From patchwork Mon Mar 28 22:40:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12794303 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 561A0C433FE for ; Mon, 28 Mar 2022 22:43:12 +0000 (UTC) Received: from localhost ([::1]:57938 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nYy4t-0004k9-9l for qemu-devel@archiver.kernel.org; Mon, 28 Mar 2022 18:43:11 -0400 Received: from eggs.gnu.org ([209.51.188.92]:38044) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nYy2P-0002X8-0Y for qemu-devel@nongnu.org; Mon, 28 Mar 2022 18:40:37 -0400 Received: from [2607:f8b0:4864:20::533] (port=39548 helo=mail-pg1-x533.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nYy2N-0007rz-Bj for qemu-devel@nongnu.org; Mon, 28 Mar 2022 18:40:36 -0400 Received: by mail-pg1-x533.google.com with SMTP id q19so13286810pgm.6 for ; Mon, 28 Mar 2022 15:40:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KohNfu4bDHA3H+x9hEF/fxiuHZ+lQRcyQ/g/dT6gGUc=; b=VBmK/YuCh4Ggcx9GzqZYEw9yxkh8H2Qb2J7o6I48+ORTdr5Xd0t8K0J4PaG9PQiizl ibWsijskDDoNT0enUGen6G8rbrBw3Vcg7fq/KPq1/WKtNEifbn+kBK+PMzsa0hh9GN/N vWtomPv3/rcSbr2ocNBl/VRxQhgrcPhQI7MHuaDNrVJe/rQ091gyBvBuQJ7Sk9/4bnHW JrXgIzt2AcxK5sjUJGijw6NG8z69CZ+etbmuTRHdRRINVuNlxeefbj0xdn+cnZY/4drt VyWpUQL5Jf7CNuvZ/Bghhq3aByt+27A9MnJq+T/8MjDHD4NeHhShm0uJZIdxrW7pRM08 ogpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KohNfu4bDHA3H+x9hEF/fxiuHZ+lQRcyQ/g/dT6gGUc=; b=oBMFJOlW2GqbjS2HU1rvqeTU8VTyH0cZJPWO/pGLJqRvSBSBaTJ0XkI4NKPd/NY7E7 2DOfmpYiGRnY9SGCRe9u5+tk/ZGzdAbhzn1BZMKDmwxXC4xIGdQKQYx6taF0bDWGd28O jxTpPyy9EQHtFvCWI+KkXuMqDuJrvthw/rQL/E2hKqql6YWyUmVRLraENUbN/hXhGSbR sPqhU0FBNy1FLbbGLA5j/emD7RpIh7F3HoRHol1B+49uOp3J5eVtnJ1vqvag0QPlfctN 4ftzdstsVvY4SusgiVAMH7VkEDIC4uLiPybJZays2UCs9N/c1qGB0DOxS/bfNmwZima/ orEA== X-Gm-Message-State: AOAM531EHrYT7cn+VXYmtkAnD3Fge1c3wY6LSKRpK/56p4q//KtIvPMz ms7SKLkhO+5yir06+jQdsiXU5VNU173Zcw== X-Google-Smtp-Source: ABdhPJy6AYxdI85p3/VQM2gh/6V4atckJa8em6veekbE9AqDxFEQuCKTt+P+C4Buky+6ul1gY4HhGg== X-Received: by 2002:a63:4041:0:b0:37f:8077:e0de with SMTP id n62-20020a634041000000b0037f8077e0demr11419189pga.138.1648507233855; Mon, 28 Mar 2022 15:40:33 -0700 (PDT) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id w8-20020a63a748000000b0038117e18f02sm13937073pgo.29.2022.03.28.15.40.30 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 28 Mar 2022 15:40:33 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 1/4] gitattributes: Cover Objective-C source files Date: Tue, 29 Mar 2022 00:40:09 +0200 Message-Id: <20220328224012.32737-2-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220328224012.32737-1-philippe.mathieu.daude@gmail.com> References: <20220328224012.32737-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::533 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::533; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-pg1-x533.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Christian Schoenebeck , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Akihiko Odaki Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Apple's Git distribution actually carries a similar file which annotates *.m: https://github.com/apple-opensource/Git/blob/73/gitattributes See comments in commit 29cf16db23 ("buildsys: Help git-diff adding .gitattributes config file") for details. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Christian Schoenebeck Message-Id: <20220317130326.39188-1-philippe.mathieu.daude@gmail.com> --- .gitattributes | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitattributes b/.gitattributes index 07f430e944..a217cb7bfe 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,4 @@ *.c.inc diff=c *.h.inc diff=c +*.m diff=objc *.py diff=python From patchwork Mon Mar 28 22:40:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12794306 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E1F62C433EF for ; Mon, 28 Mar 2022 22:45:44 +0000 (UTC) Received: from localhost ([::1]:35892 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nYy7M-0000SX-31 for qemu-devel@archiver.kernel.org; Mon, 28 Mar 2022 18:45:44 -0400 Received: from eggs.gnu.org ([209.51.188.92]:38100) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nYy2a-0002Zq-Hh for qemu-devel@nongnu.org; Mon, 28 Mar 2022 18:40:49 -0400 Received: from [2607:f8b0:4864:20::62c] (port=45990 helo=mail-pl1-x62c.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nYy2Y-0007sZ-Iq for qemu-devel@nongnu.org; Mon, 28 Mar 2022 18:40:48 -0400 Received: by mail-pl1-x62c.google.com with SMTP id i11so4703343plg.12 for ; Mon, 28 Mar 2022 15:40:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uYlZM0nq3diwciC2cY9naycPEtvBEHpCnKrFUOpZVMM=; b=BcQyM8XNptyR7rEDeqEzbxAXEBRC3jETs9DATm9UfiTkw421bEz5y/aJ33vGh8pLg2 DrSpufoqQo6fMZisTBswASGwmuvkaYLCk8TYX0Z93o5tyuN6vRqw1cxgaR6Zl8Js0oZJ zf76aMwuva+WkheWP2uHVEwgdC0azeNaue/6LzGJWFaYCEL+dGn33IjKvd04G5SgPUZ5 +KXdO1vSIsjaxrWIhHNZpy2EbX5XuzjbV6VIHdIK0Q+Ltihq+jtt5kgGErQgCJxYP4h4 UllT6elV3wllcwTeAlQ9OkEQlFfGavV24gN+VYbccjEp2ckM6l1cKjA9NkJZkbyA7uQ/ ZCXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uYlZM0nq3diwciC2cY9naycPEtvBEHpCnKrFUOpZVMM=; b=iRBs9Tc4H7MRTv7tTzilBczkZPNXXWC4OZfjyQzFzWFX6wUW42Iv1SpbTIZFIF4exC 0SlVXePyspLQahiNo6BSPWTlHYoTtBt9rfHPDwrCK0kIBKNkdLcOn9JzCuwIPLWtlCfs 5raMp31YlBmWcAAAD5w3zDaErF3GxREJYBxQMnl9u8dMULAO/+jmZW9fGknfRiL4kE9K K6amGplzEChPAdamNmDsy+59jZyrbHsFhF6691zZqqvGPB44bK0gzeruczV5EMvAaFjf XuIrhAXCENjOf8RcSkGGPuCvhuNJ2AskKLeUsxWsWC2glGNZTBRYQNtzc/5b5YbolkNr /CeA== X-Gm-Message-State: AOAM5323rNXI9UeV0f1eDOZaubH84HM3SS8p8QOAR9KWqTcbCAomJ9xh qVaeQmk5I/iTutRk3T9qlXOwfdmX/Nz+KQ== X-Google-Smtp-Source: ABdhPJwMMGcuEvicDfdbeHNuZ4uXD5heIKEGi2Asf87ZUiQD3kfptW1o4oaTt/W8ty14Zo+n8bnwtg== X-Received: by 2002:a17:903:41d1:b0:154:76c2:f7bc with SMTP id u17-20020a17090341d100b0015476c2f7bcmr27810462ple.109.1648507244991; Mon, 28 Mar 2022 15:40:44 -0700 (PDT) Received: from localhost.localdomain ([2600:70ff:f07f:0:3c84:1cd:456b:b750]) by smtp.gmail.com with ESMTPSA id i6-20020a633c46000000b003817d623f72sm13989623pgn.24.2022.03.28.15.40.41 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 28 Mar 2022 15:40:44 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 2/4] qemu/main-loop: Disable block backend global state assertion on Cocoa Date: Tue, 29 Mar 2022 00:40:10 +0200 Message-Id: <20220328224012.32737-3-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220328224012.32737-1-philippe.mathieu.daude@gmail.com> References: <20220328224012.32737-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::62c (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::62c; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-pl1-x62c.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= , Akihiko Odaki Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Since commit 0439c5a462 ("block/block-backend.c: assertions for block-backend") QEMU crashes when using Cocoa on Darwin hosts. Example on macOS: $ qemu-system-i386 Assertion failed: (qemu_in_main_thread()), function blk_all_next, file block-backend.c, line 552. Abort trap: 6 Looking with lldb: Assertion failed: (qemu_in_main_thread()), function blk_all_next, file block-backend.c, line 552. Process 76914 stopped * thread #1, queue = 'com.apple.main-thread', stop reason = hit program assert frame #4: 0x000000010057c2d4 qemu-system-i386`blk_all_next.cold.1 at block-backend.c:552:5 [opt] 549 */ 550 BlockBackend *blk_all_next(BlockBackend *blk) 551 { --> 552 GLOBAL_STATE_CODE(); 553 return blk ? QTAILQ_NEXT(blk, link) 554 : QTAILQ_FIRST(&block_backends); 555 } Target 1: (qemu-system-i386) stopped. (lldb) bt * thread #1, queue = 'com.apple.main-thread', stop reason = hit program assert frame #0: 0x00000001908c99b8 libsystem_kernel.dylib`__pthread_kill + 8 frame #1: 0x00000001908fceb0 libsystem_pthread.dylib`pthread_kill + 288 frame #2: 0x000000019083a314 libsystem_c.dylib`abort + 164 frame #3: 0x000000019083972c libsystem_c.dylib`__assert_rtn + 300 * frame #4: 0x000000010057c2d4 qemu-system-i386`blk_all_next.cold.1 at block-backend.c:552:5 [opt] frame #5: 0x00000001003c00b4 qemu-system-i386`blk_all_next(blk=) at block-backend.c:552:5 [opt] frame #6: 0x00000001003d8f04 qemu-system-i386`qmp_query_block(errp=0x0000000000000000) at qapi.c:591:16 [opt] frame #7: 0x000000010003ab0c qemu-system-i386`main [inlined] addRemovableDevicesMenuItems at cocoa.m:1756:21 [opt] frame #8: 0x000000010003ab04 qemu-system-i386`main(argc=, argv=) at cocoa.m:1980:5 [opt] frame #9: 0x00000001012690f4 dyld`start + 520 As we are in passed release 7.0 hard freeze, disable the block backend assertion which, while being valuable during development, is not helpful to users. We'll restore this assertion immediately once 7.0 is released and work on a fix. Suggested-by: Akihiko Odaki Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Akihiko Odaki Reviewed-by: Peter Maydell Message-Id: <20220325183707.85733-1-philippe.mathieu.daude@gmail.com> --- include/qemu/main-loop.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/qemu/main-loop.h b/include/qemu/main-loop.h index 7a4d6a0920..89bd9edefb 100644 --- a/include/qemu/main-loop.h +++ b/include/qemu/main-loop.h @@ -270,10 +270,23 @@ bool qemu_mutex_iothread_locked(void); bool qemu_in_main_thread(void); /* Mark and check that the function is part of the global state API. */ +#ifdef CONFIG_COCOA +/* + * When using the Cocoa UI, addRemovableDevicesMenuItems() is called from + * a thread different from the QEMU main thread and can not take the BQL, + * triggering this assertions in the block layer (commit 0439c5a462). + * As the Cocoa fix is not trivial, disable this assertion for the v7.0.0 + * release (when using Cocoa); we will restore it immediately after the + * release. + * This issue is tracked as https://gitlab.com/qemu-project/qemu/-/issues/926 + */ +#define GLOBAL_STATE_CODE() +#else #define GLOBAL_STATE_CODE() \ do { \ assert(qemu_in_main_thread()); \ } while (0) +#endif /* CONFIG_COCOA */ /* Mark and check that the function is part of the I/O API. */ #define IO_CODE() \ From patchwork Mon Mar 28 22:40:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12794304 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EA94DC433F5 for ; Mon, 28 Mar 2022 22:43:45 +0000 (UTC) Received: from localhost ([::1]:60508 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nYy5R-0006S5-4G for qemu-devel@archiver.kernel.org; Mon, 28 Mar 2022 18:43:45 -0400 Received: from eggs.gnu.org ([209.51.188.92]:38126) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nYy2l-0002i3-4k for qemu-devel@nongnu.org; Mon, 28 Mar 2022 18:41:00 -0400 Received: from [2607:f8b0:4864:20::102f] (port=35686 helo=mail-pj1-x102f.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nYy2j-0007uH-Eb for qemu-devel@nongnu.org; Mon, 28 Mar 2022 18:40:58 -0400 Received: by mail-pj1-x102f.google.com with SMTP id mj15-20020a17090b368f00b001c637aa358eso607677pjb.0 for ; Mon, 28 Mar 2022 15:40:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=URKrjrpnGxI0MyeXnOmurYPvs0k0h5uuEh4aJLoXJic=; b=CYkpQG1USvcOm5kMC8nweoWQLV1/pk1byUj/+/3Eibsu/wtPeOjILuQnV1GyB71+AK Rsg7xP0i9OwfLxUwXcMAhDofRg/q9Y45cHhbz3qgipgWGZkOv18JUDVLMzBL9r+QHWzl n8OYGBViB4pDk2Db6Re+zbWO/rD9Hqszm6wih5PdpzK0mocqKMRMJ13AEJoMTwRA8fit 4pU5cU75uq4Re3nFgHUz0kbl5+Qkfnze3wKuhnyEBdqaTJBVVRLZ/s69HNcF/llqMmRM UNDABrJUBOG8zShveDspGHnzw7whHJ7V5HhwpgoD6r0GSsycB/SDrc+J7Ll6HiRtdiqA 4CaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=URKrjrpnGxI0MyeXnOmurYPvs0k0h5uuEh4aJLoXJic=; b=XwY24Ik0CWIBGfRgZGNvNChHZ2ypcjqvBtUDYEUry8QqZjs/soH8t56Sxqz2xPWq7d ZLW0nrKl94UuCtZXP9pxqGnuE+ESfUL67C2fsrYNq/OSgA9fD8lYeBn/KgnAl9+w3t4m copg3uA0cbq6ebAKDj2VagZ0B2GDLcttlBjkc6wXe4I1snulr37V9bxB3wFTfsvOXqk8 cm4MaJfW+dvZkNcuPgXYKtBD5IYdoJMc6TViBWe8Px6Z6szkHqZRiizLOxlfeC9JFSxn VnjPT6QMC7vEy4zWk+wEgXk9/bdW6GNyHEAtb2t6AbDBHxJOWQ1mCtmibEVsvorpJySi 3/Qw== X-Gm-Message-State: AOAM531rA3C8EmUzx9nLCpVulSL0812mBfJtUzpbip2au0+cv+yKYKma igd+ZCGgkMxkrj4L/rby6Xy9ofWCu6DtUg== X-Google-Smtp-Source: ABdhPJwvDUwQL7Iq3a3lNAXlPqQDhFedKLOopt/Madc4zWI431hf20l9607IyE8tOxH7/tLQPM99Kw== X-Received: by 2002:a17:902:ecc6:b0:154:5393:aa98 with SMTP id a6-20020a170902ecc600b001545393aa98mr28540635plh.88.1648507256055; Mon, 28 Mar 2022 15:40:56 -0700 (PDT) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id b13-20020a056a00114d00b004c122b90703sm17201808pfm.27.2022.03.28.15.40.53 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 28 Mar 2022 15:40:55 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 3/4] ui/cocoa: Respect left-command-key option Date: Tue, 29 Mar 2022 00:40:11 +0200 Message-Id: <20220328224012.32737-4-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220328224012.32737-1-philippe.mathieu.daude@gmail.com> References: <20220328224012.32737-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::102f (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::102f; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-pj1-x102f.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= , Akihiko Odaki Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Akihiko Odaki Signed-off-by: Akihiko Odaki Fixes: 4797adce5f ("ui/cocoa: add option to swap Option and Command") Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20220317152949.68666-1-akihiko.odaki@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- ui/cocoa.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/cocoa.m b/ui/cocoa.m index cb6e7c41dc..c4e5468f9e 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -923,7 +923,8 @@ - (bool) handleEventLocked:(NSEvent *)event /* Don't pass command key changes to guest unless mouse is grabbed */ case kVK_Command: if (isMouseGrabbed && - !!(modifiers & NSEventModifierFlagCommand)) { + !!(modifiers & NSEventModifierFlagCommand) && + left_command_key_enabled) { if (swap_opt_cmd) { [self toggleKey:Q_KEY_CODE_ALT]; } else { From patchwork Mon Mar 28 22:40:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12794308 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0FD53C433EF for ; Mon, 28 Mar 2022 22:48:11 +0000 (UTC) Received: from localhost ([::1]:40488 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nYy9i-0003i0-V2 for qemu-devel@archiver.kernel.org; Mon, 28 Mar 2022 18:48:10 -0400 Received: from eggs.gnu.org ([209.51.188.92]:38186) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nYy2x-0002q0-09 for qemu-devel@nongnu.org; Mon, 28 Mar 2022 18:41:16 -0400 Received: from [2607:f8b0:4864:20::632] (port=36576 helo=mail-pl1-x632.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nYy2v-0007v5-FD for qemu-devel@nongnu.org; Mon, 28 Mar 2022 18:41:10 -0400 Received: by mail-pl1-x632.google.com with SMTP id m18so11105945plx.3 for ; Mon, 28 Mar 2022 15:41:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YsNUrLATsn2EyMjj08DCLj2HaIRq67iesWEjKrJXNEM=; b=ECNqqydX944kLg2AB0xJFSvh1x19bXUTJoPX2Zn0NFmKsN4hod2AfLRYdR6R0aLtS0 OOmYoMM50a2Bw+qAri2ctngw5F9AZuh6IDdvd9EMR34Vhs3li+MNF1i9DTo6r84nKbtq uUZgkv6g75+WHqXY1ChqK6uYwAeZfx4XVfP0aoWcWLOOc5yKGl4IwAO8BP64a3BejWeD EHWQz1knHIMlmxXbGIXWzpoKec7awEjxYadbYmnoVlokNXyDYYsdllUfFYFDzJ8Wlg4g bC67lNs9VCimevTJKWdI+YobIdvrDkN8XMEF1klaZlo7ttRDShuxabeSzXQPSgYD3odG KzCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YsNUrLATsn2EyMjj08DCLj2HaIRq67iesWEjKrJXNEM=; b=wA4Q2XWQqD6tKhe03P1MJpf0SkUpoUNLDVfiTDJ0o+TPK0RIvpCIhojWMx8ha9SUbi iFuRF/2zQtEUiygbXVGJOG5Th/tsSmEgrYUkxNwXjIgX0oyS84FFXBxj+FGTs4KQym3I kyOcvV/NDPBqJyd2Kmn19/xDRtGx59iHAFT6OAOho9ZcVcZzZaJMZc6hB3P3NbyRngY2 VrXSBpKFtmhrrQvpCCODoAV8UW4NGRgJ2fMzwBd/mlZPzv9Fthe3j4qwUv6njoNPgyve w3DiNy+SuF43U7YaUE4jwX0/Kw8Ws9jl5LqzgaOD7zT6obOXInzNwFE4v6ycsdmbiUth 8iAQ== X-Gm-Message-State: AOAM530QlgcPpuun8jb5d7q1lrnR97+K8FX9lyXyHCqB+xHxAXJvN80n Sr6DQ8C611CBN59rNu1g8FjJPq3zq1UvyQ== X-Google-Smtp-Source: ABdhPJxbAt0TmbFsMy2mYmf0Ni/jUgbUwf0mTuEyrU33p9s8FzqhtcvT7NOva3hPARzFpYeAn4TZqg== X-Received: by 2002:a17:90b:4c49:b0:1c7:d6c1:bb0f with SMTP id np9-20020a17090b4c4900b001c7d6c1bb0fmr1340365pjb.230.1648507267785; Mon, 28 Mar 2022 15:41:07 -0700 (PDT) Received: from localhost.localdomain ([2600:70ff:f07f:0:3c84:1cd:456b:b750]) by smtp.gmail.com with ESMTPSA id a16-20020a17090a6d9000b001c9c3e2a177sm489743pjk.27.2022.03.28.15.41.04 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 28 Mar 2022 15:41:07 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 4/4] ui/console: Check console before emitting GL event Date: Tue, 29 Mar 2022 00:40:12 +0200 Message-Id: <20220328224012.32737-5-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220328224012.32737-1-philippe.mathieu.daude@gmail.com> References: <20220328224012.32737-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::632 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-pl1-x632.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= , Akihiko Odaki , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Akihiko Odaki Without this change, The GL output of a console overwrites the other consoles and makes them unusable. Signed-off-by: Akihiko Odaki Reviewed-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20220325161216.74582-1-akihiko.odaki@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- ui/console.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/ui/console.c b/ui/console.c index da434ce1b2..1752f2ec88 100644 --- a/ui/console.c +++ b/ui/console.c @@ -1886,6 +1886,9 @@ void dpy_gl_scanout_disable(QemuConsole *con) con->scanout.kind = SCANOUT_NONE; } QLIST_FOREACH(dcl, &s->listeners, next) { + if (con != (dcl->con ? dcl->con : active_console)) { + continue; + } if (dcl->ops->dpy_gl_scanout_disable) { dcl->ops->dpy_gl_scanout_disable(dcl); } @@ -1909,6 +1912,9 @@ void dpy_gl_scanout_texture(QemuConsole *con, x, y, width, height }; QLIST_FOREACH(dcl, &s->listeners, next) { + if (con != (dcl->con ? dcl->con : active_console)) { + continue; + } if (dcl->ops->dpy_gl_scanout_texture) { dcl->ops->dpy_gl_scanout_texture(dcl, backing_id, backing_y_0_top, @@ -1927,6 +1933,9 @@ void dpy_gl_scanout_dmabuf(QemuConsole *con, con->scanout.kind = SCANOUT_DMABUF; con->scanout.dmabuf = dmabuf; QLIST_FOREACH(dcl, &s->listeners, next) { + if (con != (dcl->con ? dcl->con : active_console)) { + continue; + } if (dcl->ops->dpy_gl_scanout_dmabuf) { dcl->ops->dpy_gl_scanout_dmabuf(dcl, dmabuf); } @@ -1940,6 +1949,9 @@ void dpy_gl_cursor_dmabuf(QemuConsole *con, QemuDmaBuf *dmabuf, DisplayChangeListener *dcl; QLIST_FOREACH(dcl, &s->listeners, next) { + if (con != (dcl->con ? dcl->con : active_console)) { + continue; + } if (dcl->ops->dpy_gl_cursor_dmabuf) { dcl->ops->dpy_gl_cursor_dmabuf(dcl, dmabuf, have_hot, hot_x, hot_y); @@ -1954,6 +1966,9 @@ void dpy_gl_cursor_position(QemuConsole *con, DisplayChangeListener *dcl; QLIST_FOREACH(dcl, &s->listeners, next) { + if (con != (dcl->con ? dcl->con : active_console)) { + continue; + } if (dcl->ops->dpy_gl_cursor_position) { dcl->ops->dpy_gl_cursor_position(dcl, pos_x, pos_y); } @@ -1967,6 +1982,9 @@ void dpy_gl_release_dmabuf(QemuConsole *con, DisplayChangeListener *dcl; QLIST_FOREACH(dcl, &s->listeners, next) { + if (con != (dcl->con ? dcl->con : active_console)) { + continue; + } if (dcl->ops->dpy_gl_release_dmabuf) { dcl->ops->dpy_gl_release_dmabuf(dcl, dmabuf); } @@ -1983,6 +2001,9 @@ void dpy_gl_update(QemuConsole *con, graphic_hw_gl_block(con, true); QLIST_FOREACH(dcl, &s->listeners, next) { + if (con != (dcl->con ? dcl->con : active_console)) { + continue; + } if (dcl->ops->dpy_gl_update) { dcl->ops->dpy_gl_update(dcl, x, y, w, h); }