mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-21 19:02:25 +00:00
conf: only format <controller> as a pair tag when needed
Make the decision based on the usage of childBuf buffer. This fixes the oddity in the test case introduced by commit c1c4d0d where we would format an empty pair tag.
This commit is contained in:
parent
5b96f37ff4
commit
bb74c66e67
@ -21477,7 +21477,6 @@ virDomainControllerDefFormat(virBufferPtr buf,
|
||||
def->queues || def->cmd_per_lun || def->max_sectors || def->ioeventfd ||
|
||||
def->iothread ||
|
||||
virDomainDeviceInfoNeedsFormat(&def->info, flags) || pcihole64) {
|
||||
virBufferAddLit(buf, ">\n");
|
||||
|
||||
if (pciModel) {
|
||||
modelName = virDomainControllerPCIModelNameTypeToString(def->opts.pciopts.modelName);
|
||||
@ -21526,7 +21525,10 @@ virDomainControllerDefFormat(virBufferPtr buf,
|
||||
virBufferAsprintf(&childBuf, "<pcihole64 unit='KiB'>%lu</"
|
||||
"pcihole64>\n", def->opts.pciopts.pcihole64size);
|
||||
}
|
||||
}
|
||||
|
||||
if (virBufferUse(&childBuf)) {
|
||||
virBufferAddLit(buf, ">\n");
|
||||
virBufferAddBuffer(buf, &childBuf);
|
||||
virBufferAddLit(buf, "</controller>\n");
|
||||
} else {
|
||||
|
@ -14,8 +14,7 @@
|
||||
<on_crash>destroy</on_crash>
|
||||
<devices>
|
||||
<emulator>/usr/bin/qemu-system-s390x</emulator>
|
||||
<controller type='virtio-serial' index='0'>
|
||||
</controller>
|
||||
<controller type='virtio-serial' index='0'/>
|
||||
<console type='pty'>
|
||||
<target type='virtio' port='0'/>
|
||||
</console>
|
||||
|
Loading…
x
Reference in New Issue
Block a user