[Cluster-devel] Cluster Project branch, master, updated. cluster-2.99.03-4-g34925e9

2008-06-03 Thread fabbione
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project Cluster Project.

http://sources.redhat.com/git/gitweb.cgi?p=cluster.git;a=commitdiff;h=34925e9ae54cddda311a682c9131d2d6b84dca7c

The branch, master has been updated
   via  34925e9ae54cddda311a682c9131d2d6b84dca7c (commit)
  from  e879971090c6821bb966f17875874d11aa740a5c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit 34925e9ae54cddda311a682c9131d2d6b84dca7c
Author: Fabio M. Di Nitto [EMAIL PROTECTED]
Date:   Tue Jun 3 10:45:45 2008 +0200

[CONFIG] Add full xpath support to libccs

Signed-off-by: Fabio M. Di Nitto [EMAIL PROTECTED]

---

Summary of changes:
 config/libs/libccsconfdb/Makefile |3 +-
 config/libs/libccsconfdb/ccs.h|2 +
 config/libs/libccsconfdb/libccs.c |  287 ++---
 3 files changed, 271 insertions(+), 21 deletions(-)

diff --git a/config/libs/libccsconfdb/Makefile 
b/config/libs/libccsconfdb/Makefile
index c9b6d94..92c3b78 100644
--- a/config/libs/libccsconfdb/Makefile
+++ b/config/libs/libccsconfdb/Makefile
@@ -37,10 +37,11 @@ OBJS=   $(TARGET).o
 
 CFLAGS += -fPIC
 CFLAGS += -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64
-CFLAGS += -I${openaisincdir}
+CFLAGS += -I${openaisincdir} `xml2-config --cflags`
 CFLAGS += -I${incdir}
 
 LDFLAGS += -L${openaislibdir} -lconfdb
+LDFLAGS += `xml2-config --libs`
 
 $(TARGET).a: $(OBJS)
${AR} r $@ $^
diff --git a/config/libs/libccsconfdb/ccs.h b/config/libs/libccsconfdb/ccs.h
index 91e63cd..eca9c4d 100644
--- a/config/libs/libccsconfdb/ccs.h
+++ b/config/libs/libccsconfdb/ccs.h
@@ -24,4 +24,6 @@ int ccs_get_list(int desc, const char *query, char **rtn);
 int ccs_set(int desc, const char *path, char *val);
 int ccs_lookup_nodename(int desc, const char *nodename, char **rtn);
 
+extern int fullxpath;
+
 #endif /*  __CCS_DOT_H__ */
diff --git a/config/libs/libccsconfdb/libccs.c 
b/config/libs/libccsconfdb/libccs.c
index ab82b9d..3d75710 100644
--- a/config/libs/libccsconfdb/libccs.c
+++ b/config/libs/libccsconfdb/libccs.c
@@ -24,10 +24,12 @@
 #include limits.h
 #include openais/saAis.h
 #include openais/confdb.h
+#include libxml/parser.h
+#include libxml/xpath.h
 
 #include ccs.h
 
-/* Callbacks are not supported */
+/* Callbacks are not supported - we will use them to update fullxml doc/ctx */
 static confdb_callbacks_t callbacks = {
.confdb_change_notify_fn = NULL,
 };
@@ -39,40 +41,171 @@ static char previous_query[PATH_MAX];
 static unsigned int query_handle;
 static unsigned int list_handle;
 
