xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [XEN PATCH for-4.15] libxl: Replace deprecated QMP command by "query-cpus-fast"
@ 2021-03-22 14:17 Anthony PERARD
  2021-03-22 14:32 ` Ian Jackson
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Anthony PERARD @ 2021-03-22 14:17 UTC (permalink / raw)
  To: xen-devel; +Cc: Anthony PERARD, Ian Jackson, Wei Liu

We use the deprecated QMP command "query-cpus" which will be remove in
the upcoming QEMU 6.0 release. There's a replacement which is
"query-cpus-fast", and have been available since QEMU 2.12 (April
2018).

In order to been able to keep using recent version of QEMU, this patch
replace the deprecated command by the newer version. And because we
are in the "feature freeze" period, this patch is kept simple without
fallback (which could have been used when "query-cpus-fast" wasn't
available).

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 tools/libs/light/libxl_domain.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/tools/libs/light/libxl_domain.c b/tools/libs/light/libxl_domain.c
index 5d4ec9071160..e32e1cd39fea 100644
--- a/tools/libs/light/libxl_domain.c
+++ b/tools/libs/light/libxl_domain.c
@@ -1740,23 +1740,23 @@ static int libxl__set_vcpuonline_xenstore(libxl__gc *gc, uint32_t domid,
     return rc;
 }
 
-static int qmp_parse_query_cpus(libxl__gc *gc,
-                                libxl_domid domid,
-                                const libxl__json_object *response,
-                                libxl_bitmap *const map)
+static int qmp_parse_query_cpus_fast(libxl__gc *gc,
+                                     libxl_domid domid,
+                                     const libxl__json_object *response,
+                                     libxl_bitmap *const map)
 {
     int i;
     const libxl__json_object *cpu;
 
     libxl_bitmap_set_none(map);
-    /* Parse response to QMP command "query-cpus":
-     * [ { 'CPU': 'int',...} ]
+    /* Parse response to QMP command "query-cpus-fast":
+     * [ { 'cpu-index': 'int',...} ]
      */
     for (i = 0; (cpu = libxl__json_array_get(response, i)); i++) {
         unsigned int cpu_index;
         const libxl__json_object *o;
 
-        o = libxl__json_map_get("CPU", cpu, JSON_INTEGER);
+        o = libxl__json_map_get("cpu-index", cpu, JSON_INTEGER);
         if (!o) {
             LOGD(ERROR, domid, "Failed to retrieve CPU index.");
             return ERROR_QEMU_API;
@@ -1841,7 +1841,7 @@ int libxl_set_vcpuonline(libxl_ctx *ctx, uint32_t domid,
                                              LIBXL_QMP_CMD_TIMEOUT * 1000);
             if (rc) goto out;
             qmp->callback = set_vcpuonline_qmp_cpus_queried;
-            rc = libxl__ev_qmp_send(egc, qmp, "query-cpus", NULL);
+            rc = libxl__ev_qmp_send(egc, qmp, "query-cpus-fast", NULL);
             if (rc) goto out;
             return AO_INPROGRESS;
         default:
@@ -1876,7 +1876,7 @@ static void set_vcpuonline_qmp_cpus_queried(libxl__egc *egc,
     if (rc) goto out;
 
     libxl_bitmap_alloc(CTX, &current_map, svos->info.vcpu_max_id + 1);
-    rc = qmp_parse_query_cpus(gc, qmp->domid, response, &current_map);
+    rc = qmp_parse_query_cpus_fast(gc, qmp->domid, response, &current_map);
     if (rc) goto out;
 
     libxl_bitmap_copy_alloc(CTX, final_map, svos->cpumap);
@@ -2199,7 +2199,7 @@ static void retrieve_domain_configuration_lock_acquired(
         libxl_bitmap_alloc(CTX, &rdcs->qemuu_cpus,
                            d_config->b_info.max_vcpus);
         rdcs->qmp.callback = retrieve_domain_configuration_cpu_queried;
-        rc = libxl__ev_qmp_send(egc, &rdcs->qmp, "query-cpus", NULL);
+        rc = libxl__ev_qmp_send(egc, &rdcs->qmp, "query-cpus-fast", NULL);
         if (rc) goto out;
         has_callback = true;
     }
@@ -2220,7 +2220,7 @@ static void retrieve_domain_configuration_cpu_queried(
 
     if (rc) goto out;
 
-    rc = qmp_parse_query_cpus(gc, qmp->domid, response, &rdcs->qemuu_cpus);
+    rc = qmp_parse_query_cpus_fast(gc, qmp->domid, response, &rdcs->qemuu_cpus);
 
 out:
     retrieve_domain_configuration_end(egc, rdcs, rc);
-- 
Anthony PERARD



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [XEN PATCH for-4.15] libxl: Replace deprecated QMP command by "query-cpus-fast"
  2021-03-22 14:17 [XEN PATCH for-4.15] libxl: Replace deprecated QMP command by "query-cpus-fast" Anthony PERARD
@ 2021-03-22 14:32 ` Ian Jackson
  2021-03-22 14:47 ` Jan Beulich
  2021-04-01 14:24 ` Olaf Hering
  2 siblings, 0 replies; 6+ messages in thread
