All of lore.kernel.org
 help / color / mirror / Atom feed
From: pcaulfield@sourceware.org <pcaulfield@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/ccs/ccs_tool editconf.c
Date: 13 Dec 2007 10:38:47 -0000	[thread overview]
Message-ID: <20071213103847.27581.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	pcaulfield at sourceware.org	2007-12-13 10:38:47

Modified files:
	ccs/ccs_tool   : editconf.c 

Log message:
	Fix altname option

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/ccs/ccs_tool/editconf.c.diff?cvsroot=cluster&r1=1.11&r2=1.12

--- cluster/ccs/ccs_tool/editconf.c	2006/05/24 13:50:41	1.11
+++ cluster/ccs/ccs_tool/editconf.c	2007/12/13 10:38:42	1.12
@@ -417,7 +417,7 @@
 /* Print name=value pairs for a (n XML) node.
  * "ignore" is a string to ignore if present as a property (probably already printed on the main line)
  */
-static void print_properties(xmlNode *node, char *prefix, char *ignore, char *ignore2)
+static int print_properties(xmlNode *node, char *prefix, char *ignore, char *ignore2)
 {
 	xmlAttr *attr;
 	int done_prefix = 0;
@@ -440,6 +440,7 @@
 	}
 	if (done_prefix)
 		printf("\n");
+	return done_prefix;
 }
 
 /* Add name=value pairs from the commandline as properties to a node */
@@ -477,6 +478,7 @@
 {
 	xmlNode *clusternodes;
 	xmlNode *newnode;
+
 	xmlNode *newfence;
 	xmlNode *newfencemethod;
 	xmlNode *newfencedevice;
@@ -507,6 +509,15 @@
 	xmlSetProp(newnode, BAD_CAST "nodeid", BAD_CAST ninfo->nodeid);
 	xmlAddChild(clusternodes, newnode);
 
+	if (ninfo->altname)
+	{
+		xmlNode *altnode;
+
+		altnode = xmlNewNode(NULL, BAD_CAST "altname");
+		xmlSetProp(altnode, BAD_CAST "name", BAD_CAST ninfo->altname);
+		xmlAddChild(newnode, altnode);
+	}
+
 	/* Add the fence attributes */
 	newfence = xmlNewNode(NULL, BAD_CAST "fence");
 	newfencemethod = xmlNewNode(NULL, BAD_CAST "method");
@@ -975,6 +986,13 @@
 			       ftype?ftype:(xmlChar *)"");
 			if (verbose)
 			{
+				xmlNode *a = findnode(cur_node, "altname");
+				if (a)
+				{
+					printf(" altname %s=%s", "name", xmlGetProp(a, BAD_CAST "name"));
+					if (!print_properties(a, "","",""))
+						printf("\n");
+				}
 				print_properties(cur_node, "  Node properties: ", "votes", "nodeid");
 				print_properties(fencenode, "  Fence properties: ", "agent", "");
 			}



                 reply	other threads:[~2007-12-13 10:38 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=20071213103847.27581.qmail@sourceware.org \
    --to=pcaulfield@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.