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

2017-06-26 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 | 57 ++- 1 file changed, 40 inser

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

2017-06-26 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 v4 03/13] char: chardevice hotswap

2017-06-26 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

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

2017-06-26 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 v4 01/13] char: move QemuOpts->ChardevBackend translation to a separate func

2017-06-26 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 v4 13/13] serial: chardev hotswap support

2017-06-26 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 v4 02/13] char: add backend hotswap handler

2017-06-26 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 v4 05/13] char: avoid chardevice direct access

2017-06-26 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 v4 00/13] chardevice hotswap

2017-06-26 Thread Anton Nefedov
connection to a live VM from VM with WinDbg. Anton Nefedov (13): char: move QemuOpts->ChardevBackend translation to a separate func char: add backend hotswap handler char: chardevice hotswap char: forbid direct chardevice access for hotswap devices char: avoid chardevice direct access t

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

2017-06-15 Thread Anton Nefedov
On 06/13/2017 03:32 PM, Marc-André Lureau wrote: Hi On Tue, Jun 13, 2017 at 3:53 PM Anton Nefedov <anton.nefe...@virtuozzo.com <mailto:anton.nefe...@virtuozzo.com>> wrote: > The existing chr_write_lock belongs to Chardev. > For the hotswap case,

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

2017-06-13 Thread Anton Nefedov
On 06/09/2017 05:53 PM, Marc-André Lureau wrote: On Thu, Jun 1, 2017 at 3:23 PM Anton Nefedov <anton.nefe...@virtuozzo.com <mailto:anton.nefe...@virtuozzo.com>> wrote: On 05/31/2017 10:20 PM, Marc-André Lureau wrote: > Hi > > On Tue, May 30,

Re: [Qemu-devel] [PATCH v2 02/15] file-posix: support BDRV_REQ_ALLOCATE

2017-06-02 Thread Anton Nefedov
On 06/01/2017 10:54 PM, Eric Blake wrote: On 06/01/2017 02:49 PM, Eric Blake wrote: On 06/01/2017 10:14 AM, Anton Nefedov wrote: Current write_zeroes implementation is good enough to satisfy this flag too Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- block/file-posix

Re: [Qemu-devel] [PATCH v2 03/15] blkdebug: support BDRV_REQ_ALLOCATE

2017-06-02 Thread Anton Nefedov
On 06/01/2017 10:50 PM, Eric Blake wrote: On 06/01/2017 10:14 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 ++- 1 file changed, 2 insertions(+), 1 deletion(-) Sho

Re: [Qemu-devel] [PATCH v2 01/15] block: introduce BDRV_REQ_ALLOCATE flag

2017-06-02 Thread Anton Nefedov
On 06/01/2017 10:07 PM, Eric Blake wrote: On 06/01/2017 10:14 AM, Anton Nefedov wrote: 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

[Qemu-devel] [PATCH v2 15/15] iotest 046: test simultaneous cluster write error case

2017-06-01 Thread Anton Nefedov
Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- tests/qemu-iotests/046 | 38 +- tests/qemu-iotests/046.out | 23 +++ 2 files changed, 60 insertions(+), 1 deletion(-) diff --git a/tests/qemu-iotests/046 b/test

[Qemu-devel] [PATCH v2 14/15] qcow2: allow concurrent unaligned writes to the same clusters

2017-06-01 Thread Anton Nefedov
to unallocated clusters with no backing data: HDD fio over xfs iodepth=4: seqwrite 4k: 18400 -> 22800 IOPS ( x1.24 ) seqwrite 68k: 1600 -> 2300 IOPS ( x1.44 ) Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> Signed-off-by: Denis V. Lunev <d...@openvz.org> --- block/qco

[Qemu-devel] [PATCH v2 12/15] qcow2-cluster: slightly refactor handle_dependencies()

