提交 d21fc709 编写于 作者: J John Ferlan

conf: Ensure both parent_wwnn/parent_wwpn provided

https://bugzilla.redhat.com/show_bug.cgi?id=1428209

Commit id 'bb74a7ff' neglected to check that both the parent_wwnn
parent_wwpn are in the XML if one or the other is similar to how
the node device code checked (commit id '2b13361b').

If only one is provided, the "default" is to use a vHBA capable
adapter (see commit id '78be2e8b'), so the vHBA could start, but
perhaps not on the expected adapter.
Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
上级 3c647ee4
......@@ -941,6 +941,25 @@ virStoragePoolDefParseXML(xmlXPathContextPtr ctxt)
if (!virValidateWWN(ret->source.adapter.data.fchost.wwnn) ||
!virValidateWWN(ret->source.adapter.data.fchost.wwpn))
goto error;
if ((ret->source.adapter.data.fchost.parent_wwnn &&
!ret->source.adapter.data.fchost.parent_wwpn)) {
virReportError(VIR_ERR_XML_ERROR,
_("when providing parent_wwnn='%s', the "
"parent_wwpn must also be provided"),
ret->source.adapter.data.fchost.parent_wwnn);
goto error;
}
if (!ret->source.adapter.data.fchost.parent_wwnn &&
ret->source.adapter.data.fchost.parent_wwpn) {
virReportError(VIR_ERR_XML_ERROR,
_("when providing parent_wwpn='%s', the "
"parent_wwnn must also be provided"),
ret->source.adapter.data.fchost.parent_wwpn);
goto error;
}
} else if (ret->source.adapter.type ==
VIR_STORAGE_POOL_SOURCE_ADAPTER_TYPE_SCSI_HOST) {
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.
先完成此消息的编辑!
想要评论请 注册