Commit Graph

606 Commits

Author SHA1 Message Date
Mark McLoughlin
77a2fc0061 Add virRun() helper function (Dan Berrange) 2008-01-10 13:46:10 +00:00
Daniel P. Berrange
9d11255a47 Fix vcpupin hypercall map data to be 8-bytes 2008-01-09 21:08:29 +00:00
Daniel P. Berrange
78f2cd3d2d Added graceful shutdown support to QEMU/KVM (patch from Guido Guenther) 2008-01-09 16:05:21 +00:00
Daniel P. Berrange
8796a9ff74 Fix warning in debug output 2008-01-08 17:52:10 +00:00
Daniel P. Berrange
8cd4774468 Fix buffer passed to free() 2008-01-08 16:17:15 +00:00
Daniel P. Berrange
94e49e3f0e Fix config file reading to not truncate large files 2008-01-07 15:21:33 +00:00
Richard W.M. Jones
029aef1d24 Miscellaneous fixes for building on Windows (MinGW).
* 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>.
2008-01-05 16:06:36 +00:00
Daniel P. Berrange
76122538b6 Fix crash when no auth callback is provided 2008-01-02 22:48:04 +00:00
Daniel Veillard
7b40fcd11f * src/openvz.c: patch from Mikhail Pokidko to fix the OpenVZ
compilation error #426385
Daniel
2007-12-26 05:41:05 +00:00
Daniel P. Berrange
d575a83f81 Fix nodeinfo compat with Xen 3.2.0 2007-12-17 23:04:33 +00:00
Richard W.M. Jones
1be1fe69f5 Fix remote_internal.c error handling of qparam_get_query
* src/remote_internal.c: Fixed reversed check of error handling
          of qparam_get_query call (Dan Berrange).
2007-12-17 17:41:02 +00:00
Richard W.M. Jones
3b0149354b Add separate qparams module for handling query parameters.
* 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.
2007-12-17 10:07:56 +00:00
Richard W.M. Jones
ed9788c796 Add extra utility functions to buf.c
* src/buf.c, src/buf.h: Added utility functions
	  virBufferURIEncodeString and virBufferAddChar to the
	  buffer module.
2007-12-17 10:05:35 +00:00
Daniel P. Berrange
a11494fd52 Don't invoke callback with unsupported credential types 2007-12-15 17:15:12 +00:00
Daniel Veillard
cc8e4ff318 fix setting CPU parameters in the config files
* src/xm_internal.c: patch from Saori Fukuta to fix setting
  CPU parameters in the config files, the value was overwritten
Daniel
2007-12-14 15:51:42 +00:00
Daniel Veillard
81acc14e3a fix the detach-disk command when using Xen tap devices
* 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
2007-12-14 15:38:02 +00:00
Richard W.M. Jones
b47ffc035c Fix virBufferEscapeString escaping of '<'
* src/buf.c (virBufferEscapeString): '<' escaped as "&lt;"
2007-12-12 16:27:10 +00:00
Jim Meyering
49230350fa Use a variable name as sizeof argument, not a type name.
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_.
2007-12-11 21:57:29 +00:00
Richard W.M. Jones
0d14fc0cbb Fri Dec 7 14:49:00 UTC 2007 Richard W.M. Jones <rjones@redhat.com>
* 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.
2007-12-07 14:56:37 +00:00
Richard W.M. Jones
f3ebd20d35 Fri Dec 7 14:47:00 UTC 2007 Richard W.M. Jones <rjones@redhat.com>
* src/internal.h: Use gnulib gettext library.  Define
	  INET_ADDRSTRLEN unless already defined.
2007-12-07 14:52:24 +00:00
Richard W.M. Jones
f1f94721ae Fri Dec 7 14:36:00 UTC 2007 Richard W.M. Jones <rjones@redhat.com>
* 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.
2007-12-07 14:45:39 +00:00
Richard W.M. Jones
36f0ce0472 Fri Dec 7 14:34:00 UTC 2007 Richard W.M. Jones <rjones@redhat.com>
* src/sexpr.c: Cosmetic rearrangement of headers.
2007-12-07 14:39:14 +00:00
Jim Meyering
4a2f8fc633 Include "config.h" in remaining non-generated files.
* proxy/libvirt_proxy.c: Likewise.
* python/libvir.c: Likewise.
* python/types.c: Likewise.
* src/event.c: Likewise.
* src/xm_internal.c: Likewise.
* tests/reconnect.c: Likewise.
* tests/testutils.c: Likewise.
2007-12-07 10:08:06 +00:00
Richard W.M. Jones
efd495d667 Thu Dec 6 16:32:00 UTC 2007 Richard W.M. Jones <rjones@redhat.com>
* src/virsh.c: The prompt should depend on readonly status,
	  not on the UID.
2007-12-06 16:36:21 +00:00
Richard W.M. Jones
ec38eb9388 Thu Dec 6 12:00:00 UTC 2007 Richard W.M. Jones <rjones@redhat.com>
* src/remote_internal.c: Clean up a warning if neither SASL
          nor PolKit are enabled.
