mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-09 14:35:25 +00:00
qemu: Use qemuDomainSaveStatus
It is a nice wrapper around virDomainObjSave which logs a warning, but otherwise ignores the error. Let's use it where appropriate. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
877d1c2478
commit
38fb9106ed
@ -6324,10 +6324,8 @@ void qemuDomainObjTaint(virQEMUDriver *driver,
|
|||||||
virDomainTaintFlags taint,
|
virDomainTaintFlags taint,
|
||||||
qemuDomainLogContext *logCtxt)
|
qemuDomainLogContext *logCtxt)
|
||||||
{
|
{
|
||||||
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
|
|
||||||
|
|
||||||
qemuDomainObjTaintMsg(driver, obj, taint, logCtxt, NULL);
|
qemuDomainObjTaintMsg(driver, obj, taint, logCtxt, NULL);
|
||||||
ignore_value(virDomainObjSave(obj, driver->xmlopt, cfg->stateDir));
|
qemuDomainSaveStatus(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
void qemuDomainObjTaintMsg(virQEMUDriver *driver,
|
void qemuDomainObjTaintMsg(virQEMUDriver *driver,
|
||||||
@ -7163,20 +7161,17 @@ qemuDomainRemoveInactiveJobLocked(virQEMUDriver *driver,
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
qemuDomainSetFakeReboot(virQEMUDriver *driver,
|
qemuDomainSetFakeReboot(virQEMUDriver *driver G_GNUC_UNUSED,
|
||||||
virDomainObj *vm,
|
virDomainObj *vm,
|
||||||
bool value)
|
bool value)
|
||||||
{
|
{
|
||||||
qemuDomainObjPrivate *priv = vm->privateData;
|
qemuDomainObjPrivate *priv = vm->privateData;
|
||||||
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
|
|
||||||
|
|
||||||
if (priv->fakeReboot == value)
|
if (priv->fakeReboot == value)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
priv->fakeReboot = value;
|
priv->fakeReboot = value;
|
||||||
|
qemuDomainSaveStatus(vm);
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0)
|
|
||||||
VIR_WARN("Failed to save status on vm %s", vm->def->name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -3383,7 +3383,6 @@ qemuMigrationSrcConfirmPhase(virQEMUDriver *driver,
|
|||||||
{
|
{
|
||||||
g_autoptr(qemuMigrationCookie) mig = NULL;
|
g_autoptr(qemuMigrationCookie) mig = NULL;
|
||||||
virObjectEvent *event;
|
virObjectEvent *event;
|
||||||
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
|
|
||||||
qemuDomainObjPrivate *priv = vm->privateData;
|
qemuDomainObjPrivate *priv = vm->privateData;
|
||||||
qemuDomainJobPrivate *jobPriv = priv->job.privateData;
|
qemuDomainJobPrivate *jobPriv = priv->job.privateData;
|
||||||
qemuDomainJobInfo *jobInfo = NULL;
|
qemuDomainJobInfo *jobInfo = NULL;
|
||||||
@ -3473,8 +3472,7 @@ qemuMigrationSrcConfirmPhase(virQEMUDriver *driver,
|
|||||||
qemuMigrationParamsReset(driver, vm, QEMU_ASYNC_JOB_MIGRATION_OUT,
|
qemuMigrationParamsReset(driver, vm, QEMU_ASYNC_JOB_MIGRATION_OUT,
|
||||||
jobPriv->migParams, priv->job.apiFlags);
|
jobPriv->migParams, priv->job.apiFlags);
|
||||||
|
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0)
|
qemuDomainSaveStatus(vm);
|
||||||
VIR_WARN("Failed to save status on vm %s", vm->def->name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -5627,7 +5625,6 @@ qemuMigrationDstFinish(virQEMUDriver *driver,
|
|||||||
int cookie_flags = 0;
|
int cookie_flags = 0;
|
||||||
qemuDomainObjPrivate *priv = vm->privateData;
|
qemuDomainObjPrivate *priv = vm->privateData;
|
||||||
qemuDomainJobPrivate *jobPriv = priv->job.privateData;
|
qemuDomainJobPrivate *jobPriv = priv->job.privateData;
|
||||||
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
|
|
||||||
unsigned short port;
|
unsigned short port;
|
||||||
unsigned long long timeReceived = 0;
|
unsigned long long timeReceived = 0;
|
||||||
virObjectEvent *event;
|
virObjectEvent *event;
|
||||||
@ -5834,9 +5831,7 @@ qemuMigrationDstFinish(virQEMUDriver *driver,
|
|||||||
virObjectEventStateQueue(driver->domainEventState, event);
|
virObjectEventStateQueue(driver->domainEventState, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virDomainObjIsActive(vm) &&
|
qemuDomainSaveStatus(vm);
|
||||||
virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0)
|
|
||||||
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 */
|
||||||
qemuProcessAutoDestroyRemove(driver, vm);
|
qemuProcessAutoDestroyRemove(driver, vm);
|
||||||
|
@ -414,7 +414,6 @@ qemuProcessHandleReset(qemuMonitor *mon G_GNUC_UNUSED,
|
|||||||
virQEMUDriver *driver = opaque;
|
virQEMUDriver *driver = opaque;
|
||||||
virObjectEvent *event = NULL;
|
virObjectEvent *event = NULL;
|
||||||
qemuDomainObjPrivate *priv;
|
qemuDomainObjPrivate *priv;
|
||||||
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
|
|
||||||
virDomainState state;
|
virDomainState state;
|
||||||
int reason;
|
int reason;
|
||||||
|
|
||||||
@ -435,8 +434,7 @@ qemuProcessHandleReset(qemuMonitor *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, cfg->stateDir) < 0)
|
qemuDomainSaveStatus(vm);
|
||||||
VIR_WARN("Failed to save status on vm %s", vm->def->name);
|
|
||||||
|
|
||||||
unlock:
|
unlock:
|
||||||
virObjectUnlock(vm);
|
virObjectUnlock(vm);
|
||||||
@ -458,7 +456,6 @@ qemuProcessFakeReboot(void *opaque)
|
|||||||
virDomainObj *vm = opaque;
|
virDomainObj *vm = opaque;
|
||||||
qemuDomainObjPrivate *priv = vm->privateData;
|
qemuDomainObjPrivate *priv = vm->privateData;
|
||||||
virQEMUDriver *driver = priv->driver;
|
virQEMUDriver *driver = priv->driver;
|
||||||
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
|
|
||||||
virDomainRunningReason reason = VIR_DOMAIN_RUNNING_BOOTED;
|
virDomainRunningReason reason = VIR_DOMAIN_RUNNING_BOOTED;
|
||||||
int ret = -1, rc;
|
int ret = -1, rc;
|
||||||
|
|
||||||
@ -493,11 +490,7 @@ qemuProcessFakeReboot(void *opaque)
|
|||||||
goto endjob;
|
goto endjob;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0) {
|
qemuDomainSaveStatus(vm);
|
||||||
VIR_WARN("Unable to save status on vm %s after state change",
|
|
||||||
vm->def->name);
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
endjob:
|
endjob:
|
||||||
@ -575,7 +568,6 @@ qemuProcessHandleShutdown(qemuMonitor *mon G_GNUC_UNUSED,
|
|||||||
virQEMUDriver *driver = opaque;
|
virQEMUDriver *driver = opaque;
|
||||||
qemuDomainObjPrivate *priv;
|
qemuDomainObjPrivate *priv;
|
||||||
virObjectEvent *event = NULL;
|
virObjectEvent *event = NULL;
|
||||||
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
|
|
||||||
int detail = 0;
|
int detail = 0;
|
||||||
|
|
||||||
VIR_DEBUG("vm=%p", vm);
|
VIR_DEBUG("vm=%p", vm);
|
||||||
@ -622,11 +614,7 @@ qemuProcessHandleShutdown(qemuMonitor *mon G_GNUC_UNUSED,
|
|||||||
event = virDomainEventLifecycleNewFromObj(vm,
|
event = virDomainEventLifecycleNewFromObj(vm,
|
||||||
VIR_DOMAIN_EVENT_SHUTDOWN,
|
VIR_DOMAIN_EVENT_SHUTDOWN,
|
||||||
detail);
|
detail);
|
||||||
|
qemuDomainSaveStatus(vm);
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0) {
|
|
||||||
VIR_WARN("Unable to save status on vm %s after state change",
|
|
||||||
vm->def->name);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
priv->pausedShutdown = true;
|
priv->pausedShutdown = true;
|
||||||
}
|
}
|
||||||
@ -651,7 +639,6 @@ qemuProcessHandleStop(qemuMonitor *mon G_GNUC_UNUSED,
|
|||||||
virObjectEvent *event = NULL;
|
virObjectEvent *event = NULL;
|
||||||
virDomainPausedReason reason;
|
virDomainPausedReason reason;
|
||||||
virDomainEventSuspendedDetailType detail;
|
virDomainEventSuspendedDetailType detail;
|
||||||
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
|
|
||||||
qemuDomainObjPrivate *priv = vm->privateData;
|
qemuDomainObjPrivate *priv = vm->privateData;
|
||||||
|
|
||||||
virObjectLock(vm);
|
virObjectLock(vm);
|
||||||
@ -692,10 +679,7 @@ qemuProcessHandleStop(qemuMonitor *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, cfg->stateDir) < 0) {
|
qemuDomainSaveStatus(vm);
|
||||||
VIR_WARN("Unable to save status on vm %s after state change",
|
|
||||||
vm->def->name);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virObjectUnlock(vm);
|
virObjectUnlock(vm);
|
||||||
@ -710,7 +694,6 @@ qemuProcessHandleResume(qemuMonitor *mon G_GNUC_UNUSED,
|
|||||||
{
|
{
|
||||||
virQEMUDriver *driver = opaque;
|
virQEMUDriver *driver = opaque;
|
||||||
virObjectEvent *event = NULL;
|
virObjectEvent *event = NULL;
|
||||||
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
|
|
||||||
qemuDomainObjPrivate *priv;
|
qemuDomainObjPrivate *priv;
|
||||||
virDomainRunningReason reason = VIR_DOMAIN_RUNNING_UNPAUSED;
|
virDomainRunningReason reason = VIR_DOMAIN_RUNNING_UNPAUSED;
|
||||||
virDomainEventResumedDetailType eventDetail;
|
virDomainEventResumedDetailType eventDetail;
|
||||||
@ -734,11 +717,7 @@ qemuProcessHandleResume(qemuMonitor *mon G_GNUC_UNUSED,
|
|||||||
event = virDomainEventLifecycleNewFromObj(vm,
|
event = virDomainEventLifecycleNewFromObj(vm,
|
||||||
VIR_DOMAIN_EVENT_RESUMED,
|
VIR_DOMAIN_EVENT_RESUMED,
|
||||||
eventDetail);
|
eventDetail);
|
||||||
|
qemuDomainSaveStatus(vm);
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0) {
|
|
||||||
VIR_WARN("Unable to save status on vm %s after state change",
|
|
||||||
vm->def->name);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virObjectUnlock(vm);
|
virObjectUnlock(vm);
|
||||||
@ -753,7 +732,6 @@ qemuProcessHandleRTCChange(qemuMonitor *mon G_GNUC_UNUSED,
|
|||||||
{
|
{
|
||||||
virQEMUDriver *driver = opaque;
|
virQEMUDriver *driver = opaque;
|
||||||
virObjectEvent *event = NULL;
|
virObjectEvent *event = NULL;
|
||||||
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
|
|
||||||
|
|
||||||
virObjectLock(vm);
|
virObjectLock(vm);
|
||||||
|
|
||||||
@ -776,8 +754,7 @@ qemuProcessHandleRTCChange(qemuMonitor *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, cfg->stateDir) < 0)
|
qemuDomainSaveStatus(vm);
|
||||||
VIR_WARN("unable to save domain status with RTC change");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
event = virDomainEventRTCChangeNewFromObj(vm, offset);
|
event = virDomainEventRTCChangeNewFromObj(vm, offset);
|
||||||
@ -797,7 +774,6 @@ qemuProcessHandleWatchdog(qemuMonitor *mon G_GNUC_UNUSED,
|
|||||||
virQEMUDriver *driver = opaque;
|
virQEMUDriver *driver = opaque;
|
||||||
virObjectEvent *watchdogEvent = NULL;
|
virObjectEvent *watchdogEvent = NULL;
|
||||||
virObjectEvent *lifecycleEvent = NULL;
|
virObjectEvent *lifecycleEvent = NULL;
|
||||||
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
|
|
||||||
|
|
||||||
virObjectLock(vm);
|
virObjectLock(vm);
|
||||||
watchdogEvent = virDomainEventWatchdogNewFromObj(vm, action);
|
watchdogEvent = virDomainEventWatchdogNewFromObj(vm, action);
|
||||||
@ -817,10 +793,7 @@ qemuProcessHandleWatchdog(qemuMonitor *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, cfg->stateDir) < 0) {
|
qemuDomainSaveStatus(vm);
|
||||||
VIR_WARN("Unable to save status on vm %s after watchdog event",
|
|
||||||
vm->def->name);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vm->def->watchdog->action == VIR_DOMAIN_WATCHDOG_ACTION_DUMP) {
|
if (vm->def->watchdog->action == VIR_DOMAIN_WATCHDOG_ACTION_DUMP) {
|
||||||
@ -859,7 +832,6 @@ qemuProcessHandleIOError(qemuMonitor *mon G_GNUC_UNUSED,
|
|||||||
const char *srcPath;
|
const char *srcPath;
|
||||||
const char *devAlias;
|
const char *devAlias;
|
||||||
virDomainDiskDef *disk;
|
virDomainDiskDef *disk;
|
||||||
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
|
|
||||||
|
|
||||||
virObjectLock(vm);
|
virObjectLock(vm);
|
||||||
|
|
||||||
@ -902,8 +874,7 @@ qemuProcessHandleIOError(qemuMonitor *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, cfg->stateDir) < 0)
|
qemuDomainSaveStatus(vm);
|
||||||
VIR_WARN("Unable to save status on vm %s after IO error", vm->def->name);
|
|
||||||
}
|
}
|
||||||
virObjectUnlock(vm);
|
virObjectUnlock(vm);
|
||||||
|
|
||||||
@ -1085,7 +1056,6 @@ qemuProcessHandleTrayChange(qemuMonitor *mon G_GNUC_UNUSED,
|
|||||||
virQEMUDriver *driver = opaque;
|
virQEMUDriver *driver = opaque;
|
||||||
virObjectEvent *event = NULL;
|
virObjectEvent *event = NULL;
|
||||||
virDomainDiskDef *disk;
|
virDomainDiskDef *disk;
|
||||||
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
|
|
||||||
|
|
||||||
virObjectLock(vm);
|
virObjectLock(vm);
|
||||||
disk = qemuProcessFindDomainDiskByAliasOrQOM(vm, devAlias, devid);
|
disk = qemuProcessFindDomainDiskByAliasOrQOM(vm, devAlias, devid);
|
||||||
@ -1098,11 +1068,7 @@ qemuProcessHandleTrayChange(qemuMonitor *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, cfg->stateDir) < 0) {
|
qemuDomainSaveStatus(vm);
|
||||||
VIR_WARN("Unable to save status on vm %s after tray moved event",
|
|
||||||
vm->def->name);
|
|
||||||
}
|
|
||||||
|
|
||||||
virDomainObjBroadcast(vm);
|
virDomainObjBroadcast(vm);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1118,7 +1084,6 @@ qemuProcessHandlePMWakeup(qemuMonitor *mon G_GNUC_UNUSED,
|
|||||||
virQEMUDriver *driver = opaque;
|
virQEMUDriver *driver = opaque;
|
||||||
virObjectEvent *event = NULL;
|
virObjectEvent *event = NULL;
|
||||||
virObjectEvent *lifecycleEvent = NULL;
|
virObjectEvent *lifecycleEvent = NULL;
|
||||||
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
|
|
||||||
|
|
||||||
virObjectLock(vm);
|
virObjectLock(vm);
|
||||||
event = virDomainEventPMWakeupNewFromObj(vm);
|
event = virDomainEventPMWakeupNewFromObj(vm);
|
||||||
@ -1135,11 +1100,7 @@ qemuProcessHandlePMWakeup(qemuMonitor *mon G_GNUC_UNUSED,
|
|||||||
lifecycleEvent = virDomainEventLifecycleNewFromObj(vm,
|
lifecycleEvent = virDomainEventLifecycleNewFromObj(vm,
|
||||||
VIR_DOMAIN_EVENT_STARTED,
|
VIR_DOMAIN_EVENT_STARTED,
|
||||||
VIR_DOMAIN_EVENT_STARTED_WAKEUP);
|
VIR_DOMAIN_EVENT_STARTED_WAKEUP);
|
||||||
|
qemuDomainSaveStatus(vm);
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0) {
|
|
||||||
VIR_WARN("Unable to save status on vm %s after wakeup event",
|
|
||||||
vm->def->name);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virObjectUnlock(vm);
|
virObjectUnlock(vm);
|
||||||
@ -1155,7 +1116,6 @@ qemuProcessHandlePMSuspend(qemuMonitor *mon G_GNUC_UNUSED,
|
|||||||
virQEMUDriver *driver = opaque;
|
virQEMUDriver *driver = opaque;
|
||||||
virObjectEvent *event = NULL;
|
virObjectEvent *event = NULL;
|
||||||
virObjectEvent *lifecycleEvent = NULL;
|
virObjectEvent *lifecycleEvent = NULL;
|
||||||
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
|
|
||||||
|
|
||||||
virObjectLock(vm);
|
virObjectLock(vm);
|
||||||
event = virDomainEventPMSuspendNewFromObj(vm);
|
event = virDomainEventPMSuspendNewFromObj(vm);
|
||||||
@ -1171,11 +1131,7 @@ qemuProcessHandlePMSuspend(qemuMonitor *mon G_GNUC_UNUSED,
|
|||||||
virDomainEventLifecycleNewFromObj(vm,
|
virDomainEventLifecycleNewFromObj(vm,
|
||||||
VIR_DOMAIN_EVENT_PMSUSPENDED,
|
VIR_DOMAIN_EVENT_PMSUSPENDED,
|
||||||
VIR_DOMAIN_EVENT_PMSUSPENDED_MEMORY);
|
VIR_DOMAIN_EVENT_PMSUSPENDED_MEMORY);
|
||||||
|
qemuDomainSaveStatus(vm);
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0) {
|
|
||||||
VIR_WARN("Unable to save status on vm %s after suspend event",
|
|
||||||
vm->def->name);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (priv->agent)
|
if (priv->agent)
|
||||||
qemuAgentNotifyEvent(priv->agent, QEMU_AGENT_EVENT_SUSPEND);
|
qemuAgentNotifyEvent(priv->agent, QEMU_AGENT_EVENT_SUSPEND);
|
||||||
@ -1195,7 +1151,6 @@ qemuProcessHandleBalloonChange(qemuMonitor *mon G_GNUC_UNUSED,
|
|||||||
{
|
{
|
||||||
virQEMUDriver *driver = opaque;
|
virQEMUDriver *driver = opaque;
|
||||||
virObjectEvent *event = NULL;
|
virObjectEvent *event = NULL;
|
||||||
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
|
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
virObjectLock(vm);
|
virObjectLock(vm);
|
||||||
@ -1216,9 +1171,7 @@ qemuProcessHandleBalloonChange(qemuMonitor *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, cfg->stateDir) < 0)
|
qemuDomainSaveStatus(vm);
|
||||||
VIR_WARN("unable to save domain status with balloon change");
|
|
||||||
|
|
||||||
virObjectUnlock(vm);
|
virObjectUnlock(vm);
|
||||||
|
|
||||||
virObjectEventStateQueue(driver->domainEventState, event);
|
virObjectEventStateQueue(driver->domainEventState, event);
|
||||||
@ -1232,7 +1185,6 @@ qemuProcessHandlePMSuspendDisk(qemuMonitor *mon G_GNUC_UNUSED,
|
|||||||
virQEMUDriver *driver = opaque;
|
virQEMUDriver *driver = opaque;
|
||||||
virObjectEvent *event = NULL;
|
virObjectEvent *event = NULL;
|
||||||
virObjectEvent *lifecycleEvent = NULL;
|
virObjectEvent *lifecycleEvent = NULL;
|
||||||
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
|
|
||||||
|
|
||||||
virObjectLock(vm);
|
virObjectLock(vm);
|
||||||
event = virDomainEventPMSuspendDiskNewFromObj(vm);
|
event = virDomainEventPMSuspendDiskNewFromObj(vm);
|
||||||
@ -1248,11 +1200,7 @@ qemuProcessHandlePMSuspendDisk(qemuMonitor *mon G_GNUC_UNUSED,
|
|||||||
virDomainEventLifecycleNewFromObj(vm,
|
virDomainEventLifecycleNewFromObj(vm,
|
||||||
VIR_DOMAIN_EVENT_PMSUSPENDED,
|
VIR_DOMAIN_EVENT_PMSUSPENDED,
|
||||||
VIR_DOMAIN_EVENT_PMSUSPENDED_DISK);
|
VIR_DOMAIN_EVENT_PMSUSPENDED_DISK);
|
||||||
|
qemuDomainSaveStatus(vm);
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0) {
|
|
||||||
VIR_WARN("Unable to save status on vm %s after suspend event",
|
|
||||||
vm->def->name);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (priv->agent)
|
if (priv->agent)
|
||||||
qemuAgentNotifyEvent(priv->agent, QEMU_AGENT_EVENT_SUSPEND);
|
qemuAgentNotifyEvent(priv->agent, QEMU_AGENT_EVENT_SUSPEND);
|
||||||
@ -1599,7 +1547,6 @@ qemuProcessHandleMigrationStatus(qemuMonitor *mon G_GNUC_UNUSED,
|
|||||||
qemuDomainObjPrivate *priv;
|
qemuDomainObjPrivate *priv;
|
||||||
virQEMUDriver *driver = opaque;
|
virQEMUDriver *driver = opaque;
|
||||||
virObjectEvent *event = NULL;
|
virObjectEvent *event = NULL;
|
||||||
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
|
|
||||||
int reason;
|
int reason;
|
||||||
|
|
||||||
virObjectLock(vm);
|
virObjectLock(vm);
|
||||||
@ -1629,11 +1576,7 @@ qemuProcessHandleMigrationStatus(qemuMonitor *mon G_GNUC_UNUSED,
|
|||||||
event = virDomainEventLifecycleNewFromObj(vm,
|
event = virDomainEventLifecycleNewFromObj(vm,
|
||||||
VIR_DOMAIN_EVENT_SUSPENDED,
|
VIR_DOMAIN_EVENT_SUSPENDED,
|
||||||
VIR_DOMAIN_EVENT_SUSPENDED_POSTCOPY);
|
VIR_DOMAIN_EVENT_SUSPENDED_POSTCOPY);
|
||||||
|
qemuDomainSaveStatus(vm);
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0) {
|
|
||||||
VIR_WARN("Unable to save status on vm %s after state change",
|
|
||||||
vm->def->name);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
|
@ -586,7 +586,6 @@ qemuSaveImageStartVM(virConnectPtr conn,
|
|||||||
VIR_AUTOCLOSE intermediatefd = -1;
|
VIR_AUTOCLOSE intermediatefd = -1;
|
||||||
g_autoptr(virCommand) cmd = NULL;
|
g_autoptr(virCommand) cmd = NULL;
|
||||||
g_autofree char *errbuf = NULL;
|
g_autofree char *errbuf = NULL;
|
||||||
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
|
|
||||||
virQEMUSaveHeader *header = &data->header;
|
virQEMUSaveHeader *header = &data->header;
|
||||||
g_autoptr(qemuDomainSaveCookie) cookie = NULL;
|
g_autoptr(qemuDomainSaveCookie) cookie = NULL;
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
@ -680,10 +679,7 @@ qemuSaveImageStartVM(virConnectPtr conn,
|
|||||||
"%s", _("failed to resume domain"));
|
"%s", _("failed to resume domain"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0) {
|
qemuDomainSaveStatus(vm);
|
||||||
VIR_WARN("Failed to save status on vm %s", vm->def->name);
|
|
||||||
goto cleanup;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
int detail = (start_paused ? VIR_DOMAIN_EVENT_SUSPENDED_PAUSED :
|
int detail = (start_paused ? VIR_DOMAIN_EVENT_SUSPENDED_PAUSED :
|
||||||
VIR_DOMAIN_EVENT_SUSPENDED_RESTORED);
|
VIR_DOMAIN_EVENT_SUSPENDED_RESTORED);
|
||||||
|
Loading…
Reference in New Issue
Block a user