xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Ian Jackson <ian.jackson@eu.citrix.com>
To: xen-devel@lists.xen.org
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Subject: [PATCH 11/13] libxl: correct some comments regarding event API and fds
Date: Thu, 2 Aug 2012 18:27:20 +0100	[thread overview]
Message-ID: <1343928442-23966-12-git-send-email-ian.jackson@eu.citrix.com> (raw)
In-Reply-To: <1343928442-23966-1-git-send-email-ian.jackson@eu.citrix.com>

* libxl may indeed register more than one callback for the same fd,
  with some restrictions.  The allowable range of responses to this by
  the application means that this should pose no problems for users.
  But the documentation comment should be fixed.

* Document the relaxed synchronicity semantics of the fd_modify
  registration callback.

* A couple of comments referred to old names for functions.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl_event.h |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/tools/libxl/libxl_event.h b/tools/libxl/libxl_event.h
index 3344bc8..cead71b 100644
--- a/tools/libxl/libxl_event.h
+++ b/tools/libxl/libxl_event.h
@@ -320,13 +320,24 @@ typedef struct libxl_osevent_hooks {
  * *for_registration_update is honoured by libxl and will be passed
  * to future modify or deregister calls.
  *
- * libxl will only attempt to register one callback for any one fd.
+ * libxl may want to register more than one callback for any one fd;
+ * in that case: (i) each such registration will have at least one bit
+ * set in revents which is unique to that registration; (ii) if an
+ * event occurs which is relevant for multiple registrations the
+ * application's event system is may call libxl_osevent_occurred_fd
+ * for one, some, or all of those registrations.
+ *
+ * If fd_modify is used, it is permitted for the application's event
+ * system to still make calls to libxl_osevent_occurred_fd for the
+ * "old" set of requested events; these will be safely ignored by
+ * libxl.
+ *
  * libxl will remember the value stored in *for_app_registration_out
  * (or *for_app_registration_update) by a successful call to
  * register (or modify), and pass it to subsequent calls to modify
  * or deregister.
  *
- * register_fd_hooks may be called only once for each libxl_ctx.
+ * osevent_register_hooks may be called only once for each libxl_ctx.
  * libxl may make calls to register/modify/deregister from within
  * any libxl function (indeed, it will usually call register from
  * register_event_hooks).  Conversely, the application MUST NOT make
@@ -357,7 +368,7 @@ void libxl_osevent_register_hooks(libxl_ctx *ctx,
 /* It is NOT legal to call _occurred_ reentrantly within any libxl
  * function.  Specifically it is NOT legal to call it from within
  * a register callback.  Conversely, libxl MAY call register/deregister
- * from within libxl_event_registered_call_*.
+ * from within libxl_event_occurred_call_*.
  */
 
 void libxl_osevent_occurred_fd(libxl_ctx *ctx, void *for_libxl,
-- 
1.7.2.5

  parent reply	other threads:[~2012-08-02 17:27 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-02 17:27 [PATCH v5 00/13] libxl: Assorted bugfixes and cleanups Ian Jackson
2012-08-02 17:27 ` [PATCH 01/13] libxl: unify libxl__device_destroy and device_hotplug_done Ian Jackson
2012-08-02 17:27 ` [PATCH 02/13] libxl: react correctly to bootloader pty master POLLHUP Ian Jackson
2012-08-03  8:32   ` Ian Campbell
2012-08-02 17:27 ` [PATCH 03/13] libxl: fix device counting race in libxl__devices_destroy Ian Jackson
2012-08-02 17:27 ` [PATCH 04/13] libxl: fix formatting of DEFINE_DEVICES_ADD Ian Jackson
2012-08-02 17:27 ` [PATCH 05/13] libxl: abolish useless `start' parameter to libxl__add_* Ian Jackson
2012-08-02 17:27 ` [PATCH 06/13] libxl: rename aodevs to multidev Ian Jackson
2012-08-02 17:27 ` [PATCH 07/13] libxl: do not blunder on if bootloader fails (again) Ian Jackson
2012-08-02 17:27 ` [PATCH 08/13] libxl: remus: mark TODOs more clearly Ian Jackson
2012-08-02 17:27 ` [PATCH 09/13] libxl: remove an unused numainfo parameter Ian Jackson
2012-08-02 17:27 ` [PATCH 10/13] libxl: idl: always initialise KeyedEnum keyvar in member init Ian Jackson
2012-08-02 17:27 ` Ian Jackson [this message]
2012-08-03  8:35   ` [PATCH 11/13] libxl: correct some comments regarding event API and fds Ian Campbell
2012-08-03 10:53     ` Ian Jackson
2012-08-02 17:27 ` [PATCH 12/13] libxl: add a comment re the memory management API instability Ian Jackson
2012-08-03  8:35   ` Ian Campbell
2012-08-02 17:27 ` [PATCH 13/13] libxl: -Wunused-parameter Ian Jackson
2012-08-03  8:08   ` Ian Campbell
2012-08-03  8:59 ` [PATCH v5 00/13] libxl: Assorted bugfixes and cleanups Ian Campbell
2012-08-03 11:05   ` Ian Jackson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1343928442-23966-12-git-send-email-ian.jackson@eu.citrix.com \
    --to=ian.jackson@eu.citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).