[Qemu-devel] [PATCH 02/10] snapshot: return error code from bdrv_snapshot_delete_by_id_or_name
this will make code better in the next patch Signed-off-by: Denis V. Lunev CC: Juan Quintela CC: Stefan Hajnoczi CC: Kevin Wolf --- block/snapshot.c | 7 --- include/block/snapshot.h | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/block/snapshot.c b/block/snapshot.c index d929d08..ed0422d 100644 --- a/block/snapshot.c +++ b/block/snapshot.c @@ -253,9 +253,9 @@ int bdrv_snapshot_delete(BlockDriverState *bs, return -ENOTSUP; } -void bdrv_snapshot_delete_by_id_or_name(BlockDriverState *bs, -const char *id_or_name, -Error **errp) +int bdrv_snapshot_delete_by_id_or_name(BlockDriverState *bs, + const char *id_or_name, + Error **errp) { int ret; Error *local_err = NULL; @@ -270,6 +270,7 @@ void bdrv_snapshot_delete_by_id_or_name(BlockDriverState *bs, if (ret < 0) { error_propagate(errp, local_err); } +return ret; } int bdrv_snapshot_list(BlockDriverState *bs, diff --git a/include/block/snapshot.h b/include/block/snapshot.h index 6195c9c..9ddfd42 100644 --- a/include/block/snapshot.h +++ b/include/block/snapshot.h @@ -63,9 +63,9 @@ int bdrv_snapshot_delete(BlockDriverState *bs, const char *snapshot_id, const char *name, Error **errp); -void bdrv_snapshot_delete_by_id_or_name(BlockDriverState *bs, -const char *id_or_name, -Error **errp); +int bdrv_snapshot_delete_by_id_or_name(BlockDriverState *bs, + const char *id_or_name, + Error **errp); int bdrv_snapshot_list(BlockDriverState *bs, QEMUSnapshotInfo **psn_info); int bdrv_snapshot_load_tmp(BlockDriverState *bs, -- 2.5.0
[Qemu-devel] [PATCH 02/10] snapshot: return error code from bdrv_snapshot_delete_by_id_or_name
this will make code better in the next patch Signed-off-by: Denis V. Lunev CC: Juan Quintela CC: Stefan Hajnoczi CC: Kevin Wolf --- block/snapshot.c | 7 --- include/block/snapshot.h | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/block/snapshot.c b/block/snapshot.c index d929d08..ed0422d 100644 --- a/block/snapshot.c +++ b/block/snapshot.c @@ -253,9 +253,9 @@ int bdrv_snapshot_delete(BlockDriverState *bs, return -ENOTSUP; } -void bdrv_snapshot_delete_by_id_or_name(BlockDriverState *bs, -const char *id_or_name, -Error **errp) +int bdrv_snapshot_delete_by_id_or_name(BlockDriverState *bs, + const char *id_or_name, + Error **errp) { int ret; Error *local_err = NULL; @@ -270,6 +270,7 @@ void bdrv_snapshot_delete_by_id_or_name(BlockDriverState *bs, if (ret < 0) { error_propagate(errp, local_err); } +return ret; } int bdrv_snapshot_list(BlockDriverState *bs, diff --git a/include/block/snapshot.h b/include/block/snapshot.h index 6195c9c..9ddfd42 100644 --- a/include/block/snapshot.h +++ b/include/block/snapshot.h @@ -63,9 +63,9 @@ int bdrv_snapshot_delete(BlockDriverState *bs, const char *snapshot_id, const char *name, Error **errp); -void bdrv_snapshot_delete_by_id_or_name(BlockDriverState *bs, -const char *id_or_name, -Error **errp); +int bdrv_snapshot_delete_by_id_or_name(BlockDriverState *bs, + const char *id_or_name, + Error **errp); int bdrv_snapshot_list(BlockDriverState *bs, QEMUSnapshotInfo **psn_info); int bdrv_snapshot_load_tmp(BlockDriverState *bs, -- 2.5.0
[Qemu-devel] [PATCH 02/10] snapshot: return error code from bdrv_snapshot_delete_by_id_or_name
this will make code better in the next patch Signed-off-by: Denis V. Lunev Reviewed-by: Fam Zheng Reviewed-by: Stefan Hajnoczi CC: Juan Quintela CC: Kevin Wolf --- block/snapshot.c | 7 --- include/block/snapshot.h | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/block/snapshot.c b/block/snapshot.c index d929d08..ed0422d 100644 --- a/block/snapshot.c +++ b/block/snapshot.c @@ -253,9 +253,9 @@ int bdrv_snapshot_delete(BlockDriverState *bs, return -ENOTSUP; } -void bdrv_snapshot_delete_by_id_or_name(BlockDriverState *bs, -const char *id_or_name, -Error **errp) +int bdrv_snapshot_delete_by_id_or_name(BlockDriverState *bs, + const char *id_or_name, + Error **errp) { int ret; Error *local_err = NULL; @@ -270,6 +270,7 @@ void bdrv_snapshot_delete_by_id_or_name(BlockDriverState *bs, if (ret < 0) { error_propagate(errp, local_err); } +return ret; } int bdrv_snapshot_list(BlockDriverState *bs, diff --git a/include/block/snapshot.h b/include/block/snapshot.h index 6195c9c..9ddfd42 100644 --- a/include/block/snapshot.h +++ b/include/block/snapshot.h @@ -63,9 +63,9 @@ int bdrv_snapshot_delete(BlockDriverState *bs, const char *snapshot_id, const char *name, Error **errp); -void bdrv_snapshot_delete_by_id_or_name(BlockDriverState *bs, -const char *id_or_name, -Error **errp); +int bdrv_snapshot_delete_by_id_or_name(BlockDriverState *bs, + const char *id_or_name, + Error **errp); int bdrv_snapshot_list(BlockDriverState *bs, QEMUSnapshotInfo **psn_info); int bdrv_snapshot_load_tmp(BlockDriverState *bs, -- 2.5.0