Re: [Qemu-devel] [PATCH 2/4] block: Add bdrv_get_node_name

2014-10-29 Thread Max Reitz
to check this, don't we? cscope tells me there are 61 callers of bdrv_get_device_name() and not all of them look like they always query a BDS with a BB. Max +const char *bdrv_get_node_name(const BlockDriverState *bs) +{ +return bs->node_name; +} + const char *bdrv_get_device

Re: [Qemu-devel] [PATCH 3/4] block: Include "node-name" if present in query-blockstats

2014-10-29 Thread Max Reitz
block-core.json | 5 - 2 files changed, 9 insertions(+), 1 deletion(-) Reviewed-by: Max Reitz

Re: [Qemu-devel] [PATCH 4/4] qmp: Add optional switch "query-nodes" in query-blockstats

2014-10-29 Thread Max Reitz
x27;: 'query-blockstats', + 'data': {'*query-nodes': 'bool' }, No space after the opening shwoopy bracket (took that from Wikipedia, I love it), but a space before the closing one. Also, the new parameter should be documented, I think (and the documenta

Re: [Qemu-devel] [PATCH RFC 2/2] block: Warn on insecure format probing

2014-10-30 Thread Max Reitz
more specific, if possible. I don't feel like testing four bytes is enough (although in practice it should be). Also, I like Kevin's proposal/Anthony's approach a lot more because of its principle. If a guest can overwrite the beginning of the image so it looks like an image format, that's the real bug. Afterwards, anyone will recognize that image as non-raw and they'd be correct. Max

[Qemu-devel] [PATCH] tcg: dump op count to the same stream as other info

2014-11-02 Thread Max Filippov
Otherwise 'info jit' outputs half of the information to monitor and the rest to qemu log. Signed-off-by: Max Filippov --- tcg/tcg.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tcg/tcg.c b/tcg/tcg.c index 7a84b87..15d29df 100644 --- a/tcg/tcg.c +++ b

Re: [Qemu-devel] [PATCH] tcg: dump op count to the same stream as other info

2014-11-02 Thread Max Filippov
On Sun, Nov 2, 2014 at 10:53 PM, Richard Henderson wrote: > On 11/02/2014 01:07 AM, Max Filippov wrote: >> Otherwise 'info jit' outputs half of the information to monitor and the >> rest to qemu log. >> >> Signed-off-by: Max Filippov >> --- >

[Qemu-devel] [PATCH] tcg: add separate monitor command to dump opcode counters

2014-11-02 Thread Max Filippov
Currently 'info jit' outputs half of the information to monitor and the rest to qemu log. Dumping opcode counts to monitor as a part of 'info jit' command doesn't sound useful. Add new monitor command 'info opcount' that only dumps opcode counters. Signed-off-

[Qemu-devel] [PULL 0/8] target-xtensa queue 2014-11-03

2014-11-02 Thread Max Filippov
registers and with profiling interrupts; - fix uImage load address for MMUv2 cores; - add script for automatic core import from xtensa configuration overlay. Max Filippov (8): target-xtensa: add definition for

Re: [Qemu-devel] [PATCH] block: changed to proper enum type

2014-11-03 Thread Max Reitz
on the mailing list, and Stefan already merged one of them to his block tree; see: http://lists.nongnu.org/archive/cgi-bin/namazu.cgi?query=BlockErrorAction+IoOperationType&submit=Search!&idxname=qemu-devel&max=20&result=normal&sort=score The patch Stefan merged is here: https

Re: [Qemu-devel] [PATCH RFC 2/2] block: Warn on insecure format probing

2014-11-03 Thread Max Reitz
On 2014-10-30 at 14:02, Markus Armbruster wrote: Max Reitz writes: So I guess it's my turn to give yet another opinion (or just something in between of what has been already said). First, I'm fine with this patch, or at least the idea as there were yet some quirks. Yes, the

Re: [Qemu-devel] [PATCH] virtio-scsi: Fix memory leak when realize failed

2014-11-03 Thread Max Reitz
EUE_MAX); +virtio_cleanup(vdev); return; } s->cmd_vqs = g_malloc0(s->conf.num_queues * sizeof(VirtQueue *)); The alternative would be to simply push virtio_init() below this check, but it's fine either way. Reviewed-by: Max Reitz

Re: [Qemu-devel] [PATCH RFC 2/2] block: Warn on insecure format probing

2014-11-03 Thread Max Reitz
TM) detects to be some image format. You don't think so. That's why you say probing is the real problem, whereas I say allowing the guest to write a fake image header is the real problem (not the least because it may fool other tools as well). So for me, your patch only mitigates the

