Bug 701911 - file is changed after convert/rebase/commit operation
Summary: file is changed after convert/rebase/commit operation
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kvm
Version: 5.7
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Kevin Wolf
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: Rhel5KvmTier3
TreeView+ depends on / blocked
 
Reported: 2011-05-04 09:20 UTC by Suqin Huang
Modified: 2013-01-09 23:51 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Rebase: Bug Fixes and Enhancements
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-10-31 10:18:19 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Suqin Huang 2011-05-04 09:20:24 UTC
Description of problem:


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

kvm-83-232.el5

How reproducible:
sometime

Steps to Reproduce:
1. boot guest and create big file in guest
cmd:

qemu-kvm -drive file='/usr/images/RHEL-Server-6.1-64-virtio.qcow2',index=0,if=virtio,media=disk,cache=none,boot=on,format=qcow2 -net nic,vlan=0,model=virtio,macaddr='9a:96:a2:e2:19:33' -net tap,vlan=0,script='/usr/scripts/qemu-ifup-switch',downscript='no' -m 8192 -smp 4,cores=1,threads=1,sockets=4 -cpu qemu64,+sse2 -soundhw ac97 -spice port=8000,disable-ticketing -qxl 1 -rtc-td-hack -M rhel5.6.0 -boot c  -usbdevice tablet -no-kvm-pit-reinjection

2. dd if=/dev/zero of=/tmp/file_base bs=100M count=10

3. get file md5sum value and shutdown guest
   # md5sum /tmp/file_base

4. create snapshot
qemu-img create -b RHEL-Server-6.1-64-virtio.qcow2 -F qcow2 -f qcow2 sn1.qcow2

5. boot snapshot and create big file
# dd if=/dev/zero of=/tmp/sn1 bs=100M count=10
# md5sum /tmp/sn1

6. shutdown snapshot and sn1 
qemu-img convert -f qcow2 -O qcow2 /usr/sn1.qcow2 /usr/sn1.qcow2_to_qcow2.qcow2

7. check file after convert
# md5sum /tmp/sn1
# md5sum /tmp/file_base


Actual results:

md5sum value is changed after image converted, rebase/commit may also cause image changed

Expected results:


Additional info:

1. host
2.6.18-259.el5

processor	: 7
vendor_id	: AuthenticAMD
cpu family	: 16
model		: 4
model name	: Quad-Core AMD Opteron(tm) Processor 2376
stepping	: 2
cpu MHz		: 800.000
cache size	: 512 KB
physical id	: 1
siblings	: 4
core id		: 3
cpu cores	: 4
apicid		: 7
initial apicid	: 7
fpu		: yes
fpu_exception	: yes
cpuid level	: 5
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nonstop_tsc extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt npt lbrv svm_lock nrip_save
bogomips	: 4588.58
TLB size	: 1024 4K pages
clflush size	: 64
cache_alignment	: 64
address sizes	: 48 bits physical, 48 bits virtual
power management: ts ttp tm stc 100mhzsteps hwpstate

Comment 3 Glauber Costa 2011-05-25 16:54:03 UTC
Until more information can be provided, this looks like just a wrong setup.

Comment 4 Suqin Huang 2011-06-20 02:28:37 UTC
Hi Glauber,
I don't compare file_base with sn1, I compare file_base_before_rebase with file_base_after_rebase, sn1 with sn1 (before and after), so, it should be a bug, can I re-open this bug

Comment 5 Kevin Wolf 2011-06-22 08:30:58 UTC
Have you tried if it happens on RHEL 6, too?

Comment 6 Kevin Wolf 2011-06-22 09:34:41 UTC
And can you verify that the md5sum is still the same when you restart the original VM?

Comment 7 Suqin Huang 2011-06-22 09:39:05 UTC
(In reply to comment #5)
> Have you tried if it happens on RHEL 6, too?

there is a bug for rhel6 bug 696557

Comment 9 Kevin Wolf 2011-08-01 16:28:41 UTC
(In reply to comment #6)
> And can you verify that the md5sum is still the same when you restart the
> original VM?

Did you check this?

Comment 10 Suqin Huang 2011-08-04 11:39:43 UTC
Test commit scenario, md5sum is still changed when boot base image

Comment 11 Kevin Wolf 2011-08-04 12:07:35 UTC
So is the md5sum of the original VM the same as on the copy after qemu-img convert? If so, this is not a bug in qemu-img, but the data has never been written correctly to the image file.

How do you shut the guest down after dd? Is it a clean shutdown or is qemu killed?

Comment 12 Suqin Huang 2011-08-05 01:43:39 UTC
(In reply to comment #11)
> So is the md5sum of the original VM the same as on the copy after qemu-img
> convert? If so, this is not a bug in qemu-img, but the data has never been
> written correctly to the image file.
> 

1. if don't do commit, then reboot base image, the md5sum is always the same
2. if commit, then reboot base image, the file md5sum is changed sometime.

> How do you shut the guest down after dd? Is it a clean shutdown or is qemu
> killed?

clean shutdown

Comment 13 Ronen Hod 2011-10-31 10:18:19 UTC
Since we didn't find the capacity to fix it for 5.8, it doesn't make sense to
continue dragging it to the next version. Closing.


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