mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
conf: Use virXMLFormatElement in virDomainControllerDriverFormat
Refactor adding of the controller <driver> element. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
5a690f695f
commit
53c11edef9
@ -24255,7 +24255,7 @@ virDomainDiskDefFormat(virBufferPtr buf,
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
static int
|
||||
virDomainControllerDriverFormat(virBufferPtr buf,
|
||||
virDomainControllerDefPtr def)
|
||||
{
|
||||
@ -24280,11 +24280,7 @@ virDomainControllerDriverFormat(virBufferPtr buf,
|
||||
|
||||
virDomainVirtioOptionsFormat(&driverBuf, def->virtio);
|
||||
|
||||
if (virBufferError(&driverBuf) != 0 || virBufferUse(&driverBuf)) {
|
||||
virBufferAddLit(buf, "<driver");
|
||||
virBufferAddBuffer(buf, &driverBuf);
|
||||
virBufferAddLit(buf, "/>\n");
|
||||
}
|
||||
return virXMLFormatElement(buf, "driver", &driverBuf, NULL);
|
||||
}
|
||||
|
||||
|
||||
@ -24417,7 +24413,8 @@ virDomainControllerDefFormat(virBufferPtr buf,
|
||||
}
|
||||
}
|
||||
|
||||
virDomainControllerDriverFormat(&childBuf, def);
|
||||
if (virDomainControllerDriverFormat(&childBuf, def) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (virDomainDeviceInfoFormat(&childBuf, &def->info, flags) < 0)
|
||||
goto cleanup;
|
||||
|
Loading…
Reference in New Issue
Block a user