diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 03e574093587f8a819475ec82382b0bf796c2515..492e0b73a44e3bdfcc50bdbc715b1f8cd76ec594 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -3699,16 +3699,16 @@ error: } int -virDomainDiskFindControllerModel(virDomainDefPtr def, - virDomainDiskDefPtr disk, - int controllerType) +virDomainDeviceFindControllerModel(virDomainDefPtr def, + virDomainDeviceInfoPtr info, + int controllerType) { int model = -1; int i; for (i = 0; i < def->ncontrollers; i++) { if (def->controllers[i]->type == controllerType && - def->controllers[i]->idx == disk->info.addr.drive.controller) + def->controllers[i]->idx == info->addr.drive.controller) model = def->controllers[i]->model; } diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index ec823e2d7263518e5d30c4ff178e719c3ae8c60f..08b8e48d17690001e5a04f5b4cce09b9aae22d4e 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2023,9 +2023,9 @@ void virDomainInputDefFree(virDomainInputDefPtr def); void virDomainDiskDefFree(virDomainDiskDefPtr def); void virDomainLeaseDefFree(virDomainLeaseDefPtr def); void virDomainDiskHostDefFree(virDomainDiskHostDefPtr def); -int virDomainDiskFindControllerModel(virDomainDefPtr def, - virDomainDiskDefPtr disk, - int controllerType); +int virDomainDeviceFindControllerModel(virDomainDefPtr def, + virDomainDeviceInfoPtr info, + int controllerType); virDomainDiskDefPtr virDomainDiskFindByBusAndDst(virDomainDefPtr def, int bus, char *dst); diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 3a297ec1fd1846d821b316cb49de7358ea8cdc28..449696d112f5838dc1e6cc6c2135f385ebfa70a3 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -125,6 +125,7 @@ virDomainDeviceAddressTypeToString; virDomainDeviceDefCopy; virDomainDeviceDefFree; virDomainDeviceDefParse; +virDomainDeviceFindControllerModel; virDomainDeviceInfoCopy; virDomainDeviceInfoIterate; virDomainDeviceTypeToString; @@ -142,7 +143,6 @@ virDomainDiskDeviceTypeToString; virDomainDiskErrorPolicyTypeFromString; virDomainDiskErrorPolicyTypeToString; virDomainDiskFindByBusAndDst; -virDomainDiskFindControllerModel; virDomainDiskGeometryTransTypeFromString; virDomainDiskGeometryTransTypeToString; virDomainDiskHostDefFree; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 173938b646700c8b55de8ab303dc0ee084e4b399..41a2dfdd863043b46a3266381a66a342366a1698 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -557,8 +557,8 @@ qemuAssignDeviceDiskAliasCustom(virDomainDefPtr def, if (disk->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DRIVE) { if (disk->bus == VIR_DOMAIN_DISK_BUS_SCSI) { controllerModel = - virDomainDiskFindControllerModel(def, disk, - VIR_DOMAIN_CONTROLLER_TYPE_SCSI); + virDomainDeviceFindControllerModel(def, &disk->info, + VIR_DOMAIN_CONTROLLER_TYPE_SCSI); if ((qemuSetScsiControllerModel(def, qemuCaps, &controllerModel)) < 0) return -1; @@ -3210,8 +3210,8 @@ qemuBuildDriveDevStr(virDomainDefPtr def, } controllerModel = - virDomainDiskFindControllerModel(def, disk, - VIR_DOMAIN_CONTROLLER_TYPE_SCSI); + virDomainDeviceFindControllerModel(def, &disk->info, + VIR_DOMAIN_CONTROLLER_TYPE_SCSI); if ((qemuSetScsiControllerModel(def, qemuCaps, &controllerModel)) < 0) goto error;