Bug 1810858 - [q35] No "DEVICE_DELETED" event in qmp after "device_del" virtio-blk-pci
Summary: [q35] No "DEVICE_DELETED" event in qmp after "device_del" virtio-blk-pci
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux Advanced Virtualization
Classification: Red Hat
Component: qemu-kvm
Version: 8.2
Hardware: Unspecified
OS: Windows
medium
high
Target Milestone: rc
: ---
Assignee: Julia Suvorova
QA Contact: qing.wang
URL:
Whiteboard:
Depends On:
Blocks: 1744438
TreeView+ depends on / blocked
 
Reported: 2020-03-06 03:43 UTC by qing.wang
Modified: 2020-12-20 05:33 UTC (History)
17 users (show)

Fixed In Version: qemu-kvm-4.2.0-21.module+el8.2.1+6586+8b7713b9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1678311
Environment:
Last Closed: 2020-05-14 02:06:33 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)

Comment 5 Julia Suvorova 2020-04-29 22:31:14 UTC
QE, can you check if this is still reproducible with qemu-kvm-4.2.0-19.module+el8.3.0+6371+f67a7ce3, please?

Comment 6 qing.wang 2020-05-06 11:20:53 UTC
I did not found above issue in qemu-kvm-4.2.0-19.module+el8.3.0+6371+f67a7ce3

Test steps:

1.Create image:
qemu-img create -f raw /home/kvm_autotest_root/images/data0.raw 1G

2.Boot vm
/usr/libexec/qemu-kvm \
  -name 'avocado-vt-vm1' \
  -machine q35 \
  -nodefaults \
  -device VGA,bus=pcie.0,addr=0x1 \
  -m 13072 \
  -smp 12,maxcpus=12,cores=6,threads=1,dies=1,sockets=2 \
  -device pcie-root-port,id=pcie.0-root-port-2,slot=2,chassis=2,addr=0x2,bus=pcie.0 \
  -device qemu-xhci,id=usb1,bus=pcie.0-root-port-2,addr=0x0 \
  -object iothread,id=iothread0 \
  -object iothread,id=iothread1 \
  -object iothread,id=iothread2 \
  -blockdev node-name=file_image1,driver=file,aio=native,filename=/home/kvm_autotest_root/images/win2019-64-virtio.qcow2,cache.direct=on,cache.no-flush=off \
  -blockdev node-name=drive_image1,driver=qcow2,cache.direct=on,cache.no-flush=off,file=file_image1 \
  -device pcie-root-port,id=pcie.0-root-port-3,slot=3,chassis=3,addr=0x3,bus=pcie.0 \
  -device virtio-blk-pci,id=image1,drive=drive_image1,bootindex=0,write-cache=on,iothread=iothread0,bus=pcie.0-root-port-3,addr=0x0 \
  -device pcie-root-port,id=pcie.0-root-port-4,slot=4,chassis=4,addr=0x4,bus=pcie.0 \
  -device virtio-net-pci,mac=9a:a6:91:a0:8f:22,id=idw2eatJ,netdev=idpFq5nx,bus=pcie.0-root-port-4,addr=0x0 \
  -netdev tap,id=idpFq5nx,vhost=on \
  -blockdev node-name=file_cd1,driver=file,read-only=on,aio=native,filename=/home/kvm_autotest_root/iso/windows/winutils.iso,cache.direct=on,cache.no-flush=off \
  -blockdev node-name=drive_cd1,driver=raw,read-only=on,cache.direct=on,cache.no-flush=off,file=file_cd1 \
  -device ide-cd,id=cd1,drive=drive_cd1,bootindex=1,write-cache=on,bus=ide.0,unit=0 \
  -device usb-tablet,id=usb-tablet1,bus=usb1.0,port=1 \
  -vnc :6 \
  -rtc base=localtime,clock=host,driftfix=slew \
  -boot order=cdn,once=c,menu=off,strict=off \
  -enable-kvm \
  -device pcie-root-port,id=pcie_extra_root_port_0,slot=5,chassis=5,addr=0x5,bus=pcie.0 \
  -device pcie-root-port,id=pcie_extra_root_port_1,slot=6,chassis=6,addr=0x6,bus=pcie.0 \
  -monitor stdio \
  -chardev file,id=qmp_id_qmpmonitor1,path=/var/tmp/monitor-qmpdbg.log,server,nowait \
  -mon chardev=qmp_id_qmpmonitor1,mode=control \
  -qmp tcp:0:5956,server,nowait \
  -chardev file,path=/var/tmp/monitor-serialdbg.log,id=serial_id_serial0 \
  -device isa-serial,chardev=serial_id_serial0