Re: [Qemu-devel] [PATCH] virtio-scsi: Fix memory leak when realize failed

2014-11-03 Thread Max Reitz
On 2014-11-03 at 10:17, Fam Zheng wrote: On Mon, 11/03 09:53, Max Reitz wrote: On 2014-10-30 at 12:50, Fam Zheng wrote: Signed-off-by: Fam Zheng --- hw/scsi/virtio-scsi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c index a1725b8

Re: [Qemu-devel] [PATCH 0/2] block: JSON filenames and relative backing files

2014-11-03 Thread Max Reitz
On 2014-11-03 at 12:41, Stefan Hajnoczi wrote: On Thu, Oct 23, 2014 at 04:56:13PM +0200, Max Reitz wrote: Sometimes, qemu does not have a filename to work with (it then generates a JSON filename), so it does not know which directory to use for a backing file specified by a relative filename

Re: [Qemu-devel] [PATCH 0/2] block: Propagate error in bdrv_img_create()

2014-11-03 Thread Max Reitz
On 2014-10-29 at 11:42, Stefan Hajnoczi wrote: On Mon, Oct 27, 2014 at 01:30:07PM +0100, Max Reitz wrote: Currently, when trying to create a backed image without specifying its size, when the backing file does not exist or is not accessible, an appropriate error message will be generated which

[Qemu-devel] [PATCH] qemu-img: Omit error_report() after img_open()

2014-11-03 Thread Max Reitz
img_open() already prints an error if the operation failed, so there should not be another error_report() afterwards. Signed-off-by: Max Reitz --- qemu-img.c | 4 1 file changed, 4 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 66a7eb4..a42335c 100644 --- a/qemu-img.c +++ b/qemu

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

2014-08-29 Thread Max Reitz
On 28.08.2014 18:08, Benoît Canet wrote: On Wed, Aug 27, 2014 at 10:18:23PM +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

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

2014-08-29 Thread Max Reitz
On 29.08.2014 21:50, Eric Blake wrote: On 08/27/2014 02:18 PM, 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. Signed-off-by: Max Reitz

Re: [Qemu-devel] What tests should "make check-block" run?

2014-08-29 Thread Max Reitz
but how do I find out about 'check' ? I just had to bounce through the makefile and a wrapper script to even figure out which directory it lives in, and there's no help text or usage comments in it... http://qemu-project.org/Documentation/QemuIoTests I'm afraid this needs updati

[Qemu-devel] [PATCH v5 06/11] qcow2: Fix refcount blocks beyond image end

2014-08-29 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 Reviewed-by: Eric Blake --- block/qcow2-refcount.c | 62

[Qemu-devel] [PATCH v5 03/11] qcow2: Split qcow2_check_refcounts()

2014-08-29 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 v5 01/11] qcow2: Calculate refcount block entry count

2014-08-29 Thread Max Reitz
The size of a refblock entry is (in theory) variable; calculate therefore the number of entries per refblock and the according bit shift (1 << x == entry count) when opening an image. Signed-off-by: Max Reitz --- block/qcow2.c | 2 ++ block/qcow2.h | 2 ++ 2 files changed, 4 insertions(+)

[Qemu-devel] [PATCH v5 02/11] qcow2: Fix leaks in dirty images

2014-08-29 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 v5 00/11] qcow2: Fix image repairing

2014-08-29 Thread Max Reitz
. v5: - Added patch 1 which adds two helper variables to BDRVQcowState reflecting the number of entries per refcount block; in contrast to v4, we don't need to clamp the refcount order against sub-byte widths, because sub-byte widths are actually correct (that means, I dropped th

[Qemu-devel] [PATCH v5 05/11] qcow2: Reuse refcount table in calculate_refcounts()

2014-08-29 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 v5 08/11] qcow2: Rebuild refcount structure during check

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

[Qemu-devel] [PATCH v5 04/11] qcow2: Pull check_refblocks() up

2014-08-29 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 v5 09/11] qcow2: Clean up after refcount rebuild

2014-08-29 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

[Qemu-devel] [PATCH 2/2] docs/qcow2: Correct refcount_block_entries

2014-08-29 Thread Max Reitz
A refblock entry may have a different size than 16 bits, it may even be smaller than a byte. Correct the refcount_block_entries calculation accordingly. Signed-off-by: Max Reitz --- docs/specs/qcow2.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/specs/qcow2.txt b

[Qemu-devel] [PATCH v5 10/11] iotests: Fix test outputs