2017-06-01 Thread Anton Nefedov
- assert the alignment on return if the allocation has to stop (at the start of a running allocation) - make use of const specifiers for local variables Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> Signed-off-by: Denis V. Lunev <d...@openvz.org> --- block/qco

[Qemu-devel] [PATCH v2 08/15] qcow2: truncate preallocated space

2017-06-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-cluster.c

[Qemu-devel] [PATCH v2 13/15] qcow2-cluster: make handle_dependencies() logic easier to follow

2017-06-01 Thread Anton Nefedov
Avoid complicated nested conditions; return or continue asap instead. The logic is not changed. Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> Signed-off-by: Denis V. Lunev <d...@openvz.org> --- block/qcow2-cluster.c | 45 ++--- 1

[Qemu-devel] [PATCH v2 05/15] qcow2: do not COW the empty areas

2017-06-01 Thread Anton Nefedov
quential write: seqwrite 4k, size=4g, iodepth=4 SSD : 7000 -> 18000 IOPS ( x2.6 ) - numbers are similar to qemu-io tests, slightly less improvement (damped by fs?) Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> Signed-off-by: Denis V. Lunev <d

[Qemu-devel] [PATCH v2 11/15] qcow2: fix misleading comment about L2 linking

2017-06-01 Thread Anton Nefedov
Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> Signed-off-by: Denis V. Lunev <d...@openvz.org> --- block/qcow2-cluster.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c index ed65961..3d

[Qemu-devel] [PATCH v2 07/15] qcow2: set inactive flag

2017-06-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 c6fb714..b090833 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -

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

2017-06-01 Thread Anton Nefedov
to commit messages (see patch 3, 12) Anton Nefedov (11): block: introduce BDRV_REQ_ALLOCATE flag file-posix: support BDRV_REQ_ALLOCATE blkdebug: support BDRV_REQ_ALLOCATE qcow2: do not COW the empty areas qcow2: set inactive flag qcow2: handle_prealloc(): find out if area zeroed by earlier

[Qemu-devel] [PATCH v2 06/15] qcow2: preallocation at image expand

2017-06-01 Thread Anton Nefedov
<d...@openvz.org> Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- block/qcow2-cache.c| 3 + block/qcow2-cluster.c | 5 ++ block/qcow2-refcount.c | 14 + block/qcow2.c | 147 + block/qcow2.h |

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

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

[Qemu-devel] [PATCH v2 03/15] blkdebug: support BDRV_REQ_ALLOCATE

2017-06-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 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/block/blkdebug.c b/block/blkdebug.c index a5196e8..8b1401b 100644 --- a/block/blkdebug.c

[Qemu-devel] [PATCH v2 02/15] file-posix: support BDRV_REQ_ALLOCATE

2017-06-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 | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/block/file-posix.c b/block/file-posix.c index de2d3a2..1

[Qemu-devel] [PATCH v2 01/15] block: introduce BDRV_REQ_ALLOCATE flag

2017-06-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 v2 04/15] qcow2: alloc space for COW in one chunk

2017-06-01 Thread Anton Nefedov
enis V. Lunev <d...@openvz.org> Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- block/qcow2.c | 24 +++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/block/qcow2.c b/block/qcow2.c index b3ba5da..cd5efba 100644 --- a/block/qcow2.c ++

[Qemu-devel] [PATCH v2 10/15] qcow2: handle_prealloc(): find out if area zeroed by earlier preallocation

2017-06-01 Thread Anton Nefedov
Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> Signed-off-by: Denis V. Lunev <d...@openvz.org> --- block/qcow2-cluster.c | 2 ++ block/qcow2.c | 8 +++- block/qcow2.h | 4 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/block/qcow2

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

2017-06-01 Thread Anton Nefedov
On 06/01/2017 10:12 AM, Marc-André Lureau wrote: Hi On Tue, May 30, 2017 at 6:08 PM Anton Nefedov <anton.nefe...@virtuozzo.com <mailto:anton.nefe...@virtuozzo.com>> wrote: Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com <mailto:anton.nefe...@virtuozzo.

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

