1. 09 5月, 2019 6 次提交
  2. 07 5月, 2019 1 次提交
    • E
      conf: Add parameter to virDomainDiskSourceFormat · 1ec3e397
      Eric Blake 提交于
      Commits 4bc42986 and 218c81ea removed virDomainStorageSourceFormat on
      the grounds that there were no external callers; however, the upcoming
      backup code wants to output a <target> (push mode) or <scratch> (pull
      mode) element that is in all other respects identical to a domain's
      <source> element, where the previous virDomainStorageSourceFormat fit
      the bill nicely. But rather than reverting the commits, it's easier to
      just add an additional parameter for the element name to use, and
      update all callers.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      1ec3e397
  3. 17 4月, 2019 3 次提交
  4. 15 4月, 2019 2 次提交
    • D
      PPC64 support for NVIDIA V100 GPU with NVLink2 passthrough · 1a922648
      Daniel Henrique Barboza 提交于
      The NVIDIA V100 GPU has an onboard RAM that is mapped into the
      host memory and accessible as normal RAM via an NVLink2 bridge. When
      passed through in a guest, QEMU puts the NVIDIA RAM window in a
      non-contiguous area, above the PCI MMIO area that starts at 32TiB.
      This means that the NVIDIA RAM window starts at 64TiB and go all the
      way to 128TiB.
      
      This means that the guest might request a 64-bit window, for each PCI
      Host Bridge, that goes all the way to 128TiB. However, the NVIDIA RAM
      window isn't counted as regular RAM, thus this window is considered
      only for the allocation of the Translation and Control Entry (TCE).
      For more information about how NVLink2 support works in QEMU,
      refer to the accepted implementation [1].
      
      This memory layout differs from the existing VFIO case, requiring its
      own formula. This patch changes the PPC64 code of
      @qemuDomainGetMemLockLimitBytes to:
      
      - detect if we have a NVLink2 bridge being passed through to the
      guest. This is done by using the @ppc64VFIODeviceIsNV2Bridge function
      added in the previous patch. The existence of the NVLink2 bridge in
      the guest means that we are dealing with the NVLink2 memory layout;
      
      - if an IBM NVLink2 bridge exists, passthroughLimit is calculated in a
      different way to account for the extra memory the TCE table can alloc.
      The 64TiB..128TiB window is more than enough to fit all possible
      GPUs, thus the memLimit is the same regardless of passing through 1 or
      multiple V100 GPUs.
      
      Further reading explaining the background
      [1] https://lists.gnu.org/archive/html/qemu-devel/2019-03/msg03700.html
      [2] https://www.redhat.com/archives/libvir-list/2019-March/msg00660.html
      [3] https://www.redhat.com/archives/libvir-list/2019-April/msg00527.htmlSigned-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
      Reviewed-by: NErik Skultety <eskultet@redhat.com>
      1a922648
    • D
      qemu_domain: NVLink2 bridge detection function for PPC64 · cc9f0380
      Daniel Henrique Barboza 提交于
      The NVLink2 support in QEMU implements the detection of NVLink2
      capable devices by verifying the attributes of the VFIO mem region
      QEMU allocates for the NVIDIA GPUs. To properly allocate an
      adequate amount of memLock, Libvirt needs this information before
      a QEMU instance is even created, thus querying QEMU is not
      possible and opening a VFIO window is too much.
      
      An alternative is presented in this patch. Making the following
      assumptions:
      
      - if we want GPU RAM to be available in the guest, an NVLink2 bridge
      must be passed through;
      
      - an unknown PCI device can be classified as a NVLink2 bridge
      if its device tree node has 'ibm,gpu', 'ibm,nvlink',
      'ibm,nvlink-speed' and 'memory-region'.
      
      This patch introduces a helper called @ppc64VFIODeviceIsNV2Bridge
      that checks the device tree node of a given PCI device and
      check if it meets the criteria to be a NVLink2 bridge. This
      new function will be used in a follow-up patch that, using the
      first assumption, will set up the rlimits of the guest
      accordingly.
      Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
      cc9f0380
  5. 12 4月, 2019 1 次提交
  6. 10 4月, 2019 2 次提交
  7. 04 4月, 2019 1 次提交
  8. 03 4月, 2019 11 次提交
  9. 29 3月, 2019 3 次提交
  10. 27 3月, 2019 1 次提交
  11. 22 3月, 2019 7 次提交
    • E
      snapshot: Rename virDomainSnapshotObjPtr · e055a816
      Eric Blake 提交于
      Now that the core of SnapshotObj is agnostic to snapshots and can be
      shared with upcoming checkpoint code, it is time to rename the struct
      and the functions specific to list operations. A later patch will
      shuffle which file holds the common code. This is a fairly mechanical
      patch.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
      e055a816
    • E
      snapshot: Switch type of virDomainSnapshotObj.def · 1ab05da2
      Eric Blake 提交于
      Another step towards making the object list reusable for both
      snapshots and checkpoints: the list code only ever needs items that
      are in the common virDomainMomentDef base type. This undoes a lot of
      the churn in accessing common members added in the previous patch, and
      the bulk of the patch is mechanical. But there was one spot where I
      had to unroll a VIR_STEAL_PTR to work around changed types.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
      1ab05da2
    • E
      snapshot: Factor out virDomainMomentDef class · ffc0fbeb
      Eric Blake 提交于
      Pull out the common parts of virDomainSnapshotDef that will be reused
      for virDomainCheckpointDef into a new base class.  Adjust all callers
      that use the direct fields (some of it is churn that disappears when
      the next patch refactors virDomainSnapshotObj; oh well...).
      
      Someday, I hope to switch this type to be a subclass of virObject, but
      that requires a more thorough audit of cleanup paths, and besides
      minimal incremental changes are easier to review.
      
      As for the choice of naming:
      I promised my teenage daughter Evelyn that I'd give her credit for her
      contribution to this commit. I asked her "What would be a good name
      for a base class for DomainSnapshot and DomainCheckpoint". After
      explaining what a base class was (using the classic OOB Square and
      Circle inherit from Shape), she came up with "DomainMoment", which is
      way better than my initial thought of "DomainPointInTime" or
      "DomainPIT".
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
      ffc0fbeb
    • E
      snapshot: Access snapshot def directly when needed · 55c2ab3e
      Eric Blake 提交于
      An upcoming patch will rework virDomainSnapshotObjList to be generic
      for both snapshots and checkpoints; reduce the churn by adding a new
      accessor virDomainSnapshotObjGetDef() which returns the
      snapshot-specific definition even when the list is rewritten to
      operate only on a base class, then using it at sites that that are
      specific to snapshots.  Use VIR_STEAL_PTR when appropriate in the
      affected lines.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
      55c2ab3e
    • E
      snapshot: Add accessors for updating snapshot list relations · 02c4e24d
      Eric Blake 提交于
      Rather than allowing a leaky abstraction where multiple drivers have
      to open-code operations that update the relations in a
      virDomainSnapshotObjList, it is better to add accessor functions so
      that updates to relations are maintained closer to the internals.
      This patch finishes the job started in the previous patch, by getting
      rid of all direct access to nchildren, first_child, or sibling outside
      of the lowest level functions, making it easier to refactor later on.
      
      The lone new caller to virDomainSnapshotObjListSize() checks for a
      return != 0, because it wants to handles errors (-1, only possible if
      the hash table wasn't allocated) and existing snapshots (> 0) in the
      same manner; we can drop the check for a current snapshot on the
      grounds that there shouldn't be one if there are no snapshots.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
      02c4e24d
    • E
      snapshot: Track current snapshot in virDomainSnapshotObjList · 4819f54b
      Eric Blake 提交于
      It is easier to track the current snapshot as part of the list of
      snapshots. In particular, doing so lets us guarantee that the current
      snapshot is cleared if that snapshot is removed from the list (rather
      than depending on the caller to do so, and risking a use-after-free
      problem, such as the one recently patched in 1db9d0ef).  This
      requires the addition of several new accessor functions, as well as a
      useful return type for virDomainSnapshotObjListRemove().  A few error
      handling sites that were previously setting vm->current_snapshot =
      NULL can now be dropped, because the previous function call has now
      done it already.  Also, qemuDomainRevertToSnapshot() was setting the
      current vm twice, so keep only the one used on the success path.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
      4819f54b
    • E
      snapshot: Drop virDomainSnapshotDef.current · f1056279
      Eric Blake 提交于
      The only use for the 'current' member of virDomainSnapshotDef was with
      the PARSE/FORMAT_INTERNAL flag for controlling an internal-use
      <active> element marking whether a particular snapshot definition was
      current, and even then, only by the qemu driver on output, and by qemu
      and test driver on input. But this duplicates vm->snapshot_current,
      and gets in the way of potential simplifications to have qemu store a
      single file for all snapshots rather than one file per snapshot.  Get
      rid of the member by adding a bool* parameter during parse (ignored if
      the PARSE_INTERNAL flag is not set), and by adding a new flag during
      format (if FORMAT_INTERNAL is set, the value printed in <active>
      depends on the new FORMAT_CURRENT).
      
      Then update the qemu driver accordingly, which involves hoisting
      assignments to vm->current_snapshot to occur prior to any point where
      a snapshot XML file is written (although qemu kept
      vm->current_snapshot and snapshot->def_current in sync by the end of
      the function, they were not always identical in the middle of
      functions, so the shuffling gets a bit interesting). Later patches
      will clean up some of that confusing churn to vm->current_snapshot.
      
      Note: even if later patches refactor qemu to no longer use
      FORMAT_INTERNAL for output (by storing bulk snapshot XML instead), we
      will always need PARSE_INTERNAL for input (because on upgrade, a new
      libvirt still has to parse XML left from a previous libvirt).
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
      f1056279
  12. 20 3月, 2019 2 次提交