We need to validate the XML against schema if option 'validate'
was passed to the 'iface-define' virsh command. For that we need
to allow validation flag and propagate flags to parse function.
Signed-off-by: Kristina Hanicova <khanicov(a)redhat.com>
---
src/interface/interface_backend_netcf.c | 4 ++--
src/test/test_driver.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/interface/interface_backend_netcf.c
b/src/interface/interface_backend_netcf.c
index 9f93cdd657..78fd4f9bc7 100644
--- a/src/interface/interface_backend_netcf.c
+++ b/src/interface/interface_backend_netcf.c
@@ -894,11 +894,11 @@ static virInterfacePtr netcfInterfaceDefineXML(virConnectPtr conn,
virInterfaceDef *ifacedef = NULL;
virInterfacePtr ret = NULL;
- virCheckFlags(0, NULL);
+ virCheckFlags(VIR_INTERFACE_DEFINE_VALIDATE, NULL);
virObjectLock(driver);
- ifacedef = virInterfaceDefParseString(xml, 0);
+ ifacedef = virInterfaceDefParseString(xml, flags);
if (!ifacedef) {
/* error was already reported */
goto cleanup;
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index 450510ee54..67db02b25d 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -6156,10 +6156,10 @@ testInterfaceDefineXML(virConnectPtr conn,
virInterfaceDef *objdef;
virInterfacePtr ret = NULL;
- virCheckFlags(0, NULL);
+ virCheckFlags(VIR_INTERFACE_DEFINE_VALIDATE, NULL);
virObjectLock(privconn);
- if ((def = virInterfaceDefParseString(xmlStr, 0)) == NULL)
+ if ((def = virInterfaceDefParseString(xmlStr, flags)) == NULL)
goto cleanup;
if ((obj = virInterfaceObjListAssignDef(privconn->ifaces, def)) == NULL)
--
2.31.1