Commit Graph

4127 Commits

Author SHA1 Message Date
Thiago Mendes
ddb2795b65 Converting Spice_protocol.odt to Asciidoc
https://gitlab.freedesktop.org/spice/spice-server/issues/10

Acked-by: Frediano Ziglio <fziglio@redhat.com>
2019-05-31 15:01:54 +01:00
Thiago Mendes
b052fb73b6 Converting Vd_interfaces.odt to Asciidoc
https://gitlab.freedesktop.org/spice/spice-server/issues/10

Acked-by: Frediano Ziglio <fziglio@redhat.com>
2019-05-31 15:01:37 +01:00
Frediano Ziglio
70f75c0f33 syntax-check: Add missing contributors names to AUTHORS
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2019-05-31 05:58:58 +01:00
worldofpeace
b4a6c1abcc meson: correct some things
We can get source_root from meson, and doing [3]
can give you an out of bounds error in certain cases.

Acked-by: Frediano Ziglio <fziglio@redhat.com>
2019-05-29 13:14:24 +01:00
Frediano Ziglio
5ee2af0fe5 docs: Remove obsolete paragraph
ClientCbs were removed, all is automated in RedChannel.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2019-05-29 10:23:40 +01:00
Frediano Ziglio
c52b88c895 docs: Add some notes on event scheduling and threading
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2019-05-29 10:23:35 +01:00
Francois Gouget
3d7f1cc512 mjpeg: Pull more code in get_min_required_playback_delay()
This reduces code duplication and passing the MJpegEncoder object
makes it possible to modify the playback calculation without adding
more arguments.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2019-05-21 09:05:50 +01:00
Francois Gouget
7515a0ac57 mjpeg: Constify some MJpegEncoder* parameters
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2019-05-21 09:05:47 +01:00
Francois Gouget
a8faddf653 gstreamer-encoder: Constify some SpiceGstEncoder* parameters
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2019-05-21 08:51:53 +01:00
Francois Gouget
ba4bcd5174 gstreamer-encoder: Return the average frame size as a 32 bit int
It makes no sense to expect average frame sizes anywhere close to 2GB.
But then make sure to avoid arithmetic overflows.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2019-05-21 08:48:49 +01:00
Francois Gouget
cfe98800a0 gstreamer-encoder: Show the source fps when the system is too slow
The source framerate is as important as the resolution when trying to
understand if the system should be fast enough to encode the video
stream in real time.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2019-05-21 08:46:27 +01:00
Frediano Ziglio
148203a5d2 spice-experimental: Remove obsolete file
This header was removed in 2014 (3c6b4e415) as deprecated and added again
in 2015 (2e88eb705) as causing some issue with former Qemu versions.
After 4 years remove again, now there should not be any usage of it.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Snir Sheriber <ssheribe@redhat.com>
2019-05-20 10:11:41 +01:00
Francois Gouget
5ee001a5b0 gstreamer-encoder: Include encoding time in get_min_playback_delay()
This way all the minimum delay calculation is in one place and this
makes gstreamer's implementation closer to the mjpeg one.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2019-05-16 08:26:18 +01:00
Francois Gouget
a9c5bb974a mjpeg: Remove the unused MJPEG_LOW_FPS_RATE_TH constant
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2019-05-16 08:23:05 +01:00
Francois Gouget
d09c9b43e0 reds: Enable mm_time adjustments on startup
This reinstates the reds_enable_mm_time() call in do_spice_init()
that was removed by commit c541d7e29d.

We send mm_time adjustments to the client whenever there is no audio
playback. There is no audio playback on startup. Therefore
mm_time_enabled must be true on startup. QED.

This fixes adjusting the client mm_time whenever playing a silent
video (or full desktop stream) when no sound has been played before
such as when using Xspice, booting an OS with no startup or login
jingle, or possibly when migrating a VM (per commit 1c154ea5ec).

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2019-05-16 08:23:00 +01:00
Frediano Ziglio
07adcce16e dcc: Avoid usage of not aligned GlzEncDictRestoreData structure
Copy to/from unaligned field to avoid potential unaligned access.
Although it adds a copy it's not in a hot path (migration) and
the structure is pretty small.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Uri Lublin <uril@redhat.com>
2019-05-13 14:15:19 +01:00
Frediano Ziglio
753ebc0e7c test-display-base: Use SPICE_CONTAINEROF to avoid alignment warning
This change prevent a warning issued by GCC 9 and potentially
other compilers.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Uri Lublin <uril@redhat.com>
2019-05-13 14:13:21 +01:00
Frediano Ziglio
47ad2179f0 build: Fix M4 macros quoting
The PKG_CHECK_MODULES macro were not expanded correctly causing
the gio-unix module not to be detected and these warnings:

