Commit Graph

754 Commits

Author SHA1 Message Date
Marc-André Lureau
eeb95c5b84 server: add reds_stream_{read,write,free,remove_watch}()
https://bugs.freedesktop.org/show_bug.cgi?id=34795
2011-07-21 15:09:25 +03:00
Marc-André Lureau
881971fbca server: s/RedsStreamContext/RedsStream
https://bugs.freedesktop.org/show_bug.cgi?id=34795
2011-07-21 15:09:25 +03:00
Marc-André Lureau
a1ef838d34 server/reds: remove unused readv
Let's not bother with it since nobody uses it, and it's not implemented for SSL anyway

https://bugs.freedesktop.org/show_bug.cgi?id=34795
2011-07-21 15:09:25 +03:00
Marc-André Lureau
e1cfe664c4 build: make it silent
This patch make it easier to spot warnings in compilation.  It should
work with older versions of automake that don't support silent rules.

If you want verbose build, make V=1.

Signed-off-by: Uri Lublin <uril@redhat.com>

https://bugs.freedesktop.org/show_bug.cgi?id=34795
2011-07-21 15:09:25 +03:00
Arnon Gilboa
4bdacb2c14 client/windows: use SPICE_PROTOCOL_DIR in project include dirs
instead of ..\..\..\spice-protocol. Relative path to another git tree is a bit
ugly, since it requires spice-protocol to be in a specific location.

SPICE_PROTOCOL_DIR should also be used in windows qxl and vdagent instead of
SPICE_COMMON_DIR, which is an old and confusing name, due to the common
directory in spice git repo.
2011-07-21 15:09:25 +03:00
Alon Levy
fcd4a8e446 server/red_channel: fix segfault on red_channel_destroy if peer already removed 2011-07-21 15:09:25 +03:00
Thomas Tyminski
b6445d35f7 Fixes compilation error of Spice Client (Linux/X11) with OpenGL enabled modified: client/x11/red_window.cpp 2011-07-21 15:08:32 +03:00
Gerd Hoffmann
8c0f2787ab build: s/HUGE/INFINITY/
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-21 15:08:32 +03:00
Gerd Hoffmann
205193f255 build: only check for x11 extensions when
building for x11 platform.
2011-07-21 15:08:32 +03:00
Gerd Hoffmann
4492f4854e build: alsa is needed on linux only.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-21 15:08:32 +03:00
Alon Levy
58f79a98b6 server/tests: Makefile.am: use AM_LDFLAGS instead of LDFLAGS 2011-07-21 15:08:32 +03:00
Alon Levy
ae7659fea9 server/red_channel: error channel if alloc_msg_buf fails (returns NULL) 2011-07-21 15:08:32 +03:00
Hans de Goede
ce516b0bdf spicec: Make loglevel configurable through the environment
Having a loglevel variable is much more useful if we can actually change
its value without a recompile. Use a SPICEC_LOG_LEVEL environment variable so
we can do this from the spice xpi / activex too (by setting the environment
variable before starting the browser).
2011-07-20 13:43:17 +02:00
Gerd Hoffmann
89accad2bf server: add symbol versioning to the spice server shared library.
This patch adds symbol versions to the spice server library.  Each
symbol which is exported by libspice-server gets tagged with the
(stable) version where it appeared first.  This way the linker and rpm
are able to figure which version of the spice-server libary is required
by a particular qemu binary/package.

