[PATCH 039/103] qemuBuildVirtioDevGetConfig: Split up formatting of bus suffix

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 src/qemu/qemu_command.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index e86c3bda22..b1ee5c6cb8 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -808,6 +808,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";
@@ -841,9 +845,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) {
-- 
2.31.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux