[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [RFC PATCH 11/11] qcow2: Add data file to ImageInfoSpecific
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [RFC PATCH 11/11] qcow2: Add data file to ImageInfoSpecificQCow2 |
Date: |
Thu, 31 Jan 2019 18:55:49 +0100 |
Signed-off-by: Kevin Wolf <address@hidden>
---
qapi/block-core.json | 1 +
block/qcow2.c | 6 +++++-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/qapi/block-core.json b/qapi/block-core.json
index 060df28797..0eb0637b64 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -74,6 +74,7 @@
{ 'struct': 'ImageInfoSpecificQCow2',
'data': {
'compat': 'str',
+ '*data-file': 'str',
'*lazy-refcounts': 'bool',
'*corrupt': 'bool',
'refcount-bits': 'int',
diff --git a/block/qcow2.c b/block/qcow2.c
index 4959bf16a4..e3427f9fcd 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -1459,7 +1459,9 @@ static int coroutine_fn qcow2_do_open(BlockDriverState
*bs, QDict *options,
if (s->incompatible_features & QCOW2_INCOMPAT_DATA_FILE) {
s->data_file = bdrv_open_child(NULL, options, "data-file", bs,
&child_file, false, &local_err);
- if (!s->data_file) {
+ if (s->data_file) {
+ s->image_data_file = g_strdup(s->data_file->bs->filename);
+ } else {
if (s->image_data_file) {
error_free(local_err);
local_err = NULL;
@@ -4533,6 +4535,8 @@ static ImageInfoSpecific
*qcow2_get_specific_info(BlockDriverState *bs)
QCOW2_INCOMPAT_CORRUPT,
.has_corrupt = true,
.refcount_bits = s->refcount_bits,
+ .has_data_file = !!s->image_data_file,
+ .data_file = g_strdup(s->image_data_file),
};
} else {
/* if this assertion fails, this probably means a new version was
--
2.20.1
- Re: [Qemu-block] [RFC PATCH 01/11] qcow2: Extend spec for external data files, (continued)
- [Qemu-block] [RFC PATCH 03/11] qcow2: Pass bs to qcow2_get_cluster_type(), Kevin Wolf, 2019/01/31
- [Qemu-block] [RFC PATCH 04/11] qcow2: Prepare qcow2_get_cluster_type() for external data file, Kevin Wolf, 2019/01/31
- [Qemu-block] [RFC PATCH 05/11] qcow2: Prepare count_contiguous_clusters() for external data file, Kevin Wolf, 2019/01/31
- [Qemu-block] [RFC PATCH 06/11] qcow2: Don't assume 0 is an invalid cluster offset, Kevin Wolf, 2019/01/31
- [Qemu-block] [RFC PATCH 07/11] qcow2: External file I/O, Kevin Wolf, 2019/01/31
- [Qemu-block] [RFC PATCH 08/11] qcow2: Add basic data-file infrastructure, Kevin Wolf, 2019/01/31
- [Qemu-block] [RFC PATCH 09/11] qcow2: Creating images with external data file, Kevin Wolf, 2019/01/31
- [Qemu-block] [RFC PATCH 11/11] qcow2: Add data file to ImageInfoSpecificQCow2,
Kevin Wolf <=
- [Qemu-block] [RFC PATCH 10/11] qcow2: Store data file name in the image, Kevin Wolf, 2019/01/31
- Re: [Qemu-block] [RFC PATCH 00/11] qcow2: External data files, Nir Soffer, 2019/01/31