提交 83f2b62c 编写于 作者: J John Ferlan

conf: Add check for host address type while checking in use

While searching the hostdevs the drive type can be either *_TYPE_DRIVE
or *_TYPE_NONE.  If the type is _TYPE_NONE on the first scsi_host, then
there is an erroneous "match" that the address already exists.

Although this works by chance currently because hostdev's are added one
at a time and 'nhostdevs' would be zero, thus returning false for the
first hostdev added, a future patch will move the hostdev address
assignment into post processing resulting in the bad match.

This code is only called by path's expecting either drive or none.
Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
上级 ca2cf74e
...@@ -3917,7 +3917,8 @@ virDomainDriveAddressIsUsedByHostdev(const virDomainDef *def, ...@@ -3917,7 +3917,8 @@ virDomainDriveAddressIsUsedByHostdev(const virDomainDef *def,
for (i = 0; i < def->nhostdevs; i++) { for (i = 0; i < def->nhostdevs; i++) {
hostdev = def->hostdevs[i]; hostdev = def->hostdevs[i];
if (hostdev->source.subsys.type != type) if (hostdev->source.subsys.type != type ||
hostdev->info->type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DRIVE)
continue; continue;
if (hostdev->info->addr.drive.controller == controller && if (hostdev->info->addr.drive.controller == controller &&
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册