[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH 11 of 27 V4] libxl: disk: use _init/_setdefault
# HG changeset patch # User Ian Campbell <ian.campbell@xxxxxxxxxx> # Date 1330533036 0 # Node ID 56f3abb2a946c1487bc48771fd50eb0e4da224c0 # Parent 95e87306617eb179741b03f31bb16c2245789322 libxl: disk: use _init/_setdefault Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx> diff -r 95e87306617e -r 56f3abb2a946 tools/libxl/libxl.c --- a/tools/libxl/libxl.c Wed Feb 29 16:30:35 2012 +0000 +++ b/tools/libxl/libxl.c Wed Feb 29 16:30:36 2012 +0000 @@ -1186,10 +1186,19 @@ int libxl_vncviewer_exec(libxl_ctx *ctx, /******************************************************************************/ -int libxl_device_disk_init(libxl_ctx *ctx, libxl_device_disk *disk) +void libxl_device_disk_init(libxl_device_disk *disk) { memset(disk, 0x00, sizeof(libxl_device_disk)); - return 0; +} + +int libxl__device_disk_setdefault(libxl__gc *gc, libxl_device_disk *disk) +{ + int rc; + + rc = libxl__device_disk_set_backend(gc, disk); + if (rc) return rc; + + return rc; } static int libxl__device_from_disk(libxl__gc *gc, uint32_t domid, @@ -1241,10 +1250,7 @@ int libxl_device_disk_add(libxl_ctx *ctx libxl__device device; int major, minor, rc; - rc = libxl__device_disk_set_backend(gc, disk); - if (rc) goto out; - - rc = libxl__device_disk_set_backend(gc, disk); + rc = libxl__device_disk_setdefault(gc, disk); if (rc) goto out; front = flexarray_make(16, 1); @@ -1396,7 +1402,7 @@ static void libxl__device_disk_from_xs_b unsigned int len; char *tmp; - libxl_device_disk_init(ctx, disk); + libxl_device_disk_init(disk); tmp = xs_read(ctx->xsh, XBT_NULL, libxl__sprintf(gc, "%s/params", be_path), &len); @@ -1440,7 +1446,7 @@ int libxl_devid_to_device_disk(libxl_ctx char *dompath, *path; int rc = ERROR_FAIL; - libxl_device_disk_init(ctx, disk); + libxl_device_disk_init(disk); dompath = libxl__xs_get_dompath(gc, domid); if (!dompath) { @@ -1604,7 +1610,7 @@ char * libxl_device_disk_local_attach(li char *ret = NULL; int rc; - rc = libxl__device_disk_set_backend(gc, disk); + rc = libxl__device_disk_setdefault(gc, disk); if (rc) goto out; switch (disk->backend) { diff -r 95e87306617e -r 56f3abb2a946 tools/libxl/libxl.h --- a/tools/libxl/libxl.h Wed Feb 29 16:30:35 2012 +0000 +++ b/tools/libxl/libxl.h Wed Feb 29 16:30:36 2012 +0000 @@ -498,7 +498,7 @@ void libxl_vminfo_list_free(libxl_vminfo */ /* Disks */ -int libxl_device_disk_init(libxl_ctx *ctx, libxl_device_disk *disk); +void libxl_device_disk_init(libxl_device_disk *disk); int libxl_device_disk_add(libxl_ctx *ctx, uint32_t domid, libxl_device_disk *disk); int libxl_device_disk_remove(libxl_ctx *ctx, uint32_t domid, libxl_device_disk *disk, diff -r 95e87306617e -r 56f3abb2a946 tools/libxl/libxl_create.c --- a/tools/libxl/libxl_create.c Wed Feb 29 16:30:35 2012 +0000 +++ b/tools/libxl/libxl_create.c Wed Feb 29 16:30:36 2012 +0000 @@ -536,7 +536,7 @@ static int do_domain_create(libxl__gc *g if (ret) goto error_out; for (i = 0; i < d_config->num_disks; i++) { - ret = libxl__device_disk_set_backend(gc, &d_config->disks[i]); + ret = libxl__device_disk_setdefault(gc, &d_config->disks[i]); if (ret) goto error_out; } diff -r 95e87306617e -r 56f3abb2a946 tools/libxl/libxl_internal.h --- a/tools/libxl/libxl_internal.h Wed Feb 29 16:30:35 2012 +0000 +++ b/tools/libxl/libxl_internal.h Wed Feb 29 16:30:36 2012 +0000 @@ -191,6 +191,8 @@ _hidden int libxl__domain_create_info_se libxl_domain_create_info *c_info); _hidden int libxl__domain_build_info_setdefault(libxl__gc *gc, libxl_domain_build_info *b_info); +_hidden int libxl__device_disk_setdefault(libxl__gc *gc, + libxl_device_disk *disk); struct libxl__evgen_domain_death { uint32_t domid; diff -r 95e87306617e -r 56f3abb2a946 tools/libxl/xl_cmdimpl.c --- a/tools/libxl/xl_cmdimpl.c Wed Feb 29 16:30:35 2012 +0000 +++ b/tools/libxl/xl_cmdimpl.c Wed Feb 29 16:30:36 2012 +0000 @@ -382,7 +382,7 @@ static void parse_disk_config_multistrin { int e; - libxl_device_disk_init(ctx, disk); + libxl_device_disk_init(disk); if (!*config) { *config = xlu_cfg_init(stderr, "command line"); _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |