File: ChangeLog

package info (click to toggle)
spice 0.12.5-1+deb8u5
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 17,576 kB
  • ctags: 22,684
  • sloc: ansic: 133,084; cpp: 30,397; sh: 11,648; python: 2,896; makefile: 728
file content (10113 lines) | stat: -rw-r--r-- 397,871 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
8839
8840
8841
8842
8843
8844
8845
8846
8847
8848
8849
8850
8851
8852
8853
8854
8855
8856
8857
8858
8859
8860
8861
8862
8863
8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
8890
8891
8892
8893
8894
8895
8896
8897
8898
8899
8900
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
8911
8912
8913
8914
8915
8916
8917
8918
8919
8920
8921
8922
8923
8924
8925
8926
8927
8928
8929
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940
8941
8942
8943
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989
8990
8991
8992
8993
8994
8995
8996
8997
8998
8999
9000
9001
9002
9003
9004
9005
9006
9007
9008
9009
9010
9011
9012
9013
9014
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
9034
9035
9036
9037
9038
9039
9040
9041
9042
9043
9044
9045
9046
9047
9048
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
9372
9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516
9517
9518
9519
9520
9521
9522
9523
9524
9525
9526
9527
9528
9529
9530
9531
9532
9533
9534
9535
9536
9537
9538
9539
9540
9541
9542
9543
9544
9545
9546
9547
9548
9549
9550
9551
9552
9553
9554
9555
9556
9557
9558
9559
9560
9561
9562
9563
9564
9565
9566
9567
9568
9569
9570
9571
9572
9573
9574
9575
9576
9577
9578
9579
9580
9581
9582
9583
9584
9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9635
9636
9637
9638
9639
9640
9641
9642
9643
9644
9645
9646
9647
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
9658
9659
9660
9661
9662
9663
9664
9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9680
9681
9682
9683
9684
9685
9686
9687
9688
9689
9690
9691
9692
9693
9694
9695
9696
9697
9698
9699
9700
9701
9702
9703
9704
9705
9706
9707
9708
9709
9710
9711
9712
9713
9714
9715
9716
9717
9718
9719
9720
9721
9722
9723
9724
9725
9726
9727
9728
9729
9730
9731
9732
9733
9734
9735
9736
9737
9738
9739
9740
9741
9742
9743
9744
9745
9746
9747
9748
9749
9750
9751
9752
9753
9754
9755
9756
9757
9758
9759
9760
9761
9762
9763
9764
9765
9766
9767
9768
9769
9770
9771
9772
9773
9774
9775
9776
9777
9778
9779
9780
9781
9782
9783
9784
9785
9786
9787
9788
9789
9790
9791
9792
9793
9794
9795
9796
9797
9798
9799
9800
9801
9802
9803
9804
9805
9806
9807
9808
9809
9810
9811
9812
9813
9814
9815
9816
9817
9818
9819
9820
9821
9822
9823
9824
9825
9826
9827
9828
9829
9830
9831
9832
9833
9834
9835
9836
9837
9838
9839
9840
9841
9842
9843
9844
9845
9846
9847
9848
9849
9850
9851
9852
9853
9854
9855
9856
9857
9858
9859
9860
9861
9862
9863
9864
9865
9866
9867
9868
9869
9870
9871
9872
9873
9874
9875
9876
9877
9878
9879
9880
9881
9882
9883
9884
9885
9886
9887
9888
9889
9890
9891
9892
9893
9894
9895
9896
9897
9898
9899
9900
9901
9902
9903
9904
9905
9906
9907
9908
9909
9910
9911
9912
9913
9914
9915
9916
9917
9918
9919
9920
9921
9922
9923
9924
9925
9926
9927
9928
9929
9930
9931
9932
9933
9934
9935
9936
9937
9938
9939
9940
9941
9942
9943
9944
9945
9946
9947
9948
9949
9950
9951
9952
9953
9954
9955
9956
9957
9958
9959
9960
9961
9962
9963
9964
9965
9966
9967
9968
9969
9970
9971
9972
9973
9974
9975
9976
9977
9978
9979
9980
9981
9982
9983
9984
9985
9986
9987
9988
9989
9990
9991
9992
9993
9994
9995
9996
9997
9998
9999
10000
10001
10002
10003
10004
10005
10006
10007
10008
10009
10010
10011
10012
10013
10014
10015
10016
10017
10018
10019
10020
10021
10022
10023
10024
10025
10026
10027
10028
10029
10030
10031
10032
10033
10034
10035
10036
10037
10038
10039
10040
10041
10042
10043
10044
10045
10046
10047
10048
10049
10050
10051
10052
10053
10054
10055
10056
10057
10058
10059
10060
10061
10062
10063
10064
10065
10066
10067
10068
10069
10070
10071
10072
10073
10074
10075
10076
10077
10078
10079
10080
10081
10082
10083
10084
10085
10086
10087
10088
10089
10090
10091
10092
10093
10094
10095
10096
10097
10098
10099
10100
10101
10102
10103
10104
10105
10106
10107
10108
10109
10110
10111
10112
10113
2014-05-19  Christophe Fergeau  <cfergeau@redhat.com>

	Update libtool version information for 0.12.5 release

	Update 'release' instructions in configure.ac
	The instructions are obsolete, replace them with the explanation about
	how to handle current/revision/age from libtool manual:
	https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html

	Update NEWS

2014-05-16  Marc-André Lureau  <marcandre.lureau@gmail.com>

	server: use a warning when disconnecting unresponsive client
	The debug level is not visible by default, since it is an unsolicited
	server behaviour, make it a warning.

2014-05-15  Christophe Fergeau  <cfergeau@redhat.com>

	docs: Fix make distcheck

2014-05-15  소병철  <byungchul.so@samsung.com>

	Use PRI macros in printf to keep compatibility between 32/64bit system
	gcc's some integer type definitions are different between 32/64bit system.
	This causes platform dependency problem with printf function. However,
	we can avoid this problem by using PRI macros that supports platform
	independent printf.

2014-04-16  Christophe Fergeau  <cfergeau@redhat.com>

	Fix submodule reference

	Add missing buffer (re)allocation to reds_sasl_handle_auth_steplen()
	We need to make sure we have a buffer big enough to accomodate the data
	sent by the coming SASL step.

	Call correct SASL helper in reds_handle_auth_sasl_step
	sasl_handle_auth_start() was called instead of reds_sasl_handle_auth_step()

	Add G_GNUC_UNUSED annotations to async_read_handler args
	2 of the arguments are not used, the G_GNUC_UNUSED annotation will make
	this explicit.

	Make struct AsyncRead/async_read_handler private
	All users are now contained in reds_stream.c

	Remove RedLinkInfo::async_read
	9feed69 moved the async reader code to RedsStream so that it can be used
	for the SASL authentication code. In particular, it introduced a
	RedsStream::async_read member which is used by the SASL authentication code
	for its async operations.

	However, what was not done is to remove the now redundant
	RedLinkInfo::async_read field. This causes failures when using SASL
	authentication as the async read error callback is getting set
	on the RedLinkInfo::async_read structure, but then the SASL code is trying
	to use the RedeStream::async_read structure for its async IOs, which do not
	have the needed error callback set.

	This commit makes use of the newly introduced reds_stream_async_read()
	helper in order to make use of RedsStream::async_read.

	Call AsyncRead variables 'async' instead of 'obj'
	This is a more explicit name.

	Add reds_stream_set_async_error_handler() helper
	This replaces async_read_set_error_handler() which was unused. This sets a
	callback to be called when an async operation fails.

	We could pass the error_handler to each reds_stream_async_read() call, but as
	we will be using the same one for all async calls, it's more convenient to set it
	once and for all.
	AsyncRead is going to be private to reds_stream.c in one of the next
	commits, and the error handler will need to be set from reds.c,
	hence the move to a public RedsStream method.

	Introduce reds_stream_async_read() helper
	This will allow to make RedsStream::async_read private

	build-sys: Fix VPATH builds
	Fixing this is a matter of picking the spice-common fix to generate the
	(de)marshaller source files in the right place, and to adjust the compiler
	flags to look for includes in the build directory as well.

	Fix --without-sasl build
	There are 2 SASL-related function prototypes which are unused in the
	--without-sasl case. They cause a warning, and a build failure
	when using -Werror. Wrapping them in #if HAVE_SASL avoids this issue.

	doc: Generate chunked manual
	This commit makes use of a2x in order to generate a chunked manual in
	addition to the "all in one page" one.

2014-03-25  Marc-André Lureau  <marcandre.lureau@gmail.com>

	manual: improve text about ~/Public

2014-03-20  Christophe Fergeau  <cfergeau@redhat.com>

	Check RSA_generate_key_ex return value
	This can fail in fips mode for example. If we ignore the failure, we'll get
	a crash:

	 #0  0x00007f38d63728a0 in BN_num_bits () from /lib64/libcrypto.so.10
	 #1  0x00007f38d639661d in RSA_size () from /lib64/libcrypto.so.10
	 #2  0x00007f38d7991762 in reds_handle_read_link_done () from /lib64/libspice-server.so.1
	 #3  0x00007f38d7990c06 in spice_server_add_client () from /lib64/libspice-server.so.1
	 #4  0x00007f38d7990c6a in reds_accept () from /lib64/libspice-server.so.1
	 #5  0x00007f38dc0d2946 in qemu_iohandler_poll (pollfds=0x7f38dedce200, ret=755449965, ret@entry=1) at iohandler.c:143
	 #6  0x00007f38dc0d6ea8 in main_loop_wait (nonblocking=<optimized out>) at main-loop.c:465
	 #7  0x00007f38dbffd7c0 in main_loop () at vl.c:1988
	 #8  main (argc=<optimized out>, argv=<optimized out>, envp=<optimized out>) at vl.c:4357

	This commit will cause the client connection to fail but qemu won't
	segfault.

2014-03-20  David Gibson  <dgibson@redhat.com>

	Don't truncate large 'now' values in _spice_timer_set
	static void _spice_timer_set(SpiceTimer *timer, uint32_t ms, uint32_t now)

	The _spice_timer_set() function takes a 32-bit integer for the "now" value.
	The now value passed in however, can exceed 2^32 (it's in ms and derived
	from CLOCK_MONOTONIC, which will wrap around a 32-bit integer in around 46
	days).

	If the now value passed in exceeds 2^32, this will mean timers are inserted
	into the active list with expiry values before the current time, they will
	immediately trigger, and (if they don't make themselves inactive) be
	reinserted still before the current time.

	This leads to an infinite loop in spice_timer_queue_cb().

	https://bugzilla.redhat.com/show_bug.cgi?id=1072700

2014-03-19  Marc-André Lureau  <marcandre.lureau@gmail.com>

	Update spice-common

	manual: fix xml highlighting

	manual: add folder sharing section

	Translate docbook -> asciidoc
	It's much much easier to read and edit, and the end results looks better
	as well, see http://elmarco.fedorapeople.org/manual.html

	Associate org.spice-space.webdav.0 port to webdav channel
	For example, with qemu, a webdav channel can be created this way:

	 -chardev spiceport,name=org.spice-space.webdav.0,...

	And redirected to a virtio port:

	 -device virtserialport,...,name=org.spice-space.webdav.0

	build-sys: simplify manual html generation

	SpiceUserManual.xml: small clean-ups
	Remove some non-conventional/non-freesoftware editor-specific lines.

	Remove trailing whitespaces

	Get rid of DTD, which is too strict for docbook, see also:
	http://docbook.org/tdg5/en/html/ch02.html

	This get rids of the following warning/error:

	I/O error : Attempt to load network entity
	http://docbook.org/xml/5.0/dtd/docbook.dtd
	/home/elmarco/src/spice/spice-master/docs/manual/SpiceUserManual.xml:4:
	warning: failed to load external entity
	"http://docbook.org/xml/5.0/dtd/docbook.dtd"
	          "http://docbook.org/xml/5.0/dtd/docbook.dtd">
	                                                       ^

2014-03-13  Christophe Fergeau  <cfergeau@redhat.com>

	Fix test_capability() typo
	It was spelt 'capabilty'

	Fix typo in log message

	mjpeg: Don't warn on unsupported image formats
	When trying to start mjpeg compression mode, mjpeg_encoder_start_frame()
	tests the image format as its only able to compress 24/32bpp images. On
	images with lower bit depths, we return MJPEG_ENCODER_FRAME_UNSUPPORTED to
	indicate this is not a format we can compress. However, this return goes
	with a spice_warning("unsupported format"). As the rest of the code can
	cope with this unsupported format by not doing mjpeg compression, it's
	nicer to downgrade this spice_warning() to spice_debug().

	This fixes https://bugzilla.redhat.com/show_bug.cgi?id=1070028

2014-01-20  Christophe Fergeau  <cfergeau@redhat.com>

	Add reference manual
	This manual documents how to enable/use various SPICE features when
	creating a VM by running QEMU directly, or when using libvirt, or when
	using virt-manager.
	This is based on work by Lubos Kocman

	Make RedsStream::info private

	Introduce reds_stream_set_channel()

	Introduce reds_stream_set_info_flag()

	Make RedsStream::async_read private

	Make RedsStream::sasl private

	Make RedsStream read/write functions private

	Make RedsStream::ssl private

	Introduce reds_stream_is_ssl()

	Add RedsStream::priv
	The private data is allocated at the same time as RedsStream and
	goes immediatly after the main RedsStream data.
	This private member will allow to hide internal RedsStream
	implementation details from the rest of spice-server.

	Move SASL authentication to reds_stream.h
	SASL authentication mostly use members from RedsStream to do its work, so
	it makes sense to have its code in reds_stream.c. This should allow to make
	RedsStream::sasl private in the future.

	Move async code to RedsStream
	The AsyncRead structure in reds.h wraps an async read + callback to
	be done on a stream. Moving it to reds_stream.h is needed in order
	to move SASL authentication there.

	Move stream read/write callbacks to reds_stream.c
	Now that stream creation and SSL enabling are done by helpers
	in reds_stream.c, we can move the initialization of the vfunc
	read/write pointers there too.

	Introduce reds_stream_new() helper
	Initializing a new stream means initializing quite a few fields.
	This commit factors this initialization in a dedicated reds_stream_new
	helper. This also helps moving more code from reds.c to reds_stream.c

	reds: Move SSL-related code to RedsStream
	Code to initiate a SSL stream belongs there

	Move sync_write* to reds_stream.h
	They are renamed to reds_stream_write*

	Add reds_stream.[ch]
	Gather common RedsStream code there rather than having it
	in reds.c

	Move SPICE_GNUC_VISIBLE to red_common.h

2014-01-02  Christophe Fergeau  <cfergeau@redhat.com>

	tests: Avoid malloc failures
	test-display-streaming is calling malloc() without checking its return
	value. Coverity warns about this. This commit switches to g_malloc() to
	sidestep this warning (g_malloc() never returns NULL but aborts instead).

	tests: Remove unused variables
	coverity spotted some variables that were declared but not used in
	server/tests

2014-01-02  Jeremy White  <jwhite@codeweavers.com>

	Fix typo; sampel --> sample

	Add support for the Opus codec

	Revise the spice client and server to use the new snd_codec functions in spice-common.
	This makes celt optional, and paves the way to readily add additional codecs.

2013-12-12  David Jaša  <djasa@redhat.com>

	Use TLS version 1.0 or better
	When creating a TLS socket, both spice-server and spice-gtk currently
	call SSL_CTX_new(TLSv1_method()). The TLSv1_method() function set the
	protocol version to TLS 1.0 exclusively. The correct way to support
	multiple protocol versions is to call SSLv23_method() in spite of its
	scary name. This method will enable all SSL/TLS protocol versions. The
	protocol suite may be further narrowed down by setting respective
	SSL_OP_NO_<version_code> options of SSL context.  This possibility is
	used in this patch in order to block use of SSLv3 that is enabled by
	default in openssl for client sockets as of now but spice has never used
	it.

2013-12-11  Christophe Fergeau  <cfergeau@redhat.com>

	Remove empty red_time.c

	Add red_time.h to Makefile.am
	This file was added in bc50ff076 a few months ago, but is not listed
	in Makefile.am, and thus not part of tarballs. However, it's being included
	from other C files, so not having it causes compilation breakage.

	Update git-version-gen to latest version
	Pick the latest git-version-gen version from
	http://git.savannah.gnu.org/cgit/gnulib.git/plain/build-aux/git-version-gen

	Add .version to EXTRA_DIST
	Newer versions of git-version-gen document that it should be done, and
	builddir != srcdir builds are broken if it's not present in the tarball as
	we'd attempt to generate this file in the read-only source directory (if
	the source dir is read-only)

	Fix snappy detection with newer spice-gtk
	It was renamed to spicy-screenshot

2013-11-04  Christian Ruppert  <idl0r@qasl.de>

	Require alsa only with --enable-client
	Hey guys,

	the alsa libraries/header seem to be required only when configured with
	--enable-client so I wrote a patch to make configure respect it.

	--
	Regards,
	Christian Ruppert

	From 53683cc75ba092799f856f710cb45b2aacfb6123 Mon Sep 17 00:00:00 2001
	From: Christian Ruppert <idl0r@gentoo.org>
	Date: Sun, 3 Nov 2013 18:36:26 +0100
	Subject: [PATCH] Require alsa only with --enable-client

2013-10-30  Christophe Fergeau  <cfergeau@redhat.com>

	Fix buffer overflow when decrypting client SPICE ticket
	reds_handle_ticket uses a fixed size 'password' buffer for the decrypted
	password whose size is SPICE_MAX_PASSWORD_LENGTH. However,
	RSA_private_decrypt which we call for the decryption expects the
	destination buffer to be at least RSA_size(link->tiTicketing.rsa)
	bytes long. On my spice-server build, SPICE_MAX_PASSWORD_LENGTH
	is 60 while RSA_size() is 128, so we end up overflowing 'password'
	when using long passwords (this was reproduced using the string:
	'fullscreen=1proxy=#enter proxy here; e.g spice_proxy = http://[proxy]:[port]'
	as a password).

	When the overflow occurs, QEMU dies with:
	*** stack smashing detected ***: qemu-system-x86_64 terminated

	This commit ensures we use a corectly sized 'password' buffer,
	and that it's correctly nul-terminated so that we can use strcmp
	instead of strncmp. To keep using strncmp, we'd need to figure out
	which one of 'password' and 'taTicket.password' is the smaller buffer,
	and use that size.

	This fixes rhbz#999839

2013-10-28  Christophe Fergeau  <cfergeau@redhat.com>

	Remove tunneling support
	It's depending on an unmaintained package (slirp), and I don't
	think anyone uses that code. It's not tested upstream nor in fedora,
	so let's remove it.

	Silence gcc false positive with -Wuninitialized
	Some versions of gcc warn about:
	red_channel.c: In function 'red_channel_client_wait_outgoing_item':
	red_channel.c:2331: error: 'end_time' may be used uninitialized in this function [-Wuninitialized]
	red_channel.c: In function 'red_channel_client_wait_pipe_item_sent':
	red_channel.c:2363: error: 'end_time' may be used uninitialized in this function [-Wuninitialized]
	red_channel.c: In function 'red_channel_wait_all_sent':
	red_channel.c:2401: error: 'end_time' may be used uninitialized in this function [-Wuninitialized]

	This is a false positive as end_time is unitialized when timeout is -1, and
	we will only try to use end_time if timeout is not -1.

	This commit initializes end_time to UINT64_MAX to avoid that warning. As
	the test involving end_time will never be reached, we ensure it's always
	TRUE so that it would be a noop even if it was reached.

2013-10-18  Axel Lin  <axel.lin@ingics.com>

	red_tunnel_worker: Fix build error due to missing monitor_latency argument
	Fix missing monitor_latency argument in red_channel_client_create call.

2013-10-10  Christophe Fergeau  <cfergeau@redhat.com>

	Use latest warnings.m4 from gnulib
	This fixes at least some issues when building with clang

	Use hardened linker flags if available
	This commit reuse several macros from libvirt to test for
	support for "-Wl,-z -Wl,relro", "-Wl,-z -Wl,now" and
	"-Wl,--no-copy-dt-needed-entries", and use them if available.

	Don't ignore all of m4/ in .gitignore
	m4/ contains several files tracked in git, so we should not ignore
	the whole directory.

2013-10-09  Christophe Fergeau  <cfergeau@redhat.com>

	Fix PlaybackeCommand typo

2013-10-09  Jeremy White  <jwhite@codeweavers.com>

	Fix an overlooked x11 client case.

2013-10-08  Marc-André Lureau  <marcandre.lureau@gmail.com>

	reds: remove dead code

2013-10-08  Christophe Fergeau  <cfergeau@redhat.com>

	reds: Fix 'asyc' typo

	Fix 'recive' typo throughout the code base
	'receive' was mispelt 'recive' in multiple places.

	Namespace RECEIVE_BUF_SIZE

2013-10-07  Marc-André Lureau  <marcandre.lureau@gmail.com>

	server: handle red_get_surface_cmd() error explicitely
	Don't ignore red_get_surface_cmd() error, and explicitely interrupt and
	free cmd before processing.

	server: plug some leaks on error
	Plug what looks like memory leaks, that could be potentially be
	triggered by a misbehaving guest.

	server: inputs s/relase/release

	server: release all pressed keys on client disconnect
	Releasing modifiers keys unconditionally on disconnect leads to
	unexpected guest wakeups. To improve the situation, the server can
	release only the pressed keys, which will prevent the wakeup in most
	cases.

	Furthermore, it's not sufficient to release only the modifiers keys.
	Any key should be released on client disconnect to avoid sticky key
	press across connections.

	https://bugzilla.redhat.com/show_bug.cgi?id=871240

	server: mark deprecated symbols

	server/tests: avoid using deprecated symbols

	server: set dispatcher before calling attache_worker
	This allows to call spice_qxl_add_memslot during attache_worker(), like
	done in the tests.

	Update spice-common

2013-10-01  Marc-André Lureau  <marcandre.lureau@gmail.com>

	server: remove memslot unused functions

2013-09-30  Marc-André Lureau  <marcandre.lureau@gmail.com>

	cleanup: remove GITVERSION
	This file is unneeded since d986fb46

	server: remove unused fill_rects_clip
	Unused since 62d0c076eb2eb0f9954c3870f31b4dd685e5f95c.

	spicec: disable stencil test with primary fbo
	The primary buffer doesn't use stencil test. However, this should be
	explicitely disabled, since the canvas might change stencil state, and
	this will affect primary stencil buffer, making some of further update
	operations clipped in unwanted ways.

	spicec: use pre/post copy
	Ensure the GL state is appropriate for calling GCanvas::copy_pixels.

	spicec: add sw canvas diff check
	Setting CHECKDIFF=1 environment variable will compare the rendering of
	the selected canvas with a software canvas. This is useful for debugging
	some rendering issues, however it is far from being perfect, since it's
	not able to tell whether one or the other is actually faulty. It's a
	strong indication though of which operations are incorrect.

	Ideally, all operations should be checked, however, a few of them are
	disabled by default because they fail all the time, and it looks like
	pixman is not very accurate for blending/compositing (at least visually,
	it seems gl has better rendering)

	spicec: do not abort if cache error

	spicec: add SPICE_NOGRAB
	Similar to spice-gtk, disable mouse and keyboard grab (useful when
	running under a debugger)

	spicec: remove dead GL code

	spicec: use doublebuffer for opengl
	This visually reduces glitches without noticeable speed difference.

	It's also the traditionnal way of doing opengl.

	spicec: fix non-doublebuffer drawing
	First, context must set it, then Draw/ReadBuffer must be set to FRONT,
	and then explicit Flush is needed.

	This patch is mostly for future reference, it is mostly discarded in
	following patch using double-buffer.

	spicec: use standard opengl 3.0 framebuffer

	spicec: refresh the display after display resize

	spicec: warn when throwing exception
	This helps to identify the code location of exception

	update spice-common

2013-09-26  Yonit Halperin  <yhalperi@redhat.com>

	red_worker: disconnect the channel instead of shutdown in case of a blocking method failure
	rhbz#1004443

	The methods that trigger waitings on the client pipe require that
	the waiting will succeed in order to continue, or otherwise, that
	all the living pipe items will be released (e.g., when
	we must destroy a surface, we need that all its related pipe items will
	be released). Shutdown of the socket will eventually trigger
	red_channel_client_disconnect (*), which will empty the pipe. However,
	if the blocking method failed, we need to empty the pipe synchronously.
	It is not safe(**) to call red_channel_client_disconnect from ChannelCbs
	, but all the blocking calls in red_worker are done from callbacks that
	are triggered from the device.
	To summarize, calling red_channel_client_disconnect instead of calling
	red_channel_client_shutdown will immediately release all the pipe items that are
	held by the channel client (by calling red_channel_client_pipe_clear).
	If red_clear_surface_drawables_from_pipe timeouts,
	red_channel_client_disconnect will make sure that the surface we wish to
	release is not referenced by any pipe-item.

	(*) After a shutdown of a socket, we expect that later, when
	red_peer_handle_incoming is called, it will encounter a socket
	error and will call the channel's on_error callback which calls
	red_channel_client_disconnect.

	(**) I believe it was not safe before commit 2d2121a17038bc0 (before adding ref
	count to ChannelClient). However, I think it might still be unsafe, because
	red_channel_client_disconnect sets rcc->stream to NULL, and rcc->stream
	may be referred later inside a red_channel_client method unsafely. So instead
	of checking if (stream != NULL) after calling callbacks, we try to avoid
	calling red_channel_client_disconnect from callbacks.

	red_channel: cleanup of red_channel_client blocking methods
	(1) receive timeout as a parameter.
	(2) add a return value and pass the handling
	    of failures to the calling routine.

	red_worker: cleanup red_clear_surface_drawables_from_pipes
	(1) merge 'force' and 'wait_for_outgoing_item' to one parameter.
	    'wait_for_outgoing_item' is a derivative of 'force'.
	(2) move the call to red_wait_outgoing_item to red_clear_surface_drawables_from_pipe

2013-09-17  Marc-André Lureau  <marcandre.lureau@gmail.com>

	build-sys: fix some automake warning
	client/Makefile.am:199: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
	server/tests/Makefile.am:3: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')

2013-09-10  Dunrong Huang  <riegamaths@gmail.com>

	Fix _FORTIFY_SOURCE redefine error
	If the _FORTIFY_SOURCE has been already defined, we shouldn't redefine
	it, or it will raise a build error as below:

	In file included from agent-msg-filter.c:21:0:
	../config.h:17:0: error: "_FORTIFY_SOURCE" redefined [-Werror]
	agent-msg-filter.c:1:0: note: this is the location of the previous definition

	Suggested-by: Christophe Fergeau <cfergeau@redhat.com>

2013-09-02  Christophe Fergeau  <cfergeau@redhat.com>

	red_parse_qxl: Change spice_error() to spice_warning()
	After eb09c25c, red_parse_qxl.c still has some spice_error() which
	will kill the server even though the code is trying to return an error
	when the spice_error() is hit.
	This commit replaces these occurrences with a spice_warning() which
	will not kill spice-server.

2013-09-02  Uri Lublin  <uril@redhat.com>

	server: bitmap_consistent: replace spice_error with spice_warning
	bitmap_consistent should return true or false.
	Currently it aborts instead of returning false, due to spice_error.
	Replacing spice_error with spice_warning, provides information and returns
	false, as expected.

	This fixes Fedora bz#997932

2013-08-29  Alon Levy  <alevy@redhat.com>

	client: add some missing USE_GUI define guards

2013-08-22  Yonit Halperin  <yhalperi@redhat.com>

	red_worker: fix call to dump_bitmap (too many args)

	spice_bitmap_utils: fix dump_bitmap

2013-08-14  Yonit Halperin  <yhalperi@redhat.com>

	main_channel: monitoring client connection status
	rhbz#994175

	Start monitoring if the client connection is alive after completing
	the bit-rate test.

	red_channel: add option to monitor whether a channel client is alive
	rhbz#994175

	When a client connection is closed surprisingly (i.e., without a FIN
	segment), we cannot identify it by a socket error (which is the only
	way by which we identified disconnections so far).
	This patch allows a channel client to periodically check the state of
	the connection and identify surprise disconnections.

	red_channel: add on_input callback for tracing incoming bytes
	The callback will be used in the next patch.

	spice_timer_queue: don't call timers repeatedly
	For channels that don't run as part of the main loop, we use
	spice_timer_queue, while for the other channels we use
	qemu timers support. The callbacks for setting timers are supplied to
	red_channel via SpiceCoreInterface, and their behavior should be
	consistent. qemu timers are called only once per each call to
	timer_start. This patch assigns the same behaviour to spice_timer_queue.

2013-08-14  Alon Levy  <alevy@redhat.com>

	server: split spice_image_cache from red_worker

	server/red_worker: s/image_cache_eaging/image_cache_aging/

	server: move surface_format_to_image_type to spice_bitmap_utils

	server: s/red_wait_all_sent/red_channel_wait_all_sent/

	server: move three functions to red_channel
	Three blocking functions, one was split to leave the display channel
	specific referencing of the DrawablePipeItem being sent inside
	red_worker, but the rest (most) of the timeout logic was moved to
	red_channel, including the associated constants.

	Moved functions:
	red_channel_client_wait_pipe_item_sent
	red_wait_outgoing_item
	red_wait_all_sent

	Introduces red_time.h & red_time.c for a small helper function dealing
	with time.h

	server: move bit set/clear utilities out of red_worker.h

	server: move dump_bitmap to separate file

	server/red_worker.c:red_process_drawable: rename item to drawable

	server/red_worker.c:red_process_drawable: rename drawable to red_drawable

	red_worker: mark DRAW_ALL as broken
	setting DRAW_ALL define doesn't produce correct rendering. Using
	update_area instead of red_draw_qxl_drawable will work but it shouldn't
	be required. This is not work I intend to do right now, so marking it
	for anyone looking at this in the future.

2013-08-06  Yonit Halperin  <yhalperi@redhat.com>

	red_worker: decrease the timeout when flushing commands and waiting for the client.
	150 seconds is way too long period for holding the guest driver and
	waiting for a response for the client. This timeout was 15 seconds, but
	when off-screen surfaces ware introduced it was arbitrarily multiplied by
	10.
	Other existing related bugs emphasize why it is important to decrease
	the timeout:
	(1) 994211 - the qxl driver waits for an async-io reponse for 60 seconds
	    and after that, it switches to sync-io mode. Not only that the
	    driver might use invalid data (since it didn't wait for the query to
	    complete), falling back to sync-io mode introduces other errors.
	(2) 994175 - spice server sometimes doesn't recognize that the client
	             has disconnected.
	(3) There might be cache inconsistency between the client and the server,
	and then the display channel waits indefinitely for a cache item (e.g., bug
	977998)

	This patch changes the timeout to 30 seconds. I tested it under wifi +emulating 2.5Mbps network,
	together with playing video on the guest and changing resolutions in a loop. The timeout didn't expired
	during my tests.

	This bug is related to rhbz#964136 (but from rhbz#964136 info it is still not
	clear why the client wasn't responsive).

