[libvirt] [PATCH] qemu: Don't jump to endjob if no job was even started

In qemuDomainShutdownFlags if we try to use guest agent, which has error or is not configured, we jump go endjob label even if we haven't started any job yet. This may lead to the daemon crash: 1) virsh shutdown --mode agent on a domain without agent configured 2) wait until domain quits 3) virsh edit --- src/qemu/qemu_driver.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 1b147a9..7945c5d 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -1546,12 +1546,12 @@ static int qemuDomainShutdownFlags(virDomainPtr dom, unsigned int flags) { if (priv->agentError) { qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("QEMU guest agent is not available due to an error")); - goto endjob; + goto cleanup; } if (!priv->agent) { qemuReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s", _("QEMU guest agent is not configured")); - goto endjob; + goto cleanup; } } -- 1.7.3.4

On 01/31/2012 11:16 AM, Michal Privoznik wrote:
In qemuDomainShutdownFlags if we try to use guest agent, which has error or is not configured, we jump go endjob label even if we haven't started any job yet. This may lead to the daemon crash: 1) virsh shutdown --mode agent on a domain without agent configured 2) wait until domain quits 3) virsh edit
ACK.
--- src/qemu/qemu_driver.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 1b147a9..7945c5d 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -1546,12 +1546,12 @@ static int qemuDomainShutdownFlags(virDomainPtr dom, unsigned int flags) { if (priv->agentError) { qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("QEMU guest agent is not available due to an error")); - goto endjob; + goto cleanup; } if (!priv->agent) { qemuReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s", _("QEMU guest agent is not configured")); - goto endjob; + goto cleanup; } }

On 31.01.2012 18:22, Laine Stump wrote:
On 01/31/2012 11:16 AM, Michal Privoznik wrote:
In qemuDomainShutdownFlags if we try to use guest agent, which has error or is not configured, we jump go endjob label even if we haven't started any job yet. This may lead to the daemon crash: 1) virsh shutdown --mode agent on a domain without agent configured 2) wait until domain quits 3) virsh edit
ACK.
Thanks, pushed.
participants (2)
-
Laine Stump
-
Michal Privoznik