Commit Graph

121 Commits

Author SHA1 Message Date
Daniel P. Berrange
13a0a5fa23 Added more bash supressions 2008-04-28 13:55:50 +00:00
Daniel P. Berrange
45008e03ec Ignore bash bugs under valgrind 2008-04-28 13:36:48 +00:00
Daniel P. Berrange
e6f1123819 Added full support for serial and parallel devices to Xen drivers 2008-04-26 14:22:02 +00:00
Daniel P. Berrange
49956f0469 Implement serial & parallel device support for QEMU driver 2008-04-25 20:46:13 +00:00
Daniel P. Berrange
94353ef660 Re-factor and pretty print differences 2008-04-18 15:28:33 +00:00
Daniel P. Berrange
484559148d Test script helper for printing string differences 2008-04-18 15:05:29 +00:00
Jim Meyering
5bf824ea10 convert TAB-based indentation in C sources to use only spaces
Done using this command (also includes .c.in and .h.in files):
for i in $(g ls-files|grep -E '\.[ch](\.in)?$'|grep -v gnulib); do
  expand -i $i > j && mv j $i;done
2008-04-10 16:54:54 +00:00
Jim Meyering
dc42a9d2de remove Vim and Emacs variable settings from C source files
Done with these commands:
git grep -l Local.variab|xargs \
  perl -0x3b -pi -e 's,\n+/\*\n \* vim:(.|\n)*,\n,'

git grep -l Local.variab|xargs \
  perl -0x3b -pi -e 's,\n+/\*\n \* Local variables:\n(.|\n)*,\n,'
2008-04-10 16:53:29 +00:00
Jim Meyering
3ce465f819 Don't fail to read a file because it's non-seekable (e.g., a pipe).
* src/util.c (fread_file_lim): New function.
(__virFileReadAll): Use fread_file_lim, rather than requiring
that stat.st_size provide a usable file size.
* tests/read-non-seekable: New test, for the above.
* tests/Makefile.am (test_scripts): Add read-non-seekable.
* tests/test-lib.sh (mkfifo_or_skip_): New helper function.
2008-04-08 15:33:16 +00:00
Jim Meyering
7c61b48202 * tests/vcpupin: Add a test for the 2008-04-04 virsh.c bugfix. 2008-04-07 12:12:34 +00:00
Jim Meyering
f15efcdf27 Add new testing framework and the first test to use it.
* tests/Makefile.am (test_scripts): Add vcpupin.
(EXTRA_DIST): Add test-lib.sh.
* tests/test-lib.sh: Testing framework, from coreutils.
* tests/vcpupin: New file.
* build-aux/mktempd: New file, from gnulib.
* bootstrap: Add posix-shell and mktempd to the list of imported modules.
* gnulib/m4/posix-shell.m4: New file, from gnulib.
2008-03-24 10:19:36 +00:00
Jim Meyering
870dba07b1 Fix bugs in tests/Makefile.am.
* tests/Makefile.am (TESTS_ENVIRONMENT): Correct invalid
settings of abs_top_builddir and abs_top_srcdir.
Also prepend src/ to PATH, so we test the just-built virsh,
not whatever happens to be in the original $PATH.
2008-03-24 10:18:36 +00:00
Daniel Veillard
08ecf61b35 * NEWS virsh.1 docs//* include/libvirt/libvirt.h[.in] qemud/mdns.h
src/libvirt.c src/qemu.conf src/remote_internal.c src/xend_internal.c
  tests/confdata/libvirtd.conf tests/confdata/libvirtd.out: patch from
  Atsushi SAKAI fixing a ot more typo