[ 0.8 branch: drop 0.10 symbols from list ]

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-19 14:41:10 +02:00
Yonit Halperin
4f0e0ac712 client: fix for redundant shift+f11 RHBZ #674532
After shift+F11, both in Windows 7 and xp clients, WM_KEYUP events were missing for
SHIFT and F11. For F11 it was less important since unpress_all was preformed for all keys.
However, we perform sync for all the keyboard modifiers and the GetKeyboardState returns "down" for shift.
In windows7 client, we sometimes received afterwards a F11 KEYDOWN event repetition, and this caused SHIFT+F11 to be called again.
Not performing hiding of the windows while changing client resolutions, solved the problem of missing events, and I don't see any difference
in how spice looks while toggling to full screen.
Using GetAsyncKeyState, returns "UP" for shift in windows 7, and helps avoid performing shift+f11 again, if there is an F11 repetition
before we receive the KEYUP event for shift.
2011-06-14 10:08:32 +03:00
Alon Levy
529dc40dc3 server/smartcard: fix use after free 2011-05-24 16:11:26 +03:00
Arnon Gilboa
31358b640b client/windows: init PACKAGE_VERSION
in windows, we set PACKAGE_VERSION to the binary version
since we don't have config.h as generated by linux configure
2011-05-24 12:29:13 +03:00
Yonit Halperin
04595c74ad client: fix flipped video in Linux guest on windows client, RHBZ #667689
Video streams from Linux guests are oriented top-down, where gdi_canvas_put_image always
received display context for down-top oriented bitmap. I fixed create_bitmap
to consider the stream orientation.
2011-05-19 14:07:57 +03:00
Alon Levy
f73a05021c client: fix return code when missing host 2011-05-12 12:56:04 +03:00
Hans de Goede
9a03fbcbe4 Release 0.8.1 2011-04-20 10:51:32 +02:00
Christophe Fergeau
e733aee0f2 client: skip spaces in --host-subject
This fixes fdo bug #32896:

"Subject in certificates is stored in following format (values separated by
comma and space):

grep Subject: server-cert.pem | awk -F": " '{print $2}'
O=REDHAT, CN=10.34.58.2

While spicec expects that values in host subject are separated only by comma:

spicec --host-subject "O=REDHAT,CN=10.34.58.2"
"

In this case, ignoring spaces make it much easier to directly copy and paste
the subject line from certificates.
2011-04-20 10:47:18 +02:00
Christophe Fergeau
1d61c0211e client: add --version cmdline option to spicec
This fixes freedesktop bug #33907
2011-04-20 10:45:14 +02:00
Christophe Fergeau
4bcb62f9a1 client: s/AVAILIBLE/AVAILABLE in CmdLineParser
It was mispelt in a CmdLineParser enum.
2011-04-20 10:45:10 +02:00
Hans de Goede
443994ba87 server: make sure we clear vdagent and update mouse mode on agent disconnect
The check this patch removes causes us to not set vdagent to NULL, nor
update the mouse mode when the guest agent disconnects when no client is
attached. Which leads to a non working mouse, and on agent reconnect a
"spice_server_char_device_add_interface: vdagent already attached" message
instead of a successful re-add of the agent interface .
2011-04-01 16:46:55 +02:00
Hans de Goede
620a02da31 server: ignore SPICE_MSGC_MAIN_AGENT_START messages when there is no agent
This can happen for example when a SPICE_MSGC_MAIN_AGENT_START message
from the client and the vdagent disconnecting race.
2011-04-01 16:45:50 +02:00
Hans de Goede
2df49c8a67 server: hookup agent-msg-filter discard-all functionality
This ensures that if the client or agent connects to the client-agent
"tunnel" while the other side is halfway through sending a multi part
message, the rest of the message gets discarded, and the connecting
party starts getting data at the beginning of the next message.
2011-04-01 16:31:37 +02:00
Hans de Goede
5d7cf4c002 server: add discard all option to agent message filter 2011-04-01 14:22:44 +02:00
Hans de Goede
1ec316e561 server: filter all data from client
Filter all data from client, even when there is no agent connected
to keep filter state correct.
2011-04-01 14:14:00 +02:00
Hans de Goede
add4bedb2f server: reset read/write filter on agent/client disconnect
The agent message filter keeps track of messages as they are being send
reset the relevant filter to its initial state when one of the 2 ends
of the agent<->client "tunnel" disconnects.
2011-04-01 14:08:56 +02:00
Hans de Goede
a19f51265c server: break read_from_vdi_port loop if the guest gets disconnected
read_from_vdi_port calls dispatch_vdi_port data, which will disconnect
the guest agent if it sends invalid data. It would then try to read more
data from the disconnected guest agent resulting in a NULL ptr dereference,
this patch fixes this.
2011-04-01 11:13:50 +02:00
Hans de Goede
7cc85f33be server: Don't stop writing agent data to the guest when the client disconnects
write_to_vdi_port() was checking for reds->agent_state.connected to determine
wether it could write queued data. But agent_state.connected reflects if
*both* ends are connected. If the client has disconnected, but the guest agent
is still connected and some data is still pending (like a final clipboard
release from the client), then this data should be written to the guest agent.
2011-04-01 11:13:50 +02:00
Hans de Goede
ef6886732e server: Don't reset agent state when the client disconnects
We were calling reds_reset_vdp on client disconnect, which is not a good
idea. reds_reset_vdp does 3 things:

1) It resets the state related to reading chunks from the spicevmc virtio
   port. If the client disconnects while the guest agent is in the middle
   of sending a chunk, this will lead to an inconsistent state, and lots
   of printing of "dispatch_vdi_port_data: invalid port" messages caused
   by this inconsistent state sometimes followed by a segfault.

   This can be triggered by copy and pasting something large (say
   a screenshot) from the guest to the spice-gtk client, as the spice-gtk
   client currently has a bug causing it to crash when receiving a multi
   chunk vdagent messages. Without this patch (and with the spice-gtk bug
   present) I can consistently reproduce this.

2) It clears any buffered writes from the client to the guest still pending
   because the virtio port cannot consume data fast enough. Since the agent
   itself is still running fine, throwing away writes for it because the
   client has disconnected makes no sense. Esp, since on clean exit the
   client may very well send a clipboard release message directly
   before closing the connection, and this may get lost this way.

3) It sets client_agent_started to false, this is the only thing which
   actually makes sense to do on client disconnect.

Note that since we no longer reset the vdp state on client disconnect, we
must now reset it on agent disconnect even if we don't have a client. So
the reds_reset_vdp call in reds_agent_remove() gets moved to the top,
above both the agent_state.connected and reds->peer checks which will
both fail in the no client case.
2011-04-01 11:13:46 +02:00
Hans de Goede
302ab69f5b server: Make copy paste support configurable
Also bump SPICE_SERVER_VERSION to 0x000801 as 0.8.1 will be the
first version with the new API for this, and we need to be able to
detect the presence of this API in qemu.
2011-03-24 17:24:31 +01:00
Hans de Goede
0417117417 spice-server: Add the ability to filter agent messages 2011-03-24 17:24:31 +01:00
Hans de Goede
6696914bd9 spicec-x11: Work around a bug in xsel
Although ICCCM 2.2. Responsibilities of the Selection Owner:
http://tronche.com/gui/x/icccm/sec-2.html#s-2.2

Clearly states (about selection notify events):
The owner should set the specified selection, target, time, and property
arguments to the values received in the SelectionRequest event.

xsel sets the selection notify event target member to the incr atom when it
is going to send the clipboard data incremental, rather then setting it to
the UTF8_STRING atom (which was the target of the SelectionRequest).

Work around this (esp as it is likely other programs may get this wrong too)
and accept the incr atom as a valid target in a selection notify event.

This fixes Alon's test with running:
python -c "print list(range(1000))" | xsel -i -b
on the client.
2011-03-23 17:50:05 +01:00
Hans de Goede
69067b14e0 spicec-x11: Don't crash on apps sending bad atoms as TARGETS
Some apps (bad xsel, bad!) send invalid Atoms in their TARGETS property,
causing spicec to exit because of an XError. This patch makes spicec survive
this scenario.

For more info on the xsel bug, see:
https://bugzilla.redhat.com/show_bug.cgi?id=690214
2011-03-23 17:49:57 +01:00
Hans de Goede
b30f8b877c client: Don't handle hotkeys while sticky alt is active
In some cases rhev-m changes the hotkey for releasing the mouse grab
to ctrl + alt. This makes it impossible to send ctrl + alt + other-key
to the guest, even when using sticky alt.

What happens is:
-press alt until sticky alt activates
-release alt (but recorded state stays pressed due to sticky alt)
-press ctrl
-hotkey code sees ctrl+alt pressed, releases mouse grab
-mouse grab release code does an unpress all -> end of sticky state.

