1. 12 11月, 2019 3 次提交
  2. 09 11月, 2019 2 次提交
  3. 25 10月, 2019 1 次提交
  4. 24 10月, 2019 1 次提交
    • M
      Drop needless ret variable · 3b4df5d3
      Michal Privoznik 提交于
      In few places we have the following code pattern:
      
        int ret;
        ... /* @ret is not accessed here */
        ret = f(...);
        return ret;
      
      This pattern can be written less verbose:
      
        ...
        return f(...);
      
      This patch was generated with following coccinelle spatch:
      
        @@
        type T;
        constant C;
        expression f;
        identifier ret;
        @@
        -T ret = C;
         ... when != ret
        -ret = f;
        -return ret;
        +return f;
      
      Afterwards I needed to fix a few places, e.g. comment in
      virDomainNetIPParseXML() was removed too because coccinelle
      thinks it refers to @ret while in fact it doesn't. Also in few
      places it replaced @ret declaration with a few spaces instead of
      removing the line. But nothing terribly wrong.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
      3b4df5d3
  5. 21 10月, 2019 2 次提交
  6. 18 10月, 2019 1 次提交
  7. 17 10月, 2019 1 次提交
  8. 16 10月, 2019 2 次提交
  9. 15 10月, 2019 3 次提交
  10. 14 10月, 2019 1 次提交
    • 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
  11. 25 9月, 2019 1 次提交
  12. 19 9月, 2019 1 次提交
  13. 18 9月, 2019 2 次提交
  14. 27 8月, 2019 1 次提交
  15. 09 8月, 2019 2 次提交
  16. 15 7月, 2019 1 次提交
  17. 11 7月, 2019 2 次提交
    • D
      vz: acquire a pidfile in the driver root directory · 7cefe611
      Daniel P. Berrangé 提交于
      When we allow multiple instances of the driver for the same user
      account, using a separate root directory, we need to ensure mutual
      exclusion. Use a pidfile to guarantee this.
      
      In privileged libvirtd this ends up locking
      
         /var/run/libvirt/vz/driver.pid
      
      In unprivileged libvirtd this ends up locking
      
        /run/user/$UID/libvirt/vz/run/driver.pid
      
      NB, the latter can vary depending on $XDG_RUNTIME_DIR
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      7cefe611
    • E
      snapshot: Add VIR_DOMAIN_SNAPSHOT_CREATE_VALIDATE flag · 95f8e323
      Eric Blake 提交于
      We've been doing a terrible job of performing XML validation in our
      various API that parse XML with a corresponding schema (we started
      with domains back in commit dd69a14f, v1.2.12, but didn't catch all
      domain-related APIs, didn't document the use of the flag, and didn't
      cover other XML). New APIs (like checkpoints) should do the validation
      unconditionally, but it doesn't hurt to continue retrofitting existing
      APIs to at least allow the option.
      
      While there are many APIs that could be improved, this patch focuses
      on wiring up a new snapshot XML creation flag through all the
      hypervisors that support snapshots, as well as exposing it in 'virsh
      snapshot-create'.  For 'virsh snapshot-create-as', we blindly set the
      flag without a command-line option, since the XML we create from the
      command line should generally always comply (note that validation
      might cause failures where it used to succeed, such as if we tighten
      the RNG to reject a name of '../\n'); but blindly passing the flag
      means we also have to add in fallback code to disable validation if
      the server is too old to understand the flag.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Acked-by: NPeter Krempa <pkrempa@redhat.com>
      95f8e323
  18. 10 7月, 2019 1 次提交
  19. 19 6月, 2019 1 次提交
  20. 28 5月, 2019 1 次提交
  21. 09 5月, 2019 3 次提交
    • E
      snapshot: Make virDomainSnapshotDef a virObject · 57387ff5
      Eric Blake 提交于
      This brings about a couple of benefits:
      - use of VIR_AUTOUNREF() simplifies several callers
      - Fixes a todo about virDomainMomentObjList not being polymorphic enough
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Acked-by: NPeter Krempa <pkrempa@redhat.com>
      57387ff5
    • E
      snapshot: s/current/parent/ as prep for virObject · 098043ed
      Eric Blake 提交于
      VIR_CLASS_NEW insists that descendents of virObject have 'parent' as
      the name of their inherited base class member at offset 0. While it
      would be possible to write a new class-creation macro that takes the
      actual field name 'current', and rewrite VIR_CLASS_NEW to call the new
      macro with the hard-coded name 'parent', it seems less confusing if
      all object code uses similar naming. Thus, this is a mechanical rename
      in preparation of making virDomainSnapshotDef a descendent of
      virObject.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Acked-by: NPeter Krempa <pkrempa@redhat.com>
      098043ed
    • E
      snapshot: s/parent/parent_name/ as prep for virObject · 36603bc5
      Eric Blake 提交于
      VIR_CLASS_NEW insists that descendents of virObject have 'parent' as
      the name of their inherited base class member at offset 0. While it
      would be possible to write a new class-creation macro that takes the
      actual field name, and rewrite VIR_CLASS_NEW to call the new macro
      with the hard-coded name 'parent', so that we could make
      virDomainMomentDef use a custom name for its base class, it seems less
      confusing if all object code uses similar naming. Thus, this is a
      mechanical rename in preparation of making virDomainSnapshotDef a
      descendent of virObject, when we can no longer use 'parent' for a
      different purpose than the base class.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Acked-by: NPeter Krempa <pkrempa@redhat.com>
      36603bc5
  22. 17 4月, 2019 5 次提交
  23. 12 4月, 2019 1 次提交
  24. 22 3月, 2019 1 次提交