Hide Forgot
Description of problem: fail to unhotplug virtio block disk while the device is using inside win8-64 guest. Or qemu monitor or QMP give friendly messages while failed(e.g device is busying). Current, qemu monitor and QMP don't any output message when hot-unplug fail. Version-Release number of selected component (if applicable): qemu-kvm-1.5.2-4.el7.x86_64 kernel 3.10.0-11.el7.x86_64 How reproducible: 100% Steps to Reproduce: 1.Boot win8-64 guest with a virtio-blk data device. # /usr/libexec/qemu-kvm -S -M pc-i440fx-rhel7.0.0 \ -cpu SandyBridge -enable-kvm \ -m 4G -smp 4,sockets=2,cores=2,threads=1 \ -name juli -uuid 355a2475-4e03-4cdd-bf7b-5d6a59edaa61 \ -rtc base=localtime,clock=host,driftfix=slew \ -drive file=/mnt/win8-64.raw,if=none,cache=none,aio=native,format=raw,id=drive0 \ -device virtio-blk-pci,bus=pci.0,addr=0x8,drive=drive0,scsi=off,config-wce=off,bootindex=0 \ -drive file=/mnt/sdb-1.raw,if=none,id=drive-virtio0-0-1,media=disk,cache=none,format=raw \ -device virtio-blk-pci,bus=pci.0,addr=0x4,drive=drive-virtio0-0-1,id=test30-d,scsi=off,config-wce=off \ -device virtio-balloon-pci,id=ballooning,addr=0x6 -global PIIX4_PM.disable_s3=0 -global PIIX4_PM.disable_s4=0 \ -netdev tap,id=hostnet0,vhost=off,queues=4,script=/etc/qemu-ifup \ -device virtio-net-pci,mq=on,vectors=17,netdev=hostnet0,id=virtio-net-pci0,mac=24:be:05:14:0d:52,addr=0x7,bootindex=2 \ -k en-us -boot menu=on,reboot-timeout=-1,strict=on \ -qmp tcp:0:4445,server,nowait -serial unix:/tmp/ttyS0,server,nowait \ -vnc :3 -spice port=5932,disable-ticketing \ -vga cirrus -monitor stdio \ -monitor tcp:0:7445,server,nowait \ -drive file=/mnt/virtio-win-prewhql-0.1-68/virtio-win-prewhql-0.1.iso,if=none,media=cdrom,format=raw,aio=native,id=drive-ide1-0-2 \ -device ide-drive,drive=drive-ide1-0-2,id=ide1-0-2,bus=ide.1,unit=1 2.Do hot-unplug inside monitor and QMP. (qemu) device_del test30-d {"execute":"device_del","arguments":{"id":"test30-d"}} 3.Check the result. (qemu) info qtree Actual results: (qemu) device_del test30-d {"execute":"device_del","arguments":{"id":"test30-d"}} {"return": {}} (qemu) info qtree ... ... dev: virtio-blk-pci, id "test30-d" class = 0x0 ioeventfd = on vectors = 2 x-data-plane = off indirect_desc = on event_idx = on drive = drive-virtio0-0-1 logical_block_size = 512 physical_block_size = 512 min_io_size = 0 opt_io_size = 0 bootindex = -1 ... ... Expected results: If the device can not hot-unplug successfully, monitor or QMP will give friendly messages. Hot-unplug can success while the device is using. Additional info: Hot-unplug can success while the device is not doing I/O service. I alse Rhel7.0 guest: With Rhel7.0 guest hot-unplug can success while the device is using.
(In reply to Jun Li from comment #0) > I alse Rhel7.0 guest: > With Rhel7.0 guest hot-unplug can success while the device is using. Maybe the virtio-win issue, please also provide the virtio-win version.
(In reply to Sibiao Luo from comment #2) > (In reply to Jun Li from comment #0) > > I alse Rhel7.0 guest: > > With Rhel7.0 guest hot-unplug can success while the device is using. > Maybe the virtio-win issue, please also provide the virtio-win version. The version of virtio-win: virtio-win-prewhql-0.1-68
This is not possible due to the way hot-unplug work. device_del is an asynchronous command that tells the guest "please eject this device when you're ready". The guest is free to never eject the device, which is what is happening here.
(In reply to Paolo Bonzini from comment #5) > This is not possible due to the way hot-unplug work. > > device_del is an asynchronous command that tells the guest "please eject > this device when you're ready". The guest is free to never eject the > device, which is what is happening here. Can we consider it is a virtio-block windows driver bug ? Thanks, Mike
No, the hot-unplug is done at the PCI level and the virtio-win drivers probably never see it. I guess it's Windows policy to not eject the device if there's something mounted on it.
Hi Cong, Free to update the QE contact.
Hi Peixiu, Have you met this issue in the recent testing? Thanks.
(In reply to CongLi from comment #15) > Hi Peixiu, > > Have you met this issue in the recent testing? > Hi coli, we don't start the virtio-win block function test now, If I hit it later, will update on this bug~ Best Regards~ Peixiu
For windows, we should not unplug virtio device during it's in use. Details please refer to https://bugzilla.redhat.com/show_bug.cgi?id=1215953#c2
(In reply to lijin from comment #17) > For windows, we should not unplug virtio device during it's in use. > > Details please refer to > https://bugzilla.redhat.com/show_bug.cgi?id=1215953#c2 Thanks lijin. Close this bug. *** This bug has been marked as a duplicate of bug 1215953 ***