在 2013-01-07一的 17:57 +0100,Ján Tomko写道: > On 01/04/13 03:28, li guang wrote: > > 在 2013-01-03四的 16:13 +0100,Ján Tomko写道: > >> On 12/26/12 02:00, liguang wrote: > >>> @@ -1801,10 +1803,13 @@ qemuBuildDeviceAddressStr(virBufferPtr buf, > >>> * When QEMU grows support for > 1 PCI domain, then pci.0 change > >>> * to pciNN.0 where NN is the domain number > >>> */ > >>> - if (qemuCapsGet(caps, QEMU_CAPS_PCI_MULTIBUS)) > >>> + if (info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCIBRIDGE) { > >>> + virBufferAsprintf(buf, ",bus=pci-bridge%d", info->addr.pci.bus); > >>> + } else if (qemuCapsGet(caps, QEMU_CAPS_PCI_MULTIBUS)) { > >>> virBufferAsprintf(buf, ",bus=pci.0"); > >> > >> Is there any way (or plan) to use more pci buses with QEMU other than > >> with the pci bridges? If not, we could just name the bridges pci.%d. (If > >> we index the bridges from 1). > > > > as far as I know, qemu can't use multi-pci-bus, > > so only pci.0 accepted now. > > > >> > >>> - else > >>> + } else { > >>> virBufferAsprintf(buf, ",bus=pci"); > >>> + } > >>> if (info->addr.pci.multi == VIR_DEVICE_ADDRESS_PCI_MULTI_ON) > >>> virBufferAddLit(buf, ",multifunction=on"); > >>> else if (info->addr.pci.multi == VIR_DEVICE_ADDRESS_PCI_MULTI_OFF) > >>> @@ -3455,6 +3460,32 @@ error: > >>> return NULL; > >>> } > >> > >> > >>> > >>> +char * > >>> +qemuBuildPCIbridgeDevStr(virDomainPCIbridgeDefPtr dev, > >>> + qemuCapsPtr caps, int idx) > >>> +{ > >>> + virBuffer buf = VIR_BUFFER_INITIALIZER; > >>> + > >>> + virBufferAsprintf(&buf, "pci-bridge,chassis_nr=1"); > >> > >> The chassis number has to be unique for each bridge. > > > > chassis number is not so important, > > here, I just set all bridges in same chassis. > > > > > > Each bridge must have a unique chassis #. > > You *must* set it to a value > 0. > > I don't check that it is unique, just that it is >0. > > If you make it non unique, guest will be confused. > > http://lists.gnu.org/archive/html/qemu-devel/2012-02/msg02765.html Oh, to be a little pedantic, please refer to PCI-TO-PCI BRIDGE ARCHITECTURE SPECIFICATION, REV 1.2, page 146, as I said before, 'I just set all bridges in same chassis', that means, 1 main chassis(#0) ,1 expansion chassis(#1), maybe it seems strange, but It's not illegal. of course, I will consider your advice to make it unique. Thanks! > > Jan -- regards! li guang -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list