qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] fe4d7e: rocker: Revamp fp_port_get_info


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] fe4d7e: rocker: Revamp fp_port_get_info
Date: Fri, 01 Jan 2021 09:13:18 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: fe4d7e338faf7809024017e373b15dd8ac82094d
      
https://github.com/qemu/qemu/commit/fe4d7e338faf7809024017e373b15dd8ac82094d
  Author: Eric Blake <eblake@redhat.com>
  Date:   2020-12-19 (Sat, 19 Dec 2020)

  Changed paths:
    M hw/net/rocker/rocker.c
    M hw/net/rocker/rocker_fp.c
    M hw/net/rocker/rocker_fp.h

  Log Message:
  -----------
  rocker: Revamp fp_port_get_info

Instead of modifying the value member of a list element passed as a
parameter, and open-coding the manipulation of that list, it's nicer
to just return a freshly allocated value to be prepended to a list
using QAPI_LIST_PREPEND.

Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <20201113011340.463563-3-eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>


  Commit: eaedde5255842e8add96bec127567e2a8b3be9a8
      
https://github.com/qemu/qemu/commit/eaedde5255842e8add96bec127567e2a8b3be9a8
  Author: Eric Blake <eblake@redhat.com>
  Date:   2020-12-19 (Sat, 19 Dec 2020)

  Changed paths:
    M migration/migration.c

  Log Message:
  -----------
  migration: Refactor migrate_cap_add

Instead of taking a list parameter and returning a new head at a
distance, just return the new item for the caller to insert into a
list via QAPI_LIST_PREPEND.

Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <20201113011340.463563-4-eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>


  Commit: 54aa3de72ea2aaa2e903e7e879a4f3dda515a00e
      
https://github.com/qemu/qemu/commit/54aa3de72ea2aaa2e903e7e879a4f3dda515a00e
  Author: Eric Blake <eblake@redhat.com>
  Date:   2020-12-19 (Sat, 19 Dec 2020)

  Changed paths:
    M block/gluster.c
    M block/qapi.c
    M chardev/char.c
    M docs/devel/writing-qmp-commands.txt
    M hw/core/machine-qmp-cmds.c
    M hw/core/machine.c
    M hw/net/rocker/rocker_of_dpa.c
    M hw/net/virtio-net.c
    M migration/migration.c
    M migration/postcopy-ram.c
    M monitor/hmp-cmds.c
    M monitor/misc.c
    M monitor/qmp-cmds-control.c
    M qemu-img.c
    M qga/commands-posix-ssh.c
    M qga/commands-posix.c
    M qga/commands-win32.c
    M qga/commands.c
    M qom/qom-qmp-cmds.c
    M target/arm/helper.c
    M target/arm/monitor.c
    M target/i386/cpu.c
    M target/mips/cpu.c
    M target/ppc/translate_init.c.inc
    M target/s390x/cpu_models.c
    M tests/test-clone-visitor.c
    M tests/test-qobject-output-visitor.c
    M tests/test-visitor-serialization.c
    M trace/qmp.c
    M ui/input.c
    M ui/vnc.c
    M util/qemu-config.c

  Log Message:
  -----------
  qapi: Use QAPI_LIST_PREPEND() where possible

Anywhere we create a list of just one item or by prepending items
(typically because order doesn't matter), we can use
QAPI_LIST_PREPEND().  But places where we must keep the list in order
by appending remain open-coded until later patches.

Note that as a side effect, this also performs a cleanup of two minor
issues in qga/commands-posix.c: the old code was performing
 new = g_malloc0(sizeof(*ret));
which 1) is confusing because you have to verify whether 'new' and
'ret' are variables with the same type, and 2) would conflict with C++
compilation (not an actual problem for this file, but makes
copy-and-paste harder).

Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <20201113011340.463563-5-eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
[Straightforward conflicts due to commit a8aa94b5f8 "qga: update
schema for guest-get-disks 'dependents' field" and commit a10b453a52
"target/mips: Move mips_cpu_add_definition() from helper.c to cpu.c"
resolved.  Commit message tweaked.]
Signed-off-by: Markus Armbruster <armbru@redhat.com>


  Commit: 3953f826a3ff09a6b71b0365c05d1d3f9fdf49f2
      
