1. 17 9月, 2012 2 次提交
    • O
      list: Implement RPC calls for virConnectListAllNWFilters · 3f47ff8b
      Osier Yang 提交于
      The RPC generator doesn't support returning list of object yet, this patch
      do the work manually.
      
        * daemon/remote.c:
          Implemente the server side handler remoteDispatchConnectListAllNWFilters.
      
        * src/remote/remote_driver.c:
          Add remote driver handler remoteConnectListAllNWFilters.
      
        * src/remote/remote_protocol.x:
          New RPC procedure REMOTE_PROC_CONNECT_LIST_ALL_NWFILTERS and
          structs to represent the args and ret for it.
      
        * src/remote_protocol-structs: Likewise.
      3f47ff8b
    • O
      list: Implement RPC calls for virConnectListAllNodeDevices · 4230b6c1
      Osier Yang 提交于
      The RPC generator doesn't support returning list of object yet, this patch
      does the work manually.
      
        * daemon/remote.c:
          Implemente the server side handler remoteDispatchConnectListAllNodeDevices.
      
        * src/remote/remote_driver.c:
          Add remote driver handler remoteConnectListAllNodeDevices.
      
        * src/remote/remote_protocol.x:
          New RPC procedure REMOTE_PROC_CONNECT_LIST_ALL_INTERFACES and
      4230b6c1
  2. 12 9月, 2012 1 次提交
    • O
      list: Implemente RPC calls for virConnectListAllInterfaces · 65741d84
      Osier Yang 提交于
      The RPC generator doesn't support returning list of object yet, this patch
      do the work manually.
      
        * daemon/remote.c:
          Implemente the server side handler remoteDispatchConnectListAllInterfaces.
      
        * src/remote/remote_driver.c:
          Add remote driver handler remoteConnectListAllInterfaces.
      
        * src/remote/remote_protocol.x:
          New RPC procedure REMOTE_PROC_CONNECT_LIST_ALL_INTERFACES and
          structs to represent the args and ret for it.
      
        * src/remote_protocol-structs: Likewise.
      65741d84
  3. 11 9月, 2012 1 次提交
    • O
      list: Implement RPC calls for virConnectListAllNetworks · eff8a8db
      Osier Yang 提交于
      The RPC generator doesn't support returning list of object, this patch
      do the work manually.
      
      * daemon/remote.c:
        Implemente the server side handler remoteDispatchConnectListAllNetworks.
      
      * src/remote/remote_driver.c:
        Add remote driver handler remoteConnectListAllNetworks.
      
      * src/remote/remote_protocol.x:
        New RPC procedure REMOTE_PROC_CONNECT_LIST_ALL_NETWORKS and
        structs to represent the args and ret for it.
      
      * src/remote_protocol-structs: Likewise.
      eff8a8db
  4. 10 9月, 2012 1 次提交
    • O
      list: Implement RPC calls for virStoragePoolListAllVolumes · a8bac1c0
      Osier Yang 提交于
      The RPC generator doesn't returning support list of object, this
      patch do the work manually.
      
        * daemon/remote.c:
          Implemente the server side handler remoteDispatchStoragePoolListAllVolumes
      
        * src/remote/remote_driver.c:
          Add remote driver handler remoteStoragePoolListAllVolumes
      
        * src/remote/remote_protocol.x:
          New RPC procedure REMOTE_PROC_STORAGE_POOL_LIST_ALL_VOLUMES and
          structs to represent the args and ret for it.
      
        * src/remote_protocol-structs: Likewise.
      a8bac1c0
  5. 07 9月, 2012 1 次提交
    • J
      Fix PMSuspend and PMWakeup events · afab4824
      Jiri Denemark 提交于
      The unused reason parameter of PM{Suspend,Wakeup} event callbacks was
      completely ignored in lot of places and those events were not actually
      working at all.
      afab4824
  6. 06 9月, 2012 1 次提交
    • O
      list: Implement the RPC calls for virConnectListAllStoragePools · 17fd0088
      Osier Yang 提交于
      The RPC generator doesn't support returning list of object, this patch does
      the work manually.
      
        * daemon/remote.c:
          Implement the server side handler remoteDispatchConnectListAllStoragePools
      
        * src/remote/remote_driver.c:
          Add remote driver handler remoteConnectListAllStoragePools.
      
        * src/remote/remote_protocol.x:
          New RPC procedure REMOTE_PROC_CONNECT_LIST_ALL_STORAGE_POOLS and
          structs to represent the args and ret for it.
      
        * src/remote_protocol-structs: Likewise.
      17fd0088
  7. 22 8月, 2012 1 次提交
  8. 21 8月, 2012 1 次提交
  9. 15 8月, 2012 1 次提交
    • D
      Refactor RPC client private data setup · 39b5e4d4
      Daniel P. Berrange 提交于
      Currently there is a hook function that is invoked when a
      new client connection comes in, which allows an app to
      setup private data. This setup will make it difficult to
      serialize client state during process re-exec(). Change to
      a model where the app registers a callback when creating
      the virNetServerPtr instance, which is used to allocate
      the client private data immediately during virNetClientPtr
      construction.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      39b5e4d4
  10. 07 8月, 2012 1 次提交
  11. 31 7月, 2012 1 次提交
    • J
      daemon: Fix crash in virTypedParameterArrayClear · 6039a2cb
      Jiri Denemark 提交于
      Daemon uses the following pattern when dispatching APIs with typed
      parameters:
      
          VIR_ALLOC_N(params, nparams);
          virDomain*(dom, params, &nparams, flags);
          virTypedParameterArrayClear(params, nparams);
      
      In case nparams was originally set to 0, virDomain* API would fill it
      with the number of typed parameters it can provide and we would use this
      number (rather than zero) to clear params. Because VIR_ALLOC* returns
      non-NULL pointer even if size is 0, the code would end up walking
      through random memory. If we were lucky enough and the memory contained
      7 (VIR_TYPED_PARAM_STRING) at the right place, we would try to free a
      random pointer and crash.
      
      Let's make sure params stays NULL when nparams is 0.
      6039a2cb
  12. 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
  13. 20 7月, 2012 1 次提交
  14. 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
  15. 05 7月, 2012 1 次提交
  16. 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
  17. 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
  18. 21 5月, 2012 1 次提交
  19. 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
  20. 30 3月, 2012 1 次提交
  21. 23 3月, 2012 3 次提交
    • 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
  22. 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
  23. 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
  24. 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
  25. 04 2月, 2012 1 次提交
    • 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
  26. 01 2月, 2012 3 次提交
  27. 29 1月, 2012 1 次提交
  28. 28 1月, 2012 2 次提交
  29. 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
  30. 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