Re: [Qemu-block] [PATCH v2 24/24] keyval: Support lists

2017-02-28 Thread Eric Blake
On 02/28/2017 03:27 PM, Markus Armbruster wrote: > Additionally permit non-negative integers as key components. A > dictionary's keys must either be all integers or none. If all keys > are integers, convert the dictionary to a list. The set of keys must > be [0,N]. > > +static void

Re: [Qemu-block] [Qemu-devel] [PATCH v2 24/24] keyval: Support lists

2017-02-28 Thread Kevin Wolf
Am 28.02.2017 um 23:11 hat Markus Armbruster geschrieben: > Kevin Wolf writes: > > > Am 28.02.2017 um 22:27 hat Markus Armbruster geschrieben: > >> Additionally permit non-negative integers as key components. A > >> dictionary's keys must either be all integers or none. If

Re: [Qemu-block] [Qemu-devel] [PATCH v2 24/24] keyval: Support lists

2017-02-28 Thread Markus Armbruster
Kevin Wolf writes: > Am 28.02.2017 um 22:27 hat Markus Armbruster geschrieben: >> Additionally permit non-negative integers as key components. A >> dictionary's keys must either be all integers or none. If all keys >> are integers, convert the dictionary to a list. The set

Re: [Qemu-block] [PATCH v2 21/24] block: Initial implementation of -blockdev

2017-02-28 Thread Kevin Wolf
Am 28.02.2017 um 22:27 hat Markus Armbruster geschrieben: > The new command line option -blockdev works like QMP command > blockdev-add. > > The option argument may be given in JSON syntax, exactly as in QMP. > Example usage: > > -blockdev '{"node-name": "foo", "driver": "raw", "file":

Re: [Qemu-block] [PATCH v2 18/24] qapi: New parse_qapi_name()

2017-02-28 Thread Kevin Wolf
Am 28.02.2017 um 22:27 hat Markus Armbruster geschrieben: > Signed-off-by: Markus Armbruster > Reviewed-by: Eric Blake Reviewed-by: Kevin Wolf

Re: [Qemu-block] [PATCH v2 03/24] keyval: New keyval_parse()

