1. 25 7月, 2017 2 次提交
  2. 10 7月, 2017 1 次提交
    • P
      qemu: domain: Use vcpu 'node-id' property and pass it back to qemu · ccac4465
      Peter Krempa 提交于
      vcpu properties gathered from query-hotpluggable cpus need to be passed
      back to qemu. As qemu did not use the node-id property until now and
      libvirt forgot to pass it back properly (it was parsed but not passed
      around) we did not honor this.
      
      This patch adds node-id to the structures where it was missing and
      passes it around as necessary.
      
      The test data was generated with a VM with following config:
          <numa>
            <cell id='0' cpus='0,2,4,6' memory='512000' unit='KiB'/>
            <cell id='1' cpus='1,3,5,7' memory='512000' unit='KiB'/>
          </numa>
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1452053
      ccac4465
  3. 16 6月, 2017 1 次提交
  4. 14 6月, 2017 1 次提交
  5. 07 6月, 2017 6 次提交
  6. 05 6月, 2017 1 次提交
  7. 27 4月, 2017 1 次提交
  8. 18 4月, 2017 1 次提交
    • P
      qemu: refactor qemuDomainMachine* functions · ac97658d
      Pavel Hrdina 提交于
      Introduce new wrapper functions without *Machine* in the function
      name that take the whole virDomainDef structure as argument and
      call the existing functions with *Machine* in the function name.
      
      Change the arguments of existing functions to *machine* and *arch*
      because they don't need the whole virDomainDef structure and they
      could be used in places where we don't have virDomainDef.
      Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      ac97658d
  9. 10 4月, 2017 1 次提交
  10. 28 3月, 2017 1 次提交
    • A
      qemu: Remove qemuDomainRequiresMemLock() · 1f7661af
      Andrea Bolognani 提交于
      Instead of having a separate function, we can simply return
      zero from the existing qemuDomainGetMemLockLimitBytes() to
      signal the caller that the memory locking limit doesn't need
      to be set for the guest.
      
      Having a single function instead of two makes it less likely
      that we will use the wrong value, which is exactly what
      happened when we started applying the limit that was meant
      for VFIO-using guests to <memoryBacking><locked>-using
      guests.
      1f7661af
  11. 27 3月, 2017 5 次提交
  12. 25 3月, 2017 1 次提交
    • J
      qemu: Set up the migration TLS objects for target · 1a6b6d9a
      John Ferlan 提交于
      If the migration flags indicate this migration will be using TLS,
      then set up the destination during the prepare phase once the target
      domain has been started to add the TLS objects to perform the migration.
      
      This will create at least an "-object tls-creds-x509,endpoint=server,..."
      for TLS credentials and potentially an "-object secret,..." to handle the
      passphrase response to access the TLS credentials. The alias/id used for
      the TLS objects will contain "libvirt_migrate".
      
      Once the objects are created, the code will set the "tls-creds" and
      "tls-hostname" migration parameters to signify usage of TLS.
      
      During the Finish phase we'll be sure to attempt to clear the
      migration parameters and delete those objects (whether or not they
      were created). We'll also perform the same reset during recovery
      if we've reached FINISH3.
      
      If the migration isn't using TLS, then be sure to check if the
      migration parameters exist and clear them if so.
      1a6b6d9a
  13. 16 3月, 2017 1 次提交
  14. 10 3月, 2017 1 次提交
    • M
      qemuProcessHandleMonitorEOF: Disable namespace for domain · e915942b
      Michal Privoznik 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1430634
      
      If a qemu process has died, we get EOF on its monitor. At this
      point, since qemu process was the only one running in the
      namespace kernel has already cleaned the namespace up. Any
      attempt of ours to enter it has to fail.
      
      This really happened in the bug linked above. We've tried to
      attach a disk to qemu and while we were in the monitor talking to
      qemu it just died. Therefore our code tried to do some roll back
      (e.g. deny the device in cgroups again, restore labels, etc.).
      However, during the roll back (esp. when restoring labels) we
      still thought that domain has a namespace. So we used secdriver's
      transactions. This failed as there is no namespace to enter.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      e915942b
  15. 09 3月, 2017 1 次提交
  16. 21 2月, 2017 1 次提交
    • M
      qemu: Fix deadlock across fork() in QEMU driver · e22de286
      Marc Hartmayer 提交于
      The functions in virCommand() after fork() must be careful with regard
      to accessing any mutexes that may have been locked by other threads in
      the parent process. It is possible that another thread in the parent
      process holds the lock for the virQEMUDriver while fork() is called.
      This leads to a deadlock in the child process when
      'virQEMUDriverGetConfig(driver)' is called and therefore the handshake
      never completes between the child and the parent process. Ultimately
      the virDomainObjectPtr will never be unlocked.
      
      It gets much worse if the other thread of the parent process, that
      holds the lock for the virQEMUDriver, tries to lock the already locked
      virDomainObject. This leads to a completely unresponsive libvirtd.
      
      It's possible to reproduce this case with calling 'virsh start XXX'
      and 'virsh managedsave XXX' in a tight loop for multiple domains.
      
      This commit fixes the deadlock in the same way as it is described in
      commit 61b52d2e.
      Signed-off-by: NMarc Hartmayer <mhartmay@linux.vnet.ibm.com>
      Reviewed-by: NBoris Fiuczynski <fiuczy@linux.vnet.ibm.com>
      e22de286
  17. 20 2月, 2017 3 次提交
  18. 15 2月, 2017 1 次提交
    • M
      qemu_conf: Check for namespaces availability more wisely · b57bd206
      Michal Privoznik 提交于
      The bare fact that mnt namespace is available is not enough for
      us to allow/enable qemu namespaces feature. There are other
      requirements: we must copy all the ACL & SELinux labels otherwise
      we might grant access that is administratively forbidden or vice
      versa.
      At the same time, the check for namespace prerequisites is moved
      from domain startup time to qemu.conf parser as it doesn't make
      much sense to allow users to start misconfigured libvirt just to
      find out they can't start a single domain.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      b57bd206
  19. 08 2月, 2017 1 次提交
  20. 31 1月, 2017 1 次提交
  21. 26 1月, 2017 1 次提交
  22. 10 1月, 2017 1 次提交
  23. 04 1月, 2017 1 次提交
    • J
      qemu: Don't assume secret provided for LUKS encryption · 7f7d9904
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1405269
      
      If a secret was not provided for what was determined to be a LUKS
      encrypted disk (during virStorageFileGetMetadata processing when
      called from qemuDomainDetermineDiskChain as a result of hotplug
      attach qemuDomainAttachDeviceDiskLive), then do not attempt to
      look it up (avoiding a libvirtd crash) and do not alter the format
      to "luks" when adding the disk; otherwise, the device_add would
      fail with a message such as:
      
         "unable to execute QEMU command 'device_add': Property 'scsi-hd.drive'
          can't find value 'drive-scsi0-0-0-0'"
      
      because of assumptions that when the format=luks that libvirt would have
      provided the secret to decrypt the volume.
      
      Access to unlock the volume will thus be left to the application.
      7f7d9904
  24. 15 12月, 2016 5 次提交
    • M
      qemu: Manage /dev entry on RNG hotplug · f95c5c48
      Michal Privoznik 提交于
      When attaching a device to a domain that's using separate mount
      namespace we must maintain /dev entries in order for qemu process
      to see them.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      f95c5c48
    • M
      qemu: Manage /dev entry on chardev hotplug · f5fdf23a
      Michal Privoznik 提交于
      When attaching a device to a domain that's using separate mount
      namespace we must maintain /dev entries in order for qemu process
      to see them.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      f5fdf23a
    • M
      qemu: Manage /dev entry on hostdev hotplug · 6e574928
      Michal Privoznik 提交于
      When attaching a device to a domain that's using separate mount
      namespace we must maintain /dev entries in order for qemu process
      to see them.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      6e574928
    • M
      qemu: Manage /dev entry on disk hotplug · 81df2150
      Michal Privoznik 提交于
      When attaching a device to a domain that's using separate mount
      namespace we must maintain /dev entries in order for qemu process
      to see them.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      81df2150
    • M
      qemu: Spawn qemu under mount namespace · bb4e5296
      Michal Privoznik 提交于
      Prime time. When it comes to spawning qemu process and
      relabelling all the devices it's going to touch, there's inherent
      race with other applications in the system (e.g. udev). Instead
      of trying convincing udev to not touch libvirt managed devices,
      we can create a separate mount namespace for the qemu, and mount
      our own /dev there. Of course this puts more work onto us as we
      have to maintain /dev files on each domain start and device
      hot(un-)plug. On the other hand, this enhances security also.
      
      From technical POV, on domain startup process the parent
      (libvirtd) creates:
      
        /var/lib/libvirt/qemu/$domain.dev
        /var/lib/libvirt/qemu/$domain.devpts
      
      The child (which is going to be qemu eventually) calls unshare()
      to create new mount namespace. From now on anything that child
      does is invisible to the parent. Child then mounts tmpfs on
      $domain.dev (so that it still sees original /dev from the host)
      and creates some devices (as explained in one of the previous
      patches). The devices have to be created exactly as they are in
      the host (including perms, seclabels, ACLs, ...). After that it
      moves $domain.dev mount to /dev.
      
      What's the $domain.devpts mount there for then you ask? QEMU can
      create PTYs for some chardevs. And historically we exposed the
      host ends in our domain XML allowing users to connect to them.
      Therefore we must preserve devpts mount to be shared with the
      host's one.
      
      To make this patch as small as possible, creating of devices
      configured for domain in question is implemented in next patches.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      bb4e5296