Re: [Qemu-block] [PATCH v3 2/7] qemu-img: Add salvaging mode to convert

2019-04-15 Thread Vladimir Sementsov-Ogievskiy
13.04.2019 19:53, Max Reitz wrote: > This adds a salvaging mode (--salvage) to qemu-img convert which ignores > read errors and treats the respective areas as containing only zeroes. > This can be used for instance to at least partially recover the data > from terminally corrupted qcow2 images. >

Re: [Qemu-block] [PATCH 4/4] qcow2: Fix full preallocation with external data file

2019-04-15 Thread Eric Blake
On 4/15/19 10:54 AM, Kevin Wolf wrote: > preallocate_co() already gave the data file the full size without > forwarding the requested preallocation mode to the protocol. When > bdrv_co_truncate() was called later with the preallocation mode, the > file didn't actually grow any more, so the data fil

Re: [Qemu-block] [PATCH 3/4] qcow2: Add errp to preallocate_co()

2019-04-15 Thread Eric Blake
On 4/15/19 10:54 AM, Kevin Wolf wrote: > We'll add a bdrv_co_truncate() call in the next patch which can return > an Error that we don't want to discard. So add an errp parameter to > preallocate_co(). > > Cc: qemu-sta...@nongnu.org > Signed-off-by: Kevin Wolf > --- > block/qcow2.c | 11 ++--

Re: [Qemu-block] [PATCH for-4.0? 2/4] qcow2: Fix preallocation bdrv_pwrite to wrong file

2019-04-15 Thread Eric Blake
On 4/15/19 10:54 AM, Kevin Wolf wrote: > With an external data file, preallocate_co() must write the final byte > to the external data file, not to the qcow2 image file. > > This is harmless for preallocation of newly created images (only the > qcow2 file size is increased to the virtual disk size

Re: [Qemu-block] [PATCH 1/4] qcow2: Avoid COW during metadata preallocation

2019-04-15 Thread Eric Blake
On 4/15/19 10:54 AM, Kevin Wolf wrote: > Limiting the allocation to INT_MAX bytes isn't particularly clever > because it means that the final cluster will be a partial cluster which > will be completed through a COW operation. This results in unnecessary > data read and write requests which lead to

[Qemu-block] [PATCH 1/4] qcow2: Avoid COW during metadata preallocation

2019-04-15 Thread Kevin Wolf
Limiting the allocation to INT_MAX bytes isn't particularly clever because it means that the final cluster will be a partial cluster which will be completed through a COW operation. This results in unnecessary data read and write requests which lead to an unwanted non-sparse filesystem block for me

[Qemu-block] [PATCH 3/4] qcow2: Add errp to preallocate_co()

2019-04-15 Thread Kevin Wolf
We'll add a bdrv_co_truncate() call in the next patch which can return an Error that we don't want to discard. So add an errp parameter to preallocate_co(). Cc: qemu-sta...@nongnu.org Signed-off-by: Kevin Wolf --- block/qcow2.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) d

[Qemu-block] [PATCH 4/4] qcow2: Fix full preallocation with external data file

2019-04-15 Thread Kevin Wolf
preallocate_co() already gave the data file the full size without forwarding the requested preallocation mode to the protocol. When bdrv_co_truncate() was called later with the preallocation mode, the file didn't actually grow any more, so the data file stayed unallocated even if full preallocation

[Qemu-block] [PATCH for-4.0? 2/4] qcow2: Fix preallocation bdrv_pwrite to wrong file

2019-04-15 Thread Kevin Wolf
With an external data file, preallocate_co() must write the final byte to the external data file, not to the qcow2 image file. This is harmless for preallocation of newly created images (only the qcow2 file size is increased to the virtual disk size while it should be much smaller), but with preal

[Qemu-block] [PATCH 0/4] qcow2: Preallocation fixes

2019-04-15 Thread Kevin Wolf
Kevin Wolf (4): qcow2: Avoid COW during metadata preallocation qcow2: Fix preallocation bdrv_pwrite to wrong file qcow2: Add errp to preallocate_co() qcow2: Fix full preallocation with external data file block/qcow2.c | 47 +++ 1 file changed, 2

[Qemu-block] [RFC] iotests: Fix iotests 110 and 126

2019-04-15 Thread Max Reitz
A recent patch results in qemu-img reporting the backing file format of vmdk images as vmdk. This broke iotests 110 and 126. Fixes: "vmdk: Set vmdk parent backing_format to vmdk" Signed-off-by: Max Reitz --- RFC because: (1) I'd prefer for this patch to be squashed into the patch mentioned a

Re: [Qemu-block] [PATCH] vmdk: Set vmdk parent backing_format to vmdk

2019-04-15 Thread Max Reitz
On 11.04.19 12:43, Sam Eiderman wrote: > Are you going to fix this when you apply the patch or should I? I can’t fix it because Kevin has applied this patch to his branch. I’d prefer it if there weren’t commits that break patches (even if it’s just temporary), so I think right now it’s mostly up

[Qemu-block] [PATCH v6 2/5] block/backup: move to copy_bitmap with granularity

2019-04-15 Thread Vladimir Sementsov-Ogievskiy
We are going to share this bitmap between backup and backup-top filter driver, so let's share something more meaningful. It also simplifies some calculations. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- block/backup.c | 48 +++--

[Qemu-block] [PATCH v6 1/5] block/backup: simplify backup_incremental_init_copy_bitmap

