]> xenbits.xensource.com Git - libvirt.git/commitdiff
build: Extract pod from source files
authorAndrea Bolognani <abologna@redhat.com>
Tue, 12 Apr 2016 18:32:33 +0000 (20:32 +0200)
committerAndrea Bolognani <abologna@redhat.com>
Mon, 25 Apr 2016 13:40:43 +0000 (15:40 +0200)
Instead of embedding the pod information inside the respective
source files, store them in separate files.

This allows us to reduce the number of custom build rules as
most of the information can be inferred for the file name;
moreover, text editors are more likely to use proper syntax
highlighting for standalone pod files.

tools/Makefile.am
tools/virt-host-validate.c
tools/virt-host-validate.pod [new file with mode: 0644]
tools/virt-pki-validate.in
tools/virt-pki-validate.pod [new file with mode: 0644]
tools/virt-sanlock-cleanup.in
tools/virt-sanlock-cleanup.pod [new file with mode: 0644]
tools/virt-xml-validate.in
tools/virt-xml-validate.pod [new file with mode: 0644]

index 0c6ab37b0b466981baec874e43953280bf6f0eac..e414498bfc8d6c4b3552535889b02d243482954b 100644 (file)
@@ -45,7 +45,11 @@ EXTRA_DIST = \
        virt-sanlock-cleanup.in                         \
        virt-sanlock-cleanup.8                          \
        virt-admin.pod                                  \
+       virt-host-validate.pod                          \
        virt-login-shell.pod                            \
+       virt-pki-validate.pod                           \
+       virt-sanlock-cleanup.pod                        \
+       virt-xml-validate.pod                           \
        virsh.pod                                       \
        libvirt-guests.sysconf                          \
        virsh-edit.c                                    \
@@ -101,37 +105,16 @@ virt-xml-validate: virt-xml-validate.in Makefile
                       -e 's|[@]VERSION@|$(VERSION)|g' \
          < $< > $@ || (rm $@ && exit 1) && chmod +x $@
 
-virt-xml-validate.1: virt-xml-validate.in $(top_srcdir)/configure.ac
-       $(AM_V_GEN)$(POD2MAN) --name VIRT-XML-VALIDATE $< $(srcdir)/$@ \
-           && if grep 'POD ERROR' $(srcdir)/$@ ; then \
-               rm $(srcdir)/$@; exit 1; fi
-
 virt-pki-validate: virt-pki-validate.in Makefile
        $(AM_V_GEN)sed -e 's|[@]sysconfdir@|$(sysconfdir)|g' \
                       -e 's|[@]VERSION@|$(VERSION)|g' \
          < $< > $@ || (rm $@ && exit 1) && chmod +x $@
 
-virt-pki-validate.1: virt-pki-validate.in $(top_srcdir)/configure.ac
-       $(AM_V_GEN)$(POD2MAN) --name VIRT-PKI-VALIDATE $< $(srcdir)/$@ \
-           && if grep 'POD ERROR' $(srcdir)/$@ ; then \
-               rm $(srcdir)/$@; exit 1; fi
-
-virt-host-validate.1: virt-host-validate.c $(top_srcdir)/configure.ac
-       $(AM_V_GEN)$(POD2MAN) --name VIRT-HOST-VALIDATE $< $(srcdir)/$@ \
-           && if grep 'POD ERROR' $(srcdir)/$@ ; then \
-               rm $(srcdir)/$@; exit 1; fi
-
 virt-sanlock-cleanup: virt-sanlock-cleanup.in Makefile
        $(AM_V_GEN)sed -e 's|[@]sysconfdir@|$(sysconfdir)|' \
            -e 's|[@]localstatedir@|$(localstatedir)|' < $< > $@ \
            || (rm $@ && exit 1) && chmod +x $@
 
-virt-sanlock-cleanup.8: virt-sanlock-cleanup.in $(top_srcdir)/configure.ac
-       $(AM_V_GEN)$(POD2MAN) --name VIRT-SANLOCK-CLEANUP --section=8 \
-           $< $(srcdir)/$@ \
-           && if grep 'POD ERROR' $(srcdir)/$@ ; then \
-               rm $(srcdir)/$@; exit 1; fi
-
 noinst_LTLIBRARIES = libvirt_shell.la
 libvirt_shell_la_CFLAGS = \
                $(AM_CFLAGS)                                            \
@@ -288,6 +271,11 @@ endif WITH_WIN_ICON
                && if grep 'POD ERROR' $(srcdir)/$@ ; then \
                rm $(srcdir)/$@; exit 1; fi
 
+%.8: %.pod $(top_srcdir)/configure.ac
+       $(AM_V_GEN)$(POD2MAN) --section=8 $< $(srcdir)/$@ \
+               && if grep 'POD ERROR' $(srcdir)/$@ ; then \
+               rm $(srcdir)/$@; exit 1; fi
+
 install-data-local: install-init install-systemd
 
 uninstall-local: uninstall-init uninstall-systemd
index 5b7fe9b4a15149cb6f118c82b6afebf0554b7f3a..f092824120aa1b43df1ab00548430d7a96da5c57 100644 (file)
@@ -138,77 +138,3 @@ main(int argc, char **argv)
 
     return ret;
 }
-
-/*
-
-=pod
-
-=head1 NAME
-
-  virt-host-validate - validate host virtualization setup
-
-=head1 SYNOPSIS
-
-  virt-host-validate [OPTIONS...] [HV-TYPE]
-
-=head1 DESCRIPTION
-
-This tool validates that the host is configured in a suitable
-way to run libvirt hypervisor drivers. If invoked without any
-arguments it will check support for all hypervisor drivers it
-is aware of. Optionally it can be given a particular hypervisor
-type ('qemu' or 'lxc') to restrict the checks to those relevant
-for that virtualization technology
-
-=head1 OPTIONS
-
-=over 4
-
-=item C<-v>, C<--version>
-
-Display the command version
-
-=item C<-h>, C<--help>
-
-Display the command line help
-
-=item C<-q>, C<--quiet>
-
-Don't display details of individual checks being performed.
-Only display output if a check does not pass.
-
-=back
-
-=head1 EXIT STATUS
-
-Upon successful validation, an exit status of 0 will be set. Upon
-failure a non-zero status will be set.
-
-=head1 AUTHOR
-
-Daniel P. Berrange
-
-=head1 BUGS
-
-Report any bugs discovered to the libvirt community via the
-mailing list C<http://libvirt.org/contact.html> or bug tracker C<http://libvirt.org/bugs.html>.
-Alternatively report bugs to your software distributor / vendor.
-
-=head1 COPYRIGHT
-
-Copyright (C) 2012 by Red Hat, Inc.
-
-=head1 LICENSE
-
-virt-host-validate is distributed under the terms of the GNU GPL v2+.
-This is free software; see the source for copying conditions. There
-is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE
-
-=head1 SEE ALSO
-
-C<virsh(1)>, C<virt-pki-validate>, C<virt-xml-validate>
-
-=cut
-
-*/
diff --git a/tools/virt-host-validate.pod b/tools/virt-host-validate.pod
new file mode 100644 (file)
index 0000000..51edf2d
--- /dev/null
@@ -0,0 +1,67 @@
+=head1 NAME
+
+  virt-host-validate - validate host virtualization setup
+
+=head1 SYNOPSIS
+
+  virt-host-validate [OPTIONS...] [HV-TYPE]
+
+=head1 DESCRIPTION
+
+This tool validates that the host is configured in a suitable
+way to run libvirt hypervisor drivers. If invoked without any
+arguments it will check support for all hypervisor drivers it
+is aware of. Optionally it can be given a particular hypervisor
+type ('qemu' or 'lxc') to restrict the checks to those relevant
+for that virtualization technology
+
+=head1 OPTIONS
+
+=over 4
+
+=item C<-v>, C<--version>
+
+Display the command version
+
+=item C<-h>, C<--help>
+
+Display the command line help
+
+=item C<-q>, C<--quiet>
+
+Don't display details of individual checks being performed.
+Only display output if a check does not pass.
+
+=back
+
+=head1 EXIT STATUS
+
+Upon successful validation, an exit status of 0 will be set. Upon
+failure a non-zero status will be set.
+
+=head1 AUTHOR
+
+Daniel P. Berrange
+
+=head1 BUGS
+
+Report any bugs discovered to the libvirt community via the
+mailing list C<http://libvirt.org/contact.html> or bug tracker C<http://libvirt.org/bugs.html>.
+Alternatively report bugs to your software distributor / vendor.
+
+=head1 COPYRIGHT
+
+Copyright (C) 2012 by Red Hat, Inc.
+
+=head1 LICENSE
+
+virt-host-validate is distributed under the terms of the GNU GPL v2+.
+This is free software; see the source for copying conditions. There
+is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
+PURPOSE
+
+=head1 SEE ALSO
+
+C<virsh(1)>, C<virt-pki-validate>, C<virt-xml-validate>
+
+=cut
index cda55d158ceb24a1242f4a9a8308fa4d2a9bd1ac..92df9ed379e818161e022cab03f40019538d3a6a 100755 (executable)
@@ -320,67 +320,3 @@ fi
 
 
 exit 0
-
-: <<=cut
-=pod
-
-=head1 NAME
-
-  virt-pki-validate - validate libvirt PKI files are configured correctly
-
-=head1 SYNOPSIS
-
-  virt-pki-validate [OPTION]
-
-=head1 DESCRIPTION
-
-This tool validates that the necessary PKI files are configured for
-a secure libvirt server or client using the TLS encryption protocol.
-It will report any missing certificate or key files on the host. It
-should be run as root to ensure it can read all the necessary files
-
-=head1 OPTIONS
-
-=over
-
-=item B<-h, --help>
-
-Display command line help usage then exit.
-
-=item B<-V, --version>
-
-Display version information then exit.
-
-=back
-
-=head1 EXIT STATUS
-
-Upon successful validation, an exit status of 0 will be set. Upon
-failure a non-zero status will be set.
-
-=head1 AUTHOR
-
-Richard Jones
-
-=head1 BUGS
-
-Report any bugs discovered to the libvirt community via the
-mailing list C<http://libvirt.org/contact.html> or bug tracker C<http://libvirt.org/bugs.html>.
-Alternatively report bugs to your software distributor / vendor.
-
-=head1 COPYRIGHT
-
-Copyright (C) 2006-2012 by Red Hat, Inc.
-
-=head1 LICENSE
-
-virt-pki-validate is distributed under the terms of the GNU GPL v2+.
-This is free software; see the source for copying conditions. There
-is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE
-
-=head1 SEE ALSO
-
-C<virsh(1)>, online PKI setup instructions C<http://libvirt.org/remote.html>
-
-=cut
diff --git a/tools/virt-pki-validate.pod b/tools/virt-pki-validate.pod
new file mode 100644 (file)
index 0000000..b216f56
--- /dev/null
@@ -0,0 +1,60 @@
+=head1 NAME
+
+  virt-pki-validate - validate libvirt PKI files are configured correctly
+
+=head1 SYNOPSIS
+
+  virt-pki-validate [OPTION]
+
+=head1 DESCRIPTION
+
+This tool validates that the necessary PKI files are configured for
+a secure libvirt server or client using the TLS encryption protocol.
+It will report any missing certificate or key files on the host. It
+should be run as root to ensure it can read all the necessary files
+
+=head1 OPTIONS
+
+=over
+
+=item B<-h, --help>
+
+Display command line help usage then exit.
+
+=item B<-V, --version>
+
+Display version information then exit.
+
+=back
+
+=head1 EXIT STATUS
+
+Upon successful validation, an exit status of 0 will be set. Upon
+failure a non-zero status will be set.
+
+=head1 AUTHOR
+
+Richard Jones
+
+=head1 BUGS
+
+Report any bugs discovered to the libvirt community via the
+mailing list C<http://libvirt.org/contact.html> or bug tracker C<http://libvirt.org/bugs.html>.
+Alternatively report bugs to your software distributor / vendor.
+
+=head1 COPYRIGHT
+
+Copyright (C) 2006-2012 by Red Hat, Inc.
+
+=head1 LICENSE
+
+virt-pki-validate is distributed under the terms of the GNU GPL v2+.
+This is free software; see the source for copying conditions. There
+is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
+PURPOSE
+
+=head1 SEE ALSO
+
+C<virsh(1)>, online PKI setup instructions C<http://libvirt.org/remote.html>
+
+=cut
index 9855f4244e9e93e6ad2c2222876480f54b2f194f..6551b0476f92624960cc3036d8a4e78150947842 100644 (file)
@@ -59,55 +59,3 @@ do
 done
 
 exit 0
