Re: [Qemu-devel] [PATCH v3] util/async: use atomic_mb_set in qemu_bh_cancel

2017-11-08 Thread Pavel Butsykin
On 08.11.2017 17:15, Paolo Bonzini wrote: On 08/11/2017 15:10, Sergio Lopez wrote: I'm not quite sure that the pre-fetched is involved in this issue, because pre-fetch reading a certain addresses should be invalidated by write on another core to the same addresses. In our case write

Re: [Qemu-devel] [PATCH v3] util/async: use atomic_mb_set in qemu_bh_cancel

2017-11-08 Thread Pavel Butsykin
On 08.11.2017 17:24, Sergio Lopez wrote: On Wed, Nov 8, 2017 at 3:15 PM, Paolo Bonzini wrote: On 08/11/2017 15:10, Sergio Lopez wrote: I'm not quite sure that the pre-fetched is involved in this issue, because pre-fetch reading a certain addresses should be invalidated by

Re: [Qemu-devel] [PATCH v3] util/async: use atomic_mb_set in qemu_bh_cancel

2017-11-08 Thread Pavel Butsykin
On 08.11.2017 09:34, Sergio Lopez wrote: Commit b7a745d added a qemu_bh_cancel call to the completion function as an optimization to prevent it from unnecessarily rescheduling itself. This completion function is scheduled from worker_thread, after setting the state of a ThreadPoolElement to

Re: [Qemu-devel] [PATCH] qcow2: Emit errp when truncating the image tail

