1. 23 8月, 2011 1 次提交
  2. 19 8月, 2011 4 次提交
    • E
      virsh: properly interleave shared stdout and stderr · baac9c37
      Eric Blake 提交于
      Without this patch, invoking 'virsh >file 2>&1' results in
      error messages appearing before normal output, even if they
      occurred later in time than the normal output (since stderr
      is unbuffered, but stdout waits until a full buffer).
      
      * tools/virsh.c (print_job_progress, vshError): Flush between
      stream transitions.
      * tests/undefine: Test it.
      baac9c37
    • E
      maint: simplify lots of libxml2 clients · d89dd42d
      Eric Blake 提交于
      Repetitive patterns should be factored.  The sign of a good
      factorization is a change that kills 5x more lines than it adds :)
      
      * src/conf/domain_conf.c (virDomainDeviceDefParse)
      (virDomainSnapshotDefParseString): Use new convenience macros.
      * src/conf/storage_conf.c (virStoragePoolDefParseSourceString):
      Likewise.
      * src/cpu/cpu.c (cpuCompareXML, cpuBaselineXML): Likewise.
      * src/esx/esx_vi.c (esxVI_Context_Execute): Likewise.
      * src/qemu/qemu_migration.c (qemuMigrationCookieXMLParseStr):
      Likewise.
      * src/security/virt-aa-helper.c (caps_mockup): Likewise.
      * src/test/test_driver.c (testOpenFromFile): Likewise.
      * tests/cputest.c (cpuTestLoadXML, cpuTestLoadMultiXML):
      Likewise.
      * tools/virsh.c (cmdFreecell, makeCloneXML, cmdVNCDisplay)
      (cmdTTYConsole, cmdDetachInterface, cmdDetachDisk)
      (cmdSnapshotCreate, cmdSnapshotCreateAs, cmdSnapshotCurrent)
      (cmdSnapshotList, cmdSnapshotParent): Likewise.
      d89dd42d
    • E
      maint: treat more libxml2 functions as free-like · e472fe25
      Eric Blake 提交于
      * cfg.mk (useless_free_options): Add xmlFreeDoc, xmlBufferFree.
      * src/esx/esx_vi.c (ESX_VI__TEMPLATE__FREE): Fix offenders.
      * tools/virsh.c (cmdFreecell, cmdVNCDisplay, cmdTTYConsole)
      (cmdDetachInterface, cmdDetachDisk, cmdSnapshotCreate)
      (cmdSnapshotCreateAs, cmdSnapshotList, cmdSnapshotParent):
      Likewise.
      e472fe25
    • T
      schedinfo: add missing documentation · 4dec4d41
      Taku Izumi 提交于
      This patch adds the missing documentation about the scheduler parameter
      "vcpu_period" and "vcpu_quota".
      4dec4d41
  3. 17 8月, 2011 3 次提交
  4. 13 8月, 2011 2 次提交
  5. 12 8月, 2011 3 次提交
    • E
      virsh: don't reject undefine on active domain · 9a0ec363
      Eric Blake 提交于
      The public API documents that undefine may be used to transition a
      running persistent domain into a transient one.  Many drivers still
      do not support this usage, but virsh shouldn't be getting in the
      way of those that do support it.
      
      This also drops a redundant conditional; vshCommandOptString
      guaranteed that name was non-NULL.
      
      * tools/virsh.c (cmdUndefine): Allow undefine on active domains;
      the drivers may still reject it, but it is a valid API usage.
      * tests/undefine (error): Fix the test to match.
      9a0ec363
    • P
      virsh: Add dir type for listing volumes with vol-list · 594f564c
      Peter Krempa 提交于
      Fix of output of detailed volume list. BZ #727088
      594f564c
    • 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
  6. 11 8月, 2011 2 次提交
    • 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
    • E
      virsh: fix snapshot-create-as to handle arbitrary names · 69278878
      Eric Blake 提交于
      Found this working on the next patch to use xpath to parse
      arbitrary names back out.
      
      * tools/virsh.c (cmdSnapshotCreateAs): Escape user input.
      69278878
  7. 10 8月, 2011 1 次提交
  8. 02 8月, 2011 2 次提交
  9. 01 8月, 2011 1 次提交
    • M
      virsh: Fix vol-name and vol-pool commands · c9ee3d26
      Matthias Bolte 提交于
      This commands don't have a --pool option, so don't tell
      vshCommandOptVolBy that there could be one. This made
      vshCommandOptString for pooloptname fail and an "missing option"
      error was reported.
      
      Make pooloptname optional for vshCommandOptVolBy.
      c9ee3d26
  10. 29 7月, 2011 2 次提交
    • M
      freebsd: Fix build problem due to picking up the wrong libvirt.h · b590866b
      Matthias Bolte 提交于
      Gettext annoyingly modifies CPPFLAGS in-place, putting
      -I/usr/local/include into the search patch if libintl headers
      must be used from that location.  But since we must support
      automake 1.9.6 which lacks AM_CPPFLAGS, and since CPPFLAGS is used
      prior to INCLUDES, this means that the build picks up the _old_
      installed libvirt.h in priority to the in-tree version, leading
      to all sorts of weird build failures on FreeBSD.
      
      Fix this by teaching configure to undo gettext's actions, but
      to keep any changes required by gettext at the end of INCLUDES
      after all in-tree locations are used first.  Also requires
      adding a wrapper Makefile.am and making gnulib-tool create
      just gnulib.mk files during the bootstrap process.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      b590866b
    • E
      maint: add missing copyright notices · ff81956a
      Eric Blake 提交于
      I went with the shorter license notice used by src/libvirt.c,
      rather than spelling out the full LGPLv2+ clause into each of
      these files.
      
      * configure.ac: Declare copyright.
      * all Makefile.am: Likewise.
      ff81956a
  11. 28 7月, 2011 3 次提交
    • A
      virsh: avoid missing zero value judgement in cmdBlkiotune · 3f39a0bf
      Alex Jia 提交于
      * tools/virsh.c: fix missing zero value judgement in cmdBlkiotune and correct
        vshError information.
      
        when weight is equal to 0, the cmdBlkiotune will not raise any error information
        when judge weight value first time, and execute else branch to judge weight
        value again, strncpy(temp->field, VIR_DOMAIN_BLKIO_WEIGHT, sizeof(temp->field))
        will be not executed for ever. However, if and only if param->field is equal
        to VIR_DOMAIN_BLKIO_WEIGHT, underlying qemuDomainSetBlkioParameters function
        will check whether weight value is in range [100, 1000].
      
      * how to reproduce?
      
        % virsh blkiotune ${guestname} --weight 0
      Signed-off-by: NAlex Jia <ajia@redhat.com>
      3f39a0bf
    • A
      virsh: fix memory leak in cmdVolPath code · 1768bf63
      Alex Jia 提交于
      * tools/virsh.c: avoid memory leak in cmdVolPath.
      * src/libvirt.c: Add doc for virStorageVolGetPath to tell one
        must free() the returned path after use.
      
      * how to reproduce?
      
      % dd if=/dev/zero of=/var/lib/libvirt/images/foo.img count=1 bs=10M
      % virsh pool-refresh default
      % valgrind -v --leak-check=full virsh vol-path --vol \
      /var/lib/libvirt/images/foo.img
      
      * actual results:
      
      Detected in valgrind run:
      
      ==16436== 32 bytes in 1 blocks are definitely lost in loss record 7 of 22
      ==16436==    at 0x4A05FDE: malloc (vg_replace_malloc.c:236)
      ==16436==    by 0x386A314B3D: xdr_string (in /lib64/libc-2.12.so)
      ==16436==    by 0x3DF8CD770D: xdr_remote_nonnull_string (remote_protocol.c:3
      ==16436==    by 0x3DF8CD7EC8: xdr_remote_storage_vol_get_path_ret
      % virsh pool-refresh default
      % valgrind -v --leak-check=full virsh vol-path --vol \
      /var/lib/libvirt/images/foo.img
      Signed-off-by: NAlex Jia <ajia@redhat.com>
      1768bf63
    • E
      virsh: expose change-protection during migration · 0d0bf850
      Eric Blake 提交于
      * tools/virsh.c (doMigrate): Add --change-protection flag.
      * tools/virsh.pod (migrate): Document it.
      0d0bf850
  12. 27 7月, 2011 1 次提交
  13. 26 7月, 2011 5 次提交
    • A
      tools: format percent strings of nodecpustats · 831c81fc
      Alex Jia 提交于
      * tools/virsh.c: format strings display for virsh nodecpustats --percent.
      
      * how to reproduce?
      
      % virsh nodecpustats --percent
      usage:            2.0%
          user  :       1.0%
          system:       1.0%
      idle  :          98.0%
      iowait:           0.0%
      
      * after format strings
      
      % virsh nodecpustats --percent
      usage:            2.0%
      user:             1.0%
      system:           1.0%
      idle:            98.0%
      iowait:           0.0%
      Signed-off-by: NAlex Jia <ajia@redhat.com>
      831c81fc
    • 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: use faster bit search · 7e853d6c
      Eric Blake 提交于
      Now that gnulib gives us ffs, we might as well use it.
      
      * tools/virsh.c (vshCmddefGetData): Use ffs rather than
      count_one_bits.
      7e853d6c
    • 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
  14. 22 7月, 2011 6 次提交
    • A
      Enable the virDomainBlockPull API in virsh · b31abc6f
      Adam Litke 提交于
      Define two new virsh commands:
       * blockpull: Initiate a blockPull for the given disk
       * blockjob: Retrieve progress info, modify speed, and cancel active block jobs
      
      Share print_job_progress() with the migration code.
      
      * tools/virsh.c: implement the new commands
      b31abc6f
    • 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 bypass-cache flag in libvirt-guests init script · 28d18250
      Eric Blake 提交于
      libvirt-guests is a perfect use case for bypassing the file system
      cache - lots of filesystem traffic done at system shutdown, where
      caching is pointless, and startup, where reading large files only
      once just gets in the way.  Make this a configurable option in the
      init script, but defaulting to existing behavior.
      
      * tools/libvirt-guests.sysconf (BYPASS_CACHE): New variable.
      * tools/libvirt-guests.init.sh (start, suspend_guest): Use it.
      28d18250
    • 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
    • E
      build: rename files.h to virfile.h · 8e22e089
      Eric Blake 提交于
      In preparation for a future patch adding new virFile APIs.
      
      * src/util/files.h, src/util/files.c: Move...
      * src/util/virfile.h, src/util/virfile.c: ...here, and rename
      functions to virFile prefix.  Macro names are intentionally
      left alone.
      * *.c: All '#include "files.h"' uses changed.
      * src/Makefile.am (UTIL_SOURCES): Reflect rename.
      * cfg.mk (exclude_file_name_regexp--sc_prohibit_close): Likewise.
      * src/libvirt_private.syms: Likewise.
      * docs/hacking.html.in: Likewise.
      * HACKING: Regenerate.
      8e22e089
  15. 21 7月, 2011 1 次提交
  16. 20 7月, 2011 1 次提交
    • O
      undefine: Extend virsh undefine to support the new flag · 83e849c1
      Osier Yang 提交于
      If the domain has managed save image, and --managed-save is
      not specified, then it fails with an error telling the user
      that a managed save image still exists.
      
      If the domain has managed save image, and --managed-save is
      specified, it invokes virDomainUndefineFlags. If
      virDomainUndefineFlags fails, then it tries to remove the managed
      save image using virDomainManagedSaveRemove first, with
      invoking virDomainUndefine following. (For compatibility between
      new virsh with this patch and older libvirt without this patch).
      
      Similarly if the domain has no managed save image. See the codes for
      detail.
      
      NOTE: Have not removing the codes checking if the domain is running
      in function "cmdUndefine", it will go along with qemu driver's fix
      (allow to undefine a running domain).
      83e849c1
  17. 19 7月, 2011 2 次提交