1. 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
  2. 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
  3. 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
  4. 08 9月, 2011 1 次提交
  5. 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
  6. 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
  7. 03 9月, 2011 5 次提交
    • 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
    • E
      snapshot: add snapshot-list --parent to virsh · d4a965c6
      Eric Blake 提交于
      Even though I recently added 'virsh snapshot-parent', doing it one
      snapshot at a time is painful, so make it possible to expand the
      snapshot-list table at once.
      
      * tools/virsh.c (cmdSnapshotList): Add --parent.
      * tools/virsh.pod (snapshot-list): Document it.
      d4a965c6
    • E
      snapshot: expose --running and --paused in virsh · 42c52d53
      Eric Blake 提交于
      Pretty straight-forward exposure of new flags.  For most commands,
      we let the API reject mutually exclusive flags; but for save-image-edit,
      we do the sanity check ourselves to avoid looping on flag failure if
      the edit cycle is ever enhanced to allow the user to retry an edit
      to fix up an xml validation error.
      
      * tools/virsh.c (cmdManagedSave, cmdRestore, cmdSave)
      (cmdSaveImageDefine, cmdSaveImageEdit): Add new flags.
      * tools/virsh.pod (managedsave, restore, save, save-image-define)
      (save-image-edit): Document them.
      42c52d53
  8. 02 9月, 2011 4 次提交
  9. 30 8月, 2011 1 次提交
    • E
      start: allow discarding managed save · 27c85260
      Eric Blake 提交于
      There have been several instances of people having problems with
      a broken managed save file, and not aware that they could use
      'virsh managedsave-remove dom' to fix things.  Making it possible
      to do this as part of starting a domain makes the same functionality
      easier to find, and one less API call.
      
      * include/libvirt/libvirt.h.in (VIR_DOMAIN_START_FORCE_BOOT): New
      flag.
      * src/libvirt.c (virDomainCreateWithFlags): Document it.
      * src/qemu/qemu_driver.c (qemuDomainObjStart): Alter signature.
      (qemuAutostartDomain, qemuDomainStartWithFlags): Update callers.
      * tools/virsh.c (cmdStart): Expose it in virsh.
      * tools/virsh.pod (start): Document it.
      27c85260
  10. 26 8月, 2011 2 次提交
  11. 24 8月, 2011 1 次提交
    • E
      virsh: add list --managed-save · 13154027
      Eric Blake 提交于
      Knowing whether 'virsh start' will resume a saved image or do
      a fresh boot is useful enough to expose via 'virsh list'.
      
      Also, translate the state column.
      
      * tools/virsh.c (cmdList): add --managed-save flag
      * tools/virsh.pod (list): Document it.
      Based on a suggestion by Miklos Vajna.
      13154027
  12. 19 8月, 2011 1 次提交
  13. 17 8月, 2011 1 次提交
    • E
      virsh: concatenate qemu-monitor-command arguments · 531c8581
      Eric Blake 提交于
      Call me lazy, but:
      
      virsh qemu-monitor-command dom --hmp info status
      
      is nicer than:
      
      virsh qemu-monitor-command dom --hmp 'info status'
      
      * tools/virsh.c (cmdQemuMonitorCommand): Allow multiple arguments,
      for convenience.
      531c8581
  14. 12 8月, 2011 1 次提交
    • E
      virsh: add snapshot-parent · 98369d31
      Eric Blake 提交于
      Down the road, I want to add virDomainSnapshotGetParent, and use
      the new API rather than xml scraping; but this virsh command can
      be implemented even without the new API.
      
      * tools/virsh.c (cmdSnapshotParent): New command.
      * tools/virsh.pod (snapshot-parent): Document it.
      98369d31
  15. 11 8月, 2011 1 次提交
    • E
      virsh: add virsh snapshot-current --name · 23b4a3f9
      Eric Blake 提交于
      Sometimes, full XML is too much; since most snapshot commands
      operate on a snapshot name, there should be an easy way to get
      at the current snapshot's name.  For example:
      
      virsh snapshot-revert dom `virsh snapshot-current dom --name`
      
      * tools/virsh.c (cmdSnapshotCurrent): Add an option.
      * tools/virsh.pod (snapshot-current): Document it.
      23b4a3f9
  16. 02 8月, 2011 1 次提交
  17. 28 7月, 2011 1 次提交
  18. 27 7月, 2011 1 次提交
  19. 26 7月, 2011 3 次提交
    • D
      Fix incorrect implication about list options · 93fb3acc
      Dave Allan 提交于
      The description of the list command seemed to suggest that it could
      take a set of domains as an argument, which is not correct in the
      current HEAD.  If virsh list is intended to take a list of domains,
      then this patch should be NAK'd and a bug opened against virsh list.
      
      Reported by hachi on #virt
      
      v2:
      
      Change language to include transient domains
      
      Osier pointed out that transient domains are not defined, so what I
      had originally proposed wasn't quite correct.
      93fb3acc
    • D
      Fix typos in virsh.pod file · a4b4b6aa
      Daniel P. Berrange 提交于
      * tools/virsh.pod: Fix missing > tag in docs
      a4b4b6aa
    • E
      virsh: make vcpucount use --current consistently · 4b7a8e9c
      Eric Blake 提交于
      Rename the existing --current flag to the new name --active,
      while adding a new flag --current to expose the new
      VIR_DOMAIN_AFFECT_CURRENT flag of virDomainGetVcpusFlags.
      
      For backwards compability, the output does not change (even
      though the label "current" no longer matches the spelling of
      the option that would trigger that number in isolation), and
      we accept "--current --live" as an undocumented synonym for
      "--active --live" to avoid breaking any existing clients.
      
      * tools/virsh.c (cmdVcpucount): Add --active flag, and rearrange
      existing flag handling to expose VIR_DOMAIN_AFFECT_CURRENT support.
      * tools/virsh.pod (vcpucount): Document this.
      4b7a8e9c
  20. 22 7月, 2011 3 次提交
    • E
      save: add virsh commands for manipulating save files · bfb485ce
      Eric Blake 提交于
      Now you can edit a saved state file even if you forgot to grab
      a dumpxml file prior to saving a domain.  Plus, in-place editing
      feels so much nicer.
      
      * tools/virsh.c (cmdSaveImageDumpxml, cmdSaveImageDefine)
      (cmdSaveImageEdit): New commands.
      * tools/virsh.pod (save-image-dumpxml, save-image-define)
      (save-image-edit): Document them.
      bfb485ce
    • E
      save: support --xml to virsh save/restore · 38149ec1
      Eric Blake 提交于
      Also, migrate was missing documentation for the --xml option
      added in commit ec5301cb.
      
      * tools/virsh.c (cmdSave, cmdRestore): Add xml argument.
      * tools/virsh.pod (save, restore, migrate): Document it.
      38149ec1
    • E
      save: add --bypass-cache flag to virsh save/restore operations · a779d2ff
      Eric Blake 提交于
      Wire up the new flag to several virsh commands.  Also, the
      'dump' command had undocumented flags.
      
      * tools/virsh.c (cmdSave, cmdManagedSave, cmdDump, cmdStart)
      (cmdRestore): Add new flag.
      * tools/virsh.pod (save, managedsave, dump, start, restore):
      Document flags.
      a779d2ff