qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] d43013: qapi: Turn ShutdownCause into QAPI en


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] d43013: qapi: Turn ShutdownCause into QAPI enum
Date: Wed, 19 Dec 2018 07:30:27 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: d43013e24de2f101f2d878823d78e2c1f8e2d6ed
      
https://github.com/qemu/qemu/commit/d43013e24de2f101f2d878823d78e2c1f8e2d6ed
  Author: Dominik Csapak <address@hidden>
  Date:   2018-12-18 (Tue, 18 Dec 2018)

  Changed paths:
    M include/sysemu/sysemu.h
    M qapi/run-state.json

  Log Message:
  -----------
  qapi: Turn ShutdownCause into QAPI enum

Needed so the patch after next can add ShutdownCause to QMP events
SHUTDOWN and RESET.

Signed-off-by: Dominik Csapak <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: ecd7a0d5bbfbbb6922dfe4049227256d1eafa3b8
      
https://github.com/qemu/qemu/commit/ecd7a0d5bbfbbb6922dfe4049227256d1eafa3b8
  Author: Dominik Csapak <address@hidden>
  Date:   2018-12-18 (Tue, 18 Dec 2018)

  Changed paths:
    M qapi/run-state.json
    M tests/qemu-iotests/060.out
    M tests/qemu-iotests/071.out
    M tests/qemu-iotests/081.out
    M tests/qemu-iotests/087.out
    M tests/qemu-iotests/094.out
    M tests/qemu-iotests/109.out
    M tests/qemu-iotests/117.out
    M tests/qemu-iotests/119.out
    M tests/qemu-iotests/120.out
    M tests/qemu-iotests/127.out
    M tests/qemu-iotests/140.out
    M tests/qemu-iotests/143.out
    M tests/qemu-iotests/156.out
    M tests/qemu-iotests/176.out
    M tests/qemu-iotests/183.out
    M tests/qemu-iotests/184.out
    M tests/qemu-iotests/185.out
    M tests/qemu-iotests/191.out
    M tests/qemu-iotests/195.out
    M tests/qemu-iotests/223.out
    M tests/qemu-iotests/227.out
    M vl.c

  Log Message:
  -----------
  qmp: Add reason to SHUTDOWN and RESET events

This makes it possible to determine what the exact reason was for
a RESET or a SHUTDOWN. A management layer might need the specific reason
of those events to determine which cleanups or other actions it needs to do.

This patch also updates the iotests to the new expected output that includes
the reason.

Signed-off-by: Dominik Csapak <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
[Commit message tweaked]
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: 9254893882139b9a7738214d669958df4dfeee2f
      
https://github.com/qemu/qemu/commit/9254893882139b9a7738214d669958df4dfeee2f
  Author: Dominik Csapak <address@hidden>
  Date:   2018-12-18 (Tue, 18 Dec 2018)

  Changed paths:
    M qapi/run-state.json
    M qmp.c
    M tests/qemu-iotests/060.out
    M tests/qemu-iotests/071.out
    M tests/qemu-iotests/081.out
    M tests/qemu-iotests/087.out
    M tests/qemu-iotests/094.out
    M tests/qemu-iotests/109.out
    M tests/qemu-iotests/117.out
    M tests/qemu-iotests/119.out
    M tests/qemu-iotests/120.out
    M tests/qemu-iotests/127.out
    M tests/qemu-iotests/140.out
    M tests/qemu-iotests/143.out
    M tests/qemu-iotests/156.out
    M tests/qemu-iotests/176.out
    M tests/qemu-iotests/183.out
    M tests/qemu-iotests/184.out
    M tests/qemu-iotests/185.out
    M tests/qemu-iotests/191.out
    M tests/qemu-iotests/195.out
    M tests/qemu-iotests/223.out
    M tests/qemu-iotests/227.out

  Log Message:
  -----------
  qmp: Split ShutdownCause host-qmp into quit and system-reset

It is interesting to know whether the shutdown cause was 'quit' or
'reset', especially when using "--no-reboot". In that case, a management
layer can now determine if the guest wanted a reboot or shutdown, and
can act accordingly.

Changes the output of the reason in the iotests from 'host-qmp' to
'host-qmp-quit'. This does not break compatibility because
the field was introduced in the same version.

Signed-off-by: Dominik Csapak <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
[Commit message tweaked]
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: 46ea94ca9cfcd56c27efafd2ff32281360e0267f
      
https://github.com/qemu/qemu/commit/46ea94ca9cfcd56c27efafd2ff32281360e0267f
  Author: Daniel Henrique Barboza <address@hidden>
  Date:   2018-12-18 (Tue, 18 Dec 2018)

  Changed paths:
    M hw/acpi/core.c
    M hw/i386/xen/xen-hvm.c
    M include/sysemu/sysemu.h
    M qapi/misc.json
    M vl.c

  Log Message:
  -----------
  qmp: query-current-machine with wakeup-suspend-support

