1. 20 7月, 2012 1 次提交
  2. 14 7月, 2012 1 次提交
    • D
      Define public API for receiving guest memory balloon events · 7ed6d7dd
      Daniel P. Berrange 提交于
      When the guest changes its memory balloon applications may want
      to know what the new value is, without having to periodically
      poll on XML / domain info. Introduce a "balloon change" event
      to let apps see this
      
      * include/libvirt/libvirt.h.in: Define the
        virConnectDomainEventBalloonChangeCallback callback
        and VIR_DOMAIN_EVENT_ID_BALLOON_CHANGE constant
      * python/libvirt-override-virConnect.py,
        python/libvirt-override.c: Wire up helpers for new event
      * daemon/remote.c: Helper for serializing balloon event
      * examples/domain-events/events-c/event-test.c,
        examples/domain-events/events-python/event-test.py: Add
        example of balloon event usage
      * src/conf/domain_event.c, src/conf/domain_event.h: Handling
        of balloon events
      * src/remote/remote_driver.c: Add handler of balloon events
      * src/remote/remote_protocol.x: Define wire protocol for
        balloon events
      * src/remote_protocol-structs: Likewise.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      7ed6d7dd
  3. 10 7月, 2012 1 次提交
    • J
      systemd: start libvirtd after network · 4036aa91
      Jim Fehlig 提交于
      Domains configured with autostart may fail to start if the host
      network stack has not been started.  E.g. when using bridged
      networking autostarting a domain can fail with
      
      libvirtd[1403]: 2012-06-20 13:23:49.833+0000: 1485: error :
      qemuAutostartDomain:177 : Failed to autostart VM 'test': Cannot get
      interface MTU on 'br0': No such device
      4036aa91
  4. 05 7月, 2012 1 次提交
  5. 27 6月, 2012 1 次提交
  6. 20 6月, 2012 1 次提交
    • E
      list: provide RPC call for snapshots · dbb564f8
      Eric Blake 提交于
      The generator doesn't handle lists of virDomainSnapshotPtr, so
      this commit requires a bit more work than some RPC additions.
      
      * src/remote/remote_protocol.x
      (REMOTE_PROC_DOMAIN_LIST_ALL_SNAPSHOTS)
      (REMOTE_PROC_DOMAIN_SNAPSHOT_LIST_ALL_CHILDREN): New RPC calls,
      with corresponding structs.
      * daemon/remote.c (remoteDispatchDomainListAllSnapshots)
      (remoteDispatchDomainSnapshotListAllChildren): New functions.
      * src/remote/remote_driver.c (remoteDomainListAllSnapshots)
      (remoteDomainSnapshotListAllChildren): Likewise.
      * src/remote_protocol-structs: Regenerate.
      dbb564f8
  7. 19 6月, 2012 1 次提交
    • P
      remote: implement remote protocol for virConnectListAllDomains() · 9c9de4e6
      Peter Krempa 提交于
      This patch wires up the RPC protocol handlers for
      virConnectListAllDomains(). The RPC generator has no support for the way
      how virConnectListAllDomains() returns the results so the handler code
      had to be done manually.
      
      The new api is handled by REMOTE_PROC_CONNECT_LIST_ALL_DOMAINS, with
      number 273 and marked with high priority.
      9c9de4e6
  8. 15 6月, 2012 1 次提交
  9. 11 6月, 2012 2 次提交
    • D
      Fix privileges on /var/run/libvirt directory · 0ec82620
      Daniel P. Berrange 提交于
      Previous commit
      
        commit 32a9aac2
        Author: William Jon McCann <william.jon.mccann@gmail.com>
        Date:   Thu May 3 12:36:27 2012 -0400
      
          Use XDG Base Directories instead of storing in home directory
      
      Accidentally changed the umask when creating /var/run/libvirt
      to 077. This prevents /var/run/libvirt being readable by non-root,
      which is required for non-root to connect to libvirtd. Fix the
      code so that umask 077 is only used for the non-privileged libvirtd
      instance.
      0ec82620
    • D
      Only migrate profile in non-privileged libvirtd instance · 19c08b56
      Daniel P. Berrange 提交于
      Only the non-privileged libvirtd instance uses $HOME. So avoid
      running the code for migrating to XDG directories unless using
      a non-privileged libvirtd
      19c08b56
  10. 06 6月, 2012 1 次提交
    • E
      build: ensure storage driver is used · 3c3644d3
      Eric Blake 提交于
      Commit 1c275e9a accidentally dropped the storage driver from
      libvirtd, because it depended on a C preprocessor macro that
      was not defined.  Furthermore, if you do './configure
      --without-storage-dir --with-storage-disk' or any other combination
      where you explicitly build a subset of storage backends excluding
      the dir backend, then the build is broken.
      
      Based on analysis by Osier Yang.
      
      * configure.ac (WITH_STORAGE): Define top-level conditional.
      * src/Makefile.am (mod_LTLIBRARIES): Build driver even when
      storage_dir is disabled.
      * daemon/libvirtd.c: Pick up storage driver for any backend, not
      just dir.
      * daemon/Makefile.am (libvirtd_LDADD): Likewise.
      3c3644d3
  11. 30 5月, 2012 2 次提交
    • E
      build: use same perl binary throughout build · 13af87f2
      Eric Blake 提交于
      Some of our rules used $(PERL), while others used 'perl'.  Always
      using the variable allows a developer to point to a different (often
      better) perl than the default one found on $PATH.
      
      * daemon/Makefile.am ($(srcdir)/remote_dispatch.h): s/perl/$(PERL).
      * src/Makefile.am ($(srcdir)/remote/remote_client_bodies.h)
      (PDWTAGS, %protocol.c, %_probes.stp): Likewise.
      13af87f2
    • E
      build: fix testing of augeas files in VPATH builds · fb59cf7a
      Eric Blake 提交于
      Without this fix, a VPATH build (such as used by ./autobuild.sh)
      fails with messages like:
      
      make[3]: Entering directory `/home/remote/eblake/libvirt-tmp2/build/daemon'
      ../../build-aux/augeas-gentest.pl libvirtd.conf ../../daemon/test_libvirtd.aug.in test_libvirtd.aug
      cannot read libvirtd.conf: No such file or directory at ../../build-aux/augeas-gentest.pl line 38.
      
      Since the test files are not part of the tarball, we can generate
      them into the build dir, but rather than create a subdirectory
      just for the test file, it is easier to test them directly in
      libvirt.git/src.
      
      * daemon/Makefile.am (AUG_GENTEST): Factor out definition.
      (test_libvirtd.aug): Look for correct file.
      * src/Makefile.am (AUG_GENTEST): Use $(PERL).
      (qemu/test_libvirtd_qemu.aug, lxc/test_libvirtd_lxc.aug)
      (locking/test_libvirt_sanlock.aug): Rename to avoid subdirectories.
      (check-augeas-qemu, check-augeas-lxc, check-augeas-sanlock): Reflect
      location of built tests.
      * configure.ac (PERL): Substitute perl.
      fb59cf7a
  12. 28 5月, 2012 5 次提交
    • D
      Fix linking to DTrace probes file · 1e8ecfed
      Daniel P. Berrange 提交于
      There was no rule forcing libvirt_qemu_probes.o to be built
      before libvirt_qemu_probes.lo was used. Also libvirtd was
      still referencing the .o file, rather than the .lo file.
      
      Both the .lo and .o file must be listed as DEPENDENCIES,
      otherwise libtool will unhelpfully delete the .o file
      once the .lo file is created.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      1e8ecfed
    • D
      Autogenerate augeas test case from default config files · de9758ae
      Daniel P. Berrange 提交于
      When adding new config file parameters, the corresponding
      additions to the augeas lens' are constantly forgotten.
      Also there are augeas test cases, these don't catch the
      error, since they too are never updated.
      
      To address this, the augeas test cases need to be auto-generated
      from the example config files.
      
      * build-aux/augeas-gentest.pl: Helper to generate an
        augeas test file, substituting in elements from the
        example config files
      * src/Makefile.am, daemon/Makefile.am: Switch to
        auto-generated augeas test cases
      * daemon/test_libvirtd.aug, daemon/test_libvirtd.aug.in,
        src/locking/test_libvirt_sanlock.aug,
        src/locking/test_libvirt_sanlock.aug.in,
        src/lxc/test_libvirtd_lxc.aug,
        src/lxc/test_libvirtd_lxc.aug.in,
        src/qemu/test_libvirtd_qemu.aug,
        src/qemu/test_libvirtd_qemu.aug.in: Remove example
        config file data, replacing with a ::CONFIG:: placeholder
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      de9758ae
    • D
      Fix mistakes in augeas lens · a9c779ca
      Daniel P. Berrange 提交于
      Add nmissing 'host_uuid' entry to libvirtd.conf lens and
      rename spice_passwd to spice_password in qemu.conf lens
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      a9c779ca
    • D
      Standardize whitespace used in example config files · c5c3278e
      Daniel P. Berrange 提交于
      Instead of doing
      
        # example_config
      
      use
      
        #example_config
      
      so it is possible to programatically uncomment example config
      options, as distinct from their comment/descriptions
      
      Also delete rogue trailing comma not allowed by lens
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      c5c3278e
    • D
      Remove uid param from directory lookup APIs · 517368a3
      Daniel P. Berrange 提交于
      Remove the uid param from virGetUserConfigDirectory,
      virGetUserCacheDirectory, virGetUserRuntimeDirectory,
      and virGetUserDirectory
      
      These functions were universally called with the
      results of getuid() or geteuid(). To make it practical
      to port to Win32, remove the uid parameter and hardcode
      geteuid()
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      517368a3
  13. 24 5月, 2012 3 次提交
    • D
      Override default driver dir when running from GIT · b4763726
      Daniel P. Berrange 提交于
      * daemon/libvirtd.c: Set custom driver module dir if the current
        binary name is 'lt-libvirtd' (indicating execution directly
        from GIT checkout)
      * src/driver.c, src/driver.h, src/libvirt_driver_modules.syms: Add
        virDriverModuleInitialize to allow driver module location to
        be changed
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      b4763726
    • D
      Split QEMU dtrace probes into separate file · a4e45a06
      Daniel P. Berrange 提交于
      When building as driver modules, it is not possible for the QEMU
      driver module to reference the DTrace/SystemTAP probes linked into
      the main libvirt.so. Thus we need to move the QEMU probes into a
      separate file 'libvirt_qemu_probes.d'. Also rename the existing
      file from 'probes.d' to 'libvirt_probes.d' while we're at it
      
      * daemon/Makefile.am, src/internal.h: Include libvirt_probes.h
        instead of probes.h
      * src/Makefile.am: Add rules for libvirt_qemu_probes.d
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor_json.c,
        src/qemu/qemu_monitor_text.c: Include libvirt_qemu_probes.h
      * src/libvirt_probes.d: Rename from probes.d
      * src/libvirt_qemu_probes.d: QEMU specific probes formerly
        in probes.d
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      a4e45a06
    • D
      Only build server side drivers as modules · 1c275e9a
      Daniel P. Berrange 提交于
      The driver modules all use symbols which are defined in libvirt.so.
      Thus for loading of modules to work, the binary that libvirt.so
      is linked to must export its symbols back to modules. If the
      libvirt.so itself is dlopen()d then the RTLD_GLOBAL flag must
      be set. Unfortunately few, if any, programming languages use
      the RTLD_GLOBAL flag when loading modules :-( This means is it
      not practical to use driver modules for any libvirt client side
      drivers (OpenVZ, VMWare, Hyper-V, Remote client, test).
      
      This patch changes the build process so only server side drivers
      are built as modules (Xen, QEMU, LXC, UML)
      
      * daemon/libvirtd.c: Add missing load of 'interface' driver
      * src/Makefile.am: Only build server side drivers as modules
      * src/libvirt.c: Don't load any driver modules
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      1c275e9a
  14. 23 5月, 2012 1 次提交
  15. 21 5月, 2012 1 次提交
  16. 16 5月, 2012 2 次提交
    • D
      Reject any non-option command line arguments · 51bcb09f
      Daniel P. Berrange 提交于
      Due to a bug in editing /etc/sysconfig/libvirtd, VDSM was causing
      libvirt processes to run with the following command line args
      
         /usr/sbin/libvirtd --listen '#' 'by vdsm'
      
      While it correctly rejects any invalid option flags, libvirtd
      was not rejecting any non-option command line arguments
      
      * daemon/libvirtd.c: Reject non-option argv
      51bcb09f
    • D
      Remove bogus udev.target dep from libvirtd unit · 6cfc3f8f
      Daniel P. Berrange 提交于
      There is no 'udev.target' unit in systemd (only 'udev.service')
      yet libvirtd's unit file had a dep on one. There's no compelling
      reason for a dep on udev, so remove it altogether.
      Reported-by: NAvi Kivity <avi@redhat.com>
      6cfc3f8f
  17. 15 5月, 2012 1 次提交
    • D
      Move user libvirtd socket out of abstract namespace · 905be03d
      Daniel P. Berrange 提交于
      The current unprivileged user libvirtd sockets are in the abstract
      namespace. This has a number of problems
      
       - You can't connect to them remotely using the nc/ssh tunnel
       - This is not portable for OS-X, BSD & probably others
       - Parent directory permissions don't apply
      905be03d
  18. 14 5月, 2012 1 次提交
    • W
      Use XDG Base Directories instead of storing in home directory · 32a9aac2
      William Jon McCann 提交于
      As defined in:
      http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
      
      This offers a number of advantages:
       * Allows sharing a home directory between different machines, or
      sessions (eg. using NFS)
       * Cleanly separates cache, runtime (eg. sockets), or app data from
      user settings
       * Supports performing smart or selective migration of settings
      between different OS versions
       * Supports reseting settings without breaking things
       * Makes it possible to clear cache data to make room when the disk
      is filling up
       * Allows us to write a robust and efficient backup solution
       * Allows an admin flexibility to change where data and settings are stored
       * Dramatically reduces the complexity and incoherence of the
      system for administrators
      32a9aac2
  19. 08 5月, 2012 1 次提交
  20. 20 4月, 2012 1 次提交
    • D
      The policy kit and HAL node device drivers both require a · 2223ea98
      Daniel P. Berrange 提交于
      DBus connection. The HAL device code further requires that
      the DBus connection is integrated with the event loop and
      provides such glue logic itself.
      
      The forthcoming FirewallD integration also requires a
      dbus connection with event loop integration. Thus we need
      to pull the current event loop glue out of the HAL driver.
      
      Thus we create src/util/virdbus.{c,h} files. This contains
      just one method virDBusGetSystemBus() which obtains a handle
      to the single shared system bus instance, with event glue
      automagically setup.
      2223ea98
  21. 12 4月, 2012 1 次提交
    • A
      daemon: Plug memory leaks · d0eaf4b1
      Alex Jia 提交于
      * daemon/libvirtd-config.c (daemonConfigFree): fix memory leaks.
      
      How to reproduce?
      
      % make && make -C tests check TESTS=libvirtdconftest
      % cd tests && valgrind -v --leak-check=full ./libvirtdconftest
      
      actual result:
      
      ==11008== 185 bytes in 5 blocks are definitely lost in loss record 3 of 5
      ==11008==    at 0x4A05FDE: malloc (vg_replace_malloc.c:236)
      ==11008==    by 0x39CF07F6E1: strdup (strdup.c:43)
      ==11008==    by 0x406626: daemonConfigLoadOptions (libvirtd-config.c:438)
      ==11008==    by 0x406800: daemonConfigLoadData (libvirtd-config.c:492)
      ==11008==    by 0x403CCF: testCorrupt (libvirtdconftest.c:110)
      ==11008==    by 0x404FAD: virtTestRun (testutils.c:145)
      ==11008==    by 0x403A34: mymain (libvirtdconftest.c:219)
      ==11008==    by 0x404687: virtTestMain (testutils.c:700)
      ==11008==    by 0x39CF01ECDC: (below main) (libc-start.c:226)
      ==11008==
      ==11008== LEAK SUMMARY:
      ==11008==    definitely lost: 185 bytes in 5 blocks
      Signed-off-by: NAlex Jia <ajia@redhat.com>
      d0eaf4b1
  22. 10 4月, 2012 3 次提交
  23. 05 4月, 2012 1 次提交
  24. 30 3月, 2012 1 次提交
  25. 27 3月, 2012 1 次提交
    • S
      Change the default of mdns_adv to false · 53e1d56d
      Stef Walter 提交于
       * Don't advertise information on the network without consent of
         the user, either through manual configuration, or a user
         interface that drives this option.
       * Since libvirtd must be configured for network access anyway
         (for all but ssh), this setting was not useful "out of the box",
         so changing this default setting does not remove "out of the box"
         functionality.
      53e1d56d
  26. 23 3月, 2012 4 次提交
    • O
      Add support for the suspend event · 487c0633
      Osier Yang 提交于
      This patch introduces a new event type for the QMP event
      SUSPEND:
      
          VIR_DOMAIN_EVENT_ID_PMSUSPEND
      
      The event doesn't take any data, but considering there might
      be reason for wakeup in future, the callback definition is:
      
      typedef void
      (*virConnectDomainEventSuspendCallback)(virConnectPtr conn,
                                              virDomainPtr dom,
                                              int reason,
                                              void *opaque);
      
      "reason" is unused currently, always passes "0".
      487c0633
    • O
      Add support for the wakeup event · 57ddcc23
      Osier Yang 提交于
      This patch introduces a new event type for the QMP event
      WAKEUP:
      
          VIR_DOMAIN_EVENT_ID_PMWAKEUP
      
      The event doesn't take any data, but considering there might
      be reason for wakeup in future, the callback definition is:
      
      typedef void
      (*virConnectDomainEventWakeupCallback)(virConnectPtr conn,
                                             virDomainPtr dom,
                                             int reason,
                                             void *opaque);
      
      "reason" is unused currently, always passes "0".
      57ddcc23
    • O
      Add support for event tray moved of removable disks · a26a1969
      Osier Yang 提交于
      This patch introduces a new event type for the QMP event
      DEVICE_TRAY_MOVED, which occurs when the tray of a removable
      disk is moved (i.e opened or closed):
      
          VIR_DOMAIN_EVENT_ID_TRAY_CHANGE
      
      The event's data includes the device alias and the reason
      for tray status' changing, which indicates why the tray
      status was changed. Thus the callback definition for the event
      is:
      
      enum {
          VIR_DOMAIN_EVENT_TRAY_CHANGE_OPEN = 0,
          VIR_DOMAIN_EVENT_TRAY_CHANGE_CLOSE,
      
      \#ifdef VIR_ENUM_SENTINELS
          VIR_DOMAIN_EVENT_TRAY_CHANGE_LAST
      \#endif
      } virDomainEventTrayChangeReason;
      
      typedef void
      (*virConnectDomainEventTrayChangeCallback)(virConnectPtr conn,
                                                 virDomainPtr dom,
                                                 const char *devAlias,
                                                 int reason,
                                                 void *opaque);
      a26a1969
    • D
      Leave all child processes running when stopping systemd service · cb640543
      Daniel P. Berrange 提交于
      Currently the libvirt.service unit file for systemd does not
      specify any kill mode. So systemd kills off every process
      inside its cgroup. ie all dnsmasq processes, all virtual
      machines. This obviously not what we want. Set KillMode=process
      so that it only kills the top level process of libvirtd
      
      * daemon/libvirtd.service.in: Add KillMode=process
      Reported-By: NMark McLoughlin <markmc@redhat.com>
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      cb640543