1. 11 12月, 2019 5 次提交
  2. 10 12月, 2019 1 次提交
  3. 09 11月, 2019 1 次提交
  4. 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
  5. 30 9月, 2019 1 次提交
  6. 14 8月, 2019 1 次提交
  7. 09 8月, 2019 11 次提交
  8. 08 8月, 2019 1 次提交
    • D
      tools: avoid accidentally using files from gnulib · 8242ce4f
      Daniel P. Berrangé 提交于
      The AM_CPPFLAGS setting includes the gnulib headers, which
      means we can get some replacement functions defined. Since
      virt-login-shell and the NSS module intentionally don't link
      to gnulib, these replacement functions causes link failures.
      
      This was seen cross-compiling on Debian for example:
      
      virt-login-shell.o: In function `main':
      /builds/libvirt/libvirt/build/tools/../../tools/virt-login-shell.c:81: undefined reference to `rpl_strerror'
      /builds/libvirt/libvirt/build/tools/../../tools/virt-login-shell.c:66: undefined reference to `rpl_strerror'
      /builds/libvirt/libvirt/build/tools/../../tools/virt-login-shell.c:75: undefined reference to `rpl_strerror'
      
      The only way to avoid these replacement gnulib headers is
      to drop the -Ignulib/lib flags. We do still want to use
      gnulib for configmake.h and intprops.h, but those can be
      included via their full path.
      
      We must also stop using internal.h, since that expects
      -Ignulib/lib to be on the include path in order to resolve
      the verify.h header.
      Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      8242ce4f
  9. 07 8月, 2019 5 次提交
    • D
      nss: only link to yajl library and nothing else · 4ab46435
      Daniel P. Berrangé 提交于
      Now that the code does not refer to any libvirt headers,
      except internal.h macros, it does not need to link to
      any libvirt code, nor gnulib either. The only thing it
      needs is yajl.
      Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      4ab46435
    • D
      nss: custom parser for loading .leases file · 18a4b247
      Daniel P. Berrangé 提交于
      The .leases file is currently loaded using the virLease class,
      which in turn uses the virJSON parsing code. This pulls in a
      heap of libvirt code (logging, hash tables, etc) which we do
      not wish to depend on.
      
      This uses the yajl parser code directly, so the only dep is
      yajl and plain libc functions.
      Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      18a4b247
    • D
      nss: custom parser for loading .macs file · 904d60b0
      Daniel P. Berrangé 提交于
      The .macs file is currently loaded using the virMacMap class,
      which in turn uses the virJSON parsing code. This pulls in a
      heap of libvirt code (logging, hash tables, objects, etc) which
      we do not wish to depend on.
      
      This uses the yajl parser code directly, so the only dep is
      yajl and plain libc functions.
      Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      904d60b0
    • D
      tools: split virt-login-shell into two binaries · 4feeb2d9
      Daniel P. Berrangé 提交于
      The virt-login-shell binary is a setuid program that takes
      no arguments. When invoked it looks at the invoking uid,
      resolves it to a username, and finds an LXC guest with the
      same name. It then starts the guest and runs the shell in
      side the namespaces of the container.
      
      Given this set of tasks the virt-login-shell binary needs
      to connect to libvirtd, make various other libvirt API calls.
      This is a problem for setuid binaries as various libraries
      that libvirt.so links to are not safe. For example, they have
      constructor functions which execute an unknown amount of code
      that can be influenced by env variables.
      
      For this reason virt-login-shell doesn't use libvirt.so,
      but instead links to a custom, cut down, set of source files
      sufficient to be a local client only.
      
      This introduces a problem for integrating glib2 into libvirt
      though, as once integrated, there would be no way to build
      virt-login-shell without an external dependancy on glib2 and
      this is definitely not setuid safe.
      
      To resolve this problem, we split the virt-login-shell binary
      into two parts. The first part is setuid and does almost
      nothing. It simply records the original uid+gid, and then
      invokes the virt-login-shell-helper binary. Crucially when
      it does this it completes scrubs all environment variables.
      It is thus safe for virt-login-shell-helper to link to the
      normal libvirt.so. Any things that constructor functions
      do cannot be influenced by user control env vars or cli
      args.
      Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      4feeb2d9
    • D
      tools: rename source for virt-login-shell · 46754ffb
      Daniel P. Berrangé 提交于
      We'll shortly be renaming the binary to virt-login-shell-helper
      and introducing a new tool as virt-login-shell. Renaming the
      source file first gives a much more usefull diff for the next
      commit.
      Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      46754ffb
  10. 27 7月, 2019 1 次提交
    • E
      backup: Implement virsh support for checkpoints · 689beaa4
      Eric Blake 提交于
      Introduce a bunch of new virsh commands for managing checkpoints in
      isolation. More commands are needed for performing incremental
      backups, but these commands were easy to implement by modeling heavily
      after virsh-snapshot.c. There is no need for checkpoint-revert or
      checkpoint-current since those snapshot APIs have no checkpoint
      counterpart.  Similarly, it is not necessary to change which
      checkpoint is current when redefining from XML, since until we
      integrate checkpoints with snapshots, there is only a linear chain
      (and you can deduce the current checkpoint by instead using
      'checkpoint-list --leaves').  Other aspects of checkpoint-list are
      also a bit simpler than the snapshot counterpart, in part because we
      don't have to cater to back-compat to older API.
      
      Upcoming patches will test these interfaces once the test driver
      supports checkpoints.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
      689beaa4
  11. 16 3月, 2019 1 次提交
  12. 15 3月, 2019 1 次提交
  13. 12 2月, 2019 1 次提交
    • M
      tools: Keep wireshark plugin registration code in git · a87a75e5
      Michal Privoznik 提交于
      In order to be able to dissect libvirt protocol the wireshark
      plugin needs to be registered. So far this plugin registration
      code was generated on every build using a script that was copied
      over from wireshark's tools/ directory.
      
      This is suboptimal, because the way that plugins register changes
      across wireshark releases. Therefore, let's keep the generated
      file in the git, put the command line used to generate the file
      into a comment and remove the script.
      
      This solution allows us to put different registration mechanism
      into one file (under #ifdef-s) and thus compile with wider range
      of wireshark releases.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NJán Tomko <jtomko@redhat.com>
      a87a75e5
  14. 08 1月, 2019 2 次提交
  15. 19 12月, 2018 1 次提交
  16. 24 8月, 2018 1 次提交
  17. 13 8月, 2018 2 次提交
  18. 10 8月, 2018 1 次提交
  19. 09 8月, 2018 1 次提交
    • J
      Fix link errors in tools/nss and tests · b3d9b08e
      Jim Fehlig 提交于
      While local builds succeed fine, a build worker building in a chroot
      environment is encountering errors when linking some items in tools/nss
      and tests, e.g.
      
      [  469s] libtool: link: gcc -shared  -fPIC -DPIC  -Wl,--whole-archive nss/.libs/libnss_libvirt_impl.a -Wl,--no-whole-archive  -lpthread -lutil -ltirpc  -fstack-protector-strong -grecord-gcc-switches -O2 -fstack-protector-strong -g -Wl,--version-script=./nss/libvirt_nss.syms -Wl,-z -Wl,relro -Wl,-z -Wl,now -Wl,--no-copy-dt-needed-entries -Wl,-z -Wl,defs -grecord-gcc-switches -O2 -fstack-protector-strong -g   -pthread -Wl,-soname -Wl,libnss_libvirt.so.2 -o nss/.libs/libnss_libvirt.so.2
      [  469s] nss/.libs/libnss_libvirt_impl.a(libvirt_nss_la-virjsoncompat.o): In function `virJSONJanssonOnce':
      [  469s] /home/abuild/rpmbuild/BUILD/libvirt-4.6.0/src/util/virjsoncompat.c:63: undefined reference to `dlopen'
      [  469s] /home/abuild/rpmbuild/BUILD/libvirt-4.6.0/src/util/virjsoncompat.c:79: undefined reference to `dlsym'
      ...
      
      A similar problem was fixed in commit b018ada3 and inspires this fix.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
      b3d9b08e
  20. 06 3月, 2018 1 次提交