Re: [Qemu-devel] [PATCH 5/7] block/raw-posix: call plain fallocate in handle_aiocb_write_zeroes

2015-01-30 Thread Denis V. Lunev
On 30/01/15 18:42, Max Reitz wrote: On 2015-01-30 at 10:41, Denis V. Lunev wrote: On 30/01/15 17:58, Max Reitz wrote: On 2015-01-30 at 03:42, Denis V. Lunev wrote: There is a possibility that we are extending our image and thus writing zeroes beyond the end of the file. In this case we do

Re: [Qemu-devel] [PATCH 1/1] block: enforce minimal 4096 alignment in qemu_blockalign

2015-01-30 Thread Denis V. Lunev
On 29/01/15 16:49, Denis V. Lunev wrote: On 29/01/15 16:18, Kevin Wolf wrote: Am 29.01.2015 um 11:50 hat Denis V. Lunev geschrieben: The following sequence int fd = open(argv[1], O_RDWR | O_CREAT | O_DIRECT, 0644); for (i = 0; i < 10; i++) write(fd, buf, 4

Re: [Qemu-devel] [PATCH 1/1] block: enforce minimal 4096 alignment in qemu_blockalign

2015-01-30 Thread Denis V. Lunev
On 30/01/15 22:48, Kevin Wolf wrote: Am 30.01.2015 um 19:39 hat Denis V. Lunev geschrieben: On 29/01/15 16:49, Denis V. Lunev wrote: On 29/01/15 16:18, Kevin Wolf wrote: Am 29.01.2015 um 11:50 hat Denis V. Lunev geschrieben: The following sequence int fd = open(argv[1], O_RDWR | O_CREAT

Re: [Qemu-devel] [PATCH 7/7] block/raw-posix: set max_write_zeroes to INT_MAX for regular files

2015-02-02 Thread Denis V. Lunev
09:42 hat Denis V. Lunev geschrieben: fallocate() works fine and could handle properly with arbitrary size requests. There is no sense to reduce the amount of space to fallocate. The bigger is the size, the better is the performance as the amount of journal updates is reduced. The patch changes

Re: [Qemu-devel] [PATCH 7/7] block/raw-posix: set max_write_zeroes to INT_MAX for regular files

2015-02-02 Thread Denis V. Lunev
02.02.2015 um 14:23 schrieb Kevin Wolf: Am 30.01.2015 um 09:42 hat Denis V. Lunev geschrieben: fallocate() works fine and could handle properly with arbitrary size requests. There is no sense to reduce the amount of space to fallocate. The bigger is the size, the better is the performance as the amount

Re: [Qemu-devel] [PATCH] block: change default for discard and write zeroes to INT_MAX

2015-02-02 Thread Denis V. Lunev
Wolf Suggested-by: Denis V. Lunev Signed-off-by: Peter Lieven Thanks, applied to the block branch (and removed 'block/raw-posix: set max_write_zeroes to INT_MAX for regular files' from the queue). Kevin double checked the code. There are 2 things to patch for discard, write_zeroes

[Qemu-devel] [PATCH 2/2] nbd: fix max_discard

2015-02-02 Thread Denis V. Lunev
be discarded, in bytes } QEMU_PACKED; Thus we should limit bl_max_discard to INT_MAX >> BDRV_SECTOR_BITS to avoid overflow. Signed-off-by: Denis V. Lunev CC: Kevin Wolf CC: Peter Lieven --- block/nbd.c | 8 1 file changed, 8 insertions(+) diff --git a/block/nbd.c b/block/nb

[Qemu-devel] [PATCH 1/2] glusterfs: fix max_discard

2015-02-02 Thread Denis V. Lunev
size_t lent, glfs_io_cbk fn, void *data) __THROW This is problematic on i686 as sizeof(size_t) == 4. Set bl_max_discard to INT_MAX >> BDRV_SECTOR_BITS to avoid overflow. Signed-off-by: Denis V. Lunev CC: Kevin Wolf CC: Peter Lieven --- block/gluster.c | 9

[Qemu-devel] [PATCH v3 0/1] block: enforce minimal 4096 alignment in qemu_blockalign

2015-02-02 Thread Denis V. Lunev
in_mem_alignment to check buffers coming from guest. Changes from v1: - enforces 4096 alignment in qemu_(try_)blockalign, avoid touching of bdrv_qiov_is_aligned path not to enforce additional bounce buffering as suggested by Paolo - reduces 10% to 5% in patch description to better fit 180 vs 189 d

Re: [Qemu-devel] [PATCH 1/1] block: align bounce buffers to page

2015-02-02 Thread Denis V. Lunev
On 02/02/15 19:47, Paolo Bonzini wrote: On 02/02/2015 17:44, Denis V. Lunev wrote: +++ b/block/raw-posix.c @@ -667,7 +667,8 @@ static void raw_refresh_limits(BlockDriverState *bs, Error **errp) BDRVRawState *s = bs->opaque; raw_probe_alignment(bs, s->fd, errp); -

[Qemu-devel] [PATCH 1/1] block: align bounce buffers to page

2015-02-02 Thread Denis V. Lunev
rce bounce buffering if guest request is aligned to 512 bytes. This patch forces page alignment when we are really forced to perform bounce buffering. Signed-off-by: Denis V. Lunev CC: Paolo Bonzini CC: Kevin Wolf CC: Stefan Hajnoczi --- block.c | 19 +-- bl

Re: [Qemu-devel] [PATCH] block: change default for discard and write zeroes to INT_MAX

2015-02-02 Thread Denis V. Lunev
On 02/02/15 19:45, Kevin Wolf wrote: Am 02.02.2015 um 17:25 hat Denis V. Lunev geschrieben: On 02/02/15 19:13, Kevin Wolf wrote: Am 02.02.2015 um 15:48 hat Peter Lieven geschrieben: do not trim requests if the driver does not supply a limit through BlockLimits. For write zeroes we still keep

Re: [Qemu-devel] [PATCH] block: change default for discard and write zeroes to INT_MAX

