From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35313) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGVrG-00029z-3K for qemu-devel@nongnu.org; Wed, 28 Jan 2015 11:52:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YGVrC-0000yI-ON for qemu-devel@nongnu.org; Wed, 28 Jan 2015 11:52:50 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43568) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGVrC-0000xu-HN for qemu-devel@nongnu.org; Wed, 28 Jan 2015 11:52:46 -0500 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 t0SGqium013510 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 28 Jan 2015 11:52:45 -0500 Message-ID: <54C913DB.3060505@redhat.com> Date: Wed, 28 Jan 2015 09:52:43 -0700 From: Eric Blake MIME-Version: 1.0 References: <1422387983-32153-1-git-send-email-mreitz@redhat.com> <1422387983-32153-32-git-send-email-mreitz@redhat.com> In-Reply-To: <1422387983-32153-32-git-send-email-mreitz@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="35AJjpe8cmtjvcp5NkRAgeUWDmmv0788h" Subject: Re: [Qemu-devel] [PATCH RESEND 31/50] block: Add blk_insert_bs() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz , qemu-devel@nongnu.org Cc: Kevin Wolf , Fam Zheng , Jeff Cody , Markus Armbruster , Stefan Hajnoczi , John Snow This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --35AJjpe8cmtjvcp5NkRAgeUWDmmv0788h Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 01/27/2015 12:46 PM, Max Reitz wrote: > This function associates the given BlockDriverState with the given > BlockBackend. >=20 > Signed-off-by: Max Reitz > --- > block/block-backend.c | 16 ++++++++++++++++ > include/sysemu/block-backend.h | 1 + > 2 files changed, 17 insertions(+) >=20 > diff --git a/block/block-backend.c b/block/block-backend.c > index 760558f..656ebfc 100644 > --- a/block/block-backend.c > +++ b/block/block-backend.c > @@ -312,6 +312,22 @@ void blk_hide_on_behalf_of_do_drive_del(BlockBacke= nd *blk) > } > =20 > /* > + * Associates a new BlockDriverState with @blk. > + */ > +void blk_insert_bs(BlockBackend *blk, BlockDriverState *bs) > +{ > + if (bs->blk =3D=3D blk) { > + return; > + } > + > + assert(!blk->bs); I guess this interesting code allows for idempotent use of blk_insert_bs more than once? What situations require that usage pattern? At any rate, the new function looks fine. Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --35AJjpe8cmtjvcp5NkRAgeUWDmmv0788h 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/ iQEcBAEBCAAGBQJUyRPbAAoJEKeha0olJ0NqN5sH/jP5XVt/N59zBKPHverNih9j teYAXDda7vjuBitUncj0/vrBuBNCFKJTkb0JiRSKYtPc9zullhHbUXqL5sRLpyTc iz96uOvKksgUgMOkUAK3RoyEEKBS66lCx7g6hrEcYO+awxwt/eQNjOIYSQ+jUWUb WpYFB3AFpM1Lx2Pl/AyI7pvFQdo506/5oIrQ4/SiJIIgRLMzYLoqV0Pa4mz86deM aLkUCvsmH3HVdXeNETuDv7aWSvCkRAbxZnHpg1y1Y5sGP2uSKkPb1aldJ89RB0YK NnWDq61Yn60tdgxzz/LlM2jSZ+cSlO2jSe1RGpdI80KgDFXoC5dL0zDRajSRl88= =ePYx -----END PGP SIGNATURE----- --35AJjpe8cmtjvcp5NkRAgeUWDmmv0788h--