2017-06-01 Thread Anton Nefedov
On 05/31/2017 10:20 PM, Marc-André Lureau wrote: Hi On Tue, May 30, 2017 at 6:12 PM Anton Nefedov <anton.nefe...@virtuozzo.com <mailto:anton.nefe...@virtuozzo.com>> wrote: This patch adds a possibility to change a char device without a frontend removal. 1. Ideal

Re: [Qemu-devel] [PATCH v1 05/13] qcow2: set inactive flag

2017-05-31 Thread Anton Nefedov
On 05/26/2017 11:11 AM, Kevin Wolf wrote: Am 19.05.2017 um 11:34 hat Anton Nefedov geschrieben: 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

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

2017-05-30 Thread Anton Nefedov
Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- tests/test-char.c | 68 +++ 1 file changed, 68 insertions(+) diff --git a/tests/test-char.c b/tests/test-char.c index ed6b18f..cd54f88 100644 --- a/tests/test-char.c +++ b

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

2017-05-30 Thread Anton Nefedov
makes it possible to test the existing chardev-file Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- tests/test-char.c | 127 +- 1 file changed, 79 insertions(+), 48 deletions(-) diff --git a/tests/test-char.c b/tests/test-

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

2017-05-30 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> --- chardev/char.c

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

2017-05-30 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> --- chardev/char.c| 126 +++

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

2017-05-30 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 v3 01/13] char: move QemuOpts->ChardevBackend translation to a separate func

2017-05-30 Thread Anton Nefedov
parse function will be used by the following patch Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsement...@virtuozzo.com> --- chardev/char.c | 70 -- 1 file changed, 4

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

2017-05-30 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> --- chardev/char.c| 2 +- hmp-commands.hx | 16 hmp.c

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

2017-05-30 Thread Anton Nefedov
a frontend 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:

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

2017-05-30 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> --- tests/test-char.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test-char.c b/tests/test-char.c

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

2017-05-30 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 v3 07/13] test-char: split char_udp_test

2017-05-30 Thread Anton Nefedov
makes it possible to test the existing chardev-udp Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- tests/test-char.c | 58 +++ 1 file changed, 41 insertions(+), 17 deletions(-) diff --git a/tests/test-char.c b/tests/test-

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

2017-05-30 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 v3 05/13] char: avoid chardevice direct access

2017-05-30 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> --- chardev/char.c | 5 + gdbstub.c | 2 +- hw/arm

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

2017-05-30 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 0/7] qcow2: Reduce the number of I/O ops when doing COW

2017-05-26 Thread Anton Nefedov
On 05/26/2017 04:08 PM, Alberto Garcia wrote: On Fri 26 May 2017 02:47:55 PM CEST, Anton Nefedov wrote: Tried the another machine; about 10% improvement here [...] [root@localhost ~]# fio --name=randwrite --blocksize=4k --filename=/dev/sdb --rw=randwrite --direct=1 --ioengine=libaio --size

Re: [Qemu-devel] [PATCH 0/7] qcow2: Reduce the number of I/O ops when doing COW

2017-05-26 Thread Anton Nefedov
On 05/26/2017 01:17 PM, Kevin Wolf wrote: Am 24.05.2017 um 18:09 hat Anton Nefedov geschrieben: I agree; as mentioned we have similar patches and they don't conflict much. We noticed a performance regression on HDD though, for the presumably optimized case (random 4k write over a large backed

Re: [Qemu-devel] [PATCH v1 01/13] qcow2: alloc space for COW in one chunk

2017-05-26 Thread Anton Nefedov
On 05/26/2017 11:57 AM, Denis V. Lunev wrote: On 05/26/2017 11:11 AM, Kevin Wolf wrote: Am 19.05.2017 um 11:34 hat Anton Nefedov geschrieben: From: "Denis V. Lunev" <d...@openvz.org> Currently each single write operation can result in 3 write operations if guest offsets

