From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34719) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XKQsG-0006y0-4m for qemu-devel@nongnu.org; Thu, 21 Aug 2014 07:49:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XKQsA-0003HX-VH for qemu-devel@nongnu.org; Thu, 21 Aug 2014 07:49:48 -0400 Received: from mail-wi0-x22f.google.com ([2a00:1450:400c:c05::22f]:40373) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XKQsA-0003HM-Ol for qemu-devel@nongnu.org; Thu, 21 Aug 2014 07:49:42 -0400 Received: by mail-wi0-f175.google.com with SMTP id ho1so8535195wib.8 for ; Thu, 21 Aug 2014 04:49:41 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <53F5DCD1.5050205@redhat.com> Date: Thu, 21 Aug 2014 13:49:37 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1408517593.25437.102.camel@ori.omang.mine.nu> <53F461E6.5020506@redhat.com> <1408527055.14053.107.camel@abi.no.oracle.com> <20140820113627.GG17371@redhat.com> <53F4A082.7090103@redhat.com> <87sikrus2w.fsf@blackfin.pond.sub.org> <53F4E9D9.2050102@redhat.com> In-Reply-To: <53F4E9D9.2050102@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/3] ioh3420: Provide a unique bus name and an interrupt mapping function List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake , Markus Armbruster Cc: Juan Quintela , Alexey Kardashevskiy , Marcel Apfelbaum , Knut Omang , qemu-devel@nongnu.org, Gonglei , "Michael S. Tsirkin" , Igor Mammedov Il 20/08/2014 20:32, Eric Blake ha scritto: > On 08/20/2014 08:57 AM, Markus Armbruster wrote: >> Paolo Bonzini 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 >>>> * .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 >>> .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 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