Re: [Qemu-devel] [PATCH 1/4] qcow2: Add qcow2_signal_corruption()

2014-08-20 Thread Max Reitz
On 20.08.2014 12:10, Kevin Wolf wrote: Am 16.08.2014 um 23:16 hat Max Reitz geschrieben: Add a helper function for easily marking an image corrupt while outputting an informative message to stderr and via QAPI. Signed-off-by: Max Reitz --- block/qcow2.c | 28

Re: [Qemu-devel] [PATCH 4/4] qcow2: Check L1/L2/reftable entries for alignment

2014-08-20 Thread Max Reitz
On 20.08.2014 12:51, Kevin Wolf wrote: Am 16.08.2014 um 23:16 hat Max Reitz geschrieben: Offsets taken from the L1, L2 and refcount tables are generally assumed to be correctly aligned. However, this cannot be guaranteed if the image has been written to by something different than qemu, thus

Re: [Qemu-devel] [PATCH 3/4] qcow2: Add overlap-check.template option

2014-08-20 Thread Max Reitz
On 20.08.2014 21:22, Eric Blake wrote: On 08/20/2014 11:59 AM, Max Reitz wrote: Being able to set the overlap-check option to a string and then refine it via the overlap-check.* options is a nice idea for the command line but does not work so well for non-flattened dicts. In that case, one can

Re: [Qemu-devel] [PATCH 4/4] qapi/block-core: Add "new" qcow2 options

2014-08-20 Thread Max Reitz
On 20.08.2014 21:36, Eric Blake wrote: On 08/20/2014 11:59 AM, Max Reitz wrote: qcow2 supports more than four options by now, add the new options (overlap check mode and metadata cache size) Signed-off-by: Max Reitz --- qapi/block-core.json | 79

Re: [Qemu-devel] [PATCH 2/3] hw/core/loader: implement load_uimage_at

2014-08-21 Thread Max Filippov
Hi Alex, On Thu, Aug 21, 2014 at 1:16 PM, Alexander Graf wrote: > On 12.08.14 06:22, Max Filippov wrote: >> load_uimage_at loads kernel image at the specified address instead of >> the address recorded in the uImage header. >> >> Cc: qemu-sta...@nongnu.org >

Re: [Qemu-devel] [PATCH 1/4] block: Correct bs->growable

