VIRTUTECH CONFIDENTIAL Previous - Up - Next
image
- Implemented By
-
image
- Description
-
This interface is used for handling big data images.
read() and write access a block of data at a time.
Iteration over all pages can be done with for_all_spages().
The iteration stops when f() returns non-zero,
and the return value from for_all_spages() is the last return
value from the callback function.
typedef uint64 vdisk_addr_t;
typedef struct image_interface {
void (*read)(conf_object_t *img, void *to_buf, vdisk_addr_t start,
size_t length);
void (*write)(conf_object_t *img, void *from_buf, vdisk_addr_t start,
size_t length);
int (*for_all_spages)(conf_object_t *img,
int (*f)(image_spage_t *, vdisk_addr_t, void *),
void *arg);
void (*set_persistent)(conf_object_t *obj);
void (*save_to_file)(conf_object_t *NOTNULL obj,
const char *NOTNULL file,
uint64 start, uint64 length);
void (*save_diff)(conf_object_t *NOTNULL obj,
const char *NOTNULL file);
void (*clear_range)(conf_object_t *NOTNULL obj,
uint64 start, uint64 length);
} image_interface_t;
VIRTUTECH CONFIDENTIAL Previous - Up - Next