qemu: domain: Return early in qemuDomainObjPrivateXMLFormatJob

Remove one level of nesting by returing early.

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

View File

@ -2067,14 +2067,17 @@ qemuDomainObjPrivateXMLFormatJob(virBufferPtr buf,
if (!qemuDomainTrackJob(job))
job = QEMU_JOB_NONE;
if (job || priv->job.asyncJob) {
if (job == QEMU_JOB_NONE &&
priv->job.asyncJob == QEMU_ASYNC_JOB_NONE)
return;
virBufferAsprintf(buf, "<job type='%s' async='%s'",
qemuDomainJobTypeToString(job),
qemuDomainAsyncJobTypeToString(priv->job.asyncJob));
if (priv->job.phase) {
virBufferAsprintf(buf, " phase='%s'",
qemuDomainAsyncJobPhaseToString(
priv->job.asyncJob, priv->job.phase));
qemuDomainAsyncJobPhaseToString(priv->job.asyncJob,
priv->job.phase));
}
if (priv->job.asyncJob != QEMU_ASYNC_JOB_MIGRATION_OUT) {
virBufferAddLit(buf, "/>\n");
@ -2097,7 +2100,6 @@ qemuDomainObjPrivateXMLFormatJob(virBufferPtr buf,
virBufferAdjustIndent(buf, -2);
virBufferAddLit(buf, "</job>\n");
}
}
}