@@ -428,14 +428,11 @@ build_madt(GArray *table_data, BIOSLinker *linker, PCMachineState *pcms)
static void *acpi_set_bsel(PCIBus *bus, void *opaque)
{
unsigned *bsel_alloc = opaque;
- unsigned *bus_bsel;
if (qbus_is_hotpluggable(BUS(bus))) {
- bus_bsel = g_malloc(sizeof *bus_bsel);
-
- *bus_bsel = (*bsel_alloc)++;
+ bus->bus_bsel = (*bsel_alloc)++;
object_property_add_uint32_ptr(OBJECT(bus), ACPI_PCIHP_PROP_BSEL,
- bus_bsel, NULL);
+ &bus->bus_bsel, NULL);
}
return bsel_alloc;
@@ -41,6 +41,7 @@ struct PCIBus {
int *irq_count;
Notifier machine_done;
+ unsigned bus_bsel;
};
typedef struct PCIBridgeWindows PCIBridgeWindows;