Commit Graph

540 Commits

Author SHA1 Message Date
Cole Robinson
6b57c3de0f spec: Use power64 macro
Covers the whole ppc64 family. Example bug for binutils:

https://bugzilla.redhat.com/show_bug.cgi?id=834651
2014-07-25 15:20:13 -04:00
Jiri Denemark
b983742029 spec: Enable sanlock on qemu_kvm_arches for RHEL
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2014-07-23 16:43:30 +02:00
Michal Privoznik
28d54aab05 examples: Introduce domtop
There's this question on the list that is asked over and over again.
How do I get {cpu, memory, ...} usage in percentage? Or its modified
version: How do I plot nice graphs like virt-manager does?

It would be nice if we have an example to inspire people. And that's
what domtop should do. Yes, it could be written in different ways, but
I've chosen this one as I think it show explicitly what users need to
implement in order to imitate virt-manager's graphing.

Note: The usage is displayed from host perspective. That is, how much
host CPUs the domain is using. But it should be fairly simple to
switch do just guest CPU usage if needed.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2014-07-18 16:39:54 +02:00
Jiri Denemark
d659b412a8 spec: Consolidate with_qemu* definitions
Decisions whether qemu driver and libvirt-daemon-{qemu,kvm} packages
should be built on various OS/arch combinations were scattered around
the spec file. Let's make it easier to see where qemu driver is going to
be built.
2014-07-18 10:07:16 +02:00
Eric Blake
13228b854c spec: fix invalid syntax
Commit 20e01504 broke 'make rpm':

error: line 540: Unknown tag:     %elif 020 >= 12 || 0 >= 6

Apparently, even though shell has elif so that you can do a chain
of conditionals, the rpm spec file does not, and you have to nest
things instead.

* libvirt.spec.in: Convert %elif to proper nested %if.

Signed-off-by: Eric Blake <eblake@redhat.com>
2014-07-15 17:11:56 -06:00
Jiri Denemark
20e01504a1 spec: Update polkit dependencies for CVE-2013-4311
Use secured polkit on distros which provide it. However, RHEL-6 will
still allow for older polkit-0.93 rather than forcing polkit-0.96-5
which is not available in all RHEL-6 releases.
2014-07-15 16:34:53 +02:00
Ján Tomko
a3a2080eac Actually fix the spec file
There was a '%' missing before the last {rhel}.
Tested on RHEL-7 this time.
2014-07-09 09:04:15 +02:00
Ján Tomko
f762aaf782 Fix the indentation in libvirt.spec.in
Over 66% of my last commit 66e7061 was not indented properly.
2014-07-08 15:55:31 +02:00
Ján Tomko
66e7061210 Don't require iptables-ipv6 on >= F17 and RHEL >= 7
We only need ip6tables, which is now a part of the iptables package:
http://pkgs.fedoraproject.org/cgit/iptables.git/commit/?h=1392835

This needlessly pulls in iptables-services:
https://bugzilla.redhat.com/show_bug.cgi?id=1101510
which can conflict with firewalld:
https://bugzilla.redhat.com/show_bug.cgi?id=1101484
2014-07-08 15:29:46 +02:00
Michal Privoznik
614581f32b Introduce domain_capabilities
This new module holds and formats capabilities for emulator. If you
are about to create a new domain, you may want to know what is the
host or hypervisor capable of. To make sure we don't regress on the
XML, the formatting is not something left for each driver to
implement, rather there's general format function.

The domain capabilities is a lockable object (even though the locking
is not necessary yet) which uses reference counter.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2014-07-03 12:22:37 +02:00
Daniel Veillard
b083528e56 Release of libvirt-1.2.6 2014-07-02 13:50:18 +08:00
Daniel P. Berrange
65d8c92a75 Add pkg-config files for libvirt-qemu & libvirt-lxc
For some reason there have never been pkg-config files created
for the libvirt-qemu.so and libvirt-lxc.so libraries.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2014-06-23 16:17:27 +01:00
Nehal J Wani
baafe668fa Add helper program to create custom leases
Introduce helper program to catch events from dnsmasq and maintain a custom
lease file per network. It supports dhcpv4 and dhcpv6. The file is saved as
"<interface-name>.status".

Each lease contains the following info:
<expiry-time (epoch time)> <mac> <iaid> <ip-address> <hostname> <clientid>

Example of custom leases file content:
[
    {
        "iaid": "1221229",
        "ip-address": "2001:db8:ca2:2:1::95",
        "mac-address": "52:54:00:12:a2:6d",
        "hostname": "Fedora20",
        "client-id": "00:04:1a:c1:d9:6b:5a:0a:e2:bc:f8:4b:1e:37:2e:38:22:55",
        "expiry-time": 1393244216
    },
    {
        "ip-address": "192.168.150.208",
        "mac-address": "52:54:00:11:56:b3",
        "hostname": "Wani-PC",
        "client-id": "01:52:54:00:11:56:b3",
        "expiry-time": 1393244248
    }
]

src/Makefile.am:
   * Add options to compile the helper program

src/network/bridge_driver.c:
   * Introduce networkDnsmasqLeaseFileNameCustom()
   * Invoke helper program along with dnsmasq
   * Delete the .status file when corresponding n/w is destroyed.

src/network/leaseshelper.c
   * Helper program to create the custom lease file
