提交 d72ed16b 编写于 作者: X Xu Yandong 提交者: Michal Privoznik

qemuCheckDiskConfigAgainstDomain: Validate disk's SCSI address iff disk is SCSI

Check the disk SCSI address only when the disk actually is of
SCSI type.
Signed-off-by: NXu Yandong <xuyandong2@huawei.com>
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
上级 5f646ffd
......@@ -8314,7 +8314,8 @@ static int
qemuCheckDiskConfigAgainstDomain(const virDomainDef *def,
const virDomainDiskDef *disk)
{
if (virDomainSCSIDriveAddressIsUsed(def, &disk->info.addr.drive)) {
if (disk->bus == VIR_DOMAIN_DISK_BUS_SCSI &&
virDomainSCSIDriveAddressIsUsed(def, &disk->info.addr.drive)) {
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("Domain already contains a disk with that address"));
return -1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册