[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 05/19] libxl: events: Use libxl__xswait_* in spawn code
On 03/04/2014 10:56 PM, Ian Jackson wrote: > Replace open-coded use of ev_time and ev_xswatch with xswait. > > Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx> > CC: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx> > Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx> > --- > tools/libxl/libxl_exec.c | 49 > +++++++++++++++--------------------------- > tools/libxl/libxl_internal.h | 3 +-- > 2 files changed, 18 insertions(+), 34 deletions(-) > > diff --git a/tools/libxl/libxl_exec.c b/tools/libxl/libxl_exec.c > index b6efa0f..4b012dc 100644 > --- a/tools/libxl/libxl_exec.c > +++ b/tools/libxl/libxl_exec.c > @@ -257,10 +257,8 @@ err: > */ > > /* Event callbacks. */ > -static void spawn_watch_event(libxl__egc *egc, libxl__ev_xswatch *xsw, > - const char *watch_path, const char > *event_path); > -static void spawn_timeout(libxl__egc *egc, libxl__ev_time *ev, > - const struct timeval *requested_abs); > +static void spawn_watch_event(libxl__egc *egc, libxl__xswait_state *xswa, > + int rc, const char *xsdata); > static void spawn_middle_death(libxl__egc *egc, libxl__ev_child *childw, > pid_t pid, int status); > > @@ -274,8 +272,7 @@ static void spawn_fail(libxl__egc *egc, > libxl__spawn_state *ss); > void libxl__spawn_init(libxl__spawn_state *ss) > { > libxl__ev_child_init(&ss->mid); > - libxl__ev_time_init(&ss->timeout); > - libxl__ev_xswatch_init(&ss->xswatch); > + libxl__xswait_init(&ss->xswait); > } > > int libxl__spawn_spawn(libxl__egc *egc, libxl__spawn_state *ss) > @@ -288,12 +285,12 @@ int libxl__spawn_spawn(libxl__egc *egc, > libxl__spawn_state *ss) > libxl__spawn_init(ss); > ss->failed = ss->detaching = 0; > > - rc = libxl__ev_time_register_rel(gc, &ss->timeout, > - spawn_timeout, ss->timeout_ms); > - if (rc) goto out_err; > - > - rc = libxl__ev_xswatch_register(gc, &ss->xswatch, > - spawn_watch_event, ss->xspath); > + ss->xswait.ao = ao; > + ss->xswait.what = GCSPRINTF("%s startup", ss->what); > + ss->xswait.path = ss->xspath; > + ss->xswait.timeout_ms = ss->timeout_ms; > + ss->xswait.callback = spawn_watch_event; > + rc = libxl__xswait_start(gc, &ss->xswait); This is another kind of open code, I guess it should be wrapped into a function. _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |