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. > > Signed-off-by: Wenchao Xia > --- > 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? > +# > +# @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. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org