mirror of
https://github.com/xemu-project/xemu.git
synced 2024-11-23 03:29:43 +00:00
qga: Fix suspend on Linux guests without systemd
Allow the Linux guest agent to attempt each of the suspend methods (systemctl, pm-* and writing to /sys) in turn. Prior to this guests without systemd failed to suspend due to `guest_suspend` returning early regardless of the return value of `systemd_supports_mode`. Signed-off-by: Mark Somerville <mark@qpok.net> Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com> Signed-off-by: Konstantin Kostiuk <kkostiuk@redhat.com> (cherry picked from commit 86dcb6ab9b603450eb6d896cdc95286de2c7d561) Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
This commit is contained in:
parent
8e84a20705
commit
07e7102b8e
@ -1925,10 +1925,10 @@ static void guest_suspend(SuspendMode mode, Error **errp)
|
|||||||
if (systemd_supports_mode(mode, &local_err)) {
|
if (systemd_supports_mode(mode, &local_err)) {
|
||||||
mode_supported = true;
|
mode_supported = true;
|
||||||
systemd_suspend(mode, &local_err);
|
systemd_suspend(mode, &local_err);
|
||||||
}
|
|
||||||
|
|
||||||
if (!local_err) {
|
if (!local_err) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
error_free(local_err);
|
error_free(local_err);
|
||||||
@ -1937,10 +1937,10 @@ static void guest_suspend(SuspendMode mode, Error **errp)
|
|||||||
if (pmutils_supports_mode(mode, &local_err)) {
|
if (pmutils_supports_mode(mode, &local_err)) {
|
||||||
mode_supported = true;
|
mode_supported = true;
|
||||||
pmutils_suspend(mode, &local_err);
|
pmutils_suspend(mode, &local_err);
|
||||||
}
|
|
||||||
|
|
||||||
if (!local_err) {
|
if (!local_err) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
error_free(local_err);
|
error_free(local_err);
|
||||||
|
Loading…
Reference in New Issue
Block a user