Re: [Qemu-devel] [PATCH v3 22/23] block: Lift device model API into BlockBackend

2014-09-22 Thread Max Reitz
-backend.h | 35 ++ 7 files changed, 203 insertions(+), 182 deletions(-) Reviewed-by: Max Reitz

Re: [Qemu-devel] [PATCH v3 19/23] blockdev: Drop DriveInfo member enable_auto_del

2014-09-22 Thread Max Reitz
On 22.09.2014 17:06, Markus Armbruster wrote: Max Reitz writes: On 16.09.2014 20:12, Markus Armbruster wrote: Commit 2d246f0 introduced DriveInfo member enable_auto_del to distinguish DriveInfo created via drive_new() from DriveInfo created via qmp_blockdev_add(). The latter no longer exist

[Qemu-devel] [PATCH 2/2] raw-posix: raw_co_get_block_status() return value

2014-09-22 Thread Max Reitz
Instead of generating the full return value thrice in try_fiemap(), try_seek_hole() and as a fall-back in raw_co_get_block_status() itself, generate the value only in raw_co_get_block_status(). Suggested-by: Kevin Wolf Signed-off-by: Max Reitz --- block/raw-posix.c | 20 ++-- 1

Re: [Qemu-devel] [PATCH 2/2] raw-posix: raw_co_get_block_status() return value

2014-09-22 Thread Max Reitz
On 22.09.2014 17:23, Max Reitz wrote: Instead of generating the full return value thrice in try_fiemap(), try_seek_hole() and as a fall-back in raw_co_get_block_status() itself, generate the value only in raw_co_get_block_status(). Suggested-by: Kevin Wolf Signed-off-by: Max Reitz --- block

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

2014-09-22 Thread Max Reitz
along the way. v2: - Patch 1: Clamp nb_sectors against image end - Patch 2: Fix alignment issue Max Reitz (2): raw-posix: Fix raw_co_get_block_status() after EOF raw-posix: raw_co_get_block_status() return value block/raw-posix.c | 36 ++-- 1 file change

[Qemu-devel] [PATCH v2 1/2] raw-posix: Fix raw_co_get_block_status() after EOF

2014-09-22 Thread Max Reitz
instead. Fix this, too. Additionally, nb_sectors should be clamped against the image end. This was probably not an issue if FIEMAP or SEEK_HOLE/SEEK_DATA worked, but the fallback did not take this case into account. Reported-by: Kevin Wolf Signed-off-by: Max Reitz --- block/raw-posix.c | 12

[Qemu-devel] [PATCH v2 2/2] raw-posix: raw_co_get_block_status() return value

2014-09-22 Thread Max Reitz
Instead of generating the full return value thrice in try_fiemap(), try_seek_hole() and as a fall-back in raw_co_get_block_status() itself, generate the value only in raw_co_get_block_status(). Suggested-by: Kevin Wolf Signed-off-by: Max Reitz --- block/raw-posix.c | 24

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

2014-09-22 Thread Max Reitz
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. While doing that, centralize the generation of raw_co_get_block_status()'s return value along the way. Max Reitz (2): raw-posix

[Qemu-devel] [PATCH 1/2] raw-posix: Fix raw_co_get_block_status() after EOF

2014-09-22 Thread Max Reitz
instead. Fix this, too. Reported-by: Kevin Wolf Signed-off-by: Max Reitz --- block/raw-posix.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/block/raw-posix.c b/block/raw-posix.c index a253697..de4e3f3 100644 --- a/block/raw-posix.c +++ b/block/raw-posix.c @@ -1509,9

[Qemu-devel] [PATCH] target-xtensa: add definition for XTHAL_INTTYPE_PROFILING

2014-09-23 Thread Max Filippov
There's new interrupt type in the recent Xtensa releases that may appear in configuration overlay. Add definition so that new cores that use it could be automatically imported. Signed-off-by: Max Filippov --- target-xtensa/cpu.h | 1 + target-xtensa/overlay_tool.h | 1 + 2

[Qemu-devel] [PATCH] target-xtensa: tests: pre-process tests linker script

2014-09-23 Thread Max Filippov
configuration and pass it through the C preprocessor. While at it clean up tabs and align the initial stack on 16 bytes. Signed-off-by: Max Filippov --- tests/tcg/xtensa/Makefile| 10 +++- tests/tcg/xtensa/linker.ld | 112 - tests/tcg/xtensa/linker.ld.S | 130

Re: [Qemu-devel] [PATCH v3] docs: add blkdebug block driver documentation

2014-09-24 Thread Max Reitz
] * Expanded ini rules file explanation [Paolo] * Added note that errno values depend on the host [Eric] docs/blkdebug.txt | 161 ++ 1 file changed, 161 insertions(+) create mode 100644 docs/blkdebug.txt Reviewed-by: Max Reitz Maybe I&#x

[Qemu-devel] [PATCH 2/3] blkdebug: Simplify and improve filename generation

2014-09-24 Thread Max Reitz
qemu-iotest 099 which exactly tests this filename generation. Fix it up as well. Signed-off-by: Max Reitz --- block/blkdebug.c | 98 +- tests/qemu-iotests/099.out | 4 +- 2 files changed, 29 insertions(+), 73 deletions(-) diff --git a/block

[Qemu-devel] [PATCH 3/3] iotests: Plain blkdebug filename generation

2014-09-24 Thread Max Reitz
Add a test whether blkdebug is able to generate a plain filename if given a configuration file and a file to be tested only. Signed-off-by: Max Reitz --- tests/qemu-iotests/099 | 9 - tests/qemu-iotests/099.out | 4 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a

[Qemu-devel] [PATCH 1/4] block: Change bdrv_get_encrypted_filename()

2014-09-24 Thread Max Reitz
Instead of returning a pointer to the filename, copy it into a buffer specified by the caller. While adapting the callers accordingly, this patch also fixes them apparently ignoring that this function's return value may be NULL. Signed-off-by: Max Reitz --- block.c

[Qemu-devel] [PATCH 4/4] block: Drop BlockDriverState.filename

2014-09-24 Thread Max Reitz
ult of bdrv_filename(); any access to BlockDriverState.filename is then replaced by this buffer Signed-off-by: Max Reitz --- block.c | 43 ++- block/blkverify.c | 3 +-- block/commit.c| 4 +++- block/mi

[Qemu-devel] [PATCH 2/4] block: Avoid BlockDriverState.filename

2014-09-24 Thread Max Reitz
emove that field, using exact_filename is fine, too (this is the only user of BlockDriverState.filename which frequently queries that field). Finally, in some other places there a buffer is available whose content equals that of BlockDriverState.filename; use that buffer instead. Signed-off-by: Max

[Qemu-devel] [PATCH 0/4] block: Drop BDS.filename

2014-09-24 Thread Max Reitz
when a disk image is opened or some message should be emitted, both of which cases do not suffer from the performance hit. Max Reitz (4): block: Change bdrv_get_encrypted_filename() block: Avoid BlockDriverState.filename block: Add bdrv_filename() block: Drop BlockDriverState.filename

[Qemu-devel] [PATCH 3/4] block: Add bdrv_filename()

2014-09-24 Thread Max Reitz
. Since bdrv_refresh_filename() therefore no longer refreshes that field, some calls to that function have to be replaced by calls to bdrv_filename() "manually" refreshing the BDS filename field. Signed-off-by: Max Reitz --- block.c | 31 --- block/b

[Qemu-devel] [PATCH 1/3] nbd: Fix filename generation

2014-09-24 Thread Max Reitz
. Just use BlockDriverState::options instead. Reported-by: Stefan Hajnoczi Signed-off-by: Max Reitz --- block/nbd.c | 44 +--- 1 file changed, 29 insertions(+), 15 deletions(-) diff --git a/block/nbd.c b/block/nbd.c index 89775e1..04cc845 100644 --- a/block/nbd.c +

[Qemu-devel] [PATCH 0/3] block: Fix filename generation for blkdebug and nbd

2014-09-24 Thread Max Reitz
This series fixes the filename generation in nbd and improves the one in blkdebug. Max Reitz (3): nbd: Fix filename generation blkdebug: Simplify and improve filename generation iotests: Plain blkdebug filename generation block/blkdebug.c | 98

[Qemu-devel] [PATCH] target-xtensa: avoid duplicate timer interrupt delivery

2014-09-26 Thread Max Filippov
upper interval boundary and once for the lower. Fix that by excluding lower interval boundary from the condition. This doesn't have user-visible effect, because CCOMPARE reload always causes CCOUNT increment followed by current timer interrupt reset. Signed-off-by: Max Filippov --- hw/x

Re: [Qemu-devel] [PATCH v2 2/2] block/raw-posix: use seek_hole ahead of fiemap

2014-09-26 Thread Max Reitz
: Michael Steffens Signed-off-by: Tony Breeds Cc: Kevin Wolf Cc: Markus Armbruster Cc: Stefan Hajnoczi Cc: Max Reitz Cc: Pádraig Brady Cc: Eric Blake --- Changes since v1: - split in to 2 patches - tried to make the commit messages better I used this order in at least one of the non-final

Re: [Qemu-devel] [PATCH v2 1/2] block/raw-posix: Fix disk corruption in try_fiemap

2014-09-26 Thread Max Reitz
Cc: Markus Armbruster Cc: Stefan Hajnoczi Cc: Max Reitz Cc: Pádraig Brady Cc: Eric Blake --- Changes since v1: - split in to 2 patches - tried to make the commit messages better block/raw-posix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Max Reitz

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

2014-09-29 Thread Max Filippov
On Tue, Sep 16, 2014 at 9:16 AM, Max Filippov wrote: > 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: >&

[Qemu-devel] [PATCH 0/3] qcow2/qapi: Add "corrupt" to ImageInfoSpecificQCow2

2014-09-30 Thread Max Reitz
irect qemu-img info calls by _img_info where appropriate. Max Reitz (3): iotests: Use _img_info qapi: Add corrupt field to ImageInfoSpecificQCow2 iotests: qemu-img info output for corrupt image block/qcow2.c | 3 +++ qapi/block-core.json | 6 - tests/qemu-iotests/06

[Qemu-devel] [PATCH 3/3] iotests: qemu-img info output for corrupt image

2014-09-30 Thread Max Reitz
The "corrupt" entry in the format-specific information section should be "true". Signed-off-by: Max Reitz --- tests/qemu-iotests/060 | 3 +++ tests/qemu-iotests/060.out | 9 + 2 files changed, 12 insertions(+) diff --git a/tests/qemu-iotests/060 b/tests/qe

[Qemu-devel] [PATCH 2/3] qapi: Add corrupt field to ImageInfoSpecificQCow2

2014-09-30 Thread Max Reitz
Just like lazy-refcounts, this field will be present iff the qcow2 compat level is 1.1 (or probably any future revision). As expected, this breaks some tests due to the new field present in qemu-img info output; so fix their output accordingly. Suggested-by: Eric Blake Signed-off-by: Max Reitz

[Qemu-devel] [PATCH 1/3] iotests: Use _img_info

2014-09-30 Thread Max Reitz
qemu-img info, "qcow2" is replaced by "IMGFMT"; but as "qcow2" is only mentioned once in test 082 (in _supported_fmt), I consider this an improvement. Signed-off-by: Max Reitz --- tests/qemu-iotests/070 | 2 +- tests/qemu-iotests/070.out | 5 ++--- t

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

2014-10-01 Thread Max Reitz
mode 100644 block/block-backend.c create mode 100644 include/sysemu/block-backend.h Reviewed-by: Max Reitz

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

2014-10-01 Thread Max Reitz
lock/block_int.h | 2 + include/sysemu/block-backend.h | 5 ++ qemu-img.c | 125 +++-- qemu-io.c | 4 +- qemu-nbd.c | 4 +- 9 files changed, 156 insertions(+), 93 deletions(-) Reviewed-by: Max Reitz

Re: [Qemu-devel] [PATCH v4 04/23] block: Connect BlockBackend and DriveInfo

2014-10-01 Thread Max Reitz
++ blockdev.c| 69 --- include/sysemu/blockdev.h | 4 +++ 4 files changed, 77 insertions(+), 36 deletions(-) Reviewed-by: Max Reitz

Re: [Qemu-devel] [PATCH v4 08/23] block: Eliminate BlockDriverState member device_name[]

2014-10-01 Thread Max Reitz
hanged, 55 insertions(+), 48 deletions(-) Reviewed-by: Max Reitz

Re: [Qemu-devel] [PATCH v4 09/23] block: Merge BlockBackend and BlockDriverState name spaces

2014-10-01 Thread Max Reitz
ock.c | 48 block/block-backend.c | 17 +++-- include/block/block.h | 2 +- 3 files changed, 24 insertions(+), 43 deletions(-) Reviewed-by: Max Reitz

Re: [Qemu-devel] [PATCH v4 11/23] block: Rename BlockDriverAIOCB* to BlockAIOCB*

2014-10-01 Thread Max Reitz
nt issues fixed, the scsi-generic.c hunk moved to patch 12 and the two trivial replacements in docs/blkdebug.txt: Reviewed-by: Max Reitz

Re: [Qemu-devel] [PATCH v4 12/23] block: Rename BlockDriverCompletionFunc to BlockCompletionFunc

2014-10-01 Thread Max Reitz
should replace that occurrence as well. With these trivial changes (alignment changes due to rebasing on a patch 11 changed according to my proposals and the replacement in docs/blkdebug.txt): Reviewed-by: Max Reitz

Re: [Qemu-devel] [PATCH v4 15/23] hw: Convert from BlockDriverState to BlockBackend, mostly

2014-10-01 Thread Max Reitz
d 15, and if you change 11 and 12 and then change this patch to match the changes. Reviewed-by: Max Reitz

Re: [Qemu-devel] [PATCH v4 19/23] blockdev: Fix blockdev-add not to create DriveInfo

2014-10-01 Thread Max Reitz
ude/sysemu/blockdev.h | 1 - 6 files changed, 20 insertions(+), 25 deletions(-) Reviewed-by: Max Reitz

Re: [Qemu-devel] [PATCH v4 23/23] block: Make device model's references to BlockBackend strong

