summaryrefslogtreecommitdiff
path: root/lib/device/dev-cache.c
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2016-03-04 16:30:04 -0600
committerDavid Teigland <teigland@redhat.com>2016-03-07 12:06:26 -0600
commit77d4d75d1699cfd30cfbf2fdb9f69ec705c1ecfb (patch)
treeca526692d6a70f04576bfc355d9f1b9c140fc919 /lib/device/dev-cache.c
parentc8b7ecc78dad71e1770a25d11533c1f726c575bc (diff)
downloadlvm2-dev-dct-lvm-using-dev-4.tar.gz
pvs: warn if no PV is found for a device lvm is usingdev-dct-lvm-using-dev-4
After 'pvs' reports all PVs, if there are devices that were not reported which lvm is currently using for LVs then print a warning.
Diffstat (limited to 'lib/device/dev-cache.c')
-rw-r--r--lib/device/dev-cache.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/device/dev-cache.c b/lib/device/dev-cache.c
index 47ae1403e..6355bf5ec 100644
--- a/lib/device/dev-cache.c
+++ b/lib/device/dev-cache.c
@@ -17,6 +17,7 @@
#include "btree.h"
#include "config.h"
#include "toolcontext.h"
+#include "activate.h"
#ifdef UDEV_SYNC_SUPPORT
#include <libudev.h>
@@ -409,6 +410,8 @@ static int _insert_dev(const char *path, dev_t d)
return 0;
}
+ dev->lvm_using = lvs_using_device(dev);
+
return 1;
}
@@ -1110,3 +1113,4 @@ const char *dev_name(const struct device *dev)
return (dev && dev->aliases.n) ? dm_list_item(dev->aliases.n, struct dm_str_list)->str :
unknown_device_name();
}
+