Re: [Qemu-block] [PATCH v8 19/21] vpc: Switch to .bdrv_co_block_status()

2018-02-14 Thread Kevin Wolf
Am 13.02.2018 um 21:26 hat Eric Blake geschrieben: > We are gradually moving away from sector-based interfaces, towards > byte-based. Update the vpc driver accordingly. > > Signed-off-by: Eric Blake > Reviewed-by: Vladimir Sementsov-Ogievskiy >

Re: [Qemu-block] [PATCH v8 20/21] vvfat: Switch to .bdrv_co_block_status()

2018-02-14 Thread Kevin Wolf
Am 13.02.2018 um 21:27 hat Eric Blake geschrieben: > We are gradually moving away from sector-based interfaces, towards > byte-based. Update the vvfat driver accordingly. Note that we > can rely on the block driver having already clamped limits to our > block size, and simplify accordingly. > >

Re: [Qemu-block] [PATCH v8 08/21] iscsi: Switch to .bdrv_co_block_status()

2018-02-14 Thread Kevin Wolf
Am 13.02.2018 um 21:26 hat Eric Blake geschrieben: > We are gradually moving away from sector-based interfaces, towards > byte-based. Update the iscsi driver accordingly. In this case, > it is handy to teach iscsi_co_block_status() to handle a NULL map > and file parameter, even though the block

Re: [Qemu-block] block_status automatically added flags

2018-02-14 Thread Vladimir Sementsov-Ogievskiy
13.02.2018 21:48, Eric Blake wrote: On 02/13/2018 11:36 AM, Vladimir Sementsov-Ogievskiy wrote: Hi Eric! I'm now testing my nbd block status realization (block_status part, not about dirty bitmaps), and faced into the following effect. I created empty qcow2 image and wrote to the first

[Qemu-block] BLOCK_STATUS extension

2018-02-14 Thread Vladimir Sementsov-Ogievskiy
Hi all. Just note: looks like we allow zero-sized metadata context name. Is it ok? * |NBD_REP_META_CONTEXT| (4) A description of a metadata context. Data: o 32 bits, NBD metadata context ID. o String, name of the metadata context. This is not required to be a

Re: [Qemu-block] [PATCH v8 09/21] null: Switch to .bdrv_co_block_status()

2018-02-14 Thread Kevin Wolf
Am 14.02.2018 um 15:44 hat Eric Blake geschrieben: > On 02/14/2018 06:05 AM, Kevin Wolf wrote: > > Am 13.02.2018 um 21:26 hat Eric Blake geschrieben: > > > We are gradually moving away from sector-based interfaces, towards > > > byte-based. Update the null driver accordingly. > > > > > >

[Qemu-block] [PATCH v3 2/2] block: fix write with zero flag set and iovector provided

2018-02-14 Thread Anton Nefedov
The normal bdrv_co_pwritev() use is either - BDRV_REQ_ZERO_WRITE clear and iovector provided - BDRV_REQ_ZERO_WRITE set and iovector == NULL while - the flag clear and iovector == NULL is an assertion failure in bdrv_co_do_zero_pwritev() - the flag set and iovector provided is in fact

[Qemu-block] [PATCH v3 0/2] block: fix write with zero flag set and iovector provided

2018-02-14 Thread Anton Nefedov
v3: patch 1: image cluster size reduced to get away with a smaller test image (the cluster size can be as small as 512 bytes for qcow2, but the test runs for all generic formats and minimum for qed is 4k) v2: http://lists.nongnu.org/archive/html/qemu-devel/2018-02/msg03016.html Anton

Re: [Qemu-block] [PATCH v8 08/21] iscsi: Switch to .bdrv_co_block_status()

2018-02-14 Thread Eric Blake
On 02/14/2018 05:53 AM, Kevin Wolf wrote: Am 13.02.2018 um 21:26 hat Eric Blake geschrieben: We are gradually moving away from sector-based interfaces, towards byte-based. Update the iscsi driver accordingly. In this case, it is handy to teach iscsi_co_block_status() to handle a NULL map and

Re: [Qemu-block] [PATCH v8 19/21] vpc: Switch to .bdrv_co_block_status()

2018-02-14 Thread Eric Blake
On 02/14/2018 07:08 AM, Kevin Wolf wrote: Am 13.02.2018 um 21:26 hat Eric Blake geschrieben: We are gradually moving away from sector-based interfaces, towards byte-based. Update the vpc driver accordingly. Signed-off-by: Eric Blake Reviewed-by: Vladimir

Re: [Qemu-block] [PATCH v8 09/21] null: Switch to .bdrv_co_block_status()

