]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: domain: Store 'qomPath' in qemuDomainVcpuPrivate
authorPeter Krempa <pkrempa@redhat.com>
Mon, 7 Feb 2022 10:56:40 +0000 (11:56 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 7 Feb 2022 17:04:52 +0000 (18:04 +0100)
The QOM path will be needed by code which is querying the cpu flags via
'qom-get' and thus needs a valid QOM path to the vCPU.

Add it into the private data and transfer from the queried data.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_domain.c
src/qemu/qemu_domain.h
src/qemu/qemu_monitor.h

index 14b585c6e9ce306de8154ce7e8b7faf28417f042..015f635dc8a4a1bcffe7c8c18a775e13a1e2182f 100644 (file)
@@ -821,6 +821,7 @@ qemuDomainVcpuPrivateDispose(void *obj)
     g_free(priv->type);
     g_free(priv->alias);
     virJSONValueFree(priv->props);
+    g_free(priv->qomPath);
     return;
 }
 
@@ -9550,6 +9551,8 @@ qemuDomainRefreshVcpuInfo(virQEMUDriver *driver,
         vcpupriv->props = g_steal_pointer(&info[i].props);
         vcpupriv->enable_id = info[i].id;
         vcpupriv->qemu_id = info[i].qemu_id;
+        g_free(vcpupriv->qomPath);
+        vcpupriv->qomPath = g_steal_pointer(&info[i].qom_path);
 
         if (hotplug && state) {
             vcpu->online = info[i].online;
index 78474b3f733488e40d666320b46176a9a441434e..8bf1c91049f72e63aa107a531f92331be7c74035 100644 (file)
@@ -316,6 +316,8 @@ struct _qemuDomainVcpuPrivate {
     int thread_id;
     int node_id;
     int vcpus;
+
+    char *qomPath;
 };
 
 #define QEMU_DOMAIN_VCPU_PRIVATE(vcpu) \
index 11ecda97de7463b86fcd57a897fe6fe0ded4fb85..efc4721ea98a512350632fe7316d2ba2ecb9ba44 100644 (file)
@@ -692,7 +692,6 @@ struct _qemuMonitorCPUInfo {
     /* alias of an hotpluggable entry. Entries with alias can be hot-unplugged */
     char *alias;
 
-    /* internal for use in the matching code */
     char *qom_path;
 
     bool halted;