From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olaf Hering Subject: Re: wating for backend changes (was Re: [PATCH v3 4/4] libxl: add support for vscsi) Date: Tue, 14 Apr 2015 17:55:12 +0200 Message-ID: <20150414155512.GA20666@aepfle.de> 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: Content-Disposition: inline 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: xen-devel@lists.xen.org Cc: Wei Liu , Ian Jackson , Ian Campbell , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On Fri, Apr 10, Olaf Hering wrote: > 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. > - libxl__ev_devstate_wait registers a watch and a timer. > > > 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 reconfigure case has to wait for various states, depending on the > state before the reconfiguration. For the time being I used also polling via libxl__wait_for_backend. Doing event driven reconfigure can be implemented, but only with quite some effort. Olaf