Bug 677918

Summary: File system change fail to be written to qcow2 image when use "quit" on qemu console immediately after the change
Product: Red Hat Enterprise Linux 6 Reporter: Shaolong Hu <shu>
Component: qemu-kvmAssignee: Virtualization Maintenance <virt-maint>
Status: CLOSED NOTABUG QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.1CC: bcao, juzhang, michen, mkenneth, virt-maint
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-02-16 10:33:31 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Shaolong Hu 2011-02-16 09:36:42 UTC
Description of problem:
Create a new file using "dd" command in guest which use qcow2 image, when "dd" command finish, immediately type "quit" on qemu console to end the guest, boot guest with the image again, the file "dd" created does not exist.

Version-Release number of selected component (if applicable):
host info:
#uname -r
2.6.32-113.el6.x86_64
#rpm -q qemu-kvm
qemu-kvm-0.12.1.2-2.145.el6.x86_64
guest info:
2.6.18-238.el5

How reproducible:
100% if quit quickly enough

Steps to Reproduce:
1. create a qcow2 image: qemu-img create -f qcow2 rhel5.6_64_qcow2_base 20G
2. boot guest: /usr/libexec/qemu-kvm -M rhel6.1.0 -enable-kvm -m 2G -smp 2 -name RHEL-Server-5.6-64-base -uuid `uuidgen` -rtc base=utc -boot order=cd -drive file=./rhel5.6_64_qcow2_base,if=none,id=drive-virtio-disk0,format=qcow2,cache=none,werror=stop,rerror=stop -device virtio-blk-pci,drive=drive-virtio-disk0,id=virtio-disk0 -netdev tap,script=/etc/qemu-ifup,id=hostnet0 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:7b:a2:fa -usb -device usb-tablet,id=input0 -vnc :10 -monitor stdio
3. after guest boot, on qemu console, type "quit" ahead, but don't press ENTER: ((qemu)) quit
4. in the guest, use "dd" create a new file: dd if=/dev/zero of=./base bs=1M count=1024
5. wait for dd finish, when you see the output of dd, switch your window to qemu console press ENTER immediately, this can be easily accomplished within 1 second.

  
Actual results:
boot guest with the image again, the file "base" does not exist.

Expected results:
boot guest with the image again, the file "base" should exist.

Additional info:

Comment 2 Shaolong Hu 2011-02-16 10:33:31 UTC
Have confirmed that this is caused by dd command itself, if use "dd conv=fsync ...", this won't happen, not a bug, never mind.