Re: [Qemu-block] [PATCH v4 27/39] qcow2: Update qcow2_update_snapshot_refcount() to support L2 slices

2018-02-13 Thread Eric Blake
On 02/05/2018 08:33 AM, Alberto Garcia wrote: qcow2_update_snapshot_refcount() increases the refcount of all clusters of a given snapshot. In order to do that it needs to load all its L2 tables and iterate over their entries. Since we'll be loading L2 slices instead of full tables we need to add

Re: [Qemu-block] [Qemu-devel] [PATCH 1/2] Add save-snapshot, load-snapshot and delete-snapshot to QAPI

2018-02-13 Thread Denis V. Lunev
On 02/13/2018 05:43 PM, Kevin Wolf wrote: > Am 13.02.2018 um 15:30 hat Roman Kagan geschrieben: >> On Tue, Feb 13, 2018 at 11:50:24AM +0100, Kevin Wolf wrote: >>> Am 11.01.2018 um 14:04 hat Daniel P. Berrange geschrieben: Then you could just use the regular migrate QMP commands for loading

Re: [Qemu-block] [Qemu-devel] [PATCH 1/2] Add save-snapshot, load-snapshot and delete-snapshot to QAPI

2018-02-13 Thread Daniel P . Berrangé
On Tue, Feb 13, 2018 at 03:45:21PM +0100, Kevin Wolf wrote: > Am 13.02.2018 um 15:36 hat Daniel P. Berrangé geschrieben: > > On Tue, Feb 13, 2018 at 05:30:02PM +0300, Roman Kagan wrote: > > > On Tue, Feb 13, 2018 at 11:50:24AM +0100, Kevin Wolf wrote: > > > > Am 11.01.2018 um 14:04 hat Daniel P.

Re: [Qemu-block] [Qemu-devel] [PATCH 1/2] Add save-snapshot, load-snapshot and delete-snapshot to QAPI

2018-02-13 Thread Kevin Wolf
Am 13.02.2018 um 15:36 hat Daniel P. Berrangé geschrieben: > On Tue, Feb 13, 2018 at 05:30:02PM +0300, Roman Kagan wrote: > > On Tue, Feb 13, 2018 at 11:50:24AM +0100, Kevin Wolf wrote: > > > Am 11.01.2018 um 14:04 hat Daniel P. Berrange geschrieben: > > > > Then you could just use the regular

Re: [Qemu-block] [Qemu-devel] [PATCH 1/2] Add save-snapshot, load-snapshot and delete-snapshot to QAPI

2018-02-13 Thread Kevin Wolf
Am 13.02.2018 um 15:30 hat Roman Kagan geschrieben: > On Tue, Feb 13, 2018 at 11:50:24AM +0100, Kevin Wolf wrote: > > Am 11.01.2018 um 14:04 hat Daniel P. Berrange geschrieben: > > > Then you could just use the regular migrate QMP commands for loading > > > and saving snapshots. > > > > Yes, you

Re: [Qemu-block] [PATCH v4 25/39] qcow2: Update zero_single_l2() to support L2 slices

2018-02-13 Thread Eric Blake
On 02/05/2018 08:33 AM, Alberto Garcia wrote: zero_single_l2() limits the number of clusters to be zeroed to the amount that fits inside an L2 table. Since we'll be loading L2 slices instead of full tables we need to update that limit. The function is renamed to zero_in_l2_slice() for clarity.

Re: [Qemu-block] [PATCH v4 24/39] qcow2: Update discard_single_l2() to support L2 slices

2018-02-13 Thread Eric Blake
On 02/05/2018 08:33 AM, Alberto Garcia wrote: discard_single_l2() limits the number of clusters to be discarded to the amount that fits inside an L2 table. Since we'll be loading L2 slices instead of full tables we need to update that limit. The function is renamed to discard_in_l2_slice() for

Re: [Qemu-block] [Qemu-devel] [PATCH 1/2] Add save-snapshot, load-snapshot and delete-snapshot to QAPI

