Commit Graph

1007 Commits

Author SHA1 Message Date
Frediano Ziglio
4d5c60226c ci: Install missing package
Latest Fedora release does not include awk command by default.
Install it manually as required by some script.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2025-05-05 17:22:22 +01:00
Frediano Ziglio
c1b8dbbb9b Minor Python 3 updates
- Remove "u" prefix from strings;
- Raising strings as exception is not valid anymore;
- Convert generators to list where necessary;
- traceback.print_exc accept a limit as first argument, not
  a file (this even for Python 2).

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2025-04-07 19:59:32 +00:00
Qiang Yu
492c22f444 Add gl_scanout2_unix for multi plane support
Signed-off-by: Qiang Yu <yuq825@gmail.com>
2025-03-28 14:12:46 +08:00
Qiang Yu
ebf052d051 marshaller: suport multi fd
For sending multi plane gl scanout.

Signed-off-by: Qiang Yu <yuq825@gmail.com>
2025-03-25 15:58:15 +08:00
Akihiko Odaki
2f5f1d3854 test-marshallers: Define generated_test_messages.h target
Define generated_test_messages.h target; otherwise Make may not be able
to find the file and fail.

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
2025-03-01 12:55:56 +00:00
Frediano Ziglio
a791a224e7 Update print syntax to Python 3
Never changed because possibly never hit these lines.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2023-12-16 18:58:37 +00:00
Chris Mayo
8c0319e31d codegen: Use context manager when opening files
Signed-off-by: Chris Mayo <aklhfex@gmail.com>
Acked-by: Frediano Ziglio <freddy77@gmail.com>
2023-12-16 18:45:46 +00:00
Chris Mayo
29dacb5f53 Stop using Python six package
Signed-off-by: Chris Mayo <aklhfex@gmail.com>
Acked-by: Frediano Ziglio <freddy77@gmail.com>
2023-12-16 18:45:43 +00:00
Chris Mayo
91fc091358 Drop Python 2 from m4/spice-deps.m4
Signed-off-by: Chris Mayo <aklhfex@gmail.com>
Acked-by: Frediano Ziglio <freddy77@gmail.com>
2023-12-16 18:45:39 +00:00
Frediano Ziglio
fe4395f3d7 build: Avoid Meson warning
Avoids:

WARNING: You should add the boolean check kwarg to the run_command call.
         It currently defaults to false,
         but it will default to true in future releases of meson.
         See also: https://github.com/mesonbuild/meson/issues/9300

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Uri Lublin <uril@redhat.com>
2023-11-05 15:29:33 +00:00
Vivek Kasireddy
bb8f66983a common: Add a udev helper to identify GPU Vendor
Given that libudev is widely available on many Linux distros, we
can use the relevant APIs to iterate over all the devices associated
with the drm subsystem to figure out if a specific vendor GPU
is available or not.

This capability (identifying GPU Vendor) is useful to determine
whether to launch Gstreamer pipeline using h/w accelerated
plugins. On systems where libudev is not available (Windows,
MacOS, etc) we'd have to make this determination based on the
availability of the relevant plugins in the Gstreamer registry.

Cc: Frediano Ziglio <freddy77@gmail.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
Cc: Dongwon Kim <dongwon.kim@intel.com>
Cc: Hazwan Arif Mazlan <hazwan.arif.mazlan@intel.com>
Cc: Jin Chung Teng <jin.chung.teng@intel.com>
Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
Acked-by: Frediano Ziglio <freddy77@gmail.com>
2023-10-17 10:32:27 +01:00
Frediano Ziglio
58d375e5ea Replace EVP_PKEY_cmp with EVP_PKEY_eq
EVP_PKEY_cmp was made obsolete in OpenSSL.
The main reason is that the return value is not coherent with
other *_cmp functions.
So it was replaced by EVP_PKEY_eq, which does the same.
Rename to avoid a deprecation warning on newer OpenSSL releases.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2022-06-29 07:57:53 +01:00
Frediano Ziglio
8a19611049 ci: Set WINEPATH during Windows build
Without it on Fedora 35 Wine is not able to find DLLs installed
on the system.
This will cause failures executing tests but this also helps in
case there are tests during the configuration phase.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2022-01-27 09:16:53 +00:00
Frediano Ziglio
a7b5474bf8 build: Correctly check for Python modules
Currently using Meson the command "python -m <MODULE_NAME>" is
run. However this command instead of trying to import the module
tried to execute it as a script failing for the updated pyparsing
with:

    /usr/bin/python3: No module named pyparsing.__main__; 'pyparsing' is a package and cannot be directly executed

