Commit Graph

12 Commits

Author SHA1 Message Date
Ryota Ozaki
e8fc4cbb64 LXC implement missing macaddr assignment feature
Currently MAC address configuration of container veth is just ignored.
This patch implements the missing feature.

* src/lxc/veth.c, src/lxc/veth.h: add setMacAddr
* src/lxc/lxc_driver.c: set macaddr of container veth if specified
2009-10-21 12:04:02 +02:00
Ryota Ozaki
c396fb36fa LXC complement PATH environment variable
* src/lxc/lxc_driver.c: without PATH, the controller will definitely
  fail to call ip command
2009-10-14 16:54:29 +02:00
Ryota Ozaki
c861237a64 LXC fix return code handling in lxcVmStart
In lxcVmStart we first should not reuse rc for another purpose
than the return value.

* src/lxc/lxc_driver.c: don't reuse rc for local procedure calls
2009-10-13 16:36:59 +02:00
Amy Griffis
2dd44664cf LXC add driver config file lxc.conf
* src/lxc/lxc.conf: new configuration file, there is currently one
  tunable "log_with_libvirtd" that controls whether an lxc controller will
  log only to the container log file, or whether it will honor libvirtd's
  log output configuration. This provides a way to have libvirtd and its
  children log to a single file.  The default is to log to the container
  log file.
* src/Makefile.am libvirt.spec.in: add the new file
* src/lxc/lxc_conf.[ch] src/lxc/lxc_driver.c: read the new log value
  from the configuration file and pass the log informations when
  starting up a container.
2009-10-08 17:40:14 +02:00
Amy Griffis
c73a0c4ac9 LXC do not truncate container log files on restart
* src/lxc/lxc_driver.c: use O_APPEND instead of O_TRUNC when opening
  the log file on lxcVmStart()
2009-10-08 17:37:09 +02:00
Amy Griffis
221b457e69 LXC initialize logging configuration
* src/lxc/lxc_driver.c src/lxc/lxc_controller.c: before launching the
  lxc controller, have the lxc driver query the log settings and setup
  envp[]. This provides the advantage of honoring the actual log
  configuration instead of only what had been set in the environment.
  The lxc controller now simply has to call virLogSetFromEnv().
2009-10-08 17:16:08 +02:00
Ryota Ozaki
3a05dc09ec LXC implement memory control APIs
The patch implements the missing memory control APIs for lxc, i.e.,
domainGetMaxMemory, domainSetMaxMemory, domainSetMemory, and improves
domainGetInfo to return proper amount of used memory via cgroup.

* src/libvirt_private.syms: Export virCgroupGetMemoryUsage
  and add missing virCgroupSetMemory
* src/lxc/lxc_driver.c: Implement missing memory functions
* src/util/cgroup.c, src/util/cgroup.h: Add the function
  to get used memory
2009-10-07 15:26:23 +02:00
Chris Lalancette
6e16575a37 Tunnelled migration.
Implementation of tunnelled migration, using a Unix Domain Socket
on the qemu backend.  Note that this requires very new versions of
qemu (0.10.7 at least) in order to get the appropriate bugfixes.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
2009-10-02 11:43:26 +02:00
Chris Lalancette
03d777f345 Introduce virStrncpy.
Add the virStrncpy function, which takes a dst string, source string,
the number of bytes to copy and the number of bytes available in the
dest string.  If the source string is too large to fit into the
destination string, including the \0 byte, then no data is copied and
the function returns NULL.  Otherwise, this function copies n bytes
from source into dst, including the \0, and returns a pointer to the
dst string.  This function is intended to replace all unsafe uses
of strncpy in the code base, since strncpy does *not* guarantee that
the buffer terminates with a \0.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
2009-09-22 20:10:00 +02:00
Ryota Ozaki
c8c9ef2757 lxc: suspend/resume support
* src/conf/domain_conf.c: Don't assume all virDomainObjPtr have
  a non-NULL monitor_chr field in virDomainObjFormat.
* src/lxc/lxc_driver.c: Implement suspend/resume driver APis
* src/util/cgroup.c, src/util/cgroup.h: Support the 'freezer'
  cgroup controller
* src/libvirt_private.syms: Export virCgroupSetFreezerState
  and virCgroupGetFreezerState
2009-09-22 11:30:06 +01:00
Chris Lalancette
5d2df4100d Fix up comments for domainXML{To,From}Native.
Signed-off-by: Chris Lalancette <clalance@redhat.com>
2009-09-21 18:15:41 +02:00
Daniel P. Berrange
c93125b120 Move LXC driver into src/lxc/
* src/lxc_conf.c, src/lxc_conf.h, src/lxc_container.c,
  src/lxc_container.h, src/lxc_controller.c, src/lxc_driver.c,
  src/lxc_driver.h, src/veth.c, src/veth.h: Move to src/lxc/
* src/opennebula/one_driver.c: Remove bogus veth.h include
* src/Makefile.am: Adjust for lxc paths
* daemon/qemud.c: Adjust include for lxc
2009-09-21 14:41:42 +01:00