1. 05 3月, 2019 9 次提交
  2. 04 3月, 2019 21 次提交
  3. 01 3月, 2019 2 次提交
    • E
      news: More 5.1 updates · d542b454
      Eric Blake 提交于
      Mention my snapshot bug fixes, and the corresponding virsh command-line
      parse tweak I added while working on the snapshot bug fixes.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      d542b454
    • E
      qemu: Fix snapshot redefine vs. domain state bug · 3926d0aa
      Eric Blake 提交于
      The existing qemu snapshot code has a slight bug: if the domain
      is currently pmsuspended, you can't use the _REDEFINE flag even
      though the current domain state should have no bearing on being
      able to recreate metadata state; and conversely, you can use the
      _REDEFINE flag to create snapshot metadata claiming to be
      pmsuspended as a bypass to the normal restrictions that you can't
      create an original qemu snapshot in that state (the restriction
      against pmsuspend is specific to qemu, rather than part of the
      driver-agnostic snapshot_conf code).
      
      Fix this by checking the snapshot state (when redefining) instead
      of the domain state (which is a subset of snapshot states).
      
      Fixes the second problem mentioned in https://bugzilla.redhat.com/1680304Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
      3926d0aa
  4. 28 2月, 2019 7 次提交
  5. 27 2月, 2019 1 次提交
    • 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