qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: Anthony Liguori <anthony@codemonkey.ws>
Cc: Kevin Wolf <kwolf@redhat.com>, Chunqiang Tang <ctang@us.ibm.com>,
	Markus Armbruster <armbru@redhat.com>,
	Aurelien Jarno <aurelien@aurel32.net>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Re: Strategic decision: COW format
Date: Mon, 14 Mar 2011 15:05:38 +0000	[thread overview]
Message-ID: <AANLkTinKpm+WcnJOJKPjNGSFVVOPCL4ak2Aqg+E60SWx@mail.gmail.com> (raw)
In-Reply-To: <4D7E2B09.7060002@codemonkey.ws>

On Mon, Mar 14, 2011 at 2:49 PM, Anthony Liguori <anthony@codemonkey.ws> wrote:
> On 03/14/2011 09:21 AM, Kevin Wolf wrote:
>>
>> Am 14.03.2011 15:02, schrieb Anthony Liguori:
>>>
>>> On 03/14/2011 08:53 AM, Chunqiang Tang wrote:
>>>>>
>>>>> No, because the copy-on-write is another layer on top of the snapshot
>>>>> and AFAICT, they don't persist when moving between snapshots.
>>>>>
>>>>> The equivalent for external snapshots would be:
>>>>>
>>>>> base0<- base1<- base2<- image
>>>>>
>>>>> And then if I wanted to move to base1 without destroying base2 and
>>>>> image, I could do:
>>>>>
>>>>> qemu-img create -f qcow2 -b base1 base1-overlay.img
>>>>>
>>>>> The file system can keep a lot of these things around pretty easily but
>>>>> with your proposal, it seems like there can only be one.  If you
>>>>> support
>>>>> many of them, I think you'll degenerate to something as complex as a
>>>>> reference count table.
>>>>>
>>>>> On the other hand, I think it's reasonable to just avoid the CoW
>>>>> overlay
>>>>> entirely and say that moving to a previous snapshot destroys any of
>>>>> it's
>>>>> children.  I think this ends up being a simplifying assumption that is
>>>>> worth investigating further.
>>>>
>>>> No, both VMware and FVD have the same semantics as QCOW2. Moving to a
>>>> previous snapshot does not destroy any of its children. In the example I
>>>> gave (copied below),
>>>> it goes from
>>>>
>>>> Image: s1->s2->s3->s4->(current-state)
>>>>
>>>> back to snapshot s2, and now the state is
>>>>
>>>> Image: s1->s2->s3->s4
>>>>             |->(curren-state)
>>>>
>>>> where all snapshots s1-s4 are kept. From there, it can take another
>>>> snapshot s5, and then further go back to snapshot s4, ending up with
>>>>
>>>> Image: s1->s2->s3->s4
>>>>             |->s5   |
>>>>                     |->   (current-state)
>>>
>>> Your use of "current-state" is confusing me because AFAICT,
>>> current-state is just semantically another snapshot.
>>>
>>> It's writable because it has no children.  You only keep around one
>>> writable snapshot and to make another snapshot writable, you have to
>>> discard the former.
>>>
>>> This is not the semantics of qcow2.  Every time you create a snapshot,
>>> it's essentially a new image.  You can write directly to it.
>>>
>>> While we don't do this today and I don't think we ever should, it's
>>> entirely possible to have two disks served simultaneously out of the
>>> same qcow2 file using snapshots.
>>
>> No, CQ is describing the semantics of internal snapshots in qcow2
>> correctly. You have all the snapshots that are stored in the snapshot
>> table (all read-only) plus one current state described by the image
>> header (read-write).
>
> But is there any problem (in the format) with writing to the non-current
> state?  I can't think of one.

Here is a problem: there is a single global refcount table in QCOW2.
You need to synchronize updates of the refcounts between multiple
writers to avoid introducing incorrect refcounts.

Stefan

  reply	other threads:[~2011-03-14 15:05 UTC|newest]

Thread overview: 87+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <OF3C9DAE9F.EC6B5878-ON85257826.00715C10-85257826.007A14FB@LocalDomain>
2011-02-15 19:45 ` [Qemu-devel] Re: Comparing New Image Formats: FVD vs. QED Chunqiang Tang
2011-02-16 12:34   ` Kevin Wolf
2011-02-17 16:04     ` Chunqiang Tang
2011-02-18  9:12     ` Strategic decision: COW format (was: [Qemu-devel] Re: Comparing New Image Formats: FVD vs. QED) Markus Armbruster
2011-02-18  9:57       ` [Qemu-devel] Re: Strategic decision: COW format Kevin Wolf
2011-02-18 14:20         ` Anthony Liguori
2011-02-22  8:37           ` Markus Armbruster
2011-02-22  8:56             ` Kevin Wolf
2011-02-22 10:21               ` Markus Armbruster
2011-02-22 15:57               ` Anthony Liguori
2011-02-22 16:15                 ` Kevin Wolf
2011-02-22 18:18                   ` Anthony Liguori
2011-02-23  9:13                     ` Kevin Wolf
2011-02-23 14:21                       ` Anthony Liguori
2011-02-23 14:55                         ` Kevin Wolf
2011-02-23 13:43               ` Avi Kivity
2011-02-23 14:23                 ` Anthony Liguori
2011-02-23 14:38                   ` Kevin Wolf
2011-02-23 15:29                     ` Anthony Liguori
2011-02-23 15:36                       ` Avi Kivity
2011-02-23 15:47                         ` Anthony Liguori
2011-02-23 15:59                           ` Avi Kivity
2011-02-23 15:54                       ` Kevin Wolf
2011-02-23 15:23                   ` Avi Kivity
2011-02-23 15:31                     ` Anthony Liguori
2011-02-23 15:37                       ` Avi Kivity
2011-02-23 15:50                         ` Anthony Liguori
2011-02-23 16:03                           ` Avi Kivity
2011-02-23 16:04                             ` Anthony Liguori
2011-02-23 16:15                               ` Kevin Wolf
2011-02-25 11:20                             ` Pavel Dovgaluk
     [not found]                             ` <-1737654525499315352@unknownmsgid>