3. Add disk
{"execute": "qmp_capabilities"}

  {"execute": "blockdev-add", "arguments": {"node-name": "file_stg0", "driver": "file", "aio": "threads", "filename": "/home/kvm_autotest_root/images/data0.raw", "cache": {"direct": true, "no-flush": false}}}
  {"execute": "blockdev-add", "arguments": {"node-name": "drive_stg0", "driver": "raw", "cache": {"direct": true, "no-flush": false}, "file": "file_stg0"}}

  {"execute": "device_add", "arguments": {"driver": "virtio-blk-pci", "id": "stg0", "drive": "drive_stg0", "write-cache": "on", "iothread": "iothread1", "bus": "pcie_extra_root_port_0", "addr": "0x0"}}


4. Check in guest ,found the added disk

5.{"execute": "device_del", "arguments": {"id": "stg0"}, "id": "XVosfhHr"}

actual result:
{"timestamp": {"seconds": 1588759356, "microseconds": 118518}, "event": "DEVICE_DELETED", "data": {"path": "/machine/peripheral/stg0/virtio-backend"}}
{"timestamp": {"seconds": 1588759356, "microseconds": 173412}, "event": "DEVICE_DELETED", "data": {"device": "stg0", "path": "/machine/peripheral/stg0"}}


6. re-hotplug
{"execute": "device_add", "arguments": {"driver": "virtio-blk-pci", "id": "stg0", "drive": "drive_stg0", "write-cache": "on", "iothread": "iothread1", "bus": "pcie_extra_root_port_0", "addr": "0x0"}}

step5 meet expected result.

