Re: [Qemu-block] [Qemu-devel] [PATCH 1/1] vl.c: Since the help says that 'disk_image' is a raw hard disk image, pass format=raw

2015-05-04 Thread Kevin Wolf
Am 01.05.2015 um 01:28 hat Don Slutz geschrieben: On 04/30/15 16:15, Kevin Wolf wrote: Am 30.04.2015 um 21:15 hat Eric Blake geschrieben: [adding qemu-block] On 04/30/2015 12:23 PM, Don Slutz wrote: ~/qemu/out/master/x86_64-softmmu/qemu-system-x86_64 -h | head QEMU emulator version

Re: [Qemu-block] [PATCH v3 3/9] libqos: Add migration helpers

2015-05-04 Thread Kevin Wolf
Am 30.04.2015 um 20:07 hat John Snow geschrieben: libqos.c: -set_context for addressing which commands go where -migrate performs the actual migration malloc.c: - Structure of the allocator is adjusted slightly with a second-tier malloc to make swapping around the

Re: [Qemu-block] [PATCH v3 0/9] ahci: enable migration

2015-05-04 Thread Kevin Wolf
Am 30.04.2015 um 20:07 hat John Snow geschrieben: The day we all feared is here, and I am proposing we allow the migration of the AHCI device tentatively for the 2.4 development window. There are some more NCQ migration tests are needed, but I felt that it was important to get migration

Re: [Qemu-block] [Qemu-devel] [PATCH 1/1] vl.c: Since the help says that 'disk_image' is a raw hard disk image, pass format=raw

2015-05-04 Thread Markus Armbruster
Kevin Wolf kw...@redhat.com writes: Am 01.05.2015 um 01:28 hat Don Slutz geschrieben: [...] So do you want a more complex patch that allows the format to be specified? Only for 'disk_image'? Include -hd* ? I'm afraid that there is no nice way to improve the plain 'disk_image' case.

[Qemu-block] [PATCH v5 0/2] block: enforce minimal 4096 alignment in qemu_blockalign

2015-05-04 Thread Denis V. Lunev
The following sequence int fd = open(argv[1], O_RDWR | O_CREAT | O_DIRECT, 0644); for (i = 0; i 10; i++) write(fd, buf, 4096); iperforms 5% better if buf is aligned to 4096 bytes rather then to 512 bytes. I have used the following program to test #define _GNU_SOURCE

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

2015-05-04 Thread Denis V. Lunev
The following sequence int fd = open(argv[1], O_RDWR | O_CREAT | O_DIRECT, 0644); for (i = 0; i 10; i++) write(fd, buf, 4096); performs 5% better if buf is aligned to 4096 bytes. The difference is quite reliable. On the other hand we do not want at the moment to enforce

[Qemu-block] [PATCH 1/2] block: minimal bounce buffer alignment

2015-05-04 Thread Denis V. Lunev
The patch introduces new concept: minimal memory alignment for bounce buffers. Original so called optimal value is actually minimal required value for aligment. It should be used for validation that the IOVec is properly aligned and bounce buffer is not required. Though, from the performance

Re: [Qemu-block] [Qemu-devel] [PATCH 1/1] vl.c: Since the help says that 'disk_image' is a raw hard disk image, pass format=raw

2015-05-04 Thread Kevin Wolf
Am 04.05.2015 um 15:39 hat Markus Armbruster geschrieben: Kevin Wolf kw...@redhat.com writes: Am 01.05.2015 um 01:28 hat Don Slutz geschrieben: [...] So do you want a more complex patch that allows the format to be specified? Only for 'disk_image'? Include -hd* ? I'm afraid

Re: [Qemu-block] [PATCH v3 0/9] ahci: enable migration

2015-05-04 Thread John Snow
On 05/04/2015 08:29 AM, Kevin Wolf wrote: Am 30.04.2015 um 20:07 hat John Snow geschrieben: The day we all feared is here, and I am proposing we allow the migration of the AHCI device tentatively for the 2.4 development window. There are some more NCQ migration tests are needed, but I felt

Re: [Qemu-block] [Qemu-devel] [PATCH v3 3/9] libqos: Add migration helpers

