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

[libvirt] [PATCH] Register storage backends in test driver



The refactored storage backend registering broke the test driver. The
attached patch makes everything work again by explicitly registering the
backends on driver startup.

Thanks,
Cole
diff --git a/src/test.c b/src/test.c
index 30dc52a..a785f04 100644
--- a/src/test.c
+++ b/src/test.c
@@ -43,6 +43,11 @@
 #include "network_conf.h"
 #include "domain_conf.h"
 #include "storage_conf.h"
+#include "storage_backend.h"
+#include "storage_backend_logical.h"
+#include "storage_backend_iscsi.h"
+#include "storage_backend_disk.h"
+#include "storage_backend_fs.h"
 #include "xml.h"
 
 #define MAX_CPUS 128
@@ -663,6 +668,17 @@ static int testOpen(virConnectPtr conn,
         return VIR_DRV_OPEN_ERROR;
     }
 
+    if (virStorageBackendRegister(&virStorageBackendDirectory) < 0 ||
+        virStorageBackendRegister(&virStorageBackendFileSystem) < 0 ||
+        virStorageBackendRegister(&virStorageBackendNetFileSystem) < 0 ||
+        virStorageBackendRegister(&virStorageBackendLogical) < 0 ||
+        virStorageBackendRegister(&virStorageBackendISCSI) < 0 ||
+        virStorageBackendRegister(&virStorageBackendDisk) < 0) {
+        testError(NULL, VIR_ERR_INTERNAL_ERROR,
+                  _("Failed to register storage backends."));
+        return VIR_DRV_OPEN_DECLINED;
+    }
+
     if (STREQ(uri->path, "/default"))
         ret = testOpenDefault(conn);
     else

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