From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39405) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c70cL-00076i-H0 for qemu-devel@nongnu.org; Wed, 16 Nov 2016 08:51:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c70cH-0002Yu-Oz for qemu-devel@nongnu.org; Wed, 16 Nov 2016 08:51:13 -0500 From: "Pavel Dovgalyuk" References: <20160926080757.6992.74311.stgit@PASHA-ISP> <20160926131721.GH6093@noname.str.redhat.com> <001101d218c8$67aa1010$36fe3030$@ru> <20160928083620.GD5236@noname.redhat.com> <001501d2196b$496b4e90$dc41ebb0$@ru> <20160928094313.GI5236@noname.redhat.com> <000001d21986$b68cd280$23a67780$@ru> <001d01d23fee$b962ec40$2c28c4c0$@ru> <681073315.13077713.1479298503298.JavaMail.zimbra@redhat.com> In-Reply-To: <681073315.13077713.1479298503298.JavaMail.zimbra@redhat.com> Date: Wed, 16 Nov 2016 16:50:58 +0300 Message-ID: <002801d24010$760d8e60$6228ab20$@ru> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Language: ru Subject: Re: [Qemu-devel] [PATCH v5 7/9] block: don't make snapshots for filters List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: 'Paolo Bonzini' Cc: 'Kevin Wolf' , 'Pavel Dovgalyuk' , qemu-devel@nongnu.org, 'peter maydell' , quintela@redhat.com, jasowang@redhat.com, mst@redhat.com, mreitz@redhat.com, qemu-block@nongnu.org > From: Paolo Bonzini [mailto:pbonzini@redhat.com] > > I've investigated this issue. > > This command line works ok: > > -drive > > driver=blkreplay,if=none,image.driver=file,image.filename=testdisk.qcow,id=img-blkreplay > > -device ide-hd,drive=img-blkreplay > > > > And this does not: > > -drive > > > driver=blkreplay,if=none,image.driver=qcow2,image.file.driver=file,image.file.filename=testdis > k.qcow > > ,id=img-blkreplay > > -device ide-hd,drive=img-blkreplay > > > > QEMU hangs at some moment of replay. > > > > I found that some dma requests do not pass through the blkreplay driver > > due to the following line in block-backend.c: > > return bdrv_co_preadv(blk->root, offset, bytes, qiov, flags); > > > > This line passes read request directly to qcow driver and blkreplay cannot > > process it to make deterministic. > > I don't understand, blk->root should be the blkreplay here. I've got some more logs. I used the disk image which references the backing file. It seems that some weird things happen with both command lines. == For the first command line (blkreplay separated from image): blk_co_preadv(img-blkreplay) -> bdrv_co_preadv(qcow2, temp_overlay1) -> bdrv_co_preadv(blkreplay, temp_overlay) -> bdrv_co_preadv(qcow2, temp_overlay2) -> bdrv_co_preadv(qcow2, image_overlay) -> bdrv_co_preadv(qcow2, image_backing) -> bdrv_co_preadv(file, image_backing) But sometimes it changes to: blk_co_preadv(img-blkreplay) -> bdrv_co_preadv(qcow2, temp_overlay1) -> bdrv_co_preadv(file, temp_overlay1) == For the second command line (blkreplay combined with image): In most cases we have the following call stack: blk_co_preadv(img-blkreplay) -> bdrv_co_preadv(qcow2, temp_overlay) -> bdrv_co_preadv(blkreplay, image_overlay) -> bdrv_co_preadv(qcow2, image_overlay) -> bdrv_co_preadv(qcow2, image_backing) -> bdrv_co_preadv(file, image_backing) But sometimes it changes to: blk_co_preadv(img-blkreplay) -> bdrv_co_preadv(qcow2, temp overlay) -> bdrv_co_preadv(file, temp overlay) ======== It seems, that temporary overlay is created over blkreplay, which it intended to work as a simple filter. Is that correct? Pavel Dovgalyuk