2013-07-29  Yonit Halperin  <yhalperi@redhat.com>

	log: improve debug information related to client disconnection

	snd_worker/snd_disconnect_channel: don't call snd_channel_put if the channel has already been disconnected
	The snd channels has one reference as long as their socket is active.
	The playback channel has an additional reference for each frame that is
	currently filled by the sound device.
	Once the channel is disconnected (the socket has been freed and the
	first reference is released) snd_disconnect_channel shouldn't release
	a reference again.

	snd_worker: fix memory leak of PlaybackChannel
	When the sequence of calls bellow occurs, the PlaybackChannel
	is not released (snd_channel_put is not called for the
	samples that refer to the channel).

	    spice_server_playback_get_buffer
	    snd_channel_disconnect
	    spice_server_playback_put_samples

	reds: s/red_client_disconnect/red_channel_client_shutdown inside callbacks
	When we want to disconnect the main channel from a callback, it is
	safer to use red_channel_client_shutdown, instead of directly
	destroying the client. It is also more consistent with how other
	channels treat errors.
	red_channel_client_shutdown will trigger socket error in the main channel.
	Then, main_channel_client_on_disconnect will be called,
	and eventually, main_dispatcher_client_disconnect.

	I didn't replace calls to reds_disconnect/reds_client_disconnect in
	places where those calls were safe && that might need immediate client
	disconnection.

	decouple disconnection of the main channel from client destruction
	Fixes rhbz#918169

	Some channels make direct calls to reds/main_channel routines. If
	these routines try to read/write to the socket, and they get socket
	error, main_channel_client_on_disconnect is called, and triggers
	red_client_destroy. In order to prevent accessing expired references
	to RedClient, RedChannelClient, or other objects (inside the original call, after
	red_client_destroy has been called) I made the call to
	red_client_destroy asynchronous with respect to main_channel_client_on_disconnect.
	I added MAIN_DISPATCHER_CLIENT_DISCONNECT to main_dispatcher.
	main_channel_client_on_disconnect pushes this msg to the dispatcher,
	instead of calling directly to reds_client_disconnect.

	The patch uses RedClient ref-count in order to handle a case where
	reds_client_disconnect is called directly (e.g., when a new client connects while
	another one is connected), while there is already CLIENT_DISCONNECT msg
	pending in the main_dispatcher.

	Examples:
	(1) snd_worker.c

	    snd_disconnect_channel()
	        channel->cleanup() //snd_playback_cleanup
	            reds_enable_mm_timer()
	                .
	                .
	                main_channel_push_multi_media_time()...socket_error
	                    .
	                    .
	                    red_client_destory()
	                        .
	                        .
	                        snd_disconnect_channel()
	                            channel->cleanup()
	                                celt051_encoder_destroy()
	            celt051_encoder_destory() // double release

	Note that this bug could have been solved by changing the order of
	calls: e.g., channel->stream = NULL before calling cleanup, and
	some other changes + reference counting. However, I found other
	places in the code with similar problems, and I looked for a general
	solution, at least till we redesign red_channel to handle reference
	counting more consistently.

	(2) inputs_channel.c

	    inputs_connect()
	        main_channel_client_push_notify()...socket_error
	                .
	                .
	            red_client_destory()
	                .
	                .
	        red_channel_client_create() // refers to client which is already destroyed

	(3) reds.c

	    reds_handle_main_link()
	       main_channel_push_init() ...socket error
	                .
	                .
	            red_client_destory()
	                .
	                .
	       main_channel_client_start_net_test(mcc) // refers to mcc which is already destroyed

	    This can explain the assert in rhbz#964136, comment #1 (but not the hang that occurred before).

	main_dispatcher: add ref count protection to RedClient instances

	red_channel: add ref count to RedClient

	red_channel: prevent adding and pushing pipe items after a channel_client has diconnected
	Fixes: leaks of pipe items & "red_client_destroy: assertion `rcc->send_data.size == 0'"

	red_channel_disconnect clears the pipe. It is called only once. After,
	it was called, not items should be added to the pipe.

	An example of when this assert can occur:
	on_new_cursor_channel (red_worker.c), pushes 2 pipe items.
	When it pushes the first pipe item, if the client has disconnected,
	it can hit a socket error, and then, red_channel_client_disconnect is called.
	The second call to adding a pipe item, will add the item to
	the pipe. red_channel_client_pipe_add_type also calls
	red_channel_client_push, which will update the send_data.size.
	Then, the push will also hit a socket error, but red_channel_client_disconnect
	won't clear the pending pipe item again, since it was already called.
	When red_client_destory is called, we hit assertion `rcc->send_data.size
	== 0'.
	Note that if a pipe item is added to the pipe after
	red_channel_client_disconnect was called, but without pushing it,
	we should hit "spice_assert(rcc->pipe_size == 0)".

2013-07-28  Alon Levy  <alevy@redhat.com>

	server/red_channel: fix unused variable
	unused variable 'so_unsent_size' [-Werror=unused-variable]

2013-07-24  Alon Levy  <alevy@redhat.com>

	server/red_worker.c: remove unused pipe_item_remove

2013-07-22  Nahum Shalman  <nshalman@elys.com>

	TIOCOUTQ -> SIOCOUTQ and portability ifdefs
	The ioctl on sockets is actually named SIOCOUTQ though its value
	is identical to TIOCOUTQ which is for terminals.
	SIOCOUTQ is linux specific so we add a header check and ifdef based
	on the presence of the header
	This prevents bogus ioctls on non-Linux platforms

	configure.ac comment typo nit

2013-07-17  Uri Lublin  <uril@redhat.com>

	Release 0.12.4

	Update spice-common submodule (get spice-protocol 0.12.6)

	syntax-check: trailing whitespaces -- ignore binary files

2013-07-16  Uri Lublin  <uril@redhat.com>

	syntax-check: remove trailing whitespaces
	Only whitespace changes in this commit.

	syntax-check: make sure config.h is the first included .h file

	syntax-check: use test A && test B instead of test A -a B

	syntax-check: fix no-newline or empty line at EOF

	syntax-check: s/the the/the/ in a comment

	syntax-check: update AUTHORS

	syntax-check: fix cast_of_argument_to_free
	In this case, make syntax-check is wrong, and we actually do
	need the cast.
	A cast is needed when types are   uint64_t <--> pointer

	Using a local "ptr" variable makes both gcc and syntax-check happy.

	syntax-check: fix avoid_if_before_free

	server/tests: fix timer for test_empty_success

	server/tests: test_display_width_stride: add destroy command
	Otherwise, the test exits after the first iteration over all tests,
	on the second attempt to create an already created surface.

	server/tests: remove option from usage if AUTOMATED_TESTS is not configured

	server/tests: invalid-option: print the bad argument
	optind points to the next argument to parse.

	server/tests: fix produce_command for create surface
	Earlier in this function, test->target_surface is set to 1, which
	is the only allowed non-primary surface currently.

	If surface parameters are given (and specifically data is checked)
	they are being used, otherwise a default surface is used.

	Earlier in this function, "command" is set to a non-NULL value.
	Thus, the else part was unreachable code, which is fixed now.

	server/tests: test_display_base: set rect according to appropriate surface
	When surface_id == 0, primary is used.
	Otherwise (currently 1), secondary is used.

	Also, remove unused test_width and test_height.
	Since commit caea7699434c20dceef8fc79d21b8eeb663fbf53,
	test->width and test->height are used.

	red_channel: replace RING_FOREACH with RING_FOREACH_SAFE in some places
	This was originally intended to fix the problem fixed by
	commit 53488f0275d6c8a121af49f7ac817d09ce68090d.

	What is left are FOREACH loops that are at less risk and maybe safe (no
	read/write or disconnect/destroy are called from within them).

	red_worker: use a generic SAFE_FOREACH macro
	Introduce SAFE_FOREACH macro

	Make other safe iterators use SAFE_FOREACH

	red_worker: delete unused CCC_FOREACH

	red_worker: make DRAWABLE_FOREACH_DPI safe

	red_worker: use only DRAWABLE_FOREACH_GLZ_SAFE

	red_worker: make WORKER_FOREACH_DCC safe
	Specifically, the loop in red_pipes_add_draw can cause spice to abort.

	In red_worker.c (WORKER_FOREACH_DCC):
	  red_pipes_add_drawable
	    red_pipe_add_drawable
	      red_handle_drawable_surfaces_client_synced
	        red_push_surface_image
	          red_channel_client_push
	            red_channel_client_send
	              red_peer_handle_outgoing
	                reds_stream_writev (if fails -- EPIPE)
	                handler->cb->on_error = red_channel_client_disconnect()
	                  red_channel_remove_client()
	                  ring_remove() -- of rcc from channel.clients ring.

	red_worker: reuse DCC_FOREACH in WORKER_DCC_FOREACH
	The only thing that is needed is to get the channel out of the worker.

	red_worker: use only RCC_FOREACH_SAFE
	RCC_FOREACH may be dangerous

	The following patches replace FOREACH loops with a SAFE version.
	Using unsafe loops may cause spice-server to abort (assert fails).
	Specifically a read/write fail in those loops, may cause the client
	to disconnect, removing the node currently iterated, which cause spice
	to abort in ring_next():
	 -- assertion `pos->next != NULL && pos->prev != NULL' failed

2013-07-05  David Gibson  <david@gibson.dropbear.id.au>

	Use RING_FOREACH_SAFE in red_channel.c functions which are missing it
	Currently, both red_channel_pipes_add_type() and
	red_channel_pipes_add_empty_msg() use plaing RING_FOREACH() which is not
	safe versus removals from the ring within the loop body.

	Although it's rare, such a removal can occur in both cases.  In the case
	of red_channel_pipes_add_type() we have:
	    red_channel_pipes_add_type()
	    -> red_channel_client_pipe_add_type()
	        -> red_channel_client_push()

	And in the case of red_channel_client_pipes_add_empty_msg() we have:
	    red_channel_client_pipes_add_empty_msg()
	    -> red_channel_client_pipe_add_empty_msg()
	        -> red_channel_client_push()

	But red_channel_client_push() can cause a removal from the clients ring if
	a network error occurs:
	    red_channel_client_push()
	    -> red_channel_client_send()
	        -> red_peer_handle_outgoing()
	            -> handler->cb->on_error callback
	            =  red_channel_client_default_peer_on_error()
	                -> red_channel_client_disconnect()
	                    -> red_channel_remove_client()
	                        -> ring_remove()

	When this error path does occur, the assertion in RING_FOREACH()'s
	ring_next() trips, and the process containing the spice server is aborted.
	i.e. your whole VM dies, as a result of an unfortunately timed network
	error on the spice channel.

	Please apply.

2013-06-25  Yonit Halperin  <yhalperi@redhat.com>

	red_worker: fix for stuck display_channel over WAN (jpeg_enabled=true)
	The image descriptor flags shouldn't be copied as is from the flags that
	were set by the driver. Specifically, the CACHE_ME flag shouldn't be copied,
	since it is possible that (a) the image won't be cached (b) the image
	is already cached, but in its lossy version, and we may want to set the bit for
	CACHE_REPLACE_ME, in order to cache it in its lossless version.
	In case (b), the client first looks for the CACHE_ME flag, and only if
	it is not set it looks for CACHE_REPLACE_ME (see canvas_base.c). Since both flags where set,
	the client ignored REPLACE_ME, and didn't turned off the lossy flag of the
	cach item. Then, when a request from this lossles item reached the
	client (FROM_CACHE_LOSSLESS), the client display channel waited
	endlessly for the lossless version of the image.

2013-06-24  Yonit Halperin  <yhalperi@redhat.com>

	red_worker: improve stream stats readability and ease of parsing
	also added start/end-bit-rate and avg-quality to the final stream stats.

	mjpeg_encoder: add mjpeg_encoder_get_stats

	spice: silencing most of the ping/pong logging
	Those messages are too frequent and don't contribute much

2013-06-06  Hans de Goede  <hdegoede@redhat.com>

	server: Add support for filtering out agent file-xfer msgs (rhbz#961848)

2013-05-24  Yonit Halperin  <yhalperi@redhat.com>

	red_channel: replace an assert upon threads mismatch with a warning
	The assert:
	spice_assert(pthread_equal(pthread_self(), client->thread_id))
	and the assert:
	spice_assert(pthread_equal(pthread_self(), rcc->channel->thread_id))
	were coded in order to protect data that is accessed from the main
	context (red_client and most of the channels), from
	access by threads of other channels (namely, the display and cursor
	channels), and vice versa.
	However, some of the calls to the sound channel interface,
	and also the char_device interface, can be done from the vcpu thread.
	It doesn't endanger these channels internal data, since qemu use global
	mutex for the vcpu and io threads.
	Thus, pthread_self() can be !=  channel->thread_id, if one of them is
	the vcpu thread and the other is the io-thread, and we shouldn't assert.

	Future plans: A more complete and complicated solution would be to manage our own thread for
	spice-channels, and push input from qemu to this thread, instead of
	counting on the global mutex of qemu

	rhbz#823472

2013-05-23  Yonit Halperin  <yhalperi@redhat.com>

	main_channel: fix double release of migration target data
	If client_migrate_info was called once with cert-host-subject and
	then again without cert-host-subject, on a third call to
	client_migrate info, the cert-host-subject from the first call would
	have been freed for the second time.

2013-05-19  Christophe Fergeau  <cfergeau@redhat.com>

	Log actual address spice-server binds to
	It's not always obvious what address spice-server will bind to,
	in particular when the 'addr' parameter is omitted on QEMU
	commandline. The decision of what address to bind to is made
	in reds_init_socket with a call to getaddrinfo. Surprisingly,
	that function had a call to getnameinfo() already, but it does
	not seem to be using the result of that call in any way.
	This commit moves this call after the socket is successfully bound
	and add a log message to indicate which address it's bound to.

2013-05-17  Alon Levy  <alevy@redhat.com>

	0.12.3 release

	server/red_parse_qxl: two coding convention pointer cast fix

	server/dispatchers: initialize stack to 0 for valgrind

	server/red_dispatcher: close pa hole in RedWorkerMessageDisplayConnect for valgrind

	server/tests: test_display_width_stride

	server/red_worker: simplify monitors_config update

	server/tests/test_display_base: add missing set_client_capabilities, fix client_monitors_config signature

	server/red_worker: turn critical (assert) non error into warning
	The situation causing this assert is unknown but it doesn't cause
	correctness issues with later rendering, and it is causing an abort.

	server/red_worker: s/driver_has_monitors_config/driver_cap_monitors_config/ (plus small comment)

2013-05-09  Yonit Halperin  <yhalperi@redhat.com>

	red_worker: don't get bit_rate from main_channel_client, if it wasn't initialized
	When setting an initial video stream bit rate, if the bit rate
	wasn't calculated by main_channel_client, and we don't have
	estimation from previos streams, use some default values.
	The patch also removes updating dcc->streams_max_bit_rate when
	the bit_rate held by the main_channel is larger than it. It is not necessary
	since we compare those 2 values each time we set the initial bit rate
	for a stream.

2013-05-08  Yonit Halperin  <yhalperi@redhat.com>

	reds: fix memory leak when core->base.minor_version < 3

	reds: move handle_channel_event logic from main_dispatcher to reds
	main_dispactcher role is to pass events to the main thread.
	The logic that handles the event better not be inside main_dispatcher.

	red_worker: fail handle_migrate_data instead of aborting when there is an error during restoration of surfaces

	red_channel: notify and shutdown a channel client when its handle_migrate_data fails

	red_channel: add spice_channel_client_error
	spice_channel_client_error prints warning and shutdowns the
	channel_client that hit the error.
	This macro is useful for errors that are specific for one session
	and that are unrecoverable only with respect to this session.
	Prefer disconnecting a client over aborting when possible.

	red_worker: fix incorrect is_low_bandwidth after migrating a low bandwidth connection
	rhbz#956345

	After a spice session has been migrated, we don't retest the network
	(user experience considerations). Instead, we obtain the is_low_bandwidth flag
	from the src-server, via the migration data.
	Before this patch, if we migrated from server s1 to s2 and then to s3,
	and if the connection to s1 was a low bandwidth one, we erroneously
	passed is_low_bandwidth=FALSE from s2 to s3.

	Cc: Marc-André Lureau <marcandre.lureau@redhat.com>

	red_worker: cleanup: add is_low_bandwidth flag to CommonChannelClient
	Replace the mixed calls to display_channel_client_is_low_bandwidth
	and to main_channel_client_is_low_bandwidth, with one flag in
	CommonChannelClient that is set upon channel creation.

	main_channel: add routine for checking if a network test had been conducted and completed

2013-05-05  Alon Levy  <alevy@redhat.com>

	red_worker: remove wrong TODO
	red_create_stream is called even without any client but there is no
	encoding since the mjpeg encoder is now associated with StreamAgent
	which is only created when we have a client.

2013-05-01  Yonit Halperin  <yhalperi@redhat.com>

	red_channel: on migration target, start sending ping messages only after the client's migration has completed
	The connection to the target server is established before migration
	starts. However, the client reads and replies to messages from the server only after
	migration completes. Thus, we better not send ping msgs from the target
	before migration completes (because the observed roundtrip duration will
	be bigger than the real one).

	red_channel: stop sending ping messages after migration has completed
	We mustn't send any msg to the client, besides MSG_MIGRATE_DATA, after
	we send MSG_MIGRATE.

	reds: fix not sending the mm-time after migration when there is no audio playback
	This bug results in the client dropping all the video frames after
	migration in case that (1) the hosts involved in migration have different
	mm-time; and that (2) there is no audio playback.
	This is relvant only for the client that was connected during the
	migration.

	rhbz#958276

2013-04-30  Yonit Halperin  <yhalperi@redhat.com>

	red_channel: fix not handling self pipe items in red_channel_client_release_item
	When a client disconnects, red_channel_client_pipe_clear is called.
	Releasing pipe items of type == MIGRATE||EMPTY_MSG||PING
	wasn't handled, and was passed to channel_cbs.release_item.
	There, an error occured since the pipe items were not recognized.

2013-04-24  Hans de Goede  <hdegoede@redhat.com>

	server: Add public spice_qxl_driver_unload method
	With a SPICE_DISPLAY_CAP_MONITORS_CONFIG capable client, the client needs to
	know what part of the primary to use for each monitor. If the guest driver
	does not support this, the server sends messages to the client for a
	single monitor spanning the entire primary.

	As soon as the guest calls spice_qxl_monitors_config_async once, we set
	the red_worker driver_has_monitors_config flag and stop doing this.

	This is a problem when the driver gets unloaded, for example after a reboot
	or when switching to a text vc with usermode mode-setting under Linux.

	To reproduce this start a multi-mon capable Linux guest which uses
	usermode mode-setting and then once X has started switch to a text vc. Note
	how the client window does not only not resize, if you try to resize it
	manually you always keep blackborders since the aspect is wrong.

	This patch is the spice-server side of fixing this, it adds a new
	spice_qxl_driver_unload method which clears the driver_has_monitors_config
	flag.

	The other patch needed to fix this is in qemu, and will calls this new method
	from qxl_enter_vga_mode.

2013-04-22  Yonit Halperin  <yhalperi@redhat.com>

	red_worker: assign mm_time to vga frames

	red_worker: increase the interval limit for stream frames

	collect and print video stream statistics

	server/red_worker: add an option to supply the bandwidth via env var
	SPICE_BIT_RATE can be set for supplying red_worker the available
	bandwidth (in Mbps).

	server/red_worker.c: use the bit rate of old streams as a start point for new streams
	mjpeg_encoder modify the initial bit we supply it, according to the
	client feedback. If it reaches a bit rate which is higher than the
	initial one, we use the higher bit rate as the new bit rate estimation.

	red_worker: video streams - adjust client playback latency

	reds: support mm_time latency adjustments
	When there is no audio playback, we set the mm_time in the client to be older
	than the one in the server by at least the requested latency (the delta is
	actually bigger, due to the network latency).
	When there is an audio playback, we adjust the mm_time in the client by
	adjusting the playback buffer using SPICE_MSG_PLAYBACK_LATENCY.

	snd_worker: support sending SPICE_MSG_PLAYBACK_LATENCY
	also update spice-common submodule

	dispatcher.h: fix - s/#define MAIN_DISPATCHER_H/#define DISPATCHER_H

	red_worker: ignoring video frame drops that are not due to pipe congestion
	A frame can be dropped if a new frame was added during the same
	call to red_process_command (we didn't attempt to send the older
	frame). Such drops are ignored.

	red_worker: notify mjpeg_encoder on server frame drops

	red_worker: support SPICE_MSGC_DISPLAY_STREAM_REPORT
	update mjpeg_encoder with reports from the client about
	the playback quality.
	The patch also updates the spice-common submodule.

	red_worker: start using mjpeg_encoder rate control capabilities
	This patch only employs setting the stream parameters based on
	the initial given bit-rate, the latency, and the encoding size.
	Later patches will also employ mjpeg_encoder response to client reports,
	and its control over frame drops.

	The patch also removes old stream bit rate calculations that weren't
	used.

	server/red_worker: enable latency monitoring in the display channel

	red_worker: stream - update periodically the input frame rate
	Periodically calculate the rate of frames arriving from the guest to the
	server.

	red_channel: monitor connection latency using MSG_PING

	server/red_worker: assign timer callbacks to worker_core, using spice_timer_queue
	display channel - supplying timeouts interface to red_channel, in order to allow
	periodic latency monitoring (see next patch).

	server: spice_timer_queue
	Each thread can create a spice_timer_queue, for managing its
	own timers.

	mjpeg_encoder: add stream warmup time, in which we avoid server and client drops
	The stream starts after lossless frames were sent to the client,
	and without rate control (except for pipe congestion). Thus, on the beginning
	of the stream, we might observe frame drops on the client and server side which
	are not necessarily related to mis-estimation of the bit rate, and we would
	like to wait till the stream stabilizes.

	mjpeg_encoder: keep the average observed fps similar to the defined fps
	The actual frames distribution does not necessarily fit the
	condition "at least one frame every (1000/rate_contorl->fps)
	milliseconds".
	For keeping the average frame rate close to the defined fps, we
	periodically measure the current average fps, and modify
	rate_control->adjusted_fps accordingly. Then, we use
	(1000/rate_control->adjusted_fps) as the interval between the
	frames.

	mjpeg_encoder: move the control over frame drops to mjpeg_encoder

	mjpeg_encoder: update the client with estimations for the required playback latency
	The required client playback latency is assessed based on the current
	estimation of the bit rate, the network latency, and the encoding size
	of the frames. When the playback delay that is reported by the client
	seems too small, or when the stream parameters change, we send the
	client an updated playback latency estimation.

	mjpeg_encoder: modify stream bit rate based on server side pipe congestion
	Downgrading stream bit rate when the input frame rate in the server
	exceeds the output frame rate, and frames are being dropped from the
	output pipe.

	mjpeg_encoder: adjust the stream bit rate based on periodic client feedback
	mjpeg_encoder can receive periodic reports about the playback status on
	the client side. Then, mjpeg_encoder analyses the report and can
	increase or decrease the stream bit rate, depending on the report.
	When the bit rate is changed, the quality and frame rate of the stream
	are re-evaluated.

	mjpeg_encoder: re-configure stream parameters when the frame's encoding size changes
	If the encoding size seems to get smaller/bigger, re-evaluate the
	stream quality and frame rate.

	mjpeg_encoder: configure mjpeg quality and frame rate according to a given bit rate
	Previously, the mjpeg quality was always 70. The frame rate was
	tuned according to the frames' congestion in the pipe.
	This patch sets the quality and frame rate according to
	a given bit rate and the size of the first encoded frames.

	The following patches will introduce an adaptive video streaming, in which
	the bit rate, the quality, and the frame rate, change in response to
	different parameters.

	Patches that make red_worker adopt this feature will also follow.

	server/red_worker: streams: moving mjpeg_encoder from Stream to StreamAgent
	The mjpeg_encoder should be client specific, and not shared between
	different clients**, for the following reasons:
	(1) Since we use abbreviated jpeg datastream for mjpeg, employing the same
	    mjpeg_encoder for different clients might cause errors when the
	    clients decode the jpeg data.
	(2) The next patch introduces bit rate control to the mjpeg_encoder.
	    This feature depends on the bandwidth available, which is client
	    specific.

	** at least till we change multi-clients not to re-encode the same
	   streams.

	red_worker: stream agent - fix miscounting of frames
	Frames counting was skipped when the previous frame was already
	sent completely to the client.

2013-04-19  Hans de Goede  <hdegoede@redhat.com>

	snd_worker: Make sure we never send an empty volume message
	My commit 71315b2e "snd_worker: Don't send empty audio-volume messages",
	fixes only one case of sending an empty volume message, if the client connects
	to a vm early during its boot sequence, while the snd hardware is being reset
	by the guest driver, qemu will call spice_server_playback_set_volume() with
	0 channels from the reset handler.

	This patch also applies both fixes to the record channel.

2013-04-10  Hans de Goede  <hdegoede@redhat.com>

	spice-common: Update

2013-04-08  Yonit Halperin  <yhalperi@redhat.com>

	red_worker.c: fix not destroying streams before sending MSG_MIGRATE
	When qemu migration completes, we need to stop the streams, and to send
	the corresponding upgrade_items to the client.
	Otherwise, (1) the client might display lossy regions that we don't track
	(streams are not part of the migration data).
	(2) streams_timeout may occur after MSG_MIGRATE has been sent, leading
	to messages being sent to the client after MSG_MIGRATE and before
	MSG_MIGRATE_DATA (e.g., STREAM_CLIP, STREAM_DESTROY, DRAW_COPY).
	No message besides MSG_MIGRATE_DATA should be sent after
	MSG_MIGRATE.

	When a msg other than MIGRATE_DATA reached spice-gtk after MSG_MIGRATE,
	spice-gtk sent it to dest server as the migration data, and the dest
	server crashed with a "bad message size" assert.

	red_worker.c: s/red_display_destroy_streams/red_display_destroy_streams_agents
	In order not to confuse it with red_destroy_streams in the following
	patch.

2013-04-01  Hans de Goede  <hdegoede@redhat.com>

	snd_worker: Don't send empty audio-volume messages
	If no volume has been set it, we end up sending a volume message with
	audio-volume for 0 channels (iow an empty message). This is not useful
	and triggers the following warning in spice-gtk:

	(remote-viewer:8726): GSpice-WARNING **: set_sink_input_volume() failed:
	Invalid argument

2013-03-29  Hans de Goede  <hdegoede@redhat.com>

	char_device: Don't set active when stopped and don't access dev after unref
	2 closely related changes in one:
	1) When leaving the read or write loop because the chardev has been stopped
	active should not be updated. It has been set to FALSE by
	spice_char_device_stop and should stay FALSE
	2) The updating of dev->active should be done *before* unref-ing dev

	char_device: Don't set the write-retry timer when not running
	The write-retry timer should not be set when we're leaving
	spice_char_device_write_to_device because the char-dev has been stopped.

	char_device: Properly update buffer status when leaving the write loop on stop
	Before this patch the write-loop in spice_char_device_write_to_device would
	break on running becoming 0, after having written some data, without updating
	the buffer status, causing the same data to be written *again* when started.

2013-03-15  Hans de Goede  <hdegoede@redhat.com>

	inputs-channel: Don't send insecure keyb notify to in migrate client
	This fixes spice-gtk printing message like these on migration:
	(remote-viewer:18402): GSpice-CRITICAL **: spice_channel_iterate_read: assertion `c->state != SPICE_CHANNEL_STATE_MIGRATING' failed

	inputs-channel: Handle printing of insecure keyboard notify
	This is clearly something which should be handled in the inputs_channel code,
	rather then having a special case for it in the generic channel handling
	code in reds.c. Moving it here also fixes the TODO we had on only sending
	this message to new clients.

	main-channel: Add a main_channel_client_push_notify function
	Sometimes we want to send a notify to a single client, rather then to
	all of them.

	main-channel: Make main_channel_push_notify deal with dynamic memory
	Currently main_channel_push_notify only gets passed a static string, but
	chances are in the future it may get passed dynamically allocated strings,
	prepare it for this.

	While at it also make clear that its argument is a string, and simplify
	things a bit by making use of this knowledge (pushing the strlen call down).

2013-03-07  Hans de Goede  <hdegoede@redhat.com>

	server/reds: Send the agent a CLIENT_DISCONNECTED msg on client disconnect
	Client -> agent messages can spawn multiple VDIChunks. When this happens
	the agent re-assembles the chunks into a complete VDAgentMessage before
	processing it. The server only guarentees coherency at the chunk level,
	so it is not possible for a partial chunk to get delivered to the agent.

	But it is possible for some chunks of a VDAgentMessage to be delivered to
	the agent followed by a client to disconnect without the rest of the
	VDAgentMessage being delivered!

	This will leave the agent in a wrong state, and the first messages send to it
	by the next client to connect will get seen as the rest of the VDAgentMessage
	from the previous client.

	This patch sends the agent a new VD_AGENT_CLIENT_DISCONNECTED message from the
	VDP_SERVER_PORT, on which the agent can then reset its VDP_CLIENT_PORT state.

	Note that no capability check is done for this, since the capabilities are
	something negotiated between client and agent. The server will simply always
	send this message on client disconnect, relying on older agents discarding the
	message since it has an unknown type (which both the windows and linux agents
	already do).

	char_device: Add spice_char_device_write_buffer_get_server_no_token()
	To allow the server to send agent messages without needing to wait for a
	self-token. IE for sending VD_AGENT_CLIENT_DISCONNECTED messages.

	Update spice-common

2013-03-04  Hans de Goede  <hdegoede@redhat.com>

	Silence __spice_char_device_write_buffer_get: internal buf is not available
	These messages are printed when the server tries to push a mouse event to
	the agent before the previous one has been flushed. This is a normal condition
	(which gets tracked by the reds->pending_mouse_event boolean), and as such
	it should *not* trigger the printing of error messages.

	I've seen these messages occasionally before, but with agent file-xfer they
	are trivial to trigger, simply send a large file to the agent and while it
	is transferring move the mouse over the client window. Note that due to the
	client tokens not allowing the client to completely saturate the agent
	channel mouse events do still get send to the agent, just with a slightly
	larger interval. So everything is working as designed and this spice_printerr
	is just leading to people chasing ghosts.

2013-01-15  Hans de Goede  <hdegoede@redhat.com>

	worker_update_monitors_config: Drop bogus real_count accounting
	1) This does not buy us much, as red_marshall_monitors_config() also
	   removes 0x0 sized monitors and does a much better job at it
	   (also removing intermediate ones, not only tailing ones)
	2) The code is wrong, as it allocs space for real_count heads, where
	   real_count always <= monitors_config->count and then stores
	   monitors_config->count in worker->monitors_config->count, causing
	   red_marshall_monitors_config to potentially walk
	   worker->monitors_config->heads past its boundaries.

	server: Fix SpiceWorker-CRITICAL **: red_worker.c:10968:red_push_monitors_config: condition `monitors_config != NULL' failed
	During my dynamic monitor support testing today, I hit the following assert
	in red_worker.c:
	"red_push_monitors_config: condition `monitors_config != NULL' failed"

	This is caused by the following scenario:
	1) Guest causes handle_dev_monitors_config_async() to be called
	2) handle_dev_monitors_config_async() calls worker_update_monitors_config()
	3) handle_dev_monitors_config_async() pushes worker->monitors_config, this
	   takes a ref on the current monitors_config
	4) Guest causes handle_dev_monitors_config_async() to be called *again*
	5) handle_dev_monitors_config_async() calls worker_update_monitors_config()
	6) worker_update_monitors_config() does a decref on worker->monitors_config,
	   releasing the workers reference, this monitor_config from step 2 is
	   not yet free-ed though as the pipe-item still holds a ref
	7) worker_update_monitors_config() creates a new monitors_config with an
	   initial ref-count of 1 and stores that in worker->monitors_config
	8) The pipe-item of the *first* monitors_config is send, upon completion
	   a decref is done on the monitors_config, and monitors_config_decref not
	   only frees the monitor_config, but *also* sets worker->monitors_config
	   to NULL, even though worker->monitors_config no longer refers to the
	   monitor_config being freed, it refers to the 2nd monitor_config!
	9) The client which was connected when this all happened disconnects
	10) A new client connects, leading to the assert:
	    at red_worker.c:9519
	    num_common_caps=1, common_caps=0x5555569b6f60, migrate=0,
	    stream=<optimized out>, client=<optimized out>, worker=<optimized out>)
	    at red_worker.c:10423
	    at red_worker.c:11301

	Note that red_worker.c:9519 is:
	        red_push_monitors_config(dcc);
	gdb does not point to the actual line of the assert because the function gets
	inlined.

	The fix is easy and obvious, don't set worker->monitors_config to NULL in
	monitors_config_decref. I'm a bit baffled as to why that code is there in
	the first place, the whole point of ref-counting is to not have one single
	unique place to store the reference...

	This fix should not have any adverse side-effects as the 4 callers of
	monitors_config_decref fall into 2 categories:
	1) Code which immediately after the decref replaces worker->monitors_config
	   with a new monitors_config:
	   worker_update_monitors_config()
	   set_monitors_config_to_primary()
	2) pipe-item freeing code, which should not touch the worker state at all
	   to being with

2013-01-14  Michael Tokarev  <mjt@tls.msk.ru>

	link libspice server with libm libpthread
	server/Makefile apparently forgot to link libspice-server
	with -lm -lpthread, but it uses symbols from these libraries
	directly.  These libs are detected by configure and stored in
	$(SPICE_NONPKGCONFIG_LIBS) make variable, but this variable
	is never referenced at link time.  Add it to server/Makefile.am,
	to libspice_server_la_LIBADD variable.

	Signed-off-By: Michael Tokarev <mjt@tls.msk.ru>

2013-01-08  Yonit Halperin  <yhalperi@redhat.com>

	red_worker.c: clearing the stream vis_region, after it has been detached
	The stream vis_region should be cleared after the stream region was sent
	to the client losslessly. Otherwise, we might send redundant stream upgrades
	if we process more drawables that are dependent on the stream region.

	red_worker.c: insert a drawable to its position in the current tree before calling red_detach_streams_behind
	resolves: rhbz#891326

	Starting from commit 81fe00b08ad4f, red_detach_streams_behind can
	trigger modifications in the current tree (by update_area calls). Thus,
	after calling red_detach_streams_behind it is not safe to access tree
	entries that were calculated before the call.
	This patch inserts the drawable to the tree before the call to
	red_detach_streams_behind. This change also requires making sure
	that rendering operations that can be triggered by
	red_detach_streams_behind will not include this drawable (which is now part of the tree).

2013-01-01  Uri Lublin  <uril@redhat.com>

	server: guest_set_client_capabilities: protect against NULL worker->display_channel
	Reported-by: Michal Luscon <mluscon@redhat.com>

	Found by a Coverity scan:
	  in handle_dev_start -
	    Checking "worker->display_channel" implies that "worker->display_channel"
		         might be NULL.
	    Passing "worker" to function "guest_set_client_capabilities"
	  in guest_set_client_capabilities -
	    Directly dereferencing parameter "worker->display_channel"

2012-12-20  Hans de Goede  <hdegoede@redhat.com>

	Release 0.12.2

2012-12-20  Yonit Halperin  <yhalperi@redhat.com>

	red_parse_qxl: fix throwing away drawables that have masks
	Non rgb bitmaps are allowed to not have a palette in case they
	are masks (which are 1BIT bitmaps).

	Related: rhbz#864982

2012-12-19  Hans de Goede  <hdegoede@redhat.com>

	spice-client: Add --hotkeys cmdline option
	To allow using the existing mechanism to override the default hotkeys from
	the cmdline.

2012-12-12  Christophe Fergeau  <cfergeau@redhat.com>

	reds: Use g_strlcpy instead of strncpy
	reds.c is using strncpy with a length one byte less than the
	destination buffer size, and is relying on the fact that the
	destination buffers are static global variables.
	Now that we depend on glib, we can use g_strlcpy instead, which
	avoids relying on such a subtle trick to get a nul-terminated
	string.

	build: Use glib2
	Now that QEMU depends on glib, it won't really hurt if we depend
	on it as well, and we won't have to reinvent our own helpers.

	Don't build client by default
	It has been superseded by virt-viewer/remote-viewer

	Fail reds_init_socket when getaddrinfo fails
	We currently output a warning when getaddrinfo fails, but then
	we go on trying to use the information it couldn't read. Make
	sure we bail out of reds_init_socket if getaddrinfo fails.

	Make sure strncpy'ed string are 0-terminated
	spice_server_set_ticket and spice_server_set_addr get (library)
	user-provided strings as arguments, and copy them to fixed-size
	buffers using strncpy. However, if these strings are too long,
	the copied string will not be 0-terminated, which will cause issues
	later. This commit copies one byte less than the size of the
	destination buffer. In both cases, this buffer is a static global
	variable, so its memory will be set to 0.

