1. 09 4月, 2013 2 次提交
  2. 08 4月, 2013 1 次提交
  3. 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
  4. 04 4月, 2013 4 次提交
  5. 23 3月, 2013 5 次提交
  6. 22 3月, 2013 1 次提交
  7. 20 3月, 2013 3 次提交
  8. 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
  9. 14 3月, 2013 2 次提交
  10. 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
  11. 12 3月, 2013 1 次提交
  12. 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
  13. 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
  14. 08 3月, 2013 5 次提交
    • D
      Include pid namespace inode in LXC audit messages · ab1ef3bc
      Daniel P. Berrange 提交于
      To allow the efficient correlation of container audit messages
      with host hosts, include the pid namespace inode in audit
      messages.
      ab1ef3bc
    • D
      Add support for disks backed by plain files in LXC · eaf7d4dd
      Daniel P. Berrange 提交于
      By using a loopback device, disks backed by plain files can
      be made available to LXC containers. We make no attempt to
      auto-detect format if <driver type="raw"/> is not set,
      instead we unconditionally treat that as meaning raw. This
      is to avoid the security issues inherent with format
      auto-detection
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      eaf7d4dd
    • D
      Refactor loop device setup code in LXC · f0bfb630
      Daniel P. Berrange 提交于
      Minor re-factoring of code for setting up loop devices in
      the LXC controller
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      f0bfb630
    • D
      Improve LXC startup error reporting · 09f5e012
      Daniel P. Berrange 提交于
      Currently we rely on a VIR_ERROR message being logged by the
      virRaiseError function to report LXC startup errors. This gives
      the right message, but is rather ugly and can be truncated
      if lots of log messages are written. Change the LXC controller
      to explicitly print any virErrorPtr message to stderr. Then
      change the driver to skip over anything that looks like a log
      message.
      
      The result is that this
      
      error: Failed to start domain busy
      error: internal error guest failed to start: 2013-03-04 19:46:42.846+0000: 1734: info : libvirt version: 1.0.2
      2013-03-04 19:46:42.846+0000: 1734: error : virFileLoopDeviceAssociate:600 : Unable to open /root/disk.raw: No such file or directory
      
      changes to
      
      error: Failed to start domain busy
      error: internal error guest failed to start: Unable to open /root/disk.raw: No such file or directory
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      09f5e012
    • D
      Use VIR_MASS_CLOSE in LXC container startup · 58e0accd
      Daniel P. Berrange 提交于
      In the LXC container startup code when switching stdio
      streams, we call VIR_FORCE_CLOSE on all FDs. This triggers
      a huge number of warnings, but we don't see them because
      stdio is closed at this point. strace() however shows them
      which can confuse people debugging the code. Switch to
      VIR_MASS_CLOSE to avoid this
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      58e0accd