Bug 751700 - [virtio-win][viostor] "block I/O error" while use drive_del to hot unplug a virtio disk
Summary: [virtio-win][viostor] "block I/O error" while use drive_del to hot unplug a v...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: virtio-win
Version: 7.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: 7.0
Assignee: Vadim Rozenfeld
QA Contact: Virtualization Bugs
URL:
Whiteboard:
: 805461 (view as bug list)
Depends On:
Blocks: 1288337 1401400
TreeView+ depends on / blocked
 
Reported: 2011-11-07 08:30 UTC by Qunfang Zhang
Modified: 2018-12-06 09:50 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-12-06 09:50:32 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Qunfang Zhang 2011-11-07 08:30:47 UTC
Description of problem:
Boot a win2k8-64 guest, hot plug the second data disk and then hot unplug it, got I/O error and the guest is stopped

Version-Release number of selected component (if applicable):
kernel-2.6.32-215.el6.x86_64
qemu-kvm-0.12.1.2-2.209.el6.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Boot a win2k8-64 guest
/usr/libexec/qemu-kvm -m 2G -smp 2 -cpu cpu64-rhel6,+x2apic -drive file=/home/win2k8-64-virtio.qcow2,if=none,id=drive-ide0-0-0,werror=stop,rerror=stop,cache=none,format=qcow2 -device virtio-blk-pci,drive=drive-ide0-0-0,id=ide0-0-0 -netdev tap,id=hostnet0,vhost=on,script=/etc/qemu-ifup -device virtio-net-pci,netdev=hostnet0,mac=00:10:20:2b:20:1a,bus=pci.0,addr=0x4 -boot dc -uuid 7dde6941-2bf6-40d6-9a14-27ab2d5252da -rtc-td-hack -no-kvm-pit-reinjection -monitor stdio -name win2k8-64 -spice port=5930,disable-ticketing -vga qxl -usb -device usb-tablet -k en-us -global qxl-vga.vram_size=33554432 -device virtio-serial-pci,id=virtio-serial0,max_ports=16,bus=pci.0,addr=0x7 -chardev socket,id=channel0,host=127.0.0.1,port=12345,server,nowait -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=channel0,id=channel0,name=com.redhat.rhevm.vdsm -chardev spicevmc,id=charchannel1,name=vdagent -device virtserialport,bus=virtio-serial0.0,nr=2,chardev=charchannel1,id=channel1,name=com.redhat.spice.0

2.Hot plug a virtio data disk.
(qemu) __com.redhat_drive_add file=/home/disk.qcow2,id=virtio-2,format=qcow2,cache=none,werror=stop,rerror=stop
(qemu) device_add virtio-blk-pci,id=virtio-2-2,bus=pci.0,drive=virtio-2

3.Hot unplug the data disk.
(qemu) __com.redhat_drive_del virtio-2
(qemu) block I/O error in device '': Input/output error (5)
handle_dev_input: stop

  
Actual results:
Got the block I/O error as in step 3.

Expected results:
Should no error and disk is removed safely.

Additional info:
If using "device_del virtio-2-2" to remove the data disk, no error happens.

Comment 1 Mike Cao 2011-11-07 08:41:18 UTC
Change this issue to virtio-win conponent since I can *not* reproduce this issue on RHEL5u7 guest.

Additional info
1.in the windows guest ,click "safely remove disk XXX" will not hit this issue.
2.virtio-win driver :virtio-win-1.4.0-1.el6

Comment 2 Mike Cao 2011-11-07 08:49:32 UTC
tried with win2k3_32 bit guest ,also hit this issue .

Comment 3 Vadim Rozenfeld 2011-11-27 21:08:07 UTC
Hi Mike,
Could you please check if it works on Linux?

Best,
Vadim.

