qemu/qga-Fix-suspend-on-Linux-guests-without-systemd.patch
Jiabo Feng b239b0b2d5 QEMU update to version 6.2.0-78(master)
- sw_64: Added sw64 architecture related updates
- virtio-crypto: verify src&dst buffer length for sym request
- vhost-vdpa: do not cleanup the vdpa/vhost-net structures if peer nic is present
- qga: Fix suspend on Linux guests without systemd
- tests: vhost-user-test: release mutex on protocol violation
- qapi: support updating expected test output via make
- block: Fix misleading hexadecimal format
- block/rbd: fix write zeroes with growing images
- block/nbd.c: Fixed IO request coroutine not being wakeup when kill NBD server
- block/nfs: Fix 32-bit Windows build
- qapi/qdev: Tidy up device_add documentation
- hw/xen/xen_pt: fix uninitialized variable
- migration/ram: Fix error handling in ram_write_tracking_start()
- docs/about/build-platforms: Refine the distro support policy
- xen-block: Avoid leaks on new error path
- QGA VSS: Add wrapper to send log to debugger and stderr
- chardev/char-socket: set s->listener = NULL in char_socket_finalize
- qapi/block: Tidy up block-latency-histogram-set documentation
- disas/riscv Fix ctzw disassemble
- vfio: Fix vfio_get_dev_region() trace event
- migration/ram: Fix populate_read_range()
- Check and report for incomplete 'global' option  format

Signed-off-by: Jiabo Feng <fengjiabo1@huawei.com>
2023-08-16 08:57:07 +08:00

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