From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH for-xen-4.5] libxl: Allow copying smaller bitmap into a larger one Date: Fri, 21 Nov 2014 11:26:25 +0000 Message-ID: <1416569185.20516.8.camel@Abyss> References: <1416518854-5284-1-git-send-email-boris.ostrovsky@oracle.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6505362266485923778==" Return-path: In-Reply-To: <1416518854-5284-1-git-send-email-boris.ostrovsky@oracle.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Boris Ostrovsky Cc: wei.liu2@citrix.com, xen-devel@lists.xen.org, ian.jackson@eu.citrix.com, ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com List-Id: xen-devel@lists.xenproject.org --===============6505362266485923778== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-Sl7hztBN5p6xVS4QEL3F" --=-Sl7hztBN5p6xVS4QEL3F Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, 2014-11-20 at 16:27 -0500, Boris Ostrovsky wrote: > diff --git a/tools/libxl/libxl_utils.c b/tools/libxl/libxl_utils.c > index 58df4f3..2a08bef 100644 > --- a/tools/libxl/libxl_utils.c > +++ b/tools/libxl/libxl_utils.c > @@ -614,6 +614,13 @@ void libxl_bitmap_copy(libxl_ctx *ctx, libxl_bitmap = *dptr, > memcpy(dptr->map, sptr->map, sz * sizeof(*dptr->map)); > } > =20 > +void libxl_bitmap_copy_partial(libxl_ctx *ctx, libxl_bitmap *dptr, > + const libxl_bitmap *sptr) > +{ > + assert(dptr->size >=3D sptr->size); > + memcpy(dptr->map, sptr->map, sptr->size * sizeof(*dptr->map)); > +} > + Looking at other callers of libxl_bitmap_copy(), I think something like this makes sense for pretty much all of them. And even abstracting from them, and thinking to how a function like 'libxl_bitmap_copy()' this should behave, copying only the "common part" makes sense to me. So, should we make libxl_bitmap_copy() behave like implemented above, rather than introducing a new function. I know this is public stable API, but I think this is a fine behavioral change, isn't it? Regards, Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-Sl7hztBN5p6xVS4QEL3F Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEABECAAYFAlRvIWEACgkQk4XaBE3IOsTgXgCeLdrlytQQWoLy9M8+g5v+HPDa UrYAoKzTvsYypeHTad0BXHiylTgsLP2x =Fdax -----END PGP SIGNATURE----- --=-Sl7hztBN5p6xVS4QEL3F-- --===============6505362266485923778== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --===============6505362266485923778==--