mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-25 01:34:11 +03:00
qemu: command: Ignore QEMU_CAPS_DEVICE when building drive alias
QEMU_CAPS_DEVICE is always set nowadays, so we can drop the non-DEVICE code paths
This commit is contained in:
parent
afdb3fc901
commit
c7d6c13989
@ -377,17 +377,13 @@ qemuBuildObjectCommandlineFromJSON(const char *type,
|
||||
}
|
||||
|
||||
|
||||
char *qemuDeviceDriveHostAlias(virDomainDiskDefPtr disk,
|
||||
virQEMUCapsPtr qemuCaps)
|
||||
char *qemuDeviceDriveHostAlias(virDomainDiskDefPtr disk)
|
||||
{
|
||||
char *ret;
|
||||
|
||||
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE)) {
|
||||
ignore_value(virAsprintf(&ret, "%s%s", QEMU_DRIVE_HOST_PREFIX,
|
||||
disk->info.alias));
|
||||
} else {
|
||||
ignore_value(VIR_STRDUP(ret, disk->info.alias));
|
||||
}
|
||||
if (virAsprintf(&ret, "%s%s",
|
||||
QEMU_DRIVE_HOST_PREFIX, disk->info.alias) < 0)
|
||||
return NULL;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -96,8 +96,7 @@ char *qemuBuildNicDevStr(virDomainDefPtr def,
|
||||
size_t vhostfdSize,
|
||||
virQEMUCapsPtr qemuCaps);
|
||||
|
||||
char *qemuDeviceDriveHostAlias(virDomainDiskDefPtr disk,
|
||||
virQEMUCapsPtr qemuCaps);
|
||||
char *qemuDeviceDriveHostAlias(virDomainDiskDefPtr disk);
|
||||
|
||||
/* Both legacy & current support */
|
||||
char *qemuBuildDriveStr(virDomainDiskDefPtr disk,
|
||||
|
@ -192,7 +192,7 @@ qemuDomainChangeEjectableMedia(virQEMUDriverPtr driver,
|
||||
if (qemuDomainPrepareDisk(driver, vm, disk, newsrc, false) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (!(driveAlias = qemuDeviceDriveHostAlias(disk, priv->qemuCaps)))
|
||||
if (!(driveAlias = qemuDeviceDriveHostAlias(disk)))
|
||||
goto error;
|
||||
|
||||
do {
|
||||
@ -376,7 +376,7 @@ qemuDomainAttachVirtioDiskDevice(virConnectPtr conn,
|
||||
if (!(drivestr = qemuBuildDriveStr(disk, false, priv->qemuCaps)))
|
||||
goto error;
|
||||
|
||||
if (!(drivealias = qemuDeviceDriveHostAlias(disk, priv->qemuCaps)))
|
||||
if (!(drivealias = qemuDeviceDriveHostAlias(disk)))
|
||||
goto error;
|
||||
|
||||
if (!(devstr = qemuBuildDriveDevStr(vm->def, disk, 0, priv->qemuCaps)))
|
||||
|
Loading…
Reference in New Issue
Block a user