1. 15 11月, 2016 4 次提交
    • 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: auto-add pcie-root-port/dmi-to-pci-bridge controllers as needed · 0702f48e
      Laine Stump 提交于
      Previously libvirt would only add pci-bridge devices automatically
      when an address was requested for a device that required a legacy PCI
      slot and none was available. This patch expands that support to
      dmi-to-pci-bridge (which is needed in order to add a pci-bridge on a
      machine with a pcie-root), and pcie-root-port (which is needed to add
      a hotpluggable PCIe device). It does *not* automatically add
      pcie-switch-upstream-ports or pcie-switch-downstream-ports (and
      currently there are no plans for that).
      
      Given the existing code to auto-add pci-bridge devices, automatically
      adding pcie-root-ports is fairly straightforward. The
      dmi-to-pci-bridge support is a bit tricky though, for a few reasons:
      
      1) Although the only reason to add a dmi-to-pci-bridge is so that
         there is a reasonable place to plug in a pci-bridge controller,
         most of the time it's not the presence of a pci-bridge *in the
         config* that triggers the requirement to add a dmi-to-pci-bridge.
         Rather, it is the presence of a legacy-PCI device in the config,
         which triggers auto-add of a pci-bridge, which triggers auto-add of
         a dmi-to-pci-bridge (this is handled in
         virDomainPCIAddressSetGrow() - if there's a request to add a
         pci-bridge we'll check if there is a suitable bus to plug it into;
         if not, we first add a dmi-to-pci-bridge).
      
      2) Once there is already a single dmi-to-pci-bridge on the system,
         there won't be a need for any more, even if it's full, as long as
         there is a pci-bridge with an open slot - you can also plug
         pci-bridges into existing pci-bridges. So we have to make sure we
         don't add a dmi-to-pci-bridge unless there aren't any
         dmi-to-pci-bridges *or* any pci-bridges.
      
      3) Although it is strongly discouraged, it is legal for a pci-bridge
         to be directly plugged into pcie-root, and we don't want to
         auto-add a dmi-to-pci-bridge if there is already a pci-bridge
         that's been forced directly into pcie-root.
      
      Although libvirt will now automatically create a dmi-to-pci-bridge
      when it's needed, the code still remains for now that forces a
      dmi-to-pci-bridge on all domains with pcie-root (in
      qemuDomainDefAddDefaultDevices()). That will be removed in a future
      patch.
      
      For now, the pcie-root-ports are added one to a slot, which is a bit
      wasteful and means it will fail after 31 total PCIe devices (30 if
      there are also some PCI devices), but helps keep the changeset down
      for this patch. A future patch will have 8 pcie-root-ports sharing the
      functions on a single slot.
      0702f48e
    • L
      qemu: assign nec-xhci (USB3) controller to a PCIe address when appropriate · 5266426b
      Laine Stump 提交于
      The nec-usb-xhci device (which is a USB3 controller) has always
      presented itself as a PCI device when plugged into a legacy PCI slot,
      and a PCIe device when plugged into a PCIe slot, but libvirt has
      always auto-assigned it to a legacy PCI slot.
      
      This patch changes that behavior to auto-assign to a PCIe slot on
      systems that have pcie-root (e.g. Q35 and aarch64/virt).
      
      Since we don't yet auto-create pcie-*-port controllers on demand, this
      means a config with an nec-xhci USB controller that has no PCI address
      assigned will also need to have an otherwise-unused pcie-*-port
      controller specified:
      
         <controller type='pci' model='pcie-root-port'/>
         <controller type='usb' model='nec-xhci'/>
      
      (this assumes there is an otherwise-unused slot on pcie-root to accept
      the pcie-root-port)
      5266426b
    • L
      qemu: assign virtio devices to PCIe slot when appropriate · c7fc151e
      Laine Stump 提交于
      libvirt previously assigned nearly all devices to a "hotpluggable"
      legacy PCI slot even on machines with a PCIe root bus (and even though
      most such machines don't even support hotplug on legacy PCI slots!)
      Forcing all devices onto legacy PCI slots means that the domain will
      need a dmi-to-pci-bridge (to convert from PCIe to legacy PCI) and a
      pci-bridge (to provide hotpluggable legacy PCI slots which, again,
      usually aren't hotpluggable anyway).
      
      To help reduce the need for these legacy controllers, this patch tries
      to assign virtio-1.0-capable devices to PCIe slots whenever possible,
      by setting appropriate connectFlags in
      virDomainCalculateDevicePCIConnectFlags(). Happily, when that function
      was written (just a few commits ago) it was created with a
      "virtioFlags" argument, set by both of its callers, which is the
      proper connectFlags to set for any virtio-*-pci device - depending on
      the arch/machinetype of the domain, and whether or not the qemu binary
      supports virtio-1.0, that flag will have either been set to PCI or
      PCIe. This patch merely enables the functionality by setting the flags
      for the device to whatever is in virtioFlags if the device is a
      virtio-*-pci device.
      
      NB: the first virtio video device will be placed directly on bus 0
      slot 1 rather than on a pcie-root-port due to the override for primary
      video devices in qemuDomainValidateDevicePCISlotsQ35(). Whether or not
      to change that is a topic of discussion, but this patch doesn't change
      that particular behavior.
      
      NB2: since the slot must be hotpluggable, and pcie-root (the PCIe root
      complex) does *not* support hotplug, this means that suitable
      controllers must also be in the config (i.e. either pcie-root-port, or
      pcie-downstream-port). For now, libvirt doesn't add those
      automatically, so if you put virtio devices in a config for a qemu
      that has PCIe-capable virtio devices, you'll need to add extra
      pcie-root-ports yourself. That requirement will be eliminated in a
      future patch, but for now, it's simple to do this:
      
         <controller type='pci' model='pcie-root-port'/>
         <controller type='pci' model='pcie-root-port'/>
         <controller type='pci' model='pcie-root-port'/>
         ...
      
      Partially Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1330024
      c7fc151e
  2. 11 11月, 2016 1 次提交
  3. 09 11月, 2016 1 次提交
  4. 03 11月, 2016 1 次提交
  5. 26 10月, 2016 3 次提交
    • G
      qemu: Add support for using AES secret for SCSI hotplug · 0701abcb
      Gema Gomez 提交于
      Support for virtio disks was added in commit id 'fceeeda2', but not for
      SCSI drives. Add the secret for the server when hotplugging a SCSI drive.
      No need to make any adjustments for unplug since that's handled during
      the qemuDomainDetachDiskDevice call to qemuDomainRemoveDiskDevice in
      the qemuDomainDetachDeviceDiskLive switch.
      
      Added a test to/for the command line processing to show the command line
      options when adding a SCSI drive for the guest.
      0701abcb
    • 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
    • J
      qemu: Add the length options to the iotune command line · 2db108c7
      John Ferlan 提交于
      Add in the block I/O throttling length/duration parameter to the command
      line if supported. If not supported, fail command creation.
      
      Add the xml2argvtest for testing.
      2db108c7
  6. 24 10月, 2016 1 次提交
    • 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
  7. 18 10月, 2016 1 次提交
  8. 17 10月, 2016 1 次提交
    • A
      conf: Explain some code in more detail · 61e10143
      Andrea Bolognani 提交于
      The code is entirely correct, but it still managed to trip me
      up when I first ran into it because I did not realize right away
      that VIR_PCI_CONNECT_TYPES_ENDPOINT was not a single flag, but
      rather a mask including both VIR_PCI_CONNECT_TYPE_PCI_DEVICE and
      VIR_PCI_CONNECT_TYPE_PCIE_DEVICE.
      
      In order to save the next distracted traveler in PCI Address Land
      some time, document this fact with a comment. Add a test case for
      the behavior as well.
      61e10143
  9. 14 10月, 2016 2 次提交
  10. 12 10月, 2016 7 次提交
  11. 07 10月, 2016 1 次提交
    • D
      qemu: fix command line building for iommu devices · 5dee6686
      Daniel P. Berrange 提交于
      The intel-iommu device has existed since QEMU 2.2.0, but
      it was only possible to create it with -device since
      QEMU 2.7.0, thanks to:
      
        commit 621d983a1f9051f4cfc3f402569b46b77d8449fc
        Author: Marcel Apfelbaum <marcel@redhat.com>
        Date:   Mon Jun 27 18:38:34 2016 +0300
      
          hw/iommu: enable iommu with -device
      
          Use the standard '-device intel-iommu' to create the IOMMU device.
          The legacy '-machine,iommu=on' can still be used.
      
      The libvirt capability check & command line formatting code
      is thus broken for all QEMU versions 2.2.0 -> 2.6.0 inclusive.
      
      This fixes it to use iommu=on instead.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      5dee6686
  12. 28 9月, 2016 1 次提交
    • J
      qemu: Fix crash in qemucapsprobe · c2c43912
      Jiri Denemark 提交于
      The qemucapsprobe helper calls virQEMUCapsNewForBinaryInternal with
      caps == NULL, causing the following crash:
      
          Program received signal SIGSEGV, Segmentation fault.
          #0  0x00007ffff788775f in virQEMUCapsInitHostCPUModel
              (qemuCaps=qemuCaps@entry=0x649680, host=host@entry=0x10) at
              src/qemu/qemu_capabilities.c:2969
          #1  0x00007ffff7889dbf in virQEMUCapsNewForBinaryInternal
              (caps=caps@entry=0x0, binary=<optimized out>,
              libDir=libDir@entry=0x4033f6 "/tmp", cacheDir=cacheDir@entry=0x0,
              runUid=runUid@entry=4294967295, runGid=runGid@entry=4294967295,
              qmpOnly=true) at src/qemu/qemu_capabilities.c:4039
          #2  0x0000000000401702 in main (argc=2, argv=0x7fffffffd968) at
              tests/qemucapsprobe.c:73
      
      Caused by v2.2.0-182-g68c70118.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      c2c43912
  13. 26 9月, 2016 1 次提交
  14. 22 9月, 2016 11 次提交
  15. 16 9月, 2016 1 次提交
    • L
      qemu: map "virtio" video model to "virt" machtype correctly (arm/aarch64) · 706b5b62
      Laszlo Ersek 提交于
      Most of QEMU's PCI display device models, such as:
      
        libvirt video/model/@type  QEMU -device
        -------------------------  ------------
        cirrus                     cirrus-vga
        vga                        VGA
        qxl                        qxl-vga
        virtio                     virtio-vga
      
      come with a linear framebuffer (sometimes called "VGA compatibility
      framebuffer"). This linear framebuffer lives in one of the PCI device's
      MMIO BARs, and allows guest code (primarily: firmware drivers, and
      non-accelerated OS drivers) to display graphics with direct memory access.
      
      Due to architectural reasons on aarch64/KVM hosts, this kind of
      framebuffer doesn't / can't work in
      
        qemu-system-(arm|aarch64) -M virt
      
      machines. Cache coherency issues guarantee a corrupted / unusable display.
      The problem has been researched by several people, including kvm-arm
      maintainers, and it's been decided that the best way (practically the only
      way) to have boot time graphics for such guests is to consolidate on
      QEMU's "virtio-gpu-pci" device.
      
      >From <https://bugzilla.redhat.com/show_bug.cgi?id=1195176>, libvirt
      supports
      
        <devices>
          <video>
            <model type='virtio'/>
          </video>
        </devices>
      
      but libvirt unconditionally maps @type='virtio' to QEMU's "virtio-vga"
      device model. (See the qemuBuildDeviceVideoStr() function and the
      "qemuDeviceVideo" enum impl.)
      
      According to the above, this is not right for the "virt" machine type; the
      qemu-system-(arm|aarch64) binaries don't even recognize the "virtio-vga"
      device model (justifiedly). Whereas "virtio-gpu-pci", which is a pure
      virtio device without a compatibility framebuffer, is available, and works
      fine.
      
      (The ArmVirtQemu ("AAVMF") platform of edk2 -- that is, the UEFI firmware
      for "virt" -- supports "virtio-gpu-pci", as of upstream commit
      3ef3209d3028. See
      <https://tianocore.acgmultimedia.com/show_bug.cgi?id=66>.)
      
      Override the default mapping of "virtio", from "virtio-vga" to
      "virtio-gpu-pci", if qemuDomainMachineIsVirt() evaluates to true.
      
      Cc: Andrea Bolognani <abologna@redhat.com>
      Cc: Drew Jones <drjones@redhat.com>
      Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
      Cc: Martin Kletzander <mkletzan@redhat.com>
      Suggested-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1372901Signed-off-by: NLaszlo Ersek <lersek@redhat.com>
      Acked-by: NMartin Kletzander <mkletzan@redhat.com>
      706b5b62
  16. 14 9月, 2016 1 次提交
  17. 09 9月, 2016 2 次提交