Skip to content

Commit

Permalink
issue: 2682063 Update output with vmad
Browse files Browse the repository at this point in the history
Signed-off-by: Igor Ivanov <[email protected]>
  • Loading branch information
igor-ivanov committed Sep 29, 2021
1 parent 2bc5c84 commit fecffc7
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/vma/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ void print_vma_global_settings()
VLOG_STR_PARAM_STRING("Log File", safe_mce_sys().log_filename, MCE_DEFAULT_LOG_FILE, SYS_VAR_LOG_FILENAME, safe_mce_sys().log_filename);
VLOG_STR_PARAM_STRING("Stats File", safe_mce_sys().stats_filename, MCE_DEFAULT_STATS_FILE, SYS_VAR_STATS_FILENAME, safe_mce_sys().stats_filename);
VLOG_STR_PARAM_STRING("Stats shared memory directory", safe_mce_sys().stats_shmem_dirname, MCE_DEFAULT_STATS_SHMEM_DIR, SYS_VAR_STATS_SHMEM_DIRNAME, safe_mce_sys().stats_shmem_dirname);
VLOG_STR_PARAM_STRING("VMAD output directory", safe_mce_sys().vmad_notify_dir, MCE_DEFAULT_VMAD_FOLDER, SYS_VAR_VMAD_DIR, safe_mce_sys().vmad_notify_dir);
VLOG_STR_PARAM_STRING("SERVICE output directory", safe_mce_sys().service_notify_dir, MCE_DEFAULT_SERVICE_FOLDER, SYS_VAR_SERVICE_DIR, safe_mce_sys().service_notify_dir);
VLOG_PARAM_NUMBER("Stats FD Num (max)", safe_mce_sys().stats_fd_num_max, MCE_DEFAULT_STATS_FD_NUM, SYS_VAR_STATS_FD_NUM);
VLOG_STR_PARAM_STRING("Conf File", safe_mce_sys().conf_filename, MCE_DEFAULT_CONF_FILE, SYS_VAR_CONF_FILENAME, safe_mce_sys().conf_filename);
VLOG_STR_PARAM_STRING("Application ID", safe_mce_sys().app_id, MCE_DEFAULT_APP_ID, SYS_VAR_APPLICATION_ID, safe_mce_sys().app_id);
Expand Down
12 changes: 6 additions & 6 deletions src/vma/util/agent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@
#define output_fatal() \
do { \
vlog_levels_t _level = (mce_sys_var::HYPER_MSHV == safe_mce_sys().hypervisor ? \
VLOG_WARNING : VLOG_DEBUG); \
VLOG_WARNING : VLOG_DEBUG); \
vlog_printf(_level, "*************************************************************\n"); \
if (rc == -EPROTONOSUPPORT) \
vlog_printf(_level, "* Protocol version mismatch was found between vma and vmad. *\n"); \
if (rc == -EPROTONOSUPPORT) \
vlog_printf(_level, "* Protocol version mismatch was found between the library and the service. *\n"); \
else \
vlog_printf(_level, "* Can not establish connection with the daemon (vmad). *\n"); \
vlog_printf(_level, "* Can not establish connection with the service. *\n"); \
vlog_printf(_level, "* UDP/TCP connections are likely to be limited. *\n"); \
vlog_printf(_level, "*************************************************************\n"); \
} while (0)
Expand All @@ -100,7 +100,7 @@ agent::agent() :
/* Fill free queue with empty messages */
i = m_msg_num;
m_msg_num = 0;
const char *path = safe_mce_sys().vmad_notify_dir;
const char *path = safe_mce_sys().service_notify_dir;
while (i--) {
/* coverity[overwrite_var] */
msg = (agent_msg_t *)calloc(1, sizeof(*msg));
Expand Down Expand Up @@ -528,7 +528,7 @@ int agent::send_msg_init(void)
}

