public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* cluster: RHEL5 - fence: Use libvirt's autodetection by default
@ 2009-04-09 21:06 Lon Hohberger
  0 siblings, 0 replies; only message in thread
From: Lon Hohberger @ 2009-04-09 21:06 UTC (permalink / raw)
  To: cluster-cvs-relay

Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=b08a992e52144b2f6fa6424dd4c69ab705f5d4e1
Commit:        b08a992e52144b2f6fa6424dd4c69ab705f5d4e1
Parent:        99f367d0522a290f770f188f201f7c5f4dcd20d8
Author:        Lon Hohberger <lhh@redhat.com>
AuthorDate:    Thu Apr 9 17:04:28 2009 -0400
Committer:     Lon Hohberger <lhh@redhat.com>
CommitterDate: Thu Apr 9 17:04:28 2009 -0400

fence: Use libvirt's autodetection by default

If no URI is specified, assume libvirt will find
the right hypervisor.

Signed-off-by: Lon Hohberger <lhh@redhat.com>
---
 fence/agents/xvm/fence_xvmd.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/fence/agents/xvm/fence_xvmd.c b/fence/agents/xvm/fence_xvmd.c
index 380c42e..6995a08 100644
--- a/fence/agents/xvm/fence_xvmd.c
+++ b/fence/agents/xvm/fence_xvmd.c
@@ -62,9 +62,9 @@ int cleanup_xml(char *xmldesc, char **ret, size_t *retsz);
 
 
 static char *hypervisor_uris[] = {
+	NULL,
 	"xen:///",
-	"qemu:///system",
-	NULL
+	"qemu:///system"
 };
 
 
@@ -77,7 +77,7 @@ find_hypervisor(fence_xvm_args_t *args)
 	if (args->uri)
 		return virConnectOpen(args->uri);
 
-	for (x = 0; hypervisor_uris[x]; x++) {
+	for (x = 0; x < (sizeof(hypervisor_uris)/sizeof(char *)); x++) {
 		vp = virConnectOpen(hypervisor_uris[x]);
 		if (vp)
 			break;
@@ -86,9 +86,11 @@ find_hypervisor(fence_xvm_args_t *args)
 	if (!vp)
 		return NULL;
 
-	args->uri = strdup(hypervisor_uris[x]);
-	dbg_printf(1, "DISCOVERY: Using %s as hypervisor URI from now on\n",
-		   args->uri);
+	if (args->uri) {
+		args->uri = strdup(hypervisor_uris[x]);
+		dbg_printf(1, "DISCOVERY: Using %s as hypervisor "
+			   "URI from now on\n", args->uri);
+	}
 
 	return vp;
 }


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-04-09 21:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-09 21:06 cluster: RHEL5 - fence: Use libvirt's autodetection by default Lon Hohberger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).