From: Ian Jackson Subject: wating for backend changes (was Re: [PATCH v3 4/4] libxl: add support for vscsi) Date: Wed, 15 Apr 2015 12:50:17 +0100 Message-ID: <21806.20601.416647.208397@mariner.uk.xensource.com> References: <1425635156-2357-1-git-send-email-olaf@aepfle.de> <1425635156-2357-5-git-send-email-olaf@aepfle.de> <20150410092357.GA22131@aepfle.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20150410092357.GA22131@aepfle.de> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Olaf Hering Cc: Stefano Stabellini , Wei Liu , Ian Campbell , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org Olaf Hering writes ("wating for backend changes (was Re: [PATCH v3 4/4] libxl: add support for vscsi)"): > How is new code supposed to wait for backend changes? > > Right now there are two APIs for that: > - libxl__wait_for_backend loops for a while until it returns an error. This is deprecated. I seem to remember I wrote a patch to clarify the internal docs but it seems to be languishing in one of my outstanding series. > - libxl__ev_devstate_wait registers a watch and a timer. New code should use this. > In case of pvscsi there are three variants: > - new, can use libxl__wait_device_connection > - reconfigure, can use both of the above > - remove, may use DEFINE_DEVICE_REMOVE and its > libxl__initiate_device_remove ... > The pci code in libxl uses just libxl__wait_for_backend. Looking through > the history it seems the function was added just for pci. Is it a > deprecated function, should callers get converted to > libxl__ev_devstate_wait? Ideally, yes. Thanks, Ian.