Bug 1460008 - useless errmsg when USB kbd capability is missing from QEMU, but the domain XML wants a USB kbd
useless errmsg when USB kbd capability is missing from QEMU, but the domain X...
Status: VERIFIED
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt (Show other bugs)
7.4-Alt
aarch64 Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Ján Tomko
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-06-08 15:57 EDT by Laszlo Ersek
Modified: 2017-08-23 03:40 EDT (History)
6 users (show)

See Also:
Fixed In Version: libvirt-3.2.0-16.el7a
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
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)
aarch64-vgpu-6.xml -- reproducer domain XML for comment 0 (4.20 KB, text/plain)
2017-06-08 15:59 EDT, Laszlo Ersek
no flags Details

  None (edit)
Description Laszlo Ersek 2017-06-08 15:57:35 EDT
*** Description of problem:

- qemu-kvm-rhev-2.9.0-8.el7.aarch64 does not have "CONFIG_USB=y" in
  "default-configs/aarch64-softmmu.mak",

- therefore the source file "hw/usb/dev-hid.c" is not built into the aarch64
  emulator,

- as a consequence, the emulator lacks the usb-tablet and usb-kbd devices,

- consequently, libvirt (correctly) determines that this emulator binary
  lacks the QEMU_CAPS_DEVICE_USB_KBD capability,

- and therefore I cannot start my domain which uses both a USB tablet and a
  USB keyboard.

This would be fine, but the error message is nondescript:

> error: Failed to start domain aarch64-vgpu-6
> error: An error occurred, but the cause is unknown

No reference is given regarding the lack of QEMU_CAPS_DEVICE_USB_KBD vs. the
device types requested by the domain XML.

*** Version-Release number of selected component (if applicable):

libvirt-daemon-3.2.0-7.el7.aarch64

*** How reproducible:

100%

*** Steps to Reproduce:

1. Define a domain from the attached XML ("aarch64-vgpu-6.xml").

2. Start the domain with "virsh start".

*** Actual results:

Unhelpful error message (the fallback message from virDispatchError() -->
virErrorGenericFailure()).

*** Expected results:

The conflict between lacking emulator capabilities and requested device
types should be spelled out.

*** Additional info:

This is the call stack whence the generic error code is propagated outwards:

#0  virQEMUCapsGet (qemuCaps=qemuCaps@entry=0xffff98015fd0,
    flag=flag@entry=QEMU_CAPS_DEVICE_USB_KBD) at
    qemu/qemu_capabilities.c:2318
#1  0x0000ffffa4961a70 in qemuBuildUSBInputDevStr (qemuCaps=0xffff98015fd0,
    dev=0xffff90017270, def=0xffff900155a0) at qemu/qemu_command.c:4211
#2  qemuBuildInputCommandLine (cmd=cmd@entry=0xffff98005be0,
    def=def@entry=0xffff900155a0, qemuCaps=qemuCaps@entry=0xffff98015fd0) at
    qemu/qemu_command.c:4244
#3  0x0000ffffa49734e4 in qemuBuildCommandLine
    (driver=driver@entry=0xffff9c10e500, logManager=0xffff980020a0,
    def=0xffff900155a0, monitor_chr=0xffff98016250,
    monitor_json=monitor_json@entry=true, qemuCaps=0xffff98015fd0,
    migrateURI=migrateURI@entry=0x0, snapshot=snapshot@entry=0x0,
    vmop=VIR_NETDEV_VPORT_PROFILE_OP_CREATE,
    standalone=standalone@entry=false, enableFips=false, nodeset=0x0,
    nnicindexes=nnicindexes@entry=0xffffa98fe0b0,
    nicindexes=nicindexes@entry=0xffffa98fe0b8, domainLibDir=0xffff98007f20
    "/var/lib/libvirt/qemu/domain-20-aarch64-vgpu-6") at
    qemu/qemu_command.c:10060
#4  0x0000ffffa49acabc in qemuProcessLaunch (conn=conn@entry=0xffff98001550,
    driver=driver@entry=0xffff9c10e500, vm=vm@entry=0xffff9c1ad4d0,
    asyncJob=asyncJob@entry=QEMU_ASYNC_JOB_START,
    incoming=incoming@entry=0x0, snapshot=snapshot@entry=0x0,
    vmop=vmop@entry=VIR_NETDEV_VPORT_PROFILE_OP_CREATE,
    flags=flags@entry=19) at qemu/qemu_process.c:5641
