[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] libxl: make most libxl_FOO_path() functions internal.
# HG changeset patch # User Ian Campbell <ian.campbell@xxxxxxxxxx> # Date 1334218378 -3600 # Node ID 7d53703aa3ffa88cf57d212dd80e90f42647c74e # Parent caee592e55cbaaf4157bd1ead097e571b1dfcef8 libxl: make most libxl_FOO_path() functions internal. Only libxl_xen_config_dir_path and libxl_lock_dir_path are used outside the library. Also bindir, sbindir, sharedir and xenpagingdir appeared to be completely unused so nuke them. Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx> Committed-by: Ian Jackson <ian.jackson.citrix.com> Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx> --- diff -r caee592e55cb -r 7d53703aa3ff tools/libxl/libxl.c --- a/tools/libxl/libxl.c Tue Apr 24 18:42:24 2012 +0100 +++ b/tools/libxl/libxl.c Thu Apr 12 09:12:58 2012 +0100 @@ -1126,7 +1126,7 @@ out: int libxl_console_exec(libxl_ctx *ctx, uint32_t domid, int cons_num, libxl_console_type type) { GC_INIT(ctx); - char *p = libxl__sprintf(gc, "%s/xenconsole", libxl_private_bindir_path()); + 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; @@ -1767,7 +1767,7 @@ int libxl__device_nic_setdefault(libxl__ if (!nic->bridge) return ERROR_NOMEM; } if ( !nic->script && asprintf(&nic->script, "%s/vif-bridge", - libxl_xen_script_dir_path()) < 0 ) + libxl__xen_script_dir_path()) < 0 ) return ERROR_FAIL; if (!nic->nictype) nic->nictype = LIBXL_NIC_TYPE_IOEMU; @@ -1837,7 +1837,7 @@ int libxl_device_nic_add(libxl_ctx *ctx, flexarray_append(back, "script"); flexarray_append(back, nic->script[0]=='/' ? nic->script : libxl__sprintf(gc, "%s/%s", - libxl_xen_script_dir_path(), + libxl__xen_script_dir_path(), nic->script)); } diff -r caee592e55cb -r 7d53703aa3ff tools/libxl/libxl.h --- a/tools/libxl/libxl.h Tue Apr 24 18:42:24 2012 +0100 +++ b/tools/libxl/libxl.h Thu Apr 12 09:12:58 2012 +0100 @@ -785,18 +785,8 @@ int libxl_flask_setenforce(libxl_ctx *ct int libxl_flask_loadpolicy(libxl_ctx *ctx, void *policy, uint32_t size); /* common paths */ -const char *libxl_sbindir_path(void); -const char *libxl_bindir_path(void); -const char *libxl_libexec_path(void); -const char *libxl_libdir_path(void); -const char *libxl_sharedir_path(void); -const char *libxl_private_bindir_path(void); -const char *libxl_xenfirmwaredir_path(void); const char *libxl_xen_config_dir_path(void); -const char *libxl_xen_script_dir_path(void); const char *libxl_lock_dir_path(void); -const char *libxl_run_dir_path(void); -const char *libxl_xenpaging_dir_path(void); /* misc */ diff -r caee592e55cb -r 7d53703aa3ff tools/libxl/libxl_dm.c --- a/tools/libxl/libxl_dm.c Tue Apr 24 18:42:24 2012 +0100 +++ b/tools/libxl/libxl_dm.c Thu Apr 12 09:12:58 2012 +0100 @@ -24,7 +24,7 @@ static const char *libxl_tapif_script(li #ifdef __linux__ return libxl__strdup(gc, "no"); #else - return libxl__sprintf(gc, "%s/qemu-ifup", libxl_xen_script_dir_path()); + return libxl__sprintf(gc, "%s/qemu-ifup", libxl__xen_script_dir_path()); #endif } @@ -47,10 +47,10 @@ const char *libxl__domain_device_model(l } else { switch (info->device_model_version) { case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL: - dm = libxl__abs_path(gc, "qemu-dm", libxl_libexec_path()); + dm = libxl__abs_path(gc, "qemu-dm", libxl__libexec_path()); break; case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN: - dm = libxl__abs_path(gc, "qemu-system-i386", libxl_libexec_path()); + dm = libxl__abs_path(gc, "qemu-system-i386", libxl__libexec_path()); break; default: LIBXL__LOG(ctx, LIBXL__LOG_ERROR, @@ -337,7 +337,7 @@ static char ** libxl__build_device_model flexarray_append(dm_args, libxl__sprintf(gc, "socket,id=libxl-cmd," "path=%s/qmp-libxl-%d,server,nowait", - libxl_run_dir_path(), guest_domid)); + libxl__run_dir_path(), guest_domid)); flexarray_append(dm_args, "-mon"); flexarray_append(dm_args, "chardev=libxl-cmd,mode=control"); @@ -708,7 +708,7 @@ static int libxl__create_stubdom(libxl__ dm_config.b_info.target_memkb = dm_config.b_info.max_memkb; dm_config.b_info.u.pv.kernel.path = libxl__abs_path(gc, "ioemu-stubdom.gz", - libxl_xenfirmwaredir_path()); + libxl__xenfirmwaredir_path()); dm_config.b_info.u.pv.cmdline = libxl__sprintf(gc, " -d %d", guest_domid); dm_config.b_info.u.pv.ramdisk.path = ""; dm_config.b_info.u.pv.features = ""; diff -r caee592e55cb -r 7d53703aa3ff tools/libxl/libxl_dom.c --- a/tools/libxl/libxl_dom.c Tue Apr 24 18:42:24 2012 +0100 +++ b/tools/libxl/libxl_dom.c Thu Apr 12 09:12:58 2012 +0100 @@ -362,7 +362,7 @@ static const char *libxl__domain_firmwar break; } } - return libxl__abs_path(gc, firmware, libxl_xenfirmwaredir_path()); + return libxl__abs_path(gc, firmware, libxl__xenfirmwaredir_path()); } int libxl__build_hvm(libxl__gc *gc, uint32_t domid, diff -r caee592e55cb -r 7d53703aa3ff tools/libxl/libxl_internal.h --- a/tools/libxl/libxl_internal.h Tue Apr 24 18:42:24 2012 +0100 +++ b/tools/libxl/libxl_internal.h Thu Apr 12 09:12:58 2012 +0100 @@ -1375,6 +1375,14 @@ _hidden int libxl__carefd_close(libxl__c /* You may pass NULL in which case the answer is -1. */ _hidden int libxl__carefd_fd(const libxl__carefd*); +/* common paths */ +_hidden const char *libxl__libexec_path(void); +_hidden const char *libxl__private_bindir_path(void); +_hidden const char *libxl__xenfirmwaredir_path(void); +_hidden const char *libxl__xen_config_dir_path(void); +_hidden const char *libxl__xen_script_dir_path(void); +_hidden const char *libxl__lock_dir_path(void); +_hidden const char *libxl__run_dir_path(void); /* * Convenience macros. diff -r caee592e55cb -r 7d53703aa3ff tools/libxl/libxl_paths.c --- a/tools/libxl/libxl_paths.c Tue Apr 24 18:42:24 2012 +0100 +++ b/tools/libxl/libxl_paths.c Thu Apr 12 09:12:58 2012 +0100 @@ -15,37 +15,17 @@ #include "libxl_osdeps.h" /* must come before any other headers */ #include "libxl_internal.h" -const char *libxl_sbindir_path(void) -{ - return SBINDIR; -} - -const char *libxl_bindir_path(void) -{ - return BINDIR; -} - -const char *libxl_libexec_path(void) +const char *libxl__libexec_path(void) { return LIBEXEC; } -const char *libxl_libdir_path(void) -{ - return LIBDIR; -} - -const char *libxl_sharedir_path(void) -{ - return SHAREDIR; -} - -const char *libxl_private_bindir_path(void) +const char *libxl__private_bindir_path(void) { return PRIVATE_BINDIR; } -const char *libxl_xenfirmwaredir_path(void) +const char *libxl__xenfirmwaredir_path(void) { return XENFIRMWAREDIR; } @@ -55,7 +35,7 @@ const char *libxl_xen_config_dir_path(vo return XEN_CONFIG_DIR; } -const char *libxl_xen_script_dir_path(void) +const char *libxl__xen_script_dir_path(void) { return XEN_SCRIPT_DIR; } @@ -65,16 +45,11 @@ const char *libxl_lock_dir_path(void) return XEN_LOCK_DIR; } -const char *libxl_run_dir_path(void) +const char *libxl__run_dir_path(void) { return XEN_RUN_DIR; } -const char *libxl_xenpaging_dir_path(void) -{ - return XEN_PAGING_DIR; -} - /* * Local variables: * mode: C diff -r caee592e55cb -r 7d53703aa3ff tools/libxl/libxl_qmp.c --- a/tools/libxl/libxl_qmp.c Tue Apr 24 18:42:24 2012 +0100 +++ b/tools/libxl/libxl_qmp.c Thu Apr 12 09:12:58 2012 +0100 @@ -682,7 +682,7 @@ libxl__qmp_handler *libxl__qmp_initializ qmp = qmp_init_handler(gc, domid); qmp_socket = libxl__sprintf(gc, "%s/qmp-libxl-%d", - libxl_run_dir_path(), domid); + libxl__run_dir_path(), domid); if ((ret = qmp_open(qmp, qmp_socket, QMP_SOCKET_CONNECT_TIMEOUT)) < 0) { LIBXL__LOG_ERRNO(qmp->ctx, LIBXL__LOG_ERROR, "Connection error"); qmp_free_handler(qmp); @@ -720,7 +720,7 @@ void libxl__qmp_cleanup(libxl__gc *gc, u char *qmp_socket; qmp_socket = libxl__sprintf(gc, "%s/qmp-libxl-%d", - libxl_run_dir_path(), domid); + libxl__run_dir_path(), domid); if (unlink(qmp_socket) == -1) { if (errno != ENOENT) { LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |