From nobody Mon Feb 9 17:59:42 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1615873134; cv=none; d=zohomail.com; s=zohoarc; b=UTvvMeIgjYbiKhyrciaV5fSWi9qcmThCkTMmA95VhIu14Y85ph2JOAKuIIGDCrcRmh9QpvTlz5rrG7uS+txfSfxinZWDJcd1o25fupIOteFofTYE1pGijR57BPz62LptoCMPAbPFnLK2XCW609YHzr2+x2/Wiq6+SQ6xAZnz8Z0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615873134; 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; bh=1bgTBjz/F4v1Gv2UDYz0PLiO8IJC3N0/Nliz+enLVyQ=; b=BkeTaX01sN20CN4c+aW/NnMFeBf9vS0cZZw61+pKqgN4dVO9LNeue5kYGOQ+kjo1COosIprv9NBVvPIkppMoG/ywdeC/A0OtMh0QdPhFGPwNgFtoujFdiv3WGTrq6PHWlD3kO7K/j9xyooFVdDM67qNv9TyOCX6qg325LPjJXaY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1615873134049512.0506731348912; Mon, 15 Mar 2021 22:38:54 -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-421-rJ69C0O0OdqLqoF2CZzFdA-1; Tue, 16 Mar 2021 01:38:50 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CDE2C18460E2; Tue, 16 Mar 2021 05:38:44 +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 9875662A6F; Tue, 16 Mar 2021 05:38:44 +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 4E92E1800B9A; Tue, 16 Mar 2021 05:38:44 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12G5cNq0017016 for ; Tue, 16 Mar 2021 01:38:23 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1E6B96A039; Tue, 16 Mar 2021 05:38:23 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-141.ams2.redhat.com [10.36.112.141]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D9B7D6EF51; Tue, 16 Mar 2021 05:38:22 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 5399518007BD; Tue, 16 Mar 2021 06:38:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615873133; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=1bgTBjz/F4v1Gv2UDYz0PLiO8IJC3N0/Nliz+enLVyQ=; b=G9cNQnjPi1Bb5pcC/CwmXPK2q2KkzcVBAjIrI3FI9VWM1DuuCsLAoExkI03p4QF5EfBNpM VW4wGf97RdtN1Dz6c+ckmwoO3tkMKdLLQyFwlXbAk85ZgMJ2dw69Fof/EVXbGnq2qIy5pH S9SI6S69NgK402OYADszL5vR7AcmFFk= X-MC-Unique: rJ69C0O0OdqLqoF2CZzFdA-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 05/11] ui/cocoa: Do not exit immediately after shutdown Date: Tue, 16 Mar 2021 06:38:07 +0100 Message-Id: <20210316053813.1719442-6-kraxel@redhat.com> In-Reply-To: <20210316053813.1719442-1-kraxel@redhat.com> References: <20210316053813.1719442-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: libvir-list@redhat.com, Peter Maydell , Gerd Hoffmann , Akihiko Odaki 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.15 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-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Akihiko Odaki ui/cocoa used to call exit immediately after calling qemu_system_shutdown_request, which prevents QEMU from actually perfoming system shutdown. Just sleep forever, and wait QEMU to call exit and kill the Cocoa thread. Signed-off-by: Akihiko Odaki Message-Id: <20210219111652.20623-1-akihiko.odaki@gmail.com> Signed-off-by: Gerd Hoffmann --- ui/cocoa.m | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ui/cocoa.m b/ui/cocoa.m index a7848ae0a30e..9da0e884b712 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -1115,7 +1115,13 @@ QemuCocoaView *cocoaView; COCOA_DEBUG("QemuCocoaAppController: applicationWillTerminate\n"); =20 qemu_system_shutdown_request(SHUTDOWN_CAUSE_HOST_UI); - exit(0); + + /* + * Sleep here, because returning will cause OSX to kill us + * immediately; the QEMU main loop will handle the shutdown + * request and terminate the process. + */ + [NSThread sleepForTimeInterval:INFINITY]; } =20 - (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)t= heApplication --=20 2.29.2