From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60806) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YwCgf-0003iA-G0 for qemu-devel@nongnu.org; Sat, 23 May 2015 12:54:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YwCga-0003Xy-Ny for qemu-devel@nongnu.org; Sat, 23 May 2015 12:54:13 -0400 Message-ID: <5560B09E.6060102@redhat.com> Date: Sat, 23 May 2015 18:53:50 +0200 From: Max Reitz MIME-Version: 1.0 References: <1432190583-10518-1-git-send-email-famz@redhat.com> <1432190583-10518-7-git-send-email-famz@redhat.com> In-Reply-To: <1432190583-10518-7-git-send-email-famz@redhat.com> Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v6 06/13] virtio-scsi-dataplane: Add "device IO" op blocker listener List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng , qemu-devel@nongnu.org Cc: Kevin Wolf , qemu-block@nongnu.org, jcody@redhat.com, armbru@redhat.com, Stefan Hajnoczi , amit.shah@redhat.com, pbonzini@redhat.com On 21.05.2015 08:42, Fam Zheng wrote: > When a disk is attached to scsi-bus, virtio_scsi_hotplug will take care > of protecting the block device with op blockers. Currently we haven't > enabled block jobs (like what's done in virtio_blk_data_plane_create), > but it is necessary to honor "device IO" op blocker first before we do. > This is useful to make sure that guest IO requests are paused during qmp > transactions (such as multi-disk snapshot or backup). > > A counter is added to the virtio-scsi device, which keeps track of > currently blocked disks. If it goes from 0 to 1, the ioeventfds are > disabled; when it goes back to 0, they are re-enabled. > > Also in device initialization, push the enabling of ioeventfds to before > return, so the virtio_scsi_clear_aio is not needed there. Rename it, > pair with an enabling variant, fix one coding style issue, then use it > in the device pause points. > > Signed-off-by: Fam Zheng > --- > hw/scsi/virtio-scsi-dataplane.c | 82 +++++++++++++++++++++++++++++++---------- > hw/scsi/virtio-scsi.c | 3 ++ > include/hw/virtio/virtio-scsi.h | 3 ++ > 3 files changed, 68 insertions(+), 20 deletions(-) Reviewed-by: Max Reitz