qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] e2503f: qapi-types.py: Implement 'base' for u


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] e2503f: qapi-types.py: Implement 'base' for unions
Date: Fri, 26 Jul 2013 16:00:10 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: e2503f5e213e30e3e9a397d454a35c10b5bdc899
      
https://github.com/qemu/qemu/commit/e2503f5e213e30e3e9a397d454a35c10b5bdc899
  Author: Kevin Wolf <address@hidden>
  Date:   2013-07-26 (Fri, 26 Jul 2013)

  Changed paths:
    M scripts/qapi-types.py

  Log Message:
  -----------
  qapi-types.py: Implement 'base' for unions

The new 'base' key in a union definition refers to a struct type, which
is inlined into the union definition and can represent fields common to
all kinds.

For example the following schema definition...

    { 'type': 'BlockOptionsBase', 'data': { 'read-only': 'bool' } }

    { 'union': 'BlockOptions',
      'base': 'BlockOptionsBase',
      'data': {
    'raw': 'BlockOptionsRaw'
    'qcow2': 'BlockOptionsQcow2'
      } }

...would result in this generated C struct:

    struct BlockOptions
    {
  BlockOptionsKind kind;
  union {
      void *data;
      BlockOptionsRaw * raw;
      BlockOptionsQcow2 * qcow2;
  };
  bool read_only;
    };

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Eric Blake <address@hidden>


  Commit: d131c897f3dea8b76d7a487af0f7f5f11d0500a3
      
https://github.com/qemu/qemu/commit/d131c897f3dea8b76d7a487af0f7f5f11d0500a3
  Author: Kevin Wolf <address@hidden>
  Date:   2013-07-26 (Fri, 26 Jul 2013)

  Changed paths:
    M scripts/qapi-visit.py

  Log Message:
  -----------
  qapi-visit.py: Split off generate_visit_struct_fields()

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Eric Blake <address@hidden>


  Commit: 0aef92b90d24858eea1ebd52a51bc31563f1fb52
      
https://github.com/qemu/qemu/commit/0aef92b90d24858eea1ebd52a51bc31563f1fb52
  Author: Kevin Wolf <address@hidden>
  Date:   2013-07-26 (Fri, 26 Jul 2013)

  Changed paths:
    M scripts/qapi-visit.py

  Log Message:
  -----------
  qapi-visit.py: Implement 'base' for unions