2017-10-09 Thread Pavel Butsykin
warn_reportf_err(local_err, + "Failed to truncate the tail of the image: "); } } } else { Reviewed-by: Pavel Butsykin <pbutsy...@virtuozzo.com>

[Qemu-devel] [PATCH v3 2/2] qcow2: truncate the tail of the image file after shrinking the image

2017-09-28 Thread Pavel Butsykin
Now after shrinking the image, at the end of the image file, there might be a tail that probably will never be used. So we can find the last used cluster and cut the tail. Signed-off-by: Pavel Butsykin <pbutsy...@virtuozzo.com> Reviewed-by: John Snow <js...@redhat.com> --- block/qcow

[Qemu-devel] [PATCH v3 0/2] Truncate the tail of the image file in qcow2 shrinking

2017-09-28 Thread Pavel Butsykin
: - report a warning if truncation of the tail of the image file failed. (2) Pavel Butsykin (2): qcow2: fix return error code in qcow2_truncate() qcow2: truncate the tail of the image file after shrinking the image block/qcow2-refcount.c | 22 ++ block/qcow2.c | 27

[Qemu-devel] [PATCH v3 1/2] qcow2: fix return error code in qcow2_truncate()

2017-09-28 Thread Pavel Butsykin
Signed-off-by: Pavel Butsykin <pbutsy...@virtuozzo.com> Reviewed-by: Eric Blake <ebl...@redhat.com> Reviewed-by: John Snow <js...@redhat.com> Reviewed-by: Max Reitz <mre...@redhat.com> --- block/qcow2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

Re: [Qemu-devel] [PATCH v2 2/2] qcow2: truncate the tail of the image file after shrinking the image

2017-09-28 Thread Pavel Butsykin
On 27.09.2017 19:36, Max Reitz wrote: On 2017-09-27 18:27, Pavel Butsykin wrote: On 27.09.2017 19:00, Max Reitz wrote: On 2017-09-22 11:39, Pavel Butsykin wrote: Now after shrinking the image, at the end of the image file, there might be a tail that probably will never be used. So we can find

Re: [Qemu-devel] [PATCH v2 2/2] qcow2: truncate the tail of the image file after shrinking the image

2017-09-27 Thread Pavel Butsykin
On 27.09.2017 19:00, Max Reitz wrote: On 2017-09-22 11:39, Pavel Butsykin wrote: Now after shrinking the image, at the end of the image file, there might be a tail that probably will never be used. So we can find the last used cluster and cut the tail. Signed-off-by: Pavel Butsykin <pbu

Re: [Qemu-devel] [PATCH v2 0/2] Truncate the tail of the image file in qcow2 shrinking

2017-09-22 Thread Pavel Butsykin
On 22.09.2017 12:50, Daniel P. Berrange wrote: On Fri, Sep 22, 2017 at 12:39:24PM +0300, Pavel Butsykin wrote: Now after shrinking the qcow2 image, at the end of the image file, there might be a tail that probably will never be used. Although it will not bring any tangible benefit, we can cut

[Qemu-devel] [PATCH v2 2/2] qcow2: truncate the tail of the image file after shrinking the image

2017-09-22 Thread Pavel Butsykin
Now after shrinking the image, at the end of the image file, there might be a tail that probably will never be used. So we can find the last used cluster and cut the tail. Signed-off-by: Pavel Butsykin <pbutsy...@virtuozzo.com> --- block/qcow2-refcount.c | 22 ++ block

[Qemu-devel] [PATCH v2 0/2] Truncate the tail of the image file in qcow2 shrinking

2017-09-22 Thread Pavel Butsykin
and the image is not heavily fragmented then the virtual size of the image file will be commensurate with the real size. It also doesn't look like a great plus.. Well, at least we can discuss it. Changes from v1: - rewrite qcow2_get_last_cluster() function according to Max's comments. (2) Pavel Butsykin (2

[Qemu-devel] [PATCH v2 1/2] qcow2: fix return error code in qcow2_truncate()

2017-09-22 Thread Pavel Butsykin
Signed-off-by: Pavel Butsykin <pbutsy...@virtuozzo.com> Reviewed-by: Eric Blake <ebl...@redhat.com> Reviewed-by: John Snow <js...@redhat.com> Reviewed-by: Max Reitz <mre...@redhat.com> --- block/qcow2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

Re: [Qemu-devel] [PATCH 2/2] qcow2: truncate the tail of the image file after shrinking the image

2017-09-21 Thread Pavel Butsykin
On 21.09.2017 18:28, Max Reitz wrote: On 2017-09-20 15:58, Pavel Butsykin wrote: Now after shrinking the image, at the end of the image file, there might be a tail that probably will never be used. So we can find the last used cluster and cut the tail. Signed-off-by: Pavel Butsykin <pbu

Re: [Qemu-devel] [PATCH 2/2] qcow2: truncate the tail of the image file after shrinking the image

2017-09-21 Thread Pavel Butsykin
On 21.09.2017 18:30, Max Reitz wrote: On 2017-09-20 15:58, Pavel Butsykin wrote: Now after shrinking the image, at the end of the image file, there might be a tail that probably will never be used. So we can find the last used cluster and cut the tail. Signed-off-by: Pavel Butsykin <pbu

Re: [Qemu-devel] [Qemu-block] [PATCH 2/2] qcow2: truncate the tail of the image file after shrinking the image

2017-09-21 Thread Pavel Butsykin
On 21.09.2017 00:38, John Snow wrote: On 09/20/2017 09:58 AM, Pavel Butsykin wrote: Now after shrinking the image, at the end of the image file, there might be a tail that probably will never be used. So we can find the last used cluster and cut the tail. Signed-off-by: Pavel Butsykin

[Qemu-devel] [PATCH 0/2] Truncate the tail of the image file in qcow2 shrinking

2017-09-20 Thread Pavel Butsykin
and the image is not heavily fragmented then the virtual size of the image file will be commensurate with the real size. It also doesn't look like a great plus.. Well, at least we can discuss it. Pavel Butsykin (2): qcow2: fix return error code in qcow2_truncate() qcow2: truncate the tail of the image

[Qemu-devel] [PATCH 1/2] qcow2: fix return error code in qcow2_truncate()

2017-09-20 Thread Pavel Butsykin
Signed-off-by: Pavel Butsykin <pbutsy...@virtuozzo.com> --- block/qcow2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index 2174a84d1f..8a4311d338 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -3166,7 +3166,7 @@ stat

[Qemu-devel] [PATCH 2/2] qcow2: truncate the tail of the image file after shrinking the image

2017-09-20 Thread Pavel Butsykin
Now after shrinking the image, at the end of the image file, there might be a tail that probably will never be used. So we can find the last used cluster and cut the tail. Signed-off-by: Pavel Butsykin <pbutsy...@virtuozzo.com> --- block/qcow2-refcount.c | 21 + block/q

[Qemu-devel] [PATCH v2] virtio-serial: add enable_backend callback

2017-09-19 Thread Pavel Butsykin
on the destination side. Also RAM access during postcopy-ram migration with enabled release-ram capability can lead to sad consequences. Let's add enable_backend() callback to avoid undesirable virtioqueue changes in the guest memory. Signed-off-by: Pavel Butsykin <pbutsy...@virtuozzo.com> --- C

[Qemu-devel] [PATCH v8 1/4] qemu-img: add --shrink flag for resize

2017-09-18 Thread Pavel Butsykin
The flag is additional precaution against data loss. Perhaps in the future the operation shrink without this flag will be blocked for all formats, but for now we need to maintain compatibility with raw. Signed-off-by: Pavel Butsykin <pbutsy...@virtuozzo.com> Reviewed-by: Max Reit

[Qemu-devel] [PATCH v8 4/4] qemu-iotests: add shrinking image test

2017-09-18 Thread Pavel Butsykin
Signed-off-by: Pavel Butsykin <pbutsy...@virtuozzo.com> Reviewed-by: Max Reitz <mre...@redhat.com> Reviewed-by: John Snow <js...@redhat.com> --- tests/qemu-iotests/163 | 170 + tests/qemu-iotests/163.out | 5 ++ tests/qemu-iot

[Qemu-devel] [PATCH v8 0/4] Add shrink image for qcow2

2017-09-18 Thread Pavel Butsykin
malloc() on g_malloc() for allocation reftable_tmp (3) Changes from v6: - rebase on master 1f29673387 Changes from v7: - fix 106 iotest (1) - minor fixes according to comments (2, 3) - add documentation of the new enum members (3) - add r-b's by Max and John Pavel Butsykin (4): qemu-img: add --sh

[Qemu-devel] [PATCH v8 2/4] qcow2: add qcow2_cache_discard

2017-09-18 Thread Pavel Butsykin
Whenever l2/refcount table clusters are discarded from the file we can automatically drop unnecessary content of the cache tables. This reduces the chance of eviction useful cache data and eliminates inconsistent data in the cache with the data in the file. Signed-off-by: Pavel Butsykin <pbu

[Qemu-devel] [PATCH v8 3/4] qcow2: add shrink image support

2017-09-18 Thread Pavel Butsykin
This patch add shrinking of the image file for qcow2. As a result, this allows us to reduce the virtual image size and free up space on the disk without copying the image. Image can be fragmented and shrink is done by punching holes in the image file. Signed-off-by: Pavel Butsykin <pbu

Re: [Qemu-devel] [PATCH v7 0/4] Add shrink image for qcow2

2017-09-18 Thread Pavel Butsykin
On 16.09.2017 17:56, Max Reitz wrote: On 2017-08-22 01:31, John Snow wrote: On 08/17/2017 05:15 AM, Pavel Butsykin wrote: This patch add shrinking of the image file for qcow2. As a result, this allows us to reduce the virtual image size and free up space on the disk without copying the image

Re: [Qemu-devel] [PATCH] virtio-serial: add enable_backend callback

2017-09-18 Thread Pavel Butsykin
On 15.09.2017 20:09, Paolo Bonzini wrote: On 07/07/2017 16:21, Pavel Butsykin wrote: We should guarantee that RAM will not be modified while VM has a stopped state, otherwise it can lead to negative consequences during post-copy migration. In RUN_STATE_FINISH_MIGRATE step, it's expected

Re: [Qemu-devel] [PATCH] virtio-serial: add enable_backend callback

2017-09-15 Thread Pavel Butsykin
On 17.07.2017 16:56, Pavel Butsykin wrote: On 07.07.2017 17:21, Pavel Butsykin wrote: We should guarantee that RAM will not be modified while VM has a stopped state, otherwise it can lead to negative consequences during post-copy migration. In RUN_STATE_FINISH_MIGRATE step, it's expected

Re: [Qemu-devel] [PATCH v7 0/4] Add shrink image for qcow2

2017-09-15 Thread Pavel Butsykin
On 17.08.2017 12:15, Pavel Butsykin wrote: This patch add shrinking of the image file for qcow2. As a result, this allows us to reduce the virtual image size and free up space on the disk without copying the image. Image can be fragmented and shrink is done by punching holes in the image file

Re: [Qemu-devel] [PATCH] qcow2: move qcow2_store_persistent_dirty_bitmaps() before cache flushing

2017-09-06 Thread Pavel Butsykin
On 05.09.2017 22:30, Eric Blake wrote: On 09/04/2017 05:18 AM, Pavel Butsykin wrote: After calling qcow2_inactivate(), all qcow2 caches must be flushed, but this may not happen, because the last call qcow2_store_persistent_dirty_bitmaps() can lead to marking l2/refcont cache as dirty. Let's

[Qemu-devel] [PATCH] qcow2: move qcow2_store_persistent_dirty_bitmaps() before cache flushing

2017-09-04 Thread Pavel Butsykin
-off-by: Pavel Butsykin <pbutsy...@virtuozzo.com> --- block/qcow2.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index a3679c69e8..dcf49084c5 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -2037,6 +2037,14 @@ stat

[Qemu-devel] [PATCH] follow-up path - " qcow2: add shrink image support"

2017-08-17 Thread Pavel Butsykin
Signed-off-by: Pavel Butsykin <pbutsy...@virtuozzo.com> --- qapi/block-core.json | 5 + 1 file changed, 5 insertions(+) diff --git a/qapi/block-core.json b/qapi/block-core.json index d6172bfe15..c55cd0c8db 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -2479,6 +2

Re: [Qemu-devel] [Qemu-block] [PATCH v6 0/4] Add shrink image for qcow2

2017-08-17 Thread Pavel Butsykin
replace g_try_malloc() on g_malloc() for allocation reftable_tmp (3) Pavel Butsykin (4): qemu-img: add --shrink flag for resize qcow2: add qcow2_cache_discard qcow2: add shrink image support qemu-iotests: add shrinking image test block/qcow2-cache.c| 26 +++ b

[Qemu-devel] [PATCH v7 4/4] qemu-iotests: add shrinking image test

2017-08-17 Thread Pavel Butsykin
Signed-off-by: Pavel Butsykin <pbutsy...@virtuozzo.com> Reviewed-by: Max Reitz <mre...@redhat.com> --- tests/qemu-iotests/163 | 170 + tests/qemu-iotests/163.out | 5 ++ tests/qemu-iotests/group | 1 + 3 files changed, 17

[Qemu-devel] [PATCH v7 3/4] qcow2: add shrink image support

2017-08-17 Thread Pavel Butsykin
This patch add shrinking of the image file for qcow2. As a result, this allows us to reduce the virtual image size and free up space on the disk without copying the image. Image can be fragmented and shrink is done by punching holes in the image file. Signed-off-by: Pavel Butsykin <pbu

[Qemu-devel] [PATCH v7 2/4] qcow2: add qcow2_cache_discard

2017-08-17 Thread Pavel Butsykin
Whenever l2/refcount table clusters are discarded from the file we can automatically drop unnecessary content of the cache tables. This reduces the chance of eviction useful cache data and eliminates inconsistent data in the cache with the data in the file. Signed-off-by: Pavel Butsykin <pbu

[Qemu-devel] [PATCH v7 1/4] qemu-img: add --shrink flag for resize

2017-08-17 Thread Pavel Butsykin
The flag is additional precaution against data loss. Perhaps in the future the operation shrink without this flag will be blocked for all formats, but for now we need to maintain compatibility with raw. Signed-off-by: Pavel Butsykin <pbutsy...@virtuozzo.com> Reviewed-by: Max Reit

[Qemu-devel] [PATCH v7 0/4] Add shrink image for qcow2

2017-08-17 Thread Pavel Butsykin
malloc() on g_malloc() for allocation reftable_tmp (3) Changes from v6: - rebase on master 1f29673387 Pavel Butsykin (4): qemu-img: add --shrink flag for resize qcow2: add qcow2_cache_discard qcow2: add shrink image support qemu-iotests: add shrinking image test block/qcow2-cache.c

Re: [Qemu-devel] [PATCH] virtio-serial: add enable_backend callback

2017-07-17 Thread Pavel Butsykin
On 07.07.2017 17:21, Pavel Butsykin wrote: We should guarantee that RAM will not be modified while VM has a stopped state, otherwise it can lead to negative consequences during post-copy migration. In RUN_STATE_FINISH_MIGRATE step, it's expected that RAM on source side will not be modified

[Qemu-devel] [PATCH v6 1/4] qemu-img: add --shrink flag for resize

2017-07-14 Thread Pavel Butsykin
The flag is additional precaution against data loss. Perhaps in the future the operation shrink without this flag will be blocked for all formats, but for now we need to maintain compatibility with raw. Signed-off-by: Pavel Butsykin <pbutsy...@virtuozzo.com> Reviewed-by: Max Reit

[Qemu-devel] [PATCH v6 0/4] Add shrink image for qcow2

2017-07-14 Thread Pavel Butsykin
malloc() on g_malloc() for allocation reftable_tmp (3) Pavel Butsykin (4): qemu-img: add --shrink flag for resize qcow2: add qcow2_cache_discard qcow2: add shrink image support qemu-iotests: add shrinking image test block/qcow2-cache.c| 26 +++ block/qcow2-cluster.c | 50

[Qemu-devel] [PATCH v6 3/4] qcow2: add shrink image support

2017-07-14 Thread Pavel Butsykin
This patch add shrinking of the image file for qcow2. As a result, this allows us to reduce the virtual image size and free up space on the disk without copying the image. Image can be fragmented and shrink is done by punching holes in the image file. Signed-off-by: Pavel Butsykin <pbu

[Qemu-devel] [PATCH v6 4/4] qemu-iotests: add shrinking image test

2017-07-14 Thread Pavel Butsykin
Signed-off-by: Pavel Butsykin <pbutsy...@virtuozzo.com> Reviewed-by: Max Reitz <mre...@redhat.com> --- tests/qemu-iotests/163 | 170 + tests/qemu-iotests/163.out | 5 ++ tests/qemu-iotests/group | 1 + 3 files changed, 17

[Qemu-devel] [PATCH v6 2/4] qcow2: add qcow2_cache_discard

2017-07-14 Thread Pavel Butsykin
Whenever l2/refcount table clusters are discarded from the file we can automatically drop unnecessary content of the cache tables. This reduces the chance of eviction useful cache data and eliminates inconsistent data in the cache with the data in the file. Signed-off-by: Pavel Butsykin <pbu

Re: [Qemu-devel] [PATCH v5 3/4] qcow2: add shrink image support

2017-07-13 Thread Pavel Butsykin
On 13.07.2017 17:36, Max Reitz wrote: On 2017-07-13 10:41, Kevin Wolf wrote: Am 12.07.2017 um 18:58 hat Max Reitz geschrieben: On 2017-07-12 16:52, Kevin Wolf wrote: Am 12.07.2017 um 13:46 hat Pavel Butsykin geschrieben: This patch add shrinking of the image file for qcow2. As a result

Re: [Qemu-devel] [PATCH v5 3/4] qcow2: add shrink image support

2017-07-13 Thread Pavel Butsykin
On 13.07.2017 11:41, Kevin Wolf wrote: Am 12.07.2017 um 18:58 hat Max Reitz geschrieben: On 2017-07-12 16:52, Kevin Wolf wrote: Am 12.07.2017 um 13:46 hat Pavel Butsykin geschrieben: This patch add shrinking of the image file for qcow2. As a result, this allows us to reduce the virtual image

Re: [Qemu-devel] [PATCH v5 2/4] qcow2: add qcow2_cache_discard

2017-07-13 Thread Pavel Butsykin
On 12.07.2017 17:45, Kevin Wolf wrote: Am 12.07.2017 um 13:46 hat Pavel Butsykin geschrieben: Whenever l2/refcount table clusters are discarded from the file we can automatically drop unnecessary content of the cache tables. This reduces the chance of eviction useful cache data and eliminates

[Qemu-devel] [PATCH v5 1/4] qemu-img: add --shrink flag for resize

2017-07-12 Thread Pavel Butsykin
The flag is additional precaution against data loss. Perhaps in the future the operation shrink without this flag will be blocked for all formats, but for now we need to maintain compatibility with raw. Signed-off-by: Pavel Butsykin <pbutsy...@virtuozzo.com> Reviewed-by: Max Reit

[Qemu-devel] [PATCH v5 4/4] qemu-iotests: add shrinking image test

2017-07-12 Thread Pavel Butsykin
Signed-off-by: Pavel Butsykin <pbutsy...@virtuozzo.com> Reviewed-by: Max Reitz <mre...@redhat.com> --- tests/qemu-iotests/163 | 170 + tests/qemu-iotests/163.out | 5 ++ tests/qemu-iotests/group | 1 + 3 files changed, 17

[Qemu-devel] [PATCH v5 3/4] qcow2: add shrink image support

2017-07-12 Thread Pavel Butsykin
This patch add shrinking of the image file for qcow2. As a result, this allows us to reduce the virtual image size and free up space on the disk without copying the image. Image can be fragmented and shrink is done by punching holes in the image file. Signed-off-by: Pavel Butsykin <pbu

[Qemu-devel] [PATCH v5 2/4] qcow2: add qcow2_cache_discard

2017-07-12 Thread Pavel Butsykin
Whenever l2/refcount table clusters are discarded from the file we can automatically drop unnecessary content of the cache tables. This reduces the chance of eviction useful cache data and eliminates inconsistent data in the cache with the data in the file. Signed-off-by: Pavel Butsykin <pbu

[Qemu-devel] [PATCH v5 0/4] Add shrink image for qcow2

2017-07-12 Thread Pavel Butsykin
c/qemu/commits/block Max's block branch Pavel Butsykin (4): qemu-img: add --shrink flag for resize qcow2: add qcow2_cache_discard qcow2: add shrink image support qemu-iotests: add shrinking image test block/qcow2-cache.c| 26 +++ block/qcow2-cluster.c | 40

Re: [Qemu-devel] [PATCH v4 0/4] Add shrink image for qcow2

2017-07-11 Thread Pavel Butsykin
On 11.07.2017 16:14, no-re...@patchew.org wrote: Hi, This series failed build test on s390x host. Please find the details below. Type: series Subject: [Qemu-devel] [PATCH v4 0/4] Add shrink image for qcow2 Message-id: 20170711124024.1396-1-pbutsy...@virtuozzo.com Because this series is

[Qemu-devel] [PATCH v4 4/4] qemu-iotests: add shrinking image test

2017-07-11 Thread Pavel Butsykin
Signed-off-by: Pavel Butsykin <pbutsy...@virtuozzo.com> --- tests/qemu-iotests/163 | 170 + tests/qemu-iotests/163.out | 5 ++ tests/qemu-iotests/group | 1 + 3 files changed, 176 insertions(+) create mode 100644 tests/qemu-iotes

[Qemu-devel] [PATCH v4 3/4] qcow2: add shrink image support

2017-07-11 Thread Pavel Butsykin
This patch add shrinking of the image file for qcow2. As a result, this allows us to reduce the virtual image size and free up space on the disk without copying the image. Image can be fragmented and shrink is done by punching holes in the image file. Signed-off-by: Pavel Butsykin <pbu

[Qemu-devel] [PATCH v4 0/4] Add shrink image for qcow2

2017-07-11 Thread Pavel Butsykin
) Changes from v3: - rebase on "Implement a warning_report function" Alistair's patch-set (1) - spelling fixes (1) - the man page fix according to the discussion (1) - add call qcow2_signal_corruption() in case of image corruption (3) Pavel Butsykin (4): qemu-img: add --shrink flag for

[Qemu-devel] [PATCH v4 2/4] qcow2: add qcow2_cache_discard

2017-07-11 Thread Pavel Butsykin
Whenever l2/refcount table clusters are discarded from the file we can automatically drop unnecessary content of the cache tables. This reduces the chance of eviction useful cache data and eliminates inconsistent data in the cache with the data in the file. Signed-off-by: Pavel Butsykin <pbu

[Qemu-devel] [PATCH v4 1/4] qemu-img: add --shrink flag for resize

2017-07-11 Thread Pavel Butsykin
The flag is additional precaution against data loss. Perhaps in the future the operation shrink without this flag will be blocked for all formats, but for now we need to maintain compatibility with raw. Signed-off-by: Pavel Butsykin <pbutsy...@virtuozzo.com> Reviewed-by: Max Reit

Re: [Qemu-devel] [PATCH] virtio-serial: add enable_backend callback

2017-07-10 Thread Pavel Butsykin
On 10.07.2017 17:13, Laurent Vivier wrote: On 07/07/2017 16:21, Pavel Butsykin wrote: We should guarantee that RAM will not be modified while VM has a stopped state, otherwise it can lead to negative consequences during post-copy migration. In RUN_STATE_FINISH_MIGRATE step, it's expected

[Qemu-devel] [PATCH v3 4/4] qemu-iotests: add shrinking image test

2017-07-07 Thread Pavel Butsykin
Signed-off-by: Pavel Butsykin <pbutsy...@virtuozzo.com> --- tests/qemu-iotests/163 | 170 + tests/qemu-iotests/163.out | 5 ++ tests/qemu-iotests/group | 1 + 3 files changed, 176 insertions(+) create mode 100644 tests/qemu-iotes

[Qemu-devel] [PATCH v3 2/4] qcow2: add qcow2_cache_discard

2017-07-07 Thread Pavel Butsykin
Whenever l2/refcount table clusters are discarded from the file we can automatically drop unnecessary content of the cache tables. This reduces the chance of eviction useful cache data and eliminates inconsistent data in the cache with the data in the file. Signed-off-by: Pavel Butsykin <pbu

[Qemu-devel] [PATCH v3 3/4] qcow2: add shrink image support

2017-07-07 Thread Pavel Butsykin
This patch add shrinking of the image file for qcow2. As a result, this allows us to reduce the virtual image size and free up space on the disk without copying the image. Image can be fragmented and shrink is done by punching holes in the image file. Signed-off-by: Pavel Butsykin <pbu

[Qemu-devel] [PATCH v3 1/4] qemu-img: add --shrink flag for resize

2017-07-07 Thread Pavel Butsykin
The flag as additional precaution of data loss. Perhaps in the future the operation shrink without this flag will be blocked for all formats, but while we need to maintain compatibility with raw. Signed-off-by: Pavel Butsykin <pbutsy...@virtuozzo.com> --- qemu-img-cmds.hx | 4 ++--

[Qemu-devel] [PATCH v3 0/4] Add shrink image for qcow2

2017-07-07 Thread Pavel Butsykin
te warning messages (1) - enforce --shrink flag for all formats except raw (1) - split qcow2_cache_discard() (2) - minor fixes according to comments (3) - rewrite the last part of qcow2_shrink_reftable() to avoid qcow2_free_clusters() calls inside (3) - improve test for shrinking image (4) Pavel B

[Qemu-devel] [PATCH] virtio-serial: add enable_backend callback

2017-07-07 Thread Pavel Butsykin
on the destination side. Also RAM access during postcopy-ram migration with enabled release-ram capability can lead to sad consequences. Let's add enable_backend() callback to avoid undesirable virtioqueue changes in the guest memory. Signed-off-by: Pavel Butsykin <pbutsy...@virtuozzo.com> -

Re: [Qemu-devel] [PATCH 0/5] qemu-iotests: test savevm/loadvm iothread (and make it work!)

2017-07-05 Thread Pavel Butsykin
On 05.07.2017 15:55, Stefan Hajnoczi wrote: On Mon, Jun 19, 2017 at 03:26:56PM +0300, Pavel Butsykin wrote: On 15.06.2017 19:38, Stefan Hajnoczi wrote: This series extends qemu-iotests 068 to also run with iothread enabled. Doing so was harder than expected because: 1. ioeventfd is disabled

Re: [Qemu-devel] [PATCH v2 3/4] qcow2: add shrink image support

2017-06-28 Thread Pavel Butsykin
On 28.06.2017 16:59, Max Reitz wrote: On 2017-06-27 17:06, Pavel Butsykin wrote: On 26.06.2017 20:47, Max Reitz wrote: On 2017-06-26 17:23, Pavel Butsykin wrote: [] Is there any guarantee that in the future this will not change? Because in this case it can be a potential danger. Since

Re: [Qemu-devel] [PATCH v2 3/4] qcow2: add shrink image support

2017-06-27 Thread Pavel Butsykin
On 26.06.2017 20:47, Max Reitz wrote: On 2017-06-26 17:23, Pavel Butsykin wrote: [] Is there any guarantee that in the future this will not change? Because in this case it can be a potential danger. Since this behavior is not documented anywhere, there is no guarantee. I can add a comment

Re: [Qemu-devel] [PATCH v2 3/4] qcow2: add shrink image support

2017-06-26 Thread Pavel Butsykin
On 23.06.2017 18:46, Max Reitz wrote: On 2017-06-22 15:57, Pavel Butsykin wrote: On 22.06.2017 01:55, Max Reitz wrote: On 2017-06-13 14:16, Pavel Butsykin wrote: [] +} +qcow2_cache_put(bs, s->refcount_block_cache, ); + +reftable_tmp[i] = unused_block

