mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-30 16:35:24 +00:00
qemu: alias: Remove check for QEMU_CAPS_BLOCKDEV
The only instance in this file can be simplified to avoid checking the capability. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
99a770881a
commit
071a4c8ba7
@ -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++) {
|
||||
|
@ -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);
|
||||
|
@ -1072,7 +1072,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)
|
||||
|
@ -6607,7 +6607,7 @@ qemuProcessPrepareDomain(virQEMUDriver *driver,
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (qemuAssignDeviceAliases(vm->def, priv->qemuCaps) < 0)
|
||||
if (qemuAssignDeviceAliases(vm->def) < 0)
|
||||
return -1;
|
||||
|
||||
qemuProcessPrepareDeviceBootorder(vm->def);
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user