2014-08-22 Thread Max Reitz
On 21.08.2014 10:19, Kevin Wolf wrote: Am 20.08.2014 um 21:13 hat Max Reitz geschrieben: On 20.08.2014 13:40, Kevin Wolf wrote: Am 12.07.2014 um 00:23 hat Max Reitz geschrieben: Currently, the field "growable" in a BDS is set iff the BDS is opened in protocol mode (with O_BDR

Re: [Qemu-devel] [PATCH v11 03/14] qcow2: Optimize bdrv_make_empty()

2014-08-22 Thread Max Reitz
On 21.08.2014 16:31, Kevin Wolf wrote: Am 20.08.2014 um 20:17 hat Max Reitz geschrieben: bdrv_make_empty() is currently only called if the current image represents an external snapshot that has been committed to its base image; it is therefore unlikely to have internal snapshots. In this case

Re: [Qemu-devel] [PATCH v2 2/9] qcow2: Factor out refcount accounting for check

2014-08-22 Thread Max Reitz
On 21.08.2014 23:16, Benoît Canet wrote: On Thu, Aug 21, 2014 at 01:13:20PM -0600, Eric Blake wrote: On 08/21/2014 12:57 PM, Benoît Canet wrote: On Fri, Aug 15, 2014 at 05:16:19PM +0200, Max Reitz wrote: Put the code for calculating the reference counts during qemu-img check into an own

Re: [Qemu-devel] [PATCH v2 2/9] qcow2: Factor out refcount accounting for check

2014-08-22 Thread Max Reitz
On 22.08.2014 17:37, Benoît Canet wrote: On Fri, Aug 22, 2014 at 05:26:45PM +0200, Max Reitz wrote: On 21.08.2014 23:16, Benoît Canet wrote: On Thu, Aug 21, 2014 at 01:13:20PM -0600, Eric Blake wrote: On 08/21/2014 12:57 PM, Benoît Canet wrote: On Fri, Aug 15, 2014 at 05:16:19PM +0200, Max

Re: [Qemu-devel] [PATCH v2 2/9] qcow2: Factor out refcount accounting for check

2014-08-22 Thread Max Reitz
On 22.08.2014 17:44, Max Reitz wrote: [snip] […] Splitting the check won't help; […] Sorry, I meant “patch” instead of “check”. Max

[Qemu-devel] [PATCH v3 00/10] qcow2: Fix image repairing

2014-08-22 Thread Max Reitz
ow2: Clean up after refcount rebuild' 009/10:[] [--] 'iotests: Fix test outputs' 010/10:[0004] [FC] 'iotests: Add test for potentially damaging repairs' Max Reitz (10): qcow2: Fix leaks in dirty images qcow2: Split qcow2_check_refcounts() qcow2: Pull check_refblocks()

[Qemu-devel] [PATCH v3 02/10] qcow2: Split qcow2_check_refcounts()

2014-08-22 Thread Max Reitz
Put the code for calculating the reference counts and comparing them during qemu-img check into own functions. Signed-off-by: Max Reitz --- block/qcow2-refcount.c | 153 - 1 file changed, 102 insertions(+), 51 deletions(-) diff --git a/block

[Qemu-devel] [PATCH v3 01/10] qcow2: Fix leaks in dirty images

2014-08-22 Thread Max Reitz
When opening dirty images, qcow2's repair function should not only repair errors but leaks as well. Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- block/qcow2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/qcow2.c b/block/qcow2.c index f9e045f..67d6368 1

[Qemu-devel] [PATCH v3 04/10] qcow2: Reuse refcount table in calculate_refcounts()

2014-08-22 Thread Max Reitz
We will later call calculate_refcounts multiple times, so reuse the refcount table if possible. Signed-off-by: Max Reitz --- block/qcow2-refcount.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c index 2b728ef

[Qemu-devel] [PATCH v3 06/10] qcow2: Do not perform potentially damaging repairs

2014-08-22 Thread Max Reitz
lean which should be set to true whenever a fix is rather dangerous or too complicated using the current refcount structures. Another example for this is refcount blocks being referenced more than once. Signed-off-by: Max Reitz --- block/qcow2-refcou

[Qemu-devel] [PATCH v3 09/10] iotests: Fix test outputs

2014-08-22 Thread Max Reitz
rebuild the refcount structure as well. Signed-off-by: Max Reitz --- tests/qemu-iotests/039.out | 10 -- tests/qemu-iotests/060.out | 10 -- tests/qemu-iotests/061.out | 18 -- 3 files changed, 28 insertions(+), 10 deletions(-) diff --git a/tests/qemu-iotests/039.out b

[Qemu-devel] [PATCH v3 03/10] qcow2: Pull check_refblocks() up

2014-08-22 Thread Max Reitz
Pull check_refblocks() before calculate_refcounts() so we can drop its static declaration. Signed-off-by: Max Reitz --- block/qcow2-refcount.c | 102 - 1 file changed, 49 insertions(+), 53 deletions(-) diff --git a/block/qcow2-refcount.c b/block

[Qemu-devel] [PATCH v3 05/10] qcow2: Fix refcount blocks beyond image end

2014-08-22 Thread Max Reitz
If the qcow2 check function detects a refcount block located beyond the image end, grow the image appropriately. This cannot break anything and is the logical fix for such a case. Signed-off-by: Max Reitz --- block/qcow2-refcount.c | 50 ++ 1 file

[Qemu-devel] [PATCH v3 08/10] qcow2: Clean up after refcount rebuild

2014-08-22 Thread Max Reitz
Because the old refcount structure will be leaked after having rebuilt it, we need to recalculate the refcounts and run a leak-fixing operation afterwards (if leaks should be fixed at all). Signed-off-by: Max Reitz --- block/qcow2-refcount.c | 35 +++ 1 file

[Qemu-devel] [PATCH v3 10/10] iotests: Add test for potentially damaging repairs

2014-08-22 Thread Max Reitz
There are certain cases where repairing a qcow2 image might actually damage it further (or rather, where repairing it has in fact damaged it further with the old qcow2 check implementation). This should not happen, so add a test for these cases. Signed-off-by: Max Reitz --- tests/qemu-iotests

[Qemu-devel] [PATCH v3 07/10] qcow2: Rebuild refcount structure during check

2014-08-22 Thread Max Reitz
ructure will be leaked, however. Signed-off-by: Max Reitz --- block/qcow2-refcount.c | 265 - 1 file changed, 262 insertions(+), 3 deletions(-) diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c index 242a20c..59cab65 100644 --- a/block/q

Re: [Qemu-devel] [PATCH v3 10/10] iotests: Add test for potentially damaging repairs

2014-08-26 Thread Max Reitz
On 22.08.2014 21:55, Eric Blake wrote: On 08/22/2014 10:31 AM, Max Reitz wrote: There are certain cases where repairing a qcow2 image might actually damage it further (or rather, where repairing it has in fact damaged it further with the old qcow2 check implementation). This should not happen

Re: [Qemu-devel] [PATCH v3 09/10] iotests: Fix test outputs

2014-08-26 Thread Max Reitz
On 26.08.2014 15:09, Eric Blake wrote: On 08/22/2014 10:31 AM, Max Reitz wrote: 039, 060 and 061 all create images with referenced clusters having a refcount of 0. Because previous commits changed handling of such errors, these tests now have a different output. Fix it. Furthermore, 060

Re: [Qemu-devel] [PATCH v3 05/10] qcow2: Fix refcount blocks beyond image end

2014-08-26 Thread Max Reitz
On 26.08.2014 15:07, Eric Blake wrote: On 08/22/2014 10:31 AM, Max Reitz wrote: If the qcow2 check function detects a refcount block located beyond the image end, grow the image appropriately. This cannot break anything and is the logical fix for such a case. Does the testsuite cover this one

Re: [Qemu-devel] [PATCH 1/3] qemu-img: fix img_commit() error return value

2014-08-26 Thread Max Reitz
(-) Reviewed-by: Max Reitz

Re: [Qemu-devel] [PATCH 2/3] qemu-img: fix img_compare() flags error path

2014-08-26 Thread Max Reitz
+++--- 1 file changed, 3 insertions(+), 3 deletions(-) Reviewed-by: Max Reitz

Re: [Qemu-devel] [PATCH 3/3] qemu-img: always goto out in img_snapshot() error paths

2014-08-26 Thread Max Reitz
y initialized during declaration. Reported-by: John Snow Signed-off-by: Stefan Hajnoczi --- qemu-img.c | 15 ++- 1 file changed, 6 insertions(+), 9 deletions(-) Reviewed-by: Max Reitz

[Qemu-devel] [PATCH v12 02/14] qcow2: Implement bdrv_make_empty()

2014-08-26 Thread Max Reitz
Implement this function by making all clusters in the image file fall through to the backing file (by using the recently extended discard). Signed-off-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: Kevin Wolf --- block/qcow2.c | 27 +++ 1 file changed, 27

[Qemu-devel] [PATCH v12 03/14] qcow2: Optimize bdrv_make_empty()

2014-08-26 Thread Max Reitz
the dirty flag set) and creating a trivial refcount structure. If there are snapshots, fall back to the simple implementation (discard all clusters). Signed-off-by: Max Reitz --- block/blkdebug.c | 2 + block/qcow2.c | 137

