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

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



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.)

> @@ -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?


Thanks,

-- 

Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech



 


Rackspace

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