#include <stdio.h>#include <getopt.h>#include <fcntl.h>#include <errno.h>#include <signal.h>#include <sys/sem.h>#include <sys/socket.h>#include <sys/un.h>#include <sys/types.h>#include <pwd.h>#include "y2storage/AppUtil.h"#include "y2storage/StorageInterface.h"#include "y2storage/StorageTypes.h"#include "y2storage/StorageTmpl.h"#include "EvmsAccess.h"Classes | |
| struct | CmdEntry |
Defines | |
| #define | OPT_LOG_PATH 200 |
| #define | OPT_LOG_NAME 201 |
| #define | OPT_LOG_FILE 202 |
| #define | OPT_SOCKET 203 |
| #define | OPT_TIMEOUT 204 |
| #define | OPT_RETRY 205 |
Functions | |
| bool | read_line (int fd, string &line) |
| bool | write_string (int fd, const string &str) |
| int | EvmsCreateCoCmd (EvmsAccess &evms, const string ¶ms) |
| int | EvmsExtendCoCmd (EvmsAccess &evms, const string ¶ms) |
| int | EvmsShrinkCoCmd (EvmsAccess &evms, const string ¶ms) |
| int | EvmsDeleteCoCmd (EvmsAccess &evms, const string ¶ms) |
| int | EvmsCreateLvCmd (EvmsAccess &evms, const string ¶ms) |
| int | EvmsDeleteLvCmd (EvmsAccess &evms, const string ¶ms) |
| int | EvmsResizeLvCmd (EvmsAccess &evms, const string ¶ms) |
| int | EvmsCreateCompatVolume (EvmsAccess &evms, const string ¶ms) |
| int | EvmsActivate (EvmsAccess &evms, const string ¶ms) |
| void | searchExecCmd (const string &cmd, EvmsAccess &evms, const string ¶ms, int fd) |
| void | loop_cin () |
| void | cleanup () |
| void | sigterm_handler (int sig) |
| void | loop_socket (const string &spath, int timeout, const char *ppath) |
| int | main (int argc_iv, char **argv_ppcv) |
Variables | |
| static struct option | LongOpt_arm [] |
| static CmdEntry | cmds [] |
| static string | spath |
| static int | semid = -1 |
| static int | lsock = -1 |
| #define OPT_LOG_FILE 202 |
Referenced by main().
| #define OPT_LOG_NAME 201 |
Referenced by main().
| #define OPT_LOG_PATH 200 |
Referenced by main().
| #define OPT_RETRY 205 |
Referenced by main().
| #define OPT_SOCKET 203 |
Referenced by main().
| #define OPT_TIMEOUT 204 |
Referenced by main().
| void cleanup | ( | ) |
| int EvmsActivate | ( | EvmsAccess & | evms, | |
| const string & | params | |||
| ) |
References storage::EvmsAccess::activate().
| int EvmsCreateCoCmd | ( | EvmsAccess & | evms, | |
| const string & | params | |||
| ) |
References storage::EvmsAccess::createCo(), and storage::extractNthWord().
| int EvmsCreateCompatVolume | ( | EvmsAccess & | evms, | |
| const string & | params | |||
| ) |
References storage::EvmsAccess::createCompatVol(), and storage::extractNthWord().
| int EvmsCreateLvCmd | ( | EvmsAccess & | evms, | |
| const string & | params | |||
| ) |
References storage::EvmsAccess::createLv(), and storage::extractNthWord().
| int EvmsDeleteCoCmd | ( | EvmsAccess & | evms, | |
| const string & | params | |||
| ) |
References storage::EvmsAccess::deleteCo(), and storage::extractNthWord().
| int EvmsDeleteLvCmd | ( | EvmsAccess & | evms, | |
| const string & | params | |||
| ) |
References storage::EvmsAccess::deleteLv(), and storage::extractNthWord().
| int EvmsExtendCoCmd | ( | EvmsAccess & | evms, | |
| const string & | params | |||
| ) |
References storage::EvmsAccess::extendCo(), and storage::extractNthWord().
| int EvmsResizeLvCmd | ( | EvmsAccess & | evms, | |
| const string & | params | |||
| ) |
References storage::EvmsAccess::changeLvSize(), and storage::extractNthWord().
| int EvmsShrinkCoCmd | ( | EvmsAccess & | evms, | |
| const string & | params | |||
| ) |
References storage::extractNthWord(), and storage::EvmsAccess::shrinkCo().
| void loop_cin | ( | ) |
References storage::extractNthWord(), getline(), searchExecCmd(), and y2milestone.
Referenced by main().
| void loop_socket | ( | const string & | spath, | |
| int | timeout, | |||
| const char * | ppath | |||
| ) |
References storage::extractNthWord(), IPC_PROJ_ID, lsock, read_line(), searchExecCmd(), semid, sigterm_handler(), y2debug, y2error, y2milestone, and y2warning.
Referenced by main().
| int main | ( | int | argc_iv, | |
| char ** | argv_ppcv | |||
| ) |
References cleanup(), storage::createLogger(), LongOpt_arm, loop_cin(), loop_socket(), OPT_LOG_FILE, OPT_LOG_NAME, OPT_LOG_PATH, OPT_RETRY, OPT_SOCKET, OPT_TIMEOUT, and y2milestone.
| bool read_line | ( | int | fd, | |
| string & | line | |||
| ) |
Referenced by loop_socket().
| void searchExecCmd | ( | const string & | cmd, | |
| EvmsAccess & | evms, | |||
| const string & | params, | |||
| int | fd | |||
| ) |
References CmdEntry::cmd, storage::EVMS_HELPER_UNKNOWN_CMD, CmdEntry::fnc, storage::lengthof(), storage::EvmsAccess::listLibstorage(), write_string(), and y2milestone.
Referenced by loop_cin(), and loop_socket().
| void sigterm_handler | ( | int | sig | ) |
| bool write_string | ( | int | fd, | |
| const string & | str | |||
| ) |
Initial value:
{
{ "create_co", EvmsCreateCoCmd },
{ "extend_co", EvmsExtendCoCmd },
{ "shrink_co", EvmsShrinkCoCmd },
{ "delete_co", EvmsDeleteCoCmd },
{ "create_lv", EvmsCreateLvCmd },
{ "delete_lv", EvmsDeleteLvCmd },
{ "resize_lv", EvmsResizeLvCmd },
{ "cc_vol", EvmsCreateCompatVolume },
{ "activate", EvmsActivate }
}
struct option LongOpt_arm[] [static] |
Initial value:
{
{ "log-path", required_argument, NULL, OPT_LOG_PATH },
{ "log-name", required_argument, NULL, OPT_LOG_NAME },
{ "log-file", required_argument, NULL, OPT_LOG_FILE },
{ "retry", no_argument, NULL, OPT_RETRY },
{ "socket", required_argument, NULL, OPT_SOCKET },
{ "timeout", required_argument, NULL, OPT_TIMEOUT }
}
Referenced by main().
int lsock = -1 [static] |
Referenced by cleanup(), and loop_socket().
int semid = -1 [static] |
Referenced by storage::EvmsCo::attachToSocket(), cleanup(), and loop_socket().
1.5.5