summaryrefslogtreecommitdiffstats
path: root/common
Commit message (Collapse)AuthorAgeFilesLines
* Use the spice-common submoduleMarc-André Lureau2012-03-2564-27549/+0
| | | | | | | | | | | | | | | | | | This patch will replace the common/ directory with the spice-common project. It is for now a simple project subdirectory shared with spice-gtk, but the goal is to make it a proper library later on. With this change, the spice-server build is broken. The following commits fix the build, and have been seperated to ease the review. v2 - moves all the generated marshallers to spice-common library - don't attempt to fix windows VS build, which should somehow be splitted with spice-common (or built from tarball only to avoid generation tools/libs deps) v3 - uses libspice-common-client - fix a mutex.h inclusion reported by Alon
* Send name & uuid to capable clientsMarc-André Lureau2012-03-051-0/+9
| | | | | | | | | Add spice_server_set_name() and spice_server_set_uuid() that allows the client to identify a Spice server (useful to associate settings with a particular server) The SPICE_MSG_MAIN_NAME and SPICE_MSG_MAIN_UUID messages are only sent to capable clients, announcing SPICE_MAIN_CAP_NAME_AND_UUID.
* mingw: workaround weird openssl build failureChristophe Fergeau2012-03-041-0/+1
| | | | | | If X509_NAME isn't undefined before including x509v3.h, very weird compilation error occurs. It seems to be caused by duplicate definitions for this symbols coming from wincrypto.h
* mingw: don't try to redefine allocaChristophe Fergeau2012-03-041-0/+2
| | | | | mingw already has a #define alloca __builtin_alloca so trying to redefine it triggers a warning.
* mingw: use uintptr_t when converting a pointer to an intChristophe Fergeau2012-03-042-5/+5
| | | | | | 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.
* Remove extra '\n' from red_printf() callsDan McGee2012-02-141-1/+1
| | | | | | | 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>
* Add casts for compatibility purposesDan McGee2012-02-141-1/+1
| | | | | | | | | | | 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>
* Update .gitignore with a few more generated filesDan McGee2012-01-231-0/+1
| | | | Signed-off-by: Dan McGee <dpmcgee@gmail.com>
* Remove trailing whitespace from end of linesDaniel P. Berrange2012-01-1310-38/+37
|
* Add missing includes of config.hDaniel P. Berrange2012-01-131-1/+1
| | | | Not all files were including config.h
* Remove unused backup fileDaniel P. Berrange2012-01-131-1413/+0
| | | | | The common/glc.c.save file appears to be a obsolete copy of glc.c
* Remove trailing blank linesDaniel P. Berrange2012-01-1319-19/+0
| | | | Remove any blank lines at the end of all source files
* Fix up copyright decl to always use 'Copyright (C) Red Hat, Inc.'Daniel P. Berrange2012-01-134-4/+4
| | | | A couple of files were missing '(C)' in the copyright header
* Remove casts from void * with xrealloc() callsDaniel P. Berrange2012-01-131-12/+10
| | | | | The xrealloc() function returns void*, so the return value never needs to be cast
* Remove useless if() before free()Daniel P. Berrange2012-01-137-31/+12
| | | | | The free() function allows NULL to be passed in, so any code which puts a if() before free() is wasting time
* Death to all TABsDaniel P. Berrange2012-01-137-90/+90
| | | | | | Source files should all use spaces instead of tabs for indentation. Update the few files not already in compliance
* common/ssl_verify: special case to WIN32 that isn't MINGW32Alon Levy2012-01-131-1/+1
|
* common/bitops: mingw32: reorder so __GNUC__ define is checked firstAlon Levy2012-01-131-14/+14
|
* common/backtrace: for mingw32 no pipe/wait_pid, just disableAlon Levy2012-01-132-4/+23
|
* client/windows: fix several assigned but not used errorsAlon Levy2012-01-131-15/+9
|
* client/common: mingw32: workaround HAVE_STDLIB_H redefined in jconfig.hAlon Levy2012-01-132-0/+6
|
* server: add prefix argument to red_printf_debugAlon Levy2011-11-071-2/+2
| | | | | printed before function name. No central location for prefixes. Adding "WORKER", "ASYNC", "MAIN" since those were the current users.
* common/spice_common.h: red_printf_debug: fix wrong signAlon Levy2011-11-071-1/+1
|
* server,proto: tell the clients to connect to the migration target before ↵Yonit Halperin2011-11-021-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
* server: fix function prototypesChristophe Fergeau2011-09-052-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]
* add C++ guards to backtrace.hChristophe Fergeau2011-09-011-0/+6
| | | | | Without these, spice_backtrace() can't be used from the C++ client code.
* fix memory leak in error pathChristophe Fergeau2011-08-251-1/+2
| | | | Issue found by the Coverity scanner
* common: introduce red_printf_debugAlon Levy2011-08-231-0/+10
|
* common/ring: RING_FOREACH_SAFE: use shorter version from qemuAlon Levy2011-08-231-5/+3
|
* common/backtrace.h: disable for WIN32Alon Levy2011-07-311-0/+4
| | | | | This also catches mingw32 which is probably fine, but at least it fixes the build on visual studio.
* fix integer marshalling helpers on big endianChristophe Fergeau2011-07-281-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.
* fix typo in big endian code pathChristophe Fergeau2011-07-281-2/+2
| | | | uint63_t should be uint64_t
* fix make distcheckChristophe Fergeau2011-07-221-1/+1
|
* common: add backtrace via gstack or glibc backtraceAlon Levy2011-07-194-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.
* sndworker: add AudioVolume/AudioMute messagesMarc-André Lureau2011-06-221-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
* common: add WIN64 ifdef for spice_bit_find_msb (fix broken windows x64 build)Arnon Gilboa2011-05-221-2/+2
| | | | | inline __asm is not supported in x64, so use the naive implementation until x64 asm implemented.
* common: use INLINE instead of inlineArnon Gilboa2011-05-127-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.
* common: fix ssl_verify windows build errorsArnon Gilboa2011-05-122-2/+8
|
* common: add ssl_verify.c common codeMarc-André Lureau2011-05-033-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.
* common: add ring_get_length() for debugging purposesMarc-André Lureau2011-05-031-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.
* common: mem.h add alloca definitionMarc-André Lureau2011-05-031-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.
* common: spice_memdup could accept NULLMarc-André Lureau2011-05-031-0/+4
| | | | (this patch is not to solve a crash fix, but to align with glib API)
* common: add windows.h where required, make gdi_handlers staticMarc-André Lureau2011-05-033-1/+8
| | | | | This patch has not been verified with VS/brew. It should be safe hopefully. Compilation is fine with mingw32/spice-gtk.
* move get_time_stamp to main_channel.cChristophe Fergeau2011-05-031-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.
* use standard do { } while (0) for spice_common.h macrosChristophe Fergeau2011-05-031-11/+11
|
* move WARN and WARN_ONCE to spice_common.hChristophe Fergeau2011-05-034-15/+7
|
* common: use PANIC from spice_common.hChristophe Fergeau2011-05-033-20/+0
|
* common,server: use ASSERT from spice_common.hChristophe Fergeau2011-05-037-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.
* common: don't duplicate find_msb implementationChristophe Fergeau2011-05-034-67/+95
|
* add missing staticChristophe Fergeau2011-05-031-2/+2
|