From patchwork Mon Jan 13 17:35:58 2025 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: 13937837 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 A6E9CC02180 for ; Mon, 13 Jan 2025 17:37:35 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tXON3-0002NL-Bq; Mon, 13 Jan 2025 12:37:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tXOMS-00022d-2m for qemu-devel@nongnu.org; Mon, 13 Jan 2025 12:36:25 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tXOMK-0006yr-76 for qemu-devel@nongnu.org; Mon, 13 Jan 2025 12:36:19 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-4361fe642ddso48330945e9.2 for ; Mon, 13 Jan 2025 09:36:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736789772; x=1737394572; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=DzCNbwIo87x4lOEY4ICfv2t12PV5Rydbl8ocZx/cYns=; b=cbgcKYzonekfIJxgcVEhT+CYJ/npyycy0FNGWWRCGn/Z8/luj7vzrUeUt7enX5H1Rz qR1lM3FgvKglYgHhOXi3IgOWdH55FJVjGDDytRJ2/AHPBBbJ3DyZsKJHObJqIzx+jJ48 yFhsUuPcvbuUu7CKuZaGUu4WNRmy1pPuTPh+ahlPU5MZfmljludgBjidhOrQkU8cXtRs ab3cbCXAUqPT2q2Cx/fGRnRbynkbfQKnuxce+7dqzrcFaT8/Ws+g/RDJsO/GtElJGt51 dAqPVVnOuWHN8sQvFBYvc4FrJ+d3CMFkk1JdMwnJgMFZ9UiN/KBAfpNb0lUusif3hX43 nBHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736789772; x=1737394572; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DzCNbwIo87x4lOEY4ICfv2t12PV5Rydbl8ocZx/cYns=; b=rxYES3OxINPlZTENh1p45qWyjWcRwEQNCvgKYa8Gstz1brEjn8QNEg324eBl9JeXWz yZ3JzAASJLqVDfZP8cTn+0MzgdyMdG0owav1ce0YV0BUAqo2hLsa3TzPDMNIRGqKv3Xm RP8i0suIxLIMbubd1oXJS3LXxjaH26GbcK9X79lox6nrh29FGOno65S9lYo0lzwWkeiu f5pVwUuRRLjXwqFaTVj3KiFhfWnWbilhW3RsIHq94PTFAGNjbWdm4+Ac0Xy5XMxj26sf PwtNvJjJDfsOS7u++g1Fw350XI/gGpl1MQ0edFfvimXcWlylX15/E+ktOIUmlMOTUuND SYhg== X-Gm-Message-State: AOJu0Yy0KzdB+izDEpk+yY00S+NkptysY47xg4o/dDs6zyJ7Z0n8C1z2 f0U6aPa96fLjobu6skVZjb1RciWcmsHFAOEwd3dZy4C5fsCCickcd18JaE3uh31SfSNPAxdyYI3 03bk= X-Gm-Gg: ASbGncso5el0WxMLGQWeR7AfigXU8QVO5IK2z5CPOtEb8KZGm6XuyYLNLdrcq4aHUnW 2SSQqF3zk9+kBfFuuO3gwtDb3gzXmTnhkYltweBNZH7FfL0mPw4DSRhc447tiafAarvtMtO/oSf iER2NjvRV6ZnUy2lhZ52xrfXsZCkUx0q7w2u8vxjf+6aasR+CJ8jdoDQVP+mfJsYV8puXlDahwT Ok6n0+GWL4H0n03P4mdavlqYLPL7B5cfkgN2RpBBleasCxq8O+rul79D4tCI34+qANAbMjoda+6 715UWcljl/r7Zw8HCq9iqvXdkcDMug4= X-Google-Smtp-Source: AGHT+IF6uUsTb9bpYcV7vwky7GAhL+niw9ROGKAt4cgqykrFFxW5PMY1Mq1MemJEuns/lzK/3bIkWg== X-Received: by 2002:a5d:5848:0:b0:385:df5d:622c with SMTP id ffacd0b85a97d-38a8730dec4mr17115771f8f.30.1736789771685; Mon, 13 Jan 2025 09:36:11 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e383654sm12945329f8f.30.2025.01.13.09.36.10 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 13 Jan 2025 09:36:11 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Akihiko Odaki , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= , Igor Mammedov Subject: [PULL v2 06/55] hw/qdev: Pass bus argument to qdev_hotplug_allowed() Date: Mon, 13 Jan 2025 18:35:58 +0100 Message-ID: <20250113173604.46931-2-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250113173604.46931-1-philmd@linaro.org> References: <20250113173604.46931-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Akihiko Odaki In preparation of checking the parent bus is hot(un)pluggable in a few commits, pass a 'bus' argument to qdev_hotplug_allowed(). Signed-off-by: Akihiko Odaki [PMD: Split from bigger patch, part 1/6] Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Igor Mammedov Message-Id: <20250110091908.64454-2-philmd@linaro.org> --- include/hw/qdev-core.h | 2 +- hw/core/qdev-hotplug.c | 2 +- system/qdev-monitor.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index 89575e74e27..930b00fb09a 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -540,7 +540,7 @@ void qdev_set_legacy_instance_id(DeviceState *dev, int alias_id, int required_for_version); HotplugHandler *qdev_get_bus_hotplug_handler(DeviceState *dev); HotplugHandler *qdev_get_machine_hotplug_handler(DeviceState *dev); -bool qdev_hotplug_allowed(DeviceState *dev, Error **errp); +bool qdev_hotplug_allowed(DeviceState *dev, BusState *bus, Error **errp); /** * qdev_get_hotplug_handler() - Get handler responsible for device wiring diff --git a/hw/core/qdev-hotplug.c b/hw/core/qdev-hotplug.c index d495d0e9c70..19fbb11a316 100644 --- a/hw/core/qdev-hotplug.c +++ b/hw/core/qdev-hotplug.c @@ -30,7 +30,7 @@ HotplugHandler *qdev_get_machine_hotplug_handler(DeviceState *dev) return NULL; } -bool qdev_hotplug_allowed(DeviceState *dev, Error **errp) +bool qdev_hotplug_allowed(DeviceState *dev, BusState *bus, Error **errp) { MachineState *machine; MachineClass *mc; diff --git a/system/qdev-monitor.c b/system/qdev-monitor.c index 23043b1e0d5..83388dc0c4a 100644 --- a/system/qdev-monitor.c +++ b/system/qdev-monitor.c @@ -691,7 +691,7 @@ DeviceState *qdev_device_add_from_qdict(const QDict *opts, /* Check whether the hotplug is allowed by the machine */ if (phase_check(PHASE_MACHINE_READY)) { - if (!qdev_hotplug_allowed(dev, errp)) { + if (!qdev_hotplug_allowed(dev, bus, errp)) { goto err_del_dev; } From patchwork Mon Jan 13 17:35:59 2025 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: 13937838 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 F09EBC02185 for ; Mon, 13 Jan 2025 17:37:35 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tXONF-0002da-JC; Mon, 13 Jan 2025 12:37:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tXOMT-00023W-Vv for qemu-devel@nongnu.org; Mon, 13 Jan 2025 12:36:26 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tXOMO-0006zd-1M for qemu-devel@nongnu.org; Mon, 13 Jan 2025 12:36:25 -0500 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-436249df846so31978425e9.3 for ; Mon, 13 Jan 2025 09:36:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736789777; x=1737394577; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=UfFTRmuQecjymNg1z1Zlqe+xEmRGvh9kuRZqED+itwE=; b=ZOKvLh+JkRlsluoteN1EmHKMLQzwVivrz/7yL6YLeQUSk6RRmvnztPdqb+ZJEb/XA5 fv5CIi12lvCZJBqmD02g78AN2yiXSXh8vfL9E9ZxgNOl2uLe84OqloymcS2zi4OJZRLi 46IcbFOtfSWwf3A7VWo6xuzZqFxd5VjqB4TshbzLXW+5e1xVOoUQYKzZ8mMg3y0p/NN/ gjB7u4lBb45bcJoA+tUJ6J7BWHtbHTivjdqBhsekWNxcVmubw89sgbt7UHYUwhh0xxaG +MHpaZOPPsfd1hXz0qswHv7Lg+NijhTXBPRzALX8CYHt4iPf5c+BDDAWRPagpKjebbOf 4c+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736789777; x=1737394577; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UfFTRmuQecjymNg1z1Zlqe+xEmRGvh9kuRZqED+itwE=; b=GABy7RcfIUQMEs2bKyieROM5cTssYccyUFtdHAiBRsgYf+rH1CGKzmLstz1EfetiwO y84/BSbguZA2b618kgm+EhZ4SMnnA8BzyrGNW4cwcUHJWqZIUNSRYxRFvsNDlH5W2PBw VXLSiKiPUNOB0/SDkkAp7HPhYsQUAIh1tzt6WZLkS9StEWrQOM6SndwgQ56ce+pKSqTt ogd8XnI1KCPGZgoxKp1wo0WzcdBBRO3tL2/9c7nNZvZAs6x8wtIQ6ShHuibpbhtrAE2M 66L2bJ9BYNM+paHQ2ObC2KihjlqZ4sj0NbvXqnhSBFiyTD0RZr6aR5EdcXut7D/CmEsK 0oBw== X-Gm-Message-State: AOJu0YwHkVyxp3p64ttWV69FaQofpkEUOVJO9oejUnKJovRO3jDtH4s/ IVo/+bWHwDrraPJm+SRnkeAhOaS2WVQ9zFkCCMjMItI1O5zAJ4PndTaJiMZMFsbLmIPF9hGoyZP xMwY= X-Gm-Gg: ASbGncsjkQOSMroN526NjI6d71us2PoKiD14HFJR08yjG2my9i6d1L2ynt4JHhLcF7L 8ddWi2K185uiK38yxWS5Jrf5xoWs5b3ZFZbMZO3px/fXvNL7yIlPl8mCILxaZS+DUIGNYOpMg6B J4SXSjBL0NiT+IKyBqRa0PTxCk/n8x1Q3r7721qpN3R4wKmkS9y/YxjN0xZ0mjKZs08BnSJs0PL u/HmNaVdqC6Y9QfnCbP3MoKTzH3f283nqkDDiyeQJFmxCLkI8fb3T0WCFbOAIu7aLVCOv/zZ/Hm rP3jR+exIy1bmfphdPMgr3/KF2o7Q9A= X-Google-Smtp-Source: AGHT+IHjjQ93CsEmrN6tlZ4KbqY37GVEjUYPtu4C8QT23GOocDKlT3ofNi0aExjH/hxjEFW5Dr+47A== X-Received: by 2002:a05:600c:1f95:b0:434:a525:7257 with SMTP id 5b1f17b1804b1-436e26d946cmr167014235e9.21.1736789776632; Mon, 13 Jan 2025 09:36:16 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e4b81d7sm12730247f8f.73.2025.01.13.09.36.15 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 13 Jan 2025 09:36:15 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Akihiko Odaki , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= , Igor Mammedov Subject: [PULL v2 07/55] hw/qdev: Factor qdev_hotunplug_allowed() out Date: Mon, 13 Jan 2025 18:35:59 +0100 Message-ID: <20250113173604.46931-3-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250113173604.46931-1-philmd@linaro.org> References: <20250113173604.46931-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=philmd@linaro.org; helo=mail-wm1-x32a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Akihiko Odaki Factor qdev_hotunplug_allowed() out of qdev_unplug(). Start checking the device is not blocked. Signed-off-by: Akihiko Odaki [PMD: Split from bigger patch, part 2/6] Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Igor Mammedov Message-Id: <20250110091908.64454-3-philmd@linaro.org> --- include/hw/qdev-core.h | 1 + hw/core/qdev-hotplug.c | 5 +++++ system/qdev-monitor.c | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index 930b00fb09a..530f3da7021 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -541,6 +541,7 @@ void qdev_set_legacy_instance_id(DeviceState *dev, int alias_id, HotplugHandler *qdev_get_bus_hotplug_handler(DeviceState *dev); HotplugHandler *qdev_get_machine_hotplug_handler(DeviceState *dev); bool qdev_hotplug_allowed(DeviceState *dev, BusState *bus, Error **errp); +bool qdev_hotunplug_allowed(DeviceState *dev, Error **errp); /** * qdev_get_hotplug_handler() - Get handler responsible for device wiring diff --git a/hw/core/qdev-hotplug.c b/hw/core/qdev-hotplug.c index 19fbb11a316..dc35110e735 100644 --- a/hw/core/qdev-hotplug.c +++ b/hw/core/qdev-hotplug.c @@ -47,6 +47,11 @@ bool qdev_hotplug_allowed(DeviceState *dev, BusState *bus, Error **errp) return true; } +bool qdev_hotunplug_allowed(DeviceState *dev, Error **errp) +{ + return !qdev_unplug_blocked(dev, errp); +} + HotplugHandler *qdev_get_bus_hotplug_handler(DeviceState *dev) { if (dev->parent_bus) { diff --git a/system/qdev-monitor.c b/system/qdev-monitor.c index 83388dc0c4a..511d1aa83c2 100644 --- a/system/qdev-monitor.c +++ b/system/qdev-monitor.c @@ -909,7 +909,7 @@ void qdev_unplug(DeviceState *dev, Error **errp) HotplugHandlerClass *hdc; Error *local_err = NULL; - if (qdev_unplug_blocked(dev, errp)) { + if (!qdev_hotunplug_allowed(dev, errp)) { return; } From patchwork Mon Jan 13 17:36:00 2025 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: 13937836 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 C1A5EC02183 for ; Mon, 13 Jan 2025 17:37:35 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tXONF-0002dL-H5; Mon, 13 Jan 2025 12:37:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tXOMU-00024A-GP for qemu-devel@nongnu.org; Mon, 13 Jan 2025 12:36:27 -0500 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tXOMR-0006zw-RQ for qemu-devel@nongnu.org; Mon, 13 Jan 2025 12:36:26 -0500 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-385e06af753so2319849f8f.2 for ; Mon, 13 Jan 2025 09:36:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736789781; x=1737394581; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=OUfr49xKtxGGKC5FU33V2zWTBLM60pMyiEdF047/1BY=; b=LnMn1Xx8JAwsyMCgvRVubEuKzZh4g0GdjSr2vkd0Y72Ob6phP9qeGahaSYFx+WnNWG wAqcUoOh+zO6SPh8zoeyiWC06W5HcIblr5rOVbY/2ETSroSRp22ksAUv6bTGYHUYd341 LXacYgwkgyK8tmIhrFZsv0igM1eDMrCisdneRYB+Xu/73/66MhbH5DkrfFDdfIVQRa9T H11z7bLb9LeBLcwLnENGMl6oIcPr63ICYx3g5iMlZkhcDoQojZmDYG4DrW7nMEKzoxKv jZc4x1hA9TYvzcrX5GaAI2O/9HLVe0wgeoYxDzOaXfgPoMegBZkRRWHWqK7h+dvzsrw2 fP+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736789781; x=1737394581; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OUfr49xKtxGGKC5FU33V2zWTBLM60pMyiEdF047/1BY=; b=CWwffBs24uU+2cDQJq7RI90gCBZGWTvNo65xPsgt4Q5CyVm4BkN1uRnVavJTzqpK8P ol+5S8fByIsyKVIDhOZqflV2yTrtYXaipCxdXb8LQXNDCN1lL17tC4VGjx/tRByosTui XWrQlvyHd5xbhitXvpzB5/43ZguQSIWrU9J0eW15JNpmWuEHqjsER0rOq/sDV/zMwmoY Cgl9pvvysVnseClDpUAQMpWQhzbd3OrmAqz9bLhnLe5i93kV1PdbkSEkrwcaLdZ0K9Fm bPyWwyHyLSWvjC3BhQQw5di7B6c/Ip35/4V4WK6jjLUzsVea6+UX5MRNxI3YS0XHkFKL iJTQ== X-Gm-Message-State: AOJu0YyKpKYPW4PpPdTC2HhV5WYHz6SOfMNTzARiofoBU1fsIa00Ud3Q Ng58a3Asiro9QYV/kn6QRM1NEaQYYAPbAuHVzBa7aoVtfqZ3skX3CzzJfQUR7Y2z9l6/fs89X4F /ckM= X-Gm-Gg: ASbGncuyu/FPfUxCcVIOWStbYLC5GFQs5m5QFzUUkw8t+Zglp7D95MJ5ji/7b+tejy8 A+XqW4HFATJgqkXgEByERIwpXDUmVREIoSZQIBmCdRela73reyM3zqMfPfhxRJ4vJ8XtvpPF3Vp lBrpv4Gs2YWv8u/x/OJhdm1EpO9ApzWowXSbiszu5/82D+0Ro4xIbwhkzy3JCa6odt9MUjQXnoD LO30CsEHQsHe+FIOSiOMScw6ehW4aWO0iKjmRBYbAnAQG0xd9uw814xrVEJQ6U2dki8URHWGfG3 FX7kn4FcpIECJijRt4xIKtT1vozCW/E= X-Google-Smtp-Source: AGHT+IH7SrMANo6WXpu9S7c3pf2PFlOGus0yX+aOIAdVptDu3GzyGxD8+C0hQyuH5IGoj+nQ+R71XQ== X-Received: by 2002:a5d:47c4:0:b0:38a:41f8:8abf with SMTP id ffacd0b85a97d-38a87312917mr20841540f8f.31.1736789781410; Mon, 13 Jan 2025 09:36:21 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e4c3428sm12430145f8f.87.2025.01.13.09.36.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 13 Jan 2025 09:36:20 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Akihiko Odaki , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= , Igor Mammedov Subject: [PULL v2 08/55] hw/qdev: Introduce qdev_hotplug_unplug_allowed_common() Date: Mon, 13 Jan 2025 18:36:00 +0100 Message-ID: <20250113173604.46931-4-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250113173604.46931-1-philmd@linaro.org> References: <20250113173604.46931-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=philmd@linaro.org; helo=mail-wr1-x429.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Akihiko Odaki Introduce qdev_hotplug_unplug_allowed_common() to hold common code between checking hot-plug/unplug is allowed. Signed-off-by: Akihiko Odaki [PMD: Split from bigger patch, part 3/6] Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Igor Mammedov Message-Id: <20250110091908.64454-4-philmd@linaro.org> --- hw/core/qdev-hotplug.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/hw/core/qdev-hotplug.c b/hw/core/qdev-hotplug.c index dc35110e735..168d7964740 100644 --- a/hw/core/qdev-hotplug.c +++ b/hw/core/qdev-hotplug.c @@ -30,12 +30,22 @@ HotplugHandler *qdev_get_machine_hotplug_handler(DeviceState *dev) return NULL; } +static bool qdev_hotplug_unplug_allowed_common(DeviceState *dev, BusState *bus, + Error **errp) +{ + return true; +} + bool qdev_hotplug_allowed(DeviceState *dev, BusState *bus, Error **errp) { MachineState *machine; MachineClass *mc; Object *m_obj = qdev_get_machine(); + if (!qdev_hotplug_unplug_allowed_common(dev, bus, errp)) { + return false; + } + if (object_dynamic_cast(m_obj, TYPE_MACHINE)) { machine = MACHINE(m_obj); mc = MACHINE_GET_CLASS(machine); @@ -49,7 +59,8 @@ bool qdev_hotplug_allowed(DeviceState *dev, BusState *bus, Error **errp) bool qdev_hotunplug_allowed(DeviceState *dev, Error **errp) { - return !qdev_unplug_blocked(dev, errp); + return !qdev_unplug_blocked(dev, errp) && + qdev_hotplug_unplug_allowed_common(dev, dev->parent_bus, errp); } HotplugHandler *qdev_get_bus_hotplug_handler(DeviceState *dev) From patchwork Mon Jan 13 17:36:01 2025 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: 13937839 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 76779C02184 for ; Mon, 13 Jan 2025 17:37:36 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tXONJ-0002wX-8b; Mon, 13 Jan 2025 12:37:17 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tXOMX-00028D-SV for qemu-devel@nongnu.org; Mon, 13 Jan 2025 12:36:31 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tXOMV-000719-Sb for qemu-devel@nongnu.org; Mon, 13 Jan 2025 12:36:29 -0500 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-43623f0c574so33103825e9.2 for ; Mon, 13 Jan 2025 09:36:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736789786; x=1737394586; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=uzxOnDYWp3ING3ucvnPH2nA5sMkoderjORmFMdUDMqM=; b=baseB0KEmVR2sAa+jAs3CZqY71O0eIxuM1n7KoJ2JiVw/Q594U05vhBFPQa4CVZMIg X1smN49ewaxQgdhxGByNnlJBldeslW3mHYhTxe/5Cnp5RXu5cmEfTKIMJuMZqur7ybI6 zAlo0du+nKsk2JPq3/+XYgMlpZHEAfkkqcEZnSaN+Eg+MheYToR60o805Ne8ZYXuiLh/ jZ/GL30VvUD9M2kNcJzxOgucIfdfdTK+yUtbos/4uzZMOg05OOoq1yeGgwOlAi+8Uah6 NOn8E7BF0AwJXToyHnxBjCe/z+YHolLN9s0qjx1MLhTG5m9Uq4ruA6LD5K9QGYrnJ2Q2 vHsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736789786; x=1737394586; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uzxOnDYWp3ING3ucvnPH2nA5sMkoderjORmFMdUDMqM=; b=KcEqOLA6zXDx1g+B3fI6PR38fXD6xOuFBIDV8OuRlKOvBqlCPPSfaLLv1o2CfakhYu F1e3x2sAhp2fzkFD3j+Gqgvj6nk2RVlQdMa/2xTX+oaWP3qWAeRZ3fcLLozM2HYlY7uB KPenMzmAcatLceP+l/TrxUg5VkyK3DkrqQ729UxJ3TEUjxNWLk0K5KAokAoQve9u8fAJ utbAwxa6o1vCbcZBxGOSRusWP6IxU8e7ua03tdrAu4MKyaSBg5Mnzyx5mXk1kMGvF+Vb HUWCqCJpARRCg9Q7Vh83TQTFQYyo1FhGWHixFJC+h3eUEcbBgR3KonPwS0iLz3h3A1T5 /lmg== X-Gm-Message-State: AOJu0Yw9JX8pTqH4+WcYnzL/2ZyNrozyVWKDNYhePWF9wdje3U6PhHuQ gg0u/c0MxEH23kpSj1Ua3Y0ZRCuLWXlH3FT7MhLesmMxRkEjTpX6aMyvre5DIl/uwmXG0xEXLCy PZF0= X-Gm-Gg: ASbGncuwLv0SmXapE3G4vd11uvRcCiSV9Nt24D9W5Qp8SG6PnuBQx+x4ReTPts8mxo+ 33166w2yl5entFMGBE/DOSkQeU4GKEmm7MrxJd7naaBPE4EqJtp65LzkneDVmMJpo2iU0VyjKkx HDMENlXBWZwjLPbOnJtqZsFrfzkxLkMwkwCr7bQyPe9sfP4XeJXtiAgH2MRR45AxbiJTrQCdV6Q tT8QbH1CZuPtO7mu2HsbW8/N46Ne2i81GF9RrOHejHKcyHjC7H/aLtc8+sOPrnHcUzSdDJW8gat bS2qH+dN0E128T8fdrgYwVufABe5Y2k= X-Google-Smtp-Source: AGHT+IE/GB6o8EeF/u9O99TCIXv2Ew6YHg+yaA7eY/BgKZewjf+mmHKfmcpHGwEQtjeffiuY38GhRg== X-Received: by 2002:a05:600c:4ed3:b0:434:f7e3:bfbd with SMTP id 5b1f17b1804b1-436e26dda8cmr175373635e9.23.1736789786163; Mon, 13 Jan 2025 09:36:26 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e2e89f29sm184467465e9.28.2025.01.13.09.36.25 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 13 Jan 2025 09:36:25 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Akihiko Odaki , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= , Igor Mammedov Subject: [PULL v2 09/55] hw/qdev: Check DevClass::hotpluggable in hotplug_unplug_allowed_common Date: Mon, 13 Jan 2025 18:36:01 +0100 Message-ID: <20250113173604.46931-5-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250113173604.46931-1-philmd@linaro.org> References: <20250113173604.46931-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=philmd@linaro.org; helo=mail-wm1-x32a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Akihiko Odaki Check the same code once in the common helper. Signed-off-by: Akihiko Odaki [PMD: Split from bigger patch, part 4/6] Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Igor Mammedov Message-Id: <20250110091908.64454-5-philmd@linaro.org> --- hw/core/qdev-hotplug.c | 9 +++++++++ system/qdev-monitor.c | 10 +--------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/hw/core/qdev-hotplug.c b/hw/core/qdev-hotplug.c index 168d7964740..1d77fffb5e0 100644 --- a/hw/core/qdev-hotplug.c +++ b/hw/core/qdev-hotplug.c @@ -12,6 +12,7 @@ #include "qemu/osdep.h" #include "hw/qdev-core.h" #include "hw/boards.h" +#include "qapi/error.h" HotplugHandler *qdev_get_machine_hotplug_handler(DeviceState *dev) { @@ -33,6 +34,14 @@ HotplugHandler *qdev_get_machine_hotplug_handler(DeviceState *dev) static bool qdev_hotplug_unplug_allowed_common(DeviceState *dev, BusState *bus, Error **errp) { + DeviceClass *dc = DEVICE_GET_CLASS(dev); + + if (!dc->hotpluggable) { + error_setg(errp, "Device '%s' does not support hotplugging", + object_get_typename(OBJECT(dev))); + return false; + } + return true; } diff --git a/system/qdev-monitor.c b/system/qdev-monitor.c index 511d1aa83c2..81f747b38fa 100644 --- a/system/qdev-monitor.c +++ b/system/qdev-monitor.c @@ -263,8 +263,7 @@ static DeviceClass *qdev_get_device_class(const char **driver, Error **errp) } dc = DEVICE_CLASS(oc); - if (!dc->user_creatable || - (phase_check(PHASE_MACHINE_READY) && !dc->hotpluggable)) { + if (!dc->user_creatable) { error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "driver", "a pluggable device type"); return NULL; @@ -904,7 +903,6 @@ static DeviceState *find_device_state(const char *id, bool use_generic_error, void qdev_unplug(DeviceState *dev, Error **errp) { - DeviceClass *dc = DEVICE_GET_CLASS(dev); HotplugHandler *hotplug_ctrl; HotplugHandlerClass *hdc; Error *local_err = NULL; @@ -919,12 +917,6 @@ void qdev_unplug(DeviceState *dev, Error **errp) return; } - if (!dc->hotpluggable) { - error_setg(errp, "Device '%s' does not support hotplugging", - object_get_typename(OBJECT(dev))); - return; - } - if (migration_is_running() && !dev->allow_unplug_during_migration) { error_setg(errp, "device_del not allowed while migrating"); return; From patchwork Mon Jan 13 17:36:02 2025 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: 13937841 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 9FC94C02180 for ; Mon, 13 Jan 2025 17:38:32 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tXONL-00038H-Nj; Mon, 13 Jan 2025 12:37:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tXOMe-0002Dm-CK for qemu-devel@nongnu.org; Mon, 13 Jan 2025 12:36:39 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tXOMb-00071m-IK for qemu-devel@nongnu.org; Mon, 13 Jan 2025 12:36:36 -0500 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-43675b1155bso52677665e9.2 for ; Mon, 13 Jan 2025 09:36:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736789791; x=1737394591; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9K5rXE6D64Zw+S58ipW/6GTsDDRWIpLeh+hDNnJwfH8=; b=pa8XMhZuQryc7Yv0MpNGgdb2FGiLGzIkyls63oDyRSUYyTde5S8o/tzXx0S35/Eup9 yRtere6zhIWrs3GDXDyBNcr8//Q4Xo1lhDTPr7v6+8RKYqpGMRZkHpDfLBRFucyuupDf iijectX/HJ7z5Zv4GmmxLDyoAfcKtlBucu+GoGyrlP32VspuQKOn6QYx7IXIKxTjK/3r JeMCpQ8XB6dcPvtdHn3xvLMBNBPpjI9Whnv/DW3KWO1iIzZnrzZYEfsyK6BGpFeYGuIi DBBoUwp4p2/hWFf5PF/bkbWu57tGYvkWraNMtkP3gIsdUYkBWS+e147hnjOxWKC7//Ad 2rtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736789791; x=1737394591; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9K5rXE6D64Zw+S58ipW/6GTsDDRWIpLeh+hDNnJwfH8=; b=mHq58KqdFyOP2i+qQj7P+ATMext0QYwcHV7AbSc+dBZzUaakeXy5BT84EM0F0o+F+T eUWP3tOccgjo06J/nxbfD2SccYCoPeUeodBBtPwlEITB+vfzexHCB/OtOsAUBwS+Xyim IGcqR78PQmBvMiTMntOpfYWqIr5oCDsrOzxAh9apagTWDTeFvZkQ7Sdf7JFjrWaHqfH1 4YErCooJ178i2+CjMsl3XM8pGfX7BxQCIxg2BEX6kvIXXargL8pKsd84uqqgvhebdcYO G+bfQt5imHyJ/9792XHVIvk9E5K1BwJubKukK2jU/uI/+sTOyBnj41AOg8+tqYkpo0wT nY8A== X-Gm-Message-State: AOJu0Yz3LSmKwUUWKahvhCapa8327yNvPYi34fveB2Yinf+RcL9sAXym 3A5rT+O0V241pkp+UGLBMwYE3YfbczMr+F/w8sHsCv2favyVXc7iVPpMN3NMEwfmtVhmwUlr9E3 umfs= X-Gm-Gg: ASbGncstrfkXXliEnCapXhurC9Tj0KqvDdLFKKqlm3LQ7rB927grTQqPfhVuaTW24Z0 94VFxGlW/R1JFsIKqeM/vM91DzvZ1aLJhEi2Bk6vAOW/cGG1DMbznP6oxqDseKxk/wjP3aBH+sq ZwAh3Rtg7Z9AK2490cUgBue3mQwEEdeF9Jm38YE5IuauhrT8suk5M98SifI9aWCzHmzB/6Co5D/ FbxJ1+7epfigg3XznAR29pzi0Cm456qK3nDTT+t7xLb4auSeksEju70DB1xqDkeb+J9pxyG/vfB i3T1V6us4N3ndzObV/Y4NpD5Z/oC5l0= X-Google-Smtp-Source: AGHT+IFglCJm+RC9BMBQdNoTlgTdPDqruK/UM0Z74DCSW+z1+KuqHRY+QlTZIoH5I4iq99XezX/5+g== X-Received: by 2002:a05:600c:354e:b0:434:f9c4:a850 with SMTP id 5b1f17b1804b1-436e269c42dmr223133295e9.10.1736789790784; Mon, 13 Jan 2025 09:36:30 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e9dc860bsm150457005e9.9.2025.01.13.09.36.29 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 13 Jan 2025 09:36:30 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Akihiko Odaki , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= , Igor Mammedov Subject: [PULL v2 10/55] hw/qdev: Check qbus_is_hotpluggable in hotplug_unplug_allowed_common Date: Mon, 13 Jan 2025 18:36:02 +0100 Message-ID: <20250113173604.46931-6-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250113173604.46931-1-philmd@linaro.org> References: <20250113173604.46931-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Akihiko Odaki Check the same code once in the common helper. Signed-off-by: Akihiko Odaki [PMD: Split from bigger patch, part 5/6] Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Igor Mammedov Message-Id: <20250110091908.64454-6-philmd@linaro.org> --- hw/core/qdev-hotplug.c | 8 ++++++++ system/qdev-monitor.c | 11 ----------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/hw/core/qdev-hotplug.c b/hw/core/qdev-hotplug.c index 1d77fffb5e0..f6422cd0e4e 100644 --- a/hw/core/qdev-hotplug.c +++ b/hw/core/qdev-hotplug.c @@ -42,6 +42,14 @@ static bool qdev_hotplug_unplug_allowed_common(DeviceState *dev, BusState *bus, return false; } + if (bus) { + if (!qbus_is_hotpluggable(bus)) { + error_setg(errp, "Bus '%s' does not support hotplugging", + bus->name); + return false; + } + } + return true; } diff --git a/system/qdev-monitor.c b/system/qdev-monitor.c index 81f747b38fa..e27d25c5859 100644 --- a/system/qdev-monitor.c +++ b/system/qdev-monitor.c @@ -675,11 +675,6 @@ DeviceState *qdev_device_add_from_qdict(const QDict *opts, return NULL; } - if (phase_check(PHASE_MACHINE_READY) && bus && !qbus_is_hotpluggable(bus)) { - error_setg(errp, "Bus '%s' does not support hotplugging", bus->name); - return NULL; - } - if (migration_is_running()) { error_setg(errp, "device_add not allowed while migrating"); return NULL; @@ -911,12 +906,6 @@ void qdev_unplug(DeviceState *dev, Error **errp) return; } - if (dev->parent_bus && !qbus_is_hotpluggable(dev->parent_bus)) { - error_setg(errp, "Bus '%s' does not support hotplugging", - dev->parent_bus->name); - return; - } - if (migration_is_running() && !dev->allow_unplug_during_migration) { error_setg(errp, "device_del not allowed while migrating"); return; From patchwork Mon Jan 13 17:36:03 2025 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: 13937843 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 B2736C02184 for ; Mon, 13 Jan 2025 17:38:54 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tXONL-00035Z-3A; Mon, 13 Jan 2025 12:37:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tXOMg-0002En-Rp for qemu-devel@nongnu.org; Mon, 13 Jan 2025 12:36:39 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tXOMf-00072D-8L for qemu-devel@nongnu.org; Mon, 13 Jan 2025 12:36:38 -0500 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-4361fe642ddso48335545e9.2 for ; Mon, 13 Jan 2025 09:36:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736789795; x=1737394595; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=So15p+H+DSsGmUuH6+mgWAC3ycngOqSbmiFDKA1MmyA=; b=cHjv8KqM0maYDidtTkfqeZAeZ+mxjvl9vjmigK6M8AXU0qd/b60TJCFx8sDcllCIAI 7jPz/zzxOyk6paiuea79Dufrp5ahoOSVo1vtcN6m+3MKZPQy9Bvcife75SXsjIlRxXkS 5qgJOvMSJIKSGP+RqotdT1LZVCRym6ilkCk4D+nqxmtyouFOly3js3kw2vbQhXxs9fhJ ROKyMA7EXjhFeFM4dOmex2by7YgMOk/ohi6Ui8crj6DlZ8iBWxN3ZnKEXwZjCGbtOGe8 hoye5egl+R77jp/tbPb3PFOABbW2bIlKC6e60VOP6w31RRamPv+nZNpKPFykxAIHS+PH 4dkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736789795; x=1737394595; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=So15p+H+DSsGmUuH6+mgWAC3ycngOqSbmiFDKA1MmyA=; b=jCSCHdSAKlE/Ot42G+elOHs5pNeiXI1rSac1tzQRBHGuiSkM9TYsAUMTgIfvWS67r0 ETZN9I99BceyJWoeoe5Defhbnscag1eG25glnSA6d/9y/X/LMuBN0YayrChAdnatYYlx lwNIumNjW9rrRH2ZfgT6y3IupLOYAZY9hoObVlUXirlf0Hz+2nRBB1kP8p2821jMbmtK dcnRj0Rt4kJqJXc26S5nK0lU+T2SAF2seMf6gNMUxhUnmEVh5dTSk369IUlaBa7gMVZZ af1dtPhawqFwBtVFhtE78FaOqM+eryLC8mVX28IHhCmYCeRb7WiiH5KzwN6DjQux6t3n C1qg== X-Gm-Message-State: AOJu0YxI9LGckoUNRzK+vqTyRcEJ8dfyLPEXYf/zfgSZPfZpw6NkqwuR jfRvkE3Nk4Nu7bBcEPC6BMWCGAImCH5TkfhivY+ImIsWHARFhwtumt+UAz4u/FAJsUUeBvrf5Np TOEQ= X-Gm-Gg: ASbGncv64Mrnn03w8h0fmmVfzBqLH5Cfbgc2p1RbHahco5k39bl77PkmhuTzMgjzgNr a/0/S0jf9JOvG9IR1pRYzohFyy1c2UJKNjggCrUxZInmAfjmOxKWjvRBhHXwzqU0LLCDFnKOqWp lvuHOhE0HM0W8l9OTVFOYt6H0g9t27TZmuffxztIt9Sd01ZZZmozxDBkQDjln97udIsILUjsS6i xcDDv3rd96LVQDFS4StyV31zJKcgTFlbMlcwLydGt50X252lcVClbdmzPauiGjDxmf1OaTHLZN2 Qw0pxHY6xbMVm8YlX5EEklbXmDwN9Rs= X-Google-Smtp-Source: AGHT+IHn9uN347JJfz3ougU5mSXjWhY/2H/e/aVOln9G8gCTQ7BUE2jtGL7aDApRZjl9TmL73PQJXg== X-Received: by 2002:a05:600c:4f8e:b0:436:fb02:e90 with SMTP id 5b1f17b1804b1-436fb021066mr56367155e9.10.1736789795403; Mon, 13 Jan 2025 09:36:35 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e9d8fba4sm150936005e9.4.2025.01.13.09.36.34 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 13 Jan 2025 09:36:34 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Akihiko Odaki , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= , Igor Mammedov Subject: [PULL v2 11/55] hw/qdev: Check machine_hotplug_handler in hotplug_unplug_allowed_common Date: Mon, 13 Jan 2025 18:36:03 +0100 Message-ID: <20250113173604.46931-7-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250113173604.46931-1-philmd@linaro.org> References: <20250113173604.46931-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Akihiko Odaki Commit 03fcbd9dc508 ("qdev: Check for the availability of a hotplug controller before adding a device") says: > The qdev_unplug() function contains a g_assert(hotplug_ctrl) > statement, so QEMU crashes when the user tries to device_add + > device_del a device that does not have a corresponding hotplug > controller. > The code in qdev_device_add() already checks whether the bus has a > proper hotplug controller, but for devices that do not have a > corresponding bus, here is no appropriate check available yet. In that > case we should check whether the machine itself provides a suitable > hotplug controller and refuse to plug the device if none is available. However, it forgot to add the corresponding check to qdev_unplug(). Check the machine hotplug handler once in the common qdev_hotplug_unplug_allowed_common() helper so both hotplug and hot-unplug path are covered. Fixes: 7716b8ca74 ("qdev: HotplugHandler: Add support for unplugging BUS-less devices") Signed-off-by: Akihiko Odaki [PMD: Split from bigger patch, part 6/6] Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Igor Mammedov Message-Id: <20250110091908.64454-7-philmd@linaro.org> --- hw/core/qdev-hotplug.c | 10 ++++++++++ system/qdev-monitor.c | 14 +++----------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/hw/core/qdev-hotplug.c b/hw/core/qdev-hotplug.c index f6422cd0e4e..ff176dc1bb3 100644 --- a/hw/core/qdev-hotplug.c +++ b/hw/core/qdev-hotplug.c @@ -48,6 +48,16 @@ static bool qdev_hotplug_unplug_allowed_common(DeviceState *dev, BusState *bus, bus->name); return false; } + } else { + if (!qdev_get_machine_hotplug_handler(dev)) { + /* + * No bus, no machine hotplug handler --> device is not hotpluggable + */ + error_setg(errp, + "Device '%s' can not be hotplugged on this machine", + object_get_typename(OBJECT(dev))); + return false; + } } return true; diff --git a/system/qdev-monitor.c b/system/qdev-monitor.c index e27d25c5859..861c25c855f 100644 --- a/system/qdev-monitor.c +++ b/system/qdev-monitor.c @@ -684,17 +684,9 @@ DeviceState *qdev_device_add_from_qdict(const QDict *opts, dev = qdev_new(driver); /* Check whether the hotplug is allowed by the machine */ - if (phase_check(PHASE_MACHINE_READY)) { - if (!qdev_hotplug_allowed(dev, bus, errp)) { - goto err_del_dev; - } - - if (!bus && !qdev_get_machine_hotplug_handler(dev)) { - /* No bus, no machine hotplug handler --> device is not hotpluggable */ - error_setg(errp, "Device '%s' can not be hotplugged on this machine", - driver); - goto err_del_dev; - } + if (phase_check(PHASE_MACHINE_READY) && + !qdev_hotplug_allowed(dev, bus, errp)) { + goto err_del_dev; } /* From patchwork Mon Jan 13 17:36:04 2025 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: 13937842 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 F2F78C02180 for ; Mon, 13 Jan 2025 17:38:53 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tXONL-00037S-IB; Mon, 13 Jan 2025 12:37:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tXOMn-0002L2-6j for qemu-devel@nongnu.org; Mon, 13 Jan 2025 12:36:48 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tXOMl-00072Q-GV for qemu-devel@nongnu.org; Mon, 13 Jan 2025 12:36:44 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-436a39e4891so32067885e9.1 for ; Mon, 13 Jan 2025 09:36:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736789800; x=1737394600; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=HyhgHy5lutIfTsw5uCOmzhS68O1wU1WLlga8mlFXRVY=; b=PFZHJVVsckWNauKHEOMtPaEGpbye3zVcihsoBDeQhFDswHYftoAGDa2mTh1IVKvwec tkVSCBb/cCMzMNQbefhzSd9CT87Q6468AAw51QmLZ0Y2hqlwTjpf9FoTq+ZwpbrNJ5fh ioBBailgqIRKmXQcDNXC1m43o1ss0m3xcu+0snlO6ymK0/LsYl1tFHLl8eBGH3fgHsF1 JkFsaZr/Dw1iZRD0c3z3I+sAUqrcFbdqUAhr/YnbHE1/zyRy7kiTA9i/WkiDFWfRA/lb NjX1TLsgnlIqet413kUD2qJ3ZxIANR+c8jG9fzQhfKYPFNjsja6w8B4qTMU2eHp4e85k yDew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736789800; x=1737394600; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HyhgHy5lutIfTsw5uCOmzhS68O1wU1WLlga8mlFXRVY=; b=Gm5TmGe9Uy2i+UqnklRBVEcdNE5WzCm3ac5jHhWPUNZGls4MkKOECXO4b39hCZf+qk 73/SKT0THsCjpdPlmGKGp4hQgXo2SXvetL5CifploR7m9bf8Nkwt7l4vdp+kLd9FlKH+ Hz4mj6KDrCb5ndCb0iMcqT7RA71jFIlOdjr1QgQgxz9fQZ8EtMSpT/0aNEqeNKrpeCNT OhcfUJlZbvdButPNHalMUo7AYRwVOIAPRvCwbg+zJivBBQUsCJNOQXvvqZuQnPY9CzCx 79nLpSHqp+vbZGDMGgyiX3Z+/HiepBqQNdKt9k7O09PRoZit+mR1TkMcJ3goNdbVol1K 5LYA== X-Gm-Message-State: AOJu0YyfE97v3jdnavwsVucSICKTmmFqdCwAkBoqGNPkZPqYaw260du6 fmnUX/J3YgPKkWGfkNeBe3qvoxA5ox3yRLneRFKf8zpbtDhw4PsQNcDAqg1WiVAFl2pY23VCQuv ilcg= X-Gm-Gg: ASbGncvvmBQ9gj963z2NpkvycwvwlWpzf6VZwyocuej+9mqSMDqJ+fCcNvkw6TWxgpw HLARDyhC49Hlw3oqdrJLbd0LouyNgHVFtILDrjkyAqYw4VENMn6iCbUCsc0irwPNbQv0/biUu8a dzL+oWzrNJaqeyz505Oe6ezFlwZdNEqNG7e6/OjcZo1eKKPE0rIXnP9VcAKLsyN2WWo8jMWyJ9I u/let2MJdI68GMm0XAeHKS8XVznY3dn2kAz9Cl1Y+uztNZ1X+81lx/cPw4turAvVl9J8lHa9cSH gmbGbrvkJsnTzsxeIKWKBnJPnE1sAak= X-Google-Smtp-Source: AGHT+IEoY3bsXDrrD3aeN/d6i958cc60AwLxNezTQJHLt7RiCOJL5StT1QpPrYrNd3YuVCkizywDyg== X-Received: by 2002:a05:600c:314f:b0:435:9ed3:5688 with SMTP id 5b1f17b1804b1-436e26a1f79mr218206415e9.18.1736789799982; Mon, 13 Jan 2025 09:36:39 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e2da6336sm185094455e9.8.2025.01.13.09.36.39 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 13 Jan 2025 09:36:39 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jiaxun Yang , =?utf-8?q?Signed-off-by=3A_Philip?= =?utf-8?q?pe_Mathieu-Daud=C3=A9?= Subject: [PULL v2 55/55] Add a b4 configuration file Date: Mon, 13 Jan 2025 18:36:04 +0100 Message-ID: <20250113173604.46931-8-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250113173604.46931-1-philmd@linaro.org> References: <20250113173604.46931-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Jiaxun Yang b4 [1] is a convenient tool to manage patch series with mailing list working flow. Add a project default config file to match QEMU's mailing list conventions as well as adopting differences on scripting. Examples of b4: ``` $ b4 prep --check Checking patches using: scripts/checkpatch.pl -q --terse --no-summary --mailback - --- Signed-off-by: Jiaxun Yang --- Changes in v2: - Add lore masks (philmd) from: https://lore.kernel.org/qemu-devel/20241224135054.10243-1-philmd@linaro.org/ - Link to v1: https://lore.kernel.org/r/20241222-b4-config-v1-1-b3667beb30a4@flygoat.com --- ● cc5a4c890fed: Add a b4 configuration file ● checkpatch.pl: 27: WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? --- Success: 0, Warning: 1, Error: 0 ``` ``` $ b4 prep -c Will collect To: addresses using echo Will collect Cc: addresses using get_maintainer.pl Collecting To/Cc addresses + To: qemu-devel@nongnu.org --- You can trim/expand this list with: b4 prep --edit-cover Invoking git-filter-repo to update the cover letter. New history written in 0.02 seconds... Completely finished after 0.06 seconds ``` [1]: https://b4.docs.kernel.org/ Co-developed-by: Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Jiaxun Yang Message-ID: <20250102-b4-config-v2-1-cc7299e399bb@flygoat.com> Signed-off-by: Philippe Mathieu-Daudé --- .b4-config | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .b4-config diff --git a/.b4-config b/.b4-config new file mode 100644 index 00000000000..4b9b2fe290f --- /dev/null +++ b/.b4-config @@ -0,0 +1,14 @@ +# +# Common b4 settings that can be used to send patches to QEMU upstream. +# https://b4.docs.kernel.org/ +# + +[b4] + send-series-to = qemu-devel@nongnu.org + send-auto-to-cmd = echo + send-auto-cc-cmd = scripts/get_maintainer.pl --noroles --norolestats --nogit --nogit-fallback + am-perpatch-check-cmd = scripts/checkpatch.pl -q --terse --no-summary --mailback - + prep-perpatch-check-cmd = scripts/checkpatch.pl -q --terse --no-summary --mailback - + searchmask = https://lore.kernel.org/qemu-devel/?x=m&t=1&q=%s + linkmask = https://lore.kernel.org/qemu-devel/%s + linktrailermask = Message-ID: <%s>