1. 14 11月, 2016 1 次提交
    • E
      admin: Use the newly introduced close callback handling helpers · e555ed6f
      Erik Skultety 提交于
      Use the newly introduced close callback helpers to make the code look just a
      bit cleaner and more importantly, to fix the following memleak regarding a
      dangling virAdmConnect object reference caused by assigning NULL to the close
      callback data once the catch-disconnect routine used the callback followed
      by a comparison of NULL to the originally defined close callback (which at that
      moment had already been NULL'd by remoteAdminClientCloseFunc) in
      virAdmConnectCloseCallbackUnregister.
      
      717 (88 direct, 629 indirect) bytes in 1 blocks are definitely lost record
       110 of 141
          at 0x4C2A988: calloc (vg_replace_malloc.c:711)
          by 0x530696F: virAllocVar (viralloc.c:560)
          by 0x53689E6: virObjectNew (virobject.c:193)
          by 0x5368B5E: virObjectLockableNew (virobject.c:219)
          by 0x4E3E7EE: virAdmConnectNew (datatypes.c:900)
          by 0x4E398BB: virAdmConnectOpen (libvirt-admin.c:220)
          by 0x10D3E3: vshAdmConnect (virt-admin.c:161)
          by 0x10D624: vshAdmReconnect (virt-admin.c:215)
          by 0x10DB0A: cmdConnect (virt-admin.c:353)
          by 0x11288F: vshCommandRun (vsh.c:1313)
          by 0x10FDB6: main (virt-admin.c:1439)
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1357358Signed-off-by: NErik Skultety <eskultet@redhat.com>
      e555ed6f
  2. 19 5月, 2016 2 次提交
    • E
      admin: Introduce virAdmServerSetClientLimits · 8b1f0469
      Erik Skultety 提交于
      Opposite operation to virAdmServerGetClientLimits. Understandably though,
      setting values for current number of clients connected or still waiting
      for authentication does not make sense, since changes to these values are event
      dependent, i.e. a client connects - counter is increased. Thus only the limits
      to maximum clients connected and waiting for authentication can be set. Should
      a request for other controls to be set arrive (provided such a setting will
      be first introduced to the config), the set of configuration controls can be
      later expanded (thanks to typed params). This patch also introduces a
      constraint that the maximum number of clients waiting for authentication has to
      be less than the overall maximum number of clients connected and any attempt to
      violate this constraint will be denied.
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      8b1f0469
    • E
      admin: Introduce virAdmServerGetClientLimits · 509bd5d8
      Erik Skultety 提交于
      Enable retrieval of the number of maximum clients connected to all sockets
      combined, as well as the number of maximum clients waiting for authentication,
      in order to be successfully connected. These are the attributes configurable
      through libvirtd.conf, however, it could be handy to not only know values for
      these limits, but also the values for the current number of clients
      connected and number of clients currently waiting for authentication which are
      changing dynamically. This API does both, retrieves the limits as well as the
      current dynamic values.
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      509bd5d8
  3. 10 5月, 2016 1 次提交
  4. 03 5月, 2016 2 次提交
    • E
      admin: Introduce virAdmClientGetInfo API · 4a0e9108
      Erik Skultety 提交于
      Expose a public API to retrieve some identity and connection information about
      a client connected to the specified server on daemon. The identity info
      retrieved is mostly connection transport dependent, i.e. there won't be any
      socket address returned for a local (UNIX socket) connection, while on the
      other hand, when connected through TLS or unencrypted TCP, obviously no UNIX
      process identification will be present in the returned data. All supported
      values that can be returned in typed params are exposed and documented in
      include/libvirt/libvirt-admin.h
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      4a0e9108
    • E
      admin: Introduce listing clients · ed978fa2
      Erik Skultety 提交于
      Finally add public method to retrieve the list of currently connected clients
      to a given server.
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      ed978fa2
  5. 18 4月, 2016 2 次提交
    • E
      admin: Introduce virAdmServerSetThreadPoolParameters · 93ab4da5
      Erik Skultety 提交于
      Since threadpool increments the current number of threads according to current
      load, i.e. how many jobs are waiting in the queue. The count however, is
      constrained by max and min limits of workers. The logic of this new API works
      like this:
          1) setting the minimum
              a) When the limit is increased, depending on the current number of
                 threads, new threads are possibly spawned if the current number of
                 threads is less than the new minimum limit
              b) Decreasing the minimum limit has no possible effect on the current
                 number of threads
          2) setting the maximum
              a) Icreasing the maximum limit has no immediate effect on the current
                 number of threads, it only allows the threadpool to spawn more
                 threads when new jobs, that would otherwise end up queued, arrive.
              b) Decreasing the maximum limit may affect the current number of
                 threads, if the current number of threads is less than the new
                 maximum limit. Since there may be some ongoing time-consuming jobs
                 that would effectively block this API from killing any threads.
                 Therefore, this API is asynchronous with best-effort execution,
                 i.e. the necessary number of workers will be terminated once they
                 finish their previous job, unless other workers had already
                 terminated, decreasing the limit to the requested value.
          3) setting priority workers
              - both increase and decrease in count of these workers have an
                immediate impact on the current number of workers, new ones will be
                spawned or some of them get terminated respectively.
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      93ab4da5
    • E
      admin: Introduce virAdmServerGethreadPoolParameters · caa16d31
      Erik Skultety 提交于
      New API to retrieve current server workerpool specs. Since it uses typed
      parameters, more specs to retrieve can be further included in the pool of
      supported ones.
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      caa16d31
  6. 11 3月, 2016 1 次提交
  7. 19 2月, 2016 1 次提交
    • E
      admin: Fix memory leak in remoteAdminConnectClose · e9e85655
      Erik Skultety 提交于
      When virt-admin is run with valgrind, this kind of output can be obtained:
      
      HEAP SUMMARY:
        in use at exit: 134,589 bytes in 1,031 blocks
        total heap usage: 2,667 allocs, 1,636 frees, 496,755 bytes allocated
      
      88 bytes in 1 blocks are definitely lost in loss record 82 of 128
       at 0x4C2A9C7: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
       by 0x52F6D1F: virAllocVar (viralloc.c:560)
       by 0x5350268: virObjectNew (virobject.c:193)
       by 0x53503E0: virObjectLockableNew (virobject.c:219)
       by 0x4E3BBCB: virAdmConnectNew (datatypes.c:832)
       by 0x4E38495: virAdmConnectOpen (libvirt-admin.c:209)
       by 0x10C541: vshAdmConnect (virt-admin.c:107)
       by 0x10C7B2: vshAdmReconnect (virt-admin.c:163)
       by 0x10CC7C: cmdConnect (virt-admin.c:298)
       by 0x110838: vshCommandRun (vsh.c:1224)
       by 0x10DFD8: main (virt-admin.c:862)
      
       LEAK SUMMARY:
          definitely lost: 88 bytes in 1 blocks
          indirectly lost: 0 bytes in 0 blocks
          possibly lost: 0 bytes in 0 blocks
          still reachable: 134,501 bytes in 1,030 blocks
          suppressed: 0 bytes in 0 blocks
      
      This is because virNetClientSetCloseCallback was being reinitialized
      incorrectly. By resetting the callbacks in a proper way, the leak is fixed.
      e9e85655
  8. 17 2月, 2016 1 次提交
  9. 21 12月, 2015 1 次提交
    • E
      Revert "admin: Rename virAdmConnect to virAdmDaemon" · 3245e178
      Erik Skultety 提交于
      Commmit df8192aa introduced admin related rename and some minor
      (caused by automated approach, aka sed) and some more severe isues along with
      it. First reason to revert is the inconsistency with libvirt library.
      Although we deal with the daemon directly rather than with a specific
      hypervisor, we still do have a connection. That being said, contributors might
      get under the impression that AdmDaemonNew would spawn/start a new daemon
      (since it's admin API, why not...), or AdmDaemonClose would do the exact
      opposite or they might expect DaemonIsAlive report overall status of the daemon
      which definitely isn't the case.
      The second reason to revert this patch is renaming virt-admin client. The
      client tool does not necessarily have to reflect the names of the API's it's
      using in his internals. An example would be 's/vshAdmConnect/vshAdmDaemon'
      where noone can be certain of what the latter function really does. The former
      is quite expressive about some connection magic it performs, but the latter does
      not say anything, especially when vshAdmReconnect and vshAdmDisconnect were
      left untouched.
      3245e178
  10. 01 12月, 2015 1 次提交
    • M
      admin: Rename virAdmConnect to virAdmDaemon · df8192aa
      Martin Kletzander 提交于
      virAdmConnect was named after virConnect, but after some discussions,
      most of the APIs called will be working with remote daemon and starting
      them virAdmDaemon will make more sense.  Only possibly controversal name
      is CloseCallback (de)registration, and connecting to the daemon (which
      will still be Open/Close), but even this makes sense if one thinks about
      the daemon being opened and closed, e.g. as file, etc.
      
      This way all the APIs working with the daemon will start with
      virAdmDaemon prefix, they will accept virAdmDaemonPtr as first parameter
      and that will better suit with other namings as well (virDomain*,
      virAdmServer*, etc.).
      
      Because in virt-admin, the connection name does not refer to a struct
      that would have a connect in its name, also adjust 'connname' in
      clients.  And because it is not used anywhere in the vsh code, move it
      from there into each client.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      df8192aa
  11. 30 11月, 2015 3 次提交
    • E
      admin: Add support for connection close callbacks · 6dd7e42d
      Erik Skultety 提交于
      As we need a client disconnect handler, we also need a mechanism to register
      such handlers for a client. This patch introduced both the close callbacks and
      also the client vshAdmCatchDisconnect handler to be registered with it. By
      registering the handler we still need to make sure the client can react to
      daemon's events like disconnect or keepalive, so asynchronous I/O event polling
      is necessary to be enabled too.
      6dd7e42d
    • E
      admin: Do not generate remoteAdminConnect{Open,Close} · 0ecf9b3e
      Erik Skultety 提交于
      As we plan to add more and more logic to remote connecting methods,
      these cannot be generated from admin_protocol.x anymore. Instead,
      this patch implements these to methods explicitly.
      0ecf9b3e
    • E
      admin: Move remote admin API version to a separate module · b86cf882
      Erik Skultety 提交于
      By moving the remote version into a separate module, we gain a slightly
      better maintainability in the long run than just by leaving it in one
      place with the existing libvirt-admin library which can start getting
      pretty messy later on.
      b86cf882