Re: [Qemu-devel] [PATCHv6] add qemu-img convert -n option (skip target volume creation)

2013-09-02 Thread Stefan Hajnoczi
On Fri, Aug 30, 2013 at 08:20:58PM +0100, Alex Bligh wrote: @@ -1363,6 +1372,16 @@ static int img_convert(int argc, char **argv) bdrv_get_geometry(bs[0], bs_sectors); buf = qemu_blockalign(out_bs, IO_BUF_SIZE); +if (skip_create) { +uint64_t out_bs_sectors = 0; +

Re: [Qemu-devel] [PATCHv6] add qemu-img convert -n option (skip target volume creation)

2013-09-02 Thread Alex Bligh
On 2 Sep 2013, at 16:28, Stefan Hajnoczi wrote: If bdrv_getlength() failed and bdrv_get_geometry() produced a 0 result, then this error message will be confusing to users. It would be better to use bdrv_getlength() directly: int64_t length = bdrv_getlength(out_bs); if (length 0) {

[Qemu-devel] [PATCHv6] add qemu-img convert -n option (skip target volume creation)

2013-08-30 Thread Alex Bligh
From: Alexandre Derumier aderum...@odiso.com Add a -n option to skip volume creation on qemu-img convert. This is useful for targets such as rbd / ceph, where the target volume may already exist; we cannot always rely on qemu-img convert to create the image, as dependent on the output format,