From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38244) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yqgi9-0006ug-5P for qemu-devel@nongnu.org; Fri, 08 May 2015 07:44:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yqgi7-0007Go-W7 for qemu-devel@nongnu.org; Fri, 08 May 2015 07:44:57 -0400 Message-ID: <554CA1AD.7090505@redhat.com> Date: Fri, 08 May 2015 13:44:45 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1431085109-19677-1-git-send-email-dimara@arrikto.com> <1431085109-19677-2-git-send-email-dimara@arrikto.com> In-Reply-To: <1431085109-19677-2-git-send-email-dimara@arrikto.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/4] Fix migration in case of scsi-generic List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Dimitris Aragiorgis , qemu-devel@nongnu.org Cc: kwolf@redhat.com, stefanha@redhat.com, qemu-block@nongnu.org On 08/05/2015 13:38, Dimitris Aragiorgis wrote: > During migration, QEMU uses fsync()/fdatasync() on the open file > descriptor for read-write block devices to flush data just before > stopping the VM. > > However, fsync() on a scsi-generic device returns -EINVAL which > causes the migration to fail. This patch skips flushing data in case > of an SG device, since submitting SCSI commands directly via an SG > character device (e.g. /dev/sg0) bypasses the page cache completely, > anyway. Good catch! The patch is correct, but please remove the same test from iscsi_co_flush (in block/iscsi.c) because it's now duplicate. Thanks, Paolo > Signed-off-by: Dimitris Aragiorgis > --- > block/io.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/block/io.c b/block/io.c > index 1ce62c4..d248a4d 100644 > --- a/block/io.c > +++ b/block/io.c > @@ -2231,7 +2231,7 @@ int coroutine_fn bdrv_co_flush(BlockDriverState *bs) > { > int ret; > > - if (!bs || !bdrv_is_inserted(bs) || bdrv_is_read_only(bs)) { > + if (!bs || !bdrv_is_inserted(bs) || bdrv_is_read_only(bs) || bdrv_is_sg(bs)) { > return 0; > } > >