You need to sign in or sign up before continuing.
  1. 18 8月, 2017 1 次提交
  2. 24 7月, 2017 2 次提交
  3. 22 6月, 2017 1 次提交
  4. 12 5月, 2017 1 次提交
  5. 10 5月, 2017 1 次提交
    • D
      Don't inline virStringTrimOptionalNewline · 1a77b97c
      Daniel P. Berrange 提交于
      GCC complains that inlining virStringTrimOptionalNewline is not
      likely on some platforms:
      
        cc1: warnings being treated as errors
        ../../src/util/virfile.c: In function 'virFileReadValueBitmap':
        ../../src/util/virstring.h:292: error: inlining failed in call to 'virStringTrimOptionalNewline': call is unlikely and code size would grow [-Winline]
        ../../src/util/virfile.c:3987: error: called from here [-Winline]
      
      Inlining this function is not going to be a measurable performance
      benefit either, since the time required to execute it is going to
      be dominated by running of strlen() over the string, not by the
      function call overhead.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      1a77b97c
  6. 07 4月, 2017 1 次提交
  7. 06 12月, 2016 2 次提交
  8. 25 11月, 2016 1 次提交
    • M
      virstring: Unify string list function names · c2a5a4e7
      Michal Privoznik 提交于
      We have couple of functions that operate over NULL terminated
      lits of strings. However, our naming sucks:
      
      virStringJoin
      virStringFreeList
      virStringFreeListCount
      virStringArrayHasString
      virStringGetFirstWithPrefix
      
      We can do better:
      
      virStringListJoin
      virStringListFree
      virStringListFreeCount
      virStringListHasString
      virStringListGetFirstWithPrefix
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      c2a5a4e7
  9. 17 8月, 2016 1 次提交
    • A
      util: Make virStringArrayHasString() const-correct · 3edcf834
      Andrea Bolognani 提交于
      The first argument should be const char ** instead of
      char **, because this is a search function and as such it
      doesn't, and shouldn't, alter the haystack in any way.
      
      This change means we no longer have to cast arrays of
      immutable strings to arrays of mutable strings; we still
      have to do the opposite, though, but that's reasonable.
      3edcf834
  10. 16 5月, 2016 2 次提交
  11. 13 4月, 2016 1 次提交
  12. 10 2月, 2016 1 次提交
  13. 09 2月, 2016 1 次提交
  14. 19 8月, 2015 1 次提交
  15. 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
  16. 16 4月, 2015 1 次提交
  17. 22 10月, 2014 1 次提交
  18. 15 10月, 2014 1 次提交
  19. 24 9月, 2014 1 次提交
    • D
      Support passing dict by reference for dbus messages · 88a2dc1f
      Daniel P. Berrange 提交于
      Currently DBus dict values must be passed inline
      
         virDBusMessageEncode("a{ss}",
                              3,
                              "key1", "val1",
                              "key2", "val2",
                              "key3", "val3");
         virDBusMessageDecode("a{ss}",
                              3,
                              &key1, &val1,
                              &key2, &val2,
                              &key3, &val3);
      
      This allows them to be passed by reference
      
         const char **dictin = {
            "key1", "val1",
            "key2", "val2",
            "key3", "val3"
         };
         char **dictout;
         size_t ndictout;
      
         virDBusMessageEncode("a&{ss}",
                              ARRAY_CARDINALITY(dict) / 2,
                              dictin);
         virDBusMessageDecode("a&{ss}",
                              &ndictout,
                              &dictout);
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      88a2dc1f
  20. 21 7月, 2014 1 次提交
    • P
      util: Check return value from virStrToLong* functions · 5df81317
      Peter Krempa 提交于
      We do so in the vast majority of places, so there's no problem of adding
      the attribute to enforce it by the complier and fix a few leftover
      places.
      
      This was originally pointed out by Coverity as a recent change triggered
      it's warning that our code checked the vast majority of returns from
      virStrToLong_ui.
      5df81317
  21. 24 6月, 2014 1 次提交
  22. 06 6月, 2014 1 次提交
  23. 03 6月, 2014 1 次提交
    • P
      util: string: Return element count from virStringSplit · 68226749
      Peter Krempa 提交于
      To allow using the array manipulation macros on the arrays returned by
      virStringSplit we need to know the count of the elements in the array.
      Modify virStringSplit to return this value, rename it and add a helper
      with the old name so that we don't need to update all the code.
      68226749
  24. 02 5月, 2014 1 次提交
    • E
      util: new stricter unsigned int parsing · 7b045c8c
      Eric Blake 提交于
      strtoul() is required to parse negative numbers as their
      twos-complement positive counterpart.  But sometimes we want
      to reject negative numbers.  Add new functions to do this.
      The 'p' suffix is a mnemonic for 'positive' (technically it
      also parses 0, but 'non-negative' doesn't lend itself to a
      nice one-letter suffix).
      
      * src/util/virstring.h (virStrToLong_uip, virStrToLong_ulp)
      (virStrToLong_ullp): New prototypes.
      * src/util/virstring.c (virStrToLong_uip, virStrToLong_ulp)
      (virStrToLong_ullp): New functions.
      * src/libvirt_private.syms (virstring.h): Export them.
      * tests/virstringtest.c (testStringToLong): Test them.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      7b045c8c
  25. 24 2月, 2014 2 次提交
  26. 28 11月, 2013 1 次提交
  27. 18 7月, 2013 1 次提交
    • J
      virAsprintf: correctly check return value · 23e938ee
      Ján Tomko 提交于
      When virAsprintf was changed from a function to a macro
      reporting OOM error in dc6f2dad, it was documented as returning
      0 on success. This is incorrect, it returns the number of bytes
      written as asprintf does.
      
      Some of the functions were converted to use virAsprintf's return
      value directly, changing the return value on success from 0 to >= 0.
      
      For most of these, this is not a problem, but the change in
      virPCIDriverDir breaks PCI passthrough.
      
      The return value check in virhashtest pre-dates virAsprintf OOM
      conversion.
      
      vmwareMakePath seems to be unused.
      23e938ee
  28. 10 7月, 2013 1 次提交
    • M
      Introduce OOM reporting to virAsprintf · dc6f2dad
      Michal Privoznik 提交于
      Actually, I'm turning this function into a macro as filename,
      function name and line number needs to be passed. The new
      function virAsprintfInternal is introduced with the extended set
      of arguments.
      dc6f2dad
  29. 24 5月, 2013 1 次提交
    • M
      virStrndup: Accept negative values as string length · c9357196
      Michal Privoznik 提交于
      It may shorten the code a bit as the following pattern:
      
        VIR_STRNDUP(dst, src, cond ? n : strlen(src))
      
      is used on several places among our code. However, we can
      move the strlen into virStrndup and thus write just:
      
        VIR_STRNDUP(dst, src, cond ? n : -1)
      c9357196
  30. 08 5月, 2013 2 次提交
    • D
      Include process start time when doing polkit checks · 979e9c56
      Daniel P. Berrange 提交于
      Since PIDs can be reused, polkit prefers to be given
      a (PID,start time) pair. If given a PID on its own,
      it will attempt to lookup the start time in /proc/pid/stat,
      though this is subject to races.
      
      It is safer if the client app resolves the PID start
      time itself, because as long as the app has the client
      socket open, the client PID won't be reused.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      979e9c56
    • E
      string: make VIR_STRDUP easier to use · 6b74a9f5
      Eric Blake 提交于
      While reviewing proposed VIR_STRDUP conversions, I've already noticed
      several places that do:
      
      if (str && VIR_STRDUP(dest, str) < 0)
      
      which can be simplified by allowing str to be NULL (something that
      strdup() doesn't allow).  Meanwhile, code that wants to ensure a
      non-NULL dest regardless of the source can check for <= 0.
      
      Also, make it part of the VIR_STRDUP contract that macro arguments
      are evaluated exactly once.
      
      * src/util/virstring.h (VIR_STRDUP, VIR_STRDUP_QUIET, VIR_STRNDUP)
      (VIR_STRNDUP_QUIET): Improve contract.
      * src/util/virstring.c (virStrdup, virStrndup): Change return
      conventions.
      * docs/hacking.html.in: Document this.
      * HACKING: Regenerate.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      6b74a9f5
  31. 05 5月, 2013 1 次提交
    • M
      virstring: Introduce VIR_STRDUP and VIR_STRNDUP · c3abb5c4
      Michal Privoznik 提交于
      The code adaptation is not done right now, but in subsequent patches.
      Hence I am not implementing syntax-check rule as it would break
      compilation. Developers are strongly advised to use these new macros.
      They are similar to VIR_ALLOC() logic: VIR_STRDUP(dst, src) returns zero
      on success, -1 otherwise. In case you don't want to report OOM error,
      use the _QUIET variant of a macro.
      c3abb5c4
  32. 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
  33. 13 4月, 2013 1 次提交
  34. 01 12月, 2012 1 次提交
  35. 21 9月, 2012 1 次提交