[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2] tools/helpers/init-dom0less: fix vcpu availability



On 16:24-20240820, Anthony PERARD wrote:
> On Tue, Aug 20, 2024 at 01:34:17PM +0530, Amneesh Singh wrote:
> > diff --git a/tools/helpers/init-dom0less.c b/tools/helpers/init-dom0less.c
> > index fee9345..722a5af 100644
> > --- a/tools/helpers/init-dom0less.c
> > +++ b/tools/helpers/init-dom0less.c
> > @@ -167,15 +167,20 @@ retry_transaction:
> >      /* /domain */
> >      if (!do_xs_write_dom(xsh, t, domid, "vm", vm_val_str)) goto err;
> >      if (!do_xs_write_dom(xsh, t, domid, "name", dom_name_str)) goto err;
> > -    if (!do_xs_write_dom(xsh, t, domid, "cpu", "")) goto err;
> 
> You should probably keep this node even if "*/availability" isn't going
> to be written. It might be useful for watching everything under the
> "cpu" node. (libxl create this node independently from all the other
> "availability" sub-nodes.)
Gotcha, didn't know that. Guess that can be kept the way it was then.
Thanks for pointing it out.
> 
> > @@ -330,14 +336,24 @@ int main(int argc, char **argv)
> >
> >      for (i = 0; i < nb_vm; i++) {
> >          domid_t domid = info[i].domid;
> > +        libxl_vcpuinfo *vcpuinfo;
> > +        int nb_vcpu = 0, nr_cpus = 0;
> > +
> >
> >          /* Don't need to check for Dom0 */
> >          if (!domid)
> >              continue;
> >
> > +        vcpuinfo = libxl_list_vcpu(ctx, domid, &nb_vcpu, &nr_cpus);
> > +
> > +        if (!vcpuinfo) {
> > +          fprintf(stderr, "libxl_list_vcpu failed.\n");
> > +          nb_vcpu = 0;
> 
> Is there any value to keep going if libxl_list_vcpu() fails?
> Or is the reasoning is that cpu/*/availability was broken before, so
> it's not important enough to stop init-dom0less?
Yes, so missing cpu/*/availability nodes would mean we cannot
pin/remove/add vcpus using xenlight I believe. However, we can still
hotplug other stuff like net or block devices. In fact, I was doing
exactly this when cpu/*/availability was broken.
> 
> 
> Thanks,
> 
> --
> 
> Anthony Perard | Vates XCP-ng Developer
> 
> XCP-ng & Xen Orchestra - Vates solutions
> 
> web: 
> https://urldefense.com/v3/__https://vates.tech__;!!G3vK!TgBV3TUl158hw6AKLTg3uYRP3PP-1Ku8uVFaT9lFV46NIVCn9kL-y82D2xz1j_iUwo58t8yr3hwYJBV9GAMS5zaFOSA$
> 

Regards
Amneesh



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.