Re: [Qemu-devel] [PATCH v2 1/4] qemu-img: add --shrink flag for resize

2017-06-22 Thread Pavel Butsykin
On 22.06.2017 17:49, Kevin Wolf wrote: Am 22.06.2017 um 15:54 hat Pavel Butsykin geschrieben: On 22.06.2017 01:17, Max Reitz wrote: On 2017-06-13 14:16, Pavel Butsykin wrote: The flag as additional precaution of data loss. Perhaps in the future the operation shrink without this flag

Re: [Qemu-devel] [PATCH v2 3/4] qcow2: add shrink image support

2017-06-22 Thread Pavel Butsykin
On 22.06.2017 01:55, Max Reitz wrote: On 2017-06-13 14:16, Pavel Butsykin wrote: This patch add shrinking of the image file for qcow2. As a result, this allows us to reduce the virtual image size and free up space on the disk without copying the image. Image can be fragmented and shrink

Re: [Qemu-devel] [PATCH v2 2/4] qcow2: add qcow2_cache_discard

2017-06-22 Thread Pavel Butsykin
On 22.06.2017 01:29, Max Reitz wrote: On 2017-06-13 14:16, Pavel Butsykin wrote: Whenever l2/refcount table clusters are discarded from the file we can automatically drop unnecessary content of the cache tables. This reduces the chance of eviction useful cache data and eliminates inconsistent

