summaryrefslogtreecommitdiff
path: root/common
AgeCommit message (Collapse)AuthorFilesLines
2011-11-07server: add prefix argument to red_printf_debugAlon Levy1-2/+2
printed before function name. No central location for prefixes. Adding "WORKER", "ASYNC", "MAIN" since those were the current users.
2011-11-07common/spice_common.h: red_printf_debug: fix wrong signAlon Levy1-1/+1
2011-11-02server,proto: tell the clients to connect to the migration target before ↵Yonit Halperin1-0/+2
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
2011-09-05server: fix function prototypesChristophe Fergeau2-5/+5
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]
2011-09-01add C++ guards to backtrace.hChristophe Fergeau1-0/+6
Without these, spice_backtrace() can't be used from the C++ client code.
2011-08-25fix memory leak in error pathChristophe Fergeau1-1/+2
Issue found by the Coverity scanner
2011-08-23common: introduce red_printf_debugAlon Levy1-0/+10
2011-08-23common/ring: RING_FOREACH_SAFE: use shorter version from qemuAlon Levy1-5/+3
2011-07-31common/backtrace.h: disable for WIN32Alon Levy1-0/+4
This also catches mingw32 which is probably fine, but at least it fixes the build on visual studio.
2011-07-28fix integer marshalling helpers on big endianChristophe Fergeau1-6/+6
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.
2011-07-28fix typo in big endian code pathChristophe Fergeau1-2/+2
uint63_t should be uint64_t
2011-07-22fix make distcheckChristophe Fergeau1-1/+1
2011-07-19common: add backtrace via gstack or glibc backtraceAlon Levy4-0/+142
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.
2011-06-22sndworker: add AudioVolume/AudioMute messagesMarc-André Lureau1-0/+9
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
2011-05-22common: add WIN64 ifdef for spice_bit_find_msb (fix broken windows x64 build)Arnon Gilboa1-2/+2
inline __asm is not supported in x64, so use the naive implementation until x64 asm implemented.
2011-05-12common: use INLINE instead of inlineArnon Gilboa7-38/+20
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.
2011-05-12common: fix ssl_verify windows build errorsArnon Gilboa2-2/+8
2011-05-03common: add ssl_verify.c common codeMarc-André Lureau3-0/+543
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.
2011-05-03common: add ring_get_length() for debugging purposesMarc-André Lureau1-0/+13
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.
2011-05-03common: mem.h add alloca definitionMarc-André Lureau1-0/+30
We don't support the autoconf ALLOCA/C_ALLOC fallback. If one day, someone cares for a weird platform, he can fix it.
2011-05-03common: spice_memdup could accept NULLMarc-André Lureau1-0/+4
(this patch is not to solve a crash fix, but to align with glib API)
2011-05-03common: add windows.h where required, make gdi_handlers staticMarc-André Lureau3-1/+8
This patch has not been verified with VS/brew. It should be safe hopefully. Compilation is fine with mingw32/spice-gtk.
2011-05-03move get_time_stamp to main_channel.cChristophe Fergeau1-7/+0
There is only one user of get_time_stamp from spice_common.h so it's not really useful to keep it there.
2011-05-03use standard do { } while (0) for spice_common.h macrosChristophe Fergeau1-11/+11
2011-05-03move WARN and WARN_ONCE to spice_common.hChristophe Fergeau4-15/+7
2011-05-03common: use PANIC from spice_common.hChristophe Fergeau3-20/+0
2011-05-03common,server: use ASSERT from spice_common.hChristophe Fergeau7-36/+3
spice_common.h provides an ASSERT macro, no need to duplicate it in many places. For now client/debug.h keeps its own copy since debug.h and spice_common.h have clashes on other macros which are trickier to unify.
2011-05-03common: don't duplicate find_msb implementationChristophe Fergeau4-67/+95
2011-05-03add missing staticChristophe Fergeau1-2/+2
2011-05-03add #include <config.h> to all source filesChristophe Fergeau20-5/+63
When using config.h, it must be the very first include in all source files since it contains #define that may change the compilation process (eg libc structure layout changes when it's used to enable large file support on 32 bit x86 archs). This commit adds it at the beginning of all .c and .cpp files
2011-05-03autotools: correctly build canvas-related codeChristophe Fergeau9-14/+39
spice client and spice server shares code from common/{gdi,gl,sw}_canvas.[ch]. However, while most of the code is shared, the server code wants a canvas compiled with SW_CANVAS_IMAGE_CACHE defined while the client code wants a canvas compiled with SW_CANVAS_CACHE. The initial autotools refactoring didn't take that into account, this is now fixed by this commit. After this commit, the canvas files from common/ are no longer compiled as part of the libspice-common.la convenience library. Instead, there are "proxy" canvas source files in client/ and server/ which #include the appropriate C files after defining the relevant #define for the binary that is being built. To prevent misuse of the canvas c files and headers in common/, SPICE_CANVAS_INTERNAL must be set when including the canvas headers from common/ or when building the c files from common/ otherwise the build will error out.
2011-05-03autotools: refactor the whole build machineryChristophe Fergeau1-31/+56
spice Makefile.am setup is a bit confusing, with source file names being listed several times in different Makefile.am (generally, once in EXTRA_DIST and another time in another Makefile.am in _SOURCES). The client binaries are built by client/x11/Makefile.am, which means recursing into client, then into x11 to finally build spicec. This Makefile.am is also referencing files from common/ and client/, which is a bit unusual with autotools. This patch attempts to simplify the build process to get something more usual from an autotools point of view. The source from common/ are compiled into a libtool convenience library, which the server and the client links against which avoids referencing source files from common/ when building the server and the client. The client is built in client/Makefile.am and directly builds files from x11/ windows/ and gui/ if needed (without recursing in these subdirectories). This makes the build simpler to understand, and also makes it possible to list source files once, which avoids potential make distcheck breakage when adding new files. There is a regression in this patch with respect to sw_canvas/gl_canvas/gdi_canvas. They should be built with different preprocessor #defines resulting in different behaviour of the canvas for the client and the server. However, this is not currently the case, both the client and the server will use the same code for now (which probably means one of them is broken). This will be fixed in a subsequent commit. make distcheck passes, but compilation on windows using the autotools build system hasn't been tested, which means it's likely to be broken. It shouldn't be too hard ot fix it though, just let me know of any issues with this.
2011-05-02common: don't try to redefine PANIC if it already existsChristophe Fergeau1-0/+2
canvas_base.c tries to define PANIC, but it might already be set if eg client/debug.h has been included before. All the other macros in this file are guarded by #ifndef, this commit adds the missing #ifndef to PANIC. Note that this is just a bandaid, ideally common/ would contain a logging frameword, and these macros would only be defined once instead of being defined in several places.
2011-05-02use foo(void) instead of foo() in prototypesChristophe Fergeau11-11/+11
In C, the latter isn't a prototype for a function with no arg, but declares a function with an undefined number of args.
2011-05-02common: add missing header guards to gl_canvas.hChristophe Fergeau1-0/+5
2011-05-02common: add extern "C" guards to headersChristophe Fergeau23-2/+182
Since some spice C++ code is using code from common/, the C functions need to be marked as such for the C++ compiler, otherwise we'll get linkage issues.
2011-04-18draw: remove SPICE_ADDRESSChristophe Fergeau1-1/+0
This commit removes the typedef for SPICE_ADDRESS which was no longer used. This is the last thing that was missing to close fdo bug #28984
2011-04-08common/pixman: remove dead assignmentsChristophe Fergeau1-7/+3
They were detected using clang-static-analyzer. Don't initialize the variable to a value to override it with a different value a few lines after.
2011-03-23common/gl: remove unused variableChristophe Fergeau1-3/+2
clang static analyzer warned that 'len' was computed but never used in glc_vertex2d. glc_stroke_line_dash has side effects so we have to call it, but we don't need to save its return value since it's not used.
2011-03-02ring: add RING_FOREACH{,_SAFE,_REVERSED}Alon Levy1-0/+21
2011-03-02server/common: introduce common/spice_common.hAlon Levy1-0/+70
move all the ASSERT/PANIC/PANIC_ON/red_error/red_printf* macros to a common file to be used with ring.h that is going to be used externally (by spice-gtk).
2011-02-28common: add SpiceBuffer - based on qemu-vnc BufferMarc-André Lureau2-0/+70
https://bugs.freedesktop.org/show_bug.cgi?id=34795
2011-01-25common/sw_canvas: remove unused error valAlon Levy1-2/+1
This is the only unused var change I'll want to revisit eventually, I'm submitting anyway since it doesn't change current behavior. I'm talking about ignoring the return value from canvas creation. Adding a print is possible but I didn't test (may be too verbose, also preferable to be a debug print if so, and we don't have that option in the code atm - probably an environment variable will do, or adding some spice_server_set_logging_level api, maybe even spice_server_set_logging_fd?)
2011-01-25common/canvas_base.c: remove unused variablesAlon Levy1-12/+0
2011-01-05common, canvas_get_jpeg_alpha: let top_down be any valueAlon Levy1-1/+1
Allow top_down flag to have any value, only ASSERT it is positive when needs to be positive and zero otherwise. Allows older server bug of sending 4 instead of 1 in top down flag to not affect newer clients (previous patch fixes server).
2010-12-08mingw32 build: various fixesAlon Levy1-2/+2
2010-12-08mingw32 build: fix two functionsAlon Levy1-1/+1
2010-12-08mingw32 build: fix signed/unsigned warnings as errorsAlon Levy3-7/+7
2010-12-08mingw32 build: fix build errorsGerd Hoffmann1-2/+2
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2010-09-29Initialize variable to avoid compiler warningAlexander Larsson1-1/+1
Seems the OSX gcc warns on saveRight not being initialzied.