[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [RFC V10 4/4] domain snapshot design: libxl




>>> On 1/30/2015 at 12:41 AM, in message <1422549669.10225.0.camel@xxxxxxxxxx>, 
>>> Ian
Campbell <Ian.Campbell@xxxxxxxxxx> wrote: 
> On Mon, 2015-01-26 at 11:25 +0800, Chunyan Liu wrote: 
> > Changes to V9: 
> >   * update libxl_disk_snapshot structures as Ian suggests 
> >   * add more descriptions for libxl_disk_snapshot_delete 
> >   * add two functions for deleting external disk snapshot: 
> >     libxl_domain_block_rebase and libxl_domain_block_commit 
> >  
> > =========================================================================== 
> >  
> > Libxl Design 
> >  
> > 1. New Structures 
> >  
> > libxl_disk_snapshot_type = Struct("disk_snapshot_type", [ 
> >     (0, "default"), 
>  
> How is default handled wrt the keyed union? In particualr if default 
> turns out to mean external, then external_path would need to be non-null 
> -- how is that fabricated? 
>  
> Or did you mean s/default/unknown/ suggesting this would be an illegal 
> input? 

Yeah, it means invalid input. Should be 'unknown'. Will change.

>  
> >     (1, "internal"), 
> >     (2, "external"), 
> >     ]) 
> >  
> > libxl_disk_snapshot = Struct("disk_snapshot",[ 
> >     # target disk 
> >     ("disk",            libxl_device_disk), 
> >  
> >     # disk snapshot name 
> >     ("name",            string), 
> >  
> >     ("u", KeyedUnion(None, libxl_disk_snapshot_type, "type", 
> >          [("external", Struct(None, [ 
> >  
> >             # disk format for external files. Since external disk snapshot  
> is 
> >             # implemented with backing file mechanism, the external file  
> disk 
> >             # format must support backing file. This field can be NULL,  
> then 
> >             # a proper disk format will be used by default according to the 
> >             # orignal disk format. 
> >             ("external_format", libxl_disk_format), 
> >  
> >             # external file path. This field should be non-NULL and a new  
> path. 
> >             ("external_path",   string), 
> >             ])) 
> >          ])) 
> >     ]) 
> >  
> >  
> > 2. New Functions 
> [...] 
>  
> > /** 
> >  * libxl_disk_to_snapshot: 
> >  * @snapshot: array of disk snapshot configuration. Has "nb" members. 
> >  * @nb: number of disks. 
> >  * @ctx: libxl context 
> >  * @domid: domain id 
> >  * @snapshot (OUTPUT): array of disk snapshot configuration. 
> >  * @num (OUTPUT): number of disks. 
>  
> @nb must equal @num, perhaps you actually meant for this to be an IN/OUT 
> parameter along with @snapshot instead of passing an IN array and an OUT 
> array? 
>  
> >  * 
> >  * Helper function to produce an array of libxl_disk_snapshot. 
> >  * 
> >  * Could be used when user doesn't specify disk snapshot information 
> >  * in creating a domain snapshot, it will by default fill disk snapshot 
> >  * information according to domain disks: 
> >  *   By default it will take internal disk snapshot to each domain 
> >  *   disk that could take internal disk snapshot, otherwise, take 
> >  *   external disk snapshot. 
>  
> How does this function determine the external path? 

Meant to let user to fill in snapshot name and external path after calling this
to set default. But yes, it's better to do all work in this function. Will add
two parameters 'path' and 'name'.
Then it will be:
int libxl_disk_to_snapshot(libxl_ctx *ctx, uint32_t domid,
                           const char *path, const char *name,
                           libxl_disk_snapshot **snapshot, int *num)

@path: path to store vm snapshot data. @path can be NULL if all disks
           support internal disk snapshots; otherwise, @path shouldn't be
           NULL.
@name: vm snapshot name. All disks will use this name as disk snapshot
           name, external disk snapshot will use this name to generate external
           file name.

Thanks!

- Chunyan

>  
>  
>  
>  


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.