On 2012年08月20日 14:17, Laine Stump wrote:
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
that calls virNetworkDefineXMLFlags.
---
src/network/bridge_driver.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index bff2d30..e2b569f 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -2339,7 +2339,10 @@ cleanup:
return ret;
}
-static virNetworkPtr networkDefine(virConnectPtr conn, const char *xml) {
+static
+virNetworkPtr networkDefineXMLFlags(virConnectPtr conn, const char *xml,
+ unsigned int flags)
+{
struct network_driver *driver = conn->networkPrivateData;
virNetworkIpDefPtr ipdef, ipv4def = NULL;
virNetworkDefPtr def;
@@ -2349,6 +2352,8 @@ static virNetworkPtr networkDefine(virConnectPtr conn, const char
*xml) {
int ii;
dnsmasqContext* dctx = NULL;
+ virCheckFlags(0, NULL);
+
networkDriverLock(driver);
if (!(def = virNetworkDefParseString(xml)))
@@ -2426,6 +2431,12 @@ cleanup:
return ret;
}
+static
+virNetworkPtr networkDefine(virConnectPtr conn, const char *xml)
+{
+ return networkDefineXMLFlags(conn, xml, 0);
+}
+
static int networkUndefine(virNetworkPtr net) {
struct network_driver *driver = net->conn->networkPrivateData;
virNetworkObjPtr network;
@@ -2739,6 +2750,7 @@ static virNetworkDriver networkDriver = {
.networkLookupByUUID = networkLookupByUUID, /* 0.2.0 */
.networkLookupByName = networkLookupByName, /* 0.2.0 */
.networkCreateXML = networkCreate, /* 0.2.0 */
+ .networkDefineXMLFlags = networkDefineXMLFlags, /* 0.10.0 */
.networkDefineXML = networkDefine, /* 0.2.0 */
.networkUndefine = networkUndefine, /* 0.2.0 */
.networkCreate = networkStart, /* 0.2.0 */
ACK