1. 15 7月, 2015 2 次提交
  2. 08 7月, 2015 7 次提交
  3. 01 7月, 2015 1 次提交
  4. 30 6月, 2015 3 次提交
  5. 27 6月, 2015 2 次提交
    • L
      qemu: always permit PCI devices to be manually assigned to a PCIe bus · 1e15be1b
      Laine Stump 提交于
      When support for the pcie-root and dmi-to-pci-bridge buses on a Q35
      machinetype was added, I was concerned that even though qemu at the
      time allowed plugging a PCI device into a PCIe port, that it might not
      be supported in the future. To prevent painful backtracking in the
      possible future where this happened, I disallowed such connections
      except in a few specific cases requested by qemu developers (indicated
      in the code with the flag VIR_PCI_CONNECT_TYPE_EITHER_IF_CONFIG).
      
      Now that a couple years have passed, there is a clear message from
      qemu that there is no danger in allowing PCI devices to be plugged
      into PCIe ports. This patch eliminates
      VIR_PCI_CONNECT_TYPE_EITHER_IF_CONFIG and changes the code to always
      allow PCI->PCIe or PCIe->PCI connection *when the PCI address is
      specified in the config. (For newly added devices that haven't yet
      been given a PCI address, the auto-placement still prefers using the
      correct type of bus).
      1e15be1b
    • L
      qemu: refactor qemuBuildControllerDevStr to eliminate future duplicate code · 1074fc50
      Laine Stump 提交于
      The PCI case of the switch statement in this function contains another
      switch statement with a case for each model. Currently every model
      except pci-root and pcie-root has a check for index > 0 (since only
      those two can have index==0), and the function should never be called
      for those two anyway. If we move the check for !pci[e]-root to the top
      of the pci case, then we can move the check for index > 0 out of the
      individual model cases. This will save repeating that check for the
      three new controller models about to be added.
      1074fc50
  6. 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
  7. 24 6月, 2015 1 次提交
  8. 18 6月, 2015 5 次提交
  9. 15 6月, 2015 2 次提交
  10. 12 6月, 2015 3 次提交
  11. 11 6月, 2015 1 次提交
  12. 09 6月, 2015 1 次提交
  13. 01 6月, 2015 2 次提交
  14. 29 5月, 2015 1 次提交
    • J
      Allocate priv->vioserialaddrs unconditionally · 0a2581a1
      Ján Tomko 提交于
      When attempting to hotplug a virtio-serial console to a domain
      that had no virtio-serial controllers (not even those that
      are added by libvirt when some devices need them) at daemon startup,
      report a user-friendly error:
      
      error: Failed to attach device from console.xml
      error: internal error: no virtio-serial controllers are available
      
      instead of crashing the daemon:
      
      Process terminating with default action of signal 11 (SIGSEGV): dumping core
       Access not within mapped region at address 0x8
         at 0x531028F: virDomainVirtioSerialAddrNext (domain_addr.c:916)
         by 0x531028F: virDomainVirtioSerialAddrAssign (domain_addr.c:1029)
         by 0x1CBF68: qemuDomainAttachChrDevice (qemu_hotplug.c:1565)
         by 0x1BCD5E: qemuDomainAttachDeviceLive (qemu_driver.c:7997)
         by 0x1BCD5E: qemuDomainAttachDeviceFlags (qemu_driver.c:8743)
      
      Introduced in v1.2.14-30-g59033788.
      0a2581a1
  15. 26 5月, 2015 1 次提交
    • J
      qemu: Resolve Coverity RESOURCE_LEAK · 2f9f7b5f
      John Ferlan 提交于
      Recent changes to the -M/--machine processing code in qemuParseCommandLine
      caused Coverity to determine there was a possible resource leak with how
      the 'list' is managed. Rather than try to add virStringFreeList calls
      everywhere - just promote list to the top of the variables and free it
      within the error processing code. Also required a couple of other tweaks
      in order to avoid double free's.
      2f9f7b5f
  16. 21 5月, 2015 1 次提交
  17. 20 5月, 2015 1 次提交
  18. 18 5月, 2015 1 次提交
  19. 16 5月, 2015 3 次提交
    • L
      qemu: log error when domain has an unsupported IDE controller · eadd757c
      Laine Stump 提交于
      We have previously effectively ignored all <controller type='ide'>
      elements in a domain definition.
      
      On the i440fx-based machinetypes there is an IDE controller that is
      included in the chipset and can't be removed (which is the ide
      controller with index='0'>), so it makes sense to ignore that one
      controller. However, if an i440fx domain definition has a 2nd
      controller, nothing catches this error (unless you also have a disk
      attached to it, in which case qemu will complain that you're trying to
      use the ide controller named "ide1", which doesn't exist), and if any
      other type of domain has even a single controller defined, it will be
      incorrectly ignored.
      
      Ignoring a bogus controller definition isn't such a big problem, as
      long as an error is logged when any disk is attached to that
      non-existent controller. But in the case of q35-based machinetypes,
      the hardcoded id ("alias" in libvirt terms) of its builtin SATA
      controller is "ide", which happens to be the same id as the builtin
      IDE controller on i440fx machinetypes. So libvirt creates a
      commandline believing that it is connecting the disk to the builtin
      (but actually nonexistent) IDE controller, qemu thinks that libvirt
      wanted that disk connected to the builtin SATA controller, and
      everybody is happy.
      
      Until you try to connect a 2nd disk to the IDE controller. Then qemu
      will complain that you're trying to set unit=1 on a controller that
      requires unit=0 (SATA controllers are organized differently than IDE
      controllers).
      
      After this patch, if a domain has an IDE controller defined for a
      machinetype that has no IDE controllers, libvirt will log an error
      about the controller itself as it is building the qemu commandline
      (rather than a (possible) error from qemu about disks attached to that
      controller). This is done by adding IDE to the list of controller
      types that are handled in the loop that creates controller command
      strings in qemuBuildCommandline() (previously it would *always* skip
      IDE controllers). Then qemuBuildControllerDevStr() is modified to log
      an appropriate error in the case of IDE controllers.
      
      In the future, if we add support for extra IDE controllers (piix3-ide
      and/or piix4-ide) we can just add it into the IDE case in
      qemuBuildControllerDevStr(). For now, nobody seems anxious to add
      extra support for an aging and very slow controller, when there are so
      many better options available.
      
      Resolves:
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1176071 (Fedora)
      eadd757c
    • L
      qemu: clean up qemuBuildCommandline loop that builds controller args · b8f345b4
      Laine Stump 提交于
      Reorganize the loop that builds controller args to remove unnecessary
      duplicated code and superfluous else clauses. No functional change.
      b8f345b4
    • L
      qemu: use controller alias when constructing device/controller args · 0260506c
      Laine Stump 提交于
      This makes sure that that the commandlines generated for devices and
      controller devices are all using the alias that has been set in the
      controller's object as the id of the controller, rather than
      hardcoding a printf (or worse, encoding exceptions to the standard
      ${controller}${index} into the logic)
      
      Since this "fixes" the controller name used for the sata controller,
      the commandline arg for the sata controller in the sata test case had
      to be adjusted to be "sata0" instead of "ahci0". All other tests
      remain unchanged, verifying that the patch causes no other functional
      change.
      
      Because the function that finds a controller alias based on a device
      def requires a pointer to the full domainDef in order to get the list
      of controllers, the arglist of a few functions had to have this added.
      0260506c