提交 2077ea84 编写于 作者: J John Ferlan

conf: Add missing validate for fchost search fields

Commit id 'bb74a7ff' added some new fields to search for a fchost by
parent wwnn/wwpn or parent_fabric_name, but neglected to validate that
the data within the fields was valid at parse time. This could lead to
eventual failure at run time, so rather than have the failure then, let's
validate now.
Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
上级 d21fc709
...@@ -960,6 +960,18 @@ virStoragePoolDefParseXML(xmlXPathContextPtr ctxt) ...@@ -960,6 +960,18 @@ virStoragePoolDefParseXML(xmlXPathContextPtr ctxt)
goto error; goto error;
} }
if (ret->source.adapter.data.fchost.parent_wwnn &&
!virValidateWWN(ret->source.adapter.data.fchost.parent_wwnn))
goto error;
if (ret->source.adapter.data.fchost.parent_wwpn &&
!virValidateWWN(ret->source.adapter.data.fchost.parent_wwpn))
goto error;
if (ret->source.adapter.data.fchost.parent_fabric_wwn &&
!virValidateWWN(ret->source.adapter.data.fchost.parent_fabric_wwn))
goto error;
} else if (ret->source.adapter.type == } else if (ret->source.adapter.type ==
VIR_STORAGE_POOL_SOURCE_ADAPTER_TYPE_SCSI_HOST) { VIR_STORAGE_POOL_SOURCE_ADAPTER_TYPE_SCSI_HOST) {
if (!ret->source.adapter.data.scsi_host.name && if (!ret->source.adapter.data.scsi_host.name &&
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册