static int do_save_vmstate(char *buf, int64_t offset, int count, int *total) { *total = bdrv_save_vmstate(bs, (uint8_t *)buf, offset, count); if (*total < 0) return *total; return 1; }
static void test_sync_op_save_vmstate(BdrvChild *c) { uint8_t buf[512]; int ret; /* Error: Driver does not support snapshots */ ret = bdrv_save_vmstate(c->bs, buf, 0, sizeof(buf)); g_assert_cmpint(ret, ==, -ENOTSUP); }
static int block_put_buffer(void *opaque, const uint8_t *buf, int64_t pos, int size) { bdrv_save_vmstate(opaque, buf, pos, size); return size; }