qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [Bug 1662050] Re: qemu-img convert a overlay qcow2 imag


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [Bug 1662050] Re: qemu-img convert a overlay qcow2 image into a entire image
Date: Mon, 13 Feb 2017 14:13:29 +0000
User-agent: Mutt/1.7.1 (2016-10-04)

On Thu, Feb 09, 2017 at 02:05:54AM -0000, wayen wrote:
> @Eric Blake, I used virt-sparsify to sparsify the qcow2 overlay image.
> As you said, the actual disk usage is minimized and the apparent file
> size is unchanged.It is very valuable for me, because it means that my
> disk can hold more files.
> 
> But we need to be careful when transfer the sparse qcow2 overlays.
> Because some tools do not support sparse file and will convert it into a
> common file,for example, scp. And I doubt what will happen when transfer
> sparse files between different file systems.
> 
> So I want to use qemu-img to convert the sparse qcow2 overlay into
> common file. If this was feasible, the holes in the sparse overlay will
> be removed and the above problems will disappear.

You can use the drive_mirror HMP command or drive-mirror QMP command on
a running QEMU instance to copy the data to a new file and switch to the
new file.

I'm curious what exactly is being optimized by copying out a fresh qcow2
image.

Please post the output of:

  $ stat delta.qcow2
  $ qemu-img map delta.qcow2
  $ stat new.qcow2
  $ qemu-img map new.qcow2

This will allow us to see the size and data layout differences.

Maybe a new command should be added to QEMU to do the optimization
in-place.  This would avoid the disk space overhead associated with
drive-mirror, cp, qemu-img convert, etc.

Stefan

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]