|
|
7b4659 |
From bdb0a40645dc91fe4fea4327634e118cc22c3c1c Mon Sep 17 00:00:00 2001
|
|
|
7b4659 |
Message-Id: <bdb0a40645dc91fe4fea4327634e118cc22c3c1c@dist-git>
|
|
|
7b4659 |
From: Jiri Denemark <jdenemar@redhat.com>
|
|
|
7b4659 |
Date: Fri, 16 Aug 2019 14:52:33 +0200
|
|
|
7b4659 |
Subject: [PATCH] qemu: Pass correct qemuCaps to virDomainDefCopy
|
|
|
7b4659 |
MIME-Version: 1.0
|
|
|
7b4659 |
Content-Type: text/plain; charset=UTF-8
|
|
|
7b4659 |
Content-Transfer-Encoding: 8bit
|
|
|
7b4659 |
|
|
|
7b4659 |
Since qemuDomainDefPostParse callback requires qemuCaps, we need to make
|
|
|
7b4659 |
sure it gets the capabilities stored in the domain's private data if the
|
|
|
7b4659 |
domain is running. Passing NULL may cause QEMU capabilities probing to
|
|
|
7b4659 |
be triggered in case QEMU binary changed in the meantime. When this
|
|
|
7b4659 |
happens while a running domain object is locked, QMP event delivered to
|
|
|
7b4659 |
the domain before QEMU capabilities probing finishes will deadlock the
|
|
|
7b4659 |
event loop.
|
|
|
7b4659 |
|
|
|
7b4659 |
Several general functions from domain_conf.c were lazily passing NULL as
|
|
|
7b4659 |
the parseOpaque pointer instead of letting their callers pass the right
|
|
|
7b4659 |
data. This patch fixes all paths leading to virDomainDefCopy to do the
|
|
|
7b4659 |
right thing.
|
|
|
7b4659 |
|
|
|
7b4659 |
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
|
|
7b4659 |
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
|
|
|
7b4659 |
(cherry picked from commit bbcfa07bea4fbe2fe8a51f99f20c77ddefd2d40d)
|
|
|
7b4659 |
|
|
|
7b4659 |
Conflicts:
|
|
|
7b4659 |
src/lxc/lxc_driver.c
|
|
|
7b4659 |
- context
|
|
|
7b4659 |
|
|
|
7b4659 |
src/qemu/qemu_driver.c
|
|
|
7b4659 |
- qemuDomainAttachDeviceLiveAndConfig is quite different
|
|
|
7b4659 |
- context in qemuDomainRevertToSnapshot
|
|
|
7b4659 |
- ProcessAttach API was removed upstream
|
|
|
7b4659 |
|
|
|
7b4659 |
src/uml/uml_driver.c
|
|
|
7b4659 |
- uml driver was removed upstream
|
|
|
7b4659 |
|
|
|
7b4659 |
https://bugzilla.redhat.com/show_bug.cgi?id=1731783
|
|
|
7b4659 |
https://bugzilla.redhat.com/show_bug.cgi?id=1742023
|
|
|
7b4659 |
|
|
|
7b4659 |
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
|
|
7b4659 |
Message-Id: <eadbc85f47469abe211d649d5414c2474a65f56c.1565959866.git.jdenemar@redhat.com>
|
|
|
7b4659 |
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
|
|
7b4659 |
---
|
|
|
7b4659 |
src/conf/domain_conf.c | 18 +++++++++++-------
|
|
|
7b4659 |
src/conf/domain_conf.h | 9 ++++++---
|
|
|
7b4659 |
src/libxl/libxl_domain.c | 2 +-
|
|
|
7b4659 |
src/libxl/libxl_driver.c | 10 +++++-----
|
|
|
7b4659 |
src/libxl/libxl_migration.c | 2 +-
|
|
|
7b4659 |
src/lxc/lxc_driver.c | 8 ++++----
|
|
|
7b4659 |
src/lxc/lxc_process.c | 2 +-
|
|
|
7b4659 |
src/qemu/qemu_driver.c | 28 ++++++++++++++++++++--------
|
|
|
7b4659 |
src/qemu/qemu_migration.c | 4 +++-
|
|
|
7b4659 |
src/qemu/qemu_process.c | 4 ++--
|
|
|
7b4659 |
src/test/test_driver.c | 2 +-
|
|
|
7b4659 |
src/uml/uml_driver.c | 2 +-
|
|
|
7b4659 |
tests/qemuhotplugtest.c | 2 +-
|
|
|
7b4659 |
13 files changed, 57 insertions(+), 36 deletions(-)
|
|
|
7b4659 |
|
|
|
7b4659 |
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
|
|
|
7b4659 |
index aaf6a6bab1..0fdf1742fd 100644
|
|
|
7b4659 |
--- a/src/conf/domain_conf.c
|
|
|
7b4659 |
+++ b/src/conf/domain_conf.c
|
|
|
7b4659 |
@@ -3374,7 +3374,8 @@ virDomainObjWaitUntil(virDomainObjPtr vm,
|
|
|
7b4659 |
int
|
|
|
7b4659 |
virDomainObjSetDefTransient(virCapsPtr caps,
|
|
|
7b4659 |
virDomainXMLOptionPtr xmlopt,
|
|
|
7b4659 |
- virDomainObjPtr domain)
|
|
|
7b4659 |
+ virDomainObjPtr domain,
|
|
|
7b4659 |
+ void *parseOpaque)
|
|
|
7b4659 |
{
|
|
|
7b4659 |
int ret = -1;
|
|
|
7b4659 |
|
|
|
7b4659 |
@@ -3384,7 +3385,8 @@ virDomainObjSetDefTransient(virCapsPtr caps,
|
|
|
7b4659 |
if (domain->newDef)
|
|
|
7b4659 |
return 0;
|
|
|
7b4659 |
|
|
|
7b4659 |
- if (!(domain->newDef = virDomainDefCopy(domain->def, caps, xmlopt, NULL, false)))
|
|
|
7b4659 |
+ if (!(domain->newDef = virDomainDefCopy(domain->def, caps, xmlopt,
|
|
|
7b4659 |
+ parseOpaque, false)))
|
|
|
7b4659 |
goto out;
|
|
|
7b4659 |
|
|
|
7b4659 |
ret = 0;
|
|
|
7b4659 |
@@ -3423,10 +3425,11 @@ virDomainObjRemoveTransientDef(virDomainObjPtr domain)
|
|
|
7b4659 |
virDomainDefPtr
|
|
|
7b4659 |
virDomainObjGetPersistentDef(virCapsPtr caps,
|
|
|
7b4659 |
virDomainXMLOptionPtr xmlopt,
|
|
|
7b4659 |
- virDomainObjPtr domain)
|
|
|
7b4659 |
+ virDomainObjPtr domain,
|
|
|
7b4659 |
+ void *parseOpaque)
|
|
|
7b4659 |
{
|
|
|
7b4659 |
if (virDomainObjIsActive(domain) &&
|
|
|
7b4659 |
- virDomainObjSetDefTransient(caps, xmlopt, domain) < 0)
|
|
|
7b4659 |
+ virDomainObjSetDefTransient(caps, xmlopt, domain, parseOpaque) < 0)
|
|
|
7b4659 |
return NULL;
|
|
|
7b4659 |
|
|
|
7b4659 |
if (domain->newDef)
|
|
|
7b4659 |
@@ -29180,12 +29183,13 @@ virDomainDefCopy(virDomainDefPtr src,
|
|
|
7b4659 |
virDomainDefPtr
|
|
|
7b4659 |
virDomainObjCopyPersistentDef(virDomainObjPtr dom,
|
|
|
7b4659 |
virCapsPtr caps,
|
|
|
7b4659 |
- virDomainXMLOptionPtr xmlopt)
|
|
|
7b4659 |
+ virDomainXMLOptionPtr xmlopt,
|
|
|
7b4659 |
+ void *parseOpaque)
|
|
|
7b4659 |
{
|
|
|
7b4659 |
virDomainDefPtr cur;
|
|
|
7b4659 |
|
|
|
7b4659 |
- cur = virDomainObjGetPersistentDef(caps, xmlopt, dom);
|
|
|
7b4659 |
- return virDomainDefCopy(cur, caps, xmlopt, NULL, false);
|
|
|
7b4659 |
+ cur = virDomainObjGetPersistentDef(caps, xmlopt, dom, parseOpaque);
|
|
|
7b4659 |
+ return virDomainDefCopy(cur, caps, xmlopt, parseOpaque, false);
|
|
|
7b4659 |
}
|
|
|
7b4659 |
|
|
|
7b4659 |
|
|
|
7b4659 |
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
|
|
|
7b4659 |
index 2d272f907f..9e4fed6d4e 100644
|
|
|
7b4659 |
--- a/src/conf/domain_conf.h
|
|
|
7b4659 |
+++ b/src/conf/domain_conf.h
|
|
|
7b4659 |
@@ -2940,12 +2940,14 @@ void virDomainObjAssignDef(virDomainObjPtr domain,
|
|
|
7b4659 |
virDomainDefPtr *oldDef);
|
|
|
7b4659 |
int virDomainObjSetDefTransient(virCapsPtr caps,
|
|
|
7b4659 |
virDomainXMLOptionPtr xmlopt,
|
|
|
7b4659 |
- virDomainObjPtr domain);
|
|
|
7b4659 |
+ virDomainObjPtr domain,
|
|
|
7b4659 |
+ void *parseOpaque);
|
|
|
7b4659 |
void virDomainObjRemoveTransientDef(virDomainObjPtr domain);
|
|
|
7b4659 |
virDomainDefPtr
|
|
|
7b4659 |
virDomainObjGetPersistentDef(virCapsPtr caps,
|
|
|
7b4659 |
virDomainXMLOptionPtr xmlopt,
|
|
|
7b4659 |
- virDomainObjPtr domain);
|
|
|
7b4659 |
+ virDomainObjPtr domain,
|
|
|
7b4659 |
+ void *parseOpaque);
|
|
|
7b4659 |
|
|
|
7b4659 |
int virDomainObjUpdateModificationImpact(virDomainObjPtr vm,
|
|
|
7b4659 |
unsigned int *flags);
|
|
|
7b4659 |
@@ -2966,7 +2968,8 @@ virDomainDefPtr virDomainDefCopy(virDomainDefPtr src,
|
|
|
7b4659 |
bool migratable);
|
|
|
7b4659 |
virDomainDefPtr virDomainObjCopyPersistentDef(virDomainObjPtr dom,
|
|
|
7b4659 |
virCapsPtr caps,
|
|
|
7b4659 |
- virDomainXMLOptionPtr xmlopt);
|
|
|
7b4659 |
+ virDomainXMLOptionPtr xmlopt,
|
|
|
7b4659 |
+ void *parseOpaque);
|
|
|
7b4659 |
|
|
|
7b4659 |
typedef enum {
|
|
|
7b4659 |
/* parse internal domain status information */
|
|
|
7b4659 |
diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c
|
|
|
7b4659 |
index 2ab78ac9a5..f52540e6a7 100644
|
|
|
7b4659 |
--- a/src/libxl/libxl_domain.c
|
|
|
7b4659 |
+++ b/src/libxl/libxl_domain.c
|
|
|
7b4659 |
@@ -1208,7 +1208,7 @@ libxlDomainStart(libxlDriverPrivatePtr driver,
|
|
|
7b4659 |
VIR_FREE(managed_save_path);
|
|
|
7b4659 |
}
|
|
|
7b4659 |
|
|
|
7b4659 |
- if (virDomainObjSetDefTransient(cfg->caps, driver->xmlopt, vm) < 0)
|
|
|
7b4659 |
+ if (virDomainObjSetDefTransient(cfg->caps, driver->xmlopt, vm, NULL) < 0)
|
|
|
7b4659 |
goto cleanup;
|
|
|
7b4659 |
|
|
|
7b4659 |
/* Run an early hook to set-up missing devices */
|
|
|
7b4659 |
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
|
|
|
7b4659 |
index 5a5e792957..be6b66ce7e 100644
|
|
|
7b4659 |
--- a/src/libxl/libxl_driver.c
|
|
|
7b4659 |
+++ b/src/libxl/libxl_driver.c
|
|
|
7b4659 |
@@ -1461,7 +1461,7 @@ virDomainLiveConfigHelperMethod(virCapsPtr caps,
|
|
|
7b4659 |
return -1;
|
|
|
7b4659 |
|
|
|
7b4659 |
if (*flags & VIR_DOMAIN_AFFECT_CONFIG) {
|
|
|
7b4659 |
- if (!(*persistentDef = virDomainObjGetPersistentDef(caps, xmlopt, dom))) {
|
|
|
7b4659 |
+ if (!(*persistentDef = virDomainObjGetPersistentDef(caps, xmlopt, dom, NULL))) {
|
|
|
7b4659 |
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
|
|
7b4659 |
_("Get persistent config failed"));
|
|
|
7b4659 |
return -1;
|
|
|
7b4659 |
@@ -2147,7 +2147,7 @@ libxlDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
|
|
|
7b4659 |
goto endjob;
|
|
|
7b4659 |
}
|
|
|
7b4659 |
|
|
|
7b4659 |
- if (!(def = virDomainObjGetPersistentDef(cfg->caps, driver->xmlopt, vm)))
|
|
|
7b4659 |
+ if (!(def = virDomainObjGetPersistentDef(cfg->caps, driver->xmlopt, vm, NULL)))
|
|
|
7b4659 |
goto endjob;
|
|
|
7b4659 |
|
|
|
7b4659 |
maplen = VIR_CPU_MAPLEN(nvcpus);
|
|
|
7b4659 |
@@ -3961,7 +3961,7 @@ libxlDomainAttachDeviceFlags(virDomainPtr dom, const char *xml,
|
|
|
7b4659 |
|
|
|
7b4659 |
/* Make a copy for updated domain. */
|
|
|
7b4659 |
if (!(vmdef = virDomainObjCopyPersistentDef(vm, cfg->caps,
|
|
|
7b4659 |
- driver->xmlopt)))
|
|
|
7b4659 |
+ driver->xmlopt, NULL)))
|
|
|
7b4659 |
goto endjob;
|
|
|
7b4659 |
|
|
|
7b4659 |
if (libxlDomainAttachDeviceConfig(vmdef, dev) < 0)
|
|
|
7b4659 |
@@ -4051,7 +4051,7 @@ libxlDomainDetachDeviceFlags(virDomainPtr dom, const char *xml,
|
|
|
7b4659 |
|
|
|
7b4659 |
/* Make a copy for updated domain. */
|
|
|
7b4659 |
if (!(vmdef = virDomainObjCopyPersistentDef(vm, cfg->caps,
|
|
|
7b4659 |
- driver->xmlopt)))
|
|
|
7b4659 |
+ driver->xmlopt, NULL)))
|
|
|
7b4659 |
goto endjob;
|
|
|
7b4659 |
|
|
|
7b4659 |
if (libxlDomainDetachDeviceConfig(vmdef, dev) < 0)
|
|
|
7b4659 |
@@ -4138,7 +4138,7 @@ libxlDomainUpdateDeviceFlags(virDomainPtr dom, const char *xml,
|
|
|
7b4659 |
|
|
|
7b4659 |
/* Make a copy for updated domain. */
|
|
|
7b4659 |
if (!(vmdef = virDomainObjCopyPersistentDef(vm, cfg->caps,
|
|
|
7b4659 |
- driver->xmlopt)))
|
|
|
7b4659 |
+ driver->xmlopt, NULL)))
|
|
|
7b4659 |
goto cleanup;
|
|
|
7b4659 |
|
|
|
7b4659 |
if ((ret = libxlDomainUpdateDeviceConfig(vmdef, dev)) < 0)
|
|
|
7b4659 |
diff --git a/src/libxl/libxl_migration.c b/src/libxl/libxl_migration.c
|
|
|
7b4659 |
index b2e5847c58..f207bd7b02 100644
|
|
|
7b4659 |
--- a/src/libxl/libxl_migration.c
|
|
|
7b4659 |
+++ b/src/libxl/libxl_migration.c
|
|
|
7b4659 |
@@ -1293,7 +1293,7 @@ libxlDomainMigrationDstFinish(virConnectPtr dconn,
|
|
|
7b4659 |
|
|
|
7b4659 |
vm->persistent = 1;
|
|
|
7b4659 |
if (!(vmdef = virDomainObjGetPersistentDef(cfg->caps,
|
|
|
7b4659 |
- driver->xmlopt, vm)))
|
|
|
7b4659 |
+ driver->xmlopt, vm, NULL)))
|
|
|
7b4659 |
goto cleanup;
|
|
|
7b4659 |
|
|
|
7b4659 |
if (virDomainSaveConfig(cfg->configDir, cfg->caps, vmdef) < 0)
|
|
|
7b4659 |
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
|
|
|
7b4659 |
index f9794e0655..b182fa3759 100644
|
|
|
7b4659 |
--- a/src/lxc/lxc_driver.c
|
|
|
7b4659 |
+++ b/src/lxc/lxc_driver.c
|
|
|
7b4659 |
@@ -1936,7 +1936,7 @@ lxcDomainSetSchedulerParametersFlags(virDomainPtr dom,
|
|
|
7b4659 |
|
|
|
7b4659 |
if (persistentDef) {
|
|
|
7b4659 |
/* Make a copy for updated domain. */
|
|
|
7b4659 |
- persistentDefCopy = virDomainObjCopyPersistentDef(vm, caps, driver->xmlopt);
|
|
|
7b4659 |
+ persistentDefCopy = virDomainObjCopyPersistentDef(vm, caps, driver->xmlopt, NULL);
|
|
|
7b4659 |
if (!persistentDefCopy)
|
|
|
7b4659 |
goto endjob;
|
|
|
7b4659 |
}
|
|
|
7b4659 |
@@ -4755,7 +4755,7 @@ static int lxcDomainAttachDeviceFlags(virDomainPtr dom,
|
|
|
7b4659 |
|
|
|
7b4659 |
if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
|
|
|
7b4659 |
/* Make a copy for updated domain. */
|
|
|
7b4659 |
- vmdef = virDomainObjCopyPersistentDef(vm, caps, driver->xmlopt);
|
|
|
7b4659 |
+ vmdef = virDomainObjCopyPersistentDef(vm, caps, driver->xmlopt, NULL);
|
|
|
7b4659 |
if (!vmdef)
|
|
|
7b4659 |
goto endjob;
|
|
|
7b4659 |
|
|
|
7b4659 |
@@ -4870,7 +4870,7 @@ static int lxcDomainUpdateDeviceFlags(virDomainPtr dom,
|
|
|
7b4659 |
|
|
|
7b4659 |
if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
|
|
|
7b4659 |
/* Make a copy for updated domain. */
|
|
|
7b4659 |
- vmdef = virDomainObjCopyPersistentDef(vm, caps, driver->xmlopt);
|
|
|
7b4659 |
+ vmdef = virDomainObjCopyPersistentDef(vm, caps, driver->xmlopt, NULL);
|
|
|
7b4659 |
if (!vmdef)
|
|
|
7b4659 |
goto endjob;
|
|
|
7b4659 |
|
|
|
7b4659 |
@@ -4961,7 +4961,7 @@ static int lxcDomainDetachDeviceFlags(virDomainPtr dom,
|
|
|
7b4659 |
|
|
|
7b4659 |
if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
|
|
|
7b4659 |
/* Make a copy for updated domain. */
|
|
|
7b4659 |
- vmdef = virDomainObjCopyPersistentDef(vm, caps, driver->xmlopt);
|
|
|
7b4659 |
+ vmdef = virDomainObjCopyPersistentDef(vm, caps, driver->xmlopt, NULL);
|
|
|
7b4659 |
if (!vmdef)
|
|
|
7b4659 |
goto endjob;
|
|
|
7b4659 |
|
|
|
7b4659 |
diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c
|
|
|
7b4659 |
index 14502e12fe..d40c7acaaa 100644
|
|
|
7b4659 |
--- a/src/lxc/lxc_process.c
|
|
|
7b4659 |
+++ b/src/lxc/lxc_process.c
|
|
|
7b4659 |
@@ -1274,7 +1274,7 @@ int virLXCProcessStart(virConnectPtr conn,
|
|
|
7b4659 |
* report implicit runtime defaults in the XML, like vnc listen/socket
|
|
|
7b4659 |
*/
|
|
|
7b4659 |
VIR_DEBUG("Setting current domain def as transient");
|
|
|
7b4659 |
- if (virDomainObjSetDefTransient(caps, driver->xmlopt, vm) < 0)
|
|
|
7b4659 |
+ if (virDomainObjSetDefTransient(caps, driver->xmlopt, vm, NULL) < 0)
|
|
|
7b4659 |
goto cleanup;
|
|
|
7b4659 |
|
|
|
7b4659 |
/* Run an early hook to set-up missing devices */
|
|
|
7b4659 |
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
|
|
|
7b4659 |
index 3f8530eb0e..82371b9a66 100644
|
|
|
7b4659 |
--- a/src/qemu/qemu_driver.c
|
|
|
7b4659 |
+++ b/src/qemu/qemu_driver.c
|
|
|
7b4659 |
@@ -8379,6 +8379,7 @@ qemuDomainAttachDeviceLiveAndConfig(virDomainObjPtr vm,
|
|
|
7b4659 |
const char *xml,
|
|
|
7b4659 |
unsigned int flags)
|
|
|
7b4659 |
{
|
|
|
7b4659 |
+ qemuDomainObjPrivatePtr priv = vm->privateData;
|
|
|
7b4659 |
virDomainDefPtr vmdef = NULL;
|
|
|
7b4659 |
virQEMUDriverConfigPtr cfg = NULL;
|
|
|
7b4659 |
virDomainDeviceDefPtr dev = NULL, dev_copy = NULL;
|
|
|
7b4659 |
@@ -8417,7 +8418,7 @@ qemuDomainAttachDeviceLiveAndConfig(virDomainObjPtr vm,
|
|
|
7b4659 |
|
|
|
7b4659 |
if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
|
|
|
7b4659 |
/* Make a copy for updated domain. */
|
|
|
7b4659 |
- vmdef = virDomainObjCopyPersistentDef(vm, caps, driver->xmlopt);
|
|
|
7b4659 |
+ vmdef = virDomainObjCopyPersistentDef(vm, caps, driver->xmlopt, priv->qemuCaps);
|
|
|
7b4659 |
if (!vmdef)
|
|
|
7b4659 |
goto cleanup;
|
|
|
7b4659 |
|
|
|
7b4659 |
@@ -8520,6 +8521,7 @@ static int qemuDomainUpdateDeviceFlags(virDomainPtr dom,
|
|
|
7b4659 |
{
|
|
|
7b4659 |
virQEMUDriverPtr driver = dom->conn->privateData;
|
|
|
7b4659 |
virDomainObjPtr vm = NULL;
|
|
|
7b4659 |
+ qemuDomainObjPrivatePtr priv;
|
|
|
7b4659 |
virDomainDefPtr vmdef = NULL;
|
|
|
7b4659 |
virDomainDeviceDefPtr dev = NULL, dev_copy = NULL;
|
|
|
7b4659 |
bool force = (flags & VIR_DOMAIN_DEVICE_MODIFY_FORCE) != 0;
|
|
|
7b4659 |
@@ -8542,6 +8544,8 @@ static int qemuDomainUpdateDeviceFlags(virDomainPtr dom,
|
|
|
7b4659 |
if (!(vm = qemuDomObjFromDomain(dom)))
|
|
|
7b4659 |
goto cleanup;
|
|
|
7b4659 |
|
|
|
7b4659 |
+ priv = vm->privateData;
|
|
|
7b4659 |
+
|
|
|
7b4659 |
if (virDomainUpdateDeviceFlagsEnsureACL(dom->conn, vm->def, flags) < 0)
|
|
|
7b4659 |
goto cleanup;
|
|
|
7b4659 |
|
|
|
7b4659 |
@@ -8574,7 +8578,8 @@ static int qemuDomainUpdateDeviceFlags(virDomainPtr dom,
|
|
|
7b4659 |
|
|
|
7b4659 |
if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
|
|
|
7b4659 |
/* Make a copy for updated domain. */
|
|
|
7b4659 |
- vmdef = virDomainObjCopyPersistentDef(vm, caps, driver->xmlopt);
|
|
|
7b4659 |
+ vmdef = virDomainObjCopyPersistentDef(vm, caps, driver->xmlopt,
|
|
|
7b4659 |
+ priv->qemuCaps);
|
|
|
7b4659 |
if (!vmdef)
|
|
|
7b4659 |
goto endjob;
|
|
|
7b4659 |
|
|
|
7b4659 |
@@ -8632,6 +8637,7 @@ qemuDomainDetachDeviceLiveAndConfig(virQEMUDriverPtr driver,
|
|
|
7b4659 |
const char *xml,
|
|
|
7b4659 |
unsigned int flags)
|
|
|
7b4659 |
{
|
|
|
7b4659 |
+ qemuDomainObjPrivatePtr priv = vm->privateData;
|
|
|
7b4659 |
virCapsPtr caps = NULL;
|
|
|
7b4659 |
virQEMUDriverConfigPtr cfg = NULL;
|
|
|
7b4659 |
virDomainDeviceDefPtr dev = NULL, dev_copy = NULL;
|
|
|
7b4659 |
@@ -8670,7 +8676,7 @@ qemuDomainDetachDeviceLiveAndConfig(virQEMUDriverPtr driver,
|
|
|
7b4659 |
|
|
|
7b4659 |
if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
|
|
|
7b4659 |
/* Make a copy for updated domain. */
|
|
|
7b4659 |
- vmdef = virDomainObjCopyPersistentDef(vm, caps, driver->xmlopt);
|
|
|
7b4659 |
+ vmdef = virDomainObjCopyPersistentDef(vm, caps, driver->xmlopt, priv->qemuCaps);
|
|
|
7b4659 |
if (!vmdef)
|
|
|
7b4659 |
goto cleanup;
|
|
|
7b4659 |
|
|
|
7b4659 |
@@ -8726,6 +8732,7 @@ qemuDomainDetachDeviceAliasLiveAndConfig(virQEMUDriverPtr driver,
|
|
|
7b4659 |
const char *alias,
|
|
|
7b4659 |
unsigned int flags)
|
|
|
7b4659 |
{
|
|
|
7b4659 |
+ qemuDomainObjPrivatePtr priv = vm->privateData;
|
|
|
7b4659 |
virCapsPtr caps = NULL;
|
|
|
7b4659 |
virQEMUDriverConfigPtr cfg = NULL;
|
|
|
7b4659 |
virDomainDefPtr def = NULL;
|
|
|
7b4659 |
@@ -8752,7 +8759,8 @@ qemuDomainDetachDeviceAliasLiveAndConfig(virQEMUDriverPtr driver,
|
|
|
7b4659 |
if (persistentDef) {
|
|
|
7b4659 |
virDomainDeviceDef dev;
|
|
|
7b4659 |
|
|
|
7b4659 |
- if (!(vmdef = virDomainObjCopyPersistentDef(vm, caps, driver->xmlopt)))
|
|
|
7b4659 |
+ if (!(vmdef = virDomainObjCopyPersistentDef(vm, caps, driver->xmlopt,
|
|
|
7b4659 |
+ priv->qemuCaps)))
|
|
|
7b4659 |
goto cleanup;
|
|
|
7b4659 |
|
|
|
7b4659 |
if (virDomainDefFindDevice(vmdef, alias, &dev, true) < 0)
|
|
|
7b4659 |
@@ -10368,7 +10376,8 @@ qemuDomainSetSchedulerParametersFlags(virDomainPtr dom,
|
|
|
7b4659 |
if (persistentDef) {
|
|
|
7b4659 |
/* Make a copy for updated domain. */
|
|
|
7b4659 |
if (!(persistentDefCopy = virDomainObjCopyPersistentDef(vm, caps,
|
|
|
7b4659 |
- driver->xmlopt)))
|
|
|
7b4659 |
+ driver->xmlopt,
|
|
|
7b4659 |
+ priv->qemuCaps)))
|
|
|
7b4659 |
goto endjob;
|
|
|
7b4659 |
}
|
|
|
7b4659 |
|
|
|
7b4659 |
@@ -15975,6 +15984,7 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
|
|
|
7b4659 |
if (!(vm = qemuDomObjFromSnapshot(snapshot)))
|
|
|
7b4659 |
goto cleanup;
|
|
|
7b4659 |
|
|
|
7b4659 |
+ priv = vm->privateData;
|
|
|
7b4659 |
cfg = virQEMUDriverGetConfig(driver);
|
|
|
7b4659 |
|
|
|
7b4659 |
if (virDomainRevertToSnapshotEnsureACL(snapshot->domain->conn, vm->def) < 0)
|
|
|
7b4659 |
@@ -16052,7 +16062,7 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
|
|
|
7b4659 |
snap->def->current = true;
|
|
|
7b4659 |
if (snap->def->dom) {
|
|
|
7b4659 |
config = virDomainDefCopy(snap->def->dom, caps,
|
|
|
7b4659 |
- driver->xmlopt, NULL, true);
|
|
|
7b4659 |
+ driver->xmlopt, priv->qemuCaps, true);
|
|
|
7b4659 |
if (!config)
|
|
|
7b4659 |
goto endjob;
|
|
|
7b4659 |
}
|
|
|
7b4659 |
@@ -16062,7 +16072,6 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
|
|
|
7b4659 |
switch ((virDomainState) snap->def->state) {
|
|
|
7b4659 |
case VIR_DOMAIN_RUNNING:
|
|
|
7b4659 |
case VIR_DOMAIN_PAUSED:
|
|
|
7b4659 |
- priv = vm->privateData;
|
|
|
7b4659 |
start_flags |= VIR_QEMU_PROCESS_START_PAUSED;
|
|
|
7b4659 |
|
|
|
7b4659 |
/* Transitions 2, 3, 5, 6, 8, 9 */
|
|
|
7b4659 |
@@ -20500,6 +20509,7 @@ qemuDomainGetFSInfo(virDomainPtr dom,
|
|
|
7b4659 |
unsigned int flags)
|
|
|
7b4659 |
{
|
|
|
7b4659 |
virQEMUDriverPtr driver = dom->conn->privateData;
|
|
|
7b4659 |
+ qemuDomainObjPrivatePtr priv;
|
|
|
7b4659 |
virDomainObjPtr vm;
|
|
|
7b4659 |
qemuAgentPtr agent;
|
|
|
7b4659 |
virCapsPtr caps = NULL;
|
|
|
7b4659 |
@@ -20511,6 +20521,8 @@ qemuDomainGetFSInfo(virDomainPtr dom,
|
|
|
7b4659 |
if (!(vm = qemuDomObjFromDomain(dom)))
|
|
|
7b4659 |
return ret;
|
|
|
7b4659 |
|
|
|
7b4659 |
+ priv = vm->privateData;
|
|
|
7b4659 |
+
|
|
|
7b4659 |
if (virDomainGetFSInfoEnsureACL(dom->conn, vm->def) < 0)
|
|
|
7b4659 |
goto cleanup;
|
|
|
7b4659 |
|
|
|
7b4659 |
@@ -20526,7 +20538,7 @@ qemuDomainGetFSInfo(virDomainPtr dom,
|
|
|
7b4659 |
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
|
|
|
7b4659 |
goto endjob;
|
|
|
7b4659 |
|
|
|
7b4659 |
- if (!(def = virDomainDefCopy(vm->def, caps, driver->xmlopt, NULL, false)))
|
|
|
7b4659 |
+ if (!(def = virDomainDefCopy(vm->def, caps, driver->xmlopt, priv->qemuCaps, false)))
|
|
|
7b4659 |
goto endjob;
|
|
|
7b4659 |
|
|
|
7b4659 |
agent = qemuDomainObjEnterAgent(vm);
|
|
|
7b4659 |
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
|
|
|
7b4659 |
index f5d77d2508..b7f4110baf 100644
|
|
|
7b4659 |
--- a/src/qemu/qemu_migration.c
|
|
|
7b4659 |
+++ b/src/qemu/qemu_migration.c
|
|
|
7b4659 |
@@ -4850,6 +4850,7 @@ qemuMigrationDstPersist(virQEMUDriverPtr driver,
|
|
|
7b4659 |
bool ignoreSaveError)
|
|
|
7b4659 |
{
|
|
|
7b4659 |
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
|
|
|
7b4659 |
+ qemuDomainObjPrivatePtr priv = vm->privateData;
|
|
|
7b4659 |
virCapsPtr caps = NULL;
|
|
|
7b4659 |
virDomainDefPtr vmdef;
|
|
|
7b4659 |
virDomainDefPtr oldDef = NULL;
|
|
|
7b4659 |
@@ -4864,7 +4865,8 @@ qemuMigrationDstPersist(virQEMUDriverPtr driver,
|
|
|
7b4659 |
oldDef = vm->newDef;
|
|
|
7b4659 |
vm->newDef = qemuMigrationCookieGetPersistent(mig);
|
|
|
7b4659 |
|
|
|
7b4659 |
- if (!(vmdef = virDomainObjGetPersistentDef(caps, driver->xmlopt, vm)))
|
|
|
7b4659 |
+ if (!(vmdef = virDomainObjGetPersistentDef(caps, driver->xmlopt, vm,
|
|
|
7b4659 |
+ priv->qemuCaps)))
|
|
|
7b4659 |
goto error;
|
|
|
7b4659 |
|
|
|
7b4659 |
if (virDomainSaveConfig(cfg->configDir, driver->caps, vmdef) < 0 &&
|
|
|
7b4659 |
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
|
|
|
7b4659 |
index 34686b4d92..08e1d91fcc 100644
|
|
|
7b4659 |
--- a/src/qemu/qemu_process.c
|
|
|
7b4659 |
+++ b/src/qemu/qemu_process.c
|
|
|
7b4659 |
@@ -5375,7 +5375,7 @@ qemuProcessInit(virQEMUDriverPtr driver,
|
|
|
7b4659 |
* report implicit runtime defaults in the XML, like vnc listen/socket
|
|
|
7b4659 |
*/
|
|
|
7b4659 |
VIR_DEBUG("Setting current domain def as transient");
|
|
|
7b4659 |
- if (virDomainObjSetDefTransient(caps, driver->xmlopt, vm) < 0)
|
|
|
7b4659 |
+ if (virDomainObjSetDefTransient(caps, driver->xmlopt, vm, priv->qemuCaps) < 0)
|
|
|
7b4659 |
goto cleanup;
|
|
|
7b4659 |
|
|
|
7b4659 |
if (flags & VIR_QEMU_PROCESS_START_PRETEND) {
|
|
|
7b4659 |
@@ -7314,7 +7314,7 @@ int qemuProcessAttach(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|
|
7b4659 |
* report implicit runtime defaults in the XML, like vnc listen/socket
|
|
|
7b4659 |
*/
|
|
|
7b4659 |
VIR_DEBUG("Setting current domain def as transient");
|
|
|
7b4659 |
- if (virDomainObjSetDefTransient(caps, driver->xmlopt, vm) < 0)
|
|
|
7b4659 |
+ if (virDomainObjSetDefTransient(caps, driver->xmlopt, vm, NULL) < 0)
|
|
|
7b4659 |
goto error;
|
|
|
7b4659 |
|
|
|
7b4659 |
vm->def->id = qemuDriverAllocateID(driver);
|
|
|
7b4659 |
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
|
|
|
7b4659 |
index 5494d51017..1a25b37729 100644
|
|
|
7b4659 |
--- a/src/test/test_driver.c
|
|
|
7b4659 |
+++ b/src/test/test_driver.c
|
|
|
7b4659 |
@@ -657,7 +657,7 @@ testDomainStartState(testDriverPtr privconn,
|
|
|
7b4659 |
|
|
|
7b4659 |
if (virDomainObjSetDefTransient(privconn->caps,
|
|
|
7b4659 |
privconn->xmlopt,
|
|
|
7b4659 |
- dom) < 0) {
|
|
|
7b4659 |
+ dom, NULL) < 0) {
|
|
|
7b4659 |
goto cleanup;
|
|
|
7b4659 |
}
|
|
|
7b4659 |
|
|
|
7b4659 |
diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c
|
|
|
7b4659 |
index c77988f01e..796de53d43 100644
|
|
|
7b4659 |
--- a/src/uml/uml_driver.c
|
|
|
7b4659 |
+++ b/src/uml/uml_driver.c
|
|
|
7b4659 |
@@ -1092,7 +1092,7 @@ static int umlStartVMDaemon(virConnectPtr conn,
|
|
|
7b4659 |
* report implicit runtime defaults in the XML, like vnc listen/socket
|
|
|
7b4659 |
*/
|
|
|
7b4659 |
VIR_DEBUG("Setting current domain def as transient");
|
|
|
7b4659 |
- if (virDomainObjSetDefTransient(driver->caps, driver->xmlopt, vm) < 0) {
|
|
|
7b4659 |
+ if (virDomainObjSetDefTransient(driver->caps, driver->xmlopt, vm, NULL) < 0) {
|
|
|
7b4659 |
VIR_FORCE_CLOSE(logfd);
|
|
|
7b4659 |
return -1;
|
|
|
7b4659 |
}
|
|
|
7b4659 |
diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c
|
|
|
7b4659 |
index bc199685c6..2dbf768e16 100644
|
|
|
7b4659 |
--- a/tests/qemuhotplugtest.c
|
|
|
7b4659 |
+++ b/tests/qemuhotplugtest.c
|
|
|
7b4659 |
@@ -425,7 +425,7 @@ testQemuHotplugCpuPrepare(const char *test,
|
|
|
7b4659 |
|
|
|
7b4659 |
/* create vm->newDef */
|
|
|
7b4659 |
data->vm->persistent = true;
|
|
|
7b4659 |
- if (virDomainObjSetDefTransient(caps, driver.xmlopt, data->vm) < 0)
|
|
|
7b4659 |
+ if (virDomainObjSetDefTransient(caps, driver.xmlopt, data->vm, NULL) < 0)
|
|
|
7b4659 |
goto error;
|
|
|
7b4659 |
|
|
|
7b4659 |
priv = data->vm->privateData;
|
|
|
7b4659 |
--
|
|
|
7b4659 |
2.22.1
|
|
|
7b4659 |
|