[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PATCH 12/20] qcow2: Return error for snapshot operation wi
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PATCH 12/20] qcow2: Return error for snapshot operation with data file |
Date: |
Wed, 27 Feb 2019 18:22:48 +0100 |
Internal snapshots and an external data file are incompatible because
snapshots require refcounting and non-linear mapping. Return an error
for all of the snapshot operations if an external data file is in use.
Signed-off-by: Kevin Wolf <address@hidden>
---
block/qcow2-snapshot.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/block/qcow2-snapshot.c b/block/qcow2-snapshot.c
index 5ae3407f68..a6ffae89a6 100644
--- a/block/qcow2-snapshot.c
+++ b/block/qcow2-snapshot.c
@@ -353,6 +353,10 @@ int qcow2_snapshot_create(BlockDriverState *bs,
QEMUSnapshotInfo *sn_info)
return -EFBIG;
}
+ if (has_data_file(bs)) {
+ return -ENOTSUP;
+ }
+
memset(sn, 0, sizeof(*sn));
/* Generate an ID */
@@ -466,6 +470,10 @@ int qcow2_snapshot_goto(BlockDriverState *bs, const char
*snapshot_id)
int ret;
uint64_t *sn_l1_table = NULL;
+ if (has_data_file(bs)) {
+ return -ENOTSUP;
+ }
+
/* Search the snapshot */
snapshot_index = find_snapshot_by_id_or_name(bs, snapshot_id);
if (snapshot_index < 0) {
@@ -599,6 +607,10 @@ int qcow2_snapshot_delete(BlockDriverState *bs,
QCowSnapshot sn;
int snapshot_index, ret;
+ if (has_data_file(bs)) {
+ return -ENOTSUP;
+ }
+
/* Search the snapshot */
snapshot_index = find_snapshot_by_id_and_name(bs, snapshot_id, name);
if (snapshot_index < 0) {
@@ -670,6 +682,9 @@ int qcow2_snapshot_list(BlockDriverState *bs,
QEMUSnapshotInfo **psn_tab)
QCowSnapshot *sn;
int i;
+ if (has_data_file(bs)) {
+ return -ENOTSUP;
+ }
if (!s->nb_snapshots) {
*psn_tab = NULL;
return s->nb_snapshots;
--
2.20.1
- [Qemu-block] [PATCH 13/20] qcow2: Support external data file in qemu-img check, (continued)
- [Qemu-block] [PATCH 13/20] qcow2: Support external data file in qemu-img check, Kevin Wolf, 2019/02/27
- [Qemu-block] [PATCH 14/20] qcow2: Add basic data-file infrastructure, Kevin Wolf, 2019/02/27
- [Qemu-block] [PATCH 02/20] qcow2: Simplify preallocation code, Kevin Wolf, 2019/02/27
- [Qemu-block] [PATCH 09/20] qcow2: Return 0/-errno in qcow2_alloc_compressed_cluster_offset(), Kevin Wolf, 2019/02/27
- [Qemu-block] [PATCH 18/20] qemu-iotests: Preallocation with external data file, Kevin Wolf, 2019/02/27
- [Qemu-block] [PATCH 07/20] qcow2: Prepare count_contiguous_clusters() for external data file, Kevin Wolf, 2019/02/27
- [Qemu-block] [PATCH 10/20] qcow2: Prepare qcow2_co_block_status() for data file, Kevin Wolf, 2019/02/27
- [Qemu-block] [PATCH 08/20] qcow2: Don't assume 0 is an invalid cluster offset, Kevin Wolf, 2019/02/27
- [Qemu-block] [PATCH 20/20] qemu-iotests: amend with external data file, Kevin Wolf, 2019/02/27
- [Qemu-block] [PATCH 04/20] qcow2: Basic definitions for external data files, Kevin Wolf, 2019/02/27
- [Qemu-block] [PATCH 12/20] qcow2: Return error for snapshot operation with data file,
Kevin Wolf <=
- [Qemu-block] [PATCH 15/20] qcow2: Creating images with external data file, Kevin Wolf, 2019/02/27
- [Qemu-block] [PATCH 16/20] qcow2: Store data file name in the image, Kevin Wolf, 2019/02/27
- [Qemu-block] [PATCH 11/20] qcow2: External file I/O, Kevin Wolf, 2019/02/27
- [Qemu-block] [PATCH 17/20] qcow2: Implement data-file-raw create option, Kevin Wolf, 2019/02/27
- [Qemu-block] [PATCH 19/20] qemu-iotests: General tests for qcow2 with external data file, Kevin Wolf, 2019/02/27