1. 29 7月, 2011 1 次提交
    • 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
  2. 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
  3. 27 7月, 2011 1 次提交
  4. 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
  5. 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
  6. 21 7月, 2011 1 次提交
  7. 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
  8. 19 7月, 2011 6 次提交
    • E
      Revert "virsh: make migrate --tunnelled imply --p2p" · 74594c57
      Eric Blake 提交于
      This reverts commit 40143fb6.
      
      The patch prevents future compatibility if migration ever learns
      how to do tunnelled without p2p.
      74594c57
    • O
      virsh: Extend virsh dominfo to display if managed save image exists · 73d4625a
      Osier Yang 提交于
      * tools/virsh.c: new column "Managed save" for "cmdDominfo".
      * tools/virsh.pod: Update document of "managedsave" to tell one can
        use "dominfo" to query whether a domain has any managed save image.
      73d4625a
    • O
      doc: Correct documents for iface commands · dde56813
      Osier Yang 提交于
      The problems:
          * Duplicate documents for "iface-name"
          * Lacks of document for "iface-mac"
          * Inconsistent option names with virsh help strings.
      dde56813
    • E
      virsh: make migrate --tunnelled imply --p2p · 40143fb6
      Eric Blake 提交于
      We can make the virsh migrate UI friendlier by supplying the
      missing bit automatically instead of erroring out when requesting
      --tunnelled without --p2p.
      
      * tools/virsh.c (doMigrate): Make --p2p optional when using
      --tunnelled.
      * tools/virsh.pod (migrate): Tweak wording accordingly.
      40143fb6
    • A
      virsh: avoid double free of domain · 6f669d4e
      Alex Jia 提交于
      * tools/virsh.c: avoid double free of domain, when weight value of blkiotune
        less than 0, codes will free domain and jump to cleanup section, however,
        cleanup will free domain again.
      
      Detected in valgrind run:
      
      ==21297== ERROR SUMMARY: 20 errors from 20 contexts (suppressed: 69 from 8)
      ==21297==
      ==21297== 1 errors in context 1 of 20:
      ==21297== Invalid read of size 4
      ==21297==    at 0x40E209B: virDomainFree (libvirt.c:2096)
      ==21297==    by 0x8065274: cmdBlkiotune (virsh.c:3695)
      ==21297==    by 0x8054CC1: vshCommandRun (virsh.c:13135)
      ==21297==    by 0x806B967: main (virsh.c:14487)
      ==21297==  Address 0x446ad48 is 0 bytes inside a block of size 36 free'd
      ==21297==    at 0x4005B0A: free (vg_replace_malloc.c:325)
      ==21297==    by 0x406814D: virFree (memory.c:310)
      ==21297==    by 0x40D6635: virReleaseDomain (datatypes.c:243)
      ==21297==    by 0x40D6C5E: virUnrefDomain (datatypes.c:280)
      ==21297==    by 0x40E20B9: virDomainFree (libvirt.c:2101)
      ==21297==    by 0x8065297: cmdBlkiotune (virsh.c:3613)
      ==21297==    by 0x8054CC1: vshCommandRun (virsh.c:13135)
      ==21297==    by 0x806B967: main (virsh.c:14487)
      ==21297==
      ==21297==
      ==21297== 1 errors in context 2 of 20:
      ==21297== Invalid read of size 4
      ==21297==    at 0x40E1FE6: virDomainFree (libvirt.c:2092)
      ==21297==    by 0x8065274: cmdBlkiotune (virsh.c:3695)
      ==21297==    by 0x8054CC1: vshCommandRun (virsh.c:13135)
      ==21297==    by 0x806B967: main (virsh.c:14487)
      ==21297==  Address 0x446ad48 is 0 bytes inside a block of size 36 free'd
      ==21297==    at 0x4005B0A: free (vg_replace_malloc.c:325)
      ==21297==    by 0x406814D: virFree (memory.c:310)
      ==21297==    by 0x40D6635: virReleaseDomain (datatypes.c:243)
      ==21297==    by 0x40D6C5E: virUnrefDomain (datatypes.c:280)
      ==21297==    by 0x40E20B9: virDomainFree (libvirt.c:2101)
      ==21297==    by 0x8065297: cmdBlkiotune (virsh.c:3613)
      ==21297==    by 0x8054CC1: vshCommandRun (virsh.c:13135)
      ==21297==    by 0x806B967: main (virsh.c:14487)
      
      * how to reproduce?
        % valgrind -v --leak-check=full virsh blkiotune guestname --weight -1
      6f669d4e
    • E
      docs: improve virsh man page synopses · 08d3b0a2
      Eric Blake 提交于
      "optional" is not a very good meta-syntactic construct in our man
      page.  I scrubbed this, and additionally improved some documentation
      on mutually exclusive options.  For example,
      
      [[--live] [--config] | [--current]]
      
      implies a set of optional flags, where within the set you can have
      either --current or a choice of 0, 1, or both --live and --config.
      
      * tools/virsh.pod: Use "[name]" rather than "optional name" for
      optional arguments.
      08d3b0a2
  9. 16 7月, 2011 2 次提交
    • E
      virsh: improve option handling · ca92c857
      Eric Blake 提交于
      The documentation for vshCommandOptString claims that it returns
      -1 on a missing required argument, but in reality, that error
      message was unreachable (it was buried inside an if clause that
      is true only if the argument was present).  The code was so hairy
      that I decided a rewrite would make it easier to understand,
      and actually return the error values we want.
      
      Meanwhile, our construction guarantees that all vshCmdOpt have
      a non-null def member, so there are some redundant checks that
      can be trimmed.
      
      * tools/virsh.c (vshCommandOpt): Alter signature.
      (vshCommandOptInt, vshCommandOptUInt, vshCommandOptUL)
      (vshCommandOptString, vshCommandOptLongLong)
      (vshCommandOptULongLong, vshCommandOptBool): Adjust all callers.
      (vshCommandOptArgv): Remove dead condition.
      ca92c857
    • H
      add --cache, --serial, --shareable and --address to attach-disk · e962a579
      Hu Tao 提交于
      This adds four options for virsh command attach-disk.
      
      --cache option allows user to specify cache mode of disk device
      from virsh command line when attaching a disk device.
      
      --serial option allows user to specify serial string of disk device
      from virsh command line when attaching a disk device.
      
      --shareable option allows user to specify whether the disk device is
      shareable between domains when attaching a disk device from virsh
      command line.
      
      --address option allows user to specify address of disk device when
      attaching a disk device.
      e962a579
  10. 15 7月, 2011 1 次提交
  11. 14 7月, 2011 6 次提交
  12. 12 7月, 2011 2 次提交
  13. 08 7月, 2011 2 次提交
    • E
      virsh: make destroy sound less scary · 085d2415
      Eric Blake 提交于
      Destroy has a rather negative English connotation.  Try to reduce
      the impact, so newbies aren't as scared to use it.
      
      * tools/virsh.c: Tweak all destroy documentation.
      * tools/virsh.pod: Likewise.
      085d2415
    • E
      build: use gnulib pthread_sigmask · 8437e738
      Eric Blake 提交于
      Gnulib finally learned how to do pthread_sigmask on mingw.
      
      * .gnulib: Update to latest, for pthread_sigmask.
      * bootstrap.conf (gnulib_modules): Add pthread_sigmask.
      * configure.ac (AC_CHECK_FUNCS): Drop redundant check.
      * src/rpc/virnetclient.c (virNetClientSetTLSSession)
      (virNetClientIOEventLoop): Make code unconditional.
      * src/util/command.c (virFork): Likewise.
      * tools/virsh.c (doMigrate, cmdMigrate): Likewise.
      8437e738
  14. 01 7月, 2011 2 次提交
    • E
      virsh: avoid uninitialized variable · cdb0e0dc
      Eric Blake 提交于
      Detected by Coverity; neither vshCmddefHelp nor vshCmdOptParse
      was initializing opts_required.
      
      * tools/virsh.c (vshCmddefOptParse): Always initialize bitmaps.
      cdb0e0dc
    • E
      virsh: avoid integer overflow · 6f9432fc
      Eric Blake 提交于
      Detected by Coverity.  info.nrVirtCpu is unsigned short, but if
      cpumaplen is int, then the product of the two in vshMalloc risks
      unintended sign extension.  cmdVcpuinfo had already solved this
      by using size_t cpumaplen.
      
      * tools/virsh.c (cmdVcpuPin): Use correct type.
      6f9432fc
  15. 30 6月, 2011 1 次提交