So instead use "python -c 'import <MODULE_NAME>".
Autoconf is already using that command (see m4/ax_python_module.m4).

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2021-10-28 16:46:38 +01:00
Frediano Ziglio
96dd787377 Find Python3 installation correctly on MacOS
This fixes partially https://gitlab.freedesktop.org/spice/spice-gtk/-/issues/144.
Meson requires Python3 so you should be able to detect python3.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2021-08-16 10:00:28 +01:00
Frediano Ziglio
de79bac8e9 build: Update Meson requirement to 0.49
This avoids this warning:

WARNING: Project targeting '>= 0.48.0' but tried to use feature introduced in '0.49.0': / with string arguments.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2021-06-14 06:58:44 +01:00
Frediano Ziglio
bac2aa4e2d codegen: Make input structures for marshaller constant
Add const specifier to passed structure.
Make code a bit more "safe" as compiler can check if code is
trying to change some passed data.
Also allows to declare data passed as constant.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2021-05-24 08:08:37 +01:00
Frediano Ziglio
18f753c52f meson: Generate missing intermediate target
Tell build system how to generate the intermediate file
generated_test_messages.h.
Otherwise if removed the build will then fail.
This is also probably the reason some build intermittently fail.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2021-05-18 15:01:31 +01:00
Frediano Ziglio
bb0831cc10 canvas_base: Fix missing ntohl for Win32 platform
Win32 requires winsock2.h to be included in order to use ntohl.
To avoid the include use GUINT32_FROM_BE instead, already available.

This problem was reported by Biswapriyo Nath whom also tested the
solution for Win32.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2021-05-07 19:42:38 +01:00
Frediano Ziglio
fcfe9104bd Fix make distcheck
We need to package generated_test_messages.h file

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2021-04-14 17:29:08 +01:00
Marc-André Lureau
c39f4fd002 Fix build as meson subproject
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2021-04-13 23:37:10 +04:00
Marc-André Lureau
91362d045a Fix invalid vdagent buffer access
The caller use the "size" argument in different ways. Either the size of
the data to convert, or the end boundary to be deduced by offset.

Fix it so the the "size" argument means the amount in bytes of data to
convert, that seems simpler and saner. (yay C)

Fixes: spice#53

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2021-04-13 21:30:38 +04:00
Stefan Weil
68188b0c21 Add missing include file string.h
It is required for strcmp. This fixes a compiler warning for mingw-w64.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Acked-by: Frediano Ziglio <freddy77@gmail.com>
2021-04-08 15:42:20 +01:00
Frediano Ziglio
c48140c493 helper-fuzzer-demarshallers: Check also test demarshallers
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2021-02-22 09:11:40 +00:00
Frediano Ziglio
6b662331f7 codegen: Handle zero_terminated attribute in demashaller
Make sure the output array is zero terminated to simplify
code using the output structures.

Changed in generated code:

    diff -ru gen/generated_client_demarshallers.c common/generated_client_demarshallers.c
    --- gen/generated_client_demarshallers.c	2021-02-21 15:13:42.004307087 +0000
    +++ common/generated_client_demarshallers.c	2021-02-21 15:13:58.916513426 +0000
    @@ -565,15 +565,24 @@
         return NULL;
     }

    -static uint8_t * parse_array_uint8(uint8_t *message_start, SPICE_GNUC_UNUSED uint8_t *message_end, uint8_t *struct_data, PointerInfo *this_ptr_info)
    +static uint8_t * parse_array_uint8_terminated(uint8_t *message_start, SPICE_GNUC_UNUSED uint8_t *message_end, uint8_t *struct_data, PointerInfo *this_ptr_info)
     {
         uint8_t *in = message_start + this_ptr_info->offset;
         uint8_t *end;

         end = struct_data;
         memcpy(end, in, this_ptr_info->nelements);
    +#if defined(__GNUC__)
    +#pragma GCC diagnostic push
    +#pragma GCC diagnostic ignored "-Wstringop-overflow"
    +#endif
    +    ((char *) (end))[this_ptr_info->nelements] = 0;
    +#if defined(__GNUC__)
    +#pragma GCC diagnostic pop
    +#endif
         in += this_ptr_info->nelements;
         end += this_ptr_info->nelements;
    +    end += 1;
         return end;
     }

    @@ -622,7 +631,8 @@
                 dst_info_host_data__array__nelements = host_size__value;

                 dst_info_host_data__array__nw_size = dst_info_host_data__array__nelements;
    -            dst_info_host_data__array__mem_size = sizeof(uint8_t) * dst_info_host_data__array__nelements;
    +            dst_info_host_data__array__mem_size = sizeof(uint8_t) * dst_info_host_data__array__nelements + sizeof(uint8_t);
    +            dst_info_host_data__array__mem_size = SPICE_ALIGN(dst_info_host_data__array__mem_size, 4);
                 if (SPICE_UNLIKELY(dst_info_host_data__array__nw_size > (uintptr_t) (message_end - message_start - host_data__value))) {
                     goto error;
                 }
    @@ -650,7 +660,8 @@
                 dst_info_cert_subject_data__array__nelements = cert_subject_size__value;

                 dst_info_cert_subject_data__array__nw_size = dst_info_cert_subject_data__array__nelements;
    -            dst_info_cert_subject_data__array__mem_size = sizeof(uint8_t) * dst_info_cert_subject_data__array__nelements;
    +            dst_info_cert_subject_data__array__mem_size = sizeof(uint8_t) * dst_info_cert_subject_data__array__nelements + sizeof(uint8_t);
    +            dst_info_cert_subject_data__array__mem_size = SPICE_ALIGN(dst_info_cert_subject_data__array__mem_size, 4);
                 if (SPICE_UNLIKELY(dst_info_cert_subject_data__array__nw_size > (uintptr_t) (message_end - message_start - cert_subject_data__value))) {
                     goto error;
                 }
    @@ -685,14 +696,14 @@
             out->dst_info.sport = consume_uint16(&in);
             out->dst_info.host_size = consume_uint32(&in);
             ptr_info[n_ptr].offset = consume_uint32(&in);
    -        ptr_info[n_ptr].parse = parse_array_uint8;
    +        ptr_info[n_ptr].parse = parse_array_uint8_terminated;
             ptr_info[n_ptr].dest = (void **)&out->dst_info.host_data;
             host_data__array__nelements = out->dst_info.host_size;
             ptr_info[n_ptr].nelements = host_data__array__nelements;
             n_ptr++;
             out->dst_info.cert_subject_size = consume_uint32(&in);
             ptr_info[n_ptr].offset = consume_uint32(&in);
    -        ptr_info[n_ptr].parse = parse_array_uint8;
    +        ptr_info[n_ptr].parse = parse_array_uint8_terminated;
             ptr_info[n_ptr].dest = (void **)&out->dst_info.cert_subject_data;
             cert_subject_data__array__nelements = out->dst_info.cert_subject_size;
             ptr_info[n_ptr].nelements = cert_subject_data__array__nelements;
    @@ -1050,7 +1061,8 @@
             host_data__array__nelements = host_size__value;

             host_data__array__nw_size = host_data__array__nelements;
    -        host_data__array__mem_size = sizeof(uint8_t) * host_data__array__nelements;
    +        host_data__array__mem_size = sizeof(uint8_t) * host_data__array__nelements + sizeof(uint8_t);
    +        host_data__array__mem_size = SPICE_ALIGN(host_data__array__mem_size, 4);
             if (SPICE_UNLIKELY(host_data__array__nw_size > (uintptr_t) (message_end - message_start - host_data__value))) {
                 goto error;
             }
    @@ -1078,7 +1090,8 @@
             cert_subject_data__array__nelements = cert_subject_size__value;

             cert_subject_data__array__nw_size = cert_subject_data__array__nelements;
    -        cert_subject_data__array__mem_size = sizeof(uint8_t) * cert_subject_data__array__nelements;
    +        cert_subject_data__array__mem_size = sizeof(uint8_t) * cert_subject_data__array__nelements + sizeof(uint8_t);
    +        cert_subject_data__array__mem_size = SPICE_ALIGN(cert_subject_data__array__mem_size, 4);
             if (SPICE_UNLIKELY(cert_subject_data__array__nw_size > (uintptr_t) (message_end - message_start - cert_subject_data__value))) {
                 goto error;
             }
    @@ -1107,13 +1120,13 @@
         out->sport = consume_uint16(&in);
         out->host_size = consume_uint32(&in);
         ptr_info[n_ptr].offset = consume_uint32(&in);
    -    ptr_info[n_ptr].parse = parse_array_uint8;
    +    ptr_info[n_ptr].parse = parse_array_uint8_terminated;
         ptr_info[n_ptr].dest = (void **)&out->host_data;
         ptr_info[n_ptr].nelements = host_data__array__nelements;
         n_ptr++;
         out->cert_subject_size = consume_uint32(&in);
         ptr_info[n_ptr].offset = consume_uint32(&in);
    -    ptr_info[n_ptr].parse = parse_array_uint8;
    +    ptr_info[n_ptr].parse = parse_array_uint8_terminated;
         ptr_info[n_ptr].dest = (void **)&out->cert_subject_data;
         ptr_info[n_ptr].nelements = cert_subject_data__array__nelements;
         n_ptr++;
    @@ -1338,7 +1351,8 @@
                 dst_info_host_data__array__nelements = host_size__value;

                 dst_info_host_data__array__nw_size = dst_info_host_data__array__nelements;
    -            dst_info_host_data__array__mem_size = sizeof(uint8_t) * dst_info_host_data__array__nelements;
    +            dst_info_host_data__array__mem_size = sizeof(uint8_t) * dst_info_host_data__array__nelements + sizeof(uint8_t);
    +            dst_info_host_data__array__mem_size = SPICE_ALIGN(dst_info_host_data__array__mem_size, 4);
                 if (SPICE_UNLIKELY(dst_info_host_data__array__nw_size > (uintptr_t) (message_end - message_start - host_data__value))) {
                     goto error;
                 }
    @@ -1366,7 +1380,8 @@
                 dst_info_cert_subject_data__array__nelements = cert_subject_size__value;

                 dst_info_cert_subject_data__array__nw_size = dst_info_cert_subject_data__array__nelements;
    -            dst_info_cert_subject_data__array__mem_size = sizeof(uint8_t) * dst_info_cert_subject_data__array__nelements;
    +            dst_info_cert_subject_data__array__mem_size = sizeof(uint8_t) * dst_info_cert_subject_data__array__nelements + sizeof(uint8_t);
    +            dst_info_cert_subject_data__array__mem_size = SPICE_ALIGN(dst_info_cert_subject_data__array__mem_size, 4);
                 if (SPICE_UNLIKELY(dst_info_cert_subject_data__array__nw_size > (uintptr_t) (message_end - message_start - cert_subject_data__value))) {
                     goto error;
                 }
    @@ -1401,14 +1416,14 @@
             out->dst_info.sport = consume_uint16(&in);
             out->dst_info.host_size = consume_uint32(&in);
             ptr_info[n_ptr].offset = consume_uint32(&in);
    -        ptr_info[n_ptr].parse = parse_array_uint8;
    +        ptr_info[n_ptr].parse = parse_array_uint8_terminated;
             ptr_info[n_ptr].dest = (void **)&out->dst_info.host_data;
             host_data__array__nelements = out->dst_info.host_size;
             ptr_info[n_ptr].nelements = host_data__array__nelements;
             n_ptr++;
             out->dst_info.cert_subject_size = consume_uint32(&in);
             ptr_info[n_ptr].offset = consume_uint32(&in);
    -        ptr_info[n_ptr].parse = parse_array_uint8;
    +        ptr_info[n_ptr].parse = parse_array_uint8_terminated;
             ptr_info[n_ptr].dest = (void **)&out->dst_info.cert_subject_data;
             cert_subject_data__array__nelements = out->dst_info.cert_subject_size;
             ptr_info[n_ptr].nelements = cert_subject_data__array__nelements;
    @@ -7582,7 +7597,8 @@
             name__array__nelements = name_size__value;

             name__array__nw_size = name__array__nelements;
    -        name__array__mem_size = sizeof(uint8_t) * name__array__nelements;
    +        name__array__mem_size = sizeof(uint8_t) * name__array__nelements + sizeof(uint8_t);
    +        name__array__mem_size = SPICE_ALIGN(name__array__mem_size, 4);
             if (SPICE_UNLIKELY(name__array__nw_size > (uintptr_t) (message_end - message_start - name__value))) {
                 goto error;
             }
    @@ -7609,7 +7625,7 @@

         out->name_size = consume_uint32(&in);
         ptr_info[n_ptr].offset = consume_uint32(&in);
    -    ptr_info[n_ptr].parse = parse_array_uint8;
    +    ptr_info[n_ptr].parse = parse_array_uint8_terminated;
         ptr_info[n_ptr].dest = (void **)&out->name;
         ptr_info[n_ptr].nelements = name__array__nelements;
         n_ptr++;

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2021-02-22 09:11:35 +00:00
Frediano Ziglio
bd15c96f54 codegen: Propagate zero_terminated attribute
Currently the attribute is not used.
However we would like to make sure when present that the array
is always zero terminated to simplify usages after demarshalling.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2021-02-22 09:11:33 +00:00
Frediano Ziglio
a627a14af0 codegen: Propagate attributes to element under pointers
Current propagated attributes are propagated only from member to
member type.
But for pointers you probably want to use propagated attribus to
underlying type (like an array for instance).

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2021-02-22 09:11:30 +00:00
Frediano Ziglio
6838f30079 codegen: Add a check to array type
If the size is not constant the array has to be allocated in some
way in the output and so there must be a specification for the
output (as default is write into the C structure all data).
The only exceptions are when the length is constant (in this case
a constant length array in the C structure is used) or a pointer
(in this case the pointer allocate the array).

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2021-02-22 09:11:28 +00:00
Frediano Ziglio
e49301ebd1 codegen: Make "output_attrs" variable global
Allows to reuse it.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2021-02-22 09:11:22 +00:00
Frediano Ziglio
d8fe0cbb84 codegen: Remove bytes array length support
This syntax was only used in protocol 1 which has been removed
time ago.
Beside not being used it's confusing and prone to errors,
array size is specified using 2 identifiers, one reporting
bytes and the other number of items, one used for marshalling,
the other for demarshalling.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2020-10-06 13:09:56 +01:00
Frediano Ziglio
d589542e04 test-quic: Add test cases for quic fuzzer
To use for start for the fuzzer.