2018-02-14 Thread Eric Blake
On 02/14/2018 06:05 AM, Kevin Wolf wrote: Am 13.02.2018 um 21:26 hat Eric Blake geschrieben: We are gradually moving away from sector-based interfaces, towards byte-based. Update the null driver accordingly. Signed-off-by: Eric Blake Reviewed-by: Vladimir

Re: [Qemu-block] [PATCH v8 20/21] vvfat: Switch to .bdrv_co_block_status()

2018-02-14 Thread Kevin Wolf
Am 14.02.2018 um 15:50 hat Eric Blake geschrieben: > On 02/14/2018 07:12 AM, Kevin Wolf wrote: > > Am 13.02.2018 um 21:27 hat Eric Blake geschrieben: > > > We are gradually moving away from sector-based interfaces, towards > > > byte-based. Update the vvfat driver accordingly. Note that we > > >

Re: [Qemu-block] qcow2 images corruption

2018-02-14 Thread Nicolas Ecarnot
https://framadrop.org/r/Lvvr392QZo#/wOeYUUlHQAtkUw1E+x2YdqTqq21Pbic6OPBIH0TjZE= Le 14/02/2018 à 00:01, John Snow a écrit : On 02/13/2018 04:41 AM, Kevin Wolf wrote: Am 07.02.2018 um 18:06 hat Nicolas Ecarnot geschrieben: TL; DR : qcow2 images keep getting corrupted. Any workaround? Not

Re: [Qemu-block] [Qemu-devel] [PATCH v8 02/21] nvme: Drop pointless .bdrv_co_get_block_status()

2018-02-14 Thread Philippe Mathieu-Daudé
On 02/13/2018 05:26 PM, Eric Blake wrote: > Commit bdd6a90 has a bug: drivers should never directly set > BDRV_BLOCK_ALLOCATED, but only io.c should do that (as needed). Doesn't "pointless" in subject hide this is a bugfix? > Instead, drivers should report BDRV_BLOCK_DATA if it knows that > data

Re: [Qemu-block] [PATCH v8 00/21] add byte-based block_status driver callbacks

2018-02-14 Thread Kevin Wolf
Am 13.02.2018 um 21:26 hat Eric Blake geschrieben: > There are patches floating around to add NBD_CMD_BLOCK_STATUS, > but NBD wants to report status on byte granularity (even if the > reporting will probably be naturally aligned to sectors or even > much higher levels). I've therefore started the

Re: [Qemu-block] [PATCH v3 0/2] block: fix write with zero flag set and iovector provided

2018-02-14 Thread Kevin Wolf
Am 14.02.2018 um 17:09 hat Anton Nefedov geschrieben: > v3: patch 1: image cluster size reduced to get away with a smaller test image > (the cluster size can be as small as 512 bytes for qcow2, > but the test runs for all generic formats and minimum for qed is 4k) Thanks, applied to the

[Qemu-block] [PATCH 3/3] block/ssh: Add basic .bdrv_truncate()

2018-02-14 Thread Max Reitz
libssh2 does not seem to offer real truncation support, so we can only grow files -- but that is better than nothing. Signed-off-by: Max Reitz --- block/ssh.c | 24 1 file changed, 24 insertions(+) diff --git a/block/ssh.c b/block/ssh.c index

[Qemu-block] [PATCH 2/3] block/ssh: Make ssh_grow_file() blocking

2018-02-14 Thread Max Reitz
At runtime (that is, during a future ssh_truncate()), the SSH session is non-blocking. However, ssh_truncate() (or rather, bdrv_truncate() in general) is not a coroutine, so this resize operation needs to block. For ssh_create(), that is fine, too; the session is never set to non-blocking

[Qemu-block] [PATCH 0/3] block/ssh: Add basic .bdrv_truncate()

2018-02-14 Thread Max Reitz
For (x-)blockdev-create, all protocol drivers that support image creation also need to offer a .bdrv_truncate() implementation that matches in features. A previous series of mine brought gluster's and sheepdog's implementation up to par regarding preallocated truncation; but I forgot about

[Qemu-block] [PATCH 1/3] block/ssh: Pull ssh_grow_file() from ssh_create()

2018-02-14 Thread Max Reitz
If we ever want to offer even rudimentary truncation functionality for ssh, we should put the respective code into a reusable function. Signed-off-by: Max Reitz --- block/ssh.c | 30 ++ 1 file changed, 22 insertions(+), 8 deletions(-) diff --git

Re: [Qemu-block] [RFC PATCH 0/2] s/size/entries/ when dealing with non-byte units

2018-02-14 Thread Max Reitz
On 2018-02-14 00:33, Eric Blake wrote: > I mentioned this while reviewing Berto's series on L2 slice handling; > this is a first cut at patches that I think are worth doing throughout > the qcow2 code base if we like the idea. I like the idea. :-) The patches look good to me. Max > Eric Blake