2015-05-04 Thread John Snow
On 05/04/2015 08:07 AM, Kevin Wolf wrote: Am 30.04.2015 um 20:07 hat John Snow geschrieben: libqos.c: -set_context for addressing which commands go where -migrate performs the actual migration malloc.c: - Structure of the allocator is adjusted slightly with a

[Qemu-block] [PATCH v4 01/17] qcow2: Add new overlap check functions

2015-05-04 Thread Max Reitz
The existing qcow2 metadata overlap detection function used existing structures to determine the location of the image metadata, from plain fields such as l1_table_offset and l1_size in the BDRVQcowState, over image structures in memory such as the L1 table for the L2 tables' positions, or it even

[Qemu-block] [PATCH v4 00/17] qcow2: Add new overlap check functions

2015-05-04 Thread Max Reitz
This is a continuation of previous versions of this series. v2's cover letter was the most elaborate, which you can find here (includes benchmarks): http://lists.nongnu.org/archive/html/qemu-devel/2014-11/msg03430.html See patch 1 for an explanation of why this series exists and what it does.

[Qemu-block] [PATCH v4 03/17] qcow2: Create metadata list

2015-05-04 Thread Max Reitz
Create and destroy the metadata list on creation and destruction of a qcow2 BDS, respectively. Skip creation if no overlap checks should be performed. Signed-off-by: Max Reitz mre...@redhat.com --- block/qcow2.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/block/qcow2.c

[Qemu-block] [PATCH v4 04/17] qcow2/overlaps: Protect image header

2015-05-04 Thread Max Reitz
Enter the image header into the metadata list to protect it against accidental modifications. Signed-off-by: Max Reitz mre...@redhat.com Reviewed-by: Eric Blake ebl...@redhat.com --- block/qcow2.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/block/qcow2.c b/block/qcow2.c index

[Qemu-block] [PATCH v4 05/17] qcow2/overlaps: Protect refcount table

2015-05-04 Thread Max Reitz
Keep track of the refcount table in the metadata list to protect it against accidental modifications. Signed-off-by: Max Reitz mre...@redhat.com Reviewed-by: Eric Blake ebl...@redhat.com --- block/qcow2-refcount.c | 18 ++ block/qcow2.c | 4 2 files changed, 22

[Qemu-block] [PATCH v4 10/17] qcow2/overlaps: Protect inactive L1 tables

2015-05-04 Thread Max Reitz
Keep track of the inactive L1 tables in the metadata list to protect them against accidental modifications. Signed-off-by: Max Reitz mre...@redhat.com Reviewed-by: Eric Blake ebl...@redhat.com --- block/qcow2-snapshot.c | 25 + 1 file changed, 25 insertions(+) diff --git

[Qemu-block] [PATCH v4 11/17] qcow2/overlaps: Protect inactive L2 tables

2015-05-04 Thread Max Reitz
Keep track of the inactive L2 tables in the metadata list to protect them against accidental modifications. Signed-off-by: Max Reitz mre...@redhat.com --- block/qcow2-refcount.c | 20 block/qcow2-snapshot.c | 43 --- 2 files changed,

[Qemu-block] [PATCH v4 15/17] qcow2: Add overlap structure memory size options

2015-05-04 Thread Max Reitz
Add runtime options to qcow2 to control the size of the structures used for metadata overlap prevention (one option to control the size of the bitmap cache, another one to control the total memory size limit). Signed-off-by: Max Reitz mre...@redhat.com --- block/qcow2.c | 35

[Qemu-block] [PATCH v4 13/17] qcow2/overlaps: Add memory limit reached event

2015-05-04 Thread Max Reitz
Later, a mechanism to set a limit on how much memory may be used for the overlap prevention structures will be introduced. If that limit is about to be exceeded, a QMP event should be emitted. This very event is specified by this patch. Signed-off-by: Max Reitz mre...@redhat.com ---

[Qemu-block] [PATCH v4 07/17] qcow2/overlaps: Protect active L1 table

2015-05-04 Thread Max Reitz
Keep track of the active L1 table in the metadata list to protect it against accidental modifications. Signed-off-by: Max Reitz mre...@redhat.com Reviewed-by: Eric Blake ebl...@redhat.com --- block/qcow2-cluster.c | 11 +++ block/qcow2-snapshot.c | 10 ++ block/qcow2.c