2014-08-29 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 v5 07/11] qcow2: Do not perform potentially damaging repairs

2014-08-29 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 1/2] qcow2: Drop REFCOUNT_SHIFT

2014-08-29 Thread Max Reitz
With BDRVQcowState.refcount_block_bits, we don't need REFCOUNT_SHIFT anymore. Signed-off-by: Max Reitz --- block/qcow2-refcount.c | 32 ++-- block/qcow2.c | 2 +- block/qcow2.h | 2 -- 3 files changed, 15 insertions(+), 21 deletions(-) diff

[Qemu-devel] [PATCH v5 11/11] iotests: Add test for potentially damaging repairs

2014-08-29 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 0/2] qcow2: Drop REFCOUNT_SHIFT

2014-08-29 Thread Max Reitz
refcount order other than 4. Fix that. This is a follow-up to my "[PATCH v5 00/11] qcow2: Fix image repairing" series and therefore depends on it. Max Reitz (2): qcow2: Drop REFCOUNT_SHIFT docs/qcow2: Correct refcount_block_entries block/qcow2-refco

Re: [Qemu-devel] [PATCH v5 01/11] qcow2: Calculate refcount block entry count

2014-09-02 Thread Max Reitz
On 30.08.2014 01:03, Eric Blake wrote: On 08/29/2014 03:40 PM, Max Reitz wrote: The size of a refblock entry is (in theory) variable; calculate therefore the number of entries per refblock and the according bit shift (1 << x == entry count) when opening an image. Signed-off-by: Max

Re: [Qemu-devel] [PATCH 2/2] docs/qcow2: Correct refcount_block_entries

2014-09-02 Thread Max Reitz
On 30.08.2014 00:37, Eric Blake wrote: On 08/29/2014 03:45 PM, Max Reitz wrote: A refblock entry may have a different size than 16 bits, it may even be smaller than a byte. Correct the refcount_block_entries calculation accordingly. Signed-off-by: Max Reitz --- docs/specs/qcow2.txt | 2

Re: [Qemu-devel] [PATCH v2 1/2] qemu-img: clarify src_cache option documentation

2014-09-02 Thread Max Reitz
ions(+), 3 deletions(-) Reviewed-by: Max Reitz

Re: [Qemu-devel] [PATCH v2 2/2] qemu-img: fix rebase src_cache option documentation

2014-09-02 Thread Max Reitz
rv, &local_err); if (ret) { ... } } The documentation only mentions the new backing file but it really applies to both. Suggested-by: Jeff Nelson Signed-off-by: Stefan Hajnoczi --- qemu-img.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Max Reitz

Re: [Qemu-devel] [PATCH v13 1/6] block: round up file size to nearest sector

2014-09-02 Thread Max Reitz
Reviewed-by: Max Reitz

Re: [Qemu-devel] [PATCH v13 2/6] block: don't convert file size to sector size

2014-09-02 Thread Max Reitz
insertions(+), 20 deletions(-) Reviewed-by: Max Reitz

Re: [Qemu-devel] [PATCH v13 3/6] rename parse_enum_option to qapi_enum_parse and make it public

2014-09-02 Thread Max Reitz
unchanged (except for the author note), so: Reviewed-by: Max Reitz

Re: [Qemu-devel] [PATCH v13 4/6] qapi: introduce PreallocMode and a new PreallocMode full.

