Index: pvfs2/Makefile.in diff -c pvfs2/Makefile.in:1.254 pvfs2/Makefile.in:1.255 *** pvfs2/Makefile.in:1.254 Sun Jul 22 12:02:14 2007 --- pvfs2/Makefile.in Fri Aug 17 00:04:23 2007 *************** *** 802,808 **** rm -f maint/mpi-depend.sh rm -f examples/pvfs2-server.rc rm -f doc/doxygen/pvfs2-doxygen.conf ! rm -f examples/fs.conf examples/server.conf-localhost rm -rf autom4te*.cache rm -f pvfs2-config.h.in~ rm -f $(srcdir)/cscope.out $(srcdir)/cscope.files --- 802,808 ---- rm -f maint/mpi-depend.sh rm -f examples/pvfs2-server.rc rm -f doc/doxygen/pvfs2-doxygen.conf ! rm -f examples/fs.conf rm -rf autom4te*.cache rm -f pvfs2-config.h.in~ rm -f $(srcdir)/cscope.out $(srcdir)/cscope.files *************** *** 815,821 **** find . -name "module.mk" -exec rm \{\} \; rm -f Makefile pvfs2-config.h rm -f src/server/simple.conf - rm -f src/server/server.conf-localhost rm -f src/apps/admin/pvfs2-config ifndef DIST_RELEASE rm -f $(SMCGEN) --- 815,820 ---- *************** *** 858,881 **** # config files in the server build directory with good defaults for # debugging ifndef DIST_RELEASE ! all:: src/server/simple.conf src/server/server.conf-localhost endif ! src/server/simple.conf src/server/server.conf-localhost: src/apps/admin/pvfs2-genconfig $(Q) " GENCONFIG $@" $(E)$(srcdir)/src/apps/admin/pvfs2-genconfig --protocol tcp --port 3334 \ --ioservers localhost --metaservers localhost --logfile /tmp/pvfs2-server.log \ --storage /tmp/pvfs2-test-space --logging "server,network,storage,flow" \ ! --quiet src/server/simple.conf src/server/server.conf # whether this is a distribution tarball or not, drop some config files # into the "examples" subdir of the build dir ! all:: examples/fs.conf examples/server.conf-localhost ! examples/fs.conf examples/server.conf-localhost: src/apps/admin/pvfs2-genconfig $(Q) " GENCONFIG $@" $(E)$(srcdir)/src/apps/admin/pvfs2-genconfig --protocol tcp --port 3334 \ --ioservers localhost --metaservers localhost --logfile /tmp/pvfs2-server.log \ --storage /tmp/pvfs2-test-space \ ! --quiet examples/fs.conf examples/server.conf install_doc: install -d $(mandir)/man1 --- 857,880 ---- # config files in the server build directory with good defaults for # debugging ifndef DIST_RELEASE ! all:: src/server/simple.conf endif ! src/server/simple.conf: src/apps/admin/pvfs2-genconfig $(Q) " GENCONFIG $@" $(E)$(srcdir)/src/apps/admin/pvfs2-genconfig --protocol tcp --port 3334 \ --ioservers localhost --metaservers localhost --logfile /tmp/pvfs2-server.log \ --storage /tmp/pvfs2-test-space --logging "server,network,storage,flow" \ ! --quiet src/server/simple.conf # whether this is a distribution tarball or not, drop some config files # into the "examples" subdir of the build dir ! all:: examples/fs.conf ! examples/fs.conf: src/apps/admin/pvfs2-genconfig $(Q) " GENCONFIG $@" $(E)$(srcdir)/src/apps/admin/pvfs2-genconfig --protocol tcp --port 3334 \ --ioservers localhost --metaservers localhost --logfile /tmp/pvfs2-server.log \ --storage /tmp/pvfs2-test-space \ ! --quiet examples/fs.conf install_doc: install -d $(mandir)/man1 *************** *** 907,912 **** --- 906,912 ---- install -m 755 src/apps/admin/pvfs2-config $(prefix)/bin @# if we ever auto-generate genconfig, remove the $(srcdir) install -m 755 $(srcdir)/src/apps/admin/pvfs2-genconfig $(prefix)/bin + install -m 755 $(srcdir)/src/apps/admin/pvfs2-config-convert $(prefix)/bin ifdef BUILD_KARMA install -m 755 $(KARMA) $(prefix)/bin endif Index: pvfs2/include/pvfs2-mgmt.h diff -c pvfs2/include/pvfs2-mgmt.h:1.59 pvfs2/include/pvfs2-mgmt.h:1.60 *** pvfs2/include/pvfs2-mgmt.h:1.59 Fri Apr 13 01:14:15 2007 --- pvfs2/include/pvfs2-mgmt.h Fri Aug 17 00:04:23 2007 *************** *** 365,373 **** const PVFS_fs_id* fsid, PVFS_BMI_addr_t* addr, char* fs_buf, ! int fs_buf_size, ! char* server_buf, ! int server_buf_size); #endif /* __PVFS2_MGMT_H */ --- 365,371 ---- const PVFS_fs_id* fsid, PVFS_BMI_addr_t* addr, char* fs_buf, ! int fs_buf_size); #endif /* __PVFS2_MGMT_H */ Index: pvfs2/src/apps/admin/pvfs2-config-convert diff -c /dev/null pvfs2/src/apps/admin/pvfs2-config-convert:1.1 *** /dev/null Fri Aug 17 00:08:24 2007 --- pvfs2/src/apps/admin/pvfs2-config-convert Fri Aug 17 00:04:23 2007 *************** *** 0 **** --- 1,153 ---- + #!/usr/bin/perl -w + # + # (C) 2001 Clemson University and The University of Chicago + # + # See COPYING in top-level directory. + # + # convert old format pvfs2 config files to the new single config format. + # + use Term::ReadLine; + use Getopt::Long; + + # turn on strictness + use strict 'vars'; + + my $opt_servers = ''; + my $show_help = ''; + + sub usage + { + + print STDERR <<"THIS"; + Usage: pvfs2-config-convert [OPTIONS] + + The pvfs2-config-convert utility converts old fs.conf and server.conf config + files to the new format, where only a single fs.conf is used. Each of the + options in the server.conf files will be added to the new fs.conf. Note that + this script does not support server.conf files generated for configurations where + multiple servers are run on the same node. + + This script requires the following argument: + + --servers hostnames of all servers. Can be + {#-#,#,#-#,...} + + The rest of the arguments are optional: + + --help This message + + THIS + + } + + GetOptions('servers=s' => \$opt_servers, + 'help' => \$show_help) + or die "Could not parse arguments. See -h for help\n"; + + if($show_help) + { + usage(); + exit; + } + + if($opt_servers eq '') + { + die "Bad arguments. See -h for help.\n"; + } + + if(@ARGV != 3) + { + die "Bad arguments. See -h for help.\n"; + } + + my @servers = parse_hostlist($opt_servers); + + open(NEWFSCONF, ">", $ARGV[2]) or die "Failed to create new fs.conf: $ARGV[2]: $!\n"; + open(OLDFSCONF, "<", $ARGV[0]) or die "Failed to open old fs.conf: $ARGV[0]: $!\n"; + + my $line = undef; + + while(defined($line = )) + { + print NEWFSCONF $line; + } + + close(OLDFSCONF); + + foreach my $s (@servers) + { + open(OLDSCONF, "<", $ARGV[1] . "-$s") or die "Failed to open old server.conf: $ARGV[1]-$s: $!\n"; + + print NEWFSCONF "\n\tServer $s\n"; + while(defined($line = )) + { + if($line !~ /HostID/) + { + print NEWFSCONF "\t" . $line; + } + } + + print NEWFSCONF "\n"; + close(OLDSCONF); + } + + close(NEWFSCONF); + + sub parse_hostlist + { + my $inputline = shift; + my @components = (); + my @hosts = (); + + # we want to split the string into components seperated by comma + # but we don't want split components that have curly brackets. For example, + # we need to be sure that "hosta{1-4,8-12},hostb,hostc{1,2,3}" splits to + # hosta{1-4,8-12} + # hostb + # hostc{1,2,3} + # + @components = $inputline =~ /(?:,?[ ]*([^{,]+(?:{[^}]+})?))/g; + foreach my $comp (@components) + { + # if we've got a component that has {..}, then expand. + # match the prefix (hostname) and curly brackets + if($comp =~ /([^{]+){([^}]+)}/) + { + my $prefix = $1; + my $ranges = $2; + + # split the ranges string on the commas + foreach my $r (split(/,/, $ranges)) + { + if($r !~ /-/) + { + # only one number, just push it on + } + else + { + # min and max in this range. Add each of the indexes + my ($s, $f) = $r =~ /([0-9]+)-([0-9]+)/; + for(my $i = $s; $i <= $f; ++$i) + { + push @hosts, "$prefix$i"; + } + } + } + } + else { + push @hosts, $comp; + } + } + return @hosts; + } + + + + # Local variables: + # c-indent-level: 4 + # c-basic-offset: 4 + # End: + # + # vim: ts=8 sts=4 sw=4 expandtab + + Index: pvfs2/src/apps/admin/pvfs2-genconfig diff -c pvfs2/src/apps/admin/pvfs2-genconfig:1.70 pvfs2/src/apps/admin/pvfs2-genconfig:1.71 *** pvfs2/src/apps/admin/pvfs2-genconfig:1.70 Wed Jul 25 17:07:28 2007 --- pvfs2/src/apps/admin/pvfs2-genconfig Fri Aug 17 00:04:23 2007 *************** *** 51,56 **** --- 51,61 ---- my %all_endpoints = (); + my $default_storage = undef; + my $default_logfile = undef; + + my $bmi_module = undef; + my $opt_gen_key = 0; my $META_ENDPOINT = 0x1; *************** *** 193,198 **** --- 198,206 ---- print $target "\tClientRetryLimit 5\n"; print $target "\tClientRetryDelayMilliSecs 2000\n"; + print $target "\n\tStorageSpace " . $default_storage . "\n"; + print $target "\tLogFile " . $default_logfile . "\n"; + print $target "\n"; } *************** *** 414,432 **** # dump usage with a single HERE document rather than seperate print # statements print $OUT <<"THIS"; ! Usage: pvfs2-genconfig [OPTIONS] The pvfs2-genconfig utility creates configuration files for the ! PVFS2 file system. The and arguments are ! manditory and specify the names of the configuration files that will ! be written. This utility will create one fs.conf file. It will also ! create a seperate server.conf file for each server in the file system. ! Each server.conf file will be appended with the host name of the server ! to which it belongs. ! ! EXAMPLE: 'pvfs2-genconfig /tmp/fs.conf /tmp/server.conf' will ! generate a file called /tmp/fs.conf and server specific files ! called /tmp/server.conf-host1, /tmp/server.conf-host2, etc. NOTE: If pvfs2-genconfig is executed with a single argument of "-", then all output is directed to stdout and no files are written. --- 422,436 ---- # dump usage with a single HERE document rather than seperate print # statements print $OUT <<"THIS"; ! Usage: pvfs2-genconfig [OPTIONS] The pvfs2-genconfig utility creates configuration files for the ! PVFS2 file system. The argument is ! manditory and specify the name of the configuration file that will ! be written. This utility will create the fs.conf file. ! ! EXAMPLE: 'pvfs2-genconfig /tmp/fs.conf' will ! generate a file called /tmp/fs.conf NOTE: If pvfs2-genconfig is executed with a single argument of "-", then all output is directed to stdout and no files are written. *************** *** 1248,1254 **** if ($using_stdout) { $output_target = \*STDOUT; } ! elsif (@ARGV != 2) { die "Bad arguments. See -h for help.\n"; } --- 1252,1258 ---- if ($using_stdout) { $output_target = \*STDOUT; } ! elsif (@ARGV != 1) { die "Bad arguments. See -h for help.\n"; } *************** *** 1273,1282 **** print_welcome(); - my $default_storage = undef; - my $default_logfile = undef; - my $bmi_module = undef; - if($opt_metaspec) { get_specs($IO_ENDPOINT, $opt_iospec); --- 1277,1282 ---- *************** *** 1387,1396 **** if (!$opt_quiet) { print $OUT "Writing fs config file... "; ! if ($using_stdout == 1) ! { ! print $OUT "\n"; ! } } emit_defaults($output_target, $num_unexp_reqs, --- 1387,1393 ---- if (!$opt_quiet) { print $OUT "Writing fs config file... "; ! print $OUT "done\n"; } emit_defaults($output_target, $num_unexp_reqs, *************** *** 1409,1454 **** if ($using_stdout == 0) { close($output_target); - } - - if (!$opt_quiet) { - print $OUT "Done.\n"; - - print $OUT "Writing ", $count, " server config file(s)... "; - if ($using_stdout == 1) - { - print $OUT "\n"; - } - } - - foreach my $ep (sort keys %all_endpoints) - { - my($filename); - - # and open server.conf files - if ($using_stdout == 0) - { - $filename = "$ARGV[1]-" . $ep; - unless (open(SERVEROUT, ">", $filename)) - { - die "Can't open specified file $filename: $!\n"; - } - $output_target = \*SERVEROUT; - } - - emit_server_conf( - $output_target, $ep, - $all_endpoints{$ep}->{STORAGE}, - $all_endpoints{$ep}->{LOGFILE}); - - if ($using_stdout == 0) - { - close(SERVEROUT); - } - } - - if (!$opt_quiet) { - print $OUT "Done.\n"; } # Local variables: --- 1406,1411 ---- Index: pvfs2/src/apps/admin/pvfs2-migrate-collection.c diff -c pvfs2/src/apps/admin/pvfs2-migrate-collection.c:1.19 pvfs2/src/apps/admin/pvfs2-migrate-collection.c:1.20 *** pvfs2/src/apps/admin/pvfs2-migrate-collection.c:1.19 Mon Nov 13 14:50:40 2006 --- pvfs2/src/apps/admin/pvfs2-migrate-collection.c Fri Aug 17 00:04:23 2007 *************** *** 46,52 **** int all_set; int cleanup_set; char fs_conf[PATH_MAX]; - char server_conf[PATH_MAX]; } options_t; /** default size of buffers to use for reading old db keys */ --- 46,51 ---- *************** *** 137,143 **** { int ret = -1; ! /* all parameters read in from fs.conf and server.conf */ struct server_configuration_s server_config; PINT_llist_p fs_configs; --- 136,142 ---- { int ret = -1; ! /* all parameters read in from fs.conf */ struct server_configuration_s server_config; PINT_llist_p fs_configs; *************** *** 161,167 **** return -1; } ! ret = PINT_parse_config(&server_config, opts.fs_conf, opts.server_conf); if(ret < 0) { gossip_err("Error: Please check your config files.\n"); --- 160,166 ---- return -1; } ! ret = PINT_parse_config(&server_config, opts.fs_conf, NULL); if(ret < 0) { gossip_err("Error: Please check your config files.\n"); *************** *** 454,467 **** } strcpy(opts->fs_conf, argv[optind++]); - if(argc < optind) - { - /* missing server.conf */ - print_help(argv[0]); - return(-1); - } - strcpy(opts->server_conf, argv[optind]); - return 0; } --- 453,458 ---- *************** *** 471,477 **** static void print_help( char *progname) /**< executable name */ { ! fprintf(stderr,"\nusage: %s \\\n\t\t[OPTIONS] \n", progname); fprintf(stderr,"\nThis utility will migrate a PVFS2 collection from an old version\n" "to the most recent version.\n\n"); fprintf(stderr,"One of the following arguments is required:\n"); --- 462,468 ---- static void print_help( char *progname) /**< executable name */ { ! fprintf(stderr,"\nusage: %s \\\n\t\t[OPTIONS] \n", progname); fprintf(stderr,"\nThis utility will migrate a PVFS2 collection from an old version\n" "to the most recent version.\n\n"); fprintf(stderr,"One of the following arguments is required:\n"); Index: pvfs2/src/client/sysint/client-state-machine.h diff -c pvfs2/src/client/sysint/client-state-machine.h:1.169 pvfs2/src/client/sysint/client-state-machine.h:1.170 *** pvfs2/src/client/sysint/client-state-machine.h:1.169 Fri Jul 6 01:23:20 2007 --- pvfs2/src/client/sysint/client-state-machine.h Fri Aug 17 00:04:24 2007 *************** *** 370,378 **** struct server_configuration_s *config; struct PVFS_sys_mntent *mntent; char *fs_config_buf; - char *server_config_buf; uint32_t fs_config_buf_size; - uint32_t server_config_buf_size; int persist_config_buffers; int free_config_flag; }; --- 370,376 ---- *************** *** 382,390 **** int nservers; PVFS_BMI_addr_t *addr_array; char **fs_config_bufs; - char **server_config_bufs; int32_t *fs_config_buf_size; - int32_t *server_config_buf_size; }; /* flag to disable cached lookup during getattr nested sm */ --- 380,386 ---- Index: pvfs2/src/client/sysint/fs-add.sm diff -c pvfs2/src/client/sysint/fs-add.sm:1.15 pvfs2/src/client/sysint/fs-add.sm:1.16 *** pvfs2/src/client/sysint/fs-add.sm:1.15 Fri Apr 13 01:14:16 2007 --- pvfs2/src/client/sysint/fs-add.sm Fri Aug 17 00:04:24 2007 *************** *** 299,315 **** js_p->error_code = -PVFS_ENOMEM; return SM_ACTION_COMPLETE; } - sm_p->fetch_config.server_config_bufs = (char **) calloc(count, sizeof(char *)); - if (sm_p->fetch_config.server_config_bufs == NULL) - { - fprintf(stderr, "Could not allocate svc_configs\n"); - free(sm_p->fetch_config.addr_array); - sm_p->fetch_config.addr_array = NULL; - free(sm_p->fetch_config.fs_config_bufs); - sm_p->fetch_config.fs_config_bufs = NULL; - js_p->error_code = -PVFS_ENOMEM; - return SM_ACTION_COMPLETE; - } sm_p->fetch_config.fs_config_buf_size = (int *) calloc(count, sizeof(int)); if (sm_p->fetch_config.fs_config_buf_size == NULL) { --- 299,304 ---- *************** *** 318,340 **** sm_p->fetch_config.addr_array = NULL; free(sm_p->fetch_config.fs_config_bufs); sm_p->fetch_config.fs_config_bufs = NULL; - free(sm_p->fetch_config.server_config_bufs); - sm_p->fetch_config.server_config_bufs = NULL; - js_p->error_code = -PVFS_ENOMEM; - return SM_ACTION_COMPLETE; - } - sm_p->fetch_config.server_config_buf_size = (int *) calloc(count, sizeof(int)); - if (sm_p->fetch_config.server_config_buf_size == NULL) - { - fprintf(stderr, "Could not allocate svc_sizes\n"); - free(sm_p->fetch_config.addr_array); - sm_p->fetch_config.addr_array = NULL; - free(sm_p->fetch_config.fs_config_bufs); - sm_p->fetch_config.fs_config_bufs = NULL; - free(sm_p->fetch_config.server_config_bufs); - sm_p->fetch_config.server_config_bufs = NULL; - free(sm_p->fetch_config.fs_config_buf_size); - sm_p->fetch_config.fs_config_buf_size = NULL; js_p->error_code = -PVFS_ENOMEM; return SM_ACTION_COMPLETE; } --- 307,312 ---- *************** *** 348,359 **** sm_p->fetch_config.addr_array = NULL; free(sm_p->fetch_config.fs_config_bufs); sm_p->fetch_config.fs_config_bufs = NULL; - free(sm_p->fetch_config.server_config_bufs); - sm_p->fetch_config.server_config_bufs = NULL; free(sm_p->fetch_config.fs_config_buf_size); sm_p->fetch_config.fs_config_buf_size = NULL; - free(sm_p->fetch_config.server_config_buf_size); - sm_p->fetch_config.server_config_buf_size = NULL; js_p->error_code = -PVFS_ENOMEM; return SM_ACTION_COMPLETE; } --- 320,327 ---- *************** *** 447,454 **** { if (sm_p->fetch_config.fs_config_bufs && sm_p->fetch_config.fs_config_bufs[i]) free(sm_p->fetch_config.fs_config_bufs[i]); - if (sm_p->fetch_config.server_config_bufs && sm_p->fetch_config.server_config_bufs[i]) - free(sm_p->fetch_config.server_config_bufs[i]); if (sha1_fs_digests && sha1_fs_digests[i]) free(sha1_fs_digests[i]); } --- 415,420 ---- *************** *** 457,468 **** sm_p->fetch_config.addr_array = NULL; free(sm_p->fetch_config.fs_config_bufs); sm_p->fetch_config.fs_config_bufs = NULL; - free(sm_p->fetch_config.server_config_bufs); - sm_p->fetch_config.server_config_bufs = NULL; free(sm_p->fetch_config.fs_config_buf_size); sm_p->fetch_config.fs_config_buf_size = NULL; - free(sm_p->fetch_config.server_config_buf_size); - sm_p->fetch_config.server_config_buf_size = NULL; js_p->error_code = (ret == -PVFS_EOPNOTSUPP) ? 0 : ret; return 1; } --- 423,430 ---- Index: pvfs2/src/client/sysint/mgmt-get-config.c diff -c pvfs2/src/client/sysint/mgmt-get-config.c:1.4 pvfs2/src/client/sysint/mgmt-get-config.c:1.5 *** pvfs2/src/client/sysint/mgmt-get-config.c:1.4 Fri Apr 13 01:14:16 2007 --- pvfs2/src/client/sysint/mgmt-get-config.c Fri Aug 17 00:04:24 2007 *************** *** 30,38 **** const PVFS_fs_id * fsid, PVFS_BMI_addr_t * addr, char *fs_buf, ! int fs_buf_size, ! char *server_buf, ! int server_buf_size) { int ret = -PVFS_EINVAL; PINT_smcb *smcb = NULL; --- 30,36 ---- const PVFS_fs_id * fsid, PVFS_BMI_addr_t * addr, char *fs_buf, ! int fs_buf_size) { int ret = -PVFS_EINVAL; PINT_smcb *smcb = NULL; *************** *** 118,139 **** /* make sure strings will be null terminated after strncpy */ fs_buf[fs_buf_size-1] = '\0'; - server_buf[server_buf_size-1] = '\0'; /* The following copies the retrieved configuration buffers into the return buffers */ strncpy(fs_buf, sm_p->u.get_config.fs_config_buf, (fs_buf_size - 1)); - strncpy(server_buf, sm_p->u.get_config.server_config_buf, - (server_buf_size - 1)); exit_path: if (sm_p && sm_p->u.get_config.persist_config_buffers) { free(sm_p->u.get_config.fs_config_buf); - free(sm_p->u.get_config.server_config_buf); sm_p->u.get_config.fs_config_buf = NULL; - sm_p->u.get_config.server_config_buf = NULL; } PINT_mgmt_release(op_id); --- 116,132 ---- Index: pvfs2/src/client/sysint/server-get-config.sm diff -c pvfs2/src/client/sysint/server-get-config.sm:1.27 pvfs2/src/client/sysint/server-get-config.sm:1.28 *** pvfs2/src/client/sysint/server-get-config.sm:1.27 Fri Apr 13 01:14:16 2007 --- pvfs2/src/client/sysint/server-get-config.sm Fri Aug 17 00:04:24 2007 *************** *** 22,30 **** static int server_parse_config( struct server_configuration_s *config, char *fs_config_buf, ! uint32_t fs_config_buf_size, ! char *server_config_buf, ! uint32_t server_config_buf_size); /* state function prototypes */ static PINT_sm_action server_get_config_setup_msgpair( --- 22,28 ---- static int server_parse_config( struct server_configuration_s *config, char *fs_config_buf, ! uint32_t fs_config_buf_size); /* state function prototypes */ static PINT_sm_action server_get_config_setup_msgpair( *************** *** 213,247 **** static int server_parse_config( struct server_configuration_s *config, char *fs_config_buf, ! uint32_t fs_config_buf_size, ! char *server_config_buf, ! uint32_t server_config_buf_size) { int ret = 1, template_index = 1; ! int fs_fd = 0, server_fd = 0; char fs_template_array[2][64] = { ".__pvfs_fs_configXXXXXX", "/tmp/.__pvfs_fs_configXXXXXX" }; - char server_template_array[2][64] = - { - ".__pvfs_server_configXXXXXX", - "/tmp/.__pvfs_server_configXXXXXX" - }; char *fs_template = NULL; - char *server_template = NULL; if (config) { assert(fs_config_buf); - assert(server_config_buf); while(1) { assert(template_index > -1); fs_template = fs_template_array[template_index]; - server_template = server_template_array[template_index]; fs_fd = mkstemp(fs_template); if (fs_fd != -1) --- 211,235 ---- static int server_parse_config( struct server_configuration_s *config, char *fs_config_buf, ! uint32_t fs_config_buf_size) { int ret = 1, template_index = 1; ! int fs_fd = 0; char fs_template_array[2][64] = { ".__pvfs_fs_configXXXXXX", "/tmp/.__pvfs_fs_configXXXXXX" }; char *fs_template = NULL; if (config) { assert(fs_config_buf); while(1) { assert(template_index > -1); fs_template = fs_template_array[template_index]; fs_fd = mkstemp(fs_template); if (fs_fd != -1) *************** *** 256,289 **** } } - server_fd = mkstemp(server_template); - if (server_fd == -1) - { - close(fs_fd); - remove(fs_template); - gossip_err("mkstemp(%s) failed\n", server_template); - return ret; - } - assert(!fs_config_buf[fs_config_buf_size - 1]); - assert(!server_config_buf[server_config_buf_size - 1]); if (write(fs_fd,fs_config_buf, (fs_config_buf_size - 1)) == (fs_config_buf_size - 1)) { ! if (write(server_fd,server_config_buf, ! (server_config_buf_size - 1)) == ! (server_config_buf_size - 1)) ! { ! ret = PINT_parse_config( ! config, fs_template, server_template); ! } } close(fs_fd); - close(server_fd); remove(fs_template); - remove(server_template); } return ret; } --- 244,259 ---- } } assert(!fs_config_buf[fs_config_buf_size - 1]); if (write(fs_fd,fs_config_buf, (fs_config_buf_size - 1)) == (fs_config_buf_size - 1)) { ! ret = PINT_parse_config(config, fs_template, NULL); } close(fs_fd); remove(fs_template); } return ret; } *************** *** 334,343 **** if (sm_p && !sm_p->u.get_config.persist_config_buffers) { free(sm_p->u.get_config.fs_config_buf); - free(sm_p->u.get_config.server_config_buf); - sm_p->u.get_config.fs_config_buf = NULL; - sm_p->u.get_config.server_config_buf = NULL; } /* preserve js_p->error_code */ --- 304,310 ---- *************** *** 356,364 **** { ret = server_parse_config( sm_p->u.get_config.config, sm_p->u.get_config.fs_config_buf, ! sm_p->u.get_config.fs_config_buf_size, ! sm_p->u.get_config.server_config_buf, ! sm_p->u.get_config.server_config_buf_size); if (ret) { gossip_err("Failed to get_config from host %s\n", --- 323,329 ---- { ret = server_parse_config( sm_p->u.get_config.config, sm_p->u.get_config.fs_config_buf, ! sm_p->u.get_config.fs_config_buf_size); if (ret) { gossip_err("Failed to get_config from host %s\n", *************** *** 435,444 **** strdup(resp_p->u.getconfig.fs_config_buf); sm_p->u.get_config.fs_config_buf_size = resp_p->u.getconfig.fs_config_buf_size; - sm_p->u.get_config.server_config_buf = - strdup(resp_p->u.getconfig.server_config_buf); - sm_p->u.get_config.server_config_buf_size = - resp_p->u.getconfig.server_config_buf_size; } /* if this is the last response, check all of the status values --- 400,405 ---- *************** *** 466,478 **** */ #ifdef __GNUC__ static int PINT_fetch_config_list(int nservers, PVFS_BMI_addr_t *servers, ! char **fs_config_bufs, char **server_config_bufs, ! int *fs_config_buf_size, int *server_config_buf_size) __attribute__((unused)); #endif static int PINT_fetch_config_list(int nservers, PVFS_BMI_addr_t *servers, ! char **fs_config_bufs, char **server_config_bufs, ! int *fs_config_buf_size, int *server_config_buf_size) { int ret = -PVFS_EINVAL; PINT_smcb *smcb = NULL; --- 427,437 ---- */ #ifdef __GNUC__ static int PINT_fetch_config_list(int nservers, PVFS_BMI_addr_t *servers, ! char **fs_config_bufs, int *fs_config_buf_size) __attribute__((unused)); #endif static int PINT_fetch_config_list(int nservers, PVFS_BMI_addr_t *servers, ! char **fs_config_bufs, int *fs_config_buf_size) { int ret = -PVFS_EINVAL; PINT_smcb *smcb = NULL; *************** *** 483,490 **** gossip_debug(GOSSIP_CLIENT_DEBUG, "PINT_fetch_config_list entered\n"); ! if (nservers < 0 || !servers || !fs_config_bufs || !server_config_bufs ! || !fs_config_buf_size || !server_config_buf_size) { return ret; } --- 442,448 ---- gossip_debug(GOSSIP_CLIENT_DEBUG, "PINT_fetch_config_list entered\n"); ! if (nservers < 0 || !servers || !fs_config_bufs || !fs_config_buf_size) { return ret; } *************** *** 513,521 **** sm_p->fetch_config.nservers = nservers; sm_p->fetch_config.addr_array = servers; sm_p->fetch_config.fs_config_bufs = fs_config_bufs; - sm_p->fetch_config.server_config_bufs = server_config_bufs; sm_p->fetch_config.fs_config_buf_size = fs_config_buf_size; - sm_p->fetch_config.server_config_buf_size = server_config_buf_size; sm_p->msgarray_count = nservers; sm_p->msgarray = (PINT_sm_msgpair_state *) malloc( nservers * sizeof(PINT_sm_msgpair_state)); --- 471,477 ---- *************** *** 605,614 **** strdup(resp_p->u.getconfig.fs_config_buf); sm_p->fetch_config.fs_config_buf_size[i] = resp_p->u.getconfig.fs_config_buf_size; - sm_p->fetch_config.server_config_bufs[i] = - strdup(resp_p->u.getconfig.server_config_buf); - sm_p->fetch_config.server_config_buf_size[i] = - resp_p->u.getconfig.server_config_buf_size; } /* if this is the last response, check all of the status values --- 561,566 ---- Index: pvfs2/src/common/misc/fsck-utils.c diff -c pvfs2/src/common/misc/fsck-utils.c:1.3 pvfs2/src/common/misc/fsck-utils.c:1.4 *** pvfs2/src/common/misc/fsck-utils.c:1.3 Thu Mar 15 16:45:22 2007 --- pvfs2/src/common/misc/fsck-utils.c Fri Aug 17 00:04:24 2007 *************** *** 133,139 **** PVFS_BMI_addr_t *addresses = NULL; char *fs_config = NULL; char *fs_config_diff = NULL; - char *server_config = NULL; char *reference_config_server = NULL; const char *server_name = NULL; struct server_configuration_s *server_config_struct = NULL; --- 133,138 ---- *************** *** 198,216 **** return -PVFS_ENOMEM; } - server_config = calloc(SERVER_CONFIG_BUFFER_SIZE, sizeof(char)); - if (server_config == NULL) - { - free(addresses); - free(fs_config); - return -PVFS_ENOMEM; - } - ret = PVFS_mgmt_get_config(cur_fs, &addresses[i], fs_config, ! FS_CONFIG_BUFFER_SIZE, ! server_config, SERVER_CONFIG_BUFFER_SIZE); if (ret < 0) { PVFS_perror_gossip("PVFS_mgmt_get_config", ret); --- 197,206 ---- return -PVFS_ENOMEM; } ret = PVFS_mgmt_get_config(cur_fs, &addresses[i], fs_config, ! FS_CONFIG_BUFFER_SIZE); if (ret < 0) { PVFS_perror_gossip("PVFS_mgmt_get_config", ret); *************** *** 218,229 **** i, num_servers); free(addresses); free(fs_config); - free(server_config); return(ret); } - - /* don't need this guy */ - free(server_config); if (i == 0) { --- 208,215 ---- Index: pvfs2/src/common/misc/msgpairarray.sm diff -c pvfs2/src/common/misc/msgpairarray.sm:1.42 pvfs2/src/common/misc/msgpairarray.sm:1.43 *** pvfs2/src/common/misc/msgpairarray.sm:1.42 Tue May 8 17:08:54 2007 --- pvfs2/src/common/misc/msgpairarray.sm Fri Aug 17 00:04:24 2007 *************** *** 106,112 **** static PINT_sm_action msgpairarray_init( struct PINT_smcb *smcb, job_status_s *js_p) { ! struct PINT_client_sm *sm_p = PINT_sm_frame(smcb, PINT_FRAME_CURRENT); int i = 0; PINT_sm_msgpair_state *msg_p = NULL; --- 106,112 ---- static PINT_sm_action msgpairarray_init( struct PINT_smcb *smcb, job_status_s *js_p) { ! PARENT_SM *sm_p = PINT_sm_frame(smcb, PINT_FRAME_CURRENT); int i = 0; PINT_sm_msgpair_state *msg_p = NULL; *************** *** 156,162 **** static PINT_sm_action msgpairarray_post( struct PINT_smcb *smcb, job_status_s *js_p) { ! struct PINT_client_sm *sm_p = PINT_sm_frame(smcb, PINT_FRAME_CURRENT); int ret = -PVFS_EINVAL, i = 0, tmp = 0; struct server_configuration_s *server_config = NULL; PVFS_msg_tag_t session_tag; --- 156,162 ---- static PINT_sm_action msgpairarray_post( struct PINT_smcb *smcb, job_status_s *js_p) { ! PARENT_SM *sm_p = PINT_sm_frame(smcb, PINT_FRAME_CURRENT); int ret = -PVFS_EINVAL, i = 0, tmp = 0; struct server_configuration_s *server_config = NULL; PVFS_msg_tag_t session_tag; *************** *** 401,407 **** static PINT_sm_action msgpairarray_post_retry( struct PINT_smcb *smcb, job_status_s *js_p) { ! struct PINT_client_sm *sm_p = PINT_sm_frame(smcb, PINT_FRAME_CURRENT); job_id_t tmp_id; gossip_debug(GOSSIP_MSGPAIR_DEBUG, "%s: sm %p, wait %d ms\n", --- 401,407 ---- static PINT_sm_action msgpairarray_post_retry( struct PINT_smcb *smcb, job_status_s *js_p) { ! PARENT_SM *sm_p = PINT_sm_frame(smcb, PINT_FRAME_CURRENT); job_id_t tmp_id; gossip_debug(GOSSIP_MSGPAIR_DEBUG, "%s: sm %p, wait %d ms\n", *************** *** 417,423 **** static PINT_sm_action msgpairarray_complete( struct PINT_smcb *smcb, job_status_s *js_p) { ! struct PINT_client_sm *sm_p = PINT_sm_frame(smcb, PINT_FRAME_CURRENT); gossip_debug(GOSSIP_MSGPAIR_DEBUG, "%s: sm %p status_user_tag %d msgarray_count %d\n", __func__, smcb, (int) js_p->status_user_tag, sm_p->msgarray_count); --- 417,423 ---- static PINT_sm_action msgpairarray_complete( struct PINT_smcb *smcb, job_status_s *js_p) { ! PARENT_SM *sm_p = PINT_sm_frame(smcb, PINT_FRAME_CURRENT); gossip_debug(GOSSIP_MSGPAIR_DEBUG, "%s: sm %p status_user_tag %d msgarray_count %d\n", __func__, smcb, (int) js_p->status_user_tag, sm_p->msgarray_count); *************** *** 488,494 **** static PINT_sm_action msgpairarray_completion_fn( struct PINT_smcb *smcb, job_status_s *js_p) { ! struct PINT_client_sm *sm_p = PINT_sm_frame(smcb, PINT_FRAME_CURRENT); int ret = -PVFS_EINVAL, i = 0; int need_retry = 0; struct PINT_decoded_msg decoded_resp; --- 488,494 ---- static PINT_sm_action msgpairarray_completion_fn( struct PINT_smcb *smcb, job_status_s *js_p) { ! PARENT_SM *sm_p = PINT_sm_frame(smcb, PINT_FRAME_CURRENT); int ret = -PVFS_EINVAL, i = 0; int need_retry = 0; struct PINT_decoded_msg decoded_resp; Index: pvfs2/src/common/misc/server-config.c diff -c pvfs2/src/common/misc/server-config.c:1.103 pvfs2/src/common/misc/server-config.c:1.104 *** pvfs2/src/common/misc/server-config.c:1.103 Wed Aug 15 14:43:08 2007 --- pvfs2/src/common/misc/server-config.c Fri Aug 17 00:04:24 2007 *************** *** 33,39 **** static const char * replace_old_keystring(const char * oldkey); - static DOTCONF_CB(get_pvfs_server_id); static DOTCONF_CB(get_logstamp); static DOTCONF_CB(get_storage_space); static DOTCONF_CB(enter_defaults_context); --- 33,38 ---- *************** *** 50,55 **** --- 49,56 ---- static DOTCONF_CB(exit_storage_hints_context); static DOTCONF_CB(enter_export_options_context); static DOTCONF_CB(exit_export_options_context); + static DOTCONF_CB(enter_server_options_context); + static DOTCONF_CB(exit_server_options_context); static DOTCONF_CB(enter_mhranges_context); static DOTCONF_CB(exit_mhranges_context); static DOTCONF_CB(enter_dhranges_context); *************** *** 68,73 **** --- 69,75 ---- static DOTCONF_CB(get_event_logging_list); static DOTCONF_CB(get_filesystem_collid); static DOTCONF_CB(get_alias_list); + static DOTCONF_CB(check_this_server); #ifdef USE_TRUSTED static DOTCONF_CB(get_trusted_portlist); static DOTCONF_CB(get_trusted_network); *************** *** 122,129 **** struct filesystem_configuration_s *src_fs); static int cache_config_files( struct server_configuration_s *config_s, ! char *global_config_filename, ! char *server_config_filename); static int is_populated_filesystem_configuration( struct filesystem_configuration_s *fs); static int is_root_handle_in_a_meta_range( --- 124,130 ---- struct filesystem_configuration_s *src_fs); static int cache_config_files( struct server_configuration_s *config_s, ! char *global_config_filename); static int is_populated_filesystem_configuration( struct filesystem_configuration_s *fs); static int is_root_handle_in_a_meta_range( *************** *** 154,164 **** /* PVFS2 servers are deployed using configuration files that provide information * about the file systems, storage locations and endpoints that each server ! * manages. For every pvfs2 deployment, there is a global config file ! * (fs.conf) shared between all of the pvfs2 servers, as well as ! * per-server config files (server.conf) that contain config options ! * unique to that server (such as host/port endpoint). Configuration options ! * in both the global and server specific config files have the following format: * *
   * OptionName OptionValue
