[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 15/31] savevm: Include writable devices with removab
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 15/31] savevm: Include writable devices with removable media |
Date: |
Tue, 6 Sep 2011 17:39:30 +0200 |
From: Markus Armbruster <address@hidden>
savevm and loadvm silently ignore block devices with removable media,
such as floppies and SD cards. Rolling back a VM to a previous
checkpoint will *not* roll back writes to block devices with removable
media.
Moreover, bdrv_is_removable() is a confused mess, and wrong in at
least one case: it considers "-drive if=xen,media=cdrom -M xenpv"
removable. It'll be cleaned up later in this series.
Read-only block devices are also ignored, but that's okay.
Fix by ignoring only read-only block devices and empty block devices.
Signed-off-by: Markus Armbruster <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block.c | 2 +-
savevm.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/block.c b/block.c
index 487a6a9..a8c789a 100644
--- a/block.c
+++ b/block.c
@@ -2097,7 +2097,7 @@ void bdrv_debug_event(BlockDriverState *bs, BlkDebugEvent
event)
int bdrv_can_snapshot(BlockDriverState *bs)
{
BlockDriver *drv = bs->drv;
- if (!drv || bdrv_is_removable(bs) || bdrv_is_read_only(bs)) {
+ if (!drv || !bdrv_is_inserted(bs) || bdrv_is_read_only(bs)) {
return 0;
}
diff --git a/savevm.c b/savevm.c
index b06308b..1feaa70 100644
--- a/savevm.c
+++ b/savevm.c
@@ -1914,7 +1914,7 @@ void do_savevm(Monitor *mon, const QDict *qdict)
bs = NULL;
while ((bs = bdrv_next(bs))) {
- if (bdrv_is_removable(bs) || bdrv_is_read_only(bs)) {
+ if (!bdrv_is_inserted(bs) || bdrv_is_read_only(bs)) {
continue;
}
@@ -2034,7 +2034,7 @@ int load_vmstate(const char *name)
bs = NULL;
while ((bs = bdrv_next(bs))) {
- if (bdrv_is_removable(bs) || bdrv_is_read_only(bs)) {
+ if (!bdrv_is_inserted(bs) || bdrv_is_read_only(bs)) {
continue;
}
--
1.7.6
- [Qemu-devel] [PATCH 07/31] block: Split change_cb() into change_media_cb(), resize_cb(), (continued)
- [Qemu-devel] [PATCH 07/31] block: Split change_cb() into change_media_cb(), resize_cb(), Kevin Wolf, 2011/09/06
- [Qemu-devel] [PATCH 09/31] ide: Clean up case label indentation in ide_exec_cmd(), Kevin Wolf, 2011/09/06
- [Qemu-devel] [PATCH 11/31] block/raw: Fix to forward method bdrv_media_changed(), Kevin Wolf, 2011/09/06
- [Qemu-devel] [PATCH 10/31] ide: Give vmstate structs internal linkage where possible, Kevin Wolf, 2011/09/06
- [Qemu-devel] [PATCH 17/31] spitz tosa: Simplify "drive is suitable for microdrive" test, Kevin Wolf, 2011/09/06
- [Qemu-devel] [PATCH 12/31] block: Leave tracking media change to device models, Kevin Wolf, 2011/09/06
- [Qemu-devel] [PATCH 14/31] block: Clean up bdrv_flush_all(), Kevin Wolf, 2011/09/06
- [Qemu-devel] [PATCH 13/31] fdc: Make media change detection more robust, Kevin Wolf, 2011/09/06
- [Qemu-devel] [PATCH 15/31] savevm: Include writable devices with removable media,
Kevin Wolf <=
- [Qemu-devel] [PATCH 20/31] VMDK: add twoGbMaxExtentSparse support, Kevin Wolf, 2011/09/06
- [Qemu-devel] [PATCH 16/31] xen: Clean up pci_piix3_xen_ide_unplug()'s test for "not a CD", Kevin Wolf, 2011/09/06
- [Qemu-devel] [PATCH 22/31] VMDK: Opening compressed extent., Kevin Wolf, 2011/09/06
- [Qemu-devel] [PATCH 23/31] VMDK: read/write compressed extent, Kevin Wolf, 2011/09/06
- [Qemu-devel] [PATCH 21/31] VMDK: separate vmdk_read_extent/vmdk_write_extent, Kevin Wolf, 2011/09/06
- [Qemu-devel] [PATCH 19/31] VMDK: enable twoGbMaxExtentFlat, Kevin Wolf, 2011/09/06
- [Qemu-devel] [PATCH 25/31] VMDK: bugfix, open Haiku vmdk image, Kevin Wolf, 2011/09/06
- [Qemu-devel] [PATCH 24/31] VMDK: creating streamOptimized subformat, Kevin Wolf, 2011/09/06
- [Qemu-devel] [PATCH 18/31] block: Declare qemu_blockalign() in block.h, not block_int.h, Kevin Wolf, 2011/09/06
- [Qemu-devel] [PATCH 29/31] scsi: refine constants for READ CAPACITY 16, Kevin Wolf, 2011/09/06