-
-: <<=cut
-=pod
-
-=head1 NAME
-
-  virt-sanlock-cleanup - remove stale sanlock resource lease files
-
-=head1 SYNOPSIS
-
-  virt-sanlock-cleanup
-
-=head1 DESCRIPTION
-
-This tool removes any resource lease files created by the sanlock
-lock manager plugin. The resource lease files only need to exist
-on disks when a guest using the resource is active. This script
-reclaims the disk space used by resources which are not currently
-active.
-
-=head1 EXIT STATUS
-
-Upon successful processing of leases cleanup, an exit status
-of 0 will be set. Upon fatal error a non-zero status will
-be set.
-
-=head1 AUTHOR
-
-Daniel Berrange
-
-=head1 BUGS
-
-Report any bugs discovered to the libvirt community via the
-mailing list C<http://libvirt.org/contact.html> or bug tracker C<http://libvirt.org/bugs.html>.
-Alternatively report bugs to your software distributor / vendor.
-
-=head1 COPYRIGHT
-
-Copyright (C) 2011, 2013 Red Hat, Inc.
-
-=head1 LICENSE
-
-virt-sanlock-cleanup is distributed under the terms of the GNU GPL v2+.
-This is free software; see the source for copying conditions. There
-is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE
-
-=head1 SEE ALSO
-
-C<virsh(1)>, online instructions C<http://libvirt.org/locking.html>
-
-=cut
diff --git a/tools/virt-sanlock-cleanup.pod b/tools/virt-sanlock-cleanup.pod
new file mode 100644 (file)
index 0000000..69a2b5d
--- /dev/null
@@ -0,0 +1,48 @@
+=head1 NAME
+
+  virt-sanlock-cleanup - remove stale sanlock resource lease files
+
+=head1 SYNOPSIS
+
+  virt-sanlock-cleanup
+
+=head1 DESCRIPTION
+
+This tool removes any resource lease files created by the sanlock
+lock manager plugin. The resource lease files only need to exist
+on disks when a guest using the resource is active. This script
+reclaims the disk space used by resources which are not currently
+active.
+
+=head1 EXIT STATUS
+
+Upon successful processing of leases cleanup, an exit status
+of 0 will be set. Upon fatal error a non-zero status will
+be set.
+
+=head1 AUTHOR
+
+Daniel Berrange
+
+=head1 BUGS
+
+Report any bugs discovered to the libvirt community via the
+mailing list C<http://libvirt.org/contact.html> or bug tracker C<http://libvirt.org/bugs.html>.
+Alternatively report bugs to your software distributor / vendor.
+
+=head1 COPYRIGHT
+
+Copyright (C) 2011, 2013 Red Hat, Inc.
+
+=head1 LICENSE
+
+virt-sanlock-cleanup is distributed under the terms of the GNU GPL v2+.
+This is free software; see the source for copying conditions. There
+is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
+PURPOSE
+
+=head1 SEE ALSO
+
+C<virsh(1)>, online instructions C<http://libvirt.org/locking.html>
+
+=cut
index a04fa06f7a0f89f3e63e42581c023ff0f801c365..81fde4d832923fb2c153bcdc009d89871fbcfb11 100644 (file)
@@ -102,116 +102,3 @@ fi
 xmllint --noout --relaxng "$SCHEMA" "$XMLFILE"
 
 exit
