1. 05 4月, 2012 1 次提交
  2. 30 3月, 2012 1 次提交
  3. 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
  4. 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
  5. 08 3月, 2012 1 次提交
    • E
      api: add overflow error · 239fb8c4
      Eric Blake 提交于
      Overflow can be user-induced, so it deserves more than being called
      an internal error.  Note that in general, 32-bit platforms have
      far more places to trigger this error (anywhere the public API
      used 'unsigned long' but the other side of the connection is a
      64-bit server); but some are possible on 64-bit platforms (where
      the public API computes the product of two numbers).
      
      * include/libvirt/virterror.h (VIR_ERR_OVERFLOW): New error.
      * src/util/virterror.c (virErrorMsg): Translate it.
      * src/libvirt.c (virDomainSetVcpusFlags, virDomainGetVcpuPinInfo)
      (virDomainGetVcpus, virDomainGetCPUStats): Use it.
      * daemon/remote.c (HYPER_TO_TYPE): Likewise.
      * src/qemu/qemu_driver.c (qemuDomainBlockResize): Likewise.
      239fb8c4
  6. 07 3月, 2012 1 次提交
    • E
      rpc: allow truncated return for virDomainGetCPUStats · 462dc569
      Eric Blake 提交于
      The RPC code assumed that the array returned by the driver would be
      fully populated; that is, ncpus on entry resulted in ncpus * return
      value on exit.  However, while we don't support holes in the middle
      of ncpus, we do want to permit the case of ncpus on entry being
      longer than the array returned by the driver (that is, it should be
      safe for the caller to pass ncpus=128 on entry, and the driver will
      stop populating the array when it hits max_id).
      
      Additionally, a successful return implies that the caller will then
      use virTypedParamArrayClear on the entire array; for this to not
      free uninitialized memory, the driver must ensure that all skipped
      entries are explicitly zeroed (the RPC driver did this, but not
      the qemu driver).
      
      There are now three cases:
      server 0.9.10 and client 0.9.10 or newer: No impact - there were no
      hypervisor drivers that supported cpu stats
      
      server 0.9.11 or newer and client 0.9.10: if the client calls with
      ncpus beyond the max, then the rpc call will fail on the client side
      and disconnect the client, but the server is no worse for the wear
      
      server 0.9.11 or newer and client 0.9.11: the server can return a
      truncated array and the client will do just fine
      
      I reproduced the problem by using a host with 2 CPUs, and doing:
      virsh cpu-stats $dom --start 1 --count 2
      
      * daemon/remote.c (remoteDispatchDomainGetCPUStats): Allow driver
      to omit tail of array.
      * src/remote/remote_driver.c (remoteDomainGetCPUStats):
      Accommodate driver that omits tail of array.
      * src/libvirt.c (virDomainGetCPUStats): Document this.
      * src/qemu/qemu_driver.c (qemuDomainGetPercpuStats): Clear all
      unpopulated entries.
      462dc569
  7. 02 3月, 2012 2 次提交
    • P
      daemon: Remove deprecated HAL from init script dependencies · 2dcca3ec
      Peter Krempa 提交于
      The init script for the daemon requests to start HAL although it has
      been deprecated long time ago. This patch removes the dependency.
      2dcca3ec
    • E
      build: use correct type for pid and similar types · 3e2c3d8f
      Eric Blake 提交于
      No thanks to 64-bit windows, with 64-bit pid_t, we have to avoid
      constructs like 'int pid'.  Our API in libvirt-qemu cannot be
      changed without breaking ABI; but then again, libvirt-qemu can
      only be used on systems that support UNIX sockets, which rules
      out Windows (even if qemu could be compiled there) - so for all
      points on the call chain that interact with this API decision,
      we require a different variable name to make it clear that we
      audited the use for safety.
      
      Adding a syntax-check rule only solves half the battle; anywhere
      that uses printf on a pid_t still needs to be converted, but that
      will be a separate patch.
      
      * cfg.mk (sc_correct_id_types): New syntax check.
      * src/libvirt-qemu.c (virDomainQemuAttach): Document why we didn't
      use pid_t for pid, and validate for overflow.
      * include/libvirt/libvirt-qemu.h (virDomainQemuAttach): Tweak name
      for syntax check.
      * src/vmware/vmware_conf.c (vmwareExtractPid): Likewise.
      * src/driver.h (virDrvDomainQemuAttach): Likewise.
      * tools/virsh.c (cmdQemuAttach): Likewise.
      * src/remote/qemu_protocol.x (qemu_domain_attach_args): Likewise.
      * src/qemu_protocol-structs (qemu_domain_attach_args): Likewise.
      * src/util/cgroup.c (virCgroupPidCode, virCgroupKillInternal):
      Likewise.
      * src/qemu/qemu_command.c(qemuParseProcFileStrings): Likewise.
      (qemuParseCommandLinePid): Use pid_t for pid.
      * daemon/libvirtd.c (daemonForkIntoBackground): Likewise.
      * src/conf/domain_conf.h (_virDomainObj): Likewise.
      * src/probes.d (rpc_socket_new): Likewise.
      * src/qemu/qemu_command.h (qemuParseCommandLinePid): Likewise.
      * src/qemu/qemu_driver.c (qemudGetProcessInfo, qemuDomainAttach):
      Likewise.
      * src/qemu/qemu_process.c (qemuProcessAttach): Likewise.
      * src/qemu/qemu_process.h (qemuProcessAttach): Likewise.
      * src/uml/uml_driver.c (umlGetProcessInfo): Likewise.
      * src/util/virnetdev.h (virNetDevSetNamespace): Likewise.
      * src/util/virnetdev.c (virNetDevSetNamespace): Likewise.
      * tests/testutils.c (virtTestCaptureProgramOutput): Likewise.
      * src/conf/storage_conf.h (_virStoragePerms): Use mode_t, uid_t,
      and gid_t rather than int.
      * src/security/security_dac.c (virSecurityDACSetOwnership): Likewise.
      * src/conf/storage_conf.c (virStorageDefParsePerms): Avoid
      compiler warning.
      3e2c3d8f
  8. 29 2月, 2012 2 次提交
  9. 25 2月, 2012 1 次提交
    • D
      Workaround python header file insanity · 1d4c4d9d
      Daniel P. Berrange 提交于
      The /usr/include/python/pyconfig.h file pollutes the global
      namespace with a huge number of HAVE_XXX and WITH_XXX
      defines. These change what we detected in our own config.h
      In particular if you try to build without DTrace, python's
      headers turn it back on with predictable fail.
      
      THe hack to workaround this is to rename WITH_DTRACE to
      WITH_DTRACE_PROBES to avoid the namespace clash
      1d4c4d9d
  10. 16 2月, 2012 4 次提交
    • J
      Fix polkit0 authentication · fcdfa31f
      Jim Fehlig 提交于
      Commit 7033c5f2 introduced some bugs in polkit0 authentication.
      
      Fix libvirtd segfault in remoteDispatchAuthPolkit().
      
      Fix polkit authentication bypass when caller UID = 0.
      fcdfa31f
    • J
      Fix build with polkit0 · c05ec920
      Jim Fehlig 提交于
      Commit 8dd623b9 introduced a build error with --enable-compile-warnings=error
      
        remote.c:2593: error: unused variable 'rv' [-Wunused-variable]
      
      Pushing under build-breaker rule.
      c05ec920
    • E
      daemon: fix logic bug with virAsprintf · 15a280bb
      Eric Blake 提交于
      Regression introduced in commit 7033c5f2, due to improper conversion
      from snprintf to virAsprintf.
      
      * daemon/remote.c (remoteDispatchAuthList): Check return value
      correctly.
      15a280bb
    • E
      daemon: plug memory leak · d2728cc2
      Eric Blake 提交于
      Leak introduced in commit bb2eddc6.
      
      * daemon/remote.c (remoteDispatchAuthPolkit): Also free pkout on
      success.
      d2728cc2
  11. 08 2月, 2012 1 次提交
    • C
      Allow polkit auth for VNC and SSH users · 756e6ab4
      Cole Robinson 提交于
      If you are sitting in front of a physical machine and logged in as
      a regular user, you can connect to the system libvirtd instance
      by providing a root password to policykit. This is how most
      virt-manager users talk to libvirt.
      
      However, if you are launching virt-manager over ssh -X, or over
      VNC started from say /etc/sysconfig/vncservers, our policykit policy
      rejects the user outright, providing no option to provide the root
      password. This is confusing to users and doesn't seem to serve much
      point.
      
      Change the policy to allow inactive (VNC) and non-local (SSH, VNC)
      to provide root credentials for accessing system libvirtd. We use
      auth_admin rather than auth_admin_keep so that credentials aren't
      cached at all, and every subsequent reconnection to libvirt requires
      auth.
      
      Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=625115
      Similar change to PackageKit policy:
      https://bugzilla.redhat.com/show_bug.cgi?id=528511
      756e6ab4
  12. 04 2月, 2012 3 次提交
    • E
      maint: consolidate several .gitignore files · 8f00276c
      Eric Blake 提交于
      Unlike .cvsignore under CVS, git allows for ignoring nested
      names.  We weren't very consistent where new tests were
      being ignored (some in .gitignore, some in tests/.gitignore),
      and I found it easier to just consolidate everything.
      
      * .gitignore: Subsume entries from subdirectories.
      * daemon/.gitignore: Delete.
      * docs/.gitignore: Likewise.
      * docs/devhelp/.gitignore: Likewise.
      * docs/html/.gitignore: Likewise.
      * examples/dominfo/.gitignore: Likewise.
      * examples/domsuspend/.gitignore: Likewise.
      * examples/hellolibvirt/.gitignore: Likewise.
      * examples/openauth/.gitignore: Likewise.
      * examples/domain-events/events-c/.gitignore: Likewise.
      * include/libvirt/.gitignore: Likewise.
      * src/.gitignore: Likewise.
      * src/esx/.gitignore: Likewise.
      * tests/.gitignore: Likewise.
      * tools/.gitignore: Likewise.
      8f00276c
    • E
      build: clean up CPPFLAGS/INCLUDES usage · cb33ee1f
      Eric Blake 提交于
      Our syntax checker missed all-lower-case variables (this will
      be fixed by the next .gnulib update).  Additionally, anywhere
      that we mix in-tree files with generated files, automake recommends
      listing builddir prior to srcdir for VPATH builds.
      
      * src/Makefile.am (*_la_CFLAGS): Favor $(top_srcdir).
      (INCLUDES): Likewise, and follow automake recommendations on
      builddir before srcdir.
      * python/Makefile.am (INCLUDES): Swap directory order.
      * tests/Makefile.am (INCLUDES): Likewise.
      * tools/Makefile.am (INCLUDES): Likewise.
      * daemon/Makefile.am (INCLUDES): Likewise.
      (libvirtd.init, libvirtd.service): Favor $().
      * examples/hellolibvirt/Makefile.am (hellolibvirt_LDADD):
      Likewise.
      * examples/openauth/Makefile.am (openauth_LDADD): Likewise.
      * examples/dominfo/Makefile.am (INCLUDES): Drop dead include.
      * examples/domsuspend/Makefile.am (INCLUDES): Likewise.
      cb33ee1f
    • E
      command: allow merging stdout and stderr in string capture · c9ace552
      Eric Blake 提交于
      Sometimes, its easier to run children with 2>&1 in shell notation,
      and just deal with stdout and stderr interleaved.  This was already
      possible for fd handling; extend it to also work when doing string
      capture of a child process.
      
      * docs/internals/command.html.in: Document this.
      * src/util/command.c (virCommandSetErrorBuffer): Likewise.
      (virCommandRun, virExecWithHook): Implement it.
      * tests/commandtest.c (test14): Test it.
      * daemon/remote.c (remoteDispatchAuthPolkit): Use new command
      feature.
      c9ace552
  13. 01 2月, 2012 4 次提交
  14. 29 1月, 2012 1 次提交
  15. 28 1月, 2012 2 次提交
  16. 27 1月, 2012 2 次提交
    • E
      build: allow for 64-bit pid in daemon · 7033c5f2
      Eric Blake 提交于
      Convert daemon code to handle 64-bit pid_t (even though at the
      moment, it is not compiled on mingw).
      
      * daemon/remote.c (remoteDispatchAuthList)
      (remoteDispatchAuthPolkit): Print pid_t via %lld.
      7033c5f2
    • E
      daemon: convert virRun to virCommand · 8dd623b9
      Eric Blake 提交于
      Using snprintf to build up argv seems archaic.
      
      * daemon/remote.c (remoteDispatchAuthPolkit): Modernize command call.
      8dd623b9
  17. 21 1月, 2012 1 次提交
    • E
      API: make declaration of _LAST enum values conditional · 7b4e5693
      Eric Blake 提交于
      Although this is a public API break, it only affects users that
      were compiling against *_LAST values, and can be trivially
      worked around without impacting compilation against older
      headers, by the user defining VIR_ENUM_SENTINELS before using
      libvirt.h.  It is not an ABI break, since enum values do not
      appear as .so entry points.  Meanwhile, it prevents users from
      using non-stable enum values without explicitly acknowledging
      the risk of doing so.
      
      See this list discussion:
      https://www.redhat.com/archives/libvir-list/2012-January/msg00804.html
      
      * include/libvirt/libvirt.h.in: Hide all sentinels behind
      LIBVIRT_ENUM_SENTINELS, and add missing sentinels.
      * src/internal.h (VIR_DEPRECATED): Allow inclusion after
      libvirt.h.
      (LIBVIRT_ENUM_SENTINELS): Expose sentinels internally.
      * daemon/libvirtd.h: Use the sentinels.
      * src/remote/remote_protocol.x (includes): Don't expose sentinels.
      * python/generator.py (enum): Likewise.
      * tests/cputest.c (cpuTestCompResStr): Silence compiler warning.
      * tools/virsh.c (vshDomainStateReasonToString)
      (vshDomainControlStateToString): Likewise.
      7b4e5693
  18. 20 1月, 2012 1 次提交
    • E
      util: add new file for virTypedParameter utils · 61ca98b0
      Eric Blake 提交于
      Preparation for another patch that refactors common patterns
      into the new file for fewer lines of code overall.
      
      * src/util/util.h (virTypedParameterArrayClear): Move...
      * src/util/virtypedparam.h: ...to new file.
      (virTypedParameterArrayValidate, virTypedParameterAssign): New
      prototypes.
      * src/util/util.c (virTypedParameterArrayClear): Likewise.
      * src/util/virtypedparam.c: New file.
      * po/POTFILES.in: Mark file for translation.
      * src/Makefile.am (UTIL_SOURCES): Build it.
      * src/libvirt_private.syms (util.h): Split...
      (virtypedparam.h): to new section.
      (virkeycode.h): Sort.
      * daemon/remote.c: Adjust callers.
      * tools/virsh.c: Likewise.
      61ca98b0
  19. 19 1月, 2012 3 次提交
  20. 03 1月, 2012 1 次提交
    • E
      domiftune: clean up previous patches · 269ce467
      Eric Blake 提交于
      Most severe here is a latent (but currently untriggered) memory leak
      if any hypervisor ever adds a string interface property; the
      remainder are mainly cosmetic.
      
      * include/libvirt/libvirt.h.in (VIR_DOMAIN_BANDWIDTH_*): Move
      macros closer to interface that uses them, and document type.
      * src/libvirt.c (virDomainSetInterfaceParameters)
      (virDomainGetInterfaceParameters): Formatting tweaks.
      * daemon/remote.c (remoteDispatchDomainGetInterfaceParameters):
      Avoid memory leak.
      * src/libvirt_public.syms (LIBVIRT_0.9.9): Sort lines.
      * src/libvirt_private.syms (domain_conf.h): Likewise.
      * src/qemu/qemu_driver.c (qemuDomainSetInterfaceParameters): Fix
      comments, break long lines.
      269ce467
  21. 29 12月, 2011 1 次提交
    • H
      domiftune: Add support of new APIs to the remote driver · e7dfe00d
      Hu Tao 提交于
      * daemon/remote.c: implement the server side support
      * src/remote/remote_driver.c: implement the client side support
      * src/remote/remote_protocol.x: definitions for the new entry points
      * src/remote_protocol-structs: structure definitions
      e7dfe00d
  22. 28 12月, 2011 1 次提交
    • E
      daemon: clean up daemonization · e957b670
      Eric Blake 提交于
      Valgrind detected a pipe fd leak before the parent exits on success,
      introduced in commit 4296cea2; by itself, the leak is not bad, since
      we immediately called _exit(), but we might as well be clean to make
      valgrind analysis easier.  Meanwhile, if the daemon grandchild detects
      an error, the parent failed to flush the error message before exiting.
      Also, we had the possibility of both parent and child returning to the
      caller, such that the user could see duplicated reports of failure
      from the two return paths.  And we might as well be robust to the
      (unlikely) situation of being started with stdin closed.
      
      * daemon/libvirtd.c (daemonForkIntoBackground): Use exit if an
      error message was generated, avoid fd leaks for valgrind's sake,
      avoid returning to caller in both parent and child, and don't
      close a just-dup'd stdin.
      Based on a report by Alex Jia.
      
      * How to reproduce?
        % service libvirtd stop
        % valgrind -v --track-fds=yes /usr/sbin/libvirtd --daemon
      
      * Actual valgrind result:
      
      ==16804== FILE DESCRIPTORS: 7 open at exit.
      ==16804== Open file descriptor 7:
      ==16804==    at 0x321FAD8B87: pipe (in /lib64/libc-2.12.so)
      ==16804==    by 0x41F34D: daemonForkIntoBackground (libvirtd.c:186)
      ==16804==    by 0x4207A0: main (libvirtd.c:1420)
      Signed-off-by: NAlex Jia <ajia@redhat.com>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      e957b670
  23. 21 12月, 2011 1 次提交