1. 19 7月, 2012 4 次提交
    • D
      Move LXC domain private data into separate file · f93518c7
      Daniel P. Berrange 提交于
      Move the LXC driver code related to the virDomainObjPtr
      private data into separate lxc_domain.{c,h} files
      to reduce the size of lxc_driver.c
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      f93518c7
    • D
      Don't autostart domains when reloading config · 95c2c19f
      Daniel P. Berrange 提交于
      When sending SIGHUP to libvirtd, it will trigger the virStateDriver
      reload operation. This is intended to reload the configuration files
      for guests. For unknown historical reasons this is also triggering
      autostart of all guests. Autostart is generally expected to be
      something that happens on OS startup. Starting VMs on SIGHUP will
      violate that expectation and potentially cause dangerous scenarios
      if the admin has explicitly shutdown a misbehaving VM that has
      been marked as autostart
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      95c2c19f
    • D
      lxcContainerMountCGroups also mounts a tmpfs that needs to be labeled. · 9f5ef4d9
      Dan Walsh 提交于
      This patch passes down the sec_mount_options to the
      lxcContainerMountCGroups function and then mounts the tmpfs with
      the correct label.
      9f5ef4d9
    • D
      Mount all tmpfs filesystems with correct SELinux label · e0018429
      Daniel J Walsh 提交于
      Basically within a Secure Linux Container (virt-sandbox) we want all content
      that the process within the container can write to be labeled the same.  We
      are labeling the physical disk correctly but when we create "RAM" based file
      systems
      libvirt is not labeling them, and they are defaulting to tmpfs_t, which will
      will not allow the processes to write.  This patch labels the RAM based file
      systems correctly.
      e0018429
  2. 17 7月, 2012 1 次提交
    • S
      Convert 'raw MAC address' usages to use virMacAddr · 387117ad
      Stefan Berger 提交于
      Introduce new members in the virMacAddr 'class'
      - virMacAddrSet: set virMacAddr from a virMacAddr
      - virMacAddrSetRaw: setting virMacAddr from raw 6 byte MAC address buffer
      - virMacAddrGetRaw: writing virMacAddr into raw 6 byte MAC address buffer
      - virMacAddrCmp: comparing two virMacAddr
      - virMacAddrCmpRaw: comparing a virMacAddr with a raw 6 byte MAC address buffer
      
      then replace raw MAC addresses by replacing
      
      - 'unsigned char *' with virMacAddrPtr
      - 'unsigned char ... [VIR_MAC_BUFLEN]' with virMacAddr
      
      and introduce usage of above functions where necessary.
      387117ad
  3. 11 7月, 2012 2 次提交
    • D
      Fix shutdown of LXC controller · 97d7f02d
      Daniel P. Berrange 提交于
      Since we are not yet using the virNetServerPtr object for running
      the event loop, we can't use virNetServerQuit(). Instead set the
      global 'quit' flag in libvirt_lxc
      97d7f02d
    • E
      build: detect all improper uses of _("%s") · 0867a877
      Eric Blake 提交于
      The only useful translation of "%s" as a format string is "%s" (I
      suppose you could claim "%1$s" is also valid, but why bother).  So
      it is not worth translating; fixing this exposes some instances
      where we were failing to translate real error messages.  This makes
      the fix of commit 097da1ab more generic, as well as ensuring no
      future regressions.
      
      * cfg.mk (sc_prohibit_useless_translation): New rule.
      * src/lxc/lxc_driver.c (lxcSetVcpuBWLive): Fix offender.
      * src/openvz/openvz_conf.c (openvzReadFSConf): Likewise.
      * src/qemu/qemu_cgroup.c (qemuSetupCgroupForVcpu): Likewise.
      * src/qemu/qemu_driver.c (qemuSetVcpusBWLive): Likewise.
      * src/xenapi/xenapi_utils.c (xenapiSessionErrorHandle): Likewise.
      0867a877
  4. 06 7月, 2012 1 次提交
  5. 05 7月, 2012 12 次提交
  6. 29 6月, 2012 1 次提交
  7. 25 6月, 2012 3 次提交
    • D
      Support bind mounting host files, as well as directories in LXC · 465c055f
      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>
      465c055f
    • D
      Add support for guest bind mounts with LXC · 3b1ddec1
      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
      3b1ddec1
    • D
      Add support for RAM filesystems for LXC · 76b644c3
      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>
      76b644c3
  8. 21 6月, 2012 1 次提交
    • J
      Initialize random generator in lxc controller · 57349ffc
      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
      57349ffc
  9. 20 6月, 2012 1 次提交
    • P
      drivers: Implement virListAllDomains for drivers using virDomainObj · 33dc8cf0
      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.
      33dc8cf0
  10. 19 6月, 2012 4 次提交
  11. 18 6月, 2012 2 次提交
  12. 15 6月, 2012 1 次提交
    • D
      Always pivot_root event if the new root source is '/' · e9d8861e
      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
      e9d8861e
  13. 14 6月, 2012 1 次提交
    • D
      Add some missing hook functions · 6510c97b
      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
      6510c97b
  14. 11 6月, 2012 3 次提交
  15. 30 5月, 2012 1 次提交
    • M
      lxc: return correct number of CPUs · 87dfdb0b
      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.
      87dfdb0b
  16. 28 5月, 2012 2 次提交
    • D
      Autogenerate augeas test case from default config files · de9758ae
      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>
      de9758ae
    • D
      Standardize whitespace used in example config files · c5c3278e
      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>
      c5c3278e