Daniel
2008-03-17 10:27:31 +00:00
Jim Meyering
9262d88e28 Avoid link errors with "configure --disable-shared".
* src/Makefile.am: Create a convenience library, libvirt_test.la,
and don't restrict access to *its* symbols.
* tests/Makefile.am (LDADDS): Add ../src/libvirt_test.la, so that
"configure --disable-shared" no longer provokes link errors.
(LIBVIRT): Remove definition.
(LDADDS): Remove use.
($(LIBVIRT)): Remove rule.
(LDADDS): Use the new convenience library instead.
(CLEANFILES): Define.
* docs/examples/index.py (dump_Makefile): Append $(COVERAGE_LDFLAGS),
to the LDADDS definition, to avoid link error with the combination of
--enable-test-coverage and --disable-shared.
* docs/examples/Makefile.am: Regenerate.
* docs/examples/index.html: Likewise.
* qemud/Makefile.am (libvirtd_LDFLAGS): Append $(COVERAGE_LDFLAGS).
* src/libvirt_sym.version: Remove some SP-before-TAB.
2008-02-28 17:06:32 +00:00
Daniel P. Berrange
63bc5dd3e1 Add formal internal capabilities API and update drivers to use it 2008-02-27 04:35:08 +00:00
Jim Meyering
bdbce64bab With --without-xen, avoid warning about unused function.
* tests/statstest.c (testQuietError) [!WITH_XEN]: Don't define.
2008-02-22 12:33:47 +00:00
Daniel P. Berrange
4a4e272f9d Added storage backend helper APIs 2008-02-20 15:38:29 +00:00
Jim Meyering
e8ff93b4e6 Remove more useless if tests before "free"-like functions.
* build-aux/useless-if-before-free: Rename from ...
* build-aux/find-unnecessary-if-before-free: ... this.  Remove file.
Also changed it so that new names are no longer hard-coded in the
script.  Instead, they're supplied via options:
* Makefile.cfg (useless_free_options): Define.
Add xmlXPathFreeObject to the list of free-like functions it detects.
* Makefile.maint (sc_avoid_if_before_free): Reflect script renaming.
* .x-sc_avoid_if_before_free: Likewise.
* src/openvz_conf.c (openvzParseXML): Remove useless "if"-before-free.
* src/qemu_conf.c (qemudParseXML, qemudParseNetworkXML): Likewise.
* src/virsh.c (cmdVNCDisplay, cmdTTYConsole, cmdDetachInterface):
(cmdDetachDisk): Likewise.
* src/xm_internal.c (xenXMConfigSetIntFromXPath): Likewise.
(xenXMConfigSetStringFromXPath, xenXMParseXMLToConfig): Likewise.
(xenXMDomainAttachDevice, xenXMAttachDisk, xenXMAttachInterface):
(xenXMDomainDetachDevice): Likewise.
* src/xml.c (virXPathString): Likewise.
* tests/xmlrpctest.c (checkRequestValue): Likewise.
2008-02-07 16:49:29 +00:00
Jim Meyering
e04912a9f0 Remove all trailing blanks; turn on the rule to detect them.
* Makefile.cfg (local-checks-to-skip): Remove sc_trailing_blank.
* .x-sc_trailing_blank: New file, to exempt the few binary files.
2008-02-05 19:27:37 +00:00
Daniel P. Berrange
e87e3f86bf Added support for booting off kenrel+initrd with HVM guests 2008-02-05 16:21:25 +00:00
Jim Meyering
b5433aaa6f Avoid compilation failure when building --without-xen.
* tests/statstest.c (testDevice) [!WITH_XEN]: #ifdef-out.
(main) [!WITH_XEN]: #ifdef-out the body.

