4 * Copyright (C) 2003-2004 Sistina Software, Inc. All rights reserved.
5 * Copyright (C) 2004 Red Hat, Inc. All rights reserved.
7 * This file is part of LVM2.
9 * This copyrighted material is made available to anyone wishing to use,
10 * modify, copy, or redistribute it subject to the terms and conditions
11 * of the GNU Lesser General Public License v.2.1.
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program; if not, write to the Free Software Foundation,
15 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 #ifndef _LVM_TOOL_POLLDAEMON_H
19 #define _LVM_TOOL_POLLDAEMON_H
21 #include "metadata-exported.h"
24 PROGRESS_CHECK_FAILED
= 0,
25 PROGRESS_UNFINISHED
= 1,
26 PROGRESS_FINISHED_SEGMENT
= 2,
27 PROGRESS_FINISHED_ALL
= 3
32 struct poll_functions
{
33 const char *(*get_copy_name_from_lv
) (struct logical_volume
*lv
);
34 struct volume_group
*(*get_copy_vg
) (struct cmd_context
*cmd
,
37 struct logical_volume
*(*get_copy_lv
) (struct cmd_context
*cmd
,
38 struct volume_group
*vg
,
42 progress_t (*poll_progress
)(struct cmd_context
*cmd
,
43 struct logical_volume
*lv
,
45 struct daemon_parms
*parms
);
46 int (*update_metadata
) (struct cmd_context
*cmd
,
47 struct volume_group
*vg
,
48 struct logical_volume
*lv
,
49 struct dm_list
*lvs_changed
, unsigned flags
);
50 int (*finish_copy
) (struct cmd_context
*cmd
,
51 struct volume_group
*vg
,
52 struct logical_volume
*lv
,
53 struct dm_list
*lvs_changed
);
60 unsigned outstanding_count
;
61 unsigned progress_display
;
62 const char *progress_title
;
64 struct poll_functions
*poll_fns
;
67 int poll_daemon(struct cmd_context
*cmd
, const char *name
, const char *uuid
,
69 uint32_t lv_type
, struct poll_functions
*poll_fns
,
70 const char *progress_title
);
72 progress_t
poll_mirror_progress(struct cmd_context
*cmd
,
73 struct logical_volume
*lv
, const char *name
,
74 struct daemon_parms
*parms
);