From f66f64cf3ca968db2ca7f45bfd125ec7d85624e5 Mon Sep 17 00:00:00 2001 From: jiangdongxu Date: Mon, 4 Dec 2023 17:30:02 +0800 Subject: [PATCH] Revert "hw/virtio/virtio-iommu-pci: Enforce the device is plugged on the root bus" This reverts commit a2323aa79da71c92e818306f1e18184619309a35. Signed-off-by: jiangdongxu --- hw/virtio/virtio-iommu-pci.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/hw/virtio/virtio-iommu-pci.c b/hw/virtio/virtio-iommu-pci.c index 37eb2fb979..a160ae6b41 100644 --- a/hw/virtio/virtio-iommu-pci.c +++ b/hw/virtio/virtio-iommu-pci.c @@ -44,7 +44,6 @@ static Property virtio_iommu_pci_properties[] = { static void virtio_iommu_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp) { VirtIOIOMMUPCI *dev = VIRTIO_IOMMU_PCI(vpci_dev); - PCIBus *pbus = pci_get_bus(&vpci_dev->pci_dev); DeviceState *vdev = DEVICE(&dev->vdev); VirtIOIOMMU *s = VIRTIO_IOMMU(vdev); @@ -66,17 +65,11 @@ static void virtio_iommu_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp) s->reserved_regions[i].type != VIRTIO_IOMMU_RESV_MEM_T_MSI) { error_setg(errp, "reserved region %d has an invalid type", i); error_append_hint(errp, "Valid values are 0 and 1\n"); - return; - } + } } - if (!pci_bus_is_root(pbus)) { - error_setg(errp, "virtio-iommu-pci must be plugged on the root bus"); - return; - } - object_property_set_link(OBJECT(dev), "primary-bus", - OBJECT(pbus), &error_abort); - + OBJECT(pci_get_bus(&vpci_dev->pci_dev)), + &error_abort); virtio_pci_force_virtio_1(vpci_dev); qdev_realize(vdev, BUS(&vpci_dev->bus), errp); } -- 2.27.0