qemu: End job even if exiting monitor after OpenGraphics(FD) fails

Signed-off-by: Luyao Huang <lhuang@redhat.com>
This commit is contained in:
Luyao Huang 2015-06-30 11:35:13 +08:00 committed by Martin Kletzander
parent 224456fc4a
commit 91c9e4d920

View File

@ -17265,10 +17265,8 @@ qemuDomainOpenGraphics(virDomainPtr dom,
qemuDomainObjEnterMonitor(driver, vm);
ret = qemuMonitorOpenGraphics(priv->mon, protocol, fd, "graphicsfd",
(flags & VIR_DOMAIN_OPEN_GRAPHICS_SKIPAUTH) != 0);
if (qemuDomainObjExitMonitor(driver, vm) < 0) {
if (qemuDomainObjExitMonitor(driver, vm) < 0)
ret = -1;
goto cleanup;
}
qemuDomainObjEndJob(driver, vm);
cleanup:
@ -17337,10 +17335,8 @@ qemuDomainOpenGraphicsFD(virDomainPtr dom,
qemuDomainObjEnterMonitor(driver, vm);
ret = qemuMonitorOpenGraphics(priv->mon, protocol, pair[1], "graphicsfd",
(flags & VIR_DOMAIN_OPEN_GRAPHICS_SKIPAUTH));
if (qemuDomainObjExitMonitor(driver, vm) < 0) {
if (qemuDomainObjExitMonitor(driver, vm) < 0)
ret = -1;
goto cleanup;
}
qemuDomainObjEndJob(driver, vm);
if (ret < 0)
goto cleanup;