This patch introduces `set_bitmap` and `test_bitmap` + relevant
macros, adapted from `<qemu>/include/qemu/bitops.h`.
These functions differ from `set_bit`/`test_bit` as they can set/test
bits in bit arrays longer than scalar data-types.
Signed-off-by: Kevin Pouget <kpouget@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
spice-common depends on Glib2, so automatically add to the
dependency list.
You can define a GLIB2_MIN_VER m4 variable in configure.ac
to raise the default GLib2 required version.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Kevin Pouget <kpouget@redhat.com>
Add a common.m4 file to be included directly in other project.
This include will include all needed checks to use spice-common.
Just include directly this file in your configure.ac.
This will define SPICE_COMMON_CFLAGS and SPICE_COMMON_DIR (for
linking .la files) which are needed to use spice-common.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Kevin Pouget <kpouget@redhat.com>
Reduce execution time. No need to run so much tests, coverage
stays more or less the same.
We iterate twice to check RGB mode with alpha, otherwise the
coverage reduce about 10-20%.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Marc-André Lureau <marcandre.lureau@gmail.com>
There's no much need for than size to be so big, limit to
reduce execution time, coverage stays more or less the same.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Do not call the function for every iteration
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Marc-André Lureau <marcandre.lureau@gmail.com>
New versions of gcc have implemented __has_builtin which causes meson
to detect functions in libm, such as hypot() and sqrt() as built-ins
during configure time, while they are actually part of libm. This has
been causing build failures in Fedora 32 Rawhide and has been reported
in meson for some time now: https://github.com/mesonbuild/meson/issues/3740
Meson always adds --as-needed to linker arguments so, it does not hurt
to link against libm even though no functions from that library will be
used.
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
This rule remove possible integer overflows.
Current code generated is not affected by these integer overflows
as the computations are done using 64 bit but better safe then sorry.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Julien Rope <jrope@redhat.com>
No need to compute these variable always, only if we have
a reference to a previous sequence.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Francesco Giudici <fgiudici@redhat.com>
The loop is always executed once so use a do {} while construct
to avoid the repetition.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Francesco Giudici <fgiudici@redhat.com>
Boundaries checks already done some lines above, no needs
to repeat for each pixel.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Francesco Giudici <fgiudici@redhat.com>
"buffers" and "marshallers" are always pointing to the static
buffers inside the same structure.
Use single array fields to avoid having initialize and have them.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Julien Rope <jrope@redhat.com>
This macro was suggested to simplify hot path expensive checks
which should be disable in production environments.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Francesco Giudici <fgiudici@redhat.com>
Allows to check QUIC algorithm and code with multiple input/output
formats.
Was limited to just RGB and RGBA.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Remove some system checks.
Specifically:
- functions in the standard C (memset, memmove);
- functions we use but we assume in the specific implementation
present (dup2, fork);
- functions we don't use (error_at_line);
- headers in the standard C (stddef.h, stdint.h, string.h);
- headers present in all systems we support if are not checked
in the source files (malloc.h);
- types we assume being present (XintYY_t, pid_t).
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Include headers required for implementation only in the
implementation file.
This remove dependency and avoid the user component having to
check for header flags (in this case HAVE_CELT051 and HAVE_OPUS).
This make easier integration in other components.
This also make compilation faster.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
quic_config is used only by the implementation so include it
only from the implementation file.
This remove dependency.
This make easier integration in other components.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Allow the user to disable tests through -Dtests=false
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
Allow the user to disable tests through --disable-tests, this is
especially useful for example to disable gdk-pixbuf dependency
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
Make sure that guard do no change building out-of-tree or
with Meson.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Uri Lublin <uril@redhat.com>
The agent-interface is an experimental instrumentation library for
capturing and sharing Spice performance indicators with an external
agent.
--enable-instrumentation=[recorder/agent/no]
Enable instrumentation [default=no]
The former configuration option '--enable-recorder' is transformed
into '--enable-instrumentation=recorder'.
Signed-off-by: Kevin Pouget <kpouget@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
agent_interface_start: this function allows launching the agent
interface (ie, its listening socket) on a given port.
agent_interface_set_on_connect_cb: this function allows passing a
callback function that will be triggered when a client (a Local Agent)
connects to the Agent Interface socket.
agent_interface_set_forward_quality_cb: this function allows SPICE to
provide a function that will forward Quality messages received by the
Agent Interface towards SPICE server, for a centralized processing of
the messages.
Signed-off-by: Kevin Pouget <kpouget@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
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@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
Check that combination of fields for an array does not
lead to unsafe code.
check_valid method came from generate_c_declaration with
some more check and it's use in demarshaller to validate
the array if the structure is not generated.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
Output attributes are the attributes that specify how to store
that field in the C structure.
There can be only one output type specified.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
The argument requires Meson 0.50 however it's already "false"
by default if "install_dir" is not provided so remove it
to keep compatibility with Meson 0.48.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
This check make sure that output fields for member with @end (arrays)
are declared as empty arrays in output C structure.
This avoids output fields to be declared as pointer or other
invalid types.
The check is a compile time check so no code in object file
is generated.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Uri Lublin <uril@redhat.com>
This was some left-over during development of C structure
generations (the single structure generation was skipped).
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Uri Lublin <uril@redhat.com>
Just style, they do the same thing, but is more coherent
with the rest of the code.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Uri Lublin <uril@redhat.com>
Do it by adding @end tag.
Without it the allocated memory has no space for 'name'.
Also fix SpiceMsgMainArrayMessage tests/test-marshallers.h,
replacing int8_t* name with int8_t name[0].
This makes name an "in-structure" array with no pre-defined size
instead of a pointer.
The size is defined by the message size.
Signed-off-by: Uri Lublin <uril@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
member = None is set before the if/else condition.
In the else code, when member is set it is checked
and if not-None it breaks out of the loop.
If the code is still in the loop for sure member is None.
Found by covscan.
Signed-off-by: Uri Lublin <uril@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
We started disabling Celt support making the option required.
After 2 releases start making it disabled unless explicitly
enabled.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Snir Sheriber <ssheribe@redhat.com>
Pull version update and some features.
Version update changed copyright in files to LGPLv2, more
compatible with SPICE.
One of the feature is the support for absolute time.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
This should always be defined and including config.h is a requirement.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
git.mk seems to have issues with Makefile rules generating multiple
files so add manually this file.
This avoid SPICE server to generate distribution files with
"-dirty" suffix.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>