Branch: refs/heads/master Home: https://github.com/qemu/qemu Commit: 3688d8c717927e7ecaa8c260bc9cc706e3dbef7e https://github.com/qemu/qemu/commit/3688d8c717927e7ecaa8c260bc9cc706e3dbef7e Author: Marc-André Lureau <marcandre.lur...@redhat.com> Date: 2016-09-19 (Mon, 19 Sep 2016)
Changed paths: M qmp.c M scripts/create_config Log Message: ----------- build-sys: define QEMU_VERSION_{MAJOR, MINOR, MICRO} There are better chances to find what went wrong at build time than a later assert in qmp_query_version Signed-off-by: Marc-André Lureau <marcandre.lur...@redhat.com> Message-Id: <20160912091913.15831-2-marcandre.lur...@redhat.com> Reviewed-by: Markus Armbruster <arm...@redhat.com> Signed-off-by: Markus Armbruster <arm...@redhat.com> Commit: 119ebac1feb26181cbadd13a8a795a199d0bbaa6 https://github.com/qemu/qemu/commit/119ebac1feb26181cbadd13a8a795a199d0bbaa6 Author: Marc-André Lureau <marcandre.lur...@redhat.com> Date: 2016-09-19 (Mon, 19 Sep 2016) Changed paths: M monitor.c M qapi-schema.json M qmp-commands.hx Log Message: ----------- qapi-schema: use generated marshaller for 'qmp_capabilities' qapi'fy the 'qmp_capabilities' command, makes the command visible in query-qmp-schema. Signed-off-by: Marc-André Lureau <marcandre.lur...@redhat.com> Reviewed-by: Eric Blake <ebl...@redhat.com> Reviewed-by: Markus Armbruster <arm...@redhat.com> Message-Id: <20160912091913.15831-3-marcandre.lur...@redhat.com> Signed-off-by: Markus Armbruster <arm...@redhat.com> Commit: 94cfd07f26ef240499f3a4a7a14a4bcc17b8f003 https://github.com/qemu/qemu/commit/94cfd07f26ef240499f3a4a7a14a4bcc17b8f003 Author: Marc-André Lureau <marcandre.lur...@redhat.com> Date: 2016-09-19 (Mon, 19 Sep 2016) Changed paths: M qapi-schema.json Log Message: ----------- qapi-schema: add 'device_add' Even though device_add is not fully qapi'fied, we may add it to the json schema with 'gen': false, so registration and documentation can be generated. Signed-off-by: Marc-André Lureau <marcandre.lur...@redhat.com> Reviewed-by: Eric Blake <ebl...@redhat.com> Message-Id: <20160912091913.15831-4-marcandre.lur...@redhat.com> Reviewed-by: Markus Armbruster <arm...@redhat.com> Signed-off-by: Markus Armbruster <arm...@redhat.com> Commit: d79bedfa404a02a4652cc8d964fa6dc9b7ec62f7 https://github.com/qemu/qemu/commit/d79bedfa404a02a4652cc8d964fa6dc9b7ec62f7 Author: Marc-André Lureau <marcandre.lur...@redhat.com> Date: 2016-09-19 (Mon, 19 Sep 2016) Changed paths: M monitor.c Log Message: ----------- monitor: simplify invalid_qmp_mode() handle_qmp_command() will switch to use qmp_dispatch(). It won't have a pointer to the marshaller function anymore, but only the name of the command to invoke. Simplify invalid_qmp_mode() so it can just be called with the command name. Signed-off-by: Marc-André Lureau <marcandre.lur...@redhat.com> Reviewed-by: Eric Blake <ebl...@redhat.com> Message-Id: <20160912091913.15831-5-marcandre.lur...@redhat.com> Reviewed-by: Markus Armbruster <arm...@redhat.com> Signed-off-by: Markus Armbruster <arm...@redhat.com> Commit: edcfaefe07e242f204d476a8f2290895593eb09f https://github.com/qemu/qemu/commit/edcfaefe07e242f204d476a8f2290895593eb09f Author: Marc-André Lureau <marcandre.lur...@redhat.com> Date: 2016-09-19 (Mon, 19 Sep 2016) Changed paths: M monitor.c Log Message: ----------- monitor: register gen:false commands manually Since a few commands are using 'gen': false, they are not registered automatically by the generator. Register manually instead. This is in preparation for removal of qapi 'middle' mode generation. Note that qmp_init_marshal() function isn't run yet, so the commands aren't actually registered, until module_call_init(MODULE_INIT_QAPI) is added in a later patch. Signed-off-by: Marc-André Lureau <marcandre.lur...@redhat.com> Reviewed-by: Eric Blake <ebl...@redhat.com> Message-Id: <20160912091913.15831-6-marcandre.lur...@redhat.com> Reviewed-by: Markus Armbruster <arm...@redhat.com> Signed-off-by: Markus Armbruster <arm...@redhat.com> Commit: 60b03e4e6ac6eee3acac3c3173180f43adc6ddd5 https://github.com/qemu/qemu/commit/60b03e4e6ac6eee3acac3c3173180f43adc6ddd5 Author: Markus Armbruster <arm...@redhat.com> Date: 2016-09-19 (Mon, 19 Sep 2016) Changed paths: M include/qapi/qmp/dispatch.h M qapi/qmp-registry.c Log Message: ----------- qapi: Support unregistering QMP commands Signed-off-by: Markus Armbruster <arm...@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lur...@redhat.com> Message-Id: <20160912091913.15831-7-marcandre.lur...@redhat.com> Commit: 5032a16d1d44cc805ea0240903dc8dc98294da1f https://github.com/qemu/qemu/commit/5032a16d1d44cc805ea0240903dc8dc98294da1f Author: Marc-André Lureau <marcandre.lur...@redhat.com> Date: 2016-09-19 (Mon, 19 Sep 2016) Changed paths: M monitor.c Log Message: ----------- qmp: Hack to keep commands configuration-specific We currently define QMP commands in two places: the QAPI schema and qmp-commands.hx. The latter is preprocessed, the former is not. We use the preprocessor to suppress configuration-specific commands. For instance, query-spice is only available #ifdef CONFIG_SPICE. QMP command dispatch and query-commands use the qmp-commands.hx definition, and thus obey the #ifdeffery there. Good, because it lets QMP clients probe for available features more easily. query-qmp-schema uses the QAPI schema, and thus lists the configuration-specific commands even when they're unavailable. Not so good. We're about to flip command dispatch and query-commands to the non-middle-mode command registry, which uses the QAPI schema, so we can ditch qmp-commands.hx. To avoid regressing query-commands, arrange for commands that are suppressed with the preprocessor now to be unregistered with that registry. This will keep them unavailable and out of query-commands when we flip command dispatch and query-commands to that registry, exactly as before. This is a hack. The proper solution is to support configuration-specific commands in the QAPI schema. Mark it FIXME. Signed-off-by: Marc-André Lureau <marcandre.lur...@redhat.com> Signed-off-by: Markus Armbruster <arm...@redhat.com> Message-Id: <20160912091913.15831-8-marcandre.lur...@redhat.com> Commit: b804dc3bcddce6d0cd58e3c66cb0ee5b282b9e14 https://github.com/qemu/qemu/commit/b804dc3bcddce6d0cd58e3c66cb0ee5b282b9e14 Author: Marc-André Lureau <marcandre.lur...@redhat.com> Date: 2016-09-19 (Mon, 19 Sep 2016) Changed paths: M scripts/qapi-commands.py Log Message: ----------- qapi: export the marshallers Make it possible to call marshallers manually, without going through qmp_dispatch(). (this is currently only possible in middle-mode, but it's also useful in general) Signed-off-by: Marc-André Lureau <marcandre.lur...@redhat.com> Message-Id: <20160912091913.15831-9-marcandre.lur...@redhat.com> Reviewed-by: Markus Armbruster <arm...@redhat.com> Signed-off-by: Markus Armbruster <arm...@redhat.com> Commit: c823501ea9bf7b13ca32226e1c628480edb034d6 https://github.com/qemu/qemu/commit/c823501ea9bf7b13ca32226e1c628480edb034d6 Author: Marc-André Lureau <marcandre.lur...@redhat.com> Date: 2016-09-19 (Mon, 19 Sep 2016) Changed paths: M Makefile M docs/writing-qmp-commands.txt M monitor.c M qmp-commands.hx M vl.c Log Message: ----------- monitor: use qmp_find_command() (using generated qapi code) Stop using the so-called 'middle' mode. Instead, use qmp_find_command() from generated qapi commands registry. Update and fix the documentation too. Signed-off-by: Marc-André Lureau <marcandre.lur...@redhat.com> Message-Id: <20160912091913.15831-10-marcandre.lur...@redhat.com> Reviewed-by: Markus Armbruster <arm...@redhat.com> Signed-off-by: Markus Armbruster <arm...@redhat.com> Commit: 9e812b6adc6d9efe640fabeb9f5edee8248fdac9 https://github.com/qemu/qemu/commit/9e812b6adc6d9efe640fabeb9f5edee8248fdac9 Author: Marc-André Lureau <marcandre.lur...@redhat.com> Date: 2016-09-19 (Mon, 19 Sep 2016) Changed paths: M monitor.c Log Message: ----------- monitor: implement 'qmp_query_commands' without qmp_cmds One step towards getting rid of the static qmp_cmds table. Signed-off-by: Marc-André Lureau <marcandre.lur...@redhat.com> Reviewed-by: Eric Blake <ebl...@redhat.com> Message-Id: <20160912091913.15831-11-marcandre.lur...@redhat.com> Reviewed-by: Markus Armbruster <arm...@redhat.com> Signed-off-by: Markus Armbruster <arm...@redhat.com> Commit: 2b9e35760a8ff5548f6789d048c6e6e3c22c70ee https://github.com/qemu/qemu/commit/2b9e35760a8ff5548f6789d048c6e6e3c22c70ee Author: Marc-André Lureau <marcandre.lur...@redhat.com> Date: 2016-09-19 (Mon, 19 Sep 2016) Changed paths: M docs/writing-qmp-commands.txt M hmp-commands-info.hx M hmp-commands.hx M monitor.c Log Message: ----------- monitor: remove mhandler.cmd_new This is no longer necessary now that we aren't using middle mode anymore. Signed-off-by: Marc-André Lureau <marcandre.lur...@redhat.com> Reviewed-by: Eric Blake <ebl...@redhat.com> Message-Id: <20160912091913.15831-12-marcandre.lur...@redhat.com> Reviewed-by: Markus Armbruster <arm...@redhat.com> Signed-off-by: Markus Armbruster <arm...@redhat.com> Commit: 077b009ebb98c45ac1a88332e2ddb99a88cc09cd https://github.com/qemu/qemu/commit/077b009ebb98c45ac1a88332e2ddb99a88cc09cd Author: Marc-André Lureau <marcandre.lur...@redhat.com> Date: 2016-09-19 (Mon, 19 Sep 2016) Changed paths: M scripts/qapi-commands.py Log Message: ----------- qapi: remove the "middle" mode Now that the register function is always generated, we can remove the so-called "middle" mode from the generator script. Signed-off-by: Marc-André Lureau <marcandre.lur...@redhat.com> Message-Id: <20160912091913.15831-13-marcandre.lur...@redhat.com> Reviewed-by: Markus Armbruster <arm...@redhat.com> Signed-off-by: Markus Armbruster <arm...@redhat.com> Commit: a0067da1577e3eb0c60758384282568f4b2328fe https://github.com/qemu/qemu/commit/a0067da1577e3eb0c60758384282568f4b2328fe Author: Marc-André Lureau <marcandre.lur...@redhat.com> Date: 2016-09-19 (Mon, 19 Sep 2016) Changed paths: M scripts/qapi-commands.py M tests/test-qmp-commands.c Log Message: ----------- qapi: check invalid arguments on no-args commands The generated marshal functions do not visit arguments from commands that take no arguments. Thus they fail to catch invalid members. Visit the arguments, if provided, to throw an error in case of invalid members. Currently, qmp_check_client_args() checks for invalid arguments and correctly catches this case. When switching to qmp_dispatch() we want to keep that behaviour. The commands using 'O' may have arbitrary arguments, and must have 'gen': false in the qapi schema to skip the generated checks. Old/new diff: void qmp_marshal_stop(QDict *args, QObject **ret, Error **errp) { Error *err = NULL; + Visitor *v = NULL; - (void)args; + if (args) { + v = qmp_input_visitor_new(QOBJECT(args), true); + visit_start_struct(v, NULL, NULL, 0, &err); + if (err) { + goto out; + } + + if (!err) { + visit_check_struct(v, &err); + } + visit_end_struct(v, NULL); + if (err) { + goto out; + } + } qmp_stop(&err); + +out: error_propagate(errp, err); + visit_free(v); + if (args) { + v = qapi_dealloc_visitor_new(); + visit_start_struct(v, NULL, NULL, 0, NULL); + + visit_end_struct(v, NULL); + visit_free(v); + } } The new code closely resembles code for a command with arguments. Differences: - the visit of the argument and its cleanup struct don't visit any members (because there are none). - the visit of the argument struct and its cleanup are conditional. Signed-off-by: Marc-André Lureau <marcandre.lur...@redhat.com> Message-Id: <20160912091913.15831-14-marcandre.lur...@redhat.com> Reviewed-by: Markus Armbruster <arm...@redhat.com> Signed-off-by: Markus Armbruster <arm...@redhat.com> Commit: 4bdadd86718c901fc1a512a7e3e0cbe7518cf277 https://github.com/qemu/qemu/commit/4bdadd86718c901fc1a512a7e3e0cbe7518cf277 Author: Marc-André Lureau <marcandre.lur...@redhat.com> Date: 2016-09-19 (Mon, 19 Sep 2016) Changed paths: M tests/test-qga.c Log Message: ----------- tests: add a test to check invalid args Check that invalid args on commands without arguments returns an error. Signed-off-by: Marc-André Lureau <marcandre.lur...@redhat.com> Message-Id: <20160912091913.15831-15-marcandre.lur...@redhat.com> Reviewed-by: Markus Armbruster <arm...@redhat.com> Signed-off-by: Markus Armbruster <arm...@redhat.com> Commit: 5c678ee8d9406b9baeec788530965483575db555 https://github.com/qemu/qemu/commit/5c678ee8d9406b9baeec788530965483575db555 Author: Marc-André Lureau <marcandre.lur...@redhat.com> Date: 2016-09-19 (Mon, 19 Sep 2016) Changed paths: M monitor.c M trace-events Log Message: ----------- monitor: use qmp_dispatch() Replace the old manual dispatch and validation code by the generic one provided by qapi common code. Note that it is now possible to call the following commands that used to be disabled by compile-time conditionals: - dump-skeys - query-spice - rtc-reset-reinjection - query-gic-capabilities Their fallback functions return an appropriate "feature disabled" error. Signed-off-by: Marc-André Lureau <marcandre.lur...@redhat.com> Message-Id: <20160912091913.15831-16-marcandre.lur...@redhat.com> Reviewed-by: Markus Armbruster <arm...@redhat.com> Signed-off-by: Markus Armbruster <arm...@redhat.com> Commit: 842894994e089d3d8fc2cedd4679f1367b761212 https://github.com/qemu/qemu/commit/842894994e089d3d8fc2cedd4679f1367b761212 Author: Marc-André Lureau <marcandre.lur...@redhat.com> Date: 2016-09-19 (Mon, 19 Sep 2016) Changed paths: M Makefile.target Log Message: ----------- build-sys: remove qmp-commands-old.h Signed-off-by: Marc-André Lureau <marcandre.lur...@redhat.com> Reviewed-by: Eric Blake <ebl...@redhat.com> Message-Id: <20160912091913.15831-17-marcandre.lur...@redhat.com> Reviewed-by: Markus Armbruster <arm...@redhat.com> Signed-off-by: Markus Armbruster <arm...@redhat.com> Commit: bdf05133233faa11899738d5c90c7b78d145682b https://github.com/qemu/qemu/commit/bdf05133233faa11899738d5c90c7b78d145682b Author: Marc-André Lureau <marcandre.lur...@redhat.com> Date: 2016-09-19 (Mon, 19 Sep 2016) Changed paths: M qmp-commands.hx Log Message: ----------- qmp-commands.hx: fix some styling Add some missing lines, remove superflous @ in command name, remove trailing spaces. Signed-off-by: Marc-André Lureau <marcandre.lur...@redhat.com> Message-Id: <20160912091913.15831-18-marcandre.lur...@redhat.com> Reviewed-by: Markus Armbruster <arm...@redhat.com> Signed-off-by: Markus Armbruster <arm...@redhat.com> Commit: bd6092e407a5d682fbfddcbc510038b84bc1a1aa https://github.com/qemu/qemu/commit/bd6092e407a5d682fbfddcbc510038b84bc1a1aa Author: Marc-André Lureau <marcandre.lur...@redhat.com> Date: 2016-09-19 (Mon, 19 Sep 2016) Changed paths: M .gitignore M MAINTAINERS M Makefile M docs/qapi-code-gen.txt A docs/qmp-commands.txt M docs/writing-qmp-commands.txt R qmp-commands.hx Log Message: ----------- Replace qmp-commands.hx by docs/qmp-commands.txt The only remaining function of qmp-commands.hx is to let us generate qmp-commands.txt from it. Replace qmp-commands.hx by qmp-commands.txt. We intend to move the documentation into the QAPI schema and generate qapi-commands.txt from it, but not right now. Signed-off-by: Marc-André Lureau <marcandre.lur...@redhat.com> Message-Id: <20160912091913.15831-19-marcandre.lur...@redhat.com> Reviewed-by: Markus Armbruster <arm...@redhat.com> Signed-off-by: Markus Armbruster <arm...@redhat.com> Commit: 33e1666b4289313306371fee0740f5c85517e406 https://github.com/qemu/qemu/commit/33e1666b4289313306371fee0740f5c85517e406 Author: Peter Maydell <peter.mayd...@linaro.org> Date: 2016-09-19 (Mon, 19 Sep 2016) Changed paths: M .gitignore M MAINTAINERS M Makefile M Makefile.target M docs/qapi-code-gen.txt A docs/qmp-commands.txt M docs/writing-qmp-commands.txt M hmp-commands-info.hx M hmp-commands.hx M include/qapi/qmp/dispatch.h M monitor.c M qapi-schema.json M qapi/qmp-registry.c R qmp-commands.hx M qmp.c M scripts/create_config M scripts/qapi-commands.py M tests/test-qga.c M tests/test-qmp-commands.c M trace-events M vl.c Log Message: ----------- Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2016-09-19' into staging QAPI patches for 2016-09-19 # gpg: Signature made Mon 19 Sep 2016 17:27:42 BST # gpg: using RSA key 0x3870B400EB918653 # gpg: Good signature from "Markus Armbruster <arm...@redhat.com>" # gpg: aka "Markus Armbruster <arm...@pond.sub.org>" # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867 4E5F 3870 B400 EB91 8653 * remotes/armbru/tags/pull-qapi-2016-09-19: Replace qmp-commands.hx by docs/qmp-commands.txt qmp-commands.hx: fix some styling build-sys: remove qmp-commands-old.h monitor: use qmp_dispatch() tests: add a test to check invalid args qapi: check invalid arguments on no-args commands qapi: remove the "middle" mode monitor: remove mhandler.cmd_new monitor: implement 'qmp_query_commands' without qmp_cmds monitor: use qmp_find_command() (using generated qapi code) qapi: export the marshallers qmp: Hack to keep commands configuration-specific qapi: Support unregistering QMP commands monitor: register gen:false commands manually monitor: simplify invalid_qmp_mode() qapi-schema: add 'device_add' qapi-schema: use generated marshaller for 'qmp_capabilities' build-sys: define QEMU_VERSION_{MAJOR, MINOR, MICRO} Signed-off-by: Peter Maydell <peter.mayd...@linaro.org> Compare: https://github.com/qemu/qemu/compare/3d47a1390bd8...33e1666b4289