Hostinfo day 4: Implement command processing code.
[virt-hostinfo.git] / hostinfo-set / hostinfo-set.pl
1 #!/usr/bin/perl -w
2 # @configure_input@
3 # virt-hostinfo
4 # Copyright (C) 2009 Red Hat Inc.
5 #
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19
20 use strict;
21
22 #use Sys::Virt;
23
24 =pod
25
26 =head1 NAME
27
28 hostinfo-set - enable or disable hostinfo for a guest
29
30 =head1 SYNOPSIS
31
32  hostinfo-set [--options] [GUESTNAME [GUESTNAME...]]
33
34  hostinfo-set --enable GUESTNAME [GUESTNAME...]
35
36  hostinfo-set --disable GUESTNAME [GUESTNAME...]
37
38 =head1 DESCRIPTION
39
40 This command is used to enable or disable the L<hostinfo(8)> feature
41 per-guest.  Note that you also need to enable the hostinfo service for
42 the host as a whole.  You may also wish to configure what each guest
43 has access to.  See L<hostinfo(8)> for information about how to do
44 that.
45
46 The simplest use is to run this with C<--enable> or C<--disable> to
47 (respectively) enable or disable hostinfo for the libvirt guest(s)
48 named on the command line.  For example:
49
50  # virsh list --all
51   Id Name                 State
52  ----------------------------------
53    1 F11                  running
54    - winxp                shut off
55  
56  # hostinfo-set --enable F11
57
58 To enable hostinfo for every guest, you could do:
59
60  hostinfo-set --enable --all
61
62 =cut
63
64
65
66 =head1 OPTIONS
67
68 =over 4
69
70 =item B<--enable>
71
72 Enable hostinfo per-guest for each of the guests listed on the command
73 line.
74
75 =item B<--disable>
76
77 Disable hostinfo per-guest for each of the guests listed on the command
78 line.
79
80 Either C<--enable> or C<--disable> must be given.
81
82 =item B<--all>
83
84 If this option is given, then we try to enable or disable hostinfo for
85 every guest known to libvirt (both running and inactive).
86
87 =back
88
89 =cut
90
91
92
93 =head1 SEE ALSO
94
95 See the L<hostinfo(8)> manpage for the main documentation about
96 hostinfo configuration and troubleshooting.
97
98 To see if hostinfo is enabled or disabled for a particular guest, use
99 the L<hostinfo-status(8)> command.
100
101 See also:
102 L<hostinfo-test(8)>,
103 L<virt-install(1)>,
104 L<virt-manager(1)>,
105 L<http://fedoraproject.org/wiki/Features/Hostinfo>,
106 L<http://libvirt.org/>.
107
108 =head1 AUTHORS
109
110 Richard W.M. Jones (C<rjones at redhat dot com>)
111
112 =head1 COPYRIGHT
113
114 Copyright (C) 2009 Red Hat Inc.
115 L<http://fedoraproject.org/wiki/Features/Hostinfo>
116
117 This program is free software; you can redistribute it and/or modify
118 it under the terms of the GNU General Public License as published by
119 the Free Software Foundation; either version 2 of the License, or
120 (at your option) any later version.
121
122 This program is distributed in the hope that it will be useful,
123 but WITHOUT ANY WARRANTY; without even the implied warranty of
124 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
125 GNU General Public License for more details.
126
127 You should have received a copy of the GNU General Public License
128 along with this program; if not, write to the Free Software
129 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.