From nobody Sat Feb 7 05:24:58 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1669210551; cv=none; d=zohomail.com; s=zohoarc; b=f45itruNEZb2mB18M6dMgTJESuYwQSL6BQ/wUc+3aCisFJOzIqkL4uwy3IfvLFcwcMd/5kmrB2JTaLdRKyU2NNjwDCR54MLbt+kqINo0JNzdmGUYrpEPXe7ihtEtKUGm5sWINOhC4ZJg+ZL3O1rXF8/1380DZ+lbgjL5748H6Fc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1669210551; h=Content-Type:Content-Transfer-Encoding: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; bh=sTKJHpwW5etiBX8eCgEq0BodbzKplmg3m3/HUBuLF5U=; b=TeK0/fVuFiSxzV7HapAxJl5thWTc4Gd6Ht8jcOzEEJXCIKDZo7sTwwyORr+EvfsfsR9fAUOWbufL2nLz60Iwg6DQrPN2xRHFGHpEvmGAausHxUnZJs/ZsECJ7dvp1UHugyfS/VFnbe/kmwBYjW8XGbQeI86j8kYmBpIz8SCAtbw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1669210551603911.2794978475131; Wed, 23 Nov 2022 05:35:51 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-446-B72ql2pvPb6s2cc1xoJVwg-1; Wed, 23 Nov 2022 08:35:48 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 18FE185A588; Wed, 23 Nov 2022 13:35:46 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 04BEB112D160; Wed, 23 Nov 2022 13:35:46 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id DAC781946589; Wed, 23 Nov 2022 13:35:45 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 73CF91946587 for ; Wed, 23 Nov 2022 13:31:31 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 3C1104EA55; Wed, 23 Nov 2022 13:31:31 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.43.2.106]) by smtp.corp.redhat.com (Postfix) with ESMTP id D41944EA4A for ; Wed, 23 Nov 2022 13:31:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669210550; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=sTKJHpwW5etiBX8eCgEq0BodbzKplmg3m3/HUBuLF5U=; b=dbbQHxLB+bhFwIeF7ik987K1lFa9+GjDjGFo+UxYuGGy7u5J+CTAMDIs2mk+eWA/xCVpFW 4uvc85yscigF+HtB9avEDrFBwPFfw/DxnoFmk7BwIDSRNX1YuobrnBYW99u3iDbcnh6kLW ArD01ysspiN33+hAYGFuPjSjegL4bvM= X-MC-Unique: B72ql2pvPb6s2cc1xoJVwg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Kristina Hanicova To: libvir-list@redhat.com Subject: [PATCH 1/2] qemu: refresh state after reset Date: Wed, 23 Nov 2022 14:31:16 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1669210553408100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Domain state may change during the reset and qemu does not always send events about it. In case it happens, the state would be inconsistent with the internal state of qemu which could cause additional problems. The solution is to refresh state after a successful reset to query qemu about the current domain state. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D1824722 Signed-off-by: Kristina Hanicova --- src/qemu/qemu_driver.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index ff5a743716..b2060ee843 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -2000,6 +2000,7 @@ qemuDomainReset(virDomainPtr dom, unsigned int flags) int ret =3D -1; qemuDomainObjPrivate *priv; virDomainState state; + virQEMUDriver *driver =3D dom->conn->privateData; =20 virCheckFlags(0, -1); =20 @@ -2023,8 +2024,11 @@ qemuDomainReset(virDomainPtr dom, unsigned int flags) priv->fakeReboot =3D false; =20 state =3D virDomainObjGetState(vm, NULL); - if (state =3D=3D VIR_DOMAIN_CRASHED) + if (state =3D=3D VIR_DOMAIN_CRASHED) { virDomainObjSetState(vm, VIR_DOMAIN_PAUSED, VIR_DOMAIN_PAUSED_CRAS= HED); + } else if (qemuProcessRefreshState(driver, vm, VIR_ASYNC_JOB_NONE) < 0= ) { + goto cleanup; + } =20 endjob: virDomainObjEndJob(vm); --=20 2.38.1