From 93c5841e087b336aebfc8dc3fd5de5ab483cda68 Mon Sep 17 00:00:00 2001 From: Luyao Huang Date: Thu, 19 Mar 2015 11:14:39 +0800 Subject: [PATCH] qemu: do not overwrite the error in qemuDomainObjExitMonitor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://bugzilla.redhat.com/show_bug.cgi?id=1196934 When qemu exits during startup, libvirt includes the error from /var/log/libvirt/qemu/vm.log in the error message: $ virsh start test3 error: Failed to start domain test3 error: internal error: early end of file from monitor: possible problem: 2015-02-27T03:03:16.985494Z qemu-kvm: -numa memdev is not supported by machine rhel6.5.0 The check for domain liveness added to qemuDomainObjExitMonitor in commit dc2fd51f sometimes overwrites this error: $ virsh start test3 error: Failed to start domain test3 error: operation failed: domain is no longer running Fix the check to only report an error if there is none set. Signed-off-by: Luyao Huang Signed-off-by: Ján Tomko (cherry picked from commit 4f068209387118f9b67c7cfe1a6c0097d7f573e7) --- src/qemu/qemu_domain.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 3303c0c6f8..20ac408d15 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -1604,8 +1604,9 @@ int qemuDomainObjExitMonitor(virQEMUDriverPtr driver, { qemuDomainObjExitMonitorInternal(driver, obj); if (!virDomainObjIsActive(obj)) { - virReportError(VIR_ERR_OPERATION_FAILED, "%s", - _("domain is no longer running")); + if (!virGetLastError()) + virReportError(VIR_ERR_OPERATION_FAILED, "%s", + _("domain is no longer running")); return -1; } return 0;