Commit Graph

460 Commits

Author SHA1 Message Date
Yonit Halperin
35cf65a45e seamless-migration: update spice-common submodule
Also Update server and client according to the change of
SpiceMsgMainMigrationBegin: it now holds all the fields inside
SpiceMigrationDstInfo.
2012-08-27 09:10:53 +03:00
Søren Sandmann Pedersen
37be9e0c2e Add support for Composite command to the client
All the real work is being done in spice-common, so this patch is just
hooking up the virtual calls and adding the SPICE_DISPLAY_CAP_COMPOSITE
capability.
2012-08-24 13:45:31 -04:00
Yonit Halperin
0f1fb0ecc2 Update the spice-common submodule
spice-common changes: STREAM_DATA_SIZED message was added in order to support
video streams with frames that their size is different from the initial size
that the stream was created with.

This patch also includes server and client adjustments to the new
SpiceMsgDisplayStreamData.
2012-05-03 12:31:03 +03:00
Daniel P. Berrange
91210c671f Ensure __STDC_FORMAT_MACROS is always defined first
The client/common.h file defines __STDC_FORMAT_MACROS before
including inttypes.h so that the PRI* macros get defined in
C++. This is ignoring the possibility that other global
includes may have already pulled in inttypes.h

We need __STDC_FORMAT_MACROS to be defined before any header
files are included. Putting it in config.h satisfies this,
since config.h is always the first header
2012-04-26 18:46:52 +01:00
Daniel P. Berrange
ef78242e19 Add some more 'noreturn' annotations
Methods which longjump, unconditionally raise an
exception, or call _exit()  cannot return control
to the caller so should be annotated with 'noreturn'

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-04-25 11:31:14 +01:00
Daniel P. Berrange
6d7d9bc12d Fix printf format specifiers for i686 hosts
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-04-25 11:00:01 +01:00
Daniel P. Berrange
3bbc53521e Add missing struct field initializers
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-04-25 10:51:37 +01:00
Daniel P. Berrange
d986fb466b Enable many more compiler warnings
* m4/manywarnings.m4m, m4/warnings.m4: Import GNULIB warnings
  modules
* m4/spice-compile-warnings.m4: Define SPICE_COMPILE_WARNINGS
* configure.ac: Replace compile warning check with a call to
  SPICE_COMPILE_WARNINGS
* client/Makefile.am: Use WARN_CXXFLAGS instead of WARN_CFLAGS

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-04-25 09:49:25 +01:00
Daniel P. Berrange
e1633c65cc Fix broken -I../common to be -I../spice-common in client
* Makefile.am: s/common/spice-common/

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-04-25 09:42:15 +01:00
Daniel P. Berrange
456634a63e Mark functions which never return control
* client/red_channel.cpp:  AbortTrigger::on_event can't return
  given its current impl
* server/red_worker.c: red_worker_main can't return

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-04-25 09:42:15 +01:00
Daniel P. Berrange
6a8b7585e2 Fix multiple printf format problems
All printf var-args style methods should be annotation with
their format. All format strings must be const strings.

* client/application.cpp, client/cmd_line_parser.cpp,
  client/hot_keys.cpp: Avoid non-const format
* client/client_net_socket.cpp: Fix broken format specifier
* client/red_peer.cpp: Fix missing format specifier
* client/platform.h: Add SPICE_GNUC_PRINTF annotation to term_printf
* client/utils.h: Add SPICE_GNUC_PRINTF annotation to string_printf
* server/glz_encoder_config.h, server/red_worker.c: Add
  SPICE_GNUC_PRINTF annotation to warning callbacks

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-04-25 09:42:11 +01:00
Aric Stewart
b87ef5170d update visual studio project file
Note, there may be line-ending issues here is we are not careful.  This file is a msdos formatted file.

There was some inconsistencies in those line-ending that I have normalized.

Signed-off-by: Aric Stewart <aric@codeweavers.com>
2012-04-18 16:01:27 +03:00
Alon Levy
42758228fc client/windows/redc.vcproj: switch to unix EOL (dos2unix) 2012-04-18 16:00:17 +03:00
Aric Stewart
962f239159 Update win32 generate(1).bat files to match modern usage
This involves:
 generating .c instead of .cpp files
 Not including "common.h"
 Standardizing some parameters