2018-02-13 Thread Daniel P . Berrangé
On Tue, Feb 13, 2018 at 05:30:02PM +0300, Roman Kagan wrote: > On Tue, Feb 13, 2018 at 11:50:24AM +0100, Kevin Wolf wrote: > > Am 11.01.2018 um 14:04 hat Daniel P. Berrange geschrieben: > > > Then you could just use the regular migrate QMP commands for loading > > > and saving snapshots. > > > >

Re: [Qemu-block] [Qemu-devel] [PATCH 1/2] Add save-snapshot, load-snapshot and delete-snapshot to QAPI

2018-02-13 Thread Daniel P . Berrangé
On Tue, Feb 13, 2018 at 02:20:00PM +0100, Kevin Wolf wrote: > Am 13.02.2018 um 12:51 hat Daniel P. Berrangé geschrieben: > > On Tue, Feb 13, 2018 at 11:43:55AM +, Dr. David Alan Gilbert wrote: > > > * Kevin Wolf (kw...@redhat.com) wrote: > > > > Am 11.01.2018 um 14:04 hat Daniel P. Berrange

[Qemu-block] [PATCH 3/7] gluster: Query current size in do_truncate()

2018-02-13 Thread Max Reitz
Instead of expecting the current size to be 0, query it and allocate only the area [current_size, offset) if preallocation is requested. Signed-off-by: Max Reitz --- block/gluster.c | 21 +++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git

Re: [Qemu-block] [Qemu-devel] [PATCH 1/2] Add save-snapshot, load-snapshot and delete-snapshot to QAPI

2018-02-13 Thread Kevin Wolf
Am 13.02.2018 um 12:51 hat Daniel P. Berrangé geschrieben: > On Tue, Feb 13, 2018 at 11:43:55AM +, Dr. David Alan Gilbert wrote: > > * Kevin Wolf (kw...@redhat.com) wrote: > > > Am 11.01.2018 um 14:04 hat Daniel P. Berrange geschrieben: > > > > On Thu, Jan 11, 2018 at 01:46:38PM +0100, Max

[Qemu-block] [PATCH 4/7] gluster: Add preallocated truncation

2018-02-13 Thread Max Reitz
By using qemu_do_cluster_truncate() in qemu_cluster_truncate(), we now automatically have preallocated truncation. Signed-off-by: Max Reitz --- block/gluster.c | 17 + 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/block/gluster.c

[Qemu-block] [PATCH 5/7] sheepdog: Make sd_prealloc() take a BDS

2018-02-13 Thread Max Reitz
We want to use this function in sd_truncate() later on, so taking a filename is not exactly ideal. Signed-off-by: Max Reitz --- block/sheepdog.c | 29 + 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/block/sheepdog.c

[Qemu-block] [PATCH 7/7] sheepdog: Allow fully preallocated truncation

2018-02-13 Thread Max Reitz
Signed-off-by: Max Reitz --- block/sheepdog.c | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/block/sheepdog.c b/block/sheepdog.c index d300fb69c0..ac02b10fe0 100644 --- a/block/sheepdog.c +++ b/block/sheepdog.c @@ -2180,15 +2180,16 @@

[Qemu-block] [PATCH 0/7] block: Preallocated truncation for gluster and sheepdog

2018-02-13 Thread Max Reitz
As far as I can see, these are the only protocols beside file-posix that support preallocated creation. In contrast to file-posix, however, they have not supported preallocated truncation so far. This series brings their truncation code to feature parity with their creation code in this regard.

[Qemu-block] [PATCH 6/7] sheepdog: Pass old and new size to sd_prealloc()

2018-02-13 Thread Max Reitz
sd_prealloc() will now preallocate the area [old_size, new_size). As before, it rounds to buf_size and may thus overshoot and preallocate areas that were not requested to be preallocated. For image creation, this is no change in behavior. For truncation, this is in accordance with the

Re: [Qemu-block] [PATCH v4 37/39] iotests: Test valid values of l2-cache-entry-size

