Cross-project NBD extension proposal: NBD_INFO_INIT_STATE

2020-02-10 Thread Eric Blake
I will be following up to this email with four separate threads each addressed to the appropriate single list, with proposed changes to: - the NBD protocol - qemu: both server and client - libnbd: client - nbdkit: server The feature in question adds a new optional NBD_INFO_ packet to the NBD_OP

Re: Cross-project NBD extension proposal: NBD_INFO_INIT_STATE

2020-02-10 Thread Richard W.M. Jones
On Mon, Feb 10, 2020 at 03:37:20PM -0600, Eric Blake wrote: > For now, only 2 of those 16 bits are defined: NBD_INIT_SPARSE (the > image has at least one hole) and NBD_INIT_ZERO (the image reads > completely as zero); the two bits are orthogonal and can be set > independently, although it is easy e

Re: Cross-project NBD extension proposal: NBD_INFO_INIT_STATE

2020-02-10 Thread Eric Blake
On 2/10/20 4:12 PM, Richard W.M. Jones wrote: On Mon, Feb 10, 2020 at 03:37:20PM -0600, Eric Blake wrote: For now, only 2 of those 16 bits are defined: NBD_INIT_SPARSE (the image has at least one hole) and NBD_INIT_ZERO (the image reads completely as zero); the two bits are orthogonal and can be

Re: Cross-project NBD extension proposal: NBD_INFO_INIT_STATE

2020-02-10 Thread Richard W.M. Jones
On Mon, Feb 10, 2020 at 04:29:53PM -0600, Eric Blake wrote: > On 2/10/20 4:12 PM, Richard W.M. Jones wrote: > >On Mon, Feb 10, 2020 at 03:37:20PM -0600, Eric Blake wrote: > >>For now, only 2 of those 16 bits are defined: NBD_INIT_SPARSE (the > >>image has at least one hole) and NBD_INIT_ZERO (the i

Re: Cross-project NBD extension proposal: NBD_INFO_INIT_STATE

2020-02-11 Thread Eric Blake
On 2/10/20 4:52 PM, Richard W.M. Jones wrote: On Mon, Feb 10, 2020 at 04:29:53PM -0600, Eric Blake wrote: On 2/10/20 4:12 PM, Richard W.M. Jones wrote: On Mon, Feb 10, 2020 at 03:37:20PM -0600, Eric Blake wrote: For now, only 2 of those 16 bits are defined: NBD_INIT_SPARSE (the image has at le

Re: Cross-project NBD extension proposal: NBD_INFO_INIT_STATE

2020-02-11 Thread Wouter Verhelst
Hi, On Mon, Feb 10, 2020 at 10:52:55PM +, Richard W.M. Jones wrote: > But anyway ... could a flag indicating that the whole image is sparse > be useful, either as well as NBD_INIT_SPARSE or instead of it? You > could use it to avoid an initial disk trim, which is something that > mke2fs does:

Re: Cross-project NBD extension proposal: NBD_INFO_INIT_STATE

2020-02-12 Thread Eric Blake
On 2/12/20 1:27 AM, Wouter Verhelst wrote: Hi, On Mon, Feb 10, 2020 at 10:52:55PM +, Richard W.M. Jones wrote: But anyway ... could a flag indicating that the whole image is sparse be useful, either as well as NBD_INIT_SPARSE or instead of it? You could use it to avoid an initial disk trim

Re: Cross-project NBD extension proposal: NBD_INFO_INIT_STATE

2020-02-12 Thread Richard W.M. Jones
On Wed, Feb 12, 2020 at 06:09:11AM -0600, Eric Blake wrote: > On 2/12/20 1:27 AM, Wouter Verhelst wrote: > >Hi, > > > >On Mon, Feb 10, 2020 at 10:52:55PM +, Richard W.M. Jones wrote: > >>But anyway ... could a flag indicating that the whole image is sparse > >>be useful, either as well as NBD

Re: Cross-project NBD extension proposal: NBD_INFO_INIT_STATE

2020-02-12 Thread Eric Blake
On 2/12/20 6:36 AM, Richard W.M. Jones wrote: Okay, in v2, I will start with just two bits, NBD_INIT_SPARSE (entire image is sparse, nothing is allocated) and NBD_INIT_ZERO (entire image reads as zero), and save any future bits for later additions. Do we think that 16 bits is sufficient for the

Re: Cross-project NBD extension proposal: NBD_INFO_INIT_STATE

2020-02-17 Thread Max Reitz
Hi, It’s my understanding that without some is_zero infrastructure for QEMU, it’s impossible to implement this flag in qemu’s NBD server. At the same time, I still haven’t understood what we need the flag for. As far as I understood in our discussion on your qemu series, there is no case where a

Re: Cross-project NBD extension proposal: NBD_INFO_INIT_STATE

2020-02-18 Thread Eric Blake
On 2/17/20 9:13 AM, Max Reitz wrote: Hi, It’s my understanding that without some is_zero infrastructure for QEMU, it’s impossible to implement this flag in qemu’s NBD server. You're right that we may need some more infrastructure before being able to decide when to report this bit in all case

Re: Cross-project NBD extension proposal: NBD_INFO_INIT_STATE

2020-02-19 Thread Max Reitz
On 18.02.20 21:55, Eric Blake wrote: > On 2/17/20 9:13 AM, Max Reitz wrote: >> Hi, >> >> It’s my understanding that without some is_zero infrastructure for QEMU, >> it’s impossible to implement this flag in qemu’s NBD server. > > You're right that we may need some more infrastructure before being