From nobody Sun Feb 8 22:43:22 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=1637760664; cv=none; d=zohomail.com; s=zohoarc; b=WZraMjk6c1Ure3mQDRL/A+AXapsrLfujK6OcS/y9/Ae4DZqOcPT4eOqZjQOlz7uEKRQF96xfdXXclWGJ+poY9eXIbZXs7M5WHK/MC5FsiEqyscbZUZaEgY+hKwEfcSEsQv/usuItQDN7fqtvCEmWmmpnlb1WlQ1U8AKMf6HiplA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1637760664; 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=b+BTmJZG5JnlS/q7VTScLuRRi8iIx3uuJTc0OZ2hVsY=; b=PMPPiZ3IPMJIcU/dfDlGLzOLjkKFgXKhWP+1OAyNC4wbCuV0wUniFu3lmhO6bIB5Jwi2bAn4te9EBKngEDOe9TuCVK7+sVND7jhPUW5AjL1/ix+F/jwIkgeg5vyUsOXZ46M4CmQyKG71O56PjxR0ncMNrqFfGUDnUhfaWC4SEdw= 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 1637760664641445.5544809704285; Wed, 24 Nov 2021 05:31:04 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-191-fc1nW4W-MxeIoVu9QJIlmg-1; Wed, 24 Nov 2021 08:30:30 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6F23F81EE72; Wed, 24 Nov 2021 13:30:25 +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 0F4EC19733; Wed, 24 Nov 2021 13:30:25 +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 D5E064A705; Wed, 24 Nov 2021 13:30:24 +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 1AODTWr0012644 for ; Wed, 24 Nov 2021 08:29:32 -0500 Received: by smtp.corp.redhat.com (Postfix) id DF5B7ADDC; Wed, 24 Nov 2021 13:29:32 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.43.2.72]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6808A5DF21 for ; Wed, 24 Nov 2021 13:29:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1637760663; 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=b+BTmJZG5JnlS/q7VTScLuRRi8iIx3uuJTc0OZ2hVsY=; b=gucKvp9CfZVizw7D/oJy2uz8c/ur1SOW3BQYFTabDHTPXdVR1kvtUZNlFlkQjRrqz9hEfj BgFpTnvmJePHbeTkw4p2z0T10oov2GeLxm01Od7JsNZ0uzdOli6CNqVyo064M10ZDn4lm+ j+sMfaj7gEi/fnjRlrqBrPdRV4llDhs= X-MC-Unique: fc1nW4W-MxeIoVu9QJIlmg-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 6/7] qemu: turn qemuDomainObjExitMonitor into void Date: Wed, 24 Nov 2021 14:28:54 +0100 Message-Id: <84a7b74fb1c136574a57a547866a022ad26e9baa.1637760513.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com 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.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1637760666240100001 This reverts my commit dc2fd51fd727bbb6de172e0ca4b7dd307bb99180 Check for domain liveness in qemuDomainObjExitMonitor which fixed the symptoms of the bug later fixed by commit 81f50cb92d16643bcd749e3ab5b404b8b7cec643 qemu: Avoid calling qemuProcessStop without a job Signed-off-by: J=C3=A1n Tomko --- src/qemu/THREADS.txt | 5 ----- src/qemu/qemu_domain.c | 15 +-------------- src/qemu/qemu_domain.h | 4 ++-- 3 files changed, 3 insertions(+), 21 deletions(-) diff --git a/src/qemu/THREADS.txt b/src/qemu/THREADS.txt index ff10bef9a0..98aa3165e3 100644 --- a/src/qemu/THREADS.txt +++ b/src/qemu/THREADS.txt @@ -170,11 +170,6 @@ To acquire the QEMU monitor lock - Acquires the virDomainObj *lock =20 These functions must not be used by an asynchronous job. - Note that the virDomainObj is unlocked during the time in - monitor and it can be changed, e.g. if QEMU dies, qemuProcessStop - may free the live domain definition and put the persistent - definition back in vm->def. The callers should check the return - value of ExitMonitor to see if the domain is still alive. =20 =20 To acquire the QEMU monitor lock as part of an asynchronous job diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 94b4081da6..dea7dae4b3 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -5893,24 +5893,11 @@ void qemuDomainObjEnterMonitor(virQEMUDriver *drive= r, /* obj must NOT be locked before calling * * Should be paired with an earlier qemuDomainObjEnterMonitor() call - * - * Returns -1 if the domain is no longer alive after exiting the monitor. - * In that case, the caller should be careful when using obj's data, - * e.g. the live definition in vm->def has been freed by qemuProcessStop - * and replaced by the persistent definition, so pointers stolen - * from the live definition could no longer be valid. */ -int qemuDomainObjExitMonitor(virQEMUDriver *driver, +void qemuDomainObjExitMonitor(virQEMUDriver *driver, virDomainObj *obj) { qemuDomainObjExitMonitorInternal(driver, obj); - if (!virDomainObjIsActive(obj)) { - if (virGetLastErrorCode() =3D=3D VIR_ERR_OK) - virReportError(VIR_ERR_OPERATION_FAILED, "%s", - _("domain is no longer running")); - return -1; - } - return 0; } =20 /* diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index 596add616d..8173c39cdb 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -487,8 +487,8 @@ qemuMonitor *qemuDomainGetMonitor(virDomainObj *vm) void qemuDomainObjEnterMonitor(virQEMUDriver *driver, virDomainObj *obj) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -int qemuDomainObjExitMonitor(virQEMUDriver *driver, - virDomainObj *obj) +void qemuDomainObjExitMonitor(virQEMUDriver *driver, + virDomainObj *obj) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); int qemuDomainObjEnterMonitorAsync(virQEMUDriver *driver, virDomainObj *obj, --=20 2.31.1