summaryrefslogtreecommitdiff
path: root/tools/vgcfgrestore.c
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2018-07-10 13:39:29 -0500
committerDavid Teigland <teigland@redhat.com>2018-07-11 11:26:42 -0500
commit117160b27e510dceb1ed6acf995115c040acd88d (patch)
treeae459f189f4202cb78ef3c9f8196a559b2398801 /tools/vgcfgrestore.c
parentedf3f86184a380994e383b9884364e702e4ac647 (diff)
downloadlvm2-117160b27e510dceb1ed6acf995115c040acd88d.tar.gz
Remove lvmetad
Native disk scanning is now both reduced and async/parallel, which makes it comparable in performance (and often faster) when compared to lvm using lvmetad. Autoactivation now uses local temp files to record online PVs, and no longer requires lvmetad. There should be no apparent command-level change in behavior.
Diffstat (limited to 'tools/vgcfgrestore.c')
-rw-r--r--tools/vgcfgrestore.c35
1 files changed, 1 insertions, 34 deletions
diff --git a/tools/vgcfgrestore.c b/tools/vgcfgrestore.c
index 0dd7d4d77..84032f133 100644
--- a/tools/vgcfgrestore.c
+++ b/tools/vgcfgrestore.c
@@ -14,7 +14,6 @@
*/
#include "tools.h"
-#include "daemons/lvmetad/lvmetad-client.h"
#include "device_mapper/all.h"
#include "device_mapper/misc/dm-ioctl.h"
@@ -77,7 +76,6 @@ out:
int vgcfgrestore(struct cmd_context *cmd, int argc, char **argv)
{
const char *vg_name = NULL;
- int lvmetad_rescan = 0;
unsigned found = 0;
int ret;
@@ -121,22 +119,6 @@ int vgcfgrestore(struct cmd_context *cmd, int argc, char **argv)
}
}
- /*
- * lvmetad does not handle a VG being restored, which would require
- * vg_remove of the existing VG, then vg_update of the restored VG. A
- * command failure after removing the existing VG from lvmetad would
- * not be easily recovered from. So, disable the lvmetad cache before
- * doing the restore. After the VG is restored on disk, rescan
- * metadata from disk to populate lvmetad from scratch which will pick
- * up the VG that was restored on disk.
- */
-
- if (lvmetad_used()) {
- lvmetad_set_disabled(cmd, LVMETAD_DISABLE_REASON_VGRESTORE);
- lvmetad_disconnect();
- lvmetad_rescan = 1;
- }
-
if (!lock_vol(cmd, VG_ORPHANS, LCK_VG_WRITE, NULL)) {
log_error("Unable to lock orphans.");
return ECMD_FAILED;
@@ -161,7 +143,7 @@ int vgcfgrestore(struct cmd_context *cmd, int argc, char **argv)
unlock_vg(cmd, NULL, VG_ORPHANS);
log_error("Restore failed.");
ret = ECMD_FAILED;
- goto rescan;
+ goto out;
}
ret = ECMD_PROCESSED;
@@ -169,21 +151,6 @@ int vgcfgrestore(struct cmd_context *cmd, int argc, char **argv)
unlock_vg(cmd, NULL, VG_ORPHANS);
unlock_vg(cmd, NULL, vg_name);
-rescan:
- if (lvmetad_rescan) {
- if (!lvmetad_connect(cmd)) {
- log_warn("WARNING: Failed to connect to lvmetad.");
- log_warn("WARNING: Update lvmetad with pvscan --cache.");
- goto out;
- }
- if (!refresh_filters(cmd))
- stack;
- if (!lvmetad_pvscan_all_devs(cmd, 1)) {
- log_warn("WARNING: Failed to scan devices.");
- log_warn("WARNING: Update lvmetad with pvscan --cache.");
- goto out;
- }
- }
out:
return ret;
}