1. 09 5月, 2019 2 次提交
  2. 18 4月, 2019 1 次提交
  3. 17 4月, 2019 6 次提交
  4. 16 4月, 2019 2 次提交
  5. 13 4月, 2019 2 次提交
  6. 10 4月, 2019 1 次提交
  7. 03 4月, 2019 8 次提交
  8. 27 3月, 2019 4 次提交
  9. 22 3月, 2019 5 次提交
    • E
      snapshot: Rename file for virDomainMomentObj · 5d23cd1c
      Eric Blake 提交于
      Now that we have made virDomainMomentObj sufficiently generic to
      support both snapshots and checkpoints, it is time to rename the file
      that it lives in. The split between a generic object and a list of the
      generic objects doesn't buy us as much, so it will be easier to stick
      all the moment list code in one file, with more code moving in the
      next patch.  The changes during the move are fairly minor, although it
      is worth pointing out that the log/error messages for the new file
      report that they are from "domain", since the file will eventually be
      shared by both "domain snapshot" and "domain checkpoint".
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
      5d23cd1c
    • 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: 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: Add accessor for reparenting snapshot children · ced0898f
      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 starts the task with a single new function:
      virDomainSnapshotMoveChildren(). The logic might not be immediately
      obvious [okay, that's an understatement - the existing code uses black
      magic ;-)], so here's an overview: The old code has an implicit for
      loop around each call to qemuDomainSnapshotReparentChildren() by using
      virDomainSnapshotForEachChild() (you'll need a wider context than
      git's default of 3 lines to see that); the new code has a more visible
      for loop. Then it helps if you realize that the code is making two
      separate changes to each child object: STRDUP of the new parent name
      prior to writing XML files (unchanged), and touching up the pointer to
      the parent object (refactored); the end result is the same whether a
      single pass made both changes (both in driver code), or whether it is
      split into two passes making one change each (one in driver code, the
      other in the new accessor).
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
      ced0898f
    • 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
  10. 20 3月, 2019 1 次提交
    • M
      virnwfilterbindingobj: Introduce and use virNWFilterBindingObjStealDef · 8c08a997
      Michal Privoznik 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1686927
      
      When trying to create a nwfilter binding via
      nwfilterBindingCreateXML() we may encounter a crash. The sequence
      of functions called is as follows:
      
      1) nwfilterBindingCreateXML() parses the XML and calls
      virNWFilterBindingObjListAdd() which calls
      virNWFilterBindingObjListAddLocked()
      
      2) Here, @binding is not found because binding->remove is set.
      
      3) Therefore, controls continue with creating new @binding,
      setting its def to the one from 1) and adding it to the hash
      table.
      
      4) This fails, because the binding is still in the hash table
      (duplicate key is detected).
      
      5) The control jumps to 'error' label where
      virNWFilterBindingObjEndAPI() is called which frees the binding
      definition passed.
      
      6) Error is propagated to the caller, which calls
      virNWFilterBindingDefFree() over the definition again.
      
      The solution is to unset binding->def in case of failure so it's
      not freed in step 5).
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NJán Tomko <jtomko@redhat.com>
      8c08a997
  11. 19 3月, 2019 1 次提交
    • J
      storage: optional 'refresh' elemement on pool · 669018bc
      Jason Dillaman 提交于
      The new 'refresh' element can override the default refresh operations
      for a storage pool. The only currently supported override is to set
      the volume allocation size to the volume capacity. This can be specified
      by adding the following snippet:
      
      <pool>
      ...
        <refresh>
          <volume allocation='capacity'/>
        </refresh>
      ...
      </pool>
      
      This is useful for certain backends where computing the actual allocation
      of a volume might be an expensive operation.
      Signed-off-by: NJason Dillaman <dillaman@redhat.com>
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      669018bc
  12. 16 3月, 2019 2 次提交
  13. 15 3月, 2019 1 次提交
  14. 14 3月, 2019 1 次提交
  15. 13 3月, 2019 1 次提交
  16. 12 3月, 2019 1 次提交
    • M
      conf: Introduce firmware attribute to <os/> · d947fa8a
      Michal Privoznik 提交于
      The idea is that using this attribute users enable libvirt to
      automagically select firmware image for their domain. For
      instance:
      
        <os firmware='efi'>
          <type arch='x86_64' machine='pc-q35-4.0'>hvm</type>
          <loader secure='no'/>
        </os>
      
        <os firmware='bios'>
          <type arch='x86_64' machine='pc-q35-4.0'>hvm</type>
        </os>
      
      (The automagic of selecting firmware image will be described in
      later commits.)
      
      Accepted values are 'bios' and 'efi' to let libvirt select
      corresponding type of firmware.
      
      I know it is a good sign to introduce xml2xml test case when
      changing XML config parser but that will have to come later.
      Firmware auto selection is not enabled for any driver just yet so
      any xml2xml test would fail right away.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
      d947fa8a
  17. 11 3月, 2019 1 次提交