2014-10-01 Thread Max Reitz
On 30.09.2014 21:25, Markus Armbruster wrote: Doesn't make a difference just yet, but it's the right thing to do. Signed-off-by: Markus Armbruster Reviewed-by: Benoît Canet Reviewed-by: Kevin Wolf --- block/block-backend.c | 2 ++ 1 file changed, 2 insertions(+) Reviewed-by: Max Reitz

Re: [Qemu-devel] [PATCH 01/11] block: acquire AioContext in generic blockjob QMP commands

2014-10-01 Thread Max Reitz
ons(-) Reviewed-by: Max Reitz

Re: [Qemu-devel] [PATCH 02/11] blockdev: acquire AioContext in do_qmp_query_block_jobs_one()

2014-10-01 Thread Max Reitz
tions(+), 2 deletions(-) This conflicts with patch 7 Markus's BlockBackend series; but in itself, this patch is fine. Reviewed-by: Max Reitz

Re: [Qemu-devel] [PATCH 03/11] blockdev: acquire AioContext in blockdev_mark_auto_del()

2014-10-01 Thread Max Reitz
another AioContext we must acquire/release to ensure thread safety. Signed-off-by: Stefan Hajnoczi --- blockdev.c | 7 +++ 1 file changed, 7 insertions(+) Reviewed-by: Max Reitz

Re: [Qemu-devel] [PATCH 04/11] blockdev: add note that block_job_cb() must be thread-safe

2014-10-01 Thread Max Reitz
+ 1 file changed, 5 insertions(+) Reviewed-by: Max Reitz

Re: [Qemu-devel] [PATCH 05/11] blockjob: add block_job_defer_to_main_loop()

2014-10-01 Thread Max Reitz
another thread) after the call to bdrv_get_aio_context() in block_job_defer_to_main_loop() and before block_job_defer_to_main_loop_bh() is run. If so, this might create race conditions. Other than that, this patch looks good. Max

Re: [Qemu-devel] [PATCH 06/11] block: add bdrv_drain()

2014-10-01 Thread Max Reitz
ve a function to drain a single device's I/O queue." Apparently, under certain circumstances, it now *is* possible. ;-) Reviewed-by: Max Reitz

Re: [Qemu-devel] [PATCH 07/11] block: let backup blockjob run in BDS AioContext

2014-10-01 Thread Max Reitz
loop and not the BDS's AIO context) and try to cancel it or set its speed from another thread (e.g. the main loop), won't the blockjob hold the BDS's AIO context lock as long as it runs and making it impossible to interfere? Max

Re: [Qemu-devel] [PATCH 07/11] block: let backup blockjob run in BDS AioContext

2014-10-04 Thread Max Reitz
On 02.10.2014 17:08, Stefan Hajnoczi wrote: On Wed, Oct 01, 2014 at 09:38:39PM +0200, Max Reitz wrote: On 01.10.2014 19:01, Stefan Hajnoczi wrote: The backup block job must run in the BlockDriverState AioContext so that it works with dataplane. The basics of acquiring the AioContext are easy

Re: [Qemu-devel] [PATCH 08/11] block: let stream blockjob run in BDS AioContext

2014-10-04 Thread Max Reitz
changed, 48 insertions(+), 18 deletions(-) Reviewed-by: Max Reitz

Re: [Qemu-devel] [PATCH 09/11] block: let mirror blockjob run in BDS AioContext

2014-10-04 Thread Max Reitz
| 85 -- blockdev.c | 38 ++ 3 files changed, 97 insertions(+), 39 deletions(-) Reviewed-by: Max Reitz

Re: [Qemu-devel] [PATCH 10/11] block: let commit blockjob run in BDS AioContext

