1. 18 9月, 2013 14 次提交
    • D
      Add support for using 3-arg pkcheck syntax for process (CVE-2013-4311) · 922b7fda
      Daniel P. Berrange 提交于
      With the existing pkcheck (pid, start time) tuple for identifying
      the process, there is a race condition, where a process can make
      a libvirt RPC call and in another thread exec a setuid application,
      causing it to change to effective UID 0. This in turn causes polkit
      to do its permission check based on the wrong UID.
      
      To address this, libvirt must get the UID the caller had at time
      of connect() (from SO_PEERCRED) and pass a (pid, start time, uid)
      triple to the pkcheck program.
      
      This fix requires that libvirt is re-built against a version of
      polkit that has the fix for its CVE-2013-4288, so that libvirt
      can see 'pkg-config --variable pkcheck_supports_uid polkit-gobject-1'
      Signed-off-by: NColin Walters <walters@redhat.com>
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      922b7fda
    • D
      Ensure system identity includes process start time · e65667c0
      Daniel P. Berrange 提交于
      The polkit access driver will want to use the process start
      time field. This was already set for network identities, but
      not for the system identity.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      e65667c0
    • D
      Also store user & group ID values in virIdentity · db7a5688
      Daniel P. Berrange 提交于
      Future improvements to the polkit code will require access to
      the numeric user ID, not merely user name.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      db7a5688
    • C
      daemon: Don't hardcode pki paths in help output · d0d013d9
      Christophe Fergeau 提交于
      There are constants for these paths in remote_driver.h so we can
      use these rather than duplicating them in the help output.
      Signed-off-by: NChristophe Fergeau <cfergeau@redhat.com>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      d0d013d9
    • C
      daemon: Fix 'caert.pem' typo in privileged help output · 521b78d0
      Christophe Fergeau 提交于
      The help message indicates that the CA certificate is
      $sysconfdir/pki/CA/caert.pem while the actual path is
      $sysconfdir/pki/CA/cacert.pem
      Signed-off-by: NChristophe Fergeau <cfergeau@redhat.com>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      521b78d0
    • J
      qemu: Avoid dangling job in qemuDomainSetBlockIoTune · 13e9bad5
      Jiri Denemark 提交于
      virDomainSetBlockIoTuneEnsureACL was incorrectly called after we already
      started a job. As a result of this, the job was not cleaned up when an
      access driver had forbidden the action.
      13e9bad5
    • T
      virsh: Add vshCompleter to each option · ffb7ccaa
      Tomas Meszaros 提交于
      completer and completer_flags added to the _vshCmdOptDef
      structure so it will be possible for completion generators to
      conveniently call option completer functions with desired flags.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      ffb7ccaa
    • 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
    • D
      VMX: Add support for 'auto detect' fileNames · 834aebcc
      Doug Goldstein 提交于
      VMWare Fusion 5 can set the CD-ROM's device name to be 'auto detect' when
      using the physical drive via 'cdrom-raw' device type. VMWare will then
      connect to first available host CD-ROM to the virtual machine upon start
      up according to VMWare documentation. If no device is available, it
      appears that the device will remain disconnected.
      
      To better model this a CD-ROM that is marked as "auto detect" when in
      the off state would be modeled as the following with this patch:
        <disk type='block' device='lun'>
          <source startupPolicy='optional'/>
          <target dev='hda' bus='ide'/>
          <address type='drive' controller='0' bus='0' target='0' unit='0'/>
        </disk>
      
      Once the domain transitions to the powered on state, libvirt can
      populate the remaining source data with what is connected, if anything.
      However future power cycles, the domain may not always start with that
      device attached.
      834aebcc
    • D
      Allow <source> for type=block to have no dev · 4b5652d0
      Doug Goldstein 提交于
      Currently the XML parser already allows the following syntax:
        <disk type='block' device='cdrom'>
          <source startupPolicy='optional'/>
          <target dev='hda' bus='ide'/>
          <address type='drive' controller='0' bus='0' target='0' unit='0'/>
        </disk>
      
      But it if the dev value is NULL then it would not have the leading
      "<source ", resulting in invalid XML.
      4b5652d0
    • E
      build: skip ld_preload tests on non-Linux systems · caf65892
      Eric Blake 提交于
      A cross build to mingw fails with:
      
        CC       virsystemdtest-virsystemdtest.o
      ../../tests/virsystemdtest.c: In function 'testCreateNoSystemd':
      ../../tests/virsystemdtest.c:97:9: error: implicit declaration of function 'unsetenv' [-Werror=implicit-function-declaration]
               unsetenv("FAIL_NO_SERVICE");
               ^
      ../../tests/virsystemdtest.c:97:9: error: nested extern declaration of 'unsetenv' [-Werror=nested-externs]
      
      We could cop out and pull in the gnulib unsetenv module.  But when
      you stop and think about it, this test requires LD_PRELOAD to work,
      and systemd is a Linux-only concept anyways, both of which mean
      the test could never work on mingw in the first place.  Simpler is
      to just fix the test to behave like our other LD_PRELOAD tests.
      
      * tests/virsystemdtest.c: Provide non-Linux implementation.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      caf65892
    • E
      build: hoist system-specific checks before library checks · 0e1f012c
      Eric Blake 提交于
      Commit f92c7e31 fixed a regression for native builds, but introduced
      a regression for cross-compilation builds; in particular,
      ./autobuild.sh on a Fedora system with mingw cross-compiler fails
      with:
      
      checking for qemu-kvm... /usr/bin/qemu-kvm
      checking for yajl_parse_complete in -lyajl... no
      checking for yajl_tree_parse in -lyajl... no
      configure: error: You must install the libyajl library & headers to compile libvirt
      
      Since we default $with_qemu to 'yes' rather than 'check', and then
      flip that default based on platform-specific checks, those platform
      specifics need to come prior to any library checks that depend on
      the value of $with_qemu.
      
      * configure.ac: Ensure system defaults are sane before checking
      for things that make decisions based on system default.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      0e1f012c
    • E
      maint: ignore recently-added test · ceaa536d
      Eric Blake 提交于
      * .gitignore: Ignore metadatatest.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      ceaa536d
  2. 17 9月, 2013 26 次提交
    • P
      tests: metadatatest: Quiesce errors on expected paths · 935c0317
      Peter Krempa 提交于
      Use the helper added in previous patch to quiesce errors from this test
      that was spamming logs on normal test runs.
      935c0317
    • P
      test: Refactor setting of dummy error handlers · 43f68a4f
      Peter Krempa 提交于
      Multiple tests need to register a function to quiesce errors from
      libvirt when using a connection and doing negative tests. Each of those
      tests had a static function to do so. This can be replaced by a utility
      function that enables the errors when debug is enabled.
      
      This patch adds virtTestQuiesceLibvirtErrors() and refactors test that
      use private handlers.
      43f68a4f
    • A
      Add tftp protocol support for cdrom disk · 8ffe1d0c
      Aline Manera 提交于
      qemu/KVM also supports a tftp URL while specifying the cdrom ISO image.
      
      The xml should be as following:
      
          <disk type='network' device='cdrom'>
            <source protocol='tftp' name='/url/path'>
              <host name='host.name' port='69'/>
            </source>
          </disk>
      Signed-off-by: NAline Manera <alinefm@br.ibm.com>
      8ffe1d0c
    • A
      Add ftps protocol support for cdrom disk · 0f24393e
      Aline Manera 提交于
      The ftps protocol is another protocol supported by qemu/KVM while specifying
      the cdrom ISO image.
      
      The xml should be as following:
      
          <disk type='network' device='cdrom'>
            <source protocol='ftps' name='/url/path'>
              <host name='host.name' port='990'/>
            </source>
          </disk>
      Signed-off-by: NAline Manera <alinefm@br.ibm.com>
      0f24393e
    • A
      Add https protocol support for cdrom disk · d9dd9818
      Aline Manera 提交于
      The https protocol is also accepted by qemu/KVM when specifying the cdrom ISO
      image.
      
      The xml should be as following:
      
          <disk type='network' device='cdrom'>
            <source protocol='https' name='/url/path'>
              <host name='host.name' port='443'/>
            </source>
          </disk>
      Signed-off-by: NAline Manera <alinefm@br.ibm.com>
      d9dd9818
    • P
      virsh: Don't shadow global variable "remove" in cmdMetadata · 6bf4c779
      Peter Krempa 提交于
      Some systems apparently have a global variable/function called remove
      and thus break compilation of virsh-domain.c. Rename the variable to
      avoid this.
      
      Reported by GuanQiang.
      6bf4c779
    • P
      conf: Avoid false positive of uninitialized variable use · 0d4f469c
      Peter Krempa 提交于
      GCC 4.8.0+ whines about variable "new" being uninitialized since
      commit 73bfac0e. This is a false positive as the
      xmlFreeNode(new) statement can be only reached if new was actually
      allocated successfully.
      
        CC       conf/libvirt_conf_la-domain_conf.lo
        conf/domain_conf.c: In function 'virDomainDefSetMetadata':
        conf/domain_conf.c:18650:24: error: 'new' may be used uninitialized in this function [-Werror=maybe-uninitialized]
                     xmlFreeNode(new);
      
      Reported independently by John Ferlan and Michal Privoznik.
      0d4f469c
    • E
      build: fix VPATH build of remote driver · 716c7bb1
      Eric Blake 提交于
      Commit 073e1575 tried to set things up so that 1) generated files
      to be shipped in the tarball always live in srcdir, and 2) we have
      no files in SOURCES that depend on any other files with a literal
      $(srcdir) in the name, because that situation can cause confusing
      results for the make expansion of $@ depending on whether the file
      is found locally or via VPATH.  But all my testing for that patch
      was done incrementally, where all the protocol.[ch] files had
      already been generated prior to the patch and were up-to-date in
      the srcdir, and thus I missed one case where $@ causes grief in a
      VPATH build from a fresh checkout:
      
      We have a pattern rule for generating remote_protocol.[ch], and
      what's more, the rule for protocol.c depends on protocol.h AND
      on the protocol.x file.  The pattern for protocol.c is only
      satisfied via the VPATH lookup for protocol.x, and if protocol.h
      doesn't yet exist, the VPATH rule kicks in and we end up with a
      dependency on a file with $(srcdir) in the name.  Based on make's
      rules for $@, this resulted in make building remote_protocol.h
      into srcdir (where we want it), then remote_protocol.c into
      builddir (oops, not so good for the tarball), and also causes
      the build to fail (the compiler can't find the .h if it lives
      in a different directory than the .c):
      
        CC       remote/libvirt_driver_remote_la-remote_protocol.lo
      remote/remote_protocol.c:7:29: fatal error: remote_protocol.h: No such file or directory
       #include "remote_protocol.h"
                                   ^
      compilation terminated.
      
      As before, the fix is to hard-code the output file to go into
      srcdir in spite of $@; but since this is in a pattern rule, we
      are forced to use $@ in the recipe, so the patch is a bit
      trickier than what was done in commit 073e1575.
      
      * src/Makefile.am (%protocol.c, %protocol.h): Force output to srcdir.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      716c7bb1
    • P
      conf: Don't corrupt metadata on OOM · 7655ed08
      Peter Krempa 提交于
      Eric Blake suggested that we could do a little better in case copying of
      the metadata to be set fails. With this patch, the old metadata is
      discarded after the new string is copied successfuly.
      7655ed08
    • P
      qemu: Fix memleak after commit 59898a88 · 044e3e75
      Peter Krempa 提交于
      If the ABI compatibility check with the "migratable" user XML is
      successful, we would leak the originally parsed XML from the user that
      would not be used in this case.
      
      Reported by Ján Tomko.
      044e3e75
    • P
      tests: Add metadata tests · 2e23c77b
      Peter Krempa 提交于
      This test exercises the virDomain[Get|Set]Metadata API and tests it for
      regressions
      2e23c77b
    • P
      test: Add <metadata> support into the test driver · f616fbf2
      Peter Krempa 提交于
      f616fbf2
    • P
      lxc: Add metadata modification APIs · f9c7b32e
      Peter Krempa 提交于
      f9c7b32e
    • P
      lib: Don't force the key argument when deleting metadata · 3b6784d1
      Peter Krempa 提交于
      virDomainSetMetadata when operating on the metadata element was
      requesting the @key argument to be passed even if @metadata was NULL
      used to delete the corresponding metadata element. This is not needed as
      the key is only used when adding the element and matching is done via
      the XML namespace.
      3b6784d1
    • P
      conf: allow to add XML metadata using the virDomainSetMetadata api · 73bfac0e
      Peter Krempa 提交于
      The functionality wasn't originally implemented. This patch adds the
      ability to modify domain's XML metadata using the API.
      73bfac0e
    • P
      conf: Add support for requesting of XML metadata via the API · ac38bff0
      Peter Krempa 提交于
      The virDomainGetMetadata function was designed to support also retrieval
      of app specific metadata from the <metadata> element. This functionality
      was never implemented originally.
      ac38bff0
    • P
      virsh-domain: Add command to allow modifications of XML metadata · 01b03f59
      Peter Krempa 提交于
      The metadata modification functions will support modification of the XML
      metadata. Add a virsh command to allow using this approach.
      01b03f59
    • P
      3df33d7a
    • P
      be0f0c22
    • P
      conf: Factor out setting of metadata to simplify code · e9cb66f1
      Peter Krempa 提交于
      The code to set the metadata in a domain definition is common to live
      and inactive domains. Factor it out into a common func.
      e9cb66f1
    • P
      qemu: Factor out body of qemuDomainSetMetadata for universal use · f87a7c67
      Peter Krempa 提交于
      The function implemented common behavior that can be reused for other
      hypervisor drivers that use the virDomainObj data structures. Factor out
      the core into a separate helper func.
      f87a7c67
    • P
      qemu: Factor out body of qemuDomainGetMetadata for universal use · 99c51af2
      Peter Krempa 提交于
      The function implemented common behavior that can be reused for other
      hypervisor drivers that use the virDomainObj data structures. Factor out
      the core into a separate helper func.
      99c51af2
    • P
      virsh-domain: Line up signal names array · cb356928
      Peter Krempa 提交于
      Line up the array so that the grid is visible.
      cb356928
    • P
      virsh-domain: Remove spurious ATTRIBUTE_UNUSED from cmdDesc · 626d4dfc
      Peter Krempa 提交于
      The "cmd" variable is actually used so remove the attribute.
      626d4dfc
    • P
      qemu: Use "migratable" XML definition when doing external checkpoints · 1b7bfa65
      Peter Krempa 提交于
      In the original implementation of external checkpoints I've mistakenly
      used the live definition to be stored in the save image. The normal
      approach is to use the "migratable" definition. This was discovered when
      commit 07966f6a changed the behavior to
      use a converted XML from the user to do the compatibility check to fix
      problem when using the regular machine saving.
      
      As the previous patch added a compatibility layer, we can now change the
      type of the XML in the image.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1008340
      1b7bfa65
    • P
      qemu: Fix checking of ABI stability when restoring external checkpoints · 59898a88
      Peter Krempa 提交于
      External checkpoints have a bug in the implementation where they use the
      normal definition instead of the "migratable" one. This causes errors
      when the snapshot is being reverted using the workaround method via
      qemuDomainRestoreFlags() with a custom XML. This issue was introduced
      when commit 07966f6a changed the code to
      compare "migratable" XMLs from the user as we should have used
      migratable in the image too.
      
      This patch adds a compatibility layer, so that fixing the snapshot code
      won't make existing snapshots fail to load.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1008340
      59898a88