Commit Graph

280 Commits

Author SHA1 Message Date
Christophe Fergeau
ea9e91cd8d mingw: don't try to redefine alloca
mingw already has a #define alloca __builtin_alloca so trying to
redefine it triggers a warning.
2012-03-20 15:25:56 +01:00
Christophe Fergeau
a107b62a74 mingw: use uintptr_t when converting a pointer to an int
win64 uses 32 bit long, so we cannot use a long to hold a 64 bit
pointer. Thankfully, there's a [u]intptr_t type available exactly
for these uses.
2012-03-20 15:25:56 +01:00
Dan McGee
a14a8c83e0 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-03-20 15:25:56 +01:00
Dan McGee
df2dcb496e 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-03-20 15:25:55 +01:00
Dan McGee
e571bd02c9 Update .gitignore with a few more generated files
Signed-off-by: Dan McGee <dpmcgee@gmail.com>
2012-03-20 15:25:55 +01:00
Daniel P. Berrange
95f2f77839 Remove trailing whitespace from end of lines 2012-03-20 15:25:55 +01:00
Daniel P. Berrange
14ca077df3 Add missing includes of config.h
Not all files were including config.h
2012-03-20 15:25:55 +01:00
Daniel P. Berrange
4930ef7239 Remove unused backup file
The common/glc.c.save file appears to be a obsolete copy of
glc.c
2012-03-20 15:25:55 +01:00
Daniel P. Berrange
f83432a685 Remove trailing blank lines
Remove any blank lines at the end of all source files
2012-03-20 15:25:55 +01:00
Daniel P. Berrange
457892cb9f Fix up copyright decl to always use 'Copyright (C) Red Hat, Inc.'
A couple of files were missing '(C)' in the copyright header
2012-03-20 15:25:55 +01:00
Daniel P. Berrange
6142b84cd4 Remove casts from void * with xrealloc() calls
The xrealloc() function returns void*, so the return value
never needs to be cast
2012-03-20 15:25:55 +01:00
Daniel P. Berrange
4a9f7971fc 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-03-20 15:25:55 +01:00
Daniel P. Berrange
bcdf929c79 Death to all TABs
Source files should all use spaces instead of tabs for
indentation. Update the few files not already in
compliance
2012-03-20 15:25:55 +01:00
Alon Levy
a2e0db03a9 common/ssl_verify: special case to WIN32 that isn't MINGW32 2012-03-20 15:25:55 +01:00
Alon Levy
533358acf5 common/bitops: mingw32: reorder so __GNUC__ define is checked first 2012-03-20 15:25:55 +01:00
Alon Levy
db2057fa4c common/backtrace: for mingw32 no pipe/wait_pid, just disable 2012-03-20 15:25:55 +01:00
Alon Levy
a2cc577747 client/windows: fix several assigned but not used errors 2012-03-20 15:25:54 +01:00
Alon Levy
e8efd344c0 client/common: mingw32: workaround HAVE_STDLIB_H redefined in jconfig.h 2012-03-20 15:25:54 +01:00
Yonit Halperin
ec119c67f3 spice.proto: add SPICE_MSG_LIST to base channel 2012-03-20 15:25:54 +01:00
Hans de Goede
9ef008e5c3 codegen: Fix enums.h generation
With the new usbredir code we have the new concept of the abstract /
generic spicevmc channel type (which just tunnels data from a qemu chardev),
and we've the usbredir channel, which is the only current user of this.

This was reflected in the protocols enum in spice-protocol.h by a manual
edit done by me, my bad. This patch teaches spice.proto about the relation
between the abstract spicevmc channel and the usbredir channel and
modifies codegen to deal with this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2012-03-20 15:25:54 +01:00
Alon Levy
5846dec251 server: add prefix argument to red_printf_debug
printed before function name. No central location for prefixes.
Adding "WORKER", "ASYNC", "MAIN" since those were the current users.
2012-03-20 15:25:54 +01:00
Alon Levy
cc30c6d833 common/spice_common.h: red_printf_debug: fix wrong sign 2012-03-20 15:25:54 +01:00
Yonit Halperin
4b1c0afd7d spice.proto: add SPICE_MSG_MAIN_MIGRATE_END & SPICE_MSGC_MAIN_MIGRATE_END
(cherry picked from commit cfbd07710562e522179ae5a7085a789489a821bb branch 0.8)
2012-03-20 15:25:54 +01:00
Yonit Halperin
9cf6d39b36 server,proto: tell the clients to connect to the migration target before migraton starts
(1) send SPICE_MSG_MAIN_MIGRATE_BEGIN upon spice_server_migrate_connect
    (to all the clients that support it)
(2) wait for SPICE_MSGC_MAIN_MIGRATE_(CONNECTED|CONNECT_ERROR) from all the relevant clients,
    or a timeout, in order to complete client_migrate_info monitor command
(cherry picked from commit 5560c56ef05c74da5e0e0825dc1f134019593cad branch 0.8;
 Was modified to support the separation of main channel from reds, and multiple clients)

Conflicts:

	server/reds.c
