2 * Copyright (C) 2003-2004 Sistina Software, Inc. All rights reserved.
3 * Copyright (C) 2004 Red Hat, Inc. All rights reserved.
5 * This file is part of LVM2.
7 * This copyrighted material is made available to anyone wishing to use,
8 * modify, copy, or redistribute it subject to the terms and conditions
9 * of the GNU Lesser General Public License v.2.1.
11 * You should have received a copy of the GNU Lesser General Public License
12 * along with this program; if not, write to the Free Software Foundation,
13 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 #ifndef _LVM_TOOL_POLLDAEMON_H
17 #define _LVM_TOOL_POLLDAEMON_H
19 #include "metadata-exported.h"
22 PROGRESS_CHECK_FAILED = 0,
23 PROGRESS_UNFINISHED = 1,
24 PROGRESS_FINISHED_SEGMENT = 2,
25 PROGRESS_FINISHED_ALL = 3
30 struct poll_functions {
31 const char *(*get_copy_name_from_lv) (struct logical_volume *lv);
32 struct volume_group *(*get_copy_vg) (struct cmd_context *cmd,
35 struct logical_volume *(*get_copy_lv) (struct cmd_context *cmd,
36 struct volume_group *vg,
40 progress_t (*poll_progress)(struct cmd_context *cmd,
41 struct logical_volume *lv,
43 struct daemon_parms *parms);
44 int (*update_metadata) (struct cmd_context *cmd,
45 struct volume_group *vg,
46 struct logical_volume *lv,
47 struct dm_list *lvs_changed, unsigned flags);
48 int (*finish_copy) (struct cmd_context *cmd,
49 struct volume_group *vg,
50 struct logical_volume *lv,
51 struct dm_list *lvs_changed);
56 unsigned wait_before_testing;
59 unsigned outstanding_count;
60 unsigned progress_display;
61 const char *progress_title;
63 struct poll_functions *poll_fns;
66 int poll_daemon(struct cmd_context *cmd, const char *name, const char *uuid,
68 uint32_t lv_type, struct poll_functions *poll_fns,
69 const char *progress_title);
71 progress_t poll_mirror_progress(struct cmd_context *cmd,
72 struct logical_volume *lv, const char *name,
73 struct daemon_parms *parms);