mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-27 16:15:23 +00:00
conf: eliminate monster condition in virDomainControllerDefFormat
Move most of the subelement formatting out of the giant if.
This commit is contained in:
parent
1a4b21f1c6
commit
583022e52e
@ -21479,11 +21479,7 @@ virDomainControllerDefFormat(virBufferPtr buf,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pciModel || pciTarget ||
|
if (pciModel || pciTarget) {
|
||||||
def->queues || def->cmd_per_lun || def->max_sectors || def->ioeventfd ||
|
|
||||||
def->iothread ||
|
|
||||||
virDomainDeviceInfoNeedsFormat(&def->info, flags) || pcihole64) {
|
|
||||||
|
|
||||||
if (pciModel) {
|
if (pciModel) {
|
||||||
modelName = virDomainControllerPCIModelNameTypeToString(def->opts.pciopts.modelName);
|
modelName = virDomainControllerPCIModelNameTypeToString(def->opts.pciopts.modelName);
|
||||||
if (!modelName) {
|
if (!modelName) {
|
||||||
@ -21520,6 +21516,7 @@ virDomainControllerDefFormat(virBufferPtr buf,
|
|||||||
virBufferAddLit(&childBuf, "</target>\n");
|
virBufferAddLit(&childBuf, "</target>\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
virDomainControllerDriverFormat(&childBuf, def);
|
virDomainControllerDriverFormat(&childBuf, def);
|
||||||
|
|
||||||
@ -21531,7 +21528,6 @@ virDomainControllerDefFormat(virBufferPtr buf,
|
|||||||
virBufferAsprintf(&childBuf, "<pcihole64 unit='KiB'>%lu</"
|
virBufferAsprintf(&childBuf, "<pcihole64 unit='KiB'>%lu</"
|
||||||
"pcihole64>\n", def->opts.pciopts.pcihole64size);
|
"pcihole64>\n", def->opts.pciopts.pcihole64size);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (virBufferUse(&childBuf)) {
|
if (virBufferUse(&childBuf)) {
|
||||||
virBufferAddLit(buf, ">\n");
|
virBufferAddLit(buf, ">\n");
|
||||||
|
Loading…
Reference in New Issue
Block a user