[Spice-commits] Changes to 'rfc/v1/AgentInterface'

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Sep 17 07:27:50 UTC 2019


New branch 'rfc/v1/AgentInterface' available with the following commits:
commit d3c9bb5ed6c1ce9afcbfb1b109c2c0ad87422961
Author: Kevin Pouget <kpouget at redhat.com>
Date:   Mon Sep 9 09:41:50 2019 +0200

    build: Introduce 'agent' as an alternative Recorder implementation
    
    The 'agent' interface is an experimental alternative to C3D recorder
    for capturing Spice performance indicators.
    
    > --enable-recorder=[c3d/agent/no]
    >          Enable recorder instrumentation [default=no]
    
    Signed-off-by: Kevin Pouget <kpouget at redhat.com>

commit fb5ec595a9874194ea670a25abad6ca84b661d4c
Author: Kevin Pouget <kpouget at redhat.com>
Date:   Mon Sep 9 09:47:32 2019 +0200

    common/recorder.h: do not complain on unused (dummy) recorders
    
    Signed-off-by: Kevin Pouget <kpouget at redhat.com>

commit 7bd6843da1403a81324c4a2871815f26b2f80646
Author: Kevin Pouget <kpouget at redhat.com>
Date:   Mon Sep 9 10:53:54 2019 +0200

    agent-interface: add special recorder 'quality_interface'
    
    This special interface should be defined by Spice-Server. It allows
    the forwarding of Quality message to Smart Streaming main module, via
    the socket to the Server's Smart Local Agent.
    
    > RECORDER(quality_interface, 64, "Quality Interface");
    >
    > void main_channel_client_handle_quality_indicator(MainChannelClient *mcc,
    >                                                   SpiceMsgcMainQualityIndicator *msg, uint32_t size)
    > {
    >     record(quality_interface, "client: %s", msg->indic);
    > }
    
    > RECORDER_DECLARE(quality_interface);
    >
    > static void forward_quality(uint64_t *_not_used, const char *quality)
    > {
    >     record(quality_interface, "server: %s", quality);
    > }
    
    > RECORDER_DECLARE(quality_interface);
    >
    > static bool
    > handle_msg_quality(StreamDevice *dev, SpiceCharDeviceInstance *sin)
    > {
    >     /* ... */
    >     record(quality_interface, "guest: %s", quality_msg->quality);
    > }
    
    Signed-off-by: Kevin Pouget <kpouget at redhat.com>

commit 0189a3b40c8638c6163efcfa07fd32503d096dce
Author: Kevin Pouget <kpouget at redhat.com>
Date:   Mon Sep 9 10:47:49 2019 +0200

    agent-interface: allow SPICE to provide the on-connect callback
    
    The on_connect callback is called when a Smart Local Agent connects to
    the Agent Interface.
    
    > static void on_agent_interface_connect(void *data);
    >
    > static void init_agent()
    > {
    >     /* ... */
    >     record(agent_interface, "on_connect_cb: %p %p",
    >            on_agent_interface_connect, &connect_data);
    > }
    
    Signed-off-by: Kevin Pouget <kpouget at redhat.com>

commit e50b3ab94403b2a7ce25e3bfb1b9f3c39e2d12a8
Author: Kevin Pouget <kpouget at redhat.com>
Date:   Mon Sep 9 10:42:31 2019 +0200

    agent-interface: allow SPICE to provide the quality-forwarding callback
    
    The quality-forwarding callback is called when the Agent-Interface
    receives a Quality string from the Smart Local Agent socket. This
    message should be forwarded by SPICE to the Quality Interface of Spice
    Server.
    
    > static void forward_quality(uint64_t *data, const char *quality);
    >
    > static void init_agent(SpiceChannel *channel)
    > {
    >     /* ... */
    >     record(agent_interface, "quality_cb: %p %p", forward_quality, channel);
    > }
    
    Signed-off-by: Kevin Pouget <kpouget at redhat.com>

commit 18adcaa08c49a05fcb4f9d4a230fc10648c3cc3f
Author: Kevin Pouget <kpouget at redhat.com>
Date:   Mon Sep 9 10:32:21 2019 +0200

    agent-interface: add special recorder 'agent_interface' for port configuration
    
    This special recorder allows SPICE to configure the Agent Interface:
    
    > RECORDER_DECLARE(agent_interface);
    >
    > static void init_agent(void)
    > {
    >     uint64_t port = 1234;
    >
    >     record(agent_interface, "port: %lu", port);
    > }
    
    The configuration of the Agent Interface port triggers the creation of
    the server socket.
    
    The '%lu' printf-format allows the warning-free compatibility with the
    dummy recorder.h, that passes the record(rec, *) arguments to printf.
    
    Signed-off-by: Kevin Pouget <kpouget at redhat.com>

commit 7d219cc94cdc7697a57d61846b447eeeab392ffa
Author: Kevin Pouget <kpouget at redhat.com>
Date:   Mon Sep 9 09:59:31 2019 +0200

    agent-interface: introduce the core of the Agent Interface
    
    When initialized (recorder_initialization), the Agent Interface launch
    a GThread (handle_communications) that opens a TCP server socket and
    waits for Smart Local Agent connections. When a Local Agent connects
    to the sockets, the communication is initialized
    (agent_initialize_communication), the communication socket is stored
    and the list of Recorders is sent. In return, the local agent
    indicates which recorders to enable.
    
    On the SPICE side, the Agent Interface handles the record() calls
    (recorder_append*). When a record is received from SPICE, and if the
    recorder is enabled, the record entry is sent through the TCP
    connection. Otherwise, the record is dropped.
    
    Signed-off-by: Kevin Pouget <kpouget at redhat.com>

commit c2442e509c3e8a853dd27aa8779730828c7e120a
Author: Kevin Pouget <kpouget at redhat.com>
Date:   Mon Sep 9 09:49:31 2019 +0200

    agent-interface: add agent_interface.h header
    
    This file is based on c3d/recorder's recorder.h file, that describes a
    general-purpose instrumentation interface. agent_interface.h is a
    trimmed-down version of it.
    
    Signed-off-by: Kevin Pouget <kpouget at redhat.com>



More information about the Spice-commits mailing list