qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Create the VMDK snapshot from the QEMU monitor.
@ 2006-12-26 15:49 Igor Lvovsky
  2006-12-26 17:24 ` Anthony Liguori
  0 siblings, 1 reply; 5+ messages in thread
From: Igor Lvovsky @ 2006-12-26 15:49 UTC (permalink / raw)
  To: qemu-devel


[-- Attachment #1.1: Type: text/plain, Size: 628 bytes --]

  Hi,

This patch completes the previous one and allows the snapshot (VMDK style) creation from the QEMU monitor (Ctrl+Alt+2).

 

To clarify, the previous patch implements the snapshot capabilities according to the "Virtual Disk Format 1.0" document.

http://lists.gnu.org/archive/html/qemu-devel/2006-12/msg00311.html

 

Implemented features:

1.	Create snapshot.
2.	CID concept to prevent snapshots chain inconsistency.
3.	Snapshots read/write capabilities.

 

The whole chain (base image and snapshots) created by QEMU can be loaded from the VMware workstation and vice versa.

 

Igor Lvovsky.


[-- Attachment #1.2: Type: text/html, Size: 3963 bytes --]

[-- Attachment #2: vmdk-support2.diff --]
[-- Type: application/octet-stream, Size: 1944 bytes --]

Index: monitor.c
===================================================================
RCS file: /sources/qemu/qemu/monitor.c,v
retrieving revision 1.58
diff -u -r1.58 monitor.c
--- monitor.c	22 Dec 2006 14:11:31 -0000	1.58
+++ monitor.c	26 Dec 2006 15:08:25 -0000
@@ -361,6 +361,51 @@
     eject_device(bs, force);
 }
 
+int vmdk_snapshot_create(BlockDriverState *bs);
+
+static void do_snapshot(const char *hda, const char *hdb,
+                        const char *hdc, const char *hdd)
+{
+
+    if (!strcmp(hda,"hda")) {
+        if (vmdk_snapshot_create(bs_table[0]) == -1)
+            term_printf("hda snapshot fail\n");
+    }
+
+    if (hdb) {
+        if (!strcmp(hdb,"hdb")) {
+            if (bs_table[1]) {
+                if (vmdk_snapshot_create(bs_table[1]) == -1)
+                    term_printf("hdb snapshot fail\n");
+            }else {
+                term_printf("hdb not exist\n");
+            }
+        }
+    }
+
+    if (hdc) {
+        if (!strcmp(hdc,"hdc")) {
+            if (bs_table[2]) {
+                if (vmdk_snapshot_create(bs_table[2]) == -1)
+                    term_printf("hdc snapshot fail\n");
+            }else {
+                term_printf("hdc not exist\n");
+            }
+        }
+    }
+
+    if (hdd) {
+        if (!strcmp(hdd,"hdd")) {
+            if (bs_table[3]) {
+                if (vmdk_snapshot_create(bs_table[3]) == -1)
+                    term_printf("hdd snapshot fail\n");
+            }else {
+                term_printf("hdd not exist\n");
+            }
+        }
+    }
+}
+
 static void do_change(const char *device, const char *filename)
 {
     BlockDriverState *bs;
@@ -1218,6 +1263,8 @@
 #endif
      { "stopcapture", "i", do_stop_capture,
        "capture index", "stop capture" },
+     { "create_snapshot", "ss?s?s?", do_snapshot, 
+       "hda [hdb] [hdc] [hdd]", "create snapshot of one or more images (VMDK format)" },
     { NULL, NULL, }, 
 };
 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-01-09 19:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-26 15:49 [Qemu-devel] [PATCH] Create the VMDK snapshot from the QEMU monitor Igor Lvovsky
2006-12-26 17:24 ` Anthony Liguori
2007-01-09 10:28   ` [Qemu-devel] [PATCH] Create the VMDK snapshot from the QEMUmonitor Igor Lvovsky
2007-01-09 16:20     ` Anthony Liguori
2007-01-09 19:40     ` Fabrice Bellard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).