[Qemu-block] [PATCH v4 06/17] qcow2/overlaps: Protect refcount blocks

2015-05-04 Thread Max Reitz
Keep track of the refcount blocks in the metadata list to protect them against accidental modifications. Signed-off-by: Max Reitz mre...@redhat.com Reviewed-by: Eric Blake ebl...@redhat.com --- block/qcow2-refcount.c | 38 +- 1 file changed, 37 insertions(+),

[Qemu-block] [PATCH v4 12/17] qcow2: Use new metadata overlap check function

2015-05-04 Thread Max Reitz
Make the static new overlap check function global and drop the old function. Signed-off-by: Max Reitz mre...@redhat.com --- block/qcow2-overlap.c | 8 +--- block/qcow2-refcount.c | 120 - 2 files changed, 2 insertions(+), 126 deletions(-) diff

[Qemu-block] [PATCH v4 14/17] qcow2/overlaps: Add memory usage limit

2015-05-04 Thread Max Reitz
This adds an adjustable limit for the total memory usage of the overlap prevention structures. Signed-off-by: Max Reitz mre...@redhat.com --- block/qcow2-overlap.c | 145 +++--- block/qcow2.c | 2 +- block/qcow2.h | 2 +- 3 files

[Qemu-block] [PATCH v4 17/17] iotests: Test qcow2's overlap check memory limit

2015-05-04 Thread Max Reitz
This patch adds some test cases for the memory limit concerning the in-memory structures used to detect and prevent accidental metadata overlaps. Signed-off-by: Max Reitz mre...@redhat.com --- tests/qemu-iotests/060 | 222 +

[Qemu-block] [PATCH v4 16/17] qapi: Expose new qcow2 overlap check options

2015-05-04 Thread Max Reitz
Expose the two new options for controlling the memory usage of the overlap check implementation via QAPI. Signed-off-by: Max Reitz mre...@redhat.com --- qapi/block-core.json | 37 + 1 file changed, 37 insertions(+) diff --git a/qapi/block-core.json

Re: [Qemu-block] [PATCH v4 13/17] qcow2/overlaps: Add memory limit reached event

2015-05-04 Thread Eric Blake
On 05/04/2015 01:15 PM, Max Reitz wrote: Later, a mechanism to set a limit on how much memory may be used for the overlap prevention structures will be introduced. If that limit is about to be exceeded, a QMP event should be emitted. This very event is specified by this patch.

Re: [Qemu-block] [Qemu-devel] [PATCH v4 0/3] block: Fix unaligned bdrv_aio_write_zeroes

2015-05-04 Thread Fam Zheng
On Thu, 04/30 15:34, Kevin Wolf wrote: Am 27.04.2015 um 15:18 hat Fam Zheng geschrieben: An unaligned zero write causes NULL deferencing in bdrv_co_do_pwritev. That path is reachable from bdrv_co_write_zeroes and bdrv_aio_write_zeroes. You can easily trigger through the former with

[Qemu-block] [PATCH v5 2/3] block: Fix NULL deference for unaligned write if qiov is NULL

2015-05-04 Thread Fam Zheng
For zero write, qiov passed by callers (qemu-io write -z and scsi-disk write same) is NULL. Commit fc3959e466 fixed bdrv_co_write_zeroes which is the common case for this bug, but it still exists in bdrv_aio_write_zeroes. A simpler fix would be in bdrv_co_do_pwritev which is the NULL dereference

[Qemu-block] [PATCH v5 0/3] block: Fix unaligned bdrv_aio_write_zeroes

2015-05-04 Thread Fam Zheng
An unaligned zero write causes NULL deferencing in bdrv_co_do_pwritev. That path is reachable from bdrv_co_write_zeroes and bdrv_aio_write_zeroes. You can easily trigger through the former with qemu-io, as the test case added by 61815d6e0aa. For bdrv_aio_write_zeroes, in common cases there's

Re: [Qemu-block] [PATCH v4 16/17] qapi: Expose new qcow2 overlap check options

2015-05-04 Thread Eric Blake
On 05/04/2015 01:15 PM, Max Reitz wrote: Expose the two new options for controlling the memory usage of the overlap check implementation via QAPI. Signed-off-by: Max Reitz mre...@redhat.com --- qapi/block-core.json | 37 + 1 file changed, 37