mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
conf: drop virCapsPtr param from APIs for saving domains
Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
24d87d2e88
commit
78d8228eec
@ -540,7 +540,7 @@ bhyveDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int flag
|
|||||||
vm->persistent = 1;
|
vm->persistent = 1;
|
||||||
|
|
||||||
if (virDomainDefSave(vm->newDef ? vm->newDef : vm->def,
|
if (virDomainDefSave(vm->newDef ? vm->newDef : vm->def,
|
||||||
privconn->xmlopt, caps, BHYVE_CONFIG_DIR) < 0) {
|
privconn->xmlopt, BHYVE_CONFIG_DIR) < 0) {
|
||||||
virDomainObjListRemove(privconn->domains, vm);
|
virDomainObjListRemove(privconn->domains, vm);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -1063,7 +1063,6 @@ bhyveDomainSetMetadata(virDomainPtr dom,
|
|||||||
{
|
{
|
||||||
bhyveConnPtr privconn = dom->conn->privateData;
|
bhyveConnPtr privconn = dom->conn->privateData;
|
||||||
virDomainObjPtr vm;
|
virDomainObjPtr vm;
|
||||||
virCapsPtr caps = NULL;
|
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
|
virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
|
||||||
@ -1075,10 +1074,7 @@ bhyveDomainSetMetadata(virDomainPtr dom,
|
|||||||
if (virDomainSetMetadataEnsureACL(dom->conn, vm->def, flags) < 0)
|
if (virDomainSetMetadataEnsureACL(dom->conn, vm->def, flags) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (!(caps = bhyveDriverGetCapabilities(privconn)))
|
ret = virDomainObjSetMetadata(vm, type, metadata, key, uri,
|
||||||
goto cleanup;
|
|
||||||
|
|
||||||
ret = virDomainObjSetMetadata(vm, type, metadata, key, uri, caps,
|
|
||||||
privconn->xmlopt, BHYVE_STATE_DIR,
|
privconn->xmlopt, BHYVE_STATE_DIR,
|
||||||
BHYVE_CONFIG_DIR, flags);
|
BHYVE_CONFIG_DIR, flags);
|
||||||
|
|
||||||
@ -1090,7 +1086,6 @@ bhyveDomainSetMetadata(virDomainPtr dom,
|
|||||||
|
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
virObjectUnref(caps);
|
|
||||||
virDomainObjEndAPI(&vm);
|
virDomainObjEndAPI(&vm);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -110,14 +110,9 @@ virBhyveProcessStart(virConnectPtr conn,
|
|||||||
bhyveConnPtr privconn = conn->privateData;
|
bhyveConnPtr privconn = conn->privateData;
|
||||||
bhyveDomainObjPrivatePtr priv = vm->privateData;
|
bhyveDomainObjPrivatePtr priv = vm->privateData;
|
||||||
int ret = -1, rc;
|
int ret = -1, rc;
|
||||||
virCapsPtr caps = NULL;
|
|
||||||
|
|
||||||
logfile = g_strdup_printf("%s/%s.log", BHYVE_LOG_DIR, vm->def->name);
|
logfile = g_strdup_printf("%s/%s.log", BHYVE_LOG_DIR, vm->def->name);
|
||||||
|
|
||||||
caps = bhyveDriverGetCapabilities(privconn);
|
|
||||||
if (!caps)
|
|
||||||
goto cleanup;
|
|
||||||
|
|
||||||
if ((logfd = open(logfile, O_WRONLY | O_APPEND | O_CREAT,
|
if ((logfd = open(logfile, O_WRONLY | O_APPEND | O_CREAT,
|
||||||
S_IRUSR | S_IWUSR)) < 0) {
|
S_IRUSR | S_IWUSR)) < 0) {
|
||||||
virReportSystemError(errno,
|
virReportSystemError(errno,
|
||||||
@ -211,14 +206,13 @@ virBhyveProcessStart(virConnectPtr conn,
|
|||||||
virDomainObjSetState(vm, VIR_DOMAIN_RUNNING, reason);
|
virDomainObjSetState(vm, VIR_DOMAIN_RUNNING, reason);
|
||||||
priv->mon = bhyveMonitorOpen(vm, driver);
|
priv->mon = bhyveMonitorOpen(vm, driver);
|
||||||
|
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, caps,
|
if (virDomainObjSave(vm, driver->xmlopt,
|
||||||
BHYVE_STATE_DIR) < 0)
|
BHYVE_STATE_DIR) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
virObjectUnref(caps);
|
|
||||||
if (devicemap != NULL) {
|
if (devicemap != NULL) {
|
||||||
rc = unlink(devmap_file);
|
rc = unlink(devmap_file);
|
||||||
if (rc < 0 && errno != ENOENT)
|
if (rc < 0 && errno != ENOENT)
|
||||||
@ -384,7 +378,6 @@ virBhyveProcessReconnect(virDomainObjPtr vm,
|
|||||||
char *expected_proctitle = NULL;
|
char *expected_proctitle = NULL;
|
||||||
bhyveDomainObjPrivatePtr priv = vm->privateData;
|
bhyveDomainObjPrivatePtr priv = vm->privateData;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
virCapsPtr caps = NULL;
|
|
||||||
|
|
||||||
if (!virDomainObjIsActive(vm))
|
if (!virDomainObjIsActive(vm))
|
||||||
return 0;
|
return 0;
|
||||||
@ -392,10 +385,6 @@ virBhyveProcessReconnect(virDomainObjPtr vm,
|
|||||||
if (!vm->pid)
|
if (!vm->pid)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
caps = bhyveDriverGetCapabilities(data->driver);
|
|
||||||
if (!caps)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
virObjectLock(vm);
|
virObjectLock(vm);
|
||||||
|
|
||||||
kp = kvm_getprocs(data->kd, KERN_PROC_PID, vm->pid, &nprocs);
|
kp = kvm_getprocs(data->kd, KERN_PROC_PID, vm->pid, &nprocs);
|
||||||
@ -429,11 +418,10 @@ virBhyveProcessReconnect(virDomainObjPtr vm,
|
|||||||
vm->def->id = -1;
|
vm->def->id = -1;
|
||||||
virDomainObjSetState(vm, VIR_DOMAIN_SHUTOFF,
|
virDomainObjSetState(vm, VIR_DOMAIN_SHUTOFF,
|
||||||
VIR_DOMAIN_SHUTOFF_UNKNOWN);
|
VIR_DOMAIN_SHUTOFF_UNKNOWN);
|
||||||
ignore_value(virDomainObjSave(vm, data->driver->xmlopt, caps,
|
ignore_value(virDomainObjSave(vm, data->driver->xmlopt,
|
||||||
BHYVE_STATE_DIR));
|
BHYVE_STATE_DIR));
|
||||||
}
|
}
|
||||||
|
|
||||||
virObjectUnref(caps);
|
|
||||||
virObjectUnlock(vm);
|
virObjectUnlock(vm);
|
||||||
VIR_FREE(expected_proctitle);
|
VIR_FREE(expected_proctitle);
|
||||||
|
|
||||||
|
@ -29035,7 +29035,6 @@ virDomainDefSaveXML(virDomainDefPtr def,
|
|||||||
int
|
int
|
||||||
virDomainDefSave(virDomainDefPtr def,
|
virDomainDefSave(virDomainDefPtr def,
|
||||||
virDomainXMLOptionPtr xmlopt,
|
virDomainXMLOptionPtr xmlopt,
|
||||||
virCapsPtr caps G_GNUC_UNUSED,
|
|
||||||
const char *configDir)
|
const char *configDir)
|
||||||
{
|
{
|
||||||
g_autofree char *xml = NULL;
|
g_autofree char *xml = NULL;
|
||||||
@ -29049,7 +29048,6 @@ virDomainDefSave(virDomainDefPtr def,
|
|||||||
int
|
int
|
||||||
virDomainObjSave(virDomainObjPtr obj,
|
virDomainObjSave(virDomainObjPtr obj,
|
||||||
virDomainXMLOptionPtr xmlopt,
|
virDomainXMLOptionPtr xmlopt,
|
||||||
virCapsPtr caps G_GNUC_UNUSED,
|
|
||||||
const char *statusDir)
|
const char *statusDir)
|
||||||
{
|
{
|
||||||
unsigned int flags = (VIR_DOMAIN_DEF_FORMAT_SECURE |
|
unsigned int flags = (VIR_DOMAIN_DEF_FORMAT_SECURE |
|
||||||
@ -30141,7 +30139,6 @@ virDomainObjSetMetadata(virDomainObjPtr vm,
|
|||||||
const char *metadata,
|
const char *metadata,
|
||||||
const char *key,
|
const char *key,
|
||||||
const char *uri,
|
const char *uri,
|
||||||
virCapsPtr caps,
|
|
||||||
virDomainXMLOptionPtr xmlopt,
|
virDomainXMLOptionPtr xmlopt,
|
||||||
const char *stateDir,
|
const char *stateDir,
|
||||||
const char *configDir,
|
const char *configDir,
|
||||||
@ -30160,7 +30157,7 @@ virDomainObjSetMetadata(virDomainObjPtr vm,
|
|||||||
if (virDomainDefSetMetadata(def, type, metadata, key, uri) < 0)
|
if (virDomainDefSetMetadata(def, type, metadata, key, uri) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (virDomainObjSave(vm, xmlopt, caps, stateDir) < 0)
|
if (virDomainObjSave(vm, xmlopt, stateDir) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -30169,7 +30166,7 @@ virDomainObjSetMetadata(virDomainObjPtr vm,
|
|||||||
uri) < 0)
|
uri) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (virDomainDefSave(persistentDef, xmlopt, caps, configDir) < 0)
|
if (virDomainDefSave(persistentDef, xmlopt, configDir) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3283,7 +3283,6 @@ virDomainRedirdevDefPtr virDomainRedirdevDefRemove(virDomainDefPtr def, size_t i
|
|||||||
|
|
||||||
int virDomainDefSave(virDomainDefPtr def,
|
int virDomainDefSave(virDomainDefPtr def,
|
||||||
virDomainXMLOptionPtr xmlopt,
|
virDomainXMLOptionPtr xmlopt,
|
||||||
virCapsPtr caps,
|
|
||||||
const char *configDir)
|
const char *configDir)
|
||||||
G_GNUC_WARN_UNUSED_RESULT
|
G_GNUC_WARN_UNUSED_RESULT
|
||||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2)
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2)
|
||||||
@ -3291,7 +3290,6 @@ int virDomainDefSave(virDomainDefPtr def,
|
|||||||
|
|
||||||
int virDomainObjSave(virDomainObjPtr obj,
|
int virDomainObjSave(virDomainObjPtr obj,
|
||||||
virDomainXMLOptionPtr xmlopt,
|
virDomainXMLOptionPtr xmlopt,
|
||||||
virCapsPtr caps,
|
|
||||||
const char *statusDir)
|
const char *statusDir)
|
||||||
G_GNUC_WARN_UNUSED_RESULT
|
G_GNUC_WARN_UNUSED_RESULT
|
||||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2)
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2)
|
||||||
@ -3541,7 +3539,6 @@ int virDomainObjSetMetadata(virDomainObjPtr vm,
|
|||||||
const char *metadata,
|
const char *metadata,
|
||||||
const char *key,
|
const char *key,
|
||||||
const char *uri,
|
const char *uri,
|
||||||
virCapsPtr caps,
|
|
||||||
virDomainXMLOptionPtr xmlopt,
|
virDomainXMLOptionPtr xmlopt,
|
||||||
const char *stateDir,
|
const char *stateDir,
|
||||||
const char *configDir,
|
const char *configDir,
|
||||||
|
@ -1470,7 +1470,7 @@ libxlDomainStart(libxlDriverPrivatePtr driver,
|
|||||||
virDomainObjSetState(vm, VIR_DOMAIN_PAUSED, VIR_DOMAIN_PAUSED_USER);
|
virDomainObjSetState(vm, VIR_DOMAIN_PAUSED, VIR_DOMAIN_PAUSED_USER);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, cfg->caps, cfg->stateDir) < 0)
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0)
|
||||||
goto destroy_dom;
|
goto destroy_dom;
|
||||||
|
|
||||||
if (virAtomicIntInc(&driver->nactive) == 1 && driver->inhibitCallback)
|
if (virAtomicIntInc(&driver->nactive) == 1 && driver->inhibitCallback)
|
||||||
|
@ -453,7 +453,7 @@ libxlReconnectDomain(virDomainObjPtr vm,
|
|||||||
|
|
||||||
libxlReconnectNotifyNets(vm->def);
|
libxlReconnectNotifyNets(vm->def);
|
||||||
|
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, cfg->caps, cfg->stateDir) < 0)
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0)
|
||||||
VIR_WARN("Cannot update XML for running Xen guest %s", vm->def->name);
|
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 */
|
/* now that we know it's reconnected call the hook if present */
|
||||||
@ -1188,7 +1188,7 @@ libxlDomainSuspend(virDomainPtr dom)
|
|||||||
VIR_DOMAIN_EVENT_SUSPENDED_PAUSED);
|
VIR_DOMAIN_EVENT_SUSPENDED_PAUSED);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, cfg->caps, cfg->stateDir) < 0)
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0)
|
||||||
goto endjob;
|
goto endjob;
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
@ -1242,7 +1242,7 @@ libxlDomainResume(virDomainPtr dom)
|
|||||||
VIR_DOMAIN_EVENT_RESUMED_UNPAUSED);
|
VIR_DOMAIN_EVENT_RESUMED_UNPAUSED);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, cfg->caps, cfg->stateDir) < 0)
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0)
|
||||||
goto endjob;
|
goto endjob;
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
@ -1667,7 +1667,7 @@ libxlDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem,
|
|||||||
virDomainDefSetMemoryTotal(persistentDef, newmem);
|
virDomainDefSetMemoryTotal(persistentDef, newmem);
|
||||||
if (persistentDef->mem.cur_balloon > newmem)
|
if (persistentDef->mem.cur_balloon > newmem)
|
||||||
persistentDef->mem.cur_balloon = newmem;
|
persistentDef->mem.cur_balloon = newmem;
|
||||||
ret = virDomainDefSave(persistentDef, driver->xmlopt, cfg->caps, cfg->configDir);
|
ret = virDomainDefSave(persistentDef, driver->xmlopt, cfg->configDir);
|
||||||
goto endjob;
|
goto endjob;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1700,7 +1700,7 @@ libxlDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem,
|
|||||||
if (flags & VIR_DOMAIN_MEM_CONFIG) {
|
if (flags & VIR_DOMAIN_MEM_CONFIG) {
|
||||||
sa_assert(persistentDef);
|
sa_assert(persistentDef);
|
||||||
persistentDef->mem.cur_balloon = newmem;
|
persistentDef->mem.cur_balloon = newmem;
|
||||||
ret = virDomainDefSave(persistentDef, driver->xmlopt, cfg->caps, cfg->configDir);
|
ret = virDomainDefSave(persistentDef, driver->xmlopt, cfg->configDir);
|
||||||
goto endjob;
|
goto endjob;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2351,13 +2351,13 @@ libxlDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
|
|||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
if (flags & VIR_DOMAIN_VCPU_LIVE) {
|
if (flags & VIR_DOMAIN_VCPU_LIVE) {
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, cfg->caps, cfg->stateDir) < 0) {
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0) {
|
||||||
VIR_WARN("Unable to save status on vm %s after changing vcpus",
|
VIR_WARN("Unable to save status on vm %s after changing vcpus",
|
||||||
vm->def->name);
|
vm->def->name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (flags & VIR_DOMAIN_VCPU_CONFIG) {
|
if (flags & VIR_DOMAIN_VCPU_CONFIG) {
|
||||||
if (virDomainDefSave(def, driver->xmlopt, cfg->caps, cfg->configDir) < 0) {
|
if (virDomainDefSave(def, driver->xmlopt, cfg->configDir) < 0) {
|
||||||
VIR_WARN("Unable to save configuration of vm %s after changing vcpus",
|
VIR_WARN("Unable to save configuration of vm %s after changing vcpus",
|
||||||
vm->def->name);
|
vm->def->name);
|
||||||
}
|
}
|
||||||
@ -2507,9 +2507,9 @@ libxlDomainPinVcpuFlags(virDomainPtr dom, unsigned int vcpu,
|
|||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
if (flags & VIR_DOMAIN_AFFECT_LIVE) {
|
if (flags & VIR_DOMAIN_AFFECT_LIVE) {
|
||||||
ret = virDomainObjSave(vm, driver->xmlopt, cfg->caps, cfg->stateDir);
|
ret = virDomainObjSave(vm, driver->xmlopt, cfg->stateDir);
|
||||||
} else if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
|
} else if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
|
||||||
ret = virDomainDefSave(targetDef, driver->xmlopt, cfg->caps, cfg->configDir);
|
ret = virDomainDefSave(targetDef, driver->xmlopt, cfg->configDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
endjob:
|
endjob:
|
||||||
@ -2870,7 +2870,7 @@ libxlDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int flag
|
|||||||
vm->persistent = 1;
|
vm->persistent = 1;
|
||||||
|
|
||||||
if (virDomainDefSave(vm->newDef ? vm->newDef : vm->def,
|
if (virDomainDefSave(vm->newDef ? vm->newDef : vm->def,
|
||||||
driver->xmlopt, cfg->caps, cfg->configDir) < 0) {
|
driver->xmlopt, cfg->configDir) < 0) {
|
||||||
virDomainObjListRemove(driver->domains, vm);
|
virDomainObjListRemove(driver->domains, vm);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -4143,7 +4143,7 @@ libxlDomainAttachDeviceFlags(virDomainPtr dom, const char *xml,
|
|||||||
* update domain status forcibly because the domain status may be
|
* update domain status forcibly because the domain status may be
|
||||||
* changed even if we attach the device failed.
|
* changed even if we attach the device failed.
|
||||||
*/
|
*/
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, cfg->caps, cfg->stateDir) < 0)
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0)
|
||||||
goto endjob;
|
goto endjob;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4151,7 +4151,7 @@ libxlDomainAttachDeviceFlags(virDomainPtr dom, const char *xml,
|
|||||||
|
|
||||||
/* Finally, if no error until here, we can save config. */
|
/* Finally, if no error until here, we can save config. */
|
||||||
if (flags & VIR_DOMAIN_DEVICE_MODIFY_CONFIG) {
|
if (flags & VIR_DOMAIN_DEVICE_MODIFY_CONFIG) {
|
||||||
ret = virDomainDefSave(vmdef, driver->xmlopt, cfg->caps, cfg->configDir);
|
ret = virDomainDefSave(vmdef, driver->xmlopt, cfg->configDir);
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
virDomainObjAssignDef(vm, vmdef, false, NULL);
|
virDomainObjAssignDef(vm, vmdef, false, NULL);
|
||||||
vmdef = NULL;
|
vmdef = NULL;
|
||||||
@ -4233,7 +4233,7 @@ libxlDomainDetachDeviceFlags(virDomainPtr dom, const char *xml,
|
|||||||
* update domain status forcibly because the domain status may be
|
* update domain status forcibly because the domain status may be
|
||||||
* changed even if we attach the device failed.
|
* changed even if we attach the device failed.
|
||||||
*/
|
*/
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, cfg->caps, cfg->stateDir) < 0)
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0)
|
||||||
goto endjob;
|
goto endjob;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4241,7 +4241,7 @@ libxlDomainDetachDeviceFlags(virDomainPtr dom, const char *xml,
|
|||||||
|
|
||||||
/* Finally, if no error until here, we can save config. */
|
/* Finally, if no error until here, we can save config. */
|
||||||
if (flags & VIR_DOMAIN_DEVICE_MODIFY_CONFIG) {
|
if (flags & VIR_DOMAIN_DEVICE_MODIFY_CONFIG) {
|
||||||
ret = virDomainDefSave(vmdef, driver->xmlopt, cfg->caps, cfg->configDir);
|
ret = virDomainDefSave(vmdef, driver->xmlopt, cfg->configDir);
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
virDomainObjAssignDef(vm, vmdef, false, NULL);
|
virDomainObjAssignDef(vm, vmdef, false, NULL);
|
||||||
vmdef = NULL;
|
vmdef = NULL;
|
||||||
@ -4320,13 +4320,13 @@ libxlDomainUpdateDeviceFlags(virDomainPtr dom, const char *xml,
|
|||||||
* update domain status forcibly because the domain status may be
|
* update domain status forcibly because the domain status may be
|
||||||
* changed even if we attach the device failed.
|
* changed even if we attach the device failed.
|
||||||
*/
|
*/
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, cfg->caps, cfg->stateDir) < 0)
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0)
|
||||||
ret = -1;
|
ret = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Finally, if no error until here, we can save config. */
|
/* Finally, if no error until here, we can save config. */
|
||||||
if (!ret && (flags & VIR_DOMAIN_DEVICE_MODIFY_CONFIG)) {
|
if (!ret && (flags & VIR_DOMAIN_DEVICE_MODIFY_CONFIG)) {
|
||||||
ret = virDomainDefSave(vmdef, driver->xmlopt, cfg->caps, cfg->configDir);
|
ret = virDomainDefSave(vmdef, driver->xmlopt, cfg->configDir);
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
virDomainObjAssignDef(vm, vmdef, false, NULL);
|
virDomainObjAssignDef(vm, vmdef, false, NULL);
|
||||||
vmdef = NULL;
|
vmdef = NULL;
|
||||||
@ -6526,7 +6526,7 @@ libxlDomainSetMetadata(virDomainPtr dom,
|
|||||||
if (libxlDomainObjBeginJob(driver, vm, LIBXL_JOB_MODIFY) < 0)
|
if (libxlDomainObjBeginJob(driver, vm, LIBXL_JOB_MODIFY) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
ret = virDomainObjSetMetadata(vm, type, metadata, key, uri, cfg->caps,
|
ret = virDomainObjSetMetadata(vm, type, metadata, key, uri,
|
||||||
driver->xmlopt, cfg->stateDir,
|
driver->xmlopt, cfg->stateDir,
|
||||||
cfg->configDir, flags);
|
cfg->configDir, flags);
|
||||||
|
|
||||||
|
@ -1324,7 +1324,7 @@ libxlDomainMigrationDstFinish(virConnectPtr dconn,
|
|||||||
if (!(vmdef = virDomainObjGetPersistentDef(driver->xmlopt, vm, NULL)))
|
if (!(vmdef = virDomainObjGetPersistentDef(driver->xmlopt, vm, NULL)))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (virDomainDefSave(vmdef, driver->xmlopt, cfg->caps, cfg->configDir) < 0)
|
if (virDomainDefSave(vmdef, driver->xmlopt, cfg->configDir) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
event = virDomainEventLifecycleNewFromObj(vm,
|
event = virDomainEventLifecycleNewFromObj(vm,
|
||||||
@ -1336,7 +1336,7 @@ libxlDomainMigrationDstFinish(virConnectPtr dconn,
|
|||||||
event = NULL;
|
event = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, cfg->caps, cfg->stateDir) < 0)
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
dom = virGetDomain(dconn, vm->def->name, vm->def->uuid, vm->def->id);
|
dom = virGetDomain(dconn, vm->def->name, vm->def->uuid, vm->def->id);
|
||||||
@ -1386,7 +1386,7 @@ libxlDomainMigrationSrcConfirm(libxlDriverPrivatePtr driver,
|
|||||||
VIR_DOMAIN_PAUSED_MIGRATION);
|
VIR_DOMAIN_PAUSED_MIGRATION);
|
||||||
event = virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_SUSPENDED,
|
event = virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_SUSPENDED,
|
||||||
VIR_DOMAIN_EVENT_SUSPENDED_MIGRATED);
|
VIR_DOMAIN_EVENT_SUSPENDED_MIGRATED);
|
||||||
ignore_value(virDomainObjSave(vm, driver->xmlopt, cfg->caps, cfg->stateDir));
|
ignore_value(virDomainObjSave(vm, driver->xmlopt, cfg->stateDir));
|
||||||
}
|
}
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
@ -444,7 +444,7 @@ lxcDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int flags)
|
|||||||
vm->persistent = 1;
|
vm->persistent = 1;
|
||||||
|
|
||||||
if (virDomainDefSave(vm->newDef ? vm->newDef : vm->def,
|
if (virDomainDefSave(vm->newDef ? vm->newDef : vm->def,
|
||||||
driver->xmlopt, driver->caps, cfg->configDir) < 0) {
|
driver->xmlopt, cfg->configDir) < 0) {
|
||||||
virDomainObjListRemove(driver->domains, vm);
|
virDomainObjListRemove(driver->domains, vm);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -678,7 +678,7 @@ static int lxcDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem,
|
|||||||
if (persistentDef->mem.cur_balloon > newmem)
|
if (persistentDef->mem.cur_balloon > newmem)
|
||||||
persistentDef->mem.cur_balloon = newmem;
|
persistentDef->mem.cur_balloon = newmem;
|
||||||
if (virDomainDefSave(persistentDef,
|
if (virDomainDefSave(persistentDef,
|
||||||
driver->xmlopt, driver->caps, cfg->configDir) < 0)
|
driver->xmlopt, cfg->configDir) < 0)
|
||||||
goto endjob;
|
goto endjob;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -705,14 +705,14 @@ static int lxcDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem,
|
|||||||
}
|
}
|
||||||
|
|
||||||
def->mem.cur_balloon = newmem;
|
def->mem.cur_balloon = newmem;
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0)
|
||||||
goto endjob;
|
goto endjob;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (persistentDef) {
|
if (persistentDef) {
|
||||||
persistentDef->mem.cur_balloon = newmem;
|
persistentDef->mem.cur_balloon = newmem;
|
||||||
if (virDomainDefSave(persistentDef,
|
if (virDomainDefSave(persistentDef,
|
||||||
driver->xmlopt, driver->caps, cfg->configDir) < 0)
|
driver->xmlopt, cfg->configDir) < 0)
|
||||||
goto endjob;
|
goto endjob;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -857,11 +857,11 @@ lxcDomainSetMemoryParameters(virDomainPtr dom,
|
|||||||
#undef VIR_SET_MEM_PARAMETER
|
#undef VIR_SET_MEM_PARAMETER
|
||||||
|
|
||||||
if (def &&
|
if (def &&
|
||||||
virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0)
|
||||||
goto endjob;
|
goto endjob;
|
||||||
|
|
||||||
if (persistentDef &&
|
if (persistentDef &&
|
||||||
virDomainDefSave(persistentDef, driver->xmlopt, driver->caps, cfg->configDir) < 0)
|
virDomainDefSave(persistentDef, driver->xmlopt, cfg->configDir) < 0)
|
||||||
goto endjob;
|
goto endjob;
|
||||||
/* QEMU and LXC implementations are identical */
|
/* QEMU and LXC implementations are identical */
|
||||||
|
|
||||||
@ -1967,12 +1967,12 @@ lxcDomainSetSchedulerParametersFlags(virDomainPtr dom,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0)
|
||||||
goto endjob;
|
goto endjob;
|
||||||
|
|
||||||
|
|
||||||
if (persistentDef) {
|
if (persistentDef) {
|
||||||
rc = virDomainDefSave(persistentDefCopy, driver->xmlopt, driver->caps,
|
rc = virDomainDefSave(persistentDefCopy, driver->xmlopt,
|
||||||
cfg->configDir);
|
cfg->configDir);
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
goto endjob;
|
goto endjob;
|
||||||
@ -2673,7 +2673,7 @@ lxcDomainSetBlkioParameters(virDomainPtr dom,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virDomainDefSave(persistentDef, driver->xmlopt, driver->caps, cfg->configDir) < 0)
|
if (virDomainDefSave(persistentDef, driver->xmlopt, cfg->configDir) < 0)
|
||||||
ret = -1;
|
ret = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3030,7 +3030,7 @@ static int lxcDomainSuspend(virDomainPtr dom)
|
|||||||
VIR_DOMAIN_EVENT_SUSPENDED_PAUSED);
|
VIR_DOMAIN_EVENT_SUSPENDED_PAUSED);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0)
|
||||||
goto endjob;
|
goto endjob;
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
@ -3087,7 +3087,7 @@ static int lxcDomainResume(virDomainPtr dom)
|
|||||||
VIR_DOMAIN_EVENT_RESUMED_UNPAUSED);
|
VIR_DOMAIN_EVENT_RESUMED_UNPAUSED);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0)
|
||||||
goto endjob;
|
goto endjob;
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
@ -4740,7 +4740,7 @@ static int lxcDomainAttachDeviceFlags(virDomainPtr dom,
|
|||||||
* changed even if we failed to attach the device. For example,
|
* changed even if we failed to attach the device. For example,
|
||||||
* a new controller may be created.
|
* a new controller may be created.
|
||||||
*/
|
*/
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0) {
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0) {
|
||||||
ret = -1;
|
ret = -1;
|
||||||
goto endjob;
|
goto endjob;
|
||||||
}
|
}
|
||||||
@ -4748,7 +4748,7 @@ static int lxcDomainAttachDeviceFlags(virDomainPtr dom,
|
|||||||
|
|
||||||
/* Finally, if no error until here, we can save config. */
|
/* Finally, if no error until here, we can save config. */
|
||||||
if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
|
if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
|
||||||
ret = virDomainDefSave(vmdef, driver->xmlopt, driver->caps, cfg->configDir);
|
ret = virDomainDefSave(vmdef, driver->xmlopt, cfg->configDir);
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
virDomainObjAssignDef(vm, vmdef, false, NULL);
|
virDomainObjAssignDef(vm, vmdef, false, NULL);
|
||||||
vmdef = NULL;
|
vmdef = NULL;
|
||||||
@ -4822,7 +4822,7 @@ static int lxcDomainUpdateDeviceFlags(virDomainPtr dom,
|
|||||||
if (lxcDomainUpdateDeviceConfig(vmdef, dev) < 0)
|
if (lxcDomainUpdateDeviceConfig(vmdef, dev) < 0)
|
||||||
goto endjob;
|
goto endjob;
|
||||||
|
|
||||||
if (virDomainDefSave(vmdef, driver->xmlopt, driver->caps, cfg->configDir) < 0)
|
if (virDomainDefSave(vmdef, driver->xmlopt, cfg->configDir) < 0)
|
||||||
goto endjob;
|
goto endjob;
|
||||||
|
|
||||||
virDomainObjAssignDef(vm, vmdef, false, NULL);
|
virDomainObjAssignDef(vm, vmdef, false, NULL);
|
||||||
@ -4908,7 +4908,7 @@ static int lxcDomainDetachDeviceFlags(virDomainPtr dom,
|
|||||||
* changed even if we failed to attach the device. For example,
|
* changed even if we failed to attach the device. For example,
|
||||||
* a new controller may be created.
|
* a new controller may be created.
|
||||||
*/
|
*/
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0) {
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0) {
|
||||||
ret = -1;
|
ret = -1;
|
||||||
goto endjob;
|
goto endjob;
|
||||||
}
|
}
|
||||||
@ -4916,7 +4916,7 @@ static int lxcDomainDetachDeviceFlags(virDomainPtr dom,
|
|||||||
|
|
||||||
/* Finally, if no error until here, we can save config. */
|
/* Finally, if no error until here, we can save config. */
|
||||||
if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
|
if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
|
||||||
ret = virDomainDefSave(vmdef, driver->xmlopt, driver->caps, cfg->configDir);
|
ret = virDomainDefSave(vmdef, driver->xmlopt, cfg->configDir);
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
virDomainObjAssignDef(vm, vmdef, false, NULL);
|
virDomainObjAssignDef(vm, vmdef, false, NULL);
|
||||||
vmdef = NULL;
|
vmdef = NULL;
|
||||||
@ -5207,7 +5207,6 @@ lxcDomainSetMetadata(virDomainPtr dom,
|
|||||||
virLXCDriverPtr driver = dom->conn->privateData;
|
virLXCDriverPtr driver = dom->conn->privateData;
|
||||||
virDomainObjPtr vm;
|
virDomainObjPtr vm;
|
||||||
virLXCDriverConfigPtr cfg = NULL;
|
virLXCDriverConfigPtr cfg = NULL;
|
||||||
virCapsPtr caps = NULL;
|
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
|
virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
|
||||||
@ -5221,13 +5220,10 @@ lxcDomainSetMetadata(virDomainPtr dom,
|
|||||||
if (virDomainSetMetadataEnsureACL(dom->conn, vm->def, flags) < 0)
|
if (virDomainSetMetadataEnsureACL(dom->conn, vm->def, flags) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (!(caps = virLXCDriverGetCapabilities(driver, false)))
|
|
||||||
goto cleanup;
|
|
||||||
|
|
||||||
if (virLXCDomainObjBeginJob(driver, vm, LXC_JOB_MODIFY) < 0)
|
if (virLXCDomainObjBeginJob(driver, vm, LXC_JOB_MODIFY) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
ret = virDomainObjSetMetadata(vm, type, metadata, key, uri, caps,
|
ret = virDomainObjSetMetadata(vm, type, metadata, key, uri,
|
||||||
driver->xmlopt, cfg->stateDir,
|
driver->xmlopt, cfg->stateDir,
|
||||||
cfg->configDir, flags);
|
cfg->configDir, flags);
|
||||||
|
|
||||||
@ -5241,7 +5237,6 @@ lxcDomainSetMetadata(virDomainPtr dom,
|
|||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
virDomainObjEndAPI(&vm);
|
virDomainObjEndAPI(&vm);
|
||||||
virObjectUnref(caps);
|
|
||||||
virObjectUnref(cfg);
|
virObjectUnref(cfg);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -790,7 +790,7 @@ static void virLXCProcessMonitorInitNotify(virLXCMonitorPtr mon G_GNUC_UNUSED,
|
|||||||
}
|
}
|
||||||
virDomainAuditInit(vm, initpid, inode);
|
virDomainAuditInit(vm, initpid, inode);
|
||||||
|
|
||||||
if (virDomainObjSave(vm, lxc_driver->xmlopt, lxc_driver->caps, cfg->stateDir) < 0)
|
if (virDomainObjSave(vm, lxc_driver->xmlopt, cfg->stateDir) < 0)
|
||||||
VIR_WARN("Cannot update XML with PID for LXC %s", vm->def->name);
|
VIR_WARN("Cannot update XML with PID for LXC %s", vm->def->name);
|
||||||
|
|
||||||
virObjectUnlock(vm);
|
virObjectUnlock(vm);
|
||||||
@ -1457,7 +1457,7 @@ int virLXCProcessStart(virConnectPtr conn,
|
|||||||
|
|
||||||
/* Write domain status to disk for the controller to
|
/* Write domain status to disk for the controller to
|
||||||
* read when it starts */
|
* read when it starts */
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
/* Allow the child to exec the controller */
|
/* Allow the child to exec the controller */
|
||||||
@ -1696,7 +1696,7 @@ virLXCProcessReconnectDomain(virDomainObjPtr vm,
|
|||||||
|
|
||||||
virLXCProcessReconnectNotifyNets(vm->def);
|
virLXCProcessReconnectNotifyNets(vm->def);
|
||||||
|
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0)
|
||||||
VIR_WARN("Cannot update XML for running LXC guest %s", vm->def->name);
|
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 */
|
/* now that we know it's reconnected call the hook if present */
|
||||||
|
@ -8188,7 +8188,7 @@ qemuDomainObjSaveStatus(virQEMUDriverPtr driver,
|
|||||||
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
|
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
|
||||||
|
|
||||||
if (virDomainObjIsActive(obj)) {
|
if (virDomainObjIsActive(obj)) {
|
||||||
if (virDomainObjSave(obj, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
if (virDomainObjSave(obj, driver->xmlopt, cfg->stateDir) < 0)
|
||||||
VIR_WARN("Failed to save status on vm %s", obj->def->name);
|
VIR_WARN("Failed to save status on vm %s", obj->def->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -8220,7 +8220,7 @@ qemuDomainSaveConfig(virDomainObjPtr obj)
|
|||||||
|
|
||||||
cfg = virQEMUDriverGetConfig(driver);
|
cfg = virQEMUDriverGetConfig(driver);
|
||||||
|
|
||||||
if (virDomainDefSave(def, driver->xmlopt, driver->caps, cfg->configDir) < 0)
|
if (virDomainDefSave(def, driver->xmlopt, cfg->configDir) < 0)
|
||||||
VIR_WARN("Failed to save config of vm %s", obj->def->name);
|
VIR_WARN("Failed to save config of vm %s", obj->def->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -10082,7 +10082,7 @@ qemuDomainSetFakeReboot(virQEMUDriverPtr driver,
|
|||||||
|
|
||||||
priv->fakeReboot = value;
|
priv->fakeReboot = value;
|
||||||
|
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0)
|
||||||
VIR_WARN("Failed to save status on vm %s", vm->def->name);
|
VIR_WARN("Failed to save status on vm %s", vm->def->name);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
|
@ -1865,7 +1865,7 @@ static int qemuDomainSuspend(virDomainPtr dom)
|
|||||||
if (qemuProcessStopCPUs(driver, vm, reason, QEMU_ASYNC_JOB_NONE) < 0)
|
if (qemuProcessStopCPUs(driver, vm, reason, QEMU_ASYNC_JOB_NONE) < 0)
|
||||||
goto endjob;
|
goto endjob;
|
||||||
}
|
}
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0)
|
||||||
goto endjob;
|
goto endjob;
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
@ -1923,7 +1923,7 @@ static int qemuDomainResume(virDomainPtr dom)
|
|||||||
goto endjob;
|
goto endjob;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0)
|
||||||
goto endjob;
|
goto endjob;
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
@ -2365,7 +2365,7 @@ static int qemuDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem,
|
|||||||
|
|
||||||
if (persistentDef->mem.cur_balloon > newmem)
|
if (persistentDef->mem.cur_balloon > newmem)
|
||||||
persistentDef->mem.cur_balloon = newmem;
|
persistentDef->mem.cur_balloon = newmem;
|
||||||
ret = virDomainDefSave(persistentDef, driver->xmlopt, driver->caps,
|
ret = virDomainDefSave(persistentDef, driver->xmlopt,
|
||||||
cfg->configDir);
|
cfg->configDir);
|
||||||
goto endjob;
|
goto endjob;
|
||||||
}
|
}
|
||||||
@ -2405,7 +2405,7 @@ static int qemuDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem,
|
|||||||
|
|
||||||
if (persistentDef) {
|
if (persistentDef) {
|
||||||
persistentDef->mem.cur_balloon = newmem;
|
persistentDef->mem.cur_balloon = newmem;
|
||||||
ret = virDomainDefSave(persistentDef, driver->xmlopt, driver->caps,
|
ret = virDomainDefSave(persistentDef, driver->xmlopt,
|
||||||
cfg->configDir);
|
cfg->configDir);
|
||||||
goto endjob;
|
goto endjob;
|
||||||
}
|
}
|
||||||
@ -2480,7 +2480,7 @@ static int qemuDomainSetMemoryStatsPeriod(virDomainPtr dom, int period,
|
|||||||
}
|
}
|
||||||
|
|
||||||
def->memballoon->period = period;
|
def->memballoon->period = period;
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0)
|
||||||
goto endjob;
|
goto endjob;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2492,7 +2492,7 @@ static int qemuDomainSetMemoryStatsPeriod(virDomainPtr dom, int period,
|
|||||||
goto endjob;
|
goto endjob;
|
||||||
}
|
}
|
||||||
persistentDef->memballoon->period = period;
|
persistentDef->memballoon->period = period;
|
||||||
ret = virDomainDefSave(persistentDef, driver->xmlopt, driver->caps, cfg->configDir);
|
ret = virDomainDefSave(persistentDef, driver->xmlopt, cfg->configDir);
|
||||||
goto endjob;
|
goto endjob;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4202,7 +4202,7 @@ processGuestPanicEvent(virQEMUDriverPtr driver,
|
|||||||
|
|
||||||
virObjectEventStateQueue(driver->domainEventState, event);
|
virObjectEventStateQueue(driver->domainEventState, event);
|
||||||
|
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0) {
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0) {
|
||||||
VIR_WARN("Unable to save status on vm %s after state change",
|
VIR_WARN("Unable to save status on vm %s after state change",
|
||||||
vm->def->name);
|
vm->def->name);
|
||||||
}
|
}
|
||||||
@ -4282,7 +4282,7 @@ processDeviceDeletedEvent(virQEMUDriverPtr driver,
|
|||||||
goto endjob;
|
goto endjob;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0)
|
||||||
VIR_WARN("unable to save domain status after removing device %s",
|
VIR_WARN("unable to save domain status after removing device %s",
|
||||||
devAlias);
|
devAlias);
|
||||||
|
|
||||||
@ -4650,7 +4650,7 @@ processSerialChangedEvent(virQEMUDriverPtr driver,
|
|||||||
|
|
||||||
dev.data.chr->state = newstate;
|
dev.data.chr->state = newstate;
|
||||||
|
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0)
|
||||||
VIR_WARN("unable to save status of domain %s after updating state of "
|
VIR_WARN("unable to save status of domain %s after updating state of "
|
||||||
"channel %s", vm->def->name, devAlias);
|
"channel %s", vm->def->name, devAlias);
|
||||||
|
|
||||||
@ -4976,7 +4976,7 @@ qemuDomainSetVcpusMax(virQEMUDriverPtr driver,
|
|||||||
if (virDomainDefSetVcpusMax(persistentDef, nvcpus, driver->xmlopt) < 0)
|
if (virDomainDefSetVcpusMax(persistentDef, nvcpus, driver->xmlopt) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (virDomainDefSave(persistentDef, driver->xmlopt, driver->caps, cfg->configDir) < 0)
|
if (virDomainDefSave(persistentDef, driver->xmlopt, cfg->configDir) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -5105,7 +5105,7 @@ qemuDomainPinVcpuLive(virDomainObjPtr vm,
|
|||||||
vcpuinfo->cpumask = tmpmap;
|
vcpuinfo->cpumask = tmpmap;
|
||||||
tmpmap = NULL;
|
tmpmap = NULL;
|
||||||
|
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (g_snprintf(paramField, VIR_TYPED_PARAM_FIELD_LENGTH,
|
if (g_snprintf(paramField, VIR_TYPED_PARAM_FIELD_LENGTH,
|
||||||
@ -5188,7 +5188,7 @@ qemuDomainPinVcpuFlags(virDomainPtr dom,
|
|||||||
vcpuinfo->cpumask = pcpumap;
|
vcpuinfo->cpumask = pcpumap;
|
||||||
pcpumap = NULL;
|
pcpumap = NULL;
|
||||||
|
|
||||||
ret = virDomainDefSave(persistentDef, driver->xmlopt, driver->caps, cfg->configDir);
|
ret = virDomainDefSave(persistentDef, driver->xmlopt, cfg->configDir);
|
||||||
goto endjob;
|
goto endjob;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5320,7 +5320,7 @@ qemuDomainPinEmulator(virDomainPtr dom,
|
|||||||
if (!(def->cputune.emulatorpin = virBitmapNewCopy(pcpumap)))
|
if (!(def->cputune.emulatorpin = virBitmapNewCopy(pcpumap)))
|
||||||
goto endjob;
|
goto endjob;
|
||||||
|
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0)
|
||||||
goto endjob;
|
goto endjob;
|
||||||
|
|
||||||
str = virBitmapFormat(pcpumap);
|
str = virBitmapFormat(pcpumap);
|
||||||
@ -5340,7 +5340,7 @@ qemuDomainPinEmulator(virDomainPtr dom,
|
|||||||
if (!(persistentDef->cputune.emulatorpin = virBitmapNewCopy(pcpumap)))
|
if (!(persistentDef->cputune.emulatorpin = virBitmapNewCopy(pcpumap)))
|
||||||
goto endjob;
|
goto endjob;
|
||||||
|
|
||||||
ret = virDomainDefSave(persistentDef, driver->xmlopt, driver->caps, cfg->configDir);
|
ret = virDomainDefSave(persistentDef, driver->xmlopt, cfg->configDir);
|
||||||
goto endjob;
|
goto endjob;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5800,7 +5800,7 @@ qemuDomainPinIOThread(virDomainPtr dom,
|
|||||||
if (virProcessSetAffinity(iothrid->thread_id, pcpumap) < 0)
|
if (virProcessSetAffinity(iothrid->thread_id, pcpumap) < 0)
|
||||||
goto endjob;
|
goto endjob;
|
||||||
|
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0)
|
||||||
goto endjob;
|
goto endjob;
|
||||||
|
|
||||||
if (g_snprintf(paramField, VIR_TYPED_PARAM_FIELD_LENGTH,
|
if (g_snprintf(paramField, VIR_TYPED_PARAM_FIELD_LENGTH,
|
||||||
@ -5833,7 +5833,7 @@ qemuDomainPinIOThread(virDomainPtr dom,
|
|||||||
iothrid->cpumask = cpumask;
|
iothrid->cpumask = cpumask;
|
||||||
iothrid->autofill = false;
|
iothrid->autofill = false;
|
||||||
|
|
||||||
ret = virDomainDefSave(persistentDef, driver->xmlopt, driver->caps, cfg->configDir);
|
ret = virDomainDefSave(persistentDef, driver->xmlopt, cfg->configDir);
|
||||||
goto endjob;
|
goto endjob;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6251,7 +6251,7 @@ qemuDomainChgIOThread(virQEMUDriverPtr driver,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0)
|
||||||
goto endjob;
|
goto endjob;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6283,7 +6283,7 @@ qemuDomainChgIOThread(virQEMUDriverPtr driver,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virDomainDefSave(persistentDef, driver->xmlopt, driver->caps,
|
if (virDomainDefSave(persistentDef, driver->xmlopt,
|
||||||
cfg->configDir) < 0)
|
cfg->configDir) < 0)
|
||||||
goto endjob;
|
goto endjob;
|
||||||
}
|
}
|
||||||
@ -6887,7 +6887,7 @@ qemuDomainSaveImageStartVM(virConnectPtr conn,
|
|||||||
"%s", _("failed to resume domain"));
|
"%s", _("failed to resume domain"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0) {
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0) {
|
||||||
VIR_WARN("Failed to save status on vm %s", vm->def->name);
|
VIR_WARN("Failed to save status on vm %s", vm->def->name);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -7594,7 +7594,7 @@ qemuDomainDefineXMLFlags(virConnectPtr conn,
|
|||||||
vm->persistent = 1;
|
vm->persistent = 1;
|
||||||
|
|
||||||
if (virDomainDefSave(vm->newDef ? vm->newDef : vm->def,
|
if (virDomainDefSave(vm->newDef ? vm->newDef : vm->def,
|
||||||
driver->xmlopt, driver->caps, cfg->configDir) < 0) {
|
driver->xmlopt, cfg->configDir) < 0) {
|
||||||
if (oldDef) {
|
if (oldDef) {
|
||||||
/* There is backup so this VM was defined before.
|
/* There is backup so this VM was defined before.
|
||||||
* Just restore the backup. */
|
* Just restore the backup. */
|
||||||
@ -8669,13 +8669,13 @@ qemuDomainAttachDeviceLiveAndConfig(virDomainObjPtr vm,
|
|||||||
* changed even if we failed to attach the device. For example,
|
* changed even if we failed to attach the device. For example,
|
||||||
* a new controller may be created.
|
* a new controller may be created.
|
||||||
*/
|
*/
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Finally, if no error until here, we can save config. */
|
/* Finally, if no error until here, we can save config. */
|
||||||
if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
|
if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
|
||||||
if (virDomainDefSave(vmdef, driver->xmlopt, driver->caps, cfg->configDir) < 0)
|
if (virDomainDefSave(vmdef, driver->xmlopt, cfg->configDir) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
virDomainObjAssignDef(vm, vmdef, false, NULL);
|
virDomainObjAssignDef(vm, vmdef, false, NULL);
|
||||||
@ -8822,7 +8822,7 @@ static int qemuDomainUpdateDeviceFlags(virDomainPtr dom,
|
|||||||
* changed even if we failed to attach the device. For example,
|
* changed even if we failed to attach the device. For example,
|
||||||
* a new controller may be created.
|
* a new controller may be created.
|
||||||
*/
|
*/
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0) {
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0) {
|
||||||
ret = -1;
|
ret = -1;
|
||||||
goto endjob;
|
goto endjob;
|
||||||
}
|
}
|
||||||
@ -8830,7 +8830,7 @@ static int qemuDomainUpdateDeviceFlags(virDomainPtr dom,
|
|||||||
|
|
||||||
/* Finally, if no error until here, we can save config. */
|
/* Finally, if no error until here, we can save config. */
|
||||||
if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
|
if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
|
||||||
ret = virDomainDefSave(vmdef, driver->xmlopt, driver->caps, cfg->configDir);
|
ret = virDomainDefSave(vmdef, driver->xmlopt, cfg->configDir);
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
virDomainObjAssignDef(vm, vmdef, false, NULL);
|
virDomainObjAssignDef(vm, vmdef, false, NULL);
|
||||||
vmdef = NULL;
|
vmdef = NULL;
|
||||||
@ -8920,13 +8920,13 @@ qemuDomainDetachDeviceLiveAndConfig(virQEMUDriverPtr driver,
|
|||||||
* changed even if we failed to attach the device. For example,
|
* changed even if we failed to attach the device. For example,
|
||||||
* a new controller may be created.
|
* a new controller may be created.
|
||||||
*/
|
*/
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, caps, cfg->stateDir) < 0)
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Finally, if no error until here, we can save config. */
|
/* Finally, if no error until here, we can save config. */
|
||||||
if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
|
if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
|
||||||
if (virDomainDefSave(vmdef, driver->xmlopt, caps, cfg->configDir) < 0)
|
if (virDomainDefSave(vmdef, driver->xmlopt, cfg->configDir) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
virDomainObjAssignDef(vm, vmdef, false, NULL);
|
virDomainObjAssignDef(vm, vmdef, false, NULL);
|
||||||
@ -9004,7 +9004,7 @@ qemuDomainDetachDeviceAliasLiveAndConfig(virQEMUDriverPtr driver,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (vmdef) {
|
if (vmdef) {
|
||||||
if (virDomainDefSave(vmdef, driver->xmlopt, caps, cfg->configDir) < 0)
|
if (virDomainDefSave(vmdef, driver->xmlopt, cfg->configDir) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
virDomainObjAssignDef(vm, vmdef, false, NULL);
|
virDomainObjAssignDef(vm, vmdef, false, NULL);
|
||||||
vmdef = NULL;
|
vmdef = NULL;
|
||||||
@ -9586,7 +9586,7 @@ qemuDomainSetBlkioParameters(virDomainPtr dom,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0)
|
||||||
goto endjob;
|
goto endjob;
|
||||||
}
|
}
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
@ -9621,7 +9621,7 @@ qemuDomainSetBlkioParameters(virDomainPtr dom,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virDomainDefSave(persistentDef, driver->xmlopt, driver->caps, cfg->configDir) < 0)
|
if (virDomainDefSave(persistentDef, driver->xmlopt, cfg->configDir) < 0)
|
||||||
ret = -1;
|
ret = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -9851,11 +9851,11 @@ qemuDomainSetMemoryParameters(virDomainPtr dom,
|
|||||||
#undef VIR_SET_MEM_PARAMETER
|
#undef VIR_SET_MEM_PARAMETER
|
||||||
|
|
||||||
if (def &&
|
if (def &&
|
||||||
virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0)
|
||||||
goto endjob;
|
goto endjob;
|
||||||
|
|
||||||
if (persistentDef &&
|
if (persistentDef &&
|
||||||
virDomainDefSave(persistentDef, driver->xmlopt, driver->caps, cfg->configDir) < 0)
|
virDomainDefSave(persistentDef, driver->xmlopt, cfg->configDir) < 0)
|
||||||
goto endjob;
|
goto endjob;
|
||||||
/* QEMU and LXC implementations are identical */
|
/* QEMU and LXC implementations are identical */
|
||||||
|
|
||||||
@ -10118,7 +10118,7 @@ qemuDomainSetNumaParameters(virDomainPtr dom,
|
|||||||
-1, mode, nodeset) < 0)
|
-1, mode, nodeset) < 0)
|
||||||
goto endjob;
|
goto endjob;
|
||||||
|
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0)
|
||||||
goto endjob;
|
goto endjob;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -10129,7 +10129,7 @@ qemuDomainSetNumaParameters(virDomainPtr dom,
|
|||||||
-1, mode, nodeset) < 0)
|
-1, mode, nodeset) < 0)
|
||||||
goto endjob;
|
goto endjob;
|
||||||
|
|
||||||
if (virDomainDefSave(persistentDef, driver->xmlopt, driver->caps, cfg->configDir) < 0)
|
if (virDomainDefSave(persistentDef, driver->xmlopt, cfg->configDir) < 0)
|
||||||
goto endjob;
|
goto endjob;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -10311,7 +10311,7 @@ qemuDomainSetPerfEvents(virDomainPtr dom,
|
|||||||
VIR_TRISTATE_BOOL_YES : VIR_TRISTATE_BOOL_NO;
|
VIR_TRISTATE_BOOL_YES : VIR_TRISTATE_BOOL_NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0)
|
||||||
goto endjob;
|
goto endjob;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -10325,7 +10325,7 @@ qemuDomainSetPerfEvents(virDomainPtr dom,
|
|||||||
VIR_TRISTATE_BOOL_YES : VIR_TRISTATE_BOOL_NO;
|
VIR_TRISTATE_BOOL_YES : VIR_TRISTATE_BOOL_NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virDomainDefSave(persistentDef, driver->xmlopt, driver->caps, cfg->configDir) < 0)
|
if (virDomainDefSave(persistentDef, driver->xmlopt, cfg->configDir) < 0)
|
||||||
goto endjob;
|
goto endjob;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -10523,7 +10523,6 @@ qemuDomainSetSchedulerParametersFlags(virDomainPtr dom,
|
|||||||
int ret = -1;
|
int ret = -1;
|
||||||
int rc;
|
int rc;
|
||||||
g_autoptr(virQEMUDriverConfig) cfg = NULL;
|
g_autoptr(virQEMUDriverConfig) cfg = NULL;
|
||||||
g_autoptr(virCaps) caps = NULL;
|
|
||||||
qemuDomainObjPrivatePtr priv;
|
qemuDomainObjPrivatePtr priv;
|
||||||
virObjectEventPtr event = NULL;
|
virObjectEventPtr event = NULL;
|
||||||
virTypedParameterPtr eventParams = NULL;
|
virTypedParameterPtr eventParams = NULL;
|
||||||
@ -10569,9 +10568,6 @@ qemuDomainSetSchedulerParametersFlags(virDomainPtr dom,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
|
|
||||||
goto cleanup;
|
|
||||||
|
|
||||||
if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
|
if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
@ -10787,7 +10783,7 @@ qemuDomainSetSchedulerParametersFlags(virDomainPtr dom,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, caps, cfg->stateDir) < 0)
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0)
|
||||||
goto endjob;
|
goto endjob;
|
||||||
|
|
||||||
if (eventNparams) {
|
if (eventNparams) {
|
||||||
@ -10797,7 +10793,7 @@ qemuDomainSetSchedulerParametersFlags(virDomainPtr dom,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (persistentDef) {
|
if (persistentDef) {
|
||||||
rc = virDomainDefSave(persistentDefCopy, driver->xmlopt, caps,
|
rc = virDomainDefSave(persistentDefCopy, driver->xmlopt,
|
||||||
cfg->configDir);
|
cfg->configDir);
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
goto endjob;
|
goto endjob;
|
||||||
@ -11636,7 +11632,7 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom,
|
|||||||
goto endjob;
|
goto endjob;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0)
|
||||||
goto endjob;
|
goto endjob;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -11661,7 +11657,7 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virDomainDefSave(persistentDef, driver->xmlopt, driver->caps, cfg->configDir) < 0)
|
if (virDomainDefSave(persistentDef, driver->xmlopt, cfg->configDir) < 0)
|
||||||
goto endjob;
|
goto endjob;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -14654,7 +14650,7 @@ qemuDomainSnapshotCreateInactiveExternal(virQEMUDriverPtr driver,
|
|||||||
defdisk->src = g_steal_pointer(&newsrc);
|
defdisk->src = g_steal_pointer(&newsrc);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virDomainDefSave(vm->def, driver->xmlopt, driver->caps, cfg->configDir) < 0)
|
if (virDomainDefSave(vm->def, driver->xmlopt, cfg->configDir) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
@ -15591,8 +15587,8 @@ qemuDomainSnapshotCreateDiskActive(virQEMUDriverPtr driver,
|
|||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0 ||
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0 ||
|
||||||
(vm->newDef && virDomainDefSave(vm->newDef, driver->xmlopt, driver->caps,
|
(vm->newDef && virDomainDefSave(vm->newDef, driver->xmlopt,
|
||||||
cfg->configDir) < 0))
|
cfg->configDir) < 0))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
@ -16886,7 +16882,7 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
|
|||||||
}
|
}
|
||||||
if (ret == 0 && defined && vm->persistent &&
|
if (ret == 0 && defined && vm->persistent &&
|
||||||
!(ret = virDomainDefSave(vm->newDef ? vm->newDef : vm->def,
|
!(ret = virDomainDefSave(vm->newDef ? vm->newDef : vm->def,
|
||||||
driver->xmlopt, driver->caps, cfg->configDir))) {
|
driver->xmlopt, cfg->configDir))) {
|
||||||
detail = VIR_DOMAIN_EVENT_DEFINED_FROM_SNAPSHOT;
|
detail = VIR_DOMAIN_EVENT_DEFINED_FROM_SNAPSHOT;
|
||||||
virObjectEventStateQueue(driver->domainEventState,
|
virObjectEventStateQueue(driver->domainEventState,
|
||||||
virDomainEventLifecycleNewFromObj(vm,
|
virDomainEventLifecycleNewFromObj(vm,
|
||||||
@ -17691,7 +17687,7 @@ qemuDomainBlockJobAbort(virDomainPtr dom,
|
|||||||
job->state = QEMU_BLOCKJOB_STATE_ABORTING;
|
job->state = QEMU_BLOCKJOB_STATE_ABORTING;
|
||||||
}
|
}
|
||||||
|
|
||||||
ignore_value(virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir));
|
ignore_value(virDomainObjSave(vm, driver->xmlopt, cfg->stateDir));
|
||||||
|
|
||||||
if (!async) {
|
if (!async) {
|
||||||
qemuBlockJobUpdate(vm, job, QEMU_ASYNC_JOB_NONE);
|
qemuBlockJobUpdate(vm, job, QEMU_ASYNC_JOB_NONE);
|
||||||
@ -19269,7 +19265,7 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
|
|||||||
if (virDomainDiskSetBlockIOTune(disk, &info) < 0)
|
if (virDomainDiskSetBlockIOTune(disk, &info) < 0)
|
||||||
goto endjob;
|
goto endjob;
|
||||||
|
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0)
|
||||||
goto endjob;
|
goto endjob;
|
||||||
|
|
||||||
if (eventNparams) {
|
if (eventNparams) {
|
||||||
@ -19294,7 +19290,7 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
|
|||||||
if (virDomainDiskSetBlockIOTune(conf_disk, &info) < 0)
|
if (virDomainDiskSetBlockIOTune(conf_disk, &info) < 0)
|
||||||
goto endjob;
|
goto endjob;
|
||||||
|
|
||||||
if (virDomainDefSave(persistentDef, driver->xmlopt, driver->caps,
|
if (virDomainDefSave(persistentDef, driver->xmlopt,
|
||||||
cfg->configDir) < 0)
|
cfg->configDir) < 0)
|
||||||
goto endjob;
|
goto endjob;
|
||||||
}
|
}
|
||||||
@ -19555,7 +19551,6 @@ qemuDomainSetMetadata(virDomainPtr dom,
|
|||||||
virQEMUDriverPtr driver = dom->conn->privateData;
|
virQEMUDriverPtr driver = dom->conn->privateData;
|
||||||
virDomainObjPtr vm;
|
virDomainObjPtr vm;
|
||||||
g_autoptr(virQEMUDriverConfig) cfg = NULL;
|
g_autoptr(virQEMUDriverConfig) cfg = NULL;
|
||||||
g_autoptr(virCaps) caps = NULL;
|
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
|
virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
|
||||||
@ -19569,13 +19564,10 @@ qemuDomainSetMetadata(virDomainPtr dom,
|
|||||||
if (virDomainSetMetadataEnsureACL(dom->conn, vm->def, flags) < 0)
|
if (virDomainSetMetadataEnsureACL(dom->conn, vm->def, flags) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
|
|
||||||
goto cleanup;
|
|
||||||
|
|
||||||
if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
|
if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
ret = virDomainObjSetMetadata(vm, type, metadata, key, uri, caps,
|
ret = virDomainObjSetMetadata(vm, type, metadata, key, uri,
|
||||||
driver->xmlopt, cfg->stateDir,
|
driver->xmlopt, cfg->stateDir,
|
||||||
cfg->configDir, flags);
|
cfg->configDir, flags);
|
||||||
|
|
||||||
@ -21896,7 +21888,7 @@ qemuDomainRenameCallback(virDomainObjPtr vm,
|
|||||||
vm->def->name = new_dom_name;
|
vm->def->name = new_dom_name;
|
||||||
new_dom_name = NULL;
|
new_dom_name = NULL;
|
||||||
|
|
||||||
if (virDomainDefSave(vm->def, driver->xmlopt, driver->caps, cfg->configDir) < 0)
|
if (virDomainDefSave(vm->def, driver->xmlopt, cfg->configDir) < 0)
|
||||||
goto rollback;
|
goto rollback;
|
||||||
|
|
||||||
if (virFileExists(old_dom_cfg_file) &&
|
if (virFileExists(old_dom_cfg_file) &&
|
||||||
@ -22420,14 +22412,14 @@ qemuDomainSetLifecycleAction(virDomainPtr dom,
|
|||||||
|
|
||||||
qemuDomainModifyLifecycleAction(def, type, action);
|
qemuDomainModifyLifecycleAction(def, type, action);
|
||||||
|
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0)
|
||||||
goto endjob;
|
goto endjob;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (persistentDef) {
|
if (persistentDef) {
|
||||||
qemuDomainModifyLifecycleAction(persistentDef, type, action);
|
qemuDomainModifyLifecycleAction(persistentDef, type, action);
|
||||||
|
|
||||||
if (virDomainDefSave(persistentDef, driver->xmlopt, driver->caps,
|
if (virDomainDefSave(persistentDef, driver->xmlopt,
|
||||||
cfg->configDir) < 0)
|
cfg->configDir) < 0)
|
||||||
goto endjob;
|
goto endjob;
|
||||||
}
|
}
|
||||||
@ -22723,7 +22715,7 @@ qemuDomainAgentSetResponseTimeout(virDomainPtr dom,
|
|||||||
QEMU_DOMAIN_PRIVATE(vm)->agentTimeout = timeout;
|
QEMU_DOMAIN_PRIVATE(vm)->agentTimeout = timeout;
|
||||||
|
|
||||||
if (virDomainObjIsActive(vm) &&
|
if (virDomainObjIsActive(vm) &&
|
||||||
virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
@ -5980,7 +5980,7 @@ qemuDomainHotplugDelVcpu(virQEMUDriverPtr driver,
|
|||||||
|
|
||||||
qemuDomainVcpuPersistOrder(vm->def);
|
qemuDomainVcpuPersistOrder(vm->def);
|
||||||
|
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
@ -6055,7 +6055,7 @@ qemuDomainHotplugAddVcpu(virQEMUDriverPtr driver,
|
|||||||
|
|
||||||
qemuDomainVcpuPersistOrder(vm->def);
|
qemuDomainVcpuPersistOrder(vm->def);
|
||||||
|
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
@ -6313,7 +6313,7 @@ qemuDomainSetVcpusInternal(virQEMUDriverPtr driver,
|
|||||||
if (persistentDef) {
|
if (persistentDef) {
|
||||||
qemuDomainSetVcpusConfig(persistentDef, nvcpus, hotpluggable);
|
qemuDomainSetVcpusConfig(persistentDef, nvcpus, hotpluggable);
|
||||||
|
|
||||||
if (virDomainDefSave(persistentDef, driver->xmlopt, driver->caps, cfg->configDir) < 0)
|
if (virDomainDefSave(persistentDef, driver->xmlopt, cfg->configDir) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6513,7 +6513,7 @@ qemuDomainSetVcpuInternal(virQEMUDriverPtr driver,
|
|||||||
if (persistentDef) {
|
if (persistentDef) {
|
||||||
qemuDomainSetVcpuConfig(persistentDef, map, state);
|
qemuDomainSetVcpuConfig(persistentDef, map, state);
|
||||||
|
|
||||||
if (virDomainDefSave(persistentDef, driver->xmlopt, driver->caps, cfg->configDir) < 0)
|
if (virDomainDefSave(persistentDef, driver->xmlopt, cfg->configDir) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1037,7 +1037,7 @@ qemuMigrationSrcNBDStorageCopy(virQEMUDriverPtr driver,
|
|||||||
tlsAlias, flags) < 0)
|
tlsAlias, flags) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0) {
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0) {
|
||||||
VIR_WARN("Failed to save status on vm %s", vm->def->name);
|
VIR_WARN("Failed to save status on vm %s", vm->def->name);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -3005,7 +3005,7 @@ qemuMigrationSrcConfirmPhase(virQEMUDriverPtr driver,
|
|||||||
qemuMigrationParamsReset(driver, vm, QEMU_ASYNC_JOB_MIGRATION_OUT,
|
qemuMigrationParamsReset(driver, vm, QEMU_ASYNC_JOB_MIGRATION_OUT,
|
||||||
priv->job.migParams, priv->job.apiFlags);
|
priv->job.migParams, priv->job.apiFlags);
|
||||||
|
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0)
|
||||||
VIR_WARN("Failed to save status on vm %s", vm->def->name);
|
VIR_WARN("Failed to save status on vm %s", vm->def->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4856,7 +4856,7 @@ qemuMigrationDstPersist(virQEMUDriverPtr driver,
|
|||||||
priv->qemuCaps)))
|
priv->qemuCaps)))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (virDomainDefSave(vmdef, driver->xmlopt, driver->caps, cfg->configDir) < 0 &&
|
if (virDomainDefSave(vmdef, driver->xmlopt, cfg->configDir) < 0 &&
|
||||||
!ignoreSaveError)
|
!ignoreSaveError)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
@ -5109,7 +5109,7 @@ qemuMigrationDstFinish(virQEMUDriverPtr driver,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (virDomainObjIsActive(vm) &&
|
if (virDomainObjIsActive(vm) &&
|
||||||
virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0)
|
||||||
VIR_WARN("Failed to save status on vm %s", vm->def->name);
|
VIR_WARN("Failed to save status on vm %s", vm->def->name);
|
||||||
|
|
||||||
/* Guest is successfully running, so cancel previous auto destroy */
|
/* Guest is successfully running, so cancel previous auto destroy */
|
||||||
|
@ -411,7 +411,7 @@ qemuProcessHandleReset(qemuMonitorPtr mon G_GNUC_UNUSED,
|
|||||||
if (priv->agent)
|
if (priv->agent)
|
||||||
qemuAgentNotifyEvent(priv->agent, QEMU_AGENT_EVENT_RESET);
|
qemuAgentNotifyEvent(priv->agent, QEMU_AGENT_EVENT_RESET);
|
||||||
|
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0)
|
||||||
VIR_WARN("Failed to save status on vm %s", vm->def->name);
|
VIR_WARN("Failed to save status on vm %s", vm->def->name);
|
||||||
|
|
||||||
if (vm->def->onReboot == VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY ||
|
if (vm->def->onReboot == VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY ||
|
||||||
@ -493,7 +493,7 @@ qemuProcessFakeReboot(void *opaque)
|
|||||||
goto endjob;
|
goto endjob;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0) {
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0) {
|
||||||
VIR_WARN("Unable to save status on vm %s after state change",
|
VIR_WARN("Unable to save status on vm %s after state change",
|
||||||
vm->def->name);
|
vm->def->name);
|
||||||
}
|
}
|
||||||
@ -614,7 +614,7 @@ qemuProcessHandleShutdown(qemuMonitorPtr mon G_GNUC_UNUSED,
|
|||||||
VIR_DOMAIN_EVENT_SHUTDOWN,
|
VIR_DOMAIN_EVENT_SHUTDOWN,
|
||||||
detail);
|
detail);
|
||||||
|
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0) {
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0) {
|
||||||
VIR_WARN("Unable to save status on vm %s after state change",
|
VIR_WARN("Unable to save status on vm %s after state change",
|
||||||
vm->def->name);
|
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_WARN("Unable to release lease on %s", vm->def->name);
|
||||||
VIR_DEBUG("Preserving lock state '%s'", NULLSTR(priv->lockState));
|
VIR_DEBUG("Preserving lock state '%s'", NULLSTR(priv->lockState));
|
||||||
|
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0) {
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0) {
|
||||||
VIR_WARN("Unable to save status on vm %s after state change",
|
VIR_WARN("Unable to save status on vm %s after state change",
|
||||||
vm->def->name);
|
vm->def->name);
|
||||||
}
|
}
|
||||||
@ -726,7 +726,7 @@ qemuProcessHandleResume(qemuMonitorPtr mon G_GNUC_UNUSED,
|
|||||||
VIR_DOMAIN_EVENT_RESUMED,
|
VIR_DOMAIN_EVENT_RESUMED,
|
||||||
eventDetail);
|
eventDetail);
|
||||||
|
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0) {
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0) {
|
||||||
VIR_WARN("Unable to save status on vm %s after state change",
|
VIR_WARN("Unable to save status on vm %s after state change",
|
||||||
vm->def->name);
|
vm->def->name);
|
||||||
}
|
}
|
||||||
@ -769,7 +769,7 @@ qemuProcessHandleRTCChange(qemuMonitorPtr mon G_GNUC_UNUSED,
|
|||||||
offset += vm->def->clock.data.variable.adjustment0;
|
offset += vm->def->clock.data.variable.adjustment0;
|
||||||
vm->def->clock.data.variable.adjustment = offset;
|
vm->def->clock.data.variable.adjustment = offset;
|
||||||
|
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0)
|
||||||
VIR_WARN("unable to save domain status with RTC change");
|
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_WARN("Unable to release lease on %s", vm->def->name);
|
||||||
VIR_DEBUG("Preserving lock state '%s'", NULLSTR(priv->lockState));
|
VIR_DEBUG("Preserving lock state '%s'", NULLSTR(priv->lockState));
|
||||||
|
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0) {
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0) {
|
||||||
VIR_WARN("Unable to save status on vm %s after watchdog event",
|
VIR_WARN("Unable to save status on vm %s after watchdog event",
|
||||||
vm->def->name);
|
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_WARN("Unable to release lease on %s", vm->def->name);
|
||||||
VIR_DEBUG("Preserving lock state '%s'", NULLSTR(priv->lockState));
|
VIR_DEBUG("Preserving lock state '%s'", NULLSTR(priv->lockState));
|
||||||
|
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0)
|
||||||
VIR_WARN("Unable to save status on vm %s after IO error", vm->def->name);
|
VIR_WARN("Unable to save status on vm %s after IO error", vm->def->name);
|
||||||
}
|
}
|
||||||
virObjectUnlock(vm);
|
virObjectUnlock(vm);
|
||||||
@ -1149,7 +1149,7 @@ qemuProcessHandleTrayChange(qemuMonitorPtr mon G_GNUC_UNUSED,
|
|||||||
else if (reason == VIR_DOMAIN_EVENT_TRAY_CHANGE_CLOSE)
|
else if (reason == VIR_DOMAIN_EVENT_TRAY_CHANGE_CLOSE)
|
||||||
disk->tray_status = VIR_DOMAIN_DISK_TRAY_CLOSED;
|
disk->tray_status = VIR_DOMAIN_DISK_TRAY_CLOSED;
|
||||||
|
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0) {
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0) {
|
||||||
VIR_WARN("Unable to save status on vm %s after tray moved event",
|
VIR_WARN("Unable to save status on vm %s after tray moved event",
|
||||||
vm->def->name);
|
vm->def->name);
|
||||||
}
|
}
|
||||||
@ -1189,7 +1189,7 @@ qemuProcessHandlePMWakeup(qemuMonitorPtr mon G_GNUC_UNUSED,
|
|||||||
VIR_DOMAIN_EVENT_STARTED,
|
VIR_DOMAIN_EVENT_STARTED,
|
||||||
VIR_DOMAIN_EVENT_STARTED_WAKEUP);
|
VIR_DOMAIN_EVENT_STARTED_WAKEUP);
|
||||||
|
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0) {
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0) {
|
||||||
VIR_WARN("Unable to save status on vm %s after wakeup event",
|
VIR_WARN("Unable to save status on vm %s after wakeup event",
|
||||||
vm->def->name);
|
vm->def->name);
|
||||||
}
|
}
|
||||||
@ -1227,7 +1227,7 @@ qemuProcessHandlePMSuspend(qemuMonitorPtr mon G_GNUC_UNUSED,
|
|||||||
VIR_DOMAIN_EVENT_PMSUSPENDED,
|
VIR_DOMAIN_EVENT_PMSUSPENDED,
|
||||||
VIR_DOMAIN_EVENT_PMSUSPENDED_MEMORY);
|
VIR_DOMAIN_EVENT_PMSUSPENDED_MEMORY);
|
||||||
|
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0) {
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0) {
|
||||||
VIR_WARN("Unable to save status on vm %s after suspend event",
|
VIR_WARN("Unable to save status on vm %s after suspend event",
|
||||||
vm->def->name);
|
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);
|
||||||
vm->def->mem.cur_balloon = actual;
|
vm->def->mem.cur_balloon = actual;
|
||||||
|
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0)
|
||||||
VIR_WARN("unable to save domain status with balloon change");
|
VIR_WARN("unable to save domain status with balloon change");
|
||||||
|
|
||||||
virObjectUnlock(vm);
|
virObjectUnlock(vm);
|
||||||
@ -1296,7 +1296,7 @@ qemuProcessHandlePMSuspendDisk(qemuMonitorPtr mon G_GNUC_UNUSED,
|
|||||||
VIR_DOMAIN_EVENT_PMSUSPENDED,
|
VIR_DOMAIN_EVENT_PMSUSPENDED,
|
||||||
VIR_DOMAIN_EVENT_PMSUSPENDED_DISK);
|
VIR_DOMAIN_EVENT_PMSUSPENDED_DISK);
|
||||||
|
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0) {
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0) {
|
||||||
VIR_WARN("Unable to save status on vm %s after suspend event",
|
VIR_WARN("Unable to save status on vm %s after suspend event",
|
||||||
vm->def->name);
|
vm->def->name);
|
||||||
}
|
}
|
||||||
@ -1669,7 +1669,7 @@ qemuProcessHandleMigrationStatus(qemuMonitorPtr mon G_GNUC_UNUSED,
|
|||||||
VIR_DOMAIN_EVENT_SUSPENDED,
|
VIR_DOMAIN_EVENT_SUSPENDED,
|
||||||
VIR_DOMAIN_EVENT_SUSPENDED_POSTCOPY);
|
VIR_DOMAIN_EVENT_SUSPENDED_POSTCOPY);
|
||||||
|
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0) {
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0) {
|
||||||
VIR_WARN("Unable to save status on vm %s after state change",
|
VIR_WARN("Unable to save status on vm %s after state change",
|
||||||
vm->def->name);
|
vm->def->name);
|
||||||
}
|
}
|
||||||
@ -3105,7 +3105,7 @@ qemuProcessUpdateVideoRamSize(virQEMUDriverPtr driver,
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
cfg = virQEMUDriverGetConfig(driver);
|
cfg = virQEMUDriverGetConfig(driver);
|
||||||
ret = virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir);
|
ret = virDomainObjSave(vm, driver->xmlopt, cfg->stateDir);
|
||||||
virObjectUnref(cfg);
|
virObjectUnref(cfg);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
@ -6860,7 +6860,7 @@ qemuProcessLaunch(virConnectPtr conn,
|
|||||||
}
|
}
|
||||||
|
|
||||||
VIR_DEBUG("Writing early domain status to disk");
|
VIR_DEBUG("Writing early domain status to disk");
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
VIR_DEBUG("Waiting for handshake from child");
|
VIR_DEBUG("Waiting for handshake from child");
|
||||||
@ -7118,7 +7118,7 @@ qemuProcessFinishStartup(virQEMUDriverPtr driver,
|
|||||||
}
|
}
|
||||||
|
|
||||||
VIR_DEBUG("Writing domain status to disk");
|
VIR_DEBUG("Writing domain status to disk");
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (qemuProcessStartHook(driver, vm,
|
if (qemuProcessStartHook(driver, vm,
|
||||||
@ -8223,7 +8223,7 @@ qemuProcessReconnect(void *opaque)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* update domain state XML with possibly updated state in virDomainObj */
|
/* update domain state XML with possibly updated state in virDomainObj */
|
||||||
if (virDomainObjSave(obj, driver->xmlopt, driver->caps, cfg->stateDir) < 0)
|
if (virDomainObjSave(obj, driver->xmlopt, cfg->stateDir) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
/* Run an hook to allow admins to do some magic */
|
/* Run an hook to allow admins to do some magic */
|
||||||
|
@ -4066,7 +4066,7 @@ static int testDomainSetMetadata(virDomainPtr dom,
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
ret = virDomainObjSetMetadata(privdom, type, metadata, key, uri,
|
ret = virDomainObjSetMetadata(privdom, type, metadata, key, uri,
|
||||||
privconn->caps, privconn->xmlopt,
|
privconn->xmlopt,
|
||||||
NULL, NULL, flags);
|
NULL, NULL, flags);
|
||||||
|
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user