qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
	Anthony Liguori <aliguori@us.ibm.com>,
	qemu-devel <qemu-devel@nongnu.org>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Dietmar Maurer <dietmar@proxmox.com>
Subject: Re: [Qemu-devel] [RFC] qemu-img: add option -d in convert
Date: Tue, 25 Jun 2013 19:14:19 +0800	[thread overview]
Message-ID: <51C97B8B.2010304@linux.vnet.ibm.com> (raw)
In-Reply-To: <20130625091300.GA26177@stefanha-thinkpad.redhat.com>

于 2013-6-25 17:13, Stefan Hajnoczi 写道:
> On Thu, Jun 20, 2013 at 04:59:17PM +0800, Wenchao Xia wrote:
>
> If I understand correctly, you have a backing chain with internal
> snapshots:
>
>> imageA(sn0)->imageB(sn0,sn1)->imageC(sn0)
>
> And you want to convert this to a chain of external snapshots:
>
   What it looks like is convert into external snapshots, actually
requirement is get delta data from internal snapshot, external snapshots
have delta data by nature so it is a way to orginize it. This patch
will help get that delta data.

>> imageA_sn0.qcow2-->imageA.qcow2-->imageB_sn0.qcow2-->imageB_sn1.qcow2-
>> ->imageB.qcow2-->imageC_sn0.qcow2-->imageC.qcow2
>
> You also want each image file to contain only data that is not in the
> parent.  So imageA.qcow2 would not contain identical clusters from
> imageA_sn0.qcow2.
>
   yes, it is the purpose, delta data.

> The most efficient way of doing this is by looking into the L1/L2 tables
> of the imageA(sn0) and imageA so that you know which clusters are
> different.
>
   There would be two steps I think: 1st is simply compare the cluster
to get delta, 2nd is improve it: when 2 snapshots is in one qcow2,
introduce a function to looking into L1/L2.

> This is a weird operation.  It also has a dual, converting the external
> snapshot chain into a chain of image files with internal snapshots -
> again sharing clusters instead of duplicating them.
>
   Indeed, but converting external chain into internal snapshots, is not
that useful as its revert, since in most case qemu-img can directly
convert external chain back to restore a snapshot. It can be added if
some case appear.

> It's possible to implement this but I'm a little surprised that anyone
> would want to do this.  And I wonder if management tools can cope with
> this mix of internal and external snapshots :).
>
   I think it is useful: internal snapshot have advantage about
performance, but disadvantage for delta data retrieving. This patch
will help it. When it is online, the user, for example, libvirt,
can retrieve internal/external ones very similar, it simply calls
qemu-img to get the delta for both case.

> Stefan
>


-- 
Best Regards

Wenchao Xia

  reply	other threads:[~2013-06-25 11:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-20  8:59 [Qemu-devel] [RFC] qemu-img: add option -d in convert Wenchao Xia
2013-06-25  9:13 ` Stefan Hajnoczi
2013-06-25 11:14   ` Wenchao Xia [this message]
2013-06-27  9:01     ` Stefan Hajnoczi
2013-06-27 12:30       ` Wenchao Xia
2013-07-02  8:47         ` Stefan Hajnoczi
2013-06-27 12:44       ` Wenchao Xia

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=51C97B8B.2010304@linux.vnet.ibm.com \
    --to=xiawenc@linux.vnet.ibm.com \
    --cc=aliguori@us.ibm.com \
    --cc=dietmar@proxmox.com \
    --cc=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).