Re: [Qemu-devel] [PATCH v2 3/9] char: chardevice hotswap

2017-05-25 Thread Anton Nefedov
Hi Hi Marc-André, thanks for reviewing, pls see answers below On Fri, May 19, 2017 at 4:51 PM Anton Nefedov <address@hidden> 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 fronten

Re: [Qemu-devel] [PATCH v1 04/13] qcow2: preallocation at image expand

2017-05-24 Thread Anton Nefedov
On 05/22/2017 10:29 PM, Eric Blake wrote: On 05/19/2017 04:34 AM, Anton Nefedov wrote: From: "Denis V. Lunev" <d...@openvz.org> This patch adds image preallocation at expand to provide better locality of QCOW2 image file and optimize this procedure for some distribute

Re: [Qemu-devel] [PATCH 7/7] qcow2: Merge the writing of the COW regions with the guest data

2017-05-24 Thread Anton Nefedov
If the guest tries to write data that results on the allocation of a new cluster, instead of writing the guest data first and then the data from the COW regions, write everything together using one single I/O operation. This can improve the write performance by 25% or more, depending on several

Re: [Qemu-devel] [PATCH 0/7] qcow2: Reduce the number of I/O ops when doing COW

2017-05-24 Thread Anton Nefedov
On 05/24/2017 07:20 PM, Alberto Garcia wrote: On Wed 24 May 2017 06:09:42 PM CEST, Anton Nefedov wrote: I agree; as mentioned we have similar patches and they don't conflict much. We noticed a performance regression on HDD though, for the presumably optimized case (random 4k write over

Re: [Qemu-devel] [PATCH 0/7] qcow2: Reduce the number of I/O ops when doing COW

2017-05-24 Thread Anton Nefedov
On 05/24/2017 05:20 PM, Alberto Garcia wrote: On Tue 23 May 2017 04:36:52 PM CEST, Eric Blake wrote: here's a patch series that rewrites the copy-on-write code in the qcow2 driver to reduce the number of I/O operations. And it competes with Denis and Anton's patches:

Re: [Qemu-devel] [PATCH v1 02/13] qcow2: is_zero_sectors(): return true if area is outside of backing file

2017-05-23 Thread Anton Nefedov
On 05/22/2017 10:14 PM, Eric Blake wrote: On 05/22/2017 02:12 PM, Eric Blake wrote: +++ b/block/qcow2.c @@ -2482,7 +2482,7 @@ static bool is_zero_sectors(BlockDriverState *bs, int64_t start, int64_t res; if (start + count > bs->total_sectors) { -count = bs->total_sectors

Re: [Qemu-devel] [PATCH v1 03/13] qcow2: do not COW the empty areas

2017-05-23 Thread Anton Nefedov
On 05/22/2017 10:24 PM, Eric Blake wrote: On 05/19/2017 04:34 AM, Anton Nefedov wrote: If COW area of the newly allocated cluster is zeroes, there is no reason to write zero sectors in perform_cow() again now as whole clusters are zeroed out in single chunks by handle_alloc_space

Re: [Qemu-devel] [PATCH v1 01/13] qcow2: alloc space for COW in one chunk

2017-05-23 Thread Anton Nefedov
On 05/22/2017 10:00 PM, Eric Blake wrote: On 05/19/2017 04:34 AM, Anton Nefedov wrote: From: "Denis V. Lunev" <d...@openvz.org> Currently each single write operation can result in 3 write operations if guest offsets are not cluster aligned. One write is performed for the real

[Qemu-devel] [PATCH v2 7/9] serial: move TIOCM update to a separate function

2017-05-19 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> --

[Qemu-devel] [PATCH v2 9/9] char: avoid chardevice direct access

2017-05-19 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> --- chardev/char.c | 5 + gdbstub.c | 2 +- hw/arm

[Qemu-devel] [PATCH v2 4/9] hmp: add hmp analogue for qmp-chardev-change

2017-05-19 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> --- chardev/char.c| 4 ++-- hmp-commands.hx | 16 hmp.c

[Qemu-devel] [PATCH v2 6/9] virtio-console: chardev hotswap support

2017-05-19 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 v2 2/9] char: add backend hotswap handler

2017-05-19 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> --- backends/rng-egd.c

[Qemu-devel] [PATCH v2 3/9] char: chardevice hotswap

2017-05-19 Thread Anton Nefedov
me of the errors synchronously - but most of them we can) Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsement...@virtuozzo.com> --- chardev/char.c| 147 ++ include/sysemu/char.h

