Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
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