From: Michal Privoznik <mprivozn@redhat.com>
Libvirt's philosophy is that for a running domain there are two
(in general distinct) definitions: live definition (reflects the
running state) and inactive definition (used to seed the live
definition when domain is being created). That's why we have
VIR_DOMAIN_AFFECT_LIVE and VIR_DOMAIN_AFFECT_CONFIG flags to APIs
that modify domain definitions.
Well, the CH driver doesn't do this distinction. Fix this by
making the domain definition transient when it's being created.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
src/ch/ch_process.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/ch/ch_process.c b/src/ch/ch_process.c
index 4ebb261805..f16f2b3916 100644
--- a/src/ch/ch_process.c
+++ b/src/ch/ch_process.c
@@ -951,6 +951,10 @@ virCHProcessStart(virCHDriver *driver,
return -1;
}
+ VIR_DEBUG("Setting current domain def as transient");
+ if (virDomainObjSetDefTransient(driver->xmlopt, vm, NULL) < 0)
+ return -1;
+
VIR_DEBUG("Creating domain log file for %s domain", vm->def->name);
if (!(logCtxt = domainLogContextNew(cfg->stdioLogD, cfg->logDir,
CH_DRIVER_NAME,
@@ -1100,6 +1104,7 @@ virCHProcessStop(virCHDriver *driver,
virHostdevReAttachDomainDevices(driver->hostdevMgr, CH_DRIVER_NAME, def,
hostdev_flags);
+ virDomainObjRemoveTransientDef(vm);
virErrorRestore(&orig_err);
return 0;
}
--
2.51.0