1. 27 10月, 2016 1 次提交
    • J
      Add 'FromCache' to virDomainVirtioSerialAddrAutoAssign · 0512dd26
      Ján Tomko 提交于
      Commit 19a148b7 dropped the cache from QEMU's private domain object.
      Assume the callers do not have the cache by default and use
      a longer name for the internal ones that do.
      
      This makes the shorter 'virDomainVirtioSerialAddrAutoAssign'
      name availabe for a function that will not require the cache.
      0512dd26
  2. 25 10月, 2016 2 次提交
  3. 24 10月, 2016 4 次提交
  4. 12 10月, 2016 1 次提交
    • P
      qemu_domain: move video validation out of qemu_command · 133fb140
      Pavel Hrdina 提交于
      All definition validation that doesn't depend on qemu capabilities
      and was allowed previously as valid definition should be placed into
      qemuDomainDefValidate.
      
      The check whether video type is supported or not was based on an enum
      that translates type into model.  Use switch to ensure that if new
      video type is added, it will be properly handled.
      Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      133fb140
  5. 02 9月, 2016 1 次提交
    • X
      conf: Fix initialization value of 'multi' in PCI address · f7658da6
      Xian Han Yu 提交于
      The 'multi' element in PCI address struct used as 'virTristateSwitch',
      and its default value is 'VIR_TRISTATE_SWITCH_ABSENT'. Current PCI
      process use 'false' to initialization 'multi', which is ambiguously
      for assignment or comparison. This patch use '{0}' to initialize
      the whole PCI address struct, which fix the 'multi' initialization
      and makes code more simplify and explicitly.
      Signed-off-by: NXian Han Yu <xhyubj@linux.vnet.ibm.com>
      f7658da6
  6. 26 7月, 2016 4 次提交
    • T
      qemu: remove ccwaddrs caching · 1aa5e66c
      Tomasz Flendrich 提交于
      Dropping the caching of ccw address set.
      The cached set is not required anymore, because the set is now being
      recalculated from the domain definition on demand, so the cache
      can be deleted.
      1aa5e66c
    • T
      Add qemuDomainCCWAddrSetCreateFromDomain · af174f6e
      Tomasz Flendrich 提交于
      The address sets (pci, ccw, virtio serial) are currently cached
      in qemu private data, but all the information required to recreate
      these sets is in the domain definition. Therefore I am removing
      the redundant data and adding a way to recalculate these sets.
      
      Add a function that calculates the ccw address set
      from the domain definition.
      af174f6e
    • T
      qemu: remove vioserialaddrs caching · 19a148b7
      Tomasz Flendrich 提交于
      Dropping the caching of virtio serial address set.
      The cached set is not required anymore, because the set is now being
      recalculated from the domain definition on demand, so the cache
      can be deleted.
      
      Credit goes to Cole Robinson.
      19a148b7
    • T
      add virDomainVirtioSerialAddrSetCreateFromDomain · 40c284f0
      Tomasz Flendrich 提交于
      The address sets (pci, ccw, virtio serial) are currently cached
      in qemu private data, but all the information required to recreate
      these sets is in the domain definition. Therefore I am removing
      the redundant data and adding a way to recalculate these sets.
      
      Add a function that calculates the virtio serial address set
      from the domain definition.
      
      Credit goes to Cole Robinson.
      40c284f0
  7. 21 7月, 2016 4 次提交
  8. 24 6月, 2016 1 次提交
  9. 23 6月, 2016 1 次提交
  10. 21 6月, 2016 1 次提交
  11. 18 6月, 2016 1 次提交
    • A
      qemu: Permit PCI-free aarch64 mach-virt guests · 86a68bdb
      Andrea Bolognani 提交于
      There has been some progress lately in enabling virtio-pci on
      aarch64 guests; however, guest OS support is still spotty at best,
      so most guests are going to be using virtio-mmio instead.
      
      Currently, mach-virt guests are closely modeled after q35 guests,
      and that includes always adding a dmi-to-pci-bridge that's just
      impossible to get rid of. While that's acceptable (if suboptimal)
      for q35, where you will always need some kind of PCI device anyway,
      mach-virt guests should be allowed to avoid it.
      86a68bdb
  12. 26 5月, 2016 2 次提交
    • A
      qemu: Fix error message when PCI bridge has index <= bus · c7289cf3
      Andrea Bolognani 提交于
      Commit ff212622 changed the error message to be more
      detailed about the failure at hand; however, while the new
      error message claims that "bus must be <= index", the error
      message is displayed if "idx <= addr->bus", ie. when bus
      is larger than or *equal to* index.
      
      Change the error message to report the correct constraint,
      and format it in a way that mirrors the check exactly to
      make it clearer to people reading the code. The new error
      message reads "index must be larger than bus".
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1339900
      c7289cf3
    • L
      conf/qemu: make IS_USB2_CONTROLLER globally available · 1140b31f
      Laine Stump 提交于
      IS_USB2_CONTROLLER() is useful in more places aside from just when
      assigning PCI addresses in QEMU, and is checking for enum values that
      are all defined in conf/domain_conf.h anyway, so define it there
      instead.
      1140b31f
  13. 25 5月, 2016 2 次提交
    • J
      qemu: Remove unused persistentAddrs · fb063500
      John Ferlan 提交于
      Based on some digital archaeology performed by jtomko, it's been determined
      that the persistentAddrs variable is no longer necessary...
      
      The variable was added by:
      commit 141dea6b
      CommitDate: 2010-02-12 17:25:52 +0000
          Add persistence of PCI addresses to QEMU
      
      Where it was set to 0 on domain startup if qemu did not support the
      QEMUD_CMD_FLAG_DEVICE capability, to clear the addresses at shutdown,
      because QEMU might make up different ones next time.
      
      As of commit f5dd58a6
      CommitDate: 2012-07-11 11:19:05 +0200
          qemu: Extended qemuDomainAssignAddresses to be callable from
          everywhere.
      
      this was broken, when the persistentAddrs = 0 assignment was moved
      inside qemuDomainAssignPCIAddresses and while it pretends to check
      for !QEMU_CAPS_DEVICE, its parent qemuDomainAssignAddresses is only
      called if QEMU_CAPS_DEVICE is present.
      fb063500
    • J
      qemu: Remove dead code · f30672d5
      John Ferlan 提交于
      Since commit id '20a0fa8e' removed the QEMU_CAPS_DEVICE, Coverity notes
      that it's no longer possible to have 'addrs' be NULL when checking for
      a live domain since qemuDomainPCIAddressSetCreate would have jumped to
      cleanup if addrs was NULL.
      f30672d5
  14. 21 5月, 2016 1 次提交
    • L
      qemu: auto-assign addresses when <address type='pci'/> is specified · c026f8f1
      Laine Stump 提交于
      Rather than only assigning a PCI address when no address is given at
      all, also do it when the config says that the address type is 'pci',
      but it gives no address (virDeviceInfoPCIAddressWanted()).
      
      There are also several places after parsing but prior to address
      assignment where code previously expected that any info with address
      type='pci' would have a *valid* PCI address, which isn't always the
      case - now we check not only for type='pci', but also for a valid
      address (virDeviceInfoPCIAddressPresent()).
      
      The test case added in this patch was directly copied from Cole's patch titled:
      
          qemu: Wire up address type=pci auto_allocate
      c026f8f1
  15. 19 5月, 2016 1 次提交
    • C
      qemu: address: Remove QEMU_CAPS_DEVICE usage · 20a0fa8e
      Cole Robinson 提交于
      All qemu versions we support have QEMU_CAPS_DEVICE, so checking
      for it is redundant. Remove the usage.
      
      The code diff isn't clear, but all that code is just inindented
      with no other change.
      
      Test cases that hit qemuDomainAssignAddresses but don't have
      infrastructure for specifying qemuCaps values see lots of
      churn, since now PCI addresses are in the XML output.
      20a0fa8e
  16. 03 5月, 2016 4 次提交
  17. 02 5月, 2016 1 次提交
    • M
      Change virDevicePCIAddress to virPCIDeviceAddress · c36b1f7b
      Martin Kletzander 提交于
      We had both and the only difference was that the latter also included
      information about multifunction setting.  The problem with that was that
      we couldn't use functions made for only one of the structs (e.g.
      parsing).  To consolidate those two structs, use the one in virpci.h,
      include that in domain_conf.h and add the multifunction member in it.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      c36b1f7b
  18. 25 4月, 2016 1 次提交
    • L
      qemu: fix error log in qemuAssignPCIAddresses() · ff212622
      Laine Stump 提交于
      This error message was too specific, based on the incorrect assumption
      that any error was cause by auto-added bridges:
      
        failed to create PCI bridge on bus 2: too many devices
        with fixed addresses
      
      In practice you can't know if a bridge with an index <= the bus it's
      connecting to was added automatically, or if it was a mistake in
      explicit config, and the auto-add problem is going to be dealt with in
      a different way in an upcoming patch. The new message is this:
      
        PCI Controller at index 1 (0x01) has "
        bus='0x02', but bus must be <= index
      
      (note that index is given in both decimal and hex because it is
      formatted as decimal in the XML, but bus is formatted as hex, and
      displaying the hex value of index makes it easier to see the problem
      when index > 9 (which will often be the case with PCIe, since most
      controllers only have a single port, not 32 slots as with standard
      PCI)).
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1004593
      ff212622
  19. 15 4月, 2016 7 次提交
    • L
      qemu: support new pci controller model "pcie-expander-bus" · 8b62c65d
      Laine Stump 提交于
      This is backed by the qemu device pxb-pcie, which will be available in
      qemu 2.6.0.
      
      As with pci-expander-bus (which uses qemu's pxb device), the busNr
      attribute and <node> subelement of <target> are used to set the bus_nr
      and numa_node options.
      
      During post-parse we validate that the domain's machinetype is
      q35-based (since the device shows up for 440fx-based machinetypes, but
      is unusable), as well as checking that <node> specifies a node that is
      actually configured on the guest.
      8b62c65d
    • L
      conf: new pci controller model pcie-expander-bus · bc07251f
      Laine Stump 提交于
      This controller provides a single PCIe port on a new root. It is
      similar to pci-expander-bus, intended to provide a bus that can be
      associated with a guest-identifiable NUMA node, but is for
      machinetypes with PCIe rather than PCI (e.g. q35-based machinetypes).
      
      Aside from PCIe vs. PCI, the other main difference is that a
      pci-expander-bus has a companion pci-bridge that is automatically
      attached along with it, but pcie-expander-bus has only a single port,
      and that port will only connect to a pcie-root-port, or to a
      pcie-switch-upstream-port. In order for the bus to be of any use in
      the guest, it must have either a pcie-root-port or a
      pcie-switch-upstream-port attached (and one or more
      pcie-switch-downstream-ports attached to the
      pcie-switch-upstream-port).
      bc07251f
    • L
      qemu: support new pci controller model "pci-expander-bus" · 400b2976
      Laine Stump 提交于
      This is backed by the qemu device "pxb".
      
      The pxb device always includes a pci-bridge that is at the bus number
      of the pxb + 1.
      
      busNr and <node> from the <target> subelement are used to set the
      bus_nr and numa_node options for pxb.
      
      During post-parse we validate that the domain's machinetype is
      440fx-based (since the pxb device only works on 440fx-based machines),
      and <node> also gets a sanity check to assure that the NUMA node
      specified for the pxb (if any - it's optional) actually exists on the
      guest.
      400b2976
    • L
      conf: new pci controller model pci-expander-bus · 52f3d0a4
      Laine Stump 提交于
      This is a standard PCI root bus (not a bridge) that can be added to a
      440fx-based domain. Although it uses a PCI slot, this is *not* how it
      is connected into the PCI bus hierarchy, but is only used for
      control. Each pci-expander-bus provides 32 slots (0-31) that can
      accept hotplug of standard PCI devices.
      
      The usefulness of pci-expander-bus relative to a pci-bridge is that
      the NUMA node of the bus can be specified with the <node> subelement
      of <target>. This gives guest-side visibility to the NUMA node of
      attached devices (presuming that management apps only assign a device
      to a bus that has a NUMA node number matching the node number of the
      device on the host).
      
      Each pci-expander-bus also has a "busNr" attribute. The expander-bus
      itself will take the busNr specified, and all buses that are connected
      to this bus (including the pci-bridge that is automatically added to
      any expander bus of model "pxb" (see the next commit)) will use
      busNr+1, busNr+2, etc, and the pci-root (or the expander-bus with next
      lower busNr) will use bus numbers lower than busNr.
      52f3d0a4
    • L
      qemu: set PCI controller default modelName in a separate function · 1da28473
      Laine Stump 提交于
      Since every PCI controller model has to have a default model name set,
      put it in a separate function to clean up qemuDomainAssignPCIAddresses
      a bit.
      1da28473
    • L
      conf: utility function to convert PCI controller model into connect type · a0616ee8
      Laine Stump 提交于
      There are two places in qemu_domain_address.c where we have a switch
      statement to convert PCI controller models
      (VIR_DOMAIN_CONTROLLER_MODEL_PCI*) into the connection type flag that
      is matched when looking for an upstream connection for that model of
      controller (VIR_PCI_CONNECT_TYPE_*). This patch makes a utility
      function in conf/domain_addr.c to do that, so that when a new PCI
      controller is added, we only need to add the new model-->connect-type
      in a single place.
      a0616ee8
    • L
      conf/qemu: change the way VIR_PCI_CONNECT_TYPE_* flags work · d1cc4605
      Laine Stump 提交于
      The flags used to determine which devices could be plugged into which
      controllers were quite confusing, as they tried to create classes of
      connections, then put particular devices into possibly multiple
      classes, while sometimes setting multiple flags for the controllers
      themselves. The attempt to have a single flag indicate, e.g. that a
      root-port or a switch-downstream-port could connect was not only
      confusing, it was leading to a situation where it would be impossible
      to specify exactly the right combinations for a new controller.
      
      The solution is for the VIR_PCI_CONNECT_TYPE_* flags to have a 1:1
      correspondence with each type of PCI controller, plus a flag for a PCI
      endpoint device and another for a PCIe endpoint device (the only
      exception to this is that pci-bridge and pcie-expander-bus controllers
      have their upstream connection classified as
      VIR_PCI_CONNECT_TYPE_PCI_DEVICE since they can be plugged into
      *exactly* the same ports as any endpoint device).  Each device then
      has a single flag for connect type (plus the HOTPLUG flag if that
      device can e hotplugged), and each controller sets the CONNECT bits
      for all controllers that can be plugged into it, as well as for either
      type of endpoint device that can be plugged in (and the HOTPLUG flag
      if it can accept hotplugged devices).
      
      With this change, it is *slightly* easier to understand the matching
      of connections (as long as you remember that the flag for a
      device/upstream-facing connection of a controller is the same as that
      device's type, while the flags for a controller's downstream
      connections is the OR of all device types that can be plugged into
      that controller). More importantly, it will be possible to correctly
      specify what can be plugged into a pcie-switch-expander-bus, when
      support for it is added.
      d1cc4605