[Qemu-devel] [PATCH 5/7] iotests: Use $PYTHON for Python scripts

2014-05-15 Thread Max Reitz
Instead of invoking Python scripts directly via ./, use $PYTHON to obtain the correct Python interpreter command. Signed-off-by: Max Reitz --- tests/qemu-iotests/031 | 8 tests/qemu-iotests/036 | 6 +++--- tests/qemu-iotests/039 | 18 +- tests/qemu-iotests/054

[Qemu-devel] [PATCH 2/7] configure: Enable out-of-tree iotests

2014-05-15 Thread Max Reitz
In order to allow out-of-tree iotests, create a symlink for the check script in the build tree. While doing so, also write configured options relevant to the iotests to common.env in the build tree; currently, this is the command to invoke Python 2. Signed-off-by: Max Reitz --- configure | 12

[Qemu-devel] [PATCH 3/7] iotests: Add default common.env

2014-05-15 Thread Max Reitz
Add a default common.env in case the one supposed to be emitted by configure cannot be found. Signed-off-by: Max Reitz --- tests/qemu-iotests/common.env.default | 6 ++ 1 file changed, 6 insertions(+) create mode 100644 tests/qemu-iotests/common.env.default diff --git a/tests/qemu-iotests

[Qemu-devel] [PATCH 7/7] iotests: Fix 083 for out-of-tree builds

2014-05-15 Thread Max Reitz
re "nbd\.c". While working on this, also fix the regexes: '.' should be escaped and a single backslash is not enough for escaping when enclosed by double quotes. Signed-off-by: Max Reitz --- tests/qemu-iotests/083 | 8 1 file changed, 4 insertions(+), 4 deletions(-) d

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

2014-05-16 Thread Max Reitz
On 16.05.2014 00:52, Eric Blake wrote: On 05/15/2014 04:26 PM, Max Reitz wrote: As out-of-tree builds are preferred for qemu, running the qemu-iotests in that out-of-tree build should be supported as well. To do so, a symbolic link has to be created pointing to the check script in the source

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

2014-05-16 Thread Max Reitz
On 16.05.2014 09:40, Fam Zheng wrote: On Fri, 05/16 00:26, Max Reitz wrote: 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. If configure is supposed to create common.env, but we

Re: [Qemu-devel] [PATCH 5/7] iotests: Use $PYTHON for Python scripts

