1. 18 3月, 2019 4 次提交
  2. 16 3月, 2019 1 次提交
  3. 15 3月, 2019 10 次提交
  4. 14 3月, 2019 2 次提交
  5. 13 3月, 2019 3 次提交
  6. 12 3月, 2019 9 次提交
  7. 11 3月, 2019 2 次提交
  8. 08 3月, 2019 6 次提交
    • E
      snapshot: Avoid latent use-after-free when cleaning snapshots · 44a9b872
      Eric Blake 提交于
      Right now, the only callers of qemuDomainSnapshotDiscardAllMetadata()
      are right before freeing the virDomainSnapshotObjList, so it did not
      matter if the list's metaroot (which points to all the defined root
      snapshots) is left inconsistent. But an upcoming patch will want to
      clear all snapshots if a bulk redefine fails partway through, in
      which case things must be reset.  Make this work by teaching the
      existing virDomainSnapshotUpdateRelations() to be safe regardless of
      the incoming state of the metaroot (since we don't want to leak that
      internal detail into qemu code), then fixing the qemu code to use
      it after deleting all snapshots. Additionally, the qemu code must
      reset vm->current_snapshot if the current snapshot was removed,
      regardless of whether the overall removal succeeded or failed later.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
      44a9b872
    • E
      snapshot: Give virDomainSnapshotDefFormat its own flags · c5029559
      Eric Blake 提交于
      virDomainSnapshotDefFormat currently takes two sets of knobs:
      an 'unsigned int flags' argument that can currently just be
      VIR_DOMAIN_DEF_FORMAT_SECURE, and an 'int internal' argument used as
      a bool to determine whether to output an additional element.  It
      then reuses the 'flags' knob to call into virDomainDefFormatInternal(),
      which takes a different set of flags. In fact, prior to commit 0ecd6851
      (1.2.12), the 'flags' argument actually took the public
      VIR_DOMAIN_XML_SECURE, which was even more confusing.  Let's borrow
      from the style of that earlier commit, by introducing a function
      for translating from the public flags (VIR_DOMAIN_SNAPSHOT_XML_SECURE
      was just recently introduced) into a new enum specific to snapshot
      formatting, and adjust all callers to use snapshot-specific enum
      values when formatting, and where the formatter now uses a new
      variable 'domainflags' to make it obvious when we are translating
      from snapshot flags back to domain flags.  We don't even have to
      use the conversion function for drivers that don't accept the
      public VIR_DOMAIN_SNAPSHOT_XML_SECURE flag.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
      c5029559
    • E
      qemu: Use virDomainSnapshotState for switch statements · 1ceb0e93
      Eric Blake 提交于
      Clean up the previous patch which abused switch on virDomainState
      while working with a variable containing virDomainSnapshotState, by
      converting the two affected switch statements to now use the right
      enum.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
      1ceb0e93
    • E
      snapshot: Rework virDomainSnapshotState enum · f43eb680
      Eric Blake 提交于
      The existing virDomainSnapshotState is a superset of virDomainState,
      adding one more state (disk-snapshot) on top of valid domain states.
      But as written, the enum cannot be used for gcc validation that all
      enum values are covered in a strongly-typed switch condition, because
      the enum does not explicitly include the values it is adding to.
      
      Copy the style used in qemu_blockjob.h of creating new enum names
      for every inherited value, and update most clients to use the new
      enum names anywhere snapshot state is referenced. The exception is
      two switch statements in qemu code, which instead gain a fixme
      comment about odd type usage (which will be cleaned up in the next
      patch). The rest of the patch is fairly mechanical (I actually did
      it by temporarily s/state/xstate/ in snapshot_conf.h to let the
      compiler find which spots in the code used the field, did the
      obvious search and replace in those functions, then undid the rename).
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
      f43eb680
    • E
      qemu: Const-correct snapshot directory name · 7ff982f0
      Eric Blake 提交于
      qemuDomainSnapshotWriteMetadata does not modify the directory name,
      and making it const-correct aids in writing an upcoming patch.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
      7ff982f0
    • E
      qemu: Refactor snapshot check for _LIVE vs. _REDEFINE · 8532ee4a
      Eric Blake 提交于
      The current qemu code rejects the combination of the two flags
      VIR_DOMAIN_SNAPSHOT_CREATE_LIVE in tandem with
      VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE, but rather late in the cycle
      (after the snapshot was already parsed), and with a rather confusing
      message (complaining that live snapshots require external storage,
      even if the redefined snapshot already declares external storage).
      Hoist the rejection message to occur earlier (before parsing any
      XML, which also aids upcoming patches that will implement bulk
      redefine), and with a more typical error message about mutually
      exclusive flags.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
      Reviewed-by: NJán Tomko <jtomko@redhat.com>
      8532ee4a
  9. 07 3月, 2019 3 次提交