../configure: line 15133: GIO_UNIX_CFLAGS: command not found
../configure: line 15134: C: command not found
../configure: line 15135: GIO_UNIX_LIBS: command not found
../configure: line 15136: linker: command not found

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2019-05-08 08:28:55 +01:00
Snir Sheriber
c3fb5596c6 Remove -Wchkp warning, deprecated in GCC 9
Signed-off-by: Snir Sheriber <ssheribe@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2019-05-07 13:00:00 +01:00
Frediano Ziglio
d5041a5039 ci: Add test for Windows using MingW
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2019-05-07 10:14:38 +01:00
Frediano Ziglio
80fb39eedd Add some notes for the Windows port
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2019-05-07 10:14:35 +01:00
Frediano Ziglio
d417a0bdfd Disable recording filtering for Windows
Although this feature can be ported to Windows doing so would
require the usage of g_spawn_async_with_fds, which is only available
in GLib 2.58 or some specific Win32 code.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2019-05-07 10:14:33 +01:00
Frediano Ziglio
9a07eb6582 red-stream: Fix SSL connection for Windows
Set correctly errno to make callers handle correctly encrypted
traffic.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2019-05-07 10:14:31 +01:00
Frediano Ziglio
fd90a9d084 tests: Exclude tests that cannot work on Windows
test-stream test is passing file descriptor using Unix socket.
test-stat-file needs some porting work of mmap feature.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2019-05-07 10:14:28 +01:00
Frediano Ziglio
d0ae7f157d dispatcher: Port to Windows
Replace poll call with select.
As socket is set to non-blocking we must support it so if
we detect an EAGAIN error wait for data.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2019-05-07 10:14:26 +01:00
Frediano Ziglio
524acca643 windows: Disable code not working on Windows
- global signals;
- CLOEXEC flag;
- mmap and statistics;
- IPTOS_LOWDELAY flag;
- Unix sockets;
- sharing file descriptors through Unix sockets;
- TCP_CORK flag.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2019-05-07 10:14:22 +01:00
Frediano Ziglio
c8ab3c2c98 test-channel: Use socket compatibility layer
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2019-05-07 10:14:20 +01:00
Frediano Ziglio
5ab0667eff test-leaks: Use socket compatibility layer
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2019-05-07 10:14:18 +01:00
Frediano Ziglio
3a95e77af2 dispatcher: Use socket compatibility layer
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2019-05-07 10:14:16 +01:00
Frediano Ziglio
5c65107663 red-stream: Use socket compatibility layer
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2019-05-07 10:14:14 +01:00
Frediano Ziglio
14d4cdebc3 reds: Use socket compatibility layer (close -> socket_close)
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2019-05-07 10:14:12 +01:00
Frediano Ziglio
026fab1825 net-utils: Port to Windows
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2019-05-07 10:14:08 +01:00
Frediano Ziglio
0c59394b24 sys-socket: Add socket_newpair utility
Allows to easier port socketpair.
Windows does not have this function, we need to create a pair
using 2 internet sockets and connecting one to the other.
The SPICE core interface implementation provided by Qemu under
Windows requires, under Windows, to provide SOCKET handles
so pipes or other Windows handles won't work.
Windows does not provide a socketpair function so use this
replacement.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2019-05-07 10:14:05 +01:00
Frediano Ziglio
55dd7410b0 sys-socket: Introduce some utility to make sockets more portable
Between Unix and Windows socket are quite different:
- on Windows sockets have a different namespace from C file
  descriptors so you can't use read/write/close or similar functions;
- errors are not stored in errno but you must be read/write the
  errors with specific function;
- sometimes sockets are put in non-blocking mode automatically
  calling some functions;
- SOCKET type is 64 bit on Windows 64 which does not fit technically
  in an int. Is however safe to assume them to fit in an int.