Comment 4 Mike Cao 2011-11-28 04:43:31 UTC
(In reply to comment #3)
> Hi Mike,
> Could you please check if it works on Linux?
> 
> Best,
> Vadim.

According to comment #1 ,
Could not reprodcuce it with RHEL5u7 guest 

Best Regards,
Mike

Comment 5 Vadim Rozenfeld 2011-12-09 10:28:49 UTC
(In reply to comment #4)
> (In reply to comment #3)
> > Hi Mike,
> > Could you please check if it works on Linux?
> > 
> > Best,
> > Vadim.
> 
> According to comment #1 ,
> Could not reprodcuce it with RHEL5u7 guest 
>
Hi Mike,
Can you check the following scenario on Linux:
- step 1;
- step 2 (Hot plug a virtio data disk); 
- please mount the new volume;
- step 3 (Hot unplug the data disk);
- try read/write the new volume created after step 2.

Thank you,
Vadim.
 
> Best Regards,
> Mike

Comment 6 Vadim Rozenfeld 2011-12-09 11:02:39 UTC
Moving it to RHEL-6.4.0
There is no easy way to monitor disk
add/removal events.

Comment 7 Mike Cao 2011-12-12 06:46:20 UTC
(In reply to comment #5)

> >
> Hi Mike,
> Can you check the following scenario on Linux:
> - step 1;
> - step 2 (Hot plug a virtio data disk); 
> - please mount the new volume;
> - step 3 (Hot unplug the data disk);
> - try read/write the new volume created after step 2.
> 

Hi, Vadim

I reproduce the issue with Linux guest after mount the new volume .
Sorry for my mistake ,move this issue to qemu-kvm ?

Best Regards,
Mike

Comment 8 Vadim Rozenfeld 2011-12-12 07:56:39 UTC
(In reply to comment #7)
> (In reply to comment #5)
> 
> > >
> > Hi Mike,
> > Can you check the following scenario on Linux:
> > - step 1;
> > - step 2 (Hot plug a virtio data disk); 
> > - please mount the new volume;
> > - step 3 (Hot unplug the data disk);
> > - try read/write the new volume created after step 2.
> > 
> 
> Hi, Vadim
> 
> I reproduce the issue with Linux guest after mount the new volume .
> Sorry for my mistake ,move this issue to qemu-kvm ?

Yes, please.
Kind regards,
Vadim.

> 
> Best Regards,
> Mike

Comment 9 Mike Cao 2011-12-12 08:04:53 UTC
according to comment #8 and comment #7 ,move component to qemu-kvm.

Comment 10 Minchan Kim 2011-12-15 14:35:59 UTC
(In reply to comment #7)
> (In reply to comment #5)
> 
> > >
> > Hi Mike,
> > Can you check the following scenario on Linux:
> > - step 1;
> > - step 2 (Hot plug a virtio data disk); 
> > - please mount the new volume;
> > - step 3 (Hot unplug the data disk);
> > - try read/write the new volume created after step 2.
> > 
> 
> Hi, Vadim
> 
> I reproduce the issue with Linux guest after mount the new volume .
> Sorry for my mistake ,move this issue to qemu-kvm ?
> 
> Best Regards,
> Mike


Hi, Mike

Could you show me steps to reproduce this problem in linux guest?

Comment 11 Mike Cao 2011-12-16 02:27:26 UTC
(In reply to comment #10)
> (In reply to comment #7)
> > (In reply to comment #5)
> > 
> > > >
> > > Hi Mike,
> > > Can you check the following scenario on Linux:
> > > - step 1;
> > > - step 2 (Hot plug a virtio data disk); 
> > > - please mount the new volume;
> > > - step 3 (Hot unplug the data disk);
> > > - try read/write the new volume created after step 2.
> > > 
> > 
> > Hi, Vadim
> > 
> > I reproduce the issue with Linux guest after mount the new volume .
> > Sorry for my mistake ,move this issue to qemu-kvm ?
> > 
> > Best Regards,
> > Mike
> 
> 
> Hi, Mike
> 
> Could you show me steps to reproduce this problem in linux guest?
1. Boot a Linux guest

2.Hot plug a virtio data disk.
(qemu) __com.redhat_drive_add
file=/home/disk.qcow2,id=virtio-2,format=qcow2,cache=none,werror=stop,rerror=stop
(qemu) device_add virtio-blk-pci,id=virtio-2-2,bus=pci.0,drive=virtio-2

3.format this disk as a partition and mount it in /mnt
#fidsk /dev/vdb
#mkfs.ext3 /dev/vdb1
#mount /dev/vdb1 /mnt

3.Hot unplug the data disk driver.
(qemu) __com.redhat_drive_del virtio-2


4.do io operation on /mnt
#mkdir /mnt/tt


Actual results:
(qemu) block I/O error in device '': Input/output error (5)
handle_dev_input: stop

then type (qemu)cont ,guest still stopped and can not be continued any more 

Expected results:
Should no error and disk is removed safely.

Additional info:
If using "device_del virtio-2-2" to remove the data disk, no error happens.

Comment 12 Asias He 2012-07-16 08:20:15 UTC
I have fixed the hot un-plug problem in upstream kernel and will backport to RHEL when it hit linus's tree without any changes to qemu-kvm. 

http://lists.linuxfoundation.org/pipermail/virtualization/2012-June/020173.html

I thinks we need some change in windows driver as well. So, reassign this bug to Vadim Rozenfeld.

Comment 13 Vadim Rozenfeld 2012-07-31 07:17:28 UTC
*** Bug 805461 has been marked as a duplicate of this bug. ***

Comment 18 danielgao 2013-07-30 14:42:30 UTC
>Asias He 2012-07-16 04:20:15 EDT 
>I have fixed the hot un-plug problem in upstream kernel and will backport to >RHEL when it hit linus's tree without any changes to qemu-kvm. 

>http://lists.linuxfoundation.org/pipermail/virtualization/2012-June/020173.html

I thinks we need some change in windows driver as well. So, reassign this bug to Vadim Rozenfeld.

Hi Vadim
Is it fixed in windows virtio driver?

Comment 19 Vadim Rozenfeld 2013-07-31 10:09:47 UTC
(In reply to danielgao from comment #18)
> >Asias He 2012-07-16 04:20:15 EDT 
> >I have fixed the hot un-plug problem in upstream kernel and will backport to >RHEL when it hit linus's tree without any changes to qemu-kvm. 
> 
> >http://lists.linuxfoundation.org/pipermail/virtualization/2012-June/020173.html
> 
> I thinks we need some change in windows driver as well. So, reassign this
> bug to Vadim Rozenfeld.
> 
> Hi Vadim
> Is it fixed in windows virtio driver?

Was it an NTFS formatted volume? If yes, can we check how it works with FAT?

Thank you,
Vadim.

Comment 20 danielgao 2013-07-31 13:41:32 UTC
NTFS and FAT were both tested and failed.

Steps are shown below:
1.start a vm(win2k3 or win2k8)

2.(qemu)drive_add dummy file=/home/newvirtio.img,if=none,id=drive_virtio_disk0,format=raw,cache=none,io=native

3.(qemu)device_add virtio-blk-pci,id=virtio_disk0,bus=pci.0,drive=drive_virtio_disk0

4.format the disk with NTFS or FAT file system

5.do io operation on new disk.
#copying large files to new disk

6.before finishing the copying
  (qemu) device_del virtio_disk0
  (qemu) drive_del drive_virtio_disk0

7.in guest,we still can see the volume,but cannot do any operation.Also,failed  to shutdown the vm gracefully. 

Version-Release number of selected component (if applicable):
rhel6.4 kernel-2.6.32-358.el6.x86_64
win-virtio:win-virtio-0.1.65
Guest OS:win2k3 or win2k8

Comment 21 Ronen Hod 2014-03-25 10:10:08 UTC
Deferring once again to 7.1. Not a mainstream scenario (unplug the media, not the device, although it is a non-removable media).

Comment 23 Ronen Hod 2014-08-06 08:55:20 UTC
No good solution yet. Deferring again to 7.2.

Comment 26 Yu Wang 2015-12-04 02:36:54 UTC
NTFS and FAT were both tested and failed.

Steps:
1.start a vm( win2k8-32)
  
2.(qemu)__com.redhat_drive_add file=test.raw,id=drive-virtio-disk0,format=raw,cache=none

3.(qemu) device_add virtio-blk-pci,id=virtio-disk0,drive=drive-virtio-disk0

4.format the disk with NTFS or FAT file system

5. del drive and device
  (qemu) drive_del drive_virtio_disk0
  (qemu) device_del virtio_disk0

6.1) qemu didn't report any error.
  2)The hotunplug blk device is still in device manager
  3)in guest,we still can see the volume in "my computer",but cannot do any 
operation , if do some operatio, it shows"The reqquest could not be performed because of an I/O device error"
  4) in Disk manager, the hotunplug disk is still exit, if rescan the disk, the hotunpluged disk change to Unknown disk and not Initialized(shows black)

7 Additional info 
  if not use drive_del command,only "(qemu) device_del virtio_disk0", the system shows normally, the device and disk can not be found successfully.

Version-Release number of selected component (if applicable):

kernel-2.6.32-573.8.1.el6.x86_64
qemu-kvm-rhev-0.12.1.2-2.479.el6_7.2.x86_64
win-virtio:virtio-win-prewhql-111/virtio-win-1.4.0-1.el6/virtio-win-prewhql-65
Guest OS: win2k8

Comment 28 Peixiu Hou 2018-07-12 09:41:31 UTC
On rhel7.6 host, also can reproduced this issue on win2008-r2.

Used version:
kernel-3.10.0-916.el7.x86_64
qemu-img-rhev-2.12.0-5.el7.x86_64
seabios-1.10.2-3.el7_4.1.x86_64
virtio-win-prewhql-156

Best Regards~
peixiu


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