Bug 1084302

Summary: Should improve error info when can't find backing file for snapshot
Product: Red Hat Enterprise Linux 7 Reporter: Xu Han <xuhan>
Component: qemu-kvmAssignee: Jeff Cody <jcody>
Status: CLOSED WONTFIX QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: chayang, eblake, jcody, juzhang, knoel, michen, mkenneth, qguo, qzhang, rbalakri, rpacheco, virt-maint
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1028276
: 1161582 (view as bug list) Environment:
Last Closed: 2016-04-28 19:02:53 UTC Type: Bug
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: 1028276    
Bug Blocks: 1161582    

Comment 2 Xu Han 2014-04-04 07:03:48 UTC
The reason of this issue is that QEMU seeking the backing file by following the path of the current snapshot. If they sit in different directory, while creating a new snapshot, QEMU would show like:
{"error": {"class": "GenericError", "desc": "Could not open '/home/xuhan/sn/space0-snap2.qcow2': Could not open file: No such file or directory: No such file or directory"}}

CLI:
/usr/libexec/qemu-kvm ... \
    -drive file=disk0,if=none,id=drive-ide0-0-0,cache=none,aio=threads,rerror=stop,werror=stop ...

# ls /home/xuhan/ | grep disk0
disk0

# pidof qemu-kvm
12121

# ll /proc/12121/cwd
lrwxrwxrwx. 1 root root 0 Apr  4 13:51 /proc/12121/cwd -> /home/xuhan

---------------------------
Creating snapshotA succeed:

{ "execute": "blockdev-snapshot-sync", "arguments": { "device": "drive-ide0-0-0", "snapshot-file": "/home/xuhan/sn/space0-snap2.qcow2", "format": "qcow2", "mode": "absolute-paths" } }
{"return": {}}

(qemu) info block
...
drive-ide0-0-0: removable=0 io-status=ok file=/home/xuhan/sn/space0-snap2.qcow2 backing_file=disk0 backing_file_depth=1 ro=0 drv=qcow2 encrypted=0 bps=0 bps_rd=0 bps_wr=0 iops=0 iops_rd=0 iops_wr=0
...

--------------------------
Creating snapshotB failed:

{ "execute": "blockdev-snapshot-sync", "arguments": { "device": "drive-ide0-0-0", "snapshot-file": "/home/xuhan/sn/space0-snap3.qcow2", "format": "qcow2", "mode": "absolute-paths" } }
{"error": {"class": "GenericError", "desc": "Could not open '/home/xuhan/sn/space0-snap2.qcow2': Could not open file: No such file or directory: No such file or directory"}}


---------------------------------------------------------------------------
If copy the backing file to the path of the current snapshot, then creating snapshotB would succeed:

# cp /home/xuhan/disk0 /home/xuhan/sn/disk0

{ "execute": "blockdev-snapshot-sync", "arguments": { "device": "drive-ide0-0-0", "snapshot-file": "/home/xuhan/sn/space0-snap3.qcow2", "format": "qcow2", "mode": "absolute-paths" } }
{"return": {}}

(qemu) info block
...
drive-ide0-0-0: removable=0 io-status=ok file=/home/xuhan/sn/space0-snap3.qcow2 backing_file=/home/xuhan/sn/space0-snap2.qcow2 backing_file_depth=2 ro=0 drv=qcow2 encrypted=0 bps=0 bps_rd=0 bps_wr=0 iops=0 iops_rd=0 iops_wr=0
...

Comment 3 Xu Han 2014-04-04 07:43:19 UTC
Version-Release number of selected component (if applicable):
qemu-kvm-rhev-1.5.3-60.el7ev.x86_64

Also hit this issue with:
qemu-kvm-rhev-1.5.3-43.el7.x86_64
So, this might not be a regression.