Daniel Veillard [Tue, 26 Feb 2008 07:05:18 +0000 (07:05 +0000)]
* src/driver.h src/libvirt.c src/openvz_driver.c src/qemu_driver.c
src/remote_internal.c src/test.c src/util.c src/util.h
src/xen_unified.c: added probe interface at the driver level,
use that to improve default hypervisor selection in the absence
of a given URI when connecting
Daniel
Daniel Veillard [Mon, 25 Feb 2008 13:55:56 +0000 (13:55 +0000)]
fix compilation against static libraries
* src/Makefile.am src/util-lib.h: fix done with Jim to allow
compilation of virsh with the static libraries.
Daniel
Jim Meyering [Fri, 22 Feb 2008 15:55:04 +0000 (15:55 +0000)]
Use safewrite in place of write, in many cases.
Also add "make syntax-check" rules to ensure no new uses sneak in.
There are many uses of write like this:
if (write (fd, xml, towrite) != towrite)
return -1;
The problem is that the syscall can succeed, yet write less than
the requested number of bytes, so the caller should retry
rather than simply failing.
This patch changes most of them to use util.c's safewrite wrapper,
which encapsulates the process. Also, there were a few cases in
which the retry loop was open-coded, and I replaced those, too.
* Makefile.maint (sc_avoid_write): New rule, to avoid recurrence.
* .x-sc_avoid_write: New file. Record two legitimate exemptions.
* qemud/qemud.c (sig_handler, qemudClientWriteBuf): Use safewrite, not write.
* src/conf.c (__virConfWriteFile): Likewise.
* src/qemu_conf.c (qemudSaveConfig, qemudSaveNetworkConfig): Likewise.
* src/qemu_driver.c (qemudWaitForMonitor, qemudStartVMDaemon)
(qemudVMData, PROC_IP_FORWARD): Likewise.
* proxy/libvirt_proxy.c: Include "util.h".
(proxyWriteClientSocket): Use safewrite.
* src/test.c (testDomainSave, testDomainCoreDump): Likewise.
* src/proxy_internal.c (virProxyWriteClientSocket): Likewise.
* src/virsh.c: Include "util-lib.h".
(vshOutputLogFile): Use safewrite.
* src/console.c: Include "util-lib.h".
(vshRunConsole): Use safewrite.
Jim Meyering [Fri, 22 Feb 2008 15:53:13 +0000 (15:53 +0000)]
Move safewrite and saferead to a separate file.
We currently use safewrite from inside libvirt and don't want to publish
any such function name. However, we do want to use it in applications
like virsh, libvirtd and libvirt_proxy that link with libvirt. To that
end, this change moves that function definition (along with the nearly
identical saferead) into a new file, util-lib.c. To avoid maintaining
separate copies of even such small functions, we simply include that new
file from util.c. Then, the separate applications that need to use
safewrite simply compile and link with util-lib.c.
Of course, this does mean that each of those applications will
containing two copies of these functions. However, the functions
are so small that it's not worth worrying about that.
* src/util.c (saferead, safewrite): Move function definitions to
util-lib.c and include that .c file.
* src/util-lib.c (saferead, safewrite): New file. Functions from src/util.c
with slight change (s/int r =/ssize_t r =/) to reflect read/write return type.
* src/util-lib.h: Declare the two moved functions.
* src/util.h: Remove declarations. Include src/util-lib.h.
* proxy/Makefile.am (libvirt_proxy_SOURCES): Add src/util-lib.c.
* qemud/Makefile.am (libvirtd_SOURCES): Likewise.
* src/Makefile.am (virsh_SOURCES): Add util-lib.c. Remove some SP-before-TAB.
Jim Meyering [Wed, 13 Feb 2008 21:52:19 +0000 (21:52 +0000)]
Pull useless-if-before-free from gnulib, and update.
* bootstrap (gnulib_tool): Add useless-if-before-free to
the list of modules.
* build-aux/useless-if-before-free: Update from gnulib.
* gnulib/lib/vasnprintf.c: Work around a bug in HPUX 10.20.
* gnulib/m4/vasnprintf.m4: Likewise.
Daniel Veillard [Mon, 11 Feb 2008 16:08:11 +0000 (16:08 +0000)]
Network doc example fixes
* docs/libvir.html docs/format.html: fixes the examples on the
section about ethernet bridging, as raised by Maxwell Bottiger,
fixes bug #430790
Daniel
* src/nodeinfo.h: don't include internal.h, which was only
needed for xstrtol(), but instead include libvirt.h which
is suffificient for the declarations in the header.
Jim Meyering [Thu, 7 Feb 2008 19:20:36 +0000 (19:20 +0000)]
Enable another syntax-check rule.
* Makefile.cfg (local-checks-to-skip): Remove sc_no_have_config_h.
* qemud/mdns.c: Remove "#ifdef HAVE_CONFIG_H".
* Makefile.maint (sc_no_have_config_h): Tighten up regexp,
so that the above mention of "HAVE_CONFIG_H" doesn't match.
* .x-sc_no_have_config_h: New file, to exempt gnulib/ straggler.
Daniel Veillard [Thu, 7 Feb 2008 09:49:13 +0000 (09:49 +0000)]
Python bindings return values fixes
* python/libvir.c: apply patch from Cole Robinson to provide
return values for manulally written python bindings.
Daniel
Daniel Veillard [Wed, 6 Feb 2008 17:57:10 +0000 (17:57 +0000)]
add/change/delete a Disk/NIC of an inactive domains
* src/xm_internal.[ch]: applied patch from Shigeki Sakamoto to
add/change/delete a Disk/NIC of an inactive domains
Daniel
Jim Meyering [Tue, 29 Jan 2008 18:15:54 +0000 (18:15 +0000)]
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.
Jim Meyering [Tue, 29 Jan 2008 17:42:39 +0000 (17:42 +0000)]
Add framework for code style- and syntax-checking rules.
Almost all tests are initially disabled via the list in Makefile.cfg.
* Makefile.am (EXTRA_DIST): Add .x-sc_avoid_if_before_free.
Omit names of files that automake includes automatically.
* .x-sc_avoid_if_before_free: New file.
* build-aux/vc-list-files: Likewise.
* build-aux/find-unnecessary-if-before-free: Likewise.
* GNUmakefile, Makefile.cfg, Makefile.maint: New files.
Daniel Veillard [Fri, 25 Jan 2008 09:47:51 +0000 (09:47 +0000)]
Fix VIR_DOMAIN_NONE into VIR_DOMAIN_NOSTATE
* src/xen_internal.c: fix an erronous use of VIR_DOMAIN_NONE instead
of VIR_DOMAIN_NOSTATE (both defined as 0, no regression)
Daniel
Correct typos in the documentation (Atsushi SAKAI)
* README, libvirt.spec.in, docs/devhelp/html.xsl,
docs/devhelp/index.html: Correct typos in the documentation.
Portability improvements for Mac OS X.
* 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.