[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 01/19] blockdev: preserve readonly and snapshot stat
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 01/19] blockdev: preserve readonly and snapshot states across media changes |
Date: |
Mon, 24 Sep 2012 16:26:30 +0200 |
From: Kevin Shanahan <address@hidden>
If readonly=on is given at device creation time, the ->readonly flag
needs to be set in the block driver state for this device so that
readonly-ness is preserved across media changes (qmp change command).
Similarly, to preserve the snapshot property requires ->open_flags to
be correct.
Signed-off-by: Kevin Shanahan <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
blockdev.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/blockdev.c b/blockdev.c
index 7c83baa..e5d450f 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -527,6 +527,8 @@ DriveInfo *drive_init(QemuOpts *opts, int default_to_scsi)
if_name[type], mediastr, unit_id);
}
dinfo->bdrv = bdrv_new(dinfo->id);
+ dinfo->bdrv->open_flags = snapshot ? BDRV_O_SNAPSHOT : 0;
+ dinfo->bdrv->read_only = ro;
dinfo->devaddr = devaddr;
dinfo->type = type;
dinfo->bus = bus_id;
--
1.7.6.5
- [Qemu-devel] [PULL 00/19] Block patches, Kevin Wolf, 2012/09/24
- [Qemu-devel] [PATCH 01/19] blockdev: preserve readonly and snapshot states across media changes,
Kevin Wolf <=
- [Qemu-devel] [PATCH 02/19] block: correctly set the keep_read_only flag, Kevin Wolf, 2012/09/24
- [Qemu-devel] [PATCH 03/19] block: make bdrv_set_enable_write_cache() modify open_flags, Kevin Wolf, 2012/09/24
- [Qemu-devel] [PATCH 10/19] block: raw-posix image file reopen, Kevin Wolf, 2012/09/24
- [Qemu-devel] [PATCH 05/19] block: move aio initialization into a helper function, Kevin Wolf, 2012/09/24
- [Qemu-devel] [PATCH 13/19] block: qcow2 image file reopen, Kevin Wolf, 2012/09/24
- [Qemu-devel] [PATCH 06/19] block: move open flag parsing in raw block drivers to helper functions, Kevin Wolf, 2012/09/24
- [Qemu-devel] [PATCH 08/19] block: use BDRV_O_NOCACHE instead of s->aligned_buf in raw-posix.c, Kevin Wolf, 2012/09/24
- [Qemu-devel] [PATCH 12/19] block: qed image file reopen, Kevin Wolf, 2012/09/24
- [Qemu-devel] [PATCH 11/19] block: raw image file reopen, Kevin Wolf, 2012/09/24
- [Qemu-devel] [PATCH 09/19] block: purge s->aligned_buf and s->aligned_buf_size from raw-posix.c, Kevin Wolf, 2012/09/24