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

Peter Krempa posted 103 patches 4 years, 4 months ago
Only 102 patches received!
[PATCH 039/103] qemuBuildVirtioDevGetConfig: Split up formatting of bus suffix
Posted by Peter Krempa 4 years, 4 months ago
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>
---
 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

Re: [PATCH 039/103] qemuBuildVirtioDevGetConfig: Split up formatting of bus suffix
Posted by Ján Tomko 4 years, 4 months ago
On a Thursday in 2021, Peter Krempa wrote:
>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>
>---
> src/qemu/qemu_command.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano