From: Sander Eikelenboom Subject: Re: [Xen-unstable] XenbusState signaling with regard to pci-detach on HVM guests Date: Sat, 9 Aug 2014 01:30:09 +0200 Message-ID: <394063044.20140809013009@eikelenboom.it> References: <1029634869.20140808000454@eikelenboom.it> <53E493E3020000780002A5E3@mail.emea.novell.com> <135580811.20140808102031@eikelenboom.it> <53E4ABB1020000780002A7B6@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XFtc5-0004er-DH for xen-devel@lists.xenproject.org; Fri, 08 Aug 2014 23:30:21 +0000 In-Reply-To: <53E4ABB1020000780002A7B6@mail.emea.novell.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: Jan Beulich , Konrad Rzeszutek Wilk Cc: xen-devel@lists.xenproject.org, Ian Campbell List-Id: xen-devel@lists.xenproject.org Friday, August 8, 2014, 10:51:29 AM, you wrote: >>>> On 08.08.14 at 10:20, wrote: >> So how feasible is it to keep on trying to work around on things .. when >> there >> is that much spaghetti :-) > It's ugly, yes, but breaking existing code is ugly too. The usual > handshaking negotiation via xenstore should be used to control > altered behavior. > Jan Got an example (something like the ) that is used between pciback and front ? But i still don't see how it could be done without a lot of code duplication or complicating things further. I also tried the other route that keeps the changes to pciback only. That is placing a "safeguard" at the end of the xenstore watch callback (xen_pcibk_be_watch), that way there is no change for PV guests ( as pcifront does seem to do the proper signaling ). So on every change to (or under) a guests "pci-root" tree in xenstore, pciback would check if the list of devices that it has registered as passed through to a domain (dev_domain_list) matches with the xenstore entries. If a xenstore entry is missing for a device that is still registred to a domain, it is clear that libxl has removed it and yanked the xenstore entries from beneath our feet, so we should now deregister the device from the domain in pciback. How ever my C-skills are a bit too limited with respect to passing around the necessary lists/arrays of pci_dev structs to loop through and compare it to the xenstore entries, so i can't get it implemented :-( *sigh* -- Sander