Re: [PATCH 05/37] virDomainNetDefParseXML: Separate and localize parsing of 'backend/@vhost'

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

 



On a Monday in 2022, Peter Krempa wrote:
Move it into an independent block and move temporary variables locally.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
src/conf/domain_conf.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)

@@ -9484,7 +9479,14 @@ virDomainNetDefParseXML(virDomainXMLOption *xmlopt,
                                         &def->driver.virtio.guest.ufo) < 0)
                return NULL;
        }
-        def->backend.vhost = g_steal_pointer(&vhost_path);
+    }
+
+    if (def->type != VIR_DOMAIN_NET_TYPE_HOSTDEV &&
+        virDomainNetIsVirtioModel(def)) {
+        g_autofree  char *vhost = virXPathString("string(./backend/@vhost)", ctxt);
+

Double space -------^

+        if (vhost)
+            def->backend.vhost = virFileSanitizePath(vhost);
    }

    def->linkstate = VIR_DOMAIN_NET_INTERFACE_LINK_STATE_DEFAULT;
--
2.37.1





[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