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

[libvirt] [PATCH] Add dummy nwfilter driver to test driver



This patch adds a dummy nwfilter driver to the test driver so that the
int-overflow test passes without modifications.

Signed-off-by: Stefan Berger <Stefanb us ibm com>

Index: libvirt/src/test/test_driver.c
===================================================================
--- libvirt.orig/src/test/test_driver.c
+++ libvirt/src/test/test_driver.c
@@ -5205,6 +5205,22 @@ static int testSecretClose(virConnectPtr
     return 0;
 }
 
+
+static virDrvOpenStatus testNWFilterOpen(virConnectPtr conn,
+                                         virConnectAuthPtr auth ATTRIBUTE_UNUSED,
+                                         int flags ATTRIBUTE_UNUSED) {
+    if (STRNEQ(conn->driver->name, "Test"))
+        return VIR_DRV_OPEN_DECLINED;
+
+    conn->secretPrivateData = conn->privateData;
+    return VIR_DRV_OPEN_SUCCESS;
+}
+
+static int testNWFilterClose(virConnectPtr conn) {
+    conn->nwfilterPrivateData = NULL;
+    return 0;
+}
+
 static virDriver testDriver = {
     VIR_DRV_TEST,
     "Test",
@@ -5398,6 +5414,12 @@ static virSecretDriver testSecretDriver 
 };
 
 
+static virNWFilterDriver testNWFilterDriver = {
+    .name = "Test",
+    .open = testNWFilterOpen,
+    .close = testNWFilterClose,
+};
+
 /**
  * testRegister:
  *
@@ -5418,6 +5440,8 @@ testRegister(void)
         return -1;
     if (virRegisterSecretDriver(&testSecretDriver) < 0)
         return -1;
+    if (virRegisterNWFilterDriver(&testNWFilterDriver) < 0)
+        return -1;
 
     return 0;
 }


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