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

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

 



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