Blob Blame History Raw
From d6b698815d887ba6ff5196e8d815283e5e250592 Mon Sep 17 00:00:00 2001
From: Cole Robinson <crobinso@redhat.com>
Date: Sun, 21 Sep 2014 15:04:16 -0400
Subject: [PATCH] createinterface: Use inactive XML for embeding child XML

The inactive XML will drop things like complex protocol output and
link state info, which netcf can choke on for sub interfaces.

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

(cherry picked from commit 662922dc955591b15b88be567a05e7918d713f12)
---
 virtManager/createinterface.py | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/virtManager/createinterface.py b/virtManager/createinterface.py
index 5faa6ee..c8a72c2 100644
--- a/virtManager/createinterface.py
+++ b/virtManager/createinterface.py
@@ -926,8 +926,18 @@ class vmmCreateInterface(vmmGObjectUI):
             if (itype == Interface.INTERFACE_TYPE_BRIDGE or
                 itype == Interface.INTERFACE_TYPE_BOND):
                 for row in ifaces:
-                    child = Interface(self.conn.get_backend(),
-                        parsexml=row[INTERFACE_ROW_KEY].get_xml_config())
+                    if row[INTERFACE_ROW_IS_DEFINED]:
+                        vmmiface = self.conn.get_interface(
+                            row[INTERFACE_ROW_NAME])
+
+                        # Use the inactive XML, which drops a bunch
+                        # elements that might cause netcf to choke on
+                        # for a sub-interface
+                        xml = vmmiface.get_xml(inactive=True)
+                    else:
+                        xml = row[INTERFACE_ROW_KEY].get_xml_config()
+
+                    child = Interface(self.conn.get_backend(), parsexml=xml)
                     iobj.add_interface(child)
                 check_conflict = True
 
-- 
1.9.3