forked from altcloud/fence-virt
Move name_mode to fence_virtd block
Signed-off-by: Lon Hohberger <lhh@redhat.com>
This commit is contained in:
parent
a12da25998
commit
ddc8c75e2d
@ -2,6 +2,7 @@ fence_virtd {
|
|||||||
debug ="99";
|
debug ="99";
|
||||||
listener = "multicast";
|
listener = "multicast";
|
||||||
backend = "libvirt";
|
backend = "libvirt";
|
||||||
|
name_mode = "name";
|
||||||
}
|
}
|
||||||
|
|
||||||
listeners {
|
listeners {
|
||||||
@ -25,4 +26,3 @@ backends {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
name_mode = "name";
|
|
||||||
|
@ -336,8 +336,8 @@ libvirt_init(backend_context_t *c, config_object_t *config)
|
|||||||
{
|
{
|
||||||
virConnectPtr vp;
|
virConnectPtr vp;
|
||||||
char value[256];
|
char value[256];
|
||||||
char *uri = NULL;
|
|
||||||
struct libvirt_info *info = NULL;
|
struct libvirt_info *info = NULL;
|
||||||
|
char *uri = NULL;
|
||||||
int use_uuid = 0;
|
int use_uuid = 0;
|
||||||
|
|
||||||
info = malloc(sizeof(*info));
|
info = malloc(sizeof(*info));
|
||||||
@ -348,12 +348,17 @@ libvirt_init(backend_context_t *c, config_object_t *config)
|
|||||||
|
|
||||||
if (sc_get(config, "backends/libvirt/@uri",
|
if (sc_get(config, "backends/libvirt/@uri",
|
||||||
value, sizeof(value)) == 0) {
|
value, sizeof(value)) == 0) {
|
||||||
uri = value;
|
uri = strdup(value);
|
||||||
|
if (!uri) {
|
||||||
|
free(info);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
printf("Using %s\n", uri);
|
printf("Using %s\n", uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Naming scheme is a top-level configuration option */
|
/* Naming scheme is a top-level configuration option */
|
||||||
if ((sc_get(config, "@name_mode", value, sizeof(value)-1) == 0)) {
|
if (sc_get(config, "fence_virtd/@name_mode",
|
||||||
|
value, sizeof(value)-1) == 0) {
|
||||||
|
|
||||||
dbg_printf(1, "Got %s for name_mode\n", value);
|
dbg_printf(1, "Got %s for name_mode\n", value);
|
||||||
if (!strcasecmp(value, "uuid")) {
|
if (!strcasecmp(value, "uuid")) {
|
||||||
@ -368,9 +373,11 @@ libvirt_init(backend_context_t *c, config_object_t *config)
|
|||||||
/* We don't need to store the URI; we only use it once */
|
/* We don't need to store the URI; we only use it once */
|
||||||
vp = virConnectOpen(uri);
|
vp = virConnectOpen(uri);
|
||||||
if (!vp) {
|
if (!vp) {
|
||||||
|
free(uri);
|
||||||
free(info);
|
free(info);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
free(uri);
|
||||||
|
|
||||||
info->magic = MAGIC;
|
info->magic = MAGIC;
|
||||||
info->vp = vp;
|
info->vp = vp;
|
||||||
|
@ -353,7 +353,8 @@ mcast_config(config_object_t *config, mcast_options *args)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sc_get(config, "@name_mode", value, sizeof(value)-1) == 0) {
|
if (sc_get(config, "fence_virtd/@name_mode",
|
||||||
|
value, sizeof(value)-1) == 0) {
|
||||||
/*
|
/*
|
||||||
* This is just an optimization. If an administrator
|
* This is just an optimization. If an administrator
|
||||||
* configured something at the top level, we can use it
|
* configured something at the top level, we can use it
|
||||||
|
Loading…
x
Reference in New Issue
Block a user