mirror of https://gitee.com/openkylin/libvirt.git
qemu: refresh state after reboot initiated from the guest
Internal domain state needs to be refreshed after reset from the guest side because it may be inconsistent with the internal qemu state. Signed-off-by: Kristina Hanicova <khanicov@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com> Signed-off-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
f47af66624
commit
75952d1874
|
@ -11161,6 +11161,7 @@ qemuProcessEventFree(struct qemuProcessEvent *event)
|
|||
break;
|
||||
case QEMU_PROCESS_EVENT_PR_DISCONNECT:
|
||||
case QEMU_PROCESS_EVENT_UNATTENDED_MIGRATION:
|
||||
case QEMU_PROCESS_EVENT_RESET:
|
||||
case QEMU_PROCESS_EVENT_LAST:
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -448,6 +448,7 @@ typedef enum {
|
|||
QEMU_PROCESS_EVENT_GUEST_CRASHLOADED,
|
||||
QEMU_PROCESS_EVENT_MEMORY_DEVICE_SIZE_CHANGE,
|
||||
QEMU_PROCESS_EVENT_UNATTENDED_MIGRATION,
|
||||
QEMU_PROCESS_EVENT_RESET,
|
||||
|
||||
QEMU_PROCESS_EVENT_LAST
|
||||
} qemuProcessEventType;
|
||||
|
|
|
@ -3922,6 +3922,19 @@ processMemoryDeviceSizeChange(virQEMUDriver *driver,
|
|||
}
|
||||
|
||||
|
||||
static void
|
||||
processResetEvent(virQEMUDriver *driver,
|
||||
virDomainObj *vm)
|
||||
{
|
||||
if (virDomainObjBeginJob(vm, VIR_JOB_MODIFY) < 0)
|
||||
return;
|
||||
|
||||
qemuProcessRefreshState(driver, vm, VIR_ASYNC_JOB_NONE);
|
||||
|
||||
virDomainObjEndJob(vm);
|
||||
}
|
||||
|
||||
|
||||
static void qemuProcessEventHandler(void *data, void *opaque)
|
||||
{
|
||||
struct qemuProcessEvent *processEvent = data;
|
||||
|
@ -3973,6 +3986,9 @@ static void qemuProcessEventHandler(void *data, void *opaque)
|
|||
processEvent->action,
|
||||
processEvent->status);
|
||||
break;
|
||||
case QEMU_PROCESS_EVENT_RESET:
|
||||
processResetEvent(driver, vm);
|
||||
break;
|
||||
case QEMU_PROCESS_EVENT_LAST:
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -432,6 +432,8 @@ qemuProcessHandleReset(qemuMonitor *mon G_GNUC_UNUSED,
|
|||
qemuDomainSetFakeReboot(vm, false);
|
||||
qemuDomainSaveStatus(vm);
|
||||
|
||||
qemuProcessEventSubmit(vm, QEMU_PROCESS_EVENT_RESET, 0, 0, NULL);
|
||||
|
||||
unlock:
|
||||
virObjectUnlock(vm);
|
||||
virObjectEventStateQueue(driver->domainEventState, event);
|
||||
|
|
Loading…
Reference in New Issue