#5  0x0000ffffa49adf6c in qemuProcessStart (conn=conn@entry=0xffff98001550,
    driver=driver@entry=0xffff9c10e500, vm=vm@entry=0xffff9c1ad4d0,
    asyncJob=asyncJob@entry=QEMU_ASYNC_JOB_START,
    migrateFrom=migrateFrom@entry=0x0, migrateFd=migrateFd@entry=-1,
    migratePath=migratePath@entry=0x0, snapshot=snapshot@entry=0x0,
    vmop=vmop@entry=VIR_NETDEV_VPORT_PROFILE_OP_CREATE, flags=19,
    flags@entry=3) at qemu/qemu_process.c:6001
#6  0x0000ffffa4a08714 in qemuDomainObjStart (conn=0xffff98001550,
    driver=driver@entry=0xffff9c10e500, vm=0xffff9c1ad4d0,
    flags=flags@entry=1, asyncJob=QEMU_ASYNC_JOB_START) at
    qemu/qemu_driver.c:6968
#7  0x0000ffffa4a08df0 in qemuDomainCreateWithFlags (dom=0xffff98000b40,
    flags=1) at qemu/qemu_driver.c:7022
#8  0x0000ffffb261bbe0 in virDomainCreateWithFlags
    (domain=domain@entry=0xffff98000b40, flags=1) at libvirt-domain.c:6595
#9  0x0000aaaaab666a04 in remoteDispatchDomainCreateWithFlags
    (server=<optimized out>, msg=0xaaaabcce0670, ret=0xffff98016310,
    args=0xffff980160c0, rerr=0xffffa98fe720, client=<optimized out>) at
    remote_dispatch.h:4307
#10 remoteDispatchDomainCreateWithFlagsHelper (server=<optimized out>,
    client=<optimized out>, msg=0xaaaabcce0670, rerr=0xffffa98fe720,
    args=0xffff980160c0, ret=0xffff98016310) at remote_dispatch.h:4282
#11 0x0000ffffb2686188 in virNetServerProgramDispatchCall
    (msg=0xaaaabcce0670, client=0xaaaabcce0760, server=0xaaaabccc2dc0,
    prog=0xaaaabcccf970) at rpc/virnetserverprogram.c:437
#12 virNetServerProgramDispatch (prog=0xaaaabcccf970,
    server=server@entry=0xaaaabccc2dc0, client=0xaaaabcce0760,
    msg=0xaaaabcce0670) at rpc/virnetserverprogram.c:307
#13 0x0000aaaaab689410 in virNetServerProcessMsg (msg=<optimized out>,
    prog=<optimized out>, client=<optimized out>, srv=0xaaaabccc2dc0) at
    rpc/virnetserver.c:148
#14 virNetServerHandleJob (jobOpaque=<optimized out>, opaque=0xaaaabccc2dc0)
    at rpc/virnetserver.c:169
#15 0x0000ffffb2577274 in virThreadPoolWorker
    (opaque=opaque@entry=0xaaaabccb6ef0) at util/virthreadpool.c:167
#16 0x0000ffffb25765f8 in virThreadHelper (data=<optimized out>) at
    util/virthread.c:206
#17 0x0000ffffb1cf7bb0 in start_thread () from /lib64/libpthread.so.0
#18 0x0000ffffb1c3b650 in thread_start () from /lib64/libc.so.6
Comment 2 Laszlo Ersek 2017-06-08 15:59 EDT
Created attachment 1286218 [details]
aarch64-vgpu-6.xml -- reproducer domain XML for comment 0
Comment 3 Ján Tomko 2017-06-09 02:38:26 EDT
Proposed upstream patch:
https://www.redhat.com/archives/libvir-list/2017-June/msg00456.html
Comment 4 Ján Tomko 2017-06-09 03:26:17 EDT
Pushed upstream with an incorrect bug link in the commit message:
commit 3596b1ddf912418f70c9eaa07d460aacf574bbfd
Author:     Ján Tomko <jtomko@redhat.com>
CommitDate: 2017-06-09 08:29:12 +0200

    qemu: report an error if usb keyboards are unsupported
    
    Be nicer to the user and report a proper error instead of:
    An error occurred, but the cause is unknown
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1460086

git describe: v3.4.0-84-g3596b1d
Comment 5 Laszlo Ersek 2017-06-09 14:05:40 EDT
Bug 1460086 is unrelated; I think that's a mis-paste in the upstream commit. I'll add a note to bug 1460086 about this.

Thanks for the quick fix, Ján!
Comment 9 Andrea Bolognani 2017-08-08 08:54:14 EDT
I have confirmed the issue has indeed been addressed.

Please move this bug to VERIFIED.
Comment 10 Dan Zheng 2017-08-23 03:40:04 EDT
Regarding to comment 9, we verify it now.

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