Skip to contentSkip to conversation

QMP command for snapshot_blkdev

PATCH In review [email protected] 2 participants 5 messages Jul 8, 2011 – Jul 11, 2011

lore
Share & tools
lore
#0 lore raw

cover QMP command for snapshot_blkdev

From: Jes Sorensen <[email protected]>

Hi,

I discussed the issue of a QMP command for live snapshot with Anthony, and we have agreed that it is fine to have a QMP command that matches the current human monitor command. This doesn't preclude that in the future someone may want to add support breaking live snapshots into multiple commands.

Cheers,
Jes

Jes Sorensen (1):
QMP: add snapshot_blkdev command

 qmp-commands.hx |   38 ++++++++++++++++++++++++++++++++++++++
 1 files changed, 38 insertions(+), 0 deletions(-)
Signature · 1 line
1.7.4.4
#1 lore raw

PATCH 1/1 QMP: add snapshot_blkdev command

From: Jes Sorensen <[email protected]>

Add QMP bits for snapshot_blkdev command. This is the same as snapshot_blkdev in the human monitor. The command is synchronous.

In the future async commands and or a break down of the functionality into multiple commands might be added.

---
 qmp-commands.hx |   38 ++++++++++++++++++++++++++++++++++++++
 1 files changed, 38 insertions(+), 0 deletions(-)
