qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: Liu Yuan <namei.unix@gmail.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
	sheepdog@lists.wpkg.org, qemu-devel@nongnu.org,
	MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Subject: Re: [Qemu-devel] [PATCH v4] sheepdog: fix loadvm operation
Date: Fri, 26 Apr 2013 13:41:14 +0200	[thread overview]
Message-ID: <20130426114114.GC26175@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <1366894179-9350-1-git-send-email-namei.unix@gmail.com>

On Thu, Apr 25, 2013 at 08:49:39PM +0800, Liu Yuan wrote:
> From: Liu Yuan <tailai.ly@taobao.com>
> 
> Currently the 'loadvm' opertaion works as following:
> 1. switch to the snapshot
> 2. mark current working VDI as a snapshot
> 3. rely on sd_create_branch to create a new working VDI based on the snapshot
> 
> This works not the same as other format as QCOW2. For e.g,
> 
> qemu > savevm # get a live snapshot snap1
> qemu > savevm # snap2
> qemu > loadvm 1 # This will steally create snap3 of the working VDI
> 
> Which will result in following snapshot chain:
> 
> base <-- snap1 <-- snap2 <-- snap3
>           ^
>           |
>       working VDI
> 
> snap3 was unnecessarily created and might be annoying users.
> 
> This patch discard the unnecessary 'snap3' creation. and implement
> rollback(loadvm) operation to the specified snapshot by
> 1. switch to the snapshot
> 2. delete working VDI
> 3. rely on sd_create_branch to create a new working VDI based on the snapshot
> 
> The snapshot chain for above example will be:
> 
> base <-- snap1 <-- snap2
>           ^
>           |
>       working VDI
> 
> Cc: qemu-devel@nongnu.org
> Cc: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
> Cc: Kevin Wolf <kwolf@redhat.com>
> Cc: Stefan Hajnoczi <stefanha@redhat.com>
> Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
> ---
> v4:
>  - print an error message when NO_VDI found
> 
> v3:
>  - let boot from snapshot behave like 'loadvm'
> 
> v2:
>  - use do_req() because sd_delete isn't in coroutine
>  - don't break old behavior if we boot up on the snapshot by using s->reverted
>    to indicate if we delete working VDI successfully
>  - fix a subtle case that sd_create_branch() isn't called yet while another
>    'loadvm' is executed
> 
>  block/sheepdog.c |   54 +++++++++++++++++++++++++++++++++++++++++++++++++++++-
>  1 file changed, 53 insertions(+), 1 deletion(-)

Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/block

Stefan

      parent reply	other threads:[~2013-04-26 11:41 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-24 16:47 [Qemu-devel] [PATCH v2] sheepdog: fix loadvm operation Liu Yuan
2013-04-25  4:12 ` Liu Yuan
2013-04-25  8:11   ` [Qemu-devel] [sheepdog] " MORITA Kazutaka
2013-04-25  8:27     ` Liu Yuan
2013-04-25  8:42 ` [Qemu-devel] [PATCH v3] " Liu Yuan
2013-04-25  9:40   ` [Qemu-devel] [sheepdog] " MORITA Kazutaka
2013-04-25  9:44     ` Liu Yuan
2013-04-25 10:03       ` MORITA Kazutaka
2013-04-25 12:32         ` Liu Yuan
2013-04-25 12:49 ` [Qemu-devel] [PATCH v4] " Liu Yuan
2013-04-25 13:06   ` [Qemu-devel] [sheepdog] " MORITA Kazutaka
2013-04-26  9:04     ` Liu Yuan
2013-04-26 11:39       ` Stefan Hajnoczi
2013-04-26 11:48         ` Liu Yuan
2013-04-26 11:41   ` Stefan Hajnoczi [this message]

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=20130426114114.GC26175@stefanha-thinkpad.redhat.com \
    --to=stefanha@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=morita.kazutaka@lab.ntt.co.jp \
    --cc=namei.unix@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=sheepdog@lists.wpkg.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).