Commit Graph

4380 Commits

Author SHA1 Message Date
Frediano Ziglio
fff6e7da69 smartcard: Avoid useless cast
We just created the object, we know is a RedCharDeviceSmartcard,
avoid to cast the pointer using RED_CHAR_DEVICE_SMARTCARD.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2020-03-12 18:57:54 +00:00
Frediano Ziglio
a59cfc0cc3 build: Use warning_level option for Meson
warning_level 2 setting for Meson add the same "-Wall -Wextra"
options to GCC compiler.
This removes a warning using Meson.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2020-03-12 18:57:11 +00:00
Frediano Ziglio
ac38d4bbf9 build: By default use debugoptimized build type for Meson
Usually the default options for C are "-O2 -g".
So this build type is more conservative.
Normal users wanting to build the package won't find themselves
with a bad performance executable.
This will catch some potentially warning not detected with
debug build.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2020-03-12 18:57:08 +00:00
Frediano Ziglio
7a4ca27f98 build: Cleanup old comment
In Meson better to use --werror option instead to manually add to
options

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2020-03-12 18:57:02 +00:00
Frediano Ziglio
892639a696 inputs-channel: Remove unused macros
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Francesco Giudici <fgiudici@redhat.com>
2020-03-09 13:32:46 +00:00
Frediano Ziglio
1a91da8689 migrate.py: By default try to search system qemu executable
Do not look to "../../qemu/x86_64-softmmu/qemu-system-x86_64",
this will be searched with which if no found, just use the name.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2020-03-09 12:28:45 +00:00
Frediano Ziglio
768360018a migrate.py: Use python3 as executable interpreter
The script was updated to use Python 3 syntax.
Although you can launch with "python3 ./tests/migrate.py ..."
better to also update the script source to make it
executable directly.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2020-03-09 12:28:39 +00:00
Frediano Ziglio
2c2e5bd531 spice_protocol: Minor updates
Update many "red" prefixes.
Add some capabilities for audio.
Update some structure names.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Francesco Giudici <fgiudici@redhat.com>
2020-03-05 10:52:23 +00:00
Victor Toso
84f257e263 migrate.py: add seamless migration option
Now we always add seamless-migration option to qemu command line and
disabled (off) by default although seamless migration is supported for
over 7 years already!

Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Kevin Pouget <kpouget@redhat.com>
2020-03-04 16:09:49 +00:00
Victor Toso
81d28cac55 migrate.py: cosmetic changes
Make one argument per line;
Indent with arguments;

Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Kevin Pouget <kpouget@redhat.com>
2020-03-04 16:09:46 +00:00
Victor Toso
4882e01370 migrate.py: add option for hostname change
This is used in the migrate message and being able to tweak it allows
clients from different machines to test this local migration test.

Example of usage:
    ./migrate.py --hostname 192.168.122.1 --wait-user-connect

In a VM with access to 192.168.122.1:
    remote-viewer spice://192.168.122.1:5911

Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Kevin Pouget <kpouget@redhat.com>
2020-03-04 16:09:44 +00:00
Victor Toso
49e3e7a6d4 migrate.py: style, break line of qmp's command
Preparatory patch for adding support to change hostname.

Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Kevin Pouget <kpouget@redhat.com>
2020-03-04 16:09:41 +00:00
Victor Toso
632cfa1c3d migrate.py: cosmetic changes on start_qemu()
This function can be tweak quite a bit due all possibilities around
QEMU configuration. This patch removes incoming_args and extra_args
and move their values to the right place in the function.

I'm also applying a more extensive coding style for parameters, so
when we need to do changes it should happen with fewer lines.

While at it, change to string interpolation from 3.6+, suggested by
Kevin Pouget.

Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Kevin Pouget <kpouget@redhat.com>
2020-03-04 16:09:39 +00:00
Victor Toso
57af035749 migrate.py: simplify wait_active()
We are only interested in the running state of qmp (or VCPUS) here
which is what we check. Moving this check to the try branch allows
removing some extra checks.

Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Kevin Pouget <kpouget@redhat.com>
2020-03-04 16:09:37 +00:00
Victor Toso
f75236bf42 migrate.py: migrate count starts with 1
As this is not some index but a counter. The first print happens after
first migration was done, meaning 1 instead of 0

Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Kevin Pouget <kpouget@redhat.com>
2020-03-04 16:09:33 +00:00
Victor Toso
b124ebe53e migrate.py: fix events race
Currently, when we run migrate.py with --client option we get stuck
waiting for SPICE_CONNECTED event on target qmp (while receiving only
QMP). Problem is, only after event SPICE_INITIALIZED in the source qmp
is that the client will be able to do migration (to properly exchange
spice messages).

So, it is a must that if we have a test where a client is connected,
to wait for SPICE_INITIALIZED event in the source qmp.

To clarify, this patches fixes the following test:

    ./migrate.py --client spicy

Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Kevin Pouget <kpouget@redhat.com>
2020-03-04 16:09:27 +00:00
Frediano Ziglio
b8c1926608 red-common: Remove ring.h inclusion
These structures are not used that extensively, do not include
in the common header.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2020-03-04 13:53:32 +00:00
Frediano Ziglio
d1023dc09e red-channel: Remove unneeded ring.h include
Not used in the header.
Also we reduced a lot the usage of these structures.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2020-03-04 13:53:30 +00:00
Frediano Ziglio
143c5b290f red-channel: Update some comment and function
red_channel_client_destroy is not called anymore from RedClient and
should not so update the comments.
red_channel_client_destroy, compared to other XXX_destroy functions
did not unreference the object but was just disconnecting the
client channel so use red_channel_client_disconnect instead.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2020-03-04 13:53:27 +00:00
Frediano Ziglio
f5aaed38c6 red-client: Do not call red_channel_client_destroy
The object is already destroyed calling red_channel_disconnect_client.
The difference is that red_channel_disconnect_client does it in
the right thread while red_channel_client_destroy here attempts to
do potentially from another thread. This however at this stage
(after already being disconnected) is not an issue, just redundant
and potentially unsafe if red_channel_client_destroy change in
a way to have issue with multiple threads.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2020-03-04 13:53:25 +00:00
Frediano Ziglio
5f63e54326 red-channel-client: Remove only set "destroying" field
The field is only set and never checked.
Cascading cleaning up red_channel_client_set_destroying.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2020-03-04 13:53:23 +00:00
Frediano Ziglio
b11bb5d7f6 red-channel-client: Remove unused red_channel_client_is_destroying
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2020-03-04 13:53:20 +00:00
Frediano Ziglio
53c989a686 spicevmc: Do not call destroy while disconnecting
"RedChannelClient::on_disconnect", which for SpiceVMC is bound to
"spicevmc_red_channel_client_on_disconnect", is called while the
RedChannel object is disconnecting. More precisely is called after
the object has been removed from RedChannel causing
"red_channel_client_is_connected" to be false.
Calling "red_channel_client_destroy" this will lead
to a no-op as function will set "destroying" and call
"red_channel_client_disconnect" which will just exit finding
"red_channel_client_is_connected" false.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2020-03-04 13:52:53 +00:00
Frediano Ziglio
c5127b9d0e common-graphics-channel: Use sizeof instead of size constant
Minimal style change.
Allows to easier change the size of the buffer.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Francesco Giudici <fgiudici@redhat.com>
2020-03-04 09:06:17 +00:00
Frediano Ziglio
7230ff3d47 inputs-channel-client: Use sizeof instead of size constant
Minimal style change.
Allows to easier change the size of the buffer.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Francesco Giudici <fgiudici@redhat.com>
2020-03-04 09:04:03 +00:00
Frediano Ziglio
1bf9d22cf2 Support abstract Unix sockets
Allows to specify abstract Unix sockets addresses.
These Unix sockets are supported on Linux and allows to not
have file system names.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Kevin Pouget <kpouget@redhat.com>
2020-03-03 16:18:01 +00:00
Frediano Ziglio
a6ccd2a309 main-channel-client: Set state before sending ping messages
It is not guaranteed that all the messages will be sent on a single
push call, unless this is done very early.
Although currently this function is called very early remove
this hidden assumption in the code.
"ping_id" is just incremented every time a message is sent to
client (in "main_channel_marshall_ping") so the formulae
"mcc->priv->ping_id - 2" was there to get the id of two messages
ago (the first message queued in this function) assuming all
messages were pushed at the time the formulae is used.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Snir Sheriber <ssheribe@redhat.com>
2020-03-03 09:26:34 +00:00
Frediano Ziglio
b934b828df Remove "migration-flags" setting to 0
0 is the default value, no need to set explicitly.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2020-03-03 08:50:24 +01:00
Frediano Ziglio
594c2feffa Remove "handle-acks" setting to FALSE
FALSE is the default value, no need to set explicitly.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2020-03-03 08:50:20 +01:00
Frediano Ziglio
673fbd7147 cursor-channel: Remove unused pipe_item argument from red_marshall_cursor_init
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2020-03-03 08:28:56 +01:00
Frediano Ziglio
0f1a606d30 Reuse new spice_extra_assert macro
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2020-03-03 08:19:00 +01:00
Frediano Ziglio
4924cf210e reds: Remove only assigned "reds" field
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2020-03-02 14:24:14 +00:00
Frediano Ziglio
626ad248f5 build: Update spice-common integration
Use new common.m4 include file to make easier to integrate
with spice-common repository.
The new include will allow for instance spice-common to
add additional dependencies without changes (or minor) to
spice-server.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Kevin Pouget <kpouget@redhat.com>
2020-03-02 14:04:06 +00:00
Frediano Ziglio
a7f25ca5a8 Update spice-common submodule
This brings in the following changes:

