- 05 7月, 2012 2 次提交
-
-
由 Daniel P. Berrange 提交于
Move the veth device name state into the virLXCControllerPtr object and stop passing it around. Also use size_t instead of unsigned int for the array length parameters. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
The LXC controller code is having to pass around an ever increasing number of parameters between methods. To make the code more managable introduce a virLXCControllerPtr to hold all this state, starting with the container name and virDomainDefPtr object Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 29 6月, 2012 1 次提交
-
-
由 Daniel P. Berrange 提交于
Since we are mounting a new /dev in the container, we must remove any sub-mounts like /dev/shm, /dev/mqueue, etc, otherwise they'll be recorded in /proc/mounts, but not be accessible to applications.
-
- 25 6月, 2012 3 次提交
-
-
由 Daniel J Walsh 提交于
Currently libvirt-lxc checks to see if the destination exists and is a directory. If it is not a directory then the mount fails. Since libvirt-lxc can bind mount files on an inode, this patch is needed to allow us to bind mount files on files. Currently we want to bind mount on top of /etc/machine-id, and /etc/adjtime If the destination of the mount point does not exists, it checks if the src is a directory and then attempts to create a directory, otherwise it creates an empty file for the destination. The code will then bind mount over the destination. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
Currently you can configure LXC to bind a host directory to a guest directory, but not to bind a guest directory to a guest directory. While the guest container init could do this itself, allowing it in the libvirt XML means a stricter SELinux policy can be written
-
由 Daniel P. Berrange 提交于
Introduce a new syntax for filesystems to allow use of a RAM filesystem <filesystem type='ram'> <source usage='10' units='MiB'/> <target dir='/mnt'/> </filesystem> The usage units default to KiB to limit consumption of host memory. * docs/formatdomain.html.in: Document new syntax * docs/schemas/domaincommon.rng: Add new attributes * src/conf/domain_conf.c: Parsing/formatting of RAM filesystems * src/lxc/lxc_container.c: Mounting of RAM filesystems Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 21 6月, 2012 1 次提交
-
-
由 Jim Fehlig 提交于
The lxc contoller eventually makes use of virRandomBits(), which was segfaulting since virRandomInitialize() is never invoked. Program received signal SIGSEGV, Segmentation fault. 0x00007ffff554d560 in random_r () from /lib64/libc.so.6 (gdb) bt 0 0x00007ffff554d560 in random_r () from /lib64/libc.so.6 1 0x0000000000469eaa in virRandomBits (nbits=32) at util/virrandom.c:80 2 0x000000000045bf69 in virHashCreateFull (size=256, dataFree=0x4aa2a2 <hashDataFree>, keyCode=0x45bd40 <virHashStrCode>, keyEqual=0x45bdad <virHashStrEqual>, keyCopy=0x45bdfa <virHashStrCopy>, keyFree=0x45be37 <virHashStrFree>) at util/virhash.c:134 3 0x000000000045c069 in virHashCreate (size=0, dataFree=0x4aa2a2 <hashDataFree>) at util/virhash.c:164 4 0x00000000004aa562 in virNWFilterHashTableCreate (n=0) at conf/nwfilter_params.c:686 5 0x00000000004aa95b in virNWFilterParseParamAttributes (cur=0x711d30) at conf/nwfilter_params.c:793 6 0x0000000000481a7f in virDomainNetDefParseXML (caps=0x702c90, node=0x7116b0, ctxt=0x7101b0, bootMap=0x0, flags=0) at conf/domain_conf.c:4589 7 0x000000000048cc36 in virDomainDefParseXML (caps=0x702c90, xml=0x710040, root=0x7103b0, ctxt=0x7101b0, expectedVirtTypes=16, flags=0) at conf/domain_conf.c:8658 8 0x000000000048f011 in virDomainDefParseNode (caps=0x702c90, xml=0x710040, root=0x7103b0, expectedVirtTypes=16, flags=0) at conf/domain_conf.c:9360 9 0x000000000048ee30 in virDomainDefParse (xmlStr=0x0, filename=0x702ae0 "/var/run/libvirt/lxc/x.xml", caps=0x702c90, expectedVirtTypes=16, flags=0) at conf/domain_conf.c:9310 10 0x000000000048ef00 in virDomainDefParseFile (caps=0x702c90, filename=0x702ae0 "/var/run/libvirt/lxc/x.xml", expectedVirtTypes=16, flags=0) at conf/domain_conf.c:9332 11 0x0000000000425053 in main (argc=5, argv=0x7fffffffe2b8) at lxc/lxc_controller.c:1773
-
- 20 6月, 2012 1 次提交
-
-
由 Peter Krempa 提交于
This patch adds support for listing all domains into drivers that use the common virDomainObj implementation: libxl, lxc, openvz, qemu, test, uml, vmware. For drivers that don't support managed save images the guests are treated as if they had none, so filtering guests that do have such an image on this driver succeeds and produces 0 results.
-
- 19 6月, 2012 4 次提交
-
-
由 Gao feng 提交于
when lxcContainerIdentifyCGroups failed, the memory it allocated has been freed, so we should not free this memory again in lxcContainerSetupPivortRoot and lxcContainerSetupExtraMounts. Signed-off-by: NGao feng <gaofeng@cn.fujitsu.com>
-
由 Gao feng 提交于
print debug info "container support is enabled" when host support the user or net namespace. Signed-off-by: NGao feng <gaofeng@cn.fujitsu.com>
-
由 Gao feng 提交于
kill the "return 0;" code, it will cause memory leak. Signed-off-by: NGao feng <gaofeng@cn.fujitsu.com>
-
由 Eric Blake 提交于
Introduced in commit 1f8c33b6. * src/lxc/lxc_container.c (lxcContainerGetSubtree): Avoid TAB.
-
- 18 6月, 2012 2 次提交
-
-
由 Gao feng 提交于
when libvirt_lxc trigger oom error in lxcContainerGetSubtree we should free the alloced memory for mounts. so when lxcContainerGetSubtree failed,we should do some memory cleanup in lxcContainerUnmountSubtree. Signed-off-by: NGao feng <gaofeng@cn.fujitsu.com>
-
由 Gao feng 提交于
we alloc the memory for format in lxcContainerMountDetectFilesystem but without free it in lxcContainerMountFSBlockHelper. this patch just call VIR_FREE to free it. Signed-off-by: NGao feng <gaofeng@cn.fujitsu.com>
-
- 15 6月, 2012 1 次提交
-
-
由 Daniel P. Berrange 提交于
This reverts commit c16b4c43 Author: Daniel P. Berrange <berrange@redhat.com> Date: Fri May 11 15:09:27 2012 +0100 Avoid LXC pivot root in the root source is still / This commit broke setup of /dev, because the code which deals with setting up a private /dev and /dev/pts only works if you do a pivotroot. The original intent of avoiding the pivot root was to try and ensure the new root has a minimumal mount tree. The better way todo this is to just unmount the bits we don't want (ie old /proc & /sys subtrees. So apply the logic from commit c529b47a Author: Daniel P. Berrange <berrange@redhat.com> Date: Fri May 11 11:35:28 2012 +0100 Trim /proc & /sys subtrees before mounting new instances to the pivot_root codepath as well
-
- 14 6月, 2012 1 次提交
-
-
由 Daniel P. Berrange 提交于
A core use case of the hook scripts is to be able to do things to a guest's network configuration. It is possible to hook into the 'start' operation for a QEMU guest which runs just before the guest is started. The TAP devices will exist at this point, but the QEMU process will not. It can be desirable to have a 'started' hook too, which runs once QEMU has started. If libvirtd is restarted it will re-populate firewall rules, but there is no QEMU hook to trigger for existing domains. This is solved with a 'reconnect' hook. Finally, if attaching to an external QEMU process there needs to be an 'attach' hook script. This all also applies to the LXC driver * docs/hooks.html.in: Document new operations * src/util/hooks.c, src/util/hooks.c: Add 'started', 'reconnect' and 'attach' operations for QEMU. Add 'prepare', 'started', 'release' and 'reconnect' operations for LXC * src/lxc/lxc_driver.c: Add hooks for 'prepare', 'started', 'release' and 'reconnect' operations * src/qemu/qemu_process.c: Add hooks for 'started', 'reconnect' and 'reconnect' operations
-
- 11 6月, 2012 3 次提交
-
-
由 Gao feng 提交于
we forgot to free fslist,just add VIR_FREE(fslist). Signed-off-by: NGao feng <gaofeng@cn.fujitsu.com>
-
由 Gao feng 提交于
when do remount,the source and target should be the same values specified in the initial mount() call. So change fs->dst to src. Signed-off-by: NGao feng <gaofeng@cn.fujitsu.com>
-
由 Gao feng 提交于
There is no code use the variable "src" in lxcContainerMountBasicFS. so delete it and VIR_FREE. Signed-off-by: NGao feng <gaofeng@cn.fujitsu.com>
-
- 30 5月, 2012 1 次提交
-
-
由 Martin Kletzander 提交于
When getting number of CPUs the host has assigned, there was always number "1" returned. Even though all lxc domains with no pinning launched by libvirt run on all pCPUs (by default, no matter what's the number), we should at least return the same number as the user specified when creating the domain.
-
- 28 5月, 2012 2 次提交
-
-
由 Daniel P. Berrange 提交于
When adding new config file parameters, the corresponding additions to the augeas lens' are constantly forgotten. Also there are augeas test cases, these don't catch the error, since they too are never updated. To address this, the augeas test cases need to be auto-generated from the example config files. * build-aux/augeas-gentest.pl: Helper to generate an augeas test file, substituting in elements from the example config files * src/Makefile.am, daemon/Makefile.am: Switch to auto-generated augeas test cases * daemon/test_libvirtd.aug, daemon/test_libvirtd.aug.in, src/locking/test_libvirt_sanlock.aug, src/locking/test_libvirt_sanlock.aug.in, src/lxc/test_libvirtd_lxc.aug, src/lxc/test_libvirtd_lxc.aug.in, src/qemu/test_libvirtd_qemu.aug, src/qemu/test_libvirtd_qemu.aug.in: Remove example config file data, replacing with a ::CONFIG:: placeholder Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
Instead of doing # example_config use #example_config so it is possible to programatically uncomment example config options, as distinct from their comment/descriptions Also delete rogue trailing comma not allowed by lens Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 22 5月, 2012 1 次提交
-
-
由 Daniel P. Berrange 提交于
When the last reference to a virConnectPtr is released by libvirtd, it was possible for a deadlock to occur in the virDomainEventState functions. The virDomainEventStatePtr holds a reference on virConnectPtr for each registered callback. When removing a callback, the virUnrefConnect function is run. If this causes the last reference on the virConnectPtr to be released, then virReleaseConnect can be run, which in turns calls qemudClose. This function has a call to virDomainEventStateDeregisterConn which is intended to remove all callbacks associated with the virConnectPtr instance. This will try to grab a lock on virDomainEventState but this lock is already held. Deadlock ensues Thread 1 (Thread 0x7fcbb526a840 (LWP 23185)): Since each callback associated with a virConnectPtr holds a reference on virConnectPtr, it is impossible for the qemudClose method to be invoked while any callbacks are still registered. Thus the call to virDomainEventStateDeregisterConn must in fact be a no-op. Thus it is possible to just remove all trace of virDomainEventStateDeregisterConn and avoid the deadlock. * src/conf/domain_event.c, src/conf/domain_event.h, src/libvirt_private.syms: Delete virDomainEventStateDeregisterConn * src/libxl/libxl_driver.c, src/lxc/lxc_driver.c, src/qemu/qemu_driver.c, src/uml/uml_driver.c: Remove calls to virDomainEventStateDeregisterConn
-
- 16 5月, 2012 6 次提交
-
-
由 Daniel P. Berrange 提交于
Normal practice is for cgroups controllers to be mounted at /sys/fs/cgroup. When setting up a container, /sys is mounted with a new sysfs instance, thus we must re-mount all the cgroups controllers. The complexity is that we must mount them in the same layout as the host OS. ie if 'cpu' and 'cpuacct' were mounted at the same location in the host we must preserve this in the container. Also if any controllers are co-located we must setup symlinks from the individual controller name to the co-located mount-point Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
Both /proc and /sys may have sub-mounts in them from the host OS. We must explicitly unmount them all before mounting the new instance over that location. If we don't then /proc/mounts will show the sub-mounts as existing, even though nothing will be able to access them, due to the over-mount. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
If the LXC config has a filesystem <filesystem> <source dir='/'/> <target dir='/'/> </filesystem> then there is no need to go down the pivot root codepath. We can simply use the existing root as needed. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
Currently to make sysfs readonly, we remount the existing instance and then bind it readonly. Unfortunately this means sysfs is still showing device objects wrt the host OS namespace. We need it to reflect the container namespace, so we must mount a completely new instance of it. Do the same for selinuxfs since there is no benefit to bind mounting & this lets us simplify the code. * src/lxc/lxc_container.c: Mount fresh sysfs instance Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel Walsh 提交于
Instead of hardcoding use of SELinux contexts in the LXC driver, switch over to using the official security driver API. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel Walsh 提交于
To allow the security drivers to apply different configuration information per hypervisor, pass the virtualization driver name into the security manager constructor. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 01 5月, 2012 4 次提交
-
-
由 Daniel P. Berrange 提交于
Once lxcContainerSetStdio is invoked, logging will not work as expected in libvirt_lxc. So make sure this is the last thing to be called, in particular after setting the security process label
-
由 Daniel P. Berrange 提交于
The virLogSetFromEnv call was done too late in startup to catch many log messages (eg from security driver initialization). To assist debugging also explicitly log the security details at startup
-
由 Daniel P. Berrange 提交于
The driver->securityDriverName field may be NULL, if automatic probing is used to determine security driver. This meant that unless selinux was explicitly requested in lxc.conf, it was not being sent to the libvirt_lxc process. The driver->securityManager field is guaranteed non-NULL, since there will always be the 'none' security driver present if nothing else exists. So use that to set the driver name for libvirt_lxc Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
Currently the libvirt_lxc process uses VIR_DOMAIN_XML_INACTIVE when loading the XML for the container. This means it loses any dynamic data such as the, just allocated, SELinux label. Further there is an inconsistency in the libvirt LXC driver whereby it saves the live config XML and then later overwrites the file with the live status XML instead. Add a comment about this for future reference. * src/lxc/lxc_controller.c: Remove VIR_DOMAIN_XML_INACTIVE when loading XML * src/lxc/lxc_driver.c: Add comment about inconsistent config file formats Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 28 4月, 2012 1 次提交
-
-
由 Stefan Berger 提交于
Error: UNINIT: /libvirt/src/lxc/lxc_driver.c:1412: var_decl: Declaring variable "fd" without initializer. /libvirt/src/lxc/lxc_driver.c:1460: uninit_use_in_call: Using uninitialized value "fd" when calling "virFileClose". /libvirt/src/util/virfile.c:50: read_parm: Reading a parameter value. Error: DEADCODE: /libvirt/src/lxc/lxc_controller.c:960: dead_error_condition: On this path, the condition "ret == 4" cannot be true. /libvirt/src/lxc/lxc_controller.c:959: at_most: After this line, the value of "ret" is at most -1. /libvirt/src/lxc/lxc_controller.c:959: new_values: Noticing condition "ret < 0". /libvirt/src/lxc/lxc_controller.c:961: dead_error_line: Execution cannot reach this statement "continue;". Error: UNINIT: /libvirt/src/lxc/lxc_controller.c:1104: var_decl: Declaring variable "consoles" without initializer. /libvirt/src/lxc/lxc_controller.c:1237: uninit_use: Using uninitialized value "consoles".
-
- 30 3月, 2012 1 次提交
-
-
由 Daniel P. Berrange 提交于
The code is splattered with a mix of sizeof foo sizeof (foo) sizeof(foo) Standardize on sizeof(foo) and add a syntax check rule to enforce it Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 27 3月, 2012 3 次提交
-
-
由 Daniel P. Berrange 提交于
Pass argv to the init binary of LXC, using a new <initarg> element. * docs/formatdomain.html.in: Document <os> usage for containers * docs/schemas/domaincommon.rng: Add <initarg> element * src/conf/domain_conf.c, src/conf/domain_conf.h: parsing and formatting of <initarg> * src/lxc/lxc_container.c: Setup LXC argv * tests/Makefile.am, tests/lxcxml2xmldata/lxc-systemd.xml, tests/lxcxml2xmltest.c, tests/testutilslxc.c, tests/testutilslxc.h: Test parsing/formatting of LXC related XML parts
-
由 Daniel P. Berrange 提交于
The SELinux mount point moved from /selinux to /sys/fs/selinux when systemd came along. * configure.ac: Probe for SELinux mount point * src/lxc/lxc_container.c: Use SELinux mount point determined by configure.ac
-
由 Martin Kletzander 提交于
Return statements with parameter enclosed in parentheses were modified and parentheses were removed. The whole change was scripted, here is how: List of files was obtained using this command: git grep -l -e '\<return\s*([^()]*\(([^()]*)[^()]*\)*)\s*;' | \ grep -e '\.[ch]$' -e '\.py$' Found files were modified with this command: sed -i -e \ 's_^\(.*\<return\)\s*(\(\([^()]*([^()]*)[^()]*\)*\))\s*\(;.*$\)_\1 \2\4_' \ -e 's_^\(.*\<return\)\s*(\([^()]*\))\s*\(;.*$\)_\1 \2\3_' Then checked for nonsense. The whole command looks like this: git grep -l -e '\<return\s*([^()]*\(([^()]*)[^()]*\)*)\s*;' | \ grep -e '\.[ch]$' -e '\.py$' | xargs sed -i -e \ 's_^\(.*\<return\)\s*(\(\([^()]*([^()]*)[^()]*\)*\))\s*\(;.*$\)_\1 \2\4_' \ -e 's_^\(.*\<return\)\s*(\([^()]*\))\s*\(;.*$\)_\1 \2\3_'
-
- 23 3月, 2012 1 次提交
-
-
由 Daniel P. Berrange 提交于
Move error reporting out of the callers, into virURIParse and virURIFormat, to get consistency. * include/libvirt/virterror.h, src/util/virterror.c: Add VIR_FROM_URI * src/util/viruri.c, src/util/viruri.h: Add error reporting * src/esx/esx_driver.c, src/libvirt.c, src/libxl/libxl_driver.c, src/lxc/lxc_driver.c, src/openvz/openvz_driver.c, src/qemu/qemu_driver.c, src/qemu/qemu_migration.c, src/remote/remote_driver.c, src/uml/uml_driver.c, src/vbox/vbox_tmpl.c, src/vmx/vmx.c, src/xen/xen_driver.c, src/xen/xend_internal.c, tests/viruritest.c: Remove error reporting Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 16 3月, 2012 1 次提交
-
-
由 Daniel P. Berrange 提交于
If no <interface> elements are included in an LXC guest XML description, then the LXC guest will just see the host's network interfaces. It is desirable to be able to hide the host interfaces, without having to define any guest interfaces. This patch introduces a new feature flag <privnet/> to allow forcing of a private network namespace for LXC. In the future I also anticipate that we will add <privuser/> to force a private user ID namespace. * src/conf/domain_conf.c, src/conf/domain_conf.h: Add support for <privnet/> feature. Auto-set <privnet> if any <interface> devices are defined * src/lxc/lxc_container.c: Honour request for private network namespace
-