]> git.proxmox.com Git - mirror_qemu.git/commit - qga/commands-posix.c
qga: removing bios_supports_mode
authorDaniel Henrique Barboza <danielhb413@gmail.com>
Thu, 21 Jun 2018 10:21:53 +0000 (07:21 -0300)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 3 Jul 2018 20:20:51 +0000 (15:20 -0500)
commit73e1d8eb9b738cef3dee2da26bb669b1092a4c12
tree355d04f74ec39702542242a261546d1e0c357fbb
parent067927d62e097a8a3624a926e792756ce7a353ed
qga: removing bios_supports_mode

bios_support_mode verifies if the guest has support for a certain
suspend mode but it doesn't inform back which suspend tool
provides it. The caller, guest_suspend, executes all suspend
strategies in order again.

After adding systemd suspend support, bios_support_mode now will
verify for support for systemd, then pmutils, then Linux sys state
file. In a worst case scenario where both systemd and pmutils isn't
supported but Linux sys state is:

- bios_supports_mode will check for systemd, then pmutils, then
Linux sys state. It will tell guest_suspend that there is support,
but it will not tell who provides it;

- guest_suspend will try to execute (and fail) systemd suspend,
then pmutils suspend, to only then use the Linux sys suspend.
The time spent executing systemd and pmutils suspend was wasted
and could be avoided, but only bios_support_mode knew it but
didn't inform it back.

A quicker approach is to nuke bios_supports_mode and control
whether we found support at all with a bool flag inside
guest_suspend. guest_suspend will search for suspend support
and execute it as soon as possible. If the a given suspend
mechanism fails, continue to the next. If no suspend
support is found, the "not supported" message is still being
sent back to the user.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
qga/commands-posix.c