This patch makes it possible to atleast send ctrl + alt + del (or other key)
using sticky alt. Note: even with this patch it is still a bad idea to
use ctrl + alt as hotkey combi.
2011-03-11 15:31:27 +01:00
Alon Levy
5315888a70 server/reds: allow call to reds_agent_remove even if it is gone
The current assert(reds->agent_state.connected) tiggers if when
the agent disconnected there was still data waiting to be sent (for
instance if there is a bug in the client handling clipboard and it
is killed while a large clipboard transfer is in progress). So first
call to reds_agent_remove happens from spice_server_char_device_remove_interface,
and then it is called again (triggering the assert) from free_item_data
from read_from_vdi_port because of the channel destruction.

Other option would be to not call it from one of the paths - but that
is suboptimal:
 * if there is no data in the pipe, the second call never happens.
 * the second call has to be there anyway, because it may fail during
  parsing data from the agent.

This patch fixes a segfault on this assert when a client starts passing
from guest agent to client a large clipboard and dies in the middle. There
is still another assert happening occasionally at marshaller which I don't
have a fix for (but it doesn't seem to be related).
2011-03-08 21:49:21 +02:00
Alon Levy
e1ec222e8b client/smartcard: handle the --smartcard-db option 2011-03-08 21:19:23 +02:00
Hans de Goede
7fd8b7c971 Release 0.8.0 2011-03-01 19:40:36 +02:00
Hans de Goede
1a20edffed x11: Use _exit rather then exit on X errors (rhbz#680763)
This avoids us trying to restore the original resolution when we're fullscreen
and an X error happens. As restoring fullscreen is a bad idea then as this
involves making more X calls, which can get us stuck (in side an XLockDisplay
call for example).
2011-03-01 19:40:36 +02:00
Uri Lublin
eda812f0d7 client: exit nicely for --controller with no SPICE_XPI_SOCKET (rhbz#644292)
When starting spicec with --controller, SPICE_XPI_SOCKET environment
variable must be defined so spicec and the controller can be connected.
2011-03-01 19:40:36 +02:00
Hans de Goede
a0996e0f70 Fix keyb modifiers not syncing from client to client os (rhbz#679467) 2011-03-01 19:40:36 +02:00
Gerd Hoffmann
aa827c5b99 fix spice-server segfault on migration
spice-server tries to use the migration information without checking
whenever this is available in the first place ...

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-02-15 11:24:28 +01:00
Hans de Goede
822fea8b32 Release 0.7.3 2011-02-11 15:37:54 +01:00
Hans de Goede
f173a38de7 Drop static_title.bmp from windows/Makefile.am 2011-02-11 15:37:54 +01:00
Alon Levy
09d843ccb6 update required minimal libcacard to 0.1.2 2011-02-10 10:35:04 +02:00
Alon Levy
f94d08cf3f client/smartcard: libcacard dropped ReaderAddResponse
uses VSC_Error with code==VSC_SUCCESS instead. This means that the VSC_Error
message is overloaded. Instead of the other option of adding a message id,
since the connection is TCP so no messages may be dropped or reordered, by
having each message followed by a response there is no ambiguity. Still
this commit adds a queue for messages that we only have one of which outstanding
at a time, i.e. send, wait for response, send the next, etc. This further
simplifies the logic, while not adding much overhead since only when spicec
starts up it has a situation where it needs to send two events (ReaderAdd
and ATR for Card Insert).
2011-02-10 10:34:58 +02:00
Alon Levy
5ed4050992 server/smartcard: don't push our own error on reader add
The device already sends one. There are actually two connections going
on:
 server to client - this is the smartcard channel, it reuses the VSC protocol.
 server to device - this is an internal connection using VSC too.

We generally just passthrough all messages from the client to the device,
and from the device to the client. We only rewrite the reader_id because
the device knows about a single id (it is actually a card id), and we
may manage more then one in the future.

Bottom line is that there was an extra VSC_Error message reaching the client.
2011-02-10 10:34:53 +02:00
Alon Levy
17ba06da2c client/smartcard: ignore VSC_Init 2011-02-10 10:34:47 +02:00