2014-09-02 Thread Max Reitz
ilename, QemuOpts *opts, Error **errp) flags |= BLOCK_FLAG_LAZY_REFCOUNTS; } +if (prealloc && prealloc != PREALLOC_MODE_METADATA) { +ret = -1; Since the return value is expected to be -errno, I'd propose "ret = -EINVAL;" here. With that fixed (

Re: [Qemu-devel] [PATCH v13 5/6] raw-posix: Add full preallocation option

2014-09-02 Thread Max Reitz
ix/Linux. +Supported options: +@table @code +@item preallocation +Preallocation mode(allowed values: @code{off}, @code{full}). An image is +fully preallocated by calling posix_fallocate() if it's available, or by +writing zeros to underlying storage. +@end table + Same as for qemu-doc.texi. Howev

Re: [Qemu-devel] [PATCH v13 6/6] qcow2: Add full preallocation option

2014-09-02 Thread Max Reitz
+++--- qemu-doc.texi | 7 +++--- qemu-img.texi | 7 +++--- tests/qemu-iotests/082.out | 54 4 files changed, 87 insertions(+), 42 deletions(-) Reviewed-by: Max Reitz

[Qemu-devel] [PATCH v2 1/3] qcow2: Drop REFCOUNT_SHIFT

2014-09-02 Thread Max Reitz
With BDRVQcowState.refcount_block_bits, we don't need REFCOUNT_SHIFT anymore. Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- block/qcow2-refcount.c | 32 ++-- block/qcow2.c | 2 +- block/qcow2.h | 2 -- 3 files changed, 15 insertions(+

[Qemu-devel] [PATCH v2 3/3] docs/qcow2: Limit refcount_order to [0, 6]

2014-09-02 Thread Max Reitz
it at the largest reasonable value. Suggested-by: Eric Blake Signed-off-by: Max Reitz --- docs/specs/qcow2.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/specs/qcow2.txt b/docs/specs/qcow2.txt index 0a878aa..121dfc8 100644 --- a/docs/specs/qcow2.txt +++ b/docs/specs/qcow2.txt @@ -11

[Qemu-devel] [PATCH v2 0/3] qcow2: Drop REFCOUNT_SHIFT

2014-09-02 Thread Max Reitz
ct refcount_block_entries' 003/3:[down] 'docs/qcow2: Limit refcount_order to [0, 6]' Max Reitz (3): qcow2: Drop REFCOUNT_SHIFT docs/qcow2: Correct refcount_block_entries docs/qcow2: Limit refcount_order to [0, 6] block/qcow2-refcount.c | 32 ++-- blo

[Qemu-devel] [PATCH v2 2/3] docs/qcow2: Correct refcount_block_entries

2014-09-02 Thread Max Reitz
A refblock entry may have a different size than 16 bits, it may even be smaller than a byte. Correct the refcount_block_entries calculation accordingly. Signed-off-by: Max Reitz --- docs/specs/qcow2.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/specs/qcow2.txt b

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

2014-09-04 Thread Max Reitz
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_BDRV_PROTOCOL). However, not every protocol block driver allows growing: NBD, for instance, does n

Re: [Qemu-devel] [PATCH 1/2] vmdk: fix vmdk_parse_extents() extent_file leaks

2014-09-04 Thread Max Reitz
On 04.09.2014 22:04, Stefan Hajnoczi wrote: Signed-off-by: Stefan Hajnoczi --- block/vmdk.c | 2 ++ 1 file changed, 2 insertions(+) Reviewed-by: Max Reitz

Re: [Qemu-devel] [PATCH 2/2] vmdk: fix buf leak in vmdk_parse_extents()

2014-09-04 Thread Max Reitz
On 04.09.2014 22:04, Stefan Hajnoczi wrote: vmdk_open_sparse() does not take ownership of buf so the caller always needs to free it. Signed-off-by: Stefan Hajnoczi --- block/vmdk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Max Reitz

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

2014-09-05 Thread Max Reitz
On 05.09.2014 12:01, Kevin Wolf wrote: Am 04.09.2014 um 22:01 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

[Qemu-devel] [PATCH v2 2/5] qcow2: Add qcow2_signal_corruption()

2014-09-05 Thread Max Reitz
Add a helper function for easily marking an image corrupt (on fatal corruptions) while outputting an informative message to stderr and via QAPI. Signed-off-by: Max Reitz --- block/qcow2.c | 48 block/qcow2.h | 5 + 2 files changed, 53

[Qemu-devel] [PATCH v2 1/5] qapi/block: Add "fatal" to BLOCK_IMAGE_CORRUPTED

2014-09-05 Thread Max Reitz
the image should not be marked corrupt (in accordance to "fatal" set to false). Signed-off-by: Max Reitz --- block/qcow2-refcount.c | 1 + qapi/block-core.json | 9 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/block/qcow2-refcount.c b/block/qcow2-refcou

[Qemu-devel] [PATCH v2 0/5] qcow2: Check L1/L2/reftable entries for alignment

2014-09-05 Thread Max Reitz
corruption() for overlaps' 004/5:[0068] [FC] 'qcow2: Check L1/L2/reftable entries for alignment' 005/5:[down] 'iotests: Add more tests for qcow2 corruption' Max Reitz (5): qapi/block: Add "fatal" to BLOCK_IMAGE_CORRUPTED qcow2: Add qcow2_signal_corruption() qcow2:

[Qemu-devel] [PATCH v2 3/5] qcow2: Use qcow2_signal_corruption() for overlaps

2014-09-05 Thread Max Reitz
Use the new function in case of a failed overlap check. This changes output in case of corruption, so adapt iotest 060's reference output accordingly. Signed-off-by: Max Reitz --- block/qcow2-refcount.c | 24 +++- tests/qemu-iotests/060.out | 10 +- 2

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

