All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Chunyan Liu <cyliu@suse.com>
Cc: ian.jackson@eu.citrix.com, jfehlig@suse.com, wei.liu2@citrix.com,
	xen-devel@lists.xen.org
Subject: Re: [RFC V9 4/4] domain snapshot design: libxl/libxlu
Date: Thu, 18 Dec 2014 15:27:16 +0000	[thread overview]
Message-ID: <1418916436.11882.101.camel@citrix.com> (raw)
In-Reply-To: <1418711577-15449-5-git-send-email-cyliu@suse.com>

On Tue, 2014-12-16 at 14:32 +0800, Chunyan Liu wrote:
> Changes to V8:
>   * remove libxl_domain_snapshot_create/delete/revert API
>   * export disk snapshot functionality for both xl and libvirt usage
> 
> ===========================================================================
> Libxl/libxlu Design
> 
> 1. New Structures
> 
> libxl_disk_snapshot = Struct("disk_snapshot",[
>     # target disk
>     ("disk",            libxl_device_disk),
> 
>     # disk snapshot name
>     ("name",            string),
> 
>     # internal/external disk snapshot?
>     ("external",        bool),
> 
>     # for external disk snapshot, specify following two field
>     ("external_format", string),
>     ("external_path",   string),

Should this be a KeyedUnion over a new LIBXL_DISK_SNAPSHOT_KIND enum
(with values INTERNAL and EXTERNAL)? This would automatically make the
binding between external==true and the fields which depend on that.

external_format should be of type libxl_disk_format, unless it is
referring to something else?

Is it possible for format to differ from the format of the underlying
disk? Perhaps taking a snapshot of a raw disk as a qcow? In any case
passing in UNKNOWN and letting libxl choose (probably by picking the
same as the underlying disk) should be supported.

> /*  This API might not be used by xl, since xl won't take care of deleting
>  *  snapshots. But for libvirt, since libvirt manages snapshots and will
>  *  delete snapshot, this API will be used.
>  */
> int libxl_disk_snapshot_delete(libxl_ctx *ctx, uint32_t domid,
>                                libxl_disk_snapshot *snapshot, int nb);

The three usecases I mentioned in the previous mail are important here,
because depending on which usecases you are considering there maybe a
many to one relationship between domains and a given snapshot (gold
image case). This interface cannot support that I think.

When we discussed this in previous iterations I suggested a libxl
command to tell a VM that it needed to reexamine its disks to see if any
of the chains had changed. I'm sure that's not the only potential answer
though.

> int libxl_disk_to_snapshot(libxl_ctx *ctx, uint32_t domid,
>                            libxl_disk_snapshot **snapshot, int *num);
> 
>     This is for domain snapshot create. If user doesn't specify disks,
>     then by default it will take internal disk snapshot to each domain
>     disk. This function will fill libxl_disk_snapshot according to domain
>     disks info.

Is this just a helper to produce an array to pass to
libxl_disk_snapshot_create? Or does it actually do stuff?

I think it's the former, but it could be clarified. I *think* this is
just a special case of libxl_device_disk_list which returns plausible
snapshot objects instead of the disks themselves.
> 
> For disk snapshot revert, no qmp command for that, it always calls
> external commands to finish the work, so put in libxlu (?):

I think rather than "no qmp" the issue is that "revert" is (at least as
far as libxl knows) essentially, destroy, rollback disks, restore from
RAM snapshot. So there is no qemu to speak to during the rollback. Is
that right?

Ian.

  parent reply	other threads:[~2014-12-18 15:27 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-16  6:32 [RFC V9 0/4] domain snapshot document Chunyan Liu
2014-12-16  6:32 ` [RFC V9 1/4] domain snapshot terms Chunyan Liu
2014-12-18 15:05   ` Ian Campbell
2014-12-19  2:46     ` Chun Yan Liu
2014-12-16  6:32 ` [RFC V9 2/4] domain snapshot overview Chunyan Liu
2014-12-17 12:17   ` Wei Liu
2014-12-18  3:34     ` Chun Yan Liu
2014-12-18 10:57       ` Wei Liu
2014-12-18 15:10   ` Ian Campbell
2014-12-19  5:45     ` Chun Yan Liu
2014-12-19 10:25       ` Ian Campbell
2014-12-23  3:42         ` Chun Yan Liu
2015-01-08 12:26           ` Ian Campbell
2015-01-12  7:01             ` Chun Yan Liu
2015-01-12 13:54               ` Ian Campbell
2015-01-14  3:12                 ` Chun Yan Liu
2014-12-16  6:32 ` [RFC V9 3/4] domain snapshot design: xl Chunyan Liu
2014-12-17 12:28   ` Wei Liu
2014-12-18  3:23     ` Chun Yan Liu
2014-12-18 11:02       ` Wei Liu
2014-12-18 15:15   ` Ian Campbell
2014-12-19  7:03     ` Chun Yan Liu
2014-12-19 10:27       ` Ian Campbell
2014-12-22  8:52         ` Chun Yan Liu
2015-01-08 11:59           ` Ian Campbell
2014-12-16  6:32 ` [RFC V9 4/4] domain snapshot design: libxl/libxlu Chunyan Liu
2014-12-17 14:09   ` Wei Liu
2014-12-18  3:01     ` Chun Yan Liu
2014-12-18 15:27   ` Ian Campbell [this message]
2014-12-19  6:58     ` Chun Yan Liu
2014-12-19 10:38       ` Ian Campbell
2014-12-22  9:36         ` Chun Yan Liu
2014-12-22  9:36         ` [Qemu-devel] " Chun Yan Liu
2015-01-08 12:11           ` Ian Campbell
2015-01-08 12:11           ` [Qemu-devel] " Ian Campbell
2015-01-09  9:59             ` Chun Yan Liu
2015-01-09  9:59               ` Chun Yan Liu
2014-12-22  9:53         ` Chun Yan Liu

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=1418916436.11882.101.camel@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=cyliu@suse.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jfehlig@suse.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.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.