]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Command remove unused 'qemuBuildVirtioDevStr'
authorPeter Krempa <pkrempa@redhat.com>
Tue, 5 Oct 2021 16:28:33 +0000 (18:28 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 12 Oct 2021 09:11:13 +0000 (11:11 +0200)
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>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_command.c

index df6ce97d164952fb398d46d3da3dfceba6386497..579ecbf690cb89c3bf790ff259e235132ebec6fe 100644 (file)
@@ -1189,7 +1189,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)
@@ -1227,69 +1227,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)