Merge "Fix linux-x86_64 build."
diff --git a/block.c b/block.c
index 6d05a58..852cb3e 100644
--- a/block.c
+++ b/block.c
@@ -1181,6 +1181,15 @@
 /**************************************************************/
 /* 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)
 {
diff --git a/block.h b/block.h
index 71e87fc..b392021 100644
--- a/block.h
+++ b/block.h
@@ -145,6 +145,7 @@
 const char *bdrv_get_encrypted_filename(BlockDriverState *bs);
 void bdrv_get_backing_filename(BlockDriverState *bs,
                                char *filename, int filename_size);
+int bdrv_can_snapshot(BlockDriverState *bs);
 int bdrv_snapshot_create(BlockDriverState *bs,
                          QEMUSnapshotInfo *sn_info);
 int bdrv_snapshot_goto(BlockDriverState *bs,
diff --git a/savevm.c b/savevm.c
index 8f0d8f1..ee90805 100644
--- a/savevm.c
+++ b/savevm.c
@@ -907,8 +907,8 @@
     for(se = first_se; se != NULL; se = se->next) {
         int len;
 
-	if (se->save_state == NULL)
-	    continue;
+        if (se->save_state == NULL)
+            continue;
 
         /* Section type */
         qemu_put_byte(f, QEMU_VM_SECTION_FULL);
@@ -1122,22 +1122,6 @@
     return ret;
 }
 
-/* device can contain snapshots */
-static int bdrv_can_snapshot(BlockDriverState *bs)
-{
-    return (bs &&
-            !bdrv_is_removable(bs) &&
-            !bdrv_is_read_only(bs));
-}
-
-/* device must be snapshots in order to have a reliable snapshot */
-static int bdrv_has_snapshot(BlockDriverState *bs)
-{
-    return (bs &&
-            !bdrv_is_removable(bs) &&
-            !bdrv_is_read_only(bs));
-}
-
 static BlockDriverState *get_bs_snapshots(void)
 {
     BlockDriverState *bs;
@@ -1257,7 +1241,7 @@
 
     for(i = 0; i < nb_drives; i++) {
         bs1 = drives_table[i].bdrv;
-        if (bdrv_has_snapshot(bs1)) {
+        if (bdrv_can_snapshot(bs1)) {
             if (must_delete) {
                 ret = bdrv_snapshot_delete(bs1, old_sn->id_str);
                 if (ret < 0) {
@@ -1304,7 +1288,7 @@
 
     for(i = 0; i <= nb_drives; i++) {
         bs1 = drives_table[i].bdrv;
-        if (bdrv_has_snapshot(bs1)) {
+        if (bdrv_can_snapshot(bs1)) {
             ret = bdrv_snapshot_goto(bs1, name);
             if (ret < 0) {
                 if (bs != bs1)
@@ -1372,7 +1356,7 @@
 
     for(i = 0; i <= nb_drives; i++) {
         bs1 = drives_table[i].bdrv;
-        if (bdrv_has_snapshot(bs1)) {
+        if (bdrv_can_snapshot(bs1)) {
             ret = bdrv_snapshot_delete(bs1, name);
             if (ret < 0) {
                 if (ret == -ENOTSUP)
@@ -1402,7 +1386,7 @@
     monitor_printf(mon, "Snapshot devices:");
     for(i = 0; i <= nb_drives; i++) {
         bs1 = drives_table[i].bdrv;
-        if (bdrv_has_snapshot(bs1)) {
+        if (bdrv_can_snapshot(bs1)) {
             if (bs == bs1)
                 monitor_printf(mon, " %s", bdrv_get_device_name(bs1));
         }