From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH 3/3] libxl: update vcpus bitmap in retrieved guest config Date: Tue, 7 Jun 2016 18:22:27 +0200 Message-ID: <1465316547.15816.167.camel@citrix.com> References: <1465298642-5356-1-git-send-email-wei.liu2@citrix.com> <1465298642-5356-4-git-send-email-wei.liu2@citrix.com> <20160607144529.GL1184@perard.uk.xensource.com> <20160607160307.GN25922@citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0310944479219433599==" Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bAJly-0005z6-Gd for xen-devel@lists.xenproject.org; Tue, 07 Jun 2016 16:22:34 +0000 In-Reply-To: <20160607160307.GN25922@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" To: Wei Liu , Anthony PERARD Cc: Xen-devel , Stefano Stabellini , Ian Jackson , Jan Beulich List-Id: xen-devel@lists.xenproject.org --===============0310944479219433599== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="=-3wUkRbELaeJaJJPi1RVI" --=-3wUkRbELaeJaJJPi1RVI Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, 2016-06-07 at 17:03 +0100, Wei Liu wrote: > On Tue, Jun 07, 2016 at 03:45:29PM +0100, Anthony PERARD wrote: > >=C2=A0 > > > --- a/tools/libxl/libxl.c > > > +++ b/tools/libxl/libxl.c > > > @@ -7222,6 +7222,57 @@ void libxl_mac_copy(libxl_ctx *ctx, > > > libxl_mac *dst, libxl_mac *src) > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0(*dst)[i] =3D (= *src)[i]; > > > =C2=A0} > > > =C2=A0 > > > +static int libxl__update_avail_vcpus_qmp(libxl__gc *gc, uint32_t > > > domid, > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0unsigned int max_vcpus, > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0libxl_bitmap *map) > > > +{ > > > +=C2=A0=C2=A0=C2=A0=C2=A0unsigned int count, i; > > > +=C2=A0=C2=A0=C2=A0=C2=A0int rc; > > > + > > > +=C2=A0=C2=A0=C2=A0=C2=A0/* For QEMU upstream we always need to retur= n the number > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0* of cpus present to QEMU whether they= are online or not; > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0* otherwise QEMU won't accept the save= d state. > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0*/ > > > +=C2=A0=C2=A0=C2=A0=C2=A0rc =3D libxl__qmp_query_cpus(gc, domid, &cou= nt); > > > +=C2=A0=C2=A0=C2=A0=C2=A0if (rc) { > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0LOG(ERROR, "fail to = get number of cpus for domain %d", > > > domid); > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0goto out; > > > +=C2=A0=C2=A0=C2=A0=C2=A0} > > > + > > > +=C2=A0=C2=A0=C2=A0=C2=A0for (i =3D 0; i < count; i++) > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0libxl_bitmap_set(map= , i); > > What if I have cpu 1, 7 and 42 online, but all the other offline? > >=20 > I have more or less the same question when I wrote this patch. At > that > time I thought the avail_vcpus was only used for generating -smp > option > to QEMU. >=20 > In your example, you will have -smp 3,maxvcpus=3D$Y. I think the > migration > should still succeed. Furthermore, the cpu-add operation doesn't > care, > so it probably won't have visible effect. >=20 > I agree it would be good to set the exact bits though -- if you can > tell > me which field to test.=C2=A0 >=20 Perhaps at least mention something about all this either in a comment or in the changelog? Regards, Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-3wUkRbELaeJaJJPi1RVI 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 iQIcBAABCAAGBQJXVvTEAAoJEBZCeImluHPu84oQANTuDB04IaYw4L97Rga5z+Iw e1coKSBJNyywgP46hr9e2M7Q/16WzvKNhTjoupQ+KYYELZD8auWKx4pwyiWRQIV8 zM08Z9SUQG5Rsm+RzrjZBA8ORgjsrtHduaqkIfG1R7AoVpRmtzaSMmak7FvmrKwM +p4onkHDQ7hIWTkuDs+/SQ4gTOOaRqjx5uI3y5PVPbhCW/ZTqd+woOrmNwguqgQu 6zn4ZVWu5RIoeyYc0umBM+ubqEyK9XW0VHd5GysvsVB/oYZfOvse3/1oDe3NeE0o C7633q2qmXICTNRZ2q9iMBdSURd355yHl4Oj4IPlvLm3asNutQHE6O/n84kLbpcH nnYzQ7vKOx6JUz6W23I16Xts8nyYpCbDo7rjbFPtDiNYRznHCwTPP4y6My7TjGht VNvMmcxcFXm9MhhaeEUV1YiqQzvQO2hR99y0ZeXiNo61MsilQF2AdLxwrzGywslo 5VMBdUNL7lzn8VzkGNkEriCjswmLWl8bk0ESQHrvqUNCySBCQ+7mR7rd1cS+pjJG zOp8b6yN7DQSLqLGttsqLVgDL+Ah+1RABuo1sm9XjTIDPVddOEO0RM+FJ9wGEGXl TOjH8i++95et9Km1dasSARjPiqunZrBBse/4GVS64HZM92SqbgnZWgWpFKC2dpGP vkPLtB/5IbeqqdrgwLZf =EesI -----END PGP SIGNATURE----- --=-3wUkRbELaeJaJJPi1RVI-- --===============0310944479219433599== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwOi8vbGlzdHMueGVuLm9y Zy94ZW4tZGV2ZWwK --===============0310944479219433599==--