From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59980) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQG4z-0006hX-Jc for qemu-devel@nongnu.org; Tue, 24 Feb 2015 09:03:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YQG4u-0008N4-U5 for qemu-devel@nongnu.org; Tue, 24 Feb 2015 09:03:17 -0500 Received: from mx1.redhat.com ([209.132.183.28]:60906) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQG4u-0008Mx-Lg for qemu-devel@nongnu.org; Tue, 24 Feb 2015 09:03:12 -0500 Message-ID: <54EC849C.4000400@redhat.com> Date: Tue, 24 Feb 2015 09:03:08 -0500 From: Max Reitz MIME-Version: 1.0 References: <1424732339-11237-1-git-send-email-mreitz@redhat.com> <87bnkjlk4h.fsf@blackfin.pond.sub.org> In-Reply-To: <87bnkjlk4h.fsf@blackfin.pond.sub.org> Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] virtio-scsi: Allocate op blocker reason before blocking List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: Paolo Bonzini , qemu-devel@nongnu.org, Anthony Liguori , "Michael S. Tsirkin" On 2015-02-24 at 04:43, Markus Armbruster wrote: > Max Reitz writes: > >> s->blocker is really only used in hw/scsi/virtio-scsi.c; the only places >> where it is used in hw/scsi/virtio-scsi-dataplane.c is when it is >> allocated and when it is freed. That does not make a whole lot of sense >> (and is actually wrong because this leads to s->blocker potentially >> being NULL when blk_op_block_all() is called in virtio-scsi.c), so move >> the allocation and destruction of s->blocker to blk_op_block_all() and >> blk_op_unblock_all() in virtio-scsi.c, respectively. >> >> Signed-off-by: Max Reitz >> --- >> Try: >> >> $ echo -e 'eject drv\nquit' | \ >> x86_64-softmmu/qemu-system-x86_64 \ >> -monitor stdio -machine accel=qtest -display none \ >> -object iothread,id=thr -device virtio-scsi-pci,iothread=thr \ >> -drive if=none,file=test.qcow2,format=qcow2,id=drv \ >> -device scsi-cd,drive=drv >> >> What it should do: >> >> QEMU 2.2.50 monitor - type 'help' for more information >> (qemu) eject drv >> Device 'drv' is busy: block device is in use by data plane >> (qemu) quit >> >> What it should not do: >> >> QEMU 2.2.50 monitor - type 'help' for more information >> (qemu) eject drv >> [1] 10102 done >> 10103 segmentation fault (core dumped) > Why do you put your nice reproducer below the --- divider? I rather > like bug fixing commits come with reproducers in the commit message. > > [...] Because then I'm afraid that Eric complains because I used echo -e instead of printf. Seriously speaking, I don't mind putting it into the commit message. I'll wait for reviews on the change itself, and then either send a v2 with the reproducer included in the commit message or hope for a maintainer to fix it up himself (which I'd be totally fine with *hint hint*). Max