When issuing the qmp/hmp 'system_wakeup' command, what happens in a
nutshell is:

- qmp_system_wakeup_request set runstate to RUNNING, sets a wakeup_reason
and notify the event
- in the main_loop, all vcpus are paused, a system reset is issued, all
subscribers of wakeup_notifiers receives a notification, vcpus are then
resumed and the wake up QAPI event is fired

Note that this procedure alone doesn't ensure that the guest will awake
from SUSPENDED state - the subscribers of the wake up event must take
action to resume the guest, otherwise the guest will simply reboot. At
this moment, only the ACPI machines via acpi_pm1_cnt_init and xen_hvm_init
have wake-up from suspend support.

However, only the presence of 'system_wakeup' is required for QGA to
support 'guest-suspend-ram' and 'guest-suspend-hybrid' at this moment.
This means that the user/management will expect to suspend the guest using
one of those suspend commands and then resume execution using system_wakeup,
regardless of the support offered in system_wakeup in the first place.

This patch creates a new API called query-current-machine [1], that holds
a new flag called 'wakeup-suspend-support' that indicates if the guest
supports wake up from suspend via system_wakeup. The machine is considered
to implement wake-up support if a call to a new 'qemu_register_wakeup_support'
is made during its init, as it is now being done inside acpi_pm1_cnt_init
and xen_hvm_init. This allows for any other machine type to declare wake-up
support regardless of ACPI state or wakeup_notifiers subscription, making easier
for newer implementations that might have their own mechanisms in the future.

This is the expected output of query-current-machine when running a x86
guest:

{"execute" : "query-current-machine"}
{"return": {"wakeup-suspend-support": true}}

Running the same x86 guest, but with the --no-acpi option:

{"execute" : "query-current-machine"}
{"return": {"wakeup-suspend-support": false}}

This is the output when running a pseries guest:

{"execute" : "query-current-machine"}
{"return": {"wakeup-suspend-support": false}}

