[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-stable] [PATCH 16/60] blockdev: preserve readonly and snapshot sta
From: |
Michael Tokarev |
Subject: |
[Qemu-stable] [PATCH 16/60] blockdev: preserve readonly and snapshot states across media changes |
Date: |
Mon, 4 Feb 2013 14:40:26 +0400 |
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>
(cherry picked from commit 80dd1aae3657a902d262f5d20a7a3c655b23705e)
Signed-off-by: Michael Tokarev <address@hidden>
---
blockdev.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/blockdev.c b/blockdev.c
index 67895b2..2455e21 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -529,6 +529,8 @@ DriveInfo *drive_init(QemuOpts *opts, int default_to_scsi)
devname, 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.10.4
- [Qemu-stable] [PATCH 23/60] hw/qxl: qxl_dirty_surfaces: use uintptr_t, (continued)
- [Qemu-stable] [PATCH 23/60] hw/qxl: qxl_dirty_surfaces: use uintptr_t, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 54/60] hw/arm_boot.c: Consistently use ram_size from arm_boot_info struct, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 29/60] usb-storage: fix SYNCHRONIZE_CACHE, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 41/60] mips/malta: fix CBUS UART interrupt pin, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 10/60] pcie_aer: clear cmask for Advanced Error Interrupt Message Number, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 22/60] uhci: Raise interrupt when requested even for non active tds, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 35/60] s390x: fix -initrd in virtio machine, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 16/60] blockdev: preserve readonly and snapshot states across media changes,
Michael Tokarev <=
- [Qemu-stable] [PATCH 32/60] qed: refuse unaligned zero writes with a backing file, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 15/60] i386: kvm: bit 10 of CPUID[8000_0001].EDX is reserved, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 47/60] kvm: fix incorrect length in a loop over kvm dirty pages map, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 45/60] e1000: Discard packets that are too long if !SBP and !LPE, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 46/60] e1000: Discard oversized packets based on SBP|LPE, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 38/60] xhci: fix usb name in caps, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 33/60] e1000: drop check_rxov, always treat RX ring with RDH == RDT as empty, Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 20/60] ui/vnc: Only report/use TIGHT_PNG encoding if enabled., Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 21/60] vnc: fix "info vnc" with "-vnc ..., reverse=on", Michael Tokarev, 2013/02/04
- [Qemu-stable] [PATCH 56/60] target-xtensa: fix search_pc for the last TB opcode, Michael Tokarev, 2013/02/04