FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Cluster Development

 
 
LinkBack Thread Tools
 
Old 12-10-2010, 08:00 AM
Dmitry Mishin
 
Default Added ability to reference domains from services

Signed-off-by: Dmitry Mishin <dim@parallels.com>
---
config/tools/ccs_tool/editconf.c | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/config/tools/ccs_tool/editconf.c b/config/tools/ccs_tool/editconf.c
index aae1095..baa6fd3 100644
--- a/config/tools/ccs_tool/editconf.c
+++ b/config/tools/ccs_tool/editconf.c
@@ -46,6 +46,7 @@ struct option_info
const char *exclusive;
const char *recovery;
const char *fs;
+ const char *domain;
const char *script;
const char *mountpoint;
const char *type;
@@ -695,6 +696,7 @@ static void add_clusterservice(xmlNode *root_element, struct option_info *ninfo,
{
xmlNode *rm;
xmlNode *rs;
+ xmlNode *fdomains;
xmlNode *newnode;

xmlNode *newfs = NULL;
@@ -711,6 +713,7 @@ static void add_clusterservice(xmlNode *root_element, struct option_info *ninfo,
ninfo->configfile);

rs = findnode(rm, "resources");
+ fdomains = findnode(rm, "failoverdomains");
if (ninfo->fs && (!rs || !find_fs_resource(rs, ninfo->fs)))
die("fs resource %s doesn't exist in %s
", ninfo->fs,
ninfo->configfile);
@@ -720,11 +723,16 @@ static void add_clusterservice(xmlNode *root_element, struct option_info *ninfo,
if (ninfo->ip_addr && (!rs || !find_ip_resource(rs, ninfo->ip_addr)))
die("ip resource %s doesn't exist in %s
", ninfo->ip_addr,
ninfo->configfile);
+ if (ninfo->domain && (!fdomains || !find_fdomain_resource(fdomains, ninfo->domain)))
+ die("failover domain %s doesn't exist in %s
", ninfo->domain,
+ ninfo->configfile);

/* Add the new service */
newnode = xmlNewNode(NULL, BAD_CAST "service");
xmlSetProp(newnode, BAD_CAST "name", BAD_CAST ninfo->name);
xmlSetProp(newnode, BAD_CAST "autostart", BAD_CAST ninfo->autostart);
+ if (ninfo->domain)
+ xmlSetProp(newnode, BAD_CAST "domain", BAD_CAST ninfo->domain);
if (ninfo->exclusive)
xmlSetProp(newnode, BAD_CAST "exclusive",
BAD_CAST ninfo->exclusive);
@@ -1135,6 +1143,7 @@ struct option list_options[] =
struct option addservice_options[] =
{
{ "autostart", required_argument, NULL, 'a'},
+ { "domain", required_argument, NULL, 'd'},
{ "exclusive", required_argument, NULL, 'x'},
{ "recovery", required_argument, NULL, 'r'},
{ "fs", required_argument, NULL, 'f'},
@@ -1553,7 +1562,7 @@ void add_service(int argc, char **argv)
ninfo.autostart = "1";
ninfo.recovery = "relocate";

- while ( (opt = getopt_long(argc, argv, "a:x:r:f:c:s:i:CFh?", addservice_options, NULL)) != EOF)
+ while ( (opt = getopt_long(argc, argv, "a:d:x:r:f:c:s:i:CFh?", addservice_options, NULL)) != EOF)
{
switch(opt)
{
@@ -1562,6 +1571,10 @@ void add_service(int argc, char **argv)
ninfo.autostart = optarg;
break;

+ case 'd':
+ ninfo.domain = strdup(optarg);
+ break;
+
case 'x':
validate_int_arg(opt, optarg);
ninfo.exclusive = optarg;
--
1.7.1
 
Old 12-10-2010, 12:42 PM
Dmitry Mishin
 
Default Added ability to reference domains from services

Signed-off-by: Dmitry Mishin <dim@parallels.com>
---
config/tools/ccs_tool/editconf.c | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/config/tools/ccs_tool/editconf.c b/config/tools/ccs_tool/editconf.c
index 516b338..a443831 100644
--- a/config/tools/ccs_tool/editconf.c
+++ b/config/tools/ccs_tool/editconf.c
@@ -44,6 +44,7 @@ struct option_info
const char *exclusive;
const char *recovery;
const char *fs;
+ const char *domain;
const char *script;
const char *mountpoint;
const char *type;
@@ -696,6 +697,7 @@ static void add_clusterservice(xmlNode *root_element, struct option_info *ninfo,
{
xmlNode *rm;
xmlNode *rs;
+ xmlNode *fdomains;
xmlNode *newnode;

xmlNode *newfs = NULL;
@@ -712,6 +714,7 @@ static void add_clusterservice(xmlNode *root_element, struct option_info *ninfo,
ninfo->configfile);

rs = findnode(rm, "resources");
+ fdomains = findnode(rm, "failoverdomains");
if (ninfo->fs && (!rs || !find_fs_resource(rs, ninfo->fs)))
die("fs resource %s doesn't exist in %s
", ninfo->fs,
ninfo->configfile);
@@ -721,11 +724,16 @@ static void add_clusterservice(xmlNode *root_element, struct option_info *ninfo,
if (ninfo->ip_addr && (!rs || !find_ip_resource(rs, ninfo->ip_addr)))
die("ip resource %s doesn't exist in %s
", ninfo->ip_addr,
ninfo->configfile);
+ if (ninfo->domain && (!fdomains || !find_fdomain_resource(fdomains, ninfo->domain)))
+ die("failover domain %s doesn't exist in %s
", ninfo->domain,
+ ninfo->configfile);

/* Add the new service */
newnode = xmlNewNode(NULL, BAD_CAST "service");
xmlSetProp(newnode, BAD_CAST "name", BAD_CAST ninfo->name);
xmlSetProp(newnode, BAD_CAST "autostart", BAD_CAST ninfo->autostart);
+ if (ninfo->domain)
+ xmlSetProp(newnode, BAD_CAST "domain", BAD_CAST ninfo->domain);
if (ninfo->exclusive)
xmlSetProp(newnode, BAD_CAST "exclusive",
BAD_CAST ninfo->exclusive);
@@ -1137,6 +1145,7 @@ struct option create_options[] =
struct option addservice_options[] =
{
{ "autostart", required_argument, NULL, 'a'},
+ { "domain", required_argument, NULL, 'd'},
{ "exclusive", required_argument, NULL, 'x'},
{ "recovery", required_argument, NULL, 'r'},
{ "fs", required_argument, NULL, 'f'},
@@ -1530,7 +1539,7 @@ void add_service(int argc, char **argv)
ninfo.autostart = "1";
ninfo.recovery = "relocate";

- while ( (opt = getopt_long(argc, argv, "a:x:r:f:c:s:i:CFh?", addservice_options, NULL)) != EOF)
+ while ( (opt = getopt_long(argc, argv, "a:d:x:r:f:c:s:i:CFh?", addservice_options, NULL)) != EOF)
{
switch(opt)
{
@@ -1539,6 +1548,10 @@ void add_service(int argc, char **argv)
ninfo.autostart = optarg;
break;

+ case 'd':
+ ninfo.domain = strdup(optarg);
+ break;
+
case 'x':
validate_int_arg(opt, optarg);
ninfo.exclusive = optarg;
--
1.7.1
 

Thread Tools




All times are GMT. The time now is 01:21 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org