[Qemu-devel] [PATCH v12 00/14] qemu-img: Implement commit like QMP

2014-08-26 Thread Max Reitz
---] [-C] 'qemu-img: Empty image after commit' 010/14:[] [--] 'qemu-img: Enable progress output for commit' 011/14:[] [-C] 'qemu-img: Specify backing file for commit' 012/14:[] [--] 'iotests: Add _filter_qemu_img_map' 013/14:[] [-C]

[Qemu-devel] [PATCH v12 07/14] block/mirror: Improve progress report

2014-08-26 Thread Max Reitz
er in fact desirable. Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- block/mirror.c | 34 ++ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/block/mirror.c b/block/mirror.c index 5e7a166..98ba217 100644 --- a/block/mirror.c +++ b/block/mirror.

[Qemu-devel] [PATCH v12 04/14] blockjob: Introduce block_job_complete_sync()

2014-08-26 Thread Max Reitz
Implement block_job_complete_sync() by doing the exact same thing as block_job_cancel_sync() does, only with calling block_job_complete() instead of block_job_cancel(). Signed-off-by: Max Reitz Reviewed-by: Kevin Wolf --- blockjob.c | 39

[Qemu-devel] [PATCH v12 05/14] blockjob: Add "ready" field

2014-08-26 Thread Max Reitz
ck job may be completed. Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- blockjob.c | 3 +++ include/block/blockjob.h | 5 + qapi/block-core.json | 4 +++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/blockjob.c b/blockjob.c index ed9927b..56525c4 10

[Qemu-devel] [PATCH v12 01/14] qcow2: Allow "full" discard

2014-08-26 Thread Max Reitz
Normally, discarded sectors should read back as zero. However, there are cases in which a sector (or rather cluster) should be discarded as if they were never written in the first place, that is, reading them should fall through to the backing file again. Signed-off-by: Max Reitz Reviewed-by

[Qemu-devel] [PATCH v12 14/14] iotests: Add test for qcow2's bdrv_make_empty

2014-08-26 Thread Max Reitz
Add a test for qcow2's fast bdrv_make_empty implementation on images without internal snapshots. Signed-off-by: Max Reitz --- tests/qemu-iotests/098 | 78 ++ tests/qemu-iotests/098.out | 45 ++ tests/qemu-iotests/

[Qemu-devel] [PATCH v12 08/14] qemu-img: Implement commit like QMP

2014-08-26 Thread Max Reitz
block-commit by using commit_active_start() and then waiting for the block job to finish. Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- block/Makefile.objs | 2 +- qemu-img.c | 83 + 2 files changed, 65 insertions(+), 20 dele

[Qemu-devel] [PATCH v12 06/14] iotests: Omit length/offset test in 040 and 041

2014-08-26 Thread Max Reitz
function from iotests.py, the same applies there as well which in turn affects tests 030, 055 and 056. On the other hand, a block job's length does not have to be related to the length of the image file in the first place, so that check was questionable anyway. Signed-off-by: Max Reitz Reviewed-by:

[Qemu-devel] [PATCH v12 09/14] qemu-img: Empty image after commit

