From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Bader Subject: Re: [libvirt] [Xen-devel] [PATCH] libxl: Correctly initialize vcpu bitmap Date: Tue, 23 Jul 2013 09:08:40 +0200 Message-ID: <51EE2BF8.9090302@canonical.com> References: <1374490265-2019-1-git-send-email-stefan.bader@canonical.com> <20130722193959.GQ30300@phenom.dumpdata.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5737143757386161577==" Return-path: In-Reply-To: <20130722193959.GQ30300@phenom.dumpdata.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com To: Konrad Rzeszutek Wilk Cc: libvir-list@redhat.com, xen-devel@lists.xensource.com, Ian Campbell List-Id: xen-devel@lists.xenproject.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --===============5737143757386161577== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="------------enig2054CE1AE7755004203B2434" This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig2054CE1AE7755004203B2434 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 22.07.2013 21:39, Konrad Rzeszutek Wilk wrote: > On Mon, Jul 22, 2013 at 12:51:05PM +0200, Stefan Bader wrote: >> This fixes the basic setup but there is likely more to do if things >> like manual CPU hirarchy (nodes, cores, threads) to be working. >> >> Cross-posting to xen-devel to make sure I am doing things correctly. >> >> -Stefan >> >> >> >From 1ec5e7ea0d3498b9f61b83e8aed87cc3cae106de Mon Sep 17 00:00:00 200= 1 >> From: Stefan Bader >> Date: Fri, 19 Jul 2013 15:20:00 +0200 >> Subject: [PATCH] libxl: Correctly initialize vcpu bitmap >> >> The avai_vcpu bitmap has to be allocated before it can be used (using >=20 > avail_vcpu ? *sigh* Yeah, of course I cannot spell. :-P >=20 >> the maximum allowed value for that). Then for each available VCPU the >> bit in the mask has to be set (libxl_bitmap_set takes a bit position >> as an argument, not the number of bits to set). >> >> Without this, I would always only get one VCPU for guests created >> through libvirt/libxl. >> >> Signed-off-by: Stefan Bader >=20 > The libxl calling logic looks Ok to me. So from the libxl perspective > you can tack on Reviewed-by: Konrad Rzeszutek Wilk Thanks, I will leave that (as well as the complimentary fixing of missing= lletters to the libvirt maintainers. :) -Stefan >=20 >> --- >> src/libxl/libxl_conf.c | 14 +++++++++++--- >> 1 file changed, 11 insertions(+), 3 deletions(-) >> >> diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c >> index 4a0fba9..7592dd2 100644 >> --- a/src/libxl/libxl_conf.c >> +++ b/src/libxl/libxl_conf.c >> @@ -331,7 +331,8 @@ error: >> } >> =20 >> static int >> -libxlMakeDomBuildInfo(virDomainDefPtr def, libxl_domain_config *d_con= fig) >> +libxlMakeDomBuildInfo(libxlDriverPrivatePtr driver, virDomainDefPtr d= ef, >> + libxl_domain_config *d_config) >> { >> libxl_domain_build_info *b_info =3D &d_config->b_info; >> int hvm =3D STREQ(def->os.type, "hvm"); >> @@ -343,8 +344,15 @@ libxlMakeDomBuildInfo(virDomainDefPtr def, libxl_= domain_config *d_config) >> libxl_domain_build_info_init_type(b_info, LIBXL_DOMAIN_TYPE_H= VM); >> else >> libxl_domain_build_info_init_type(b_info, LIBXL_DOMAIN_TYPE_P= V); >> + >> b_info->max_vcpus =3D def->maxvcpus; >> - libxl_bitmap_set((&b_info->avail_vcpus), def->vcpus); >> + if (libxl_cpu_bitmap_alloc(driver->ctx, &b_info->avail_vcpus, >> + def->maxvcpus)) >> + goto error; >> + libxl_bitmap_set_none(&b_info->avail_vcpus); >> + for (i =3D 0; i < def->vcpus; i++) >> + libxl_bitmap_set((&b_info->avail_vcpus), i); >> + >> if (def->clock.ntimers > 0 && >> def->clock.timers[0]->name =3D=3D VIR_DOMAIN_TIMER_NAME_TSC) = { >> switch (def->clock.timers[0]->mode) { >> @@ -802,7 +810,7 @@ libxlBuildDomainConfig(libxlDriverPrivatePtr drive= r, >> if (libxlMakeDomCreateInfo(driver, def, &d_config->c_info) < 0) >> return -1; >> =20 >> - if (libxlMakeDomBuildInfo(def, d_config) < 0) { >> + if (libxlMakeDomBuildInfo(driver, def, d_config) < 0) { >> return -1; >> } >> =20 >> --=20 >> 1.7.9.5 >> >> >> _______________________________________________ >> Xen-devel mailing list >> Xen-devel@lists.xen.org >> http://lists.xen.org/xen-devel --------------enig2054CE1AE7755004203B2434 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.4.11 (GNU/Linux) Comment: Using GnuPG with undefined - http://www.enigmail.net/ iQIcBAEBCgAGBQJR7iwBAAoJEOhnXe7L7s6jCr0P/3n9qM7mD/k0UmomyuSlTszM yE5unG5XLcLcPhV61vAczpgOxUrKN1qm1mfM3CqzDXyiSJtKIt7lGpsbo4GBy2R4 zdfdlpKVG6f4NlvUbB/pGwacMVSSoSdKjWCX+6Mb2QBgES95Sc/kLxt5ei6x6N/k F7c4CBq3toDwudBT+GslQ4qZTS4ObCBVdVpa6FTJB3mQg14MWN7WVxwGev2ZbQsC G6OfJZFV8iKnrWgdPfEc7V54kE0BDZk2d52XMd/m69T/zEOd6nmvtpLJS3kIYtOD UEtJiNykjzTXdIVI/HKQJUAz5V51BjMhSSimp9VxUDJi03BoZ1HYbBj8PavhJgZY pKH1cZ/zEY+5O0Dlp5QYpiQrLYv0jUQaf1Ez+jDMjhtmlML4jxls1JlPNIfxBJBc YquAZ/KeJeoOLeY41nvxw1zNZuGbkL0EM4tBY+7bYBEUdH2Nx4bqiwqnJDPXs2Wu KmCAMU49d11xFYH78qcmnmUPYMW5NvL4a96BJjIF7uTCiddKH/4YWxOlborTtrJ0 c6eBootIGVGFJRbV71PoBEWB8sEz8DCTKTVIzvv2REaFFvYXvZCNAtpQEJNXAXN5 8VzrCfquHpiDQXDo2f9O9Ni7MKPCoJBt16+bWqUyUTSNbyFHlevJmgZtvYc2aqBG /mahE6v/GKP5RVKaZXyQ =NFLE -----END PGP SIGNATURE----- --------------enig2054CE1AE7755004203B2434-- --===============5737143757386161577== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============5737143757386161577==--