Bug 986793

Summary: fail to hotunplug virtio-serial bus after hotunplug the virtserialport
Product: Red Hat Enterprise Linux 6 Reporter: Sibiao Luo <sluo>
Component: qemu-kvmAssignee: Amit Shah <amit.shah>
Status: CLOSED CURRENTRELEASE QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.5CC: acathrow, amit.shah, bsarathy, chayang, flang, juzhang, mdeng, michen, mkenneth, qzhang, sluo, virt-maint, xfu
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-08-12 08:34:29 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Sibiao Luo 2013-07-22 06:20:46 UTC
Description of problem:
boot guest with virtio-serial, and do hotunplug the virtserialport firstly, then hutunplug the virtio-serial bus that fail.

BTW, if hotunplug the virtio-serial bus directly without hot-remove the virtserialport firstly, it can remove the virtio-serial bus and port successfully. 

Version-Release number of selected component (if applicable):
host info:
kernel-2.6.32-398.el6.x86_64
qemu-kvm-0.12.1.2-2.378.el6.x86_64
guest info:
kernel-2.6.32-398.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1.boot guest with virtio-serial.
e.g:...-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.1,bus=virtio-serial0.0,id=port1,nr=1 -chardev socket,id=channel2,path=/tmp/helloworld2,server,nowait -device virtserialport,chardev=channel2,name=com.redhat.rhevm.vdsm.2,bus=virtio-serial0.0,id=port2,nr=2
2.do hotunplug the virtserialport firstly.
(qemu) device_del port1
(qemu) device_del port2
3.then hutunplug the virtio-serial bus.
(qemu) device_del virtio-serial0

Actual results:
after step3, it can complete excuting 'device_del virtio-serial0' command, but the virtio-serial bus still existing in info qtree, and if hotadd it again that prompt duplicate ID 'virtio-serial0' for device.
(qemu) info qtree
bus: main-system-bus
  type System
  dev: i440FX-pcihost, id ""
...
      dev: virtio-serial-pci, id "virtio-serial0"
        dev-prop: vectors = 0
        dev-prop: class = 0x780
        dev-prop: indirect_desc = on
        dev-prop: event_idx = on
        dev-prop: max_ports = 16
        dev-prop: flow_control = 1
        bus-prop: addr = 03.0
        bus-prop: romfile = <null>
        bus-prop: rombar = 1
        bus-prop: multifunction = off
        class Class 0780, addr 00:03.0, pci id 1af4:1003 (sub 1af4:0003)
        bar 0: i/o at 0xffffffffffffffff [0x1e]
        bus: virtio-serial0.0
          type virtio-serial-bus
...
(qemu) device_add virtio-serial-pci,id=virtio-serial0,max_ports=16,vectors=0,bus=pci.0,addr=0x3
Duplicate ID 'virtio-serial0' for device
(qemu) device_del virtio-serial0
(qemu) device_add virtio-serial-pci,id=virtio-serial0,max_ports=16,vectors=0,bus=pci.0,addr=0x3
Duplicate ID 'virtio-serial0' for device

Expected results:
It can do hotunplug the virtserialport firstly and then hutunplug the virtio-serial bus successfully.

Additional info:

Comment 2 Amit Shah 2013-08-08 07:00:24 UTC
Can this be reproduced in a recent build?

Comment 4 Qunfang Zhang 2013-08-09 03:12:34 UTC
flang will help do this as sluo is on vacation.

Comment 5 langfang 2013-08-09 04:59:36 UTC
Test this bug as follow version,but both can not reproduce.Hotunplug/hotplug work well.

Version(bug reporter use):

Host
# uname -r
2.6.32-398.el6.x86_64
# rpm -q qemu-kvm
qemu-kvm-0.12.1.2-2.378.el6.x86_64

Guest:
2.6.32-398.el6.x86_64


Senario 2)

Version:

Host:

Version:
# uname -r 
2.6.32-405.el6.x86_64
# rpm -q qemu-kvm
qemu-kvm-0.12.1.2-2.382.el6.x86_64

Guest:
2.6.32-403.el6.x86_64


The steps as same as reproduce(comment0)


MY CLI:
 /usr/libexec/qemu-kvm -m 4G -smp 4 -device virtio-scsi-pci,bus=pci.0,addr=0x5,id=scsi0 -drive file=/dev/vg-flang/lv-flang,if=none,id=drive-scsi0-0-0,media=disk,cache=none,format=raw,werror=stop,rerror=stop,aio=native -device scsi-hd,drive=drive-scsi0-0-0,bus=scsi0.0,scsi-id=0,lun=0,id=flang,bootindex=1 -monitor stdio -vnc :10 -vga qxl -netdev tap,id=hostnet0,vhost=on,script=/etc/qemu-ifup -device virtio-net-pci,netdev=hostnet0,mac=00:10:20:2d:31:22,bus=pci.0,addr=0x4,id=net0 -qmp tcp:0:5555,server,nowait -global PIIX4_PM.disable_s3=0 -global PIIX4_PM.disable_s4=0 -boot menu=on -monitor stdio -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.1,bus=virtio-serial0.0,id=port1,nr=1 -chardev socket,id=channel2,path=/tmp/helloworld2,server,nowait -device virtserialport,chardev=channel2,name=com.redhat.rhevm.vdsm.2,bus=virtio-serial0.0,id=port2,nr=2

Comment 6 Amit Shah 2013-08-12 08:34:29 UTC
Thanks for confirming.