This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 1002384 - fail to hot-unplug virtio block disk in use inside win8-64 guest
fail to hot-unplug virtio block disk in use inside win8-64 guest
Status: ASSIGNED
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm-rhev (Show other bugs)
7.0
x86_64 Linux
medium Severity medium
: rc
: ---
Assigned To: Vadim Rozenfeld
aihua liang
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-29 01:16 EDT by Jun Li
Modified: 2017-08-02 02:53 EDT (History)
17 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-08-07 09:49:35 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jun Li 2013-08-29 01:16:31 EDT
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.
Comment 2 Sibiao Luo 2013-08-29 02:04:03 EDT
(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.
Comment 3 Jun Li 2013-08-29 02:46:59 EDT
(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
Comment 5 Paolo Bonzini 2014-08-07 09:49:35 EDT
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.
Comment 6 Mike Cao 2014-08-07 10:46:45 EDT
(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
Comment 7 Paolo Bonzini 2014-08-07 11:06:47 EDT
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.
Comment 14 juzhang 2017-06-08 07:10:31 EDT
Hi Cong,

Free to update the QE contact.

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