All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Daniel Henrique Barboza <danielhb413@gmail.com>
Cc: qemu-devel@nongnu.org, ehabkost@redhat.com, mst@redhat.com,
	mdroth@linux.vnet.ibm.com, imammedo@redhat.com
Subject: Re: [Qemu-devel] [PATCH v11 1/3] qmp: query-current-machine with wakeup-suspend-support
Date: Thu, 06 Dec 2018 07:53:56 +0100	[thread overview]
Message-ID: <8736rbkuwr.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <20181205194701.17836-2-danielhb413@gmail.com> (Daniel Henrique Barboza's message of "Wed, 5 Dec 2018 17:46:59 -0200")

Daniel Henrique Barboza <danielhb413@gmail.com> writes:

> 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 <bala24@linux.vnet.ibm.com>
> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>

Reviewed-by: Markus Armbruster <armbru@redhat.com>

  reply	other threads:[~2018-12-06  6:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-05 19:46 [Qemu-devel] [PATCH v11 0/3] wakeup-from-suspend and system_wakeup changes Daniel Henrique Barboza
2018-12-05 19:46 ` [Qemu-devel] [PATCH v11 1/3] qmp: query-current-machine with wakeup-suspend-support Daniel Henrique Barboza
2018-12-06  6:53   ` Markus Armbruster [this message]
2018-12-05 19:47 ` [Qemu-devel] [PATCH v11 2/3] qga: update guest-suspend-ram and guest-suspend-hybrid descriptions Daniel Henrique Barboza
2018-12-06  6:54   ` Markus Armbruster
2018-12-05 19:47 ` [Qemu-devel] [PATCH v11 3/3] qmp hmp: Make system_wakeup check wake-up support and run state Daniel Henrique Barboza
2018-12-06  6:58   ` Markus Armbruster
2018-12-07 20:02   ` Michael S. Tsirkin
2018-12-06  6:59 ` [Qemu-devel] [PATCH v11 0/3] wakeup-from-suspend and system_wakeup changes Markus Armbruster
2018-12-07 19:54   ` Eduardo Habkost
2018-12-10  6:39     ` Markus Armbruster
2018-12-10  7:30 ` Markus Armbruster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8736rbkuwr.fsf@dusky.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=danielhb413@gmail.com \
    --cc=ehabkost@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.