From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH] libxl: use LIBXL_API_VERSION 0x040200 Date: Thu, 14 Apr 2016 14:55:57 +0200 Message-ID: <1460638557.13871.161.camel__15087.5884028666$1460638663$gmane$org@citrix.com> References: <1460590625-3805-1-git-send-email-jfehlig@suse.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3370274549891978208==" Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" To: George Dunlap , Jim Fehlig Cc: LibVirt Development List , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org --===============3370274549891978208== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-hTcKwmWFBPKzhbrV/7vH" --=-hTcKwmWFBPKzhbrV/7vH Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, 2016-04-14 at 09:33 +0100, George Dunlap wrote: > On Thu, Apr 14, 2016 at 12:37 AM, Jim Fehlig > wrote: > >=C2=A0 > > diff --git a/src/libxl/libxl_conf.h b/src/libxl/libxl_conf.h > > index 3c0eafb..24e2911 100644 > > --- a/src/libxl/libxl_conf.h > > +++ b/src/libxl/libxl_conf.h > > @@ -69,18 +69,6 @@ > > =C2=A0# endif > >=20 > >=20 > > -/* libxl interface for setting VCPU affinity changed in 4.5. In > > fact, a new > > - * parameter has been added, representative of 'VCPU soft > > affinity'. If one > > - * does not care about it (and that's libvirt case), passing NULL > > is the > > - * right thing to do. To mark that change, > > LIBXL_HAVE_VCPUINFO_SOFT_AFFINITY > > - * is defined. */ > > -# ifdef LIBXL_HAVE_VCPUINFO_SOFT_AFFINITY > > -#=C2=A0=C2=A0define libxl_set_vcpuaffinity(ctx, domid, vcpuid, map) \ > > -=C2=A0=C2=A0=C2=A0=C2=A0libxl_set_vcpuaffinity((ctx), (domid), (vcpuid= ), (map), NULL) > > -#=C2=A0=C2=A0define libxl_set_vcpuaffinity_all(ctx, domid, max_vcpus, = map) \ > > -=C2=A0=C2=A0=C2=A0=C2=A0libxl_set_vcpuaffinity_all((ctx), (domid), (ma= x_vcpus), (map), > > NULL) > > -# endif > Just checking with this -- the LIBXL_API_VERSION is meant for > *forward* compatibility, but I think the LIBXL_HAVE_* macros are for > *backwards* compatibility, isn't that right?=C2=A0=C2=A0If you compile th= is > against an older version of Xen without LIBXL_HAVE_VCPU_SOFT_AFFINITY > (say, 4.4), will it break with this patch? >=20 Err... I'm not good at this things, but I don't think it will break. So, libxl_set_vcpuaffinity(ctx,d,v,map,map) was defined in Xen 4.5. Xen 4.4 only has libxl_set_vcpuaffinity(ctx,d,v,map). Libvirt only uses libxl_set_vcpuaffinity(ctx,d,v,map) (i.e., the latter =3D=3D the older one). On anything below Xen 4.5 --which also means LIBXL_HAVE_VCPU_SOFT_AFFINITY is not defined-- the variant with only one map parameter is available, and therefore things should build and work. For anything above Xen 4.5 _and_ with LIBXL_API_VERSION<4.5 (which would be the case, with this patch), libxl.h provides the stub for the variant with only one map argument, so everything should again be fine. Or am I missing something? Perhaps, the point is that the hunk being removed above should really have been using LIBXL_API_VERSION already, rather than LIBXL_HAVE_VCPUINFO_SOFT_AFFINITY. But, at the time, as far as I can recall, libvirt was not setting LIBXL_API_VERSION to anything, and doing that was not considered necessary. Therefore I did use LIBXL_HAVE_VCPUINFO_SOFT_AFFINITY for the check, which is always present, starting from Xen 4.5 (or never present, before that). Regards, Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-hTcKwmWFBPKzhbrV/7vH 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 iEYEABECAAYFAlcPk10ACgkQk4XaBE3IOsS3UwCghJrndxf2sx8dDfk4Kk5YpI+r Ic4AoJYQROgw5wuCGMieNAKZ5QzUkS71 =4sLq -----END PGP SIGNATURE----- --=-hTcKwmWFBPKzhbrV/7vH-- --===============3370274549891978208== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwOi8vbGlzdHMueGVuLm9y Zy94ZW4tZGV2ZWwK --===============3370274549891978208==--