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>
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>
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>
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>
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>
"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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Instead, create a new image with backing-file of the original image
(a "permanent" snapshot), use it during the test and remove it at the end.
Also use 'writeback' cache instead of 'unsafe'.
Signed-off-by: Uri Lublin <uril@redhat.com>
squash: actually remove the snapshot. mention cache change
There is no raw_input() in python3 -- define it as input()
Use decode() when writing subprocess output to the log, to make
sure the argument for write is a string (in python3
stdout.read() returns bytes).
There is no has_key in python3 -- use "in" instead
Signed-off-by: Uri Lublin <uril@redhat.com>
Channel client creation can fail in some situation.
For instance if during a migration the client is disconnected.
In most cases this is ignored (this is usually logged in
red_channel_client_initable_init) but not in case of
CursorChannelClient and StreamChannelClient.
This fixes rhbz#1788757.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Julien Rope <jrope@redhat.com>
red_channel_client_shutdown remove the watch and shutdown the
socket. Reuse in red_channel_client_disconnect.
Calling shutdown will close the connection earlier.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>