aboutsummaryrefslogtreecommitdiff
path: root/hmp-commands.hx
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@redhat.com>2013-06-26 14:11:58 +0200
committerKevin Wolf <kwolf@redhat.com>2013-07-15 09:49:00 +0200
commitde90930a0c45760e7523138fac57ff07312bf51d (patch)
tree168e123511084e83eb64b1484019379ee0a96ceb /hmp-commands.hx
parentb53169eae06d6cf6f512a8b1fdd5424a0a6aab85 (diff)
block: add drive_backup HMP command
Make "drive_backup" available on the HMP monitor: drive_backup [-n] [-f] device target [format] The -n flag requests QEMU to reuse the image found in new-image-file, instead of recreating it from scratch. The -f flag requests QEMU to copy the whole disk, so that the result does not need a backing file. Note that this flag *must* currently be passed since the other sync modes ('none' and 'top') have not been implemented yet. Requiring it ensures that "drive_backup" behaves like "drive_mirror". Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'hmp-commands.hx')
-rw-r--r--hmp-commands.hx20
1 files changed, 20 insertions, 0 deletions
diff --git a/hmp-commands.hx b/hmp-commands.hx
index d1cdcfb71b..8c6b91a9c7 100644
--- a/hmp-commands.hx
+++ b/hmp-commands.hx
@@ -1059,6 +1059,26 @@ using the specified target.
ETEXI
{
+ .name = "drive_backup",
+ .args_type = "reuse:-n,full:-f,device:B,target:s,format:s?",
+ .params = "[-n] [-f] device target [format]",
+ .help = "initiates a point-in-time\n\t\t\t"
+ "copy for a device. The device's contents are\n\t\t\t"
+ "copied to the new image file, excluding data that\n\t\t\t"
+ "is written after the command is started.\n\t\t\t"
+ "The -n flag requests QEMU to reuse the image found\n\t\t\t"
+ "in new-image-file, instead of recreating it from scratch.\n\t\t\t"
+ "The -f flag requests QEMU to copy the whole disk,\n\t\t\t"
+ "so that the result does not need a backing file.\n\t\t\t",
+ .mhandler.cmd = hmp_drive_backup,
+ },
+STEXI
+@item drive_backup
+@findex drive_backup
+Start a point-in-time copy of a block device to a specificed target.
+ETEXI
+
+ {
.name = "drive_add",
.args_type = "pci_addr:s,opts:s",
.params = "[[<domain>:]<bus>:]<slot>\n"