-
-: <<=cut
-=pod
-
-=head1 NAME
-
-  virt-xml-validate - validate libvirt XML files against a schema
-
-=head1 SYNOPSIS
-
-  virt-xml-validate XML-FILE [SCHEMA-NAME]
-  virt-xml-validate OPTION
-
-=head1 DESCRIPTION
-
-Validates a libvirt XML for compliance with the published schema.
-The first compulsory argument is the path to the XML file to be
-validated. The optional second argument is the name of the schema
-to validate against. If omitted, the schema name will be inferred
-from the name of the root element in the XML document.
-
-Valid schema names currently include
-
-=over 4
-
-=item C<domainsnapshot>
-
-The schema for the XML format used by domain snapshot configuration
-
-=item C<domain>
-
-The schema for the XML format used by guest domains configuration
-
-=item C<network>
-
-The schema for the XML format used by virtual network configuration
-
-=item C<storagepool>
-
-The schema for the XML format used by storage pool configuration
-
-=item C<storagevol>
-
-The schema for the XML format used by storage volume descriptions
-
-=item C<nodedev>
-
-The schema for the XML format used by node device descriptions
-
-=item C<capability>
-
-The schema for the XML format used to declare driver capabilities
-
-=item C<nwfilter>
-
-The schema for the XML format used by network traffic filters
-
-=item C<secret>
-
-The schema for the XML format used by secrets descriptions
-
-=item C<interface>
-
-The schema for the XML format used by physical host interfaces
-
-=back
-
-=head1 OPTIONS
-
-=over
-
-=item B<-h, --help>
-
-Display command line help usage then exit.
-
-=item B<-V, --version>
-
-Display version information then exit.
-
-=back
-
-=head1 EXIT STATUS
-
-Upon successful validation, an exit status of 0 will be set. Upon
-failure a non-zero status will be set.
-
-=head1 AUTHOR
-
-Daniel P.Berrange
-
-=head1 BUGS
-
-Report any bugs discovered to the libvirt community via the
-mailing list C<http://libvirt.org/contact.html> or bug tracker C<http://libvirt.org/bugs.html>.
-Alternatively report bugs to your software distributor / vendor.
-
-=head1 COPYRIGHT
-
-Copyright (C) 2009-2013 by Red Hat, Inc.
-Copyright (C) 2009 by Daniel P. Berrange
-
-=head1 LICENSE
-
-virt-xml-validate is distributed under the terms of the GNU GPL v2+.
-This is free software; see the source for copying conditions. There
-is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE
-
-=head1 SEE ALSO
-
-C<virsh(1)>, online XML format descriptions C<http://libvirt.org/format.html>
-
-=cut
diff --git a/tools/virt-xml-validate.pod b/tools/virt-xml-validate.pod
new file mode 100644 (file)
index 0000000..1df5a93
--- /dev/null
@@ -0,0 +1,109 @@
+=head1 NAME
+
+  virt-xml-validate - validate libvirt XML files against a schema
+
+=head1 SYNOPSIS
+
+  virt-xml-validate XML-FILE [SCHEMA-NAME]
+  virt-xml-validate OPTION
+
+=head1 DESCRIPTION
+
+Validates a libvirt XML for compliance with the published schema.
+The first compulsory argument is the path to the XML file to be
+validated. The optional second argument is the name of the schema
+to validate against. If omitted, the schema name will be inferred
+from the name of the root element in the XML document.
+
+Valid schema names currently include
+
+=over 4
+
+=item C<domainsnapshot>
+
+The schema for the XML format used by domain snapshot configuration
+
+=item C<domain>
+
+The schema for the XML format used by guest domains configuration
+
+=item C<network>
+
+The schema for the XML format used by virtual network configuration
+
+=item C<storagepool>
+
+The schema for the XML format used by storage pool configuration
+
+=item C<storagevol>
+
+The schema for the XML format used by storage volume descriptions
+
+=item C<nodedev>
+
+The schema for the XML format used by node device descriptions
+
+=item C<capability>
+
+The schema for the XML format used to declare driver capabilities
+
+=item C<nwfilter>
+
+The schema for the XML format used by network traffic filters
+
+=item C<secret>
+
+The schema for the XML format used by secrets descriptions
+
+=item C<interface>
+
+The schema for the XML format used by physical host interfaces
+
+=back
+
+=head1 OPTIONS
+
+=over
+
+=item B<-h, --help>
+
+Display command line help usage then exit.
+
+=item B<-V, --version>
+
+Display version information then exit.
+
+=back
+
+=head1 EXIT STATUS
+
+Upon successful validation, an exit status of 0 will be set. Upon
+failure a non-zero status will be set.
+
+=head1 AUTHOR
+
+Daniel P.Berrange
+
+=head1 BUGS
+
+Report any bugs discovered to the libvirt community via the
+mailing list C<http://libvirt.org/contact.html> or bug tracker C<http://libvirt.org/bugs.html>.
+Alternatively report bugs to your software distributor / vendor.
+
+=head1 COPYRIGHT
+
+Copyright (C) 2009-2013 by Red Hat, Inc.
+Copyright (C) 2009 by Daniel P. Berrange
+
+=head1 LICENSE
+
+virt-xml-validate is distributed under the terms of the GNU GPL v2+.
+This is free software; see the source for copying conditions. There
+is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
+PURPOSE
+
+=head1 SEE ALSO
+
+C<virsh(1)>, online XML format descriptions C<http://libvirt.org/format.html>
+
+=cut