mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-28 11:31:16 +00:00
conf: sanitize virDomainSaveStatus & virDomainSaveConfig APIs
Our normal practice is for the object type to be the name prefix, and the object instance be the first parameter passed in. Rename these to virDomainObjSave and virDomainDefSave moving their primary parameter to be the first one. Ensure that the xml options are passed into both functions in prep for future work. Finally enforce checking of the return type and mark all parameters as non-NULL. Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
5cedfbd100
commit
908701c64a
@ -545,8 +545,8 @@ bhyveDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int flag
|
||||
def = NULL;
|
||||
vm->persistent = 1;
|
||||
|
||||
if (virDomainSaveConfig(BHYVE_CONFIG_DIR, caps,
|
||||
vm->newDef ? vm->newDef : vm->def) < 0) {
|
||||
if (virDomainDefSave(vm->newDef ? vm->newDef : vm->def,
|
||||
privconn->xmlopt, caps, BHYVE_CONFIG_DIR) < 0) {
|
||||
virDomainObjListRemove(privconn->domains, vm);
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -211,9 +211,8 @@ virBhyveProcessStart(virConnectPtr conn,
|
||||
virDomainObjSetState(vm, VIR_DOMAIN_RUNNING, reason);
|
||||
priv->mon = bhyveMonitorOpen(vm, driver);
|
||||
|
||||
if (virDomainSaveStatus(driver->xmlopt,
|
||||
BHYVE_STATE_DIR,
|
||||
vm, caps) < 0)
|
||||
if (virDomainObjSave(vm, driver->xmlopt, caps,
|
||||
BHYVE_STATE_DIR) < 0)
|
||||
goto cleanup;
|
||||
|
||||
ret = 0;
|
||||
@ -430,9 +429,8 @@ virBhyveProcessReconnect(virDomainObjPtr vm,
|
||||
vm->def->id = -1;
|
||||
virDomainObjSetState(vm, VIR_DOMAIN_SHUTOFF,
|
||||
VIR_DOMAIN_SHUTOFF_UNKNOWN);
|
||||
ignore_value(virDomainSaveStatus(data->driver->xmlopt,
|
||||
BHYVE_STATE_DIR,
|
||||
vm, caps));
|
||||
ignore_value(virDomainObjSave(vm, data->driver->xmlopt, caps,
|
||||
BHYVE_STATE_DIR));
|
||||
}
|
||||
|
||||
virObjectUnref(caps);
|
||||
|
@ -29062,10 +29062,10 @@ virDomainDefCompatibleDevice(virDomainDefPtr def,
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
virDomainSaveXML(const char *configDir,
|
||||
virDomainDefPtr def,
|
||||
const char *xml)
|
||||
static int
|
||||
virDomainDefSaveXML(virDomainDefPtr def,
|
||||
const char *configDir,
|
||||
const char *xml)
|
||||
{
|
||||
char uuidstr[VIR_UUID_STRING_BUFLEN];
|
||||
g_autofree char *configFile = NULL;
|
||||
@ -29090,23 +29090,24 @@ virDomainSaveXML(const char *configDir,
|
||||
}
|
||||
|
||||
int
|
||||
virDomainSaveConfig(const char *configDir,
|
||||
virCapsPtr caps,
|
||||
virDomainDefPtr def)
|
||||
virDomainDefSave(virDomainDefPtr def,
|
||||
virDomainXMLOptionPtr xmlopt G_GNUC_UNUSED,
|
||||
virCapsPtr caps,
|
||||
const char *configDir)
|
||||
{
|
||||
g_autofree char *xml = NULL;
|
||||
|
||||
if (!(xml = virDomainDefFormat(def, caps, VIR_DOMAIN_DEF_FORMAT_SECURE)))
|
||||
return -1;
|
||||
|
||||
return virDomainSaveXML(configDir, def, xml);
|
||||
return virDomainDefSaveXML(def, configDir, xml);
|
||||
}
|
||||
|
||||
int
|
||||
virDomainSaveStatus(virDomainXMLOptionPtr xmlopt,
|
||||
const char *statusDir,
|
||||
virDomainObjPtr obj,
|
||||
virCapsPtr caps)
|
||||
virDomainObjSave(virDomainObjPtr obj,
|
||||
virDomainXMLOptionPtr xmlopt,
|
||||
virCapsPtr caps,
|
||||
const char *statusDir)
|
||||
{
|
||||
unsigned int flags = (VIR_DOMAIN_DEF_FORMAT_SECURE |
|
||||
VIR_DOMAIN_DEF_FORMAT_STATUS |
|
||||
@ -29119,7 +29120,7 @@ virDomainSaveStatus(virDomainXMLOptionPtr xmlopt,
|
||||
if (!(xml = virDomainObjFormat(xmlopt, obj, caps, flags)))
|
||||
return -1;
|
||||
|
||||
return virDomainSaveXML(statusDir, obj->def, xml);
|
||||
return virDomainDefSaveXML(obj->def, statusDir, xml);
|
||||
}
|
||||
|
||||
|
||||
@ -30221,7 +30222,7 @@ virDomainObjSetMetadata(virDomainObjPtr vm,
|
||||
if (virDomainDefSetMetadata(def, type, metadata, key, uri) < 0)
|
||||
return -1;
|
||||
|
||||
if (virDomainSaveStatus(xmlopt, stateDir, vm, caps) < 0)
|
||||
if (virDomainObjSave(vm, xmlopt, caps, stateDir) < 0)
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -30230,7 +30231,7 @@ virDomainObjSetMetadata(virDomainObjPtr vm,
|
||||
uri) < 0)
|
||||
return -1;
|
||||
|
||||
if (virDomainSaveConfig(configDir, caps, persistentDef) < 0)
|
||||
if (virDomainDefSave(persistentDef, xmlopt, caps, configDir) < 0)
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -3292,17 +3292,21 @@ ssize_t virDomainRedirdevDefFind(virDomainDefPtr def,
|
||||
virDomainRedirdevDefPtr redirdev);
|
||||
virDomainRedirdevDefPtr virDomainRedirdevDefRemove(virDomainDefPtr def, size_t idx);
|
||||
|
||||
int virDomainSaveXML(const char *configDir,
|
||||
virDomainDefPtr def,
|
||||
const char *xml);
|
||||
int virDomainDefSave(virDomainDefPtr def,
|
||||
virDomainXMLOptionPtr xmlopt,
|
||||
virCapsPtr caps,
|
||||
const char *configDir)
|
||||
G_GNUC_WARN_UNUSED_RESULT
|
||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2)
|
||||
ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4);
|
||||
|
||||
int virDomainSaveConfig(const char *configDir,
|
||||
virCapsPtr caps,
|
||||
virDomainDefPtr def);
|
||||
int virDomainSaveStatus(virDomainXMLOptionPtr xmlopt,
|
||||
const char *statusDir,
|
||||
virDomainObjPtr obj,
|
||||
virCapsPtr caps) G_GNUC_WARN_UNUSED_RESULT;
|
||||
int virDomainObjSave(virDomainObjPtr obj,
|
||||
virDomainXMLOptionPtr xmlopt,
|
||||
virCapsPtr caps,
|
||||
const char *statusDir)
|
||||
G_GNUC_WARN_UNUSED_RESULT
|
||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2)
|
||||
ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4);
|
||||
|
||||
typedef void (*virDomainLoadConfigNotify)(virDomainObjPtr dom,
|
||||
int newDomain,
|
||||
|
@ -309,6 +309,7 @@ virDomainDefParseFile;
|
||||
virDomainDefParseNode;
|
||||
virDomainDefParseString;
|
||||
virDomainDefPostParse;
|
||||
virDomainDefSave;
|
||||
virDomainDefSetMemoryTotal;
|
||||
virDomainDefSetVcpus;
|
||||
virDomainDefSetVcpusMax;
|
||||
@ -526,6 +527,7 @@ virDomainObjNew;
|
||||
virDomainObjParseFile;
|
||||
virDomainObjParseNode;
|
||||
virDomainObjRemoveTransientDef;
|
||||
virDomainObjSave;
|
||||
virDomainObjSetDefTransient;
|
||||
virDomainObjSetMetadata;
|
||||
virDomainObjSetState;
|
||||
@ -555,9 +557,6 @@ virDomainRNGModelTypeToString;
|
||||
virDomainRNGRemove;
|
||||
virDomainRunningReasonTypeFromString;
|
||||
virDomainRunningReasonTypeToString;
|
||||
virDomainSaveConfig;
|
||||
virDomainSaveStatus;
|
||||
virDomainSaveXML;
|
||||
virDomainSCSIDriveAddressIsUsed;
|
||||
virDomainSeclabelTypeFromString;
|
||||
virDomainSeclabelTypeToString;
|
||||
|
@ -1463,7 +1463,7 @@ libxlDomainStart(libxlDriverPrivatePtr driver,
|
||||
virDomainObjSetState(vm, VIR_DOMAIN_PAUSED, VIR_DOMAIN_PAUSED_USER);
|
||||
}
|
||||
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, cfg->caps) < 0)
|
||||
if (virDomainObjSave(vm, driver->xmlopt, cfg->caps, cfg->stateDir) < 0)
|
||||
goto destroy_dom;
|
||||
|
||||
if (virAtomicIntInc(&driver->nactive) == 1 && driver->inhibitCallback)
|
||||
|
@ -453,7 +453,7 @@ libxlReconnectDomain(virDomainObjPtr vm,
|
||||
|
||||
libxlReconnectNotifyNets(vm->def);
|
||||
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, cfg->caps) < 0)
|
||||
if (virDomainObjSave(vm, driver->xmlopt, cfg->caps, cfg->stateDir) < 0)
|
||||
VIR_WARN("Cannot update XML for running Xen guest %s", vm->def->name);
|
||||
|
||||
/* now that we know it's reconnected call the hook if present */
|
||||
@ -1188,7 +1188,7 @@ libxlDomainSuspend(virDomainPtr dom)
|
||||
VIR_DOMAIN_EVENT_SUSPENDED_PAUSED);
|
||||
}
|
||||
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, cfg->caps) < 0)
|
||||
if (virDomainObjSave(vm, driver->xmlopt, cfg->caps, cfg->stateDir) < 0)
|
||||
goto endjob;
|
||||
|
||||
ret = 0;
|
||||
@ -1242,7 +1242,7 @@ libxlDomainResume(virDomainPtr dom)
|
||||
VIR_DOMAIN_EVENT_RESUMED_UNPAUSED);
|
||||
}
|
||||
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, cfg->caps) < 0)
|
||||
if (virDomainObjSave(vm, driver->xmlopt, cfg->caps, cfg->stateDir) < 0)
|
||||
goto endjob;
|
||||
|
||||
ret = 0;
|
||||
@ -1667,7 +1667,7 @@ libxlDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem,
|
||||
virDomainDefSetMemoryTotal(persistentDef, newmem);
|
||||
if (persistentDef->mem.cur_balloon > newmem)
|
||||
persistentDef->mem.cur_balloon = newmem;
|
||||
ret = virDomainSaveConfig(cfg->configDir, cfg->caps, persistentDef);
|
||||
ret = virDomainDefSave(persistentDef, driver->xmlopt, cfg->caps, cfg->configDir);
|
||||
goto endjob;
|
||||
}
|
||||
|
||||
@ -1700,7 +1700,7 @@ libxlDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem,
|
||||
if (flags & VIR_DOMAIN_MEM_CONFIG) {
|
||||
sa_assert(persistentDef);
|
||||
persistentDef->mem.cur_balloon = newmem;
|
||||
ret = virDomainSaveConfig(cfg->configDir, cfg->caps, persistentDef);
|
||||
ret = virDomainDefSave(persistentDef, driver->xmlopt, cfg->caps, cfg->configDir);
|
||||
goto endjob;
|
||||
}
|
||||
}
|
||||
@ -2351,13 +2351,13 @@ libxlDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
|
||||
ret = 0;
|
||||
|
||||
if (flags & VIR_DOMAIN_VCPU_LIVE) {
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, cfg->caps) < 0) {
|
||||
if (virDomainObjSave(vm, driver->xmlopt, cfg->caps, cfg->stateDir) < 0) {
|
||||
VIR_WARN("Unable to save status on vm %s after changing vcpus",
|
||||
vm->def->name);
|
||||
}
|
||||
}
|
||||
if (flags & VIR_DOMAIN_VCPU_CONFIG) {
|
||||
if (virDomainSaveConfig(cfg->configDir, cfg->caps, def) < 0) {
|
||||
if (virDomainDefSave(def, driver->xmlopt, cfg->caps, cfg->configDir) < 0) {
|
||||
VIR_WARN("Unable to save configuration of vm %s after changing vcpus",
|
||||
vm->def->name);
|
||||
}
|
||||
@ -2507,9 +2507,9 @@ libxlDomainPinVcpuFlags(virDomainPtr dom, unsigned int vcpu,
|
||||
ret = 0;
|
||||
|
||||
if (flags & VIR_DOMAIN_AFFECT_LIVE) {
|
||||
ret = virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, cfg->caps);
|
||||
ret = virDomainObjSave(vm, driver->xmlopt, cfg->caps, cfg->stateDir);
|
||||
} else if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
|
||||
ret = virDomainSaveConfig(cfg->configDir, cfg->caps, targetDef);
|
||||
ret = virDomainDefSave(targetDef, driver->xmlopt, cfg->caps, cfg->configDir);
|
||||
}
|
||||
|
||||
endjob:
|
||||
@ -2869,9 +2869,8 @@ libxlDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int flag
|
||||
|
||||
vm->persistent = 1;
|
||||
|
||||
if (virDomainSaveConfig(cfg->configDir,
|
||||
cfg->caps,
|
||||
vm->newDef ? vm->newDef : vm->def) < 0) {
|
||||
if (virDomainDefSave(vm->newDef ? vm->newDef : vm->def,
|
||||
driver->xmlopt, cfg->caps, cfg->configDir) < 0) {
|
||||
virDomainObjListRemove(driver->domains, vm);
|
||||
goto cleanup;
|
||||
}
|
||||
@ -4145,7 +4144,7 @@ libxlDomainAttachDeviceFlags(virDomainPtr dom, const char *xml,
|
||||
* update domain status forcibly because the domain status may be
|
||||
* changed even if we attach the device failed.
|
||||
*/
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, cfg->caps) < 0)
|
||||
if (virDomainObjSave(vm, driver->xmlopt, cfg->caps, cfg->stateDir) < 0)
|
||||
goto endjob;
|
||||
}
|
||||
|
||||
@ -4153,7 +4152,7 @@ libxlDomainAttachDeviceFlags(virDomainPtr dom, const char *xml,
|
||||
|
||||
/* Finally, if no error until here, we can save config. */
|
||||
if (flags & VIR_DOMAIN_DEVICE_MODIFY_CONFIG) {
|
||||
ret = virDomainSaveConfig(cfg->configDir, cfg->caps, vmdef);
|
||||
ret = virDomainDefSave(vmdef, driver->xmlopt, cfg->caps, cfg->configDir);
|
||||
if (!ret) {
|
||||
virDomainObjAssignDef(vm, vmdef, false, NULL);
|
||||
vmdef = NULL;
|
||||
@ -4236,7 +4235,7 @@ libxlDomainDetachDeviceFlags(virDomainPtr dom, const char *xml,
|
||||
* update domain status forcibly because the domain status may be
|
||||
* changed even if we attach the device failed.
|
||||
*/
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, cfg->caps) < 0)
|
||||
if (virDomainObjSave(vm, driver->xmlopt, cfg->caps, cfg->stateDir) < 0)
|
||||
goto endjob;
|
||||
}
|
||||
|
||||
@ -4244,7 +4243,7 @@ libxlDomainDetachDeviceFlags(virDomainPtr dom, const char *xml,
|
||||
|
||||
/* Finally, if no error until here, we can save config. */
|
||||
if (flags & VIR_DOMAIN_DEVICE_MODIFY_CONFIG) {
|
||||
ret = virDomainSaveConfig(cfg->configDir, cfg->caps, vmdef);
|
||||
ret = virDomainDefSave(vmdef, driver->xmlopt, cfg->caps, cfg->configDir);
|
||||
if (!ret) {
|
||||
virDomainObjAssignDef(vm, vmdef, false, NULL);
|
||||
vmdef = NULL;
|
||||
@ -4324,13 +4323,13 @@ libxlDomainUpdateDeviceFlags(virDomainPtr dom, const char *xml,
|
||||
* update domain status forcibly because the domain status may be
|
||||
* changed even if we attach the device failed.
|
||||
*/
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, cfg->caps) < 0)
|
||||
if (virDomainObjSave(vm, driver->xmlopt, cfg->caps, cfg->stateDir) < 0)
|
||||
ret = -1;
|
||||
}
|
||||
|
||||
/* Finally, if no error until here, we can save config. */
|
||||
if (!ret && (flags & VIR_DOMAIN_DEVICE_MODIFY_CONFIG)) {
|
||||
ret = virDomainSaveConfig(cfg->configDir, cfg->caps, vmdef);
|
||||
ret = virDomainDefSave(vmdef, driver->xmlopt, cfg->caps, cfg->configDir);
|
||||
if (!ret) {
|
||||
virDomainObjAssignDef(vm, vmdef, false, NULL);
|
||||
vmdef = NULL;
|
||||
|
@ -1326,7 +1326,7 @@ libxlDomainMigrationDstFinish(virConnectPtr dconn,
|
||||
driver->xmlopt, vm, NULL)))
|
||||
goto cleanup;
|
||||
|
||||
if (virDomainSaveConfig(cfg->configDir, cfg->caps, vmdef) < 0)
|
||||
if (virDomainDefSave(vmdef, driver->xmlopt, cfg->caps, cfg->configDir) < 0)
|
||||
goto cleanup;
|
||||
|
||||
event = virDomainEventLifecycleNewFromObj(vm,
|
||||
@ -1338,7 +1338,7 @@ libxlDomainMigrationDstFinish(virConnectPtr dconn,
|
||||
event = NULL;
|
||||
}
|
||||
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, cfg->caps) < 0)
|
||||
if (virDomainObjSave(vm, driver->xmlopt, cfg->caps, cfg->stateDir) < 0)
|
||||
goto cleanup;
|
||||
|
||||
dom = virGetDomain(dconn, vm->def->name, vm->def->uuid, vm->def->id);
|
||||
@ -1388,7 +1388,7 @@ libxlDomainMigrationSrcConfirm(libxlDriverPrivatePtr driver,
|
||||
VIR_DOMAIN_PAUSED_MIGRATION);
|
||||
event = virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_SUSPENDED,
|
||||
VIR_DOMAIN_EVENT_SUSPENDED_MIGRATED);
|
||||
ignore_value(virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, cfg->caps));
|
||||
ignore_value(virDomainObjSave(vm, driver->xmlopt, cfg->caps, cfg->stateDir));
|
||||
}
|
||||
goto cleanup;
|
||||
}
|
||||
|
@ -443,8 +443,8 @@ lxcDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int flags)
|
||||
def = NULL;
|
||||
vm->persistent = 1;
|
||||
|
||||
if (virDomainSaveConfig(cfg->configDir, driver->caps,
|
||||
vm->newDef ? vm->newDef : vm->def) < 0) {
|
||||
if (virDomainDefSave(vm->newDef ? vm->newDef : vm->def,
|
||||
driver->xmlopt, driver->caps, cfg->configDir) < 0) {
|
||||
virDomainObjListRemove(driver->domains, vm);
|
||||
goto cleanup;
|
||||
}
|
||||
@ -677,8 +677,8 @@ static int lxcDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem,
|
||||
virDomainDefSetMemoryTotal(persistentDef, newmem);
|
||||
if (persistentDef->mem.cur_balloon > newmem)
|
||||
persistentDef->mem.cur_balloon = newmem;
|
||||
if (virDomainSaveConfig(cfg->configDir, driver->caps,
|
||||
persistentDef) < 0)
|
||||
if (virDomainDefSave(persistentDef,
|
||||
driver->xmlopt, driver->caps, cfg->configDir) < 0)
|
||||
goto endjob;
|
||||
}
|
||||
} else {
|
||||
@ -705,14 +705,14 @@ static int lxcDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem,
|
||||
}
|
||||
|
||||
def->mem.cur_balloon = newmem;
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0)
|
||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
||||
goto endjob;
|
||||
}
|
||||
|
||||
if (persistentDef) {
|
||||
persistentDef->mem.cur_balloon = newmem;
|
||||
if (virDomainSaveConfig(cfg->configDir, driver->caps,
|
||||
persistentDef) < 0)
|
||||
if (virDomainDefSave(persistentDef,
|
||||
driver->xmlopt, driver->caps, cfg->configDir) < 0)
|
||||
goto endjob;
|
||||
}
|
||||
}
|
||||
@ -857,11 +857,11 @@ lxcDomainSetMemoryParameters(virDomainPtr dom,
|
||||
#undef VIR_SET_MEM_PARAMETER
|
||||
|
||||
if (def &&
|
||||
virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0)
|
||||
virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
||||
goto endjob;
|
||||
|
||||
if (persistentDef &&
|
||||
virDomainSaveConfig(cfg->configDir, driver->caps, persistentDef) < 0)
|
||||
virDomainDefSave(persistentDef, driver->xmlopt, driver->caps, cfg->configDir) < 0)
|
||||
goto endjob;
|
||||
/* QEMU and LXC implementations are identical */
|
||||
|
||||
@ -1967,12 +1967,13 @@ lxcDomainSetSchedulerParametersFlags(virDomainPtr dom,
|
||||
}
|
||||
}
|
||||
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0)
|
||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
||||
goto endjob;
|
||||
|
||||
|
||||
if (persistentDef) {
|
||||
rc = virDomainSaveConfig(cfg->configDir, driver->caps, persistentDefCopy);
|
||||
rc = virDomainDefSave(persistentDefCopy, driver->xmlopt, driver->caps,
|
||||
cfg->configDir);
|
||||
if (rc < 0)
|
||||
goto endjob;
|
||||
|
||||
@ -2672,7 +2673,7 @@ lxcDomainSetBlkioParameters(virDomainPtr dom,
|
||||
}
|
||||
}
|
||||
|
||||
if (virDomainSaveConfig(cfg->configDir, driver->caps, persistentDef) < 0)
|
||||
if (virDomainDefSave(persistentDef, driver->xmlopt, driver->caps, cfg->configDir) < 0)
|
||||
ret = -1;
|
||||
}
|
||||
|
||||
@ -3029,7 +3030,7 @@ static int lxcDomainSuspend(virDomainPtr dom)
|
||||
VIR_DOMAIN_EVENT_SUSPENDED_PAUSED);
|
||||
}
|
||||
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0)
|
||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
||||
goto endjob;
|
||||
ret = 0;
|
||||
|
||||
@ -3086,7 +3087,7 @@ static int lxcDomainResume(virDomainPtr dom)
|
||||
VIR_DOMAIN_EVENT_RESUMED_UNPAUSED);
|
||||
}
|
||||
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0)
|
||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
||||
goto endjob;
|
||||
ret = 0;
|
||||
|
||||
@ -4743,7 +4744,7 @@ static int lxcDomainAttachDeviceFlags(virDomainPtr dom,
|
||||
* changed even if we failed to attach the device. For example,
|
||||
* a new controller may be created.
|
||||
*/
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0) {
|
||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0) {
|
||||
ret = -1;
|
||||
goto endjob;
|
||||
}
|
||||
@ -4751,7 +4752,7 @@ static int lxcDomainAttachDeviceFlags(virDomainPtr dom,
|
||||
|
||||
/* Finally, if no error until here, we can save config. */
|
||||
if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
|
||||
ret = virDomainSaveConfig(cfg->configDir, driver->caps, vmdef);
|
||||
ret = virDomainDefSave(vmdef, driver->xmlopt, driver->caps, cfg->configDir);
|
||||
if (!ret) {
|
||||
virDomainObjAssignDef(vm, vmdef, false, NULL);
|
||||
vmdef = NULL;
|
||||
@ -4830,7 +4831,7 @@ static int lxcDomainUpdateDeviceFlags(virDomainPtr dom,
|
||||
if (lxcDomainUpdateDeviceConfig(vmdef, dev) < 0)
|
||||
goto endjob;
|
||||
|
||||
if (virDomainSaveConfig(cfg->configDir, driver->caps, vmdef) < 0)
|
||||
if (virDomainDefSave(vmdef, driver->xmlopt, driver->caps, cfg->configDir) < 0)
|
||||
goto endjob;
|
||||
|
||||
virDomainObjAssignDef(vm, vmdef, false, NULL);
|
||||
@ -4917,7 +4918,7 @@ static int lxcDomainDetachDeviceFlags(virDomainPtr dom,
|
||||
* changed even if we failed to attach the device. For example,
|
||||
* a new controller may be created.
|
||||
*/
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0) {
|
||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0) {
|
||||
ret = -1;
|
||||
goto endjob;
|
||||
}
|
||||
@ -4925,7 +4926,7 @@ static int lxcDomainDetachDeviceFlags(virDomainPtr dom,
|
||||
|
||||
/* Finally, if no error until here, we can save config. */
|
||||
if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
|
||||
ret = virDomainSaveConfig(cfg->configDir, driver->caps, vmdef);
|
||||
ret = virDomainDefSave(vmdef, driver->xmlopt, driver->caps, cfg->configDir);
|
||||
if (!ret) {
|
||||
virDomainObjAssignDef(vm, vmdef, false, NULL);
|
||||
vmdef = NULL;
|
||||
|
@ -790,7 +790,7 @@ static void virLXCProcessMonitorInitNotify(virLXCMonitorPtr mon G_GNUC_UNUSED,
|
||||
}
|
||||
virDomainAuditInit(vm, initpid, inode);
|
||||
|
||||
if (virDomainSaveStatus(lxc_driver->xmlopt, cfg->stateDir, vm, lxc_driver->caps) < 0)
|
||||
if (virDomainObjSave(vm, lxc_driver->xmlopt, lxc_driver->caps, cfg->stateDir) < 0)
|
||||
VIR_WARN("Cannot update XML with PID for LXC %s", vm->def->name);
|
||||
|
||||
virObjectUnlock(vm);
|
||||
@ -1457,7 +1457,7 @@ int virLXCProcessStart(virConnectPtr conn,
|
||||
|
||||
/* Write domain status to disk for the controller to
|
||||
* read when it starts */
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0)
|
||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
||||
goto cleanup;
|
||||
|
||||
/* Allow the child to exec the controller */
|
||||
@ -1696,7 +1696,7 @@ virLXCProcessReconnectDomain(virDomainObjPtr vm,
|
||||
|
||||
virLXCProcessReconnectNotifyNets(vm->def);
|
||||
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0)
|
||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
||||
VIR_WARN("Cannot update XML for running LXC guest %s", vm->def->name);
|
||||
|
||||
/* now that we know it's reconnected call the hook if present */
|
||||
|
@ -8167,7 +8167,7 @@ qemuDomainObjSaveStatus(virQEMUDriverPtr driver,
|
||||
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
|
||||
|
||||
if (virDomainObjIsActive(obj)) {
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, obj, driver->caps) < 0)
|
||||
if (virDomainObjSave(obj, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
||||
VIR_WARN("Failed to save status on vm %s", obj->def->name);
|
||||
}
|
||||
|
||||
@ -8199,7 +8199,7 @@ qemuDomainSaveConfig(virDomainObjPtr obj)
|
||||
|
||||
cfg = virQEMUDriverGetConfig(driver);
|
||||
|
||||
if (virDomainSaveConfig(cfg->configDir, driver->caps, def) < 0)
|
||||
if (virDomainDefSave(def, driver->xmlopt, driver->caps, cfg->configDir) < 0)
|
||||
VIR_WARN("Failed to save config of vm %s", obj->def->name);
|
||||
}
|
||||
|
||||
@ -10072,7 +10072,7 @@ qemuDomainSetFakeReboot(virQEMUDriverPtr driver,
|
||||
|
||||
priv->fakeReboot = value;
|
||||
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0)
|
||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
||||
VIR_WARN("Failed to save status on vm %s", vm->def->name);
|
||||
|
||||
cleanup:
|
||||
|
@ -1860,7 +1860,7 @@ static int qemuDomainSuspend(virDomainPtr dom)
|
||||
if (qemuProcessStopCPUs(driver, vm, reason, QEMU_ASYNC_JOB_NONE) < 0)
|
||||
goto endjob;
|
||||
}
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0)
|
||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
||||
goto endjob;
|
||||
ret = 0;
|
||||
|
||||
@ -1918,7 +1918,7 @@ static int qemuDomainResume(virDomainPtr dom)
|
||||
goto endjob;
|
||||
}
|
||||
}
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0)
|
||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
||||
goto endjob;
|
||||
ret = 0;
|
||||
|
||||
@ -2360,8 +2360,8 @@ static int qemuDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem,
|
||||
|
||||
if (persistentDef->mem.cur_balloon > newmem)
|
||||
persistentDef->mem.cur_balloon = newmem;
|
||||
ret = virDomainSaveConfig(cfg->configDir, driver->caps,
|
||||
persistentDef);
|
||||
ret = virDomainDefSave(persistentDef, driver->xmlopt, driver->caps,
|
||||
cfg->configDir);
|
||||
goto endjob;
|
||||
}
|
||||
|
||||
@ -2400,8 +2400,8 @@ static int qemuDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem,
|
||||
|
||||
if (persistentDef) {
|
||||
persistentDef->mem.cur_balloon = newmem;
|
||||
ret = virDomainSaveConfig(cfg->configDir, driver->caps,
|
||||
persistentDef);
|
||||
ret = virDomainDefSave(persistentDef, driver->xmlopt, driver->caps,
|
||||
cfg->configDir);
|
||||
goto endjob;
|
||||
}
|
||||
}
|
||||
@ -2475,7 +2475,7 @@ static int qemuDomainSetMemoryStatsPeriod(virDomainPtr dom, int period,
|
||||
}
|
||||
|
||||
def->memballoon->period = period;
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0)
|
||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
||||
goto endjob;
|
||||
}
|
||||
|
||||
@ -2487,7 +2487,7 @@ static int qemuDomainSetMemoryStatsPeriod(virDomainPtr dom, int period,
|
||||
goto endjob;
|
||||
}
|
||||
persistentDef->memballoon->period = period;
|
||||
ret = virDomainSaveConfig(cfg->configDir, driver->caps, persistentDef);
|
||||
ret = virDomainDefSave(persistentDef, driver->xmlopt, driver->caps, cfg->configDir);
|
||||
goto endjob;
|
||||
}
|
||||
|
||||
@ -4201,7 +4201,7 @@ processGuestPanicEvent(virQEMUDriverPtr driver,
|
||||
|
||||
virObjectEventStateQueue(driver->domainEventState, event);
|
||||
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0) {
|
||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0) {
|
||||
VIR_WARN("Unable to save status on vm %s after state change",
|
||||
vm->def->name);
|
||||
}
|
||||
@ -4281,7 +4281,7 @@ processDeviceDeletedEvent(virQEMUDriverPtr driver,
|
||||
goto endjob;
|
||||
}
|
||||
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0)
|
||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
||||
VIR_WARN("unable to save domain status after removing device %s",
|
||||
devAlias);
|
||||
|
||||
@ -4649,7 +4649,7 @@ processSerialChangedEvent(virQEMUDriverPtr driver,
|
||||
|
||||
dev.data.chr->state = newstate;
|
||||
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0)
|
||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
||||
VIR_WARN("unable to save status of domain %s after updating state of "
|
||||
"channel %s", vm->def->name, devAlias);
|
||||
|
||||
@ -4975,7 +4975,7 @@ qemuDomainSetVcpusMax(virQEMUDriverPtr driver,
|
||||
if (virDomainDefSetVcpusMax(persistentDef, nvcpus, driver->xmlopt) < 0)
|
||||
return -1;
|
||||
|
||||
if (virDomainSaveConfig(cfg->configDir, driver->caps, persistentDef) < 0)
|
||||
if (virDomainDefSave(persistentDef, driver->xmlopt, driver->caps, cfg->configDir) < 0)
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
@ -5104,7 +5104,7 @@ qemuDomainPinVcpuLive(virDomainObjPtr vm,
|
||||
vcpuinfo->cpumask = tmpmap;
|
||||
tmpmap = NULL;
|
||||
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0)
|
||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (g_snprintf(paramField, VIR_TYPED_PARAM_FIELD_LENGTH,
|
||||
@ -5187,7 +5187,7 @@ qemuDomainPinVcpuFlags(virDomainPtr dom,
|
||||
vcpuinfo->cpumask = pcpumap;
|
||||
pcpumap = NULL;
|
||||
|
||||
ret = virDomainSaveConfig(cfg->configDir, driver->caps, persistentDef);
|
||||
ret = virDomainDefSave(persistentDef, driver->xmlopt, driver->caps, cfg->configDir);
|
||||
goto endjob;
|
||||
}
|
||||
|
||||
@ -5319,7 +5319,7 @@ qemuDomainPinEmulator(virDomainPtr dom,
|
||||
if (!(def->cputune.emulatorpin = virBitmapNewCopy(pcpumap)))
|
||||
goto endjob;
|
||||
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0)
|
||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
||||
goto endjob;
|
||||
|
||||
str = virBitmapFormat(pcpumap);
|
||||
@ -5339,7 +5339,7 @@ qemuDomainPinEmulator(virDomainPtr dom,
|
||||
if (!(persistentDef->cputune.emulatorpin = virBitmapNewCopy(pcpumap)))
|
||||
goto endjob;
|
||||
|
||||
ret = virDomainSaveConfig(cfg->configDir, driver->caps, persistentDef);
|
||||
ret = virDomainDefSave(persistentDef, driver->xmlopt, driver->caps, cfg->configDir);
|
||||
goto endjob;
|
||||
}
|
||||
|
||||
@ -5799,7 +5799,7 @@ qemuDomainPinIOThread(virDomainPtr dom,
|
||||
if (virProcessSetAffinity(iothrid->thread_id, pcpumap) < 0)
|
||||
goto endjob;
|
||||
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0)
|
||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
||||
goto endjob;
|
||||
|
||||
if (g_snprintf(paramField, VIR_TYPED_PARAM_FIELD_LENGTH,
|
||||
@ -5832,7 +5832,7 @@ qemuDomainPinIOThread(virDomainPtr dom,
|
||||
iothrid->cpumask = cpumask;
|
||||
iothrid->autofill = false;
|
||||
|
||||
ret = virDomainSaveConfig(cfg->configDir, driver->caps, persistentDef);
|
||||
ret = virDomainDefSave(persistentDef, driver->xmlopt, driver->caps, cfg->configDir);
|
||||
goto endjob;
|
||||
}
|
||||
|
||||
@ -6250,7 +6250,7 @@ qemuDomainChgIOThread(virQEMUDriverPtr driver,
|
||||
|
||||
}
|
||||
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0)
|
||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
||||
goto endjob;
|
||||
}
|
||||
|
||||
@ -6282,8 +6282,8 @@ qemuDomainChgIOThread(virQEMUDriverPtr driver,
|
||||
break;
|
||||
}
|
||||
|
||||
if (virDomainSaveConfig(cfg->configDir, driver->caps,
|
||||
persistentDef) < 0)
|
||||
if (virDomainDefSave(persistentDef, driver->xmlopt, driver->caps,
|
||||
cfg->configDir) < 0)
|
||||
goto endjob;
|
||||
}
|
||||
|
||||
@ -6894,7 +6894,7 @@ qemuDomainSaveImageStartVM(virConnectPtr conn,
|
||||
"%s", _("failed to resume domain"));
|
||||
goto cleanup;
|
||||
}
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0) {
|
||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0) {
|
||||
VIR_WARN("Failed to save status on vm %s", vm->def->name);
|
||||
goto cleanup;
|
||||
}
|
||||
@ -7608,8 +7608,8 @@ qemuDomainDefineXMLFlags(virConnectPtr conn,
|
||||
|
||||
vm->persistent = 1;
|
||||
|
||||
if (virDomainSaveConfig(cfg->configDir, driver->caps,
|
||||
vm->newDef ? vm->newDef : vm->def) < 0) {
|
||||
if (virDomainDefSave(vm->newDef ? vm->newDef : vm->def,
|
||||
driver->xmlopt, driver->caps, cfg->configDir) < 0) {
|
||||
if (oldDef) {
|
||||
/* There is backup so this VM was defined before.
|
||||
* Just restore the backup. */
|
||||
@ -8684,13 +8684,13 @@ qemuDomainAttachDeviceLiveAndConfig(virDomainObjPtr vm,
|
||||
* changed even if we failed to attach the device. For example,
|
||||
* a new controller may be created.
|
||||
*/
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0)
|
||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
/* Finally, if no error until here, we can save config. */
|
||||
if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
|
||||
if (virDomainSaveConfig(cfg->configDir, driver->caps, vmdef) < 0)
|
||||
if (virDomainDefSave(vmdef, driver->xmlopt, driver->caps, cfg->configDir) < 0)
|
||||
goto cleanup;
|
||||
|
||||
virDomainObjAssignDef(vm, vmdef, false, NULL);
|
||||
@ -8837,7 +8837,7 @@ static int qemuDomainUpdateDeviceFlags(virDomainPtr dom,
|
||||
* changed even if we failed to attach the device. For example,
|
||||
* a new controller may be created.
|
||||
*/
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0) {
|
||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0) {
|
||||
ret = -1;
|
||||
goto endjob;
|
||||
}
|
||||
@ -8845,7 +8845,7 @@ static int qemuDomainUpdateDeviceFlags(virDomainPtr dom,
|
||||
|
||||
/* Finally, if no error until here, we can save config. */
|
||||
if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
|
||||
ret = virDomainSaveConfig(cfg->configDir, driver->caps, vmdef);
|
||||
ret = virDomainDefSave(vmdef, driver->xmlopt, driver->caps, cfg->configDir);
|
||||
if (!ret) {
|
||||
virDomainObjAssignDef(vm, vmdef, false, NULL);
|
||||
vmdef = NULL;
|
||||
@ -8935,13 +8935,13 @@ qemuDomainDetachDeviceLiveAndConfig(virQEMUDriverPtr driver,
|
||||
* changed even if we failed to attach the device. For example,
|
||||
* a new controller may be created.
|
||||
*/
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, caps) < 0)
|
||||
if (virDomainObjSave(vm, driver->xmlopt, caps, cfg->stateDir) < 0)
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
/* Finally, if no error until here, we can save config. */
|
||||
if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
|
||||
if (virDomainSaveConfig(cfg->configDir, caps, vmdef) < 0)
|
||||
if (virDomainDefSave(vmdef, driver->xmlopt, caps, cfg->configDir) < 0)
|
||||
goto cleanup;
|
||||
|
||||
virDomainObjAssignDef(vm, vmdef, false, NULL);
|
||||
@ -9019,7 +9019,7 @@ qemuDomainDetachDeviceAliasLiveAndConfig(virQEMUDriverPtr driver,
|
||||
}
|
||||
|
||||
if (vmdef) {
|
||||
if (virDomainSaveConfig(cfg->configDir, caps, vmdef) < 0)
|
||||
if (virDomainDefSave(vmdef, driver->xmlopt, caps, cfg->configDir) < 0)
|
||||
goto cleanup;
|
||||
virDomainObjAssignDef(vm, vmdef, false, NULL);
|
||||
vmdef = NULL;
|
||||
@ -9601,7 +9601,7 @@ qemuDomainSetBlkioParameters(virDomainPtr dom,
|
||||
}
|
||||
}
|
||||
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0)
|
||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
||||
goto endjob;
|
||||
}
|
||||
if (ret < 0)
|
||||
@ -9636,7 +9636,7 @@ qemuDomainSetBlkioParameters(virDomainPtr dom,
|
||||
}
|
||||
}
|
||||
|
||||
if (virDomainSaveConfig(cfg->configDir, driver->caps, persistentDef) < 0)
|
||||
if (virDomainDefSave(persistentDef, driver->xmlopt, driver->caps, cfg->configDir) < 0)
|
||||
ret = -1;
|
||||
}
|
||||
|
||||
@ -9866,11 +9866,11 @@ qemuDomainSetMemoryParameters(virDomainPtr dom,
|
||||
#undef VIR_SET_MEM_PARAMETER
|
||||
|
||||
if (def &&
|
||||
virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0)
|
||||
virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
||||
goto endjob;
|
||||
|
||||
if (persistentDef &&
|
||||
virDomainSaveConfig(cfg->configDir, driver->caps, persistentDef) < 0)
|
||||
virDomainDefSave(persistentDef, driver->xmlopt, driver->caps, cfg->configDir) < 0)
|
||||
goto endjob;
|
||||
/* QEMU and LXC implementations are identical */
|
||||
|
||||
@ -10133,7 +10133,7 @@ qemuDomainSetNumaParameters(virDomainPtr dom,
|
||||
-1, mode, nodeset) < 0)
|
||||
goto endjob;
|
||||
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0)
|
||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
||||
goto endjob;
|
||||
}
|
||||
|
||||
@ -10144,7 +10144,7 @@ qemuDomainSetNumaParameters(virDomainPtr dom,
|
||||
-1, mode, nodeset) < 0)
|
||||
goto endjob;
|
||||
|
||||
if (virDomainSaveConfig(cfg->configDir, driver->caps, persistentDef) < 0)
|
||||
if (virDomainDefSave(persistentDef, driver->xmlopt, driver->caps, cfg->configDir) < 0)
|
||||
goto endjob;
|
||||
}
|
||||
|
||||
@ -10326,7 +10326,7 @@ qemuDomainSetPerfEvents(virDomainPtr dom,
|
||||
VIR_TRISTATE_BOOL_YES : VIR_TRISTATE_BOOL_NO;
|
||||
}
|
||||
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0)
|
||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
||||
goto endjob;
|
||||
}
|
||||
|
||||
@ -10340,7 +10340,7 @@ qemuDomainSetPerfEvents(virDomainPtr dom,
|
||||
VIR_TRISTATE_BOOL_YES : VIR_TRISTATE_BOOL_NO;
|
||||
}
|
||||
|
||||
if (virDomainSaveConfig(cfg->configDir, driver->caps, persistentDef) < 0)
|
||||
if (virDomainDefSave(persistentDef, driver->xmlopt, driver->caps, cfg->configDir) < 0)
|
||||
goto endjob;
|
||||
}
|
||||
|
||||
@ -10802,7 +10802,7 @@ qemuDomainSetSchedulerParametersFlags(virDomainPtr dom,
|
||||
}
|
||||
}
|
||||
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0)
|
||||
if (virDomainObjSave(vm, driver->xmlopt, caps, cfg->stateDir) < 0)
|
||||
goto endjob;
|
||||
|
||||
if (eventNparams) {
|
||||
@ -10812,7 +10812,8 @@ qemuDomainSetSchedulerParametersFlags(virDomainPtr dom,
|
||||
}
|
||||
|
||||
if (persistentDef) {
|
||||
rc = virDomainSaveConfig(cfg->configDir, driver->caps, persistentDefCopy);
|
||||
rc = virDomainDefSave(persistentDefCopy, driver->xmlopt, caps,
|
||||
cfg->configDir);
|
||||
if (rc < 0)
|
||||
goto endjob;
|
||||
|
||||
@ -11650,7 +11651,7 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom,
|
||||
goto endjob;
|
||||
}
|
||||
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0)
|
||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
||||
goto endjob;
|
||||
}
|
||||
|
||||
@ -11675,7 +11676,7 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom,
|
||||
}
|
||||
}
|
||||
|
||||
if (virDomainSaveConfig(cfg->configDir, driver->caps, persistentDef) < 0)
|
||||
if (virDomainDefSave(persistentDef, driver->xmlopt, driver->caps, cfg->configDir) < 0)
|
||||
goto endjob;
|
||||
}
|
||||
|
||||
@ -14668,7 +14669,7 @@ qemuDomainSnapshotCreateInactiveExternal(virQEMUDriverPtr driver,
|
||||
defdisk->src = g_steal_pointer(&newsrc);
|
||||
}
|
||||
|
||||
if (virDomainSaveConfig(cfg->configDir, driver->caps, vm->def) < 0)
|
||||
if (virDomainDefSave(vm->def, driver->xmlopt, driver->caps, cfg->configDir) < 0)
|
||||
goto cleanup;
|
||||
|
||||
ret = 0;
|
||||
@ -15605,9 +15606,9 @@ qemuDomainSnapshotCreateDiskActive(virQEMUDriverPtr driver,
|
||||
if (rc < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0 ||
|
||||
(vm->newDef && virDomainSaveConfig(cfg->configDir, driver->caps,
|
||||
vm->newDef) < 0))
|
||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0 ||
|
||||
(vm->newDef && virDomainDefSave(vm->newDef, driver->xmlopt, driver->caps,
|
||||
cfg->configDir) < 0))
|
||||
goto cleanup;
|
||||
|
||||
ret = 0;
|
||||
@ -16903,8 +16904,8 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
|
||||
}
|
||||
}
|
||||
if (ret == 0 && defined && vm->persistent &&
|
||||
!(ret = virDomainSaveConfig(cfg->configDir, driver->caps,
|
||||
vm->newDef ? vm->newDef : vm->def))) {
|
||||
!(ret = virDomainDefSave(vm->newDef ? vm->newDef : vm->def,
|
||||
driver->xmlopt, driver->caps, cfg->configDir))) {
|
||||
detail = VIR_DOMAIN_EVENT_DEFINED_FROM_SNAPSHOT;
|
||||
virObjectEventStateQueue(driver->domainEventState,
|
||||
virDomainEventLifecycleNewFromObj(vm,
|
||||
@ -17709,7 +17710,7 @@ qemuDomainBlockJobAbort(virDomainPtr dom,
|
||||
job->state = QEMU_BLOCKJOB_STATE_ABORTING;
|
||||
}
|
||||
|
||||
ignore_value(virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps));
|
||||
ignore_value(virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir));
|
||||
|
||||
if (!async) {
|
||||
qemuBlockJobUpdate(vm, job, QEMU_ASYNC_JOB_NONE);
|
||||
@ -19287,8 +19288,7 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
|
||||
if (virDomainDiskSetBlockIOTune(disk, &info) < 0)
|
||||
goto endjob;
|
||||
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir,
|
||||
vm, driver->caps) < 0)
|
||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
||||
goto endjob;
|
||||
|
||||
if (eventNparams) {
|
||||
@ -19313,8 +19313,8 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
|
||||
if (virDomainDiskSetBlockIOTune(conf_disk, &info) < 0)
|
||||
goto endjob;
|
||||
|
||||
if (virDomainSaveConfig(cfg->configDir, driver->caps,
|
||||
persistentDef) < 0)
|
||||
if (virDomainDefSave(persistentDef, driver->xmlopt, driver->caps,
|
||||
cfg->configDir) < 0)
|
||||
goto endjob;
|
||||
}
|
||||
|
||||
@ -21915,7 +21915,7 @@ qemuDomainRenameCallback(virDomainObjPtr vm,
|
||||
vm->def->name = new_dom_name;
|
||||
new_dom_name = NULL;
|
||||
|
||||
if (virDomainSaveConfig(cfg->configDir, driver->caps, vm->def) < 0)
|
||||
if (virDomainDefSave(vm->def, driver->xmlopt, driver->caps, cfg->configDir) < 0)
|
||||
goto rollback;
|
||||
|
||||
if (virFileExists(old_dom_cfg_file) &&
|
||||
@ -22439,16 +22439,15 @@ qemuDomainSetLifecycleAction(virDomainPtr dom,
|
||||
|
||||
qemuDomainModifyLifecycleAction(def, type, action);
|
||||
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir,
|
||||
vm, driver->caps) < 0)
|
||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
||||
goto endjob;
|
||||
}
|
||||
|
||||
if (persistentDef) {
|
||||
qemuDomainModifyLifecycleAction(persistentDef, type, action);
|
||||
|
||||
if (virDomainSaveConfig(cfg->configDir, driver->caps,
|
||||
persistentDef) < 0)
|
||||
if (virDomainDefSave(persistentDef, driver->xmlopt, driver->caps,
|
||||
cfg->configDir) < 0)
|
||||
goto endjob;
|
||||
}
|
||||
|
||||
@ -22743,7 +22742,7 @@ qemuDomainAgentSetResponseTimeout(virDomainPtr dom,
|
||||
QEMU_DOMAIN_PRIVATE(vm)->agentTimeout = timeout;
|
||||
|
||||
if (virDomainObjIsActive(vm) &&
|
||||
virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0)
|
||||
virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
||||
goto cleanup;
|
||||
|
||||
ret = 0;
|
||||
|
@ -5980,7 +5980,7 @@ qemuDomainHotplugDelVcpu(virQEMUDriverPtr driver,
|
||||
|
||||
qemuDomainVcpuPersistOrder(vm->def);
|
||||
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0)
|
||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
||||
goto cleanup;
|
||||
|
||||
ret = 0;
|
||||
@ -6055,7 +6055,7 @@ qemuDomainHotplugAddVcpu(virQEMUDriverPtr driver,
|
||||
|
||||
qemuDomainVcpuPersistOrder(vm->def);
|
||||
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0)
|
||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
||||
goto cleanup;
|
||||
|
||||
ret = 0;
|
||||
@ -6313,7 +6313,7 @@ qemuDomainSetVcpusInternal(virQEMUDriverPtr driver,
|
||||
if (persistentDef) {
|
||||
qemuDomainSetVcpusConfig(persistentDef, nvcpus, hotpluggable);
|
||||
|
||||
if (virDomainSaveConfig(cfg->configDir, driver->caps, persistentDef) < 0)
|
||||
if (virDomainDefSave(persistentDef, driver->xmlopt, driver->caps, cfg->configDir) < 0)
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
@ -6513,7 +6513,7 @@ qemuDomainSetVcpuInternal(virQEMUDriverPtr driver,
|
||||
if (persistentDef) {
|
||||
qemuDomainSetVcpuConfig(persistentDef, map, state);
|
||||
|
||||
if (virDomainSaveConfig(cfg->configDir, driver->caps, persistentDef) < 0)
|
||||
if (virDomainDefSave(persistentDef, driver->xmlopt, driver->caps, cfg->configDir) < 0)
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
|
@ -1037,7 +1037,7 @@ qemuMigrationSrcNBDStorageCopy(virQEMUDriverPtr driver,
|
||||
tlsAlias, flags) < 0)
|
||||
return -1;
|
||||
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0) {
|
||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0) {
|
||||
VIR_WARN("Failed to save status on vm %s", vm->def->name);
|
||||
return -1;
|
||||
}
|
||||
@ -3020,7 +3020,7 @@ qemuMigrationSrcConfirmPhase(virQEMUDriverPtr driver,
|
||||
qemuMigrationParamsReset(driver, vm, QEMU_ASYNC_JOB_MIGRATION_OUT,
|
||||
priv->job.migParams, priv->job.apiFlags);
|
||||
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0)
|
||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
||||
VIR_WARN("Failed to save status on vm %s", vm->def->name);
|
||||
}
|
||||
|
||||
@ -4871,7 +4871,7 @@ qemuMigrationDstPersist(virQEMUDriverPtr driver,
|
||||
priv->qemuCaps)))
|
||||
goto error;
|
||||
|
||||
if (virDomainSaveConfig(cfg->configDir, driver->caps, vmdef) < 0 &&
|
||||
if (virDomainDefSave(vmdef, driver->xmlopt, driver->caps, cfg->configDir) < 0 &&
|
||||
!ignoreSaveError)
|
||||
goto error;
|
||||
|
||||
@ -5124,7 +5124,7 @@ qemuMigrationDstFinish(virQEMUDriverPtr driver,
|
||||
}
|
||||
|
||||
if (virDomainObjIsActive(vm) &&
|
||||
virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0)
|
||||
virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
||||
VIR_WARN("Failed to save status on vm %s", vm->def->name);
|
||||
|
||||
/* Guest is successfully running, so cancel previous auto destroy */
|
||||
|
@ -411,7 +411,7 @@ qemuProcessHandleReset(qemuMonitorPtr mon G_GNUC_UNUSED,
|
||||
if (priv->agent)
|
||||
qemuAgentNotifyEvent(priv->agent, QEMU_AGENT_EVENT_RESET);
|
||||
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0)
|
||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
||||
VIR_WARN("Failed to save status on vm %s", vm->def->name);
|
||||
|
||||
if (vm->def->onReboot == VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY ||
|
||||
@ -493,7 +493,7 @@ qemuProcessFakeReboot(void *opaque)
|
||||
goto endjob;
|
||||
}
|
||||
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0) {
|
||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0) {
|
||||
VIR_WARN("Unable to save status on vm %s after state change",
|
||||
vm->def->name);
|
||||
}
|
||||
@ -614,7 +614,7 @@ qemuProcessHandleShutdown(qemuMonitorPtr mon G_GNUC_UNUSED,
|
||||
VIR_DOMAIN_EVENT_SHUTDOWN,
|
||||
detail);
|
||||
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0) {
|
||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0) {
|
||||
VIR_WARN("Unable to save status on vm %s after state change",
|
||||
vm->def->name);
|
||||
}
|
||||
@ -680,7 +680,7 @@ qemuProcessHandleStop(qemuMonitorPtr mon G_GNUC_UNUSED,
|
||||
VIR_WARN("Unable to release lease on %s", vm->def->name);
|
||||
VIR_DEBUG("Preserving lock state '%s'", NULLSTR(priv->lockState));
|
||||
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0) {
|
||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0) {
|
||||
VIR_WARN("Unable to save status on vm %s after state change",
|
||||
vm->def->name);
|
||||
}
|
||||
@ -726,7 +726,7 @@ qemuProcessHandleResume(qemuMonitorPtr mon G_GNUC_UNUSED,
|
||||
VIR_DOMAIN_EVENT_RESUMED,
|
||||
eventDetail);
|
||||
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0) {
|
||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0) {
|
||||
VIR_WARN("Unable to save status on vm %s after state change",
|
||||
vm->def->name);
|
||||
}
|
||||
@ -769,7 +769,7 @@ qemuProcessHandleRTCChange(qemuMonitorPtr mon G_GNUC_UNUSED,
|
||||
offset += vm->def->clock.data.variable.adjustment0;
|
||||
vm->def->clock.data.variable.adjustment = offset;
|
||||
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0)
|
||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
||||
VIR_WARN("unable to save domain status with RTC change");
|
||||
}
|
||||
|
||||
@ -812,7 +812,7 @@ qemuProcessHandleWatchdog(qemuMonitorPtr mon G_GNUC_UNUSED,
|
||||
VIR_WARN("Unable to release lease on %s", vm->def->name);
|
||||
VIR_DEBUG("Preserving lock state '%s'", NULLSTR(priv->lockState));
|
||||
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0) {
|
||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0) {
|
||||
VIR_WARN("Unable to save status on vm %s after watchdog event",
|
||||
vm->def->name);
|
||||
}
|
||||
@ -904,7 +904,7 @@ qemuProcessHandleIOError(qemuMonitorPtr mon G_GNUC_UNUSED,
|
||||
VIR_WARN("Unable to release lease on %s", vm->def->name);
|
||||
VIR_DEBUG("Preserving lock state '%s'", NULLSTR(priv->lockState));
|
||||
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0)
|
||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
||||
VIR_WARN("Unable to save status on vm %s after IO error", vm->def->name);
|
||||
}
|
||||
virObjectUnlock(vm);
|
||||
@ -1149,7 +1149,7 @@ qemuProcessHandleTrayChange(qemuMonitorPtr mon G_GNUC_UNUSED,
|
||||
else if (reason == VIR_DOMAIN_EVENT_TRAY_CHANGE_CLOSE)
|
||||
disk->tray_status = VIR_DOMAIN_DISK_TRAY_CLOSED;
|
||||
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0) {
|
||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0) {
|
||||
VIR_WARN("Unable to save status on vm %s after tray moved event",
|
||||
vm->def->name);
|
||||
}
|
||||
@ -1189,7 +1189,7 @@ qemuProcessHandlePMWakeup(qemuMonitorPtr mon G_GNUC_UNUSED,
|
||||
VIR_DOMAIN_EVENT_STARTED,
|
||||
VIR_DOMAIN_EVENT_STARTED_WAKEUP);
|
||||
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0) {
|
||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0) {
|
||||
VIR_WARN("Unable to save status on vm %s after wakeup event",
|
||||
vm->def->name);
|
||||
}
|
||||
@ -1227,7 +1227,7 @@ qemuProcessHandlePMSuspend(qemuMonitorPtr mon G_GNUC_UNUSED,
|
||||
VIR_DOMAIN_EVENT_PMSUSPENDED,
|
||||
VIR_DOMAIN_EVENT_PMSUSPENDED_MEMORY);
|
||||
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0) {
|
||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0) {
|
||||
VIR_WARN("Unable to save status on vm %s after suspend event",
|
||||
vm->def->name);
|
||||
}
|
||||
@ -1261,7 +1261,7 @@ qemuProcessHandleBalloonChange(qemuMonitorPtr mon G_GNUC_UNUSED,
|
||||
vm->def->mem.cur_balloon, actual);
|
||||
vm->def->mem.cur_balloon = actual;
|
||||
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0)
|
||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
||||
VIR_WARN("unable to save domain status with balloon change");
|
||||
|
||||
virObjectUnlock(vm);
|
||||
@ -1296,7 +1296,7 @@ qemuProcessHandlePMSuspendDisk(qemuMonitorPtr mon G_GNUC_UNUSED,
|
||||
VIR_DOMAIN_EVENT_PMSUSPENDED,
|
||||
VIR_DOMAIN_EVENT_PMSUSPENDED_DISK);
|
||||
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0) {
|
||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0) {
|
||||
VIR_WARN("Unable to save status on vm %s after suspend event",
|
||||
vm->def->name);
|
||||
}
|
||||
@ -1669,7 +1669,7 @@ qemuProcessHandleMigrationStatus(qemuMonitorPtr mon G_GNUC_UNUSED,
|
||||
VIR_DOMAIN_EVENT_SUSPENDED,
|
||||
VIR_DOMAIN_EVENT_SUSPENDED_POSTCOPY);
|
||||
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0) {
|
||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0) {
|
||||
VIR_WARN("Unable to save status on vm %s after state change",
|
||||
vm->def->name);
|
||||
}
|
||||
@ -3105,7 +3105,7 @@ qemuProcessUpdateVideoRamSize(virQEMUDriverPtr driver,
|
||||
return -1;
|
||||
|
||||
cfg = virQEMUDriverGetConfig(driver);
|
||||
ret = virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps);
|
||||
ret = virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir);
|
||||
virObjectUnref(cfg);
|
||||
|
||||
return ret;
|
||||
@ -6860,7 +6860,7 @@ qemuProcessLaunch(virConnectPtr conn,
|
||||
}
|
||||
|
||||
VIR_DEBUG("Writing early domain status to disk");
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0)
|
||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
||||
goto cleanup;
|
||||
|
||||
VIR_DEBUG("Waiting for handshake from child");
|
||||
@ -7118,7 +7118,7 @@ qemuProcessFinishStartup(virQEMUDriverPtr driver,
|
||||
}
|
||||
|
||||
VIR_DEBUG("Writing domain status to disk");
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0)
|
||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (qemuProcessStartHook(driver, vm,
|
||||
@ -8223,7 +8223,7 @@ qemuProcessReconnect(void *opaque)
|
||||
}
|
||||
|
||||
/* update domain state XML with possibly updated state in virDomainObj */
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, obj, driver->caps) < 0)
|
||||
if (virDomainObjSave(obj, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
||||
goto error;
|
||||
|
||||
/* Run an hook to allow admins to do some magic */
|
||||
|
Loading…
Reference in New Issue
Block a user