From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41263) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGysN-0002Pw-PL for qemu-devel@nongnu.org; Thu, 29 Jan 2015 18:51:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YGysK-00011d-CR for qemu-devel@nongnu.org; Thu, 29 Jan 2015 18:51:55 -0500 Received: from mx1.redhat.com ([209.132.183.28]:44770) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGysK-00011E-4L for qemu-devel@nongnu.org; Thu, 29 Jan 2015 18:51:52 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t0TNppKd003370 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 29 Jan 2015 18:51:51 -0500 Message-ID: <54CAC796.8020305@redhat.com> Date: Thu, 29 Jan 2015 16:51:50 -0700 From: Eric Blake MIME-Version: 1.0 References: <1422300468-16216-1-git-send-email-mreitz@redhat.com> <1422300468-16216-10-git-send-email-mreitz@redhat.com> In-Reply-To: <1422300468-16216-10-git-send-email-mreitz@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="0qoScok0en8NGF5xLrlrwed0c83sTuUrt" Subject: Re: [Qemu-devel] [PATCH 09/21] block: Add blk_name_taken() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz , qemu-devel@nongnu.org Cc: Kevin Wolf , Markus Armbruster , Stefan Hajnoczi This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --0qoScok0en8NGF5xLrlrwed0c83sTuUrt Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 01/26/2015 12:27 PM, Max Reitz wrote: > There may be BlockBackends which are not returned by blk_by_name(), but= > do exist and have a name. blk_name_taken() allows testing whether a > specific name is in use already, independent of whether the BlockBacken= d > with that name is accessible through blk_by_name(). >=20 > Signed-off-by: Max Reitz > --- > block.c | 2 +- > block/block-backend.c | 19 ++++++++++++++++++- > include/sysemu/block-backend.h | 1 + > 3 files changed, 20 insertions(+), 2 deletions(-) >=20 > diff --git a/block.c b/block.c > index 0cd6457..8eef0c5 100644 > --- a/block.c > +++ b/block.c > @@ -898,7 +898,7 @@ static void bdrv_assign_node_name(BlockDriverState = *bs, > } > =20 > /* takes care of avoiding namespaces collisions */ > - if (blk_by_name(node_name)) { > + if (blk_name_taken(node_name)) { While you are here, s/namespaces/namespace/ Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --0qoScok0en8NGF5xLrlrwed0c83sTuUrt 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/ iQEcBAEBCAAGBQJUyseWAAoJEKeha0olJ0NqGFwH/R0J2MAzHy7W63nuxNQSqr+3 MIRvZcntsnCwz3kzCCThTaZ1G/o/xF8VNYJ0kQcStXb/1skhXwHeje/TFJyy86to +FKGQYkPs61JvC6lwzyPBjqwbDfKYGV2eqLeO8hH0A7dDIE7L5QuuDRevoUoiMou R62YMxnzMNDonl+MvCd/f++iMbaHiXIhrzUPe461PTHwDt6bIUt9wnaiwc8NRwuy LuBEf0M7US00MQdtY5wVTBKW3+xtaCheRvfWj4bKFMM2kygx0WselqvKxfBy7Gbt mSF0xiJm1u4reeZfC/YAcZyIaJB00672vuVOXVt5T655lRDwkaCViz9IVWTH5A0= =jC+m -----END PGP SIGNATURE----- --0qoScok0en8NGF5xLrlrwed0c83sTuUrt--