1. 25 9月, 2019 2 次提交
    • P
      util: typedparam: Simplify handling of lists of typed parameters · 33773355
      Peter Krempa 提交于
      Introduce a new set of helpers including a new data structure which
      simplifies keeping and construction of lists of typed parameters.
      
      The use of VIR_RESIZE_N in the virTypedParamsAdd API has performance
      benefits but requires passing around 3 arguments. Use of them lead to a
      set of macros with embedded jumps used in the qemu statistics code.
      
      This patch introduces 'virTypedParamList' type which aggregates the
      necessary list-keeping variables and also a new set of functions to add
      new typed parameters to a list.
      
      These new helpers use printf-like format string and arguments to format
      the argument name as the stats code often uses indexed typed parameters.
      
      The accessor function then allows extracting the typed parameter list in
      the same format as virTypedParamsAdd* functions would do.
      
      One additional benefit is also that the list function can easily be used
      with VIR_AUTOPTR.
      Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
      Reviewed-by: NJán Tomko <jtomko@redhat.com>
      33773355
    • P
      util: typedparam: Move and unexport virTypedParameterAssignFromStr · e532aa61
      Peter Krempa 提交于
      The function is only used as a helper in virTypedParamsAddFromString.
      Make it static and move it to virtypedparam-public.c.
      Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
      Reviewed-by: NJán Tomko <jtomko@redhat.com>
      e532aa61
  2. 28 8月, 2019 1 次提交
  3. 19 6月, 2019 1 次提交
  4. 10 4月, 2019 1 次提交
  5. 04 2月, 2019 1 次提交
  6. 14 12月, 2018 2 次提交
  7. 03 11月, 2017 1 次提交
    • A
      Remove backslash alignment attempts · 3e7db8d3
      Andrea Bolognani 提交于
      Right-aligning backslashes when defining macros or using complex
      commands in Makefiles looks cute, but as soon as any changes is
      required to the code you end up with either distractingly broken
      alignment or unnecessarily big diffs where most of the changes
      are just pushing all backslashes a few characters to one side.
      
      Generated using
      
        $ git grep -El '[[:blank:]][[:blank:]]\\$' | \
          grep -E '*\.([chx]|am|mk)$$' | \
          while read f; do \
            sed -Ei 's/[[:blank:]]*[[:blank:]]\\$/ \\/g' "$f"; \
          done
      Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
      3e7db8d3
  8. 23 3月, 2017 1 次提交
  9. 28 5月, 2016 1 次提交
    • M
      Turn 1<<31 into 1U<<31 · 0628f349
      Michal Privoznik 提交于
      Apparently, 1 << 31 is signed which in turn does not fit into
      a signed integer variable:
      
      ../../include/libvirt/libvirt-domain.h:1881:57: error: result of '1 << 31' requires 33 bits to represent, but 'int' only has 32 bits [-Werror=shift-overflow=]
           VIR_CONNECT_GET_ALL_DOMAINS_STATS_ENFORCE_STATS = 1 << 31, /* enforce requested stats */
                                                               ^~
      cc1: all warnings being treated as errors
      
      The solution is to make it an unsigned value. I've found only two
      such occurrences in our code base.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      0628f349
  10. 03 2月, 2016 4 次提交
    • E
      util: Export remoteSerializeTypedParameters internally via util · 8cd1d546
      Erik Skultety 提交于
      Same as for deserializer, this method might get handy for admin one day.
      The major reason for this patch is to stay consistent with idea, i.e.
      when deserializer can be shared, why not serializer as well. The only
      problem to be solved was that the daemon side serializer uses a code
      snippet which handles sparse arrays returned by some APIs as well as
      removes any string parameters that can't be returned to older clients.
      This patch makes of the new virTypedParameterRemote datatype introduced
      by one of the pvious patches.
      8cd1d546
    • E
      util: Export remoteFreeTypedParameters internally via util · 9afc115f
      Erik Skultety 提交于
      Since the method is static to remote_driver, it can't even be used by our
      daemon. Other than that, it would be useful to be able to use it with admin as
      well. This patch uses the new virTypedParameterRemote datatype introduced in
      one of previous patches.
      9afc115f
    • E
      util: Export remoteDeserializeTypedParameters internally via util · 0472cef6
      Erik Skultety 提交于
      Currently, the deserializer is hardcoded into remote_driver which makes
      it impossible for admin to use it. One way to achieve a shared implementation
      (besides moving the code to another module) would be pass @ret_params_val as a
      void pointer as opposed to the remote_typed_param pointer and add a new extra
      argument specifying which of those two protocols is being used and typecast
      the pointer at the function entry. An example from remote_protocol:
      
      struct remote_typed_param_value {
              int type;
              union {
                      int i;
                      u_int ui;
                      int64_t l;
                      uint64_t ul;
                      double d;
                      int b;
                      remote_nonnull_string s;
              } remote_typed_param_value_u;
      };
      typedef struct remote_typed_param_value remote_typed_param_value;
      
      struct remote_typed_param {
              remote_nonnull_string field;
              remote_typed_param_value value;
      };
      
      That would leave us with a bunch of if-then-elses that needed to be used across
      the method. This patch takes the other approach using the new datatype
      introduced in one of earlier commits.
      0472cef6
    • E
      util: Introduce virTypedParameterRemote datatype · 41a45994
      Erik Skultety 提交于
      Both admin and remote protocols define their own types
      (remote_typed_param vs admin_typed_param). Because of the naming convention,
      admin typed params wouldn't be able to reuse the serialization/deserialization
      methods, which are tailored for use by remote protocol, even if those method
      were exported properly. In that case, introduce a new internal data type
      structurally copying both admin and remote protocols which, eventually, would
      allow serializer and deserializer to be used in a more generic way.
      41a45994
  11. 18 6月, 2015 2 次提交
  12. 25 6月, 2013 5 次提交
  13. 18 1月, 2013 1 次提交
  14. 21 9月, 2012 1 次提交
  15. 07 9月, 2012 1 次提交
  16. 23 7月, 2012 1 次提交
    • O
      Desert the FSF address in copyright · f9ce7dad
      Osier Yang 提交于
      Per the FSF address could be changed from time to time, and GNU
      recommends the following now: (http://www.gnu.org/licenses/gpl-howto.html)
      
        You should have received a copy of the GNU General Public License
        along with Foobar.  If not, see <http://www.gnu.org/licenses/>.
      
      This patch removes the explicit FSF address, and uses above instead
      (of course, with inserting 'Lesser' before 'General').
      
      Except a bunch of files for security driver, all others are changed
      automatically, the copyright for securify files are not complete,
      that's why to do it manually:
      
        src/security/security_selinux.h
        src/security/security_driver.h
        src/security/security_selinux.c
        src/security/security_apparmor.h
        src/security/security_apparmor.c
        src/security/security_driver.c
      f9ce7dad
  17. 12 3月, 2012 1 次提交
    • E
      cpustats: report user and sys times · 759095f6
      Eric Blake 提交于
      Thanks to cgroups, providing user vs. system time of the overall
      guest is easy to add to our existing API.
      
      * include/libvirt/libvirt.h.in (VIR_DOMAIN_CPU_STATS_USERTIME)
      (VIR_DOMAIN_CPU_STATS_SYSTEMTIME): New constants.
      * src/util/virtypedparam.h (virTypedParameterArrayValidate)
      (virTypedParameterAssign): Enforce checking the result.
      * src/qemu/qemu_driver.c (qemuDomainGetPercpuStats): Fix offender.
      (qemuDomainGetTotalcpuStats): Implement new parameters.
      * tools/virsh.c (cmdCPUStats): Tweak output accordingly.
      759095f6
  18. 20 1月, 2012 1 次提交
    • E
      util: add new file for virTypedParameter utils · 61ca98b0
      Eric Blake 提交于
      Preparation for another patch that refactors common patterns
      into the new file for fewer lines of code overall.
      
      * src/util/util.h (virTypedParameterArrayClear): Move...
      * src/util/virtypedparam.h: ...to new file.
      (virTypedParameterArrayValidate, virTypedParameterAssign): New
      prototypes.
      * src/util/util.c (virTypedParameterArrayClear): Likewise.
      * src/util/virtypedparam.c: New file.
      * po/POTFILES.in: Mark file for translation.
      * src/Makefile.am (UTIL_SOURCES): Build it.
      * src/libvirt_private.syms (util.h): Split...
      (virtypedparam.h): to new section.
      (virkeycode.h): Sort.
      * daemon/remote.c: Adjust callers.
      * tools/virsh.c: Likewise.
      61ca98b0
  19. 26 8月, 2011 3 次提交
    • M
      hyperv: Add basic driver for Microsoft Hyper-V · 5e3b0f8b
      Matthias Bolte 提交于
      Domain listing, basic information retrieval and domain life cycle
      management is implemented. But currently the domain XML output
      lacks the complete devices section.
      
      The driver uses OpenWSMAN to directly communicate with a Hyper-V
      server over its WS-Management interface exposed via Microsoft WinRM.
      
      The driver is based on the work of Michael Sievers. This started in
      the same master program project group at the University of Paderborn
      as the ESX driver.
      
      See Michael's blog for details: http://hyperv4libvirt.wordpress.com/
      5e3b0f8b
    • M
      hyperv: Add OpenWSMAN based client for the Hyper-V WMI API · e224b6f8
      Matthias Bolte 提交于
      Add a generator script to generate the structs and serialization
      information for OpenWSMAN.
      
      openwsman.h collects workarounds for problems in OpenWSMAN <= 2.2.6.
      There are also disabled sections that would use ws_serializer_free_mem
      but can't because it's broken in OpenWSMAN <= 2.2.6. Patches to fix
      this have been posted upstream.
      e224b6f8
    • M
      hyperv: Add driver skeleton · 4d6e6f4a
      Matthias Bolte 提交于
      4d6e6f4a
  20. 23 3月, 2010 1 次提交
  21. 10 3月, 2010 1 次提交
  22. 18 1月, 2010 1 次提交
  23. 24 7月, 2009 1 次提交
    • M
      First version of the driver for VMWare ESX · e2aeee68
      Matthias Bolte 提交于
      * src/esx/esx_*.[ch]: the driver, uses a remote minimal SOAP client
        to talk to the VI services on ESX nodes.
      * configure.in include/libvirt/virterror.h src/Makefile.am src/driver.h
        src/libvirt.c src/virterror.c: glue in the new driver
      e2aeee68
  24. 16 1月, 2009 1 次提交
  25. 20 11月, 2008 1 次提交
  26. 10 10月, 2008 1 次提交
  27. 21 8月, 2008 1 次提交
  28. 08 2月, 2008 1 次提交
    • M
      Fix gcc-4.3.0 "inlining failed" warning. · 3da5504e
      Mark McLoughlin 提交于
      * src/internal.h: move xstrol() variants from here ...
      
      * src/util.[ch]: ... to here and rename to virStrToLong()
      
      * src/libvirt_sym.version: export __virStrToLong_i() for
      virsh and qemud.
      
      * src/nodeinfo.c, src/stats_linux.c, src/virsh.c,
        src/xend_internal.c, qemud/qemud.c: replace xstrtol()
      calls with virStrToLong()
      
      * src/nodeinfo.h: don't include internal.h, which was only
      needed for xstrtol(), but instead include libvirt.h which
      is suffificient for the declarations in the header.
      3da5504e