1. 21 10月, 2019 6 次提交
  2. 18 10月, 2019 3 次提交
  3. 17 10月, 2019 8 次提交
  4. 16 10月, 2019 8 次提交
  5. 15 10月, 2019 8 次提交
  6. 14 10月, 2019 6 次提交
    • M
      security: Pass @migrated to virSecurityManagerSetAllLabel · 458d0a8c
      Michal Privoznik 提交于
      In upcoming commits, virSecurityManagerSetAllLabel() will perform
      rollback in case of failure by calling
      virSecurityManagerRestoreAllLabel(). But in order to do that, the
      former needs to have @migrated argument so that it can be passed
      to the latter.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NCole Robinson <crobinso@redhat.com>
      458d0a8c
    • D
      build: remove use of usleep gnulib module in favour of g_usleep · 27cb4c1a
      Daniel P. Berrangé 提交于
      The usleep function was missing on older mingw versions, but we can rely
      on it existing everywhere these days. It may only support times upto 1
      second in duration though, so we'll prefer to use g_usleep instead.
      
      The commandhelper program is not changed since that can't link to glib.
      Fortunately it doesn't need to build on Windows platforms either.
      Reviewed-by: NJán Tomko <jtomko@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      27cb4c1a
    • D
      util: convert virIdentity class to use GObject · 16121a88
      Daniel P. Berrangé 提交于
      Converting from virObject to GObject is reasonably straightforward,
      as illustrated by this patch for virIdentity
      
      In the header file
      
       - Remove
      
           typedef struct _virIdentity virIdentity
      
       - Add
      
           #define VIR_TYPE_IDENTITY virIdentity_get_type ()
           G_DECLARE_FINAL_TYPE (virIdentity, vir_identity, VIR, IDENTITY, GObject);
      
         Which provides the typedef we just removed, and class
         declaration boilerplate and various other constants/macros.
      
      In the source file
      
       - Change 'virObject parent' to 'GObject parent' in the struct
       - Remove the virClass variable and its initializing call
       - Add
      
            G_DEFINE_TYPE(virIdentity, vir_identity, G_TYPE_OBJECT)
      
         which declares the instance & class constructor functions
      
       - Add an impl of the instance & class constructors
         wiring up the finalize method to point to our dispose impl
      
      In all files
      
       - Replace VIR_AUTOUNREF(virIdentityPtr) with g_autoptr(virIdentity)
      
       - Replace virObjectRef/Unref with g_object_ref/unref. Note
         the latter functions do *NOT* accept a NULL object where as
         libvirt's do. If you replace g_object_unref with g_clear_object
         it is NULL safe, but also clears the pointer.
      Reviewed-by: NJán Tomko <jtomko@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      16121a88
    • D
      util: use glib base64 encoding/decoding APIs · 6c748c8e
      Daniel P. Berrangé 提交于
      Replace use of the gnulib base64 module with glib's own base64 API family.
      Reviewed-by: NJán Tomko <jtomko@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      6c748c8e
    • 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
      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
  7. 10 10月, 2019 1 次提交