Eduardo Lima (Etrunko) (1):
      build: Unconditionally link with libm if found

Frediano Ziglio (23):
      quic: Remove unused include header
      quic: Use G_UNLIKELY in some hot paths
      quic: Do not include quic_config.h in quic.h
      snd_codec: Avoid some useless casts declaring struct type
      snd_codec: Do not include not needed headers
      build: Clean up some configure checks
      test-quic: Convert image to get more testing (gray, rgb16)
      log: Add spice_extra_assert
      Reuse new spice_extra_assert macro
      marshallers: Avoid some useless pointers in SpiceMarshallerData
      lz_decompress: Constify some variable
      lz_decompress: Do not execute nested checks
      lz_decompress: Simplify loop
      lz_decompress: Reindented comment
      lz_decompress: Move variable declaration in nested scope
      lz_decompress: Read "ctrl" inside loop
      lz_compress: Cleanup unused macros
      codegen: Check unsafe values alone
      snd_codec: Update field names in function documentation
      test-quic: Avoid namespace conflict with Gdk API
      test-quic: Cache gdk_pixbuf_get_byte_length value
      test-quic: Reduce height of test image
      test-quic: Run 1 random quic test per color mode

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2020-03-02 14:02:21 +00:00
Frediano Ziglio
0fcb6fa4d2 main-channel-client: Remove useless check
main_channel_client_push_ping is never called with mcc NULL.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Snir Sheriber <ssheribe@redhat.com>
2020-03-02 07:46:25 +00:00
Frediano Ziglio
99bdb4bddd main-channel-client: Remove unused result from main_channel_client_push_ping
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Snir Sheriber <ssheribe@redhat.com>
2020-03-02 07:46:25 +00:00
Frediano Ziglio
0bb564fdca video-stream: Make video_stream*_unref static
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Snir Sheriber <ssheribe@redhat.com>
2020-03-02 07:30:23 +00:00
Frediano Ziglio
68c514e1fa reds: Free RedLinkInfo once in reds_handle_link
Instead of freeing it in both reds_handle_main_link and
reds_handle_other_links free it in reds_handle_link.
This will reduce the chances code is changed adding a leak in some paths.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Julien Rope <jrope@redhat.com>
2020-02-29 09:25:25 +00:00
Frediano Ziglio
f338b5bec9 reds: Reuse reds_link_free to free link message
Instead of freeing manually the field and then detaching from
the structure just detach only if retained.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2020-02-29 09:09:51 +00:00
Frediano Ziglio
2e1da8486d display-channel: Make display_channel_update_compression static
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2020-02-28 13:19:02 +00:00
Frediano Ziglio
6bba711386 Add some notes on how to do the release
Just to not forget some steps

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2020-02-28 13:18:23 +00:00
Frediano Ziglio
7f7af5d426 build: Prepare for 0.14.3 release
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2020-02-27 11:22:44 +00:00
Frediano Ziglio
c989769211 Do not generate ChangeLog file
People can read change logs from git log instead, version is enough.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2020-02-27 11:22:40 +00:00
Frediano Ziglio
533cf98e33 CHANGELOG: Use markdown
We will prefer CHANGELOG over NEWS just as matter of Gitlab's.
Followup patch will move NEWS content to CHANGELOG.

This patch renames NEWS -> CHANGELOG.md.
The change in configure.ac is necessary as GNU style requires
a NEWS file to be present.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2020-02-27 11:22:01 +00:00
Frediano Ziglio
4c589e01fb Use local variable to compute gradual score
Due to aliasing using pointers lead to some sub-optimization.
Use local variable and then write them to output to improve performances.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Julien Rope <jrope@redhat.com>
2020-02-27 07:55:43 +00:00
Victor Toso
9e29b72461 red-channel: no need to call g_type_init()
Since 03d46e9e "build-sys: Raise glib requirement to 2.38" in
2019-02-05

Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-02-26 13:01:51 +00:00
Victor Toso
0b1a87a6d0 Remove unused code since glib bump to 2.38
g_assert_null, g_assert_true and g_assert_false are all defined in
GLib 2.38

Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-02-26 13:01:48 +00:00
Victor Toso
e7a2a86779 tests: remove test-glib-compat.c
Basically not run since 03d46e9e "build-sys: Raise glib requirement to
2.38" in 2019-02-05

Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-02-26 13:01:46 +00:00
Victor Toso
7848ee3faf Remove glib-compat.h
Not used since 03d46e9e "build-sys: Raise glib requirement to 2.38" in
2019-02-05

Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-02-26 13:01:43 +00:00
Frediano Ziglio
b939e70d9c red-record-qxl: Write record file in the same format under Windows
The record file uses fprintf to record commands and attributes.
On Windows line terminator uses ASCII format ("\r\n") while on
Linux it used UNIX format ("\n"). Open file as binary to use the
same line terminator on both systems.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Francesco Giudici <fgiudici@redhat.com>
2020-02-26 12:50:27 +00:00