2014-08-26 Thread Max Reitz
After the top image has been committed, it should be emptied unless specified otherwise. Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- qemu-img-cmds.hx | 4 ++-- qemu-img.c | 34 +++--- qemu-img.texi| 6 +- 3 files changed, 38 insertions(+), 6

[Qemu-devel] [PATCH v12 11/14] qemu-img: Specify backing file for commit

2014-08-26 Thread Max Reitz
Introduce a new parameter for qemu-img commit which may be used to explicitly specify the backing file into which an image should be committed if the backing chain has more than a single layer. Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- qemu-img-cmds.hx | 4 ++-- qemu-img.c

[Qemu-devel] [PATCH v12 10/14] qemu-img: Enable progress output for commit

2014-08-26 Thread Max Reitz
Implement progress output for the commit command by querying the progress of the block job. Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- qemu-img-cmds.hx | 4 ++-- qemu-img.c | 24 ++-- qemu-img.texi| 2 +- 3 files changed, 25 insertions(+), 5 deletions

[Qemu-devel] [PATCH v12 13/14] iotests: Add test for backing-chain commits

2014-08-26 Thread Max Reitz
Add a test for qemu-img commit on backing chains with more than two images. This test also checks whether the top image is emptied (unless this is prevented by specifying either -d or -b) and does therefore not work for qed and vmdk which requires it to be separate from 020. Signed-off-by: Max

[Qemu-devel] [PATCH v12 12/14] iotests: Add _filter_qemu_img_map

2014-08-26 Thread Max Reitz
As different image formats most probably map guest addresses to different host addresses, add a filter to filter the host addresses out; also, the image filename should be filtered. Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- tests/qemu-iotests/common.filter | 7 +++ 1 file

Re: [Qemu-devel] [PATCH 4/4] qcow2: Fix leak of opts in qcow2_open

2014-08-27 Thread Max Reitz
ts in qcow2_open()' from my 'qapi/block-core: Add "new" qcow2 options' series. I guess it's up to the maintainer(s) which one gets pulled, I just want to point out that pulling one means leaving out the other. Max

Re: [Qemu-devel] [PATCH v3 07/10] qcow2: Rebuild refcount structure during check

2014-08-27 Thread Max Reitz
On 25.08.2014 19:40, Benoît Canet wrote: On Fri, Aug 22, 2014 at 06:31:41PM +0200, Max Reitz wrote: The previous commit introduced the "rebuild" variable to qcow2's implementation of the image consistency check. Now make use of this by adding a function which creates a complete

[Qemu-devel] [PATCH v4 01/10] qcow2: Fix leaks in dirty images

2014-08-27 Thread Max Reitz
When opening dirty images, qcow2's repair function should not only repair errors but leaks as well. Signed-off-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: Benoît Canet --- block/qcow2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/qcow2.c b/block/qc

[Qemu-devel] [PATCH v4 02/10] qcow2: Split qcow2_check_refcounts()

2014-08-27 Thread Max Reitz
Put the code for calculating the reference counts and comparing them during qemu-img check into own functions. Signed-off-by: Max Reitz Reviewed-by: Benoît Canet --- block/qcow2-refcount.c | 153 - 1 file changed, 102 insertions(+), 51 deletions

[Qemu-devel] [PATCH v4 00/10] qcow2: Fix image repairing

2014-08-27 Thread Max Reitz
s beyond image end' 006/10:[] [--] 'qcow2: Do not perform potentially damaging repairs' 007/10:[0046] [FC] 'qcow2: Rebuild refcount structure during check' 008/10:[] [--] 'qcow2: Clean up after refcount rebuild' 009/10:[] [--] 'iotests: Fix test o

[Qemu-devel] [PATCH v4 04/10] qcow2: Reuse refcount table in calculate_refcounts()

2014-08-27 Thread Max Reitz
We will later call calculate_refcounts multiple times, so reuse the refcount table if possible. Signed-off-by: Max Reitz Reviewed-by: Benoît Canet --- block/qcow2-refcount.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/block/qcow2-refcount.c b/block/qcow2

[Qemu-devel] [PATCH v4 03/10] qcow2: Pull check_refblocks() up

2014-08-27 Thread Max Reitz
Pull check_refblocks() before calculate_refcounts() so we can drop its static declaration. Signed-off-by: Max Reitz Reviewed-by: Benoît Canet --- block/qcow2-refcount.c | 102 - 1 file changed, 49 insertions(+), 53 deletions(-) diff --git a

[Qemu-devel] [PATCH v4 05/10] qcow2: Fix refcount blocks beyond image end

2014-08-27 Thread Max Reitz
If the qcow2 check function detects a refcount block located beyond the image end, grow the image appropriately. This cannot break anything and is the logical fix for such a case. Signed-off-by: Max Reitz --- block/qcow2-refcount.c | 62 ++ 1 file

[Qemu-devel] [PATCH v4 09/10] iotests: Fix test outputs

