Commit Graph

22440 Commits

Author SHA1 Message Date
Andrea Bolognani
6e742c7f18 build: Always ship virt-login-shell.conf
No need to special-case this one: we can add it to EXTRA_DIST so
that it will be shipped in any case, and if WITH_LOGIN_SHELL
happens to be enabled we mark it for installation as well.
2016-04-25 15:40:44 +02:00
Andrea Bolognani
49ba028aed build: Replace variables in man pages
We can't use eg. @sysconfdir@ directly in the .pod file, because
pod2man(1) will interpret that as a variable name and format it
accordingly.

Instead, we use eg. SYSCONFDIR and use a subsequent sed(1) call
to turn it into the expected @sysconfdir@.
2016-04-25 15:40:44 +02:00
Andrea Bolognani
f806febbdf build: Ensure intermediate files are cleaned up properly
All $(MANINFILES) should be deleted on distclean.
2016-04-25 15:40:44 +02:00
Andrea Bolognani
7351f7fe68 build: Group files
Define $(PODFILES) and $(MANINFILES) so that adding a new man
page only requires changes in a few, well defined spots.
2016-04-25 15:40:44 +02:00
Andrea Bolognani
378338ba28 build: Never ship man pages
The generated man pages may contain information that depend on
the build configuration, so they should not be shipped but
rather always built on the user's machine.
2016-04-25 15:40:44 +02:00
Andrea Bolognani
5b479f3b5b build: Standardize on .pod -> .x.in -> .x
After this commit, all man pages are generated using the same two
steps:

  1. Process a source $command.pod file with pod2man(1) to obtain
     a valid man page in $command.$section.in

  2. Process $command.$section.in with sed(1) to obtain the final
     man page in $command.$section
2016-04-25 15:40:44 +02:00
Andrea Bolognani
9b77ce63f1 build: Perform post-processing on all man pages
Man pages in daemon/ and src/ are being already subjected to this
post-processing step: make it so those in tools/ are as well.
2016-04-25 15:40:44 +02:00
Andrea Bolognani
90709d8d22 build: Build man pages in $(builddir)
No file should be created inside $(srcdir) during build.
2016-04-25 15:40:43 +02:00
Andrea Bolognani
94bf7e5d84 build: Extract pod from source files
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.
2016-04-25 15:40:43 +02:00
Andrea Bolognani
2d1269605c build: Ship virt-admin.pod
This is the source file for the virt-admin(1) manual page, so
it should be shipped.
2016-04-25 15:40:43 +02:00
Peter Krempa
3a703b8120 virsh: host: Use bitmap size in bytes rather than bit count
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1329819
2016-04-25 13:27:16 +02:00
Martin Kletzander
72c313bce9 qemu: Fix off-by-one error in block I/O throttle messages
QEMU_BLOCK_IOTUNE_MAX is the maximum inclusively, so let's modify the
message so it makes sense.

https://bugzilla.redhat.com/show_bug.cgi?id=1329041

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2016-04-25 12:16:38 +02:00
Andrea Bolognani
7867c579ea docs: Fix some formatting oddities
When describing attributes and elements, we mostly stick to
a certain pattern; however, there are a few cases when the
information is not presented in the usual way.

Since there doesn't seem to be any reason not to follow the
tried and true formula, rework those bits to fit the rest of
the documentation.
2016-04-25 12:09:34 +02:00
Andrea Bolognani
1f29f3da06 syntax-check: Enforce <code> inside <dt> elements
Commit 61b070cf20 cleaned up a number of cases where the <dt>
element was used to document symbols, but the symbol itself was
not inside a <code> element.

To make sure we don't end up having to clean up again a few
months from now, introduce a syntax-check rule that can spot
such mistakes.

All existing exceptions are marked as such, with either file
or line granularity depending on the case.
2016-04-25 12:09:34 +02:00
Peter Krempa
d195cffa2e docs: apibuild: Fix VPATH build
libvirt-common.h is generated into builddir/include/libvirt. apibuild.py
only operated on srcdir/inlcude/libvirt. With VPATH build
srcdir/docs/libvirt-libvirt-common.html would not get generated and make
RPM failed.
2016-04-25 08:49:30 +02:00
Cole Robinson
856e84a516 tests: consistently source test-lib.sh in scripts
This unifies the test scripts to all use the similar pattern added for
schematests in ace4aecd. This gives the following

- Enables running all tests from outside of tests/ dir
- Drops redundant abs_* definitions, which are set by test-lib.sh
- Drops unnecessary srcdir variable which was only used for sourcing
    test-lib.sh

Behavior changes:

- srcdir can no longer be overwritten, but I don't know why anyone would
    really need to...
- Script VERBOSE setting no longer prints commands executed by test-lib.sh.
    if anyone cares I suggest handling this in test-lib.sh which already
    has other verbose style handling
2016-04-23 15:41:40 -04:00
Cole Robinson
18644491de vbox: VIR_WARN if we don't support the API version
We presently don't give any indication if the VirtualBox version
isn't in our support whitelist.
2016-04-23 13:40:56 -04:00
Cole Robinson
fa90464faa tests: remove 'reconnect' and 'statstest'
These old tests expect to run against a real xen connection via
xend running on the host. Our intentions for the test suite are
that it doesn't require interacting with any specific host resources,
so these don't really belong here.
2016-04-23 13:37:09 -04:00
Laine Stump
898d62313e docs: remove *other* reference to igmp for IPv6
This finishes the job started by commit 81f3839f8 - removing the
erroneous reference to nonexistent "igmp-ipv6" protocol.
2016-04-22 12:45:59 -04:00
John Ferlan
1e733c1928 docs: Add bold style for <dt><code> elements
Add bolding for <dt><code> elements to make them "stick out" on the
page rather that just a stream of text where the elements only differ
by slightly different font style.
2016-04-22 08:14:17 -04:00
Andrea Bolognani
61b070cf20 docs: Use <code> inside <dt> for symbols
Most of the time, the <dt> tag is used when providing
documentation for a symbol; enclose symbols in <code> tags to
style them appropriately.
2016-04-22 10:36:14 +02:00
Peter Krempa
2f745b63fd docs: apibuild: Fix for python 2.6
Ancient python didn't like the new list added in 99283874. Convert it to
a dict.
2016-04-22 10:14:13 +02:00
Martin Kletzander
2d04f6de77 qemu: Limit maximum block device I/O tune values
The values are currently limited to LLONG_MAX which causes some
problems.  QEMU conveniently changed their maximum to 1e15 (1 PB) which
is enough for some time and we need to adapt to that so that we don't
throw "Unknown error" messages.  Strictly limiting these values actually
fixes some corner case values (off-by-one checks in QEMU probably).

Since values out of the new specified range do not overflow anything,
change the type of error as well.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1317531

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2016-04-22 07:29:03 +02:00
Cole Robinson
4839822faf tests: rename test_conf -> virconftest
And confdata to virconfdata, since 'conf' can mean a few different
things in libvirt
2016-04-21 18:14:07 -04:00
Cole Robinson
6cf52a2ffd tests: consistently name virsh tests with 'virsh-' prefix 2016-04-21 18:14:07 -04:00
Cole Robinson
af9d6b1c8c tests: build: Remove duplicate libvirtd test list
Store the test list in libvirtd_test_scripts, and use it where
appropriate. This also fixes the fact that we didn't ship
virsh-uriprecedence when libvirtd build is disabled.
2016-04-21 18:14:07 -04:00
Cole Robinson
3cc2a9e0d4 virconf: Handle conf file without ending newline
$ echo -n 'log_level=1' > ~/.config/libvirt/libvirtd.conf
$ libvirtd --timeout=10
2014-10-10 10:30:56.394+0000: 6626: info : libvirt version: 1.1.3.6, package: 1.fc20 (Fedora Project, 2014-09-08-17:50:42, buildvm-05.phx2.fedoraproject.org)
2014-10-10 10:30:56.394+0000: 6626: error : main:1261 : Can't load config file: configuration file syntax error: /home/rjones/.config/libvirt/libvirtd.conf:1: expecting a value: /home/rjones/.config/libvirt/libvirtd.conf

Rather than try to fix this in the depths of the parser, just catch
the case when a config file doesn't end in a newline, and manually
append a newline to the content before parsing

https://bugzilla.redhat.com/show_bug.cgi?id=1151409
2016-04-21 18:14:07 -04:00
Laine Stump
81f3839f87 docs: remove reference to non-existent "igmp-ipv6" protocol
IGMP is used on IPv4 networks tp setup multicast group memberships. On
IPv6, this job is done by Multicast Listener Discovery (MLD), which
uses ICMPv6 packets rather than its own IP protocol number like IGMP.

The nwfilter documentation lists "igmp-ipv6" as one of the possible
protocols, but this is ignored (and stripped from the xml). This patch
removes that erroneous reference.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1038888
2016-04-21 16:32:12 -04:00
Laine Stump
bf3d9f305e network: fix DHCPv6 on networks with prefix != 64
According to the dnsmasq manpage, the netmask for IPv4 address ranges
will be auto-deteremined from the interface dnsmasq is listening on,
but it can't do this for IPv6 for some reason - it instead assumes a
network prefix of 64 for all IPv6 address ranges. If this is
incorrect, dnsmasq will refuse to give out an address to clients,
instead logging this message:

 dnsmasq-dhcp[2380]: no address range available for DHCPv6 request via virbr0

