From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wei Liu Subject: Re: [PATCH XEN v6 25/32] tools/libs/gnttab: Extensive updates to API documentation. Date: Wed, 9 Dec 2015 12:41:12 +0000 Message-ID: <20151209124112.GM23818@citrix.com> References: <1449141675.4424.125.camel@citrix.com> <1449141749-14940-1-git-send-email-ian.campbell@citrix.com> <1449141749-14940-26-git-send-email-ian.campbell@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1449141749-14940-26-git-send-email-ian.campbell@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: wei.liu2@citrix.com, Daniel De Graaf , ian.jackson@eu.citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Thu, Dec 03, 2015 at 11:22:22AM +0000, Ian Campbell wrote: [...] > + * connection, connected, etc). > + * > + * Both ends are permitted to modify (including clear) their > + * respective status bytes and to signal the event channel themselves > + * from userspace. > + * > + * Depending on the mechanisms which have been registered an > + * application may receive a shutdown notification as: > + * > + * - An event channel notification on a dedicated event channel > + * - Observation of the other ends's status byte being cleared > + * (whether in response to an explicit notification or in the > + * course of normal operation). > + * > + * The mechanism should be defined as part of the specific ring > + * protocol. > + * > + * Upon receiving notification of their peer's shutdown an application > + * is expected to teardown any resources (and in particular any grant > + * mappings) in a timely manner. > + * > + * NOTE: this protocol is intended to allow for better error behaviour > + * and recovery between two cooperating peers. It does not cover the > + * case of a malivious peer who may continue to hold resources open. "malicious" > + */ > + > +/* > * Grant Table Interface (making use of grants from other domains) > */ > > typedef struct xengntdev_handle xengnttab_handle; > > /* > - * Note: > - * After fork a child process must not use any opened xc gnttab > - * handle inherited from their parent. They must open a new handle if > - * they want to interact with xc. > + * Returns a handle onto the grant table driver. Logs errors. > + * > + * Note: After fork a child process must not use any opened gnttab > + * handle inherited from their parent, more access any grant mapped > + * areas associated with that handle. > + * And this could use the same cloexec trick as you do in other patch for privcmd. Wei.