summaryrefslogtreecommitdiff
path: root/tools/vgcfgbackup.c
diff options
context:
space:
mode:
authorPeter Rajnoha <prajnoha@redhat.com>2014-11-27 15:02:13 +0100
committerPeter Rajnoha <prajnoha@redhat.com>2015-02-10 16:05:24 +0100
commit51d96a170314b7ce75f233d42501262805384770 (patch)
treeda64397e4a7903edd59743b78a43e385dda83a19 /tools/vgcfgbackup.c
parent2a19866a74c5101d262586ad0e08317e9a514977 (diff)
downloadlvm2-51d96a170314b7ce75f233d42501262805384770.tar.gz
toollib: replace void *handle with struct processing_handle for use in processing functions (process_each_*/process_single_* and related)
This patch replaces "void *handle" with "struct processing_handle *handle" in process_each_*, process_single_* and related functions. The struct processing_handle consists of two handles inside now: - the "struct selection_handle *selection_handle" used for applying selection criteria while processing process_each_*, process_single_* and related functions (patches using this logic will follow) - the "void* custom_handle" (this is actually the original handle used before this patch - a pointer to custom data passed into process_each_*, process_single_* and related functions).
Diffstat (limited to 'tools/vgcfgbackup.c')
-rw-r--r--tools/vgcfgbackup.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/tools/vgcfgbackup.c b/tools/vgcfgbackup.c
index 7cf19bc28..ee65f180c 100644
--- a/tools/vgcfgbackup.c
+++ b/tools/vgcfgbackup.c
@@ -49,9 +49,9 @@ static char *_expand_filename(const char *template, const char *vg_name,
static int vg_backup_single(struct cmd_context *cmd, const char *vg_name,
struct volume_group *vg,
- void *handle)
+ struct processing_handle *handle)
{
- char **last_filename = (char **)handle;
+ char **last_filename = (char **)handle->custom_handle;
char *filename;
if (arg_count(cmd, file_ARG)) {
@@ -83,11 +83,14 @@ int vgcfgbackup(struct cmd_context *cmd, int argc, char **argv)
{
int ret;
char *last_filename = NULL;
+ struct processing_handle handle = { .internal_report_for_select = 1,
+ .selection_handle = NULL,
+ .custom_handle = &last_filename };
init_pvmove(1);
ret = process_each_vg(cmd, argc, argv, READ_ALLOW_INCONSISTENT,
- &last_filename, &vg_backup_single);
+ &handle, &vg_backup_single);
dm_free(last_filename);