aboutsummaryrefslogtreecommitdiffstats
path: root/block.c
diff options
context:
space:
mode:
authorOt ten Thije <ottenthije@google.com>2010-09-30 14:17:10 +0100
committerOt ten Thije <ottenthije@google.com>2010-10-21 11:16:06 +0100
commit8f2de6dd4f99bf15ab55b07b88f61c1ba4c65187 (patch)
treeb31765711f60019869092ba9977586ccbef0a8c3 /block.c
parent7d98eae200f294f51ada36d9b01591fc4726dd94 (diff)
downloadexternal_qemu-8f2de6dd4f99bf15ab55b07b88f61c1ba4c65187.zip
external_qemu-8f2de6dd4f99bf15ab55b07b88f61c1ba4c65187.tar.gz
external_qemu-8f2de6dd4f99bf15ab55b07b88f61c1ba4c65187.tar.bz2
Make state snapshots compatible with SD cards.
This patch introduces a check such that only drives exporting a snapshot creation function are considered for storing snapshots. SD cards are mounted with a raw file system, which does not support snapshots. Since the SD card is now skipped, the actual snapshot image can be safely mounted on hdb rather than hda. The contents of the SD card itself are included in the snapshot however, since they are accessed with the NAND driver (which saves the contents of the underlying files). Change-Id: I4816b6e54e227aca356389c15ce9f5c1282d2464
Diffstat (limited to 'block.c')
-rw-r--r--block.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/block.c b/block.c
index 6d05a58..852cb3e 100644
--- a/block.c
+++ b/block.c
@@ -1181,6 +1181,15 @@ int bdrv_get_buffer(BlockDriverState *bs, uint8_t *buf, int64_t pos, int size)
/**************************************************************/
/* handling of snapshots */
+int bdrv_can_snapshot(BlockDriverState *bs)
+{
+ return ( bs &&
+ !bdrv_is_removable(bs) &&
+ !bdrv_is_read_only(bs) &&
+ bs->drv &&
+ bs->drv->bdrv_snapshot_create );
+}
+
int bdrv_snapshot_create(BlockDriverState *bs,
QEMUSnapshotInfo *sn_info)
{