Bug 1315245 - qemu-img unable to parse the prefix "file:" correctlly.
qemu-img unable to parse the prefix "file:" correctlly.
Status: CLOSED NEXTRELEASE
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
7.3
x86_64 Linux
unspecified Severity low
: rc
: ---
Assigned To: Max Reitz
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-03-07 06:06 EST by pingl
Modified: 2016-03-24 01:20 EDT (History)
10 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-03-08 14:05:40 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 pingl 2016-03-07 06:06:29 EST
Description of problem:
qemu-img unable to parse the prefix "file:" correctlly. Create an image using the prexif "file:", whose filename actually contains that prefix.

Version-Release number of selected component (if applicable):
qemu-kvm-1.5.3-108.el7
3.10.0-355.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.create an image with prefix 'file:'.
# qemu-img create -f qcow2 file:ip-192.168.254.185:asdf 5G


Actual results:
# qemu-img create -f qcow2 file:ip-192.168.254.185:asdf 5G
Formatting 'file:ip-192.168.254.185:asdf', fmt=qcow2 size=5368709120 encryption=off cluster_size=65536 lazy_refcounts=off 
# ls -l
-rw-r--r-- 1 root root 197120 March   7 18:41 file:ip-192.168.254.185:asdf

Expected results:
Create an image whose name is "ip-192.168.254.185:asdf"

Additional info:
When test the issue on RHEL7.2, the case passed. 
RHEL7.2:
version of componests:
qemu-kvm-rhev-2.3.0-31.el7_2.8
3.10.0-327.13.1.el7.x86_64

# qemu-img create -f qcow2 file:ip-192.168.254.185:asdf 5G
Formatting 'file:ip-192.168.254.185:asdf', fmt=qcow2 size=5368709120 encryption=off cluster_size=65536 lazy_refcounts=off refcount_bits=16
# ls -l
-rw-r--r-- 1 root root 197120 March   7 18:40 ip-192.168.254.185:asdf
# qemu-img info file:ip-192.168.254.185:asdf 
image: ip-192.168.254.185:asdf
file format: qcow2
virtual size: 5.0G (5368709120 bytes)
disk size: 196K
cluster_size: 65536
Format specific information:
    compat: 1.1
    lazy refcounts: false
    refcount bits: 16
    corrupt: false

RHEL7.3:
version of componests:
qemu-kvm-1.5.3-108.el7
3.10.0-355.el7.x86_64

# qemu-img create -f qcow2 file:ip-192.168.254.185:asdf 5G
Formatting 'file:ip-192.168.254.185:asdf', fmt=qcow2 size=5368709120 encryption=off cluster_size=65536 lazy_refcounts=off 
# ls -l
-rw-r--r-- 1 root root 197120 March   7 18:41 file:ip-192.168.254.185:asdf
# qemu-img info file:ip-192.168.254.185:asdf 
image: file:ip-192.168.254.185:asdf
file format: qcow2
virtual size: 5.0G (5368709120 bytes)
disk size: 196K
cluster_size: 65536
Format specific information:
    compat: 1.1
    lazy refcounts: false

#qemu-img create -f qcow2 ip-192.168.254.185:asdf 5G
qemu-img: ip-192.168.254.185:asdf: Unknown protocol 'ip-192.168.254.185:asdf'

Reference bug:
https://bugzilla.redhat.com/show_bug.cgi?id=1072130
Comment 2 Ademar Reis 2016-03-08 14:05:40 EST
From https://bugzilla.redhat.com/show_bug.cgi?id=1072130#c4:

"""
As your tests show, too, using the "file:" prefix creates an image whose filename actually contains that prefix, which is not correct. As I have said, I have sent upstream patches to fix this behavior which are however pretty difficult to backport. Therefore, my question (basically to everyone reading this bugzilla, therefore I'll leave needinfo cleared) remains:

Do we really need to fix the behavior in RHEL 6 for specifying the "file:" prefix ("file:foo:bar" should create a file named "foo:bar" instead of "file:foo:bar") or will the already working "./foo:bar" notation (which is probably more intuitive, anyway) suffice?
"""

Given the backport is not trivial, I'm closing this one in RHEL6 too. Please reopen if it's affecting customers or a layered product.

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