The qemuCaps is left for the device commandline formatters for now as it might come in handy. Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx> --- 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 0ac899ba80..a0e489fb59 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -343,8 +343,7 @@ qemuVirCommandGetDevSet(virCommandPtr cmd, int fd) static int qemuBuildDeviceAddressStr(virBufferPtr buf, const virDomainDef *domainDef, - virDomainDeviceInfoPtr info, - virQEMUCapsPtr qemuCaps G_GNUC_UNUSED) + virDomainDeviceInfoPtr info) { g_autofree char *devStr = NULL; const char *contAlias = NULL; @@ -1830,14 +1829,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; @@ -2303,7 +2302,7 @@ qemuBuildVHostUserFsCommandLine(virCommandPtr 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); @@ -2378,7 +2377,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); @@ -2772,7 +2771,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); @@ -3418,7 +3417,7 @@ qemuBuildMemoryDimmBackendStr(virBufferPtr buf, char * qemuBuildMemoryDeviceStr(const virDomainDef *def, virDomainMemoryDefPtr mem, - virQEMUCapsPtr qemuCaps) + virQEMUCapsPtr qemuCaps G_GNUC_UNUSED) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; const char *device = NULL; @@ -3471,7 +3470,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); @@ -3631,7 +3630,7 @@ qemuBuildNicDevStr(virDomainDefPtr 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; @@ -3840,7 +3839,7 @@ qemuBuildHostNetStr(virDomainNetDefPtr net, char * qemuBuildWatchdogDevStr(const virDomainDef *def, virDomainWatchdogDefPtr dev, - virQEMUCapsPtr qemuCaps) + virQEMUCapsPtr qemuCaps G_GNUC_UNUSED) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; @@ -3852,7 +3851,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); @@ -3919,7 +3918,7 @@ qemuBuildMemballoonCommandLine(virCommandPtr 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) { @@ -4020,7 +4019,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); @@ -4031,7 +4030,7 @@ qemuBuildVirtioInputDevStr(const virDomainDef *def, static char * qemuBuildUSBInputDevStr(const virDomainDef *def, virDomainInputDefPtr dev, - virQEMUCapsPtr qemuCaps) + virQEMUCapsPtr qemuCaps G_GNUC_UNUSED) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; @@ -4047,7 +4046,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); @@ -4155,7 +4154,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); @@ -4353,7 +4352,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); @@ -4535,7 +4534,7 @@ char * qemuBuildPCIHostdevDevStr(const virDomainDef *def, virDomainHostdevDefPtr dev, unsigned int bootIndex, /* used iff dev->info->bootIndex == 0 */ - virQEMUCapsPtr qemuCaps) + virQEMUCapsPtr qemuCaps G_GNUC_UNUSED) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; virDomainHostdevSubsysPCIPtr pcisrc = &dev->source.subsys.u.pci; @@ -4570,7 +4569,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; @@ -4618,7 +4617,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); @@ -4628,13 +4627,13 @@ qemuBuildUSBHostdevDevStr(const virDomainDef *def, static char * qemuBuildHubDevStr(const virDomainDef *def, virDomainHubDefPtr dev, - virQEMUCapsPtr qemuCaps) + virQEMUCapsPtr 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); @@ -4712,7 +4711,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); @@ -5131,7 +5130,7 @@ qemuBuildHostdevMdevModelTypeString(virDomainHostdevSubsysMediatedDevPtr mdev) char * qemuBuildHostdevMediatedDevStr(const virDomainDef *def, virDomainHostdevDefPtr dev, - virQEMUCapsPtr qemuCaps) + virQEMUCapsPtr qemuCaps G_GNUC_UNUSED) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; virDomainHostdevSubsysMediatedDevPtr mdevsrc = &dev->source.subsys.u.mdev; @@ -5153,7 +5152,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) @@ -5633,7 +5632,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); @@ -9065,7 +9064,7 @@ qemuBuildSmartcardCommandLine(virLogManagerPtr logManager, static char * qemuBuildShmemDevLegacyStr(virDomainDefPtr def, virDomainShmemDefPtr shmem, - virQEMUCapsPtr qemuCaps) + virQEMUCapsPtr qemuCaps G_GNUC_UNUSED) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; @@ -9089,7 +9088,7 @@ qemuBuildShmemDevLegacyStr(virDomainDefPtr def, } } - if (qemuBuildDeviceAddressStr(&buf, def, &shmem->info, qemuCaps) < 0) + if (qemuBuildDeviceAddressStr(&buf, def, &shmem->info) < 0) return NULL; return virBufferContentAndReset(&buf); @@ -9098,7 +9097,7 @@ qemuBuildShmemDevLegacyStr(virDomainDefPtr def, char * qemuBuildShmemDevStr(virDomainDefPtr def, virDomainShmemDefPtr shmem, - virQEMUCapsPtr qemuCaps) + virQEMUCapsPtr qemuCaps G_GNUC_UNUSED) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; @@ -9130,7 +9129,7 @@ qemuBuildShmemDevStr(virDomainDefPtr 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); @@ -9578,7 +9577,7 @@ qemuBuildConsoleCommandLine(virLogManagerPtr logManager, char * qemuBuildRedirdevDevStr(const virDomainDef *def, virDomainRedirdevDefPtr dev, - virQEMUCapsPtr qemuCaps) + virQEMUCapsPtr qemuCaps G_GNUC_UNUSED) { size_t i; g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; @@ -9621,7 +9620,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); @@ -9744,7 +9743,7 @@ qemuBuildDomainLoaderCommandLine(virCommandPtr cmd, static char * qemuBuildTPMDevStr(const virDomainDef *def, virDomainTPMDefPtr tpm, - virQEMUCapsPtr qemuCaps) + virQEMUCapsPtr qemuCaps G_GNUC_UNUSED) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; const char *model = virDomainTPMModelTypeToString(tpm->model); @@ -9755,7 +9754,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); @@ -10325,7 +10324,7 @@ qemuBuildVsockDevStr(virDomainDefPtr 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); @@ -10763,7 +10762,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