[PATCH 4/5] network: implement virNetworkDefineXMLFlags for test_driver

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

 



    Just add an entry to the function table, rename the original
    virNetworkDefineXML to virNetworkDefineXMLFlags (with a check for
    flags == 0), and add a one line replacement for virNetworkDefineXML.
---
 src/test/test_driver.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index a767e21..e0da9fe 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -3105,12 +3105,17 @@ cleanup:
     return ret;
 }
 
-static virNetworkPtr testNetworkDefine(virConnectPtr conn, const char *xml) {
+static
+virNetworkPtr testNetworkDefineXMLFlags(virConnectPtr conn, const char *xml,
+                                        unsigned int flags)
+{
     testConnPtr privconn = conn->privateData;
     virNetworkDefPtr def;
     virNetworkObjPtr net = NULL;
     virNetworkPtr ret = NULL;
 
+    virCheckFlags(0, NULL);
+
     testDriverLock(privconn);
     if ((def = virNetworkDefParseString(xml)) == NULL)
         goto cleanup;
@@ -3130,6 +3135,12 @@ cleanup:
     return ret;
 }
 
+static
+virNetworkPtr testNetworkDefine(virConnectPtr conn, const char *xml)
+{
+    return testNetworkDefineXMLFlags(conn, xml, 0);
+}
+
 static int testNetworkUndefine(virNetworkPtr network) {
     testConnPtr privconn = network->conn->privateData;
     virNetworkObjPtr privnet;
@@ -5616,6 +5627,7 @@ static virNetworkDriver testNetworkDriver = {
     .networkLookupByUUID = testLookupNetworkByUUID, /* 0.3.2 */
     .networkLookupByName = testLookupNetworkByName, /* 0.3.2 */
     .networkCreateXML = testNetworkCreate, /* 0.3.2 */
+    .networkDefineXMLFlags = testNetworkDefineXMLFlags, /* 0.10.0 */
     .networkDefineXML = testNetworkDefine, /* 0.3.2 */
     .networkUndefine = testNetworkUndefine, /* 0.3.2 */
     .networkCreate = testNetworkStart, /* 0.3.2 */
-- 
1.7.11.4

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