Skip to content

Commit 498e8c0

Browse files
taoyuhongjren1
authored andcommitted
monitor: an interface of acrn-dm
A monitor component will be added to acrn-dm, which crteats socket, bind and listening at /run/acrn/vmname. Acrnctl & acrnd could conn -ect to the socket for communication, using defined message, in include/monitor_msg.h For each defined message, a message handler callback could be registered via monitor_add_msg_handler(). On received of a defined message, a certain call back will be called. Each callback can only see the message sender's socket-fd. When acrn-dm want report something, not triggered by incoming message it can send broadcast message, use monitor_broadcast(). Acked-by: Eddie Dong <eddie.dong@intel.com> Reviewed-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com> Reviewed-by: Zhao Yakui <yakui.zhao@intel.com> Reviewed-by: Yin, Fengwei <fengwei.yin@intel.com> Signed-off-by: Tao, Yuhong <yuhong.tao@intel.com>
1 parent 1ef6bba commit 498e8c0

File tree

5 files changed

+665
-0
lines changed

5 files changed

+665
-0
lines changed

devicemodel/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ SRCS += hw/acpi/acpi.c
8181

8282
# core
8383
#SRCS += core/bootrom.c
84+
SRCS += core/monitor.c
8485
SRCS += core/sw_load_common.c
8586
SRCS += core/sw_load_bzimage.c
8687
SRCS += core/sw_load_vsbl.c

devicemodel/core/main.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
#include "rtc.h"
6464
#include "version.h"
6565
#include "sw_load.h"
66+
#include "monitor.h"
6667

6768
#define GUEST_NIO_PORT 0x488 /* guest upcalls via i/o port */
6869

@@ -801,6 +802,7 @@ main(int argc, char *argv[])
801802

802803
vrtc_init(ctx, rtc_localtime);
803804
sci_init(ctx);
805+
monitor_init(ctx);
804806

805807
/*
806808
* Exit if a device emulation finds an error in its
@@ -863,6 +865,7 @@ main(int argc, char *argv[])
863865
*/
864866
mevent_dispatch();
865867

868+
monitor_close();
866869
vm_pause(ctx);
867870
fbsdrun_deletecpu(ctx, BSP);
868871
vm_unsetup_memory(ctx);

0 commit comments

Comments
 (0)