https://github.com/qemu/qemu/commit/3953f826a3ff09a6b71b0365c05d1d3f9fdf49f2
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-12-19 (Sat, 19 Dec 2020)

  Changed paths:
    M tests/check-qjson.c

  Log Message:
  -----------
  tests/check-qjson: Don't skip funny QNumber to JSON conversions

simple_number() and float_number() convert from JSON to QNumber and
back.

simple_number() tests "-0", but skips the conversion back to JSON,
because it yields "0", not "-0".  Works as intended, so better cover
it: don't skip, but expect the funny result.

float_number() tests "-32.20e-10", but skips the conversion back to
JSON, because it yields "-0".  This is a known bug in
qnum_to_string(), marked FIXME there.  Cover the bug: don't skip, but
expect the funny result.

While there, switch from g_assert() to g_assert_cmpstr() & friends for
friendlier test failures.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20201210161452.2813491-2-armbru@redhat.com>


  Commit: 1a68eb8c186d81a2836bd1e9abd03c0b39f252e9
      
https://github.com/qemu/qemu/commit/1a68eb8c186d81a2836bd1e9abd03c0b39f252e9
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-12-19 (Sat, 19 Dec 2020)

  Changed paths:
    M tests/check-qjson.c

  Log Message:
  -----------
  tests/check-qjson: Examine QNum more thoroughly

simple_number() checks only qnum_get_try_int().  Also check
qnum_get_try_uint() and qnum_get_double().

float_number() checks only qnum_get_double().  Also check
qnum_get_try_int() and qnum_get_try_uint().

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20201210161452.2813491-3-armbru@redhat.com>


  Commit: 4aea88335d5c824b7b63b73c12830b5db558d463
      
https://github.com/qemu/qemu/commit/4aea88335d5c824b7b63b73c12830b5db558d463
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-12-19 (Sat, 19 Dec 2020)

  Changed paths:
    M tests/check-qjson.c

  Log Message:
  -----------
  tests/check-qjson: Cover number 2^63

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20201210161452.2813491-4-armbru@redhat.com>


  Commit: 780df5d42befde9293cd667e1e237f26bcf37e94
      
https://github.com/qemu/qemu/commit/780df5d42befde9293cd667e1e237f26bcf37e94
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-12-19 (Sat, 19 Dec 2020)

  Changed paths:
    M tests/check-qjson.c

  Log Message:
  -----------
  tests/check-qjson: Replace redundant large_number()

Move one of large_number()'s three checks to uint_number(), and the
other two to float_number().

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20201210161452.2813491-5-armbru@redhat.com>


  Commit: 1a9076919f5367309ee8d89b91aae5330dec37d6
      
https://github.com/qemu/qemu/commit/1a9076919f5367309ee8d89b91aae5330dec37d6
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-12-19 (Sat, 19 Dec 2020)

  Changed paths:
    M tests/check-qnum.c

  Log Message:
  -----------
  tests/check-qnum: Cover qnum_to_string() for "unround" argument

qnum_to_string() has a FIXME comment about rounding errors due to
insufficient precision.  Cover it: 2.718281828459045 gets converted to
"2.718282".  The next commit will fix it.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20201210161452.2813491-6-armbru@redhat.com>


  Commit: f917eed3069640f6fa15f07cc5a61ecf4270e6a3
      
https://github.com/qemu/qemu/commit/f917eed3069640f6fa15f07cc5a61ecf4270e6a3
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-12-19 (Sat, 19 Dec 2020)

  Changed paths:
    M qobject/qnum.c
    M tests/check-qjson.c
    M tests/check-qnum.c

  Log Message:
  -----------
  qobject: Fix qnum_to_string() to use sufficient precision

We should serialize numbers to JSON so that they deserialize back to
the same number.  We fail to do so.

The culprit is qnum_to_string(): it uses format %f with trailing '0'
trimmed.  Results in pretty output for "nice" numbers, but is prone to
nasty rounding errors.  For instance, numbers between 0 and 0.0000005
get flushed to zero.

Where exactly the incorrect rounding can bite is tiresome to gauge.
Here's my take.