Committer: Jim Meyering <meyering@redhat.com>
Author: Guido Guenther  <agx@sigxcpu.org>
2008-01-31 21:49:47 +00:00
Daniel P. Berrange
03003499e7 Fix XML generation for Xen USB devices 2008-01-30 16:38:18 +00:00
Jim Meyering
51dd1d9e38 Arrange for "make syntax-check" to pass.
* .x-sc_avoid_if_before_free: Exempt ChangeLog.
* tests/statstest.c: Include <config.h>, not "config.h".
2008-01-30 06:55:56 +00:00
Daniel P. Berrange
21416a4746 Fix device name -> number conversion for block stats 2008-01-29 18:36:00 +00:00
Jim Meyering
2367caa327 Also detect and remove unnecessary if-before-xmlXPathFreeContext.
* build-aux/find-unnecessary-if-before-free: Update regexp.
* src/openvz_conf.c: Remove unnecessary "if (P)"-before xmlXPathFreeContext.
* src/qemu_conf.c: Likewise.
* src/virsh.c: Likewise.
* src/xm_internal.c: Likewise.
* src/xml.c: Likewise.
* tests/xmlrpctest.c: Likewise.
2008-01-29 18:23:43 +00:00
Jim Meyering
a378188194 Enable the <config.h>-requiring test; fix violations
Use <config.h>, not "config.h", per autoconf documentation.
* Makefile.cfg (local-checks-to-skip) [sc_require_config_h]: Enable.
* .x-sc_require_config_h: New file, to list exempted files.
* Makefile.am (EXTRA_DIST): Add .x-sc_require_config_h.
2008-01-29 18:15:54 +00:00
Jim Meyering
acff2d11ac Given code like if (foo) free (foo); remove the useless "if (foo) " part.
Likewise, given if (foo != NULL) free (foo); remove the useless "if" test.

* proxy/libvirt_proxy.c: Remove unnecessary "if" test before free.
* python/generator.py: Likewise.
* qemud/qemud.c: Likewise.
* src/buf.c: Likewise.
* src/conf.c: Likewise.
* src/hash.c: Likewise.
* src/iptables.c: Likewise.
* src/libvirt.c: Likewise.
* src/openvz_conf.c: Likewise.
* src/qemu_conf.c: Likewise.
* src/qemu_driver.c: Likewise.
* src/remote_internal.c: Likewise.
* src/test.c: Likewise.
* src/virsh.c: Likewise.
* src/virterror.c: Likewise.
* src/xen_internal.c: Likewise.
* src/xen_unified.c: Likewise.
* src/xend_internal.c: Likewise.
* src/xm_internal.c: Likewise.
* src/xml.c: Likewise.
* src/xmlrpc.c: Likewise.
* src/xs_internal.c: Likewise.
* tests/testutils.c: Likewise.
* tests/xencapstest.c: Likewise.
* tests/xmconfigtest.c: Likewise.
2008-01-29 17:41:07 +00:00
Jim Meyering
63dffbf1d2 Avoid "may be used uninitialized" warning.
* tests/xmconfigtest.c (testCompareParseXML): Initialize "old_priv".
2008-01-21 17:06:47 +00:00
Jim Meyering
f510a6128b Clean up global name space in examples and tests.
* docs/examples/suspend.c: Declare global "conn" to be static.
* tests/qemuxml2argvtest.c: Declare global "driver" to be static.
* tests/qemuxml2xmltest.c: Likewise.


Author: Jim Meyering <meyering@redhat.com>
2008-01-14 14:04:33 +00:00
Daniel P. Berrange
94e49e3f0e Fix config file reading to not truncate large files 2008-01-07 15:21:33 +00:00
Jim Meyering
9e188e11c5 Accommodate automake-1.9.
* tests/Makefile.am (TESTS_ENVIRONMENT): Adjust PATH setting
to work also with automake-1.9.  Can't use $(abs_top_builddir).


Author: Jim Meyering <meyering@redhat.com>
2007-12-12 07:21:37 +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
Jim Meyering
5a190594f4 Test libvirtd's config-processing code.
And remove a minor diagnostic inconsistency.
* tests/daemon-conf: New test.
* tests/Makefile.am (TESTS_ENVIRONMENT): Prepend qemud/ to PATH,
so we can invoke libvirtd without an absolute name.
(test_scripts): Add daemon-conf.
* qemud/qemud.c (remoteConfigGetAuth): Use checkType,
rather than open-coding it with a different diagnostic.
2007-12-11 21:20:13 +00:00
Richard W.M. Jones
66e4326c84 Insert cosmetic linebreak 2007-12-07 14:38:34 +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
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
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
1b1d647439 Initial integration of SASL authentication, working for Kerberos only 2007-12-05 15:24:15 +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
Daniel P. Berrange
6d3f1d516e Disable Xen specific functions if Xen driver is disabled 2007-11-30 22:51:54 +00:00
Richard W.M. Jones
b7641686a6 Mon Nov 26 12:03:00 UTC 2007 Richard W.M. Jones <rjones@redhat.com>
* tests/Makefile.am, tests/nodeinfotest.c, tests/qemuxml2argvtest.c,
	  tests/qemuxml2xmltest.c, tests/sexpr2xmltest.c, tests/virshtest.c,
	  tests/xencapstest.c, tests/xmconfigtest.c, tests/xml2sexprtest.c:
	  Miscellaneous fixes to the tests to compile under Cygwin.
