[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 02/30] block: after creating a live snapshot, make o
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 02/30] block: after creating a live snapshot, make old image read-only |
Date: |
Fri, 28 Sep 2012 19:56:45 +0200 |
From: Jeff Cody <address@hidden>
Currently, after a live snapshot of a drive, the image that has
been 'demoted' to be below the new active layer remains r/w.
This patch reopens it read-only.
Note that we do not check for error on the reopen(), because we
will not abort the snapshots if the reopen fails.
This patch depends on the bdrv_reopen() series.
Signed-off-by: Jeff Cody <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
blockdev.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/blockdev.c b/blockdev.c
index e5d450f..0267fa3 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -805,6 +805,11 @@ void qmp_transaction(BlockdevActionList *dev_list, Error
**errp)
QSIMPLEQ_FOREACH(states, &snap_bdrv_states, entry) {
/* This removes our old bs from the bdrv_states, and adds the new bs */
bdrv_append(states->new_bs, states->old_bs);
+ /* We don't need (or want) to use the transactional
+ * bdrv_reopen_multiple() across all the entries at once, because we
+ * don't want to abort all of them if one of them fails the reopen */
+ bdrv_reopen(states->new_bs, states->new_bs->open_flags & ~BDRV_O_RDWR,
+ NULL);
}
/* success */
--
1.7.6.5
- [Qemu-devel] [PULL 00/30] Block patches, Kevin Wolf, 2012/09/28
- [Qemu-devel] [PATCH 02/30] block: after creating a live snapshot, make old image read-only,
Kevin Wolf <=
- [Qemu-devel] [PATCH 01/30] block-migration: Flush requests in blk_mig_cleanup, Kevin Wolf, 2012/09/28
- [Qemu-devel] [PATCH 03/30] aio: Fix qemu_aio_wait() to maintain correct walking_handlers count, Kevin Wolf, 2012/09/28
- [Qemu-devel] [PATCH 06/30] configure: Add a config option for GlusterFS as block backend, Kevin Wolf, 2012/09/28
- [Qemu-devel] [PATCH 07/30] block: Support GlusterFS as a QEMU block backend., Kevin Wolf, 2012/09/28
- [Qemu-devel] [PATCH 05/30] aio: Another fix to the walking_handlers logic, Kevin Wolf, 2012/09/28
- [Qemu-devel] [PATCH 10/30] blockdev: rename block_stream_cb to a generic block_job_cb, Kevin Wolf, 2012/09/28
- [Qemu-devel] [PATCH 09/30] block: add live block commit functionality, Kevin Wolf, 2012/09/28
- [Qemu-devel] [PATCH 11/30] block: helper function, to find the base image of a chain, Kevin Wolf, 2012/09/28
- [Qemu-devel] [PATCH 08/30] block: add support functions for live commit, to find and delete images., Kevin Wolf, 2012/09/28
- [Qemu-devel] [PATCH 04/30] qemu: URI parsing library, Kevin Wolf, 2012/09/28