From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60662) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zljam-0006CB-RB for qemu-devel@nongnu.org; Mon, 12 Oct 2015 16:21:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zljai-00084v-FK for qemu-devel@nongnu.org; Mon, 12 Oct 2015 16:21:08 -0400 References: <3cad1f87e0ee00374ee40c0c744456dc86e5b35f.1444640617.git.berto@igalia.com> From: Max Reitz Message-ID: <561C162A.80303@redhat.com> Date: Mon, 12 Oct 2015 22:20:58 +0200 MIME-Version: 1.0 In-Reply-To: <3cad1f87e0ee00374ee40c0c744456dc86e5b35f.1444640617.git.berto@igalia.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ouGqoERgCGKGrmlbtEFSbKKCIweWIF9M4" Subject: Re: [Qemu-devel] [PATCH v7 1/5] block: check for existing device IDs in external_snapshot_prepare() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alberto Garcia , qemu-devel@nongnu.org Cc: Kevin Wolf , Stefan Hajnoczi , qemu-block@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --ouGqoERgCGKGrmlbtEFSbKKCIweWIF9M4 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable On 12.10.2015 11:16, Alberto Garcia wrote: > The 'snapshot-node-name' parameter of blockdev-snapshot-sync allows > setting the node name of the image that is going to be created. >=20 > Before creating the image, external_snapshot_prepare() checks that the > name is not already being used. The check is however incomplete since > it only considers existing node names, but node names must not clash > with device IDs either because they share the same namespace. >=20 > If the user attempts to create a snapshot using the name of an > existing device for the 'snapshot-node-name' parameter the operation > will eventually fail, but only after the new image has been created. >=20 > This patch replaces bdrv_find_node() with bdrv_lookup_bs() to extend > the check to existing device IDs, and thus detect possible name > clashes before the new image is created. >=20 > Signed-off-by: Alberto Garcia > --- > blockdev.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) Reviewed-by: Max Reitz --ouGqoERgCGKGrmlbtEFSbKKCIweWIF9M4 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 iQEcBAEBCAAGBQJWHBYqAAoJEDuxQgLoOKytbUEH/iofDs0R3Xm099AW2Rgw1iNY KxFo1J5ThEz9cC81NDiIPS82w3PV397NSty3xnJpiirHh8TovM+w4DCdVOF5tH9H gvVJkyOC9wovOm/iKow8Ev/hTDjrIOEx1n638m08Hf69WA62nVK/ybzjkL6S5IwN p00XiMraOkZgsXbeR9IxmZktlW+IUTZt30ntZZBQCo3023M71iJf0Vh5Fle8obGs 7xokPUJLEt1Sc6wO5jsXyDJBwb9y/pxrTHT+eHHLrn9Eoj29aHp8SNd37/UNWJ9G JSpz0pqaXExg+uln8PD3LxtETw4GFYEHRO50tqJyRT/KQOntj82aaIf9aqTyGrE= =nuIW -----END PGP SIGNATURE----- --ouGqoERgCGKGrmlbtEFSbKKCIweWIF9M4--