From: Lin Yang <lin.a.yang@intel.com>
---
src/qemu/qemu_monitor_json.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 811db233c4..8c7f088775 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -48,7 +48,7 @@
VIR_LOG_INIT("qemu.qemu_monitor_json");
-#define QOM_CPU_PATH "/machine/unattached/device[0]"
+#define QOM_CPU_PATH "/machine/cpu[0]"
#define LINE_ENDING "\r\n"
@@ -1679,7 +1679,7 @@ int qemuMonitorJSONSystemReset(qemuMonitor *mon)
* A s390 cpu entry could look like this
* { "arch": "s390",
* "cpu-index": 0,
- * "qom-path": "/machine/unattached/device[0]",
+ * "qom-path": "/machine/cpu[0]",
* "thread_id": 3081,
* "cpu-state": "operating" }
*
@@ -1711,7 +1711,7 @@ qemuMonitorJSONExtractCPUS390Info(virJSONValue *jsoncpu,
* [{ "arch": "x86",
* "current": true,
* "CPU": 0,
- * "qom_path": "/machine/unattached/device[0]",
+ * "qom_path": "/machine/cpu[0]",
* "pc": -2130415978,
* "halted": true,
* "thread_id": 2631237,
@@ -1726,7 +1726,7 @@ qemuMonitorJSONExtractCPUS390Info(virJSONValue *jsoncpu,
* "thread-id": 0,
* "socket-id": 0
* },
- * "qom-path": "/machine/unattached/device[0]",
+ * "qom-path": "/machine/cpu[0]",
* "thread-id": 2631237,
* ...},
* {...}
@@ -1737,7 +1737,7 @@ qemuMonitorJSONExtractCPUS390Info(virJSONValue *jsoncpu,
* "props": {
* "core-id": 0
* },
- * "qom-path": "/machine/unattached/device[0]",
+ * "qom-path": "/machine/cpu[0]",
* "thread-id": 1237,
* "cpu-state": "operating",
* ...},
@@ -7853,7 +7853,7 @@ qemuMonitorQueryHotpluggableCpusFree(struct qemuMonitorQueryHotpluggableCpusEntr
* "socket-id": 0
* },
* "vcpus-count": 1,
- * "qom-path": "/machine/unattached/device[0]",
+ * "qom-path": "/machine/cpu[0]",
* "type": "qemu64-x86_64-cpu"
* },
* {...}
--
2.17.1
On Fri, 28 Jan 2022, Haibin Huang wrote:
> From: Lin Yang <lin.a.yang@intel.com>
>
How do we propose to maintain compatibility with older versions of Qemu?
> ---
> src/qemu/qemu_monitor_json.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
> index 811db233c4..8c7f088775 100644
> --- a/src/qemu/qemu_monitor_json.c
> +++ b/src/qemu/qemu_monitor_json.c
> @@ -48,7 +48,7 @@
>
> VIR_LOG_INIT("qemu.qemu_monitor_json");
>
> -#define QOM_CPU_PATH "/machine/unattached/device[0]"
> +#define QOM_CPU_PATH "/machine/cpu[0]"
>
> #define LINE_ENDING "\r\n"
>
> @@ -1679,7 +1679,7 @@ int qemuMonitorJSONSystemReset(qemuMonitor *mon)
> * A s390 cpu entry could look like this
> * { "arch": "s390",
> * "cpu-index": 0,
> - * "qom-path": "/machine/unattached/device[0]",
> + * "qom-path": "/machine/cpu[0]",
> * "thread_id": 3081,
> * "cpu-state": "operating" }
> *
> @@ -1711,7 +1711,7 @@ qemuMonitorJSONExtractCPUS390Info(virJSONValue *jsoncpu,
> * [{ "arch": "x86",
> * "current": true,
> * "CPU": 0,
> - * "qom_path": "/machine/unattached/device[0]",
> + * "qom_path": "/machine/cpu[0]",
> * "pc": -2130415978,
> * "halted": true,
> * "thread_id": 2631237,
> @@ -1726,7 +1726,7 @@ qemuMonitorJSONExtractCPUS390Info(virJSONValue *jsoncpu,
> * "thread-id": 0,
> * "socket-id": 0
> * },
> - * "qom-path": "/machine/unattached/device[0]",
> + * "qom-path": "/machine/cpu[0]",
> * "thread-id": 2631237,
> * ...},
> * {...}
> @@ -1737,7 +1737,7 @@ qemuMonitorJSONExtractCPUS390Info(virJSONValue *jsoncpu,
> * "props": {
> * "core-id": 0
> * },
> - * "qom-path": "/machine/unattached/device[0]",
> + * "qom-path": "/machine/cpu[0]",
> * "thread-id": 1237,
> * "cpu-state": "operating",
> * ...},
> @@ -7853,7 +7853,7 @@ qemuMonitorQueryHotpluggableCpusFree(struct qemuMonitorQueryHotpluggableCpusEntr
> * "socket-id": 0
> * },
> * "vcpus-count": 1,
> - * "qom-path": "/machine/unattached/device[0]",
> + * "qom-path": "/machine/cpu[0]",
> * "type": "qemu64-x86_64-cpu"
> * },
> * {...}
> --
> 2.17.1
>
>
Please ignore just this patchset, which should be re-worked to be compatible with older QEME version as you pointed out and submitted after corresponding QEMU patch get merged.
> -----Original Message-----
> From: Ani Sinha <ani@anisinha.ca>
> Sent: Saturday, February 5, 2022 10:02 PM
> To: Huang, Haibin <haibin.huang@intel.com>
> Cc: libvir-list@redhat.com; Ding, Jian-feng <jian-feng.ding@intel.com>; Yang,
> Lin A <lin.a.yang@intel.com>; Lu, Lianhao <lianhao.lu@intel.com>
> Subject: Re: [libvirt][PATCH v10 5/5] Update default CPU location in qemu QOM
> tree
>
>
>
> On Fri, 28 Jan 2022, Haibin Huang wrote:
>
> > From: Lin Yang <lin.a.yang@intel.com>
> >
>
> How do we propose to maintain compatibility with older versions of Qemu?
>
> > ---
> > src/qemu/qemu_monitor_json.c | 12 ++++++------
> > 1 file changed, 6 insertions(+), 6 deletions(-)
> >
> > diff --git a/src/qemu/qemu_monitor_json.c
> > b/src/qemu/qemu_monitor_json.c index 811db233c4..8c7f088775 100644
> > --- a/src/qemu/qemu_monitor_json.c
> > +++ b/src/qemu/qemu_monitor_json.c
> > @@ -48,7 +48,7 @@
> >
> > VIR_LOG_INIT("qemu.qemu_monitor_json");
> >
> > -#define QOM_CPU_PATH "/machine/unattached/device[0]"
> > +#define QOM_CPU_PATH "/machine/cpu[0]"
> >
> > #define LINE_ENDING "\r\n"
> >
> > @@ -1679,7 +1679,7 @@ int qemuMonitorJSONSystemReset(qemuMonitor
> *mon)
> > * A s390 cpu entry could look like this
> > * { "arch": "s390",
> > * "cpu-index": 0,
> > - * "qom-path": "/machine/unattached/device[0]",
> > + * "qom-path": "/machine/cpu[0]",
> > * "thread_id": 3081,
> > * "cpu-state": "operating" }
> > *
> > @@ -1711,7 +1711,7 @@
> qemuMonitorJSONExtractCPUS390Info(virJSONValue *jsoncpu,
> > * [{ "arch": "x86",
> > * "current": true,
> > * "CPU": 0,
> > - * "qom_path": "/machine/unattached/device[0]",
> > + * "qom_path": "/machine/cpu[0]",
> > * "pc": -2130415978,
> > * "halted": true,
> > * "thread_id": 2631237,
> > @@ -1726,7 +1726,7 @@
> qemuMonitorJSONExtractCPUS390Info(virJSONValue *jsoncpu,
> > * "thread-id": 0,
> > * "socket-id": 0
> > * },
> > - * "qom-path": "/machine/unattached/device[0]",
> > + * "qom-path": "/machine/cpu[0]",
> > * "thread-id": 2631237,
> > * ...},
> > * {...}
> > @@ -1737,7 +1737,7 @@
> qemuMonitorJSONExtractCPUS390Info(virJSONValue *jsoncpu,
> > * "props": {
> > * "core-id": 0
> > * },
> > - * "qom-path": "/machine/unattached/device[0]",
> > + * "qom-path": "/machine/cpu[0]",
> > * "thread-id": 1237,
> > * "cpu-state": "operating",
> > * ...},
> > @@ -7853,7 +7853,7 @@ qemuMonitorQueryHotpluggableCpusFree(struct
> qemuMonitorQueryHotpluggableCpusEntr
> > * "socket-id": 0
> > * },
> > * "vcpus-count": 1,
> > - * "qom-path": "/machine/unattached/device[0]",
> > + * "qom-path": "/machine/cpu[0]",
> > * "type": "qemu64-x86_64-cpu"
> > * },
> > * {...}
> > --
> > 2.17.1
> >
> >
© 2016 - 2026 Red Hat, Inc.