From nobody Thu Apr 18 12:41:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599828710; cv=none; d=zohomail.com; s=zohoarc; b=T1lKw8oaSTnoRzAd1T9FehUCV9/oyPZgALoOSrjCmGXA5LjlotXgfCb4Hb2OmziUN244dP8bRCt0G0hmEoGPkQdGmkObJLsdeHeqJd502drxNkyEFwcdZ7Wusj5TWpi9rzxZ41YwxPloFUwira7fvtnFYZu/FJcS5fnlK+uklJ8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599828710; h=Content-Type: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=jp8ABoa+Fmgc//1ERox1HLLGaw6fLD2T8TMZS1q5ENg=; b=h4IBA7mFznXjvvivYY9FFaznTR+bMUiHDoo0YCC5fW8Qp5pnSPuhlDXpkXPKHJxEWhUHzEv9iu1uYj7D+ITspI8i+Tr9qx802qIhLIcRd1ybSgscy6sdZGzQpUdrTANL+AaqZwNE9BXaNDSv/3h36AUO3ACNx9VaEfg4s0OwE5Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1599828710808671.2312901450708; Fri, 11 Sep 2020 05:51:50 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-594-0C29WMB7NVOhesz88xUhLA-1; Fri, 11 Sep 2020 08:51:47 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id C68891007B3B; Fri, 11 Sep 2020 12:51:41 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 56BA37ED9A; Fri, 11 Sep 2020 12:51:41 +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 54A8D180B65D; Fri, 11 Sep 2020 12:51:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08BCpMiq020539 for ; Fri, 11 Sep 2020 08:51:22 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8AC1D821EE; Fri, 11 Sep 2020 12:51:22 +0000 (UTC) Received: from nautilus.redhat.com (unknown [10.40.192.159]) by smtp.corp.redhat.com (Postfix) with ESMTP id D72A188D50; Fri, 11 Sep 2020 12:51:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599828709; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=jp8ABoa+Fmgc//1ERox1HLLGaw6fLD2T8TMZS1q5ENg=; b=H9oywnhg3CNXlrZo2oaIirUEJVT2I93SGoKnQMxRflNouJif/mO3dBqkmAgncceFGDadqm pEh9gIbmDvR7/iwn6bPCO8pQyNT2uUC0jH93VgSHPyPmCLT/Rw3HVf+lwb7qxO2OEzyMtE GWgCimIg+cYTL8aI34j3w+8lwsOGKtc= X-MC-Unique: 0C29WMB7NVOhesz88xUhLA-1 From: Erik Skultety To: libvir-list@redhat.com Subject: [libvirt PATCH] qemu: qemuDomainPMSuspendAgent: Don't assign to 'ret' in a conditional Date: Fri, 11 Sep 2020 14:51:15 +0200 Message-Id: <9824a82198d97c40ff0e8f423888a7b9ccf5b301.1599828598.git.eskultet@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: Erik Skultety 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" When the guest agent isn't running, we still report success on a PM suspend action even though we logged an error correctly, this is because we poisoned the 'ret' value a few lines above. Fixes: a663a860819287e041c3de672aad1d8543098ecc Signed-off-by: Erik Skultety --- Pushed as trivial. src/qemu/qemu_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 2e46931c71..fcdee31971 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -16770,7 +16770,7 @@ qemuDomainPMSuspendAgent(virQEMUDriverPtr driver, if (qemuDomainObjBeginAgentJob(driver, vm, QEMU_AGENT_JOB_MODIFY) < 0) return -1; - if ((ret =3D virDomainObjCheckActive(vm)) < 0) + if (virDomainObjCheckActive(vm) < 0) goto endjob; if (!qemuDomainAgentAvailable(vm, true)) -- 2.26.2