From: Ian Campbell Subject: Re: [PATCH] Prevent xl save from segfaulting when control/shutdown key is removed Date: Wed, 23 Nov 2011 14:40:43 +0000 Message-ID: <1322059243.1005.140.camel@zakaz.uk.xensource.com> References: <3341e3e990568f459ae9.1322041536@cosworth.uk.xensource.com> <1322043166.1005.27.camel@zakaz.uk.xensource.com> <291EDFCB1E9E224A99088639C4762022B5988E4AD4@LONPMAILBOX01.citrite.net> <1322047419.1005.72.camel@zakaz.uk.xensource.com> <291EDFCB1E9E224A99088639C4762022B5988E4AE8@LONPMAILBOX01.citrite.net> <1322053488.1005.107.camel@zakaz.uk.xensource.com> <291EDFCB1E9E224A99088639C4762022B5988E4AED@LONPMAILBOX01.citrite.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <291EDFCB1E9E224A99088639C4762022B5988E4AED@LONPMAILBOX01.citrite.net> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Paul Durrant Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On Wed, 2011-11-23 at 13:12 +0000, Paul Durrant wrote: > True. I was conflating the key rm issue with the fact that the > XenServer Windows PV guest agent gets unhappy because it can't > advertise its features (which I hadn't mentioned before). > > I suppose that libxl will just have to continue to speculatively write > control/shutdown and timeout if it's not NUL-ed or rm-ed as it does > now. I suppose one option might be a "feature-will-write-features" flag. If it is not written to true then assume everything is supported, if it does get set to true then look for the flags and follow them. However if a protocol is going to be invented then it should be discussed here and documented etc. Ian. > > Paul > > > -----Original Message----- > > From: Ian Campbell > > Sent: 23 November 2011 13:05 > > To: Paul Durrant > > Cc: xen-devel@lists.xensource.com > > Subject: RE: [Xen-devel] [PATCH] Prevent xl save from segfaulting > > when control/shutdown key is removed > > > > On Wed, 2011-11-23 at 12:59 +0000, Paul Durrant wrote: > > > > -----Original Message----- > > > > From: Ian Campbell > > > > Sent: 23 November 2011 11:24 > > > > To: Paul Durrant > > > > Cc: xen-devel@lists.xensource.com > > > > Subject: RE: [Xen-devel] [PATCH] Prevent xl save from > > segfaulting > > > > when control/shutdown key is removed > > > > > > > > On Wed, 2011-11-23 at 11:19 +0000, Paul Durrant wrote: > > > > > what is the reason for creating control ro to the guest? > > > > > > > > In general libxl prefers to whitelist paths which the guest can > > > > write too, just to prevent a complete free for all, keep things > > > > somewhat under control and to help avoid situations where tools > > > > might inadvertently rely on a guest-writeable key in an unsafe > > way.. > > > > > > > > > In XenServer we allow the guest to write the control key to > > > > advertise > > > > > feature-shutdown, feature-suspend etc. so that the tools know > > what > > > > > values of control/shutdown the guest will respond to. > > > > > > > > The libxl way would be to create these at build time (perhaps > > empty) > > > > with the appropriate permissions. > > > > > > > > It's not clear how that functionality can be added in a way > > which is > > > > compatible with existing guests though, e.g. no Linux guest > > writes > > > > those but many can be suspended etc. > > > > > > > > > > So the simple solution, for compatibility's sake, is to make > > control rw isn't it? > > > > The problem I'm thinking of exists even if control is rw. > > > > Given an empty control directory how do you know if a guest supports > > suspend or not, given that most existing guests which do support > > suspend do not write any key there? > > > > Ian. >