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 949211 - 'An undefined error has occurred' when hot unplug the unsupport hotplugging usb-ehci in rhel7
Summary: 'An undefined error has occurred' when hot unplug the unsupport hotplugging u...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm
Version: 7.0
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: rc
: ---
Assignee: Amnon Ilan
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-04-07 03:40 UTC by Sibiao Luo
Modified: 2015-06-28 11:50 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-06-28 11:50:34 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Sibiao Luo 2013-04-07 03:40:38 UTC
Description of problem:
bug 879096 that disable the device 'usb-ehci' which does not support hotplugging in rhel6. I check it in rhel7 that qemu has disble the unsupport hotplugging usb-ehci, and there is a 'An undefined error has occurred' qemu prompt in HMP monitor, but it did not appear in QMP monitor.

Version-Release number of selected component (if applicable):
hostinfo:
kernel-3.9.0-0.rc4.45.el7.x86_64
qemu-kvm-1.4.0-1.el7.x86_64
seabios-1.7.2-0.2.gita810e4e7.el7.x86_64
guest info:
win2012 64bit

How reproducible:
100%

Steps to Reproduce:
1.boot guest with 'usb-ehci' controller under pc-i440fx-1.4.
# /usr/libexec/qemu-kvm -S -M pc-i440fx-1.4 -cpu SandyBridge -enable-kvm -m 4096 -smp 2,sockets=2,cores=1,threads=1 -no-kvm-pit-reinjection -name sluo-test -uuid ed09fa10-6ffe-4811-a42f-0294afcb5a42 -rtc base=localtime,clock=host,driftfix=slew -device virtio-serial-pci,id=virtio-serial0,max_ports=16,vectors=0,bus=pci.0,addr=0x3 -chardev socket,id=channel1,path=/tmp/helloworld1,server,nowait -device virtserialport,chardev=channel1,name=com.redhat.rhevm.vdsm,bus=virtio-serial0.0,id=port1 -chardev socket,id=channel2,path=/tmp/helloworld2,server,nowait -device virtserialport,chardev=channel2,name=com.redhat.rhevm.vdsm,bus=virtio-serial0.0,id=port2 -drive file=/home/windows_server_2012_x64.qcow2,if=none,id=drive-system-disk,format=qcow2,cache=none,aio=native,werror=stop,rerror=stop,serial=QEMU-DISK1 -device virtio-scsi-pci,bus=pci.0,addr=0x4,id=scsi0 -device scsi-hd,bus=scsi0.0,drive=drive-system-disk,id=system-disk,bootindex=1 -netdev tap,id=hostnet0,vhost=off,script=/etc/qemu-ifup -device virtio-net-pci,netdev=hostnet0,id=virtio-net-pci0,mac=08:2e:5f:0a:0d:b1,bus=pci.0,addr=0x5,bootindex=2 -device virtio-balloon-pci,id=ballooning,bus=pci.0,addr=0x6 -drive file=/home/my-data-disk.raw,if=none,id=drive-data-disk,format=raw,cache=none,aio=native,werror=stop,rerror=stop,serial=QEMU-DISK2 -device virtio-scsi-pci,bus=pci.0,addr=0x7,id=scsi1 -device scsi-hd,bus=scsi1.0,drive=drive-data-disk,id=data-disk -device usb-ehci,id=ehci,bus=pci.0,addr=0x8 -global PIIX4_PM.disable_s3=0 -global PIIX4_PM.disable_s4=0 -serial unix:/tmp/ttyS0,server,nowait -qmp tcp:0:4444,server,nowait -k en-us -boot menu=on -vnc :1 -spice disable-ticketing,port=5931 -monitor stdio
2.do hot-unplug/plug 'usb-ehci' controller in HMP monitor.
(qemu) device_del ehci

(qemu) device_add usb-ehci,id=ehci1,bus=pci.0,addr=0x9
  
Actual results:
after step 2, the qemu prompt as following:
(qemu) device_del ehci
Device 'usb-ehci' does not support hotplugging
An undefined error has occurred               <-----------here
(qemu) 
(qemu) device_add usb-ehci,id=ehci1,bus=pci.0,addr=0x9
Device 'usb-ehci' does not support hotplugging
Device 'usb-ehci' could not be initialized

Expected results:
there should no 'An undefined error has occurred' when do hot-unplug usb-ehci. 

Additional info:
I tried it var QMP monitor that did have such issue, it prompt correctly.
{"execute":"device_del","arguments":{"id":"ehci"}}
{"error": {"class": "GenericError", "desc": "Device 'usb-ehci' does not support hotplugging"}}
{"execute":"device_add","arguments":{"driver":"usb-ehci","id":"ehci1","bus":"pci.0","addr":"0x9"}}
{"error": {"class": "GenericError", "desc": "Device 'usb-ehci' does not support hotplugging"}}

Comment 1 Michael S. Tsirkin 2013-11-06 13:13:12 UTC
ok so this is a minor bug.
it's expected that unplug fails.
the fact that is prints 'undefined error has occured' is wrong.

only hmp has this issue so cosmetic, low priority

Comment 5 Amos Kong 2014-12-15 08:52:17 UTC
There is some refactor, the problem doesn't exist in qemu-upstrean and qemu-kvm-rhev.

This problem only exists in qemu-kvm, we need a internal fix.


hw/core/qdev.c:
void qdev_unplug(DeviceState *dev, Error **errp)
{
    ......
    if (dc->unplug(dev) < 0) {
        error_set(errp, QERR_UNDEFINED_ERROR);
        return;
    }
}

hw/pci/pci.c:
static int pci_unplug_device(DeviceState *qdev)
{
    ......                                  
    if (pc->no_hotplug) {
        qerror_report(QERR_DEVICE_NO_HOTPLUG,
                      object_get_typename(OBJECT(dev)));
-        return -1;
+        return 0;
    }
    ......
}

Comment 12 jason wang 2015-06-02 06:13:50 UTC
According to Amos:

The patch lies to qdev_unplug()'s caller to suppress one error,
the fix causes some incoordination between downstream and upstream.

The problem only effects HMP, which isn't supported. So it's better to close
it as WONTFIX as suggested by Markus.

The trivial problem can be fixed by future rebasing.

Looks like we can just close this as WONTFIX.


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