mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-21 21:25:25 +00:00
qemu: Replace qemuDomainCheckMonitor with qemuMigrationJobCheckStatus
The function is only used during incoming migration in the beginning of Finish phase to detect if QEMU already died but EOF handler haven't had a chance to do its job yet. It calls query-status QMP command, but ignores the result. By calling query-migrate instead we can achieve the same functionality if QEMU is dead and even get meaningful error from "error-desc" in case the incoming migration failed and QEMU is still running. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
3100f43a1d
commit
090a2f27c2
@ -9007,24 +9007,6 @@ qemuDomainVcpuPersistOrder(virDomainDef *def)
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
qemuDomainCheckMonitor(virDomainObj *vm,
|
||||
virDomainAsyncJob asyncJob)
|
||||
{
|
||||
qemuDomainObjPrivate *priv = vm->privateData;
|
||||
int ret;
|
||||
|
||||
if (qemuDomainObjEnterMonitorAsync(vm, asyncJob) < 0)
|
||||
return -1;
|
||||
|
||||
ret = qemuMonitorCheck(priv->mon);
|
||||
|
||||
qemuDomainObjExitMonitor(vm);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
qemuDomainSupportsVideoVga(const virDomainVideoDef *video,
|
||||
virQEMUCaps *qemuCaps)
|
||||
|
@ -968,9 +968,6 @@ bool qemuDomainVcpuHotplugIsInOrder(virDomainDef *def)
|
||||
void qemuDomainVcpuPersistOrder(virDomainDef *def)
|
||||
ATTRIBUTE_NONNULL(1);
|
||||
|
||||
int qemuDomainCheckMonitor(virDomainObj *vm,
|
||||
virDomainAsyncJob asyncJob);
|
||||
|
||||
bool qemuDomainSupportsVideoVga(const virDomainVideoDef *video,
|
||||
virQEMUCaps *qemuCaps);
|
||||
|
||||
|
@ -6850,10 +6850,11 @@ qemuMigrationDstFinishActive(virQEMUDriver *driver,
|
||||
goto error;
|
||||
|
||||
if (retcode != 0) {
|
||||
/* Check for a possible error on the monitor in case Finish was called
|
||||
* earlier than monitor EOF handler got a chance to process the error
|
||||
/* Checking the migration status will read the migration error if
|
||||
* set and QEMU is still alive. If the process died and EOF handler
|
||||
* was not run yet, the appropriate monitor error will be set.
|
||||
*/
|
||||
qemuDomainCheckMonitor(vm, VIR_ASYNC_JOB_MIGRATION_IN);
|
||||
qemuMigrationJobCheckStatus(vm, VIR_ASYNC_JOB_MIGRATION_IN);
|
||||
goto error;
|
||||
}
|
||||
|
||||
|
@ -1430,14 +1430,6 @@ qemuMonitorStopCPUs(qemuMonitor *mon)
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
qemuMonitorCheck(qemuMonitor *mon)
|
||||
{
|
||||
bool running;
|
||||
return qemuMonitorGetStatus(mon, &running, NULL);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
qemuMonitorGetStatus(qemuMonitor *mon,
|
||||
bool *running,
|
||||
|
@ -558,7 +558,6 @@ typedef enum {
|
||||
VIR_ENUM_DECL(qemuMonitorVMStatus);
|
||||
int qemuMonitorVMStatusToPausedReason(const char *status);
|
||||
|
||||
int qemuMonitorCheck(qemuMonitor *mon);
|
||||
int qemuMonitorGetStatus(qemuMonitor *mon,
|
||||
bool *running,
|
||||
virDomainPausedReason *reason)
|
||||
|
Loading…
Reference in New Issue
Block a user