From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38300) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WNlGz-0002KW-Ci for qemu-devel@nongnu.org; Wed, 12 Mar 2014 11:40:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WNlGt-0002Qp-PC for qemu-devel@nongnu.org; Wed, 12 Mar 2014 11:40:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37220) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WNlGt-0002Q7-3G for qemu-devel@nongnu.org; Wed, 12 Mar 2014 11:40:43 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s2CFeeCV004930 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 12 Mar 2014 11:40:41 -0400 Message-ID: <53207FF7.8050707@redhat.com> Date: Wed, 12 Mar 2014 09:40:39 -0600 From: Eric Blake MIME-Version: 1.0 References: <1394636459-30712-1-git-send-email-kwolf@redhat.com> In-Reply-To: <1394636459-30712-1-git-send-email-kwolf@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Saxmfw0DbLxQkBbbf3M8ihRwoHobEXjEi" Subject: Re: [Qemu-devel] [PATCH] block: Add error handling to bdrv_invalidate_cache() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf , qemu-devel@nongnu.org Cc: stefanha@redhat.com, quintela@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Saxmfw0DbLxQkBbbf3M8ihRwoHobEXjEi Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 03/12/2014 09:00 AM, Kevin Wolf wrote: > If it returns an error, the migrated VM will not be started, but qemu > exits with an error message. >=20 > Signed-off-by: Kevin Wolf > --- > block.c | 28 ++++++++++++++++++++++------ > block/qcow2.c | 22 +++++++++++++++++++--- > block/qed.c | 21 ++++++++++++++++++--- > include/block/block.h | 4 ++-- > include/block/block_int.h | 2 +- > migration.c | 8 +++++++- > 6 files changed, 69 insertions(+), 16 deletions(-) >=20 > @@ -115,7 +116,12 @@ static void process_incoming_migration_co(void *op= aque) > =20 > bdrv_clear_incoming_migration_all(); > /* Make sure all file formats flush their mutable metadata */ > - bdrv_invalidate_cache_all(); > + bdrv_invalidate_cache_all(&local_err); > + if (local_err) { > + qerror_report_err(local_err); > + error_free(local_err); > + exit(EXIT_FAILURE); Freeing before exit() is wasted cpu cycles, but doesn't hurt the common case, and keeping the error_free() makes valgrind a bit happier, so I'm not opposed to leaving it as-is. Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --Saxmfw0DbLxQkBbbf3M8ihRwoHobEXjEi Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJTIH/3AAoJEKeha0olJ0NqbjwH/A9TiMNOdZYEVx1TAuDAOqQ1 fIYNdChvlGsRsG1n0sj/fGbi+ZQGxnvDAWPLz07bvhCQnv6qr7l9xWjVW6ZLDIVE JGooquxhjx7w0HMICY2e9mLS8MKICU5GJoBZyIfR4bUzIikXzI9EeYeAIQgw3C7n Cp0496vSJNsVGwBvT8VbIXhI7x32Irl1tQB+Vo4YganDb4btHCYLfeoDPABOssbZ ECNtPUtQtHx0sT1EypaQkLG4kmaF/xJZ6kwRts3bBCT2WdSd/VOKPqJKCTkkquyT hHYeqNNr1whinmdUSOr2orfx3HS7cN5oUGV3/8fJM+V0p/vrsf42ZPXq+9NcBUI= =jsC3 -----END PGP SIGNATURE----- --Saxmfw0DbLxQkBbbf3M8ihRwoHobEXjEi--