RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1188914 - improve the error when add a input device to lxc domain and forbid add a unsupported input device to lxc domain
Summary: improve the error when add a input device to lxc domain and forbid add a unsu...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.1
Hardware: x86_64
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Libvirt Maintainers
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-02-04 02:32 UTC by Luyao Huang
Modified: 2015-11-19 06:09 UTC (History)
5 users (show)

Fixed In Version: libvirt-1.2.13-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-19 06:09:38 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:2202 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2015-11-19 08:17:58 UTC

Description Luyao Huang 2015-02-04 02:32:17 UTC
Description of problem:
improve the error when add a input device to lxc domain and forbid add a unsupported input device to lxc domain

Version-Release number of selected component (if applicable):
libvirt-1.2.8-15.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.try to add a inpurt deivce like this to lxc domain:
<input type='tablet' bus='usb'/>

# virsh -c lxc:/// edit helloworld
error: internal error: xen bus does not support tablet input device
Failed. Try again? [y,n,f,?]:

2.try to add a inpurt deivce like this to lxc domain:
<input type='mouse' bus='usb'/>

# virsh -c lxc:/// edit helloworld
Domain helloworld XML configuration edited.

3.check the xml:
# virsh -c lxc:/// dumpxml helloworld
<domain type='lxc'>
  <name>helloworld</name>
  <uuid>ed1955f7-4e72-40ae-8265-c193e7436c8a</uuid>
  <memory unit='KiB'>102400</memory>
  <currentMemory unit='KiB'>102300</currentMemory>
  <vcpu placement='static' cpuset='1-3'>2</vcpu>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64'>exe</type>
    <init>/bin/sh</init>
  </os>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <devices>
    <emulator>/usr/libexec/libvirt_lxc</emulator>
    <filesystem type='mount' accessmode='passthrough'>
      <source dir='/'/>
      <target dir='/'/>
    </filesystem>
    <console type='pty'>
      <target type='lxc' port='0'/>
    </console>
    <input type='mouse' bus='usb'/>
  </devices>
  <seclabel type='dynamic' model='selinux' relabel='yes'/>
</domain>


Actual results:
libvirt report 
 xen bus does not support tablet input device
in step 1, but it is not a xen bus.

lxc do not support input device mouse but can add it to xml.

Expected results:
improve the error when add a input device to lxc domain and forbid add a unsupported input device to lxc domain

Additional info:

Comment 1 Peter Krempa 2015-02-04 07:32:26 UTC
Fixed upstream:

commit 76b284c968ffd630f97b35464d7836699b5482be
Author: Luyao Huang <lhuang>
Date:   Wed Feb 4 10:33:29 2015 +0800

    conf: Properly report error of unsupported input bus type
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1188914
    
    Add a missing jump to the error label in case the input device bus is
    invalid.

v1.2.12-72-g76b284c

Comment 3 Yang Yang 2015-05-14 03:03:20 UTC
Verified on libvirt-1.2.15-1.el7.x86_64

Steps
1. define a lxc
# virsh -c lxc:/// define lxc.xml 
Domain helloworld defined from lxc.xml
# cat /yy/lxc.xml 
<domain type='lxc'>
  <name>helloworld</name>
  <uuid>ed1955f7-4e72-40ae-8265-c193e7436c8a</uuid>
  <memory unit='KiB'>102400</memory>
  <currentMemory unit='KiB'>102300</currentMemory>
  <vcpu placement='static' cpuset='1-3'>2</vcpu>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64'>exe</type>
    <init>/bin/sh</init>
  </os>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <devices>
    <emulator>/usr/libexec/libvirt_lxc</emulator>
    <filesystem type='mount' accessmode='passthrough'>
      <source dir='/'/>
      <target dir='/'/>
    </filesystem>
    <console type='pty'>
      <target type='lxc' port='0'/>
    </console>
  </devices>
  <seclabel type='dynamic' model='selinux' relabel='yes'/>
</domain>

2. edit lxc with input element
add <input type='mouse' bus='usb'/>
<input type='keyboard' bus='xen'/>
<input type='tablet' bus='ps2'/>
# virsh -c lxc:/// edit helloworld
error: XML document failed to validate against schema: Unable to validate doc against /usr/share/libvirt/schemas/domain.rng
Element domain has extra content: input

Comment 5 errata-xmlrpc 2015-11-19 06:09:38 UTC
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.

https://rhn.redhat.com/errata/RHBA-2015-2202.html


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