Document testing method.
[virt-hostinfo.git] / hostinfo-status / hostinfo-status.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-status - check if hostinfo is enabled for a guest
29
30 =head1 SYNOPSIS
31
32  hostinfo-status [GUESTNAME [GUESTNAME...]]
33
34 =head1 DESCRIPTION
35
36 This command finds out if hostinfo is enabled or disabled for a
37 particular guest.
38
39 For example:
40
41  # hostinfo-status myguest
42  myguest: hostinfo is enabled on serial port 1 (ttyS1/COM2)
43
44 If no guest names are listed on the command line, this command
45 displays the status of all guests known to libvirt.
46
47 If you want to find out if the hostinfo feature is enabled for the
48 host as a whole, you should use this command instead:
49
50  service hostinfo status
51
52 (see L<hostinfo(8)>).
53
54 =cut
55
56 =head1 OPTIONS
57
58 =over 4
59
60 =item B<--quiet>
61
62 Use this option from scripts to test if hostinfo is enabled
63 for a single guest without the verbose messages:
64
65  if hostinfo-status --quiet myguest; then
66    echo Yes, hostinfo is enabled for this guest.
67  else
68    echo No, hostinfo is not enabled for this guest.
69  fi
70
71 =back
72
73 =cut
74
75
76
77
78 =head1 RETURN VALUE
79
80 Normally C<hostinfo-status> returns 0 if the command was successful,
81 or 2 if there was an error.
82
83 However if you use the C<--quiet> option, it returns 0 if hostinfo
84 is enabled, 1 if hostinfo is disabled, or 2 if there was an error.
85
86 =cut
87
88
89
90 =head1 SEE ALSO
91
92 L<hostinfo(8)>,
93 L<hostinfo-set(8)>,
94 L<hostinfo-test(8)>,
95 L<virt-install(1)>,
96 L<virt-manager(1)>,
97 L<http://fedoraproject.org/wiki/Features/Hostinfo>,
98 L<http://libvirt.org/>.
99
100 =head1 AUTHORS
101
102 Richard W.M. Jones (C<rjones at redhat dot com>)
103
104 =head1 COPYRIGHT
105
106 Copyright (C) 2009 Red Hat Inc.
107 L<http://fedoraproject.org/wiki/Features/Hostinfo>
108
109 This program is free software; you can redistribute it and/or modify
110 it under the terms of the GNU General Public License as published by
111 the Free Software Foundation; either version 2 of the License, or
112 (at your option) any later version.
113
114 This program is distributed in the hope that it will be useful,
115 but WITHOUT ANY WARRANTY; without even the implied warranty of
116 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
117 GNU General Public License for more details.
118
119 You should have received a copy of the GNU General Public License
120 along with this program; if not, write to the Free Software
121 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.