* In QMP output, type 'number':

  - query-blockstats value avg_rd_queue_depth

  - QMP query-migrate values mbps, cache-miss-rate, encoding-rate,
    busy-rate, compression-rate.

  Relatively harmless, I guess.

* In tracing QMP input.  Harmless.

* In qemu-ga output, type 'number': guest-get-users value login-time.
  Harmless.

* In output of HMP qom-get.  Harmless.

Not affected, because double values don't actually occur there (I
think):

* QMP output, type 'any':

  * qom-get value

  * qom-list, qom-list-properties value default-value

  * query-cpu-model-comparison, query-cpu-model-baseline,
    query-cpu-model-expansion value props.

* qemu-img --output json output.

* "json:" pseudo-filenames generated by bdrv_refresh_filename().

* The rbd block driver's "=keyvalue-pairs" hack.

* In -object help on property default values.  Aside: use of JSON
  feels inappropriate here.

* Output of HMP qom-get.

* Argument conversion to QemuOpts for qdev_device_add() and HMP with
  qemu_opts_from_qdict()

  QMP and HMP device_add, virtio-net failover primary creation,
  xen-usb "usb-host" creation, HMP netdev_add, object_add.

* The uses of qobject_input_visitor_new_flat_confused()

  As far as I can tell, none of the visited types contain double
  values.

* Dumping ImageInfoSpecific with dump_qobject()

Fix by formatting with %.17g.  17 decimal digits always suffice for
IEEE double.

The change to expected test output illustrates the effect: the
rounding errors are gone, but some seemingly "nice" numbers now get
converted to not so nice strings, e.g. 0.42 to "0.41999999999999998".
This is because 0.42 is not representable exactly in double.  It's
more accurate in this example than strictly necessary, though.

If ugly accuracy bothers us, we can we can try using the least number
of digits that still converts back to the same double.  In this
example, "0.42" would do.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20201210161452.2813491-7-armbru@redhat.com>


  Commit: 7b205a7373c25db2f3680dee5a8c82e038135ec1
      
https://github.com/qemu/qemu/commit/7b205a7373c25db2f3680dee5a8c82e038135ec1
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-12-19 (Sat, 19 Dec 2020)

  Changed paths:
    M tests/test-string-output-visitor.c

  Log Message:
  -----------
  test-string-output-visitor: Cover "unround" number

This demonstrates rounding error due to insufficient precision: double
3.1415926535897932 gets converted to JSON 3.141593.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20201210161452.2813491-8-armbru@redhat.com>


  Commit: 54addb01d8c2511ef96b0f0ca6b695d120dd8363
      
https://github.com/qemu/qemu/commit/54addb01d8c2511ef96b0f0ca6b695d120dd8363
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-12-19 (Sat, 19 Dec 2020)

  Changed paths:
    M qapi/string-output-visitor.c
    M tests/test-string-output-visitor.c

  Log Message:
  -----------
  string-output-visitor: Fix to use sufficient precision

The string output visitor should serialize numbers so that the string
input visitor deserializes them back to the same number.  It fails to
do so.

print_type_number() uses format %f.  This is prone to nasty rounding
errors.  For instance, numbers between 0 and 0.0000005 get flushed to
zero.

We currently use this visitor only for HMP info migrate, info network,
info qtree, and info memdev.  No double values occur there as far as I
can tell.

Fix anyway by formatting with %.17g.  17 decimal digits always suffice
for IEEE double.

See also recent commit "qobject: Fix qnum_to_string() to use
sufficient precision".

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20201210161452.2813491-9-armbru@redhat.com>


  Commit: 2a02c1398a47e75aa6963baf7dbfa68a54dc2e41
      
https://github.com/qemu/qemu/commit/2a02c1398a47e75aa6963baf7dbfa68a54dc2e41
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-12-19 (Sat, 19 Dec 2020)

  Changed paths:
    M tests/test-visitor-serialization.c

  Log Message:
  -----------
  test-visitor-serialization: Drop insufficient precision workaround

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20201210161452.2813491-10-armbru@redhat.com>


  Commit: 28f1c1f6e07c4bb4d79bed9474d1425c55e21712
      
https://github.com/qemu/qemu/commit/28f1c1f6e07c4bb4d79bed9474d1425c55e21712
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-12-19 (Sat, 19 Dec 2020)

  Changed paths:
    M tests/test-visitor-serialization.c

  Log Message:
  -----------
  test-visitor-serialization: Clean up test_primitives()