qmp-commands.hx +38 -0
index 92c5c3a..eb135c1 100644
@@ -694,6 +694,44 @@ Example:
 EQMP
 
     {
+        .name       = "blockdev-snapshot",
+        .args_type  = "device:B,snapshot_file:s?,format:s?",
+        .params     = "device [new-image-file] [format]",
+        .help       = "initiates a live snapshot\n\t\t\t"
+                      "of device. If a new image file is specified, the\n\t\t\t"
+                      "new image file will become the new root image.\n\t\t\t"
+                      "If format is specified, the snapshot file will\n\t\t\t"
+                      "be created in that format. Otherwise the\n\t\t\t"
+                      "snapshot will be internal! (currently unsupported)",
+        .user_print = monitor_user_noop,
+        .mhandler.cmd_new = do_snapshot_blkdev,
+    },
+
+SQMP
+blockdev-snapshot-sync
+----------------------
+
+Synchronous snapshot of block device, using snapshot file as target,
+if provided. 
+
+Arguments:
+
+- "device": device name to snapshot (json-string)
+- "snapshot_file": name of new image file (json-string)
+- "format": format of new image (json-string)
+
+Example:
+
+-> { "execute": "blockdev-snapshot", "arguments": { "device": "ide-hd0",
+                                                    "snapshot_file":
+                                                    "/some/place/my-image",
+						    "format": "qcow2"
+                                                   } }
+<- { "return": {} }
+
+EQMP
+
+    {
         .name       = "balloon",
         .args_type  = "value:M",
         .params     = "target",
Signature · 1 line
1.7.4.4
#2 lore raw

Re: [Qemu-devel] [PATCH 1/1] QMP: add snapshot_blkdev command

Quoted 18 lines · On Fri, 8 Jul 2011 14:00:13 +0200 [email protected] wrote:

From: Jes Sorensen <[email protected]>

Add QMP bits for snapshot_blkdev command. This is the same as snapshot_blkdev in the human monitor. The command is synchronous.

In the future async commands and or a break down of the functionality into multiple commands might be added.

---
 qmp-commands.hx |   38 ++++++++++++++++++++++++++++++++++++++
 1 files changed, 38 insertions(+), 0 deletions(-)
qmp-commands.hx +0 -0
index 92c5c3a..eb135c1 100644

qmp-commands.hx Example: · line 697

Quoted 4 lines
qmp-commands.hx +1 -0
@@ -694,6 +694,44 @@ Example:
 EQMP
 
     {
+        .name       = "blockdev-snapshot",

blockdev-snapshot-sync.

qmp-commands.hx Example: · line 705

Quoted 8 lines
qmp-commands.hx +8 -0
+        .args_type  = "device:B,snapshot_file:s?,format:s?",
+        .params     = "device [new-image-file] [format]",
+        .help       = "initiates a live snapshot\n\t\t\t"
+                      "of device. If a new image file is specified, the\n\t\t\t"
+                      "new image file will become the new root image.\n\t\t\t"
+                      "If format is specified, the snapshot file will\n\t\t\t"
+                      "be created in that format. Otherwise the\n\t\t\t"
+                      "snapshot will be internal! (currently unsupported)",

The 'otherwise' part is a bit confusing. You document something as if it were supported then you say it's not supported. I recommend to just not document it instead.

qmp-commands.hx Example: · line 715

Quoted 10 lines
qmp-commands.hx +10 -0
+        .user_print = monitor_user_noop,
+        .mhandler.cmd_new = do_snapshot_blkdev,
+    },
+
+SQMP
+blockdev-snapshot-sync
+----------------------
+
+Synchronous snapshot of block device, using snapshot file as target,
+if provided. 

In QMP only this text is used, the text in '.help' is discarded. Please, move all command documentation here.

qmp-commands.hx Example: · line 726

Quoted 11 lines
qmp-commands.hx +11 -0
+
+Arguments:
+
+- "device": device name to snapshot (json-string)
+- "snapshot_file": name of new image file (json-string)
+- "format": format of new image (json-string)
+
+Example:
+
+-> { "execute": "blockdev-snapshot", "arguments": { "device": "ide-hd0",
+                                                    "snapshot_file":

We are trying to standardize the use of hyphen in QMP.

Quoted 11 lines
qmp-commands.hx +8 -0
+                                                    "/some/place/my-image",
+						    "format": "qcow2"
+                                                   } }
+<- { "return": {} }
+
+EQMP
+
+    {
         .name       = "balloon",
         .args_type  = "value:M",
         .params     = "target",
#3 lore raw

Re: [Qemu-devel] [PATCH 1/1] QMP: add snapshot_blkdev command

Quoted 23 lines · Luiz Capitulino
Quoted 20 lines · On Fri, 8 Jul 2011 14:00:13 +0200 [email protected] wrote:

From: Jes Sorensen <[email protected]>

Add QMP bits for snapshot_blkdev command. This is the same as snapshot_blkdev in the human monitor. The command is synchronous.

In the future async commands and or a break down of the functionality into multiple commands might be added.

---
 qmp-commands.hx |   38 ++++++++++++++++++++++++++++++++++++++
 1 files changed, 38 insertions(+), 0 deletions(-)
qmp-commands.hx +0 -0
index 92c5c3a..eb135c1 100644
@@ -694,6 +694,44 @@ Example:
 EQMP
 
Quoted 4 lines

qmp-commands.hx Example: · line 697

Quoted 2 lines
qmp-commands.hx +1 -0
     {
+        .name       = "blockdev-snapshot",

blockdev-snapshot-sync.

argh, will fix

Quoted 9 lines

qmp-commands.hx Example: · line 705

Quoted 8 lines
qmp-commands.hx +8 -0
+        .args_type  = "device:B,snapshot_file:s?,format:s?",
+        .params     = "device [new-image-file] [format]",
+        .help       = "initiates a live snapshot\n\t\t\t"
+                      "of device. If a new image file is specified, the\n\t\t\t"
+                      "new image file will become the new root image.\n\t\t\t"
+                      "If format is specified, the snapshot file will\n\t\t\t"
+                      "be created in that format. Otherwise the\n\t\t\t"
+                      "snapshot will be internal! (currently unsupported)",
Quoted 3 lines

The 'otherwise' part is a bit confusing. You document something as if it were supported then you say it's not supported. I recommend to just not document it instead.

Ok

Quoted 5 lines
Quoted 5 lines
qmp-commands.hx +5 -0
+        .user_print = monitor_user_noop,
+        .mhandler.cmd_new = do_snapshot_blkdev,
+    },
+
+SQMP
Quoted 8 lines

qmp-commands.hx Example: · line 715

Quoted 5 lines
qmp-commands.hx +5 -0
+blockdev-snapshot-sync
+----------------------
+
+Synchronous snapshot of block device, using snapshot file as target,
+if provided. 

In QMP only this text is used, the text in '.help' is discarded. Please, move all command documentation here.

If .help isn't used, then please remove it from the struct. It is really pointless to keep carrying both around.

Quoted 5 lines
Quoted 5 lines
qmp-commands.hx +5 -0
+
+Arguments:
+
+- "device": device name to snapshot (json-string)
+- "snapshot_file": name of new image file (json-string)
Quoted 8 lines

qmp-commands.hx Example: · line 726

Quoted 6 lines
qmp-commands.hx +6 -0
+- "format": format of new image (json-string)
+
+Example:
+
+-> { "execute": "blockdev-snapshot", "arguments": { "device": "ide-hd0",
+                                                    "snapshot_file":

We are trying to standardize the use of hyphen in QMP.

Sorry, but I haven't got a clue what you mean here.

Jes

#4 lore raw

Re: [Qemu-devel] [PATCH 1/1] QMP: add snapshot_blkdev command

Quoted 60 lines · On Mon, 11 Jul 2011 19:50:45 +0200 Jes Sorensen <[email protected]> wrote:
Quoted 23 lines · Luiz Capitulino
Quoted 20 lines · On Fri, 8 Jul 2011 14:00:13 +0200 [email protected] wrote:

From: Jes Sorensen <[email protected]>

Add QMP bits for snapshot_blkdev command. This is the same as snapshot_blkdev in the human monitor. The command is synchronous.

In the future async commands and or a break down of the functionality into multiple commands might be added.

---
 qmp-commands.hx |   38 ++++++++++++++++++++++++++++++++++++++
 1 files changed, 38 insertions(+), 0 deletions(-)
qmp-commands.hx +0 -0
index 92c5c3a..eb135c1 100644
@@ -694,6 +694,44 @@ Example:
 EQMP
 
Quoted 4 lines

qmp-commands.hx Example: · line 697

Quoted 2 lines
qmp-commands.hx +1 -0
     {
+        .name       = "blockdev-snapshot",

blockdev-snapshot-sync.

argh, will fix

Quoted 9 lines

qmp-commands.hx Example: · line 705

Quoted 8 lines
qmp-commands.hx +8 -0
+        .args_type  = "device:B,snapshot_file:s?,format:s?",
+        .params     = "device [new-image-file] [format]",
+        .help       = "initiates a live snapshot\n\t\t\t"
+                      "of device. If a new image file is specified, the\n\t\t\t"
+                      "new image file will become the new root image.\n\t\t\t"
+                      "If format is specified, the snapshot file will\n\t\t\t"
+                      "be created in that format. Otherwise the\n\t\t\t"
+                      "snapshot will be internal! (currently unsupported)",
Quoted 3 lines

The 'otherwise' part is a bit confusing. You document something as if it were supported then you say it's not supported. I recommend to just not document it instead.

Ok

Quoted 5 lines
Quoted 5 lines
qmp-commands.hx +5 -0
+        .user_print = monitor_user_noop,
+        .mhandler.cmd_new = do_snapshot_blkdev,
+    },
+
+SQMP
Quoted 8 lines

qmp-commands.hx Example: · line 715

Quoted 5 lines
qmp-commands.hx +5 -0
+blockdev-snapshot-sync
+----------------------
+
+Synchronous snapshot of block device, using snapshot file as target,
+if provided. 

In QMP only this text is used, the text in '.help' is discarded. Please, move all command documentation here.

Quoted 2 lines

If .help isn't used, then please remove it from the struct. It is really pointless to keep carrying both around.

Yes, sorry for that. It will be completely dropped when we move to the QAPI (which uses a schema file).

Quoted 15 lines
Quoted 14 lines

qmp-commands.hx Example: · line 726

Quoted 12 lines
qmp-commands.hx +11 -0
+
+Arguments:
+
+- "device": device name to snapshot (json-string)
+- "snapshot_file": name of new image file (json-string)
+- "format": format of new image (json-string)
+
+Example:
+
+-> { "execute": "blockdev-snapshot", "arguments": { "device": "ide-hd0",
+                                                    "snapshot_file":

We are trying to standardize the use of hyphen in QMP.

Quoted 1 line

Sorry, but I haven't got a clue what you mean here.

The argument is called "snapshot_file" but it should be called snapshot-file.