Commit Graph

166 Commits

Author SHA1 Message Date
Daniel Veillard
508de7eedb Release of libvirt-0.9.6 2011-09-22 14:53:23 +08:00
Daniel Veillard
a362f1f7aa Release of libvirt-0.9.5
* configure.ac docs/news.html.in libvirt.spec.in: update for the release
* po/*.po*: fetch updated translations from transifex and rebuilt
2011-09-20 14:17:47 +08:00
Daniel P. Berrange
19ff0ddfbb Update to require sanlock 1.8 for license compliance
Inexplicably the sanlock code all got placed under the GPLv2-only,
so libvirt's use of sanlock introduces a license incompatibility.
The sanlock developers have now rearranged the code such that there
is a 'sanlock_client.so' which is LGPLv2+ while their daemon remains
GPLv2-only. To use the new client library we need to call the new
sanlock_init and sanlock_align APIs instead of sanlock_direct_init
and sanlock_direct_align. These APIs calls are now routed via the
sanlock daemon, instead of doing direct I/O calls to disk.

For all this we require sanlock >= 1.8

* configure.ac: Check for sanlock_client.so instead of sanlock.so
  and fix various comments
* libvirt.spec.in: Mandate sanlock >= 1.8
* src/Makefile.am: Link to -lsanlock_client
* src/locking/lock_driver_sanlock.c: Use sanlock_init and
  sanlock_align
2011-09-20 11:18:54 +08:00
Eric Blake
1726a736fb build: work around lack of MacOS fdatasync
Mingw lacks fsync, but gnulib provides that.  Meanwhile, gnulib does
not (yet) provide fdatasync, so this is a quick hack to fake that
function on MacOS X; we can revert this configure change once gnulib
gives us a real module.

We have been implicitly relying on gnulib's largefile module being
pulled in by other modules, but it's better to make that explicit.

* bootstrap.conf (gnulib_modules): Add fsync.  Make largefile use
explicit.
* configure.ac (AC_CHECK_FUNCS_ONCE): Check for fdatasync, and
fake it with fsync when not present.
2011-09-16 17:42:28 -06:00
Daniel P. Berrange
8e44e5593e Prevent crash from dlclose() of libvirt.so
When libvirt calls virInitialize it creates a thread local
for the virErrorPtr storage, and registers a callback to
cleanup memory when a thread exits. When libvirt is dlclose()d
or otherwise made non-resident, the callback function is
removed from memory, but the thread local may still exist
and if a thread later exists, it will invoke the callback
and SEGV. There may also be other thread locals with callbacks
pointing to libvirt code, so it is in general never safe to
unload libvirt.so from memory once initialized.

To allow dlclose() to succeed, but keep libvirt.so resident
in memory, link with '-z nodelete'. This issue was first
found with the libvirt CIM provider, but can potentially
hit many of the dynamic language bindings which all ultimately
involve dlopen() in some way, either on libvirt.so itself,
or on the glue code for the binding which in turns links
to libvirt

* configure.ac, src/Makefile.am: Ensure libvirt.so is linked
  with -z nodelete
* cfg.mk, .gitignore, tests/Makefile.am, tests/shunloadhelper.c,
  tests/shunloadtest.c: A test case to unload libvirt while
  a thread is still running.
2011-09-16 15:51:31 -06:00
Osier Yang
660cb2530f storage: Add mkfs and libblkid to build system 2011-09-02 21:16:50 +08:00
Matthias Bolte
f2e7064373 hyperv: Add configure check for OpenWSMAN 2011-08-26 17:52:54 +02:00
Matthias Bolte
099d30a825 Fix detection of GnuTLS 1.x.y
Detection based on gnutls_session doesn't work because GnuTLS 2.x.y
comes with a compat.h that defines gnutls_session to gnutls_session_t.

Instead detect this based on LIBGNUTLS_VERSION_MAJOR. Move this from
configure/config.h to gnutls_1_0_compat.h and make sure that all users
include gnutls_1_0_compat.h properly.

Also fix header guard in gnutls_1_0_compat.h.
2011-08-03 19:22:29 +02:00
Daniel Veillard
14c2ca3db9 Release of libvirt-0.9.4
* configure.ac docs/news.html.in libvirt.spec.in: updates for new
  release
* po/*.po*: pulled translations from the transifex teams and regenerated
  localizations
2011-08-03 11:02:42 +08:00
Eric Blake
e4047f0a10 build: allow caching the input to STATIC_ANALYSIS
Right now, every re-run of configure re-evaluates whether a
static analysis tool is in use.  But if you run configure under
coverity, make a tweak, and then do an incremental rebuild with
gcc but not coverity to test the tweak, then rerun a build under
coverity, then configure does not get rerun, and static analysis
ends up with lots of false positives.

This patch caches the static analysis result, and also makes it
easier to force static analysis even if the existing checks are
insufficient to detect newer versions of the static analyzer tools.

* configure.ac (lv_cv_static_analysis): New cache variable.
2011-08-02 15:01:32 -06:00
Matthias Bolte
b590866bdb freebsd: Fix build problem due to picking up the wrong libvirt.h
Gettext annoyingly modifies CPPFLAGS in-place, putting
-I/usr/local/include into the search patch if libintl headers
must be used from that location.  But since we must support
automake 1.9.6 which lacks AM_CPPFLAGS, and since CPPFLAGS is used
prior to INCLUDES, this means that the build picks up the _old_
installed libvirt.h in priority to the in-tree version, leading
to all sorts of weird build failures on FreeBSD.

Fix this by teaching configure to undo gettext's actions, but
to keep any changes required by gettext at the end of INCLUDES
after all in-tree locations are used first.  Also requires
adding a wrapper Makefile.am and making gnulib-tool create
just gnulib.mk files during the bootstrap process.

Signed-off-by: Eric Blake <eblake@redhat.com>
2011-07-29 07:35:54 -06:00
Eric Blake
ff81956ac6 maint: add missing copyright notices
I went with the shorter license notice used by src/libvirt.c,
rather than spelling out the full LGPLv2+ clause into each of
these files.

* configure.ac: Declare copyright.
* all Makefile.am: Likewise.
2011-07-28 15:01:17 -06:00
Michal Privoznik
90074ecfa7 bandwidth: Implement functions to enable and disable QoS
These function executes 'tc' with appropriate arguments to set
desired QoS setting on interface or bridge during its creation.
2011-07-25 13:49:55 +08:00
Eric Blake
5283ea9b1d tests: fix compilation failures
Even though gnutls is a hard-req for libvirt, and gnutls depends
on libtasn1, that does not mean that you have to have the libtasn1
development files installed.  Skip the test rather than failing
compilation in that case.

With newer gcc, the test consumed too much stack space.  Move
things to static storage to fix that.

* configure.ac (AC_CHECK_HEADERS): Check for libtasn1.h.
(HAVE_LIBTASN1): New automake conditional.
* tests/Makefile.am (virnettlsconvirnettlscontexttest_SOURCES)
(virnettlscontexttest_LDADD): Allow compilation without libtasn1.
* tests/virnettlscontexttest.c: Skip test if headers not present.
(struct testTLSCertReq): Alter time members.
(testTLSGenerateCert): Reflect the change.
(mymain): Reduce stack usage.
2011-07-25 13:48:26 +08:00
Eric Blake
12291656b1 save: let iohelper work on O_DIRECT fds
Required for a coming patch where iohelper will operate on O_DIRECT
fds.  There, the user-space memory must be aligned to file system
boundaries (at least 512, but using page-aligned works better, and
some file systems prefer 64k).  Made tougher by the fact that
VIR_ALLOC won't work on void *, but posix_memalign won't work on
char * and isn't available everywhere.

This patch makes some simplifying assumptions - namely, output
to an O_DIRECT fd will only be attempted on an empty seekable
file (hence, no need to worry about preserving existing data
on a partial block, and ftruncate will work to undo the effects
of having to round up the size of the last block written), and
input from an O_DIRECT fd will only be attempted on a complete
seekable file with the only possible short read at EOF.

* configure.ac (AC_CHECK_FUNCS_ONCE): Check for posix_memalign.
* src/util/iohelper.c (runIO): Use aligned memory, and handle
quirks of O_DIRECT on last write.
2011-07-21 16:24:08 -06:00
Jim Fehlig
b8adfcc60c Fix build when using polkit0
V2: Remove policy kit references from virNetServer and use DBus APIs
    directly, if available.
2011-07-12 08:44:55 -06:00
Jim Fehlig
41828514bb Skip some xen tests if xend is not running
Currently, the xen statstest and reconnect tests are only compiled
if xend is running.  Compile them unconditionally if xen headers
are present, but skip the tests at runtime if xend is not running.

This is in response to Eric's suggestion here

https://www.redhat.com/archives/libvir-list/2011-July/msg00367.html
2011-07-07 17:23:09 -06:00
Eric Blake
8437e738fa build: use gnulib pthread_sigmask
Gnulib finally learned how to do pthread_sigmask on mingw.

* .gnulib: Update to latest, for pthread_sigmask.
* bootstrap.conf (gnulib_modules): Add pthread_sigmask.
* configure.ac (AC_CHECK_FUNCS): Drop redundant check.
* src/rpc/virnetclient.c (virNetClientSetTLSSession)
(virNetClientIOEventLoop): Make code unconditional.
* src/util/command.c (virFork): Likewise.
* tools/virsh.c (doMigrate, cmdMigrate): Likewise.
2011-07-07 13:12:44 -06:00
Daniel Veillard
7976d96dd7 Release of libvirt-0.9.3
* configure.ac docs/news.html.in libvirt.spec.in: update for the
  new release
* po/*.po*: updated and regenerated localizations
2011-07-04 15:54:36 +08:00
Daniel P. Berrange
df0b57a95a Convert libvirtd over to the new RPC handling APIs
This guts the libvirtd daemon, removing all its networking and
RPC handling code. Instead it calls out to the new virServerPtr
APIs for all its RPC & networking work

As a fallout all libvirtd daemon error reporting now takes place
via the normal internal error reporting APIs. There is no need
to call separate error reporting APIs in RPC code, nor should
code use VIR_WARN/VIR_ERROR for reporting fatal problems anymore.

* daemon/qemu_dispatch_*.h, daemon/remote_dispatch_*.h: Remove
  old generated dispatcher code
* daemon/qemu_dispatch.h, daemon/remote_dispatch.h: New dispatch
  code
* daemon/dispatch.c, daemon/dispatch.h: Remove obsoleted code
* daemon/remote.c, daemon/remote.h: Rewrite for new dispatch
  APIs
* daemon/libvirtd.c, daemon/libvirtd.h: Remove all networking
  code
* daemon/stream.c, daemon/stream.h: Update for new APIs
* daemon/Makefile.am: Link to libvirt-net-rpc-server.la
2011-06-28 17:33:19 +01:00
Daniel P. Berrange
58b5b14e5e Introduce a generic object for using network sockets
Introduces a simple wrapper around the raw POSIX sockets APIs
and name resolution APIs. Allows for easy creation of client
and server sockets with correct usage of name resolution APIs
for protocol agnostic socket setup.

It can listen for UNIX and TCP stream sockets.

It can connect to UNIX, TCP streams directly, or indirectly
to UNIX sockets via an SSH tunnel or external command

* src/Makefile.am: Add to libvirt-net-rpc.la
* src/rpc/virnetsocket.c, src/rpc/virnetsocket.h: Generic
  sockets APIs
* tests/Makefile.am: Add socket test
* tests/virnetsockettest.c: New test case
* tests/testutils.c: Avoid overriding LIBVIRT_DEBUG settings
* tests/ssh.c: Dumb helper program for SSH tunnelling tests
2011-06-24 11:48:18 +01:00
Matthias Bolte
20991b937b configure: Make libnl optional unless macvtap is required
If macvtap is required then libnl has to be available, otherwise
libnl is optional.
2011-06-23 11:51:00 -04:00
Matthias Bolte
bfbeafbd5d Fix dlopen dependency
Since the addition of the lock manager framework in 6a943419c5
dlopen is always required, but the checks in configure wasn't changed
to reflect that. This didn't show up directly because the VirtualBox
driver linking dlopen in covered it. But disabling the VirtualBox
driver makes the build fail due to missing dlopen.

Change the dlopen check in configure to pick up dlopen when available.

Reported by Ruben Kerkhof.
2011-06-13 14:19:56 -06:00
Eric Blake
28ea3bf31c build: detect Coverity 5.3.0
Coverity 5.3.0 still outputs lots of COVERITY_* variables, but no
longer modifies COVERITY_BUILD_COMMAND in the environment.  Pick
one that seems likely to stay around.

* configure.ac (STATIC_ANALYSIS): Detect newer Coverity.
2011-06-08 04:47:05 -06:00
Osier Yang
31967cff04 build: Fix typos in configure.ac 2011-06-08 15:07:24 +08:00
Daniel Veillard
2c5ded6e82 Release of libvirt-0.9.2
* configure.ac docs/news.html.in libvirt.spec.in: update for release
* po/*.po*: updated translations and regenerated
2011-06-06 11:46:37 +08:00
Daniel P. Berrange
ebfb8c4243 Add call to sanlock_restrict() in QEMU lock driver
In between fork and exec, a connection to sanlock is acquired
and the socket file descriptor is intionally leaked to the
child process. sanlock watches this FD for POLL_HANGUP to
detect when QEMU has exited. We don't want a rogus/compromised
QEMU from issuing sanlock RPC calls on the leaked FD though,
since that could be used to DOS other guests. By calling
sanlock_restrict() on the socket before exec() we can lock
it down.

* configure.ac: Check for sanlock_restrict API
* src/locking/domain_lock.c: Restrict lock acquired in
  process startup phase
* src/locking/lock_driver.h: Add VIR_LOCK_MANAGER_ACQUIRE_RESTRICT
* src/locking/lock_driver_sanlock.c: Add call to sanlock_restrict
  when requested by VIR_LOCK_MANAGER_ACQUIRE_RESTRICT flag
2011-06-02 17:23:44 +01:00
Daniel P. Berrange
9f135031ff Add a plugin for the 'sanlock' project
Sanlock is a project that implements a disk-paxos locking
algorithm. This is suitable for cluster deployments with
shared storage.

* src/Makefile.am: Add dlopen plugin for sanlock
* src/locking/lock_driver_sanlock.c: Sanlock driver
* configure.ac: Check for sanlock
* libvirt.spec.in: Add a libvirt-lock-sanlock RPM
2011-06-02 10:54:01 +01:00
Matthias Bolte
32abd5ee26 remote generator: Legacy support for hyper to long mappings
Remove some special case code that took care of mapping hyper to the
correct C types.

As the list of procedures that is allowed to map hyper to long is fixed
put it in the generator instead annotations in the .x files. This
results in simpler .x file parsing code.

Use macros for hyper to long assignments that perform overflow checks
when long is smaller than hyper. Map hyper to long long by default.

Suggested by Eric Blake.
2011-06-01 15:51:01 +02:00
Matthias Bolte
e85a602bb7 openvz: Automatically disable on non-Linux systems
As OpenVZ is Linux specific.
2011-05-31 09:03:06 +02:00
Michal Privoznik
9c6000579b interface: Implement driver methods for network config transaction API
This is the functionality at the end of the libvirt part of the call
chain - for each function, the corresponding netcf API is called.
2011-05-27 14:33:59 -04:00
Matthias Bolte
95cc5e5908 Allow to explicitly disable the secrets a directory storage driver 2011-05-25 18:31:14 +02:00
Eric Blake
0bb6e15515 build: require newer gettext
Now that RHEL 5.6 ships with gettext 0.17, we can get out of the
stone age and use the newer gettext capabilities and improved
macros for certain configure tests.

* configure.ac (AM_GNU_GETTEXT_VERSION): Bump to 0.17.
(MKINSTALLDIRS): Delete hack that is no longer needed.
* bootstrap.conf (buildreq): Check for minimum gettext version.
Based on a report by Wen Congyang.
2011-05-19 17:54:47 -06:00
Dirk Herrendorefer
5252a06d65 Add support for 'passthru' mode for direct network interfaces
starting with kernel 2.6.38 macvtap supports a 'passthru' mode for
attaching virtual functions of a SRIOV capable network card directly to a VM.
This patch adds the capability to configure such a device.

Signed-off-by: Dirk Herrendoerfer <d.herrendoerfer@herrendoerfer.name>
2011-05-18 08:15:08 -06:00
Eric Blake
d4982b86d2 build: drop unused <sys/syslimits.h> header
<sys/syslimits.h> is not standardized, so portable programs should
not need to rely on it.  If there really is something that we need
where <sys/syslimits.h> provided the limit but <limits.h> did not,
then that would be a candidate for fixing in gnulib.  But this patch
did not turn up any compilation failures on Linux.

* src/internal.h (includes): Drop unused header.
* daemon/libvirtd.h (includes): Likewise.
* configure.ac (AC_CHECK_HEADERS): Likewise.
Based on a report by Matthias Bolte.
2011-05-17 09:34:11 -06:00
Matthias Bolte
6593a5cbfd configure: Fix mpath check on non-Linux systems 2011-05-14 06:40:01 +02:00
Wen Congyang
1ba6e2d926 build: avoid compiler warning during configure
There is no need to redefine _GNU_SOURCE in tests that occur after
gl_INIT, since that macro already AC_DEFINE'd it for us.

Signed-off-by: Eric Blake <eblake@redhat.com>
2011-05-12 08:50:01 -06:00
Christophe Fergeau
29d753c8d5 fix xdr detection and use with recent glibc
glibc 2.13.90 has obsoleted its rpc implementation in favour of
the one provided by the TI-RPC library:

> * The RPC implementation in libc is obsoleted.  Old programs keep working
>   but new programs cannot be linked with the routines in libc anymore.
>   Programs in need of RPC functionality must be linked against TI-RPC.
>   The TI-RPC implemtation is IPv6 enabled and there are other benefits.
>
>   Visible changes of this change include (obviously) the inability to
>   link
>   programs using RPC functions without referencing the TI-RPC library,
>   the
>   removal of the RPC headers from the glibc headers, and the lack of
>   symbols defined in <rpc/netdb.h> when <netdb.h> is installed.
>   Implemented by Ulrich Drepper.
(from glibc NEWS)

Thus with recent glibc, we need to try linking with -ltirpc when looking
for the XDR functions. The daemon also needs to use XDR_CFLAGS to be able
to find the XDR headers stored in /usr/include/tirpc.

When using TI-RPC, there are some warnings about redundant declarations, but
the fix probably belongs in other modules:

/usr/include/tirpc/rpc/rpcent.h:68:13: warning: redundant redeclaration of
'setrpcent' [-Wredundant-decls]
/usr/include/rpc/netdb.h:53:13: note: previous declaration of 'setrpcent'
was here

/usr/include/tirpc/rpc/rpcent.h:69:13: warning: redundant redeclaration of
'endrpcent' [-Wredundant-decls]
/usr/include/rpc/netdb.h:54:13: note: previous declaration of 'endrpcent'
was here

/usr/include/tirpc/rpc/rpc.h:84:12: warning: redundant redeclaration of
'bindresvport' [-Wredundant-decls]
/usr/include/netinet/in.h:440:12: note: previous declaration of
'bindresvport' was here
2011-05-11 14:56:57 -06:00
Daniel P. Berrange
9f5d3a912d Add support for YAJL version 2 API/ABI
Version 2.0.0 or yajl changed API. It is fairly trivial for us to
cope with both APIs in libvirt, so adapt.

* configure.ac: Probe for yajl2 API
* src/util/json.c: Conditional support for yajl2 API
2011-05-11 09:35:10 +01:00
Daniel Veillard
9b889aacef Release of libvirt-0.9.1
* configure.ac libvirt.spec.in docs/news.html.in: update and document
  the release
* po/*.po*: update localizations for german, polish, spanish, ukrainian
  and vietnamese coming from transifex, regenerate
2011-05-05 11:25:13 +08:00
Eric Blake
2ffa8b341c maint: detect clang 2.9
In Fedora 15, with clang 2.8, 'scan-build env' shows:
CCC_ANALYZER_ANALYSIS=-analyzer-check-objc-mem -analyzer-check-security-syntactic -analyzer-check-dead-stores -analyzer-check-objc-unused-ivars -analyzer-check-objc-methodsigs

But in rawhide, with clang 2.9, the same variable is set but
empty, implying the default set of analysis.  We still want
sa_assert defined in that case, to stop clang from hitting
false positives.

* configure.ac (STATIC_ANALYSIS): Detect clang even when the set
of analyses is the default.
2011-05-04 17:22:22 -06:00
Jiri Denemark
3a55213252 build: Use pkg-config for libssh2 check
Currently the build fails if /usr/local/include does not exist since
its use is hardcoded in configure.ac
2011-04-28 14:26:24 +02:00
Jiri Denemark
14c8dc841b build: Ignore old audit library
Check for audit_encode_nv_string in libaudit so that ancient audit
library is ignored rather than trying to compile with libaudit support
and failing.
2011-04-28 14:25:27 +02:00
Osier Yang
53cb23f426 build: Fix problem of building Python bindings
If one specify "--with-python=yes" but no python-devel package
is installed, we ignore it with just a notice message, which
doesn't give clear guide to user.
2011-04-27 21:07:14 +08:00
Daniel P. Berrange
0e867555bd Use gnulib's manywarnings & warnings modules
Remove custom code for checking compiler warnings, using
gl_WARN_ADD instead. Don't list all flags ourselves, use
gnulib's gl_MANYWARN_ALL_GCC to get all possible GCC flags,
then turn off the ones we don't want yet.

* acinclude.m4: Rewrite to use gl_WARN_ADD and gl_MANYWARN_ALL_GCC
* bootstrap.conf: Add warnings & manywarnings
* configure.ac: Switch to gl_WARN_ADD
* m4/compiler-flags.m4: Obsoleted by gl_WARN_ADD
2011-04-05 11:39:35 +01:00
Daniel Veillard
d17e438ad3 Release of libvirt-0.9.0
* configure.ac docs/news.html.in libvirt.spec.in: update for the release
* po/*.po*: update polish translation and regenerate
2011-04-04 20:15:45 +08:00
Markus Groß
0244977180 Implements domainXMLTo/FromNative in libxl driver
* src/Makefile.am src/libvirt_private.syms configure.ac: share and
  reuse the sexpr routines from sexpr.h of the old xen driver
* src/libxl/libxl_driver.c: implements libxlDomainXMLFromNative and
  libxlDomainXMLToNative
2011-03-29 20:57:02 +08:00
Daniel P. Berrange
4591df766d Remove the Open Nebula driver
The Open Nebula driver has been unmaintained since it was first
introduced. The only commits have been for tree-wide cleanups.
It also has a major design flaw, in that it only knows about guests
that it has created itself, which makes it of very limited use.

Discussions wrt evolution of the VMWare ESX driver, concluded that
it should limit itself to single-node ESX operation and not try to
manage the multi-node architecture of VirtualCenter. Open Nebula
is a cluster like Virtual Center, not a single node system, so
the same reasoning applies.

The DeltaCloud project includes an Open Nebula driver and is a much
better fit architecturally, since it is explicitly targetting the
distributed multihost cluster scenario.

Thus this patch deletes the libvirt Open Nebula driver with the
recommendation that people use DeltaCloud for managing it instead.

* configure.ac: Remove probe for xmlrpc & --with-one arg
* daemon/Makefile.am, daemon/libvirtd.c, src/Makefile.am: Remove
  ONE driver build
* src/opennebula/one_client.c, src/opennebula/one_client.h,
  src/opennebula/one_conf.c, src/opennebula/one_conf.h,
  src/opennebula/one_driver.c, src/opennebula/one_driver.c: Delete
  files
* autobuild.sh, libvirt.spec.in, mingw32-libvirt.spec.in: Remove
  build rules for Open Nebula
* docs/drivers.html.in, docs/sitemap.html.in: Remove reference
  to OpenNebula
* docs/drvone.html.in: Delete file
2011-03-28 14:09:11 +01:00
Osier Yang
ab8984e482 Fix syntax error in configure.ac
Which will lead "./configure --with-audit=yes" breaks.
2011-03-28 18:05:32 +08:00
Eric Blake
b5a048ed68 build: shorten libxenlight summary for consistent alignment
* configure.ac: Use xenlight: rather than libxenlight: in summary.
Suggested by Daniel Veillard.
2011-03-25 09:06:18 -06:00