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

Re: [Xen-devel] [PATCH 2/2] call ao_how callback explicitly



> Bamvor Jian Zhang writes ("[PATCH 2/2] call ao_how callback explicitly"):
> > ao_how callback is not called after inserted into list.
> > in my test, i directly call it in
> > libxl__ao_complete_check_progress_reports. i know it should not
> > work like this. Could you give some suggestion about it?
> 
> I'm not sure what you mean.  Under what conditions do you not see the
> callback happen ?  The existing machinery is supposed to take care of
> that.  Specifically, in the patch you're changing,
> libxl__ao_complete_check_progress_reports puts the ao onto
> egc->aos_for_callback.  On the return path from the libxl event
> function back to the application, we are supposed to call
> libxl__egc_cleanup, which in turn calls egc_run_callbacks, which
> should pick up the aos on aos_for_callback.  libxl__egc_cleanup is
> called from the event loops in libxl_event_wait and
> libxl__ao_inprogress and from the macro EGC_FREE.  It should be
> impossible for a path to be missed because inside libxl one needs an
> egc to call libxl__ao_complete.
the libvirt libxl driver register the event handler through
libxl_event_register_callbacks, so the libxl_event_wait could not get
the event. and if the ao_how is used, the libxl__egc_cleanup in
"if ( poller )" statement will not be called either.
even if i could expose the libxl_egc_cleanup to libvirt, i still do not
know when should i call it? i do not know if there is a event triggered
before the ao_how callback should be called. (is there a fd event when
the async operation complete?).


diff --git a/tools/libxl/libxl_event.c b/tools/libxl/libxl_event.c
index b732816..c216651 100644
--- a/tools/libxl/libxl_event.c
+++ b/tools/libxl/libxl_event.c
@@ -1743,6 +1743,13 @@ void libxl__ao_progress_report(libxl__egc *egc, 
libxl__ao *ao,
     }
 }
 
+void libxl_egc_cleanup(libxl_ctx *ctx)
+{
+    EGC_INIT(ctx);
+    libxl__egc_cleanup(egc);
+    EGC_FREE;
+    return rc;
+}
 
 /*
  * Local variables:
diff --git a/tools/libxl/libxl_event.h b/tools/libxl/libxl_event.h
index 27a65dc..f0f7376 100644
--- a/tools/libxl/libxl_event.h
+++ b/tools/libxl/libxl_event.h
@@ -555,6 +555,7 @@ int libxl_childproc_reaped(libxl_ctx *ctx, pid_t, int 
status)
  */
 void libxl_postfork_child_noexec(libxl_ctx *ctx);
 
+void libxl_egc_cleanup(libxl_ctx *ctx);
 
 #endif
 
>
> What kind of an ao_how is your application passing to libxl ?
ao_how with callback set.
> Is your
> application multithreaded ?
yes.



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






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