[libvirt] [PATCH v3 01/18] conf: Ensure both parent_wwnn/parent_wwpn provided

John Ferlan jferlan at redhat.com
Fri Mar 10 21:10:33 UTC 2017


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

Commit id 'bb74a7ffe' 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 '2b13361bc').

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: John Ferlan <jferlan at redhat.com>
---
 src/conf/storage_conf.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c
index a52eeba..e4d89dd 100644
--- a/src/conf/storage_conf.c
+++ b/src/conf/storage_conf.c
@@ -941,6 +941,17 @@ 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) ||
+                (!ret->source.adapter.data.fchost.parent_wwnn &&
+                 ret->source.adapter.data.fchost.parent_wwpn)) {
+                virReportError(VIR_ERR_XML_ERROR, "%s",
+                               _("must supply both parent_wwnn and "
+                                 "parent_wwpn not just one or the other"));
+                    goto error;
+            }
+
         } else if (ret->source.adapter.type ==
                    VIR_STORAGE_POOL_SOURCE_ADAPTER_TYPE_SCSI_HOST) {
             if (!ret->source.adapter.data.scsi_host.name &&
-- 
2.9.3




More information about the libvir-list mailing list