[PATCH 08/38] qemuBuildDeviceAddressStr: Remove unused 'qemuCaps'

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

 



The qemuCaps is left for the device commandline formatters for now as it
might come in handy.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
Reviewed-by: Ján Tomko <jtomko@xxxxxxxxxx>
Reviewed-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
Reviewed-by: Neal Gompa <ngompa13@xxxxxxxxx>
---
 src/qemu/qemu_command.c | 73 ++++++++++++++++++++---------------------
 1 file changed, 36 insertions(+), 37 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 63b6533c68..1b32f02543 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -343,8 +343,7 @@ qemuVirCommandGetDevSet(virCommand *cmd, int fd)
 static int
 qemuBuildDeviceAddressStr(virBuffer *buf,
                           const virDomainDef *domainDef,
-                          virDomainDeviceInfo *info,
-                          virQEMUCaps *qemuCaps G_GNUC_UNUSED)
+                          virDomainDeviceInfo *info)
 {
     g_autofree char *devStr = NULL;
     const char *contAlias = NULL;
@@ -1831,14 +1830,14 @@ qemuBuildDiskDeviceStr(const virDomainDef *def,

         qemuBuildVirtioOptionsStr(&opt, disk->virtio);

-        if (qemuBuildDeviceAddressStr(&opt, def, &disk->info, qemuCaps) < 0)
+        if (qemuBuildDeviceAddressStr(&opt, def, &disk->info) < 0)
             return NULL;
         break;

     case VIR_DOMAIN_DISK_BUS_USB:
         virBufferAddLit(&opt, "usb-storage");

-        if (qemuBuildDeviceAddressStr(&opt, def, &disk->info, qemuCaps) < 0)
+        if (qemuBuildDeviceAddressStr(&opt, def, &disk->info) < 0)
             return NULL;
         break;

@@ -2304,7 +2303,7 @@ qemuBuildVHostUserFsCommandLine(virCommand *cmd,
     if (fs->info.bootIndex)
         virBufferAsprintf(&opt, ",bootindex=%u", fs->info.bootIndex);

-    if (qemuBuildDeviceAddressStr(&opt, def, &fs->info, priv->qemuCaps) < 0)
+    if (qemuBuildDeviceAddressStr(&opt, def, &fs->info) < 0)
         return -1;

     virCommandAddArgBuffer(cmd, &opt);
@@ -2379,7 +2378,7 @@ qemuBuildFSDevStr(const virDomainDef *def,

     qemuBuildVirtioOptionsStr(&opt, fs->virtio);

-    if (qemuBuildDeviceAddressStr(&opt, def, &fs->info, qemuCaps) < 0)
+    if (qemuBuildDeviceAddressStr(&opt, def, &fs->info) < 0)
         return NULL;

     return virBufferContentAndReset(&opt);
@@ -2773,7 +2772,7 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef,

     qemuBuildIoEventFdStr(&buf, def->ioeventfd, qemuCaps);

-    if (qemuBuildDeviceAddressStr(&buf, domainDef, &def->info, qemuCaps) < 0)
+    if (qemuBuildDeviceAddressStr(&buf, domainDef, &def->info) < 0)
         return -1;

     *devstr = virBufferContentAndReset(&buf);
@@ -3419,7 +3418,7 @@ qemuBuildMemoryDimmBackendStr(virBuffer *buf,
 char *
 qemuBuildMemoryDeviceStr(const virDomainDef *def,
                          virDomainMemoryDef *mem,
-                         virQEMUCaps *qemuCaps)
+                         virQEMUCaps *qemuCaps G_GNUC_UNUSED)
 {
     g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
     const char *device = NULL;
@@ -3472,7 +3471,7 @@ qemuBuildMemoryDeviceStr(const virDomainDef *def,
     virBufferAsprintf(&buf, "memdev=mem%s,id=%s",
                       mem->info.alias, mem->info.alias);

-    if (qemuBuildDeviceAddressStr(&buf, def, &mem->info, qemuCaps) < 0)
+    if (qemuBuildDeviceAddressStr(&buf, def, &mem->info) < 0)
         return NULL;

     return virBufferContentAndReset(&buf);
@@ -3632,7 +3631,7 @@ qemuBuildNicDevStr(virDomainDef *def,
     virBufferAsprintf(&buf, ",mac=%s",
                       virMacAddrFormat(&net->mac, macaddr));

-    if (qemuBuildDeviceAddressStr(&buf, def, &net->info, qemuCaps) < 0)
+    if (qemuBuildDeviceAddressStr(&buf, def, &net->info) < 0)
         return NULL;
     if (qemuBuildRomStr(&buf, &net->info) < 0)
         return NULL;
@@ -3841,7 +3840,7 @@ qemuBuildHostNetStr(virDomainNetDef *net,
 char *
 qemuBuildWatchdogDevStr(const virDomainDef *def,
                         virDomainWatchdogDef *dev,
-                        virQEMUCaps *qemuCaps)
+                        virQEMUCaps *qemuCaps G_GNUC_UNUSED)
 {
     g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;

@@ -3853,7 +3852,7 @@ qemuBuildWatchdogDevStr(const virDomainDef *def,
     }

     virBufferAsprintf(&buf, "%s,id=%s", model, dev->info.alias);
-    if (qemuBuildDeviceAddressStr(&buf, def, &dev->info, qemuCaps) < 0)
+    if (qemuBuildDeviceAddressStr(&buf, def, &dev->info) < 0)
         return NULL;

     return virBufferContentAndReset(&buf);
@@ -3920,7 +3919,7 @@ qemuBuildMemballoonCommandLine(virCommand *cmd,
     }

     virBufferAsprintf(&buf, ",id=%s", def->memballoon->info.alias);
-    if (qemuBuildDeviceAddressStr(&buf, def, &def->memballoon->info, qemuCaps) < 0)
+    if (qemuBuildDeviceAddressStr(&buf, def, &def->memballoon->info) < 0)
         return -1;

     if (def->memballoon->autodeflate != VIR_TRISTATE_SWITCH_ABSENT) {
@@ -4021,7 +4020,7 @@ qemuBuildVirtioInputDevStr(const virDomainDef *def,
         virQEMUBuildBufferEscapeComma(&buf, dev->source.evdev);
     }

-    if (qemuBuildDeviceAddressStr(&buf, def, &dev->info, qemuCaps) < 0)
+    if (qemuBuildDeviceAddressStr(&buf, def, &dev->info) < 0)
         return NULL;

     qemuBuildVirtioOptionsStr(&buf, dev->virtio);
@@ -4032,7 +4031,7 @@ qemuBuildVirtioInputDevStr(const virDomainDef *def,
 static char *
 qemuBuildUSBInputDevStr(const virDomainDef *def,
                         virDomainInputDef *dev,
-                        virQEMUCaps *qemuCaps)
+                        virQEMUCaps *qemuCaps G_GNUC_UNUSED)
 {
     g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;

@@ -4048,7 +4047,7 @@ qemuBuildUSBInputDevStr(const virDomainDef *def,
         break;
     }

-    if (qemuBuildDeviceAddressStr(&buf, def, &dev->info, qemuCaps) < 0)
+    if (qemuBuildDeviceAddressStr(&buf, def, &dev->info) < 0)
         return NULL;

     return virBufferContentAndReset(&buf);
@@ -4156,7 +4155,7 @@ qemuBuildSoundDevStr(const virDomainDef *def,
             return NULL;
         virBufferAsprintf(&buf, ",audiodev=%s", audioid);
     }
-    if (qemuBuildDeviceAddressStr(&buf, def, &sound->info, qemuCaps) < 0)
+    if (qemuBuildDeviceAddressStr(&buf, def, &sound->info) < 0)
         return NULL;

     return virBufferContentAndReset(&buf);
@@ -4354,7 +4353,7 @@ qemuBuildDeviceVideoStr(const virDomainDef *def,
         virBufferAsprintf(&buf, ",xres=%u,yres=%u", video->res->x, video->res->y);
     }

-    if (qemuBuildDeviceAddressStr(&buf, def, &video->info, qemuCaps) < 0)
+    if (qemuBuildDeviceAddressStr(&buf, def, &video->info) < 0)
         return NULL;

     qemuBuildVirtioOptionsStr(&buf, video->virtio);
@@ -4536,7 +4535,7 @@ char *
 qemuBuildPCIHostdevDevStr(const virDomainDef *def,
                           virDomainHostdevDef *dev,
                           unsigned int bootIndex, /* used iff dev->info->bootIndex == 0 */
-                          virQEMUCaps *qemuCaps)
+                          virQEMUCaps *qemuCaps G_GNUC_UNUSED)
 {
     g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
     virDomainHostdevSubsysPCI *pcisrc = &dev->source.subsys.u.pci;
@@ -4571,7 +4570,7 @@ qemuBuildPCIHostdevDevStr(const virDomainDef *def,
         bootIndex = dev->info->bootIndex;
     if (bootIndex)
         virBufferAsprintf(&buf, ",bootindex=%u", bootIndex);
-    if (qemuBuildDeviceAddressStr(&buf, def, dev->info, qemuCaps) < 0)
+    if (qemuBuildDeviceAddressStr(&buf, def, dev->info) < 0)
         return NULL;
     if (qemuBuildRomStr(&buf, dev->info) < 0)
         return NULL;
@@ -4619,7 +4618,7 @@ qemuBuildUSBHostdevDevStr(const virDomainDef *def,
     if (dev->info->bootIndex)
         virBufferAsprintf(&buf, ",bootindex=%u", dev->info->bootIndex);

-    if (qemuBuildDeviceAddressStr(&buf, def, dev->info, qemuCaps) < 0)
+    if (qemuBuildDeviceAddressStr(&buf, def, dev->info) < 0)
         return NULL;

     return virBufferContentAndReset(&buf);
@@ -4629,13 +4628,13 @@ qemuBuildUSBHostdevDevStr(const virDomainDef *def,
 static char *
 qemuBuildHubDevStr(const virDomainDef *def,
                    virDomainHubDef *dev,
-                   virQEMUCaps *qemuCaps)
+                   virQEMUCaps *qemuCaps G_GNUC_UNUSED)
 {
     g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;

     virBufferAddLit(&buf, "usb-hub");
     virBufferAsprintf(&buf, ",id=%s", dev->info.alias);
-    if (qemuBuildDeviceAddressStr(&buf, def, &dev->info, qemuCaps) < 0)
+    if (qemuBuildDeviceAddressStr(&buf, def, &dev->info) < 0)
         return NULL;

     return virBufferContentAndReset(&buf);
@@ -4713,7 +4712,7 @@ qemuBuildSCSIVHostHostdevDevStr(const virDomainDef *def,
                       vhostfdName,
                       dev->info->alias);

-    if (qemuBuildDeviceAddressStr(&buf, def, dev->info, qemuCaps) < 0)
+    if (qemuBuildDeviceAddressStr(&buf, def, dev->info) < 0)
         return NULL;

     return virBufferContentAndReset(&buf);
@@ -5132,7 +5131,7 @@ qemuBuildHostdevMdevModelTypeString(virDomainHostdevSubsysMediatedDev *mdev)
 char *
 qemuBuildHostdevMediatedDevStr(const virDomainDef *def,
                                virDomainHostdevDef *dev,
-                               virQEMUCaps *qemuCaps)
+                               virQEMUCaps *qemuCaps G_GNUC_UNUSED)
 {
     g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
     virDomainHostdevSubsysMediatedDev *mdevsrc = &dev->source.subsys.u.mdev;
@@ -5152,7 +5151,7 @@ qemuBuildHostdevMediatedDevStr(const virDomainDef *def,
         virBufferAsprintf(&buf, ",display=%s",
                           virTristateSwitchTypeToString(mdevsrc->display));

-    if (qemuBuildDeviceAddressStr(&buf, def, dev->info, qemuCaps) < 0)
+    if (qemuBuildDeviceAddressStr(&buf, def, dev->info) < 0)
         return NULL;

     if (dev->info->bootIndex)
@@ -5632,7 +5631,7 @@ qemuBuildRNGDevStr(const virDomainDef *def,

     qemuBuildVirtioOptionsStr(&buf, dev->virtio);

-    if (qemuBuildDeviceAddressStr(&buf, def, &dev->info, qemuCaps) < 0)
+    if (qemuBuildDeviceAddressStr(&buf, def, &dev->info) < 0)
         return NULL;

     return virBufferContentAndReset(&buf);
@@ -9064,7 +9063,7 @@ qemuBuildSmartcardCommandLine(virLogManager *logManager,
 static char *
 qemuBuildShmemDevLegacyStr(virDomainDef *def,
                            virDomainShmemDef *shmem,
-                           virQEMUCaps *qemuCaps)
+                           virQEMUCaps *qemuCaps G_GNUC_UNUSED)
 {
     g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;

@@ -9088,7 +9087,7 @@ qemuBuildShmemDevLegacyStr(virDomainDef *def,
         }
     }

-    if (qemuBuildDeviceAddressStr(&buf, def, &shmem->info, qemuCaps) < 0)
+    if (qemuBuildDeviceAddressStr(&buf, def, &shmem->info) < 0)
         return NULL;

     return virBufferContentAndReset(&buf);
@@ -9097,7 +9096,7 @@ qemuBuildShmemDevLegacyStr(virDomainDef *def,
 char *
 qemuBuildShmemDevStr(virDomainDef *def,
                      virDomainShmemDef *shmem,
-                     virQEMUCaps *qemuCaps)
+                     virQEMUCaps *qemuCaps G_GNUC_UNUSED)
 {
     g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;

@@ -9129,7 +9128,7 @@ qemuBuildShmemDevStr(virDomainDef *def,
                           virTristateSwitchTypeToString(shmem->msi.ioeventfd));
     }

-    if (qemuBuildDeviceAddressStr(&buf, def, &shmem->info, qemuCaps) < 0)
+    if (qemuBuildDeviceAddressStr(&buf, def, &shmem->info) < 0)
         return NULL;

     return virBufferContentAndReset(&buf);
@@ -9577,7 +9576,7 @@ qemuBuildConsoleCommandLine(virLogManager *logManager,
 char *
 qemuBuildRedirdevDevStr(const virDomainDef *def,
                         virDomainRedirdevDef *dev,
-                        virQEMUCaps *qemuCaps)
+                        virQEMUCaps *qemuCaps G_GNUC_UNUSED)
 {
     size_t i;
     g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
@@ -9620,7 +9619,7 @@ qemuBuildRedirdevDevStr(const virDomainDef *def,
     if (dev->info.bootIndex)
         virBufferAsprintf(&buf, ",bootindex=%u", dev->info.bootIndex);

-    if (qemuBuildDeviceAddressStr(&buf, def, &dev->info, qemuCaps) < 0)
+    if (qemuBuildDeviceAddressStr(&buf, def, &dev->info) < 0)
         return NULL;

     return virBufferContentAndReset(&buf);
@@ -9743,7 +9742,7 @@ qemuBuildDomainLoaderCommandLine(virCommand *cmd,
 static char *
 qemuBuildTPMDevStr(const virDomainDef *def,
                    virDomainTPMDef *tpm,
-                   virQEMUCaps *qemuCaps)
+                   virQEMUCaps *qemuCaps G_GNUC_UNUSED)
 {
     g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
     const char *model = virDomainTPMModelTypeToString(tpm->model);
@@ -9754,7 +9753,7 @@ qemuBuildTPMDevStr(const virDomainDef *def,
     virBufferAsprintf(&buf, "%s,tpmdev=tpm-%s,id=%s",
                       model, tpm->info.alias, tpm->info.alias);

-    if (qemuBuildDeviceAddressStr(&buf, def, &tpm->info, qemuCaps) < 0)
+    if (qemuBuildDeviceAddressStr(&buf, def, &tpm->info) < 0)
         return NULL;

     return virBufferContentAndReset(&buf);
@@ -10324,7 +10323,7 @@ qemuBuildVsockDevStr(virDomainDef *def,

     qemuBuildVirtioOptionsStr(&buf, vsock->virtio);

-    if (qemuBuildDeviceAddressStr(&buf, def, &vsock->info, qemuCaps) < 0)
+    if (qemuBuildDeviceAddressStr(&buf, def, &vsock->info) < 0)
         return NULL;

     return virBufferContentAndReset(&buf);
@@ -10762,7 +10761,7 @@ qemuBuildSerialChrDeviceStr(char **deviceStr,
                       virDomainChrSerialTargetModelTypeToString(serial->targetModel),
                       serial->info.alias, serial->info.alias);

-    if (qemuBuildDeviceAddressStr(&buf, def, &serial->info, qemuCaps) < 0)
+    if (qemuBuildDeviceAddressStr(&buf, def, &serial->info) < 0)
         return -1;

     *deviceStr = virBufferContentAndReset(&buf);
-- 
2.30.2




[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