Re: [Qemu-devel] [PATCH v2 1/4] qemu-img: add --shrink flag for resize

2017-06-22 Thread Pavel Butsykin
On 22.06.2017 01:17, Max Reitz wrote: On 2017-06-13 14:16, Pavel Butsykin wrote: The flag as additional precaution of data loss. Perhaps in the future the operation shrink without this flag will be banned, but while we need to maintain compatibility. Signed-off-by: Pavel Butsykin <pbu

Re: [Qemu-devel] [PATCH 0/5] qemu-iotests: test savevm/loadvm iothread (and make it work!)

2017-06-19 Thread Pavel Butsykin
On 15.06.2017 19:38, Stefan Hajnoczi wrote: This series extends qemu-iotests 068 to also run with iothread enabled. Doing so was harder than expected because: 1. ioeventfd is disabled without -M accel=kvm even though it should work 2. loadvm still has an iothread bug Instead of adding a

Re: [Qemu-devel] [PATCH v3 3/4] migration: avoid recursive AioContext locking in save_vmstate()

2017-06-15 Thread Pavel Butsykin
On 14.06.2017 17:43, Kevin Wolf wrote: Am 14.06.2017 um 15:15 hat Pavel Butsykin geschrieben: On 14.06.2017 13:10, Pavel Butsykin wrote: On 22.05.2017 16:57, Stefan Hajnoczi wrote: AioContext was designed to allow nested acquire/release calls. It uses a recursive mutex so callers don't need

