* configure.in: Use PortableXDR if available.
* qemud/internal.h: Use "socketcompat.h".
* qemud/qemud.c: Use <signal.h>.
* src/sexpr.c: Use <stdlib.h> instead of <malloc.h>.
* src/socketcompat.h: Include <sys/un.h> for Mac OS X.
A NUL byte at beginning of input, or just after a newline
would provoke an invalid buf[-1] access (possible segfault).
* src/libvirt.c (virConnectAuthCallbackDefault):
* src/qemu_conf.c: Add "static" and "const" attributes to some globals.
* src/qemu_conf.h: Update a declaration.
* src/qemu_driver.c (qemud_driver): Declare static.
Author: Jim Meyering <meyering@redhat.com>
a proposed system for letting iptables know how to
reload our rules. The proposed system wasn't accepted
so, although there might be some other theoretical
use for this, let's just remove it.
iptables configuration using the lokkit --custom-rules command.
Basically, we write out our rules to /var/lib/libvirt/iptables
and run lokkit --custom-rules so that if e.g. iptables is
restarted or the user edits their firewall configuration, then
libvirt's rules get reloaded.
* configure.in: xdr functions may require -lxdr.
* configure.in, src/Makefile.am: Extra linking flags for
building libvirt DLL.
* src/socketcompat.h: Hide Windows Winsock incompatibilities
in a separate header file.
* src/remote_internal.c: Switch to using socketcompat.h /
socket_errno().
* src/test.c: Switch to using socketcompat.h.
* gnulib/lib/arpa/.cvsignore: Ignore another generated file.
* src/qparams.c: Include <config.h>.
* src/qparams.c, src/qparams.h, src/Makefile.am: Added a
separate 'qparams' module for handling query parameters.
* src/remote_internal.c: Factor out query parameter code so
it uses the 'qparams' module.
* src/xs_internal.[ch]: patch from Saori Fukuta to fix the
detach-disk command when using Xen tap devices.
* docs/libvir.html: typo fix from Jim Meyering
Daniel
Given code like: T *var = calloc (n, sizeof (T));
Convert to this: T *var = calloc (n, sizeof (*var));
This first-cut change adjusts all malloc, calloc, and
realloc statements.
The only binary differences are in remote_internal.c
(due to the bug fix) and in xmlrpc.c (due to factorization).
* python/libvir.c: As above.
* qemud/event.c: Likewise.
* qemud/mdns.c: Likewise.
* qemud/qemud.c: Likewise.
* qemud/remote.c: Likewise.
* src/bridge.c: Likewise.
* src/buf.c: Likewise.
* src/conf.c: Likewise.
* src/hash.c: Likewise.
* src/iptables.c: Likewise.
* src/openvz_conf.c: Likewise.
* src/qemu_conf.c: Likewise.
* src/qemu_driver.c: Likewise.
* src/test.c: Likewise.
* src/xen_internal.c: Likewise.
* src/xen_unified.c: Likewise.
* src/xm_internal.c: Likewise.
* src/xml.c: Likewise.
* tests/qemuxml2argvtest.c: Likewise.
* src/xmlrpc.c (xmlRpcValuePtr): Likewise, and minor factorization.
* src/remote_internal.c (remoteAuthMakeCredentials): Use the right
type when allocating space for an array of cred _pointers_.
* src/console.c, src/console.h, src/virsh.c: Disable
text console on Windows.
* src/libvirt.c: Use replacement getpass from Gnulib.
* src/libvirt.c: Initialize Winsock before use.
* src/remote_internal.c: Header file fixes for Windows.
Don't fail if AI_ADDRCONFIG isn't defined. Disable
unsupported stuff under Windows.
* src/uuid.c: ENODATA unavailable on Windows, use EIO instead.
* src/virsh.c: No uid_t / getuid on Windows.
* src/virsh.c: No O_SYNC on Windows.
* src/.cvsignore: Ignore *.loT files (generated under Windows).
* proxy/libvirt_proxy.c: Bail out earlier --without-xen.
* src/proxy_internal.c: Don't build proxy client side if
configured --without-xen.
* src/iptables.c, src/iptables.h: Disable this code if
configured --without-qemu.
* src/nodeinfo.c: If no 'uname' function, set model name to
empty string (for Windows).
* src/xen_unified.h, src/util.c, src/test.c: Include <winsock2.h>
on Windows.
* src/util.c: Disable virExec* and virFileLinkPointsTo on
MinGW.
New files go into these directories:
gnulib/lib
gnulib/m4
gnulib/tests
* bootstrap: A wrapper around gnulib-tool.
* configure.in: Invoke gl_EARLY and gl_INIT, being careful to put gl_EARLY
before any macro that uses AC_COMPILE_IFELSE.
(AC_OUTPUT): Add lib/Makefile and gl-tests/Makefile. Remove m4/Makefile.
* Makefile.am (SUBDIRS): Add gnulib/lib and remove m4. Add gnulib/tests
early enough that those tests run before any libvirt unit tests.
* m4/Makefile.am: Remove file. Not needed.
* src/Makefile.am (INCLUDES): Add -I$(top_srcdir)/gnulib/lib -I../gnulib/lib.
(LDADDS, libvirt_la_LIBADD): Add ../gnulib/lib/libgnu.la.
* src/nodeinfo.c: Include "physmem.h".
* qemud/qemud.c, src/remote_internal.c: Include "getaddrinfo.h".
(MEMINFO_PATH, linuxNodeInfoMemPopulate): Remove definitions.
(virNodeInfoPopulate): Use physmem_total, not linuxNodeInfoMemPopulate.
* tests/Makefile.am (INCLUDES): Add -I$(top_srcdir)/gnulib/lib -I../gnulib/lib.
(LDADDS): Add ../gnulib/lib/libgnu.la.
* qemud/Makefile.am (libvirtd_LDADD): Add ../gnulib/lib/libgnu.la.
* tests/nodeinfotest.c (linuxTestCompareFiles): No longer read total
memory from a file.
Update expected output not to include "Memory: NNNN"
* tests/nodeinfodata/linux-nodeinfo-1.txt:
* tests/nodeinfodata/linux-nodeinfo-2.txt:
* tests/nodeinfodata/linux-nodeinfo-3.txt:
* tests/nodeinfodata/linux-nodeinfo-4.txt:
* tests/nodeinfodata/linux-nodeinfo-5.txt:
* tests/nodeinfodata/linux-nodeinfo-6.txt:
* src/test.c [WITH_TEST]: Remove definition of _GNU_SOURCE that
would conflict with the one now in "config.h".
* autogen.sh: Add -I gnulib/m4.
* src/conf.c, src/sexpr.c: Don't define _GNU_SOURCE.
Instead, include "config.h".
* qemud/qemud.c: Remove definition of _GNU_SOURCE.
* src/openvz_driver.c: Likewise.
* src/qemu_driver.c: Likewise.
* src/remote_internal.c: Likewise.
* configure.in: Use AC_CONFIG_AUX_DIR(build-aux), so that a bunch
of gettextize-generated files go into build-aux/, rather than in
the top-level directory.
* .cvsignore: Adjust.
* build-aux/.cvsignore: New file.
Author: Jim Meyering <meyering@redhat.com>
* python/libvir.c, python/libvirt_wrap.h, qemud/qemud.c,
qemud/remote.c, src/internal.h, src/openvz_conf.c,
src/openvz_driver.c, src/proxy_internal.h, src/qemu_conf.c,
src/qemu_driver.c, src/remote_internal.h, src/test.h, src/util.c,
src/xen_unified.c, src/xen_unified.h, tests/nodeinfotest.c,
tests/qemuxml2argvtest.c, tests/qemuxml2xmltest.c, tests/reconnect.c,
tests/sexpr2xmltest.c, tests/virshtest.c, tests/xencapstest.c,
tests/xmconfigtest.c, tests/xml2sexprtest.c:
Change #include <> to #include "" for local includes.
Removed many includes from src/internal.h and put them in
the C files which actually use them.
Removed <ansidecl.h> - unused.
Added a comment around __func__.
Removed a clashing redefinition of VERSION symbol.
All limits (PATH_MAX etc) now done in src/internal.h, so we
don't need to include those headers in other files.
* configure.in: curses is not actually required to build libvirt
* configure.in, src/virsh.c: Make readline optional. If not
available then virsh is built without support for command
line editing.
src/xend_internal.c src/xm_internal.c src/xs_internal.c:
cleanup the xen subdriver table, remove the type entry and
always return "Xen" from the unified entry point.
Daniel
* qemud/qemud.c (tls_port, tcp_port, mdns_name, tls_allowed_ip_list):
(tls_allowed_dn_list): Remove "const", now that we free these.
(unix_sock_rw_mask): Rename from unix_sock_rw_perms, so that
the latter name can be used as a local string variable, so that the
variable name matches the config attribute name.
(unix_sock_ro_mask): Rename from unix_sock_ro_perms, likewise.
(remoteCheckDN, remoteCheckAccess): Adapt to const removal.
(qemudDispatchServer): Check for heap allocation failure.
(remoteConfigGetStringList): New function, based on code from Dan Berrangé.
(CHECK_TYPE): Remove macro.
(checkType): New function.
(GET_CONF_INT, GET_CONF_STR): New macros.
(remoteReadConfigFile): Use new macros to avoid duplication and to
check for allocation failure.
* src/conf.h (virConfTypeName): New static inline function.
* configure.in: Added CYGWIN_EXTRA_LDFLAGS, CYGWIN_EXTRA_LIBADD,
CYGWIN_EXTRA_PYTHON_LIBADD, CYGWIN automake conditional.
* src/Makefile.am: Extra flags required to build DLL of libvirt
for Cygwin.
* python/Makefile.am: Extra flags and rule required to build
Python module for Cygwin.
prefix as the installed libvirt, use the same localstatedir /var
(instead of /usr/var) and sysconfdir /etc (instead of /usr/etc) to
be able to connect to the system daemon, and use the system local
options
* src/xs_internal.c: avoid error message when non-root cannot open
xenstore
* src/xend_internal.c: avoid error message when non-root cannot
directly access xend, in those 2 cases the proxy (or remote code)
should implement the access so there is no need to raise the error
there.
Daniel
* src/bridge.c, src/bridge.h, src/qemu_conf.c, src/qemu_conf.h,
src/qemu_driver.c, src/qemu_driver.h, src/test.c: Disable more
of qemu if configured --without-qemu.
* configure.in, src/internal.h, src/xml.c: <sys/syslimits.h>
is needed on Cygwin to get PATH_MAX. HOST_NAME_MAX and
IF_NAMESIZE defined if not in header files.
* src/stats_linux.c: Fix parsing of short interface names
occurring in the /proc/net/dev file.
* src/qemu_driver.c: Collect interface stats for QEMU & KVM
domains.
* docs/hvsupport.html, docs/libvir.html: Document HV support
for virNodeGetFreeMemory and virNodeGetCellsFreeMemory.
* src/libvirt.c: Add DEBUG to virNodeGetFreeMemory and
virNodeGetCellsFreeMemory.
* src/xen_internal.c: virXenError* functions now take an
additional virConnectPtr argument, and set it where possible.
* src/stats_linux.c, src/stats_linux.h, src_xen_internal.c:
Abstract out the Linux-specific statistics. Fixed parsing
of 64 bit numbers.
* src/Makefile.am: Updated Makefile for new files.
* qemud/qemud.c: Replace uses of strtol with uses of xstrtol_i.
Avoid overflow for very large --timeout=N values.
* src/nodeinfo.c: In linuxNodeInfoMemPopulate and
linuxNodeInfoCPUPopulate, use xstrtol_i rather than strtol.
Unlike in qemud.c, here we allow trailing "isspace", and in
the case of "cpuinfo cpu MHz", also allow a "." terminator,
since we ignore the decimal and any following digits.
* src/internal.h: Define xstrtol_ui, too.
Author: Jim Meyering <meyering@redhat.com>
Patch from Jim Meyering
* src/internal.h: Include <errno.h>.
Define new static inline function, xstrtol_i.
* src/virsh.c: Detect integer overflow in domain ID number
in vshCommandOptDomainBy. Detect overflow and invalid port
number suffix in cmdVNCDisplay.
* src/xend_internal.c: Parse CPU number more carefully in
xenDaemonDomainGetVcpus.
* tests/int-overflow: New script. Test for the above-fixed bug.
* tests/Makefile.am: Add int-overflow to TESTS. Define
TESTS_ENVIRONMENT, to propagate $abs_top_* variables into the
int-overflow script. Adapt the "valgrind" rule not to clobber
new TESTS_ENVIRONMENT.
Daniel
Avoid risk of format string abuse (also avoids gcc warnings).
* src/util.c (ReportError): Use a literal "%s" format string.
* src/remote_internal.c (server_error): Likewise.
* src/qemu_conf.c (qemudReportError): Likewise.
* acinclude.m4: Add -Wformat -Wformat-security to default
list of warning flags, to warn about errors such as the
above.
src/xen_unified.[ch] src/xend_internal.[ch] src/xml.[ch]: last
patch for the library NUMA support, allow to serialize CPU pinning
to domain configs (but won't work though proxy access), includes
many patches from Saori Fukuta.
Daniel
* tests/conftest.c: Use fwrite, not printf, since the
result buffer is not NUL-terminatedi, from Jim Meyering.
* tests/qemuxml2argvtest.c: Initialize vm.migrateFrom[0],
to avoid "read-uninitialized" error from within
qemudBuildCommandLinei, from Jim Meyering.
Daniel
* src/test.c, include/libvirt/libvirt.h.in: Remove virDomainRestart
from the public API (it was not used), and move it into the test
driver where it is used for purely internal purposes.
src/driver.h src/libvirt.c src/openvz_driver.c src/qemu_driver.c
src/test.c src/xen_unified.c src/xend_internal.c: add new API
virNodeGetFreeMemory(), extends the driver. Lacks remote and
QEmu support though.
* src/libvirt.c: allows to fix virNodeGetCellsFreeMemory() adding
parameter check for startCell.
* proxy/libvirt_proxy.c src/xend_internal.[ch]
include/libvirt/libvirt.h include/libvirt/libvirt.h.in: applied
vncpasswd dump patch from Mark Johnson but with the
virDomainXMLFlags extension as suggested by Daniel Berrange
this changed a couple of internal APIs too
* tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: fix one of the
tests affected by bootloader dump change.
Daniel
src/qemu_driver.c src/remote_internal.c src/test.c
src/xen_internal.[ch] src/xen_unified.c src/xend_internal.[ch]
src/libvirt.c src/libvirt_sym.version: adding NUMA support patches
from Beth Kon adding new virNodeGetCellsFreeMemory entry point
and extending the virConnectGetCapabilities one. Fix a couple of
issues in the patch and add to exported symbols from shared lib.
* docs/virsh.pod docs/virsh.1 src/virsh.c: added new command
freecell to get the available memory on the node or in a NUMA cell.
* docs/*: updated and regenerated the documentation
Daniel
* src/bridge.c, src/qemu_driver.c, configure.in: Try to detect
the paths of dnsmasq and brctl at compile time. If found
then compile them in, otherwise search $PATH at runtime.
* libvirt.spec.in: BR dnsmasq and bridge-utils so we have their
paths at compile time.
* src/libvirt.c (virDomainMigrate): Added virDomainMigrate
API call.
* src/xend_internal.c, src/xen_unified.c: Support for migration
of Xen domains.
* src/xen_internal.c: Xen capabilities indicates level of
support for migration.
* qemud/remote.c, qemud/remote_protocol.x, src/remote_internal.c:
Support for migration between remote hypervisors.
* src/virsh.c: Added 'virsh migrate' command.
* docs/libvir.html, docs/hvsupport.html: Updated hvsupport
documentation.
* qemud/remote.c, qemud/remote_protocol.x, src/driver.h,
src/internal.h, src/libvirt.c, src/libvirt_sym.version,
src/qemu_driver.c, src/remote_internal.c, src/test.c:
Add a private interface so that libvirt.c coordination
functions can detect the availability of features in
underlying drivers, using the VIR_DRV_SUPPORTS_FEATURE
macro.
* acinclude.m4, configure.in: ./configure option
--disable-stack-protector.
* src/gnutls_1_0_compat.h: Compatibility with GnuTLS 1.0.
* src/bridge.c: If no bridge ioctls, give an error at runtime.
patch from David Lutterkort
* tests/xencapsdata/xen-i686-pae-hvm.xml
tests/xencapsdata/xen-ia64-be-hvm.xml
tests/xencapsdata/xen-ia64-hvm.xml
tests/xencapsdata/xen-x86_64-hvm.xml: this also affects a few tests
Daniel
src/openvz_driver.c src/qemu_driver.c src/util.c src/util.h:
cleanup patches from Shuveb Hussain, with new util module for
common code shared between drivers.
Daniel
applied patch from Shuveb Hussain to plug the developping
OpenVZ support. Disabled by default.
* src/openvz_conf.[ch] src/openvz_driver.[ch]: added new
OpenVZ driver files. Avoid a redefinition of readline().
Daniel
new function virBufferEscapeString() to format a string while
escaping its content for XML, and apply it to a couple of
obvious places, should fix bug #206653
* po/*: updated strings, and added new bosnian localization.
Daniel
* src/proxy_internal.c, src/proxy_internal.h,
src.xen_internal.c, src/xen_internal.h,
src/xen_unified.c, src/xen_unified.h,
src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h,
src/xs_internal.c, src/xs_internal.h: The interface
between xen_unified.c and its underlying driver now uses
a custom structure (struct xenUnifiedDriver) instead
of reusing virDriver.
* src/xen_unified.c: virDomainLookup* functions in Xen
now throw VIR_ERR_NO_DOMAIN if the domain does not exist.
* src/xs_internal.c: Fix indentation.
* src/hash.c, src/internal.h: Remove virGetDomainByID function
as it is not used or exported.
* src/proxy_internal.c, src/qemu_driver.c, src/remote_internal.c,
src/test.c, src/xend_internal.c, src/xs_internal.c: Fix
all callers to virGetDomain and virGetNetwork functions -
the callers do not need to set virterror since it is already
set inside the functions.
* include/libvirt/virterror.h, src/virterror.c, src/libvirt.c:
Add VIR_ERR_NO_DOMAIN and VIR_ERR_NO_NETWORK errors, which
indicate that there is no domain/network from vir*Lookup* functions.
* src/qemu_driver.c: Use VIR_ERR_NO_DOMAIN in lookup functions.
* src/test.c: Use VIR_ERR_NO_DOMAIN in lookup functions.
* src/xm_internal.c: configCache not getting refilled if the
connection was closed (affected the remote case mainly),
and error messages added to xenXMConfigCacheRefresh.
* src/conf.c, src/test.c, src/xen_internal.c: Readd checking
of errors from virBuffer functions.
* src/sexpr.c: Add comment about use of _GNU_SOURCE.
* src/virsh.c: Remove use of _GNU_SOURCE / isblank.
* src/xml.c, tests/Makefile.am: Minor cleanup.
* src/remote_internal.c, python/Makefile.am: Python bindings
fixed, and now building virConnect.getHostname and
virConnect.getURI. Fixed a problem which stopped
libvirt.py from being (re-)built. Rearranged
python/Makefile.am to make it cleaner and clearer.
* include/libvirt/libvirt.h.in, src/libvirt.c, src/libvirt_sym.version,
python/generator.py: Added virDomainGetConnect and
virNetworkGetConnect to allow us to get the "hidden"
connection associated with each domain or network.