Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1065258 - file is missing in backing file after qemu-img commit
Summary: file is missing in backing file after qemu-img commit
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm
Version: 7.0
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: rc
: ---
Assignee: Jeff Cody
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-02-14 08:17 UTC by CongLi
Modified: 2014-02-17 02:57 UTC (History)
13 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-02-17 02:57:11 UTC


Attachments (Terms of Use)
autotest debug file (deleted)
2014-02-14 08:22 UTC, CongLi
no flags Details

Description CongLi 2014-02-14 08:17:43 UTC
Description of problem:
file is missing in backing file after qemu-img commit

Version-Release number of selected component (if applicable):
kernel-3.10.0-87.el7.x86_64
qemu-kvm-rhev-1.5.3-47.el7.x86_64

How reproducible:
only once

Steps to Reproduce:
1. Create backing file by command: 
   # qemu-img create -b /home/staf-kvm-devel/autotest-devel/client/tests/virt/shared/data/images/RHEL-Server-7.0-64-virtio.qcow2 -f qcow2 /home/staf-kvm-devel/autotest-devel/client/tests/virt/shared/data/images/RHEL-Server-7.0-64-virtio_bak.qcow2 

2. Start a new VM, using backing file as its harddisk

3. Touch a file "commit_testfile" in the backing_file, and shutdown the VM.
   # touch /commit_testfile
   
4. Boot the original harddisk to make sure touching the file does not affect it.
   # [ ! -e /commit_testfile ] && echo $?

5. Commit the change to the original harddisk by executing "qemu-img commit" command:
   # qemu-img commit -f qcow2 /home/staf-kvm-devel/autotest-devel/client/tests/virt/shared/data/images/RHEL-Server-7.0-64-virtio_bak.qcow2

6. Start the VM using the original harddisk and check if the file "commit_testfile" exists.

Actual results:
Could not find commit_testfile in backing file after commit

Expected results:
File should be still existed after commit

Additional info:
1. Qemu CML:
/home/staf-kvm-devel/autotest-devel/client/tests/virt/qemu/qemu \
    -S  \
    -name 'virt-tests-vm1'  \
    -sandbox off  \
    -M pc-i440fx-rhel7.0.0  \
    -nodefaults  \
    -vga qxl  \
    -global qxl-vga.vram_size=33554432 \
    -device intel-hda,bus=pci.0,addr=03 \
    -device hda-duplex  \
    -chardev socket,id=qmp_id_qmpmonitor1,path=/tmp/monitor-qmpmonitor1-20140214-024611-TGAd2Ijj,server,nowait \
    -mon chardev=qmp_id_qmpmonitor1,mode=control  \
    -chardev socket,id=serial_id_serial0,path=/tmp/serial-serial0-20140214-024611-TGAd2Ijj,server,nowait \
    -device isa-serial,chardev=serial_id_serial0 \
    -device virtio-serial-pci,id=virtio_serial_pci0,bus=pci.0,addr=04  \
    -chardev socket,id=devvs,path=/tmp/virtio_port-vs-20140214-024611-TGAd2Ijj,server,nowait \
    -device virtserialport,chardev=devvs,name=vs,id=vs,bus=virtio_serial_pci0.0  \
    -chardev socket,id=seabioslog_id_20140214-024611-TGAd2Ijj,path=/tmp/seabios-20140214-024611-TGAd2Ijj,server,nowait \
    -device isa-debugcon,chardev=seabioslog_id_20140214-024611-TGAd2Ijj,iobase=0x402 \
    -device nec-usb-xhci,id=usb1,bus=pci.0,addr=05 \
    -drive id=drive_image1,if=none,cache=none,snapshot=off,aio=native,file=/home/staf-kvm-devel/autotest-devel/client/tests/virt/shared/data/images/RHEL-Server-7.0-64-virtio.qcow2 \
    -device virtio-blk-pci,id=image1,drive=drive_image1,bootindex=0,bus=pci.0,addr=06 \
    -device virtio-net-pci,mac=9a:8c:8d:8e:8f:90,id=idQiI89V,netdev=idLOXATs,bus=pci.0,addr=07  \
    -netdev tap,id=idLOXATs,vhost=on,vhostfd=23,fd=22  \
    -m 4096  \
    -smp 4,maxcpus=4,cores=2,threads=1,sockets=2  \
    -cpu 'Opteron_G4',+kvm_pv_unhalt \
    -device usb-tablet,id=usb-tablet1,bus=usb1.0,port=1  \
    -spice port=3000,password=123456,addr=0,tls-port=3200,x509-dir=/tmp/spice_x509d,tls-channel=main,tls-channel=inputs,image-compression=auto_glz,zlib-glz-wan-compression=auto,streaming-video=all,agent-mouse=on,playback-compression=on,ipv4  \
    -rtc base=utc,clock=host,driftfix=slew  \
    -boot order=cdn,once=c,menu=off  \
    -no-kvm-pit-reinjection \
    -enable-kvm

