1. 16 10月, 2015 1 次提交
    • J
      qemu: Fix qemu startup check for QEMU_CAPS_OBJECT_IOTHREAD · cc2d49f9
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1249981
      
      When qemuDomainPinIOThread was added in commit id 'fb562614', a check
      for the IOThread capability was not needed since a check for iothreadpids
      covered the condition where the support for IOThreads was not present.
      The iothreadpids array was only created if qemuProcessDetectIOThreadPIDs
      was able to query the monitor for IOThreads. It would only do that if
      the QEMU_CAPS_OBJECT_IOTHREAD capability was set.
      
      However, when iothreadids were added in commit id '8d4614a5' and the
      check for iothreadpids was replaced by a search through the iothreadids[]
      array for the matching iothread_id that left open the possibility that
      an iothreadids[] array was defined, but the entries essentially pointed
      to elements with only the 'iothread_id' defined leaving the 'thread_id'
      value of 0 and eventually the cpumap entry of NULL.
      
      This was because, the original IOThreads commit id '72edaae7' only
      checked if IOThreads were defined and if the emulator had the IOThreads
      capability, then IOThread objects were added at startup. The "capability
      failure" check was only done when a disk was assigned to an IOThread in
      qemuCheckIOThreads. This was because the initial implementation had no way
      to dynamically add IOThreads, but it was possible to dynamically add a
      disk to the domain. So the decision was if the domain supported it, then
      add the IOThread objects. Then if a disk with an IOThread defined was
      added, it could check the capability and fail to add if not there. This
      just meant the 'iothreads' value was essentially ignored.
      
      Eventually commit id 'a27ed6e7' allowed for the dynamic addition and
      deletion of IOThread objects. So it was no longer necessary to generate
      IOThread objects to dynamically attach a disk to. However, the startup
      and disk check code was not modified to reflect this.
      
      This patch will move the capability failure check to when IOThread
      objects are being added to the command line. Thus a domain that has
      IOThreads defined will not be started if the emulator doesn't support
      the capability. This means when qemuCheckIOThreads is called to add
      a disk, it's no longer necessary to check the capability. Instead the
      code can use the IOThreadFind call to indicate that the IOThread
      doesn't exist.
      
      Finally because it could be possible to have a domain running with the
      iothreadids[] defined prior to this change if libvirtd is restarted each
      having mostly empty elements, qemuProcessDetectIOThreadPIDs will check
      if there are niothreadids when the QEMU_CAPS_OBJECT_IOTHREAD capability
      check fails and remove the elements and array if it exists.
      
      With these changes in place, it turns out the cputune-numatune test
      was failing because the right bit wasn't set in the test. So used the
      opportunity to fix that and create a test that would expect to fail
      with some sort of iothreads defined and used, but not having the
      correct capability.
      cc2d49f9
  2. 06 10月, 2015 3 次提交
  3. 02 10月, 2015 3 次提交
  4. 23 9月, 2015 1 次提交
    • P
      qemu: Align memory module sizes to 2MiB · 624ec1c2
      Peter Krempa 提交于
      My original implementation was based on a qemu version that still did
      not have all the checks in place. Using sizes that would align to odd
      megabyte increments will produce the following error:
      
      qemu-kvm: -device pc-dimm,node=0,memdev=memdimm0,id=dimm0: backend memory size must be multiple of 0x200000
      qemu-kvm: -device pc-dimm,node=0,memdev=memdimm0,id=dimm0: Device 'pc-dimm' could not be initialized
      
      Introduce an alignment retrieval function for memory devices and use it
      to align the devices separately and modify a test case to verify it.
      624ec1c2
  5. 22 9月, 2015 3 次提交
  6. 08 9月, 2015 1 次提交
  7. 02 9月, 2015 1 次提交
    • J
      qemu: add udp interface support · 5c668a78
      Jonathan Toppins 提交于
      Adds a new interface type using UDP sockets, this seems only applicable
      to QEMU but have edited tree-wide to support the new interface type.
      
      The interface type required the addition of a "localaddr" (local
      address), this then maps into the following xml and qemu call.
      
      <interface type='udp'>
        <mac address='52:54:00:5c:67:56'/>
        <source address='127.0.0.1' port='11112'>
          <local address='127.0.0.1' port='22222'/>
        </source>
        <model type='virtio'/>
        <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
      </interface>
      
      QEMU call:
      	-net socket,udp=127.0.0.1:11112,localaddr=127.0.0.1:22222
      
      Notice the xml "local" entry becomes the "localaddr" for the qemu call.
      
      reference:
      http://lists.gnu.org/archive/html/qemu-devel/2011-11/msg00629.htmlSigned-off-by: NJonathan Toppins <jtoppins@cumulusnetworks.com>
      Signed-off-by: NJán Tomko <jtomko@redhat.com>
      5c668a78
  8. 24 8月, 2015 1 次提交
  9. 10 8月, 2015 11 次提交
    • M
    • M
      conf: Add ioeventfd option for controllers · 35eecdde
      Martin Kletzander 提交于
      This will be used with a virtio-scsi controller later on.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      35eecdde
    • L
      qemu: support new pci controller model "pcie-switch-downstream-port" · 7d69387c
      Laine Stump 提交于
      This is backed by the qemu device xio3130-downstream. It can only be
      connected to a pcie-switch-upstream-port (x3130-upstream) on the
      upstream side.
      7d69387c
    • L
      conf: new pcie-controller model "pcie-switch-downstream-port" · 76379a6e
      Laine Stump 提交于
      This controller can be connected only to a port on a
      pcie-switch-upstream-port. It provides a single hotpluggable port that
      will accept any PCI or PCIe device, as well as any device requiring a
      pcie-*-port (the only current example of such a device is the
      pcie-switch-upstream-port).
      76379a6e
    • L
      qemu: support new pci controller model "pcie-switch-upstream-port" · cb99086d
      Laine Stump 提交于
      this is backed by the qemu device x3130-upstream. It can only plug
      into a pcie-root-port or pcie-switch-downstream-port.
      cb99086d
    • L
      conf: new pci controller model "pcie-switch-upstream-port" · 38ea9515
      Laine Stump 提交于
      This controller can be connected only to a pcie-root-port or a
      pcie-switch-downstream-port (which will be added in a later patch),
      which is the reason for the new connect type
      VIR_PCI_CONNECT_TYPE_PCIE_PORT. A pcie-switch-upstream-port provides
      32 ports (slot=0 to slot=31) on the downstream side, which can only
      have pci controllers of model "pcie-switch-downstream-port" plugged
      into them, which is the reason for the other new connect type
      VIR_PCI_CONNECT_TYPE_PCIE_SWITCH.
      38ea9515
    • L
      qemu: support new pci controller model "pcie-root-port" · 16328520
      Laine Stump 提交于
      This is backed by the qemu device ioh3420.
      
      chassis and port from the <target> subelement are used to store/set the
      respective qemu device options for the ioh3420. Currently, chassis is
      set to be the index of the controller, and port is set to
      "(slot << 3) + function" (per suggestion from Alex Williamson).
      16328520
    • L
      conf: new pci controller model "pcie-root-port" · dce3b8be
      Laine Stump 提交于
      This controller can be connected (at domain startup time only - not
      hotpluggable) only to a port on the pcie root complex ("pcie-root" in
      libvirt config), hence the new connect type
      VIR_PCI_CONNECT_TYPE_PCIE_ROOT. It provides a hotpluggable port that
      will accept any PCI or PCIe device.
      
      New attributes must be added to the controller <target> subelement for
      this - chassis and port are guest-visible option values that will be
      set by libvirt with values derived from the controller's index and pci
      address information.
      dce3b8be
    • L
      qemu: implement <target chassisNr='n'/> subelement/attribute of <controller> · 18c10451
      Laine Stump 提交于
      This uses the new subelement/attribute in two ways:
      
      1) If a "pci-bridge" pci controller has no chassisNr attribute, it
      will automatically be set to the controller's index as soon as the
      controller's PCI address is known (during
      qemuDomainAssignPCIAddresses()).
      
      2) when creating the commandline for a pci-bridge device, chassisNr
      will be used to set qemu's chassis_nr option (rather than the previous
      practice of hard-coding it to the controller's index).
      18c10451
    • L
      conf: add new <target> subelement with chassisNr attribute to <controller> · 8dc88aee
      Laine Stump 提交于
      There are some configuration options to some types of pci controllers
      that are currently automatically derived from other parts of the
      controller's configuration. For example, in qemu a pci-bridge
      controller has an option that is called "chassis_nr"; up until now
      libvirt has always set chassis_nr to the index of the pci-bridge. So
      this:
      
        <controller type='pci' model='pci-bridge' index='2'/>
      
      will always result in:
      
        -device pci-bridge,chassis_nr=2,...
      
      on the qemu commandline. In the future we may decide there is a better
      way to derive that option, but even in that case we will need for
      existing domains to retain the same chassis_nr they were using in the
      past - that is something that is visible to the guest so it is part of
      the guest ABI and changing it would lead to problems for migrating
      guests (or just guests with very picky OSes).
      
      The <target> subelement has been added as a place to put the new
      "chassisNr" attribute that will be filled in by libvirt when it
      auto-generates the chassisNr; it will be saved in the config, then
      reused any time the domain is started:
      
        <controller type='pci' model='pci-bridge' index='2'>
          <model type='pci-bridge'/>
          <target chassisNr='2'/>
        </controller>
      
      The one oddity of all this is that if the controller configuration
      is changed (for example to change the index or the pci address
      where the controller is plugged in), the items in <target> will
      *not* be re-generated, which might lead to conflict. I can't
      really see any way around this, but fortunately if there is a
      material conflict qemu will let us know and we will pass that on
      to the user.
      8dc88aee
    • L
      conf: add new <model> subelement with name attribute to <controller> · bf202510
      Laine Stump 提交于
      This new subelement is used in PCI controllers: the toplevel
      *attribute* "model" of a controller denotes what kind of PCI
      controller is being described, e.g. a "dmi-to-pci-bridge",
      "pci-bridge", or "pci-root". But in the future there will be different
      implementations of some of those types of PCI controllers, which
      behave similarly from libvirt's point of view (and so should have the
      same model), but use a different device in qemu (and present
      themselves as a different piece of hardware in the guest). In an ideal
      world we (i.e. "I") would have thought of that back when the pci
      controllers were added, and used some sort of type/class/model
      notation (where class was used in the way we are now using model, and
      model was used for the actual manufacturer's model number of a
      particular family of PCI controller), but that opportunity is long
      past, so as an alternative, this patch allows selecting a particular
      implementation of a pci controller with the "name" attribute of the
      <model> subelement, e.g.:
      
        <controller type='pci' model='dmi-to-pci-bridge' index='1'>
          <model name='i82801b11-bridge'/>
        </controller>
      
      In this case, "dmi-to-pci-bridge" is the kind of controller (one that
      has a single PCIe port upstream, and 32 standard PCI ports downstream,
      which are not hotpluggable), and the qemu device to be used to
      implement this kind of controller is named "i82801b11-bridge".
      
      Implementing the above now will allow us in the future to add a new
      kind of dmi-to-pci-bridge that doesn't use qemu's i82801b11-bridge
      device, but instead uses something else (which doesn't yet exist, but
      qemu people have been discussing it), all without breaking existing
      configs.
      
      (note that for the existing "pci-bridge" type of PCI controller, both
      the model attribute and <model> name are 'pci-bridge'. This is just a
      coincidence, since it turns out that in this case the device name in
      qemu really is a generic 'pci-bridge' rather than being the name of
      some real-world chip)
      bf202510
  10. 09 8月, 2015 1 次提交
    • L
      conf: more useful error message when pci function is out of range · f8fe8f03
      Laine Stump 提交于
      If a pci address had a function number out of range, the error message
      would be:
      
        Insufficient specification for PCI address
      
      which is logged by virDevicePCIAddressParseXML() after
      virDevicePCIAddressIsValid returns a failure.
      
      This patch enhances virDevicePCIAddressIsValid() to optionally report
      the error itself (since it is the place that decides which part of the
      address is "invalid"), and uses that feature when calling from
      virDevicePCIAddressParseXML(), so that the error will be more useful,
      e.g.:
      
        Invalid PCI address function=0x8, must be <= 7
      
      Previously, virDevicePCIAddressIsValid didn't check for the
      theoretical limits of domain or bus, only for slot or function. While
      adding log messages, we also correct that ommission. (The RNG for PCI
      addresses already enforces this limit, which by the way means that we
      can't add any negative tests for this - as far as I know our
      domainschematest has no provisions for passing XML that is supposed to
      fail).
      
      Note that virDevicePCIAddressIsValid() can only check against the
      absolute maximum attribute values for *any* possible PCI controller,
      not for the actual maximums of the specific controller that this
      device is attaching to; fortunately there is later more specific
      validation for guest-side PCI addresses when building the set of
      assigned PCI addresses. For host-side PCI addresses (e.g. for
      <hostdev> and for network device pools), we rely on the error that
      will be logged when it is found that the device doesn't actually
      exist.
      
      This resolves:
      
        https://bugzilla.redhat.com/show_bug.cgi?id=1004596
      f8fe8f03
  11. 04 8月, 2015 1 次提交
  12. 24 7月, 2015 1 次提交
  13. 20 7月, 2015 1 次提交
  14. 15 7月, 2015 1 次提交
  15. 09 7月, 2015 1 次提交
  16. 08 7月, 2015 4 次提交
  17. 01 7月, 2015 1 次提交
  18. 30 6月, 2015 1 次提交
  19. 29 6月, 2015 1 次提交
  20. 26 6月, 2015 2 次提交
    • M
      qemuBuildMemoryBackendStr: Honour passed @pagesize · 70d75ffc
      Michal Privoznik 提交于
      So far the argument has not much meaning and was practically ignored.
      This is not good since when doing memory hotplug, the size of desired
      hugepage backing is passed in that argument. Taking closer look at the
      tests I'm fixing reveals the bug. For instance, while the following is
      in the test:
      
          <memory model='dimm'>
            <source>
              <nodemask>1-3</nodemask>
              <pagesize unit='KiB'>4096</pagesize>
            </source>
            <target>
              <size unit='KiB'>524287</size>
              <node>0</node>
            </target>
            <address type='dimm' slot='0' base='0x100000000'/>
          </memory>
      
      the generated commandline corresponding to this XML was:
      
          -object memory-backend-ram,id=memdimm0,size=536870912,\
          host-nodes=1-3,policy=bind
      
      Have you noticed? Yes, memory-backend-ram! Nothing can be further away
      from the right answer. The hugepage backing is requested in the XML
      and we happily ignore it. This is just not right. It's
      memory-backend-file which should have been used:
      
          -object memory-backend-file,id=memdimm0,prealloc=yes,\
          mem-path=/dev/hugepages4M/libvirt/qemu,size=536870912,\
          host-nodes=1-3,policy=bind
      
      The problem is, that @pagesize passed to qemuBuildMemoryBackendStr
      (where this part of commandline is built) was ignored. The hugepage to
      back memory was searched only and only by NUMA nodes pinning. This
      works only for regular guest NUMA nodes.
      
      Then, I'm changing the hugepages size in the test XMLs too. This is
      simply because in the test suite we create dummy mount points just for
      2M and 1G hugepages. And in the test 4M was requested. I'm sticking to
      2M, but 1G should just work too.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      70d75ffc
    • M
      qemuBuildMemoryBackendStr: Fix hugepages lookup process · f8e9deb1
      Michal Privoznik 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1196644
      
      This function constructs the backend (host facing) part of the
      memory device.  At the beginning, the configured hugepages are
      searched to find the best match for given guest NUMA node.
      Configured hugepages can have a @nodeset attribute to specify on
      which guest NUMA nodes should be the hugepages backing used.
      There is, however, one 'corner case'. Users may just tell 'use
      hugepages to back all the nodes'. In other words:
      
        <memoryBacking>
          <hugepages/>
        </memoryBacking>
      
        <cpu>
          <numa>
            <cell id='0' cpus='0-1' memory='1024000' unit='KiB'/>
          </numa>
        </cpu>
      
      Our code fails in this case. Well, since there's no @nodeset (nor
      any <page/> child element to <hugepages/>) we fail to lookup the
      default hugepage size to use.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      f8e9deb1