static int do_co_write_zeroes(int64_t offset, int count, int *total) { Coroutine *co; CoWriteZeroes data = { .offset = offset, .count = count, .total = total, .done = false, }; co = qemu_coroutine_create(co_write_zeroes_entry); qemu_coroutine_enter(co, &data); while (!data.done) { qemu_aio_wait(); } if (data.ret < 0) { return data.ret; } else { return 1; } } static int do_load_vmstate(char *buf, int64_t offset, int count, int *total) { *total = bdrv_load_vmstate(bs, (uint8_t *)buf, offset, count); if (*total < 0) { return *total; } return 1; }
static int do_load_vmstate(char *buf, int64_t offset, int count, int *total) { *total = bdrv_load_vmstate(bs, (uint8_t *)buf, offset, count); if (*total < 0) return *total; return 1; }
static void test_sync_op_load_vmstate(BdrvChild *c) { uint8_t buf[512]; int ret; /* Error: Driver does not support snapshots */ ret = bdrv_load_vmstate(c->bs, buf, 0, sizeof(buf)); g_assert_cmpint(ret, ==, -ENOTSUP); }
static int block_get_buffer(void *opaque, uint8_t *buf, int64_t pos, int size) { return bdrv_load_vmstate(opaque, buf, pos, size); }