Sync usage with man page.
[netbsd-mini2440.git] / external / gpl2 / lvm2 / dist / tools / polldaemon.h
blob100558ca3683e323c51dfb9766787f2e2844a43a
1 /* $NetBSD$ */
3 /*
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"
23 typedef enum {
24 PROGRESS_CHECK_FAILED = 0,
25 PROGRESS_UNFINISHED = 1,
26 PROGRESS_FINISHED_SEGMENT = 2,
27 PROGRESS_FINISHED_ALL = 3
28 } progress_t;
30 struct daemon_parms;
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,
35 const char *name,
36 const char *uuid);
37 struct logical_volume *(*get_copy_lv) (struct cmd_context *cmd,
38 struct volume_group *vg,
39 const char *name,
40 const char *uuid,
41 uint32_t lv_type);
42 progress_t (*poll_progress)(struct cmd_context *cmd,
43 struct logical_volume *lv,
44 const char *name,
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);
56 struct daemon_parms {
57 unsigned interval;
58 unsigned aborting;
59 unsigned background;
60 unsigned outstanding_count;
61 unsigned progress_display;
62 const char *progress_title;
63 uint32_t lv_type;
64 struct poll_functions *poll_fns;
67 int poll_daemon(struct cmd_context *cmd, const char *name, const char *uuid,
68 unsigned background,
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);
76 #endif