qemu: domain: Don't overwrite job type in private data

The code overwrote the internal job type and then fixed it back. Since
the job type is not accessed in the code this does not make much sense.
Use the temporary value instead.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
Peter Krempa 2018-03-01 18:01:08 +01:00
parent d2cd7215e7
commit d33adb9173

View File

@ -2062,15 +2062,14 @@ qemuDomainObjPrivateXMLFormatJob(virBufferPtr buf,
virDomainObjPtr vm,
qemuDomainObjPrivatePtr priv)
{
qemuDomainJob job;
qemuDomainJob job = priv->job.active;
job = priv->job.active;
if (!qemuDomainTrackJob(job))
priv->job.active = QEMU_JOB_NONE;
job = QEMU_JOB_NONE;
if (priv->job.active || priv->job.asyncJob) {
if (job || priv->job.asyncJob) {
virBufferAsprintf(buf, "<job type='%s' async='%s'",
qemuDomainJobTypeToString(priv->job.active),
qemuDomainJobTypeToString(job),
qemuDomainAsyncJobTypeToString(priv->job.asyncJob));
if (priv->job.phase) {
virBufferAsprintf(buf, " phase='%s'",
@ -2099,7 +2098,6 @@ qemuDomainObjPrivateXMLFormatJob(virBufferPtr buf,
virBufferAddLit(buf, "</job>\n");
}
}
priv->job.active = job;
}