test_primitives() uses union member intmax_t max to compare the
integer members.  Unspecified behavior.  Has worked fine for many
years, though.  Clean it up.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20201210161452.2813491-11-armbru@redhat.com>


  Commit: 436054e22f8447692196ddae7012f6083140e461
      
https://github.com/qemu/qemu/commit/436054e22f8447692196ddae7012f6083140e461
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-12-19 (Sat, 19 Dec 2020)

  Changed paths:
    M monitor/misc.c

  Log Message:
  -----------
  hmp: Simplify how qmp_human_monitor_command() gets output

Commit 48c043d0d1 "hmp: human-monitor-command: stop using the Memory
chardev driver" left us "if string is non-empty, duplicate it, else
duplicate the empty string".  Meh.  Duplicate it unconditionally.

Cc: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20201211171152.146877-2-armbru@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>


  Commit: 20076f4a8c3b275272d0b907f37c126bd91ec1b9
      
https://github.com/qemu/qemu/commit/20076f4a8c3b275272d0b907f37c126bd91ec1b9
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-12-19 (Sat, 19 Dec 2020)

  Changed paths:
    M monitor/misc.c
    M monitor/monitor-internal.h
    M monitor/monitor.c

  Log Message:
  -----------
  monitor: Use GString instead of QString for output buffer

GString has a richer set of string operations than QString.  It should
be preferred to QString except where we need a QObject or reference
counting.  We don't here.  Switch to GString, and put its richer
interface to use.

Cc: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20201211171152.146877-3-armbru@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>


  Commit: 6589f4599151201a61d6b1be8450adb63ae81017
      
https://github.com/qemu/qemu/commit/6589f4599151201a61d6b1be8450adb63ae81017
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-12-19 (Sat, 19 Dec 2020)

  Changed paths:
    M include/qapi/qmp/qjson.h
    M monitor/qmp.c
    M qemu-img.c
    M qobject/qjson.c
    M qom/qom-hmp-cmds.c
    M tests/qtest/libqtest.c

  Log Message:
  -----------
  qobject: Make qobject_to_json_pretty() take a pretty argument

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20201211171152.146877-4-armbru@redhat.com>


  Commit: f1cc129df8341ebb6176363d24b57035bb5dabe4
      
https://github.com/qemu/qemu/commit/f1cc129df8341ebb6176363d24b57035bb5dabe4
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-12-19 (Sat, 19 Dec 2020)

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

  Log Message:
  -----------
  qobject: Use GString instead of QString to accumulate JSON

QString supports modifying its string, but it's quite limited: you can
only append.  The remaining callers use it for building an initial
string, never for modifying it later.

Use of GString for building the initial string is actually more
convenient here.  Change qobject_to_json() & friends to do that.

Once all such uses are replaced this way, QString can become immutable.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20201211171152.146877-5-armbru@redhat.com>


  Commit: eab3a4678b07267c39e7290a6e9e7690b1d2a521
      
https://github.com/qemu/qemu/commit/eab3a4678b07267c39e7290a6e9e7690b1d2a521
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-12-19 (Sat, 19 Dec 2020)

  Changed paths:
    M block.c
    M block/rbd.c
    M include/qapi/qmp/qjson.h
    M monitor/qmp.c
    M qemu-img.c
    M qga/main.c
    M qobject/qjson.c
    M qom/object_interfaces.c
    M qom/qom-hmp-cmds.c
    M tests/check-qjson.c
    M tests/qtest/libqtest.c
    M tests/test-visitor-serialization.c

  Log Message:
  -----------
  qobject: Change qobject_to_json()'s value to GString

qobject_to_json() and qobject_to_json_pretty() build a GString, then
covert it to QString.  Just one of the callers actually needs a
QString: qemu_rbd_parse_filename().  A few others need a string they
can modify: qmp_send_response(), qga's send_response(), to_json_str(),
and qmp_fd_vsend_fds().  The remainder just need a string.

Change qobject_to_json() and qobject_to_json_pretty() to return the
GString.

