[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v2 47/55] acpihp: simplify acpi_pcihp_disable_root_bus
|
From: |
Michael S. Tsirkin |
|
Subject: |
[PULL v2 47/55] acpihp: simplify acpi_pcihp_disable_root_bus |
|
Date: |
Fri, 7 Jan 2022 06:05:26 -0500 |
From: Ani Sinha <ani@anisinha.ca>
Get rid of the static variable that keeps track of whether hotplug has been
disabled on the root pci bus. Simply use qbus_is_hotpluggable() api to
perform the same check. This eliminates additional if conditional and
simplifies the function.
Signed-off-by: Ani Sinha <ani@anisinha.ca>
Message-Id: <1640764674-7784-1-git-send-email-ani@anirban.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
hw/acpi/pcihp.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/hw/acpi/pcihp.c b/hw/acpi/pcihp.c
index a5e182dd3a..6befd23e16 100644
--- a/hw/acpi/pcihp.c
+++ b/hw/acpi/pcihp.c
@@ -128,20 +128,15 @@ static void acpi_set_pci_info(void)
static void acpi_pcihp_disable_root_bus(void)
{
- static bool root_hp_disabled;
Object *host = acpi_get_i386_pci_host();
PCIBus *bus;
- if (root_hp_disabled) {
- return;
- }
-
bus = PCI_HOST_BRIDGE(host)->bus;
- if (bus) {
+ if (bus && qbus_is_hotpluggable(BUS(bus))) {
/* setting the hotplug handler to NULL makes the bus non-hotpluggable
*/
qbus_set_hotplug_handler(BUS(bus), NULL);
}
- root_hp_disabled = true;
+
return;
}
--
MST
- [PULL v2 30/55] util/oslib-posix: Support MADV_POPULATE_WRITE for os_mem_prealloc(), (continued)
- [PULL v2 30/55] util/oslib-posix: Support MADV_POPULATE_WRITE for os_mem_prealloc(), Michael S. Tsirkin, 2022/01/07
- [PULL v2 32/55] util/oslib-posix: Don't create too many threads with small memory or little pages, Michael S. Tsirkin, 2022/01/07
- [PULL v2 33/55] util/oslib-posix: Avoid creating a single thread with MADV_POPULATE_WRITE, Michael S. Tsirkin, 2022/01/07
- [PULL v2 36/55] virtio-mem: Support "prealloc=on" option, Michael S. Tsirkin, 2022/01/07
- [PULL v2 43/55] acpi: fix QEMU crash when started with SLIC table, Michael S. Tsirkin, 2022/01/07
- [PULL v2 34/55] util/oslib-posix: Support concurrent os_mem_prealloc() invocation, Michael S. Tsirkin, 2022/01/07
- [PULL v2 41/55] virtio-mem: Set "unplugged-inaccessible=auto" for the 7.0 machine on x86, Michael S. Tsirkin, 2022/01/07
- [PULL v2 35/55] util/oslib-posix: Forward SIGBUS to MCE handler under Linux, Michael S. Tsirkin, 2022/01/07
- [PULL v2 40/55] virtio-mem: Support VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE, Michael S. Tsirkin, 2022/01/07
- [PULL v2 42/55] intel-iommu: correctly check passthrough during translation, Michael S. Tsirkin, 2022/01/07
- [PULL v2 47/55] acpihp: simplify acpi_pcihp_disable_root_bus,
Michael S. Tsirkin <=
- [PULL v2 37/55] virtio: signal after wrapping packed used_idx, Michael S. Tsirkin, 2022/01/07
- [PULL v2 50/55] hw/scsi/vhost-scsi: don't leak vqs on error, Michael S. Tsirkin, 2022/01/07
- [PULL v2 39/55] linux-headers: sync VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE, Michael S. Tsirkin, 2022/01/07
- [PULL v2 44/55] tests: acpi: whitelist expected blobs before changing them, Michael S. Tsirkin, 2022/01/07
- [PULL v2 45/55] tests: acpi: add SLIC table test, Michael S. Tsirkin, 2022/01/07
- [PULL v2 53/55] tests: acpi: prepare for updated TPM related tables, Michael S. Tsirkin, 2022/01/07
- [PULL v2 46/55] tests: acpi: SLIC: update expected blobs, Michael S. Tsirkin, 2022/01/07
- [PULL v2 38/55] MAINTAINERS: Add a separate entry for acpi/VIOT tables, Michael S. Tsirkin, 2022/01/07
- [PULL v2 51/55] hw/scsi/vhost-scsi: don't double close vhostfd on error, Michael S. Tsirkin, 2022/01/07
- [PULL v2 52/55] virtio/vhost-vsock: don't double close vhostfd, remove redundant cleanup, Michael S. Tsirkin, 2022/01/07