From: Wei Liu Subject: Re: [PATCH V5 32/32] libxl: synchronize configuration when we plug / unplug device Date: Sun, 1 Jun 2014 21:57:29 +0100 Message-ID: <20140601205729.GF28279@zion.uk.xensource.com> References: <1400018054-26038-1-git-send-email-wei.liu2@citrix.com> <1400018054-26038-33-git-send-email-wei.liu2@citrix.com> <21371.30169.2338.357028@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <21371.30169.2338.357028@mariner.uk.xensource.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 Jackson Cc: Wei Liu , ian.campbell@citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Tue, May 20, 2014 at 04:33:45PM +0100, Ian Jackson wrote: > Wei Liu writes ("[PATCH V5 32/32] libxl: synchronize configuration when we plug / unplug device"): > > This approach cannot deal with half-baked device state (say, if AO > > returns success but for various reasons other parts just fail and we > > have some xenstore entries written / resource allocated). However we > > cannot make thing worse as the original code cannot handle that either. > > The good side of this approach is that in the future we can compare the > > stored configuration and xenstore entries to spot any half-baked device > > state so it can help fix that issue in the future. > > I'm still concerned about this. > > And seeing the code which results from doing it this way hasn't really > convinced me otherwise. These macros are going to need to be adjusted > again. > > Wouldn't it be better to write something which can merge (a) the > information currently obtained by libxl_device_disk_list, > libxl__device_disk_from_xs_be et al and (b) the new JSON > configuration ? > This is certainly doable. But again, what's the desirable state to record? If a device's entry is present in xenstore then it must be valid? It might be my misundertanding of how we should handle half-baked state. We shall have further discussion... > Then you could arrange to add the device to the JSON config before > doing anything else, and remove it afterwards, and then there would be > no undesirable states etc. > Sorry, it's unclear to me what you want me to do. Why do I need to remove a device after I add it? Wei. > Ian.