qemu_rbd_parse_filename() now has to convert to QString.  All others
save a QString temporary.  to_json_str() actually becomes a bit
simpler, because GString provides more convenient modification
functions.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20201211171152.146877-6-armbru@redhat.com>


  Commit: 88e25b1e6d8a0e3672ba8d5bae5c1df768c35bc8
      
https://github.com/qemu/qemu/commit/88e25b1e6d8a0e3672ba8d5bae5c1df768c35bc8
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-12-19 (Sat, 19 Dec 2020)

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

  Log Message:
  -----------
  Revert "qstring: add qstring_free()"

This reverts commit 164c374b75f87c6765a705c4418ab7005a2d356f.

A free function for a reference-counted object is in bad taste.
Fortunately, this one is now also unused.  Drop it.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20201211171152.146877-7-armbru@redhat.com>


  Commit: bce800869b44ce82705205147018bffbbc798834
      
https://github.com/qemu/qemu/commit/bce800869b44ce82705205147018bffbbc798834
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-12-19 (Sat, 19 Dec 2020)

  Changed paths:
    M hw/rdma/rdma_backend.c
    M hw/rdma/rdma_backend_defs.h
    M hw/rdma/rdma_utils.c
    M hw/rdma/rdma_utils.h

  Log Message:
  -----------
  hw/rdma: Replace QList by GQueue

RdmaProtectedQList provides a thread-safe queue of int64_t on top of a
QList.

rdma_protected_qlist_destroy() calls qlist_destroy_obj() directly.
qlist_destroy_obj() is actually for use by qobject_destroy() only.
The next commit will make that obvious.

The minimal fix would be calling qobject_unref() instead.  But QList
is actually a bad fit here.  It's designed for representing JSON
arrays.  We're better off with a GQueue here.  Replace.

Cc: Yuval Shaia <yuval.shaia.ml@gmail.com>
Cc: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20201211171152.146877-8-armbru@redhat.com>


  Commit: 80d71121b719c610c7f6e05c932c35ded4cc92d4
      
https://github.com/qemu/qemu/commit/80d71121b719c610c7f6e05c932c35ded4cc92d4
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-12-19 (Sat, 19 Dec 2020)

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

  Log Message:
  -----------
  qobject: Move internals to qobject-internal.h

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20201211171152.146877-9-armbru@redhat.com>


  Commit: d403d92dfc243f0fb7dec432f971961c522ba077
      
https://github.com/qemu/qemu/commit/d403d92dfc243f0fb7dec432f971961c522ba077
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-12-19 (Sat, 19 Dec 2020)

  Changed paths:
    M monitor/qmp.c

  Log Message:
  -----------
  qmp: Fix tracing of non-string command IDs

