qmp: add interface blockdev-snapshot-delete-internal-sync

This interface use id and name as optional parameters, to handle the
case that one image contain multiple snapshots with same name which
may be '', but with different id.

Adding parameter id is for historical compatiability reason, and
that case is not possible in qemu's new interface for internal
snapshot at block device level, but still possible in qemu-img.

Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
Wenchao Xia
2013-09-11 14:04:36 +08:00
committed by Kevin Wolf
parent f323bc9e8b
commit 44e3e053af
4 changed files with 132 additions and 0 deletions

View File

@@ -1124,6 +1124,47 @@ Example:
}
<- { "return": {} }
EQMP
{
.name = "blockdev-snapshot-delete-internal-sync",
.args_type = "device:B,id:s?,name:s?",
.mhandler.cmd_new =
qmp_marshal_input_blockdev_snapshot_delete_internal_sync,
},
SQMP
blockdev-snapshot-delete-internal-sync
--------------------------------------
Synchronously delete an internal snapshot of a block device when the format of
image used supports it. The snapshot is identified by name or id or both. One
of name or id is required. If the snapshot is not found, the operation will
fail.
Arguments:
- "device": device name (json-string)
- "id": ID of the snapshot (json-string, optional)
- "name": name of the snapshot (json-string, optional)
Example:
-> { "execute": "blockdev-snapshot-delete-internal-sync",
"arguments": { "device": "ide-hd0",
"name": "snapshot0" }
}
<- { "return": {
"id": "1",
"name": "snapshot0",
"vm-state-size": 0,
"date-sec": 1000012,
"date-nsec": 10,
"vm-clock-sec": 100,
"vm-clock-nsec": 20
}
}
EQMP
{