[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] libxl: disk: use _init/_setdefault



# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1330604774 0
# Node ID 41731e865e399de1ff5a100ae7b6b139f232adfc
# Parent  66d0a12239dac983785c0a692f4f1b5f2501cbd2
libxl: disk: use _init/_setdefault

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---


diff -r 66d0a12239da -r 41731e865e39 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c       Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl.c       Thu Mar 01 12:26:14 2012 +0000
@@ -1186,10 +1186,19 @@
 
 
/******************************************************************************/
 
-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 @@
     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 @@
     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 @@
     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 *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 66d0a12239da -r 41731e865e39 tools/libxl/libxl.h
--- a/tools/libxl/libxl.h       Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl.h       Thu Mar 01 12:26:14 2012 +0000
@@ -498,7 +498,7 @@
  */
 
 /* 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 66d0a12239da -r 41731e865e39 tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c        Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl_create.c        Thu Mar 01 12:26:14 2012 +0000
@@ -536,7 +536,7 @@
     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 66d0a12239da -r 41731e865e39 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h      Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl_internal.h      Thu Mar 01 12:26:14 2012 +0000
@@ -191,6 +191,8 @@
                                         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 66d0a12239da -r 41731e865e39 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c  Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c  Thu Mar 01 12:26:14 2012 +0000
@@ -382,7 +382,7 @@
 {
     int e;
 
-    libxl_device_disk_init(ctx, disk);
+    libxl_device_disk_init(disk);
 
     if (!*config) {
         *config = xlu_cfg_init(stderr, "command line");

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.