--- 155,166 ----
  
  /* PVFS2 servers are deployed using configuration files that provide information
   * about the file systems, storage locations and endpoints that each server
!  * manages.  For every pvfs2 deployment, there should be a global config file
!  * (fs.conf) shared across all of the pvfs2 servers. When the servers
!  * are started up, a command line parameter (server-alias) indicates what options
!  * are relevant and applicable for a particular server.
!  * This parameter will be used by the server to parse relevant options.
!  * Configuration options in the global config files have the following format:
   * 
   * 
   * OptionName OptionValue
***************
*** 197,204 ****
   *
   * Options and contexts that appear in the top-level (not defined within
   * another context) are considered to be defined in a special Global
!  * context.  Many options are only specified to appear within either the
!  * Global context or the Default context, 
   * which is a context that allows a default value to be specified for certain
   * options.
   *
--- 199,206 ----
   *
   * Options and contexts that appear in the top-level (not defined within
   * another context) are considered to be defined in a special Global
!  * context.  Many options are only specified to appear within
!  * the Default context, 
   * which is a context that allows a default value to be specified for certain
   * options.
   *
***************
*** 210,238 ****
   */
  static const configoption_t options[] =
  {
-     /* 
-      * Specifies a string identifier for the pvfs2 server that is to be
-      * run on this host.  This option is required for each per-server config
-      * file.  The format of this string is:
-      *
-      * {transport}://{hostname}:{port}
-      *
-      * Where {transport} is one of the possible BMI transport modules
-      * (tcp, ib, gm).  Example:
-      *
-      * tcp://myhost.mydn:12345
-      *
-      */
-     {"HostID",ARG_STR, get_pvfs_server_id,NULL,CTX_GLOBAL,NULL},
-     
-     /* Specifies the local path for the pvfs2 server to use as storage space.
-      * This option is required for each per-server config file.
-      * Example:
-      *
-      * /tmp/pvfs.storage
-      */
-     {"StorageSpace",ARG_STR, get_storage_space,NULL,CTX_GLOBAL,NULL},
- 
      /* Options specified within the Defaults context are used as 
       * default values over all the pvfs2 server specific config files.
       */
--- 212,217 ----
***************
*** 306,311 ****
--- 285,331 ----
       */
      {"Alias",ARG_LIST, get_alias_list,NULL,CTX_ALIASES,NULL},
  
+     /* Defines the server alias for the server specific options that
+      * are to be set within the ServerOptions context.
+      */
+     {"Server", ARG_STR, check_this_server, NULL, CTX_SERVER_OPTIONS, NULL},
+ 
+     /* This groups the Server specific options.
+      *
+      * The ServerOptions context should be defined after the Alias mappings 
+      * have been defined. The reason is that the ServerOptions context is
+      * defined in terms of the aliases defined in that context.
+      *
+      * Default options applicable to all servers can be overridden on
+      * a per-server basis in the ServerOptions context.
+      * To illustrate:
+      * Suppose the Option name is X, its default value is Y,
+      * and one wishes to override the option for a server to Y'.
+      *
+      * 
+      *     ..
+      *     X  Y
+      *     ..
+      * 
+      *
+      * 
+      *     Server {server alias}
+      *     ..
+      *     X Y'
+      *     ..
+      * 
+      *
+      * The ServerOptions context REQUIRES the Server option specify
+      * the server alias, which sets the remaining options specified
+      * in the context for that server.
+     */
+     {"",ARG_NONE,enter_server_options_context,NULL,
+         CTX_GLOBAL, NULL},
+     /* Specifies the end-tag of the ServerOptions context.
+      */
+     {"",ARG_NONE,exit_server_options_context,NULL,
+         CTX_SERVER_OPTIONS,NULL},
+ 
      /* This groups options specific to a filesystem.  A pvfs2 server may manage
       * more than one filesystem, so a config file may have more than
       * one Filesystem context, each defining the parameters of a different
***************
*** 461,467 ****
       * concurrently 
       */
      {"TroveMaxConcurrentIO", ARG_INT, get_trove_max_concurrent_io, NULL,
!         CTX_DEFAULTS|CTX_GLOBAL,"16"},
  
      /* The gossip interface in pvfs allows users to specify different
       * levels of logging for the pvfs server.  The output of these
--- 481,487 ----
       * concurrently 
       */
      {"TroveMaxConcurrentIO", ARG_INT, get_trove_max_concurrent_io, NULL,
!         CTX_DEFAULTS|CTX_SERVER_OPTIONS,"16"},
  
      /* The gossip interface in pvfs allows users to specify different
       * levels of logging for the pvfs server.  The output of these
***************
*** 472,478 ****
       * a particular server in the Global context.
       */
      {"LogFile",ARG_STR, get_logfile,NULL,
!         CTX_DEFAULTS|CTX_GLOBAL,"/tmp/pvfs2-server.log"},
  
      /* The LogType option can be used to control the destination of log 
       * messages from PVFS2 server.  The default value is "file", which causes
--- 492,498 ----
       * a particular server in the Global context.
       */
      {"LogFile",ARG_STR, get_logfile,NULL,
!         CTX_DEFAULTS|CTX_SERVER_OPTIONS,"/tmp/pvfs2-server.log"},
  
      /* The LogType option can be used to control the destination of log 
       * messages from PVFS2 server.  The default value is "file", which causes
***************
*** 481,487 ****
       * to be written to syslog.
       */
      {"LogType",ARG_STR, get_logtype,NULL,
!         CTX_DEFAULTS|CTX_GLOBAL,"file"},
  
      /* The gossip interface in pvfs allows users to specify different
       * levels of logging for the pvfs server.  This option sets that level for
--- 501,507 ----
       * to be written to syslog.
       */
      {"LogType",ARG_STR, get_logtype,NULL,
!         CTX_DEFAULTS|CTX_SERVER_OPTIONS,"file"},
  
      /* The gossip interface in pvfs allows users to specify different
       * levels of logging for the pvfs server.  This option sets that level for
***************
*** 502,520 ****
       * EventLogging -flow,-flowproto
       */
      {"EventLogging",ARG_LIST, get_event_logging_list,NULL,
!         CTX_DEFAULTS|CTX_GLOBAL,"none,"},
  
      /* At startup each pvfs server allocates space for a set number
       * of incoming requests to prevent the allocation delay at the beginning
       * of each unexpected request.  This parameter specifies the number
       * of requests for which to allocate space.
       *
!      * If set in the Defaults context, its value will be used for all servers.
!      * The default value can also be overwritten by setting a separate value
!      * in the Global context.
       */
       {"UnexpectedRequests",ARG_INT, get_unexp_req,NULL,
!          CTX_DEFAULTS|CTX_GLOBAL,"50"},
  
       /* Current implementations of TCP on most systems use a window
        * size that is too small for almost all uses of pvfs.  
--- 522,554 ----
       * EventLogging -flow,-flowproto
       */
      {"EventLogging",ARG_LIST, get_event_logging_list,NULL,
!         CTX_DEFAULTS|CTX_SERVER_OPTIONS,"none,"},
  
      /* At startup each pvfs server allocates space for a set number
       * of incoming requests to prevent the allocation delay at the beginning
       * of each unexpected request.  This parameter specifies the number
       * of requests for which to allocate space.
       *
!      * A default value is set in the Defaults context which will be be used 
!      * for all servers. 
!      * However, the default value can also be overwritten by setting a separate value
!      * in the ServerOptions context using the Option tag.
       */
       {"UnexpectedRequests",ARG_INT, get_unexp_req,NULL,
!          CTX_DEFAULTS|CTX_SERVER_OPTIONS,"50"},
! 
!     /* Specifies the local path for the pvfs2 server to use as storage space.
!      * This option specifies the default path for all servers and will appear
!      * in the Defaults context.
!      *
!      * NOTE: This can be overridden in the  tag on a per-server
!      * basis. Look at the "Option" tag for more details
!      * Example:
!      *
!      * StorageSpace /tmp/pvfs.storage
!      */
!     {"StorageSpace",ARG_STR, get_storage_space,NULL,
!         CTX_DEFAULTS|CTX_SERVER_OPTIONS,NULL},
  
       /* Current implementations of TCP on most systems use a window
        * size that is too small for almost all uses of pvfs.  
***************
*** 536,592 ****
        * PSC networking options for details.
        */
       {"TCPBufferSend",ARG_INT, get_tcp_buffer_send,NULL,
!          CTX_DEFAULTS|CTX_GLOBAL,"0"},
  
       /* See the TCPBufferSend option.
        */
        {"TCPBufferReceive",ARG_INT, get_tcp_buffer_receive,NULL,
!          CTX_DEFAULTS|CTX_GLOBAL,"0"},
  
       /* If enabled, specifies that the server should bind its port only on
        * the specified address (rather than INADDR_ANY)
        */
       {"TCPBindSpecific",ARG_STR, get_tcp_bind_specific,NULL,
!         CTX_DEFAULTS|CTX_GLOBAL,"no"},
  
       /* Specifies the timeout value in seconds for BMI jobs on the server.
        */
       {"ServerJobBMITimeoutSecs",ARG_INT, get_server_job_bmi_timeout,NULL,
!          CTX_DEFAULTS|CTX_GLOBAL, "300"},
       
       /* Specifies the timeout value in seconds for TROVE jobs on the server.
        */
       {"ServerJobFlowTimeoutSecs",ARG_INT, get_server_job_flow_timeout,NULL,
!          CTX_DEFAULTS|CTX_GLOBAL, "300"},
       
       /* Specifies the timeout value in seconds for BMI jobs on the client.
        */
       {"ClientJobBMITimeoutSecs",ARG_INT, get_client_job_bmi_timeout,NULL,
!          CTX_DEFAULTS|CTX_GLOBAL, "300"},
  
       /* Specifies the timeout value in seconds for FLOW jobs on the client.
        */
       {"ClientJobFlowTimeoutSecs",ARG_INT, get_client_job_flow_timeout,NULL,
!          CTX_DEFAULTS|CTX_GLOBAL, "300"},
  
       /* Specifies the number of retry attempts for operations (when possible)
        */
       {"ClientRetryLimit",ARG_INT, get_client_retry_limit,NULL,
!          CTX_DEFAULTS|CTX_GLOBAL, "5"},
  
       /* Specifies the delay in milliseconds to wait between retries.
        */
       {"ClientRetryDelayMilliSecs",ARG_INT, get_client_retry_delay,NULL,
!          CTX_DEFAULTS|CTX_GLOBAL, "2000"},
  
       /* This specifies the frequency (in milliseconds) 
        * that performance monitor should be updated
        * when the pvfs server is running in admin mode.
        *
!       * Can be set in either Default or Global contexts.
        */
      {"PerfUpdateInterval",ARG_INT, get_perf_update_interval,NULL,
!         CTX_DEFAULTS|CTX_GLOBAL,"1000"},
  
      /* List the BMI modules to load when the server is started.  At present,
       * only tcp, infiniband, and myrinet are valid BMI modules.  
--- 570,626 ----
        * PSC networking options for details.
        */
       {"TCPBufferSend",ARG_INT, get_tcp_buffer_send,NULL,
!          CTX_DEFAULTS,"0"},
  
       /* See the TCPBufferSend option.
        */
        {"TCPBufferReceive",ARG_INT, get_tcp_buffer_receive,NULL,
!          CTX_DEFAULTS,"0"},
  
       /* If enabled, specifies that the server should bind its port only on
        * the specified address (rather than INADDR_ANY)
        */
       {"TCPBindSpecific",ARG_STR, get_tcp_bind_specific,NULL,
!         CTX_DEFAULTS|CTX_SERVER_OPTIONS,"no"},
  
       /* Specifies the timeout value in seconds for BMI jobs on the server.
        */
       {"ServerJobBMITimeoutSecs",ARG_INT, get_server_job_bmi_timeout,NULL,
!          CTX_DEFAULTS|CTX_SERVER_OPTIONS, "300"},
       
       /* Specifies the timeout value in seconds for TROVE jobs on the server.
        */
       {"ServerJobFlowTimeoutSecs",ARG_INT, get_server_job_flow_timeout,NULL,
!          CTX_DEFAULTS|CTX_SERVER_OPTIONS, "300"},
       
       /* Specifies the timeout value in seconds for BMI jobs on the client.
        */
       {"ClientJobBMITimeoutSecs",ARG_INT, get_client_job_bmi_timeout,NULL,
!          CTX_DEFAULTS, "300"},
  
       /* Specifies the timeout value in seconds for FLOW jobs on the client.
        */
       {"ClientJobFlowTimeoutSecs",ARG_INT, get_client_job_flow_timeout,NULL,
!          CTX_DEFAULTS, "300"},
  
       /* Specifies the number of retry attempts for operations (when possible)
        */
       {"ClientRetryLimit",ARG_INT, get_client_retry_limit,NULL,
!          CTX_DEFAULTS, "5"},
  
       /* Specifies the delay in milliseconds to wait between retries.
        */
       {"ClientRetryDelayMilliSecs",ARG_INT, get_client_retry_delay,NULL,
!          CTX_DEFAULTS, "2000"},
  
       /* This specifies the frequency (in milliseconds) 
        * that performance monitor should be updated
        * when the pvfs server is running in admin mode.
        *
!       * Can be set in either Default or ServerOptions contexts.
        */
      {"PerfUpdateInterval",ARG_INT, get_perf_update_interval,NULL,
!         CTX_DEFAULTS,"1000"},
  
      /* List the BMI modules to load when the server is started.  At present,
       * only tcp, infiniband, and myrinet are valid BMI modules.  
***************
*** 602,612 ****
       *
       * Note that only the bmi modules compiled into pvfs should be
       * specified in this list.  The BMIModules option can be specified
!      * in either the Defaults or Global contexts.
       */
!     {"BMIModules",ARG_LIST, get_bmi_module_list,NULL,
!         CTX_DEFAULTS|CTX_GLOBAL,NULL},
!     
      /* List the flow modules to load when the server is started.  The modules
       * available for loading currently are:
       *
--- 636,645 ----
       *
       * Note that only the bmi modules compiled into pvfs should be
       * specified in this list.  The BMIModules option can be specified
!      * in either the Defaults or ServerOptions contexts.
       */
!     {"BMIModules",ARG_LIST, get_bmi_module_list,NULL, CTX_DEFAULTS,NULL},
! 
      /* List the flow modules to load when the server is started.  The modules
       * available for loading currently are:
       *
***************
*** 626,632 ****
       *
       */
      {"FlowModules",ARG_LIST, get_flow_module_list,NULL,
!         CTX_DEFAULTS|CTX_GLOBAL,"flowproto_multiqueue,"},
  
      /* buffer size to use for bulk data transfers */
      {"FlowBufferSizeBytes", ARG_INT,
--- 659,686 ----
       *
       */
      {"FlowModules",ARG_LIST, get_flow_module_list,NULL,
!         CTX_DEFAULTS,"flowproto_multiqueue,"},
! 
!     /* Specifies the format of the date/timestamp that events will have
!      * in the event log.  Possible values are:
!      *
!      * usec: [%H:%M:%S.%U]
!      *
!      * datetime: [%m/%d %H:%M]
!      *
!      * thread: [%H:%M:%S.%U (%lu)]
!      *
!      * none
!      *
!      * The format of the option is one of the above values.  For example,
!      *
!      * LogStamp datetime
!      */
!     {"LogStamp",ARG_STR, get_logstamp,NULL,
!         CTX_DEFAULTS|CTX_SERVER_OPTIONS,"usec"},
! 
!     /* --- end default options for all servers */
!     
  
      /* buffer size to use for bulk data transfers */
      {"FlowBufferSizeBytes", ARG_INT,
***************
*** 636,679 ****
      {"FlowBuffersPerFlow", ARG_INT,
           get_flow_buffers_per_flow, NULL, CTX_FILESYSTEM,"8"},
  
!     /* Define options that will influence the way a file-system gets exported
       * to the rest of the world.
       */
  
!     /* RootSquash option specifies whether the exported file-system needs to squash accesses
!      * by root. This is an optional parameter that needs to be specified as part of the ExportOptions
!      * context and is a list of BMI URL specification of client addresses for which RootSquash
!      * has to be enforced. 
       * RootSquash tcp://192.168.2.0@24 tcp://10.0.0.* tcp://192.168.* ...
       */
      {"RootSquash", ARG_LIST, get_root_squash, NULL,
          CTX_EXPORT, ""},
  
!     /* ReadOnly option specifies whether the exported file-system needs to disallow write accesses
!      * from clients or anything that modifies the state of the file-system.
!      * This is an optional parameter that needs to be specified as part of the ExportOptions
!      * context and is a list of BMI URL specification of client addresses for which ReadOnly
!      * has to be enforced.
       * ReadOnly tcp://192.168.2.0@24 tcp://10.0.0.* tcp://192.168.* ...
       */
      {"ReadOnly", ARG_LIST,  get_read_only,    NULL,
          CTX_EXPORT, ""},
  
!     /* AllSquash option specifies whether the exported file-system needs to squash all accesses
!      * to the file-system to a specified uid/gid!
!      * This is an optional parameter that needs to be specified as part of the ExportOptions
!      * context and is a list of BMI URL specification of client addresses for which AllSquash
!      * has to be enforced.
       * AllSquash tcp://192.168.2.0@24 tcp://10.0.0.* tcp://192.168.* ...
       */
      {"AllSquash", ARG_LIST, get_all_squash,   NULL,
          CTX_EXPORT, ""},
  
!     /* AnonUID and AnonGID are 2 integers that tell the servers to translate the requesting clients'
!      * uid/gid to the specified ones whenever AllSquash is specified!
!      * If these are not specified and AllSquash is specified then the uid used will be
!      * that of nobody and gid that of nobody
       */
      {"AnonUID",  ARG_STR,  get_anon_uid,     NULL,
          CTX_EXPORT, "65534"},
      {"AnonGID",  ARG_STR,  get_anon_gid,     NULL,
--- 690,749 ----
      {"FlowBuffersPerFlow", ARG_INT,
           get_flow_buffers_per_flow, NULL, CTX_FILESYSTEM,"8"},
  
!     /* 
!      * File-system export options
!      *
!      * Define options that will influence the way a file-system gets exported
       * to the rest of the world.
       */
  
!     /* RootSquash option specifies whether the exported file-system needs to
!     *  squash accesses by root. This is an optional parameter that needs 
!     *  to be specified as part of the ExportOptions
!      * context and is a list of BMI URL specification of client addresses 
!      * for which RootSquash has to be enforced. 
!      *
       * RootSquash tcp://192.168.2.0@24 tcp://10.0.0.* tcp://192.168.* ...
       */
      {"RootSquash", ARG_LIST, get_root_squash, NULL,
          CTX_EXPORT, ""},
  
!     /* ReadOnly option specifies whether the exported file-system needs to
!     *  disallow write accesses from clients or anything that modifies the 
!     *  state of the file-system.
!      * This is an optional parameter that needs to be specified as part of 
!      * the ExportOptions context and is a list of BMI URL specification of 
!      * client addresses for which ReadOnly has to be enforced.
!      * An example: 
!      *
       * ReadOnly tcp://192.168.2.0@24 tcp://10.0.0.* tcp://192.168.* ...
       */
      {"ReadOnly", ARG_LIST,  get_read_only,    NULL,
          CTX_EXPORT, ""},
  
!     /* AllSquash option specifies whether the exported file-system needs to 
!     *  squash all accesses to the file-system to a specified uid/gid!
!      * This is an optional parameter that needs to be specified as part of 
!      * the ExportOptions context and is a list of BMI URL specification of client 
!      * addresses for which AllSquash has to be enforced.
!      * An example:
!      *
       * AllSquash tcp://192.168.2.0@24 tcp://10.0.0.* tcp://192.168.* ...
       */
      {"AllSquash", ARG_LIST, get_all_squash,   NULL,
          CTX_EXPORT, ""},
  
!     /* AnonUID and AnonGID are 2 integers that tell the servers to translate 
!     *  the requesting clients' uid/gid to the specified ones whenever AllSquash
!     *  is specified!
!      * If these are not specified and AllSquash is specified then the uid used 
!      * will be that of nobody and gid that of nobody.
!      * An example:
!      *
!      * AnonUID 3454
!      * AnonGID 3454
       */
+ 
      {"AnonUID",  ARG_STR,  get_anon_uid,     NULL,
          CTX_EXPORT, "65534"},
      {"AnonGID",  ARG_STR,  get_anon_gid,     NULL,
***************
*** 763,786 ****
      {"DBCacheType", ARG_STR, get_db_cache_type, NULL,
          CTX_STORAGEHINTS, "sys"},
  
-     /* Specifies the format of the date/timestamp that events will have
-      * in the event log.  Possible values are:
-      *
-      * usec: [%H:%M:%S.%U]
-      *
-      * datetime: [%m/%d %H:%M]
-      *
-      * thread: [%H:%M:%S.%U (%lu)]
-      *
-      * none
-      *
-      * The format of the option is one of the above values.  For example,
-      *
-      * LogStamp datetime
-      */
-     {"LogStamp",ARG_STR, get_logstamp,NULL,
-         CTX_DEFAULTS|CTX_GLOBAL,"usec"},
-     
      /* This option specifies a parameter name to be passed to the 
       * distribution to be used.  This option should be immediately
       * followed by a Value option.
--- 833,838 ----
***************
*** 827,833 ****
       * StorageHints context for that filesystem.
       */
      {"TroveMethod", ARG_STR, get_trove_method, NULL, 
!         CTX_DEFAULTS|CTX_GLOBAL|CTX_STORAGEHINTS, "dbpf"},
  
      /* Specifies the file system's key for use in HMAC-based digests of
       * client operations.
--- 879,885 ----
       * StorageHints context for that filesystem.
       */
      {"TroveMethod", ARG_STR, get_trove_method, NULL, 
!         CTX_DEFAULTS|CTX_STORAGEHINTS, "dbpf"},
  
      /* Specifies the file system's key for use in HMAC-based digests of
       * client operations.
***************
*** 843,849 ****
   * Params:   struct server_configuration_s*,
   *           global_config_filename - common config file for all servers
   *                                    and clients
!  *           server_config_filename - config file specific to one server
   *                                    (ignored on client side)
   *
   * Returns:  0 on success; 1 on failure
--- 895,901 ----
   * Params:   struct server_configuration_s*,
   *           global_config_filename - common config file for all servers
   *                                    and clients
!  *           server_alias_name      - alias (if any) provided for this server
   *                                    (ignored on client side)
   *
   * Returns:  0 on success; 1 on failure
***************
*** 852,858 ****
  int PINT_parse_config(
      struct server_configuration_s *config_obj,
      char *global_config_filename,
!     char *server_config_filename)
  {
      struct server_configuration_s *config_s;
      configfile_t *configfile = (configfile_t *)0;
--- 904,910 ----
  int PINT_parse_config(
      struct server_configuration_s *config_obj,
      char *global_config_filename,
!     char *server_alias_name)
  {
      struct server_configuration_s *config_s;
      configfile_t *configfile = (configfile_t *)0;
***************
*** 867,872 ****
--- 919,925 ----
      config_s = config_obj;
      memset(config_s, 0, sizeof(struct server_configuration_s));
  
+     config_s->server_alias = server_alias_name;
      /* set some global defaults for optional parameters */
      config_s->logstamp_type = GOSSIP_LOGSTAMP_DEFAULT;
      config_s->server_job_bmi_timeout = PVFS2_SERVER_JOB_BMI_TIMEOUT_DEFAULT;
***************
*** 877,891 ****
      config_s->client_retry_delay_ms = PVFS2_CLIENT_RETRY_DELAY_MS_DEFAULT;
      config_s->trove_max_concurrent_io = 16;
  
!     if (cache_config_files(
!             config_s, global_config_filename, server_config_filename))
      {
          return 1;
      }
      assert(config_s->fs_config_buflen && config_s->fs_config_buf);
-     assert(config_s->server_config_buflen && config_s->server_config_buf);
  
!     /* first read in the fs.conf defaults config file */
      config_s->configuration_context = CTX_GLOBAL;
      configfile = PINT_dotconf_create(config_s->fs_config_filename,
                                       options, (void *)config_s, 
--- 930,942 ----
      config_s->client_retry_delay_ms = PVFS2_CLIENT_RETRY_DELAY_MS_DEFAULT;
      config_s->trove_max_concurrent_io = 16;
  
!     if (cache_config_files(config_s, global_config_filename))
      {
          return 1;
      }
      assert(config_s->fs_config_buflen && config_s->fs_config_buf);
  
!     /* read in the fs.conf defaults config file */
      config_s->configuration_context = CTX_GLOBAL;
      configfile = PINT_dotconf_create(config_s->fs_config_filename,
                                       options, (void *)config_s, 
***************
*** 896,901 ****
--- 947,953 ----
                     config_s->fs_config_filename);
          return 1;
      }
+     config_s->private_data = configfile;
      configfile->errorhandler = (dotconf_errorhandler_t)errorhandler;
      configfile->contextchecker = (dotconf_contextchecker_t)contextchecker;
      
***************
*** 906,942 ****
      }
      PINT_dotconf_cleanup(configfile);
  
!     /* then read in the server.conf (host specific) config file */
!     config_s->configuration_context = CTX_GLOBAL;
!     configfile = PINT_dotconf_create(config_s->server_config_filename,
!                                 options, (void *)config_s, CASE_INSENSITIVE);
!     if (!configfile)
      {
!         gossip_err("Error opening config file: %s\n",
!                    config_s->server_config_filename);
!         return 1;
!     }
!     configfile->errorhandler = (dotconf_errorhandler_t)errorhandler;
!     configfile->contextchecker = (dotconf_contextchecker_t)contextchecker;
! 
!     if (PINT_dotconf_command_loop(configfile) == 0)
!     {
!         /* NOTE: dotconf error handler will log message */
!         return 1;
!     }
!     PINT_dotconf_cleanup(configfile);
! 
!     if (!config_s->host_id)
!     {
!         gossip_err("Configuration file error. "
!                    "No host ID specified.\n");
!         return 1;
      }
  
!     if (!config_s->storage_path)
      {
          gossip_err("Configuration file error. "
!                    "No storage path specified.\n");
          return 1;
      }
  
--- 958,981 ----
      }
      PINT_dotconf_cleanup(configfile);
  
!     if (server_alias_name) 
      {
!         struct host_alias_s *halias;
!         halias = find_host_alias_ptr_by_alias(
!                                 config_s, server_alias_name);
!         if (!halias || !halias->bmi_address) 
!         {
!             gossip_err("Configuration file error. "
!                        "No host ID specified for alias %s.\n", server_alias_name);
!             return 1;
!         }
!         config_s->host_id = strdup(halias->bmi_address);
      }
  
!     if (server_alias_name && !config_s->storage_path)
      {
          gossip_err("Configuration file error. "
!                    "No storage path specified for alias %s.\n", server_alias_name);
          return 1;
      }
  
***************
*** 985,1009 ****
      return(1);
  }
  
- DOTCONF_CB(get_pvfs_server_id)
- {
-     struct server_configuration_s *config_s = 
-         (struct server_configuration_s *)cmd->context;
-     if (config_s->host_id)
-     {
-         gossip_err("WARNING: HostID value being overwritten (from "
-                    "%s to %s).\n",config_s->host_id,cmd->data.str);
-         free(config_s->host_id);
-     }
-     config_s->host_id = (cmd->data.str ? strdup(cmd->data.str) : NULL);
-     return NULL;
- }
- 
  DOTCONF_CB(get_logstamp)
  {
      struct server_configuration_s *config_s = 
          (struct server_configuration_s *)cmd->context;
  
      if(!strcmp(cmd->data.str, "none"))
      {
          config_s->logstamp_type = GOSSIP_LOGSTAMP_NONE;
--- 1024,1039 ----
      return(1);
  }
  
  DOTCONF_CB(get_logstamp)
  {
      struct server_configuration_s *config_s = 
          (struct server_configuration_s *)cmd->context;
  
+     if(config_s->configuration_context == CTX_SERVER_OPTIONS &&
+        config_s->my_server_options == 0)
+     {
+         return NULL;
+     }
      if(!strcmp(cmd->data.str, "none"))
      {
          config_s->logstamp_type = GOSSIP_LOGSTAMP_NONE;
***************
*** 1033,1038 ****
--- 1063,1073 ----
  {
      struct server_configuration_s *config_s = 
          (struct server_configuration_s *)cmd->context;
+     if(config_s->configuration_context == CTX_SERVER_OPTIONS &&
+        config_s->my_server_options == 0)
+     {
+         return NULL;
+     }
      if (config_s->storage_path)
      {
          gossip_err("WARNING: StorageSpace value being overwritten.\n");
***************
*** 1194,1199 ****
--- 1229,1276 ----
      return NULL;
  }
  
+ DOTCONF_CB(enter_server_options_context)
+ {
+     struct server_configuration_s *config_s = 
+         (struct server_configuration_s *)cmd->context;
+     config_s->configuration_context = CTX_SERVER_OPTIONS;
+ 
+     return PINT_dotconf_set_defaults(
+         cmd->configfile, CTX_SERVER_OPTIONS);
+ }
+ 
+ DOTCONF_CB(exit_server_options_context)
+ {
+     struct server_configuration_s *config_s = 
+         (struct server_configuration_s *)cmd->context;
+     config_s->configuration_context = CTX_GLOBAL;
+     config_s->my_server_options = 0;
+     return NULL;
+ }
+ 
+ DOTCONF_CB(check_this_server)
+ {
+     struct server_configuration_s *config_s =
+         (struct server_configuration_s *)cmd->context;
+ 
+     if(is_valid_alias(config_s->host_aliases, cmd->data.str))
+     {
+         /* if the Server option specifies our alias, enable setting
+          * of server specific options
+          */
+         if(config_s->server_alias &&
+            strcmp(config_s->server_alias, cmd->data.str) == 0)
+         {
+             config_s->my_server_options = 1;
+         }
+     }
+     else
+     {
+         return "Unrecognized alias specified.\n";
+     }
+     return NULL;
+ }
+ 
  DOTCONF_CB(enter_mhranges_context)
  {
      struct server_configuration_s *config_s = 
***************
*** 1266,1271 ****
--- 1343,1353 ----
  {
      struct server_configuration_s *config_s = 
          (struct server_configuration_s *)cmd->context;
+     if(config_s->configuration_context == CTX_SERVER_OPTIONS &&
+        config_s->my_server_options == 0)
+     {
+         return NULL;
+     }
      config_s->initial_unexpected_requests = cmd->data.value;
      return NULL;
  }
***************
*** 1291,1296 ****
--- 1373,1383 ----
      struct server_configuration_s *config_s =
          (struct server_configuration_s *)cmd->context;
  
+     if(config_s->configuration_context == CTX_SERVER_OPTIONS &&
+        config_s->my_server_options == 0)
+     {
+         return NULL;
+     }
      if(strcasecmp(cmd->data.str, "yes") == 0)
      {
          config_s->tcp_bind_specific = 1;
***************
*** 1307,1318 ****
      return NULL;
  }
  
- 
- 
  DOTCONF_CB(get_server_job_bmi_timeout)
  {
      struct server_configuration_s *config_s = 
          (struct server_configuration_s *)cmd->context;
      config_s->server_job_bmi_timeout = cmd->data.value;
      return NULL;
  }
--- 1394,1408 ----
      return NULL;
  }
  
  DOTCONF_CB(get_server_job_bmi_timeout)
  {
      struct server_configuration_s *config_s = 
          (struct server_configuration_s *)cmd->context;
+     if(config_s->configuration_context == CTX_SERVER_OPTIONS &&
+        config_s->my_server_options == 0)
+     {
+         return NULL;
+     }
      config_s->server_job_bmi_timeout = cmd->data.value;
      return NULL;
  }
***************
*** 1321,1326 ****
--- 1411,1421 ----
  {
      struct server_configuration_s *config_s = 
          (struct server_configuration_s *)cmd->context;
+     if(config_s->configuration_context == CTX_SERVER_OPTIONS &&
+        config_s->my_server_options == 0)
+     {
+         return NULL;
+     }
      config_s->server_job_flow_timeout = cmd->data.value;
      return NULL;
  }
***************
*** 1370,1375 ****
--- 1465,1475 ----
      struct server_configuration_s *config_s = 
          (struct server_configuration_s *)cmd->context;
      /* free whatever was added in set_defaults phase */
+     if(config_s->configuration_context == CTX_SERVER_OPTIONS &&
+        config_s->my_server_options == 0)
+     {
+         return NULL;
+     }
      if (config_s->logfile)
          free(config_s->logfile);
      config_s->logfile = (cmd->data.str ? strdup(cmd->data.str) : NULL);
***************
*** 1381,1386 ****
--- 1481,1491 ----
      struct server_configuration_s *config_s = 
          (struct server_configuration_s *)cmd->context;
      /* free whatever was added in set_defaults phase */
+     if(config_s->configuration_context == CTX_SERVER_OPTIONS &&
+        config_s->my_server_options == 0)
+     {
+         return NULL;
+     }
      if (config_s->logtype)
          free(config_s->logtype);
      config_s->logtype = (cmd->data.str ? strdup(cmd->data.str) : NULL);
***************
*** 1396,1407 ****
      char buf[512] = {0};
      char *ptr = buf;
  
!     if (config_s->event_logging != NULL)
      {
-         len = strlen(config_s->event_logging);
-         strncpy(ptr,config_s->event_logging,len);
-         ptr += (len * sizeof(char));
          free(config_s->event_logging);
      }
      for(i = 0; i < cmd->arg_count; i++)
      {
--- 1501,1515 ----
      char buf[512] = {0};
      char *ptr = buf;
  
!     if(config_s->configuration_context == CTX_SERVER_OPTIONS &&
!        config_s->my_server_options == 0)
!     {
!         return NULL;
!     }
!     if (config_s->event_logging != NULL) 
      {
          free(config_s->event_logging);
+         config_s->event_logging = NULL;
      }
      for(i = 0; i < cmd->arg_count; i++)
      {
***************
*** 1423,1432 ****
  
      if (config_s->flow_modules != NULL)
      {
-         len = strlen(config_s->flow_modules);
-         strncpy(ptr,config_s->flow_modules,len);
-         ptr += (len * sizeof(char));
          free(config_s->flow_modules);
      }
      for(i = 0; i < cmd->arg_count; i++)
      {
--- 1531,1538 ----
  
      if (config_s->flow_modules != NULL)
      {
          free(config_s->flow_modules);
+         config_s->flow_modules = NULL;
      }
      for(i = 0; i < cmd->arg_count; i++)
      {
***************
*** 1729,1738 ****
  
      if (config_s->bmi_modules != NULL)
      {
-         len = strlen(config_s->bmi_modules);
-         strncpy(ptr,config_s->bmi_modules,len);
-         ptr += (len * sizeof(char));
          free(config_s->bmi_modules);
      }
      for(i = 0; i < cmd->arg_count; i++)
      {
--- 1835,1842 ----
  
      if (config_s->bmi_modules != NULL)
      {
          free(config_s->bmi_modules);
+         config_s->bmi_modules = NULL;
      }
      for(i = 0; i < cmd->arg_count; i++)
      {
***************
*** 2061,2066 ****
--- 2165,2176 ----
  {
      struct server_configuration_s *config_s = 
          (struct server_configuration_s *)cmd->context;
+ 
+     if(config_s->configuration_context == CTX_SERVER_OPTIONS &&
+        config_s->my_server_options == 0)
+     {
+         return NULL;
+     }
      config_s->trove_max_concurrent_io = cmd->data.value;
      return NULL;
  }
***************
*** 2440,2447 ****
      return NULL;
  }
  
- 
- 
  /*
   * Function: PINT_config_release
   *
--- 2550,2555 ----
***************
*** 2475,2498 ****
              config_s->fs_config_filename = NULL;
          }
  
-         if (config_s->server_config_filename)
-         {
-             free(config_s->server_config_filename);
-             config_s->server_config_filename = NULL;
-         }
- 
          if (config_s->fs_config_buf)
          {
              free(config_s->fs_config_buf);
              config_s->fs_config_buf = NULL;
          }
  
-         if (config_s->server_config_buf)
-         {
-             free(config_s->server_config_buf);
-             config_s->server_config_buf = NULL;
-         }
- 
          if (config_s->logfile)
          {
              free(config_s->logfile);
--- 2583,2594 ----
***************
*** 3409,3415 ****
  }
  
  /*
!   verify that both config files exist.  if so, cache them in RAM so
    that getconfig will not have to re-read the file contents each time.
    returns 0 on success; 1 on failure.
  
--- 3505,3511 ----
  }
  
  /*
!   verify that the config file exists.  if so, cache it in RAM so
    that getconfig will not have to re-read the file contents each time.
    returns 0 on success; 1 on failure.
  
***************
*** 3418,3431 ****
  */
  static int cache_config_files(
      struct server_configuration_s *config_s,
!     char *global_config_filename,
!     char *server_config_filename)
  {
      int fd = 0, nread = 0;
      struct stat statbuf;
      char *working_dir = NULL;
      char *my_global_fn = NULL;
-     char *my_server_fn = NULL;
      char buf[512] = {0};
  
      assert(config_s);
--- 3514,3525 ----
  */
  static int cache_config_files(
      struct server_configuration_s *config_s,
!     char *global_config_filename)
  {
      int fd = 0, nread = 0;
      struct stat statbuf;
      char *working_dir = NULL;
      char *my_global_fn = NULL;
      char buf[512] = {0};
  
      assert(config_s);
***************
*** 3435,3450 ****
      /* pick some filenames if not provided */
      my_global_fn = ((global_config_filename != NULL) ?
                      global_config_filename : "fs.conf");
-     my_server_fn = ((server_config_filename != NULL) ?
-                     server_config_filename : "server.conf");
  
!   open_global_config:
      memset(&statbuf, 0, sizeof(struct stat));
      if (stat(my_global_fn, &statbuf) == 0)
      {
          if (statbuf.st_size == 0)
          {
!             gossip_err("Invalid global config file %s.  This "
                         "file is 0 bytes in length!\n", my_global_fn);
              goto error_exit;
          }
--- 3529,3542 ----
      /* pick some filenames if not provided */
      my_global_fn = ((global_config_filename != NULL) ?
                      global_config_filename : "fs.conf");
  
! open_global_config:
      memset(&statbuf, 0, sizeof(struct stat));
      if (stat(my_global_fn, &statbuf) == 0)
      {
          if (statbuf.st_size == 0)
          {
!             gossip_err("Invalid config file %s.  This "
                         "file is 0 bytes in length!\n", my_global_fn);
              goto error_exit;
          }
***************
*** 3475,3514 ****
          goto error_exit;
      }
  
-   open_server_config:
-     memset(&statbuf,0,sizeof(struct stat));
-     if (stat(my_server_fn, &statbuf) == 0)
-     {
-         if (statbuf.st_size == 0)
-         {
-             gossip_err("Invalid server config file %s.  This "
-                        "file is 0 bytes in length!\n", my_server_fn);
-             goto error_exit;
-         }
-         config_s->server_config_filename = strdup(my_server_fn);
-         config_s->server_config_buflen = statbuf.st_size + 1;
-     }
-     else if (errno == ENOENT)
-     {
- 	gossip_err("Failed to find server config file %s.  This "
-                    "file does not exist!\n", my_server_fn);
-         goto error_exit;
-     }
-     else
-     {
-         assert(working_dir);
-         snprintf(buf, 512, "%s/%s", working_dir, my_server_fn);
-         my_server_fn = buf;
-         goto open_server_config;
-     }
- 
-     if (!config_s->server_config_filename ||
-         (config_s->server_config_buflen == 0))
-     {
-         gossip_err("Failed to stat server config file.  (0 file size?)\n");
-         goto error_exit;
-     }
- 
      if ((fd = open(my_global_fn, O_RDONLY)) == -1)
      {
          gossip_err("Failed to open fs config file %s.\n",
--- 3567,3572 ----
***************
*** 3536,3569 ****
      }
      close(fd);
  
-     if ((fd = open(my_server_fn,O_RDONLY)) == -1)
-     {
-         gossip_err("Failed to open fs config file %s.\n", my_server_fn);
-         goto error_exit;
-     }
- 
-     config_s->server_config_buf = (char *)
-         malloc(config_s->server_config_buflen);
-     if (!config_s->server_config_buf)
-     {
-         gossip_err("Failed to allocate %d bytes for caching the server "
-                    "config file\n", (int) config_s->server_config_buflen);
-         goto close_fd_fail;
-     }
- 
-     memset(config_s->server_config_buf, 0, config_s->server_config_buflen);
-     nread = read(fd, config_s->server_config_buf,
-                  (config_s->server_config_buflen - 1));
-     if (nread != (config_s->server_config_buflen - 1))
-     {
-         gossip_err("Failed to read server config file %s "
-                    "(nread is %d | config_buflen is %d)\n",
-                    my_server_fn, nread,
-                    (int)(config_s->server_config_buflen - 1));
-         goto close_fd_fail;
-     }
- 
-     close(fd);
      return 0;
  
    close_fd_fail:
--- 3594,3599 ----
***************
*** 4004,4012 ****
                  gossip_err("Could not find handle range for host %s\n",
                             config->host_id);
                  gossip_err("Please make sure that the host names in "
!                            "%s and %s are consistent\n",
!                            config->fs_config_filename,
!                            config->server_config_filename);
                  break;
              }
  
--- 4034,4041 ----
                  gossip_err("Could not find handle range for host %s\n",
                             config->host_id);
                  gossip_err("Please make sure that the host names in "
!                            "%s are consistent\n",
!                            config->fs_config_filename);
                  break;
              }
  
Index: pvfs2/src/common/misc/server-config.h
diff -c pvfs2/src/common/misc/server-config.h:1.58 pvfs2/src/common/misc/server-config.h:1.59
*** pvfs2/src/common/misc/server-config.h:1.58	Wed Aug 15 14:43:08 2007
--- pvfs2/src/common/misc/server-config.h	Fri Aug 17 00:04:24 2007
***************
*** 27,32 ****
--- 27,33 ----
      CTX_DISTRIBUTION     = (1 << 8),
      CTX_SECURITY         = (1 << 9),
      CTX_EXPORT           = (1 << 10),
+     CTX_SERVER_OPTIONS   = (1 << 11),
  };
  
  typedef struct phys_server_desc
***************
*** 130,142 ****
  typedef struct server_configuration_s
  {
      char *host_id;
      char *storage_path;
      char *fs_config_filename;       /* the fs.conf file name            */
      size_t fs_config_buflen;        /* the fs.conf file length          */
      char *fs_config_buf;            /* the fs.conf file contents        */
-     char *server_config_filename;   /* the server.conf file name        */
-     size_t server_config_buflen;    /* the server.conf file length      */
-     char *server_config_buf;        /* the server.conf file contents    */
      int  initial_unexpected_requests;
      int  server_job_bmi_timeout;    /* job timeout values in seconds    */
      int  server_job_flow_timeout;
--- 131,142 ----
  typedef struct server_configuration_s
  {
      char *host_id;
+     char *server_alias;             /* the command line server-alias parameter */
+     int my_server_options;
      char *storage_path;
      char *fs_config_filename;       /* the fs.conf file name            */
      size_t fs_config_buflen;        /* the fs.conf file length          */
      char *fs_config_buf;            /* the fs.conf file contents        */
      int  initial_unexpected_requests;
      int  server_job_bmi_timeout;    /* job timeout values in seconds    */
      int  server_job_flow_timeout;
***************
*** 185,197 ****
                                       * be configurable.
                                       */
      int trove_method;
! 
  } server_configuration_s;
  
  int PINT_parse_config(
      struct server_configuration_s *config_s,
      char *global_config_filename,
!     char *server_config_filename);
  
  void PINT_config_release(
      struct server_configuration_s *config_s);
--- 185,197 ----
                                       * be configurable.
                                       */
      int trove_method;
!     void *private_data;
  } server_configuration_s;
  
  int PINT_parse_config(
      struct server_configuration_s *config_s,
      char *global_config_filename,
!     char *server_alias_name);
  
  void PINT_config_release(
      struct server_configuration_s *config_s);
Index: pvfs2/src/common/misc/str-utils.c
diff -c pvfs2/src/common/misc/str-utils.c:1.21 pvfs2/src/common/misc/str-utils.c:1.22
*** pvfs2/src/common/misc/str-utils.c:1.21	Tue May  1 12:30:58 2007
--- pvfs2/src/common/misc/str-utils.c	Fri Aug 17 00:04:24 2007
***************
*** 9,14 ****
--- 9,15 ----
  #include 
  #include 
  #include 
+ #include 
  
  #include "str-utils.h"
  
***************
*** 349,355 ****
      const char *holder = NULL;
      const char *holder2 = NULL;
      const char *end = NULL;
!     int tokencount = 1;
      int i = -1;
  
      if (!comma_list || !tokens)
--- 350,356 ----
      const char *holder = NULL;
      const char *holder2 = NULL;
      const char *end = NULL;
!     int tokencount = 1, retval;
      int i = -1;
  
      if (!comma_list || !tokens)
***************
*** 365,378 ****
  	holder++;
      }
  
!     /* if we don't find any commas, just set the entire string to the first
!      *  token and return
!      */
!     if(0 == tokencount)
!     {
! 	tokencount = 1;
!     }
! 
      /* allocate pointers for each */
      *tokens = (char **) malloc(sizeof(char *) * tokencount);
      if (!(*tokens))
--- 366,372 ----
  	holder++;
      }
  
!     retval = tokencount;
      /* allocate pointers for each */
      *tokens = (char **) malloc(sizeof(char *) * tokencount);
      if (!(*tokens))
***************
*** 401,406 ****
--- 395,404 ----
  	{
  	    holder2 = end;
  	}
+         if (holder2 - holder == 0) {
+             retval--;
+             goto out;
+         }
  	(*tokens)[i] = (char *) malloc((holder2 - holder) + 1);
  	if (!(*tokens)[i])
  	{
***************
*** 408,418 ****
  	}
  	strncpy((*tokens)[i], holder, (holder2 - holder));
  	(*tokens)[i][(holder2 - holder)] = '\0';
  	holder = holder2 + 1;
- 
      }
  
!     return (tokencount);
  
    failure:
  
--- 406,417 ----
  	}
  	strncpy((*tokens)[i], holder, (holder2 - holder));
  	(*tokens)[i][(holder2 - holder)] = '\0';
+         assert(strlen((*tokens)[i]) != 0);
  	holder = holder2 + 1;
      }
  
! out:
!     return (retval);
  
    failure:
  
Index: pvfs2/src/kernel/linux-2.6/devpvfs2-req.c
diff -c pvfs2/src/kernel/linux-2.6/devpvfs2-req.c:1.70 pvfs2/src/kernel/linux-2.6/devpvfs2-req.c:1.71
*** pvfs2/src/kernel/linux-2.6/devpvfs2-req.c:1.70	Thu Feb  8 13:49:50 2007
--- pvfs2/src/kernel/linux-2.6/devpvfs2-req.c	Fri Aug 17 00:04:25 2007
***************
*** 30,35 ****
--- 30,37 ----
  gossip_err("  open_access_count = %d\n", open_access_count);          \
  gossip_err("*****************************************************\n")
  
+ static struct class *pvfs2_dev_class;
+ 
  static int pvfs2_devreq_open(
      struct inode *inode,
      struct file *file)
***************
*** 951,957 ****
  };
  
  /* Must be called on module load */
! int pvfs2_ioctl32_init(void)
  {
      int i, error;
  
--- 953,959 ----
  };
  
  /* Must be called on module load */
! static int pvfs2_ioctl32_init(void)
  {
      int i, error;
  
***************
*** 972,978 ****
  }
  
  /* Must be called on module unload */
! void pvfs2_ioctl32_cleanup(void)
  {
      int i;
      for (i = 0;  pvfs2_ioctl32_trans[i].cmd != 0; i++)
--- 974,980 ----
  }
  
  /* Must be called on module unload */
! static void pvfs2_ioctl32_cleanup(void)
  {
      int i;
      for (i = 0;  pvfs2_ioctl32_trans[i].cmd != 0; i++)
***************
*** 988,1003 ****
  #endif /* CONFIG_COMPAT */
  
  #if (defined(CONFIG_COMPAT) && !defined(HAVE_REGISTER_IOCTL32_CONVERSION)) || !defined(CONFIG_COMPAT)
! int pvfs2_ioctl32_init(void)
  {
      return 0;
  }
  
! void pvfs2_ioctl32_cleanup(void)
  {
      return;
  }
  #endif
  
  static unsigned int pvfs2_devreq_poll(
      struct file *file,
--- 990,1058 ----
  #endif /* CONFIG_COMPAT */
  
  #if (defined(CONFIG_COMPAT) && !defined(HAVE_REGISTER_IOCTL32_CONVERSION)) || !defined(CONFIG_COMPAT)
! static int pvfs2_ioctl32_init(void)
  {
      return 0;
  }
  
! static void pvfs2_ioctl32_cleanup(void)
  {
      return;
  }
  #endif
+ 
+ /* the assigned character device major number */
+ static int pvfs2_dev_major = 0;
+ /* Initialize pvfs2 device specific state: 
+  * Must be called at module load time only 
+  */
+ int pvfs2_dev_init(void)
+ {
+     int ret;
+ 
+     /* register the ioctl32 sub-system */
+     if ((ret = pvfs2_ioctl32_init()) < 0) {
+         return ret;
+     }
+     /* register pvfs2-req device  */
+     pvfs2_dev_major = register_chrdev(0, PVFS2_REQDEVICE_NAME,
+                                       &pvfs2_devreq_file_operations);
+     if (pvfs2_dev_major < 0)
+     {
+ 	gossip_debug(GOSSIP_INIT_DEBUG, "Failed to register /dev/%s (error %d)\n",
+ 		    PVFS2_REQDEVICE_NAME, pvfs2_dev_major);
+         pvfs2_ioctl32_cleanup();
+         return pvfs2_dev_major;
+     }
+     pvfs2_dev_class = class_create(THIS_MODULE, "pvfs2");
+     if (IS_ERR(pvfs2_dev_class)) {
+         pvfs2_ioctl32_cleanup();
+         unregister_chrdev(pvfs2_dev_major, PVFS2_REQDEVICE_NAME);
+         ret = PTR_ERR(pvfs2_dev_class);
+         return ret;
+     }
+     class_device_create(pvfs2_dev_class, NULL,
+                         MKDEV(pvfs2_dev_major, 0), NULL,
+                         PVFS2_REQDEVICE_NAME);
+ 
+     gossip_debug(GOSSIP_INIT_DEBUG, "*** /dev/%s character device registered ***\n",
+ 		PVFS2_REQDEVICE_NAME);
+     gossip_debug(GOSSIP_INIT_DEBUG, "'mknod /dev/%s c %d 0'.\n", PVFS2_REQDEVICE_NAME,
+                 pvfs2_dev_major);
+     return 0;
+ }
+ 
+ void pvfs2_dev_cleanup(void)
+ {
+     class_device_destroy(pvfs2_dev_class, MKDEV(pvfs2_dev_major, 0));
+     class_destroy(pvfs2_dev_class);
+     unregister_chrdev(pvfs2_dev_major, PVFS2_REQDEVICE_NAME);
+     gossip_debug(GOSSIP_INIT_DEBUG, "*** /dev/%s character device unregistered ***\n",
+             PVFS2_REQDEVICE_NAME);
+     /* unregister the ioctl32 sub-system */
+     pvfs2_ioctl32_cleanup();
+     return;
+ }
  
  static unsigned int pvfs2_devreq_poll(
      struct file *file,
Index: pvfs2/src/kernel/linux-2.6/pvfs2-kernel.h
diff -c pvfs2/src/kernel/linux-2.6/pvfs2-kernel.h:1.142 pvfs2/src/kernel/linux-2.6/pvfs2-kernel.h:1.143
*** pvfs2/src/kernel/linux-2.6/pvfs2-kernel.h:1.142	Tue Jul 17 18:03:31 2007
--- pvfs2/src/kernel/linux-2.6/pvfs2-kernel.h	Fri Aug 17 00:04:25 2007
***************
*** 47,52 ****
--- 47,53 ----
  #include 
  #include 
  #include 
+ #include 
  #include 
  #include 
  #include 
***************
*** 821,828 ****
   * defined in devpvfs2-req.c
   ****************************/
  
! int     pvfs2_ioctl32_init(void);
! void    pvfs2_ioctl32_cleanup(void);
  int     is_daemon_in_service(void);
  int     fs_mount_pending(PVFS_fs_id fsid);
  
--- 822,829 ----
   * defined in devpvfs2-req.c
   ****************************/
  
! int     pvfs2_dev_init(void);
! void    pvfs2_dev_cleanup(void);
  int     is_daemon_in_service(void);
  int     fs_mount_pending(PVFS_fs_id fsid);
  
Index: pvfs2/src/kernel/linux-2.6/pvfs2-mod.c
diff -c pvfs2/src/kernel/linux-2.6/pvfs2-mod.c:1.36 pvfs2/src/kernel/linux-2.6/pvfs2-mod.c:1.37
*** pvfs2/src/kernel/linux-2.6/pvfs2-mod.c:1.36	Thu Apr  5 16:58:37 2007
--- pvfs2/src/kernel/linux-2.6/pvfs2-mod.c	Fri Aug 17 00:04:25 2007
***************
*** 68,76 ****
  
  #endif /* PVFS2_LINUX_KERNEL_2_4 */
  
- /* the assigned character device major number */
- static int pvfs2_dev_major = 0;
- 
  /* synchronizes the request device file */
  struct semaphore devreq_semaphore;
  
--- 68,73 ----
***************
*** 118,147 ****
          goto cleanup_inode;
      }
  
!     /* Initialize the ioctl32 subsystem. This could be a noop too */
!     if ((ret = pvfs2_ioctl32_init()) < 0)
      {
!         gossip_err("pvfs2: could not register ioctl32 handlers? %d!\n",
                  ret);
          goto cleanup_kiocb;
      }
  
-     /* register pvfs2-req device  */
-     pvfs2_dev_major = register_chrdev(0, PVFS2_REQDEVICE_NAME,
-                                       &pvfs2_devreq_file_operations);
-     if (pvfs2_dev_major < 0)
-     {
- 	gossip_debug(GOSSIP_INIT_DEBUG, "Failed to register /dev/%s (error %d)\n",
- 		    PVFS2_REQDEVICE_NAME, pvfs2_dev_major);
-         ret = pvfs2_dev_major;
-         goto cleanup_ioctl;
-     }
- 
-     gossip_debug(GOSSIP_INIT_DEBUG, "*** /dev/%s character device registered ***\n",
- 		PVFS2_REQDEVICE_NAME);
-     gossip_debug(GOSSIP_INIT_DEBUG, "'mknod /dev/%s c %d 0'.\n", PVFS2_REQDEVICE_NAME,
-                 pvfs2_dev_major);
- 
      sema_init(&devreq_semaphore, 1);
      sema_init(&request_semaphore, 1);
  
--- 115,128 ----
          goto cleanup_inode;
      }
  
!     /* Initialize the pvfsdev subsystem. */
!     if ((ret = pvfs2_dev_init()) < 0)
      {
!         gossip_err("pvfs2: could not initialize device subsystem %d!\n",
                  ret);
          goto cleanup_kiocb;
      }
  
      sema_init(&devreq_semaphore, 1);
      sema_init(&request_semaphore, 1);
  
***************
*** 170,178 ****
  cleanup_progress_table:
      qhash_finalize(htable_ops_in_progress);
  cleanup_device:
!     unregister_chrdev(pvfs2_dev_major, PVFS2_REQDEVICE_NAME);
! cleanup_ioctl:
!     pvfs2_ioctl32_cleanup();
  cleanup_kiocb:
      kiocb_cache_finalize();
  cleanup_inode:
--- 151,157 ----
  cleanup_progress_table:
      qhash_finalize(htable_ops_in_progress);
  cleanup_device:
!     pvfs2_dev_cleanup();
  cleanup_kiocb:
      kiocb_cache_finalize();
  cleanup_inode:
***************
*** 196,210 ****
      unregister_filesystem(&pvfs2_fs_type);
      pvfs2_proc_finalize();
      fsid_key_table_finalize();
!     if (unregister_chrdev(pvfs2_dev_major, PVFS2_REQDEVICE_NAME) < 0)
!     {
! 	gossip_err("Failed to unregister pvfs2 device /dev/%s\n",
! 		    PVFS2_REQDEVICE_NAME);
!     }
!     else {
!         gossip_debug(GOSSIP_INIT_DEBUG, "Unregistered pvfs2 device /dev/%s\n",
!                     PVFS2_REQDEVICE_NAME);
!     }
      /* clear out all pending upcall op requests */
      spin_lock(&pvfs2_request_list_lock);
      while (!list_empty(&pvfs2_request_list))
--- 175,181 ----
      unregister_filesystem(&pvfs2_fs_type);
      pvfs2_proc_finalize();
      fsid_key_table_finalize();
!     pvfs2_dev_cleanup();
      /* clear out all pending upcall op requests */
      spin_lock(&pvfs2_request_list_lock);
      while (!list_empty(&pvfs2_request_list))
***************
*** 231,238 ****
  	    }
  	} while (hash_link);
      }
-     /* cleans up all ioctl32 handlers */
-     pvfs2_ioctl32_cleanup();
      kiocb_cache_finalize();
      pvfs2_inode_cache_finalize();
      dev_req_cache_finalize();
--- 202,207 ----
Index: pvfs2/src/proto/PINT-le-bytefield.c
diff -c pvfs2/src/proto/PINT-le-bytefield.c:1.51 pvfs2/src/proto/PINT-le-bytefield.c:1.52
*** pvfs2/src/proto/PINT-le-bytefield.c:1.51	Tue Jul 24 13:16:21 2007
--- pvfs2/src/proto/PINT-le-bytefield.c	Fri Aug 17 00:04:27 2007
***************
*** 92,98 ****
  		continue;
  	    case PVFS_SERV_GETCONFIG:
  		resp.u.getconfig.fs_config_buf = tmp_name;
- 		resp.u.getconfig.server_config_buf = tmp_name;
  		respsize = extra_size_PVFS_servresp_getconfig;
  		break;
  	    case PVFS_SERV_LOOKUP_PATH:
--- 92,97 ----
Index: pvfs2/src/proto/pvfs2-req-proto.h
diff -c pvfs2/src/proto/pvfs2-req-proto.h:1.150 pvfs2/src/proto/pvfs2-req-proto.h:1.151
*** pvfs2/src/proto/pvfs2-req-proto.h:1.150	Wed Jul 18 16:44:32 2007
--- pvfs2/src/proto/pvfs2-req-proto.h	Fri Aug 17 00:04:27 2007
***************
*** 697,713 ****
  {
      char *fs_config_buf;
      uint32_t fs_config_buf_size;
-     char *server_config_buf;
-     uint32_t server_config_buf_size;
  };
! endecode_fields_4_struct(
      PVFS_servresp_getconfig,
      uint32_t, fs_config_buf_size,
!     uint32_t, server_config_buf_size,
!     string, fs_config_buf,
!     string, server_config_buf)
  #define extra_size_PVFS_servresp_getconfig \
!     (2 * PVFS_REQ_LIMIT_CONFIG_FILE_BYTES)
  
  /* truncate ****************************************************/
  /* - resizes an existing datafile */
--- 697,710 ----
  {
      char *fs_config_buf;
      uint32_t fs_config_buf_size;
  };
! endecode_fields_3_struct(
      PVFS_servresp_getconfig,
      uint32_t, fs_config_buf_size,
!     skip4,,
!     string, fs_config_buf)
  #define extra_size_PVFS_servresp_getconfig \
!     (PVFS_REQ_LIMIT_CONFIG_FILE_BYTES)
  
  /* truncate ****************************************************/
  /* - resizes an existing datafile */
Index: pvfs2/src/server/get-config.sm
diff -c pvfs2/src/server/get-config.sm:1.36 pvfs2/src/server/get-config.sm:1.37
*** pvfs2/src/server/get-config.sm:1.36	Fri Apr 13 01:14:30 2007
--- pvfs2/src/server/get-config.sm	Fri Aug 17 00:04:30 2007
***************
*** 77,92 ****
  
      /* TODO: handle this properly later */
      assert(user_opts->fs_config_buflen <= PVFS_REQ_LIMIT_CONFIG_FILE_BYTES);
-     assert(user_opts->server_config_buflen <= PVFS_REQ_LIMIT_CONFIG_FILE_BYTES);
  
      s_op->resp.u.getconfig.fs_config_buf_size =
          (uint32_t)user_opts->fs_config_buflen;
      s_op->resp.u.getconfig.fs_config_buf =
          (char*)user_opts->fs_config_buf;
-     s_op->resp.u.getconfig.server_config_buf_size =
-         (uint32_t)user_opts->server_config_buflen;
-     s_op->resp.u.getconfig.server_config_buf =
-         (char*)user_opts->server_config_buf;
  
      js_p->error_code = 0;
      return SM_ACTION_COMPLETE;
--- 77,87 ----
Index: pvfs2/src/server/pvfs2-server.c
diff -c pvfs2/src/server/pvfs2-server.c:1.244 pvfs2/src/server/pvfs2-server.c:1.245
*** pvfs2/src/server/pvfs2-server.c:1.244	Wed Aug 15 14:43:11 2007
--- pvfs2/src/server/pvfs2-server.c	Fri Aug 17 00:04:30 2007
***************
*** 108,116 ****
      int server_create_storage_space;
      int server_background;
      char *pidfile;
  } options_t;
  
! static options_t s_server_options = { 0, 0, 1, NULL };
  
  /* each of the elements in this array consists of a string and its length.
   * we're able to use sizeof here because sizeof an inlined string ("") gives
--- 108,118 ----
      int server_create_storage_space;
      int server_background;
      char *pidfile;
+     char *server_alias;
  } options_t;
  
! static options_t s_server_options = { 0, 0, 1, NULL, NULL};
! static char *fs_conf = NULL;
  
  /* each of the elements in this array consists of a string and its length.
   * we're able to use sizeof here because sizeof an inlined string ("") gives
***************
*** 154,159 ****
--- 156,162 ----
  static void write_pidfile(int fd);
  static void remove_pidfile(void);
  static int parse_port_from_host_id(char* host_id);
+ static char *guess_alias(void);
  
  static TROVE_method_id trove_coll_to_method_callback(TROVE_coll_id);
  
***************
*** 414,420 ****
  int main(int argc, char **argv)
  {
      int ret = -1, siglevel = 0;
-     char *fs_conf = NULL, *server_conf = NULL;
      struct PINT_smcb *tmp_op = NULL;
      uint64_t debug_mask = 0;
  
--- 417,422 ----
***************
*** 447,465 ****
      }
  
      gossip_debug_fp(stderr, 'S', GOSSIP_LOGSTAMP_DATETIME,
!                     "PVFS2 Server version %s starting...\n", PVFS2_VERSION);
  
!     fs_conf = ((argc >= optind) ? argv[optind] : NULL);
!     server_conf = ((argc >= (optind + 1)) ? argv[optind + 1] : NULL);
  
!     ret = PINT_parse_config(&server_config, fs_conf, server_conf);
      if (ret < 0)
      {
!         gossip_err("Error: Please check your config files.\n");  
          gossip_err("Error: Server aborting.\n");
          goto server_shutdown;
      }
  
      server_status_flag |= SERVER_CONFIG_INIT;
  
      if (!PINT_config_is_valid_configuration(&server_config))
--- 449,470 ----
      }
  
      gossip_debug_fp(stderr, 'S', GOSSIP_LOGSTAMP_DATETIME,
!                     "PVFS2 Server on node %s version %s starting...\n",
!                     s_server_options.server_alias, PVFS2_VERSION);
  
!     /* code to handle older two config file format */
  
!     ret = PINT_parse_config(&server_config, fs_conf, s_server_options.server_alias);
      if (ret < 0)
      {
!         gossip_err("Error: Please check your config files.\n");
          gossip_err("Error: Server aborting.\n");
+         free(s_server_options.server_alias);
          goto server_shutdown;
      }
  
+     free(s_server_options.server_alias);
+ 
      server_status_flag |= SERVER_CONFIG_INIT;
  
      if (!PINT_config_is_valid_configuration(&server_config))
***************
*** 1574,1580 ****
  static void usage(int argc, char **argv)
  {
      gossip_err("Usage: %s: [OPTIONS]  "
!                "\n\n", argv[0]);
      gossip_err("  -d, --foreground\t"
                 "will keep server in the foreground\n");
      gossip_err("  -f, --mkfs\t\twill cause server to "
--- 1579,1585 ----
  static void usage(int argc, char **argv)
  {
      gossip_err("Usage: %s: [OPTIONS]  "
!                "\n\n", argv[0]);
      gossip_err("  -d, --foreground\t"
                 "will keep server in the foreground\n");
      gossip_err("  -f, --mkfs\t\twill cause server to "
***************
*** 1585,1595 ****
--- 1590,1602 ----
      gossip_err("  -v, --version\t\toutput version information "
                 "and exit\n");
      gossip_err("  -p, --pidfile \twrite process id to file\n");
+     gossip_err("  -a, --alias \tuse the specified alias for this node\n");
  }
  
  static int server_parse_cmd_line_args(int argc, char **argv)
  {
      int ret = 0, option_index = 0;
+     int total_arguments = 0;
      const char *cur_option = NULL;
      static struct option long_opts[] =
      {
***************
*** 1599,1610 ****
          {"rmfs",0,0,0},
          {"version",0,0,0},
          {"pidfile",1,0,0},
          {0,0,0,0}
      };
  
!     while ((ret = getopt_long(argc, argv,"dfhrvp:",
                                long_opts, &option_index)) != -1)
      {
          switch (ret)
          {
              case 0:
--- 1606,1619 ----
          {"rmfs",0,0,0},
          {"version",0,0,0},
          {"pidfile",1,0,0},
+         {"alias",0,0,0},
          {0,0,0,0}
      };
  
!     while ((ret = getopt_long(argc, argv,"dfhrvp:a:",
                                long_opts, &option_index)) != -1)
      {
+         total_arguments++;
          switch (ret)
          {
              case 0:
***************
*** 1635,1640 ****
--- 1644,1653 ----
                  {
                      goto do_pidfile;
                  }
+                 else if (strcmp("alias", cur_option) == 0)
+                 {
+                     goto do_alias;
+                 }
                  break;
              case 'v':
            do_version:
***************
*** 1654,1659 ****
--- 1667,1673 ----
                  break;
              case 'p':
            do_pidfile:
+                 total_arguments++;
                  s_server_options.pidfile = optarg;
                  if(optarg[0] != '/')
                  {
***************
*** 1661,1680 ****
                      goto parse_cmd_line_args_failure;
                  }
                  break;
              case '?':
              case 'h':
            do_help:
              default:
            parse_cmd_line_args_failure:
                  usage(argc, argv);
                  return 1;
          }
      }
  
!     if (argc == 1)
      {
          goto parse_cmd_line_args_failure;
      }
      return 0;
  }
  
--- 1675,1724 ----
                      goto parse_cmd_line_args_failure;
                  }
                  break;
+             case 'a':
+            do_alias:
+                 total_arguments++;
+                 s_server_options.server_alias = strdup(optarg);
+                 break;
              case '?':
              case 'h':
            do_help:
              default:
            parse_cmd_line_args_failure:
                  usage(argc, argv);
+                 if(s_server_options.server_alias)
+                 {
+                     free(s_server_options.server_alias);
+                 }
                  return 1;
          }
      }
  
!     if(argc < optind)
!     {
!         gossip_err("Missing config file in command line arguments\n");
!         goto parse_cmd_line_args_failure;
!     }
! 
!     fs_conf = argv[optind++];
! 
!     if(argc - total_arguments > 2)
      {
+         /* Assume user is passing in a server.conf.  Bit of a hack here to
+          * support server.conf files in the old format by appending the
+          * server.conf options onto the fs.conf.
+          */
+         gossip_err("The two config file format is no longer supported.  "
+                    "Generate a single fs.conf that uses the new format with the "
+                    "pvfs2-config-convert script.\n\n");
          goto parse_cmd_line_args_failure;
      }
+ 
+     if (s_server_options.server_alias == NULL)
+     {
+         /* Try to guess the alias from the hostname */
+         s_server_options.server_alias = guess_alias();
+     }
      return 0;
  }
  
***************
*** 2043,2056 ****
  
  static TROVE_method_id trove_coll_to_method_callback(TROVE_coll_id coll_id)
  {
!     struct filesystem_configuration_s * fs_conf;
!     
!     fs_conf = PINT_config_find_fs_id(&server_config, coll_id);
!     if(!fs_conf)
      {
          return server_config.trove_method;
      }
!     return fs_conf->trove_method;
  }
  
  #ifndef GOSSIP_DISABLE_DEBUG
--- 2087,2100 ----
  
  static TROVE_method_id trove_coll_to_method_callback(TROVE_coll_id coll_id)
  {
!     struct filesystem_configuration_s * fs_config;
! 
!     fs_config = PINT_config_find_fs_id(&server_config, coll_id);
!     if(!fs_config)
      {
          return server_config.trove_method;
      }
!     return fs_config->trove_method;
  }
  
  #ifndef GOSSIP_DISABLE_DEBUG
***************
*** 2108,2113 ****
--- 2152,2185 ----
      if (op >= 0 && op < PVFS_SERV_NUM_OPS)
          s = PINT_server_req_table[op].string_name;
      return s;
+ }
+ 
+ static char *guess_alias(void)
+ {
+     char tmp_alias[1024];
+     char *tmpstr;
+     char *alias;
+     int ret;
+ 
+     /* hmm...failed to find alias as part of the server config filename,
+      * use the hostname to guess
+      */
+     ret = gethostname(tmp_alias, 1024);
+     if(ret != 0)
+     {
+         gossip_err("Failed to get hostname while attempting to guess "
+                    "alias.  Use -a to specify the alias for this server "
+                    "process directly\n");
+         return NULL;
+     }
+     alias = tmp_alias;
+ 
+     tmpstr = strstr(tmp_alias, ".");
+     if(tmpstr)
+     {
+         *tmpstr = 0;
+     }
+     return strdup(tmp_alias);
  }
  
  /*
Index: pvfs2/test/server/showconfig.c
diff -c pvfs2/test/server/showconfig.c:1.25 pvfs2/test/server/showconfig.c:1.26
*** pvfs2/test/server/showconfig.c:1.25	Fri Aug 18 10:55:58 2006
--- pvfs2/test/server/showconfig.c	Fri Aug 17 00:04:33 2007
***************
*** 24,30 ****
  
      if (argc != 3)
      {
!         printf("Usage: %s  \n",argv[0]);
          return 1;
      }
  
--- 24,30 ----
  
      if (argc != 3)
      {
!         printf("Usage: %s  \n",argv[0]);
          return 1;
      }
  
***************
*** 47,59 ****
      fprintf(stderr,"FS Config File Name      : %s (%d bytes)\n",
              serverconfig.fs_config_filename,
              (int)serverconfig.fs_config_buflen);
-     fprintf(stderr,"Server Config File Name  : %s (%d bytes)\n",
-             serverconfig.server_config_filename,
-             (int)serverconfig.server_config_buflen);
      fprintf(stderr,"Initial Unexp Requests   : %d\n",
              serverconfig.initial_unexpected_requests);
      fprintf(stderr,"Configured Log File      : %s\n",
              serverconfig.logfile);
      fprintf(stderr,"Event Logging Mask String: %s\n",
              serverconfig.event_logging);
  
--- 47,60 ----
      fprintf(stderr,"FS Config File Name      : %s (%d bytes)\n",
              serverconfig.fs_config_filename,
              (int)serverconfig.fs_config_buflen);
      fprintf(stderr,"Initial Unexp Requests   : %d\n",
              serverconfig.initial_unexpected_requests);
      fprintf(stderr,"Configured Log File      : %s\n",
              serverconfig.logfile);
+     fprintf(stderr,"Configured FlowModules : %s\n",
+             serverconfig.flow_modules);
+     fprintf(stderr,"Configured BMIModules : %s\n",
+             serverconfig.bmi_modules);
      fprintf(stderr,"Event Logging Mask String: %s\n",
              serverconfig.event_logging);