2014-06-02 11:45:10 +01:00
Daniel Veillard
7455be8ea9 Forgot spec changelog in 1.2.5 commit 2014-06-02 09:52:44 +08:00
Jiri Denemark
96eb7523e4 spec: Don't install nonexistent test_libvirt_lockd.aug
test_libvirt_lockd.aug is only generated when qemu driver is enabled.
2014-05-06 14:04:54 +02:00
Jiri Denemark
01cf9effcc spec: sanlock is x86_64 only on RHEL 2014-05-06 14:04:53 +02:00
Daniel Veillard
791fb3f668 Release of libvirt-1.2.4
* docs/news.html.in libvirt.spec.in: updates for release
* po/*.po*: fetched new localization and regenerated
2014-05-04 14:41:29 +08:00
Sahid Orentino Ferdjaoui
b21795bb5b Add a new example to illustrate domain migration
This commit adds a new example to illustrate peer to
peer domain migration with virDomainMigrateToURI.

Signed-off-by: Sahid Orentino Ferdjaoui <sahid.ferdjaoui@cloudwatt.com>
2014-04-30 14:29:07 +01:00
Eric Blake
110c0db88c conf: create common storage RNG grammar file
Having two tiny files with a couple definitions didn't make
as much sense as one common file, especially since I plan to
add more definitions and use it in more places.

* docs/schemas/storageencryption.rng: Merge this...
* docs/schemas/storagefilefeatures.rng: ...and this, into...
* docs/schemas/storagecommon.rng: ...this new file.
* docs/schemas/Makefile.am (schema_DATA): Reflect renames.
* docs/schemas/storagevol.rng: Likewise.
* docs/schemas/domaincommon.rng: Likewise.
* libvirt.spec.in: Likewise.
* mingw-libvirt.spec.in: Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
2014-04-14 07:07:01 -06:00
Cédric Bosdonnat
ec70f3696f Introduce --without-pm-utils to get rid of pm-is-supported dependency
This uses the dbus api of systemd to check the power management
capabilities of the node.
2014-04-11 15:51:10 -06:00
Daniel Veillard
c53663ccdb Release of libvirt-1.2.3
* docs/news.html.in libvirt.spec.in: update for the release
* po/*.po*: pull updated translations and regenerate
2014-04-01 15:29:53 +08:00
Michael Chapman
9add02a0b0 spec: move some dirs into appropriate subpackages
This commit moves a few directories into more appropriate subpackages.
In a few cases a directory is owned by two subpackages, however this is
OK as long as the permissions and ownership for the directory are
consistent between them.

- %{_sysconfdir}/libvirt/qemu/

  Used by the qemu and network drivers.

  When building with separate driver modules, this directory is only
  owned by l-d-d-network. l-d-d-qemu has a hard dependency on
  l-d-d-network, which means this directory is created with the
  correct permissions and ownership, however it's clearer if both
  subpackages own the directory independently.

- %{_sysconfdir}/libvirt/nwfilter/

  Used by the nwfilter driver only.

  This directory is currently always owned by libvirt-daemon. This
  commit moves it into l-d-d-nwfilter when building with separate
  driver modules.

- %{_localstatedir}/run/libvirt/network/

  Used by the network and nwfilter drivers.

  When building without separate driver modules, this directory is
  should be owned by libvirt-daemon only if either of these drivers
  are enabled. When building with separate driver modules, this
  directory should be owned by l-d-d-nwfilter in addition to
  l-d-d-network.

- %{_datadir}/libvirt/networks/ and
  %{_datadir}/libvirt/networks/default.xml

  Used only by the %post scriptlet in libvirt-daemon-config-network.

Signed-off-by: Michael Chapman <mike@very.puzzling.org>
2014-03-17 16:43:24 +01:00
Jiri Denemark
201082488f spec: Let translations be properly updated
Libvirt tarball contains po/stamp-po file which prevents any po/*.gmo
file to be regenerated even if a corresponding po/*.po file is newer. By
removing the stamp-po file, all *.gmo files are properly updated if
required. This allows downstreams to provide patches that update
translations.
2014-03-06 22:18:11 +01:00
Daniel Veillard
e8684eb541 Release of libvirt-1.2.2
- docs/news.html.in libvirt.spec.in: update for the release
* po/*.po*: update localization and merge
2014-03-02 23:09:45 +08:00
Peter Krempa
1600966749 spec: Fix braces around macros
In commit 72f7658ba2 I've added a few
macros with bad bracing. Although they work as expected fix them so that
we use uniform syntax.
2014-02-26 14:31:30 +01:00
Eric Blake
dea81f40ec spec: make systemd_daemon usage configurable
On Fedora 20, I added this to my '~/.rpmmacros':

%_without_udev 1
%_without_storage_mpath 1
%_without_storage_disk 1

and uninstalled systemd-devel (which also removed device-mapper-devel).
Then I ran 'make rpm', and inspected the results:

$ ldd ~/rpmbuild/BUILD/libvirt-1.2.2/daemon/.libs/libvirtd | grep syst
$

Then I reinstalled systemd-devel, where I now see:

$ ldd ~/rpmbuild/BUILD/libvirt-1.2.2/daemon/.libs/libvirtd | grep syst
  libsystemd-daemon.so.0 => /lib64/libsystemd-daemon.so.0 (0x00007ffb858ba000)
$

Oops - the build is non-deterministic, where the final binary
depends on my build environment.  The fix is to require
systemd-devel in all situations where the code base uses it.
Now ~/.rpmmacros can contain "%define _without_systemd_daemon 1"
to explicitly disable use of the library, but the library is now
a strict build requirement for normal builds; if systemd-devel
is not installed, the user now gets an up-front warning:

$ rpmbuild -ta libvirt-1.2.2.tar.gz
error: Failed build dependencies:
       systemd-devel is needed by libvirt-1.2.2-1.fc20.x86_64

* libvirt.spec.in (with_systemd_daemon): New variable.
(BuildRequires): Require systemd-devel for more than just udev.
(%configure): Make choice of systemd_daemon explicit.

Signed-off-by: Eric Blake <eblake@redhat.com>
2014-02-26 06:02:57 -07:00
Eric Blake
7cac3afa50 spec: require device-mapper-devel for storage-disk
On Fedora 20, with the following in my ~/.rpmmacros:

%_without_udev 1
%_without_storage_mpath 1

and with device-mapper-devel uninstalled, 'make rpm' fails with:

checking for libdevmapper.h... no
configure: error: You must install device-mapper-devel/libdevmapper >= 1.0.0 to compile libvirt
error: Bad exit status from /var/tmp/rpm-tmp.Wo9pOG (%build)

This is a rather late point to be issuing an error; better is
to flag missing packages up front.  The fix is to match the logic
in configure.ac on when devmapper is required (for both mpath and
storage).  While at it, rbd storage is not dependent on mpath.
With this patch applied, I now get:

$ rpmbuild -ta libvirt-1.2.2.tar.gz
error: Failed build dependencies:
       device-mapper-devel is needed by libvirt-1.2.2-1.fc20.x86_64

until either installing the package or further modifying
~/.rpmmacros to add "%_without_storage_disk 1".

* libvirt.spec.in (BuildRequires): Fix build when mpath is
disabled.

Signed-off-by: Eric Blake <eblake@redhat.com>
2014-02-26 06:02:06 -07:00
Eric Blake
fa2939986d spec: explicitly avoid bhyve on Linux
Generally, we try to make the spec file tweakable via user
variables, so that they can select a different subset of sub-rpms
to build.  We also try to explicitly list all driver config
options, rather than leaving the chance that the rpm build may be
non-deterministic based on what the user had installed locally.
But in the case of the recent bhyve hypervisor driver, there is
no port of bhyve to Linux, so it is easier to just blindly
disable it for now.  If someone ever does try to port bhyve to
Fedora, we can make the spec file conditional at that point.

* libvirt.spec.in (%configure): Don't try to build bhyve.

Signed-off-by: Eric Blake <eblake@redhat.com>
2014-02-26 06:00:56 -07:00
Peter Krempa
72f7658ba2 spec: Use correct versions of libgfapi in RHEL builds
RHEL still uses the 3.4.0 package of libgfapi and the package is built
only for x86_64.
2014-02-26 13:24:45 +01:00
Eric Blake
dca5ce4c65 spec: add missing dep of libvirt-daemon-config-nwfilter
Similar to cf76c4b, if modules are used, then nwfilter configuration
requires the nwfilter driver module.

Signed-off-by: Eric Blake <eblake@redhat.com>
2014-02-13 06:39:51 -07:00
Eric Blake
d181452132 Revert "spec: require libvirt-wireshark from libvirt metapackage"
This reverts commit 8d6c3659b8.

After further list discussion, it was decided that pulling in
wireshark as a dependency is a bit too much for the base 'libvirt'
package.  Remember also that 'libvirt-devel' is also not pulled in
by the base 'libvirt' - the metapackage exists for full
functionality of libvirtd, rather than to pull in all subpackages.
2014-02-13 06:39:19 -07:00
Eric Blake
8d6c3659b8 spec: require libvirt-wireshark from libvirt metapackage
In general, the 'libvirt' metapackage should pull in all subpackages.
Fix this for the wireshark subpackage created in commit f9ada9f.

* libvirt.spec.in (Requires): Add dependency.

Signed-off-by: Eric Blake <eblake@redhat.com>
2014-02-12 13:27:38 -07:00
Thierry Parmentelat
cf76c4b3dd spec: add missing dep of libvirt-daemon-config-network
When building modules, libvirt-daemon-config-network requires
libvirt-daemon-driver-network to ensure the 'default' network
is setup properly

Signed-off-by: Eric Blake <eblake@redhat.com>
2014-02-12 13:24:01 -07:00
Thierry Parmentelat
902f6148de spec: require libvirt-daemon-driver-interface only when built
Signed-off-by: Eric Blake <eblake@redhat.com>
2014-02-12 13:14:11 -07:00
Eric Blake
f9ada9f3d0 rpm: create libvirt-wireshark sub-package
On Fedora 20, with wireshark-devel installed, 'make rpm' failed
due to installed but unpackaged files related to wireshark.  As
F20 is already released without wireshark, I chose to add a new
sub-package that is enabled only for F21 and later.  Furthermore,
all existing wireshark plugins belong to the wireshark package,
so I got to invent behavior of how the first third-party wireshark
module will behave.

* libvirt.spec.in (with_wireshark): Add new conditional.
* configure.ac (ws-plugindir): Improve wording.

Signed-off-by: Eric Blake <eblake@redhat.com>
2014-02-05 06:46:00 -07:00
Daniel Veillard
7b84b1673a Release of libvirt-1.2.1
* docs/news.html.in libvirt.spec.in: updated for the release
* po/*.po*: updated localization from transifex and regenerated
2014-01-16 17:25:58 +08:00
Michal Privoznik
e26cae6b85 examples: Resurrect domsuspend example
This partially reverts 5eb4b04211 and 62774afb6b.

Rewrite the domsuspend example from scratch. This time do it right.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2013-12-24 17:17:35 +01:00
Laine Stump
a13051b224 specfile: fix make rpm when with_driver_modules is 1
Commit ff76566 moved around things in the specfiles to put
driver-specific files into their appropriate sub-packages (when
with_driver_modules == 1), but accidentally changed things so that the
deamon-driver-network and daemon-config-network files were only
included in a package when with_driver_modules == 0. This broke "make
rpm" on fedora (where with_driver_modules == 1).

This patch follows the pattern (already used for the files in other
sub-modules) of duplicating the files for the main package
(!with_driver_modules) and the sub-package (with_driver_modules).
2013-12-17 14:33:00 +02:00
Daniel P. Berrange
950c2a550f Move examples/domain-events/event-c to examples/object-events
The domain events demo program isn't really tied to domain
events anymore, so rename it to object events.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-12-13 16:07:54 +00:00
Laine Stump
10ba5c4535 Add another missing % on %{_libdir} macro
Signed-off-by: Laine Stump <laine@laine.org>
2013-12-12 15:49:19 +02:00
Daniel P. Berrange
c1e55451f3 Add missing % on %{_libdir} macro in RPM
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-12-12 13:36:03 +00:00
Michael Chapman
81764660ae spec: clean up libvirtd and virtlockd service mgmt
- systemctl and the %systemd_* RPM macros can take multiple unit names
  in the one invocation. Make use of this to avoid repeated systemd
  daemon reloads.

- virtlockd was only properly enabled and disabled when using systemd,
  but when systemd RPM macros were not available (e.g. on Fedora < 18).
  Make sure it's enabled when systemd RPM macros are present, or when
  using initscripts.

- Always use "reload" on virtlockd, not "condrestart". This allows it to
  cleanly re-execute itself without losing running state. Ignore any
  error should the reload fail.

- Move the reloading of virtlockd and libvirtd via their initscripts
  into the daemon package's %postun scriptlet. These services must be
  restarted after all of the libvirt-daemon-driver-* packages have
  been upgraded during the same RPM transaction.

- Add a %triggerpostun executed only when upgrading an older
  libvirt-daemon. As an older package would only reload libvirtd during
  %post, and the newer package would only reload libvirtd during
  %postun, such an upgrade would not reload libvirtd at all without the
  trigger.

Signed-off-by: Michael Chapman <mike@very.puzzling.org>
2013-12-10 12:02:37 +01:00
Jim Fehlig
ff76566ec0 spec: move driver-specific files to driver subpackages
The libvirt-daemon package contains several driver-specific files,
directories, and script, which can be problematic when building the
package with multiple hypervisor support, e.g. both QEMU and Xen.

E.g. installing a QEMU+Xen enabled libvirt-daemon on a Xen-only system
will result in the creation of qemu and kvm groups and a qemu user.

Move the driver-specific files, directories, and script to the
respective driver subpackages.
2013-12-06 14:00:51 -07:00
Jim Fehlig
2984e26146 spec: Define hypervisor-specific files together
Collapse the various {with_<hypervisor>} conditionals in the
libvirt-daemon package files section into a single {with_<hypervisor>}
conditional
2013-12-06 14:00:51 -07:00
Jim Fehlig
753dcf635d spec: Conditionally specify some hypervisor-specific files
Move some hypervisor-specific files in the libvirt-daemon subpackage
within conditionals for those hypervisors.
2013-12-06 14:00:51 -07:00
Jim Fehlig
b531255b6e spec: Fix files list when building without driver modules
The daemon-config-{network,nwfilter} subpackages are built regardless
of whether or not with_driver_modules is defined, therefore don't
conditionally define their files list.
2013-12-06 14:00:51 -07:00
Jim Fehlig
f422ab05b8 spec: Only add libvirt-daemon pre install script if building with qemu
The %pre script in libvirt-daemon is specific to qemu, so only include
it if building with qemu support.
2013-12-06 14:00:51 -07:00
Jim Fehlig
dc4973f85b spec: Fix unconditional references of nwfilter
Ensure nwfilter files lists and dependencies are conditional upon
with_nwfilter being defined.
2013-12-06 14:00:51 -07:00
Peter Krempa
5eb4b04211 examples: Remove broken bad example
The domsuspend example code is a really old and bad exmample of (how not
to use) the libvirt API. Remove it as it's apparent that nobody tried to
use it. It was broken and nobody complained.
2013-12-04 18:56:06 +01:00
Daniel Veillard
4e41a2a370 Release of libvirt-1.2.0
* configure.ac docs/news.html.in libvirt.spec.in: update for release
* po/*.po*: update and merge localizations from transifex
2013-12-02 12:17:51 +08:00
Eric Blake
318ea3cb77 storage: initial support for linking with libgfapi
We support gluster volumes in domain XML, so we also ought to
support them as a storage pool.  Besides, a future patch will
want to take advantage of libgfapi to handle the case of a
gluster device holding qcow2 rather than raw storage, and for
that to work, we need a storage backend that can read gluster
storage volume contents.  This sets up the framework.

Note that the new pool is named 'gluster' to match a
<disk type='network'><source protocol='gluster'> image source
already supported in a <domain>; it does NOT match the
<pool type='netfs'><source><target type='glusterfs'>,
since that uses a FUSE mount to a local file name rather than
a network name.

This and subsequent patches have been tested against glusterfs
3.4.1 (available on Fedora 19); there are likely bugs in older
versions that may prevent decent use of gfapi, so this patch
enforces the minimum version tested.  A future patch may lower
the minimum.  On the other hand, I hit at least two bugs in
3.4.1 that will be fixed in 3.5/3.4.2, where it might be worth
raising the minimum: glfs_readdir is nicer to use than
glfs_readdir_r [1], and glfs_fini should only return failure on
an actual failure [2].

[1] http://lists.gnu.org/archive/html/gluster-devel/2013-10/msg00085.html
[2] http://lists.gnu.org/archive/html/gluster-devel/2013-10/msg00086.html

* configure.ac (WITH_STORAGE_GLUSTER): New conditional.
* m4/virt-gluster.m4: new file.
* libvirt.spec.in (BuildRequires): Support gluster in spec file.
* src/conf/storage_conf.h (VIR_STORAGE_POOL_GLUSTER): New pool
type.
* src/conf/storage_conf.c (poolTypeInfo): Treat similar to
sheepdog and rbd.
(virStoragePoolDefFormat): Don't output target for gluster.
* src/storage/storage_backend_gluster.h: New file.
* src/storage/storage_backend_gluster.c: Likewise.
* po/POTFILES.in: Add new file.
* src/storage/storage_backend.c (backends): Register new type.
* src/Makefile.am (STORAGE_DRIVER_GLUSTER_SOURCES): Build new files.
* src/storage/storage_backend.h (_virStorageBackend): Documet
assumption.

Signed-off-by: Eric Blake <eblake@redhat.com>
2013-11-25 11:02:52 -07:00
Daniel P. Berrange
a7a1244a73 Remove python binding
The python binding now lives in

  http://libvirt.org/git/?p=libvirt-python.git

that repo also provides an RPM which is upgrade compatible
with the old libvirt-python sub-RPM.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-11-25 16:08:00 +00:00
Jiri Denemark
604f79b360 spec: Don't save/restore running VMs on libvirt-client update
The previous attempt (commit d65e0e1) removed just one of two
libvirt-guests restarts that happened on libvirt-client update. Let's
remove the last one too :-)

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

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2013-11-25 16:50:53 +01:00
Cole Robinson
d65e0e1466 spec: Don't save/restore running VMs on libvirt-client update
Restarting an active libvirt-guests.service is the equivalent of
doing:

/usr/libexec/libvirt-guests.sh stop
/usr/libexec/libvirt-guests.sh start

Which in a default configuration will managedsave every running VM,
and then restore them. Certainly not something we should do every
time the libvirt-client RPM is updated.

Just drop the try-restart attempt, I don't know what purpose it
serves anyways.

https://bugzilla.redhat.com/show_bug.cgi?id=962225
2013-11-22 09:32:18 -05:00
Jiri Denemark
0ee2364319 spec: Restrict virt-login-shell usage
https://bugzilla.redhat.com/show_bug.cgi?id=1033614

As virt-login-shell is an SUID binary, we should restrict its usage to
just the users chosen by an administrator to use virt-login-shell as
their login shell. This can easily be done by making the binary
executable only by users from a new virtlogin group.
2013-11-22 14:57:23 +01:00
Michael Chapman
caaeb691a3 spec: fix libvirt-docs subpackage on RHEL-6
RHEL-6's rpmbuild wipes the docdir for a (sub-)package if any %doc
directives are present, prior to copying in the marked documentation.
This means we can't prepopulate this directory with the HTML
documentation during the %install phase.

Instead, move the HTML documentation to a temporary directory during
%install and mark the contents of this temporary directory with %doc.

This fixes a build regression introduced in

  commit e23216da9a
  Author: Cole Robinson <crobinso@redhat.com>
  Date:   Wed Sep 25 13:20:40 2013 -0400

    spec: Clean up distribution of ChangeLog (and others)

where the libvirt-docs sub-RPM gained a %doc directive, thus
triggering the RPM bug.

Signed-off-by: Michael Chapman <mike@very.puzzling.org>
2013-11-20 12:58:24 +00:00
Daniel Veillard
a4a7c7e9c4 Release of libvirt-1.1.4
* configure.ac docs/news.html.in libvirt.spec.in: update for the release
* po/*.po*: update localizations from transifex and regenerate
2013-11-04 12:30:41 +08:00
Daniel P. Berrange
23142ac91a Push RPM deps down into libvirt-daemon-driver-XXXX sub-RPMs
For inexplicable reasons, many of the 3rd party package deps
were left against the 'libvirt-daemon' RPM when the drivers
were split out. This makes a minimal install heavier that
it should be. Push them all down into libvirt-daemon-driver-XXX
so they're only pulled in when truly needed

With this change applied, a minimal install of just the
libvirt-daemon-driver-lxc RPM is reduced by 41 MB on a
Fedora 19 host.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-10-29 14:31:18 +00:00
Daniel P. Berrange
8adc92694f Move virt-login-shell into libvirt-login-shell sub-RPM
Many people will not want the setuid virt-login-shell binary
installed by default, so move it into a separate sub-RPM
named libvirt-login-shell. This RPM is only generated if
LXC is enabled

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-10-21 14:03:52 +01:00
Daniel Veillard
a72940f954 Release of libvirt-1.1.3
- configure.ac docs/news.html.in libvirt.spec.in: update for release
- po/*.po*: updated localization and regenerated
2013-10-01 15:04:14 +08:00
Cole Robinson
e23216da9a spec: Clean up distribution of ChangeLog (and others)
- Move COPYING* to libvirt-client, so every package pulls them in
- Move AUTHORS ChangeLog.gz NEWS README TODO from -daemon to -docs
- Drop duplicate distribution of docs in -python

https://bugzilla.redhat.com/show_bug.cgi?id=977099
2013-09-25 13:45:36 -04:00
Daniel P. Berrange
922b7fda77 Add support for using 3-arg pkcheck syntax for process (CVE-2013-4311)
With the existing pkcheck (pid, start time) tuple for identifying
the process, there is a race condition, where a process can make
a libvirt RPC call and in another thread exec a setuid application,
causing it to change to effective UID 0. This in turn causes polkit
to do its permission check based on the wrong UID.

To address this, libvirt must get the UID the caller had at time
of connect() (from SO_PEERCRED) and pass a (pid, start time, uid)
triple to the pkcheck program.

This fix requires that libvirt is re-built against a version of
polkit that has the fix for its CVE-2013-4288, so that libvirt
can see 'pkg-config --variable pkcheck_supports_uid polkit-gobject-1'

Signed-off-by: Colin Walters <walters@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-09-18 15:13:42 +01:00
Eric Blake
12509c7999 spec: make client-only testing easier
Several recent patches cleaned up 'make rpm' for the situation
when client_only is true; these were done by manual spec file
editing (since it's relatively hard to come by a RHEL 5 s390
box).  Make it easier to do in the future via a simpler command
line override.

* libvirt.spec.in (client_only): Allow for override.

Signed-off-by: Eric Blake <eblake@redhat.com>
2013-09-05 07:06:36 -06:00
Eric Blake
c021f5cecc spec: default vbox according to libvirtd build
Commit ba5f3c7 moved virtualBox support into libvirtd, but the spec
file was still unconditionally requesting it even when not building
the server side.  Thankfully there were no ill effects for a
client_only build, as most uses of %{with_vbox} were guarded by
%{with_libvirtd}; but we might as well avoid confusion by more
closely matching the makefile.

* libvirt.spec.in (with_vbox): Hoist to server conditionals.

Signed-off-by: Eric Blake <eblake@redhat.com>
2013-09-04 14:55:43 -06:00
Eric Blake
d42906fd00 spec: fix rpm build when lxc disabled
'make rpm' failed if ~/.rpmmacros contains '%_without_lxc 1',
which simulates the case of not having lxc available.

RPM build errors:
    File not found: /home/eblake/rpmbuild/BUILDROOT/libvirt-1.1.1-1.fc19.x86_64/etc/libvirt/virt-login-shell.conf
    File not found by glob: /home/eblake/rpmbuild/BUILDROOT/libvirt-1.1.1-1.fc19.x86_64/usr/share/man/man1/virt-login-shell.1*
    File not found: /home/eblake/rpmbuild/BUILDROOT/libvirt-1.1.1-1.fc19.x86_64/usr/bin/virt-login-shell
make: *** [rpm] Error 1

Reported by Dan Berrange.

* libvirt.spec.in: Mark virt-login-shell as conditional on lxc.

Signed-off-by: Eric Blake <eblake@redhat.com>
2013-09-04 11:30:18 -06:00
Daniel Veillard
85240daba2 Release of libvirt-1.1.2
* configure.ac docs/news.html.in libvirt.spec.in: update for the release
* po/*.po*: merged new localizations and regenerated
2013-09-02 09:47:37 +08:00
Eric Blake
70363ea9ff build: add configure option to disable gnulib tests
The gnulib testsuite is relatively stable - the only times it is
likely to have a test change from pass to fail is on a gnulib
submodule update or a major system change (such as moving from
Fedora 18 to 19, or other large change to libc).  While it is an
important test for end users on arbitrary machines (to make sure
that the portability glue works for their machine), it mostly
wastes time for development testing (as most developers aren't
making any of the major changes that would cause gnulib tests
to alter behavior).  Thus, it pays to make the tests optional
at configure time, defaulting to off for development, on for
tarballs, with autobuilders requesting it to be on.  It also
helps to allow a make-time override, via VIR_TEST_EXPENSIVE=[01]
(much the way automake sets up V=[01] for overriding the configure
time default of how verbose to be).

Automake has some pretty hard-coded magic with regards to the
TESTS variable; I had quite a job figuring out how to keep
'make distcheck' passing regardless of the configure option
setting in use, while still disabling the tests at runtime
when I did not configure them on and did not use the override
variable.  Thankfully, we require GNU make, which lets me
hide some information from Automake's magic handling of TESTS.

* bootstrap.conf (bootstrap_epilogue): Munge gnulib test variable.
* configure.ac (--enable-expensive-tests): Add new enable switch.
(VIR_TEST_EXPENSIVE_DEFAULT, WITH_EXPENSIVE_TESTS): Set new
witnesses.
* gnulib/tests/Makefile.am (TESTS): Make tests conditional on
configure settings and the VIR_TEST_EXPENSIVE variable.
* tests/Makefile.am (TESTS_ENVIRONMENT): Expose VIR_TEST_EXPENSIVE
to all tests.
* autobuild.sh: Enable all tests during autobuilds.
* libvirt.spec.in (%configure): Likewise.
* mingw-libvirt.spec.in (%mingw_configure): Likewise.
* docs/hacking.html.in: Document the option.
* HACKING: Regenerate.

Signed-off-by: Eric Blake <eblake@redhat.com>
2013-08-12 10:02:38 -06:00
Eric Blake
6094b1ff19 build: avoid -lgcrypt with newer gnutls
https://bugzilla.redhat.com/show_bug.cgi?id=951637

Newer gnutls uses nettle, rather than gcrypt, which is a lot nicer
regarding initialization.  Yet we were unconditionally initializing
gcrypt even when gnutls wouldn't be using it, and having two crypto
libraries linked into libvirt.so is pointless, but mostly harmless
(it doesn't crash, but does interfere with certification efforts).

There are three distinct version ranges to worry about when
determining which crypto lib gnutls uses, per these gnutls mails:
2.12: http://lists.gnu.org/archive/html/gnutls-devel/2011-03/msg00034.html
3.0: http://lists.gnu.org/archive/html/gnutls-devel/2011-07/msg00035.html

If pkg-config can prove version numbers and/or list the crypto
library used for static linking, we have our proof; if not, it
is safer (even if pointless) to continue to use gcrypt ourselves.

* configure.ac (WITH_GNUTLS): Probe whether to add -lgcrypt, and
define a witness WITH_GNUTLS_GCRYPT.
* src/libvirt.c (virTLSMutexInit, virTLSMutexDestroy)
(virTLSMutexLock, virTLSMutexUnlock, virTLSThreadImpl)
(virGlobalInit): Honor the witness.
* libvirt.spec.in (BuildRequires): Make gcrypt usage conditional,
no longer needed in Fedora 19.

Signed-off-by: Eric Blake <eblake@redhat.com>
2013-08-12 09:58:48 -06:00
Daniel P. Berrange
38550ae809 Add an example config file for virtlockd
The virtlockd daemon supports an /etc/libvirt/virtlockd.conf
config file, but we never installed a default config, nor
created any augeas scripts. This change addresses that omission.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-08-09 15:03:04 +01:00
Daniel P. Berrange
6ff0cffd55 Add a man page for virtlockd daemon
Create a virtlockd.pod.in file containing the man page
content for virtlockd.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-08-09 11:56:34 +01:00
Dan Walsh
54d69f540c Introduce a virt-login-shell binary
Add a virt-login-shell binary that can be set as a user's
shell, such that when they login, it causes them to enter
the LXC container with a name matching their user name.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-08-08 16:36:31 +01:00
Jiri Denemark
010065d702 spec: Explicitly claim ownership of channel subdir
As both /var/lib/libvirt/qemu and /var/lib/libvirt/qemu/channel/target
are owned by us, the intermediate /var/lib/libvirt/qemu/channel should
be owned by us too.
2013-08-02 17:22:33 +02:00
Daniel P. Berrange
311eae8257 Remove reference to python/tests from RPM %doc
The python/tests files were recently deleted, but a reference was
left in the RPM %doc entry

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-08-02 16:29:43 +02:00
Jiri Denemark
462863a3ee spec: Don't mix commands with macro definitions
%build section should first define all required macros and then run
commands. Interleaving them makes it harder to spot what commands are
run.
2013-07-30 17:13:40 +02:00
Jiri Denemark
d5cd5bf031 spec: Use --enable-werror on RHEL
As RHEL provides a stable tool chain, we don't have to worry about
frequent changes in reported compiler warnings (which prevents us from
enabling -Werror unconditionally).
2013-07-30 17:05:44 +02:00
Jiri Denemark
a718d28279 spec: RHEL-7 does not have sanlock on i686 2013-07-30 17:05:44 +02:00
Peter Krempa
9c7de20a2b spec: Disable libssh2 support for RHEL
https://bugzilla.redhat.com/show_bug.cgi?id=905513

Libssh2 isn't reliable enough to support the libvirt transport using it.
The problems include mishandling of "known_hosts" files that may confuse
users.
2013-07-30 17:05:43 +02:00
Daniel P. Berrange
6aa5ebbecd Support apparmor in RPM spec
If libapparmor-devel happens to be installed when building the
RPM, it will failed due to unlisted virt-aa-helper in %files.
Add support for apparmor in the spec, so that we can explicitly
turn it on/off, defaulting to off in all distros. This causes
--without-apparmor to be given to configure, preventing the
build failures if the user happens to have libapparmor-devel
present.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-07-30 14:13:58 +01:00
Jiri Denemark
095ba43903 spec: Cat test-suite.log if make check fails
Current automake enables parallel test by default, which means test
details are only logged in test-suite.log and not printed to stderr.
This patch makes test failures directly visible in RPM build logs even
when parallel tests are turned on.
2013-07-29 18:14:02 +02:00
Cole Robinson
3347a42032 python: Drop TODO
File hasn't been really touched for 7 years. And with recent rawhide
changes it contributed to an RPM build failure. Let's drop it.

This also removes installation of a libvirt-python doc dir, so drop
handling of it from the RPM spec.
2013-07-29 07:54:18 -04:00
Daniel Veillard
034d322978 Release of libvirt-1.1.0
* configure.ac docs/news.html.in libvirt.spec.in: updated for the release
* po/*.po*: updated localizations and regenerated
2013-07-01 17:22:49 +08:00
Eric Blake
3a214482ec spec: require xen-devel for libxl driver
When using 'rpmbuild --define "_without_xen 1"', but on a new enough
Fedora where %{with_libxl} still gets set to 1 by default, the
build dependencies were incomplete, which could result in 'make rpm'
failing because ./configure failed to build the libxl driver.

* libvirt.spec.in (BuildRequires): Fix xen-devel condition.

Signed-off-by: Eric Blake <eblake@redhat.com>
2013-06-29 14:56:05 -06:00
Daniel Veillard
0c737dfb44 Add polkit policy for API checks to rpm spec 2013-06-25 13:44:47 +02:00
Ján Tomko
31d42506fb conf: add features to volume target XML
Add <features> and <compat> elements to volume target XML.

<compat> is a string which for qcow2 represents the QEMU version
it should be compatible with. Valid values are 0.10 and 1.1.
1.1 is implicit if the <features> element is present, otherwise
qemu-img default is used. 0.10 can be specified to explicitly
create older images after the qemu-img default changes.

<features> contains optional features, so far
<lazy_refcounts/> is available, which enables caching of reference
counters, improving performance for snapshots.
2013-06-21 13:25:30 +02:00
Cole Robinson
ce672cde62 spec: Enable KVM support on ARM
F20/rawhide has support for this.

From: Peter Robinson <pbrobinson@gmail.com>
2013-06-18 07:33:23 -04:00
Cole Robinson
db459dbdb9 spec: Drop Requires: vbox
Since this package isn't provided by any stock RH based distro. The
upstream RPMs are called VirtualBox anyways.
2013-06-08 18:32:59 -04:00
Jiri Denemark
3b50a711f0 spec: Explicitly require libgcrypt-devel
Our configure.ac says:

    Not all versions of gnutls include -lgcrypt, and so we add
    it explicitly for the calls to gcry_control/check_version

Thus we cannot rely on gnutls-devel to bring grcypt-devel as a
dependency.
2013-06-03 15:15:44 +02:00
Daniel Veillard
4497ef50dc Release of libvirt 1.0.6
* configure.ac docs/news.html.in libvirt.spec.in: update for the release
* po/*.po*: pull localization updates and regenerate the po
2013-06-03 12:09:56 +02:00
Viktor Mihajlovski
831909a94e spec: Build vbox packages only for x86 architectures
Commit 6ab6bc19f0 has introduced separate
daemon/driver packages for vbox. These should only be built for x86
architectures which is done hereby.

Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
2013-05-24 10:11:00 -06:00
Eric Blake
de483052a2 maint: follow recommended practice for using LGPL
https://www.gnu.org/licenses/gpl-howto.html states:

You should also include a copy of the license itself somewhere in the
distribution of your program. All programs, whether they are released
under the GPL or LGPL, should include the text version of the GPL. In
GNU programs the license is usually in a file called COPYING.

If you are releasing your program under the LGPL, you should also
include the text version of the LGPL, usually in a file called
COPYING.LESSER. Please note that, since the LGPL is a set of
additional permissions on top of the GPL, it's important to include
both licenses so users have all the materials they need to understand
their rights.

* configure.ac (COPYING): No more games with non-git file.
* COPYING: New file, copied from gnulib.
* COPYING.LIB: Rename...
* COPYING.LESSER: ...to this.
* .gitignore: Track licenses in git.
* cfg.mk (exclude_file_name_regexp--sc_copyright_address): Tweak
rule.
* libvirt.spec.in (daemon, client, python): Reflect rename.

Signed-off-by: Eric Blake <eblake@redhat.com>
2013-05-20 14:15:21 -06:00
Daniel P. Berrange
6ab6bc19f0 Add libvirt-daemon-vbox & libvirt-daemon-driver-vbox RPMs
Now the VirtualBox driver is a loadable module, it needs
to live in its own sub-RPM

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-05-17 17:09:29 +01:00
Eric Blake
9615ca59c6 spec: fix outdated comment
https://bugzilla.redhat.com/show_bug.cgi?id=963016 points out that
we don't use initscripts by default on Fedora any more.

* libvirt.spec.in (Requires): Better explanation of gettext.

Signed-off-by: Eric Blake <eblake@redhat.com>
2013-05-14 21:07:40 -06:00
Eric Blake
a2584d58f6 spec: proper soft static allocation of qemu uid
https://bugzilla.redhat.com/show_bug.cgi?id=924501 tracks a
problem that occurs if uid 107 is already in use at the time
libvirt is first installed.  In response that problem, Fedora
packaging guidelines were recently updated.  This fixes the
spec file to comply with the new guidelines:
https://fedoraproject.org/wiki/Packaging:UsersAndGroups

* libvirt.spec.in (daemon): Follow updated Fedora guidelines.

Signed-off-by: Eric Blake <eblake@redhat.com>
2013-05-06 14:05:05 -06:00
Laine Stump
9eafa25116 build: fix make rpm failure
Commit 297c99a accidentally put a { where a ( belonged, causing make
rpm to fail.
2013-05-03 07:52:22 -04:00
Michal Privoznik
297c99a567 qemu: Generate agent socket path if missing
It's not desired to force users imagine path for a socket they
are not even supposed to connect to. On the other hand, we
already have a release where the qemu agent socket path is
exposed to XML, so we cannot silently drop it from there.
The new path is generated in form:

$LOCALSTATEDIR/lib/libvirt/qemu/channel/target/$domain.$name

for qemu system mode, and

$XDG_CONFIG_HOME/qemu/lib/channel/target/$domain.$name

for qemu session mode.
2013-05-02 16:40:24 +02:00
Daniel Veillard
8e20a23fb6 Release of libvirt-1.0.5
* configure.ac docs/news.html.in libvirt.spec.in: updated for the release
* po/*.po*: pulled and merged a number of new localization updates
2013-05-02 15:04:50 +08:00
Eric Blake
e2472e6957 spec: collect all BuildRequires into one area
Conditional BuildRequires: should be at the top level, rather
than appearing in conditional sub-package sections.  This
appears to be the only offender.

* libvirt.spec.in (BuildRequires): Move libblkid-devel into
correct area.

Signed-off-by: Eric Blake <eblake@redhat.com>
2013-05-01 20:55:59 -06:00
Jiri Denemark
6f1b9c8d2a spec: Require pod2man when running autoreconf
Since commit b8a32e0e94, all man pages
depend on configure.ac so that they are properly regenerated whenever
libvirt version changes. Thus libvirt.spec needs to have a build
dependency on pod2man when %{enable_autotools} is set.
2013-04-08 16:11:16 +02:00
Michal Privoznik
5e5ca84e31 test: Return Libvirt logo as domain screenshot
This is just a bare Easter Egg. Whenever a user runs virDomainScreenshot
over a domain in test driver, he'll get the Libvirt PNG logo in return.
2013-04-02 14:38:56 +02:00
Daniel Veillard
89d730201f Release of libvirt-1.0.4
- configure.ac docs/news.html.in libvirt.spec.in: updates for the release
- po/*.po*: fetch translation updates from Transifex and regenerate
2013-04-01 10:57:04 +08:00