tools: rework on vm ops

There are some problems to use VM operations in a deamon process,
such as Acrnd.  the list_vm() does not return VM informations, it
just print VM information to stdio, so we have get_vm_list()
to get VM list head vmngr_head; get_vm_list() always creates a
new fresh vm list every time, and must use put_vm_list() to delete
old list. So Acrnd need to create and destroy vm list frequently.
In fact we just need the vmngr_head to be an extern variable. And
to make it refreshable.We can insert new VMs, remove dead ones,
and update their state.

Reviewed-by: Yan Like <like.yan@intel.com>
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
This commit is contained in:
yuhong.tao@intel.com
2018-06-23 00:08:59 +08:00
committed by lijinxia
parent f0fe17de96
commit c4f9a2fd70
6 changed files with 224 additions and 89 deletions

View File

@@ -17,12 +17,6 @@
#include "mevent.h"
#include "acrn_mngr.h"
#ifdef MNGR_DEBUG
#define pdebug() fprintf(stderr, "%s %d\n", __FUNCTION__, __LINE__)
#else
#define pdebug() while(0){}
#endif
/* helpers */
/* Check if @path is a directory, and create if not exist */
static int check_dir(const char *path)