From: Eduardo Habkost <ehabkost@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: Daniel Henrique Barboza <danielhb@linux.ibm.com>,
qemu-devel@nongnu.org, dgilbert@redhat.com,
mdroth@linux.vnet.ibm.com,
Stefano Stabellini <sstabellini@kernel.org>,
Anthony Perard <anthony.perard@citrix.com>,
libvir-list@redhat.com, "Michael S. Tsirkin" <mst@redhat.com>,
Igor Mammedov <imammedo@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v7 1/3] qmp: adding 'wakeup-suspend-support' in query-target
Date: Mon, 21 May 2018 15:14:35 -0300 [thread overview]
Message-ID: <20180521181435.GN25013@localhost.localdomain> (raw)
In-Reply-To: <87wow1gxi8.fsf@dusky.pond.sub.org>
On Fri, May 18, 2018 at 10:48:31AM +0200, Markus Armbruster wrote:
> Cc'ing a few more people.
>
> Daniel Henrique Barboza <danielhb@linux.ibm.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 there are only two subscribers of the wake up event: one
> > in hw/acpi/core.c and another one in hw/i386/xen/xen-hvm.c. This means
> > that system_wakeup does not work as intended with other architectures.
> >
> > 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 adds a new flag called 'wakeup-suspend-support' in TargetInfo
> > that allows the caller to query if the guest supports wake up from
> > suspend via system_wakeup. It goes over the subscribers of the wake up
> > event and, if it's empty, it assumes that the guest does not support
> > wake up from suspend (and thus, pm-suspend itself).
> >
> > This is the expected output of query-target when running a x86 guest:
> >
> > {"execute" : "query-target"}
> > {"return": {"arch": "x86_64", "wakeup-suspend-support": true}}
> >
> > This is the output when running a pseries guest:
> >
> > {"execute" : "query-target"}
> > {"return": {"arch": "ppc64", "wakeup-suspend-support": false}}
> >
> > Given that the TargetInfo structure is read-only, adding a new flag to
> > it is backwards compatible. There is no need to deprecate the old
> > TargetInfo format.
> >
> > 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).
> >
> > Reported-by: Balamuruhan S <bala24@linux.vnet.ibm.com>
> > Signed-off-by: Daniel Henrique Barboza <danielhb@linux.ibm.com>
>
> Is query-target is the right place to carry this flag? v7 is rather
> late for this kind of question; my sincere apologies.
[...]
>
> Issue#2: the flag isn't a property of the target. Due to -no-acpi, it's
> not even a property of the machine type. If it was, query-machines
> would be the natural owner of the flag.
>
> Perhaps query-machines is still the proper owner. The value of
> wakeup-suspend-support would have to depend on -no-acpi for the machine
> types that honor it. Not ideal; I'd prefer MachineInfo to be static.
> Tolerable? I guess that's also a libvirt question.
It depends when libvirt is going to query it. Is it OK to only
query it after the VM is already up and running? If it is, then
we can simply expose it as a read-only property of the machine
object.
Or, if we don't want to rely on qom-get as a stable API, we can
add a new query command (query-machine? query-power-management?)
--
Eduardo
next prev parent reply other threads:[~2018-05-21 18:14 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-17 19:23 [Qemu-devel] [PATCH v7 0/3] wakeup-from-suspend and system_wakeup changes Daniel Henrique Barboza
2018-05-17 19:23 ` [Qemu-devel] [PATCH v7 1/3] qmp: adding 'wakeup-suspend-support' in query-target Daniel Henrique Barboza
2018-05-18 8:48 ` Markus Armbruster
2018-05-21 18:14 ` Eduardo Habkost [this message]
2018-05-21 19:46 ` Daniel Henrique Barboza
2018-05-21 20:26 ` Eduardo Habkost
2018-05-23 9:17 ` Markus Armbruster
2018-05-23 12:27 ` Eduardo Habkost
2018-05-23 14:11 ` Daniel Henrique Barboza
2018-05-23 15:53 ` Markus Armbruster
2018-05-24 18:57 ` Eduardo Habkost
2018-05-25 6:30 ` Markus Armbruster
2018-05-25 20:30 ` Eduardo Habkost
2018-05-28 7:23 ` Markus Armbruster
2018-05-29 14:55 ` Eduardo Habkost
2018-06-19 20:29 ` Daniel Henrique Barboza
2018-06-20 7:09 ` Markus Armbruster
2018-05-17 19:23 ` [Qemu-devel] [PATCH v7 2/3] qga: update guest-suspend-ram and guest-suspend-hybrid descriptions Daniel Henrique Barboza
2018-05-17 19:23 ` [Qemu-devel] [PATCH v7 3/3] qmp.c: system_wakeup: runstate and wake-up support check Daniel Henrique Barboza
2018-05-18 8:48 ` Markus Armbruster
2018-05-18 12:52 ` Daniel Henrique Barboza
2018-05-18 15:00 ` 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=20180521181435.GN25013@localhost.localdomain \
--to=ehabkost@redhat.com \
--cc=anthony.perard@citrix.com \
--cc=armbru@redhat.com \
--cc=danielhb@linux.ibm.com \
--cc=dgilbert@redhat.com \
--cc=imammedo@redhat.com \
--cc=libvir-list@redhat.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=sstabellini@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).