Split fence_virt vs. fence_xvm args

Fence_virt -h and fence_xvm -h now produce
meaningful output

Signed-off-by: Lon Hohberger <lon@users.sourceforge.net>
This commit is contained in:
Lon Hohberger 2010-01-09 14:20:59 -05:00
parent eff8f93c54
commit c7209147c2
4 changed files with 39 additions and 36 deletions

View File

@ -51,12 +51,14 @@ int
main(int argc, char **argv)
{
fence_virt_args_t args;
char *my_options = "di:a:p:r:C:c:k:M:H:uo:t:?hV";
const char *my_options;
args_init(&args);
if (!strcmp(basename(argv[0]), "fence_xvm")) {
my_options = "di:a:p:r:C:c:k:M:H:uo:t:?hV";
args.mode = MODE_MULTICAST;
} else {
my_options = "dD:P:M:H:o:t:?hV";
args.mode = MODE_SERIAL;
}

View File

@ -279,21 +279,6 @@ assign_version(fence_virt_args_t *args, struct arg_info *arg, char *value)
}
static inline void
assign_noccs(fence_virt_args_t *args, struct arg_info *arg, char *value)
{
args->flags |= F_NOCCS;
}
static inline void
assign_nocluster(fence_virt_args_t *args, struct arg_info *arg, char *value)
{
args->flags |= F_NOCCS;
args->flags |= F_NOCLUSTER;
}
static inline void
assign_uri(fence_virt_args_t *args, struct arg_info *arg, char *value)
{
@ -318,14 +303,14 @@ static struct arg_info _arg_info[] = {
"Not user serviceable",
NULL },
{ '\xff', NULL, "nodename",
"Not user serviceable",
NULL },
{ 'd', "-d", "debug",
"Specify (CCS) / increment (command line) debug level",
assign_debug },
{ 'f', "-f", NULL,
"Foreground mode (do not fork)",
assign_foreground },
{ 'i', "-i <family>", "ip_family",
"IP Family ([auto], ipv4, ipv6)",
assign_family },
@ -359,7 +344,7 @@ static struct arg_info _arg_info[] = {
assign_key },
{ 'D', "-D <device>", "serial_device",
"Shared key file (default=" DEFAULT_SERIAL_DEVICE ")",
"Serial device (default=" DEFAULT_SERIAL_DEVICE ")",
assign_device },
{ 'P', "-P <param>", "serial_params",
@ -395,14 +380,6 @@ static struct arg_info _arg_info[] = {
"Help (alternate)",
assign_help },
{ 'X', "-X", NULL,
"Do not connect to CCS for configuration",
assign_noccs },
{ 'L', "-L", NULL,
"Local mode only (no cluster; implies -X)",
assign_nocluster },
{ 'U', "-U", "uri",
"URI for Hypervisor (default: auto detect)",
assign_uri },
@ -516,7 +493,7 @@ args_print(fence_virt_args_t *args)
1 = print fence-style stdin args + description
*/
void
args_usage(char *progname, char *optstr, int print_stdin)
args_usage(char *progname, const char *optstr, int print_stdin)
{
int x;
struct arg_info *arg;
@ -606,7 +583,7 @@ eol:
@param args Args structure to fill in.
*/
void
args_get_stdin(char *optstr, fence_virt_args_t *args)
args_get_stdin(const char *optstr, fence_virt_args_t *args)
{
char in[256];
int line = 0;
@ -651,7 +628,7 @@ args_get_stdin(char *optstr, fence_virt_args_t *args)
@param args Args structure to fill in.
*/
void
args_get_getopt(int argc, char **argv, char *optstr, fence_virt_args_t *args)
args_get_getopt(int argc, char **argv, const char *optstr, fence_virt_args_t *args)
{
int opt;
struct arg_info *arg;

View File

@ -77,11 +77,11 @@ struct arg_info {
void args_init(fence_virt_args_t *args);
void args_finalize(fence_virt_args_t *args);
void args_get_getopt(int argc, char **argv, char *optstr,
void args_get_getopt(int argc, char **argv, const char *optstr,
fence_virt_args_t *args);
void args_get_stdin(char *optstr, fence_virt_args_t *args);
void args_get_ccs(char *optstr, fence_virt_args_t *args);
void args_usage(char *progname, char *optstr, int print_stdin);
void args_get_stdin(const char *optstr, fence_virt_args_t *args);
void args_get_ccs(const char *optstr, fence_virt_args_t *args);
void args_usage(char *progname, const char *optstr, int print_stdin);
void args_print(fence_virt_args_t *args);
#endif

View File

@ -83,6 +83,17 @@ Treat 'domain' as UUID instead of domain name.
.
Fencing action (null, off, on, [reboot], or status) (Default Value: reboot)
.TP
.B -D
.
Serial device (fence_virt mode). Default=/dev/ttyS1
.TP
.B -P
.
Serial parameters (fence_virt mode). Default=115200,8N1
.TP
.B -t
.
@ -175,5 +186,18 @@ Fencing action (null, off, on, [reboot], or status) (Default Value: reboot)
.
Fencing timeout (in seconds; default=30) (Default Value: 30)
.TP
.B serial_device
.
Serial device
.TP
.B serial_params
.
Serial parameters
.SH SEE ALSO