dd7aef2877
- kvm-block-nbd-Fix-hang-in-.bdrv_close.patch [bz#1640894] - kvm-block-Generic-file-creation-fallback.patch [bz#1640894] - kvm-file-posix-Drop-hdev_co_create_opts.patch [bz#1640894] - kvm-iscsi-Drop-iscsi_co_create_opts.patch [bz#1640894] - kvm-iotests-Add-test-for-image-creation-fallback.patch [bz#1640894] - kvm-block-Fix-leak-in-bdrv_create_file_fallback.patch [bz#1640894] - kvm-iotests-Use-complete_and_wait-in-155.patch [bz#1790482 bz#1805143] - kvm-block-Introduce-bdrv_reopen_commit_post-step.patch [bz#1790482 bz#1805143] - kvm-block-qcow2-Move-bitmap-reopen-into-bdrv_reopen_comm.patch [bz#1790482 bz#1805143] - kvm-iotests-Refactor-blockdev-reopen-test-for-iothreads.patch [bz#1790482 bz#1805143] - kvm-block-bdrv_reopen-with-backing-file-in-different-Aio.patch [bz#1790482 bz#1805143] - kvm-block-Versioned-x-blockdev-reopen-API-with-feature-f.patch [bz#1790482 bz#1805143] - kvm-block-Make-bdrv_get_cumulative_perm-public.patch [bz#1790482 bz#1805143] - kvm-block-Relax-restrictions-for-blockdev-snapshot.patch [bz#1790482 bz#1805143] - kvm-iotests-Fix-run_job-with-use_log-False.patch [bz#1790482 bz#1805143] - kvm-iotests-Test-mirror-with-temporarily-disabled-target.patch [bz#1790482 bz#1805143] - kvm-block-Fix-cross-AioContext-blockdev-snapshot.patch [bz#1790482 bz#1805143] - kvm-iotests-Add-iothread-cases-to-155.patch [bz#1790482 bz#1805143] - kvm-qapi-Add-allow-write-only-overlay-feature-for-blockd.patch [bz#1790482 bz#1805143] - kvm-exec-rom_reset-Free-rom-data-during-inmigrate-skip.patch [bz#1809380] - Resolves: bz#1640894 (Fix generic file creation fallback for qemu-img nvme:// image creation support) - Resolves: bz#1790482 (bitmaps in backing images can't be modified) - Resolves: bz#1805143 (allow late/lazy opening of backing chain for shallow blockdev-mirror) - Resolves: bz#1809380 (guest hang during reboot process after migration from RHEl7.8 to RHEL8.2.0.)
79 lines
2.8 KiB
Diff
79 lines
2.8 KiB
Diff
From ec5408763c49cd0b63ee324bdc38a429ed1adeee Mon Sep 17 00:00:00 2001
|
|
From: Kevin Wolf <kwolf@redhat.com>
|
|
Date: Fri, 13 Mar 2020 12:34:29 +0000
|
|
Subject: [PATCH 09/20] block/qcow2: Move bitmap reopen into
|
|
bdrv_reopen_commit_post
|
|
|
|
RH-Author: Kevin Wolf <kwolf@redhat.com>
|
|
Message-id: <20200313123439.10548-4-kwolf@redhat.com>
|
|
Patchwork-id: 94280
|
|
O-Subject: [RHEL-AV-8.2.0 qemu-kvm PATCH v2 03/13] block/qcow2: Move bitmap reopen into bdrv_reopen_commit_post
|
|
Bugzilla: 1790482 1805143
|
|
RH-Acked-by: John Snow <jsnow@redhat.com>
|
|
RH-Acked-by: Daniel P. Berrange <berrange@redhat.com>
|
|
RH-Acked-by: Peter Krempa <pkrempa@redhat.com>
|
|
|
|
From: Peter Krempa <pkrempa@redhat.com>
|
|
|
|
The bitmap code requires writing the 'file' child when the qcow2 driver
|
|
is reopened in read-write mode.
|
|
|
|
If the 'file' child is being reopened due to a permissions change, the
|
|
modification is commited yet when qcow2_reopen_commit is called. This
|
|
means that any attempt to write the 'file' child will end with EBADFD
|
|
as the original fd was already closed.
|
|
|
|
Moving bitmap reopening to the new callback which is called after
|
|
permission modifications are commited fixes this as the file descriptor
|
|
will be replaced with the correct one.
|
|
|
|
The above problem manifests itself when reopening 'qcow2' format layer
|
|
which uses a 'file-posix' file child which was opened with the
|
|
'auto-read-only' property set.
|
|
|
|
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
|
Message-Id: <db118dbafe1955afbc0a18d3dd220931074ce349.1582893284.git.pkrempa@redhat.com>
|
|
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
|
(cherry picked from commit 65eb7c85a3e62529e2bad782e94d5a7b11dd5a92)
|
|
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
|
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
|
|
---
|
|
block/qcow2.c | 7 ++++++-
|
|
1 file changed, 6 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/block/qcow2.c b/block/qcow2.c
|
|
index 7c18721..83b1fc0 100644
|
|
--- a/block/qcow2.c
|
|
+++ b/block/qcow2.c
|
|
@@ -1881,6 +1881,11 @@ fail:
|
|
static void qcow2_reopen_commit(BDRVReopenState *state)
|
|
{
|
|
qcow2_update_options_commit(state->bs, state->opaque);
|
|
+ g_free(state->opaque);
|
|
+}
|
|
+
|
|
+static void qcow2_reopen_commit_post(BDRVReopenState *state)
|
|
+{
|
|
if (state->flags & BDRV_O_RDWR) {
|
|
Error *local_err = NULL;
|
|
|
|
@@ -1895,7 +1900,6 @@ static void qcow2_reopen_commit(BDRVReopenState *state)
|
|
bdrv_get_node_name(state->bs));
|
|
}
|
|
}
|
|
- g_free(state->opaque);
|
|
}
|
|
|
|
static void qcow2_reopen_abort(BDRVReopenState *state)
|
|
@@ -5492,6 +5496,7 @@ BlockDriver bdrv_qcow2 = {
|
|
.bdrv_close = qcow2_close,
|
|
.bdrv_reopen_prepare = qcow2_reopen_prepare,
|
|
.bdrv_reopen_commit = qcow2_reopen_commit,
|
|
+ .bdrv_reopen_commit_post = qcow2_reopen_commit_post,
|
|
.bdrv_reopen_abort = qcow2_reopen_abort,
|
|
.bdrv_join_options = qcow2_join_options,
|
|
.bdrv_child_perm = bdrv_format_default_perms,
|
|
--
|
|
1.8.3.1
|
|
|