1. 16 1月, 2020 1 次提交
  2. 10 12月, 2019 1 次提交
  3. 15 11月, 2019 2 次提交
    • P
      replace use of gnulib snprintf by g_snprintf · 43b01ef2
      Pavel Hrdina 提交于
      Glib implementation follows the ISO C99 standard so it's safe to replace
      the gnulib implementation.
      Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      Reviewed-by: NPeter Krempa <pkrempa@redhat.com>
      43b01ef2
    • J
      Add API to change qemu agent response timeout · 95f5ac9a
      Jonathon Jongsma 提交于
      Some layered products such as oVirt have requested a way to avoid being
      blocked by guest agent commands when querying a loaded vm. For example,
      many guest agent commands are polled periodically to monitor changes,
      and rather than blocking the calling process, they'd prefer to simply
      time out when an agent query is taking too long.
      
      This patch adds a way for the user to specify a custom agent timeout
      that is applied to all agent commands.
      
      One special case to note here is the 'guest-sync' command. 'guest-sync'
      is issued internally prior to calling any other command. (For example,
      when libvirt wants to call 'guest-get-fsinfo', we first call
      'guest-sync' and then call 'guest-get-fsinfo').
      
      Previously, the 'guest-sync' command used a 5-second timeout
      (VIR_DOMAIN_QEMU_AGENT_COMMAND_DEFAULT), whereas the actual command that
      followed always blocked indefinitely
      (VIR_DOMAIN_QEMU_AGENT_COMMAND_BLOCK). As part of this patch, if a
      custom timeout is specified that is shorter than
      5 seconds,  this new timeout is also used for 'guest-sync'. If there is
      no custom timeout or if the custom timeout is longer than 5 seconds, we
      will continue to use the 5-second timeout.
      Signed-off-by: NJonathon Jongsma <jjongsma@redhat.com>
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
      95f5ac9a
  4. 12 11月, 2019 1 次提交
  5. 21 10月, 2019 1 次提交
  6. 16 10月, 2019 2 次提交
  7. 15 10月, 2019 2 次提交
  8. 14 10月, 2019 1 次提交
  9. 31 8月, 2019 1 次提交
  10. 29 8月, 2019 2 次提交
  11. 26 8月, 2019 5 次提交
  12. 10 4月, 2019 1 次提交
  13. 04 2月, 2019 2 次提交
  14. 10 1月, 2019 1 次提交
  15. 09 1月, 2019 1 次提交
  16. 14 12月, 2018 1 次提交
    • D
      Remove all Author(s): lines from source file headers · 60046283
      Daniel P. Berrangé 提交于
      In many files there are header comments that contain an Author:
      statement, supposedly reflecting who originally wrote the code.
      In a large collaborative project like libvirt, any non-trivial
      file will have been modified by a large number of different
      contributors. IOW, the Author: comments are quickly out of date,
      omitting people who have made significant contribitions.
      
      In some places Author: lines have been added despite the person
      merely being responsible for creating the file by moving existing
      code out of another file. IOW, the Author: lines give an incorrect
      record of authorship.
      
      With this all in mind, the comments are useless as a means to identify
      who to talk to about code in a particular file. Contributors will always
      be better off using 'git log' and 'git blame' if they need to  find the
      author of a particular bit of code.
      
      This commit thus deletes all Author: comments from the source and adds
      a rule to prevent them reappearing.
      
      The Copyright headers are similarly misleading and inaccurate, however,
      we cannot delete these as they have legal meaning, despite being largely
      inaccurate. In addition only the copyright holder is permitted to change
      their respective copyright statement.
      Reviewed-by: NErik Skultety <eskultet@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      60046283
  17. 16 11月, 2018 1 次提交
  18. 20 9月, 2018 1 次提交
  19. 11 9月, 2018 2 次提交
  20. 06 9月, 2018 2 次提交
  21. 23 7月, 2018 1 次提交
    • A
      src: Make virStr*cpy*() functions return an int · 6c0d0210
      Andrea Bolognani 提交于
      Currently, the functions return a pointer to the
      destination buffer on success or NULL on failure.
      
      Not only does this kind of error handling look quite
      alien in the context of libvirt, where most functions
      return zero on success and a negative int on failure,
      but it's also somewhat pointless because unless there's
      been a failure the returned pointer will be the same
      one passed in by the user, thus offering no additional
      value.
      
      Change the functions so that they return an int
      instead.
      Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
      6c0d0210
  22. 06 6月, 2018 2 次提交
    • R
      all: Replace virGetLastError with virGetLastErrorCode where we can · 2b6667ab
      ramyelkest 提交于
      Replace instances where we previously called virGetLastError just to
      either get the code or to check if an error exists with
      virGetLastErrorCode to avoid a validity pre-check.
      Signed-off-by: NRamy Elkest <ramyelkest@gmail.com>
      Reviewed-by: NErik Skultety <eskultet@redhat.com>
      2b6667ab
    • D
      qemu: remove pointless connect retry logic in agent · fc06debd
      Daniel P. Berrangé 提交于
      When the agent code was first introduced back in
      
        commit c160ce33
        Author: Daniel P. Berrange <berrange@redhat.com>
        Date:   Wed Oct 5 18:31:54 2011 +0100
      
          QEMU guest agent support
      
      there was code that would loop and retry the connection when opening
      the agent socket. At this time, the only thing done in between the
      opening of the monitor socket & opening of the agent socket was a
      call to set the monitor capabilities. This was a no-op on non-QMP
      versions, so in theory there could be a race which let us connect
      to the monitor while the agent socket was still not created by QEMU.
      
      In the modern world, however, we long ago mandated the use of QMP
      for managing QEMU, so we're guaranteed to have a set capabilities
      QMP call. Once we've seen a reply to this, we're guaranteed that
      QEMU has fully initialized all backends and is in its event loop.
      
      We can thus be sure the QEMU agent socket is present and don't need
      to retry connections to it, even without having the chardev FD passing
      feature.
      Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      fc06debd
  23. 11 5月, 2018 1 次提交
    • J
      util: Clean up consumers of virJSONValueArraySize · 4a3d6ed5
      John Ferlan 提交于
      Rather than have virJSONValueArraySize return a -1 when the input
      is not an array and then splat an error message, let's check for
      an array before calling and then change the return to be a size_t
      instead of ssize_t.
      
      That means using the helper virJSONValueIsArray as well as using a
      more generic error message such as "Malformed <something> array".
      In some cases we can remove stack variables and when we cannot,
      those variables should be size_t not ssize_t. Alter a few references
      of if (!value) to be if (value == 0) instead as well.
      
      Some callers can already assume an array is being worked on based
      on the previous call, so there's less to do.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      Reviewed-by: NJán Tomko <jtomko@redhat.com>
      4a3d6ed5
  24. 04 5月, 2018 1 次提交
  25. 18 4月, 2018 1 次提交
    • M
      virobject: Introduce VIR_CLASS_NEW() macro · 10f94828
      Michal Privoznik 提交于
      So far we are repeating the following lines over and over:
      
        if (!(virSomeObjectClass = virClassNew(virClassForObject(),
                                   "virSomeObject",
                                   sizeof(virSomeObject),
                                   virSomeObjectDispose)))
            return -1;
      
      While this works, it is impossible to do some checking. Firstly,
      the class name (the 2nd argument) doesn't match the name in the
      code in all cases (the 3rd argument). Secondly, the current style
      is needlessly verbose. This commit turns example into following:
      
        if (!(VIR_CLASS_NEW(virSomeObject,
                            virClassForObject)))
            return -1;
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
      10f94828
  26. 03 4月, 2018 3 次提交