2011-02-25 13:22                               ` Stefan Hajnoczi
2011-02-23 15:52                         ` Anthony Liguori
2011-02-23 15:59                           ` Gleb Natapov
2011-02-23 16:00                           ` Avi Kivity
2011-02-23 15:33                     ` Daniel P. Berrange
2011-02-23 15:38                       ` Avi Kivity
2011-02-18 17:43         ` Stefan Weil
2011-02-18 19:11           ` Kevin Wolf
2011-02-18 19:47             ` Anthony Liguori
2011-02-18 20:49               ` Kevin Wolf
2011-02-18 20:50                 ` Anthony Liguori
2011-02-18 21:27                   ` Kevin Wolf
2011-02-19 17:19             ` Stefan Hajnoczi
2011-02-18 20:31           ` Anthony Liguori
2011-02-19 12:27           ` [Qemu-devel] Bugs in the VDI Block Device Driver Chunqiang Tang
2011-02-19 16:21             ` Stefan Hajnoczi
2011-02-19 18:49               ` Stefan Weil
2011-02-20 22:13         ` [Qemu-devel] Re: Strategic decision: COW format Aurelien Jarno
2011-02-21  8:59           ` Kevin Wolf
2011-02-21 13:44             ` Stefan Hajnoczi
2011-02-21 14:10               ` Kevin Wolf
2011-02-21 15:16                 ` Anthony Liguori
2011-02-21 15:26                   ` Kevin Wolf
2011-02-23  3:32               ` Chunqiang Tang
2011-02-23 13:20                 ` Markus Armbruster
     [not found]               ` <OFAEB4CD91.BE989F29-ON8525783F.007366B8-85257840.00130B47@LocalDomain>
2011-03-13  5:51                 ` Chunqiang Tang
2011-03-13 17:48                   ` Anthony Liguori
2011-03-14  2:28                     ` Chunqiang Tang
2011-03-14 13:22                       ` Anthony Liguori
2011-03-14 13:53                         ` Chunqiang Tang
2011-03-14 14:02                           ` Anthony Liguori
2011-03-14 14:21                             ` Kevin Wolf
2011-03-14 14:35                               ` Chunqiang Tang
2011-03-14 14:49                               ` Anthony Liguori
2011-03-14 15:05                                 ` Stefan Hajnoczi [this message]
2011-03-14 15:08                                 ` Kevin Wolf
2011-03-14 14:26                           ` Stefan Hajnoczi
2011-03-14 14:30                             ` Chunqiang Tang
2011-03-14 14:15                         ` Kevin Wolf
2011-03-14 14:25                           ` Chunqiang Tang
2011-03-14 14:31                             ` Stefan Hajnoczi
2011-03-14 16:32                               ` Chunqiang Tang
2011-03-14 17:57                                 ` Kevin Wolf
2011-03-14 19:23                                   ` Chunqiang Tang
2011-03-14 20:16                                     ` Kevin Wolf
     [not found]                               ` <OF7C2FDD40.E76A4E14-ON85257853.005ADD68-85257853.005AF16E@LocalDomain>
2011-03-14 21:32                                 ` Chunqiang Tang
2011-03-14 14:34                             ` Kevin Wolf
2011-03-14 14:47                           ` Anthony Liguori
2011-03-14 15:03                             ` Kevin Wolf
2011-03-14 15:13                               ` Anthony Liguori
2011-03-14 15:04                             ` Chunqiang Tang
2011-03-14 15:07                               ` Stefan Hajnoczi
2011-03-14 10:12                   ` Kevin Wolf
2011-02-22  8:40           ` Markus Armbruster
2011-02-16 13:21   ` [Qemu-devel] Re: Comparing New Image Formats: FVD vs. QED Stefan Hajnoczi
2011-02-17 16:04     ` Chunqiang Tang

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=AANLkTinKpm+WcnJOJKPjNGSFVVOPCL4ak2Aqg+E60SWx@mail.gmail.com \
    --to=stefanha@gmail.com \
    --cc=anthony@codemonkey.ws \
    --cc=armbru@redhat.com \
    --cc=aurelien@aurel32.net \
    --cc=ctang@us.ibm.com \
    --cc=kwolf@redhat.com \
    --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 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).