With this extra tool, management can avoid situations where a guest
that does not have proper suspend/wake capabilities ends up in
inconsistent state (e.g.
https://github.com/open-power-host-os/qemu/issues/31).

[1] the decision of creating the query-current-machine API is based
on discussions in the QEMU mailing list where it was decided that
query-target wasn't a proper place to store the wake-up flag, neither
was query-machines because this isn't a static property of the
machine object. This new API can then be used to store other
dynamic machine properties that are scattered around the code
ATM. More info at:
https://lists.gnu.org/archive/html/qemu-devel/2018-05/msg04235.html

Reported-by: Balamuruhan S <address@hidden>
Signed-off-by: Daniel Henrique Barboza <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Acked-by: Eduardo Habkost <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: f8a577773815cc8ff7154bdb114a6f8ee4165edc
      
https://github.com/qemu/qemu/commit/f8a577773815cc8ff7154bdb114a6f8ee4165edc
  Author: Daniel Henrique Barboza <address@hidden>
  Date:   2018-12-18 (Tue, 18 Dec 2018)

  Changed paths:
    M qga/qapi-schema.json

  Log Message:
  -----------
  qga: update guest-suspend-ram and guest-suspend-hybrid descriptions

This patch updates the descriptions of 'guest-suspend-ram' and
'guest-suspend-hybrid' to mention that both commands relies now
on the proper support for wake up from suspend, retrieved by the
'wakeup-suspend-support' attribute of the 'query-current-machine'
QMP command.

Reported-by: Balamuruhan S <address@hidden>
Signed-off-by: Daniel Henrique Barboza <address@hidden>
Reviewed-by: Michael Roth <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Acked-by: Eduardo Habkost <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: fb0641121072d9d612773370688a6887bb78db08
      
https://github.com/qemu/qemu/commit/fb0641121072d9d612773370688a6887bb78db08
  Author: Daniel Henrique Barboza <address@hidden>
  Date:   2018-12-18 (Tue, 18 Dec 2018)

  Changed paths:
    M hmp.c
    M hw/acpi/core.c
    M hw/char/serial.c
    M hw/input/ps2.c
    M hw/timer/mc146818rtc.c
    M include/sysemu/sysemu.h
    M migration/migration.c
    M qapi/misc.json
    M qmp.c
    M vl.c

  Log Message:
  -----------
  qmp hmp: Make system_wakeup check wake-up support and run state

The qmp/hmp command 'system_wakeup' is simply a direct call to
'qemu_system_wakeup_request' from vl.c. This function verifies if
runstate is SUSPENDED and if the wake up reason is valid before
proceeding. However, no error or warning is thrown if any of those
pre-requirements isn't met. There is no way for the caller to
differentiate between a successful wakeup or an error state caused
when trying to wake up a guest that wasn't suspended.

This means that system_wakeup is silently failing, which can be
considered a bug. Adding error handling isn't an API break in this
case - applications that didn't check the result will remain broken,
the ones that check it will have a chance to deal with it.

Adding to that, the commit before previous created a new QMP API called
query-current-machine, with a new flag called wakeup-suspend-support,
that indicates if the guest has the capability of waking up from suspended
state. Although such guest will never reach SUSPENDED state and erroring
it out in this scenario would suffice, it is more informative for the user
to differentiate between a failure because the guest isn't suspended versus
a failure because the guest does not have support for wake up at all.

All this considered, this patch changes qmp_system_wakeup to check if
the guest is capable of waking up from suspend, and if it is suspended.
After this patch, this is the output of system_wakeup in a guest that
does not have wake-up from suspend support (ppc64):

(qemu) system_wakeup
wake-up from suspend is not supported by this guest
(qemu)

And this is the output of system_wakeup in a x86 guest that has the
support but isn't suspended:

(qemu) system_wakeup
Unable to wake up: guest is not in suspended state
(qemu)

Reported-by: Balamuruhan S <address@hidden>
Signed-off-by: Daniel Henrique Barboza <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Acked-by: Eduardo Habkost <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: ce1a1aec47877a281d69dbc2e65f86bfe8fea231
      
https://github.com/qemu/qemu/commit/ce1a1aec47877a281d69dbc2e65f86bfe8fea231
  Author: Marc-André Lureau <address@hidden>
  Date:   2018-12-18 (Tue, 18 Dec 2018)

  Changed paths:
    M scripts/qapi/common.py

  Log Message:
  -----------
  qapi: fix flat union on uncovered branches conditionals

Default branches variant should use the member conditional.

This fixes compilation with --disable-replication.

Fixes: 335d10cd8e2c3bb6067804b095aaf6371fc1983e

Signed-off-by: Marc-André Lureau <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
[Long line wrapped]
Signed-off-by: Markus Armbruster <address@hidden>


  Commit: adf02c4419e9ac4b3d9a16efdb7e3089c19ae246
      
https://github.com/qemu/qemu/commit/adf02c4419e9ac4b3d9a16efdb7e3089c19ae246
  Author: Peter Maydell <address@hidden>
  Date:   2018-12-19 (Wed, 19 Dec 2018)

  Changed paths:
    M hmp.c
    M hw/acpi/core.c
    M hw/char/serial.c
    M hw/i386/xen/xen-hvm.c
    M hw/input/ps2.c
    M hw/timer/mc146818rtc.c
    M include/sysemu/sysemu.h
    M migration/migration.c
    M qapi/misc.json
    M qapi/run-state.json
    M qga/qapi-schema.json
    M qmp.c
    M scripts/qapi/common.py
    M tests/qemu-iotests/060.out
    M tests/qemu-iotests/071.out
    M tests/qemu-iotests/081.out
    M tests/qemu-iotests/087.out
    M tests/qemu-iotests/094.out
    M tests/qemu-iotests/109.out
    M tests/qemu-iotests/117.out
    M tests/qemu-iotests/119.out
    M tests/qemu-iotests/120.out
    M tests/qemu-iotests/127.out
    M tests/qemu-iotests/140.out
    M tests/qemu-iotests/143.out
    M tests/qemu-iotests/156.out
    M tests/qemu-iotests/176.out
    M tests/qemu-iotests/183.out
    M tests/qemu-iotests/184.out
    M tests/qemu-iotests/185.out
    M tests/qemu-iotests/191.out
    M tests/qemu-iotests/195.out
    M tests/qemu-iotests/223.out
    M tests/qemu-iotests/227.out
    M vl.c

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

QAPI patches for 2018-12-18

# gpg: Signature made Tue 18 Dec 2018 07:20:11 GMT
# gpg:                using RSA key 3870B400EB918653
# gpg: Good signature from "Markus Armbruster <address@hidden>"
# gpg:                 aka "Markus Armbruster <address@hidden>"
# Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653

* remotes/armbru/tags/pull-qapi-2018-12-18:
  qapi: fix flat union on uncovered branches conditionals
  qmp hmp: Make system_wakeup check wake-up support and run state
  qga: update guest-suspend-ram and guest-suspend-hybrid descriptions
  qmp: query-current-machine with wakeup-suspend-support
  qmp: Split ShutdownCause host-qmp into quit and system-reset
  qmp: Add reason to SHUTDOWN and RESET events
  qapi: Turn ShutdownCause into QAPI enum

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


Compare: https://github.com/qemu/qemu/compare/e85c577158a2...adf02c4419e9
      **NOTE:** This service has been marked for deprecation: 
https://developer.github.com/changes/2018-04-25-github-services-deprecation/

      Functionality will be removed from GitHub.com on January 31st, 2019.

reply via email to

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