1. 04 3月, 2019 5 次提交
  2. 27 2月, 2019 2 次提交
    • E
      snapshot: Permit redefine of offline external snapshot · dafef600
      Eric Blake 提交于
      Due to historical back-compat, bare 'virsh snapshot-create-as'
      favors internal snapshots (but can't be used on domains with raw
      storage), while 'virsh snapshot-create-as --disk-only' favors
      external snapshots.  What's more, snapshots created with
      --disk-only while the domain was running are marked as snapshot
      state 'disk-snapshot', while snapshots created while the domain
      was offline are marked as snapshot state 'shutdown' (a
      'disk-snapshot' image might not be quiescent, while a 'shutdown'
      snapshot always is).
      
      But this leads to some interesting problems: if we create a
      --disk-only snapshot of an offline guest, and then immediately try
      to 'virsh snapshot-create --redefine' using the resulting XML to
      overwrite the existing snapashot in place, things silently succeed,
      but 'virsh snapshot-create --redefine --disk-only' fails with an
      error message that the snapshot state is not 'disk-only'.  Worse,
      if we delete the snapshot metadata first and then try to recreate
      things, omitting --disk-only fails because the verification code
      wants to force the default of an internal snapshot (which doesn't
      work with raw disks), and using --disk-only still fails because the
      snapshot XML is not 'disk-only' - making it impossible to recreate
      the snapshot metadata (or to transfer it from one libvirtd host to
      another).  Ideally, the presence or absence of the --disk-only
      flag, and the presence or absence of an existing snapshot being
      overwritten, shouldn't matter; if the XML is valid for one
      situation, it should always be valid to redefine the metadata for
      that snapshot.
      
      Fix things by uniformly using virDomainSnapshotDefIsExternal()
      (caching the results up front, and eliminating other 'if' clauses
      now rendered redundant) when deciding whether the XML being
      requested for redefinition should permit external or force internal
      state capture (we got it right in only one out of three places in
      the function).
      
      See also https://bugzilla.redhat.com/1680304; this fixes the
      domain-agnostic problems mentioned there, but another patch is
      needed to fix further oddities with the qemu driver.  I did not
      check for sure when the problems were introduced (git blame puts
      some affected hunks as far back as 1.0.0), but it was definitely
      been broken even before when commit 670e86bf (1.1.4) factored
      redefine prep out of qemu code into the common snapshot_conf code.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
      dafef600
    • E
      snapshots: Avoid term 'checkpoint' for full system snapshot · d152c727
      Eric Blake 提交于
      Upcoming patches plan to introduce virDomainCheckpointPtr as a new
      object for use in incremental backups, along with documentation on
      how incremental backups differ from snapshots.  But first, we need
      to rename any existing mention of a 'system checkpoint' to instead
      be a 'full system snapshot', so that we aren't overloading
      the term checkpoint.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
      d152c727
  3. 25 2月, 2019 1 次提交
  4. 24 2月, 2019 1 次提交
  5. 22 2月, 2019 1 次提交
    • E
      snapshot: Saner use of uuid · c900474e
      Eric Blake 提交于
      Most of the code base is fairly consistent about using the name
      'uuidstr' when dealing with a formatted human-readable form, and
      'uuid' when dealing with the smaller raw bytes form. Fix
      snapshot_conf to comply, as well as reducing the scope of a human
      string to only the error message that needs it.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      c900474e
  6. 21 2月, 2019 1 次提交
  7. 20 2月, 2019 1 次提交
    • E
      domain: Fix unknown flags diagnosis in virDomainGetXMLDesc · 27c8fd74
      Eric Blake 提交于
      Many drivers had a comment that they did not validate the incoming
      'flags' to virDomainGetXMLDesc() because they were relying on
      virDomainDefFormat() to do it instead. This used to be the case
      (at least since 461e0f1a and friends in 0.9.4 added unknown flag
      checking in general), but regressed in commit 0ecd6851 (1.2.12),
      when all of the drivers were changed to pass 'flags' through the
      new helper virDomainDefFormatConvertXMLFlags(). Since this helper
      silently ignores unknown flags, we need to implement flag checking
      in each driver instead.
      
      Annoyingly, this means that any new flag values added will silently
      be ignored when targeting an older libvirt, rather than our usual
      practice of loudly diagnosing an unsupported flag.  Add comments
      in domain_conf.[ch] to remind us to be extra vigilant about the
      impact when adding flags (a new flag to add data is safe if the
      older server omitting the requested data doesn't break things in
      the newer client; a new flag to suppress data rather than enhancing
      the existing VIR_DOMAIN_XML_SECURE may form a data leak or even a
      security hole).
      
      In the qemu driver, there are multiple callers all funnelling to
      qemuDomainDefFormatBufInternal(); many of them already validated
      flags (and often only a subset of the full set of possible flags),
      but for ease of maintenance, we can also check flags at the common
      helper function.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
      27c8fd74
  8. 19 2月, 2019 1 次提交
  9. 18 2月, 2019 3 次提交
  10. 15 2月, 2019 7 次提交
  11. 13 2月, 2019 2 次提交
  12. 12 2月, 2019 9 次提交
  13. 07 2月, 2019 1 次提交
  14. 04 2月, 2019 4 次提交
  15. 02 2月, 2019 1 次提交