xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Jason Andryuk <jandryuk@gmail.com>
To: Anthony PERARD <anthony.perard@citrix.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>,
	Ian Jackson <iwj@xenproject.org>,  Wei Liu <wl@xen.org>
Subject: Re: [XEN PATCH 3/8] libxl: Replace deprecated "cpu-add" QMP command by "device_add"
Date: Mon, 3 May 2021 09:47:47 -0400	[thread overview]
Message-ID: <CAKf6xpugza2tpXq52_TgUUvVfZ7_ccPcbszvu6VYO=ryGAAp5g@mail.gmail.com> (raw)
In-Reply-To: <20210423161558.224367-4-anthony.perard@citrix.com>

On Fri, Apr 23, 2021 at 12:16 PM Anthony PERARD
<anthony.perard@citrix.com> wrote:
>
> The command "cpu-add" for CPU hotplug is deprecated and has been
> removed from QEMU 6.0 (April 2021). We need to add cpus with the
> command "device_add" now.
>
> In order to find out which parameters to pass to "device_add" we first
> make a call to "query-hotpluggable-cpus" which list the cpus drivers
> and properties.
>
> The algorithm to figure out which CPU to add, and by extension if any
> CPU needs to be hotplugged, is in the function that adds the cpus.
> Because of that, the command "query-hotpluggable-cpus" is always
> called, even when not needed.
>
> In case we are using a version of QEMU older than 2.7 (Sept 2016)
> which don't have "query-hotpluggable-cpus", we fallback to using
> "cpu-add".
>
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
> ---
>  tools/libs/light/libxl_domain.c | 87 ++++++++++++++++++++++++++++++++-
>  1 file changed, 85 insertions(+), 2 deletions(-)
>
> diff --git a/tools/libs/light/libxl_domain.c b/tools/libs/light/libxl_domain.c
> index 8c003aa7cb04..e130deb0757f 100644
> --- a/tools/libs/light/libxl_domain.c
> +++ b/tools/libs/light/libxl_domain.c

> +
> +/* Fallback function for QEMU older than 2.7, when
> + * 'query-hotpluggable-cpus' wasn't available and vcpu object couldn't be
> + * added with 'device_add'. */
> +static void set_vcpuonline_qmp_add_cpu(libxl__egc *egc, libxl__ev_qmp *qmp,
> +                                       const libxl__json_object *response,
> +                                       int rc) { STATE_AO_GC(qmp->ao);

STATE_AO_GC should be on a new line.

With that,

Reviewed-by: Jason Andryuk <jandryuk@gmail.com>

Thanks,
Jason


  reply	other threads:[~2021-05-03 13:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-23 16:15 [XEN PATCH 0/8] Fix libxl with QEMU 6.0 + remove some more deprecated usages Anthony PERARD
2021-04-23 16:15 ` [XEN PATCH 1/8] libxl: Replace deprecated QMP command by "query-cpus-fast" Anthony PERARD
2021-04-28 16:53   ` Jason Andryuk
2021-05-10 14:11     ` Anthony PERARD
2021-04-23 16:15 ` [XEN PATCH 2/8] libxl: Replace QEMU's command line short-form boolean option Anthony PERARD
2021-04-23 16:15 ` [XEN PATCH 3/8] libxl: Replace deprecated "cpu-add" QMP command by "device_add" Anthony PERARD
2021-05-03 13:47   ` Jason Andryuk [this message]
2021-04-23 16:15 ` [XEN PATCH 4/8] libxl: Use -device for cd-rom drives Anthony PERARD
2021-04-23 16:15 ` [XEN PATCH 5/8] libxl: Assert qmp_ev's state in qmp_ev_qemu_compare_version Anthony PERARD
2021-04-23 16:15 ` [XEN PATCH 6/8] libxl: Export libxl__qmp_ev_qemu_compare_version Anthony PERARD
2021-04-23 16:15 ` [XEN PATCH 7/8] libxl: Use `id` with the "eject" QMP command Anthony PERARD
2021-04-23 16:15 ` [XEN PATCH 8/8] libxl: Replace QMP command "change" by "blockdev-change-media" Anthony PERARD
2021-05-03 14:13 ` [XEN PATCH 0/8] Fix libxl with QEMU 6.0 + remove some more deprecated usages Jason Andryuk
2021-05-10 14:17   ` 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='CAKf6xpugza2tpXq52_TgUUvVfZ7_ccPcbszvu6VYO=ryGAAp5g@mail.gmail.com' \
    --to=jandryuk@gmail.com \
    --cc=anthony.perard@citrix.com \
    --cc=iwj@xenproject.org \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    --subject='Re: [XEN PATCH 3/8] libxl: Replace deprecated "cpu-add" QMP command by "device_add"' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).