Re: [Nbd] [PATCH 2/2] NBD proto: add GET_LBA_STATUS extension

2016-04-04 Thread Eric Blake
On 04/04/2016 02:16 PM, Denis V. Lunev wrote: >> +The following request types are currently defined for the command: >> + >> +1. Block provisioning state >> + >> +Upon receiving an `NBD_CMD_GET_LBA_STATUS` command with command flags >> +field set to `NBD_FLAG_GET_ALLOCATED` (0x0),

Re: [Nbd] [PATCH 2/2] NBD proto: add GET_LBA_STATUS extension

2016-04-04 Thread Denis V. Lunev
On 03/23/2016 05:16 PM, Denis V. Lunev wrote: > From: Pavel Borzenkov > > With the availability of sparse storage formats, it is often needed to > query status of a particular LBA range and read only those blocks of > data that are actually present on the block device. >

Re: [Nbd] [PATCH 2/2] NBD proto: add GET_LBA_STATUS extension

2016-03-24 Thread Wouter Verhelst
Hi Paolo, On Thu, Mar 24, 2016 at 12:55:51PM +0100, Paolo Bonzini wrote: > > > On 23/03/2016 18:58, Wouter Verhelst wrote: > >> +To provide such class of information, `GET_LBA_STATUS` extension adds new > >> +`NBD_CMD_GET_LBA_STATUS` command which returns a list of LBA ranges with > >> +their

Re: [Nbd] [PATCH 2/2] NBD proto: add GET_LBA_STATUS extension

2016-03-24 Thread Wouter Verhelst
On Thu, Mar 24, 2016 at 02:36:52PM +0300, Pavel Borzenkov wrote: > On Thu, Mar 24, 2016 at 09:41:29AM +0100, Wouter Verhelst wrote: > > Okay, that alleviates my concerns. > > > > In that case it might be useful if the server could say something along > > the lines of "I know it's allocated, but I

Re: [Nbd] [PATCH 2/2] NBD proto: add GET_LBA_STATUS extension

2016-03-24 Thread Paolo Bonzini
On 24/03/2016 14:31, Alex Bligh wrote: > Sorry, I should have been clearer on the states: > > bits > 210 > > 1-- Unallocated, and hence reads as zero > -1- Allocated, and reads as zero > --1 Allocated, and reads as non-zero > > So 100 means 'definitely unallocated, will read as zero'. > > If

Re: [Nbd] [PATCH 2/2] NBD proto: add GET_LBA_STATUS extension

2016-03-24 Thread Alex Bligh
On 24 Mar 2016, at 12:32, Paolo Bonzini wrote: > On 24/03/2016 13:17, Alex Bligh wrote: >> * unallocated >> * zero >> * non-zero >> >> So the possible replies are a bitfield of those, with a '1' if it 'might' >> be in that state, i.e. >> >>

Re: [Nbd] [PATCH 2/2] NBD proto: add GET_LBA_STATUS extension

2016-03-24 Thread Paolo Bonzini
On 24/03/2016 13:17, Alex Bligh wrote: >>> >> * unallocated >>> >> * zero >>> >> * non-zero >>> >> >>> >> So the possible replies are a bitfield of those, with a '1' if it 'might' >>> >> be in that state, i.e. >>> >> >>> >> 111 = no idea >>> >> 110 = might be zero or unallocated, but isn't

Re: [Nbd] [PATCH 2/2] NBD proto: add GET_LBA_STATUS extension

2016-03-24 Thread Alex Bligh
On 24 Mar 2016, at 11:58, Paolo Bonzini wrote: > > On 24/03/2016 11:32, Alex Bligh wrote: Now I'm not saying we need to fully define what it means for a part of the backend to be "dirty" or not. It's okay to leave part of the meaning in the dark,

Re: [Nbd] [PATCH 2/2] NBD proto: add GET_LBA_STATUS extension

2016-03-24 Thread Paolo Bonzini
On 24/03/2016 11:32, Alex Bligh wrote: >> > Now I'm not saying we >> > need to fully define what it means for a part of the backend to be >> > "dirty" or not. It's okay to leave part of the meaning in the dark, >> > leaving that implementation-defined. > Well, the 3 possible states are: > > *

