qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 26ee12: qapi2texi: minor python code simplifi


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 26ee12: qapi2texi: minor python code simplification
Date: Tue, 20 Mar 2018 04:36:38 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 26ee12ad1f5fc1239b7366b696e813a27319b752
      
https://github.com/qemu/qemu/commit/26ee12ad1f5fc1239b7366b696e813a27319b752
  Author: Marc-André Lureau <address@hidden>
  Date:   2018-03-19 (Mon, 19 Mar 2018)

  Changed paths:
    M scripts/qapi/doc.py

  Log Message:
  -----------
  qapi2texi: minor python code simplification

Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Eric Blake <address@hidden>


  Commit: 3d96ea44d4dde442094b7d9e5b71ef61b4c4ae39
      
https://github.com/qemu/qemu/commit/3d96ea44d4dde442094b7d9e5b71ef61b4c4ae39
  Author: Marc-André Lureau <address@hidden>
  Date:   2018-03-19 (Mon, 19 Mar 2018)

  Changed paths:
    M include/qapi/qmp/qlit.h

  Log Message:
  -----------
  qlit: use QType instead of int

Suggested-by: Markus Armbruster <address@hidden>
Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Eric Blake <address@hidden>


  Commit: 3cf42b8b3af1bd61e736a9ca0f94806c7931ae56
      
https://github.com/qemu/qemu/commit/3cf42b8b3af1bd61e736a9ca0f94806c7931ae56
  Author: Marc-André Lureau <address@hidden>
  Date:   2018-03-19 (Mon, 19 Mar 2018)

  Changed paths:
    M include/qapi/qmp/qlit.h
    M qobject/qlit.c
    M tests/check-qlit.c

  Log Message:
  -----------
  qlit: add qobject_from_qlit()

Instantiate a QObject* from a literal QLitObject.

LitObject only supports int64_t for now.  uint64_t and double aren't
implemented.

Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Eric Blake <address@hidden>


  Commit: 7d0f982bfbb92fbfc1bf6c9bcaffe745996a763c
      
https://github.com/qemu/qemu/commit/7d0f982bfbb92fbfc1bf6c9bcaffe745996a763c
  Author: Marc-André Lureau <address@hidden>
  Date:   2018-03-19 (Mon, 19 Mar 2018)

  Changed paths:
    M docs/devel/qapi-code-gen.txt
    M monitor.c
    M scripts/qapi/introspect.py
    M tests/test-qobject-input-visitor.c

  Log Message:
  -----------
  qapi: generate a literal qobject for introspection

Replace the generated json string with a literal qobject. The later is
easier to deal with, at run time as well as compile time: adding #if
conditionals will be easier than in a json string.

The output of query-qmp-schema is not changed.

Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Message-Id: <address@hidden>
[eblake: fix python 3 failure]
Signed-off-by: Eric Blake <address@hidden>


  Commit: 9139b5672360aaa263da1d96cdfdbe16accb6e3b
      
https://github.com/qemu/qemu/commit/9139b5672360aaa263da1d96cdfdbe16accb6e3b
  Author: Max Reitz <address@hidden>
  Date:   2018-03-19 (Mon, 19 Mar 2018)

  Changed paths:
    M include/qemu/compiler.h

  Log Message:
  -----------
  compiler: Add QEMU_BUILD_BUG_MSG() macro

_Static_assert() allows us to specify messages, and that may come in
handy.  Even without _Static_assert(), encouraging developers to put a
helpful message next to the QEMU_BUILD_BUG_* may make debugging easier
whenever it breaks.

Signed-off-by: Max Reitz <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Alberto Garcia <address@hidden>
Signed-off-by: Eric Blake <address@hidden>


  Commit: 1a56b1e2ab5e9d6d89386ca953b4afb419e15abe
      
https://github.com/qemu/qemu/commit/1a56b1e2ab5e9d6d89386ca953b4afb419e15abe
  Author: Max Reitz <address@hidden>
  Date:   2018-03-19 (Mon, 19 Mar 2018)

  Changed paths:
    M include/qapi/qmp/qobject.h

  Log Message:
  -----------
  qapi: Add qobject_to()

This is a dynamic casting macro that, given a QObject type, returns an
object as that type or NULL if the object is of a different type (or
NULL itself).

The macro uses lower-case letters because:
1. There does not seem to be a hard rule on whether qemu macros have to
   be upper-cased,
2. The current situation in qapi/qmp is inconsistent (compare e.g.
   QINCREF() vs. qdict_put()),
3. qobject_to() will evaluate its @obj parameter only once, thus it is
   generally not important to the caller whether it is a macro or not,
4. I prefer it aesthetically.

The macro parameter order is chosen with typename first for
consistency with other QAPI macros like QAPI_CLONE(), as well as
for legibility (read it as "qobject to" type "applied to" obj).

Signed-off-by: Max Reitz <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Alberto Garcia <address@hidden>
[eblake: swap parameter order to list type first, avoid clang ubsan
warning on QOBJECT(NULL) and container_of(NULL,type,base)]
Signed-off-by: Eric Blake <address@hidden>


  Commit: 7dc847ebba953db90853d15f140c20eef74d4fb2
      