2014-10-04 Thread Max Reitz
k_job_is_cancelled(&s->common) && sector_num == end) { -/* success */ -ret = bdrv_drop_intermediate(active, top, base, s->backing_file_str); +out: + if (buf) { +qemu_vfree(buf); } Is this new condition really necessary? However, it won't h

Re: [Qemu-devel] [PATCH 11/11] block: declare blockjobs and dataplane friends!

2014-10-04 Thread Max Reitz
-by: Max Reitz

Re: [Qemu-devel] [PATCH 10/11] block: let commit blockjob run in BDS AioContext

2014-10-07 Thread Max Reitz
On 06.10.2014 11:30, Stefan Hajnoczi wrote: On Sat, Oct 04, 2014 at 11:28:22PM +0200, Max Reitz wrote: On 01.10.2014 19:01, Stefan Hajnoczi wrote: The commit block job must run in the BlockDriverState AioContext so that it works with dataplane. Acquire the AioContext in blockdev.c so starting

Re: [Qemu-devel] [PATCH v6 03/24] block: Connect BlockBackend to BlockDriverState

2014-10-07 Thread Max Reitz
6 insertions(+), 94 deletions(-) Reviewed-by: Max Reitz

Re: [Qemu-devel] [PATCH v6 04/24] block: Connect BlockBackend and DriveInfo

2014-10-07 Thread Max Reitz
blockdev.c| 73 --- include/sysemu/blockdev.h | 4 +++ 4 files changed, 79 insertions(+), 38 deletions(-) Reviewed-by: Max Reitz

Re: [Qemu-devel] [PATCH v6 07/24] blockdev: Eliminate drive_del()

2014-10-07 Thread Max Reitz
/blockdev.h | 1 - 4 files changed, 7 insertions(+), 10 deletions(-) Reviewed-by: Max Reitz

Re: [Qemu-devel] [PATCH v6 16/24] hw: Convert from BlockDriverState to BlockBackend, mostly

2014-10-07 Thread Max Reitz
de/sysemu/block-backend.h | 76 + include/sysemu/blockdev.h| 5 +- include/sysemu/dma.h | 20 +-- trace-events | 8 +- 111 files changed, 1137 insertions(+), 807 deletions(-) Reviewed-by: Max Reitz

[Qemu-devel] [PATCH 2/3] block: Add AIO context notifiers

2014-06-13 Thread Max Reitz
: Max Reitz --- block.c | 56 +++ include/block/block_int.h | 41 ++ 2 files changed, 97 insertions(+) diff --git a/block.c b/block.c index 17f763d..1ee82cc 100644 --- a/block.c +++ b/block.c @@ -1809,6

[Qemu-devel] [PATCH 0/3] nbd: Adapt for dataplane

2014-06-13 Thread Max Reitz
BD (two block devices and one NBD client per device). I didn't run into any problems and the NBD code indeed did attach and detach from the respective AIO contexts, so this time I'm more confident that it indeed does work. Max Reitz (3): nbd: Drop nbd_can_read() block: Add AIO cont

[Qemu-devel] [PATCH 3/3] nbd: Follow the BDS' AIO context

2014-06-13 Thread Max Reitz
Keep the NBD server always in the same AIO context as the exported BDS by calling bdrv_add_aio_context_notifier() and implementing the required callbacks. Signed-off-by: Max Reitz --- nbd.c | 31 +++ 1 file changed, 31 insertions(+) diff --git a/nbd.c b/nbd.c index

[Qemu-devel] [PATCH 1/3] nbd: Drop nbd_can_read()

2014-06-13 Thread Max Reitz
() (which registers all handlers for the AIO context and file descriptor belonging to the given client), nbd_unset_handlers() (which unregisters them) and nbd_update_can_read() (which checks whether NBD can read for the given client and acts accordingly). Signed-off-by: Max Reitz --- nbd.c | 77

Re: [Qemu-devel] [PATCH v9 1/4] quorum: Add the rewrite-corrupted parameter to quorum

2014-06-13 Thread Max Reitz
insertions(+), 8 deletions(-) Reviewed-by: Max Reitz

Re: [Qemu-devel] [PATCH v9 2/4] block: Add node-name argument to drive-mirror

2014-06-13 Thread Max Reitz
files changed, 17 insertions(+), 2 deletions(-) Reviewed-by: Max Reitz

Re: [Qemu-devel] [PATCH v9 3/4] block: Add replaces argument to drive-mirror

2014-06-13 Thread Max Reitz
bs, BlockDriverState *candidate); - int (*bdrv_probe)(const uint8_t *buf, int buf_size, const char *filename); int (*bdrv_probe_device)(const char *filename); This hunk doesn't seem intended...? Other than these, the patch looks fine to me. If you fix the leakage of s->replaces (or explain why mirror_complete() is always invoked before immediate_exit): Reviewed-by: Max Reitz

Re: [Qemu-devel] [PATCH v9 4/4] qemu-iotests: Add TestRepairQuorum to 041 to test drive-mirror node-name mode.

