1. 15 12月, 2016 5 次提交
    • M
      qemu: Prepare TPM when starting a domain · 2c654490
      Michal Privoznik 提交于
      When starting a domain and separate mount namespace is used, we
      have to create all the /dev entries that are configured for the
      domain.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      2c654490
    • M
      qemu: Prepare chardevs when starting a domain · 4e445101
      Michal Privoznik 提交于
      When starting a domain and separate mount namespace is used, we
      have to create all the /dev entries that are configured for the
      domain.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      4e445101
    • M
      qemu: Prepare hostdevs when starting a domain · 73267cec
      Michal Privoznik 提交于
      When starting a domain and separate mount namespace is used, we
      have to create all the /dev entries that are configured for the
      domain.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      73267cec
    • M
      qemu: Prepare disks when starting a domain · 054202d0
      Michal Privoznik 提交于
      When starting a domain and separate mount namespace is used, we
      have to create all the /dev entries that are configured for the
      domain.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      054202d0
    • 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
  2. 08 12月, 2016 1 次提交
  3. 01 12月, 2016 1 次提交
    • L
      qemu: propagate virQEMUDriver object to qemuDomainDeviceCalculatePCIConnectFlags · 9b0848d5
      Laine Stump 提交于
      If libvirtd is running unprivileged, it can open a device's PCI config
      data in sysfs, but can only read the first 64 bytes. But as part of
      determining whether a device is Express or legacy PCI,
      qemuDomainDeviceCalculatePCIConnectFlags() will be updated in a future
      patch to call virPCIDeviceIsPCIExpress(), which tries to read beyond
      the first 64 bytes of the PCI config data and fails with an error log
      if the read is unsuccessful.
      
      In order to avoid creating a parallel "quiet" version of
      virPCIDeviceIsPCIExpress(), this patch passes a virQEMUDriverPtr down
      through all the call chains that initialize the
      qemuDomainFillDevicePCIConnectFlagsIterData, and saves the driver
      pointer with the rest of the iterdata so that it can be used by
      qemuDomainDeviceCalculatePCIConnectFlags(). This pointer isn't used
      yet, but will be used in an upcoming patch (that detects Express vs
      legacy PCI for VFIO assigned devices) to examine driver->privileged.
      9b0848d5
  4. 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
  5. 23 11月, 2016 2 次提交
    • N
      qemu: agent: fix unsafe agent access · aaf2992d
      Nikolay Shirokovskiy 提交于
      qemuDomainObjExitAgent is unsafe.
      
      First it accesses domain object without domain lock.
      Second it uses outdated logic that goes back to commit 79533da1 of
      year 2009 when code was quite different. (unref function
      instead of unreferencing only unlocked and disposed object
      in case of last reference and leaved unlocking to the caller otherwise).
      Nowadays this logic may lead to disposing locked object
      i guess.
      
      Another problem is that the callers of qemuDomainObjEnterAgent
      use domain object again (namely priv->agent) without domain lock.
      
      This patch address these two problems.
      
      qemuDomainGetAgent is dropped as unused.
      aaf2992d
    • N
      qemu: drop write-only agentStart · 3c1c5678
      Nikolay Shirokovskiy 提交于
      3c1c5678
  6. 22 11月, 2016 4 次提交
  7. 15 11月, 2016 3 次提交
    • L
      qemu: add a USB3 controller to Q35 domains by default · d8bd8376
      Laine Stump 提交于
      Previously we added a set of EHCI+UHCI controllers to Q35 machines to
      mimic real hardware as closely as possible, but recent discussions
      have pointed out that the nec-usb-xhci (USB3) controller is much more
      virtualization-friendly (uses less CPU), so this patch switches the
      default for Q35 machinetypes to add an XHCI instead (if it's
      supported, which it of course *will* be).
      
      Since none of the existing test cases left out USB controllers in the
      input XML, a new Q35 test case was added which has *no* devices, so
      ends up with only the defaults always put in by qemu, plus those added
      by libvirt.
      d8bd8376
    • L
      qemu: don't force-add a dmi-to-pci-bridge just on principle · 80723220
      Laine Stump 提交于
      Now the a dmi-to-pci-bridge is automatically added just as it's needed
      (when a pci-bridge is being added), we no longer have any need to
      force-add one to every single Q35 domain.
      80723220
    • L
      qemu: new functions qemuDomainMachineHasPCI[e]Root() · 50adb8a6
      Laine Stump 提交于
      These functions provide a simple one line method of learning if the
      current domain has a pci-root or pcie-root bus.
      50adb8a6
  8. 02 11月, 2016 1 次提交
  9. 26 10月, 2016 1 次提交
    • J
      qemu: Add a secret object to/for a char source dev · daf5c651
      John Ferlan 提交于
      Add the secret object so the 'passwordid=' can be added if the command line
      if there's a secret defined in/on the host for TCP chardev TLS objects.
      
      Preparation for the secret involves adding the secinfo to the char source
      device prior to command line processing. There are multiple possibilities
      for TCP chardev source backend usage.
      
      Add test for at least a serial chardev as an example.
      daf5c651
  10. 25 10月, 2016 1 次提交
  11. 24 10月, 2016 2 次提交
    • P
      domain: fix migration to older libvirt · 7c8df1e8
      Pavel Hrdina 提交于
      Since TLS was introduced hostwide for libvirt 2.3.0 and a domain
      configurable haveTLS was implemented for libvirt 2.4.0, we have to
      modify the migratable XML for specific case where the 'tls' attribute
      is based on setting from qemu.conf.
      
      The "tlsFromConfig" is libvirt internal attribute and is stored only in
      status XML to ensure that when libvirtd is restarted this internal flag
      is not lost by the restart.
      
      That flag is used to decide whether we should put *tls* attribute to
      migratable XML or not.
      Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      7c8df1e8
    • P
      domain: Add optional 'tls' attribute for TCP chardev · 0298531b
      Pavel Hrdina 提交于
      Add an optional "tls='yes|no'" attribute for a TCP chardev.
      
      For QEMU, this will allow for disabling the host config setting of the
      'chardev_tls' for a domain chardev channel by setting the value to "no" or
      to attempt to use a host TLS environment when setting the value to "yes"
      when the host config 'chardev_tls' setting is disabled, but a TLS environment
      is configured via either the host config 'chardev_tls_x509_cert_dir' or
      'default_tls_x509_cert_dir'
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      0298531b
  12. 22 10月, 2016 2 次提交
  13. 20 10月, 2016 1 次提交
    • J
      qemu: Introduce qemuDomainChardevPrivatePtr · 5f2a1327
      John Ferlan 提交于
      Modeled after the qemuDomainHostdevPrivatePtr (commit id '27726d8c'),
      create a privateData pointer in the _virDomainChardevDef to allow storage
      of private data for a hypervisor in order to at least temporarily store
      secret data for usage during qemuBuildCommandLine.
      
      NB: Since the qemu_parse_command (qemuParseCommandLine) code is not
      expecting to restore the secret data, there's no need to add code
      code to handle this new structure there.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      5f2a1327
  14. 18 10月, 2016 1 次提交
  15. 12 10月, 2016 3 次提交
  16. 11 10月, 2016 1 次提交
  17. 05 10月, 2016 1 次提交
  18. 26 9月, 2016 9 次提交