1. 02 6月, 2015 1 次提交
    • A
      virsh: Pass vshControl to all vshCommandOpt*() calls · be6ff4da
      Andrea Bolognani 提交于
      This will allow us to use vshError() to report errors from inside
      vshCommandOpt*(), instead of replicating the same logic and error
      messages all over the place.
      
      We also have more context inside the vshCommandOpt*() functions,
      for example the actual value used on the command line, which means
      we can produce more detailed error messages.
      
      vshCommandOptBool() is the exception here, because it's explicitly
      designed not to report any error.
      be6ff4da
  2. 02 4月, 2015 1 次提交
  3. 12 1月, 2015 1 次提交
  4. 15 11月, 2014 1 次提交
  5. 11 9月, 2014 1 次提交
    • J
      virsh: Resolve Coverity DEADCODE · daf27d4d
      John Ferlan 提交于
      Since 0766783a
      
      Coverity complains that the EDIT_FREE definition results in DEADCODE.
      
      As it turns out with the change to use the EDIT_FREE macro the call to
      vir*Free() wouldn't be necessary nor would it happen...
      
      Prior code to above commitid would :
      
        vir*Ptr foo = NULL;
        ...
        foo = vir*GetXMLDesc()
        ...
        vir*Free(foo);
        foo = vir*DefineXML()
        ...
      
      And thus the free was needed.  With the change to use EDIT_FREE the
      same code changed to:
      
        vir*Ptr foo = NULL;
        vir*Ptr foo_edited = NULL;
        ...
        foo = vir*GetXMLDesc()
        ...
        if (foo_edited)
            vir*Free(foo_edited);
        foo_edited = vir*DefineXML()
        ...
      
      However, foo_edited could never be set in the code path - even with
      all the goto's since the only way for it to be set is if vir*DefineXML()
      succeeds in which case the code to allow a retry (and thus all the goto's)
      never leaves foo_edited set
      
      All error paths lead to "cleanup:" which causes both foo and foo_edited
      to call the respective vir*Free() routines if set.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      daf27d4d
  6. 25 3月, 2014 1 次提交
  7. 14 3月, 2014 1 次提交
  8. 20 8月, 2013 1 次提交
    • P
      virsh: modify vshStringToArray to duplicate the elements too · d64af6ce
      Peter Krempa 提交于
      At a slightly larger memory expense allow stealing of items from the
      string array returned from vshStringToArray and turn the result into a
      string list compatible with virStringSplit. This will allow to use the
      common dealloc function.
      
      This patch also fixes a few forgotten checks of return from
      vshStringToArray and one memory leak.
      d64af6ce
  9. 26 7月, 2013 1 次提交
    • J
      Fix virsh snapshot-list error reporting · e3b21cdc
      Jim Fehlig 提交于
      Noticed that the expected "not supported" error is dropped when
      invoking 'virsh snapshot-list dom' on a Xen installation running
      the libxl driver
      
       virsh snapshot-list test
       error: Invalid snapshot: virDomainSnapshotFree
      
      The error is overwritten by a call to virDomainSnapshotFree
      in cleanup code within cmdSnapshotList.  Prevent overwritting
      the real error by not calling virDomainSnapshotFree with a NULL
      virDomainSnapshotPtr.
      e3b21cdc
  10. 11 7月, 2013 1 次提交
  11. 11 5月, 2013 1 次提交
    • L
      util: move virFile* functions from virutil.c to virfile.c · bfe7721d
      Laine Stump 提交于
      These all existed before virfile.c was created, and for some reason
      weren't moved.
      
      This is mostly straightfoward, although the syntax rule prohibiting
      write() had to be changed to have an exception for virfile.c instead
      of virutil.c.
      
      This movement pointed out that there is a function called
      virBuildPath(), and another almost identical function called
      virFileBuildPath(). They really should be a single function, which
      I'll take care of as soon as I figure out what the arglist should look
      like.
      bfe7721d
  12. 02 5月, 2013 1 次提交
    • M
      virutil: Move string related functions to virstring.c · 7c9a2d88
      Michal Privoznik 提交于
      The source code base needs to be adapted as well. Some files
      include virutil.h just for the string related functions (here,
      the include is substituted to match the new file), some include
      virutil.h without any need (here, the include is removed), and
      some require both.
      7c9a2d88
  13. 21 3月, 2013 4 次提交
  14. 15 3月, 2013 2 次提交
    • M
      Cleanup useless flags specifications · 73cc87d1
      Martin Kletzander 提交于
      After we switched to C99 initialization, I noticed there were many
      places where the specification of .flags parameter differed.  After
      going through many options and deciding whether to unify the
      initialization to be '.flags = 0' or '.flags = VSH_OFLAG_NONE', I
      realized both can be removed and it makes the code easier to go
      through.
      73cc87d1
    • M
      Fix snapshot-create-as syntax in help output · 66f1bbc3
      Martin Kletzander 提交于
      According to the man page, the memspec parameter should have the
      '--memspec' option mandatory and this is as close as we can get to
      that.  What this change does is explained below.
      
      man virsh:
      
      snapshot-create-as ... [[--live] [--memspec memspec]]
      
      virsh help snapshot-create-as before this patch:
      
        SYNOPSIS
          snapshot-create-as ... [<memspec>] ...
      ...
        OPTIONS
          [--memspec] <string> ...
      
      virsh help snapshot-create-as after this patch:
      
        SYNOPSIS
          snapshot-create-as ... [--memspec <string>] ...
      ...
        OPTIONS
          --memspec <string> ...
      66f1bbc3
  15. 11 3月, 2013 1 次提交
  16. 05 3月, 2013 1 次提交
  17. 13 2月, 2013 2 次提交
  18. 11 2月, 2013 2 次提交
  19. 08 2月, 2013 1 次提交
  20. 04 2月, 2013 3 次提交
  21. 17 1月, 2013 1 次提交
  22. 21 12月, 2012 4 次提交
  23. 23 11月, 2012 1 次提交
  24. 20 11月, 2012 2 次提交
    • E
      snapshot: expose location through virsh snapshot-info · 0f9b6ee4
      Eric Blake 提交于
      Now that we can filter on this information, we should also make
      it easy to get at.
      
      * tools/virsh-snapshot.c (cmdSnapshotInfo): Add another output
      row, and switch to XPath queries rather than strstr.
      0f9b6ee4
    • E
      snapshot: add virsh back-compat support for new filters · 1d272e8f
      Eric Blake 提交于
      Snapshot filtering based on types is useful enough to add
      back-compat support into virsh.  It is also rather easy - all
      versions of libvirt that don't understand the new filter flags
      already gave us sufficient information in a single XML field
      to reconstruct all the information we need (that is, it isn't
      until libvirt 1.0.1 that we have more interesting types of
      snapshots, such as offline external).
      
      * tools/virsh-snapshot.c (vshSnapshotFilter): New function.
      (vshSnapshotListCollect): Add fallback support.
      1d272e8f
  25. 19 11月, 2012 1 次提交
    • E
      snapshot: add two more filter sets to API · e9028f4b
      Eric Blake 提交于
      As we enable more modes of snapshot creation, it becomes more important
      to be able to quickly filter based on snapshot properties.  This patch
      introduces new filter flags; subsequent patches will introduce virsh
      back-compat filtering, as well as actual libvirt filtering.
      
      * include/libvirt/libvirt.h.in (virDomainSnapshotListFlags): Add
      five new flags in two new groups.
      * src/libvirt.c (virDomainSnapshotNum, virDomainSnapshotListNames)
      (virDomainListAllSnapshots, virDomainSnapshotNumChildren)
      (virDomainSnapshotListChildrenNames)
      (virDomainSnapshotListAllChildren): Document them.
      * src/conf/snapshot_conf.h (VIR_DOMAIN_SNAPSHOT_FILTERS_STATUS)
      (VIR_DOMAIN_SNAPSHOT_FILTERS_LOCATION): Add new convenience filter
      collection macros.
      * tools/virsh-snapshot.c (cmdSnapshotList): Add 5 new flags.
      * tools/virsh.pod (snapshot-list): Document them.
      e9028f4b
  26. 15 11月, 2012 1 次提交
  27. 08 11月, 2012 2 次提交
    • E
      virsh: add snapshot-create-as memspec support · 2cd4d8e5
      Eric Blake 提交于
      External checkpoints could be created with snapshot-create, but
      without libvirt supplying a default name for the memory file,
      it is essential to add a new argument to snapshot-create-as to
      allow the user to choose the memory file name.  This adds the
      option --memspec [file=]name[,snapshot=type], where type can
      be none, internal, or external.  For an example,
      
      virsh snapshot-create-as $dom --memspec /path/to/file
      
      is the shortest possible command line for creating an external
      checkpoint, named after the current timestamp.
      
      * tools/virsh-snapshot.c (vshParseSnapshotMemspec): New function.
      (cmdSnapshotCreateAs): Use it.
      * tests/virsh-optparse (test_url): Test it.
      * tools/virsh.pod (snapshot-create-as): Document it.
      2cd4d8e5
    • E
      virsh: make ,, escape parsing common · 9d91a18e
      Eric Blake 提交于
      So far, none of the existing callers of vshStringToArray expected
      the user to ever pass a literal comma; meanwhile, snapshot parsing
      had rolled its own array parser.  Moving the comma escaping into
      the common function won't affect any existing callers, and will make
      this function reusable for adding memory handling to snapshot parsing.
      
      As a bonus, the testsuite was already testing snapshot parsing, so
      the fact that the test still passes means that we are now giving
      testsuite exposure to vshStringToArray.
      
      * tools/virsh-snapshot.c (vshParseSnapshotDiskspec): Move ,,
      parsing...
      * tools/virsh.c (vshStringToArray): ...into common function.
      Also, vshStrdup can't fail.
      9d91a18e