1. 13 3月, 2018 1 次提交
  2. 07 3月, 2018 1 次提交
  3. 22 2月, 2018 1 次提交
  4. 20 2月, 2018 2 次提交
    • D
      Fix build with GCC 8 new switch fallthrough warnings · 75f4813c
      Daniel P. Berrangé 提交于
      GCC 8 became more fussy about detecting switch
      fallthroughs. First it doesn't like it if you have
      a fallthrough attribute that is not before a case
      statement. e.g.
      
         FOO:
         BAR:
         WIZZ:
            ATTRIBUTE_FALLTHROUGH;
      
      Is unacceptable as there's no final case statement,
      so while FOO & BAR are falling through, WIZZ is
      not falling through. IOW, GCC wants us to write
      
        FOO:
        BAR:
          ATTRIBUTE_FALLTHROUGH;
        WIZZ:
      
      Second, it will report risk of fallthrough even if you
      have a case statement for every single enum value, but
      only if the switch is nested inside another switch and
      the outer case statement has no final break. This is
      is arguably valid because despite the fact that we have
      cast from "int" to the enum typedef, nothing guarantees
      that the variable we're switching on only contains values
      that have corresponding switch labels. e.g.
      
         int domstate = 87539319;
         switch ((virDomainState)domstate) {
            ...
         }
      
      will not match enum value, but also not raise any kind
      of compiler warning. So it is right to complain about
      risk of fallthrough if no default: is present.
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      75f4813c
    • D
      conf: add enum constants for default controller models · a302480d
      Daniel P. Berrangé 提交于
      The controller model is slightly unusual in that the default value is
      -1, not 0. As a result the default value is not covered by any of the
      existing enum cases. This in turn means that any switch() statements
      that think they have covered all cases, will in fact not match the
      default value at all. In the qemuDomainDeviceCalculatePCIConnectFlags()
      method this has caused a serious mistake where we fallthrough from the
      SCSI controller case, to the VirtioSerial controller case, and from
      the USB controller case to the IDE controller case.
      
      By adding explicit enum constant starting at -1, we can ensure switches
      remember to handle the default case.
      Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      a302480d
  5. 09 2月, 2018 1 次提交
    • D
      conf: expand network device callbacks to cover resolving NIC type · a455d41e
      Daniel P. Berrangé 提交于
      Currently the QEMU driver will call directly into the network driver
      impl to modify resolve the atual type of NICs with type=network. It
      has todo this before it has allocated the actual NIC. This introduces
      a callback system to allow us to decouple the QEMU driver from the
      network driver.
      
      This is a short term step, as it ought to be possible to achieve the
      same end goal by simply querying XML via the public network API. The
      QEMU code in question though, has no virConnectPtr conveniently
      available at this time.
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      a455d41e
  6. 01 2月, 2018 6 次提交
    • J
      qemu: Update qemuDomainFindSCSIControllerModel return · 5b5bff35
      John Ferlan 提交于
      Now that the controller model is updated during post parse callback,
      this code no longer needs to fetch the model based on the capabilities
      and can just return the model directly if the controller is found.
      
      Removal of @qemuCaps cascades through various callers which are now
      updated to not pass the capabilities.
      5b5bff35
    • J
      qemu: Reduce need to call qemuDomainGetSCSIControllerModel · de8fac5f
      John Ferlan 提交于
      Now that post parse processing handles setting the SCSI controller
      model, there's no need to call qemuDomainGetSCSIControllerModel to
      get the "default controller" when building the command line controller
      string or when assigning the spaprvio address since the controller
      model value will already be filled in.
      de8fac5f
    • J
      qemu: Introduce qemuDomainSetSCSIControllerModel · 62f8c947
      John Ferlan 提交于
      During post parse processing, let's force setting the controller
      model to default value if not already set for defined controllers
      (e.g. the non implicit ones).
      62f8c947
    • J
      qemu: Introduce qemuDomainGetSCSIControllerModel · fadfb4f9
      John Ferlan 提交于
      Rename and rework qemuDomainSetSCSIControllerModel since we're
      really not setting the SCSI controller model. Instead the code
      is either returning the existing SCSI controller model value, the
      default value based on the capabilities, or -1 with the error set.
      fadfb4f9
    • J
      qemu: Introduce qemuDomainFindSCSIControllerModel · 6ae6ffd8
      John Ferlan 提交于
      Rather than repeat multiple steps in order to find the SCSI
      controller model, let's combine them into one helper that will
      return either the model from the definition or the default
      model based on the capabilities.
      
      This patch adds an extra check/error that the controller
      that's being found actually exists. This just clarifies that
      the error was because the controller doesn't exist rather
      than the more generic error that we were unable to determine
      the model from qemuDomainSetSCSIControllerModel when a -1
      was passed in and the capabilities were unable to find one.
      6ae6ffd8
    • J
      qemu: Split qemuDomainSetSCSIControllerModel · e37540f4
      John Ferlan 提交于
      Rather than one function serving two purposes, let's split out the
      else condition which is checking whether the model can be used
      during command line building based on the capabilities.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      e37540f4
  7. 21 1月, 2018 1 次提交
    • L
      qemu: assign correct type of PCI address for vhost-scsi when using pcie-root · 18c24bc6
      Laine Stump 提交于
      Commit 10c73bf1 fixed a bug that I had introduced back in commit
      70249927 - if a vhost-scsi device had no manually assigned PCI
      address, one wouldn't be assigned automatically. There was a slight
      problem with the logic of the fix though - in the case of domains with
      pcie-root (e.g. those with a q35 machinetype),
      qemuDomainDeviceCalculatePCIConnectFlags() will attempt to determine
      if the host-side PCI device is Express or legacy by examining sysfs
      based on the host-side PCI address stored in
      hostdev->source.subsys.u.pci.addr, but that part of the union is only
      valid for PCI hostdevs, *not* for SCSI hostdevs. So we end up trying
      to read sysfs for some probably-non-existent device, which fails, and
      the function virPCIDeviceIsPCIExpress() returns failure (-1).
      
      By coincidence, the return value is being examined as a boolean, and
      since -1 is true, we still end up assigning the vhost-scsi device to
      an Express slot, but that is just by chance (and could fail in the
      case that the gibberish in the "hostside PCI address" was the address
      of a real device that happened to be legacy PCI).
      
      Since (according to Paolo Bonzini) vhost-scsi devices appear just like
      virtio-scsi devices in the guest, they should follow the same rules as
      virtio devices when deciding whether they should be placed in an
      Express or a legacy slot. That's accomplished in this patch by
      returning early with virtioFlags, rather than erroneously using
      hostdev->source.subsys.u.pci.addr. It also adds a test case for PCIe
      to assure it doesn't get broken in the future.
      18c24bc6
  8. 14 12月, 2017 1 次提交
    • J
      qemu: Need to assign PCI address to vhost-scsi · 10c73bf1
      John Ferlan 提交于
      Commit id '70249927' neglected to cover this case because the test
      had taken the "shortcut" to already add the <address>; however, when
      the PCI address assignment code was adjusted by commit id '70249927'
      the vhost-scsi (VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI_HOST) wasn't
      covered thus returning a 0 for pciFlags. So I altered the tests too
      to make sure it doesn't happen again.
      
      Previously the qemuxml2xmloutdata was a softlink to the source
      qemuxml2argvdata, so I unlinked and recreated the output file to
      force generation of the adddress. Without the test changes, an
      address generation returns:
      
          libvirt: Domain Config error : internal error: Cannot automatically
          add a new PCI bus for a device with connect flags 00
      
      if an address was supplied in the test, a restart of libvirtd or
      edit of a guest would display the following opaque message:
      
          warning : qemuDomainCollectPCIAddress:1237 :
          qemuDomainDeviceCalculatePCIConnectFlags() thinks that the device
           with PCI address 0000:00:09.0 should not have a PCI address
      
      where the address is related to the guest PCI address provided.
      10c73bf1
  9. 28 11月, 2017 5 次提交
  10. 19 10月, 2017 2 次提交
  11. 16 10月, 2017 1 次提交
  12. 11 10月, 2017 1 次提交
  13. 05 9月, 2017 1 次提交
  14. 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
  15. 25 8月, 2017 1 次提交
  16. 25 7月, 2017 1 次提交
  17. 18 7月, 2017 2 次提交
  18. 15 7月, 2017 4 次提交
  19. 13 6月, 2017 1 次提交
  20. 28 4月, 2017 2 次提交
  21. 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
  22. 27 3月, 2017 1 次提交
  23. 17 3月, 2017 1 次提交
  24. 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