summaryrefslogtreecommitdiffstats
path: root/old-tests/format1
diff options
context:
space:
mode:
authorJoe Thornber <thornber@redhat.com>2001-10-08 08:47:27 +0000
committerJoe Thornber <thornber@redhat.com>2001-10-08 08:47:27 +0000
commitd81ec60d191c483890edd38179240c32383f5ac6 (patch)
tree48ba44baf662422b72b94c98f3375a75aa76c53d /old-tests/format1
parent25d42d50a84a960d71e506cc6eff5151f272abca (diff)
downloadlvm2-d81ec60d191c483890edd38179240c32383f5ac6.tar.gz
lvm2-d81ec60d191c483890edd38179240c32383f5ac6.tar.xz
lvm2-d81ec60d191c483890edd38179240c32383f5ac6.zip
o test program for reading a vg
Diffstat (limited to 'old-tests/format1')
-rw-r--r--old-tests/format1/read_vg_t.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/old-tests/format1/read_vg_t.c b/old-tests/format1/read_vg_t.c
new file mode 100644
index 00000000..cbe89c8a
--- /dev/null
+++ b/old-tests/format1/read_vg_t.c
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2001 Sistina Software (UK) Limited.
+ *
+ * This file is released under the GPL.
+ */
+
+#include "log.h"
+#include "format1.h"
+#include <stdio.h>
+
+int main(int argc, char **argv)
+{
+ struct io_space *ios;
+ struct volume_group *vg;
+
+ if (argc != 2) {
+ fprintf(stderr, "usage: read_vg_t <vg_name>\n");
+ exit(1);
+ }
+
+ init_log(stderr);
+ init_debug(_LOG_DEBUG);
+
+ if (!dev_cache_init()) {
+ fprintf(stderr, "init of dev-cache failed\n");
+ exit(1);
+ }
+
+ if (!dev_cache_add_dir("/dev")) {
+ fprintf(stderr, "couldn't add /dev to dir-cache\n");
+ exit(1);
+ }
+
+ ios = create_lvm_v1_format(NULL);
+ vg = ios->vg_read(ios, argv[1]);
+
+ if (!vg) {
+ fprintf(stderr, "couldn't read vg %s\n", argv[1]);
+ exit(1);
+ }
+
+ ios->destroy(ios);
+
+ dump_memory();
+ fin_log();
+ return 0;
+}