1. 27 3月, 2017 7 次提交
  2. 26 3月, 2017 5 次提交
    • R
      bhyve: add xhci tablet support · daecaea0
      Roman Bogorodskiy 提交于
      Along with video and VNC support, bhyve has introduced USB tablet
      support as an input device. This tablet is exposed to a guest
      as a device on an XHCI controller.
      
      At present, tablet is the only supported device on the XHCI controller
      in bhyve, so to make things simple, it's allowed to only have a
      single XHCI controller with a single tablet device.
      
      In detail, this commit:
      
       - Introduces a new capability bit for XHCI support in bhyve
       - Adds an XHCI controller and tabled support with 1:1 mapping
         between them
       - Adds a couple of unit tests
      daecaea0
    • R
      bhyve: helper function to probe hypervisor caps · 9bf6b9df
      Roman Bogorodskiy 提交于
      There are a number of functions in bhyve_capabilities.c that probe
      hypervisor capabilities by executing the bhyve(1) binary with the
      specific device arugment, checking error message (if any) and setting
      proper capability bit. As those are extremely similar, move this logic
      into a helper function and convert existing functions to use that.
      9bf6b9df
    • R
      domaincapstest: add bhyve caps test · 74cfb5bb
      Roman Bogorodskiy 提交于
       * Extract filling bhyve capabilities from virBhyveDomainCapsBuild()
         into a new function virBhyveDomainCapsFill() to make testing
         easier by not having to mock firmware directory listing and
         hypervisor capabilities probing
       * Also, just presence of the firmware files is not sufficient
         to enable os.loader.supported, hypervisor should support UEFI
         boot too
       * Add tests to domaincapstest for the main caps possible flows:
          - when UEFI bootrom is supported
          - when video (fbus) is supported
          - neither of above is supported
      74cfb5bb
    • R
      qemu: fix build with clang · 4035baeb
      Roman Bogorodskiy 提交于
      qemuMigrationResetTLS() does not initialize 'ret' by default,
      so when it jumps to 'cleanup' on error, the 'ret' variable will be
      uninitialized, which clang complains about.
      
      Set it to '-1' by default.
      4035baeb
    • R
      virpci: fix build on non-Linux · 27a59a92
      Roman Bogorodskiy 提交于
      virPCIGetDeviceAddressFromSysfsLink() should return
      virPCIDeviceAddressPtr, so return NULL in the stub instead of "-1".
      27a59a92
  3. 25 3月, 2017 10 次提交
    • J
      qemu: Set up the migration TLS objects for source · a69e266d
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1300769
      
      If the migration flags indicate this migration will be using TLS,
      then while we have connection in the Begin phase check and setup the
      TLS environment that will be used by virMigrationRun during the Perform
      phase for the source to configure TLS.
      
      Processing adds an "-object tls-creds-x509,endpoint=client,..." and
      possibly an "-object secret,..." to handle the passphrase response.
      
      Then it sets the 'tls-creds' and possibly 'tls-hostname' migration
      parameters.
      
      The qemuMigrateCancel will clean up and reset the environment as it
      was originally found.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      a69e266d
    • J
      qemu: Set up the migration TLS objects for target · 1a6b6d9a
      John Ferlan 提交于
      If the migration flags indicate this migration will be using TLS,
      then set up the destination during the prepare phase once the target
      domain has been started to add the TLS objects to perform the migration.
      
      This will create at least an "-object tls-creds-x509,endpoint=server,..."
      for TLS credentials and potentially an "-object secret,..." to handle the
      passphrase response to access the TLS credentials. The alias/id used for
      the TLS objects will contain "libvirt_migrate".
      
      Once the objects are created, the code will set the "tls-creds" and
      "tls-hostname" migration parameters to signify usage of TLS.
      
      During the Finish phase we'll be sure to attempt to clear the
      migration parameters and delete those objects (whether or not they
      were created). We'll also perform the same reset during recovery
      if we've reached FINISH3.
      
      If the migration isn't using TLS, then be sure to check if the
      migration parameters exist and clear them if so.
      1a6b6d9a
    • J
      qemu: Add job for qemuDomain{Add|Del}TLSObjects · b9c09f80
      John Ferlan 提交于
      Add an asyncJob argument for add/delete TLS Objects. A future patch will
      add/delete TLS objects from a migration which may have a job to join.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      b9c09f80
    • J
      qemu: Add TLS params to _qemuMonitorMigrationParams · 3d06cb96
      John Ferlan 提交于
      Add the fields to support setting tls-creds and tls-hostname during
      a migration (either source or target). Modify the query migration
      function to check for the presence and set the field for future
      consumers to determine which of 3 conditions is being met (NULL,
      present and set to "", or present and sent to something). These
      correspond to qemu commit id '4af245dc3' which added support to
      default the value to "" and allow setting (or resetting) to ""
      in order to disable. This reset option allows libvirt to properly
      use the tls-creds and tls-hostname parameters.
      
      Modify code paths that either allocate or use stack space in order
      to call qemuMigrationParamsClear or qemuMigrationParamsFree for cleanup.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      3d06cb96
    • J
      Add new migration flag VIR_MIGRATE_TLS · 6a8d898d
      John Ferlan 提交于
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      6a8d898d
    • J
      qemu: Update the TLS client verify descriptions for vnc and chardev · 3f3582d6
      John Ferlan 提交于
      Update the descriptions to match the migrate option.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      3f3582d6
    • J
      conf: Introduce migrate_tls_x509_cert_dir · 1415121a
      John Ferlan 提交于
      Add a new TLS X.509 certificate type - "migrate". This will handle the
      creation of a TLS certificate capability (and possibly repository) to
      be used for migrations. Similar to chardev's, credentials will be handled
      via a libvirt secrets; however, unlike chardev's enablement and usage
      will be via a CLI flag instead of a conf flag and a domain XML attribute.
      
      The migrations using the *x509_verify flag require the client-cert.pem
      and client-key.pem files to be present in the TLS directory - so let's
      also be sure to note that in the qemu.conf file.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      1415121a
    • J
      qemu: Replace macro usage of (false); with just (0) · e3ff84ed
      John Ferlan 提交于
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      e3ff84ed
    • J
      qemu: Create #define for TLS configuration setup. · 54477976
      John Ferlan 提交于
      Create GET_CONFIG_TLS_CERT to set up the TLS for 'chardev' TLS setting.
      Soon to be reused.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      54477976
    • R
      util: fix build on non-Linux · a7496ad2
      Roman Bogorodskiy 提交于
      Fix typo in virNetDevPFGetVF() stub:
      
        ATTRUBUTE_UNUSED -> ATTRIBUTE_UNUSED.
      
      While here, use common indent style for arguments in
      virNetDevGetVirtualFunctionIndex() stub.
      a7496ad2
  4. 24 3月, 2017 13 次提交
    • P
      qemu: snapshot: Forbid internal snapshots with pflash firmware · 9e246583
      Peter Krempa 提交于
      If the variable store (<nvram>) file is raw qemu can't do a snapshot of
      it and thus the snapshot fails. QEMU rejects such snapshot by a message
      which would not be properly interpreted as an error by libvirt.
      
      Additionally allowing to use a qcow2 variable store backing file would
      solve this issue but then it would become eligible to become target of
      the memory dump.
      
      Offline internal snapshot would be incomplete too with either storage
      format since libvirt does not handle the pflash file in this case.
      
      Forbid such snapshot so that we can avoid problems.
      9e246583
    • L
      network: only check for IPv6 RA routes when the network has an IPv6 address · a1f46c71
      Laine Stump 提交于
      commit 00d28a78 added a check to see if there were any IPv6 routes
      added by RA (Router Advertisement) via an interface that had accept_ra
      set to something other than "2". The check was being done
      unconditionally, but it's only relevant if IPv6 forwarding is going to
      be turned on, and that will only happen if the network has an IPv6
      address.
      a1f46c71
    • J
      Revert "qemu: forbid migration with an IOMMU device" · da17090b
      Ján Tomko 提交于
      This reverts commit b7118623.
      
      Migration was implemented by QEMU commit:
      commit 8cdcf3c1e58d04b6811956d7608efeb66c42d719
      Author: Peter Xu <peterx@redhat.com>
      Date:   Fri Jan 6 12:06:13 2017 +0800
      
          intel_iommu: allow migration
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1433994
      da17090b
    • L
      util: new function virNetDevPFGetVF() · 554253ad
      Laine Stump 提交于
      Given an SRIOV PF netdev name (e.g. "enp2s0f0") and VF#, this new
      function returns the netdev name of the referenced VF device
      (e.g. "enp2s11f6"), or NULL if the device isn't bound to a net driver.
      554253ad
    • L
      util: new internal function to permit silent failure of virNetDevSetMAC() · f4ef3a71
      Laine Stump 提交于
      We will want to allow silent failure of virNetDevSetMAC() in the case
      that the SIOSIFHWADDR ioctl fails with errno == EADDRNOTAVAIL. (Yes,
      that is very specific, but we really *do* want a logged failure in all
      other circumstances, and don't want to duplicate code in the caller
      for the other possibilities).
      
      This patch renames the 3 different virNetDevSetMAC() functions to
      virNetDevSetMACInternal(), adding a 3rd arg called "quiet" and making
      them static (because this extra control will only be needed within
      virnetdev.c). A new global virNetDevSetMAC() is defined that calls
      whichever of the three *Internal() functions gets compiled with quiet
      = false. Callers in virnetdev.c that want to notice a failure with
      errno == EADDRNOTAVAIL and retry with a different strategy rather than
      immediately failing, can call virNetDevSetMACInternal(..., true).
      f4ef3a71
    • L
      util: new function virPCIDeviceRebind() · 251d179b
      Laine Stump 提交于
      This function unbinds a device from its driver, then immediately
      rebinds it to its driver again. The code for this new function is just
      the 2nd half of virPCIDeviceBindWithDriverOverride(), so that
      function's 2nd half is replaced with a call to virPCIDeviceRebind().
      251d179b
    • L
      util: make virPCIGetDeviceAddressFromSysfsLink() public · 9a238c16
      Laine Stump 提交于
      This function will be useful in virnetdev.c, so promote it from static.
      9a238c16
    • L
      util: change virPCIGetNetName() to not return error if device has no net name · d6ee56d7
      Laine Stump 提交于
      ...and cleanup the callers to report it when it *is* an error.
      
      In many cases It's useful for virPCIGetNetName() to not log an error
      and simply return a NULL pointer when the given device isn't bound to
      a net driver (e.g. we're looking at a VF that is permanently bound to
      vfio-pci). The existing code would silently return an error in this
      case, which could eventually lead to the dreaded "An error occurred
      but the cause is unknown" log message.
      
      This patch changes virPCIGetNetName() to still return success if the
      device simply isn't bound to a net driver, and adjusts all the callers
      that require a non-null netname to check for that condition and log an
      error when it happens.
      d6ee56d7
    • L
      util: make virMacAddrParse more versatile · 30b07a42
      Laine Stump 提交于
      Previously the MAC address text was required to be terminated with a
      NULL. After this, it can be terminated with a space or any control
      character.
      30b07a42
    • L
      util: eliminate useless local variable · 606a0133
      Laine Stump 提交于
      vf in virNetDevMacVLanDeleteWithVPortProfile() is initialized to -1
      and never set. It's not set for a good reason - because it doesn't
      make sense during macvtap device setup to refer to a VF device as
      "PF:VF#". This patch replaces the two uses of "vf" with "-1", and
      removes the local variable, so that it's more clear we are always
      calling the utility functions with vf set to -1.
      606a0133
    • L
      util: use cleanup label consistently in virHostdevNetConfigReplace() · 19c5db74
      Laine Stump 提交于
      This will make an upcoming functional change more straightforward.
      19c5db74
    • L
      util: remove unused args from virNetDevSetVfConfig() · 0a583c26
      Laine Stump 提交于
      This function is only called in two places, and the ifindex,
      nltarget_kernel, and getPidFunc args are never used (and never will
      be).
      
      ifindex - we always know the name of the device, and never know the
      ifindex - if we really did need the ifindex we would have to get it
      from the name using virNetDevGetIndex(). In practice, we just send -1
      to virNetDevSetVfConfig(), which doesn't bother to learn the real
      ifindex (you only need a name *or* an ifindex for the netlink command
      to succeed, not both).
      
      nltarget_kernel - messages to set the config of an SRIOV VF will
      always go to netlink in the kernel, not to another user process, so
      this arg is always true (there are other uses of netlink messages
      where the message might need to go to another user process, but never
      in the case of RTM_SETLINK for SRIOV).
      
      getPidFunc - this arg is only used if nltarget_kernel is false, and it
      never is.
      
      None of this has any functional effect, it just makes it easier to
      follow what's happening when virNetDevSetVfConfig() is called.
      0a583c26
    • L
      util: permit querying a VF MAC address or VLAN tag by itself · 176229dd
      Laine Stump 提交于
      virNetDevParseVfConfig() assumed that both the MAC address and VLAN
      tag pointers were valid, so even if you only wanted one or the other,
      you would need a variable to hold the returned value for both. This
      patch checks each for a NULL pointer before filling it in.
      176229dd
  5. 23 3月, 2017 5 次提交