Re: [Qemu-devel] [PATCH 1/5 for-2.11?] qcow2: reject unaligned offsets in write compressed

2017-11-14 Thread Anton Nefedov
On 14/11/2017 7:50 PM, Eric Blake wrote: On 11/14/2017 04:16 AM, Anton Nefedov wrote: Misaligned compressed write is not supported. Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- block/qcow2.c | 4 1 file changed, 4 insertions(+) Should this one be applied i

[Qemu-devel] [PATCH 4/5] block-stream: add compress option

2017-11-14 Thread Anton Nefedov
Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- qapi/block-core.json | 4 include/block/block_int.h | 4 +++- block/stream.c| 16 blockdev.c| 13 - hmp.c | 2 ++ hmp-commands.hx

[Qemu-devel] [PATCH 2/5] qcow2: multiple clusters write compressed

2017-11-14 Thread Anton Nefedov
large requests into separate clusters and write using existing functionality. For unaligned requests we use a workaround and do write data without compression. Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- block/qcow2.c | 77 +++---

[Qemu-devel] [PATCH 5/5] iotest 030: add compressed block-stream test

2017-11-14 Thread Anton Nefedov
Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- tests/qemu-iotests/030 | 69 +- tests/qemu-iotests/030.out | 4 +-- 2 files changed, 70 insertions(+), 3 deletions(-) diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030

[Qemu-devel] [PATCH 0/5] compressed block-stream

2017-11-14 Thread Anton Nefedov
It might be useful to compress images during block-stream; this way the user can merge compressed images of a backing chain and the result will remain compressed. Anton Nefedov (4): qcow2: reject unaligned offsets in write compressed block: support compressed write for copy-on-read block

[Qemu-devel] [PATCH 1/5] qcow2: reject unaligned offsets in write compressed

2017-11-14 Thread Anton Nefedov
Misaligned compressed write is not supported. Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- block/qcow2.c | 4 1 file changed, 4 insertions(+) diff --git a/block/qcow2.c b/block/qcow2.c index 92cb9f9..45c5651 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -

[Qemu-devel] [PATCH 3/5] block: support compressed write for copy-on-read

2017-11-14 Thread Anton Nefedov
Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- block/io.c | 30 -- block/trace-events | 2 +- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/block/io.c b/block/io.c index 3d5ef2c..93c6b24 100644 --- a/block/io.c +++ b

Re: [Qemu-devel] [Qemu-block] segfault in parallel blockjobs (iotest 30)

2017-11-08 Thread Anton Nefedov
On 8/11/2017 5:45 PM, Alberto Garcia wrote: On Tue 07 Nov 2017 05:19:41 PM CET, Anton Nefedov wrote: BlockBackend gets deleted by another job's stream_complete(), deferred to the main loop, so the fact that the job is put to sleep by bdrv_drain_all_begin() doesn't really stop it from

[Qemu-devel] segfault in parallel blockjobs (iotest 30)

2017-11-07 Thread Anton Nefedov
Hi, One more drainage-related thing. We have recently encountered an issue with parallel block jobs and it's not quite clear how to fix it properly, so would appreciate your ideas. The small attached tweak makes iotest 30 (-qcow2 -nocache) fail 10/10 times on my machine. And while most of the

[Qemu-devel] [PATCH v5 15/15] iotest 134: test cluster-misaligned encrypted write

2017-11-01 Thread Anton Nefedov
COW (even empty/zero) areas require encryption too Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- tests/qemu-iotests/134 | 9 + tests/qemu-iotests/134.out | 10 ++ 2 files changed, 19 insertions(+) diff --git a/tests/qemu-iotests/134 b/tests/qemu-iotes

[Qemu-devel] [PATCH v5 12/15] qcow2: check space leak at the end of the image

2017-11-01 Thread Anton Nefedov
-by: Denis V. Lunev <d...@openvz.org> Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- block/qcow2.c | 32 + tests/qemu-iotests/026.out | 94 +- tests/qemu-iote

[Qemu-devel] [PATCH v5 10/15] qcow2: set inactive flag

2017-11-01 Thread Anton Nefedov
Qcow2State and BlockDriverState flags have to be in sync Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- block/qcow2.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/qcow2.c b/block/qcow2.c index 3899524..f41aaac 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -

[Qemu-devel] [PATCH v5 06/15] block: support BDRV_REQ_ALLOCATE in passthrough drivers

