ioh3420: Provide a unique bus name and an interrupt mapping function
PATCH 2/3 ioh3420: Provide a unique bus name and an interrupt mapping function
A unique bus name is necessary to be able to refer to each instance from the command line and monitors.
--- hw/pci-bridge/ioh3420.c | 4 ++++ 1 file changed, 4 insertions(+)
hw/pci-bridge/ioh3420.c +4 -0
@@ -95,6 +95,9 @@ static int ioh3420_initfn(PCIDevice *d)PCIEPort *p =PCIE_PORT (d);PCIESlot *s =PCIE_SLOT (d);int rc; +char tmp[100 ]; +sprintf (tmp,"pcie_port.%d" , s->slot); +pci_bridge_map_irq (br,g_strdup (tmp), pci_swizzle_map_irq_fn); rc =pci_bridge_initfn (d,TYPE_PCIE_BUS );if (rc <0 ) {
@@ -154,6 +157,7 @@ static void ioh3420_exitfn(PCIDevice *d)pcie_cap_exit (d);msi_uninit (d);pci_bridge_exitfn (d); +g_free ((char *)br->bus_name); } PCIESlot *ioh3420_init(PCIBus *bus, int devfn, bool multifunction,
Signature · 1 line
1.9.0
Il 20/08/2014 08:53, Knut Omang ha scritto:
Quoted 2 lines
A unique bus name is necessary to be able to refer to each instance from the command line and monitors.
Is it needed? Can't you just add id= to the -device option?
Paolo
Quoted 5 lines · Paolo Bonzini
Il 20/08/2014 08:53, Knut Omang ha scritto:
Quoted 2 lines
A unique bus name is necessary to be able to refer to each instance from the command line and monitors.
Is it needed? Can't you just add id= to the -device option?
Yes, as far as I understand the problem is that the id= would work on the ioh3420 device itself, while what is needed here is to name the secondary bus of the ioh3420, which I haven't found a way to name from the command line.
Maybe an even better solution would be to have default names for everything, if not specified, from a user friendliness perspective?
I suppose this is a more general issue of sensible default values though, but the fact that it is easy to create devices which cannot be referred has caused me some confusion from time to time.
Quoted 1 line
Paolo
Thanks,
Knut
Quoted 11 lines · Knut Omang
Quoted 5 lines · Paolo Bonzini
Il 20/08/2014 08:53, Knut Omang ha scritto:
Quoted 2 lines
A unique bus name is necessary to be able to refer to each instance from the command line and monitors.
Is it needed? Can't you just add id= to the -device option?
Yes, as far as I understand the problem is that the id= would work on the ioh3420 device itself, while what is needed here is to name the secondary bus of the ioh3420, which I haven't found a way to name from the command line.
Did you try using the device name?
For pci bridges, unless you set bus_name, bus name will match device itself. See this code:
* If we don't specify the name, the bus will be addressed as
* <id>.0, where id is the device id.
* Since PCI Bridge devices have a single bus each, we don't need
* the index:
* let users address the bus using the device name.
*/
if (!br->bus_name && dev->qdev.id && *dev->qdev.id) {
br->bus_name = dev->qdev.id;
}
Quoted 12 lines
Maybe an even better solution would be to have default names for everything, if not specified, from a user friendliness perspective?
I suppose this is a more general issue of sensible default values though, but the fact that it is easy to create devices which cannot be referred has caused me some confusion from time to time.
Quoted 1 line
Paolo
Thanks,
Knut
Quoted 6 lines · Michael S. Tsirkin
Quoted 5 lines · Knut Omang
Quoted 4 lines · Paolo Bonzini
Il 20/08/2014 08:53, Knut Omang ha scritto:
Quoted 2 lines
A unique bus name is necessary to be able to refer to each instance from the command line and monitors.
Quoted 8 lines
Quoted 6 lines
Quoted 1 line
Is it needed? Can't you just add id= to the -device option?
Yes, as far as I understand the problem is that the id= would work on the ioh3420 device itself, while what is needed here is to name the secondary bus of the ioh3420, which I haven't found a way to name from the command line.
Did you try using the device name?
I believe I did, I tried a lot back and forth back then...
Quoted 12 lines
For pci bridges, unless you set
bus_name, bus name will match device itself. See this code:* If we don't specify the name, the bus will be addressed as
* <id>.0, where id is the device id.
* Since PCI Bridge devices have a single bus each, we don't need
* the index:
* let users address the bus using the device name.
*/
if (!br->bus_name &&dev->qdev.id&&*dev->qdev.id) {
br->bus_name=dev->qdev.id;
}
but my testing of this may well have been before your patch with this logic - the cost of being so slow with my patches - it won't happen again...
Both with the somewhat counterintuitive second re-provision of the bus name in
- pci_bridge_map_irq(br, g_strdup(tmp), pci_swizzle_map_irq_fn);
+ pci_bridge_map_irq(br, br->bus_name, pci_swizzle_map_irq_fn);
and actually with removing it due to Alex's commit 659fefee which was also not in when this was conceived, I am now able to instantiate two devices on two ports by means of:
-device ioh3420,slot=0,id=pcie_port.0
-device ioh3420,slot=1,id=pcie_port.1
-device <ari_capable_device1>,bus=pcie_port.0
-device <ari_capable_device2>,bus=pcie_port.1
In light of Markus' enlightening description of the mess here, unless there are more issues, I'll repost the rest of the changes without this commit,
Thanks,
Knut
Quoted 12 lines
Quoted 12 lines
Maybe an even better solution would be to have default names for everything, if not specified, from a user friendliness perspective?
I suppose this is a more general issue of sensible default values though, but the fact that it is easy to create devices which cannot be referred has caused me some confusion from time to time.
Quoted 1 line
Paolo
Thanks,
Knut
Il 20/08/2014 13:36, Michael S. Tsirkin ha scritto:
Quoted 4 lines
For pci bridges, unless you set
bus_name, bus name will match device itself. See this code:
Quoted 9 lines
* If we don't specify the name, the bus will be addressed as
* <id>.0, where id is the device id.
* Since PCI Bridge devices have a single bus each, we don't need
* the index:
* let users address the bus using the device name.
*/
if (!br->bus_name &&dev->qdev.id&&*dev->qdev.id) {
br->bus_name=dev->qdev.id;
}
Is libvirt using this rule? If not, I'd rather slash it since the <id>.0 name is shared with all other buses and not PCI-bridge-specific.
Paolo
Quoted 15 lines · Paolo Bonzini
Il 20/08/2014 13:36, Michael S. Tsirkin ha scritto:
Quoted 4 lines
For pci bridges, unless you set
bus_name, bus name will match device itself. See this code:Quoted 9 lines
* If we don't specify the name, the bus will be addressed as
* <id>.0, where id is the device id.
* Since PCI Bridge devices have a single bus each, we don't need
* the index:
* let users address the bus using the device name.
*/
if (!br->bus_name &&dev->qdev.id&&*dev->qdev.id) {
br->bus_name=dev->qdev.id;
}
Quoted 2 lines
Is libvirt using this rule? If not, I'd rather slash it since the <id>.0 name is shared with all other buses and not PCI-bridge-specific.
br->bus_name is null unless pci_bridge_map_irq() set it. Only caller for ioh3420 is ioh3420_init(), and that's dead code. Therefore, br->bus_name is null here.
Libvirt always sets a device ID. Slashing this this special case would change the bus name from ID.0 to just ID. That'll break libvirt, as far as I can tell from its source.
Sad.
Quoted 20 lines · Markus Armbruster
Quoted 15 lines · Paolo Bonzini
Il 20/08/2014 13:36, Michael S. Tsirkin ha scritto:
Quoted 4 lines
For pci bridges, unless you set
bus_name, bus name will match device itself. See this code:Quoted 9 lines
* If we don't specify the name, the bus will be addressed as
* <id>.0, where id is the device id.
* Since PCI Bridge devices have a single bus each, we don't need
* the index:
* let users address the bus using the device name.
*/
if (!br->bus_name &&dev->qdev.id&&*dev->qdev.id) {
br->bus_name=dev->qdev.id;
}Quoted 2 lines
Is libvirt using this rule? If not, I'd rather slash it since the <id>.0 name is shared with all other buses and not PCI-bridge-specific.
Quoted 7 lines
br->bus_nameis null unlesspci_bridge_map_irq()set it. Only caller for ioh3420 isioh3420_init(), and that's dead code. Therefore,br->bus_nameis null here.Libvirt always sets a device ID. Slashing this this special case would change the bus name from ID.0 to just ID. That'll break libvirt, as far as I can tell from its source.
Libvirt has had to deal with shenanigans like this before:
Quoted 2 lines
Sad.
Although libvirt could deal with the fallout (especially if it is made introspectible, instead of just randomly changing with no witness that can be probed via QMP), you are correct that it would be nicer to not break existing clients :(
Signature · 2 lines
Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Il 20/08/2014 20:32, Eric Blake ha scritto:
Quoted 25 lines · Markus Armbruster
Quoted 24 lines
Quoted 15 lines · Paolo Bonzini
Il 20/08/2014 13:36, Michael S. Tsirkin ha scritto:
Quoted 4 lines
For pci bridges, unless you set
bus_name, bus name will match device itself. See this code:Quoted 9 lines
* If we don't specify the name, the bus will be addressed as
* <id>.0, where id is the device id.
* Since PCI Bridge devices have a single bus each, we don't need
* the index:
* let users address the bus using the device name.
*/
if (!br->bus_name &&dev->qdev.id&&*dev->qdev.id) {
br->bus_name=dev->qdev.id;
}Quoted 2 lines
Is libvirt using this rule? If not, I'd rather slash it since the <id>.0 name is shared with all other buses and not PCI-bridge-specific.
br->bus_nameis null unlesspci_bridge_map_irq()set it. Only caller for ioh3420 isioh3420_init(), and that's dead code. Therefore,br->bus_nameis null here.
Quoted 7 lines
Quoted 3 lines
Libvirt always sets a device ID. Slashing this this special case would change the bus name from ID.0 to just ID. That'll break libvirt, as far as I can tell from its source.
Libvirt has had to deal with shenanigans like this before:
While I applaud your attempts, I still maintain that it is pointless to support anything but a very recent QEMU (let's say 2.0+ right now) for non-x86 architecture.
I think that for q35 we should still be able to do modifications (and perhaps should not even be providing backwards-compatible machine types), but pci bridges affect piix4 too.
Paolo
Quoted 11 lines · Knut Omang
Quoted 5 lines · Paolo Bonzini
Il 20/08/2014 08:53, Knut Omang ha scritto:
Quoted 2 lines
A unique bus name is necessary to be able to refer to each instance from the command line and monitors.
Is it needed? Can't you just add id= to the -device option?
Yes, as far as I understand the problem is that the id= would work on the ioh3420 device itself, while what is needed here is to name the secondary bus of the ioh3420, which I haven't found a way to name from the command line.
Bus names in qdev are a mess. Here are the rules:
1. If code provides a name, that's the name.
2. Else, if the device has an ID, the name is ID.N, where N counts the device's buses from zero.
3. Else, the name is BUS-TYPE-NAME.N, where N counts the buses of this type from zero.
This results in a usable bus name unless device IDs collide with bus type names, or the code provides names that collide.
The user needs to take care to use IDs that don't collide with bus names. Adding new bus names may screw some users.
The user needs to take further care to use IDs whenever the code provides a bus name that collides. Adding code that provides bus names may screw some users.
Broken by design.
The problem here is "code provides names that collide": device q35-pcihost provides the name "pcie.0". Bound to collide with the first PCIE bus named under rule 3. For instance, if you next add an ioh3420 without ID, its bus is also named "pcie.0".
Rule 1 should be taken out and shot. Unfortunately, that'll break ABI left & right. Instead, we can try to reduce its use. The appended does exactly that for q35-pcihost. With it applied, the bus provided by q35-pcihost still gets the same name "pcie.0", but under rule 3 instead of rule 1. Rule 3 then names further PCIE buses "pcie.1", "pcie.2", ... instead of "pcie.0", "pcie.1", ... Better, but it's still an ABI break.
Quoted 2 lines
Maybe an even better solution would be to have default names for everything, if not specified, from a user friendliness perspective?
Buses *have* a default name! You're confusing this with device IDs, which exist only when the user sets one.
Changes in this area are difficult, because the names are all ABI. Names that cannot be used are fair game, of course.
Quoted 3 lines
I suppose this is a more general issue of sensible default values though, but the fact that it is easy to create devices which cannot be referred has caused me some confusion from time to time.
Picking default qdev IDs risks collisions with the user's IDs. We shouldn't do that. We do it anyway in a few places, for historical reasons.
QOM paths might be a sane way to let users refer to devices without IDs.
While writing the above, I stumbled another rule 1 screwup: pci_bridge.c attempts to "improve" the boring standard bus names chosen via rule 2 or 3.
pci_bridge_initfn() provides a bus name of its own (commit 8a3d80fpci_bridge: user-friendly default bus name):
a. If pci_bridge_map_irq() set a bus name, that's the name.
b. Else, if the device has an ID, that's the name. Thus, ID.N is "improved" to just ID, at the cost of a special case: now users have to avoid not just IDs of the form BUS-TYPE-NAME.N, but also plain BUS-TYPE-NAME.
Callers of pci_bridge_map_irq() generally provide a name. Some names contain spaces, thus can't collide (but would be bloody inconvenient on the command line or in the monitor). Others don't, but thankfully the ones I checked are in dead code. Craptastic.
hw/pci-host/q35.c +1 -1
@@ -47,7 +47,7 @@ static void q35_host_realize(DeviceState *dev, Error **errp)sysbus_add_io (sbd,MCH_HOST_BRIDGE_CONFIG_DATA , &pci->data_mem);sysbus_init_ioports (sbd,MCH_HOST_BRIDGE_CONFIG_DATA ,4 ); - pci->bus =pci_bus_new (DEVICE (s),"pcie.0" , + pci->bus =pci_bus_new (DEVICE (s),NULL , s->mch.pci_address_space, s->mch.address_space_io,0 ,TYPE_PCIE_BUS );qdev_set_parent_bus (DEVICE (&s->mch),BUS (pci->bus));
Quoted 92 lines · Markus Armbruster
Quoted 11 lines · Knut Omang
Quoted 5 lines · Paolo Bonzini
Il 20/08/2014 08:53, Knut Omang ha scritto:
Quoted 2 lines
A unique bus name is necessary to be able to refer to each instance from the command line and monitors.
Is it needed? Can't you just add id= to the -device option?
Yes, as far as I understand the problem is that the id= would work on the ioh3420 device itself, while what is needed here is to name the secondary bus of the ioh3420, which I haven't found a way to name from the command line.
Bus names in qdev are a mess. Here are the rules:
1. If code provides a name, that's the name.
2. Else, if the device has an ID, the name is ID.N, where N counts the device's buses from zero.
3. Else, the name is BUS-TYPE-NAME.N, where N counts the buses of this type from zero.
This results in a usable bus name unless device IDs collide with bus type names, or the code provides names that collide.
The user needs to take care to use IDs that don't collide with bus names. Adding new bus names may screw some users.
The user needs to take further care to use IDs whenever the code provides a bus name that collides. Adding code that provides bus names may screw some users.
Broken by design.
The problem here is "code provides names that collide": device q35-pcihost provides the name "pcie.0". Bound to collide with the first PCIE bus named under rule 3. For instance, if you next add an ioh3420 without ID, its bus is also named "pcie.0".
Rule 1 should be taken out and shot. Unfortunately, that'll break ABI left & right. Instead, we can try to reduce its use. The appended does exactly that for q35-pcihost. With it applied, the bus provided by q35-pcihost still gets the same name "pcie.0", but under rule 3 instead of rule 1. Rule 3 then names further PCIE buses "pcie.1", "pcie.2", ... instead of "pcie.0", "pcie.1", ... Better, but it's still an ABI break.
Quoted 2 lines
Maybe an even better solution would be to have default names for everything, if not specified, from a user friendliness perspective?
Buses *have* a default name! You're confusing this with device IDs, which exist only when the user sets one.
Changes in this area are difficult, because the names are all ABI. Names that cannot be used are fair game, of course.
Quoted 3 lines
I suppose this is a more general issue of sensible default values though, but the fact that it is easy to create devices which cannot be referred has caused me some confusion from time to time.
Picking default qdev IDs risks collisions with the user's IDs. We shouldn't do that. We do it anyway in a few places, for historical reasons.
QOM paths might be a sane way to let users refer to devices without IDs.
While writing the above, I stumbled another rule 1 screwup:
pci_bridge.cattempts to "improve" the boring standard bus names chosen via rule 2 or 3.
pci_bridge_initfn()provides a bus name of its own (commit 8a3d80fpci_bridge: user-friendly default bus name):
a. Ifpci_bridge_map_irq()set a bus name, that's the name.b. Else, if the device has an ID, that's the name. Thus, ID.N is "improved" to just ID, at the cost of a special case: now users have to avoid not just IDs of the form BUS-TYPE-NAME.N, but also plain BUS-TYPE-NAME.
Callers of
pci_bridge_map_irq()generally provide a name. Some names contain spaces, thus can't collide (but would be bloody inconvenient on the command line or in the monitor). Others don't, but thankfully the ones I checked are in dead code. Craptastic.hw/pci-host/q35.c +0
-0
hw/pci-host/q35.c static void q35_host_realize(DeviceState *dev, Error **errp) · line 53
Quoted 8 lines
hw/pci-host/q35.c +1
-1@@ -47,7 +47,7 @@ static void q35_host_realize(DeviceState *dev, Error **errp)sysbus_add_io (sbd,MCH_HOST_BRIDGE_CONFIG_DATA , &pci->data_mem);sysbus_init_ioports (sbd,MCH_HOST_BRIDGE_CONFIG_DATA ,4 ); - pci->bus =pci_bus_new (DEVICE (s),"pcie.0" , + pci->bus =pci_bus_new (DEVICE (s),NULL , s->mch.pci_address_space, s->mch.address_space_io,0 ,TYPE_PCIE_BUS );qdev_set_parent_bus (DEVICE (&s->mch),BUS (pci->bus));
This is for the root bus, I think it won't help Knut who's trying to add devices behind root ports.
Quoted 96 lines · Michael S. Tsirkin
Quoted 95 lines · Markus Armbruster
Quoted 11 lines · Knut Omang
Quoted 5 lines · Paolo Bonzini
Il 20/08/2014 08:53, Knut Omang ha scritto:
Quoted 2 lines
A unique bus name is necessary to be able to refer to each instance from the command line and monitors.
Is it needed? Can't you just add id= to the -device option?
Yes, as far as I understand the problem is that the id= would work on the ioh3420 device itself, while what is needed here is to name the secondary bus of the ioh3420, which I haven't found a way to name from the command line.
Bus names in qdev are a mess. Here are the rules:
1. If code provides a name, that's the name.
2. Else, if the device has an ID, the name is ID.N, where N counts the device's buses from zero.
3. Else, the name is BUS-TYPE-NAME.N, where N counts the buses of this type from zero.
This results in a usable bus name unless device IDs collide with bus type names, or the code provides names that collide.
The user needs to take care to use IDs that don't collide with bus names. Adding new bus names may screw some users.
The user needs to take further care to use IDs whenever the code provides a bus name that collides. Adding code that provides bus names may screw some users.
Broken by design.
The problem here is "code provides names that collide": device q35-pcihost provides the name "pcie.0". Bound to collide with the first PCIE bus named under rule 3. For instance, if you next add an ioh3420 without ID, its bus is also named "pcie.0".
Rule 1 should be taken out and shot. Unfortunately, that'll break ABI left & right. Instead, we can try to reduce its use. The appended does exactly that for q35-pcihost. With it applied, the bus provided by q35-pcihost still gets the same name "pcie.0", but under rule 3 instead of rule 1. Rule 3 then names further PCIE buses "pcie.1", "pcie.2", ... instead of "pcie.0", "pcie.1", ... Better, but it's still an ABI break.
Quoted 2 lines
Maybe an even better solution would be to have default names for everything, if not specified, from a user friendliness perspective?
Buses *have* a default name! You're confusing this with device IDs, which exist only when the user sets one.
Changes in this area are difficult, because the names are all ABI. Names that cannot be used are fair game, of course.
Quoted 3 lines
I suppose this is a more general issue of sensible default values though, but the fact that it is easy to create devices which cannot be referred has caused me some confusion from time to time.
Picking default qdev IDs risks collisions with the user's IDs. We shouldn't do that. We do it anyway in a few places, for historical reasons.
QOM paths might be a sane way to let users refer to devices without IDs.
While writing the above, I stumbled another rule 1 screwup:
pci_bridge.cattempts to "improve" the boring standard bus names chosen via rule 2 or 3.
pci_bridge_initfn()provides a bus name of its own (commit 8a3d80fpci_bridge: user-friendly default bus name):
a. Ifpci_bridge_map_irq()set a bus name, that's the name.b. Else, if the device has an ID, that's the name. Thus, ID.N is "improved" to just ID, at the cost of a special case: now users have to avoid not just IDs of the form BUS-TYPE-NAME.N, but also plain BUS-TYPE-NAME.
Callers of
pci_bridge_map_irq()generally provide a name. Some names contain spaces, thus can't collide (but would be bloody inconvenient on the command line or in the monitor). Others don't, but thankfully the ones I checked are in dead code. Craptastic.hw/pci-host/q35.c +0
-0@@ -47,7 +47,7 @@ static void q35_host_realize(DeviceState *dev, Error **errp)sysbus_add_io (sbd,MCH_HOST_BRIDGE_CONFIG_DATA , &pci->data_mem);sysbus_init_ioports (sbd,MCH_HOST_BRIDGE_CONFIG_DATA ,4 );
Quoted 8 lines
hw/pci-host/q35.c static void q35_host_realize(DeviceState *dev, Error **errp) · line 53
Quoted 5 lines
hw/pci-host/q35.c +1
-1- pci->bus =pci_bus_new (DEVICE (s),"pcie.0" , + pci->bus =pci_bus_new (DEVICE (s),NULL , s->mch.pci_address_space, s->mch.address_space_io,0 ,TYPE_PCIE_BUS );qdev_set_parent_bus (DEVICE (&s->mch),BUS (pci->bus));This is for the root bus, I think it won't help Knut who's trying to add devices behind root ports.
Read again, more slowly :)
Yes, I null the name of the root bus. That makes the qdev machinery derive the very same "pcie.0" name via rule 3 instead of rule 1, with the side effect that future (non-root) PCIE buses get different names. In particular, the next one named via rule 3 will be called "pcie.1" instead of "pcie.0", making it actually accessible.
Il 20/08/2014 15:03, Markus Armbruster ha scritto:
Quoted 10 lines
Quoted 3 lines
Quoted 3 lines
This is for the root bus, I think it won't help Knut who's trying to add devices behind root ports.
Read again, more slowly :)
Yes, I null the name of the root bus. That makes the qdev machinery derive the very same "pcie.0" name via rule 3 instead of rule 1, with the side effect that future (non-root) PCIE buses get different names. In particular, the next one named via rule 3 will be called "pcie.1" instead of "pcie.0", making it actually accessible.
I agree that this is a big improvement.
Paolo
Quoted 6 lines · Paolo Bonzini
Il 20/08/2014 15:03, Markus Armbruster ha scritto:
Quoted 5 lines
Quoted 3 lines
Quoted 3 lines
This is for the root bus, I think it won't help Knut who's trying to add devices behind root ports.
Read again, more slowly :)
Quoted 7 lines
Quoted 5 lines
Yes, I null the name of the root bus. That makes the qdev machinery derive the very same "pcie.0" name via rule 3 instead of rule 1, with the side effect that future (non-root) PCIE buses get different names. In particular, the next one named via rule 3 will be called "pcie.1" instead of "pcie.0", making it actually accessible.
I agree that this is a big improvement.
It's also an ABI break. I'm not saying we can't do it, just that we better consider it carefully.
Hi Knut,
Am 20.08.2014 08:53, schrieb Knut Omang:
Quoted 14 lines
A unique bus name is necessary to be able to refer to each instance from the command line and monitors.
Signed-off-by Knut Omang <[email protected]>--- hw/pci-bridge/ioh3420.c | 4 ++++ 1 file changed, 4 insertions(+)hw/pci-bridge/ioh3420.c +0
-0
hw/pci-bridge/ioh3420.c static int ioh3420_initfn(PCIDevice *d) · line 100
Quoted 6 lines
hw/pci-bridge/ioh3420.c +3
-0@@ -95,6 +95,9 @@ static int ioh3420_initfn(PCIDevice *d)PCIEPort *p =PCIE_PORT (d);PCIESlot *s =PCIE_SLOT (d);int rc; +char tmp[100 ]; +sprintf (tmp,"pcie_port.%d" , s->slot); +pci_bridge_map_irq (br,g_strdup (tmp), pci_swizzle_map_irq_fn);
Style issues apart (white line being dropped), this is a rather convoluted way of providing a bus name to something. ;)
That makes me think something else is going wrong, or APIs may need to be improved. Could you elaborate for those not intimately familiar with this bridge what name you're seeing before, given a particular command line, and explain why IRQ mapping affects the bus name?
Thanks,
Andreas
Quoted 11 lines
hw/pci-bridge/ioh3420.c +1
-0rc =pci_bridge_initfn (d,TYPE_PCIE_BUS );if (rc <0 ) {@@ -154,6 +157,7 @@ static void ioh3420_exitfn(PCIDevice *d)pcie_cap_exit (d);msi_uninit (d);pci_bridge_exitfn (d); +g_free ((char *)br->bus_name); } PCIESlot *ioh3420_init(PCIBus *bus, int devfn, bool multifunction,
Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg