summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAlasdair Kergon <agk@redhat.com>2005-10-17 17:56:27 +0000
committerAlasdair Kergon <agk@redhat.com>2005-10-17 17:56:27 +0000
commita653923fe70a81a0a78a0d4cb6d2d18144fc57e6 (patch)
tree6ca926ecd83de47e63d3874e6144a6e0c32f3627 /tools
parent191abde97efc6c0a262b2d69ccfccdd53d1b26a6 (diff)
downloadlvm2-a653923fe70a81a0a78a0d4cb6d2d18144fc57e6.tar.gz
lvm2-a653923fe70a81a0a78a0d4cb6d2d18144fc57e6.tar.xz
lvm2-a653923fe70a81a0a78a0d4cb6d2d18144fc57e6.zip
Attempt to load missing targets using modprobe.
Diffstat (limited to 'tools')
-rw-r--r--tools/polldaemon.c7
-rw-r--r--tools/toollib.c44
-rw-r--r--tools/toollib.h3
-rw-r--r--tools/tools.h1
4 files changed, 2 insertions, 53 deletions
diff --git a/tools/polldaemon.c b/tools/polldaemon.c
index 39c43a16..34cc90cb 100644
--- a/tools/polldaemon.c
+++ b/tools/polldaemon.c
@@ -72,8 +72,6 @@ static int _check_mirror_status(struct cmd_context *cmd,
float segment_percent = 0.0, overall_percent = 0.0;
uint32_t event_nr = 0;
-void *x;
-
/* By default, caller should not retry */
*finished = 1;
@@ -87,7 +85,7 @@ void *x;
return 0;
}
- if (!lv_mirror_percent(lv_mirr, !parms->interval, &segment_percent,
+ if (!lv_mirror_percent(cmd, lv_mirr, !parms->interval, &segment_percent,
&event_nr)) {
log_error("ABORTING: Mirror percentage check failed.");
return 0;
@@ -99,9 +97,6 @@ void *x;
else
log_verbose("%s: Moved: %.1f%%", name, overall_percent);
-x = dm_pool_alloc(cmd->mem, 1);
-dm_pool_free(cmd->mem, x);
-
if (segment_percent < 100.0) {
/* The only case the caller *should* try again later */
*finished = 0;
diff --git a/tools/toollib.c b/tools/toollib.c
index c07a42bb..aa15cd43 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -969,50 +969,6 @@ struct volume_group *recover_vg(struct cmd_context *cmd, const char *vgname,
return vg_read(cmd, vgname, &consistent);
}
-/*
- * Execute and wait for external command
- */
-int exec_cmd(const char *command, const char *fscmd, const char *lv_path,
- const char *size)
-{
- pid_t pid;
- int status;
-
- log_verbose("Executing: %s %s %s %s", command, fscmd, lv_path, size);
-
- if ((pid = fork()) == -1) {
- log_error("fork failed: %s", strerror(errno));
- return 0;
- }
-
- if (!pid) {
- /* Child */
- /* FIXME Use execve directly */
- execlp(command, command, fscmd, lv_path, size, NULL);
- log_sys_error("execlp", command);
- exit(errno);
- }
-
- /* Parent */
- if (wait4(pid, &status, 0, NULL) != pid) {
- log_error("wait4 child process %u failed: %s", pid,
- strerror(errno));
- return 0;
- }
-
- if (!WIFEXITED(status)) {
- log_error("Child %u exited abnormally", pid);
- return 0;
- }
-
- if (WEXITSTATUS(status)) {
- log_error("%s failed: %u", command, WEXITSTATUS(status));
- return 0;
- }
-
- return 1;
-}
-
int apply_lvname_restrictions(const char *name)
{
if (!strncmp(name, "snapshot", 8)) {
diff --git a/tools/toollib.h b/tools/toollib.h
index 00b69bd1..9e8b3f33 100644
--- a/tools/toollib.h
+++ b/tools/toollib.h
@@ -86,9 +86,6 @@ struct list *create_pv_list(struct dm_pool *mem, struct volume_group *vg, int ar
struct list *clone_pv_list(struct dm_pool *mem, struct list *pvs);
-int exec_cmd(const char *command, const char *fscmd, const char *lv_path,
- const char *size);
-
int apply_lvname_restrictions(const char *name);
int validate_vg_name(struct cmd_context *cmd, const char *vg_name);
diff --git a/tools/tools.h b/tools/tools.h
index a074bb12..4d143af7 100644
--- a/tools/tools.h
+++ b/tools/tools.h
@@ -41,6 +41,7 @@
#include "metadata.h"
#include "list.h"
#include "locking.h"
+#include "lvm-exec.h"
#include "lvm-file.h"
#include "lvm-string.h"
#include "segtype.h"