2017-11-01 Thread Anton Nefedov
Support the flag if the underlying BDS supports it Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> Reviewed-by: Alberto Garcia <be...@igalia.com> --- block/blkdebug.c | 3 ++- block/blkverify.c | 2 +- block/mirror.c | 2 +- block/raw-format.c | 3 ++- 4 file

[Qemu-devel] [PATCH v5 07/15] qcow2: move is_zero() up

2017-11-01 Thread Anton Nefedov
To be used in the following commit without a forward declaration. Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- block/qcow2.c | 35 +-- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index 9

[Qemu-devel] [PATCH v5 04/15] block: treat BDRV_REQ_ALLOCATE as serialising

2017-11-01 Thread Anton Nefedov
request is in flight already. Return EAGAIN, let the caller reconsider. Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- block/io.c | 27 +++ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/block/io.c b/block/io.c index 7506207..1e07a0b

[Qemu-devel] [PATCH v5 14/15] iotest 198: test BDRV_REQ_ALLOCATE

2017-11-01 Thread Anton Nefedov
Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- tests/qemu-iotests/198 | 146 + tests/qemu-iotests/198.out | 50 tests/qemu-iotests/group | 1 + 3 files changed, 197 insertions(+) create mode 100755 test

[Qemu-devel] [PATCH v5 05/15] file-posix: support BDRV_REQ_ALLOCATE

2017-11-01 Thread Anton Nefedov
Current write_zeroes implementation is good enough to satisfy this flag too Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> Reviewed-by: Alberto Garcia <be...@igalia.com> --- block/file-posix.c | 8 1 file changed, 8 insertions(+) diff --git a/block/file-posix.c

[Qemu-devel] [PATCH v5 01/15] mirror: inherit supported write/zero flags

2017-11-01 Thread Anton Nefedov
Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> Reviewed-by: Eric Blake <ebl...@redhat.com> --- block/mirror.c | 5 + 1 file changed, 5 insertions(+) diff --git a/block/mirror.c b/block/mirror.c index 307b639..19c8987 100644 --- a/block/mirror.c +++ b/block/mirror.

[Qemu-devel] [PATCH v5 13/15] qcow2: do not zero out clusters if already preallocated

2017-11-01 Thread Anton Nefedov
if space preallocation feature is used, it can be detected that the space is already zeroes, so COW can be skipped without additional zeroing of the clusters. Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- block/qcow2.h | 6 ++ block/qcow2-cluster.c | 2 ++

[Qemu-devel] [PATCH v5 11/15] qcow2: truncate preallocated space

2017-11-01 Thread Anton Nefedov
From: "Denis V. Lunev" <d...@openvz.org> This could be done after calculation of the end of data and metadata in the qcow2 image. Signed-off-by: Denis V. Lunev <d...@openvz.org> Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- block/qcow2.h |

[Qemu-devel] [PATCH v5 03/15] block: introduce BDRV_REQ_ALLOCATE flag

2017-11-01 Thread Anton Nefedov
- and the common block layer (so it will not fall back to any slowpath (like writing zero buffers) in case the driver does not support the flag). Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> Reviewed-by: Eric Blake <ebl...@redhat.com> Reviewed-by: Alberto Garcia <b

[Qemu-devel] [PATCH v5 09/15] qcow2: preallocation at image expand

2017-11-01 Thread Anton Nefedov
sters. Possible conflicts are resolved by the common block layer code since ALLOCATE requests are serialising. Signed-off-by: Denis V. Lunev <d...@openvz.org> Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- block/qcow2.h | 3 +++ block/qcow2.c | 43 +

[Qemu-devel] [PATCH v5 02/15] blkverify: set supported write/zero flags

2017-11-01 Thread Anton Nefedov
Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- block/blkverify.c | 9 + 1 file changed, 9 insertions(+) diff --git a/block/blkverify.c b/block/blkverify.c index 06369f9..9ba65d0 100644 --- a/block/blkverify.c +++ b/block/blkverify.c @@ -140,6 +140,15 @@ stat

[Qemu-devel] [PATCH v5 08/15] qcow2: skip writing zero buffers to empty COW areas

2017-11-01 Thread Anton Nefedov
Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- block/qcow2.h | 6 + block/qcow2-cluster.c | 3 ++- block/qcow2.c | 67 -- block/trace-events | 1 + tests/qemu-iotests/060 | 2 +- test

[Qemu-devel] [PATCH v5 00/15] qcow2: space preallocation and COW improvements

2017-11-01 Thread Anton Nefedov
void that but return ENOTSUP. Such allocate requests are also implemented to possibly overlap with the other requests. No wait is performed but an error returned in such case as well. So the operation should be considered advisory and a fallback scenario still handled by the caller (in this case, qcow2 driver). A

