Bug 980414 - qemu-kvm create -o backing_fmt can set incorrect value to image
qemu-kvm create -o backing_fmt can set incorrect value to image
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
7.0
x86_64 Linux
medium Severity medium
: rc
: ---
Assigned To: Kevin Wolf
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-02 06:13 EDT by Huang Wenlong
Modified: 2013-12-06 12:21 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-12-06 12:21:09 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Huang Wenlong 2013-07-02 06:13:00 EDT
Description of problem:
qemu-kvm create -o backing_fmt can set incorrect value to image 

Version-Release number of selected component (if applicable):
qemu-kvm-1.5.1-1.el7.x86_64

How reproducible:
100

Steps to Reproduce:
1.# qemu-img create -f qcow2 base.img 1G
Formatting 'base.img', fmt=qcow2 size=1073741824 encryption=off cluster_size=65536 lazy_refcounts=off 

2.# qemu-img create -f qcow2 -b base.img -o backing_fmt=raw  new.img 1G
Formatting 'new.img', fmt=qcow2 size=1073741824 backing_file='base.img' backing_fmt='raw' encryption=off cluster_size=65536 lazy_refcounts=off 

3.check 2 images info , incorrect base.img format :raw ,actually 
format is qcow2
# qemu-img info base.img 
image: base.img
file format: qcow2
virtual size: 1.0G (1073741824 bytes)
disk size: 136K
cluster_size: 65536

# qemu-img info new.img 
image: new.img
file format: qcow2
virtual size: 1.0G (1073741824 bytes)
disk size: 196K
cluster_size: 65536
backing file: base.img
backing file format: raw




Actual results:
as step

Expected results:
should not set incorrect format info to images 

Additional info:
Comment 2 Kevin Wolf 2013-07-05 10:48:56 EDT
You mean 'qemu-img create' should try to open the backing file and complain if
it can't do so?
Comment 3 Huang Wenlong 2013-07-17 03:01:51 EDT
(In reply to Kevin Wolf from comment #2)
> You mean 'qemu-img create' should try to open the backing file and complain
> if
> it can't do so?

I think maybe qemu can check the backing file format and report an error while someone try to set a wrong backing_fmt for new image

Wenlong
Comment 5 Ademar Reis 2013-12-06 12:21:09 EST
A raw image is just a raw, non-structured set of bits.

If you tell qemu-img a qcow2 (or .jpg, or .pdf, or .mkv, or whatever) file is a raw image, it'll happily accept it and this is expected. You never know for sure what's inside of a raw image.

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