qemuBuildVirtioDevGetConfig: Split up formatting of bus suffix

Add the bus suffix in a separate call. This will make it more obvious
what's happening in the next commit.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2021-09-30 17:06:02 +02:00
parent 927f189a36
commit 95c8d0b21e

View File

@ -815,6 +815,10 @@ qemuBuildVirtioDevGetConfig(virDomainDeviceDef *device,
*disableLegacy = VIR_TRISTATE_SWITCH_ABSENT;
*disableModern = VIR_TRISTATE_SWITCH_ABSENT;
qemuBuildVirtioDevGetConfigDev(device, &has_tmodel, &has_ntmodel);
virBufferAdd(&buf, baseName, -1);
switch ((virDomainDeviceAddressType) info->type) {
case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI:
implName = "pci";
@ -848,9 +852,7 @@ qemuBuildVirtioDevGetConfig(virDomainDeviceDef *device,
return -1;
}
virBufferAsprintf(&buf, "%s-%s", baseName, implName);
qemuBuildVirtioDevGetConfigDev(device, &has_tmodel, &has_ntmodel);
virBufferAsprintf(&buf, "-%s", implName);
if (has_tmodel || has_ntmodel) {
if (info->type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) {