[PATCH 098/103] qemu: Command remove unused 'qemuBuildVirtioDevStr'

Peter Krempa posted 103 patches 4 years, 4 months ago
Only 102 patches received!
[PATCH 098/103] qemu: Command remove unused 'qemuBuildVirtioDevStr'
Posted by Peter Krempa 4 years, 4 months ago
All virtio devices were converted to the new JSON formatter so we can
remove the old one.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
 src/qemu/qemu_command.c | 65 +----------------------------------------
 1 file changed, 1 insertion(+), 64 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index b9c9027748..324da4adc5 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -1182,7 +1182,7 @@ qemuBuildVirtioDevGetConfig(virDomainDeviceDef *device,
  *
  * Build the qemu virtio -device JSON properties name from the passed parameters.
  */
-static G_GNUC_UNUSED virJSONValue *
+static virJSONValue *
 qemuBuildVirtioDevProps(virDomainDeviceType devtype,
                         void *devdata,
                         virQEMUCaps *qemuCaps)
@@ -1220,69 +1220,6 @@ qemuBuildVirtioDevProps(virDomainDeviceType devtype,
 }


-/**
- * qemuBuildVirtioDevStr
- * @buf: virBuffer * to append the built string
- * @qemuCaps: virQEMUCapPtr
- * @devtype: virDomainDeviceType of the device. Ex: VIR_DOMAIN_DEVICE_TYPE_RNG
- * @devdata: *Def * of the device definition
- *
- * Build the qemu virtio -device name from the passed parameters. Currently
- * this is mostly about attaching the correct string prefix to @baseName for
- * the passed @type. So for @baseName "virtio-rng" and devdata->info.type
- * VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI, generate "virtio-rng-pci"
- *
- * Returns: -1 on failure, 0 on success
- */
-static G_GNUC_UNUSED int
-qemuBuildVirtioDevStr(virBuffer *buf,
-                      virQEMUCaps *qemuCaps,
-                      virDomainDeviceType devtype,
-                      void *devdata)
-{
-    virDomainDeviceDef device = { .type = devtype };
-    g_autofree char *model = NULL;
-    virTristateSwitch disableLegacy = VIR_TRISTATE_SWITCH_ABSENT;
-    virTristateSwitch disableModern = VIR_TRISTATE_SWITCH_ABSENT;
-    virDomainVirtioOptions *virtioOptions = NULL;
-
-    virDomainDeviceSetData(&device, devdata);
-
-    if (qemuBuildVirtioDevGetConfig(&device, qemuCaps, &model, &virtioOptions,
-                                    &disableLegacy, &disableModern) < 0)
-        return -1;
-
-    virBufferAdd(buf, model, -1);
-
-    if (disableLegacy != VIR_TRISTATE_SWITCH_ABSENT) {
-        virBufferAsprintf(buf, ",disable-legacy=%s",
-                          virTristateSwitchTypeToString(disableLegacy));
-    }
-
-    if (disableModern != VIR_TRISTATE_SWITCH_ABSENT) {
-        virBufferAsprintf(buf, ",disable-modern=%s",
-                          virTristateSwitchTypeToString(disableModern));
-    }
-
-    if (virtioOptions) {
-        if (virtioOptions->iommu != VIR_TRISTATE_SWITCH_ABSENT) {
-            virBufferAsprintf(buf, ",iommu_platform=%s",
-                              virTristateSwitchTypeToString(virtioOptions->iommu));
-        }
-        if (virtioOptions->ats != VIR_TRISTATE_SWITCH_ABSENT) {
-            virBufferAsprintf(buf, ",ats=%s",
-                              virTristateSwitchTypeToString(virtioOptions->ats));
-        }
-        if (virtioOptions->packed != VIR_TRISTATE_SWITCH_ABSENT) {
-            virBufferAsprintf(buf, ",packed=%s",
-                              virTristateSwitchTypeToString(virtioOptions->packed));
-        }
-    }
-
-    return 0;
-}
-
-
 static int
 qemuBuildRomProps(virJSONValue *props,
                   virDomainDeviceInfo *info)
-- 
2.31.1

Re: [PATCH 098/103] qemu: Command remove unused 'qemuBuildVirtioDevStr'
Posted by Ján Tomko 4 years, 4 months ago
On a Thursday in 2021, Peter Krempa wrote:
>All virtio devices were converted to the new JSON formatter so we can
>remove the old one.
>
>Signed-off-by: Peter Krempa <pkrempa@redhat.com>
>---
> src/qemu/qemu_command.c | 65 +----------------------------------------
> 1 file changed, 1 insertion(+), 64 deletions(-)
>

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

Jano