https://github.com/qemu/qemu/commit/7dc847ebba953db90853d15f140c20eef74d4fb2
  Author: Max Reitz <address@hidden>
  Date:   2018-03-19 (Mon, 19 Mar 2018)

  Changed paths:
    M block.c
    M block/parallels.c
    M block/qapi.c
    M block/qcow.c
    M block/qcow2.c
    M block/qed.c
    M block/rbd.c
    M block/sheepdog.c
    M block/vhdx.c
    M block/vpc.c
    M blockdev.c
    M hw/i386/acpi-build.c
    M monitor.c
    M qapi/qmp-dispatch.c
    M qapi/qobject-input-visitor.c
    M qapi/qobject-output-visitor.c
    M qga/main.c
    M qmp.c
    M qobject/json-parser.c
    M qobject/qbool.c
    M qobject/qdict.c
    M qobject/qjson.c
    M qobject/qlist.c
    M qobject/qlit.c
    M qobject/qnum.c
    M qobject/qstring.c
    M qom/object.c
    M target/i386/cpu.c
    M target/s390x/cpu_models.c
    M tests/check-qdict.c
    M tests/check-qjson.c
    M tests/check-qlist.c
    M tests/check-qlit.c
    M tests/check-qnum.c
    M tests/check-qobject.c
    M tests/check-qstring.c
    M tests/device-introspect-test.c
    M tests/libqtest.c
    M tests/numa-test.c
    M tests/qom-test.c
    M tests/test-char.c
    M tests/test-keyval.c
    M tests/test-qga.c
    M tests/test-qmp-cmds.c
    M tests/test-qmp-event.c
    M tests/test-qobject-input-visitor.c
    M tests/test-qobject-output-visitor.c
    M tests/test-x86-cpuid-compat.c
    M util/keyval.c
    M util/qemu-config.c
    M util/qemu-option.c

  Log Message:
  -----------
  qapi: Replace qobject_to_X(o) by qobject_to(X, o)

This patch was generated using the following Coccinelle script:

@@
expression Obj;
@@
(
- qobject_to_qnum(Obj)
+ qobject_to(QNum, Obj)
|
- qobject_to_qstring(Obj)
+ qobject_to(QString, Obj)
|
- qobject_to_qdict(Obj)
+ qobject_to(QDict, Obj)
|
- qobject_to_qlist(Obj)
+ qobject_to(QList, Obj)
|
- qobject_to_qbool(Obj)
+ qobject_to(QBool, Obj)
)

and a bit of manual fix-up for overly long lines and three places in
tests/check-qjson.c that Coccinelle did not find.

Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Alberto Garcia <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
[eblake: swap order from qobject_to(o, X), rebase to master, also a fix
to latent false-positive compiler complaint about hw/i386/acpi-build.c]
Signed-off-by: Eric Blake <address@hidden>


  Commit: cb51b976babf7ee16dc5eda4f2189d65b8b700a3
      
https://github.com/qemu/qemu/commit/cb51b976babf7ee16dc5eda4f2189d65b8b700a3
  Author: Max Reitz <address@hidden>
  Date:   2018-03-19 (Mon, 19 Mar 2018)

  Changed paths:
    M include/qapi/qmp/qbool.h
    M include/qapi/qmp/qdict.h
    M include/qapi/qmp/qlist.h
    M include/qapi/qmp/qnum.h
    M include/qapi/qmp/qstring.h
    M qobject/qbool.c
    M qobject/qdict.c
    M qobject/qlist.c
    M qobject/qnum.c
    M qobject/qstring.c

  Log Message:
  -----------
  qapi: Remove qobject_to_X() functions

They are no longer needed now.

Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Alberto Garcia <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Eric Blake <address@hidden>


  Commit: 532fb532847365f61a9c6e1291b6588a43bc1cc4
      
https://github.com/qemu/qemu/commit/532fb532847365f61a9c6e1291b6588a43bc1cc4
  Author: Max Reitz <address@hidden>
  Date:   2018-03-19 (Mon, 19 Mar 2018)

  Changed paths:
    M qapi/qobject-input-visitor.c
    M qobject/json-parser.c
    M qobject/qdict.c

  Log Message:
  -----------
  qapi: Make more of qobject_to()

This patch reworks some places which use either qobject_type() checks
plus qobject_to(), where the latter alone is sufficient, or NULL checks
plus qobject_type() checks where we can simply do a qobject_to() != NULL
check.

Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Alberto Garcia <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
[eblake: rebase to qobject_to() parameter ordering]
Signed-off-by: Eric Blake <address@hidden>


  Commit: e59a0cf17b1b9932b65e6fc25d6856976f5e4831
      
https://github.com/qemu/qemu/commit/e59a0cf17b1b9932b65e6fc25d6856976f5e4831
  Author: Max Reitz <address@hidden>
  Date:   2018-03-19 (Mon, 19 Mar 2018)

  Changed paths:
    M block.c
    M blockdev.c
    M tests/qemu-iotests/089
    M tests/qemu-iotests/089.out

  Log Message:
  -----------
  block: Handle null backing link