2012-12-05  Yonit Halperin  <yhalperi@redhat.com>

	red_worker: revert 8855438a
	red_proccess_commands calls were added after calling
	guest_set_client_capabilities in order to cleanup the command ring from
	old commands that the client might not be able to handle.
	However, calling red_process_commands at this stage does send messages
	to the client.
	In addition, since setting the client capabilities at the guest is not
	synchronized, emptying the command ring is not enough in order to make
	sure the following commands will be supported by the client.
	The call to red_proccess_commands before initializing the display
	streams (the call to red_display_start_streams), caused inconsistencies
	related to video streaming upon reconnecting (rhbz#883564).

	I'm reverting this patch till another solution for the capabilities
	mismatch is introduced.

	Resolves: rhbz#883564

2012-12-05  Marc-André Lureau  <marcandre.lureau@redhat.com>

	server: add "port" channel support
	A Spice port channel carry arbitrary data between the Spice client and
	the Spice server. It may be used to provide additional services on top
	of a Spice connection. For example, a channel can be associated with
	the qemu monitor for the client to interact with it, just like any
	qemu chardev. Or it may be used with various protocols, such as the
	Spice Controller.

	A port kind is identified simply by its fqdn, such as org.qemu.monitor,
	org.spice.spicy.test or org.ovirt.controller...

	The channel is based on Spicevmc which simply tunnels data between
	client and server, with a few additional messages.

	See the description of the channel protocol in spice-common history.

	server: bump SPICE_SERVER_VERSION to 0.12.2

	update spice-common

2012-11-30  Yonit Halperin  <yhalperi@redhat.com>

	agent: fix mishandling of agent data received from the client after agent disconnection
	The server can receive from the client agent data even when the agent
	is disconnected. This can happen if the client sends the agent data
	before it receives the AGENT_DISCONNECTED msg. We should receive and handle such msgs, instead
	of disconnecting the client.
	This bug can also lead to a server crash if the agent gets reconnected
	fast enough, and it receives an agent data msg from the client before MSGC_AGENT_START.

	upstream bz#55726
	rhbz#881980

2012-11-29  Yonit Halperin  <yhalperi@redhat.com>

	red_worker: no need to align the stride of internal images
	Internal images are just read from the surface, compressed, and sent to the client.
	Then, they are destroyed. I can't find any reason for aligning their memory.

2012-11-28  Yonit Halperin  <yhalperi@redhat.com>

	red_worker: fix sending internal images with stride > bpp*width to lz compression
	rhbz#876685

	The current lz implementation does not support such bitmaps.
	The following patch will actually prevent allocating stride > bpp*width
	for internal images.

2012-11-26  Yonit Halperin  <yhalperi@redhat.com>

	red_worker.c: fix memory corruption when data from client is bigger than 1024 bytes
	Previously, there was no check for the size of the message received from
	the client, and all messages were read into a buffer of size 1024.
	However, migration data can be bigger than 1024. In such cases, memory
	corruption occurred.

	red_worker.c: fix not sending all pending messages when the device is stopped
	red_wait_outgoing_item only waits till the currently outgoing msg is
	completely sent.
	red_wait_outgoing_items does the same for multi-clients. handle_dev_stop erroneously called
	red_wait_outgoing_items, instead of waiting till all the items in the
	pipes are sent.
	This waiting is necessary because after drawables are sent to the client, we release them from the
	device. The device might have been stopped due to moving to the non-live
	phase of migration. Accessing the device memory during this phase can lead
	to inconsistencies.

	Also, MSG_MIGRATE should be the last message sent to the client, before
	MSG_MIGRATE_DATA. Due to this bug, msgs were marshalled and sent after
	handle_dev_stop and after handle_dev_display_migrate which sometimes led
	to the release of surfaces, and inserting MSG_DISPLAY_DESTROY_SURFACE
	after MSG_MIGRATE.

	This patch also removes the calls to red_wait_outgoing_items, from
	dev_flush_surfaces. They were unnecessary.

	smartcard.c: avoid marshalling migration data with reference to a memory that might be released before send has completed
	The current solution just copy the buffer. Currently data that is read
	from the guest is always copied before sending it to the client. When we
	will have ref count for these buffers, we can also use it for marshalling
	the migration data.

	red_worker.c: fix marshalling of migration data
	fix calling spice_marhsaller_add_ref with memory on stack

	reds.c: fix calls to spice_marshaller_add_ref with ptr to memory that might be released before sending

	char_device.c: when the state is destroyed, also free the buffer that is being written to the device

	char_device.c: add ref count for write-to-device buffers
	The ref count is used in order to keep buffers that were in the write
	queue and now are part of migration data, in case the char_device state
	is destroyed before we complete sending the migration data.

2012-11-21  Yonit Halperin  <yhalperi@redhat.com>

	char_device.c: fix call to spice_marshaller_add_ref with memory on stack
	rhbz#862352

2012-11-12  Yonit Halperin  <yhalperi@redhat.com>

	red_worker.c: fix calling set_client_capabilities when it is unsupported by qemu
	The erroneous call was in handle_dev_start.
	This patch also fixes not calling set_client_capabilities when the
	qxl major_version is > 3.

	display seamless migration: no need to trace the generation of the primary surface
	We no longer process destroy_primary or destroy_surfaces while waiting
	for migration data.

	display seamless migration: don't process both cmd ring and dispatcher queue till migration data is received
	fix: rhbz#866929

	At migration destination side, we need to restore the client's surfaces
	state, before sending surfaces related messages.
	Before this patch, we stopped the processing of only the cmd ring, till migration data
	arrived.
	However, some QXL_IOs require reading and rendering the cmd ring (e.g.,
	update_area). Moreover, when the device is reset, after destroying all
	surfaces, we assert (in qemu) if the cmd ring is not empty (see
	rhbz#866929).
	This fix makes the red_worker thread wait till the migration data arrives
	(or till a timeout), and not process any input from the device after the
	vm is started.

2012-11-04  Alon Levy  <alevy@redhat.com>

	Revert "server: add websockets support via libwebsockets"
	This reverts commit 63bb37276e028ab1b1c156c9e7907bf22b6d5952.

	update spice-common (was broken)

2012-11-01  Alon Levy  <alevy@redhat.com>

	server/red_worker: don't call set_client_capabilities if vm is stopped
	We try to inject an interrupt to the vm in this case, which we cannot do
	if it is stopped. Instead log this and update when vm restarts.

	RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=870972
	 (that bz is on qemu, it will be cloned or just changed, not
	  sure yet)

2012-10-25  Alon Levy  <alevy@redhat.com>

	server/red_worker: wip: VALIDATE_SURFACE macros, remove asserts (but too late - should be done earlier)

	release 0.12.1

	server: add websockets support via libwebsockets
	New API: spice_server_set_ws_ports

	This adds an optional dependency on libwebsockets. You need to get my
	patched 0.0.3 version here:
	 git://people.freedesktop.org/~alon/libwebsockets

	There is no qemu patches yet, to test change in reds.c the default value
	of spice_ws_port to 5959 (for the default of spice-html5).

	For testing there is an online client at
	 http://spice-space.org/spice-html5/spice.html

	Known issues:
	 1. The tester (server/tests/test_display_no_ssl) gets into dropping all
	  data after a few seconds, I think it's an issue with the implemented
	  watches, but haven't figured it out.

	 2. libwebsocket's read interface is inverted to what our code expects,
	 i.e. there is no libwebsocket_read, so there is an additional copy
	 involved (see RedsWebSocket). This can be fixed.

	 3. Listening on a separate port. Since the headers are different, we
	 could listen on the same port (first three bytes RED/GET). I don't know
	 if we want to?

	Todos:
	 1. SSL not implemented yet. Needs some thought as to how.

	 2. Serve spice-html5 when accessed as a http server. Nice to have.

	server/red_worker: stride > 0 is tested, remove abort
	Tested using the wip driver and xf86-video-modesetting.

	server/tests/test_display_base: fix segfault in test

	server/reds.c: split off reds-private.h

	configure.ac: add libcacard to SPICE_REQUIRES if built with smartcard support

	update spice-common

2012-10-24  Uri Lublin  <uril@redhat.com>

	server: red_dispatcher: check major/minor of qxl for client_monitors_config
	This solves a problem with new spice-server and old qemu-kvm, where spice thinks
	qif->client_monitors_config exists, while it does not exist in qemu-kvm.

	Also "major > required_major" was added to the condition.
	Also only the specific RedDispatcher is checked (and not all dispatchers).

2012-10-19  Alon Levy  <alevy@redhat.com>

	add git-version-gen and gitlog-to-changelog

2012-10-18  Hans de Goede  <hdegoede@redhat.com>

	inputs_channel: Fix wrong handling of key up/down on big endian
	The client will send 0x000000## codes for regular keys, and 0x0000##e0 codes
	for extended keys. The current code which simply walks the uint32_t code in
	memory order relies on the memory order being little endian, which will
	clearly fail on big endian machines, this fixes this.

2012-10-11  Yonit Halperin  <yhalperi@redhat.com>

	snd channel: fix accessing freed memory
	snd_channel_put freed "channel", and then channel->worker was accessed.
	It caused segmentation faults during connections and disconnections of the client.

2012-10-01  Christophe Fergeau  <cfergeau@redhat.com>

	Fix PlaybackChannel forward declaration
	This caused a jenkins build failure:

	snd_worker.c:148: error: redefinition of typedef 'PlaybackChannel'
	snd_worker.c:126: note: previous declaration of 'PlaybackChannel' was here

2012-10-01  Andrew Eikum  <aeikum@codeweavers.com>

	server: Access the correct SndChannel for a given AudioFrame
	The client of _get_buffer() holds a ref to the SndChannel, and we
	should access that SndChannel when _put_samples() is called, not the one
	that happens to currently be attached to the Interface.

	server: Don't release SndChannel twice from worker reference
	When we release the SndChannel reference during
	snd_disconnect_channel(), we need to set the pointer to NULL so it
	doesn't get released again on client reconnect during
	snd_set_playback_peer(). This can happen when a reference is held from
	_playback_get_buffer().

2012-09-20  Christophe Fergeau  <cfergeau@redhat.com>

	reds: Report an error when reds_char_device_add_state fails
	This used to abort with spice_error. The caller currently does
	not check spice_server_char_device_add_interface return value, but
	it's still cleaner to report an error in this case.

	reds: Check errors returned from SSL_CTX_set_cipher_list

	reds: Report errors from load_dh_params

	reds: Check reds_init_ssl errors
	Now that this function can fail, propagate any error up to the
	caller. This allows qemu to fail when an SSL initialization error
	occurred.

	reds: report SSL initialization errors
	Errors occurring in reds_init_ssl used to be fatal through the use
	of spice_error, but this was downgraded to non-fatal spice_warning
	calls recently. This means we no longer error out when invalid SSL
	(certificates, ...) parameters are passed by the user.
	This commit changes reds_init_ssl return value from void to int so
	that errors can be reported to the caller.

	reds_init_net: report errors on watch setup failures
	We used to be aborting in such situations, but this was changed
	during the big spice_error/printerr cleanup. We are currently
	outputting a warning but not reporting the error with the caller
	when reds_init_net fails to register listening watches with the
	mainloop. As it's unlikely that things will work as expected in
	such cases, better to error out of the function instead of pretending
	everything is all right.

	reds: Abort on BN-new failures
	BN_new returns NULL on allocation failures. Given that we abort
	on malloc allocation failures, we should also abort here. The
	current code will segfault when BN_new fails as it immediatly tries
	to use the NULL pointer.

2012-09-14  Alon Levy  <alevy@redhat.com>

	Release 0.12.0

2012-09-13  Alon Levy  <alevy@redhat.com>

	server/spice-server.syms: add missing global labels
	Although global is the default, this makes the file more consistent.

	server/Makefile.am: fix for make distcheck
	Doesn't make sense to distribute test_spice_version.sh, so just
	ensure the build passes if it doesn't exist.

	spice-server 0.11.5
	Added api:
	 QXL interface (3.2)
	  client_monitors_config

	server/tests: agent mock, client_monitors_config

	server: Filter VD_AGENT_MONITORS_CONFIG
	If the guest supports client monitors config we pass it the
	VDAgentMonitorsConfig message via the
	QXLInterface::client_monitors_config api instead of via the vdagent.

	server/reds: reuse already defined local

	server/red_dispatcher: client_monitors_config support
	Adds two functions:
	 - red_dispatcher_use_client_monitors_config:
	   check that QXLInterface supports client_monitors_config and that it's
	   functional.
	 - red_dispatcher_client_monitors_config:
	   send the client monitors configuration to the guest.

	server: add QXLInterface::client_monitors_config
	Used to implement guest monitor configuration change similarly to real
	hardware in conjunction with the new qemu interrupt
	QXL_INTERRUPT_CLIENT_MONITORS_CONFIG. client_monitors_config is also
	used to probe the support by the interface. If it is not supported we
	send the message to the guest agent.
	This makes a linux qxl driver similar to existing kms drivers.

	The logic is:

	For every received VDAgentMonitorsConfig:
	 if client_monitors_config(NULL):
	  write client configuration to pci rom BAR.
	  send interrupt to guest
	  guest kernel reads configuration from rom BAR.
	  guest kernel issues event to user space
	  user space reads (libdrm) and reconfigures (libXRandr)
	 else: (current implementation)
	  write message to guest agent
	  guest agent issues reconfiguration via XRandr / windows Escape ioctl to kernel

	update spice-common module
	For qxl client_monitors_config support.

2012-09-12  Alon Levy  <alevy@redhat.com>

	server/red_dispatcher: change a printerr to debug

2012-09-11  Søren Sandmann Pedersen  <ssp@redhat.com>

	Bump SPICE_INTERFACE_QXL_VERSION_MINOR
	Then check that we have the right version before accessing the
	set_client_capabilities() function.

2012-09-11  Peter Robinson  <pbrobinson@gmail.com>

	Enable build on armv6+
	The following patch enables it to build on ARM platforms that support
	atomics. Tested on an armv7hl on an ARMv7 device running Fedora 18. Using
	firefox connecting to a RHEV-M instance I could launch consoles in
	spice-xpi and login so basic support works!

	Resolves: rhbz#613529

2012-09-10  Christophe Fergeau  <cfergeau@redhat.com>

	Update spice-common to get A8 surface definitions
	Latest spice needs these definitions from spice-protocol

2012-09-07  Søren Sandmann Pedersen  <ssp@redhat.com>

	Bump spice.h version number to 0.11.4
	No new symbols are added, but there is an addition to QXLInterface:

	    void (*set_client_capabilities)(QXLInstance *qin,
	                                    uint8_t client_present,
	                                    uint8_t caps[58]);

	Set a8 capability in the QXL device if supported by the client

	Process outstanding commands in the ring after changing capability bits
	When a new client connects, there may be commands in the ring that it
	can't understand, so we need to process these before forwarding new
	commands to the client. By doing this after changing the capability
	bits we ensure that the new client will never see a command that it
	doesn't understand (under the assumption that the guest will read and
	obey the capability bits).

	Acked-by: Alon Levy <alonl@redhat.com>

2012-09-06  Søren Sandmann Pedersen  <ssp@redhat.com>

	Add new set_client_capabilities() interface to QXLInstance
	A new interface

	  set_client_capabilities (QXLInstance *qin,
	  			   uint8_t client_present,
	  			   uint8_t caps[58]);

	is added to QXLInstance, and spice server is changed to call it
	whenever a client connects or disconnects. The QXL device in response
	is expected to update the client capability bits in the ROM of the
	device and raise the QXL_INTERRUPT_CLIENT interrupt.

	There is a potential race condition in the case where a client
	disconnects and a new client with fewer capabilities connects. There
	may be commands in the ring that the new client can't handle. This
	case is handled by first changing the capability bits, then processing
	all commands in the ring, and then start forwarding commands to the
	new client. As long as the guest obeys the capability bits, the new
	client will never see anything it doesn't understand.

	client: Advertise A8_SURFACE capability

2012-09-05  Alon Levy  <alevy@redhat.com>

	server/red_parse_qxl: fix bitmap_consistent again

2012-09-05  Jeremy White  <jwhite@codeweavers.com>

	Implement spice_server_set_exit_on_disconnect to enable an option whereby the spice server shuts down on client disconnect.

2012-09-05  Alon Levy  <alevy@redhat.com>

	server/red_parse_qxl: fix wrong bitmap_consistent
	The bit calculation was wrong for all the paletted types by a factor of
	between 8 and 1 (SPICE_BITMAP_FMT_{1,4,8}BIT_PLT_{LE,BE})

2012-09-03  Alon Levy  <alevy@redhat.com>

	server/red_parse_qxl: add bitmap consistency check
	Just checks stride vs width times bpp.

	This fixes a potential abort on guest generated bad images in
	glz_encoder.

	Other files touched to move some consts to red_common, they are
	static so no problem to be defined in both red_worker.c and
	red_parse_qxl.c .

	server/tests/test_display_base: fix update_area abort
	Don't do zero area update_areas, server now aborts on those. This tester
	is not supposed to test those aborts.

	server: replace syntax-check reported tabs with spaces

	server: add dist-hook to prevent spice version configure/spice.h difference

2012-09-02  Alon Levy  <alevy@redhat.com>

	0.11.3 release
	No new api entries.

	add server/tests/test_vdagent

	server/tests/test_two_servers

	server/tests: introduce Test struct

2012-08-30  Alon Levy  <alevy@redhat.com>

	server/red_worker: seamless: fix invalid memory reference
	replace add_ref with add for stack allocated SpiceMigrateDataDisplay.

	This fixes wrong MIGRATE_DATA message in display channel (symptom is
	glz_encoder_max being way too big, and malloc failure at target) seen on
	F18 with gcc-4.7.1-5.fc18.x86_64 and glibc-2.16-8.fc18.x86_64 (didn't
	appear on RHEL 6).

	server: freezed->froze, missing whitespace after declarations

	server: s/max_encdoers/max_encoders/

2012-08-30  Yonit Halperin  <yhalperi@redhat.com>

	server/inputs_channel.c: whitespace fix

2012-08-30  Alon Levy  <alevy@redhat.com>

	server/red_tunnel_worker: remove unneeded expect_migrate_mark

2012-08-27  Alon Levy  <alevy@redhat.com>

	server/red_tunnel_worker.c: fix build
	Only passes compile, not tested.

2012-08-27  Marc-André Lureau  <marcandre.lureau@redhat.com>

	inputs: handle SPICE_MSGC_INPUTS_KEY_SCANCODE
	Handle SPICE_MSGC_INPUTS_KEY_SCANCODE message, allowing arbitrary
	keyboard scancode sequence.

2012-08-27  Alon Levy  <alevy@redhat.com>

	support automake >= 1.12
	Requires a single line (sans comments) change to configure.ac in
	spice-common too, to define the new AM_PROG_AR.

	server/red_worker: handle_dev_update_area: fail if invalid area

2012-08-27  Yann E. MORIN  <yann.morin.1998@free.fr>

	client: fix missing stdarg.h include
	When the C library is uClibc, stdarg.h is required to get the
	definition for va_list et al.

2012-08-27  Yonit Halperin  <yhalperi@redhat.com>

	enable seamless migration and set migration protocol version

	inputs channel migration: don't send any msg after MSG_MIGRATE
	Pending motion acks, and keyboard modifiers messages will be sent
	by the destination after receiving the migration data.

	inputs_channel: send and handle migration data

	migration_protocol: add inputs channel migration data
	Storing the motion count in uint16_t and not in uint32_t since
	the exact count is not important, just its division in
	SPICE_INPUT_MOTION_ACK_BUNCH (see the next 2 patches).

	main_channel: don't expect init msg in a seamless migration destination
	If the server is a destination of seamless migration, send msgs to the client,
	even though an init msg has not been sent to the client.

	red_channel: set send_data.last_sent_serial in red_channel_client_set_message_serial
	red_channel_client_set_message_serial is called for setting
	the serial of the display channel messages after migration (on the
	destination side). The serial is retrieved from the migration data.

	red_channel: remove unused migrate flag from RedChannel
	The relevant flags reside in RedChannelClient and RedClient

	snd_worker: handling migration
	The playback and record channel send SPICE_MSG_MIGRATE to the client.
	Both playback and record channel does not have a state to restore:
	while in the legacy migration implementation the record channel
	used to restore the mode and start time, it looks unnecessary since
	the client receives from the src MSG_RECORD_STOP before the migration
	completion notification (when the vm is stopped). Afterwards, when the vm
	starts on the dest side, the client receives MSG_RECORD_START.

	snd_channel: fix double release
	Due to the fix in the previous patch, snd_disconnect_channel can be
	called both when there is write/read error in the channel, or from
	red_client_destroy (which calls client_cbs.disconnect).
	Multiple calls to snd_disconnect_channel resulted in calling
	channel->cleanup(channel) more than once (double release).

	red_channel (dummy): fix not adding dummy RedChannelClient to the client
	snd channel wasn't added to be part of the client's channels list.
	As a result, when the client was destroyed, or migrated, snd channel
	client wasn't destroy, or its migration callback wasn't called.

	However, due to adding dummy channels to the client, we need special
	handling for calls to disconnecting dummy channel clients.

	TODO: we need to refactor snd_worker to use red_channel

	display migration: restore destination state
	Restoring display channel from migration data.
	Not notifying client about changes that are artifacts of loading the vm.
	Remove legacy migration code.

	display migration: marshall migration data

	display & cursor migration: send SPICE_MSG_MIGRATE

	migration_protocol: add display channel migration data

	inputs channel: use the default red_channel behaviour for client_cbs.migrate
	The default callback sends SPICE_MSG_MIGRATE to the client.

	inputs channel: fix using spice messages enums as pipe items type
	A channel pipe item type must start from PIPE_ITEM_TYPE_CHANNEL_BASE.
	SPICE_MSG_MIGRATE value eq. PIPE_ITEM_TYPE_SET_ACK. Setting a pipe item
	type to SPICE_MSG_MIGRATE, leads to red_channel handling PIPE_ITEM_TYPE_SET_ACK.

	char_device: don't connect a migrated client if the state of the device might have changed since it was created
	If reading/writing from the device have occured before migration data
	has arrived, the migration data might no longer be relvant, and we
	disconnect the client.

	main: restore state from migration data
	Also removed old migration leftovers.

	main: send migration data
	Also removed some unused definitions from reds that used to belong to
	old agent and migration code.

	main: send MSG_MIGRATE upon vm migration completion
	Before sending the above msg, if there is a pending partial msg that
	has been read from the agent, we send it to the client. The alternative
	was to keep the msg as part of the migration data, and then
	to send it to the destination server via the client and to wait there
	for the msg chunk completion, before sending it to the client. Of
	course, the latter is less efficient.

	reds: s/HADER/HEADER

	migration_protocol: add migration data for the main channel (mainly for the agent)

	main_channel: fix using spice messages enums as pipe items type
	A channel pipe item type must start from PIPE_ITEM_TYPE_CHANNEL_BASE.
	SPICE_MSG_MIGRATE value eq. PIPE_ITEM_TYPE_SET_ACK. Setting a pipe item
	type to SPICE_MSG_MIGRATE, leads to red_channel handling PIPE_ITEM_TYPE_SET_ACK.

	Also removed sending SPICE_MSG_MIGRATE. It will be handled in the next
	patch.

	red_channel: introduce PIPE_ITEM_TYPE_EMPTY_MSG
	The pipe item is used for sending messages that don't have body.

	smartcard: restore state after migration from migration data

	smartcard migration: send migration data

	migration_protocol: add migration data for smartcard

	smartcard: send MSG_MIGRATE upon vm migration completion
	The above is the default behaviour for red_channel_client, if
	client_cbs.migrate is not registered as part of red_channel_register_client_cbs

	smartcard: fix PIPE_ITEMs enum indexing
	The enum should start from PIPE_ITEM_TYPE_CHANNEL_BASE, otherwise,
	PIPE_ITEM_TYPE_ERROR is handled like PIPE_ITEM_TYPE_SET_ACK.

	smartcard: change the timing of attaching a client to SpiceCharDeviceState
	Attach/detach a client to a SpiceCharDeviceState upon its
	connection/disconnection, instead of upon reader_add/remove messages.
	When the client is removed from a SpiceCharDeviceState, all the
	messages from this client are removed from the device write queue.
	This shouldn't happen when we only receive reader_remove and the
	client is still connected.

	spicevmc migration: restore migration dest state from migration data

	spicevmc migration: send migration data

	spicevmc: send MSG_MIGRATE upon vm migration completion
	The above is the default behaviour for red_channel_client, if
	client_cbs.migrate is not registered as part of red_channel_register_client_cbs

	migration_protocol: add migration data for spicevmc

	char device migration: restore state at destination from migration data

	char device migration: don't read or write from/to the device while waiting for migraion data

	char device migration: marshall migration data

	char_device: variable token price for write buffers
	When restoring migration data, we also restore data that is addressed to
	the device, and that might have been originated from more than 1
	message. When the write buffer that is assoicated with this data is
	released, we need to free all the relevant tokens.

	migration_protocol: add migration data for char devices

	replace some migration related spice_error calls with info/warning

	seamless migration: migration completion on the destination side
	Tracking the channels that wait for migration data. If there
	is a new migration process pending, when all the channels have
	restored their state, we begin the new migration.

	red_channel: handle sending SPICE_MSG_MIGRATE
	The relevant code is common to all channels.

	The patch also contains a fix to the return value for
	handle_migrate_data callback: s/uint64_t/int

	red_channel: fix pipe item leak

	seamleass migration: manage post migration phase in the src side
	In semi-seamless, SPICE_MSG_MAIN_MIGRATE_END is sent.
	In seamless, each channel migrates separately.

	The src waits till all the clients are disconnected (or a timeout), and
	then it notifies qemu that spice migration has completed.

	The patch doesn't include the per-channel logic for seamless migration
	(sending MSG_MIGRATE, MIGRATE_DATA, etc.).

	seamless migration: pre migration phase on the destination side
	- handle SPICE_MSGC_MAIN_MIGRATE_DST_DO_SEAMLESS
	- reply with SPICE_MSG_MAIN_MIGRATE_DST_SEAMLESS_ACK/NACK
	- prepare the channels for migration according to the migration
	   type (semi/seamless)

	see spice-protocol for more details:
	commit 3838ad140a046c4ddf42fef58c9727ecfdc09f9f

	seamless migration: pre migration phase on the src side
	sending SPICE_MSG_MAIN_MIGRATE_BEGIN_SEAMLESS and handling
	SPICE_MSGC_MAIN_MIGRATE_CONNECTED_SEAMLESS

	The src side signals the client to establish a connection
	to the destination.
	In seamless migration, the client is also used to perform
	a sort of handshake with the destination, for verifying
	if seamless migration can be supported.

	see spice-protocol for more details:
	commit 3838ad140a046c4ddf42fef58c9727ecfdc09f9f

	seamless-migration: update spice-common submodule
	Also Update server and client according to the change of
	SpiceMsgMainMigrationBegin: it now holds all the fields inside
	SpiceMigrationDstInfo.

	seamless-migration: add migration_protocol.h
	The file will hold the declarations of the different migration
	data messages (depending on the channel), that will be passed
	from the src server to the dst server, via the client, using
	SPICE_MSG_MIGRATE_DATA.

	bump version to 0.11.2
	New api entries:
	    spice_server_vm_start
	    spice_server_vm_stop
	    spice_server_set_seamless_migration

	spice.h: add spice_server_set_seamless_migration
	This new call is used in order to identify whether qemu, or
	the management (e.g. libvirt), support seamless migration.
	If it is supported, qemu spice cmd-line configuration should have
	seamless-migration=on.

	In addition, we disable seamless migration support if multiple clients
	are allowed. Currently, only one client is supported.

	spice_server_vm_start/stop: notify red_dispatcher on vm start/stop
	Till now, red_worker was notfied about vm status changes via QXLWorker->start/stop
	(or spice_qxl_start/stop).
	Newer qemu, that supports calling spice_server_vm_start/stop, will call only
	these routines, and won't call QXLWorker->start/stop.

	spice.h: add entries for tracking vm state
	When vm state changes (started/stopped), we notify all the
	attached SpiceCharDeviceStates about the change. This is mainly required
	for avoiding writing/reading to/from the device during the non-live
	stage of migration.

	spice version will be bumped in one of the following patches.

	reds: add tracking for char devices
	The list of attached char_devices will be used in the next patch
	for notifying each instance of SpiceCharDeviceState when the vm
	is started or stopped.

	agent: don't attempt to read from the device if it was released
	if vdi_port_read_buf_process failes, we detach the agent and also release
	the read buffer. We shouldn't try reading from the device afterwards.

	agent: reset client tokens when notifying on agent connection
	send SPICE_MSG_MAIN_AGENT_CONNECTED_TOKENS

	red_channel: add red_channel_test_remote_cap
	for checking if all the channel clients connected support the cap

2012-08-24  Søren Sandmann Pedersen  <ssp@redhat.com>

	Add support for Composite command to the client
	All the real work is being done in spice-common, so this patch is just
	hooking up the virtual calls and adding the SPICE_DISPLAY_CAP_COMPOSITE
	capability.

	Add support for QXLComposite to spice server
	In red-parse-qxl.c add support for parsing QXLComposite into
	SpiceComposite. In red-worker.c add support for marshalling
	SpiceComposite onto the wire.

	Add support for LZ compression of A8 images
	Graduality is irrelevant for A8 images, so instead of using RGB-ness
	as a short-cut, add a new macro BITMAP_FMT_HAS_GRADUALITY() that
	returns true for the existing RGB images, but false for A8.

2012-08-09  Marc-André Lureau  <marcandre.lureau@redhat.com>

	Update spice-common

2012-07-25  Yonit Halperin  <yhalperi@redhat.com>

	red_worker: Fix reference counting for the current frame (drawable) of a stream
	After marshalling MSG_STREAM_CREATE, there is no need to ref and
	unref stream->current before and after completing the sending of the
	message (correspondingly). The referencing is unnecessary because all
	the data that is required from the drawable (the clipping), is copied
	during marshalling, and no field in the drawable is referenced (see
	spice_marshall_msg_display_stream_create).

	Moreover, the referencing was bugous:
	While display_channel_hold_pipe_item and
	display_channel_client_release_item_after_push referenced and
	dereferenced, correspondingly, stream->current, stream->current might
	have changed in between these calls, and then we ended up with one drawable
	leaking, and one drawable released before its time has come (which
	of course led to critical errors).

2012-07-23  Alon Levy  <alevy@redhat.com>

	bump version to 0.11.1 for new spice_qxl_monitors_config_async
	bump current and age since only additions where done.
	new server library is libspice-server.so.1.2.0 .

2012-07-22  Alon Levy  <alevy@redhat.com>

	server: add monitors_config support
	a SpiceMsgDisplayMonitorsConfig is sent on two occasions:
	 * as a result of a spice_qxl_monitors_config_async
	 * whenever a client connects and there is a previously set monitors
	   config

	Sending the new message is protected by a new cap,
	SPICE_DISPLAY_CAP_MONITORS_CONFIG

	More elaborately:
	spice_qxl_monitors_config_async receives a QXLPHYSICAL address of a
	QXLMonitorsConfig struct and reads it, caching it in the RedWorker, and
	sending it to all clients. Whenever a new client connects it receives
	a SpiceMsgDisplayMonitorsConfig message as well.

	server/red_parse_qxl: red_get_image: fix leaks on bad image

	server/red_worker: release bad drawables

	server/red_parse_qxl: disallow zero area bitmaps
	prevents division by zero later (SIGFPE, Arithmetic exception) in
	spice-common code, at spice-common/common/canvas_base.c:646
	for both client and server (server only upon rendering).

	server/red_parse_qxl: get_path: remove return NULL
	introduced by 2ec2dbc78a660ee4e3315f50c881d9e31a8e4fe2

	server/reds: more fixes for wrong spice_error in d2c99b59

	server: don't abort on guest images with missing palettes

	server: factor out bitmap_fmt_is_rgb

2012-07-16  Marc-André Lureau  <marcandre.lureau@redhat.com>

	Update spice-common

	tests: add missing file to .gitignore
	TODO: some day, switch to git.mk

	build-sys: remove cegui/slirp and mandatory client from dist-check
	The spicec client is no longer actively maintained.

	By removing cegui from distcheck, we can avoid extra build time and
	dependencies (>150Mb extra cegui/boost on fedora)

	Slirp is not available in most distributions, afaict, making it hard
	to build consistantly accross various systems.

	The client is still build if the dependencies are present.

	build-sys: define GL flags if enabled
	The server too can use opengl, independently from client.

2012-07-11  Alon Levy  <alevy@redhat.com>

	server/reds: fix wrong spice_error in d2c99b59

	server/red_worker: fix wrong spice_error in commit 706232a8

2012-07-05  Alon Levy  <alevy@redhat.com>

	server/reds.c: spice_printerr cleanup
	Rules for replacing spice_printerr:
	* if it's a client drop / agent drop, spice_error
	* if it's important, spice_warning
	* else, spice_info.

	The fourth rule is spice_debug if it's going to fill up the log, but
	nothing of the sort here.

	Other things this patch does:
	* changed reds_show_new_channel to reds_info_new_channel in an attempt to
	advertise it doesn't always show anything, unless SPICE_DEBUG_LOG_LEVEL
	>= SPICE_DEVUG_LOG_INFO (==3)
	* removes two lines of whitespace.
	* added "crashy" to multiple client warning (only warning introduced,
	  the rest are errors).

	server/red_worker: elevate some spice_debugs to spice_info
	Specifically all those that the previous patch converted to spice_debug.
	spice_debug contains very verbose stuff like update_area that drowns out
	those relatively rare (client connect / disconnect generated) messages.

	update spice-common for spice_info

	server/red_worker: cleanup lines starting with 5 spaces

	server/red_worker: death to spice_printerr, too verbose by far
	Replaced mostly with spice_debug, but spice_warning & spice_error as
	well where appropriate.

2012-07-04  Yonit Halperin  <yhalperi@redhat.com>

	smartcard: Remove redefinition of typedef 'SmartCardDeviceState'

2012-07-03  Yonit Halperin  <yhalperi@redhat.com>

	char_device.h: Remove redefinition of typedef 'SpiceCharDeviceState'
	The original definition is in spice.h

	char_device: move SpiceCharDeviceState from the header
	In addition, I also removed the no longer used wakeup callback

	smartcard: use SpiceCharDeviceState for writing to the guest device
	With SpiceCharDeviceState, the smartcard code now supports partial writes,
	and storing data that is received from the client after the device is
	stopped, instead of attempting to write it to the guest.

	smartcard: creating SmartCardChannelClient type
	The lifetime of the channel is not necessarily correlated to the life
	time of the device. In the next patch, we need to keep a reference
	to SpiceCharDeviceWriteBuffer, which might be in use even if the
	SpiceCharDeviceState is destroyed, but the channel is still connected.
	The next patch keeps this reference inside SmartCardChannelClient.

	This patch also removes the routine smartcard_readers_detach_all(rcc), which
	is unnecessary since we don't support multiple readers; even when
	we do support them, each channel client should be associated with only
	one reader (i.e., we will have different channels for different
	readers).

	smartcard: use SpiceCharDeviceState for managing reading from the device
	This patch and the following one do not introduce tokening to the smartcard
	channel. But this can be done easily later, by setting the appropriate
	variables in SpiceCharDeviceState (after adding the appropriate protocol messages,
	and implementing this in the client side).

	spicevmc: use SpiceCharDeviceState for writing to the guest device
	With SpiceCharDeviceState, spicevmc now supports partial writes,
	and storing data that is received from the client after the device is
	stopped, instead of attempting to write it to the guest.

	spicevmc: employ SpiceCharDeviceState for managing reading from the guest device
	This patch and the following one do not introduce tokening to the
	spicevmc channel. But this can be done easily later, by setting the appropriate
	variables in SpiceCharDeviceState (after adding
	the appropriate protocol messages, and implementing this in the client
	side).

	agent: employ SpiceCharDeviceState for writing to the device

	agent: use SpiceCharDeviceWriteBuffer for agent data from the client
	This is an intermediate patch. The next patch will actually
	push the buffer to the device, instead of copying it.

	agent: employ SpiceCharDeviceState for managing reading from the device

	agent: remove save/restore migration data code
	This code is never called, it was relevant for seamless migration.
	Most of the data that needs to be migrated was moved to
	SpiceCharDeviceState. When we implement seamless migration,
	we will have routines in char_device.c for migrating the relevant data.

	agent: Fix tokens handling in main_channel
	- Allow sending tokens to a specific client.
	- Do not ignore tokens that are sent from the client to the server.

	The tokens support for multiple clients and for server side tokens
	is still broken in reds. It will be fixed in following patches, when
	the server-side agent code will use the SpiceCharDeviceState api.

	Notice that ignoring the server-side tokens didn't introduce a problem
	since both the client and the server set it to ~0.

	char_device: Introducing shared flow control code for char devices.
	SpiceCharDeviceState manages the (1) write-to-device queue
	(2) wakeup and reading from the device (3) client tokens (4)
	sending messages from the device to the client/s, considering the
	available tokens.
	SpiceCharDeviceState can be also stopped and started. When the device
	is stopped, no reading or writing is done from/to the device. Messages
	addressed from the client to the device are being queued.
	Later, an api for stop/start will be added to spice.h and it should
	be called from qemu.

	This patch does not yet remove the wakeup callback from
	SpiceCharDeviceState, but once all the char devices (agent/spicevmc/smartcard)
	code will switch to the new implementation, SpiceCharDeviceState
	will be moved to the c file and its reference to the wakeup callback will be removed.

	smartcard: fix an error message

	smartcard: fix calc of remaining data size when reading more than one msg from the device

2012-07-02  Alon Levy  <alevy@redhat.com>

	update spice-common
	Includes using the same spice.proto as spice-gtk now, with smartcard
	fixes, more verbose output when SSL verification fails, and some
	warnings fixes. shortlog:

	Alon Levy (6):
	      python_modules/ptypes.py/EnumBaseType.c_enumname: add missing return to fix broken enums generation
	      smartcard: build fixes for spice server
	      updated spice-protocol for smartcard enums non conflict with libcacard
	      Makefile.am: fix .gitignore not being generated in spice-protocol/spice
	      Makefile.am: now that spice_codegen.py is used add *.pyc to ignored files in root
	      update spice-protocol for smartcard enums fix

	Christophe Fergeau (1):
	      ssl: more verbose output when SSL verification fails

	Marc-André Lureau (3):
	      ssl-verify: add a bit of run-time checks
	      Fix invalid macro usage
	      Fix a gcc warning

2012-06-27  Alon Levy  <alevy@redhat.com>

	spice.h: bump SPICE_SERVER_VERSION for release 0.11.0 (cherry picked from commit dd5c995c32cf595d31e59975bd1b3216cf996656)

	Revert "update spice-common for multiple monitor in single display channel support"
	This reverts commit 3baf290be79cfb1872b90f7724efa50aa343d74b.

	Revert "spice.h: bump SPICE_SERVER_VERSION for release 0.11.0"
	This reverts commit dd5c995c32cf595d31e59975bd1b3216cf996656.

2012-06-21  Alon Levy  <alevy@redhat.com>

	spice.h: bump SPICE_SERVER_VERSION for release 0.11.0

	update spice-common for multiple monitor in single display channel support

2012-06-19  Nikolay Orlyuk  <virkony@gmail.com>

	Added configure option --disable-xinerama
	This parameter was added to be able to control dependency on
	libXinerama. Which is really useful for package managers.
	Fixes bug #51192

2012-06-12  Alon Levy  <alevy@redhat.com>

	Release 0.11.0
	Current bumped and age bumped for new intefaces only (no backward
	incompatible changes).

	New libtool version is 2.0.1, using --version-info instead of
	--version-name. Doing the version change and --version-name to
	--version-info change here to avoid changing the libtool version twice.

	Added interfaces:
	    spice_server_set_name
	    spice_server_set_uuid
	    spice_server_set_listen_socket_fd
	    spice_server_is_server_mouse

	New library name in linux:
	    libspice-server.so.1.1.0
	Old:
	    libspice-server.so.1.0.2

2012-06-07  Alon Levy  <alevy@redhat.com>

	server/red_channel: s/channle/channel

2012-06-06  Alon Levy  <alevy@redhat.com>

	m4/spice-compile-warnings: Squelch _FORTIFY_SOURCE when needed to avoid glibc #warnings.
	Fix copied from libvirt, commit by Eric Blake.

	glibc 2.15 (on Fedora 17) coupled with explicit disabling of
	optimization during development dies a painful death:

	/usr/include/features.h:314:4: error: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Werror=cpp]

	Work around this by only conditionally defining _FORTIFY_SOURCE,
	in the case where glibc can actually use it.  The trick is using
	AH_VERBATIM instead of AC_DEFINE.

