1. 01 12月, 2011 2 次提交
    • E
      qemu: amend existing table of device weights · 22cf6d46
      Eric Blake 提交于
      Prior to this patch, for a running dom, the commands:
      
      $ virsh blkiotune dom --device-weights /dev/sda,502,/dev/sdb,498
      $ virsh blkiotune dom --device-weights /dev/sda,503
      $ virsh blkiotune dom
      weight         : 500
      device_weight  : /dev/sda,503
      
      claim that /dev/sdb no longer has a non-default weight, but
      directly querying cgroups says otherwise:
      
      $ cat /cgroup/blkio/libvirt/qemu/dom/blkio.weight_device
      8:0     503
      8:16    498
      
      After this patch, an explicit 0 is required to remove a device path
      from the XML, and omitting a device path that was previously
      specified leaves that device path untouched in the XML, to match
      cgroups behavior.
      
      * src/qemu/qemu_driver.c (parseBlkioWeightDeviceStr): Rename...
      (qemuDomainParseDeviceWeightStr): ...and use correct type.
      (qemuDomainSetBlkioParameters): After parsing string, modify
      rather than replacing existing table.
      * tools/virsh.pod (blkiotune): Tweak wording.
      22cf6d46
    • L
      Enable the blkdeviotune command in virsh · e9bd9a08
      Lei Li 提交于
      Support virsh command blkdeviotune. Can set or query a block disk
      I/O throttle setting.
      Signed-off-by: NLei Li <lilei@linux.vnet.ibm.com>
      Signed-off-by: NZhi Yong Wu <wuzhy@linux.vnet.ibm.com>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      e9bd9a08
  2. 30 11月, 2011 1 次提交
    • H
      blkiotune: add interface for blkiotune.device_weight · 6ac81c8e
      Hu Tao 提交于
      This adds per-device weights to <blkiotune>.  Note that the
      cgroups implementation only supports weights per block device,
      and not per-file within the device; hence this option must be
      global to the domain definition rather than tied to individual
      <devices>/<disk> entries:
      
      <domain ...>
        <blkiotune>
          <device>
            <path>/path/to/block</path>
            <weight>1000</weight>
          </device>
        </blkiotune>
      ..
      
      This patch also adds a parameter --device-weights to virsh command
      blkiotune for setting/getting blkiotune.weight_device for any
      hypervisor that supports it.  All <device> entries under
      <blkiotune> are concatenated into a single string attribute under
      virDomain{Get,Set}BlkioParameters, named "device_weight".
      Signed-off-by: NHu Tao <hutao@cn.fujitsu.com>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      6ac81c8e
  3. 29 11月, 2011 3 次提交
  4. 17 11月, 2011 1 次提交
    • L
      virsh: add iface-bridge and iface-unbridge commands · 1ae8eed1
      Laine Stump 提交于
      One of the top questions by libvirt users is how to create a host
      bridge device so that guests can be directly on the physical
      network. There are several example documents that explain how to do
      this manually, but following them often results in confusion and
      failure. virt-manager does a good job of creating a bridge based on an
      existing network device, but not everyone wants to use virt-manager.
      
      This patch adds a new command, iface-bridge that makes it just about
      as simple as possible to create a new bridge device based on an
      existing ethernet/vlan/bond device (including associating IP
      configuration with the bridge rather than the now-attached device),
      and start that new bridge up ready for action, eg:
      
          virsh iface-bridge eth0 br0
      
      For symmetry's sake, it also adds a command to remove a device from a
      bridge, restoring the IP config to the now-unattached device:
      
          virsh iface-unbridge br0
      
      (I had a short debate about whether to do "iface-unbridge eth0"
      instead, but that would involve searching through all bridge devices
      for the one that contained eth0, which seems like a bit too much
      trouble).
      
      NOTE: These two commands require that the netcf library be available
      on the host. Hopefully this will provide some extra incentive for
      people using suse, debian, ubuntu, and other similar systems to polish
      up (and push downstream) the ports to those distros recently pushed to
      the upstream netcf repo by Dan Berrange. Anyone interested in helping
      with that effort in any way should join the netcf-devel mailing list
      (subscription info at
      https://fedorahosted.org/mailman/listinfo/netcf-devel)
      
      During creation of the bridge, it's possible to specify whether or not
      the STP protocol should be started up on the bridge and, if so, how
      many seconds the bridge should squelch traffic from newly added
      devices while learning new topology (defaults are stp='on' and
      delay='0', which seems to usually work best for bridges used in the
      context of libvirt guests).
      
      There is also an option to not immediately start the bridge (and a
      similar option to not immediately start the un-attached device after
      destroying the bridge. Default is to start the new device, because in
      the case of iface-unbridge not starting is strongly discouraged as it
      will leave the system with no network connectivity on that interface
      (because it's necessary to destroy/undefine the bridge device before
      the unattached device can be defined), and it seemed better to make
      the option for iface-bridge behave consistently.
      
      NOTE TO THOSE TRYING THESE COMMANDS FOR THE FIRST TIME: to guard
      against any "unexpected" change to configuration, it is advisable to
      issue an "virsh iface-begin" command before starting any interface
      config changes, and "virsh iface-commit" only after you've verified
      that everything is working as you expect. If something goes wrong,
      you can always run "virsh iface-rollback" or reboot the system (which
      should automatically do iface-rollback).
      
      Aside from adding the code for these two functions, and the two
      entries into the command table, the only other change to virsh.c was
      to add the option name to vshCommandOptInterfaceBy(), because the
      iface-unbridge command names its interface option as "bridge".
      
      virsh.pod has also been updated with short descriptions of these two
      new commands.
      1ae8eed1
  5. 21 10月, 2011 1 次提交
    • E
      docs: document managed=yes of hostdev passthrough · 10d3272e
      Eric Blake 提交于
      Clarify some of the effects of managed passthrough <hostdev> devices;
      with recent changes (commit d0935478), a nodedev-reattach is only needed
      to pair up to an explicit nodedev-dettach (but beware that older
      virt-manager has a bug where it uses explicit nodedev-dettach under the
      hood when using the gui to hotplug a hostdev device).
      
      * docs/formatdomain.html.in: Mention reattach.
      * tools/virsh.pod (nodedev): Mention managed mode.
      10d3272e
  6. 20 10月, 2011 1 次提交
  7. 13 10月, 2011 2 次提交
    • M
      virDomainCoreDump: Introduce VIR_DUMP_RESET flag · 4dadfe59
      Michal Privoznik 提交于
      This flag is intended to allow user to do so called system reset
      after dump, instead of sending ACPI reboot event.
      4dadfe59
    • E
      snapshot: add API for filtering by leaves · 8b6d1a20
      Eric Blake 提交于
      Counterpart to --roots.
      
      * include/libvirt/libvirt.h.in (VIR_DOMAIN_SNAPSHOT_LIST_LEAVES):
      New flag.
      * src/libvirt.c (virDomainSnapshotNum, virDomainSnapshotListNames)
      (virDomainSnapshotNumChildren)
      (virDomainSnapshotListChildrenNames): Document it.
      * tools/virsh.c (cmdSnapshotList): Expose it.
      * tools/virsh.pod (snapshot-list): Document --leaves.
      8b6d1a20
  8. 12 10月, 2011 1 次提交
    • E
      snapshot: virsh shorthand for operating on current snap · b77b203c
      Eric Blake 提交于
      Rather than having to do:
      
      $ virsh snapshot-revert dom $(virsh snapshot-current dom --name)
      
      I thought it would be nice to do:
      
      $ virsh snapshot-revert dom --current
      
      I didn't add 'virsh snapshot-dumpxml --current' since we already have
      'virsh snapshot-current' for the same task.  snapshot-list accepted
      a name but did not require it, and that remains the case, with
      --current serving in place of that name.  For all other commands,
      name used to be required, and can now be replaced by --current;
      I intentionally made it so that omitting both --current and a name
      is an error (having the absence of a name imply --current seems
      just a bit too magic, so --current must be explicit).  I also had
      to keep snapshot-edit backwards-compatible, as the only command
      that already had a --current argument alongside a name, which still
      works to both edit a named snapshot and make it current.
      
      * tools/virsh.c (vshLookupSnapshot): New helper function.
      (cmdSnapshotEdit, cmdSnapshotList, cmdSnapshotParent)
      (cmdSnapshotDelete, cmdDomainSnapshotRevert): Use it, adding an
      option where needed.
      * tools/virsh.pod (snapshot-delete, snapshot-edit)
      (snapshot-list, snapshot-parent, snapshot-revert): Document
      use of --current.
      (snapshot-dumpxml): Mention alternative.
      b77b203c
  9. 11 10月, 2011 2 次提交
    • E
      snapshot: virsh snapshot-list and children · fe383bb5
      Eric Blake 提交于
      Sometimes, we only care about one branch of the snapshot hierarchy.
      Make it easier to list a single branch, by using the new APIs.
      
      Technically, I could emulate these new virsh options on old servers
      by doing a complete dump, then scraping xml to filter out just the
      snapshots that I care about, but I didn't want to do that in this patch.
      
      * tools/virsh.c (cmdSnapshotList): Add --from, --descendants.
      * tools/virsh.pod (snapshot-list): Document them.
      fe383bb5
    • E
      snapshot: avoid accidental renames with snapshot-edit · bab4f31c
      Eric Blake 提交于
      I was a bit surprised that 'virsh snapshot-edit dom name' silently
      allowed me to clone things, while still telling me the old name,
      especially since other commands like 'virsh edit dom' reject rename
      attempts (*).  This fixes things to be more explicit (**).
      
      (*) Technically, 'virsh edit dom' relies on virDomainDefineXML
      behavior, which rejects attempts to mix a new name with existing
      uuid or new uuid with existing name, but you can create a new
      domain by changing both uuid and name.  On the other hand, while
      snapshot-edit --clone is a true clone, creating a new domain
      would also have to decide whether to clone snapshot metadata,
      managed save, and any other secondary data related to the domain.
      Domain renames are not trivial either.
      
      (**) Renaming or creating a clone is still a risky proposition -
      for offline snapshots and system checkpoints, if the new name
      does not match an actual name recorded in the qcow2 internal
      snapshots, then you cannot revert to the new checkpoint.  But it
      is assumed that anyone using the new virsh flags knows what they
      are doing, and can deal with the fallout caused by a rename/clone;
      that is, we can't completely prevent a user from shooting
      themselves in the foot, so much as we are making the default
      action less risky.
      
      * tools/virsh.c (cmdSnapshotEdit): Add --rename, --clone.
      * tools/virsh.pod (snapshot-edit): Document them.
      bab4f31c
  10. 06 10月, 2011 1 次提交
    • E
      snapshot: add REVERT_FORCE to API · 3c797404
      Eric Blake 提交于
      Although reverting to a snapshot is a form of data loss, this is
      normally expected.  However, there are two cases where additional
      surprises (failure to run the reverted state, or a break in
      connectivity to the domain) can come into play.  Requiring extra
      acknowledgment in these cases will make it less likely that
      someone can get into an unrecoverable state due to a default revert.
      
      Also create a new error code, so users can distinguish when forcing
      would make a difference, rather than having to blindly request force.
      
      * include/libvirt/libvirt.h.in (VIR_DOMAIN_SNAPSHOT_REVERT_FORCE):
      New flag.
      * src/libvirt.c (virDomainRevertToSnapshot): Document it.
      * include/libvirt/virterror.h (VIR_ERR_SNAPSHOT_REVERT_RISKY): New
      error value.
      * src/util/virterror.c (virErrorMsg): Implement it.
      * tools/virsh.c (cmdDomainSnapshotRevert): Add --force to virsh.
      * tools/virsh.pod (snapshot-revert): Document it.
      3c797404
  11. 29 9月, 2011 3 次提交
    • X
      virsh: Add 'reset' command for virsh · 0ec9a8c2
      Xu He Jie 提交于
      Signed-off-by: NXu He Jie <xuhj@linux.vnet.ibm.com>
      0ec9a8c2
    • D
      virsh: describe attach-interface parameter target · dd09da70
      Daniel Veillard 提交于
      This patch is based on a improvement suggested by Kazuhiro Kikuchi
      of Fujitsu, it gives a description of the target parameter for that
      command
      
      * tools/virsh.pod: add description for target parameter of
        attach-interface
      dd09da70
    • D
      virsh: update man page for cpu_shares parameter · 0c92e142
      Daniel Veillard 提交于
      The man page suggest that the cpu_shares parameter of schedinfo
      allows values 0-262144, but the kernel remaps values 0 and 1 to
      the minimum 2, just document that behaviour:
      
      [root@test ~]# cat /cgroup/cpu/libvirt/qemu/cpu.shares
      1024
      [root@test ~]# echo 0 > /cgroup/cpu/libvirt/qemu/cpu.shares
      [root@test ~]# cat /cgroup/cpu/libvirt/qemu/cpu.shares
      2
      [root@test ~]# echo 1 > /cgroup/cpu/libvirt/qemu/cpu.shares
      [root@test ~]# cat /cgroup/cpu/libvirt/qemu/cpu.shares
      2
      [root@test ~]#
      
      * tools/virsh.pod: update description of the cpu_shares parameter
        to indicate the values 0 and 1 are automatically changed by the
        kernel to minimal value 2
      0c92e142
  12. 28 9月, 2011 3 次提交
    • E
      snapshot: add virsh snapshot-list --tree · 1cf0e3db
      Eric Blake 提交于
      Reuse the tree listing of nodedev-list, coupled with the new helper
      function to efficiently grab snapshot parent names, to produce
      tree output for a snapshot hierarchy.  For example:
      
      $ virsh snapshot-list dom --tree
      root1
       |
        +- sibling1
        +- sibling2
        |   |
        |   +- grandchild
        |
        +- sibling3
      
      root2
       |
        +- child
      
      * tools/virsh.c (cmdSnapshotList): Add --tree.
      * tools/virsh.pod (snapshot-list): Document it.
      1cf0e3db
    • E
      docs: document virsh nodedev-* commands · beeab559
      Eric Blake 提交于
      This section of the man page was completely missing; I stumbled on
      it when I had no clue that I had to use nodedev-reattach after
      I was done playing with <hostdev> device passthrough to one of my
      guests.
      
      * tools/virsh.pod (NODEDEV COMMANDS): New section.
      (attach-device, detach-device): Add cross-references.
      beeab559
    • E
      snapshot: fix man page typos · 63b2edc8
      Eric Blake 提交于
      pod2man from perl-5.8.8 (RHEL 5) errors out on ill-formed POD:
      
      *** ERROR: unterminated I<...> at line 1114 in file virsh.pod
      *** ERROR: unterminated I<...> at line 1851 in file virsh.pod
      
      Newer pod2man appears to be more tolerant (which is a shame,
      because it meant that this error is harder to detect).
      
      * tools/virsh.pod (undefine, snapshot-current): Add missing >.
      63b2edc8
  13. 27 9月, 2011 2 次提交
  14. 23 9月, 2011 2 次提交
    • O
      Add unsafe cache mode support for disk driver · f887334d
      Oskari Saarenmaa 提交于
      QEMU 0.13 introduced cache=unsafe for -drive, this patch exposes
      it in the libvirt layer.
      
        * Introduced a new QEMU capability flag ($prefix_CACHE_UNSAFE),
          as even if $prefix_CACHE_V2 is set, we can't know if unsafe
          is supported.
      
        * Improved the reliability of qemu cache type detection.
      f887334d
    • P
      virsh: Improve virsh manual for virsh memtune command · c4111bd0
      Peter Krempa 提交于
      Commit 0a22f542 added --min-guarantee option for the memtune command.
      This option is supported only by the ESX hypervisor. This patch adds a
      statement about this fact, to prevent user confusion.
      
      This patch also adds explanation how to clear/set to unlimited the
      memory tunables. (documments the -1 value).
      c4111bd0
  15. 20 9月, 2011 2 次提交
    • P
      virsh: doc: Fix supported driver types for attach-disk command · 2ad83bf4
      Peter Krempa 提交于
      Virsh man page lists driver types to be used with attach-device
      command, but does not specify that those are usable only with the XEN
      Hypervisor.
      
      This patch adds statement, that those options specified are applicable
      only on the Xen hypervisor and adds option usable with qemu emulator.
      
      This patch also changes type of error returned by QEMU driver if the
      user specifies incompatible driver type from VIR_ERR_INTERNAL_ERROR to
      VIR_ERR_CONFIG_UNSUPPORTED.
      2ad83bf4
    • P
      virsh: Add more human-friendly output of domblkstat command · 619077b9
      Peter Krempa 提交于
      Users of virsh complain that output of the domblkstat command
      is not intuitive enough. This patch adds explanation of fields
      returned by this command to the help section for domblkstat and
      the man page of virsh. Also a switch --human is added for
      domblkstat that prints the fields with more descriptive
      texts.
      
      This patch also changes sequence of the output fields and their
      names back to the order and spelling established by previous
      versions of virsh to maintain compatibility with scripts.
      
      Example of ordered and "translated" output:
      
      PRE-patch:
      
      virsh # domblkstat 1 vda
      vda wr_bytes 5170176
      vda wr_operations 511
      vda rd_bytes 82815488
      vda rd_operations 3726
      
      POST-patch:
      
      virsh # domblkstat 1 vda
      vda rd_req 3726
      vda rd_bytes 82815488
      vda wr_req 478
      vda wr_bytes 4965376
      
      Example of human readable output:
      
      virsh # domblkstat 1 vda --human
      Device: vda
       number of read operations:      3726
       number of read bytes:           82815488
       number of write operations:     478
       number of bytes written:        4965376
      
      https://bugzilla.redhat.com/show_bug.cgi?id=731656
      619077b9
  16. 16 9月, 2011 3 次提交
    • P
      doc: Add statment about permissions needed to do a core dump · 4d4430e1
      Peter Krempa 提交于
      Documentation did not specify, that some permissions are required on
      target path for coredump for the user running the hypervisor.
      
      Diff to v1:
      - reword statements
      4d4430e1
    • E
      snapshot: tweak snapshot-create-as diskspec docs · 85d28108
      Eric Blake 提交于
      With this patch, it is hopefully a bit more obvious that for
      snapshot-create-as, a literal '--diskspec' is mandatory if name
      or description was omitted, but optional if all earlier options
      were provided.
      
      These all denote two diskspecs and a description:
      virsh snapshot-create-as dom name desc vda vdb
      virsh snapshot-create-as dom name desc --diskspec vda --diskspec vdb
      virsh snapshot-create-as dom name desc --diskspec vda vdb
      virsh snapshot-create-as dom name desc vda --diskspec vdb
      virsh snapshot-create-as dom --diskspec vda --diskspec vdb name desc
      
      This gives two diskspecs but no description:
      virsh snapshot-create-as dom name --diskspec vda --diskspec vdb
      
      And this treats 'vda' as the description, with only one diskspec:
      virsh snapshot-create-as dom name vda vdb
      
      The help output now shows:
          snapshot-create-as <domain> [<name>] [<description>] [--print-xml] [--no-metadata] [--halt] [--disk-only] [[--diskspec] <string>]...
      
      I also checked the help output for echo and send-key, which are two
      other variants of argv commands.
      
      * tools/virsh.pod (snapshot-create-as): Document when a literal
      --diskspec must preceed a diskspec argument.
      * tools/virsh.c (vshCmddefHelp): Update help output for argv when
      naming the option is useful.
      (vshCmddefGetData): Fix logic on when argv was seen.
      * tests/virsh-optparse: Add tests to avoid regressions.
      85d28108
    • P
      doc: virsh: Fix command name in man page · b4a01cec
      Peter Krempa 提交于
      Fix cut&paste error having command named domif-setlink instead of
      domif-getlink.
      b4a01cec
  17. 08 9月, 2011 1 次提交
  18. 06 9月, 2011 1 次提交
    • P
      link-state: virsh: Add wrapper commands for changing link state · dc675f37
      Peter Krempa 提交于
      Two new commands are added to virsh that wrap usage of
      virDomainUpdateDeviceFlags for changing link state of domain's network
      interfaces. These wrappers extract network devices's xml configuration
      and modify the link state for easy manipulation from an user's perspective.
      
       - domif-setlink - set link state of a domains virtual network interface
       - domif-getlink - get link state
      
      * tools/virsh.c   - Add functionality to virsh
      * tools/virsh.pod - Manpage documentation
      dc675f37
  19. 05 9月, 2011 5 次提交
    • E
      snapshot: wire up disk-only flag to snapshot-create · 35d52b56
      Eric Blake 提交于
      Expose the disk-only flag through virsh.  Additionally, make
      virsh snapshot-create-as take an arbitrary number of diskspecs,
      which can be used to build up the xml for <domainsnapshot>.
      
      * tools/virsh.c (cmdSnapshotCreate): Add --disk-only.
      (cmdSnapshotCreateAs): Likewise, and add argv diskspec.
      (vshParseSnapshotDiskspec): New helper function.
      (vshCmddefGetOption): Allow naming of argv field.
      * tools/virsh.pod (snapshot-create, snapshot-create-as): Document
      them.
      * tests/virsh-optparse: Test snapshot-create-as parsing.
      35d52b56
    • E
      snapshot: add virsh domblklist command · 88a993b1
      Eric Blake 提交于
      This adds a convenience function to virsh that parses out block
      information from the domain xml, making it much easier to see
      what strings can be used in all other contexts that demand a
      specific block name, especially when given the previous patch
      that allows using either target or unique source name.
      
      As an example on a domain with one disk and an empty cdrom drive:
      
      Target     Source
      -------------------------------------------
      vda        /var/lib/libvirt/images/fedora_12.img
      hdc        -
      
      * tools/virsh.c (cmdDomblklist): New function.
      * tools/virsh.pod (domblklist): Document it.
      88a993b1
    • 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: expose halt-after-creation in virsh · a891ffa4
      Eric Blake 提交于
      Easy enough to emulate even with older servers.
      
      * tools/virsh.c (cmdSnapshotCreate, cmdSnapshotCreateAs): Add
      --halt flag.
      (vshSnapshotCreate): Emulate halt when flag is unsupported.
      * tools/virsh.pod (snapshot-create, snapshot-create-as): Document
      it.
      a891ffa4
    • E
      snapshot: expose new delete flag in virsh · ddc88273
      Eric Blake 提交于
      It would technically be possible to have virsh compute the list
      of descendants of a given snapshot, then delete those one at
      a time.  But it's complex, and not worth writing for a first
      cut at implementing the new flags.
      
      * tools/virsh.c (cmdSnapshotDelete): Add --children-only,
      --metadata.
      * tools/virsh.pod (snapshot-delete): Document them.
      ddc88273
  20. 03 9月, 2011 3 次提交
    • E
      snapshot: teach virsh about new undefine flags · e88872e9
      Eric Blake 提交于
      Similar to 'undefine --managed-save' (commit 83e849c1), we must
      assume that the old API is unsafe; however, we cannot emulate
      metadata-only deletion on older servers.  Additionally, we have
      the wrinkle that while virDomainUndefineFlags and managed save
      cleanup were introduced in 0.9.4, it wasn't until 0.9.5 that
      snapshots block undefine of a domain.  Do the best we can given
      the server we are talking to.
      
      * tools/virsh.c (cmdUndefine): Add --snapshots-metadata flag.
      * tools/virsh.pod (undefine, destroy, shutdown): Document effect
      of snapshots.
      e88872e9
    • E
      snapshot: improve virsh snapshot-create, add snapshot-edit · 2b4d8deb
      Eric Blake 提交于
      Wire up the new snapshot creation flags in virsh.  For convenience,
      teach 'snapshot-current' how to make an existing snapshot become
      current (can be used after upgrading to newer libvirt to recover
      from the fact that the older libvirt lost track of the current
      snapshot after a restart).  The snapshot-create-as command is
      intentionally not taught --redefine or --current, as this would
      imply adding a lot of other options for everything else that can
      appear in the <domainsnapshot> xml, but which is normally read-only.
      Besides, redefining will usually be done on files created by
      snapshot-dumpxml, rather than something built up by hand on the
      command line.  And now that we can redefine, we can edit.
      
      * tools/virsh.c (cmdSnapshotCreate): Add --redefine, --current,
      and --no-metadata.
      (cmdSnapshotCreateAs): Add --no-metadata.
      (cmdSnapshotCurrent): Add snapshotname to alter current snapshot.
      (cmdSnapshotEdit): New command.
      * tools/virsh.pod (snapshot-create, snapshot-create-as)
      (snapshot-current, snapshot-edit):  Document these.
      2b4d8deb
    • E
      snapshot: reflect new dumpxml and list options in virsh · 22a833e7
      Eric Blake 提交于
      New flag bits are worth exposing via virsh.  In the case of
      snapshot-list --roots, it's possible to emulate this even when
      talking to an older server that lacks the bit; whereas
      --metadata requires a newer server.
      
      Although we don't use --security-info yet, the flag is already
      documented for other dumpxml operations, and turning it on now
      will make it useful when a future patch actually has to honor it.
      
      * tools/virsh.c (cmdSnapshotDumpXML, cmdSnapshotCurrent): Add
      --security-info.
      (cmdSnapshotList): Add --roots, --metadata.
      * tools/virsh.pod (snapshot-dumpxml, snapshot-current)
      (snapshot-list): Document these.
      22a833e7