2015-02-02 Thread Denis V. Lunev
On 02/02/15 20:34, Paolo Bonzini wrote: On 02/02/2015 18:00, Denis V. Lunev wrote: You are absolutely correct for NBD case but I do not get the point about SIZE_MAX for gluster. There is no such definition in their git at git://github.com/gluster/glusterfs nor in public API headers in

[Qemu-devel] [PATCH 2/2] nbd: fix max_discard

2015-02-02 Thread Denis V. Lunev
be discarded, in bytes } QEMU_PACKED; Thus we should limit bl_max_discard to UINT32_MAX >> BDRV_SECTOR_BITS to avoid overflow. Signed-off-by: Denis V. Lunev CC: Kevin Wolf CC: Peter Lieven --- block/nbd.c | 8 1 file changed, 8 insertions(+) diff --git a/block/nbd.c b/block/nb

[Qemu-devel] [PATCH 1/2] glusterfs: fix max_discard

2015-02-02 Thread Denis V. Lunev
size_t lent, glfs_io_cbk fn, void *data) __THROW This is problematic on i686 as sizeof(size_t) == 4. Set bl_max_discard to SIZE_MAX >> BDRV_SECTOR_BITS to avoid overflow on i386. Signed-off-by: Denis V. Lunev CC: Kevin Wolf CC: Peter Lieven --- block/g

[Qemu-devel] [PATCH v2 0/2] fix max_discard for NBD/gluster block drivers

2015-02-02 Thread Denis V. Lunev
Changes from v1: - switched to UINT32_MAX for NBD - limited max_discard for gluster to SIZE_MAX on i686 only Signed-off-by: Denis V. Lunev CC: Kevin Wolf CC: Peter Lieven

[Qemu-devel] [PATCH 2/2] nbd: fix max_discard

2015-02-02 Thread Denis V. Lunev
be discarded, in bytes } QEMU_PACKED; Thus we should limit bl_max_discard to UINT32_MAX >> BDRV_SECTOR_BITS to avoid overflow. Signed-off-by: Denis V. Lunev Reviewed-by: Peter Lieven CC: Kevin Wolf --- block/nbd.c | 8 1 file changed, 8 insertions(+) diff --git a/block/nbd.

[Qemu-devel] [PATCH 1/2] glusterfs: fix max_discard

2015-02-02 Thread Denis V. Lunev
size_t lent, glfs_io_cbk fn, void *data) __THROW This is problematic on i686 as sizeof(size_t) == 4. Set bl_max_discard to SIZE_MAX >> BDRV_SECTOR_BITS to avoid overflow on i386. Signed-off-by: Denis V. Lunev CC: Kevin Wolf CC: Peter Lieven --- block/gluster.c | 9

[Qemu-devel] [PATCH v3 0/2] fix max_discard for NBD/gluster block drivers

2015-02-02 Thread Denis V. Lunev
Changes from v2: - dropped conditional in patch gluster code Changes from v1: - switched to UINT32_MAX for NBD - limited max_discard for gluster to SIZE_MAX on i686 only Signed-off-by: Denis V. Lunev CC: Kevin Wolf CC: Peter Lieven

Re: [Qemu-devel] [PATCH 1/2] glusterfs: fix max_discard

