[PATCH 1/2] conf: Alter error message for vHBA creation using parent wwnn/wwpn

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit id 'bb74a7ffe' added a fairly non specific message when providing
only the <parent wwnn='xxx'/> or <parent wwpn='xxx'/> instead of providing
both wwnn and wwpn. This patch just modifies the message to be more specific
about which was missing.

Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
---
 src/conf/node_device_conf.c | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c
index 3565aec..2b49f5c 100644
--- a/src/conf/node_device_conf.c
+++ b/src/conf/node_device_conf.c
@@ -1615,10 +1615,19 @@ virNodeDeviceDefParseXML(xmlXPathContextPtr ctxt,
     def->parent = virXPathString("string(./parent[1])", ctxt);
     def->parent_wwnn = virXPathString("string(./parent[1]/@wwnn)", ctxt);
     def->parent_wwpn = virXPathString("string(./parent[1]/@wwpn)", ctxt);
-    if ((def->parent_wwnn && !def->parent_wwpn) ||
-        (!def->parent_wwnn && def->parent_wwpn)) {
-        virReportError(VIR_ERR_XML_ERROR, "%s",
-                       _("must supply both wwnn and wwpn for parent"));
+    if (def->parent_wwnn && !def->parent_wwpn) {
+        virReportError(VIR_ERR_XML_ERROR,
+                       _("when providing parent wwnn='%s', the "
+                         "wwpn must also be provided"),
+                       def->parent_wwnn);
+        goto error;
+    }
+
+    if (!def->parent_wwnn && def->parent_wwpn) {
+        virReportError(VIR_ERR_XML_ERROR,
+                       _("when providing parent wwpn='%s', the "
+                         "wwnn must also be provided"),
+                       def->parent_wwpn);
         goto error;
     }
     def->parent_fabric_wwn = virXPathString("string(./parent[1]/@fabric_wwn)",
-- 
2.9.3

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux