]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuBuildVirtioDevGetConfig: Split up formatting of bus suffix
authorPeter Krempa <pkrempa@redhat.com>
Thu, 30 Sep 2021 15:06:02 +0000 (17:06 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 12 Oct 2021 08:26:02 +0000 (10:26 +0200)
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>
src/qemu/qemu_command.c

index 6f968ff5d6e9cf5820e4d2346da88d5fc4118fb2..ee6b7758437e81b7d863e491df3998dd6b0de56e 100644 (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) {