From: Olaf Hering Subject: Re: [PATCH] libxl: add option for discard support to xl disk configuration Date: Wed, 29 Jan 2014 12:19:39 +0100 Message-ID: <20140129111939.GA26899@aepfle.de> References: <1390933497-12819-1-git-send-email-olaf@aepfle.de> <1390991329.31814.58.camel@kazak.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: <1390991329.31814.58.camel@kazak.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 Campbell Cc: anthony.perard@citrix.com, stefano.stabellini@eu.citrix.com, Ian.Jackson@eu.citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Wed, Jan 29, Ian Campbell wrote: > > +Default value: on > > I think this default should be "on if, available for that backend type". Ok, will make this change. > What happens if the backed does not support discard? The toolstack just does not know if a phy device supports it, or if file backed storage can do hole punching. If feature-discard is set and the frontend sends a discard request, the backend would return an error (like ENOTSUPPORTED) and the frontend internally disables the discard flag. Thats how it is done in pvops and the forward ported xenlinux tree. Up to now I have not prepared a change for the backend drivers. They could either force feature-discard to be true so that the error paths will be executed. Or they could ignore the discard-enable if the backing storage does not support discard. > > disk->readwrite = 1; > > + disk->discard_enable = 1; /* Doing it twice?! */ > > Why? Thats what I'm asking you. Why is readwrite set here, and later on also in the .l file? At least just setting it here did not unconditionally enable it if no discard= was specified. I have not traced the code why that happens. > > + * discard_enable > > All of the existing properties use - not _. I will make this change. Thanks. Olaf