Commit Graph

16 Commits

Author SHA1 Message Date
Frediano Ziglio
e0b395fb68 Declare exported functions as C
Allows to be used by both C and C++ code.
So to leave part of the code in C and part move to C++.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2020-05-01 06:58:08 +01:00
Frediano Ziglio
0a415abf35 agent-msg-filter: Add some comments to AgentMsgFilter structure
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2019-02-11 15:15:59 +00:00
Christophe Fergeau
bc5326b1ce Unify header guards
This changes the header guards in all .h files to follow this format:

/*
 * Licensing block
 */

/* ... */

Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2017-03-30 18:17:20 +01:00
Pavel Grunt
cd80b9fc78 agent-filter: Use enum as return value
Explicitely discard AGENT_MSG_FILTER_MONITORS_CONFIG messages
from the agent.

Also remove unused AGENT_MSG_FILTER_END

Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-09-16 11:54:56 +01:00
Pavel Grunt
5d6e3ff1e9 agent-filter: Constantify parameter
Filter should not modify data

Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-09-12 13:22:11 +01:00
Jonathon Jongsma
5c64e01111 AgentMsgFilter: use typedef
Instead of using the full 'struct AgentMsgFilter', use the typedef name

Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-05-24 17:46:05 +01:00
Frediano Ziglio
f36c3887ba Make sure all headers are independent
Make sure is possible to include any headers alone.

I used this script to check independence (run under server directory):
----
#!/bin/bash

set -e

# check not already modified
if grep -q libheaders.la Makefile.am; then
    echo "Header library already prepared" >&2
    exit 1
fi

add_lib() {
    local hdr="$1"

    hdr=${hdr%.h}
    c="mao_${hdr}.c"
    echo "#include \"${hdr}.h\"" > $c
    echo -e "\t$c \\" >&3
}

# add library to compile all headers alones
exec 3>> Makefile.am
echo "
noinst_LTLIBRARIES += libheaders.la
libheaders_la_SOURCES =				\\" >&3
for hdr in *.h; do
    case $hdr in
    spice-bitmap-utils.h)
        add_lib $hdr
        ;;
    spice*.h)
        ;;
    *)
        add_lib $hdr
        ;;
    esac
done
echo -e "\t\$(NULL)" >&3
exec 3>&-
----

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-05-18 00:24:37 +01:00
Pavel Grunt
9d777e427a agent-msg-filter: Move include from header
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-05-04 14:40:51 +01:00
Christophe Fergeau
0df59fcfc9 agent: Sync AgentMsgFilter state upon agent connection
AgentMsgFilter needs to know whether monitors config messages need to be
filtered or not. This used to be done from within
agent_msg_filter_config() using the global RedsState, but this got more
tricky as it was removed.
A first attempt a1e62fa5ae caused crashes on qemu startup with
"qemu-system-x86_64 -spice port=5900" (without -vga qxl). A second
attempt added a RedsState* argument to agent_msg_filter_config() which
in my opinion is not really nice from a layering point of view.

This new attempt makes sure AgentMsgFilter state is correct when the
filter is set to stop discarding all data, which allows to remove direct
use of RedsState from within AgentMsgFilter.

Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-03-21 10:34:29 +00:00
Christophe Fergeau
79e02e98ab Revert "fix regression due to callback called earlier"
Passing Reds into agent-msg-filter.[ch] isn't the right thing to do from
a layering point of view.

This reverts commit a1e62fa5ae.

Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-03-21 10:34:22 +00:00
Frediano Ziglio
a1e62fa5ae fix regression due to callback called earlier
Patch 1f21008060 ("Remove use of global
'reds' from AgentMsgFilter") introduced a regression. This because
QXLInterface->client_monitors_config was called before returning
from spice_add_interface. Some client of spice-server expect the
spice_add_interface already returned and some state change was done
before client_monitors_config was called.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-02-19 09:51:25 +00:00
Jonathon Jongsma
1f21008060 Remove use of global 'reds' from AgentMsgFilter
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2016-02-16 10:54:30 +00:00
Hans de Goede
db278430f8 server: Add support for filtering out agent file-xfer msgs (rhbz#961848)
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-06-06 16:07:30 +02:00
Alon Levy
d694739b21 server: Filter VD_AGENT_MONITORS_CONFIG
If the guest supports client monitors config we pass it the
VDAgentMonitorsConfig message via the
QXLInterface::client_monitors_config api instead of via the vdagent.
2012-09-13 14:47:32 +03:00
Hans de Goede
3accb60240 server: add discard all option to agent message filter 2011-04-04 11:30:30 +02:00
Hans de Goede
c2db6d1066 spice-server: Add the ability to filter agent messages 2011-03-24 17:28:21 +01:00