libxl: rtc_timeoffset fix; uptime fix; typo corrections
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/1 libxl: rtc_timeoffset fix; uptime fix; typo corrections
rtc_timeoffset did not allow negative values to be specified; fixing this required changing its type to a signed integer and allowing negative numbers as values in the configuration file without tripping an error message.
"xl uptime" needed to be modified to allow no arguments.
Minor typo fixes.
--- tools/libxl/libxl.c | 8 ++++---- tools/libxl/libxl_types.idl | 2 +- tools/libxl/libxlu_cfg_l.l | 2 +- tools/libxl/xl_cmdimpl.c | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-)
tools/libxl/libxl.c +4 -4
@@ -554,7 +554,7 @@ libxl_dominfo * libxl_list_domain(libxl_ctx *ctx, int *nb_domain_out) ret =xc_domain_getinfolist (ctx->xch,0 ,1024 , info);if (ret<0 ) { -LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"geting domain info list" ); +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"getting domain info list" );free (ptr);return NULL ; }
@@ -573,7 +573,7 @@ int libxl_domain_info(libxl_ctx *ctx, libxl_dominfo *info_r, ret =xc_domain_getinfolist (ctx->xch, domid,1 , &xcinfo);if (ret<0 ) { -LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"geting domain info list" ); +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"getting domain info list" );return ERROR_FAIL ; }if (ret==0 || xcinfo.domain != domid)return ERROR_INVAL ;
@@ -677,7 +677,7 @@ libxl_vminfo * libxl_list_vm(libxl_ctx *ctx, int *nb_vm_out) ret =xc_domain_getinfolist (ctx->xch,1 ,1024 , info);if (ret<0 ) { -LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"geting domain info list" ); +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"getting domain info list" );return NULL ; }for (idx = i =0 ; i < ret; i++) {
@@ -1375,7 +1375,7 @@ void libxl__destroy_domid(libxl__egc *egc, libxl__destroy_domid_state *dis)case 0 :break ;case ERROR_INVAL : -LIBXL__LOG (ctx,LIBXL__LOG_ERROR ,"non-existant domain %d" , domid); +LIBXL__LOG (ctx,LIBXL__LOG_ERROR ,"non-existent domain %d" , domid);default : goto out; }
tools/libxl/libxl_types.idl +1 -1
@@ -273,7 +273,7 @@ libxl_domain_build_info = Struct("domain_build_info",[ ("target_memkb", MemKB), ("video_memkb", MemKB), ("shadow_memkb", MemKB), - ("rtc_timeoffset", uint32), + ("rtc_timeoffset", integer), ("exec_ssidref", uint32), ("localtime", libxl_defbool), ("disable_migrate", libxl_defbool),
tools/libxl/libxlu_cfg_l.l +1 -1
@@ -56,7 +56,7 @@ void xlu__cfg_yyset_column(int column_no, yyscan_t yyscanner); yylval->string= xlu__cfgl_strdup(ctx,yytext); GOT(IDENT); } -[0-9][0-9a-fx]* { +-?[0-9][0-9a-fx]* { yylval->string= xlu__cfgl_strdup(ctx,yytext); GOT(NUMBER); }
tools/libxl/xl_cmdimpl.c +1 -1
@@ -6125,7 +6125,7 @@ int main_uptime(int argc, char **argv)int nb_doms =0 ;int opt; - SWITCH_FOREACH_OPT(opt, "s", NULL, "uptime", 1) { + SWITCH_FOREACH_OPT(opt, "s", NULL, "uptime", 0) {case 's' : short_mode =1 ;break ;
Signature · 1 line
1.8.1.5
Quoted 10 lines · John Weekes
rtc_timeoffsetdid not allow negative values to be specified; fixing this required changing its type to a signed integer and allowing negative numbers as values in the configuration file without tripping an error message."xl uptime" needed to be modified to allow no arguments.
Minor typo fixes.
Signed-off-by John Weekes <[email protected]>
Thanks for the fixes -- but this will need to be broken down into three separate patches.
-George
Quoted 98 lines
--- tools/libxl/libxl.c | 8 ++++---- tools/libxl/libxl_types.idl | 2 +- tools/libxl/libxlu_cfg_l.l | 2 +- tools/libxl/xl_cmdimpl.c | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-)tools/libxl/libxl.c +1
-1@@ -554,7 +554,7 @@ libxl_dominfo * libxl_list_domain(libxl_ctx *ctx, int *nb_domain_out) ret =xc_domain_getinfolist (ctx->xch,0 ,1024 , info);if (ret<0 ) { -LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"geting domain info list" ); +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"getting domain info list");free (ptr);return NULL ;}tools/libxl/libxl.c +1
-1@@ -573,7 +573,7 @@ int libxl_domain_info(libxl_ctx *ctx, libxl_dominfo *info_r, ret =xc_domain_getinfolist (ctx->xch, domid,1 , &xcinfo);if (ret<0 ) { -LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"geting domain info list" ); +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"getting domain info list");return ERROR_FAIL ; }if (ret==0 || xcinfo.domain != domid) return ERROR_INVAL;tools/libxl/libxl.c +1
-1@@ -677,7 +677,7 @@ libxl_vminfo * libxl_list_vm(libxl_ctx *ctx, int *nb_vm_out) ret =xc_domain_getinfolist (ctx->xch,1 ,1024 , info);if (ret<0 ) { -LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"geting domain info list" ); +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"getting domain info list");return NULL ; }for (idx = i = 0; i < ret; i++) {tools/libxl/libxl.c +1
-1@@ -1375,7 +1375,7 @@ void libxl__destroy_domid(libxl__egc *egc, libxl__destroy_domid_state *dis)case 0 :break ;case ERROR_INVAL : -LIBXL__LOG (ctx,LIBXL__LOG_ERROR ,"non-existant domain %d" , domid); +LIBXL__LOG (ctx,LIBXL__LOG_ERROR ,"non-existent domain %d" , domid);default : goto out;}tools/libxl/libxl_types.idl +1
-1@@ -273,7 +273,7 @@ libxl_domain_build_info = Struct("domain_build_info",[ ("target_memkb", MemKB), ("video_memkb", MemKB), ("shadow_memkb", MemKB), - ("rtc_timeoffset", uint32), + ("rtc_timeoffset", integer), ("exec_ssidref", uint32), ("localtime", libxl_defbool), ("disable_migrate", libxl_defbool),tools/libxl/libxlu_cfg_l.l +1
-1@@ -56,7 +56,7 @@ void xlu__cfg_yyset_column(int column_no, yyscan_t yyscanner); yylval->string= xlu__cfgl_strdup(ctx,yytext); GOT(IDENT); } -[0-9][0-9a-fx]* { +-?[0-9][0-9a-fx]* { yylval->string= xlu__cfgl_strdup(ctx,yytext); GOT(NUMBER);}tools/libxl/xl_cmdimpl.c +1
-1@@ -6125,7 +6125,7 @@ int main_uptime(int argc, char **argv)int nb_doms =0 ;int opt; - SWITCH_FOREACH_OPT(opt, "s", NULL, "uptime", 1) { + SWITCH_FOREACH_OPT(opt, "s", NULL, "uptime", 0) {case 's' : short_mode =1 ;break ; --1.8.1.5
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
George Dunlap writes ("Re: [Xen-devel] [PATCH] libxl: rtc_timeoffset fix; uptime fix; typo corrections"):
Quoted 6 lines
Quoted 4 lines · John Weekes
rtc_timeoffsetdid not allow negative values to be specified; fixing this required changing its type to a signed integer and allowing negative numbers as values in the configuration file without tripping an error message.
...
This part looks OK to me - rather surprisingly perhaps, given that it doesn't actually change at all the place where the number is converted from a string to an integer!
The rest is fine too.
Quoted 2 lines
Thanks for the fixes -- but this will need to be broken down into three separate patches.
Yes.
Thanks,
Ian.