This will contain the data required for creating the qemu-img
command line without having access to the volume definition.
diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c
index fdda0dc..f5b95ec 100644
The core issue is when the qemu-img command builder includes the size string ("%llk", size_arg). In vivid, if you are not converting, it creates it (0k) in our case, which is completely valid parameter to qemu-img.
In wily (1.2.15) this is now a new condition see this diff:
- if (convert)
- virCommandAddArg(cmd, inputPath);
- virCommandAddArg(cmd, vol->target.path);
- if (!convert)
- virCommandAddArgFormat(cmd, "%lluK", size_arg);
+ if (info.inputPath)
+ virCommandAddArg(cmd, info.inputPath);
+ virCommandAddArg(cmd, info.path);
+ if (!info.inputPath && info.size_arg)
+ virCommandAddArgFormat(cmd, "%lluK", info.size_arg);
I suspect that we might need to report this upstream. If we don't pass a capacity (or pass it as 0)
then the if (!info.inputPath && info.size_arg) will always fail: if (1 && 0), and it will stay broken
I think it's safe to drop the && info.size_arg check since it's safe to call qemu-img with size 0:
In the change between vivid (1.2.12) and wily (1.2.15) the following patch from upstream was applied:
commit fbcf7da95b872ac 45cabc4356fc9c0 6e809d0237
Author: Ján Tomko <email address hidden>
Date: Thu Jul 31 18:07:56 2014 +0200
Introduce struct _virStorageBack endQemuImgInfo
This will contain the data required for creating the qemu-img
command line without having access to the volume definition.
diff --git a/src/storage/ storage_ backend. c b/src/storage/ storage_ backend. c
index fdda0dc..f5b95ec 100644
The core issue is when the qemu-img command builder includes the size string ("%llk", size_arg). In vivid, if you are not converting, it creates it (0k) in our case, which is completely valid parameter to qemu-img.
In wily (1.2.15) this is now a new condition see this diff:
- if (convert) g(cmd, inputPath); g(cmd, vol->target.path); gFormat( cmd, "%lluK", size_arg); g(cmd, info.inputPath); g(cmd, info.path); gFormat( cmd, "%lluK", info.size_arg);
- virCommandAddAr
- virCommandAddAr
- if (!convert)
- virCommandAddAr
+ if (info.inputPath)
+ virCommandAddAr
+ virCommandAddAr
+ if (!info.inputPath && info.size_arg)
+ virCommandAddAr
I suspect that we might need to report this upstream. If we don't pass a capacity (or pass it as 0)
then the if (!info.inputPath && info.size_arg) will always fail: if (1 && 0), and it will stay broken
I think it's safe to drop the && info.size_arg check since it's safe to call qemu-img with size 0:
(foudres) libvirt % sudo /usr/bin/qemu-img create -f qcow2 -o compat=0.10 /var/lib/ uvtool/ libvirt/ images/ x-uvt-b64- Y29tLnVidW50dS5 jbG91ZDpzZXJ2ZX I6MTUuMTA6YW1kN jQgMjAxNTA2MjQ= uvtool/ libvirt/ images/ x-uvt-b64- Y29tLnVidW50dS5 jbG91ZDpzZXJ2ZX I6MTUuMTA6YW1kN jQgMjAxNTA2MjQ= : Image creation needs a size parameter uvtool/ libvirt/ images/ x-uvt-b64- Y29tLnVidW50dS5 jbG91ZDpzZXJ2ZX I6MTUuMTA6YW1kN jQgMjAxNTA2MjQ= 0K uvtool/ libvirt/ images/ x-uvt-b64- Y29tLnVidW50dS5 jbG91ZDpzZXJ2ZX I6MTUuMTA6YW1kN jQgMjAxNTA2MjQ= ', fmt=qcow2 size=0 compat='0.10' encryption=off cluster_size=65536 lazy_refcounts=off uvtool/ libvirt/ images/ x-uvt-b64- Y29tLnVidW50dS5 jbG91ZDpzZXJ2ZX I6MTUuMTA6YW1kN jQgMjAxNTA2MjQ= uvtool/ libvirt/ images/ x-uvt-b64- Y29tLnVidW50dS5 jbG91ZDpzZXJ2ZX I6MTUuMTA6YW1kN jQgMjAxNTA2MjQ= uvtool/ libvirt/ images/ x-uvt-b64- Y29tLnVidW50dS5 jbG91ZDpzZXJ2ZX I6MTUuMTA6YW1kN jQgMjAxNTA2MjQ= uvtool/ libvirt/ images/ x-uvt-b64- Y29tLnVidW50dS5 jbG91ZDpzZXJ2ZX I6MTUuMTA6YW1kN jQgMjAxNTA2MjQ=
qemu-img: /var/lib/
(foudres) libvirt % sudo /usr/bin/qemu-img create -f qcow2 -o compat=0.10 /var/lib/
Formatting '/var/lib/
(foudres) libvirt % ls -al /var/lib/
-rw-r--r-- 1 root root 196608 Jun 29 12:12 /var/lib/
(foudres) libvirt % sudo qemu-img info /var/lib/
image: /var/lib/
file format: qcow2
virtual size: 0 (0 bytes)
disk size: 192K
cluster_size: 65536
Format specific information:
compat: 0.10