From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55321) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtIMV-0002ol-7b for qemu-devel@nongnu.org; Mon, 02 Nov 2015 11:53:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZtIMU-00010u-9D for qemu-devel@nongnu.org; Mon, 02 Nov 2015 11:53:39 -0500 References: <693e03976f7b27b0cafa27c2e0cac754b61cf0be.1446465949.git.berto@igalia.com> From: Max Reitz Message-ID: <56379509.3030106@redhat.com> Date: Mon, 2 Nov 2015 17:53:29 +0100 MIME-Version: 1.0 In-Reply-To: <693e03976f7b27b0cafa27c2e0cac754b61cf0be.1446465949.git.berto@igalia.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="1gT3Q0gMh6UBtOB3d03DE0ACoBP3jeiPE" Subject: Re: [Qemu-devel] [PATCH v2 1/2] block: Disallow snapshots if the overlay doesn't support backing files List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alberto Garcia , qemu-devel@nongnu.org Cc: Kevin Wolf , qemu-block@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --1gT3Q0gMh6UBtOB3d03DE0ACoBP3jeiPE Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable On 02.11.2015 13:15, Alberto Garcia wrote: > This addresses scenarios like this one: >=20 > { 'execute': 'blockdev-add', 'arguments': > { 'options': { 'driver': 'qcow2', > 'node-name': 'new0', > 'file': { 'driver': 'file', > 'filename': 'new.qcow2', > 'node-name': 'file0' } } } } >=20 > { 'execute': 'blockdev-snapshot', 'arguments': > { 'node': 'virtio0', > 'overlay': 'file0' } } >=20 > Signed-off-by: Alberto Garcia > --- > blockdev.c | 5 +++++ > 1 file changed, 5 insertions(+) >=20 > diff --git a/blockdev.c b/blockdev.c > index a567a05..2774bf5 100644 > --- a/blockdev.c > +++ b/blockdev.c > @@ -1667,6 +1667,11 @@ static void external_snapshot_prepare(BlkTransac= tionState *common, > =20 > if (state->new_bs->backing !=3D NULL) { > error_setg(errp, "The snapshot already has a backing image"); > + return; This is... > + } > + > + if (!state->new_bs->drv->supports_backing) { > + error_setg(errp, "The snapshot does not support backing images= "); =2E..why a return statement might be good here, too. With or without: Reviewed-by: Max Reitz > } > } > =20 >=20 --1gT3Q0gMh6UBtOB3d03DE0ACoBP3jeiPE Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJWN5UJAAoJEDuxQgLoOKytBMsH/3hFxSSK+gDl3XNyIBdN/Zo7 sDGmDIOIT+y7BBZKtm0+tscbaOztkmKNa9MnrM1ge6sV6ZQ1IBOsnblsvSjZUEm7 p1fPD+mzaq9WzisBAjRu4NF0ABDq+CxrgJoJvBvEexlXtoznceYcjVnjvJLuG905 LlxnvIQqhLeMpZdSNz2a9JKd60vvVFSVPjh6eAMMSa/Pb3d5Mb6++oOIcBkKgbIZ jFt3cU3ECgMNlz7hwc2wa7hhWFh+bPVjTbRRu1dqLYJVo8TXbNHRXm/zE0igOhlG 9sjij0YjXyGc5r3TEnqdXnQIsug3Q0MKSrel5QsrwPAG6adOtSDRjlmtlslvzXs= =poqg -----END PGP SIGNATURE----- --1gT3Q0gMh6UBtOB3d03DE0ACoBP3jeiPE--