The solution is for libvirt to add ",$prefix" to all IPv6 dhcp-range
arguments when building the dnsmasq.conf file.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1033739
2016-04-21 15:06:25 -04:00
Peter Krempa
888dda4b33 conf: disk: extract validation of startup policy 2016-04-21 17:04:06 +02:00
Peter Krempa
3fa8125f25 conf: disk: Extract checking of removable status 2016-04-21 17:04:06 +02:00
Peter Krempa
2d3557b251 conf: disk: Move validation of disk bus vs disk type 2016-04-21 17:04:06 +02:00
Peter Krempa
d9cab30a9c conf: disk: extract sgio/rawio validation 2016-04-21 17:04:06 +02:00
Peter Krempa
af93e2bf3d conf: disk: Don't bother setting removable state to 0 by default 2016-04-21 17:04:06 +02:00
Peter Krempa
d3ab5ff49d conf: disk: Initialize closed device tray state to 0
Additionally avoid initializing it after being calloced.
2016-04-21 17:04:06 +02:00
Peter Krempa
21aad98cad conf: disk: Extract disk type and device right away
Additionally switch to using a common temp variable for the xml
elements.
2016-04-21 17:04:06 +02:00
Peter Krempa
5211c90738 conf: disk: Remove custom single-use temporary variables
Use a single temporary variable instead shortening the code.
2016-04-21 17:04:06 +02:00
Peter Krempa
ffaacefada conf: disk: Mark VIR_DOMAIN_DISK_IO_DEFAULT as 0 and simplify parsing 2016-04-21 17:04:06 +02:00
Peter Krempa
8a3dea1f11 conf: disk: Sanitize parsing of disk format 2016-04-21 17:04:06 +02:00
Peter Krempa
f3f931b6c0 conf: disk: Avoid temporary variable when parsing driver name 2016-04-21 17:04:06 +02:00
Peter Krempa
b8635011ec conf: disk: Split out parsing of disk <driver> element 2016-04-21 17:04:06 +02:00
Peter Krempa
a309f5754e conf: disk: Extract verification of disk config
Rather than checking individual fields in dubious places extract them to
a central point.
2016-04-21 17:04:06 +02:00
Andrea Bolognani
71c22b186c build: Fix default network generation on FreeBSD
FreeBSD's sed(1) doesn't support using "\n" to insert a newline,
so the installed default.xml file ends up containing a literal
"n" between tags; to work around this problem, add a tr(1)
invocation as suggested by the sed FAQ[1].

[1] http://sed.sourceforge.net/sedfaq4.html (4.1 c)
2016-04-21 16:45:20 +02:00
Michal Privoznik
01acd6f52b daemonStreamHandleRead: Rework to follow our coding pattern
Usually, we have this 'if() goto cleanup;' pattern in our new
code. It is going to be useful here too. Thing is, there was a
memleak. If there has been an error in
virNetServerProgramSendStreamError() or
virNetServerProgramSendStreamData() created message was never
freed.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2016-04-21 16:29:41 +02:00
Michal Privoznik
30898d80d7 virNet{Client,Server}*Stream: Update comment
After 434de30da5 the status values are prefixed VIR_NET_
rather than REMOTE_.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2016-04-21 16:29:41 +02:00
Michal Privoznik
ae886429e4 daemon stream: Remove useless empty lines from header file
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2016-04-21 16:29:41 +02:00
Michal Privoznik
7747c3bfca daemon stream: Convert @tx in daemonClientStream to bool
This structure item is used as pure boolean. There's no need to
hold whole integer for it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2016-04-21 16:29:41 +02:00
Michal Privoznik
5441a25ff6 daemon stream: Prefer bool over unsigned int var:1
There is no need for doing that since we have a bool type.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2016-04-21 16:29:41 +02:00
Michal Privoznik
8def0a22a3 daemonClientStream: Use unsigned int to store stream @serial
The stream serial number is the serial number of the RPC call
that initiated a data transfer. And as such can never be
negative. Moreover, when looking up internal state for a stream,
the serial numbers are compared. But hey, the serial number in
message header is unsigned too!

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2016-04-21 16:29:41 +02:00
Peter Krempa
3883a29782 include: common: Fix function formatting 2016-04-21 15:39:08 +02:00