[PATCH 26/37] virDomainNetDefParseXML: Refactor parsing of data for VIR_DOMAIN_NET_TYPE_VDPA

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

 



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

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index b41e1644a5..c14f3f2910 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -9188,9 +9188,11 @@ virDomainNetDefParseXML(virDomainXMLOption *xmlopt,
         break;

     case VIR_DOMAIN_NET_TYPE_VDPA:
-        if (source_node) {
-            dev = virXMLPropString(source_node, "dev");
-        }
+        if (virDomainNetDefParseXMLRequireSource(def, source_node) < 0)
+            return NULL;
+
+        if (!(def->data.vdpa.devicepath = virXMLPropStringRequired(source_node, "dev")))
+            return NULL;
         break;

     case VIR_DOMAIN_NET_TYPE_CLIENT:
@@ -9331,15 +9333,6 @@ virDomainNetDefParseXML(virDomainXMLOption *xmlopt,
         break;

     case VIR_DOMAIN_NET_TYPE_VDPA:
-        if (dev == NULL) {
-            virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                           _("No <source> 'dev' attribute "
-                             "specified with <interface type='vdpa'/>"));
-            return NULL;
-        }
-        def->data.vdpa.devicepath = g_steal_pointer(&dev);
-        break;
-
     case VIR_DOMAIN_NET_TYPE_BRIDGE:
         break;

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