2012-03-20 15:25:54 +01:00
Christophe Fergeau
264ccc73f1 server: fix function prototypes
Several functions in server/ were not specifying an argument list,
ie they were declared as void foo(); When compiling with
-Wstrict-prototypes, this leads to:
test_playback.c:93:5: erreur: function declaration isn’t a prototype
[-Werror=strict-prototypes]
2012-03-20 15:25:54 +01:00
Christophe Fergeau
6130d4602d add C++ guards to backtrace.h
Without these, spice_backtrace() can't be used from the C++ client
code.
2012-03-20 15:25:54 +01:00
Christophe Fergeau
40c06459e5 fix memory leak in error path
Issue found by the Coverity scanner
2012-03-20 15:25:54 +01:00
Alon Levy
4f60889f23 spice.proto: add comment for origin of STYLED and START_WITH_GAP 2012-03-20 15:25:54 +01:00
Alon Levy
ed77ce6dbf common: introduce red_printf_debug 2012-03-20 15:25:54 +01:00
Alon Levy
e5b2086eb5 common/ring: RING_FOREACH_SAFE: use shorter version from qemu 2012-03-20 15:25:54 +01:00
Hans de Goede
d69f4ccea2 server: Add a usbredir channel 2012-03-20 15:25:54 +01:00
Alon Levy
82ed762637 common/backtrace.h: disable for WIN32
This also catches mingw32 which is probably fine, but at least it fixes
the build on visual studio.
2012-03-20 15:25:53 +01:00
Christophe Fergeau
ec5f0c2e99 fix integer marshalling helpers on big endian
They were trying to convert the destination pointer to an integer before
trying to dereference it. The initial conversion was meant to be a cast
to a pointer of the right size, not to an integer.
2012-03-20 15:25:53 +01:00
Christophe Fergeau
303ac1c9de fix typo in big endian code path
uint63_t should be uint64_t
2012-03-20 15:25:53 +01:00
Christophe Fergeau
673ab9b950 fix make distcheck 2012-03-20 15:25:53 +01:00
Alon Levy
cb4c660655 common: add backtrace via gstack or glibc backtrace
Add a backtrace printing function copied from xserver os/backtrace.c
that uses gstack, and if that isn't found then glibc's backtrace.
Used in ASSERT, tested on F15.
2012-03-20 15:25:53 +01:00
Christophe Fergeau
da4768ae2b don't #include config.h in generated header files
7e30572ab adds a #include <config.h> to the beginning of generated
files. It also does this for generated headers and enums files,
which is not wanted, especially if it's an installed file. This
commit only adds this include for the non-header non-enum case
(hopefully, enums are only generated for use in a .h file).
2012-03-20 15:25:53 +01:00
Christophe Fergeau
e0a8d6625c add check for pyparsing
Check both in configure.ac (after checking if we need to rebuild
the marshalling files) and in the python script using pyparsing
(for people modifying .proto files in tarballs)
2012-03-20 15:25:53 +01:00
Marc-André Lureau
85a49d512a sndworker: add AudioVolume/AudioMute messages
These messages allow the guest to send the audio device volume to the
client. It uses an arbitrary scale of 16bits, which works good enough
for now.

Save VolumeState in {Playback,Record}State, so that we can send the
current volume on channel connection.

Note about future improvements:
- add exact dB support
- add client to guest volume change

Updated since v2:
- bumped record and playback interface minor version to allow
  conditional compilation
Updated since v1:
- sync record volume on connection too
2012-03-20 15:25:53 +01:00
Marc-André Lureau
5ae49c0d5b python: remove c-ism trailing ; 2012-03-20 15:25:53 +01:00
Marc-André Lureau
7f9e2cb1f7 codegen: typedef the protocol enums
Commit 9d5ef9beeca722b2ceff7d15aaa3aaaaf07ecfbf in spice-protocol
introduced a typedef manually in the generated enums.h header.

This patch adds them automatically to all enums during enums.h generation.
2012-03-20 15:25:53 +01:00
Arnon Gilboa
f492c12364 common: add WIN64 ifdef for spice_bit_find_msb (fix broken windows x64 build)
inline __asm is not supported in x64, so use the naive implementation
until x64 asm implemented.
2012-03-20 15:25:53 +01:00
Arnon Gilboa
88f7e2b32d common: use INLINE instead of inline
needed for spice/common files used by the client, server & qxl driver.
in windows _inline works for both c/c++, while inline is c++ only.
compiling the client with mixed c/c++ code required this define.
2012-03-20 15:25:53 +01:00
Arnon Gilboa
4cb26e06f7 common: fix ssl_verify windows build errors 2012-03-20 15:25:53 +01:00
Marc-André Lureau
5de42c768d common: add ssl_verify.c common code
Code adapter from RedPeer::ssl_verify_callback() and used by
spice-gtk.

Since v1:
 - fixed Makefile.am
 - added config.h include
 - autoconf alloca added in patch series
 - moved int escape inside for loop
 - added a failed case when missing assignment
 - replaced strlen () by -1
 - skip spaces after comma
 - c++ guards

I didn't use bool, because openSSL uses int, and it is more future
proof for error reporting.
2012-03-20 15:25:53 +01:00
Marc-André Lureau
a472bdff0d common: add ring_get_length() for debugging purposes
Please notice it has a "static" modifier, like the rest of the inlined
functions in ring.h, so it won't warn if it isn't used.
2012-03-20 15:25:52 +01:00
Marc-André Lureau
3349946ab2 common: mem.h add alloca definition
We don't support the autoconf ALLOCA/C_ALLOC fallback. If one day,
someone cares for a weird platform, he can fix it.
2012-03-20 15:25:52 +01:00
Marc-André Lureau
55e936b9fd common: spice_memdup could accept NULL
(this patch is not to solve a crash fix, but to align with glib API)
2012-03-20 15:25:52 +01:00
Marc-André Lureau
f0ce9c8433 common: add windows.h where required, make gdi_handlers static
This patch has not been verified with VS/brew. It should be safe
hopefully. Compilation is fine with mingw32/spice-gtk.
2012-03-20 15:25:52 +01:00
Christophe Fergeau
c04b58bf7a move get_time_stamp to main_channel.c
There is only one user of get_time_stamp from spice_common.h so
it's not really useful to keep it there.
2012-03-20 15:25:52 +01:00