1. 11 4月, 2013 1 次提交
  2. 09 4月, 2013 3 次提交
    • D
      Unmount existing filesystems under user specified mounts in LXC · 1bd955ed
      Daniel P. Berrange 提交于
      If the user requests a mount for /run, this may hide any existing
      mounts that are lower down in /run. The result is that the
      container still sees the mounts in /proc/mounts, but cannot
      access them
      
      sh-4.2# df
      df: '/run/user/501/gvfs': No such file or directory
      df: '/run/media/berrange/LIVE': No such file or directory
      df: '/run/media/berrange/SecureDiskA1': No such file or directory
      df: '/run/libvirt/lxc/sandbox': No such file or directory
      Filesystem                      1K-blocks      Used Available Use% Mounted on
      /dev/mapper/vg_t500wlan-lv_root 151476396 135390200   8384900  95% /
      tmpfs                             1970888      3204   1967684   1% /run
      /dev/sda1                          194241    155940     28061  85% /boot
      devfs                                  64         0        64   0% /dev
      tmpfs                                  64         0        64   0% /sys/fs/cgroup
      tmpfs                             1970888      1200   1969688   1% /etc/libvirt-sandbox/scratch
      
      Before mounting any filesystem at a particular location, we
      must recursively unmount anything at or below the target mount
      point
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      1bd955ed
    • D
      Move lxcContainerUnmountSubtree further up in file · 2863ca22
      Daniel P. Berrange 提交于
      Ensure lxcContainerUnmountSubtree is at the top of the
      lxc_container.c file so it is easily referenced from
      any other method. No functional change
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      2863ca22
    • B
      Implement support for <hostdev caps=net> · 442d6a05
      Bogdan Purcareata 提交于
      This allows a container-type domain to have exclusive access to one of
      the host's NICs.
      
      Wire <hostdev caps=net> with the lxc_controller - when moving the newly
      created veth devices into a new namespace, also look for any hostdev
      devices that should be moved. Note: once the container domain has been
      destroyed, there is no code that moves the interfaces back to the
      original namespace. This does happen, though, probably due to default
      cleanup on namespace destruction.
      Signed-off-by: NBogdan Purcareata <bogdan.purcareata@freescale.com>
      442d6a05
  3. 08 4月, 2013 1 次提交
  4. 05 4月, 2013 8 次提交
    • D
      Don't create dirs in cgroup controllers we don't want to use · 56f27b3b
      Daniel P. Berrange 提交于
      Currently when getting an instance of virCgroupPtr we will
      create the path in all cgroup controllers. Only at the virt
      driver layer are we attempting to filter controllers. This
      is bad because the mere act of creating the dirs in the
      controllers can have a functional impact on the kernel,
      particularly for performance.
      
      Update the virCgroupForDriver() method to accept a bitmask
      of controllers to use. Only create dirs in the controllers
      that are requested. When creating cgroups for domains,
      respect the active controller list from the parent cgroup
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      56f27b3b
    • D
      Rename virCgroupGetAppRoot to virCgroupForSelf · 804a809a
      Daniel P. Berrange 提交于
      The virCgroupGetAppRoot is not clear in its meaning. Change
      to virCgroupForSelf to highlight that this returns the
      cgroup config for the caller's process
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      804a809a
    • P
      virCaps: get rid of defaultConsoleTargetType callback · 482e5f15
      Peter Krempa 提交于
      This patch refactors various places to allow removing of the
      defaultConsoleTargetType callback from the virCaps structure.
      
      A new console character device target type is introduced -
      VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_NONE - to mark that no type was
      specified in the XML. This type is at the end converted to the standard
      VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL. Other types that are
      different from this default have to be processed separately in the
      device post parse callback.
      482e5f15
    • P
      virCaps: get rid of macPrefix field · 46becc18
      Peter Krempa 提交于
      Use the virDomainXMLConf structure to hold this data and tweak the code
      to avoid semantic change.
      
      Without configuration the KVM mac prefix is used by default. I chose it
      as it's in the privately administered segment so it should be usable for
      any purposes.
      46becc18
    • P
      virCaps: get rid of emulatorRequired · b5def001
      Peter Krempa 提交于
      This patch removes the emulatorRequired field and associated
      infrastructure from the virCaps object. Instead the driver specific
      callbacks are used as this field isn't enforced by all drivers.
      
      This patch implements the appropriate callbacks in the qemu and lxc
      driver and moves to check to that location.
      b5def001
    • P
      conf callback: Rearrange function parameters · ad0d10b2
      Peter Krempa 提交于
      Move the xmlopt and caps arguments to the end of the argument list.
      ad0d10b2
    • P
      conf: Add post XML parse callbacks and prepare for cleaning of virCaps · 43b99fc4
      Peter Krempa 提交于
      This patch adds instrumentation that will allow hypervisor drivers to
      fill and validate domain and device definitions after parsed by the XML
      parser.
      
      With this patch, after the XML is parsed, a callback to the driver is
      issued requesting to fill and validate driver specific details of the
      configuration. This allows to use sensible defaults and checks on a per
      driver basis at the time the XML is parsed.
      
      Two callback pointers are stored in the new virDomainXMLConf object:
      * virDomainDeviceDefPostParseCallback (devicesPostParseCallback)
        - called for a single device parsed and for every single device in a
          domain config. A virDomainDeviceDefPtr is passed along with the
          domain definition and virCaps.
      
      * virDomainDefPostParseCallback, (domainPostParseCallback)
        - A callback that is meant to process the domain config after it's
        parsed.  A virDomainDefPtr is passed along with virCaps.
      
      Both types of callbacks support arbitrary opaque data passed for the
      callback functions.
      
      Errors may be reported in those callbacks resulting in a XML parsing
      failure.
      43b99fc4
    • P
      maint: Rename xmlconf to xmlopt and virDomainXMLConfig to virDomainXMLOption · e84b1931
      Peter Krempa 提交于
      This patch is the result of running:
      
      for i in $(git ls-files | grep -v html | grep -v \.po$ ); do
        sed -i -e "s/virDomainXMLConf/virDomainXMLOption/g" -e "s/xmlconf/xmlopt/g" $i
      done
      
      and a few manual tweaks.
      e84b1931
  5. 04 4月, 2013 4 次提交
  6. 23 3月, 2013 5 次提交
  7. 22 3月, 2013 1 次提交
  8. 20 3月, 2013 3 次提交
  9. 19 3月, 2013 2 次提交
    • D
      Do not prematurely close loop devices in LXC controller · 0a418355
      Daniel P. Berrange 提交于
      The LXC controller is closing loop devices as soon as the
      container has started. This is fine if the loop device
      was setup as a mounted filesystem, but if we're just passing
      through the loop device as a disk, nothing else is keeping
      it open. Thus we must keep the loop device FDs open for as
      long the libvirt_lxc process is running.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      0a418355
    • D
      Setup LXC cgroups in two phases · 1760258c
      Daniel P. Berrange 提交于
      Currently the LXC controller creates the cgroup, configures the
      resources and adds the task all in one go. This is not sufficiently
      flexible for the forthcoming NBD integration. We need to make sure
      the NBD process gets into the right cgroup immediately, but we can
      not have limits (in particular the device ACL) applied at the point
      where we start qemu-nbd. So create a virLXCCgroupCreate method
      which creates the cgroup and adds the current task to be called
      early, and leave virLXCCgroupSetup to only do resource config.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      1760258c
  10. 14 3月, 2013 2 次提交
  11. 13 3月, 2013 3 次提交
    • D
      Daemonize fuse thread in libvirt_lxc · e31f32c6
      Daniel P. Berrange 提交于
      In some startup failure modes, the fuse thread may get itself
      wedged. This will cause the entire libvirt_lxc process to
      hang trying to the join the thread. There is no compelling
      reason to wait for the thread to exit if the whole process
      is exiting, so just daemonize the fuse thread instead.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      e31f32c6
    • D
      Fix query of LXC security label · a0881019
      Daniel P. Berrange 提交于
      The virDomainGetSecurityLabel method is currently (mistakenly)
      showing the label of the libvirt_lxc process:
      
      ...snip...
      Security model: selinux
      Security DOI:   0
      Security label: system_u:system_r:virtd_t:s0-s0:c0.c1023 (permissive)
      
      when it should be showing the init process label
      
      ...snip...
      Security model: selinux
      Security DOI:   0
      Security label: system_u:system_r:svirt_t:s0:c724,c995 (permissive)
      a0881019
    • P
      virCaps: conf: start splitting out irrelevat data · 27cf98e2
      Peter Krempa 提交于
      The virCaps structure gathered a ton of irrelevant data over time that.
      The original reason is that it was propagated to the XML parser
      functions.
      
      This patch aims to create a new data structure virDomainXMLConf that
      will contain immutable data that are used by the XML parser. This will
      allow two things we need:
      
      1) Get rid of the stuff from virCaps
      
      2) Allow us to add callbacks to check and add driver specific stuff
      after domain XML is parsed.
      
      This first attempt removes pointers to private data allocation functions
      to this new structure and update all callers and function that require
      them.
      27cf98e2
  12. 12 3月, 2013 1 次提交
  13. 11 3月, 2013 2 次提交
    • G
      Convert HAVE_SELINUX to WITH_SELINUX · 531b4fe8
      Guido Günther 提交于
      these were missed by 63f18f37
      531b4fe8
    • G
      lxc: Init activeUsbHostdevs · 6082bc27
      Guido Günther 提交于
      otherwise we crash with
      
       #0  virUSBDeviceListFind (list=0x0, dev=dev@entry=0x8193d70) at util/virusb.c:526
       #1  0xb1a4995b in virLXCPrepareHostdevUSBDevices (driver=driver@entry=0x815d9a0, name=0x815dbf8 "debian-700267", list=list@entry=0x81d8f08) at lxc/lxc_hostdev.c:88
       #2  0xb1a49fce in virLXCPrepareHostUSBDevices (def=0x8193af8, driver=0x815d9a0) at lxc/lxc_hostdev.c:261
       #3  virLXCPrepareHostDevices (driver=driver@entry=0x815d9a0, def=0x8193af8) at lxc/lxc_hostdev.c:328
       #4  0xb1a4c5b1 in virLXCProcessStart (conn=0x817d3f8, driver=driver@entry=0x815d9a0, vm=vm@entry=0x8190908, autoDestroy=autoDestroy@entry=false, reason=reason@entry=VIR_DOMAIN_RUNNING_BOOTED)
           at lxc/lxc_process.c:1068
       #5  0xb1a57e00 in lxcDomainStartWithFlags (dom=dom@entry=0x815e460, flags=flags@entry=0) at lxc/lxc_driver.c:1014
       #6  0xb1a57fc3 in lxcDomainStart (dom=0x815e460) at lxc/lxc_driver.c:1046
       #7  0xb79c8375 in virDomainCreate (domain=domain@entry=0x815e460) at libvirt.c:8450
       #8  0x08078959 in remoteDispatchDomainCreate (args=0x81920a0, rerr=0xb65c21d0, client=0xb0d00490, server=<optimized out>, msg=<optimized out>) at remote_dispatch.h:1066
       #9  remoteDispatchDomainCreateHelper (server=0x80c4928, client=0xb0d00490, msg=0xb0d005b0, rerr=0xb65c21d0, args=0x81920a0, ret=0x815d208) at remote_dispatch.h:1044
       #10 0xb7a36901 in virNetServerProgramDispatchCall (msg=0xb0d005b0, client=0xb0d00490, server=0x80c4928, prog=0x80c6438) at rpc/virnetserverprogram.c:432
       #11 virNetServerProgramDispatch (prog=0x80c6438, server=server@entry=0x80c4928, client=0xb0d00490, msg=0xb0d005b0) at rpc/virnetserverprogram.c:305
       #12 0xb7a300a7 in virNetServerProcessMsg (msg=<optimized out>, prog=<optimized out>, client=<optimized out>, srv=0x80c4928) at rpc/virnetserver.c:162
       #13 virNetServerHandleJob (jobOpaque=0xb0d00510, opaque=0x80c4928) at rpc/virnetserver.c:183
       #14 0xb7924f98 in virThreadPoolWorker (opaque=opaque@entry=0x80a94b0) at util/virthreadpool.c:144
       #15 0xb7924515 in virThreadHelper (data=0x80a9440) at util/virthreadpthread.c:161
       #16 0xb7887c39 in start_thread (arg=0xb65c2b70) at pthread_create.c:304
       #17 0xb77eb78e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130
      
      when adding a domain with a usb device. This is Debian bug
      
          http://bugs.debian.org/700267
      6082bc27
  14. 09 3月, 2013 1 次提交
    • G
      lxc: include sys/stat.h · c8871d8f
      Guido Günther 提交于
      This fixes the build on Debian Wheezy which otherwise fails with:
      
        CC     libvirt_driver_lxc_impl_la-lxc_process.lo
        lxc/lxc_process.c: In function 'virLXCProcessGetNsInode':
        lxc/lxc_process.c:648:5: error: implicit declaration of function 'stat' [-Werror=implicit-function-declaration]
        lxc/lxc_process.c:648:5: error: nested extern declaration of 'stat' [-Werror=nested-externs]
        cc1: all warnings being treated as errors
      c8871d8f
  15. 08 3月, 2013 3 次提交