2014-06-13 Thread Max Reitz
repair_img, format=iotests.imgfmt) +self.assert_qmp(result, 'return', {}) + +result = self.vm.qmp('block-job-pause', device='quorum0') +self.assert_qmp(result, 'return', {}) + +time.sleep(1) +result = self.vm.qmp(&#x

Re: [Qemu-devel] [PATCH 1/3] nbd: Drop nbd_can_read()

2014-06-14 Thread Max Reitz
On 14.06.2014 09:57, Paolo Bonzini wrote: Il 14/06/2014 00:30, Max Reitz ha scritto: +static void nbd_set_handlers(NBDClient *client) +{ +if (client->exp && client->exp->ctx) { +aio_set_fd_handler(client->exp->ctx, client->sock, +

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

2014-06-14 Thread Max Reitz
++ tests/qemu-iotests/group | 1 + 6 files changed, 82 insertions(+), 3 deletions(-) create mode 100755 tests/qemu-iotests/093 create mode 100644 tests/qemu-iotests/093.out Reviewed-by: Max Reitz

Re: [Qemu-devel] [PATCH v10 2/6] raw, qcow2: don't convert file size to sector size

2014-06-14 Thread Max Reitz
ably for the better to align the size here. Reviewed-by: Max Reitz

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

2014-06-14 Thread Max Reitz
ead, Error **errp) } } -static inline int parse_enum_option(const char *lookup[], const char *buf, -int max, int def, Error **errp) -{ -int i; - -if (!buf) { -return def; -} - -for (i = 0; i <

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

2014-06-14 Thread Max Reitz
commands" series), block-related QAPI definitions should go into qapi/block.json or qapi/block-core.json. I think the following definition should now go into qapi/block-core.json instead of qapi-schema.json. Apart from that, this patch looks good. Max @@ -3077,3 +3077,1

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

2014-06-14 Thread Max Reitz
everything; you chose the latter, which is fine. However, why do you implement the preallocation differently for preallocation=full, then? posix_fallocate() does not seem to change the contents of the areas which were newly allocated; and the ftruncate() before made sure they ar

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

2014-06-14 Thread Max Reitz
(alloc_options, BLOCK_OPT_PREALLOC, "full"); +} else if (prealloc == PREALLOC_MODE_METADATA) { + set_option_parameter(alloc_options, BLOCK_OPT_PREALLOC, "metadata"); +} How about set_option_parameter(alloc_options, BLOCK_OPT_PREALLOC, Prealloc

Re: [Qemu-devel] [PATCH v10 4/4] qemu-iotests: Add TestRepairQuorum to 041 to test drive-mirror node-name mode.

2014-06-17 Thread Max Reitz
some open questions from v9 about why this test works, so I'll still wait. ;-) Max

[Qemu-devel] [PATCH] qcow2: Silence covscan for g_realloc() result

2014-06-17 Thread Max Reitz
. Signed-off-by: Max Reitz --- See https://bugzilla.redhat.com/show_bug.cgi?id=1102409 for covscan's output. --- block/qcow2-refcount.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c index 9507aef..4b81077 100644 --- a/block/qcow2-refco

Re: [Qemu-devel] [PATCH v10 4/4] qemu-iotests: Add TestRepairQuorum to 041 to test drive-mirror node-name mode.

2014-06-17 Thread Max Reitz
: Benoit Canet --- tests/qemu-iotests/041 | 196 - tests/qemu-iotests/041.out | 4 +- 2 files changed, 194 insertions(+), 6 deletions(-) Reviewed-by: Max Reitz

Re: [Qemu-devel] [PATCH v10 4/4] qemu-iotests: Add TestRepairQuorum to 041 to test drive-mirror node-name mode.

2014-06-17 Thread Max Reitz
On 17.06.2014 20:19, Benoît Canet wrote: The Tuesday 17 Jun 2014 à 18:17:46 (+0200), Max Reitz wrote : On 16.06.2014 12:00, Benoît Canet wrote: The to-replace-node-name is designed to allow repairing a broken Quorum file. This patch introduces a new class TestRepairQuorum testing that the

[Qemu-devel] [PATCH 2/2] iotests: Add test for set "filename" for NBD

2014-06-17 Thread Max Reitz
Add a new test for qemu-iotests which checks whether the "filename" (and consequently the "file") attribute is set for images which are opened over NBD. Signed-off-by: Max Reitz --- tests/qemu-iotests/097 | 72 ++ tests/qemu-

[Qemu-devel] [PATCH 1/2] block: Do not prematurely remove "filename"

2014-06-17 Thread Max Reitz
hich do not need the filename because they have parsed it already (e.g. NBD). Signed-off-by: Max Reitz --- block.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/block.c b/block.c index 43abe96..1fdfa66 100644 --- a/block.c +++ b/block.c @@ -954,6 +

[Qemu-devel] [PATCH 0/2] block: Fix unset "filename" for certain drivers

2014-06-17 Thread Max Reitz
For some protocol block drivers, the "filename" attribute in their BDSs is unset due to bdrv_file_open() removing it from the options QDict before bdrv_open_common() is able to copy it into the BDS. Fix this by not removing it until until bdrv_open_common() has indeed copied it. Ma

Re: [Qemu-devel] [PATCH 2/2] iotests: Add test for set "filename" for NBD

2014-06-18 Thread Max Reitz
On 18.06.2014 15:47, Benoît Canet wrote: The Wednesday 18 Jun 2014 à 00:14:10 (+0200), Max Reitz wrote : Add a new test for qemu-iotests which checks whether the "filename" (and consequently the "file") attribute is set for images which are opened over NBD. Sign

[Qemu-devel] [PATCH v2 3/3] nbd: Follow the BDS' AIO context

2014-06-18 Thread Max Reitz
Keep the NBD server always in the same AIO context as the exported BDS by calling bdrv_add_aio_context_notifier() and implementing the required callbacks. Signed-off-by: Max Reitz --- nbd.c | 31 +++ 1 file changed, 31 insertions(+) diff --git a/nbd.c b/nbd.c index

[Qemu-devel] [PATCH v2 2/3] block: Add AIO context notifiers

2014-06-18 Thread Max Reitz
: Max Reitz --- block.c | 56 +++ include/block/block_int.h | 41 ++ 2 files changed, 97 insertions(+) diff --git a/block.c b/block.c index 43abe96..a3d09fa 100644 --- a/block.c +++ b/block.c @@ -1806,6

[Qemu-devel] [PATCH v2 0/3] nbd: Adapt for dataplane

2014-06-18 Thread Max Reitz
[down] : patch is downstream-only The flags [FC] indicate (F)unctional and (C)ontextual differences, respectively 001/3:[0005] [FC] 'nbd: Drop nbd_can_read()' 002/3:[] [--] 'block: Add AIO context notifiers' 003/3:[] [--] 'nbd: Follow the BDS' AIO co

[Qemu-devel] [PATCH v2 1/3] nbd: Drop nbd_can_read()

2014-06-18 Thread Max Reitz
() (which registers all handlers for the AIO context and file descriptor belonging to the given client), nbd_unset_handlers() (which unregisters them) and nbd_update_can_read() (which checks whether NBD can read for the given client and acts accordingly). Signed-off-by: Max Reitz --- nbd.c | 74

Re: [Qemu-devel] [PATCH v2 1/3] nbd: Drop nbd_can_read()

2014-06-20 Thread Max Reitz
On 19.06.2014 10:44, Paolo Bonzini wrote: Il 18/06/2014 21:06, Max Reitz ha scritto: +static void nbd_set_handlers(NBDClient *client) +{ +if (client->exp && client->exp->ctx) { +aio_set_fd_handler(client->exp->ctx, client->sock, +

Re: [Qemu-devel] [PATCH v2 1/3] nbd: Drop nbd_can_read()

2014-06-20 Thread Max Reitz
On 19.06.2014 05:58, Stefan Hajnoczi wrote: On Wed, Jun 18, 2014 at 09:06:41PM +0200, Max Reitz wrote: +static void nbd_update_can_read(NBDClient *client) +{ +bool can_read = client->recv_coroutine || +client->nb_requests < MAX_NBD_REQUESTS; + +if (can_read

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

2014-06-20 Thread Max Reitz
On 20.06.2014 10:25, Hu Tao wrote: On Sat, Jun 14, 2014 at 10:37:33PM +0200, Max Reitz wrote: On 12.06.2014 05:54, Hu Tao wrote: This adds a preallocation=full mode to qcow2 image creation, which creates a non-sparse image file. Signed-off-by: Hu Tao --- block/qcow2.c | 90

[Qemu-devel] [PATCH for-2.2 v3 0/3] nbd: Adapt for dataplane

2014-06-20 Thread Max Reitz
tream/downstream patch [down] : patch is downstream-only The flags [FC] indicate (F)unctional and (C)ontextual differences, respectively 001/3:[0006] [FC] 'nbd: Drop nbd_can_read()' 002/3:[] [--] 'block: Add AIO context notifiers' 003/3:[] [--] 'nbd: Follow the BD

[Qemu-devel] [PATCH for-2.2 v3 1/3] nbd: Drop nbd_can_read()

2014-06-20 Thread Max Reitz
() (which registers all handlers for the AIO context and file descriptor belonging to the given client), nbd_unset_handlers() (which unregisters them) and nbd_update_can_read() (which checks whether NBD can read for the given client and acts accordingly). Signed-off-by: Max Reitz --- nbd.c | 72

[Qemu-devel] [PATCH for-2.2 v3 2/3] block: Add AIO context notifiers

2014-06-20 Thread Max Reitz
: Max Reitz Reviewed-by: Stefan Hajnoczi --- block.c | 56 +++ include/block/block_int.h | 41 ++ 2 files changed, 97 insertions(+) diff --git a/block.c b/block.c index 1fdfa66..4b3e674 100644 --- a

[Qemu-devel] [PATCH for-2.2 v3 3/3] nbd: Follow the BDS' AIO context

2014-06-20 Thread Max Reitz
Keep the NBD server always in the same AIO context as the exported BDS by calling bdrv_add_aio_context_notifier() and implementing the required callbacks. Signed-off-by: Max Reitz Reviewed-by: Stefan Hajnoczi --- nbd.c | 31 +++ 1 file changed, 31 insertions

[Qemu-devel] [PATCH] hw/xtensa/xtfpga: fix FLASH mapping to boot region for KC705

2014-06-23 Thread Max Filippov
On KC705 bootloader area is located at FLASH offset 0x0600, not 0 as on older xtfpga boards. Cc: qemu-sta...@nongnu.org Signed-off-by: Max Filippov --- hw/xtensa/xtensa_lx60.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hw/xtensa/xtensa_lx60.c b/hw/xtensa

[Qemu-devel] [PATCH 4/9] hw/xtensa/xtfpga: use symbolic constants for bootparam tags

2014-06-23 Thread Max Filippov
Import bootparam tag names from linux/arch/xtensa/include/asm/bootparam.h No functional changes. Signed-off-by: Max Filippov --- hw/xtensa/bootparam.h | 10 ++ hw/xtensa/xtfpga.c| 6 +++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/hw/xtensa/bootparam.h b/hw

[Qemu-devel] [PATCH 9/9] hw/xtensa/xtfpga: implement initrd loading

2014-06-23 Thread Max Filippov
Signed-off-by: Max Filippov --- hw/xtensa/xtfpga.c | 24 1 file changed, 24 insertions(+) diff --git a/hw/xtensa/xtfpga.c b/hw/xtensa/xtfpga.c index 01825d6..a2dff5a 100644 --- a/hw/xtensa/xtfpga.c +++ b/hw/xtensa/xtfpga.c @@ -180,6 +180,7 @@ static void lx_init(const

[Qemu-devel] [PATCH 7/9] hw/xtensa/xtfpga: implement uImage loading

2014-06-23 Thread Max Filippov
Provide a simple bootloader code at the reset address that jumps to the loaded image entry point when it's not equal to the reset address. This is needed because the old method of setting pc doesn't work due to cpu reset done after the machine setup. Signed-off-by: Max Filippov ---

[Qemu-devel] [PATCH 8/9] hw/xtensa/xtfpga: implement DTB loading

2014-06-23 Thread Max Filippov
Signed-off-by: Max Filippov --- hw/xtensa/xtfpga.c | 23 +++ 1 file changed, 23 insertions(+) diff --git a/hw/xtensa/xtfpga.c b/hw/xtensa/xtfpga.c index 0e0d825..01825d6 100644 --- a/hw/xtensa/xtfpga.c +++ b/hw/xtensa/xtfpga.c @@ -37,6 +37,7 @@ #include "hw/block/fl

[Qemu-devel] [PATCH 2/9] hw/xtensa: replace fprintfs with error_report

2014-06-23 Thread Max Filippov
Signed-off-by: Max Filippov --- hw/xtensa/sim.c| 6 -- hw/xtensa/xtfpga.c | 10 ++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/hw/xtensa/sim.c b/hw/xtensa/sim.c index 89da43c..9642bf5 100644 --- a/hw/xtensa/sim.c +++ b/hw/xtensa/sim.c @@ -31,6 +31,7

[Qemu-devel] [PATCH 3/9] hw/xtensa/xtfpga: retrieve parameters from machine_opts

2014-06-23 Thread Max Filippov
Signed-off-by: Max Filippov --- hw/xtensa/xtfpga.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/xtensa/xtfpga.c b/hw/xtensa/xtfpga.c index 75bc479..0aa3eeb 100644 --- a/hw/xtensa/xtfpga.c +++ b/hw/xtensa/xtfpga.c @@ -174,9 +174,10 @@ static void lx_init(const

[Qemu-devel] [PATCH 1/9] hw/xtensa: remove extraneous xtensa_ prefix from file names

2014-06-23 Thread Max Filippov
While at it rename lx60 (named after the first board of the family) to more generic xtfpga (the family name). Signed-off-by: Max Filippov --- hw/xtensa/Makefile.objs | 4 ++-- hw/xtensa/{xtensa_bootparam.h => bootparam.h} | 0 hw/xtensa/{xtensa_sim.c =>

[Qemu-devel] [PATCH 0/9] target-xtensa: linux booting improvements

2014-06-23 Thread Max Filippov
Hi, this series refactors boot parameters handling for xtensa xtfpga boards and implements uImage, FDT and initrd loading. Max Filippov (9): hw/xtensa: remove extraneous xtensa_ prefix from file names hw/xtensa: replace fprintfs with error_report hw/xtensa/xtfpga: retrieve parameters from

[Qemu-devel] [PATCH 6/9] hw/xtensa/xtfpga: add memory info to bootparam

2014-06-23 Thread Max Filippov
Signed-off-by: Max Filippov --- hw/xtensa/bootparam.h | 9 + hw/xtensa/xtfpga.c| 9 - 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/hw/xtensa/bootparam.h b/hw/xtensa/bootparam.h index e839bee..955f4e8 100644 --- a/hw/xtensa/bootparam.h +++ b/hw/xtensa

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