
On 07/10/2012 01:01 AM, Osier Yang wrote:
On 2012年07月10日 01:29, Peter Krempa wrote:
Libvirt adds a USB controller to the guest even if the user does not specify any in the XML. This is due to back-compat reasons.
It's not for back-compat reasons as far as I known, 42043afcd adds the implicit USB controller for virt-manager's use, and it causes the regression bug of migration, as the old libvirt doesn't have a default USB controller as a force. Jirka fixed it by commit 409b5f549.
It IS for back-compat reasons. We have been outputting '-usb' in the qemu command line for ages prior to 42043afcd, and need a way to explicitly omit the '-usb' in the command line. Older libvirt had no way to represent the implicit device, and the fix of 409b5f549 was more of a hack that said when migrating back to an older libvirt, the existing usb controller of the sending libvirt would be implicitly recreated by the receiving libvirt. If a user explicitly requests the 'none' controller, then we must ensure that migration to an older host fails up front; the 'none' element must be explicit because the absence of an element implies the default usb controller.
Is it a hard requirement of specify the 'none' USB controller model?
Yes, just like it is a hard requirement that a user explicitly specifies the 'none' memoryballoon controller. That's the back-compat issue we have to face any time we make the XML explicit for something that older libvirt provided implicitly. This patch looks correct to me. -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org