Signed-off-by: Aric Stewart <aric@codeweavers.com>
2012-04-18 14:06:04 +03:00
Aric Stewart
4aca52309c we do not need afxres.h included in redc.rc
It is not an MFC project so simply including windef.h is better and
allows for compiling with the Express editions of Visual Studio.
2012-04-18 14:05:50 +03:00
Aric Stewart
197620e43a Copy getopt.h from old common/win/my_getopt-1.5/my_getopt
This patch completes the copy from
4d8f39020a which missed this file.
2012-04-17 10:27:17 +03:00
Aric Stewart
3cd2f843b5 update windows client generate.bat and generate1.bat
the python script is now in spice-common and client_marshallers.h needs
to be included instead of marshallers.h
2012-04-17 10:24:19 +03:00
Christophe Fergeau
2439c0dc90 Replace sprintf with snprintf use
The hotkey parser was generating a string with sprintf and data it got
from the controller socket (ie data which can have an arbitrary
length). Using sprintf there is a bad idea, replace it with snprintf.
2012-04-02 12:14:55 +02:00
Marc-André Lureau
4d8f39020a Copy common/win/my_getopt-1.5/my_getopt client/windows 2012-03-25 19:00:00 +02:00
Marc-André Lureau
359fc1cb5d Use the spice-common submodule
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
2012-03-25 18:59:10 +02:00
Christophe Fergeau
64e0974114 Don't truncate SPICE_FOREIGN_MENU_SOCKET
When we get the socket name for the foreign menu socket from
an environment variable, we cannot make assumptions about its length.
Currently, we are strncpying to a 50 byte buffer which is easily
too small.
2012-03-20 16:53:50 +01:00
Christophe Fergeau
3d452a312b Don't limit spice controller socket name to 50 chars
The spice controller socket name used to be hardcoded to
/tmp/SpiceController-%lu.uds and generated using snprintf. A 50 bytes
buffer was enough for that, but this was changed in commit 79fffbf95
because this was predictable and allowed other users on the system
to sniff the browser/client communication. spicec now uses the value
of the environment SPICE_XPI_SOCKET as the name of the socket to use.
However, since the name that is used is no longer generated by spicec,
no assumption can be made about its size. Currently, the socket is
created inside the user home directory, which means that if the
user name is too long, spicec will not be able to read the controller
socket name.
This commit directly uses the string from getenv as he name of the
controller socket (on Linux) instead of limiting its size to 50 characters,
which should fix this issue.
This fixes rhbz #804561
2012-03-20 16:53:40 +01:00
Christophe Fergeau
01c6f4d2c6 Remove unused Canvas members
The various Canvas have _max and _base variables which are not
used, better to remove them.
2012-03-20 16:53:35 +01:00
Marc-André Lureau
1ab589f39e Use SPICE_FOREIGN_MENU_SOCKET if it's available
If specified, use SPICE_FOREIGN_MENU_SOCKET environment variable over
snprintf(pipe_name, PIPE_NAME_MAX_LEN, PIPE_NAME,
Platform::get_process_id()); since it's impossible to guess the client
pid when spice-xpi launches the client as a grand-child (via script
etc).

This is also more aligned with the way we handle SPICE_XPI_SOCKET
location.
2012-03-05 22:52:27 +01:00
Christophe Fergeau
32cd24be0a mingw: fix signed/unsigned comparison warnings 2012-03-04 10:50:38 +02:00
Christophe Fergeau
58b9aa9853 mingw: add workaround for _ftime_s issue on mingw
mingw has a _ftime_s prototype in its headers, but no corresponding
symbol available at link time. Workaround this issue for now by
 #defining it to _ftime. This is untested on win64 where the workaround
may not be needed.
2012-03-04 10:50:38 +02:00
Christophe Fergeau
4ec9ac20fc mingw: #ifdef unneeded #define in common.h
common.h has some #define when doing win32 build to workaround a few
missing functions on these systems. However, since mingw32 has some
of these, this causes either warnings about redefining preprocessor
symbols or wreak havoc in mingw headers trying to use these symbols.
This commit wraps these symbols in an #ifndef __MINGW32__ to avoid
using them on this platform.
2012-03-04 10:50:38 +02:00
Christophe Fergeau
5989e2d1c4 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-04 10:50:38 +02:00
Arnon Gilboa
f605e2774d client/windows: fix SetClipboardViewer error handling rhbz#786554
MSDN says the following about SetClipboardViewer(): "If an error occurs or there
are no other windows in the clipboard viewer chain, the return value is NULL".
Seems like the buggy case was "no other windows in the clipboard viewer chain",
which explains the 3rd party clipboard manager workaround detailed in the bug
description.

It also seems like SetClipboardViewer() does not clear the error state on
succcess. Calling SetLastError(0) before SetClipboardViewer() seems to solves
this issue.

Since we could not reproduce the bug on our env, the customer has verified on
several of their systems that a private build resolved the issue.
2012-03-01 14:16:49 +02:00
Yonit Halperin
d2cd7b2b02 client X11: support volume keys when evdev is in use
Add support for sending volume keys scancodes to the guest
RHBZ #552539

Signed-off-by: Yonit Halperin <yhalperi@redhat.com>
2012-03-01 08:59:19 +02:00
Yonit Halperin
68cdc5488d client: keyboard - add mapping for volume keys
Add support for sending volume keys scancodes to the guest
RHBZ #552539

A good reference for mapping keymaps to scancodes can be found in
spice-gtk/gtk/keymaps.csv

Signed-off-by: Yonit Halperin <yhalperi@redhat.com>
2012-03-01 08:58:52 +02:00
Christophe Fergeau
a50619e733 Fix compilation when smartcard support is disabled
The addition of smartcard control to the controller doesn't handle
the case when smartcard support is disabled at compile time. When
this is the case, this causes compile errors.
2012-02-29 18:20:01 +01:00
Alon Levy
4b7c66cafc controller_test: add README 2012-02-28 14:40:42 +02:00
Alon Levy
294dae31b0 client controller_test: reorder parameters since pid isn't needed for linux client test 2012-02-28 14:40:42 +02:00
Alon Levy
26516fc5a2 client: handle CONTROLLER_ENABLE_SMARTCARD (rhbz 641828) 2012-02-28 14:40:42 +02:00
Alon Levy
bbd01f5f63 controller_test: add ENABLE_SMARTCARD 2012-02-28 14:40:42 +02: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
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
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
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
Alon Levy
7dbdd93bf9 client/foreign_menu: arm build fix 2012-01-22 15:13:32 +02:00
Daniel P. Berrange
68c2897e5b Remove trailing whitespace from end of lines 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
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
a9bf749779 client/windows: fix several assigned but not used errors 2012-01-13 17:42:23 +02:00
Alon Levy
96c292a0b4 client/windows: arraysize(inf.bmiColors) == 1 in mingw32 2012-01-13 17:42:23 +02:00
Alon Levy
fe61197643 client/windows: fix typo, make error messages unique 2012-01-13 17:42:23 +02:00
Alon Levy
54a7b36a57 client/windows/main: mingw32 provides PACKAGE_VERSION 2012-01-13 17:42:23 +02:00