2017-02-28 Thread Kevin Wolf
Am 28.02.2017 um 22:26 hat Markus Armbruster geschrieben: > keyval_parse() parses KEY=VALUE,... into a QDict. Works like > qemu_opts_parse(), except: > > * Returns a QDict instead of a QemuOpts (d'oh). > > * Supports nesting, unlike QemuOpts: a KEY is split into key > fragments at '.' (dotted

Re: [Qemu-block] [PATCH v2 24/24] keyval: Support lists

2017-02-28 Thread Kevin Wolf
Am 28.02.2017 um 22:27 hat Markus Armbruster geschrieben: > Additionally permit non-negative integers as key components. A > dictionary's keys must either be all integers or none. If all keys > are integers, convert the dictionary to a list. The set of keys must > be [0,N]. > > Examples: > >

Re: [Qemu-block] [Qemu-devel] [PATCH v2 03/24] keyval: New keyval_parse()

2017-02-28 Thread Markus Armbruster
Eric Blake writes: > On 02/28/2017 03:26 PM, Markus Armbruster wrote: >> keyval_parse() parses KEY=VALUE,... into a QDict. Works like >> qemu_opts_parse(), except: >> >> * Returns a QDict instead of a QemuOpts (d'oh). >> >> * Supports nesting, unlike QemuOpts: a KEY is

Re: [Qemu-block] [PATCH v2 00/24] block: Command line option -blockdev

2017-02-28 Thread Markus Armbruster
Markus Armbruster writes: > Actually, the command line option is the least part of this series. > Its bulk is about building infrastructure and getting errors out of > the JSON parser[*]. The latter part could be spun out in its own > series, if that helps. We'll see. > >

Re: [Qemu-block] [PATCH v2 03/24] keyval: New keyval_parse()

2017-02-28 Thread Eric Blake
On 02/28/2017 03:26 PM, Markus Armbruster wrote: > keyval_parse() parses KEY=VALUE,... into a QDict. Works like > qemu_opts_parse(), except: > > * Returns a QDict instead of a QemuOpts (d'oh). > > * Supports nesting, unlike QemuOpts: a KEY is split into key > fragments at '.' (dotted key

[Qemu-block] [PATCH v2 24/24] keyval: Support lists

2017-02-28 Thread Markus Armbruster
Additionally permit non-negative integers as key components. A dictionary's keys must either be all integers or none. If all keys are integers, convert the dictionary to a list. The set of keys must be [0,N]. Examples: * list.1=goner,list.0=null,list.1=eins,list.2=zwei is equivalent to JSON

[Qemu-block] [PATCH v2 21/24] block: Initial implementation of -blockdev

2017-02-28 Thread Markus Armbruster
The new command line option -blockdev works like QMP command blockdev-add. The option argument may be given in JSON syntax, exactly as in QMP. Example usage: -blockdev '{"node-name": "foo", "driver": "raw", "file": {"driver": "file", "filename": "foo.img"} }' The JSON argument doesn't

[Qemu-block] [PATCH v2 20/24] qapi: New qobject_input_visitor_new_str() for convenience

2017-02-28 Thread Markus Armbruster
Signed-off-by: Markus Armbruster --- include/qapi/qobject-input-visitor.h | 12 qapi/qobject-input-visitor.c | 36 2 files changed, 48 insertions(+) diff --git a/include/qapi/qobject-input-visitor.h

[Qemu-block] [PATCH v2 12/24] qobject: Propagate parse errors through qobject_from_json()

2017-02-28 Thread Markus Armbruster
The next few commits will put the errors to use where appropriate. Signed-off-by: Markus Armbruster Reviewed-by: Kevin Wolf Reviewed-by: Eric Blake --- block.c| 2 +- include/qapi/qmp/qjson.h | 2

[Qemu-block] [PATCH v2 22/24] qapi: Improve how keyval input visitor reports unexpected dicts

2017-02-28 Thread Markus Armbruster
Incorrect option -blockdev node-name=foo,driver=file,filename=foo.img,aio.unmap=on is rejected with "Invalid parameter type for 'aio', expected: string". To make sense of this, you almost have to translate it into the equivalent QMP command { "execute": "blockdev-add", "arguments": {

[Qemu-block] [PATCH v2 04/24] qapi: qobject input visitor variant for use with keyval_parse()

2017-02-28 Thread Markus Armbruster
From: "Daniel P. Berrange" Currently the QObjectInputVisitor assumes that all scalar values are directly represented as the final types declared by the thing being visited. i.e. it assumes an 'int' is using QInt, and a 'bool' is using QBool, etc. This is good when

[Qemu-block] [PATCH v2 14/24] check-qjson: Test errors from qobject_from_json()

2017-02-28 Thread Markus Armbruster
Pass _abort with known-good input. Else pass and check what comes back. This demonstrates that the parser fails silently for many errors. Signed-off-by: Markus Armbruster Reviewed-by: Kevin Wolf --- tests/check-qjson.c | 88

[Qemu-block] [PATCH v2 00/24] block: Command line option -blockdev

2017-02-28 Thread Markus Armbruster
Actually, the command line option is the least part of this series. Its bulk is about building infrastructure and getting errors out of the JSON parser[*]. The latter part could be spun out in its own series, if that helps. We'll see. The design of the command line interface was discussed here:

[Qemu-block] [PATCH v2 16/24] monitor: Assert qmp_schema_json[] is sane

2017-02-28 Thread Markus Armbruster
qmp_query_qmp_schema() parses qmp_schema_json[] with qobject_from_json(). This must not fail, so pass _abort. Signed-off-by: Markus Armbruster Reviewed-by: Kevin Wolf --- monitor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[Qemu-block] [PATCH v2 23/24] docs/qapi-code-gen.txt: Clarify naming rules

2017-02-28 Thread Markus Armbruster
Signed-off-by: Markus Armbruster Reviewed-by: Kevin Wolf --- docs/qapi-code-gen.txt | 61 -- 1 file changed, 39 insertions(+), 22 deletions(-) diff --git a/docs/qapi-code-gen.txt b/docs/qapi-code-gen.txt index

[Qemu-block] [PATCH v2 07/24] qapi: Factor out common qobject_input_get_keyval()

2017-02-28 Thread Markus Armbruster
Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake --- qapi/qobject-input-visitor.c | 87 ++-- 1 file changed, 35 insertions(+), 52 deletions(-) diff --git a/qapi/qobject-input-visitor.c

[Qemu-block] [PATCH v2 06/24] qapi: Factor out common part of qobject input visitor creation

2017-02-28 Thread Markus Armbruster
Signed-off-by: Markus Armbruster Reviewed-by: Kevin Wolf --- qapi/qobject-input-visitor.c | 61 +++- 1 file changed, 26 insertions(+), 35 deletions(-) diff --git a/qapi/qobject-input-visitor.c

[Qemu-block] [PATCH v2 03/24] keyval: New keyval_parse()

2017-02-28 Thread Markus Armbruster
keyval_parse() parses KEY=VALUE,... into a QDict. Works like qemu_opts_parse(), except: * Returns a QDict instead of a QemuOpts (d'oh). * Supports nesting, unlike QemuOpts: a KEY is split into key fragments at '.' (dotted key convention; the block layer does something similar on top of

[Qemu-block] [PATCH v2 19/24] keyval: Restrict key components to valid QAPI names

2017-02-28 Thread Markus Armbruster
Restricting the key components to something sane leaves us room for evolving key syntax. Since they will be commonly used as QAPI member names by the QObject input visitor, we can just as well borrow the QAPI naming rules here. Signed-off-by: Markus Armbruster Reviewed-by:

[Qemu-block] [PATCH v2 13/24] block: More detailed syntax error reporting for JSON filenames

2017-02-28 Thread Markus Armbruster
Signed-off-by: Markus Armbruster Reviewed-by: Kevin Wolf --- block.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/block.c b/block.c index af1014f..ca15e93 100644 --- a/block.c +++ b/block.c @@ -1200,9 +1200,14 @@ static QDict

[Qemu-block] [PATCH v2 09/24] libqtest: Fix qmp() & friends to abort on JSON parse errors

2017-02-28 Thread Markus Armbruster
Signed-off-by: Markus Armbruster Reviewed-by: Kevin Wolf --- tests/libqtest.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/libqtest.c b/tests/libqtest.c index 683d5e3..bb444d5 100644 --- a/tests/libqtest.c +++

[Qemu-block] [PATCH v2 15/24] test-visitor-serialization: Pass _abort to qobject_from_json()

2017-02-28 Thread Markus Armbruster
qmp_deserialize() calls qobject_from_json() ignoring errors. It passes the result to qobject_input_visitor_new(), which asserts it's not null. Therefore, we can just as well pass _abort to qobject_from_json(). Signed-off-by: Markus Armbruster Reviewed-by: Kevin Wolf

[Qemu-block] [PATCH v2 10/24] qjson: Abort earlier on qobject_from_jsonf() misuse

2017-02-28 Thread Markus Armbruster
Ignoring errors first, then asserting success is suboptimal. Pass _abort instead, so we abort earlier, and hopefully get more useful clues on what's wrong. Signed-off-by: Markus Armbruster Reviewed-by: Kevin Wolf --- qobject/qjson.c | 2 +- 1 file changed,

[Qemu-block] [PATCH v2 02/24] tests: Fix gcov-files-test-qemu-opts-y, gcov-files-test-logging-y

2017-02-28 Thread Markus Armbruster
Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Reviewed-by: Kevin Wolf --- tests/Makefile.include | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Makefile.include b/tests/Makefile.include index

[Qemu-block] [PATCH v2 01/24] test-qemu-opts: Cover qemu_opts_parse() of "no"

2017-02-28 Thread Markus Armbruster
qemu_opts_parse() interprets "no" as negated empty key. Consistent with its acceptance of empty keys elsewhere, whatever that's worth. Signed-off-by: Markus Armbruster Reviewed-by: Kevin Wolf --- tests/test-qemu-opts.c | 5 + 1 file changed, 5

Re: [Qemu-block] [Qemu-devel] [PULL v2 0/5] Block patches for 2.9

2017-02-28 Thread Jeff Cody
On Tue, Feb 28, 2017 at 09:31:41AM -0800, no-re...@patchew.org wrote: > Hi, > > This series failed build test on s390x host. Please find the details below. > > Type: series > Subject: [Qemu-devel] [PULL v2 0/5] Block patches for 2.9 > Message-id: 20170228163436.31357-1-jc...@redhat.com > [...]

Re: [Qemu-block] [Qemu-devel] [PATCH 18/24] block: Initial implementation of -blockdev

2017-02-28 Thread Markus Armbruster
Kevin Wolf writes: > Am 27.02.2017 um 12:20 hat Markus Armbruster geschrieben: >> The new command line option -blockdev works like QMP command >> blockdev-add. >> >> The option argument may be given in JSON syntax, exactly as in QMP. >> Example usage: >> >> -blockdev

[Qemu-block] [PULL 45/46] block: Add Error parameter to bdrv_set_backing_hd()

2017-02-28 Thread Kevin Wolf
Not all callers of bdrv_set_backing_hd() know for sure that attaching the backing file will be allowed by the permission system. Return the error from the function rather than aborting. Signed-off-by: Kevin Wolf Acked-by: Fam Zheng Reviewed-by: Max Reitz

[Qemu-block] [PULL 36/46] mirror: Add filter-node-name to blockdev-mirror

2017-02-28 Thread Kevin Wolf
Management tools need to be able to know about every node in the graph and need a way to address them. Changing the graph structure was okay because libvirt doesn't really manage the node level yet, but future libvirt versions need to deal with both new and old version of qemu. This new option to

[Qemu-block] [PULL 43/46] block: Assertions for write permissions

2017-02-28 Thread Kevin Wolf
This adds assertions that ensure that the necessary write permissions have been granted before someone attempts to write to a node. Signed-off-by: Kevin Wolf Acked-by: Fam Zheng Reviewed-by: Max Reitz --- block/io.c | 3 +++ 1 file

[Qemu-block] [PULL 40/46] nbd/server: Use real permissions for NBD exports

2017-02-28 Thread Kevin Wolf
NBD can't cope with device size changes, so resize must be forbidden, but otherwise we can tolerate anything. Depending on whether the export is writable or not, we only require consistent reads and writes. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz

[Qemu-block] [PULL 39/46] migration/block: Use real permissions

2017-02-28 Thread Kevin Wolf
Request BLK_PERM_CONSISTENT_READ for the source of block migration, and handle potential permission errors as good as we can in this place (which is not very good, but it matches the other failure cases). Signed-off-by: Kevin Wolf Acked-by: Fam Zheng

[Qemu-block] [PULL 37/46] commit: Add filter-node-name to block-commit

2017-02-28 Thread Kevin Wolf
Management tools need to be able to know about every node in the graph and need a way to address them. Changing the graph structure was okay because libvirt doesn't really manage the node level yet, but future libvirt versions need to deal with both new and old version of qemu. This new option to

[Qemu-block] [PULL 34/46] mirror: Use real permissions in mirror/active commit block job

2017-02-28 Thread Kevin Wolf
The mirror block job is mainly used for two different scenarios: Mirroring to an otherwise unused, independent target node, or for active commit where the target node is part of the backing chain of the source. Similarly to the commit block job patch, we need to insert a new filter node to keep

[Qemu-block] [PULL 35/46] stream: Use real permissions in streaming block job

2017-02-28 Thread Kevin Wolf
The correct permissions are relatively obvious here (and explained in code comments). For intermediate streaming, we need to reopen the top node read-write before creating the job now because the permissions system catches attempts to get the BLK_PERM_WRITE_UNCHANGED permission on a read-only

[Qemu-block] [PULL 29/46] backup: Use real permissions in backup block job

2017-02-28 Thread Kevin Wolf
The backup block job doesn't have very complicated requirements: It needs to read from the source and write to the target, but it's fine with either side being changed. The only restriction is that we can't resize the image because the job uses a cached value. qemu-iotests 055 needs to be changed

[Qemu-block] [PULL 26/46] blockjob: Add permissions to block_job_add_bdrv()

2017-02-28 Thread Kevin Wolf
Block jobs don't actually do I/O through the the reference they create with block_job_add_bdrv(), but they might want to use the permisssion system to express what the block job does to intermediate nodes. This adds permissions to block_job_add_bdrv() to provide the means to request permissions.

[Qemu-block] [PULL 21/46] hw/block: Introduce share-rw qdev property

2017-02-28 Thread Kevin Wolf
By default, don't allow another writer for block devices that are attached to a guest device. For the cases where this setup is intended (e.g. using a cluster filesystem on the disk), the new option can be used to allow it. This change affects only devices using DEFINE_BLOCK_PROPERTIES(). Devices

[Qemu-block] [PULL 20/46] hw/block: Request permissions

2017-02-28 Thread Kevin Wolf
This makes all device emulations with a qdev drive property request permissions on their BlockBackend. The only thing we block at this point is resizing images for some devices that can't support it. Signed-off-by: Kevin Wolf Acked-by: Fam Zheng Reviewed-by:

[Qemu-block] [PULL 24/46] block: Include details on permission errors in message

2017-02-28 Thread Kevin Wolf
Instead of just telling that there was some conflict, we can be specific and tell which permissions were in conflict and which way the conflict is. Signed-off-by: Kevin Wolf Acked-by: Fam Zheng Reviewed-by: Max Reitz --- block.c | 67

[Qemu-block] [PULL 17/46] block: Add BDRV_O_RESIZE for blk_new_open()

2017-02-28 Thread Kevin Wolf
blk_new_open() is a convenience function that processes flags rather than QDict options as a simple way to just open an image file. In order to keep it convenient in the future, it must automatically request the necessary permissions. This can easily be inferred from the flags for read and write,

[Qemu-block] [PULL 32/46] block: Allow backing file links in change_parent_backing_link()

2017-02-28 Thread Kevin Wolf
Now that the backing file child role implements .attach/.detach callbacks, nothing prevents us from modifying the graph even if that involves changing backing file links. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz Acked-by: Fam Zheng

[Qemu-block] [PULL 33/46] blockjob: Factor out block_job_remove_all_bdrv()

2017-02-28 Thread Kevin Wolf
In some cases, we want to remove op blockers on intermediate nodes before the whole block job transaction has completed (because they block restoring the final graph state during completion). Provide a function for this. The whole block job lifecycle is a bit messed up and it's hard to actually

[Qemu-block] [PULL 46/46] block: Add Error parameter to bdrv_append()

2017-02-28 Thread Kevin Wolf
Aborting on error in bdrv_append() isn't correct. This patch fixes it and lets the callers handle failures. Test case 085 needs a reference output update. This is caused by the reversed order of bdrv_set_backing_hd() and change_parent_backing_link() in bdrv_append(): When the backing file of the

[Qemu-block] [PULL 41/46] tests: Remove FIXME comments

2017-02-28 Thread Kevin Wolf
Not requesting any permissions is actually correct for these test cases because no actual I/O or other operation covered by the permission system is performed. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz Acked-by: Fam Zheng ---

[Qemu-block] [PULL 27/46] commit: Use real permissions in commit block job

2017-02-28 Thread Kevin Wolf
This is probably one of the most interesting conversions to the new op blocker system because a commit block job intentionally leaves some intermediate block nodes in the backing chain that aren't valid on their own any more; only the whole chain together results in a valid view. In order to

[Qemu-block] [PULL 38/46] hmp: Request permissions in qemu-io

2017-02-28 Thread Kevin Wolf
The HMP command 'qemu-io' is a bit tricky because it wants to work on the original BlockBackend, but additional permissions could be required. The details are explained in a comment in the code, but in summary, just request whatever permissions the current qemu-io command needs. Signed-off-by:

[Qemu-block] [PULL 31/46] block: BdrvChildRole.attach/detach() callbacks

2017-02-28 Thread Kevin Wolf
Backing files are somewhat special compared to other kinds of children because they are attached and detached using bdrv_set_backing_hd() rather than the normal set of functions, which does a few more things like setting backing blockers, toggling the BDRV_O_NO_BACKING flag, setting

[Qemu-block] [PULL 19/46] block: Allow error return in BlockDevOps.change_media_cb()

2017-02-28 Thread Kevin Wolf
Some devices allow a media change between read-only and read-write media. They need to adapt the permissions in their .change_media_cb() implementation, which can fail. So add an Error parameter to the function. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz

[Qemu-block] [PULL 28/46] commit: Use real permissions for HMP 'commit'

2017-02-28 Thread Kevin Wolf
This is a little simpler than the commit block job because it's synchronous and only commits into the immediate backing file, but otherwise doing more or less the same. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz Acked-by: Fam Zheng

[Qemu-block] [PULL 23/46] block: Add BdrvChildRole.get_parent_desc()

2017-02-28 Thread Kevin Wolf
For meaningful error messages in the permission system, we need to get some human-readable description of the parent of a BdrvChild. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz Acked-by: Fam Zheng --- block.c | 9

[Qemu-block] [PULL 22/46] blockjob: Add permissions to block_job_create()

2017-02-28 Thread Kevin Wolf
This functions creates a BlockBackend internally, so the block jobs need to tell it what they want to do with the BB. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz Acked-by: Fam Zheng --- block/backup.c | 5 +++--

[Qemu-block] [PULL 15/46] block: Add permissions to blk_new()

2017-02-28 Thread Kevin Wolf
We want every user to be specific about the permissions it needs, so we'll pass the initial permissions as parameters to blk_new(). A user only needs to call blk_set_perm() if it wants to change the permissions after the fact. The permissions are stored in the BlockBackend and applied whenever a

[Qemu-block] [PULL 14/46] block: Add permissions to BlockBackend

2017-02-28 Thread Kevin Wolf
The BlockBackend can now store the permissions that its user requires. This is necessary because nodes can be ejected from or inserted into a BlockBackend and all of these operations must make sure that the user still gets what it requested initially. Signed-off-by: Kevin Wolf

[Qemu-block] [PULL 18/46] block: Request real permissions in blk_new_open()

2017-02-28 Thread Kevin Wolf
We can figure out the necessary permissions from the flags that the caller passed. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz Acked-by: Fam Zheng --- block/block-backend.c | 22 +++--- 1 file changed, 19

[Qemu-block] [PULL 08/46] block: Request child permissions in filter drivers

2017-02-28 Thread Kevin Wolf
All callers will have to request permissions for all of their child nodes. Block drivers that act as simply filters can use the default implementation of .bdrv_child_perm(). Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz Acked-by: Fam Zheng

[Qemu-block] [PULL 13/46] block: Request real permissions in bdrv_attach_child()

2017-02-28 Thread Kevin Wolf
Now that all block drivers with children tell us what permissions they need from each of their children, bdrv_attach_child() can use this information and make the right requirements while trying to attach new children. Signed-off-by: Kevin Wolf Acked-by: Fam Zheng

[Qemu-block] [PULL 07/46] block: Default .bdrv_child_perm() for filter drivers

2017-02-28 Thread Kevin Wolf
Most filters need permissions related to read and write for their children, but only if the node has a parent that wants to use the same operation on the filter. The same is true for resize. This adds a default implementation that simply forwards all necessary permissions to all children of the

[Qemu-block] [PULL 11/46] vvfat: Implement .bdrv_child_perm()

2017-02-28 Thread Kevin Wolf
vvfat is the last remaining driver that can have children, but doesn't implement .bdrv_child_perm() yet. The default handlers aren't suitable here, so let's implement a very simple driver-specific one that protects the internal child from being used by other users as good as our permissions

[Qemu-block] [PULL 16/46] block: Add error parameter to blk_insert_bs()

2017-02-28 Thread Kevin Wolf
Now that blk_insert_bs() requests the BlockBackend permissions for the node it attaches to, it can fail. Instead of aborting, pass the errors to the callers. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz Acked-by: Fam Zheng --- block.c

[Qemu-block] [PULL 04/46] block: Add Error argument to bdrv_attach_child()

2017-02-28 Thread Kevin Wolf
It will have to return an error soon, so prepare the callers for it. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz Acked-by: Fam Zheng --- block.c | 16 +--- block/quorum.c| 9 -

[Qemu-block] [PULL 09/46] block: Default .bdrv_child_perm() for format drivers

2017-02-28 Thread Kevin Wolf
Almost all format drivers have the same characteristics as far as permissions are concerned: They have one or more children for storing their own data and, more importantly, metadata (can be written to and grow even without external write requests, must be protected against other writers and

[Qemu-block] [PULL 12/46] block: Require .bdrv_child_perm() with child nodes

2017-02-28 Thread Kevin Wolf
All block drivers that can have child nodes implement .bdrv_child_perm() now. Make this officially a requirement by asserting that only drivers without children can omit .bdrv_child_perm(). Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz Acked-by: Fam Zheng

[Qemu-block] [PULL 05/46] block: Let callers request permissions when attaching a child node

2017-02-28 Thread Kevin Wolf
When attaching a node as a child to a new parent, the required and shared permissions for this parent are checked against all other parents of the node now, and an error is returned if there is a conflict. This allows error returns to a function that previously always succeeded, and the same is

[Qemu-block] [PULL 02/46] option: Tweak invalid size error message and unbreak iotest 049

2017-02-28 Thread Kevin Wolf
From: Markus Armbruster Commit 75cdcd1 neglected to update tests/qemu-iotests/049.out, and made the error message for negative size worse. Fix that. Reported-by: Thomas Huth Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake

[Qemu-block] [PULL 06/46] block: Involve block drivers in permission granting

2017-02-28 Thread Kevin Wolf
In many cases, the required permissions of one node on its children depend on what its parents require from it. For example, the raw format or most filter drivers only need to request consistent reads if that's something that one of their parents wants. In order to achieve this, this patch

[Qemu-block] [PULL 01/46] qemu-img: make convert async

2017-02-28 Thread Kevin Wolf
From: Peter Lieven the convert process is currently completely implemented with sync operations. That means it reads one buffer and then writes it. No parallelism and each sync request takes as long as it takes until it is completed. This can be a big performance hit when the

[Qemu-block] [PULL 03/46] block: Add op blocker permission constants

2017-02-28 Thread Kevin Wolf
This patch defines the permission categories that will be used by the new op blocker system. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz Acked-by: Fam Zheng --- include/block/block.h | 36 1 file

[Qemu-block] [PULL 00/46] Block layer patches

2017-02-28 Thread Kevin Wolf
The following changes since commit 9514f2648ca05b38e852b490a12b8cd98d5808c1: Merge remote-tracking branch 'remotes/gkurz/tags/for-upstream' into staging (2017-02-28 17:39:49 +) are available in the git repository at: git://repo.or.cz/qemu/kevin.git tags/for-upstream for you to fetch

Re: [Qemu-block] [PATCH 24/24] keyval: Support lists

2017-02-28 Thread Eric Blake
On 02/28/2017 01:25 PM, Kevin Wolf wrote: > Am 27.02.2017 um 12:20 hat Markus Armbruster geschrieben: >> Additionally permit non-negative integers as key components. A >> dictionary's keys must either be all integers or none. If all keys >> are integers, convert the dictionary to a list. The

Re: [Qemu-block] [Qemu-devel] [PATCH 24/24] keyval: Support lists

2017-02-28 Thread Markus Armbruster
Kevin Wolf writes: > Am 27.02.2017 um 12:20 hat Markus Armbruster geschrieben: >> Additionally permit non-negative integers as key components. A >> dictionary's keys must either be all integers or none. If all keys >> are integers, convert the dictionary to a list. The set

Re: [Qemu-block] [PATCH 18/24] block: Initial implementation of -blockdev

2017-02-28 Thread Kevin Wolf
Am 27.02.2017 um 12:20 hat Markus Armbruster geschrieben: > The new command line option -blockdev works like QMP command > blockdev-add. > > The option argument may be given in JSON syntax, exactly as in QMP. > Example usage: > > -blockdev '{"node-name": "foo", "driver": "raw", "file":

Re: [Qemu-block] [Qemu-devel] [PATCH 14/24] check-qjson: Test errors from qobject_from_json()

2017-02-28 Thread Markus Armbruster
Eric Blake writes: > On 02/27/2017 05:20 AM, Markus Armbruster wrote: >> Pass _abort with known-good input. Else pass and check >> what comes back. This demonstrates that the parser fails silently for >> many errors. >> >> Signed-off-by: Markus Armbruster

Re: [Qemu-block] [Qemu-devel] [PATCH 12/24] qobject: Propagate parse errors through qobject_from_json()

2017-02-28 Thread Markus Armbruster
Eric Blake writes: > On 02/27/2017 05:20 AM, Markus Armbruster wrote: >> Signed-off-by: Markus Armbruster >> --- >> block.c| 2 +- >> include/qapi/qmp/qjson.h | 5 +-- >> monitor.c | 2 +- >>

Re: [Qemu-block] [PATCH 22/24] qapi: New parse_qapi_name()

2017-02-28 Thread Eric Blake
On 02/27/2017 05:20 AM, Markus Armbruster wrote: > Signed-off-by: Markus Armbruster > --- > include/qapi/util.h| 2 ++ > qapi/qapi-util.c | 47 +++ > tests/test-qapi-util.c | 34 ++ > 3

Re: [Qemu-block] [PATCH 18/24] block: Initial implementation of -blockdev

2017-02-28 Thread Eric Blake
On 02/27/2017 05:20 AM, Markus Armbruster wrote: > The new command line option -blockdev works like QMP command > blockdev-add. > > The option argument may be given in JSON syntax, exactly as in QMP. > Example usage: > > -blockdev '{"node-name": "foo", "driver": "raw", "file": {"driver": >

[Qemu-block] [PATCH v4] backup: allow target without .bdrv_get_info

2017-02-28 Thread Vladimir Sementsov-Ogievskiy
Currently backup to nbd target is broken, as nbd doesn't have .bdrv_get_info realization. Signed-off-by: Vladimir Sementsov-Ogievskiy --- v4: use error_report() add article v3: fix compilation (I feel like an idiot) adjust wording (Fam) v2: add WARNING

Re: [Qemu-block] [Qemu-devel] [PATCH 17/24] qapi: New qobject_input_visitor_new_str() for convenience

2017-02-28 Thread Kevin Wolf
Am 28.02.2017 um 19:48 hat Markus Armbruster geschrieben: > Kevin Wolf writes: > > > Am 27.02.2017 um 12:20 hat Markus Armbruster geschrieben: > >> Signed-off-by: Markus Armbruster > >> --- > >> include/qapi/qobject-input-visitor.h | 12 > >>

Re: [Qemu-block] [PATCH 24/24] keyval: Support lists

2017-02-28 Thread Kevin Wolf
Am 27.02.2017 um 12:20 hat Markus Armbruster geschrieben: > Additionally permit non-negative integers as key components. A > dictionary's keys must either be all integers or none. If all keys > are integers, convert the dictionary to a list. The set of keys must > be [0,N]. > > Examples: > >

Re: [Qemu-block] [PATCH 12/24] qobject: Propagate parse errors through qobject_from_json()

2017-02-28 Thread Eric Blake
On 02/27/2017 05:20 AM, Markus Armbruster wrote: > Signed-off-by: Markus Armbruster > --- > block.c| 2 +- > include/qapi/qmp/qjson.h | 5 +-- > monitor.c | 2 +- > qobject/qjson.c| 4 +-- >

Re: [Qemu-block] [PATCH 14/24] check-qjson: Test errors from qobject_from_json()

2017-02-28 Thread Eric Blake
On 02/27/2017 05:20 AM, Markus Armbruster wrote: > Pass _abort with known-good input. Else pass and check > what comes back. This demonstrates that the parser fails silently for > many errors. > > Signed-off-by: Markus Armbruster > --- > tests/check-qjson.c | 88 >

Re: [Qemu-block] [Qemu-devel] [PATCH 03/24] keyval: New keyval_parse()

2017-02-28 Thread Markus Armbruster
Eric Blake writes: > On 02/28/2017 12:03 PM, Markus Armbruster wrote: >> Eric Blake writes: >> >>> On 02/28/2017 09:48 AM, Kevin Wolf wrote: Am 27.02.2017 um 12:20 hat Markus Armbruster geschrieben: > keyval_parse() parses KEY=VALUE,... into a

Re: [Qemu-block] [Qemu-devel] [PATCH 22/24] qapi: New parse_qapi_name()

2017-02-28 Thread Markus Armbruster
Kevin Wolf writes: > Am 27.02.2017 um 12:20 hat Markus Armbruster geschrieben: >> Signed-off-by: Markus Armbruster >> --- >> include/qapi/util.h| 2 ++ >> qapi/qapi-util.c | 47 +++ >>

Re: [Qemu-block] [Qemu-devel] [PATCH 19/24] qapi: Improve how keyval input visitor reports unexpected dicts

2017-02-28 Thread Markus Armbruster
Kevin Wolf writes: > Am 27.02.2017 um 12:20 hat Markus Armbruster geschrieben: >> Incorrect option >> >> -blockdev node-name=foo,driver=file,filename=foo.img,aio.unmap >> >> is rejected with "Invalid parameter type for 'aio', expected: string". >> To make sense of this,

Re: [Qemu-block] [Qemu-devel] [PATCH 03/24] keyval: New keyval_parse()

2017-02-28 Thread Eric Blake
On 02/28/2017 12:03 PM, Markus Armbruster wrote: > Eric Blake writes: > >> On 02/28/2017 09:48 AM, Kevin Wolf wrote: >>> Am 27.02.2017 um 12:20 hat Markus Armbruster geschrieben: keyval_parse() parses KEY=VALUE,... into a QDict. Works like qemu_opts_parse(), except:

Re: [Qemu-block] [Qemu-devel] [PATCH 17/24] qapi: New qobject_input_visitor_new_str() for convenience

2017-02-28 Thread Markus Armbruster
Kevin Wolf writes: > Am 27.02.2017 um 12:20 hat Markus Armbruster geschrieben: >> Signed-off-by: Markus Armbruster >> --- >> include/qapi/qobject-input-visitor.h | 12 >> qapi/qobject-input-visitor.c | 33

Re: [Qemu-block] [PATCH 23/24] keyval: Restrict key components to valid QAPI names

2017-02-28 Thread Kevin Wolf
Am 27.02.2017 um 12:20 hat Markus Armbruster geschrieben: > Restricting the key components to something sane leaves us room for > evolving key syntax. Since they will be commonly used as QAPI member > names by the QObject input visitor, we can just as well borrow the > QAPI naming rules here. >

Re: [Qemu-block] [Qemu-devel] [PATCH 09/24] libqtest: Fix qmp() & friends to abort on JSON parse errors

2017-02-28 Thread Markus Armbruster
Kevin Wolf writes: > Am 27.02.2017 um 12:20 hat Markus Armbruster geschrieben: >> Signed-off-by: Markus Armbruster > > Aha, I was just too quick! :-) I'll add something to the previous commit's message. > Reviewed-by: Kevin Wolf Thanks!

Re: [Qemu-block] [PATCH 22/24] qapi: New parse_qapi_name()

2017-02-28 Thread Kevin Wolf
Am 27.02.2017 um 12:20 hat Markus Armbruster geschrieben: > Signed-off-by: Markus Armbruster > --- > include/qapi/util.h| 2 ++ > qapi/qapi-util.c | 47 +++ > tests/test-qapi-util.c | 34 ++

Re: [Qemu-block] [PATCH 20/24] docs/qapi-code-gen.txt: Clarify naming rules

2017-02-28 Thread Kevin Wolf
Am 27.02.2017 um 12:20 hat Markus Armbruster geschrieben: > Signed-off-by: Markus Armbruster Reviewed-by: Kevin Wolf

Re: [Qemu-block] [PATCH 21/24] test-qapi-util: New, covering qapi/qapi-util.c

2017-02-28 Thread Kevin Wolf
Am 27.02.2017 um 12:20 hat Markus Armbruster geschrieben: > Signed-off-by: Markus Armbruster Reviewed-by: Kevin Wolf

Re: [Qemu-block] [PATCH 19/24] qapi: Improve how keyval input visitor reports unexpected dicts

2017-02-28 Thread Kevin Wolf
Am 27.02.2017 um 12:20 hat Markus Armbruster geschrieben: > Incorrect option > > -blockdev node-name=foo,driver=file,filename=foo.img,aio.unmap > > is rejected with "Invalid parameter type for 'aio', expected: string". > To make sense of this, you almost have to translate it into the >

Re: [Qemu-block] [PATCH 17/24] qapi: New qobject_input_visitor_new_str() for convenience

2017-02-28 Thread Kevin Wolf
Am 27.02.2017 um 12:20 hat Markus Armbruster geschrieben: > Signed-off-by: Markus Armbruster > --- > include/qapi/qobject-input-visitor.h | 12 > qapi/qobject-input-visitor.c | 33 + > 2 files changed, 45 insertions(+) > >

Re: [Qemu-block] [PATCH 17/24] qapi: New qobject_input_visitor_new_str() for convenience

2017-02-28 Thread Kevin Wolf
Am 27.02.2017 um 12:20 hat Markus Armbruster geschrieben: > Signed-off-by: Markus Armbruster > --- > include/qapi/qobject-input-visitor.h | 12 > qapi/qobject-input-visitor.c | 33 + > 2 files changed, 45 insertions(+) > >

Re: [Qemu-block] [PATCH 16/24] monitor: Assert qmp_schema_json[] is sane

2017-02-28 Thread Kevin Wolf
Am 27.02.2017 um 12:20 hat Markus Armbruster geschrieben: > qmp_query_qmp_schema() parses qmp_schema_json[] with > qobject_from_json(). This must not fail, so pass _abort. > > Signed-off-by: Markus Armbruster Reviewed-by: Kevin Wolf

  1   2   3   >