Re: [Qemu-devel] [PATCH v4 00/15] qcow2: space preallocation and COW improvements

2017-09-21 Thread Anton Nefedov
On 1/8/2017 5:18 PM, Anton Nefedov wrote: This pull request is to address a few performance problems of qcow2 format: 1. non cluster-aligned write requests (to unallocated clusters) explicitly pad data with zeroes if there is no backing data. This can be avoided and the whole

Re: [Qemu-devel] reduce write bandwidth of qcow2 driver while allocating new cluster

2017-09-04 Thread Anton Nefedov
On 31/8/2017 9:55 AM, Liu Qing wrote: On Wed, Aug 30, 2017 at 01:15:33PM +0300, Anton Nefedov wrote: On 29/08/2017 05:56, Liu Qing wrote: On Mon, Aug 28, 2017 at 10:46:34AM -0500, Eric Blake wrote: [adding qemu-block] On 08/28/2017 12:56 AM, Liu Qing wrote: Dear list, Recently I used

Re: [Qemu-devel] reduce write bandwidth of qcow2 driver while allocating new cluster

2017-08-30 Thread Anton Nefedov
On 29/08/2017 05:56, Liu Qing wrote: On Mon, Aug 28, 2017 at 10:46:34AM -0500, Eric Blake wrote: [adding qemu-block] On 08/28/2017 12:56 AM, Liu Qing wrote: Dear list, Recently I used fio to test qcow2 driver in the guest os, and found out that when a new cluster is allocated the 4K IO

Re: [Qemu-devel] [PATCH v4 02/15] blkverify: set supported write/zero flags

2017-08-07 Thread Anton Nefedov
On 08/04/2017 06:23 PM, Eric Blake wrote: On 08/01/2017 09:18 AM, Anton Nefedov wrote: Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- block/blkverify.c | 9 + 1 file changed, 9 insertions(+) Basically, blkverify supports a flag if BOTH of its underlying file

Re: [Qemu-devel] [PATCH v4 08/15] qcow2: set inactive flag

2017-08-07 Thread Anton Nefedov
On 08/04/2017 11:00 PM, Eric Blake wrote: On 08/01/2017 09:19 AM, Anton Nefedov wrote: Qcow2State and BlockDriverState flags have to be in sync Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- block/qcow2.c | 1 + 1 file changed, 1 insertion(+) Is this a bug fix

[Qemu-devel] [PATCH v4 15/15] iotest 134: test cluster-misaligned encrypted write

2017-08-01 Thread Anton Nefedov
COW (even empty/zero) areas require encryption too Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- tests/qemu-iotests/134 | 9 + tests/qemu-iotests/134.out | 10 ++ 2 files changed, 19 insertions(+) diff --git a/tests/qemu-iotests/134 b/tests/qemu-iotes

[Qemu-devel] [PATCH v4 10/15] qcow2: check space leak at the end of the image

2017-08-01 Thread Anton Nefedov
-by: Denis V. Lunev <d...@openvz.org> Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- block/qcow2.c | 32 tests/qemu-iotests/026.out | 104 - tests/qemu-iotes

[Qemu-devel] [PATCH v4 14/15] iotest 190: test BDRV_REQ_ALLOCATE

2017-08-01 Thread Anton Nefedov
Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- tests/qemu-iotests/190 | 146 + tests/qemu-iotests/190.out | 50 tests/qemu-iotests/group | 1 + 3 files changed, 197 insertions(+) create mode 100755 test

[Qemu-devel] [PATCH v4 11/15] qcow2: move is_zero() up

2017-08-01 Thread Anton Nefedov
To be used in the following commit without a forward declaration. Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- block/qcow2.c | 45 ++--- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c

[Qemu-devel] [PATCH v4 03/15] block: introduce BDRV_REQ_ALLOCATE flag

2017-08-01 Thread Anton Nefedov
The flag is supposed to indicate that the region of the disk image has to be sufficiently allocated so it reads as zeroes. The call with the flag set has to return -ENOTSUP if allocation cannot be done efficiently (i.e. without falling back to writing actual buffers) Signed-off-by: Anton Nefedov

[Qemu-devel] [PATCH v4 02/15] blkverify: set supported write/zero flags

2017-08-01 Thread Anton Nefedov
Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- block/blkverify.c | 9 + 1 file changed, 9 insertions(+) diff --git a/block/blkverify.c b/block/blkverify.c index 06369f9..9ba65d0 100644 --- a/block/blkverify.c +++ b/block/blkverify.c @@ -140,6 +140,15 @@ stat