Instead of converting all "backing": null instances into "backing": "",
handle a null value directly in bdrv_open_inherit().

This enables explicitly null backing links for json:{} filenames.

Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Alberto Garcia <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
[eblake: rebase to qobject_to() parameter order and qapi headers split]
Signed-off-by: Eric Blake <address@hidden>


  Commit: 4f7be2806e672fa232e406ac5eec26789b9d5f85
      
https://github.com/qemu/qemu/commit/4f7be2806e672fa232e406ac5eec26789b9d5f85
  Author: Max Reitz <address@hidden>
  Date:   2018-03-19 (Mon, 19 Mar 2018)

  Changed paths:
    M block.c
    M qapi/block-core.json
    M qemu-doc.texi
    M qemu-options.hx

  Log Message:
  -----------
  block: Deprecate "backing": ""

We have a clear replacement, so let's deprecate it.

Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Alberto Garcia <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Eric Blake <address@hidden>


  Commit: 99f2f54174a595e3ada6e4332fcd2b37ebb0d55d
      
https://github.com/qemu/qemu/commit/99f2f54174a595e3ada6e4332fcd2b37ebb0d55d
  Author: Daniel P. Berrange <address@hidden>
  Date:   2018-03-19 (Mon, 19 Mar 2018)

  Changed paths:
    M chardev/char-socket.c

  Log Message:
  -----------
  chardev: tcp: postpone TLS work until machine done

TLS handshake may create background GSource tasks, while we won't know
the correct GMainContext until the whole chardev (including frontend)
inited.  Let's postpone the initial TLS handshake until machine done.

For dynamically created tcp chardev, we don't postpone that by checking
the init_machine_done variable.

Signed-off-by: Daniel P. Berrange <address@hidden>
[peterx: add missing include line, do unit test]
Signed-off-by: Peter Xu <address@hidden>
Message-Id: <address@hidden>
Acked-by: Paolo Bonzini <address@hidden>
Signed-off-by: Eric Blake <address@hidden>


  Commit: 378112b0020c4bc6c54e73e58046399f0e41b939
      
https://github.com/qemu/qemu/commit/378112b0020c4bc6c54e73e58046399f0e41b939
  Author: Peter Xu <address@hidden>
  Date:   2018-03-19 (Mon, 19 Mar 2018)

  Changed paths:
    M docs/devel/qapi-code-gen.txt
    M docs/interop/qmp-spec.txt

  Log Message:
  -----------
  docs: update QMP documents for OOB commands

Update both the developer and spec for the new QMP OOB (Out-Of-Band)
command.

Signed-off-by: Peter Xu <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
[eblake: grammar tweaks]
Signed-off-by: Eric Blake <address@hidden>


  Commit: 775932020dd6bd7e9c1acc0d7779677d8b4c094c
      
https://github.com/qemu/qemu/commit/775932020dd6bd7e9c1acc0d7779677d8b4c094c
  Author: Peter Xu <address@hidden>
  Date:   2018-03-19 (Mon, 19 Mar 2018)

  Changed paths:
    M include/qapi/qmp/qstring.h
    M qobject/qstring.c

  Log Message:
  -----------
  qobject: introduce qstring_get_try_str()

The only difference from qstring_get_str() is that it allows the qstring
to be NULL.  If so, NULL is returned.

CC: Eric Blake <address@hidden>
CC: Markus Armbruster <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Peter Xu <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Eric Blake <address@hidden>


  Commit: b26ae1cb8eb0756524e322169138830b9b542311
      
https://github.com/qemu/qemu/commit/b26ae1cb8eb0756524e322169138830b9b542311
  Author: Peter Xu <address@hidden>
  Date:   2018-03-19 (Mon, 19 Mar 2018)

  Changed paths:
    M include/qapi/qmp/qstring.h
    M qobject/qstring.c

  Log Message:
  -----------
  qobject: introduce qobject_get_try_str()

A quick way to fetch string from qobject when it's a QString.

Reviewed-by: Fam Zheng <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Peter Xu <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
[eblake: rebase to qobject_to() macro]
Signed-off-by: Eric Blake <address@hidden>


  Commit: aafb21a0b9cea5fa0fe52e68111bb6bd13837a02
      
https://github.com/qemu/qemu/commit/aafb21a0b9cea5fa0fe52e68111bb6bd13837a02
  Author: Peter Xu <address@hidden>
  Date:   2018-03-19 (Mon, 19 Mar 2018)

  Changed paths:
    M qom/object.c

  Log Message:
  -----------
  qobject: let object_property_get_str() use new API

We can simplify object_property_get_str() using the new
qobject_get_try_str().

Reviewed-by: Fam Zheng <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Peter Xu <address@hidden>
Message-Id: <address@hidden>
[eblake: rebase context of qobject_to() macro]
Signed-off-by: Eric Blake <address@hidden>


  Commit: 88a95d1090f9d9d60016ded3c129bf9952f8fa29
      
