modified 64bit build error
[sdk/emulator/libs/spice-server.git] / ChangeLog
1 2013-07-17  Uri Lublin  <uril@redhat.com>
2
3         Release 0.12.4
4
5         Update spice-common submodule (get spice-protocol 0.12.6)
6
7         syntax-check: trailing whitespaces -- ignore binary files
8
9 2013-07-16  Uri Lublin  <uril@redhat.com>
10
11         syntax-check: remove trailing whitespaces
12         Only whitespace changes in this commit.
13
14         syntax-check: make sure config.h is the first included .h file
15
16         syntax-check: use test A && test B instead of test A -a B
17
18         syntax-check: fix no-newline or empty line at EOF
19
20         syntax-check: s/the the/the/ in a comment
21
22         syntax-check: update AUTHORS
23
24         syntax-check: fix cast_of_argument_to_free
25         In this case, make syntax-check is wrong, and we actually do
26         need the cast.
27         A cast is needed when types are   uint64_t <--> pointer
28
29         Using a local "ptr" variable makes both gcc and syntax-check happy.
30
31         syntax-check: fix avoid_if_before_free
32
33         server/tests: fix timer for test_empty_success
34
35         server/tests: test_display_width_stride: add destroy command
36         Otherwise, the test exits after the first iteration over all tests,
37         on the second attempt to create an already created surface.
38
39         server/tests: remove option from usage if AUTOMATED_TESTS is not configured
40
41         server/tests: invalid-option: print the bad argument
42         optind points to the next argument to parse.
43
44         server/tests: fix produce_command for create surface
45         Earlier in this function, test->target_surface is set to 1, which
46         is the only allowed non-primary surface currently.
47
48         If surface parameters are given (and specifically data is checked)
49         they are being used, otherwise a default surface is used.
50
51         Earlier in this function, "command" is set to a non-NULL value.
52         Thus, the else part was unreachable code, which is fixed now.
53
54         server/tests: test_display_base: set rect according to appropriate surface
55         When surface_id == 0, primary is used.
56         Otherwise (currently 1), secondary is used.
57
58         Also, remove unused test_width and test_height.
59         Since commit caea7699434c20dceef8fc79d21b8eeb663fbf53,
60         test->width and test->height are used.
61
62         red_channel: replace RING_FOREACH with RING_FOREACH_SAFE in some places
63         This was originally intended to fix the problem fixed by
64         commit 53488f0275d6c8a121af49f7ac817d09ce68090d.
65
66         What is left are FOREACH loops that are at less risk and maybe safe (no
67         read/write or disconnect/destroy are called from within them).
68
69         red_worker: use a generic SAFE_FOREACH macro
70         Introduce SAFE_FOREACH macro
71
72         Make other safe iterators use SAFE_FOREACH
73
74         red_worker: delete unused CCC_FOREACH
75
76         red_worker: make DRAWABLE_FOREACH_DPI safe
77
78         red_worker: use only DRAWABLE_FOREACH_GLZ_SAFE
79
80         red_worker: make WORKER_FOREACH_DCC safe
81         Specifically, the loop in red_pipes_add_draw can cause spice to abort.
82
83         In red_worker.c (WORKER_FOREACH_DCC):
84           red_pipes_add_drawable
85             red_pipe_add_drawable
86               red_handle_drawable_surfaces_client_synced
87                 red_push_surface_image
88                   red_channel_client_push
89                     red_channel_client_send
90                       red_peer_handle_outgoing
91                         reds_stream_writev (if fails -- EPIPE)
92                         handler->cb->on_error = red_channel_client_disconnect()
93                           red_channel_remove_client()
94                           ring_remove() -- of rcc from channel.clients ring.
95
96         red_worker: reuse DCC_FOREACH in WORKER_DCC_FOREACH
97         The only thing that is needed is to get the channel out of the worker.
98
99         red_worker: use only RCC_FOREACH_SAFE
100         RCC_FOREACH may be dangerous
101
102         The following patches replace FOREACH loops with a SAFE version.
103         Using unsafe loops may cause spice-server to abort (assert fails).
104         Specifically a read/write fail in those loops, may cause the client
105         to disconnect, removing the node currently iterated, which cause spice
106         to abort in ring_next():
107          -- assertion `pos->next != NULL && pos->prev != NULL' failed
108
109 2013-07-05  David Gibson  <david@gibson.dropbear.id.au>
110
111         Use RING_FOREACH_SAFE in red_channel.c functions which are missing it
112         Currently, both red_channel_pipes_add_type() and
113         red_channel_pipes_add_empty_msg() use plaing RING_FOREACH() which is not
114         safe versus removals from the ring within the loop body.
115
116         Although it's rare, such a removal can occur in both cases.  In the case
117         of red_channel_pipes_add_type() we have:
118             red_channel_pipes_add_type()
119             -> red_channel_client_pipe_add_type()
120                 -> red_channel_client_push()
121
122         And in the case of red_channel_client_pipes_add_empty_msg() we have:
123             red_channel_client_pipes_add_empty_msg()
124             -> red_channel_client_pipe_add_empty_msg()
125                 -> red_channel_client_push()
126
127         But red_channel_client_push() can cause a removal from the clients ring if
128         a network error occurs:
129             red_channel_client_push()
130             -> red_channel_client_send()
131                 -> red_peer_handle_outgoing()
132                     -> handler->cb->on_error callback
133                     =  red_channel_client_default_peer_on_error()
134                         -> red_channel_client_disconnect()
135                             -> red_channel_remove_client()
136                                 -> ring_remove()
137
138         When this error path does occur, the assertion in RING_FOREACH()'s
139         ring_next() trips, and the process containing the spice server is aborted.
140         i.e. your whole VM dies, as a result of an unfortunately timed network
141         error on the spice channel.
142
143         Please apply.
144
145 2013-06-25  Yonit Halperin  <yhalperi@redhat.com>
146
147         red_worker: fix for stuck display_channel over WAN (jpeg_enabled=true)
148         The image descriptor flags shouldn't be copied as is from the flags that
149         were set by the driver. Specifically, the CACHE_ME flag shouldn't be copied,
150         since it is possible that (a) the image won't be cached (b) the image
151         is already cached, but in its lossy version, and we may want to set the bit for
152         CACHE_REPLACE_ME, in order to cache it in its lossless version.
153         In case (b), the client first looks for the CACHE_ME flag, and only if
154         it is not set it looks for CACHE_REPLACE_ME (see canvas_base.c). Since both flags where set,
155         the client ignored REPLACE_ME, and didn't turned off the lossy flag of the
156         cach item. Then, when a request from this lossles item reached the
157         client (FROM_CACHE_LOSSLESS), the client display channel waited
158         endlessly for the lossless version of the image.
159
160 2013-06-24  Yonit Halperin  <yhalperi@redhat.com>
161
162         red_worker: improve stream stats readability and ease of parsing
163         also added start/end-bit-rate and avg-quality to the final stream stats.
164
165         mjpeg_encoder: add mjpeg_encoder_get_stats
166
167         spice: silencing most of the ping/pong logging
168         Those messages are too frequent and don't contribute much
169
170 2013-06-06  Hans de Goede  <hdegoede@redhat.com>
171
172         server: Add support for filtering out agent file-xfer msgs (rhbz#961848)
173
174 2013-05-24  Yonit Halperin  <yhalperi@redhat.com>
175
176         red_channel: replace an assert upon threads mismatch with a warning
177         The assert:
178         spice_assert(pthread_equal(pthread_self(), client->thread_id))
179         and the assert:
180         spice_assert(pthread_equal(pthread_self(), rcc->channel->thread_id))
181         were coded in order to protect data that is accessed from the main
182         context (red_client and most of the channels), from
183         access by threads of other channels (namely, the display and cursor
184         channels), and vice versa.
185         However, some of the calls to the sound channel interface,
186         and also the char_device interface, can be done from the vcpu thread.
187         It doesn't endanger these channels internal data, since qemu use global
188         mutex for the vcpu and io threads.
189         Thus, pthread_self() can be !=  channel->thread_id, if one of them is
190         the vcpu thread and the other is the io-thread, and we shouldn't assert.
191
192         Future plans: A more complete and complicated solution would be to manage our own thread for
193         spice-channels, and push input from qemu to this thread, instead of
194         counting on the global mutex of qemu
195
196         rhbz#823472
197
198 2013-05-23  Yonit Halperin  <yhalperi@redhat.com>
199
200         main_channel: fix double release of migration target data
201         If client_migrate_info was called once with cert-host-subject and
202         then again without cert-host-subject, on a third call to
203         client_migrate info, the cert-host-subject from the first call would
204         have been freed for the second time.
205
206 2013-05-19  Christophe Fergeau  <cfergeau@redhat.com>
207
208         Log actual address spice-server binds to
209         It's not always obvious what address spice-server will bind to,
210         in particular when the 'addr' parameter is omitted on QEMU
211         commandline. The decision of what address to bind to is made
212         in reds_init_socket with a call to getaddrinfo. Surprisingly,
213         that function had a call to getnameinfo() already, but it does
214         not seem to be using the result of that call in any way.
215         This commit moves this call after the socket is successfully bound
216         and add a log message to indicate which address it's bound to.
217
218 2013-05-17  Alon Levy  <alevy@redhat.com>
219
220         0.12.3 release
221
222         server/red_parse_qxl: two coding convention pointer cast fix
223
224         server/dispatchers: initialize stack to 0 for valgrind
225
226         server/red_dispatcher: close pa hole in RedWorkerMessageDisplayConnect for valgrind
227
228         server/tests: test_display_width_stride
229
230         server/red_worker: simplify monitors_config update
231
232         server/tests/test_display_base: add missing set_client_capabilities, fix client_monitors_config signature
233
234         server/red_worker: turn critical (assert) non error into warning
235         The situation causing this assert is unknown but it doesn't cause
236         correctness issues with later rendering, and it is causing an abort.
237
238         server/red_worker: s/driver_has_monitors_config/driver_cap_monitors_config/ (plus small comment)
239
240 2013-05-10  Yonit Halperin  <yhalperi@redhat.com>
241
242         red_worker: don't get bit_rate from main_channel_client, if it wasn't initialized
243         When setting an initial video stream bit rate, if the bit rate
244         wasn't calculated by main_channel_client, and we don't have
245         estimation from previos streams, use some default values.
246         The patch also removes updating dcc->streams_max_bit_rate when
247         the bit_rate held by the main_channel is larger than it. It is not necessary
248         since we compare those 2 values each time we set the initial bit rate
249         for a stream.
250
251 2013-05-08  Yonit Halperin  <yhalperi@redhat.com>
252
253         reds: fix memory leak when core->base.minor_version < 3
254
255         reds: move handle_channel_event logic from main_dispatcher to reds
256         main_dispactcher role is to pass events to the main thread.
257         The logic that handles the event better not be inside main_dispatcher.
258
259         red_worker: fail handle_migrate_data instead of aborting when there is an error during restoration of surfaces
260
261         red_channel: notify and shutdown a channel client when its handle_migrate_data fails
262
263         red_channel: add spice_channel_client_error
264         spice_channel_client_error prints warning and shutdowns the
265         channel_client that hit the error.
266         This macro is useful for errors that are specific for one session
267         and that are unrecoverable only with respect to this session.
268         Prefer disconnecting a client over aborting when possible.
269
270         red_worker: fix incorrect is_low_bandwidth after migrating a low bandwidth connection
271         rhbz#956345
272
273         After a spice session has been migrated, we don't retest the network
274         (user experience considerations). Instead, we obtain the is_low_bandwidth flag
275         from the src-server, via the migration data.
276         Before this patch, if we migrated from server s1 to s2 and then to s3,
277         and if the connection to s1 was a low bandwidth one, we erroneously
278         passed is_low_bandwidth=FALSE from s2 to s3.
279
280         Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
281
282         red_worker: cleanup: add is_low_bandwidth flag to CommonChannelClient
283         Replace the mixed calls to display_channel_client_is_low_bandwidth
284         and to main_channel_client_is_low_bandwidth, with one flag in
285         CommonChannelClient that is set upon channel creation.
286
287         main_channel: add routine for checking if a network test had been conducted and completed
288
289 2013-05-05  Alon Levy  <alevy@redhat.com>
290
291         red_worker: remove wrong TODO
292         red_create_stream is called even without any client but there is no
293         encoding since the mjpeg encoder is now associated with StreamAgent
294         which is only created when we have a client.
295
296 2013-05-01  Yonit Halperin  <yhalperi@redhat.com>
297
298         red_channel: on migration target, start sending ping messages only after the client's migration has completed
299         The connection to the target server is established before migration
300         starts. However, the client reads and replies to messages from the server only after
301         migration completes. Thus, we better not send ping msgs from the target
302         before migration completes (because the observed roundtrip duration will
303         be bigger than the real one).
304
305         red_channel: stop sending ping messages after migration has completed
306         We mustn't send any msg to the client, besides MSG_MIGRATE_DATA, after
307         we send MSG_MIGRATE.
308
309         reds: fix not sending the mm-time after migration when there is no audio playback
310         This bug results in the client dropping all the video frames after
311         migration in case that (1) the hosts involved in migration have different
312         mm-time; and that (2) there is no audio playback.
313         This is relvant only for the client that was connected during the
314         migration.
315
316         rhbz#958276
317
318 2013-04-30  Yonit Halperin  <yhalperi@redhat.com>
319
320         red_channel: fix not handling self pipe items in red_channel_client_release_item
321         When a client disconnects, red_channel_client_pipe_clear is called.
322         Releasing pipe items of type == MIGRATE||EMPTY_MSG||PING
323         wasn't handled, and was passed to channel_cbs.release_item.
324         There, an error occured since the pipe items were not recognized.
325
326 2013-04-24  Hans de Goede  <hdegoede@redhat.com>
327
328         server: Add public spice_qxl_driver_unload method
329         With a SPICE_DISPLAY_CAP_MONITORS_CONFIG capable client, the client needs to
330         know what part of the primary to use for each monitor. If the guest driver
331         does not support this, the server sends messages to the client for a
332         single monitor spanning the entire primary.
333
334         As soon as the guest calls spice_qxl_monitors_config_async once, we set
335         the red_worker driver_has_monitors_config flag and stop doing this.
336
337         This is a problem when the driver gets unloaded, for example after a reboot
338         or when switching to a text vc with usermode mode-setting under Linux.
339
340         To reproduce this start a multi-mon capable Linux guest which uses
341         usermode mode-setting and then once X has started switch to a text vc. Note
342         how the client window does not only not resize, if you try to resize it
343         manually you always keep blackborders since the aspect is wrong.
344
345         This patch is the spice-server side of fixing this, it adds a new
346         spice_qxl_driver_unload method which clears the driver_has_monitors_config
347         flag.
348
349         The other patch needed to fix this is in qemu, and will calls this new method
350         from qxl_enter_vga_mode.
351
352 2013-04-22  Yonit Halperin  <yhalperi@redhat.com>
353
354         red_worker: assign mm_time to vga frames
355
356         red_worker: increase the interval limit for stream frames
357
358         collect and print video stream statistics
359
360         server/red_worker: add an option to supply the bandwidth via env var
361         SPICE_BIT_RATE can be set for supplying red_worker the available
362         bandwidth (in Mbps).
363
364         server/red_worker.c: use the bit rate of old streams as a start point for new streams
365         mjpeg_encoder modify the initial bit we supply it, according to the
366         client feedback. If it reaches a bit rate which is higher than the
367         initial one, we use the higher bit rate as the new bit rate estimation.
368
369         red_worker: video streams - adjust client playback latency
370
371         reds: support mm_time latency adjustments
372         When there is no audio playback, we set the mm_time in the client to be older
373         than the one in the server by at least the requested latency (the delta is
374         actually bigger, due to the network latency).
375         When there is an audio playback, we adjust the mm_time in the client by
376         adjusting the playback buffer using SPICE_MSG_PLAYBACK_LATENCY.
377
378         snd_worker: support sending SPICE_MSG_PLAYBACK_LATENCY
379         also update spice-common submodule
380
381         dispatcher.h: fix - s/#define MAIN_DISPATCHER_H/#define DISPATCHER_H
382
383         red_worker: ignoring video frame drops that are not due to pipe congestion
384         A frame can be dropped if a new frame was added during the same
385         call to red_process_command (we didn't attempt to send the older
386         frame). Such drops are ignored.
387
388         red_worker: notify mjpeg_encoder on server frame drops
389
390         red_worker: support SPICE_MSGC_DISPLAY_STREAM_REPORT
391         update mjpeg_encoder with reports from the client about
392         the playback quality.
393         The patch also updates the spice-common submodule.
394
395         red_worker: start using mjpeg_encoder rate control capabilities
396         This patch only employs setting the stream parameters based on
397         the initial given bit-rate, the latency, and the encoding size.
398         Later patches will also employ mjpeg_encoder response to client reports,
399         and its control over frame drops.
400
401         The patch also removes old stream bit rate calculations that weren't
402         used.
403
404         server/red_worker: enable latency monitoring in the display channel
405
406         red_worker: stream - update periodically the input frame rate
407         Periodically calculate the rate of frames arriving from the guest to the
408         server.
409
410         red_channel: monitor connection latency using MSG_PING
411
412         server/red_worker: assign timer callbacks to worker_core, using spice_timer_queue
413         display channel - supplying timeouts interface to red_channel, in order to allow
414         periodic latency monitoring (see next patch).
415
416         server: spice_timer_queue
417         Each thread can create a spice_timer_queue, for managing its
418         own timers.
419
420         mjpeg_encoder: add stream warmup time, in which we avoid server and client drops
421         The stream starts after lossless frames were sent to the client,
422         and without rate control (except for pipe congestion). Thus, on the beginning
423         of the stream, we might observe frame drops on the client and server side which
424         are not necessarily related to mis-estimation of the bit rate, and we would
425         like to wait till the stream stabilizes.
426
427         mjpeg_encoder: keep the average observed fps similar to the defined fps
428         The actual frames distribution does not necessarily fit the
429         condition "at least one frame every (1000/rate_contorl->fps)
430         milliseconds".
431         For keeping the average frame rate close to the defined fps, we
432         periodically measure the current average fps, and modify
433         rate_control->adjusted_fps accordingly. Then, we use
434         (1000/rate_control->adjusted_fps) as the interval between the
435         frames.
436
437         mjpeg_encoder: move the control over frame drops to mjpeg_encoder
438
439         mjpeg_encoder: update the client with estimations for the required playback latency
440         The required client playback latency is assessed based on the current
441         estimation of the bit rate, the network latency, and the encoding size
442         of the frames. When the playback delay that is reported by the client
443         seems too small, or when the stream parameters change, we send the
444         client an updated playback latency estimation.
445
446         mjpeg_encoder: modify stream bit rate based on server side pipe congestion
447         Downgrading stream bit rate when the input frame rate in the server
448         exceeds the output frame rate, and frames are being dropped from the
449         output pipe.
450
451         mjpeg_encoder: adjust the stream bit rate based on periodic client feedback
452         mjpeg_encoder can receive periodic reports about the playback status on
453         the client side. Then, mjpeg_encoder analyses the report and can
454         increase or decrease the stream bit rate, depending on the report.
455         When the bit rate is changed, the quality and frame rate of the stream
456         are re-evaluated.
457
458         mjpeg_encoder: re-configure stream parameters when the frame's encoding size changes
459         If the encoding size seems to get smaller/bigger, re-evaluate the
460         stream quality and frame rate.
461
462         mjpeg_encoder: configure mjpeg quality and frame rate according to a given bit rate
463         Previously, the mjpeg quality was always 70. The frame rate was
464         tuned according to the frames' congestion in the pipe.
465         This patch sets the quality and frame rate according to
466         a given bit rate and the size of the first encoded frames.
467
468         The following patches will introduce an adaptive video streaming, in which
469         the bit rate, the quality, and the frame rate, change in response to
470         different parameters.
471
472         Patches that make red_worker adopt this feature will also follow.
473
474         server/red_worker: streams: moving mjpeg_encoder from Stream to StreamAgent
475         The mjpeg_encoder should be client specific, and not shared between
476         different clients**, for the following reasons:
477         (1) Since we use abbreviated jpeg datastream for mjpeg, employing the same
478             mjpeg_encoder for different clients might cause errors when the
479             clients decode the jpeg data.
480         (2) The next patch introduces bit rate control to the mjpeg_encoder.
481             This feature depends on the bandwidth available, which is client
482             specific.
483
484         ** at least till we change multi-clients not to re-encode the same
485            streams.
486
487         red_worker: stream agent - fix miscounting of frames
488         Frames counting was skipped when the previous frame was already
489         sent completely to the client.
490
491 2013-04-19  Hans de Goede  <hdegoede@redhat.com>
492
493         snd_worker: Make sure we never send an empty volume message
494         My commit 71315b2e "snd_worker: Don't send empty audio-volume messages",
495         fixes only one case of sending an empty volume message, if the client connects
496         to a vm early during its boot sequence, while the snd hardware is being reset
497         by the guest driver, qemu will call spice_server_playback_set_volume() with
498         0 channels from the reset handler.
499
500         This patch also applies both fixes to the record channel.
501
502 2013-04-10  Hans de Goede  <hdegoede@redhat.com>
503
504         spice-common: Update
505
506 2013-04-08  Yonit Halperin  <yhalperi@redhat.com>
507
508         red_worker.c: fix not destroying streams before sending MSG_MIGRATE
509         When qemu migration completes, we need to stop the streams, and to send
510         the corresponding upgrade_items to the client.
511         Otherwise, (1) the client might display lossy regions that we don't track
512         (streams are not part of the migration data).
513         (2) streams_timeout may occur after MSG_MIGRATE has been sent, leading
514         to messages being sent to the client after MSG_MIGRATE and before
515         MSG_MIGRATE_DATA (e.g., STREAM_CLIP, STREAM_DESTROY, DRAW_COPY).
516         No message besides MSG_MIGRATE_DATA should be sent after
517         MSG_MIGRATE.
518
519         When a msg other than MIGRATE_DATA reached spice-gtk after MSG_MIGRATE,
520         spice-gtk sent it to dest server as the migration data, and the dest
521         server crashed with a "bad message size" assert.
522
523         red_worker.c: s/red_display_destroy_streams/red_display_destroy_streams_agents
524         In order not to confuse it with red_destroy_streams in the following
525         patch.
526
527 2013-04-01  Hans de Goede  <hdegoede@redhat.com>
528
529         snd_worker: Don't send empty audio-volume messages
530         If no volume has been set it, we end up sending a volume message with
531         audio-volume for 0 channels (iow an empty message). This is not useful
532         and triggers the following warning in spice-gtk:
533
534         (remote-viewer:8726): GSpice-WARNING **: set_sink_input_volume() failed:
535         Invalid argument
536
537 2013-03-29  Hans de Goede  <hdegoede@redhat.com>
538
539         char_device: Don't set active when stopped and don't access dev after unref
540         2 closely related changes in one:
541         1) When leaving the read or write loop because the chardev has been stopped
542         active should not be updated. It has been set to FALSE by
543         spice_char_device_stop and should stay FALSE
544         2) The updating of dev->active should be done *before* unref-ing dev
545
546         char_device: Don't set the write-retry timer when not running
547         The write-retry timer should not be set when we're leaving
548         spice_char_device_write_to_device because the char-dev has been stopped.
549
550         char_device: Properly update buffer status when leaving the write loop on stop
551         Before this patch the write-loop in spice_char_device_write_to_device would
552         break on running becoming 0, after having written some data, without updating
553         the buffer status, causing the same data to be written *again* when started.
554
555 2013-03-15  Hans de Goede  <hdegoede@redhat.com>
556
557         inputs-channel: Don't send insecure keyb notify to in migrate client
558         This fixes spice-gtk printing message like these on migration:
559         (remote-viewer:18402): GSpice-CRITICAL **: spice_channel_iterate_read: assertion `c->state != SPICE_CHANNEL_STATE_MIGRATING' failed
560
561         inputs-channel: Handle printing of insecure keyboard notify
562         This is clearly something which should be handled in the inputs_channel code,
563         rather then having a special case for it in the generic channel handling
564         code in reds.c. Moving it here also fixes the TODO we had on only sending
565         this message to new clients.
566
567         main-channel: Add a main_channel_client_push_notify function
568         Sometimes we want to send a notify to a single client, rather then to
569         all of them.
570
571         main-channel: Make main_channel_push_notify deal with dynamic memory
572         Currently main_channel_push_notify only gets passed a static string, but
573         chances are in the future it may get passed dynamically allocated strings,
574         prepare it for this.
575
576         While at it also make clear that its argument is a string, and simplify
577         things a bit by making use of this knowledge (pushing the strlen call down).
578
579 2013-03-07  Hans de Goede  <hdegoede@redhat.com>
580
581         server/reds: Send the agent a CLIENT_DISCONNECTED msg on client disconnect
582         Client -> agent messages can spawn multiple VDIChunks. When this happens
583         the agent re-assembles the chunks into a complete VDAgentMessage before
584         processing it. The server only guarentees coherency at the chunk level,
585         so it is not possible for a partial chunk to get delivered to the agent.
586
587         But it is possible for some chunks of a VDAgentMessage to be delivered to
588         the agent followed by a client to disconnect without the rest of the
589         VDAgentMessage being delivered!
590
591         This will leave the agent in a wrong state, and the first messages send to it
592         by the next client to connect will get seen as the rest of the VDAgentMessage
593         from the previous client.
594
595         This patch sends the agent a new VD_AGENT_CLIENT_DISCONNECTED message from the
596         VDP_SERVER_PORT, on which the agent can then reset its VDP_CLIENT_PORT state.
597
598         Note that no capability check is done for this, since the capabilities are
599         something negotiated between client and agent. The server will simply always
600         send this message on client disconnect, relying on older agents discarding the
601         message since it has an unknown type (which both the windows and linux agents
602         already do).
603
604         char_device: Add spice_char_device_write_buffer_get_server_no_token()
605         To allow the server to send agent messages without needing to wait for a
606         self-token. IE for sending VD_AGENT_CLIENT_DISCONNECTED messages.
607
608         Update spice-common
609
610 2013-03-04  Hans de Goede  <hdegoede@redhat.com>
611
612         Silence __spice_char_device_write_buffer_get: internal buf is not available
613         These messages are printed when the server tries to push a mouse event to
614         the agent before the previous one has been flushed. This is a normal condition
615         (which gets tracked by the reds->pending_mouse_event boolean), and as such
616         it should *not* trigger the printing of error messages.
617
618         I've seen these messages occasionally before, but with agent file-xfer they
619         are trivial to trigger, simply send a large file to the agent and while it
620         is transferring move the mouse over the client window. Note that due to the
621         client tokens not allowing the client to completely saturate the agent
622         channel mouse events do still get send to the agent, just with a slightly
623         larger interval. So everything is working as designed and this spice_printerr
624         is just leading to people chasing ghosts.
625
626 2013-01-15  Hans de Goede  <hdegoede@redhat.com>
627
628         worker_update_monitors_config: Drop bogus real_count accounting
629         1) This does not buy us much, as red_marshall_monitors_config() also
630            removes 0x0 sized monitors and does a much better job at it
631            (also removing intermediate ones, not only tailing ones)
632         2) The code is wrong, as it allocs space for real_count heads, where
633            real_count always <= monitors_config->count and then stores
634            monitors_config->count in worker->monitors_config->count, causing
635            red_marshall_monitors_config to potentially walk
636            worker->monitors_config->heads past its boundaries.
637
638         server: Fix SpiceWorker-CRITICAL **: red_worker.c:10968:red_push_monitors_config: condition `monitors_config != NULL' failed
639         During my dynamic monitor support testing today, I hit the following assert
640         in red_worker.c:
641         "red_push_monitors_config: condition `monitors_config != NULL' failed"
642
643         This is caused by the following scenario:
644         1) Guest causes handle_dev_monitors_config_async() to be called
645         2) handle_dev_monitors_config_async() calls worker_update_monitors_config()
646         3) handle_dev_monitors_config_async() pushes worker->monitors_config, this
647            takes a ref on the current monitors_config
648         4) Guest causes handle_dev_monitors_config_async() to be called *again*
649         5) handle_dev_monitors_config_async() calls worker_update_monitors_config()
650         6) worker_update_monitors_config() does a decref on worker->monitors_config,
651            releasing the workers reference, this monitor_config from step 2 is
652            not yet free-ed though as the pipe-item still holds a ref
653         7) worker_update_monitors_config() creates a new monitors_config with an
654            initial ref-count of 1 and stores that in worker->monitors_config
655         8) The pipe-item of the *first* monitors_config is send, upon completion
656            a decref is done on the monitors_config, and monitors_config_decref not
657            only frees the monitor_config, but *also* sets worker->monitors_config
658            to NULL, even though worker->monitors_config no longer refers to the
659            monitor_config being freed, it refers to the 2nd monitor_config!
660         9) The client which was connected when this all happened disconnects
661         10) A new client connects, leading to the assert:
662             at red_worker.c:9519
663             num_common_caps=1, common_caps=0x5555569b6f60, migrate=0,
664             stream=<optimized out>, client=<optimized out>, worker=<optimized out>)
665             at red_worker.c:10423
666             at red_worker.c:11301
667
668         Note that red_worker.c:9519 is:
669                 red_push_monitors_config(dcc);
670         gdb does not point to the actual line of the assert because the function gets
671         inlined.
672
673         The fix is easy and obvious, don't set worker->monitors_config to NULL in
674         monitors_config_decref. I'm a bit baffled as to why that code is there in
675         the first place, the whole point of ref-counting is to not have one single
676         unique place to store the reference...
677
678         This fix should not have any adverse side-effects as the 4 callers of
679         monitors_config_decref fall into 2 categories:
680         1) Code which immediately after the decref replaces worker->monitors_config
681            with a new monitors_config:
682            worker_update_monitors_config()
683            set_monitors_config_to_primary()
684         2) pipe-item freeing code, which should not touch the worker state at all
685            to being with
686
687 2013-01-14  Michael Tokarev  <mjt@tls.msk.ru>
688
689         link libspice server with libm libpthread
690         server/Makefile apparently forgot to link libspice-server
691         with -lm -lpthread, but it uses symbols from these libraries
692         directly.  These libs are detected by configure and stored in
693         $(SPICE_NONPKGCONFIG_LIBS) make variable, but this variable
694         is never referenced at link time.  Add it to server/Makefile.am,
695         to libspice_server_la_LIBADD variable.
696
697         Signed-off-By: Michael Tokarev <mjt@tls.msk.ru>
698
699 2013-01-08  Yonit Halperin  <yhalperi@redhat.com>
700
701         red_worker.c: clearing the stream vis_region, after it has been detached
702         The stream vis_region should be cleared after the stream region was sent
703         to the client losslessly. Otherwise, we might send redundant stream upgrades
704         if we process more drawables that are dependent on the stream region.
705
706         red_worker.c: insert a drawable to its position in the current tree before calling red_detach_streams_behind
707         resolves: rhbz#891326
708
709         Starting from commit 81fe00b08ad4f, red_detach_streams_behind can
710         trigger modifications in the current tree (by update_area calls). Thus,
711         after calling red_detach_streams_behind it is not safe to access tree
712         entries that were calculated before the call.
713         This patch inserts the drawable to the tree before the call to
714         red_detach_streams_behind. This change also requires making sure
715         that rendering operations that can be triggered by
716         red_detach_streams_behind will not include this drawable (which is now part of the tree).
717
718 2013-01-01  Uri Lublin  <uril@redhat.com>
719
720         server: guest_set_client_capabilities: protect against NULL worker->display_channel
721         Reported-by: Michal Luscon <mluscon@redhat.com>
722
723         Found by a Coverity scan:
724           in handle_dev_start -
725             Checking "worker->display_channel" implies that "worker->display_channel"
726                          might be NULL.
727             Passing "worker" to function "guest_set_client_capabilities"
728           in guest_set_client_capabilities -
729             Directly dereferencing parameter "worker->display_channel"
730
731 2012-12-20  Hans de Goede  <hdegoede@redhat.com>
732
733         Release 0.12.2
734
735 2012-12-20  Yonit Halperin  <yhalperi@redhat.com>
736
737         red_parse_qxl: fix throwing away drawables that have masks
738         Non rgb bitmaps are allowed to not have a palette in case they
739         are masks (which are 1BIT bitmaps).
740
741         Related: rhbz#864982
742
743 2012-12-19  Hans de Goede  <hdegoede@redhat.com>
744
745         spice-client: Add --hotkeys cmdline option
746         To allow using the existing mechanism to override the default hotkeys from
747         the cmdline.
748
749 2012-12-12  Christophe Fergeau  <cfergeau@redhat.com>
750
751         reds: Use g_strlcpy instead of strncpy
752         reds.c is using strncpy with a length one byte less than the
753         destination buffer size, and is relying on the fact that the
754         destination buffers are static global variables.
755         Now that we depend on glib, we can use g_strlcpy instead, which
756         avoids relying on such a subtle trick to get a nul-terminated
757         string.
758
759         build: Use glib2
760         Now that QEMU depends on glib, it won't really hurt if we depend
761         on it as well, and we won't have to reinvent our own helpers.
762
763         Don't build client by default
764         It has been superseded by virt-viewer/remote-viewer
765
766         Fail reds_init_socket when getaddrinfo fails
767         We currently output a warning when getaddrinfo fails, but then
768         we go on trying to use the information it couldn't read. Make
769         sure we bail out of reds_init_socket if getaddrinfo fails.
770
771         Make sure strncpy'ed string are 0-terminated
772         spice_server_set_ticket and spice_server_set_addr get (library)
773         user-provided strings as arguments, and copy them to fixed-size
774         buffers using strncpy. However, if these strings are too long,
775         the copied string will not be 0-terminated, which will cause issues
776         later. This commit copies one byte less than the size of the
777         destination buffer. In both cases, this buffer is a static global
778         variable, so its memory will be set to 0.
779
780 2012-12-05  Yonit Halperin  <yhalperi@redhat.com>
781
782         red_worker: revert 8855438a
783         red_proccess_commands calls were added after calling
784         guest_set_client_capabilities in order to cleanup the command ring from
785         old commands that the client might not be able to handle.
786         However, calling red_process_commands at this stage does send messages
787         to the client.
788         In addition, since setting the client capabilities at the guest is not
789         synchronized, emptying the command ring is not enough in order to make
790         sure the following commands will be supported by the client.
791         The call to red_proccess_commands before initializing the display
792         streams (the call to red_display_start_streams), caused inconsistencies
793         related to video streaming upon reconnecting (rhbz#883564).
794
795         I'm reverting this patch till another solution for the capabilities
796         mismatch is introduced.
797
798         Resolves: rhbz#883564
799
800 2012-12-05  Marc-André Lureau  <marcandre.lureau@redhat.com>
801
802         server: add "port" channel support
803         A Spice port channel carry arbitrary data between the Spice client and
804         the Spice server. It may be used to provide additional services on top
805         of a Spice connection. For example, a channel can be associated with
806         the qemu monitor for the client to interact with it, just like any
807         qemu chardev. Or it may be used with various protocols, such as the
808         Spice Controller.
809
810         A port kind is identified simply by its fqdn, such as org.qemu.monitor,
811         org.spice.spicy.test or org.ovirt.controller...
812
813         The channel is based on Spicevmc which simply tunnels data between
814         client and server, with a few additional messages.
815
816         See the description of the channel protocol in spice-common history.
817
818         server: bump SPICE_SERVER_VERSION to 0.12.2
819
820         update spice-common
821
822 2012-11-30  Yonit Halperin  <yhalperi@redhat.com>
823
824         agent: fix mishandling of agent data received from the client after agent disconnection
825         The server can receive from the client agent data even when the agent
826         is disconnected. This can happen if the client sends the agent data
827         before it receives the AGENT_DISCONNECTED msg. We should receive and handle such msgs, instead
828         of disconnecting the client.
829         This bug can also lead to a server crash if the agent gets reconnected
830         fast enough, and it receives an agent data msg from the client before MSGC_AGENT_START.
831
832         upstream bz#55726
833         rhbz#881980
834
835 2012-11-29  Yonit Halperin  <yhalperi@redhat.com>
836
837         red_worker: no need to align the stride of internal images
838         Internal images are just read from the surface, compressed, and sent to the client.
839         Then, they are destroyed. I can't find any reason for aligning their memory.
840
841 2012-11-28  Yonit Halperin  <yhalperi@redhat.com>
842
843         red_worker: fix sending internal images with stride > bpp*width to lz compression
844         rhbz#876685
845
846         The current lz implementation does not support such bitmaps.
847         The following patch will actually prevent allocating stride > bpp*width
848         for internal images.
849
850 2012-11-26  Yonit Halperin  <yhalperi@redhat.com>
851
852         red_worker.c: fix memory corruption when data from client is bigger than 1024 bytes
853         Previously, there was no check for the size of the message received from
854         the client, and all messages were read into a buffer of size 1024.
855         However, migration data can be bigger than 1024. In such cases, memory
856         corruption occurred.
857
858         red_worker.c: fix not sending all pending messages when the device is stopped
859         red_wait_outgoing_item only waits till the currently outgoing msg is
860         completely sent.
861         red_wait_outgoing_items does the same for multi-clients. handle_dev_stop erroneously called
862         red_wait_outgoing_items, instead of waiting till all the items in the
863         pipes are sent.
864         This waiting is necessary because after drawables are sent to the client, we release them from the
865         device. The device might have been stopped due to moving to the non-live
866         phase of migration. Accessing the device memory during this phase can lead
867         to inconsistencies.
868
869         Also, MSG_MIGRATE should be the last message sent to the client, before
870         MSG_MIGRATE_DATA. Due to this bug, msgs were marshalled and sent after
871         handle_dev_stop and after handle_dev_display_migrate which sometimes led
872         to the release of surfaces, and inserting MSG_DISPLAY_DESTROY_SURFACE
873         after MSG_MIGRATE.
874
875         This patch also removes the calls to red_wait_outgoing_items, from
876         dev_flush_surfaces. They were unnecessary.
877
878         smartcard.c: avoid marshalling migration data with reference to a memory that might be released before send has completed
879         The current solution just copy the buffer. Currently data that is read
880         from the guest is always copied before sending it to the client. When we
881         will have ref count for these buffers, we can also use it for marshalling
882         the migration data.
883
884         red_worker.c: fix marshalling of migration data
885         fix calling spice_marhsaller_add_ref with memory on stack
886
887         reds.c: fix calls to spice_marshaller_add_ref with ptr to memory that might be released before sending
888
889         char_device.c: when the state is destroyed, also free the buffer that is being written to the device
890
891         char_device.c: add ref count for write-to-device buffers
892         The ref count is used in order to keep buffers that were in the write
893         queue and now are part of migration data, in case the char_device state
894         is destroyed before we complete sending the migration data.
895
896 2012-11-21  Yonit Halperin  <yhalperi@redhat.com>
897
898         char_device.c: fix call to spice_marshaller_add_ref with memory on stack
899         rhbz#862352
900
901 2012-11-12  Yonit Halperin  <yhalperi@redhat.com>
902
903         red_worker.c: fix calling set_client_capabilities when it is unsupported by qemu
904         The erroneous call was in handle_dev_start.
905         This patch also fixes not calling set_client_capabilities when the
906         qxl major_version is > 3.
907
908         display seamless migration: no need to trace the generation of the primary surface
909         We no longer process destroy_primary or destroy_surfaces while waiting
910         for migration data.
911
912         display seamless migration: don't process both cmd ring and dispatcher queue till migration data is received
913         fix: rhbz#866929
914
915         At migration destination side, we need to restore the client's surfaces
916         state, before sending surfaces related messages.
917         Before this patch, we stopped the processing of only the cmd ring, till migration data
918         arrived.
919         However, some QXL_IOs require reading and rendering the cmd ring (e.g.,
920         update_area). Moreover, when the device is reset, after destroying all
921         surfaces, we assert (in qemu) if the cmd ring is not empty (see
922         rhbz#866929).
923         This fix makes the red_worker thread wait till the migration data arrives
924         (or till a timeout), and not process any input from the device after the
925         vm is started.
926
927 2012-11-04  Alon Levy  <alevy@redhat.com>
928
929         Revert "server: add websockets support via libwebsockets"
930         This reverts commit 63bb37276e028ab1b1c156c9e7907bf22b6d5952.
931
932         update spice-common (was broken)
933
934 2012-11-01  Alon Levy  <alevy@redhat.com>
935
936         server/red_worker: don't call set_client_capabilities if vm is stopped
937         We try to inject an interrupt to the vm in this case, which we cannot do
938         if it is stopped. Instead log this and update when vm restarts.
939
940         RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=870972
941          (that bz is on qemu, it will be cloned or just changed, not
942           sure yet)
943
944 2012-10-25  Alon Levy  <alevy@redhat.com>
945
946         server/red_worker: wip: VALIDATE_SURFACE macros, remove asserts (but too late - should be done earlier)
947
948         release 0.12.1
949
950         server: add websockets support via libwebsockets
951         New API: spice_server_set_ws_ports
952
953         This adds an optional dependency on libwebsockets. You need to get my
954         patched 0.0.3 version here:
955          git://people.freedesktop.org/~alon/libwebsockets
956
957         There is no qemu patches yet, to test change in reds.c the default value
958         of spice_ws_port to 5959 (for the default of spice-html5).
959
960         For testing there is an online client at
961          http://spice-space.org/spice-html5/spice.html
962
963         Known issues:
964          1. The tester (server/tests/test_display_no_ssl) gets into dropping all
965           data after a few seconds, I think it's an issue with the implemented
966           watches, but haven't figured it out.
967
968          2. libwebsocket's read interface is inverted to what our code expects,
969          i.e. there is no libwebsocket_read, so there is an additional copy
970          involved (see RedsWebSocket). This can be fixed.
971
972          3. Listening on a separate port. Since the headers are different, we
973          could listen on the same port (first three bytes RED/GET). I don't know
974          if we want to?
975
976         Todos:
977          1. SSL not implemented yet. Needs some thought as to how.
978
979          2. Serve spice-html5 when accessed as a http server. Nice to have.
980
981         server/red_worker: stride > 0 is tested, remove abort
982         Tested using the wip driver and xf86-video-modesetting.
983
984         server/tests/test_display_base: fix segfault in test
985
986         server/reds.c: split off reds-private.h
987
988         configure.ac: add libcacard to SPICE_REQUIRES if built with smartcard support
989
990         update spice-common
991
992 2012-10-24  Uri Lublin  <uril@redhat.com>
993
994         server: red_dispatcher: check major/minor of qxl for client_monitors_config
995         This solves a problem with new spice-server and old qemu-kvm, where spice thinks
996         qif->client_monitors_config exists, while it does not exist in qemu-kvm.
997
998         Also "major > required_major" was added to the condition.
999         Also only the specific RedDispatcher is checked (and not all dispatchers).
1000
1001 2012-10-19  Alon Levy  <alevy@redhat.com>
1002
1003         add git-version-gen and gitlog-to-changelog
1004
1005 2012-10-18  Hans de Goede  <hdegoede@redhat.com>
1006
1007         inputs_channel: Fix wrong handling of key up/down on big endian
1008         The client will send 0x000000## codes for regular keys, and 0x0000##e0 codes
1009         for extended keys. The current code which simply walks the uint32_t code in
1010         memory order relies on the memory order being little endian, which will
1011         clearly fail on big endian machines, this fixes this.
1012
1013 2012-10-11  Yonit Halperin  <yhalperi@redhat.com>
1014
1015         snd channel: fix accessing freed memory
1016         snd_channel_put freed "channel", and then channel->worker was accessed.
1017         It caused segmentation faults during connections and disconnections of the client.
1018
1019 2012-10-01  Christophe Fergeau  <cfergeau@redhat.com>
1020
1021         Fix PlaybackChannel forward declaration
1022         This caused a jenkins build failure:
1023
1024         snd_worker.c:148: error: redefinition of typedef 'PlaybackChannel'
1025         snd_worker.c:126: note: previous declaration of 'PlaybackChannel' was here
1026
1027 2012-10-01  Andrew Eikum  <aeikum@codeweavers.com>
1028
1029         server: Access the correct SndChannel for a given AudioFrame
1030         The client of _get_buffer() holds a ref to the SndChannel, and we
1031         should access that SndChannel when _put_samples() is called, not the one
1032         that happens to currently be attached to the Interface.
1033
1034         server: Don't release SndChannel twice from worker reference
1035         When we release the SndChannel reference during
1036         snd_disconnect_channel(), we need to set the pointer to NULL so it
1037         doesn't get released again on client reconnect during
1038         snd_set_playback_peer(). This can happen when a reference is held from
1039         _playback_get_buffer().
1040
1041 2012-09-20  Christophe Fergeau  <cfergeau@redhat.com>
1042
1043         reds: Report an error when reds_char_device_add_state fails
1044         This used to abort with spice_error. The caller currently does
1045         not check spice_server_char_device_add_interface return value, but
1046         it's still cleaner to report an error in this case.
1047
1048         reds: Check errors returned from SSL_CTX_set_cipher_list
1049
1050         reds: Report errors from load_dh_params
1051
1052         reds: Check reds_init_ssl errors
1053         Now that this function can fail, propagate any error up to the
1054         caller. This allows qemu to fail when an SSL initialization error
1055         occurred.
1056
1057         reds: report SSL initialization errors
1058         Errors occurring in reds_init_ssl used to be fatal through the use
1059         of spice_error, but this was downgraded to non-fatal spice_warning
1060         calls recently. This means we no longer error out when invalid SSL
1061         (certificates, ...) parameters are passed by the user.
1062         This commit changes reds_init_ssl return value from void to int so
1063         that errors can be reported to the caller.
1064
1065         reds_init_net: report errors on watch setup failures
1066         We used to be aborting in such situations, but this was changed
1067         during the big spice_error/printerr cleanup. We are currently
1068         outputting a warning but not reporting the error with the caller
1069         when reds_init_net fails to register listening watches with the
1070         mainloop. As it's unlikely that things will work as expected in
1071         such cases, better to error out of the function instead of pretending
1072         everything is all right.
1073
1074         reds: Abort on BN-new failures
1075         BN_new returns NULL on allocation failures. Given that we abort
1076         on malloc allocation failures, we should also abort here. The
1077         current code will segfault when BN_new fails as it immediatly tries
1078         to use the NULL pointer.
1079
1080 2012-09-15  Alon Levy  <alevy@redhat.com>
1081
1082         Release 0.12.0
1083
1084 2012-09-13  Alon Levy  <alevy@redhat.com>
1085
1086         server/spice-server.syms: add missing global labels
1087         Although global is the default, this makes the file more consistent.
1088
1089         server/Makefile.am: fix for make distcheck
1090         Doesn't make sense to distribute test_spice_version.sh, so just
1091         ensure the build passes if it doesn't exist.
1092
1093         spice-server 0.11.5
1094         Added api:
1095          QXL interface (3.2)
1096           client_monitors_config
1097
1098         server/tests: agent mock, client_monitors_config
1099
1100         server: Filter VD_AGENT_MONITORS_CONFIG
1101         If the guest supports client monitors config we pass it the
1102         VDAgentMonitorsConfig message via the
1103         QXLInterface::client_monitors_config api instead of via the vdagent.
1104
1105         server/reds: reuse already defined local
1106
1107         server/red_dispatcher: client_monitors_config support
1108         Adds two functions:
1109          - red_dispatcher_use_client_monitors_config:
1110            check that QXLInterface supports client_monitors_config and that it's
1111            functional.
1112          - red_dispatcher_client_monitors_config:
1113            send the client monitors configuration to the guest.
1114
1115         server: add QXLInterface::client_monitors_config
1116         Used to implement guest monitor configuration change similarly to real
1117         hardware in conjunction with the new qemu interrupt
1118         QXL_INTERRUPT_CLIENT_MONITORS_CONFIG. client_monitors_config is also
1119         used to probe the support by the interface. If it is not supported we
1120         send the message to the guest agent.
1121         This makes a linux qxl driver similar to existing kms drivers.
1122
1123         The logic is:
1124
1125         For every received VDAgentMonitorsConfig:
1126          if client_monitors_config(NULL):
1127           write client configuration to pci rom BAR.
1128           send interrupt to guest
1129           guest kernel reads configuration from rom BAR.
1130           guest kernel issues event to user space
1131           user space reads (libdrm) and reconfigures (libXRandr)
1132          else: (current implementation)
1133           write message to guest agent
1134           guest agent issues reconfiguration via XRandr / windows Escape ioctl to kernel
1135
1136         update spice-common module
1137         For qxl client_monitors_config support.
1138
1139 2012-09-12  Alon Levy  <alevy@redhat.com>
1140
1141         server/red_dispatcher: change a printerr to debug
1142
1143 2012-09-11  Søren Sandmann Pedersen  <ssp@redhat.com>
1144
1145         Bump SPICE_INTERFACE_QXL_VERSION_MINOR
1146         Then check that we have the right version before accessing the
1147         set_client_capabilities() function.
1148
1149 2012-09-11  Peter Robinson  <pbrobinson@gmail.com>
1150
1151         Enable build on armv6+
1152         The following patch enables it to build on ARM platforms that support
1153         atomics. Tested on an armv7hl on an ARMv7 device running Fedora 18. Using
1154         firefox connecting to a RHEV-M instance I could launch consoles in
1155         spice-xpi and login so basic support works!
1156
1157         Resolves: rhbz#613529
1158
1159 2012-09-10  Christophe Fergeau  <cfergeau@redhat.com>
1160
1161         Update spice-common to get A8 surface definitions
1162         Latest spice needs these definitions from spice-protocol
1163
1164 2012-09-07  Søren Sandmann Pedersen  <ssp@redhat.com>
1165
1166         Bump spice.h version number to 0.11.4
1167         No new symbols are added, but there is an addition to QXLInterface:
1168
1169             void (*set_client_capabilities)(QXLInstance *qin,
1170                                             uint8_t client_present,
1171                                             uint8_t caps[58]);
1172
1173         Set a8 capability in the QXL device if supported by the client
1174
1175         Process outstanding commands in the ring after changing capability bits
1176         When a new client connects, there may be commands in the ring that it
1177         can't understand, so we need to process these before forwarding new
1178         commands to the client. By doing this after changing the capability
1179         bits we ensure that the new client will never see a command that it
1180         doesn't understand (under the assumption that the guest will read and
1181         obey the capability bits).
1182
1183         Acked-by: Alon Levy <alonl@redhat.com>
1184
1185 2012-09-06  Søren Sandmann Pedersen  <ssp@redhat.com>
1186
1187         Add new set_client_capabilities() interface to QXLInstance
1188         A new interface
1189
1190           set_client_capabilities (QXLInstance *qin,
1191                                    uint8_t client_present,
1192                                    uint8_t caps[58]);
1193
1194         is added to QXLInstance, and spice server is changed to call it
1195         whenever a client connects or disconnects. The QXL device in response
1196         is expected to update the client capability bits in the ROM of the
1197         device and raise the QXL_INTERRUPT_CLIENT interrupt.
1198
1199         There is a potential race condition in the case where a client
1200         disconnects and a new client with fewer capabilities connects. There
1201         may be commands in the ring that the new client can't handle. This
1202         case is handled by first changing the capability bits, then processing
1203         all commands in the ring, and then start forwarding commands to the
1204         new client. As long as the guest obeys the capability bits, the new
1205         client will never see anything it doesn't understand.
1206
1207         client: Advertise A8_SURFACE capability
1208
1209 2012-09-05  Alon Levy  <alevy@redhat.com>
1210
1211         server/red_parse_qxl: fix bitmap_consistent again
1212
1213 2012-09-05  Jeremy White  <jwhite@codeweavers.com>
1214
1215         Implement spice_server_set_exit_on_disconnect to enable an option whereby the spice server shuts down on client disconnect.
1216
1217 2012-09-05  Alon Levy  <alevy@redhat.com>
1218
1219         server/red_parse_qxl: fix wrong bitmap_consistent
1220         The bit calculation was wrong for all the paletted types by a factor of
1221         between 8 and 1 (SPICE_BITMAP_FMT_{1,4,8}BIT_PLT_{LE,BE})
1222
1223 2012-09-03  Alon Levy  <alevy@redhat.com>
1224
1225         server/red_parse_qxl: add bitmap consistency check
1226         Just checks stride vs width times bpp.
1227
1228         This fixes a potential abort on guest generated bad images in
1229         glz_encoder.
1230
1231         Other files touched to move some consts to red_common, they are
1232         static so no problem to be defined in both red_worker.c and
1233         red_parse_qxl.c .
1234
1235         server/tests/test_display_base: fix update_area abort
1236         Don't do zero area update_areas, server now aborts on those. This tester
1237         is not supposed to test those aborts.
1238
1239         server: replace syntax-check reported tabs with spaces
1240
1241         server: add dist-hook to prevent spice version configure/spice.h difference
1242
1243 2012-09-02  Alon Levy  <alevy@redhat.com>
1244
1245         0.11.3 release
1246         No new api entries.
1247
1248         add server/tests/test_vdagent
1249
1250         server/tests/test_two_servers
1251
1252         server/tests: introduce Test struct
1253
1254 2012-08-30  Alon Levy  <alevy@redhat.com>
1255
1256         server/red_worker: seamless: fix invalid memory reference
1257         replace add_ref with add for stack allocated SpiceMigrateDataDisplay.
1258
1259         This fixes wrong MIGRATE_DATA message in display channel (symptom is
1260         glz_encoder_max being way too big, and malloc failure at target) seen on
1261         F18 with gcc-4.7.1-5.fc18.x86_64 and glibc-2.16-8.fc18.x86_64 (didn't
1262         appear on RHEL 6).
1263
1264         server: freezed->froze, missing whitespace after declarations
1265
1266         server: s/max_encdoers/max_encoders/
1267
1268 2012-08-30  Yonit Halperin  <yhalperi@redhat.com>
1269
1270         server/inputs_channel.c: whitespace fix
1271
1272 2012-08-30  Alon Levy  <alevy@redhat.com>
1273
1274         server/red_tunnel_worker: remove unneeded expect_migrate_mark
1275
1276 2012-08-28  Alon Levy  <alevy@redhat.com>
1277
1278         server/red_tunnel_worker.c: fix build
1279         Only passes compile, not tested.
1280
1281 2012-08-27  Marc-André Lureau  <marcandre.lureau@redhat.com>
1282
1283         inputs: handle SPICE_MSGC_INPUTS_KEY_SCANCODE
1284         Handle SPICE_MSGC_INPUTS_KEY_SCANCODE message, allowing arbitrary
1285         keyboard scancode sequence.
1286
1287 2012-08-27  Alon Levy  <alevy@redhat.com>
1288
1289         support automake >= 1.12
1290         Requires a single line (sans comments) change to configure.ac in
1291         spice-common too, to define the new AM_PROG_AR.
1292
1293         server/red_worker: handle_dev_update_area: fail if invalid area
1294
1295 2012-08-27  Yann E. MORIN  <yann.morin.1998@free.fr>
1296
1297         client: fix missing stdarg.h include
1298         When the C library is uClibc, stdarg.h is required to get the
1299         definition for va_list et al.
1300
1301 2012-08-27  Yonit Halperin  <yhalperi@redhat.com>
1302
1303         enable seamless migration and set migration protocol version
1304
1305         inputs channel migration: don't send any msg after MSG_MIGRATE
1306         Pending motion acks, and keyboard modifiers messages will be sent
1307         by the destination after receiving the migration data.
1308
1309         inputs_channel: send and handle migration data
1310
1311         migration_protocol: add inputs channel migration data
1312         Storing the motion count in uint16_t and not in uint32_t since
1313         the exact count is not important, just its division in
1314         SPICE_INPUT_MOTION_ACK_BUNCH (see the next 2 patches).
1315
1316         main_channel: don't expect init msg in a seamless migration destination
1317         If the server is a destination of seamless migration, send msgs to the client,
1318         even though an init msg has not been sent to the client.
1319
1320         red_channel: set send_data.last_sent_serial in red_channel_client_set_message_serial
1321         red_channel_client_set_message_serial is called for setting
1322         the serial of the display channel messages after migration (on the
1323         destination side). The serial is retrieved from the migration data.
1324
1325         red_channel: remove unused migrate flag from RedChannel
1326         The relevant flags reside in RedChannelClient and RedClient
1327
1328         snd_worker: handling migration
1329         The playback and record channel send SPICE_MSG_MIGRATE to the client.
1330         Both playback and record channel does not have a state to restore:
1331         while in the legacy migration implementation the record channel
1332         used to restore the mode and start time, it looks unnecessary since
1333         the client receives from the src MSG_RECORD_STOP before the migration
1334         completion notification (when the vm is stopped). Afterwards, when the vm
1335         starts on the dest side, the client receives MSG_RECORD_START.
1336
1337         snd_channel: fix double release
1338         Due to the fix in the previous patch, snd_disconnect_channel can be
1339         called both when there is write/read error in the channel, or from
1340         red_client_destroy (which calls client_cbs.disconnect).
1341         Multiple calls to snd_disconnect_channel resulted in calling
1342         channel->cleanup(channel) more than once (double release).
1343
1344         red_channel (dummy): fix not adding dummy RedChannelClient to the client
1345         snd channel wasn't added to be part of the client's channels list.
1346         As a result, when the client was destroyed, or migrated, snd channel
1347         client wasn't destroy, or its migration callback wasn't called.
1348
1349         However, due to adding dummy channels to the client, we need special
1350         handling for calls to disconnecting dummy channel clients.
1351
1352         TODO: we need to refactor snd_worker to use red_channel
1353
1354         display migration: restore destination state
1355         Restoring display channel from migration data.
1356         Not notifying client about changes that are artifacts of loading the vm.
1357         Remove legacy migration code.
1358
1359         display migration: marshall migration data
1360
1361         display & cursor migration: send SPICE_MSG_MIGRATE
1362
1363         migration_protocol: add display channel migration data
1364
1365         inputs channel: use the default red_channel behaviour for client_cbs.migrate
1366         The default callback sends SPICE_MSG_MIGRATE to the client.
1367
1368         inputs channel: fix using spice messages enums as pipe items type
1369         A channel pipe item type must start from PIPE_ITEM_TYPE_CHANNEL_BASE.
1370         SPICE_MSG_MIGRATE value eq. PIPE_ITEM_TYPE_SET_ACK. Setting a pipe item
1371         type to SPICE_MSG_MIGRATE, leads to red_channel handling PIPE_ITEM_TYPE_SET_ACK.
1372
1373         char_device: don't connect a migrated client if the state of the device might have changed since it was created
1374         If reading/writing from the device have occured before migration data
1375         has arrived, the migration data might no longer be relvant, and we
1376         disconnect the client.
1377
1378         main: restore state from migration data
1379         Also removed old migration leftovers.
1380
1381         main: send migration data
1382         Also removed some unused definitions from reds that used to belong to
1383         old agent and migration code.
1384
1385         main: send MSG_MIGRATE upon vm migration completion
1386         Before sending the above msg, if there is a pending partial msg that
1387         has been read from the agent, we send it to the client. The alternative
1388         was to keep the msg as part of the migration data, and then
1389         to send it to the destination server via the client and to wait there
1390         for the msg chunk completion, before sending it to the client. Of
1391         course, the latter is less efficient.
1392
1393         reds: s/HADER/HEADER
1394
1395         migration_protocol: add migration data for the main channel (mainly for the agent)
1396
1397         main_channel: fix using spice messages enums as pipe items type
1398         A channel pipe item type must start from PIPE_ITEM_TYPE_CHANNEL_BASE.
1399         SPICE_MSG_MIGRATE value eq. PIPE_ITEM_TYPE_SET_ACK. Setting a pipe item
1400         type to SPICE_MSG_MIGRATE, leads to red_channel handling PIPE_ITEM_TYPE_SET_ACK.
1401
1402         Also removed sending SPICE_MSG_MIGRATE. It will be handled in the next
1403         patch.
1404
1405         red_channel: introduce PIPE_ITEM_TYPE_EMPTY_MSG
1406         The pipe item is used for sending messages that don't have body.
1407
1408         smartcard: restore state after migration from migration data
1409
1410         smartcard migration: send migration data
1411
1412         migration_protocol: add migration data for smartcard
1413
1414         smartcard: send MSG_MIGRATE upon vm migration completion
1415         The above is the default behaviour for red_channel_client, if
1416         client_cbs.migrate is not registered as part of red_channel_register_client_cbs
1417
1418         smartcard: fix PIPE_ITEMs enum indexing
1419         The enum should start from PIPE_ITEM_TYPE_CHANNEL_BASE, otherwise,
1420         PIPE_ITEM_TYPE_ERROR is handled like PIPE_ITEM_TYPE_SET_ACK.
1421
1422         smartcard: change the timing of attaching a client to SpiceCharDeviceState
1423         Attach/detach a client to a SpiceCharDeviceState upon its
1424         connection/disconnection, instead of upon reader_add/remove messages.
1425         When the client is removed from a SpiceCharDeviceState, all the
1426         messages from this client are removed from the device write queue.
1427         This shouldn't happen when we only receive reader_remove and the
1428         client is still connected.
1429
1430         spicevmc migration: restore migration dest state from migration data
1431
1432         spicevmc migration: send migration data
1433
1434         spicevmc: send MSG_MIGRATE upon vm migration completion
1435         The above is the default behaviour for red_channel_client, if
1436         client_cbs.migrate is not registered as part of red_channel_register_client_cbs
1437
1438         migration_protocol: add migration data for spicevmc
1439
1440         char device migration: restore state at destination from migration data
1441
1442         char device migration: don't read or write from/to the device while waiting for migraion data
1443
1444         char device migration: marshall migration data
1445
1446         char_device: variable token price for write buffers
1447         When restoring migration data, we also restore data that is addressed to
1448         the device, and that might have been originated from more than 1
1449         message. When the write buffer that is assoicated with this data is
1450         released, we need to free all the relevant tokens.
1451
1452         migration_protocol: add migration data for char devices
1453
1454         replace some migration related spice_error calls with info/warning
1455
1456         seamless migration: migration completion on the destination side
1457         Tracking the channels that wait for migration data. If there
1458         is a new migration process pending, when all the channels have
1459         restored their state, we begin the new migration.
1460
1461         red_channel: handle sending SPICE_MSG_MIGRATE
1462         The relevant code is common to all channels.
1463
1464         The patch also contains a fix to the return value for
1465         handle_migrate_data callback: s/uint64_t/int
1466
1467         red_channel: fix pipe item leak
1468
1469         seamleass migration: manage post migration phase in the src side
1470         In semi-seamless, SPICE_MSG_MAIN_MIGRATE_END is sent.
1471         In seamless, each channel migrates separately.
1472
1473         The src waits till all the clients are disconnected (or a timeout), and
1474         then it notifies qemu that spice migration has completed.
1475
1476         The patch doesn't include the per-channel logic for seamless migration
1477         (sending MSG_MIGRATE, MIGRATE_DATA, etc.).
1478
1479         seamless migration: pre migration phase on the destination side
1480         - handle SPICE_MSGC_MAIN_MIGRATE_DST_DO_SEAMLESS
1481         - reply with SPICE_MSG_MAIN_MIGRATE_DST_SEAMLESS_ACK/NACK
1482         - prepare the channels for migration according to the migration
1483            type (semi/seamless)
1484
1485         see spice-protocol for more details:
1486         commit 3838ad140a046c4ddf42fef58c9727ecfdc09f9f
1487
1488         seamless migration: pre migration phase on the src side
1489         sending SPICE_MSG_MAIN_MIGRATE_BEGIN_SEAMLESS and handling
1490         SPICE_MSGC_MAIN_MIGRATE_CONNECTED_SEAMLESS
1491
1492         The src side signals the client to establish a connection
1493         to the destination.
1494         In seamless migration, the client is also used to perform
1495         a sort of handshake with the destination, for verifying
1496         if seamless migration can be supported.
1497
1498         see spice-protocol for more details:
1499         commit 3838ad140a046c4ddf42fef58c9727ecfdc09f9f
1500
1501         seamless-migration: update spice-common submodule
1502         Also Update server and client according to the change of
1503         SpiceMsgMainMigrationBegin: it now holds all the fields inside
1504         SpiceMigrationDstInfo.
1505
1506         seamless-migration: add migration_protocol.h
1507         The file will hold the declarations of the different migration
1508         data messages (depending on the channel), that will be passed
1509         from the src server to the dst server, via the client, using
1510         SPICE_MSG_MIGRATE_DATA.
1511
1512         bump version to 0.11.2
1513         New api entries:
1514             spice_server_vm_start
1515             spice_server_vm_stop
1516             spice_server_set_seamless_migration
1517
1518         spice.h: add spice_server_set_seamless_migration
1519         This new call is used in order to identify whether qemu, or
1520         the management (e.g. libvirt), support seamless migration.
1521         If it is supported, qemu spice cmd-line configuration should have
1522         seamless-migration=on.
1523
1524         In addition, we disable seamless migration support if multiple clients
1525         are allowed. Currently, only one client is supported.
1526
1527         spice_server_vm_start/stop: notify red_dispatcher on vm start/stop
1528         Till now, red_worker was notfied about vm status changes via QXLWorker->start/stop
1529         (or spice_qxl_start/stop).
1530         Newer qemu, that supports calling spice_server_vm_start/stop, will call only
1531         these routines, and won't call QXLWorker->start/stop.
1532
1533         spice.h: add entries for tracking vm state
1534         When vm state changes (started/stopped), we notify all the
1535         attached SpiceCharDeviceStates about the change. This is mainly required
1536         for avoiding writing/reading to/from the device during the non-live
1537         stage of migration.
1538
1539         spice version will be bumped in one of the following patches.
1540
1541         reds: add tracking for char devices
1542         The list of attached char_devices will be used in the next patch
1543         for notifying each instance of SpiceCharDeviceState when the vm
1544         is started or stopped.
1545
1546         agent: don't attempt to read from the device if it was released
1547         if vdi_port_read_buf_process failes, we detach the agent and also release
1548         the read buffer. We shouldn't try reading from the device afterwards.
1549
1550         agent: reset client tokens when notifying on agent connection
1551         send SPICE_MSG_MAIN_AGENT_CONNECTED_TOKENS
1552
1553         red_channel: add red_channel_test_remote_cap
1554         for checking if all the channel clients connected support the cap
1555
1556 2012-08-24  Søren Sandmann Pedersen  <ssp@redhat.com>
1557
1558         Add support for Composite command to the client
1559         All the real work is being done in spice-common, so this patch is just
1560         hooking up the virtual calls and adding the SPICE_DISPLAY_CAP_COMPOSITE
1561         capability.
1562
1563         Add support for QXLComposite to spice server
1564         In red-parse-qxl.c add support for parsing QXLComposite into
1565         SpiceComposite. In red-worker.c add support for marshalling
1566         SpiceComposite onto the wire.
1567
1568         Add support for LZ compression of A8 images
1569         Graduality is irrelevant for A8 images, so instead of using RGB-ness
1570         as a short-cut, add a new macro BITMAP_FMT_HAS_GRADUALITY() that
1571         returns true for the existing RGB images, but false for A8.
1572
1573 2012-08-09  Marc-André Lureau  <marcandre.lureau@redhat.com>
1574
1575         Update spice-common
1576
1577 2012-07-25  Yonit Halperin  <yhalperi@redhat.com>
1578
1579         red_worker: Fix reference counting for the current frame (drawable) of a stream
1580         After marshalling MSG_STREAM_CREATE, there is no need to ref and
1581         unref stream->current before and after completing the sending of the
1582         message (correspondingly). The referencing is unnecessary because all
1583         the data that is required from the drawable (the clipping), is copied
1584         during marshalling, and no field in the drawable is referenced (see
1585         spice_marshall_msg_display_stream_create).
1586
1587         Moreover, the referencing was bugous:
1588         While display_channel_hold_pipe_item and
1589         display_channel_client_release_item_after_push referenced and
1590         dereferenced, correspondingly, stream->current, stream->current might
1591         have changed in between these calls, and then we ended up with one drawable
1592         leaking, and one drawable released before its time has come (which
1593         of course led to critical errors).
1594
1595 2012-07-23  Alon Levy  <alevy@redhat.com>
1596
1597         bump version to 0.11.1 for new spice_qxl_monitors_config_async
1598         bump current and age since only additions where done.
1599         new server library is libspice-server.so.1.2.0 .
1600
1601 2012-07-22  Alon Levy  <alevy@redhat.com>
1602
1603         server: add monitors_config support
1604         a SpiceMsgDisplayMonitorsConfig is sent on two occasions:
1605          * as a result of a spice_qxl_monitors_config_async
1606          * whenever a client connects and there is a previously set monitors
1607            config
1608
1609         Sending the new message is protected by a new cap,
1610         SPICE_DISPLAY_CAP_MONITORS_CONFIG
1611
1612         More elaborately:
1613         spice_qxl_monitors_config_async receives a QXLPHYSICAL address of a
1614         QXLMonitorsConfig struct and reads it, caching it in the RedWorker, and
1615         sending it to all clients. Whenever a new client connects it receives
1616         a SpiceMsgDisplayMonitorsConfig message as well.
1617
1618         server/red_parse_qxl: red_get_image: fix leaks on bad image
1619
1620         server/red_worker: release bad drawables
1621
1622         server/red_parse_qxl: disallow zero area bitmaps
1623         prevents division by zero later (SIGFPE, Arithmetic exception) in
1624         spice-common code, at spice-common/common/canvas_base.c:646
1625         for both client and server (server only upon rendering).
1626
1627         server/red_parse_qxl: get_path: remove return NULL
1628         introduced by 2ec2dbc78a660ee4e3315f50c881d9e31a8e4fe2
1629
1630         server/reds: more fixes for wrong spice_error in d2c99b59
1631
1632         server: don't abort on guest images with missing palettes
1633
1634         server: factor out bitmap_fmt_is_rgb
1635
1636 2012-07-16  Marc-André Lureau  <marcandre.lureau@redhat.com>
1637
1638         Update spice-common
1639
1640         tests: add missing file to .gitignore
1641         TODO: some day, switch to git.mk
1642
1643         build-sys: remove cegui/slirp and mandatory client from dist-check
1644         The spicec client is no longer actively maintained.
1645
1646         By removing cegui from distcheck, we can avoid extra build time and
1647         dependencies (>150Mb extra cegui/boost on fedora)
1648
1649         Slirp is not available in most distributions, afaict, making it hard
1650         to build consistantly accross various systems.
1651
1652         The client is still build if the dependencies are present.
1653
1654         build-sys: define GL flags if enabled
1655         The server too can use opengl, independently from client.
1656
1657 2012-07-11  Alon Levy  <alevy@redhat.com>
1658
1659         server/reds: fix wrong spice_error in d2c99b59
1660
1661         server/red_worker: fix wrong spice_error in commit 706232a8
1662
1663 2012-07-05  Alon Levy  <alevy@redhat.com>
1664
1665         server/reds.c: spice_printerr cleanup
1666         Rules for replacing spice_printerr:
1667         * if it's a client drop / agent drop, spice_error
1668         * if it's important, spice_warning
1669         * else, spice_info.
1670
1671         The fourth rule is spice_debug if it's going to fill up the log, but
1672         nothing of the sort here.
1673
1674         Other things this patch does:
1675         * changed reds_show_new_channel to reds_info_new_channel in an attempt to
1676         advertise it doesn't always show anything, unless SPICE_DEBUG_LOG_LEVEL
1677         >= SPICE_DEVUG_LOG_INFO (==3)
1678         * removes two lines of whitespace.
1679         * added "crashy" to multiple client warning (only warning introduced,
1680           the rest are errors).
1681
1682         server/red_worker: elevate some spice_debugs to spice_info
1683         Specifically all those that the previous patch converted to spice_debug.
1684         spice_debug contains very verbose stuff like update_area that drowns out
1685         those relatively rare (client connect / disconnect generated) messages.
1686
1687         update spice-common for spice_info
1688
1689         server/red_worker: cleanup lines starting with 5 spaces
1690
1691         server/red_worker: death to spice_printerr, too verbose by far
1692         Replaced mostly with spice_debug, but spice_warning & spice_error as
1693         well where appropriate.
1694
1695 2012-07-04  Yonit Halperin  <yhalperi@redhat.com>
1696
1697         smartcard: Remove redefinition of typedef 'SmartCardDeviceState'
1698
1699 2012-07-03  Yonit Halperin  <yhalperi@redhat.com>
1700
1701         char_device.h: Remove redefinition of typedef 'SpiceCharDeviceState'
1702         The original definition is in spice.h
1703
1704         char_device: move SpiceCharDeviceState from the header
1705         In addition, I also removed the no longer used wakeup callback
1706
1707         smartcard: use SpiceCharDeviceState for writing to the guest device
1708         With SpiceCharDeviceState, the smartcard code now supports partial writes,
1709         and storing data that is received from the client after the device is
1710         stopped, instead of attempting to write it to the guest.
1711
1712         smartcard: creating SmartCardChannelClient type
1713         The lifetime of the channel is not necessarily correlated to the life
1714         time of the device. In the next patch, we need to keep a reference
1715         to SpiceCharDeviceWriteBuffer, which might be in use even if the
1716         SpiceCharDeviceState is destroyed, but the channel is still connected.
1717         The next patch keeps this reference inside SmartCardChannelClient.
1718
1719         This patch also removes the routine smartcard_readers_detach_all(rcc), which
1720         is unnecessary since we don't support multiple readers; even when
1721         we do support them, each channel client should be associated with only
1722         one reader (i.e., we will have different channels for different
1723         readers).
1724
1725         smartcard: use SpiceCharDeviceState for managing reading from the device
1726         This patch and the following one do not introduce tokening to the smartcard
1727         channel. But this can be done easily later, by setting the appropriate
1728         variables in SpiceCharDeviceState (after adding the appropriate protocol messages,
1729         and implementing this in the client side).
1730
1731         spicevmc: use SpiceCharDeviceState for writing to the guest device
1732         With SpiceCharDeviceState, spicevmc now supports partial writes,
1733         and storing data that is received from the client after the device is
1734         stopped, instead of attempting to write it to the guest.
1735
1736         spicevmc: employ SpiceCharDeviceState for managing reading from the guest device
1737         This patch and the following one do not introduce tokening to the
1738         spicevmc channel. But this can be done easily later, by setting the appropriate
1739         variables in SpiceCharDeviceState (after adding
1740         the appropriate protocol messages, and implementing this in the client
1741         side).
1742
1743         agent: employ SpiceCharDeviceState for writing to the device
1744
1745         agent: use SpiceCharDeviceWriteBuffer for agent data from the client
1746         This is an intermediate patch. The next patch will actually
1747         push the buffer to the device, instead of copying it.
1748
1749         agent: employ SpiceCharDeviceState for managing reading from the device
1750
1751         agent: remove save/restore migration data code
1752         This code is never called, it was relevant for seamless migration.
1753         Most of the data that needs to be migrated was moved to
1754         SpiceCharDeviceState. When we implement seamless migration,
1755         we will have routines in char_device.c for migrating the relevant data.
1756
1757         agent: Fix tokens handling in main_channel
1758         - Allow sending tokens to a specific client.
1759         - Do not ignore tokens that are sent from the client to the server.
1760
1761         The tokens support for multiple clients and for server side tokens
1762         is still broken in reds. It will be fixed in following patches, when
1763         the server-side agent code will use the SpiceCharDeviceState api.
1764
1765         Notice that ignoring the server-side tokens didn't introduce a problem
1766         since both the client and the server set it to ~0.
1767
1768         char_device: Introducing shared flow control code for char devices.
1769         SpiceCharDeviceState manages the (1) write-to-device queue
1770         (2) wakeup and reading from the device (3) client tokens (4)
1771         sending messages from the device to the client/s, considering the
1772         available tokens.
1773         SpiceCharDeviceState can be also stopped and started. When the device
1774         is stopped, no reading or writing is done from/to the device. Messages
1775         addressed from the client to the device are being queued.
1776         Later, an api for stop/start will be added to spice.h and it should
1777         be called from qemu.
1778
1779         This patch does not yet remove the wakeup callback from
1780         SpiceCharDeviceState, but once all the char devices (agent/spicevmc/smartcard)
1781         code will switch to the new implementation, SpiceCharDeviceState
1782         will be moved to the c file and its reference to the wakeup callback will be removed.
1783
1784         smartcard: fix an error message
1785
1786         smartcard: fix calc of remaining data size when reading more than one msg from the device
1787
1788 2012-07-02  Alon Levy  <alevy@redhat.com>
1789
1790         update spice-common
1791         Includes using the same spice.proto as spice-gtk now, with smartcard
1792         fixes, more verbose output when SSL verification fails, and some
1793         warnings fixes. shortlog:
1794
1795         Alon Levy (6):
1796               python_modules/ptypes.py/EnumBaseType.c_enumname: add missing return to fix broken enums generation
1797               smartcard: build fixes for spice server
1798               updated spice-protocol for smartcard enums non conflict with libcacard
1799               Makefile.am: fix .gitignore not being generated in spice-protocol/spice
1800               Makefile.am: now that spice_codegen.py is used add *.pyc to ignored files in root
1801               update spice-protocol for smartcard enums fix
1802
1803         Christophe Fergeau (1):
1804               ssl: more verbose output when SSL verification fails
1805
1806         Marc-André Lureau (3):
1807               ssl-verify: add a bit of run-time checks
1808               Fix invalid macro usage
1809               Fix a gcc warning
1810
1811 2012-06-27  Alon Levy  <alevy@redhat.com>
1812
1813         spice.h: bump SPICE_SERVER_VERSION for release 0.11.0 (cherry picked from commit dd5c995c32cf595d31e59975bd1b3216cf996656)
1814
1815         Revert "update spice-common for multiple monitor in single display channel support"
1816         This reverts commit 3baf290be79cfb1872b90f7724efa50aa343d74b.
1817
1818         Revert "spice.h: bump SPICE_SERVER_VERSION for release 0.11.0"
1819         This reverts commit dd5c995c32cf595d31e59975bd1b3216cf996656.
1820
1821 2012-06-21  Alon Levy  <alevy@redhat.com>
1822
1823         spice.h: bump SPICE_SERVER_VERSION for release 0.11.0
1824
1825         update spice-common for multiple monitor in single display channel support
1826
1827 2012-06-19  Nikolay Orlyuk  <virkony@gmail.com>
1828
1829         Added configure option --disable-xinerama
1830         This parameter was added to be able to control dependency on
1831         libXinerama. Which is really useful for package managers.
1832         Fixes bug #51192
1833
1834 2012-06-12  Alon Levy  <alevy@redhat.com>
1835
1836         Release 0.11.0
1837         Current bumped and age bumped for new intefaces only (no backward
1838         incompatible changes).
1839
1840         New libtool version is 2.0.1, using --version-info instead of
1841         --version-name. Doing the version change and --version-name to
1842         --version-info change here to avoid changing the libtool version twice.
1843
1844         Added interfaces:
1845             spice_server_set_name
1846             spice_server_set_uuid
1847             spice_server_set_listen_socket_fd
1848             spice_server_is_server_mouse
1849
1850         New library name in linux:
1851             libspice-server.so.1.1.0
1852         Old:
1853             libspice-server.so.1.0.2
1854
1855 2012-06-07  Alon Levy  <alevy@redhat.com>
1856
1857         server/red_channel: s/channle/channel
1858
1859 2012-06-06  Alon Levy  <alevy@redhat.com>
1860
1861         m4/spice-compile-warnings: Squelch _FORTIFY_SOURCE when needed to avoid glibc #warnings.
1862         Fix copied from libvirt, commit by Eric Blake.
1863
1864         glibc 2.15 (on Fedora 17) coupled with explicit disabling of
1865         optimization during development dies a painful death:
1866
1867         /usr/include/features.h:314:4: error: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Werror=cpp]
1868
1869         Work around this by only conditionally defining _FORTIFY_SOURCE,
1870         in the case where glibc can actually use it.  The trick is using
1871         AH_VERBATIM instead of AC_DEFINE.
1872
1873 2012-06-05  Alon Levy  <alevy@redhat.com>
1874
1875         server/spice.h: s/Pleaes/Please/
1876
1877 2012-05-31  Yonit Halperin  <yhalperi@redhat.com>
1878
1879         server/red_channel: do not attempt to write if the channel client is disconnected
1880         The red_channel_client_event call to red_channel_client_receive might result
1881         in a disconnected channel client. The following call to
1882         red_channel_client_push may call to red_peer_handle_outgoing with a
1883         disconnected socket.
1884
1885         server/red_channel: fix possible access to released channel clients
1886         Added ref count for RedChannel and RedChannelClient.
1887
1888         red_channel.c/red_peer_handle_incoming call to
1889         handler->cb->handle_message might lead to the release of the channel
1890         client, and the following call to handler->cb->release_msg_buf will be
1891         a violation.
1892
1893         This bug can be produced by causing main_channel_handle_parsed
1894         call red_client_destory, e.g., by some violation in
1895         reds_on_main_agent_data that will result in a call to reds_disconnect.
1896
1897 2012-05-24  Yonit Halperin  <yhalperi@redhat.com>
1898
1899         server/red_worker: fix red_wait_pipe_item_sent
1900         Resolves: rhbz#824384
1901
1902         red_wait_pipe_item_sent mistakingly returned without waiting for sending the given pipe item
1903         when the channel wasn't blocked. As a result, we failed when we had to
1904         destroy a surface (e.g., QXL_IO_DESTROY_ALL_SURFACES) and to release all
1905         the drawables that are depended on it (by removing them or waiting they will be sent).
1906         In addition, red_wait_pipe_item_sent increased and decreased the reference to the pipe item
1907         using channel_cbs->hold_item, and channel_cbs->release_item. However,
1908         these calls can be called only by red_channel, otherwise
1909         display_channel_client_release_item_before_push is called twice and
1910         leads to a double call to ring_remove(&dpi->base).
1911         Instead ref/put_drawable_pipe_item should be called.
1912
1913         server/red_channel: remove red_channel_client_item_being_sent
1914         The above routine was risky, since red_channel_client_init_send_data
1915         can also be called with item==NULL. Thus, not all pipe items can be tracked.
1916         The one call that was made for this routine was not necessary.
1917
1918 2012-05-21  Yonit Halperin  <yhalperi@redhat.com>
1919
1920         server: handle red_channel_client_create returning NULL
1921
1922         server/red_channel: prevent creating more than one channel client with the same type+id
1923
1924         server/video: do not allow non-streamable drawables be stream candidates
1925         Resolves: rhbz#820669
1926
1927         Fix a segfault caused by a call to __red_is_next_stream_frame made by
1928         red_stream_maintenance, with a drawable that is not a DRAW_COPY one.
1929         The segfault is a reault of __red_is_next_stream_frame accessing
1930         red_drawable->u.copy.src_bitmap for a non DRAW_COPY drawable.
1931
1932 2012-05-16  Yonit Halperin  <yhalperi@redhat.com>
1933
1934         server/tests: test_display_streaming - test wide sized frames
1935         Before, we tested only higher frames, while wider frames would have
1936         triggered a bug in mjpeg_encoder, when spice is linked with libjpeg and
1937         not libjpeg-turbo.
1938
1939         server/mjpeg_encoder: realloc encoder->row, when a wider frame is given
1940         Fix crashes when there are sized wider frames in the stream, and we are
1941         linked with libjpeg.
1942
1943         Related : rhbz#813826
1944         Resolves: rhbz#820669
1945
1946 2012-05-15  Alon Levy  <alevy@redhat.com>
1947
1948         server: move self_bitmap_image to RedDrawable
1949         Simplify keeping count of self_bitmap_image by putting it in
1950         RedDrawable. It is allocated on reading from the command pipe and
1951         deallocated when the last reference to the RedDrawable is dropped,
1952         instead of keeping track of it in GlzDrawable and Drawable.
1953
1954         server/red_worker/put_red_drawable: s/drawable/red_drawable/
1955
1956         server/red_worker/red_handle_self_bitmap: add red_drawable local, one extra whitespace line removed
1957
1958         server/red_worker: rename SpiceImage *self_bitmap to self_bitmap_image
1959
1960         Revert "server/red_worker: fix possible leak of self_bitmap"
1961         This reverts commit 35dbf3ccc4b852f9dbb29eb8a53c94f26d2e3a6e.
1962
1963         accidentally pushed v1 of patches, reverting in preperation of pushing
1964         v2.
1965
1966 2012-05-14  Alon Levy  <alevy@redhat.com>
1967
1968         server/red_worker: fix possible leak of self_bitmap
1969         After the previous patch moving self_bitmap freeing inside red_drawable
1970         ref count, we have a possible self_bitmap leak:
1971
1972         red_process_commands
1973          red_get_drawable | red_drawable #1, red_drawable->self_bitmap == 1
1974           red_process_drawable | rd #2, d #1, d->self_bitmap != NULL
1975            release_drawable | rd #1, d# = 0, try to release self_bitmap, but
1976                                 blocked by rd #1
1977           put_red_drawable | rd #0
1978
1979         This patch moves the call to release_drawable after the call to
1980         put_red_drawable, thereby fixing the above situation.
1981
1982         server/red_worker/red_process_commands: rename drawable to red_drawable (later add a local drawable)
1983
1984         server/red_worker: red_process_drawable: have single point of exit
1985
1986 2012-05-14  Yonit Halperin  <yhalperi@redhat.com>
1987
1988         server/red_worker: don't release self_bitmap unless refcount is 0
1989         RHBZ: 808936
1990
1991 2012-05-10  Yonit Halperin  <yhalperi@redhat.com>
1992
1993         server/mjpeg_encoder: fix wrong size assigned to dest_len
1994         It should have been the allocated size and not the occupied one.
1995         This led to a lot of unnecessary allocations and deallocations.
1996
1997         server/mjpeg_encoder: Fix memory leak for the inital output buffer given for each frame
1998
1999 2012-05-07  Alon Levy  <alevy@redhat.com>
2000
2001         server/reds: add "usbredir" to recognized channel names
2002         RHBZ: 819484
2003
2004 2012-05-04  Nahum Shalman  <nshalman@elys.com>
2005
2006         cleanup x11 library detection for building client
2007         Consolidate two separate chunks of library hunting that depend on the
2008         same check.
2009
2010         Check if we're actually building the client before looking for
2011         client only libraries.
2012
2013         Hide some of the final output if we're not building the client.
2014
2015 2012-05-03  Yonit Halperin  <yhalperi@redhat.com>
2016
2017         server/tests/test_display_streaming: include tests for clip and sized frames
2018         CC: Alon Levy <alevy@redhat.com>
2019
2020         server/tests: use the correct dimensions in SIMPLE_UPDATE
2021
2022         server/tests: add SLEEP command to test_display_base
2023
2024         server/tests: add clip to SIMPLE_DRAW_BITMAP
2025
2026 2012-05-03  Alon Levy  <alevy@redhat.com>
2027
2028         server/tests/test_display_streaming: update to create sized frames
2029
2030         server/tests: add SIMPLE_DRAW_SOLID and SIMPLE_DRAW_BITMAP
2031
2032         server/tests: refactor Command
2033
2034         server/tests: add test_get_width/test_get_height
2035
2036         server/tests: refactor test_display_base
2037
2038 2012-05-03  Yonit Halperin  <yhalperi@redhat.com>
2039
2040         server/red_worker/video: don't override the clip in areas that belong only to sized frames
2041
2042         server/red_worker.c/video: add support for frames of different sizes
2043         rhbz #813826
2044
2045         When playing a youtube video on Windows guest, the driver sometimes(**) sends
2046         images which contain the video frames, but also other parts of the
2047         screen (e.g., the youtube process bar). In order to prevent glitches, we send these
2048         images as part of the stream, using SPICE_MSG_DISPLAY_STREAM_DATA_SIZED.
2049
2050         (**) It happens regularly with the you tube html5 player. With flash,
2051         it occurs when moving the cursor in the player area.
2052
2053         Update the spice-common submodule
2054         spice-common changes: STREAM_DATA_SIZED message was added in order to support
2055         video streams with frames that their size is different from the initial size
2056         that the stream was created with.
2057
2058         This patch also includes server and client adjustments to the new
2059         SpiceMsgDisplayStreamData.
2060
2061         server/red_worker/video: don't detach a drawable from a stream due to it being rendered.
2062         The previous patch took care that streams will be upgraded by a surface
2063         screenshot and not the last frame, if necessary. Thus, there is no
2064         more a reason for detaching drawables from streams when they are
2065         rendered. Moreover, detaching such drawables can cause glitches, in
2066         case they are still in the pipe, and red_update_area is called
2067         frequently and leads to stream frames rendering.
2068
2069         server/red_worker/video: upgrade stream by a screenshot instead of the last frame, if needed
2070         Upgrading a stream: When the stream's visible region is bigger than the one of the last
2071         frame, we will send an updated screenshot of the visible region, instead
2072         of sending the last frame losslessly.
2073
2074         server/red_worker/video: maintain visible region and clip region for streams
2075         Differentiate between the clipping of the video stream, and the region
2076         that currently displays fragments of the video stream (henceforth,
2077         vis_region). The latter equals or contains the former one. For example,
2078         let c1 be the clip area at time t1, and c2 be the clip area at time t2,
2079         where t1 < t2. If c1 contains c2, and at least part of c1/c2, hasn't been
2080         covered by a non-video images, vis_region will contain c2, and also the part
2081         of c1/c2 that still displays fragments of the video.
2082         When we consider if a stream should be "upgraded" (1), due to its area
2083         being used by a rendering operation, or due to stopping the video, we
2084         should take into account the vis_region, and not the clip region (next
2085         patch: not upgrade by the last frame, but rather by vis_region).
2086         This fix will be more necessary when sized frames are introduced (see the
2087         following patches). Then, the vis_region might be larger
2088         than the last frame, and contain it, more frequently than before.
2089
2090         (1) "upgrading a stream" stands for sending its last frame losslessly. Or more
2091         precisely, lossless resending of all the currently displayed lossy areas, that were
2092         sent as part of the stream.
2093
2094         server/red_worker: add get_stream_id
2095
2096         Update the spice-common submodule
2097         We need some rect/region getters methods that were added
2098
2099 2012-04-27  Jeremy White  <jwhite@codeweavers.com>
2100
2101         Force 64 bit multiplication on 32 bit systems; fixes a bug where the server times out the display channel freakily fast.
2102
2103 2012-04-26  Daniel P. Berrange  <berrange@redhat.com>
2104
2105         Ensure __STDC_FORMAT_MACROS is always defined first
2106         The client/common.h file defines __STDC_FORMAT_MACROS before
2107         including inttypes.h so that the PRI* macros get defined in
2108         C++. This is ignoring the possibility that other global
2109         includes may have already pulled in inttypes.h
2110
2111         We need __STDC_FORMAT_MACROS to be defined before any header
2112         files are included. Putting it in config.h satisfies this,
2113         since config.h is always the first header
2114
2115         Disable -Waggregate-return if building with SLIRP
2116         The API design of SLIRP means that it is not practical to use
2117         the -Waggregate-return warning flag. Disable this flag in the
2118         (unlikely) scenario where SLIRP is actually requested at build
2119         time
2120
2121 2012-04-26  Alon Levy  <alevy@redhat.com>
2122
2123         bump spice-common with SpiceClips fix
2124
2125 2012-04-25  Daniel P. Berrange  <berrange@redhat.com>
2126
2127         Add some more 'noreturn' annotations
2128         Methods which longjump, unconditionally raise an
2129         exception, or call _exit()  cannot return control
2130         to the caller so should be annotated with 'noreturn'
2131
2132         Fix typo in is_equal_brush
2133         The 3 part of the conditional in the is_equal_brush method
2134         compared the b1->u.color field to itself, instead of b2->u.color
2135
2136         Fix printf format specifiers for i686 hosts
2137
2138         Add missing struct field initializers
2139
2140         Ensure config.h is the first include in the file
2141
2142         Add a few more syntax-check exemptions
2143
2144         Add recent new committers to AUTHORS file / mailmap
2145
2146         Enable many more compiler warnings
2147         * m4/manywarnings.m4m, m4/warnings.m4: Import GNULIB warnings
2148           modules
2149         * m4/spice-compile-warnings.m4: Define SPICE_COMPILE_WARNINGS
2150         * configure.ac: Replace compile warning check with a call to
2151           SPICE_COMPILE_WARNINGS
2152         * client/Makefile.am: Use WARN_CXXFLAGS instead of WARN_CFLAGS
2153
2154         Make some int->pointer casts explicit
2155         Tell the compiler that was really do intend to cast from int
2156         to pointer, to prevent warnings about implicit casts
2157
2158         * server/tests/test_display_base.c: Add explicit casts
2159
2160         Fix broken -I../common to be -I../spice-common in client
2161         * Makefile.am: s/common/spice-common/
2162
2163         VSCMsgHeader.reader_id is unsigned, so don't check for >= 0
2164         * server/smartcard.c: Fix assertion to not check for >= 0 on
2165           unsigned variable
2166
2167         Avoid jumping across variables declarations with initializers
2168         If a 'goto' statement jumps across a variable declaration
2169         which also has an initializer, the variable is in an undefined
2170         state. Splitting the the declaration & initialization doesn't
2171         change that, but the compiler can at least now detect use of
2172         the unintialized variable
2173
2174         Convert cases of () to (void)
2175         * server/reds.c, server/smartcard.c: s/()/(void)
2176
2177         Remove 2 *MB* stack frame in red_worker_main
2178         The red_worker_main method allocates a RedWorker struct instance
2179         on the stack. This struct is a full 2 MB in size which is not
2180         at all resonable to allocate on the stack.
2181
2182         * server/red_worker.c: Move RedWorker struct to the heap
2183
2184         Mark some variables as volatile
2185         When using setjmp/longjmp the state of local variables can be
2186         undefined in certain scenarios:
2187
2188         [quote man(longjmp)]
2189                The values of automatic variables are unspecified  after  a
2190                call to longjmp() if they meet all the following criteria:
2191
2192                ·  they are local to the function that made the correspond‐
2193                   ing setjmp(3) call;
2194
2195                ·  their values are changed between the calls to  setjmp(3)
2196                   and longjmp(); and
2197
2198                ·  they are not declared as volatile.
2199         [/quote]
2200
2201         * server/red_worker.c: Mark some vars as volatile
2202
2203         Mark functions which never return control
2204         * client/red_channel.cpp:  AbortTrigger::on_event can't return
2205           given its current impl
2206         * server/red_worker.c: red_worker_main can't return
2207
2208         Fix multiple printf format problems
2209         All printf var-args style methods should be annotation with
2210         their format. All format strings must be const strings.
2211
2212         * client/application.cpp, client/cmd_line_parser.cpp,
2213           client/hot_keys.cpp: Avoid non-const format
2214         * client/client_net_socket.cpp: Fix broken format specifier
2215         * client/red_peer.cpp: Fix missing format specifier
2216         * client/platform.h: Add SPICE_GNUC_PRINTF annotation to term_printf
2217         * client/utils.h: Add SPICE_GNUC_PRINTF annotation to string_printf
2218         * server/glz_encoder_config.h, server/red_worker.c: Add
2219           SPICE_GNUC_PRINTF annotation to warning callbacks
2220
2221         Fix const-ness violations
2222         * server/red_worker.c: Add missing const for return type
2223         * server/reds.c: Static strings must be declared const
2224
2225         Don't do arithmetic on void * type, use uint8_t instead
2226         Arithmetic on void * types is non-portable & trivially avoided
2227
2228         * server/dispatcher.c: Use uint8_t for arithmetic
2229
2230 2012-04-18  Alon Levy  <alevy@redhat.com>
2231
2232         spice-common: update submodule to verify_subject MSVC++ fix
2233
2234         spice-common: update submodule
2235
2236         update spice-common for MSVC++ build fixes
2237
2238 2012-04-18  Aric Stewart  <aric@codeweavers.com>
2239
2240         update visual studio project file
2241         Note, there may be line-ending issues here is we are not careful.  This file is a msdos formatted file.
2242
2243         There was some inconsistencies in those line-ending that I have normalized.
2244
2245 2012-04-18  Alon Levy  <alevy@redhat.com>
2246
2247         client/windows/redc.vcproj: switch to unix EOL (dos2unix)
2248
2249 2012-04-18  Aric Stewart  <aric@codeweavers.com>
2250
2251         Update win32 generate(1).bat files to match modern usage
2252         This involves:
2253          generating .c instead of .cpp files
2254          Not including "common.h"
2255          Standardizing some parameters
2256
2257         we do not need afxres.h included in redc.rc
2258         It is not an MFC project so simply including windef.h is better and
2259         allows for compiling with the Express editions of Visual Studio.
2260
2261 2012-04-18  Michael Tokarev  <mjt@tls.msk.ru>
2262
2263         fix error-path return in snd_set_record_peer()
2264         The error_{1,2} labels in this functions are backwards.
2265
2266 2012-04-17  Aric Stewart  <aric@codeweavers.com>
2267
2268         Copy getopt.h from old common/win/my_getopt-1.5/my_getopt
2269         This patch completes the copy from
2270         4d8f39020ac83602c1647d4af04e8b19bf74ed6e which missed this file.
2271
2272         update windows client generate.bat and generate1.bat
2273         the python script is now in spice-common and client_marshallers.h needs
2274         to be included instead of marshallers.h
2275
2276 2012-04-05  Alon Levy  <alevy@redhat.com>
2277
2278         server: allow failure in getvirt
2279         This patch changed getvirt to continue working even if spice_critical
2280         doesn't abort (i.e. SPICE_ABORT_LEVEL != -1). This is in preparation to
2281         make getvirt not abort at all. The reason is that getvirt is run on
2282         guest provided memory, so a bad driver can crash the vm.
2283
2284 2012-04-02  Christophe Fergeau  <cfergeau@redhat.com>
2285
2286         Replace sprintf with snprintf use
2287         The hotkey parser was generating a string with sprintf and data it got
2288         from the controller socket (ie data which can have an arbitrary
2289         length). Using sprintf there is a bad idea, replace it with snprintf.
2290
2291 2012-03-28  Marc-André Lureau  <marcandre.lureau@redhat.com>
2292
2293         spice-common: update to fix quic-encode warnings
2294
2295 2012-03-26  Alon Levy  <alevy@redhat.com>
2296
2297         server: export spice_server_is_server_mouse predicate
2298         To be used by qemu query-spice / info spice commands.
2299
2300 2012-03-26  Marc-André Lureau  <marcandre.lureau@redhat.com>
2301
2302         Remove files moved to spice-common
2303
2304 2012-03-25  Marc-André Lureau  <marcandre.lureau@redhat.com>
2305
2306         Copy common/win/my_getopt-1.5/my_getopt client/windows
2307
2308         Use the spice-common logging functions
2309         It will abort by default for critical level messages. That behaviour
2310         can be tuned at runtime.
2311
2312         Use the spice-common submodule
2313         This patch will replace the common/ directory with the spice-common
2314         project. It is for now a simple project subdirectory shared with
2315         spice-gtk, but the goal is to make it a proper library later on.
2316
2317         With this change, the spice-server build is broken. The following
2318         commits fix the build, and have been seperated to ease the review.
2319
2320         v2
2321         - moves all the generated marshallers to spice-common library
2322         - don't attempt to fix windows VS build, which should somehow be
2323           splitted with spice-common (or built from tarball only to avoid
2324           generation tools/libs deps)
2325         v3
2326         - uses libspice-common-client
2327         - fix a mutex.h inclusion reported by Alon
2328
2329 2012-03-23  Marc-André Lureau  <marcandre.lureau@redhat.com>
2330
2331         sasl: small refactoring, check memcheck != NULL
2332
2333         Use spice_strdup() to avoid crashing on NULL
2334         qemu can call spice_server_set_name(s, NULL) when the name is not
2335         given. Let's not crash in this case
2336
2337 2012-03-22  Alon Levy  <alevy@redhat.com>
2338
2339         server/tests: add resolution changes tester
2340
2341         server/tests/test_display_base: add Command
2342         add parameters to the commands used for display tests.
2343
2344 2012-03-21  Alon Levy  <alevy@redhat.com>
2345
2346         server/tests/test_display_base: remove 64bit arch assumptions
2347
2348         server/red_memslots: don't assume 64 bit environment
2349         assumption that unsigned long == QXLPHYSICAL causes get_virt to compute
2350         the wrong slot. Fix by replacing addr variables to be of type
2351         QXLPHYSICAL.
2352
2353         server/red_worker: fix for case where ASSERT is compiled out
2354
2355         server/red_memslots: use QXLPHYSICAL for addresses
2356         Cannot assume unsigned long == QXLPHYSICAL, not true for 32 bit
2357         architectures.
2358
2359         server/red_memslots: drop two unused functions
2360         cb_get_virt and cb_validate_virt have disappeared a long time ago,
2361         not needed since:
2362
2363         commit 5ac88aa79fa6445f96e5419d8bf4fce81da63b90
2364         Author: Gerd Hoffmann <kraxel@redhat.com>
2365         Date:   Thu Jul 1 17:55:33 2010 +0200
2366
2367             Properly parse QXLImage to the new-world SpiceImage
2368
2369             SpiceImage now replaces RedImage and has all image types in it.
2370             All image data are now chunked (and as such not copied when demarshalling).
2371
2372 2012-03-20  Christophe Fergeau  <cfergeau@redhat.com>
2373
2374         Don't truncate SPICE_FOREIGN_MENU_SOCKET
2375         When we get the socket name for the foreign menu socket from
2376         an environment variable, we cannot make assumptions about its length.
2377         Currently, we are strncpying to a 50 byte buffer which is easily
2378         too small.
2379
2380         Don't limit spice controller socket name to 50 chars
2381         The spice controller socket name used to be hardcoded to
2382         /tmp/SpiceController-%lu.uds and generated using snprintf. A 50 bytes
2383         buffer was enough for that, but this was changed in commit 79fffbf95
2384         because this was predictable and allowed other users on the system
2385         to sniff the browser/client communication. spicec now uses the value
2386         of the environment SPICE_XPI_SOCKET as the name of the socket to use.
2387         However, since the name that is used is no longer generated by spicec,
2388         no assumption can be made about its size. Currently, the socket is
2389         created inside the user home directory, which means that if the
2390         user name is too long, spicec will not be able to read the controller
2391         socket name.
2392         This commit directly uses the string from getenv as he name of the
2393         controller socket (on Linux) instead of limiting its size to 50 characters,
2394         which should fix this issue.
2395         This fixes rhbz #804561
2396
2397         Remove unused Canvas members
2398         The various Canvas have _max and _base variables which are not
2399         used, better to remove them.
2400
2401 2012-03-20  Alon Levy  <alevy@redhat.com>
2402
2403         server/red_worker: don't typedef SpiceWatch twice
2404         First defined in spice.h, fixes build failure with gcc 4.4.6
2405
2406 2012-03-13  Hans de Goede  <hdegoede@redhat.com>
2407
2408         red_worker: Check for NULL watches
2409         If we run out of watches slots, we return NULL from watch_add, which
2410         means that the other watch_foo functions may get called with a NULL
2411         parameter, protect them against this.
2412
2413 2012-03-12  Nahum Shalman  <nshalman@elys.com>
2414
2415         server: remove superfluous check
2416         no need to duplicate the check that the fd isn't -1
2417
2418         server: listen on a pre-opened file descriptor
2419         Allow applications to pre-open a file descriptor and have spice listen
2420         on it.
2421
2422         Thanks to Daniel Berrange for his comments
2423
2424         server: don't fail on ENOPROTOOPT from setsockopt
2425         If we allow listening on arbitrary sockets like unix sockets,
2426         we can get ENOPROTOOPT errors from setsockopt calls that set TCP
2427         specific options.  This should be allowed to happen.
2428
2429 2012-03-12  Hans de Goede  <hdegoede@redhat.com>
2430
2431         red_channel: remove pre_disconnect hook
2432         Now that red_worker's EventListener is gone there are no more users of it.
2433
2434         red_worker: Rework poll code to use the watch interface
2435         Commit 143a1df24e83e9c1e173c16aeb76d61ffdce9598 changed red_worker_main
2436         from epoll to poll. But epoll has edge triggered semantics (when requested
2437         and we requested them), where as poll is always level triggered. And
2438         red_worker was relying on the edge triggered semantics, as it was always
2439         polling for POLLOUT, which, when edge triggered, would only cause poll
2440         to register an event after we had blocked on a write. But after the
2441         switch to regular poll, with its level triggered semantics, the POLLOUT
2442         condition would almost always be true, causing red_worker_main to not
2443         block on the poll and burn CPU as fast as it can as soon as a client was
2444         connected.
2445
2446         Luckily we already have a mechanism to switch from polling for read only
2447         to polling for read+write and back again in the form of watches. So this
2448         patch changes the red_worker dummy watch implementation into a proper watch
2449         implementation, and drops the entire EventListener concept since that then is
2450         no longer needed.
2451
2452         This fixes spice-server using 400% CPU on my quad core machine as soon as
2453         a client was connected to a multi head vm, and as an added bonus is a nice
2454         cleanup IMHO.
2455
2456         red_channel: Use the channel core to remove the stream watch on disconnect
2457         We allow channels to have different core implementations, but we were
2458         relying on reds_stream_free to remove the stream watch on disconnect,
2459         and reds_stream_free always uses the qemu core implementation.
2460
2461         So far we were getting away with this since all the alternative core
2462         implementations always return NULL from watch_add.
2463
2464         But:
2465         1) The code before this patch clearly was not correct, since it was matching
2466            a channel-core watch_add with a qemu-core watch_remove
2467         2) I plan to move red_worker over to actually using an alternative watch
2468            implementation at which point this becomes a real problem
2469
2470 2012-03-10  Hans de Goede  <hdegoede@redhat.com>
2471
2472         red_worker: Remove ref counting from the EventListener struct
2473         The red_worker EventListener struct is either embedded in one of:
2474         1) DisplayChannelClient
2475         2) CursorChannelClient
2476         3) RedWorker
2477
2478         And as such gets destroyed when these get destroyed, in case 1 & 2 through
2479         a call to red_channel_client_destroy().
2480
2481         So free-ing it when the ref-count becomes 0 is wrong, for cases:
2482         1) and 2) this will lead to a double free;
2483         3) this will lead to passing memory to free which was not returned by malloc.
2484
2485         This is not causing any issues as the ref-count never gets decremented, other
2486         then in red_worker_main where it gets incremented before it gets decremented,
2487         so it never becomes 0.
2488
2489         So we might just as well completely remove it.
2490
2491         Notes:
2492         1) This is mainly a preparation patch for fixing issues introduced by
2493            the move from epoll to poll
2494         2) Since removing the ref-counting removes the one code path where listeners
2495            would get set to NULL, this patch moves the setting of NULL to
2496            pre_disconnect, where it should have been done in the first place since
2497            red_client_destroy calls red_channel_client_disconnect
2498            (through the dispatcher) followed by red_channel_client_destroy, so
2499            after pre_disconnect the listener may be gone.
2500
2501         Ensure all members of ChannelCbs and ClientCbs are either assigned or NULL
2502         While git-bisecting another issue I ended up hitting and not recognizing
2503         the bug fixed by commit 7a079b452b026d6ce38f95dcc397fa64b059fffb.
2504
2505         While fixing this (again) I noticed that (even after the fix) not all
2506         users of ChannelCbs first zero it. So this patch ensures that all users of
2507         ChannelCbs first zero it, and does the same for ClientCbs while at it.
2508
2509         Since before this patch there were multiple zero-ing styles, some using
2510         memset and other using a zero initializer this patch also unifies all
2511         the zero-ing to use a NULL initializer for the first element.
2512
2513 2012-03-06  Alon Levy  <alevy@redhat.com>
2514
2515         server/red_worker: fix use after free for listeners
2516         This fixes a core dumped observed once by repeated migration. So far 100
2517         migrations and no recurrence.
2518
2519         Core was generated by `/home/alon/spice/upstream/bin/qemu-system-x86_64 --enable-kvm -qmp unix:/tmp/mi'.
2520         Program terminated with signal 11, Segmentation fault.
2521         11197                   if (evt_listener && evt_listener->refs > 1) {
2522         Missing separate debuginfos, use: debuginfo-install bluez-libs-4.98-3.fc17.x86_64 brlapi-0.5.6-4.fc17.x86_64 bzip2-libs-1.0.6-4.fc17.x86_64 cryptopp-5.6.1-6.fc17.x86_64 keyutils-libs-1.5.5-2.fc17.x86_64 libssh2-1.4.0-1.fc17.x86_64 nss-softokn-freebl-3.13.1-20.fc17.x86_64 xen-libs-4.1.2-11.fc17.x86_64 xz-libs-5.1.1-2alpha.fc17.x86_64
2523         (gdb) bt
2524         (gdb) l
2525         11192           for (i = 0; i < MAX_EVENT_SOURCES; i++) {
2526         11193               struct pollfd *pfd = worker.poll_fds + i;
2527         11194               if (pfd->revents) {
2528         11195                   EventListener *evt_listener = worker.listeners[i];
2529         11196
2530         11197                   if (evt_listener && evt_listener->refs > 1) {
2531         11198                       evt_listener->action(evt_listener, pfd);
2532         11199                       if (--evt_listener->refs) {
2533         11200                           continue;
2534         11201                       }
2535         (gdb) p evt_listener
2536         $1 = (EventListener *) 0x7f15a9a5d1e0
2537         (gdb) p *evt_listener
2538         Cannot access memory at address 0x7f15a9a5d1e0
2539         (gdb) p i
2540         $2 = 2
2541         (gdb) p worker.listeners
2542         $3 = {0x7f15bc832520, 0x7f15a406e1a0, 0x7f15a9a5d1e0, 0x0 <repeats 17 times>}
2543
2544 2012-03-05  Marc-André Lureau  <marcandre.lureau@redhat.com>
2545
2546         Use SPICE_FOREIGN_MENU_SOCKET if it's available
2547         If specified, use SPICE_FOREIGN_MENU_SOCKET environment variable over
2548         snprintf(pipe_name, PIPE_NAME_MAX_LEN, PIPE_NAME,
2549         Platform::get_process_id()); since it's impossible to guess the client
2550         pid when spice-xpi launches the client as a grand-child (via script
2551         etc).
2552
2553         This is also more aligned with the way we handle SPICE_XPI_SOCKET
2554         location.
2555
2556         Fix spice-protocol reference
2557
2558         Send name & uuid to capable clients
2559         Add spice_server_set_name() and spice_server_set_uuid() that allows
2560         the client to identify a Spice server (useful to associate settings
2561         with a particular server)
2562
2563         The SPICE_MSG_MAIN_NAME and SPICE_MSG_MAIN_UUID messages are only sent
2564         to capable clients, announcing SPICE_MAIN_CAP_NAME_AND_UUID.
2565
2566         demarshal: fixed-size array are missing __nelements
2567         A message with a fixed-size array, such as uint8 uuid[16] will
2568         generate an invalid code, missing the __nelements variable. Make sure
2569         that variable is defined.
2570
2571 2012-03-05  Christophe Fergeau  <cfergeau@redhat.com>
2572
2573         server: more logging about certificates used
2574         This commit adds some log messages indicating which certificates
2575         could be loaded (or not).
2576
2577         Fixes rhbz#787678
2578
2579         Add log for invalid/expired tickets
2580         Currently, when a ticket has already expired, or is invalid, there is
2581         no qemu log to tell what went wrong. This commit adds such a log.
2582
2583         Fixes rhbz#787669
2584
2585 2012-03-04  Christophe Fergeau  <cfergeau@redhat.com>
2586
2587         mingw: workaround weird openssl build failure
2588         If X509_NAME isn't undefined before including x509v3.h, very
2589         weird compilation error occurs. It seems to be caused by duplicate
2590         definitions for this symbols coming from wincrypto.h
2591
2592         mingw: don't try to redefine alloca
2593         mingw already has a #define alloca __builtin_alloca so trying to
2594         redefine it triggers a warning.
2595
2596         mingw: fix signed/unsigned comparison warnings
2597
2598         mingw: add workaround for _ftime_s issue on mingw
2599         mingw has a _ftime_s prototype in its headers, but no corresponding
2600         symbol available at link time. Workaround this issue for now by
2601          #defining it to _ftime. This is untested on win64 where the workaround
2602         may not be needed.
2603
2604         mingw: #ifdef unneeded #define in common.h
2605         common.h has some #define when doing win32 build to workaround a few
2606         missing functions on these systems. However, since mingw32 has some
2607         of these, this causes either warnings about redefining preprocessor
2608         symbols or wreak havoc in mingw headers trying to use these symbols.
2609         This commit wraps these symbols in an #ifndef __MINGW32__ to avoid
2610         using them on this platform.
2611
2612         mingw: use uintptr_t when converting a pointer to an int
2613         win64 uses 32 bit long, so we cannot use a long to hold a 64 bit
2614         pointer. Thankfully, there's a [u]intptr_t type available exactly
2615         for these uses.
2616
2617 2012-03-01  Marc-André Lureau  <marcandre.lureau@redhat.com>
2618
2619         build-sys: fix make distcheck
2620         - Do not refer to .c files managed by another makefile (this will fail
2621           make distclean)
2622         - Do not refer to files by relative path (should use $top_srcdir for ex)
2623         - Use LDADD for object linking instead of LDFLAGS, for linker flags
2624
2625         build-sys: cleanup server/tests/Makefile.am
2626
2627         build-sys: use spice-protocol as submodule
2628
2629         build-sys: cleanup, use autoreconf
2630
2631 2012-03-01  Arnon Gilboa  <agilboa@redhat.com>
2632
2633         client/windows: fix SetClipboardViewer error handling rhbz#786554
2634         MSDN says the following about SetClipboardViewer(): "If an error occurs or there
2635         are no other windows in the clipboard viewer chain, the return value is NULL".
2636         Seems like the buggy case was "no other windows in the clipboard viewer chain",
2637         which explains the 3rd party clipboard manager workaround detailed in the bug
2638         description.
2639
2640         It also seems like SetClipboardViewer() does not clear the error state on
2641         succcess. Calling SetLastError(0) before SetClipboardViewer() seems to solves
2642         this issue.
2643
2644         Since we could not reproduce the bug on our env, the customer has verified on
2645         several of their systems that a private build resolved the issue.
2646
2647 2012-03-01  Yonit Halperin  <yhalperi@redhat.com>
2648
2649         client X11: support volume keys when evdev is in use
2650         Add support for sending volume keys scancodes to the guest
2651         RHBZ #552539
2652
2653         client: keyboard - add mapping for volume keys
2654         Add support for sending volume keys scancodes to the guest
2655         RHBZ #552539
2656
2657         A good reference for mapping keymaps to scancodes can be found in
2658         spice-gtk/gtk/keymaps.csv
2659
2660 2012-02-29  Christophe Fergeau  <cfergeau@redhat.com>
2661
2662         Fix compilation when smartcard support is disabled
2663         The addition of smartcard control to the controller doesn't handle
2664         the case when smartcard support is disabled at compile time. When
2665         this is the case, this causes compile errors.
2666
2667 2012-02-28  Alon Levy  <alevy@redhat.com>
2668
2669         controller_test: add README
2670
2671         client controller_test: reorder parameters since pid isn't needed for linux client test
2672
2673         client: handle CONTROLLER_ENABLE_SMARTCARD (rhbz 641828)
2674
2675         controller_test: add ENABLE_SMARTCARD
2676
2677 2012-02-26  Alon Levy  <alevy@redhat.com>
2678
2679         server: fix segfault on client disconnect
2680         ..as a result of missing initialization of newly introduced
2681         pre_disconnect in main channel.
2682
2683 2012-02-26  Fabiano Fidêncio  <fabiano@fidencio.org>
2684
2685         Enabling cursor in server/tests
2686             Now, cursor is being shown in all tests as a white rectangle and is
2687             running in the screen doing a diagonal movement. It's a very simple
2688             way to test cursor commands and is sufficient for our tests.
2689
2690 2012-02-21  Dan McGee  <dpmcgee@gmail.com>
2691
2692         Use standard IOV_MAX definition where applicable
2693         This is provided by <limits.h> on all platforms as long as _XOPEN_SOURCE
2694         is defined. On Linux, this is 1024, on Solaris, this is 16, and on any
2695         other platform, we now respect the value supported by the OS.
2696
2697         Respect IOV_MAX if defined
2698         Solaris has a pitiful maximum writev vector size of only 16, so the ping
2699         request at initial startup destroyed this call and broke things
2700         immediately. Reimplement stream_writev_cb() to respect IOV_MAX and break
2701         the writev() calls into chunks as necessary. Care was taken to return
2702         the correct values as necessary so the EAGAIN handling logic can
2703         determine where to resume the writev call the next time around.
2704
2705         red_worker: reimplement event loop using poll()
2706         This removes the epoll dependency we had in red_worker, which was the
2707         last Linux-specific call we were using in the entire Spice server. Given
2708         we never have more than 10 file descriptors involved, there is little
2709         performance gain had here by using epoll() over poll().
2710
2711         The biggest change is introduction of a new pre_disconnect callback;
2712         this is because poll, unlike epoll, cannot automatically remove file
2713         descriptors as they are closed from the pollfd set. This cannot be done
2714         in the existing on_disconnect callback; that is too late as the stream
2715         has already been closed and the file descriptor lost. The on_disconnect
2716         callback can not be moved before the close and other operations easily
2717         because of some behavior that relies on client_num being set to a
2718         certain value.
2719
2720         Use memcpy call in red_channel_create
2721         Rather than assign the callbacks one-by-one, we can just memcpy the
2722         struct into the one we have allocated in our RedChannel object, which is
2723         much more efficient, not to mention future-proof when more callbacks are
2724         added.
2725
2726         Cleanup definitions of disconnect methods
2727         We had multiple stub methods that simply called other disconnect
2728         methods, making my head hurt with the indirection. Call the right
2729         methods at the right time and rip out the stub methods; if they are
2730         truely needed later they can be added again.
2731
2732         red_worker: rename epoll_timeout to event_timeout
2733         With future patches in mind that will allow for some other
2734         non-Linux-specific event polling sytem to be used, rename this to a more
2735         generic name. All of the select/poll/epoll/kqueue family of calls are
2736         related to evented I/O, so 'event_' makes sense in this case.
2737
2738         Add configure-time check for -Wl, --version-script option
2739         This is supported by the GNU linker, but not the Solaris linker, which
2740         is used as the default on that platform even when compiling with GCC.
2741         Omit passing the option to the linker on platforms that do not support
2742         it.
2743
2744 2012-02-20  Hans de Goede  <hdegoede@redhat.com>
2745
2746         server/spicevmc: Don't destroy the rcc twice
2747         spicevmc calls red_channel_client_destroy() on the rcc when it disconnects
2748         since we don't want to delay the destroy until the session gets closed as
2749         spicevmc channels can be opened, closed and opened again during a single
2750         session.
2751
2752         This causes red_channel_client_destroy() to get called twice, triggering
2753         an assert, when a connected channel gets destroyed.
2754
2755         This was fixed with commit ffc4de01e6f9ea0676f17b10e45a137d7e15d6ac for
2756         the case where: a spicevmc channel was open on client disconnected, and
2757         the main channel disconnect gets handled first.
2758
2759         But the channel can also be destroyed when the chardev gets unregistered
2760         with the spice-server. This path still triggers the assert.
2761
2762         This patch fixes this by adding a destroying flag to the rcc struct, and
2763         also moves the previous fix over to the same, more clean, method of
2764         detecting this special case.
2765
2766 2012-02-15  Alon Levy  <alevy@redhat.com>
2767
2768         server/tests/basic_event_loop: print something on channel_event
2769
2770         server, separate SpiceChannelEventInfo from RedStream
2771         fixes rhbz 790749 use after free of SpiceChannelEventInfo.
2772
2773         The lifetime of the SpiceChannelEventInfo was that of RedsStream, but it
2774         is used by main_dispatcher_handle_channel_event after the RedsStream is
2775         freed for the cursor and display channels. Making SCEI allocation be at
2776         RedsStream allocation, and deallocation after the DESTROY event is
2777         processed by core->channel_event, fixes use after free.
2778
2779         README: make a note of SPICE_DEBUG_ALLOW_MC
2780
2781 2012-02-14  Dan McGee  <dpmcgee@gmail.com>
2782
2783         Remove all usages of bzero()
2784         As recommended by modern C practice, we should just be using memset().
2785
2786         Remove extra '\n' from red_printf() calls
2787         red_printf() takes care of adding a newline to all messages; remove the
2788         extra newline from all messages and macros that were doubling them up.
2789
2790 2012-02-14  Alon Levy  <alevy@redhat.com>
2791
2792         server/tests: use getopt_long
2793
2794 2012-02-14  Fabiano Fidêncio  <fabiano@fidencio.org>
2795
2796         Adding image to be used as "correct" in regression tests
2797
2798         Adding support to automated tests
2799             As suggested by Alon, a simple automated test to try to find
2800             regressions in Spice code.
2801             To use this, compile Spice with --enable-automated-tests and
2802             run test_display_streaming passing --automated-tests as parameter.
2803
2804 2012-02-14  Dan McGee  <dpmcgee@gmail.com>
2805
2806         Add casts for compatibility purposes
2807         Some non-Linux platforms return a (caddr_t *) result for the return
2808         value of mmap(), which is very unfortunate. Add a (void *) cast to
2809         explicitly avoid the warning when compiling with -Werror.
2810
2811         For the IO vector related stuff, signed vs. unsigned comes into play so
2812         adding a (void *) cast here is technically correct for all platforms.
2813
2814 2012-02-12  Yonit Halperin  <yhalperi@redhat.com>
2815
2816         server: support IPV6 addresses in channel events sent to qemu
2817         RHBZ #788444
2818
2819         CC: Gerd Hoffmann <kraxel@redhat.com>
2820
2821 2012-02-09  Erlon Cruz  <erlon.cruz@br.flextronics.com>
2822
2823         Fix mandatory -Werror option
2824         Compilation was breaking due to warning errors even when configuring with
2825         --enable-werror=no. This patch fix this.
2826
2827 2012-02-03  Christophe Fergeau  <cfergeau@redhat.com>
2828
2829         Handle Application::set_hotkeys failure
2830         Application::set_hotkeys can throw an exception if it fails parsing
2831         the string describing the hotkeys to set. Currently this exception
2832         is uncaught which causes spicec to terminate when the controller
2833         tries to set invalid hotkeys. Fall back to using the default
2834         hotkeys when the controller sends an invalid hotkeys string.
2835
2836 2012-01-31  Christophe Fergeau  <cfergeau@redhat.com>
2837
2838         Don't use "hw:0,0" for recording with alsa
2839         We currently hardcode this device when spicec needs to record with
2840         alsa. However, this doesn't interact well with PulseAudio, which
2841         means that if something is already using the recording device, spicec
2842         won't be able to open it again.
2843         Using "default" as the device will let spicec use the PulseAudio
2844         alsa support and will avoid this issue.
2845
2846 2012-01-23  Hans de Goede  <hdegoede@redhat.com>
2847
2848         More comparison between signed and unsigned integer expressions warning fixes
2849         Turns out that more recent snapshots of gcc-4.7 emit even more of these,
2850         so the fixes which I've done before tagging the 0.10.1 release are not
2851         enough to build warning free with the latest gcc-4.7 snapshot <sigh>.
2852
2853         This fixes this.
2854
2855         Release 0.10.1
2856
2857         Fix various comparison between signed and unsigned integer expressions warnings
2858         These turn into errors because of our -Werror use, breaking the build.
2859
2860 2012-01-23  Alon Levy  <alevy@redhat.com>
2861
2862         server/red_channel: red_peer_handle_incoming: comment on null check
2863
2864         server/tests/test_empty_success: fix warning on bzero
2865
2866 2012-01-23  Dan McGee  <dpmcgee@gmail.com>
2867
2868         Use found python binary to check for pyparsing
2869         This matches what we do in client/Makefile.am to actually run the
2870         python scripts, which is to use the python binary we find first,
2871         preferring 'python2' over 'python'. This makes the compile work on odd
2872         systems such as Arch Linux where the python binary is actually python3.
2873
2874         Remove epoll headers from client code
2875         There is no more usage of epoll on the client side, so no need to
2876         include these header files.
2877
2878 2012-01-23  Nahum Shalman  <nshalman-github@elys.com>
2879
2880         server: don't complain if setsockopt(SO_PRIORITY) call fails
2881         dc7855967f4e did this for the TCP_NODELAY and IP_TOS calls; we should do
2882         it for priority as well if necessary.
2883
2884         We also #ifdef the setting of the low-level socket priority based on
2885         whether we have a definition of SO_PRIORITY available. This option is
2886         not available on Illumos/Solaris platforms; however, since we set IP_TOS
2887         anyway it is not a big deal to omit it here.
2888
2889 2012-01-23  Dan McGee  <dpmcgee@gmail.com>
2890
2891         server/inputs_channel: don't set O_ASYNC option on socket
2892         output to send a SIGIO signal to the running program. However, we don't
2893         handle this signal anywhere in the code, so setting the option is
2894         unnecessary.
2895
2896         Update .gitignore with a few more generated files
2897
2898         Fix git commit hook errors in red_worker
2899         This ensures all line lengths are down below 100 characters as well as
2900         removing some trailing spaces.
2901
2902         Fix line length errors in main_channel
2903         These are all existing errors; fix them so they don't block future
2904         commits in this file unnecessarily.
2905
2906             error (1): length @ server/main_channel.c +369
2907             error (2): length @ server/main_channel.c +444
2908             error (3): length @ server/main_channel.c +764
2909             error (4): length @ server/main_channel.c +932
2910             error (5): length @ server/main_channel.c +1044
2911
2912 2012-01-22  Alon Levy  <alevy@redhat.com>
2913
2914         docs/Spice_for_newbies.odt: some updates - added copy paste and wan mention, removed vdi_port
2915
2916         server/red_channel: avoid segfault if stream == NULL
2917
2918         client/foreign_menu: arm build fix
2919
2920         import existing odt docs
2921
2922 2012-01-18  Hans de Goede  <hdegoede@redhat.com>
2923
2924         server: Don't complain if setsockopt NODELAY fails on unix sockets
2925         With Daniel P. Berrange's patches to allow use of pre-supplied fd's
2926         as channels, we can no longer be sure that our connections are TCP
2927         sockets, so it makes no sense to complain if a TCP/IP specific
2928         setsockopt fails with an errno of ENOTSUP.
2929
2930         Note that this extends Daniel's commit 492ddb5d1d595e2d12208f4602b18e4432f4e6b4
2931         which already added the same check to server/inputs_channel.c
2932
2933 2012-01-13  Daniel P. Berrange  <berrange@redhat.com>
2934
2935         Add a 'syntax-check' make target
2936         The 'make syntax-check' target is used to perform various code
2937         style sanity checks, as well as to detect certain trivial error
2938         patterns. The target is placed in GNUmakefile, instead of Makefile.am
2939         since it relies on GNU specific make extensions.
2940
2941         The actual GNUmakefile and maint.mk files are taken from the
2942         GNULIB project, unchanged
2943
2944         The cfg.mk file is used to configure which of the syntax checks
2945         are activated, to allow addition of new project specific syntax
2946         checks, and to blacklist certain files which should not be checked
2947
2948         * .mailmap: Add mapping for various broken email addrs in
2949           commit log, to stop complaints about AUTHORS file missing
2950           entries
2951         * GNUmakefile: define the 'syntax-check' rule
2952         * maint.mk: definition of standard syntax checks
2953         * cfg.mk: configuration for checks
2954
2955         Remove trailing whitespace from end of lines
2956
2957         Replace  test XXX -a YYY with test XXX && test YYY
2958         The '-a' and '-o' operators to test are not portable. Always
2959         combine two invocations of 'test' using || or && instead.
2960
2961         Add missing includes of config.h
2962         Not all files were including config.h
2963
2964         Remove bogus include of strings.h
2965         The tests include strings.h but don't need any of its functions
2966
2967         Remove unused backup file
2968         The common/glc.c.save file appears to be a obsolete copy of
2969         glc.c
2970
2971         Remove trailing blank lines
2972         Remove any blank lines at the end of all source files
2973
2974         Remove 'the the' typos
2975
2976         Remove unused assert.h include
2977         The assert.h include was never used in any code
2978
2979         Always quote first arg to AC_DEFINE
2980         The first arg to AC_DEFINE should always be quoted
2981
2982         Fix up copyright decl to always use 'Copyright (C) Red Hat, Inc.'
2983         A couple of files were missing '(C)' in the copyright header
2984
2985         Improve usefulness of README file
2986         The COPYING file already contains the license text, so the README
2987         file need not repeat it. Instead put in a description of what
2988         SPICE is, simple install instructions & pointers to mailing lists
2989         and bug trackers
2990
2991         Fill out the AUTHORS file with some content
2992         The AUTHORS file is empty, fill it in with a list of present and
2993         past maintainers, and email addresses of all people who have
2994         contributed patches
2995
2996         Remove casts from void * with xrealloc() calls
2997         The xrealloc() function returns void*, so the return value
2998         never needs to be cast
2999
3000         Rewrite code to avoid triggering warning about casting param to free()
3001         Since free() takes a void* parameters do not need to be cast.
3002
3003         The existing code here is actally fine, but it trips up the
3004         syntax-check rule, so tweak it to an equivalent construct
3005         which passes the syntax check
3006
3007         Remove useless if() before free()
3008         The free() function allows NULL to be passed in, so any
3009         code which puts a if() before free() is wasting time
3010
3011         Death to all TABs
3012         Source files should all use spaces instead of tabs for
3013         indentation. Update the few files not already in
3014         compliance
3015
3016 2012-01-13  Alon Levy  <alevy@redhat.com>
3017
3018         common/ssl_verify: special case to WIN32 that isn't MINGW32
3019
3020         common/bitops: mingw32: reorder so __GNUC__ define is checked first
3021
3022         common/backtrace: for mingw32 no pipe/wait_pid, just disable
3023
3024         client/windows: fix several assigned but not used errors
3025
3026         client/windows: arraysize(inf.bmiColors) == 1 in mingw32
3027
3028         client/windows: fix typo, make error messages unique
3029
3030         client/windows/main: mingw32 provides PACKAGE_VERSION
3031
3032         client/common: mingw32: workaround HAVE_STDLIB_H redefined in jconfig.h
3033
3034         client: mingw32 build needs the jpeg_boolean define
3035
3036         client/common.h: mingw32 fix
3037         define PACKAGE_VERSION only ifndef __GNUC__
3038         Since it is defined by autoconf and so it kinda comes with using the GNU
3039         compilers.
3040
3041         client/Makefile.am: mingw32 fixes
3042         * build resource file with windres
3043         * include client/windows and not client/x11
3044         * use CXIMAGE_CFLAGS (it's already set to -DDISABLE_CXIMAGE correctly)
3045
3046         client: log command line (rhbz 767581)
3047
3048 2012-01-13  Hans de Goede  <hdegoede@redhat.com>
3049
3050         client-x11: Fix building with gcc-4.7
3051         Without this change gcc says:
3052         x11/res.cpp:31:1: error: narrowing conversion of ‘(((unsigned int)_alt_image.<anonymous struct>::width) * 4u)’ from ‘unsigned int’ to ‘int’ inside { } is ill-formed in C++11 [-Werror=narrowing]
3053         x11/res.cpp:61:1: error: narrowing conversion of ‘_red_icon.<anonymous struct>::width’ from ‘const uint32_t {aka const unsigned int}’ to ‘int’ inside { } is ill-formed in C++11 [-Werror=narrowing]
3054         x11/res.cpp:61:1: error: narrowing conversion of ‘_red_icon.<anonymous struct>::height’ from ‘const uint32_t {aka const unsigned int}’ to ‘int’ inside { } is ill-formed in C++11 [-Werror=narrowing]
3055         cc1plus: all warnings being treated as errors
3056
3057         smartcard handling: Fix compilation when ASSERT-s are turned on
3058
3059 2012-01-12  Yonit Halperin  <yhalperi@redhat.com>
3060
3061         server: add support for SPICE_COMMON_CAP_MINI_HEADER
3062         Support for a header without a serial and without sub list.
3063         red_channel: Support the two types of headers.
3064                      Keep a consistent consecutive messages serial.
3065         red_worker: use urgent marshaller instead of sub list.
3066         snd_worker: Sound channels need special support since they still don't use
3067                     red_channel for sending & receiving.
3068
3069         configure: spice-protocol >= 0.10.1 (mini header support)
3070
3071         server: Limit the access to SpiceDataHeader of messages - only via red_channel.
3072
3073         server/red_worker: pass remote caps to display/cursor red_channel_client's
3074
3075         server/red_channel: introduce urgent marshaller
3076         When red_channel::red_channel_client_begin_send_message is called,
3077         the message that is pending in the urgent marshaller will be sent before
3078         the one in the main channel.
3079         The urgent marshaller should be used if in the middle of marshalling one message,
3080         you find out you need to send another message before. This functionality
3081         is equivalent to the sub_list messages. It will replace them in the following
3082         patches, when sub_list is removed from Spice data header.
3083
3084         spice.proto: add SPICE_MSG_LIST to base channel
3085
3086 2012-01-12  Hans de Goede  <hdegoede@redhat.com>
3087
3088         codegen: Fix enums.h generation
3089         With the new usbredir code we have the new concept of the abstract /
3090         generic spicevmc channel type (which just tunnels data from a qemu chardev),
3091         and we've the usbredir channel, which is the only current user of this.
3092
3093         This was reflected in the protocols enum in spice-protocol.h by a manual
3094         edit done by me, my bad. This patch teaches spice.proto about the relation
3095         between the abstract spicevmc channel and the usbredir channel and
3096         modifies codegen to deal with this.
3097
3098 2012-01-09  Daniel P. Berrange  <berrange@redhat.com>
3099
3100         Do not assume that SPICE is using a TCP socket
3101         If setting the TCP_NODELAY socket option fails with ENOTSUP,
3102         then don't treat this is a fatal error. SPICE is likely just
3103         running over a UNIX socket instead.
3104
3105         * server/inputs_channel.c: Ignore TCP_NODELAY socket opt fails
3106
3107         Allow auth to be skipped when attaching to pre-accepted clients
3108         When an applications passes in a pre-accepted socket for a
3109         client, they may well have already performed suitable authentication
3110         out of band. They should thus have the option to request that any
3111         spice authentication is skipped.
3112
3113         * server/reds.c, spice.h: Add flag for skipping auth
3114
3115         Add APIs for injecting a client connection socket
3116         Allow applications to pass a pre-accepted client socket file
3117         descriptor in. The new APIs are spice_server_add_ssl_client
3118         and spice_server_add_client
3119
3120         * server/reds.c: Implement new APIs
3121         * server/spice.h: Define new APIs
3122
3123         Move SSL setup out of reds_accept_ssl_connection
3124         To allow setup of an SSL client, from a passed in client
3125         socket, move all the SSL client initialization code out
3126         of reds_accept_ssl_connection and into a new method called
3127         reds_init_client_ssl_connection
3128
3129         * server/reds.c: Introduce reds_init_client_ssl_connection
3130
3131         Rename __reds_accept_connection into reds_init_client_connection
3132         Remove the accept() call from __reds_accept_connection and
3133         rename it to reds_init_client_connection. The caller is now
3134         responsible for accepting the new socket. The method
3135         reds_init_client_connection merely initializes it for
3136         usage.
3137
3138         * server/reds.c: Add reds_init_client_connection
3139
3140         Merge reds_accept_connection into reds_accept
3141         Neither reds_accept_connection or reds_accept are very long,
3142         so the split is pointless & increases code size for no gain.
3143         Merge them together to reduce code size
3144
3145         * server/reds.c: Merge reds_accept_connection into reds_accept
3146
3147 2011-12-22  Hans de Goede  <hdegoede@redhat.com>
3148
3149         spicevmc: Set sockopt nodelay for usbredir channels
3150         We want as little latency as possible with usb channels.
3151
3152 2011-12-22  Yonit Halperin  <yhalperi@redhat.com>
3153
3154         server: don't reset the display channel when disconnecting all its clients ,FDBZ #43977
3155         The display channel was unnecessarily set to NULL when we disconnect all the clients
3156         (on flush display commands timeout).
3157         As a result, we recreated the display channel when a new client was connected.
3158         The display channel was created with default red_channel.client_cbs, while its
3159         correct client_cbs are the ones that are set by the red_dispatcher when it creates
3160         the first display_channel.
3161         This fix enforces a single creation of the display channel (per qxl), via the red_dispatcher.
3162
3163 2011-12-22  Uri Lublin  <uril@redhat.com>
3164
3165         client: screen: fix typo _forec_update_timer
3166         sed -i 's/_forec_update_timer/_force_update_timer/' screen.cpp screen.h
3167
3168         client: RedScreen::RedScreen: fix initialization order of _menu_needs_update
3169         Related to a91b0b3ff712eb2a7d91a951f2af7842495357c3
3170
3171 2011-12-20  Uri Lublin  <uril@redhat.com>
3172
3173         client: foreign-menu: pass "active" param when creating a ForeignMenu (#769020)
3174         The default stays the same -- false.
3175
3176         A race could prevent setting ForeignMenu::_active correctly.
3177         That happened when Application::on_app_activated was called before
3178         _foriegn_menu was created. When foriegn_menu was created its
3179         _active defaults to false, and that has not changed, until focus
3180         was taken out and back in spice-client window.
3181
3182         This caused usbrdr to sometimes not auto-share devices, unless
3183         the user switched focus to a different application and back to
3184         spicec.
3185
3186         The fix updates ForiegnMenu::_active upon creation.
3187
3188         client: update menu if needed when exiting full-screen mode (#758260)
3189
3190         client: menu: make RedWindow::set_menu() return an error-code (#758260)
3191         RedWindow::set_menu() can fail (on Windows when in fullscreen mode).
3192         For Windows spice-client, when in fullscreen mode, the system-menu
3193         is NULL.
3194
3195         Returns 0 upon success, non-0 (currently only -1) upon failure.
3196
3197         client controller/foreign_menu: use memmove instead of memcpy in readers
3198         When src/dst memory areas may overlap, it's safer to use memmove.
3199
3200 2011-12-18  Hans de Goede  <hdegoede@redhat.com>
3201
3202         spicevmc: Fix assert when still connected on session disconnect (fdo#43903)
3203         Currently when the main channel disconnects while a spicevmc channel
3204         (such as a usbredir channel) is still connected, qemu will abort with the
3205         following message:
3206         ring_remove: ASSERT item->next != NULL && item->prev != NULL failed
3207
3208         This is caused by red_client_destroy() first calling:
3209         rcc->channel->client_cbs.disconnect(rcc);
3210         And then calling:
3211         red_channel_client_destroy(rcc);
3212
3213         For each channel. This is fine, but the spicevmc disconnect code does a
3214         red_channel_client_destroy(rcc) itself since as usb devices are added
3215         / removed, the channels carrying their traffic get connected / disconnected
3216         and they get re-used for new devices, which won't work if the old channel is
3217         still there when the new connection comes in.
3218
3219         This patch fixes the double destroy when there are still spicevmc channels
3220         connected by not doing the red_channel_client_destroy from the spicevmc
3221         disconnect code when not just the channel, but the entire client is
3222         disconnecting.
3223
3224 2011-12-15  Marc-André Lureau  <marcandre.lureau@redhat.com>
3225
3226         build: remove unused variable
3227
3228 2011-12-15  Hans de Goede  <hdegoede@redhat.com>
3229
3230         server/red_parse_qxl.h: License should be LGPLv2+ rather then GPLv2+
3231         Also fixup the header of server/red_parse_qxl.c, which still contained
3232         some GPL (program rather then library) text in its header.
3233
3234 2011-12-14  Marc-André Lureau  <marcandre.lureau@redhat.com>
3235
3236         spelling: s/cupture/capture
3237
3238 2011-11-28  Jürg Billeter  <j@bitron.ch>
3239
3240         server: Move $(Z_LIBS) from INCLUDES to LIBADD in Makefile.am
3241         This fixes undefined references to deflate* when building tests.
3242
3243 2011-11-24  Gal Hammer  <ghammer@redhat.com>
3244
3245         client: handle the redundant right ctrl windows' message send when a alt-gr is pressed bz#709074
3246         Hello,
3247
3248         The second patch check to see if Windows is sending a fake VK_CONTROL
3249         message when the user pressed Alt-Gr when using a non-US keyboard layout
3250         (German, Czech, etc...).
3251
3252         If the function is_fake_ctrl return true and key event is translated to
3253         a REDKEY_INVALID and the event is discarded.
3254
3255              Gal.
3256
3257         client: handle the redundant right ctrl windows' message send when a alt-gr is pressed bz#709074
3258         Hello,
3259
3260         I first updated the translate_key function. It now requires the windows
3261         message as parameter (will be used later). It also use the raw wparam
3262         and lparam parameters in order to remove the code duplication when
3263         calling the function.
3264
3265              Gal.
3266
3267 2011-11-14  Arnon Gilboa  <agilboa@redhat.com>
3268
3269         client: add xinerama support
3270         RHEL-6 Bugzilla: 695323
3271
3272         cherry-picked from qspice commit
3273          003667ac99beeec9b330a07bc3569c59a96d4588
3274          which fixes RHEL-5 541566
3275
3276         with merge of the one line qspice fix to SPICE_REQUIRES:
3277          9f3fe4755f11044a45c4b21148466a997fcbf735
3278          spice: fixed reference to xinerama pkg config file
3279          (Xinerama.pc=>xinerama.pc)
3280          Author: Yonit Halperin <yhalperi@redhat.com>
3281
3282 2011-11-10  Alon Levy  <alevy@redhat.com>
3283
3284         Release 0.10.0
3285
3286         Update NEWS for 0.10.0 release
3287
3288         server/mjpeg_encoder: use size_t * consistently
3289         fix another 64 bit-ism. unsigned long != size_t in general.
3290
3291         server/main_channel: fix pointer-to-int-cast error
3292         64 bit-ism removed.
3293
3294         server/main_channel: use PRIu64 where needed
3295
3296 2011-11-08  Alon Levy  <alevy@redhat.com>
3297
3298         server/spice-server.syms: fix 0.8 compatibility
3299         spice_server_migrate_connect is in 0.8.3 in the released 0.8 branch,
3300         and so should not be changed in 0.10. This doesn't break the 0.9.1
3301         release which didn't contain this symbol at all, only 0.9.2 release
3302         that hopefully no one actually packaged.
3303
3304         server/red_worker: reuse dispatcher
3305         This patch reuses Dispatcher in RedDispatcher. It adds two helpers
3306         to red_worker to keep RedWorker opaque to the outside. The dispatcher is
3307         abused in three places that use the underlying socket directly:
3308          once sending a READY after red_init completes
3309          once for each channel creation, replying with the RedChannel instance
3310           for cursor and display.
3311
3312         FDO Bugzilla: 42463
3313
3314         rfc->v1:
3315         * move callbacks to red_worker.c including registration (Yonit)
3316         * rename dispatcher to red_dispatcher in red_worker.c and red_dispatcher.c
3317         * add accessor red_dispatcher_get_dispatcher
3318         * s/dispatcher_handle_recv/dispatcher_handle_recv_read/ and change sig to
3319           just Dispatcher *dispatcher (was the SpiceCoreInterface one)
3320         * remove SpiceCoreInterface parameter from dispatcher_init (Yonit)
3321         * main_dispatcher needed it for channel_event so it has it in
3322           struct MainDispatcher
3323         * add dispatcher_get_recv_fd for red_worker
3324
3325         server/dispatcher: add dispatcher_register_async_done_callback
3326
3327         introduce DISPATCHER_{NONE,ACK,ASYNC}
3328
3329         server: introduce dispatcher
3330         used for main_dispatcher only in this patch.
3331
3332         Dispatcher is meant to be used for Main<->any low frequency messages.
3333
3334         It's interface is meant to include the red_dispatcher usage:
3335          fixed size messages per message type
3336          some messages require an ack
3337
3338         Some methods are added to be used by RedDispatcher later:
3339          dispatcher_handle_read - to be called directly by RedDispatcher epoll
3340           based loop
3341          dispatcher_set_opaque - to be set from red_worker pthread
3342          dispatcher_init - allow NULL core as used by red_worker
3343
3344         Read and Write behavior:
3345          Sender: blocking write, blocking read for ack (if any).
3346          Reader: poll for any data, if such then blocking read for a
3347          message_type and following message. repeat until poll returns
3348          with no pending data to read.
3349
3350         FDO Bugzilla: 42463
3351
3352 2011-11-07  Alon Levy  <alevy@redhat.com>
3353
3354         server/red_dispatcher: remove semicolon from DBG_ASYNC
3355
3356         server: add prefix argument to red_printf_debug
3357         printed before function name. No central location for prefixes.
3358         Adding "WORKER", "ASYNC", "MAIN" since those were the current users.
3359
3360         server/red_dispatcher: support concurrent asyncs
3361         This is part of the dispatcher update, extracting the dispatcher routine
3362         from red_dispatcher and main_dispatcher into dispatcher.
3363
3364         Supporting multiple async operations will make it natural to support
3365         async monitor commands and async guest io requests that could overlap in
3366         time.
3367
3368         Use a Ring for AsyncCommands.
3369
3370         Free Desktop Bugzilla: 42463
3371
3372         Related FD: 41622
3373
3374         common/spice_common.h: red_printf_debug: fix wrong sign
3375
3376 2011-11-02  Yonit Halperin  <yhalperi@redhat.com>
3377
3378         Release 0.9.2
3379
3380         client: support semi-seamless migration between spice servers with different protocols.
3381         It can't actually happen right now, since switch-host migration scheme will take
3382         place if the src/target server has protocol 1.
3383         (cherry picked from commit 4b2bf4d88c253502003aa5e4b93a045742eec9b4 branch 0.8)
3384
3385         client: display channel - destroy all surfaces on disconnect
3386         Fix not destroying surfaces and other data (e.g., streams) upon disconnection.
3387         (cherry picked from commit 010b22cd771b7e81363b4b6521e4265b093fcd25 branch 0.8)
3388
3389         client: display channel migration (cherry picked from commit cad3c585444f940f60c12789f4174f2d32bec70f branch 0.8)
3390         Conflicts:
3391
3392                 client/display_channel.cpp
3393
3394         client: playback/record channels: implement on_disconnect (cherry picked from commit d3ed9d5e9d52ddcadcb3c8c77dd827b50071d813 branch 0.8)
3395
3396         client: main channel migration: do partial cleanup when switching hosts
3397         Implement on_disconnect_mig_src and on_connect_mig_target in order to avoid
3398         unnecessary cleanups done in on_(disconnet|connect).
3399         In addition, do not request guest display settings changes after migration.
3400         (cherry picked from commit f91d202eb3bf631cf5e70277d1aabffec7da9393 branch 0.8)
3401
3402         client: handle SPICE_MSG_MAIN_MIGRATE_END
3403         (1) disconnect all channels from the migration src
3404         (2) after all channels are disconnected, clean global resources
3405         (3) send SPICE_MSGC_MAIN_MIGRATE_END to migration target
3406         (4) wait for SPICE_MSG_MAIN_INIT
3407         (4) switch all channels to migration target
3408         (cherry picked from commit 510a4ff7c4f188fe6d0fb12198b8f9fdb74b9a2d branch 0.8)
3409
3410         Conflicts:
3411
3412                 client/red_channel.h
3413
3414         client: handle SpiceMsgMainMigrationBegin (semi-seamless migration)
3415         RHBZ 725009, 738270
3416         (cherry picked from commit 31ed2519a752b7332ed40d0d7ab02e938c0e65cb branch 0.8)
3417
3418         Conflicts:
3419
3420                 client/red_client.cpp
3421
3422         client: rewrite surfaces cache
3423         use std::map instead of a specific template (CHash).
3424         There is no need for special template. Moreover, using
3425         std::map will allow easy iteration over the surfaces.
3426         (cherry picked from commit fcb3b4ce5231218bcf949da4270bd85a2cfb3535 branch 0.8)
3427
3428         Conflicts:
3429
3430                 client/display_channel.cpp
3431
3432         server: turn spice_server_migrate_start into a valid call
3433         We will add a qemu call to spice_server_migrate_start when migration starts.
3434         For now, it does nothing, but we may need this notification in the future.
3435         (cherry picked from commit b8213167717979e6f2fb52646e43eb458634e6a1 branch 0.8)
3436
3437         server: handling semi-seamless migration in the target side
3438         (1) not sending anything to a migrated client till we recieve SPICE_MSGC_MIGRATE_END
3439         (2) start a new client migration (handle client_migrate_info) only after SPICE_MSGC_MIGRATE_END
3440             from the previous migration was received for this client
3441         (3) use the correct ticket
3442
3443         Note: we assume the same channles are linked before and ater migration. i.e.,
3444               SPICE_MSGC_MAIN_ATTACH_CHANNELS is not sent from the clients.
3445
3446         server: move the linking of channels to a separate routine
3447
3448         server: handle spice_server_migrate_end
3449         If the migration has completed successfully:
3450         (1) send MSG_MAIN_MIGRATE_END to the clients that are connected to the target
3451         (2) send MSG_MAIN_SWITCH_HOST to all the other clients
3452
3453         If the migration failed, send MSG_MAIN_MIGRATE_CANCEL to clients that are
3454         connected to the target.
3455
3456         (cherry picked from commit 4b82580fc36228af13db4ac3c403753d6b5c40b5 branch 0.8;
3457          Was modified to support multiple clients, and the separation of main_channel from reds)
3458
3459         Conflicts:
3460
3461                 server/reds.c
3462
3463         spice.proto: add SPICE_MSG_MAIN_MIGRATE_END & SPICE_MSGC_MAIN_MIGRATE_END
3464         (cherry picked from commit cfbd07710562e522179ae5a7085a789489a821bb branch 0.8)
3465
3466         server,proto: tell the clients to connect to the migration target before migraton starts
3467         (1) send SPICE_MSG_MAIN_MIGRATE_BEGIN upon spice_server_migrate_connect
3468             (to all the clients that support it)
3469         (2) wait for SPICE_MSGC_MAIN_MIGRATE_(CONNECTED|CONNECT_ERROR) from all the relevant clients,
3470             or a timeout, in order to complete client_migrate_info monitor command
3471         (cherry picked from commit 5560c56ef05c74da5e0e0825dc1f134019593cad branch 0.8;
3472          Was modified to support the separation of main channel from reds, and multiple clients)
3473
3474         Conflicts:
3475
3476                 server/reds.c
3477
3478         configure: spice-protocol >= 0.9.1 (semi-seamless migration protocol) (cherry picked from commit 55ccc022ec9829523ebe36fdf0ec7c593ce76c22 branch 0.8)
3479         Conflicts:
3480
3481                 configure.ac
3482
3483         server: handle migration interface addition
3484         (cherry picked from commit 3ac0075cdac8fa42de47a7882022795e96cb1fee branch 0.8)
3485
3486         Conflicts:
3487
3488                 server/reds.h
3489
3490         server/spice.h: semi-seamless migration interface, RHBZ #738266
3491         semi-seamless migration details:
3492
3493         migration source side
3494         ---------------------
3495         (1) spice_server_migrate_connect (*): tell client to link
3496             to the target side - send SPICE_MSG_MAIN_MIGRATE_BEGIN.
3497             This should be called upon client_migrate_info cmd.
3498             client_migrate_info is asynchronous.
3499         (2) Complete spice_server_migrate_connect only when the client has been connected
3500             to the target - wait for SPICE_MSGC_MAIN_MIGRATE_(CONNECTED|CONNECT_ERROR) or a timeout.
3501         (3) spice_server_migrate_end: tell client migration it can switch to the target - send
3502             SPICE_MSG_MAIN_MIGRATE_END.
3503         (4) client cleans up all data related to the connection to the source and switches to the target.
3504             It sends SPICE_MSGC_MAIN_MIGRATE_END.
3505
3506         migration target side
3507         ---------------------
3508         (1) the server identifies itself as a migraiton target since the client is linked with (connection_id != 0)
3509         (2) server doesn't start the channels' logic (channel->link) till it receives SPICE_MSGC_MAIN_MIGRATE_END
3510             from the client.
3511
3512         *   After migration starts, the target qemu is blocked and cannot accept new spice client
3513             connections. Thus, we trigger the connection to the target upon client_migrate_info
3514             command.
3515         (cherry picked from commit 6e56bea67c5648b0c81990171d4bc0cf1a402043 branch 0.8)
3516
3517         Conflicts:
3518
3519                 server/spice.h
3520
3521         server: set & test channel capabilities in red_channel
3522         The code for setting and testing channel capabilities was
3523         unnecessarily duplicated. Now it is in red_channel.
3524         RedsChannel was dropped from Reds; It was used only for holding
3525         the channels common capabilities, which are now held in RedChannel.
3526
3527 2011-10-31  Alon Levy  <alevy@redhat.com>
3528
3529         [0.8 branch] server: add main_dispatcher
3530         add main_dispatcher, a message passing mechanism for sending messages to
3531         the main thread. The main thread is the thread that implements
3532         SpiceCoreInterface, which is assumed to be a single thread.
3533
3534         Similar to the async operation of red_worker, a socket pair is created
3535         and used to pass messages. The messages are a fixed size to ease
3536         parsing. A single message is defined to pass a channel_event.
3537
3538         RHBZ: 746950
3539         FDBZ: 41858
3540
3541         This patch is 0.8 branch only, for the master branch there should be a
3542         better approach to share code with red_dispatcher and ready the way for
3543         later adding more threads.
3544
3545         cherry-pick from 0.8 80caf07e09efe14c67f89a3c01501a6a39681167
3546
3547         Conflicts:
3548
3549                 server/reds.c
3550
3551 2011-10-23  Liang Guo  <bluestonechina@gmail.com>
3552
3553         spice-server.pc.in: move Requires to Requires.private
3554         When using pkg-config, Requires and Requires.private field list
3555         packages required by this package, but packages listed under
3556         Requires.private are not taken into account when a flag list is
3557         computed for dynamically linked executable. In the situation
3558         where each .pc file corresponds to a library, Requires.private
3559         shall be used exclusively to specify the dependencies between
3560         the libraries.
3561
3562 2011-10-18  Yonit Halperin  <yhalperi@redhat.com>
3563
3564         server/red_worker: fix placing of ASSERT(red_channel_client_no_item_being_sent) (fdbz #41523)
3565         Call ASSERT(red_channel_client_no_item_being_sent) only if
3566         red_wait_outgoing_item/s did not timeout.
3567
3568 2011-10-05  Christophe Fergeau  <cfergeau@redhat.com>
3569
3570         client/x11: reset screen positions in XMonitor::do_restore
3571         XMonitor::do_restore (called for example when going out of
3572         fullscreen) restore the screen resolution to its previous state,
3573         but it doesn't take care of repositioning the screen to their
3574         previous position, which is one of the advantages of using randr
3575         1.2.
3576         Since MultyMonScreen::restore handles all of this for us, just call
3577         it to restore the monitor position/resolutions to their previous
3578         settings. Before doing any changes, MultyMonScreen::restore checks
3579         if there's something to do, so calling it once per monitor won't be
3580         an issue, the resolution/position will only be set the first time.
3581
3582         This has the side-effect of fixing bug #693431. This bug occurs when
3583         closing the client after the client went in and out of fullscreen.
3584         MultyMonScreen::~MultyMonScreen calls MultyMonScreen::restore, which
3585         decides to change the screen positions since they were lost when going
3586         to fullscreen because XMonitor::restore didn't restore the positions.
3587         After this change, the positions will be properly restored and
3588         MultyMonScreen::restore won't be needlessly called upon client
3589         shutdown.
3590
3591         client/x11: fix mode setting in MultyMonScreen::restore
3592         MultyMonScreen::restore changes the X11 Screen resolution, but it
3593         doesn't use MultyMonScreen::set_size. This means
3594         MultyMonScreen::_width and MultyMonScreen::_height don't get
3595         updated to reflect the new resolution settings, which could cause
3596         issues later on. Until now this was safe since the only caller of
3597         MultyMonScreen::restore was MultyMonScreen destructor.
3598
3599         client/x11: fix typos (finde => find)
3600
3601 2011-09-20  Christophe Fergeau  <cfergeau@redhat.com>
3602
3603         client: fix typo commnad=>command
3604
3605 2011-09-19  Christophe Fergeau  <cfergeau@redhat.com>
3606
3607         client: don't crash when booting a Xinerama setup
3608         In a Xinerama setup, when X starts up and creates one of the
3609         secondary screens, first a non-primary surface is created on the
3610         secondary screen, and then the primary surface for this screen is
3611         created.
3612         This causes a crash when the guest uses Xinerama and the client
3613         is attached to the VM before X starts (ie while the guest is
3614         booting).
3615         This happens because DisplayChannel::create_canvas (which is called
3616         when creating a non-primary surface) assumes a screen has already been
3617         set for the DisplayChannel while this only happens upon primary surface
3618         creation. However, it uses the screen for non important stuff, so we
3619         can test if screen() is non NULL before using it. This is what is done
3620         in other parts of this file.
3621
3622         Fixes rhbz #732423
3623
3624         replace warning with comment in glz_usr_free_image
3625         When running some xinerama tests, I got several
3626         glz_usr_free_image: error
3627         messages. Looking at the code, this error is reported when this
3628         function is called from a different DisplayChannelClient than the
3629         one which created the glz compressed image.
3630         When this happens, the backtrace is
3631             at glz_encoder_dictionary.c:362
3632             0x7fff940b6670) at glz_encoder_dictionary.c:449
3633             image_type=LZ_IMAGE_TYPE_RGB32, image_width=512, image_height=256, image_stride=2048, first_lines=0x0,
3634             num_first_lines=0, usr_image_context=0x7fff7420da40, image_head_dist=0x7fff9b2a3194)
3635             at glz_encoder_dictionary.c:570
3636             top_down=4, lines=0x0, num_lines=0, stride=2048, io_ptr=0x7fff740ea7c0 "  ZL", num_io_bytes=65536, usr_context=
3637             0x7fff7420da40, o_enc_dict_context=0x7fff7420da60) at glz_encoder.c:255
3638             drawable=0x7fff9b46bc08, o_comp_data=0x7fff9b2a3350) at red_worker.c:5753
3639             0x7fff9b46bc08, can_lossy=0, o_comp_data=0x7fff9b2a3350) at red_worker.c:6211
3640             0x7fff9b46bc08, can_lossy=0) at red_worker.c:6344
3641             0x7fff74085c50, dpi=0x7fff7445b890, src_allowed_lossy=0) at red_worker.c:7046
3642             0x7fff7445b890) at red_worker.c:7720
3643             at red_worker.c:7964
3644             at red_worker.c:8431
3645
3646         Since the glz dictionary is shared between all the
3647         DisplayChannelClient instances that belong to the same client, it can
3648         happen that the glz dictionary code decides to free an image from one
3649         thread while it was added from another thread (thread ==
3650         DisplayChannelClient), so the error message that is printed is not an
3651         actual error. This commit removes this message and adds a comment
3652         explaining what's going on.
3653
3654 2011-09-15  Christophe Fergeau  <cfergeau@redhat.com>
3655
3656         fix typos
3657         applicaion => application
3658         Attache => Attach
3659         Detache => Detach
3660         _layes => _layers
3661
3662 2011-09-05  Christophe Fergeau  <cfergeau@redhat.com>
3663
3664         server: fix function prototypes
3665         Several functions in server/ were not specifying an argument list,
3666         ie they were declared as void foo(); When compiling with
3667         -Wstrict-prototypes, this leads to:
3668         test_playback.c:93:5: erreur: function declaration isn’t a prototype
3669         [-Werror=strict-prototypes]
3670
3671 2011-09-01  Marc-André Lureau  <marcandre.lureau@redhat.com>
3672
3673         fix bug #692833
3674
3675 2011-09-01  Christophe Fergeau  <cfergeau@redhat.com>
3676
3677         add C++ guards to backtrace.h
3678         Without these, spice_backtrace() can't be used from the C++ client
3679         code.
3680
3681         server: init all fields on SpiceMsgDisplayStreamCreate
3682         red_display_marshall_stream_start initializes a
3683         SpiceMsgDisplayStreamCreate structure before marshalling it and
3684         sending it on the wire. However, it never fills
3685         SpiceMsgDisplayStreamCreate::stamp which then causes a complaint
3686         from valgrind. This patch sets this value to 0, it's not used
3687         by the client so the value shouldn't matter.
3688
3689         fix valgrind warning in test_display__stream
3690         create_test_primary_surface::test_display_base.c creates a
3691         QXLDevSurfaceCreate structure and initialize it, but doesn't set
3692         the position field. Moreover, this structure has 4 bytes of padding
3693         to the end (as shown by pahole from dwarves), so initialize the whole
3694         structure to 0 before using it.
3695
3696 2011-08-25  Hans de Goede  <hdegoede@redhat.com>
3697
3698         Fixup NEWS entry for multiclient
3699
3700         Release 0.9.1
3701
3702         fix more inverted memset parameters
3703
3704 2011-08-25  Christophe Fergeau  <cfergeau@redhat.com>
3705
3706         fix leak in do_jpeg_encode
3707         Issue found by the Coverity scanner.
3708
3709         HDG: Fixup don't free RGB24_line if it was not allocated by do_jpeg_encode
3710
3711         fix memory leak in error path
3712         Issue found by the Coverity scanner
3713
3714         fix inverted memset parameters
3715         Issue found by the Coverity scanner.
3716
3717 2011-08-25  Hans de Goede  <hdegoede@redhat.com>
3718
3719         Rename usbredir channel code to spicevmc
3720         While discussing various things with Alon in Vancouver, it came up that
3721         having a channel which simply passes through data coming out of a qemu
3722         chardev frontend unmodified, like the usbredir channel does, can be used
3723         for a lot of other cases too. To facilitate this the usbredir channel code
3724         will be turned into a generic spicevmc channel, which is just a passthrough
3725         to the client, from the spicevmc chardev.
3726
3727         This patch renames usbredir.c to spicevmc.c and changes the prefix of all
3728         functions / structs to match. This should make clear that the code is not
3729         usbredir specific.
3730
3731         Some examples of why having a generic spicevmc pass through is good:
3732         1) We could add a monitor channel, allowing access to the qemu monitor from
3733         the spice client, since the monitor is a chardev frontend we could re-use
3734         the generic spicevmc channel server code, so all that is needed to add this
3735         (server side) would be reserving a new channel id for this.
3736
3737         2) We could allow users to come up with new channels of their own, without
3738         requiring qemu or server modification. The idea is to allow doing something
3739         like this on the qemu startup cmdline:
3740         -chardev spicevmc,name=generic,channelid=128
3741
3742         To ensure these new "generic" channels cannot conflict with newly added
3743         official types, they must start at the SPICE_CHANNEL_USER_DEFINED_START value
3744         (128).
3745
3746         These new user defined channels could then either be used with a special
3747         modified client, with client plugins (if we add support for those), or
3748         by exporting them on the client side for use by an external ap, see below.
3749
3750         3) We could also add support to the client to make user-defined channels
3751         end in a unix socket / pipe, allowing handling of the data by an external app,
3752         we could for example have a new spice client cmdline argument like this:
3753         --custom-channel unixsocket=/tmp/mysocket,channelid=128
3754
3755         This would allow for something like:
3756         $random app on guest -> virtio-serial -> spicevmc chardev ->
3757          -> spicevmc channel -> unix socket -> $random app on client
3758
3759         4) On hind sight this could also have been used for the smartcard stuff,
3760         with a 1 channel / reader model, rather then the current multiplexing code
3761         where we've our own multiplexing protocol wrapper over the libcacard
3762         smartcard protocol.
3763
3764         usbredir: Merge UsbRedirState and UsbRedirChannel
3765         Now that the Channel struct is gone and the RedChannel has the same lifetime
3766         as the chardev interface there is no need to have these 2 separate.
3767
3768         usbredir: Fix crash caused by MC changes
3769
3770         usbredir: Ensure that our msg_rcv_buf is not used re-entrantly
3771
3772         red_channel: Fix msg buf memleak on parser error
3773
3774 2011-08-25  Yonit Halperin  <yhalperi@redhat.com>
3775
3776         client: setting monitors resolution before resizing screens, RHBZ #728252
3777         fix for "client: fix endless recursion in rearrange_monitors, RHBZ #692976"
3778
3779 2011-08-23  Alon Levy  <alevy@redhat.com>
3780
3781         server: add tester and todo for multiple client support
3782
3783         server/snd_worker.c: add reference counting to SndChannel
3784         Fixes a valgrind discovered possible bug in spice-server - valgrind on
3785         test_playback saw it, didn't see it happen with qemu.
3786
3787         The problem is that the frames buffers returned by spice_server_playback_get_buffer
3788         are part of the malloc'ed SndChannel, whose lifetime is smaller then that of SndWorker.
3789         As a result a pointer to a previously returned spice_server_playback_get_buffer could
3790         remain and be used after SndChannel has been freed because the client disconnected.
3791
3792         server/reds: reds_client_disconnect: remove wrong check for reds_main_channel_connected
3793         The "channel->disconnecting" parameter already protects against recursion.
3794
3795         Removed fixed TODOs.
3796
3797         server/reds: fix reds_main_channel_connected
3798         instead of checking just for reds->main_channel check that there is at least
3799         one client as well.
3800
3801         server: add public spice_server_get_num_clients
3802
3803         server/snd_worker.c: add red_channel_client_destroy_dummy
3804
3805         server/red_channel: release channel allocated message  buffer
3806         handler->cb->release_msg_buf was not being called except in the error path,
3807         causing a memory leak.
3808
3809         server/main_channel: reduce verbose agent data command
3810         by using the new SPICE_DEBUG_LEVEL.
3811
3812 2011-08-23  Yonit Halperin  <yhalperi@redhat.com>
3813
3814         drawables count for debug
3815
3816         server: registering RedChannel in reds, instead of Channel
3817         Merging the functionality of reds::channel, into RedChannel.
3818         In addition, cleanup and fix disconnection code: before this patch,
3819         red_dispatcher_disconnect_display_client
3820         could have been called from the red_worker thread
3821         (and it must be called only from the io thread).
3822
3823         RedChannel holds only connected channel clients. RedClient holds all the
3824         channel clients that were created till it is destroyed
3825         (and then it destroys them as well).
3826
3827         Note: snd_channel still doesn't use red_channel, however it
3828         creates dummy channel and channel clients, in order to register itself
3829         in reds.
3830
3831         server/red_channel.c: a channel is connected if it holds at least one channel client
3832
3833         Previously I changed RedChannel to hold only connected channel clients and
3834         RedClient, to hold all the channel clients as long as it is not destroyed.
3835
3836         usbredir: multichannel has not been tested, it just compiles.
3837
3838         server/red_channel.c inroducing client_cbs
3839         client_cbs are supposed to be called from client context (reds). This patch will be used
3840         in future patches for relacing reds::Channel with RedChannel in order to eliminate redundancy.
3841
3842         server/red_channel.c: pack all channel callbacks to ChannelCbs
3843
3844 2011-08-23  Alon Levy  <alevy@redhat.com>
3845
3846         server/red_worker: add ref counting to RedDrawable
3847         introduces ref_red_drawable and put_red_drawable (rename from free_red_drawable)
3848
3849         RedDrawable is already references by Drawable and RedGlzDrawable, with
3850         a hack to NULL the drawable field in RedGlzDrawable to indicate RedGlzDrawable
3851         is the last reference holder. Using an explicit reference count instead.
3852
3853         server/red_worker: add stream_count (for debug purposes)
3854
3855         server/red_worker: validate_surface: print paniced surface_id
3856
3857         server/red_worker: no panic on double destroy primary
3858
3859         server/red_worker: DEBUG_CURSORS
3860         Add cursor allocation debugging code that is turned off as long as
3861         DEBUG_CURSORS is not defined.
3862
3863         server/red_worker: on_new_display_channel_client: push ack, cleanup
3864         small cleanup patch, only functional change is sending a set ack message.
3865
3866         server/red_worker: add cursor_channel_client_disconnect
3867         makes RED_WORKER_MESSAGE_CURSOR_DISCONNECT_CLIENT disconnect only a
3868         single client.
3869
3870         server/red_worker: remove forced disconnect on connect
3871
3872 2011-08-23  Yonit Halperin  <yhalperi@redhat.com>
3873
3874         server/red_worker.c: fix CursorPipeItem leak
3875         CursorPipeItems and their corresponding cursor_item were not
3876         freed when they were removed from the pipe without sending them.
3877         In addition cursor_channel_hold_pipe_item used wrong conversion
3878         to (CursorItem*) for a (CursorPipeItem*).
3879
3880 2011-08-23  Alon Levy  <alevy@redhat.com>
3881
3882         server/red_worker: split cursor pipe item from cursor item
3883         Required to support multiple clients.
3884         Also changes somewhat the way we produce PIPE_ITEM_TYPE_LOCAL_CURSOR. Btw,
3885         I haven't managed to see when we actually produce such an item during my
3886         tests.
3887
3888         Previously we had a single pipe item per CursorItem, this is impossible
3889         with two pipes, which happens when we have two clients.
3890
3891         server/red_worker: whitespace fixes
3892
3893         server/reds: add RedsState.allow_multiple_clients
3894         Currently set by environment variable SPICE_DEBUG_ALLOW_MC (any value means
3895         to allow multiple connections). Later will be set by spice api from qemu.
3896
3897         server/red_channel: introduce client ring in RedChannel
3898         Also adds Drawable pipes and glz rings.
3899
3900         main_channel and red_worker had several locations that still accessed rcc
3901         directly, so they had to be touched too, but the changes are minimal.
3902
3903         Most changes are in red_channel: drop the single client reference in RedChannel
3904         and add a ring of channels.
3905
3906         Things missing / not done right in red_worker:
3907          * StreamAgents are in DCC - right/wrong?
3908          * GlzDict is multiplied - multiple compressions.
3909
3910         We still are missing:
3911          * remove the disconnect calls on new connections
3912
3913         server/red_channel: add pipe_size helpers
3914
3915         server/red_worker: remove more direct access to RedChannelClient.rcc
3916
3917 2011-08-23  Yonit Halperin  <yhalperi@redhat.com>
3918
3919         server/red_worker.c: make dictionary and cache different per client
3920         There is no inter-client shared dictionary and cache yet.
3921
3922         At this point the display channel can be used by multiple clients.
3923
3924         You can still crash on lack of Drawables or CursorItems due to the slower
3925         clients pipe growing uncontrollably.
3926
3927 2011-08-23  Alon Levy  <alevy@redhat.com>
3928
3929         server/red_worker: multiple client support - base split
3930         This patch compiles but breaks spice.
3931
3932         Split both display and cursor channels to a client part and channel part.
3933
3934         Introduce DisplayChannelClient, CursorChannelClient, CommonChannelClient.
3935         don't disconnect channel on client disconnect.
3936         Move all caches to the ChannelClient's.
3937
3938         Remove reference counting of the channel.
3939
3940         No new functionality introduced.
3941
3942         NOTE: Introduces a crash in disconnections, a regression, resulting from
3943         incorrect thread access, that is fixed in the patch titled:
3944         "server: registering RedChannel in reds, instead of Channel"
3945
3946         server/red_worker: cleanup
3947
3948         server/smartcard: support multiple clients
3949         each client supplying a smartcard channel gets it's own smartcard. If
3950         there are not enough smartcards provided by the server (read: qemu)
3951         then it will be as though there are none.
3952
3953         currently disabled - later patches that enable smartcard don't make
3954         this channel available to any but the first client.
3955
3956         server/red_tunnel_worker: trivial multi client support
3957         s/TunnelChannel/TunnelChannelClient/
3958
3959         That's about it.  this is probably the wrong way to do it. Not tested
3960         at all. What do we want, a separate interface per client? same interface
3961         for all clients? probably the later. This doesn't do that. Not tested,
3962         so probably doesn't even work.
3963
3964         changes red_channel_pipe_item_is_linked to red_channel_client_pipe_item_is_linked,
3965         since tunnel channel is the only user, must be done in patch to not break compilation.
3966
3967         server/inputs_channel: support multiple clients
3968         from server events are broadcast - leds change. The rest is client
3969         to server, so it is just passed on.
3970
3971         server/main_channel: support multiple clients
3972         The main channel deals with connecting new clients, announcing mouse mode
3973         changes, and the agent channel. The implementation is currently done without
3974         any changes to the protocol, so everything has to be either broadcast or
3975         to a specific client.
3976
3977          channels list - specific client
3978          mouse mode - broadcast
3979          agent - broadcast
3980          notify - broadcast (should have two modes, and use the appropriate)
3981
3982         Notable TODOs:
3983          * migration testing
3984          * agent tokens are wrongly sent (or did I fix that? check)
3985
3986         server/red_channel: introduce pipes functions
3987         Introduce functions to add (via producer method) the same item to multiple
3988         pipes, all for the same channel.
3989
3990         Note: Right now there is only a single channel, but the next patches will do the
3991         per-channel breakdown to channel and channel_client before actually introducing
3992         a ring in RedChannel, this makes it easier to make smaller changes - the
3993         channel->rcc link will exist until removed in the ring introducing patch.
3994
3995         server/red_channel: ignore error if already shutdown
3996         on red_channel_peer_on_incoming_error, if we are already shutdown, do not
3997         call the channel's error handler. Since the channel has been shutdown, we
3998         assume this is a second or later error, and handling has already occured.
3999
4000         server/main_channel: move connection_id from reds
4001         Expose additional api to find a client given a connection_id. The connection_id
4002         is first set when the first channel connects, which is the main channel.
4003         It could also be kept in the RedClient instead, not sure.
4004
4005         TODO:
4006          multiple todo's added for multiclient handling. I don't remember why
4007          I wrote them exactly, and besides if I did any migration tests. So: TODO.
4008
4009         server/main_channel: move ping here from reds.
4010         cleanup only. Note that the ping function is half used since the opt parameter
4011         stopped being called with anything but NULL, should be returned at some point,
4012         specifically when we drop the 250kbyte ping on start and do a continuous check
4013         for latency and bandwidth.
4014
4015         See:
4016          81945d897 - server: add new vd interface QTerm2Interface, Yaniv Kamay
4017           introducing the usage of ping with a non NULL opt
4018          3f7ea8e7a - zap qterm interfaces, Gerd Hoffman
4019           removing it
4020
4021         server/main_channel: move latency and bitrate to channel client
4022         They were globals before. This introduces api for other channels
4023         to query the low bandwidth status. The queries themselves are still done
4024         from the wrong context (channel and not channel client) but that's because
4025         the decoupling of channel and channel client will be done in the following
4026         patches.
4027
4028         Note that snd_worker.c got two copied function declarations that belong to
4029         main_channel.h but can't be easily dragged into snd_worker.c since it still
4030         uses it's own RedChannel struct.
4031
4032         server/reds: add concept of secondary channels
4033         Secondary channels are those that don't support multiple clients. The
4034         support added in this patch just doesn't let the second or more connected
4035         client receive the unsupported channels in the channels list sent by the
4036         server to the client. This doesn't handle the situation where:
4037
4038         client A connects (gets all channels)
4039         client B connects (gets supported multiple client channels)
4040         client A disconnects (Suboptimal 1: B doesn't get new channels at this point)
4041         client C connects (Suboptimal 2: C doesn't get the full list of channels, but
4042         the partial one)
4043
4044         Specifically the channels that only support a single client are:
4045          sound (both playback and record channels)
4046          smartcard
4047          tunnel
4048
4049         server: Add RedClient
4050         That means RedClient tracks a ring of channels. Right now there will be only
4051         a single client because of the disconnection mechanism - whenever a new
4052         client comes we disconnect all existing clients. But this patch adds already
4053         a ring of clients to reds.c (stored in RedServer).
4054
4055         There is a known problem handling many connections and disconnections at the
4056         same time, trigerrable easily by the following script:
4057
4058         export NEW_DISPLAY=:3.0
4059
4060         Xephyr $NEW_DISPLAY -noreset &
4061         for ((i = 0 ; i < 5; ++i)); do
4062             for ((j = 0 ; j < 10; ++j)); do
4063                 DISPLAY=$NEW_DISPLAY c_win7x86_qxl_tests &
4064             done
4065             sleep 2;
4066         done
4067
4068         I fixed a few of the problems resulting from this in the same patch. This
4069         required already introducing a few other changes:
4070          * make sure all removal of channels happens in the main thread, for that
4071          two additional dispatcher calls are added to remove a specific channel
4072          client (RED_WORKER_MESSAGE_CURSOR_DISCONNECT_CLIENT and
4073          RED_WORKER_MESSAGE_DISPLAY_DISCONNECT_CLIENT).
4074          * change some asserts in input channel.
4075          * make main channel disconnect not recursive
4076          * introduce disconnect call back to red_channel_create_parser
4077
4078         The remaining abort is from a double free in the main channel, still can't
4079         find it (doesn't happen when running under valgrind - probably due to the
4080         slowness resulting from that), but is easy to see when running under gdb.
4081
4082         server/main_channel+reds: make main_channel_init return MainChannelClient
4083         This makes it easier to introduce RedClient in the next patch.
4084
4085         server/red_worker: release PIPE_ITEM_TYPE_VERB in display channel
4086         We send a SPICE_MSG_DISPLAY_MARK verb.
4087
4088         server/red_client: clear pipe on disconnect
4089
4090         server/red_channel: workaround for fast client disconnect bug (TODO - real fix)
4091
4092         server/main_channel: use MainChannel in sig
4093         use MainChannel* instead of Channel* for a many functions in main_channel.h
4094         (affects main_channel.c and reds.c).
4095
4096         some one liner fixes are hidden in here too.
4097
4098         server: move pipe from RedChannel to RedChannelClient
4099         Another cleanup patch, no change to behavior (still one client, and it
4100         disconnects previous client if any).
4101
4102         The implementation for multiple client is straightforward: the pipe
4103         remains per (channel,client) pair, so it needs to move from the RedChannel
4104         that to RedChannelClient. Implementation using a single pipe with multiple
4105         consumers (to reflect different latencies) doesn't fit well with pipe rewriting
4106         that is used by the display channel. Additionally this approach is much simpler
4107         to verify. Lastly it doesn't add considerable overhead (but see the display
4108         channel changes in a later patch for a real place to rethink).
4109
4110         This patch is just technical, changing signatures to reflect the first
4111         argument (oop style) so red_channel becomes red_channel_client. Some places
4112         may seem odd but they should be fixed with later comits where the channels
4113         grow to support multiple clients.
4114
4115         Sound (playback/record) channels are the only ones not touched - this is
4116         consistent with previous patches, since they have been left out of the
4117         RedChannel refactoring.  That is left as future work. (note that they don't use
4118         a pipe, which was the reason for not refactoring).
4119
4120         server/red_worker: introduce {display,cursor}_is_connected
4121         Instead of checking for worker->{display,cursor}_channel directly.
4122
4123         server/red_channel (all): introduce RedChannelClient
4124         This commit adds a RedChannelClient that now owns the stream connection,
4125         but still doesn't own the pipe. There is only a single RCC per RC
4126         right now (and RC still means RedChannel, RedClient will be introduced
4127         later). All internal api changes are in server/red_channel.h, hence
4128         the need to update all channels. red_worker.c is affected the most because
4129         it makes use of direct access to some of RedChannel still.
4130
4131         API changes:
4132
4133          1. red_channel_client_create added.
4134           rec_channel_create -> (red_channel_create, red_channel_client_create)
4135          2. two way connection: rcc->channel, channel->rcc (later channel will
4136           hold a list, and there will be a RedClient to hold the list of channels
4137           per client)
4138          3. seperation of channel disconnect and channel_client_disconnect
4139
4140         TODO:
4141          usbredir added untested.
4142
4143         server/red_worker: drop red_pipe_add_tail, use red_channel_pipe_add_tail
4144         The only difference between them being that the later also does a push.
4145         I don't believe that to be a problem, but if it does I can always introduce
4146         a push'less version.
4147
4148         server/red_channel: renames to use _proc postfix consistently
4149         rename types - we use _proc suffix mostly to indicate function pointer types,
4150         use it for some function pointers that were missing it.
4151
4152         s/channel_handle_migrate_flush_mark/channel_handle_migrate_flush_mark_proc/
4153         s/channel_handle_migrate_data_get_serial/channel_handle_migrate_data_get_serial_proc/
4154         s/channel_handle_migrate_data/channel_handle_migrate_data_proc/
4155
4156         spice.proto: add comment for origin of STYLED and START_WITH_GAP
4157
4158         server/red_worker: explicitly include unistd and errno
4159
4160         common: introduce red_printf_debug
4161
4162         server/tests/test_playback: correctly use spice_server_playback_get_buffer
4163         and spice_server_playback_put_samples. The former retrieves a buffer from a free
4164         list with spice_server_playback_get_buffer, and should be used once via
4165         spice_server_playback_put_samples. The tester previously reused the same buffer
4166         a number of times.
4167
4168         server/tests/basic_event_loop: multiple fixes
4169         reuse common/ring.h
4170         ignore SIGPIPE
4171         fix handling of removed watches
4172
4173         tests/migrate.py: add --vdagent
4174         Adds the required options to provide a vdagent to the guest in both source and target qemu
4175         instances.
4176
4177         This will be the last update of the in spice git tests directory, I've moved those tests
4178         to the repository spice-tests. The longer term goal remains autotest integration, but since
4179         this test (and some minor others for qemu) need a home it is:
4180
4181         http://cgit.freedesktop.org/~alon/spice-tests/
4182
4183         (I'm reluctant to put it under spice/ because of my wish to go to autotest, but still, there
4184         they are. Nothing as permanent as the temporary).
4185
4186         Independent (of external modules, i.e. qemu) tests (server/tests) should remain in tree.
4187
4188 2011-08-23  Yonit Halperin  <yhalperi@redhat.com>
4189
4190         server/red_worker.c: fix - locking the wrong mutex when releasing glz dict
4191
4192 2011-08-23  Alon Levy  <alevy@redhat.com>
4193
4194         server/tests/test_display_base: fix compile
4195
4196         common/ring: RING_FOREACH_SAFE: use shorter version from qemu
4197
4198         server/reds.h: explicitly include config.h
4199
4200         server/tests/migrate.py: make executable
4201
4202 2011-08-17  Christophe Fergeau  <cfergeau@redhat.com>
4203
4204         use Xkb to get keyboard modifier mask
4205         To be able to enable/disable keyboard leds on X11, we need to query
4206         the X server for which mask correspond to which led (NumLock,
4207         CapsLock). So far this was done using XKeysymToKeycode and iterating
4208         over X modifier mapping.
4209         Xkb provides XkbKeysymToModifiers for this purpose, and since
4210         we're using Xkb anyway, it makes more sense to use it.
4211
4212         At some point, on my Fedora 15 box, XKeysymToKeycode was returning
4213         NoSymbol for CapsLock and NumLock leading to spicec not being able
4214         to change the keyboard leds when qemu tells it to. However, I couldn't
4215         reproduce this when I tried again :-/
4216
4217         fix harmless typo in InputsChannel::handle_modifiers
4218         InputsChannel::handle_modifiers converts _modifiers which is a
4219         bitflag of SPICE_KEYBOARD_MODIFIER_FLAGS_* to a Platform::*_MODIFIER
4220         bitflag, which is what Platform::set_keyboard_lock_modifiers expects.
4221         However, it's called with _modifiers, and the bitflag that this
4222         function computes is never used. Pass the computed bitflag to
4223         ::set_keyboard_lock_modifiers since _modifiers format is meaningless
4224         for ::set_keyboard_lock_modifiers.
4225         This bug was harmless because the two different set of modifier
4226         flags actually use the same values, so _modifiers and modifiers could
4227         be used interchangeably. However it's more future-proof to use the
4228         right format here.
4229
4230 2011-08-15  Christophe Fergeau  <cfergeau@redhat.com>
4231
4232         fix 2 X11 related leaks
4233
4234         channel: fix EVP_PKEY leak
4235
4236         always set VDAgentDisplayConfig::depth
4237         Even if VDAgentDisplayConfig::depth will be unused if the
4238         VD_AGENT_DISPLAY_CONFIG_FLAG_SET_COLOR_DEPTH isn't set, it's
4239         better to initialize it anyway to avoid warnings from valgrind.
4240
4241 2011-08-10  Hans de Goede  <hdegoede@redhat.com>
4242
4243         server: Add a usbredir channel
4244
4245 2011-08-03  Alon Levy  <alevy@redhat.com>
4246
4247         client/red_client: fix broken switch host migration (RHBZ 727969)
4248         3f8d7e59dbd94b1837503f37b5065698df3ffbc7 introduced a regression, after
4249         sending one attach_channels message we never send another one.
4250         Fix by resetting on disconnect.
4251
4252 2011-08-02  Christophe Fergeau  <cfergeau@redhat.com>
4253
4254         mjpeg: add missing SPICE_BITMAP_FMT_RGBA
4255         I forgot to handle SPICE_BITMAP_FMT_RGBA when mapping from
4256         spice image formats to libjpeg-turbo colorspaces.
4257
4258 2011-08-02  Liang Guo  <bluestonechina@gmail.com>
4259
4260         Fix typo: treshold -> threshold
4261
4262         Fix typo: seperator -> separator
4263
4264 2011-08-01  Christophe Fergeau  <cfergeau@redhat.com>
4265
4266         mjpeg: fix libjpeg assertion
4267         After the changes to add libjpeg-turbo support to spice-server mjpeg
4268         compression code, it's relatively easy to hit an assertion from
4269         libjpeg in spice-server about "too few scanlines transferred" when
4270         the mjpeg streaming code triggers. This assertion brings down qemu,
4271         which is bad :)
4272
4273         This is because when we first initialize the mjpeg encoder, we do:
4274
4275         stream_width = SPICE_ALIGN(src_rect->right - src_rect->left, 2);
4276         stream_height = SPICE_ALIGN(src_rect->bottom - src_rect->top, 2);
4277
4278         stream->mjpeg_encoder = mjpeg_encoder_new(stream_width, stream_height);
4279
4280         and then when we iterate over the image scanlines to feed them to
4281         libjpeg, we do:
4282
4283         const int image_height = src->bottom - src->top;
4284         const int image_width = src->right - src->left;
4285
4286         for (i = 0; i < image_height; i++) {
4287             mjpeg_encoder_encode_scanline(...);
4288         }
4289         mjpeg_encoder_end_frame(...);
4290
4291         When stream_height is odd, the mjpeg_encoder will be created with
4292         an height that is 1 more than the number of lines we encode. Then
4293         libjpeg asserts when we tell it we're done with the compression
4294         while it's still waiting for one more scanline.
4295
4296         Looking through git history, this rounding seems to be an artifact
4297         from when we were using ffmpeg for the mjpeg encoding. Since
4298         spicec and spicy (the latter needs a few fixes) can handle streams
4299         with odd height/width, the best way to solve this issue is to stop
4300         rounding up the height and width of the streams we create. This
4301         even saves some bandwidth :)
4302
4303 2011-07-31  Alon Levy  <alevy@redhat.com>
4304
4305         server/red_dispatcher: fix wrong resolution set for tablet
4306         when changing resolutions due to the new async code paths the surface
4307         creation command was kept by reference, and later, when the red_worker
4308         signaled completion by calling async_complete the mouse mode was updated
4309         using the reference. This caused the wrong values to be read resulting in wrong
4310         resolutions set and a non working mouse pointer. Fix this by keeping a copy of
4311         the surface creation command instead of a reference.
4312
4313         No bz. Found in testing.
4314
4315 2011-07-31  Christophe Fergeau  <cfergeau@redhat.com>
4316
4317         client: fix 30s timeout regression
4318         Changelog from Arnon Gilboa, patch from me:
4319
4320         Commit eb6f55409412 caused the following regression:
4321
4322         When client runs without the auto-conf or disable-effects options
4323         (either from CLI or controller), which is the case when using Spice
4324         from Admin Portal, the client will unecessarily wait for 30sec before
4325         connecting to a Windows guest with an agent running (this won't happen
4326         with linux guests or without an agent running).
4327
4328         The mentioned patch assumed that on_agent_reply() of
4329         VD_AGENT_DISPLAY_CONFIG will call send_main_attach_channels() and
4330         connect. However, when auto-conf or disable-effects are not used,
4331         on_agent_reply() will ignore the reply and not call
4332         send_main_attach_channels(). Therefore, send_main_attach_channels()
4333         will only be called on agent timeout.
4334
4335         The solution is to activate agent timer only if auto-conf or
4336         disable-effects. Otherwise, simply call send_main_attach_channels().
4337
4338         Fixes rhbz #726441
4339
4340 2011-07-31  Alon Levy  <alevy@redhat.com>
4341
4342         common/backtrace.h: disable for WIN32
4343         This also catches mingw32 which is probably fine, but at least it fixes
4344         the build on visual studio.
4345
4346 2011-07-28  Christophe Fergeau  <cfergeau@redhat.com>
4347
4348         fix integer marshalling helpers on big endian
4349         They were trying to convert the destination pointer to an integer before
4350         trying to dereference it. The initial conversion was meant to be a cast
4351         to a pointer of the right size, not to an integer.
4352
4353         fix typo in big endian code path
4354         uint63_t should be uint64_t
4355
4356 2011-07-26  Hans de Goede  <hdegoede@redhat.com>
4357
4358         Bump version in server/spice,h to 0.9.1
4359         It is a bit early to bump, since a 0.9.1 release is not happening yet,
4360         but this allows me to test if the vdagent SpiceCharInterface state callback
4361         fixes are present or not in qemu code, and thus disabling the ugly vdagent
4362         specific workaround from spice-qemu-char.c when compiling against a new
4363         enough spice-server.
4364
4365 2011-07-25  Hans de Goede  <hdegoede@redhat.com>
4366
4367         server: Don't call vdagent chardev state callback on client (dis)connect
4368         See this long mail for the rationale for this:
4369         http://lists.freedesktop.org/archives/spice-devel/2011-July/004837.html
4370
4371 2011-07-23  Alon Levy  <alevy@redhat.com>
4372
4373         Release 0.9.0
4374
4375 2011-07-22  Alon Levy  <alevy@redhat.com>
4376
4377         server/smartcard: fix smartcard_channel_send_error
4378         It was sending the wrong data, the memory right after the VCSMsgHeader
4379         which was actually not where the data was.
4380
4381         Fixed by having the header and data (VSCError, 4 bytes of the error code)
4382         embedded in the ErrorItem pipe item.
4383
4384 2011-07-22  Christophe Fergeau  <cfergeau@redhat.com>
4385
4386         mjpeg: rename jpeg_mem_dest
4387         jpeg_mem_dest is a public symbol in libjpeg8 so using it with
4388         no prefix will cause symbol clashes. Rename it to spice_jpeg_mem_dest.
4389
4390         mjpeg_encoder: allocate "row" on demand
4391         It's not used when we use jpeg-turbo colorspaces, so it's better
4392         to allocate it when we know we'll need it rather than always
4393         allocating it even if it won't be used.
4394
4395         mjpeg_encoder: remove unused functions
4396         After the refactoring to optionally use libjpeg-turbo, some
4397         of the functions that mjpeg-encoder used to provide are now no
4398         longer used. This commit removes them.
4399
4400         mjpeg_encoder: use libjpeg-turbo extra colorspaces
4401         When libjpeg-turbo is available, we can use the BGR and BGRX
4402         colorspaces that it provides to avoid extra conversions of the
4403         data we want to compress to mjpeg
4404
4405         red_worker: use new mjpeg_encoder_encode_scanline API
4406         The main point is to move the pixel conversion code into
4407         the MjpegEncoder class to be able to make use libjpeg-turbo
4408         additional pixel formats without the reds_worker code noticing.
4409
4410         mjpeg_encoder: add mjpeg_encoder_get_bytes_per_pixel
4411         Returns the number of bytes per pixel corresponding to the input
4412         data format.
4413
4414         mjpeg_encoder: add mjpeg_encoder_encode_scanline
4415         This API is meant to allow us to move the pixel format conversion
4416         into MjpegEncoder. This will allow us to be able to use the
4417         additional pixel formats from libjpeg-turbo when available.
4418
4419         red_worker: simplify red_rgb_to_24bpp prototype
4420         It takes a lot of arguments, "id" is unused, "frame" and
4421         "frame_size" can be obtained from the "stream" argument, so
4422         can get rid of 3 arguments to make things more readable.
4423
4424         mjpeg_encoder: rework output buffer allocation
4425         When encoding a frame, red_worker passes an allocated buffer to
4426         libjpeg where it should encode the frame. When it fails, a new
4427         bigger buffer is allocated and the encoding is restarted from
4428         scratch. However, it's possible to use libjpeg to realloc this
4429         buffer if it gets too small during the encoding process. Make use
4430         of this feature, especially since it will make it easier to encore
4431         one line at a time instead of a full frame in subsequent commits.
4432
4433         red_worker: factor pixel conversion code
4434         When encoding to mjpeg, the on screen data have to be converted
4435         to 24bpp RGB since that's the format that libjpeg expects. Factor
4436         as much code as possible for the 3 formats we handle.
4437
4438         set version number to 0.9.0
4439
4440         fix make distcheck
4441
4442         configure.ac: fix pyparsing check
4443         2>&1 was typo'ed 2&>1 which caused an empty '1' file to be created
4444         when running this test.
4445
4446         add SASL and smartcard to distcheck flags
4447
4448         client: don't die if initial agent timeout triggers
4449         When the client connects to a spice VM, if an agent is detected,
4450         there will be a few messages exchanged to exchange capabilities,
4451         display resolutions, ... This exchange has a timeout in case
4452         something goes wrong. However, when it fires, the client dies.
4453         This commit changes this and lets the client connects to the
4454         guest when the timeout happens.
4455         rhbz #673973
4456
4457         client: only send one SPICE_MSGC_MAIN_ATTACH_CHANNELS messages
4458         492f7a9b fixed unwanted timeouts during initial client startup,
4459         but it also caused a bad regression when connecting to
4460         RHEL6+agent guests: the SPICE_MSGS_MAIN_ATTACH_CHANNELS message
4461         was sent multiple times, once in RedClient::handle_init, then
4462         once again in RedClient::on_agent_announce_capabilities (which
4463         can even be triggered multiple times). Sending this message multiple
4464         times is a big NO and causes the server to close the client connection,
4465         and the client to die. Add a _msg_attach_message_sent boolean to
4466         make sure we only send this message once.
4467
4468         rhbz #712938
4469
4470         client: split overlong option descriptions
4471
4472 2011-07-21  Hans de Goede  <hdegoede@redhat.com>
4473
4474         server: make sure we clear vdagent and update mouse mode on agent disconnect
4475         The check this patch removes causes us to not set vdagent to NULL, nor
4476         update the mouse mode when the guest agent disconnects when no client is
4477         attached. Which leads to a non working mouse, and on agent reconnect a
4478         "spice_server_char_device_add_interface: vdagent already attached" message
4479         instead of a successful re-add of the agent interface .
4480
4481         hansg: Note this is commit 443994ba from the 0.8 branch, which I did
4482         not forward port back then because it seemed unnecessary on master, but it
4483         turns out that the (wrong) check was just hidden in another place on master.
4484
4485 2011-07-21  Yonit Halperin  <yhalperi@redhat.com>
4486
4487         client: fix endless recursion in rearrange_monitors, RHBZ #692976
4488         The endless recursion happens due to Application::prepare_monitors calling RedScreen::resize
4489         calling Application::rearrange_monitors calling Application::prepare_monitors
4490
4491         I changed RedScreen::resize not to call rearrange_monitors. Instead,
4492         the monitor should be configured correctly from Application, before
4493         calling resize.
4494         In addition, I made some cleanups to allow reusing rearrange_monitors code.
4495
4496 2011-07-21  Hans de Goede  <hdegoede@redhat.com>
4497
4498         spicec: Make loglevel configurable through the environment
4499         Having a loglevel variable is much more useful if we can actually change
4500         its value without a recompile. Use a SPICEC_LOG_LEVEL environment variable so
4501         we can do this from the spice xpi / activex too (by setting the environment
4502         variable before starting the browser).
4503
4504 2011-07-20  Yonit Halperin  <yhalperi@redhat.com>
4505
4506         server/red_worker: send surface images to client on-demand after S3/4 wakeup
4507         When surfaces are being reloaded to the worker, we
4508         will send them to the client only if and when it needs them.
4509
4510 2011-07-20  Alon Levy  <alevy@redhat.com>
4511
4512         server/spice.h: bump QXL_MINOR because of QXLWorker and QXLInterface changes
4513
4514         server: add QXLWorker.flush_surfaces_async for S3/S4 support
4515         This does the following, all to remove any referenced memory on the pci bars:
4516             flush_all_qxl_commands(worker);
4517             flush_all_surfaces(worker);
4518             red_wait_outgoing_item((RedChannel *)worker->display_channel);
4519             red_wait_outgoing_item((RedChannel *)worker->cursor_channel);
4520
4521         The added api is specifically async, i.e. it calls async_complete
4522         when done.
4523
4524         server: add QXLInterface::update_area_complete callback
4525         when update_area_async is called update_area_complete will be called with
4526         the surfaces dirty rectangle list.
4527
4528         server/red_worker: handle_dev_input: reuse write_ready introduced for async
4529
4530         server: add async io support
4531         The new _ASYNC io's in qxl_dev listed at the end get six new api
4532         functions, and an additional callback function "async_complete". When
4533         the async version of a specific io is used, completion is notified by
4534         calling async_complete, and no READY message is written or expected by
4535         the dispatcher.
4536
4537         update_area has been changed to push QXLRects to the worker thread, where
4538         the conversion to SpiceRect takes place.
4539
4540         A cookie has been added to each async call to QXLWorker, and is passed back via
4541         async_complete.
4542
4543         Added api:
4544
4545         QXLWorker:
4546             update_area_async
4547             add_memslot_async
4548             destroy_surfaces_async
4549             destroy_primary_surface_async
4550             create_primary_surface_async
4551             destroy_surface_wait_async
4552
4553         QXLInterface:
4554             async_complete
4555
4556         bump required spice-protocol to 0.8.1 for qxl_dev async and s3 updates
4557
4558         server: api: add spice_qxl_* calls based on QXLWorker contents
4559         For each callback in QXLWorker, for example QXLWorker::update_area, add
4560         a direct call named spice_qxl_update_area.
4561
4562         This will (a) remove the pointless indirection and (b) make shared
4563         library versioning alot easier as we'll get new linker symbols which
4564         we can tag with the version they appeared in the shared library.
4565
4566         server: spice-server.syms: move sasl symbols to 0.8.2
4567
4568         server/red_worker: remove print on handle_dev_destroy_surfaces
4569
4570         server/red_worker: *_release_item: less frequent debug messages
4571
4572         server/tests: test_util.h: fix double ASSERT definition
4573
4574 2011-07-19  Alon Levy  <alevy@redhat.com>
4575
4576         common: add backtrace via gstack or glibc backtrace
4577         Add a backtrace printing function copied from xserver os/backtrace.c
4578         that uses gstack, and if that isn't found then glibc's backtrace.
4579         Used in ASSERT, tested on F15.
4580
4581 2011-07-19  Gerd Hoffmann  <kraxel@redhat.com>
4582
4583         server: add symbol versioning to the spice server shared library.
4584         This patch adds symbol versions to the spice server library.  Each
4585         symbol which is exported by libspice-server gets tagged with the
4586         (stable) version where it appeared first.  This way the linker and rpm
4587         are able to figure which version of the spice-server libary is required
4588         by a particular qemu binary/package.
4589
4590 2011-07-19  Christophe Fergeau  <cfergeau@redhat.com>
4591
4592         remove unused function
4593
4594         client: add missing "," in option list
4595         In commit 44073d1b38e2 - client: improve WAN option description
4596         one "," was missing at the end of the line. Since the next argument
4597         was a string too, gcc silently concatenated them, and thanks to C++
4598         polymorphic functions, the compiler didn't complain about the
4599         missing argument, so it went unnoticed.
4600         The effects are pretty bad though, since it prevents spicec from
4601         running because it thinks command line parsing fails.
4602
4603 2011-07-18  Christophe Fergeau  <cfergeau@redhat.com>
4604
4605         Fix spice-server/qemu channel version checks
4606         When qemu creates a channel, reds.c contains code to check the
4607         minor/major channel versions known to QEMU (ie the ones that were
4608         current in spice-server when QEMU was compiled) and to compare these
4609         versions against the current ones the currently installed spice-server
4610         version.
4611
4612         According to kraxel [1], the rules for these interface numbers are:
4613
4614         "The purpose of the versions is exactly to avoid the need for a new
4615         soname.  The rules are basically:
4616
4617            (1) You add stuff to the interface, strictly append-only to not break
4618                binary compatibility.
4619            (2) You bump the minor version of the interface.
4620            (3) You check the minor version at runtime to figure whenever the
4621                added fields contain valid stuff or not.
4622
4623         An example is here (core interface, minor goes from 2 to 3, new
4624         channel_event callback):
4625
4626         http://cgit.freedesktop.org/spice/spice/commit/?id=97f33fa86aa6edd25111b173dc0d9599ac29f879
4627         "
4628
4629         The code currently refuses to create a channel if QEMU minor version is
4630         less than the current spice-server version. This does not correspond
4631         to the intended behaviour, this patch changes to fail is qemu was compiled
4632         with a spice-server that is *newer* than the one currently installed. This
4633         case is something we cannot support nicely.
4634
4635         [1] http://lists.freedesktop.org/archives/spice-devel/2011-July/004440.html
4636
4637 2011-07-18  Uri Lublin  <uril@redhat.com>
4638
4639         client: rename connect_unsecure to connect_to_peer
4640         Both connect_secure() and connect_unsecure() call connect_to_peer().
4641
4642         Prior to this commit spicec.log reported all connections as unsecure,
4643         as connect_secure() called connect_unsecure() to make the connection.
4644         This fixes RH bug #653545
4645
4646 2011-07-18  Christophe Fergeau  <cfergeau@redhat.com>
4647
4648         client: don't crash when agent is missing WAN support
4649         If you try to connect to a linux guest with WAN options, SPICE window opens up
4650         and is blank - it then fails with vdagent timeout message.  It should give a
4651         warning that this is only applicable for windows guest and still connect to
4652         guest.
4653
4654         It all starts in RedClient::handle_init
4655         This function checks whether we have an agent or not, because if we have an
4656         agent, there will be some kind of handshake to check both sides capabilities
4657         before all the spice channels are created.
4658
4659         When there is no agent running, the startup process goes on with
4660         SPICE_MSGC_MAIN_ATTACH_CHANNELS
4661
4662         When there is a windows agent running, VD_AGENT_ANNOUNCE_CAPABILITIES and
4663         VD_AGENT_DISPLAY_CONFIG messages are sent to the agent, and when processing the
4664         agent answer to the VD_AGENT_DISPLAY_CONFIG message,
4665         SPICE_MSGC_MAIN_ATTACH_CHANNELS will be sent and the startup process will go
4666         on.
4667
4668         However, when there is no agent running but --color-depth was used, handle_init
4669         won't send the SPICE_MSGC_MAIN_ATTACH_CHANNELS message but will wait for the
4670         agent handshake to proceed to its end, which won't happen, so it will timeout
4671         waiting for agent answers.
4672
4673         Similarly, the linux agent handles VD_AGENT_ANNOUNCE_CAPABILITIES messages, but
4674         it doesn't handle VD_AGENT_DISPLAY_CONFIG messages, so we'll never reach the
4675         point where a SPICE_MSGC_MAIN_ATTACH_CHANNELS will be sent.
4676
4677         This commit fixes this in 2 places:
4678         - unconditionnally send SPICE_MSGC_ATTACH_CHANNELS when no agent is running in
4679         handle_init
4680         - send SPICE_MSGC_MAIN_ATTACH_CHANNELS in
4681         RedClient::on_agent_announce_capabilities if the agent doesn't have the
4682         VD_AGENT_CAP_DISPLAY_CONFIG capability
4683
4684         This fixes RH bug #712938
4685
4686         client: improve WAN option description
4687         The WAN options (--color-depth and --disable-effects) need
4688         support from the guest agent to be working. Currently they are
4689         only supported on Windows. While I don't want to explicitly
4690         mention Windows in --help output, we can hint that it won't
4691         work with all guests in --help. This fixes RH bug #712941
4692
4693         x11: don't return freed memory from get_clipboard
4694         There is a double free in client/x11/platform.cpp.
4695         In get_selection(), in the exit: case with ret_val == -1 and data != NULL,
4696         *data_ret (which is returned to the caller) has already been
4697         assigned "data", so it will be pointing to freed memory when "data" is
4698         XFree'd'. Then in handle_selection_notify, get_selection_free is called on
4699         this pointer, which causes a double free.
4700         When the length of the read data = 0, set the returned value to NULL,
4701         this way subsequent free attempts will be a noop.
4702         Fixes RH bug #710461
4703
4704         client: match delete[] with new[]
4705         vinfo in x11/platform.cpp is allocated using new[] so it needs to
4706         be freed with delete[]
4707
4708         client: s/recive/receive
4709
4710 2011-07-12  Yonit Halperin  <yhalperi@redhat.com>
4711
4712         server: add missing calls to red_handle_drawable_surfaces_client_synced
4713         red_handle_drawable_surfaces_client_synced was called only from red_pipe_add_drawable, while it
4714         should also be called from red_pipe_add_drawable_after. Otherwise, the client
4715         might receive a command with a reference to a surface it doesn't hold and crash.
4716
4717         server: fix access to a released drawable. RHBZ #713474
4718         red_pipe_add_drawable can lead to removal of drawables from current tree
4719         (since it calls red_handle_drawable_surfaces_client_synced), which can
4720         also lead to releasing these drawables.
4721         Before the fix, red_current_add_equal, called red_pipe_add_drawable,
4722         without assuring afterwards that the drawables it refers to are still alive or
4723         still in the current tree.
4724
4725 2011-07-06  Alon Levy  <alevy@redhat.com>
4726
4727         server: fix segfault if no migrate_info provided
4728         qemu calls spice_server_migrate_switch even if it didn't do a
4729         spice_server_migrate_info first. Fix the resulting error by not pushing
4730         a switch host tag to the pipe in this case, and add a check anyway in the
4731         marshalling code just in case.
4732
4733 2011-07-05  Yonit Halperin  <yhalperi@redhat.com>
4734
4735         server: cursor_channel: releasing pipe items resources when the pipe is cleared (on disconnect)
4736         same as commit 74a9d10af96f4d7c8c1b1d7fca124a8df9180787 for cursor channel
4737
4738         server: display_channel: releasing pipe items resources when the pipe is cleared (on disconnect)
4739         fixes "display_channel_release_item: panic: invalid item type"
4740
4741         Before changing the red_worker to use the red_channel interface, there
4742         was a devoted red_pipe_clear routine for the display channel and cursor channel.
4743         However, clearing the pipe in red_channel, uses the release_item callback
4744         the worker provided. This callback has handled only resources that need to be released
4745         after the pipe item was enqueued from the pipe, and only for pipe items that were set in
4746         red_channel_init_send_data.
4747         This fix changes the display channel release_item callback to handle all types of
4748         pipe items, and also handles differently pushed and non-pushed pipe items.
4749
4750         server: not reading command rings before RED_WORKER_MESSAGE_START, RHBZ #718713
4751         On migration, destroy_surfaces is called from qxl (qxl_hard_reset), before the device was loaded (on destination).
4752         handle_dev_destroy_surfaces led to red_process_commands, which read the qxl command ring
4753         (which appeared to be not empty), and then when processing the command
4754         it accessed unmapped memory.
4755
4756         server: replace redundant code with red_cursor_reset
4757         In addition (1) make handle_dev_destroy_surfaces call red_release_cursor
4758         (2) call red_wait_outgoing_item(cursor_channel) only after adding msgs to pipe
4759
4760         server: removing local cursor, this solves RHBZ #714801
4761         When the worker was stoped, the cursor was copied from guest ram to the host ram,
4762         and its corresponding qxl command was released.
4763         This is unecessary, since the qxl ram still exists (we keep references
4764         to the surfaces in the same manner).
4765         It also led to BSOD on guest upon migration: the device tracks cursor set commands and it stores
4766         a reference to the last one. Then, it replays it to the destination server when migrating to it.
4767         However, the command the qxl replayed has already been released from the pci by the original
4768         worker, upon STOP.
4769
4770 2011-07-05  Alon Levy  <alevy@redhat.com>
4771
4772         tests/migrate: update to use argparse and run spicy by default
4773         Most helpful change is that it prints help if you do --help.
4774         It can take --image parameter, and --client parameter, defaults to spicy.
4775
4776         Incidentally, spicy switch host seems broken - if you run with --client spicec
4777         (assuming spicec is in the PATH), it works fine, but using the default spicy (or
4778         --client spicy) it fails after a single switch.
4779
4780         server/tests/basic_event_loop: strange assert failure; fix
4781
4782         server/smartcard: register channel only when hardware is available
4783
4784 2011-06-29  Alon Levy  <alevy@redhat.com>
4785
4786         Revert "server/smartcard: don't register the channel if no hardware emulated"
4787         This reverts commit 456ff9f8d5d27ac763e89e67a100661084695dc5.
4788
4789         That patch just disabled the smartcard channel completely because
4790         the check was done *before* the initialization of the qemu smartcard
4791         devices, not after.
4792
4793 2011-06-28  Christophe Fergeau  <cfergeau@redhat.com>
4794
4795         red_worker: remove 2 empty functions
4796         red_worker was using some share/unshare stream_buf functions whose
4797         body is empty. This commit removes them and their use.
4798
4799 2011-06-23  Alon Levy  <alevy@redhat.com>
4800
4801         server/smartcard: don't register the channel if no hardware emulated
4802
4803         server/smartcard: handle BaseChannel messages
4804         According to spice.proto the smartcard channel can receive acks and any
4805         other message defined in BaseChannel. While the spicec implementation didn't
4806         send an ACK spice-gtk does, so handle it.
4807
4808 2011-06-22  Christophe Fergeau  <cfergeau@redhat.com>
4809
4810         don't #include config.h in generated header files
4811         7e30572ab adds a #include <config.h> to the beginning of generated
4812         files. It also does this for generated headers and enums files,
4813         which is not wanted, especially if it's an installed file. This
4814         commit only adds this include for the non-header non-enum case
4815         (hopefully, enums are only generated for use in a .h file).
4816
4817         s/__visible__/SPICE_GNUC_VISIBLE
4818         The C specification reserves use of identifiers starting with __
4819         to the compiler so we shouldn't use one such symbol.
4820
4821         add check for pyparsing
4822         Check both in configure.ac (after checking if we need to rebuild
4823         the marshalling files) and in the python script using pyparsing
4824         (for people modifying .proto files in tarballs)
4825
4826 2011-06-22  Marc-André Lureau  <marcandre.lureau@redhat.com>
4827
4828         sndworker: check the caps before sending volume messages
4829
4830         sndworker: add AudioVolume/AudioMute messages
4831         These messages allow the guest to send the audio device volume to the
4832         client. It uses an arbitrary scale of 16bits, which works good enough
4833         for now.
4834
4835         Save VolumeState in {Playback,Record}State, so that we can send the
4836         current volume on channel connection.
4837
4838         Note about future improvements:
4839         - add exact dB support
4840         - add client to guest volume change
4841
4842         Updated since v2:
4843         - bumped record and playback interface minor version to allow
4844           conditional compilation
4845         Updated since v1:
4846         - sync record volume on connection too
4847
4848 2011-06-21  Marc-André Lureau  <marcandre.lureau@redhat.com>
4849
4850         python: remove c-ism trailing ;
4851
4852         codegen: typedef the protocol enums
4853         Commit 9d5ef9beeca722b2ceff7d15aaa3aaaaf07ecfbf in spice-protocol
4854         introduced a typedef manually in the generated enums.h header.
4855
4856         This patch adds them automatically to all enums during enums.h generation.
4857
4858 2011-06-14  Yonit Halperin  <yhalperi@redhat.com>
4859
4860         client: fix for redundant shift+f11 RHBZ #674532
4861         After shift+F11, both in Windows 7 and xp clients, WM_KEYUP events were missing for
4862         SHIFT and F11. For F11 it was less important since unpress_all was preformed for all keys.
4863         However, we perform sync for all the keyboard modifiers and the GetKeyboardState returns "down" for shift.
4864         In windows7 client, we sometimes received afterwards a F11 KEYDOWN event repetition, and this caused SHIFT+F11 to be called again.
4865         Not performing hiding of the windows while changing client resolutions, solved the problem of missing events, and I don't see any difference
4866         in how spice looks while toggling to full screen.
4867         Using GetAsyncKeyState, returns "UP" for shift in windows 7, and helps avoid performing shift+f11 again, if there is an F11 repetition
4868         before we receive the KEYUP event for shift.
4869
4870 2011-05-30  Arnon Gilboa  <agilboa@redhat.com>
4871
4872         client/windows: enable image randomization (ASLR) rhbz#701111
4873         Enable image randomized base address, hindering some types of
4874         security attacks by making it more difficult for an attacker
4875         to predict target addresses.
4876
4877         client/windows: remove slash from x64 build dir
4878         otherwise x64 is built in root if REDC_BUILD_DIR is not defined
4879
4880 2011-05-24  Alon Levy  <alevy@redhat.com>
4881
4882         server/smartcard: fix use after free
4883
4884 2011-05-22  Arnon Gilboa  <agilboa@redhat.com>
4885
4886         client/windows: remove precompiled header for common.h (fix broken windows debug build)
4887         -Release currently doesn't use precompiled headers at all
4888         -Debug is broken since common/*.c files don't include common.h
4889         -PCH can be enabled for all but specifically-chosen c-files
4890
4891         common: add WIN64 ifdef for spice_bit_find_msb (fix broken windows x64 build)
4892         inline __asm is not supported in x64, so use the naive implementation
4893         until x64 asm implemented.
4894
4895 2011-05-19  Yonit Halperin  <yhalperi@redhat.com>
4896
4897         client: fix flipped video in Linux guest on windows client, RHBZ #667689
4898         Video streams from Linux guests are oriented top-down, where gdi_canvas_put_image always
4899         received display context for down-top oriented bitmap. I fixed create_bitmap
4900         to consider the stream orientation.
4901
4902 2011-05-12  Arnon Gilboa  <agilboa@redhat.com>
4903
4904         common: use INLINE instead of inline
4905         needed for spice/common files used by the client, server & qxl driver.
4906         in windows _inline works for both c/c++, while inline is c++ only.
4907         compiling the client with mixed c/c++ code required this define.
4908
4909         client/windows: undef SIZE_MAX in stdint.h
4910         eliminating redefinition warning
4911
4912         common: fix ssl_verify windows build errors
4913
4914         client/windows: add common\ssl_verify.c/h to project
4915         disable WarnAsError, due to c/c++ warnings
4916
4917         client/windows: inc version to 0,9,0,0
4918
4919         client/windows: init PACKAGE_VERSION
4920         in windows, we set PACKAGE_VERSION to the binary version
4921         since we don't have config.h as generated by linux configure
4922
4923 2011-05-12  Alon Levy  <alevy@redhat.com>
4924
4925         client: fix return code when missing host
4926
4927 2011-05-09  Alon Levy  <alevy@redhat.com>
4928
4929         server/red_worker: stat_now cleanup
4930         static, remove inline, add (void), and empty line after function variables.
4931
4932         server/red_worker: fix typo (lats_send_time)
4933
4934         server/tests: show port to connect to
4935
4936 2011-05-08  Marc-André Lureau  <marcandre.lureau@redhat.com>
4937
4938         server: bump SPICE_SERVER_VERSION to 0.9.0
4939         SASL functions will be released with 0.9.0
4940
4941 2011-05-05  Zeeshan Ali (Khattak)  <zeeshanak@gnome.org>
4942
4943         server: Unset executable bit of red_tunnel_worker.h
4944
4945 2011-05-03  Marc-André Lureau  <marcandre.lureau@redhat.com>
4946
4947         build: fix gettimeofday warning
4948           CC     test_playback.o
4949         test_playback.c: In function ‘playback_timer_cb’:
4950         test_playback.c:56:5: warning: implicit declaration of function ‘gettimeofday’
4951
4952         client: make use of ssl_verify.c
4953         Fixed since v1:
4954         - don't include C code, rather use the common lib
4955         - add missing spice_openssl_verify_free() call
4956         - keep the extra-parsing of subject for error reporting
4957
4958         common: add ssl_verify.c common code
4959         Code adapter from RedPeer::ssl_verify_callback() and used by
4960         spice-gtk.
4961
4962         Since v1:
4963          - fixed Makefile.am
4964          - added config.h include
4965          - autoconf alloca added in patch series
4966          - moved int escape inside for loop
4967          - added a failed case when missing assignment
4968          - replaced strlen () by -1
4969          - skip spaces after comma
4970          - c++ guards
4971
4972         I didn't use bool, because openSSL uses int, and it is more future
4973         proof for error reporting.
4974
4975         common: add ring_get_length() for debugging purposes
4976         Please notice it has a "static" modifier, like the rest of the inlined
4977         functions in ring.h, so it won't warn if it isn't used.
4978
4979         common: mem.h add alloca definition
4980         We don't support the autoconf ALLOCA/C_ALLOC fallback. If one day,
4981         someone cares for a weird platform, he can fix it.
4982
4983         common: spice_memdup could accept NULL
4984         (this patch is not to solve a crash fix, but to align with glib API)
4985
4986         common: add windows.h where required, make gdi_handlers static
4987         This patch has not been verified with VS/brew. It should be safe
4988         hopefully. Compilation is fine with mingw32/spice-gtk.
4989
4990         build: require c99
4991         Because we use c99: stdbool.h, inttypes.h, bool, variadic macros, // comments, ...
4992
4993 2011-05-03  Christophe Fergeau  <cfergeau@redhat.com>
4994
4995         move get_time_stamp to main_channel.c
4996         There is only one user of get_time_stamp from spice_common.h so
4997         it's not really useful to keep it there.
4998
4999         use standard do { } while (0) for spice_common.h macros
5000
5001         move WARN and WARN_ONCE to spice_common.h
5002
5003         common: use PANIC from spice_common.h
5004
5005         common,server: use ASSERT from spice_common.h
5006         spice_common.h provides an ASSERT macro, no need to duplicate it
5007         in many places. For now client/debug.h keeps its own copy since
5008         debug.h and spice_common.h have clashes on other macros which are
5009         trickier to unify.
5010
5011         server: use gcc builtin for atomic get/set bit
5012
5013         client: remove unused mb() macro
5014
5015         common: don't duplicate find_msb implementation
5016
5017         remove void * arithmetic
5018         With -Wpointer-arith, gcc complains about void pointer arithmetic.
5019         This is not a big deal with gcc, but could be with other compilers,
5020         so it's better to cast to char */uint8_t * before doing the
5021         arithmetic on such pointers.
5022
5023         add missing static
5024
5025         configure.ac: remove setting default C(XX)FLAGS
5026         automake/autoconf already set them for us to -g -O2 if there are
5027         no flags defined.
5028
5029         win32: remove obsolete preprocessor #defines
5030         SW_CANVAS_NO_CHUNKS isn't used anywhere but in this file.
5031         SW_CANVAS_CACHE is now defined directly in the files where it's
5032         needed so we no longer need it in the .vcproj file.
5033
5034         add comment to beginning of autogenerated files
5035
5036         s/USE_OGL/USE_OPENGL
5037         This is more explicit about what it does, and not much longer
5038
5039         use AC_DEFINE instead of hardcoding preprocessor flags
5040         Now that all source files include config.h, we can use AC_DEFINE
5041         to enable/disable optional features (opengl, cegui). This is
5042         cleaner than directly appending -Dxxx directives to the preprocessor
5043         flags. This also guarantees that everything will be appropriately
5044         rebuilt when using the same source tree to build first with opengl
5045         support and then without (the config.h timestamp will change,
5046         triggering a rebuild of the files including it)
5047
5048         add config.h to autogenerated files too
5049         Modify the python (de)marshaller generator to add #include
5050         <config.h> at the beginning of the C files it generates
5051
5052         add #include <config.h> to all source files
5053         When using config.h, it must be the very first include in all source
5054         files since it contains #define that may change the compilation process
5055         (eg libc structure layout changes when it's used to enable large file
5056         support on 32 bit x86 archs). This commit adds it at the beginning
5057         of all .c and .cpp files
5058
5059         autotools: correctly build canvas-related code
5060         spice client and spice server shares code from
5061         common/{gdi,gl,sw}_canvas.[ch]. However, while most of the code is
5062         shared, the server code wants a canvas compiled with
5063         SW_CANVAS_IMAGE_CACHE defined while the client code wants a canvas
5064         compiled with SW_CANVAS_CACHE.
5065
5066         The initial autotools refactoring didn't take that into account,
5067         this is now fixed by this commit. After this commit, the canvas
5068         files from common/ are no longer compiled as part of the
5069         libspice-common.la convenience library. Instead, there are "proxy"
5070         canvas source files in client/ and server/ which #include the
5071         appropriate C files after defining the relevant #define for the
5072         binary that is being built.
5073
5074         To prevent misuse of the canvas c files and headers in common/,
5075         SPICE_CANVAS_INTERNAL must be set when including the canvas headers
5076         from common/ or when building the c files from common/ otherwise
5077         the build will error out.
5078
5079         configure.ac: remove unused AC_SUBST
5080
5081         autotools: refactor the whole build machinery
5082         spice Makefile.am setup is a bit confusing, with source file
5083         names being listed several times in different Makefile.am
5084         (generally, once in EXTRA_DIST and another time in another
5085         Makefile.am in _SOURCES). The client binaries are built
5086         by client/x11/Makefile.am, which means recursing into client,
5087         then into x11 to finally build spicec. This Makefile.am is
5088         also referencing files from common/ and client/, which is
5089         a bit unusual with autotools.
5090
5091         This patch attempts to simplify the build process to get
5092         something more usual from an autotools point of view.
5093         The source from common/ are compiled into a libtool convenience
5094         library, which the server and the client links against which avoids
5095         referencing source files from common/ when building the server and
5096         the client. The client is built in client/Makefile.am and directly
5097         builds files from x11/ windows/ and gui/ if needed (without
5098         recursing in these subdirectories).
5099
5100         This makes the build simpler to understand, and also makes it
5101         possible to list source files once, which avoids potential
5102         make distcheck breakage when adding new files.
5103
5104         There is a regression in this patch with respect to
5105         sw_canvas/gl_canvas/gdi_canvas. They should be built with
5106         different preprocessor #defines resulting in different behaviour
5107         of the canvas for the client and the server. However, this is not
5108         currently the case, both the client and the server will use the same
5109         code for now (which probably means one of them is broken). This will
5110         be fixed in a subsequent commit.
5111
5112         make distcheck passes, but compilation on windows using the
5113         autotools build system hasn't been tested, which means it's likely
5114         to be broken. It shouldn't be too hard ot fix it though, just let
5115         me know of any issues with this.
5116
5117 2011-05-02  Christophe Fergeau  <cfergeau@redhat.com>
5118
5119         add missing "LGPLv2.1 or later" header to source files
5120
5121         common: don't try to redefine PANIC if it already exists
5122         canvas_base.c tries to define PANIC, but it might already be set
5123         if eg client/debug.h has been included before. All the other
5124         macros in this file are guarded by #ifndef, this commit adds
5125         the missing #ifndef to PANIC. Note that this is just a bandaid,
5126         ideally common/ would contain a logging frameword, and these
5127         macros would only be defined once instead of being defined in
5128         several places.
5129
5130         server: s/desable/disable
5131         This fixes a typo in some function names, there should be no
5132         functional change.
5133
5134         use foo(void) instead of foo() in prototypes
5135         In C, the latter isn't a prototype for a function with no arg,
5136         but declares a function with an undefined number of args.
5137
5138         server: remove extra arg in reds_on_main_agent_start call
5139
5140         client: remove c++ wrappers
5141         client/ contains several .cpp file which only #include a .c file
5142         of the same name. This is unusual and seems to only be done to
5143         get C++ name mangling on the symbols defined in the C file.
5144         Now that all headers files in common/ use extern "C", these
5145         wrappers are no longer useful.
5146
5147         common: add missing header guards to gl_canvas.h
5148
5149         common: add extern "C" guards to headers
5150         Since some spice C++ code is using code from common/, the C
5151         functions need to be marked as such for the C++ compiler, otherwise
5152         we'll get linkage issues.
5153
5154         client: make building client optional
5155
5156         configure.ac: replace tab with spaces
5157         This makes the "C++ Compiler:     ...." status output nicely
5158         aligned with the other messages.
5159
5160         configure.ac: remove unused dynamic linkage flag
5161         configure.ac defines a SPICEC_STATIC_LINKAGE_BDYNAMIC variable
5162         when --enable-static-linkage is not set, but it's never used.
5163         SPICEC_STATIC_LINKAGE_BSTATIC is used in client/, but since we
5164         are using libtool, it might be more appropriate to use
5165         'make LDFLAGS="-all-static"' to achieve static link.
5166
5167         configure.ac: fix use of AC_ARG_ENABLE
5168         Most uses of AC_ARG_ENABLE were buggy:
5169         - when passing --disable-xxx, configure.ac would behave as if it
5170           was passed --enable-xxx
5171         - passing --enable-xxx=foo would "leak" into the summary, ie the
5172           summary (at the end of configure) would say "xxx: foo" instead
5173           of "xxx: yes"
5174
5175         This patch fixes these 2 issues.
5176
5177         configure.ac: fix make dist
5178
5179         server: use is_primary_surface
5180         red_worker.c has an is_primary_surface helper function, but there
5181         were some places in the file not using it. This patch fixes that
5182
5183 2011-04-26  Alon Levy  <alevy@redhat.com>
5184
5185         spice.proto: Fill.rop_descriptor type s/uint16/ropd (10x atiti)
5186
5187 2011-04-18  Christophe Fergeau  <cfergeau@redhat.com>
5188
5189         client: skip spaces in --host-subject
5190         This fixes fdo bug #32896:
5191
5192         "Subject in certificates is stored in following format (values separated by
5193         comma and space):
5194
5195         grep Subject: server-cert.pem | awk -F": " '{print $2}'
5196         O=REDHAT, CN=10.34.58.2
5197
5198         While spicec expects that values in host subject are separated only by comma:
5199
5200         spicec --host-subject "O=REDHAT,CN=10.34.58.2"
5201         "
5202
5203         In this case, ignoring spaces make it much easier to directly copy and paste
5204         the subject line from certificates.
5205
5206         draw: remove SPICE_ADDRESS
5207         This commit removes the typedef for SPICE_ADDRESS which was no
5208         longer used. This is the last thing that was missing to close
5209         fdo bug #28984
5210
5211         client: add --version cmdline option to spicec
5212         This fixes freedesktop bug #33907
5213
5214         client: s/reqired/required in CmdLineParser
5215
5216         client: s/AVAILIBLE/AVAILABLE in CmdLineParser
5217         It was mispelt in a CmdLineParser enum.
5218
5219 2011-04-08  Christophe Fergeau  <cfergeau@gmail.com>
5220
5221         server/tests remove useless assignment
5222         This was detected by clang-static-analyzer.
5223
5224         common/pixman: remove dead assignments
5225         They were detected using clang-static-analyzer. Don't initialize
5226         the variable to a value to override it with a different value
5227         a few lines after.
5228
5229         tests: fix compilation with -Wall -Werror
5230         When compiling spice with make CFLAGS="-g3 -ggdb3 -O0 -Wall -Werror",
5231         the build broken because of a few unused variables/missing returns.
5232         This patch fixes these warnings.
5233
5234 2011-04-08  Christophe Fergeau  <cfergeau@redhat.com>
5235
5236         gl: remove unused variables
5237         gcc 4.6 warned about these.
5238
5239         gl: use correct pixman accessor for image data
5240         Commit 774e5bd36f4 changed
5241         -  dest->source.pixmap.x_image->data +
5242         +  (uint8_t *)pixman_image_get_stride(dest->source.pixmap.pixman_image) +
5243
5244         The correct accessor to use is pixman_image_get_data. Thanks to gcc
5245         4.6 for warning about a "different size" int to pointer conversion.
5246
5247         client: use silent generation rules in Makefile.am
5248         The server Makefile.am rules for marshallers generation are
5249         prefixed with AM_V_SILENT to integrate nicely with automake silent
5250         rules. The same AM_V_SILENT prefix isn't used in client/Makefile.am
5251         resulting in verbose output even when automake silent mode is
5252         enabled. This commit removes this verbosity.
5253
5254 2011-04-04  Christophe Fergeau  <cfergeau@gmail.com>
5255
5256         configure.ac: remove detection of WARN_UNUSED_RESULT
5257         spice configure.ac has some code to detect if the compiler has
5258         a special attribute to tag some functions so that they generate a
5259         warning when their return value isn't checked. However, this test
5260         is broken (the gcc attribute name is "warn_unused_result", not
5261         "__warn_unused_result__" and WARN_UNUSED_RESULT is unused anyway
5262         since spice-protocol provides SPICE_GNUC_WARN_UNUSED_RESULT. Thus
5263         we can just drop that block of code from configure.ac
5264
5265 2011-04-04  Christophe Fergeau  <cfergeau@redhat.com>
5266
5267         remove duplicated macro
5268         MIN() is already defined in spice-protocol/spice/macros.h
5269
5270 2011-04-04  Hans de Goede  <hdegoede@redhat.com>
5271
5272         server: make sure we clear vdagent and update mouse mode on agent disconnect
5273         The check this patch removes causes us to not set vdagent to NULL, nor
5274         update the mouse mode when the guest agent disconnects when no client is
5275         attached. Which leads to a non working mouse, and on agent reconnect a
5276         "spice_server_char_device_add_interface: vdagent already attached" message
5277         instead of a successful re-add of the agent interface .
5278
5279         server: ignore SPICE_MSGC_MAIN_AGENT_START messages when there is no agent
5280         This can happen for example when a SPICE_MSGC_MAIN_AGENT_START message
5281         from the client and the vdagent disconnecting race.
5282
5283         server: hookup agent-msg-filter discard-all functionality
5284         This ensures that if the client or agent connects to the client-agent
5285         "tunnel" while the other side is halfway through sending a multi part
5286         message, the rest of the message gets discarded, and the connecting
5287         party starts getting data at the beginning of the next message.
5288
5289         server: add discard all option to agent message filter
5290
5291         server: filter all data from client
5292         Filter all data from client, even when there is no agent connected
5293         to keep filter state correct.
5294
5295         server: reset read/write filter on agent/client disconnect
5296         The agent message filter keeps track of messages as they are being send
5297         reset the relevant filter to its initial state when one of the 2 ends
5298         of the agent<->client "tunnel" disconnects.
5299
5300         server: break read_from_vdi_port loop if the guest gets disconnected
5301         read_from_vdi_port calls dispatch_vdi_port data, which will disconnect
5302         the guest agent if it sends invalid data. It would then try to read more
5303         data from the disconnected guest agent resulting in a NULL ptr dereference,
5304         this patch fixes this.
5305
5306         server: Don't stop writing agent data to the guest when the client disconnects
5307         write_to_vdi_port() was checking for reds->agent_state.connected to determine
5308         wether it could write queued data. But agent_state.connected reflects if
5309         *both* ends are connected. If the client has disconnected, but the guest agent
5310         is still connected and some data is still pending (like a final clipboard
5311         release from the client), then this data should be written to the guest agent.
5312
5313         server: Don't reset agent state when the client disconnects
5314         We were calling reds_reset_vdp on client disconnect, which is not a good
5315         idea. reds_reset_vdp does 3 things:
5316
5317         1) It resets the state related to reading chunks from the spicevmc virtio
5318            port. If the client disconnects while the guest agent is in the middle
5319            of sending a chunk, this will lead to an inconsistent state, and lots
5320            of printing of "dispatch_vdi_port_data: invalid port" messages caused
5321            by this inconsistent state sometimes followed by a segfault.
5322
5323            This can be triggered by copy and pasting something large (say
5324            a screenshot) from the guest to the spice-gtk client, as the spice-gtk
5325            client currently has a bug causing it to crash when receiving a multi
5326            chunk vdagent messages. Without this patch (and with the spice-gtk bug
5327            present) I can consistently reproduce this.
5328
5329         2) It clears any buffered writes from the client to the guest still pending
5330            because the virtio port cannot consume data fast enough. Since the agent
5331            itself is still running fine, throwing away writes for it because the
5332            client has disconnected makes no sense. Esp, since on clean exit the
5333            client may very well send a clipboard release message directly
5334            before closing the connection, and this may get lost this way.
5335
5336         3) It sets client_agent_started to false, this is the only thing which
5337            actually makes sense to do on client disconnect.
5338
5339         Note that since we no longer reset the vdp state on client disconnect, we
5340         must now reset it on agent disconnect even if we don't have a client. So
5341         the reds_reset_vdp call in reds_agent_remove() gets moved to the top,
5342         above both the agent_state.connected and reds->peer checks which will
5343         both fail in the no client case.
5344
5345 2011-03-24  Hans de Goede  <hdegoede@redhat.com>
5346
5347         server: avoid unneeded recursion in dispatch_vdi_port_data
5348         dispatch_vdi_port_data, was calling vdi_read_buf_release when no client
5349         is connected to free the passed in buf. The only difference between
5350         vdi_read_buf_release and directly adding the buffer back to the ring
5351         with ring_add, is that vdi_read_buf_release calls read_from_vdi_port
5352         after adding the buffer back. But dispatch_vdi_port_data only gets called
5353         from read_from_vdi_port itself, thus this would lead to recursing into
5354         read_from_vdi_port. read_from_vdi_port is protected against recursion and
5355         will immediately return if called recursively. Thus calling
5356         vdi_read_buf_release from dispatch_vdi_port_data is pointless, instead
5357         simply putting the buffer back in the ring suffices.
5358
5359         server: Make copy paste support configurable
5360         Also bump SPICE_SERVER_VERSION to 0x000801 as 0.8.1 will be the
5361         first version with the new API for this, and we need to be able to
5362         detect the presence of this API in qemu.
5363
5364         spice-server: Add the ability to filter agent messages
5365
5366 2011-03-23  Hans de Goede  <hdegoede@redhat.com>
5367
5368         spicec-x11: Work around a bug in xsel
5369         Although ICCCM 2.2. Responsibilities of the Selection Owner:
5370         http://tronche.com/gui/x/icccm/sec-2.html#s-2.2
5371
5372         Clearly states (about selection notify events):
5373         The owner should set the specified selection, target, time, and property
5374         arguments to the values received in the SelectionRequest event.
5375
5376         xsel sets the selection notify event target member to the incr atom when it
5377         is going to send the clipboard data incremental, rather then setting it to
5378         the UTF8_STRING atom (which was the target of the SelectionRequest).
5379
5380         Work around this (esp as it is likely other programs may get this wrong too)
5381         and accept the incr atom as a valid target in a selection notify event.
5382
5383         This fixes Alon's test with running:
5384         python -c "print list(range(1000))" | xsel -i -b
5385         on the client.
5386
5387         spicec-x11: Don't crash on apps sending bad atoms as TARGETS
5388         Some apps (bad xsel, bad!) send invalid Atoms in their TARGETS property,
5389         causing spicec to exit because of an XError. This patch makes spicec survive
5390         this scenario.
5391
5392         For more info on the xsel bug, see:
5393         https://bugzilla.redhat.com/show_bug.cgi?id=690214
5394
5395 2011-03-23  Christophe Fergeau  <cfergeau@gmail.com>
5396
5397         common/gl: remove unused variable
5398         clang static analyzer warned that 'len' was computed but never
5399         used in glc_vertex2d. glc_stroke_line_dash has side effects so
5400         we have to call it, but we don't need to save its return value
5401         since it's not used.
5402
5403         opengl: fix compilation
5404         When OpenGL is enabled, build fails in DisplayChannel::create_surface
5405         because Canvas *canvas is declared twice. Remove the first
5406         declaration to fix compilation.
5407
5408 2011-03-22  Alon Levy  <alevy@redhat.com>
5409
5410         server/tests: add test_playback
5411
5412         configure.ac: fix message when missing SASL lib
5413
5414         server: use -std=c99
5415         Finds some bugs.
5416
5417         python_modules/codegen.py: fix indent error in an unused function
5418
5419         client/smartcard: use proper include delemiters
5420
5421 2011-03-11  Hans de Goede  <hdegoede@redhat.com>
5422
5423         client: Don't handle hotkeys while sticky alt is active
5424         In some cases rhev-m changes the hotkey for releasing the mouse grab
5425         to ctrl + alt. This makes it impossible to send ctrl + alt + other-key
5426         to the guest, even when using sticky alt.
5427
5428         What happens is:
5429         -press alt until sticky alt activates
5430         -release alt (but recorded state stays pressed due to sticky alt)
5431         -press ctrl
5432         -hotkey code sees ctrl+alt pressed, releases mouse grab
5433         -mouse grab release code does an unpress all -> end of sticky state.
5434
5435         This patch makes it possible to atleast send ctrl + alt + del (or other key)
5436         using sticky alt. Note: even with this patch it is still a bad idea to
5437         use ctrl + alt as hotkey combi.
5438
5439 2011-03-08  Alon Levy  <alevy@redhat.com>
5440
5441         server/reds: allow call to reds_agent_remove even if it is gone
5442         The current assert(reds->agent_state.connected) tiggers if when
5443         the agent disconnected there was still data waiting to be sent (for
5444         instance if there is a bug in the client handling clipboard and it
5445         is killed while a large clipboard transfer is in progress). So first
5446         call to reds_agent_remove happens from spice_server_char_device_remove_interface,
5447         and then it is called again (triggering the assert) from free_item_data
5448         from read_from_vdi_port because of the channel destruction.
5449
5450         Other option would be to not call it from one of the paths - but that
5451         is suboptimal:
5452          * if there is no data in the pipe, the second call never happens.
5453          * the second call has to be there anyway, because it may fail during
5454           parsing data from the agent.
5455
5456         This patch fixes a segfault on this assert when a client starts passing
5457         from guest agent to client a large clipboard and dies in the middle. There
5458         is still another assert happening occasionally at marshaller which I don't
5459         have a fix for (but it doesn't seem to be related).
5460
5461         client/smartcard: handle the --smartcard-db option
5462
5463 2011-03-08  Arnon Gilboa  <agilboa@redhat.com>
5464
5465         client/windows: cleanup vcproj based on updated libs
5466         using updated windows libraries:
5467         http://www.spice-space.org/download/stable/wspice-x86_08032011.zip
5468         http://www.spice-space.org/download/stable/wspice-x64_08032011.zip
5469
5470         -remove IgnoreDefaultLibraryNames="MSVCRT.lib", since pixman is now compiled
5471         using MT threading model similar to other libraries. It used to be mistakenly
5472         compiled with MD.
5473
5474         -downgrade freetype lib to 2.3.11-7, which is the one used/tested with
5475         CEGUI 0.6.2
5476
5477         -pthread lib patched (InterlockedCompareExchange), so x64 client will no
5478         longer crash on SelectClipRgn, BitBlt etc.
5479
5480 2011-03-03  Marc-André Lureau  <marcandre.lureau@redhat.com>
5481
5482         server/input: avoid double free() of RedChannel on disconnect
5483         Current master is calling red_channel_destroy() on incoming error, but
5484         reds Channels still references it, which causes a double free() later
5485         on (see valgrind report below).
5486
5487         Instead, on error condition, do like the rest of the channels and call
5488         reds_disconnect(), which remove the references and call shutdown(),
5489         which then call red_channel_destroy() and finally free the channel
5490         with red_channel_destroy().
5491
5492         Note: the previous code intention was certainly to be able to keep the
5493         rest of the channels connected when input channel has errors. This is
5494         not addressed by this patch.
5495
5496         red_channel_shutdown:
5497         ==29792== Invalid read of size 8
5498         ==29792==    at 0x4C6F063: red_channel_shutdown (red_channel.c:460)
5499         ==29792==    by 0x4C51EFA: inputs_shutdown (inputs_channel.c:463)
5500         ==29792==    by 0x4C48445: reds_shatdown_channels (reds.c:539)
5501         ==29792==    by 0x4C4868A: reds_disconnect (reds.c:603)
5502         ==29792==    by 0x4C519E9: main_channel_on_error (main_channel.c:765)
5503         ==29792==    by 0x4C6E80A: red_channel_peer_on_incoming_error (red_channel.c:215)
5504         ==29792==    by 0x4C6E22D: red_peer_handle_incoming (red_channel.c:87)
5505         ==29792==    by 0x4C6E551: red_channel_receive (red_channel.c:154)
5506         ==29792==    by 0x4C6F329: red_channel_event (red_channel.c:531)
5507         ==29792==    by 0x41CB8C: main_loop_wait (vl.c:1365)
5508         ==29792==    by 0x437CDE: kvm_main_loop (qemu-kvm.c:1589)
5509         ==29792==    by 0x41FE9A: main (vl.c:1411)
5510         ==29792==  Address 0x30b0f6d0 is 0 bytes inside a block of size 28,648 free'd
5511         ==29792==    at 0x4A05372: free (vg_replace_malloc.c:366)
5512         ==29792==    by 0x4C6F032: red_channel_destroy (red_channel.c:454)
5513         ==29792==    by 0x4C6E80A: red_channel_peer_on_incoming_error (red_channel.c:215)
5514         ==29792==    by 0x4C6E22D: red_peer_handle_incoming (red_channel.c:87)
5515         ==29792==    by 0x4C6E551: red_channel_receive (red_channel.c:154)
5516         ==29792==    by 0x4C6F329: red_channel_event (red_channel.c:531)
5517         ==29792==    by 0x41CB8C: main_loop_wait (vl.c:1365)
5518         ==29792==    by 0x437CDE: kvm_main_loop (qemu-kvm.c:1589)
5519         ==29792==    by 0x41FE9A: main (vl.c:1411)
5520
5521         https://bugs.freedesktop.org/show_bug.cgi?id=34971
5522
5523         Revert "server/red_channel: red_channel_event: push on blocked"
5524         This reverts commit 5062433d8af45822371b6487a8d7baea23071d18.
5525
5526         red_channel_receive() can call red_channel_destroy() which frees
5527         channel.
5528
5529         The condition bellow is then checked, which can access a freed
5530         channel:
5531
5532         if (event & SPICE_WATCH_EVENT_WRITE || channel->send_data.blocked)
5533
5534         Reverting this commit solves the issue without any apparent
5535         bugs/drawbacks, which kind of clears out the weird TODO.
5536
5537         handle_dev_input: cursor connect
5538         ==11826== Invalid read of size 4
5539         ==11826==    at 0x4C6F83C: red_channel_event (red_channel.c:535)
5540         ==11826==    by 0x41CB8C: main_loop_wait (vl.c:1365)
5541         ==11826==    by 0x437CDE: kvm_main_loop (qemu-kvm.c:1589)
5542         ==11826==    by 0x41FE9A: main (vl.c:1411)
5543         ==11826==  Address 0x31fb00f0 is 96 bytes inside a block of size 28,648 free'd
5544         ==11826==    at 0x4A05372: free (vg_replace_malloc.c:366)
5545         ==11826==    by 0x4C6F536: red_channel_destroy (red_channel.c:453)
5546         ==11826==    by 0x4C52B5D: inputs_channel_on_incoming_error (inputs_channel.c:449)
5547         ==11826==    by 0x4C6ED0E: red_channel_peer_on_incoming_error (red_channel.c:215)
5548         ==11826==    by 0x4C6E731: red_peer_handle_incoming (red_channel.c:87)
5549         ==11826==    by 0x4C6EA55: red_channel_receive (red_channel.c:154)
5550         ==11826==    by 0x4C6F82D: red_channel_event (red_channel.c:530)
5551         ==11826==    by 0x41CB8C: main_loop_wait (vl.c:1365)
5552         ==11826==    by 0x437CDE: kvm_main_loop (qemu-kvm.c:1589)
5553         ==11826==    by 0x41FE9A: main (vl.c:1411)
5554         ==11826==
5555
5556         https://bugs.freedesktop.org/show_bug.cgi?id=34971
5557
5558 2011-03-02  Alon Levy  <alevy@redhat.com>
5559
5560         server/red_worker: use red_channel_pipe_item_init
5561         replaces in file red_pipe_item_init.
5562
5563         server/red_channel: move out_bytes_counter from Outgoing to RedChannel
5564
5565         server/red_channel: split Incoming/Outgoing to callback and state
5566         This allows later to have the callback table under RedChannel when
5567         the callbacks actually get used by RedChannelClient. Since the cb's
5568         are identical for different clients of the same channel it makes sense
5569         to store the callback pointers in one place per channel. The rest of
5570         the incoming and outgoing struct just gets moved to RedChannelClient.
5571
5572         server/red_channel: no opaque in red_channel_peer_on_*_error
5573
5574         server/red_worker: use red_channel_is_connected
5575
5576         server/red_channel: add red_channel_disconnect, use in red_worker
5577         replace channel_release_res in red_worker with red_channel_disconnect.
5578
5579         server/red_channel: reset send_data.item to NULL after release
5580
5581         server/red_worker: remove RedChannel argument from add_buf_from_info
5582         It was unused.
5583
5584         server/red_channel: add red_channel_{,no_}item_being_sent
5585
5586         server/red_worker: complete removal of send_data.marshaller use
5587
5588         server/red_worker: replace _send_ functions by _marshall_
5589         Changes in display channel for a code size win.
5590
5591         A note about this and the previous cursor change: it will appear that we are
5592         now (with these changes) releasing resources too early. This is not so - send
5593         always has the option of blocking, which means after send you can not release
5594         resources anyway, that's what the release_item callback is for. So both the
5595         code before and now are doing the same accounting.
5596
5597         server/red_channel: add red_channel_send_message_pending
5598
5599         server/red_channel: add red_channel_all_blocked
5600
5601         server/red_worker: cursor channel: replace _send_ with _marshall_
5602
5603         server/red_channel (all): add red_channel_get_header
5604         This is useful during the channel specific channel_send_pipe_item_proc
5605         callback, it allows altering or reader the header being sent.
5606
5607         server/red_channel: add red_channel_get_first_socket
5608         Use in main_channel. This is just for backward portability later
5609         when multiple clients are introduced - needs to be considered (which
5610         sockets do we want to export from libspiceserver?)
5611
5612         server/red_channel (+): remove red_channel_add_buf
5613
5614         server/tunnel: pass SpiceMarshaller reference from send
5615         Introduce SpiceMarshaller param to all send's that do add_buf
5616
5617         Next patch will use marshaller in all functions that currently don't by
5618         replacing red_channel_add_buf with marshaller add_ref. Note - currently
5619         tunnel is broken due to wrong size in messages.
5620
5621         server/red_channel (all): add red_channel_get_stream
5622         use in config_socket, this makes the stream internal to the RedChannel
5623         implementation that will change later for multiple client support.
5624
5625         ring: add RING_FOREACH{,_SAFE,_REVERSED}
5626
5627         server/common: introduce common/spice_common.h
5628         move all the ASSERT/PANIC/PANIC_ON/red_error/red_printf* macros
5629         to a common file to be used with ring.h that is going to be used externally
5630         (by spice-gtk).
5631
5632         server/red_channel (all): handle MIGRATE_DATA and MIGRATE_FLUSH_DATA
5633         Handling done in red_channel instead of per channel, using call backs
5634         for the channel specific part.
5635         Intended to reduce furthur reliance of channels on RedChannel struct.
5636
5637         The commit makes the code harder to understand because of the artificial
5638         get_serial stuff, should later be fixed by having a joint migration
5639         header with the serial (since all channels pass it).
5640
5641         server/red_channel (all): add red_channel_get_marshaller
5642         For ussage in the send_item callback. It's only valid during this
5643         time anyway (should make it return NULL in other occasions?)
5644
5645         No more direct usage of RedChannel.send_data.marshaller by channels.
5646
5647         server/red_worker: use red_channel_destroy
5648
5649         server/inputs_channel: s/PIPE_ITEM_INIT/PIPE_ITEM_INPUTS_INIT/
5650
5651         server/red_channel: move SET_ACK to red_channel
5652
5653         server/red_channel: add more ack api
5654
5655         server: use red_channel_get_message_serial
5656
5657         server/red_channel (all): makes red_channel_reset_send_data private
5658         ready the way for handling ack messages in RedChannel.
5659
5660         server/red_worker: use red_channel
5661
5662         server/red_channe: make hold_item take a channel arg
5663
5664         server/red_worker: introduce red_peer_handle_outgoing and OutgoingHandler
5665         From red_channel.
5666
5667         server/red_worker: introduce common_channel_config_socket
5668
5669         server/red_worker: line width fix
5670
5671         server/red_worker: don't push to NULL channel (called from device input)
5672
5673         server/red_worker: introduce red_channel_pipe_clear
5674         No more common_release_pipe_item
5675
5676         server/red_worker: add red_channel_push
5677
5678         server/red_worker: add send_item
5679
5680         server/red_worker: red_channel renames
5681         The renames are part of refactoring red_worker's RedChannel to reuse
5682         red_channel.h's RedChannel at the end.
5683
5684         s/red_send_data/red_channel_send/
5685         s/red_pipe_get/red_channel_pipe_get/
5686         s/recive_data/incoming/
5687         s/red_receive/red_channel_receive/
5688         s/channel_handle_message/red_channel_handle_message/
5689         s/channel_is_connected/red_channel_is_connected/
5690         s/red_pipe_add_type/red_channel_pipe_add_type/
5691
5692         server/red_tunnel_worker: use message_serial setter and getter
5693         fixes breakage in --enable-tunnel compilation.
5694
5695 2011-03-01  Hans de Goede  <hdegoede@redhat.com>
5696
5697         x11: Use _exit rather then exit on X errors (rhbz#680763)
5698         This avoids us trying to restore the original resolution when we're fullscreen
5699         and an X error happens. As restoring fullscreen is a bad idea then as this
5700         involves making more X calls, which can get us stuck (in side an XLockDisplay
5701         call for example).
5702
5703 2011-03-01  Uri Lublin  <uril@redhat.com>
5704
5705         client: exit nicely for --controller with no SPICE_XPI_SOCKET (rhbz#644292)
5706         When starting spicec with --controller, SPICE_XPI_SOCKET environment
5707         variable must be defined so spicec and the controller can be connected.
5708
5709 2011-03-01  Hans de Goede  <hdegoede@redhat.com>
5710
5711         Fix keyb modifiers not syncing from client to client os (rhbz#679467)
5712
5713 2011-02-28  Marc-André Lureau  <marcandre.lureau@redhat.com>
5714
5715         server: add SASL support
5716         We introduce 2 public functions to integrate with the library user.
5717
5718         spice_server_set_sasl() - turn on SASL
5719         spice_server_set_sasl_appname() - specify the name of the app (It is
5720         used for where to find the default configuration file)
5721
5722         The patch for QEMU is on its way.
5723
5724         https://bugs.freedesktop.org/show_bug.cgi?id=34795
5725
5726         server: add auth mechanism selection
5727         https://bugs.freedesktop.org/show_bug.cgi?id=34795
5728
5729         server: add reds_channel_dispose()
5730         Try to have a common base dispose() method for channels. For now, it
5731         just free the caps.
5732
5733         Make use of it in snd_worker, and in sync_write() - sync_write() is
5734         going to have default caps later on.
5735
5736         https://bugs.freedesktop.org/show_bug.cgi?id=34795
5737
5738         server: simplify and constify sync_write()
5739         + symplify, improving style of code using it.
5740
5741         https://bugs.freedesktop.org/show_bug.cgi?id=34795
5742
5743         server: pull out reds_handle_link(), for future reuse
5744         + a couple of indent, style change
5745
5746         https://bugs.freedesktop.org/show_bug.cgi?id=34795
5747
5748         build: add --with-sasl
5749         Using cyrus SASL library (same as gtk-vnc/qemu).
5750
5751         https://bugs.freedesktop.org/show_bug.cgi?id=34795
5752
5753         common: add SpiceBuffer - based on qemu-vnc Buffer
5754         https://bugs.freedesktop.org/show_bug.cgi?id=34795
5755
5756         server/reds: make writev fallback more generic
5757         We are going to reuse it for SASL/SSF encode write().
5758
5759         https://bugs.freedesktop.org/show_bug.cgi?id=34795
5760
5761         server: rename s/peer/stream
5762         This is stylish change again. We are talking about a RedStream object,
5763         so let's just name the variable "stream" everywhere, to avoid
5764         confusion with a non existent RedPeer object.
5765
5766         https://bugs.freedesktop.org/show_bug.cgi?id=34795
5767
5768         server/reds: remove the void* ctx field
5769         https://bugs.freedesktop.org/show_bug.cgi?id=34795
5770
5771         server: use the new reds_stream_{read,write}
5772         https://bugs.freedesktop.org/show_bug.cgi?id=34795
5773
5774 2011-02-27  Marc-André Lureau  <marcandre.lureau@redhat.com>
5775
5776         server: remove cb_free, not needed anymore
5777         https://bugs.freedesktop.org/show_bug.cgi?id=34795
5778
5779         server: use reds_{link,stream}_free()
5780         Be carefull removing the watch before, like __release_link
5781
5782         https://bugs.freedesktop.org/show_bug.cgi?id=34795
5783
5784         server: use reds_stream_remove_watch() helper
5785         https://bugs.freedesktop.org/show_bug.cgi?id=34795
5786
5787         server: add reds_stream_{read,write,free,remove_watch}()
5788         https://bugs.freedesktop.org/show_bug.cgi?id=34795
5789
5790         server: s/RedsStreamContext/RedsStream
5791         https://bugs.freedesktop.org/show_bug.cgi?id=34795
5792
5793         server/reds: remove unused readv
5794         Let's not bother with it since nobody uses it, and it's not implemented for SSL anyway
5795
5796         https://bugs.freedesktop.org/show_bug.cgi?id=34795
5797
5798         build: make it silent
5799         This patch make it easier to spot warnings in compilation.  It should
5800         work with older versions of automake that don't support silent rules.
5801
5802         If you want verbose build, make V=1.
5803
5804
5805         https://bugs.freedesktop.org/show_bug.cgi?id=34795
5806
5807 2011-02-13  Arnon Gilboa  <agilboa@redhat.com>
5808
5809         client/windows: use SPICE_PROTOCOL_DIR in project include dirs
5810         instead of ..\..\..\spice-protocol. Relative path to another git tree is a bit
5811         ugly, since it requires spice-protocol to be in a specific location.
5812
5813         SPICE_PROTOCOL_DIR should also be used in windows qxl and vdagent instead of
5814         SPICE_COMMON_DIR, which is an old and confusing name, due to the common
5815         directory in spice git repo.
5816
5817 2011-02-11  Alon Levy  <alevy@redhat.com>
5818
5819         server/tests/basic_event_loop: fix bzero warning
5820
5821         tests/migrate.py: refactor to allow importing for later use
5822
5823 2011-02-11  Hans de Goede  <hdegoede@redhat.com>
5824
5825         Drop static_title.bmp from windows/Makefile.am
5826
5827 2011-02-11  Alon Levy  <alevy@redhat.com>
5828
5829         server/red_worker: cursor_channel_send_item: don't downcast
5830
5831         server/red_worker: match channel_release_pipe_item_proc to red_channel
5832
5833         server/red_worker: introduce an outgoing struct around out_bytes_counter
5834
5835         server/red_worker: renames to add channel_ prefix and consistent sig
5836         s/disconnect_channel_proc/channel_disconnect_proc/
5837         s/release_item_proc/channel_release_pipe_item_proc/
5838         s/handle_message_proc/channel_handle_parsed_proc/
5839
5840         Adds RedChannel* channel as first parameter to hold_pipe_item_proc
5841
5842         server/red_worker: split cursor_channel_send_item
5843         Split from cursor_channel_push
5844
5845         server/red_worker: use red_channel begin_send_message
5846         s/red_begin_send_message/red_channel_begin_send_message/
5847
5848         server/red_worker: add red_channel_init_send_data
5849         Changes semantics of send to always hold/release regardless of block, like
5850         red_channel. A hold is just a reference count increment or nop.
5851
5852         server/red_worker: split display_channel_send_item
5853         Split it out of display_channel_push.
5854
5855         server/red_worker: extract common_release_pipe_item from red_pipe_clear
5856
5857         server/red_worker: use red_channel pipe add versions
5858         s/red_pipe_add/red_channel_pipe_add/
5859         s/red_pipe_add_after/red_channel_pipe_add_after/
5860
5861         server/red_worker: shorten some lines using alias variables
5862
5863         server/red_worker: introduce CommonChannel
5864         with everything (almost) not in red_channel's RedChannel
5865
5866         As a result of CommonChannel a free cb is added to EventHandler,
5867         to take care of non zero offset for embedded EventHandler.
5868
5869         server/red_worker: use ack_data struct
5870         start of move to red_channel based channels
5871
5872         server/red_worker: change hold_item sig, drop the void*
5873         changed to PipeItem *
5874
5875 2011-02-09  Alon Levy  <alevy@redhat.com>
5876
5877         update required minimal libcacard to 0.1.2
5878
5879         client/smartcard: libcacard dropped ReaderAddResponse
5880         uses VSC_Error with code==VSC_SUCCESS instead. This means that the VSC_Error
5881         message is overloaded. Instead of the other option of adding a message id,
5882         since the connection is TCP so no messages may be dropped or reordered, by
5883         having each message followed by a response there is no ambiguity. Still
5884         this commit adds a queue for messages that we only have one of which outstanding
5885         at a time, i.e. send, wait for response, send the next, etc. This further
5886         simplifies the logic, while not adding much overhead since only when spicec
5887         starts up it has a situation where it needs to send two events (ReaderAdd
5888         and ATR for Card Insert).
5889
5890         server/smartcard: don't push our own error on reader add
5891         The device already sends one. There are actually two connections going
5892         on:
5893          server to client - this is the smartcard channel, it reuses the VSC protocol.
5894          server to device - this is an internal connection using VSC too.
5895
5896         We generally just passthrough all messages from the client to the device,
5897         and from the device to the client. We only rewrite the reader_id because
5898         the device knows about a single id (it is actually a card id), and we
5899         may manage more then one in the future.
5900
5901         Bottom line is that there was an extra VSC_Error message reaching the client.
5902
5903 2011-02-07  Alon Levy  <alevy@redhat.com>
5904
5905         client/smartcard: ignore VSC_Init
5906
5907         server/smartcard: ignore VSC_Init from client
5908
5909         server/smartcard: print instead of assert on bad reader_id in smartcard_char_device_on_message_from_device
5910
5911         server/smartcard: libcacard uses network byte order, so we must too
5912
5913         client/smartcard: s/reader_id_t/uint32_t/ (libcacard changed)
5914
5915         server/smartcard: libcacard removed ReaderAddResponse
5916
5917         server/smartcard: s/reader_id_t/uint32_t/ (libcacard changed)
5918
5919         server/red_channel: style fix in red_channel_init_send_data
5920
5921         server/red_channel: red_channel_pipe_clear: assert on NULL channel
5922
5923         server/red_channel: add TODO
5924
5925         server/red_channel: export red_channel_send
5926
5927         server/red_channel: add red_channel_waiting_for_ack
5928         small inline function to have the ack window logic.
5929
5930         server/red_channel: protect red_channel_push from NULL
5931
5932         server/red_channel: reset pipe_size on clear (from red_worker)
5933
5934         server/red_channel: red_channel_event: push on blocked
5935         try to push either on signal (write available) or when blocked
5936         and read signaled. From red_worker, copied for compatibility when
5937         switching later to RedChannel in red_worker. Doesn't make a lot of
5938         sense (but works), see comment in patch.
5939
5940         server/red_channel: use red_channel_receive
5941
5942         server/red_channel: add empty handle of SPICE_MSGC_DISCONNECTING
5943         Simply ignored in red_channel_handle_message
5944
5945         server/red_channel: add red_channel_receive (for red_worker)
5946
5947         server/red_channel: unstatic red_channel_pipe_clear (for red_worker)
5948
5949         server/red_channel: unstatic red_channel_push (for red_worker)
5950
5951         server/red_channel: two 80 column fixes
5952
5953         server/red_channel: add public red_channel_default_peer_on_error
5954         for later use in red_worker
5955
5956         server/red_channel: add red_channel_pipe_add_after (from red_worker)
5957
5958         server/red_channel: make client ack window configurable
5959         from red_worker
5960
5961         server/red_channel (tunnel): change sig of red_channel_handle_message
5962         for later usage with red_worker
5963
5964         server/red_channel: make MAX_SEND_VEC 100
5965         MAX_SEND_VEC was 100 for DisplayChannel's RedChannel implementation which is being replaced
5966         with RedChannel in red_channel. So changing from 50 to 100 in red_channel
5967         (make this configurble?) - effectively increased memory usage by:
5968         (100-50)*sizeof(iovec)*(num_of_channels-2) ==(arch 64bit) 50*16*6 ~ 5k
5969         Not terrible.
5970
5971         server/red_channel: reflect SpiceDataHeader fields in handle_parsed_proc
5972
5973         server/red_channel: add red_channel_pipe_add_push
5974
5975         server/red_channel: add hold_item (from red_worker)
5976         hold_item called on init_send_data, matching release.
5977         This is not the behavior of red_worker - we ref++ (==hold_item) when
5978         sending the item, and --refs when releasing it, instead of only holding
5979         if the send is blocked.
5980
5981         Note 1: Naming: hold_pipe_item is the proc name, the variable is called
5982         hold_item, this is similar to release_item/release_pipe_item naming.
5983
5984         Note 2: All channels have empty implementation, we later use this when
5985         red_worker get's RedChannelized.
5986
5987         server/red_channel: add out_bytes_counter (unused)
5988
5989         client: log subject-host mismatch, and raise ssl warnings to errors
5990
5991         configure.ac: use AC_LANG_SOURCE in AC_COMPILE_IFELSE, silence remaining warnings
5992
5993         server/red_worker: fix used but uninitialized warning (gcc 4.6.0)
5994
5995 2011-01-27  Uri Lublin  <uril@redhat.com>
5996
5997         spice-client migration: fix minor for old migration support.
5998         For not too old spice-migration, minor is 1.
5999         For older (ancient) spice-migration, minor is 0.
6000
6001         Affects only VM migration while a spice client is connected.
6002
6003 2011-01-27  Alon Levy  <alevy@redhat.com>
6004
6005         client/windows: don't allocate console unless required
6006
6007         client: fix broken vs2008 build
6008
6009         client: --help should not need platform initialization
6010         separate initialization into before command line parsing and after,
6011         call later only if command line parsing succeeds (in particular, it
6012         "fails" if --help is given).
6013
6014 2011-01-25  Alon Levy  <alevy@redhat.com>
6015
6016         demarshaller/marshaller fix gcc 4.6.0
6017         python_modules/demarshal.py and marshal.py fixes for gcc 4.6.0
6018         warning about set but unused variables. The fixes disable creating
6019         of variables mem_size when they are not used (demarshall) and
6020         declaring a src variable when the message doesn't use it (marshal).
6021
6022         You need to touch *.proto after applying this (should add a Makefile
6023         dependency).
6024
6025         codegen: avoid creating out if not used (fix gcc 4.6.0 warning)
6026
6027         client: gcc 4.6.0: two more unused variable fixes
6028
6029         client/cegui: cegui 0.6.0 gcc 4.6.0 related fix
6030         cegui doesn't include stddef required for ptrdiff_t type, we
6031         include it for it.
6032
6033         client/glz_decoder.cpp: gcc 4.6.0 unused fixes
6034
6035         client/display_channel: gcc 4.6.0 unused fixes
6036
6037         common/sw_canvas: remove unused error val
6038         This is the only unused var change I'll want to revisit eventually,
6039         I'm submitting anyway since it doesn't change current behavior. I'm
6040         talking about ignoring the return value from canvas creation. Adding
6041         a print is possible but I didn't test (may be too verbose, also
6042         preferable to be a debug print if so, and we don't have that option
6043         in the code atm - probably an environment variable will do, or adding
6044         some spice_server_set_logging_level api, maybe even
6045         spice_server_set_logging_fd?)
6046
6047         common/canvas_base.c: remove unused variables
6048
6049         client/server: warning fixes (gcc 4.6.0)
6050         gcc 4.6.0 added "[-Werror=unused-but-set-variable]", this and the next
6051         few fixes tend to that. Mostly harmless.
6052
6053         client/server: add missing USE_TUNNEL
6054         disable some code that only makes sense when USE_TUNNEL is defined
6055         in client and server channel security level setting.
6056
6057         client/server: add missing smartchannel channel security handling
6058         The name to channel id mapping for the smartcard channel is missing,
6059         add it in client and server.
6060
6061 2011-01-21  Hans de Goede  <hdegoede@redhat.com>
6062
6063         Update license header for server/red_parse_qxl.c
6064         This one mistakenly had a GPL header rather then an LGPL header.
6065
6066         Drop unnecessary X11 and alsa requires from spice-server.pc
6067
6068 2011-01-19  Hans de Goede  <hdegoede@redhat.com>
6069
6070         server: remove dep on CEGUI
6071
6072 2011-01-16  Alon Levy  <alevy@redhat.com>
6073
6074         server/red_channel: fix segfault on red_channel_destroy if peer already removed
6075
6076         server/inputs_channel: use outgoing marshaller in red_channel/RedChannel
6077
6078 2011-01-15  Alon Levy  <alevy@redhat.com>
6079
6080         tests/migrate.py: add a migration test
6081
6082         server/main_channel: use red_channel (most code is pipe send/marshall separation)
6083
6084         server/red_channel: no need for extra loop
6085
6086 2011-01-13  Alon Levy  <alevy@redhat.com>
6087
6088         server/red_channel: go marshaller for outgoing (copied from red_worker)
6089
6090         server/reds: don't remove agent if it's not connected
6091
6092         server/reds: protect reds_update_mouse_mode when main_channel is disconnected
6093
6094         server/reds: don't call close on NULL channel on atexit callback
6095
6096         server/reds: fix possible segfault when accessing vdagent from reds_update_mouse_mode after vdagent set to NULL
6097
6098         server/reds: s/reds_push_migrate_data_item/reds_marshall_migrate_data_item/
6099
6100         server: split main_channel from reds
6101
6102 2011-01-11  Alon Levy  <alevy@redhat.com>
6103
6104         server: remove dep on libcacard
6105         Only the client needs this, and erronously using SPICE_REQUIRES
6106         results in libcacard dep in spice-server.pc, which is then dragged
6107         into qemu when linking, beeing used instead of the builtin libcacard.
6108
6109 2011-01-10  Alon Levy  <alevy@redhat.com>
6110
6111         server/tests: split test_display_no_ssl to test_display_base, add streaming test
6112
6113         server/tests/test_display_no_ssl: add update_area, COPY_BITS to tested functions, make a queue of QXLCommandExt waiting (cursor still with production at get_command)
6114
6115         server/tests/test_display_no_ssl: add surface create/destroy test (commented out), and square mode (default)
6116
6117         server/tests: fix timer reset to allow setting next call during callback
6118
6119         server/tests/test_display_no_ssl: change color every circle
6120
6121         server/tests/test_display_no_ssl: restart notify timer
6122
6123         server/tests: basic_event_loop: reset timer after firing it
6124
6125         server/tests/test_display_no_ssl: disable cursor test until it works correctly
6126
6127         server/test/test_display_no_ssl: add beginning of basic cursor item test. doesn't actually show anything on client. also, leaks.
6128
6129         server/tests/test_display_no_ssl: make window 320x320, two colored updates, one in notify batch
6130
6131 2011-01-07  Alon Levy  <alevy@redhat.com>
6132
6133         server/red_worker: use 1, not 4 when lz_encoding a top down image
6134
6135 2011-01-06  Alon Levy  <alevy@redhat.com>
6136
6137         client/cmd_line_parser: fix wrong reporting of bad argument in --bla=val case
6138         We use get_opt_long, which allows non ambiguous abbreviations, but
6139         since we didn't like that we have code that checks for abbreviations and
6140         issues an error. But that code only handled separate argument and key like:
6141         --bla value
6142         and didn't handle them in the same arguemnts, like:
6143         --bla=value
6144         This patch fixes that, and gives a slightly better error report (it still
6145         contains the =value part though)
6146
6147 2011-01-05  Alon Levy  <alevy@redhat.com>
6148
6149         common, canvas_get_jpeg_alpha: let top_down be any value
6150         Allow top_down flag to have any value, only ASSERT it is positive
6151         when needs to be positive and zero otherwise. Allows older server
6152         bug of sending 4 instead of 1 in top down flag to not affect newer
6153         clients (previous patch fixes server).
6154
6155         client: CEGUI: search for CEGUI-0.6 to work in F15 (rawhide)
6156
6157 2011-01-05  Thomas Tyminski  <thomast@cs.tu-berlin.de>
6158
6159         Fixes compilation error of Spice Client (Linux/X11) with OpenGL enabled modified: client/x11/red_window.cpp
6160
6161 2010-12-30  Alon Levy  <alevy@redhat.com>
6162
6163         mingw32: refix to build on mingw..
6164
6165 2010-12-30  Marc-André Lureau  <marcandre.lureau@redhat.com>
6166
6167         client inputs: stop blinking keyboard when out of focus
6168         We could introduce another boolean to prevent changes, or just reuse
6169         _active_modifiers_event = true to prevent further update.
6170
6171         Additionaly this patch restore the keyboard state when focusing out,
6172         which is fine when dealing with full remote desktop, but should be
6173         reconsidered if/when SPICE supports remote windows managed by client
6174         window manager for instance, imho.
6175
6176 2010-12-30  Tiziano Mueller  <dev-zero@gentoo.org>
6177
6178         jpeg_boolean is a mingw32-libjpeg specific thing. Use a define check rather than a version check.
6179
6180 2010-12-17  Hans de Goede  <hdegoede@redhat.com>
6181
6182         server: Update SPICE_SERVER_VERSION
6183
6184         Makefiles: fix server/tests/test_util.h not being included in make dist
6185
6186         server: Update SPICE_SERVER_VERSION
6187
6188 2010-12-16  Hans de Goede  <hdegoede@redhat.com>
6189
6190         spicec: Remove spice-client watermark (rhbz#662450)
6191         This patch stops us from drawing the spice client watermark at the top of
6192         the virtual machine view. We have had requests through several channels to
6193         remove this as it has little added value, and is seen as annoying by some.
6194         Given that we now also have a bugzilla for this I think it is time we really
6195         remove it.
6196
6197         spicec-x11: Let the window manager place our window the 1st time (rhbz#662407)
6198         The problem is that RedWindow::show calls the XLib MoveWindow function
6199         on the window after it has been mapped, moving it to the location in
6200         _show_pos. This is seen by the window manager as the application saying
6201         I know exactly where I want my window to be placed, don't do placing for
6202         me. Which causes the client window to always be shown at pos 0x0, even
6203         though that may not be the best location.
6204
6205         What this patch does is:
6206         1) It makes RedWindow::show not call MoveWindow when a window is
6207            first created normally and then shown
6208         2) It makes RedWindow::show still call MoveWindow when:
6209            -when the window has been shown before, and was hidden for some
6210             reason (controller interface), and is now being re-shown
6211             so that it ends up being re-shown at its old position
6212            -when the window is a fullscreen window (screen.cpp always
6213             calls move on the window before showing it to set its position)
6214            -when the user switch from windowed mode -> fullscreen ->
6215             windowed mode again, to make sure that the windowed mode window
6216             is shown in the same position as before switching to fullscreen
6217             mode
6218
6219         spicec-x11: Add a class hint to our window managet hints
6220         This helps people who want to tell their windowmanager to do something special
6221         with spicec, like make it sticky, or whatever, see:
6222         https://bugzilla.redhat.com/show_bug.cgi?id=662452#c4
6223
6224         spicec: Add a --title cmdline option (rhbz#662452)
6225
6226 2010-12-16  Gerd Hoffmann  <kraxel@redhat.com>
6227
6228         move chardevs out of experimental
6229         While we are at it:  There is no reason for chardev
6230         support to stay in the experimental area, so move it out.
6231         qemu should not need the "spice-experimental.h" file.
6232
6233         move switch-host migration out of experimental
6234         seamless stays in the experimental area.
6235         comments updates too.
6236
6237         client migration: switch host
6238         Implement server-side support for switch-host client migration.  Client
6239         side support is present already in the tree.
6240
6241         Setting the migration information is done using the existing
6242         spice_server_migrate_info() function.  A new
6243         spice_server_migrate_switch() function has been added which triggers
6244         sending out the switch-host message.
6245
6246         Seamless migration functions are left there for now.
6247         spice_server_migrate_start() has been chamnged to just fail
6248         unconditionally though as seamless migration is broken anyway.
6249
6250 2010-12-15  Alon Levy  <alevy@redhat.com>
6251
6252         server/red_worker: fix worker->drawable_count
6253         drawable_count was becoming negative. It tracks the number of
6254         items in the worker->current_list ring. It was decremented correctly,
6255         but incremented only in several cases. The cases it wasn't incremented
6256         where:
6257          red_current_add_equal found an equivalent drawable
6258         by moving the increment to where the item is added to current_list, in
6259         __current_add_drawable, the accounting remains correct.
6260
6261         This has no affect other then correct accounting, as drawable_count isn't
6262         used for anything.
6263
6264 2010-12-11  Alon Levy  <alevy@redhat.com>
6265
6266         client/smartcard: external cac card library name and version changed
6267
6268 2010-12-09  Gerd Hoffmann  <kraxel@redhat.com>
6269
6270         server: improve error handling
6271         We should pass up errors instead of aborting.  Do that at least
6272         for bind() failures which actually happen in real live due to the
6273         tcp port being busy.
6274
6275 2010-12-08  Alon Levy  <alevy@redhat.com>
6276
6277         server/tests: fix for AM_LDFLAGS introduction
6278
6279 2010-12-08  Gerd Hoffmann  <kraxel@redhat.com>
6280
6281         mingw32 build: disable -fvisibility test for unsupported mingw32 target
6282
6283         v2: only disable for os_win32 (Hans)
6284
6285 2010-12-08  Alon Levy  <alevy@redhat.com>
6286
6287         mingw32 build: check for CXImage, disable if not found (only on mingw32)
6288         v2:
6289          + simplify (Hans)
6290          + also report presence of cximage for mingw32 target
6291
6292         mingw32 build: use PRIu64 instead of ll
6293
6294         mingw32 build: python_modules/marshal: use unsigned for for_loop index variable
6295
6296         mingw32 build: various fixes
6297
6298         mingw32 build: fix two functions
6299
6300         mingw32 build: add missing switch flags (nop)
6301
6302         mingw32 build: eol fixes
6303
6304         mingw32 build: windows/Makefile.am: double NULL definition
6305
6306         mingw32 build: missing linked files for spicec.exe
6307
6308         mingw32 build: remove unused, initialize uninitialized, reorder constructor initializers
6309
6310         mingw32 build: fix assignement as condition warning
6311
6312         mingw32 build: fixed using -1 as uninitialized value for unsigned variables
6313
6314         mingw32 build: fix signed/unsigned warnings as errors
6315
6316         mingw32 build: fix configure.ac typo
6317
6318         mingw32 build: fix various warnings
6319
6320 2010-12-08  Gerd Hoffmann  <kraxel@redhat.com>
6321
6322         mingw32 build: fix build errors
6323
6324         mingw32 build: disable ms compiler pragmas for gcc
6325
6326 2010-12-07  Gerd Hoffmann  <kraxel@redhat.com>
6327
6328         mingw32 build: add client/windows/Makefile, tweak configure
6329
6330         build: s/HUGE/INFINITY/
6331
6332         build: use jpeg_boolean with more recent libjpeg versions.
6333
6334         build: only check for x11 extensions when building for x11 platform.
6335
6336         build: alsa is needed on linux only.
6337
6338 2010-12-07  Alon Levy  <alevy@redhat.com>
6339
6340         server/tests: Makefile.am: use AM_LDFLAGS instead of LDFLAGS
6341
6342         server/inputs: return NULL on alloc_buf request for too large message
6343
6344         server/red_channel: error channel if alloc_msg_buf fails (returns NULL)
6345
6346         server/inputs_channel: better protection from channel disconnection on keyboard modifiers callback
6347
6348         server/red_channel: add red_channel_is_connected
6349
6350         server/inputs_channel: remove unused declaration in inputs_channel.h
6351
6352         server/inputs_channel: s/inputs_channel/g_inputs_channel/
6353
6354         server/inputs_channel: initialize inputs_channel to NULL
6355
6356         server: reds/inputs_channel: move some structs to inputs_channel
6357
6358         server: inputs_channel: use red_channel
6359
6360         server: red_channel: add optional parser and separate incoming/outgoing error handlers for later inputs/main channel usage
6361
6362         server: inputs_channel: s/inputs_state/inputs_channel/
6363
6364         server: introduce inputs_channel, split from reds.c
6365
6366         server/reds: fix typo
6367
6368 2010-12-07  Arnon Gilboa  <agilboa@redhat.com>
6369
6370         spicec: do not call connect_secure when connect_unsecure fails due to protocol version mismatch (v2)
6371         If connect_unsecure failed due to protocol version mismatch, don't try to
6372         connect_secure with the same version, but retry (connect_secure or
6373         connect_unsecure) with older version. catch (...) is handled by caller
6374         at RedChannel::run().
6375
6376         This solves the following bug: when "new" Spice client (protocol version 2)
6377         with given secure_port connects to "old" server which is not using the same
6378         secure_port (or not using a secure_port at all), the client exits immediately.
6379
6380         In this scenario, the client first tries to use Spice protocol version 2 to
6381         connect the unsecure port, and altough this fails due to version mismatch, it
6382         tries to connect to the secure port with the same protocol version 2, which is
6383         a wrong behavior, fails due to socket error 10061 (WSAECONNREFUSED -
6384         Connection refused) and handled mistakenly by immediate exit, instead of
6385         retrying with protocol version 1.
6386
6387 2010-12-07  Alon Levy  <alevy@redhat.com>
6388
6389         client/smartcard: add files to Makefile.am for make dist
6390
6391         smartcard: configure option --enable-smartcard
6392
6393         smartcard: server side (not enabled yet)
6394
6395         smartcard: client: add keyboard shortcuts for remove/insert virtual card
6396
6397         smartcard: client side (not enabled yet)
6398
6399         smartcard: add to spice.proto
6400
6401         server: add spice_server_char_device_remove_interface
6402
6403 2010-12-06  Alon Levy  <alevy@redhat.com>
6404
6405         server: print subtype when adding CHAR_DEVICE interfaces
6406
6407         server: add static to spice_server_char_device_add_interface
6408
6409         spice codegen: fix copy-o, no such variable value
6410
6411         server: fix print text on vdagent interface addition
6412
6413         server: add char_device.h header, use in reds.c
6414
6415         spice-experimental.h: add multiple include protection
6416
6417         server/vdi_port (virtserial): always read data
6418         We erronously ignored data from guest on the serial channel if no client is
6419         connected. This leads to an assert when the guest writes a second time, since
6420         there is still data unconsumed by us (the host).
6421         Fix by reading data anyway, and discarding it after parsing (and reading) whole
6422         messages from the guest.
6423         Net affect is that any messages the agent sends while no client is connected
6424         get discarded, but only full messages are discarded.
6425         This fixes an abort if booting a winxp guest with vdagent without a connected
6426         client.
6427
6428 2010-12-02  Alon Levy  <alevy@redhat.com>
6429
6430         server: add char_device.h to Makefile.am for make dist
6431
6432 2010-11-30  Alon Levy  <alevy@redhat.com>
6433
6434         server/tests: add test_display_no_ssl
6435         updates taken from spice vga mode updates, i.e. non cacheable, glz compressed
6436         (depends on whatever settings you apply to the server) opaque draw operations.
6437          + completed the SpiceCoreInterface implementation (timers)
6438
6439         v1->v2:
6440          removed test_util.c (Hans)
6441          replaced mallocz with calloc (Hans)
6442
6443         server/tests: Makefile.am fixes
6444          * don't install tests on make install
6445          * don't forget anything for make dist tarball
6446
6447         add .gitignore for tests
6448
6449 2010-11-25  Hans de Goede  <hdegoede@redhat.com>
6450
6451         spicec: Don't show a white screen if guest resolution does not fit fullscreen
6452         Currently when going / starting fullscreen if the guest resolution for one of
6453         the monitors is higher then that monitor on the client can handle, we show a
6454         white screen. Leaving the user stuck (unless they know the fullscreen key
6455         switch combi) with a white screen when starting the client fullscreen from
6456         the XPI.
6457
6458         This patch changes the client to fall back to windowed mode in this case
6459         instead.
6460
6461 2010-11-24  Arnon Gilboa  <agilboa@redhat.com>
6462
6463         spicec: fix ASSERT to accept size == 0
6464         which is useful when calling RedClient::on_clipboard_notify(VD_AGENT_CLIPBOARD_NONE, NULL, 0);
6465
6466         spicec-win: add image copy-paste support
6467         -currently png & bmp
6468         -using wspice libs cximage.lib & png.lib
6469         -jpg & tiff will follow
6470
6471 2010-11-23  Hans de Goede  <hdegoede@redhat.com>
6472
6473         spicec-x11: Fix unhandled exception: no window proc crash (rhbz#655836)
6474         When XIM + ibus is in use XIM creates an invisible window for its own
6475         purposes, we sometimes get a _GTK_LOAD_ICONTHEMES ClientMessage event on
6476         this window. Since this window was not explicitly created by spicec, it
6477         does not have a Window Context (with the event handling function for the
6478         window in question) set. This would cause spicec to throw an unhandled
6479         exception and exit.
6480
6481         This patch replaces the exception throwing with silently ignoring
6482         ClientMessage events on Windows without a Context and logging a warning
6483         for other event types.
6484
6485 2010-11-22  Hans de Goede  <hdegoede@redhat.com>
6486
6487         spicec-x11: Fix modifier keys getting stuck (rhbz#655048)
6488         Currently modifier keys (ctrl, alt) can get stuck when using the x11 client.
6489         To reproduce under gnome:
6490         -focus the client window without causing it to grab the keyborad (click on
6491          the title bar not the window)
6492         -press crlt + alt + right arrow to switch virtual desktop
6493         -press crlt + alt + left arrow to switch back
6494         -notice ctrl + alt are stuck pressed
6495
6496         What is happening here is:
6497         -We get a focus out event, caused by the hotkey combi key grab, focus event
6498          notify mode == NotifyGrab, and release all keys -> good
6499         -We get another focus out event, as we really loose the focus.
6500          notify mode == NotifyWhileGrabbed, which we ignore as we already lost
6501          focus before
6502         -We get a focus in event, as the focus is returning to us, but we don't
6503          really have the focus yet, as the hotkey combi key grab is still active
6504          (ie ctrl + alt are still pressed).
6505          We now sync the vm's modifier key state with the current X-server state,
6506          telling the vm ctrl + alt are pressed. Note we do this by directly reading
6507          the X-server keyboard status, we are not getting any key press events from the
6508          X-server -> bad
6509         -We get another focus in event, as we really get the focus back,
6510          notify mode == NotifyUngrab. We ignore this one as already have gained the
6511          focus before. If we were to sync the vm modifier state here, all would be
6512          well we would no longer see the modifier keys pressed, or if we would we
6513          would get a release event when they get released (testing has shown both).
6514
6515         The solution here is to ignore the first focus in event, and do the modifier
6516         sync on the second focus in event, or more in general to ignore focus events
6517         where notify mode == NotifyWhileGrabbed.
6518
6519 2010-11-17  Hans de Goede  <hdegoede@redhat.com>
6520
6521         spicec-x11: Add a few missing XLockDisplay calls (rhbz#654265)
6522         The XIM functions end up waiting for a reply from the server, so they
6523         need locking around them. Idem for the XLookupString call.
6524
6525 2010-11-09  Hans de Goede  <hdegoede@redhat.com>
6526
6527         spicec: Don't show gui when connection info is specified on the cmdline
6528         Currently when compiled with the gui enabled if you specify a host to connect
6529         to on the cmdline the gui flashes by (show_gui gets called, then the connect
6530         handler calls hide_gui as soon as the connection is made).
6531
6532         This patch removes this ugly flashing by of the gui.
6533
6534         spicec: Remove empty show / hide gui functions
6535         When compiling without gui support just don't call show / hide
6536         gui, rather then making them stubs, this makes it easier to follow what is
6537         going on.
6538
6539         spicec: Fix info layer sometimes not showing
6540         Currently we are calling show_info_layer from hide_gui in application.cpp, but
6541         there are 2 cases where this does not happen:
6542
6543         1) When compiled without gui support hide_gui is a complete nop, so we never
6544            show the info layer when compiled without gui support
6545         2) When run with --controller we never show the gui, and hide_gui
6546            checks if there is a gui to hide as the first thing and if not returns
6547            resulting in show_info_layer not being called, and thus the info layer
6548            not showing when launched from the xpi
6549
6550         This patch fixes both by adding a call to show_info_layer from
6551         on_visibility_start note that on_visibility_start also calls hide_gui,
6552         so in some cases show_info_layer may be called twice, this is not a
6553         problem as show_info_layer is protected against this.
6554
6555 2010-11-08  Alon Levy  <alevy@redhat.com>
6556
6557         server/reds: zap unsetting of QEMU_AUDIO_DRV
6558
6559         gitignore: add generated_*, vim temps, pyc
6560
6561         reds: remove needless buffer in InputsState
6562
6563         server: tests: add basic tests with working do nothing server
6564
6565 2010-11-08  Arnon Gilboa  <agilboa@redhat.com>
6566
6567         spicec-win: ignore MSVCRT.lib in x86 build
6568         Same as in x64 build, for using the updated wspice-0.6.3
6569
6570 2010-11-05  Hans de Goede  <hdegoede@redhat.com>
6571
6572         spicec: Make cegui log to <app_data_dir>/cegui.log
6573         This stops the client from dropping CEGUI.log files into the cwd all
6574         the time, and stops it from crashing when the cwd is not writable
6575         (rhbz#650253).
6576
6577 2010-10-28  Hans de Goede  <hdegoede@redhat.com>
6578
6579         spicec-x11: Listen for selection owner window destroy / close events too
6580         These rarely happen as most apps have the decency to do a SetSelectionOwner
6581         None before exiting. But some do not, so listen for these too.
6582
6583 2010-10-25  Alon Levy  <alevy@redhat.com>
6584
6585         client: add verbose link error messages
6586
6587 2010-10-25  Arnon Gilboa  <agilboa@redhat.com>
6588
6589         spicec-tests: add controller_test (v2)
6590         use chars for title & menu instead of wchars
6591
6592         spicec-win: remove redundent strdup & buggy free
6593         text refered a substr of item_dup and was used after free(item_dup).
6594         no need to strdup, we can destroy the resource string.
6595
6596 2010-10-25  Hans de Goede  <hdegoede@redhat.com>
6597
6598         controller: Make menu text utf-8
6599         We are making all text send over the controller socket utf-8, rather then
6600         having somethings as 8 bit (hostname) and others (title, menu) unicode16,
6601         this patch completes this change by converting the menu handling.
6602
6603         spicec-x11: Do not set _NET_WM_USER_TIME to 0 on startup
6604         Setting _NET_WM_USER_TIME to 0 means we do not want focus, not good.
6605
6606 2010-10-25  Arnon Gilboa  <agilboa@redhat.com>
6607
6608         spicec-win: add x64 to vcproj & sln (v2)
6609         use CEGUI for x64 as well, no need for the SUPPORT_GUI hack
6610
6611         spicec-win: map title string from utf8 to utf16
6612         Fix win client broken by the utf8 patch.
6613
6614 2010-10-24  Arnon Gilboa  <agilboa@redhat.com>
6615
6616         spicec-win: add #ifndef _WIN64 for u/intptr_t typedefs
6617
6618         spicec-win: Replace Set/GetWindowLong to LongPtr for x64 competability
6619
6620 2010-10-21  Hans de Goede  <hdegoede@redhat.com>
6621
6622         Remove no longer used wstring_printf functions
6623
6624         client: Interpret the title control message as utf8 instead of unicode16
6625         The activex browser plugin is sending unicode16 text, where as the
6626         xpi one is sending utf8 text. After discussing this on irc we've decided
6627         that utf8 is what we want to use. So the client (this patch), and the
6628         activex will be changed to expect resp. send utf8 text as the title.
6629
6630         spicec-x11: Change source of controller socket name, fixing CVE-2010-2792
6631         The socket name used to communicate between the xpi browser plugin and the
6632         spicec was predictable allowing a non priviliged user on the same system
6633         to create the socket before spicec does and thus intercept the messages from
6634         the xpi to the client, including login credentials. This security vulnerability
6635         has been registred with mitre as CVE-2010-2792:
6636         http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2010-2792
6637
6638         This patch changes the controller code to instead read the socket name
6639         from an environment variable which gets set by the xpi before executing
6640         the spicec, making the socketname private between the client and the xpi.
6641
6642         Note that this means that the controller will only work with an xpi which
6643         has matching changes, the changes are present in the latest version of the
6644         xpi as available as update for / with RHEL-5.5 and RHEL-6.0 .
6645
6646 2010-10-18  Hans de Goede  <hdegoede@redhat.com>
6647
6648         Release 0.6.3
6649
6650         Make the gui use Application::hide_gui rather then hide_me
6651         Now that Application::hide_me actually does what the name suggests
6652         (hide the entire client, ie all client windows), the gui using it to
6653         not show the gui layer leads to the entire client disappearing when
6654         one presses close in the GUI or dismisses a GUI dialog. This patch makes
6655         the GUI code call hide_gui instead of hide_me, fixing this.
6656
6657         Bump version to 0.6.2
6658
6659         Update NEWS for 0.6.2 release
6660
6661         spicec-x11: Fix window management under KDE
6662         There were 2 issues with window management under KDE
6663         1) When an app does its own focus management like we do, kwin expects
6664            an explicit raise for the app to get to the top, so we did have focus,
6665            but would have other windows (partially) covering the client window
6666            -> do a raise after setting focus to ourselves
6667         2) When switching from fullscreen <-> window, we unmap and remap our
6668            window, then set focus to ourselves. kwin thinks this means we're trying
6669            to steal the focus without the user asking for it. This patch makes us
6670            set the _NET_WM_USER_TIME property on our window, this helps kwin's
6671            focus stealing code to see that we are really not stealing the focus,
6672            just responding to a user event.
6673
6674         client: change monitor mode setting <-> fullscreen window mode setting order
6675         1) Make the order when starting up in fullscreen mode the same as when
6676            switching from window -> fullscreen:
6677            First set the mode, then make the window fullscreen
6678         2) Change the order when leaving fullscreen mode, first restore the original
6679            monitor mode, then make the window non fullscreen. Changing the monitor
6680            mode in X11 causes the window manager to re-arrange windows, and if this
6681            happens while compiz is busy mapping the window it gets confused and
6682            maps the window with a maxmimized size.
6683
6684         spicec-x11: Change WmSizeHints in fullscreen mode
6685         Some window managers will ignore the fullscreen hint, unless WmSizeHints
6686         allow them to resize the window so that they can give it the size of
6687         the roo-window. This fixes fullscreen mode in compiz.
6688
6689         spicec-x11: Add missing XLockDisplay around XRRSet* calls
6690         XRRSet* calls wait for a XReply, so add a missing XLockDisplay,
6691         this fixes a hang (due to a race so not always) when switching between
6692         windowed and fullscreen mode.
6693
6694         client: Do not try to send display_config until we've received the agent caps
6695         Currenty, we check the agent caps in RedClient::handle_agent_connected
6696         for VD_AGENT_CAP_DISPLAY_CONFIG and if present send display_config, but at
6697         this time we have not received the caps yet, so remove this.
6698
6699         Also the send_agent_display_config call in on_agent_announce_capabilities
6700         lacks a check for _agent_disp_config_sent, and we send the display config
6701         before announcing that we may do so by sending our own caps, which seems
6702         inpolite.
6703
6704 2010-10-18  Arnon Gilboa  <agilboa@redhat.com>
6705
6706         spicec: add controller
6707         Spice client controller enables external control (e.g., by XPI or ActiveX) of
6708         the client functionality.
6709
6710         The controller protocol enables setting parameters (host, port, sport, pwd,
6711         secure channels, disabled channels, title, menus, hotkeys etc.), connecting
6712         the server, showing and hiding the client etc.
6713
6714         The controller is based on the cross-platform named pipe.
6715
6716         spicec: add foreign menu
6717         Spice foreign menu enables external control of the client menu.
6718
6719         The foreignmenu protocol enables an external application to:
6720         add a submenu, set its title, clear it, add/modify/remove an item etc.
6721
6722         Foreign menu is based on the cross-platform named pipe.
6723
6724 2010-10-17  Arnon Gilboa  <agilboa@redhat.com>
6725
6726         spicec-win: move named_pipe defines
6727
6728         spicec-win: fix menu id push to free_sys_menu_id
6729
6730         spicec: enable multiple CmdLineParser instantiations
6731         Used by controller. One instance at a time, not thread-safe.
6732         Add basename() for win32.
6733
6734         spicec: name host param
6735
6736         spicec: add ProcessLoop::on_start_running()
6737
6738         spicec: extract RedScreen::update_menu()
6739
6740         spicec: add menu id & find_sub()
6741
6742 2010-10-16  Hans de Goede  <hdegoede@redhat.com>
6743
6744         server: remove useless agent send_tokens
6745         We are keeping track of tokens for sending agent data to the client, but
6746         the client send an initial value of ~0, and never gives us new send tokens
6747         so this is all rather useless -> remove it.
6748
6749         Note that it is kept in the migration data struct for compatibility reasons.
6750
6751 2010-10-15  Hans de Goede  <hdegoede@redhat.com>
6752
6753         Call read_from_vdi_port() from vdi_read_buf_release()
6754         read_from_vdi_port(), called from vdagent_char_device_wakeup() may
6755         fail to consume all data because no buffers are available in the
6756         read_bufs ring. When this happens we would fail to ever read more data
6757         from the agent on the guest as the port is throttled and stays throttled
6758         until we've consumed all data from the current buffer.
6759
6760         This patch re-enables the call to read_from_vdi_port() from
6761         vdi_read_buf_release(), so that we will try the read again when space
6762         becomes available in the read_bufs ring.
6763
6764         Together with another nasty hack in the linux guest virtio_console
6765         driver, where it waits for a write to be acked by the host before
6766         continuing with the next one, this can lead to a linux guest
6767         getting stuck / hang (until the write is read by the spice-server
6768         which never happens becaus of the above issues).
6769
6770         Note that even with this patch, the guest will still gets stuck due to
6771         a bug in watch_update_mask in spice-core in qemu, which causes writing
6772         to the client to never resume once it blocked. A patch for this has been
6773         submitted to qemu.
6774
6775         server: always call read_from_vdi_port() in a while loop
6776         read_from_vdi_port() MUST always be called in a while loop until it returns 0.
6777
6778         This is needed because it can cause new data available events and its
6779         recursion protection causes those to get lost. Calling it until it returns 0
6780         ensures that all data has been consumed.
6781
6782         Example scenario where we can fail to read the available data otherwise:
6783         - server/reds.c: vdagent_char_device_wakeup get called
6784           by hw/spice-vmc.c because data has arrived from the guest,
6785         - hw/spice-vmc.c: vmc_read get calls
6786         - If the vmc_read call depletes the current buffer it calls
6787           virtio_serial_throttle_port(&svc->port, false)
6788         - This causes vmc_have_data to get called, which if in the
6789           mean time another buffer has arrived causes
6790           vdagent_char_device_wakeup to gets called again
6791           (so recursively)
6792         - vdagent_char_device_wakeup is protected against recursive
6793           calling and ignores the second call (a nasty hack)
6794         - if no other data arrives, the arrived data will not get read
6795
6796         Don't crash when a client disconnects while there were pending writes
6797
6798         spicec-x11: add support for image copy and paste
6799
6800 2010-10-12  Alexander Larsson  <alexl@redhat.com>
6801
6802         Replace epoll with select in X client
6803         The use of epoll in the client is totally overkill in terms of
6804         scalability, and its a problem for portability. The OSX port converts
6805         this to use select, but keeps some of the old complexities in the code.
6806         This new patch makes it simpler and look much more like the windows
6807         code.
6808
6809 2010-10-12  Gerd Hoffmann  <kraxel@redhat.com>
6810
6811         server: add channel notifications.
6812         This patch adds a channel event callback to the spice core interface.
6813         This new callback will be called for three events:
6814
6815           (1) A new connection has been established.
6816           (2) The channel is ready (i.e. authentication is done,
6817               link message verification passed all tests, channel
6818               is ready to use).
6819           (3) Channel was disconnected.
6820
6821         Qemu will use this to send notifications to the management app.
6822
6823 2010-10-11  Hans de Goede  <hdegoede@redhat.com>
6824
6825         spicec-x11: Put locks around xlib calls which wait for a reply
6826         Since libX11-1.3.4 the multi-threading handling code of libX11 has been
6827         changed, see:
6828         http://cgit.freedesktop.org/xorg/lib/libX11/commit/?id=933aee1d5c53b0cc7d608011a29188b594c8d70b
6829
6830         This causes several issues. One of them is the display inside the
6831         client not getting updated when there are no XEvents being generated,
6832         this is caused by the following part of the referenced commit message:
6833
6834         Caveats:
6835         - If one thread is waiting for events and another thread tries to read a reply,
6836           both will hang until an event arrives. Previously, if this happened it might
6837           work sometimes, but otherwise would trigger either an assertion failure or
6838           a permanent hang.
6839
6840         We were depending on the otherwise behavior and apparently were lucky.
6841         This can be seen by starting F14 in runlevel 3 and then doing startx
6842         and not touching the mouse / keyb afterwards. Once you move the mouse
6843         (generate an event you see the UI contents being updated but not before.
6844
6845         Another thing both I and Alon (iirc) have seen are hangs where 2
6846         threads are stuck in XSync waiting for a reply simultaneously. This might
6847         be related to libxcb version, according to the libX11 commit a libxcb
6848         newer then 1.6 was needed, and my system had 1.5 at the time I saw this
6849         after updating to libxcb 1.7 I can no longer reproduce.
6850
6851         This patch tackles both problems (and is needed for the 1st one
6852         indepently of the 2nd one possibly being fixed) by adding XLockDisplay
6853         calls around all libX11 calls which wait for a reply or an event.
6854
6855 2010-10-11  Arnon Gilboa  <agilboa@redhat.com>
6856
6857         spice-win: handle multiple types on clipboard grab send & receive
6858
6859         spice-win: remove clipboard_changer hack
6860         Instead of keeping a flag, we simply check wether the new owner is us or not
6861
6862         spice-win: handle type VD_AGENT_CLIPBOARD_NONE in Platform::on_clipboard_notify()
6863
6864         spice-win: remove windows-specific bitmap cut & paste support
6865         will wait until png comes in
6866
6867 2010-10-09  Hans de Goede  <hdegoede@redhat.com>
6868
6869         spicec: Do not try to do accounting of pci memory
6870         Without this patch spicec reproducely hangs in
6871         GlzDecoderWindow::pre_decode_update_window().
6872
6873         When GlzDecoderWindow::will_overflow() returns true,
6874         GlzDecoderWindow::pre_decode_update_window(),
6875         waits for a call to GlzDecoderWindow::post_decode()
6876         to free up some memory
6877
6878         This happens even though there still is pci memory
6879         available (otherwise the driver would not have
6880         been able to send an image to decode in the first
6881         place).
6882
6883         The GlzDecoderWindow::post_decode() call never happens
6884         as the server is waiting for a reply to the decode
6885         of the hanging image, causing the client to hang
6886         for ever.
6887
6888         This patch fixes this by simply removing the
6889         "attempted" pci memory accounting. As there is no
6890         need for that, as the driver already must keep
6891         track of pci memory usage.
6892
6893         I've verified that both the old and new Xorg drivers
6894         take care of not overusing the pci memory themselves
6895         I would expect the same to be true for the windows
6896         driver.
6897
6898         Note the calculating of the glz_window_size in
6899         red_client.cpp cannot be removed as the calculated
6900         value is send as part of the SpiceMsgcDisplayInit on
6901         connect.
6902
6903 2010-10-06  Hans de Goede  <hdegoede@redhat.com>
6904
6905         spicec: only send display-config if the agent can handle it
6906
6907         spicec-x11: Drop annoying useless warning
6908         Every time an events comes past where the Window is None (which happens
6909         about once every 5 minutes or so), this annoying "invalid window" message
6910         gets printed. Remove it!
6911
6912         spicec: don't send agent messages directly from ClipboardListener callbacks
6913         ClipboardListener callbacks can run from another thread then the
6914         main channel loop thread, where agent messages are normally dispatched from.
6915
6916         So they may not send agent messages directly, instead they should post
6917         events to the main channel loop.
6918
6919         spicec-x11: Remove a race window in selection ownership release code
6920         Well almost remove it, it was possible that another x11 app would acquire
6921         selection ownership, and we would receive a release message from the
6922         agent before having processed the xselection ownership change event.
6923
6924         Then we would set the selection owner to none, overriding the new owner.
6925         As the comment in the patch indicates there still is a minute window left
6926         where something similar can happen after this patch. Nothing we can do
6927         about that (I blame the libX11 selection API).
6928
6929         spicec: Move setting of clipboard_owner to guest to platform code
6930         Atleast under x11 there is a race condition when setting the clipboard
6931         owner to guest from the RedClient code rather then doing it in Platform.
6932
6933         After the XSetSelectionOwner() in Platform::on_clipboard_grab(), which runs
6934         from the main message loop thread, the x11 event thread can receive a
6935         SelectionRequest event from another x11 app, before the RedClient code
6936         has set the clipboard owner, which will trigger the owner != guest
6937         check in the SelectionRequest event handling code.
6938
6939         By moving the setting of the owner in to Platform::on_clipboard_grab() it
6940         gets protected by the clipboard lock, which closes this tiny race.
6941
6942 2010-10-04  Hans de Goede  <hdegoede@redhat.com>
6943
6944         spicec-x11: make get_clipboard_type handle the None Atom
6945
6946         spicec-x11: protect against recursive incr properties
6947
6948         spicec-x11: If the clipboard was large return the memory to the system
6949
6950         spicec-x11: use malloc / free / realloc for clipboard data
6951         As we need a realloc function it is better to use malloc / free /
6952         realloc then to diy, esp. as realloc can grow the buffer without
6953         needing a memcpy.
6954
6955         spicec-x11: Use a queue for XSelectionRequest events
6956         XSelectionRequest events must be answered in the order they were
6957         received. But for TARGETS request we can answer directly, where as
6958         other requests need to go through the agent. This causes us to handle
6959         things out of order, and this can cause us to have more then one
6960         requets outstanding with the agent, which is also not what we want.
6961
6962         So this patch introduces a queue for XSelectionRequest events, causing
6963         us to handle them 1 at a time and always in order.
6964
6965         spicec-x11: handle multiple types per grab
6966         And also handle many x11 targets (ie utf8 variants) to a single agent
6967         type mapping.
6968
6969         spicec-x11: Add XFlush calls were needed
6970         Since we do not always "pump" libX11's event loop by calling
6971         XPending (we only call XPending when there is data to read from the
6972         display fd), we must always explictly flush any outstanding requests.
6973
6974         This patch adds a whole bunch of missing XFlush calls.
6975
6976         spicec-x11: Force processing of ownerchange event when releasing the cb
6977         Make sure we process the XFixesSetSelectionOwnerNotify event caused by
6978         us setting the clipboard owner to none, directly after setting the owner
6979         to none. Otherwise we may end up changing the clipboard owner to none, after
6980         it has already been re-owned because the XFixesSetSelectionOwnerNotify event
6981         to owner none is event is still pending when we set the new owner, and
6982         then changes the owner back to none once processed messing up our clipboard
6983         ownership state tracking.
6984
6985         I saw this happening when doing copy twice in succession inside the guest.
6986
6987         spicec-x11: Request targets from new clipboard owner
6988         Request targets from new clipboard owner, rather then assuming UTF-8
6989         (not entirely complete yet, the last pieces will be in another patch).
6990
6991         Atleast as important this code unifies the selection getting code
6992         for incr and non incr getting of selection data so that it can be
6993         used for both getting regular selection data and for getting targets
6994         selection data.
6995
6996         This also fixes a big bug in the (I believe untested sofar) incr support
6997         code which was interpreting the contents of PropertyNotify events as
6998         XSelectionEvents rather then as XpropertyEvents which are completely
6999         differen structs!
7000
7001 2010-10-03  Hans de Goede  <hdegoede@redhat.com>
7002
7003         spicec-x11: remove clipboard_changer hack
7004         Instead of keeping a flag, we can and should simply check wether the
7005         new owner reported in the event it us or not. Also check for the
7006         new owner being none and send a clipboard_release when that is the
7007         case (through set_clipboard_owner(owner_none)).
7008
7009 2010-10-02  Hans de Goede  <hdegoede@redhat.com>
7010
7011         Keep track of clipboard ownership
7012         Given that all clipboard handling is async, it is possible to for
7013         example receive a request for clipboard data from the agent
7014         while the client no longer owns the clipboard (ie a
7015         VD_AGENT_CLIPBOARD_RELEASE message is in transit to the agent).
7016
7017         Thus it is necessary to keep track of our notion of clipboard ownership
7018         and check received clipboard messages (both from other apps on the client
7019         machine and from the agent) to see if they match our notion and if not
7020         drop, or in case were a counter message is expected nack the clipboard
7021         message.
7022
7023         Rename platform clipboard handling functions
7024         Rename the 4 platform clipboard functions which get called
7025         upon receival of an agent clipboard message to on_clipboard_*
7026
7027         The old set_clipboard_* names were confusing as they suggest being
7028         a class property setter (like set_event_listener) rather then
7029         event handler, and set_clipboard_owner was causing a name conflict
7030         with the next patch in this series.
7031
7032         Move checking for on demand clipboard cap closer to sending of agent messages
7033         This way the events will always get generated and other things
7034         (such as clipboard ownership administration, see the next patches)
7035         can be done in repsonse to the events, even though no message will be send.
7036
7037         This patch also removes the !_agent_caps check from the capability
7038         checks, this is not needed as VD_AGENT_HAS_CAPABILITY checks _agent_caps_size
7039         which will be 0 when _agent_caps is NULL.
7040
7041 2010-10-01  Hans de Goede  <hdegoede@redhat.com>
7042
7043         Respond to clipb request with an unsupported type with data with a none type
7044         Currently we send a VD_AGENT_CLIPBOARD_RELEASE when we receive a
7045         VD_AGENT_CLIPBOARD_REQUEST with a type which we do not support. This is not
7046         correct, as this means given up clipboard ownership while we may be able
7047         to answer requests with different types. The correct response is to
7048         nack the request by sending a VD_AGENT_CLIPBOARD (data) message with a type
7049         of VD_AGENT_CLIPBOARD_NONE.
7050
7051         Change VD_AGENT_CLIPBOARD_GRAB to an array of types
7052         A clipboard owner can indicate that it can supply the data the clipboard
7053         owns in multiple formats, so make the data passed with a
7054         VD_AGENT_CLIPBOARD_GRAB message an array of types rather then a single
7055         type.
7056
7057         Call intern_atoms() earlier
7058         We call XFixesSelectSelectionInput with the clipboard_atom, so we musr
7059         initialize the atoms before calling XFixesSelectSelectionInput.
7060
7061         Set clipboard_event before calling send_selection_notify
7062         send_selection_notify used the clipboard_event, so set it before calling
7063         send_selection_notify.
7064
7065         wrap XGetAtomName
7066         XGetAtomName() throws X11 errors when called on a None atom, so wrap
7067         it catching the None case.
7068
7069 2010-10-01  Arnon Gilboa  <agilboa@redhat.com>
7070
7071         client: support clipboard/selection-owner model (v2)
7072         -includes most of Hans' review fixes (up to the SelectionRequest comment [4]) & X11 wips sent by Hans (10x!)
7073         -use the VD_AGENT_CLIPBOARD_* types in the platform code
7074         -add ifs for VD_AGENT_CAP_CLIPBOARD_BY_DEMAND in both sides
7075         -support the GRAB/REQUEST/DATA/RELEASE verbs in both ways
7076         -pasting clipboard data is now "only-by-demand" from both sides (client and agent), whose behavior is symmetric
7077         -client and agent don't read or send the contents of the clipboard unnecessarily (e.g. copy, internal paste, repeating paste, focus change)
7078         -set client as clipboard listener instead of application
7079         -add atexit(cleanup) in win platform
7080
7081         linux:
7082         -instead of clipboard atom selection instead of XA_PRIMARY
7083         -enable USE_XRANDR_1_2 and support clipboard in MultyMonScreen
7084         -send utf8 with no null termination, remove ++size
7085         -add xfixes in configure.ac & Makefile.am
7086
7087         windows:
7088         -bonus: support image cut & paste, currently only on windows
7089
7090         not done yet:
7091         -clipboards formats are still uint32_t, not mime types stores as strings
7092         -platform_win is still used, not the root window
7093         -not replaced the ugly windows CF_DIB in agent/winclient
7094
7095 2010-09-29  Alexander Larsson  <alexl@redhat.com>
7096
7097         Bump version to 0.6.1
7098
7099         Update NEWS for release
7100
7101         client: Avoid crash if platform_win is NULL
7102         This is a temporary fix as this will be fixed for real when
7103         the cut and paste patches land.
7104
7105         client: Re-enable USE_XRANDR_1_2
7106         This was disabled by mistake before.
7107
7108         client: Don't hardcode -lrt
7109         -lrt is already included in SPICE_NONPKGCONFIG_LIBS if needed so no
7110         need to add it to the command line manually.
7111
7112         client: Fall back to gettimeofday if clock_gettime not found
7113
7114         client: Include config.h from common.h
7115         config.h should be availible everywhere, so move its inclusion
7116         to the top of common.h.
7117
7118         client: Check for pthread yield function using autoconf
7119
7120         Initialize variable to avoid compiler warning
7121         Seems the OSX gcc warns on saveRight not being initialzied.
7122
7123         client: Include stdint.h for uint32_t
7124
7125         client: Don't use basename for argv[0] in --help output
7126         This isn't what other apps do, and it had issues in the OSX port,
7127         so just remove this.
7128
7129         Fix warning from OSX compiler
7130         The OSX compiler warns about uninitialized variable, so we change
7131         a bit how size is initialized.
7132
7133 2010-09-22  Alexander Larsson  <alexl@redhat.com>
7134
7135         Handle surface images in DrawOpaque
7136
7137 2010-09-21  Alexander Larsson  <alexl@redhat.com>
7138
7139         server: Handle self_image in localize_bitmap
7140         When drawing a drawable with a NULL src bitmap that means we should
7141         be using the previously generated self_bitmap. Not doing this causes
7142         a segfault due to accessing the NULL.
7143
7144         server: Handle NULL image in red_update_streamable
7145         A NULL src bitmap means self_bitmap, which is not a stream, so abort.
7146
7147         server: Use the right image size for self_bitmap
7148         The self_bitmap is the size of self_bitmap_area, not the bbox.
7149         This is especially important since we later copy the self_bitmap_area
7150         into the new bitmap, and if that is larger than bbox then we will
7151         overwrite random memory.
7152
7153         server: Don't leak QUIC image chunks
7154         red_put_image() needs to free the chunks for QUIC images, as we
7155         allocate these when creating the image.
7156
7157         Fix crash when resetting pixman image transform
7158         Resetting the transform is done by setting it to the identity
7159         transform, not passing in NULL. Passing in NULL causes a crash.
7160
7161 2010-09-20  Alexander Larsson  <alexl@redhat.com>
7162
7163         server: Ensure we flush the release pipe after an oom
7164         We really need to flush the ring to ensure that we push something on the
7165         release ring. If we don't do this and the ring is not pushed for other
7166         reasons we will timeout in the guest driver waiting for the ring.
7167
7168         Release more drawables on OOM
7169         We've changed how resources are released so they are now being
7170         freed continuosly, rather than on OOM, since we want to free as early
7171         possible to avoid fragmentation. So, OOM situations should be a bit
7172         less common now and signify a real memory shortage, so we should try
7173         to free up more resources.
7174
7175 2010-09-14  Gerd Hoffmann  <kraxel@redhat.com>
7176
7177         fix palette handling for 0.4 compat
7178         spice 0.4 guests pass 16bpp palette colors when running in
7179         a 16bpp video mode.  Convert them to 32bpp.
7180
7181         fix brush handling for 0.4 compat
7182         spice 0.4 guests pass 16bpp colors for brushes when running in
7183         a 16bpp video mode.  Convert them to 32bpp.
7184
7185         move command flags handling to the qxl parser
7186         Pass through command flags to the qxl parser, so we can hide all
7187         compat bits for spice 0.4 within the qxl parser.
7188
7189 2010-09-09  Hans de Goede  <hdegoede@redhat.com>
7190
7191         spicec-x11: Fix going into a never ending loop upon xrandr event (#628573) (v2)
7192         When handling an xrandr event the event_listener->on_monitors_change()
7193         callback destroys and re-creates the monitor object(s) which results
7194         in the DynamicScreen or MultyMonconstructor being called, which triggers
7195         more xrandr events. This causes a never ending event handling loop making
7196         spicec hang, and eventually making the X-server crash as a backlog
7197         of events builds up and it oom's.
7198
7199         This patches this by explictly processing the xrandr event caused
7200         by the constructor inside the constructor surrounded by the already
7201         present guard code against recursive xrandr events.
7202
7203 2010-09-02  Yonit Halperin  <yhalperi@redhat.com>
7204
7205         server: avoid creating a stream from traces more than once for the same drawable
7206         could have caused ASSERT(!drawable->stream) in red_create_stream
7207
7208 2010-09-02  Alexander Larsson  <alexl@redhat.com>
7209
7210         Add API to turn on backwards compatibility mode
7211         When upgrading a cluster of machines you typically do this by
7212         upgrading a set of machines at a time, making the new machines run
7213         the new software version, but in a fashion compatible with the old
7214         versions (in terms of e.g. migration). Then when all machines are
7215         upgrades, any new features in the new version can be enabled.
7216
7217         This API allows qemu to limit the set of features that spice uses to
7218         those compatible with an older version, in order to do an upgrade like
7219         this. Right now it doesn't really do much, since we don't keep compat
7220         with 0.4.0 atm (although that may be added later).
7221
7222         There is no guarantee that any future version of spice support
7223         being compatible with any previous version. However, we will always
7224         support compatibility with the previous major version so that clusters
7225         can be upgraded step by step.
7226
7227 2010-08-31  Alexander Larsson  <alexl@redhat.com>
7228
7229         Bump version to 0.6.0
7230
7231         Require spice-protocol 0.6.0
7232
7233         Update NEWS for release
7234
7235         Fix scaling with large magnification
7236         When scaling part of an image we need to specify the source
7237         coordinates in transformed coordinates. For large magnifications this
7238         means we will get pretty large values.
7239
7240         Now, if e.g. src_x * transform is larger than 32765, then the
7241         coordinate ends up outside the pixman 16bit image size, so the
7242         rendering will not work.
7243
7244         The fix is to make the src_x/y offset part of the transformation.
7245         This means its automatically transformed by the correct scaling, and
7246         the coordinates passed into pixman are not (typically) over 16bit.
7247
7248         Revert "Fix scaling with large magnification"
7249         This reverts commit e13be77f33609cb3fdae354ce1f2686ae865f9e0.
7250
7251 2010-08-31  Alon Levy  <alevy@redhat.com>
7252
7253         client: add default agent capabilities
7254
7255 2010-08-31  Gerd Hoffmann  <kraxel@redhat.com>
7256
7257         qxl parser: complete parsing of QXLCompatDrawable structs
7258
7259 2010-08-31  Yonit Halperin  <yhalperi@redhat.com>
7260
7261         server: red_current_add_equal - don't push a drawable to the middle of the pipe if it depends on surfaces.
7262         This will prevent: 1) rendering problems (commands sent to the client in the wrong order)
7263         2) sending commands for surfaces that haven't been created yet on the client side.
7264
7265 2010-08-31  Alon Levy  <alevy@redhat.com>
7266
7267         server: when woken up by data ready to be read, don't call write.
7268         This used to be a callback for the vdi_port "data ready" interrupt,
7269         which did indicate either data ready to read or data ready to write, but
7270         this is no longer the case now that virtio-serial is used.
7271
7272         This seemingly simple fix prevents a race that needs to be fixed with
7273         another patch, see freedesktop bz #29903
7274
7275         server: retry mouse send on queue full
7276
7277         server: bugfix - make vdi_port_write_retry reiterate if write_queue still not empty
7278         The vdi_port_write_timer_started flag was not being reset, which prevented
7279         another vdi_port_write_timer_start from actually starting the timer. Fix
7280         is to change order of lines. This happens in the callback of the timer, so
7281         no chance of double timer set.
7282
7283         client: add announce_capabilities
7284
7285         server: add subtype to SpiceCharDeviceInterface, use for vdagent
7286
7287         server: rename SpiceVDIPort* to SpiceCharDevice*
7288
7289 2010-08-30  Yonit Halperin  <yhalperi@redhat.com>
7290
7291         server: fix red_current_flush to flush only the surface that was given as parameter
7292         A side effect of the previous red_current_flush, which flushed all the surfaces, and was called on a new display channel connection, was
7293         that red_handle_drawable_surfaces_client_synced sent the most updated surfaces images when needed. However, now, it should
7294         explicitly call red_current_flush.
7295         Moreover, since red_current_flush was called on a new display channel connection only if there was a primary surface,
7296         if the connection of the display channel occurred at the moment of no primary surface, red_handle_drawable_surfaces_client_synced was buggy.
7297
7298 2010-08-30  Alexander Larsson  <alexl@redhat.com>
7299
7300         Fix scaling with large magnification
7301         When scaling part of an image we need to specify the source coordinates
7302         in transformed coordinates. For large magnifications this means
7303         we will get pretty large values.
7304
7305         Now, if e.g. src_x * transform is larger than 32765, then the coordinate
7306         ends up outside the pixman 16bit image size, so the rendering
7307         will not work.
7308
7309         In order to work around this we generate a "sub-image" of the pixman
7310         image such that the src_x/y values we have to specify are zero (or near
7311         zero).
7312
7313 2010-08-30  Gerd Hoffmann  <kraxel@redhat.com>
7314
7315         Bump versions.
7316         Update #define in server/spice.h in preparation for the 0.6.0 release.
7317         We also got some new functions, thus we have to increate the shared
7318         lib minor number for spice-server.
7319
7320         Add config functions.
7321         A bunch of configuration functions where never ported forward from
7322         rhel-6 to upstream.  Add them so we can add qemu config options for
7323         these settings.
7324
7325 2010-08-30  Alon Levy  <alevy@redhat.com>
7326
7327         Merge commit 'ea298a14e1cde8b811baf6bd187287f18dde0dee'
7328
7329         server: moved agent pipe headers to spice-protocol
7330
7331 2010-08-30  Yonit Halperin  <yhalperi@redhat.com>
7332
7333         server: cleanups in destorying surfaces code
7334
7335         server: really wait for a surface to be destroyed, when calling destroy_surface_wait
7336         Waiting till all the pipe items that are dependent on the surface will be sent.
7337         This was probably the cause for freedesktop bug #29750.
7338
7339         server: consider also PIPE_ITEM_UPGRADE when searching for drawables in red_clear_surface_drawables_from_pipe
7340
7341 2010-08-27  Alexander Larsson  <alexl@redhat.com>
7342
7343         canvas: Better coordinate rounding in scaling
7344         When scaling in pixman you give the source coordinates in transformed
7345         space rather than in the source coordinates. This is a bit problematic
7346         when both source and destination coordinates are at integer positions, but
7347         the scaling factor is not an exact 16.16 fixed point value. We used
7348         to calculate the transformed source based on the floating point
7349         transformation, which gave the wrong answer sometimes. Now we do the
7350         calculations based on the fixed point transform that we give pixman.
7351
7352         However, even with this patch I can still sometimes see issues related
7353         to this, although they are less bad.
7354
7355         server: red_send_image() - append image data to right marshaller
7356         The actual bitmap data was added to the main marshaller rather than
7357         the submarshaller that pointed to the SpiceImage part. This made us
7358         send too short messages failing demarshalling in the client.
7359
7360         server: red_send_image() initialize bitmap.flags
7361         We're currently sending this to the network based on random memory.
7362
7363 2010-08-27  Gerd Hoffmann  <kraxel@redhat.com>
7364
7365         zap more unused bits.
7366         BufDescriptor isn't used at all.
7367         Two AddBufInfo fields (slot_id and group_id) are not used any more.
7368
7369         red_get_cursor: avoid extra copy
7370
7371         fix red_cursur_flush segfault
7372
7373         zap dead typedefs
7374
7375         zap dead qxl chunk code
7376
7377         qxl parser: add cursor parsing
7378
7379 2010-08-26  Gerd Hoffmann  <kraxel@redhat.com>
7380
7381         qxl parser: complete QXL_SURFACE_CMD_CREATE parsing
7382
7383 2010-08-26  Alexander Larsson  <alexl@redhat.com>
7384
7385         server: Fix alloc_lz_image_surface stride allocations
7386         All lz surfaces are not 4 bytes per pixel, calculate the right stride
7387         based on the pixman format.
7388
7389 2010-08-25  Yonit Halperin  <yhalperi@redhat.com>
7390
7391         server: clean glz drawables when reseting qxl
7392         When the we reset qxl, we destroy all srufaces. Since surfaces and glz
7393         drawables are no longer dependent, we need to call red_display_clear_glz_drawables explicitly
7394         in order to clear all our drawables references in the server.
7395
7396 2010-08-25  Alexander Larsson  <alexl@redhat.com>
7397
7398         server: Add missing break in switch case
7399
7400         client: Handle async errors from xshm setup
7401         XShmAttach can fail asynchronously, so we need to check the
7402         errors in the x error handler during the XSync.
7403
7404 2010-08-24  Alexander Larsson  <alexl@redhat.com>
7405
7406         client: Don't leak xshm segments
7407
7408         Don't try xshm any more if it fails for a permanent reason
7409         This is copied from how Gtk+ detects Xshm failures.
7410
7411 2010-08-24  Yonit Halperin  <yhalperi@yhalperi.tlv.redhat.com>
7412
7413         server: remove the no longer used glz drawables list that was maintained for each surface.
7414
7415         server: remove unnecessary dependency between surfaces and Glz drawables
7416         Fixes freedesktop bug #28568
7417
7418 2010-08-23  Alexander Larsson  <alexl@redhat.com>
7419
7420         Fix mismerge in last commit
7421
7422         Remove USE_EXCLUDE_RGN define and !USE_EXCLUDE_RGN code
7423
7424         Remove STREAM_TRACE define and !STREAM_TRACE code
7425
7426 2010-08-23  Yonit Halperin  <yhalperi@redhat.com>
7427
7428         Limiting video streaming to the primary surface. freedesktop bug #28088.
7429
7430         client: Fix for clipboard sending; It wasn't thread safe.
7431
7432         client: fix - exit on bad display-effect argument
7433
7434 2010-08-18  Alexander Larsson  <alexl@redhat.com>
7435
7436         Stride can be negative, so don't use size_t for it
7437
7438 2010-08-17  Alon Levy  <alevy@redhat.com>
7439
7440         support python 2.5.4+ for marshaller/demarshallers
7441         Patch adds a "from __future__" import that doesn't affect newer python's but
7442         allows python 2.5.4 to run the code (tested under scratchbox, n900 build environment)
7443
7444 2010-07-29  Alon Levy  <alevy@redhat.com>
7445
7446         client: Application::get_screen: fix double SpicePoint size, second hiding the first
7447
7448         add arm and armv7 to configurable 32 bit variants in configure.ac (n900 and pc-z1 tested respectively)
7449
7450         add eol after #ifdef in jpeg_encoder.h for n900 scratchbox compiler
7451
7452 2010-07-22  Alon Levy  <alevy@redhat.com>
7453
7454         server: add vdi_port write retry timer. RHBZ 616772
7455
7456 2010-07-21  Alexander Larsson  <alexl@redhat.com>
7457
7458         Don't do manual marshalling for input channel
7459
7460         Fix typo in NEWS
7461
7462 2010-07-20  Alexander Larsson  <alexl@redhat.com>
7463
7464         Update NEWS for 0.5.3
7465
7466         Require spice-protocol 0.5.3 or later
7467
7468         Bump version to 0.5.3
7469
7470         server: Properly order rgb for 24bit bitmaps when sending to libjpeg
7471         SPICE_BITMAP_FMT_24BIT order is bgr, libjpeg wants rgb.
7472         This fixes freedesktop bug #28089
7473
7474         Swap red and blue when decoding 0.4 mjpeg streams
7475         There was an error in how this was encoded in 0.4, which we need
7476         to handle. There is still some issues with the old streams as
7477         the luminocity handling in 0.4 was not correct.
7478
7479         demarshaller: Fix palette marshalling
7480         It turns out that using base + sizeof(struct) is not a good way to
7481         access an array at the end of a struct. For SpicePalette sizeof is 16, but
7482         offset of ents is 12. Using this calculation in the demarshaller breaks
7483         things badly, so now we use the actual array member.
7484
7485         Don't send padding over the network with video data
7486
7487 2010-07-19  Alexander Larsson  <alexl@redhat.com>
7488
7489         Fix uninitialized variable warnings
7490
7491         Don't send CursorHeader if cursor_flags is NONE
7492
7493         Send Clip.rects inline rather than using a pointer
7494
7495         codegen: Allow @to_ptr to make inline structs demarshal as pointers
7496
7497         codegen: Various cleanups
7498         Remove all uses of @end in the marshaller, instead just using
7499         the C struct array-at-end-of-struct. To make this work we also remove
7500         all use of @end for switches (making them C unions).
7501
7502         We drop the zero member of the notify message so that we can avoid this
7503         use of @end for a primitive in the marshaller (plus its useless to send
7504         over the wire).
7505
7506         We change the offsets and stuff in the migration messages to real pointers.
7507
7508         codegen: Pass member to SubMarshallingSource rather than name
7509         This way we can check attributes on the member.
7510
7511         codegen: Remove unused methos has_pointer()
7512
7513 2010-07-19  Alon Levy  <alevy@redhat.com>
7514
7515         server vdi port: prevent recursive calls to read_from_vdi_port (required for spice-vmc)
7516
7517 2010-07-19  Arnon Gilboa  <agilboa@redhat.com>
7518
7519         client: add clipboard support
7520          * windows - untested
7521          * linux - small strings both ways, large implemented differently:
7522           * client to guest - support INCR
7523           * guest to client - we supply a single possibly very large property
7524          * requires server changes in next patch to work with spice-vmc
7525
7526 2010-07-19  Alon Levy  <alevy@redhat.com>
7527
7528         fix typo DisplayModeListner -> DisplayModeListener
7529
7530 2010-07-19  Yonit Halperin  <yhalperi@redhat.com>
7531
7532         client: command line arguments for setting windows guest monitors' color depth and disabling some display options (helpful on WAN)
7533
7534 2010-07-15  Yonit Halperin  <yhalperi@redhat.com>
7535
7536         canvas_base jpeg_alpha: supply the correct size to jpeg_decoder
7537
7538         Merge branch 'master' of git://git.freedesktop.org/git/spice/spice into spice_image
7539
7540 2010-07-14  Gerd Hoffmann  <kraxel@redhat.com>
7541
7542         add SPICE_SERVER_VERSION
7543         Allow to ifdef features which depend on a certain libspice-server release.
7544
7545         update shlib minor
7546         commit c90183da944001e466f60acb58a5052c353995ca added two new functions,
7547         update shared lib minor version for that.
7548
7549 2010-07-14  Yonit Halperin  <yhalperi@redhat.com>
7550
7551         server: enabling/disabling jpeg and zlib-over-glz via spice command line args
7552
7553 2010-07-13  Gerd Hoffmann  <kraxel@redhat.com>
7554
7555         red_glz_compress_image: lines isn't needed any more
7556
7557 2010-07-12  Yonit Halperin  <yhalperi@redhat.com>
7558
7559         server: enabling/disabling jpeg and zlib-over-glz via spice command line args
7560
7561 2010-07-09  Alexander Larsson  <alexl@redhat.com>
7562
7563         Don't marshall bitmap data as pointer, instead send inline
7564
7565         Add --enable-werror and make it the default only for git builds
7566         Its not generally a good idea to have released tarballs build with
7567         -Werror, as later compilers may add warnings breaking old releases, etc.
7568
7569         Use the right enum types for bitmap_data.type comparisons
7570
7571         Add files i forgot to commit
7572
7573 2010-07-08  Alexander Larsson  <alexl@redhat.com>
7574
7575         Update NEWS for release
7576
7577         Disable tunnel by default on windows
7578
7579         Make tunnel support optional in client too
7580
7581         Make distcheck work
7582
7583         Missed some misspelling fixes
7584
7585         Fix various misspellings
7586         letancy -> latency
7587         compund -> compound
7588         SpicedSubMessage -> SpiceSubMessage
7589         modifaiers -> modifiers
7590         massage -> message
7591         outgoiong -> outgoing
7592         AlphaBlnd -> AlphaBlend
7593         remoth -> remote
7594         modifires -> modifiers
7595         secore -> secure
7596
7597         Fix sign warnings from win32 compiler
7598
7599         Fix inclusion of common files, no need for common/ part
7600
7601         server: Remove unnecessary pci id/rev checks
7602         There is no need to check the pci ids or revisions. Thats a contract
7603         between qemu and the driver, and spice need not care, as long as
7604         we get the right data from qemu.
7605
7606         Simplify spice_pixman_region32_init_rects with new types
7607         Don't manually of SpiceRects to pixman_box32_t now that they are compatible
7608         and SpiceRect is internal.
7609
7610         Make all internal structures not be packed
7611
7612         Remove unused method declarations
7613
7614         Move SpiceChunks to mem.h
7615
7616         Move in spice/draw.h from spice-protocol to common/
7617
7618         Handle the new QXLCursorHeader type
7619
7620         Use QXLPHYSICAL, not SPICE_ADDRESS in qxl parser
7621
7622         codegen: No SPICE_ADDRESS types left, drop @c_ptr
7623
7624         Properly parse QXLLineAttrs.style
7625
7626 2010-07-08  Gerd Hoffmann  <kraxel@redhat.com>
7627
7628         remove QXLInterface->has_command()
7629         Not used any more, zap it before rolling up a release tarball.
7630
7631 2010-07-08  Uri Lublin  <uril@redhat.com>
7632
7633         server: add missing ifdef USE_OGL (red_worker.c)
7634
7635 2010-07-08  Gerd Hoffmann  <kraxel@redhat.com>
7636
7637         Properly parse QXLImage to the new-world SpiceImage
7638         SpiceImage now replaces RedImage and has all image types in it.
7639         All image data are now chunked (and as such not copied when demarshalling).
7640
7641 2010-07-08  Alexander Larsson  <alexl@redhat.com>
7642
7643         codegen: support @chunk on non-pointer arrays
7644         This is similar to @as_ptr, but generates a single chunk of data.
7645
7646         Add support for @chunk
7647
7648         marshaller: Make get_nw_offset() handle deep member references
7649
7650         Add spice_marshaller_add_ref_chunks
7651
7652         Add spice_chunks_* helpers
7653
7654 2010-07-05  Alexander Larsson  <alexl@redhat.com>
7655
7656         Convert SpicePath.segments to a pointer array
7657
7658         Handle extra size for switch and array the right way
7659         Even for is_extra_size() we should calculate the mem_size for
7660         arrays, its just that the parent type (in this case switch) should
7661         request mem_size if the type is_extra_size.
7662
7663         marshaller: Add some docs describing the types of sizes
7664
7665         marshaller: Make @nonnull a propagated attribute
7666         This cleans up some stuff
7667
7668         marshaller: Make @c_ptr a propagated attribute
7669         This simplifies some code
7670
7671         marshaller: Add generic way to handle propagating attributes
7672         Also switches @ptr_array to use this
7673
7674 2010-07-02  Gerd Hoffmann  <kraxel@redhat.com>
7675
7676         Properly parse and marshall SpiceString
7677
7678 2010-07-01  Alexander Larsson  <alexl@redhat.com>
7679
7680         Fix build on win32
7681
7682         Fix 32bit failure in demarshaller
7683         Due to a typo we always read offsets as pointers, never as SPICE_ADDRESS.
7684
7685         Update for the SpicePath.segments type change
7686
7687 2010-07-01  Alon Levy  <alevy@redhat.com>
7688
7689         Make CEGUI optional
7690         This makes the CEGUI dependency optional and off by default. Restoring
7691         previous behaviour of exiting on disconnect if disabled.
7692
7693 2010-07-01  Alexander Larsson  <alexl@redhat.com>
7694
7695         client: Use ASSERT, not assert
7696
7697 2010-07-01  Alon Levy  <alevy@redhat.com>
7698
7699         - fix for noopengl patch for server
7700         I still don't have commit access (can't ssh to anarchy) so if someone could commit this (alex) thanks,
7701
7702         Alon
7703
7704         Fix for no opengl patch - required to compile the server (fixes missing symbol gl_canvas_init).
7705
7706 2010-07-01  Yonit Halperin  <yhalperi@redhat.com>
7707
7708         fix for not clearing the cursor ring when the primary surface is destroyed
7709         fixes a crash in qxl_soft_reset
7710
7711 2010-06-30  Alexander Larsson  <alexl@redhat.com>
7712
7713         Simplify SpiceLineAttr by removing unsed stuff
7714         Also in new protocol don't send style data if not needed.
7715
7716         Automatically marshall SpiceClipRects
7717
7718         Automatically marshall SpicePath
7719
7720         Support @marshall to automatically marshall pointers
7721
7722         Store SpicePath segment count rather than size
7723         Internally and in the network protocol (for the new version) we
7724         now store the actual number of segments rather than the size of the
7725         full segments array in bytes. This change consists of multiple changes
7726         to handle this:
7727
7728         * Make the qxl parser calculate num_segments
7729         * Make the canvas stroke code handle the new SpicePath layout.
7730         * Fix up is_equal_path in red_worker.c for the new layout
7731         * replace multiple calls to spice_marshall_PathSegment with a single
7732           spice_marshall_Path call
7733         * Make the byte_size() array size handling do the conversion from
7734           network size to number of elements when marshalling/demarshalling.
7735         * Update the current spice protocol to send the segment count rather than
7736           the size
7737         * Update the old spice protocol to use the new byte_size functionallity
7738           to calculate the size sent and the number of elements recieved
7739
7740         Add spice_marshaller_set_uint32
7741         With this function you can update an added uint32 after it being added.
7742         To make this possible all the spice_marshaller_add_add_foo functions
7743         now return a pointer that can be used as a reference when later
7744         setting a value.
7745
7746         Update client and protocol to support the new SpiceClipRects
7747
7748         demarshaller: Support @c_ptr attributes for pointers
7749         A @c_ptr pointer is stored in memory as a real pointer rather than a
7750         SPICE_ADDRESS. This is a temporary thing that will be removed again
7751         when all SPICE_ADDRESSes have been converted to real pointer.
7752
7753         demarshaller: Don't parse @zero members
7754         These just write zeros at the right place in the network protocol
7755         typically for old back-compat things. We don't want to read these
7756         back in.
7757
7758 2010-06-30  Gerd Hoffmann  <kraxel@redhat.com>
7759
7760         qxl-abi: handle clip rect and path references.
7761         red_parse_qxl.c starts to follow QXLPHYSICAL references and build up
7762         data structures.  Can zap a bunch of get_virt calls in red_worker.c,
7763         followed by cleanups.
7764
7765         (de-) marshaller needs updates to deal with that.  Also I suspect with
7766         the get_virt() calls being gone we can offload more work to generated
7767         marshaller code.
7768
7769         client doesn't build.
7770
7771         add qxl chunk parser
7772
7773 2010-06-29  Alexander Larsson  <alexl@redhat.com>
7774
7775         server: Don't call opengl if not enabled
7776         If USE_OGL is not defined, really don't call or link in the opengl
7777         backend.
7778
7779 2010-06-29  Yonit Halperin  <yhalperi@redhat.com>
7780
7781         client: add --include "common.h" for generated marshallers
7782
7783         fixed unhandled destroy screen in Application:restore_screens_size
7784
7785         detaching the screen when the primary surface is destoryed and closing the window if the primary surface is not recreated (the monitor has been detached).
7786
7787         remove unnecessary send of SPICE_MSG_DISPLAY_RESET
7788         when SPICE_MSG_DISPLAY_RESET was sent, SPICE_MSG_DISPLAY_SURFACE_DESTROY had already
7789         been sent for all surfaces.
7790         It also caused a client crash since DisplayChannel::handle_reset assumes that screen
7791         exists.
7792
7793 2010-06-29  Gerd Hoffmann  <kraxel@redhat.com>
7794
7795         qxl abi: parse QXLRect.
7796
7797         qxl abi: parse QXLPoint & friends.
7798
7799         qxl abi: parse QXLCursorCmd.
7800
7801         qxl abi: parse QXLSurfaceCmd.
7802
7803         qxl abi: parse QXLMessage.
7804
7805         qxl abi: parse QXLUpdateCmd.
7806
7807         qxl abi: parse QXLClip.
7808
7809         qxl abi: parse QXLLineAttr.
7810
7811         qxl abi: parse QXLPattern.
7812
7813         qxl abi: parse QXLBrush.
7814
7815         qxl abi: parse QXLQMask.
7816
7817         qxl abi: parse QXLBlackness+QXLInvers+QXLWhiteness.
7818
7819         qxl abi: parse QXLText.
7820
7821         qxl abi: parse QXLStroke.
7822
7823         qxl abi: parse QXLRop3.
7824
7825         qxl abi: parse QXLTransparent.
7826
7827         qxl abi: parse QXLCopy + QXLBlend.
7828         Also adapt to tyops fix (s/rop_decriptor/rop_descriptor/).
7829
7830         qxl abi: add missing QXLCopyBits
7831
7832         qxl abi: parse QXLOpaque.
7833         Also adapt to tyops fix (s/rop_decriptor/rop_descriptor/).
7834
7835         qxl abi: parse QXLFill.
7836         Also adapt to tyops fix (s/rop_decriptor/rop_descriptor/).
7837
7838         qxl abi: parse QXLAlphaBlnd (+Compat)
7839
7840         qxl abi: parse QXLCompatDrawable.
7841
7842         qxl abi: parse QXLDrawable.
7843
7844         improve memory slot error logging.
7845
7846 2010-06-28  Alexander Larsson  <alexl@redhat.com>
7847
7848         Replace log4cpp with custom log function
7849         Also prints a simpler error to stderr for WARN or above so that
7850         we print something on the commandline if something go wrong.
7851
7852         Fix build error due to member "SpiceMsgEmpty" same name as type
7853
7854 2010-06-24  Alexander Larsson  <alexl@redhat.com>
7855
7856         spice.proto: surface_create.format is of type surface_fmt
7857
7858         Use smaller size for enums and flags on the network
7859         This makes the protocol more compact. This was mainly done for the commonly
7860         used types. Some seldom used ones are still 32bit for future compatibility.
7861
7862         Remove support for clip by path
7863         This is not supported currently anyway and was not generated before.
7864
7865 2010-06-23  Alexander Larsson  <alexl@redhat.com>
7866
7867         spice.proto: No need for @ptr32 as that is now the default
7868
7869         spice.proto: Don't use @fixedsize for Brush
7870         There is no reason to send the maximum size on the network, that is just
7871         a waste of space most of the time.
7872
7873         Don't send zero data item for clips with no data
7874
7875         Make pointers 32bit in new protocol format
7876
7877         marshaller: Correctly determine if switches are fixed size
7878         Switches are fixed size only if all cases have the same size *and*
7879         it has a default case or all the valid cases are listed.
7880
7881         Fix handling of @ptr32 network size
7882
7883         Remove minor markup in unstable protocol as we're resetting minor to 0
7884
7885 2010-06-23  Gerd Hoffmann  <kraxel@redhat.com>
7886
7887         fix use-after-free in spice_marshaller_reset
7888
7889         drop bogous get_virt_delta calls
7890
7891 2010-06-23  Alexander Larsson  <alexl@redhat.com>
7892
7893         Fix version mismatch error on connect
7894         Protocol is 0 (auto), 1 (old), or 2 (new). This is (apart from 0) the
7895         same as the major number for the stable protocol. However, the current major
7896         is ~(-1) to signify it being unstable, so don't use the major number as source
7897         for setting or comparing protocol.
7898
7899         Fix screen resolution changes on old servers
7900         * Correctly check for existing canvas 0
7901         * Don't try to unlock the screen size if there is no active screen
7902
7903 2010-06-22  Alexander Larsson  <alexl@redhat.com>
7904
7905         client: Support connecting to a major==1 server
7906
7907         Implement display_mode message needed for backwards compat
7908
7909         Generate marshaller/demarshallers for old protocol
7910
7911         Add spice1.proto describing the 0.4 version of the network protocolx
7912
7913         Add support for @virtual markup in spice protocol
7914         This means the member is not sent on the network at all.
7915         Instead its initialized to the attribute argument when demarshalled.
7916
7917         This is useful for backwards compatibility support.
7918
7919         Make internal generated marshaller functions static
7920
7921         Support extra prefix in code generators
7922         This is require when we add a new spice.proto for the old (major 1)
7923         protocol description.
7924
7925         Add more emacs mode headers
7926
7927         Convert client to use indirect calls for message marshalling
7928         This is required to support multiple versions
7929
7930         Support creating marshallers that are called indirectly
7931         This is needed if we want to switch marshallers depending on what
7932         major version the remote side has.
7933
7934         Add destructor for demarshalled messages
7935         This is required because we don't want to free messages that just
7936         refer to the unparsed message (like SpiceMsgData).
7937
7938         Also, in the future we might need it for more complex demarshalling.
7939
7940 2010-06-21  Yonit Halperin  <yhalperi@redhat.com>
7941
7942         fix for not reseting client palette caches on migration
7943
7944         Lossy compression of RGBA images (on WAN connection)
7945         The RGB channels are compressed using JPEG.
7946         The alpha channel is compressed using LZ.
7947
7948         applying zlib compression over glz on WAN connection
7949
7950 2010-06-21  Alexander Larsson  <alexl@redhat.com>
7951
7952         Make opengl optional, disabled by default
7953         The OpenGL renderer isn't really useful right now, its not quite up
7954         to date, its not really faster than software and it only supports a limited
7955         subset of drivers. So, lets disable it for now.
7956
7957         Long term opengl rendering of the 2d part of spice is important if we want
7958         to combine 2d and 3d rendering (say if spice adds opengl support in the
7959         protocol). But until then this is isn't useful for normal use.
7960
7961 2010-06-18  Alexander Larsson  <alexl@redhat.com>
7962
7963         Make generated marshallers build on win32
7964
7965         Add server/demarshaller.h
7966
7967         Make sound data @as_ptr to avoid copying data
7968
7969         Make ping data @as_ptr to avoid copying data
7970
7971         Make cursor data @as_ptr to avoid copying data
7972
7973         Support @as_ptr in demarshaller to avoid copying data unnecessary
7974
7975         Make pointer types in messages be 64bit in memory
7976         Right now we always assume pointers are stored as SPICE_ADDRESS,
7977         i.e. 64bit, independent on the size sent on the network.
7978         This is required for 64bit architectures of course, but slightly overkill
7979         on 32bit architectures, so needs fixing when all SPICE_ADDRESS elements
7980         can be made internal.
7981
7982         Don't pack the message structures
7983
7984         Make all message structs internal to spice
7985         We move all message structs from spice-protocol to spice as
7986         we want to be able to change these as needed internally. The
7987         on-network format is no longer defined by these structures anyway,
7988         but rather by the spice protocol description.
7989
7990         Allow multiple --include args
7991
7992         Use generated demarshallers in server
7993
7994         Generate demarshallers on server side
7995
7996         Make tunnel_service_add members be of cstring array size
7997
7998         Switch client to use generated marshallers
7999
8000         Generate and link marshallers into client
8001
8002         Re-enable cache freeing
8003         I don't know why this was disabled but it seems like a bad idea
8004
8005         Convert reds.c to use SpiceMarshaller
8006
8007         Convert snd_worker.c to use SpiceMarshaller and generated marshallers
8008
8009         Convert red_worker.c to use SpiceMarshaller for marshalling
8010
8011         Generate marshallers in server
8012
8013         Use @ptr32 for 32bit offsets in spice.proto
8014
8015         Add @nomarshal in a few places where we're marshalling manually
8016
8017         spice.proto: add @outvar markup
8018         With this we can reference pointer member with no naming conflicts
8019
8020         Add support for generating message and structure marshallers
8021
8022         Add SpiceMarshaller for easy marshalling
8023
8024         Generate demarshalling code on win32 too
8025
8026         Client: Use the autogenerated demarshallers
8027         When a message has been read from the network we now pass it into
8028         the generated demarshaller for the channel. The demarshaller converts
8029         the network data to in-memory structures that is passed on to the
8030         spice internals.
8031
8032         Additionally it also:
8033         * Converts endianness
8034         * Validates sizes of message and any pointers in it
8035         * Localizes offsets (converts them to pointers)
8036         * Checks for zero offsets in messages where they are not supported
8037
8038         Some of this was previously done using custom code in the client, this
8039         is now removed.
8040
8041         Generate demarshallers in client
8042
8043         Add python code to automake system
8044
8045         Initial import of spice protocol description and demarshall generator
8046         The "spice.proto" file describes in detail the networking prototcol
8047         that spice uses and spice_codegen.py can parse this and generate
8048         demarshallers for such network messages.
8049
8050         Use the correctly spelled enum values from the new generated enums
8051
8052         Use the new enums for keyboard modifier flags
8053
8054 2010-06-17  Alexander Larsson  <alexl@redhat.com>
8055
8056         There are multiple line attribute flags enums, use only one
8057
8058         Add spice_strnlen
8059
8060 2010-06-09  Yonit Halperin  <yhalperi@redhat.com>
8061
8062         server: optimize red_pipe_replace_rendered_drawables_with_images (lossy bitmaps support related)
8063
8064         init/destroy lossy surface region
8065
8066         enabling jpeg on low bandwidth connection
8067
8068         not using jpeg when sending a surface to the client (the whole surface)
8069         When a surface is sent to the client using red_send_surface_image, operations were already
8070         performed on it. Thus it may combine, especially if it is a primary surface, both "picture-like" areas
8071         and areas that are more "artificial". In order to avoid noticeable artifacts, such surface will be sent lossless.
8072
8073         send qxl commands to client: support for resending lossy components when jpeg compression is enabled
8074
8075         infrastructure routines for resending to the client part of surfaces that have been sent lossy.
8076         The code also handles cases in which the server doesn't hold anymore these surfaces parts, i.e., when
8077         it holds a more updated version of them. This scenario is handled by replacing commands that were rendered, with images.
8078
8079         introducing lossy and lz compression in red_send_image
8080
8081         lossy surface regions in the client: infrastructure for tracking and updating
8082
8083         support for lossy images in the pixmap cache and fill bits
8084         1) add an option to determine if a bitmap can be sent lossy to the client
8085         2) when required, replacing lossy cache items with their correspending
8086            lossless bitmaps
8087
8088         JPEG support: introducing jpeg encoding for spice bitmaps
8089
8090         server: fix bitmap flags assignment in red_send_image
8091
8092 2010-06-09  Alexander Larsson  <alexl@redhat.com>
8093
8094         client: Only invalidate on screen if drawing to the primary surface
8095
8096 2010-05-26  Gerd Hoffmann  <kraxel@redhat.com>
8097
8098         sound: code style fixups
8099
8100 2010-05-21  Alexander Larsson  <alexl@redhat.com>
8101
8102         Fix some misspelled identifiers
8103         severty -> severity
8104         SpiceResorceID -> SpiceResourceID
8105         SpiceResorceList -> SpiceResourceList
8106         resorces -> resources
8107         ped_size -> pad_size
8108         postition -> position
8109
8110         RedWorkeMessage -> RedWorkerMessage
8111
8112         Fix spelling errors in comments and strings
8113
8114 2010-05-21  Gerd Hoffmann  <kraxel@redhat.com>
8115
8116         sound channels: restart audio on client reconnect.
8117
8118 2010-05-19  Alexander Larsson  <alexl@redhat.com>
8119
8120         Use the new byteswap macros from spice-protocol
8121
8122         Change leftover VD_INTERFACE_RECORD to SPICE_INTERFACE_RECORD
8123
8124         Add missing backslash continuation in makefile
8125
8126 2010-05-19  Gerd Hoffmann  <kraxel@redhat.com>
8127
8128         Revert "[debug] migration troubleshooting"
8129         This reverts commit 08927fabe57c17086fe3bce3a9ca166e2309349e.
8130
8131         complete NetWireInterface redesign, make red_tunnel_worker.c build.
8132
8133         add spice-experimental.h
8134         Supposed to be used for work-in-progress bits,
8135         where interfaces are not finalized yet.
8136
8137         Moved over vdi port interface, tunnel interface
8138         and spice client migration functions.
8139
8140         zap vd_interface.h
8141         move over content to spice.h
8142
8143         vd_interface.h cleanups.
8144         Drop leftover bits which are not used any more.
8145         Rename DrawArea to QXLDrawArea.
8146
8147         NetWireInterface: redesign
8148
8149         zap MigrationInterface
8150         Remove remaining MigrationInterface bits.
8151
8152         migration: new api
8153         Add new API for migration, based on what RHEL-6 has.
8154
8155         [debug] migration troubleshooting
8156
8157         zap migration code
8158         Drop all code which depends on accessing the migration file handle.
8159
8160         replace worker load/save with loadvm_commands, allow keeping surface content
8161         Add worker->loadvm_commands.  qemu will uses this to send a series of
8162         commands needed to restore state after savevm/loadvm and migration.
8163         That will be one create-surface command per surface and one cursor-set
8164         command for the local pointer.
8165
8166         The worker->save/load functions are not needed any more.
8167         Likewise the interface->{get,set}_save_data callbacks.
8168
8169         Surfaces created via loadvm_commands *will* not be cleared.  Also
8170         primary surfaces are not cleared any more (unconditionally, although
8171         we could do that conditionally on loadvm using the flags field in
8172         QXLSurfaceCreate).
8173
8174         surface: keep metadata (aka create command) in device memory.
8175         With this patch applied the spice server will not release surface create
8176         commands for the whole lifecycle of the surface.  When the surface is
8177         destroyed both create and destroy commands are released.
8178
8179         This has the effect that the surface metadata (size, depth, ...) is kept
8180         in qxl device memory.  This in turn makes it alot easier for qemu to
8181         handle savevm/loadvm.  It just needs to do some minimal command parsing
8182         and maintain pointers to the create commands for the active surfaces.
8183
8184         kill spice_server_set_mouse_absolute
8185         Not needed.  Just register/unregister the tablet interface instead.
8186
8187         vdi port: redesign.
8188         Pretty straight forward.
8189
8190         One thing we should think about is if and how we are going to deal
8191         with multiple ports here?
8192
8193         With vdi port using virtio-serial as communication channel to the guest
8194         it is easy to have multiple ports, i.e. we might want to use a second
8195         instance for clipboard data.  That implies that we need support for
8196         multiple channels all the way through the stack ...
8197
8198         constify SpiceBaseInterface
8199
8200         SoundInterfaces: redesign
8201
8202         TabletInterface: redesign
8203
8204         QXL: redesign.
8205
8206         MouseInterface: redesign
8207
8208         KeyboardInterface: redesign.
8209         This is the direction I wanna take with all interfaces:  Clearly
8210         separate interface (aka version information and function pointers)
8211         and state information.  SpiceKbdInterface defines the interface,
8212         SpiceKbdInstance maintains per-instance state information.  Keyboard
8213         hasn't much beside a pointer to SpiceKbdInterface, for other
8214         interfaces this very likely will be different.
8215
8216         s/CoreInterface/SpiceCoreInterface/
8217
8218         VDInterface: redesign.
8219         VDInterface has been renamed to SpiceBaseInterface. Dropped base_version
8220         element, shlib versioning should be used instead.  Dropped id element,
8221         it is passed to spice_server_add_interface() instead.  Now
8222         SpiceBaseInterface has static information only, multiple interface
8223         instances can share it.
8224
8225         Added SpiceBaseInstance struct for maintaining per-instance state
8226         information.  Adapted spice_server_{add,remove}_interface() functions
8227         to the new world.
8228
8229         shlib major
8230
8231         minor timer interface cleanups.
8232         Make the timer interface largely look like the watch interface.
8233         Simliar naming convention for the functions (timer_*) and a
8234         opaque SpiceTimer type.
8235
8236         new watch api: kill old api
8237
8238         new watch api: switch channels
8239
8240         new watch api: switch sound
8241
8242         new watch api: switch migration
8243
8244         new watch api: switch inputs
8245
8246         new watch api: switch ssl accept
8247
8248         new watch api: switch main channel
8249
8250         new watch api: switch liasync read
8251
8252         new watch api: switch listening sockets
8253
8254         introduce new watch api
8255         This patch adds a new file handle watch interface to libspice, featuring
8256         three callbacks:
8257
8258           (1) watch_add() -- create a new file watch.
8259           (2) watch_update_mask() -- change event mask.  spice frequently
8260                                      enables/disables write notification.
8261           (3) watch_remove() -- remove a file watch.
8262
8263         libspice users must implement these functions to allow libspice
8264         monitoring file handles.
8265
8266         The old interface (set_file_handlers) doesn't explicitly express the
8267         lifecycle of a watch.  Also it maps 1:1 to a qemu-internal function.
8268         In case the way qemu implements file watches changes (someone sayed
8269         QemuIONotifier?) this will break horribly.  Beside that it is very
8270         bad style.
8271
8272         Follwing patches will switch over users one by one to the new interface
8273         and finally zap the old one.
8274
8275         fix visibility
8276
8277         zap CoreInterface->{term_printf,log}
8278         Was used to print stuff to the qemu monitor.
8279         Fundamentally incompatible with QMP.  Remove.
8280
8281         zap qterm interfaces
8282         old way to handle monitor, obsolete.
8283
8284         zap CoreInterface->(un)register_change_notifiers()
8285         spice_server_add_interface() and spice_server_remove_interface()
8286         can be used instead.
8287
8288         zap CoreInterface->next()
8289         Interfaces must be registered after spice_server_init().
8290         The "next" callback is used to discover interfaces
8291         registered before spice_server_init().  Which is a empty
8292         list and thus pretty pointless.  Remove it.
8293
8294         channel security cleanup
8295         - drop spice_channel_name_t enum, use spice-protocol defines instead.
8296         - switch spice_server_set_channel_security() channel parameter from
8297           enum to string.
8298         - drop spice_server_set_default_channel_security(), use
8299           spice_server_set_channel_security with channel == NULL instead.
8300
8301         zap spice_parse_args + spice_usage_str
8302         First step to throw out the old interface.
8303
8304 2010-05-19  Alexander Larsson  <alexl@redhat.com>
8305
8306         Minor whitespace cleanup
8307
8308         Make it --enable-tunnel work
8309
8310 2010-05-03  Yonit Halperin  <yhalperi@redhat.com>
8311
8312         server: fix invalid self loop in surfaces dependencies.
8313         Cyclic dependencies between surfaces mustn't occur. They can cause invalid rendering -
8314         recent drawables might be rendered before older ones.
8315
8316 2010-05-03  Dan Kenigsberg  <danken@redhat.com>
8317
8318         spice server: fix typo in private key error message
8319
8320 2010-05-03  Gerd Hoffmann  <kraxel@redhat.com>
8321
8322         Add C version of find_msb()
8323         This patch allows people to build the spice-client on any 32bit/64bit
8324         architecture.
8325
8326         by Bryan Stillwell <bryan@bokeoa.com>
8327
8328 2010-05-03  Alexander Larsson  <alexl@redhat.com>
8329
8330         Remove all mentions of "cairo" from the code
8331         The command line option is renamed from "cairo" to "sw", and
8332         similarly all filenames and types from Cairo to Sw (and similar).
8333
8334 2010-04-30  Alexander Larsson  <alexl@redhat.com>
8335
8336         Don't send alpha bytes for primary surface
8337         The framebuffer is not used as a source for alpha blends, so we never
8338         need to scan it for alpha bytes.
8339
8340 2010-04-29  Gerd Hoffmann  <kraxel@redhat.com>
8341
8342         iovec: add sanity check
8343         Adds sanity check to iovec setup.  In theory this should never ever
8344         trigger.  In practice guest driver bugs can make it trigger.  This
8345         patch avoids qemu burning cpu in a endless loop, instead we'll print a
8346         message and abort.  Not sure whenever there is a more graceful way to
8347         handle the situation ...
8348
8349         fix worker->stop surface cleanup
8350
8351 2010-04-29  Alexander Larsson  <alexl@redhat.com>
8352
8353         client: Report window format right for win32
8354
8355         client: Support 16bpp pixmaps on win32
8356
8357         win32 client: Remove unnecessary GDIImage type
8358         We just use pixman_image_t as the "information about image data" structure.
8359
8360 2010-04-28  Alexander Larsson  <alexl@redhat.com>
8361
8362         Add support for SPICE_IMAGE_FLAGS_HIGH_BITS_SET
8363
8364         Clear alpha in xRGB destination to avoid pixman setting it to 0xff
8365         Pixman sometimes sets the ignored high byte to 0xff during alpha
8366         blending. This is correct according to pixman specs, as the high
8367         byte is ignored. However its not what windows expects, and it causes
8368         unnecessary regions with non-zero high byte, causing us to
8369         send rgba data instead of rgb which compresses worse.
8370
8371         So, we detect this and clear the high byte.
8372
8373         Fix line lengths and tabs
8374
8375 2010-04-26  Gerd Hoffmann  <kraxel@redhat.com>
8376
8377         fix two warnings
8378
8379 2010-04-23  Alexander Larsson  <alexl@redhat.com>
8380
8381         Remove surface format workaround now that win32 driver is fixed
8382         The win32 driver makes all 32bit surfaces be xRGB now, so we
8383         can remove this old workaround.
8384
8385         Fix up win32 client with recent changes
8386
8387         Win32 canvas fixes
8388
8389         If we have alpha in a 32bit rgb surface, ensure we send that
8390         If we don't then alpha is lost which is problematic if the surface
8391         is later used as with alpha_blend and SRC_SURFACE_HAS_ALPHA.
8392
8393         Support alpha surface sources and destinations
8394
8395         Localize palettes for LZ PLT format
8396         This is needed since they always decode to 32bit mode.
8397
8398         Server: Use the right image format when updating from a surface
8399
8400         Make each surface its own depth/format
8401         Surface creation now specifies the exact format, not only the bit depth
8402         of each surface which is used for rendering.
8403
8404         Additionally we now actually store the surfaces in that format, instead
8405         of converting everything to 32bpp when drawing or e.g. handling palettes.
8406
8407         Client: Support pixmap format conversion in copy_pixels
8408         In order to be able to support 16bit canvases on 32bit screens and 32bit
8409         canvases on 16bit screens we need to handle format conversion when drawing
8410         RedPixmaps.
8411
8412         The way this works now for X11 is that we only have one PIXELS_SOURCE_TYPE
8413         for pixmaps, which always has a pixman_image_t for the data, but additionally
8414         it has an XImage (shared mem or not) if the screen the pixmap was created
8415         for (i.e. an explicit one or the default screen) has the same format as
8416         the pixmap.
8417
8418         When we draw a pixmap on a drawable we have two variants. If the pixmap
8419         has a XImage and it matches the format of the target drawable then we
8420         just X(Shm)PutImage it to the drawable. If the formats differ, then we
8421         create a temporary XImage and convert into that before drawing it to
8422         the screen.
8423
8424         Right now this is a bit inefficient, because we always allocate a new
8425         temporary image when converting. We want to add some caching here, but
8426         at least this lets things work again.
8427
8428         X11 client: Add helper for XImage construction
8429
8430         Add utility functions to create XShm images
8431
8432         Create screen composit area in same format as window
8433         This way we don't have to convert when drawing to it, or drawing it to
8434         the dc.
8435
8436         Add helper to compare RedDrawable::Formats for copy compabible
8437         Being copy compatible means the format are identical except
8438         that some bits in the source may be ignored in the destination.
8439
8440         Add RedDrawable::Format get_format()
8441         This is useful because we can e.g. create pixmaps in the same format as
8442         a window.
8443
8444         Add XPlatform::get_screen_format for X11
8445
8446         Move RedPixmap::Format to RedDrawable::Format
8447         We need to know the format for other drawables too (like for instance
8448         the native format of a window), so we're pushing this down.
8449
8450         This changes a bunch of references to be RedDrawable::, but not all.
8451         The the old RedPixmap:: references still work, but will be phased out.
8452
8453         Make client canvas and pixmaps handle more formats and simplify
8454         We now support 16bit format pixmaps as well as the old ones. Including
8455         both 555 and 565 modes.
8456
8457         We drop the palette argument for pixmap construction as it was only
8458         used for black/white anyway.
8459
8460         Canvas creation is simplified so that there is no separate set_mode
8461         state. Canvases are already created in the right mode and never change.
8462
8463         common: Add lookaside storage for pixman image format
8464         Ideally we should just read this from the pixman image, but
8465         there is no API to do so in stable pixman, so we store it.
8466
8467         Add pixman utilities for bitmap to pixman_image_t conversion
8468
8469         Add support for 16bit rop3
8470
8471         Add emacs modelines to more files
8472
8473         Remove unused method canvas_surf_to_invers
8474
8475         Make client start if screen is 16bpp
8476         The current glx code is looking for a rgb32 visual and always failing
8477         if there is none. This means not even software rendering starts up
8478         on e.g. 16bit visuals. This commit makes it pick software fallbacks
8479         on 16bit visuals.
8480
8481         Long term we need to fix the gl implementation to do 16bpp too.
8482
8483         Client: Don't die if XIM not availible
8484
8485         Detect XShm extension sanely
8486         The previous way XShm detection worked failed at least for me, and is
8487         not the standard way. We now just use XShmQueryExtension and
8488         XShmQueryVersion.
8489
8490         Detect big endian systems
8491
8492         Fix warnings breaking win32 build
8493
8494 2010-04-14  Izik Eidus  <ieidus@redhat.com>
8495
8496         Merge branch 'master' of ssh://git.freedesktop.org/git/spice/spice
8497
8498         spice: server: change update_area command
8499         The new command return dirty area to be used
8500         by users that want spice to render localy or
8501         into some framebuffer (sdl / vnc)
8502
8503 2010-04-14  Alexander Larsson  <alexl@redhat.com>
8504
8505         Avoid unncessary buffer management in mjpeg decoder if possible
8506
8507 2010-04-13  Alexander Larsson  <alexl@redhat.com>
8508
8509         Relicense everything from GPL to LGPL 2.1+
8510
8511         Fix A1 handling in RedDrawable combine_pixels.
8512         The previous code was just busted, as apparent on e.g. the cursor
8513         in MS Paint.
8514
8515 2010-04-12  Alexander Larsson  <alexl@redhat.com>
8516
8517         Use upstream name for pthreads lib and new freetype version
8518
8519         Fixed vs2008 warning
8520
8521         Fix win32 build with pixman 0.18.0
8522
8523         Use fast DCT method for better jpeg compression performance
8524
8525 2010-04-12  Izik Eidus  <ieidus@redhat.com>
8526
8527         spice server: fix validate_chunk
8528
8529         fix 16bpp support on cairo_canvas
8530
8531 2010-04-12  Alexander Larsson  <alexl@redhat.com>
8532
8533         Always tread depth 24 (i.e. non alpha) as depth 32 when blitting
8534         When blitting we don't really care about alpha mismatches, we just copy bits
8535         anyway.
8536
8537 2010-04-09  Izik Eidus  <ieidus@redhat.com>
8538
8539         take the right lock when freeing glz stuff of surfaces
8540         this was noticed by Yonit.
8541
8542 2010-04-09  Alexander Larsson  <alexl@redhat.com>
8543
8544         Split out the memslot stuff from red_worker.c to its own files
8545         This is required so that we can have code in other files that does address
8546         validation.
8547
8548 2010-04-09  Yonit Halperin  <yhalperi@redhat.com>
8549
8550         server: fix race condition in lz global dictionary, in its image segments list
8551
8552 2010-04-09  Izik Eidus  <ieidus@redhat.com>
8553
8554         spice: win32 client: fix gdi locking
8555         While the fix could have been more effective,
8556         it seems like this patch stream better with the coding
8557         logic that was there..., maybe later we will want to change
8558         the locking into more effective way.
8559
8560         (There is just the primary surface to protect in reiality)
8561
8562 2010-04-08  Alexander Larsson  <alexl@redhat.com>
8563
8564         Remove leftover AutoVStreamInit class
8565
8566         Initialize _kill_mark so we don't get spurious valgrind warnings
8567
8568         Free the jpeg decoder with the stream
8569
8570         Use libjpeg to decode mjpegs, not ffmpeg
8571         This is pretty straightforward, although there are two weird issues.
8572         The current encoder has two bugs in the yuv conversion. First of all
8573         it switches red and blue, due to something of an endianness issue. We
8574         keep this behavior by switching red and blue. Maybe we want to
8575         change this in the new protocol version since switching this may
8576         cause jpeg compression to be worse.
8577
8578         Secondly, the old coder/decoder did rgb to/from yuv420 wrongly for
8579         jpeg, not using the "full scale" version of Y that is used in jpeg,
8580         but the other one where y goes from 16 to 235. (See jpeg/jfif
8581         reference on http://en.wikipedia.org/wiki/YCbCr for details.)
8582         The new decoder uses the full range in order to get better quality,
8583         which means old encoders will show slightly darker images.
8584
8585         This completely removes all ffmpeg usage in the client
8586
8587         Update project file to visual studio 2008
8588
8589 2010-04-08  Izik Eidus  <ieidus@redhat.com>
8590
8591         spice server: fix not sent depth size for surfaces
8592
8593 2010-04-07  Alexander Larsson  <alexl@redhat.com>
8594
8595         Remove non-used lookup3.[ch]
8596
8597 2010-04-06  Yonit Halperin  <yhalperi@redhat.com>
8598
8599         server configuration: make network redirection support optional
8600         By default it is disabled. To enable: configure --enable-tunnel.
8601         When active, requires libslirp.
8602
8603         client: handling SPICE_MSG_MAIN_MIGRATE_SWITCH_HOST
8604         disconnecting from the current host and connecting to the target host.
8605
8606         client: fix unsafe access to an event member
8607
8608 2010-04-06  Izik Eidus  <ieidus@redhat.com>
8609
8610         spice server: try to be less brutal when changing res or when flushing the tree
8611         The idea is that we can try to defer some stuff to be later
8612         send in the pipe if the pipe is not fulled yet, moreover
8613         we will then walk on the pipe using:
8614         red_clear_surface_drawables_from_pipe() and will try to
8615         remove the uneeded objects of this surface
8616
8617         Still some room to improvment but later...
8618
8619         spice server: remove surface_id and surfaces_dest[3] from guest mem
8620         Validate the surface_ids just once and keep them in safe
8621         memory area
8622
8623         Make things simpler
8624
8625 2010-04-05  Izik Eidus  <ieidus@redhat.com>
8626
8627         spice: common: gdi_canvas fix gdi objects leak
8628         BitmapMask was used by the draw_text function as well
8629         therefore we need to mark from_surface = 0 if we want
8630         it to release the boject...
8631
8632         (Was evil, took me few hours to understand from where
8633          the leak come...)
8634
8635         spice-server: when destroying a surface don`t send uneeded items
8636         Just skip the items of destroyed surface that are found in the pipe
8637         before we skip them, we check if they are needed by other users...
8638
8639         spice-server: remove glz objects related to surface when destroying a surface
8640         make the surface released faster in the release ring
8641         as well as clean unneeded reference into the glz
8642
8643         spice: reds: fix uninitlized pointer
8644
8645 2010-04-03  Yonit Halperin  <yhalperi@redhat.com>
8646
8647         client: x11: fix a crash caused by a call to a destroyed window.
8648         Happens when a focused window is destroyed without a focus out event,
8649         and a focus-in event occurs on another window.
8650
8651 2010-04-03  Izik Eidus  <ieidus@redhat.com>
8652
8653         libspice: add off screens support
8654
8655         spice server: surface create/destroy protocol support
8656         Now we can send commands from the server to the client
8657         to destroy surfaces (right now just the primary surface)
8658
8659         Needed for offscreens support)
8660
8661         Another patch`s on the way.
8662
8663 2010-03-24  Alexander Larsson  <alexl@redhat.com>
8664
8665         Rename .so spice-server.so
8666         Also change include dir to "spice-server" for consistency.
8667
8668         libspice.so conflicted with the tclspice package, and its also
8669         a clarification for when we create a spice client library.
8670
8671         Add spice_strndup
8672         Also, make str(n)dup handle NULL correctly
8673
8674         Get rid of more out-of-memory checks
8675         We already check this in spice_malloc now
8676
8677 2010-03-24  Yonit Halperin  <yhalperi@redhat.com>
8678
8679         spice: server: Being more permissive in video identification
8680         In 'filter' video streaming mode, use a more permissive threshold for distinguishing
8681         'realistic' streams from 'textaul'/'artificial' streams. The previous threshold classified
8682         streams that were scaled on the guest as artificial and thus they were not recoginized as videos.
8683
8684 2010-03-24  Alon Levy  <alevy@redhat.com>
8685
8686         spice: client: fix handling of top down images in video streams
8687         Top down streams arrive from x11-qxl driver.
8688
8689 2010-03-24  Yonit Halperin  <yhalperi@redhat.com>
8690
8691         spice: server: avoid video streaming of small images
8692         I added a lower limit to the size of images that are being streamed.
8693         The limit is only active in "filter" video streaming mode.
8694         This will prevent blurry animated icons.
8695
8696 2010-03-24  Alexander Larsson  <alexl@redhat.com>
8697
8698         rename spice.pc to spice-server.pc
8699
8700         configure.ac: client: replace $(top_srcdir) in x11/Makefile.am (subdir config)
8701         Replace all "$(top_srcdir)/common" with "$(SPICE_COMMON_DIR)"
8702         and     all "$(top_srcdir)/client" with custom "$(CLIENTDIR)"
8703
8704         This would (after following patches) enables building the client from
8705         either spice/ (top directory) or spice/client.
8706
8707 2010-03-24  Uri Lublin  <uril@redhat.com>
8708
8709         configure.ac: define SPICE_COMMON_SRCDIR, to be used by Makefile.am (subdir config)
8710         Note that SPICE_COMMON_SRCDIR may be overwritten by configure.ac.shared
8711
8712         autogen: exit upon errors (subdir config)
8713
8714         autogen: add possibly missing AUTOMAKE definition (subdir config)
8715
8716         autogen: remove copied code - srcdir and ORIGDIR (subdir config)
8717
8718 2010-03-18  Alexander Larsson  <alexl@redhat.com>
8719
8720         Fix uninitilized memory read in stroke_fill_spans()
8721         y2 was not initialized
8722
8723 2010-03-18  Gerd Hoffmann  <kraxel@redhat.com>
8724
8725         new libspice api: spice_server_add_get_{sock, peer}_info()
8726
8727         new libspice api: spice_server_add_renderer()
8728
8729 2010-03-18  Yonit Halperin  <yhalperi@redhat.com>
8730
8731         client: add command line support for ciphers, ca file, and host certificate subject
8732
8733 2010-03-17  Alexander Larsson  <alexl@redhat.com>
8734
8735         Default opt flags to -O2
8736         gcc -O3 has some code generation failures due to a combination of
8737         unaligned (packed) structs and vectorization that can cause
8738         a crash in canvas_localize_palette().
8739
8740         And its just safer to use -O2, which is the standard "trusted"
8741         optimization flags.
8742
8743         Use nearest scaling for DRAW_ALPHA_BLEND since this is what win32 needs
8744         DrvAlphaBlend is the only current user of DRAW_ALPHA_BLEND, and its
8745         defined to do nearest (COLORONCOLOR) scaling, not bilinear.
8746
8747         Fix up empty region checks in canvas operations
8748         We rely on not passing on empty rects to the drawing operations by
8749         checking for empty regions and exiting early. However the checks
8750         were wrongly using pixman_region32_n_rects(region) == 0, whereas
8751         we should be using pixman_region32_not_empty().
8752
8753 2010-03-11  Søren Sandmann Pedersen  <ssp@redhat.com>
8754
8755         Explicitly depend on various X libraries, and -pthread
8756         In Fedora 13, the linker doesn't pull in DT_NEEDED libraries anymore,
8757         so we have to list the things that we depend on explicitly.
8758
8759         This affects several X extension libraries, and also the pthread
8760         library.
8761
8762 2010-03-11  Alexander Larsson  <alexl@redhat.com>
8763
8764         Use spice allocator in server/
8765
8766         Use the spice allocator in common/
8767
8768         New memory allocators that exit on OOM and handle multiplication overflow
8769         Every place that does a regular malloc/calloc and aborts on failure
8770         should use spice_malloc/spice_mallo0 instead, which is leaner and cleaner.
8771
8772         Allocations of dynamically sized arrays can use g_malloc_n or g_new etc
8773         which correctly handle multiplication overflow if some of the arguments
8774         are not trusted.
8775
8776 2010-03-10  Alexander Larsson  <alexl@redhat.com>
8777
8778         Define __STDC_LIMIT_MACROS for c++ code to get SIZE_MAX
8779         We need SIZE_MAX for the malloc overflow code, and its not defined
8780         in C++ unless __STDC_LIMIT_MACROS is defined.
8781
8782         Define GL_GLEXT_PROTOTYPES in CFLAGS not in random places in the source
8783
8784         Revert "Fix possible quic_usr_more_lines_unstable() crash"
8785         This reverts commit 34e6a0a0d539fb49a03ec01bf11be505c88fcaa1.
8786
8787         Turns out this wasn't needed and the crash was due to other changes.
8788
8789 2010-03-09  Alexander Larsson  <alexl@redhat.com>
8790
8791         Update gdi canvas wrt latest changes
8792         ALIGN -> SPICE_ALIGN
8793
8794 2010-03-09  Gerd Hoffmann  <kraxel@redhat.com>
8795
8796         new libspice api: add spice_server_set_mouse_absolute()
8797
8798         new libspice api: add spice_server_set_channel_security()
8799
8800         new libspice api: make spice_channel_name_t part of the public api.
8801
8802         new libspice api: add spice_server_{get, set}_image_compression()
8803
8804         new libspice api: make image_compression_t part of the public api.
8805
8806         new libspice api: configure listen addr, add ipv6 suppor
8807
8808         new libspice api: configure tls
8809
8810         new libspice api: zap function pointer indirection.
8811         Make register_*_notifier calls optional, long term they should go away
8812         entriely.  Add direct library calls as replacement.
8813
8814         new libspice api: configure port + ticket
8815         Add new functions to configure spice port and ticketing.  Yes, this is
8816         incomplete, it includes just the most important bits to get something
8817         up'n'running.
8818
8819         These functions are supposed to replace both spice_parse_args() and
8820         the monitor interaction via qterm interface.
8821
8822         new libspice api: alloc, initi and free spice server instances.
8823         The implementation can't handle multiple spice server instances at the
8824         same time right now.  The API allows this though, so if we fixup the
8825         implementation some day we don't have to change the API.
8826
8827         Fix possible quic_usr_more_lines_unstable() crash
8828         quic_usr_more_lines_unstable() assumes it can allways copy a complete
8829         scanline.  Well, it can't.  In case the screen rectangle which needs
8830         updating has an x-offset greater than zero *and* includes the last
8831         scanline of the screen it will overflow the source buffer by
8832         x-offset * bytes-per-pixel bytes.
8833
8834 2010-03-09  Alexander Larsson  <alexl@redhat.com>
8835
8836         Use macros from <spice/macros.h> rather than duplicate them
8837
8838 2010-03-08  Alexander Larsson  <alexl@redhat.com>
8839
8840         Move draw_rop3 to canvas_base
8841
8842         Move canvas_draw_stroke to canvas_base
8843
8844         Move most of the shared draw_xyz() methods from CairoCanvas to CanvasBase
8845         This adds a set of virtual methods for low-level operations. A subclass
8846         can choose to implement those and let the default CanvasBase implementations
8847         handle the highlevel stuff.
8848
8849         Move canvas_region and group_start/end to canvas_base
8850
8851         Move virtualization of canvas drawing into common/canvas_base
8852         Instead of having two virtualizations of the canvas we push the
8853         virtualization into the canvas code itself. This not only avoids
8854         the duplication of this code, it also makes the exposed API for the
8855         canvas much smaller (in terms of exported API).
8856
8857         It also lets us use the virtualization to implement basic support
8858         for operations in canvas_base which is then overridden by each canvas
8859         implementation.
8860
8861         Make virt mapping an interface
8862
8863         Make glz_decoder non-optional canvas_base in canvas constructors
8864         It can still be NULL, but we simplify the headers by always including it.
8865         There is no practical performance difference here.
8866
8867         Make canvas Glz decoder integration nicer
8868         We use a dynamic interface similar to e.g. SpiceImageCache instead
8869         of passing both function and opaque
8870
8871         Fix colorkeying in pixman_utils.c
8872         We were masking out the alpha bit in the key color not int
8873         the source pixel, so colorkeying didn't work when the high byte
8874         was != 0. For instance in the shutdown dialog in XP.
8875
8876 2010-03-05  Alexander Larsson  <alexl@redhat.com>
8877
8878         Fix up win32 build reference to pixman_utils.cpp
8879         It was pointing to the wrong directory for pixman_utils.cpp
8880
8881 2010-03-03  Alexander Larsson  <alexl@redhat.com>
8882
8883         Only use AI_ADDRCONF if availible
8884         AI_ADDRCONF not availible on winXP, so this fixes windows build.
8885
8886 2010-03-01  Larsson@.(none)  <Larsson@.(none)>
8887
8888         Update visual studio project for pixman changes
8889
8890         Make gdi canvas build in the new pixman world
8891
8892         Always include spice/types.h before pixman so standard int types exist
8893
8894         Fix warnings from visual studio compiler
8895
8896         Have only one copy of ROUND macro and cast to int explicitly
8897
8898 2010-02-27  Gerd Hoffmann  <kraxel@redhat.com>
8899
8900         spice client: add ipv6 support.
8901
8902         spice client: fix dns lookup
8903         ignore lookup results which are not ipv4
8904
8905 2010-02-23  Alexander Larsson  <alexl@redhat.com>
8906
8907         Remove qcairo dependency, only use pixman
8908
8909         Remove cairo use in client
8910
8911         Remove no longer needed CAIRO_CANVAS_CACH_IS_SHARED define and code
8912
8913         Remove last cairo use from canvas_base
8914
8915         Remove cairo_t from cairo canvas
8916
8917         Covert cairo canvas put_image() to pixman
8918
8919         Replace custom region implementation with pixman_region32_t
8920         pixman_region32_t is an efficient well tested region implementation (its
8921         the one used in X) that we already depend on via pixman and use in
8922         some places. No need to have a custom region implementation.
8923
8924         Convert cairo canvas clear() to pixman
8925
8926         Convert cairo canvas group_start/end to pixman
8927
8928         Convert cairo canvas read_bits() to pixman
8929
8930         Remove unused cairo helper functions
8931
8932         Convert cairo canvas to use pixman for draw_stroke
8933
8934         Convert cairo canvas draw_transparent to use pixman
8935
8936         Convert cairo canvas draw_rop3 to using pixman
8937
8938         Convert draw_blackness/whiteness/invers to using pixman
8939
8940         Convert cairo canvas alpha_blend to using pixman
8941
8942         Convert cairo canvas draw_text to using pixman
8943
8944         Convert cairo canvas copy bits to pixman
8945
8946         Convert cairo canvas draw_copy() to using pixman
8947         This is just identical to draw_blend().
8948
8949         Convert cairo canvas draw_blend() to using pixman
8950
8951         Convert cairo canvas draw_opaque() to using pixman
8952
8953         Convert cairo canvas draw_fill() to using pixman
8954
8955         Add possibility to not invert bitmask in canvas_get_mask()
8956         This allows the pixman implementation to instead invert the (generally
8957         smaller) region instead of duplicating the bitmap to invert it.
8958
8959         Use pixman_image_t instead of cairo_surface_t as the generic pixman container
8960         This allows us to use the simpler dependency of pixman outside of the
8961         cairo backend, and it later lets us move the cairo backend to using
8962         pixman only.
8963
8964         Turn image and palette cache into c style dynamic interface
8965         Instead of passing a bunch of function pointer and an opaque
8966         pointer we make a real type and add a vtable pointer to it.
8967         This means we can simplify all the canvas constructors, etc.
8968
8969         Add optional templated base class to Cache and SharedCache
8970         We want this for integration with C-style classes.
8971
8972         Add pixman_image_t referencing the cairo_canvas bits
8973         This references the same data as the cairo surface and can be used
8974         for drawing to the surface using direct pixman calls instead.
8975
8976         Add line rasterizer
8977
8978         Add pixman utilities
8979         This includes:
8980          * pixman region from SpiceRects
8981          * rop2 enum
8982          * solid fill
8983          * solid fill with rop
8984          * tiled fill
8985          * tiled fill with rop
8986          * blit
8987          * blit with rop
8988          * copy rect
8989
8990         Add emacs settings for indent according to spice styleguide
8991
8992 2010-02-10  Alexander Larsson  <alexl@redhat.com>
8993
8994         Fix delete vs delete[] mismatches
8995         This fixes a bunch of valgrind warnings.
8996
8997 2010-02-04  Alexander Larsson  <alexl@redhat.com>
8998
8999         Use standard int types and <spice/types.h>
9000
9001         Revert automatic renames that were wrong
9002         Seems my rename script didn't handle C++ namespaces that well.
9003
9004         Use the new header names
9005         I just ran:
9006          find -name "*.[ch]" | xargs sed -i -f ../spice-protocol/includes.sed
9007          find -name "*.cpp" | xargs sed -i -f ../spice-protocol/includes.sed
9008
9009         Rename symbols that were changed in spice-protocol
9010         This is an automatic change using:
9011         $ find -name "*.[ch]" | xargs ../spice-protocol/rename-identifiers.sh ../spice-protocol/renames
9012         $ find -name "*.cpp" | xargs ../spice-protocol/rename-identifiers.sh ../spice-protocol/renames
9013
9014         Remove headers that were moved to spice-protocol
9015
9016         Depend on spice-protocol module
9017         This doesn't actually use the new module, just sets it up for use.
9018
9019         Filter out XIM X events
9020         XIM ClientMessage events to an XIM internal window was triggering
9021         the check for a window message procs. We need to properly filter
9022         events with XFilterEvent to avoid this happening.
9023
9024 2010-01-28  Izik Eidus  <ieidus@redhat.com>
9025
9026         libspice: add surface 0 support
9027         This include alot of infestracture for off screens.
9028
9029 2010-01-11  Yaniv Kamay  <ykamay@redhat.com>
9030
9031         client: change rerror code to be positive
9032
9033         client: add Platform::term_printf
9034         Platform::term_printf is a variant of printf that
9035         on windows dynamically opens console in order to
9036         have visible output during command line processing.
9037
9038         client: fix logger init mix-up
9039
9040         client: move log file to spicec appdata dir
9041
9042 2010-01-11  Yonit Halperin  <yhalperi@redhat.com>
9043
9044         server,client: server authentication for secured channels.
9045         3 available mechanisms:  by public key, by host name, and by certificate subject name.
9046         In the former method, chain of trust verification is not performed.
9047         The CA certificate files are looked for under <spice-config-dir>/spice_truststore.pem
9048
9049         windows <spice-config-dir>=%APPDATA%\spicec\
9050         linux <spice-config-dir>=$HOME/.spicec/
9051
9052 2010-01-07  Arnon Gilboa  <agilboa@redhat.com>
9053
9054         spice: menu additons
9055         -functions: set_name, remove_command, remove_sub, clear
9056         -item state & enum
9057         -add state support in RedWindow insert_command & insert_menu
9058
9059 2010-01-06  Yaniv Kamay  <ykamay@redhat.com>
9060
9061         server: add new vd interface QTerm2Interface
9062
9063 2010-01-06  Arnon Gilboa  <agilboa@redhat.com>
9064
9065         spice: add missing break
9066
9067 2010-01-04  Yaniv Kamay  <ykamay@redhat.com>
9068
9069         client: use spice icon instead-of solidice icon
9070
9071 2009-12-30  Arnon Gilboa  <agilboa@redhat.com>
9072
9073         spice: PKG_CHECK_MODULES: CEGUI version
9074
9075         spice: position mouse in primary monitor center after full screen toggle
9076         -move _focused & _pointer_in_window from RedWindow to RedWindow_p's
9077         -move shadow focus & cursor handling to sync()
9078         -add reset_cursor_pos() to Platform
9079         -Monitor set_mode()/restore() use virtual do_set_mode()/do_restore()
9080
9081         spice: on_activate_screen generates on_key_down for any modifier pressed
9082         -call SetWindowsHookEx(WH_KEYBOARD_LL, LowLevelKeyboardProc...) only once, in RedWindow::init()
9083         -add Application::cleanup_globals() & RedWindow::cleanup()
9084         -cleanup LowLevelKeyboardProc()
9085
9086 2009-12-28  Yaniv Kamay  <ykamay@redhat.com>
9087
9088         client: let PreLoginDialog save and restore LoginDialog
9089
9090         client: remove splash image
9091
9092         client: add GUI infrastructure + functional login dialog
9093
9094         client: add gui res files
9095
9096         client: add soft renderer and cegui
9097
9098         client: smiplify DisconnectedEvent
9099
9100         client: move visibility change logic from screen to app
9101
9102         client: wait for disconnect state in RedClient::connect()
9103
9104         client: improve screen resizing
9105         Screen now have to modes locked and unlocked.
9106
9107         In unlocked mode, the application can change screen size and so
9108         reduce resolution changing. The application can also choose to
9109         change window size while not in full screen mode.
9110
9111         In locked mode the application must ewtain locker screen size
9112         setting.
9113
9114         client: restore mouse capture state after screen resizing
9115
9116         use spaces instead of tabs in bitmap_to_c and icon_to_c output
9117
9118 2009-12-24  Yaniv Kamay  <ykamay@redhat.com>
9119
9120         win client: change avcodec version to 51
9121
9122 2009-12-24  Izik Eidus  <ieidus@redhat.com>
9123
9124         spice: fix server crush in case connecting without qxl device
9125
9126 2009-12-23  Izik Eidus  <ieidus@redhat.com>
9127
9128         spice client: fix wrong gdi-canvas handling of blend_alpha
9129
9130 2009-12-23  Yaniv Kamay  <ykamay@redhat.com>
9131
9132         client: new static title image
9133
9134 2009-12-22  Izik Eidus  <ieidus@redhat.com>
9135
9136         spice: fix ssl compiling errors
9137         (openssl api was changed, so lets have ifdef to compile in all cases)
9138
9139         spice: client: add checks to see if it is safe to use XShem.
9140         Beacuse that XShem internal checks wont fail when using the spice client
9141         from remote, we are adding check on the socket family to see if it is
9142         unix domain socket and fail in case it is not.
9143
9144 2009-12-21  Yaniv Kamay  <ykamay@redhat.com>
9145
9146         spice: sever: increase client timeout
9147         Increase client timeout in order to prevent unnecessary
9148         disconnecting of client while the connection is over WAN.
9149
9150         Tested by changing WinXP resolution (with desktop background) while
9151         connecting over WAN (1.5Mbit 150Kbit)
9152
9153         spice: sever: remove assert on nop copy bits
9154
9155 2009-11-30  Yonit Halperin  <yhalperi@redhat.com>
9156
9157         spice server: heuristic for distinguishing between "real" videos and textual streams
9158
9159 2009-11-30  Yaniv Kamay  <ykamay@redhat.com>
9160
9161         client: KeyHandler now receive unicode char event in addition to RedKey events
9162
9163         client: move scan code translation to InputsChannel
9164
9165         remove unuse Application::is_cad_pressed()
9166
9167         client: split inputs handler
9168
9169         client: interactive screen layer
9170
9171 2009-11-23  Izik Eidus  <ieidus@redhat.com>
9172
9173         spice: server: add memslots support.
9174
9175 2009-11-18  Yaniv Kamay  <ykamay@redhat.com>
9176
9177         add missing alt_image.c to Makefile.am
9178
9179 2009-11-18  Arnon Gilboa  <agilboa@redhat.com>
9180
9181         spice: pass modifiers stroke events down the hook chain
9182
9183         spice: add [pid:tid] to log lines
9184
9185         spice: on toggle_full_screen, generate on_key_down if shift is still pressed
9186
9187 2009-11-17  Arnon Gilboa  <agilboa@agilboa.usersys.redhat.com>
9188
9189         spice: show splash screen on disconnect only on debug
9190
9191 2009-11-16  Yaniv Kamay  <ykamay@redhat.com>
9192
9193         client: change jitter buffer size to 300ms
9194
9195 2009-11-15  Yonit Halperin  <yhalperi@redhat.com>
9196
9197         spice client: sticky Alt activation when holding an Alt key: bug #505912.
9198         Additional changes that were required for the feature:
9199             1) focusing on the pointed window in full screen mode
9200             2) In X11 - handling events that occur during keyboard ungrabbing
9201             3) In X11 - handling Leave/Enter Notify events that occur during keyboard grabbing/ungrabbing
9202             4) In X11 - fix for focus events that are handled in the wrong order (happens when
9203                focus events occur during grabbing the keyboard)
9204             5) In X11 - ignoring key release events during key holding
9205             6) In Windows - synchronizing keyboard release events that occured during a modal loop
9206
9207 2009-11-09  Izik Eidus  <ieidus@redhat.com>
9208
9209         spice: client: gl: fix glx support.
9210         Just move around touch_context and untouch_context to be at the right
9211         places.
9212
9213         client: fix colormap handling.
9214
9215 2009-11-09  Yonit Halperin  <yhalperi@redhat.com>
9216
9217         spice client: tunnel channel - checking that the configuration pipe listener was created before deleting it
9218
9219         spice client: calling the timers during modal loop in Windows
9220
9221         spice client: fixed missing AutoRef
9222
9223         spice client: remove timer interface from platform - use Application (via ProcessLoop interface).
9224
9225 2009-11-09  Izik Eidus  <ieidus@redhat.com>
9226
9227         spice server: fix gl
9228         red_worker: put invalidate at the right places
9229
9230 2009-11-09  Yonit Halperin  <yhalperi@redhat.com>
9231
9232         spice client: cosmetic changes
9233
9234         spice client: Transfer all channels run loop from EventsLoop class to ProcessLoop class
9235
9236         spice client: creating a general process loop.
9237         The process loop is responsible for: 1) waiting for events 2) timers 3) events queue for
9238         actions that should be performed in the context of the thread and are pushed from other threads.
9239         The benefits:
9240         1) remove duplicity: till now, there was one implementaion of events loop for the channels and
9241         another one for the main thread.
9242         2) timers can be executed on each thread and not only on the main thread.
9243         3) events can be pushed to each thread and not only to the main thread.
9244         In this commit, only the main thread was modified to use the new process loop.
9245
9246 2009-10-27  Yaniv Kamay  <ykamay@redhat.com>
9247
9248         fix win client copyright string
9249
9250         fix bad initialization of XDisplay in case crt have more then one output
9251
9252 2009-10-26  Yaniv Kamay  <ykamay@redhat.com>
9253
9254         fix build on Debian
9255
9256 2009-10-25  Izik Eidus  <ieidus@redhat.com>
9257
9258         spice: move create and destroy of the canvas to new place
9259         work around for xlib threaded bugs
9260
9261         spice xclient: move xsync() to be at the right place.
9262
9263 2009-10-18  Yonit Halperin  <yhalperi@redhat.com>
9264
9265         tunnel
9266
9267 2009-10-14  Yaniv Kamay  <ykamay@redhat.com>
9268
9269         change development version to 0.5.0
9270
9271         fresh start