Re: [Qemu-devel] [PATCH v3 3/4] migration: avoid recursive AioContext locking in save_vmstate()

2017-06-14 Thread Pavel Butsykin
On 14.06.2017 13:10, Pavel Butsykin wrote: On 22.05.2017 16:57, Stefan Hajnoczi wrote: AioContext was designed to allow nested acquire/release calls. It uses a recursive mutex so callers don't need to worry about nesting...or so we thought. BDRV_POLL_WHILE() is used to wait for block I/O

Re: [Qemu-devel] [PATCH v3 3/4] migration: avoid recursive AioContext locking in save_vmstate()

2017-06-14 Thread Pavel Butsykin
On 22.05.2017 16:57, Stefan Hajnoczi wrote: AioContext was designed to allow nested acquire/release calls. It uses a recursive mutex so callers don't need to worry about nesting...or so we thought. BDRV_POLL_WHILE() is used to wait for block I/O requests. It releases the AioContext

[Qemu-devel] [PATCH v2 4/4] qemu-iotests: add shrinking image test

2017-06-13 Thread Pavel Butsykin
Signed-off-by: Pavel Butsykin <pbutsy...@virtuozzo.com> --- tests/qemu-iotests/163 | 113 + tests/qemu-iotests/163.out | 5 ++ tests/qemu-iotests/group | 1 + 3 files changed, 119 insertions(+) create mode 100644 tests/qemu-iotes

