qemu: domain: Store 'qomPath' in qemuDomainVcpuPrivate

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>
This commit is contained in:
Peter Krempa 2022-02-07 11:56:40 +01:00
parent 715846b6ea
commit f0a4951616
3 changed files with 5 additions and 1 deletions

View 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;

View File

@ -316,6 +316,8 @@ struct _qemuDomainVcpuPrivate {
int thread_id;
int node_id;
int vcpus;
char *qomPath;
};
#define QEMU_DOMAIN_VCPU_PRIVATE(vcpu) \

View 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;