Received: from eggs.gnu.org ([2001:4830:134:3::10]:37676) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5vL1-0007L4-MB for qemu-devel@nongnu.org; Fri, 19 Jun 2015 08:24:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z5vL0-0007yh-Pi for qemu-devel@nongnu.org; Fri, 19 Jun 2015 08:24:03 -0400 Date: Fri, 19 Jun 2015 13:23:53 +0100 From: Stefan Hajnoczi Message-ID: <20150619122353.GH11189@stefanha-thinkpad.redhat.com> References: <1432115859-11413-1-git-send-email-dimara@arrikto.com> <1432115859-11413-3-git-send-email-dimara@arrikto.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ZYOWEO2dMm2Af3e3" Content-Disposition: inline In-Reply-To: <1432115859-11413-3-git-send-email-dimara@arrikto.com> Subject: Re: [Qemu-devel] [PATCH v4 2/5] Fix migration in case of scsi-generic List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Dimitris Aragiorgis Cc: kwolf@redhat.com, pbonzini@redhat.com, qemu-devel@nongnu.org, qemu-block@nongnu.org --ZYOWEO2dMm2Af3e3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 20, 2015 at 12:57:36PM +0300, 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. >=20 > 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. >=20 > Note that fsync() not only flushes the page cache but also the disk > cache. The scsi-generic device never sends flushes, and for > migration it assumes that the same SCSI device is used by the > destination host, so it does not issue any SCSI SYNCHRONIZE CACHE > (10) command. >=20 > Finally, remove the bdrv_is_sg() test from iscsi_co_flush() since > this is now redundant (we flush the underlying protocol at the end > of bdrv_co_flush() which, with this patch, we never reach). >=20 > Signed-off-by: Dimitris Aragiorgis > --- > block/io.c | 3 ++- > block/iscsi.c | 4 ---- > 2 files changed, 2 insertions(+), 5 deletions(-) Reviewed-by: Stefan Hajnoczi --ZYOWEO2dMm2Af3e3 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVhAnZAAoJEJykq7OBq3PIuBYH/2MDCpsXeI76P/bgkyMk8KeT OAWrmes+REIGB4ZmVmniVsOABccs59sklbehSD+rjqV2Ju84KaOj0ZUJLPls0KI2 RAr6pfWmnwQJOLpN/VgJ/gI9xwDAkarD/LSsOdw4HYQ7HwDGv76bo7ZeQSV3prvi fbmGj5fbKLU6DOexi92uzE9D89eWkf/34XQh4tEYcTDn2IkqV6gKpsPH70T9jdG/ XvL/GS3ZXak88PftxtLli8B5TPru5CDfBJou9YNysQ5oJGtaKdLsBTf/doRxgHja 3nyqqP9stUjUpEw2CdoDd00mlX9w/q4qhd6ebmlkYe9bv/fiQB7WaDNUl5n/90A= =Sr76 -----END PGP SIGNATURE----- --ZYOWEO2dMm2Af3e3--