Tests have been generated with a patch like:

	diff --git a/tests/test-quic.c b/tests/test-quic.c
	--- a/tests/test-quic.c
	+++ b/tests/test-quic.c
	@@ -372,8 +372,8 @@ static void pixbuf_compare(GdkPixbuf *pixbuf_a, GdkPixbuf *pixbuf_b)
	 static GdkPixbuf *pixbuf_new_random(int alpha)
	 {
	     gboolean has_alpha = alpha >= 0 ? alpha : g_random_boolean();
	-    gint width = g_random_int_range(100, 2000);
	-    gint height = g_random_int_range(100, 500);
	+    gint width = g_random_int_range(10, 100);
	+    gint height = g_random_int_range(10, 100);
	     GdkPixbuf *random_pixbuf;
	     guint i, size;
	     guint8 *pixels;
	@@ -401,6 +401,12 @@ static void test_pixbuf(GdkPixbuf *pixbuf)
	     compressed_data = quic_encode_from_pixbuf(pixbuf, imgbuf);

	     uncompressed_pixbuf = quic_decode_to_pixbuf(compressed_data);
	+    {
	+        static int num = 0;
	+        char fn[256];
	+        sprintf(fn, "test%d.quic", ++num);
	+        g_assert(g_file_set_contents(fn, (void *) compressed_data->data, compressed_data->len, NULL));
	+    }
	     image_buf_free(imgbuf, uncompressed_pixbuf);

	     //g_assert(memcmp(gdk_pixbuf_get_pixels(pixbuf), gdk_pixbuf_get_pixels(uncompressed_pixbuf), gdk_pixbuf_get_byte_length(uncompressed_pixbuf)));

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Uri Lublin <uril@redhat.com>
2020-09-17 06:46:57 +01:00
Frediano Ziglio
3b81e67979 test-quic: Add fuzzer capabilities to the test
Allows it to be used for fuzzying compressed images.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Uri Lublin <uril@redhat.com>
2020-09-17 06:46:57 +01:00
Frediano Ziglio
b24fe6b66b quic: Avoid possible buffer overflow in find_bucket
Proved by fuzzing the code.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Uri Lublin <uril@redhat.com>
2020-09-17 06:46:57 +01:00
Frediano Ziglio
ef1b6ff7b8 quic: Check RLE lengths
Avoid buffer overflows decoding images. On compression we compute
lengths till end of line so it won't cause regressions.
Proved by fuzzing the code.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Uri Lublin <uril@redhat.com>
2020-09-17 06:46:57 +01:00
Frediano Ziglio
404d74782c quic: Check image size in quic_decode_begin
Avoid some overflow in code due to images too big or
negative numbers.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Uri Lublin <uril@redhat.com>
2020-09-17 06:46:57 +01:00
Frediano Ziglio
762e0abae3 quic: Check we have some data to start decoding quic image
All paths already pass some data to quic_decode_begin but for the
test check it, it's not that expensive test.
Checking for not 0 is enough, all other words will potentially be
read calling more_io_words but we need one to avoid a potential
initial buffer overflow or deferencing an invalid pointer.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Uri Lublin <uril@redhat.com>
2020-09-17 06:46:57 +01:00
Marc-André Lureau
fa0c199d33 agent: fix vdagent monitor flag filtering
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-09-17 06:46:26 +01:00
Frediano Ziglio
0d7d0d35d8 agent: Extend agent_check_message to support VDAgentMonitorsConfig extension
Add support for VD_AGENT_CONFIG_MONITORS_FLAG_PHYSICAL_SIZE flag.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Marc-André Lureau <marcandre.lureau@gmail.com>
2020-09-15 11:55:45 +01:00
Frediano Ziglio
b03c894c21 quic: Fix typo in comment
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2020-09-04 21:05:48 +01:00
Frediano Ziglio
03bde6fdb2 quic: Constify a parameter
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2020-08-31 12:36:15 +01:00
Frediano Ziglio
243c314b3f proto: Add support for side mouse buttons
This is the couterpart of spice-protocol commit

    commit cbe7b2c28543f4c5e57d1db1b753b73a64104162 (HEAD -> master, origin/master, origin/HEAD)
    Author: SimonP <simonp.git@gmail.com>

        protocol: Add support for side mouse buttons

        Side mouse buttons currently do not exist in the protocol, causing them
        to be inexplicably ignored by VMs in virt-manager and such. This lays
        the groundwork for fixing that issue.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Kevin Pouget <kpouget@redhat.com>
2020-08-31 12:33:11 +01:00
Frediano Ziglio
c39cc1b1ef ssl_verify: Do not check IP if we fail to resolve it
There's no point on checking an empty IP address, an IP
address is never empty.
This also solve some compiler warnings trying to possibly
pass a NULL pointer to memcmp or setting a variable without
reading it.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Uri Lublin <uril@redhat.com>
2020-08-27 18:50:01 +01:00
Frediano Ziglio
7daee890be quic_tmpl: Remove unused bpc parameter
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Uri Lublin <uril@redhat.com>
2020-08-25 12:26:20 +01:00
Frediano Ziglio
2f045752d5 helper-fuzzer-demarshallers: Provide replacement for ftello for MSVC
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Uri Lublin <uril@redhat.com>
2020-08-10 09:55:31 +01:00
Frediano Ziglio
b843d02a1b Avoid usage of GCC extension for __VA_ARGS__ where possible
The "##" before __VA_ARGS__ is a GCC extension.
Try to limit its usage where necessary.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Uri Lublin <uril@redhat.com>
2020-08-10 09:55:27 +01:00
Frediano Ziglio
ca1016eb15 backtrace: Do not attempt to compile if spice_backtrace is empty
In backtrace.h spice_backtrace is defined as:

  #if defined(WIN32) && !defined(__MINGW32__)
  #define spice_backtrace()
  #else
  ..

so don't try to compile if an empty macro is used.
Currently not causing any issue as we use MingW on Windows but
does not hurt is code is more portable.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Uri Lublin <uril@redhat.com>
2020-08-10 09:55:10 +01:00
Haochen Tong
8e0e13881e marshal: fix clang "missing field initializer" warning on generated files
Signed-off-by: Haochen Tong <i@hexchain.org>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-07-11 08:17:20 +01:00
Haochen Tong
bca74fb6c9 pixman_utils: fix clang "unused functions" warning
Signed-off-by: Haochen Tong <i@hexchain.org>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-07-11 08:17:18 +01:00
Frediano Ziglio
35be203f42 snd_codec: Use better type for snd_codec_create mode
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Julien Ropé <jrope@gmail.com>
2020-07-07 13:09:38 +01:00
Frediano Ziglio
283d82b0a3 snd_codec: Use better type for function result
Instead of just plain preprocessor macros use an enum.
This is more type safe and could produce better debugging
type information.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Julien Ropé <jrope@gmail.com>
2020-07-07 13:09:36 +01:00