[PATCH 1/9] conf: split interface target element condition

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

 



Check for the 'dev' attribute in a separate condition, to make
parsing future attributes easier.

Signed-off-by: Ján Tomko <jtomko@xxxxxxxxxx>
---
 src/conf/domain_conf.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 3689ac0a82..c0a8ae7898 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -11069,15 +11069,16 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt,
                     }
                     ctxt->node = tmpnode;
                 }
-            } else if (!ifname &&
-                       virXMLNodeNameEqual(cur, "target")) {
-                ifname = virXMLPropString(cur, "dev");
-                if (ifname &&
-                    (flags & VIR_DOMAIN_DEF_PARSE_INACTIVE) &&
-                    (STRPREFIX(ifname, VIR_NET_GENERATED_TAP_PREFIX) ||
-                     (prefix && STRPREFIX(ifname, prefix)))) {
-                    /* An auto-generated target name, blank it out */
-                    VIR_FREE(ifname);
+            } else if (virXMLNodeNameEqual(cur, "target")) {
+                if (!ifname) {
+                    ifname = virXMLPropString(cur, "dev");
+                    if (ifname &&
+                        (flags & VIR_DOMAIN_DEF_PARSE_INACTIVE) &&
+                        (STRPREFIX(ifname, VIR_NET_GENERATED_TAP_PREFIX) ||
+                         (prefix && STRPREFIX(ifname, prefix)))) {
+                        /* An auto-generated target name, blank it out */
+                        VIR_FREE(ifname);
+                    }
                 }
             } else if ((!ifname_guest || !ifname_guest_actual) &&
                        virXMLNodeNameEqual(cur, "guest")) {
-- 
2.16.1

--
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