[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v2 08/15] libxl: convert libxl_device_disk_add to an asyn op
Roger Pau Monne writes ("[PATCH v2 08/15] libxl: convert libxl_device_disk_add to an asyn op"): > This patch converts libxl_device_disk_add to an ao operation that > waits for device backend to reach state XenbusStateInitWait and then > marks the operation as completed. This is not really useful now, but > will be used by latter patches that will launch hotplug scripts after > we reached the desired xenbus state. ... > +void libxl__initiate_device_add(libxl__egc *egc, libxl__ao_device *aoadd) > +{ > + STATE_AO_GC(aoadd->ao); > + char *be_path = libxl__device_backend_path(gc, aoadd->dev); > + char *state_path = libxl__sprintf(gc, "%s/state", be_path); > + char *state = libxl__xs_read(gc, XBT_NULL, state_path); > + int rc = 0; Do you really need to do the xenstore state read here ? Surely libxl__ev_devstate_wait will do it for you. > diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h > index 68d076c..a5fc092 100644 > --- a/tools/libxl/libxl_internal.h > +++ b/tools/libxl/libxl_internal.h ... > +/* Internal AO operation to connect a disk device */ > +_hidden void libxl__device_disk_add(libxl__egc *egc, uint32_t domid, > + libxl_device_disk *disk, > + libxl__ao_device *aorm); > + > +/* Arranges that dev will be added to the guest, and the > + * hotplug scripts will be executed (if necessary). When > + * this is done (or an error happens), the callback in > + * aorm->callback will be called. > + */ You really can't call this an aorm if it's being used for device addition :-). Can we call this "aodev" everywhere, right from the beginning ? Thanks, Ian. _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |