1. 29 1月, 2014 3 次提交
  2. 13 11月, 2013 1 次提交
  3. 12 11月, 2013 1 次提交
    • M
      virSecurityLabelDefParseXML: Don't parse label on model='none' · 13cfcad6
      Michal Privoznik 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1027096
      
      If there's the following snippet in the domain XML, the domain will be
      lost upon the daemon restart (if the domain is started prior restart):
      
          <seclabel type='dynamic' relabel='yes'/>
      
      The problem is, the 'label', 'imagelabel' and 'baselabel' are parsed
      whenever the VIR_DOMAIN_XML_INACTIVE is *not* present or the label is
      static. The latter is not our case, obviously. So, when libvirtd starts
      up, it finds domain state xml and parse it. During parsing, many XML
      flags are enabled but VIR_DOMAIN_XML_INACTIVE. Hence, our parser tries
      to extract 'label', 'imagelabel' and 'baselabel' from the XML which
      fails for model='none'. Err, this model - even though not specified in
      XML - can be taken from qemu wide config file: /etc/libvirtd/qemu.conf.
      
      However, in order to know we are dealing with model='none' the code in
      question must be moved forward a bit. Then a new check must be
      introduced. This is what the first two chunks are doing.
      
      But this alone is not sufficient. The domain state XML won't contain the
      model attribute without slight modification. The model should be
      inserted into the XML even if equal to 'none' and the state XML is being
      generated - what if the origin (the @security_driver variable in
      qemu.conf) changes during libvirtd restarts?
      
      At the end, a test to catch this scenario is introduced.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      (cherry picked from commit 9fb3f957)
      13cfcad6
  4. 30 10月, 2013 3 次提交
    • D
      Remove (nearly) all use of getuid()/getgid() · 903db210
      Daniel P. Berrange 提交于
      Most of the usage of getuid()/getgid() is in cases where we are
      considering what privileges we have. As such the code should be
      using the effective IDs, not real IDs.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      (cherry picked from commit 9b0af092)
      903db210
    • D
      Make virCommand env handling robust in setuid env · ef047645
      Daniel P. Berrange 提交于
      When running setuid, we must be careful about what env vars
      we allow commands to inherit from us. Replace the
      virCommandAddEnvPass function with two new ones which do
      filtering
      
        virCommandAddEnvPassAllowSUID
        virCommandAddEnvPassBlockSUID
      
      And make virCommandAddEnvPassCommon use the appropriate
      ones
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      (cherry picked from commit 9b8f307c)
      ef047645
    • D
      Fix flaw in detecting log format · fc59d0ae
      Daniel P. Berrange 提交于
      The log message regex has been
      
      [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}\.[0-9]{3}\+[0-9]{4}: [0-9]+: debug|info|warning|error :
      
      The precedence of '|' is high though, so this is equivalent to matching
      
         [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}\.[0-9]{3}\+[0-9]{4}: [0-9]+: debug
      
      Or
      
         info
      
      Or
      
         warning
      
      Or
      
         error :
      
      Which is clearly not what it should have done. This caused the code to
      skip over things which are not log messages. The solution is to simply
      add brackets.
      
      A test case is also added to validate correctness.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      (cherry picked from commit 5787f0b9)
      fc59d0ae
  5. 15 10月, 2013 2 次提交
    • D
      build: Add lxc testcase to dist list · 2503a074
      Daniel Hansel 提交于
      Introduced by commit 3f029fb5 the RPM build
      was broken due to a missing LXC textcase.
      Signed-off-by: NDaniel Hansel <daniel.hansel@linux.vnet.ibm.com>
      (cherry picked from commit 6285c17f)
      2503a074
    • J
      LXC: Fix handling of RAM filesystem size units · bdd04489
      Ján Tomko 提交于
      Since 76b644c3 when the support for RAM filesystems was introduced,
      libvirt accepted the following XML:
      <source usage='1024' unit='KiB'/>
      
      This was parsed correctly and internally stored in bytes, but it
      was formatted as (with an extra 's'):
      <source usage='1024' units='KiB'/>
      When read again, this was treated as if the units were missing,
      meaning libvirt was unable to parse its own XML correctly.
      
      The usage attribute was documented as being in KiB, but it was not
      scaled if the unit was missing. Transient domains still worked,
      because this was balanced by an extra 'k' in the mount options.
      
      This patch:
      Changes the parser to use 'units' instead of 'unit', as the latter
      was never documented (fixing persistent domains) and some programs
      (libvirt-glib, libvirt-sandbox) already parse the 'units' attribute.
      
      Removes the extra 'k' from the tmpfs mount options, which is needed
      because now we parse our own XML correctly.
      
      Changes the default input unit to KiB to match documentation, fixing:
      https://bugzilla.redhat.com/show_bug.cgi?id=1015689
      (cherry picked from commit 3f029fb5)
      bdd04489
  6. 07 10月, 2013 1 次提交
  7. 01 10月, 2013 1 次提交
  8. 30 9月, 2013 1 次提交
  9. 28 9月, 2013 1 次提交
  10. 27 9月, 2013 1 次提交
  11. 26 9月, 2013 13 次提交
  12. 25 9月, 2013 2 次提交
  13. 24 9月, 2013 2 次提交
  14. 20 9月, 2013 4 次提交
    • D
      VMware: Make version parsing testable and add tests · 7457cbe8
      Doug Goldstein 提交于
      This splits up the version parsing code into a callable API like QEMU
      help/version string parsing so that we can test it as we need to add
      additional patterns for newer versions/products.
      7457cbe8
    • J
      Don't dereference NULL in qemumonitorjsontest · 5b36ab90
      Ján Tomko 提交于
      In case of an error, qemuMonitorTestNewSimple returns NULL.
      Error out instead of dereferencing it.
      
      Found by Coverity, reported by John Ferlan.
      5b36ab90
    • D
      Add checking of dbus_message_iter_append_basic return value · 83c24493
      Daniel P. Berrange 提交于
      Coverity complains that the test suite did not check the
      return value of dbus_message_iter_append_basic() as we did
      in most other places.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      83c24493
    • L
      qemu: use "ide" as device name for implicit SATA controller on Q35 · 30bb4c4b
      Laine Stump 提交于
      This resolves https://bugzilla.redhat.com/show_bug.cgi?id=1008903
      
      The Q35 machinetype has an implicit SATA controller at 00:1F.2 which
      isn't given the "expected" id of ahci0 by qemu when it's created. The
      original suggested solution to this problem was to not specify any
      controller for the disks that use the default controller and just
      specify "unit=n" instead; qemu should then use the first IDE or SATA
      controller for the disk.
      
      Unfortunately, this "solution" is ignorant of the fact that in the
      case of SATA disks, the "unit" attribute in the disk XML is actually
      *not* being used for the unit, but is instead used to specify the
      "bus" number; each SATA controller has 6 buses, and each bus only
      allows a single unit. This makes it nonsensical to specify unit='n'
      where n is anything other than 0. It also means that the only way to
      connect more than a single device to the implicit SATA controller is
      to explicitly give the bus names, which happen to be "ide.$n", where
      $n can be replaced by the disk's "unit" number.
      30bb4c4b
  15. 19 9月, 2013 2 次提交
  16. 18 9月, 2013 2 次提交
    • D
      Add forwarder attribute to <dns/> element · 22547b4c
      Diego Woitasen 提交于
      Useful to set custom forwarders instead of using the contents of
      /etc/resolv.conf. It helps me to setup dnsmasq as local nameserver to
      resolve VM domain names from domain 0, when domain option is used.
      Signed-off-by: NDiego Woitasen <diego.woitasen@vhgroup.net>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      22547b4c
    • D
      VMX: Add a VMWare Fusion 5 configuration for tests · 7ab7c9a2
      Doug Goldstein 提交于
      A user was having an issue with this specific VMWare Fusion config and
      he gave me permission to add it as part of our test suite to further
      expand our VMX test coverage. Unfortunately our VMX parser and
      generator does not support many features contained within and just
      silently ignores fields it does not understand so they had to
      be removed out in the xml2vmx test. The original unmodified version
      exists in the vmx2xml test.
      7ab7c9a2