79c4324644
Change-Id: I2d302dda68298877c65c99147f5bf22186a59aac
58 lines
1.7 KiB
Diff
58 lines
1.7 KiB
Diff
From 9f4819201fb35b419ea21d37755c4cb62454a270 Mon Sep 17 00:00:00 2001
|
|
From: qihao <qihao_yewu@cmss.chinamobile.com>
|
|
Date: Thu, 10 Aug 2023 13:59:53 +0800
|
|
Subject: [PATCH] qga: Fix suspend on Linux guests without systemd
|
|
|
|
cheery-pick from 86dcb6ab9b603450eb6d896cdc95286de2c7d561
|
|
|
|
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>
|
|
Signed-off-by: qihao_yewu <qihao_yewu@cmss.chinamobile.com>
|
|
---
|
|
qga/commands-posix.c | 12 ++++++------
|
|
1 file changed, 6 insertions(+), 6 deletions(-)
|
|
|
|
diff --git a/qga/commands-posix.c b/qga/commands-posix.c
|
|
index 75dbaab68e..4e06271889 100644
|
|
--- a/qga/commands-posix.c
|
|
+++ b/qga/commands-posix.c
|
|
@@ -2104,10 +2104,10 @@ static void guest_suspend(SuspendMode mode, Error **errp)
|
|
if (systemd_supports_mode(mode, &local_err)) {
|
|
mode_supported = true;
|
|
systemd_suspend(mode, &local_err);
|
|
- }
|
|
|
|
- if (!local_err) {
|
|
- return;
|
|
+ if (!local_err) {
|
|
+ return;
|
|
+ }
|
|
}
|
|
|
|
error_free(local_err);
|
|
@@ -2116,10 +2116,10 @@ static void guest_suspend(SuspendMode mode, Error **errp)
|
|
if (pmutils_supports_mode(mode, &local_err)) {
|
|
mode_supported = true;
|
|
pmutils_suspend(mode, &local_err);
|
|
- }
|
|
|
|
- if (!local_err) {
|
|
- return;
|
|
+ if (!local_err) {
|
|
+ return;
|
|
+ }
|
|
}
|
|
|
|
error_free(local_err);
|
|
--
|
|
2.41.0.windows.1
|
|
|