All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony PERARD <anthony.perard@vates.tech>
To: Amneesh Singh <a-singh21@ti.com>
Cc: xen-devel@lists.xenproject.org
Subject: Re: [PATCH v2] tools/helpers/init-dom0less: fix vcpu availability
Date: Tue, 20 Aug 2024 16:24:07 +0000	[thread overview]
Message-ID: <ZsTDJhcfFpm23oHO@l14> (raw)
In-Reply-To: <20240820080416.323725-1-a-singh21@ti.com>

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


  reply	other threads:[~2024-08-20 16:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-20  8:04 [PATCH v2] tools/helpers/init-dom0less: fix vcpu availability Amneesh Singh
2024-08-20 16:24 ` Anthony PERARD [this message]
2024-08-21  5:38   ` Amneesh Singh
2024-08-21 12:36     ` Anthony PERARD

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZsTDJhcfFpm23oHO@l14 \
    --to=anthony.perard@vates.tech \
    --cc=a-singh21@ti.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.