From: lhh@sourceware.org <lhh@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/fence/agents/xvm xml.c
Date: 26 Jun 2007 17:31:33 -0000 [thread overview]
Message-ID: <20070626173133.4451.qmail@sourceware.org> (raw)
CVSROOT: /cvs/cluster
Module name: cluster
Changes by: lhh at sourceware.org 2007-06-26 17:31:33
Modified files:
fence/agents/xvm: xml.c
Log message:
Ancillary patch to fix debug output
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/fence/agents/xvm/xml.c.diff?cvsroot=cluster&r1=1.2&r2=1.3
--- cluster/fence/agents/xvm/xml.c 2007/06/26 17:23:41 1.2
+++ cluster/fence/agents/xvm/xml.c 2007/06/26 17:31:32 1.3
@@ -9,6 +9,12 @@
#include <ctype.h>
+#ifdef STANDALONE
+#define dprintf(x, fmt, args...) printf("<%d> " fmt, x, ##args)
+#else
+#include "xvm.h"
+#endif
+
xmlNodePtr
get_os_node(xmlDocPtr doc)
{
@@ -52,7 +58,7 @@
}
if (xmlGetProp(curr, (xmlChar *)"port")) {
- printf("Zapping the port spec\n");
+ dprintf(5,"Zapping the graphics port\n");
xmlSetProp(curr, (xmlChar *)"port", (xmlChar *)"-1");
}
@@ -69,7 +75,7 @@
curr = xmlDocGetRootElement(doc);
if (xmlStrcmp(curr->name, (xmlChar *)"domain")) {
- printf("Invalid XML\n");
+ dprintf(1, "Invalid XML\n");
return -1;
}
@@ -84,7 +90,7 @@
curr = curr->next;
}
if (!curr) {
- printf("Unable to determine the domain type\n");
+ dprintf(1, "Unable to determine the domain type\n");
return -1;
}
@@ -93,15 +99,15 @@
if (!strcasecmp(val, "hvm")) {
type = 1;
- printf("Virtual machine is HVM\n");
+ dprintf(2, "Virtual machine is HVM\n");
} else if (!strcasecmp(val, "linux")) {
type = 2;
- printf("Virtual machine is Linux\n");
+ dprintf(2, "Virtual machine is Linux\n");
}
/* Node is still pointing to the <os> block */
if (type == 2) {
- printf("Unlinkiking %s block\n", (char *)os_node->name);
+ dprintf(3, "Unlinkiking %s block\n", (char *)os_node->name);
xmlUnlinkNode(os_node);
xmlFreeNode(os_node);
}
@@ -144,12 +150,12 @@
*xtreep = xmlParseMemory(buffer, size);
if (!*xtreep) {
- printf("parse failure %p %d\n", buffer, (int)size);
+ dprintf(1, "parse failure %p %d\n", buffer, (int)size);
return -1;
}
if (!((cur = xmlDocGetRootElement(*xtreep)))) {
- printf("root element failure\n");
+ dprintf(1, "root element failure\n");
xmlFreeDoc(*xtreep);
*xtreep = NULL;
return -1;
reply other threads:[~2007-06-26 17:31 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=20070626173133.4451.qmail@sourceware.org \
--to=lhh@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.