[Qemu-devel] [PATCH v4 07/15] qcow2: preallocation at image expand

2017-08-01 Thread Anton Nefedov
sters. Possible conflicts are resolved by the common block layer code since ALLOCATE requests are serialising. Signed-off-by: Denis V. Lunev <d...@openvz.org> Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- block/qcow2.h |

[Qemu-devel] [PATCH v4 13/15] qcow2: allocate image space by-cluster

2017-08-01 Thread Anton Nefedov
-alignment areas that were not really COWed are now detected as zeroes, hence the initial write has to be exactly the same size for the maps to match Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- block/qcow2.c | 22 +- tests/qemu-iotests/060

[Qemu-devel] [PATCH v4 12/15] qcow2: skip writing zero buffers to empty COW areas

2017-08-01 Thread Anton Nefedov
It can be detected that 1. COW alignment of a write request is zeroes 2. Respective areas on the underlying BDS already read as zeroes after being preallocated previously If both of these true, COW may be skipped Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> ---

[Qemu-devel] [PATCH v4 08/15] qcow2: set inactive flag

2017-08-01 Thread Anton Nefedov
Qcow2State and BlockDriverState flags have to be in sync Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- block/qcow2.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/qcow2.c b/block/qcow2.c index 66aa8c2..2a1d2f2 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -

[Qemu-devel] [PATCH v4 05/15] file-posix: support BDRV_REQ_ALLOCATE

2017-08-01 Thread Anton Nefedov
Current write_zeroes implementation is good enough to satisfy this flag too Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- block/file-posix.c | 8 1 file changed, 8 insertions(+) diff --git a/block/file-posix.c b/block/file-posix.c index 765a440..4ef1b1d

[Qemu-devel] [PATCH v4 06/15] block: support BDRV_REQ_ALLOCATE in passthrough drivers

2017-08-01 Thread Anton Nefedov
Support the flag if the underlying BDS supports it Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- block/blkdebug.c | 3 ++- block/blkverify.c | 2 +- block/mirror.c | 2 +- block/raw-format.c | 3 ++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a

[Qemu-devel] [PATCH v4 01/15] mirror: inherit supported write/zero flags

2017-08-01 Thread Anton Nefedov
Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- block/mirror.c | 5 + 1 file changed, 5 insertions(+) diff --git a/block/mirror.c b/block/mirror.c index d46dace..7e539f1 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -1056,6 +1056,11 @@ stati

[Qemu-devel] [PATCH v4 00/15] qcow2: space preallocation and COW improvements

2017-08-01 Thread Anton Nefedov
writes to the same unallocated cluster, which is beneficial for parallel sequential write operations which are not cluster-aligned Performance test results are added to commit messages (see patch 3, 12) Anton Nefedov (12): mirror: inherit supported write/zero flags blkverify: set supported

[Qemu-devel] [PATCH v4 09/15] qcow2: truncate preallocated space

2017-08-01 Thread Anton Nefedov
From: "Denis V. Lunev" <d...@openvz.org> This could be done after calculation of the end of data and metadata in the qcow2 image. Signed-off-by: Denis V. Lunev <d...@openvz.org> Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- block/qcow2.h |

[Qemu-devel] [PATCH v4 04/15] block: treat BDRV_REQ_ALLOCATE as serialising

2017-08-01 Thread Anton Nefedov
request is in flight already. Return EAGAIN, let the caller reconsider. Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- block/io.c | 27 +++ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/block/io.c b/block/io.c index 04d495e..0a7a372

Re: [Qemu-devel] [PATCH v3 09/13] qcow2: move is_zero_sectors() up

2017-08-01 Thread Anton Nefedov
On 07/31/2017 10:13 PM, Eric Blake wrote: On 07/31/2017 11:22 AM, Anton Nefedov wrote: To be used in the following commit without a forward declaration. Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- block/qcow2.c | 39 +++ 1 file c

Re: [Qemu-devel] [PATCH v3 04/13] block: support BDRV_REQ_ALLOCATE in passthrough drivers

2017-08-01 Thread Anton Nefedov
On 07/31/2017 10:11 PM, Eric Blake wrote: On 07/31/2017 11:21 AM, Anton Nefedov wrote: Support the flag if the underlying BDS supports it Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- block/blkdebug.c | 3 ++- block/raw-format.c | 3 ++- 2 files changed, 4 inse

[Qemu-devel] [PATCH v3 13/13] iotest 134: test cluster-misaligned encrypted write