2012-06-05  Alon Levy  <alevy@redhat.com>

	server/spice.h: s/Pleaes/Please/

2012-05-31  Yonit Halperin  <yhalperi@redhat.com>

	server/red_channel: do not attempt to write if the channel client is disconnected
	The red_channel_client_event call to red_channel_client_receive might result
	in a disconnected channel client. The following call to
	red_channel_client_push may call to red_peer_handle_outgoing with a
	disconnected socket.

	server/red_channel: fix possible access to released channel clients
	Added ref count for RedChannel and RedChannelClient.

	red_channel.c/red_peer_handle_incoming call to
	handler->cb->handle_message might lead to the release of the channel
	client, and the following call to handler->cb->release_msg_buf will be
	a violation.

	This bug can be produced by causing main_channel_handle_parsed
	call red_client_destory, e.g., by some violation in
	reds_on_main_agent_data that will result in a call to reds_disconnect.

2012-05-24  Yonit Halperin  <yhalperi@redhat.com>

	server/red_worker: fix red_wait_pipe_item_sent
	Resolves: rhbz#824384

	red_wait_pipe_item_sent mistakingly returned without waiting for sending the given pipe item
	when the channel wasn't blocked. As a result, we failed when we had to
	destroy a surface (e.g., QXL_IO_DESTROY_ALL_SURFACES) and to release all
	the drawables that are depended on it (by removing them or waiting they will be sent).
	In addition, red_wait_pipe_item_sent increased and decreased the reference to the pipe item
	using channel_cbs->hold_item, and channel_cbs->release_item. However,
	these calls can be called only by red_channel, otherwise
	display_channel_client_release_item_before_push is called twice and
	leads to a double call to ring_remove(&dpi->base).
	Instead ref/put_drawable_pipe_item should be called.

	server/red_channel: remove red_channel_client_item_being_sent
	The above routine was risky, since red_channel_client_init_send_data
	can also be called with item==NULL. Thus, not all pipe items can be tracked.
	The one call that was made for this routine was not necessary.

2012-05-21  Yonit Halperin  <yhalperi@redhat.com>

	server: handle red_channel_client_create returning NULL

	server/red_channel: prevent creating more than one channel client with the same type+id

	server/video: do not allow non-streamable drawables be stream candidates
	Resolves: rhbz#820669

	Fix a segfault caused by a call to __red_is_next_stream_frame made by
	red_stream_maintenance, with a drawable that is not a DRAW_COPY one.
	The segfault is a reault of __red_is_next_stream_frame accessing
	red_drawable->u.copy.src_bitmap for a non DRAW_COPY drawable.

2012-05-16  Yonit Halperin  <yhalperi@redhat.com>

	server/tests: test_display_streaming - test wide sized frames
	Before, we tested only higher frames, while wider frames would have
	triggered a bug in mjpeg_encoder, when spice is linked with libjpeg and
	not libjpeg-turbo.

	server/mjpeg_encoder: realloc encoder->row, when a wider frame is given
	Fix crashes when there are sized wider frames in the stream, and we are
	linked with libjpeg.

	Related : rhbz#813826
	Resolves: rhbz#820669

2012-05-15  Alon Levy  <alevy@redhat.com>

	server: move self_bitmap_image to RedDrawable
	Simplify keeping count of self_bitmap_image by putting it in
	RedDrawable. It is allocated on reading from the command pipe and
	deallocated when the last reference to the RedDrawable is dropped,
	instead of keeping track of it in GlzDrawable and Drawable.

	server/red_worker/put_red_drawable: s/drawable/red_drawable/

	server/red_worker/red_handle_self_bitmap: add red_drawable local, one extra whitespace line removed

	server/red_worker: rename SpiceImage *self_bitmap to self_bitmap_image

	Revert "server/red_worker: fix possible leak of self_bitmap"
	This reverts commit 35dbf3ccc4b852f9dbb29eb8a53c94f26d2e3a6e.

	accidentally pushed v1 of patches, reverting in preperation of pushing
	v2.

2012-05-14  Alon Levy  <alevy@redhat.com>

	server/red_worker: fix possible leak of self_bitmap
	After the previous patch moving self_bitmap freeing inside red_drawable
	ref count, we have a possible self_bitmap leak:

	red_process_commands
	 red_get_drawable | red_drawable #1, red_drawable->self_bitmap == 1
	  red_process_drawable | rd #2, d #1, d->self_bitmap != NULL
	   release_drawable | rd #1, d# = 0, try to release self_bitmap, but
	                        blocked by rd #1
	  put_red_drawable | rd #0

	This patch moves the call to release_drawable after the call to
	put_red_drawable, thereby fixing the above situation.

	server/red_worker/red_process_commands: rename drawable to red_drawable (later add a local drawable)

	server/red_worker: red_process_drawable: have single point of exit

2012-05-14  Yonit Halperin  <yhalperi@redhat.com>

	server/red_worker: don't release self_bitmap unless refcount is 0
	RHBZ: 808936

2012-05-10  Yonit Halperin  <yhalperi@redhat.com>

	server/mjpeg_encoder: fix wrong size assigned to dest_len
	It should have been the allocated size and not the occupied one.
	This led to a lot of unnecessary allocations and deallocations.

	server/mjpeg_encoder: Fix memory leak for the inital output buffer given for each frame

2012-05-07  Alon Levy  <alevy@redhat.com>

	server/reds: add "usbredir" to recognized channel names
	RHBZ: 819484

2012-05-04  Nahum Shalman  <nshalman@elys.com>

	cleanup x11 library detection for building client
	Consolidate two separate chunks of library hunting that depend on the
	same check.

	Check if we're actually building the client before looking for
	client only libraries.

	Hide some of the final output if we're not building the client.

2012-05-03  Yonit Halperin  <yhalperi@redhat.com>

	server/tests/test_display_streaming: include tests for clip and sized frames
	CC: Alon Levy <alevy@redhat.com>

	server/tests: use the correct dimensions in SIMPLE_UPDATE

	server/tests: add SLEEP command to test_display_base

	server/tests: add clip to SIMPLE_DRAW_BITMAP

2012-05-03  Alon Levy  <alevy@redhat.com>

	server/tests/test_display_streaming: update to create sized frames

	server/tests: add SIMPLE_DRAW_SOLID and SIMPLE_DRAW_BITMAP

	server/tests: refactor Command

	server/tests: add test_get_width/test_get_height

	server/tests: refactor test_display_base

2012-05-03  Yonit Halperin  <yhalperi@redhat.com>

	server/red_worker/video: don't override the clip in areas that belong only to sized frames

	server/red_worker.c/video: add support for frames of different sizes
	rhbz #813826

	When playing a youtube video on Windows guest, the driver sometimes(**) sends
	images which contain the video frames, but also other parts of the
	screen (e.g., the youtube process bar). In order to prevent glitches, we send these
	images as part of the stream, using SPICE_MSG_DISPLAY_STREAM_DATA_SIZED.

	(**) It happens regularly with the you tube html5 player. With flash,
	it occurs when moving the cursor in the player area.

	Update the spice-common submodule
	spice-common changes: STREAM_DATA_SIZED message was added in order to support
	video streams with frames that their size is different from the initial size
	that the stream was created with.

	This patch also includes server and client adjustments to the new
	SpiceMsgDisplayStreamData.

	server/red_worker/video: don't detach a drawable from a stream due to it being rendered.
	The previous patch took care that streams will be upgraded by a surface
	screenshot and not the last frame, if necessary. Thus, there is no
	more a reason for detaching drawables from streams when they are
	rendered. Moreover, detaching such drawables can cause glitches, in
	case they are still in the pipe, and red_update_area is called
	frequently and leads to stream frames rendering.

	server/red_worker/video: upgrade stream by a screenshot instead of the last frame, if needed
	Upgrading a stream: When the stream's visible region is bigger than the one of the last
	frame, we will send an updated screenshot of the visible region, instead
	of sending the last frame losslessly.

	server/red_worker/video: maintain visible region and clip region for streams
	Differentiate between the clipping of the video stream, and the region
	that currently displays fragments of the video stream (henceforth,
	vis_region). The latter equals or contains the former one. For example,
	let c1 be the clip area at time t1, and c2 be the clip area at time t2,
	where t1 < t2. If c1 contains c2, and at least part of c1/c2, hasn't been
	covered by a non-video images, vis_region will contain c2, and also the part
	of c1/c2 that still displays fragments of the video.
	When we consider if a stream should be "upgraded" (1), due to its area
	being used by a rendering operation, or due to stopping the video, we
	should take into account the vis_region, and not the clip region (next
	patch: not upgrade by the last frame, but rather by vis_region).
	This fix will be more necessary when sized frames are introduced (see the
	following patches). Then, the vis_region might be larger
	than the last frame, and contain it, more frequently than before.

	(1) "upgrading a stream" stands for sending its last frame losslessly. Or more
	precisely, lossless resending of all the currently displayed lossy areas, that were
	sent as part of the stream.

	server/red_worker: add get_stream_id

	Update the spice-common submodule
	We need some rect/region getters methods that were added

2012-04-27  Jeremy White  <jwhite@codeweavers.com>

	Force 64 bit multiplication on 32 bit systems; fixes a bug where the server times out the display channel freakily fast.

2012-04-26  Daniel P. Berrange  <berrange@redhat.com>

	Ensure __STDC_FORMAT_MACROS is always defined first
	The client/common.h file defines __STDC_FORMAT_MACROS before
	including inttypes.h so that the PRI* macros get defined in
	C++. This is ignoring the possibility that other global
	includes may have already pulled in inttypes.h

	We need __STDC_FORMAT_MACROS to be defined before any header
	files are included. Putting it in config.h satisfies this,
	since config.h is always the first header

	Disable -Waggregate-return if building with SLIRP
	The API design of SLIRP means that it is not practical to use
	the -Waggregate-return warning flag. Disable this flag in the
	(unlikely) scenario where SLIRP is actually requested at build
	time

2012-04-26  Alon Levy  <alevy@redhat.com>

	bump spice-common with SpiceClips fix

2012-04-25  Daniel P. Berrange  <berrange@redhat.com>

	Add some more 'noreturn' annotations
	Methods which longjump, unconditionally raise an
	exception, or call _exit()  cannot return control
	to the caller so should be annotated with 'noreturn'

	Fix typo in is_equal_brush
	The 3 part of the conditional in the is_equal_brush method
	compared the b1->u.color field to itself, instead of b2->u.color

	Fix printf format specifiers for i686 hosts

	Add missing struct field initializers

	Ensure config.h is the first include in the file

	Add a few more syntax-check exemptions

	Add recent new committers to AUTHORS file / mailmap

	Enable many more compiler warnings
	* m4/manywarnings.m4m, m4/warnings.m4: Import GNULIB warnings
	  modules
	* m4/spice-compile-warnings.m4: Define SPICE_COMPILE_WARNINGS
	* configure.ac: Replace compile warning check with a call to
	  SPICE_COMPILE_WARNINGS
	* client/Makefile.am: Use WARN_CXXFLAGS instead of WARN_CFLAGS

	Make some int->pointer casts explicit
	Tell the compiler that was really do intend to cast from int
	to pointer, to prevent warnings about implicit casts

	* server/tests/test_display_base.c: Add explicit casts

	Fix broken -I../common to be -I../spice-common in client
	* Makefile.am: s/common/spice-common/

	VSCMsgHeader.reader_id is unsigned, so don't check for >= 0
	* server/smartcard.c: Fix assertion to not check for >= 0 on
	  unsigned variable

	Avoid jumping across variables declarations with initializers
	If a 'goto' statement jumps across a variable declaration
	which also has an initializer, the variable is in an undefined
	state. Splitting the the declaration & initialization doesn't
	change that, but the compiler can at least now detect use of
	the unintialized variable

	Convert cases of () to (void)
	* server/reds.c, server/smartcard.c: s/()/(void)

	Remove 2 *MB* stack frame in red_worker_main
	The red_worker_main method allocates a RedWorker struct instance
	on the stack. This struct is a full 2 MB in size which is not
	at all resonable to allocate on the stack.

	* server/red_worker.c: Move RedWorker struct to the heap

	Mark some variables as volatile
	When using setjmp/longjmp the state of local variables can be
	undefined in certain scenarios:

	[quote man(longjmp)]
	       The values of automatic variables are unspecified  after  a
	       call to longjmp() if they meet all the following criteria:

	       ·  they are local to the function that made the correspond‐
	          ing setjmp(3) call;

	       ·  their values are changed between the calls to  setjmp(3)
	          and longjmp(); and

	       ·  they are not declared as volatile.
	[/quote]

	* server/red_worker.c: Mark some vars as volatile

	Mark functions which never return control
	* client/red_channel.cpp:  AbortTrigger::on_event can't return
	  given its current impl
	* server/red_worker.c: red_worker_main can't return

	Fix multiple printf format problems
	All printf var-args style methods should be annotation with
	their format. All format strings must be const strings.

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

	Fix const-ness violations
	* server/red_worker.c: Add missing const for return type
	* server/reds.c: Static strings must be declared const

	Don't do arithmetic on void * type, use uint8_t instead
	Arithmetic on void * types is non-portable & trivially avoided

	* server/dispatcher.c: Use uint8_t for arithmetic

2012-04-18  Alon Levy  <alevy@redhat.com>

	spice-common: update submodule to verify_subject MSVC++ fix

	spice-common: update submodule

	update spice-common for MSVC++ build fixes

2012-04-18  Aric Stewart  <aric@codeweavers.com>

	update visual studio project file
	Note, there may be line-ending issues here is we are not careful.  This file is a msdos formatted file.

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

2012-04-18  Alon Levy  <alevy@redhat.com>

	client/windows/redc.vcproj: switch to unix EOL (dos2unix)

2012-04-18  Aric Stewart  <aric@codeweavers.com>

	Update win32 generate(1).bat files to match modern usage
	This involves:
	 generating .c instead of .cpp files
	 Not including "common.h"
	 Standardizing some parameters

	we do not need afxres.h included in redc.rc
	It is not an MFC project so simply including windef.h is better and
	allows for compiling with the Express editions of Visual Studio.

2012-04-18  Michael Tokarev  <mjt@tls.msk.ru>

	fix error-path return in snd_set_record_peer()
	The error_{1,2} labels in this functions are backwards.

2012-04-17  Aric Stewart  <aric@codeweavers.com>

	Copy getopt.h from old common/win/my_getopt-1.5/my_getopt
	This patch completes the copy from
	4d8f39020ac83602c1647d4af04e8b19bf74ed6e which missed this file.

	update windows client generate.bat and generate1.bat
	the python script is now in spice-common and client_marshallers.h needs
	to be included instead of marshallers.h

2012-04-05  Alon Levy  <alevy@redhat.com>

	server: allow failure in getvirt
	This patch changed getvirt to continue working even if spice_critical
	doesn't abort (i.e. SPICE_ABORT_LEVEL != -1). This is in preparation to
	make getvirt not abort at all. The reason is that getvirt is run on
	guest provided memory, so a bad driver can crash the vm.

2012-04-02  Christophe Fergeau  <cfergeau@redhat.com>

	Replace sprintf with snprintf use
	The hotkey parser was generating a string with sprintf and data it got
	from the controller socket (ie data which can have an arbitrary
	length). Using sprintf there is a bad idea, replace it with snprintf.

2012-03-28  Marc-André Lureau  <marcandre.lureau@redhat.com>

	spice-common: update to fix quic-encode warnings

2012-03-26  Alon Levy  <alevy@redhat.com>

	server: export spice_server_is_server_mouse predicate
	To be used by qemu query-spice / info spice commands.

2012-03-26  Marc-André Lureau  <marcandre.lureau@redhat.com>

	Remove files moved to spice-common

2012-03-25  Marc-André Lureau  <marcandre.lureau@redhat.com>

	Copy common/win/my_getopt-1.5/my_getopt client/windows

	Use the spice-common logging functions
	It will abort by default for critical level messages. That behaviour
	can be tuned at runtime.

	Use the spice-common submodule
	This patch will replace the common/ directory with the spice-common
	project. It is for now a simple project subdirectory shared with
	spice-gtk, but the goal is to make it a proper library later on.

	With this change, the spice-server build is broken. The following
	commits fix the build, and have been seperated to ease the review.

	v2
	- moves all the generated marshallers to spice-common library
	- don't attempt to fix windows VS build, which should somehow be
	  splitted with spice-common (or built from tarball only to avoid
	  generation tools/libs deps)
	v3
	- uses libspice-common-client
	- fix a mutex.h inclusion reported by Alon

2012-03-23  Marc-André Lureau  <marcandre.lureau@redhat.com>

	sasl: small refactoring, check memcheck != NULL

	Use spice_strdup() to avoid crashing on NULL
	qemu can call spice_server_set_name(s, NULL) when the name is not
	given. Let's not crash in this case

2012-03-22  Alon Levy  <alevy@redhat.com>

	server/tests: add resolution changes tester

	server/tests/test_display_base: add Command
	add parameters to the commands used for display tests.

2012-03-21  Alon Levy  <alevy@redhat.com>

	server/tests/test_display_base: remove 64bit arch assumptions

	server/red_memslots: don't assume 64 bit environment
	assumption that unsigned long == QXLPHYSICAL causes get_virt to compute
	the wrong slot. Fix by replacing addr variables to be of type
	QXLPHYSICAL.

	server/red_worker: fix for case where ASSERT is compiled out

	server/red_memslots: use QXLPHYSICAL for addresses
	Cannot assume unsigned long == QXLPHYSICAL, not true for 32 bit
	architectures.

	server/red_memslots: drop two unused functions
	cb_get_virt and cb_validate_virt have disappeared a long time ago,
	not needed since:

	commit 5ac88aa79fa6445f96e5419d8bf4fce81da63b90
	Author: Gerd Hoffmann <kraxel@redhat.com>
	Date:   Thu Jul 1 17:55:33 2010 +0200

	    Properly parse QXLImage to the new-world SpiceImage

	    SpiceImage now replaces RedImage and has all image types in it.
	    All image data are now chunked (and as such not copied when demarshalling).

2012-03-20  Christophe Fergeau  <cfergeau@redhat.com>

	Don't truncate SPICE_FOREIGN_MENU_SOCKET
	When we get the socket name for the foreign menu socket from
	an environment variable, we cannot make assumptions about its length.
	Currently, we are strncpying to a 50 byte buffer which is easily
	too small.

	Don't limit spice controller socket name to 50 chars
	The spice controller socket name used to be hardcoded to
	/tmp/SpiceController-%lu.uds and generated using snprintf. A 50 bytes
	buffer was enough for that, but this was changed in commit 79fffbf95
	because this was predictable and allowed other users on the system
	to sniff the browser/client communication. spicec now uses the value
	of the environment SPICE_XPI_SOCKET as the name of the socket to use.
	However, since the name that is used is no longer generated by spicec,
	no assumption can be made about its size. Currently, the socket is
	created inside the user home directory, which means that if the
	user name is too long, spicec will not be able to read the controller
	socket name.
	This commit directly uses the string from getenv as he name of the
	controller socket (on Linux) instead of limiting its size to 50 characters,
	which should fix this issue.
	This fixes rhbz #804561

	Remove unused Canvas members
	The various Canvas have _max and _base variables which are not
	used, better to remove them.

2012-03-20  Alon Levy  <alevy@redhat.com>

	server/red_worker: don't typedef SpiceWatch twice
	First defined in spice.h, fixes build failure with gcc 4.4.6

2012-03-13  Hans de Goede  <hdegoede@redhat.com>

	red_worker: Check for NULL watches
	If we run out of watches slots, we return NULL from watch_add, which
	means that the other watch_foo functions may get called with a NULL
	parameter, protect them against this.

2012-03-12  Nahum Shalman  <nshalman@elys.com>

	server: remove superfluous check
	no need to duplicate the check that the fd isn't -1

	server: listen on a pre-opened file descriptor
	Allow applications to pre-open a file descriptor and have spice listen
	on it.

	Thanks to Daniel Berrange for his comments

	server: don't fail on ENOPROTOOPT from setsockopt
	If we allow listening on arbitrary sockets like unix sockets,
	we can get ENOPROTOOPT errors from setsockopt calls that set TCP
	specific options.  This should be allowed to happen.

2012-03-12  Hans de Goede  <hdegoede@redhat.com>

	red_channel: remove pre_disconnect hook
	Now that red_worker's EventListener is gone there are no more users of it.

	red_worker: Rework poll code to use the watch interface
	Commit 143a1df24e83e9c1e173c16aeb76d61ffdce9598 changed red_worker_main
	from epoll to poll. But epoll has edge triggered semantics (when requested
	and we requested them), where as poll is always level triggered. And
	red_worker was relying on the edge triggered semantics, as it was always
	polling for POLLOUT, which, when edge triggered, would only cause poll
	to register an event after we had blocked on a write. But after the
	switch to regular poll, with its level triggered semantics, the POLLOUT
	condition would almost always be true, causing red_worker_main to not
	block on the poll and burn CPU as fast as it can as soon as a client was
	connected.

	Luckily we already have a mechanism to switch from polling for read only
	to polling for read+write and back again in the form of watches. So this
	patch changes the red_worker dummy watch implementation into a proper watch
	implementation, and drops the entire EventListener concept since that then is
	no longer needed.

	This fixes spice-server using 400% CPU on my quad core machine as soon as
	a client was connected to a multi head vm, and as an added bonus is a nice
	cleanup IMHO.

	red_channel: Use the channel core to remove the stream watch on disconnect
	We allow channels to have different core implementations, but we were
	relying on reds_stream_free to remove the stream watch on disconnect,
	and reds_stream_free always uses the qemu core implementation.

	So far we were getting away with this since all the alternative core
	implementations always return NULL from watch_add.

	But:
	1) The code before this patch clearly was not correct, since it was matching
	   a channel-core watch_add with a qemu-core watch_remove
	2) I plan to move red_worker over to actually using an alternative watch
	   implementation at which point this becomes a real problem

2012-03-10  Hans de Goede  <hdegoede@redhat.com>

	red_worker: Remove ref counting from the EventListener struct
	The red_worker EventListener struct is either embedded in one of:
	1) DisplayChannelClient
	2) CursorChannelClient
	3) RedWorker

	And as such gets destroyed when these get destroyed, in case 1 & 2 through
	a call to red_channel_client_destroy().

	So free-ing it when the ref-count becomes 0 is wrong, for cases:
	1) and 2) this will lead to a double free;
	3) this will lead to passing memory to free which was not returned by malloc.

	This is not causing any issues as the ref-count never gets decremented, other
	then in red_worker_main where it gets incremented before it gets decremented,
	so it never becomes 0.

	So we might just as well completely remove it.

	Notes:
	1) This is mainly a preparation patch for fixing issues introduced by
	   the move from epoll to poll
	2) Since removing the ref-counting removes the one code path where listeners
	   would get set to NULL, this patch moves the setting of NULL to
	   pre_disconnect, where it should have been done in the first place since
	   red_client_destroy calls red_channel_client_disconnect
	   (through the dispatcher) followed by red_channel_client_destroy, so
	   after pre_disconnect the listener may be gone.

	Ensure all members of ChannelCbs and ClientCbs are either assigned or NULL
	While git-bisecting another issue I ended up hitting and not recognizing
	the bug fixed by commit 7a079b452b026d6ce38f95dcc397fa64b059fffb.

	While fixing this (again) I noticed that (even after the fix) not all
	users of ChannelCbs first zero it. So this patch ensures that all users of
	ChannelCbs first zero it, and does the same for ClientCbs while at it.

	Since before this patch there were multiple zero-ing styles, some using
	memset and other using a zero initializer this patch also unifies all
	the zero-ing to use a NULL initializer for the first element.