2014-08-27 Thread Max Reitz
rebuild the refcount structure as well. Signed-off-by: Max Reitz --- tests/qemu-iotests/039.out | 10 -- tests/qemu-iotests/060.out | 10 -- tests/qemu-iotests/061.out | 18 -- 3 files changed, 28 insertions(+), 10 deletions(-) diff --git a/tests/qemu-iotests/039.out b

[Qemu-devel] [PATCH v4 10/10] iotests: Add test for potentially damaging repairs

2014-08-27 Thread Max Reitz
refblocks beyond the image end by resizing the image accordingly. Add several tests for this as well. Signed-off-by: Max Reitz --- tests/qemu-iotests/104 | 141 + tests/qemu-iotests/104.out | 110 +++ tests/qemu-iotests

[Qemu-devel] [PATCH v4 06/10] qcow2: Do not perform potentially damaging repairs

2014-08-27 Thread Max Reitz
lean which should be set to true whenever a fix is rather dangerous or too complicated using the current refcount structures. Another example for this is refcount blocks being referenced more than once. Signed-off-by: Max Reitz Reviewed-by: Benoît Canet --- block/qcow2-refcou

[Qemu-devel] [PATCH v4 07/10] qcow2: Rebuild refcount structure during check

2014-08-27 Thread Max Reitz
ructure will be leaked, however. Signed-off-by: Max Reitz --- block/qcow2-refcount.c | 287 - 1 file changed, 284 insertions(+), 3 deletions(-) diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c index 6300cec..2dca6d4 100644 --- a/block/q

[Qemu-devel] [PATCH v4 08/10] qcow2: Clean up after refcount rebuild

2014-08-27 Thread Max Reitz
Because the old refcount structure will be leaked after having rebuilt it, we need to recalculate the refcounts and run a leak-fixing operation afterwards (if leaks should be fixed at all). Signed-off-by: Max Reitz Reviewed-by: Benoît Canet --- block/qcow2-refcount.c | 35