2017-07-31 Thread Anton Nefedov
COW (even empty/zero) areas require encryption too Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- tests/qemu-iotests/134 | 9 + tests/qemu-iotests/134.out | 10 ++ 2 files changed, 19 insertions(+) diff --git a/tests/qemu-iotests/134 b/tests/qemu-iotes

[Qemu-devel] [PATCH v3 12/13] iotest 190: test BDRV_REQ_ALLOCATE

2017-07-31 Thread Anton Nefedov
Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- tests/qemu-iotests/190 | 146 + tests/qemu-iotests/190.out | 50 tests/qemu-iotests/group | 1 + 3 files changed, 197 insertions(+) create mode 100755 test

[Qemu-devel] [PATCH v3 09/13] qcow2: move is_zero_sectors() up

2017-07-31 Thread Anton Nefedov
To be used in the following commit without a forward declaration. Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- block/qcow2.c | 39 +++ 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index 0

[Qemu-devel] [PATCH v3 11/13] qcow2: allocate image space by-cluster

2017-07-31 Thread Anton Nefedov
-alignment areas that were not really COWed are now detected as zeroes, hence the initial write has to be exactly the same size for the maps to match Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- block/qcow2.c | 22 +- tests/qemu-iotests/060

[Qemu-devel] [PATCH v3 08/13] qcow2: check space leak at the end of the image

2017-07-31 Thread Anton Nefedov
-by: Denis V. Lunev <d...@openvz.org> Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- block/qcow2.c | 32 tests/qemu-iotests/026.out | 104 - tests/qemu-iotes

[Qemu-devel] [PATCH v3 04/13] block: support BDRV_REQ_ALLOCATE in passthrough drivers

2017-07-31 Thread Anton Nefedov
Support the flag if the underlying BDS supports it Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- block/blkdebug.c | 3 ++- block/raw-format.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/block/blkdebug.c b/block/blkdebug.c index c19ab28..e

[Qemu-devel] [PATCH v3 10/13] qcow2: skip writing zero buffers to empty COW areas

2017-07-31 Thread Anton Nefedov
It can be detected that 1. COW alignment of a write request is zeroes 2. Respective areas on the underlying BDS already read as zeroes after being preallocated previously If both of these true, COW may be skipped Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> ---

[Qemu-devel] [PATCH v3 06/13] qcow2: set inactive flag

2017-07-31 Thread Anton Nefedov
Qcow2State and BlockDriverState flags have to be in sync Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- block/qcow2.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/qcow2.c b/block/qcow2.c index 1939d9b..b11dc48 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -

[Qemu-devel] [PATCH v3 07/13] qcow2: truncate preallocated space

2017-07-31 Thread Anton Nefedov
From: "Denis V. Lunev" <d...@openvz.org> This could be done after calculation of the end of data and metadata in the qcow2 image. Signed-off-by: Denis V. Lunev <d...@openvz.org> Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- block/qcow2.h |

[Qemu-devel] [PATCH v3 01/13] block: introduce BDRV_REQ_ALLOCATE flag

2017-07-31 Thread Anton Nefedov
The flag is supposed to indicate that the region of the disk image has to be sufficiently allocated so it reads as zeroes. The call with the flag set has to return -ENOTSUP if allocation cannot be done efficiently (i.e. without falling back to writing actual buffers) Signed-off-by: Anton Nefedov

[Qemu-devel] [PATCH v3 05/13] qcow2: preallocation at image expand

2017-07-31 Thread Anton Nefedov
sters. Possible conflicts are resolved by the common block layer code since ALLOCATE requests are serialising. Signed-off-by: Denis V. Lunev <d...@openvz.org> Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- block/qcow2.h |

[Qemu-devel] [PATCH v3 00/13] qcow2: space preallocation and COW improvements

2017-07-31 Thread Anton Nefedov
operations which are not cluster-aligned Performance test results are added to commit messages (see patch 3, 12) Anton Nefedov (10): block: introduce BDRV_REQ_ALLOCATE flag block: treat BDRV_REQ_ALLOCATE as serialising file-posix: support BDRV_REQ_ALLOCATE block: support BDRV_REQ_ALLOCATE

[Qemu-devel] [PATCH v3 03/13] file-posix: support BDRV_REQ_ALLOCATE

2017-07-31 Thread Anton Nefedov
Current write_zeroes implementation is good enough to satisfy this flag too Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- block/file-posix.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/block/file-posix.c b/block/file-posix.c index cfbb236..b

[Qemu-devel] [PATCH v3 02/13] block: treat BDRV_REQ_ALLOCATE as serialising

