qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 2/3] ioh3420: Provide a unique bus name and an i


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 2/3] ioh3420: Provide a unique bus name and an interrupt mapping function
Date: Wed, 20 Aug 2014 12:32:57 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.7.0

On 08/20/2014 08:57 AM, Markus Armbruster wrote:
> Paolo Bonzini <address@hidden> writes:
> 
>> Il 20/08/2014 13:36, Michael S. Tsirkin ha scritto:
>>>
>>> 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;
>>>     }
>>
>> 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.

Libvirt has had to deal with shenanigans like this before:

http://libvirt.org/git/?p=libvirt.git;a=blob;f=src/qemu/qemu_capabilities.c;h=b758b5a0d4;hb=HEAD#l1982

> 
> 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 :(

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]