2014-09-05 Thread Max Reitz
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 check all offsets taken from these tables for correct cluster alignment. Signed-off-by: Max

[Qemu-devel] [PATCH v2 5/5] iotests: Add more tests for qcow2 corruption

2014-09-05 Thread Max Reitz
Add tests for unaligned L1/L2/reftable entries and non-fatal corruption reports. Signed-off-by: Max Reitz --- tests/qemu-iotests/060 | 56 -- tests/qemu-iotests/060.out | 51 + 2 files changed, 105

Re: [Qemu-devel] [PATCH v2 1/5] qapi/block: Add "fatal" to BLOCK_IMAGE_CORRUPTED

2014-09-05 Thread Max Reitz
On 05.09.2014 16:40, Eric Blake wrote: On 09/05/2014 08:07 AM, Max Reitz wrote: Not every BLOCK_IMAGE_CORRUPTED event must be fatal; for example, when reading from an image, they should generally not be. Nonetheless, even an image only read from may of course be corrupted and this can be

Re: [Qemu-devel] [PATCH v2 1/5] qapi/block: Add "fatal" to BLOCK_IMAGE_CORRUPTED

2014-09-05 Thread Max Reitz
On 05.09.2014 16:51, Eric Blake wrote: On 09/05/2014 08:47 AM, Max Reitz wrote: On 05.09.2014 16:40, Eric Blake wrote: On 09/05/2014 08:07 AM, Max Reitz wrote: Not every BLOCK_IMAGE_CORRUPTED event must be fatal; for example, when reading from an image, they should generally not be

Re: [Qemu-devel] [PATCH v2 1/5] qapi/block: Add "fatal" to BLOCK_IMAGE_CORRUPTED

2014-09-08 Thread Max Reitz
On 08.09.2014 16:01, Benoît Canet wrote: The Friday 05 Sep 2014 à 16:07:15 (+0200), Max Reitz wrote : Not every BLOCK_IMAGE_CORRUPTED event must be fatal; for example, when reading from an image, they should generally not be. Nonetheless, even an image only read from may of course be corrupted

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

2014-09-08 Thread Max Reitz
On 08.09.2014 16:40, Benoît Canet wrote: The Friday 05 Sep 2014 à 16:07:18 (+0200), Max Reitz wrote : 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

Re: [Qemu-devel] qcow2, lazy_refcounts and killing qemu

2014-09-08 Thread Max Reitz
s* it is: commit 91af7014125895cc74141be6b60f3a3e882ed743 Author: Max Reitz Date: Fri Jul 18 20:24:56 2014 +0200 block: Add bdrv_refresh_filename() I didn't believe this either, but I have checked the result manually and I'm pretty sure that whatever this commit does, it does end up fixing the lazy_refc

[Qemu-devel] [PATCH] tcg/README: fix movcond cond argument position

2014-09-09 Thread Max Filippov
movcond has its cond argument first, not last. Fix that in documentation. Signed-off-by: Max Filippov --- tcg/README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcg/README b/tcg/README index a550ff1..69f3456 100644 --- a/tcg/README +++ b/tcg/README @@ -328,7 +328,7

[Qemu-devel] [PATCH v2] tcg/README: fix movcond/brcond cond argument position

2014-09-09 Thread Max Filippov
movcond and brcond have its cond argument first. Fix that in documentation. Signed-off-by: Max Filippov --- Changes v1 -> v2: - fix similar brcond issue tcg/README | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tcg/README b/tcg/README index a550ff1..c538b3b 100

Re: [Qemu-devel] [PATCH] tcg/README: fix movcond cond argument position

2014-09-09 Thread Max Filippov
On Tue, Sep 9, 2014 at 4:12 PM, Richard Henderson wrote: > On 09/09/2014 04:02 PM, Max Filippov wrote: >> movcond has its cond argument first, not last. Fix that in >> documentation. > No. The README is supposed to be documenting the *opcode* argument ordering, > which r

Re: [Qemu-devel] [question] virtio-blk performance degradation happened with virito-serial

2014-09-13 Thread Max Reitz
On 12.09.2014 14:38, Stefan Hajnoczi wrote: Max: Unrelated to this performance issue but I notice that the qcow2 metadata overlap check is high in the host CPU profile. Have you had any thoughts about optimizing the check? Stefan In fact, I have done so (albeit only briefly). Instead of

Re: [Qemu-devel] [PATCH] vmdk: Fix integer overflow in offset calculation

2014-09-13 Thread Max Reitz
le, for testing purposes) and then you can write anywhere (maybe once at the very beginning and once at the very end, if that works). Max

Re: [Qemu-devel] [PATCH 1/4] blockdev: Disentangle BlockDriverState and DriveInfo creation

2014-09-13 Thread Max Reitz
BDRV_O_RDWR; QINCREF(bs_opts); -ret = bdrv_open(&dinfo->bdrv, file, NULL, bs_opts, bdrv_flags, drv, &error); +ret = bdrv_open(&bs, file, NULL, bs_opts, bdrv_flags, drv, &error); +assert(bs == dinfo->bdrv); Well, this is guaranteed by bdrv_open(), but of course better having too many assertions than too few. With or without g_new0: Reviewed-by: Max Reitz

Re: [Qemu-devel] [PATCH 2/4] block: Keep DriveInfo alive until BlockDriverState dies

2014-09-13 Thread Max Reitz
v.h | 1 + stubs/Makefile.objs | 1 + stubs/blockdev.c | 12 5 files changed, 24 insertions(+), 5 deletions(-) create mode 100644 stubs/blockdev.c Seems reasonable. Reviewed-by: Max Reitz

Re: [Qemu-devel] [PATCH v2 01/23] block: Split bdrv_new_root() off bdrv_new()

2014-09-13 Thread Max Reitz
| 2 +- hw/block/xen_disk.c | 2 +- include/block/block.h | 3 ++- qemu-img.c| 6 +++--- qemu-io.c | 2 +- qemu-nbd.c| 2 +- 9 files changed, 30 insertions(+), 19 deletions(-) Reviewed-by: Max Reitz

Re: [Qemu-devel] [PATCH v2 02/23] block: New BlockBackend

2014-09-13 Thread Max Reitz
ut1, out2 and out3, and just always go to out. But of course it's not wrong this way. Reviewed-by: Max Reitz

Re: [Qemu-devel] [PATCH v2 03/23] block: Connect BlockBackend to BlockDriverState

2014-09-13 Thread Max Reitz
Shouldn't that be a blk_new_with_bs() then, just like every other case? srcpath = argv[optind]; ret = bdrv_open(&bs, srcpath, NULL, NULL, flags, drv, &local_err); Max

Re: [Qemu-devel] [PATCH] target-xtensa: mark XtensaConfig structs as unused

2014-09-14 Thread Max Filippov
+- > 3 files changed, 3 insertions(+), 3 deletions(-) Acked-by: Max Filippov -- Thanks. -- Max

Re: [Qemu-devel] [PATCH] gdbstub: Allow target CPUs to specify watchpoint STOP_BEFORE_ACCESS flag

2014-09-15 Thread Max Filippov
give correct watchpoint behaviour with a gdb attached to > our debug stub. I haven't tested the other targets beyond > compile testing, but I have checked the gdb sources to get > the list of which targets needed changes. -- Thanks. -- Max

Re: [Qemu-devel] [PATCH 07/23] target-xtensa: Use cpu_exec_interrupt qom hook

2014-09-15 Thread Max Filippov
On Sat, Sep 13, 2014 at 9:45 AM, Richard Henderson wrote: > Cc: Max Filippov > Signed-off-by: Richard Henderson > --- > cpu-exec.c | 6 -- > target-xtensa/cpu-qom.h | 1 + > target-xtensa/cpu.c | 1 + > target-xtensa/helper.c | 10 ++ &

Re: [Qemu-devel] [PATCH 06/23] qom: Add cpu_exec_interrupt hook

2014-09-15 Thread Max Filippov
+ > 3 files changed, 17 insertions(+), 5 deletions(-) Reviewed-by: Max Filippov -- Thanks. -- Max

Re: [Qemu-devel] [PATCH] gdbstub: Allow target CPUs to specify watchpoint STOP_BEFORE_ACCESS flag

2014-09-15 Thread Max Filippov
On Mon, Sep 15, 2014 at 9:15 PM, Peter Maydell wrote: > On 15 September 2014 20:59, Max Filippov wrote: >> I've tested xtensa part and have noticed no difference with or without >> this patch: >> gdb connected to qemu gdbstub always stops right after the watched >&

[Qemu-devel] [PATCH 3/6] blkverify: Implement bdrv_refresh_filename()

2014-07-18 Thread Max Reitz
Signed-off-by: Max Reitz --- block/blkverify.c | 29 + 1 file changed, 29 insertions(+) diff --git a/block/blkverify.c b/block/blkverify.c index 621b785..7c78ca4 100644 --- a/block/blkverify.c +++ b/block/blkverify.c @@ -10,6 +10,8 @@ #include #include "

