diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index 3cfaf2b9bc..68def65bf9 100644 --- a/src/conf/storage_conf.c +++ b/src/conf/storage_conf.c @@ -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 &&