This allows to fix https://gitlab.freedesktop.org/spice/spice/-/issues/88.
Some technologies like ARM64 TBI, AMD UAI or Intel LAM use higher
address bits to store some additional information.
We should preserve such bits.
In order to do that detect if the group is for host addresses and
threat the address verbatim.
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Tested-by: Momin Juned
Remove:
test-display-streaming.c: In function 'get_commands':
test-display-streaming.c:218:42: error: 'calloc' sizes specified with 'sizeof' in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
218 | *commands = (Command*) calloc(sizeof(Command), *num_commands);
| ^~~~~~~
test-display-streaming.c:218:42: note: earlier argument should specify number of elements, later size of each element
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
test-listen using GIO had issues running under CI for a while.
GIO is reading some desktop configuration so it's not very CI
friendly.
So instead of using GIO use OpenSSL BIO. The code does not
get much bigger or complicated.
We are already using OpenSSL so we are not adding dependencies.
This fixes CI for Fedora 39 (just released and available on docker).
This allowed to remove an old workaround for GIO in .gitlab-ci.yml
(cfr commit 89edf80821
"ci: Workaround an issue with GLib on Fedora 30")
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
This leak causes a CI failure running test-listen test with
Valgrind.
Note that "check-valgrind" CI job will still fail but with
less issues.
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
gstreamer-plugins-base 1.20 includes a new member in the
GstAppSinkCallbacks struct:
gboolean (*new_event) (GstAppSink *appsink, gpointer user_data);
So it has to be initialized in order to build test-gst.cpp
successfully.
(added in
0a657d6db5
)
Acked-by: Frediano Ziglio <freddy77@gmail.com>
In OpenSSL3, the SSL_accept call now emits proper errors, which we dump
*before* emitting the expected "SSL_accept failed" error message. The
g_test_expect_message framework doesn't really allow us to discard
messages AFAICT, so instead we add a new expectation with fairly loose
criteria.
Fixes#63
Signed-off-by: Simon Chopin <simon.chopin@canonical.com>
Acked-by: Frediano Ziglio <freddy77@gmail.com>
Found with readability-uppercase-literal-suffix
Avoids readability problems between lower case l and uppercase I.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Acked-by: Frediano Ziglio <freddy77@gmail.com>
Found with google-readability-casting
https://google.github.io/styleguide/cppguide.html#Casting
Makes the operation clearer.
This commit uses const_cast where needed.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Acked-by: Frediano Ziglio <freddy77@gmail.com>
The leak is detected by Valgrind on Fedora 34as:
==19603== 400 bytes in 1 blocks are possibly lost in loss record 2,296 of 2,441
==19603== at 0x4845464: calloc (vg_replace_malloc.c:1117)
==19603== by 0x40135FB: _dl_allocate_tls (in /usr/lib64/ld-2.33.so)
==19603== by 0x57EB008: pthread_create@@GLIBC_2.2.5 (in /usr/lib64/libpthread-2.33.so)
==19603== by 0x53A1130: UnknownInlinedFun (gthread-posix.c:1323)
==19603== by 0x53A1130: g_thread_new_internal (gthread.c:931)
==19603== by 0x53C4953: g_thread_pool_start_thread.constprop.0 (gthreadpool.c:477)
==19603== by 0x53A2902: g_thread_pool_push (gthreadpool.c:691)
==19603== by 0x519AE11: g_task_run_in_thread_sync (gtask.c:1593)
==19603== by 0x80D8A74: ??? (in /usr/lib64/gio/modules/libgiolibproxy.so)
==19603== by 0x5181966: g_proxy_address_enumerator_next (gproxyaddressenumerator.c:176)
==19603== by 0x519281A: g_socket_client_connect (gsocketclient.c:1098)
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Found with modernize-use-nullptr
NULL in C++ is 0 whereas it is a void pointer in C. Avoids implicit
conversions.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Acked-by: Frediano Ziglio <freddy77@gmail.com>
Found with modernize-use-override
This can be useful as compilers can generate a compile time error when:
The base class implementation function signature changes.
The user has not created the override with the correct
signature.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Acked-by: Frediano Ziglio <freddy77@gmail.com>
Fix this error reported by some older Gnu C++ compilers:
./server/tests/test-display-base.cpp:818:1: sorry, unimplemented: non-trivial designated initializers not supported
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Marc-André Lureau <marcandre.lureau@redhat.com>
- remove entry for g-type-register-static: the "possible" flag has been
re-introduced in glib.supp
- add new entries for several calloc issues
Signed-off-by: Julien Ropé <jrope@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
Exit more cleanly, otherwise sometimes some strange failures
occurs. This is due to the fact that a thread is cleaning up
everything while the others are still working.
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Uri Lublin <ulublin@redhat.com>
This flag allows to catch variables or arguments hiding other
variables or attributes.
It helps avoiding some possible mistakes.
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Julien Ropé <jrope@gmail.com>
Instead of including spice.h directly include an header that wraps
it. This allows to remove the SPICE_SERVER_INTERNAL define.
Currently is used to rename SpiceCharDeviceInstance to RedCharDevice
and reduce its visibility to hidden. This remove some warnings
and some weird code in the source.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
This allows to make easier the management of owning.
Reference counting is automatically updated based on shared
pointers modification.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
The patch seems pretty huge but mainly are mechanical steps:
- remove GObject declarations
- do not inherit from GObject
- add SPICE_CXX_GLIB_ALLOCATOR to avoid using C++ allocators
- CLASS_init and CLASS_constructor code goes into C++ constructor
- CLASS_dispose and CLASS_finalize code goes into C++ destructor
- g_object_new is replaced by new operator
- class members goes into virtual methods
- class parameters became argument to constructor
- use push-visibility.h and pop-visibility.h to limit visibility
- temporary use XXX_CAST for old GObject casts, they will
be replaced
- g_object_get is replaced by accessors
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
This allows the compiler to do some more optimisations on the
produced binary.
To allows possible future portability include header/footer in
some helper header files.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>