Commit Graph

77 Commits

Author SHA1 Message Date
Yan, Like 57d6a933f6 tools: correct several Makefile problems
1. mkdir ./tools/build if it does not exist;
2. correct static lib path for acrn-manager;
3. do not remove acrnlog.service if build under source code dir by default.

Reviewed-by: Geoffroy VanCutsem <geoffroy.vancutsem@intel.com>
Signed-off-by: Yan, Like <like.yan@intel.com>
2018-06-19 15:33:31 +08:00
yuhong.tao@intel.com 24ccdf2807 Tools:acrn-manager: use RELEASE in Makefile
The debug macro -DMNGR_DEBUG is selected by RELEASE value.
E.g., run 'make RELEASE=1' at the root of source code.

Acked-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
2018-06-14 13:40:44 +08:00
yuhong.tao@intel.com 64515cfe58 Tools:acrn-manager Fix wrong descrition of mngr_send_msg()
There is a mistake on description for mngr_send_msg() in acrn_mngr.h
We mistake the ack_len to req_len

Acked-by: Eddie Dong <eddie.dong@intel.com>
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
2018-06-11 16:45:24 +08:00
Kaige Fu 83791190d6 tools: acrnctl: Fix wrong descrition of mngr
There are some inappropriate descrition related to mngr, like "vmm msg".
Replace all "vmm" with "mngr".

No functional change.

Signed-off-by: Kaige Fu <kaige.fu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-06-08 13:46:19 +08:00
Kaige Fu 2dd4e8f81a tools: acrnctl: Add support for reseting vm
Add command reset to stop and then start vm.

Signed-off-by: Kaige Fu <kaige.fu@intel.com>
Reviewed-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
Reviewed-by: Yan, Like <like.yan@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-06-07 14:36:18 +08:00
Kaige Fu 7a0e8ddeec tools: acrnctl: Add support for resuming vm
Add command resume to resume vm from suspend state.

Signed-off-by: Kaige Fu <kaige.fu@intel.com>
Reviewed-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
Reviewed-by: Yan, Like <like.yan@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-06-07 14:36:18 +08:00
Kaige Fu d6eb39daf4 tools: acrnctl: Add support for suspending vm
Add command suspend to switch vm to suspend state.

Signed-off-by: Kaige Fu <kaige.fu@intel.com>
Reviewed-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
Reviewed-by: Yan, Like <like.yan@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-06-07 14:36:18 +08:00
Kaige Fu 665c2ee93f tools: acrnctl: Add support for continuing vm
Add command continue to start vm from pause state.

Signed-off-by: Kaige Fu <kaige.fu@intel.com>
Reviewed-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
Reviewed-by: Yan, Like <like.yan@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-06-07 14:36:18 +08:00
Kaige Fu 1933d60c29 tools: acrnctl: Add support for pausing vm
Add command pasue to pause vm.

Signed-off-by: Kaige Fu <kaige.fu@intel.com>
Reviewed-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
Reviewed-by: Yan, Like <like.yan@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-06-07 14:36:18 +08:00
Kaige Fu 3000edc6ad tools: acrnctl: Free vmmngr list after vm ops done
vmmngr_struct entry is allocated in get_vm_list. we should free it after vm ops done.

Signed-off-by: Kaige Fu <kaige.fu@intel.com>
Reviewed-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
Reviewed-by: Yan, Like <like.yan@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-06-07 14:36:18 +08:00
Kaige Fu 2da5e7c16a tools: acrnctl: Use new IPC lib to connect acrn-dm
this patch aim at
    1. Use new IPC lib to connect acrn-dm.
    2. Export list_vm, start_vm and stop_vm and acrnd will use them later.
    3. Rename vmm releated struct and function

Signed-off-by: Kaige Fu <kaige.fu@intel.com>
Reviewed-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
Reviewed-by: Yan, Like <like.yan@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-06-07 14:36:18 +08:00
Kaige Fu 143c49b0d2 tools: acrnctl: Refactor help info
Add unified function .valid_args to check validation of args.

Signed-off-by: Kaige Fu <kaige.fu@intel.com>
Reviewed-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
Reviewed-by: Yan, Like <like.yan@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2018-06-07 14:36:18 +08:00
Yan, Like c84766a869 Tools: add Makefile for all tools
Add a Makefile under ./tools to avoid changing top-level Makefile frequently

