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>
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,
virHostdevReAttachDomainDevices(driver->hostdevMgr, CH_DRIVER_NAME, def,
hostdev_flags);
+ virDomainObjRemoveTransientDef(vm);
virErrorRestore(&orig_err);
return 0;
}