Commit Graph

1269 Commits

Author SHA1 Message Date
Alon Levy
7e3fb815cc server/tests/basic_event_loop: print something on channel_event 2012-02-15 15:09:13 +02:00
Alon Levy
5ec8515508 server, separate SpiceChannelEventInfo from RedStream
fixes rhbz 790749 use after free of SpiceChannelEventInfo.

The lifetime of the SpiceChannelEventInfo was that of RedsStream, but it
is used by main_dispatcher_handle_channel_event after the RedsStream is
freed for the cursor and display channels. Making SCEI allocation be at
RedsStream allocation, and deallocation after the DESTROY event is
processed by core->channel_event, fixes use after free.
2012-02-15 15:04:04 +02:00
Alon Levy
bdd3bf8777 README: make a note of SPICE_DEBUG_ALLOW_MC 2012-02-15 14:32:11 +02:00
Dan McGee
3f303d6014 Remove all usages of bzero()
As recommended by modern C practice, we should just be using memset().

Signed-off-by: Dan McGee <dpmcgee@gmail.com>
2012-02-14 18:19:43 +02:00
Dan McGee
08c514ee85 Remove extra '\n' from red_printf() calls
red_printf() takes care of adding a newline to all messages; remove the
extra newline from all messages and macros that were doubling them up.

Signed-off-by: Dan McGee <dpmcgee@gmail.com>
2012-02-14 18:19:29 +02:00
Alon Levy
e4a92b177a server/tests: use getopt_long 2012-02-14 17:30:50 +02:00
Fabiano Fidêncio
33bd5d2797 Adding image to be used as "correct" in regression tests 2012-02-14 14:53:47 +02:00
Fabiano Fidêncio
1e8e2f9ee0 Adding support to automated tests
As suggested by Alon, a simple automated test to try to find
    regressions in Spice code.
    To use this, compile Spice with --enable-automated-tests and
    run test_display_streaming passing --automated-tests as parameter.
2012-02-14 14:53:44 +02:00
Dan McGee
aebe837d3a Add casts for compatibility purposes
Some non-Linux platforms return a (caddr_t *) result for the return
value of mmap(), which is very unfortunate. Add a (void *) cast to
explicitly avoid the warning when compiling with -Werror.

For the IO vector related stuff, signed vs. unsigned comes into play so
adding a (void *) cast here is technically correct for all platforms.

Signed-off-by: Dan McGee <dpmcgee@gmail.com>
2012-02-14 10:44:49 +02:00
Yonit Halperin
5868c99da6 server: support IPV6 addresses in channel events sent to qemu
RHBZ #788444

CC: Gerd Hoffmann <kraxel@redhat.com>

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Yonit Halperin <yhalperi@redhat.com>
2012-02-12 13:15:18 +02:00
Erlon Cruz
9eb0e4b577 Fix mandatory -Werror option
Compilation was breaking due to warning errors even when configuring with
--enable-werror=no. This patch fix this.
2012-02-09 15:51:51 +01:00
Christophe Fergeau
67178944d2 Handle Application::set_hotkeys failure
Application::set_hotkeys can throw an exception if it fails parsing
the string describing the hotkeys to set. Currently this exception
is uncaught which causes spicec to terminate when the controller
tries to set invalid hotkeys. Fall back to using the default
hotkeys when the controller sends an invalid hotkeys string.
2012-02-03 13:11:11 +01:00
Christophe Fergeau
e3fb720cd1 Don't use "hw:0,0" for recording with alsa
We currently hardcode this device when spicec needs to record with
alsa. However, this doesn't interact well with PulseAudio, which
means that if something is already using the recording device, spicec
won't be able to open it again.
Using "default" as the device will let spicec use the PulseAudio
alsa support and will avoid this issue.
2012-01-31 16:40:57 +01:00
Hans de Goede
965a1a253c More comparison between signed and unsigned integer expressions warning fixes
Turns out that more recent snapshots of gcc-4.7 emit even more of these,
so the fixes which I've done before tagging the 0.10.1 release are not
enough to build warning free with the latest gcc-4.7 snapshot <sigh>.

