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

[Xen-changelog] [xen-unstable] libxl: rename aodevs to multidev


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-unstable <patchbot@xxxxxxx>
  • Date: Tue, 07 Aug 2012 20:33:15 +0000
  • Delivery-date: Tue, 07 Aug 2012 20:33:23 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xen.org>

# HG changeset patch
# User Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
# Date 1343984051 -3600
# Node ID a1b583ffbcb0503ad3907253c41986bd65f56ac7
# Parent  ee32ae1631266f0f6cce3d8c95ba15a68ec258a4
libxl: rename aodevs to multidev

To be consistent with the new function naming, rename
libxl__ao_devices to libxl__multidev and all variables aodevs to
multidev.

No functional change.

Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Committed-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---


diff -r ee32ae163126 -r a1b583ffbcb0 tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c        Fri Aug 03 09:54:11 2012 +0100
+++ b/tools/libxl/libxl_create.c        Fri Aug 03 09:54:11 2012 +0100
@@ -599,10 +599,10 @@ static void domcreate_bootloader_done(li
                                       libxl__bootloader_state *bl,
                                       int rc);
 
-static void domcreate_launch_dm(libxl__egc *egc, libxl__ao_devices *aodevs,
+static void domcreate_launch_dm(libxl__egc *egc, libxl__multidev *aodevs,
                                 int ret);
 
-static void domcreate_attach_pci(libxl__egc *egc, libxl__ao_devices *aodevs,
+static void domcreate_attach_pci(libxl__egc *egc, libxl__multidev *aodevs,
                                  int ret);
 
 static void domcreate_console_available(libxl__egc *egc,
@@ -909,10 +909,10 @@ static void domcreate_rebuild_done(libxl
 
     store_libxl_entry(gc, domid, &d_config->b_info);
 
-    libxl__multidev_begin(ao, &dcs->aodevs);
-    dcs->aodevs.callback = domcreate_launch_dm;
-    libxl__add_disks(egc, ao, domid, d_config, &dcs->aodevs);
-    libxl__multidev_prepared(egc, &dcs->aodevs, 0);
+    libxl__multidev_begin(ao, &dcs->multidev);
+    dcs->multidev.callback = domcreate_launch_dm;
+    libxl__add_disks(egc, ao, domid, d_config, &dcs->multidev);
+    libxl__multidev_prepared(egc, &dcs->multidev, 0);
 
     return;
 
@@ -921,10 +921,10 @@ static void domcreate_rebuild_done(libxl
     domcreate_complete(egc, dcs, ret);
 }
 
-static void domcreate_launch_dm(libxl__egc *egc, libxl__ao_devices *aodevs,
+static void domcreate_launch_dm(libxl__egc *egc, libxl__multidev *multidev,
                                 int ret)
 {
-    libxl__domain_create_state *dcs = CONTAINER_OF(aodevs, *dcs, aodevs);
+    libxl__domain_create_state *dcs = CONTAINER_OF(multidev, *dcs, multidev);
     STATE_AO_GC(dcs->ao);
     int i;
 
@@ -1039,14 +1039,14 @@ static void domcreate_devmodel_started(l
     /* Plug nic interfaces */
     if (d_config->num_nics > 0) {
         /* Attach nics */
-        libxl__multidev_begin(ao, &dcs->aodevs);
-        dcs->aodevs.callback = domcreate_attach_pci;
-        libxl__add_nics(egc, ao, domid, d_config, &dcs->aodevs);
-        libxl__multidev_prepared(egc, &dcs->aodevs, 0);
+        libxl__multidev_begin(ao, &dcs->multidev);
+        dcs->multidev.callback = domcreate_attach_pci;
+        libxl__add_nics(egc, ao, domid, d_config, &dcs->multidev);
+        libxl__multidev_prepared(egc, &dcs->multidev, 0);
         return;
     }
 
-    domcreate_attach_pci(egc, &dcs->aodevs, 0);
+    domcreate_attach_pci(egc, &dcs->multidev, 0);
     return;
 
 error_out:
@@ -1054,10 +1054,10 @@ error_out:
     domcreate_complete(egc, dcs, ret);
 }
 
-static void domcreate_attach_pci(libxl__egc *egc, libxl__ao_devices *aodevs,
+static void domcreate_attach_pci(libxl__egc *egc, libxl__multidev *multidev,
                                  int ret)
 {
-    libxl__domain_create_state *dcs = CONTAINER_OF(aodevs, *dcs, aodevs);
+    libxl__domain_create_state *dcs = CONTAINER_OF(multidev, *dcs, multidev);
     STATE_AO_GC(dcs->ao);
     int i;
     libxl_ctx *ctx = CTX;
diff -r ee32ae163126 -r a1b583ffbcb0 tools/libxl/libxl_device.c
--- a/tools/libxl/libxl_device.c        Fri Aug 03 09:54:11 2012 +0100
+++ b/tools/libxl/libxl_device.c        Fri Aug 03 09:54:11 2012 +0100
@@ -403,13 +403,13 @@ void libxl__prepare_ao_device(libxl__ao 
 
 /* multidev */
 
-void libxl__multidev_begin(libxl__ao *ao, libxl__ao_devices *aodevs)
+void libxl__multidev_begin(libxl__ao *ao, libxl__multidev *multidev)
 {
     AO_GC;
 
-    aodevs->ao = ao;
-    aodevs->array = 0;
-    aodevs->used = aodevs->allocd = 0;
+    multidev->ao = ao;
+    multidev->array = 0;
+    multidev->used = multidev->allocd = 0;
 
     /* We allocate an aodev to represent the operation of preparing
      * all of the other operations.  This operation is completed when
@@ -422,25 +422,25 @@ void libxl__multidev_begin(libxl__ao *ao
      *  (iii) we have a nice consistent way to deal with any
      *      error that might occur while deciding what to initiate
      */
-    aodevs->preparation = libxl__multidev_prepare(aodevs);
+    multidev->preparation = libxl__multidev_prepare(multidev);
 }
 
 static void multidev_one_callback(libxl__egc *egc, libxl__ao_device *aodev);
 
-libxl__ao_device *libxl__multidev_prepare(libxl__ao_devices *aodevs) {
-    STATE_AO_GC(aodevs->ao);
+libxl__ao_device *libxl__multidev_prepare(libxl__multidev *multidev) {
+    STATE_AO_GC(multidev->ao);
     libxl__ao_device *aodev;
 
     GCNEW(aodev);
-    aodev->aodevs = aodevs;
+    aodev->multidev = multidev;
     aodev->callback = multidev_one_callback;
     libxl__prepare_ao_device(ao, aodev);
 
-    if (aodevs->used >= aodevs->allocd) {
-        aodevs->allocd = aodevs->used * 2 + 5;
-        GCREALLOC_ARRAY(aodevs->array, aodevs->allocd);
+    if (multidev->used >= multidev->allocd) {
+        multidev->allocd = multidev->used * 2 + 5;
+        GCREALLOC_ARRAY(multidev->array, multidev->allocd);
     }
-    aodevs->array[aodevs->used++] = aodev;
+    multidev->array[multidev->used++] = aodev;
 
     return aodev;
 }
@@ -448,28 +448,28 @@ libxl__ao_device *libxl__multidev_prepar
 static void multidev_one_callback(libxl__egc *egc, libxl__ao_device *aodev)
 {
     STATE_AO_GC(aodev->ao);
-    libxl__ao_devices *aodevs = aodev->aodevs;
+    libxl__multidev *multidev = aodev->multidev;
     int i, error = 0;
 
     aodev->active = 0;
 
-    for (i = 0; i < aodevs->used; i++) {
-        if (aodevs->array[i]->active)
+    for (i = 0; i < multidev->used; i++) {
+        if (multidev->array[i]->active)
             return;
 
-        if (aodevs->array[i]->rc)
-            error = aodevs->array[i]->rc;
+        if (multidev->array[i]->rc)
+            error = multidev->array[i]->rc;
     }
 
-    aodevs->callback(egc, aodevs, error);
+    multidev->callback(egc, multidev, error);
     return;
 }
 
-void libxl__multidev_prepared(libxl__egc *egc, libxl__ao_devices *aodevs,
-                              int rc)
+void libxl__multidev_prepared(libxl__egc *egc,
+                              libxl__multidev *multidev, int rc)
 {
-    aodevs->preparation->rc = rc;
-    multidev_one_callback(egc, aodevs->preparation);
+    multidev->preparation->rc = rc;
+    multidev_one_callback(egc, multidev->preparation);
 }
 
 
/******************************************************************************/
@@ -486,12 +486,12 @@ void libxl__multidev_prepared(libxl__egc
 #define DEFINE_DEVICES_ADD(type)                                        \
     void libxl__add_##type##s(libxl__egc *egc, libxl__ao *ao, uint32_t domid, \
                               libxl_domain_config *d_config,            \
-                              libxl__ao_devices *aodevs)                \
+                              libxl__multidev *multidev)                \
     {                                                                   \
         AO_GC;                                                          \
         int i;                                                          \
         for (i = 0; i < d_config->num_##type##s; i++) {                 \
-            libxl__ao_device *aodev = libxl__multidev_prepare(aodevs);  \
+            libxl__ao_device *aodev = libxl__multidev_prepare(multidev);  \
             libxl__device_##type##_add(egc, domid, &d_config->type##s[i], \
                                        aodev);                          \
         }                                                               \
@@ -532,8 +532,8 @@ out:
 
 /* Callback for device destruction */
 
-static void devices_remove_callback(libxl__egc *egc, libxl__ao_devices *aodevs,
-                                    int rc);
+static void devices_remove_callback(libxl__egc *egc,
+                                    libxl__multidev *multidev, int rc);
 
 void libxl__devices_destroy(libxl__egc *egc, libxl__devices_remove_state *drs)
 {
@@ -545,12 +545,12 @@ void libxl__devices_destroy(libxl__egc *
     char **kinds = NULL, **devs = NULL;
     int i, j, rc = 0;
     libxl__device *dev;
-    libxl__ao_devices *aodevs = &drs->aodevs;
+    libxl__multidev *multidev = &drs->multidev;
     libxl__ao_device *aodev;
     libxl__device_kind kind;
 
-    libxl__multidev_begin(ao, aodevs);
-    aodevs->callback = devices_remove_callback;
+    libxl__multidev_begin(ao, multidev);
+    multidev->callback = devices_remove_callback;
 
     path = libxl__sprintf(gc, "/local/domain/%d/device", domid);
     kinds = libxl__xs_directory(gc, XBT_NULL, path, &num_kinds);
@@ -587,7 +587,7 @@ void libxl__devices_destroy(libxl__egc *
                     libxl__device_destroy(gc, dev);
                     continue;
                 }
-                aodev = libxl__multidev_prepare(aodevs);
+                aodev = libxl__multidev_prepare(multidev);
                 aodev->action = DEVICE_DISCONNECT;
                 aodev->dev = dev;
                 aodev->force = drs->force;
@@ -613,7 +613,7 @@ void libxl__devices_destroy(libxl__egc *
     }
 
 out:
-    libxl__multidev_prepared(egc, aodevs, rc);
+    libxl__multidev_prepared(egc, multidev, rc);
 }
 
 /* Callbacks for device related operations */
@@ -1003,10 +1003,10 @@ static void device_hotplug_clean(libxl__
     assert(!libxl__ev_child_inuse(&aodev->child));
 }
 
-static void devices_remove_callback(libxl__egc *egc, libxl__ao_devices *aodevs,
-                                    int rc)
+static void devices_remove_callback(libxl__egc *egc,
+                                    libxl__multidev *multidev, int rc)
 {
-    libxl__devices_remove_state *drs = CONTAINER_OF(aodevs, *drs, aodevs);
+    libxl__devices_remove_state *drs = CONTAINER_OF(multidev, *drs, multidev);
     STATE_AO_GC(drs->ao);
 
     drs->callback(egc, drs, rc);
diff -r ee32ae163126 -r a1b583ffbcb0 tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c    Fri Aug 03 09:54:11 2012 +0100
+++ b/tools/libxl/libxl_dm.c    Fri Aug 03 09:54:11 2012 +0100
@@ -714,10 +714,10 @@ static void spawn_stubdom_pvqemu_cb(libx
                                 int rc);
 
 static void spawn_stub_launch_dm(libxl__egc *egc,
-                                 libxl__ao_devices *aodevs, int ret);
+                                 libxl__multidev *aodevs, int ret);
 
 static void stubdom_pvqemu_cb(libxl__egc *egc,
-                              libxl__ao_devices *aodevs,
+                              libxl__multidev *aodevs,
                               int rc);
 
 static void spaw_stubdom_pvqemu_destroy_cb(libxl__egc *egc,
@@ -856,10 +856,10 @@ retry_transaction:
         if (errno == EAGAIN)
             goto retry_transaction;
 
-    libxl__multidev_begin(ao, &sdss->aodevs);
-    sdss->aodevs.callback = spawn_stub_launch_dm;
-    libxl__add_disks(egc, ao, dm_domid, dm_config, &sdss->aodevs);
-    libxl__multidev_prepared(egc, &sdss->aodevs, 0);
+    libxl__multidev_begin(ao, &sdss->multidev);
+    sdss->multidev.callback = spawn_stub_launch_dm;
+    libxl__add_disks(egc, ao, dm_domid, dm_config, &sdss->multidev);
+    libxl__multidev_prepared(egc, &sdss->multidev, 0);
 
     free(args);
     return;
@@ -872,9 +872,9 @@ out:
 }
 
 static void spawn_stub_launch_dm(libxl__egc *egc,
-                                 libxl__ao_devices *aodevs, int ret)
+                                 libxl__multidev *multidev, int ret)
 {
-    libxl__stub_dm_spawn_state *sdss = CONTAINER_OF(aodevs, *sdss, aodevs);
+    libxl__stub_dm_spawn_state *sdss = CONTAINER_OF(multidev, *sdss, multidev);
     STATE_AO_GC(sdss->dm.spawn.ao);
     libxl_ctx *ctx = libxl__gc_owner(gc);
     int i, num_console = STUBDOM_SPECIAL_CONSOLES;
@@ -982,22 +982,22 @@ static void spawn_stubdom_pvqemu_cb(libx
     if (rc) goto out;
 
     if (d_config->num_nics > 0) {
-        libxl__multidev_begin(ao, &sdss->aodevs);
-        sdss->aodevs.callback = stubdom_pvqemu_cb;
-        libxl__add_nics(egc, ao, dm_domid, d_config, &sdss->aodevs);
-        libxl__multidev_prepared(egc, &sdss->aodevs, 0);
+        libxl__multidev_begin(ao, &sdss->multidev);
+        sdss->multidev.callback = stubdom_pvqemu_cb;
+        libxl__add_nics(egc, ao, dm_domid, d_config, &sdss->multidev);
+        libxl__multidev_prepared(egc, &sdss->multidev, 0);
         return;
     }
 
 out:
-    stubdom_pvqemu_cb(egc, &sdss->aodevs, rc);
+    stubdom_pvqemu_cb(egc, &sdss->multidev, rc);
 }
 
 static void stubdom_pvqemu_cb(libxl__egc *egc,
-                              libxl__ao_devices *aodevs,
+                              libxl__multidev *multidev,
                               int rc)
 {
-    libxl__stub_dm_spawn_state *sdss = CONTAINER_OF(aodevs, *sdss, aodevs);
+    libxl__stub_dm_spawn_state *sdss = CONTAINER_OF(multidev, *sdss, multidev);
     STATE_AO_GC(sdss->dm.spawn.ao);
     uint32_t dm_domid = sdss->pvqemu.guest_domid;
 
diff -r ee32ae163126 -r a1b583ffbcb0 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h      Fri Aug 03 09:54:11 2012 +0100
+++ b/tools/libxl/libxl_internal.h      Fri Aug 03 09:54:11 2012 +0100
@@ -1797,7 +1797,7 @@ typedef enum {
 } libxl__device_action;
 
 typedef struct libxl__ao_device libxl__ao_device;
-typedef struct libxl__ao_devices libxl__ao_devices;
+typedef struct libxl__multidev libxl__multidev;
 typedef void libxl__device_callback(libxl__egc*, libxl__ao_device*);
 
 /* This functions sets the necessary libxl__ao_device struct values to use
@@ -1827,7 +1827,7 @@ struct libxl__ao_device {
     int rc;
     /* private for multidev */
     int active;
-    libxl__ao_devices *aodevs; /* reference to the containing multidev */
+    libxl__multidev *multidev; /* reference to the containing multidev */
     /* private for add/remove implementation */
     libxl__ev_devstate backend_ds;
     /* Bodge for Qemu devices, also used for timeout of hotplug execution */
@@ -1853,12 +1853,12 @@ struct libxl__ao_device {
  */
 
 /* Starts preparing to add/remove a bunch of devices. */
-_hidden void libxl__multidev_begin(libxl__ao *ao, libxl__ao_devices*);
+_hidden void libxl__multidev_begin(libxl__ao *ao, libxl__multidev*);
 
 /* Prepares to add/remove one of many devices.  Returns a libxl__ao_device
  * which has had libxl__prepare_ao_device called, and which has also
  * had ->callback set.  The user should not mess with aodev->callback. */
-_hidden libxl__ao_device *libxl__multidev_prepare(libxl__ao_devices*);
+_hidden libxl__ao_device *libxl__multidev_prepare(libxl__multidev*);
 
 /* Notifies the multidev machinery that we have now finished preparing
  * and initiating devices.  multidev->callback may then be called as
@@ -1866,10 +1866,10 @@ _hidden libxl__ao_device *libxl__multide
  * outstanding, perhaps reentrantly.  If rc!=0 (error should have been
  * logged) multidev->callback will get a non-zero rc.
  * callback may be set by the user at any point before prepared. */
-_hidden void libxl__multidev_prepared(libxl__egc*, libxl__ao_devices*, int rc);
-
-typedef void libxl__devices_callback(libxl__egc*, libxl__ao_devices*, int rc);
-struct libxl__ao_devices {
+_hidden void libxl__multidev_prepared(libxl__egc*, libxl__multidev*, int rc);
+
+typedef void libxl__devices_callback(libxl__egc*, libxl__multidev*, int rc);
+struct libxl__multidev {
     /* set by user: */
     libxl__devices_callback *callback;
     /* for private use by libxl__...ao_devices... machinery: */
@@ -2342,7 +2342,7 @@ struct libxl__devices_remove_state {
     libxl__devices_remove_callback *callback;
     int force; /* libxl_device_TYPE_destroy rather than _remove */
     /* private */
-    libxl__ao_devices aodevs;
+    libxl__multidev multidev;
     int num_devices;
 };
 
@@ -2386,7 +2386,7 @@ _hidden void libxl__devices_destroy(libx
                                     libxl__devices_remove_state *drs);
 
 /* Helper function to add a bunch of disks. This should be used when
- * the caller is inside an async op. "devices" will NOT be prepared by
+ * the caller is inside an async op. "multidev" will NOT be prepared by
  * this function, so the caller must make sure to call
  * libxl__multidev_begin before calling this function.
  *
@@ -2395,11 +2395,11 @@ _hidden void libxl__devices_destroy(libx
  */
 _hidden void libxl__add_disks(libxl__egc *egc, libxl__ao *ao, uint32_t domid,
                               libxl_domain_config *d_config,
-                              libxl__ao_devices *aodevs);
+                              libxl__multidev *multidev);
 
 _hidden void libxl__add_nics(libxl__egc *egc, libxl__ao *ao, uint32_t domid,
                              libxl_domain_config *d_config,
-                             libxl__ao_devices *aodevs);
+                             libxl__multidev *multidev);
 
 /*----- device model creation -----*/
 
@@ -2435,7 +2435,7 @@ typedef struct {
     libxl__domain_build_state dm_state;
     libxl__dm_spawn_state pvqemu;
     libxl__destroy_domid_state dis;
-    libxl__ao_devices aodevs;
+    libxl__multidev multidev;
 } libxl__stub_dm_spawn_state;
 
 _hidden void libxl__spawn_stub_dm(libxl__egc *egc, 
libxl__stub_dm_spawn_state*);
@@ -2467,7 +2467,7 @@ struct libxl__domain_create_state {
     libxl__save_helper_state shs;
     /* necessary if the domain creation failed and we have to destroy it */
     libxl__domain_destroy_state dds;
-    libxl__ao_devices aodevs;
+    libxl__multidev multidev;
 };
 
 /*----- Domain suspend (save) functions -----*/

_______________________________________________
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®.