Re: [Nbd] [PATCH 2/2] NBD proto: add GET_LBA_STATUS extension

2016-03-24 Thread Paolo Bonzini
On 23/03/2016 18:58, Wouter Verhelst wrote: >> +To provide such class of information, `GET_LBA_STATUS` extension adds new >> +`NBD_CMD_GET_LBA_STATUS` command which returns a list of LBA ranges with >> +their respective states. >> + >> +* `NBD_CMD_GET_LBA_STATUS` (7) >> + >> +An LBA range

Re: [Nbd] [PATCH 2/2] NBD proto: add GET_LBA_STATUS extension

2016-03-24 Thread Pavel Borzenkov
On Thu, Mar 24, 2016 at 09:41:29AM +0100, Wouter Verhelst wrote: > On Thu, Mar 24, 2016 at 11:25:52AM +0300, Pavel Borzenkov wrote: > > On Wed, Mar 23, 2016 at 07:14:54PM +0100, Kevin Wolf wrote: > > > Am 23.03.2016 um 18:58 hat Wouter Verhelst geschrieben: > > > > On Wed, Mar 23, 2016 at

Re: [Nbd] [PATCH 2/2] NBD proto: add GET_LBA_STATUS extension

2016-03-24 Thread Alex Bligh
On 24 Mar 2016, at 09:33, Wouter Verhelst wrote: > Now I'm not saying we > need to fully define what it means for a part of the backend to be > "dirty" or not. It's okay to leave part of the meaning in the dark, > leaving that implementation-defined. Well, the 3 possible states

Re: [Nbd] [PATCH 2/2] NBD proto: add GET_LBA_STATUS extension

2016-03-24 Thread Wouter Verhelst
On Thu, Mar 24, 2016 at 11:43:18AM +0300, Pavel Borzenkov wrote: > On Wed, Mar 23, 2016 at 06:58:34PM +0100, Wouter Verhelst wrote: > > On Wed, Mar 23, 2016 at 05:16:02PM +0300, Denis V. Lunev wrote: > > > +2. Block dirtiness state > > > + > > > +Upon receiving an `NBD_CMD_GET_LBA_STATUS`

Re: [Nbd] [PATCH 2/2] NBD proto: add GET_LBA_STATUS extension

2016-03-24 Thread Pavel Borzenkov
On Wed, Mar 23, 2016 at 06:58:34PM +0100, Wouter Verhelst wrote: > On Wed, Mar 23, 2016 at 05:16:02PM +0300, Denis V. Lunev wrote: > > From: Pavel Borzenkov > > > > With the availability of sparse storage formats, it is often needed to > > query status of a particular

Re: [Nbd] [PATCH 2/2] NBD proto: add GET_LBA_STATUS extension

2016-03-24 Thread Wouter Verhelst
On Thu, Mar 24, 2016 at 11:25:52AM +0300, Pavel Borzenkov wrote: > On Wed, Mar 23, 2016 at 07:14:54PM +0100, Kevin Wolf wrote: > > Am 23.03.2016 um 18:58 hat Wouter Verhelst geschrieben: > > > On Wed, Mar 23, 2016 at 05:16:02PM +0300, Denis V. Lunev wrote: > > > > +the provisioning state of

Re: [Nbd] [PATCH 2/2] NBD proto: add GET_LBA_STATUS extension

2016-03-23 Thread Kevin Wolf
Am 23.03.2016 um 18:58 hat Wouter Verhelst geschrieben: > On Wed, Mar 23, 2016 at 05:16:02PM +0300, Denis V. Lunev wrote: > > +The type of information required by the client is passed to server in > > the > > +command flags field. If the server does not implement requested type or > > +

Re: [Nbd] [PATCH 2/2] NBD proto: add GET_LBA_STATUS extension

2016-03-23 Thread Wouter Verhelst
On Wed, Mar 23, 2016 at 05:16:02PM +0300, Denis V. Lunev wrote: > From: Pavel Borzenkov > > With the availability of sparse storage formats, it is often needed to > query status of a particular LBA range and read only those blocks of > data that are actually present on