This fixes this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2012-01-23 20:33:27 +01:00
Hans de Goede
8817549795 Release 0.10.1 2012-01-23 15:58:13 +01:00
Hans de Goede
a0190fce23 Fix various comparison between signed and unsigned integer expressions warnings
These turn into errors because of our -Werror use, breaking the build.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2012-01-23 15:58:13 +01:00
Alon Levy
459a4dba56 server/red_channel: red_peer_handle_incoming: comment on null check
Signed-off-by: Alon Levy <alevy@redhat.com>
2012-01-23 12:58:30 +02:00
Alon Levy
51d7598a2e server/tests/test_empty_success: fix warning on bzero
Signed-off-by: Alon Levy <alevy@redhat.com>
2012-01-23 12:41:56 +02:00
Dan McGee
07b8d85cb6 Use found python binary to check for pyparsing
This matches what we do in client/Makefile.am to actually run the
python scripts, which is to use the python binary we find first,
preferring 'python2' over 'python'. This makes the compile work on odd
systems such as Arch Linux where the python binary is actually python3.

Signed-off-by: Dan McGee <dpmcgee@gmail.com>
2012-01-23 12:28:59 +02:00
Dan McGee
90d6126869 Remove epoll headers from client code
There is no more usage of epoll on the client side, so no need to
include these header files.

Signed-off-by: Dan McGee <dpmcgee@gmail.com>
2012-01-23 12:28:59 +02:00
Nahum Shalman
781706ea0d server: don't complain if setsockopt(SO_PRIORITY) call fails
dc7855967f did this for the TCP_NODELAY and IP_TOS calls; we should do
it for priority as well if necessary.

We also #ifdef the setting of the low-level socket priority based on
whether we have a definition of SO_PRIORITY available. This option is
not available on Illumos/Solaris platforms; however, since we set IP_TOS
anyway it is not a big deal to omit it here.
2012-01-23 12:28:58 +02:00
Dan McGee
89cc196a1b server/inputs_channel: don't set O_ASYNC option on socket
output to send a SIGIO signal to the running program. However, we don't
handle this signal anywhere in the code, so setting the option is
unnecessary.

Signed-off-by: Dan McGee <dpmcgee@gmail.com>
2012-01-23 12:28:58 +02:00
Dan McGee
b0b19f4b25 Update .gitignore with a few more generated files
Signed-off-by: Dan McGee <dpmcgee@gmail.com>
2012-01-23 12:28:58 +02:00
Dan McGee
c4ddc5ba51 Fix git commit hook errors in red_worker
This ensures all line lengths are down below 100 characters as well as
removing some trailing spaces.

Signed-off-by: Dan McGee <dpmcgee@gmail.com>
2012-01-23 12:28:57 +02:00
Dan McGee
046b88ec64 Fix line length errors in main_channel
These are all existing errors; fix them so they don't block future
commits in this file unnecessarily.

    error (1): length @ server/main_channel.c +369
    error (2): length @ server/main_channel.c +444
    error (3): length @ server/main_channel.c +764
    error (4): length @ server/main_channel.c +932
    error (5): length @ server/main_channel.c +1044

Signed-off-by: Dan McGee <dpmcgee@gmail.com>
2012-01-23 12:28:57 +02:00
Alon Levy
6032a95205 docs/Spice_for_newbies.odt: some updates - added copy paste and wan mention, removed vdi_port 2012-01-22 15:13:32 +02:00
Alon Levy
88f68f5329 server/red_channel: avoid segfault if stream == NULL 2012-01-22 15:13:32 +02:00
Alon Levy
7dbdd93bf9 client/foreign_menu: arm build fix 2012-01-22 15:13:32 +02:00
Alon Levy
afd7dfde1f import existing odt docs 2012-01-22 15:13:31 +02:00
Hans de Goede
dc7855967f server: Don't complain if setsockopt NODELAY fails on unix sockets
With Daniel P. Berrange's patches to allow use of pre-supplied fd's
as channels, we can no longer be sure that our connections are TCP
sockets, so it makes no sense to complain if a TCP/IP specific
setsockopt fails with an errno of ENOTSUP.

Note that this extends Daniel's commit 492ddb5d1d
which already added the same check to server/inputs_channel.c

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2012-01-18 11:14:40 +01:00
Daniel P. Berrange
b5060ff813 Add a 'syntax-check' make target
The 'make syntax-check' target is used to perform various code
style sanity checks, as well as to detect certain trivial error
patterns. The target is placed in GNUmakefile, instead of Makefile.am
since it relies on GNU specific make extensions.

