All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: wayen <1662050@bugs.launchpad.net>
Cc: qemu-devel@nongnu.org
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	[thread overview]
Message-ID: <20170213141329.GG10361@stefanha-x1.localdomain> (raw)
In-Reply-To: <20170209020554.6226.61390.malone@wampee.canonical.com>

[-- Attachment #1: Type: text/plain, Size: 1416 bytes --]

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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

  reply	other threads:[~2017-02-13 14:13 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-06  2:45 [Qemu-devel] [Bug 1662050] [NEW] qemu-img convert a delta qcow2 image into a complete image wayen
2017-02-06  2:54 ` [Qemu-devel] [Bug 1662050] " wayen
2017-02-06  3:19 ` [Qemu-devel] [Bug 1662050] Re: qemu-img convert a overlay qcow2 image into a entire image wayen
2017-02-06 18:34   ` Eric Blake
2017-02-07  2:12 ` wayen
2017-02-07  2:33 ` wayen
2017-02-07  3:21 ` wayen
2017-02-07 12:11 ` Thomas Huth
2017-02-08  2:04 ` wayen
2017-02-08  8:04 ` Thomas Huth
2017-02-08  8:16 ` wayen
2017-02-08 13:41   ` Eric Blake
2017-02-09  2:05 ` wayen
2017-02-13 14:13   ` Stefan Hajnoczi [this message]
2017-02-14  2:00 ` wayen
2017-02-14  2:06 ` wayen
2017-02-14  2:16 ` wayen
2017-02-14  2:17 ` wayen
2017-02-15 14:24   ` Stefan Hajnoczi
2017-04-10  2:14 ` wayen
2017-04-10  3:04   ` 858585 jemmy
2017-04-10  2:16 ` wayen
2017-04-10  5:07 ` wayen
2017-04-10  6:30   ` 858585 jemmy
2017-04-10  7:00 ` wayen
2017-06-10  4:17 ` Launchpad Bug Tracker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170213141329.GG10361@stefanha-x1.localdomain \
    --to=stefanha@gmail.com \
    --cc=1662050@bugs.launchpad.net \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.