2012-03-06  Alon Levy  <alevy@redhat.com>

	server/red_worker: fix use after free for listeners
	This fixes a core dumped observed once by repeated migration. So far 100
	migrations and no recurrence.

	Core was generated by `/home/alon/spice/upstream/bin/qemu-system-x86_64 --enable-kvm -qmp unix:/tmp/mi'.
	Program terminated with signal 11, Segmentation fault.
	11197	                if (evt_listener && evt_listener->refs > 1) {
	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
	(gdb) bt
	(gdb) l
	11192	        for (i = 0; i < MAX_EVENT_SOURCES; i++) {
	11193	            struct pollfd *pfd = worker.poll_fds + i;
	11194	            if (pfd->revents) {
	11195	                EventListener *evt_listener = worker.listeners[i];
	11196
	11197	                if (evt_listener && evt_listener->refs > 1) {
	11198	                    evt_listener->action(evt_listener, pfd);
	11199	                    if (--evt_listener->refs) {
	11200	                        continue;
	11201	                    }
	(gdb) p evt_listener
	$1 = (EventListener *) 0x7f15a9a5d1e0
	(gdb) p *evt_listener
	Cannot access memory at address 0x7f15a9a5d1e0
	(gdb) p i
	$2 = 2
	(gdb) p worker.listeners
	$3 = {0x7f15bc832520, 0x7f15a406e1a0, 0x7f15a9a5d1e0, 0x0 <repeats 17 times>}

2012-03-05  Marc-André Lureau  <marcandre.lureau@redhat.com>

	Use SPICE_FOREIGN_MENU_SOCKET if it's available
	If specified, use SPICE_FOREIGN_MENU_SOCKET environment variable over
	snprintf(pipe_name, PIPE_NAME_MAX_LEN, PIPE_NAME,
	Platform::get_process_id()); since it's impossible to guess the client
	pid when spice-xpi launches the client as a grand-child (via script
	etc).

	This is also more aligned with the way we handle SPICE_XPI_SOCKET
	location.

	Fix spice-protocol reference

	Send name & uuid to capable clients
	Add spice_server_set_name() and spice_server_set_uuid() that allows
	the client to identify a Spice server (useful to associate settings
	with a particular server)

	The SPICE_MSG_MAIN_NAME and SPICE_MSG_MAIN_UUID messages are only sent
	to capable clients, announcing SPICE_MAIN_CAP_NAME_AND_UUID.

	demarshal: fixed-size array are missing __nelements
	A message with a fixed-size array, such as uint8 uuid[16] will
	generate an invalid code, missing the __nelements variable. Make sure
	that variable is defined.

2012-03-05  Christophe Fergeau  <cfergeau@redhat.com>

	server: more logging about certificates used
	This commit adds some log messages indicating which certificates
	could be loaded (or not).

	Fixes rhbz#787678

	Add log for invalid/expired tickets
	Currently, when a ticket has already expired, or is invalid, there is
	no qemu log to tell what went wrong. This commit adds such a log.

	Fixes rhbz#787669

2012-03-04  Christophe Fergeau  <cfergeau@redhat.com>

	mingw: workaround weird openssl build failure
	If X509_NAME isn't undefined before including x509v3.h, very
	weird compilation error occurs. It seems to be caused by duplicate
	definitions for this symbols coming from wincrypto.h

	mingw: don't try to redefine alloca
	mingw already has a #define alloca __builtin_alloca so trying to
	redefine it triggers a warning.

	mingw: fix signed/unsigned comparison warnings

	mingw: add workaround for _ftime_s issue on mingw
	mingw has a _ftime_s prototype in its headers, but no corresponding
	symbol available at link time. Workaround this issue for now by
	 #defining it to _ftime. This is untested on win64 where the workaround
	may not be needed.

	mingw: #ifdef unneeded #define in common.h
	common.h has some #define when doing win32 build to workaround a few
	missing functions on these systems. However, since mingw32 has some
	of these, this causes either warnings about redefining preprocessor
	symbols or wreak havoc in mingw headers trying to use these symbols.
	This commit wraps these symbols in an #ifndef __MINGW32__ to avoid
	using them on this platform.

	mingw: use uintptr_t when converting a pointer to an int
	win64 uses 32 bit long, so we cannot use a long to hold a 64 bit
	pointer. Thankfully, there's a [u]intptr_t type available exactly
	for these uses.

2012-03-01  Marc-André Lureau  <marcandre.lureau@redhat.com>

	build-sys: fix make distcheck
	- Do not refer to .c files managed by another makefile (this will fail
	  make distclean)
	- Do not refer to files by relative path (should use $top_srcdir for ex)
	- Use LDADD for object linking instead of LDFLAGS, for linker flags

	build-sys: cleanup server/tests/Makefile.am

	build-sys: use spice-protocol as submodule

	build-sys: cleanup, use autoreconf

2012-03-01  Arnon Gilboa  <agilboa@redhat.com>

	client/windows: fix SetClipboardViewer error handling rhbz#786554
	MSDN says the following about SetClipboardViewer(): "If an error occurs or there
	are no other windows in the clipboard viewer chain, the return value is NULL".
	Seems like the buggy case was "no other windows in the clipboard viewer chain",
	which explains the 3rd party clipboard manager workaround detailed in the bug
	description.

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

	Since we could not reproduce the bug on our env, the customer has verified on
	several of their systems that a private build resolved the issue.

2012-03-01  Yonit Halperin  <yhalperi@redhat.com>

	client X11: support volume keys when evdev is in use
	Add support for sending volume keys scancodes to the guest
	RHBZ #552539

	client: keyboard - add mapping for volume keys
	Add support for sending volume keys scancodes to the guest
	RHBZ #552539

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

2012-02-29  Christophe Fergeau  <cfergeau@redhat.com>

	Fix compilation when smartcard support is disabled
	The addition of smartcard control to the controller doesn't handle
	the case when smartcard support is disabled at compile time. When
	this is the case, this causes compile errors.

2012-02-28  Alon Levy  <alevy@redhat.com>

	controller_test: add README

	client controller_test: reorder parameters since pid isn't needed for linux client test

	client: handle CONTROLLER_ENABLE_SMARTCARD (rhbz 641828)

	controller_test: add ENABLE_SMARTCARD

2012-02-26  Alon Levy  <alevy@redhat.com>

	server: fix segfault on client disconnect
	..as a result of missing initialization of newly introduced
	pre_disconnect in main channel.

2012-02-26  Fabiano Fidêncio  <fabiano@fidencio.org>

	Enabling cursor in server/tests
	    Now, cursor is being shown in all tests as a white rectangle and is
	    running in the screen doing a diagonal movement. It's a very simple
	    way to test cursor commands and is sufficient for our tests.

2012-02-21  Dan McGee  <dpmcgee@gmail.com>

	Use standard IOV_MAX definition where applicable
	This is provided by <limits.h> on all platforms as long as _XOPEN_SOURCE
	is defined. On Linux, this is 1024, on Solaris, this is 16, and on any
	other platform, we now respect the value supported by the OS.

	Respect IOV_MAX if defined
	Solaris has a pitiful maximum writev vector size of only 16, so the ping
	request at initial startup destroyed this call and broke things
	immediately. Reimplement stream_writev_cb() to respect IOV_MAX and break
	the writev() calls into chunks as necessary. Care was taken to return
	the correct values as necessary so the EAGAIN handling logic can
	determine where to resume the writev call the next time around.

	red_worker: reimplement event loop using poll()
	This removes the epoll dependency we had in red_worker, which was the
	last Linux-specific call we were using in the entire Spice server. Given
	we never have more than 10 file descriptors involved, there is little
	performance gain had here by using epoll() over poll().

	The biggest change is introduction of a new pre_disconnect callback;
	this is because poll, unlike epoll, cannot automatically remove file
	descriptors as they are closed from the pollfd set. This cannot be done
	in the existing on_disconnect callback; that is too late as the stream
	has already been closed and the file descriptor lost. The on_disconnect
	callback can not be moved before the close and other operations easily
	because of some behavior that relies on client_num being set to a
	certain value.

	Use memcpy call in red_channel_create
	Rather than assign the callbacks one-by-one, we can just memcpy the
	struct into the one we have allocated in our RedChannel object, which is
	much more efficient, not to mention future-proof when more callbacks are
	added.

	Cleanup definitions of disconnect methods
	We had multiple stub methods that simply called other disconnect
	methods, making my head hurt with the indirection. Call the right
	methods at the right time and rip out the stub methods; if they are
	truely needed later they can be added again.

	red_worker: rename epoll_timeout to event_timeout
	With future patches in mind that will allow for some other
	non-Linux-specific event polling sytem to be used, rename this to a more
	generic name. All of the select/poll/epoll/kqueue family of calls are
	related to evented I/O, so 'event_' makes sense in this case.

	Add configure-time check for -Wl, --version-script option
	This is supported by the GNU linker, but not the Solaris linker, which
	is used as the default on that platform even when compiling with GCC.
	Omit passing the option to the linker on platforms that do not support
	it.

2012-02-20  Hans de Goede  <hdegoede@redhat.com>

	server/spicevmc: Don't destroy the rcc twice
	spicevmc calls red_channel_client_destroy() on the rcc when it disconnects
	since we don't want to delay the destroy until the session gets closed as
	spicevmc channels can be opened, closed and opened again during a single
	session.

	This causes red_channel_client_destroy() to get called twice, triggering
	an assert, when a connected channel gets destroyed.

	This was fixed with commit ffc4de01e6f9ea0676f17b10e45a137d7e15d6ac for
	the case where: a spicevmc channel was open on client disconnected, and
	the main channel disconnect gets handled first.

	But the channel can also be destroyed when the chardev gets unregistered
	with the spice-server. This path still triggers the assert.

	This patch fixes this by adding a destroying flag to the rcc struct, and
	also moves the previous fix over to the same, more clean, method of
	detecting this special case.

2012-02-15  Alon Levy  <alevy@redhat.com>

	server/tests/basic_event_loop: print something on channel_event

	server, separate SpiceChannelEventInfo from RedStream
	fixes rhbz 790749 use after free of SpiceChannelEventInfo.

	The lifetime of the SpiceChannelEventInfo was that of RedsStream, but it
	is used by main_dispatcher_handle_channel_event after the RedsStream is
	freed for the cursor and display channels. Making SCEI allocation be at
	RedsStream allocation, and deallocation after the DESTROY event is
	processed by core->channel_event, fixes use after free.

	README: make a note of SPICE_DEBUG_ALLOW_MC

2012-02-14  Dan McGee  <dpmcgee@gmail.com>

	Remove all usages of bzero()
	As recommended by modern C practice, we should just be using memset().

	Remove extra '\n' from red_printf() calls
	red_printf() takes care of adding a newline to all messages; remove the
	extra newline from all messages and macros that were doubling them up.

2012-02-14  Alon Levy  <alevy@redhat.com>

	server/tests: use getopt_long

2012-02-14  Fabiano Fidêncio  <fabiano@fidencio.org>

	Adding image to be used as "correct" in regression tests

	Adding support to automated tests
	    As suggested by Alon, a simple automated test to try to find
	    regressions in Spice code.
	    To use this, compile Spice with --enable-automated-tests and
	    run test_display_streaming passing --automated-tests as parameter.

2012-02-14  Dan McGee  <dpmcgee@gmail.com>

	Add casts for compatibility purposes
	Some non-Linux platforms return a (caddr_t *) result for the return
	value of mmap(), which is very unfortunate. Add a (void *) cast to
	explicitly avoid the warning when compiling with -Werror.

	For the IO vector related stuff, signed vs. unsigned comes into play so
	adding a (void *) cast here is technically correct for all platforms.

2012-02-12  Yonit Halperin  <yhalperi@redhat.com>

	server: support IPV6 addresses in channel events sent to qemu
	RHBZ #788444

	CC: Gerd Hoffmann <kraxel@redhat.com>

2012-02-09  Erlon Cruz  <erlon.cruz@br.flextronics.com>

	Fix mandatory -Werror option
	Compilation was breaking due to warning errors even when configuring with
	--enable-werror=no. This patch fix this.

2012-02-03  Christophe Fergeau  <cfergeau@redhat.com>

	Handle Application::set_hotkeys failure
	Application::set_hotkeys can throw an exception if it fails parsing
	the string describing the hotkeys to set. Currently this exception
	is uncaught which causes spicec to terminate when the controller
	tries to set invalid hotkeys. Fall back to using the default
	hotkeys when the controller sends an invalid hotkeys string.

2012-01-31  Christophe Fergeau  <cfergeau@redhat.com>

	Don't use "hw:0,0" for recording with alsa
	We currently hardcode this device when spicec needs to record with
	alsa. However, this doesn't interact well with PulseAudio, which
	means that if something is already using the recording device, spicec
	won't be able to open it again.
	Using "default" as the device will let spicec use the PulseAudio
	alsa support and will avoid this issue.

2012-01-23  Hans de Goede  <hdegoede@redhat.com>

	More comparison between signed and unsigned integer expressions warning fixes
	Turns out that more recent snapshots of gcc-4.7 emit even more of these,
	so the fixes which I've done before tagging the 0.10.1 release are not
	enough to build warning free with the latest gcc-4.7 snapshot <sigh>.

	This fixes this.

	Release 0.10.1

	Fix various comparison between signed and unsigned integer expressions warnings
	These turn into errors because of our -Werror use, breaking the build.

2012-01-23  Alon Levy  <alevy@redhat.com>

	server/red_channel: red_peer_handle_incoming: comment on null check

	server/tests/test_empty_success: fix warning on bzero

2012-01-23  Dan McGee  <dpmcgee@gmail.com>

	Use found python binary to check for pyparsing
	This matches what we do in client/Makefile.am to actually run the
	python scripts, which is to use the python binary we find first,
	preferring 'python2' over 'python'. This makes the compile work on odd
	systems such as Arch Linux where the python binary is actually python3.

	Remove epoll headers from client code
	There is no more usage of epoll on the client side, so no need to
	include these header files.

2012-01-23  Nahum Shalman  <nshalman-github@elys.com>

	server: don't complain if setsockopt(SO_PRIORITY) call fails
	dc7855967f4e did this for the TCP_NODELAY and IP_TOS calls; we should do
	it for priority as well if necessary.

	We also #ifdef the setting of the low-level socket priority based on
	whether we have a definition of SO_PRIORITY available. This option is
	not available on Illumos/Solaris platforms; however, since we set IP_TOS
	anyway it is not a big deal to omit it here.

2012-01-23  Dan McGee  <dpmcgee@gmail.com>

	server/inputs_channel: don't set O_ASYNC option on socket
	output to send a SIGIO signal to the running program. However, we don't
	handle this signal anywhere in the code, so setting the option is
	unnecessary.

	Update .gitignore with a few more generated files

	Fix git commit hook errors in red_worker
	This ensures all line lengths are down below 100 characters as well as
	removing some trailing spaces.

	Fix line length errors in main_channel
	These are all existing errors; fix them so they don't block future
	commits in this file unnecessarily.

	    error (1): length @ server/main_channel.c +369
	    error (2): length @ server/main_channel.c +444
	    error (3): length @ server/main_channel.c +764
	    error (4): length @ server/main_channel.c +932
	    error (5): length @ server/main_channel.c +1044

2012-01-22  Alon Levy  <alevy@redhat.com>

	docs/Spice_for_newbies.odt: some updates - added copy paste and wan mention, removed vdi_port

	server/red_channel: avoid segfault if stream == NULL

	client/foreign_menu: arm build fix

	import existing odt docs

2012-01-18  Hans de Goede  <hdegoede@redhat.com>

	server: Don't complain if setsockopt NODELAY fails on unix sockets
	With Daniel P. Berrange's patches to allow use of pre-supplied fd's
	as channels, we can no longer be sure that our connections are TCP
	sockets, so it makes no sense to complain if a TCP/IP specific
	setsockopt fails with an errno of ENOTSUP.

	Note that this extends Daniel's commit 492ddb5d1d595e2d12208f4602b18e4432f4e6b4
	which already added the same check to server/inputs_channel.c

2012-01-13  Daniel P. Berrange  <berrange@redhat.com>

	Add a 'syntax-check' make target
	The 'make syntax-check' target is used to perform various code
	style sanity checks, as well as to detect certain trivial error
	patterns. The target is placed in GNUmakefile, instead of Makefile.am
	since it relies on GNU specific make extensions.

	The actual GNUmakefile and maint.mk files are taken from the
	GNULIB project, unchanged

	The cfg.mk file is used to configure which of the syntax checks
	are activated, to allow addition of new project specific syntax
	checks, and to blacklist certain files which should not be checked

	* .mailmap: Add mapping for various broken email addrs in
	  commit log, to stop complaints about AUTHORS file missing
	  entries
	* GNUmakefile: define the 'syntax-check' rule
	* maint.mk: definition of standard syntax checks
	* cfg.mk: configuration for checks

	Remove trailing whitespace from end of lines

	Replace  test XXX -a YYY with test XXX && test YYY
	The '-a' and '-o' operators to test are not portable. Always
	combine two invocations of 'test' using || or && instead.

	Add missing includes of config.h
	Not all files were including config.h

	Remove bogus include of strings.h
	The tests include strings.h but don't need any of its functions

	Remove unused backup file
	The common/glc.c.save file appears to be a obsolete copy of
	glc.c

	Remove trailing blank lines
	Remove any blank lines at the end of all source files

	Remove 'the the' typos

	Remove unused assert.h include
	The assert.h include was never used in any code

	Always quote first arg to AC_DEFINE
	The first arg to AC_DEFINE should always be quoted

	Fix up copyright decl to always use 'Copyright (C) Red Hat, Inc.'
	A couple of files were missing '(C)' in the copyright header

	Improve usefulness of README file
	The COPYING file already contains the license text, so the README
	file need not repeat it. Instead put in a description of what
	SPICE is, simple install instructions & pointers to mailing lists
	and bug trackers

	Fill out the AUTHORS file with some content
	The AUTHORS file is empty, fill it in with a list of present and
	past maintainers, and email addresses of all people who have
	contributed patches

	Remove casts from void * with xrealloc() calls
	The xrealloc() function returns void*, so the return value
	never needs to be cast

	Rewrite code to avoid triggering warning about casting param to free()
	Since free() takes a void* parameters do not need to be cast.

	The existing code here is actally fine, but it trips up the
	syntax-check rule, so tweak it to an equivalent construct
	which passes the syntax check

	Remove useless if() before free()
	The free() function allows NULL to be passed in, so any
	code which puts a if() before free() is wasting time

	Death to all TABs
	Source files should all use spaces instead of tabs for
	indentation. Update the few files not already in
	compliance

2012-01-13  Alon Levy  <alevy@redhat.com>

	common/ssl_verify: special case to WIN32 that isn't MINGW32

	common/bitops: mingw32: reorder so __GNUC__ define is checked first

	common/backtrace: for mingw32 no pipe/wait_pid, just disable

	client/windows: fix several assigned but not used errors

	client/windows: arraysize(inf.bmiColors) == 1 in mingw32

	client/windows: fix typo, make error messages unique

	client/windows/main: mingw32 provides PACKAGE_VERSION

	client/common: mingw32: workaround HAVE_STDLIB_H redefined in jconfig.h

	client: mingw32 build needs the jpeg_boolean define

	client/common.h: mingw32 fix
	define PACKAGE_VERSION only ifndef __GNUC__
	Since it is defined by autoconf and so it kinda comes with using the GNU
	compilers.

	client/Makefile.am: mingw32 fixes
	* build resource file with windres
	* include client/windows and not client/x11
	* use CXIMAGE_CFLAGS (it's already set to -DDISABLE_CXIMAGE correctly)

	client: log command line (rhbz 767581)

2012-01-13  Hans de Goede  <hdegoede@redhat.com>

	client-x11: Fix building with gcc-4.7
	Without this change gcc says:
	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]
	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]
	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]
	cc1plus: all warnings being treated as errors

	smartcard handling: Fix compilation when ASSERT-s are turned on

2012-01-12  Yonit Halperin  <yhalperi@redhat.com>

	server: add support for SPICE_COMMON_CAP_MINI_HEADER
	Support for a header without a serial and without sub list.
	red_channel: Support the two types of headers.
	             Keep a consistent consecutive messages serial.
	red_worker: use urgent marshaller instead of sub list.
	snd_worker: Sound channels need special support since they still don't use
	            red_channel for sending & receiving.

	configure: spice-protocol >= 0.10.1 (mini header support)

	server: Limit the access to SpiceDataHeader of messages - only via red_channel.

	server/red_worker: pass remote caps to display/cursor red_channel_client's

	server/red_channel: introduce urgent marshaller
	When red_channel::red_channel_client_begin_send_message is called,
	the message that is pending in the urgent marshaller will be sent before
	the one in the main channel.
	The urgent marshaller should be used if in the middle of marshalling one message,
	you find out you need to send another message before. This functionality
	is equivalent to the sub_list messages. It will replace them in the following
	patches, when sub_list is removed from Spice data header.

	spice.proto: add SPICE_MSG_LIST to base channel

2012-01-12  Hans de Goede  <hdegoede@redhat.com>

	codegen: Fix enums.h generation
	With the new usbredir code we have the new concept of the abstract /
	generic spicevmc channel type (which just tunnels data from a qemu chardev),
	and we've the usbredir channel, which is the only current user of this.

	This was reflected in the protocols enum in spice-protocol.h by a manual
	edit done by me, my bad. This patch teaches spice.proto about the relation
	between the abstract spicevmc channel and the usbredir channel and
	modifies codegen to deal with this.

2012-01-09  Daniel P. Berrange  <berrange@redhat.com>

	Do not assume that SPICE is using a TCP socket
	If setting the TCP_NODELAY socket option fails with ENOTSUP,
	then don't treat this is a fatal error. SPICE is likely just
	running over a UNIX socket instead.

	* server/inputs_channel.c: Ignore TCP_NODELAY socket opt fails

	Allow auth to be skipped when attaching to pre-accepted clients
	When an applications passes in a pre-accepted socket for a
	client, they may well have already performed suitable authentication
	out of band. They should thus have the option to request that any
	spice authentication is skipped.

	* server/reds.c, spice.h: Add flag for skipping auth

	Add APIs for injecting a client connection socket
	Allow applications to pass a pre-accepted client socket file
	descriptor in. The new APIs are spice_server_add_ssl_client
	and spice_server_add_client

	* server/reds.c: Implement new APIs
	* server/spice.h: Define new APIs

	Move SSL setup out of reds_accept_ssl_connection
	To allow setup of an SSL client, from a passed in client
	socket, move all the SSL client initialization code out
	of reds_accept_ssl_connection and into a new method called
	reds_init_client_ssl_connection

	* server/reds.c: Introduce reds_init_client_ssl_connection

	Rename __reds_accept_connection into reds_init_client_connection
	Remove the accept() call from __reds_accept_connection and
	rename it to reds_init_client_connection. The caller is now
	responsible for accepting the new socket. The method
	reds_init_client_connection merely initializes it for
	usage.

	* server/reds.c: Add reds_init_client_connection

	Merge reds_accept_connection into reds_accept
	Neither reds_accept_connection or reds_accept are very long,
	so the split is pointless & increases code size for no gain.
	Merge them together to reduce code size

	* server/reds.c: Merge reds_accept_connection into reds_accept

2011-12-22  Hans de Goede  <hdegoede@redhat.com>

	spicevmc: Set sockopt nodelay for usbredir channels
	We want as little latency as possible with usb channels.

2011-12-22  Yonit Halperin  <yhalperi@redhat.com>

	server: don't reset the display channel when disconnecting all its clients ,FDBZ #43977
	The display channel was unnecessarily set to NULL when we disconnect all the clients
	(on flush display commands timeout).
	As a result, we recreated the display channel when a new client was connected.
	The display channel was created with default red_channel.client_cbs, while its
	correct client_cbs are the ones that are set by the red_dispatcher when it creates
	the first display_channel.
	This fix enforces a single creation of the display channel (per qxl), via the red_dispatcher.

2011-12-22  Uri Lublin  <uril@redhat.com>

	client: screen: fix typo _forec_update_timer
	sed -i 's/_forec_update_timer/_force_update_timer/' screen.cpp screen.h

	client: RedScreen::RedScreen: fix initialization order of _menu_needs_update
	Related to a91b0b3ff712eb2a7d91a951f2af7842495357c3

2011-12-20  Uri Lublin  <uril@redhat.com>

	client: foreign-menu: pass "active" param when creating a ForeignMenu (#769020)
	The default stays the same -- false.

	A race could prevent setting ForeignMenu::_active correctly.
	That happened when Application::on_app_activated was called before
	_foriegn_menu was created. When foriegn_menu was created its
	_active defaults to false, and that has not changed, until focus
	was taken out and back in spice-client window.

	This caused usbrdr to sometimes not auto-share devices, unless
	the user switched focus to a different application and back to
	spicec.

	The fix updates ForiegnMenu::_active upon creation.

	client: update menu if needed when exiting full-screen mode (#758260)

	client: menu: make RedWindow::set_menu() return an error-code (#758260)
	RedWindow::set_menu() can fail (on Windows when in fullscreen mode).
	For Windows spice-client, when in fullscreen mode, the system-menu
	is NULL.

	Returns 0 upon success, non-0 (currently only -1) upon failure.

	client controller/foreign_menu: use memmove instead of memcpy in readers
	When src/dst memory areas may overlap, it's safer to use memmove.

2011-12-18  Hans de Goede  <hdegoede@redhat.com>

	spicevmc: Fix assert when still connected on session disconnect (fdo#43903)
	Currently when the main channel disconnects while a spicevmc channel
	(such as a usbredir channel) is still connected, qemu will abort with the
	following message:
	ring_remove: ASSERT item->next != NULL && item->prev != NULL failed

	This is caused by red_client_destroy() first calling:
	rcc->channel->client_cbs.disconnect(rcc);
	And then calling:
	red_channel_client_destroy(rcc);

	For each channel. This is fine, but the spicevmc disconnect code does a
	red_channel_client_destroy(rcc) itself since as usb devices are added
	/ removed, the channels carrying their traffic get connected / disconnected
	and they get re-used for new devices, which won't work if the old channel is
	still there when the new connection comes in.

	This patch fixes the double destroy when there are still spicevmc channels
	connected by not doing the red_channel_client_destroy from the spicevmc
	disconnect code when not just the channel, but the entire client is
	disconnecting.

2011-12-15  Marc-André Lureau  <marcandre.lureau@redhat.com>

	build: remove unused variable

2011-12-15  Hans de Goede  <hdegoede@redhat.com>

	server/red_parse_qxl.h: License should be LGPLv2+ rather then GPLv2+
	Also fixup the header of server/red_parse_qxl.c, which still contained
	some GPL (program rather then library) text in its header.

2011-12-14  Marc-André Lureau  <marcandre.lureau@redhat.com>

	spelling: s/cupture/capture

2011-11-28  Jürg Billeter  <j@bitron.ch>

	server: Move $(Z_LIBS) from INCLUDES to LIBADD in Makefile.am
	This fixes undefined references to deflate* when building tests.

2011-11-24  Gal Hammer  <ghammer@redhat.com>

	client: handle the redundant right ctrl windows' message send when a alt-gr is pressed bz#709074
	Hello,

	The second patch check to see if Windows is sending a fake VK_CONTROL
	message when the user pressed Alt-Gr when using a non-US keyboard layout
	(German, Czech, etc...).

	If the function is_fake_ctrl return true and key event is translated to
	a REDKEY_INVALID and the event is discarded.

	     Gal.

	client: handle the redundant right ctrl windows' message send when a alt-gr is pressed bz#709074
	Hello,

	I first updated the translate_key function. It now requires the windows
	message as parameter (will be used later). It also use the raw wparam
	and lparam parameters in order to remove the code duplication when
	calling the function.

	     Gal.

2011-11-14  Arnon Gilboa  <agilboa@redhat.com>

	client: add xinerama support
	RHEL-6 Bugzilla: 695323

	cherry-picked from qspice commit
	 003667ac99beeec9b330a07bc3569c59a96d4588
	 which fixes RHEL-5 541566

	with merge of the one line qspice fix to SPICE_REQUIRES:
	 9f3fe4755f11044a45c4b21148466a997fcbf735
	 spice: fixed reference to xinerama pkg config file
	 (Xinerama.pc=>xinerama.pc)
	 Author: Yonit Halperin <yhalperi@redhat.com>

2011-11-10  Alon Levy  <alevy@redhat.com>

	Release 0.10.0

	Update NEWS for 0.10.0 release

	server/mjpeg_encoder: use size_t * consistently
	fix another 64 bit-ism. unsigned long != size_t in general.

	server/main_channel: fix pointer-to-int-cast error
	64 bit-ism removed.

	server/main_channel: use PRIu64 where needed

2011-11-08  Alon Levy  <alevy@redhat.com>

	server/spice-server.syms: fix 0.8 compatibility
	spice_server_migrate_connect is in 0.8.3 in the released 0.8 branch,
	and so should not be changed in 0.10. This doesn't break the 0.9.1
	release which didn't contain this symbol at all, only 0.9.2 release
	that hopefully no one actually packaged.

	server/red_worker: reuse dispatcher
	This patch reuses Dispatcher in RedDispatcher. It adds two helpers
	to red_worker to keep RedWorker opaque to the outside. The dispatcher is
	abused in three places that use the underlying socket directly:
	 once sending a READY after red_init completes
	 once for each channel creation, replying with the RedChannel instance
	  for cursor and display.

	FDO Bugzilla: 42463

	rfc->v1:
	* move callbacks to red_worker.c including registration (Yonit)
	* rename dispatcher to red_dispatcher in red_worker.c and red_dispatcher.c
	* add accessor red_dispatcher_get_dispatcher
	* s/dispatcher_handle_recv/dispatcher_handle_recv_read/ and change sig to
	  just Dispatcher *dispatcher (was the SpiceCoreInterface one)
	* remove SpiceCoreInterface parameter from dispatcher_init (Yonit)
	* main_dispatcher needed it for channel_event so it has it in
	  struct MainDispatcher
	* add dispatcher_get_recv_fd for red_worker

	server/dispatcher: add dispatcher_register_async_done_callback

	introduce DISPATCHER_{NONE,ACK,ASYNC}

	server: introduce dispatcher
	used for main_dispatcher only in this patch.

	Dispatcher is meant to be used for Main<->any low frequency messages.

	It's interface is meant to include the red_dispatcher usage:
	 fixed size messages per message type
	 some messages require an ack

	Some methods are added to be used by RedDispatcher later:
	 dispatcher_handle_read - to be called directly by RedDispatcher epoll
	  based loop
	 dispatcher_set_opaque - to be set from red_worker pthread
	 dispatcher_init - allow NULL core as used by red_worker

	Read and Write behavior:
	 Sender: blocking write, blocking read for ack (if any).
	 Reader: poll for any data, if such then blocking read for a
	 message_type and following message. repeat until poll returns
	 with no pending data to read.

	FDO Bugzilla: 42463

2011-11-07  Alon Levy  <alevy@redhat.com>

	server/red_dispatcher: remove semicolon from DBG_ASYNC

	server: add prefix argument to red_printf_debug
	printed before function name. No central location for prefixes.
	Adding "WORKER", "ASYNC", "MAIN" since those were the current users.

	server/red_dispatcher: support concurrent asyncs
	This is part of the dispatcher update, extracting the dispatcher routine
	from red_dispatcher and main_dispatcher into dispatcher.

	Supporting multiple async operations will make it natural to support
	async monitor commands and async guest io requests that could overlap in
	time.

	Use a Ring for AsyncCommands.

	Free Desktop Bugzilla: 42463

	Related FD: 41622

	common/spice_common.h: red_printf_debug: fix wrong sign

2011-11-02  Yonit Halperin  <yhalperi@redhat.com>

	Release 0.9.2

	client: support semi-seamless migration between spice servers with different protocols.
	It can't actually happen right now, since switch-host migration scheme will take
	place if the src/target server has protocol 1.
	(cherry picked from commit 4b2bf4d88c253502003aa5e4b93a045742eec9b4 branch 0.8)

	client: display channel - destroy all surfaces on disconnect
	Fix not destroying surfaces and other data (e.g., streams) upon disconnection.
	(cherry picked from commit 010b22cd771b7e81363b4b6521e4265b093fcd25 branch 0.8)

	client: display channel migration (cherry picked from commit cad3c585444f940f60c12789f4174f2d32bec70f branch 0.8)
	Conflicts:

		client/display_channel.cpp

	client: playback/record channels: implement on_disconnect (cherry picked from commit d3ed9d5e9d52ddcadcb3c8c77dd827b50071d813 branch 0.8)

	client: main channel migration: do partial cleanup when switching hosts
	Implement on_disconnect_mig_src and on_connect_mig_target in order to avoid
	unnecessary cleanups done in on_(disconnet|connect).
	In addition, do not request guest display settings changes after migration.
	(cherry picked from commit f91d202eb3bf631cf5e70277d1aabffec7da9393 branch 0.8)

	client: handle SPICE_MSG_MAIN_MIGRATE_END
	(1) disconnect all channels from the migration src
	(2) after all channels are disconnected, clean global resources
	(3) send SPICE_MSGC_MAIN_MIGRATE_END to migration target
	(4) wait for SPICE_MSG_MAIN_INIT
	(4) switch all channels to migration target
	(cherry picked from commit 510a4ff7c4f188fe6d0fb12198b8f9fdb74b9a2d branch 0.8)

	Conflicts:

		client/red_channel.h

	client: handle SpiceMsgMainMigrationBegin (semi-seamless migration)
	RHBZ 725009, 738270
	(cherry picked from commit 31ed2519a752b7332ed40d0d7ab02e938c0e65cb branch 0.8)

	Conflicts:

		client/red_client.cpp

	client: rewrite surfaces cache
	use std::map instead of a specific template (CHash).
	There is no need for special template. Moreover, using
	std::map will allow easy iteration over the surfaces.
	(cherry picked from commit fcb3b4ce5231218bcf949da4270bd85a2cfb3535 branch 0.8)

	Conflicts:

		client/display_channel.cpp

	server: turn spice_server_migrate_start into a valid call
	We will add a qemu call to spice_server_migrate_start when migration starts.
	For now, it does nothing, but we may need this notification in the future.
	(cherry picked from commit b8213167717979e6f2fb52646e43eb458634e6a1 branch 0.8)

	server: handling semi-seamless migration in the target side
	(1) not sending anything to a migrated client till we recieve SPICE_MSGC_MIGRATE_END
	(2) start a new client migration (handle client_migrate_info) only after SPICE_MSGC_MIGRATE_END
	    from the previous migration was received for this client
	(3) use the correct ticket

	Note: we assume the same channles are linked before and ater migration. i.e.,
	      SPICE_MSGC_MAIN_ATTACH_CHANNELS is not sent from the clients.

	server: move the linking of channels to a separate routine

	server: handle spice_server_migrate_end
	If the migration has completed successfully:
	(1) send MSG_MAIN_MIGRATE_END to the clients that are connected to the target
	(2) send MSG_MAIN_SWITCH_HOST to all the other clients

	If the migration failed, send MSG_MAIN_MIGRATE_CANCEL to clients that are
	connected to the target.

	(cherry picked from commit 4b82580fc36228af13db4ac3c403753d6b5c40b5 branch 0.8;
	 Was modified to support multiple clients, and the separation of main_channel from reds)

	Conflicts:

		server/reds.c

	spice.proto: add SPICE_MSG_MAIN_MIGRATE_END & SPICE_MSGC_MAIN_MIGRATE_END
	(cherry picked from commit cfbd07710562e522179ae5a7085a789489a821bb branch 0.8)

	server,proto: tell the clients to connect to the migration target before migraton starts
	(1) send SPICE_MSG_MAIN_MIGRATE_BEGIN upon spice_server_migrate_connect
	    (to all the clients that support it)
	(2) wait for SPICE_MSGC_MAIN_MIGRATE_(CONNECTED|CONNECT_ERROR) from all the relevant clients,
	    or a timeout, in order to complete client_migrate_info monitor command
	(cherry picked from commit 5560c56ef05c74da5e0e0825dc1f134019593cad branch 0.8;
	 Was modified to support the separation of main channel from reds, and multiple clients)

	Conflicts:

		server/reds.c

	configure: spice-protocol >= 0.9.1 (semi-seamless migration protocol) (cherry picked from commit 55ccc022ec9829523ebe36fdf0ec7c593ce76c22 branch 0.8)
	Conflicts:

		configure.ac

	server: handle migration interface addition
	(cherry picked from commit 3ac0075cdac8fa42de47a7882022795e96cb1fee branch 0.8)

	Conflicts:

		server/reds.h

	server/spice.h: semi-seamless migration interface, RHBZ #738266
	semi-seamless migration details:

	migration source side
	---------------------
	(1) spice_server_migrate_connect (*): tell client to link
	    to the target side - send SPICE_MSG_MAIN_MIGRATE_BEGIN.
	    This should be called upon client_migrate_info cmd.
	    client_migrate_info is asynchronous.
	(2) Complete spice_server_migrate_connect only when the client has been connected
	    to the target - wait for SPICE_MSGC_MAIN_MIGRATE_(CONNECTED|CONNECT_ERROR) or a timeout.
	(3) spice_server_migrate_end: tell client migration it can switch to the target - send
	    SPICE_MSG_MAIN_MIGRATE_END.
	(4) client cleans up all data related to the connection to the source and switches to the target.
	    It sends SPICE_MSGC_MAIN_MIGRATE_END.

	migration target side
	---------------------
	(1) the server identifies itself as a migraiton target since the client is linked with (connection_id != 0)
	(2) server doesn't start the channels' logic (channel->link) till it receives SPICE_MSGC_MAIN_MIGRATE_END
	    from the client.

	*   After migration starts, the target qemu is blocked and cannot accept new spice client
	    connections. Thus, we trigger the connection to the target upon client_migrate_info
	    command.
	(cherry picked from commit 6e56bea67c5648b0c81990171d4bc0cf1a402043 branch 0.8)

	Conflicts:

		server/spice.h

	server: set & test channel capabilities in red_channel
	The code for setting and testing channel capabilities was
	unnecessarily duplicated. Now it is in red_channel.
	RedsChannel was dropped from Reds; It was used only for holding
	the channels common capabilities, which are now held in RedChannel.

2011-10-31  Alon Levy  <alevy@redhat.com>

	[0.8 branch] server: add main_dispatcher
	add main_dispatcher, a message passing mechanism for sending messages to
	the main thread. The main thread is the thread that implements
	SpiceCoreInterface, which is assumed to be a single thread.

	Similar to the async operation of red_worker, a socket pair is created
	and used to pass messages. The messages are a fixed size to ease
	parsing. A single message is defined to pass a channel_event.

	RHBZ: 746950
	FDBZ: 41858

	This patch is 0.8 branch only, for the master branch there should be a
	better approach to share code with red_dispatcher and ready the way for
	later adding more threads.

	cherry-pick from 0.8 80caf07e09efe14c67f89a3c01501a6a39681167

	Conflicts:

		server/reds.c

2011-10-23  Liang Guo  <bluestonechina@gmail.com>

	spice-server.pc.in: move Requires to Requires.private
	When using pkg-config, Requires and Requires.private field list
	packages required by this package, but packages listed under
	Requires.private are not taken into account when a flag list is
	computed for dynamically linked executable. In the situation
	where each .pc file corresponds to a library, Requires.private
	shall be used exclusively to specify the dependencies between
	the libraries.

2011-10-18  Yonit Halperin  <yhalperi@redhat.com>

	server/red_worker: fix placing of ASSERT(red_channel_client_no_item_being_sent) (fdbz #41523)
	Call ASSERT(red_channel_client_no_item_being_sent) only if
	red_wait_outgoing_item/s did not timeout.

2011-10-05  Christophe Fergeau  <cfergeau@redhat.com>

	client/x11: reset screen positions in XMonitor::do_restore
	XMonitor::do_restore (called for example when going out of
	fullscreen) restore the screen resolution to its previous state,
	but it doesn't take care of repositioning the screen to their
	previous position, which is one of the advantages of using randr
	1.2.
	Since MultyMonScreen::restore handles all of this for us, just call
	it to restore the monitor position/resolutions to their previous
	settings. Before doing any changes, MultyMonScreen::restore checks
	if there's something to do, so calling it once per monitor won't be
	an issue, the resolution/position will only be set the first time.

	This has the side-effect of fixing bug #693431. This bug occurs when
	closing the client after the client went in and out of fullscreen.
	MultyMonScreen::~MultyMonScreen calls MultyMonScreen::restore, which
	decides to change the screen positions since they were lost when going
	to fullscreen because XMonitor::restore didn't restore the positions.
	After this change, the positions will be properly restored and
	MultyMonScreen::restore won't be needlessly called upon client
	shutdown.

	client/x11: fix mode setting in MultyMonScreen::restore
	MultyMonScreen::restore changes the X11 Screen resolution, but it
	doesn't use MultyMonScreen::set_size. This means
	MultyMonScreen::_width and MultyMonScreen::_height don't get
	updated to reflect the new resolution settings, which could cause
	issues later on. Until now this was safe since the only caller of
	MultyMonScreen::restore was MultyMonScreen destructor.

	client/x11: fix typos (finde => find)

2011-09-20  Christophe Fergeau  <cfergeau@redhat.com>

	client: fix typo commnad=>command

2011-09-19  Christophe Fergeau  <cfergeau@redhat.com>

	client: don't crash when booting a Xinerama setup
	In a Xinerama setup, when X starts up and creates one of the
	secondary screens, first a non-primary surface is created on the
	secondary screen, and then the primary surface for this screen is
	created.
	This causes a crash when the guest uses Xinerama and the client
	is attached to the VM before X starts (ie while the guest is
	booting).
	This happens because DisplayChannel::create_canvas (which is called
	when creating a non-primary surface) assumes a screen has already been
	set for the DisplayChannel while this only happens upon primary surface
	creation. However, it uses the screen for non important stuff, so we
	can test if screen() is non NULL before using it. This is what is done
	in other parts of this file.

	Fixes rhbz #732423

	replace warning with comment in glz_usr_free_image
	When running some xinerama tests, I got several
	glz_usr_free_image: error
	messages. Looking at the code, this error is reported when this
	function is called from a different DisplayChannelClient than the
	one which created the glz compressed image.
	When this happens, the backtrace is
	    at glz_encoder_dictionary.c:362
	    0x7fff940b6670) at glz_encoder_dictionary.c:449
	    image_type=LZ_IMAGE_TYPE_RGB32, image_width=512, image_height=256, image_stride=2048, first_lines=0x0,
	    num_first_lines=0, usr_image_context=0x7fff7420da40, image_head_dist=0x7fff9b2a3194)
	    at glz_encoder_dictionary.c:570
	    top_down=4, lines=0x0, num_lines=0, stride=2048, io_ptr=0x7fff740ea7c0 "  ZL", num_io_bytes=65536, usr_context=
	    0x7fff7420da40, o_enc_dict_context=0x7fff7420da60) at glz_encoder.c:255
	    drawable=0x7fff9b46bc08, o_comp_data=0x7fff9b2a3350) at red_worker.c:5753
	    0x7fff9b46bc08, can_lossy=0, o_comp_data=0x7fff9b2a3350) at red_worker.c:6211
	    0x7fff9b46bc08, can_lossy=0) at red_worker.c:6344
	    0x7fff74085c50, dpi=0x7fff7445b890, src_allowed_lossy=0) at red_worker.c:7046
	    0x7fff7445b890) at red_worker.c:7720
	    at red_worker.c:7964
	    at red_worker.c:8431

	Since the glz dictionary is shared between all the
	DisplayChannelClient instances that belong to the same client, it can
	happen that the glz dictionary code decides to free an image from one
	thread while it was added from another thread (thread ==
	DisplayChannelClient), so the error message that is printed is not an
	actual error. This commit removes this message and adds a comment
	explaining what's going on.

2011-09-15  Christophe Fergeau  <cfergeau@redhat.com>

	fix typos
	applicaion => application
	Attache => Attach
	Detache => Detach
	_layes => _layers

2011-09-05  Christophe Fergeau  <cfergeau@redhat.com>

	server: fix function prototypes
	Several functions in server/ were not specifying an argument list,
	ie they were declared as void foo(); When compiling with
	-Wstrict-prototypes, this leads to:
	test_playback.c:93:5: erreur: function declaration isn’t a prototype
	[-Werror=strict-prototypes]

2011-09-01  Marc-André Lureau  <marcandre.lureau@redhat.com>

	fix bug #692833

2011-09-01  Christophe Fergeau  <cfergeau@redhat.com>

	add C++ guards to backtrace.h
	Without these, spice_backtrace() can't be used from the C++ client
	code.

	server: init all fields on SpiceMsgDisplayStreamCreate
	red_display_marshall_stream_start initializes a
	SpiceMsgDisplayStreamCreate structure before marshalling it and
	sending it on the wire. However, it never fills
	SpiceMsgDisplayStreamCreate::stamp which then causes a complaint
	from valgrind. This patch sets this value to 0, it's not used
	by the client so the value shouldn't matter.

	fix valgrind warning in test_display__stream
	create_test_primary_surface::test_display_base.c creates a
	QXLDevSurfaceCreate structure and initialize it, but doesn't set
	the position field. Moreover, this structure has 4 bytes of padding
	to the end (as shown by pahole from dwarves), so initialize the whole
	structure to 0 before using it.

2011-08-25  Hans de Goede  <hdegoede@redhat.com>

	Fixup NEWS entry for multiclient

	Release 0.9.1

	fix more inverted memset parameters

2011-08-25  Christophe Fergeau  <cfergeau@redhat.com>

	fix leak in do_jpeg_encode
	Issue found by the Coverity scanner.

	HDG: Fixup don't free RGB24_line if it was not allocated by do_jpeg_encode

	fix memory leak in error path
	Issue found by the Coverity scanner

	fix inverted memset parameters
	Issue found by the Coverity scanner.

2011-08-25  Hans de Goede  <hdegoede@redhat.com>

	Rename usbredir channel code to spicevmc
	While discussing various things with Alon in Vancouver, it came up that
	having a channel which simply passes through data coming out of a qemu
	chardev frontend unmodified, like the usbredir channel does, can be used
	for a lot of other cases too. To facilitate this the usbredir channel code
	will be turned into a generic spicevmc channel, which is just a passthrough
	to the client, from the spicevmc chardev.

	This patch renames usbredir.c to spicevmc.c and changes the prefix of all
	functions / structs to match. This should make clear that the code is not
	usbredir specific.

	Some examples of why having a generic spicevmc pass through is good:
	1) We could add a monitor channel, allowing access to the qemu monitor from
	the spice client, since the monitor is a chardev frontend we could re-use
	the generic spicevmc channel server code, so all that is needed to add this
	(server side) would be reserving a new channel id for this.

	2) We could allow users to come up with new channels of their own, without
	requiring qemu or server modification. The idea is to allow doing something
	like this on the qemu startup cmdline:
	-chardev spicevmc,name=generic,channelid=128

	To ensure these new "generic" channels cannot conflict with newly added
	official types, they must start at the SPICE_CHANNEL_USER_DEFINED_START value
	(128).

	These new user defined channels could then either be used with a special
	modified client, with client plugins (if we add support for those), or
	by exporting them on the client side for use by an external ap, see below.

	3) We could also add support to the client to make user-defined channels
	end in a unix socket / pipe, allowing handling of the data by an external app,
	we could for example have a new spice client cmdline argument like this:
	--custom-channel unixsocket=/tmp/mysocket,channelid=128

	This would allow for something like:
	$random app on guest -> virtio-serial -> spicevmc chardev ->
	 -> spicevmc channel -> unix socket -> $random app on client

	4) On hind sight this could also have been used for the smartcard stuff,
	with a 1 channel / reader model, rather then the current multiplexing code
	where we've our own multiplexing protocol wrapper over the libcacard
	smartcard protocol.

	usbredir: Merge UsbRedirState and UsbRedirChannel
	Now that the Channel struct is gone and the RedChannel has the same lifetime
	as the chardev interface there is no need to have these 2 separate.

	usbredir: Fix crash caused by MC changes

	usbredir: Ensure that our msg_rcv_buf is not used re-entrantly

	red_channel: Fix msg buf memleak on parser error

2011-08-25  Yonit Halperin  <yhalperi@redhat.com>

	client: setting monitors resolution before resizing screens, RHBZ #728252
	fix for "client: fix endless recursion in rearrange_monitors, RHBZ #692976"

2011-08-23  Alon Levy  <alevy@redhat.com>

	server: add tester and todo for multiple client support

	server/snd_worker.c: add reference counting to SndChannel
	Fixes a valgrind discovered possible bug in spice-server - valgrind on
	test_playback saw it, didn't see it happen with qemu.

	The problem is that the frames buffers returned by spice_server_playback_get_buffer
	are part of the malloc'ed SndChannel, whose lifetime is smaller then that of SndWorker.
	As a result a pointer to a previously returned spice_server_playback_get_buffer could
	remain and be used after SndChannel has been freed because the client disconnected.

	server/reds: reds_client_disconnect: remove wrong check for reds_main_channel_connected
	The "channel->disconnecting" parameter already protects against recursion.

	Removed fixed TODOs.

	server/reds: fix reds_main_channel_connected
	instead of checking just for reds->main_channel check that there is at least
	one client as well.

	server: add public spice_server_get_num_clients

	server/snd_worker.c: add red_channel_client_destroy_dummy

	server/red_channel: release channel allocated message  buffer
	handler->cb->release_msg_buf was not being called except in the error path,
	causing a memory leak.

	server/main_channel: reduce verbose agent data command
	by using the new SPICE_DEBUG_LEVEL.

2011-08-23  Yonit Halperin  <yhalperi@redhat.com>

	drawables count for debug

	server: registering RedChannel in reds, instead of Channel
	Merging the functionality of reds::channel, into RedChannel.
	In addition, cleanup and fix disconnection code: before this patch,
	red_dispatcher_disconnect_display_client
	could have been called from the red_worker thread
	(and it must be called only from the io thread).

	RedChannel holds only connected channel clients. RedClient holds all the
	channel clients that were created till it is destroyed
	(and then it destroys them as well).

	Note: snd_channel still doesn't use red_channel, however it
	creates dummy channel and channel clients, in order to register itself
	in reds.

	server/red_channel.c: a channel is connected if it holds at least one channel client

	Previously I changed RedChannel to hold only connected channel clients and
	RedClient, to hold all the channel clients as long as it is not destroyed.

	usbredir: multichannel has not been tested, it just compiles.

	server/red_channel.c inroducing client_cbs
	client_cbs are supposed to be called from client context (reds). This patch will be used
	in future patches for relacing reds::Channel with RedChannel in order to eliminate redundancy.

	server/red_channel.c: pack all channel callbacks to ChannelCbs

2011-08-23  Alon Levy  <alevy@redhat.com>

	server/red_worker: add ref counting to RedDrawable
	introduces ref_red_drawable and put_red_drawable (rename from free_red_drawable)

	RedDrawable is already references by Drawable and RedGlzDrawable, with
	a hack to NULL the drawable field in RedGlzDrawable to indicate RedGlzDrawable
	is the last reference holder. Using an explicit reference count instead.

	server/red_worker: add stream_count (for debug purposes)

	server/red_worker: validate_surface: print paniced surface_id

	server/red_worker: no panic on double destroy primary

	server/red_worker: DEBUG_CURSORS
	Add cursor allocation debugging code that is turned off as long as
	DEBUG_CURSORS is not defined.

	server/red_worker: on_new_display_channel_client: push ack, cleanup
	small cleanup patch, only functional change is sending a set ack message.

	server/red_worker: add cursor_channel_client_disconnect
	makes RED_WORKER_MESSAGE_CURSOR_DISCONNECT_CLIENT disconnect only a
	single client.

	server/red_worker: remove forced disconnect on connect

2011-08-23  Yonit Halperin  <yhalperi@redhat.com>

	server/red_worker.c: fix CursorPipeItem leak
	CursorPipeItems and their corresponding cursor_item were not
	freed when they were removed from the pipe without sending them.
	In addition cursor_channel_hold_pipe_item used wrong conversion
	to (CursorItem*) for a (CursorPipeItem*).

2011-08-23  Alon Levy  <alevy@redhat.com>

	server/red_worker: split cursor pipe item from cursor item
	Required to support multiple clients.
	Also changes somewhat the way we produce PIPE_ITEM_TYPE_LOCAL_CURSOR. Btw,
	I haven't managed to see when we actually produce such an item during my
	tests.

	Previously we had a single pipe item per CursorItem, this is impossible
	with two pipes, which happens when we have two clients.

	server/red_worker: whitespace fixes

	server/reds: add RedsState.allow_multiple_clients
	Currently set by environment variable SPICE_DEBUG_ALLOW_MC (any value means
	to allow multiple connections). Later will be set by spice api from qemu.

	server/red_channel: introduce client ring in RedChannel
	Also adds Drawable pipes and glz rings.

	main_channel and red_worker had several locations that still accessed rcc
	directly, so they had to be touched too, but the changes are minimal.

	Most changes are in red_channel: drop the single client reference in RedChannel
	and add a ring of channels.

	Things missing / not done right in red_worker:
	 * StreamAgents are in DCC - right/wrong?
	 * GlzDict is multiplied - multiple compressions.

	We still are missing:
	 * remove the disconnect calls on new connections

	server/red_channel: add pipe_size helpers

	server/red_worker: remove more direct access to RedChannelClient.rcc

2011-08-23  Yonit Halperin  <yhalperi@redhat.com>

	server/red_worker.c: make dictionary and cache different per client
	There is no inter-client shared dictionary and cache yet.

	At this point the display channel can be used by multiple clients.

	You can still crash on lack of Drawables or CursorItems due to the slower
	clients pipe growing uncontrollably.

2011-08-23  Alon Levy  <alevy@redhat.com>

	server/red_worker: multiple client support - base split
	This patch compiles but breaks spice.

	Split both display and cursor channels to a client part and channel part.

	Introduce DisplayChannelClient, CursorChannelClient, CommonChannelClient.
	don't disconnect channel on client disconnect.
	Move all caches to the ChannelClient's.

	Remove reference counting of the channel.

	No new functionality introduced.

	NOTE: Introduces a crash in disconnections, a regression, resulting from
	incorrect thread access, that is fixed in the patch titled:
	"server: registering RedChannel in reds, instead of Channel"

	server/red_worker: cleanup

	server/smartcard: support multiple clients
	each client supplying a smartcard channel gets it's own smartcard. If
	there are not enough smartcards provided by the server (read: qemu)
	then it will be as though there are none.

	currently disabled - later patches that enable smartcard don't make
	this channel available to any but the first client.

	server/red_tunnel_worker: trivial multi client support
	s/TunnelChannel/TunnelChannelClient/

	That's about it.  this is probably the wrong way to do it. Not tested
	at all. What do we want, a separate interface per client? same interface
	for all clients? probably the later. This doesn't do that. Not tested,
	so probably doesn't even work.

	changes red_channel_pipe_item_is_linked to red_channel_client_pipe_item_is_linked,
	since tunnel channel is the only user, must be done in patch to not break compilation.

	server/inputs_channel: support multiple clients
	from server events are broadcast - leds change. The rest is client
	to server, so it is just passed on.

	server/main_channel: support multiple clients
	The main channel deals with connecting new clients, announcing mouse mode
	changes, and the agent channel. The implementation is currently done without
	any changes to the protocol, so everything has to be either broadcast or
	to a specific client.

	 channels list - specific client
	 mouse mode - broadcast
	 agent - broadcast
	 notify - broadcast (should have two modes, and use the appropriate)

	Notable TODOs:
	 * migration testing
	 * agent tokens are wrongly sent (or did I fix that? check)

	server/red_channel: introduce pipes functions
	Introduce functions to add (via producer method) the same item to multiple
	pipes, all for the same channel.

	Note: Right now there is only a single channel, but the next patches will do the
	per-channel breakdown to channel and channel_client before actually introducing
	a ring in RedChannel, this makes it easier to make smaller changes - the
	channel->rcc link will exist until removed in the ring introducing patch.

	server/red_channel: ignore error if already shutdown
	on red_channel_peer_on_incoming_error, if we are already shutdown, do not
	call the channel's error handler. Since the channel has been shutdown, we
	assume this is a second or later error, and handling has already occured.

	server/main_channel: move connection_id from reds
	Expose additional api to find a client given a connection_id. The connection_id
	is first set when the first channel connects, which is the main channel.
	It could also be kept in the RedClient instead, not sure.

	TODO:
	 multiple todo's added for multiclient handling. I don't remember why
	 I wrote them exactly, and besides if I did any migration tests. So: TODO.

	server/main_channel: move ping here from reds.
	cleanup only. Note that the ping function is half used since the opt parameter
	stopped being called with anything but NULL, should be returned at some point,
	specifically when we drop the 250kbyte ping on start and do a continuous check
	for latency and bandwidth.

	See:
	 81945d897 - server: add new vd interface QTerm2Interface, Yaniv Kamay
	  introducing the usage of ping with a non NULL opt
	 3f7ea8e7a - zap qterm interfaces, Gerd Hoffman
	  removing it

	server/main_channel: move latency and bitrate to channel client
	They were globals before. This introduces api for other channels
	to query the low bandwidth status. The queries themselves are still done
	from the wrong context (channel and not channel client) but that's because
	the decoupling of channel and channel client will be done in the following
	patches.

	Note that snd_worker.c got two copied function declarations that belong to
	main_channel.h but can't be easily dragged into snd_worker.c since it still
	uses it's own RedChannel struct.

	server/reds: add concept of secondary channels
	Secondary channels are those that don't support multiple clients. The
	support added in this patch just doesn't let the second or more connected
	client receive the unsupported channels in the channels list sent by the
	server to the client. This doesn't handle the situation where:

	client A connects (gets all channels)
	client B connects (gets supported multiple client channels)
	client A disconnects (Suboptimal 1: B doesn't get new channels at this point)
	client C connects (Suboptimal 2: C doesn't get the full list of channels, but
	the partial one)

	Specifically the channels that only support a single client are:
	 sound (both playback and record channels)
	 smartcard
	 tunnel

	server: Add RedClient
	That means RedClient tracks a ring of channels. Right now there will be only
	a single client because of the disconnection mechanism - whenever a new
	client comes we disconnect all existing clients. But this patch adds already
	a ring of clients to reds.c (stored in RedServer).

	There is a known problem handling many connections and disconnections at the
	same time, trigerrable easily by the following script:

	export NEW_DISPLAY=:3.0

	Xephyr $NEW_DISPLAY -noreset &
	for ((i = 0 ; i < 5; ++i)); do
	    for ((j = 0 ; j < 10; ++j)); do
	        DISPLAY=$NEW_DISPLAY c_win7x86_qxl_tests &
	    done
	    sleep 2;
	done

	I fixed a few of the problems resulting from this in the same patch. This
	required already introducing a few other changes:
	 * make sure all removal of channels happens in the main thread, for that
	 two additional dispatcher calls are added to remove a specific channel
	 client (RED_WORKER_MESSAGE_CURSOR_DISCONNECT_CLIENT and
	 RED_WORKER_MESSAGE_DISPLAY_DISCONNECT_CLIENT).
	 * change some asserts in input channel.
	 * make main channel disconnect not recursive
	 * introduce disconnect call back to red_channel_create_parser

	The remaining abort is from a double free in the main channel, still can't
	find it (doesn't happen when running under valgrind - probably due to the
	slowness resulting from that), but is easy to see when running under gdb.

	server/main_channel+reds: make main_channel_init return MainChannelClient
	This makes it easier to introduce RedClient in the next patch.

	server/red_worker: release PIPE_ITEM_TYPE_VERB in display channel
	We send a SPICE_MSG_DISPLAY_MARK verb.

	server/red_client: clear pipe on disconnect

	server/red_channel: workaround for fast client disconnect bug (TODO - real fix)

	server/main_channel: use MainChannel in sig
	use MainChannel* instead of Channel* for a many functions in main_channel.h
	(affects main_channel.c and reds.c).

	some one liner fixes are hidden in here too.

	server: move pipe from RedChannel to RedChannelClient
	Another cleanup patch, no change to behavior (still one client, and it
	disconnects previous client if any).

	The implementation for multiple client is straightforward: the pipe
	remains per (channel,client) pair, so it needs to move from the RedChannel
	that to RedChannelClient. Implementation using a single pipe with multiple
	consumers (to reflect different latencies) doesn't fit well with pipe rewriting
	that is used by the display channel. Additionally this approach is much simpler
	to verify. Lastly it doesn't add considerable overhead (but see the display
	channel changes in a later patch for a real place to rethink).

	This patch is just technical, changing signatures to reflect the first
	argument (oop style) so red_channel becomes red_channel_client. Some places
	may seem odd but they should be fixed with later comits where the channels
	grow to support multiple clients.

	Sound (playback/record) channels are the only ones not touched - this is
	consistent with previous patches, since they have been left out of the
	RedChannel refactoring.  That is left as future work. (note that they don't use
	a pipe, which was the reason for not refactoring).

	server/red_worker: introduce {display,cursor}_is_connected
	Instead of checking for worker->{display,cursor}_channel directly.

	server/red_channel (all): introduce RedChannelClient
	This commit adds a RedChannelClient that now owns the stream connection,
	but still doesn't own the pipe. There is only a single RCC per RC
	right now (and RC still means RedChannel, RedClient will be introduced
	later). All internal api changes are in server/red_channel.h, hence
	the need to update all channels. red_worker.c is affected the most because
	it makes use of direct access to some of RedChannel still.

	API changes:

	 1. red_channel_client_create added.
	  rec_channel_create -> (red_channel_create, red_channel_client_create)
	 2. two way connection: rcc->channel, channel->rcc (later channel will
	  hold a list, and there will be a RedClient to hold the list of channels
	  per client)
	 3. seperation of channel disconnect and channel_client_disconnect

	TODO:
	 usbredir added untested.

	server/red_worker: drop red_pipe_add_tail, use red_channel_pipe_add_tail
	The only difference between them being that the later also does a push.
	I don't believe that to be a problem, but if it does I can always introduce
	a push'less version.

	server/red_channel: renames to use _proc postfix consistently
	rename types - we use _proc suffix mostly to indicate function pointer types,
	use it for some function pointers that were missing it.

	s/channel_handle_migrate_flush_mark/channel_handle_migrate_flush_mark_proc/
	s/channel_handle_migrate_data_get_serial/channel_handle_migrate_data_get_serial_proc/
	s/channel_handle_migrate_data/channel_handle_migrate_data_proc/

	spice.proto: add comment for origin of STYLED and START_WITH_GAP

	server/red_worker: explicitly include unistd and errno

	common: introduce red_printf_debug

	server/tests/test_playback: correctly use spice_server_playback_get_buffer
	and spice_server_playback_put_samples. The former retrieves a buffer from a free
	list with spice_server_playback_get_buffer, and should be used once via
	spice_server_playback_put_samples. The tester previously reused the same buffer
	a number of times.

	server/tests/basic_event_loop: multiple fixes
	reuse common/ring.h
	ignore SIGPIPE
	fix handling of removed watches

	tests/migrate.py: add --vdagent
	Adds the required options to provide a vdagent to the guest in both source and target qemu
	instances.

	This will be the last update of the in spice git tests directory, I've moved those tests
	to the repository spice-tests. The longer term goal remains autotest integration, but since
	this test (and some minor others for qemu) need a home it is:

	http://cgit.freedesktop.org/~alon/spice-tests/

	(I'm reluctant to put it under spice/ because of my wish to go to autotest, but still, there
	they are. Nothing as permanent as the temporary).

	Independent (of external modules, i.e. qemu) tests (server/tests) should remain in tree.

2011-08-23  Yonit Halperin  <yhalperi@redhat.com>

	server/red_worker.c: fix - locking the wrong mutex when releasing glz dict

2011-08-23  Alon Levy  <alevy@redhat.com>

	server/tests/test_display_base: fix compile

	common/ring: RING_FOREACH_SAFE: use shorter version from qemu

	server/reds.h: explicitly include config.h

	server/tests/migrate.py: make executable

2011-08-17  Christophe Fergeau  <cfergeau@redhat.com>

	use Xkb to get keyboard modifier mask
	To be able to enable/disable keyboard leds on X11, we need to query
	the X server for which mask correspond to which led (NumLock,
	CapsLock). So far this was done using XKeysymToKeycode and iterating
	over X modifier mapping.
	Xkb provides XkbKeysymToModifiers for this purpose, and since
	we're using Xkb anyway, it makes more sense to use it.

	At some point, on my Fedora 15 box, XKeysymToKeycode was returning
	NoSymbol for CapsLock and NumLock leading to spicec not being able
	to change the keyboard leds when qemu tells it to. However, I couldn't
	reproduce this when I tried again :-/

	fix harmless typo in InputsChannel::handle_modifiers
	InputsChannel::handle_modifiers converts _modifiers which is a
	bitflag of SPICE_KEYBOARD_MODIFIER_FLAGS_* to a Platform::*_MODIFIER
	bitflag, which is what Platform::set_keyboard_lock_modifiers expects.
	However, it's called with _modifiers, and the bitflag that this
	function computes is never used. Pass the computed bitflag to
	::set_keyboard_lock_modifiers since _modifiers format is meaningless
	for ::set_keyboard_lock_modifiers.
	This bug was harmless because the two different set of modifier
	flags actually use the same values, so _modifiers and modifiers could
	be used interchangeably. However it's more future-proof to use the
	right format here.

2011-08-15  Christophe Fergeau  <cfergeau@redhat.com>

	fix 2 X11 related leaks

	channel: fix EVP_PKEY leak

	always set VDAgentDisplayConfig::depth
	Even if VDAgentDisplayConfig::depth will be unused if the
	VD_AGENT_DISPLAY_CONFIG_FLAG_SET_COLOR_DEPTH isn't set, it's
	better to initialize it anyway to avoid warnings from valgrind.

2011-08-10  Hans de Goede  <hdegoede@redhat.com>

	server: Add a usbredir channel

2011-08-03  Alon Levy  <alevy@redhat.com>

	client/red_client: fix broken switch host migration (RHBZ 727969)
	3f8d7e59dbd94b1837503f37b5065698df3ffbc7 introduced a regression, after
	sending one attach_channels message we never send another one.
	Fix by resetting on disconnect.

2011-08-02  Christophe Fergeau  <cfergeau@redhat.com>

	mjpeg: add missing SPICE_BITMAP_FMT_RGBA
	I forgot to handle SPICE_BITMAP_FMT_RGBA when mapping from
	spice image formats to libjpeg-turbo colorspaces.

2011-08-02  Liang Guo  <bluestonechina@gmail.com>

	Fix typo: treshold -> threshold

	Fix typo: seperator -> separator

2011-08-01  Christophe Fergeau  <cfergeau@redhat.com>

	mjpeg: fix libjpeg assertion
	After the changes to add libjpeg-turbo support to spice-server mjpeg
	compression code, it's relatively easy to hit an assertion from
	libjpeg in spice-server about "too few scanlines transferred" when
	the mjpeg streaming code triggers. This assertion brings down qemu,
	which is bad :)

	This is because when we first initialize the mjpeg encoder, we do:

	stream_width = SPICE_ALIGN(src_rect->right - src_rect->left, 2);
	stream_height = SPICE_ALIGN(src_rect->bottom - src_rect->top, 2);

	stream->mjpeg_encoder = mjpeg_encoder_new(stream_width, stream_height);

	and then when we iterate over the image scanlines to feed them to
	libjpeg, we do:

	const int image_height = src->bottom - src->top;
	const int image_width = src->right - src->left;

	for (i = 0; i < image_height; i++) {
	    mjpeg_encoder_encode_scanline(...);
	}
	mjpeg_encoder_end_frame(...);

	When stream_height is odd, the mjpeg_encoder will be created with
	an height that is 1 more than the number of lines we encode. Then
	libjpeg asserts when we tell it we're done with the compression
	while it's still waiting for one more scanline.

	Looking through git history, this rounding seems to be an artifact
	from when we were using ffmpeg for the mjpeg encoding. Since
	spicec and spicy (the latter needs a few fixes) can handle streams
	with odd height/width, the best way to solve this issue is to stop
	rounding up the height and width of the streams we create. This
	even saves some bandwidth :)

2011-07-31  Alon Levy  <alevy@redhat.com>

	server/red_dispatcher: fix wrong resolution set for tablet
	when changing resolutions due to the new async code paths the surface
	creation command was kept by reference, and later, when the red_worker
	signaled completion by calling async_complete the mouse mode was updated
	using the reference. This caused the wrong values to be read resulting in wrong
	resolutions set and a non working mouse pointer. Fix this by keeping a copy of
	the surface creation command instead of a reference.

	No bz. Found in testing.

2011-07-31  Christophe Fergeau  <cfergeau@redhat.com>

	client: fix 30s timeout regression
	Changelog from Arnon Gilboa, patch from me:

	Commit eb6f55409412 caused the following regression:

	When client runs without the auto-conf or disable-effects options
	(either from CLI or controller), which is the case when using Spice
	from Admin Portal, the client will unecessarily wait for 30sec before
	connecting to a Windows guest with an agent running (this won't happen
	with linux guests or without an agent running).

	The mentioned patch assumed that on_agent_reply() of
	VD_AGENT_DISPLAY_CONFIG will call send_main_attach_channels() and
	connect. However, when auto-conf or disable-effects are not used,
	on_agent_reply() will ignore the reply and not call
	send_main_attach_channels(). Therefore, send_main_attach_channels()
	will only be called on agent timeout.

	The solution is to activate agent timer only if auto-conf or
	disable-effects. Otherwise, simply call send_main_attach_channels().

	Fixes rhbz #726441

2011-07-31  Alon Levy  <alevy@redhat.com>

	common/backtrace.h: disable for WIN32
	This also catches mingw32 which is probably fine, but at least it fixes
	the build on visual studio.

2011-07-28  Christophe Fergeau  <cfergeau@redhat.com>

	fix integer marshalling helpers on big endian
	They were trying to convert the destination pointer to an integer before
	trying to dereference it. The initial conversion was meant to be a cast
	to a pointer of the right size, not to an integer.

	fix typo in big endian code path
	uint63_t should be uint64_t

2011-07-26  Hans de Goede  <hdegoede@redhat.com>

	Bump version in server/spice,h to 0.9.1
	It is a bit early to bump, since a 0.9.1 release is not happening yet,
	but this allows me to test if the vdagent SpiceCharInterface state callback
	fixes are present or not in qemu code, and thus disabling the ugly vdagent
	specific workaround from spice-qemu-char.c when compiling against a new
	enough spice-server.

2011-07-25  Hans de Goede  <hdegoede@redhat.com>

	server: Don't call vdagent chardev state callback on client (dis)connect
	See this long mail for the rationale for this:
	http://lists.freedesktop.org/archives/spice-devel/2011-July/004837.html

2011-07-23  Alon Levy  <alevy@redhat.com>

	Release 0.9.0

2011-07-22  Alon Levy  <alevy@redhat.com>

	server/smartcard: fix smartcard_channel_send_error
	It was sending the wrong data, the memory right after the VCSMsgHeader
	which was actually not where the data was.

	Fixed by having the header and data (VSCError, 4 bytes of the error code)
	embedded in the ErrorItem pipe item.

2011-07-22  Christophe Fergeau  <cfergeau@redhat.com>

	mjpeg: rename jpeg_mem_dest
	jpeg_mem_dest is a public symbol in libjpeg8 so using it with
	no prefix will cause symbol clashes. Rename it to spice_jpeg_mem_dest.

	mjpeg_encoder: allocate "row" on demand
	It's not used when we use jpeg-turbo colorspaces, so it's better
	to allocate it when we know we'll need it rather than always
	allocating it even if it won't be used.

	mjpeg_encoder: remove unused functions
	After the refactoring to optionally use libjpeg-turbo, some
	of the functions that mjpeg-encoder used to provide are now no
	longer used. This commit removes them.

	mjpeg_encoder: use libjpeg-turbo extra colorspaces
	When libjpeg-turbo is available, we can use the BGR and BGRX
	colorspaces that it provides to avoid extra conversions of the
	data we want to compress to mjpeg

	red_worker: use new mjpeg_encoder_encode_scanline API
	The main point is to move the pixel conversion code into
	the MjpegEncoder class to be able to make use libjpeg-turbo
	additional pixel formats without the reds_worker code noticing.

	mjpeg_encoder: add mjpeg_encoder_get_bytes_per_pixel
	Returns the number of bytes per pixel corresponding to the input
	data format.

	mjpeg_encoder: add mjpeg_encoder_encode_scanline
	This API is meant to allow us to move the pixel format conversion
	into MjpegEncoder. This will allow us to be able to use the
	additional pixel formats from libjpeg-turbo when available.

	red_worker: simplify red_rgb_to_24bpp prototype
	It takes a lot of arguments, "id" is unused, "frame" and
	"frame_size" can be obtained from the "stream" argument, so
	can get rid of 3 arguments to make things more readable.

	mjpeg_encoder: rework output buffer allocation
	When encoding a frame, red_worker passes an allocated buffer to
	libjpeg where it should encode the frame. When it fails, a new
	bigger buffer is allocated and the encoding is restarted from
	scratch. However, it's possible to use libjpeg to realloc this
	buffer if it gets too small during the encoding process. Make use
	of this feature, especially since it will make it easier to encore
	one line at a time instead of a full frame in subsequent commits.

	red_worker: factor pixel conversion code
	When encoding to mjpeg, the on screen data have to be converted
	to 24bpp RGB since that's the format that libjpeg expects. Factor
	as much code as possible for the 3 formats we handle.

	set version number to 0.9.0

	fix make distcheck

	configure.ac: fix pyparsing check
	2>&1 was typo'ed 2&>1 which caused an empty '1' file to be created
	when running this test.

	add SASL and smartcard to distcheck flags

	client: don't die if initial agent timeout triggers
	When the client connects to a spice VM, if an agent is detected,
	there will be a few messages exchanged to exchange capabilities,
	display resolutions, ... This exchange has a timeout in case
	something goes wrong. However, when it fires, the client dies.
	This commit changes this and lets the client connects to the
	guest when the timeout happens.
	rhbz #673973

	client: only send one SPICE_MSGC_MAIN_ATTACH_CHANNELS messages
	492f7a9b fixed unwanted timeouts during initial client startup,
	but it also caused a bad regression when connecting to
	RHEL6+agent guests: the SPICE_MSGS_MAIN_ATTACH_CHANNELS message
	was sent multiple times, once in RedClient::handle_init, then
	once again in RedClient::on_agent_announce_capabilities (which
	can even be triggered multiple times). Sending this message multiple
	times is a big NO and causes the server to close the client connection,
	and the client to die. Add a _msg_attach_message_sent boolean to
	make sure we only send this message once.

	rhbz #712938

	client: split overlong option descriptions

2011-07-21  Hans de Goede  <hdegoede@redhat.com>

	server: make sure we clear vdagent and update mouse mode on agent disconnect
	The check this patch removes causes us to not set vdagent to NULL, nor
	update the mouse mode when the guest agent disconnects when no client is
	attached. Which leads to a non working mouse, and on agent reconnect a
	"spice_server_char_device_add_interface: vdagent already attached" message
	instead of a successful re-add of the agent interface .

	hansg: Note this is commit 443994ba from the 0.8 branch, which I did
	not forward port back then because it seemed unnecessary on master, but it
	turns out that the (wrong) check was just hidden in another place on master.

2011-07-21  Yonit Halperin  <yhalperi@redhat.com>

	client: fix endless recursion in rearrange_monitors, RHBZ #692976
	The endless recursion happens due to Application::prepare_monitors calling RedScreen::resize
	calling Application::rearrange_monitors calling Application::prepare_monitors

	I changed RedScreen::resize not to call rearrange_monitors. Instead,
	the monitor should be configured correctly from Application, before
	calling resize.
	In addition, I made some cleanups to allow reusing rearrange_monitors code.

2011-07-21  Hans de Goede  <hdegoede@redhat.com>

	spicec: Make loglevel configurable through the environment
	Having a loglevel variable is much more useful if we can actually change
	its value without a recompile. Use a SPICEC_LOG_LEVEL environment variable so
	we can do this from the spice xpi / activex too (by setting the environment
	variable before starting the browser).

2011-07-20  Yonit Halperin  <yhalperi@redhat.com>

	server/red_worker: send surface images to client on-demand after S3/4 wakeup
	When surfaces are being reloaded to the worker, we
	will send them to the client only if and when it needs them.

2011-07-20  Alon Levy  <alevy@redhat.com>

	server/spice.h: bump QXL_MINOR because of QXLWorker and QXLInterface changes

	server: add QXLWorker.flush_surfaces_async for S3/S4 support
	This does the following, all to remove any referenced memory on the pci bars:
	    flush_all_qxl_commands(worker);
	    flush_all_surfaces(worker);
	    red_wait_outgoing_item((RedChannel *)worker->display_channel);
	    red_wait_outgoing_item((RedChannel *)worker->cursor_channel);

	The added api is specifically async, i.e. it calls async_complete
	when done.

	server: add QXLInterface::update_area_complete callback
	when update_area_async is called update_area_complete will be called with
	the surfaces dirty rectangle list.

	server/red_worker: handle_dev_input: reuse write_ready introduced for async

	server: add async io support
	The new _ASYNC io's in qxl_dev listed at the end get six new api
	functions, and an additional callback function "async_complete". When
	the async version of a specific io is used, completion is notified by
	calling async_complete, and no READY message is written or expected by
	the dispatcher.

	update_area has been changed to push QXLRects to the worker thread, where
	the conversion to SpiceRect takes place.

	A cookie has been added to each async call to QXLWorker, and is passed back via
	async_complete.

	Added api:

	QXLWorker:
	    update_area_async
	    add_memslot_async
	    destroy_surfaces_async
	    destroy_primary_surface_async
	    create_primary_surface_async
	    destroy_surface_wait_async

	QXLInterface:
	    async_complete

	bump required spice-protocol to 0.8.1 for qxl_dev async and s3 updates

	server: api: add spice_qxl_* calls based on QXLWorker contents
	For each callback in QXLWorker, for example QXLWorker::update_area, add
	a direct call named spice_qxl_update_area.

	This will (a) remove the pointless indirection and (b) make shared
	library versioning alot easier as we'll get new linker symbols which
	we can tag with the version they appeared in the shared library.

	server: spice-server.syms: move sasl symbols to 0.8.2

	server/red_worker: remove print on handle_dev_destroy_surfaces

	server/red_worker: *_release_item: less frequent debug messages

	server/tests: test_util.h: fix double ASSERT definition

2011-07-19  Alon Levy  <alevy@redhat.com>

	common: add backtrace via gstack or glibc backtrace
	Add a backtrace printing function copied from xserver os/backtrace.c
	that uses gstack, and if that isn't found then glibc's backtrace.
	Used in ASSERT, tested on F15.

2011-07-19  Gerd Hoffmann  <kraxel@redhat.com>

	server: add symbol versioning to the spice server shared library.
	This patch adds symbol versions to the spice server library.  Each
	symbol which is exported by libspice-server gets tagged with the
	(stable) version where it appeared first.  This way the linker and rpm
	are able to figure which version of the spice-server libary is required
	by a particular qemu binary/package.

2011-07-19  Christophe Fergeau  <cfergeau@redhat.com>

	remove unused function

	client: add missing "," in option list
	In commit 44073d1b38e2 - client: improve WAN option description
	one "," was missing at the end of the line. Since the next argument
	was a string too, gcc silently concatenated them, and thanks to C++
	polymorphic functions, the compiler didn't complain about the
	missing argument, so it went unnoticed.
	The effects are pretty bad though, since it prevents spicec from
	running because it thinks command line parsing fails.

2011-07-18  Christophe Fergeau  <cfergeau@redhat.com>

	Fix spice-server/qemu channel version checks
	When qemu creates a channel, reds.c contains code to check the
	minor/major channel versions known to QEMU (ie the ones that were
	current in spice-server when QEMU was compiled) and to compare these
	versions against the current ones the currently installed spice-server
	version.

	According to kraxel [1], the rules for these interface numbers are:

	"The purpose of the versions is exactly to avoid the need for a new
	soname.  The rules are basically:

	   (1) You add stuff to the interface, strictly append-only to not break
	       binary compatibility.
	   (2) You bump the minor version of the interface.
	   (3) You check the minor version at runtime to figure whenever the
	       added fields contain valid stuff or not.

	An example is here (core interface, minor goes from 2 to 3, new
	channel_event callback):

	http://cgit.freedesktop.org/spice/spice/commit/?id=97f33fa86aa6edd25111b173dc0d9599ac29f879
	"

	The code currently refuses to create a channel if QEMU minor version is
	less than the current spice-server version. This does not correspond
	to the intended behaviour, this patch changes to fail is qemu was compiled
	with a spice-server that is *newer* than the one currently installed. This
	case is something we cannot support nicely.

	[1] http://lists.freedesktop.org/archives/spice-devel/2011-July/004440.html

2011-07-18  Uri Lublin  <uril@redhat.com>

	client: rename connect_unsecure to connect_to_peer
	Both connect_secure() and connect_unsecure() call connect_to_peer().

	Prior to this commit spicec.log reported all connections as unsecure,
	as connect_secure() called connect_unsecure() to make the connection.
	This fixes RH bug #653545

2011-07-18  Christophe Fergeau  <cfergeau@redhat.com>

	client: don't crash when agent is missing WAN support
	If you try to connect to a linux guest with WAN options, SPICE window opens up
	and is blank - it then fails with vdagent timeout message.  It should give a
	warning that this is only applicable for windows guest and still connect to
	guest.

	It all starts in RedClient::handle_init
	This function checks whether we have an agent or not, because if we have an
	agent, there will be some kind of handshake to check both sides capabilities
	before all the spice channels are created.

	When there is no agent running, the startup process goes on with
	SPICE_MSGC_MAIN_ATTACH_CHANNELS

	When there is a windows agent running, VD_AGENT_ANNOUNCE_CAPABILITIES and
	VD_AGENT_DISPLAY_CONFIG messages are sent to the agent, and when processing the
	agent answer to the VD_AGENT_DISPLAY_CONFIG message,
	SPICE_MSGC_MAIN_ATTACH_CHANNELS will be sent and the startup process will go
	on.

	However, when there is no agent running but --color-depth was used, handle_init
	won't send the SPICE_MSGC_MAIN_ATTACH_CHANNELS message but will wait for the
	agent handshake to proceed to its end, which won't happen, so it will timeout
	waiting for agent answers.

	Similarly, the linux agent handles VD_AGENT_ANNOUNCE_CAPABILITIES messages, but
	it doesn't handle VD_AGENT_DISPLAY_CONFIG messages, so we'll never reach the
	point where a SPICE_MSGC_MAIN_ATTACH_CHANNELS will be sent.

	This commit fixes this in 2 places:
	- unconditionnally send SPICE_MSGC_ATTACH_CHANNELS when no agent is running in
	handle_init
	- send SPICE_MSGC_MAIN_ATTACH_CHANNELS in
	RedClient::on_agent_announce_capabilities if the agent doesn't have the
	VD_AGENT_CAP_DISPLAY_CONFIG capability

	This fixes RH bug #712938

	client: improve WAN option description
	The WAN options (--color-depth and --disable-effects) need
	support from the guest agent to be working. Currently they are
	only supported on Windows. While I don't want to explicitly
	mention Windows in --help output, we can hint that it won't
	work with all guests in --help. This fixes RH bug #712941

	x11: don't return freed memory from get_clipboard
	There is a double free in client/x11/platform.cpp.
	In get_selection(), in the exit: case with ret_val == -1 and data != NULL,
	*data_ret (which is returned to the caller) has already been
	assigned "data", so it will be pointing to freed memory when "data" is
	XFree'd'. Then in handle_selection_notify, get_selection_free is called on
	this pointer, which causes a double free.
	When the length of the read data = 0, set the returned value to NULL,
	this way subsequent free attempts will be a noop.
	Fixes RH bug #710461

	client: match delete[] with new[]
	vinfo in x11/platform.cpp is allocated using new[] so it needs to
	be freed with delete[]

	client: s/recive/receive

2011-07-12  Yonit Halperin  <yhalperi@redhat.com>

	server: add missing calls to red_handle_drawable_surfaces_client_synced
	red_handle_drawable_surfaces_client_synced was called only from red_pipe_add_drawable, while it
	should also be called from red_pipe_add_drawable_after. Otherwise, the client
	might receive a command with a reference to a surface it doesn't hold and crash.

	server: fix access to a released drawable. RHBZ #713474
	red_pipe_add_drawable can lead to removal of drawables from current tree
	(since it calls red_handle_drawable_surfaces_client_synced), which can
	also lead to releasing these drawables.
	Before the fix, red_current_add_equal, called red_pipe_add_drawable,
	without assuring afterwards that the drawables it refers to are still alive or
	still in the current tree.

2011-07-06  Alon Levy  <alevy@redhat.com>

	server: fix segfault if no migrate_info provided
	qemu calls spice_server_migrate_switch even if it didn't do a
	spice_server_migrate_info first. Fix the resulting error by not pushing
	a switch host tag to the pipe in this case, and add a check anyway in the
	marshalling code just in case.

2011-07-05  Yonit Halperin  <yhalperi@redhat.com>

	server: cursor_channel: releasing pipe items resources when the pipe is cleared (on disconnect)
	same as commit 74a9d10af96f4d7c8c1b1d7fca124a8df9180787 for cursor channel

	server: display_channel: releasing pipe items resources when the pipe is cleared (on disconnect)
	fixes "display_channel_release_item: panic: invalid item type"

	Before changing the red_worker to use the red_channel interface, there
	was a devoted red_pipe_clear routine for the display channel and cursor channel.
	However, clearing the pipe in red_channel, uses the release_item callback
	the worker provided. This callback has handled only resources that need to be released
	after the pipe item was enqueued from the pipe, and only for pipe items that were set in
	red_channel_init_send_data.
	This fix changes the display channel release_item callback to handle all types of
	pipe items, and also handles differently pushed and non-pushed pipe items.

	server: not reading command rings before RED_WORKER_MESSAGE_START, RHBZ #718713
	On migration, destroy_surfaces is called from qxl (qxl_hard_reset), before the device was loaded (on destination).
	handle_dev_destroy_surfaces led to red_process_commands, which read the qxl command ring
	(which appeared to be not empty), and then when processing the command
	it accessed unmapped memory.

	server: replace redundant code with red_cursor_reset
	In addition (1) make handle_dev_destroy_surfaces call red_release_cursor
	(2) call red_wait_outgoing_item(cursor_channel) only after adding msgs to pipe

	server: removing local cursor, this solves RHBZ #714801
	When the worker was stoped, the cursor was copied from guest ram to the host ram,
	and its corresponding qxl command was released.
	This is unecessary, since the qxl ram still exists (we keep references
	to the surfaces in the same manner).
	It also led to BSOD on guest upon migration: the device tracks cursor set commands and it stores
	a reference to the last one. Then, it replays it to the destination server when migrating to it.
	However, the command the qxl replayed has already been released from the pci by the original
	worker, upon STOP.

2011-07-05  Alon Levy  <alevy@redhat.com>

	tests/migrate: update to use argparse and run spicy by default
	Most helpful change is that it prints help if you do --help.
	It can take --image parameter, and --client parameter, defaults to spicy.

	Incidentally, spicy switch host seems broken - if you run with --client spicec
	(assuming spicec is in the PATH), it works fine, but using the default spicy (or
	--client spicy) it fails after a single switch.

	server/tests/basic_event_loop: strange assert failure; fix

	server/smartcard: register channel only when hardware is available

2011-06-29  Alon Levy  <alevy@redhat.com>

	Revert "server/smartcard: don't register the channel if no hardware emulated"
	This reverts commit 456ff9f8d5d27ac763e89e67a100661084695dc5.

	That patch just disabled the smartcard channel completely because
	the check was done *before* the initialization of the qemu smartcard
	devices, not after.

2011-06-28  Christophe Fergeau  <cfergeau@redhat.com>

	red_worker: remove 2 empty functions
	red_worker was using some share/unshare stream_buf functions whose
	body is empty. This commit removes them and their use.

2011-06-23  Alon Levy  <alevy@redhat.com>

	server/smartcard: don't register the channel if no hardware emulated

	server/smartcard: handle BaseChannel messages
	According to spice.proto the smartcard channel can receive acks and any
	other message defined in BaseChannel. While the spicec implementation didn't
	send an ACK spice-gtk does, so handle it.

2011-06-22  Christophe Fergeau  <cfergeau@redhat.com>

	don't #include config.h in generated header files
	7e30572ab adds a #include <config.h> to the beginning of generated
	files. It also does this for generated headers and enums files,
	which is not wanted, especially if it's an installed file. This
	commit only adds this include for the non-header non-enum case
	(hopefully, enums are only generated for use in a .h file).

	s/__visible__/SPICE_GNUC_VISIBLE
	The C specification reserves use of identifiers starting with __
	to the compiler so we shouldn't use one such symbol.

	add check for pyparsing
	Check both in configure.ac (after checking if we need to rebuild
	the marshalling files) and in the python script using pyparsing
	(for people modifying .proto files in tarballs)

2011-06-22  Marc-André Lureau  <marcandre.lureau@redhat.com>

	sndworker: check the caps before sending volume messages

	sndworker: add AudioVolume/AudioMute messages
	These messages allow the guest to send the audio device volume to the
	client. It uses an arbitrary scale of 16bits, which works good enough
	for now.

	Save VolumeState in {Playback,Record}State, so that we can send the
	current volume on channel connection.

	Note about future improvements:
	- add exact dB support
	- add client to guest volume change

	Updated since v2:
	- bumped record and playback interface minor version to allow
	  conditional compilation
	Updated since v1:
	- sync record volume on connection too

2011-06-21  Marc-André Lureau  <marcandre.lureau@redhat.com>

	python: remove c-ism trailing ;

	codegen: typedef the protocol enums
	Commit 9d5ef9beeca722b2ceff7d15aaa3aaaaf07ecfbf in spice-protocol
	introduced a typedef manually in the generated enums.h header.

	This patch adds them automatically to all enums during enums.h generation.

2011-06-14  Yonit Halperin  <yhalperi@redhat.com>

	client: fix for redundant shift+f11 RHBZ #674532
	After shift+F11, both in Windows 7 and xp clients, WM_KEYUP events were missing for
	SHIFT and F11. For F11 it was less important since unpress_all was preformed for all keys.
	However, we perform sync for all the keyboard modifiers and the GetKeyboardState returns "down" for shift.
	In windows7 client, we sometimes received afterwards a F11 KEYDOWN event repetition, and this caused SHIFT+F11 to be called again.
	Not performing hiding of the windows while changing client resolutions, solved the problem of missing events, and I don't see any difference
	in how spice looks while toggling to full screen.
	Using GetAsyncKeyState, returns "UP" for shift in windows 7, and helps avoid performing shift+f11 again, if there is an F11 repetition
	before we receive the KEYUP event for shift.

2011-05-30  Arnon Gilboa  <agilboa@redhat.com>

	client/windows: enable image randomization (ASLR) rhbz#701111
	Enable image randomized base address, hindering some types of
	security attacks by making it more difficult for an attacker
	to predict target addresses.

	client/windows: remove slash from x64 build dir
	otherwise x64 is built in root if REDC_BUILD_DIR is not defined

2011-05-24  Alon Levy  <alevy@redhat.com>

	server/smartcard: fix use after free

2011-05-22  Arnon Gilboa  <agilboa@redhat.com>

	client/windows: remove precompiled header for common.h (fix broken windows debug build)
	-Release currently doesn't use precompiled headers at all
	-Debug is broken since common/*.c files don't include common.h
	-PCH can be enabled for all but specifically-chosen c-files

	common: add WIN64 ifdef for spice_bit_find_msb (fix broken windows x64 build)
	inline __asm is not supported in x64, so use the naive implementation
	until x64 asm implemented.

2011-05-19  Yonit Halperin  <yhalperi@redhat.com>

	client: fix flipped video in Linux guest on windows client, RHBZ #667689
	Video streams from Linux guests are oriented top-down, where gdi_canvas_put_image always
	received display context for down-top oriented bitmap. I fixed create_bitmap
	to consider the stream orientation.

2011-05-12  Arnon Gilboa  <agilboa@redhat.com>

	common: use INLINE instead of inline
	needed for spice/common files used by the client, server & qxl driver.
	in windows _inline works for both c/c++, while inline is c++ only.
	compiling the client with mixed c/c++ code required this define.

	client/windows: undef SIZE_MAX in stdint.h
	eliminating redefinition warning

	common: fix ssl_verify windows build errors

	client/windows: add common\ssl_verify.c/h to project
	disable WarnAsError, due to c/c++ warnings

	client/windows: inc version to 0,9,0,0

	client/windows: init PACKAGE_VERSION
	in windows, we set PACKAGE_VERSION to the binary version
	since we don't have config.h as generated by linux configure

2011-05-12  Alon Levy  <alevy@redhat.com>

	client: fix return code when missing host

2011-05-09  Alon Levy  <alevy@redhat.com>

	server/red_worker: stat_now cleanup
	static, remove inline, add (void), and empty line after function variables.

	server/red_worker: fix typo (lats_send_time)

	server/tests: show port to connect to

2011-05-08  Marc-André Lureau  <marcandre.lureau@redhat.com>

	server: bump SPICE_SERVER_VERSION to 0.9.0
	SASL functions will be released with 0.9.0

2011-05-05  Zeeshan Ali (Khattak)  <zeeshanak@gnome.org>

	server: Unset executable bit of red_tunnel_worker.h

2011-05-03  Marc-André Lureau  <marcandre.lureau@redhat.com>

	build: fix gettimeofday warning
	  CC     test_playback.o
	test_playback.c: In function ‘playback_timer_cb’:
	test_playback.c:56:5: warning: implicit declaration of function ‘gettimeofday’

	client: make use of ssl_verify.c
	Fixed since v1:
	- don't include C code, rather use the common lib
	- add missing spice_openssl_verify_free() call
	- keep the extra-parsing of subject for error reporting

	common: add ssl_verify.c common code
	Code adapter from RedPeer::ssl_verify_callback() and used by
	spice-gtk.

	Since v1:
	 - fixed Makefile.am
	 - added config.h include
	 - autoconf alloca added in patch series
	 - moved int escape inside for loop
	 - added a failed case when missing assignment
	 - replaced strlen () by -1
	 - skip spaces after comma
	 - c++ guards

	I didn't use bool, because openSSL uses int, and it is more future
	proof for error reporting.

	common: add ring_get_length() for debugging purposes
	Please notice it has a "static" modifier, like the rest of the inlined
	functions in ring.h, so it won't warn if it isn't used.

	common: mem.h add alloca definition
	We don't support the autoconf ALLOCA/C_ALLOC fallback. If one day,
	someone cares for a weird platform, he can fix it.

	common: spice_memdup could accept NULL
	(this patch is not to solve a crash fix, but to align with glib API)

	common: add windows.h where required, make gdi_handlers static
	This patch has not been verified with VS/brew. It should be safe
	hopefully. Compilation is fine with mingw32/spice-gtk.

	build: require c99
	Because we use c99: stdbool.h, inttypes.h, bool, variadic macros, // comments, ...

2011-05-03  Christophe Fergeau  <cfergeau@redhat.com>

	move get_time_stamp to main_channel.c
	There is only one user of get_time_stamp from spice_common.h so
	it's not really useful to keep it there.

	use standard do { } while (0) for spice_common.h macros

	move WARN and WARN_ONCE to spice_common.h

	common: use PANIC from spice_common.h

	common,server: use ASSERT from spice_common.h
	spice_common.h provides an ASSERT macro, no need to duplicate it
	in many places. For now client/debug.h keeps its own copy since
	debug.h and spice_common.h have clashes on other macros which are
	trickier to unify.

	server: use gcc builtin for atomic get/set bit

	client: remove unused mb() macro

	common: don't duplicate find_msb implementation

	remove void * arithmetic
	With -Wpointer-arith, gcc complains about void pointer arithmetic.
	This is not a big deal with gcc, but could be with other compilers,
	so it's better to cast to char */uint8_t * before doing the
	arithmetic on such pointers.

	add missing static

	configure.ac: remove setting default C(XX)FLAGS
	automake/autoconf already set them for us to -g -O2 if there are
	no flags defined.

	win32: remove obsolete preprocessor #defines
	SW_CANVAS_NO_CHUNKS isn't used anywhere but in this file.
	SW_CANVAS_CACHE is now defined directly in the files where it's
	needed so we no longer need it in the .vcproj file.

	add comment to beginning of autogenerated files

	s/USE_OGL/USE_OPENGL
	This is more explicit about what it does, and not much longer

	use AC_DEFINE instead of hardcoding preprocessor flags
	Now that all source files include config.h, we can use AC_DEFINE
	to enable/disable optional features (opengl, cegui). This is
	cleaner than directly appending -Dxxx directives to the preprocessor
	flags. This also guarantees that everything will be appropriately
	rebuilt when using the same source tree to build first with opengl
	support and then without (the config.h timestamp will change,
	triggering a rebuild of the files including it)

	add config.h to autogenerated files too
	Modify the python (de)marshaller generator to add #include
	<config.h> at the beginning of the C files it generates

	add #include <config.h> to all source files
	When using config.h, it must be the very first include in all source
	files since it contains #define that may change the compilation process
	(eg libc structure layout changes when it's used to enable large file
	support on 32 bit x86 archs). This commit adds it at the beginning
	of all .c and .cpp files

	autotools: correctly build canvas-related code
	spice client and spice server shares code from
	common/{gdi,gl,sw}_canvas.[ch]. However, while most of the code is
	shared, the server code wants a canvas compiled with
	SW_CANVAS_IMAGE_CACHE defined while the client code wants a canvas
	compiled with SW_CANVAS_CACHE.

	The initial autotools refactoring didn't take that into account,
	this is now fixed by this commit. After this commit, the canvas
	files from common/ are no longer compiled as part of the
	libspice-common.la convenience library. Instead, there are "proxy"
	canvas source files in client/ and server/ which #include the
	appropriate C files after defining the relevant #define for the
	binary that is being built.

	To prevent misuse of the canvas c files and headers in common/,
	SPICE_CANVAS_INTERNAL must be set when including the canvas headers
	from common/ or when building the c files from common/ otherwise
	the build will error out.

	configure.ac: remove unused AC_SUBST

	autotools: refactor the whole build machinery
	spice Makefile.am setup is a bit confusing, with source file
	names being listed several times in different Makefile.am
	(generally, once in EXTRA_DIST and another time in another
	Makefile.am in _SOURCES). The client binaries are built
	by client/x11/Makefile.am, which means recursing into client,
	then into x11 to finally build spicec. This Makefile.am is
	also referencing files from common/ and client/, which is
	a bit unusual with autotools.

	This patch attempts to simplify the build process to get
	something more usual from an autotools point of view.
	The source from common/ are compiled into a libtool convenience
	library, which the server and the client links against which avoids
	referencing source files from common/ when building the server and
	the client. The client is built in client/Makefile.am and directly
	builds files from x11/ windows/ and gui/ if needed (without
	recursing in these subdirectories).

	This makes the build simpler to understand, and also makes it
	possible to list source files once, which avoids potential
	make distcheck breakage when adding new files.

	There is a regression in this patch with respect to
	sw_canvas/gl_canvas/gdi_canvas. They should be built with
	different preprocessor #defines resulting in different behaviour
	of the canvas for the client and the server. However, this is not
	currently the case, both the client and the server will use the same
	code for now (which probably means one of them is broken). This will
	be fixed in a subsequent commit.

	make distcheck passes, but compilation on windows using the
	autotools build system hasn't been tested, which means it's likely
	to be broken. It shouldn't be too hard ot fix it though, just let
	me know of any issues with this.

2011-05-02  Christophe Fergeau  <cfergeau@redhat.com>

	add missing "LGPLv2.1 or later" header to source files

	common: don't try to redefine PANIC if it already exists
	canvas_base.c tries to define PANIC, but it might already be set
	if eg client/debug.h has been included before. All the other
	macros in this file are guarded by #ifndef, this commit adds
	the missing #ifndef to PANIC. Note that this is just a bandaid,
	ideally common/ would contain a logging frameword, and these
	macros would only be defined once instead of being defined in
	several places.

	server: s/desable/disable
	This fixes a typo in some function names, there should be no
	functional change.

	use foo(void) instead of foo() in prototypes
	In C, the latter isn't a prototype for a function with no arg,
	but declares a function with an undefined number of args.

	server: remove extra arg in reds_on_main_agent_start call

	client: remove c++ wrappers
	client/ contains several .cpp file which only #include a .c file
	of the same name. This is unusual and seems to only be done to
	get C++ name mangling on the symbols defined in the C file.
	Now that all headers files in common/ use extern "C", these
	wrappers are no longer useful.

	common: add missing header guards to gl_canvas.h

	common: add extern "C" guards to headers
	Since some spice C++ code is using code from common/, the C
	functions need to be marked as such for the C++ compiler, otherwise
	we'll get linkage issues.

	client: make building client optional

	configure.ac: replace tab with spaces
	This makes the "C++ Compiler:     ...." status output nicely
	aligned with the other messages.

	configure.ac: remove unused dynamic linkage flag
	configure.ac defines a SPICEC_STATIC_LINKAGE_BDYNAMIC variable
	when --enable-static-linkage is not set, but it's never used.
	SPICEC_STATIC_LINKAGE_BSTATIC is used in client/, but since we
	are using libtool, it might be more appropriate to use
	'make LDFLAGS="-all-static"' to achieve static link.

	configure.ac: fix use of AC_ARG_ENABLE
	Most uses of AC_ARG_ENABLE were buggy:
	- when passing --disable-xxx, configure.ac would behave as if it
	  was passed --enable-xxx
	- passing --enable-xxx=foo would "leak" into the summary, ie the
	  summary (at the end of configure) would say "xxx: foo" instead
	  of "xxx: yes"

	This patch fixes these 2 issues.

	configure.ac: fix make dist

	server: use is_primary_surface
	red_worker.c has an is_primary_surface helper function, but there
	were some places in the file not using it. This patch fixes that

2011-04-26  Alon Levy  <alevy@redhat.com>

	spice.proto: Fill.rop_descriptor type s/uint16/ropd (10x atiti)

2011-04-18  Christophe Fergeau  <cfergeau@redhat.com>

	client: skip spaces in --host-subject
	This fixes fdo bug #32896:

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

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

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

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

	In this case, ignoring spaces make it much easier to directly copy and paste
	the subject line from certificates.

	draw: remove SPICE_ADDRESS
	This commit removes the typedef for SPICE_ADDRESS which was no
	longer used. This is the last thing that was missing to close
	fdo bug #28984

	client: add --version cmdline option to spicec
	This fixes freedesktop bug #33907

	client: s/reqired/required in CmdLineParser

	client: s/AVAILIBLE/AVAILABLE in CmdLineParser
	It was mispelt in a CmdLineParser enum.

2011-04-08  Christophe Fergeau  <cfergeau@gmail.com>

	server/tests remove useless assignment
	This was detected by clang-static-analyzer.

	common/pixman: remove dead assignments
	They were detected using clang-static-analyzer. Don't initialize
	the variable to a value to override it with a different value
	a few lines after.

	tests: fix compilation with -Wall -Werror
	When compiling spice with make CFLAGS="-g3 -ggdb3 -O0 -Wall -Werror",
	the build broken because of a few unused variables/missing returns.
	This patch fixes these warnings.

2011-04-08  Christophe Fergeau  <cfergeau@redhat.com>

	gl: remove unused variables
	gcc 4.6 warned about these.

	gl: use correct pixman accessor for image data
	Commit 774e5bd36f4 changed
	-  dest->source.pixmap.x_image->data +
	+  (uint8_t *)pixman_image_get_stride(dest->source.pixmap.pixman_image) +

	The correct accessor to use is pixman_image_get_data. Thanks to gcc
	4.6 for warning about a "different size" int to pointer conversion.

	client: use silent generation rules in Makefile.am
	The server Makefile.am rules for marshallers generation are
	prefixed with AM_V_SILENT to integrate nicely with automake silent
	rules. The same AM_V_SILENT prefix isn't used in client/Makefile.am
	resulting in verbose output even when automake silent mode is
	enabled. This commit removes this verbosity.

2011-04-04  Christophe Fergeau  <cfergeau@gmail.com>

	configure.ac: remove detection of WARN_UNUSED_RESULT
	spice configure.ac has some code to detect if the compiler has
	a special attribute to tag some functions so that they generate a
	warning when their return value isn't checked. However, this test
	is broken (the gcc attribute name is "warn_unused_result", not
	"__warn_unused_result__" and WARN_UNUSED_RESULT is unused anyway
	since spice-protocol provides SPICE_GNUC_WARN_UNUSED_RESULT. Thus
	we can just drop that block of code from configure.ac

2011-04-04  Christophe Fergeau  <cfergeau@redhat.com>

	remove duplicated macro
	MIN() is already defined in spice-protocol/spice/macros.h

2011-04-04  Hans de Goede  <hdegoede@redhat.com>

	server: make sure we clear vdagent and update mouse mode on agent disconnect
	The check this patch removes causes us to not set vdagent to NULL, nor
	update the mouse mode when the guest agent disconnects when no client is
	attached. Which leads to a non working mouse, and on agent reconnect a
	"spice_server_char_device_add_interface: vdagent already attached" message
	instead of a successful re-add of the agent interface .

	server: ignore SPICE_MSGC_MAIN_AGENT_START messages when there is no agent
	This can happen for example when a SPICE_MSGC_MAIN_AGENT_START message
	from the client and the vdagent disconnecting race.

	server: hookup agent-msg-filter discard-all functionality
	This ensures that if the client or agent connects to the client-agent
	"tunnel" while the other side is halfway through sending a multi part
	message, the rest of the message gets discarded, and the connecting
	party starts getting data at the beginning of the next message.

	server: add discard all option to agent message filter

	server: filter all data from client
	Filter all data from client, even when there is no agent connected
	to keep filter state correct.

	server: reset read/write filter on agent/client disconnect
	The agent message filter keeps track of messages as they are being send
	reset the relevant filter to its initial state when one of the 2 ends
	of the agent<->client "tunnel" disconnects.

	server: break read_from_vdi_port loop if the guest gets disconnected
	read_from_vdi_port calls dispatch_vdi_port data, which will disconnect
	the guest agent if it sends invalid data. It would then try to read more
	data from the disconnected guest agent resulting in a NULL ptr dereference,
	this patch fixes this.

	server: Don't stop writing agent data to the guest when the client disconnects
	write_to_vdi_port() was checking for reds->agent_state.connected to determine
	wether it could write queued data. But agent_state.connected reflects if
	*both* ends are connected. If the client has disconnected, but the guest agent
	is still connected and some data is still pending (like a final clipboard
	release from the client), then this data should be written to the guest agent.

	server: Don't reset agent state when the client disconnects
	We were calling reds_reset_vdp on client disconnect, which is not a good
	idea. reds_reset_vdp does 3 things:

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

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

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

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

	Note that since we no longer reset the vdp state on client disconnect, we
	must now reset it on agent disconnect even if we don't have a client. So
	the reds_reset_vdp call in reds_agent_remove() gets moved to the top,
	above both the agent_state.connected and reds->peer checks which will
	both fail in the no client case.

2011-03-24  Hans de Goede  <hdegoede@redhat.com>

	server: avoid unneeded recursion in dispatch_vdi_port_data
	dispatch_vdi_port_data, was calling vdi_read_buf_release when no client
	is connected to free the passed in buf. The only difference between
	vdi_read_buf_release and directly adding the buffer back to the ring
	with ring_add, is that vdi_read_buf_release calls read_from_vdi_port
	after adding the buffer back. But dispatch_vdi_port_data only gets called
	from read_from_vdi_port itself, thus this would lead to recursing into
	read_from_vdi_port. read_from_vdi_port is protected against recursion and
	will immediately return if called recursively. Thus calling
	vdi_read_buf_release from dispatch_vdi_port_data is pointless, instead
	simply putting the buffer back in the ring suffices.

	server: Make copy paste support configurable
	Also bump SPICE_SERVER_VERSION to 0x000801 as 0.8.1 will be the
	first version with the new API for this, and we need to be able to
	detect the presence of this API in qemu.

	spice-server: Add the ability to filter agent messages

2011-03-23  Hans de Goede  <hdegoede@redhat.com>

	spicec-x11: Work around a bug in xsel
	Although ICCCM 2.2. Responsibilities of the Selection Owner:
	http://tronche.com/gui/x/icccm/sec-2.html#s-2.2

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

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

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

	This fixes Alon's test with running:
	python -c "print list(range(1000))" | xsel -i -b
	on the client.

	spicec-x11: Don't crash on apps sending bad atoms as TARGETS
	Some apps (bad xsel, bad!) send invalid Atoms in their TARGETS property,
	causing spicec to exit because of an XError. This patch makes spicec survive
	this scenario.

	For more info on the xsel bug, see:
	https://bugzilla.redhat.com/show_bug.cgi?id=690214

2011-03-23  Christophe Fergeau  <cfergeau@gmail.com>

	common/gl: remove unused variable
	clang static analyzer warned that 'len' was computed but never
	used in glc_vertex2d. glc_stroke_line_dash has side effects so
	we have to call it, but we don't need to save its return value
	since it's not used.

	opengl: fix compilation
	When OpenGL is enabled, build fails in DisplayChannel::create_surface
	because Canvas *canvas is declared twice. Remove the first
	declaration to fix compilation.

2011-03-22  Alon Levy  <alevy@redhat.com>

	server/tests: add test_playback

	configure.ac: fix message when missing SASL lib

	server: use -std=c99
	Finds some bugs.

	python_modules/codegen.py: fix indent error in an unused function

	client/smartcard: use proper include delemiters

2011-03-11  Hans de Goede  <hdegoede@redhat.com>

	client: Don't handle hotkeys while sticky alt is active
	In some cases rhev-m changes the hotkey for releasing the mouse grab
	to ctrl + alt. This makes it impossible to send ctrl + alt + other-key
	to the guest, even when using sticky alt.

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

	This patch makes it possible to atleast send ctrl + alt + del (or other key)
	using sticky alt. Note: even with this patch it is still a bad idea to
	use ctrl + alt as hotkey combi.

2011-03-08  Alon Levy  <alevy@redhat.com>

	server/reds: allow call to reds_agent_remove even if it is gone
	The current assert(reds->agent_state.connected) tiggers if when
	the agent disconnected there was still data waiting to be sent (for
	instance if there is a bug in the client handling clipboard and it
	is killed while a large clipboard transfer is in progress). So first
	call to reds_agent_remove happens from spice_server_char_device_remove_interface,
	and then it is called again (triggering the assert) from free_item_data
	from read_from_vdi_port because of the channel destruction.

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

	This patch fixes a segfault on this assert when a client starts passing
	from guest agent to client a large clipboard and dies in the middle. There
	is still another assert happening occasionally at marshaller which I don't
	have a fix for (but it doesn't seem to be related).

	client/smartcard: handle the --smartcard-db option

2011-03-08  Arnon Gilboa  <agilboa@redhat.com>

	client/windows: cleanup vcproj based on updated libs
	using updated windows libraries:
	http://www.spice-space.org/download/stable/wspice-x86_08032011.zip
	http://www.spice-space.org/download/stable/wspice-x64_08032011.zip

	-remove IgnoreDefaultLibraryNames="MSVCRT.lib", since pixman is now compiled
	using MT threading model similar to other libraries. It used to be mistakenly
	compiled with MD.

	-downgrade freetype lib to 2.3.11-7, which is the one used/tested with
	CEGUI 0.6.2

	-pthread lib patched (InterlockedCompareExchange), so x64 client will no
	longer crash on SelectClipRgn, BitBlt etc.

2011-03-03  Marc-André Lureau  <marcandre.lureau@redhat.com>

	server/input: avoid double free() of RedChannel on disconnect
	Current master is calling red_channel_destroy() on incoming error, but
	reds Channels still references it, which causes a double free() later
	on (see valgrind report below).

	Instead, on error condition, do like the rest of the channels and call
	reds_disconnect(), which remove the references and call shutdown(),
	which then call red_channel_destroy() and finally free the channel
	with red_channel_destroy().

	Note: the previous code intention was certainly to be able to keep the
	rest of the channels connected when input channel has errors. This is
	not addressed by this patch.

	red_channel_shutdown:
	==29792== Invalid read of size 8
	==29792==    at 0x4C6F063: red_channel_shutdown (red_channel.c:460)
	==29792==    by 0x4C51EFA: inputs_shutdown (inputs_channel.c:463)
	==29792==    by 0x4C48445: reds_shatdown_channels (reds.c:539)
	==29792==    by 0x4C4868A: reds_disconnect (reds.c:603)
	==29792==    by 0x4C519E9: main_channel_on_error (main_channel.c:765)
	==29792==    by 0x4C6E80A: red_channel_peer_on_incoming_error (red_channel.c:215)
	==29792==    by 0x4C6E22D: red_peer_handle_incoming (red_channel.c:87)
	==29792==    by 0x4C6E551: red_channel_receive (red_channel.c:154)
	==29792==    by 0x4C6F329: red_channel_event (red_channel.c:531)
	==29792==    by 0x41CB8C: main_loop_wait (vl.c:1365)
	==29792==    by 0x437CDE: kvm_main_loop (qemu-kvm.c:1589)
	==29792==    by 0x41FE9A: main (vl.c:1411)
	==29792==  Address 0x30b0f6d0 is 0 bytes inside a block of size 28,648 free'd
	==29792==    at 0x4A05372: free (vg_replace_malloc.c:366)
	==29792==    by 0x4C6F032: red_channel_destroy (red_channel.c:454)
	==29792==    by 0x4C6E80A: red_channel_peer_on_incoming_error (red_channel.c:215)
	==29792==    by 0x4C6E22D: red_peer_handle_incoming (red_channel.c:87)
	==29792==    by 0x4C6E551: red_channel_receive (red_channel.c:154)
	==29792==    by 0x4C6F329: red_channel_event (red_channel.c:531)
	==29792==    by 0x41CB8C: main_loop_wait (vl.c:1365)
	==29792==    by 0x437CDE: kvm_main_loop (qemu-kvm.c:1589)
	==29792==    by 0x41FE9A: main (vl.c:1411)

	https://bugs.freedesktop.org/show_bug.cgi?id=34971

	Revert "server/red_channel: red_channel_event: push on blocked"
	This reverts commit 5062433d8af45822371b6487a8d7baea23071d18.

	red_channel_receive() can call red_channel_destroy() which frees
	channel.

	The condition bellow is then checked, which can access a freed
	channel:

	if (event & SPICE_WATCH_EVENT_WRITE || channel->send_data.blocked)

	Reverting this commit solves the issue without any apparent
	bugs/drawbacks, which kind of clears out the weird TODO.

	handle_dev_input: cursor connect
	==11826== Invalid read of size 4
	==11826==    at 0x4C6F83C: red_channel_event (red_channel.c:535)
	==11826==    by 0x41CB8C: main_loop_wait (vl.c:1365)
	==11826==    by 0x437CDE: kvm_main_loop (qemu-kvm.c:1589)
	==11826==    by 0x41FE9A: main (vl.c:1411)
	==11826==  Address 0x31fb00f0 is 96 bytes inside a block of size 28,648 free'd
	==11826==    at 0x4A05372: free (vg_replace_malloc.c:366)
	==11826==    by 0x4C6F536: red_channel_destroy (red_channel.c:453)
	==11826==    by 0x4C52B5D: inputs_channel_on_incoming_error (inputs_channel.c:449)
	==11826==    by 0x4C6ED0E: red_channel_peer_on_incoming_error (red_channel.c:215)
	==11826==    by 0x4C6E731: red_peer_handle_incoming (red_channel.c:87)
	==11826==    by 0x4C6EA55: red_channel_receive (red_channel.c:154)
	==11826==    by 0x4C6F82D: red_channel_event (red_channel.c:530)
	==11826==    by 0x41CB8C: main_loop_wait (vl.c:1365)
	==11826==    by 0x437CDE: kvm_main_loop (qemu-kvm.c:1589)
	==11826==    by 0x41FE9A: main (vl.c:1411)
	==11826==

	https://bugs.freedesktop.org/show_bug.cgi?id=34971

2011-03-02  Alon Levy  <alevy@redhat.com>

	server/red_worker: use red_channel_pipe_item_init
	replaces in file red_pipe_item_init.

	server/red_channel: move out_bytes_counter from Outgoing to RedChannel

	server/red_channel: split Incoming/Outgoing to callback and state
	This allows later to have the callback table under RedChannel when
	the callbacks actually get used by RedChannelClient. Since the cb's
	are identical for different clients of the same channel it makes sense
	to store the callback pointers in one place per channel. The rest of
	the incoming and outgoing struct just gets moved to RedChannelClient.

	server/red_channel: no opaque in red_channel_peer_on_*_error

	server/red_worker: use red_channel_is_connected

	server/red_channel: add red_channel_disconnect, use in red_worker
	replace channel_release_res in red_worker with red_channel_disconnect.

	server/red_channel: reset send_data.item to NULL after release

	server/red_worker: remove RedChannel argument from add_buf_from_info
	It was unused.

	server/red_channel: add red_channel_{,no_}item_being_sent

	server/red_worker: complete removal of send_data.marshaller use

	server/red_worker: replace _send_ functions by _marshall_
	Changes in display channel for a code size win.

	A note about this and the previous cursor change: it will appear that we are
	now (with these changes) releasing resources too early. This is not so - send
	always has the option of blocking, which means after send you can not release
	resources anyway, that's what the release_item callback is for. So both the
	code before and now are doing the same accounting.

	server/red_channel: add red_channel_send_message_pending

	server/red_channel: add red_channel_all_blocked

	server/red_worker: cursor channel: replace _send_ with _marshall_

	server/red_channel (all): add red_channel_get_header
	This is useful during the channel specific channel_send_pipe_item_proc
	callback, it allows altering or reader the header being sent.

	server/red_channel: add red_channel_get_first_socket
	Use in main_channel. This is just for backward portability later
	when multiple clients are introduced - needs to be considered (which
	sockets do we want to export from libspiceserver?)

	server/red_channel (+): remove red_channel_add_buf

	server/tunnel: pass SpiceMarshaller reference from send
	Introduce SpiceMarshaller param to all send's that do add_buf

	Next patch will use marshaller in all functions that currently don't by
	replacing red_channel_add_buf with marshaller add_ref. Note - currently
	tunnel is broken due to wrong size in messages.

	server/red_channel (all): add red_channel_get_stream
	use in config_socket, this makes the stream internal to the RedChannel
	implementation that will change later for multiple client support.

	ring: add RING_FOREACH{,_SAFE,_REVERSED}

	server/common: introduce common/spice_common.h
	move all the ASSERT/PANIC/PANIC_ON/red_error/red_printf* macros
	to a common file to be used with ring.h that is going to be used externally
	(by spice-gtk).

	server/red_channel (all): handle MIGRATE_DATA and MIGRATE_FLUSH_DATA
	Handling done in red_channel instead of per channel, using call backs
	for the channel specific part.
	Intended to reduce furthur reliance of channels on RedChannel struct.

	The commit makes the code harder to understand because of the artificial
	get_serial stuff, should later be fixed by having a joint migration
	header with the serial (since all channels pass it).

	server/red_channel (all): add red_channel_get_marshaller
	For ussage in the send_item callback. It's only valid during this
	time anyway (should make it return NULL in other occasions?)

	No more direct usage of RedChannel.send_data.marshaller by channels.

	server/red_worker: use red_channel_destroy

	server/inputs_channel: s/PIPE_ITEM_INIT/PIPE_ITEM_INPUTS_INIT/

	server/red_channel: move SET_ACK to red_channel

	server/red_channel: add more ack api

	server: use red_channel_get_message_serial

	server/red_channel (all): makes red_channel_reset_send_data private
	ready the way for handling ack messages in RedChannel.

	server/red_worker: use red_channel

	server/red_channe: make hold_item take a channel arg

	server/red_worker: introduce red_peer_handle_outgoing and OutgoingHandler
	From red_channel.

	server/red_worker: introduce common_channel_config_socket

	server/red_worker: line width fix

	server/red_worker: don't push to NULL channel (called from device input)

	server/red_worker: introduce red_channel_pipe_clear
	No more common_release_pipe_item

	server/red_worker: add red_channel_push

	server/red_worker: add send_item

	server/red_worker: red_channel renames
	The renames are part of refactoring red_worker's RedChannel to reuse
	red_channel.h's RedChannel at the end.

	s/red_send_data/red_channel_send/
	s/red_pipe_get/red_channel_pipe_get/
	s/recive_data/incoming/
	s/red_receive/red_channel_receive/
	s/channel_handle_message/red_channel_handle_message/
	s/channel_is_connected/red_channel_is_connected/
	s/red_pipe_add_type/red_channel_pipe_add_type/

	server/red_tunnel_worker: use message_serial setter and getter
	fixes breakage in --enable-tunnel compilation.

2011-03-01  Hans de Goede  <hdegoede@redhat.com>

	x11: Use _exit rather then exit on X errors (rhbz#680763)
	This avoids us trying to restore the original resolution when we're fullscreen
	and an X error happens. As restoring fullscreen is a bad idea then as this
	involves making more X calls, which can get us stuck (in side an XLockDisplay
	call for example).

2011-03-01  Uri Lublin  <uril@redhat.com>

	client: exit nicely for --controller with no SPICE_XPI_SOCKET (rhbz#644292)
	When starting spicec with --controller, SPICE_XPI_SOCKET environment
	variable must be defined so spicec and the controller can be connected.

2011-03-01  Hans de Goede  <hdegoede@redhat.com>

	Fix keyb modifiers not syncing from client to client os (rhbz#679467)

2011-02-28  Marc-André Lureau  <marcandre.lureau@redhat.com>

	server: add SASL support
	We introduce 2 public functions to integrate with the library user.

	spice_server_set_sasl() - turn on SASL
	spice_server_set_sasl_appname() - specify the name of the app (It is
	used for where to find the default configuration file)

	The patch for QEMU is on its way.

	https://bugs.freedesktop.org/show_bug.cgi?id=34795

	server: add auth mechanism selection
	https://bugs.freedesktop.org/show_bug.cgi?id=34795

	server: add reds_channel_dispose()
	Try to have a common base dispose() method for channels. For now, it
	just free the caps.

	Make use of it in snd_worker, and in sync_write() - sync_write() is
	going to have default caps later on.

	https://bugs.freedesktop.org/show_bug.cgi?id=34795

	server: simplify and constify sync_write()
	+ symplify, improving style of code using it.

	https://bugs.freedesktop.org/show_bug.cgi?id=34795

	server: pull out reds_handle_link(), for future reuse
	+ a couple of indent, style change

	https://bugs.freedesktop.org/show_bug.cgi?id=34795

	build: add --with-sasl
	Using cyrus SASL library (same as gtk-vnc/qemu).

	https://bugs.freedesktop.org/show_bug.cgi?id=34795

	common: add SpiceBuffer - based on qemu-vnc Buffer
	https://bugs.freedesktop.org/show_bug.cgi?id=34795

	server/reds: make writev fallback more generic
	We are going to reuse it for SASL/SSF encode write().

	https://bugs.freedesktop.org/show_bug.cgi?id=34795

	server: rename s/peer/stream
	This is stylish change again. We are talking about a RedStream object,
	so let's just name the variable "stream" everywhere, to avoid
	confusion with a non existent RedPeer object.

	https://bugs.freedesktop.org/show_bug.cgi?id=34795

	server/reds: remove the void* ctx field
	https://bugs.freedesktop.org/show_bug.cgi?id=34795

	server: use the new reds_stream_{read,write}
	https://bugs.freedesktop.org/show_bug.cgi?id=34795

2011-02-27  Marc-André Lureau  <marcandre.lureau@redhat.com>

	server: remove cb_free, not needed anymore
	https://bugs.freedesktop.org/show_bug.cgi?id=34795

	server: use reds_{link,stream}_free()
	Be carefull removing the watch before, like __release_link

	https://bugs.freedesktop.org/show_bug.cgi?id=34795

	server: use reds_stream_remove_watch() helper
	https://bugs.freedesktop.org/show_bug.cgi?id=34795

	server: add reds_stream_{read,write,free,remove_watch}()
	https://bugs.freedesktop.org/show_bug.cgi?id=34795

	server: s/RedsStreamContext/RedsStream
	https://bugs.freedesktop.org/show_bug.cgi?id=34795

	server/reds: remove unused readv
	Let's not bother with it since nobody uses it, and it's not implemented for SSL anyway

	https://bugs.freedesktop.org/show_bug.cgi?id=34795

	build: make it silent
	This patch make it easier to spot warnings in compilation.  It should
	work with older versions of automake that don't support silent rules.

	If you want verbose build, make V=1.


	https://bugs.freedesktop.org/show_bug.cgi?id=34795

2011-02-13  Arnon Gilboa  <agilboa@redhat.com>

	client/windows: use SPICE_PROTOCOL_DIR in project include dirs
	instead of ..\..\..\spice-protocol. Relative path to another git tree is a bit
	ugly, since it requires spice-protocol to be in a specific location.

	SPICE_PROTOCOL_DIR should also be used in windows qxl and vdagent instead of
	SPICE_COMMON_DIR, which is an old and confusing name, due to the common
	directory in spice git repo.

2011-02-11  Alon Levy  <alevy@redhat.com>

	server/tests/basic_event_loop: fix bzero warning

	tests/migrate.py: refactor to allow importing for later use

2011-02-11  Hans de Goede  <hdegoede@redhat.com>

	Drop static_title.bmp from windows/Makefile.am

2011-02-11  Alon Levy  <alevy@redhat.com>

	server/red_worker: cursor_channel_send_item: don't downcast

	server/red_worker: match channel_release_pipe_item_proc to red_channel

	server/red_worker: introduce an outgoing struct around out_bytes_counter

	server/red_worker: renames to add channel_ prefix and consistent sig
	s/disconnect_channel_proc/channel_disconnect_proc/
	s/release_item_proc/channel_release_pipe_item_proc/
	s/handle_message_proc/channel_handle_parsed_proc/

	Adds RedChannel* channel as first parameter to hold_pipe_item_proc

	server/red_worker: split cursor_channel_send_item
	Split from cursor_channel_push

	server/red_worker: use red_channel begin_send_message
	s/red_begin_send_message/red_channel_begin_send_message/

	server/red_worker: add red_channel_init_send_data
	Changes semantics of send to always hold/release regardless of block, like
	red_channel. A hold is just a reference count increment or nop.

	server/red_worker: split display_channel_send_item
	Split it out of display_channel_push.

	server/red_worker: extract common_release_pipe_item from red_pipe_clear

	server/red_worker: use red_channel pipe add versions
	s/red_pipe_add/red_channel_pipe_add/
	s/red_pipe_add_after/red_channel_pipe_add_after/

	server/red_worker: shorten some lines using alias variables

	server/red_worker: introduce CommonChannel
	with everything (almost) not in red_channel's RedChannel

	As a result of CommonChannel a free cb is added to EventHandler,
	to take care of non zero offset for embedded EventHandler.

	server/red_worker: use ack_data struct
	start of move to red_channel based channels

	server/red_worker: change hold_item sig, drop the void*
	changed to PipeItem *

2011-02-09  Alon Levy  <alevy@redhat.com>

	update required minimal libcacard to 0.1.2

	client/smartcard: libcacard dropped ReaderAddResponse
	uses VSC_Error with code==VSC_SUCCESS instead. This means that the VSC_Error
	message is overloaded. Instead of the other option of adding a message id,
	since the connection is TCP so no messages may be dropped or reordered, by
	having each message followed by a response there is no ambiguity. Still
	this commit adds a queue for messages that we only have one of which outstanding
	at a time, i.e. send, wait for response, send the next, etc. This further
	simplifies the logic, while not adding much overhead since only when spicec
	starts up it has a situation where it needs to send two events (ReaderAdd
	and ATR for Card Insert).

	server/smartcard: don't push our own error on reader add
	The device already sends one. There are actually two connections going
	on:
	 server to client - this is the smartcard channel, it reuses the VSC protocol.
	 server to device - this is an internal connection using VSC too.

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

	Bottom line is that there was an extra VSC_Error message reaching the client.

2011-02-07  Alon Levy  <alevy@redhat.com>

	client/smartcard: ignore VSC_Init

	server/smartcard: ignore VSC_Init from client

	server/smartcard: print instead of assert on bad reader_id in smartcard_char_device_on_message_from_device

	server/smartcard: libcacard uses network byte order, so we must too

	client/smartcard: s/reader_id_t/uint32_t/ (libcacard changed)

	server/smartcard: libcacard removed ReaderAddResponse

	server/smartcard: s/reader_id_t/uint32_t/ (libcacard changed)

	server/red_channel: style fix in red_channel_init_send_data

	server/red_channel: red_channel_pipe_clear: assert on NULL channel

	server/red_channel: add TODO

	server/red_channel: export red_channel_send

	server/red_channel: add red_channel_waiting_for_ack
	small inline function to have the ack window logic.

	server/red_channel: protect red_channel_push from NULL

	server/red_channel: reset pipe_size on clear (from red_worker)

	server/red_channel: red_channel_event: push on blocked
	try to push either on signal (write available) or when blocked
	and read signaled. From red_worker, copied for compatibility when
	switching later to RedChannel in red_worker. Doesn't make a lot of
	sense (but works), see comment in patch.

	server/red_channel: use red_channel_receive

	server/red_channel: add empty handle of SPICE_MSGC_DISCONNECTING
	Simply ignored in red_channel_handle_message

	server/red_channel: add red_channel_receive (for red_worker)

	server/red_channel: unstatic red_channel_pipe_clear (for red_worker)

	server/red_channel: unstatic red_channel_push (for red_worker)

	server/red_channel: two 80 column fixes

	server/red_channel: add public red_channel_default_peer_on_error
	for later use in red_worker

	server/red_channel: add red_channel_pipe_add_after (from red_worker)

	server/red_channel: make client ack window configurable
	from red_worker

	server/red_channel (tunnel): change sig of red_channel_handle_message
	for later usage with red_worker

	server/red_channel: make MAX_SEND_VEC 100
	MAX_SEND_VEC was 100 for DisplayChannel's RedChannel implementation which is being replaced
	with RedChannel in red_channel. So changing from 50 to 100 in red_channel
	(make this configurble?) - effectively increased memory usage by:
	(100-50)*sizeof(iovec)*(num_of_channels-2) ==(arch 64bit) 50*16*6 ~ 5k
	Not terrible.

	server/red_channel: reflect SpiceDataHeader fields in handle_parsed_proc

	server/red_channel: add red_channel_pipe_add_push

	server/red_channel: add hold_item (from red_worker)
	hold_item called on init_send_data, matching release.
	This is not the behavior of red_worker - we ref++ (==hold_item) when
	sending the item, and --refs when releasing it, instead of only holding
	if the send is blocked.

	Note 1: Naming: hold_pipe_item is the proc name, the variable is called
	hold_item, this is similar to release_item/release_pipe_item naming.

	Note 2: All channels have empty implementation, we later use this when
	red_worker get's RedChannelized.

	server/red_channel: add out_bytes_counter (unused)

	client: log subject-host mismatch, and raise ssl warnings to errors

	configure.ac: use AC_LANG_SOURCE in AC_COMPILE_IFELSE, silence remaining warnings

	server/red_worker: fix used but uninitialized warning (gcc 4.6.0)

2011-01-27  Uri Lublin  <uril@redhat.com>

	spice-client migration: fix minor for old migration support.
	For not too old spice-migration, minor is 1.
	For older (ancient) spice-migration, minor is 0.

	Affects only VM migration while a spice client is connected.

2011-01-27  Alon Levy  <alevy@redhat.com>

	client/windows: don't allocate console unless required

	client: fix broken vs2008 build

	client: --help should not need platform initialization
	separate initialization into before command line parsing and after,
	call later only if command line parsing succeeds (in particular, it
	"fails" if --help is given).

2011-01-25  Alon Levy  <alevy@redhat.com>

	demarshaller/marshaller fix gcc 4.6.0
	python_modules/demarshal.py and marshal.py fixes for gcc 4.6.0
	warning about set but unused variables. The fixes disable creating
	of variables mem_size when they are not used (demarshall) and
	declaring a src variable when the message doesn't use it (marshal).

	You need to touch *.proto after applying this (should add a Makefile
	dependency).

	codegen: avoid creating out if not used (fix gcc 4.6.0 warning)

	client: gcc 4.6.0: two more unused variable fixes

	client/cegui: cegui 0.6.0 gcc 4.6.0 related fix
	cegui doesn't include stddef required for ptrdiff_t type, we
	include it for it.

	client/glz_decoder.cpp: gcc 4.6.0 unused fixes

	client/display_channel: gcc 4.6.0 unused fixes

	common/sw_canvas: remove unused error val
	This is the only unused var change I'll want to revisit eventually,
	I'm submitting anyway since it doesn't change current behavior. I'm
	talking about ignoring the return value from canvas creation. Adding
	a print is possible but I didn't test (may be too verbose, also
	preferable to be a debug print if so, and we don't have that option
	in the code atm - probably an environment variable will do, or adding
	some spice_server_set_logging_level api, maybe even
	spice_server_set_logging_fd?)

	common/canvas_base.c: remove unused variables

	client/server: warning fixes (gcc 4.6.0)
	gcc 4.6.0 added "[-Werror=unused-but-set-variable]", this and the next
	few fixes tend to that. Mostly harmless.

	client/server: add missing USE_TUNNEL
	disable some code that only makes sense when USE_TUNNEL is defined
	in client and server channel security level setting.

	client/server: add missing smartchannel channel security handling
	The name to channel id mapping for the smartcard channel is missing,
	add it in client and server.

2011-01-21  Hans de Goede  <hdegoede@redhat.com>

	Update license header for server/red_parse_qxl.c
	This one mistakenly had a GPL header rather then an LGPL header.

	Drop unnecessary X11 and alsa requires from spice-server.pc

2011-01-19  Hans de Goede  <hdegoede@redhat.com>

	server: remove dep on CEGUI

2011-01-16  Alon Levy  <alevy@redhat.com>

	server/red_channel: fix segfault on red_channel_destroy if peer already removed

	server/inputs_channel: use outgoing marshaller in red_channel/RedChannel

2011-01-15  Alon Levy  <alevy@redhat.com>

	tests/migrate.py: add a migration test

	server/main_channel: use red_channel (most code is pipe send/marshall separation)

	server/red_channel: no need for extra loop

2011-01-13  Alon Levy  <alevy@redhat.com>

	server/red_channel: go marshaller for outgoing (copied from red_worker)

	server/reds: don't remove agent if it's not connected

	server/reds: protect reds_update_mouse_mode when main_channel is disconnected

	server/reds: don't call close on NULL channel on atexit callback

	server/reds: fix possible segfault when accessing vdagent from reds_update_mouse_mode after vdagent set to NULL

	server/reds: s/reds_push_migrate_data_item/reds_marshall_migrate_data_item/

	server: split main_channel from reds

2011-01-11  Alon Levy  <alevy@redhat.com>

	server: remove dep on libcacard
	Only the client needs this, and erronously using SPICE_REQUIRES
	results in libcacard dep in spice-server.pc, which is then dragged
	into qemu when linking, beeing used instead of the builtin libcacard.

2011-01-10  Alon Levy  <alevy@redhat.com>

	server/tests: split test_display_no_ssl to test_display_base, add streaming test

	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)

	server/tests/test_display_no_ssl: add surface create/destroy test (commented out), and square mode (default)

	server/tests: fix timer reset to allow setting next call during callback

	server/tests/test_display_no_ssl: change color every circle

	server/tests/test_display_no_ssl: restart notify timer

	server/tests: basic_event_loop: reset timer after firing it

	server/tests/test_display_no_ssl: disable cursor test until it works correctly

	server/test/test_display_no_ssl: add beginning of basic cursor item test. doesn't actually show anything on client. also, leaks.

	server/tests/test_display_no_ssl: make window 320x320, two colored updates, one in notify batch

2011-01-07  Alon Levy  <alevy@redhat.com>

	server/red_worker: use 1, not 4 when lz_encoding a top down image

2011-01-06  Alon Levy  <alevy@redhat.com>

	client/cmd_line_parser: fix wrong reporting of bad argument in --bla=val case
	We use get_opt_long, which allows non ambiguous abbreviations, but
	since we didn't like that we have code that checks for abbreviations and
	issues an error. But that code only handled separate argument and key like:
	--bla value
	and didn't handle them in the same arguemnts, like:
	--bla=value
	This patch fixes that, and gives a slightly better error report (it still
	contains the =value part though)

2011-01-05  Alon Levy  <alevy@redhat.com>

	common, canvas_get_jpeg_alpha: let top_down be any value
	Allow top_down flag to have any value, only ASSERT it is positive
	when needs to be positive and zero otherwise. Allows older server
	bug of sending 4 instead of 1 in top down flag to not affect newer
	clients (previous patch fixes server).

	client: CEGUI: search for CEGUI-0.6 to work in F15 (rawhide)

2011-01-05  Thomas Tyminski  <thomast@cs.tu-berlin.de>

	Fixes compilation error of Spice Client (Linux/X11) with OpenGL enabled modified: client/x11/red_window.cpp

2010-12-30  Alon Levy  <alevy@redhat.com>

	mingw32: refix to build on mingw..

2010-12-30  Marc-André Lureau  <marcandre.lureau@redhat.com>

	client inputs: stop blinking keyboard when out of focus
	We could introduce another boolean to prevent changes, or just reuse
	_active_modifiers_event = true to prevent further update.

	Additionaly this patch restore the keyboard state when focusing out,
	which is fine when dealing with full remote desktop, but should be
	reconsidered if/when SPICE supports remote windows managed by client
	window manager for instance, imho.

2010-12-30  Tiziano Mueller  <dev-zero@gentoo.org>

	jpeg_boolean is a mingw32-libjpeg specific thing. Use a define check rather than a version check.

2010-12-17  Hans de Goede  <hdegoede@redhat.com>

	server: Update SPICE_SERVER_VERSION

	Makefiles: fix server/tests/test_util.h not being included in make dist

	server: Update SPICE_SERVER_VERSION

2010-12-16  Hans de Goede  <hdegoede@redhat.com>

	spicec: Remove spice-client watermark (rhbz#662450)
	This patch stops us from drawing the spice client watermark at the top of
	the virtual machine view. We have had requests through several channels to
	remove this as it has little added value, and is seen as annoying by some.
	Given that we now also have a bugzilla for this I think it is time we really
	remove it.

	spicec-x11: Let the window manager place our window the 1st time (rhbz#662407)
	The problem is that RedWindow::show calls the XLib MoveWindow function
	on the window after it has been mapped, moving it to the location in
	_show_pos. This is seen by the window manager as the application saying
	I know exactly where I want my window to be placed, don't do placing for
	me. Which causes the client window to always be shown at pos 0x0, even
	though that may not be the best location.

	What this patch does is:
	1) It makes RedWindow::show not call MoveWindow when a window is
	   first created normally and then shown
	2) It makes RedWindow::show still call MoveWindow when:
	   -when the window has been shown before, and was hidden for some
	    reason (controller interface), and is now being re-shown
	    so that it ends up being re-shown at its old position
	   -when the window is a fullscreen window (screen.cpp always
	    calls move on the window before showing it to set its position)
	   -when the user switch from windowed mode -> fullscreen ->
	    windowed mode again, to make sure that the windowed mode window
	    is shown in the same position as before switching to fullscreen
	    mode

	spicec-x11: Add a class hint to our window managet hints
	This helps people who want to tell their windowmanager to do something special
	with spicec, like make it sticky, or whatever, see:
	https://bugzilla.redhat.com/show_bug.cgi?id=662452#c4

	spicec: Add a --title cmdline option (rhbz#662452)

2010-12-16  Gerd Hoffmann  <kraxel@redhat.com>

	move chardevs out of experimental
	While we are at it:  There is no reason for chardev
	support to stay in the experimental area, so move it out.
	qemu should not need the "spice-experimental.h" file.

	move switch-host migration out of experimental
	seamless stays in the experimental area.
	comments updates too.

	client migration: switch host
	Implement server-side support for switch-host client migration.  Client
	side support is present already in the tree.

	Setting the migration information is done using the existing
	spice_server_migrate_info() function.  A new
	spice_server_migrate_switch() function has been added which triggers
	sending out the switch-host message.

	Seamless migration functions are left there for now.
	spice_server_migrate_start() has been chamnged to just fail
	unconditionally though as seamless migration is broken anyway.

2010-12-15  Alon Levy  <alevy@redhat.com>

	server/red_worker: fix worker->drawable_count
	drawable_count was becoming negative. It tracks the number of
	items in the worker->current_list ring. It was decremented correctly,
	but incremented only in several cases. The cases it wasn't incremented
	where:
	 red_current_add_equal found an equivalent drawable
	by moving the increment to where the item is added to current_list, in
	__current_add_drawable, the accounting remains correct.

	This has no affect other then correct accounting, as drawable_count isn't
	used for anything.

2010-12-11  Alon Levy  <alevy@redhat.com>

	client/smartcard: external cac card library name and version changed

2010-12-09  Gerd Hoffmann  <kraxel@redhat.com>

	server: improve error handling
	We should pass up errors instead of aborting.  Do that at least
	for bind() failures which actually happen in real live due to the
	tcp port being busy.

2010-12-08  Alon Levy  <alevy@redhat.com>

	server/tests: fix for AM_LDFLAGS introduction

2010-12-08  Gerd Hoffmann  <kraxel@redhat.com>

	mingw32 build: disable -fvisibility test for unsupported mingw32 target

	v2: only disable for os_win32 (Hans)

2010-12-08  Alon Levy  <alevy@redhat.com>

	mingw32 build: check for CXImage, disable if not found (only on mingw32)
	v2:
	 + simplify (Hans)
	 + also report presence of cximage for mingw32 target

	mingw32 build: use PRIu64 instead of ll

	mingw32 build: python_modules/marshal: use unsigned for for_loop index variable

	mingw32 build: various fixes

	mingw32 build: fix two functions

	mingw32 build: add missing switch flags (nop)

	mingw32 build: eol fixes

	mingw32 build: windows/Makefile.am: double NULL definition

	mingw32 build: missing linked files for spicec.exe

	mingw32 build: remove unused, initialize uninitialized, reorder constructor initializers

	mingw32 build: fix assignement as condition warning

	mingw32 build: fixed using -1 as uninitialized value for unsigned variables

	mingw32 build: fix signed/unsigned warnings as errors

	mingw32 build: fix configure.ac typo

	mingw32 build: fix various warnings

2010-12-08  Gerd Hoffmann  <kraxel@redhat.com>

	mingw32 build: fix build errors

	mingw32 build: disable ms compiler pragmas for gcc

2010-12-07  Gerd Hoffmann  <kraxel@redhat.com>

	mingw32 build: add client/windows/Makefile, tweak configure

	build: s/HUGE/INFINITY/

	build: use jpeg_boolean with more recent libjpeg versions.

	build: only check for x11 extensions when building for x11 platform.

	build: alsa is needed on linux only.

2010-12-07  Alon Levy  <alevy@redhat.com>

	server/tests: Makefile.am: use AM_LDFLAGS instead of LDFLAGS

	server/inputs: return NULL on alloc_buf request for too large message

	server/red_channel: error channel if alloc_msg_buf fails (returns NULL)

	server/inputs_channel: better protection from channel disconnection on keyboard modifiers callback

	server/red_channel: add red_channel_is_connected

	server/inputs_channel: remove unused declaration in inputs_channel.h

	server/inputs_channel: s/inputs_channel/g_inputs_channel/

	server/inputs_channel: initialize inputs_channel to NULL

	server: reds/inputs_channel: move some structs to inputs_channel

	server: inputs_channel: use red_channel

	server: red_channel: add optional parser and separate incoming/outgoing error handlers for later inputs/main channel usage

	server: inputs_channel: s/inputs_state/inputs_channel/

	server: introduce inputs_channel, split from reds.c

	server/reds: fix typo

2010-12-07  Arnon Gilboa  <agilboa@redhat.com>

	spicec: do not call connect_secure when connect_unsecure fails due to protocol version mismatch (v2)
	If connect_unsecure failed due to protocol version mismatch, don't try to
	connect_secure with the same version, but retry (connect_secure or
	connect_unsecure) with older version. catch (...) is handled by caller