Hi, Eric
  About the interface,there is actually requirement to know internal
snapshots in an image of a backing file, so I think the API should be
improved as:

# @query-snapshots:
#
# Get a list of internal snapshots for whole virtual machine or a single
# block device. Note that in first case, only valid internal snapshot
# will be returned, inconsistent ones will be ignored.
#
# @device: #optional the name of the device to get snapshot info from. # If not specified, only valid snapshots for whole vm would be
#          returned.
# @image: #optional the image's name in the backing chain, only valid
#          when device is specified. If it is not specified, the
#          internal snapshots on the top of the chain will be shown.
#          Otherwise qemu will try search the image on the chain on
#          that device.
#
# Returns: a list of @SnapshotInfo describing all consistent virtual # machine
#          snapshots.
#
# Since: 1.5
##
{ 'command': 'query-snapshots',
  'data': { '*device': 'str', '*image': 'str' },
  'returns': ['SnapshotInfo'] }

  What do you think of the API?

  ##
+# @query-snapshots:
+#
+# Get a list of internal snapshots for whole virtual machine or a single
+# block device. Note that in first case, only valid internal snapshot will be
+# returned, inconsistent ones will be ignored.
+#
+# @device: #optional the name of the device to get snapshot info from. If not
+#          specified, only valid snapshots for whole vm would be returned.
+#
+# Returns: a list of @SnapshotInfo describing all consistent virtual machine
+#          snapshots.
+#
+# Since: 1.5
+##
+{ 'command': 'query-snapshots',
+  'data': { '*device': 'str' },
+  'returns': ['SnapshotInfo'] }
+
+##
  # @BlockDeviceStats:
  #
  # Statistics of a virtual block device or a block backing device.
diff --git a/qmp-commands.hx b/qmp-commands.hx
index 292d61e..846e23e 100644
--- a/qmp-commands.hx
+++ b/qmp-commands.hx
@@ -1819,6 +1819,59 @@ EQMP
      },



--
Best Regards

Wenchao Xia


Reply via email to