1. 26 11月, 2016 15 次提交
  2. 25 11月, 2016 5 次提交
  3. 24 11月, 2016 2 次提交
    • R
      tests: eventtest: fix build on macOS · a4234291
      Roman Bogorodskiy 提交于
      macOS doesn't support clock_gettime(2), at least versions prior 10.12
      (I didn't actually check 10.12 though). So, use its own routines in
      eventtest.
      
       * configure.ac: check for requires symbols and define
         HAVE_MACH_CLOCK_ROUTINES if found
       * tests/eventtest.c: add clock_get_time() based implementation
      a4234291
    • R
      tests: eventtest: fix LDADD · 0d1c147f
      Roman Bogorodskiy 提交于
      Don't explicitly LDADD -lrt, use $(LIB_CLOCK_GETTIME) because
      not all platforms have clock_gettime(2) and librt available.
      0d1c147f
  4. 22 11月, 2016 3 次提交
  5. 16 11月, 2016 1 次提交
    • R
      bhyve: fix memory leaks in bhyvexml2argvtest · a6b81d55
      Roman Bogorodskiy 提交于
       * virNetDevTapCreateInBridgePort() mock: free '*ifname' before
         strdupping a hardoded value to it
       * testCompareXMLToArgvFiles(): unref 'conn' object in cleanup
       * testCompareXMLToArgvHelper(): free 'ldargs' and 'dmargs' in
         cleanup
      a6b81d55
  6. 15 11月, 2016 14 次提交
    • J
      cpu: Avoid adding <vendor> to custom CPUs · 98b7c37d
      Jiri Denemark 提交于
      Guest CPU definitions with mode='custom' and missing <vendor> are
      expected to run on a host CPU from any vendor as long as the required
      CPU model can be used as a guest CPU on the host. But even though no CPU
      vendor was explicitly requested we would sometimes force it due to a bug
      in virCPUUpdate and virCPUTranslate.
      
      The bug would effectively forbid cross vendor migrations even if they
      were previously working just fine.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      98b7c37d
    • J
      cpu: Introduce virCPUConvertLegacy API · d73422c1
      Jiri Denemark 提交于
      PPC driver needs to convert POWERx_v* legacy CPU model names into POWERx
      to maintain backward compatibility with existing domains. This patch
      adds a new step into the guest CPU configuration work flow which CPU
      drivers can use to convert legacy CPU definitions.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      d73422c1
    • J
      cputest: Don't test cpuGuestData · 509a4a40
      Jiri Denemark 提交于
      The API is no longer used anywhere else since it was replaced by a much
      saner work flow utilizing new APIs that work on virCPUDefPtr directly:
      virCPUCompare, virCPUUpdate, and virCPUTranslate.
      
      Not testing the new work flow caused some bugs to be hidden. This patch
      reveals them, but doesn't attempt to fix them. To make sure all test
      still pass after this patch, all affected test results are modified to
      pretend the tests succeeded. All of the bugs will be fixed in the
      following commits and the artificial modifications will be reverted.
      
      The following is the list of bugs in the new CPU model work flow:
      
      - a guest CPU with mode='custom' and missing <vendor/> gets the vendor
        copied from host's CPU (the vendor should only be copied to host-model
        CPUs):
          DO_TEST_UPDATE("x86", "host", "min", VIR_CPU_COMPARE_IDENTICAL)
          DO_TEST_UPDATE("x86", "host", "pentium3", VIR_CPU_COMPARE_IDENTICAL)
          DO_TEST_GUESTCPU("x86", "host-better", "pentium3", NULL, 0)
      
      - when a guest CPU with mode='custom' needs to be translated into
        another model because the original model is not supported by a
        hypervisor, the result will have its vendor set to the vendor of the
        original CPU model as specified in cpu_map.xml even if the original
        guest CPU XML didn't contain <vendor/>:
          DO_TEST_GUESTCPU("x86", "host", "guest", model486, 0)
          DO_TEST_GUESTCPU("x86", "host", "guest", models, 0)
          DO_TEST_GUESTCPU("x86", "host-Haswell-noTSX", "Haswell-noTSX",
                           haswell, 0)
      
      - legacy POWERx_v* model names are not recognized:
          DO_TEST_GUESTCPU("ppc64", "host", "guest-legacy", ppc_models, 0)
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      509a4a40
    • J
      cputest: Don't use preferred CPU model at all · adf44c7b
      Jiri Denemark 提交于
      Now that all tests pass NULL as the preferred model, we can just drop
      that test parameter.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      adf44c7b
    • J
      cputest: Don't use superfluous preferred model · 63842776
      Jiri Denemark 提交于
      In some cases preferred model doesn't really do anything since the
      result remains the same even if it is removed.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      63842776
    • J
      cputest: Don't use preferred model with forbidden fallback · 797bdced
      Jiri Denemark 提交于
      Using a preferred model for guest CPUs with forbidden fallback masks a
      bug in the code. It would just happily use another CPU model supported
      by a hypervisor even though it is explicitly forbidden in the CPU XML.
      
      This patch temporarily changes the expected result to -2, which is used
      when the result XML file cannot be found (but it was supposed not to be
      found since the tested API should have failed). The result will be
      switched back to -1 few commits later when the original bug gets fixed.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      797bdced
    • J
      cputest: Don't use unsupported preferred model · f60c5e4e
      Jiri Denemark 提交于
      Using a preferred CPU model which is not in the list of CPU models
      supported by a hypervisor does not make sense.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      f60c5e4e
    • J
      cputest: Don't use preferred model for minimum match CPUs · 43a94270
      Jiri Denemark 提交于
      Guest CPUs with match='minimum' should always be updated to match host
      CPU model. Trying to get different results by supplying preferred models
      does not make sense.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      43a94270
    • J
      cpu: Rename cpuDataFormat · 53a5986a
      Jiri Denemark 提交于
      The new name is virCPUDataFormat.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      53a5986a
    • J
      cpu: Rename cpuDataParse · be57e689
      Jiri Denemark 提交于
      The new name is virCPUDataParse.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      be57e689
    • L
      qemu: initially reserve one open pcie-root-port for hotplug · 70d15c9a
      Laine Stump 提交于
      For machinetypes with a pci-root bus (all legacy PCI), libvirt will
      make a "fake" reservation for one extra slot prior to assigning
      addresses to unaddressed PCI endpoint devices in the domain. This will
      trigger auto-adding of a pci-bridge for the final device to be
      assigned an address *if that device would have otherwise instead been
      the last device on the last available pci-bridge*; thus it assures
      that there will always be at least one slot left open in the domain's
      bus topology for expansion (which is important both for hotplug (since
      a new pci-bridge can't be added while the guest is running) as well as
      for offline additions to the config (since adding a new device might
      otherwise in some cases require re-addressing existing devices, which
      we want to avoid)).
      
      It's important to note that for the above case (legacy PCI), we must
      check for the special case of all slots on all buses being occupied
      *prior to assigning any addresses*, and avoid attempting to reserve
      the extra address in that case, because there is no free address in
      the existing topology, so no place to auto-add a pci-bridge for
      expansion (i.e. it would always fail anyway). Since that condition can
      only be reached by manual intervention, this is acceptable.
      
      For machinetypes with pcie-root (Q35, aarch64 virt), libvirt's
      methodology for automatically expanding the bus topology is different
      - pcie-root-ports are plugged into slots (soon to be functions) of
      pcie-root as needed, and the new endpoint devices are assigned to the
      single slot in each pcie-root-port. This is done so that the devices
      are, by default, hotpluggable (the slots of pcie-root don't support
      hotplug, but the single slot of the pcie-root-port does). Since
      pcie-root-ports can only be plugged into pcie-root, and we don't
      auto-assign endpoint devices to the pcie-root slots, this means
      topology expansion doesn't compete with endpoint devices for slots, so
      we don't need to worry about checking for all "useful" slots being
      free *prior* to assigning addresses to new endpoint devices - as a
      matter of fact, if we attempt to reserve the open slots before the
      used slots, it can lead to errors.
      
      Instead this patch just reserves one slot for a "future potential"
      PCIe device after doing the assignment for actual devices, but only
      if the only PCI controller defined prior to starting address
      assignment was pcie-root, and only if we auto-added at least one PCI
      controller during address assignment. This assures two things:
      
      1) that reserving the open slots will only be done when the domain is
         initially defined, never at any time after, and
      
      2) that if the user understands enough about PCI controllers that they
         are adding them manually, that we don't mess up their plan by
         adding extras - if they know enough to add one pcie-root-port, or
         to manually assign addresses such that no pcie-root-ports are
         needed, they know enough to add extra pcie-root-ports if they want
         them (this could be called the "libguestfs clause", since
         libguestfs needs to be able to create domains with as few
         devices/controllers as possible).
      
      This is set to reserve a single free port for now, but could be
      increased in the future if public sentiment goes in that direction
      (it's easy to increase later, but essentially impossible to decrease)
      70d15c9a
    • L
      qemu: try to put ich9 sound device at 00:1B.0 · 8d873a5a
      Laine Stump 提交于
      Real Q35 hardware has an ICH9 chip that includes several integrated
      devices at particular addresses (see the file docs/q35-chipset.cfg in
      the qemu source). libvirt already attempts to put the first two sets
      of ich9 USB2 controllers it finds at 00:1D.* and 00:1A.* to match the
      real hardware. This patch does the same for the ich9 "HD audio"
      device.
      
      The main inspiration for this patch is that currently the *only*
      device in a reasonable "workstation" type virtual machine config that
      requires a legacy PCI slot is the audio device, Without this patch,
      the standard Q35 machine created by virt-manager will have a
      dmi-to-pci-bridge and a pci-bridge just for the sound device; with the
      patch (and if you change the sound device model from the default
      "ich6" to "ich9"), the machine definition constructed by virt-manager
      has absolutely no legacy PCI controllers - any legacy PCI devices
      (e.g. video and sound) are on pcie-root as integrated devices.
      8d873a5a
    • 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: don't force-add a dmi-to-pci-bridge just on principle · 80723220
      Laine Stump 提交于
      Now the a dmi-to-pci-bridge is automatically added just as it's needed
      (when a pci-bridge is being added), we no longer have any need to
      force-add one to every single Q35 domain.
      80723220