[Qemu-devel] [PATCH 1/6] block: Add bdrv_refresh_filename()

2014-07-18 Thread Max Reitz
ions. For most block drivers, this process can be done automatically; those that need special handling may define a .bdrv_refresh_filename() method to fill BDS.exact_filename and BDS.full_open_options themselves. Signed-off-by: Max Reitz --- In this version, bdrv_refresh_filename() leaves th

[Qemu-devel] [PATCH 2/6] blkdebug: Implement bdrv_refresh_filename()

2014-07-18 Thread Max Reitz
Because blkdebug cannot simply create a configuration file, simply refuse to reconstruct a plain filename and only generate an options QDict from the rules instead. Signed-off-by: Max Reitz --- Instead of this rather complicated implementation, we could decide to just drop it and let this be

[Qemu-devel] [PATCH 0/6] block: Let drivers reconstruct the filename

2014-07-18 Thread Max Reitz
x unset "filename" for certain drivers'. Max Reitz (6): block: Add bdrv_refresh_filename() blkdebug: Implement bdrv_refresh_filename() blkverify: Implement bdrv_refresh_filename() nbd: Implement bdrv_refresh_filename() quorum: Implement bdrv_refresh_filename() iote

[Qemu-devel] [PATCH 5/6] quorum: Implement bdrv_refresh_filename()

2014-07-18 Thread Max Reitz
Signed-off-by: Max Reitz --- block/quorum.c | 39 +++ 1 file changed, 39 insertions(+) diff --git a/block/quorum.c b/block/quorum.c index d5ee9c0..0de07bb 100644 --- a/block/quorum.c +++ b/block/quorum.c @@ -16,7 +16,12 @@ #include #include #include

[Qemu-devel] [PATCH 4/6] nbd: Implement bdrv_refresh_filename()

2014-07-18 Thread Max Reitz
Signed-off-by: Max Reitz --- block/nbd.c | 36 1 file changed, 36 insertions(+) diff --git a/block/nbd.c b/block/nbd.c index 4eda095..89775e1 100644 --- a/block/nbd.c +++ b/block/nbd.c @@ -31,8 +31,10 @@ #include "block/block_int.h" #include &quo

[Qemu-devel] [PATCH 6/6] iotests: Add test for image filename construction

2014-07-18 Thread Max Reitz
Testing a real in-use protocol such as NBD is hard; testing blkdebug and blkverify in its stead is easier and tests basically the same functionality. Signed-off-by: Max Reitz --- tests/qemu-iotests/099 | 116 + tests/qemu-iotests/099.out | 20

Re: [Qemu-devel] [PATCH 1/4] block: allow bdrv_unref() to be passed NULL pointers

2014-07-19 Thread Max Reitz
insertions(+) Reviewed-by: Max Reitz

Re: [Qemu-devel] [PATCH 2/4] block: vdi - use block layer ops in vdi_create, instead of posix calls

2014-07-19 Thread Max Reitz
*is* your file, so this should be just bs and not bs->file (like this, "qemu-img create -f vdi -o static=on foo.vdi 128K" segfaults). Other than that, the patch looks good. Max

Re: [Qemu-devel] [PATCH 3/4] block: use the standard 'ret' instead of 'result'

2014-07-19 Thread Max Reitz
ff-by: Jeff Cody --- block/vdi.c | 36 ++-- 1 file changed, 18 insertions(+), 18 deletions(-) Reviewed-by: Max Reitz (still applies if you have to change the penultimate hunk due to s/bs->file/bs/ in patch 2)

Re: [Qemu-devel] [PATCH 4/4] block: vpc - use block layer ops in vpc_create, instead of posix calls

2014-07-19 Thread Max Reitz
format driver. Signed-off-by: Jeff Cody --- block/vpc.c | 99 +++-- 1 file changed, 43 insertions(+), 56 deletions(-) Reviewed-by: Max Reitz

[Qemu-devel] [PATCH 2/2] qemu-img: Allow cache mode specification for amend

2014-07-19 Thread Max Reitz
: Max Reitz --- qemu-img-cmds.hx | 4 ++-- qemu-img.c | 19 +++ qemu-img.texi| 2 +- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/qemu-img-cmds.hx b/qemu-img-cmds.hx index 5613628..20a21ff 100644 --- a/qemu-img-cmds.hx +++ b/qemu-img-cmds.hx @@ -70,8

[Qemu-devel] [PATCH 1/2] qemu-img: Allow source cache mode specification

