1. 11 9月, 2019 4 次提交
    • M
      snapshot: Store both config and live XML in the snapshot domain · 152c165d
      Maxiwell S. Garcia 提交于
      The snapshot-create operation of running guests saves the live
      XML and uses it to replace the active and inactive domain in
      case of revert. So, the config XML is ignored by the snapshot
      process. This commit changes it and adds the config XML in the
      snapshot XML as the <inactiveDomain> entry.
      
      In case of offline guest, the behavior remains the same and the
      config XML is saved in the snapshot XML as <domain> entry. The
      behavior of older snapshots of running guests, that don't have
      the new <inactiveDomain>, remains the same too. The revert, in
      this case, overrides both active and inactive domain with the
      <domain> entry. So, the <inactiveDomain> in the snapshot XML is
      not required to snapshot work, but it's useful to preserve the
      config XML of running guests.
      Signed-off-by: NMaxiwell S. Garcia <maxiwell@linux.ibm.com>
      Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
      Tested-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
      Reviewed-by: NJiri Denemark <jdenemar@redhat.com>
      152c165d
    • M
      qemu: formatting XML from domain def choosing the root name · 720d9826
      Maxiwell S. Garcia 提交于
      The function virDomainDefFormatInternal() has the predefined root name
      "domain" to format the XML. But to save both active and inactive domain
      in the snapshot XML, the new root name "inactiveDomain" was created.
      So, the new function virDomainDefFormatInternalSetRootName() allows to
      choose the root name of XML. The former function became a tiny wrapper
      to call the new function setting the correct parameters.
      Signed-off-by: NMaxiwell S. Garcia <maxiwell@linux.ibm.com>
      Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
      Tested-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
      Reviewed-by: NJiri Denemark <jdenemar@redhat.com>
      720d9826
    • J
      qemu: Don't leak domain def when RevertToSnapshot fails · 33c05f8b
      Jiri Denemark 提交于
      Once we copy the domain definition from virDomainSnapshotDef, we either
      need to assign it to the domain object or free it to avoid memory leaks.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      Reviewed-by: NPavel Hrdina <phrdina@redhat.com>
      33c05f8b
    • E
      qemu: Fix regression in snapshot-revert · 4933445a
      Eric Blake 提交于
      Commit f1056279 introduced a regression: if reverting to a snapshot
      fails early (such as when we refuse to revert to an external
      snapshot), we lose track of the domain's current snapshot.
      
      Before that patch, we were tracking the notion of the domain's current
      snapshot via two means: vm->current_snapshot (which was left untouched
      on early exit) and snap->def->current (which only controls what gets
      written to XML to remember snapshots across libvirtd restarts).  That
      patch was fixing a real bug: if a revert operation failed early, later
      questions from the same libvirtd did not see any change to the current
      snapsthot, but restarting libvirtd would now claim there is no current
      snapshot.  But it fixed it in the wrong direction, in that the current
      snapshot was forgotten unconditionally, rather than only when the
      snapshot to revert to has a chance of being useful.
      
      It didn't help that the code after that patch had two separate spots
      clearing the old notion of the current snapshot - one after
      determining the snapshot to revert to was viable, the other
      unconditionally on all failure exit paths.  At any rate, the fix is
      simple: drop the unconditional cleanup on error paths, and rely only
      on the normal cleanup after early checks.
      
      Sadly, it is not possible to test this bug in the existing
      tests/virsh-snapshot, as the test driver does not have the same
      prohibition against reverting to an external snapshot as the qemu
      driver.
      
      See: https://bugzilla.redhat.com/1738747Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <20190909205242.15406-1-eblake@redhat.com>
      Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
      4933445a
  2. 10 9月, 2019 18 次提交
  3. 09 9月, 2019 15 次提交
  4. 07 9月, 2019 3 次提交