2017-07-31 Thread Anton Nefedov
request is in flight already. Return EAGAIN, let the caller reconsider. Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- block/io.c | 27 +++ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/block/io.c b/block/io.c index b3f9d61..1b935d8

[Qemu-devel] [PATCH v2] char: don't exit on hmp 'chardev-add help'

2017-07-25 Thread Anton Nefedov
qemu_chr_new_from_opts() is used from both vl.c and hmp, and it is quite confusing to see qemu suddenly exit after receiving a help option in hmp. Do exit(0) from vl.c instead. Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- include/chardev/char.h | 4 +++- chardev/

[Qemu-devel] [PATCH] char: don't exit on hmp 'chardev-add help'

2017-07-17 Thread Anton Nefedov
qemu_chr_new_from_opts() is used from both vl.c and hmp, and it is quite confusing to see qemu suddenly exit after receiving a help option in hmp. Create a separate function for printing help and let different callers react accordingly. Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.

[Qemu-devel] [PATCH v6 10/13] hmp: add hmp analogue for qmp-chardev-change

2017-07-06 Thread Anton Nefedov
Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsement...@virtuozzo.com> Acked-by: Dr. David Alan Gilbert <dgilb...@redhat.com> --- include/chardev/char.h | 10 ++ hmp.h | 1 + chardev/char.c

[Qemu-devel] [PATCH v6 13/13] serial: chardev hotswap support

2017-07-06 Thread Anton Nefedov
ore and replay the whole original control byte sequence. Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsement...@virtuozzo.com> --- hw/char/serial.c | 30 +- 1 file changed, 29 insertions(+), 1 deletion

[Qemu-devel] [PATCH v6 11/13] virtio-console: chardev hotswap support

2017-07-06 Thread Anton Nefedov
In case of a backend change, the handler functions and the watch have to be reset. Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsement...@virtuozzo.com> --- hw/char/virtio-console.c | 30 -- 1 file

[Qemu-devel] [PATCH v6 08/13] test-char: split char_file_test

2017-07-06 Thread Anton Nefedov
makes it possible to test the existing chardev-file Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> Reviewed-by: Marc-André Lureau <marcandre.lur...@redhat.com> --- tests/test-char.c | 137 +- 1 file changed, 84 inser

[Qemu-devel] [PATCH v6 09/13] test-char: add hotswap test

2017-07-06 Thread Anton Nefedov
Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> Reviewed-by: Marc-André Lureau <marcandre.lur...@redhat.com> --- tests/test-char.c | 71 +++ 1 file changed, 71 insertions(+) diff --git a/tests/test-char.c b/tests/test-

[Qemu-devel] [PATCH v6 12/13] serial: move TIOCM update to a separate function

2017-07-06 Thread Anton Nefedov
will be used by the following patch Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsement...@virtuozzo.com> Reviewed-by: Marc-André Lureau <marcandre.lur...@redhat.com> --- hw/char/serial.c | 31 +++--

[Qemu-devel] [PATCH v6 07/13] test-char: split char_udp_test

2017-07-06 Thread Anton Nefedov
makes it possible to test the existing chardev-udp Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> Reviewed-by: Marc-André Lureau <marcandre.lur...@redhat.com> --- tests/test-char.c | 56 +++ 1 file changed, 40 inser

[Qemu-devel] [PATCH v6 06/13] test-char: destroy chardev-udp after test

2017-07-06 Thread Anton Nefedov
this is only not a problem if the test is last in a suite, otherwise it makes the following main_loop() calls to fail Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> Reviewed-by: Marc-André Lureau <marcandre.lur...@redhat.com> --- tests/test-char.c | 1 + 1 file changed,

[Qemu-devel] [PATCH v6 05/13] char: avoid chardevice direct access

2017-07-06 Thread Anton Nefedov
frontends should avoid accessing CharDriver struct where possible Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsement...@virtuozzo.com> Reviewed-by: Marc-André Lureau <marcandre.lur...@redhat.com> --- include/chard

[Qemu-devel] [PATCH v6 01/13] char: move QemuOpts->ChardevBackend translation to a separate func

2017-07-06 Thread Anton Nefedov
parse function will be used by the following patch Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- chardev/char.c | 81 -- 1 file changed, 51 insertions(+), 30 deletions(-) diff --git a/chardev/char.c b/chardev/char.c

[Qemu-devel] [PATCH v6 04/13] char: forbid direct chardevice access for hotswap devices