From: Ian Jackson @ 2021-03-22 14:32 UTC (permalink / raw)
  To: Anthony PERARD; +Cc: xen-devel, Wei Liu, Daniel P. Berrangé

<Anthony PERARD writes ("[XEN PATCH for-4.15] libxl: Replace deprecated QMP command by "query-cpus-fast""):
> We use the deprecated QMP command "query-cpus" which will be remove in
> the upcoming QEMU 6.0 release. There's a replacement which is
> "query-cpus-fast", and have been available since QEMU 2.12 (April
> 2018).
> 
> In order to been able to keep using recent version of QEMU, this patch
> replace the deprecated command by the newer version. And because we
> are in the "feature freeze" period, this patch is kept simple without
> fallback (which could have been used when "query-cpus-fast" wasn't
> available).

Thank you.

I observe that Daniel Berrange also wrote a libxl patch to solve this
problem.

I read the interdiff and the only difference is that Anthony's patch
changes the internal function name to qmp_parse_query_cpus_fast
whereas Daniel's doesn't.

This gives me a fairly high confidence in the patch :-).

Acked-by: Ian Jackson <iwj@xenproject.org>
Release-Acked-by: Ian Jackson <iwj@xenproject.org>

Ian.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [XEN PATCH for-4.15] libxl: Replace deprecated QMP command by "query-cpus-fast"
  2021-03-22 14:17 [XEN PATCH for-4.15] libxl: Replace deprecated QMP command by "query-cpus-fast" Anthony PERARD
  2021-03-22 14:32 ` Ian Jackson
@ 2021-03-22 14:47 ` Jan Beulich
  2021-03-22 15:00   ` Ian Jackson
  2021-04-01 14:24 ` Olaf Hering
  2 siblings, 1 reply; 6+ messages in thread
From: Jan Beulich @ 2021-03-22 14:47 UTC (permalink / raw)
  To: Anthony PERARD; +Cc: Ian Jackson, Wei Liu, xen-devel

On 22.03.2021 15:17, Anthony PERARD wrote:
> We use the deprecated QMP command "query-cpus" which will be remove in
> the upcoming QEMU 6.0 release. There's a replacement which is
> "query-cpus-fast", and have been available since QEMU 2.12 (April
> 2018).

IOW the tool stack then isn't going to work anymore on a system with
a distro provided qemu just around 3 years old?

Jan


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [XEN PATCH for-4.15] libxl: Replace deprecated QMP command by "query-cpus-fast"
  2021-03-22 14:47 ` Jan Beulich
@ 2021-03-22 15:00   ` Ian Jackson
  0 siblings, 0 replies; 6+ messages in thread
