mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-23 13:05:27 +00:00
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:
parent
d33adb9173
commit
3a4649b532
@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user