2017-07-06 Thread Anton Nefedov
qemu_chr_fe_get_driver() is unsafe, frontends with hotswap support should not access CharDriver ptr directly as CharDriver might change. Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsement...@virtuozzo.com> Reviewed-by: Marc-

[Qemu-devel] [PATCH v6 03/13] char: chardevice hotswap

2017-07-06 Thread Anton Nefedov
ointer (qemu_chr_fe_get_driver()), and it will become invalid after backend change. So, a frontend which would like to support chardev hotswap has to register a "backend change" handler, and redo its backend setup there. Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> Reviewed-by: Vladim

[Qemu-devel] [PATCH v6 00/13] chardevice hotswap

2017-07-06 Thread Anton Nefedov
removal. Yet isa-serial and virtio-serial frontends are supported. The feature can be helpful for e.g. Windows debug allowing to establish connection to a live VM from VM with WinDbg. Anton Nefedov (13): char: move QemuOpts->ChardevBackend translation to a separate func char: add backend hots

[Qemu-devel] [PATCH v6 02/13] char: add backend hotswap handler

2017-07-06 Thread Anton Nefedov
Frontends should have an interface to setup the handler of a backend change. The interface will be used in the next commits Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsement...@virtuozzo.com> Reviewed-by: Marc-André Lureau &l

Re: [Qemu-devel] [PATCH v5 03/13] char: chardevice hotswap

2017-07-05 Thread Anton Nefedov
On 07/05/2017 06:09 PM, Paolo Bonzini wrote: On 05/07/2017 16:01, Anton Nefedov wrote: This patch adds a possibility to change a char device without a frontend removal. 1. Ideally, it would have to happen transparently to a frontend, i.e. frontend would continue its regular operation

[Qemu-devel] [PATCH v5 10/13] hmp: add hmp analogue for qmp-chardev-change

2017-07-05 Thread Anton Nefedov
Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsement...@virtuozzo.com> CC: Dr. David Alan Gilbert <dgilb...@redhat.com> --- include/chardev/char.h | 10 ++ hmp.h | 1 + chardev/char.c

[Qemu-devel] [PATCH v5 02/13] char: add backend hotswap handler

2017-07-05 Thread Anton Nefedov
Frontends should have an interface to setup the handler of a backend change. The interface will be used in the next commits Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsement...@virtuozzo.com> Reviewed-by: Marc-André Lureau &l

[Qemu-devel] [PATCH v5 06/13] test-char: destroy chardev-udp after test

2017-07-05 Thread Anton Nefedov
this is only not a problem if the test is last in a suite, otherwise it makes the following main_loop() calls to fail Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> Reviewed-by: Marc-André Lureau <marcandre.lur...@redhat.com> --- tests/test-char.c | 1 + 1 file changed,

[Qemu-devel] [PATCH v5 07/13] test-char: split char_udp_test

2017-07-05 Thread Anton Nefedov
makes it possible to test the existing chardev-udp Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> Reviewed-by: Marc-André Lureau <marcandre.lur...@redhat.com> --- tests/test-char.c | 56 +++ 1 file changed, 40 inser

[Qemu-devel] [PATCH v5 04/13] char: forbid direct chardevice access for hotswap devices

2017-07-05 Thread Anton Nefedov
qemu_chr_fe_get_driver() is unsafe, frontends with hotswap support should not access CharDriver ptr directly as CharDriver might change. Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsement...@virtuozzo.com> Reviewed-by: Marc-

[Qemu-devel] [PATCH v5 08/13] test-char: split char_file_test

2017-07-05 Thread Anton Nefedov
makes it possible to test the existing chardev-file Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> Reviewed-by: Marc-André Lureau <marcandre.lur...@redhat.com> --- tests/test-char.c | 137 +- 1 file changed, 84 inser

[Qemu-devel] [PATCH v5 13/13] serial: chardev hotswap support

2017-07-05 Thread Anton Nefedov
for a backend change, a number of ioctls has to be replayed to sync the current setup of a frontend to a backend tty. This is hopefully enough so we don't have to track, store and replay the whole original control byte sequence. Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> Re

[Qemu-devel] [PATCH v5 01/13] char: move QemuOpts->ChardevBackend translation to a separate func

2017-07-05 Thread Anton Nefedov
parse function will be used by the following patch Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- chardev/char.c | 81 -- 1 file changed, 51 insertions(+), 30 deletions(-) diff --git a/chardev/char.c b/chardev/char.c

[Qemu-devel] [PATCH v5 11/13] virtio-console: chardev hotswap support

