# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1283960928 -3600
# Node ID 4ed9f92186205917e422935902847049481a89d3
# Parent bd331cd1e7040d3f6ce86ae30488da1d771a9108
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]
Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
tools/libxl/libxl.c | 102 ++++++++++++++++++++---------------------
tools/libxl/libxl.h | 4 -
tools/libxl/libxl_blktap2.c | 4 -
tools/libxl/libxl_bootloader.c | 6 +-
tools/libxl/libxl_device.c | 20 ++++----
tools/libxl/libxl_dom.c | 26 +++++-----
tools/libxl/libxl_exec.c | 8 +--
tools/libxl/libxl_internal.c | 20 ++++----
tools/libxl/libxl_internal.h | 70 ++++++++++++++--------------
tools/libxl/libxl_noblktap2.c | 4 -
tools/libxl/libxl_pci.c | 52 ++++++++++----------
tools/libxl/libxl_utils.c | 26 +++++-----
tools/libxl/libxl_xshelp.c | 22 ++++----
13 files changed, 182 insertions(+), 182 deletions(-)
diff -r bd331cd1e704 -r 4ed9f9218620 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c Wed Sep 08 16:47:32 2010 +0100
+++ b/tools/libxl/libxl.c Wed Sep 08 16:48:48 2010 +0100
@@ -107,7 +107,7 @@ int libxl_domain_make(libxl_ctx *ctx, li
int 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 *ctx
int 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 *ct
int 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_ct
int 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(li
int 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(libx
static 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_ctx
int 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_device
static 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_ctx
if (!*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(l
int 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 *ctx
int 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 *ctx
char * 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(libxl
libxl_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_ctx
int 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 *c
int 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 *c
int 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(libxl
int 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 *ct
int 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, u
int 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(libxl
uint32_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;
diff -r bd331cd1e704 -r 4ed9f9218620 tools/libxl/libxl.h
--- a/tools/libxl/libxl.h Wed Sep 08 16:47:32 2010 +0100
+++ b/tools/libxl/libxl.h Wed Sep 08 16:48:48 2010 +0100
@@ -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
diff -r bd331cd1e704 -r 4ed9f9218620 tools/libxl/libxl_blktap2.c
--- a/tools/libxl/libxl_blktap2.c Wed Sep 08 16:47:32 2010 +0100
+++ b/tools/libxl/libxl_blktap2.c Wed Sep 08 16:48:48 2010 +0100
@@ -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)
{
diff -r bd331cd1e704 -r 4ed9f9218620 tools/libxl/libxl_bootloader.c
--- a/tools/libxl/libxl_bootloader.c Wed Sep 08 16:47:32 2010 +0100
+++ b/tools/libxl/libxl_bootloader.c Wed Sep 08 16:48:48 2010 +0100
@@ -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;
diff -r bd331cd1e704 -r 4ed9f9218620 tools/libxl/libxl_device.c
--- a/tools/libxl/libxl_device.c Wed Sep 08 16:47:32 2010 +0100
+++ b/tools/libxl/libxl_device.c Wed Sep 08 16:48:48 2010 +0100
@@ -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_ct
int 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)
-{
- libxl_gc gc = LIBXL_INIT_GC(ctx);
+int libxl__device_del(libxl_ctx *ctx, libxl__device *dev, int wait)
+{
+ 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;
diff -r bd331cd1e704 -r 4ed9f9218620 tools/libxl/libxl_dom.c
--- a/tools/libxl/libxl_dom.c Wed Sep 08 16:47:32 2010 +0100
+++ b/tools/libxl/libxl_dom.c Wed Sep 08 16:48:48 2010 +0100
@@ -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, uin
int 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_c
int 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(libx
return 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 *ct
void 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 *c
const 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;
diff -r bd331cd1e704 -r 4ed9f9218620 tools/libxl/libxl_exec.c
--- a/tools/libxl/libxl_exec.c Wed Sep 08 16:47:32 2010 +0100
+++ b/tools/libxl/libxl_exec.c Wed Sep 08 16:48:48 2010 +0100
@@ -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;
diff -r bd331cd1e704 -r 4ed9f9218620 tools/libxl/libxl_internal.c
--- a/tools/libxl/libxl_internal.c Wed Sep 08 16:47:32 2010 +0100
+++ b/tools/libxl/libxl_internal.c Wed Sep 08 16:48:48 2010 +0100
@@ -34,7 +34,7 @@ int libxl__error_set(libxl_ctx *ctx, int
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 *p
return 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 by
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;
}
@@ -102,7 +102,7 @@ void *libxl__calloc(libxl_gc *gc, size_t
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;
@@ -125,7 +125,7 @@ char *libxl__sprintf(libxl_gc *gc, const
return 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, const
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);
@@ -184,7 +184,7 @@ void libxl__log(libxl_ctx *ctx, xentooll
va_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;
diff -r bd331cd1e704 -r 4ed9f9218620 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h Wed Sep 08 16:47:32 2010 +0100
+++ b/tools/libxl/libxl_internal.h Wed Sep 08 16:48:48 2010 +0100
@@ -83,7 +83,7 @@ typedef enum {
DEVICE_VFB,
DEVICE_VKBD,
DEVICE_CONSOLE,
-} libxl_device_kinds;
+} libxl__device_kinds;
#define is_valid_device_kind(kind) (((kind) >= DEVICE_VIF) && ((kind) <=
DEVICE_CONSOLE))
@@ -92,9 +92,9 @@ typedef struct {
uint32_t backend_domid;
uint32_t devid;
uint32_t domid;
- libxl_device_kinds backend_kind;
- libxl_device_kinds kind;
-} libxl_device;
+ libxl__device_kinds backend_kind;
+ libxl__device_kinds kind;
+} libxl__device;
#define XC_PCI_BDF "0x%x, 0x%x, 0x%x, 0x%x"
#define AUTO_PHP_SLOT 0x100
@@ -113,31 +113,31 @@ typedef struct {
int alloc_maxsize;
void **alloc_ptrs;
libxl_ctx *owner;
-} libxl_gc;
-
-#define LIBXL_INIT_GC(ctx) (libxl_gc){ .alloc_maxsize = 0, .alloc_ptrs = 0,
.owner = ctx }
-static inline libxl_ctx *libxl_gc_owner(libxl_gc *gc)
+} libxl__gc;
+
+#define LIBXL_INIT_GC(ctx) (libxl__gc){ .alloc_maxsize = 0, .alloc_ptrs = 0,
.owner = ctx }
+static inline libxl_ctx *libxl__gc_owner(libxl__gc *gc)
{
return gc->owner;
}
/* memory allocation tracking/helpers */
-_hidden int libxl__ptr_add(libxl_gc *gc, void *ptr);
-_hidden void libxl__free_all(libxl_gc *gc);
-_hidden void *libxl__zalloc(libxl_gc *gc, int bytes);
-_hidden void *libxl__calloc(libxl_gc *gc, size_t nmemb, size_t size);
-_hidden char *libxl__sprintf(libxl_gc *gc, const char *fmt, ...)
PRINTF_ATTRIBUTE(2, 3);
-_hidden char *libxl__strdup(libxl_gc *gc, const char *c);
-_hidden char *libxl__dirname(libxl_gc *gc, const char *s);
-
-_hidden char **libxl__xs_kvs_of_flexarray(libxl_gc *gc, flexarray_t *array,
int length);
-_hidden int libxl__xs_writev(libxl_gc *gc, xs_transaction_t t,
+_hidden int libxl__ptr_add(libxl__gc *gc, void *ptr);
+_hidden void libxl__free_all(libxl__gc *gc);
+_hidden void *libxl__zalloc(libxl__gc *gc, int bytes);
+_hidden void *libxl__calloc(libxl__gc *gc, size_t nmemb, size_t size);
+_hidden char *libxl__sprintf(libxl__gc *gc, const char *fmt, ...)
PRINTF_ATTRIBUTE(2, 3);
+_hidden char *libxl__strdup(libxl__gc *gc, const char *c);
+_hidden char *libxl__dirname(libxl__gc *gc, const char *s);
+
+_hidden char **libxl__xs_kvs_of_flexarray(libxl__gc *gc, flexarray_t *array,
int length);
+_hidden int libxl__xs_writev(libxl__gc *gc, xs_transaction_t t,
char *dir, char **kvs);
-_hidden int libxl__xs_write(libxl_gc *gc, xs_transaction_t t,
+_hidden int libxl__xs_write(libxl__gc *gc, xs_transaction_t t,
char *path, char *fmt, ...) PRINTF_ATTRIBUTE(4, 5);
-_hidden char *libxl__xs_get_dompath(libxl_gc *gc, uint32_t domid); // logs errs
-_hidden char *libxl__xs_read(libxl_gc *gc, xs_transaction_t t, char *path);
-_hidden char **libxl__xs_directory(libxl_gc *gc, xs_transaction_t t, char
*path, unsigned int *nb);
+_hidden char *libxl__xs_get_dompath(libxl__gc *gc, uint32_t domid); // logs
errs
+_hidden char *libxl__xs_read(libxl__gc *gc, xs_transaction_t t, char *path);
+_hidden char **libxl__xs_directory(libxl__gc *gc, xs_transaction_t t, char
*path, unsigned int *nb);
/* from xl_dom */
_hidden int libxl__domain_is_hvm(libxl_ctx *ctx, uint32_t domid);
@@ -167,9 +167,9 @@ _hidden int libxl__device_physdisk_major
_hidden int libxl__device_physdisk_major_minor(const char *physpath, int
*major, int *minor);
_hidden int libxl__device_disk_dev_number(char *virtpath);
-_hidden int libxl__device_generic_add(libxl_ctx *ctx, libxl_device *device,
+_hidden int libxl__device_generic_add(libxl_ctx *ctx, libxl__device *device,
char **bents, char **fents);
-_hidden int libxl__device_del(libxl_ctx *ctx, libxl_device *dev, int wait);
+_hidden int libxl__device_del(libxl_ctx *ctx, libxl__device *dev, int wait);
_hidden int libxl__device_destroy(libxl_ctx *ctx, char *be_path, int force);
_hidden int libxl__devices_destroy(libxl_ctx *ctx, uint32_t domid, int force);
_hidden int libxl__wait_for_device_model(libxl_ctx *ctx,
@@ -190,10 +190,10 @@ typedef struct {
/* all fields are private to libxl_spawn_... */
pid_t intermediate;
char *what; /* malloc'd in spawn_spawn */
-} libxl_spawn_starting;
+} libxl__spawn_starting;
struct libxl__device_model_starting {
- libxl_spawn_starting *for_spawn; /* first! */
+ libxl__spawn_starting *for_spawn; /* first! */
char *dom_path; /* from libxl_malloc, only for dm_xenstore_record_pid */
int domid;
};
@@ -209,31 +209,31 @@ _hidden int libxl__spawn_spawn(libxl_ctx
* Caller, may pass 0 for for_spawn, in which case no need to detach.
*/
_hidden int libxl__spawn_detach(libxl_ctx *ctx,
- libxl_spawn_starting *for_spawn);
+ libxl__spawn_starting *for_spawn);
/* Logs errors. Idempotent, but only permitted after successful
* call to libxl__spawn_spawn, and no point calling it again if it fails. */
_hidden int libxl__spawn_check(libxl_ctx *ctx,
void *for_spawn);
/* Logs errors but also returns them.
- * for_spawn must actually be a libxl_spawn_starting* but
+ * for_spawn must actually be a libxl__spawn_starting* but
* we take void* so you can pass this function directly to
* libxl__wait_for_device_model. Caller must still call detach. */
/* low-level stuff, for synchronous subprocesses etc. */
_hidden void libxl__exec(int stdinfd, int stdoutfd, int stderrfd, char *arg0,
char **args); // logs errors, never returns
-_hidden void libxl__log_child_exitstatus(libxl_gc *gc,
+_hidden void libxl__log_child_exitstatus(libxl__gc *gc,
const char *what, pid_t pid, int status);
-_hidden char *libxl__abs_path(libxl_gc *gc, char *s, const char *path);
+_hidden char *libxl__abs_path(libxl__gc *gc, char *s, const char *path);
#define LIBXL__LOG_DEBUG XTL_DEBUG
#define LIBXL__LOG_INFO XTL_INFO
#define LIBXL__LOG_WARNING XTL_WARN
#define LIBXL__LOG_ERROR XTL_ERROR
-_hidden char *libxl__domid_to_name(libxl_gc *gc, uint32_t domid);
-_hidden char *libxl__poolid_to_name(libxl_gc *gc, uint32_t poolid);
+_hidden char *libxl__domid_to_name(libxl__gc *gc, uint32_t domid);
+_hidden char *libxl__poolid_to_name(libxl__gc *gc, uint32_t poolid);
/*
* blktap2 support
@@ -242,7 +242,7 @@ _hidden char *libxl__poolid_to_name(libx
/* libxl__blktap_enabled:
* return true if blktap/blktap2 support is available.
*/
-_hidden int libxl__blktap_enabled(libxl_gc *gc);
+_hidden int libxl__blktap_enabled(libxl__gc *gc);
/* libxl__blktap_devpath:
* Argument: path and disk image as specified in config file.
@@ -250,11 +250,11 @@ _hidden int libxl__blktap_enabled(libxl_
* returns device path xenstore wants to have. returns NULL
* if no device corresponds to the disk.
*/
-_hidden const char *libxl__blktap_devpath(libxl_gc *gc,
+_hidden const char *libxl__blktap_devpath(libxl__gc *gc,
const char *disk,
libxl_disk_phystype phystype);
-_hidden char *libxl__uuid2string(libxl_gc *gc, const libxl_uuid uuid);
+_hidden char *libxl__uuid2string(libxl__gc *gc, const libxl_uuid uuid);
struct libxl__xen_console_reader {
char *buffer;
diff -r bd331cd1e704 -r 4ed9f9218620 tools/libxl/libxl_noblktap2.c
--- a/tools/libxl/libxl_noblktap2.c Wed Sep 08 16:47:32 2010 +0100
+++ b/tools/libxl/libxl_noblktap2.c Wed Sep 08 16:48:48 2010 +0100
@@ -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)
{
diff -r bd331cd1e704 -r 4ed9f9218620 tools/libxl/libxl_pci.c
--- a/tools/libxl/libxl_pci.c Wed Sep 08 16:47:32 2010 +0100
+++ b/tools/libxl/libxl_pci.c Wed Sep 08 16:48:48 2010 +0100
@@ -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)
-{
- libxl_ctx *ctx = libxl_gc_owner(gc);
+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);
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(libx
return 0;
}
-static int libxl_device_pci_add_xenstore(libxl_gc *gc, uint32_t domid,
libxl_device_pci *pcidev)
-{
- libxl_ctx *ctx = libxl_gc_owner(gc);
+static int libxl_device_pci_add_xenstore(libxl__gc *gc, uint32_t domid,
libxl_device_pci *pcidev)
+{
+ 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)
-{
- libxl_ctx *ctx = libxl_gc_owner(gc);
+static int libxl_device_pci_remove_xenstore(libxl__gc *gc, uint32_t domid,
libxl_device_pci *pcidev)
+{
+ 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_pci
int 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)
-{
- libxl_ctx *ctx = libxl_gc_owner(gc);
+static int pci_multifunction_check(libxl__gc *gc, libxl_device_pci *pcidev,
unsigned int *func_mask)
+{
+ 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)
-{
- libxl_ctx *ctx = libxl_gc_owner(gc);
+static int do_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcidev)
+{
+ 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)
-{
- libxl_ctx *ctx = libxl_gc_owner(gc);
+static int do_pci_remove(libxl__gc *gc, uint32_t domid, libxl_device_pci
*pcidev)
+{
+ 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;
diff -r bd331cd1e704 -r 4ed9f9218620 tools/libxl/libxl_utils.c
--- a/tools/libxl/libxl_utils.c Wed Sep 08 16:47:32 2010 +0100
+++ b/tools/libxl/libxl_utils.c Wed Sep 08 16:48:48 2010 +0100
@@ -54,9 +54,9 @@ char *libxl_domid_to_name(libxl_ctx *ctx
return s;
}
-char *libxl__domid_to_name(libxl_gc *gc, uint32_t domid)
-{
- char *s = libxl_domid_to_name(libxl_gc_owner(gc), domid);
+char *libxl__domid_to_name(libxl__gc *gc, uint32_t 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 *ct
return s;
}
-char *libxl__poolid_to_name(libxl_gc *gc, uint32_t poolid)
-{
- char *s = libxl_poolid_to_name(libxl_gc_owner(gc), poolid);
+char *libxl__poolid_to_name(libxl__gc *gc, uint32_t 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, con
int 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_ctx
int 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_ctx
int 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_ctx
int 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, ui
int 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];
diff -r bd331cd1e704 -r 4ed9f9218620 tools/libxl/libxl_xshelp.c
--- a/tools/libxl/libxl_xshelp.c Wed Sep 08 16:47:32 2010 +0100
+++ b/tools/libxl/libxl_xshelp.c Wed Sep 08 16:48:48 2010 +0100
@@ -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_tr
return 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_tra
return 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_t
return 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 *gc
return 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);
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|