mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
qemuBuildSCSIHostdevDevStr: Pass in backend alias
Don't (re)generate the backend alias (alias of the -drive backend for now) internally but rather pass it in. Later on it will be replaced by the nodename when blockdev is used depending on the capabilities. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
6cfcc0c68e
commit
78e8bb743b
@ -4641,11 +4641,11 @@ qemuBuildSCSIHostdevDrvStr(virDomainHostdevDefPtr dev,
|
||||
|
||||
char *
|
||||
qemuBuildSCSIHostdevDevStr(const virDomainDef *def,
|
||||
virDomainHostdevDefPtr dev)
|
||||
virDomainHostdevDefPtr dev,
|
||||
const char *backendAlias)
|
||||
{
|
||||
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||
int model = -1;
|
||||
g_autofree char *driveAlias = NULL;
|
||||
const char *contAlias;
|
||||
|
||||
model = qemuDomainFindSCSIControllerModel(def, dev->info);
|
||||
@ -4687,9 +4687,7 @@ qemuBuildSCSIHostdevDevStr(const virDomainDef *def,
|
||||
dev->info->addr.drive.unit);
|
||||
}
|
||||
|
||||
if (!(driveAlias = qemuAliasFromHostdev(dev)))
|
||||
return NULL;
|
||||
virBufferAsprintf(&buf, ",drive=%s,id=%s", driveAlias, dev->info->alias);
|
||||
virBufferAsprintf(&buf, ",drive=%s,id=%s", backendAlias, dev->info->alias);
|
||||
|
||||
if (dev->info->bootIndex)
|
||||
virBufferAsprintf(&buf, ",bootindex=%u", dev->info->bootIndex);
|
||||
@ -5073,6 +5071,7 @@ qemuBuildHostdevSCSICommandLine(virCommandPtr cmd,
|
||||
virDomainHostdevSubsysSCSIPtr scsisrc = &hostdev->source.subsys.u.scsi;
|
||||
g_autofree char *devstr = NULL;
|
||||
g_autofree char *drvstr = NULL;
|
||||
g_autofree char *backendAlias = NULL;
|
||||
|
||||
if (scsisrc->protocol == VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_ISCSI) {
|
||||
virDomainHostdevSubsysSCSIiSCSIPtr iscsisrc =
|
||||
@ -5091,8 +5090,11 @@ qemuBuildHostdevSCSICommandLine(virCommandPtr cmd,
|
||||
return -1;
|
||||
virCommandAddArg(cmd, drvstr);
|
||||
|
||||
if (!(backendAlias = qemuAliasFromHostdev(hostdev)))
|
||||
return -1;
|
||||
|
||||
virCommandAddArg(cmd, "-device");
|
||||
if (!(devstr = qemuBuildSCSIHostdevDevStr(def, hostdev)))
|
||||
if (!(devstr = qemuBuildSCSIHostdevDevStr(def, hostdev, backendAlias)))
|
||||
return -1;
|
||||
virCommandAddArg(cmd, devstr);
|
||||
|
||||
|
@ -179,7 +179,9 @@ char *qemuBuildSCSIHostdevDrvStr(virDomainHostdevDefPtr dev,
|
||||
virQEMUCapsPtr qemuCaps);
|
||||
|
||||
char *qemuBuildSCSIHostdevDevStr(const virDomainDef *def,
|
||||
virDomainHostdevDefPtr dev);
|
||||
virDomainHostdevDefPtr dev,
|
||||
const char *backendAlias);
|
||||
|
||||
char *
|
||||
qemuBuildSCSIVHostHostdevDevStr(const virDomainDef *def,
|
||||
virDomainHostdevDefPtr dev,
|
||||
|
@ -2630,7 +2630,7 @@ qemuDomainAttachHostSCSIDevice(virQEMUDriverPtr driver,
|
||||
if (!(drivealias = qemuAliasFromHostdev(hostdev)))
|
||||
goto cleanup;
|
||||
|
||||
if (!(devstr = qemuBuildSCSIHostdevDevStr(vm->def, hostdev)))
|
||||
if (!(devstr = qemuBuildSCSIHostdevDevStr(vm->def, hostdev, drivealias)))
|
||||
goto cleanup;
|
||||
|
||||
if (VIR_REALLOC_N(vm->def->hostdevs, vm->def->nhostdevs + 1) < 0)
|
||||
|
Loading…
Reference in New Issue
Block a user