1. 29 1月, 2020 1 次提交
  2. 27 1月, 2020 1 次提交
    • D
      qemu: add support for running QEMU driver in embedded mode · 068efae5
      Daniel P. Berrangé 提交于
      This enables support for running QEMU embedded to the calling
      application process using a URI:
      
         qemu:///embed?root=/some/path
      
      Note that it is important to keep the path reasonably short to
      avoid risk of hitting the limit on UNIX socket path names
      which is 108 characters.
      
      When using the embedded mode with a root=/var/tmp/embed, the
      driver will use the following paths:
      
                      logDir: /var/tmp/embed/log/qemu
                 swtpmLogDir: /var/tmp/embed/log/swtpm
               configBaseDir: /var/tmp/embed/etc/qemu
                    stateDir: /var/tmp/embed/run/qemu
               swtpmStateDir: /var/tmp/embed/run/swtpm
                    cacheDir: /var/tmp/embed/cache/qemu
                      libDir: /var/tmp/embed/lib/qemu
             swtpmStorageDir: /var/tmp/embed/lib/swtpm
       defaultTLSx509certdir: /var/tmp/embed/etc/pki/qemu
      
      These are identical whether the embedded driver is privileged
      or unprivileged.
      
      This compares with the system instance which uses
      
                      logDir: /var/log/libvirt/qemu
                 swtpmLogDir: /var/log/swtpm/libvirt/qemu
               configBaseDir: /etc/libvirt/qemu
                    stateDir: /run/libvirt/qemu
               swtpmStateDir: /run/libvirt/qemu/swtpm
                    cacheDir: /var/cache/libvirt/qemu
                      libDir: /var/lib/libvirt/qemu
             swtpmStorageDir: /var/lib/libvirt/swtpm
       defaultTLSx509certdir: /etc/pki/qemu
      
      At this time all features present in the QEMU driver are available when
      running in embedded mode, availability matching whether the embedded
      driver is privileged or unprivileged.
      Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      068efae5
  3. 24 1月, 2020 2 次提交
  4. 08 1月, 2020 1 次提交
  5. 20 12月, 2019 3 次提交
  6. 12 12月, 2019 1 次提交
    • D
      qemu: keep capabilities when running QEMU as root · 19023562
      Daniel P. Berrangé 提交于
      When QEMU uid/gid is set to non-root this is pointless as if we just
      used a regular setuid/setgid call, the process will have all its
      capabilities cleared anyway by the kernel.
      
      When QEMU uid/gid is set to root, this is almost (always?) never
      what people actually want. People make QEMU run as root in order
      to access some privileged resource that libvirt doesn't support
      yet and this often requires capabilities. As a result they have
      to go find the qemu.conf param to turn this off. This is not
      viable for libguestfs - they want to control everything via the
      XML security label to request running as root regardless of the
      qemu.conf settings for user/group.
      
      Clearing capabilities was implemented originally because there
      was a proposal in Fedora to change permissions such that root,
      with no capabilities would not be able to compromise the system.
      ie a locked down root account. This never went anywhere though,
      and as a result clearing capabilities when running as root does
      not really get us any security benefit AFAICT. The root user
      can easily do something like create a cronjob, which will then
      faithfully be run with full capabilities, trivially bypassing
      the restriction we place.
      
      IOW, our clearing of capabilities is both useless from a security
      POV, and breaks valid use cases when people need to run as root.
      
      This removes the clear_emulator_capabilities configuration
      option from qemu.conf, and always runs QEMU with capabilities
      when root.  The behaviour when non-root is unchanged.
      Reviewed-by: NCole Robinson <crobinso@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      19023562
  7. 09 12月, 2019 5 次提交
  8. 22 11月, 2019 1 次提交
    • D
      util: consolidate on one free callback for hash data · bc7e7291
      Daniel P. Berrangé 提交于
      This previous commit introduced a simpler free callback for
      hash data with only 1 arg, the value to free:
      
        commit 49288fac
        Author: Peter Krempa <pkrempa@redhat.com>
        Date:   Wed Oct 9 15:26:37 2019 +0200
      
          util: hash: Add possibility to use simpler data free function in virHash
      
      It missed two functions in the hash table code which need
      to call the alternate data free function, virHashRemoveEntry
      and virHashRemoveSet.
      
      After the previous patch though, there is no code that
      makes functional use of the 2nd key arg in the data
      free function. There is merely one log message that can
      be dropped.
      
      We can thus purge the current virHashDataFree callback
      entirely, and rename virHashDataFreeSimple to replace
      it.
      Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      bc7e7291
  9. 12 11月, 2019 2 次提交
  10. 21 10月, 2019 1 次提交
  11. 18 10月, 2019 1 次提交
  12. 16 10月, 2019 4 次提交
  13. 15 10月, 2019 2 次提交
  14. 19 9月, 2019 1 次提交
  15. 10 9月, 2019 5 次提交
  16. 09 9月, 2019 3 次提交
  17. 06 9月, 2019 2 次提交
  18. 30 8月, 2019 1 次提交
  19. 27 8月, 2019 1 次提交
  20. 07 8月, 2019 2 次提交