]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
ch: Set transient domain definition
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 24 Oct 2025 13:42:53 +0000 (15:42 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 10 Nov 2025 12:16:02 +0000 (13:16 +0100)
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>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
src/ch/ch_process.c

index 4ebb261805ab6846f14ae8d0e14e851a2311da2f..f16f2b3916cfec5412f66de2396b0f95ea331f38 100644 (file)
@@ -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;
 }