From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52448) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xmiy7-0004dI-VE for qemu-devel@nongnu.org; Fri, 07 Nov 2014 07:48:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xmiy2-0003vx-V3 for qemu-devel@nongnu.org; Fri, 07 Nov 2014 07:48:47 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46706) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xmiy2-0003vq-NC for qemu-devel@nongnu.org; Fri, 07 Nov 2014 07:48:42 -0500 Message-ID: <545CBF9D.5060006@redhat.com> Date: Fri, 07 Nov 2014 13:48:29 +0100 From: Eric Blake MIME-Version: 1.0 References: <1414639364-4499-1-git-send-email-famz@redhat.com> <1414639364-4499-2-git-send-email-famz@redhat.com> In-Reply-To: <1414639364-4499-2-git-send-email-famz@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="uccarmomCeIdwERXIp51PUAVcV70P9Cj6" Subject: Re: [Qemu-devel] [PATCH v6 01/10] qapi: Add optional field "name" to block dirty bitmap List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng , qemu-devel@nongnu.org Cc: Kevin Wolf , Benoit Canet , John Snow , Markus Armbruster , Max Reitz , Stefan Hajnoczi , Jd , Paolo Bonzini , Luiz Capitulino , Vladimir Sementsov-Ogievskij This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --uccarmomCeIdwERXIp51PUAVcV70P9Cj6 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 10/30/2014 04:22 AM, Fam Zheng wrote: > This field will be set for user created dirty bitmap. Also pass in an > error pointer to bdrv_create_dirty_bitmap, so when a name is already > taken on this BDS, it can report an error message. This is not global > check, two BDSes can have dirty bitmap with a common name. >=20 > Implemented bdrv_find_dirty_bitmap to find a dirty bitmap by name, will= > be used later when other QMP commands want to reference dirty bitmap by= > name. >=20 > Add bdrv_dirty_bitmap_make_anon. This unsets the name of dirty bitmap. >=20 > Signed-off-by: Fam Zheng > --- > @@ -5278,6 +5304,9 @@ BdrvDirtyBitmap *bdrv_create_dirty_bitmap(BlockDr= iverState *bs, int granularity, > } > bitmap =3D g_new0(BdrvDirtyBitmap, 1); > bitmap->bitmap =3D hbitmap_alloc(bitmap_size, ffs(granularity) - 1= ); > + if (name) { > + bitmap->name =3D g_strdup(name); > + } No need for the 'if (name)' (g_strdup(NULL) does the right thing). > @@ -5307,6 +5337,8 @@ BlockDirtyInfoList *bdrv_query_dirty_bitmaps(Bloc= kDriverState *bs) > info->count =3D bdrv_get_dirty_count(bs, bm); > info->granularity =3D > ((int64_t) BDRV_SECTOR_SIZE << hbitmap_granularity(bm->bit= map)); > + info->has_name =3D !!bm->name; > + info->name =3D info->has_name ? g_strdup(bm->name) : NULL; And again. With those two changes, Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --uccarmomCeIdwERXIp51PUAVcV70P9Cj6 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 iQEcBAEBCAAGBQJUXL+dAAoJEKeha0olJ0NqinYH/RvcUN3T5U5E5uN9Ffs9Svo3 d2lVoeh7dXK2Qb7OlyQ7tHahm1CovOaacYCMlgMAYvYZno6Vw8RstJgRgIKCFTIb kgVRiVFaTiXUxAuonOCJvaHMK5L9949cS/qgPaWW/gHBHCWS8JF5QToYSnrPNfpn /4TP0JJeWboSZWyRYVXCEgxUVHza/2v7ytYg/L492iTrsJT6RUgKSOQEas7JH+ZF jK84KbBc+NWDdBw9gGV8bjGo30gP8uVswAOswtEnYxFboJxlFwWKf7zXquz2Bbyi TIPVVuYN4TYjZqWW/50u+2G4FpZpsWh4F2/iNSt279RxDPnN/wYjuf1vVQqPBmI= =9iYW -----END PGP SIGNATURE----- --uccarmomCeIdwERXIp51PUAVcV70P9Cj6--