2007-11-26 12:03:34 +00:00
Daniel Veillard
ef4006b3a5 * tests/sexpr2xmltest.c tests/xml2sexprtest.c: warn before exiting
if the path environment variable is missing, add the tests for
  <shareable/> from/to w! ode for disk
* tests/sexpr2xmldata/sexpr2xml-disk-block-shareable.sexpr
  tests/sexpr2xmldata/sexpr2xml-disk-block-shareable.xml
  tests/xml2sexprdata/xml2sexpr-disk-block-shareable.sexpr
  tests/xml2sexprdata/xml2sexpr-disk-block-shareable.xml:
  the new tests data
Daniel
2007-11-20 10:05:45 +00:00
Daniel P. Berrange
a2492efb60 Re-add quotes around top_srcdir/top_builddir 2007-11-18 11:23:09 +00:00
Daniel P. Berrange
99c0470dd8 Remove reliance on abs_top_{src,build}dir variables from automake 1.10 2007-11-17 13:16:47 +00:00
Jim Meyering
d5117af382 Make "make distcheck" work.
* Makefile.am: Expand some "*" wildcards, and (for now) disable
  the relatively unimportant, distuninstallcheck target.
  Fix a few redirect-directly-to-target bugs.
  Add a few $(srcdir)/ prefixes and add an uninstall-local rule.
* docs/Makefile.am: More of the same.  Split some long lines.
* python/Makefile.am: Likewise.
* python/tests/Makefile.am: Likewise.
* qemud/Makefile.am: Likewise.
* tests/Makefile.am: Remove the directories already listed in SUBDIRS.
* docs/examples/index.py: Adapt to produce the desired changes in
  docs/examples/Makefile.am. Also, sort *.c, so results are reproducible,
  and emit a comment telling emacs and vi that the file is read-only.
* docs/examples/Makefile.am: Regenerate.


Author: Jim Meyering <meyering@redhat.com>
2007-11-15 13:04:28 +00:00
Jim Meyering
5a6571eba9 Arrange for tests to pass in a non-srcdir build.
* tests/Makefile.am: Include the contents of the *data directories
in the make-dist-built tarball by adding each of that *data
directories to EXTRA_DIST.
Also add int-overflow (via $(test_scripts)) to EXTRA_DIST.
* tests/nodeinfotest.c: Prepend "$abs_top_srcdir/tests" to
each input file name.
* tests/qemuxml2argvtest.c: Likewise.
* tests/qemuxml2xmltest.c: Likewise.
* tests/sexpr2xmltest.c: Likewise.
* tests/test_conf.sh: Likewise.
* tests/virshtest.c: Likewise.
* tests/xencapstest.c: Likewise.
* tests/xmconfigtest.c: Likewise.
* tests/xml2sexprtest.c: Likewise.


Author: Jim Meyering <meyering@redhat.com>
2007-11-14 10:35:58 +00:00
Jim Meyering
a8b9c6640a conftest: fix transposed size and count arguments to fwrite.
* tests/conftest.c: Include <string.h> and <errno.h>.
Also include strerror in diagnostic.


Author: Jim Meyering <meyering@redhat.com>
2007-11-12 22:16:25 +00:00
Daniel Veillard
92c8d7dd97 Oops, forgot, Daniel 2007-11-12 14:07:37 +00:00
Daniel Veillard
a500a479b0 Begin fixing uses of strtol: parse integers more carefully.
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
2007-11-12 14:00:32 +00:00