https://github.com/qemu/qemu/commit/88a95d1090f9d9d60016ded3c129bf9952f8fa29
  Author: Peter Xu <address@hidden>
  Date:   2018-03-19 (Mon, 19 Mar 2018)

  Changed paths:
    M monitor.c

  Log Message:
  -----------
  monitor: move skip_flush into monitor_data_init

It's part of the data init.  Collect it.

Reviewed-by: Dr. David Alan Gilbert <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Peter Xu <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Eric Blake <address@hidden>


  Commit: 227a07552f3aff3cefe7eb9f8993c04a420ed962
      
https://github.com/qemu/qemu/commit/227a07552f3aff3cefe7eb9f8993c04a420ed962
  Author: Peter Xu <address@hidden>
  Date:   2018-03-19 (Mon, 19 Mar 2018)

  Changed paths:
    M monitor.c

  Log Message:
  -----------
  monitor: move the cur_mon hack deeper for QMP

In monitor_qmp_read(), we have the hack to temporarily replace the
cur_mon pointer.  Now we move this hack deeper inside the QMP dispatcher
routine since the Monitor pointer can be actually obtained using
container_of() upon the parser object, just like most of the other JSON
parser users do.

This does not make much sense as a single patch.  However, this will be
a big step for the next patch, when the QMP dispatcher routine will be
split from the QMP parser.

Reviewed-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Peter Xu <address@hidden>
Message-Id: <address@hidden>
[eblake: rebase context of qobject_to() macro]
Signed-off-by: Eric Blake <address@hidden>


  Commit: 6adf08dd42929542426b055a4b66a5bc0b8e20ba
      
https://github.com/qemu/qemu/commit/6adf08dd42929542426b055a4b66a5bc0b8e20ba
  Author: Peter Xu <address@hidden>
  Date:   2018-03-19 (Mon, 19 Mar 2018)

  Changed paths:
    M include/monitor/monitor.h
    M monitor.c
    M vl.c

  Log Message:
  -----------
  monitor: unify global init

There are many places where the monitor initializes its globals:

- monitor_init_qmp_commands() at the very beginning
- single function to init monitor_lock
- in the first entry of monitor_init() using "is_first_init"

Unify them a bit.

monitor_lock is not used before monitor_init() (as confirmed by code
analysis and gdb watchpoints); so we are safe delaying what was a
constructor-time initialization of the mutex into the later first call
to monitor_init().

Reviewed-by: Fam Zheng <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Peter Xu <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Eric Blake <address@hidden>


  Commit: 238d9f34f40642d3d5bf6bf23d03738d2ff211cd
      
https://github.com/qemu/qemu/commit/238d9f34f40642d3d5bf6bf23d03738d2ff211cd
  Author: Peter Xu <address@hidden>
  Date:   2018-03-19 (Mon, 19 Mar 2018)

  Changed paths:
    M monitor.c

  Log Message:
  -----------
  monitor: let mon_list be tail queue

It was QLIST.  I want to use this list to do monitor priority job later,
which need tail insertion ability.  So switching to a tail queue.

Reviewed-by: Fam Zheng <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Peter Xu <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Eric Blake <address@hidden>


  Commit: a5ed352596a8b7eb2f9acce34371b944ac3056c4
      
https://github.com/qemu/qemu/commit/a5ed352596a8b7eb2f9acce34371b944ac3056c4
  Author: Peter Xu <address@hidden>
  Date:   2018-03-19 (Mon, 19 Mar 2018)

  Changed paths:
    M monitor.c

  Log Message:
  -----------
  monitor: allow using IO thread for parsing

For each Monitor, add one field "use_io_thr" to show whether it will be
using the dedicated monitor IO thread to handle input/output.  When set,
monitor IO parsing work will be offloaded to the dedicated monitor IO
thread, rather than the original main loop thread.

This only works for QMP.  HMP will always be run on the main loop
thread.

Currently we're still keeping use_io_thr off always.  Will turn it on
later at some point.

One thing to mention is that we cannot set use_io_thr for every QMP
monitor.  The problem is that MUXed typed chardevs may not work well
with it now. When MUX is used, frontend of chardev can be the monitor
plus something else.  The only thing we know would be safe to be run
outside main thread so far is the monitor frontend. All the rest of the
frontends should still be run in main thread only.

