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

Re: [Xen-devel] [PATCH v2 05/15] libxl: change libxl__ao_device_remove to libxl__ao_device



Ian Jackson wrote:
Roger Pau Monne writes ("[PATCH v2 05/15] libxl: change libxl__ao_device_remove to 
libxl__ao_device"):
Introduce a new structure to track state of device backends, that will
be used in following patches on this series.

This structure if used for both device creation and device
destruction and removes libxl__ao_device_remove.

diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index ae5527b..b62110a 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -1802,6 +1795,44 @@ _hidden void 
libxl__bootloader_init(libxl__bootloader_state *bl);
...
+/* Device AO operations */

-typedef struct {
-    libxl__ao *ao;
-    libxl__ev_devstate ds;
-} libxl__ao_device_remove;
+void libxl__init_ao_device(libxl__ao_device *aorm, libxl__ao *ao,
+                           libxl__ao_device **base)
+{
+    aorm->ao = ao;
+    aorm->active = 1;
+    aorm->rc = 0;
+    aorm->base = base;
+}

I think a function "init" should set "active" to 0, surely ?
Since the operation has not in fact been started.  So perhaps this
should just be a memset.

Forget to answer this, we cannot use active = 0 at init because in the hypothetical case that a device add/remove finished before queuing all the others (so the others would be active == 0) it would mark the ao as complete, since it would see all other operations as finished.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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