2007-12-06 12:05:35 +00:00
Daniel Veillard
7633453cfa * configure.in src/Makefile.am src/virsh.c: fix compilation problems
when readline headers were found but not the library
Daniel
2007-12-06 10:24:52 +00:00
Jim Meyering
87396257fc Include "config.h".
* qemud/event.c: Likewise.
* src/buf.c: Likewise.
* src/hash.c: Likewise.
* src/nodeinfo.c: Likewise.
* src/openvz_conf.c: Likewise.
* src/proxy_internal.c: Likewise.
* src/virterror.c: Likewise.
* src/xmlrpc.c: Likewise.
* src/xs_internal.c: Likewise.
* tests/conftest.c: Likewise.
* tests/xmlrpctest.c: Likewise.
This fixes a mingw build failure reported by Rich Jones.

Author: Jim Meyering <meyering@redhat.com>
2007-12-05 21:40:15 +00:00
Jim Meyering
261e7581b1 Use gnulib, starting with its physmem and getaddrinfo modules.
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>
2007-12-05 21:31:07 +00:00
Daniel P. Berrange
2add6b3026 Fix compile issues when SASL is disabled 2007-12-05 19:25:44 +00:00
Daniel P. Berrange
e332ccdf71 Wire up SASL interaction callbacks to libvirt callbacks. Provide default callback impl 2007-12-05 18:55:04 +00:00
Daniel P. Berrange
7fa9ceb740 Added public API for authentication credential callback support 2007-12-05 18:28:05 +00:00
Daniel P. Berrange
282342c1c5 Added PolicyKit authentication support 2007-12-05 18:21:27 +00:00
Richard W.M. Jones
ffdbb903e4 Wed Dec 5 18:00:00 UTC 2007 Richard W.M. Jones <rjones@redhat.com>
* src/Makefile.am, tests/Makefile.am: Remove LIBOBJS/LTLIBOBJS
          which were incorrectly committed earlier.
2007-12-05 18:05:13 +00:00
Daniel P. Berrange
ca71b87cb0 Quit virsh immediately if connection open fails, rather than giving a non-functional interactive shell 2007-12-05 16:24:22 +00:00
Daniel P. Berrange
bb5371f668 Add data encryption using SASL SSF layer 2007-12-05 15:27:08 +00:00
Daniel P. Berrange
1b1d647439 Initial integration of SASL authentication, working for Kerberos only 2007-12-05 15:24:15 +00:00
Daniel P. Berrange
a8977b62ba Strip autogenerated vnetXXX interfaces 2007-12-05 15:08:23 +00:00
Richard W.M. Jones
4bfdb77aae Wed Dec 5 13:48:00 UTC 2007 Richard W.M. Jones <rjones@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.
2007-12-05 13:56:22 +00:00
Richard W.M. Jones
4338271f1a Tue Dec 4 17:47:01 UTC 2007 Richard W.M. Jones <rjones@redhat.com>
* 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.
2007-12-04 18:27:52 +00:00
Richard W.M. Jones
78f756e081 Mon Dec 3 16:15:10 UTC 2007 Richard W.M. Jones <rjones@redhat.com>
* src/util.c: Fix header files for Windows builds.
2007-12-03 16:19:41 +00:00
Daniel P. Berrange
4cd62fe306 Move generic file & I/O routines out of QEMU driver into util.c 2007-12-03 14:30:46 +00:00
Daniel Veillard
ed5e20baab * src/xen_unified.[ch] src/proxy_internal.c src/xen_internal.c
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
2007-12-03 09:34:38 +00:00
Daniel P. Berrange
2b3c49b6ab Fix numerous memory leaks 2007-12-01 15:45:25 +00:00
Daniel P. Berrange
b4f841d92f Fix buffer termination off-by-1 in link comparison code 2007-12-01 15:29:45 +00:00
Daniel P. Berrange
6d3f1d516e Disable Xen specific functions if Xen driver is disabled 2007-11-30 22:51:54 +00:00
Jim Meyering
c3c80a183e Detect heap allocation failure; factor out some duplication.
* 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.
2007-11-30 15:43:42 +00:00
Richard W.M. Jones
d63034c018 Thu Nov 29 17:40:00 GMT 2007 Richard W.M. Jones <rjones@redhat.com>
* 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.
2007-11-29 17:44:01 +00:00
Richard W.M. Jones
ba75647b55 Thu Nov 29 09:15:00 GMT 2007 Richard W.M. Jones <rjones@redhat.com>
* src/virsh.c: Added #include <time.h> so it can compile
          on CentOS 4 (Carl Jones).
2007-11-29 09:18:04 +00:00
Richard W.M. Jones
df0525a911 Wed Nov 28 14:20:00 GMT 2007 Richard W.M. Jones <rjones@redhat.com>
* src/virsh.c: Missing comma.
2007-11-28 14:22:30 +00:00
Jim Meyering
55311d6c38 src/virsh.c (vshCloseLogFile): Diagnose close/write failure. 2007-11-28 13:22:33 +00:00