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
This commit is contained in:
Michal Privoznik 2012-01-31 16:59:02 +01:00
parent 53e23e99a9
commit bb311b3458
1 changed files with 2 additions and 2 deletions

View File

@ -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;
}
}