if (data.hdr.ver < VMA_AGENT_VER) {
__log_dbg("Protocol version mismatch: agent ver = 0x%X vmad ver = 0x%X",
__log_dbg("Protocol version mismatch: agent ver = 0x%X service ver = 0x%X",
VMA_AGENT_VER, data.hdr.ver);
rc = -EPROTONOSUPPORT;
goto err;
Expand Down
8 changes: 4 additions & 4 deletions src/vma/util/sys_vars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -503,9 +503,9 @@ void mce_sys_var::get_env_params()
memset(log_filename, 0, sizeof(log_filename));
memset(stats_filename, 0, sizeof(stats_filename));
memset(stats_shmem_dirname, 0, sizeof(stats_shmem_dirname));
memset(vmad_notify_dir, 0, sizeof(vmad_notify_dir));
memset(service_notify_dir, 0, sizeof(service_notify_dir));
strcpy(stats_filename, MCE_DEFAULT_STATS_FILE);
strcpy(vmad_notify_dir, MCE_DEFAULT_VMAD_FOLDER);
strcpy(service_notify_dir, MCE_DEFAULT_SERVICE_FOLDER);
strcpy(stats_shmem_dirname, MCE_DEFAULT_STATS_SHMEM_DIR);
strcpy(conf_filename, MCE_DEFAULT_CONF_FILE);
strcpy(app_id, MCE_DEFAULT_APP_ID);
Expand Down Expand Up @@ -800,8 +800,8 @@ void mce_sys_var::get_env_params()
read_env_variable_with_pid(conf_filename, sizeof(conf_filename), env_ptr);
}

if ((env_ptr = getenv(SYS_VAR_VMAD_DIR)) != NULL){
read_env_variable_with_pid(vmad_notify_dir, sizeof(vmad_notify_dir), env_ptr);
if ((env_ptr = getenv(SYS_VAR_SERVICE_DIR)) != NULL){
read_env_variable_with_pid(service_notify_dir, sizeof(service_notify_dir), env_ptr);
}

if ((env_ptr = getenv(SYS_VAR_LOG_LEVEL)) != NULL)
Expand Down
6 changes: 3 additions & 3 deletions src/vma/util/sys_vars.h
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ struct mce_sys_var {
char stats_filename[PATH_MAX];
char stats_shmem_dirname[PATH_MAX];
char conf_filename[PATH_MAX];
char vmad_notify_dir[PATH_MAX];
char service_notify_dir[PATH_MAX];
bool log_colors;
bool handle_sigintr;
bool handle_segfault;
Expand Down Expand Up @@ -456,7 +456,7 @@ extern mce_sys_var & safe_mce_sys();
#define SYS_VAR_LOG_DETAILS "VMA_LOG_DETAILS"
#define SYS_VAR_LOG_FILENAME "VMA_LOG_FILE"
#define SYS_VAR_STATS_FILENAME "VMA_STATS_FILE"
#define SYS_VAR_VMAD_DIR "VMA_VMAD_NOTIFY_DIR"
#define SYS_VAR_SERVICE_DIR "VMA_VMAD_NOTIFY_DIR"
#define SYS_VAR_STATS_SHMEM_DIRNAME "VMA_STATS_SHMEM_DIR"
#define SYS_VAR_CONF_FILENAME "VMA_CONFIG_FILE"
#define SYS_VAR_LOG_COLORS "VMA_LOG_COLORS"
Expand Down Expand Up @@ -575,7 +575,7 @@ extern mce_sys_var & safe_mce_sys();
#define MCE_DEFAULT_LOG_FILE ("")
#define MCE_DEFAULT_CONF_FILE ("/etc/libvma.conf")
#define MCE_DEFAULT_STATS_FILE ("")
#define MCE_DEFAULT_VMAD_FOLDER (VMA_AGENT_PATH)
#define MCE_DEFAULT_SERVICE_FOLDER (VMA_AGENT_PATH)
#define MCE_DEFAULT_STATS_SHMEM_DIR ("/tmp/")
#define MCE_DEFAULT_LOG_DETAILS (0)
#define MCE_DEFAULT_LOG_COLORS (true)
Expand Down

0 comments on commit fecffc7

Please sign in to comment.