Signed-off-by: Peter Xu <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
[eblake: squash in Peter's followup patch to avoid test failures]
Signed-off-by: Eric Blake <address@hidden>


  Commit: 02130314d8c71743e6d1fefc2b08a608516bccc7
      
https://github.com/qemu/qemu/commit/02130314d8c71743e6d1fefc2b08a608516bccc7
  Author: Peter Xu <address@hidden>
  Date:   2018-03-19 (Mon, 19 Mar 2018)

  Changed paths:
    M monitor.c
    M qapi/misc.json
    M tests/qmp-test.c

  Log Message:
  -----------
  qmp: introduce QMPCapability

There were no QMP capabilities defined.  Define the first capability,
"oob", to allow out-of-band messages.

After this patch, we will allow QMP clients to enable QMP capabilities
when sending the first "qmp_capabilities" command.  Originally we are
starting QMP session with no arguments like:

  { "execute": "qmp_capabilities" }

Now we can enable some QMP capabilities using (take OOB as example,
which is the only capability that we support):

  { "execute": "qmp_capabilities",
    "arguments": { "enable": [ "oob" ] } }

When the "arguments" key is not provided, no capability is enabled.

For capability "oob", the monitor needs to be run on a dedicated IO
thread, otherwise the command will fail.  For example, trying to enable
OOB on a MUXed typed QMP monitor will fail.

One thing to mention is that QMP capabilities are per-monitor, and also
when the connection is closed due to some reason, the capabilities will
be reset.

Also, touch up qmp-test.c to test the new bits.

Signed-off-by: Peter Xu <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
[eblake: touch up commit message]
Signed-off-by: Eric Blake <address@hidden>


  Commit: 546aa56674305a4ab45bea4f36956651fd892b04
      
https://github.com/qemu/qemu/commit/546aa56674305a4ab45bea4f36956651fd892b04
  Author: Peter Xu <address@hidden>
  Date:   2018-03-19 (Mon, 19 Mar 2018)

  Changed paths:
    M monitor.c

  Log Message:
  -----------
  monitor: introduce monitor_qmp_respond()

A tiny refactoring, preparing to split the QMP dispatcher away.

Reviewed-by: Fam Zheng <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Peter Xu <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
[eblake: rebase to qobject_to() usage]
Signed-off-by: Eric Blake <address@hidden>


  Commit: df152fb950e3e00d0186cbdc412dc8ddcc618621
      
https://github.com/qemu/qemu/commit/df152fb950e3e00d0186cbdc412dc8ddcc618621
  Author: Peter Xu <address@hidden>
  Date:   2018-03-19 (Mon, 19 Mar 2018)

  Changed paths:
    M monitor.c

  Log Message:
  -----------
  monitor: let suspend_cnt be thread safe

Monitor code now can be run in more than one thread.  Let it be thread
safe when accessing suspend_cnt counter.

Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Peter Xu <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Eric Blake <address@hidden>


  Commit: e3e977d45b0750d7e4b8f9cac4b89e8082235188
      
https://github.com/qemu/qemu/commit/e3e977d45b0750d7e4b8f9cac4b89e8082235188
  Author: Peter Xu <address@hidden>
  Date:   2018-03-19 (Mon, 19 Mar 2018)

  Changed paths:
    M monitor.c
    M trace-events

  Log Message:
  -----------
  monitor: let suspend/resume work even with QMPs

This patches allows QMP monitors to be suspended/resumed.

One thing to mention is that for QMPs that are using IOThreads, we need
an explicit kick for the IOThread in case it is sleeping.

Meanwhile, we need to take special care on non-interactive HMPs.
Currently only gdbserver is using that.  For these monitors, we still
don't allow suspend/resume operations.

Since at it, add traces for the operations.

Signed-off-by: Peter Xu <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Eric Blake <address@hidden>


  Commit: 71da4667db6568220619e5dc21f1e7b4b379076e
      
https://github.com/qemu/qemu/commit/71da4667db6568220619e5dc21f1e7b4b379076e
  Author: Peter Xu <address@hidden>
  Date:   2018-03-19 (Mon, 19 Mar 2018)

  Changed paths:
    M monitor.c

  Log Message:
  -----------
  monitor: separate QMP parser and dispatcher

Originally QMP goes through these steps:

  JSON Parser --> QMP Dispatcher --> Respond
      /|\    (2)                (3)     |
   (1) |                               \|/ (4)
       +---------  main thread  --------+

This patch does this:

  JSON Parser     QMP Dispatcher --> Respond
      /|\ |           /|\       (4)     |
       |  | (2)        | (3)            |  (5)
   (1) |  +----->      |               \|/
       +---------  main thread  <-------+

So the parsing job and the dispatching job is isolated now.  It gives us
a chance in follow up patches to totally move the parser outside.

The isolation is done using one QEMUBH. Only one dispatcher QEMUBH is
used for all the monitors.

Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Peter Xu <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
[eblake: grammar tweaks, rebase to qobject_to()]
Signed-off-by: Eric Blake <address@hidden>


  Commit: 8167d8bd363f9ee22c9ee53566a51cfe886d39f1
      
https://github.com/qemu/qemu/commit/8167d8bd363f9ee22c9ee53566a51cfe886d39f1
  Author: Eric Blake <address@hidden>
  Date:   2018-03-19 (Mon, 19 Mar 2018)

  Changed paths:
    M qapi/misc.json

  Log Message:
  -----------
  qmp: add new event "command-dropped"

This event will be emitted if one QMP command is dropped.  Also,
declare an enum for the reasons.

Reviewed-by: Fam Zheng <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Peter Xu <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
[eblake: rebase to master]
Signed-off-by: Eric Blake <address@hidden>


  Commit: bf1e7301745af6d0f4acd74da4ccfce27ad6eadf
      
https://github.com/qemu/qemu/commit/bf1e7301745af6d0f4acd74da4ccfce27ad6eadf
  Author: Peter Xu <address@hidden>
  Date:   2018-03-19 (Mon, 19 Mar 2018)

  Changed paths:
    M monitor.c

  Log Message:
  -----------
  monitor: send event when command queue full

Set maximum QMP command queue length to 8.  If the queue is full,
instead of queuing the command, we directly return a "command-dropped"
event, telling the client that a specific command is dropped.

Note that this flow control mechanism is only valid if OOB is enabled.
If it's not, the effective queue length will always be 1, which strictly
follows original behavior of QMP command handling (which never drops
messages).

Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Peter Xu <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
[eblake: commit message grammar, abort on failure to send event]
Signed-off-by: Eric Blake <address@hidden>


  Commit: 876c67512e2af8c05686faa9f9ff49b38d7a392c
      
https://github.com/qemu/qemu/commit/876c67512e2af8c05686faa9f9ff49b38d7a392c
  Author: Peter Xu <address@hidden>
  Date:   2018-03-19 (Mon, 19 Mar 2018)

  Changed paths:
    M include/qapi/qmp/dispatch.h
    M qapi/introspect.json
    M scripts/qapi/commands.py
    M scripts/qapi/common.py
    M scripts/qapi/doc.py
    M scripts/qapi/introspect.py
    M tests/qapi-schema/test-qapi.py

  Log Message:
  -----------
  qapi: introduce new cmd option "allow-oob"

Here "oob" stands for "Out-Of-Band".  When "allow-oob" is set, it means
the command allows out-of-band execution.

The "oob" idea is proposed by Markus Armbruster in following thread:

  https://lists.gnu.org/archive/html/qemu-devel/2017-09/msg02057.html

This new "allow-oob" boolean will be exposed by "query-qmp-schema" as
well for command entries, so that QMP clients can know which commands
can be used in out-of-band calls. For example the command "migrate"
originally looks like:

  {"name": "migrate", "ret-type": "17", "meta-type": "command",
   "arg-type": "86"}

And it'll be changed into:

  {"name": "migrate", "ret-type": "17", "allow-oob": false,
   "meta-type": "command", "arg-type": "86"}

This patch only provides the QMP interface level changes.  It does not
contain the real out-of-band execution implementation yet.

Suggested-by: Markus Armbruster <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Signed-off-by: Peter Xu <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
[eblake: rebase on introspection done by qlit]
Signed-off-by: Eric Blake <address@hidden>


  Commit: cf869d53172920536a14180a83292b240e9d0545
      
https://github.com/qemu/qemu/commit/cf869d53172920536a14180a83292b240e9d0545
  Author: Peter Xu <address@hidden>
  Date:   2018-03-19 (Mon, 19 Mar 2018)

  Changed paths:
    M include/qapi/qmp/dispatch.h
    M monitor.c
    M qapi/qmp-dispatch.c
    M trace-events

  Log Message:
  -----------
  qmp: support out-of-band (oob) execution

Having "allow-oob":true for a command does not mean that this command
will always be run in out-of-band mode.  The out-of-band quick path will
only be executed if we specify the extra "run-oob" flag when sending the
QMP request:

    { "execute":   "command-that-allows-oob",
      "arguments": { ... },
      "control":   { "run-oob": true } }

The "control" key is introduced to store this extra flag.  "control"
field is used to store arguments that are shared by all the commands,
rather than command specific arguments.  Let "run-oob" be the first.

Note that in the patch I exported qmp_dispatch_check_obj() to be used to
check the request earlier, and at the same time allowed "id" field to be
there since actually we always allow that.

Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Peter Xu <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
[eblake: rebase to qobject_to(), spelling fix]
Signed-off-by: Eric Blake <address@hidden>


  Commit: abe3cd0ff7f774966da6842620806ab7576fe4f3
      
https://github.com/qemu/qemu/commit/abe3cd0ff7f774966da6842620806ab7576fe4f3
  Author: Peter Xu <address@hidden>
  Date:   2018-03-19 (Mon, 19 Mar 2018)

  Changed paths:
    M monitor.c

  Log Message:
  -----------
  qmp: isolate responses into io thread

For those monitors who have enabled IO thread, we'll offload the
responding procedure into IO thread.  The main reason is that chardev is
not thread safe, and we need to do all the read/write IOs in the same
thread.  For use_io_thr=true monitors, that thread is the IO thread.

We do this isolation in similar pattern as what we have done to the
request queue: we first create one response queue for each monitor, then
instead of replying directly in the main thread, we queue the responses
and kick the IO thread to do the rest of the job for us.

A funny thing after doing this is that, when the QMP clients send "quit"
to QEMU, it's possible that we close the IOThread even earlier than
replying to that "quit".  So another thing we need to do before cleaning
up the monitors is that we need to flush the response queue (we don't
need to do that for command queue; after all we are quitting) to make
sure replies for handled commands are always flushed back to clients.

Reviewed-by: Fam Zheng <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Peter Xu <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Eric Blake <address@hidden>


  Commit: 3fd2457d18edf5736f713dfe1ada9c87a9badab1
      
https://github.com/qemu/qemu/commit/3fd2457d18edf5736f713dfe1ada9c87a9badab1
  Author: Peter Xu <address@hidden>
  Date:   2018-03-19 (Mon, 19 Mar 2018)

  Changed paths:
    M monitor.c

  Log Message:
  -----------
  monitor: enable IO thread for (qmp & !mux) typed

Start to use dedicate IO thread for QMP monitors that are not using
MUXed chardev.

Reviewed-by: Fam Zheng <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Peter Xu <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Eric Blake <address@hidden>


  Commit: 469638f9cb3fde767fbc207f62fc3735eea96ef1
      
https://github.com/qemu/qemu/commit/469638f9cb3fde767fbc207f62fc3735eea96ef1
  Author: Peter Xu <address@hidden>
  Date:   2018-03-19 (Mon, 19 Mar 2018)

  Changed paths:
    M qapi/misc.json
    M qmp.c

  Log Message:
  -----------
  qmp: add command "x-oob-test"

This command is only used to test OOB functionality.  It should not be
used for any other purposes.

Reviewed-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Signed-off-by: Peter Xu <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
[eblake: grammar tweak]
Signed-off-by: Eric Blake <address@hidden>


  Commit: 91ad45061af0fe44ac5dadb5bedaf4d7a08077c8
      
https://github.com/qemu/qemu/commit/91ad45061af0fe44ac5dadb5bedaf4d7a08077c8
  Author: Peter Xu <address@hidden>
  Date:   2018-03-19 (Mon, 19 Mar 2018)

  Changed paths:
    M tests/qmp-test.c

  Log Message:
  -----------
  tests: qmp-test: verify command batching

OOB introduced DROP event for flow control.  This should not affect old
QMP clients.  Add a command batching check to make sure of it.

Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Peter Xu <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Eric Blake <address@hidden>


  Commit: d003f7a8f9cafe50119975844fa01afc2baf41fb
      
https://github.com/qemu/qemu/commit/d003f7a8f9cafe50119975844fa01afc2baf41fb
  Author: Peter Xu <address@hidden>
  Date:   2018-03-19 (Mon, 19 Mar 2018)

  Changed paths:
    M tests/qmp-test.c

  Log Message:
  -----------
  tests: qmp-test: add oob test

Test the new OOB capability.  Here we used the new "x-oob-test" command.
First, we send a lock=true and oob=false command to hang the main
thread.  Then send another lock=false and oob=true command (which will
be run inside parser this time) to free that hanged command.

Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Peter Xu <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
[eblake: grammar tweaks]
Signed-off-by: Eric Blake <address@hidden>


  Commit: b741ae74170643de0fec3005c717e3a397c3e034
      
https://github.com/qemu/qemu/commit/b741ae74170643de0fec3005c717e3a397c3e034
  Author: Vladimir Sementsov-Ogievskiy <address@hidden>
  Date:   2018-03-19 (Mon, 19 Mar 2018)

  Changed paths:
    M block/accounting.c
    M include/block/accounting.h

  Log Message:
  -----------
  block/accounting: introduce latency histogram

Introduce latency histogram statics for block devices.
For each accounted operation type, the latency region [0, +inf) is
divided into subregions by several points. Then, calculate
hits for each subregion.

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Eric Blake <address@hidden>


  Commit: 7e5c776d15b1fc0cda00c255ba035bdf81dbaa31
      
https://github.com/qemu/qemu/commit/7e5c776d15b1fc0cda00c255ba035bdf81dbaa31
  Author: Vladimir Sementsov-Ogievskiy <address@hidden>
  Date:   2018-03-19 (Mon, 19 Mar 2018)

  Changed paths:
    M block/qapi.c
    M blockdev.c
    M qapi/block-core.json

  Log Message:
  -----------
  qapi: add block latency histogram interface

Set (and clear) histograms through new command
block-latency-histogram-set and show new statistics in
query-blockstats results.

For now, the command is marked experimental with prefix 'x-',
to gain experience with the interface without being stuck
with design decisions.

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
[eblake: fix typos, mention x- prefix in commit message]
Signed-off-by: Eric Blake <address@hidden>


  Commit: 02e3092db3f9b84ed6aae54e3b71d4dc4196c7eb
      
https://github.com/qemu/qemu/commit/02e3092db3f9b84ed6aae54e3b71d4dc4196c7eb
  Author: Eric Blake <address@hidden>
  Date:   2018-03-19 (Mon, 19 Mar 2018)

  Changed paths:
    M tests/Makefile.include

  Log Message:
  -----------
  qapi: Pass '-u' when doing non-silent diff

Ed-script diffs are awful compared to context diffs.  Fix another
'diff -q' while in the area (if the files are different, being
noisy makes it easier to diagnose why).

While at it, diff .err before .out, because if a test fails, .err
is more likely to contain the most important information for
fixing the failure.

Fixes: 46ec4fce
Signed-off-by: Eric Blake <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Message-Id: <address@hidden>


  Commit: 4bdc24fa018901892bb8a5bd1808ebd605f4c64d
      
https://github.com/qemu/qemu/commit/4bdc24fa018901892bb8a5bd1808ebd605f4c64d
  Author: Peter Maydell <address@hidden>
  Date:   2018-03-20 (Tue, 20 Mar 2018)

  Changed paths:
    M block.c
    M block/accounting.c
    M block/parallels.c
    M block/qapi.c
    M block/qcow.c
    M block/qcow2.c
    M block/qed.c
    M block/rbd.c
    M block/sheepdog.c
    M block/vhdx.c
    M block/vpc.c
    M blockdev.c
    M chardev/char-socket.c
    M docs/devel/qapi-code-gen.txt
    M docs/interop/qmp-spec.txt
    M hw/i386/acpi-build.c
    M include/block/accounting.h
    M include/monitor/monitor.h
    M include/qapi/qmp/dispatch.h
    M include/qapi/qmp/qbool.h
    M include/qapi/qmp/qdict.h
    M include/qapi/qmp/qlist.h
    M include/qapi/qmp/qlit.h
    M include/qapi/qmp/qnum.h
    M include/qapi/qmp/qobject.h
    M include/qapi/qmp/qstring.h
    M include/qemu/compiler.h
    M monitor.c
    M qapi/block-core.json
    M qapi/introspect.json
    M qapi/misc.json
    M qapi/qmp-dispatch.c
    M qapi/qobject-input-visitor.c
    M qapi/qobject-output-visitor.c
    M qemu-doc.texi
    M qemu-options.hx
    M qga/main.c
    M qmp.c
    M qobject/json-parser.c
    M qobject/qbool.c
    M qobject/qdict.c
    M qobject/qjson.c
    M qobject/qlist.c
    M qobject/qlit.c
    M qobject/qnum.c
    M qobject/qstring.c
    M qom/object.c
    M scripts/qapi/commands.py
    M scripts/qapi/common.py
    M scripts/qapi/doc.py
    M scripts/qapi/introspect.py
    M target/i386/cpu.c
    M target/s390x/cpu_models.c
    M tests/Makefile.include
    M tests/check-qdict.c
    M tests/check-qjson.c
    M tests/check-qlist.c
    M tests/check-qlit.c
    M tests/check-qnum.c
    M tests/check-qobject.c
    M tests/check-qstring.c
    M tests/device-introspect-test.c
    M tests/libqtest.c
    M tests/numa-test.c
    M tests/qapi-schema/test-qapi.py
    M tests/qemu-iotests/089
    M tests/qemu-iotests/089.out
    M tests/qmp-test.c
    M tests/qom-test.c
    M tests/test-char.c
    M tests/test-keyval.c
    M tests/test-qga.c
    M tests/test-qmp-cmds.c
    M tests/test-qmp-event.c
    M tests/test-qobject-input-visitor.c
    M tests/test-qobject-output-visitor.c
    M tests/test-x86-cpuid-compat.c
    M trace-events
    M util/keyval.c
    M util/qemu-config.c
    M util/qemu-option.c
    M vl.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/ericb/tags/pull-qapi-2018-03-12-v4' 
into staging

qapi patches for 2018-03-12, 2.12 softfreeze

- Marc-André Lureau: 0/4 qapi: generate a literal qobject for introspection
- Max Reitz: 0/7 block: Handle null backing link
- Daniel P. Berrange: chardev: tcp: postpone TLS work until machine done
- Peter Xu: 00/23 QMP: out-of-band (OOB) execution support
- Vladimir Sementsov-Ogievskiy: 0/2 block latency histogram
- Eric Blake: qapi: Pass '-u' when doing non-silent diff

# gpg: Signature made Mon 19 Mar 2018 19:59:04 GMT
# gpg:                using RSA key A7A16B4A2527436A
# gpg: Good signature from "Eric Blake <address@hidden>"
# gpg:                 aka "Eric Blake (Free Software Programmer) 
<address@hidden>"
# gpg:                 aka "[jpeg image of size 6874]"
# Primary key fingerprint: 71C2 CC22 B1C4 6029 27D2  F3AA A7A1 6B4A 2527 436A

* remotes/ericb/tags/pull-qapi-2018-03-12-v4: (38 commits)
  qapi: Pass '-u' when doing non-silent diff
  qapi: add block latency histogram interface
  block/accounting: introduce latency histogram
  tests: qmp-test: add oob test
  tests: qmp-test: verify command batching
  qmp: add command "x-oob-test"
  monitor: enable IO thread for (qmp & !mux) typed
  qmp: isolate responses into io thread
  qmp: support out-of-band (oob) execution
  qapi: introduce new cmd option "allow-oob"
  monitor: send event when command queue full
  qmp: add new event "command-dropped"
  monitor: separate QMP parser and dispatcher
  monitor: let suspend/resume work even with QMPs
  monitor: let suspend_cnt be thread safe
  monitor: introduce monitor_qmp_respond()
  qmp: introduce QMPCapability
  monitor: allow using IO thread for parsing
  monitor: let mon_list be tail queue
  monitor: unify global init
  ...

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/c26ef39204f3...4bdc24fa0189

reply via email to

[Prev in Thread] Current Thread [Next in Thread]