1. 19 10月, 2017 1 次提交
    • J
      Split out qemuDomainEnsureVirtioAddress · f16600ff
      Ján Tomko 提交于
      Split out the common code responsible for reserving/assigning
      PCI/CCW addresses for virtio disks into a helper function
      for reuse by other virtio devices.
      f16600ff
  2. 16 10月, 2017 1 次提交
  3. 11 10月, 2017 1 次提交
  4. 05 9月, 2017 1 次提交
  5. 28 8月, 2017 1 次提交
    • A
      qemu: Handle host devices not being available better · 1f433932
      Andrea Bolognani 提交于
      We can't retrieve the isolation group of a device that's not present
      in the system. However, it's very common for VFs to be created late
      in the boot, so they might not be present yet when libvirtd starts,
      which would cause the guests using them to disappear.
      
      Moreover, for other architectures and even ppc64 before isolation
      groups were introduced, it's considered perfectly fine to configure a
      guest to use a device that's not yet (or no longer) available to the
      host, with the obvious caveat that such a guest won't be able to
      start before the device is available.
      
      In order to be consistent, when a device's isolation group can't be
      determined fall back to not isolating it rather than erroring out or,
      worse, making the guest disappear.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1484254Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
      1f433932
  6. 25 8月, 2017 1 次提交
  7. 25 7月, 2017 1 次提交
  8. 18 7月, 2017 2 次提交
  9. 15 7月, 2017 4 次提交
  10. 13 6月, 2017 1 次提交
  11. 28 4月, 2017 2 次提交
  12. 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
  13. 27 3月, 2017 1 次提交
  14. 17 3月, 2017 1 次提交
  15. 12 3月, 2017 1 次提交
    • F
      bhyve: add video support · 04664327
      Fabian Freyer 提交于
      bhyve supports 'gop' video device that allows clients to connect
      to VMs using VNC clients. This commit adds support for that to
      the bhyve driver:
      
       - Introducr 'gop' video device type
       - Add capabilities probing for the 'fbuf' device that's
         responsible for graphics
       - Update command builder routines to let users configure
         domain's VNC via gop graphics.
      Signed-off-by: NRoman Bogorodskiy <bogorodskiy@gmail.com>
      04664327
  16. 23 2月, 2017 2 次提交
    • D
      qemu: add missing break in qemuDomainDeviceCalculatePCIConnectFlags · fb52faf8
      Daniel P. Berrange 提交于
      One of the conditions in qemuDomainDeviceCalculatePCIConnectFlags
      was missing a break that could result it in falling through to
      an incorrect codepath.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      fb52faf8
    • A
      qemu: Allow multiple bridges when pci-bridges is not available · 011d5465
      Andrea Bolognani 提交于
      qemuDomainAssignPCIAddresses() hardcoded the assumption
      that the only way to support devices on a non-zero bus is
      to add one or more pci-bridges; however, since we now
      support a large selection of PCI controllers that can be
      used instead, the assumption is no longer true.
      
      Moreover, this check was always redundant, because the
      only sensible time to check for the availability of
      pci-bridge is when building the QEMU command line, and
      such a check is of course already in place.
      
      In fact, there were *two* such checks, but since one of
      the two was relying on the incorrect assumption explained
      above, and it was redundant anyway, it has been dropped.
      011d5465
  17. 13 2月, 2017 1 次提交
  18. 31 1月, 2017 1 次提交
  19. 11 1月, 2017 11 次提交
    • L
      conf: eliminate virDomainPCIAddressReleaseSlot() in favor of ...Addr() · 5949b53a
      Laine Stump 提交于
      Surprisingly there was a virDomainPCIAddressReleaseAddr() function
      already, but it was completely unused. Since we don't reserve entire
      slots at once any more, there is no need to release entire slots
      either, so we just replace the single call to
      virDomainPCIAddressReleaseSlot() with a call to
      virDomainPCIAddressReleaseAddr() and remove the now unused function.
      
      The keen observer may be concerned that ...Addr() doesn't call
      virDomainPCIAddressValidate(), as ...Slot() did. But really the
      validation was pointless anyway - if the device hadn't been suitable
      to be connected at that address, it would have failed validation
      before every being reserved in the first place, so by definition it
      will pass validation when it is being unplugged. (And anyway, even if
      something "bad" happened and we managed to have a device incorrectly
      at the given address, we would still want to be able to free it up for
      use by a device that *did* validate properly).
      5949b53a
    • L
      qemu: rename qemuDomainPCIAddressReserveNextSlot() to ...Addr() · 6cc20142
      Laine Stump 提交于
      This function doesn't actually reserve an entire slot any more, it
      reserves a single PCI address, so this name is more appropriate.
      6cc20142
    • L
      qemu: remove qemuDomainPCIAddressReserveNextAddr() · c5aea19d
      Laine Stump 提交于
      This function is only called in two places, and the function itself is
      just adding a single argument and calling
      virDomainPCIAddressReserveNextAddr(), so we can remove it and instead
      call virDomainPCIAddressReserveNextAddr() directly. (The main
      motivation for doing this is to free up the name so that
      qemuDomainPCIAddressReserveNextSlot() can be renamed in the next
      patch, as its current name is now inaccurate and misleading).
      c5aea19d
    • L
      conf: rename virDomainPCIAddressReserveSlot() to ...Addr() · 27b0f971
      Laine Stump 提交于
      This function doesn't actually reserve an entire slot any more, it
      reserves a single PCI address, so this name is more appropriate.
      27b0f971
    • L
      qemu: replace virDomainPCIAddressReserveAddr with virDomainPCIAddressReserveSlot · 905859a6
      Laine Stump 提交于
      All occurences of the former use fromConfig=true, and that's exactly
      how virDomainPCIAddressReserveSlot() calls
      virDomainPCIaddressReserveAddr(), so just use *Slot() so that *Addr()
      can be made static to conf/domain_addr.c (both functions will be
      renamed in upcoming patches).
      905859a6
    • L
      conf: fix fromConfig argument to virDomainPCIAddressValidate() · b59bbdba
      Laine Stump 提交于
      fromConfig should be true if the caller wants
      virDomainPCIAddressValidate() to loosen restrictions on its
      interpretation of the pciConnectFlags. In particular, either
      PCI_DEVICE or PCIE_DEVICE will be counted as equivalent to both, and
      HOTPLUG will be ignored. In a few cases where libvirt was manually
      overriding automatic address assignment, it was setting fromConfig to
      false when validating the hardcoded manual override. This patch
      changes those to fromConfig=true as a preemptive strike against any
      future bugs that might otherwise surface.
      b59bbdba
    • L
      conf: fix fromConfig argument to virDomainPCIAddressReserveAddr() · 79901543
      Laine Stump 提交于
      Although setting virDomainPCIAddressReserveAddr()'s fromConfig=true is
      correct when a PCI addres is coming from a domain's config, the *true*
      purpose of the fromConfig argument is to lower restrictions on what
      kind of device can plug into what kind of controller - if fromConfig
      is true, then a PCIE_DEVICE can plug into a slot that is marked as
      only compatible with PCI_DEVICE (and vice versa), and the HOTPLUG flag
      is ignored.
      
      For a long time there have been several calls to
      virDomainPCIAddressReserveAddr() that have fromConfig incorrectly set
      to false - it's correct that the addresses aren't coming from user
      config, but they are coming from hardcoded exceptions in libvirt that
      should, if anything, pay *even less* attention to following the
      pciConnectFlags (under the assumption that the libvirt programmer knew
      what they were doing).
      
      See commit b87703cf for an example of an actual bug caused by the
      incorrect setting of the "fromConfig" argument to
      virDomainPCIAddressReserveAddr(). Although they haven't resulted in
      any reported bugs, this patch corrects all the other incorrect
      settings of fromConfig in calls to virDomainPCIAddressReserveAddr().
      79901543
    • L
      conf: aggregate multiple devices on a slot when assigning PCI addresses · 48d39cf9
      Laine Stump 提交于
      If a PCI device has VIR_PCI_CONNECT_AGGREGATE_SLOT set in its
      pciConnectFlags, then during address assignment we allow multiple
      instances of this type of device to be auto-assigned to multiple
      functions on the same device. A slot is used for aggregating multiple
      devices only if the first device assigned to that slot had
      VIR_PCI_CONNECT_AGGREGATE_SLOT set. but any device types that have
      AGGREGATE_SLOT set might be mix/matched on the same slot.
      
      (NB: libvirt should never set the AGGREGATE_SLOT flag for a device
      type that might need to be hotplugged. Currently it is only planned
      for pcie-root-port and possibly other PCI controller types, and none
      of those are hotpluggable anyway)
      
      There aren't yet any devices that use this flag. That will be in a
      later patch.
      48d39cf9
    • L
      qemu: use virDomainPCIAddressSetAllMulti() to set multi when needed · 8f400871
      Laine Stump 提交于
      If there are multiple devices assigned to the different functions of a
      single PCI slot, they will not work properly if the device at function
      0 doesn't have its "multi" attribute turned on, so it makes sense for
      libvirt to turn it on during PCI address assignment. Setting multi
      then assures that the new setting is stored in the config (so it will
      be used next time the domain is started), preventing any potential
      problems in the case that a future change in the configuration
      eliminates the devices on all non-0 functions (multi will still be set
      for function 0 even though it is the only function in use on the slot,
      which has no useful purpose, but also doesn't cause any problems).
      
      (NB: If we were to instead just decide on the setting for
      multifunction at runtime, a later removal of the non-0 functions of a
      slot would result in a silent change in the guest ABI for the
      remaining device on function 0 (although it may seem like an
      inconsequential guest ABI change, it *is* a guest ABI change to turn
      off the multi bit).)
      8f400871
    • L
      conf: eliminate concept of "reserveEntireSlot" · 9ff9d9f5
      Laine Stump 提交于
      setting reserveEntireSlot really accomplishes nothing - instead of
      going to the trouble of computing the value for reserveEntireSlot and
      then possibly setting *all* functions of the slot as in-use, we can
      just set the in-use bit only for the specific function being used by a
      device.  Later we will know from the context (the PCI connect flags,
      and whether we are reserving a specific address or asking for "the
      next available") whether or not it is okay to allocate other functions
      on the same slot.
      
      Although it's not used yet, we allow specifying "-1" for the function
      number when looking for the "next available slot" - this is going to
      end up meaning "return the lowest available function in the slot, but
      since we currently only provide a function from an otherwise unused
      slot, "-1" ends up meaning "0".
      9ff9d9f5
    • L
      conf: use struct instead of int for each slot in virDomainPCIAddressBus · 9838cad9
      Laine Stump 提交于
      When keeping track of which functions of which slots are allocated, we
      will need to have more information than just the current bitmap with a
      bit for each function that is currently stored for each slot in a
      virDomainPCIAddressBus. To prepare for adding more per-slot info, this
      patch changes "uint8_t slots" into "virDomainPCIAddressSlot slot", which
      currently has a single member named "functions" that serves the same
      purpose previously served directly by "slots".
      9838cad9
  20. 10 1月, 2017 1 次提交
    • A
      qemu: Use virtio-pci by default for mach-virt guests · 1d845463
      Andrea Bolognani 提交于
      virtio-pci is the way forward for aarch64 guests: it's faster
      and less alien to people coming from other architectures.
      Now that guest support is finally getting there (Fedora 24,
      CentOS 7.3, Ubuntu 16.04 and Debian testing all support
      virtio-pci out of the box), we'd like to start using it by
      default instead of virtio-mmio.
      
      Users and applications can already opt-in by explicitly using
      
        <address type='pci'/>
      
      inside the relevant elements, but that's kind of cumbersome and
      requires all users and management applications to adapt, which
      we'd really like to avoid.
      
      What we can do instead is use virtio-mmio only if the guest
      already has at least one virtio-mmio device, and use virtio-pci
      in all other situations.
      
      That means existing virtio-mmio guests will keep using the old
      addressing scheme, and new guests will automatically be created
      using virtio-pci instead. Users can still override the default
      in either direction.
      
      Existing tests such as aarch64-aavmf-virtio-mmio and
      aarch64-virtio-pci-default already cover all possible
      scenarios, so no additions to the test suites are necessary.
      1d845463
  21. 02 12月, 2016 1 次提交
  22. 01 12月, 2016 2 次提交
    • L
      qemu: assign VFIO devices to PCIe addresses when appropriate · 70249927
      Laine Stump 提交于
      Although nearly all host devices that are assigned to guests using
      VFIO ("<hostdev>" devices in libvirt) are physically PCI Express
      devices, until now libvirt's PCI address assignment has always
      assigned them addresses on legacy PCI controllers in the guest, even
      if the guest's machinetype has a PCIe root bus (e.g. q35 and
      aarch64/virt).
      
      This patch tries to assign them to an address on a PCIe controller
      instead, when appropriate. First we do some preliminary checks that
      might allow setting the flags without doing any extra work, and if
      those conditions aren't met (and if libvirt is running privileged so
      that it has proper permissions), we perform the (relatively) time
      consuming task of reading the device's PCI config to see if it is an
      Express device. If this is successful, the connect flags are set based
      on the result, but if we aren't able to read the PCI config (most
      likely due to the device not being present on the system at the time
      of the check) we assume it is (or will be) an Express device, since
      that is almost always the case anyway.
      70249927
    • 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
  23. 25 11月, 2016 1 次提交
    • E
      qemu: Add vhost-scsi string for -device parameter · 9cc26dc6
      Eric Farman 提交于
      Open /dev/vhost-scsi, and record the resulting file descriptor, so that
      the guest has access to the host device outside of the libvirt daemon.
      Pass this information, along with data parsed from the XML file, to build
      a device string for the qemu command line.  That device string will be
      for either a vhost-scsi-ccw device in the case of an s390 machine, or
      vhost-scsi-pci for any others.
      Signed-off-by: NEric Farman <farman@linux.vnet.ibm.com>
      9cc26dc6