Re: [Qemu-block] [Qemu-devel] [PATCH 2/3] block/ssh: Make ssh_grow_file() blocking

2018-02-14 Thread Eric Blake
On 02/14/2018 02:49 PM, Max Reitz wrote: At runtime (that is, during a future ssh_truncate()), the SSH session is non-blocking. However, ssh_truncate() (or rather, bdrv_truncate() in general) is not a coroutine, so this resize operation needs to block. For ssh_create(), that is fine, too; the

Re: [Qemu-block] [Qemu-devel] [PATCH 2/3] block/ssh: Make ssh_grow_file() blocking

2018-02-14 Thread Max Reitz
On 2018-02-14 22:11, Eric Blake wrote: > On 02/14/2018 02:49 PM, Max Reitz wrote: >> At runtime (that is, during a future ssh_truncate()), the SSH session is >> non-blocking.  However, ssh_truncate() (or rather, bdrv_truncate() in >> general) is not a coroutine, so this resize operation needs to

Re: [Qemu-block] [Qemu-devel] [PATCH 1/3] block/ssh: Pull ssh_grow_file() from ssh_create()

2018-02-14 Thread Eric Blake
On 02/14/2018 02:49 PM, Max Reitz wrote: If we ever want to offer even rudimentary truncation functionality for ssh, we should put the respective code into a reusable function. Signed-off-by: Max Reitz --- block/ssh.c | 30 ++ 1 file changed,

Re: [Qemu-block] [Qemu-devel] [PATCH 3/3] block/ssh: Add basic .bdrv_truncate()

2018-02-14 Thread Eric Blake
On 02/14/2018 02:49 PM, Max Reitz wrote: libssh2 does not seem to offer real truncation support, so we can only grow files -- but that is better than nothing. Signed-off-by: Max Reitz --- block/ssh.c | 24 1 file changed, 24 insertions(+)

Re: [Qemu-block] [PATCH v3 1/2] iotest 033: add misaligned write-zeroes test via truncate

2018-02-14 Thread Eric Blake
On 02/14/2018 10:09 AM, Anton Nefedov wrote: This new test case only makes sense for qcow2 while iotest 033 is generic; however it matches the test purpose perfectly and also 033 contains those do_test() tricks to pass the alignment, which won't look nice being duplicated in other tests or moved

[Qemu-block] [PATCH 16/30] hw/sh4: use the BYTE-based definitions

2018-02-14 Thread Philippe Mathieu-Daudé
It ease code review, unit is explicit. Signed-off-by: Philippe Mathieu-Daudé --- hw/block/tc58128.c | 2 +- hw/sh4/r2d.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/block/tc58128.c b/hw/block/tc58128.c index 1d9f7ee000..3e658d509f 100644 ---

[Qemu-block] [PATCH 30/30] xen: use the BYTE-based definitions

2018-02-14 Thread Philippe Mathieu-Daudé
It ease code review, unit is explicit. Signed-off-by: Philippe Mathieu-Daudé --- hw/block/xen_disk.c| 4 ++-- hw/xenpv/xen_domainbuild.c | 10 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c index

Re: [Qemu-block] [Qemu-devel] [PATCH 03/30] hw/block/nvme: include the "qemu/cutils.h" in the source file

2018-02-14 Thread Thomas Huth
On 15.02.2018 05:28, Philippe Mathieu-Daudé wrote: > where it is used. > > Signed-off-by: Philippe Mathieu-Daudé > --- > hw/block/nvme.h | 1 - > hw/block/nvme.c | 1 + > 2 files changed, 1 insertion(+), 1 deletion(-) > > diff --git a/hw/block/nvme.h b/hw/block/nvme.h > index

[Qemu-block] [PATCH] nbd: Honor server's advertised minimum block size

2018-02-14 Thread Eric Blake
Commit 79ba8c98 (v2.7) changed the setting of request_alignment to occur only during bdrv_refresh_limits(), rather than at at bdrv_open() time; but at the time, NBD was unaffected, because it still used sector-based callbacks, so the block layer defaulted NBD to use 512 request_alignment. Later,

[Qemu-block] [PATCH 03/30] hw/block/nvme: include the "qemu/cutils.h" in the source file

2018-02-14 Thread Philippe Mathieu-Daudé
where it is used. Signed-off-by: Philippe Mathieu-Daudé --- hw/block/nvme.h | 1 - hw/block/nvme.c | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/block/nvme.h b/hw/block/nvme.h index 8f3981121d..cabcf20c32 100644 --- a/hw/block/nvme.h +++