From 7b4c4781e390a041fa0ef70817678f1b97fc6db6 Mon Sep 17 00:00:00 2001 From: Wenchao Xia Date: Wed, 4 Dec 2013 17:10:54 +0800 Subject: 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 Signed-off-by: Stefan Hajnoczi --- include/block/block_int.h | 4 +++- include/block/snapshot.h | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'include/block') diff --git a/include/block/block_int.h b/include/block/block_int.h index 773899b500..ec0797ebc7 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -176,7 +176,9 @@ struct BlockDriver { int (*bdrv_snapshot_list)(BlockDriverState *bs, QEMUSnapshotInfo **psn_info); int (*bdrv_snapshot_load_tmp)(BlockDriverState *bs, - const char *snapshot_name); + const char *snapshot_id, + const char *name, + Error **errp); int (*bdrv_get_info)(BlockDriverState *bs, BlockDriverInfo *bdi); ImageInfoSpecific *(*bdrv_get_specific_info)(BlockDriverState *bs); diff --git a/include/block/snapshot.h b/include/block/snapshot.h index 012bf226d3..d05bea7223 100644 --- a/include/block/snapshot.h +++ b/include/block/snapshot.h @@ -61,5 +61,10 @@ void bdrv_snapshot_delete_by_id_or_name(BlockDriverState *bs, int bdrv_snapshot_list(BlockDriverState *bs, QEMUSnapshotInfo **psn_info); int bdrv_snapshot_load_tmp(BlockDriverState *bs, - const char *snapshot_name); + const char *snapshot_id, + const char *name, + Error **errp); +int bdrv_snapshot_load_tmp_by_id_or_name(BlockDriverState *bs, + const char *id_or_name, + Error **errp); #endif -- cgit v1.2.1