From: Ian Jackson @ 2021-03-22 15:00 UTC (permalink / raw)
  To: Jan Beulich; +Cc: Anthony PERARD, Wei Liu, xen-devel

Jan Beulich writes ("Re: [XEN PATCH for-4.15] libxl: Replace deprecated QMP command by "query-cpus-fast""):
> On 22.03.2021 15:17, Anthony PERARD wrote:
> > We use the deprecated QMP command "query-cpus" which will be remove in
> > the upcoming QEMU 6.0 release. There's a replacement which is
> > "query-cpus-fast", and have been available since QEMU 2.12 (April
> > 2018).
> 
> IOW the tool stack then isn't going to work anymore on a system with
> a distro provided qemu just around 3 years old?

4.15.0 won't, unless we take the further "do it both ways" patch.  I
think my inclination is to do that after .0.

That doesn't seem so unreasonable for a newly-released Xen.

Ian.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [XEN PATCH for-4.15] libxl: Replace deprecated QMP command by "query-cpus-fast"
  2021-03-22 14:17 [XEN PATCH for-4.15] libxl: Replace deprecated QMP command by "query-cpus-fast" Anthony PERARD
  2021-03-22 14:32 ` Ian Jackson
  2021-03-22 14:47 ` Jan Beulich
@ 2021-04-01 14:24 ` Olaf Hering
  2021-04-07 15:03   ` Anthony PERARD
  2 siblings, 1 reply; 6+ messages in thread
From: Olaf Hering @ 2021-04-01 14:24 UTC (permalink / raw)
  To: Anthony PERARD; +Cc: xen-devel, Ian Jackson, Wei Liu

[-- Attachment #1: Type: text/plain, Size: 481 bytes --]

Am Mon, 22 Mar 2021 14:17:44 +0000
schrieb Anthony PERARD <anthony.perard@citrix.com>:

> We use the deprecated QMP command "query-cpus"

There is also the already removed "cpu-add" command used, which apparently has to be replaced by "device_add".

Do you happen to have a fix for this as well?


Another thread suggests that more deprecated commands are used. I think they have to be adjusted as well, ideally before they finally disappear from upstream qemu.

Olaf

[-- Attachment #2: Digitale Signatur von OpenPGP --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [XEN PATCH for-4.15] libxl: Replace deprecated QMP command by "query-cpus-fast"
  2021-04-01 14:24 ` Olaf Hering
@ 2021-04-07 15:03   ` Anthony PERARD
  0 siblings, 0 replies; 6+ messages in thread
From: Anthony PERARD @ 2021-04-07 15:03 UTC (permalink / raw)
  To: Olaf Hering; +Cc: xen-devel, Ian Jackson, Wei Liu

On Thu, Apr 01, 2021 at 04:24:54PM +0200, Olaf Hering wrote:
> Am Mon, 22 Mar 2021 14:17:44 +0000
> schrieb Anthony PERARD <anthony.perard@citrix.com>:
> 
> > We use the deprecated QMP command "query-cpus"
> 
> There is also the already removed "cpu-add" command used, which apparently has to be replaced by "device_add".
> 
> Do you happen to have a fix for this as well?
>
> Another thread suggests that more deprecated commands are used. I think they have to be adjusted as well, ideally before they finally disappear from upstream qemu.

I'm working on a fix for cpu hotplug and other deprecated/removed
things, I'll try to propose the patches upstream soon after the release
of Xen.

Thanks,

-- 
Anthony PERARD


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-04-07 15:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-22 14:17 [XEN PATCH for-4.15] libxl: Replace deprecated QMP command by "query-cpus-fast" Anthony PERARD
2021-03-22 14:32 ` Ian Jackson
2021-03-22 14:47 ` Jan Beulich
2021-03-22 15:00   ` Ian Jackson
2021-04-01 14:24 ` Olaf Hering
2021-04-07 15:03   ` Anthony PERARD

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