qemu-img cannot be used if filenames contain a ':'
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
qemu (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | ||
Precise |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
I cannot use qemu-img to create a qcow2 format file with a name containing a colon (':')
Steps to reproduce:
1) qemu-img create -f qcow2 foo 1 # this works
2) qemu-img create -f qcow2 foo:bar 1 # this fails
Expected results: both commands should succeed, and I should end up with files "foo" and "foo:bar".
Actual results: the second command fails with the error: qemu-img: Unknown protocol 'foo:bar'
Affected:
qemu-utils 1.0+noroms-
qemu-utils 1.5.0+dfsg-3ubuntu3
The root cause seems to be in qemu-img.
/*
* XXX(hch): we really should not let host device detection
* override an explicit protocol specification, but moving this
* later breaks access to device names with colons in them.
* Thanks to the brain-dead persistent naming schemes on udev-
* based Linux systems those actually are quite common.
*/
Impact: this stops me using libvirt to import an image into a file-backed storage pool with a libvirt name containing a colon (':'), since libvirt maps these to files in the filesystem, and then qemu-img (or kvm-img as libvirt uses) fails on it. Thus I can't use libvirt storage volumes with colons in the name. I'm doing this to map product IDs in the new Ubuntu cloud image simplestreams naming scheme (and product IDs contain colons).
I also tried: qemu-img create -f qcow2 file://foo 1
But this just leads to: open("file://foo", O_WRONLY|
Workaround: qemu-img create -f qcow2 ./foo:bar 1 works on 1.5.0+dfsg-
Changed in qemu (Ubuntu): | |
importance: | Undecided → Medium |
status: | New → Fix Released |
summary: |
- qemu-img fails if filenames contain a ':' + qemu-img cannot be used if filenames contain a ':' |
i marked fix-released as in saucy you can do:
$ qemu-img create ./foo:bar 1
Formatting './foo:bar', fmt=raw size=1
or
$ qemu-img create $PWD/foo:bar 1
Formatting '/tmp/foo:bar', fmt=raw size=1
both of these are reasonable work arounds, but do not work on precise.