tools: acrnctl: Fix regression of acrnctl list

commit(4d274a5 Tools: acrn-manager-interface) change location and naming scheme
to the follow.
    /run/acrn/mngr/vmname.monitor.pid.socket

This patch adapt parse vmname according new naming scheme.

Signed-off-by: Kaige Fu <kaige.fu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Kaige Fu 2018-05-31 16:41:55 +08:00 committed by lijinxia
parent 4a1f922242
commit e32a5cadf2
1 changed files with 4 additions and 4 deletions

View File

@ -86,7 +86,7 @@ static void process_msg(struct mngr_msg *msg)
/* vm states data and helper functions */ /* vm states data and helper functions */
#define ACRN_DM_SOCK_ROOT "/run/acrn" #define ACRN_DM_SOCK_ROOT "/run/acrn/mngr"
struct vmm_struct { struct vmm_struct {
char name[MAX_NAME_LEN]; char name[MAX_NAME_LEN];
@ -168,9 +168,9 @@ static void vmm_update(void)
pvmname = NULL; pvmname = NULL;
snprintf(cmd, sizeof(cmd), snprintf(cmd, sizeof(cmd),
"find %s/ -name \"*.socket\" | " "find %s/ -name \"*monitor.*.socket\" | "
"sed \"s/\\/run\\/acrn\\///g\" | " "sed \"s/\\/run\\/acrn\\/mngr\\///g\" | "
"sed \"s/-monitor.socket//g\"", ACRN_DM_SOCK_ROOT); "awk -F. \'{ print $1 }\'", ACRN_DM_SOCK_ROOT);
shell_cmd(cmd, cmd_out, sizeof(cmd_out)); shell_cmd(cmd, cmd_out, sizeof(cmd_out));
/* Properly null-terminate cmd_out */ /* Properly null-terminate cmd_out */