From: Michal Privoznik Date: Fri, 24 Oct 2025 13:42:53 +0000 (+0200) Subject: ch: Set transient domain definition X-Git-Tag: CVE-2025-12748~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=85cf0e4f17ae106ba7cec586f56c868b2b41b358;p=thirdparty%2Flibvirt.git ch: Set transient domain definition 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 Reviewed-by: Jiri Denemark --- 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; }