2019-04-15 Thread Vladimir Sementsov-Ogievskiy
Simplify backup_incremental_init_copy_bitmap using the function bdrv_dirty_bitmap_next_dirty_area. Note: move to job->len instead of bitmap size: it should not matter but less code. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/backup.c | 40 1 f

[Qemu-block] [PATCH v6 5/5] block/backup: refactor: split out backup_calculate_cluster_size

2019-04-15 Thread Vladimir Sementsov-Ogievskiy
Split out cluster_size calculation. Move copy-bitmap creation above block-job creation, as we are going to share it with upcoming backup-top filter, which also should be created before actual block job creation. Also, while being here, drop unnecessary "goto error" from bdrv_getlength error path.

[Qemu-block] [PATCH v6 3/5] block/backup: refactor and tolerate unallocated cluster skipping

2019-04-15 Thread Vladimir Sementsov-Ogievskiy
Split allocation checking to separate function and reduce nesting. Consider bdrv_is_allocated() fail as allocated area, as copying more than needed is not wrong (and we do it anyway) and seems better than fail the whole job. And, most probably we will fail on the next read, if there are real proble

[Qemu-block] [PATCH v6 0/5] backup-top: preparing refactoring

2019-04-15 Thread Vladimir Sementsov-Ogievskiy
Hi all! Here some refactoring patches, as a first step for backup-top filter introduction. v6: 01: - use end_cluster instead of last_cluster and fix bug in calculation [Max] 02: only rebased on 01, keep r-b 03, 04: new 05: it's rewritten "[PATCH v5 10/11] block/backup: tiny refactor bac

[Qemu-block] [PATCH v6 4/5] block/backup: unify different modes code path

2019-04-15 Thread Vladimir Sementsov-Ogievskiy
Do full, top and incremental mode copying all in one place. This unifies the code path and helps further improvements. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/backup.c | 43 ++- 1 file changed, 10 insertions(+), 33 deletions(-) diff --git a/

[Qemu-block] [PATCH 4/5] block/nvme: add support for write zeros

2019-04-15 Thread Maxim Levitsky
Signed-off-by: Maxim Levitsky --- block/nvme.c | 69 +++- block/trace-events | 1 + include/block/nvme.h | 17 ++- 3 files changed, 85 insertions(+), 2 deletions(-) diff --git a/block/nvme.c b/block/nvme.c index 0d9b521760..5121e809f0 10

[Qemu-block] [PATCH 0/5] Few fixes for userspace NVME driver

2019-04-15 Thread Maxim Levitsky
CC: Fam Zheng CC: Kevin Wolf CC: Max Reitz CC: qemu-de...@nongnu.org Hi! These are few assorted fixes and features for the userspace nvme driver. Tested that on my laptop with my Samsung X5 thunderbolt drive, which happens to have 4K sectors, support for discard and write zeros. Also bunch o

[Qemu-block] [PATCH 2/5] block/nvme: fix doorbell stride

2019-04-15 Thread Maxim Levitsky
Fix the math involving non standard doorbell stride Signed-off-by: Maxim Levitsky --- block/nvme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/nvme.c b/block/nvme.c index 2d208000df..208242cf1f 100644 --- a/block/nvme.c +++ b/block/nvme.c @@ -216,7 +216,7 @@ static

[Qemu-block] [PATCH 5/5] block/nvme: add support for discard

2019-04-15 Thread Maxim Levitsky
Signed-off-by: Maxim Levitsky --- block/nvme.c | 81 ++ block/trace-events | 2 ++ 2 files changed, 83 insertions(+) diff --git a/block/nvme.c b/block/nvme.c index 5121e809f0..386c2508b7 100644 --- a/block/nvme.c +++ b/block/nvme.c @@ -110,6 +11

[Qemu-block] [PATCH 1/5] block/nvme: don't flip CQ phase bits

2019-04-15 Thread Maxim Levitsky
Phase bits are only set by the hardware to indicate new completions and not by the device driver. Signed-off-by: Maxim Levitsky --- block/nvme.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/block/nvme.c b/block/nvme.c index 0684bbd077..2d208000df 100644 --- a/block/nvme.c +++ b/block/nvm

[Qemu-block] [PATCH 3/5] block/nvme: support larger that 512 bytes sector devices

2019-04-15 Thread Maxim Levitsky
Currently the driver hardcodes the sector size to 512, and doesn't check the underlying device Signed-off-by: Maxim Levitsky --- block/nvme.c | 40 +++- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/block/nvme.c b/block/nvme.c index 208242cf1f

Re: [Qemu-block] [PATCH 2/3] xen-bus: allow AioContext to be specified for each event channel

2019-04-15 Thread Stefan Hajnoczi
On Wed, Apr 10, 2019 at 03:20:05PM +, Paul Durrant wrote: > > -Original Message- > > From: Anthony PERARD [mailto:anthony.per...@citrix.com] > > Sent: 10 April 2019 13:57 > > To: Paul Durrant > > Cc: qemu-de...@nongnu.org; qemu-block@nongnu.org; > > xen-de...@lists.xenproject.org; Ste

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

2019-04-15 Thread Kevin Wolf
Am 14.04.2019 um 17:14 hat Jason Dillaman geschrieben: > On Sun, Apr 14, 2019 at 9:20 AM Stefano Garzarella > wrote: > > > > 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