The actual GNUmakefile and maint.mk files are taken from the
GNULIB project, unchanged

The cfg.mk file is used to configure which of the syntax checks
are activated, to allow addition of new project specific syntax
checks, and to blacklist certain files which should not be checked

* .mailmap: Add mapping for various broken email addrs in
  commit log, to stop complaints about AUTHORS file missing
  entries
* GNUmakefile: define the 'syntax-check' rule
* maint.mk: definition of standard syntax checks
* cfg.mk: configuration for checks
2012-01-13 18:12:00 +02:00
Daniel P. Berrange
68c2897e5b Remove trailing whitespace from end of lines 2012-01-13 18:11:59 +02:00
Daniel P. Berrange
51f1ad54ad Replace test XXX -a YYY with test XXX && test YYY
The '-a' and '-o' operators to test are not portable. Always
combine two invocations of 'test' using || or && instead.
2012-01-13 18:11:59 +02:00
Daniel P. Berrange
7427b23d84 Add missing includes of config.h
Not all files were including config.h
2012-01-13 18:11:59 +02:00
Daniel P. Berrange
d46bc77278 Remove bogus include of strings.h
The tests include strings.h but don't need any of its functions
2012-01-13 18:11:59 +02:00
Daniel P. Berrange
2d530f929f Remove unused backup file
The common/glc.c.save file appears to be a obsolete copy of
glc.c
2012-01-13 18:11:59 +02:00
Daniel P. Berrange
02d56750bd Remove trailing blank lines
Remove any blank lines at the end of all source files
2012-01-13 18:11:59 +02:00
Daniel P. Berrange
8ab7c4535a Remove 'the the' typos 2012-01-13 18:11:59 +02:00
Daniel P. Berrange
9f087ee7f0 Remove unused assert.h include
The assert.h include was never used in any code
2012-01-13 18:11:59 +02:00
Daniel P. Berrange
440ba5d8f0 Always quote first arg to AC_DEFINE
The first arg to AC_DEFINE should always be quoted
2012-01-13 18:11:59 +02:00
Daniel P. Berrange
0de78e9f59 Fix up copyright decl to always use 'Copyright (C) Red Hat, Inc.'
A couple of files were missing '(C)' in the copyright header
2012-01-13 18:11:59 +02:00
Daniel P. Berrange
d6c31a6970 Improve usefulness of README file
The COPYING file already contains the license text, so the README
file need not repeat it. Instead put in a description of what
SPICE is, simple install instructions & pointers to mailing lists
and bug trackers
2012-01-13 18:11:58 +02:00
Daniel P. Berrange
c9b38f6ac7 Fill out the AUTHORS file with some content
The AUTHORS file is empty, fill it in with a list of present and
past maintainers, and email addresses of all people who have
contributed patches
2012-01-13 18:11:58 +02:00
Daniel P. Berrange
42df032c47 Remove casts from void * with xrealloc() calls
The xrealloc() function returns void*, so the return value
never needs to be cast
2012-01-13 18:11:58 +02:00
Daniel P. Berrange
d262f1d96e Rewrite code to avoid triggering warning about casting param to free()
Since free() takes a void* parameters do not need to be cast.

The existing code here is actally fine, but it trips up the
syntax-check rule, so tweak it to an equivalent construct
which passes the syntax check
2012-01-13 18:11:58 +02:00
Daniel P. Berrange
faf0947ebb Remove useless if() before free()
The free() function allows NULL to be passed in, so any
code which puts a if() before free() is wasting time
2012-01-13 18:11:58 +02:00
Daniel P. Berrange
64f4826b6d Death to all TABs
Source files should all use spaces instead of tabs for
indentation. Update the few files not already in
compliance
2012-01-13 18:11:58 +02:00
Alon Levy
8a36c625a6 common/ssl_verify: special case to WIN32 that isn't MINGW32 2012-01-13 17:42:23 +02:00
Alon Levy
7a63185b9b common/bitops: mingw32: reorder so __GNUC__ define is checked first 2012-01-13 17:42:23 +02:00
Alon Levy
c7f4e52000 common/backtrace: for mingw32 no pipe/wait_pid, just disable 2012-01-13 17:42:23 +02:00