From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60064) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1wFv-0001dn-NU for qemu-devel@nongnu.org; Tue, 01 Jul 2014 07:29:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X1wFp-0003Gh-Ix for qemu-devel@nongnu.org; Tue, 01 Jul 2014 07:29:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38318) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1wFp-0003GY-AK for qemu-devel@nongnu.org; Tue, 01 Jul 2014 07:29:41 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s61BTdMR023080 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 1 Jul 2014 07:29:40 -0400 Message-ID: <53B29BA0.4080603@redhat.com> Date: Tue, 01 Jul 2014 13:29:36 +0200 From: Max Reitz MIME-Version: 1.0 References: <1402986730-25642-1-git-send-email-famz@redhat.com> <1402986730-25642-7-git-send-email-famz@redhat.com> In-Reply-To: <1402986730-25642-7-git-send-email-famz@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 6/7] virtio-blk: Unify {non-, }dataplane's request handlings List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng , qemu-devel@nongnu.org Cc: Kevin Wolf , Paolo Bonzini , Stefan Hajnoczi On 17.06.2014 08:32, Fam Zheng wrote: > This drops request handling code from dataplane, and uses code from > hw/block/virtio-blk.c. > > It starts to use multiwrite as non-dataplane does. > > Dataplane sets VirtIOBlock.complete_request to vring version, and calls > into non-dataplane's process handling. In complete_request_early, > qiov.size is added to vring push length, because it's also called in rw > completion now. > > Signed-off-by: Fam Zheng > --- > hw/block/dataplane/virtio-blk.c | 183 +++++----------------------------------- > 1 file changed, 19 insertions(+), 164 deletions(-) Is it intended that qemu segfaults after this commit with x-data-plane=on? $ ./qemu-img create -f qcow2 test.qcow2 64M $ x86_64-softmmu/qemu-system-x86_64 -drive if=none,file=test.qcow2,id=drv0 -device virtio-blk-pci,drive=drv0,x-data-plane=on [1] 4604 segmentation fault x86_64-softmmu/qemu-system-x86_64 -drive if=none,file=test.qcow2,id=drv0 Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7fffd75ff700 (LWP 5217)] 0x00005555556373af in virtio_blk_rw_complete (opaque=0x5555565ff5e0, ret=0) at hw/block/virtio-blk.c:99 99 bdrv_acct_done(req->dev->bs, &req->acct); (gdb) print req $1 = (VirtIOBlockReq *) 0x5555565ff5e0 (gdb) print req->dev $2 = (VirtIOBlock *) 0x0 (gdb) bt #0 0x00005555556373af in virtio_blk_rw_complete (opaque=0x5555565ff5e0, ret=0) at hw/block/virtio-blk.c:99 #1 0x0000555555840ebe in bdrv_co_em_bh (opaque=0x5555566152d0) at block.c:4675 #2 0x000055555583de77 in aio_bh_poll (ctx=ctx@entry=0x5555563a8150) at async.c:81 #3 0x000055555584b7a7 in aio_poll (ctx=0x5555563a8150, blocking=blocking@entry=true) at aio-posix.c:188 #4 0x00005555556e520e in iothread_run (opaque=0x5555563a7fd8) at iothread.c:41 #5 0x00007ffff42ba124 in start_thread () from /usr/lib/libpthread.so.0 #6 0x00007ffff16d14bd in clone () from /usr/lib/libc.so.6 Max