1. 20 9月, 2016 2 次提交
  2. 14 9月, 2016 1 次提交
  3. 06 9月, 2016 1 次提交
  4. 05 9月, 2016 3 次提交
  5. 28 7月, 2016 4 次提交
    • E
      tools: Make use of the correct environment variables · d02ef334
      Erik Skultety 提交于
      Since commit 834c5720 which extracted the generic functionality out of virsh
      and made it available for other clients like virt-admin to make use of it, it
      also introduced a bug when it renamed the original VIRSH_ environment variables
      to VSH_ variables. Virt-admin of course suffers from the same bug, so this
      patch modifies the generic module vsh.c to construct the correct name for
      environment variables of each client from information it has.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1357363Signed-off-by: NErik Skultety <eskultet@redhat.com>
      d02ef334
    • E
      vsh: Make vshInitDebug return int instead of void · 0ef07e19
      Erik Skultety 提交于
      Well, the reason behind this change is that if the function is extended in some
      way that e.g. would involve allocation we do not have a way of telling it to
      the caller. More specifically, vshInitDebug only relies on some hardcoded
      environment variables (by a mistake) that aren't documented anywhere so neither
      virsh's nor virt-admin's documented environment variables take effect. One
      possible solution would be duplicate the code for each CLI client or leave the
      method be generic and provide means that it could figure out, which client
      called it, thus initializing the proper environment variables but that could
      involve operations that might as well fail in certain circumstances and the
      caller should know that an error occurred.
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      0ef07e19
    • M
      vshReadlineParse: Drop some unused variables · ea2ad171
      Michal Privoznik 提交于
      My compiler identified some variables that were set, but never
      actually used. For instance, opts_required, and data_acomplete.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      ea2ad171
    • M
      vshCmddefGetOption: Change type of opt_index · 2bc97f27
      Michal Privoznik 提交于
      This function tries to look up desired option for a given parsed
      command. Upon successful return it also stores option position
      into passed *opt_index. Now, this variable is type of int, even
      though it is never ever used to store negative value. Moreover,
      the variable is set from a local variable which is type of
      size_t.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      2bc97f27
  6. 19 7月, 2016 1 次提交
    • J
      vsh: Properly initialize res · bd93ba64
      John Ferlan 提交于
      The 'res' variable was only being initialized to NULL in the
      if (!state) path; however, that path never used res and evenutally
      res is assigned one of two results based on a pair of if then else if
      conditions. If for some reason neither of those paths was taken and
      the (!state) path wasn't taken, then 'res' would be indeterminate.
      
      Found by Coverity, probably a false positive based on code paths, but
      better safe than sorry for the future.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      bd93ba64
  7. 11 7月, 2016 4 次提交
  8. 22 6月, 2016 1 次提交
  9. 18 6月, 2016 1 次提交
  10. 29 4月, 2016 1 次提交
  11. 15 4月, 2016 1 次提交
  12. 14 4月, 2016 1 次提交
  13. 29 3月, 2016 3 次提交
    • P
      vsh: Introduce helper to parse --bandwidth · d18e78c2
      Peter Krempa 提交于
      Historically we've used 'unsigned long' and allowed wrapping of negative
      numbers for bandwidth values. Add a helper that will simplify adding
      support for scaled integers and support for byte granularity while
      keeping the compatibility with the older approach.
      d18e78c2
    • P
      vsh: Refactor vshCommandOptScaledInt · 3f1b45de
      Peter Krempa 提交于
      Fix control flow and spacing issues.
      3f1b45de
    • P
      vsh: Tweak error message for scaled integers · b2c9d77b
      Peter Krempa 提交于
      It was too similar to the non-scaled alternative.
      
      before:
      error: Numeric value 'abc' for <size> option is malformed or out of range
      after:
      error: Scaled numeric value 'abc' for <size> option is malformed or out of range
      b2c9d77b
  14. 18 2月, 2016 1 次提交
  15. 15 2月, 2016 2 次提交
    • P
      vsh: Replace vshPrint macro with function · 27fa42b2
      Peter Krempa 提交于
      The macro would eat the first parameter. In some cases the format string
      for vshPrint was eaten. In other cases the calls referenced variables
      which did not exist in the given context. Avoid errors by doing compile
      time checking.
      27fa42b2
    • P
      vsh: Simplify bailing out on OOM conditions · 018010f0
      Peter Krempa 提交于
      When we hit OOM it doesn't really make sense to format the error message
      by attempting to allocate it. Introduce a simple helper that prints a
      static message and terminates the execution.
      018010f0
  16. 09 12月, 2015 1 次提交
  17. 04 9月, 2015 3 次提交
    • E
      vsh: Make vshInitDebug static · 682775fb
      Erik Skultety 提交于
      There's no reason why debug initialization could not be made completely
      hidden, just like readline initialization is. The point of the global
      initializer vshInit is to make initialization of smaller features transparent
      to the user/caller.
      682775fb
    • E
      vsh: Introduce vshInitReload · f59d51f5
      Erik Skultety 提交于
      Commit a0b6a36f separated vshInitDebug from the original vshInit
      (before virsh got split and vshInit became virshInit - commit 834c5720)
      in order to be able to debug command line parsing.
      After the parsing is finished, debugging is reinitialized to work properly.
      There might as well be other features that require re-initialization as
      the command line could specify parameters that override our defaults which
      had been set prior to calling vshArgvParse.
      f59d51f5
    • E
      vsh: adjust vshInit signature and remove redundant error label · 57b8a388
      Erik Skultety 提交于
      As part of the effort to stay consistent, change the vshInit signature
      from returning int to returning bool. Moreover, remove the
      unnecessary error label as there is no cleanup that would make use of
      it.
      57b8a388
  18. 03 9月, 2015 1 次提交
    • M
      vshInit: Don't leak @histsize_env · 4fdd873f
      Michal Privoznik 提交于
      Caller is responsible for freeing the result of virStringJoin()
      when no longer needed:
      
      ==10701== 1 bytes in 1 blocks are definitely lost in loss record 1 of 806
      ==10701==    at 0x4C29F80: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
      ==10701==    by 0xAADB679: strdup (in /lib64/libc-2.20.so)
      ==10701==    by 0x4F18655: virStrdup (virstring.c:726)
      ==10701==    by 0x4F175AF: virStringJoin (virstring.c:165)
      ==10701==    by 0x131D4D: vshReadlineInit (vsh.c:2572)
      ==10701==    by 0x1322DF: vshInit (vsh.c:2736)
      ==10701==    by 0x1347C1: main (virsh.c:907)
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      4fdd873f
  19. 15 8月, 2015 1 次提交
  20. 14 8月, 2015 1 次提交
    • E
      tools: Introduce new client generic module vsh · 834c5720
      Erik Skultety 提交于
      In order to share as much virsh' logic as possible with upcomming
      virt-admin client we need to split virsh logic into virsh specific and
      client generic features.
      
      Since majority of virsh methods should be generic enough to be used by
      other clients, it's much easier to rename virsh specific data to virshX
      than doing this vice versa. It moved generic virsh commands (including info
      and opts structures) to generic module vsh.c.
      
      Besides renaming methods and structures, this patch also involves introduction
      of a client specific control structure being referenced as private data in the
      original control structure, introduction of a new global vsh Initializer,
      which currently doesn't do much, but there is a potential for added
      functionality in the future.
      Lastly it introduced client hooks which are especially necessary during
      client connecting phase.
      834c5720
  21. 02 6月, 2015 5 次提交
  22. 25 5月, 2015 1 次提交