1. 24 6月, 2016 1 次提交
  2. 22 6月, 2016 1 次提交
  3. 08 6月, 2016 4 次提交
  4. 20 5月, 2016 1 次提交
  5. 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
      virnetserver: Introduce server's client-related limits getters · abf29786
      Erik Skultety 提交于
      Add some trivial getters for client related attributes to virnetserver before
      any admin method can be introduced.
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      abf29786
  6. 06 5月, 2016 3 次提交
    • C
      rpc: use virNetMessageClearPayload in client · b6238738
      Cole Robinson 提交于
      This removes the opencoded payload freeing in the client, to use
      the shared virNetMessageClearPayload call. Two changes:
      
      - ClearPayload sets nfds=0, which fixes a potential crash if
        an error path called virNetMessageFree/Clear on the message
        after fds was free'd
      - We drop the inner loop VIR_FORCE_CLOSE... this may mean fds are
        kept open a little bit longer if the call is blocking but in
        practice I don't think it will have any effect
      b6238738
    • C
      rpc: Clear more in virNetMessageClearPayload · 64bd680d
      Cole Robinson 提交于
      Set all counters to 0. This doesn't impact current users, but
      future users will want this
      64bd680d
    • C
      rpc: Add virNetMessageClearPayload · 220c4e85
      Cole Robinson 提交于
      Handles freeing the buffer and fds, but not the message details.
      Use it to drop some duplicate code.
      220c4e85
  7. 05 5月, 2016 2 次提交
    • M
      virNetServerClientNewPostExecRestart: Avoid align problems · b17e610e
      Michal Privoznik 提交于
      I've noticed this while trying to compile libvirt on my arm box.
      
        CC       rpc/libvirt_net_rpc_server_la-virnetserverclient.lo
      rpc/virnetserverclient.c: In function 'virNetServerClientNewPostExecRestart':
      rpc/virnetserverclient.c:516:45: error: cast increases required alignment of target type [-Werror=cast-align]
                                                   (long long *) &timestamp) < 0) {
                                                   ^
      cc1: all warnings being treated as errors
      
      Problem is, @timestap is defined as time_t which is 32 bits long,
      and we are typecasting it to long long which is 64bits long.
      Solution is to make @timestamp type of long long. At the same
      time, we can make @conn_time in _virNetServerClient struct long
      long too. There is no need for it to be type of time_t.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      b17e610e
    • M
      virNetServerClientNewPostExecRestart: Drop useless typecasts · 2a3a2c2f
      Michal Privoznik 提交于
      In this function, @id is defined as unsigned long long. When
      passing this variable to virJSONValueObjectGetNumberUlong(),
      well address of this variable, it's typecasted to ull*. There
      is no need for that. It's a same story with @nrequests_max.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      2a3a2c2f
  8. 03 5月, 2016 9 次提交
    • E
      virnetserverclient: Add an internal method to retrieve client's identity · 8420a53e
      Erik Skultety 提交于
      This method just aggregates various client object attributes, like socket
      address, connection type (RO/RW), and some TCP/TLS/UNIX identity in an atomic
      manner.
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      8420a53e
    • E
      virneserverclient: Introduce virNetServerClientHasSASLSession · bde2cb61
      Erik Skultety 提交于
      We do have a similar method, serving the same purpose, for TLS, but we lack
      one for SASL. So introduce one, in order for other modules to be able to find
      out, if a SASL session is active, or better said, that a SASL session exists
      at all.
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      bde2cb61
    • E
      virnetsocket: Provide socket address format in a more standard form · 9b45c9f0
      Erik Skultety 提交于
      Our socket address format is in a rather non-standard format and that is
      because sasl library requires the IP address and service to be delimited by a
      semicolon. The string form is a completely internal matter, however once the
      admin interfaces to retrieve client identity information are merged, we should
      return the socket address string in a common format, e.g. format defined by
      URI rfc-3986, i.e. the IP address and service are delimited by a colon and
      in case of an IPv6 address, square brackets are added:
      
      Examples:
          127.0.0.1:1234
          [::1]:1234
      
      This patch changes our default format to the one described above, while adding
      separate methods to request the non-standard SASL format using semicolon as a
      delimiter.
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      9b45c9f0
    • E
      admin: Introduce virAdmServerLookupClient · 52a2eef9
      Erik Skultety 提交于
      Just like with server-related APIs, before any of client-based APIs can be
      called, a reference to a client-side client object needs to be obtained. For
      this purpose, a lookup method should exist. Apart from the client retrieval
      logic, a new error code for non-existent client had to be added as well.
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      52a2eef9
    • E
      rpc: virnetserverclient: Implement client connection transport retrieval · 42b06aa6
      Erik Skultety 提交于
      Although we document 6 types of transport that we support, internally we can
      only differentiate between TCP, TLS, and UNIX transports only, since both SSH
      and libssh2 transports, due to using netcat, behave in the exactly the same
      way as a UNIX socket.
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      42b06aa6
    • E
      rpc: virnetserver: Support retrieval of a list of clients · 04bab54d
      Erik Skultety 提交于
      For now, the list copy is done simply by locking the whole server, walking the
      original and increasing the refcount on each object. We may want to change
      the list to a lockable object (like list of domains) later in the future if
      we discover some performance issues related to locking the whole server in
      order to walk the whole list of clients, possibly issuing some 'ForEach'
      callback.
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      04bab54d
    • E
      rpc: gendispatch: Tune it to support client structure · 4bd43074
      Erik Skultety 提交于
      Now that libvirt-admin supports another client-side object and provided that
      we want to generate as many both client-side and server-side RPC dispatchers,
      support for this needs to be added to gendispatch.
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      4bd43074
    • E
      rpc: virnetserverclient: Introduce new attribute conn_time to client · a32135b3
      Erik Skultety 提交于
      Besides ID, libvirt should provide several parameters to help the user
      distinguish two clients from each other. One of them is the connection
      timestamp. This patch also adds a testcase for proper JSON formatting of the
      new attribute too (proper formatting of older clients that did not support
      this attribute yet is included in the existing tests) - in order to
      testGenerateJSON to work, a mock of time_t time(time_t *timer) needed to be
      created.
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      a32135b3
    • E
      rpc: virnetserverclient: Identify clients by an integer ID · 5841d64d
      Erik Skultety 提交于
      Admin API needs a way of addressing specific clients. Unlike servers, which we
      are happy to address by names both because its name reflects its purpose (to
      some extent) and we only have two of them (so far), naming clients doesn't make
      any sense, since a) each client is an anonymous, i.e. not recognized after a
      disconnect followed by a reconnect, b) we can't predict what kind of requests
      it's going to send to daemon, and c) the are loads of them comming and going,
      so the only viable option is to use an ID which is of a reasonably wide data
      type.
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      5841d64d
  9. 02 5月, 2016 3 次提交
    • C
      rpc: protocol: Clarify VIR_NET_ERROR usage with streams · 8958dde5
      Cole Robinson 提交于
      The described protocol semantics really only apply to server initiated
      stream messages. Document the semantics for client messages.
      8958dde5
    • M
      virnetclientstream: Process stream messages later · 18944b7a
      Michal Privoznik 提交于
      There are two functions on the client that handle incoming stream
      data.  The first one virNetClientStreamQueuePacket() is a low
      level function that just processes the incoming stream data from
      the socket and stores it into an internal structure. This happens
      in the client event loop therefore the shorter the callbacks are,
      the better. The second function virNetClientStreamRecvPacket()
      then handles copying data from internal structure into a client
      provided buffer.
      Change introduced in this commit makes just that: new queue for
      incoming stream packets is introduced. Then instead of copying
      data into intermediate internal buffer and then copying them into
      user buffer, incoming stream messages are queue into the queue
      and data is copied just once - in the upper layer function
      virNetClientStreamRecvPacket(). In the end, there's just one
      copying of data and therefore shorter event loop callback. This
      should boost the performance which has proven to be the case in
      my testing.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      18944b7a
    • M
      Revert "rpc: Fix slow volume download (virsh vol-download)" · 435ee578
      Michal Privoznik 提交于
      This reverts commit d9c9e138.
      
      Unfortunately, things are going to be handled differently so this
      commit must go.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      435ee578
  10. 29 4月, 2016 1 次提交
    • B
      rpc: Don't leak fd via CreateXMLWithFiles · 5ba48584
      Ben Gray 提交于
      FD passing APIs like CreateXMLWithFiles or OpenGraphicsFD will leak
      file descriptors. The user passes in an fd, which is dup()'d in
      virNetClientProgramCall. The new fd is what is transfered to the
      server virNetClientIOWriteMessage.
      
      Once all the fds have been written though, the parent msg->fds list
      is immediately free'd, so the individual fds are never closed.
      
      This closes each FD as its send to the server, so all fds have been
      closed by the time msg->fds is free'd.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1159766
      5ba48584
  11. 21 4月, 2016 2 次提交
  12. 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
  13. 13 4月, 2016 1 次提交
    • C
      rpc: daemon: Fix virtlog/virtlock daemon reload · 9b69f022
      Cole Robinson 提交于
      Trying to reload/SIGUSR1 virtlogd or virtlockd fails with:
      
      error : virNetDaemonRun:747 : internal error: Not all servers restored, cannot run server
      
      Commit 252610f7 changed the daemon state json to allow tracking
      multiple servers. However it missed clearing dmn->srvObject after
      the json is empty, like the previous code paths handled.  Later on in
      virNewDaemonRun, dmn->srvObject is expected to be empty otherwise we
      throw the above error.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1311013
      9b69f022
  14. 11 4月, 2016 1 次提交
  15. 31 3月, 2016 1 次提交
    • F
      build: workaround broken SASL header (again) · ab74e876
      Fabiano Fidêncio 提交于
      Compilation for xdg-app failed due to a buggy SASL headers present on
      the used runtime (org.gnome.Sdk 3.18).
      
      In file included from rpc/virnetsaslcontext.h:24:0,
                       from rpc/virnetsaslcontext.c:25:
      /usr/include/sasl/sasl.h:230:38: error: unknown type name 'size_t'
       typedef void *sasl_realloc_t(void *, size_t);
                                            ^
      /usr/include/sasl/sasl.h:235:5: error: unknown type name 'sasl_realloc_t'
           sasl_realloc_t *,
      
      Use the same workaround as commit 1be3dfdf did.
      Signed-off-by: NJán Tomko <jtomko@redhat.com>
      ab74e876
  16. 24 3月, 2016 1 次提交
    • M
      gendispatch: Avoid comparing signed and unsigned vars · 9b48ef9c
      Michal Privoznik 提交于
      The adminDispatchConnectListServers() function is generated by
      our great perl script. However, it has a tiny flaw: if
      adminConnectListServers() it calls fails, the control jumps onto
      cleanup label where we try to free any list of servers built so
      far. However, in the loop @i is unsigned (size_t) while @nresults
      is signed (int). Currently, it does no harm because of the check
      for @result being non-NULL. But if that ever changes in the
      future, this bug will be hard to chase.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      9b48ef9c
  17. 17 3月, 2016 1 次提交
  18. 11 3月, 2016 4 次提交