提交 72475ac3 编写于 作者: P Peter Krempa

conf: Allow all volume modes for disk type='lun' sources

Commit 82ba4110 made possible to use direct mapped iSCSI
volumes in qemu as disk sources but didn't remove the define time check.

Rework the check by simplifying the condition and allow any volumes to
be used with disk type='lun'.
上级 0e8a72a5
...@@ -4145,26 +4145,18 @@ virDomainDeviceDefPostParseInternal(virDomainDeviceDefPtr dev, ...@@ -4145,26 +4145,18 @@ virDomainDeviceDefPostParseInternal(virDomainDeviceDefPtr dev,
} }
} }
/* Validate LUN configuration /* Validate LUN configuration */
* NOTE: virStorageTranslateDiskSourcePool is not run yet, so for if (disk->device == VIR_DOMAIN_DISK_DEVICE_LUN) {
* disk "volume"'s, the closest we can get at config time is /* volumes haven't been translated at this point, so accept them */
* to ensure mode isn't direct since host/default will allow if (!(disk->src->type == VIR_STORAGE_TYPE_BLOCK ||
* lun/block usage. At run time if it's determined the wrong disk->src->type == VIR_STORAGE_TYPE_VOLUME ||
* voltype and pooltype values are set, then failure occurs (disk->src->type == VIR_STORAGE_TYPE_NETWORK &&
*/ disk->src->protocol == VIR_STORAGE_NET_PROTOCOL_ISCSI))) {
if (disk->device == VIR_DOMAIN_DISK_DEVICE_LUN && virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
!(disk->src->type == VIR_STORAGE_TYPE_BLOCK || _("disk '%s' improperly configured for a "
(disk->src->type == VIR_STORAGE_TYPE_NETWORK && "device='lun'"), disk->dst);
disk->src->protocol == VIR_STORAGE_NET_PROTOCOL_ISCSI) || return -1;
(disk->src->type == VIR_STORAGE_TYPE_VOLUME && }
disk->src->srcpool &&
disk->src->srcpool->mode !=
VIR_STORAGE_SOURCE_POOL_MODE_DIRECT))) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("disk '%s' improperly configured for a "
"device='lun'"),
disk->dst);
return -1;
} }
if (disk->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE && if (disk->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE &&
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册