Re: [Qemu-devel] qemu aborts with temp_save: Assertion `s->temps[temp].val_type == 2 || s->temps[temp].fixed_reg' failed

2013-07-28 Thread Max Filippov
On Mon, Jul 29, 2013 at 3:01 AM, Aurelien Jarno wrote: > On Thu, Jul 11, 2013 at 08:01:19AM +0400, Max Filippov wrote: >> On Thu, Jul 11, 2013 at 6:35 AM, Max Filippov wrote: >> > Hi Peter, >> > >> > I suddenly found qemu built with debug enabled aborting with

[Qemu-devel] [PULL 0/6] target-xtensa queue

2013-07-29 Thread Max Filippov
r window inline (2013-07-29 18:35:45 +0400) xtensa queue 2013-07-29 Andreas Färber (1): tests/tcg/xtensa: Fix out-of-tree build Max Filippov (5): target-xt

Re: [Qemu-devel] [PULL 0/6] target-xtensa queue

2013-08-05 Thread Max Filippov
On Mon, Jul 29, 2013 at 7:16 PM, Max Filippov wrote: > Hello Blue/Antony, > > Please pull my current target-xtensa patch queue. There's a number of > assorted fixes, new testcase and performance optimization patch. > Changes since 2013-07-21: trivial rebase. Ping? > The

Re: [Qemu-devel] GDB debugging of QEMU.

2013-08-09 Thread Max Filippov
ary in > /usr/local/kvm/bin which is presumably whatever older > version was last installed.) You also need --args when you pass arguments to the application being debugged, so the command line looks like sudo gdb --args /usr/local/kvm/bin/qemu-system/x86_64 -s -enable-kvm -hda -- Thanks. -- Max

Re: [Qemu-devel] [PATCH 2/2] disas: Add disas-objdump.pl

2013-08-09 Thread Max Filippov
"-|", objcommand(); +$vma =~ s/:.*//; +open IN, "-|", objcommand($vma); # ... copying all but the first 7 lines of boilerplate to our stdout. my $i = 0; @@ -82,6 +85,7 @@ while (<>) { $mem = ""; $inobjd = 0; } else { +$vma = $_; print; } } -- Thanks. -- Max

Re: [Qemu-devel] [PATCH 0/2] Disassembly with external objdump

2013-08-10 Thread Max Filippov
the only internal disassemblers that > are not missing opcodes are for the extinct cpus. Will that leave those CPUs without x/i support from monitor? Does anybody use it? -- Thanks. -- Max

Re: [Qemu-devel] [PATCH 3/4] block: Allow JSON filenames

2014-05-08 Thread Max Reitz
On 07.05.2014 10:39, Kevin Wolf wrote: Am 06.05.2014 um 21:57 hat Eric Blake geschrieben: On 05/06/2014 01:30 PM, Max Reitz wrote: If the filename given to bdrv_open() is prefixed with "json:", parse the rest as a JSON object and use the result as the options QDict. Signed-off-by:

Re: [Qemu-devel] [PATCH v2] block: Fix bdrv_is_allocated() for short backing files

2014-05-08 Thread Max Reitz
D for !drv->bdrv_co_get_block_status (Max) block.c | 10 ++ include/block/block.h | 11 +++ 2 files changed, 13 insertions(+), 8 deletions(-) Reviewed-by: Max Reitz

[Qemu-devel] [PATCH v3 0/4] block: Allow JSON filenames

2014-05-08 Thread Max Reitz
tual differences, respectively 001/4:[] [--] 'qdict: Add qdict_join()' 002/4:[] [--] 'check-qdict: Add test for qdict_join()' 003/4:[0010] [FC] 'block: Allow JSON filenames' 004/4:[0015] [FC] 'iotests: Add test for the JSON protocol' Max Reitz

[Qemu-devel] [PATCH v3 4/4] iotests: Add test for the JSON protocol

2014-05-08 Thread Max Reitz
Add a test for the JSON protocol driver. Signed-off-by: Max Reitz --- tests/qemu-iotests/089 | 130 + tests/qemu-iotests/089.out | 54 +++ tests/qemu-iotests/group | 1 + 3 files changed, 185 insertions(+) create mode 100755

[Qemu-devel] [PATCH v3 1/4] qdict: Add qdict_join()

2014-05-08 Thread Max Reitz
This function joins two QDicts by absorbing one into the other. Signed-off-by: Max Reitz Reviewed-by: Benoit Canet Reviewed-by: Eric Blake --- include/qapi/qmp/qdict.h | 3 +++ qobject/qdict.c | 32 2 files changed, 35 insertions(+) diff --git a

[Qemu-devel] [PATCH v3 2/4] check-qdict: Add test for qdict_join()

2014-05-08 Thread Max Reitz
Add some test cases for qdict_join(). Signed-off-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: Benoit Canet --- tests/check-qdict.c | 87 + 1 file changed, 87 insertions(+) diff --git a/tests/check-qdict.c b/tests/check-qdict.c index

[Qemu-devel] [PATCH v3 3/4] block: Allow JSON filenames

2014-05-08 Thread Max Reitz
If the filename given to bdrv_open() is prefixed with "json:", parse the rest as a JSON object and merge the result into the options QDict. If there are conflicts, report one of them to the user and abort. Signed-off-by: Max Reitz --- block.c | 41 ++

Re: [Qemu-devel] [PATCH v2] block/raw-posix: Try both FIEMAP and SEEK_HOLE

2014-05-08 Thread Max Reitz
ates and which keeps the old order (FIEMAP first and then SEEK_HOLE). Max

Re: [Qemu-devel] [PATCH 4] block/raw-posix: Try both FIEMAP and SEEK_HOLE

2014-05-08 Thread Max Reitz
Oops, somehow dropped the “v” from “v4” in the subject. I hope you're able to infer the meaning anyway. ;-) Max

[Qemu-devel] [PATCH 4] block/raw-posix: Try both FIEMAP and SEEK_HOLE

2014-05-08 Thread Max Reitz
cases, try FIEMAP first (as this will return -ENOTSUP if not supported instead of returning a failsafe value (everything allocated as a single extent)) and if that does not work, fall back to SEEK_HOLE/SEEK_DATA. Signed-off-by: Max Reitz --- v4: - If the order of FIEMAP and SEEK_HOLE are reversed

[Qemu-devel] [PATCH v7 03/14] qcow2: Optimize bdrv_make_empty()

2014-05-08 Thread Max Reitz
clusters at once by recreating the refcount structure accordingly instead of normally discarding all clusters. If there are snapshots, fall back to the simple implementation (discard all clusters). Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- block/qcow2.c | 389

[Qemu-devel] [PATCH v7 05/14] blockjob: Add "ready" field

2014-05-08 Thread Max Reitz
ck job may be completed. Signed-off-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: Kevin Wolf --- blockjob.c | 7 ++- include/block/blockjob.h | 5 + qapi-schema.json | 4 +++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/blockjob.c b/blockj

[Qemu-devel] [PATCH v7 10/14] qemu-img: Specify backing file for commit

2014-05-08 Thread Max Reitz
Introduce a new parameter for qemu-img commit which may be used to explicitly specify the backing file into which an image should be committed if the backing chain has more than a single layer. Signed-off-by: Max Reitz --- qemu-img-cmds.hx | 4 ++-- qemu-img.c | 24

[Qemu-devel] [PATCH v7 11/14] iotests: Add _filter_qemu_img_map

2014-05-08 Thread Max Reitz
As different image formats most probably map guest addresses to different host addresses, add a filter to filter the host addresses out; also, the image filename should be filtered. Signed-off-by: Max Reitz --- tests/qemu-iotests/common.filter | 7 +++ 1 file changed, 7 insertions(+) diff

[Qemu-devel] [PATCH v7 07/14] qemu-img: Implement commit like QMP

2014-05-08 Thread Max Reitz
block-commit by using commit_active_start() and then waiting for the block job to finish. Signed-off-by: Max Reitz --- block/Makefile.objs | 2 +- qemu-img.c | 83 + 2 files changed, 65 insertions(+), 20 deletions(-) diff --git a/

[Qemu-devel] [PATCH v7 08/14] qemu-img: Empty image after commit

2014-05-08 Thread Max Reitz
After the top image has been committed, it should be emptied unless specified otherwise. Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- qemu-img-cmds.hx | 4 ++-- qemu-img.c | 34 +++--- qemu-img.texi| 6 +- 3 files changed, 38 insertions(+), 6

[Qemu-devel] [PATCH v7 12/14] iotests: Add test for backing-chain commits

2014-05-08 Thread Max Reitz
-by: Max Reitz --- tests/qemu-iotests/092 | 122 + tests/qemu-iotests/092.out | 119 +++ tests/qemu-iotests/group | 1 + 3 files changed, 242 insertions(+) create mode 100755 tests/qemu-iotests/092 create

[Qemu-devel] [PATCH v7 13/14] iotests: Add test for qcow2's bdrv_make_empty

2014-05-08 Thread Max Reitz
Add a test for qcow2's fast bdrv_make_empty implementation on images without internal snapshots. Signed-off-by: Max Reitz --- tests/qemu-iotests/093 | 72 ++ tests/qemu-iotests/093.out | 26 + tests/qemu-iotests/group | 1

[Qemu-devel] [PATCH v7 01/14] qcow2: Allow "full" discard

2014-05-08 Thread Max Reitz
Normally, discarded sectors should read back as zero. However, there are cases in which a sector (or rather cluster) should be discarded as if they were never written in the first place, that is, reading them should fall through to the backing file again. Signed-off-by: Max Reitz Reviewed-by

[Qemu-devel] [PATCH v7 14/14] iotests: Omit length/offset test in 040 and 041

2014-05-08 Thread Max Reitz
which in turn affects tests 030, 055 and 056. On the other hand, a block job's length does not have to be related to the length of the image file in the first place, so that check was questionable anyway. Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- tests/qemu-iotests/040

[Qemu-devel] [PATCH v7 04/14] blockjob: Introduce block_job_complete_sync()

2014-05-08 Thread Max Reitz
Implement block_job_complete_sync() by doing the exact same thing as block_job_cancel_sync() does, only with calling block_job_complete() instead of block_job_cancel(). Signed-off-by: Max Reitz Reviewed-by: Kevin Wolf --- blockjob.c | 39

[Qemu-devel] [PATCH v7 09/14] qemu-img: Enable progress output for commit

2014-05-08 Thread Max Reitz
Implement progress output for the commit command by querying the progress of the block job. Signed-off-by: Max Reitz --- qemu-img-cmds.hx | 4 ++-- qemu-img.c | 24 ++-- qemu-img.texi| 2 +- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/qemu-img

[Qemu-devel] [PATCH v7 06/14] block/mirror: Improve progress report

2014-05-08 Thread Max Reitz
er in fact desirable. Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- block/mirror.c | 32 +--- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/block/mirror.c b/block/mirror.c index 1c38aa8..5d9cc89 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -

[Qemu-devel] [PATCH v7 02/14] qcow2: Implement bdrv_make_empty()

2014-05-08 Thread Max Reitz
Implement this function by making all clusters in the image file fall through to the backing file (by using the recently extended discard). Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- block/qcow2.c | 27 +++ 1 file changed, 27 insertions(+) diff --git a/block

[Qemu-devel] [PATCH v7 00/14] qemu-img: Implement commit like QMP

2014-05-08 Thread Max Reitz
_filter_qemu_img_map' 012/14:[0094] [FC] 'iotests: Add test for backing-chain commits' 013/14:[] [--] 'iotests: Add test for qcow2's bdrv_make_empty' 014/14:[] [--] 'iotests: Omit length/offset test in 040 and 041' Max Reitz (14): qcow2: Allow "full"

Re: [Qemu-devel] [PATCH 4/4] Support more than 255 cpus: runtime check

2014-05-13 Thread Max Filippov
On Tue, May 13, 2014 at 11:09 AM, Li, Zhen-Hua wrote: > From: "Li, ZhenHua" > > There is some runtime check for max cpu count. Make them support 4096 cpus. > > Signed-off-by: Li, ZhenHua > --- > hw/i386/acpi-build.c | 8 > 1 file changed, 4 insertions

Re: [Qemu-devel] [PATCH] configure: Ensure tests/qemu-iotests exists before writing common.env

2014-05-14 Thread Max Reitz
he tests are still in the original source tree. I'd rather use "$source_path/tests/qemu_iotests/common.env" instead, or, if that is unacceptable as it modifies the original source tree (which is probably not desired when doing an out-of-tree build), write common.env only if this is an in-tree build. Max

Re: [Qemu-devel] [PATCH v2] block/raw-posix: Try both FIEMAP and SEEK_HOLE

2014-05-14 Thread Max Reitz
On 11.05.2014 19:26, Christoph Hellwig wrote: On Tue, May 06, 2014 at 09:00:54PM +0200, Max Reitz wrote: The current version of raw-posix always uses ioctl(FS_IOC_FIEMAP) if FIEMAP is available; lseek with SEEK_HOLE/SEEK_DATA are not even compiled in in this case. However, there may be

Re: [Qemu-devel] [PATCH] iotests: Use configured python

2014-05-14 Thread Max Reitz
On 14.05.2014 14:33, Markus Armbruster wrote: Max Reitz writes: Currently, QEMU's iotests rely on /usr/bin/env to start the correct Python (that is, at least Python 2.4, but not 3). On systems where Python 3 is the default, the user has no clean way of making the iotests use the co

Re: [Qemu-devel] [PATCH v2] qemu-img fails to delete last snapshot

2014-05-14 Thread Max Reitz
all, I am kind of in favor of making the deletion of the last snapshot a special case as this would probably greatly improve readability; but on the other hand, it actually is a good test as it is right now. Max

Re: [Qemu-devel] [PATCH v2] qcow2: Patch for shrinking qcow2 disk image

2014-05-14 Thread Max Reitz
DriverState *bs, uint64_t min_size, +bool exact_size); int qcow2_write_l1_entry(BlockDriverState *bs, int l1_index); void qcow2_l2_cache_reset(BlockDriverState *bs); int qcow2_decompress_cluster(BlockDriverState *bs, uint64_t cluster_offset); The rest of the code looks surprisingly simple, but I looks correct to me. I'd really like a test case for qemu-iotests, though. :-) Max

Re: [Qemu-devel] [PATCH 4/4] Support more than 255 cpus: runtime check

2014-05-15 Thread Max Filippov
On Thu, May 15, 2014 at 11:16 AM, Li, ZhenHua wrote: > Maybe it should be 4 bytes for 4096 (0x1000). I'd say that 2 bytes should be enough, but actually I don't see why anybody would care in that function how many bytes it is. > On 05/13/2014 04:19 PM, Max Filippov wrote: >

Re: [Qemu-devel] [PATCH] iotests: Use configured python

2014-05-15 Thread Max Reitz
On 15.05.2014 08:52, Markus Armbruster wrote: Max Reitz writes: On 14.05.2014 14:33, Markus Armbruster wrote: Max Reitz writes: Currently, QEMU's iotests rely on /usr/bin/env to start the correct Python (that is, at least Python 2.4, but not 3). On systems where Python 3 is the de

Re: [Qemu-devel] [PATCH] iotests: Use configured python

2014-05-15 Thread Max Reitz
On 15.05.2014 19:08, Peter Maydell wrote: On 15 May 2014 17:56, Max Reitz wrote: I think I'll go with Fam's proposal, which is making common.config look for python itself, which then can be overwritten by an environment variable. That sounds wrong to me. We already have a way for t

Re: [Qemu-devel] [PATCH] iotests: Use configured python

2014-05-15 Thread Max Reitz
On 15.05.2014 19:35, Markus Armbruster wrote: Max Reitz writes: On 15.05.2014 08:52, Markus Armbruster wrote: Max Reitz writes: On 14.05.2014 14:33, Markus Armbruster wrote: Max Reitz writes: Currently, QEMU's iotests rely on /usr/bin/env to start the correct Python (that is, at

[Qemu-devel] [PATCH 1/7] iotests: Allow out-of-tree run

2014-05-15 Thread Max Reitz
so, will assume it is run in the build tree. All output and temporary operations performed by iotests are then redirected here and, unless specified otherwise by the user, QEMU_PROG etc. will be set to paths appropriate for the build tree. Signed-off-by: Max Reitz --- tests/qemu-iotests/check

[Qemu-devel] [PATCH 4/7] iotests: Source common.env

2014-05-15 Thread Max Reitz
Source common.env in the iotests' check script. If the one supposed to be created by configure cannot be found, use common.env.default from the source tree. Signed-off-by: Max Reitz --- tests/qemu-iotests/check | 17 + 1 file changed, 17 insertions(+) diff --git a/tests

[Qemu-devel] [PATCH 0/7] iotests: Allow out-of-tree run

2014-05-15 Thread Max Reitz
This series enables qemu-iotests to be run in a build tree outside of the source tree. It also makes the tests use the command for invoking the Python interpreter specified through configure instead of always using "/usr/bin/env python". Max Reitz (7): iotests: Allow out-o

[Qemu-devel] [PATCH 6/7] iotests: Drop Python version from 065's Shebang

2014-05-15 Thread Max Reitz
n an exact match. Signed-off-by: Max Reitz --- tests/qemu-iotests/065 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qemu-iotests/065 b/tests/qemu-iotests/065 index ab5445f..e89b61d 100755 --- a/tests/qemu-iotests/065 +++ b/tests/qemu-iotests/065 @@ -1,4 +1,4 @@ -#!/u

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