The only instance in this file can be simplified to avoid checking the capability. Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx> --- src/qemu/qemu_alias.c | 10 ++++------ src/qemu/qemu_alias.h | 5 ++--- src/qemu/qemu_hotplug.c | 2 +- src/qemu/qemu_process.c | 2 +- tests/qemuhotplugtest.c | 2 +- 5 files changed, 9 insertions(+), 12 deletions(-) diff --git a/src/qemu/qemu_alias.c b/src/qemu/qemu_alias.c index 7b91fe3141..835401dc07 100644 --- a/src/qemu/qemu_alias.c +++ b/src/qemu/qemu_alias.c @@ -192,8 +192,7 @@ qemuAssignDeviceControllerAlias(virDomainDef *domainDef, int qemuAssignDeviceDiskAlias(virDomainDef *def, - virDomainDiskDef *disk, - virQEMUCaps *qemuCaps) + virDomainDiskDef *disk) { qemuDomainDiskPrivate *diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk); const char *prefix = virDomainDiskBusTypeToString(disk->bus); @@ -231,8 +230,7 @@ qemuAssignDeviceDiskAlias(virDomainDef *def, * on the alias in qemu. While certain disk types use just the alias, some * need the full path into /machine/peripheral as a historical artifact. */ - if (!diskPriv->qomName && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV)) { + if (!diskPriv->qomName) { switch ((virDomainDiskBus) disk->bus) { case VIR_DOMAIN_DISK_BUS_FDC: case VIR_DOMAIN_DISK_BUS_IDE: @@ -606,12 +604,12 @@ qemuAssignDeviceIOMMUAlias(virDomainIOMMUDef *iommu) int -qemuAssignDeviceAliases(virDomainDef *def, virQEMUCaps *qemuCaps) +qemuAssignDeviceAliases(virDomainDef *def) { size_t i; for (i = 0; i < def->ndisks; i++) { - if (qemuAssignDeviceDiskAlias(def, def->disks[i], qemuCaps) < 0) + if (qemuAssignDeviceDiskAlias(def, def->disks[i]) < 0) return -1; } for (i = 0; i < def->nnets; i++) { diff --git a/src/qemu/qemu_alias.h b/src/qemu/qemu_alias.h index 1a583b8207..6433ae4cec 100644 --- a/src/qemu/qemu_alias.h +++ b/src/qemu/qemu_alias.h @@ -33,8 +33,7 @@ void qemuAssignDeviceControllerAlias(virDomainDef *domainDef, virDomainControllerDef *controller); int qemuAssignDeviceDiskAlias(virDomainDef *def, - virDomainDiskDef *disk, - virQEMUCaps *qemuCaps); + virDomainDiskDef *disk); void qemuAssignDeviceHostdevAlias(virDomainDef *def, char **alias, @@ -71,7 +70,7 @@ void qemuAssignDeviceInputAlias(virDomainDef *def, void qemuAssignDeviceVsockAlias(virDomainVsockDef *vsock); -int qemuAssignDeviceAliases(virDomainDef *def, virQEMUCaps *qemuCaps); +int qemuAssignDeviceAliases(virDomainDef *def); int qemuDomainDeviceAliasIndex(const virDomainDeviceInfo *info, const char *prefix); diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 5eb370c3df..28e4284e62 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -1081,7 +1081,7 @@ qemuDomainAttachDeviceDiskLiveInternal(virQEMUDriver *driver, releaseSeclabel = true; - if (qemuAssignDeviceDiskAlias(vm->def, disk, priv->qemuCaps) < 0) + if (qemuAssignDeviceDiskAlias(vm->def, disk) < 0) goto cleanup; if (qemuDomainPrepareDiskSource(disk, priv, cfg) < 0) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 6083ee10d8..f13664c7f2 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -6629,7 +6629,7 @@ qemuProcessPrepareDomain(virQEMUDriver *driver, return -1; } - if (qemuAssignDeviceAliases(vm->def, priv->qemuCaps) < 0) + if (qemuAssignDeviceAliases(vm->def) < 0) return -1; qemuProcessPrepareDeviceBootorder(vm->def); diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index 3c9dac241a..c938c8dc4c 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -107,7 +107,7 @@ qemuHotplugCreateObjects(virDomainXMLOption *xmlopt, return -1; } - if (qemuAssignDeviceAliases((*vm)->def, priv->qemuCaps) < 0) + if (qemuAssignDeviceAliases((*vm)->def) < 0) return -1; (*vm)->def->id = QEMU_HOTPLUG_TEST_DOMAIN_ID; -- 2.36.1