[Qemu-devel] [PATCH v2 1/9] char: move QemuOpts->ChardevBackend translation to a separate func

2017-05-19 Thread Anton Nefedov
Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsement...@virtuozzo.com> --- chardev/char.c | 72 +- 1 file changed, 46 insertions(+), 26 deletions(-) diff --git a/char

[Qemu-devel] [PATCH v2 8/9] serial: chardev hotswap support

2017-05-19 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 v2 0/9] chardevice hotswap

2017-05-19 Thread Anton Nefedov
a frontend 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 (9): char: move QemuOpts->ChardevBackend translation to a separate func c

[Qemu-devel] [PATCH v2 5/9] char: forbid direct chardevice access for hotswap devices

2017-05-19 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> --- chardev/char.c

[Qemu-devel] [PATCH v1 10/13] qcow2-cluster: slightly refactor handle_dependencies()

2017-05-19 Thread Anton Nefedov
- assert the alignment on return if the allocation has to stop (at the start of a running allocation) - make use of const specifiers for local variables Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> Signed-off-by: Denis V. Lunev <d...@openvz.org> --- block/qco

[Qemu-devel] [PATCH v1 08/13] qcow2: handle_prealloc(): find out if area zeroed by earlier preallocation

2017-05-19 Thread Anton Nefedov
Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> Signed-off-by: Denis V. Lunev <d...@openvz.org> --- block/qcow2-cluster.c | 2 ++ block/qcow2.c | 8 +++- block/qcow2.h | 4 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/block/qcow2

[Qemu-devel] [PATCH v1 06/13] qcow2: truncate preallocated space

2017-05-19 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-cluster.c

[Qemu-devel] [PATCH v1 12/13] qcow2: allow concurrent unaligned writes to the same clusters

2017-05-19 Thread Anton Nefedov
to unallocated clusters with no backing data: HDD fio over xfs iodepth=4: seqwrite 4k: 18400 -> 22800 IOPS ( x1.24 ) seqwrite 68k: 1600 -> 2300 IOPS ( x1.44 ) Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> Signed-off-by: Denis V. Lunev <d...@openvz.org> --- block/qco

[Qemu-devel] [PATCH v1 13/13] iotest 046: test simultaneous cluster write error case

2017-05-19 Thread Anton Nefedov
Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- tests/qemu-iotests/046 | 38 +- tests/qemu-iotests/046.out | 23 +++ 2 files changed, 60 insertions(+), 1 deletion(-) diff --git a/tests/qemu-iotests/046 b/test

[Qemu-devel] [PATCH v1 02/13] qcow2: is_zero_sectors(): return true if area is outside of backing file

2017-05-19 Thread Anton Nefedov
in such case, bdrv_get_block_status() shall return 0, *nr == 0 iotest 154 updated accordingly: write-zeroes tail alignment can be detected as zeroes now, so pwrite_zeroes succeeds Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- block/qcow2.c | 6 -- test

[Qemu-devel] [PATCH v1 11/13] qcow2-cluster: make handle_dependencies() logic easier to follow

