From 07b70bfbb3f3aea9ce7a3a1da78cbfa8ae6bbce6 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Wed, 3 Aug 2011 15:08:11 +0200 Subject: savevm: Include writable devices with removable media 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 Signed-off-by: Kevin Wolf --- savevm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'savevm.c') diff --git a/savevm.c b/savevm.c index b06308b56a..1feaa70ccc 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; } -- cgit v1.2.3