null.c (fcb7e040f5c69ca1f0678f991ab5354488a9e192) null.c (c86422c5549c0983b4b4525b8f56a1c69dd67aa1)
1/*
2 * Null block driver
3 *
4 * Authors:
5 * Fam Zheng <famz@redhat.com>
6 *
7 * Copyright (C) 2014 Red Hat, Inc.
8 *

--- 86 unchanged lines hidden (view full) ---

95 ret = -EINVAL;
96 }
97 s->read_zeroes = qemu_opt_get_bool(opts, NULL_OPT_ZEROES, false);
98 qemu_opts_del(opts);
99 bs->supported_write_flags = BDRV_REQ_FUA;
100 return ret;
101}
102
1/*
2 * Null block driver
3 *
4 * Authors:
5 * Fam Zheng <famz@redhat.com>
6 *
7 * Copyright (C) 2014 Red Hat, Inc.
8 *

--- 86 unchanged lines hidden (view full) ---

95 ret = -EINVAL;
96 }
97 s->read_zeroes = qemu_opt_get_bool(opts, NULL_OPT_ZEROES, false);
98 qemu_opts_del(opts);
99 bs->supported_write_flags = BDRV_REQ_FUA;
100 return ret;
101}
102
103static int64_t null_getlength(BlockDriverState *bs)
103static int64_t coroutine_fn null_co_getlength(BlockDriverState *bs)
104{
105 BDRVNullState *s = bs->opaque;
106 return s->length;
107}
108
109static coroutine_fn int null_co_common(BlockDriverState *bs)
110{
111 BDRVNullState *s = bs->opaque;

--- 167 unchanged lines hidden (view full) ---

279
280static BlockDriver bdrv_null_co = {
281 .format_name = "null-co",
282 .protocol_name = "null-co",
283 .instance_size = sizeof(BDRVNullState),
284
285 .bdrv_file_open = null_file_open,
286 .bdrv_parse_filename = null_co_parse_filename,
104{
105 BDRVNullState *s = bs->opaque;
106 return s->length;
107}
108
109static coroutine_fn int null_co_common(BlockDriverState *bs)
110{
111 BDRVNullState *s = bs->opaque;

--- 167 unchanged lines hidden (view full) ---

279
280static BlockDriver bdrv_null_co = {
281 .format_name = "null-co",
282 .protocol_name = "null-co",
283 .instance_size = sizeof(BDRVNullState),
284
285 .bdrv_file_open = null_file_open,
286 .bdrv_parse_filename = null_co_parse_filename,
287 .bdrv_getlength = null_getlength,
287 .bdrv_co_getlength = null_co_getlength,
288 .bdrv_get_allocated_file_size = null_allocated_file_size,
289
290 .bdrv_co_preadv = null_co_preadv,
291 .bdrv_co_pwritev = null_co_pwritev,
292 .bdrv_co_flush_to_disk = null_co_flush,
293 .bdrv_reopen_prepare = null_reopen_prepare,
294
295 .bdrv_co_block_status = null_co_block_status,

--- 4 unchanged lines hidden (view full) ---

300
301static BlockDriver bdrv_null_aio = {
302 .format_name = "null-aio",
303 .protocol_name = "null-aio",
304 .instance_size = sizeof(BDRVNullState),
305
306 .bdrv_file_open = null_file_open,
307 .bdrv_parse_filename = null_aio_parse_filename,
288 .bdrv_get_allocated_file_size = null_allocated_file_size,
289
290 .bdrv_co_preadv = null_co_preadv,
291 .bdrv_co_pwritev = null_co_pwritev,
292 .bdrv_co_flush_to_disk = null_co_flush,
293 .bdrv_reopen_prepare = null_reopen_prepare,
294
295 .bdrv_co_block_status = null_co_block_status,

--- 4 unchanged lines hidden (view full) ---

300
301static BlockDriver bdrv_null_aio = {
302 .format_name = "null-aio",
303 .protocol_name = "null-aio",
304 .instance_size = sizeof(BDRVNullState),
305
306 .bdrv_file_open = null_file_open,
307 .bdrv_parse_filename = null_aio_parse_filename,
308 .bdrv_getlength = null_getlength,
308 .bdrv_co_getlength = null_co_getlength,
309 .bdrv_get_allocated_file_size = null_allocated_file_size,
310
311 .bdrv_aio_preadv = null_aio_preadv,
312 .bdrv_aio_pwritev = null_aio_pwritev,
313 .bdrv_aio_flush = null_aio_flush,
314 .bdrv_reopen_prepare = null_reopen_prepare,
315
316 .bdrv_co_block_status = null_co_block_status,

--- 12 unchanged lines hidden ---
309 .bdrv_get_allocated_file_size = null_allocated_file_size,
310
311 .bdrv_aio_preadv = null_aio_preadv,
312 .bdrv_aio_pwritev = null_aio_pwritev,
313 .bdrv_aio_flush = null_aio_flush,
314 .bdrv_reopen_prepare = null_reopen_prepare,
315
316 .bdrv_co_block_status = null_co_block_status,

--- 12 unchanged lines hidden ---