1. 17 10月, 2019 1 次提交
  2. 15 10月, 2019 2 次提交
  3. 14 10月, 2019 6 次提交
    • D
      util: replace strerror/strerror_r with g_strerror · c4d18e8b
      Daniel P. Berrangé 提交于
      g_strerror is offers the safety/correctness benefits of strerror_r, with
      the API design convenience of strerror.
      
      Use of virStrerror should be eliminated through the codebase in favour
      of g_strerror.
      
      commandhelper.c is a special case as its a tiny single threaded test
      program, not linked to glib, so it just uses traditional strerror().
      Reviewed-by: NJán Tomko <jtomko@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      c4d18e8b
    • D
      src: add support for g_autoptr with virObject instances · 667ff797
      Daniel P. Berrangé 提交于
      Libvirt currently uses the VIR_AUTOUNREF macro for auto cleanup of
      virObject instances. GLib approaches things differently with GObject,
      reusing their g_autoptr() concept.
      
      This introduces support for g_autoptr() with virObject, to facilitate
      the conversion to GObject.
      
      Only virObject classes which are currently used with VIR_AUTOREF are
      updated. Any others should be converted to GObject before introducing
      use of autocleanup.
      Reviewed-by: NJán Tomko <jtomko@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      667ff797
    • D
      util: rewrite auto cleanup macros to use glib's equivalent · 44e7f029
      Daniel P. Berrangé 提交于
      To facilitate porting over to glib, this rewrites the auto cleanup
      macros to use glib's equivalent.
      
      As a result it is now possible to use g_autoptr/VIR_AUTOPTR, and
      g_auto/VIR_AUTOCLEAN, g_autofree/VIR_AUTOFREE interchangably, regardless
      of which macros were used to declare the cleanup types.
      
      Within the scope of any single method, code must remain consistent
      using either GLib or Libvirt macros, never mixing both. New code
      must preferentially use the GLib macros, and old code will be
      converted incrementally.
      Reviewed-by: NJán Tomko <jtomko@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      44e7f029
    • D
      util: use glib string allocation/formatting functions · bb9a1a14
      Daniel P. Berrangé 提交于
      Convert the string duplication APIs to use the g_strdup family of APIs.
      
      We previously used the 'strdup-posix' gnulib module because mingw does
      not set errno to ENOMEM on failure
      
      We previously used the 'strndup' gnulib module because this function
      does not exist on mingw.
      
      We previously used the 'vasprintf' gnulib module because of many GNU
      supported format specifiers not working on non-Linux platforms. glib's
      own equivalent standardizes on GNU format specifiers too.
      Reviewed-by: NJán Tomko <jtomko@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      bb9a1a14
    • D
      util: use glib memory allocation functions · e85e34f3
      Daniel P. Berrangé 提交于
      Convert the VIR_ALLOC family of APIs with use of the g_malloc family of
      APIs. Use of VIR_ALLOC related functions should be incrementally phased
      out over time, allowing return value checks to be dropped. Use of
      VIR_FREE should be replaced with auto-cleanup whenever possible.
      
      We previously used the 'calloc-posix' gnulib module because mingw does
      not set errno to ENOMEM on failure.
      Reviewed-by: NJán Tomko <jtomko@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      e85e34f3
    • D
      build: link to glib library · cfbe9f12
      Daniel P. Berrangé 提交于
      Add the main glib.h to internal.h so that all common code can use it.
      
      Historically glib allowed applications to register an alternative
      memory allocator, so mixing g_malloc/g_free with malloc/free was not
      safe.
      
      This was feature was dropped in 2.46.0 with:
      
            commit 3be6ed60aa58095691bd697344765e715a327fc1
            Author: Alexander Larsson <alexl@redhat.com>
            Date:   Sat Jun 27 18:38:42 2015 +0200
      
              Deprecate and drop support for memory vtables
      
      Applications are still encourged to match g_malloc/g_free, but it is no
      longer a mandatory requirement for correctness, just stylistic. This is
      explicitly clarified in
      
          commit 1f24b36607bf708f037396014b2cdbc08d67b275
          Author: Daniel P. Berrangé <berrange@redhat.com>
          Date:   Thu Sep 5 14:37:54 2019 +0100
      
              gmem: clarify that g_malloc always uses the system allocator
      
      Applications can still use custom allocators in general, but they must
      do this by linking to a library that replaces the core malloc/free
      implemenentation entirely, instead of via a glib specific call.
      
      This means that libvirt does not need to be concerned about use of
      g_malloc/g_free causing an ABI change in the public libary, and can
      avoid memory copying when talking to external libraries.
      
      This patch probes for glib, which provides the foundation layer with
      a collection of data structures, helper APIs, and platform portability
      logic.
      
      Later patches will introduce linkage to gobject which provides the
      object type system, built on glib, and gio which providing objects
      for various interesting tasks, most notably including DBus client
      and server support and portable sockets APIs, but much more too.
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      cfbe9f12
  4. 11 10月, 2019 1 次提交
  5. 10 10月, 2019 3 次提交
  6. 08 10月, 2019 1 次提交
  7. 07 10月, 2019 1 次提交
  8. 05 10月, 2019 1 次提交
  9. 01 10月, 2019 1 次提交
    • D
      docs: attempt to document the general libvirt dev strategy · 557ac8cb
      Daniel P. Berrangé 提交于
      There are various ideas / plans floating around for future libvirt work,
      some of which is actively in progress. Historically we've never captured
      this kind of information anywhere, except in mailing list discussions.
      In particular guidelines in hacking.html.in don't appear until a policy
      is actively applied.
      
      This patch attempts to fill the documentation gap, by creating a new
      "strategy" page which outlines the general vision for some notable
      future changes. The key thing to note is that none of the stuff on this
      page is guaranteed, plans may change as new information arises. IOW this
      is a "best guess" as to the desired future.
      
      This doc has focused on three areas, related to the topic of language
      usage / consolidation
      
       - Use of non-C languages for the library, daemons or helper tools
       - Replacement of autotools with meson
       - Use of RST and Sphinx for documentation (website + man pages)
      Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NAndrea Bolognani <abologna@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      557ac8cb
  10. 30 9月, 2019 1 次提交
  11. 27 9月, 2019 1 次提交
  12. 25 9月, 2019 3 次提交
  13. 24 9月, 2019 1 次提交
    • D
      build: force a UTF-8 locale for python · ada26801
      Daniel P. Berrangé 提交于
      Python3 versions less than 3.7 have very unhelpful handling
      of the C locale where they assume data is 7-bit only. This
      violates POSIX which requires the C locale to be 8-bit clean.
      Python3 >= 3.7 now assumes that the C locale is always UTF-8.
      
      Set env variables to force LC_CTYPE to en_US.UTF-8 so that
      we get UTF-8 handling on all python versions. Note we do
      not use C.UTF-8 since not all C libraries support that.
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      ada26801
  14. 23 9月, 2019 1 次提交
  15. 13 9月, 2019 1 次提交
  16. 11 9月, 2019 1 次提交
  17. 10 9月, 2019 1 次提交
    • L
      conf: new "managed" attribute for target dev of <interface type='ethernet'> · 77f72a86
      Laine Stump 提交于
      Although <interface type='ethernet'> has always been able to use an
      existing tap device, this is just a coincidence due to the fact that
      the same ioctl is used to create a new tap device or get a handle to
      an existing device.
      
      Even then, once we have the handle to the device, we still insist on
      doing extra setup to it (setting the MAC address and IFF_UP).  That
      *might* be okay if libvirtd is running as a privileged process, but if
      libvirtd is running as an unprivileged user, those attempted
      modifications to the tap device will fail (yes, even if the tap is set
      to be owned by the user running libvirtd). We could avoid this if we
      knew that the device already existed, but as stated above, an existing
      device and new device are both accessed in the same manner, and
      anyway, we need to preserve existing behavior for those who are
      already using pre-existing devices with privileged libvirtd (and
      allowing/expecting libvirt to configure the pre-existing device).
      
      In order to cleanly support the idea of using a pre-existing and
      pre-configured tap device, this patch introduces a new optional
      attribute "managed" for the interface <target> element. This
      attribute is only valid for <interface type='ethernet'> (since all
      other interface types have mandatory config that doesn't apply in the
      case where we expect the tap device to be setup before we
      get it). The syntax would look something like this:
      
         <interface type='ethernet'>
            <target dev='mytap0' managed='no'/>
            ...
         </interface>
      
      This patch just adds managed to the grammar and parser for <target>,
      but has no functionality behind it.
      
      (NB: when managed='no' (the default when not specified is 'yes'), the
      target dev is always a name explicitly provided, so we don't
      auto-remove it from the config just because it starts with "vnet"
      (VIR_NET_GENERATED_TAP_PREFIX); this makes it possible to use the
      same pattern of names that libvirt itself uses when it automatically
      creates the tap devices.)
      Signed-off-by: NLaine Stump <laine@redhat.com>
      Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
      77f72a86
  18. 09 9月, 2019 1 次提交
    • D
      docs: remove devhelp API docs · 926b7b6e
      Daniel P. Berrangé 提交于
      We currently generate two completely separate API references for the
      libvirt public API. One at 'docs/html/' and one at 'docs/devhelp/'.
      Both are published on the website, but we only link to content in
      the 'docs/html/' pages.
      
      Both are installed in the libvirt-docs sub-RPM, with a full copy
      of the website including 'docs/html/' in /usr/share/docs/libvirt-docs,
      while the 'docs/devhelp/' content goes to /usr/share/gtk-doc/. The
      latter was broken for years until:
      
        commit ca6f6025
        Author: Andrea Bolognani <abologna@redhat.com>
        Date:   Fri May 10 14:54:52 2019 +0200
      
          docs: Introduce $(devhelphtml_generated)
      
          Our XSLT magic generates one Devhelp-compatible HTML file
          per documentation module, but so far we have only shipped
          and installed documentation for virterror.
      
          Now that we have $(modules), however, we can generate the
          list of files the same way we do for regular documentation
          and make sure we always ship and install everything.
      
      That this bug went unnoticed for so long is a sign of how few
      people are using the devhelp docs. The only commits to the devhelp
      code since it was first introduced have been fixing various build
      problems that hit.
      
      The only obvious difference between the two sets of docs is the CSS
      styling in use. Overall devhelp does not look compelling enough to
      justify having two duplicated sets of API docs. Eliminating it will
      reduce the amount of XSL code we are carrying in the tree which is
      an attractive benefit.
      Reviewed-by: NPavel Hrdina <phrdina@redhat.com>
      Reviewed-by: NAndrea Bolognani <abologna@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      926b7b6e
  19. 04 9月, 2019 4 次提交
  20. 03 9月, 2019 4 次提交
  21. 29 8月, 2019 1 次提交
  22. 28 8月, 2019 2 次提交
  23. 23 8月, 2019 1 次提交