2017-05-19 Thread Anton Nefedov
Avoid complicated nested conditions; return or continue asap instead. The logic is not changed. Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> Signed-off-by: Denis V. Lunev <d...@openvz.org> --- block/qcow2-cluster.c | 45 ++--- 1

[Qemu-devel] [PATCH v1 05/13] qcow2: set inactive flag

2017-05-19 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 6e7ce96..07c1706 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -

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

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

[Qemu-devel] [PATCH v1 01/13] qcow2: alloc space for COW in one chunk

2017-05-19 Thread Anton Nefedov
enis V. Lunev <d...@openvz.org> Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- block/qcow2.c | 32 +++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/block/qcow2.c b/block/qcow2.c index a8d61f0..2e6a0ec 100644 --- a/block

[Qemu-devel] [PATCH v1 09/13] qcow2: fix misleading comment about L2 linking

2017-05-19 Thread Anton Nefedov
Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> Signed-off-by: Denis V. Lunev <d...@openvz.org> --- block/qcow2-cluster.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c index 25210cd..42

[Qemu-devel] [PATCH v1 04/13] qcow2: preallocation at image expand

2017-05-19 Thread Anton Nefedov
<d...@openvz.org> Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- block/qcow2-cache.c| 3 + block/qcow2-cluster.c | 5 ++ block/qcow2-refcount.c | 14 + block/qcow2.c | 151 + block/qcow2.h |

[Qemu-devel] [PATCH v1 03/13] qcow2: do not COW the empty areas

2017-05-19 Thread Anton Nefedov
quential write: seqwrite 4k, size=4g, iodepth=4 SSD : 7000 -> 18000 IOPS ( x2.6 ) - numbers are similar to qemu-io tests, slightly less improvement (damped by fs?) Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> Signed-off-by: Denis V. Lunev <d

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

2017-05-19 Thread Anton Nefedov
to commit messages (see patch 3, 12) Anton Nefedov (9): qcow2: is_zero_sectors(): return true if area is outside of backing file qcow2: do not COW the empty areas qcow2: set inactive flag qcow2: handle_prealloc(): find out if area zeroed by earlier preallocation qcow2: fix misleading

[Qemu-devel] [PATCH v3 1/1] qemu-img: wait for convert coroutines to complete

2017-04-26 Thread Anton Nefedov
On error path (like i/o error in one of the coroutines), it's required to - wait for coroutines completion before cleaning the common structures - reenter dependent coroutines so they ever finish Introduced in 2d9187bc65. Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> ---

Re: [Qemu-devel] [Qemu-stable] [PATCH v2 1/1] qemu-img: wait for convert coroutines to complete

2017-04-25 Thread Anton Nefedov
On 04/25/2017 12:55 PM, Peter Lieven wrote: Am 24.04.2017 um 22:13 schrieb Anton Nefedov: On 24/04/2017 21:16, Peter Lieven wrote: Am 24.04.2017 um 18:27 schrieb Anton Nefedov <anton.nefe...@virtuozzo.com>: On 04/21/2017 03:37 PM, Peter Lieven wrote: Am 21.04.2017 um 14:19 s

Re: [Qemu-devel] [Qemu-stable] [PATCH v2 1/1] qemu-img: wait for convert coroutines to complete

2017-04-24 Thread Anton Nefedov
On 24/04/2017 21:16, Peter Lieven wrote: Am 24.04.2017 um 18:27 schrieb Anton Nefedov <anton.nefe...@virtuozzo.com>: On 04/21/2017 03:37 PM, Peter Lieven wrote: Am 21.04.2017 um 14:19 schrieb Anton Nefedov: On 04/21/2017 01:44 PM, Peter Lieven wrote: Am 21.04.2017 um 12:04 schrieb

Re: [Qemu-devel] [PATCH v2 1/1] qemu-img: wait for convert coroutines to complete

