Bug 703789

Summary: Virtual floppy locked value remains 0 regardless of using or not in guest
Product: Red Hat Enterprise Linux 5 Reporter: juzhang <juzhang>
Component: kvmAssignee: jason wang <jasowang>
Status: CLOSED WONTFIX QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: low    
Version: 5.7CC: bcao, gcosta, michen, mkenneth, rhod, virt-maint
Target Milestone: rcKeywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-07-31 13:34:35 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 580946    

Description juzhang 2011-05-11 09:24:46 UTC
Description of problem:
Virtual floppy locked value remains 0 regardless of using or not in guest

Version-Release number of selected component (if applicable):
kvm version:
kvm-83-232.el5


How reproducible:
100%

Steps to Reproduce:
1.boot guest with -fda /root/zhangjunyi/test.vfd
#/usr/libexec/qemu-kvm -M rhel5.6.0 -m 4G -smp 8 -name rhel5.7_64 -uuid 02b8079c-cca0-ae65-c63a-b2aa4119497d -monitor stdio -no-kvm-pit-reinjection -startdate now -boot c -drive  file=/root/zhangjunyi/rhel57.qcow2,if=virtio,format=qcow2,werror=stop,cache=none,boot=on -net nic,macaddr=54:52:40:3d:4c:88,vlan=0,model=virtio -net tap,script=/etc/qemu-ifup,downscript=no,vlan=0 -usb -k en-us -balloon none -notify all -cdrom /root/zhangjunyi/boot.iso -vnc :10 -fda /root/zhangjunyi/test.vfd

2.check block status,please note,locked=0
(qemu) info block
virtio0: type=hd removable=0 file=/root/zhangjunyi/rhel57.qcow2 ro=0 drv=qcow2 encrypted=0
ide1-cd0: type=cdrom removable=1 locked=0 file=/root/zhangjunyi/boot.iso ro=1 drv=raw encrypted=0
floppy0: type=floppy removable=1 locked=0 file=/root/zhangjunyi/test.vfd ro=0 drv=qcow2 encrypted=0
sd0: type=floppy removable=1 locked=0 [not inserted]

3.in guest,mount fd0 to /mnt
mount /dev/fd0 /mnt

4. check block status again,please note,still locked=0
(qemu) info block
virtio0: type=hd removable=0 file=/root/zhangjunyi/rhel57.qcow2 ro=0 drv=qcow2 encrypted=0
ide1-cd0: type=cdrom removable=1 locked=1 file=/root/zhangjunyi/boot.iso ro=1 drv=raw encrypted=0
floppy0: type=floppy removable=1 locked=0 file=/root/zhangjunyi/test.vfd ro=0 drv=qcow2 encrypted=0
sd0: type=floppy removable=1 locked=0 [not inserted]

locked=0 means can eject floppy in (qemu) regardless of using or not in guest 
  
Actual results:
locked value remain 0 even this virtual floppy is using by guest.

Expected results:
locked value should as 1.

Additional info:
1.if locked=0 even virtual floppy is using by guest,user still can reject this virtual floppy via (qemu) eject floppy0,however,guest don't know that.

EXT2-fs warning: mounting unchecked fs, running e2fsck is recommended
floppy0: disk absent or changed during operation
end_request: I/O error, dev fd0, sector 22
floppy0: disk absent or changed during operation
end_request: I/O error, dev fd0, sector 2
Buffer I/O error on device fd0, logical block 1
lost page write due to I/O error on fd0
EXT2-fs error (device fd0): ext2_get_inode: unable to read inode block - inode=11, block=11

2.take cdrom for example.
if we mount cdrom device in guest.then locks=1.
if we umount it.then locks=0.

Comment 1 Mike Cao 2011-05-31 06:47:59 UTC
*** Bug 709222 has been marked as a duplicate of this bug. ***

Comment 2 Mike Cao 2011-05-31 06:54:19 UTC
Raise the priority to high as it may cause floppy lose data ,referring to bug 709222