On 02/26/2013 03:40 AM, Wenchao Xia wrote:
This patch added the support of showing internal snapshots on an
image in the backing chain of a block device in hmp layer, by
calling a qmp function.
Signed-off-by: Wenchao Xia <address@hidden>
---
hmp.c | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
monitor.c | 6 ++--
2 files changed, 83 insertions(+), 4 deletions(-)
diff --git a/hmp.c b/hmp.c
index 5e68b2f..ffa92ff 100644
+static ImageInfo *find_image_info(const DeviceImageInfoList *device_image_list,
+ const char *image_name)
+{
+ ImageInfo *image_info;
+
+
+ /* search the chain */
+ while (device_image_list) {
+ if (device_image_list->value->has_image) {
+ image_info = device_image_list->value->image;
+ if (!strcmp(image_info->filename, image_name)) {
+ return image_info;
+ }
+ }
Is this loop smart enough, or should it be borrowing from some of the
additional complexity in bdrv_find_backing_image for properly chasing
down relative names?