2. cpuinfo:
processor	: 23
vendor_id	: AuthenticAMD
cpu family	: 21
model		: 1
model name	: AMD Opteron(TM) Processor 6234                 
stepping	: 2
microcode	: 0x6000626
cpu MHz		: 2399.938
cache size	: 2048 KB
physical id	: 1
siblings	: 12
core id		: 5
cpu cores	: 6
apicid		: 75
initial apicid	: 43
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc extd_apicid amd_dcm aperfmperf pni pclmulqdq monitor ssse3 cx16 sse4_1 sse4_2 popcnt aes xsave avx lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs xop skinit wdt lwp fma4 nodeid_msr topoext perfctr_core perfctr_nb arat cpb hw_pstate npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold
bogomips	: 4799.73
TLB size	: 1536 4K pages
clflush size	: 64
cache_alignment	: 64
address sizes	: 48 bits physical, 48 bits virtual
power management: ts ttp tm 100mhzsteps hwpstate cpb

Comment 1 CongLi 2014-02-14 08:19:33 UTC
As only met this bug once and is hard to reporduce, set the priority to low.

Comment 2 CongLi 2014-02-14 08:22:23 UTC
Created attachment 863171 [details]
autotest debug file

Comment 4 Kevin Wolf 2014-02-14 15:42:11 UTC
(In reply to CongLi from comment #0)
> Steps to Reproduce:
> 1. Create backing file by command: 
>    # qemu-img create -b
> /home/staf-kvm-devel/autotest-devel/client/tests/virt/shared/data/images/
> RHEL-Server-7.0-64-virtio.qcow2 -f qcow2
> /home/staf-kvm-devel/autotest-devel/client/tests/virt/shared/data/images/
> RHEL-Server-7.0-64-virtio_bak.qcow2 
> 
> 2. Start a new VM, using backing file as its harddisk
> 
> 3. Touch a file "commit_testfile" in the backing_file, and shutdown the VM.
>    # touch /commit_testfile
>    
> 4. Boot the original harddisk to make sure touching the file does not affect
> it.
>    # [ ! -e /commit_testfile ] && echo $?

The original hard disk is /home/staf-kvm-devel/autotest-devel/client/tests/virt/shared/data/images/RHEL-Server-7.0-64-virtio.qcow2? (This is what is
generally called the backing file, whereas the new image you created is an
overlay.)

Did you boot it up with the hard-disk in read/write mode? If so, you have
written to the backing file, which is likely to destroy data on the overlays.
You must not do that.

To confirm that this is the problem you can try booting the overlay file once
again and check if the file is still there.

Comment 5 juzhang 2014-02-17 02:05:36 UTC
(In reply to Kevin Wolf from comment #4)
> (In reply to CongLi from comment #0)
> > Steps to Reproduce:
> > 1. Create backing file by command: 
> >    # qemu-img create -b
> > /home/staf-kvm-devel/autotest-devel/client/tests/virt/shared/data/images/
> > RHEL-Server-7.0-64-virtio.qcow2 -f qcow2
> > /home/staf-kvm-devel/autotest-devel/client/tests/virt/shared/data/images/
> > RHEL-Server-7.0-64-virtio_bak.qcow2 
> > 
> > 2. Start a new VM, using backing file as its harddisk
> > 
> > 3. Touch a file "commit_testfile" in the backing_file, and shutdown the VM.
> >    # touch /commit_testfile
> >    
> > 4. Boot the original harddisk to make sure touching the file does not affect
> > it.
> >    # [ ! -e /commit_testfile ] && echo $?
> 
> The original hard disk is
> /home/staf-kvm-devel/autotest-devel/client/tests/virt/shared/data/images/
> RHEL-Server-7.0-64-virtio.qcow2? (This is what is
> generally called the backing file, whereas the new image you created is an
> overlay.)
> 
> Did you boot it up with the hard-disk in read/write mode? If so, you have
> written to the backing file, which is likely to destroy data on the overlays.
> You must not do that.
> 
> To confirm that this is the problem you can try booting the overlay file once
> again and check if the file is still there.

Hi Coli,

Could you update your comment?

Best Regards,
Junyi

Comment 6 CongLi 2014-02-17 02:57:11 UTC
(In reply to Kevin Wolf from comment #4)

> The original hard disk is
> /home/staf-kvm-devel/autotest-devel/client/tests/virt/shared/data/images/
> RHEL-Server-7.0-64-virtio.qcow2? (This is what is
> generally called the backing file, whereas the new image you created is an
> overlay.)
> 
> Did you boot it up with the hard-disk in read/write mode? If so, you have
> written to the backing file, which is likely to destroy data on the overlays.
> You must not do that.

Yes, boot the backing file in read/write mode and snapshot=off before commit.

> To confirm that this is the problem you can try booting the overlay file once
> again and check if the file is still there.

Sorry for can't be back to the origin env for I have tried to reproduced this bug 50 times on that image, but test pass.

Will update our test case's steps, thanks a lot.

Close this as 'NOT A BUG'.

Thanks,
Cong


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