All of lore.kernel.org
 help / color / mirror / Atom feed
From: kupcevic@sourceware.org <kupcevic@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] conga/ricci/modules/cluster Clusvcadm.cpp clum ...
Date: 12 Oct 2006 20:01:52 -0000	[thread overview]
Message-ID: <20061012200152.12949.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	kupcevic at sourceware.org	2006-10-12 20:01:51

Modified files:
	ricci/modules/cluster: Clusvcadm.cpp 
	ricci/modules/cluster/clumon/src/daemon: Monitor.cpp 

Log message:
	rpm module & modcluster: implement changes in `clustat -x` output

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/Clusvcadm.cpp.diff?cvsroot=cluster&r1=1.5&r2=1.6
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/clumon/src/daemon/Monitor.cpp.diff?cvsroot=cluster&r1=1.6&r2=1.7

--- conga/ricci/modules/cluster/Clusvcadm.cpp	2006/10/06 03:10:13	1.5
+++ conga/ricci/modules/cluster/Clusvcadm.cpp	2006/10/12 20:01:51	1.6
@@ -51,15 +51,18 @@
   
   ServiceStatus(const String& name,
 		const String& node, 
-		state status) :
+		state status,
+		bool xenvm) :
     name(name),
     node(node),
-    status(status) {}
+    status(status),
+    xenvm(xenvm) {}
   virtual ~ServiceStatus() {}
   
   String name;
   String node;
   state status;
+  bool xenvm;
 };
 
 
@@ -101,8 +104,12 @@
 	  iter->status == ServiceStatus::RG_STATE_DISABLED)
 	flag = "-e";
       else if (iter->status == ServiceStatus::RG_STATE_STARTED ||
-	       iter->status == ServiceStatus::RG_STATE_STARTING)
-	flag = "-r";
+	       iter->status == ServiceStatus::RG_STATE_STARTING) {
+	if (iter->xenvm)
+	  flag = "-M";
+	else
+	  flag = "-r";
+      }
       
       if (flag.size()) {
 	String out, err;
@@ -215,7 +222,7 @@
   args.push_back("-x");
   if (utils::execute(CLUSTAT_TOOL_PATH, args, out, err, status, false))
     throw command_not_found_error_msg(CLUSTAT_TOOL_PATH);
-  if (status != 0)
+  if (status)
     throw String("clustat failed");
   
   XMLObject xml = parseXML(out);
@@ -249,11 +256,18 @@
        iter != groups_xml.children().end();
        iter++)
     if (iter->tag() == "group") {
+      bool xenvm = false;
       String name(iter->get_attr("name"));
+      String::size_type idx = name.find(":");
+      if (idx != name.npos) {
+	if (name.substr(0, idx) == "xenvm")
+	  xenvm = true;
+	name = name.substr(idx + 1);
+      }
       String node(iter->get_attr("owner"));
       ServiceStatus::state state = (ServiceStatus::state) 
 	utils::to_long(iter->get_attr("state"));
-      services.push_back(ServiceStatus(name, node, state));
+      services.push_back(ServiceStatus(name, node, state, xenvm));
     }
   
   return pair<list<String>, list<ServiceStatus> >(nodes, services);
--- conga/ricci/modules/cluster/clumon/src/daemon/Monitor.cpp	2006/08/15 00:12:33	1.6
+++ conga/ricci/modules/cluster/clumon/src/daemon/Monitor.cpp	2006/10/12 20:01:51	1.7
@@ -628,7 +628,16 @@
 	  XMLObject service("service");
 	  
 	  // name
-	  service.set_attr("name", group.get_attr("name"));
+	  String name(group.get_attr("name"));
+	  bool xenvm = false;
+	  String::size_type idx = name.find(":");
+	  if (idx != name.npos) {
+	    if (name.substr(0, idx) == "xenvm")
+	      xenvm = true;
+	    name = name.substr(idx + 1);
+	  }
+	  service.set_attr("name", name);
+	  
 	  
 	  // state
 	  bool failed, running;



                 reply	other threads:[~2006-10-12 20:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061012200152.12949.qmail@sourceware.org \
    --to=kupcevic@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.