[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH V2 09/12] qmp: add interface blockdev-snapshot-d
From: |
Wenchao Xia |
Subject: |
Re: [Qemu-devel] [PATCH V2 09/12] qmp: add interface blockdev-snapshot-delete-internal-sync |
Date: |
Mon, 17 Jun 2013 11:25:26 +0800 |
User-agent: |
Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 |
δΊ 2013-6-15 17:55, Eric Blake ει:
On 06/14/2013 12:39 PM, Wenchao Xia wrote:
Snapshot ID can't be specified in this interface.
Why not? If it is possible to look up by id in isolation, then it
should be possible to delete by id in isolation. Also, if it is
possible to create a snapshot that has an id but no name (and I think
qcow2 allows such snapshots, even if we don't want to expose that corner
case of creation via normal QMP), then it is mandatory to have a way to
delete by id, since there is no name to delete by.
OK, qemu-img allows create snapshot with name="" before, so we need
take care for that corener case in this interface. Here is the redesign:
##
# @blockdev-snapshot-delete-internal-sync
#
# Synchronously delete an internal snapshot of a block device, when the
ormat
# of the image used support it.
#
# @device: the name of the device to delete the snapshot from
#
# @name: the snapshot's name to be deleted
#
# @id: optional the snapshot's ID to be deleted. If specified, qemu will
# try delete the snapshot matching both @name and @id.
#
# Returns: nothing on success
# If @device is not a valid block device, DeviceNotFound
# If snapshot not found, generic error will be returned
#
# Since 1.6
##
{ 'command': 'blockdev-snapshot-delete-internal-sync',
'data': { 'device': 'str', 'name': 'str', '*id': 'str' } }
Then caller specify name='' and id=[ID] to handle the corner case.
Signed-off-by: Wenchao Xia <address@hidden>
---
blockdev.c | 12 ++++++++++++
qapi-schema.json | 19 +++++++++++++++++++
qmp-commands.hx | 30 ++++++++++++++++++++++++++++++
3 files changed, 61 insertions(+), 0 deletions(-)
+++ b/qapi-schema.json
@@ -1712,6 +1712,25 @@
'data': { 'device': 'str', '*name': 'str'} }
##
+# @blockdev-snapshot-delete-internal-sync
+#
+# Synchronously delete an internal snapshot of a block device, when the format
+# of the image used support it.
Should this command be made available via 'transaction'? That is, if I
have a two-disk VM, and use 'transaction' to take a snapshot of both
disks at once, shouldn't I also have a way to delete the snapshots of
both at once, or gracefully fail without data loss if the second one has
problems?
I think adding it in transaction is not very useful but brings more
complexity. Transcation is used to guareentee all operations are taken
in one time point, for example, snapshot creation use it to make sure
all are consistent to VM. But for deletion, this requirement do not
exist.
+#
+# @device: the name of the device to delete the snapshot from
+#
+# @name: the snapshot's name to be deleted
+#
+# Returns: nothing on success
+# If @device is not a valid block device, DeviceNotFound
+# If snapshot not found, generic error will be returned
+#
+# Since 1.6
+##
+{ 'command': 'blockdev-snapshot-delete-internal-sync',
+ 'data': { 'device': 'str', 'name': 'str'} }
I'm not convinced that this interface is powerful enough.
--
Best Regards
Wenchao Xia
- Re: [Qemu-devel] [PATCH V2 12/12] qemu-iotests: add 055 internal snapshot for block device test case, (continued)
[Qemu-devel] [PATCH V2 05/12] snapshot: add paired functions for internal snapshot id and name, Wenchao Xia, 2013/06/14
[Qemu-devel] [PATCH V2 06/12] snapshot: distinguish id and name in snapshot delete, Wenchao Xia, 2013/06/14
[Qemu-devel] [PATCH V2 10/12] hmp: add interface hmp_snapshot_blkdev_internal, Wenchao Xia, 2013/06/14
[Qemu-devel] [PATCH V2 11/12] hmp: add interface hmp_snapshot_delete_blkdev_internal, Wenchao Xia, 2013/06/14
[Qemu-devel] [PATCH V2 09/12] qmp: add interface blockdev-snapshot-delete-internal-sync, Wenchao Xia, 2013/06/14
- Re: [Qemu-devel] [PATCH V2 09/12] qmp: add interface blockdev-snapshot-delete-internal-sync, Eric Blake, 2013/06/15
- Re: [Qemu-devel] [PATCH V2 09/12] qmp: add interface blockdev-snapshot-delete-internal-sync,
Wenchao Xia <=
- Re: [Qemu-devel] [PATCH V2 09/12] qmp: add interface blockdev-snapshot-delete-internal-sync, Stefan Hajnoczi, 2013/06/18
- Re: [Qemu-devel] [PATCH V2 09/12] qmp: add interface blockdev-snapshot-delete-internal-sync, Wenchao Xia, 2013/06/19
- Re: [Qemu-devel] [PATCH V2 09/12] qmp: add interface blockdev-snapshot-delete-internal-sync, Stefan Hajnoczi, 2013/06/19
- Re: [Qemu-devel] [PATCH V2 09/12] qmp: add interface blockdev-snapshot-delete-internal-sync, Wenchao Xia, 2013/06/19
- Re: [Qemu-devel] [PATCH V2 09/12] qmp: add interface blockdev-snapshot-delete-internal-sync, Stefan Hajnoczi, 2013/06/19
- Re: [Qemu-devel] [PATCH V2 09/12] qmp: add interface blockdev-snapshot-delete-internal-sync, Wenchao Xia, 2013/06/19
[Qemu-devel] [PATCH V2 04/12] snapshot: new function bdrv_snapshot_find_by_id_and_name(), Wenchao Xia, 2013/06/14