2017-07-05 Thread Anton Nefedov
In case of a backend change, the handler functions and the watch have to be reset. Also, avoid unsafe qemu_chr_fe_get_driver() usage even though the pointer is not really stored. Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> Reviewed-by: Vladimir Sementsov-Ogievskiy &l

[Qemu-devel] [PATCH v5 00/13] chardevice hotswap

2017-07-05 Thread Anton Nefedov
device removal. Yet isa-serial and virtio-serial frontends are supported. The feature can be helpful for e.g. Windows debug allowing to establish connection to a live VM from VM with WinDbg. Anton Nefedov (13): char: move QemuOpts->ChardevBackend translation to a separate func char: add back

[Qemu-devel] [PATCH v5 09/13] test-char: add hotswap test

2017-07-05 Thread Anton Nefedov
Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> Reviewed-by: Marc-André Lureau <marcandre.lur...@redhat.com> --- tests/test-char.c | 71 +++ 1 file changed, 71 insertions(+) diff --git a/tests/test-char.c b/tests/test-

[Qemu-devel] [PATCH v5 05/13] char: avoid chardevice direct access

2017-07-05 Thread Anton Nefedov
frontends should avoid accessing CharDriver struct where possible Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsement...@virtuozzo.com> Reviewed-by: Marc-André Lureau <marcandre.lur...@redhat.com> --- include/chard

[Qemu-devel] [PATCH v5 12/13] serial: move TIOCM update to a separate function

2017-07-05 Thread Anton Nefedov
will be used by the following patch Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsement...@virtuozzo.com> Reviewed-by: Marc-André Lureau <marcandre.lur...@redhat.com> --- hw/char/serial.c | 31 +++--

[Qemu-devel] [PATCH v5 03/13] char: chardevice hotswap

2017-07-05 Thread Anton Nefedov
So hotswap also has to be protected so write functions won't access a backend being replaced. Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsement...@virtuozzo.com> --- include/chardev/char-fe.h | 17 ++ include/chardev/c

Re: [Qemu-devel] [PATCH v4 13/13] serial: chardev hotswap support

2017-07-03 Thread Anton Nefedov
Hi Paolo, Michael, Any feedback on this change? (and a cosmetic patch 12 of this series) Thanks a lot in advance, /Anton On 06/26/2017 07:45 PM, Anton Nefedov wrote: for a backend change, a number of ioctls has to be replayed to sync the current setup of a frontend to a backend tty

Re: [Qemu-devel] [PATCH v4 11/13] virtio-console: chardev hotswap support

2017-07-03 Thread Anton Nefedov
In case of a backend change, the handler functions and the watch have to be reset. Also, avoid unsafe qemu_chr_fe_get_driver() usage even though the pointer is not really stored. Amit, have you had a chance to kindly look at this? /Anton - Original Message - Signed-off-by: Anton

[Qemu-devel] [PATCH v4 12/13] serial: move TIOCM update to a separate function

2017-06-26 Thread Anton Nefedov
will be used by the following patch Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsement...@virtuozzo.com> CC: Michael S. Tsirkin <m...@redhat.com> CC: Paolo Bonzini <pbonz...@redhat.com> Reviewed-by: Marc-And

[Qemu-devel] [PATCH v4 11/13] virtio-console: chardev hotswap support

2017-06-26 Thread Anton Nefedov
Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsement...@virtuozzo.com> CC: Amit Shah <a...@kernel.org> --- hw/char/virtio-console.c | 35 ++- 1 file changed, 30 insertions(+), 5 deletions(-

[Qemu-devel] [PATCH v4 09/13] test-char: add hotswap test

2017-06-26 Thread Anton Nefedov
Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> Reviewed-by: Marc-André Lureau <marcandre.lur...@redhat.com> --- tests/test-char.c | 71 +++ 1 file changed, 71 insertions(+) diff --git a/tests/test-char.c b/tests/test-

[Qemu-devel] [PATCH v4 08/13] test-char: split char_file_test

2017-06-26 Thread Anton Nefedov
makes it possible to test the existing chardev-file Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> Reviewed-by: Marc-André Lureau <marcandre.lur...@redhat.com> --- tests/test-char.c | 125 ++ 1 file changed, 78 inser

[Qemu-devel] [PATCH v4 06/13] test-char: unref chardev-udp after test

2017-06-26 Thread Anton Nefedov
this is only not a problem if the test is last in a suite, otherwise it makes the following main_loop() calls to fail Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> Reviewed-by: Marc-André Lureau <marcandre.lur...@redhat.com> --- tests/test-char.c | 2 ++ 1 file changed,

<    1   2   3   4   5   >