2014-05-16 Thread Max Reitz
On 16.05.2014 09:54, Fam Zheng wrote: On Fri, 05/16 00:26, Max Reitz wrote: diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check index bd66630..9968db9 100755 --- a/tests/qemu-iotests/check +++ b/tests/qemu-iotests/check @@ -287,10 +287,17 @@ do start=`_wallclock

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

2014-05-16 Thread Max Reitz
On 16.05.2014 17:09, Eric Blake wrote: On 05/16/2014 08:43 AM, Max Reitz wrote: +source_iotests="$(cd "$(dirname "$(readlink "$0")")"; pwd)" This is potentially dangerous. If readlink or dirname fails, you can invoke cd "" (which on bash

[Qemu-devel] [PATCH] target-xtensa: fix cross-page jumps/calls at the end of TB

2014-05-20 Thread Max Filippov
Move cross-page jump check to gen_jump_slot and use tb->pc instead of dc->pc to check for cross-page jumps. When TB ends at the page boundary dc->pc points to the next page allowing chaining to TBs in it. Cc: qemu-sta...@nongnu.org Signed-off-by: Max Filippov --- target-xtensa/transl

Re: [Qemu-devel] [PATCH] target-xtensa: fix cross-page jumps/calls at the end of TB

2014-05-20 Thread Max Filippov
On Tue, May 20, 2014 at 3:17 PM, Max Filippov wrote: > Move cross-page jump check to gen_jump_slot and use tb->pc instead of > dc->pc to check for cross-page jumps. > When TB ends at the page boundary dc->pc points to the next page > allowing chaining to TBs in it. > >

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

2014-05-20 Thread Max Reitz
'iotests: Add default common.env' 004/7:[0003] [FC] 'iotests: Source common.env' 005/7:[0001] [FC] 'iotests: Use $PYTHON for Python scripts' 006/7:[] [--] 'iotests: Drop Python version from 065's Shebang' 007/7:[] [--] 'iotests: Fix 083 fo

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

2014-05-20 Thread Max Reitz
yet, as this would modify the source tree which is not desired for out-of-tree runs and should be fixed in the repository anyway. Signed-off-by: Max Reitz --- tests/qemu-iotests/check | 95 +--- tests/qemu-iotests/common| 8 ++-- tests/qemu

[Qemu-devel] [PATCH v2 7/7] iotests: Fix 083 for out-of-tree builds

2014-05-20 Thread Max Reitz
re "nbd\.c". While working on this, also fix the regexes: '.' should be escaped and a single backslash is not enough for escaping when enclosed by double quotes. Signed-off-by: Max Reitz --- tests/qemu-iotests/083 | 8 1 file changed, 4 insertions(+), 4 deletions(-) d

[Qemu-devel] [PATCH v2 2/7] configure: Enable out-of-tree iotests

2014-05-20 Thread Max Reitz
In order to allow out-of-tree iotests, create a symlink for the check script in the build tree. While doing so, also write configured options relevant to the iotests to common.env in the build tree; currently, this is the command to invoke Python 2. Signed-off-by: Max Reitz --- configure | 12

[Qemu-devel] [PATCH v2 5/7] iotests: Use $PYTHON for Python scripts

2014-05-20 Thread Max Reitz
Instead of invoking Python scripts directly via ./, use $PYTHON to obtain the correct Python interpreter command. Signed-off-by: Max Reitz --- tests/qemu-iotests/031 | 8 tests/qemu-iotests/036 | 6 +++--- tests/qemu-iotests/039 | 18 +- tests/qemu-iotests/054

[Qemu-devel] [PATCH v2 3/7] iotests: Add default common.env

2014-05-20 Thread Max Reitz
Add a default common.env in case the one supposed to be emitted by configure cannot be found. Signed-off-by: Max Reitz --- tests/qemu-iotests/common.env.default | 6 ++ 1 file changed, 6 insertions(+) create mode 100644 tests/qemu-iotests/common.env.default diff --git a/tests/qemu-iotests

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

2014-05-20 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 | 16 1 file changed, 16 insertions(+) diff --git a/tests

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

2014-05-20 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

[Qemu-devel] [PATCH] iotests: Use _img_info in test 089

2014-05-20 Thread Max Reitz
. Signed-off-by: Max Reitz Reported-by: Kevin Wolf --- This is a follow-up patch for: [PATCH v3 4/4] iotests: Add test for the JSON protocol --- tests/qemu-iotests/089 | 3 +-- tests/qemu-iotests/089.out | 4 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/tests/qemu

[Qemu-devel] [PATCH 0/3] target-xtensa: fix cross-page jumps/calls at the end of TB

2014-05-20 Thread Max Filippov
Hi, this series fixes cross-page TB linking bug in target-xtensa that managed to survive for a major release period. With this bug fixed it is finally possible to build linux kernel under xtensa linux running in system mode QEMU (but it may take a couple of days to complete). Max Filippov (3

[Qemu-devel] [PATCH 2/3] target-xtensa: completely clean TLB between MMU tests

2014-05-20 Thread Max Filippov
Signed-off-by: Max Filippov --- tests/tcg/xtensa/test_mmu.S | 26 +++--- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/tests/tcg/xtensa/test_mmu.S b/tests/tcg/xtensa/test_mmu.S index 099031f..37174b9 100644 --- a/tests/tcg/xtensa/test_mmu.S +++ b/tests/tcg

[Qemu-devel] [PATCH 1/3] target-xtensa: fix cross-page jumps/calls at the end of TB

2014-05-20 Thread Max Filippov
Use tb->pc instead of dc->pc to check for cross-page jumps. When TB translation stops at the page boundary dc->pc points to the next page allowing chaining to TBs in it, which is wrong. Cc: qemu-sta...@nongnu.org Signed-off-by: Max Filippov --- target-xtensa/translate.c | 4 ++-- 1 fil

[Qemu-devel] [PATCH 3/3] target-xtensa: add tests for cross-page TB

2014-05-20 Thread Max Filippov
Signed-off-by: Max Filippov --- tests/tcg/xtensa/test_mmu.S | 220 1 file changed, 220 insertions(+) diff --git a/tests/tcg/xtensa/test_mmu.S b/tests/tcg/xtensa/test_mmu.S index 37174b9..58c5bca 100644 --- a/tests/tcg/xtensa/test_mmu.S +++ b/tests

[Qemu-devel] [Bug 1321464] Re: qemu/block/qcow2.c:1942: possible performance problem ?

2014-05-20 Thread Max Reitz
I can only speak for qcow2 and qcow, but for those places, I don't think it is worth fixing. First of all, both are image formats, so the bottleneck is generally the disk on which the images are stored and not main memory, so an overeager memset should not cause any problems. For both, the relevan

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

2014-05-22 Thread Max Reitz
On 22.05.2014 08:45, Fam Zheng wrote: On Tue, 05/20 22:23, Max Reitz wrote: As out-of-tree builds are preferred for qemu, running the qemu-iotests in that out-of-tree build should be supported as well. To do so, a symbolic link has to be created pointing to the check script in the source

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

2014-05-22 Thread Max Reitz
ut-of-tree iotests' 003/7:[] [--] 'iotests: Add default common.env' 004/7:[] [-C] 'iotests: Source common.env' 005/7:[] [-C] 'iotests: Use $PYTHON for Python scripts' 006/7:[] [--] 'iotests: Drop Python version from 065's Shebang' 007/7:[-

[Qemu-devel] [PATCH v3 2/7] configure: Enable out-of-tree iotests

2014-05-22 Thread Max Reitz
In order to allow out-of-tree iotests, create a symlink for the check script in the build tree. While doing so, also write configured options relevant to the iotests to common.env in the build tree; currently, this is the command to invoke Python 2. Signed-off-by: Max Reitz --- configure | 12

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

2014-05-22 Thread Max Reitz
yet, as this would modify the source tree which is not desired for out-of-tree runs and should be fixed in the repository anyway. Signed-off-by: Max Reitz --- tests/qemu-iotests/check | 98 ++-- tests/qemu-iotests/common| 8 ++-- tests/qemu

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

2014-05-22 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

[Qemu-devel] [PATCH v3 3/7] iotests: Add default common.env

2014-05-22 Thread Max Reitz
Add a default common.env in case the one supposed to be emitted by configure cannot be found. Signed-off-by: Max Reitz --- tests/qemu-iotests/common.env.default | 6 ++ 1 file changed, 6 insertions(+) create mode 100644 tests/qemu-iotests/common.env.default diff --git a/tests/qemu-iotests

[Qemu-devel] [PATCH v3 7/7] iotests: Fix 083 for out-of-tree builds

2014-05-22 Thread Max Reitz
re "nbd\.c". While working on this, also fix the regexes: '.' should be escaped and a single backslash is not enough for escaping when enclosed by double quotes. Signed-off-by: Max Reitz --- tests/qemu-iotests/083 | 8 1 file changed, 4 insertions(+), 4 deletions(-) d

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

2014-05-22 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 | 16 1 file changed, 16 insertions(+) diff --git a/tests

[Qemu-devel] [PATCH v3 5/7] iotests: Use $PYTHON for Python scripts

2014-05-22 Thread Max Reitz
Instead of invoking Python scripts directly via ./, use $PYTHON to obtain the correct Python interpreter command. Signed-off-by: Max Reitz --- tests/qemu-iotests/031 | 8 tests/qemu-iotests/036 | 6 +++--- tests/qemu-iotests/039 | 18 +- tests/qemu-iotests/054

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

2014-05-22 Thread Max Reitz
On 22.05.2014 23:30, Max Reitz wrote: 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". v3:

Re: [Qemu-devel] [PATCH v3 2/7] configure: Enable out-of-tree iotests

2014-05-24 Thread Max Reitz
On 23.05.2014 05:47, Fam Zheng wrote: On Thu, 05/22 23:30, Max Reitz wrote: In order to allow out-of-tree iotests, create a symlink for the check script in the build tree. While doing so, also write configured options relevant to the iotests to common.env in the build tree; currently, this is

Re: [Qemu-devel] [PATCH v3 5/7] iotests: Use $PYTHON for Python scripts

2014-05-24 Thread Max Reitz
On 23.05.2014 05:58, Fam Zheng wrote: On Thu, 05/22 23:30, Max Reitz wrote: Instead of invoking Python scripts directly via ./, use $PYTHON to obtain the correct Python interpreter command. Signed-off-by: Max Reitz --- tests/qemu-iotests/031 | 8 tests/qemu-iotests/036 | 6

Re: [Qemu-devel] [PATCH v3 3/7] iotests: Add default common.env

2014-05-24 Thread Max Reitz
On 23.05.2014 15:33, Markus Armbruster wrote: Eric Blake writes: On 05/23/2014 12:10 AM, Fam Zheng wrote: On Thu, 05/22 23:30, Max Reitz wrote: Add a default common.env in case the one supposed to be emitted by configure cannot be found. Signed-off-by: Max Reitz Now we can run both from

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

2014-05-24 Thread Max Reitz
On 23.05.2014 06:01, Fam Zheng wrote: On Thu, 05/22 23:30, Max Reitz wrote: 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

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

2014-05-24 Thread Max Reitz
#x27;iotests: Use $PYTHON for Python scripts' 005/6:[] [--] 'iotests: Drop Python version from 065's Shebang' 006/6:[] [--] 'iotests: Fix 083 for out-of-tree builds' Max Reitz (6): iotests: Allow out-of-tree run configure: Enable out-of-tree iot

[Qemu-devel] [PATCH v4 4/6] iotests: Use $PYTHON for Python scripts

2014-05-24 Thread Max Reitz
Instead of invoking Python scripts directly via ./, use $PYTHON to obtain the correct Python interpreter command. Signed-off-by: Max Reitz Reviewed-by: Fam Zheng --- tests/qemu-iotests/031 | 8 tests/qemu-iotests/036 | 6 +++--- tests/qemu-iotests/039 | 18

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

2014-05-24 Thread Max Reitz
yet, as this would modify the source tree which is not desired for out-of-tree runs and should be fixed in the repository anyway. Signed-off-by: Max Reitz --- tests/qemu-iotests/check | 98 ++-- tests/qemu-iotests/common| 11 ++--- tests/qemu

[Qemu-devel] [PATCH v4 3/6] iotests: Source common.env

2014-05-24 Thread Max Reitz
Source common.env in the iotests' check script. Signed-off-by: Max Reitz --- tests/qemu-iotests/check | 6 ++ 1 file changed, 6 insertions(+) diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check index 69f328b..992b91e 100755 --- a/tests/qemu-iotests/check +++ b/tests

Re: [Qemu-devel] [PATCH v4 0/6] iotests: Allow out-of-tree run

2014-05-24 Thread Max Reitz
On 24.05.2014 23:24, Max Reitz wrote: 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". v4:

[Qemu-devel] [PATCH v4 2/6] configure: Enable out-of-tree iotests

2014-05-24 Thread Max Reitz
In order to allow out-of-tree iotests, create a symlink for the check script in the build tree. While doing so, also write configured options relevant to the iotests to common.env in the build tree; currently, this is the command to invoke Python 2. Signed-off-by: Max Reitz --- configure | 12

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

2014-05-24 Thread Max Reitz
n an exact match. Signed-off-by: Max Reitz Reviewed-by: Fam Zheng --- 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 @@

[Qemu-devel] [PATCH v4 6/6] iotests: Fix 083 for out-of-tree builds

2014-05-24 Thread Max Reitz
re "nbd\.c". While working on this, also fix the regexes: '.' should be escaped and a single backslash is not enough for escaping when enclosed by double quotes. Signed-off-by: Max Reitz --- tests/qemu-iotests/083 | 8 1 file changed, 4 insertions(+), 4 deletions(-) d

[Qemu-devel] [PATCH v1.5] nbd: Fix filename generation

2014-10-08 Thread Max Reitz
. Just use BlockDriverState::options instead. Reported-by: Stefan Hajnoczi Signed-off-by: Max Reitz Reviewed-by: Paolo Bonzini --- This is exactly the same patch as patch 1 from my series "[PATCH 0/3] block: Fix filename generation for blkdebug and nbd", except I added Paolo's R-b. The reaso

Re: [Qemu-devel] [PATCH v5 00/11] qcow2: Fix image repairing

2014-10-08 Thread Max Reitz
On 29.08.2014 23:40, Max Reitz wrote: As can be seen in the final patch of this series, there are certain cases where the current repair implementation of qcow2 actually damages the image further because it allocates new clusters for the refcount structure which overlap with existing but

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

2014-10-08 Thread Max Reitz
On 26.08.2014 23:36, Max Reitz wrote: qemu-img should use QMP commands whenever possible in order to ensure feature completeness of both online and offline image operations. For the "commit" command, this is relatively easy, so implement it first (in the hope that indeed others will fo

Re: [Qemu-devel] [PATCH 0/3] block: Fix is_allocated() for truncated images

2014-10-08 Thread Max Reitz
On 16.08.2014 20:54, Max Reitz wrote: Patch 2: The bdrv_is_allocated() functions may return a number of zero sectors e.g. if a sector beyond the image end has been queried. Respect this case in qemu-io's map implementation so it doesn't run into an infinite loop (https://bugs.launchpa

Re: [Qemu-devel] [PATCH v2 0/2] raw-posix: Fix raw_co_get_block_status()

2014-10-08 Thread Max Reitz
On 22.09.2014 17:36, Max Reitz wrote: raw_co_get_block_status() should return 0 and set *pnum to 0 after the EOF; currently it does this merely by accident, so implement it directly. Also, nb_sectors should be clamped against the image end. While doing that, centralize the generation of

Re: [Qemu-devel] [PATCH v3 0/7] block/qcow2: Improve zero cluster expansion

2014-10-08 Thread Max Reitz
On 15.08.2014 17:47, Max Reitz wrote: The main purpose of this series is to add a progress report to qemu-img amend. This is achieved by adding a callback function to bdrv_amend_options() - the reasons for this choice are explained in patch 1. While adapting qcow2's expand_zero_clusters_

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

2014-10-10 Thread Max Filippov
On Fri, Oct 10, 2014 at 8:24 PM, Peter Maydell wrote: > On 14 September 2014 21:29, Max Filippov wrote: >> On Sun, Sep 14, 2014 at 12:36 PM, Peter Maydell >> wrote: >>> The XtensaConfig structs will be defined but not used if they are >>> for the opposite e

Re: [Qemu-devel] [PATCH v2 0/2] raw-posix: Fix raw_co_get_block_status()

2014-10-11 Thread Max Reitz
Am 09.10.2014 um 20:58 schrieb Benoît Canet: On Wed, Oct 08, 2014 at 09:43:19PM +0200, Max Reitz wrote: On 22.09.2014 17:36, Max Reitz wrote: raw_co_get_block_status() should return 0 and set *pnum to 0 after the EOF; currently it does this merely by accident, so implement it directly. Also

Re: [Qemu-devel] [PATCH 1/3] block: Ignore allocation size in underlying file

2014-10-11 Thread Max Reitz
Am 10.10.2014 um 13:50 schrieb Benoît Canet: The Saturday 16 Aug 2014 à 20:54:16 (+0200), Max Reitz wrote : When falling through to the underlying file in bdrv_co_get_block_status(), do not let the number of sectors for which information could be obtained be overwritten. Signed-off-by: Max

Re: [Qemu-devel] [PATCH 2/3] qemu-io: Respect early image end for map

2014-10-11 Thread Max Reitz
t missed, it's just printed one iteration later. Max Best regards Benoît } retstr = ret ? "allocated" : "not allocated"; -- 2.0.4

Re: [Qemu-devel] [PATCH v5 08/11] qcow2: Rebuild refcount structure during check

2014-10-11 Thread Max Reitz
Am 09.10.2014 um 01:09 schrieb Eric Blake: On 08/29/2014 03:41 PM, 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 completely new refcount

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

2014-10-11 Thread Max Reitz
Am 10.10.2014 um 14:29 schrieb Benoît Canet: On Fri, Aug 29, 2014 at 11:40:53PM +0200, 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.

Re: [Qemu-devel] [PATCH v5 08/11] qcow2: Rebuild refcount structure during check

2014-10-11 Thread Max Reitz
_SHIFT series". ;-) Once again, thank you for your reviews! Max +if (!*refcount_table) { +return -ENOMEM; +} + +memset(*refcount_table + old_nb_clusters, 0, + (*nb_clusters - old_nb_clusters) * sizeof(uint16_t)); +} + +/* Go back to the

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

2014-10-11 Thread Max Reitz
Am 10.10.2014 um 14:32 schrieb Eric Blake: On 08/26/2014 03:36 PM, Max Reitz wrote: 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 v12 14/14] iotests: Add test for qcow2's bdrv_make_empty

2014-10-11 Thread Max Reitz
Am 10.10.2014 um 18:47 schrieb Eric Blake: On 08/26/2014 03:36 PM, Max Reitz wrote: Add a test for qcow2's fast bdrv_make_empty implementation on images without internal snapshots. This test may need to be limited to compat=1.1 files. Will do. Signed-off-by: Max Reitz --- tests

Re: [Qemu-devel] [PATCH v5 08/11] qcow2: Rebuild refcount structure during check

2014-10-12 Thread Max Reitz
these look odd. Maybe refcount_block_offset, refcount_block_* and refcount_table_offset would be better. I would use longer names if there was no line length limit. ;-) I'll try and see how it looks. Max

Re: [Qemu-devel] [PATCH] qcow2: fix leak of Qcow2DiscardRegion in update_refcount_discard

2014-10-12 Thread Max Reitz
fcount.c | 1 + 1 file changed, 1 insertion(+) Reviewed-by: Max Reitz

Re: [Qemu-devel] [question] is it possible that big-endian l1 table offset referenced by other I/O while updating l1 table offset in qcow2_update_snapshot_refcount?

2014-10-12 Thread Max Reitz
, so I can't really imagine how introducing another local buffer should mitigate the problem, if there is any. Max

Re: [Qemu-devel] [question] is it possible that big-endian l1 tableoffset referenced by other I/O while updating l1 table offset in qcow2_update_snapshot_refcount?

2014-10-12 Thread Max Reitz
, if the condition not true, l1_table = s->l1_table. Oh, yes, you're right. Okay, so in theory nothing should happen anyway, because qcow2 does not have to be reentrant (so s->l1_table will not be accessed while it's big endian and therefore possibly not in CPU order). But I find it rather ugly to convert the cached L1 table to big endian, so I'd be fine with the patch you proposed. Max

Re: [Qemu-devel] [question] is it possible that big-endian l1 tableoffsetreferenced by other I/O while updating l1 table offset in qcow2_update_snapshot_refcount?

2014-10-13 Thread Max Reitz
ly not in CPU order). Could you detail how qcow2 does not have to be reentrant? In below stack, qcow2_update_snapshot_refcount |- cpu_to_be64s(&l1_table[i]) |- bdrv_pwrite_sync This is executed on bs->file, not the qcow2 BDS. Max |-- bdrv_pwrite |--- bdrv_pwritev | bdrv_prwv_co |- aio_poll(aio

Re: [Qemu-devel] [question] is it possible that big-endian l1 tableoffsetreferencedby other I/O while updating l1 table offset in qcow2_update_snapshot_refcount?

2014-10-13 Thread Max Reitz
ut aio_poll(aio_context) will poll all BDS's aio, not only that of bs->file, doesn't it? Is it possible that there are pending aio which belong to this qcow2 BDS still exist? qcow2 is generally not reentrant, this is secured by locking (BDRVQcowState.lock). As long as one re

Re: [Qemu-devel] Counting barrier instructions in ARM

2014-10-15 Thread Max Filippov
/* These execute as NOPs. */ > break; > default: > @@ -11022,6 +11030,7 @@ static inline void > gen_intermediate_code_internal(ARMCPU *cpu, > tcg_gen_debug_insn_start(dc->pc); > } > > +tcg_gen_add_i32(cpu_insn_count, cpu_insn_count, 1); And here. -- Thanks. -- Max

Re: [Qemu-devel] Counting barrier instructions in ARM

2014-10-15 Thread Max Filippov
ashing, but it should improve accuracy (: > > I had that before the change to tcg_gen_add_i32 and the crashes were > still there. But yes, this needs to be changed to use addi. Got backtraces of your crashes? > How do I enable the TCG debug build? configure with --enable-debug-tcg swithch. -- Thanks. -- Max

[Qemu-devel] [PATCH 2/2] iotests: Add test for qcow2 L1 table update

2014-10-16 Thread Max Reitz
Updating the L1 table should not result in random data being written. This adds a test for that. Signed-off-by: Max Reitz --- tests/qemu-iotests/107 | 61 ++ tests/qemu-iotests/107.out | 10 tests/qemu-iotests/group | 1 + 3 files

[Qemu-devel] [PATCH 0/2] qcow2: Do not overflow when writing an L1 sector

2014-10-16 Thread Max Reitz
qcow2_write_l1_entry() may read L1 entries from beyond the end of the in-memory L1 table when updating a sector. Fix this and add a qemu-iotest. Max Reitz (2): qcow2: Do not overflow when writing an L1 sector iotests: Add test for qcow2 L1 table update block/qcow2-cluster.c | 6

[Qemu-devel] [PATCH 1/2] qcow2: Do not overflow when writing an L1 sector

2014-10-16 Thread Max Reitz
e. Cc: qemu-sta...@nongnu.org Signed-off-by: Max Reitz --- block/qcow2-cluster.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c index f7dd8c0..4d888c7 100644 --- a/block/qcow2-cluster.c +++ b/block/qcow2-cluster.c @@

Re: [Qemu-devel] [PATCH] block: fix implicit convertion to invalid type

2014-10-16 Thread Max Reitz
--- block.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) Reviewed-by: Max Reitz

Re: [Qemu-devel] [PATCH] block: fix implicit convertion to invalid type

2014-10-16 Thread Max Reitz
Am 16.10.2014 um 15:34 schrieb Max Reitz: Am 16.10.2014 um 14:10 schrieb Igor Mammedov: change type of variable to expected IoOperationType which fixes compile warning: block.c:3655:20: warning: implicit conversion from enumeration type enum IoOperationType to different enumeration type

Re: [Qemu-devel] [PATCH v5 08/11] qcow2: Rebuild refcount structure during check

2014-10-16 Thread Max Reitz
Am 09.10.2014 um 01:09 schrieb Eric Blake: On 08/29/2014 03:41 PM, Max Reitz wrote: + * cluster_count clusters; therefore, we have to allocate + * cluster_count - contiguous_free_clusters new clusters at the end of + * the image (which is the current value of cluster

[Qemu-devel] [PATCH v2 0/2] target-xtensa: fix loading uImage kernels on MMUv2 cores

2014-10-18 Thread Max Filippov
->v2: - drop custom uImage loader interface and add generic translation function instead (suggested by Alexander Graf). Max Filippov (2): hw/core/loader: implement address translation in uimage loader hw/xtensa/xtfpga: treat uImage load address as virtual hw/arm/boot.c |

[Qemu-devel] [PATCH v2 2/2] hw/xtensa/xtfpga: treat uImage load address as virtual

2014-10-18 Thread Max Filippov
at the translated address. This fixes booting uImage kernels on dc232b and other MMUv2 cores. Cc: qemu-sta...@nongnu.org Reported-by: Waldemar Brodkorb Signed-off-by: Max Filippov --- Changes v1->v2: - use translate_phys_addr with the new load_uimage interface. hw/xtensa/xtfpga.c | 2 +- 1 f

[Qemu-devel] [PATCH] target-xtensa: add core importing script

2014-10-19 Thread Max Filippov
This script copies configuration and gdb information from the xtensa configuration overlay archive and registers new xtensa core. Signed-off-by: Max Filippov --- target-xtensa/import_core.sh | 53 1 file changed, 53 insertions(+) create mode 100755

[Qemu-devel] [PATCH] target-xtensa: fix build for cores w/o windowed registers

2014-10-19 Thread Max Filippov
Cores without windowed registers don't have window overflow/underflow vectors. Move these vectors to a separate group defined conditionally. Signed-off-by: Max Filippov --- target-xtensa/overlay_tool.h | 31 +++ 1 file changed, 19 insertions(+), 12 deletions(-)

Re: [Qemu-devel] [Consult] microblaze: About running upstream main branch qemu

2014-10-19 Thread Max Filippov
nux.bin -initrd > ../microblaze_complete.cpio.gz qemu-system-microblaze? -- Thanks. -- Max

Re: [Qemu-devel] writing a QEMU block driver

2014-10-20 Thread Max Reitz
7;s and my presentation from this year's KVM Forum: http://events.linuxfoundation.org/sites/events/files/slides/blockdev.pdf Max

Re: [Qemu-devel] [PATCH] block: add a knob to disable multiwrite_merge

2014-10-20 Thread Max Reitz
"iops_size": I/O size when limiting by iops (json-int) - "detect_zeroes": detect and optimize zero writing (json-string) - Possible values: "off", "on", "unmap" + - "write_merging": enable multiwrite_merge feature (json-bool) - "image": the detail of the image, it is a json-object containing the following: - "filename": image file name (json-string) @@ -2181,6 +2182,7 @@ Example: "iops_wr_max": 0, "iops_size": 0, "detect_zeroes": "on", + "write_merging": "true", "image":{ "filename":"disks/test.qcow2", "format":"qcow2", Hm, thanks for reminding me of that file. There are some things which I forgot to update (ImageInfoSpecific at least)... Max

Re: [Qemu-devel] [PATCH 2/2] iotests: Add test for qcow2 L1 table update

2014-10-20 Thread Max Reitz
On 2014-10-20 at 08:25, Peter Lieven wrote: On 16.10.2014 15:25, Max Reitz wrote: Updating the L1 table should not result in random data being written. This adds a test for that. Signed-off-by: Max Reitz --- tests/qemu-iotests/107 | 61

Re: [Qemu-devel] [PATCH] block: add a knob to disable multiwrite_merge

2014-10-20 Thread Max Reitz
On 2014-10-20 at 11:14, Peter Lieven wrote: On 20.10.2014 10:59, Max Reitz wrote: On 2014-10-20 at 08:14, Peter Lieven wrote: the block layer silently merges write requests since s/^t/T/ commit 40b4f539. This patch adds a knob to disable this feature as there has been some discussion

Re: [Qemu-devel] [PATCH v4 1/2] qcow2: Add qcow2_shrink_l1_and_l2_table for qcow2 shrinking

2014-10-20 Thread Max Reitz
} +qemu_close(fd); +} +} } new_l1_size = size_to_l1(s, offset); diff --git a/block/qcow2.h b/block/qcow2.h index 7d61e61..a9c8acb 100644 --- a/block/qcow2.h +++ b/block/qcow2.h @@ -516,6 +516,8 @@ int qcow2_pre_write_overlap_check(BlockDriverState *bs, int ign, int64_t offset, /* qcow2-cluster.c functions */ int qcow2_grow_l1_table(BlockDriverState *bs, uint64_t min_size, bool exact_size); +int qcow2_shrink_l1_and_l2_table(BlockDriverState *bs, uint64_t new_l1_size, + int new_l2_index, 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); Max

Re: [Qemu-devel] [PATCH] block: add a knob to disable multiwrite_merge

2014-10-20 Thread Max Reitz
On 2014-10-20 at 12:03, Peter Lieven wrote: On 20.10.2014 11:27, Max Reitz wrote: On 2014-10-20 at 11:14, Peter Lieven wrote: On 20.10.2014 10:59, Max Reitz wrote: On 2014-10-20 at 08:14, Peter Lieven wrote: the block layer silently merges write requests since s/^t/T/ commit 40b4f539

Re: [Qemu-devel] [PATCH] block: add a knob to disable multiwrite_merge

2014-10-20 Thread Max Reitz
On 2014-10-20 at 14:16, Peter Lieven wrote: On 20.10.2014 13:51, Max Reitz wrote: On 2014-10-20 at 12:03, Peter Lieven wrote: On 20.10.2014 11:27, Max Reitz wrote: On 2014-10-20 at 11:14, Peter Lieven wrote: On 20.10.2014 10:59, Max Reitz wrote: On 2014-10-20 at 08:14, Peter Lieven wrote

Re: [Qemu-devel] [PATCH] block: add a knob to disable multiwrite_merge

2014-10-20 Thread Max Reitz
On 20.10.2014 at 14:48, Peter Lieven wrote: On 20.10.2014 14:19, Max Reitz wrote: On 2014-10-20 at 14:16, Peter Lieven wrote: On 20.10.2014 13:51, Max Reitz wrote: On 2014-10-20 at 12:03, Peter Lieven wrote: [...] Can you further help here. I think my problem was that I don't have a

Re: [Qemu-devel] [PATCH] block: add a knob to disable multiwrite_merge

2014-10-20 Thread Max Reitz
On 20.10.2014 at 15:19, Peter Lieven wrote: On 20.10.2014 15:15, Max Reitz wrote: On 20.10.2014 at 14:48, Peter Lieven wrote: On 20.10.2014 14:19, Max Reitz wrote: On 2014-10-20 at 14:16, Peter Lieven wrote: On 20.10.2014 13:51, Max Reitz wrote: On 2014-10-20 at 12:03, Peter Lieven wrote

Re: [Qemu-devel] [PATCH] block: add a knob to disable multiwrite_merge

2014-10-20 Thread Max Reitz
On 20.10.2014 at 15:59, Peter Lieven wrote: On 20.10.2014 15:55, Kevin Wolf wrote: Am 20.10.2014 um 15:47 hat Peter Lieven geschrieben: On 20.10.2014 15:31, Kevin Wolf wrote: Am 20.10.2014 um 15:22 hat Max Reitz geschrieben: On 20.10.2014 at 15:19, Peter Lieven wrote: On 20.10.2014 15:15

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

2014-10-20 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 v6 00/11] qcow2: Fix image repairing

2014-10-20 Thread Max Reitz
'qcow2: Rebuild refcount structure during check' 009/11:[] [--] 'qcow2: Clean up after refcount rebuild' 010/11:[] [-C] 'iotests: Fix test outputs' 011/11:[0004] [FC] 'iotests: Add test for potentially damaging repairs' Max Reitz (11): qcow2: C

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

2014-10-20 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 v6 05/11] qcow2: Reuse refcount table in calculate_refcounts()

2014-10-20 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 v6 10/11] iotests: Fix test outputs

2014-10-20 Thread Max Reitz
rebuild the refcount structure as well. Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- 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

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

2014-10-20 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 Reviewed-by: Eric Blake --- block/qcow2.c | 3 +++ block/qcow2.h | 2 ++ 2

[Qemu-devel] [PATCH v6 09/11] qcow2: Clean up after refcount rebuild

2014-10-20 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 v6 04/11] qcow2: Pull check_refblocks() up

2014-10-20 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 v6 03/11] qcow2: Split qcow2_check_refcounts()

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

2014-10-20 Thread Max Reitz
ructure will be leaked, however. This leak will be dealt with in a follow-up commit. Signed-off-by: Max Reitz --- block/qcow2-refcount.c | 296 - 1 file changed, 293 insertions(+), 3 deletions(-) diff --git a/block/qcow2-refcount.c b/block/qcow2-r

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