|
fs_save_config(3)
Contents
|
fs_save_config - Saves an AdvFS domain configuration.
#include <stocfg/fs_config.h>
char *fs_save_config( char *object_type,
char *object_name, char **err_buf);
);
File System & Storage Configuration Library libstocfg
Points to an object type. Points to an object name; for
example, a domain name, a fileset name, or a directory
path depending on the object type. Points to a pointer
which points to a location in which the function stores an
error message.
This function saves the configuration of an AdvFS domain,
including information about its filesets and volumes.
Filesets and volumes can remain online while the configuration
is captured.
Valid names of object types are ADVFS_DOMAIN,ADVFS_FILESET,
and MOUNTPOINT.
For ADVFS_DOMAIN, the configuration of the AdvFS domain,
all associated AdvFS filesets and volumes are captured.
For each AdvFS volume that is an LSM volume, the associated
LSM diskgroup configuration is also captured.
For ADVFS_FILESET or MOUNTPOINT, the configuration of the
associated AdvFS domain is captured. For each AdvFS volume
that is an LSM volume, the associated LSM diskgroup configuration
is also captured. For MOUNTPOINT, an error will
be returned if the mountpoint is not associated with an
AdvFS fileset.
The configuration description contains sufficient information
to recreate the configuration cloning the associated
disks and then using the fs_restore_config function.
The calling function is responsible for freeing memory
allocated for the error message.
You must be the root user to execute this function.
Upon successful completion, the function returns a pointer
to a character buffer containing a description of the configuration.
The configuration description is expressed in
the XML format. See fs_config_data for a description of
the output format. Returns NULL and sets *err_buf to
point to an error message.
The following example saves a domain configuration.
#include <sys/types.h> #include <stdio.h> #include
<stocfg/fs_config.h> main(int argc, char **argv) {
char *config=NULL,*err_buf=NULL;
if(argc < 3)
{
printf("Usage: %s <object_type> <object_name>\n",*argv);
printf("\twhere object_type is one of:\n");
printf("\t\tADVFS_DOMAIN\n");
printf("\t\tADVFS_FILESET\n");
printf("\t\tMOUNTPOINT\n");
exit(0);
}
config = fs_save_config(*(argv +1),*(argv
+2),&err_buf);
}
Functions: fs_get_dom_list(3),
fs_get_fset_list(3), fs_config_get_devs(3),
fs_restore_config(3)
Files: fs_config_data(4)
fs_save_config(3)
[ Back ] |