libxenlight: add console command
PATCH 1/1 libxenlight: add console command
Resending as attachment because of bad line endings apparently
Signed-off-by Tomasz Wroblewski <[email protected]>
tools/libxl/libxl.c +18 -0
@@ -468,6 +468,24 @@if (rc <0 ) {XL_LOG_ERRNOVAL (ctx,XL_LOG_ERROR , rc,"xc_domain_destroy failed for %d" , domid);return -1 ; + } +return 0 ; +} + +int libxl_console_attach (struct libxl_ctx *ctx,uint32_t domid,int cons_num) +{ +struct stat st; +const char *XENCONSOLE ="/usr/lib/xen/bin/xenconsole" ; +char *cmd =NULL ; + +if (stat (XENCONSOLE , &st) !=0 ) { +XL_LOG (ctx,XL_LOG_ERROR ,"could not access %s" ,XENCONSOLE ); +return ERROR_FAIL ; + } + + cmd =libxl_sprintf (ctx,"%s %d --num %d" ,XENCONSOLE , domid, cons_num); +if (system (cmd) !=0 ) { +return ERROR_FAIL ; }return 0 ; }
tools/libxl/libxl.h +2 -0
@@ -266,6 +266,8 @@int libxl_domain_pause (struct libxl_ctx *ctx,uint32_t domid);int libxl_domain_unpause (struct libxl_ctx *ctx,uint32_t domid); +int libxl_console_attach (struct libxl_ctx *ctx,uint32_t domid,int cons_num); +struct libxl_dominfo *libxl_domain_list (struct libxl_ctx *ctx,int *nb_domain);xc_dominfo_t *libxl_domain_infolist (struct libxl_ctx *ctx,int *nb_domain);
tools/libxl/xl.c +52 -0
71 lines not on this page · raw message
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel