Bug 818996 - [rfe] allow to disable usb & vga altogether
[rfe] allow to disable usb & vga altogether
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
6.3
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Peter Krempa
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-04 10:44 EDT by Gerd Hoffmann
Modified: 2013-02-21 02:12 EST (History)
10 users (show)

See Also:
Fixed In Version: libvirt-0.10.0-0rc1.el6
Doc Type: Enhancement
Doc Text:
Feature: This feature allows the user to disable USB and graphics controllers in guest machines. In default configuration those controllers are automatically used. Reason: Some users prefer to run minimal configurations for server systems without the need for graphics or USB support.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-02-21 02:12:42 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
pseries.xml (1.36 KB, text/plain)
2012-05-08 11:30 EDT, Gerd Hoffmann
no flags Details

  None (edit)
Description Gerd Hoffmann 2012-05-04 10:44:16 EDT
Description of problem:

On Fri, May 04, 2012 at 04:22:14PM +0200, Gerd Hoffmann wrote:
>   Hi,
>
> Is there some way to disable usb altogether?  libvirt used to just pass
> in '-usb'.  With the arrival of usb2 support that changed into '-device
> uhci,...'.  Problem is that this breaks with several machine types such
> as isapc.  '-usb' is silently ignored in case the machine type can't
> handle usb.  '-device uhci,...' leads to an error message though and the
> guest doesn't start.
>
> /me tried "<controller type='usb' model='none'/>" which didn't work.
> Just removing the controller from the xml doesn't work too, it gets
> automagically readded.

Sadly this isn't possible yet. The only way to make it possible would
be to use the model='none' idea as you mention, since that matches
the virtio-balloon approach.

Daniel
Comment 3 Gerd Hoffmann 2012-05-08 11:27:56 EDT
While being at it:  There is a simliar issue with the vga, there seems to be no way to configure a vm without <video>.
Comment 4 Gerd Hoffmann 2012-05-08 11:30:28 EDT
Created attachment 583019 [details]
pseries.xml

Use case: upstream qemu, pseries emulation, install rhel6/ppc64 there.
Comment 5 Dave Allan 2012-05-08 13:20:51 EDT
Gerd, I generally use VMs without video.  I have no <video> tag in my xml, and I get -nographic on the qemu command line.  If you have a <graphics> tag, though, libvirt will auto create the <video> tag.  Is that what you mean?
Comment 6 Gerd Hoffmann 2012-05-09 03:56:12 EDT
Ah, that sort-of makes sense.  You can map the serial console to the vnc display though (-serial vc), in which case the it makes sense to have <graphics> without <video>.

What is the general support plan for non-pc machine types?  You quickly run into all sorts of issues then as libvirt has '-M pc' assumtions built in all over the place.  Is isapc supposted to work?  How about ppc / arm emulation?  Should I file bugs for all issues I run into when trying to run qemu-system-ppc64 with libvirt?
Comment 7 Dave Allan 2012-05-10 11:39:38 EDT
(In reply to comment #6)
> Ah, that sort-of makes sense.  You can map the serial console to the vnc
> display though (-serial vc), in which case the it makes sense to have
> <graphics> without <video>.

I see; would you mind filing a separate BZ about this behavior?  It seems quite different from the original report about USB.

> What is the general support plan for non-pc machine types?  You quickly run
> into all sorts of issues then as libvirt has '-M pc' assumtions built in all
> over the place.  Is isapc supposted to work?  How about ppc / arm emulation? 
> Should I file bugs for all issues I run into when trying to run
> qemu-system-ppc64 with libvirt?

Yes, please do.
Comment 9 Gerd Hoffmann 2012-05-11 04:21:29 EDT
Re #7: Well, it is simliar, both <controller usb> and <video> get added automatically and there is no way to disable this, using via model='none' for example.
Comment 11 Dave Allan 2012-05-11 12:22:56 EDT
Fair enough; sounds like we've got a bunch of problems in this area that could use a little attention.
Comment 13 Peter Krempa 2012-08-02 06:27:32 EDT
Libvirt does support removing video device when you remove the definition from the XML (it's not automaticaly added). On the other hand libvirt automaticaly adds USB bus to the guest. This can be now avoided with usb controller model=none that was added upstream with:

commit fbe871263c7050b59accf10bd3517e4cd5758683
Author: Peter Krempa <pkrempa@redhat.com>
Date:   Tue Jul 3 15:43:13 2012 +0200

    qemu: Add support for "none" USB controller
    
commit 317badb213f88da3cf7eb9e65afd55492801d57c
Author: Peter Krempa <pkrempa@redhat.com>
Date:   Tue Jul 3 15:30:25 2012 +0200

    domain_conf: Add helpers to verify if device configuration is valid
    
commit 0925189713c5f9479fdfa176b5a47a7a225cebd6
Author: Peter Krempa <pkrempa@redhat.com>
Date:   Mon Jul 2 17:28:43 2012 +0200

    domain_conf: Add USB controler model "none"

Moving to POST as this change will be picked up by rebasing.
Comment 15 weizhang 2012-08-23 23:33:17 EDT
Verify PASS on
libvirt-0.10.0-0rc1.el6.x86_64
kernel-2.6.32-289.el6.x86_64
qemu-kvm-0.12.1.2-2.302.el6.x86_64

1. usb hub with controller and model = none
# cat usb-hub.xml
<domain type='kvm'>
  <name>QEMUGuest1</name>
  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
  <memory unit='KiB'>219136</memory>
  <currentMemory unit='KiB'>219136</currentMemory>
  <vcpu placement='static'>1</vcpu>
  <os>
    <type arch='i686' machine='pc'>hvm</type>
    <boot dev='hd'/>
  </os>
  <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <controller type='usb' model='none' index='0'/>
    <memballoon model='virtio'/>
    <hub type='usb'>
      <address type='usb' bus='0' port='1'/>
    </hub>
  </devices>
</domain>

# virsh define usb-hub.xml 
error: Failed to define domain from usb-hub.xml
error: unsupported configuration: Can't add USB hub: USB is disabled for this domain

2. 2 usb controllers with 1 model = none
# cat usb-2.xml
<domain type='kvm'>
  <name>QEMUGuest1</name>
  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
  <memory unit='KiB'>219136</memory>
  <currentMemory unit='KiB'>219136</currentMemory>
  <vcpu placement='static'>1</vcpu>
  <os>
    <type arch='i686' machine='pc'>hvm</type>
    <boot dev='hd'/>
  </os>
  <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <controller type='usb' model='none' index='0'/>
    <controller type='usb' index='0'/>
    <memballoon model='virtio'/>
  </devices>
</domain>

# virsh define usb-2.xml 
error: Failed to define domain from usb-2.xml
error: Can't add another USB controller: USB is disabled for this domain

3. usb tablet with controller and model = none
# cat usb-tablet.xml
<domain type='kvm'>
  <name>QEMUGuest1</name>
  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
  <memory unit='KiB'>219136</memory>
  <currentMemory unit='KiB'>219136</currentMemory>
  <vcpu placement='static'>1</vcpu>
  <os>
    <type arch='i686' machine='pc'>hvm</type>
    <boot dev='hd'/>
  </os>
  <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <controller type='usb' model='none' index='0'/>
    <input type='tablet' bus='usb'/>
    <memballoon model='virtio'/>
  </devices>
</domain>
<domain type='kvm'>
  <name>QEMUGuest1</name>
  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
  <memory unit='KiB'>219136</memory>
  <currentMemory unit='KiB'>219136</currentMemory>
  <vcpu placement='static'>1</vcpu>
  <os>
    <type arch='i686' machine='pc'>hvm</type>
    <boot dev='hd'/>
  </os>
  <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <controller type='usb' model='none' index='0'/>
    <input type='tablet' bus='usb'/>
    <memballoon model='virtio'/>
  </devices>
</domain>

# virsh define usb-tablet.xml 
error: Failed to define domain from usb-tablet.xml
error: unsupported configuration: Can't add USB input device. USB bus is disabled

4. only 1 usb controller with model=none
# cat test.xml
<domain type='kvm'>
  <name>test</name>
  <uuid>73126058-c5a2-846c-428c-5b3ab8f4c2ec</uuid>
  <memory unit='KiB'>8388608</memory>
  <currentMemory unit='KiB'>8388608</currentMemory>
  <vcpu placement='static'>1</vcpu>
  <os>
    <type arch='x86_64' machine='rhel6.3.0'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='none'/>
      <source file='/var/lib/libvirt/images/test1.img'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </disk>
    <controller type='usb' index='0' model='none'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </controller>
    <memballoon model='none'/>
  </devices>
</domain>

# virsh define test.xml
# virsh start test
Domain test started
# ps aux |grep qemu-kvm
/usr/libexec/qemu-kvm -name test -S -M rhel6.3.0 -enable-kvm -m 8192 -smp 1,sockets=1,cores=1,threads=1 -uuid 73126058-c5a2-846c-428c-5b3ab8f4c2ec -nographic -nodefconfig -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/test1.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown -drive file=/var/lib/libvirt/images/test1.img,if=none,id=drive-virtio-disk0,format=raw,cache=none -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1

without usb controller and vga
Comment 16 errata-xmlrpc 2013-02-21 02:12:42 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2013-0276.html

Note You need to log in before you can comment on or make changes to this bug.