From nobody Tue Feb 10 17:03:06 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=qpok.net ARC-Seal: i=1; a=rsa-sha256; t=1680785188; cv=none; d=zohomail.com; s=zohoarc; b=dA5zO63XBG3yPqwWRLUdZPvXlU+48bEDWLZaSY+mkdlS0ytIOyOGP+W05xgdYbp/8Q+rJC4YNC455M9L5XVCyqwApO1IVlRDzKtj+4SqPAhicFGHhAoWeYilPOBt3U1Ln7RvGmiNTMXECciINH1aIyOIulBSp6QSoBnrmZy1gQA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680785188; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=X7MNN92k1/P0lMLaaLCOkqpdgSRo+pdFAKuAkULq5fI=; b=BAkdo05jKTciHTOF2V2gUoZGimp4/61z7Grep1Ht1qxrcyB/NVYMy1HYNgFz4d4SLPkzXP46yixMKSZn5RRGmRakLVjyBa6SU2cxvXtyWqmd6xcLTbsi0j7S+kCNofNbpbVxCBbCl8hwrcrribzAIfdIvLr4inW00hkRuKGToEc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1680785188250516.8114015178513; Thu, 6 Apr 2023 05:46:28 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pkP0G-0006KK-H5; Thu, 06 Apr 2023 08:46:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pkOzt-00066A-9t; Thu, 06 Apr 2023 08:45:50 -0400 Received: from box.qpok.net ([212.71.237.253]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pkOzr-00018w-1m; Thu, 06 Apr 2023 08:45:48 -0400 Received: from authenticated-user (box.qpok.net [212.71.237.253]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by box.qpok.net (Postfix) with ESMTPSA id B10FC40180; Thu, 6 Apr 2023 13:45:44 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=qpok.net; s=mail; t=1680785144; bh=djS7Op4pnwVsDeLZ5KuAHBM/nU4vwLVFXbuUGmAv0Yw=; h=From:To:Cc:Subject:Date:From; b=gIV8DisXUKJ0yFcRxWgAJ8S1gvbLZEA2TmQn1BPTCJu6FPN9vITND/6l9MzxJAP5z 64QSCZg/VtEXCnRYpMZDclkF78v7E3ySqBvOKGRjhYUwT+bkYLf2zkqaoFa9Ep/Xmr OkW4kZFo6DOcC1a+RFTW8vDnq5wj2l2TnpKZRbapLV3tUoAIYx8L0wLo6H3TR0TN5w VBILXtf/pIwC0V1xQeE5jyboNOwb8BuoXTjggYF9WzYYd44J4Pq5pHm5dLDJZpKV6U 7L98vhmUtnT7ppScW8l8mbQCz4D6BGS/jJFuCObAcS8/JLjy1+wIRSTY8pdbhlsSto dTKHCu+XzVM/g== From: Mark Somerville To: qemu-devel@nongnu.org Cc: Michael Roth , Konstantin Kostiuk , qemu-trivial@nongnu.org, Mark Somerville Subject: [PATCH v2] qga: Fix suspend on Linux guests without systemd Date: Thu, 6 Apr 2023 13:45:31 +0100 Message-Id: <20230406124531.9827-1-mark@qpok.net> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=212.71.237.253; envelope-from=mark@qpok.net; helo=box.qpok.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @qpok.net) X-ZM-MESSAGEID: 1680785189513100001 Content-Type: text/plain; charset="utf-8" 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 --- v1: Identical to this version(!) but missing from qemu-devel... Sincere apologies to anyone receiving this patch twice. I ran up against a deeply frustrating and depressing SMTP issue which should now be resovled. 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 079689d79a..59e7154af4 100644 --- a/qga/commands-posix.c +++ b/qga/commands-posix.c @@ -1918,10 +1918,10 @@ static void guest_suspend(SuspendMode mode, Error *= *errp) if (systemd_supports_mode(mode, &local_err)) { mode_supported =3D true; systemd_suspend(mode, &local_err); - } =20 - if (!local_err) { - return; + if (!local_err) { + return; + } } =20 error_free(local_err); @@ -1930,10 +1930,10 @@ static void guest_suspend(SuspendMode mode, Error *= *errp) if (pmutils_supports_mode(mode, &local_err)) { mode_supported =3D true; pmutils_suspend(mode, &local_err); - } =20 - if (!local_err) { - return; + if (!local_err) { + return; + } } =20 error_free(local_err); --=20 2.40.0