libxl: use libxl__ namespace for hidden functions
PATCH 1/1 libxl: use libxl__ namespace for hidden functions
As described in libxl.h header internal functions should use the libxl__ namespace.
I'm not sure this churn is worth it but we are starting to see patches adding internal functions which do not follow the convention and it is hard to ask for a respin with a straight face when there is so much existing dirty laundry so we should either obey the documented convention or ditch it.
I didn't touch flexarrays or xs_writev which is something of a special case for use in dm_xenstore_record_pid (libxl__xs_writev already exists but isn't immediately suitable for use).
PATCH 1/1 libxl: Ensure all _hidden functions use libxl__ prefix
# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1283851103 -3600
# Node ID a13d2fc2c1f6120cd9bcb3b2a56f10e18fdd17f0 # Parent 3337bac80d870221ebfa7bc0365b1706f5fa9dde
libxl: Ensure all _hidden functions use libxl__ prefix
This patch covers all those which could be trivially converted automatically.
sed -n -e 's/_hidden.*[ \*]libxl_\([^_][^()]*\)(.*/\1/pg' tools/libxl/*.h | \
while read i ; do \
sed -i -e "s/libxl_$i/libxl__$i/g" tools/libxl/*.[ch]; \done
sed -n -e 's/_hidden.*_libxl_\([^_][^()]*\)(.*/\1/pg' tools/libxl/*.h | \
while read i ; do \
sed -i -e "s/_libxl_$i/libxl__$i/g" tools/libxl/*.[ch]; \done
Check that diffstat includes libxl but not xl.
Fixup tools/libxl/xl_cmdimpl.c which used libxl_device_del instead of libxl_device_disk_del in a printf.
tools/libxl/libxl.c +326 -326
@@ -119,9 +119,9 @@ int libxl_domain_make(libxl_ctx *ctx, lixs_transaction_t t;xen_domain_handle_t handle; - uuid_string =libxl_uuid2string (&gc, info->uuid); + uuid_string =libxl__uuid2string (&gc, info->uuid);if (!uuid_string) { -libxl_free_all (&gc); +libxl__free_all (&gc);return ERROR_NOMEM ; }
@@ -136,27 +136,27 @@ int libxl_domain_make(libxl_ctx *ctx, li ret =xc_domain_create (ctx->xch, info->ssidref, handle, flags, domid);if (ret <0 ) {XL_LOG_ERRNOVAL (ctx,XL_LOG_ERROR , ret,"domain creation fail" ); -libxl_free_all (&gc); +libxl__free_all (&gc);return ERROR_FAIL ; } ret =xc_cpupool_movedomain (ctx->xch, info->poolid, *domid);if (ret <0 ) {XL_LOG_ERRNOVAL (ctx,XL_LOG_ERROR , ret,"domain move fail" ); -libxl_free_all (&gc); +libxl__free_all (&gc);return ERROR_FAIL ; } - dom_path =libxl_xs_get_dompath (&gc, *domid); + dom_path =libxl__xs_get_dompath (&gc, *domid);if (!dom_path) { -libxl_free_all (&gc); +libxl__free_all (&gc);return ERROR_FAIL ; } - vm_path =libxl_sprintf (&gc,"/vm/%s" , uuid_string); + vm_path =libxl__sprintf (&gc,"/vm/%s" , uuid_string);if (!vm_path) {XL_LOG (ctx,XL_LOG_ERROR ,"cannot allocate create paths" ); -libxl_free_all (&gc); +libxl__free_all (&gc);return ERROR_FAIL ; }
@@ -177,39 +177,39 @@ retry_transaction:xs_mkdir (ctx->xsh, t, vm_path);xs_set_permissions (ctx->xsh, t, vm_path, roperm,ARRAY_SIZE (roperm)); -xs_write (ctx->xsh, t,libxl_sprintf (&gc,"%s/vm" , dom_path), vm_path,strlen (vm_path)); +xs_write (ctx->xsh, t,libxl__sprintf (&gc,"%s/vm" , dom_path), vm_path,strlen (vm_path)); rc =libxl_domain_rename (ctx, *domid,0 , info->name, t);if (rc) { -libxl_free_all (&gc); +libxl__free_all (&gc);return rc; }for (i =0 ; i <ARRAY_SIZE (rw_paths); i++) { -char *path =libxl_sprintf (&gc,"%s/%s" , dom_path, rw_paths[i]); +char *path =libxl__sprintf (&gc,"%s/%s" , dom_path, rw_paths[i]);xs_mkdir (ctx->xsh, t, path);xs_set_permissions (ctx->xsh, t, path, rwperm,ARRAY_SIZE (rwperm)); }for (i =0 ; i <ARRAY_SIZE (ro_paths); i++) { -char *path =libxl_sprintf (&gc,"%s/%s" , dom_path, ro_paths[i]); +char *path =libxl__sprintf (&gc,"%s/%s" , dom_path, ro_paths[i]);xs_mkdir (ctx->xsh, t, path);xs_set_permissions (ctx->xsh, t, path, roperm,ARRAY_SIZE (roperm)); } -xs_write (ctx->xsh, t,libxl_sprintf (&gc,"%s/uuid" , vm_path), uuid_string,strlen (uuid_string)); -xs_write (ctx->xsh, t,libxl_sprintf (&gc,"%s/name" , vm_path), info->name,strlen (info->name)); +xs_write (ctx->xsh, t,libxl__sprintf (&gc,"%s/uuid" , vm_path), uuid_string,strlen (uuid_string)); +xs_write (ctx->xsh, t,libxl__sprintf (&gc,"%s/name" , vm_path), info->name,strlen (info->name));if (info->poolname) -xs_write (ctx->xsh, t,libxl_sprintf (&gc,"%s/pool_name" , vm_path), info->poolname,strlen (info->poolname)); +xs_write (ctx->xsh, t,libxl__sprintf (&gc,"%s/pool_name" , vm_path), info->poolname,strlen (info->poolname)); -libxl_xs_writev (&gc, t, dom_path, info->xsdata); -libxl_xs_writev (&gc, t,libxl_sprintf (&gc,"%s/platform" , dom_path), info->platformdata); +libxl__xs_writev (&gc, t, dom_path, info->xsdata); +libxl__xs_writev (&gc, t,libxl__sprintf (&gc,"%s/platform" , dom_path), info->platformdata); -xs_write (ctx->xsh, t,libxl_sprintf (&gc,"%s/control/platform-feature-multiprocessor-suspend" , dom_path),"1" ,1 ); +xs_write (ctx->xsh, t,libxl__sprintf (&gc,"%s/control/platform-feature-multiprocessor-suspend" , dom_path),"1" ,1 );if (!xs_transaction_end (ctx->xsh, t,0 ))if (errno ==EAGAIN ) goto retry_transaction; -libxl_free_all (&gc); +libxl__free_all (&gc);return 0 ; }
@@ -225,10 +225,10 @@ int libxl_domain_rename(libxl_ctx *ctx,xs_transaction_t our_trans =0 ;int rc; - dom_path =libxl_xs_get_dompath (&gc, domid); + dom_path =libxl__xs_get_dompath (&gc, domid);if (!dom_path) goto x_nomem; - name_path=libxl_sprintf (&gc,"%s/name" , dom_path); + name_path=libxl__sprintf (&gc,"%s/name" , dom_path);if (!name_path) goto x_nomem; retry_transaction:
@@ -286,7 +286,7 @@ int libxl_domain_rename(libxl_ctx *ctx, rc =0 ; x_rc:if (our_trans)xs_transaction_end (ctx->xsh, our_trans,1 ); -libxl_free_all (&gc); +libxl__free_all (&gc);return rc; x_fail: rc =ERROR_FAIL ; goto x_rc;
@@ -311,26 +311,26 @@ int libxl_domain_build(libxl_ctx *ctx, lif (ret) goto out; - vments =libxl_calloc (&gc,7 ,sizeof (char *)); + vments =libxl__calloc (&gc,7 ,sizeof (char *)); vments[0 ] ="rtc/timeoffset" ; vments[1 ] = (info->u.hvm.timeoffset) ? info->u.hvm.timeoffset :"" ; vments[2 ] ="image/ostype" ; vments[3 ] ="hvm" ; vments[4 ] ="start_time" ; - vments[5 ] =libxl_sprintf (&gc,"%lu.%02d" , start_time.tv_sec,(int )start_time.tv_usec/10000 ); + vments[5 ] =libxl__sprintf (&gc,"%lu.%02d" , start_time.tv_sec,(int )start_time.tv_usec/10000 ); }else { ret =build_pv (ctx, domid, info, state);if (ret) goto out; - vments =libxl_calloc (&gc,11 ,sizeof (char *)); + vments =libxl__calloc (&gc,11 ,sizeof (char *)); i =0 ; vments[i++] ="image/ostype" ; vments[i++] ="linux" ; vments[i++] ="image/kernel" ; vments[i++] = (char *) info->kernel.path; vments[i++] ="start_time" ; - vments[i++] =libxl_sprintf (&gc,"%lu.%02d" , start_time.tv_sec,(int )start_time.tv_usec/10000 ); + vments[i++] =libxl__sprintf (&gc,"%lu.%02d" , start_time.tv_sec,(int )start_time.tv_usec/10000 );if (info->u.pv.ramdisk.path) { vments[i++] ="image/ramdisk" ; vments[i++] = (char *) info->u.pv.ramdisk.path;
@@ -346,7 +346,7 @@ out:if (!info->hvm)libxl__file_reference_unmap (&info->u.pv.ramdisk); -libxl_free_all (&gc); +libxl__free_all (&gc);return ret; }
@@ -370,22 +370,22 @@ int libxl_domain_restore(libxl_ctx *ctx,gettimeofday (&start_time,NULL );if (info->hvm) { - vments =libxl_calloc (&gc,7 ,sizeof (char *)); + vments =libxl__calloc (&gc,7 ,sizeof (char *)); vments[0 ] ="rtc/timeoffset" ; vments[1 ] = (info->u.hvm.timeoffset) ? info->u.hvm.timeoffset :"" ; vments[2 ] ="image/ostype" ; vments[3 ] ="hvm" ; vments[4 ] ="start_time" ; - vments[5 ] =libxl_sprintf (&gc,"%lu.%02d" , start_time.tv_sec,(int )start_time.tv_usec/10000 ); + vments[5 ] =libxl__sprintf (&gc,"%lu.%02d" , start_time.tv_sec,(int )start_time.tv_usec/10000 ); }else { - vments =libxl_calloc (&gc,11 ,sizeof (char *)); + vments =libxl__calloc (&gc,11 ,sizeof (char *)); i =0 ; vments[i++] ="image/ostype" ; vments[i++] ="linux" ; vments[i++] ="image/kernel" ; vments[i++] = (char *) info->kernel.path; vments[i++] ="start_time" ; - vments[i++] =libxl_sprintf (&gc,"%lu.%02d" , start_time.tv_sec,(int )start_time.tv_usec/10000 ); + vments[i++] =libxl__sprintf (&gc,"%lu.%02d" , start_time.tv_sec,(int )start_time.tv_usec/10000 );if (info->u.pv.ramdisk.path) { vments[i++] ="image/ramdisk" ; vments[i++] = (char *) info->u.pv.ramdisk.path;
@@ -424,7 +424,7 @@ out: } errno = esave; -libxl_free_all (&gc); +libxl__free_all (&gc);return ret; }
@@ -453,7 +453,7 @@ int libxl_domain_resume(libxl_ctx *ctx, rc =ERROR_FAIL ; } out: -libxl_free_all (&gc); +libxl__free_all (&gc);return 0 ; }
@@ -476,27 +476,27 @@ int libxl_domain_preserve(libxl_ctx *ctxint rc; - preserved_name =libxl_sprintf (&gc,"%s%s" , info->name, name_suffix); + preserved_name =libxl__sprintf (&gc,"%s%s" , info->name, name_suffix);if (!preserved_name) { -libxl_free_all (&gc); +libxl__free_all (&gc);return ERROR_NOMEM ; } - uuid_string =libxl_uuid2string (&gc, new_uuid); + uuid_string =libxl__uuid2string (&gc, new_uuid);if (!uuid_string) { -libxl_free_all (&gc); +libxl__free_all (&gc);return ERROR_NOMEM ; } - dom_path =libxl_xs_get_dompath (&gc, domid); + dom_path =libxl__xs_get_dompath (&gc, domid);if (!dom_path) { -libxl_free_all (&gc); +libxl__free_all (&gc);return ERROR_FAIL ; } - vm_path =libxl_sprintf (&gc,"/vm/%s" , uuid_string); + vm_path =libxl__sprintf (&gc,"/vm/%s" , uuid_string);if (!vm_path) { -libxl_free_all (&gc); +libxl__free_all (&gc);return ERROR_FAIL ; }
@@ -512,17 +512,17 @@ int libxl_domain_preserve(libxl_ctx *ctxxs_mkdir (ctx->xsh, t, vm_path);xs_set_permissions (ctx->xsh, t, vm_path, roperm,ARRAY_SIZE (roperm)); -xs_write (ctx->xsh, t,libxl_sprintf (&gc,"%s/vm" , dom_path), vm_path,strlen (vm_path)); +xs_write (ctx->xsh, t,libxl__sprintf (&gc,"%s/vm" , dom_path), vm_path,strlen (vm_path)); rc =libxl_domain_rename (ctx, domid, info->name, preserved_name, t);if (rc)return rc; -xs_write (ctx->xsh, t,libxl_sprintf (&gc,"%s/uuid" , vm_path), uuid_string,strlen (uuid_string)); +xs_write (ctx->xsh, t,libxl__sprintf (&gc,"%s/uuid" , vm_path), uuid_string,strlen (uuid_string));if (!xs_transaction_end (ctx->xsh, t,0 ))if (errno ==EAGAIN ) goto retry_transaction; -libxl_free_all (&gc); +libxl__free_all (&gc);return 0 ; }
@@ -692,11 +692,11 @@ int libxl_domain_unpause(libxl_ctx *ctx,int ret, rc =0 ;if (is_hvm (ctx, domid)) { - path =libxl_sprintf (&gc,"/local/domain/0/device-model/%d/state" , domid); - state =libxl_xs_read (&gc,XBT_NULL , path); + path =libxl__sprintf (&gc,"/local/domain/0/device-model/%d/state" , domid); + state =libxl__xs_read (&gc,XBT_NULL , path);if (state !=NULL && !strcmp (state,"paused" )) { -libxl_xs_write (&gc,XBT_NULL ,libxl_sprintf (&gc,"/local/domain/0/device-model/%d/command" , domid),"continue" ); -libxl_wait_for_device_model (ctx, domid,"running" ,NULL ,NULL ); +libxl__xs_write (&gc,XBT_NULL ,libxl__sprintf (&gc,"/local/domain/0/device-model/%d/command" , domid),"continue" ); +libxl__wait_for_device_model (ctx, domid,"running" ,NULL ,NULL ); } } ret =xc_domain_unpause (ctx->xch, domid);
@@ -704,7 +704,7 @@ int libxl_domain_unpause(libxl_ctx *ctx,XL_LOG_ERRNO (ctx,XL_LOG_ERROR ,"unpausing domain %d" , domid); rc =ERROR_FAIL ; } -libxl_free_all (&gc); +libxl__free_all (&gc);return rc; }
@@ -723,17 +723,17 @@ int libxl_domain_shutdown(libxl_ctx *ctxchar *dom_path;if (req >ARRAY_SIZE (req_table)) { -libxl_free_all (&gc); +libxl__free_all (&gc);return ERROR_INVAL ; } - dom_path =libxl_xs_get_dompath (&gc, domid); + dom_path =libxl__xs_get_dompath (&gc, domid);if (!dom_path) { -libxl_free_all (&gc); +libxl__free_all (&gc);return ERROR_FAIL ; } - shutdown_path =libxl_sprintf (&gc,"%s/control/shutdown" , dom_path); + shutdown_path =libxl__sprintf (&gc,"%s/control/shutdown" , dom_path);xs_write (ctx->xsh,XBT_NULL , shutdown_path, req_table[req],strlen (req_table[req]));if (is_hvm (ctx,domid)) {
@@ -758,7 +758,7 @@ int libxl_domain_shutdown(libxl_ctx *ctx } } } -libxl_free_all (&gc); +libxl__free_all (&gc);return 0 ; }
@@ -789,7 +789,7 @@ int libxl_wait_for_disk_ejects(libxl_ctxfor (i =0 ; i < num_disks; i++) {if (asprintf (&(waiter[i].path),"%s/device/vbd/%d/eject" , -libxl_xs_get_dompath (&gc, domid), +libxl__xs_get_dompath (&gc, domid),device_disk_dev_number (disks[i].virtpath)) <0 ) goto out;if (asprintf (&(waiter[i].token),"%d" ,LIBXL_EVENT_DISK_EJECT ) <0 )
@@ -798,7 +798,7 @@ int libxl_wait_for_disk_ejects(libxl_ctx } rc =0 ; out: -libxl_free_all (&gc); +libxl__free_all (&gc);return rc; }
@@ -857,29 +857,29 @@ int libxl_event_get_disk_eject_info(libxchar *backend;char *value; - value =libxl_xs_read (&gc,XBT_NULL , event->path); + value =libxl__xs_read (&gc,XBT_NULL , event->path);if (!value ||strcmp (value,"eject" )) { -libxl_free_all (&gc); +libxl__free_all (&gc);return 0 ; } path =strdup (event->path); path[strlen (path) -6 ] ='\0' ; - backend =libxl_xs_read (&gc,XBT_NULL ,libxl_sprintf (&gc,"%s/backend" , path)); + backend =libxl__xs_read (&gc,XBT_NULL ,libxl__sprintf (&gc,"%s/backend" , path)); disk->backend_domid =0 ; disk->domid = domid; disk->physpath =NULL ; disk->phystype =0 ;/* this value is returned to the user: do not free right away */ - disk->virtpath =libxl_xs_read (&gc,XBT_NULL ,libxl_sprintf (&gc,"%s/dev" , backend)); + disk->virtpath =libxl__xs_read (&gc,XBT_NULL ,libxl__sprintf (&gc,"%s/dev" , backend)); disk->unpluggable =1 ; disk->readwrite =0 ; disk->is_cdrom =1 ;free (path); -libxl_free_all (&gc); +libxl__free_all (&gc);return 1 ; }
@@ -889,7 +889,7 @@ static int libxl_destroy_device_model(lichar *pid;int ret; - pid =libxl_xs_read (&gc,XBT_NULL ,libxl_sprintf (&gc,"/local/domain/%d/image/device-model-pid" , domid)); + pid =libxl__xs_read (&gc,XBT_NULL ,libxl__sprintf (&gc,"/local/domain/%d/image/device-model-pid" , domid));if (!pid) {int stubdomid =libxl_get_stubdom_id (ctx, domid);if (!stubdomid) {
@@ -901,7 +901,7 @@ static int libxl_destroy_device_model(li ret =libxl_domain_destroy (ctx, stubdomid,0 ); goto out; } -xs_rm (ctx->xsh,XBT_NULL ,libxl_sprintf (&gc,"/local/domain/0/device-model/%d" , domid)); +xs_rm (ctx->xsh,XBT_NULL ,libxl__sprintf (&gc,"/local/domain/0/device-model/%d" , domid)); ret =kill (atoi (pid),SIGHUP );if (ret <0 && errno ==ESRCH ) {
@@ -915,7 +915,7 @@ static int libxl_destroy_device_model(li atoi(pid)); } out: -libxl_free_all (&gc); +libxl__free_all (&gc);return ret; }
@@ -930,11 +930,11 @@ int libxl_domain_destroy(libxl_ctx *ctx, dm_present =1 ; }else {char *pid; - pid =libxl_xs_read (&gc,XBT_NULL ,libxl_sprintf (&gc,"/local/domain/%d/image/device-model-pid" , domid)); + pid =libxl__xs_read (&gc,XBT_NULL ,libxl__sprintf (&gc,"/local/domain/%d/image/device-model-pid" , domid)); dm_present = (pid !=NULL ); } - dom_path =libxl_xs_get_dompath (&gc, domid); + dom_path =libxl__xs_get_dompath (&gc, domid);if (!dom_path) { rc =ERROR_FAIL ; goto out;
@@ -944,7 +944,7 @@ int libxl_domain_destroy(libxl_ctx *ctx,XL_LOG (ctx,XL_LOG_ERROR ,"pci shutdown failed for domid %d" , domid);if (dm_present) {xs_write (ctx->xsh,XBT_NULL , -libxl_sprintf (&gc,"/local/domain/0/device-model/%d/command" , domid), +libxl__sprintf (&gc,"/local/domain/0/device-model/%d/command" , domid),"shutdown" ,strlen ("shutdown" )); } rc =xc_domain_pause (ctx->xch, domid);
@@ -955,10 +955,10 @@ int libxl_domain_destroy(libxl_ctx *ctx,if (libxl_destroy_device_model (ctx, domid) <0 )XL_LOG (ctx,XL_LOG_ERROR ,"libxl_destroy_device_model failed for %d" , domid); } -if (libxl_devices_destroy (ctx, domid, force) <0 ) +if (libxl__devices_destroy (ctx, domid, force) <0 )XL_LOG (ctx,XL_LOG_ERROR ,"libxl_destroy_devices failed for %d" , domid); - vm_path =libxl_xs_read (&gc,XBT_NULL ,libxl_sprintf (&gc,"%s/vm" , dom_path)); + vm_path =libxl__xs_read (&gc,XBT_NULL ,libxl__sprintf (&gc,"%s/vm" , dom_path));if (vm_path)if (!xs_rm (ctx->xsh,XBT_NULL , vm_path))XL_LOG_ERRNO (ctx,XL_LOG_ERROR ,"xs_rm failed for %s" , vm_path);
@@ -976,16 +976,16 @@ int libxl_domain_destroy(libxl_ctx *ctx, } rc =0 ; out: -libxl_free_all (&gc); +libxl__free_all (&gc);return 0 ; }int libxl_console_exec (libxl_ctx *ctx,uint32_t domid,int cons_num,libxl_console_constype type) {libxl_gc gc =LIBXL_INIT_GC (ctx); -char *p =libxl_sprintf (&gc,"%s/xenconsole" ,libxl_private_bindir_path ()); -char *domid_s =libxl_sprintf (&gc,"%d" , domid); -char *cons_num_s =libxl_sprintf (&gc,"%d" , cons_num); +char *p =libxl__sprintf (&gc,"%s/xenconsole" ,libxl_private_bindir_path ()); +char *domid_s =libxl__sprintf (&gc,"%d" , domid); +char *cons_num_s =libxl__sprintf (&gc,"%d" , cons_num);char *cons_type_s;switch (type) {
@@ -1002,7 +1002,7 @@ int libxl_console_exec(libxl_ctx *ctx, uexecl (p, p, domid_s,"--num" , cons_num_s,"--type" , cons_type_s, (void *)NULL ); out: -libxl_free_all (&gc); +libxl__free_all (&gc);return ERROR_FAIL ; }
@@ -1032,22 +1032,22 @@ int libxl_vncviewer_exec(libxl_ctx *ctx, NULL, }; - vnc_port =libxl_xs_read (&gc,XBT_NULL , -libxl_sprintf (&gc, + vnc_port =libxl__xs_read (&gc,XBT_NULL , +libxl__sprintf (&gc,"/local/domain/%d/console/vnc-port" , domid));if ( vnc_port ) port =atoi (vnc_port) -5900 ; - vfb_back =libxl_xs_read (&gc,XBT_NULL , -libxl_sprintf (&gc, + vfb_back =libxl__xs_read (&gc,XBT_NULL , +libxl__sprintf (&gc,"/local/domain/%d/device/vfb/0/backend" , domid));if ( vfb_back ) { - vnc_listen =libxl_xs_read (&gc,XBT_NULL , -libxl_sprintf (&gc, + vnc_listen =libxl__xs_read (&gc,XBT_NULL , +libxl__sprintf (&gc,"/local/domain/%d/console/vnc-listen" , domid));if ( autopass ) - vnc_pass =libxl_xs_read (&gc,XBT_NULL , -libxl_sprintf (&gc, + vnc_pass =libxl__xs_read (&gc,XBT_NULL , +libxl__sprintf (&gc,"/local/domain/%d/console/vnc-pass" , domid)); }
@@ -1057,7 +1057,7 @@ int libxl_vncviewer_exec(libxl_ctx *ctx,if ( (vnc_bin =getenv ("VNCVIEWER" )) ) args[0 ] = vnc_bin; - args[1 ] =libxl_sprintf (&gc,"%s:%d" , vnc_listen, port); + args[1 ] =libxl__sprintf (&gc,"%s:%d" , vnc_listen, port);if ( vnc_pass ) {char tmpname[] ="/tmp/vncautopass.XXXXXX" ;
@@ -1079,8 +1079,8 @@ int libxl_vncviewer_exec(libxl_ctx *ctx, } skip_autopass: -libxl_free_all (&gc); -libxl_exec (autopass_fd,-1 ,-1 , args[0 ], args); +libxl__free_all (&gc); +libxl__exec (autopass_fd,-1 ,-1 , args[0 ], args);return 0 ; }
@@ -1099,7 +1099,7 @@ static char ** libxl_build_device_model_flexarray_set (dm_args, num++,"qemu-dm" );flexarray_set (dm_args, num++,"-d" ); -flexarray_set (dm_args, num++,libxl_sprintf (gc,"%d" , info->domid)); +flexarray_set (dm_args, num++,libxl__sprintf (gc,"%d" , info->domid));if (info->dom_name) {flexarray_set (dm_args, num++,"-domain-name" );
@@ -1111,18 +1111,18 @@ static char ** libxl_build_device_model_if (info->vnclisten &&strchr (info->vnclisten,':' ) ==NULL ) {flexarray_set ( dm_args, num++, -libxl_sprintf (gc,"%s:%d%s" , +libxl__sprintf (gc,"%s:%d%s" , info->vnclisten, info->vncdisplay, info->vncpasswd ?",password" :"" )); }else { -flexarray_set (dm_args, num++,libxl_sprintf (gc,"127.0.0.1:%d" , info->vncdisplay)); +flexarray_set (dm_args, num++,libxl__sprintf (gc,"127.0.0.1:%d" , info->vncdisplay)); } }else if (info->vnclisten) {if (strchr (info->vnclisten,':' ) !=NULL ) {flexarray_set (dm_args, num++, info->vnclisten); }else { -flexarray_set (dm_args, num++,libxl_sprintf (gc,"%s:0" , info->vnclisten)); +flexarray_set (dm_args, num++,libxl__sprintf (gc,"%s:0" , info->vnclisten)); } }else {flexarray_set (dm_args, num++,"127.0.0.1:0" );
@@ -1153,7 +1153,7 @@ static char ** libxl_build_device_model_if (info->videoram) {flexarray_set (dm_args, num++,"-videoram" ); -flexarray_set (dm_args, num++,libxl_sprintf (gc,"%d" , info->videoram)); +flexarray_set (dm_args, num++,libxl__sprintf (gc,"%d" , info->videoram)); }if (info->stdvga) {flexarray_set (dm_args, num++,"-std-vga" );
@@ -1179,24 +1179,24 @@ static char ** libxl_build_device_model_ }if (info->vcpus >1 ) {flexarray_set (dm_args, num++,"-vcpus" ); -flexarray_set (dm_args, num++,libxl_sprintf (gc,"%d" , info->vcpus)); +flexarray_set (dm_args, num++,libxl__sprintf (gc,"%d" , info->vcpus)); }if (info->vcpu_avail) {flexarray_set (dm_args, num++,"-vcpu_avail" ); -flexarray_set (dm_args, num++,libxl_sprintf (gc,"0x%x" , info->vcpu_avail)); +flexarray_set (dm_args, num++,libxl__sprintf (gc,"0x%x" , info->vcpu_avail)); }for (i =0 ; i < num_vifs; i++) {if (vifs[i].nictype ==NICTYPE_IOEMU ) { -char *smac =libxl_sprintf (gc,"%02x:%02x:%02x:%02x:%02x:%02x" , +char *smac =libxl__sprintf (gc,"%02x:%02x:%02x:%02x:%02x:%02x" , vifs[i].mac[0 ], vifs[i].mac[1 ], vifs[i].mac[2 ], vifs[i].mac[3 ], vifs[i].mac[4 ], vifs[i].mac[5 ]);if (!vifs[i].ifname) - vifs[i].ifname =libxl_sprintf (gc,"tap%d.%d" , info->domid, vifs[i].devid); + vifs[i].ifname =libxl__sprintf (gc,"tap%d.%d" , info->domid, vifs[i].devid);flexarray_set (dm_args, num++,"-net" ); -flexarray_set (dm_args, num++,libxl_sprintf (gc,"nic,vlan=%d,macaddr=%s,model=%s" , +flexarray_set (dm_args, num++,libxl__sprintf (gc,"nic,vlan=%d,macaddr=%s,model=%s" , vifs[i].devid, smac, vifs[i].model));flexarray_set (dm_args, num++,"-net" ); -flexarray_set (dm_args, num++,libxl_sprintf (gc,"tap,vlan=%d,ifname=%s,bridge=%s,script=no" , +flexarray_set (dm_args, num++,libxl__sprintf (gc,"tap,vlan=%d,ifname=%s,bridge=%s,script=no" , vifs[i].devid, vifs[i].ifname, vifs[i].bridge)); ioemu_vifs++; }
@@ -1239,7 +1239,7 @@ static char ** libxl_build_device_model_flexarray_set (dm_args, num++,"qemu-system-xen" );flexarray_set (dm_args, num++,"-xen-domid" ); -flexarray_set (dm_args, num++,libxl_sprintf (gc,"%d" , info->domid)); +flexarray_set (dm_args, num++,libxl__sprintf (gc,"%d" , info->domid));if (info->dom_name) {flexarray_set (dm_args, num++,"-name" );
@@ -1262,11 +1262,11 @@ static char ** libxl_build_device_model_if (strchr (listen,':' ) !=NULL )flexarray_set (dm_args, num++, -libxl_sprintf (gc,"%s%s" , listen, +libxl__sprintf (gc,"%s%s" , listen, info->vncunused ?",to=99" :"" ));else flexarray_set (dm_args, num++, -libxl_sprintf (gc,"%s:%d%s" , listen, display, +libxl__sprintf (gc,"%s:%d%s" , listen, display, info->vncunused ?",to=99" :"" )); }if (info->sdl) {
@@ -1293,7 +1293,7 @@ static char ** libxl_build_device_model_if (info->boot) {flexarray_set (dm_args, num++,"-boot" ); -flexarray_set (dm_args, num++,libxl_sprintf (gc,"order=%s" , info->boot)); +flexarray_set (dm_args, num++,libxl__sprintf (gc,"order=%s" , info->boot)); }if (info->usb || info->usbdevice) {flexarray_set (dm_args, num++,"-usb" );
@@ -1312,22 +1312,22 @@ static char ** libxl_build_device_model_if (info->vcpus >1 ) {flexarray_set (dm_args, num++,"-smp" );if (info->vcpu_avail) -flexarray_set (dm_args, num++,libxl_sprintf (gc,"%d,maxcpus=%d" , info->vcpus, info->vcpu_avail)); +flexarray_set (dm_args, num++,libxl__sprintf (gc,"%d,maxcpus=%d" , info->vcpus, info->vcpu_avail));else -flexarray_set (dm_args, num++,libxl_sprintf (gc,"%d" , info->vcpus)); +flexarray_set (dm_args, num++,libxl__sprintf (gc,"%d" , info->vcpus)); }for (i =0 ; i < num_vifs; i++) {if (vifs[i].nictype ==NICTYPE_IOEMU ) { -char *smac =libxl_sprintf (gc,"%02x:%02x:%02x:%02x:%02x:%02x" , +char *smac =libxl__sprintf (gc,"%02x:%02x:%02x:%02x:%02x:%02x" , vifs[i].mac[0 ], vifs[i].mac[1 ], vifs[i].mac[2 ], vifs[i].mac[3 ], vifs[i].mac[4 ], vifs[i].mac[5 ]);if (!vifs[i].ifname) - vifs[i].ifname =libxl_sprintf (gc,"tap%d.%d" , info->domid, vifs[i].devid); + vifs[i].ifname =libxl__sprintf (gc,"tap%d.%d" , info->domid, vifs[i].devid);flexarray_set (dm_args, num++,"-net" ); -flexarray_set (dm_args, num++,libxl_sprintf (gc,"nic,vlan=%d,macaddr=%s,model=%s" , +flexarray_set (dm_args, num++,libxl__sprintf (gc,"nic,vlan=%d,macaddr=%s,model=%s" , vifs[i].devid, smac, vifs[i].model));flexarray_set (dm_args, num++,"-net" ); -flexarray_set (dm_args, num++,libxl_sprintf (gc,"tap,vlan=%d,ifname=%s,script=no" , +flexarray_set (dm_args, num++,libxl__sprintf (gc,"tap,vlan=%d,ifname=%s,script=no" , vifs[i].devid, vifs[i].ifname)); ioemu_vifs++; }
@@ -1356,7 +1356,7 @@ static char ** libxl_build_device_model_flexarray_set (dm_args, num++,"-cdrom" );flexarray_set (dm_args, num++, disks[i].physpath); }else { -flexarray_set (dm_args, num++,libxl_sprintf (gc,"-%s" , disks[i].virtpath)); +flexarray_set (dm_args, num++,libxl__sprintf (gc,"-%s" , disks[i].virtpath));flexarray_set (dm_args, num++, disks[i].physpath); }libxl_device_disk_destroy (&disks[i]);
@@ -1443,7 +1443,7 @@ static int libxl_write_dmargs(libxl_ctx roperm[1 ].id = domid; roperm[1 ].perms =XS_PERM_READ ; - vm_path =libxl_xs_read (&gc,XBT_NULL ,libxl_sprintf (&gc,"/local/domain/%d/vm" , guest_domid)); + vm_path =libxl__xs_read (&gc,XBT_NULL ,libxl__sprintf (&gc,"/local/domain/%d/vm" , guest_domid)); i =0 ; dmargs_size =0 ;
@@ -1462,18 +1462,18 @@ static int libxl_write_dmargs(libxl_ctx } i++; } - path =libxl_sprintf (&gc,"%s/image/dmargs" , vm_path); + path =libxl__sprintf (&gc,"%s/image/dmargs" , vm_path); retry_transaction: t =xs_transaction_start (ctx->xsh);xs_write (ctx->xsh, t, path, dmargs,strlen (dmargs));xs_set_permissions (ctx->xsh, t, path, roperm,ARRAY_SIZE (roperm)); -xs_set_permissions (ctx->xsh, t,libxl_sprintf (&gc,"%s/rtc/timeoffset" , vm_path), roperm,ARRAY_SIZE (roperm)); +xs_set_permissions (ctx->xsh, t,libxl__sprintf (&gc,"%s/rtc/timeoffset" , vm_path), roperm,ARRAY_SIZE (roperm));if (!xs_transaction_end (ctx->xsh, t,0 ))if (errno ==EAGAIN ) goto retry_transaction;free (dmargs); -libxl_free_all (&gc); +libxl__free_all (&gc);return 0 ; }
@@ -1505,7 +1505,7 @@ static int libxl_create_stubdom(libxl_ctmemset (&c_info,0x00 ,sizeof (libxl_domain_create_info)); c_info.hvm =0 ; - c_info.name =libxl_sprintf (&gc,"%s-dm" ,_libxl_domid_to_name (&gc, info->domid)); + c_info.name =libxl__sprintf (&gc,"%s-dm" ,libxl__domid_to_name (&gc, info->domid));libxl_uuid_copy (&c_info.uuid, &info->uuid);
@@ -1513,8 +1513,8 @@ static int libxl_create_stubdom(libxl_ct b_info.max_vcpus =1 ; b_info.max_memkb =32 *1024 ; b_info.target_memkb = b_info.max_memkb; - b_info.kernel.path =libxl_abs_path (&gc,"ioemu-stubdom.gz" ,libxl_xenfirmwaredir_path ()); - b_info.u.pv.cmdline =libxl_sprintf (&gc," -d %d" , info->domid); + b_info.kernel.path =libxl__abs_path (&gc,"ioemu-stubdom.gz" ,libxl_xenfirmwaredir_path ()); + b_info.u.pv.cmdline =libxl__sprintf (&gc," -d %d" , info->domid); b_info.u.pv.ramdisk.path ="" ; b_info.u.pv.features ="" ; b_info.hvm =0 ;
@@ -1527,11 +1527,11 @@ static int libxl_create_stubdom(libxl_ct goto out_free;libxl_write_dmargs (ctx, domid, info->domid, args); -libxl_xs_write (&gc,XBT_NULL , -libxl_sprintf (&gc,"%s/image/device-model-domid" ,libxl_xs_get_dompath (&gc, info->domid)), +libxl__xs_write (&gc,XBT_NULL , +libxl__sprintf (&gc,"%s/image/device-model-domid" ,libxl__xs_get_dompath (&gc, info->domid)),"%d" , domid); -libxl_xs_write (&gc,XBT_NULL , -libxl_sprintf (&gc,"%s/target" ,libxl_xs_get_dompath (&gc, domid)), +libxl__xs_write (&gc,XBT_NULL , +libxl__sprintf (&gc,"%s/target" ,libxl__xs_get_dompath (&gc, domid)),"%d" , info->domid); ret =xc_domain_set_target (ctx->xch, domid, info->domid);if (ret<0 ) {
@@ -1547,10 +1547,10 @@ static int libxl_create_stubdom(libxl_ct perm[1 ].perms =XS_PERM_READ ; retry_transaction: t =xs_transaction_start (ctx->xsh); -xs_mkdir (ctx->xsh, t,libxl_sprintf (&gc,"/local/domain/0/device-model/%d" , info->domid)); -xs_set_permissions (ctx->xsh, t,libxl_sprintf (&gc,"/local/domain/0/device-model/%d" , info->domid), perm,ARRAY_SIZE (perm)); -xs_mkdir (ctx->xsh, t,libxl_sprintf (&gc,"/local/domain/%d/device/vfs" , domid)); -xs_set_permissions (ctx->xsh, t,libxl_sprintf (&gc,"/local/domain/%d/device/vfs" ,domid), perm,ARRAY_SIZE (perm)); +xs_mkdir (ctx->xsh, t,libxl__sprintf (&gc,"/local/domain/0/device-model/%d" , info->domid)); +xs_set_permissions (ctx->xsh, t,libxl__sprintf (&gc,"/local/domain/0/device-model/%d" , info->domid), perm,ARRAY_SIZE (perm)); +xs_mkdir (ctx->xsh, t,libxl__sprintf (&gc,"/local/domain/%d/device/vfs" , domid)); +xs_set_permissions (ctx->xsh, t,libxl__sprintf (&gc,"/local/domain/%d/device/vfs" ,domid), perm,ARRAY_SIZE (perm));if (!xs_transaction_end (ctx->xsh, t,0 ))if (errno ==EAGAIN ) goto retry_transaction;
@@ -1579,7 +1579,7 @@ retry_transaction:if (info->serial) num_console++; - console =libxl_calloc (&gc, num_console,sizeof (libxl_device_console)); + console =libxl__calloc (&gc, num_console,sizeof (libxl_device_console));if (!console) { ret =ERROR_NOMEM ; goto out_free;
@@ -1591,9 +1591,9 @@ retry_transaction: console[i].domid = domid;if (!i) {char *filename; -char *name =libxl_sprintf (&gc,"qemu-dm-%s" ,libxl_domid_to_name (ctx, info->domid)); +char *name =libxl__sprintf (&gc,"qemu-dm-%s" ,libxl_domid_to_name (ctx, info->domid));libxl_create_logfile (ctx, name, &filename); - console[i].output =libxl_sprintf (&gc,"file:%s" , filename); + console[i].output =libxl__sprintf (&gc,"file:%s" , filename); console[i].build_state = &state;free (filename); }else
@@ -1616,7 +1616,7 @@ retry_transaction:if (starting_r) { *starting_r =calloc (sizeof (libxl_device_model_starting),1 ); (*starting_r)->domid = info->domid; - (*starting_r)->dom_path =libxl_xs_get_dompath (&gc, info->domid); + (*starting_r)->dom_path =libxl__xs_get_dompath (&gc, info->domid); (*starting_r)->for_spawn =NULL ; }
@@ -1625,7 +1625,7 @@ out_free: out_free:free (args); out: -libxl_free_all (&gc); +libxl__free_all (&gc);return ret; }
@@ -1660,11 +1660,11 @@ int libxl_create_device_model(libxl_ctx goto out; } - path =libxl_sprintf (&gc,"/local/domain/0/device-model/%d" , info->domid); + path =libxl__sprintf (&gc,"/local/domain/0/device-model/%d" , info->domid);xs_mkdir (ctx->xsh,XBT_NULL , path); -libxl_xs_write (&gc,XBT_NULL ,libxl_sprintf (&gc,"%s/disable_pf" , path),"%d" , !info->xen_platform_pci); +libxl__xs_write (&gc,XBT_NULL ,libxl__sprintf (&gc,"%s/disable_pf" , path),"%d" , !info->xen_platform_pci); -libxl_create_logfile (ctx,libxl_sprintf (&gc,"qemu-dm-%s" , info->dom_name), &logfile); +libxl_create_logfile (ctx,libxl__sprintf (&gc,"qemu-dm-%s" , info->dom_name), &logfile); logfile_w =open (logfile,O_WRONLY |O_CREAT ,0644 );free (logfile); null =open ("/dev/null" ,O_RDONLY );
@@ -1682,7 +1682,7 @@ int libxl_create_device_model(libxl_ctx } p->domid = info->domid; - p->dom_path =libxl_xs_get_dompath (&gc, info->domid); + p->dom_path =libxl__xs_get_dompath (&gc, info->domid);if (!p->dom_path) { rc =ERROR_FAIL ; goto out_close;
@@ -1692,25 +1692,25 @@ retry_transaction: retry_transaction:/* Find uuid and the write the vnc password to xenstore for qemu. */ t =xs_transaction_start (ctx->xsh); - vm_path =libxl_xs_read (&gc,t,libxl_sprintf (&gc,"%s/vm" , p->dom_path)); + vm_path =libxl__xs_read (&gc,t,libxl__sprintf (&gc,"%s/vm" , p->dom_path));if (vm_path) {/* Now write the vncpassword into it. */ - pass_stuff =libxl_calloc (&gc,2 ,sizeof (char *)); + pass_stuff =libxl__calloc (&gc,2 ,sizeof (char *)); pass_stuff[0 ] ="vncpasswd" ; pass_stuff[1 ] = info->vncpasswd; -libxl_xs_writev (&gc,t,vm_path,pass_stuff); +libxl__xs_writev (&gc,t,vm_path,pass_stuff);if (!xs_transaction_end (ctx->xsh, t,0 ))if (errno ==EAGAIN ) goto retry_transaction; } } - rc =libxl_spawn_spawn (ctx, p,"device model" , dm_xenstore_record_pid); + rc =libxl__spawn_spawn (ctx, p,"device model" , dm_xenstore_record_pid);if (rc <0 ) goto out_close;if (!rc) {/* inner child */ -libxl_exec (null, logfile_w, logfile_w, -libxl_abs_path (&gc, info->device_model,libxl_private_bindir_path ()), +libxl__exec (null, logfile_w, logfile_w, +libxl__abs_path (&gc, info->device_model,libxl_private_bindir_path ()), args); }
@@ -1721,7 +1721,7 @@ out_close:close (logfile_w);free (args); out: -libxl_free_all (&gc); +libxl__free_all (&gc);return rc; }
@@ -1729,7 +1729,7 @@ int libxl_detach_device_model(libxl_ctx libxl_device_model_starting *starting) {int rc; - rc =libxl_spawn_detach (ctx, starting->for_spawn); + rc =libxl__spawn_detach (ctx, starting->for_spawn);if (starting->for_spawn)free (starting->for_spawn);free (starting);
@@ -1740,10 +1740,10 @@ int libxl_confirm_device_model_startup(lint libxl_confirm_device_model_startup (libxl_ctx *ctx,libxl_device_model_starting *starting) { -int problem =libxl_wait_for_device_model (ctx, starting->domid,"running" ,NULL ,NULL ); +int problem =libxl__wait_for_device_model (ctx, starting->domid,"running" ,NULL ,NULL );int detach;if ( !problem ) - problem =libxl_spawn_check (ctx, starting->for_spawn); + problem =libxl__spawn_check (ctx, starting->for_spawn); detach =libxl_detach_device_model (ctx, starting);return problem ? problem : detach; }
@@ -1794,7 +1794,7 @@ int libxl_device_disk_add(libxl_ctx *ctxdevice_physdisk_major_minor (disk->physpath, &major, &minor);flexarray_set (back, boffset++,"physical-device" ); -flexarray_set (back, boffset++,libxl_sprintf (&gc,"%x:%x" , major, minor)); +flexarray_set (back, boffset++,libxl__sprintf (&gc,"%x:%x" , major, minor));flexarray_set (back, boffset++,"params" );flexarray_set (back, boffset++, disk->physpath);
@@ -1817,19 +1817,19 @@ int libxl_device_disk_add(libxl_ctx *ctx goto out_free; }flexarray_set (back, boffset++,"tapdisk-params" ); -flexarray_set (back, boffset++,libxl_sprintf (&gc,"%s:%s" ,device_disk_string_of_phystype (disk->phystype), disk->physpath)); +flexarray_set (back, boffset++,libxl__sprintf (&gc,"%s:%s" ,device_disk_string_of_phystype (disk->phystype), disk->physpath));flexarray_set (back, boffset++,"params" ); -flexarray_set (back, boffset++,libxl_strdup (&gc, dev)); +flexarray_set (back, boffset++,libxl__strdup (&gc, dev)); backend_type ="phy" ;device_physdisk_major_minor (dev, &major, &minor);flexarray_set (back, boffset++,"physical-device" ); -flexarray_set (back, boffset++,libxl_sprintf (&gc,"%x:%x" , major, minor)); +flexarray_set (back, boffset++,libxl__sprintf (&gc,"%x:%x" , major, minor)); device.backend_kind =DEVICE_VBD ;break ; }flexarray_set (back, boffset++,"params" ); -flexarray_set (back, boffset++,libxl_sprintf (&gc,"%s:%s" , +flexarray_set (back, boffset++,libxl__sprintf (&gc,"%s:%s" ,device_disk_string_of_phystype (disk->phystype), disk->physpath)); device.backend_kind =DEVICE_TAP ;
@@ -1842,15 +1842,15 @@ int libxl_device_disk_add(libxl_ctx *ctx }flexarray_set (back, boffset++,"frontend-id" ); -flexarray_set (back, boffset++,libxl_sprintf (&gc,"%d" , disk->domid)); +flexarray_set (back, boffset++,libxl__sprintf (&gc,"%d" , disk->domid));flexarray_set (back, boffset++,"online" );flexarray_set (back, boffset++,"1" );flexarray_set (back, boffset++,"removable" ); -flexarray_set (back, boffset++,libxl_sprintf (&gc,"%d" , (disk->unpluggable) ?1 :0 )); +flexarray_set (back, boffset++,libxl__sprintf (&gc,"%d" , (disk->unpluggable) ?1 :0 ));flexarray_set (back, boffset++,"bootable" ); -flexarray_set (back, boffset++,libxl_sprintf (&gc,"%d" ,1 )); +flexarray_set (back, boffset++,libxl__sprintf (&gc,"%d" ,1 ));flexarray_set (back, boffset++,"state" ); -flexarray_set (back, boffset++,libxl_sprintf (&gc,"%d" ,1 )); +flexarray_set (back, boffset++,libxl__sprintf (&gc,"%d" ,1 ));flexarray_set (back, boffset++,"dev" );flexarray_set (back, boffset++, disk->virtpath);flexarray_set (back, boffset++,"type" );
@@ -1859,11 +1859,11 @@ int libxl_device_disk_add(libxl_ctx *ctxflexarray_set (back, boffset++, disk->readwrite ?"w" :"r" );flexarray_set (front, foffset++,"backend-id" ); -flexarray_set (front, foffset++,libxl_sprintf (&gc,"%d" , disk->backend_domid)); +flexarray_set (front, foffset++,libxl__sprintf (&gc,"%d" , disk->backend_domid));flexarray_set (front, foffset++,"state" ); -flexarray_set (front, foffset++,libxl_sprintf (&gc,"%d" ,1 )); +flexarray_set (front, foffset++,libxl__sprintf (&gc,"%d" ,1 ));flexarray_set (front, foffset++,"virtual-device" ); -flexarray_set (front, foffset++,libxl_sprintf (&gc,"%d" , devid)); +flexarray_set (front, foffset++,libxl__sprintf (&gc,"%d" , devid));flexarray_set (front, foffset++,"device-type" );flexarray_set (front, foffset++, disk->is_cdrom ?"cdrom" :"disk" );
@@ -1872,9 +1872,9 @@ int libxl_device_disk_add(libxl_ctx *ctxflexarray_set (front, foffset++,"x86_32-abi" );/* hardcoded ! */ } -libxl_device_generic_add (ctx, &device, -libxl_xs_kvs_of_flexarray (&gc, back, boffset), -libxl_xs_kvs_of_flexarray (&gc, front, foffset)); +libxl__device_generic_add (ctx, &device, +libxl__xs_kvs_of_flexarray (&gc, back, boffset), +libxl__xs_kvs_of_flexarray (&gc, front, foffset)); rc =0 ;
@@ -1882,7 +1882,7 @@ out_free:flexarray_free (back);flexarray_free (front); out: -libxl_free_all (&gc); +libxl__free_all (&gc);return rc; }
@@ -1900,7 +1900,7 @@ int libxl_device_disk_del(libxl_ctx *ctx device.domid = disk->domid; device.devid = devid; device.kind =DEVICE_VBD ; -return libxl_device_del (ctx, &device, wait); +return libxl__device_del (ctx, &device, wait); }char *libxl_device_disk_local_attach (libxl_ctx *ctx,libxl_device_disk *disk)
@@ -1931,7 +1931,7 @@ char * libxl_device_disk_local_attach(libreak ; } ret =strdup (dev); -libxl_free_all (&gc); +libxl__free_all (&gc);return ret; }
@@ -1971,12 +1971,12 @@ int libxl_device_nic_add(libxl_ctx *ctx, }if (nic->devid ==-1 ) { -if (!(dompath =libxl_xs_get_dompath (&gc, domid))) { +if (!(dompath =libxl__xs_get_dompath (&gc, domid))) { rc =ERROR_FAIL ; goto out_free; } -if (!(l =libxl_xs_directory (&gc,XBT_NULL , -libxl_sprintf (&gc,"%s/device/vif" , dompath), &nb))) { +if (!(l =libxl__xs_directory (&gc,XBT_NULL , +libxl__sprintf (&gc,"%s/device/vif" , dompath), &nb))) { nic->devid =0 ; }else { nic->devid =strtoul (l[nb -1 ],NULL ,10 ) +1 ;
@@ -1991,30 +1991,30 @@ int libxl_device_nic_add(libxl_ctx *ctx, device.kind =DEVICE_VIF ;flexarray_set (back, boffset++,"frontend-id" ); -flexarray_set (back, boffset++,libxl_sprintf (&gc,"%d" , nic->domid)); +flexarray_set (back, boffset++,libxl__sprintf (&gc,"%d" , nic->domid));flexarray_set (back, boffset++,"online" );flexarray_set (back, boffset++,"1" );flexarray_set (back, boffset++,"state" ); -flexarray_set (back, boffset++,libxl_sprintf (&gc,"%d" ,1 )); +flexarray_set (back, boffset++,libxl__sprintf (&gc,"%d" ,1 ));flexarray_set (back, boffset++,"script" );flexarray_set (back, boffset++, nic->script);flexarray_set (back, boffset++,"mac" ); -flexarray_set (back, boffset++,libxl_sprintf (&gc,"%02x:%02x:%02x:%02x:%02x:%02x" , +flexarray_set (back, boffset++,libxl__sprintf (&gc,"%02x:%02x:%02x:%02x:%02x:%02x" , nic->mac[0 ], nic->mac[1 ], nic->mac[2 ], nic->mac[3 ], nic->mac[4 ], nic->mac[5 ]));flexarray_set (back, boffset++,"bridge" ); -flexarray_set (back, boffset++,libxl_strdup (&gc, nic->bridge)); +flexarray_set (back, boffset++,libxl__strdup (&gc, nic->bridge));flexarray_set (back, boffset++,"handle" ); -flexarray_set (back, boffset++,libxl_sprintf (&gc,"%d" , nic->devid)); +flexarray_set (back, boffset++,libxl__sprintf (&gc,"%d" , nic->devid));flexarray_set (front, foffset++,"backend-id" ); -flexarray_set (front, foffset++,libxl_sprintf (&gc,"%d" , nic->backend_domid)); +flexarray_set (front, foffset++,libxl__sprintf (&gc,"%d" , nic->backend_domid));flexarray_set (front, foffset++,"state" ); -flexarray_set (front, foffset++,libxl_sprintf (&gc,"%d" ,1 )); +flexarray_set (front, foffset++,libxl__sprintf (&gc,"%d" ,1 ));flexarray_set (front, foffset++,"handle" ); -flexarray_set (front, foffset++,libxl_sprintf (&gc,"%d" , nic->devid)); +flexarray_set (front, foffset++,libxl__sprintf (&gc,"%d" , nic->devid));flexarray_set (front, foffset++,"mac" ); -flexarray_set (front, foffset++,libxl_sprintf (&gc,"%02x:%02x:%02x:%02x:%02x:%02x" , +flexarray_set (front, foffset++,libxl__sprintf (&gc,"%02x:%02x:%02x:%02x:%02x:%02x" , nic->mac[0 ], nic->mac[1 ], nic->mac[2 ], nic->mac[3 ], nic->mac[4 ], nic->mac[5 ]));if (0 /* protocol != native*/ ) {
@@ -2022,9 +2022,9 @@ int libxl_device_nic_add(libxl_ctx *ctx,flexarray_set (front, foffset++,"x86_32-abi" );/* hardcoded ! */ } -libxl_device_generic_add (ctx, &device, -libxl_xs_kvs_of_flexarray (&gc, back, boffset), -libxl_xs_kvs_of_flexarray (&gc, front, foffset)); +libxl__device_generic_add (ctx, &device, +libxl__xs_kvs_of_flexarray (&gc, back, boffset), +libxl__xs_kvs_of_flexarray (&gc, front, foffset));/* FIXME: wait for plug */ rc =0 ;
@@ -2032,7 +2032,7 @@ out_free:flexarray_free (back);flexarray_free (front); out: -libxl_free_all (&gc); +libxl__free_all (&gc);return rc; }
@@ -2048,7 +2048,7 @@ int libxl_device_nic_del(libxl_ctx *ctx, device.domid = nic->domid; device.kind =DEVICE_VIF ; -return libxl_device_del (ctx, &device, wait); +return libxl__device_del (ctx, &device, wait); }libxl_nicinfo *libxl_list_nics (libxl_ctx *ctx,uint32_t domid,unsigned int *nb)
@@ -2060,50 +2060,50 @@ libxl_nicinfo *libxl_list_nics(libxl_ctxunsigned int nb_nics, i;libxl_nicinfo *res, *nics; - dompath =libxl_xs_get_dompath (&gc, domid); + dompath =libxl__xs_get_dompath (&gc, domid);if (!dompath) goto err; - list = l =libxl_xs_directory (&gc,XBT_NULL , -libxl_sprintf (&gc,"%s/device/vif" , dompath), &nb_nics); + list = l =libxl__xs_directory (&gc,XBT_NULL , +libxl__sprintf (&gc,"%s/device/vif" , dompath), &nb_nics);if (!l) goto err; nics = res =calloc (nb_nics,sizeof (libxl_device_nic));if (!res) goto err;for (*nb = nb_nics; nb_nics >0 ; --nb_nics, ++l, ++nics) { - nic_path_fe =libxl_sprintf (&gc,"%s/device/vif/%s" , dompath, *l); + nic_path_fe =libxl__sprintf (&gc,"%s/device/vif/%s" , dompath, *l); nics->backend =xs_read (ctx->xsh,XBT_NULL , -libxl_sprintf (&gc,"%s/backend" , nic_path_fe),NULL ); - val =libxl_xs_read (&gc,XBT_NULL ,libxl_sprintf (&gc,"%s/backend-id" , nic_path_fe)); +libxl__sprintf (&gc,"%s/backend" , nic_path_fe),NULL ); + val =libxl__xs_read (&gc,XBT_NULL ,libxl__sprintf (&gc,"%s/backend-id" , nic_path_fe)); nics->backend_id = val ?strtoul (val,NULL ,10 ) :-1 ; nics->devid =strtoul (*l,NULL ,10 ); - val =libxl_xs_read (&gc,XBT_NULL ,libxl_sprintf (&gc,"%s/state" , nic_path_fe)); + val =libxl__xs_read (&gc,XBT_NULL ,libxl__sprintf (&gc,"%s/state" , nic_path_fe)); nics->state = val ?strtoul (val,NULL ,10 ) :-1 ; - val =libxl_xs_read (&gc,XBT_NULL ,libxl_sprintf (&gc,"%s/mac" , nic_path_fe)); + val =libxl__xs_read (&gc,XBT_NULL ,libxl__sprintf (&gc,"%s/mac" , nic_path_fe));for (i =0 , tok =strtok (val,":" ); tok && (i <6 ); ++i, tok =strtok (NULL ,":" )) { nics->mac[i] =strtoul (tok,NULL ,16 ); } - val =libxl_xs_read (&gc,XBT_NULL ,libxl_sprintf (&gc,"%s/event-channel" , nic_path_fe)); + val =libxl__xs_read (&gc,XBT_NULL ,libxl__sprintf (&gc,"%s/event-channel" , nic_path_fe)); nics->evtch = val ?strtol (val,NULL ,10 ) :-1 ; - val =libxl_xs_read (&gc,XBT_NULL ,libxl_sprintf (&gc,"%s/tx-ring-ref" , nic_path_fe)); + val =libxl__xs_read (&gc,XBT_NULL ,libxl__sprintf (&gc,"%s/tx-ring-ref" , nic_path_fe)); nics->rref_tx = val ?strtol (val,NULL ,10 ) :-1 ; - val =libxl_xs_read (&gc,XBT_NULL ,libxl_sprintf (&gc,"%s/rx-ring-ref" , nic_path_fe)); + val =libxl__xs_read (&gc,XBT_NULL ,libxl__sprintf (&gc,"%s/rx-ring-ref" , nic_path_fe)); nics->rref_rx = val ?strtol (val,NULL ,10 ) :-1 ; nics->frontend =xs_read (ctx->xsh,XBT_NULL , -libxl_sprintf (&gc,"%s/frontend" , nics->backend),NULL ); - val =libxl_xs_read (&gc,XBT_NULL ,libxl_sprintf (&gc,"%s/frontend-id" , nics->backend)); +libxl__sprintf (&gc,"%s/frontend" , nics->backend),NULL ); + val =libxl__xs_read (&gc,XBT_NULL ,libxl__sprintf (&gc,"%s/frontend-id" , nics->backend)); nics->frontend_id = val ?strtoul (val,NULL ,10 ) :-1 ; nics->script =xs_read (ctx->xsh,XBT_NULL , -libxl_sprintf (&gc,"%s/script" , nics->backend),NULL ); +libxl__sprintf (&gc,"%s/script" , nics->backend),NULL ); } -libxl_free_all (&gc); +libxl__free_all (&gc);return res; err: -libxl_free_all (&gc); +libxl__free_all (&gc);return NULL ; }
@@ -2129,15 +2129,15 @@ int libxl_device_net2_add(libxl_ctx *ctx goto err_free; } -if (!(dompath =libxl_xs_get_dompath (&gc, domid))) { +if (!(dompath =libxl__xs_get_dompath (&gc, domid))) { rc =ERROR_FAIL ; goto err_free; } - dom =libxl_xs_read (&gc,XBT_NULL ,libxl_sprintf (&gc,"%s/name" , dompath)); + dom =libxl__xs_read (&gc,XBT_NULL ,libxl__sprintf (&gc,"%s/name" , dompath));if (net2->devid ==-1 ) { -if (!(l =libxl_xs_directory (&gc,XBT_NULL , -libxl_sprintf (&gc,"%s/device/vif2" , dompath), &nb))) { +if (!(l =libxl__xs_directory (&gc,XBT_NULL , +libxl__sprintf (&gc,"%s/device/vif2" , dompath), &nb))) { net2->devid =0 ; }else { net2->devid =strtoul (l[nb -1 ],NULL ,10 ) +1 ;
@@ -2154,62 +2154,62 @@ int libxl_device_net2_add(libxl_ctx *ctxflexarray_set (back, boffset++,"domain" );flexarray_set (back, boffset++, dom);flexarray_set (back, boffset++,"frontend-id" ); -flexarray_set (back, boffset++,libxl_sprintf (&gc,"%d" , net2->domid)); +flexarray_set (back, boffset++,libxl__sprintf (&gc,"%d" , net2->domid));flexarray_set (back, boffset++,"local-trusted" ); -flexarray_set (back, boffset++,libxl_sprintf (&gc,"%d" , net2->back_trusted)); +flexarray_set (back, boffset++,libxl__sprintf (&gc,"%d" , net2->back_trusted));flexarray_set (back, boffset++,"mac" ); -flexarray_set (back, boffset++,libxl_sprintf (&gc,"%02x:%02x:%02x:%02x:%02x:%02x" , +flexarray_set (back, boffset++,libxl__sprintf (&gc,"%02x:%02x:%02x:%02x:%02x:%02x" , net2->back_mac[0 ], net2->back_mac[1 ], net2->back_mac[2 ], net2->back_mac[3 ], net2->back_mac[4 ], net2->back_mac[5 ]));flexarray_set (back, boffset++,"remote-trusted" ); -flexarray_set (back, boffset++,libxl_sprintf (&gc,"%d" , net2->trusted)); +flexarray_set (back, boffset++,libxl__sprintf (&gc,"%d" , net2->trusted));flexarray_set (back, boffset++,"remote-mac" ); -flexarray_set (back, boffset++,libxl_sprintf (&gc,"%02x:%02x:%02x:%02x:%02x:%02x" , +flexarray_set (back, boffset++,libxl__sprintf (&gc,"%02x:%02x:%02x:%02x:%02x:%02x" , net2->front_mac[0 ], net2->front_mac[1 ], net2->front_mac[2 ], net2->front_mac[3 ], net2->front_mac[4 ], net2->front_mac[5 ]));flexarray_set (back, boffset++,"max-bypasses" ); -flexarray_set (back, boffset++,libxl_sprintf (&gc,"%d" , net2->max_bypasses)); +flexarray_set (back, boffset++,libxl__sprintf (&gc,"%d" , net2->max_bypasses));flexarray_set (back, boffset++,"filter-mac" ); -flexarray_set (back, boffset++,libxl_sprintf (&gc,"%d" , !!(net2->filter_mac))); +flexarray_set (back, boffset++,libxl__sprintf (&gc,"%d" , !!(net2->filter_mac)));flexarray_set (back, boffset++,"handle" ); -flexarray_set (back, boffset++,libxl_sprintf (&gc,"%d" , net2->devid)); +flexarray_set (back, boffset++,libxl__sprintf (&gc,"%d" , net2->devid));flexarray_set (back, boffset++,"online" );flexarray_set (back, boffset++,"1" );flexarray_set (back, boffset++,"state" );flexarray_set (back, boffset++,"1" );flexarray_set (front, foffset++,"backend-id" ); -flexarray_set (front, foffset++,libxl_sprintf (&gc,"%d" , net2->backend_domid)); +flexarray_set (front, foffset++,libxl__sprintf (&gc,"%d" , net2->backend_domid));flexarray_set (front, foffset++,"local-trusted" ); -flexarray_set (front, foffset++,libxl_sprintf (&gc,"%d" , net2->trusted)); +flexarray_set (front, foffset++,libxl__sprintf (&gc,"%d" , net2->trusted));flexarray_set (front, foffset++,"mac" ); -flexarray_set (front, foffset++,libxl_sprintf (&gc,"%02x:%02x:%02x:%02x:%02x:%02x" , +flexarray_set (front, foffset++,libxl__sprintf (&gc,"%02x:%02x:%02x:%02x:%02x:%02x" , net2->front_mac[0 ], net2->front_mac[1 ], net2->front_mac[2 ], net2->front_mac[3 ], net2->front_mac[4 ], net2->front_mac[5 ]));flexarray_set (front, foffset++,"remote-trusted" ); -flexarray_set (front, foffset++,libxl_sprintf (&gc,"%d" , net2->back_trusted)); +flexarray_set (front, foffset++,libxl__sprintf (&gc,"%d" , net2->back_trusted));flexarray_set (front, foffset++,"remote-mac" ); -flexarray_set (front, foffset++,libxl_sprintf (&gc,"%02x:%02x:%02x:%02x:%02x:%02x" , +flexarray_set (front, foffset++,libxl__sprintf (&gc,"%02x:%02x:%02x:%02x:%02x:%02x" , net2->back_mac[0 ], net2->back_mac[1 ], net2->back_mac[2 ], net2->back_mac[3 ], net2->back_mac[4 ], net2->back_mac[5 ]));flexarray_set (front, foffset++,"filter-mac" ); -flexarray_set (front, foffset++,libxl_sprintf (&gc,"%d" , !!(net2->filter_mac))); +flexarray_set (front, foffset++,libxl__sprintf (&gc,"%d" , !!(net2->filter_mac)));flexarray_set (front, foffset++,"state" );flexarray_set (front, foffset++,"1" ); -libxl_device_generic_add (ctx, &device, -libxl_xs_kvs_of_flexarray (&gc, back, boffset), -libxl_xs_kvs_of_flexarray (&gc, front, foffset)); +libxl__device_generic_add (ctx, &device, +libxl__xs_kvs_of_flexarray (&gc, back, boffset), +libxl__xs_kvs_of_flexarray (&gc, front, foffset));/* FIXME: wait for plug */ rc =0 ;
@@ -2217,7 +2217,7 @@ err_free:flexarray_free (back);flexarray_free (front); err: -libxl_free_all (&gc); +libxl__free_all (&gc);return rc; }
@@ -2230,11 +2230,11 @@ libxl_net2info *libxl_device_net2_list(lunsigned int nb_net2s, i;libxl_net2info *res, *net2s; - dompath =libxl_xs_get_dompath (&gc, domid); + dompath =libxl__xs_get_dompath (&gc, domid);if (!dompath) goto err; - l =libxl_xs_directory (&gc,XBT_NULL , -libxl_sprintf (&gc,"%s/device/vif2" , dompath), &nb_net2s); + l =libxl__xs_directory (&gc,XBT_NULL , +libxl__sprintf (&gc,"%s/device/vif2" , dompath), &nb_net2s);if (!l) goto err; res =calloc (nb_net2s,sizeof (libxl_net2info));
@@ -2242,43 +2242,43 @@ libxl_net2info *libxl_device_net2_list(l goto err; net2s = res;for (*nb = nb_net2s; nb_net2s >0 ; --nb_net2s, ++l, ++net2s) { - net2_path_fe =libxl_sprintf (&gc,"%s/device/vif2/%s" , dompath, *l); + net2_path_fe =libxl__sprintf (&gc,"%s/device/vif2/%s" , dompath, *l); - net2s->backend =libxl_xs_read (&gc,XBT_NULL , -libxl_sprintf (&gc,"%s/backend" , net2_path_fe)); - val =libxl_xs_read (&gc,XBT_NULL ,libxl_sprintf (&gc,"%s/backend-id" , net2_path_fe)); + net2s->backend =libxl__xs_read (&gc,XBT_NULL , +libxl__sprintf (&gc,"%s/backend" , net2_path_fe)); + val =libxl__xs_read (&gc,XBT_NULL ,libxl__sprintf (&gc,"%s/backend-id" , net2_path_fe)); net2s->backend_id = val ?strtoul (val,NULL ,10 ) :-1 ; net2s->devid =strtoul (*l,NULL ,10 ); - val =libxl_xs_read (&gc,XBT_NULL ,libxl_sprintf (&gc,"%s/state" , net2_path_fe)); + val =libxl__xs_read (&gc,XBT_NULL ,libxl__sprintf (&gc,"%s/state" , net2_path_fe)); net2s->state = val ?strtoul (val,NULL ,10 ) :-1 ; - val =libxl_xs_read (&gc,XBT_NULL ,libxl_sprintf (&gc,"%s/mac" , net2_path_fe)); + val =libxl__xs_read (&gc,XBT_NULL ,libxl__sprintf (&gc,"%s/mac" , net2_path_fe));for (i =0 , tok =strtok (val,":" ); tok && (i <6 ); ++i, tok =strtok (NULL ,":" )) { net2s->mac[i] =strtoul (tok,NULL ,16 ); } - val =libxl_xs_read (&gc,XBT_NULL ,libxl_sprintf (&gc,"%s/remote-trusted" , net2_path_fe)); + val =libxl__xs_read (&gc,XBT_NULL ,libxl__sprintf (&gc,"%s/remote-trusted" , net2_path_fe)); net2s->trusted = val ?strtoul (val,NULL ,10 ) :-1 ; - val =libxl_xs_read (&gc,XBT_NULL ,libxl_sprintf (&gc,"%s/remote-mac" , net2_path_fe)); + val =libxl__xs_read (&gc,XBT_NULL ,libxl__sprintf (&gc,"%s/remote-mac" , net2_path_fe));for (i =0 , tok =strtok (val,":" ); tok && (i <6 ); ++i, tok =strtok (NULL ,":" )) { net2s->back_mac[i] =strtoul (tok,NULL ,16 ); } - val =libxl_xs_read (&gc,XBT_NULL ,libxl_sprintf (&gc,"%s/filter-mac" , net2_path_fe)); + val =libxl__xs_read (&gc,XBT_NULL ,libxl__sprintf (&gc,"%s/filter-mac" , net2_path_fe)); net2s->filter_mac = val ?strtoul (val,NULL ,10 ) :-1 ; - net2s->frontend =libxl_xs_read (&gc,XBT_NULL , -libxl_sprintf (&gc,"%s/frontend" , net2s->backend)); - val =libxl_xs_read (&gc,XBT_NULL ,libxl_sprintf (&gc,"%s/frontend-id" , net2s->backend)); + net2s->frontend =libxl__xs_read (&gc,XBT_NULL , +libxl__sprintf (&gc,"%s/frontend" , net2s->backend)); + val =libxl__xs_read (&gc,XBT_NULL ,libxl__sprintf (&gc,"%s/frontend-id" , net2s->backend)); net2s->frontend_id = val ?strtoul (val,NULL ,10 ) :-1 ; } -libxl_free_all (&gc); +libxl__free_all (&gc);return res; err: -libxl_free_all (&gc); +libxl__free_all (&gc);return NULL ; }
@@ -2293,7 +2293,7 @@ int libxl_device_net2_del(libxl_ctx *ctx device.domid = net2->domid; device.kind =DEVICE_VIF2 ; -return libxl_device_del (ctx, &device, wait); +return libxl__device_del (ctx, &device, wait); }
@@ -2310,13 +2310,13 @@ int libxl_device_console_add(libxl_ctx *if (console->build_state) {xs_transaction_t t; -char **ents = (char **)libxl_calloc (&gc,11 ,sizeof (char *)); +char **ents = (char **)libxl__calloc (&gc,11 ,sizeof (char *)); ents[0 ] ="console/port" ; - ents[1 ] =libxl_sprintf (&gc,"%" PRIu32, console->build_state->console_port); + ents[1 ] =libxl__sprintf (&gc,"%" PRIu32, console->build_state->console_port); ents[2 ] ="console/ring-ref" ; - ents[3 ] =libxl_sprintf (&gc,"%lu" , console->build_state->console_mfn); + ents[3 ] =libxl__sprintf (&gc,"%lu" , console->build_state->console_mfn); ents[4 ] ="console/limit" ; - ents[5 ] =libxl_sprintf (&gc,"%d" ,LIBXL_XENCONSOLE_LIMIT ); + ents[5 ] =libxl__sprintf (&gc,"%d" ,LIBXL_XENCONSOLE_LIMIT ); ents[6 ] ="console/type" ;if (console->consback ==LIBXL_CONSBACK_XENCONSOLED ) ents[7 ] ="xenconsoled" ;
@@ -2326,7 +2326,7 @@ int libxl_device_console_add(libxl_ctx * ents[9 ] = console->output; retry_transaction: t =xs_transaction_start (ctx->xsh); -libxl_xs_writev (&gc, t,libxl_xs_get_dompath (&gc, console->domid), ents); +libxl__xs_writev (&gc, t,libxl__xs_get_dompath (&gc, console->domid), ents);if (!xs_transaction_end (ctx->xsh, t,0 ))if (errno ==EAGAIN ) goto retry_transaction;
@@ -2351,13 +2351,13 @@ retry_transaction: device.kind =DEVICE_CONSOLE ;flexarray_set (back, boffset++,"frontend-id" ); -flexarray_set (back, boffset++,libxl_sprintf (&gc,"%d" , console->domid)); +flexarray_set (back, boffset++,libxl__sprintf (&gc,"%d" , console->domid));flexarray_set (back, boffset++,"online" );flexarray_set (back, boffset++,"1" );flexarray_set (back, boffset++,"state" ); -flexarray_set (back, boffset++,libxl_sprintf (&gc,"%d" ,1 )); +flexarray_set (back, boffset++,libxl__sprintf (&gc,"%d" ,1 ));flexarray_set (back, boffset++,"domain" ); -flexarray_set (back, boffset++,_libxl_domid_to_name (&gc, domid)); +flexarray_set (back, boffset++,libxl__domid_to_name (&gc, domid));flexarray_set (back, boffset++,"protocol" );flexarray_set (back, boffset++,LIBXL_XENCONSOLE_PROTOCOL );
@@ -2365,11 +2365,11 @@ retry_transaction:* it has already been added to console/ */ if (device.devid >0 ) {flexarray_set (front, foffset++,"backend-id" ); -flexarray_set (front, foffset++,libxl_sprintf (&gc,"%d" , console->backend_domid)); +flexarray_set (front, foffset++,libxl__sprintf (&gc,"%d" , console->backend_domid));flexarray_set (front, foffset++,"state" ); -flexarray_set (front, foffset++,libxl_sprintf (&gc,"%d" ,1 )); +flexarray_set (front, foffset++,libxl__sprintf (&gc,"%d" ,1 ));flexarray_set (front, foffset++,"limit" ); -flexarray_set (front, foffset++,libxl_sprintf (&gc,"%d" ,LIBXL_XENCONSOLE_LIMIT )); +flexarray_set (front, foffset++,libxl__sprintf (&gc,"%d" ,LIBXL_XENCONSOLE_LIMIT ));flexarray_set (front, foffset++,"protocol" );flexarray_set (front, foffset++,LIBXL_XENCONSOLE_PROTOCOL );flexarray_set (front, foffset++,"type" );
@@ -2381,15 +2381,15 @@ retry_transaction:flexarray_set (front, foffset++, console->output); } -libxl_device_generic_add (ctx, &device, -libxl_xs_kvs_of_flexarray (&gc, back, boffset), -libxl_xs_kvs_of_flexarray (&gc, front, foffset)); +libxl__device_generic_add (ctx, &device, +libxl__xs_kvs_of_flexarray (&gc, back, boffset), +libxl__xs_kvs_of_flexarray (&gc, front, foffset)); rc =0 ; out_free:flexarray_free (back);flexarray_free (front); out: -libxl_free_all (&gc); +libxl__free_all (&gc);return rc; }
@@ -2423,28 +2423,28 @@ int libxl_device_vkb_add(libxl_ctx *ctx, device.kind =DEVICE_VKBD ;flexarray_set (back, boffset++,"frontend-id" ); -flexarray_set (back, boffset++,libxl_sprintf (&gc,"%d" , vkb->domid)); +flexarray_set (back, boffset++,libxl__sprintf (&gc,"%d" , vkb->domid));flexarray_set (back, boffset++,"online" );flexarray_set (back, boffset++,"1" );flexarray_set (back, boffset++,"state" ); -flexarray_set (back, boffset++,libxl_sprintf (&gc,"%d" ,1 )); +flexarray_set (back, boffset++,libxl__sprintf (&gc,"%d" ,1 ));flexarray_set (back, boffset++,"domain" ); -flexarray_set (back, boffset++,_libxl_domid_to_name (&gc, domid)); +flexarray_set (back, boffset++,libxl__domid_to_name (&gc, domid));flexarray_set (front, foffset++,"backend-id" ); -flexarray_set (front, foffset++,libxl_sprintf (&gc,"%d" , vkb->backend_domid)); +flexarray_set (front, foffset++,libxl__sprintf (&gc,"%d" , vkb->backend_domid));flexarray_set (front, foffset++,"state" ); -flexarray_set (front, foffset++,libxl_sprintf (&gc,"%d" ,1 )); +flexarray_set (front, foffset++,libxl__sprintf (&gc,"%d" ,1 )); -libxl_device_generic_add (ctx, &device, -libxl_xs_kvs_of_flexarray (&gc, back, boffset), -libxl_xs_kvs_of_flexarray (&gc, front, foffset)); +libxl__device_generic_add (ctx, &device, +libxl__xs_kvs_of_flexarray (&gc, back, boffset), +libxl__xs_kvs_of_flexarray (&gc, front, foffset)); rc =0 ; out_free:flexarray_free (back);flexarray_free (front); out: -libxl_free_all (&gc); +libxl__free_all (&gc);return rc; }
@@ -2467,10 +2467,10 @@ libxl_device_disk *libxl_device_disk_lisunsigned int numl, len;char *type; - be_path_vbd =libxl_sprintf (&gc,"%s/backend/vbd/%d" ,libxl_xs_get_dompath (&gc,0 ), domid); - be_path_tap =libxl_sprintf (&gc,"%s/backend/tap/%d" ,libxl_xs_get_dompath (&gc,0 ), domid); + be_path_vbd =libxl__sprintf (&gc,"%s/backend/vbd/%d" ,libxl__xs_get_dompath (&gc,0 ), domid); + be_path_tap =libxl__sprintf (&gc,"%s/backend/tap/%d" ,libxl__xs_get_dompath (&gc,0 ), domid); - b = l =libxl_xs_directory (&gc,XBT_NULL , be_path_vbd, &numl); + b = l =libxl__xs_directory (&gc,XBT_NULL , be_path_vbd, &numl);if (l) { ret =realloc (ret,sizeof (libxl_device_disk) * numl); disks = ret;
@@ -2479,19 +2479,19 @@ libxl_device_disk *libxl_device_disk_lisfor (; disks < dend; ++disks, ++l) { disks->backend_domid =0 ; disks->domid = domid; - disks->physpath =xs_read (ctx->xsh,XBT_NULL ,libxl_sprintf (&gc,"%s/%s/params" , be_path_vbd, *l), &len); -libxl_string_to_phystype (ctx,libxl_xs_read (&gc,XBT_NULL ,libxl_sprintf (&gc,"%s/%s/type" , be_path_vbd, *l)), &(disks->phystype)); - disks->virtpath =xs_read (ctx->xsh,XBT_NULL ,libxl_sprintf (&gc,"%s/%s/dev" , be_path_vbd, *l), &len); - disks->unpluggable =atoi (libxl_xs_read (&gc,XBT_NULL ,libxl_sprintf (&gc,"%s/%s/removable" , be_path_vbd, *l))); -if (!strcmp (libxl_xs_read (&gc,XBT_NULL ,libxl_sprintf (&gc,"%s/%s/mode" , be_path_vbd, *l)),"w" )) + disks->physpath =xs_read (ctx->xsh,XBT_NULL ,libxl__sprintf (&gc,"%s/%s/params" , be_path_vbd, *l), &len); +libxl_string_to_phystype (ctx,libxl__xs_read (&gc,XBT_NULL ,libxl__sprintf (&gc,"%s/%s/type" , be_path_vbd, *l)), &(disks->phystype)); + disks->virtpath =xs_read (ctx->xsh,XBT_NULL ,libxl__sprintf (&gc,"%s/%s/dev" , be_path_vbd, *l), &len); + disks->unpluggable =atoi (libxl__xs_read (&gc,XBT_NULL ,libxl__sprintf (&gc,"%s/%s/removable" , be_path_vbd, *l))); +if (!strcmp (libxl__xs_read (&gc,XBT_NULL ,libxl__sprintf (&gc,"%s/%s/mode" , be_path_vbd, *l)),"w" )) disks->readwrite =1 ;else disks->readwrite =0 ; - type =libxl_xs_read (&gc,XBT_NULL ,libxl_sprintf (&gc,"%s/device-type" ,libxl_xs_read (&gc,XBT_NULL ,libxl_sprintf (&gc,"%s/%s/frontend" , be_path_vbd, *l)))); + type =libxl__xs_read (&gc,XBT_NULL ,libxl__sprintf (&gc,"%s/device-type" ,libxl__xs_read (&gc,XBT_NULL ,libxl__sprintf (&gc,"%s/%s/frontend" , be_path_vbd, *l)))); disks->is_cdrom = !strcmp (type,"cdrom" ); } } - b = l =libxl_xs_directory (&gc,XBT_NULL , be_path_tap, &numl); + b = l =libxl__xs_directory (&gc,XBT_NULL , be_path_tap, &numl);if (l) { ret =realloc (ret,sizeof (libxl_device_disk) * (*num + numl)); disks = ret + *num;
@@ -2499,19 +2499,19 @@ libxl_device_disk *libxl_device_disk_lisfor (dend = ret + *num; disks < dend; ++disks, ++l) { disks->backend_domid =0 ; disks->domid = domid; - disks->physpath =xs_read (ctx->xsh,XBT_NULL ,libxl_sprintf (&gc,"%s/%s/params" , be_path_tap, *l), &len); -libxl_string_to_phystype (ctx,libxl_xs_read (&gc,XBT_NULL ,libxl_sprintf (&gc,"%s/%s/type" , be_path_tap, *l)), &(disks->phystype)); - disks->virtpath =xs_read (ctx->xsh,XBT_NULL ,libxl_sprintf (&gc,"%s/%s/dev" , be_path_tap, *l), &len); - disks->unpluggable =atoi (libxl_xs_read (&gc,XBT_NULL ,libxl_sprintf (&gc,"%s/%s/removable" , be_path_tap, *l))); -if (!strcmp (libxl_xs_read (&gc,XBT_NULL ,libxl_sprintf (&gc,"%s/%s/mode" , be_path_tap, *l)),"w" )) + disks->physpath =xs_read (ctx->xsh,XBT_NULL ,libxl__sprintf (&gc,"%s/%s/params" , be_path_tap, *l), &len); +libxl_string_to_phystype (ctx,libxl__xs_read (&gc,XBT_NULL ,libxl__sprintf (&gc,"%s/%s/type" , be_path_tap, *l)), &(disks->phystype)); + disks->virtpath =xs_read (ctx->xsh,XBT_NULL ,libxl__sprintf (&gc,"%s/%s/dev" , be_path_tap, *l), &len); + disks->unpluggable =atoi (libxl__xs_read (&gc,XBT_NULL ,libxl__sprintf (&gc,"%s/%s/removable" , be_path_tap, *l))); +if (!strcmp (libxl__xs_read (&gc,XBT_NULL ,libxl__sprintf (&gc,"%s/%s/mode" , be_path_tap, *l)),"w" )) disks->readwrite =1 ;else disks->readwrite =0 ; - type =libxl_xs_read (&gc,XBT_NULL ,libxl_sprintf (&gc,"%s/device-type" ,libxl_xs_read (&gc,XBT_NULL ,libxl_sprintf (&gc,"%s/%s/frontend" , be_path_tap, *l)))); + type =libxl__xs_read (&gc,XBT_NULL ,libxl__sprintf (&gc,"%s/device-type" ,libxl__xs_read (&gc,XBT_NULL ,libxl__sprintf (&gc,"%s/%s/frontend" , be_path_tap, *l)))); disks->is_cdrom = !strcmp (type,"cdrom" ); } } -libxl_free_all (&gc); +libxl__free_all (&gc);return ret; }
@@ -2522,31 +2522,31 @@ int libxl_device_disk_getinfo(libxl_ctxchar *dompath, *diskpath;char *val; - dompath =libxl_xs_get_dompath (&gc, domid); + dompath =libxl__xs_get_dompath (&gc, domid); diskinfo->devid =device_disk_dev_number (disk->virtpath);/* tap devices entries in xenstore are written as vbd devices. */ - diskpath =libxl_sprintf (&gc,"%s/device/vbd/%d" , dompath, diskinfo->devid); + diskpath =libxl__sprintf (&gc,"%s/device/vbd/%d" , dompath, diskinfo->devid); diskinfo->backend =xs_read (ctx->xsh,XBT_NULL , -libxl_sprintf (&gc,"%s/backend" , diskpath),NULL ); +libxl__sprintf (&gc,"%s/backend" , diskpath),NULL );if (!diskinfo->backend) { -libxl_free_all (&gc); +libxl__free_all (&gc);return ERROR_FAIL ; } - val =libxl_xs_read (&gc,XBT_NULL ,libxl_sprintf (&gc,"%s/backend-id" , diskpath)); + val =libxl__xs_read (&gc,XBT_NULL ,libxl__sprintf (&gc,"%s/backend-id" , diskpath)); diskinfo->backend_id = val ?strtoul (val,NULL ,10 ) :-1 ; - val =libxl_xs_read (&gc,XBT_NULL ,libxl_sprintf (&gc,"%s/state" , diskpath)); + val =libxl__xs_read (&gc,XBT_NULL ,libxl__sprintf (&gc,"%s/state" , diskpath)); diskinfo->state = val ?strtoul (val,NULL ,10 ) :-1 ; - val =libxl_xs_read (&gc,XBT_NULL ,libxl_sprintf (&gc,"%s/event-channel" , diskpath)); + val =libxl__xs_read (&gc,XBT_NULL ,libxl__sprintf (&gc,"%s/event-channel" , diskpath)); diskinfo->evtch = val ?strtoul (val,NULL ,10 ) :-1 ; - val =libxl_xs_read (&gc,XBT_NULL ,libxl_sprintf (&gc,"%s/ring-ref" , diskpath)); + val =libxl__xs_read (&gc,XBT_NULL ,libxl__sprintf (&gc,"%s/ring-ref" , diskpath)); diskinfo->rref = val ?strtoul (val,NULL ,10 ) :-1 ; diskinfo->frontend =xs_read (ctx->xsh,XBT_NULL , -libxl_sprintf (&gc,"%s/frontend" , diskinfo->backend),NULL ); - val =libxl_xs_read (&gc,XBT_NULL ,libxl_sprintf (&gc,"%s/frontend-id" , diskinfo->backend)); +libxl__sprintf (&gc,"%s/frontend" , diskinfo->backend),NULL ); + val =libxl__xs_read (&gc,XBT_NULL ,libxl__sprintf (&gc,"%s/frontend-id" , diskinfo->backend)); diskinfo->frontend_id = val ?strtoul (val,NULL ,10 ) :-1 ; -libxl_free_all (&gc); +libxl__free_all (&gc);return 0 ; }
@@ -2603,20 +2603,20 @@ static int libxl_build_xenpv_qemu_args(lif (vfb !=NULL ) { info->vnc = vfb->vnc;if (vfb->vnclisten) - info->vnclisten =libxl_strdup (gc, vfb->vnclisten); + info->vnclisten =libxl__strdup (gc, vfb->vnclisten); info->vncdisplay = vfb->vncdisplay; info->vncunused = vfb->vncunused;if (vfb->vncpasswd) info->vncpasswd = vfb->vncpasswd;if (vfb->keymap) - info->keymap =libxl_strdup (gc, vfb->keymap); + info->keymap =libxl__strdup (gc, vfb->keymap); info->sdl = vfb->sdl; info->opengl = vfb->opengl; }else info->nographic =1 ; info->domid = domid; info->dom_name =libxl_domid_to_name (ctx, domid); - info->device_model =libxl_abs_path (gc,"qemu-dm" ,libxl_libexec_path ()); + info->device_model =libxl__abs_path (gc,"qemu-dm" ,libxl_libexec_path ()); info->type =XENPV ;return 0 ; }
@@ -2629,7 +2629,7 @@ int libxl_create_xenpv_qemu(libxl_ctx *clibxl_build_xenpv_qemu_args (&gc, domid, vfb, &info);libxl_create_device_model (ctx, &info,NULL ,0 ,NULL ,0 , starting_r); -libxl_free_all (&gc); +libxl__free_all (&gc);return 0 ; }
@@ -2662,27 +2662,27 @@ int libxl_device_vfb_add(libxl_ctx *ctx, device.kind =DEVICE_VFB ;flexarray_set (back, boffset++,"frontend-id" ); -flexarray_set (back, boffset++,libxl_sprintf (&gc,"%d" , vfb->domid)); +flexarray_set (back, boffset++,libxl__sprintf (&gc,"%d" , vfb->domid));flexarray_set (back, boffset++,"online" );flexarray_set (back, boffset++,"1" );flexarray_set (back, boffset++,"state" ); -flexarray_set (back, boffset++,libxl_sprintf (&gc,"%d" ,1 )); +flexarray_set (back, boffset++,libxl__sprintf (&gc,"%d" ,1 ));flexarray_set (back, boffset++,"domain" ); -flexarray_set (back, boffset++,_libxl_domid_to_name (&gc, domid)); +flexarray_set (back, boffset++,libxl__domid_to_name (&gc, domid));flexarray_set (back, boffset++,"vnc" ); -flexarray_set (back, boffset++,libxl_sprintf (&gc,"%d" , vfb->vnc)); +flexarray_set (back, boffset++,libxl__sprintf (&gc,"%d" , vfb->vnc));flexarray_set (back, boffset++,"vnclisten" );flexarray_set (back, boffset++, vfb->vnclisten);flexarray_set (back, boffset++,"vncpasswd" );flexarray_set (back, boffset++, vfb->vncpasswd);flexarray_set (back, boffset++,"vncdisplay" ); -flexarray_set (back, boffset++,libxl_sprintf (&gc,"%d" , vfb->vncdisplay)); +flexarray_set (back, boffset++,libxl__sprintf (&gc,"%d" , vfb->vncdisplay));flexarray_set (back, boffset++,"vncunused" ); -flexarray_set (back, boffset++,libxl_sprintf (&gc,"%d" , vfb->vncunused)); +flexarray_set (back, boffset++,libxl__sprintf (&gc,"%d" , vfb->vncunused));flexarray_set (back, boffset++,"sdl" ); -flexarray_set (back, boffset++,libxl_sprintf (&gc,"%d" , vfb->sdl)); +flexarray_set (back, boffset++,libxl__sprintf (&gc,"%d" , vfb->sdl));flexarray_set (back, boffset++,"opengl" ); -flexarray_set (back, boffset++,libxl_sprintf (&gc,"%d" , vfb->opengl)); +flexarray_set (back, boffset++,libxl__sprintf (&gc,"%d" , vfb->opengl));if (vfb->xauthority) {flexarray_set (back, boffset++,"xauthority" );flexarray_set (back, boffset++, vfb->xauthority);
@@ -2693,19 +2693,19 @@ int libxl_device_vfb_add(libxl_ctx *ctx, }flexarray_set (front, foffset++,"backend-id" ); -flexarray_set (front, foffset++,libxl_sprintf (&gc,"%d" , vfb->backend_domid)); +flexarray_set (front, foffset++,libxl__sprintf (&gc,"%d" , vfb->backend_domid));flexarray_set (front, foffset++,"state" ); -flexarray_set (front, foffset++,libxl_sprintf (&gc,"%d" ,1 )); +flexarray_set (front, foffset++,libxl__sprintf (&gc,"%d" ,1 )); -libxl_device_generic_add (ctx, &device, -libxl_xs_kvs_of_flexarray (&gc, back, boffset), -libxl_xs_kvs_of_flexarray (&gc, front, foffset)); +libxl__device_generic_add (ctx, &device, +libxl__xs_kvs_of_flexarray (&gc, back, boffset), +libxl__xs_kvs_of_flexarray (&gc, front, foffset)); rc =0 ; out_free:flexarray_free (front);flexarray_free (back); out: -libxl_free_all (&gc); +libxl__free_all (&gc);return rc; }
@@ -2726,10 +2726,10 @@ int libxl_domain_setmaxmem(libxl_ctx *ctlibxl_gc gc =LIBXL_INIT_GC (ctx);char *mem, *endptr;uint32_t memorykb; -char *dompath =libxl_xs_get_dompath (&gc, domid); +char *dompath =libxl__xs_get_dompath (&gc, domid);int rc =1 ; - mem =libxl_xs_read (&gc,XBT_NULL ,libxl_sprintf (&gc,"%s/memory/target" , dompath)); + mem =libxl__xs_read (&gc,XBT_NULL ,libxl__sprintf (&gc,"%s/memory/target" , dompath));if (!mem) {XL_LOG_ERRNO (ctx,XL_LOG_ERROR ,"cannot get memory info from %s/memory/target\n" , dompath); goto out;
@@ -2746,11 +2746,11 @@ int libxl_domain_setmaxmem(libxl_ctx *ct }if (domid !=0 ) -libxl_xs_write (&gc,XBT_NULL ,libxl_sprintf (&gc,"%s/memory/static-max" , dompath),"%" PRIu32, max_memkb); +libxl__xs_write (&gc,XBT_NULL ,libxl__sprintf (&gc,"%s/memory/static-max" , dompath),"%" PRIu32, max_memkb); rc =0 ; out: -libxl_free_all (&gc); +libxl__free_all (&gc);return rc; }
@@ -2760,13 +2760,13 @@ int libxl_set_memory_target(libxl_ctx *cint rc =1 ;uint32_t memorykb =0 , videoram =0 ;char *memmax, *endptr, *videoram_s =NULL ; -char *dompath =libxl_xs_get_dompath (&gc, domid); +char *dompath =libxl__xs_get_dompath (&gc, domid);xc_domaininfo_t info;libxl_dominfo ptr;char *uuid;if (domid) { - memmax =libxl_xs_read (&gc,XBT_NULL ,libxl_sprintf (&gc,"%s/memory/static-max" , dompath)); + memmax =libxl__xs_read (&gc,XBT_NULL ,libxl__sprintf (&gc,"%s/memory/static-max" , dompath));if (!memmax) {XL_LOG_ERRNO (ctx,XL_LOG_ERROR ,"cannot get memory info from %s/memory/static-max\n" , dompath);
@@ -2786,17 +2786,17 @@ int libxl_set_memory_target(libxl_ctx *c } } - videoram_s =libxl_xs_read (&gc,XBT_NULL ,libxl_sprintf (&gc,"%s/memory/videoram" , dompath)); + videoram_s =libxl__xs_read (&gc,XBT_NULL ,libxl__sprintf (&gc,"%s/memory/videoram" , dompath)); videoram = videoram_s ?atoi (videoram_s) :0 ; -libxl_xs_write (&gc,XBT_NULL ,libxl_sprintf (&gc,"%s/memory/target" , dompath),"%" PRIu32, target_memkb); +libxl__xs_write (&gc,XBT_NULL ,libxl__sprintf (&gc,"%s/memory/target" , dompath),"%" PRIu32, target_memkb); rc =xc_domain_getinfolist (ctx->xch, domid,1 , &info);if (rc !=1 || info.domain != domid) goto out;xcinfo2xlinfo (&info, &ptr); - uuid =libxl_uuid2string (&gc, ptr.uuid); -libxl_xs_write (&gc,XBT_NULL ,libxl_sprintf (&gc,"/vm/%s/memory" , uuid),"%" PRIu32, target_memkb /1024 ); + uuid =libxl__uuid2string (&gc, ptr.uuid); +libxl__xs_write (&gc,XBT_NULL ,libxl__sprintf (&gc,"/vm/%s/memory" , uuid),"%" PRIu32, target_memkb /1024 );if (enforce || !domid) memorykb = target_memkb;
@@ -2806,7 +2806,7 @@ int libxl_set_memory_target(libxl_ctx *c rc =xc_domain_memory_set_pod_target (ctx->xch, domid, (target_memkb - videoram) /4 ,NULL ,NULL ,NULL ); out: -libxl_free_all (&gc); +libxl__free_all (&gc);return rc; }
@@ -2969,14 +2969,14 @@ int libxl_set_vcpuonline(libxl_ctx *ctx,XL_LOG_ERRNO (ctx,XL_LOG_ERROR ,"getting domain info list" ); goto out; } -if (!(dompath =libxl_xs_get_dompath (&gc, domid))) +if (!(dompath =libxl__xs_get_dompath (&gc, domid))) goto out; retry_transaction: t =xs_transaction_start (ctx->xsh);for (i =0 ; i <= info.vcpu_max_id; i++) -libxl_xs_write (&gc, t, -libxl_sprintf (&gc,"%s/cpu/%u/availability" , dompath, i), +libxl__xs_write (&gc, t, +libxl__sprintf (&gc,"%s/cpu/%u/availability" , dompath, i),"%s" , ((1 << i) & bitmask) ?"online" :"offline" );if (!xs_transaction_end (ctx->xsh, t,0 )) {if (errno ==EAGAIN )
@@ -2984,7 +2984,7 @@ retry_transaction: }else rc =0 ; out: -libxl_free_all (&gc); +libxl__free_all (&gc);return rc; }
@@ -3099,11 +3099,11 @@ int libxl_send_sysrq(libxl_ctx *ctx, uinint libxl_send_sysrq (libxl_ctx *ctx,uint32_t domid,char sysrq) {libxl_gc gc =LIBXL_INIT_GC (ctx); -char *dompath =libxl_xs_get_dompath (&gc, domid); +char *dompath =libxl__xs_get_dompath (&gc, domid); -libxl_xs_write (&gc,XBT_NULL ,libxl_sprintf (&gc,"%s/control/sysrq" , dompath),"%c" , sysrq); +libxl__xs_write (&gc,XBT_NULL ,libxl__sprintf (&gc,"%s/control/sysrq" , dompath),"%c" , sysrq); -libxl_free_all (&gc); +libxl__free_all (&gc);return 0 ; }
@@ -3191,14 +3191,14 @@ uint32_t libxl_vm_get_start_time(libxl_cuint32_t libxl_vm_get_start_time (libxl_ctx *ctx,uint32_t domid) {libxl_gc gc =LIBXL_INIT_GC (ctx); -char *dompath =libxl_xs_get_dompath (&gc, domid); +char *dompath =libxl__xs_get_dompath (&gc, domid);char *vm_path, *start_time;uint32_t ret; - vm_path =libxl_xs_read ( - &gc,XBT_NULL ,libxl_sprintf (&gc,"%s/vm" , dompath)); - start_time =libxl_xs_read ( - &gc,XBT_NULL ,libxl_sprintf (&gc,"%s/start_time" , vm_path)); + vm_path =libxl__xs_read ( + &gc,XBT_NULL ,libxl__sprintf (&gc,"%s/vm" , dompath)); + start_time =libxl__xs_read ( + &gc,XBT_NULL ,libxl__sprintf (&gc,"%s/start_time" , vm_path));if (start_time ==NULL ) {XL_LOG_ERRNOVAL (ctx,XL_LOG_ERROR ,-1 ,"Can't get start time of domain '%d'" , domid);
@@ -3206,7 +3206,7 @@ uint32_t libxl_vm_get_start_time(libxl_c }else { ret =strtoul (start_time,NULL ,10 ); } -libxl_free_all (&gc); +libxl__free_all (&gc);return ret; }
tools/libxl/libxl.h +1 -1
@@ -119,7 +119,7 @@* * No temporary objects allocated from the pool may be explicitly freed. * Therefore public functions which initialize a libxl_gc MUST call -* libxl_free_all() before returning. +* libxl__free_all() before returning. */ #ifndef LIBXL_H #define LIBXL_H
tools/libxl/libxl_blktap2.c +3 -3
@@ -35,15 +35,15 @@ const char *libxl_blktap_devpath(libxl_g type =device_disk_string_of_phystype (phystype); minor =tap_ctl_find_minor (type, disk);if (minor >=0 ) { - devname =libxl_sprintf (gc,"/dev/xen/blktap-2/tapdev%d" , minor); + devname =libxl__sprintf (gc,"/dev/xen/blktap-2/tapdev%d" , minor);if (devname)return devname; } - params =libxl_sprintf (gc,"%s:%s" , type, disk); + params =libxl__sprintf (gc,"%s:%s" , type, disk); err =tap_ctl_create (params, &devname);if (!err) { -libxl_ptr_add (gc, devname); +libxl__ptr_add (gc, devname);return devname; }
tools/libxl/libxl_bootloader.c +11 -11
@@ -45,20 +45,20 @@ static char **make_bootloader_args(libxlflexarray_set (args, nr++, (char *)info->u.pv.bootloader);if (info->kernel.path) -flexarray_set (args, nr++,libxl_sprintf (gc,"--kernel=%s" , info->kernel.path)); +flexarray_set (args, nr++,libxl__sprintf (gc,"--kernel=%s" , info->kernel.path));if (info->u.pv.ramdisk.path) -flexarray_set (args, nr++,libxl_sprintf (gc,"--ramdisk=%s" , info->u.pv.ramdisk.path)); +flexarray_set (args, nr++,libxl__sprintf (gc,"--ramdisk=%s" , info->u.pv.ramdisk.path));if (info->u.pv.cmdline && *info->u.pv.cmdline !='\0' ) -flexarray_set (args, nr++,libxl_sprintf (gc,"--args=%s" , info->u.pv.cmdline)); +flexarray_set (args, nr++,libxl__sprintf (gc,"--args=%s" , info->u.pv.cmdline)); -flexarray_set (args, nr++,libxl_sprintf (gc,"--output=%s" , fifo)); +flexarray_set (args, nr++,libxl__sprintf (gc,"--output=%s" , fifo));flexarray_set (args, nr++,"--output-format=simple0" ); -flexarray_set (args, nr++,libxl_sprintf (gc,"--output-directory=%s" ,"/var/run/libxl/" )); +flexarray_set (args, nr++,libxl__sprintf (gc,"--output-directory=%s" ,"/var/run/libxl/" ));if (info->u.pv.bootloader_args) {char *saveptr;/* Operate on a duplicate since strtok modifes the argument */ -char *dup =libxl_strdup (gc, info->u.pv.bootloader_args); +char *dup =libxl__strdup (gc, info->u.pv.bootloader_args);char *t =strtok_r (dup," \t\n" , &saveptr); do { flexarray_set(args, nr++, t);
@@ -126,7 +126,7 @@ static pid_t fork_exec_bootloader(int *mreturn -1 ; else if (pid == 0) {setenv ("TERM" ,"vt100" ,1 ); -libxl_exec (-1 ,-1 ,-1 , arg0, args); +libxl__exec (-1 ,-1 ,-1 , arg0, args);return -1 ; }
@@ -263,7 +263,7 @@ static char * bootloader_interact(libxl_ } } -libxl_ptr_add (gc, output); +libxl__ptr_add (gc, output);return output; out_err:
@@ -383,8 +383,8 @@ int libxl_run_bootloader(libxl_ctx *ctx, goto out_close; } - dom_console_xs_path =libxl_sprintf (&gc,"%s/serial/0/tty" ,libxl_xs_get_dompath (&gc, domid)); -libxl_xs_write (&gc,XBT_NULL , dom_console_xs_path,"%s" , dom_console_slave_tty_path); + dom_console_xs_path =libxl__sprintf (&gc,"%s/serial/0/tty" ,libxl__xs_get_dompath (&gc, domid)); +libxl__xs_write (&gc,XBT_NULL , dom_console_xs_path,"%s" , dom_console_slave_tty_path); pid =fork_exec_bootloader (&bootloader_fd, (char *)info->u.pv.bootloader, args);if (pid <0 ) {
@@ -441,7 +441,7 @@ out_close:free (args); out: -libxl_free_all (&gc); +libxl__free_all (&gc);return rc; }
tools/libxl/libxl_device.c +39 -39
222 lines not on this page · raw message
tools/libxl/libxl_dom.c +33 -33
175 lines not on this page · raw message
tools/libxl/libxl_exec.c +4 -4
@@ -35,7 +35,7 @@ static int call_waitpid(pid_t (*waitpid_return (waitpid_cb) ?waitpid_cb (pid, status, options) :waitpid (pid, status, options); } -void libxl_exec (int stdinfd,int stdoutfd,int stderrfd,char *arg0,char **args) +void libxl__exec (int stdinfd,int stdoutfd,int stderrfd,char *arg0,char **args)/* call this in the child */ {int i;
@@ -88,7 +88,7 @@ void libxl_report_child_exitstatus(libxl } } -int libxl_spawn_spawn(libxl_ctx *ctx, +int libxl__spawn_spawn(libxl_ctx *ctx, libxl_device_model_starting *starting, const char *what, void (*intermediate_hook)(void *for_spawn,
@@ -151,7 +151,7 @@ static void report_spawn_intermediate_st } } -int libxl_spawn_detach (libxl_ctx *ctx, +int libxl__spawn_detach (libxl_ctx *ctx,libxl_spawn_starting *for_spawn) {int r, status;
@@ -184,7 +184,7 @@ int libxl_spawn_detach(libxl_ctx *ctx,return rc; } -int libxl_spawn_check (libxl_ctx *ctx,void *for_spawn_void) +int libxl__spawn_check (libxl_ctx *ctx,void *for_spawn_void) {libxl_spawn_starting *for_spawn = for_spawn_void;pid_t got;
tools/libxl/libxl_internal.c +17 -17
@@ -29,12 +29,12 @@#include "libxl_internal.h" #include "libxl_utils.h" -int libxl_error_set (libxl_ctx *ctx,int code) +int libxl__error_set (libxl_ctx *ctx,int code) {return 0 ; } -int libxl_ptr_add (libxl_gc *gc,void *ptr) +int libxl__ptr_add (libxl_gc *gc,void *ptr) {int i;void **re;
@@ -65,7 +65,7 @@ int libxl_ptr_add(libxl_gc *gc, void *ptreturn 0 ; } -void libxl_free_all (libxl_gc *gc) +void libxl__free_all (libxl_gc *gc) {void *ptr;int i;
@@ -78,31 +78,31 @@ void libxl_free_all(libxl_gc *gc)free (gc->alloc_ptrs); } -void *libxl_zalloc (libxl_gc *gc,int bytes) +void *libxl__zalloc (libxl_gc *gc,int bytes) {void *ptr =calloc (bytes,1 );if (!ptr) { -libxl_error_set (libxl_gc_owner (gc),ENOMEM ); +libxl__error_set (libxl_gc_owner (gc),ENOMEM );return NULL ; } -libxl_ptr_add (gc, ptr); +libxl__ptr_add (gc, ptr);return ptr; } -void *libxl_calloc (libxl_gc *gc,size_t nmemb,size_t size) +void *libxl__calloc (libxl_gc *gc,size_t nmemb,size_t size) {void *ptr =calloc (nmemb, size);if (!ptr) { -libxl_error_set (libxl_gc_owner (gc),ENOMEM ); +libxl__error_set (libxl_gc_owner (gc),ENOMEM );return NULL ; } -libxl_ptr_add (gc, ptr); +libxl__ptr_add (gc, ptr);return ptr; } -char *libxl_sprintf (libxl_gc *gc,const char *fmt, ...) +char *libxl__sprintf (libxl_gc *gc,const char *fmt, ...) {char *s;va_list ap;
@@ -116,7 +116,7 @@ char *libxl_sprintf(libxl_gc *gc, constreturn NULL ; } - s =libxl_zalloc (gc, ret +1 ); + s =libxl__zalloc (gc, ret +1 );if (s) {va_start (ap, fmt); ret =vsnprintf (s, ret +1 , fmt, ap);
@@ -125,20 +125,20 @@ char *libxl_sprintf(libxl_gc *gc, constreturn s; } -char *libxl_strdup (libxl_gc *gc,const char *c) +char *libxl__strdup (libxl_gc *gc,const char *c) {char *s =strdup (c);if (s) -libxl_ptr_add (gc, s); +libxl__ptr_add (gc, s);return s; } -char *libxl_dirname (libxl_gc *gc,const char *s) +char *libxl__dirname (libxl_gc *gc,const char *s) {char *c; -char *ptr =libxl_strdup (gc, s); +char *ptr =libxl__strdup (gc, s); c =strrchr (ptr,'/' );if (!c)
@@ -184,11 +184,11 @@ void xl_log(libxl_ctx *ctx, xentoollog_lva_end (ap); } -char *libxl_abs_path (libxl_gc *gc,char *s,const char *path) +char *libxl__abs_path (libxl_gc *gc,char *s,const char *path) {if (!s || s[0 ] =='/' )return s; -return libxl_sprintf (gc,"%s/%s" , path, s); +return libxl__sprintf (gc,"%s/%s" , path, s); }
tools/libxl/libxl_internal.h +32 -32
129 lines not on this page · raw message
tools/libxl/libxl_pci.c +115 -115
458 lines not on this page · raw message
tools/libxl/libxl_utils.c +50 -50
108 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.
PATCH 1/1 libxl: Ensure all _hidden functions use libxl__ prefix
In reply to Ian Campbell# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1283853890 -3600
# Node ID f5372f2ac680ab1bd686499f4a9bdbc288629db1 # Parent a13d2fc2c1f6120cd9bcb3b2a56f10e18fdd17f0
libxl: Ensure all _hidden functions use libxl__ prefix
This patch covers the remaining functions identified by:
rgrep _hidden tools/libxl/*.h | grep -v libxl__
sed -i -e 's/XL_LOG/LIBXL__LOG/g' tools/libxl/*.[ch]
sed -i -e 's/xl_log/libxl__log/g' tools/libxl/*.[ch]
sed -i -e 's/\(build_\(pre\|post\|pv\|hvm\)\)/libxl__\1/g' tools/libxl/*.[ch]
sed -i -e 's/is_hvm/libxl__domain_is_hvm/g' tools/libxl/*.[ch]
sed -i -e 's/get_shutdown_reason/libxl__domain_shutdown_reason/g' tools/libxl/*.[ch]
sed -i -e 's/restore_common/libxl__domain_restore_common/g' tools/libxl/*.[ch]
sed -i -e 's/core_suspend/libxl__domain_suspend_common/g' tools/libxl/*.[ch]
sed -i -e 's/save_device_model/libxl__domain_save_device_model/g' tools/libxl/*.[ch]
sed -i -e 's/device_disk_backend_type_of_phystype/libxl__device_disk_backend_type_of_phystype/g' tools/libxl/*.[ch] sed -i -e 's/\<libxl_blktap_enabled\>/libxl__blktap_enabled/g' tools/libxl/*.[ch]
sed -i -e 's/\<libxl_blktap_devpath\>/libxl__blktap_devpath/g' tools/libxl/*.[ch]
Add _hidden to libxl__blktap_enabled and libxl__blktap_devpath
Inline dominfo_libxl__domain_shutdown_reason(info) into libxl__domain_shutdown_reason, its only caller.
tools/libxl/libxl.c +108 -108
@@ -48,7 +48,7 @@ int libxl_ctx_init(libxl_ctx *ctx, int v ctx->xch =xc_interface_open (lg,lg,0 );if (!ctx->xch) { -XL_LOG_ERRNOVAL (ctx,XL_LOG_ERROR , errno, +LIBXL__LOG_ERRNOVAL (ctx,LIBXL__LOG_ERROR , errno,"cannot open libxc handle" );return ERROR_FAIL ; }
@@ -57,7 +57,7 @@ int libxl_ctx_init(libxl_ctx *ctx, int vif (!ctx->xsh) ctx->xsh =xs_domain_open ();if (!ctx->xsh) { -XL_LOG_ERRNOVAL (ctx,XL_LOG_ERROR , errno, +LIBXL__LOG_ERRNOVAL (ctx,LIBXL__LOG_ERROR , errno,"cannot connect to xenstore" );xc_interface_close (ctx->xch);return ERROR_FAIL ;
@@ -135,14 +135,14 @@ int libxl_domain_make(libxl_ctx *ctx, li ret =xc_domain_create (ctx->xch, info->ssidref, handle, flags, domid);if (ret <0 ) { -XL_LOG_ERRNOVAL (ctx,XL_LOG_ERROR , ret,"domain creation fail" ); +LIBXL__LOG_ERRNOVAL (ctx,LIBXL__LOG_ERROR , ret,"domain creation fail" );libxl__free_all (&gc);return ERROR_FAIL ; } ret =xc_cpupool_movedomain (ctx->xch, info->poolid, *domid);if (ret <0 ) { -XL_LOG_ERRNOVAL (ctx,XL_LOG_ERROR , ret,"domain move fail" ); +LIBXL__LOG_ERRNOVAL (ctx,LIBXL__LOG_ERROR , ret,"domain move fail" );libxl__free_all (&gc);return ERROR_FAIL ; }
@@ -155,7 +155,7 @@ int libxl_domain_make(libxl_ctx *ctx, li vm_path =libxl__sprintf (&gc,"/vm/%s" , uuid_string);if (!vm_path) { -XL_LOG (ctx,XL_LOG_ERROR ,"cannot allocate create paths" ); +LIBXL__LOG (ctx,LIBXL__LOG_ERROR ,"cannot allocate create paths" );libxl__free_all (&gc);return ERROR_FAIL ; }
@@ -235,7 +235,7 @@ int libxl_domain_rename(libxl_ctx *ctx,if (!trans) { trans = our_trans =xs_transaction_start (ctx->xsh);if (!our_trans) { -XL_LOG_ERRNOVAL (ctx,XL_LOG_ERROR , errno, +LIBXL__LOG_ERRNOVAL (ctx,LIBXL__LOG_ERROR , errno,"create xs transaction for domain (re)name" ); goto x_fail; }
@@ -244,13 +244,13 @@ int libxl_domain_rename(libxl_ctx *ctx,if (old_name) { got_old_name =xs_read (ctx->xsh, trans, name_path, &got_old_len);if (!got_old_name) { -XL_LOG_ERRNOVAL (ctx,XL_LOG_ERROR , errno,"check old name" +LIBXL__LOG_ERRNOVAL (ctx,LIBXL__LOG_ERROR , errno,"check old name" " for domain %" PRIu32" allegedly named `%s'" , domid, old_name); goto x_fail; }if (strcmp (old_name, got_old_name)) { -XL_LOG (ctx,XL_LOG_ERROR ,"domain %" PRIu32" allegedly named " +LIBXL__LOG (ctx,LIBXL__LOG_ERROR ,"domain %" PRIu32" allegedly named " "`%s' is actually named `%s' - racing ?" , domid, old_name, got_old_name);free (got_old_name);
@@ -260,7 +260,7 @@ int libxl_domain_rename(libxl_ctx *ctx, }if (!xs_write (ctx->xsh, trans, name_path, new_name,strlen (new_name))) { -XL_LOG (ctx,XL_LOG_ERROR ,"failed to write new name `%s'" +LIBXL__LOG (ctx,LIBXL__LOG_ERROR ,"failed to write new name `%s'" " for domain %" PRIu32" previously named `%s'" , new_name, domid, old_name); goto x_fail;
@@ -270,12 +270,12 @@ int libxl_domain_rename(libxl_ctx *ctx,if (!xs_transaction_end (ctx->xsh, our_trans,0 )) { trans = our_trans =0 ;if (errno !=EAGAIN ) { -XL_LOG (ctx,XL_LOG_ERROR ,"failed to commit new name `%s'" +LIBXL__LOG (ctx,LIBXL__LOG_ERROR ,"failed to commit new name `%s'" " for domain %" PRIu32" previously named `%s'" , new_name, domid, old_name); goto x_fail; } -XL_LOG (ctx,XL_LOG_DEBUG ,"need to retry rename transaction" +LIBXL__LOG (ctx,LIBXL__LOG_DEBUG ,"need to retry rename transaction" " for domain %" PRIu32" (name_path=\"%s\", new_name=\"%s\")" , domid, name_path, new_name); goto retry_transaction;
@@ -300,14 +300,14 @@ int libxl_domain_build(libxl_ctx *ctx, lstruct timeval start_time;int i, ret; - ret =build_pre (ctx, domid, info, state); + ret =libxl__build_pre (ctx, domid, info, state);if (ret) goto out;gettimeofday (&start_time,NULL );if (info->hvm) { - ret =build_hvm (ctx, domid, info, state); + ret =libxl__build_hvm (ctx, domid, info, state);if (ret) goto out;
@@ -319,7 +319,7 @@ int libxl_domain_build(libxl_ctx *ctx, l vments[4 ] ="start_time" ; vments[5 ] =libxl__sprintf (&gc,"%lu.%02d" , start_time.tv_sec,(int )start_time.tv_usec/10000 ); }else { - ret =build_pv (ctx, domid, info, state); + ret =libxl__build_pv (ctx, domid, info, state);if (ret) goto out;
@@ -340,7 +340,7 @@ int libxl_domain_build(libxl_ctx *ctx, l vments[i++] = (char *) info->u.pv.cmdline; } } - ret =build_post (ctx, domid, info, state, vments, localents); + ret =libxl__build_post (ctx, domid, info, state, vments, localents); out:libxl__file_reference_unmap (&info->kernel);if (!info->hvm)
@@ -359,11 +359,11 @@ int libxl_domain_restore(libxl_ctx *ctx,struct timeval start_time;int i, ret, esave, flags; - ret =build_pre (ctx, domid, info, state); + ret =libxl__build_pre (ctx, domid, info, state);if (ret) goto out; - ret =restore_common (ctx, domid, info, state, fd); + ret =libxl__domain_restore_common (ctx, domid, info, state, fd);if (ret) goto out;
@@ -395,7 +395,7 @@ int libxl_domain_restore(libxl_ctx *ctx, vments[i++] = (char *) info->u.pv.cmdline; } } - ret =build_post (ctx, domid, info, state, vments, localents); + ret =libxl__build_post (ctx, domid, info, state, vments, localents);if (ret) goto out;
@@ -415,11 +415,11 @@ out: flags =fcntl (fd,F_GETFL );if (flags ==-1 ) { -XL_LOG_ERRNO (ctx,XL_LOG_ERROR ,"unable to get flags on restore fd" ); +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"unable to get flags on restore fd" ); }else { flags &= ~O_NONBLOCK ;if (fcntl (fd,F_SETFL , flags) ==-1 ) -XL_LOG_ERRNO (ctx,XL_LOG_ERROR ,"unable to put restore fd" +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"unable to put restore fd" " back to blocking mode" ); }
@@ -433,21 +433,21 @@ int libxl_domain_resume(libxl_ctx *ctx,libxl_gc gc =LIBXL_INIT_GC (ctx);int rc =0 ; -if (is_hvm (ctx, domid)) { -XL_LOG (ctx,XL_LOG_DEBUG ,"Called domain_resume on " +if (libxl__domain_is_hvm (ctx, domid)) { +LIBXL__LOG (ctx,LIBXL__LOG_DEBUG ,"Called domain_resume on " "non-cooperative hvm domain %u" , domid); rc =ERROR_NI ; goto out; }if (xc_domain_resume (ctx->xch, domid,1 )) { -XL_LOG_ERRNO (ctx,XL_LOG_ERROR , +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"xc_domain_resume failed for domain %u" , domid); rc =ERROR_FAIL ; goto out; }if (!xs_resume_domain (ctx->xsh, domid)) { -XL_LOG_ERRNO (ctx,XL_LOG_ERROR , +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"xs_resume_domain failed for domain %u" , domid); rc =ERROR_FAIL ;
@@ -558,13 +558,13 @@ libxl_dominfo * libxl_list_domain(libxl_ ptr =calloc (size,sizeof (libxl_dominfo));if (!ptr) { -XL_LOG_ERRNO (ctx,XL_LOG_ERROR ,"allocating domain info" ); +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"allocating domain info" );return NULL ; } ret =xc_domain_getinfolist (ctx->xch,0 ,1024 , info);if (ret<0 ) { -XL_LOG_ERRNO (ctx,XL_LOG_ERROR ,"geting domain info list" ); +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"geting domain info list" );return NULL ; }
@@ -582,7 +582,7 @@ int libxl_domain_info(libxl_ctx *ctx, li ret =xc_domain_getinfolist (ctx->xch, domid,1 , &xcinfo);if (ret<0 ) { -XL_LOG_ERRNO (ctx,XL_LOG_ERROR ,"geting domain info list" ); +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"geting domain info list" );return ERROR_FAIL ; }if (ret==0 || xcinfo.domain != domid)return ERROR_INVAL ;
@@ -600,13 +600,13 @@ libxl_poolinfo * libxl_list_pool(libxl_c ptr =calloc (size,sizeof (libxl_poolinfo));if (!ptr) { -XL_LOG_ERRNO (ctx,XL_LOG_ERROR ,"allocating cpupool info" ); +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"allocating cpupool info" );return NULL ; } ret =xc_cpupool_getinfo (ctx->xch,0 ,256 , info);if (ret<0 ) { -XL_LOG_ERRNO (ctx,XL_LOG_ERROR ,"getting cpupool info" ); +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"getting cpupool info" );return NULL ; }
@@ -631,7 +631,7 @@ libxl_vminfo * libxl_list_vm(libxl_ctx * ret =xc_domain_getinfolist (ctx->xch,1 ,1024 , info);if (ret<0 ) { -XL_LOG_ERRNO (ctx,XL_LOG_ERROR ,"geting domain info list" ); +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"geting domain info list" );return NULL ; }for (index = i =0 ; i < ret; i++) {
@@ -649,14 +649,14 @@ int libxl_domain_suspend(libxl_ctx *ctx,int libxl_domain_suspend (libxl_ctx *ctx,libxl_domain_suspend_info *info,uint32_t domid,int fd) { -int hvm =is_hvm (ctx, domid); +int hvm =libxl__domain_is_hvm (ctx, domid);int live = info !=NULL && info->flags &XL_SUSPEND_LIVE ;int debug = info !=NULL && info->flags &XL_SUSPEND_DEBUG ;int rc =0 ; -core_suspend (ctx, domid, fd, hvm, live, debug); +libxl__domain_suspend_common (ctx, domid, fd, hvm, live, debug);if (hvm) - rc =save_device_model (ctx, domid, fd); + rc =libxl__domain_save_device_model (ctx, domid, fd);return rc; }
@@ -665,7 +665,7 @@ int libxl_domain_pause(libxl_ctx *ctx, uint ret; ret =xc_domain_pause (ctx->xch, domid);if (ret<0 ) { -XL_LOG_ERRNO (ctx,XL_LOG_ERROR ,"pausing domain %d" , domid); +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"pausing domain %d" , domid);return ERROR_FAIL ; }return 0 ;
@@ -677,7 +677,7 @@ int libxl_domain_core_dump(libxl_ctx *ctint ret; ret =xc_domain_dumpcore (ctx->xch, domid, filename);if (ret<0 ) { -XL_LOG_ERRNO (ctx,XL_LOG_ERROR ,"core dumping domain %d to %s" , +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"core dumping domain %d to %s" , domid, filename);return ERROR_FAIL ; }
@@ -691,7 +691,7 @@ int libxl_domain_unpause(libxl_ctx *ctx,char *state;int ret, rc =0 ; -if (is_hvm (ctx, domid)) { +if (libxl__domain_is_hvm (ctx, domid)) { path =libxl__sprintf (&gc,"/local/domain/0/device-model/%d/state" , domid); state =libxl__xs_read (&gc,XBT_NULL , path);if (state !=NULL && !strcmp (state,"paused" )) {
@@ -701,7 +701,7 @@ int libxl_domain_unpause(libxl_ctx *ctx, } ret =xc_domain_unpause (ctx->xch, domid);if (ret<0 ) { -XL_LOG_ERRNO (ctx,XL_LOG_ERROR ,"unpausing domain %d" , domid); +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"unpausing domain %d" , domid); rc =ERROR_FAIL ; }libxl__free_all (&gc);
@@ -736,24 +736,24 @@ int libxl_domain_shutdown(libxl_ctx *ctx shutdown_path =libxl__sprintf (&gc,"%s/control/shutdown" , dom_path);xs_write (ctx->xsh,XBT_NULL , shutdown_path, req_table[req],strlen (req_table[req])); -if (is_hvm (ctx,domid)) { +if (libxl__domain_is_hvm (ctx,domid)) {unsigned long acpi_s_state =0 ;unsigned long pvdriver =0 ;int ret; ret =xc_get_hvm_param (ctx->xch, domid,HVM_PARAM_ACPI_S_STATE , &acpi_s_state);if (ret<0 ) { -XL_LOG_ERRNO (ctx,XL_LOG_ERROR ,"getting ACPI S-state" ); +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"getting ACPI S-state" );return ERROR_FAIL ; } ret =xc_get_hvm_param (ctx->xch, domid,HVM_PARAM_CALLBACK_IRQ , &pvdriver);if (ret<0 ) { -XL_LOG_ERRNO (ctx,XL_LOG_ERROR ,"getting HVM callback IRQ" ); +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"getting HVM callback IRQ" );return ERROR_FAIL ; }if (!pvdriver || acpi_s_state !=0 ) { ret =xc_domain_shutdown (ctx->xch, domid, req);if (ret<0 ) { -XL_LOG_ERRNO (ctx,XL_LOG_ERROR ,"unpausing domain" ); +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"unpausing domain" );return ERROR_FAIL ; } }
@@ -790,7 +790,7 @@ int libxl_wait_for_disk_ejects(libxl_ctxfor (i =0 ; i < num_disks; i++) {if (asprintf (&(waiter[i].path),"%s/device/vbd/%d/eject" ,libxl__xs_get_dompath (&gc, domid), -device_disk_dev_number (disks[i].virtpath)) <0 ) +libxl__device_disk_dev_number (disks[i].virtpath)) <0 ) goto out;if (asprintf (&(waiter[i].token),"%d" ,LIBXL_EVENT_DISK_EJECT ) <0 ) goto out;
@@ -893,11 +893,11 @@ static int libxl_destroy_device_model(liif (!pid) {int stubdomid =libxl_get_stubdom_id (ctx, domid);if (!stubdomid) { -XL_LOG_ERRNO (ctx,XL_LOG_ERROR ,"Couldn't find device model's pid" ); +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"Couldn't find device model's pid" ); ret =ERROR_INVAL ; goto out; } -XL_LOG (ctx,XL_LOG_ERROR ,"Device model is a stubdom, domid=%d\n" , stubdomid); +LIBXL__LOG (ctx,LIBXL__LOG_ERROR ,"Device model is a stubdom, domid=%d\n" , stubdomid); ret =libxl_domain_destroy (ctx, stubdomid,0 ); goto out; }
@@ -905,13 +905,13 @@ static int libxl_destroy_device_model(li ret =kill (atoi (pid),SIGHUP );if (ret <0 && errno ==ESRCH ) { -XL_LOG (ctx,XL_LOG_DEBUG ,"Device Model already exited" ); +LIBXL__LOG (ctx,LIBXL__LOG_DEBUG ,"Device Model already exited" ); ret =0 ; }else if (ret ==0 ) { -XL_LOG (ctx,XL_LOG_DEBUG ,"Device Model signaled" ); +LIBXL__LOG (ctx,LIBXL__LOG_DEBUG ,"Device Model signaled" ); ret =0 ; }else { -XL_LOG_ERRNO (ctx,XL_LOG_ERROR ,"failed to kill Device Model [%d]" , +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"failed to kill Device Model [%d]" ,atoi (pid)); } out:
@@ -926,7 +926,7 @@ int libxl_domain_destroy(libxl_ctx *ctx,char *vm_path;int rc, dm_present; -if (is_hvm (ctx, domid)) { +if (libxl__domain_is_hvm (ctx, domid)) { dm_present =1 ; }else {char *pid;
@@ -941,7 +941,7 @@ int libxl_domain_destroy(libxl_ctx *ctx, }if (libxl_device_pci_shutdown (ctx, domid) <0 ) -XL_LOG (ctx,XL_LOG_ERROR ,"pci shutdown failed for domid %d" , domid); +LIBXL__LOG (ctx,LIBXL__LOG_ERROR ,"pci shutdown failed for domid %d" , domid);if (dm_present) { xs_write(ctx->xsh, XBT_NULL, libxl__sprintf(&gc, "/local/domain/0/device-model/%d/command", domid),
@@ -949,28 +949,28 @@ int libxl_domain_destroy(libxl_ctx *ctx, } rc =xc_domain_pause (ctx->xch, domid);if (rc <0 ) { -XL_LOG_ERRNOVAL (ctx,XL_LOG_ERROR , rc,"xc_domain_pause failed for %d" , domid); +LIBXL__LOG_ERRNOVAL (ctx,LIBXL__LOG_ERROR , rc,"xc_domain_pause failed for %d" , domid); }if (dm_present) {if (libxl_destroy_device_model (ctx, domid) <0 ) -XL_LOG (ctx,XL_LOG_ERROR ,"libxl_destroy_device_model failed for %d" , domid); +LIBXL__LOG (ctx,LIBXL__LOG_ERROR ,"libxl_destroy_device_model failed for %d" , domid); }if (libxl__devices_destroy (ctx, domid, force) <0 ) -XL_LOG (ctx,XL_LOG_ERROR ,"libxl_destroy_devices failed for %d" , domid); +LIBXL__LOG (ctx,LIBXL__LOG_ERROR ,"libxl_destroy_devices failed for %d" , domid); vm_path =libxl__xs_read (&gc,XBT_NULL ,libxl__sprintf (&gc,"%s/vm" , dom_path));if (vm_path)if (!xs_rm (ctx->xsh,XBT_NULL , vm_path)) -XL_LOG_ERRNO (ctx,XL_LOG_ERROR ,"xs_rm failed for %s" , vm_path); +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"xs_rm failed for %s" , vm_path);if (!xs_rm (ctx->xsh,XBT_NULL , dom_path)) -XL_LOG_ERRNO (ctx,XL_LOG_ERROR ,"xs_rm failed for %s" , dom_path); +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"xs_rm failed for %s" , dom_path);libxl__userdata_destroyall (ctx, domid); rc =xc_domain_destroy (ctx->xch, domid);if (rc <0 ) { -XL_LOG_ERRNOVAL (ctx,XL_LOG_ERROR , rc,"xc_domain_destroy failed for %d" , domid); +LIBXL__LOG_ERRNOVAL (ctx,LIBXL__LOG_ERROR , rc,"xc_domain_destroy failed for %d" , domid); rc =ERROR_FAIL ; goto out; }
@@ -1012,7 +1012,7 @@ int libxl_primary_console_exec(libxl_ctxif (stubdomid)return libxl_console_exec (ctx, stubdomid,1 ,LIBXL_CONSTYPE_PV );else { -if (is_hvm (ctx, domid_vm)) +if (libxl__domain_is_hvm (ctx, domid_vm))return libxl_console_exec (ctx, domid_vm,0 ,LIBXL_CONSTYPE_SERIAL );else return libxl_console_exec (ctx, domid_vm,0 ,LIBXL_CONSTYPE_PV );
@@ -1067,7 +1067,7 @@ int libxl_vncviewer_exec(libxl_ctx *ctx,if (unlink (tmpname) )/* should never happen */ -XL_LOG_ERRNO (ctx,XL_LOG_ERROR ,"unlink %s failed" , tmpname); +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"unlink %s failed" , tmpname);if (libxl_write_exactly (ctx, autopass_fd, vnc_pass,strlen (vnc_pass), tmpname,"vnc password" ) ) {
@@ -1535,7 +1535,7 @@ static int libxl_create_stubdom(libxl_ct "%d", info->domid); ret =xc_domain_set_target (ctx->xch, domid, info->domid);if (ret<0 ) { -XL_LOG_ERRNO (ctx,XL_LOG_ERROR ,"setting target domain %d -> %d" , domid, info->domid); +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"setting target domain %d -> %d" , domid, info->domid); ret =ERROR_FAIL ; goto out_free; }
@@ -1774,10 +1774,10 @@ int libxl_device_disk_add(libxl_ctx *ctx goto out_free; } - backend_type =device_disk_backend_type_of_phystype (disk->phystype); - devid =device_disk_dev_number (disk->virtpath); + backend_type =libxl__device_disk_backend_type_of_phystype (disk->phystype); + devid =libxl__device_disk_dev_number (disk->virtpath);if (devid==-1 ) { -XL_LOG (ctx,XL_LOG_ERROR ,"Invalid or unsupported" +LIBXL__LOG (ctx,LIBXL__LOG_ERROR ,"Invalid or unsupported" " virtual disk identifier %s" , disk->virtpath); rc =ERROR_INVAL ; goto out_free;
@@ -1792,7 +1792,7 @@ int libxl_device_disk_add(libxl_ctx *ctxswitch (disk->phystype) {case PHYSTYPE_PHY : { -device_physdisk_major_minor (disk->physpath, &major, &minor); +libxl__device_physdisk_major_minor (disk->physpath, &major, &minor);flexarray_set (back, boffset++,"physical-device" );flexarray_set (back, boffset++,libxl__sprintf (&gc,"%x:%x" , major, minor));
@@ -1809,19 +1809,19 @@ int libxl_device_disk_add(libxl_ctx *ctxcase PHYSTYPE_QCOW :case PHYSTYPE_QCOW2 :case PHYSTYPE_VHD : -if (libxl_blktap_enabled (&gc)) { -const char *dev =libxl_blktap_devpath (&gc, +if (libxl__blktap_enabled (&gc)) { +const char *dev =libxl__blktap_devpath (&gc, disk->physpath, disk->phystype);if (!dev) { rc =ERROR_FAIL ; goto out_free; }flexarray_set (back, boffset++,"tapdisk-params" ); -flexarray_set (back, boffset++,libxl__sprintf (&gc,"%s:%s" ,device_disk_string_of_phystype (disk->phystype), disk->physpath)); +flexarray_set (back, boffset++,libxl__sprintf (&gc,"%s:%s" ,libxl__device_disk_string_of_phystype (disk->phystype), disk->physpath));flexarray_set (back, boffset++,"params" );flexarray_set (back, boffset++,libxl__strdup (&gc, dev)); backend_type ="phy" ; -device_physdisk_major_minor (dev, &major, &minor); +libxl__device_physdisk_major_minor (dev, &major, &minor);flexarray_set (back, boffset++,"physical-device" );flexarray_set (back, boffset++,libxl__sprintf (&gc,"%x:%x" , major, minor)); device.backend_kind =DEVICE_VBD ;
@@ -1830,13 +1830,13 @@ int libxl_device_disk_add(libxl_ctx *ctx }flexarray_set (back, boffset++,"params" );flexarray_set (back, boffset++,libxl__sprintf (&gc,"%s:%s" , -device_disk_string_of_phystype (disk->phystype), disk->physpath)); +libxl__device_disk_string_of_phystype (disk->phystype), disk->physpath)); device.backend_kind =DEVICE_TAP ;break ;default : -XL_LOG (ctx,XL_LOG_ERROR ,"unrecognized disk physical type: %d\n" , disk->phystype); +LIBXL__LOG (ctx,LIBXL__LOG_ERROR ,"unrecognized disk physical type: %d\n" , disk->phystype); rc =ERROR_INVAL ; goto out_free; }
@@ -1892,7 +1892,7 @@ int libxl_device_disk_del(libxl_ctx *ctxlibxl_device device;int devid; - devid =device_disk_dev_number (disk->virtpath); + devid =libxl__device_disk_dev_number (disk->virtpath); device.backend_domid = disk->backend_domid; device.backend_devid = devid; device.backend_kind =
@@ -1922,12 +1922,12 @@ char * libxl_device_disk_local_attach(licase PHYSTYPE_QCOW :case PHYSTYPE_QCOW2 :case PHYSTYPE_VHD : -if (libxl_blktap_enabled (&gc)) - dev =libxl_blktap_devpath (&gc, disk->physpath, phystype); +if (libxl__blktap_enabled (&gc)) + dev =libxl__blktap_devpath (&gc, disk->physpath, phystype);break ;default : -XL_LOG (ctx,XL_LOG_ERROR ,"unrecognized disk physical type: %d\n" , phystype); +LIBXL__LOG (ctx,LIBXL__LOG_ERROR ,"unrecognized disk physical type: %d\n" , phystype);break ; } ret =strdup (dev);
@@ -2523,7 +2523,7 @@ int libxl_device_disk_getinfo(libxl_ctxchar *val; dompath =libxl__xs_get_dompath (&gc, domid); - diskinfo->devid =device_disk_dev_number (disk->virtpath); + diskinfo->devid =libxl__device_disk_dev_number (disk->virtpath);/* tap devices entries in xenstore are written as vbd devices. */ diskpath =libxl__sprintf (&gc,"%s/device/vbd/%d" , dompath, diskinfo->devid);
@@ -2568,7 +2568,7 @@ int libxl_cdrom_insert(libxl_ctx *ctx, ubreak ; }if (i == num) { -XL_LOG (ctx,XL_LOG_ERROR ,"Virtual device not found" ); +LIBXL__LOG (ctx,LIBXL__LOG_ERROR ,"Virtual device not found" ); goto out; }
@@ -2731,17 +2731,17 @@ int libxl_domain_setmaxmem(libxl_ctx *ct mem =libxl__xs_read (&gc,XBT_NULL ,libxl__sprintf (&gc,"%s/memory/target" , dompath));if (!mem) { -XL_LOG_ERRNO (ctx,XL_LOG_ERROR ,"cannot get memory info from %s/memory/target\n" , dompath); +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"cannot get memory info from %s/memory/target\n" , dompath); goto out; } memorykb =strtoul (mem, &endptr,10 );if (*endptr !='\0' ) { -XL_LOG_ERRNO (ctx,XL_LOG_ERROR ,"invalid memory %s from %s/memory/target\n" , mem, dompath); +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"invalid memory %s from %s/memory/target\n" , mem, dompath); goto out; }if (max_memkb < memorykb) { -XL_LOG_ERRNO (ctx,XL_LOG_ERROR ,"memory_static_max must be greater than or or equal to memory_dynamic_max\n" ); +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"memory_static_max must be greater than or or equal to memory_dynamic_max\n" ); goto out; }
@@ -2768,19 +2768,19 @@ int libxl_set_memory_target(libxl_ctx *cif (domid) { memmax =libxl__xs_read (&gc,XBT_NULL ,libxl__sprintf (&gc,"%s/memory/static-max" , dompath));if (!memmax) { -XL_LOG_ERRNO (ctx,XL_LOG_ERROR , +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"cannot get memory info from %s/memory/static-max\n" , dompath); goto out; } memorykb =strtoul (memmax, &endptr,10 );if (*endptr !='\0' ) { -XL_LOG_ERRNO (ctx,XL_LOG_ERROR , +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"invalid max memory %s from %s/memory/static-max\n" , memmax, dompath); goto out; }if (target_memkb > memorykb) { -XL_LOG (ctx,XL_LOG_ERROR , +LIBXL__LOG (ctx,LIBXL__LOG_ERROR ,"memory_dynamic_max must be less than or equal to memory_static_max\n" ); goto out; }
@@ -2835,7 +2835,7 @@ int libxl_get_physinfo(libxl_ctx *ctx, l rc =xc_physinfo (ctx->xch, &xcphysinfo);if (rc !=0 ) { -XL_LOG_ERRNO (ctx,XL_LOG_ERROR ,"getting physinfo" ); +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"getting physinfo" );return ERROR_FAIL ; } physinfo->threads_per_core = xcphysinfo.threads_per_core;
@@ -2909,11 +2909,11 @@ libxl_vcpuinfo *libxl_list_vcpu(libxl_ctunsigned num_cpuwords;if (xc_domain_getinfolist (ctx->xch, domid,1 , &domaininfo) !=1 ) { -XL_LOG_ERRNO (ctx,XL_LOG_ERROR ,"getting infolist" ); +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"getting infolist" );return NULL ; }if (xc_physinfo (ctx->xch, &physinfo) ==-1 ) { -XL_LOG_ERRNO (ctx,XL_LOG_ERROR ,"getting physinfo" ); +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"getting physinfo" );return NULL ; } *nrcpus = physinfo.max_cpu_id +1 ;
@@ -2929,12 +2929,12 @@ libxl_vcpuinfo *libxl_list_vcpu(libxl_ctreturn NULL ; }if (xc_vcpu_getinfo (ctx->xch, domid, *nb_vcpu, &vcpuinfo) ==-1 ) { -XL_LOG_ERRNO (ctx,XL_LOG_ERROR ,"getting vcpu info" ); +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"getting vcpu info" );return NULL ; }if (xc_vcpu_getaffinity (ctx->xch, domid, *nb_vcpu, ptr->cpumap, ((*nrcpus) +7 ) /8 ) ==-1 ) { -XL_LOG_ERRNO (ctx,XL_LOG_ERROR ,"getting vcpu affinity" ); +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"getting vcpu affinity" );return NULL ; } ptr->vcpuid = *nb_vcpu;
@@ -2951,7 +2951,7 @@ int libxl_set_vcpuaffinity(libxl_ctx *ct uint64_t *cpumap, int nrcpus) {if (xc_vcpu_setaffinity (ctx->xch, domid, vcpuid, cpumap, (nrcpus +7 ) /8 )) { -XL_LOG_ERRNO (ctx,XL_LOG_ERROR ,"setting vcpu affinity" ); +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"setting vcpu affinity" );return ERROR_FAIL ; }return 0 ;
@@ -2966,7 +2966,7 @@ int libxl_set_vcpuonline(libxl_ctx *ctx,int i, rc =ERROR_FAIL ;if (libxl_domain_info (ctx, &info, domid) <0 ) { -XL_LOG_ERRNO (ctx,XL_LOG_ERROR ,"getting domain info list" ); +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"getting domain info list" ); goto out; }if (!(dompath =libxl__xs_get_dompath (&gc, domid)))
@@ -2996,7 +2996,7 @@ int libxl_get_sched_id(libxl_ctx *ctx)int sched, ret;if ((ret =xc_sched_id (ctx->xch, &sched)) !=0 ) { -XL_LOG_ERRNO (ctx,XL_LOG_ERROR ,"getting domain info list" ); +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"getting domain info list" );return ERROR_FAIL ; }return sched;
@@ -3009,7 +3009,7 @@ int libxl_sched_credit_domain_get(libxl_ rc =xc_sched_credit_domain_get (ctx->xch, domid, &sdom);if (rc !=0 ) { -XL_LOG_ERRNO (ctx,XL_LOG_ERROR ,"setting domain sched credit" ); +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"setting domain sched credit" );return ERROR_FAIL ; }
@@ -3027,7 +3027,7 @@ int libxl_sched_credit_domain_set(libxl_ rc =xc_domain_getinfolist (ctx->xch, domid,1 , &domaininfo);if (rc <0 ) { -XL_LOG_ERRNO (ctx,XL_LOG_ERROR ,"getting domain info list" ); +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"getting domain info list" );return ERROR_FAIL ; }if (rc !=1 || domaininfo.domain != domid)
@@ -3035,13 +3035,13 @@ int libxl_sched_credit_domain_set(libxl_if (scinfo->weight <1 || scinfo->weight >65535 ) { -XL_LOG_ERRNOVAL (ctx,XL_LOG_ERROR , rc, +LIBXL__LOG_ERRNOVAL (ctx,LIBXL__LOG_ERROR , rc,"Cpu weight out of range, valid values are within range from 1 to 65535" );return ERROR_INVAL ; }if (scinfo->cap <0 || scinfo->cap > (domaininfo.max_vcpu_id +1 ) *100 ) { -XL_LOG_ERRNOVAL (ctx,XL_LOG_ERROR , rc, +LIBXL__LOG_ERRNOVAL (ctx,LIBXL__LOG_ERROR , rc,"Cpu cap out of range, valid range is from 0 to %d for specified number of vcpus" , ((domaininfo.max_vcpu_id +1 ) *100 ));return ERROR_INVAL ;
@@ -3052,7 +3052,7 @@ int libxl_sched_credit_domain_set(libxl_ rc =xc_sched_credit_domain_set (ctx->xch, domid, &sdom);if ( rc <0 ) { -XL_LOG_ERRNO (ctx,XL_LOG_ERROR ,"setting domain sched credit" ); +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"setting domain sched credit" );return ERROR_FAIL ; }
@@ -3081,14 +3081,14 @@ int libxl_send_trigger(libxl_ctx *ctx, uint trigger_type =trigger_type_from_string (trigger_name);if (trigger_type ==-1 ) { -XL_LOG_ERRNOVAL (ctx,XL_LOG_ERROR ,-1 , +LIBXL__LOG_ERRNOVAL (ctx,LIBXL__LOG_ERROR ,-1 ,"Invalid trigger, valid triggers are <nmi|reset|init|power|sleep>" );return ERROR_INVAL ; } rc =xc_domain_send_trigger (ctx->xch, domid, trigger_type, vcpuid);if (rc !=0 ) { -XL_LOG_ERRNOVAL (ctx,XL_LOG_ERROR , rc, +LIBXL__LOG_ERRNOVAL (ctx,LIBXL__LOG_ERROR , rc,"Send trigger '%s' failed" , trigger_name);return ERROR_FAIL ; }
@@ -3112,7 +3112,7 @@ int libxl_send_debug_keys(libxl_ctx *ctxint ret; ret =xc_send_debug_keys (ctx->xch, keys);if ( ret <0 ) { -XL_LOG_ERRNO (ctx,XL_LOG_ERROR ,"sending debug keys" ); +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"sending debug keys" );return ERROR_FAIL ; }return 0 ;
@@ -3126,14 +3126,14 @@ libxl_xen_console_reader *char *buf =malloc (size);if (!buf) { -XL_LOG_ERRNO (ctx,XL_LOG_ERROR ,"cannot malloc buffer for libxl_xen_console_reader," +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"cannot malloc buffer for libxl_xen_console_reader," " size is %u" , size);return NULL ; } cr =malloc (sizeof (libxl_xen_console_reader));if (!cr) { -XL_LOG_ERRNO (ctx,XL_LOG_ERROR ,"cannot malloc libxl_xen_console_reader" ); +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"cannot malloc libxl_xen_console_reader" );return NULL ; }
@@ -3165,7 +3165,7 @@ int libxl_xen_console_read_line(libxl_ct ret =xc_readconsolering (ctx->xch, &cr->buffer, &cr->count, cr->clear, cr->incremental, &cr->index);if (ret <0 ) { -XL_LOG_ERRNO (ctx,XL_LOG_ERROR ,"reading console ring buffer" ); +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"reading console ring buffer" );return ERROR_FAIL ; }if (!ret) {
@@ -3200,7 +3200,7 @@ uint32_t libxl_vm_get_start_time(libxl_c start_time =libxl__xs_read ( &gc,XBT_NULL ,libxl__sprintf (&gc,"%s/start_time" , vm_path));if (start_time ==NULL ) { -XL_LOG_ERRNOVAL (ctx,XL_LOG_ERROR ,-1 , +LIBXL__LOG_ERRNOVAL (ctx,LIBXL__LOG_ERROR ,-1 ,"Can't get start time of domain '%d'" , domid); ret =-1 ; }else {
@@ -3218,7 +3218,7 @@ char *libxl_tmem_list(libxl_ctx *ctx, ui rc =xc_tmem_control (ctx->xch,-1 ,TMEMC_LIST , domid,32768 , use_long,0 , _buf);if (rc <0 ) { -XL_LOG_ERRNOVAL (ctx,XL_LOG_ERROR , rc, +LIBXL__LOG_ERRNOVAL (ctx,LIBXL__LOG_ERROR , rc,"Can not get tmem list" );return NULL ; }
@@ -3233,7 +3233,7 @@ int libxl_tmem_freeze(libxl_ctx *ctx, ui rc =xc_tmem_control (ctx->xch,-1 ,TMEMC_FREEZE , domid,0 ,0 ,0 ,NULL );if (rc <0 ) { -XL_LOG_ERRNOVAL (ctx,XL_LOG_ERROR , rc, +LIBXL__LOG_ERRNOVAL (ctx,LIBXL__LOG_ERROR , rc,"Can not freeze tmem pools" );return ERROR_FAIL ; }
@@ -3248,7 +3248,7 @@ int libxl_tmem_destroy(libxl_ctx *ctx, u rc =xc_tmem_control (ctx->xch,-1 ,TMEMC_DESTROY , domid,0 ,0 ,0 ,NULL );if (rc <0 ) { -XL_LOG_ERRNOVAL (ctx,XL_LOG_ERROR , rc, +LIBXL__LOG_ERRNOVAL (ctx,LIBXL__LOG_ERROR , rc,"Can not destroy tmem pools" );return ERROR_FAIL ; }
@@ -3263,7 +3263,7 @@ int libxl_tmem_thaw(libxl_ctx *ctx, uint rc =xc_tmem_control (ctx->xch,-1 ,TMEMC_THAW , domid,0 ,0 ,0 ,NULL );if (rc <0 ) { -XL_LOG_ERRNOVAL (ctx,XL_LOG_ERROR , rc, +LIBXL__LOG_ERRNOVAL (ctx,LIBXL__LOG_ERROR , rc,"Can not thaw tmem pools" );return ERROR_FAIL ; }
@@ -3289,13 +3289,13 @@ int libxl_tmem_set(libxl_ctx *ctx, uint3int32_t subop =tmem_setop_from_string (name);if (subop ==-1 ) { -XL_LOG_ERRNOVAL (ctx,XL_LOG_ERROR ,-1 , +LIBXL__LOG_ERRNOVAL (ctx,LIBXL__LOG_ERROR ,-1 ,"Invalid set, valid sets are <weight|cap|compress>" );return ERROR_INVAL ; } rc =xc_tmem_control (ctx->xch,-1 , subop, domid, set,0 ,0 ,NULL );if (rc <0 ) { -XL_LOG_ERRNOVAL (ctx,XL_LOG_ERROR , rc, +LIBXL__LOG_ERRNOVAL (ctx,LIBXL__LOG_ERROR , rc,"Can not set tmem %s" , name);return ERROR_FAIL ; }
@@ -3310,7 +3310,7 @@ int libxl_tmem_shared_auth(libxl_ctx *ct rc =xc_tmem_auth (ctx->xch, domid, uuid, auth);if (rc <0 ) { -XL_LOG_ERRNOVAL (ctx,XL_LOG_ERROR , rc, +LIBXL__LOG_ERRNOVAL (ctx,LIBXL__LOG_ERROR , rc,"Can not set tmem shared auth" );return ERROR_FAIL ; }
@@ -3324,7 +3324,7 @@ int libxl_tmem_freeable(libxl_ctx *ctx) rc =xc_tmem_control (ctx->xch,-1 ,TMEMC_QUERY_FREEABLE_MB ,-1 ,0 ,0 ,0 ,0 );if (rc <0 ) { -XL_LOG_ERRNOVAL (ctx,XL_LOG_ERROR , rc, +LIBXL__LOG_ERRNOVAL (ctx,LIBXL__LOG_ERROR , rc,"Can not get tmem freeable memory" );return ERROR_FAIL ; }
tools/libxl/libxl_blktap2.c +3 -3
@@ -18,13 +18,13 @@#include "tap-ctl.h" -int libxl_blktap_enabled (libxl_gc *gc) +int libxl__blktap_enabled (libxl_gc *gc) {const char *msg;return !tap_ctl_check (&msg); } -const char *libxl_blktap_devpath (libxl_gc *gc, +const char *libxl__blktap_devpath (libxl_gc *gc,const char *disk,libxl_disk_phystype phystype) {
@@ -32,7 +32,7 @@ const char *libxl_blktap_devpath(libxl_gchar *params, *devname =NULL ;int minor, err; - type =device_disk_string_of_phystype (phystype); + type =libxl__device_disk_string_of_phystype (phystype); minor =tap_ctl_find_minor (type, disk);if (minor >=0 ) { devname =libxl__sprintf (gc,"/dev/xen/blktap-2/tapdev%d" , minor);
tools/libxl/libxl_device.c +11 -11
@@ -96,7 +96,7 @@ retry_transaction:if (errno ==EAGAIN ) goto retry_transaction;else -XL_LOG_ERRNO (ctx,XL_LOG_ERROR ,"xs transaction failed" ); +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"xs transaction failed" ); } rc =0 ; out:
@@ -104,7 +104,7 @@ out:return rc; } -char *device_disk_string_of_phystype (libxl_disk_phystype phystype) +char *libxl__device_disk_string_of_phystype (libxl_disk_phystype phystype) {switch (phystype) {case PHYSTYPE_QCOW :return "qcow" ;
@@ -117,7 +117,7 @@ char *device_disk_string_of_phystype(lib } } -char *device_disk_backend_type_of_phystype (libxl_disk_phystype phystype) +char *libxl__device_disk_backend_type_of_phystype (libxl_disk_phystype phystype) {switch (phystype) {case PHYSTYPE_QCOW :return "tap" ;
@@ -130,7 +130,7 @@ char *device_disk_backend_type_of_physty } } -int device_physdisk_major_minor (const char *physpath,int *major,int *minor) +int libxl__device_physdisk_major_minor (const char *physpath,int *major,int *minor) {struct stat buf;if (stat (physpath, &buf) <0 )
@@ -188,7 +188,7 @@ static int device_virtdisk_matches(constreturn 1 ; } -int device_disk_dev_number (char *virtpath) +int libxl__device_disk_dev_number (char *virtpath) {int disk, partition;char *ep;
@@ -281,7 +281,7 @@ static int wait_for_dev_destroy(libxl_ctif (!state ||atoi (state) ==6 ) {xs_unwatch (ctx->xsh, l1[0 ], l1[1 ]);xs_rm (ctx->xsh,XBT_NULL , l1[XS_WATCH_TOKEN ]); -XL_LOG (ctx,XL_LOG_DEBUG ,"Destroyed device backend at %s" , l1[XS_WATCH_TOKEN ]); +LIBXL__LOG (ctx,LIBXL__LOG_DEBUG ,"Destroyed device backend at %s" , l1[XS_WATCH_TOKEN ]); rc =0 ; }free (l1);
@@ -304,7 +304,7 @@ int libxl__devices_destroy(libxl_ctx *ct path =libxl__sprintf (&gc,"/local/domain/%d/device" , domid); l1 =libxl__xs_directory (&gc,XBT_NULL , path, &num1);if (!l1) { -XL_LOG (ctx,XL_LOG_ERROR ,"%s is empty" , path); +LIBXL__LOG (ctx,LIBXL__LOG_ERROR ,"%s is empty" , path); goto out; }for (i =0 ; i < num1; i++) {
@@ -445,7 +445,7 @@ again: }xs_unwatch (xsh, path, path);xs_daemon_close (xsh); -XL_LOG (ctx,XL_LOG_ERROR ,"Device Model not ready" ); +LIBXL__LOG (ctx,LIBXL__LOG_ERROR ,"Device Model not ready" );libxl__free_all (&gc);return -1 ; }
@@ -463,10 +463,10 @@ int libxl__wait_for_backend(libxl_ctx *c p =xs_read (ctx->xsh,XBT_NULL , path, &len);if (p ==NULL ) {if (errno ==ENOENT ) { -XL_LOG (ctx,XL_LOG_ERROR ,"Backend %s does not exist" , +LIBXL__LOG (ctx,LIBXL__LOG_ERROR ,"Backend %s does not exist" , be_path); }else { -XL_LOG_ERRNO (ctx,XL_LOG_ERROR ,"Failed to access backend %s" , +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"Failed to access backend %s" , be_path); } goto out;
@@ -480,7 +480,7 @@ int libxl__wait_for_backend(libxl_ctx *c } } } -XL_LOG (ctx,XL_LOG_ERROR ,"Backend %s not ready" , be_path); +LIBXL__LOG (ctx,LIBXL__LOG_ERROR ,"Backend %s not ready" , be_path); out:libxl__free_all (&gc);return rc;
tools/libxl/libxl_dom.c +44 -43
310 lines not on this page · raw message
tools/libxl/libxl_exec.c +7 -7
@@ -65,25 +65,25 @@ void libxl_report_child_exitstatus(libxlif (WIFEXITED (status)) {int st =WEXITSTATUS (status);if (st) -XL_LOG (ctx, level,"%s [%ld] exited" +LIBXL__LOG (ctx, level,"%s [%ld] exited" " with error status %d" , what, (unsigned long )pid, st);else -XL_LOG (ctx, level,"%s [%ld] unexpectedly" +LIBXL__LOG (ctx, level,"%s [%ld] unexpectedly" " exited status zero" , what, (unsigned long )pid); }else if (WIFSIGNALED (status)) {int sig =WTERMSIG (status);const char *str =strsignal (sig);const char *coredump =WCOREDUMP (status) ?" (core dumped)" :"" ;if (str) -XL_LOG (ctx, level,"%s [%ld] died due to" +LIBXL__LOG (ctx, level,"%s [%ld] died due to" " fatal signal %s%s" , what, (unsigned long )pid, str, coredump);else -XL_LOG (ctx, level,"%s [%ld] died due to unknown" +LIBXL__LOG (ctx, level,"%s [%ld] died due to unknown" " fatal signal number %d%s" , what, (unsigned long )pid, sig, coredump); }else { -XL_LOG (ctx, level,"%s [%ld] gave unknown" +LIBXL__LOG (ctx, level,"%s [%ld] gave unknown" " wait status 0x%x" , what, (unsigned long )pid, status); } }
@@ -146,7 +146,7 @@ static void report_spawn_intermediate_st "%s intermediate process (startup monitor)", for_spawn->what) < 0 ) intermediate_what ="intermediate process (startup monitor)" ; -libxl_report_child_exitstatus (ctx,XL_LOG_ERROR , intermediate_what, +libxl_report_child_exitstatus (ctx,LIBXL__LOG_ERROR , intermediate_what, for_spawn->intermediate, status); } }
@@ -163,7 +163,7 @@ int libxl__spawn_detach(libxl_ctx *ctx,if (for_spawn->intermediate) { r =kill (for_spawn->intermediate,SIGKILL );if (r) { -XL_LOG_ERRNO (ctx,XL_LOG_ERROR , +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"could not kill %s intermediate process [%ld]" , for_spawn->what, (unsigned long )for_spawn->intermediate);
tools/libxl/libxl_internal.c +3 -3
@@ -147,7 +147,7 @@ char *libxl__dirname(libxl_gc *gc, constreturn ptr; } -void xl_logv (libxl_ctx *ctx,xentoollog_level msglevel,int errnoval, +void libxl__logv (libxl_ctx *ctx,xentoollog_level msglevel,int errnoval,const char *file,int line,const char *func,char *fmt,va_list ap) {
@@ -174,13 +174,13 @@ void xl_logv(libxl_ctx *ctx, xentoollog_ errno = esave; } -void xl_log (libxl_ctx *ctx,xentoollog_level msglevel,int errnoval, +void libxl__log (libxl_ctx *ctx,xentoollog_level msglevel,int errnoval,const char *file,int line,const char *func,char *fmt, ...) {va_list ap;va_start (ap, fmt); -xl_logv (ctx, msglevel, errnoval, file, line, func, fmt, ap); +libxl__logv (ctx, msglevel, errnoval, file, line, func, fmt, ap);va_end (ap); }
tools/libxl/libxl_internal.h +31 -32
119 lines not on this page · raw message
tools/libxl/libxl_noblktap2.c +2 -2
@@ -16,12 +16,12 @@#include "libxl_osdeps.h" #include "libxl_internal.h" -int libxl_blktap_enabled (libxl_gc *gc) +int libxl__blktap_enabled (libxl_gc *gc) {return 0 ; } -const char *libxl_blktap_devpath (libxl_gc *gc, +const char *libxl__blktap_devpath (libxl_gc *gc,const char *disk,libxl_disk_phystype phystype) {
tools/libxl/libxl_pci.c +41 -41
289 lines not on this page · raw message
tools/libxl/libxl_utils.c +13 -13
@@ -184,7 +184,7 @@ static int logrename(libxl_ctx *ctx, conif (r) {if (errno ==ENOENT )return 0 ;/* ok */ -XL_LOG_ERRNO (ctx,XL_LOG_ERROR ,"failed to rotate logfile - could not" +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"failed to rotate logfile - could not" " rename %s to %s" , old, new);return ERROR_FAIL ; }
@@ -218,7 +218,7 @@ int libxl_create_logfile(libxl_ctx *ctx, goto out; }else {if (errno !=ENOENT ) -XL_LOG_ERRNO (ctx,XL_LOG_WARNING ,"problem checking existence of" +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_WARNING ,"problem checking existence of" " logfile %s, which might have needed to be rotated" , name); }
@@ -271,23 +271,23 @@ int libxl_read_file_contents(libxl_ctx * f =fopen (filename,"r" );if (!f) {if (errno ==ENOENT )return ENOENT ; -XL_LOG_ERRNO (ctx,XL_LOG_ERROR ,"failed to open %s" , filename); +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"failed to open %s" , filename); goto xe; }if (fstat (fileno (f), &stab)) { -XL_LOG_ERRNO (ctx,XL_LOG_ERROR ,"failed to fstat %s" , filename); +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"failed to fstat %s" , filename); goto xe; }if (!S_ISREG (stab.st_mode)) { -XL_LOG_ERRNO (ctx,XL_LOG_ERROR ,"%s is not a plain file" , filename); +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"%s is not a plain file" , filename); errno =ENOTTY ; goto xe; }if (stab.st_size >INT_MAX ) { -XL_LOG (ctx,XL_LOG_ERROR ,"file %s is far too large" , filename); +LIBXL__LOG (ctx,LIBXL__LOG_ERROR ,"file %s is far too large" , filename); errno =EFBIG ; goto xe; }
@@ -301,9 +301,9 @@ int libxl_read_file_contents(libxl_ctx * rs =fread (data,1 , datalen, f);if (rs != datalen) {if (ferror (f)) -XL_LOG_ERRNO (ctx,XL_LOG_ERROR ,"failed to read %s" , filename); +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"failed to read %s" , filename);else if (feof (f)) -XL_LOG (ctx,XL_LOG_ERROR ,"%s changed size while we" +LIBXL__LOG (ctx,LIBXL__LOG_ERROR ,"%s changed size while we" " were reading it" , filename);else abort ();
@@ -313,7 +313,7 @@ int libxl_read_file_contents(libxl_ctx *if (fclose (f)) { f =0 ; -XL_LOG_ERRNO (ctx,XL_LOG_ERROR ,"failed to close %s" , filename); +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"failed to close %s" , filename); goto xe; }
@@ -342,13 +342,13 @@ int libxl_read_file_contents(libxl_ctx *if (got ==-1 ) { \if (errno ==EINTR )continue ; \if (!ctx)return errno; \ - XL_LOG_ERRNO(ctx, XL_LOG_ERROR, "failed to " #rw " %s%s%s", \ + LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "failed to " #rw " %s%s%s", \ what?what:"", what?" from ":"", filename); \ return errno; \ } \ if (got == 0) { \ if (!ctx) return EPROTO; \ - XL_LOG(ctx, XL_LOG_ERROR, \ + LIBXL__LOG(ctx, LIBXL__LOG_ERROR, \ zero_is_eof \ ? "file/stream truncated reading %s%s%s" \ : "file/stream write returned 0! writing %s%s%s", \
@@ -378,7 +378,7 @@ pid_t libxl_fork(libxl_ctx *ctx) pid =fork ();if (pid ==-1 ) { -XL_LOG_ERRNO (ctx,XL_LOG_ERROR ,"fork failed" ); +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"fork failed" );return -1 ; }
@@ -396,7 +396,7 @@ int libxl_pipe(libxl_ctx *ctx, int pipesint libxl_pipe (libxl_ctx *ctx,int pipes[2 ]) {if (pipe (pipes) <0 ) { -XL_LOG (ctx,XL_LOG_ERROR ,"Failed to create a pipe" ); +LIBXL__LOG (ctx,LIBXL__LOG_ERROR ,"Failed to create a pipe" );return -1 ; }return 0 ;
tools/libxl/libxl_xshelp.c +1 -1
@@ -125,7 +125,7 @@ char *libxl__xs_get_dompath(libxl_gc *gclibxl_ctx *ctx =libxl_gc_owner (gc);char *s =xs_get_domain_path (ctx->xsh, domid);if (!s) { -XL_LOG_ERRNO (ctx,XL_LOG_ERROR ,"failed to get dompath for %" PRIu32, +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"failed to get dompath for %" PRIu32, domid);return NULL ; }
PATCH 1/1 libxl: move hvm_build_set_params to libxl_dom.c
In reply to Ian Campbell# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1283853891 -3600
# Node ID 60cfaa1f0101d52a04f0b4d869bd6e0d5f1c74d5 # Parent f5372f2ac680ab1bd686499f4a9bdbc288629db1
libxl: move hvm_build_set_params to libxl_dom.c
It is an internal function with only one caller.
tools/libxl/Makefile +1 -1
@@ -27,7 +27,7 @@ LIBXL_OBJS-y += libxl_noblktap2.o LIBXL_OBJS-y += libxl_noblktap2.o endif -LIBXL_OBJS = flexarray.o libxl.o libxl_pci.o libxl_dom.o libxl_exec.o libxl_xshelp.o libxl_device.o libxl_internal.o xenguest.o libxl_utils.o $(LIBXL_OBJS-y) +LIBXL_OBJS = flexarray.o libxl.o libxl_pci.o libxl_dom.o libxl_exec.o libxl_xshelp.o libxl_device.o libxl_internal.o libxl_utils.o $(LIBXL_OBJS-y) LIBXL_OBJS += _libxl_types.o AUTOINCS= libxlu_cfg_y.h libxlu_cfg_l.h
tools/libxl/libxl_dom.c +42 -0
60 lines not on this page · raw message
tools/libxl/libxl_internal.h +0 -6
@@ -181,12 +181,6 @@ _hidden int libxl__wait_for_device_model void *check_callback_userdata); _hidden int libxl__wait_for_backend(libxl_ctx *ctx, char *be_path, char *state); -/* from xenguest (helper */ -_hidden int hvm_build_set_params(xc_interface *handle, uint32_t domid, -libxl_domain_build_info *info, -int store_evtchn,unsigned long *store_mfn, -int console_evtchn,unsigned long *console_mfn); -/* xl_exec */ /* higher-level double-fork and separate detach eg as for device models */
tools/libxl/xenguest.c deleted +0 -62
62 lines not on this page · raw message
PATCH 1/1 libxl: Use libxl__ namespace for internal types
In reply to Ian Campbell# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1283853918 -3600
# Node ID 67cfd3fbfcce5a08177af497f18d547b0667fa1f # Parent 60cfaa1f0101d52a04f0b4d869bd6e0d5f1c74d5
libxl: Use libxl__ namespace for internal types
It's not clear that the namespace rules described in libxl.h are intended to apply to internal types but I don't see why not.
sed -i -e 's/\<libxl_device\>/libxl__device/g' tools/libxl/*.[ch] sed -i -e 's/\<libxl_device_kinds\>/libxl__device_kinds/g' tools/libxl/*.[ch] sed -i -e 's/\<libxl_gc\>/libxl__gc/g' tools/libxl/*.[ch]
sed -i -e 's/\<libxl_gc_owner\>/libxl__gc_owner/g' tools/libxl/*.[ch] sed -i -e 's/\<libxl_spawn_starting\>/libxl__spawn_starting/g' tools/libxl/*.[ch]
tools/libxl/libxl.c +51 -51
@@ -107,7 +107,7 @@ int libxl_domain_make(libxl_ctx *ctx, liint libxl_domain_make (libxl_ctx *ctx,libxl_domain_create_info *info,uint32_t *domid) { -libxl_gc gc =LIBXL_INIT_GC (ctx); +libxl__gc gc =LIBXL_INIT_GC (ctx);int flags, ret, i, rc;char *uuid_string;char *rw_paths[] = {"device" ,"device/suspend/event-channel" ,"data" };
@@ -217,7 +217,7 @@ int libxl_domain_rename(libxl_ctx *ctx, const char *old_name, const char *new_name, xs_transaction_t trans) { - libxl_gc gc = LIBXL_INIT_GC(ctx); + libxl__gc gc = LIBXL_INIT_GC(ctx);char *dom_path =0 ;const char *name_path;char *got_old_name;
@@ -295,7 +295,7 @@ int libxl_domain_rename(libxl_ctx *ctx,int libxl_domain_build (libxl_ctx *ctx,libxl_domain_build_info *info,uint32_t domid,libxl_domain_build_state *state) { -libxl_gc gc =LIBXL_INIT_GC (ctx); +libxl__gc gc =LIBXL_INIT_GC (ctx);char **vments =NULL , **localents =NULL ;struct timeval start_time;int i, ret;
@@ -354,7 +354,7 @@ int libxl_domain_restore(libxl_ctx *ctx, uint32_t domid, int fd, libxl_domain_build_state *state, libxl_device_model_info *dm_info) { - libxl_gc gc = LIBXL_INIT_GC(ctx); + libxl__gc gc = LIBXL_INIT_GC(ctx);char **vments =NULL , **localents =NULL ;struct timeval start_time;int i, ret, esave, flags;
@@ -430,7 +430,7 @@ out:int libxl_domain_resume (libxl_ctx *ctx,uint32_t domid) { -libxl_gc gc =LIBXL_INIT_GC (ctx); +libxl__gc gc =LIBXL_INIT_GC (ctx);int rc =0 ;if (libxl__domain_is_hvm (ctx, domid)) {
@@ -466,7 +466,7 @@ int libxl_domain_preserve(libxl_ctx *ctxint libxl_domain_preserve (libxl_ctx *ctx,uint32_t domid,libxl_domain_create_info *info,const char *name_suffix,libxl_uuid new_uuid) { -libxl_gc gc =LIBXL_INIT_GC (ctx); +libxl__gc gc =LIBXL_INIT_GC (ctx);struct xs_permissions roperm[2 ];xs_transaction_t t;char *preserved_name;
@@ -686,7 +686,7 @@ int libxl_domain_core_dump(libxl_ctx *ctint libxl_domain_unpause (libxl_ctx *ctx,uint32_t domid) { -libxl_gc gc =LIBXL_INIT_GC (ctx); +libxl__gc gc =LIBXL_INIT_GC (ctx);char *path;char *state;int ret, rc =0 ;
@@ -718,7 +718,7 @@ static char *req_table[] = {int libxl_domain_shutdown (libxl_ctx *ctx,uint32_t domid,int req) { -libxl_gc gc =LIBXL_INIT_GC (ctx); +libxl__gc gc =LIBXL_INIT_GC (ctx);char *shutdown_path;char *dom_path;
@@ -780,7 +780,7 @@ int libxl_wait_for_domain_death(libxl_ctint libxl_wait_for_disk_ejects (libxl_ctx *ctx,uint32_t guest_domid,libxl_device_disk *disks,int num_disks,libxl_waiter *waiter) { -libxl_gc gc =LIBXL_INIT_GC (ctx); +libxl__gc gc =LIBXL_INIT_GC (ctx);int i, rc =-1 ;uint32_t domid =libxl_get_stubdom_id (ctx, guest_domid);
@@ -852,7 +852,7 @@ int libxl_event_get_domain_death_info(liint libxl_event_get_disk_eject_info (libxl_ctx *ctx,uint32_t domid,libxl_event *event,libxl_device_disk *disk) { -libxl_gc gc =LIBXL_INIT_GC (ctx); +libxl__gc gc =LIBXL_INIT_GC (ctx);char *path;char *backend;char *value;
@@ -885,7 +885,7 @@ int libxl_event_get_disk_eject_info(libxstatic int libxl_destroy_device_model (libxl_ctx *ctx,uint32_t domid) { -libxl_gc gc =LIBXL_INIT_GC (ctx); +libxl__gc gc =LIBXL_INIT_GC (ctx);char *pid;int ret;
@@ -921,7 +921,7 @@ out:int libxl_domain_destroy (libxl_ctx *ctx,uint32_t domid,int force) { -libxl_gc gc =LIBXL_INIT_GC (ctx); +libxl__gc gc =LIBXL_INIT_GC (ctx);char *dom_path;char *vm_path;int rc, dm_present;
@@ -982,7 +982,7 @@ out:int libxl_console_exec (libxl_ctx *ctx,uint32_t domid,int cons_num,libxl_console_constype type) { -libxl_gc gc =LIBXL_INIT_GC (ctx); +libxl__gc gc =LIBXL_INIT_GC (ctx);char *p =libxl__sprintf (&gc,"%s/xenconsole" ,libxl_private_bindir_path ());char *domid_s =libxl__sprintf (&gc,"%d" , domid);char *cons_num_s =libxl__sprintf (&gc,"%d" , cons_num);
@@ -1021,7 +1021,7 @@ int libxl_primary_console_exec(libxl_ctxint libxl_vncviewer_exec (libxl_ctx *ctx,uint32_t domid,int autopass) { -libxl_gc gc =LIBXL_INIT_GC (ctx); +libxl__gc gc =LIBXL_INIT_GC (ctx);const char *vnc_port, *vfb_back;const char *vnc_listen =NULL , *vnc_pass =NULL ;int port =0 , autopass_fd =-1 ;
@@ -1084,7 +1084,7 @@ skip_autopass:return 0 ; } -static char **libxl_build_device_model_args_old (libxl_gc *gc, +static char **libxl_build_device_model_args_old (libxl__gc *gc,libxl_device_model_info *info,libxl_device_nic *vifs,int num_vifs)
@@ -1222,7 +1222,7 @@ static char ** libxl_build_device_model_return (char **)flexarray_contents (dm_args); } -static char **libxl_build_device_model_args_new (libxl_gc *gc, +static char **libxl_build_device_model_args_new (libxl__gc *gc,libxl_device_model_info *info,libxl_device_nic *vifs,int num_vifs)
@@ -1350,7 +1350,7 @@ static char ** libxl_build_device_model_else flexarray_set (dm_args, num++,"xenfv" ); - disks =libxl_device_disk_list (libxl_gc_owner (gc), info->domid, &nb); + disks =libxl_device_disk_list (libxl__gc_owner (gc), info->domid, &nb);for (i; i < nb; i++) {if ( disks[i].is_cdrom ) {flexarray_set (dm_args, num++,"-cdrom" );
@@ -1366,12 +1366,12 @@ static char ** libxl_build_device_model_return (char **)flexarray_contents (dm_args); } -static char **libxl_build_device_model_args (libxl_gc *gc, +static char **libxl_build_device_model_args (libxl__gc *gc,libxl_device_model_info *info,libxl_device_nic *vifs,int num_vifs) { -libxl_ctx *ctx =libxl_gc_owner (gc); +libxl_ctx *ctx =libxl__gc_owner (gc);int new_qemu; new_qemu =libxl_check_device_model_version (ctx, info->device_model);
@@ -1430,7 +1430,7 @@ static int libxl_vfb_and_vkb_from_devicestatic int libxl_write_dmargs (libxl_ctx *ctx,int domid,int guest_domid,char **args) { -libxl_gc gc =LIBXL_INIT_GC (ctx); +libxl__gc gc =LIBXL_INIT_GC (ctx);int i;char *vm_path;char *dmargs, *path;
@@ -1485,7 +1485,7 @@ static int libxl_create_stubdom(libxl_ct libxl_device_vkb *vkb, libxl_device_model_starting **starting_r) { -libxl_gc gc =LIBXL_INIT_GC (ctx); +libxl__gc gc =LIBXL_INIT_GC (ctx);int i, num_console =1 , ret;libxl_device_console *console;libxl_domain_create_info c_info;
@@ -1635,7 +1635,7 @@ int libxl_create_device_model(libxl_ctx libxl_device_nic *vifs, int num_vifs, libxl_device_model_starting **starting_r) { - libxl_gc gc = LIBXL_INIT_GC(ctx); + libxl__gc gc = LIBXL_INIT_GC(ctx);char *path, *logfile;int logfile_w, null;int rc;
@@ -1675,7 +1675,7 @@ int libxl_create_device_model(libxl_ctxif (!*starting_r) goto out_close; p = *starting_r; - p->for_spawn =calloc (sizeof (libxl_spawn_starting),1 ); + p->for_spawn =calloc (sizeof (libxl__spawn_starting),1 ); }else { p = &buf_starting; p->for_spawn =NULL ;
@@ -1753,14 +1753,14 @@ int libxl_confirm_device_model_startup(lint libxl_device_disk_add (libxl_ctx *ctx,uint32_t domid,libxl_device_disk *disk) { -libxl_gc gc =LIBXL_INIT_GC (ctx); +libxl__gc gc =LIBXL_INIT_GC (ctx);flexarray_t *front;flexarray_t *back;char *backend_type;unsigned int boffset =0 ;unsigned int foffset =0 ;int devid; -libxl_device device; +libxl__device device;int major, minor, rc; front =flexarray_make (16 ,1 );
@@ -1889,7 +1889,7 @@ int libxl_device_disk_del(libxl_ctx *ctxint libxl_device_disk_del (libxl_ctx *ctx,libxl_device_disk *disk,int wait) { -libxl_device device; +libxl__device device;int devid; devid =libxl__device_disk_dev_number (disk->virtpath);
@@ -1905,7 +1905,7 @@ int libxl_device_disk_del(libxl_ctx *ctxchar *libxl_device_disk_local_attach (libxl_ctx *ctx,libxl_device_disk *disk) { -libxl_gc gc =LIBXL_INIT_GC (ctx); +libxl__gc gc =LIBXL_INIT_GC (ctx);const char *dev =NULL ;char *ret;int phystype = disk->phystype;
@@ -1950,12 +1950,12 @@ int libxl_device_disk_local_detach(libxl/******************************************************************************/ int libxl_device_nic_add (libxl_ctx *ctx,uint32_t domid,libxl_device_nic *nic) { -libxl_gc gc =LIBXL_INIT_GC (ctx); +libxl__gc gc =LIBXL_INIT_GC (ctx);flexarray_t *front;flexarray_t *back;unsigned int boffset =0 ;unsigned int foffset =0 ; -libxl_device device; +libxl__device device;char *dompath, **l;unsigned int nb, rc;
@@ -2039,7 +2039,7 @@ int libxl_device_nic_del(libxl_ctx *ctx,int libxl_device_nic_del (libxl_ctx *ctx,libxl_device_nic *nic,int wait) { -libxl_device device; +libxl__device device; device.backend_devid = nic->devid; device.backend_domid = nic->backend_domid;
@@ -2053,7 +2053,7 @@ int libxl_device_nic_del(libxl_ctx *ctx,libxl_nicinfo *libxl_list_nics (libxl_ctx *ctx,uint32_t domid,unsigned int *nb) { -libxl_gc gc =LIBXL_INIT_GC (ctx); +libxl__gc gc =LIBXL_INIT_GC (ctx);char *dompath, *nic_path_fe;char **l, **list;char *val, *tok;
@@ -2110,10 +2110,10 @@ err:/******************************************************************************/ int libxl_device_net2_add (libxl_ctx *ctx,uint32_t domid,libxl_device_net2 *net2) { -libxl_gc gc =LIBXL_INIT_GC (ctx); +libxl__gc gc =LIBXL_INIT_GC (ctx);flexarray_t *front, *back;unsigned int boffset =0 , foffset =0 ; -libxl_device device; +libxl__device device;char *dompath, *dom, **l;unsigned int nb;int rc;
@@ -2223,7 +2223,7 @@ err:libxl_net2info *libxl_device_net2_list (libxl_ctx *ctx,uint32_t domid,unsigned int *nb) { -libxl_gc gc =LIBXL_INIT_GC (ctx); +libxl__gc gc =LIBXL_INIT_GC (ctx);char *dompath, *net2_path_fe;char **l;char *val, *tok;
@@ -2284,7 +2284,7 @@ err:int libxl_device_net2_del (libxl_ctx *ctx,libxl_device_net2 *net2,int wait) { -libxl_device device; +libxl__device device; device.backend_devid = net2->devid; device.backend_domid = net2->backend_domid;
@@ -2300,12 +2300,12 @@ int libxl_device_net2_del(libxl_ctx *ctx/******************************************************************************/ int libxl_device_console_add (libxl_ctx *ctx,uint32_t domid,libxl_device_console *console) { -libxl_gc gc =LIBXL_INIT_GC (ctx); +libxl__gc gc =LIBXL_INIT_GC (ctx);flexarray_t *front;flexarray_t *back;unsigned int boffset =0 ;unsigned int foffset =0 ; -libxl_device device; +libxl__device device;int rc;if (console->build_state) {
@@ -2396,12 +2396,12 @@ out:/******************************************************************************/ int libxl_device_vkb_add (libxl_ctx *ctx,uint32_t domid,libxl_device_vkb *vkb) { -libxl_gc gc =LIBXL_INIT_GC (ctx); +libxl__gc gc =LIBXL_INIT_GC (ctx);flexarray_t *front;flexarray_t *back;unsigned int boffset =0 ;unsigned int foffset =0 ; -libxl_device device; +libxl__device device;int rc; front =flexarray_make (16 ,1 );
@@ -2460,7 +2460,7 @@ int libxl_device_vkb_hard_shutdown(libxllibxl_device_disk *libxl_device_disk_list (libxl_ctx *ctx,uint32_t domid,int *num) { -libxl_gc gc =LIBXL_INIT_GC (ctx); +libxl__gc gc =LIBXL_INIT_GC (ctx);char *be_path_tap, *be_path_vbd;libxl_device_disk *dend, *disks, *ret =NULL ;char **b, **l =NULL ;
@@ -2518,7 +2518,7 @@ int libxl_device_disk_getinfo(libxl_ctxint libxl_device_disk_getinfo (libxl_ctx *ctx,uint32_t domid,libxl_device_disk *disk,libxl_diskinfo *diskinfo) { -libxl_gc gc =LIBXL_INIT_GC (ctx); +libxl__gc gc =LIBXL_INIT_GC (ctx);char *dompath, *diskpath;char *val;
@@ -2592,12 +2592,12 @@ out: }/******************************************************************************/ -static int libxl_build_xenpv_qemu_args (libxl_gc *gc, +static int libxl_build_xenpv_qemu_args (libxl__gc *gc,uint32_t domid,libxl_device_vfb *vfb,libxl_device_model_info *info) { -libxl_ctx *ctx =libxl_gc_owner (gc); +libxl_ctx *ctx =libxl__gc_owner (gc);memset (info,0x00 ,sizeof (libxl_device_model_info));if (vfb !=NULL ) {
@@ -2624,7 +2624,7 @@ int libxl_create_xenpv_qemu(libxl_ctx *cint libxl_create_xenpv_qemu (libxl_ctx *ctx,uint32_t domid,libxl_device_vfb *vfb,libxl_device_model_starting **starting_r) { -libxl_gc gc =LIBXL_INIT_GC (ctx); +libxl__gc gc =LIBXL_INIT_GC (ctx);libxl_device_model_info info;libxl_build_xenpv_qemu_args (&gc, domid, vfb, &info);
@@ -2635,12 +2635,12 @@ int libxl_create_xenpv_qemu(libxl_ctx *cint libxl_device_vfb_add (libxl_ctx *ctx,uint32_t domid,libxl_device_vfb *vfb) { -libxl_gc gc =LIBXL_INIT_GC (ctx); +libxl__gc gc =LIBXL_INIT_GC (ctx);flexarray_t *front;flexarray_t *back;unsigned int boffset =0 ;unsigned int foffset =0 ; -libxl_device device; +libxl__device device;int rc; front =flexarray_make (16 ,1 );
@@ -2723,7 +2723,7 @@ int libxl_device_vfb_hard_shutdown(libxlint libxl_domain_setmaxmem (libxl_ctx *ctx,uint32_t domid,uint32_t max_memkb) { -libxl_gc gc =LIBXL_INIT_GC (ctx); +libxl__gc gc =LIBXL_INIT_GC (ctx);char *mem, *endptr;uint32_t memorykb;char *dompath =libxl__xs_get_dompath (&gc, domid);
@@ -2756,7 +2756,7 @@ out:int libxl_set_memory_target (libxl_ctx *ctx,uint32_t domid,uint32_t target_memkb,int enforce) { -libxl_gc gc =LIBXL_INIT_GC (ctx); +libxl__gc gc =LIBXL_INIT_GC (ctx);int rc =1 ;uint32_t memorykb =0 , videoram =0 ;char *memmax, *endptr, *videoram_s =NULL ;
@@ -2959,7 +2959,7 @@ int libxl_set_vcpuaffinity(libxl_ctx *ctint libxl_set_vcpuonline (libxl_ctx *ctx,uint32_t domid,uint32_t bitmask) { -libxl_gc gc =LIBXL_INIT_GC (ctx); +libxl__gc gc =LIBXL_INIT_GC (ctx);libxl_dominfo info;char *dompath;xs_transaction_t t;
@@ -3098,7 +3098,7 @@ int libxl_send_trigger(libxl_ctx *ctx, uint libxl_send_sysrq (libxl_ctx *ctx,uint32_t domid,char sysrq) { -libxl_gc gc =LIBXL_INIT_GC (ctx); +libxl__gc gc =LIBXL_INIT_GC (ctx);char *dompath =libxl__xs_get_dompath (&gc, domid);libxl__xs_write (&gc,XBT_NULL ,libxl__sprintf (&gc,"%s/control/sysrq" , dompath),"%c" , sysrq);
@@ -3190,7 +3190,7 @@ void libxl_xen_console_read_finish(libxluint32_t libxl_vm_get_start_time (libxl_ctx *ctx,uint32_t domid) { -libxl_gc gc =LIBXL_INIT_GC (ctx); +libxl__gc gc =LIBXL_INIT_GC (ctx);char *dompath =libxl__xs_get_dompath (&gc, domid);char *vm_path, *start_time;uint32_t ret;
tools/libxl/libxl.h +2 -2
@@ -107,7 +107,7 @@* should be allocated from the temporary pool. * * Where a function's primary purpose is to return such an object, -* it should have a libxl_gc * as it's first argument. +* it should have a libxl__gc * as it's first argument. * * Note that there are two ways to change an allocation from this * category to the "public" category. Either the implementation
@@ -118,7 +118,7 @@* The latter method is preferred for obvious performance reasons. * * No temporary objects allocated from the pool may be explicitly freed. -* Therefore public functions which initialize a libxl_gc MUST call +* Therefore public functions which initialize a libxl__gc MUST call * libxl__free_all() before returning. */ #ifndef LIBXL_H
tools/libxl/libxl_blktap2.c +2 -2
@@ -18,13 +18,13 @@#include "tap-ctl.h" -int libxl__blktap_enabled (libxl_gc *gc) +int libxl__blktap_enabled (libxl__gc *gc) {const char *msg;return !tap_ctl_check (&msg); } -const char *libxl__blktap_devpath (libxl_gc *gc, +const char *libxl__blktap_devpath (libxl__gc *gc,const char *disk,libxl_disk_phystype phystype) {
tools/libxl/libxl_bootloader.c +3 -3
@@ -30,7 +30,7 @@#define XENCONSOLED_BUF_SIZE 16#define BOOTLOADER_BUF_SIZE 1024 -static char **make_bootloader_args (libxl_gc *gc, +static char **make_bootloader_args (libxl__gc *gc,libxl_domain_build_info *info,uint32_t domid,const char *fifo,char *disk)
@@ -161,7 +161,7 @@ static pid_t fork_exec_bootloader(int *m* if there is actual data to write, otherwise this would loop too fast, * eating up CPU time. */ -static char *bootloader_interact (libxl_gc *gc,int xenconsoled_fd,int bootloader_fd,int fifo_fd) +static char *bootloader_interact (libxl__gc *gc,int xenconsoled_fd,int bootloader_fd,int fifo_fd) {int ret;
@@ -300,7 +300,7 @@ int libxl_run_bootloader(libxl_ctx *ctx, libxl_device_disk *disk, uint32_t domid) { -libxl_gc gc =LIBXL_INIT_GC (ctx); +libxl__gc gc =LIBXL_INIT_GC (ctx);int ret, rc =0 ;char *fifo =NULL ;char *diskpath =NULL ;
tools/libxl/libxl_device.c +9 -9
@@ -39,10 +39,10 @@ static const char *string_of_kinds[] = { [DEVICE_CONSOLE] = "console", }; -int libxl__device_generic_add (libxl_ctx *ctx,libxl_device *device, +int libxl__device_generic_add (libxl_ctx *ctx,libxl__device *device,char **bents,char **fents) { -libxl_gc gc =LIBXL_INIT_GC (ctx); +libxl__gc gc =LIBXL_INIT_GC (ctx);char *dom_path_backend, *dom_path, *frontend_path, *backend_path;xs_transaction_t t;struct xs_permissions frontend_perms[2 ];
@@ -228,7 +228,7 @@ int libxl__device_disk_dev_number(char *int libxl__device_destroy (libxl_ctx *ctx,char *be_path,int force) { -libxl_gc gc =LIBXL_INIT_GC (ctx); +libxl__gc gc =LIBXL_INIT_GC (ctx);xs_transaction_t t;char *state_path =libxl__sprintf (&gc,"%s/state" , be_path);char *state =libxl__xs_read (&gc,XBT_NULL , state_path);
@@ -264,7 +264,7 @@ out:static int wait_for_dev_destroy (libxl_ctx *ctx,struct timeval *tv) { -libxl_gc gc =LIBXL_INIT_GC (ctx); +libxl__gc gc =LIBXL_INIT_GC (ctx);int nfds, rc;unsigned int n;fd_set rfds;
@@ -293,7 +293,7 @@ static int wait_for_dev_destroy(libxl_ctint libxl__devices_destroy (libxl_ctx *ctx,uint32_t domid,int force) { -libxl_gc gc =LIBXL_INIT_GC (ctx); +libxl__gc gc =LIBXL_INIT_GC (ctx);char *path, *be_path, *fe_path;unsigned int num1, num2;char **l1 =NULL , **l2 =NULL ;
@@ -353,9 +353,9 @@ out:return 0 ; } -int libxl__device_del (libxl_ctx *ctx,libxl_device *dev,int wait) +int libxl__device_del (libxl_ctx *ctx,libxl__device *dev,int wait) { -libxl_gc gc =LIBXL_INIT_GC (ctx); +libxl__gc gc =LIBXL_INIT_GC (ctx);char *dom_path_backend, *backend_path;int rc;
@@ -393,7 +393,7 @@ int libxl__wait_for_device_model(libxl_c void *userdata), void *check_callback_userdata) { - libxl_gc gc = LIBXL_INIT_GC(ctx); + libxl__gc gc = LIBXL_INIT_GC(ctx);char *path;char *p;unsigned int len;
@@ -452,7 +452,7 @@ again:int libxl__wait_for_backend (libxl_ctx *ctx,char *be_path,char *state) { -libxl_gc gc =LIBXL_INIT_GC (ctx); +libxl__gc gc =LIBXL_INIT_GC (ctx);int watchdog =100 ;unsigned int len;char *p;
tools/libxl/libxl_dom.c +13 -13
@@ -90,7 +90,7 @@ int libxl__build_post(libxl_ctx *ctx, ui libxl_domain_build_info *info, libxl_domain_build_state *state, char **vms_ents, char **local_ents) { -libxl_gc gc =LIBXL_INIT_GC (ctx); +libxl__gc gc =LIBXL_INIT_GC (ctx);char *dom_path, *vm_path;xs_transaction_t t;char **ents;
@@ -261,7 +261,7 @@ int libxl__build_hvm(libxl_ctx *ctx, uinint libxl__build_hvm (libxl_ctx *ctx,uint32_t domid,libxl_domain_build_info *info,libxl_domain_build_state *state) { -libxl_gc gc =LIBXL_INIT_GC (ctx); +libxl__gc gc =LIBXL_INIT_GC (ctx);int ret, rc =ERROR_INVAL ;if (info->kernel.mapped) {
@@ -311,7 +311,7 @@ int libxl__domain_restore_common(libxl_c }struct suspendinfo { -libxl_gc *gc; +libxl__gc *gc;int xce;/* event channel handle */ int suspend_eventchn;int domid;
@@ -343,7 +343,7 @@ static int libxl__domain_suspend_common_int ret;char *path, *state ="suspend" ;int watchdog =60 ; -libxl_ctx *ctx =libxl_gc_owner (si->gc); +libxl_ctx *ctx =libxl__gc_owner (si->gc);if (si->hvm)xc_get_hvm_param (ctx->xch, si->domid,HVM_PARAM_ACPI_S_STATE , &s_state);
@@ -397,7 +397,7 @@ int libxl__domain_suspend_common(libxl_cint libxl__domain_suspend_common (libxl_ctx *ctx,uint32_t domid,int fd,int hvm,int live,int debug) { -libxl_gc gc =LIBXL_INIT_GC (ctx); +libxl__gc gc =LIBXL_INIT_GC (ctx);int flags;int port;struct save_callbacks callbacks;
@@ -449,7 +449,7 @@ out:int libxl__domain_save_device_model (libxl_ctx *ctx,uint32_t domid,int fd) { -libxl_gc gc =LIBXL_INIT_GC (ctx); +libxl__gc gc =LIBXL_INIT_GC (ctx);int fd2, c;char buf[1024 ];char *filename =libxl__sprintf (&gc,"/var/lib/xen/qemu-save.%d" , domid);
@@ -483,19 +483,19 @@ int libxl__domain_save_device_model(libxreturn 0 ; } -char *libxl__uuid2string (libxl_gc *gc,const libxl_uuid uuid) +char *libxl__uuid2string (libxl__gc *gc,const libxl_uuid uuid) {char *s =libxl__sprintf (gc,LIBXL_UUID_FMT ,LIBXL_UUID_BYTES (uuid));if (!s) -LIBXL__LOG (libxl_gc_owner (gc),LIBXL__LOG_ERROR ,"cannot allocate for uuid" ); +LIBXL__LOG (libxl__gc_owner (gc),LIBXL__LOG_ERROR ,"cannot allocate for uuid" );return s; } -static const char *userdata_path (libxl_gc *gc,uint32_t domid, +static const char *userdata_path (libxl__gc *gc,uint32_t domid,const char *userdata_userid,const char *wh) { -libxl_ctx *ctx =libxl_gc_owner (gc); +libxl_ctx *ctx =libxl__gc_owner (gc);char *path, *uuid_string;libxl_dominfo info;int rc;
@@ -529,7 +529,7 @@ static int userdata_delete(libxl_ctx *ctvoid libxl__userdata_destroyall (libxl_ctx *ctx,uint32_t domid) { -libxl_gc gc =LIBXL_INIT_GC (ctx); +libxl__gc gc =LIBXL_INIT_GC (ctx);const char *pattern;glob_t gl;int r, i;
@@ -559,7 +559,7 @@ int libxl_userdata_store(libxl_ctx *ctx,const char *userdata_userid, const uint8_t *data, int datalen) { - libxl_gc gc = LIBXL_INIT_GC(ctx); + libxl__gc gc = LIBXL_INIT_GC(ctx);const char *filename;const char *newfilename;int e, rc;
@@ -628,7 +628,7 @@ int libxl_userdata_retrieve(libxl_ctx *cconst char *userdata_userid, uint8_t **data_r, int *datalen_r) { - libxl_gc gc = LIBXL_INIT_GC(ctx); + libxl__gc gc = LIBXL_INIT_GC(ctx);const char *filename;int e, rc;int datalen =0 ;
tools/libxl/libxl_exec.c +4 -4
@@ -97,7 +97,7 @@ int libxl__spawn_spawn(libxl_ctx *ctx,pid_t child, got;int status;pid_t intermediate; -libxl_spawn_starting *for_spawn = starting->for_spawn; +libxl__spawn_starting *for_spawn = starting->for_spawn;if (for_spawn) { for_spawn->what =strdup (what);
@@ -136,7 +136,7 @@ int libxl__spawn_spawn(libxl_ctx *ctx, }static void report_spawn_intermediate_status (libxl_ctx *ctx, -libxl_spawn_starting *for_spawn, +libxl__spawn_starting *for_spawn,int status) {if (!WIFEXITED (status)) {
@@ -152,7 +152,7 @@ static void report_spawn_intermediate_st }int libxl__spawn_detach (libxl_ctx *ctx, -libxl_spawn_starting *for_spawn) +libxl__spawn_starting *for_spawn) {int r, status;pid_t got;
@@ -186,7 +186,7 @@ int libxl__spawn_detach(libxl_ctx *ctx,int libxl__spawn_check (libxl_ctx *ctx,void *for_spawn_void) { -libxl_spawn_starting *for_spawn = for_spawn_void; +libxl__spawn_starting *for_spawn = for_spawn_void;pid_t got;int status;
tools/libxl/libxl_internal.c +10 -10
@@ -34,7 +34,7 @@ int libxl__error_set(libxl_ctx *ctx, intreturn 0 ; } -int libxl__ptr_add (libxl_gc *gc,void *ptr) +int libxl__ptr_add (libxl__gc *gc,void *ptr) {int i;void **re;
@@ -65,7 +65,7 @@ int libxl__ptr_add(libxl_gc *gc, void *preturn 0 ; } -void libxl__free_all (libxl_gc *gc) +void libxl__free_all (libxl__gc *gc) {void *ptr;int i;
@@ -78,11 +78,11 @@ void libxl__free_all(libxl_gc *gc)free (gc->alloc_ptrs); } -void *libxl__zalloc (libxl_gc *gc,int bytes) +void *libxl__zalloc (libxl__gc *gc,int bytes) {void *ptr =calloc (bytes,1 );if (!ptr) { -libxl__error_set (libxl_gc_owner (gc),ENOMEM ); +libxl__error_set (libxl__gc_owner (gc),ENOMEM );return NULL ; }
@@ -90,11 +90,11 @@ void *libxl__zalloc(libxl_gc *gc, int byreturn ptr; } -void *libxl__calloc (libxl_gc *gc,size_t nmemb,size_t size) +void *libxl__calloc (libxl__gc *gc,size_t nmemb,size_t size) {void *ptr =calloc (nmemb, size);if (!ptr) { -libxl__error_set (libxl_gc_owner (gc),ENOMEM ); +libxl__error_set (libxl__gc_owner (gc),ENOMEM );return NULL ; }
@@ -102,7 +102,7 @@ void *libxl__calloc(libxl_gc *gc, size_treturn ptr; } -char *libxl__sprintf (libxl_gc *gc,const char *fmt, ...) +char *libxl__sprintf (libxl__gc *gc,const char *fmt, ...) {char *s;va_list ap;
@@ -125,7 +125,7 @@ char *libxl__sprintf(libxl_gc *gc, constreturn s; } -char *libxl__strdup (libxl_gc *gc,const char *c) +char *libxl__strdup (libxl__gc *gc,const char *c) {char *s =strdup (c);
@@ -135,7 +135,7 @@ char *libxl__strdup(libxl_gc *gc, constreturn s; } -char *libxl__dirname (libxl_gc *gc,const char *s) +char *libxl__dirname (libxl__gc *gc,const char *s) {char *c;char *ptr =libxl__strdup (gc, s);
@@ -184,7 +184,7 @@ void libxl__log(libxl_ctx *ctx, xentoollva_end (ap); } -char *libxl__abs_path (libxl_gc *gc,char *s,const char *path) +char *libxl__abs_path (libxl__gc *gc,char *s,const char *path) {if (!s || s[0 ] =='/' )return s;
tools/libxl/libxl_internal.h +33 -33
148 lines not on this page · raw message
tools/libxl/libxl_noblktap2.c +2 -2
@@ -16,12 +16,12 @@#include "libxl_osdeps.h" #include "libxl_internal.h" -int libxl__blktap_enabled (libxl_gc *gc) +int libxl__blktap_enabled (libxl__gc *gc) {return 0 ; } -const char *libxl__blktap_devpath (libxl_gc *gc, +const char *libxl__blktap_devpath (libxl__gc *gc,const char *disk,libxl_disk_phystype phystype) {
tools/libxl/libxl_pci.c +20 -20
@@ -196,14 +196,14 @@ parse_error:return ERROR_INVAL ; } -static int libxl_create_pci_backend (libxl_gc *gc,uint32_t domid,libxl_device_pci *pcidev,int num) +static int libxl_create_pci_backend (libxl__gc *gc,uint32_t domid,libxl_device_pci *pcidev,int num) { -libxl_ctx *ctx =libxl_gc_owner (gc); +libxl_ctx *ctx =libxl__gc_owner (gc);flexarray_t *front;flexarray_t *back;unsigned int boffset =0 ;unsigned int foffset =0 ; -libxl_device device; +libxl__device device;int i; front =flexarray_make (16 ,1 );
@@ -262,9 +262,9 @@ static int libxl_create_pci_backend(libxreturn 0 ; } -static int libxl_device_pci_add_xenstore (libxl_gc *gc,uint32_t domid,libxl_device_pci *pcidev) +static int libxl_device_pci_add_xenstore (libxl__gc *gc,uint32_t domid,libxl_device_pci *pcidev) { -libxl_ctx *ctx =libxl_gc_owner (gc); +libxl_ctx *ctx =libxl__gc_owner (gc);flexarray_t *back;char *num_devs, *be_path;int num =0 ;
@@ -316,9 +316,9 @@ retry_transaction:return 0 ; } -static int libxl_device_pci_remove_xenstore (libxl_gc *gc,uint32_t domid,libxl_device_pci *pcidev) +static int libxl_device_pci_remove_xenstore (libxl__gc *gc,uint32_t domid,libxl_device_pci *pcidev) { -libxl_ctx *ctx =libxl_gc_owner (gc); +libxl_ctx *ctx =libxl__gc_owner (gc);char *be_path, *num_devs_path, *num_devs, *xsdev, *tmp, *tmppath;int num, i, j;xs_transaction_t t;
@@ -422,7 +422,7 @@ retry_transaction2:return 0 ; } -static int get_all_assigned_devices (libxl_gc *gc,libxl_device_pci **list,int *num) +static int get_all_assigned_devices (libxl__gc *gc,libxl_device_pci **list,int *num) {libxl_device_pci *pcidevs =NULL ;char **domlist;
@@ -490,7 +490,7 @@ static int is_assigned(libxl_device_pciint libxl_device_pci_list_assignable (libxl_ctx *ctx,libxl_device_pci **list,int *num) { -libxl_gc gc =LIBXL_INIT_GC (ctx); +libxl__gc gc =LIBXL_INIT_GC (ctx);libxl_device_pci *pcidevs =NULL , *new, *assigned;struct dirent *de;DIR *dir;
@@ -545,9 +545,9 @@ int libxl_device_pci_list_assignable(lib* driver. It also initialises a bit-mask of which function numbers are present * on that device. */ -static int pci_multifunction_check (libxl_gc *gc,libxl_device_pci *pcidev,unsigned int *func_mask) +static int pci_multifunction_check (libxl__gc *gc,libxl_device_pci *pcidev,unsigned int *func_mask) { -libxl_ctx *ctx =libxl_gc_owner (gc); +libxl_ctx *ctx =libxl__gc_owner (gc);struct dirent *de;DIR *dir;
@@ -604,9 +604,9 @@ static int pci_ins_check(libxl_ctx *ctx,return 1 ; } -static int do_pci_add (libxl_gc *gc,uint32_t domid,libxl_device_pci *pcidev) +static int do_pci_add (libxl__gc *gc,uint32_t domid,libxl_device_pci *pcidev) { -libxl_ctx *ctx =libxl_gc_owner (gc); +libxl_ctx *ctx =libxl__gc_owner (gc);char *path;char *state, *vdevfn;int rc, hvm;
@@ -710,10 +710,10 @@ out:return 0 ; } -static int libxl_device_pci_reset (libxl_gc *gc,unsigned int domain,unsigned int bus, +static int libxl_device_pci_reset (libxl__gc *gc,unsigned int domain,unsigned int bus,unsigned int dev,unsigned int func) { -libxl_ctx *ctx =libxl_gc_owner (gc); +libxl_ctx *ctx =libxl__gc_owner (gc);char *reset;int fd, rc;
@@ -748,7 +748,7 @@ static int libxl_device_pci_reset(libxl_int libxl_device_pci_add (libxl_ctx *ctx,uint32_t domid,libxl_device_pci *pcidev) { -libxl_gc gc =LIBXL_INIT_GC (ctx); +libxl__gc gc =LIBXL_INIT_GC (ctx);unsigned int orig_vdev, pfunc_mask;libxl_device_pci *assigned;int num_assigned, i, rc;
@@ -816,9 +816,9 @@ out:return rc; } -static int do_pci_remove (libxl_gc *gc,uint32_t domid,libxl_device_pci *pcidev) +static int do_pci_remove (libxl__gc *gc,uint32_t domid,libxl_device_pci *pcidev) { -libxl_ctx *ctx =libxl_gc_owner (gc); +libxl_ctx *ctx =libxl__gc_owner (gc);libxl_device_pci *assigned;char *path;char *state;
@@ -931,7 +931,7 @@ out:int libxl_device_pci_remove (libxl_ctx *ctx,uint32_t domid,libxl_device_pci *pcidev) { -libxl_gc gc =LIBXL_INIT_GC (ctx); +libxl__gc gc =LIBXL_INIT_GC (ctx);unsigned int orig_vdev, pfunc_mask;int i, rc;
@@ -967,7 +967,7 @@ out:int libxl_device_pci_list_assigned (libxl_ctx *ctx,libxl_device_pci **list,uint32_t domid,int *num) { -libxl_gc gc =LIBXL_INIT_GC (ctx); +libxl__gc gc =LIBXL_INIT_GC (ctx);char *be_path, *num_devs, *xsdev, *xsvdevfn, *xsopts;int n, i;unsigned int domain =0 , bus =0 , dev =0 , func =0 , vdevfn =0 ;
tools/libxl/libxl_utils.c +11 -11
@@ -54,9 +54,9 @@ char *libxl_domid_to_name(libxl_ctx *ctxreturn s; } -char *libxl__domid_to_name (libxl_gc *gc,uint32_t domid) +char *libxl__domid_to_name (libxl__gc *gc,uint32_t domid) { -char *s =libxl_domid_to_name (libxl_gc_owner (gc), domid); +char *s =libxl_domid_to_name (libxl__gc_owner (gc), domid);if ( s )libxl__ptr_add (gc, s);return s;
@@ -103,9 +103,9 @@ char *libxl_poolid_to_name(libxl_ctx *ctreturn s; } -char *libxl__poolid_to_name (libxl_gc *gc,uint32_t poolid) +char *libxl__poolid_to_name (libxl__gc *gc,uint32_t poolid) { -char *s =libxl_poolid_to_name (libxl_gc_owner (gc), poolid); +char *s =libxl_poolid_to_name (libxl__gc_owner (gc), poolid);if ( s )libxl__ptr_add (gc, s);return s;
@@ -141,7 +141,7 @@ int libxl_name_to_poolid(libxl_ctx *ctx,int libxl_get_stubdom_id (libxl_ctx *ctx,int guest_domid) { -libxl_gc gc =LIBXL_INIT_GC (ctx); +libxl__gc gc =LIBXL_INIT_GC (ctx);char * stubdom_id_s;int ret;
@@ -158,7 +158,7 @@ int libxl_get_stubdom_id(libxl_ctx *ctx,int libxl_is_stubdom (libxl_ctx *ctx,uint32_t domid,uint32_t *target_domid) { -libxl_gc gc =LIBXL_INIT_GC (ctx); +libxl__gc gc =LIBXL_INIT_GC (ctx);char *target, *endptr;uint32_t value;int ret =0 ;
@@ -193,7 +193,7 @@ static int logrename(libxl_ctx *ctx, conint libxl_create_logfile (libxl_ctx *ctx,char *name,char **full_name) { -libxl_gc gc =LIBXL_INIT_GC (ctx); +libxl__gc gc =LIBXL_INIT_GC (ctx);struct stat stat_buf;char *logfile, *logfile_new;int i, rc;
@@ -448,7 +448,7 @@ int libxl_devid_to_device_nic(libxl_ctxint libxl_devid_to_device_nic (libxl_ctx *ctx,uint32_t domid,const char *devid,libxl_device_nic *nic) { -libxl_gc gc =LIBXL_INIT_GC (ctx); +libxl__gc gc =LIBXL_INIT_GC (ctx);char *tok, *val;char *dompath, *nic_path_fe, *nic_path_be;unsigned int i;
@@ -484,7 +484,7 @@ int libxl_devid_to_device_disk(libxl_ctxint libxl_devid_to_device_disk (libxl_ctx *ctx,uint32_t domid,const char *devid,libxl_device_disk *disk) { -libxl_gc gc =LIBXL_INIT_GC (ctx); +libxl__gc gc =LIBXL_INIT_GC (ctx);char *endptr, *val;char *dompath, *diskpath, *be_path;unsigned int devid_n;
@@ -527,7 +527,7 @@ int libxl_devid_to_device_net2(libxl_ctxint libxl_devid_to_device_net2 (libxl_ctx *ctx,uint32_t domid,const char *devid,libxl_device_net2 *net2) { -libxl_gc gc =LIBXL_INIT_GC (ctx); +libxl__gc gc =LIBXL_INIT_GC (ctx);char *tok, *endptr, *val;char *dompath, *net2path, *be_path;unsigned int devid_n, i;
@@ -598,7 +598,7 @@ int libxl_strtomac(const char *mac_s, uiint libxl_check_device_model_version (libxl_ctx *ctx,char *path) { -libxl_gc gc =LIBXL_INIT_GC (ctx); +libxl__gc gc =LIBXL_INIT_GC (ctx);pid_t pid =-1 ;int pipefd[2 ];char buf[100 ];
tools/libxl/libxl_xshelp.c +11 -11
@@ -44,7 +44,7 @@ int xs_writev(struct xs_handle *xsh, xs_return 0 ; } -char **libxl__xs_kvs_of_flexarray (libxl_gc *gc,flexarray_t *array,int length) +char **libxl__xs_kvs_of_flexarray (libxl__gc *gc,flexarray_t *array,int length) {char **kvs;int i;
@@ -68,10 +68,10 @@ char **libxl__xs_kvs_of_flexarray(libxl_return kvs; } -int libxl__xs_writev (libxl_gc *gc,xs_transaction_t t, +int libxl__xs_writev (libxl__gc *gc,xs_transaction_t t,char *dir,char *kvs[]) { -libxl_ctx *ctx =libxl_gc_owner (gc); +libxl_ctx *ctx =libxl__gc_owner (gc);char *path;int i;
@@ -88,10 +88,10 @@ int libxl__xs_writev(libxl_gc *gc, xs_trreturn 0 ; } -int libxl__xs_write (libxl_gc *gc,xs_transaction_t t, +int libxl__xs_write (libxl__gc *gc,xs_transaction_t t,char *path,char *fmt, ...) { -libxl_ctx *ctx =libxl_gc_owner (gc); +libxl_ctx *ctx =libxl__gc_owner (gc);char *s;va_list ap;int ret;
@@ -107,9 +107,9 @@ int libxl__xs_write(libxl_gc *gc, xs_trareturn 0 ; } -char *libxl__xs_read (libxl_gc *gc,xs_transaction_t t,char *path) +char *libxl__xs_read (libxl__gc *gc,xs_transaction_t t,char *path) { -libxl_ctx *ctx =libxl_gc_owner (gc); +libxl_ctx *ctx =libxl__gc_owner (gc);char *ptr; ptr =xs_read (ctx->xsh, t, path,NULL );
@@ -120,9 +120,9 @@ char * libxl__xs_read(libxl_gc *gc, xs_treturn 0 ; } -char *libxl__xs_get_dompath (libxl_gc *gc,uint32_t domid) +char *libxl__xs_get_dompath (libxl__gc *gc,uint32_t domid) { -libxl_ctx *ctx =libxl_gc_owner (gc); +libxl_ctx *ctx =libxl__gc_owner (gc);char *s =xs_get_domain_path (ctx->xsh, domid);if (!s) { LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "failed to get dompath for %" PRIu32,
@@ -133,9 +133,9 @@ char *libxl__xs_get_dompath(libxl_gc *gcreturn s; } -char **libxl__xs_directory (libxl_gc *gc,xs_transaction_t t,char *path,unsigned int *nb) +char **libxl__xs_directory (libxl__gc *gc,xs_transaction_t t,char *path,unsigned int *nb) { -libxl_ctx *ctx =libxl_gc_owner (gc); +libxl_ctx *ctx =libxl__gc_owner (gc);char **ret =NULL ; ret =xs_directory (ctx->xsh,XBT_NULL , path, nb);libxl__ptr_add (gc, ret);
Ian Campbell writes ("[Xen-devel] [PATCH 0 of 4] libxl: use libxl__ namespace for hidden functions"):
Quoted 1 line
I'm not sure this churn is worth it [...]
Better now than never I think, and definitely better now than later.
Ian.
Quoted 4 lines · Ian Jackson
Ian Campbell writes ("[Xen-devel] [PATCH 0 of 4] libxl: use
libxl__namespace for hidden functions"):Quoted 1 line
I'm not sure this churn is worth it [...]
Better now than never I think, and definitely better now than later.
I have a feeling it will need regenerating due to some of the other patches I saw go in today. I'll do that in the morning if necessary.
Ian.