]> xenbits.xensource.com Git - libvirt.git/commitdiff
storage: sheepdog: Split out functions required for tests
authorPeter Krempa <pkrempa@redhat.com>
Mon, 16 Jan 2017 12:41:18 +0000 (13:41 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 19 Jan 2017 08:25:51 +0000 (09:25 +0100)
Separate the headers so that functions only required for testing of the
sheepdog backend are separated into their own file.

src/Makefile.am
src/storage/storage_backend_sheepdog.c
src/storage/storage_backend_sheepdog.h
src/storage/storage_backend_sheepdog_priv.h [new file with mode: 0644]
tests/storagebackendsheepdogtest.c

index 348bd2a30699c48626c0684e90f718ab774f5601..dc26ddf53c4e9db366286bbb06a7ee87bbd4825a 100644 (file)
@@ -998,7 +998,8 @@ STORAGE_DRIVER_RBD_SOURCES =                                        \
                storage/storage_backend_rbd.h storage/storage_backend_rbd.c
 
 STORAGE_DRIVER_SHEEPDOG_SOURCES =                              \
-               storage/storage_backend_sheepdog.h storage/storage_backend_sheepdog.c
+               storage/storage_backend_sheepdog.h storage/storage_backend_sheepdog.c \
+               storage/storage_backend_sheepdog_priv.h
 
 STORAGE_DRIVER_GLUSTER_SOURCES =                               \
                storage/storage_backend_gluster.h storage/storage_backend_gluster.c
index 17202e4877e9f71a6f347d8250f273fcb9184313..36458a562cc5c1cf9b717fc2fc59bccc594f4b3b 100644 (file)
@@ -29,6 +29,7 @@
 
 #include "virerror.h"
 #include "storage_backend_sheepdog.h"
+#include "storage_backend_sheepdog_priv.h"
 #include "storage_conf.h"
 #include "vircommand.h"
 #include "viralloc.h"
index b0d8440b3ab631f6759ff468fbd13d7a89a5b57b..df2ead5ed4d2d009f830db60601a4ca70c241379 100644 (file)
 
 # include "storage_backend.h"
 
-int virStorageBackendSheepdogParseNodeInfo(virStoragePoolDefPtr pool,
-                                           char *output);
-int virStorageBackendSheepdogParseVdiList(virStorageVolDefPtr vol,
-                                          char *output);
-
 extern virStorageBackend virStorageBackendSheepdog;
 
 #endif /* __VIR_STORAGE_BACKEND_SHEEPDOG_H__ */
diff --git a/src/storage/storage_backend_sheepdog_priv.h b/src/storage/storage_backend_sheepdog_priv.h
new file mode 100644 (file)
index 0000000..e324ef6
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * storage_backend_sheepdog_priv.h: header for functions necessary in tests
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __VIR_STORAGE_BACKEND_SHEEPDOG_PRIV_H__
+# define __VIR_STORAGE_BACKEND_SHEEPDOG_PRIV_H__
+
+# include "conf/storage_conf.h"
+
+int virStorageBackendSheepdogParseNodeInfo(virStoragePoolDefPtr pool,
+                                           char *output);
+int virStorageBackendSheepdogParseVdiList(virStorageVolDefPtr vol,
+                                          char *output);
+
+#endif /* __VIR_STORAGE_BACKEND_SHEEPDOG_PRIV_H__ */
index fd258a80006a49a2c4aff263f8e5ad1f6b549a6f..1f6341f8adf2d7f87d24f25980fd3fa3f33dbef3 100644 (file)
@@ -32,7 +32,7 @@
 
 #include "internal.h"
 #include "testutils.h"
-#include "storage/storage_backend_sheepdog.h"
+#include "storage/storage_backend_sheepdog_priv.h"
 #include "virstring.h"
 
 #define VIR_FROM_THIS VIR_FROM_NONE