+int fullxpath = 0;
+static int fullxpathint;
+
+static char *buffer = NULL;
+static xmlDocPtr doc = NULL;
+static xmlXPathContextPtr ctx = NULL;
+static int xmllistindex = 0;
+
+static void xpathlite_init() {
+   memset(current_query, 0, PATH_MAX);
+   memset(previous_query, 0, PATH_MAX);
+   query_handle = OBJECT_PARENT_HANDLE;
+   list_handle = OBJECT_PARENT_HANDLE;
+}
+
+static void add_to_buffer(char *data, char **buffer, int *size)
+{
+   int len;
+
+   if((len = strlen(data))) {
+   *size = *size + len;
+   if (*buffer)
+   strncpy(*buffer + strlen(*buffer), data, len);
+   }
+   return;
+}
+
+static int dump_objdb_buff(confdb_handle_t dump_handle, unsigned int 
parent_object_handle, char **buffer, int *size)
+{
+   unsigned int object_handle;
+   char temp[PATH_MAX];
+   char object_name[PATH_MAX];
+   int object_name_len;
+   char key_name[PATH_MAX];
+   int key_name_len;
+   char key_value[PATH_MAX];
+   int key_value_len;
+   int res;
+
+   res = confdb_key_iter_start(dump_handle, parent_object_handle);
+   if (res != SA_AIS_OK)
+   return -1;
+
+   if (!*buffer || ((*buffer)  !strlen(*buffer))) {
+   snprintf(temp, PATH_MAX - 1, ?xml 
version=\1.0\?\nobjdbmaindoc\n);
+   add_to_buffer(temp, buffer, size);
+   }
+
+   while ( (res = confdb_key_iter(dump_handle, parent_object_handle, 
key_name, key_name_len,
+   key_value, key_value_len)) == 
SA_AIS_OK) {
+   key_name[key_name_len] = '\0';
+   key_value[key_value_len] = '\0';
+   snprintf(temp, PATH_MAX - 1,  %s=\%s\, key_name, key_value);
+   add_to_buffer(temp, buffer, size);
+   }
+
+   if (parent_object_handle  0) {
+   snprintf(temp, PATH_MAX - 1, \n);
+   add_to_buffer(temp, buffer, size);
+   }
+
+   res = confdb_object_iter_start(dump_handle, parent_object_handle);
+   if (res != SA_AIS_OK)
+   return -1;

Re: [Cluster-devel] Cluster Project branch, master, updated. cluster-2.99.03-3-ge879971

2008-06-03 Thread David Teigland
On Tue, Jun 03, 2008 at 08:55:49AM +0200, Fabio M. Di Nitto wrote:
 On Mon, 2 Jun 2008, Joel Becker wrote:
 
 On Tue, Jun 03, 2008 at 05:57:35AM -, [EMAIL PROTECTED] wrote:
 commit e879971090c6821bb966f17875874d11aa740a5c
 Author: Fabio M. Di Nitto [EMAIL PROTECTED]
 Date:   Tue Jun 3 07:54:37 2008 +0200
 
 [MISC] Make several API's private again
 
 A bunch of API's have been exported and made public by mistake.
 
 libdlmcontrol, libfenced and libgfscontrol are now private again
 and no shared libraries are available.
 
  Um, is libdlmcontrol the method by which fs control daemons
 interact with dlm_controld?  If so, ocfs2_controld certainly needs that
 shared library.
 
 As long as David is ok with it.. i was explicitly told that those 
 libraries are for internal use only.
 
 David can we make a final call on those libs?

Yes, libdlmcontrol is meant to be usd by ocfs2_controld.  I still think it
needs to be kept private, or internal in some way to prevent someone
from trying to use it.



Re: [Cluster-devel] Cluster Project branch, master, updated. cluster-2.99.03-3-ge879971

2008-06-03 Thread Fabio M. Di Nitto

On Tue, 3 Jun 2008, David Teigland wrote:


On Tue, Jun 03, 2008 at 08:55:49AM +0200, Fabio M. Di Nitto wrote:

As long as David is ok with it.. i was explicitly told that those
libraries are for internal use only.

David can we make a final call on those libs?


Yes, libdlmcontrol is meant to be usd by ocfs2_controld.  I still think it
needs to be kept private, or internal in some way to prevent someone
from trying to use it.



This is tricky.. the only half clean way i can think of is to use a non 
standard library path:


/usr/lib/dlmcontrol/

without adding it to the standard LD_PATH.

all the cluster bits can just keep linking statically. Advanced users 
like ocfs2 can either add that to the LD_PATH and link dynamically or 
build statically (whatever they prefer).


Clearly the include file will also have to go outside standard paths..

It's not clean.. i am not very happy to go this route, but i think it's 
the only one to protect the library as private.


I welcome better suggestions tho...

Fabio

PS shipping only static library is not an option.

--
I'm going to make him an offer he can't refuse.



Re: [Cluster-devel] Cluster Project branch, master, updated. cluster-2.99.03-3-ge879971

2008-06-03 Thread Joel Becker
On Tue, Jun 03, 2008 at 05:22:51PM +0200, Fabio M. Di Nitto wrote:
 Yes, libdlmcontrol is meant to be usd by ocfs2_controld.  I still think it
 needs to be kept private, or internal in some way to prevent someone
 from trying to use it.


 This is tricky.. the only half clean way i can think of is to use a non 
 standard library path:

 /usr/lib/dlmcontrol/

This would work, although I'll probably claw my eyes out while
writing the configure.in gunk (actually, I'll just copy my search for
{libpath}/openais - pre-clawed-out eyes!).
But really, why is this private?  The recovery ordering
problem is not specific to filesystems.

Joel

-- 

Hey mister if you're gonna walk on water,
 Could you drop a line my way?

Joel Becker
Principal Software Developer
Oracle
E-mail: [EMAIL PROTECTED]
Phone: (650) 506-8127



[Cluster-devel] Cluster Project tag, fence_1_32_60, created. gfs-kernel_2_6_9_76-66-gda24f0a

2008-06-03 Thread cfeist
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project Cluster Project.

http://sources.redhat.com/git/gitweb.cgi?p=cluster.git;a=commitdiff;h=da24f0a30cb5b9950061cf1502adf263b7e3f68b

The tag, fence_1_32_60 has been created
at  da24f0a30cb5b9950061cf1502adf263b7e3f68b (commit)

- Log -
commit da24f0a30cb5b9950061cf1502adf263b7e3f68b
Author: Marek 'marx' Grac [EMAIL PROTECTED]
Date:   Mon Jun 2 16:15:50 2008 +0200

[FENCE] Fix #446995: Unknown option

Previous patch worked just for command line and there was a problem with
stdin argument. Typo fixed.
---


hooks/post-receive
--
Cluster Project