From nobody Sun Feb 8 03:33:10 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1554826741; cv=none; d=zoho.com; s=zohoarc; b=EZusyVbPT3VanUgav+Y88abihB1MLCTl5VSPCZGm0WkRsIIco5a5qSG/ymkyNJOlMoD/UOwjMap7qv3zTOz6BkwauFYCV2K6HFmMTaYW2nIoYQW5C/wWj2HlY7ZU4eiuyVHeAHkqrp6iuiEaX7P55n/p7Ty9MV2W7zkIUl9KNkg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1554826741; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=CdyN4acTQGM7p92D5CNZoCufMWXdOuRpA+eY003qfAE=; b=kG+49hICNffkjSI/7G5iyP4Xbe25uSjtfSdHntQkHr8N/i3TDbRe6V+RCzCPybhhubhGzK0qQCJb2ctY2VnZiv+8OE1R607faXXmYhPWPVMQr4BtWCVc/yqnGQvRvX1xJaHQAcgGOaAss79sl3Ruh2QLMaPe5Goy01JWYHZvG94= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1554826741533300.5626790404484; Tue, 9 Apr 2019 09:19:01 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 988EB70D74; Tue, 9 Apr 2019 16:18:59 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F2C66600CC; Tue, 9 Apr 2019 16:18:56 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 1C0623FB10; Tue, 9 Apr 2019 16:18:46 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x39GIgaT016371 for ; Tue, 9 Apr 2019 12:18:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id D0A0C5D961; Tue, 9 Apr 2019 16:18:42 +0000 (UTC) Received: from mx1.redhat.com (ext-mx19.extmail.prod.ext.phx2.redhat.com [10.5.110.48]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C8A475D9C9; Tue, 9 Apr 2019 16:18:40 +0000 (UTC) Received: from mail-qk1-f193.google.com (mail-qk1-f193.google.com [209.85.222.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 81B7630611FA; Tue, 9 Apr 2019 16:18:31 +0000 (UTC) Received: by mail-qk1-f193.google.com with SMTP id k130so10631251qke.3; Tue, 09 Apr 2019 09:18:31 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:f701:d7d6:9e6a:ca5e:8a85:57a7]) by smtp.gmail.com with ESMTPSA id y34sm19152889qta.96.2019.04.09.09.18.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 09 Apr 2019 09:18:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=G1hvSyJDjT54u5HHde/p2qWl3qY+8Gj9d+UpRqTftgQ=; b=SrUpXgApEy3QXnq+DaEkYOxHsCxhkuVtKaI3KqGfDT4vSr1PJWh5ol2RdF2tqDFoKj NNd0Zv6HjfP/kzziByWOf2x/ixbhbQb9m7k+Sc6J8JXK8jZVjc5B9tvNnR79JcHXLMKt CCnvlTr2osNskG2Hhvy9eN8EUQrq9f2jPQhQFJ0+LjKnH/R1FZ80Wsy4uwHPufWjF8ZY vVTcRkRum1zsNjtsuSC5NiXKcw1dvsW0VWE+P8wE5qSKYJSxJjrHRBwcSpVLa4Eqns7H G74ILJur2zX71aitOKGDmzASd0gbnyOHoqvvWvrxIF6hMtXJho4SM3aVvWKsW4hjfe1H hkTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=G1hvSyJDjT54u5HHde/p2qWl3qY+8Gj9d+UpRqTftgQ=; b=cv1GMFuVYAtvcw5PKX5Al2H5DnkpkKSYpWHhVoKhqSbbVNI7ahzVMRfDNo+DuI/zUK 5JwYS4XnrKr3J1aS8ZwKpxz82NaQY3rFtzb3BJI61bNMByI977AHFyJvXxrOSdp1Xtz6 RGGnqjuqsp8yXwt6jYbwg8Oy2/n7zHINrsFC1VkCI30zX4QeTOTik9h0ll3efANFxOGp wk4MTzEZc1CfSduETETDtk2ymmaitI/HICg2+v0ZJ1PM7KlJjsNvbPyMRfbb/s0ZihGd +5/PIuMOkXhOmSr67OjTras4SS2zIwpd8QI+obBtXdO1VfRc1Xg2y5/mQ5nMZUXzNYyz yFrA== X-Gm-Message-State: APjAAAWOwpvnwOL06dIR0JaMsWSpq4U5zXyPIruWA+McsvHFCKcFOGXf BlWjMBHC1J2+BA2TneSQfhGC7Boi X-Google-Smtp-Source: APXvYqzBjznu4GCdzb0xfFmUsrZP1vdhNOb3yb8iiabyPBx6rRq+vFr4FTxJc5FrUlLgmCsAY9EYqQ== X-Received: by 2002:a37:a543:: with SMTP id o64mr27944605qke.235.1554826710526; Tue, 09 Apr 2019 09:18:30 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Tue, 9 Apr 2019 13:18:16 -0300 Message-Id: <20190409161816.21542-4-danielhb413@gmail.com> In-Reply-To: <20190409161816.21542-1-danielhb413@gmail.com> References: <20190409161816.21542-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Tue, 09 Apr 2019 16:18:31 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Tue, 09 Apr 2019 16:18:31 +0000 (UTC) for IP:'209.85.222.193' DOMAIN:'mail-qk1-f193.google.com' HELO:'mail-qk1-f193.google.com' FROM:'danielhb413@gmail.com' RCPT:'' X-RedHat-Spam-Score: -0.108 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_MSPIKE_H2, SPF_PASS) 209.85.222.193 mail-qk1-f193.google.com 209.85.222.193 mail-qk1-f193.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.48 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza , Balamuruhan S , pkrempa@redhat.com Subject: [libvirt] [PATCH v2 3/3] qemuDomainPMSuspendForDuration: check for QEMU_CAPS_PM_WAKEUP_SUPPORT X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 09 Apr 2019 16:19:00 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" If the current QEMU guest can't wake up from suspend properly, avoid suspending the guest at all. This is done by checking the QEMU_CAPS_PM_WAKEUP_SUPPORT cap. The absence of the cap indicates that we're dealing with a QEMU version older than 4.0 (which implements the required QMP API). In this case, proceed as usual with the suspend logic since we can't assume whether the guest has support or not. This is the output of dompmsuspend in a guest that does not have wake-up support declared in the query-current-machine: $ sudo ./run tools/virsh dompmsuspend ub1810-noACPI3 mem error: Domain ub1810-noACPI3 could not be suspended error: this function is not supported by the connection driver: Domain does= not have suspend support Fixes: https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/1759509 Reported-by: Balamuruhan S Signed-off-by: Daniel Henrique Barboza --- src/qemu/qemu_driver.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 7e5bbc3cc9..6ee1247c7b 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -19152,6 +19152,7 @@ qemuDomainPMSuspendForDuration(virDomainPtr dom, virQEMUDriverPtr driver =3D dom->conn->privateData; virDomainObjPtr vm; qemuAgentPtr agent; + qemuDomainObjPrivatePtr priv; int ret =3D -1; =20 virCheckFlags(0, -1); @@ -19174,6 +19175,26 @@ qemuDomainPMSuspendForDuration(virDomainPtr dom, if (!(vm =3D qemuDomObjFromDomain(dom))) goto cleanup; =20 + priv =3D vm->privateData; + + /* + * We can't check just for QEMU_CAPS_WAKEUP_SUSPEND_SUPPORT because, + * in case this cap is disabled, it is not possible to tell if the gue= st + * does not have wake-up from suspend support or if the current QEMU + * instance does not have the API. + * + * The case we want to handle here is when QEMU has the API and + * QEMU_CAPS_WAKEUP_SUSPEND_SUPPORT cap is disabled. Otherwise, do + * not interfere with the suspend process. + */ + if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_QUERY_CURRENT_MACHINE) && + !virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_PM_WAKEUP_SUPPORT)) { + + virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", + _("Domain does not have suspend support")); + goto cleanup; + } + if (virDomainPMSuspendForDurationEnsureACL(dom->conn, vm->def) < 0) goto cleanup; =20 --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list