Tracepoints monitor_qmp_cmd_in_band and
monitor_qmp_cmd_out_of_band (commit cf869d5317 "qmp: support
out-of-band (oob) execution") treat non-string "id" like absent "id".
Fix that.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20201211171152.146877-10-armbru@redhat.com>


  Commit: 410f44f59685b05fc76e813fb2716bdb17c8da8d
      
https://github.com/qemu/qemu/commit/410f44f59685b05fc76e813fb2716bdb17c8da8d
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-12-19 (Sat, 19 Dec 2020)

  Changed paths:
    M block.c

  Log Message:
  -----------
  block: Avoid qobject_get_try_str()

I'm about to remove qobject_get_try_str().  Use qstring_get_str()
instead.  Safe because the argument is known to be a QString here.

Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Max Reitz <mreitz@redhat.com>
Cc: qemu-block@nongnu.org
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20201211171152.146877-11-armbru@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>


  Commit: 26c52828f6e7760407e5bb43a2fab3a276eccf43
      
https://github.com/qemu/qemu/commit/26c52828f6e7760407e5bb43a2fab3a276eccf43
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-12-19 (Sat, 19 Dec 2020)

  Changed paths:
    M qom/object.c

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

Commit aafb21a0b9 "qobject: let object_property_get_str() use new API"
isn't much of a simplification.  Not worth having
object_property_get_str() differ from the other
object_property_get_FOO().  Revert.

This reverts commit aafb21a0b9cea5fa0fe52e68111bb6bd13837a02.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Daniel P. Berrangé <berrange@redhat.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20201211171152.146877-12-armbru@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>


  Commit: 808ac3657e4eb8e9fa62f57507c6d2eaa2557466
      
https://github.com/qemu/qemu/commit/808ac3657e4eb8e9fa62f57507c6d2eaa2557466
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-12-19 (Sat, 19 Dec 2020)

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

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

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20201211171152.146877-13-armbru@redhat.com>


  Commit: b3119b08143a036e8089fb442f9d42c4920ba22c
      
https://github.com/qemu/qemu/commit/b3119b08143a036e8089fb442f9d42c4920ba22c
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-12-19 (Sat, 19 Dec 2020)

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

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

No users left outside tests/, and the ones in tests/ can just as well
use qstring_get_str().  Do that, and drop the function.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20201211171152.146877-14-armbru@redhat.com>


  Commit: 91f54d92c752e392be4903c9ad2846b2cdd0398d
      
https://github.com/qemu/qemu/commit/91f54d92c752e392be4903c9ad2846b2cdd0398d
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-12-19 (Sat, 19 Dec 2020)

  Changed paths:
    M qobject/qjson.c

  Log Message:
  -----------
  qobject: Factor quoted_str() out of to_json()

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20201211171152.146877-15-armbru@redhat.com>


  Commit: 998da0b1581bfda6d6d0e82b9e42edfa1bf5cfe5
      
https://github.com/qemu/qemu/commit/998da0b1581bfda6d6d0e82b9e42edfa1bf5cfe5
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-12-19 (Sat, 19 Dec 2020)

  Changed paths:
    A include/qapi/qmp/json-writer.h
    A qobject/json-writer.c
    M qobject/meson.build
    M qobject/qjson.c
    M qobject/qnum.c

  Log Message:
  -----------
  qobject: Factor JSON writer out of qobject_to_json()

We have two JSON writers written in C: qobject/qjson.c provides
qobject_to_json(), and migration/qjson.c provides a more low level
imperative interface.  They don't share code.  The latter tacitly
limits numbers to int64_t, and strings contents to characters that
don't need escaping.

Factor out qobject_to_json()'s JSON writer as qobject/json-writer.c.
Straightforward, except for numbers: since the writer is to be
independent of QObject, it can't use qnum_to_string().  Open-code it
instead.  This is actually an improvement of sorts, because it
liberates qnum_to_string() from JSON's needs: its JSON-related FIXMEs
move to the JSON writer, where they belong.

The next commit will replace migration/qjson.c.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20201211171152.146877-16-armbru@redhat.com>


  Commit: 3ddba9a9e9bedd20a0b60dcdbe86f16223555555
      
https://github.com/qemu/qemu/commit/3ddba9a9e9bedd20a0b60dcdbe86f16223555555
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-12-19 (Sat, 19 Dec 2020)

  Changed paths:
    M hw/display/virtio-gpu.c
    M hw/intc/s390_flic_kvm.c
    M hw/nvram/eeprom93xx.c
    M hw/nvram/fw_cfg.c
    M hw/pci/msix.c
    M hw/pci/pci.c
    M hw/pci/shpc.c
    M hw/rtc/twl92230.c
    M hw/scsi/scsi-bus.c
    M hw/usb/redirect.c
    M hw/virtio/virtio.c
    M include/migration/vmstate.h
    M include/qapi/qmp/json-writer.h
    M include/qemu/typedefs.h
    M migration/meson.build
    R migration/qjson.c
    R migration/qjson.h
    M migration/savevm.c
    M migration/vmstate-types.c
    M migration/vmstate.c
    M target/alpha/machine.c
    M target/arm/machine.c
    M target/avr/machine.c
    M target/hppa/machine.c
    M target/microblaze/machine.c
    M target/mips/machine.c
    M target/openrisc/machine.c
    M target/ppc/machine.c
    M target/sparc/machine.c

  Log Message:
  -----------
  migration: Replace migration's JSON writer by the general one

Commit 8118f0950f "migration: Append JSON description of migration
stream" needs a JSON writer.  The existing qobject_to_json() wasn't a
good fit, because it requires building a QObject to convert.  Instead,
migration got its very own JSON writer, in commit 190c882ce2 "QJSON:
Add JSON writer".  It tacitly limits numbers to int64_t, and strings
contents to characters that don't need escaping, unlike
qobject_to_json().

The previous commit factored the JSON writer out of qobject_to_json().
Replace migration's JSON writer by it.

Cc: Juan Quintela <quintela@redhat.com>
Cc: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20201211171152.146877-17-armbru@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>


  Commit: 68af4cc1213ec6057ac47765985b6704c6be7fd7
      
https://github.com/qemu/qemu/commit/68af4cc1213ec6057ac47765985b6704c6be7fd7
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-12-19 (Sat, 19 Dec 2020)

  Changed paths:
    M qobject/json-parser.c

  Log Message:
  -----------
  json: Use GString instead of QString to accumulate strings

QString supports modifying its string, but it's quite limited: you can
only append.  The remaining callers use it for building an initial
string, never for modifying it later.

Change parse_string() to do build the initial string with GString.
This is another step towards making QString immutable.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20201211171152.146877-18-armbru@redhat.com>


  Commit: 7ece42110d2cde04f8cbfbceec536340344eab4e
      
https://github.com/qemu/qemu/commit/7ece42110d2cde04f8cbfbceec536340344eab4e
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-12-19 (Sat, 19 Dec 2020)

  Changed paths:
    M util/keyval.c

  Log Message:
  -----------
  keyval: Use GString to accumulate value strings

QString supports modifying its string, but it's quite limited: you can
only append.  The remaining callers use it for building an initial
string, never for modifying it later.

Change keyval_parse_one() to do build the initial string with GString.
This is another step towards making QString immutable.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20201211171152.146877-19-armbru@redhat.com>


  Commit: 18cf67c5e1d6e23042b752831aa6f9e4e478787b
      
https://github.com/qemu/qemu/commit/18cf67c5e1d6e23042b752831aa6f9e4e478787b
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-12-19 (Sat, 19 Dec 2020)

  Changed paths:
    M block.c

  Log Message:
  -----------
  block: Use GString instead of QString to build filenames

QString supports modifying its string, but it's quite limited: you can
only append.  Just one caller remains:
bdrv_parse_filename_strip_prefix() uses it just for building an
initial string.

Change it to do build the initial string with GString.  This is
another step towards making QString immutable.

Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Max Reitz <mreitz@redhat.com>
Cc: qemu-block@nongnu.org
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20201211171152.146877-20-armbru@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>


  Commit: 4ac76ba414ecb94f086d73621775d8b38b6f0a43
      
https://github.com/qemu/qemu/commit/4ac76ba414ecb94f086d73621775d8b38b6f0a43
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2020-12-19 (Sat, 19 Dec 2020)

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

  Log Message:
  -----------
  qobject: Make QString immutable

The functions to modify a QString's string are all unused now.  Drop
them, and make the string immutable.  Saves 16 bytes per QString on my
system.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20201211171152.146877-21-armbru@redhat.com>


  Commit: 1f7c02797fa189ce4b34382020bbce63262a5758
      
https://github.com/qemu/qemu/commit/1f7c02797fa189ce4b34382020bbce63262a5758
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2021-01-01 (Fri, 01 Jan 2021)

  Changed paths:
    M block.c
    M block/gluster.c
    M block/qapi.c
    M block/rbd.c
    M chardev/char.c
    M docs/devel/writing-qmp-commands.txt
    M hw/core/machine-qmp-cmds.c
    M hw/core/machine.c
    M hw/display/virtio-gpu.c
    M hw/intc/s390_flic_kvm.c
    M hw/net/rocker/rocker.c
    M hw/net/rocker/rocker_fp.c
    M hw/net/rocker/rocker_fp.h
    M hw/net/rocker/rocker_of_dpa.c
    M hw/net/virtio-net.c
    M hw/nvram/eeprom93xx.c
    M hw/nvram/fw_cfg.c
    M hw/pci/msix.c
    M hw/pci/pci.c
    M hw/pci/shpc.c
    M hw/rdma/rdma_backend.c
    M hw/rdma/rdma_backend_defs.h
    M hw/rdma/rdma_utils.c
    M hw/rdma/rdma_utils.h
    M hw/rtc/twl92230.c
    M hw/scsi/scsi-bus.c
    M hw/usb/redirect.c
    M hw/virtio/virtio.c
    M include/migration/vmstate.h
    A include/qapi/qmp/json-writer.h
    M include/qapi/qmp/qbool.h
    M include/qapi/qmp/qdict.h
    M include/qapi/qmp/qjson.h
    M include/qapi/qmp/qlist.h
    M include/qapi/qmp/qnull.h
    M include/qapi/qmp/qnum.h
    M include/qapi/qmp/qobject.h
    M include/qapi/qmp/qstring.h
    M include/qemu/typedefs.h
    M migration/meson.build
    M migration/migration.c
    M migration/postcopy-ram.c
    R migration/qjson.c
    R migration/qjson.h
    M migration/savevm.c
    M migration/vmstate-types.c
    M migration/vmstate.c
    M monitor/hmp-cmds.c
    M monitor/misc.c
    M monitor/monitor-internal.h
    M monitor/monitor.c
    M monitor/qmp-cmds-control.c
    M monitor/qmp.c
    M qapi/string-output-visitor.c
    M qemu-img.c
    M qga/commands-posix-ssh.c
    M qga/commands-posix.c
    M qga/commands-win32.c
    M qga/commands.c
    M qga/main.c
    M qobject/json-parser.c
    A qobject/json-writer.c
    M qobject/meson.build
    M qobject/qbool.c
    M qobject/qdict.c
    M qobject/qjson.c
    M qobject/qlist.c
    M qobject/qnull.c
    M qobject/qnum.c
    A qobject/qobject-internal.h
    M qobject/qobject.c
    M qobject/qstring.c
    M qom/object.c
    M qom/object_interfaces.c
    M qom/qom-hmp-cmds.c
    M qom/qom-qmp-cmds.c
    M target/alpha/machine.c
    M target/arm/helper.c
    M target/arm/machine.c
    M target/arm/monitor.c
    M target/avr/machine.c
    M target/hppa/machine.c
    M target/i386/cpu.c
    M target/microblaze/machine.c
    M target/mips/cpu.c
    M target/mips/machine.c
    M target/openrisc/machine.c
    M target/ppc/machine.c
    M target/ppc/translate_init.c.inc
    M target/s390x/cpu_models.c
    M target/sparc/machine.c
    M tests/check-qjson.c
    M tests/check-qnum.c
    M tests/check-qobject.c
    M tests/check-qstring.c
    M tests/qtest/libqtest.c
    M tests/test-clone-visitor.c
    M tests/test-qobject-output-visitor.c
    M tests/test-string-output-visitor.c
    M tests/test-visitor-serialization.c
    M trace/qmp.c
    M ui/input.c
    M ui/vnc.c
    M util/keyval.c
    M util/qemu-config.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2020-12-19' into 
staging

QAPI patches patches for 2020-12-19

# gpg: Signature made Sat 19 Dec 2020 09:40:05 GMT
# gpg:                using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653
# gpg:                issuer "armbru@redhat.com"
# gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full]
# gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>" [full]
# Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653

* remotes/armbru/tags/pull-qapi-2020-12-19: (33 commits)
  qobject: Make QString immutable
  block: Use GString instead of QString to build filenames
  keyval: Use GString to accumulate value strings
  json: Use GString instead of QString to accumulate strings
  migration: Replace migration's JSON writer by the general one
  qobject: Factor JSON writer out of qobject_to_json()
  qobject: Factor quoted_str() out of to_json()
  qobject: Drop qstring_get_try_str()
  qobject: Drop qobject_get_try_str()
  Revert "qobject: let object_property_get_str() use new API"
  block: Avoid qobject_get_try_str()
  qmp: Fix tracing of non-string command IDs
  qobject: Move internals to qobject-internal.h
  hw/rdma: Replace QList by GQueue
  Revert "qstring: add qstring_free()"
  qobject: Change qobject_to_json()'s value to GString
  qobject: Use GString instead of QString to accumulate JSON
  qobject: Make qobject_to_json_pretty() take a pretty argument
  monitor: Use GString instead of QString for output buffer
  hmp: Simplify how qmp_human_monitor_command() gets output
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


Compare: https://github.com/qemu/qemu/compare/50536341b47f...1f7c02797fa1



reply via email to

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