1. 25 3月, 2017 3 次提交
  2. 06 3月, 2017 1 次提交
    • M
      qemu: Enforce qemuSecurity wrappers · 4da534c0
      Michal Privoznik 提交于
      Now that we have some qemuSecurity wrappers over
      virSecurityManager APIs, lets make sure everybody sticks with
      them. We have them for a reason and calling virSecurityManager
      API directly instead of wrapper may lead into accidentally
      labelling a file on the host instead of namespace.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      4da534c0
  3. 15 2月, 2017 2 次提交
  4. 09 2月, 2017 1 次提交
  5. 12 1月, 2017 1 次提交
    • M
      qemu: Use namespaces iff available on the host kernel · 49f326ed
      Michal Privoznik 提交于
      So far the namespaces were turned on by default unconditionally.
      For all non-Linux platforms we provided stub functions that just
      ignored whatever namespaces setting there was in qemu.conf and
      returned 0 to indicate success. Moreover, we didn't really check
      if namespaces are available on the host kernel.
      
      This is suboptimal as we might have ignored user setting.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      49f326ed
  6. 15 12月, 2016 1 次提交
  7. 09 12月, 2016 1 次提交
  8. 08 12月, 2016 1 次提交
    • M
      qemu: Create hugepage path on per domain basis · f55afd83
      Michal Privoznik 提交于
      If you've ever tried running a huge page backed guest under
      different user than in qemu.conf, you probably failed. Problem is
      even though we have corresponding APIs in the security drivers,
      there's no implementation and thus we don't relabel the huge page
      path. But even if we did, so far all of the domains share the
      same path:
      
         /hugepageMount/libvirt/qemu
      
      Our only option there would be to set 0777 mode on the qemu dir
      which is totally unsafe. Therefore, we can create dir on
      per-domain basis, i.e.:
      
         /hugepageMount/libvirt/qemu/domainName
      
      and chown domainName dir to the user that domain is configured to
      run under.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      f55afd83
  9. 25 11月, 2016 1 次提交
    • M
      virstring: Unify string list function names · c2a5a4e7
      Michal Privoznik 提交于
      We have couple of functions that operate over NULL terminated
      lits of strings. However, our naming sucks:
      
      virStringJoin
      virStringFreeList
      virStringFreeListCount
      virStringArrayHasString
      virStringGetFirstWithPrefix
      
      We can do better:
      
      virStringListJoin
      virStringListFree
      virStringListFreeCount
      virStringListHasString
      virStringListGetFirstWithPrefix
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      c2a5a4e7
  10. 22 11月, 2016 1 次提交
  11. 09 11月, 2016 1 次提交
  12. 20 10月, 2016 1 次提交
    • J
      conf: Introduce {default|chardev}_tls_x509_secret_uuid · 3b668bb5
      John Ferlan 提交于
      Add a new qemu.conf variables to store the UUID for the secret that could
      be used to present credentials to access the TLS chardev.  Since this will
      be a server level and it's possible to use some sort of default, introduce
      both the default and chardev logic at the same time making the setting of
      the chardev check for it's own value, then if not present checking whether
      the default value had been set.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      3b668bb5
  13. 19 9月, 2016 2 次提交
    • M
      qemu: Introduce qemuGetHupageMemPath · eef8b263
      Michal Privoznik 提交于
      Now that we have two same implementations for getting path for
      huge pages backed guest memory, lets merge them into one function.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      eef8b263
    • M
      qemuBuildMemoryBackendStr: Don't crash if no hugetlbfs is mounted · 647db05e
      Michal Privoznik 提交于
      When trying to migrate a huge page enabled guest, I've noticed
      the following crash. Apparently, if no specific hugepages are
      requested:
      
        <memoryBacking>
          <hugepages/>
        </memoryBacking>
      
      and there are no hugepages configured on the destination, we try
      to dereference a NULL pointer.
      
      Program received signal SIGSEGV, Segmentation fault.
      0x00007fcc907fb20e in qemuGetHugepagePath (hugepage=0x0) at qemu/qemu_conf.c:1447
      1447        if (virAsprintf(&ret, "%s/libvirt/qemu", hugepage->mnt_dir) < 0)
      (gdb) bt
      #0  0x00007fcc907fb20e in qemuGetHugepagePath (hugepage=0x0) at qemu/qemu_conf.c:1447
      #1  0x00007fcc907fb2f5 in qemuGetDefaultHugepath (hugetlbfs=0x0, nhugetlbfs=0) at qemu/qemu_conf.c:1466
      #2  0x00007fcc907b4afa in qemuBuildMemoryBackendStr (size=4194304, pagesize=0, guestNode=0, userNodeset=0x0, autoNodeset=0x0, def=0x7fcc70019070, qemuCaps=0x7fcc70004000, cfg=0x7fcc5c011800, backendType=0x7fcc95087228, backendProps=0x7fcc95087218,
          force=false) at qemu/qemu_command.c:3297
      #3  0x00007fcc907b4f91 in qemuBuildMemoryCellBackendStr (def=0x7fcc70019070, qemuCaps=0x7fcc70004000, cfg=0x7fcc5c011800, cell=0, auto_nodeset=0x0, backendStr=0x7fcc70020360) at qemu/qemu_command.c:3413
      #4  0x00007fcc907c0406 in qemuBuildNumaArgStr (cfg=0x7fcc5c011800, def=0x7fcc70019070, cmd=0x7fcc700040c0, qemuCaps=0x7fcc70004000, auto_nodeset=0x0) at qemu/qemu_command.c:7470
      #5  0x00007fcc907c5fdf in qemuBuildCommandLine (driver=0x7fcc5c07b8a0, logManager=0x7fcc70003c00, def=0x7fcc70019070, monitor_chr=0x7fcc70004bb0, monitor_json=true, qemuCaps=0x7fcc70004000, migrateURI=0x7fcc700199c0 "defer", snapshot=0x0,
          vmop=VIR_NETDEV_VPORT_PROFILE_OP_MIGRATE_IN_START, standalone=false, enableFips=false, nodeset=0x0, nnicindexes=0x7fcc95087498, nicindexes=0x7fcc950874a0, domainLibDir=0x7fcc700047c0 "/var/lib/libvirt/qemu/domain-1-fedora") at qemu/qemu_command.c:9547
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      647db05e
  14. 13 9月, 2016 1 次提交
    • L
      qemu: fix improper initialization of cgroupControllers bitmap · 02760153
      Laine Stump 提交于
      virQEMUDriverConfigNew() always initializes the bitmap in its
      cgroupControllers member to -1 (i.e. all 1's).
      
      Prior to commit a9331394, if qemu.conf had a line with
      "cgroup_controllers", cgroupControllers would get reset to 0 before
      going through a loop setting a bit for each named cgroup controller.
      commit a9331394 left out the "reset to 0" part, so cgroupControllers
      would always be -1; if you didn't want a controller included, there
      was no longer a way to make that happen.
      
      This was discovered by users who were using qemu commandline
      passthrough to use the "input-linux" method of directing
      keyboard/mouse input to a virtual machine:
      
       https://www.redhat.com/archives/vfio-users/2016-April/msg00105.html
      
      Here's the first report I found of the problem encountered after
      upgrading libvirt beyond v2.0.0:
      
       https://www.redhat.com/archives/vfio-users/2016-August/msg00053.html
      
      Thanks to sL1pKn07 SpinFlo <sl1pkn07@gmail.com> for bringing the
      problem up in IRC, and then taking the time to do a git bisect and
      find the patch that started the problem.
      02760153
  15. 09 9月, 2016 2 次提交
    • J
      conf: Introduce chartcp_tls_x509_cert_dir · 3f60a9c3
      John Ferlan 提交于
      Add a new TLS X.509 certificate type - "chardev". This will handle the
      creation of a TLS certificate capability (and possibly repository) for
      properly configured character device TCP backends.
      
      Unlike the vnc and spice there is no "listen" or "passwd" associated. The
      credentials eventually will be handled via a libvirt secret provided to
      a specific backend.
      
      Make use of the default verify option as well.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      3f60a9c3
    • J
      conf: Add new default TLS X.509 certificate default directory · c12cb5ed
      John Ferlan 提交于
      Rather than specify perhaps multiple TLS X.509 certificate directories,
      let's create a "default" directory which can then be used if the service
      (e.g. for now vnc and spice) does not supply a default directory.
      
      Since the default for vnc and spice may have existed before without being
      supplied, the default check will first check if the service specific path
      exists and if so, set the cfg entry to that; otherwise, the default will
      be set to the (now) new defaultTLSx509certdir.
      
      Additionally add a "default_tls_x509_verify" entry which can also be used
      to force the peer verification option (for vnc it's a x509verify option).
      Add/alter the macro for the option being found in the config file to accept
      the default value.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      c12cb5ed
  16. 06 9月, 2016 2 次提交
    • D
      qemu: allow turning off QEMU guest RAM dump globally · 90e178f8
      Daniel P. Berrange 提交于
      We already have the ability to turn off dumping of guest
      RAM via the domain XML. This is not particularly useful
      though, as it is under control of the management application.
      What is needed is a way for the sysadmin to turn off guest
      RAM defaults globally, regardless of whether the mgmt app
      provides its own way to set this in the domain XML.
      
      So this adds a 'dump_guest_core' option in /etc/libvirt/qemu.conf
      which defaults to false. ie guest RAM will never be included in
      the QEMU core dumps by default. This default is different from
      historical practice, but is considered to be more suitable as
      a default because
      
       a) guest RAM can be huge and so inflicts a DOS on the host
          I/O subsystem when dumping core for QEMU crashes
      
       b) guest RAM can contain alot of sensitive data belonging
          to the VM owner. This should not generally be copied
          around inside QEMU core dumps submitted to vendors for
          debugging
      
       c) guest RAM contents are rarely useful in diagnosing
          QEMU crashes
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      90e178f8
    • D
      qemu: add a max_core setting to qemu.conf for core dump size · fa1ce979
      Daniel P. Berrange 提交于
      Currently the QEMU processes inherit their core dump rlimit
      from libvirtd, which is really suboptimal. This change allows
      their limit to be directly controlled from qemu.conf instead.
      fa1ce979
  17. 10 8月, 2016 1 次提交
  18. 04 8月, 2016 1 次提交
  19. 12 7月, 2016 1 次提交
  20. 14 6月, 2016 1 次提交
    • J
      driver config: Introduce virFirmware object · fda5a98e
      Jim Fehlig 提交于
      The virQEMUDriverConfig object contains lists of
      loader:nvram pairs to advertise firmwares supported by
      by the driver, and qemu_conf.c contains code to populate
      the lists, all of which is useful for other drivers too.
      
      To avoid code duplication, introduce a virFirmware object
      to encapsulate firmware details and switch the qemu driver
      to use it.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      fda5a98e
  21. 09 6月, 2016 1 次提交
  22. 09 5月, 2016 1 次提交
    • P
      util: Replace virDomainDiskSourceIsBlockType with a new helper · 3ec7bb35
      Peter Krempa 提交于
      For disks sources described by a libvirt volume we don't need to do a
      complicated check since virStorageTranslateDiskSourcePool already
      correctly determines the actual disk type.
      
      Replace the checks using a new accessor that does not open-code the
      whole logic.
      3ec7bb35
  23. 28 4月, 2016 1 次提交
  24. 18 2月, 2016 1 次提交
  25. 26 11月, 2015 1 次提交
    • D
      qemu: add support for sending QEMU stdout/stderr to virtlogd · 0d968ad7
      Daniel P. Berrange 提交于
      Currently the QEMU stdout/stderr streams are written directly to
      a regular file (eg /var/log/libvirt/qemu/$GUEST.log). While those
      can be rotated by logrotate (using copytruncate option) this is
      not very efficient. It also leaves open a window of opportunity
      for a compromised/broken QEMU to DOS the host filesystem by
      writing lots of text to stdout/stderr.
      
      This makes it possible to connect the stdout/stderr file handles
      to a pipe that is provided by virtlogd. The virtlogd daemon will
      read from this pipe and write data to the log file, performing
      file rotation whenever a pre-determined size limit is reached.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      0d968ad7
  26. 22 9月, 2015 1 次提交
  27. 14 8月, 2015 1 次提交
  28. 04 8月, 2015 1 次提交
    • J
      conf: Allow error reporting in virDomainDiskSourceIsBlockType · 36025c55
      John Ferlan 提交于
      Rather than provide a somewhat generic error message when the API
      returns false, allow the caller to supply a "report = true" option
      in order to cause virReportError's to describe which of the 3 paths
      that can cause failure.
      
      Some callers don't care about what caused the failure, they just want
      to have a true/false - for those, calling with report = false should
      be sufficient.
      36025c55
  29. 29 7月, 2015 1 次提交
    • E
      qemu: Adjust VM id allocation · b2960501
      Erik Skultety 提交于
      Our atomic increment (virAtomicIntInc) uses (if available) gcc
      __sync_add_and_fetch builtin. In qemu driver though, we'd profit more
      from __sync_fetch_and_add builtin. To keep it simplistic, this patch
      adjusts qemu driver initialization rather than adding a new atomic
      increment macro.
      b2960501
  30. 10 7月, 2015 1 次提交
  31. 09 7月, 2015 4 次提交