2018-02-13 Thread Alberto Garcia
On Tue 13 Feb 2018 01:32:17 PM CET, Kevin Wolf wrote: >> +# Invalid cache entry sizes >> +$QEMU_IO -c "open -o l2-cache-entry-size=256 $TEST_IMG" \ >> +2>&1 | _filter_testdir | _filter_imgfmt >> +$QEMU_IO -c "open -o l2-cache-entry-size=300 $TEST_IMG" \ >> +2>&1 | _filter_testdir |

Re: [Qemu-block] [PATCH v4 37/39] iotests: Test valid values of l2-cache-entry-size

2018-02-13 Thread Kevin Wolf
Am 05.02.2018 um 15:33 hat Alberto Garcia geschrieben: > The l2-cache-entry-size setting can only contain values that are > powers of two between 512 and the cluster size. > > Signed-off-by: Alberto Garcia > Reviewed-by: Eric Blake > Reviewed-by: Max Reitz

Re: [Qemu-block] [PATCH v4 00/39] Allow configuring the qcow2 L2 cache entry size

2018-02-13 Thread Kevin Wolf
Am 05.02.2018 um 17:31 hat Max Reitz geschrieben: > On 2018-02-05 15:33, Alberto Garcia wrote: > > this is the new revision of the patch series to allow configuring the > > entry size of the qcow2 L2 cache. Follow this link for the full > > description from the first version: > > > >

Re: [Qemu-block] [PATCH v4 34/39] qcow2: Rename l2_table in count_contiguous_clusters_unallocated()

2018-02-13 Thread Kevin Wolf
Am 05.02.2018 um 15:33 hat Alberto Garcia geschrieben: > This function doesn't need any changes to support L2 slices, but since > it's now dealing with slices intead of full tables, the l2_table s/intead/instead/ > variable is renamed for clarity. > > Signed-off-by: Alberto Garcia

Re: [Qemu-block] [Qemu-devel] [PATCH 1/2] Add save-snapshot, load-snapshot and delete-snapshot to QAPI

2018-02-13 Thread Daniel P . Berrangé
On Tue, Feb 13, 2018 at 11:43:55AM +, Dr. David Alan Gilbert wrote: > * Kevin Wolf (kw...@redhat.com) wrote: > > Am 11.01.2018 um 14:04 hat Daniel P. Berrange geschrieben: > > > On Thu, Jan 11, 2018 at 01:46:38PM +0100, Max Reitz wrote: > > > > On 2018-01-08 14:52, Eric Blake wrote: > > > > >

Re: [Qemu-block] [Qemu-devel] [PATCH 1/2] Add save-snapshot, load-snapshot and delete-snapshot to QAPI

2018-02-13 Thread Dr. David Alan Gilbert
* Kevin Wolf (kw...@redhat.com) wrote: > Am 11.01.2018 um 14:04 hat Daniel P. Berrange geschrieben: > > On Thu, Jan 11, 2018 at 01:46:38PM +0100, Max Reitz wrote: > > > On 2018-01-08 14:52, Eric Blake wrote: > > > > On 01/07/2018 06:23 AM, Richard Palethorpe wrote: > > > >> Add QAPI wrapper

Re: [Qemu-block] [Qemu-devel] [PATCH 1/2] Add save-snapshot, load-snapshot and delete-snapshot to QAPI

2018-02-13 Thread Kevin Wolf
Am 11.01.2018 um 14:04 hat Daniel P. Berrange geschrieben: > On Thu, Jan 11, 2018 at 01:46:38PM +0100, Max Reitz wrote: > > On 2018-01-08 14:52, Eric Blake wrote: > > > On 01/07/2018 06:23 AM, Richard Palethorpe wrote: > > >> Add QAPI wrapper functions for the existing snapshot functionality.

Re: [Qemu-block] qcow2 images corruption

2018-02-13 Thread Kevin Wolf
Am 07.02.2018 um 18:06 hat Nicolas Ecarnot geschrieben: > TL; DR : qcow2 images keep getting corrupted. Any workaround? Not without knowing the cause. The first thing to make sure is that the image isn't touched by a second process while QEMU is running a VM. The classic one is using 'qemu-img

<    1   2