diff options
| author | Akihiko Odaki <akihiko.odaki@daynix.com> | 2024-02-18 15:57:11 +0900 |
|---|---|---|
| committer | Philippe Mathieu-Daudé <philmd@linaro.org> | 2025-01-13 17:16:03 +0100 |
| commit | ccaca8929d53b23e2f7acc45cc88d05fc0479a1b (patch) | |
| tree | 7179d8b11ea4fd7f8b7cfede06bdaa1c56b444dd /hw/core/qdev-hotplug.c | |
| parent | 1bff035be76cc30ff0fc4e8f0b0fbda84db7d1dc (diff) | |
| download | focaccia-qemu-ccaca8929d53b23e2f7acc45cc88d05fc0479a1b.tar.gz focaccia-qemu-ccaca8929d53b23e2f7acc45cc88d05fc0479a1b.zip | |
hw/qdev: Check qbus_is_hotpluggable in hotplug_unplug_allowed_common
Check the same code once in the common helper. Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> [PMD: Split from bigger patch, part 5/6] Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <20250110091908.64454-6-philmd@linaro.org>
Diffstat (limited to 'hw/core/qdev-hotplug.c')
| -rw-r--r-- | hw/core/qdev-hotplug.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/hw/core/qdev-hotplug.c b/hw/core/qdev-hotplug.c index 1d77fffb5e..f6422cd0e4 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; } |