aboutsummaryrefslogtreecommitdiff
path: root/qemu-img.c
diff options
context:
space:
mode:
authorWenchao Xia <xiawenc@linux.vnet.ibm.com>2013-12-04 17:10:54 +0800
committerStefan Hajnoczi <stefanha@redhat.com>2013-12-04 15:19:00 +0100
commit7b4c4781e390a041fa0ef70817678f1b97fc6db6 (patch)
tree3506ed0d0b5789ee3af96cff47b66ad064466c83 /qemu-img.c
parent34602dd6424c4f1cc414ba672f4f430182b5d9f2 (diff)
snapshot: distinguish id and name in load_tmp
Since later this function will be used so improve it. The only caller of it now is qemu-img, and it is not impacted by introduce function bdrv_snapshot_load_tmp_by_id_or_name() that call bdrv_snapshot_load_tmp() twice to keep old search logic. bdrv_snapshot_load_tmp_by_id_or_name() return int to let caller know the errno, and errno will be used later. Also fix a typo in comments of bdrv_snapshot_delete(). Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'qemu-img.c')
-rw-r--r--qemu-img.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/qemu-img.c b/qemu-img.c
index dc0c2f0ed3..685c566d22 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -1264,8 +1264,12 @@ static int img_convert(int argc, char **argv)
ret = -1;
goto out;
}
- if (bdrv_snapshot_load_tmp(bs[0], snapshot_name) < 0) {
- error_report("Failed to load snapshot");
+
+ bdrv_snapshot_load_tmp_by_id_or_name(bs[0], snapshot_name, &local_err);
+ if (error_is_set(&local_err)) {
+ error_report("Failed to load snapshot: %s",
+ error_get_pretty(local_err));
+ error_free(local_err);
ret = -1;
goto out;
}