[libvirt] [PATCH 0/7] Q35 support part 2

Laine Stump laine at laine.org
Mon Aug 5 05:17:24 UTC 2013


On 08/04/2013 08:18 PM, Doug Goldstein wrote:
> On Sun, Aug 4, 2013 at 6:50 PM, Doug Goldstein <cardoe at gentoo.org> wrote:
>> On Sat, Aug 3, 2013 at 9:11 PM, Laine Stump <laine at laine.org> wrote:
>>> On 08/03/2013 10:06 PM, Doug Goldstein wrote:
>>>> On Sat, Aug 3, 2013 at 8:48 PM, Laine Stump <laine at laine.org> wrote:
>>>>> On 08/03/2013 09:36 PM, Doug Goldstein wrote:
>>>>>> On Sat, Aug 3, 2013 at 6:28 PM, Laine Stump <laine at laine.org> wrote:
>>>>>>> ...and here is the result of applying all 10 patches of this 7 patch
>>>>>>> series, and starting up a domain using the config file attached to the
>>>>>>> end of this message:
>>>>>>>
>>>>>>> # lspci
>>>>>>> 00:00.0 Host bridge: Intel Corporation 82G33/G31/P35/P31 Express DRAM
>>>>>>> Controller
>>>>>>> 00:01.0 VGA compatible controller: Red Hat, Inc. Device 0100 (rev 04)
>>>>>>> 00:02.0 PCI bridge: Red Hat, Inc. Device 0001
>>>>>>> 00:1f.0 ISA bridge: Intel Corporation 82801IB (ICH9) LPC Interface
>>>>>>> Controller (rev 02)
>>>>>>> 00:1f.2 SATA controller: Intel Corporation 82801IR/IO/IH (ICH9R/DO/DH) 6
>>>>>>> port SATA AHCI Controller (rev 02)
>>>>>>> 00:1f.3 SMBus: Intel Corporation 82801I (ICH9 Family) SMBus Controller
>>>>>>> (rev 02)
>>>>>>> 01:01.0 PCI bridge: Red Hat, Inc. Device 0001
>>>>>>> 02:01.0 Ethernet controller: Red Hat, Inc Virtio network device
>>>>>>> 02:02.0 Ethernet controller: Red Hat, Inc Virtio network device
>>>>>>> 02:03.0 Multimedia audio controller: Intel Corporation 82801AA AC'97
>>>>>>> Audio Controller (rev 01)
>>>>>>> 02:04.0 Communication controller: Red Hat, Inc Virtio console
>>>>>>> 02:05.0 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI
>>>>>>> Controller #1 (rev 03)
>>>>>>> 02:05.1 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI
>>>>>>> Controller #2 (rev 03)
>>>>>>> 02:05.2 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI
>>>>>>> Controller #3 (rev 03)
>>>>>>> 02:05.7 USB Controller: Intel Corporation 82801I (ICH9 Family) USB2 EHCI
>>>>>>> Controller #1 (rev 03)
>>>>>>> 02:06.0 SCSI storage controller: Red Hat, Inc Virtio block device
>>>>>>> 02:07.0 Unclassified device [00ff]: Red Hat, Inc Virtio memory balloon
>>>>>>> 02:08.0 SATA controller: Intel Corporation 82801IR/IO/IH (ICH9R/DO/DH) 6
>>>>>>> port SATA AHCI Controller (rev 02)
>>>>>>>
>>>>>>> You'll notice that everything except the VGA, the implicit devices are
>>>>>>>
>>>>>>> Yay!
>>>>>>>
>>>>>>> Now if virt-manager just provided a way to change the machinetype of
>>>>>>> guests as they were being created... (does virt-manager explicitly
>>>>>>> specify USB controllers? Currently the Q35 doesn't automatically create
>>>>>>> a USB controller (see the patch comments)
>>>>>>>
>>>>>>> =========
>>>>>>> <domain type='kvm'>
>>>>>>>   <name>F15-q35</name>
>>>>>>>   <memory unit='KiB'>1048576</memory>
>>>>>>>   <currentMemory unit='KiB'>1048576</currentMemory>
>>>>>>>   <os>
>>>>>>>     <type arch='x86_64' machine='pc-q35-1.5'>hvm</type>
>>>>>>>     <boot dev='hd'/>
>>>>>>>     <bootmenu enable='yes'/>
>>>>>>>   </os>
>>>>>>>   <features>
>>>>>>>     <acpi/>
>>>>>>>     <apic/>
>>>>>>>     <pae/>
>>>>>>>   </features>
>>>>>>>   <clock offset='utc'/>
>>>>>>>   <devices>
>>>>>>>     <emulator>/usr/bin/qemu-kvm</emulator>
>>>>>>>     <disk type='file' device='disk'>
>>>>>>>       <driver name='qemu' type='raw'/>
>>>>>>>       <source file='/var/lib/libvirt/images/F15.img'/>
>>>>>>>       <target dev='vda' bus='virtio'/>
>>>>>>>     </disk>
>>>>>>>     <disk type='file' device='cdrom'>
>>>>>>>       <driver name='qemu' type='raw'/>
>>>>>>>       <source file='/home/laine/example.iso'/>
>>>>>>>       <target dev='hdc' bus='sata'/>
>>>>>>>       <readonly/>
>>>>>>>       <address type='drive' controller='0' bus='0' target='0' unit='0'/>
>>>>>>>     </disk>
>>>>>>>     <controller type='virtio-serial' index='0'/>
>>>>>>>     <controller type='usb' index='0' model='ich9-ehci1'/>
>>>>>>>     <controller type='usb' index='0' model='ich9-uhci1'>
>>>>>>>       <master startport='0'/>
>>>>>>>       <address type='pci' domain='0x0000' bus='0x02' slot='0x05'
>>>>>>> function='0x0' multifunction='on'/>
>>>>>>>     </controller>
>>>>>>>     <controller type='usb' index='0' model='ich9-uhci2'>
>>>>>>>       <master startport='2'/>
>>>>>>>       <address type='pci' domain='0x0000' bus='0x02' slot='0x05'
>>>>>>> function='0x1'/>
>>>>>>>     </controller>
>>>>>>>     <controller type='usb' index='0' model='ich9-uhci3'>
>>>>>>>       <master startport='4'/>
>>>>>>>       <address type='pci' domain='0x0000' bus='0x02' slot='0x05'
>>>>>>> function='0x2'/>
>>>>>>>     </controller>
>>>>>>>     <controller type='sata' index='0'/>
>>>>>>>     <controller type='sata' index='1'/>
>>>>>>>     <controller type='pci' index='0' model='pcie-root'/>
>>>>>>>     <interface type='network'>
>>>>>>>       <source network='ipv6'/>
>>>>>>>       <model type='virtio'/>
>>>>>>>     </interface>
>>>>>>>     <interface type='network'>
>>>>>>>       <source network='isolated'/>
>>>>>>>       <model type='virtio'/>
>>>>>>>     </interface>
>>>>>>>     <serial type='pty'>
>>>>>>>       <target port='0'/>
>>>>>>>     </serial>
>>>>>>>     <console type='pty'>
>>>>>>>       <target type='serial' port='0'/>
>>>>>>>     </console>
>>>>>>>     <input type='mouse' bus='ps2'/>
>>>>>>>     <graphics type='vnc' port='-1' autoport='yes'/>
>>>>>>>     <sound model='ac97'/>
>>>>>>>     <video>
>>>>>>>       <model type='qxl' ram='65536' vram='9216' heads='1'/>
>>>>>>>     </video>
>>>>>>>     <memballoon model='virtio'/>
>>>>>>>   </devices>
>>>>>>> </domain>
>>>>>>>
>>>>>>> --
>>>>>>> libvir-list mailing list
>>>>>>> libvir-list at redhat.com
>>>>>>> https://www.redhat.com/mailman/listinfo/libvir-list
>>>>>> Excellent thanks for providing a reference example. I've been trying
>>>>>> to review all your patches and work through testing bits and pieces
>>>>>> myself. I should have probably spoke up on the ML rather than
>>>>>> remaining silent. I'll finish up testing it tonight and ACK a handful
>>>>>> shortly.
>>>>>>
>>>>> I have made some small changes to some of the other patches in the
>>>>> meantime. If you're serious to the point of actually testing them out, I
>>>>> should repost the ones I haven't yet pushed (only the first three).
>>>>> Coming up momentarily...
>>>> Yeah please repost. Until you mentioned the seabios stuff in your last
>>>> e-mail I had been debugging that.
>>>
>>> That took me a while to figure out too (and I was getting really worried
>>> until I did). I'm just glad that Alex Williamson had previously told me
>>> that qemu wasn't strict about the "can't plug a PCI device into a PCIe
>>> slot" rule.
>>>
>>>
>>>> I've got a CentOS 6.4 VM I'm trying
>>>> to get up under Q35 on qemu-1.5.2 + libvirt master + your patch set as
>>>> part of my review.
>>> Cool! The more real world testing the better! Thanks for taking the time
>>> to do that. (My testing has been with an existing Fedora 15 guest that
>>> was hanging around. Not sure why I picked that one; maybe because it was
>>> the most disposable item on the list :-)
>> So with v2 I've achieved success as well with my CentOS 6.4 VM. Your
>> domain XML is shorter than mine (I'm using dumpxml --inactive) but
>> I'll post mine.
>>
>> <domain type='kvm'>
>>   <name>altima</name>
>>   <uuid>c2ca3b04-2ae9-0dd2-9855-109dcd90e38c</uuid>
>>   <description>CentOS 6.2 i386</description>
>>   <memory unit='KiB'>524288</memory>
>>   <currentMemory unit='KiB'>524288</currentMemory>
>>   <vcpu placement='static'>1</vcpu>
>>   <os>
>>     <type arch='x86_64' machine='pc-q35-1.5'>hvm</type>
>>     <boot dev='hd'/>
>>   </os>
>>   <features>
>>     <acpi/>
>>     <apic/>
>>     <pae/>
>>   </features>
>>   <clock offset='utc'>
>>     <timer name='rtc' tickpolicy='catchup' track='guest'>
>>       <catchup  threshold='123' slew='120' limit='10000'/>
>>     </timer>
>>     <timer name='pit' tickpolicy='delay'/>
>>   </clock>
>>   <on_poweroff>destroy</on_poweroff>
>>   <on_reboot>restart</on_reboot>
>>   <on_crash>restart</on_crash>
>>   <devices>
>>     <emulator>/usr/bin/qemu-kvm</emulator>
>>     <disk type='block' device='disk'>
>>       <driver name='qemu' type='raw'/>
>>       <source dev='/dev/vms/altima.img'/>
>>       <target dev='vda' bus='virtio'/>
>>       <address type='pci' domain='0x0000' bus='0x02' slot='0x04'
>> function='0x0'/>
>>     </disk>
>>     <disk type='block' device='cdrom'>
>>       <driver name='qemu' type='raw'/>
>>       <target dev='hdc' bus='ide'/>
>>       <readonly/>
>>       <address type='drive' controller='0' bus='1' target='0' unit='0'/>
>>     </disk>
>>     <controller type='sata' index='0'>
>>       <address type='pci' domain='0x0000' bus='0x00' slot='0x1f'
>> function='0x2'/>
>>     </controller>
>>     <controller type='sata' index='1'>
>>       <address type='pci' domain='0x0000' bus='0x02' slot='0x02'
>> function='0x0'/>
>>     </controller>
>>     <controller type='virtio-serial' index='0'>
>>       <address type='pci' domain='0x0000' bus='0x02' slot='0x03'
>> function='0x0'/>
>>     </controller>
>>     <controller type='pci' index='0' model='pcie-root'/>
>>     <controller type='pci' index='1' model='dmi-to-pci-bridge'>
>>       <address type='pci' domain='0x0000' bus='0x00' slot='0x02'
>> function='0x0'/>
>>     </controller>
>>     <controller type='pci' index='2' model='pci-bridge'>
>>       <address type='pci' domain='0x0000' bus='0x01' slot='0x01'
>> function='0x0'/>
>>     </controller>
>>     <controller type='usb' index='0' model='ich9-ehci1'>
>>       <address type='pci' domain='0x0000' bus='0x02' slot='0x07'
>> function='0x7'/>
>>     </controller>
>>     <controller type='usb' index='0' model='ich9-uhci1'>
>>       <master startport='0'/>
>>       <address type='pci' domain='0x0000' bus='0x02' slot='0x06'
>> function='0x0' multifunction='on'/>
>>     </controller>
>>     <controller type='usb' index='0' model='ich9-uhci2'>
>>       <master startport='2'/>
>>       <address type='pci' domain='0x0000' bus='0x02' slot='0x06'
>> function='0x1'/>
>>     </controller>
>>     <controller type='usb' index='0' model='ich9-uhci3'>
>>       <master startport='4'/>
>>       <address type='pci' domain='0x0000' bus='0x02' slot='0x06'
>> function='0x2'/>
>>     </controller>
>>     <controller type='ide' index='0'/>
>>     <interface type='bridge'>
>>       <mac address='52:54:00:a6:23:4f'/>
>>       <source bridge='br0'/>
>>       <model type='virtio'/>
>>       <address type='pci' domain='0x0000' bus='0x02' slot='0x01'
>> function='0x0'/>
>>     </interface>
>>     <serial type='pty'>
>>       <target port='0'/>
>>     </serial>
>>     <console type='pty'>
>>       <target type='serial' port='0'/>
>>     </console>
>>     <channel type='unix'>
>>       <source mode='bind' path='/var/lib/libvirt/qemu/altima.agent'/>
>>       <target type='virtio' name='org.qemu.guest_agent.0'/>
>>       <address type='virtio-serial' controller='0' bus='0' port='1'/>
>>     </channel>
>>     <channel type='spicevmc'>
>>       <target type='virtio' name='com.redhat.spice.0'/>
>>       <address type='virtio-serial' controller='0' bus='0' port='2'/>
>>     </channel>
>>     <input type='tablet' bus='usb'/>
>>     <input type='mouse' bus='ps2'/>
>>     <graphics type='spice' autoport='yes'/>
>>     <video>
>>       <model type='qxl' ram='65536' vram='65536' heads='1'/>
>>       <address type='pci' domain='0x0000' bus='0x00' slot='0x01'
>> function='0x0'/>
>>     </video>
>>     <memballoon model='virtio'>
>>       <address type='pci' domain='0x0000' bus='0x02' slot='0x05'
>> function='0x0'/>
>>     </memballoon>
>>   </devices>
>> </domain>
>>
>> [root at altima ~]# lspci
>> 00:00.0 Host bridge: Intel Corporation 82G33/G31/P35/P31 Express DRAM Controller
>> 00:01.0 VGA compatible controller: Red Hat, Inc. Device 0100 (rev 04)
>> 00:02.0 PCI bridge: Red Hat, Inc. Device 0001
>> 00:1f.0 ISA bridge: Intel Corporation 82801IB (ICH9) LPC Interface
>> Controller (rev 02)
>> 00:1f.2 SATA controller: Intel Corporation 82801IR/IO/IH (ICH9R/DO/DH)
>> 6 port SATA Controller [AHCI mode] (rev 02)
>> 00:1f.3 SMBus: Intel Corporation 82801I (ICH9 Family) SMBus Controller (rev 02)
>> 01:01.0 PCI bridge: Red Hat, Inc. Device 0001
>> 02:01.0 Ethernet controller: Red Hat, Inc Virtio network device
>> 02:02.0 SATA controller: Intel Corporation 82801IR/IO/IH (ICH9R/DO/DH)
>> 6 port SATA Controller [AHCI mode] (rev 02)
>> 02:03.0 Communication controller: Red Hat, Inc Virtio console
>> 02:04.0 SCSI storage controller: Red Hat, Inc Virtio block device
>> 02:05.0 Unclassified device [00ff]: Red Hat, Inc Virtio memory balloon
>> 02:06.0 USB controller: Intel Corporation 82801I (ICH9 Family) USB
>> UHCI Controller #1 (rev 03)
>> 02:06.1 USB controller: Intel Corporation 82801I (ICH9 Family) USB
>> UHCI Controller #2 (rev 03)
>> 02:06.2 USB controller: Intel Corporation 82801I (ICH9 Family) USB
>> UHCI Controller #3 (rev 03)
>>
>>
>> I did notice that the EHCI USB controller is missing on bus 2 slot 7
>> function 7. Not sure if I did something wrong there in my config or
>> we're still missing some of that plumbing.
>>
>> --
>> Doug Goldstein
> Promise I'm done spamming the list after this. Try to remove all the
> USB controllers and libvirt will still let you define the domain,
> which is wrong given the USB based tablet for mouse input. When you
> try to start the domain it will fail with the following:
>
> qemu-system-x86_64: -device usb-tablet,id=input0: No 'usb-bus' bus
> found for device 'usb-tablet'
>
> So we obviously need to ensure there is a USB controller defined and
> stop relying on the implicit one but that's outside of the scope of
> q35 work since technically this affects i440fx as well.

That's taken care of for i440fx - when no usb device is defined, the
post-parse will automatically add:

    <controller type='usb' index='0'/>

which equates to the simple usb1 controller that's part of the PIIX3
chipset that's included in the i440fx emulation. This works out to
adding "-usb" to the qemu commandline.


For q35, you can also add a "default" usb controller with "-usb", but it
actually adds 3 controllers, at function 1, 2, and 7 on slot 0x1D of
pcie.0. I wasn't comfortable with the idea of a single "<controller
type='usb' index='0'> adding 3 different devices, and wasn't sure if we
should handle this by instead adding a usb1 controller (seems kind of
ugly for q35) or adding three controllers to the config, so I punted by
not adding anything, so that whatever we finally decide to do will be
compatible with domains that are created in the meantime.

Right now I'm thinking that what we should do is: if there are *0* usb
controllers present during the post-parse callback, we should add all
three of the usb controllers to the config (*not* just a single
<controller type='usb' index='0'/>"), possibly on pcie.0 at slot 0x1D
(nice, but not necessary, and it would take some hacking because 1)
currently we have no way to suggesting what bus/slot to use in the
MaybeAddController function, and 2) usb devices are all classified as
PCI, and currently can't be plugged into pcie.0).

Realistically speaking, I can't do any of that in the next week, and
what is here is functional without closing the door to having an
auto-added usb setup in the future.



>




More information about the libvir-list mailing list