This implements the visitor part of base types for unions. Parsed into
QMP, this example schema definition...

    { 'type': 'BlockOptionsBase', 'data': { 'read-only': 'bool' } }
    { 'type': 'BlockOptionsQcow2, 'data': { 'lazy-refcounts': 'bool' } }

    { 'union': 'BlockOptions',
      'base': 'BlockOptionsBase',
      'data': {
    'raw': 'BlockOptionsRaw'
    'qcow2': 'BlockOptionsQcow2'
      } }

...would describe the following JSON object:

    { "type": "qcow2",
      "read-only": true,
      "data": { "lazy-refcounts": false } }

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Eric Blake <address@hidden>


  Commit: 51631493e4876081ae27078b50bd95bd4418bf37
      
https://github.com/qemu/qemu/commit/51631493e4876081ae27078b50bd95bd4418bf37
  Author: Kevin Wolf <address@hidden>
  Date:   2013-07-26 (Fri, 26 Jul 2013)

  Changed paths:
    M docs/qapi-code-gen.txt

  Log Message:
  -----------
  docs: Document QAPI union types

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Eric Blake <address@hidden>


  Commit: 761d524dbcc5bb41213dd0f238f43c273bc2b077
      
https://github.com/qemu/qemu/commit/761d524dbcc5bb41213dd0f238f43c273bc2b077
  Author: Kevin Wolf <address@hidden>
  Date:   2013-07-26 (Fri, 26 Jul 2013)

  Changed paths:
    M include/qapi/visitor-impl.h
    M include/qapi/visitor.h
    M qapi/qapi-visit-core.c
    M qapi/qmp-input-visitor.c

  Log Message:
  -----------
  qapi: Add visitor for implicit structs

These can be used when an embedded struct is parsed and members not
belonging to the struct may be present in the input (e.g. parsing a
flat namespace QMP union, where fields from both the base and one
of the alternative types are mixed in the JSON object)

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Eric Blake <address@hidden>


  Commit: 50f2bdc75c5ee00617ad874c9ceac2cea660aa1e
      
https://github.com/qemu/qemu/commit/50f2bdc75c5ee00617ad874c9ceac2cea660aa1e
  Author: Kevin Wolf <address@hidden>
  Date:   2013-07-26 (Fri, 26 Jul 2013)

  Changed paths:
    M docs/qapi-code-gen.txt
    M scripts/qapi-types.py
    M scripts/qapi-visit.py

  Log Message:
  -----------
  qapi: Flat unions with arbitrary discriminator

Instead of the rather verbose syntax that distinguishes base and
subclass fields...

  { "type": "file",
    "read-only": true,
    "data": {
  "filename": "test"
    } }

...we can now have both in the same namespace, allowing a more direct
mapping of the command line, and moving fields between the common base
and subclasses without breaking the API:

  { "driver": "file",
    "read-only": true,
    "filename": "test" }

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Eric Blake <address@hidden>


  Commit: e8316d7e8e8339a9ea593ba821a0aad26908c0d5
      
https://github.com/qemu/qemu/commit/e8316d7e8e8339a9ea593ba821a0aad26908c0d5
  Author: Kevin Wolf <address@hidden>
  Date:   2013-07-26 (Fri, 26 Jul 2013)

  Changed paths:
    M qapi/qmp-input-visitor.c

  Log Message:
  -----------
  qapi: Add consume argument to qmp_input_get_object()

This allows to just look at the next element without actually consuming
it.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Eric Blake <address@hidden>


  Commit: ea66c6d8819c8fc5f73a28554992be64e5399fed
      
https://github.com/qemu/qemu/commit/ea66c6d8819c8fc5f73a28554992be64e5399fed
  Author: Kevin Wolf <address@hidden>
  Date:   2013-07-26 (Fri, 26 Jul 2013)

  Changed paths:
    M scripts/qapi.py

  Log Message:
  -----------
  qapi.py: Maintain a list of union types

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Eric Blake <address@hidden>


  Commit: 69dd62dfd60631ba69201d8a197fde1ece4b4df3
      
https://github.com/qemu/qemu/commit/69dd62dfd60631ba69201d8a197fde1ece4b4df3
  Author: Kevin Wolf <address@hidden>
  Date:   2013-07-26 (Fri, 26 Jul 2013)

  Changed paths:
    M docs/qapi-code-gen.txt
    M include/qapi/qmp/qobject.h
    M include/qapi/visitor-impl.h
    M include/qapi/visitor.h
    M qapi/qapi-visit-core.c
    M qapi/qmp-input-visitor.c
    M qobject/qjson.c
    M scripts/qapi-types.py
    M scripts/qapi-visit.py
    M scripts/qapi.py

  Log Message:
  -----------
  qapi: Anonymous unions

The discriminator for anonymous unions is the data type. This allows to
have a union type that allows both of these:

    { 'file': 'my_existing_block_device_id' }
    { 'file': { 'filename': '/tmp/mydisk.qcow2', 'read-only': true } }

Unions like this are specified in the schema with an empty dict as
discriminator. For this example you could take:

    { 'union': 'BlockRef',
      'discriminator': {},
      'data': { 'definition': 'BlockOptions',
          'reference': 'str' } }
    { 'type': 'ExampleObject',
      'data: { 'file': 'BlockRef' } }

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Eric Blake <address@hidden>


  Commit: 74fe54f2a1b5c4f4498a8fe521e1dfc936656cd4
      
https://github.com/qemu/qemu/commit/74fe54f2a1b5c4f4498a8fe521e1dfc936656cd4
  Author: Kevin Wolf <address@hidden>
  Date:   2013-07-26 (Fri, 26 Jul 2013)

  Changed paths:
    M block.c
    M blockdev.c

  Log Message:
  -----------
  block: Allow "driver" option on the top level

This is traditionally -drive format=..., which is now translated into
the new driver option. This gives us a more consistent way to select the
driver of BlockDriverStates that can be used in QMP context, too.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Eric Blake <address@hidden>


  Commit: 0dd6c5266313c861cf36476da86599d368ec41fc
      
https://github.com/qemu/qemu/commit/0dd6c5266313c861cf36476da86599d368ec41fc
  Author: Kevin Wolf <address@hidden>
  Date:   2013-07-26 (Fri, 26 Jul 2013)

  Changed paths:
    M include/qemu/option.h
    M util/qemu-option.c

  Log Message:
  -----------
  QemuOpts: Add qemu_opt_unset()

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Eric Blake <address@hidden>


  Commit: 57975222b6a928dd4a4a8a7b37093cc8ecba5045
      
https://github.com/qemu/qemu/commit/57975222b6a928dd4a4a8a7b37093cc8ecba5045
  Author: Kevin Wolf <address@hidden>
  Date:   2013-07-26 (Fri, 26 Jul 2013)

  Changed paths:
    M blockdev.c

  Log Message:
  -----------
  blockdev: Rename I/O throttling options for QMP

In QMP, we want to use dashes instead of underscores in QMP argument
names, and use nested options for throttling.

The new option names affect the command line as well, but for
compatibility drive_init() will convert the old option names before
calling into the code that will be shared between -drive and
blockdev-add.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Eric Blake <address@hidden>


  Commit: 64aa99d3e0333dea73d7505190659a02ca909292
      
https://github.com/qemu/qemu/commit/64aa99d3e0333dea73d7505190659a02ca909292
  Author: Kevin Wolf <address@hidden>
  Date:   2013-07-26 (Fri, 26 Jul 2013)

  Changed paths:
    M block/qcow2.c
    M block/qcow2.h
    M tests/qemu-iotests/051
    M tests/qemu-iotests/051.out

  Log Message:
  -----------
  qcow2: Use dashes instead of underscores in options

This is what QMP wants to use. The options haven't been enabled in any
release yet, so we're still free to change them.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Eric Blake <address@hidden>


  Commit: 0f227a947004aa9043d4386f4a47d6739499b88f
      
https://github.com/qemu/qemu/commit/0f227a947004aa9043d4386f4a47d6739499b88f
  Author: Kevin Wolf <address@hidden>
  Date:   2013-07-26 (Fri, 26 Jul 2013)

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

  Log Message:
  -----------
  blockdev: Rename 'readonly' option to 'read-only'

Option name cleanup before it becomes a QMP API.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Eric Blake <address@hidden>


  Commit: 29c4e2b50d95f4a15c3dd62b39f3402f05a34907
      
https://github.com/qemu/qemu/commit/29c4e2b50d95f4a15c3dd62b39f3402f05a34907
  Author: Kevin Wolf <address@hidden>
  Date:   2013-07-26 (Fri, 26 Jul 2013)

  Changed paths:
    M blockdev.c

  Log Message:
  -----------
  blockdev: Split up 'cache' option

The old 'cache' option really encodes three different boolean flags into
a cache mode name, without providing all combinations. Make them three
separate options instead and translate the old option to the new ones
for drive_init().

The specific boolean options take precedence if the old cache option is
specified as well, so the following options are equivalent:

-drive file=x,cache=none,cache.no-flush=true
-drive file=x,cache.writeback=true,cache.direct=true,cache.no-flush=true

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Eric Blake <address@hidden>


  Commit: f660dc6a2e97756596b2e79ce6127a3034f2308b
      
https://github.com/qemu/qemu/commit/f660dc6a2e97756596b2e79ce6127a3034f2308b
  Author: Kevin Wolf <address@hidden>
  Date:   2013-07-26 (Fri, 26 Jul 2013)

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

  Log Message:
  -----------
  Implement qdict_flatten()

qdict_flatten(): For each nested QDict with key x, all fields with key y
are moved to this QDict and their key is renamed to "x.y". This operation
is applied recursively for nested QDicts.

Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Eric Blake <address@hidden>


  Commit: fc5d3f843250c9d3bfa2bcfdb7369f4753a49f0e
      
https://github.com/qemu/qemu/commit/fc5d3f843250c9d3bfa2bcfdb7369f4753a49f0e
  Author: Ian Main <address@hidden>
  Date:   2013-07-26 (Fri, 26 Jul 2013)

  Changed paths:
    M block/backup.c
    M blockdev.c
    M include/block/block_int.h
    M qmp-commands.hx

  Log Message:
  -----------
  Implement sync modes for drive-backup.

This patch adds sync-modes to the drive-backup interface and
implements the FULL, NONE and TOP modes of synchronization.

FULL performs as before copying the entire contents of the drive
while preserving the point-in-time using CoW.
NONE only copies new writes to the target drive.
TOP copies changes to the topmost drive image and preserves the
point-in-time using CoW.

For sync mode TOP are creating a new target image using the same backing
file as the original disk image.  Then any new data that has been laid
on top of it since creation is copied in the main backup_run() loop.
There is an extra check in the 'TOP' case so that we don't bother to copy
all the data of the backing file as it already exists in the target.
This is where the bdrv_co_is_allocated() is used to determine if the
data exists in the topmost layer or below.

Also any new data being written is intercepted via the write_notifier
hook which ends up calling backup_do_cow() to copy old data out before
it gets overwritten.

For mode 'NONE' we create the new target image and only copy in the
original data from the disk image starting from the time the call was
made.  This preserves the point in time data by only copying the parts
that are *going to change* to the target image.  This way we can
reconstruct the final image by checking to see if the given block exists
in the new target image first, and if it does not, you can get it from
the original image.  This is basically an optimization allowing you to
do point-in-time snapshots with low overhead vs the 'FULL' version.

Since there is no old data to copy out the loop in backup_run() for the
NONE case just calls qemu_coroutine_yield() which only wakes up after
an event (usually cancel in this case).  The rest is handled by the
before_write notifier which again calls backup_do_cow() to write out
the old data so it can be preserved.

Signed-off-by: Ian Main <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: e3409362bd64731e042c9d001e43cc1d13d2df5d
      
https://github.com/qemu/qemu/commit/e3409362bd64731e042c9d001e43cc1d13d2df5d
  Author: Ian Main <address@hidden>
  Date:   2013-07-26 (Fri, 26 Jul 2013)

  Changed paths:
    M tests/qemu-iotests/055
    M tests/qemu-iotests/055.out
    A tests/qemu-iotests/056
    A tests/qemu-iotests/056.out
    M tests/qemu-iotests/group
    M tests/qemu-iotests/iotests.py

  Log Message:
  -----------
  Add tests for sync modes 'TOP' and 'NONE'

This patch adds tests for sync modes top and none.  Test for 'TOP'
is separated out as it requires a backing file.  Also added a test
for invalid format.

Signed-off-by: Ian Main <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 7d7b2ad43603d6c130b64bdc064bb8572505bb25
      
https://github.com/qemu/qemu/commit/7d7b2ad43603d6c130b64bdc064bb8572505bb25
  Author: Eduardo Otubo <address@hidden>
  Date:   2013-07-26 (Fri, 26 Jul 2013)

  Changed paths:
    M configure
    M qemu-seccomp.c

  Log Message:
  -----------
  seccomp: no need to check arch in syscall whitelist

v2 update:
- set libseccomp 2.1.0 as requirement on configure script.

Since libseccomp 2.0 there's no need to check the architecture type
anymore.

Signed-off-by: Eduardo Otubo <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Message-id: address@hidden
Signed-off-by: Anthony Liguori <address@hidden>


  Commit: 2fb861eb02f0955876e15b3de1f9c2d1f469dcf2
      
https://github.com/qemu/qemu/commit/2fb861eb02f0955876e15b3de1f9c2d1f469dcf2
  Author: Eduardo Otubo <address@hidden>
  Date:   2013-07-26 (Fri, 26 Jul 2013)

  Changed paths:
    M qemu-seccomp.c

  Log Message:
  -----------
  seccomp: removing unused syscalls gtom whitelist

v3 update:
 - reincluding getrlimit(), it is used by Xen.

v2 update:
 - reincluding setrlimit(), it is used by Xen.

Signed-off-by: Eduardo Otubo <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Message-id: address@hidden
Signed-off-by: Anthony Liguori <address@hidden>


  Commit: 405c97c3a5950d8a49b90cb977e33b6b3f9a8f95
      
https://github.com/qemu/qemu/commit/405c97c3a5950d8a49b90cb977e33b6b3f9a8f95
  Author: Anthony Liguori <address@hidden>
  Date:   2013-07-26 (Fri, 26 Jul 2013)

  Changed paths:
    M block.c
    M block/backup.c
    M block/qcow2.c
    M block/qcow2.h
    M blockdev.c
    M docs/qapi-code-gen.txt
    M include/block/block_int.h
    M include/qapi/qmp/qdict.h
    M include/qapi/qmp/qobject.h
    M include/qapi/visitor-impl.h
    M include/qapi/visitor.h
    M include/qemu/option.h
    M qapi/qapi-visit-core.c
    M qapi/qmp-input-visitor.c
    M qmp-commands.hx
    M qobject/qdict.c
    M qobject/qjson.c
    M scripts/qapi-types.py
    M scripts/qapi-visit.py
    M scripts/qapi.py
    M tests/qemu-iotests/051
    M tests/qemu-iotests/051.out
    M tests/qemu-iotests/055
    M tests/qemu-iotests/055.out
    A tests/qemu-iotests/056
    A tests/qemu-iotests/056.out
    M tests/qemu-iotests/group
    M tests/qemu-iotests/iotests.py
    M util/qemu-option.c

  Log Message:
  -----------
  Merge remote-tracking branch 'kwolf/for-anthony' into staging

# By Kevin Wolf (16) and Ian Main (2)
# Via Kevin Wolf
* kwolf/for-anthony:
  Add tests for sync modes 'TOP' and 'NONE'
  Implement sync modes for drive-backup.
  Implement qdict_flatten()
  blockdev: Split up 'cache' option
  blockdev: Rename 'readonly' option to 'read-only'
  qcow2: Use dashes instead of underscores in options
  blockdev: Rename I/O throttling options for QMP
  QemuOpts: Add qemu_opt_unset()
  block: Allow "driver" option on the top level
  qapi: Anonymous unions
  qapi.py: Maintain a list of union types
  qapi: Add consume argument to qmp_input_get_object()
  qapi: Flat unions with arbitrary discriminator
  qapi: Add visitor for implicit structs
  docs: Document QAPI union types
  qapi-visit.py: Implement 'base' for unions
  qapi-visit.py: Split off generate_visit_struct_fields()
  qapi-types.py: Implement 'base' for unions

Message-id: address@hidden
Signed-off-by: Anthony Liguori <address@hidden>


  Commit: b96919e068388309b655c7dc1afa41706d728efd
      
https://github.com/qemu/qemu/commit/b96919e068388309b655c7dc1afa41706d728efd
  Author: Mark Cave-Ayland <address@hidden>
  Date:   2013-07-26 (Fri, 26 Jul 2013)

  Changed paths:
    M hw/sparc/sun4m.c

  Log Message:
  -----------
  sun4m: add display width and height to the firmware configuration

Currently the graphics resolution for TCX is fixed at 1024x768, however
other framebuffers are capable of supporting additional resolutions.

Signed-off-by: Mark Cave-Ayland <address@hidden>
CC: Anthony Liguori <address@hidden>
CC: Blue Swirl <address@hidden>
Signed-off-by: Anthony Liguori <address@hidden>


Compare: https://github.com/qemu/qemu/compare/f0ef1cf4d6c9...b96919e06838

reply via email to

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