[sheepdog] [disscuss] Design of Libsheepdog
MORITA Kazutaka
morita.kazutaka at lab.ntt.co.jp
Thu Jun 27 05:34:09 CEST 2013
At Wed, 26 Jun 2013 10:51:26 +0800,
Kai Zhang wrote:
>
> /* connection */
> int sd_init(char *addr, const sd_t *sd);
I think the syntax of addr needs discussion:
- How to specify a port number?
- How to connect to a unix domain socket?
> int sd_close(sd_t *sd);
>
> /* vdi */
> int sd_vdi_create(sd_t sd, const char *name, size_t size, int copies,
> bool prealloc, const sd_vdi_t *vdi);
> int sd_vdi_clone(sd_t sd, const sd_vdi_t src_vdi, const char *dst_name,
> int copies, const sd_vdi_t *dst_vdi);
The source vdi must be snapshot, so I think we need more arguments to
specify the snapshot tag or index.
> int sd_vdi_open(sd_t sd, const char *name, const sd_vdi_t *vdi);
> int sd_vdi_close(const sd_vdi_t *vdi);
>
> int sd_vdi_read(sd_t sd, const sd_vdi_t vdi, void *data, size_t size,
> size_t offset);
off_t offset?
> int sd_vdi_write(sd_t sd, const sd_vdi_t vdi, void *data, size_t size,
> size_t offset, bool writeback);
Note that we have 3 modes to control cache usage:
- writethough
- writeback
- none (or directsync)
'none' is used to bypass object cache.
> int sd_vdi_resize(sd_t sd, const sd_vdi_t vdi, size_t size);
> int sd_vdi_delete(sd_t sd, const char *name);
> int sd_vdi_setattr(sd_t sd, const char *name, const char *key, void *value,
> size_t value_len);
> int sd_vdi_getattr(sd_t sd, const char *name, const char *key, void *value,
> size_t value_len);
How to delete vdi attributes?
> int sd_vdi_list(sd_t sd, string_iterator *si);
>
> /* snapshot */
> int sd_vdi_snap_create(sd_t sd, const sd_vdi_t vdi, const char *tag,
> const sd_vdi_t snap_vdi);
> int sd_vdi_snap_open(sd_t sd, const char *name, const char *tag, int idx,
> const sd_vdi_t *snap_vdi);
> int sd_vdi_snap_rollback(sd_t sd, const sd_vdi_t vdi);
> int sd_vdi_snap_read(sd_t sd, const sd_vdi_t vdi, void *data, size_t size,
> size_t offset);
sd_snapshot_*() looks simpler?
Thanks,
Kazutaka
More information about the sheepdog
mailing list