1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-02 01:18:26 +03:00

Revert last clvmd patch. More testing reveals that this just doesn't

work yet.
This commit is contained in:
Patrick Caulfield 2005-02-07 14:45:38 +00:00
parent 2cf7b80d8f
commit 5937664052
6 changed files with 25 additions and 43 deletions

View File

@ -37,7 +37,7 @@ endif
include make.tmpl include make.tmpl
daemons: lib tools daemons: lib
lib: include lib: include
tools: lib tools: lib
po: tools daemons po: tools daemons

View File

@ -4,7 +4,6 @@ Version 2.01.04 -
Remove unused -f from pvmove. Remove unused -f from pvmove.
Gulm clvmd doesn't report "connection refused" errors. Gulm clvmd doesn't report "connection refused" errors.
clvmd does a basic config file sanity check at startup. clvmd does a basic config file sanity check at startup.
clvmd now uses liblvm2cmd to preload the lock state rather than popen
Version 2.01.03 - 1st February 2005 Version 2.01.03 - 1st February 2005
=================================== ===================================

3
configure vendored
View File

@ -7413,8 +7413,7 @@ fi;
echo "$as_me:$LINENO: result: $CMDLIB" >&5 echo "$as_me:$LINENO: result: $CMDLIB" >&5
echo "${ECHO_T}$CMDLIB" >&6 echo "${ECHO_T}$CMDLIB" >&6
if test x$CMDLIB = xyes -o x$CLVMD != none; then if test x$CMDLIB = xyes; then
CMDLIB="yes"
CFLAGS="$CFLAGS -DCMDLIB" CFLAGS="$CFLAGS -DCMDLIB"
fi fi

View File

@ -344,8 +344,7 @@ AC_ARG_ENABLE(cmdlib, [ --enable-cmdlib Build shared command library],
CMDLIB=$enableval, CMDLIB=no) CMDLIB=$enableval, CMDLIB=no)
AC_MSG_RESULT($CMDLIB) AC_MSG_RESULT($CMDLIB)
if test x$CMDLIB = xyes -o x$CLVMD != none; then if test x$CMDLIB = xyes; then
CMDLIB="yes"
CFLAGS="$CFLAGS -DCMDLIB" CFLAGS="$CFLAGS -DCMDLIB"
fi fi

View File

@ -52,7 +52,7 @@ TARGETS = \
include $(top_srcdir)/make.tmpl include $(top_srcdir)/make.tmpl
CFLAGS += -D_REENTRANT -fno-strict-aliasing CFLAGS += -D_REENTRANT -fno-strict-aliasing
LIBS += -L../../tools -ldevmapper -llvm -Wl,-Bstatic -llvm2cmd -Wl,-Bdynamic -lpthread LIBS += -ldevmapper -llvm -lpthread
INSTALL_TARGETS = \ INSTALL_TARGETS = \
install_clvmd install_clvmd

View File

@ -43,7 +43,6 @@
#include "activate.h" #include "activate.h"
#include "hash.h" #include "hash.h"
#include "locking.h" #include "locking.h"
#include "../tools/lvm2cmd.h"
static struct cmd_context *cmd = NULL; static struct cmd_context *cmd = NULL;
static struct hash_table *lv_hash = NULL; static struct hash_table *lv_hash = NULL;
@ -389,19 +388,29 @@ int do_check_lvm1(char *vgname)
return status == 1 ? 0 : EBUSY; return status == 1 ? 0 : EBUSY;
} }
static void cmdline_output(int level, const char *file, int line, /*
const char *message) * Ideally, clvmd should be started before any LVs are active
* but this may not be the case...
* I suppose this also comes in handy if clvmd crashes, not that it would!
*/
static void *get_initial_state()
{ {
DEBUGLOG("lvm2output: %d: %s\n", level, message); char lv[64], vg[64], flags[25];
if (level == LVM2_LOG_PRINT) char uuid[65];
{ char line[255];
char lv[64], vg[64], flags[25]; FILE *lvs =
char uuid[65]; popen
("lvm lvs --nolocking --noheadings -o vg_uuid,lv_uuid,lv_attr",
"r");
if (sscanf(message, "%s %s %s\n", vg, lv, flags) == 3) { if (!lvs)
return NULL;
while (fgets(line, sizeof(line), lvs)) {
if (sscanf(line, "%s %s %s\n", vg, lv, flags) == 3) {
/* States: s:suspended a:active S:dropped snapshot I:invalid snapshot */ /* States: s:suspended a:active S:dropped snapshot I:invalid snapshot */
if (strlen(vg) == 38 && /* is is a valid UUID ? */ if (strlen(vg) == 38 && /* is is a valid UUID ? */
(flags[4] == 'a' || flags[4] == 's')) { /* is it active or suspended? */ (flags[4] == 'a' || flags[4] == 's')) { /* is it active or suspended? */
/* Convert hyphen-separated UUIDs into one */ /* Convert hyphen-separated UUIDs into one */
memcpy(&uuid[0], &vg[0], 6); memcpy(&uuid[0], &vg[0], 6);
@ -425,32 +434,8 @@ static void cmdline_output(int level, const char *file, int line,
} }
} }
} }
} fclose(lvs);
return NULL;
/*
* Ideally, clvmd should be started before any LVs are active
* but this may not be the case...
* I suppose this also comes in handy if clvmd crashes, not that it would!
*/
static void get_initial_state()
{
void *lvm2_handle;
lvm2_handle = lvm2_init();
if (!lvm2_handle) {
syslog(LOG_ERR, "Cannot get lvm2 context to initialise lock state\n");
return;
}
lvm2_log_fn(cmdline_output);
/* This doesn't seem to do what I think it does */
lvm2_log_level(lvm2_handle, LVM2_LOG_PRINT);
DEBUGLOG("Getting currently active LVs for lock state\n");
lvm2_run(lvm2_handle, "lvs --nolocking --noheadings -o vg_uuid,lv_uuid,lv_attr");
lvm2_exit(lvm2_handle);
} }
/* This checks some basic cluster-LVM configuration stuff */ /* This checks some basic cluster-LVM configuration stuff */