2014-07-19 Thread Max Reitz
in case of rebase). Signed-off-by: Max Reitz --- qemu-img-cmds.hx | 16 ++-- qemu-img.c | 78 qemu-img.texi| 14 +++--- 3 files changed, 80 insertions(+), 28 deletions(-) diff --git a/qemu-img-cmds.hx b/qemu-img

[Qemu-devel] [PATCH 0/2] qemu-img: Allow source cache mode specification

2014-07-19 Thread Max Reitz
consequence of this series), we may want to make it just another cache mode which can be selected by the user. Max Reitz (2): qemu-img: Allow source cache mode specification qemu-img: Allow cache mode specification for amend qemu-img-cmds.hx | 20 ++-- qemu-img.c | 97

Re: [Qemu-devel] [PATCH 1/2] qemu-img: Allow source cache mode specification

2014-07-22 Thread Max Reitz
On 21.07.2014 17:52, Eric Blake wrote: On 07/19/2014 02:35 PM, Max Reitz wrote: Many qemu-img subcommands only read the source file(s) once. For these use cases, a full write-back cache is unnecessary and mainly clutters host cache memory. Though this is generally no concern as cache memory is

Re: [Qemu-devel] [PATCH 2/2] qemu-img: Allow cache mode specification for amend

2014-07-22 Thread Max Reitz
On 21.07.2014 17:57, Eric Blake wrote: On 07/19/2014 02:35 PM, Max Reitz wrote: qemu-img amend may extensively modify the target image, depending on the options to be amended (e.g. conversion to qcow2 compat level 0.10 from 1.1 for an image with many unallocated zero clusters). Therefore it

Re: [Qemu-devel] [PATCH v2 2/5] block: vdi - use block layer ops in vdi_create, instead of posix calls

2014-07-22 Thread Max Reitz
- 1 file changed, 29 insertions(+), 39 deletions(-) diff --git a/block/vdi.c b/block/vdi.c index 197bd77..5fd9d5f 100644 --- a/block/vdi.c +++ b/block/vdi.c @@ -681,7 +681,6 @@ static int vdi_co_write(BlockDriverState *bs, Anyway: Reviewed-by: Max Reitz

Re: [Qemu-devel] [PATCH v2 2/5] block: vdi - use block layer ops in vdi_create, instead of posix calls

2014-07-22 Thread Max Reitz
On 22.07.2014 22:19, Jeff Cody wrote: On Tue, Jul 22, 2014 at 10:14:58PM +0200, Max Reitz wrote: On 21.07.2014 21:52, Jeff Cody wrote: Use the block layer to create, and write to, the image file in the VDI .bdrv_create() operation. This has a couple of benefits: Images can now be created over

Re: [Qemu-devel] [PATCH v2 5/5] block: iotest - update 084 to test static VDI image creation

2014-07-22 Thread Max Reitz
ze in bytes: %s" "${TEST_IMG}" +_cleanup_test_img + +echo echo "=== Testing image size bounds ===" echo -_make_test_img 64M +_make_test_img $size +_img_info +stat -c"disk image file size in bytes: %s" "${TEST_IMG}" # check for image size too large

[Qemu-devel] [PATCH v2 2/2] qemu-img: Allow cache mode specification for amend

2014-07-22 Thread Max Reitz
: Max Reitz Reviewed-by: Eric Blake --- qemu-img-cmds.hx | 4 ++-- qemu-img.c | 19 +++ qemu-img.texi| 2 +- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/qemu-img-cmds.hx b/qemu-img-cmds.hx index 48df0b8..55aec6b 100644 --- a/qemu-img-cmds.hx +++ b/qemu

[Qemu-devel] [PATCH v2 0/2] qemu-img: Allow source cache mode specification

2014-07-22 Thread Max Reitz
[Eric (implicitly)] - Patch 2: - Reorder img_amend()'s optstring [Eric] Max Reitz (2): qemu-img: Allow source cache mode specification qemu-img: Allow cache mode specification for amend qemu-img-cmds.hx | 20 ++-- qemu-img.c

[Qemu-devel] [PATCH v2 1/2] qemu-img: Allow source cache mode specification

2014-07-22 Thread Max Reitz
in case of rebase). Signed-off-by: Max Reitz --- qemu-img-cmds.hx | 16 ++-- qemu-img.c | 78 qemu-img.texi| 14 +++--- 3 files changed, 80 insertions(+), 28 deletions(-) diff --git a/qemu-img-cmds.hx b/qemu-img

<    5   6   7   8   9   10   11   12   13   14   >