1. 15 8月, 2012 1 次提交
  2. 09 8月, 2012 1 次提交
  3. 07 8月, 2012 3 次提交
  4. 03 8月, 2012 1 次提交
  5. 02 8月, 2012 2 次提交
    • E
      build: commit to 0.10.0 release naming · 1d170d3f
      Eric Blake 提交于
      With 0.10.0-rc0 out the door, we are committed to the next version
      number.
      
      * src/libvirt_public.syms (LIBVIRT_0.9.14): Rename...
      (LIBVIRT_0.10.0): ...to this.
      * docs/formatdomain.html.in: Fix fallout.
      * src/openvz/openvz_driver.c (openvzDriver): Likewise.
      * src/remote/remote_driver.c (remote_driver): Likewise.
      1d170d3f
    • G
      storage: netfs and iscsi need option srcSpec for resource discovery · 40570488
      Guannan Ren 提交于
      The option 'srcSpec' to virsh command find-storage-pool-sources
      is optional for logical type of storage pool, but mandatory for
      netfs and iscsi type.
      When missing the option for netfs and iscsi, libvirt reports XML
      parsing error due to null string option srcSpec.
      
      before
      error: Failed to find any netfs pool sources
      error: (storage_source_specification):1: Document is empty
      (null)
      
      after:
      error: pool type 'iscsi' requires option --srcSpec for source discovery
      40570488
  6. 30 7月, 2012 1 次提交
  7. 23 7月, 2012 1 次提交
    • O
      Desert the FSF address in copyright · f9ce7dad
      Osier Yang 提交于
      Per the FSF address could be changed from time to time, and GNU
      recommends the following now: (http://www.gnu.org/licenses/gpl-howto.html)
      
        You should have received a copy of the GNU General Public License
        along with Foobar.  If not, see <http://www.gnu.org/licenses/>.
      
      This patch removes the explicit FSF address, and uses above instead
      (of course, with inserting 'Lesser' before 'General').
      
      Except a bunch of files for security driver, all others are changed
      automatically, the copyright for securify files are not complete,
      that's why to do it manually:
      
        src/security/security_selinux.h
        src/security/security_driver.h
        src/security/security_selinux.c
        src/security/security_apparmor.h
        src/security/security_apparmor.c
        src/security/security_driver.c
      f9ce7dad
  8. 21 7月, 2012 1 次提交
  9. 20 7月, 2012 1 次提交
  10. 18 7月, 2012 1 次提交
    • J
      remote: Fix locking in stream APIs · 17f3be07
      Jiri Denemark 提交于
      Remote driver needs to make sure the driver lock is released before
      entering client IO loop as that may block indefinitely in poll(). As a
      direct consequence of not following this in stream APIs, tunneled
      migration to a destination host which becomes non-responding may block
      qemu driver. Luckily, if keepalive is turned for p2p migrations, both
      remote and qemu drivers will get automagically unblocked after keepalive
      timeout.
      17f3be07
  11. 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
  12. 04 7月, 2012 1 次提交
  13. 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
  14. 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
  15. 12 6月, 2012 1 次提交
    • E
      snapshot: RPC for new query APIs · a2bc4a0c
      Eric Blake 提交于
      Pretty straightforward.
      
      * src/remote/remote_protocol.x
      (remote_domain_snapshot_is_current_args)
      (remote_domain_snapshot_is_current_ret)
      (remote_domain_snapshot_has_metadata_args)
      (remote_domain_snapshot_has_metadata_ret): New structs.
      (REMOTE_PROC_DOMAIN_SNAPSHOT_IS_CURRENT)
      (REMOTE_PROC_DOMAIN_SNAPSHOT_HAS_METADATA): New RPC calls.
      * src/remote/remote_driver.c (remote_driver): Call them.
      * src/remote_protocol-structs: Regenerate.
      a2bc4a0c
  16. 28 5月, 2012 1 次提交
  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. 26 4月, 2012 1 次提交
    • P
      keepalive: Add ability to disable keepalive messages · 6446a9e2
      Peter Krempa 提交于
      The docs for virConnectSetKeepAlive() advertise that this function
      should be able to disable keepalives on negative or zero interval time.
      
      This patch removes the check that prohibited this and adds code to
      disable keepalives on negative/zero interval.
      
      * src/libvirt.c: virConnectSetKeepAlive(): - remove check for negative
                                                   values
      * src/rpc/virnetclient.c
      * src/rpc/virnetclient.h: - add virNetClientKeepAliveStop() to disable
                                  keepalive messages
      * src/remote/remote_driver.c: remoteSetKeepAlive(): -add ability to
                                                           disable keepalives
      6446a9e2
  20. 30 3月, 2012 3 次提交
  21. 27 3月, 2012 1 次提交
    • M
      Cleanup for a return statement in source files · 9943276f
      Martin Kletzander 提交于
      Return statements with parameter enclosed in parentheses were modified
      and parentheses were removed. The whole change was scripted, here is how:
      
      List of files was obtained using this command:
      git grep -l -e '\<return\s*([^()]*\(([^()]*)[^()]*\)*)\s*;' |             \
      grep -e '\.[ch]$' -e '\.py$'
      
      Found files were modified with this command:
      sed -i -e                                                                 \
      's_^\(.*\<return\)\s*(\(\([^()]*([^()]*)[^()]*\)*\))\s*\(;.*$\)_\1 \2\4_' \
      -e 's_^\(.*\<return\)\s*(\([^()]*\))\s*\(;.*$\)_\1 \2\3_'
      
      Then checked for nonsense.
      
      The whole command looks like this:
      git grep -l -e '\<return\s*([^()]*\(([^()]*)[^()]*\)*)\s*;' |             \
      grep -e '\.[ch]$' -e '\.py$' | xargs sed -i -e                            \
      's_^\(.*\<return\)\s*(\(\([^()]*([^()]*)[^()]*\)*\))\s*\(;.*$\)_\1 \2\4_' \
      -e 's_^\(.*\<return\)\s*(\([^()]*\))\s*\(;.*$\)_\1 \2\3_'
      9943276f
  22. 23 3月, 2012 9 次提交
    • D
      0ceced58
    • 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
      Lookup auth credentials in config file before prompting · 4445e16b
      Daniel P. Berrange 提交于
      When SASL requests auth credentials, try to look them up in the
      config file first. If any are found, remove them from the list
      that the user is prompted for
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      4445e16b
    • D
      Refactor code prompting for SASL credentials · c6c66615
      Daniel P. Berrange 提交于
      SASL may prompt for credentials after either a 'start' or 'step'
      invocation. In both cases the code to handle this is the same.
      Refactor this code into a separate method to reduce the duplication,
      since the complexity is about to grow
      
      * src/remote/remote_driver.c: Refactor interaction with SASL
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      c6c66615
    • D
      Convert drivers over to use virURIPtr for query params · bc1ff160
      Daniel P. Berrange 提交于
      Convert drivers currently using the qparams APIs, to instead
      use the virURIPtr query parameters directly.
      
      * src/esx/esx_util.c, src/hyperv/hyperv_util.c,
        src/remote/remote_driver.c, src/xenapi/xenapi_utils.c: Remove
        use of qparams
      * src/util/qparams.h, src/util/qparams.c: Delete
      * src/Makefile.am, src/libvirt_private.syms: Remove qparams
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      bc1ff160
    • D
      Use a libvirt custom struct for virURIPtr · 300e60e1
      Daniel P. Berrange 提交于
      Instead of just typedef'ing the xmlURIPtr struct for virURIPtr,
      use a custom libvirt struct. This allows us to fix various
      problems with libxml2. This initially just fixes the query vs
      query_raw handling problems.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      300e60e1
    • D
      Centralize error reporting for URI parsing/formatting problems · 1f66c18f
      Daniel P. Berrange 提交于
      Move error reporting out of the callers, into virURIParse
      and virURIFormat, to get consistency.
      
      * include/libvirt/virterror.h, src/util/virterror.c: Add VIR_FROM_URI
      * src/util/viruri.c, src/util/viruri.h: Add error reporting
      * src/esx/esx_driver.c, src/libvirt.c, src/libxl/libxl_driver.c,
        src/lxc/lxc_driver.c, src/openvz/openvz_driver.c,
        src/qemu/qemu_driver.c, src/qemu/qemu_migration.c,
        src/remote/remote_driver.c, src/uml/uml_driver.c,
        src/vbox/vbox_tmpl.c, src/vmx/vmx.c, src/xen/xen_driver.c,
        src/xen/xend_internal.c, tests/viruritest.c: Remove error
        reporting
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      1f66c18f
  23. 16 3月, 2012 1 次提交
    • O
      remote: Fix migration leaks · b569c1ab
      Osier Yang 提交于
      How to reproduce:
      
      % valgrind -v --leak-check=full virsh migrate mig \
        qemu+ssh://$dest/system --unsafe
      
      == 8 bytes in 1 blocks are definitely lost in loss record 1 of 28
      ==    at 0x4A04A28: calloc (vg_replace_malloc.c:467)
      ==    by 0x3EB7115FB8: xdr_reference (in /lib64/libc-2.12.so)
      ==    by 0x3EB7115F10: xdr_pointer (in /lib64/libc-2.12.so)
      ==    by 0x4D1EA84: xdr_remote_string (remote_protocol.c:40)
      ==    by 0x4D1EAD8: xdr_remote_domain_migrate_prepare3_ret (remote_protocol.c:4772)
      ==    by 0x4D2FFD2: virNetMessageDecodePayload (virnetmessage.c:382)
      ==    by 0x4D2789C: virNetClientProgramCall (virnetclientprogram.c:382)
      ==    by 0x4D0707D: callWithFD (remote_driver.c:4549)
      ==    by 0x4D070FB: call (remote_driver.c:4570)
      ==    by 0x4D12AEE: remoteDomainMigratePrepare3 (remote_driver.c:4138)
      ==    by 0x4CF7BE9: virDomainMigrateVersion3 (libvirt.c:4815)
      ==    by 0x4CF9432: virDomainMigrate2 (libvirt.c:5454)
      ==
      == LEAK SUMMARY:
      ==    definitely lost: 8 bytes in 1 blocks
      ==    indirectly lost: 0 bytes in 0 blocks
      ==      possibly lost: 0 bytes in 0 blocks
      ==    still reachable: 126,995 bytes in 1,343 blocks
      ==         suppressed: 0 bytes in 0 blocks
      
      This patch also fixes the leaks in remoteDomainMigratePrepare and
      remoteDomainMigratePrepare2.
      b569c1ab
  24. 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
  25. 27 2月, 2012 1 次提交
  26. 25 2月, 2012 1 次提交
    • M
      Fixed URI parsing · 9f748277
      Martin Kletzander 提交于
      Function xmlParseURI does not remove square brackets around IPv6
      address when parsing. One of the solutions is making wrappers around
      functions working with xmlURI*. This assures that uri->server will be
      always properly assigned and it doesn't have to be changed when used
      on some new place in the code.
      For this purpose, functions virParseURI and virSaveURI were
      added. These function are wrappers around xmlParseURI and xmlSaveUri
      respectively.
      Also there is one new syntax check function to prohibit these functions
      anywhere else.
      
      File changes:
       - src/util/viruri.h        -- declaration
       - src/util/viruri.c        -- definition
       - src/libvirt_private.syms -- symbol export
       - src/Makefile.am          -- added source and header files
       - cfg.mk                   -- added sc_prohibit_xmlURI
       - all others               -- ID name and include fixes
      9f748277
  27. 10 2月, 2012 1 次提交
    • A
      rpc: Plug memory leaks on doRemoteOpen() failure path · 6d514728
      Alex Jia 提交于
      Detected by valgrind. Leaks are introduced in commit c1b22644.
      
      * src/remote/remote_driver.c (doRemoteOpen): free client program memory in failure path.
      
      * How to reproduce?
      % valgrind -v --leak-check=full virsh -c qemu:
      
      * Actual result
      
      ==3969== 40 bytes in 1 blocks are definitely lost in loss record 8 of 28
      ==3969==    at 0x4A04A28: calloc (vg_replace_malloc.c:467)
          ==3969==    by 0x4C89C41: virAlloc (memory.c:101)
          ==3969==    by 0x4D5A236: virNetClientProgramNew (virnetclientprogram.c:60)
          ==3969==    by 0x4D47AB4: doRemoteOpen (remote_driver.c:658)
          ==3969==    by 0x4D49FFF: remoteOpen (remote_driver.c:871)
          ==3969==    by 0x4D13373: do_open (libvirt.c:1196)
          ==3969==    by 0x4D14535: virConnectOpenAuth (libvirt.c:1422)
          ==3969==    by 0x425627: main (virsh.c:18537)
          ==3969==
          ==3969== 40 bytes in 1 blocks are definitely lost in loss record 9 of 28
          ==3969==    at 0x4A04A28: calloc (vg_replace_malloc.c:467)
          ==3969==    by 0x4C89C41: virAlloc (memory.c:101)
          ==3969==    by 0x4D5A236: virNetClientProgramNew (virnetclientprogram.c:60)
          ==3969==    by 0x4D47AD7: doRemoteOpen (remote_driver.c:664)
          ==3969==    by 0x4D49FFF: remoteOpen (remote_driver.c:871)
          ==3969==    by 0x4D13373: do_open (libvirt.c:1196)
          ==3969==    by 0x4D14535: virConnectOpenAuth (libvirt.c:1422)
          ==3969==    by 0x425627: main (virsh.c:18537)
          ==3969==
          ==3969== LEAK SUMMARY:
          ==3969==    definitely lost: 80 bytes in 2 blocks
      Signed-off-by: NAlex Jia <ajia@redhat.com>
      6d514728