Re: [Qemu-block] [PATCH] qemu-io: Don't leak pattern file in error path

2019-09-10 Thread Stefano Garzarella
int, but let's do it > anyway in case someone later adds a 'goto error' after closing the file. > > Coverity: CID 1405303 > Fixes: 4d731510d34f280ed45a6de621d016f67a49ea48 > Signed-off-by: Kevin Wolf > --- > qemu-io-cmds.c | 4 > 1 file changed, 4 insertions(+) Reviewed-by: Stefano Garzarella

Re: [Qemu-block] [PATCH v7 1/4] block: Add zoned device model property

2019-09-09 Thread Stefano Garzarella
files changed, 53 insertions(+), 13 deletions(-) > Acked-by: Stefano Garzarella

Re: [Qemu-block] [Qemu-devel] [PATCH v6 1/4] block: Add zoned device model property

2019-09-06 Thread Stefano Garzarella
On Fri, Sep 06, 2019 at 04:17:12PM +, Dmitry Fomichev wrote: > On Fri, 2019-09-06 at 10:11 +0200, Stefano Garzarella wrote: > > On Wed, Sep 04, 2019 at 05:00:57PM -0400, Dmitry Fomichev wrote: > > > This commit adds Zoned Device Model (as defined in T10 ZBC and > > &

Re: [Qemu-block] [Qemu-devel] [PATCH v6 1/4] block: Add zoned device model property

2019-09-06 Thread Stefano Garzarella
On Wed, Sep 04, 2019 at 05:00:57PM -0400, Dmitry Fomichev wrote: > This commit adds Zoned Device Model (as defined in T10 ZBC and > T13 ZAC standards) as a block driver property, along with some > useful access functions. > > A new backend driver permission, BLK_PERM_SUPPORT_HM_ZONED, is also > in

Re: [Qemu-block] [PATCH 0/2] git.orderfile: Order Python/shell scripts before unordered files

2019-08-29 Thread Stefano Garzarella
; Philippe Mathieu-Daudé (2): > scripts/git.orderfile: Order Python files before unordered ones > scripts/git.orderfile: Order shell scripts before unordered files > > scripts/git.orderfile | 5 + > 1 file changed, 5 insertions(+) Reviewed-by: Stefano Garzarella Thanks, Stefano

Re: [Qemu-block] [PATCH 0/2] block/file-posix: Reduce xfsctl() use

2019-08-28 Thread Stefano Garzarella
/file-posix: Reduce xfsctl() use" patch and the failure rate is ~30% on my system. With the patch applied the failure rate is 0% :-) Reviewed-by: Stefano Garzarella Tested-by: Stefano Garzarella Thanks, Stefano

Re: [Qemu-block] [PATCH v3] block/rbd: add preallocation support

2019-07-29 Thread Stefano Garzarella
On Fri, Jul 26, 2019 at 08:46:56AM -0400, Jason Dillaman wrote: > On Fri, Jul 26, 2019 at 4:48 AM Stefano Garzarella > wrote: > > > > On Thu, Jul 25, 2019 at 09:30:30AM -0400, Jason Dillaman wrote: > > > On Thu, Jul 25, 2019 at 4:13 AM Stefano Garzarella > >

Re: [Qemu-block] [PATCH v2 03/11] block: Add bdrv_has_zero_init_truncate()

2019-07-26 Thread Stefano Garzarella
On Fri, Jul 26, 2019 at 12:58:58PM +0200, Max Reitz wrote: > On 26.07.19 11:04, Stefano Garzarella wrote: > > On Wed, Jul 24, 2019 at 07:12:31PM +0200, Max Reitz wrote: > >> No .bdrv_has_zero_init() implementation returns 1 if growing the file > >> would add no

Re: [Qemu-block] [PATCH v2 04/11] block: Implement .bdrv_has_zero_init_truncate()

2019-07-26 Thread Stefano Garzarella
/qed.c| 1 + > block/raw-format.c | 6 ++ > block/rbd.c| 1 + > block/sheepdog.c | 1 + > block/ssh.c| 1 + > 10 files changed, 18 insertions(+) > LGTM. Reviewed-by: Stefano Garzarella Thanks, Stefano > diff --git a/block/file-posix.c b/block/file-posix.

Re: [Qemu-block] [PATCH v2 05/11] block: Use bdrv_has_zero_init_truncate()

2019-07-26 Thread Stefano Garzarella
has_zero_init(bs->file->bs) == 0) { > +if (bdrv_has_zero_init_truncate(bs->file->bs) == 0) { > use_zero_buffers = true; > > /* zero fill the front, if any */ > -- > 2.21.0 > What about describing in the commit message why we are using bdrv_has_zero_init_truncate() like in the cover letter? With or without: Reviewed-by: Stefano Garzarella Thanks, Stefano

Re: [Qemu-block] [PATCH v2 01/11] qemu-img: Fix bdrv_has_zero_init() use in convert

2019-07-26 Thread Stefano Garzarella
target_is_new = !skip_create; > + > flags = s.min_sparse ? (BDRV_O_RDWR | BDRV_O_UNMAP) : BDRV_O_RDWR; > ret = bdrv_parse_cache_mode(cache, &flags, &writethrough); > if (ret < 0) { Make sense! Reviewed-by: Stefano Garzarella Thanks, Stefano

Re: [Qemu-block] [PATCH v2 03/11] block: Add bdrv_has_zero_init_truncate()

2019-07-26 Thread Stefano Garzarella
On Wed, Jul 24, 2019 at 07:12:31PM +0200, Max Reitz wrote: > No .bdrv_has_zero_init() implementation returns 1 if growing the file > would add non-zero areas (at least with PREALLOC_MODE_OFF), so using it > in lieu of this new function was always safe. > > But on the other hand, it is possible tha

Re: [Qemu-block] [PATCH v3] block/rbd: add preallocation support

2019-07-26 Thread Stefano Garzarella
On Thu, Jul 25, 2019 at 09:30:30AM -0400, Jason Dillaman wrote: > On Thu, Jul 25, 2019 at 4:13 AM Stefano Garzarella > wrote: > > > > On Wed, Jul 24, 2019 at 01:48:42PM -0400, Jason Dillaman wrote: > > > On Tue, Jul 23, 2019 at 3:13 AM Stefano Garzarella > > &g

Re: [Qemu-block] [PATCH v3] block/rbd: add preallocation support

2019-07-25 Thread Stefano Garzarella
On Wed, Jul 24, 2019 at 01:48:42PM -0400, Jason Dillaman wrote: > On Tue, Jul 23, 2019 at 3:13 AM Stefano Garzarella > wrote: > > > > This patch adds the support of preallocation (off/full) for the RBD > > block driver. > > If rbd_writesame() is available and s

[Qemu-block] [PATCH v3] block/rbd: add preallocation support

2019-07-23 Thread Stefano Garzarella
This patch adds the support of preallocation (off/full) for the RBD block driver. If rbd_writesame() is available and supports zeroed buffers, we use it to quickly fill the image when full preallocation is required. Signed-off-by: Stefano Garzarella --- v3: - rebased on master - filled with

Re: [Qemu-block] [PATCH for-4.1? 0/4] block: Fix three .bdrv_has_zero_init()s

2019-07-15 Thread Stefano Garzarella
; So that leaves three cases to fix, which are the first three patches in > this series. The final patch adds a test case for qcow2. (It’s > difficult to test the other drivers, because that would require a > protocol driver with image creation support and has_zero_init=0, which > is

[Qemu-block] [PATCH v2] gluster: fix .bdrv_reopen_prepare when backing file is a JSON object

2019-07-15 Thread Stefano Garzarella
lready parsed. Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1542445 Signed-off-by: Stefano Garzarella --- v2: - check if 'state->bs->exact_filename' is empty, instead to parse 'state->bs->filename' to check if it contains "json:"

Re: [Qemu-block] [PATCH] gluster: fix .bdrv_reopen_prepare when backing file is a JSON object

2019-07-15 Thread Stefano Garzarella
On Mon, Jul 15, 2019 at 03:00:29PM +0200, Max Reitz wrote: > On 15.07.19 14:50, Stefano Garzarella wrote: > > On Mon, Jul 15, 2019 at 12:53:57PM +0200, Max Reitz wrote: > >> On 15.07.19 10:16, Stefano Garzarella wrote: > >>> On Fri, Jul 12, 2019 at 08:35:12PM +02

Re: [Qemu-block] [PATCH] gluster: fix .bdrv_reopen_prepare when backing file is a JSON object

2019-07-15 Thread Stefano Garzarella
On Mon, Jul 15, 2019 at 12:53:57PM +0200, Max Reitz wrote: > On 15.07.19 10:16, Stefano Garzarella wrote: > > On Fri, Jul 12, 2019 at 08:35:12PM +0200, Max Reitz wrote: > >> On 12.07.19 12:46, Stefano Garzarella wrote: > >>> When the backing_file is s

Re: [Qemu-block] [PATCH v3] LUKS: support preallocation

2019-07-15 Thread Stefano Garzarella
On Sun, Jul 14, 2019 at 05:51:51PM +0300, Maxim Levitsky wrote: > On Thu, 2019-07-11 at 18:27 +0200, Stefano Garzarella wrote: > > On Thu, Jul 11, 2019 at 06:09:40PM +0300, Maxim Levitsky wrote: > > > preallocation=off and preallocation=metadata > > > both all

Re: [Qemu-block] [PATCH] gluster: fix .bdrv_reopen_prepare when backing file is a JSON object

2019-07-15 Thread Stefano Garzarella
On Fri, Jul 12, 2019 at 08:35:12PM +0200, Max Reitz wrote: > On 12.07.19 12:46, Stefano Garzarella wrote: > > When the backing_file is specified as a JSON object, the > > qemu_gluster_reopen_prepare() fails with this message: > > invalid URI json:{"server.0.host&qu

Re: [Qemu-block] [PATCH] doc: Preallocation does not require writing zeroes

2019-07-15 Thread Stefano Garzarella
On Fri, Jul 12, 2019 at 08:33:14PM +0200, Max Reitz wrote: > On 12.07.19 12:27, Stefano Garzarella wrote: > > On Thu, Jul 11, 2019 at 03:29:35PM +0200, Max Reitz wrote: > >> When preallocating an encrypted qcow2 image, it just lets the protocol > >> driver write data

[Qemu-block] [PATCH] gluster: fix .bdrv_reopen_prepare when backing file is a JSON object

2019-07-12 Thread Stefano Garzarella
lready parsed. Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1542445 Signed-off-by: Stefano Garzarella --- block/gluster.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/block/gluster.c b/block/gluster.c index 62f8ff2147..26971db1ea 100644 --- a/block/gluster.

Re: [Qemu-block] [PATCH] doc: Preallocation does not require writing zeroes

2019-07-12 Thread Stefano Garzarella
On Thu, Jul 11, 2019 at 03:29:35PM +0200, Max Reitz wrote: > When preallocating an encrypted qcow2 image, it just lets the protocol > driver write data and then does not mark the clusters as zero. > Therefore, reading this image will yield effectively random data. > > As such, we have not fulfille

Re: [Qemu-block] [PATCH v3] LUKS: support preallocation

2019-07-11 Thread Stefano Garzarella
On Thu, Jul 11, 2019 at 06:09:40PM +0300, Maxim Levitsky wrote: > preallocation=off and preallocation=metadata > both allocate luks header only, and preallocation=falloc/full > is passed to underlying file. > > Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1534951 > > Signed-off-by: Maxim Le

Re: [Qemu-block] [PATCH v3] block/rbd: implement .bdrv_get_allocated_file_size callback

2019-07-10 Thread Stefano Garzarella
On Tue, Jul 09, 2019 at 09:42:14PM -0400, Jason Dillaman wrote: > On Tue, Jul 9, 2019 at 11:32 AM Max Reitz wrote: > > On 09.07.19 15:09, Stefano Garzarella wrote: > > > > > > Max, Jason, thanks for the details! > > > > > > If you agree, I'll tr

Re: [Qemu-block] [PATCH v3] block/rbd: implement .bdrv_get_allocated_file_size callback

2019-07-09 Thread Stefano Garzarella
On Tue, Jul 09, 2019 at 08:55:19AM -0400, Jason Dillaman wrote: > On Tue, Jul 9, 2019 at 5:45 AM Max Reitz wrote: > > > > On 09.07.19 10:55, Max Reitz wrote: > > > On 09.07.19 05:08, Jason Dillaman wrote: > > >> On Fri, Jul 5, 2019 at 6:43 AM Stefano Garzarell

Re: [Qemu-block] [PATCH v3] block/rbd: implement .bdrv_get_allocated_file_size callback

2019-07-05 Thread Stefano Garzarella
On Fri, Jul 05, 2019 at 11:58:43AM +0200, Max Reitz wrote: > On 05.07.19 11:32, Stefano Garzarella wrote: > > This patch allows 'qemu-img info' to show the 'disk size' for > > the RBD images that have the fast-diff feature enabled. > > > > If this f

[Qemu-block] [PATCH v3] block/rbd: implement .bdrv_get_allocated_file_size callback

2019-07-05 Thread Stefano Garzarella
This patch allows 'qemu-img info' to show the 'disk size' for the RBD images that have the fast-diff feature enabled. If this feature is enabled, we use the rbd_diff_iterate2() API to calculate the allocated size for the image. Signed-off-by: Stefano Garzarella --- v3:

Re: [Qemu-block] [PATCH v2] block/rbd: implement .bdrv_get_allocated_file_size callback

2019-07-03 Thread Stefano Garzarella
On Tue, Jul 02, 2019 at 11:09:14AM -0400, Jason Dillaman wrote: > On Fri, Jun 28, 2019 at 4:59 AM Stefano Garzarella > wrote: > > > > On Thu, Jun 27, 2019 at 03:43:04PM -0400, Jason Dillaman wrote: > > > On Thu, Jun 27, 2019 at 1:24 PM John Snow wrote: > >

Re: [Qemu-block] [PATCH v2] block/rbd: implement .bdrv_get_allocated_file_size callback

2019-06-28 Thread Stefano Garzarella
On Thu, Jun 27, 2019 at 03:43:04PM -0400, Jason Dillaman wrote: > On Thu, Jun 27, 2019 at 1:24 PM John Snow wrote: > > On 6/27/19 4:48 AM, Stefano Garzarella wrote: > > > On Wed, Jun 26, 2019 at 05:04:25PM -0400, John Snow wrote: > > >> It looks like this has hit a

Re: [Qemu-block] [PATCH v2] block/rbd: implement .bdrv_get_allocated_file_size callback

2019-06-27 Thread Stefano Garzarella
> On 5/10/19 11:33 AM, Stefano Garzarella wrote: > > This patch allows 'qemu-img info' to show the 'disk size' for > > the RBD images that have the fast-diff feature enabled. > > > > If this feature is enabled, we use the rbd_diff_iterate2

Re: [Qemu-block] [PATCH v2] block/rbd: add preallocation support

2019-06-26 Thread Stefano Garzarella
On Tue, Jun 25, 2019 at 06:06:02PM +0200, Max Reitz wrote: > On 06.05.19 14:23, Stefano Garzarella wrote: > > This patch adds the support of preallocation (off/full) for the RBD > > block driver. > > If available, we use rbd_writesame() to quickly fill the image when >

Re: [Qemu-block] [PATCH v3] block/rbd: increase dynamically the image size

2019-06-25 Thread Stefano Garzarella
On Tue, Jun 25, 2019 at 04:57:53PM +0200, Max Reitz wrote: > On 25.06.19 16:47, Stefano Garzarella wrote: > > On Tue, Jun 25, 2019 at 04:02:04PM +0200, Max Reitz wrote: > >> On 09.05.19 16:59, Stefano Garzarella wrote: > >>> RBD APIs don't allow us t

Re: [Qemu-block] [PATCH v3] block/rbd: increase dynamically the image size

2019-06-25 Thread Stefano Garzarella
On Tue, Jun 25, 2019 at 04:02:04PM +0200, Max Reitz wrote: > On 09.05.19 16:59, Stefano Garzarella wrote: > > RBD APIs don't allow us to write more than the size set with > > rbd_create() or rbd_resize(). > > In order to support growing images (eg. qcow2), we resize

Re: [Qemu-block] [PATCH v3] block/rbd: increase dynamically the image size

2019-06-25 Thread Stefano Garzarella
Ping. Thanks, Stefano On Tue, May 21, 2019 at 10:56 AM Stefano Garzarella wrote: > > Kindly ping. > > Thanks, > Stefano > > On Thu, May 09, 2019 at 04:59:27PM +0200, Stefano Garzarella wrote: > > RBD APIs don't allow us to write more than the size set wit

Re: [Qemu-block] [PATCH v7 0/9] discard blockstats

2019-06-06 Thread Stefano Garzarella
On Tue, Jun 04, 2019 at 04:53:23PM +, Anton Nefedov wrote: > On 3/6/2019 1:09 PM, Stefano Garzarella wrote: > > On Tue, May 14, 2019 at 12:10:40PM +, Anton Nefedov wrote: > >> hi, > >> > >> yet another take for this patch series; please kindly consider

Re: [Qemu-block] [PATCH v7 0/9] discard blockstats

2019-06-03 Thread Stefano Garzarella
On Tue, May 14, 2019 at 12:10:40PM +, Anton Nefedov wrote: > hi, > > yet another take for this patch series; please kindly consider these for 4.1 > > Just a few cosmetic comments were received for v6 so this is mostly > a rebase+ping. > > new in v7: > - general rebase > - since claus

Re: [Qemu-block] [PATCH v4] qemu-io: add pattern file for write command

2019-05-31 Thread Stefano Garzarella
On Fri, May 31, 2019 at 06:21:13AM +, Denis Plotnikov wrote: > > > On 30.05.2019 11:26, Stefano Garzarella wrote: > > On Thu, May 30, 2019 at 11:10:55AM +0300, Denis Plotnikov wrote: > >> The patch allows to provide a pattern file for write > >> command. Th

Re: [Qemu-block] [PATCH v4] qemu-io: add pattern file for write command

2019-05-30 Thread Stefano Garzarella
On Thu, May 30, 2019 at 11:10:55AM +0300, Denis Plotnikov wrote: > The patch allows to provide a pattern file for write > command. There was no similar ability before. > > Signed-off-by: Denis Plotnikov > --- Hi Denis, for next versions I suggest to describe here, after the ---, the changes with

Re: [Qemu-block] [PATCH v2] qemu-io: add pattern file for write command

2019-05-30 Thread Stefano Garzarella
On Wed, May 29, 2019 at 02:46:24PM +0300, Denis Plotnikov wrote: > The patch allows to provide a pattern file for write > command. There was no similar ability before. > --- > qemu-io-cmds.c | 58 ++ > 1 file changed, 54 insertions(+), 4 deletions(-)

[Qemu-block] [PATCH v2 1/3] qapi/block-core: update documentation of preallocation parameter

2019-05-24 Thread Stefano Garzarella
Add default and available values in the documentation block of each block device or protocol that supports the 'preallocation' parameter during the image creation. Suggested-by: Markus Armbruster Signed-off-by: Stefano Garzarella Reviewed-by: Markus Armbruster --- qapi/block-core

[Qemu-block] [PATCH v2 2/3] block/file-posix: update .help of BLOCK_OPT_PREALLOC option

2019-05-24 Thread Stefano Garzarella
Show 'falloc' among the allowed values of 'preallocation' option, only when it is supported (if defined CONFIG_POSIX_FALLOCATE) Signed-off-by: Stefano Garzarella Reviewed-by: Markus Armbruster --- block/file-posix.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-)

[Qemu-block] [PATCH v2 0/3] Update documentation and help related to the preallocation parameter

2019-05-24 Thread Stefano Garzarella
moved references to "file-win32" and "file-posix" in the block comment [Markus] - Patch 3: reworded commit message [Markus] Stefano Garzarella (3): qapi/block-core: update documentation of preallocation parameter block/file-posix: update .help of BLOCK_OPT_PREALL

[Qemu-block] [PATCH v2 3/3] block/gluster: update .help of BLOCK_OPT_PREALLOC option

2019-05-24 Thread Stefano Garzarella
Add missing 'falloc' among the allowed values of 'preallocation' option; show it and 'full' only when they are supported. ('falloc' is supported if defined CONFIG_GLUSTERFS_FALLOCATE, 'full' is supported if defined CONFIG_GLUSTERFS_ZEROFILL) Sign

Re: [Qemu-block] [Qemu-devel] [PATCH 3/3] block/gluster: update .help of BLOCK_OPT_PREALLOC option

2019-05-24 Thread Stefano Garzarella
On Thu, May 23, 2019 at 06:35:18PM +0200, Markus Armbruster wrote: > Stefano Garzarella writes: > > > Show 'falloc' and 'full' among the allowed values of > > 'preallocation' option, only when they are supported > > ('falloc'

Re: [Qemu-block] [Qemu-devel] [PATCH 1/3] qapi/block-core: update documentation of preallocation parameter

2019-05-24 Thread Stefano Garzarella
On Thu, May 23, 2019 at 06:33:06PM +0200, Markus Armbruster wrote: > Stefano Garzarella writes: > > > Add default and available values in the documentation block of > > each block device or protocol that supports the 'preallocation' > > parameter during the im

[Qemu-block] [PATCH 3/3] block/gluster: update .help of BLOCK_OPT_PREALLOC option

2019-05-23 Thread Stefano Garzarella
Show 'falloc' and 'full' among the allowed values of 'preallocation' option, only when they are supported ('falloc' is support if defined CONFIG_GLUSTERFS_FALLOCATE, 'full' is support if defined CONFIG_GLUSTERFS_ZEROFILL) Signed-off-by: Stefano

[Qemu-block] [PATCH 0/3] Update documentation and help related to the preallocation parameter

2019-05-23 Thread Stefano Garzarella
Following Markus' advice, I updated the documentation of preallocation parameter in qapi/block-core.json adding default and allowed values (patch 1). I also updated the help related to BLOCK_OPT_PREALLOC in the QemuOptsList of file-posix (patch 2) and gluster (patch 3). Stefano Garzarel

[Qemu-block] [PATCH 2/3] block/file-posix: update .help of BLOCK_OPT_PREALLOC option

2019-05-23 Thread Stefano Garzarella
Show 'falloc' among the allowed values of 'preallocation' option, only when it is supported (if defined CONFIG_POSIX_FALLOCATE) Signed-off-by: Stefano Garzarella --- block/file-posix.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/block/file-

[Qemu-block] [PATCH 1/3] qapi/block-core: update documentation of preallocation parameter

2019-05-23 Thread Stefano Garzarella
Add default and available values in the documentation block of each block device or protocol that supports the 'preallocation' parameter during the image creation. Suggested-by: Markus Armbruster Signed-off-by: Stefano Garzarella --- qapi/block-core.json | 20 ++

Re: [Qemu-block] [Qemu-devel] Use of PreallocMode in block drivers

2019-05-23 Thread Stefano Garzarella
On Wed, May 22, 2019 at 06:25:17PM +0200, Markus Armbruster wrote: > Stefano Garzarella writes: > > > On Wed, May 8, 2019 at 1:44 PM Markus Armbruster wrote: > >> > >> Stefano Garzarella writes: > >> > >> > On Tue, May 07, 2019 at 08:34:51AM

Re: [Qemu-block] [Qemu-devel] Use of PreallocMode in block drivers

2019-05-22 Thread Stefano Garzarella
On Wed, May 8, 2019 at 1:44 PM Markus Armbruster wrote: > > Stefano Garzarella writes: > > > On Tue, May 07, 2019 at 08:34:51AM +0200, Markus Armbruster wrote: > >> Cc: Peter for a libvirt perspective. > >> > >> Stefano Garzarella writes: > >>

Re: [Qemu-block] [PATCH v3] block/rbd: increase dynamically the image size

2019-05-21 Thread Stefano Garzarella
Kindly ping. Thanks, Stefano On Thu, May 09, 2019 at 04:59:27PM +0200, Stefano Garzarella wrote: > RBD APIs don't allow us to write more than the size set with > rbd_create() or rbd_resize(). > In order to support growing images (eg. qcow2), we resize the > image before writ

Re: [Qemu-block] [PATCH] block: Use BDRV_REQUEST_MAX_BYTES instead of BDRV_REQUEST_MAX_SECTORS

2019-05-14 Thread Stefano Garzarella
Alberto Garcia > --- > block/io.c | 6 +++--- > qemu-io-cmds.c | 7 +++ > 2 files changed, 6 insertions(+), 7 deletions(-) > Reviewed-by: Stefano Garzarella Thanks, Stefano

Re: [Qemu-block] [Qemu-devel] [PATCH] qcow2: Define and use QCOW2_COMPRESSED_SECTOR_SIZE

2019-05-13 Thread Stefano Garzarella
On Mon, May 13, 2019 at 01:48:27PM +0200, Alberto Garcia wrote: > On Mon 13 May 2019 01:28:46 PM CEST, Stefano Garzarella wrote: > >> +int size = QCOW2_COMPRESSED_SECTOR_SIZE * > >> +(((l2_entry >> s->csize_shift) & s->csize_mask) +

Re: [Qemu-block] [Qemu-devel] [PATCH] qcow2: Define and use QCOW2_COMPRESSED_SECTOR_SIZE

2019-05-13 Thread Stefano Garzarella
The patch LGTM, just a comment below. On Fri, May 10, 2019 at 07:22:54PM +0300, Alberto Garcia wrote: > When an L2 table entry points to a compressed cluster the space used > by the data is specified in 512-byte sectors. This size is independent > from BDRV_SECTOR_SIZE and is specific to the qcow2

Re: [Qemu-block] [PATCH] nbd/server: Nicer spelling of max BLOCK_STATUS reply length

2019-05-13 Thread Stefano Garzarella
> uint64_t handle, >uint32_t context_id, Error **errp) > { > int ret; > -unsigned int nb_extents = dont_fragment ? 1 : NBD_MAX_BITMAP_EXTENTS; > +unsigned int nb_extents = dont_fragment ? 1 : > NBD_MAX_BLOCK_STATUS_EXTENTS; > NBDExtent *extents = g_new(NBDExtent, nb_extents); > uint64_t final_length = length; With or without changing the comment: Reviewed-by: Stefano Garzarella

[Qemu-block] [PATCH v2] block/rbd: implement .bdrv_get_allocated_file_size callback

2019-05-10 Thread Stefano Garzarella
This patch allows 'qemu-img info' to show the 'disk size' for the RBD images that have the fast-diff feature enabled. If this feature is enabled, we use the rbd_diff_iterate2() API to calculate the allocated size for the image. Signed-off-by: Stefano Garzarella --- v2: -

Re: [Qemu-block] [Qemu-devel] Use of PreallocMode in block drivers

2019-05-10 Thread Stefano Garzarella
On Thu, May 09, 2019 at 03:29:13PM +0200, Peter Krempa wrote: > On Thu, May 09, 2019 at 10:26:46 +0200, Stefano Garzarella wrote: > > On Wed, May 08, 2019 at 01:44:27PM +0200, Markus Armbruster wrote: > > > Stefano Garzarella writes: > > > > > > > On Tue, M

Re: [Qemu-block] [Qemu-devel] Use of PreallocMode in block drivers

2019-05-10 Thread Stefano Garzarella
On Thu, May 09, 2019 at 02:07:34PM +0200, Markus Armbruster wrote: > Stefano Garzarella writes: > > > On Wed, May 08, 2019 at 01:44:27PM +0200, Markus Armbruster wrote: > >> Stefano Garzarella writes: > >> > >> > On Tue, May 07, 2019 at 08:34:51AM

[Qemu-block] [PATCH v3] block/rbd: increase dynamically the image size

2019-05-09 Thread Stefano Garzarella
RBD APIs don't allow us to write more than the size set with rbd_create() or rbd_resize(). In order to support growing images (eg. qcow2), we resize the image before write operations that exceed the current size. Signed-off-by: Stefano Garzarella --- v3: - add 'image_size

Re: [Qemu-block] [Qemu-devel] Use of PreallocMode in block drivers

2019-05-09 Thread Stefano Garzarella
On Wed, May 08, 2019 at 01:44:27PM +0200, Markus Armbruster wrote: > Stefano Garzarella writes: > > > On Tue, May 07, 2019 at 08:34:51AM +0200, Markus Armbruster wrote: > >> Cc: Peter for a libvirt perspective. > >> > >> Stefano Garzarella writes: >

[Qemu-block] [PATCH] qemu-img: Use IEC binary prefixes for size constants

2019-05-08 Thread Stefano Garzarella
Using IEC binary prefixes in order to make the code more readable. Signed-off-by: Stefano Garzarella --- qemu-img.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index e6ad5978e0..71c92f142a 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -37,6

Re: [Qemu-block] [Qemu-devel] [PATCH v2] block/rbd: increase dynamically the image size

2019-05-08 Thread Stefano Garzarella
On Tue, May 07, 2019 at 11:43:50AM +0200, Kevin Wolf wrote: > Am 06.05.2019 um 11:50 hat Stefano Garzarella geschrieben: > > On Fri, May 03, 2019 at 01:21:23PM -0400, Jason Dillaman wrote: > > > On Fri, May 3, 2019 at 12:30 PM Stefano Garzarella > > > wrote: > >

Re: [Qemu-block] [Qemu-devel] Use of PreallocMode in block drivers (was: [PATCH] block/rbd: add preallocation support)

2019-05-07 Thread Stefano Garzarella
On Tue, May 07, 2019 at 08:34:51AM +0200, Markus Armbruster wrote: > Cc: Peter for a libvirt perspective. > > Stefano Garzarella writes: > > > This patch adds the support of preallocation (off/full) for the RBD > > block driver. > > If available, we use rbd_writesa

[Qemu-block] [PATCH v2] block/rbd: add preallocation support

2019-05-06 Thread Stefano Garzarella
This patch adds the support of preallocation (off/full) for the RBD block driver. If available, we use rbd_writesame() to quickly fill the image when full preallocation is required. Signed-off-by: Stefano Garzarella --- v2: - Use 4 KiB buffer for rbd_writesame() [Jason] - Use

Re: [Qemu-block] [Qemu-devel] [PATCH v2] block/rbd: increase dynamically the image size

2019-05-06 Thread Stefano Garzarella
On Fri, May 03, 2019 at 01:21:23PM -0400, Jason Dillaman wrote: > On Fri, May 3, 2019 at 12:30 PM Stefano Garzarella > wrote: > > > > RBD APIs don't allow us to write more than the size set with > > rbd_create() or rbd_resize(). > > In order to support growin

Re: [Qemu-block] [QEMU PATCH] MAINTAINERS: Downgrade status of block sections without "M:" to "Odd Fixes"

2019-05-06 Thread Stefano Garzarella
Hi Thomas, On Mon, May 06, 2019 at 08:18:54AM +0200, Thomas Huth wrote: > Fixes might still get picked up via the qemu-block mailing list, > so the status is not "Orphan" yet. > Also add the gluster mailing list as suggested by Niels here: > > https://patchwork.kernel.org/patch/10613297/#2240994

[Qemu-block] [PATCH v2] block/rbd: increase dynamically the image size

2019-05-03 Thread Stefano Garzarella
RBD APIs don't allow us to write more than the size set with rbd_create() or rbd_resize(). In order to support growing images (eg. qcow2), we resize the image before write operations that exceed the current size. Signed-off-by: Stefano Garzarella --- v2: - use bs->total_sectors in

Re: [Qemu-block] [PATCH] block/rbd: implement .bdrv_get_allocated_file_size callback

2019-05-03 Thread Stefano Garzarella
On Fri, May 03, 2019 at 07:55:01AM -0400, Jason Dillaman wrote: > On Fri, May 3, 2019 at 7:02 AM Stefano Garzarella wrote: > > > > This patch allows 'qemu-img info' to show the 'disk size' for > > rbd images. We use the rbd_diff_iterate2() API to calcu

[Qemu-block] [PATCH] block/rbd: implement .bdrv_get_allocated_file_size callback

2019-05-03 Thread Stefano Garzarella
This patch allows 'qemu-img info' to show the 'disk size' for rbd images. We use the rbd_diff_iterate2() API to calculate the allocated size for the image. Signed-off-by: Stefano Garzarella --- block/rbd.c | 33 + 1 file changed, 33 inserti

Re: [Qemu-block] [PATCH] tests/qemu-iotests: Fix more reference output files due to recent qemu-io change

2019-05-02 Thread Stefano Garzarella
missing. > > Fixes: 99e98d7c9fc1a1639fad ("qemu-io: Use error_[gs]et_progname()") > Signed-off-by: Thomas Huth > --- > tests/qemu-iotests/059.out | 8 > tests/qemu-iotests/092.out | 24 > 2 files changed, 16 insertions(+), 16 deleti

Re: [Qemu-block] [Qemu-devel] [PATCH v5 2/3] block/io: bdrv_pdiscard: support int64_t bytes parameter

2019-05-02 Thread Stefano Garzarella
On Tue, Apr 30, 2019 at 10:41:02AM -0500, Eric Blake wrote: > On 4/30/19 6:09 AM, Kevin Wolf wrote: > > Am 30.04.2019 um 12:03 hat Vladimir Sementsov-Ogievskiy geschrieben: > >> 30.04.2019 12:24, Stefano Garzarella wrote: > >>> On Tue, Apr 23, 2019 at 03:57:05PM +0300

Re: [Qemu-block] [Qemu-devel] [PATCH v5 2/3] block/io: bdrv_pdiscard: support int64_t bytes parameter

2019-04-30 Thread Stefano Garzarella
On Tue, Apr 30, 2019 at 10:03:08AM +, Vladimir Sementsov-Ogievskiy wrote: > 30.04.2019 12:24, Stefano Garzarella wrote: > > On Tue, Apr 23, 2019 at 03:57:05PM +0300, Vladimir Sementsov-Ogievskiy > > wrote: > >> This fixes at least one overflow in qcow2_process_dis

Re: [Qemu-block] [Qemu-devel] [PATCH] [RFC] qcow2: add compression type feature

2019-04-30 Thread Stefano Garzarella
Hi Denis, few simple comments below regarding the CODING_STYLE (point 7. Comment style) On Tue, Feb 05, 2019 at 12:08:25PM +0300, Denis Plotnikov wrote: > The patch adds some preparation parts for incompatible compression type > feature into QCOW2 header that indicates that *all* compressed cluste

Re: [Qemu-block] [Qemu-devel] [PATCH 0/9] block: buffer-based io

2019-04-30 Thread Stefano Garzarella
| 4 +--- > qemu-img.c | 13 - > 11 files changed, 69 insertions(+), 62 deletions(-) > > -- > 2.18.0 > The series LGTM and new helpers could be very useful! Reviewed-by: Stefano Garzarella Thanks, Stefano

Re: [Qemu-block] [Qemu-devel] [PATCH v5 2/3] block/io: bdrv_pdiscard: support int64_t bytes parameter

2019-04-30 Thread Stefano Garzarella
On Tue, Apr 23, 2019 at 03:57:05PM +0300, Vladimir Sementsov-Ogievskiy wrote: > This fixes at least one overflow in qcow2_process_discards, which > passes 64bit region length to bdrv_pdiscard where bytes (or sectors in > the past) parameter is int since its introduction in 0b919fae. > > Signed-off

Re: [Qemu-block] [PATCH RFC 1/1] block/rbd: increase dynamically the image size

2019-04-29 Thread Stefano Garzarella
On Mon, Apr 29, 2019 at 04:30:14PM +0200, Kevin Wolf wrote: > Am 29.04.2019 um 16:04 hat Stefano Garzarella geschrieben: > > On Mon, Apr 29, 2019 at 12:25:10PM +0200, Kevin Wolf wrote: > > > Am 11.04.2019 um 12:50 hat Stefano Garzarella geschrieben: > > > > RBD API

Re: [Qemu-block] [PATCH] block/rbd: add preallocation support

2019-04-29 Thread Stefano Garzarella
On Mon, Apr 29, 2019 at 09:00:26AM -0400, Jason Dillaman wrote: > On Mon, Apr 29, 2019 at 8:47 AM Stefano Garzarella > wrote: > > > > On Sat, Apr 27, 2019 at 08:43:26AM -0400, Jason Dillaman wrote: > > > On Sat, Apr 27, 2019 at 7:37 AM Stefano Garzarella > > &g

Re: [Qemu-block] [PATCH RFC 1/1] block/rbd: increase dynamically the image size

2019-04-29 Thread Stefano Garzarella
On Mon, Apr 29, 2019 at 12:25:10PM +0200, Kevin Wolf wrote: > Am 11.04.2019 um 12:50 hat Stefano Garzarella geschrieben: > > RBD APIs don't allow us to write more than the size set with rbd_create() > > or rbd_resize(). > > In order to support growing images (eg. q

Re: [Qemu-block] [PATCH] block/rbd: add preallocation support

2019-04-29 Thread Stefano Garzarella
On Sat, Apr 27, 2019 at 08:43:26AM -0400, Jason Dillaman wrote: > On Sat, Apr 27, 2019 at 7:37 AM Stefano Garzarella > wrote: > > > > This patch adds the support of preallocation (off/full) for the RBD > > block driver. > > If available, we use rbd_writesame()

Re: [Qemu-block] [Qemu-devel] [PATCH RFC 1/1] block/rbd: increase dynamically the image size

2019-04-29 Thread Stefano Garzarella
On Mon, Apr 29, 2019 at 11:58:55AM +0200, Kevin Wolf wrote: > > Hm, this is an RFC patch, which suggests that it wasn't originally meant > to be merged as it is. Are you going to send a new version, or did it > turn out to be exactly what we want and the "RFC" tag was a mistake? I put the "RFC" t

[Qemu-block] [PATCH] block/rbd: add preallocation support

2019-04-27 Thread Stefano Garzarella
This patch adds the support of preallocation (off/full) for the RBD block driver. If available, we use rbd_writesame() to quickly fill the image when full preallocation is required. Signed-off-by: Stefano Garzarella --- block/rbd.c | 149

Re: [Qemu-block] [Qemu-devel] [PATCH RFC 1/1] block/rbd: increase dynamically the image size

2019-04-23 Thread Stefano Garzarella
On Tue, Apr 23, 2019 at 09:56:19AM +0200, Kevin Wolf wrote: > Am 19.04.2019 um 14:23 hat Stefano Garzarella geschrieben: > > Hi Kevin, > > > > On Wed, Apr 17, 2019 at 10:04:43AM +0200, Kevin Wolf wrote: > > > Am 17.04.2019 um 09:34 hat Stefano Garzarella geschrieben

Re: [Qemu-block] [Qemu-devel] [PATCH RFC 1/1] block/rbd: increase dynamically the image size

2019-04-19 Thread Stefano Garzarella
Hi Kevin, On Wed, Apr 17, 2019 at 10:04:43AM +0200, Kevin Wolf wrote: > Am 17.04.2019 um 09:34 hat Stefano Garzarella geschrieben: > > On Mon, Apr 15, 2019 at 10:04:52AM +0200, Kevin Wolf wrote: > > > > > > I think a potential actual use case could be persist

Re: [Qemu-block] [Qemu-devel] [PATCH] block: Fix AioContext switch for bs->drv == NULL

2019-04-18 Thread Stefano Garzarella
or command > issued from this paused state crashes the process. > > Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1631227 > Cc: qemu-sta...@nongnu.org > Signed-off-by: Kevin Wolf > --- > block.c | 12 ++-- > 1 file changed, 2 insertions(+), 10 deletions(-) > Reviewed-by: Stefano Garzarella

Re: [Qemu-block] [Qemu-devel] [PATCH RFC 1/1] block/rbd: increase dynamically the image size

2019-04-17 Thread Stefano Garzarella
On Mon, Apr 15, 2019 at 10:04:52AM +0200, Kevin Wolf wrote: > > I think a potential actual use case could be persistent dirty bitmaps > for incremental backup. Though maybe that would be better served by > using the rbd image just as a raw external data file and keeping the > qcow2 metadata on a f

Re: [Qemu-block] [Qemu-devel] [PATCH RFC 1/1] block/rbd: increase dynamically the image size

2019-04-14 Thread Stefano Garzarella
On Thu, Apr 11, 2019 at 01:06:49PM -0400, Jason Dillaman wrote: > On Thu, Apr 11, 2019 at 9:02 AM Stefano Garzarella > wrote: > > > > On Thu, Apr 11, 2019 at 08:35:44AM -0400, Jason Dillaman wrote: > > > On Thu, Apr 11, 2019 at 7:00 AM Stefano Garzarella > >

Re: [Qemu-block] [Qemu-devel] [PATCH RFC 1/1] block/rbd: increase dynamically the image size

2019-04-11 Thread Stefano Garzarella
On Thu, Apr 11, 2019 at 08:35:44AM -0400, Jason Dillaman wrote: > On Thu, Apr 11, 2019 at 7:00 AM Stefano Garzarella > wrote: > > > > RBD APIs don't allow us to write more than the size set with rbd_create() > > or rbd_resize(). > > In order to support growin

[Qemu-block] [PATCH RFC 1/1] block/rbd: increase dynamically the image size

2019-04-11 Thread Stefano Garzarella
RBD APIs don't allow us to write more than the size set with rbd_create() or rbd_resize(). In order to support growing images (eg. qcow2), we resize the image before RW operations that exceed the current size. Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1171007 Signed-off-by: St

[Qemu-block] [PATCH RFC 0/1] block/rbd: increase dynamically the image size

2019-04-11 Thread Stefano Garzarella
maximum size of the file, this means that all writes that exceed that size, fails and returns -22. As a workaround, I'm checking if the RW operations exceed the maximum size and then I'll resize the file. It works, but I'm not sure it is the right way. Any suggestions? Thanks,

Re: [Qemu-block] [Qemu-devel] [PATCH for-4.0] block: Forward 'discard' to temporary overlay

2019-04-04 Thread Stefano Garzarella
porary > overlay enables discard when it was requested for the drive. > > Signed-off-by: Kevin Wolf > --- > block.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > Reviewed-by: Stefano Garzarella

Re: [Qemu-block] [PATCH RFC] block/gluster: limit the transfer size to 512 MiB

2019-03-28 Thread Stefano Garzarella
On Thu, Mar 28, 2019 at 03:42:49PM +0100, Kevin Wolf wrote: > Am 28.03.2019 um 14:35 hat Stefano Garzarella geschrieben: > > On Thu, Mar 28, 2019 at 12:59:55PM +0100, Kevin Wolf wrote: > > > Am 28.03.2019 um 11:52 hat Stefano Garzarella geschrieben: > > > > Sever

Re: [Qemu-block] [PATCH RFC] block/gluster: limit the transfer size to 512 MiB

2019-03-28 Thread Stefano Garzarella
On Thu, Mar 28, 2019 at 12:59:55PM +0100, Kevin Wolf wrote: > Am 28.03.2019 um 11:52 hat Stefano Garzarella geschrieben: > > Several versions of GlusterFS (3.12? -> 6.0.1) fail when the > > transfer size is greater or equal to 1024 MiB, so we are > > limiting the transfer

[Qemu-block] [PATCH RFC] block/gluster: limit the transfer size to 512 MiB

2019-03-28 Thread Stefano Garzarella
Several versions of GlusterFS (3.12? -> 6.0.1) fail when the transfer size is greater or equal to 1024 MiB, so we are limiting the transfer size to 512 MiB to avoid this rare issue. Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1691320 Signed-off-by: Stefano Garzarella --- RFC: Shoul

Re: [Qemu-block] [PATCH v2 1/2] block/vhdx: Remove redundant IEC binary prefixes definition

2019-03-27 Thread Stefano Garzarella
On Wed, Mar 27, 2019 at 01:16:49PM -0400, John Snow wrote: > > > On 3/27/19 5:56 AM, Stefano Garzarella wrote: > > IEC binary prefixes are already defined in "qemu/units.h", > > so we can remove redundant definitions in "block/vhdx.h". &

[Qemu-block] [PATCH v2 2/2] block/vhdx: Use IEC binary prefixes for size constants

2019-03-27 Thread Stefano Garzarella
Using IEC binary prefixes in order to make the code more readable, with the exception of DEFAULT_LOG_SIZE because it's passed to stringify(). Signed-off-by: Stefano Garzarella --- block/vhdx-log.c | 2 +- block/vhdx.c | 4 ++-- block/vhdx.h | 10 ++ 3 files chang

[Qemu-block] [PATCH v2 0/2] block/vhdx: Use IEC binary prefixes from "qemu/units.h"

2019-03-27 Thread Stefano Garzarella
comments in that file doesn't respect the new coding style so I left the comment as is Stefano Garzarella (2): block/vhdx: Remove redundant IEC binary prefixes definition block/vhdx: Use IEC binary prefixes for size constants block/vhdx-log.c | 2 +- block/vhdx.c | 7 --- block/v

[Qemu-block] [PATCH v2 1/2] block/vhdx: Remove redundant IEC binary prefixes definition

2019-03-27 Thread Stefano Garzarella
IEC binary prefixes are already defined in "qemu/units.h", so we can remove redundant definitions in "block/vhdx.h". Signed-off-by: Stefano Garzarella --- block/vhdx.c | 3 ++- block/vhdx.h | 6 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/block/v

<    1   2   3   4   5   6   >