mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-07 03:40:27 +00:00
DM: adapt dm-monitor and acrnctl to use the helpers
Adapt dm-monitor and acrnctl to use the helper functions and new message definitions in acrn_mngr.h. These jobs must be done in one commit to avoid build problems: 1. message transmission and callback registration code are moved to libacrn-mngr.a, so old functions in dm-monitor could be removed to make code clean; 2. remove unnecessary monior_msg.h; 3. minor changes to acrnctl accordingly. Reviewed-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com> Reviewed-by: Kevin Tian <kevin.tian@intel.com> Reviewed-by: Wang, Yu <yu1.wang@intel.com> signed-off-by: Yan Like <like.yan@intel.com> Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
This commit is contained in:
committed by
lijinxia
parent
53ecd932ad
commit
eada59c934
@@ -6,6 +6,7 @@ all: $(OUT_DIR)/libacrn-mngr.a $(OUT_DIR)/acrnctl
|
||||
$(OUT_DIR)/libacrn-mngr.a: acrn_mngr.c acrn_mngr.h
|
||||
$(CC) -c acrn_mngr.c -DMNGR_DEBUG -I../../devicemodel/include -Wall -g
|
||||
ar -cr $@ acrn_mngr.o
|
||||
cp ./acrn_mngr.h $(OUT_DIR)/
|
||||
|
||||
$(OUT_DIR)/acrnctl: acrnctl.c
|
||||
$(CC) -o $(OUT_DIR)/acrnctl acrnctl.c -I../../devicemodel/include -Wall -g
|
||||
|
@@ -42,7 +42,7 @@
|
||||
#include <sys/queue.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/un.h>
|
||||
#include "monitor_msg.h"
|
||||
#include "acrn_mngr.h"
|
||||
|
||||
#define ACRNCTL_OPT_ROOT "/opt/acrn/conf"
|
||||
#define MAX_NAME_LEN (128)
|
||||
@@ -70,7 +70,7 @@ static int shell_cmd(const char *cmd, char *outbuf, int len)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void process_msg(struct vmm_msg *msg)
|
||||
static void process_msg(struct mngr_msg *msg)
|
||||
{
|
||||
if (msg->len < sizeof(*msg))
|
||||
return;
|
||||
@@ -508,7 +508,7 @@ static int send_stop_msg(char *vmname)
|
||||
{
|
||||
int fd, ret;
|
||||
struct sockaddr_un addr;
|
||||
struct vmm_msg msg;
|
||||
struct mngr_msg msg;
|
||||
struct timeval timeout;
|
||||
fd_set rfd, wfd;
|
||||
char buf[128];
|
||||
@@ -530,8 +530,8 @@ static int send_stop_msg(char *vmname)
|
||||
goto connect_err;
|
||||
}
|
||||
|
||||
msg.magic = VMM_MSG_MAGIC;
|
||||
msg.msgid = REQ_STOP;
|
||||
msg.magic = MNGR_MSG_MAGIC;
|
||||
msg.msgid = DM_STOP;
|
||||
msg.len = sizeof(msg);
|
||||
|
||||
timeout.tv_sec = 1; /* wait 1 second for read/write socket */
|
||||
|
Reference in New Issue
Block a user