[Qemu-devel] [PATCH v2 3/4] qcow2: add shrink image support

2017-06-13 Thread Pavel Butsykin
This patch add shrinking of the image file for qcow2. As a result, this allows us to reduce the virtual image size and free up space on the disk without copying the image. Image can be fragmented and shrink is done by punching holes in the image file. Signed-off-by: Pavel Butsykin <pbu

[Qemu-devel] [PATCH v2 1/4] qemu-img: add --shrink flag for resize

2017-06-13 Thread Pavel Butsykin
The flag as additional precaution of data loss. Perhaps in the future the operation shrink without this flag will be banned, but while we need to maintain compatibility. Signed-off-by: Pavel Butsykin <pbutsy...@virtuozzo.com> --- qemu-img-cmds.hx | 4 ++-- qemu-img.c

[Qemu-devel] [PATCH v2 2/4] qcow2: add qcow2_cache_discard

2017-06-13 Thread Pavel Butsykin
Whenever l2/refcount table clusters are discarded from the file we can automatically drop unnecessary content of the cache tables. This reduces the chance of eviction useful cache data and eliminates inconsistent data in thecache with the data in the file. Signed-off-by: Pavel Butsykin <pbu

[Qemu-devel] [PATCH v2 0/4] Add shrink image for qcow2

