Bug 1420211

Summary: [Q35] unplug failed when device attached to the root port that belong to pxb-pcie
Product: Red Hat Enterprise Linux 7 Reporter: jinchen
Component: qemu-kvm-rhevAssignee: Marcel Apfelbaum <marcel>
Status: CLOSED NOTABUG QA Contact: Virtualization Bugs <virt-bugs>
Severity: high Docs Contact:
Priority: unspecified    
Version: 7.4CC: chayang, jinzhao, juzhang, knoel, virt-maint
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-05-08 11:41:50 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 jinchen 2017-02-08 07:38:19 UTC
Description of problem:
  unplug failed when device attached to the root port that belong to pxb-pcie

Version-Release number of selected component (if applicable):
  kernel-3.10.0-559.el7.x86_64
  qemu-kvm-rhev-2.8.0-3.el7.x86_64

How reproducible:
3/3

Steps to Reproduce:

1. Boot guest with qemu command 
/usr/libexec/qemu-kvm \
-M q35 \
-cpu Penryn \
-nodefaults -rtc base=utc \
-m 4G \
-smp 4,sockets=1,cores=4,threads=1 \
-enable-kvm \
-name rhel7.4 \
-uuid 990ea161-6b67-47b2-b803-19fb01d30d12 \
-smbios type=1,manufacturer='Red Hat',product='RHEV Hypervisor',version=el6,serial=koTUXQrb,uuid=feebc8fd-f8b0-4e75-abc3-e63fcdb67170 \
-k en-us \
-serial unix:/tmp/console,server,nowait \
-boot menu=on \
-bios /usr/share/seabios/bios.bin \
-chardev file,path=/home/seabios.log,id=seabios \
-device isa-debugcon,chardev=seabios,iobase=0x402 \
-qmp tcp::8892,server,nowait \
-vga qxl \
-vnc :2 \
-object memory-backend-ram,size=1024M,id=ram-node0 \
-numa node,nodeid=0,cpus=0,memdev=ram-node0 \
-object memory-backend-ram,size=1024M,id=ram-node1 \
-numa node,nodeid=1,cpus=1,memdev=ram-node1 \
-object memory-backend-ram,size=1024M,id=ram-node2 \
-numa node,nodeid=2,cpus=2,memdev=ram-node2 \
-object memory-backend-ram,size=1024M,id=ram-node3 \
-numa node,nodeid=3,cpus=3,memdev=ram-node3 \
-device pxb-pcie,id=bridge1,bus=pcie.0,numa_node=0,bus_nr=1 \
-device ioh3420,bus=bridge1,id=root.0,slot=1 \
-device virtio-net-pci,bus=root.0,netdev=dev1,mac=9a:6a:6b:6c:6d:6e,id=net1 \
-netdev tap,id=dev1 \
-device pxb-pcie,id=bridge2,bus=pcie.0,numa_node=1,bus_nr=10 \
-device ioh3420,bus=bridge2,id=root.1,slot=2 \
-drive file=/home/demo/rhel74.img,if=none,id=drive-virtio-disk0,format=qcow2,cache=none,werror=stop,rerror=stop \
-device virtio-scsi-pci,id=scsi,bus=root.1 \
-device scsi-disk,bus=scsi.0,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=0 \
-device pxb-pcie,id=bridge3,bus=pcie.0,numa_node=2,bus_nr=20 \
-device ioh3420,bus=bridge3,id=root.2,slot=3 \
-drive file=/home/demo/test.qcow2,if=none,id=drive1,format=qcow2,cache=none,werror=stop,rerror=stop \
-device virtio-blk-pci,id=virtio-disk1,drive=drive1,bus=root.2 \
-device pxb-pcie,id=bridge4,bus=pcie.0,numa_node=3,bus_nr=30 \
-device ioh3420,bus=bridge4,id=root.3,slot=4 \
-device virtio-balloon-pci,id=balloon,bus=root.3 \
-monitor stdio \

2. Hot-unplug virtio devices through qmp
{"execute":"qmp_capabilities"}
{"return": {}}
{"execute":"device_del","arguments":{"id":"virtio-disk1"}}
{"return": {}}

3. Check the info in hmp
(qemu) info block
drive-virtio-disk0 (#block144): /home/demo/rhel74.img (qcow2)
    Cache mode:       writeback, direct

drive1 (#block330): /home/demo/test.qcow2 (qcow2)
    Cache mode:       writeback, direct
(qemu) device_del 
balloon       net1          scsi          virtio-disk0  virtio-disk1

4. Check the virtio devices in guest
[root@localhost ~]# lspci -vvvt
-+-[0000:1e]---00.0-[1f]----00.0  Red Hat, Inc Virtio memory balloon
 +-[0000:14]---00.0-[15]----00.0  Red Hat, Inc Virtio block device
 +-[0000:0a]---00.0-[0b]----00.0  Red Hat, Inc Virtio SCSI
 +-[0000:01]---00.0-[02]----00.0  Red Hat, Inc Virtio network device
 \-[0000:00]-+-00.0  Intel Corporation 82G33/G31/P35/P31 Express DRAM Controller
             +-01.0  Red Hat, Inc. QXL paravirtual graphic card
             +-02.0  Red Hat, Inc. Device 000b
             +-03.0  Red Hat, Inc. Device 000b
             +-04.0  Red Hat, Inc. Device 000b
             +-05.0  Red Hat, Inc. Device 000b
             +-1f.0  Intel Corporation 82801IB (ICH9) LPC Interface Controller
             +-1f.2  Intel Corporation 82801IR/IO/IH (ICH9R/DO/DH) 6 port SATA Controller [AHCI mode]
             \-1f.3  Intel Corporation 82801I (ICH9 Family) SMBus Controller

Actual results:
delete the virtio devices failed

Expected results:
delete the virtio devices successfully

Additional info:
unplug failed when device attached to the switch(switch attached to pxb-pcie)
unplug also failed when qemu-kvm-rhev-2.6.0-28.el7_3.3.x86_64

Comment 2 Marcel Apfelbaum 2017-05-08 11:41:50 UTC
The problem seems to be 'qemu-kvm-rhev-2.8.0-3.el7.x86_64' is used an not the current version: qemu-kvm-rhev-2.9.0-. It cannot be reproduced with the later version.

This is OK since the feature was introduced in QEMU 2.9
Please re-open the BZ if needed.


Thanks,
Marcel