2017-04-24 Thread Anton Nefedov
On 04/21/2017 03:37 PM, Peter Lieven wrote: Am 21.04.2017 um 14:19 schrieb Anton Nefedov: On 04/21/2017 01:44 PM, Peter Lieven wrote: Am 21.04.2017 um 12:04 schrieb Anton Nefedov: On error path (like i/o error in one of the coroutines), it's required to - wait for coroutines completion

[Qemu-devel] [PATCH v2 1/1] qemu-img: wait for convert coroutines to complete

2017-04-21 Thread Anton Nefedov
On error path (like i/o error in one of the coroutines), it's required to - wait for coroutines completion before cleaning the common structures - reenter dependent coroutines so they ever finish Introduced in 2d9187bc65. Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> ---

Re: [Qemu-devel] [PATCH v2 1/1] qemu-img: wait for convert coroutines to complete

2017-04-21 Thread Anton Nefedov
On 04/21/2017 01:44 PM, Peter Lieven wrote: Am 21.04.2017 um 12:04 schrieb Anton Nefedov: On error path (like i/o error in one of the coroutines), it's required to - wait for coroutines completion before cleaning the common structures - reenter dependent coroutines so they ever finish

Re: [Qemu-devel] [PATCH 1/1] qemu-img: wait for convert coroutines to complete

2017-04-21 Thread Anton Nefedov
On 04/21/2017 12:18 PM, Peter Lieven wrote: Am 18.04.2017 um 12:27 schrieb Denis V. Lunev: From: Anton Nefedov <anton.nefe...@virtuozzo.com> We should wait for other coroutines on error path, i.e. one of coroutines terminates with i/o error, before cleaning the common structures. In the

Re: [Qemu-devel] [PATCH] io: fully parse & validate HTTP headers for websocket protocol handshake

2017-02-28 Thread Anton Nefedov
On 02/28/2017 03:07 PM, Daniel P. Berrange wrote: The current websockets protocol handshake code is very relaxed, just doing crude string searching across the HTTP header data. This causes it to both reject valid connections and fail to reject invalid connections. For example, according to the

Re: [Qemu-devel] [PATCH 3/3] vl: pass CPUState to qemu_system_guest_panicked

2017-02-22 Thread Anton Nefedov
hi, On 02/21/2017 01:42 PM, Paolo Bonzini wrote: qemu_system_guest_panicked was already using current_cpu implicitly, so it makes sense for it to receive a CPUState. This lets the function call cpu_get_crash_info and free the result. my motivation against this was that as

[Qemu-devel] [PATCH 0/1] qmp-events: fix GUEST_PANICKED description formatting

2017-02-17 Thread Anton Nefedov
This patch is a follow-up for: http://lists.nongnu.org/archive/html/qemu-devel/2017-02/msg03647.html

[Qemu-devel] [PATCH] qmp-events: fix GUEST_PANICKED description formatting

2017-02-16 Thread Anton Nefedov
also remove a useless NULL check in the event reporting code Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- qapi/event.json | 4 ++-- vl.c| 22 ++ 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/qapi/event.json b/qapi/even

[Qemu-devel] [PATCH] qmp-events: fix GUEST_PANICKED description formatting

2017-02-16 Thread Anton Nefedov
Signed-off-by: Anton Nefedov <anton.nefe...@virtuozzo.com> --- qapi/event.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qapi/event.json b/qapi/event.json index 970ff02..e02852c 100644 --- a/qapi/event.json +++ b/qapi/event.json @@ -488,9 +488,9 @@ # # @

Re: [Qemu-devel] [PATCH 1/1] mirror: restore offset after zeroing out the image

2017-01-31 Thread Anton Nefedov
On 01/30/2017 08:33 PM, Denis V. Lunev wrote: On 01/30/2017 08:16 PM, Eric Blake wrote: On 01/30/2017 04:22 AM, Denis V. Lunev wrote: If explicit zeroing out before mirroring is required for the target image, it moves the block job offset counter to EOF, then offset and len counters count the

<    1   2   3   4   5