Comment 7 Julia Suvorova 2020-05-13 22:26:27 UTC
(In reply to qing.wang from comment #6)
> I did not found above issue in qemu-kvm-4.2.0-19.module+el8.3.0+6371+f67a7ce3
> 
> Test steps:
> 
> 1.Create image:
> qemu-img create -f raw /home/kvm_autotest_root/images/data0.raw 1G
> 
> 2.Boot vm
> /usr/libexec/qemu-kvm \
>   -name 'avocado-vt-vm1' \
>   -machine q35 \
>   -nodefaults \
>   -device VGA,bus=pcie.0,addr=0x1 \
>   -m 13072 \
>   -smp 12,maxcpus=12,cores=6,threads=1,dies=1,sockets=2 \
>   -device
> pcie-root-port,id=pcie.0-root-port-2,slot=2,chassis=2,addr=0x2,bus=pcie.0 \
>   -device qemu-xhci,id=usb1,bus=pcie.0-root-port-2,addr=0x0 \
>   -object iothread,id=iothread0 \
>   -object iothread,id=iothread1 \
>   -object iothread,id=iothread2 \
>   -blockdev
> node-name=file_image1,driver=file,aio=native,filename=/home/
> kvm_autotest_root/images/win2019-64-virtio.qcow2,cache.direct=on,cache.no-
> flush=off \
>   -blockdev
> node-name=drive_image1,driver=qcow2,cache.direct=on,cache.no-flush=off,
> file=file_image1 \
>   -device
> pcie-root-port,id=pcie.0-root-port-3,slot=3,chassis=3,addr=0x3,bus=pcie.0 \
>   -device
> virtio-blk-pci,id=image1,drive=drive_image1,bootindex=0,write-cache=on,
> iothread=iothread0,bus=pcie.0-root-port-3,addr=0x0 \
>   -device
> pcie-root-port,id=pcie.0-root-port-4,slot=4,chassis=4,addr=0x4,bus=pcie.0 \
>   -device
> virtio-net-pci,mac=9a:a6:91:a0:8f:22,id=idw2eatJ,netdev=idpFq5nx,bus=pcie.0-
> root-port-4,addr=0x0 \
>   -netdev tap,id=idpFq5nx,vhost=on \
>   -blockdev
> node-name=file_cd1,driver=file,read-only=on,aio=native,filename=/home/
> kvm_autotest_root/iso/windows/winutils.iso,cache.direct=on,cache.no-
> flush=off \
>   -blockdev
> node-name=drive_cd1,driver=raw,read-only=on,cache.direct=on,cache.no-
> flush=off,file=file_cd1 \
>   -device
> ide-cd,id=cd1,drive=drive_cd1,bootindex=1,write-cache=on,bus=ide.0,unit=0 \
>   -device usb-tablet,id=usb-tablet1,bus=usb1.0,port=1 \
>   -vnc :6 \
>   -rtc base=localtime,clock=host,driftfix=slew \
>   -boot order=cdn,once=c,menu=off,strict=off \
>   -enable-kvm \
>   -device
> pcie-root-port,id=pcie_extra_root_port_0,slot=5,chassis=5,addr=0x5,bus=pcie.
> 0 \
>   -device
> pcie-root-port,id=pcie_extra_root_port_1,slot=6,chassis=6,addr=0x6,bus=pcie.
> 0 \
>   -monitor stdio \
>   -chardev
> file,id=qmp_id_qmpmonitor1,path=/var/tmp/monitor-qmpdbg.log,server,nowait \
>   -mon chardev=qmp_id_qmpmonitor1,mode=control \
>   -qmp tcp:0:5956,server,nowait \
>   -chardev file,path=/var/tmp/monitor-serialdbg.log,id=serial_id_serial0 \
>   -device isa-serial,chardev=serial_id_serial0
> 
> 3. Add disk
> {"execute": "qmp_capabilities"}
> 
>   {"execute": "blockdev-add", "arguments": {"node-name": "file_stg0",
> "driver": "file", "aio": "threads", "filename":
> "/home/kvm_autotest_root/images/data0.raw", "cache": {"direct": true,
> "no-flush": false}}}
>   {"execute": "blockdev-add", "arguments": {"node-name": "drive_stg0",
> "driver": "raw", "cache": {"direct": true, "no-flush": false}, "file":
> "file_stg0"}}
> 
>   {"execute": "device_add", "arguments": {"driver": "virtio-blk-pci", "id":
> "stg0", "drive": "drive_stg0", "write-cache": "on", "iothread": "iothread1",
> "bus": "pcie_extra_root_port_0", "addr": "0x0"}}
> 
> 
> 4. Check in guest ,found the added disk
> 
> 5.{"execute": "device_del", "arguments": {"id": "stg0"}, "id": "XVosfhHr"}
> 
> actual result:
> {"timestamp": {"seconds": 1588759356, "microseconds": 118518}, "event":
> "DEVICE_DELETED", "data": {"path":
> "/machine/peripheral/stg0/virtio-backend"}}
> {"timestamp": {"seconds": 1588759356, "microseconds": 173412}, "event":
> "DEVICE_DELETED", "data": {"device": "stg0", "path":
> "/machine/peripheral/stg0"}}
> 
> 
> 6. re-hotplug
> {"execute": "device_add", "arguments": {"driver": "virtio-blk-pci", "id":
> "stg0", "drive": "drive_stg0", "write-cache": "on", "iothread": "iothread1",
> "bus": "pcie_extra_root_port_0", "addr": "0x0"}}
> 
> step5 meet expected result.

Great, if it works with qemu-kvm-4.2.0-21.module+el8.2.1+6586+8b7713b9 too, we'll be able to close it this release. Can you check it too, please?

Comment 8 qing.wang 2020-05-14 03:19:27 UTC
Tested on qemu-kvm-4.2.0-21.module+el8.2.1+6586+8b7713b9 with comment 6 steps, no issue found.


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