[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v7 28/47] block/null: Implement bdrv_get_allocated_file_size
From: |
Max Reitz |
Subject: |
[PATCH v7 28/47] block/null: Implement bdrv_get_allocated_file_size |
Date: |
Thu, 25 Jun 2020 17:21:56 +0200 |
It is trivial, so we might as well do it.
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
block/null.c | 7 +++++++
tests/qemu-iotests/153.out | 2 +-
tests/qemu-iotests/184.out | 6 ++++--
3 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/block/null.c b/block/null.c
index 15e1d56746..cc9b1d4ea7 100644
--- a/block/null.c
+++ b/block/null.c
@@ -262,6 +262,11 @@ static void null_refresh_filename(BlockDriverState *bs)
bs->drv->format_name);
}
+static int64_t null_allocated_file_size(BlockDriverState *bs)
+{
+ return 0;
+}
+
static const char *const null_strong_runtime_opts[] = {
BLOCK_OPT_SIZE,
NULL_OPT_ZEROES,
@@ -277,6 +282,7 @@ static BlockDriver bdrv_null_co = {
.bdrv_file_open = null_file_open,
.bdrv_parse_filename = null_co_parse_filename,
.bdrv_getlength = null_getlength,
+ .bdrv_get_allocated_file_size = null_allocated_file_size,
.bdrv_co_preadv = null_co_preadv,
.bdrv_co_pwritev = null_co_pwritev,
@@ -297,6 +303,7 @@ static BlockDriver bdrv_null_aio = {
.bdrv_file_open = null_file_open,
.bdrv_parse_filename = null_aio_parse_filename,
.bdrv_getlength = null_getlength,
+ .bdrv_get_allocated_file_size = null_allocated_file_size,
.bdrv_aio_preadv = null_aio_preadv,
.bdrv_aio_pwritev = null_aio_pwritev,
diff --git a/tests/qemu-iotests/153.out b/tests/qemu-iotests/153.out
index b2a90caa6b..8659e6463b 100644
--- a/tests/qemu-iotests/153.out
+++ b/tests/qemu-iotests/153.out
@@ -461,7 +461,7 @@ No conflict:
image: null-co://
file format: null-co
virtual size: 1 GiB (1073741824 bytes)
-disk size: unavailable
+disk size: 0 B
Conflict:
qemu-img: --force-share/-U conflicts with image options
diff --git a/tests/qemu-iotests/184.out b/tests/qemu-iotests/184.out
index 3deb3cfb94..28b104da89 100644
--- a/tests/qemu-iotests/184.out
+++ b/tests/qemu-iotests/184.out
@@ -29,7 +29,8 @@ Testing:
"image": {
"virtual-size": 1073741824,
"filename": "json:{\"throttle-group\": \"group0\", \"driver\":
\"throttle\", \"file\": {\"driver\": \"null-co\"}}",
- "format": "throttle"
+ "format": "throttle",
+ "actual-size": SIZE
},
"iops_wr": 0,
"ro": false,
@@ -56,7 +57,8 @@ Testing:
"image": {
"virtual-size": 1073741824,
"filename": "null-co://",
- "format": "null-co"
+ "format": "null-co",
+ "actual-size": SIZE
},
"iops_wr": 0,
"ro": false,
--
2.26.2
- [PATCH v7 17/47] block: Re-evaluate backing file handling in reopen, (continued)
- [PATCH v7 17/47] block: Re-evaluate backing file handling in reopen, Max Reitz, 2020/06/25
- [PATCH v7 21/47] block: Use CAFs in bdrv_refresh_filename(), Max Reitz, 2020/06/25
- [PATCH v7 20/47] block: Iterate over children in refresh_limits, Max Reitz, 2020/06/25
- [PATCH v7 22/47] block: Use CAF in bdrv_co_rw_vmstate(), Max Reitz, 2020/06/25
- [PATCH v7 23/47] block/snapshot: Fix fallback, Max Reitz, 2020/06/25
- [PATCH v7 24/47] block: Use CAFs for debug breakpoints, Max Reitz, 2020/06/25
- [PATCH v7 25/47] block: Def. impl.s for get_allocated_file_size, Max Reitz, 2020/06/25
- [PATCH v7 27/47] blkverify: Use bdrv_sum_allocated_file_size(), Max Reitz, 2020/06/25
- [PATCH v7 29/47] blockdev: Use CAF in external_snapshot_prepare(), Max Reitz, 2020/06/25
- [PATCH v7 32/47] block-copy: Use CAF to find sync=top base, Max Reitz, 2020/06/25
- [PATCH v7 28/47] block/null: Implement bdrv_get_allocated_file_size,
Max Reitz <=
- [PATCH v7 26/47] block: Improve get_allocated_file_size's default, Max Reitz, 2020/06/25
- [PATCH v7 30/47] block: Report data child for query-blockstats, Max Reitz, 2020/06/25
- [PATCH v7 31/47] block: Use child access functions for QAPI queries, Max Reitz, 2020/06/25
- [PATCH v7 33/47] mirror: Deal with filters, Max Reitz, 2020/06/25
- [PATCH v7 36/47] nbd: Use CAF when looking for dirty bitmap, Max Reitz, 2020/06/25
- [PATCH v7 35/47] commit: Deal with filters, Max Reitz, 2020/06/25
- [PATCH v7 34/47] backup: Deal with filters, Max Reitz, 2020/06/25
- [PATCH v7 38/47] block: Drop backing_bs(), Max Reitz, 2020/06/25
- [PATCH v7 37/47] qemu-img: Use child access functions, Max Reitz, 2020/06/25
- [PATCH v7 41/47] block: Leave BDS.backing_file constant, Max Reitz, 2020/06/25