[Bug 1216009] [NEW] qemu-img fails if filenames contain a ':'

Robie Basak 1216009 at bugs.launchpad.net
Fri Aug 23 16:08:19 UTC 2013


Public bug reported:

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-0ubuntu14.10
qemu-utils	1.5.0+dfsg-3ubuntu3

The root cause seems to be in qemu-img.c:print_block_option_help which
calls bdrv_find_protocol(filename). This leads to
block.c:bdrv_find_protocol which has the following comment:

    /*
     * 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|O_CREAT|O_TRUNC, 0644) = -1 ENOENT (No such file or directory)

Workaround: qemu-img create -f qcow2 ./foo:bar 1 works on 1.5.0+dfsg-
3ubuntu3, but not on 1.0+noroms-0ubuntu14.10. This may be related to:
http://lists.nongnu.org/archive/html/qemu-devel/2013-07/msg01654.html

** Affects: qemu (Ubuntu)
     Importance: Medium
         Status: Fix Released

** Affects: qemu (Ubuntu Precise)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to qemu in Ubuntu.
https://bugs.launchpad.net/bugs/1216009

Title:
  qemu-img fails if filenames contain a ':'

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/1216009/+subscriptions



More information about the Ubuntu-server-bugs mailing list