2017-06-13 Thread Pavel Butsykin
e # du -h ./image.qcow2 129M./image.qcow2 Changes from v1: - add --shrink flag for qemu-img resize - add qcow2_cache_discard - simplify qcow2_shrink_l1_table() to reduce the likelihood of image corruption - add new qemu-iotests for shrinking images Pavel Butsykin (4): qemu-img: add --s

Re: [Qemu-devel] [PATCH 1/2] qcow2: add reduce image support

2017-06-02 Thread Pavel Butsykin
On 01.06.2017 17:41, Kevin Wolf wrote: Am 31.05.2017 um 16:43 hat Pavel Butsykin geschrieben: This patch adds the reduction of the image file for qcow2. As a result, this allows us to reduce the virtual image size and free up space on the disk without copying the image. Image can

Re: [Qemu-devel] [PATCH 0/2] Add reduce image for qcow2

2017-05-31 Thread Pavel Butsykin
On 31.05.2017 19:10, Richard W.M. Jones wrote: On Wed, May 31, 2017 at 06:54:33PM +0300, Pavel Butsykin wrote: It is assumed that the user has already made a preparatory with the image: 1. freeing space at the end of the image 2. reducing the last partition on the disk 3. rebuilding fs Only

Re: [Qemu-devel] [PATCH 0/2] Add reduce image for qcow2

2017-05-31 Thread Pavel Butsykin
On 31.05.2017 19:03, Max Reitz wrote: On 2017-05-31 17:54, Pavel Butsykin wrote: On 31.05.2017 18:03, Eric Blake wrote: On 05/31/2017 09:43 AM, Pavel Butsykin wrote: This patch adds the reduction of the image file for qcow2. As a result, this allows us to reduce the virtual image size

Re: [Qemu-devel] [PATCH 0/2] Add reduce image for qcow2

2017-05-31 Thread Pavel Butsykin
On 31.05.2017 18:03, Eric Blake wrote: On 05/31/2017 09:43 AM, Pavel Butsykin wrote: This patch adds the reduction of the image file for qcow2. As a result, this allows us to reduce the virtual image size and free up space on the disk without copying the image. Image can be fragmented

Re: [Qemu-devel] [PATCH 2/2] qemu-iotests: add reducing image test in 025

2017-05-31 Thread Pavel Butsykin
On 31.05.2017 17:43, Pavel Butsykin wrote: Signed-off-by: Pavel Butsykin <pbutsy...@virtuozzo.com> --- tests/qemu-iotests/025 | 19 +-- tests/qemu-iotests/025.out | 12 +++- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/tests/qemu-iotests

[Qemu-devel] [PATCH 0/2] Add reduce image for qcow2

