Commit Graph

1604 Commits

Author SHA1 Message Date
Dan Smith
0d2c36fda9 [LXC] Remove unused variable and fix uninitialized variable
Also remove a stale comment in the area.  This makes libvirt compile when
passed --with-lxc and --enable-compiler-warnings=error
2008-06-27 15:05:31 +00:00
Dan Smith
0240fe9d58 [LXC] Add setup/cleanup of container network interfaces 2008-06-26 16:09:48 +00:00
Dan Smith
97e1fc3734 [LXC] Add XML parsing of container network interfaces. 2008-06-26 16:08:59 +00:00
Dan Smith
e59eb52fad [LXC] Add functions to manage veth device pairs
This gives us the ability to create a veth pair so that we can move one
into the network namespace of an LXC container.
2008-06-26 16:07:48 +00:00
Dan Smith
99ded85f45 [LXC] Detect support for NETNS in lxc driver initialization
Allow check for containers support to be done without CLONE_NEWNET, and then
determine support on the fly by checking for iproute2 support and a
successful clone(CLONE_NEWNET).  This lets us set a flag for later, as well
as not completely disable LXC support on a system without NETNS support.
2008-06-26 16:05:02 +00:00
Atsushi SAKAI
f3c3550771 Fix make syntax-check 2008-06-26 10:56:19 +00:00
Atsushi SAKAI
fbb5d771a0 Compilation fixes for MinGW 2008-06-26 09:37:51 +00:00
Jim Meyering
9c593643ff quiet "make syntax-check"
* Makefile.maint (strftime-check): Add "@" prefix.
(po-check): Likewise.
2008-06-25 14:21:44 +00:00
Daniel Veillard
2de7d9d224 * python/types.c: patch from Ryan Scott to remove misplaced verbosity
when compiling in debug mode.
Daniel
2008-06-25 11:42:27 +00:00
Daniel Veillard
93db3c61c0 * configure.in NEWS libvirt.spec* doc/* po/*: making libvirt-0.4.4
release
* src/xm_internal.c: fix xm driver serialization escapes
* tests/xmconfigtest.c tests/xmconfigdata/test-escape-paths.cfg
  tests/xmconfigdata/test-escape-paths.xml: add test for previous
  problem
Daniel
2008-06-25 08:59:37 +00:00
Daniel Veillard
3f6d44e9c9 * po/*: updated a couple of localizations and regenerated the
files
Daniel
2008-06-25 08:49:54 +00:00
Daniel P. Berrange
47605e1dfa Added helpers for dealing with enumerations 2008-06-24 15:00:15 +00:00
Daniel P. Berrange
313f1a7c0d Fix const-ness of virStorageBackendRunProgRegex() 2008-06-24 14:30:25 +00:00
Daniel Veillard
1ec7cccbd3 fix a couple of List functions for max = 0 issues
* src/xen_internal.c src/xend_internal.c: fix a couple of issues
  for List functions where max given is 0
Daniel
2008-06-19 14:39:49 +00:00
Jim Meyering
e09fab39a8 virsh fails to read files larger than BUFSIZ bytes
* src/util.c (fread_file_lim): Use VIR_REALLOC_N, not VIR_ALLOC_N.
Bug introduced in 895d0fdf5b.
* tests/Makefile.am (test_scripts): Add read-bufsiz.
* tests/read-bufsiz: New test for the above.
2008-06-19 14:30:52 +00:00
Chris Lalancette
2dc11b36a1 Update the changelog to go along with my commits for the last week. 2008-06-19 14:22:54 +00:00
Chris Lalancette
0aa6eedddd For 0.4.3, danpb's new memory management scheme went into libvirt. This is
fine, except that is subtly alters the semantics of malloc(), calloc(), and
realloc().  In particular, if you say:

foo = malloc(0);

glibc will happily return a non-NULL pointer to you.  However, with the new
memory management stuff, if you say:

foo = VIR_ALLOC(0);

you will actually get a NULL pointer back.  Personally, I think this is a
dangerous deviation from malloc() semantics that everyone is used to, and is
indeed causing problems with the remote driver.  The short of it is that the
remote driver allocates memory on behalf of the remote side using VIR_ALLOC_N,
and this call is returning NULL so that the NULL checks elsewhere in the code
fire and return failure.

The attached patch fixes this situation by removing the 0 checks from the memory
allocation paths, and just lets them fall through to the normal malloc(),
calloc(), or realloc() routines, restoring old semantics.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
2008-06-19 11:58:49 +00:00
Chris Lalancette
a24b1d9eda When doing the conversion to danpb's new memory API, a small bug was
introduced into the qemudNetworkIfaceConnect() function.  In particular, there
is a call:

    if (VIR_ALLOC_N(vm->tapfds, vm->ntapfds+2) < 0)
        goto no_memory;

However, the tapfds structure is used to track *all* of the tap fds, and is
called once for each network that is being attached to the domain.  VIR_ALLOC_N
maps to calloc().  So the first network would work just fine, but if you had
more than one network, subsequent calls to this function would blow away the
stored fd's that were already there and fill them all in with zeros.  This
causes multiple problems, from the qemu domains not starting properly to
improper cleanup on shutdown.  The attached patch just changes the VIR_ALLOC_N()
to a VIR_REALLOC_N(), and everything is happy again.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
2008-06-19 10:38:36 +00:00
Jim Meyering
21ea9cb7af remove trailing white space 2008-06-17 15:55:03 +00:00
Chris Lalancette
0de4f35ebc This rather large patch rewrites the virStorageBackendISCSIFindLUNs() function
to only rely on sysfs for finding LUNs, given a session number.  Along the way,
it also fixes the bug where we wouldn't find LUNs for older kernels (with the
block:sda format), and also fixes a race condition where we could try
to find the LUN before udev has finished connecting it.

This patch fixes a few different bugs:
1) We weren't finding LUNs on pre 2.6.24 kernels
2) libvirtd sysfs scanning was racing with udev, so we didn't always see LUNs
3) We weren't showing the 0'th LUN, although that can be a valid LUN

Signed-off-by: Chris Lalancette <clalance@redhat.com>
2008-06-17 12:49:37 +00:00
Chris Lalancette
94e3ba0e87 A small bugfix; we only need to call the iscsiadm sendtarget command when we are
first logging in; we don't need to do it for logout.  Move the sendtarget
command into the Login() function.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
2008-06-17 12:47:10 +00:00
Chris Lalancette
88dd6f6cc2 Older versions of iscsiadm didn't support the "-P 0" flag to the "iscsiadm
--mode session" command.  However, just running "iscsiadm --mode session" seems
to work on all version of iscsiadm commands back to FC-6, so just use that.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
2008-06-17 12:46:38 +00:00
Chris Lalancette
a9e30eec59 In src/util.c, virLog is just a wrapper around fprintf(stderr). Make sure to
put line breaks at the end of lines that use virLog() (noticed during testing).

Signed-off-by: Chris Lalancette <clalance@redhat.com>
2008-06-17 12:45:59 +00:00
Chris Lalancette
a75a612ad5 This patch changes things around so that virStorageBackendRunProgRegex() does
*not* virStorageReportError() if the fork()/exec() process it spawned returned a
!= 0 exit code.  Rather, it returns the exitcode in this case, and it is up to
the higher level to determine whether this is a fatal error or not.  The use
case for this change is in the iSCSI stuff; older versions of iscsiadm tools
would return a failure when getting the session number, despite the command
succeeding.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
2008-06-17 12:45:24 +00:00
Daniel Veillard
a48f26c718 adding autogen.sh to EXTRA_DIST
* Makefile.am: adding autogen.sh to EXTRA_DIST
Daniel
2008-06-13 09:08:44 +00:00
Daniel Veillard
5ba9e91e52 * src/qemu_conf.c: patch from Kaitlin Rupert, dynamic devices
for network should be defined in an 'interface' node not 'net'
Daniel
2008-06-13 07:56:59 +00:00
Daniel Veillard
7db4c905d7 * configure.in NEWS libvirt.spec* doc/* po/*: making libvirt-0.4.3
release
Daniel
2008-06-12 16:10:50 +00:00
Daniel P. Berrange
841dd882a4 Fix misc compile warnings 2008-06-12 13:48:29 +00:00
Daniel P. Berrange
db162cb2b8 Fix saving of iptables rules 2008-06-12 13:47:38 +00:00
Daniel P. Berrange
74fb2b9704 Deal with inactive virtual network in domain creation 2008-06-12 10:19:24 +00:00
Daniel Veillard
4e51a21ccb Adding Kaitlin Rupert in the AUTHORS list
Daniel
2008-06-12 08:56:59 +00:00
Daniel Veillard
5d14e4fcce * src/qemu_driver.c: patch from Kaitlin Rupert, changing vcpu or
memory of an active domain is a NO_SUPPORT not INTERNAL_ERROR
Daniel
2008-06-12 08:55:13 +00:00
Daniel Veillard
d7f62fefed po regeneration
* po/*: update and regenerated
Daniel
2008-06-11 15:22:24 +00:00
Daniel P. Berrange
357bf10553 Fix RPM build 2008-06-11 11:26:36 +00:00
Daniel Veillard
c0626a02a9 * python/libvir.py python/libvirt-python-api.xml: more python
cleanups by Cole Robinson
Daniel
2008-06-11 07:49:01 +00:00
Daniel Veillard
b0a3d6809a * configure.in: patch from Cole Robinson to reactivate storage
support
Daniel
2008-06-10 15:35:15 +00:00
Daniel Veillard
cb96ae2583 * python/generator.py python/libvir.c python/libvirt-python-api.xml:
Apply patch from Cole Robinson fixing UUIDString for python
Daniel
2008-06-10 15:20:25 +00:00
Richard W.M. Jones
406d896363 Pass syntax check for XM block devices over to XenD
* src/xm_internal.c: Pass responsibility for checking syntax
	  of XM block devices over the XenD (see also Xen cset 17617).
	  (Hiroyuki Kaguchi).
2008-06-10 14:39:58 +00:00
Richard W.M. Jones
6bcf25017b virDomainMemoryPeek API
* include/libvirt/libvirt.h.in, src/libvirt.c, src/driver.h,
          src/libvirt_sym.version: New virDomainMemoryPeek API.
        * qemud/remote.c, qemud/remote_protocol.x, src/remote_internal.c:
          Support for remote.
        * src/qemu_driver.c: QEMU driver implementation of API.
        * src/test.c: Test driver (null) implementation of API.
        * docs/hvsupport.html.in: Document API.
        * libvirt.spec.in: New path /var/cache/libvirt for temporary
          storage of memory images.
        * qemud/libvirtd.init.in: Remove any old temp files in
          /var/cache/libvirt on restarts.
        * src/Makefile.am: make install creates /var/cache/libvirt.
        * configure.in: Detect mkdir -p.
2008-06-10 10:43:28 +00:00
David L. Leskovec
0d0c96722c Mon Jun 9 15:42:34 PST 2008 David L. Leskovec <dlesko@linux.vnet.ibm.com>
* src/lxc_driver.c: Make console element is output only.  Always open new
	PTY when starting a container.
	Fix string overrun when storing console name in VM def struct
2008-06-09 22:51:32 +00:00
Richard W.M. Jones
787e44a1d0 Better error messages in xend driver.
* src/xend_internal.c: Change virXendError function to take
	varargs.  Better error messages throughout.
2008-06-09 12:16:03 +00:00
Daniel P. Berrange
d789ef5a88 Switch over remaining driver code to use memory alloc apis 2008-06-06 11:09:57 +00:00
Daniel P. Berrange
d7d21c85e0 Switch daemon over to use internal memory allocation APIs 2008-06-06 10:52:01 +00:00
Richard W.M. Jones
a73a88a19f virDomainBlockPeek QEMU and remote support
* qemud/remote.c, qemud/remote_protocol.x, src/remote_internal.c:
	  Remote support.
	* qemud/remote_dispatch_localvars.h,
	  qemud/remote_dispatch_proc_switch.h,
	  qemud/remote_dispatch_prototypes.h,
	  qemud/remote_protocol.c,
	  qemud/remote_protocol.h:
	  Generated files for remote support.
	* src/xen_unified.c, src/driver.h, src/libvirt.c: Small fix -
	  pass flags around internally.
	* src/qemu_driver.c: Support for QEMU.
	* src/xend_internal.c: Remove redundant fstat call from Xen.
2008-06-05 21:12:26 +00:00
Richard W.M. Jones
8354895e68 virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
	* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
	* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
	src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
	* src/qemu_driver.c, src/test.c: Null versions of this call.
	* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
	src/xm_internal.c, src/xm_internal.h: Xen implementation.
	* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
	tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
	has been reordered slightly in the Xen driver, but should be
	functionally the same.
2008-06-05 13:17:45 +00:00
David L. Leskovec
0bd57cdbe1 Fix a few issues related to restart of libvirtd with containers running.
Mon May 12 23:32:21 PST 2008 David L. Leskovec <dlesko@linux.vnet.ibm.com>

	* src/lxc_driver.c: Add sanity of tty pid before kill()
	Ignore ECHILD errors during VM cleanup
	Call functions to store tty pid and cleanup tty pid file
	* src/lxc_conf.h: Add function to verify container process exists
	Add facilities to manage storing the tty forward process pid
	* src/lxc_conf.c: Add function to verify container process exists
	Call function to verify container process during config load
	Add facilities to manage storing the tty forward process pid
	Call function to load tty pid during load config
2008-06-05 06:03:00 +00:00
Richard W.M. Jones
eeb224b812 * src/xm_internal.c: If vcpu cpuset attribute is invalid
then display an error instead of silently ignoring it
	(Hiroyuki Kaguchi).
2008-06-03 08:01:45 +00:00
Richard W.M. Jones
4a9ebf7da7 General tips for contributing patches
* HACKING: Added section "general tips for contributing patches"
	to this file.
2008-06-02 11:53:23 +00:00
Daniel P. Berrange
f855e91f11 Only run coverage tests if lcov is installed 2008-05-29 20:43:08 +00:00
Daniel P. Berrange
d007428ddb Fix make dist 2008-05-29 20:09:56 +00:00