2
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
3
* Copyright (C) 2004 Red Hat, Inc. All rights reserved.
5
* This file is part of LVM2.
7
* This copyrighted material is made available to anyone wishing to use,
8
* modify, copy, or redistribute it subject to the terms and conditions
9
* of the GNU General Public License v.2.
11
* You should have received a copy of the GNU General Public License
12
* along with this program; if not, write to the Free Software Foundation,
13
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
#include "dbg_malloc.h"
17
#include "dev-cache.h"
22
int main(int argc, char **argv)
26
struct dev_iter *iter;
27
struct list_head *tmp;
31
fprintf(stderr, "usage: %s <dir>\n", argv[0]);
36
init_debug(_LOG_INFO);
38
if (!dev_cache_init()) {
39
log_err("couldn't initialise dev_cache_init failed");
43
for (i = 1; i < argc; i++) {
44
if (!dev_cache_add_dir(argv[i])) {
45
log_err("couldn't add '%s' to dev_cache", argv[i]);
50
if (!(iter = dev_iter_create(NULL))) {
51
log_err("couldn't create iterator");
55
while ((dev = dev_iter_get(iter))) {
56
printf("%s", dev->name);
58
list_for_each(tmp, &dev->aliases) {
59
sl = list_entry(tmp, struct str_list, list);
60
printf(", %s", sl->str);
65
dev_iter_destroy(iter);