From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58019) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X7UZ0-0005sX-RB for qemu-devel@nongnu.org; Wed, 16 Jul 2014 15:08:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X7UYu-000709-MM for qemu-devel@nongnu.org; Wed, 16 Jul 2014 15:08:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:65238) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X7UYu-0006zx-Ab for qemu-devel@nongnu.org; Wed, 16 Jul 2014 15:08:20 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s6GJ8J3r010602 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 16 Jul 2014 15:08:19 -0400 Date: Wed, 16 Jul 2014 21:08:17 +0200 From: Kevin Wolf Message-ID: <20140716190817.GC8802@noname.redhat.com> References: <1405525697-9378-1-git-send-email-kwolf@redhat.com> <1405525697-9378-2-git-send-email-kwolf@redhat.com> <53C6BF4A.6010309@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="fUYQa+Pmc3FrFX/N" Content-Disposition: inline In-Reply-To: <53C6BF4A.6010309@redhat.com> Subject: Re: [Qemu-devel] [PATCH 1/2] block: Add Error argument to bdrv_refresh_limits() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: qemu-devel@nongnu.org, stefanha@redhat.com --fUYQa+Pmc3FrFX/N Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Am 16.07.2014 um 20:07 hat Eric Blake geschrieben: > On 07/16/2014 09:48 AM, Kevin Wolf wrote: > > @@ -1154,7 +1167,7 @@ void bdrv_set_backing_hd(BlockDriverState *bs, Bl= ockDriverState *backing_hd) > > bdrv_op_unblock(bs->backing_hd, BLOCK_OP_TYPE_COMMIT, > > bs->backing_blocker); > > out: > > - bdrv_refresh_limits(bs); > > + bdrv_refresh_limits(bs, NULL); > > } > > =20 > > /* > > @@ -1778,7 +1791,7 @@ void bdrv_reopen_commit(BDRVReopenState *reopen_s= tate) > > BDRV_O_CACHE_WB); > > reopen_state->bs->read_only =3D !(reopen_state->flags & BDRV_O_RDW= R); > > =20 > > - bdrv_refresh_limits(reopen_state->bs); > > + bdrv_refresh_limits(reopen_state->bs, NULL); >=20 > > +++ b/block/stream.c > > @@ -76,7 +76,7 @@ static void close_unused_images(BlockDriverState *top= , BlockDriverState *base, > > bdrv_unref(unused); > > } > > =20 > > - bdrv_refresh_limits(top); > > + bdrv_refresh_limits(top, NULL); > > } > > =20 >=20 > Should these three callers be concerned about failure? If so, would > &error_abort be better than NULL? But as for this patch, you are > preserving existing semantics, so you could save it for a later patch. They probably should, but I couldn't figure out what they should to on failure. Aborting qemu because a single block device fails isn't nice. &error_abort has similar semantics as assert() for me ("This can't ever happen"), and this is definitely not the case here as I/O errors can happen anytime. If anything, it's similar to a qcow2 image that has detected corruption and therefore made the BDS unusable. But setting bs->drv =3D NULL within a single block driver is already tricky (and so it was buggy at first), doing it in block.c with BDSes of any driver sounds even worse. This is the reason why I kept NULL here, even if it's not completely right. Kevin --fUYQa+Pmc3FrFX/N Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAgAGBQJTxs2hAAoJEH8JsnLIjy/WhK4P+gKR0DDpiAxXO+n7jiIjr87a /hYDYMtRSInYnAklL3Vwkwpo8o1IshM1bXTeqNBX0XTUdLfAwqv4xklZGucUB2tV vv9A4PFaazcG3ec2C9Y0/nXDLD64PgvoKsSlfidEl/dYA9LNsYQVjCf4sa90tZbi Xck2kzybo19oqfk6gPNAYKcbD0sYS8wrX5tT08wtjCT1CEzSBjIfAY5tad64pjpx 4ZfQ2kQWRCpMmiWCoIQNOPVGVinFZn2Jmde2oJpgHFiMBPXJi5wZOfSYZERzxUuq a0m4dHpJKuuce/Z+jxC5uNpK2EDGBE4foNrNDXE7U4AavHHn3Pch+JQNjVo0LMX0 q2Sy005maKqQ5DM1LsU864IPw5f7KSKgj3YUUEUP4Igg1PlHMqXX3p4JAlUhkVR3 J1+E8tilT8hdFPxKM0KXWINvIEJSAuqbkKhw22VlpOHZsQ4XiVw1iK++vlMrf3wP dTDmfuo0478pajFtnJZwW2rmwsuFtK/PqROiv6M+zRtHI5chPainzbCXkktF/SJ0 u4PkkjFtaSRuX280yvimY2DQ/aByM1DLSUEtSgQxCMRXEc1oEpcfouYPT/wae3ZS +MUpVplCyeAziflaM+wJfXl8R55P+2Jd+UHsZDjQ+/XMCGVlP1X5OJoyZkHW7Goz 3JlRxny8PKGP5lTk8p1p =fspp -----END PGP SIGNATURE----- --fUYQa+Pmc3FrFX/N--