2015-02-02 Thread Denis V. Lunev
On 02/02/15 22:58, Peter Lieven wrote: Am 02.02.2015 um 19:29 schrieb Denis V. Lunev: qemu_gluster_co_discard calculates size to discard as follows size_t size = nb_sectors * BDRV_SECTOR_SIZE; ret = glfs_discard_async(s->fd, offset, size, &gluster_finish_aio

Re: [Qemu-devel] [PATCH 1/2] glusterfs: fix max_discard

2015-02-02 Thread Denis V. Lunev
On 02/02/15 23:40, Peter Lieven wrote: Am 02.02.2015 um 21:09 schrieb Denis V. Lunev: qemu_gluster_co_discard calculates size to discard as follows size_t size = nb_sectors * BDRV_SECTOR_SIZE; ret = glfs_discard_async(s->fd, offset, size, &gluster_finish_aio

Re: [Qemu-devel] [PATCH 1/2] glusterfs: fix max_discard

2015-02-02 Thread Denis V. Lunev
On 02/02/15 23:46, Denis V. Lunev wrote: On 02/02/15 23:40, Peter Lieven wrote: Am 02.02.2015 um 21:09 schrieb Denis V. Lunev: qemu_gluster_co_discard calculates size to discard as follows size_t size = nb_sectors * BDRV_SECTOR_SIZE; ret = glfs_discard_async(s->fd, offset, s

Re: [Qemu-devel] [PATCH 1/2] glusterfs: fix max_discard

2015-02-03 Thread Denis V. Lunev
On 03/02/15 14:47, Peter Lieven wrote: Am 03.02.2015 um 12:37 schrieb Kevin Wolf: Am 03.02.2015 um 12:30 hat Peter Lieven geschrieben: Am 03.02.2015 um 08:31 schrieb Denis V. Lunev: On 02/02/15 23:46, Denis V. Lunev wrote: On 02/02/15 23:40, Peter Lieven wrote: Am 02.02.2015 um 21:09

Re: [Qemu-devel] [PATCH] block: introduce BDRV_REQUEST_MAX_SECTORS

2015-02-03 Thread Denis V. Lunev
num { #define BDRV_SECTOR_SIZE (1ULL << BDRV_SECTOR_BITS) #define BDRV_SECTOR_MASK ~(BDRV_SECTOR_SIZE - 1) +#define BDRV_REQUEST_MAX_SECTORS MIN(SIZE_MAX >> BDRV_SECTOR_BITS, \ + INT_MAX >> BDRV_SECTOR_BITS) + /* * Allocation status flags

Re: [Qemu-devel] [PATCH] block: introduce BDRV_REQUEST_MAX_SECTORS

2015-02-03 Thread Denis V. Lunev
On 03/02/15 17:30, Peter Lieven wrote: Am 03.02.2015 um 14:29 schrieb Denis V. Lunev: On 03/02/15 15:12, Peter Lieven wrote: we check and adjust request sizes at several places with sometimes inconsistent checks or default values: INT_MAX INT_MAX >> BDRV_SECTOR_BITS UI

Re: [Qemu-devel] RFC: Proposal to add QEMU "Guest Environment Variables"

2015-02-03 Thread Denis V. Lunev
On 03/02/15 22:09, Gabriel L. Somlo wrote: Hi, I'm interested in adding a way for a host to pass environment variables into a qemu guest VM -- analogous to setting environment variables for a process to access via getenv() and friends. The QEMU Guest Agent (QGA) does not appear to quite fit the

Re: [Qemu-devel] RFC: Proposal to add QEMU "Guest Environment Variables"

2015-02-03 Thread Denis V. Lunev
On 03/02/15 23:14, Gabriel L. Somlo wrote: Hi Denis, On Tue, Feb 03, 2015 at 10:14:03PM +0300, Denis V. Lunev wrote: On 03/02/15 22:09, Gabriel L. Somlo wrote: I'm interested in adding a way for a host to pass environment variables into a qemu guest VM -- analogous to setting enviro

Re: [Qemu-devel] [PATCH v2 0/8] qemu: guest agent: implement guest-exec command for Linux

2015-02-03 Thread Denis V. Lunev
On 03/02/15 23:24, Michael Roth wrote: Quoting Denis V. Lunev (2015-01-13 04:13:03) On 09/01/15 22:29, Michael Roth wrote: Quoting Denis V. Lunev (2015-01-09 12:09:10) On 09/01/15 20:06, Michael Roth wrote: Quoting Denis V. Lunev (2014-12-31 07:06:46) hese patches for guest-agent add the

Re: [Qemu-devel] RFC: Proposal to add QEMU "Guest Environment Variables"

2015-02-03 Thread Denis V. Lunev
On 04/02/15 00:38, Gabriel L. Somlo wrote: On Tue, Feb 03, 2015 at 02:11:12PM -0600, Michael Roth wrote: This does seem like useful functionality, but I think I'd like to know more about the actual use-cases being looked at. The proposed functionality is mostly equivalent to that offered by "

Re: [Qemu-devel] [PATCH] block: introduce BDRV_REQUEST_MAX_SECTORS

2015-02-06 Thread Denis V. Lunev
On 06/02/15 11:49, Peter Lieven wrote: Am 03.02.2015 um 16:33 schrieb Denis V. Lunev: On 03/02/15 17:30, Peter Lieven wrote: Am 03.02.2015 um 14:29 schrieb Denis V. Lunev: On 03/02/15 15:12, Peter Lieven wrote: we check and adjust request sizes at several places with sometimes inconsistent

[Qemu-devel] [PATCH 1/1] nbd: fix max_discard/max_transfer_length

2015-02-06 Thread Denis V. Lunev
be discarded, in bytes } QEMU_PACKED; Thus we should limit bl_max_discard to UINT32_MAX >> BDRV_SECTOR_BITS to avoid overflow. NBD read/write code uses the same structure for transfers. Fix max_transfer_length accordingly. Signed-off-by: Denis V. Lunev CC: Peter Lieven CC: Kevin Wolf -

Re: [Qemu-devel] [PATCH V2] block: introduce BDRV_REQUEST_MAX_SECTORS

2015-02-06 Thread Denis V. Lunev
block.h @@ -83,6 +83,9 @@ typedef enum { #define BDRV_SECTOR_SIZE (1ULL << BDRV_SECTOR_BITS) #define BDRV_SECTOR_MASK ~(BDRV_SECTOR_SIZE - 1) +#define BDRV_REQUEST_MAX_SECTORS MIN(SIZE_MAX >> BDRV_SECTOR_BITS, \ + INT_MAX >> BDRV_SECTOR_BITS) + /* * Allocation status flags * BDRV_BLOCK_DATA: data is read from bs->file or another file Reviewed-by: Denis V. Lunev

Re: [Qemu-devel] [PATCH 1/1] nbd: fix max_discard/max_transfer_length

2015-02-06 Thread Denis V. Lunev
On 06/02/15 14:53, Kevin Wolf wrote: Am 06.02.2015 um 12:24 hat Denis V. Lunev geschrieben: nbd_co_discard calls nbd_client_session_co_discard which uses uint32_t as the length in bytes of the data to discard due to the following definition: struct nbd_request { uint32_t magic

Re: [Qemu-devel] [PATCH 1/1] nbd: fix max_discard/max_transfer_length

2015-02-06 Thread Denis V. Lunev
On 06/02/15 15:07, Kevin Wolf wrote: Am 06.02.2015 um 12:59 hat Denis V. Lunev geschrieben: On 06/02/15 14:53, Kevin Wolf wrote: Am 06.02.2015 um 12:24 hat Denis V. Lunev geschrieben: nbd_co_discard calls nbd_client_session_co_discard which uses uint32_t as the length in bytes of the data to

Re: [Qemu-devel] [PATCH 1/1] nbd: fix max_discard/max_transfer_length

2015-02-06 Thread Denis V. Lunev
On 06/02/15 15:22, Peter Lieven wrote: Am 06.02.2015 um 13:17 schrieb Denis V. Lunev: On 06/02/15 15:07, Kevin Wolf wrote: Am 06.02.2015 um 12:59 hat Denis V. Lunev geschrieben: On 06/02/15 14:53, Kevin Wolf wrote: Am 06.02.2015 um 12:24 hat Denis V. Lunev geschrieben: nbd_co_discard calls

[Qemu-devel] [PATCH v4 0/1] block: enforce minimal 4096 alignment in qemu_blockalign

2015-02-06 Thread Denis V. Lunev
force additional bounce buffering as suggested by Paolo - reduces 10% to 5% in patch description to better fit 180 vs 189 difference Signed-off-by: Denis V. Lunev CC: Paolo Bonzini CC: Kevin Wolf

[Qemu-devel] [PATCH 1/2] block, raw-posix: replace 512/4096 constants with proper macros/values

2015-02-06 Thread Denis V. Lunev
Signed-off-by: Denis V. Lunev CC: Paolo Bonzini CC: Kevin Wolf --- block.c | 10 +- block/raw-posix.c | 16 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/block.c b/block.c index d45e4dd..e98d651 100644 --- a/block.c +++ b/block.c @@ -225,8

[Qemu-devel] [PATCH 2/2] block: align bounce buffers to page

2015-02-06 Thread Denis V. Lunev
driver which should change this default at the moment. Signed-off-by: Denis V. Lunev CC: Paolo Bonzini CC: Kevin Wolf --- block.c | 20 ++-- block/raw-posix.c | 2 +- include/block/block.h | 2 ++ include/block/block_int.h | 3 +++ 4 files changed,

[Qemu-devel] [PATCH 0/3] qemu guest agent: support guest-file-* command for Windows

2015-02-06 Thread Denis V. Lunev
previous version: - compilation is fixed by gropping strtok_r at all - error_setg_win32 is used for error decoding Signed-off-by: Olga Krishtal Signed-off-by: Denis V. Lunev CC: Michael Roth

[Qemu-devel] [PATCH 1/3] utils: drop strtok_r from envlist_parse

2015-02-06 Thread Denis V. Lunev
mpiler version check here is not a good idea. Though fortunately strtok_r is used only once in the code and we could simply rewrite the code without it. Signed-off-by: Olga Krishtal Signed-off-by: Denis V. Lunev CC: Eric Blake CC: Michael Roth --- include/sysemu/os-win32.h | 1 - util/envli

[Qemu-devel] [PATCH 3/3] qga: implement file commands for Windows guest

2015-02-06 Thread Denis V. Lunev
is a prerequisite for Windows guest-exec command support. Signed-off-by: Olga Krishtal Signed-off-by: Denis V. Lunev CC: Michael Roth --- qga/commands-win32.c | 271 +++ 1 file changed, 250 insertions(+), 21 deletions(-) diff --git a/qga/commands

[Qemu-devel] [PATCH 2/3] guest agent: guest-file-open: refactoring

2015-02-06 Thread Denis V. Lunev
From: Simon Zolin Moved the code that sets non-blocking flag on fd into a separate function. Signed-off-by: Simon Zolin Reviewed-by: Roman Kagan Signed-off-by: Denis V. Lunev CC: Michael Roth CC: Eric Blake --- qga/commands-posix.c | 31 +++ 1 file changed, 23

Re: [Qemu-devel] target-i386: clear bsp bit when designating bsp

2015-04-07 Thread Denis V. Lunev
On 07/04/15 16:18, Paolo Bonzini wrote: On 07/04/2015 13:57, Andreas Färber wrote: If this is some issue with sync'ing state back and forth before QEMU and KVM then the real issue has not been explained. Hm, hw/intc/apic_common.c:apic_reset_common() has: bsp = cpu_is_bsp(s->cpu); s

Re: [Qemu-devel] target-i386: clear bsp bit when designating bsp

2015-04-07 Thread Denis V. Lunev
On 07/04/15 16:29, Paolo Bonzini wrote: On 07/04/2015 15:26, Denis V. Lunev wrote: On 07/04/15 16:18, Paolo Bonzini wrote: On 07/04/2015 13:57, Andreas Färber wrote: If this is some issue with sync'ing state back and forth before QEMU and KVM then the real issue has not been expl

[Qemu-devel] [PATCH 1/1] apic_common: improve readability of apic_reset_common

2015-04-07 Thread Denis V. Lunev
Replace call of cpu_is_bsp(s->cpu) which really returns !!(s->apicbase & MSR_IA32_APICBASE_BSP) with directly collected value. Due to this the tracepoint trace_cpu_get_apic_base((uint64_t)s->apicbase); will not be hit anymore in apic_reset_common. Signed-off-by: Denis V. Lunev

[Qemu-devel] [PATCH 03/12] block/parallels: switch to bdrv_read

2014-12-22 Thread Denis V. Lunev
so too. Signed-off-by: Roman Kagan Signed-off-by: Denis V. Lunev CC: Jeff Cody CC: Kevin Wolf CC: Stefan Hajnoczi --- block/parallels.c | 20 +++- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/block/parallels.c b/block/parallels.c index dca0df6..baefd3e

[Qemu-devel] [PATCH 07/12] block/parallels: replace magic constants 4, 64 with proper sizeofs

2014-12-22 Thread Denis V. Lunev
simple purification.. Signed-off-by: Denis V. Lunev Acked-by: Roman Kagan CC: Jeff Cody CC: Kevin Wolf CC: Stefan Hajnoczi --- block/parallels.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/block/parallels.c b/block/parallels.c index 64b169b..306f2e3 100644

[Qemu-devel] [PATCH 01/12] iotests, parallels: quote TEST_IMG in 076 test to be path-safe

2014-12-22 Thread Denis V. Lunev
suggested by Jeff Cody Signed-off-by: Denis V. Lunev Acked-by: Roman Kagan CC: Jeff Cody CC: Kevin Wolf CC: Stefan Hajnoczi --- tests/qemu-iotests/076 | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/qemu-iotests/076 b/tests/qemu-iotests/076 index ed2be35

[Qemu-devel] [PATCH 08/12] block/parallels: _co_writev callback for Parallels format

2014-12-22 Thread Denis V. Lunev
Support write on Parallels images. The code is almost the same as one in the previous patch implemented scatter-gather IO for read. Signed-off-by: Denis V. Lunev Acked-by: Roman Kagan CC: Jeff Cody CC: Kevin Wolf CC: Stefan Hajnoczi --- block/parallels.c | 77

[Qemu-devel] [PATCH 04/12] block/parallels: read up to cluster end in one go

2014-12-22 Thread Denis V. Lunev
From: Roman Kagan Teach parallels_read() to do reads in coarser granularity than just a single sector: if requested, read up to the cluster end in one go. Signed-off-by: Roman Kagan Signed-off-by: Denis V. Lunev CC: Jeff Cody CC: Kevin Wolf CC: Stefan Hajnoczi --- block/parallels.c | 18

[Qemu-devel] [PATCH 05/12] block/parallels: add get_block_status

2014-12-22 Thread Denis V. Lunev
From: Roman Kagan Implement VFS method for get_block_status to Parallels format driver. Signed-off-by: Roman Kagan Signed-off-by: Denis V. Lunev CC: Jeff Cody CC: Kevin Wolf CC: Stefan Hajnoczi --- block/parallels.c | 21 + 1 file changed, 21 insertions(+) diff --git

[Qemu-devel] [PATCH 10/12] block/parallels: support parallels image creation

2014-12-22 Thread Denis V. Lunev
Do not even care to create WithoutFreeSpace image, it is obsolete. Always create WithouFreSpacExt one. The code also does not spend a lot of efforts to fill cylinders and heads fields, they are not used actually in a real life neither in QEMU nor in Parallels products. Signed-off-by: Denis V

[Qemu-devel] [PATCH 11/12] iotests, parallels: test for newly created parallels image via qemu-img

2014-12-22 Thread Denis V. Lunev
Signed-off-by: Denis V. Lunev Acked-by: Roman Kagan CC: Jeff Cody CC: Kevin Wolf CC: Stefan Hajnoczi --- tests/qemu-iotests/115 | 68 ++ tests/qemu-iotests/115.out | 24 tests/qemu-iotests/group | 1 + 3 files changed, 93

[Qemu-devel] [PATCH 12/12] parallels: change copyright information in the image header

2014-12-22 Thread Denis V. Lunev
Signed-off-by: Denis V. Lunev Acked-by: Roman Kagan --- block/parallels.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/block/parallels.c b/block/parallels.c index bea1217..e3abf4e 100644 --- a/block/parallels.c +++ b/block/parallels.c @@ -2,8 +2,12 @@ * Block

Re: [Qemu-devel] [PATCH 2/3] guest agent: add guest-pipe-open

2014-12-24 Thread Denis V. Lunev
On 22/12/14 12:06, Denis V. Lunev wrote: From: Simon Zolin Creates a FIFO pair that can be used with existing file read/write interfaces to communicate with processes spawned via the forthcoming guest-file-exec interface. Signed-off-by: Simon Zolin Acked-by: Roman Kagan Signed-off-by: Denis

[Qemu-devel] [PATCH 0/2] eliminate data write in bdrv_write_zeroes on Linux

2014-12-24 Thread Denis V. Lunev
These patches eliminate data writes completely on Linux if fallocate FALLOC_FL_ZERO_RANGE or FALLOC_FL_PUNCH_HOLE are supported on underlying filesystem. This should seriously increase performance in some cases. Signed-off-by: Denis V. Lunev CC: Kevin Wolf CC: Stefan Hajnoczi

[Qemu-devel] [PATCH 2/2] block: use fallocate(FALLOC_FL_PUNCH_HOLE) & fallocate(0) to write zeroes

2014-12-24 Thread Denis V. Lunev
performance a bit for not-so-modern kernels or for filesystems which do not support FALLOC_FL_ZERO_RANGE. Signed-off-by: Denis V. Lunev CC: Kevin Wolf CC: Stefan Hajnoczi --- block/raw-posix.c | 12 1 file changed, 12 insertions(+) diff --git a/block/raw-posix.c b/block/raw-posix.c index

[Qemu-devel] [PATCH 1/2] block: use fallocate(FALLOC_FL_ZERO_RANGE) in handle_aiocb_write_zeroes

2014-12-24 Thread Denis V. Lunev
this efficiently writes zeroes in the middle of the file on Linux systems if the kernel is capable enough. Signed-off-by: Denis V. Lunev CC: Kevin Wolf CC: Stefan Hajnoczi --- block/raw-posix.c | 11 +++ configure | 19 +++ 2 files changed, 30 insertions

[Qemu-devel] [PATCH 4/3] guest agent: ignore SIGPIPE signal

2014-12-24 Thread Denis V. Lunev
igned-off-by: Simon Zolin Signed-off-by: Denis V. Lunev CC: Michael Roth --- qga/commands-posix.c | 16 qga/main.c | 6 ++ 2 files changed, 22 insertions(+) diff --git a/qga/commands-posix.c b/qga/commands-posix.c index 5872196..93aed2e 100644 --- a/qga/com

Re: [Qemu-devel] [PATCH] kvm_irqchip_assign_irqfd: just set irqfd in case of kvm_irqfds_enabled()

2014-12-26 Thread Denis V. Lunev
On 26/12/14 13:00, Peter Maydell wrote: On 26 December 2014 at 08:05, Tiejun Chen wrote: We should avoid to set irqfd{} unconditionally. Signed-off-by: Tiejun Chen Is there a hot path that we use this on such that the difference in code order matters at all? thanks -- PMM IMHO the patch

[Qemu-devel] [PATCH 3/7] block/raw-posix: create do_fallocate helper

2014-12-26 Thread Denis V. Lunev
The pattern do { if (fallocate(s->fd, mode, offset, len) == 0) { return 0; } } while (errno == EINTR); is used twice at the moment and I am going to add more usages. Move it to the helper function. Signed-off-by: Denis V. Lunev CC: Kevin Wolf CC: Ste

[Qemu-devel] [PATCH 1/7] block: fix maximum length sent to bdrv_co_do_write_zeroes callback in bs

2014-12-26 Thread Denis V. Lunev
ast and slow) - MAX_WRITE_ZEROES_DEFAULT should be applied for slow path only Signed-off-by: Denis V. Lunev CC: Eric Blake CC: Peter Lieven CC: Kevin Wolf CC: Stefan Hajnoczi --- block.c | 21 +++-- 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/block.c b/bloc

[Qemu-devel] [PATCH 7/7] block/raw-posix: call plain fallocate in handle_aiocb_write_zeroes

2014-12-26 Thread Denis V. Lunev
). This improves the performance of writing zeroes even on really old platforms which do not have even FALLOC_FL_PUNCH_HOLE. Signed-off-by: Denis V. Lunev CC: Kevin Wolf CC: Stefan Hajnoczi --- block/raw-posix.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/block/raw

[Qemu-devel] [PATCH v2 0/7] eliminate data write in bdrv_write_zeroes on Linux

2014-12-26 Thread Denis V. Lunev
These patches eliminate data writes completely on Linux if fallocate FALLOC_FL_ZERO_RANGE or FALLOC_FL_PUNCH_HOLE are supported on underlying filesystem. This should seriously increase performance in some special cases. Signed-off-by: Denis V. Lunev CC: Kevin Wolf CC: Stefan Hajnoczi

[Qemu-devel] [PATCH 6/7] block: use fallocate(FALLOC_FL_PUNCH_HOLE) & fallocate(0) to write zeroes

2014-12-26 Thread Denis V. Lunev
data on this offset. Therefore to make the situation consistent we should drop the data beforehand. This is done using FALLOC_FL_PUNCH_HOLE This should increase the performance a bit for not-so-modern kernels or for filesystems which do not support FALLOC_FL_ZERO_RANGE. Signed-off-by: Denis V

[Qemu-devel] [PATCH 4/7] block/raw-posix: create translate_err helper to merge errno values

2014-12-26 Thread Denis V. Lunev
actually the code if (ret == -ENODEV || ret == -ENOSYS || ret == -EOPNOTSUPP || ret == -ENOTTY) { ret = -ENOTSUP; } is present twice and will be added a couple more times. Create helper for this. Place it into do_fallocate() for further convinience. Signed-off-by: Denis V

[Qemu-devel] [PATCH 2/7] block: use fallocate(FALLOC_FL_ZERO_RANGE) in handle_aiocb_write_zeroes

2014-12-26 Thread Denis V. Lunev
This efficiently writes zeroes on Linux if the kernel is capable enough. FALLOC_FL_ZERO_RANGE correctly handles all cases, including and not including file expansion. Signed-off-by: Denis V. Lunev CC: Kevin Wolf CC: Stefan Hajnoczi --- block/raw-posix.c | 13 - configure

[Qemu-devel] [PATCH 5/7] block/raw-posix: refactor handle_aiocb_write_zeroes a bit

2014-12-26 Thread Denis V. Lunev
ore consistent. Signed-off-by: Denis V. Lunev CC: Kevin Wolf CC: Stefan Hajnoczi --- block/raw-posix.c | 60 +++ 1 file changed, 38 insertions(+), 22 deletions(-) diff --git a/block/raw-posix.c b/block/raw-posix.c index 25a6947..7866d31 100

Re: [Qemu-devel] [PATCH 1/7] block: fix maximum length sent to bdrv_co_do_write_zeroes callback in bs

2014-12-26 Thread Denis V. Lunev
On 26/12/14 16:13, Peter Lieven wrote: Am 26.12.2014 um 13:35 schrieb Denis V. Lunev: The check for maximum length was added by commit c31cb70728d2c0c8900b35a66784baa446fd5147 Author: Peter Lieven Date: Thu Oct 24 12:06:58 2013 +0200 block: honour BlockLimits in

Re: [Qemu-devel] [PATCH 1/7] block: fix maximum length sent to bdrv_co_do_write_zeroes callback in bs

2014-12-26 Thread Denis V. Lunev
On 26/12/14 16:32, Denis V. Lunev wrote: On 26/12/14 16:13, Peter Lieven wrote: Am 26.12.2014 um 13:35 schrieb Denis V. Lunev: The check for maximum length was added by commit c31cb70728d2c0c8900b35a66784baa446fd5147 Author: Peter Lieven Date: Thu Oct 24 12:06:58 2013 +0200

Re: [Qemu-devel] [PATCH 1/7] block: fix maximum length sent to bdrv_co_do_write_zeroes callback in bs

2014-12-27 Thread Denis V. Lunev
On 27/12/14 17:52, Peter Lieven wrote: Am 26.12.2014 um 20:15 schrieb Denis V. Lunev: On 26/12/14 16:32, Denis V. Lunev wrote: On 26/12/14 16:13, Peter Lieven wrote: Am 26.12.2014 um 13:35 schrieb Denis V. Lunev: The check for maximum length was added by commit

Re: [Qemu-devel] [PATCH 1/7] block: fix maximum length sent to bdrv_co_do_write_zeroes callback in bs

2014-12-27 Thread Denis V. Lunev
On 27/12/14 23:01, Peter Lieven wrote: Am 27.12.2014 um 18:42 schrieb Denis V. Lunev: On 27/12/14 17:52, Peter Lieven wrote: Am 26.12.2014 um 20:15 schrieb Denis V. Lunev: On 26/12/14 16:32, Denis V. Lunev wrote: On 26/12/14 16:13, Peter Lieven wrote: Am 26.12.2014 um 13:35 schrieb Denis V

[Qemu-devel] [PATCH 8/8] block/raw-posix: set max_write_zeroes to INT_MAX for regular files

2014-12-30 Thread Denis V. Lunev
fallocate() works fine and could handle properly with arbitrary size requests. There is no sense to reduce the amount of space to fallocate. The bigger the size, the better is performance as the amount of journal updates is reduced. Signed-off-by: Denis V. Lunev CC: Kevin Wolf CC: Stefan

[Qemu-devel] [PATCH 5/8] block/raw-posix: refactor handle_aiocb_write_zeroes a bit

2014-12-30 Thread Denis V. Lunev
ore consistent. Signed-off-by: Denis V. Lunev CC: Kevin Wolf CC: Stefan Hajnoczi CC: Peter Lieven --- block/raw-posix.c | 60 +++ 1 file changed, 38 insertions(+), 22 deletions(-) diff --git a/block/raw-posix.c b/block/raw-posix.c index 25a6

[Qemu-devel] [PATCH 1/8] block: prepare bdrv_co_do_write_zeroes to deal with large bl.max_write_zeroes

2014-12-30 Thread Denis V. Lunev
could simply allocate 1 MiB buffer and create iovec, which will point to the same memory. Signed-off-by: Denis V. Lunev CC: Kevin Wolf CC: Stefan Hajnoczi CC: Peter Lieven --- block.c | 35 --- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a

[Qemu-devel] [PATCH v3 0/8] eliminate data write in bdrv_write_zeroes on Linux in raw-posix.c

2014-12-30 Thread Denis V. Lunev
processing of very large data areas in bdrv_co_write_zeroes (new patch 1) - set bl.max_write_zeroes to INT_MAX in raw-posix.c for regular files (new patch 8) Signed-off-by: Denis V. Lunev CC: Kevin Wolf CC: Stefan Hajnoczi CC: Peter Lieven

[Qemu-devel] [PATCH 4/8] block/raw-posix: create translate_err helper to merge errno values

2014-12-30 Thread Denis V. Lunev
actually the code if (ret == -ENODEV || ret == -ENOSYS || ret == -EOPNOTSUPP || ret == -ENOTTY) { ret = -ENOTSUP; } is present twice and will be added a couple more times. Create helper for this. Place it into do_fallocate() for further convinience. Signed-off-by: Denis V

[Qemu-devel] [PATCH 2/8] block: use fallocate(FALLOC_FL_ZERO_RANGE) in handle_aiocb_write_zeroes

2014-12-30 Thread Denis V. Lunev
This efficiently writes zeroes on Linux if the kernel is capable enough. FALLOC_FL_ZERO_RANGE correctly handles all cases, including and not including file expansion. Signed-off-by: Denis V. Lunev CC: Kevin Wolf CC: Stefan Hajnoczi CC: Peter Lieven --- block/raw-posix.c | 13

[Qemu-devel] [PATCH 7/8] block/raw-posix: call plain fallocate in handle_aiocb_write_zeroes

2014-12-30 Thread Denis V. Lunev
). This improves the performance of writing zeroes even on really old platforms which do not have even FALLOC_FL_PUNCH_HOLE. Signed-off-by: Denis V. Lunev CC: Kevin Wolf CC: Stefan Hajnoczi CC: Peter Lieven --- block/raw-posix.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff

[Qemu-devel] [PATCH 3/8] block/raw-posix: create do_fallocate helper

2014-12-30 Thread Denis V. Lunev
The pattern do { if (fallocate(s->fd, mode, offset, len) == 0) { return 0; } } while (errno == EINTR); is used twice at the moment and I am going to add more usages. Move it to the helper function. Signed-off-by: Denis V. Lunev CC: Kevin Wolf CC: Ste

[Qemu-devel] [PATCH 6/8] block: use fallocate(FALLOC_FL_PUNCH_HOLE) & fallocate(0) to write zeroes

2014-12-30 Thread Denis V. Lunev
data on this offset. Therefore to make the situation consistent we should drop the data beforehand. This is done using FALLOC_FL_PUNCH_HOLE This should increase the performance a bit for not-so-modern kernels or for filesystems which do not support FALLOC_FL_ZERO_RANGE. Signed-off-by: Denis V

[Qemu-devel] [PATCH 02/19] block/parallels: rename parallels_header to ParallelsHeader

2014-12-30 Thread Denis V. Lunev
this follows QEMU coding convention Signed-off-by: Denis V. Lunev Acked-by: Roman Kagan CC: Kevin Wolf CC: Stefan Hajnoczi --- block/parallels.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/block/parallels.c b/block/parallels.c index 4f9cd8d..dca0df6 100644

[Qemu-devel] [PATCH v2 0/19] write/create for Parallels images with reasonable performance

2014-12-30 Thread Denis V. Lunev
] block/parallels: new concept for DiskDescriptor.xml to validate that approach for DiskDescriptor.xml problem. Changes from v1: - patches 13-19 added, which boosts performance from 800 KiB/sec to near native performance Signed-off-by: Denis V. Lunev CC: Roman Kagan CC: Jeff Cody CC: Kevin Wolf

[Qemu-devel] [PATCH 07/19] block/parallels: replace magic constants 4, 64 with proper sizeofs

2014-12-30 Thread Denis V. Lunev
simple purification.. Signed-off-by: Denis V. Lunev Acked-by: Roman Kagan CC: Kevin Wolf CC: Stefan Hajnoczi --- block/parallels.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/block/parallels.c b/block/parallels.c index 64b169b..306f2e3 100644 --- a/block

[Qemu-devel] [PATCH 05/19] block/parallels: add get_block_status

2014-12-30 Thread Denis V. Lunev
From: Roman Kagan Implement VFS method for get_block_status to Parallels format driver. Signed-off-by: Roman Kagan Signed-off-by: Denis V. Lunev CC: Kevin Wolf CC: Stefan Hajnoczi --- block/parallels.c | 21 + 1 file changed, 21 insertions(+) diff --git a/block

[Qemu-devel] [PATCH 03/19] block/parallels: switch to bdrv_read

2014-12-30 Thread Denis V. Lunev
so too. Signed-off-by: Roman Kagan Signed-off-by: Denis V. Lunev CC: Kevin Wolf CC: Stefan Hajnoczi --- block/parallels.c | 20 +++- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/block/parallels.c b/block/parallels.c index dca0df6..baefd3e 100644 --- a/block

[Qemu-devel] [PATCH 01/19] iotests, parallels: quote TEST_IMG in 076 test to be path-safe

2014-12-30 Thread Denis V. Lunev
suggested by Jeff Cody Signed-off-by: Denis V. Lunev Acked-by: Roman Kagan CC: Kevin Wolf CC: Stefan Hajnoczi --- tests/qemu-iotests/076 | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/qemu-iotests/076 b/tests/qemu-iotests/076 index ed2be35..0139976

[Qemu-devel] [PATCH 04/19] block/parallels: read up to cluster end in one go

2014-12-30 Thread Denis V. Lunev
From: Roman Kagan Teach parallels_read() to do reads in coarser granularity than just a single sector: if requested, read up to the cluster end in one go. Signed-off-by: Roman Kagan Signed-off-by: Denis V. Lunev CC: Kevin Wolf CC: Stefan Hajnoczi --- block/parallels.c | 18

[Qemu-devel] [PATCH 06/19] block/parallels: provide _co_readv routine for parallels format driver

2014-12-30 Thread Denis V. Lunev
Main approach is taken from qcow2_co_readv. The patch drops coroutine lock for the duration of IO operation and peforms normal scatter-gather IO using standard QEMU backend. Signed-off-by: Denis V. Lunev Acked-by: Roman Kagan CC: Kevin Wolf CC: Stefan Hajnoczi --- block/parallels.c | 46

[Qemu-devel] [PATCH 08/19] block/parallels: _co_writev callback for Parallels format

2014-12-30 Thread Denis V. Lunev
Support write on Parallels images. The code is almost the same as one in the previous patch implemented scatter-gather IO for read. Signed-off-by: Denis V. Lunev Acked-by: Roman Kagan CC: Kevin Wolf CC: Stefan Hajnoczi --- block/parallels.c | 77

[Qemu-devel] [PATCH 09/19] iotests, parallels: test for write into Parallels image

2014-12-30 Thread Denis V. Lunev
Signed-off-by: Denis V. Lunev Acked-by: Roman Kagan CC: Kevin Wolf CC: Stefan Hajnoczi --- tests/qemu-iotests/076 | 5 + tests/qemu-iotests/076.out | 10 ++ 2 files changed, 15 insertions(+) diff --git a/tests/qemu-iotests/076 b/tests/qemu-iotests/076 index 0139976..c9b55a9

[Qemu-devel] [PATCH 13/19] block/parallels: store ParallelsHeader to the BDRVParallelsState

2014-12-30 Thread Denis V. Lunev
should keep the header somethere to obtain first sector of the image properly. BDRVParallelsState would be a good place for that. Signed-off-by: Denis V. Lunev CC: Kevin Wolf CC: Stefan Hajnoczi --- block/parallels.c | 19 ++- 1 file changed, 10 insertions(+), 9 deletions

[Qemu-devel] [PATCH 15/19] block/parallels: rename catalog_ names to bat_

2014-12-30 Thread Denis V. Lunev
BAT means 'block allocation table'. Thus this name is clean and shorter on writing. Signed-off-by: Denis V. Lunev CC: Kevin Wolf CC: Stefan Hajnoczi --- block/parallels.c | 48 1 file changed, 24 insertions(+), 24 deletions(-) di

[Qemu-devel] [PATCH 10/19] block/parallels: support parallels image creation

2014-12-30 Thread Denis V. Lunev
Do not even care to create WithoutFreeSpace image, it is obsolete. Always create WithouFreSpacExt one. The code also does not spend a lot of efforts to fill cylinders and heads fields, they are not used actually in a real life neither in QEMU nor in Parallels products. Signed-off-by: Denis V

[Qemu-devel] [PATCH 19/19] block/parallels: optimize linear image expansion

2014-12-30 Thread Denis V. Lunev
benefit is around 15%. This patch is final in this series. Block driver has near native performance now. Signed-off-by: Denis V. Lunev CC: Kevin Wolf CC: Stefan Hajnoczi --- block/parallels.c | 35 +-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --g

[Qemu-devel] [PATCH 11/19] iotests, parallels: test for newly created parallels image via qemu-img

2014-12-30 Thread Denis V. Lunev
Signed-off-by: Denis V. Lunev Acked-by: Roman Kagan CC: Kevin Wolf CC: Stefan Hajnoczi --- tests/qemu-iotests/115 | 68 ++ tests/qemu-iotests/115.out | 24 tests/qemu-iotests/group | 1 + 3 files changed, 93 insertions

[Qemu-devel] [PATCH 16/19] block/parallels: no need to flush on each block allocation table update

2014-12-30 Thread Denis V. Lunev
parallels -o cluster_size=64k ./1.hds 64G qemu-io -f parallels -c "write -P 0x11 0 1024k" 1.hds from 45 Mb/sec to 160 Mb/sec on my SSD disk. The gain on rotational media is much more sufficient, from 800 Kb/sec to 45 Mb/sec. Signed-off-by: Denis V. Lunev CC: Kevin Wolf CC: Stef

[Qemu-devel] [PATCH 14/19] block/parallels: create catalog_offset helper

2014-12-30 Thread Denis V. Lunev
to calculate entry offset inside catalog bitmap in parallels image. This is a matter of convinience. Signed-off-by: Denis V. Lunev CC: Kevin Wolf CC: Stefan Hajnoczi --- block/parallels.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/block/parallels.c b

[Qemu-devel] [PATCH 12/19] parallels: change copyright information in the image header

2014-12-30 Thread Denis V. Lunev
Signed-off-by: Denis V. Lunev Acked-by: Roman Kagan CC: Kevin Wolf CC: Stefan Hajnoczi --- block/parallels.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/block/parallels.c b/block/parallels.c index bea1217..e3abf4e 100644 --- a/block/parallels.c +++ b/block

[Qemu-devel] [PATCH 17/19] block/parallels: delay writing to BAT till bdrv_co_flush_to_os

2014-12-30 Thread Denis V. Lunev
-f parallels -o cluster_size=64k ./1.hds 64G qemu-io -f parallels -c "write -P 0x11 0 1024k" 1.hds writing from 50-60 Mb/sec to 80-90 Mb/sec on rotational media and from 160 Mb/sec to 190 Mb/sec on SSD disk. Signed-off-by: Denis V. Lunev CC: Kevin Wolf CC: Stefan Hajnoczi --- block/par

<    1   2   3   4   5   6   7   8   9   10   >