1. 20 6月, 2019 1 次提交
  2. 27 3月, 2019 1 次提交
    • E
      snapshot: Various doc tweaks · 1c6b6c0b
      Eric Blake 提交于
      Since I was copying this text to form checkpoint XML and API
      documentation, I might as well make improvements along the way. Most
      of these changes are based on reviews of the checkpoint docs.
      
      Among other things: grammar tweaks, point to a single source of
      documentation rather than repeating verbosity, reword things for
      easier legibility.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
      1c6b6c0b
  3. 15 3月, 2019 1 次提交
    • E
      snapshot: More clarification about REDEFINE · a6a25d5c
      Eric Blake 提交于
      Based on recent list questions about the proposed addition of
      virDomainCheckpointCreateXML(REDEFINE), it is worth adding some
      clarification to the existing snapshot redefine documentation that is
      serving as the basis for checkpoints.
      
      Normal snapshot creation requires very few elements from the user XML
      (libvirt can pick sane defaults for items that are omitted, and many
      fields, including <domain>, are documented as readonly output fields
      ignored on input, produced by drivers that track it). But during
      REDEFINE, the API wants the complete XML produced by an earlier
      virDomainSnapshotGetXMLDesc; as the domain definition has likely
      changed since the snapshot was first created, libvirt is unable to
      recreate a <domain> sub-element that matches the original output
      representing the domain state at the time the snapshot was first
      created. In fact, reverting without a <domain> sub-element is risky
      enough that we had to add a FORCE flag for virDomainSnapshotRevert().
      In short, we only support omitting domain for qemu because of
      backwards-compatibility to snapshots created before 0.9.5 started
      capturing <domain>; even though there are other drivers like vbox that
      do not output <domain> because they have other reliable ways to
      revert.
      
      And based on the confusion caused when omitting <domain> from snapshot
      XML, the initial design for checkpoints in later patches will make
      <domain> a mandatory element during its REDEFINE.
      
      [Side note: the fact that <domain> can appear in <domainsnapshot> is a
      reason we cannot add a new API for a bulk listing or redefine of all
      snapshots of a single domain in one XML call (for example, a 1M
      <domain> XML * 16 snapshots explodes into 16M in a bulk form, which
      gets difficult to send over RPC). Perhaps we could add a flag to
      request that the <domain> sub-element be omitted on output, but such
      output is no longer suitable for sane REDEFINE input.]
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
      a6a25d5c
  4. 27 2月, 2019 1 次提交
  5. 03 8月, 2017 2 次提交
  6. 07 6月, 2017 1 次提交
  7. 11 11月, 2016 1 次提交
  8. 25 4月, 2016 1 次提交
    • A
      syntax-check: Enforce <code> inside <dt> elements · 1f29f3da
      Andrea Bolognani 提交于
      Commit 61b070cf cleaned up a number of cases where the <dt>
      element was used to document symbols, but the symbol itself was
      not inside a <code> element.
      
      To make sure we don't end up having to clean up again a few
      months from now, introduce a syntax-check rule that can spot
      such mistakes.
      
      All existing exceptions are marked as such, with either file
      or line granularity depending on the case.
      1f29f3da
  9. 13 4月, 2015 1 次提交
  10. 14 7月, 2014 1 次提交
  11. 14 2月, 2014 1 次提交
  12. 29 1月, 2014 1 次提交
    • P
      snapshot: Add support for specifying snapshot disk backing type · 7076b4b7
      Peter Krempa 提交于
      Add support for specifying various types when doing snapshots. This will
      later allow to do snapshots on network backed volumes. Disks of type
      'volume' are not supported by snapshots (yet).
      
      Also amend the test suite to check parsing of the various new disk
      types that can now be specified.
      7076b4b7
  13. 03 5月, 2013 1 次提交
    • D
      Fix multiple formatting problems in HTML docs · f2f9742d
      Daniel P. Berrange 提交于
      The rule generating the HTML docs passing the --html flag
      to xsltproc. This makes it use the legacy HTML parser, which
      either ignores or tries to fix all sorts of broken XML tags.
      There's no reason why we should be writing broken XML in
      the first place, so removing --html and adding the XHTML
      doctype to all files forces us to create good XML.
      
      This adds the XHTML doc type and fixes many, many XML tag
      problems it exposes.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      f2f9742d
  14. 02 5月, 2013 1 次提交
  15. 26 4月, 2013 1 次提交
  16. 02 11月, 2012 1 次提交
    • E
      snapshot: new XML for external system checkpoint · 4201a7ea
      Eric Blake 提交于
      Each <domainsnapshot> can now contain an optional <memory>
      element that describes how the VM state was handled, similar
      to disk snapshots.  The new element will always appear in
      output; for back-compat, an input that lacks the element will
      assume 'no' or 'internal' according to the domain state.
      
      Along with this change, it is now possible to pass <disks> in
      the XML for an offline snapshot; this also needs to be wired up
      in a future patch, to make it possible to choose internal vs.
      external on a per-disk basis for each disk in an offline domain.
      At that point, using the --disk-only flag for an offline domain
      will be able to work.
      
      For some examples below, remember that qemu supports the
      following snapshot actions:
      
      qemu-img: offline external and internal disk
      savevm: online internal VM and disk
      migrate: online external VM
      transaction: online external disk
      
      =====
      <domainsnapshot>
        <memory snapshot='no'/>
        ...
      </domainsnapshot>
      
      implies that there is no VM state saved (mandatory for
      offline and disk-only snapshots, not possible otherwise);
      using qemu-img for offline domains and transaction for online.
      
      =====
      <domainsnapshot>
        <memory snapshot='internal'/>
        ...
      </domainsnapshot>
      
      state is saved inside one of the disks (as in qemu's 'savevm'
      system checkpoint implementation).  If needed in the future,
      we can also add an attribute pointing out _which_ disk saved
      the internal state; maybe disk='vda'.
      
      =====
      <domainsnapshot>
        <memory snapshot='external' file='/path/to/state'/>
        ...
      </domainsnapshot>
      
      This is not wired up yet, but future patches will allow this to
      control a combination of 'virsh save /path/to/state' plus disk
      snapshots from the same point in time.
      
      =====
      
      So for 1.0.1 (and later, as needed), I plan to implement this table
      of combinations, with '*' designating new code and '+' designating
      existing code reached through new combinations of xml and/or the
      existing DISK_ONLY flag:
      
      domain  memory  disk   disk-only | result
      -----------------------------------------
      offline omit    omit   any       | memory=no disk=int, via qemu-img
      offline no      omit   any       |+memory=no disk=int, via qemu-img
      offline omit/no no     any       | invalid combination (nothing to snapshot)
      offline omit/no int    any       |+memory=no disk=int, via qemu-img
      offline omit/no ext    any       |*memory=no disk=ext, via qemu-img
      offline int/ext any    any       | invalid combination (no memory to save)
      online  omit    omit   off       | memory=int disk=int, via savevm
      online  omit    omit   on        | memory=no disk=default, via transaction
      online  omit    no/ext off       | unsupported for now
      online  omit    no     on        | invalid combination (nothing to snapshot)
      online  omit    ext    on        | memory=no disk=ext, via transaction
      online  omit    int    off       |+memory=int disk=int, via savevm
      online  omit    int    on        | unsupported for now
      online  no      omit   any       |+memory=no disk=default, via transaction
      online  no      no     any       | invalid combination (nothing to snapshot)
      online  no      int    any       | unsupported for now
      online  no      ext    any       |+memory=no disk=ext, via transaction
      online  int/ext any    on        | invalid combination (disk-only vs. memory)
      online  int     omit   off       |+memory=int disk=int, via savevm
      online  int     no/ext off       | unsupported for now
      online  int     int    off       |+memory=int disk=int, via savevm
      online  ext     omit   off       |*memory=ext disk=default, via migrate+trans
      online  ext     no     off       |+memory=ext disk=no, via migrate
      online  ext     int    off       | unsupported for now
      online  ext     ext    off       |*memory=ext disk=ext, via migrate+transaction
      
      * docs/schemas/domainsnapshot.rng (memory): New RNG element.
      * docs/formatsnapshot.html.in: Document it.
      * src/conf/snapshot_conf.h (virDomainSnapshotDef): New fields.
      * src/conf/domain_conf.c (virDomainSnapshotDefFree)
      (virDomainSnapshotDefParseString, virDomainSnapshotDefFormat):
      Manage new fields.
      * tests/domainsnapshotxml2xmltest.c: New test.
      * tests/domainsnapshotxml2xmlin/*.xml: Update existing tests.
      * tests/domainsnapshotxml2xmlout/*.xml: Likewise.
      4201a7ea
  17. 05 9月, 2011 3 次提交
    • E
      snapshot: also support disks by path · 89b6284f
      Eric Blake 提交于
      I got confused when 'virsh domblkinfo dom disk' required the
      path to a disk (which can be ambiguous, since a single file
      can back multiple disks), rather than the unambiguous target
      device name that I was using in disk snapshots.  So, in true
      developer fashion, I went for the best of both worlds - all
      interfaces that operate on a disk (aka block) now accept
      either the target name or the unambiguous path to the backing
      file used by the disk.
      
      * src/conf/domain_conf.h (virDomainDiskIndexByName): Add
      parameter.
      (virDomainDiskPathByName): New prototype.
      * src/libvirt_private.syms (domain_conf.h): Export it.
      * src/conf/domain_conf.c (virDomainDiskIndexByName): Also allow
      searching by path, and decide whether ambiguity is okay.
      (virDomainDiskPathByName): New function.
      (virDomainDiskRemoveByName, virDomainSnapshotAlignDisks): Update
      callers.
      * src/qemu/qemu_driver.c (qemudDomainBlockPeek)
      (qemuDomainAttachDeviceConfig, qemuDomainUpdateDeviceConfig)
      (qemuDomainGetBlockInfo, qemuDiskPathToAlias): Likewise.
      * src/qemu/qemu_process.c (qemuProcessFindDomainDiskByPath):
      Likewise.
      * src/libxl/libxl_driver.c (libxlDomainAttachDeviceDiskLive)
      (libxlDomainDetachDeviceDiskLive, libxlDomainAttachDeviceConfig)
      (libxlDomainUpdateDeviceConfig): Likewise.
      * src/uml/uml_driver.c (umlDomainBlockPeek): Likewise.
      * src/xen/xend_internal.c (xenDaemonDomainBlockPeek): Likewise.
      * docs/formatsnapshot.html.in: Update documentation.
      * tools/virsh.pod (domblkstat, domblkinfo): Likewise.
      * docs/schemas/domaincommon.rng (diskTarget): Tighten pattern on
      disk targets.
      * docs/schemas/domainsnapshot.rng (disksnapshot): Update to match.
      * tests/domainsnapshotxml2xmlin/disk_snapshot.xml: Update test.
      89b6284f
    • E
      snapshot: add <disks> to snapshot xml · d6f6b2d1
      Eric Blake 提交于
      Adds an optional element to <domainsnapshot>, which will be used
      to give user control over external snapshot filenames on input,
      and specify generated filenames on output.
      
      For now, no driver accepts this element; that will come later.
      
      <domainsnapshot>
        ...
        <disks>
          <disk name='vda' snapshot='no'/>
          <disk name='vdb' snapshot='internal'/>
          <disk name='vdc' snapshot='external'>
            <driver type='qcow2'/>
            <source file='/path/to/new'/>
          </disk>
        </disks>
        <domain>
          ...
          <devices>
            <disk ...>
              <driver name='qemu' type='raw'/>
              <target dev='vdc'/>
              <source file='/path/to/old'/>
            </disk>
          </devices>
        </domain>
      </domainsnapshot>
      
      * src/conf/domain_conf.h (_virDomainSnapshotDiskDef): New type.
      (_virDomainSnapshotDef): Add new elements.
      (virDomainSnapshotAlignDisks): New prototype.
      * src/conf/domain_conf.c (virDomainSnapshotDiskDefClear)
      (virDomainSnapshotDiskDefParseXML, disksorter)
      (virDomainSnapshotAlignDisks): New functions.
      (virDomainSnapshotDefParseString): Parse new fields.
      (virDomainSnapshotDefFree): Clean them up.
      (virDomainSnapshotDefFormat): Output them.
      * src/libvirt_private.syms (domain_conf.h): Export new function.
      * docs/schemas/domainsnapshot.rng (domainsnapshot, disksnapshot):
      Add more xml.
      * docs/formatsnapshot.html.in: Document it.
      * tests/domainsnapshotxml2xmlin/disk_snapshot.xml: New test.
      * tests/domainsnapshotxml2xmlout/disk_snapshot.xml: Update.
      d6f6b2d1
    • E
      snapshot: support extra state in snapshots · 5b30b08d
      Eric Blake 提交于
      In order to distinguish disk snapshots from system checkpoints, a
      new state value that is only valid for snapshots is helpful.
      
      * include/libvirt/libvirt.h.in (VIR_DOMAIN_LAST): New placeholder.
      * src/conf/domain_conf.h (virDomainSnapshotState): New enum mapping.
      (VIR_DOMAIN_DISK_SNAPSHOT): New internal enum value.
      * src/conf/domain_conf.c (virDomainState): Use placeholder.
      (virDomainSnapshotState): Extend mapping by one for use in snapshot.
      (virDomainSnapshotDefParseString, virDomainSnapshotDefFormat):
      Handle new state.
      (virDomainObjSetState, virDomainStateReasonToString)
      (virDomainStateReasonFromString): Avoid compiler warnings.
      * tools/virsh.c (vshDomainState, vshDomainStateReasonToString):
      Likewise.
      * src/libvirt_private.syms (domain_conf.h): Export new functions.
      * docs/schemas/domainsnapshot.rng: Tighten state definition.
      * docs/formatsnapshot.html.in: Document it.
      * tests/domainsnapshotxml2xmlout/disk_snapshot.xml: New test.
      5b30b08d
  18. 03 9月, 2011 2 次提交
    • E
      snapshot: allow full domain xml in snapshot · f609cb85
      Eric Blake 提交于
      Just like VM saved state images (virsh save), snapshots MUST
      track the inactive domain xml to detect any ABI incompatibilities.
      
      The indentation is not perfect, but functionality comes before form.
      
      Later patches will actually supply a full domain; for now, this
      wires up the storage to support one, but doesn't ever generate one
      in dumpxml output.
      
      Happily, libvirt.c was already rejecting use of VIR_DOMAIN_XML_SECURE
      from read-only connections, even though before this patch, there was
      no information to be secured by the use of that flag.
      
      And while we're at it, mark the libvirt snapshot metadata files
      as internal-use only.
      
      * src/libvirt.c (virDomainSnapshotGetXMLDesc): Document flag.
      * src/conf/domain_conf.h (_virDomainSnapshotDef): Add member.
      (virDomainSnapshotDefParseString, virDomainSnapshotDefFormat):
      Update signature.
      * src/conf/domain_conf.c (virDomainSnapshotDefFree): Clean up.
      (virDomainSnapshotDefParseString): Optionally parse domain.
      (virDomainSnapshotDefFormat): Output full domain.
      * src/esx/esx_driver.c (esxDomainSnapshotCreateXML)
      (esxDomainSnapshotGetXMLDesc): Update callers.
      * src/vbox/vbox_tmpl.c (vboxDomainSnapshotCreateXML)
      (vboxDomainSnapshotGetXMLDesc): Likewise.
      * src/qemu/qemu_driver.c (qemuDomainSnapshotCreateXML)
      (qemuDomainSnapshotLoad, qemuDomainSnapshotGetXMLDesc)
      (qemuDomainSnapshotWriteMetadata): Likewise.
      * docs/formatsnapshot.html.in: Rework doc example.
      Based on a patch by Philipp Hahn.
      f609cb85
    • E
      snapshot: allow recreation of metadata · af65695a
      Eric Blake 提交于
      The first two flags are essential for being able to replicate
      snapshot hierarchies across multiple hosts, which will come in
      handy for supervised migrations.  It also allows a management app
      to take a snapshot of a transient domain, save the metadata, stop
      the domain, recreate a new transient domain by the same name,
      redefine the snapshot, then revert to it.
      
      This is not quite as convenient as leaving the metadata behind
      after a domain is no longer around, but doing that has a few
      problems: 1. the libvirt API can only delete snapshot metadata
      if there is a valid domain handle to use to get to that snapshot
      object - if stale data is left behind without a domain, there is
      no way to request that the data be cleaned up. 2. creating a new
      domain with the same name but different uuid than the older
      domain where a snapshot existed cannot use the older snapshot
      data; this risks confusing libvirt, and forbidding the stale
      data is similar to the recent patch to forbid stale managed save.
      
      The first two flags might be useful on hypervisors with no metadata,
      but only for modifying the notion of the current snapshot;
      however, I don't know how to do that for ESX or VBox.
      
      The third flag is a convenience option, to combine a creation with
      a delete metadata into one step.  It is trivial for hypervisors
      with no metadata.
      
      The qemu changes will be involved enough to warrant a separate patch.
      
      * include/libvirt/libvirt.h.in
      (VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE)
      (VIR_DOMAIN_SNAPSHOT_CREATE_CURRENT)
      (VIR_DOMAIN_SNAPSHOT_CREATE_NO_METADATA): New flags.
      * src/libvirt.c (virDomainSnapshotCreateXML): Document them, and
      enforce mutual exclusion.
      * src/esx/esx_driver.c (esxDomainSnapshotCreateXML): Trivial
      implementation.
      * src/vbox/vbox_tmpl.c (vboxDomainSnapshotCreateXML): Likewise.
      * docs/formatsnapshot.html.in: Document re-creation.
      af65695a
  19. 06 4月, 2010 1 次提交