|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 3/3] libxl: update vcpus bitmap in retrieved guest config
On Tue, Jun 07, 2016 at 06:22:27PM +0200, Dario Faggioli wrote:
> 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:
> > >
> > > > --- 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)
> > > > (*dst)[i] = (*src)[i];
> > > > }
> > > >
> > > > +static int libxl__update_avail_vcpus_qmp(libxl__gc *gc, uint32_t
> > > > domid,
> > > > + unsigned int max_vcpus,
> > > > + libxl_bitmap *map)
> > > > +{
> > > > + unsigned int count, i;
> > > > + int rc;
> > > > +
> > > > + /* For QEMU upstream we always need to return the number
> > > > + * of cpus present to QEMU whether they are online or not;
> > > > + * otherwise QEMU won't accept the saved state.
> > > > + */
> > > > + rc = libxl__qmp_query_cpus(gc, domid, &count);
> > > > + if (rc) {
> > > > + LOG(ERROR, "fail to get number of cpus for domain %d",
> > > > domid);
> > > > + goto out;
> > > > + }
> > > > +
> > > > + for (i = 0; i < count; i++)
> > > > + libxl_bitmap_set(map, i);
> > > What if I have cpu 1, 7 and 42 online, but all the other offline?
> > >
> > 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.
> >
> > In your example, you will have -smp 3,maxvcpus=$Y. I think the
> > migration
> > should still succeed. Furthermore, the cpu-add operation doesn't
> > care,
> > so it probably won't have visible effect.
> >
> > I agree it would be good to set the exact bits though -- if you can
> > tell
> > me which field to test.
> >
> Perhaps at least mention something about all this either in a comment
> or in the changelog?
>
What would you like to see in a comment? I guess this is now moot
because the exact bits will be set.
Wei.
> Regards,
> Dario
> --
> <<This happens because I choose it to happen!>> (Raistlin Majere)
> -----------------------------------------------------------------
> Dario Faggioli, Ph.D, http://about.me/dario.faggioli
> Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)
>
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |