From patchwork Fri Jan 10 09:19: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: 856215 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp133570wrc; Fri, 10 Jan 2025 01:20:06 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXcWCdQsO35KQFhOYkdm48OanGCoOF69kH4o8UY6Xd6sjD4lCa+i+2i6C1B3fHllMYiuCEXPw==@linaro.org X-Google-Smtp-Source: AGHT+IHO0GKKk9ZgfzgEYDmi+BsbgZsgYFvsIRLS+EZkxIQ0eAe606vzccA7NNzrvn/xEp7I17+U X-Received: by 2002:a05:620a:472b:b0:7b6:67c9:a26a with SMTP id af79cd13be357-7bcd9759b6amr1062157185a.43.1736500806399; Fri, 10 Jan 2025 01:20:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736500806; cv=none; d=google.com; s=arc-20240605; b=SfOnI+t5ViT3IByyGoj47ndJ5AZv9PP8UCjPJF5OtV1Zjn74JXa1BAFab7v4wvfexW KsuxETcpdELwGm7SgYOPqhpy3pHcVf5k93LL+0KF7scUIzpH+BUnpQH8P6UiqsShucN+ lJlIGWp1pjhueTHxEGGtof5DZEZnoDbTKWclolX/TjHRr1wXfuDhIP5EGQpXyNIeWCPZ xi0QULr6fCP7P20vTLpfvmfCs77DRC+Rsabfd10E76fib0MqNvpullWmKUPxx8BAOYAG LykRx8+3ZrGGVz9RNOSuJGJZXaZyuWxNJXpGvuqi7Q6uzfuEP2+hma8o3m1GROEpNZvB zAEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=yA2q8zcDZ43//TUDxGWS7Y9cWigJcJ4nPMAPak2CZ3Y=; fh=XimDjJFGOz1tEVlhrez7cAg54nTzgWY7MGINAk/Ymt8=; b=EtjY+vpCrT+0p512makZWdPorax4XkVYpv6oMbOQTClfnLqKoT0P4gvmroCqV8M1nr UG6mTQZG1hZQRsEsZISzix0kRGnE6E1LuU04L0344p05etjJCrqZITFnrVnXD+YdX6oH YJikkBQmL86z7zdqowvNMSpq/SO4dZClfj2U9/U4uhEM62FnSoB9xPBLClBSLypXN/SQ Fg/6n7S9vZv/1ZUv8CWCqGw9FoN+qwiMEF/VrF75m6WRwzcdi2As5Tatrri0zbVwEFaa 8lI9UwzeBWQW00Hcyk4f/LqX79ho++r+FOxpYRKwVDK1u5cz6gdeHSoRGBqouR71ivVU fB3w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aZefgLBe; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7bce34fc5d2si382259685a.352.2025.01.10.01.20.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 10 Jan 2025 01:20:06 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aZefgLBe; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tWBAq-0007Fr-8m; Fri, 10 Jan 2025 04:19:24 -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 1tWBAk-0007FE-Dw for qemu-devel@nongnu.org; Fri, 10 Jan 2025 04:19:18 -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 1tWBAi-0007It-QK for qemu-devel@nongnu.org; Fri, 10 Jan 2025 04:19:18 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-43618283d48so13620185e9.1 for ; Fri, 10 Jan 2025 01:19:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736500755; x=1737105555; 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=yA2q8zcDZ43//TUDxGWS7Y9cWigJcJ4nPMAPak2CZ3Y=; b=aZefgLBeAg7aYzpfcR64k+w/Eg2jeUb8LR/4Sq6rA3rK2iID8vykFYGVM3+Q3vO3p1 6qbYYvr9QAwZGhMtx8dkUWQwM/qv8nthtdUFoQt9EQ50M7MCk3ym4CAWcy59/kQoielq T5cKVQ+8Qp0IwV3ZbhHXTF9prT+etkMpP5zrtO57HKm7NmRPpVluzmH55thRFt7smQFl N9y9lEPj02aYCF+EcBOw5hfIfUolj+TOIr38RthMMtcdGhfv/dnGXfTZTi1FnNSVe80m n+2H2UM9TzerewTfdNYO96BZlbwPNzcvLtfzWYtxe/GiZ+fOyYQLy/53ku39/SAqvkTc 7ApQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736500755; x=1737105555; 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=yA2q8zcDZ43//TUDxGWS7Y9cWigJcJ4nPMAPak2CZ3Y=; b=NpTg8COJhBeJRujELh8f8J/YlYsVrestVe9l100KIRKkkpJGeuin4RIz0lho6/2Xu9 dxzu2lkX+80iDOSZ3oWIbJhGw+3cE0IBeF5jyxzO11DSSXrMQQz7f0OtN+FL1IwhWfaD rEd7mLv9NApJPUBsH7QHEALUQLW7KaRdQSNDYGyn+wI3/RERbjyEIdG19dUwkcEtVZaT j3tpRJ3bFqvKIDw0/pNebGPb2EGPsn90emQllMN6K8yU7+VQkwLDYMlfgoFGHz1Ln36N BsVD0x0fJpDYX1gOwOYVxLdVVMB1V6krrbgij90qn0gMKA2dvgWxWlqERfBx/EMergeH fnaw== X-Gm-Message-State: AOJu0YyaicYknrFZFtGCWpFgSyeLy68ylaYO3JRXzTc58Cd9+QAC88Z9 dpAzkTtuZrF6f1mDmxCi+eip3rG02NJzfE92dtXpAnrqG9g51XwlZcPJWkWkS4rTm2iDOj8JUW9 v3+E= X-Gm-Gg: ASbGncsWtt5f3d6WTPvymIECq8K2VGt+sL6L5Te6I474aVH/ra8ylT5jqI8oGCVxdCw /6mXuV6KO8qybmKsZq1uH8NUOHFdw76RWfL1AS4friXMhF3HwYF+E0KspAPb5cyV/gz6BCHN7hv PhxAawBYvEp8TeOuolwGm8x9g5vPGFoaQ6ZpToi3xGgLrkfFhkcXybTphP05AqHl6a0MNesm/j/ cL88dOw5ALsm4jgmbfvGeNYYe6tHc0PvBY3DSQuje9Bk7IjHHGzYr1kz6hU1i7r5ZHoslMMjEGh cHxXITP/dZeTj8Wi56evRP2vLmTwENN8Cwuv X-Received: by 2002:adf:ae11:0:b0:38a:88f8:aad3 with SMTP id ffacd0b85a97d-38a88f8ad17mr5658914f8f.55.1736500754655; Fri, 10 Jan 2025 01:19:14 -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-436e2e92dc4sm79820625e9.39.2025.01.10.01.19.13 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 Jan 2025 01:19:14 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Markus Armbruster , Eduardo Habkost , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Paolo Bonzini , Akihiko Odaki , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PATCH v5 1/6] hw/qdev: Pass bus argument to qdev_hotplug_allowed() Date: Fri, 10 Jan 2025 10:19:03 +0100 Message-ID: <20250110091908.64454-2-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250110091908.64454-1-philmd@linaro.org> References: <20250110091908.64454-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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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 Signed-off-by: Philippe Mathieu-Daudé --- 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 e6ef80b7fd0..b4a5b203aab 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -544,7 +544,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 c844f538025..bf1afb81886 100644 --- a/system/qdev-monitor.c +++ b/system/qdev-monitor.c @@ -690,7 +690,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; }