Acked-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
Signed-off-by: Yan, Like <like.yan@intel.com>
2018-06-07 09:56:33 +08:00
Geoffroy Van Cutsem 7f2a7d47dd Tools Makefiles: enhancement to keep source code tree clean
Running 'make' will leave 3 files in the source code tree that
are not cleaned by a subsequent 'make clean'. These are:
* tools/acrn-crashlog/acrnprobe/include/version.h
* tools/acrn-crashlog/usercrash/include/version.h
* tools/acrn-manager/acrn_mngr.o
(as reported by 'git status' after 'make')

This patch changes the location of these files so they are
created in the target build directory and hence properly
cleaned when running 'make clean'

Other minor changes to the Makefiles include:
* Remove BASEDIR by the built-in CURDIR variable
* Add .PHONY targets

Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2018-06-05 10:22:24 +08:00
David B. Kinder f4122d99c5 license: Replace license text with SPDX tag
Replace the BSD-3-Clause boiler plate license text with an SPDX tag.

Fixes: #189

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-06-01 10:43:06 +08:00
Kaige Fu e32a5cadf2 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>
2018-06-01 10:26:27 +08:00
yuhong.tao@intel.com eada59c934 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>
2018-05-31 11:25:47 +08:00
yuhong.tao@intel.com 53ecd932ad Tools: acrn-manager: add definitions of message sturcts
We define messages into three types, accroding to which component is
responsible to handle it:
1. message handled by sos lifecycle service, from vm manager;
2. message handled by vm manager, from sos lifecycle service&dm;
3. message handled by dm, from vm manager.

Reviewed-by: Kaige Fu <kaige.fu@intel.com>
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>
2018-05-31 11:25:47 +08:00
yuhong.tao@intel.com 7d7cf309eb Tools: acrn-manager: add lib with IPC helpers
Add lib to help IPC between components, including SOS lifecycle service,
acrn manager and devicemodule.
Following helper functions are included:
  int mngr_open_un() - create a descripter for vm management IPC
  void mngr_close() - close descripter and release the resouces
  int mngr_add_handler() - add a handler for message specified by msg
  int mngr_send_msg() - send a message and wait for ack

Reviewed-by: Kaige Fu <kaige.fu@intel.com>
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>
Sigbed-off-by: Yan Like <like.yan@intel.com>
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
2018-05-31 11:25:47 +08:00
David B. Kinder 50324e5876 doc: fix tools docs formatting and clarity
This continues the editing from PR #276 with formatting and clarity
edits to have these tool documents blend in with the rest of the ACRN
documentation.  It also builds on PR #307 that set up the doc build
infrastructure to allow leaving these tool docs within the tools/
folder.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-05-30 10:36:31 -07:00
Taimoor f4b9412013 fix acrntrace README
fix acrnlog README

Fix acrn-manager README

Signed-off-by: T <shrmrf@users.noreply.github.com>
2018-05-29 14:24:17 -07:00
Kaige Fu 26b089932c tools: acrnctl: Properly null-terminate cmd_out and buf
Library function strtok_r and printf accept a string with the constraint that
the string they receive is properly null-terminated.

Signed-off-by: Kaige Fu <kaige.fu@intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
2018-05-29 14:13:20 +08:00
Kaige Fu 11abe6e81e tools: acrnctl: fix possibility of buffer overflow
Replace strcpy with strncpy to avoid possibility of buffer overflow

Signed-off-by: Kaige Fu <kaige.fu@intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
2018-05-29 14:13:20 +08:00
Tonny Tzeng 76cc3dd808 tools: invoke compiler with $(CC) instead of gcc for consistency
Signed-off-by: Tonny Tzeng tonny.tzeng@intel.com
2018-05-18 15:02:09 +08:00
Miguel Bernal Marin ace25dd3db Makefile: implement make install
The make install target was missing. This commits adds the intall target
which uses the install target from subprojects.

Also a make install target was created in each tool program.

Signed-off-by: Miguel Bernal Marin <miguel.bernal.marin@linux.intel.com>
2018-05-17 10:24:00 +08:00
Minggui Cao fb19b296ea add a makefile under project root directory
it can be used as following:
  make ==> to make hypervisor & devicemodel & tools
also modify tools makefile to support out-dir setting.

Signed-off-by: Minggui Cao <minggui.cao@intel.com>
Reviewed-by: Jack Ren <jack.ren@intel.com>
2018-05-15 18:03:34 +08:00
Yan, Like 867e56d04b Move ACRN tools code directory one level higher
The tools directory is moved out of ./devicemodle, to be in parallel with
hypervisor, devicemodel and doc.

Signed-off-by: Yan, Like <like.yan@intel.com>
2018-05-15 18:03:33 +08:00