So encapsulate the socket APIs in some definition to make easier
and more safe to deal with them.
Where the portability to Windows would make to code more offuscated a Unix
style was preferred. For instance if errors are detected errno is set from
Windows socket error instead of changing all code handling.
Fortunately on Windows Qemu core interface accepts socket (but not
other types like C file descriptors!).

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2019-05-07 10:14:00 +01:00
Frediano Ziglio
8031558ee3 tests: Provide alarm replacement for Windows
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2019-05-07 10:13:58 +01:00
Frediano Ziglio
50be664da2 windows: Do not use conflicting preprocessor macros
"interface" and "MAX_MONITORS" are defined in some Windows system
headers causing garbage code to be fed to the compiler.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2019-05-07 10:13:56 +01:00
Frediano Ziglio
992226d6f2 Avoids %m in formatting for Windows
Not supported, %m is a GNU extension of sscanf.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2019-05-07 10:13:53 +01:00
Frediano Ziglio
0643d67557 build: Detect Windows build and change some definitions
Windows needs some specific setting to use network.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2019-05-07 10:13:48 +01:00
Uri Lublin
0c4c3a6916 gitlab-ci: build out-of-tree too
One test is enough -- do it in makecheck.

Must git clean first any previous builds.

Signed-off-by: Uri Lublin <uril@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2019-05-01 19:38:09 +01:00
Frediano Ziglio
ed68d491fd Do not check for HAVE_CONFIG_H
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>
2019-04-30 09:26:55 +01:00
Frediano Ziglio
0dcb859c92 syntax-check: Remove exclude rules of now compliant code
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2019-04-30 09:25:28 +01:00
Frediano Ziglio
7cbd70b931 build: Prepare for 0.14.2 release
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2019-04-30 09:05:07 +01:00
Benjamin Tissoires
ff9c8d4908 inputs-channel: Attempt to have a reliable led state
We can not consider the qemu led state to be reliable. It by default has
50ms of delay, so if we want to achieve something reliable, this won't do.

We need to keep our own internal state, and consider it as reliable.
We update it immediately after receiving the key presses, meaning that this
is now the future state of the guest.

When we receive a keymap event, we check against this 'ideal' state and
only update the guest if we 'counted' that it won't have the correct state.

When the guest notifies its change, the modifiers_watch is supposed to
fix any wrong state.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2019-04-30 09:05:07 +01:00
Frediano Ziglio
9ff2997a05 Update spice-protocol version
We require version after 0.12.15 which was released as 0.14.0.
Check against a valid released instead of checking for a non existing one.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2019-04-26 11:45:12 +01:00
Frediano Ziglio
2ac16c1635 meson: Bump libcacard requirement to 2.5.1
This had already been done for Meson in commit
afb2ec312b.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2019-04-26 11:45:04 +01:00
Francois Gouget
5efc8fc8ad video-stream: use the dcc local variable
In update_client_playback_delay()

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2019-04-11 09:51:40 +00:00
Frediano Ziglio
39654c03a0 Fix meson build importing spice-common fix
This brings in the following changes:

Eduardo Lima (Etrunko) (1):
      meson: Make targets list store dictionaries instead of lists

Frediano Ziglio (2):
      meson: Fix dependency of generated files
      meson: Do not build generated files twice

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2019-04-05 17:12:37 +01:00
Frediano Ziglio
2eeacd1e0d Update spice-common submodule
This brings in the following changes:

Christophe Fergeau (8):
      canvas_base: Fix variable shadowing warning
      backtrace: Add missing include
      lz: Don't try to print uninitialized variable
      build: Add missing G_GNUC_PRINTF annotations
      build: Update verify.h to latest version
      test-marshallers: Fix header guard
      quic: Fix QUIC_VERSION definition
      log: Let gcc know about the logging macros which abort

Frediano Ziglio (13):
      codegen: Rename --prefix parameter to --suffix
      ci: Remove dependencies from copr build
      build: Remove snd_codec.h from EXTRA_DIST
      test-ssl-verify: Improve subject_to_x509_name coverage
      meson: Remove some useless checks
      codegen: Factor out a function to write output file
      codegen: Generate headers while generating code
      codegen: Allows to generate C declarations automatically
      Allow to generate C declarations for spice.proto
      Generate automatically most C message declarations
      recorder: Update
      build: Add new check for recorder library
      proto: Fix typo in message name

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2019-04-03 10:38:13 +01:00
Frediano Ziglio
20daba6bc3 red-worker: Remove unused definitions
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2019-03-29 15:18:49 +00:00
Frediano Ziglio
e8fb0957ef red-worker: Use bool for driver_cap_monitors_config
Easier to understand.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2019-03-29 15:18:47 +00:00