2017-05-31 Thread Pavel Butsykin
upt: false # du -h image.qcow2 129Mimage.qcow2 Pavel Butsykin (2): qcow2: add reduce image support qemu-iotests: add reducing image test in 025 block/qcow2-cache.c| 8 + block/qcow2-cluster.c | 83 ++ block/qcow2-refcount.

[Qemu-devel] [PATCH 2/2] qemu-iotests: add reducing image test in 025

2017-05-31 Thread Pavel Butsykin
Signed-off-by: Pavel Butsykin <pbutsy...@virtuozzo.com> --- tests/qemu-iotests/025 | 19 +-- tests/qemu-iotests/025.out | 12 +++- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/tests/qemu-iotests/025 b/tests/qemu-iotests/025 index f5e6

[Qemu-devel] [PATCH 1/2] qcow2: add reduce image support

2017-05-31 Thread Pavel Butsykin
This patch adds the reduction of the image file for qcow2. As a result, this allows us to reduce the virtual image size and free up space on the disk without copying the image. Image can be fragmented and reduction is done by punching holes in the image file. Signed-off-by: Pavel Butsykin <pbu

Re: [Qemu-devel] [PATCH v2 0/3] migration capability to discard the migrated ram pages

2017-03-07 Thread Pavel Butsykin
On 07.03.2017 16:56, Dr. David Alan Gilbert wrote: * Pavel Butsykin (pbutsy...@virtuozzo.com) wrote: On 14.02.2017 17:02, Dr. David Alan Gilbert wrote: Hi Pavel, I was curious, having merged this, how you're using postcopy; do you switch into postcopy mode immediately or wait until

Re: [Qemu-devel] [PATCH v2 0/3] migration capability to discard the migrated ram pages

2017-03-07 Thread Pavel Butsykin
On 07.03.2017 17:46, Dr. David Alan Gilbert wrote: * Pavel Butsykin (pbutsy...@virtuozzo.com) wrote: On 07.03.2017 16:56, Dr. David Alan Gilbert wrote: * Pavel Butsykin (pbutsy...@virtuozzo.com) wrote: On 14.02.2017 17:02, Dr. David Alan Gilbert wrote: Hi Pavel, I was curious, having

Re: [Qemu-devel] [PATCH v2 0/3] migration capability to discard the migrated ram pages

2017-03-03 Thread Pavel Butsykin
mode is done immediately, the size of VMs can be very different. * Pavel Butsykin (pbutsy...@virtuozzo.com) wrote: This feature frees the migrated memory on the source during postcopy-ram migration. In the second step of postcopy-ram migration when the source vm is put on pause we can free

[Qemu-devel] [PATCH] migration: madvise error_report fixup!

2017-02-10 Thread Pavel Butsykin
Signed-off-by: Pavel Butsykin <pbutsy...@virtuozzo.com> --- migration/qemu-file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/migration/qemu-file.c b/migration/qemu-file.c index 82dbef3c86..195fa94fcf 100644 --- a/migration/qemu-file.c +++ b/migration/qemu-

[Qemu-devel] [PATCH v2 0/3] migration capability to discard the migrated ram pages

2017-02-03 Thread Pavel Butsykin
ase memory in complete precopy (tie release-ram to postcopy) Pavel Butsykin (3): migration: add MigrationState arg for ram_save_/compressed_/page() add 'release-ram' migrate capability migration: discard non-dirty ram pages after the start of postcopy include/migration/migration.h | 2 ++ include

[Qemu-devel] [PATCH v2 1/3] migration: add MigrationState arg for ram_save_/compressed_/page()

2017-02-03 Thread Pavel Butsykin
Cosmetic patch. The use of ms variable instead of migrate_get_current() looks nicer, especially when there reuse. Signed-off-by: Pavel Butsykin <pbutsy...@virtuozzo.com> --- migration/ram.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/migration/r

[Qemu-devel] [PATCH v2 3/3] migration: discard non-dirty ram pages after the start of postcopy

2017-02-03 Thread Pavel Butsykin
After the start of postcopy migration there are some non-dirty pages which have already been migrated. These pages are no longer needed on the source vm so that we can free them and it doen't hurt to complete the migration. Signed-off-by: Pavel Butsykin <pbutsy...@virtuozzo.com> --- i

[Qemu-devel] [PATCH v2 2/3] add 'release-ram' migrate capability

2017-02-03 Thread Pavel Butsykin
-balancing scenario. Signed-off-by: Pavel Butsykin <pbutsy...@virtuozzo.com> --- include/migration/migration.h | 1 + include/migration/qemu-file.h | 3 ++- migration/migration.c | 9 +++ migration/qemu-file.c | 59 ++- migration

Re: [Qemu-devel] [PATCH 1/2] add 'discard-ram' migrate capability

2017-01-30 Thread Pavel Butsykin
On 27.01.2017 14:01, Dr. David Alan Gilbert wrote: * Pavel Butsykin (pbutsy...@virtuozzo.com) wrote: This feature frees the migrated memory on the source during postcopy-ram migration. In the second step of postcopy-ram migration when the source vm is put on pause we can free unnecessary memory

Re: [Qemu-devel] [PATCH 2/2] migration: discard non-dirty ram pages after the start of postcopy

2017-01-30 Thread Pavel Butsykin
On 27.01.2017 14:39, Dr. David Alan Gilbert wrote: * Pavel Butsykin (pbutsy...@virtuozzo.com) wrote: After the start of postcopy migration there are some non-dirty pages which have already been migrated. These pages are no longer needed on the source vm so that we can free them and it doen't

  1   2   3   >