File: ChangeLog

package info (click to toggle)
spice 0.12.8-2.1+deb9u3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 8,312 kB
  • sloc: ansic: 70,594; sh: 4,497; python: 2,950; makefile: 507
file content (12183 lines) | stat: -rw-r--r-- 484,775 bytes parent folder | download
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
10114
10115
10116
10117
10118
10119
10120
10121
10122
10123
10124
10125
10126
10127
10128
10129
10130
10131
10132
10133
10134
10135
10136
10137
10138
10139
10140
10141
10142
10143
10144
10145
10146
10147
10148
10149
10150
10151
10152
10153
10154
10155
10156
10157
10158
10159
10160
10161
10162
10163
10164
10165
10166
10167
10168
10169
10170
10171
10172
10173
10174
10175
10176
10177
10178
10179
10180
10181
10182
10183
10184
10185
10186
10187
10188
10189
10190
10191
10192
10193
10194
10195
10196
10197
10198
10199
10200
10201
10202
10203
10204
10205
10206
10207
10208
10209
10210
10211
10212
10213
10214
10215
10216
10217
10218
10219
10220
10221
10222
10223
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234
10235
10236
10237
10238
10239
10240
10241
10242
10243
10244
10245
10246
10247
10248
10249
10250
10251
10252
10253
10254
10255
10256
10257
10258
10259
10260
10261
10262
10263
10264
10265
10266
10267
10268
10269
10270
10271
10272
10273
10274
10275
10276
10277
10278
10279
10280
10281
10282
10283
10284
10285
10286
10287
10288
10289
10290
10291
10292
10293
10294
10295
10296
10297
10298
10299
10300
10301
10302
10303
10304
10305
10306
10307
10308
10309
10310
10311
10312
10313
10314
10315
10316
10317
10318
10319
10320
10321
10322
10323
10324
10325
10326
10327
10328
10329
10330
10331
10332
10333
10334
10335
10336
10337
10338
10339
10340
10341
10342
10343
10344
10345
10346
10347
10348
10349
10350
10351
10352
10353
10354
10355
10356
10357
10358
10359
10360
10361
10362
10363
10364
10365
10366
10367
10368
10369
10370
10371
10372
10373
10374
10375
10376
10377
10378
10379
10380
10381
10382
10383
10384
10385
10386
10387
10388
10389
10390
10391
10392
10393
10394
10395
10396
10397
10398
10399
10400
10401
10402
10403
10404
10405
10406
10407
10408
10409
10410
10411
10412
10413
10414
10415
10416
10417
10418
10419
10420
10421
10422
10423
10424
10425
10426
10427
10428
10429
10430
10431
10432
10433
10434
10435
10436
10437
10438
10439
10440
10441
10442
10443
10444
10445
10446
10447
10448
10449
10450
10451
10452
10453
10454
10455
10456
10457
10458
10459
10460
10461
10462
10463
10464
10465
10466
10467
10468
10469
10470
10471
10472
10473
10474
10475
10476
10477
10478
10479
10480
10481
10482
10483
10484
10485
10486
10487
10488
10489
10490
10491
10492
10493
10494
10495
10496
10497
10498
10499
10500
10501
10502
10503
10504
10505
10506
10507
10508
10509
10510
10511
10512
10513
10514
10515
10516
10517
10518
10519
10520
10521
10522
10523
10524
10525
10526
10527
10528
10529
10530
10531
10532
10533
10534
10535
10536
10537
10538
10539
10540
10541
10542
10543
10544
10545
10546
10547
10548
10549
10550
10551
10552
10553
10554
10555
10556
10557
10558
10559
10560
10561
10562
10563
10564
10565
10566
10567
10568
10569
10570
10571
10572
10573
10574
10575
10576
10577
10578
10579
10580
10581
10582
10583
10584
10585
10586
10587
10588
10589
10590
10591
10592
10593
10594
10595
10596
10597
10598
10599
10600
10601
10602
10603
10604
10605
10606
10607
10608
10609
10610
10611
10612
10613
10614
10615
10616
10617
10618
10619
10620
10621
10622
10623
10624
10625
10626
10627
10628
10629
10630
10631
10632
10633
10634
10635
10636
10637
10638
10639
10640
10641
10642
10643
10644
10645
10646
10647
10648
10649
10650
10651
10652
10653
10654
10655
10656
10657
10658
10659
10660
10661
10662
10663
10664
10665
10666
10667
10668
10669
10670
10671
10672
10673
10674
10675
10676
10677
10678
10679
10680
10681
10682
10683
10684
10685
10686
10687
10688
10689
10690
10691
10692
10693
10694
10695
10696
10697
10698
10699
10700
10701
10702
10703
10704
10705
10706
10707
10708
10709
10710
10711
10712
10713
10714
10715
10716
10717
10718
10719
10720
10721
10722
10723
10724
10725
10726
10727
10728
10729
10730
10731
10732
10733
10734
10735
10736
10737
10738
10739
10740
10741
10742
10743
10744
10745
10746
10747
10748
10749
10750
10751
10752
10753
10754
10755
10756
10757
10758
10759
10760
10761
10762
10763
10764
10765
10766
10767
10768
10769
10770
10771
10772
10773
10774
10775
10776
10777
10778
10779
10780
10781
10782
10783
10784
10785
10786
10787
10788
10789
10790
10791
10792
10793
10794
10795
10796
10797
10798
10799
10800
10801
10802
10803
10804
10805
10806
10807
10808
10809
10810
10811
10812
10813
10814
10815
10816
10817
10818
10819
10820
10821
10822
10823
10824
10825
10826
10827
10828
10829
10830
10831
10832
10833
10834
10835
10836
10837
10838
10839
10840
10841
10842
10843
10844
10845
10846
10847
10848
10849
10850
10851
10852
10853
10854
10855
10856
10857
10858
10859
10860
10861
10862
10863
10864
10865
10866
10867
10868
10869
10870
10871
10872
10873
10874
10875
10876
10877
10878
10879
10880
10881
10882
10883
10884
10885
10886
10887
10888
10889
10890
10891
10892
10893
10894
10895
10896
10897
10898
10899
10900
10901
10902
10903
10904
10905
10906
10907
10908
10909
10910
10911
10912
10913
10914
10915
10916
10917
10918
10919
10920
10921
10922
10923
10924
10925
10926
10927
10928
10929
10930
10931
10932
10933
10934
10935
10936
10937
10938
10939
10940
10941
10942
10943
10944
10945
10946
10947
10948
10949
10950
10951
10952
10953
10954
10955
10956
10957
10958
10959
10960
10961
10962
10963
10964
10965
10966
10967
10968
10969
10970
10971
10972
10973
10974
10975
10976
10977
10978
10979
10980
10981
10982
10983
10984
10985
10986
10987
10988
10989
10990
10991
10992
10993
10994
10995
10996
10997
10998
10999
11000
11001
11002
11003
11004
11005
11006
11007
11008
11009
11010
11011
11012
11013
11014
11015
11016
11017
11018
11019
11020
11021
11022
11023
11024
11025
11026
11027
11028
11029
11030
11031
11032
11033
11034
11035
11036
11037
11038
11039
11040
11041
11042
11043
11044
11045
11046
11047
11048
11049
11050
11051
11052
11053
11054
11055
11056
11057
11058
11059
11060
11061
11062
11063
11064
11065
11066
11067
11068
11069
11070
11071
11072
11073
11074
11075
11076
11077
11078
11079
11080
11081
11082
11083
11084
11085
11086
11087
11088
11089
11090
11091
11092
11093
11094
11095
11096
11097
11098
11099
11100
11101
11102
11103
11104
11105
11106
11107
11108
11109
11110
11111
11112
11113
11114
11115
11116
11117
11118
11119
11120
11121
11122
11123
11124
11125
11126
11127
11128
11129
11130
11131
11132
11133
11134
11135
11136
11137
11138
11139
11140
11141
11142
11143
11144
11145
11146
11147
11148
11149
11150
11151
11152
11153
11154
11155
11156
11157
11158
11159
11160
11161
11162
11163
11164
11165
11166
11167
11168
11169
11170
11171
11172
11173
11174
11175
11176
11177
11178
11179
11180
11181
11182
11183
11184
11185
11186
11187
11188
11189
11190
11191
11192
11193
11194
11195
11196
11197
11198
11199
11200
11201
11202
11203
11204
11205
11206
11207
11208
11209
11210
11211
11212
11213
11214
11215
11216
11217
11218
11219
11220
11221
11222
11223
11224
11225
11226
11227
11228
11229
11230
11231
11232
11233
11234
11235
11236
11237
11238
11239
11240
11241
11242
11243
11244
11245
11246
11247
11248
11249
11250
11251
11252
11253
11254
11255
11256
11257
11258
11259
11260
11261
11262
11263
11264
11265
11266
11267
11268
11269
11270
11271
11272
11273
11274
11275
11276
11277
11278
11279
11280
11281
11282
11283
11284
11285
11286
11287
11288
11289
11290
11291
11292
11293
11294
11295
11296
11297
11298
11299
11300
11301
11302
11303
11304
11305
11306
11307
11308
11309
11310
11311
11312
11313
11314
11315
11316
11317
11318
11319
11320
11321
11322
11323
11324
11325
11326
11327
11328
11329
11330
11331
11332
11333
11334
11335
11336
11337
11338
11339
11340
11341
11342
11343
11344
11345
11346
11347
11348
11349
11350
11351
11352
11353
11354
11355
11356
11357
11358
11359
11360
11361
11362
11363
11364
11365
11366
11367
11368
11369
11370
11371
11372
11373
11374
11375
11376
11377
11378
11379
11380
11381
11382
11383
11384
11385
11386
11387
11388
11389
11390
11391
11392
11393
11394
11395
11396
11397
11398
11399
11400
11401
11402
11403
11404
11405
11406
11407
11408
11409
11410
11411
11412
11413
11414
11415
11416
11417
11418
11419
11420
11421
11422
11423
11424
11425
11426
11427
11428
11429
11430
11431
11432
11433
11434
11435
11436
11437
11438
11439
11440
11441
11442
11443
11444
11445
11446
11447
11448
11449
11450
11451
11452
11453
11454
11455
11456
11457
11458
11459
11460
11461
11462
11463
11464
11465
11466
11467
11468
11469
11470
11471
11472
11473
11474
11475
11476
11477
11478
11479
11480
11481
11482
11483
11484
11485
11486
11487
11488
11489
11490
11491
11492
11493
11494
11495
11496
11497
11498
11499
11500
11501
11502
11503
11504
11505
11506
11507
11508
11509
11510
11511
11512
11513
11514
11515
11516
11517
11518
11519
11520
11521
11522
11523
11524
11525
11526
11527
11528
11529
11530
11531
11532
11533
11534
11535
11536
11537
11538
11539
11540
11541
11542
11543
11544
11545
11546
11547
11548
11549
11550
11551
11552
11553
11554
11555
11556
11557
11558
11559
11560
11561
11562
11563
11564
11565
11566
11567
11568
11569
11570
11571
11572
11573
11574
11575
11576
11577
11578
11579
11580
11581
11582
11583
11584
11585
11586
11587
11588
11589
11590
11591
11592
11593
11594
11595
11596
11597
11598
11599
11600
11601
11602
11603
11604
11605
11606
11607
11608
11609
11610
11611
11612
11613
11614
11615
11616
11617
11618
11619
11620
11621
11622
11623
11624
11625
11626
11627
11628
11629
11630
11631
11632
11633
11634
11635
11636
11637
11638
11639
11640
11641
11642
11643
11644
11645
11646
11647
11648
11649
11650
11651
11652
11653
11654
11655
11656
11657
11658
11659
11660
11661
11662
11663
11664
11665
11666
11667
11668
11669
11670
11671
11672
11673
11674
11675
11676
11677
11678
11679
11680
11681
11682
11683
11684
11685
11686
11687
11688
11689
11690
11691
11692
11693
11694
11695
11696
11697
11698
11699
11700
11701
11702
11703
11704
11705
11706
11707
11708
11709
11710
11711
11712
11713
11714
11715
11716
11717
11718
11719
11720
11721
11722
11723
11724
11725
11726
11727
11728
11729
11730
11731
11732
11733
11734
11735
11736
11737
11738
11739
11740
11741
11742
11743
11744
11745
11746
11747
11748
11749
11750
11751
11752
11753
11754
11755
11756
11757
11758
11759
11760
11761
11762
11763
11764
11765
11766
11767
11768
11769
11770
11771
11772
11773
11774
11775
11776
11777
11778
11779
11780
11781
11782
11783
11784
11785
11786
11787
11788
11789
11790
11791
11792
11793
11794
11795
11796
11797
11798
11799
11800
11801
11802
11803
11804
11805
11806
11807
11808
11809
11810
11811
11812
11813
11814
11815
11816
11817
11818
11819
11820
11821
11822
11823
11824
11825
11826
11827
11828
11829
11830
11831
11832
11833
11834
11835
11836
11837
11838
11839
11840
11841
11842
11843
11844
11845
11846
11847
11848
11849
11850
11851
11852
11853
11854
11855
11856
11857
11858
11859
11860
11861
11862
11863
11864
11865
11866
11867
11868
11869
11870
11871
11872
11873
11874
11875
11876
11877
11878
11879
11880
11881
11882
11883
11884
11885
11886
11887
11888
11889
11890
11891
11892
11893
11894
11895
11896
11897
11898
11899
11900
11901
11902
11903
11904
11905
11906
11907
11908
11909
11910
11911
11912
11913
11914
11915
11916
11917
11918
11919
11920
11921
11922
11923
11924
11925
11926
11927
11928
11929
11930
11931
11932
11933
11934
11935
11936
11937
11938
11939
11940
11941
11942
11943
11944
11945
11946
11947
11948
11949
11950
11951
11952
11953
11954
11955
11956
11957
11958
11959
11960
11961
11962
11963
11964
11965
11966
11967
11968
11969
11970
11971
11972
11973
11974
11975
11976
11977
11978
11979
11980
11981
11982
11983
11984
11985
11986
11987
11988
11989
11990
11991
11992
11993
11994
11995
11996
11997
11998
11999
12000
12001
12002
12003
12004
12005
12006
12007
12008
12009
12010
12011
12012
12013
12014
12015
12016
12017
12018
12019
12020
12021
12022
12023
12024
12025
12026
12027
12028
12029
12030
12031
12032
12033
12034
12035
12036
12037
12038
12039
12040
12041
12042
12043
12044
12045
12046
12047
12048
12049
12050
12051
12052
12053
12054
12055
12056
12057
12058
12059
12060
12061
12062
12063
12064
12065
12066
12067
12068
12069
12070
12071
12072
12073
12074
12075
12076
12077
12078
12079
12080
12081
12082
12083
12084
12085
12086
12087
12088
12089
12090
12091
12092
12093
12094
12095
12096
12097
12098
12099
12100
12101
12102
12103
12104
12105
12106
12107
12108
12109
12110
12111
12112
12113
12114
12115
12116
12117
12118
12119
12120
12121
12122
12123
12124
12125
12126
12127
12128
12129
12130
12131
12132
12133
12134
12135
12136
12137
12138
12139
12140
12141
12142
12143
12144
12145
12146
12147
12148
12149
12150
12151
12152
12153
12154
12155
12156
12157
12158
12159
12160
12161
12162
12163
12164
12165
12166
12167
12168
12169
12170
12171
12172
12173
12174
12175
12176
12177
12178
12179
12180
12181
12182
12183
2016-07-13  Frediano Ziglio  <fziglio@redhat.com>

	worker: don't process drawable if it can't be allocated
	Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
	(cherry picked from commit 63b8ea5afba5c6eb1b9825b06f2006930c318aed)

2016-07-13  Marc-André Lureau  <marcandre.lureau@gmail.com>

	worker: remove assertion on alloc_drawable
	There is no guarantee in the code that this can't be hit, so we should
	cope with it (the condition can be reached easily by running the server
	without waiting for blocked clients or pipe size)

	The following commit will attempt to address this.

	Acked-by: Frediano Ziglio <fziglio@redhat.com>
	Acked-by: Christophe Fergeau <cfergeau@redhat.com>
	(cherry picked from commit 5c7e248445f95c3fa2627532780950cf604b9e20)

2016-07-08  Christophe Fergeau  <cfergeau@redhat.com>

	Update NEWS for 0.12.8 release

2016-07-07  Marc-Andre Lureau  <marcandre.lureau@redhat.com>

	smartcard: allocate msg with the expected size
	This is related to CVE-2016-0749

	==529== ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60040009c098 at pc 0x7fffee0eda6d bp 0x7fffffffcd00 sp 0x7fffffffccf0
	WRITE of size 4 at 0x60040009c098 thread T0
	    #0 0x7fffee0eda6c in smartcard_char_device_notify_reader_add /home/elmarco/pkg/spice/spice-0.12.4/server/smartcard.c:334
	    #1 0x7fffee0ef783 in smartcard_add_reader /home/elmarco/pkg/spice/spice-0.12.4/server/smartcard.c:642
	    #2 0x7fffee0f0568 in smartcard_channel_handle_message /home/elmarco/pkg/spice/spice-0.12.4/server/smartcard.c:757
	    #3 0x7fffee032f3f in red_peer_handle_incoming /home/elmarco/pkg/spice/spice-0.12.4/server/red_channel.c:304
	    #4 0x7fffee033216 in red_channel_client_receive /home/elmarco/pkg/spice/spice-0.12.4/server/red_channel.c:322
	    #5 0x7fffee03bf1f in red_channel_client_event /home/elmarco/pkg/spice/spice-0.12.4/server/red_channel.c:1561
	    #6 0x555555c3c53d in qemu_iohandler_poll /home/elmarco/src/qemu/iohandler.c:143
	    #7 0x555555c3b800 in main_loop_wait /home/elmarco/src/qemu/main-loop.c:504
	    #8 0x5555556f160c in main_loop /home/elmarco/src/qemu/vl.c:1818
	    #9 0x5555556f160c in main /home/elmarco/src/qemu/vl.c:4394
	    #10 0x7fffed80eb14 in __libc_start_main /usr/src/debug/glibc-2.17-c758a686/csu/libc-start.c:274
	    #11 0x5555556f9c20 in _start (/home/elmarco/src/qemu/x86_64-softmmu/qemu-system-x86_64+0x1a5c20)
	0x60040009c098 is located 0 bytes to the right of 8-byte region [0x60040009c090,0x60040009c098)
	allocated by thread T0 here:
	    #0 0x7ffff4e612be in __interceptor_realloc /usr/src/debug/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/x86_64-redhat-linux/libsanitizer/asan/../../../../libsanitizer/asan/asan_malloc_linux.cc:92
	    #1 0x7fffee121308 in spice_realloc /home/elmarco/pkg/spice/spice-0.12.4/spice-common/common/mem.c:123
	    #2 0x7fffee004a48 in __spice_char_device_write_buffer_get /home/elmarco/pkg/spice/spice-0.12.4/server/char_device.c:516
	    #3 0x7fffee004e87 in spice_char_device_write_buffer_get /home/elmarco/pkg/spice/spice-0.12.4/server/char_device.c:557
	    #4 0x7fffee0ed8b9 in smartcard_char_device_notify_reader_add /home/elmarco/pkg/spice/spice-0.12.4/server/smartcard.c:325
	    #5 0x7fffee0ef783 in smartcard_add_reader /home/elmarco/pkg/spice/spice-0.12.4/server/smartcard.c:642
	    #6 0x7fffee0f0568 in smartcard_channel_handle_message /home/elmarco/pkg/spice/spice-0.12.4/server/smartcard.c:757
	    #7 0x7fffee032f3f in red_peer_handle_incoming /home/elmarco/pkg/spice/spice-0.12.4/server/red_channel.c:304
	    #8 0x7fffee033216 in red_channel_client_receive /home/elmarco/pkg/spice/spice-0.12.4/server/red_channel.c:322
	    #9 0x7fffee03bf1f in red_channel_client_event /home/elmarco/pkg/spice/spice-0.12.4/server/red_channel.c:1561
	    #10 0x555555c3c53d in qemu_iohandler_poll /home/elmarco/src/qemu/iohandler.c:143
	SUMMARY: AddressSanitizer: heap-buffer-overflow /home/elmarco/pkg/spice/spice-0.12.4/server/smartcard.c:334 smartcard_char_device_notify_reader_add

	smartcard: add a ref to item before adding to pipe
	There is an unref when the message is sent.

	This is related to CVE-2016-0749

	==17204== ERROR: AddressSanitizer: heap-use-after-free on address 0x6008000144a8 at pc 0x7fffee0ce245 bp 0x7fffffffc630 sp 0x7fffffffc620
	READ of size 4 at 0x6008000144a8 thread T0
	    #0 0x7fffee0ce244 in smartcard_unref_vsc_msg_item /home/elmarco/src/spice/spice/server/smartcard.c:608
	    #1 0x7fffee0cb451 in smartcard_unref_msg_to_client /home/elmarco/src/spice/spice/server/smartcard.c:178
	    #2 0x7fffedfcdf14 in spice_char_device_read_from_device /home/elmarco/src/spice/spice/server/char-device.c:330
	    #3 0x7fffedfd1763 in spice_char_device_wakeup /home/elmarco/src/spice/spice/server/char-device.c:901
	    #4 0x7fffee05da98 in spice_server_char_device_wakeup /home/elmarco/src/spice/spice/server/reds.c:2990
	    #5 0x55555593fa34 in spice_chr_write /home/elmarco/src/qemu/spice-qemu-char.c:189
	    #6 0x5555559375f1 in qemu_chr_fe_write /home/elmarco/src/qemu/qemu-char.c:220
	    #7 0x555555b3b682 in ccid_card_vscard_send_msg.isra.2 /home/elmarco/src/qemu/hw/usb/ccid-card-passthru.c:76
	    #8 0x555555b3c466 in ccid_card_vscard_send_error /home/elmarco/src/qemu/hw/usb/ccid-card-passthru.c:91
	    #9 0x555555b3c466 in ccid_card_vscard_handle_message /home/elmarco/src/qemu/hw/usb/ccid-card-passthru.c:242
	    #10 0x555555b3c466 in ccid_card_vscard_read /home/elmarco/src/qemu/hw/usb/ccid-card-passthru.c:289
	    #11 0x55555593f169 in vmc_write /home/elmarco/src/qemu/spice-qemu-char.c:41
	    #12 0x7fffedfcee6d in spice_char_device_write_to_device /home/elmarco/src/spice/spice/server/char-device.c:477
	    #13 0x7fffedfcfd31 in spice_char_device_write_buffer_add /home/elmarco/src/spice/spice/server/char-device.c:629
	    #14 0x7fffee0ce9df in smartcard_channel_write_to_reader /home/elmarco/src/spice/spice/server/smartcard.c:675
	    #15 0x7fffee0cc7db in smartcard_char_device_notify_reader_add /home/elmarco/src/spice/spice/server/smartcard.c:341
	    #16 0x7fffee0ce4f3 in smartcard_add_reader /home/elmarco/src/spice/spice/server/smartcard.c:648
	    #17 0x7fffee0cf2e2 in smartcard_channel_handle_message /home/elmarco/src/spice/spice/server/smartcard.c:763
	    #18 0x7fffedffe21f in red_peer_handle_incoming /home/elmarco/src/spice/spice/server/red-channel.c:307
	    #19 0x7fffedffe4f6 in red_channel_client_receive /home/elmarco/src/spice/spice/server/red-channel.c:325
	    #20 0x7fffee00726c in red_channel_client_event /home/elmarco/src/spice/spice/server/red-channel.c:1566
	    #21 0x555555c3c53d in qemu_iohandler_poll /home/elmarco/src/qemu/iohandler.c:143
	    #22 0x555555c3b800 in main_loop_wait /home/elmarco/src/qemu/main-loop.c:504
	    #23 0x5555556f160c in main_loop /home/elmarco/src/qemu/vl.c:1818
	    #24 0x5555556f160c in main /home/elmarco/src/qemu/vl.c:4394
	    #25 0x7fffed7d0b14 in __libc_start_main /usr/src/debug/glibc-2.17-c758a686/csu/libc-start.c:274
	    #26 0x5555556f9c20 in _start (/home/elmarco/src/qemu/x86_64-softmmu/qemu-system-x86_64+0x1a5c20)
	0x6008000144a8 is located 24 bytes inside of 40-byte region [0x600800014490,0x6008000144b8)
	freed by thread T0 here:
	    #0 0x7ffff4e61009 in __interceptor_free /usr/src/debug/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/x86_64-redhat-linux/libsanitizer/asan/../../../../libsanitizer/asan/asan_malloc_linux.cc:61
	    #1 0x7fffee0ce2a1 in smartcard_unref_vsc_msg_item /home/elmarco/src/spice/spice/server/smartcard.c:610
	    #2 0x7fffee0cdd58 in smartcard_channel_release_pipe_item /home/elmarco/src/spice/spice/server/smartcard.c:548
	    #3 0x7fffee000668 in red_channel_client_release_item /home/elmarco/src/spice/spice/server/red-channel.c:602
	    #4 0x7fffee0006ef in red_channel_client_release_sent_item /home/elmarco/src/spice/spice/server/red-channel.c:609
	    #5 0x7fffee0007b5 in red_channel_peer_on_out_msg_done /home/elmarco/src/spice/spice/server/red-channel.c:620
	    #6 0x7fffedffed7e in red_peer_handle_outgoing /home/elmarco/src/spice/spice/server/red-channel.c:385
	    #7 0x7fffee0057bb in red_channel_client_send /home/elmarco/src/spice/spice/server/red-channel.c:1294
	    #8 0x7fffee0076e6 in red_channel_client_begin_send_message /home/elmarco/src/spice/spice/server/red-channel.c:1605
	    #9 0x7fffee0cdccd in smartcard_channel_send_item /home/elmarco/src/spice/spice/server/smartcard.c:541
	    #10 0x7fffee000570 in red_channel_client_send_item /home/elmarco/src/spice/spice/server/red-channel.c:588
	    #11 0x7fffee005bfb in red_channel_client_push /home/elmarco/src/spice/spice/server/red-channel.c:1347
	    #12 0x7fffee007ef7 in red_channel_client_pipe_add_push /home/elmarco/src/spice/spice/server/red-channel.c:1673
	    #13 0x7fffee0cde4d in smartcard_channel_client_pipe_add_push /home/elmarco/src/spice/spice/server/smartcard.c:571
	    #14 0x7fffee0cb567 in smartcard_send_msg_to_client /home/elmarco/src/spice/spice/server/smartcard.c:187
	    #15 0x7fffedfcdba2 in spice_char_device_send_msg_to_clients /home/elmarco/src/spice/spice/server/char-device.c:282
	    #16 0x7fffedfcdea4 in spice_char_device_read_from_device /home/elmarco/src/spice/spice/server/char-device.c:329
	    #17 0x7fffedfd1763 in spice_char_device_wakeup /home/elmarco/src/spice/spice/server/char-device.c:901
	    #18 0x7fffee05da98 in spice_server_char_device_wakeup /home/elmarco/src/spice/spice/server/reds.c:2990
	    #19 0x55555593fa34 in spice_chr_write /home/elmarco/src/qemu/spice-qemu-char.c:189

2016-07-01  Frediano Ziglio  <fziglio@redhat.com>

	improve primary surface parameter checks
	Primary surface, as additional surfaces, can be used to access
	host memory from the guest using invalid parameters.

	The removed warning is not enough to prevent all cases. Also a warning
	is not enough to stop an escalation to happen.
	The red_validate_surface do different checks to make sure surface
	request is valid and not cause possible buffer/integer overflows:
	- format is valid;
	- width is not large to cause overflow compared to stride;
	- stride is not -2^31 (a number which negate is still <0);
	- stride * height does not overflow.

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

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

	factor out red_validate_surface function to validate surface parameters
	Make possible to reuse it outside red-parse-qxl.c.

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

2016-04-14  Christophe Fergeau  <cfergeau@redhat.com>

	Revert "Set TCP_KEEPINTVL when enabling TCP keepalive"
	This reverts commit 3336d892c3d8647868423300905e5cad67de1db1.

	This was NACK'ed for the master branch, but was pushed by mistake to the
	0.12 branch

	Update NEWS file for 0.12.7

	Update libtool versioning for 0.12.7 release

	Update spice-common
	Revert spice-protocol/codegen changes.
	This was causing build failures when trying to compile an older spice-server
	release against a newer spice-protocol release with new message/channel
	additions

	spice-common changes this brings in:

	Christophe Fergeau (2):
	      proto: Rename image_compress to image_compression
	      proto: Use proper type for preferred_compression field

	Marc-André Lureau (1):
	      Revert "Remove files moved to spice-protocol"

2016-04-14  Frediano Ziglio  <fziglio@redhat.com>

	red-channel: make red_client_{ref,unref} thread safe
	These function are called on both sides of dispatcher so the
	increment/decrement of the counter is done in multiple threads.
	This caused the counter to not get incremented correctly and
	freed the structure too early, leaving a dangling pointer in
	the other thread.

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

	Acked-by: Christophe Fergeau <cfergeau@redhat.com>
	Acked-by: Jonathon Jongsma <jjongsma@redhat.com>

2016-03-29  Frediano Ziglio  <fziglio@redhat.com>

	memslot: do not crash if guest provide a wrong address
	This could happen with buggy driver.

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

	Acked-by: Pavel Grunt <pgrunt@redhat.com>

	channel: do not free rcc->stream in red_channel_client_disconnect
	This fixes a crash if red_channel_client disconnect is called
	handling a message.
	This can happen for instance while handling SPICE_MSGC_ACK which calls
	red_channel_client_push which tries to detect write errors while writing
	to a socket (for instance socket disconnection).
	Messages are read in a loop and red_channel_client_disconnect would
	cause rcc->stream to be NULL which will result in a use-after-free
	problem (stream in red_peer_handle_incoming will use cached stream value).

	Acked-by: Jonathon Jongsma <jjongsma@redhat.com>

2016-03-10  Christophe Fergeau  <cfergeau@redhat.com>

	Set TCP_KEEPINTVL when enabling TCP keepalive
	Otherwise we are only changing the timeout before the first keepalive
	probe is sent.

	Remove spice_server_set_keepalive_timeout
	This public API is no longer needed as the keepalive interval does not
	need to be configurable. This API was never in a stable 0.12 release, so
	it's OK to remove it now.

	Always enable TCP keepalive
	Always enabled, hardcoded interval
	as per https://bugzilla.redhat.com/show_bug.cgi?id=1298590

2016-01-13  Christophe Fergeau  <cfergeau@redhat.com>

	Update spice-common
	This fixes a compilation problem on EL6. git shortlog of the
	spice-common changes brought in by the submodule update:

	Christophe Fergeau (2):
	      m4: Fix SPICE_WARNING on el6
	      test: Use _LDADD rather than _LDFLAGS

	Frediano Ziglio (1):
	      ring: use NULL instead of 0 for null pointers

	Lukas Venhoda (9):
	      pixman_utils: Add macros for color byte ordering
	      pixman_utils: Use PIXMAN_LE_ constants in spice_bitmap_try_as_pixman()
	      ppc: Add support for bigendian color byte order
	      ppc: Fix colors on ppc when using QUIC
	      ppc: Fix colors on ppc when using LZ
	      ppc: Fix colors on ppc when using LZ4
	      ppc: Fix colors on ppc when using jpeg
	      ppc: Fix alpha state checking on BE machines
	      Remove trailing whitespace

	Pavel Grunt (1):
	      m4: Add macro for --with-sasl

	Victor Toso (1):
	      Remove headers that are included in spice_common.h

	Update NEWS for 0.12.7 release

	spicevmc: Drop unsent data on client disconnection
	When redirecting a USB webcam over a slow link, it's currently possible
	to hit an assertion in spice-server by running cheese (application using
	the webcam), killing the client with ctrl+c and then restarting the
	client:
	qemu-kvm: spicevmc.c:324: spicevmc_red_channel_alloc_msg_rcv_buf:
	Assertion `!state->recv_from_client_buf' failed.

	This happens when red_peer_handle_incoming tries to allocate memory for
	a message using spicevmc:
	handler->msg = handler->cb->alloc_msg_buf(handler->opaque, msg_type,
	msg_size);

	red_peer_handle_incoming() is called when there is client data to be
	read, and does
	- call alloc_msg_buf() to allocate memory for the message
	- read the message
	- if the read was partial, return early, the main loop will call again
	  red_peer_handle_incoming() when there is more data available for that
	  channel
	- parse the message
	- call release_msg_buf() to free the message

	For channels based on spicevmc (usbredir and port), alloc_msg_buf()
	stores message data in SpiceVmcState::recv_from_client_buf and before
	allocating new memory, it asserts that it's NULL.

	This is what causes this crash in the following scenario:
	- SpiceVmc::alloc_msg_buf() is called and allocates memory for a new
	  message in SpiceVmcState::recv_from_client_buf
	- red_peer_handle_incoming() returns early as all the spicevmc message
	  data hasn't been received yet
	- the client gets killed
	- the main channel notices the disconnect and calls
	  main_dispatcher_client_disconnect() which will disconnect all the
	  channels
	- SpiceVmc::on_disconnect is called
	- after the new client connects, SpiceVmc::alloc_msg_buf() is called,
	  notices that SpiceVmcState::recv_from_client_buf is already set, and
	  asserts()

	This commit makes sure the partial SpiceVmcState::recv_from_client_buf
	data is cleared on disconnect so that the assert does not trigger.

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

2016-01-13  Frediano Ziglio  <fziglio@redhat.com>

	pass proper type to SPICE_CONTAINEROF
	In some case the member specified to SPICE_CONTAINEROF was not
	exactly the same type of the pointer passed.
	This can cause issues if structure changes so use proper member.

	Acked-by: Fabiano Fidêncio <fidencio@redhat.com>

2016-01-13  Sunny Shin  <sunny4s.git@gmail.com>

	channel: add option tcp keepalive timeout to channels

2016-01-13  Francois Gouget  <fgouget@codeweavers.com>

	server: Fix conversions between QXLPHYSICAL and pointers
	This avoids compilation errors with -Werror on 32 bit systems as the
	pointer size differs from that of a QXLPHYSICAL.

	server: Simplify the next chunk initialization in red_replay_data_chunks()

	server: Fix a pointer to uint64_t cast in spice_replay_next_cmd()
	This avoids a compilation error with -Werror on 32 bit systems as the
	pointer size differs from that of an uint64_t.

	server: Use '%zu' to print size_t variables
	The size_t definition is different between 32 and 64 bit systems so that
	neither '%u' nor '%lu' work for both. '%zu' should be used instead.

	Acked-by: Jonathon Jongsma <jjongsma@redhat.com>

	server: Use PRI macros in printf for 32/64 bit compatibility
	Some integer type definitions are different between 32 and 64 bit
	systems which causes problems in printf. The PRI macros automatically
	provide the printf format appropriate for the system.

	Acked-by: Jonathon Jongsma <jjongsma@redhat.com>

2016-01-13  Victor Toso  <victortoso@redhat.com>

	spicevmc: set state of DeviceInstance to NULL
	After spice_char_device_state_destroy is called spicevmc should not keep
	reference to that memory. state->chardev_st and sin->st point to the
	same SpiceCharDeviceState and both should be set to NULL when it is
	destroyed.

	char-device: set to NULL freed pointers on destroy
	As SpiceCharDeviceState is only unref'ed on
	spice_char_device_state_destroy the same device could be destroyed more
	then once so the pointers that are freed should be set to NULL.

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

	char-device: free all memory pool when no clients
	When no client is connect we should not need to keep the memory pool
	used by char-device. In most situations this is not significant but
	when using webdav this could mean freeing MAX_POOL_SIZE bytes

	Related: https://bugs.freedesktop.org/show_bug.cgi?id=91350

	char-device: Define a memory pool limit
	Otherwise the amount of unused memory could grow while transfering big
	chunks of data. This change only means that once the memory was used it
	will not be stored again after the limit was reached.

	Related: https://bugs.freedesktop.org/show_bug.cgi?id=91350

	char-device: fix usage of free/unref on WriteBuffer
	There are places were the could should definetly free the
	SpiceCharDeviceWriteBuffer and places that it should only unref it. The
	current use of spice_char_device_write_buffer_free was missleading.

	This patch creates the spice_char_device_write_buffer_unref and properly
	call these two functions.

	Related: https://bugs.freedesktop.org/show_bug.cgi?id=91350

2016-01-13  Lukas Venhoda  <lvenhoda@redhat.com>

	dcc: Don't disconnect channel, when compression is not supported
	Don't disconnect the display channel, when unsupported compression is
	requested from the client. Not changing the compression is enough.

	https://bugs.freedesktop.org/show_bug.cgi?id=92821
	Acked-by: Victor Toso <victortoso@redhat.com>
	Acked-by: Frediano Ziglio <fziglio@redhat.com>

2016-01-07  Pavel Grunt  <pgrunt@redhat.com>

	spicevmc: Return early when instance has no device state
	Same approach as in spice_server_char_device_wakeup().
	Avoid segmentation fault when the webdav channel (spice port channel) is
	used with the vnc display:
	 #0  0x00007ffff7aab734 in spice_char_device_state_opaque_get (dev=0x0)
	     at char_device.c:720
	 #1  0x00007ffff7b0850c in spice_server_port_event (sin=<optimized out>, event=<optimized out>) at spicevmc.c:578
	 #2  0x0000555555787ba4 in set_guest_connected (port=<optimized out>, guest_connected=1) at hw/char/virtio-console.c:89
	 #3  0x0000555555678d7c in control_out (len=<optimized out>, buf=0x55555775c3a0, vser=0x5555578d1540) at /home/pgrunt/RH/qemu/hw/char/virtio-serial-bus.c:404
	 #4  0x0000555555678d7c in control_out (vdev=0x5555578d1540, vq=0x555557941bc8)
	     at /home/pgrunt/RH/qemu/hw/char/virtio-serial-bus.c:441
	 #5  0x000055555588eb98 in aio_dispatch (ctx=0x5555562e1a50) at aio-posix.c:160
	 #6  0x00005555558829ee in aio_ctx_dispatch (source=<optimized out>, callback=<optimized out>, user_data=<optimized out>) at async.c:226
	 #7  0x00007ffff2010e3a in g_main_context_dispatch () at /lib64/libglib-2.0.so.0
	 #8  0x000055555588d8fb in main_loop_wait () at main-loop.c:211
	 #9  0x000055555588d8fb in main_loop_wait (timeout=<optimized out>)
	     at main-loop.c:256
	 #10 0x000055555588d8fb in main_loop_wait (nonblocking=<optimized out>)
	     at main-loop.c:504
	 #11 0x000055555561b664 in main () at vl.c:1891

	reds: Do not abort due to wrong header
	Just prevent the buggy client from connecting.

	 #0  0x00007fffe83b2a98 in raise () at /lib64/libc.so.6
	 #1  0x00007fffe83b469a in abort () at /lib64/libc.so.6
	 #2  0x00007ffff7b1533d in spice_logv (log_domain=0x7ffff7b87226 "Spice", log_level=SPICE_LOG_LEVEL_ERROR, strloc=0x7ffff7b92aba "reds.c:1373", function=0x7ffff7b94f40 <__FUNCTION__.31775> "reds_send_link_ack", format=0x7ffff7b871fe "assertion `%s' failed", args=args@entry=0x7fffffffcb68) at log.c:109
	 #3  0x00007ffff7b15468 in spice_log (log_domain=log_domain@entry=0x7ffff7b87226 "Spice", log_level=log_level@entry=SPICE_LOG_LEVEL_ERROR, strloc=strloc@entry=0x7ffff7b92aba "reds.c:1373", function=function@entry=0x7ffff7b94f40 <__FUNCTION__.31775> "reds_send_link_ack", format=format@entry=0x7ffff7b871fe "assertion `%s' failed") at log.c:123
	 #4  0x00007ffff7aee335 in reds_handle_read_link_done (link=0x555556b27c70)
	     at reds.c:1373
	 #5  0x00007ffff7aee335 in reds_handle_read_link_done (opaque=0x555556b27c70)
	     at reds.c:2139
	 #6  0x000055555588acc6 in qemu_iohandler_poll ()
	 #7  0x000055555588a8e1 in main_loop_wait ()
	 #8  0x0000555555614064 in main ()

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

	Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
	Acked-by: Frediano Ziglio <fziglio@redhat.com>

2016-01-07  Marc-André Lureau  <mlureau@redhat.com>

	build-sys: disable static lib by default
	It's not used in general, so no need to build it by default.

	Acked-by: Frediano Ziglio <fziglio@redhat.com>

2016-01-07  Christophe Fergeau  <cfergeau@redhat.com>

	build: Remove unused SPICEC_STATIC_LINKAGE_BSTATIC
	A left-over from the client code.

2016-01-07  Frediano Ziglio  <fziglio@redhat.com>

	replay: better help for -s option
	-s accepts an option to delay command queueing.

	Acked-by: Marc-André Lureau <mlureau@redhat.com>

2015-12-14  Jeremy White  <jwhite@codeweavers.com>

	Flush display commands before validating the surface.
	This fixes a display glitch in xspice which is caused when
	a surface create is queued, but then a direct call to update
	the area is issued.  Unless we flush the queue, the surface
	does not exist, and we fail.

2015-12-11  Frediano Ziglio  <fziglio@redhat.com>

	dcc: do not cause problem with multiple threads.
	With multiple cards configured you can have multiple workers running in
	different thread.
	With such configuration static variables not syncronized could lead
	to undefined behavior.

	Acked-by: Jonathon Jongsma <jjongsma@redhat.com>

2015-12-11  Marc-André Lureau  <marcandre.lureau@gmail.com>

	smartcard: include libcacard.h if possible

	Add travis CI file

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

	Update spice-common
	shortlog for the spice-common changes this brings in:

	Christophe Fergeau (3):
	      build-sys: Add missing # to comment
	      ssl-verify: Handle NULL return from g_inet_address_new_from_string()
	      ssl-verify: Don't leak GInetAddress

	Francois Gouget (3):
	      build-sys: Add the SPICE_WARNING() and SPICE_PRINT_MESSAGES m4 macros
	      build-sys: Add SPICE_CHECK_GSTREAMER()
	      build-sys: Add SPICE_CHECK_GSTREAMER_ELEMENTS()

	Lukas Venhoda (1):
	      canvas_base: Remove redundant switch case block

	Marc-André Lureau (2):
	      Fix make distcheck
	      Use new libcacard.h if possible

	build-sys: Adjust to new spice-common spice-deps.m4
	This commit also updates the spice-common submodule

	Christophe Fergeau (7):
	      Add marshaller test case
	      build-sys: Use ${PKG_CONFIG} rather than pkg-config
	      build-sys: Rework SPICE_CHECK_* m4 macros
	      build-sys: Add gio-2.0 to SPICE_CHECK_GLIB2
	      build-sys: Fix error in SPICE_CHECK_LZ4 description
	      build-sys: Set automake conditional in SPICE_CHECK_SMARTCARD
	      build-sys: Rename SUPPORT_GL to HAVE_GL

	Javier Celaya (1):
	      Fix linearization of several marshallers with one item

	Lukas Venhoda (3):
	      ssl-verify: Only check addr length when using IP addr
	      m4: Require glib version >= 2.22
	      ssl-verify: Changed IPv4 hostname to IPv6

2015-12-11  Frediano Ziglio  <fziglio@redhat.com>

	remove small leak in MJPEG code
	cinfo.dest is allocated in spice_jpeg_mem_dest but never freed.
	Note that jpeg_destroy_compress does not free this field as is
	supposed to be a buffer provided by jpeg caller.

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

	Add missing license headers

	syntax-check: Exclude png files from sc_prohibit_empty_lines_at_EOF

	syntax-check: Clean-up exception rules
	Some files no longer exists, some exceptions are no longer needed, ...

	syntax-check: Remove unused #include <strings.h>

	syntax-check: Add missing #include <config.h>

	syntax-check: Don't use tabs for indentation

	syntax-check: Exclude red_replay_qxl.c from sc_cast_of_argument_to_free
	red_replay_qxl.c stores some pointers QXLPHYSICAL data members (ie
	uint64_t), and then needs to free them, so the cast is required.

	syntax-check: Ignore .png files in sc_trailing_blank test

	syntax-check: manual: Remove duplicate word

	syntax-check: Add missing AUTHORS

2015-12-11  snir sheriber  <ssheribe@redhat.com>

	fix spelling mistakes in comments (reseting to resetting & dummym to dummy)
	Acked-by: Frediano Ziglio <fziglio@redhat.com>

2015-12-11  Jeremy White  <jwhite@codeweavers.com>

	Update the .gitignore files for the new manual, for a few newly generated tests, and for the spice-server.h.

2015-10-12  Frediano Ziglio  <fziglio@redhat.com>

	Simplify pointer computation
	Acked-by: Christophe Fergeau <cfergeau@redhat.com>

2015-10-07  Christophe Fergeau  <cfergeau@redhat.com>

	build-sys: Remove client check from configure.ac
	configure.ac is checking for pyparsing availability if
	client/generated_marshallers.cpp is missing. The client/ code is gone, and
	the python modules checks are done in spice-common/configure.ac
	nowadays, so we can get rid of this check.

2015-10-06  Frediano Ziglio  <fziglio@redhat.com>

	build-sys: bump libtool version information
	As one interface was added bump the version and put a comment to avoid
	too much updates.

2015-10-06  Christophe Fergeau  <cfergeau@redhat.com>

	Mention the 2 recently fixed CVEs in NEWS

2015-10-06  Frediano Ziglio  <fziglio@redhat.com>

	Prevent leak if size from red_get_data_chunks don't match in red_get_image

	Prevent data_size to be set independently from data
	There was not check for data_size field so one could set data to
	a small set of data and data_size much bigger than size of data
	leading to buffer overflow.

	Avoid race condition copying segments in red_get_path
	The guest can attempt to increase the number of segments while
	spice-server is reading them.
	Make sure we don't copy more then the allocated segments.

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

	Make sure we can read QXLPathSeg structures
	start pointer points to a QXLPathSeg structure.
	Before reading from the structure, make sure the structure is contained
	in the memory range checked.

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

	Fix some possible overflows in red_get_string for 32 bit
	Acked-by: Christophe Fergeau <cfergeau@redhat.com>

	Prevent DoS from guest trying to allocate too much data on host for chunks
	Limit number of chunks to a given amount to avoid guest trying to
	allocate too much memory. Using circular or nested chunks lists
	guest could try to allocate huge amounts of memory.
	Considering the list can be infinite and guest can change data this
	also prevents strange security attacks from guest.

	Prevent memory leak if red_get_data_chunks_ptr fails
	Free linked list if client tries to do nasty things

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

	Fix race condition in red_get_data_chunks_ptr
	Do not read multiple times data from guest as this can be changed by
	other guest vcpus. This causes races and security problems if these
	data are used for buffer allocation or checks.

	Actually, the 'data' member can't change during read as it is just a
	pointer to a fixed array contained in qxl. However, this change will
	make it clear that there can be no race condition.

	Fix integer overflow computing glyph_size in red_get_string
	If bpp is int the formula can lead to weird overflows. width and height
	are uint16_t so the formula is:

	  size_t = u16 * (u16 * int + const_int) / const_int;

	so it became

	  size_t = (int) u16 * ((int) u16 * int + const_int) / const_int;

	However the (int) u16 * (int) u16 can then became negative to overflow.
	Under 64 bit architectures size_t is 64 and int usually 32 so converting
	this negative 32 bit number to a unsigned 64 bit lead to a very big
	number as the signed is extended and then converted to unsigned.
	Using unsigned arithmetic prevent extending the sign.

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

	Fix race condition in red_get_string
	Do not read multiple time an array size that can be changed.

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

	Fix race in red_get_image
	Do not read multiple times data from guest as this could be changed
	by other vcpu threads.
	This causes races and security problems if these data are used for
	buffer allocation or checks.

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

	Fix race condition on red_get_clip_rects
	Do not read multiple time an array size that can be changed.

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

	Prevent 32 bit integer overflow in bitmap_consistent
	The overflow may lead to buffer overflow as the row size computed from
	width (bitmap->x) can be bigger than the size in bytes (bitmap->stride).
	This can make spice-server accept the invalid sizes.

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

	Fix buffer reading overflow
	Not security risk as just for read.
	However, this could be used to attempt integer overflows in the
	following lines.

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

	Check properly surface to be created
	Check format is valid.
	Check stride is at least the size of required bytes for a row.

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

	Fix some integer overflow causing large memory allocations
	Prevent integer overflow when computing image sizes.
	Image index computations are done using 32 bit so this can cause easily
	security issues. MAX_DATA_CHUNK is larger than the virtual
	card limit, so this is not going to cause change in behaviours.
	Comparing size calculation results with MAX_DATA_CHUNK will allow us to
	catch overflows.
	Prevent guest from allocating large amount of memory.

	Define a constant to limit data from guest.
	This limit will prevent guest trying to do nasty things and DoS to host.

	worker: avoid double free or double create of surfaces
	A driver can overwrite surface state creating a surface with the same
	id of a previous one.
	Also can try to destroy surfaces that are not created.
	Both requests cause invalid internal states that could lead to crashes
	or memory corruptions.

	worker: validate correctly surfaces
	Do not just give warning and continue to use an invalid index into
	an array.

	Resolves: CVE-2015-5260

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

2015-10-05  Marc-André Lureau  <marcandre.lureau@gmail.com>

	worker: make it clear it returns from process when no cmd
	Acked-by: Frediano Ziglio <fziglio@redhat.com>

2015-10-02  Marc-André Lureau  <marcandre.lureau@gmail.com>

	server: remove useless includes
	Acked-by: Frediano Ziglio <fziglio@redhat.com>

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

	manual: Fix Arnon last name
	It's "Gilboa", not "Giloba"

	manual: Add section about debugging
	This details the basics for now, but can be detailed in the future.

	Update NEWS

2015-09-29  Marc-André Lureau  <marcandre.lureau@gmail.com>

	worker: count in drawable_new()

2015-09-29  Jonathon Jongsma  <jjongsma@redhat.com>

	PALLET -> PALETTE
	Use the correct spelling for the enumeration

2015-09-29  Christophe Fergeau  <cfergeau@redhat.com>

	tests: Fix -Werror=format-zero-length build failure
	replay.c: In function 'replay_channel_event':
	replay.c:226:16: error: zero-length gnu_printf format string
	[-Werror=format-zero-length]
	     g_printerr("");

2015-09-24  Christophe Fergeau  <cfergeau@redhat.com>

	display: Advertise preferred compression cap
	The patches adding a way for the client to set its preferred compression
	method added a new capability so that the server can indicate support
	for this feature. However, spice-server was not setting this capability
	on its display channel, which means clients are not going to try to send
	'preferred-compression' messages even though the user request it.

2015-09-15  Marc-André Lureau  <marcandre.lureau@gmail.com>

	manual: add smartcard channel section
	Add some basic instructions to setup smartcard channel

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

	manual: add missing space
	Acked-by: Christophe Fergeau <cfergeau@redhat.com>

	manual: update webdav virt-manager section
	virt-manager can add webdav channel for a while now.

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

2015-09-08  Frediano Ziglio  <fziglio@redhat.com>

	Avoid race conditions reading monitor configs from guest
	For security reasons do not assume guest do not change structures it
	pass to Qemu.
	Guest could change count field while Qemu is copying QXLMonitorsConfig
	structure leading to heap corruption.
	This patch avoid it reading count only once.

	This patch solves CVE-2015-3247.

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

	replay: fix formatting string
	Acked-by: Christophe Fergeau <cfergeau@redhat.com>

2015-09-07  Frediano Ziglio  <fziglio@redhat.com>

	build-sys: Update warning message
	arch_warn was set to 1 only if architecture is not x86, x64 or arm.
	Update the message as we actually mainly test x64.
	Define the warning message and do the architecture checks in the
	same place so that they are easier to keep in sync.

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

2015-09-04  Frediano Ziglio  <fziglio@redhat.com>

	improve performances comparing image pixels
	This patch contains a bit of small optimizations.
	It avoid boolean	 operations which could involve branches replacing
	with binary operations (equal/all_ident -> some_differences).
	The other optimization avoids the use of ABS. First the way the macro
	was used (with a large expression) was not easy to optimize by the
	compiler.
	Then instead of using ABS a much simpler range check is used so instead
	of (ABS(n) >= k) a ((n) <= -k || (n) >= k) is used. This looks small
	but modern compilers can translate this not in range check in a couple
	of machine instructions (and a single compare).

	Using operf on same samples (using spice-server-replay) and trying 2 runs
	I got

	run             1       2
	-------------------------
	before    104441   106267
	after      92387    91083

	So the performance increase is about 13%.

	Acked-by: Jonathon Jongsma <jjongsma@redhat.com>

2015-09-03  Frediano Ziglio  <fziglio@redhat.com>

	avoid to call red_get_streams_timout twice computing timeout
	Due to how the MIN macro is defined the function was called twice
	unless the compiler could demonstrate that was returning the same
	value (which actually is impossible as function as clock_gettime
	are not deterministic).

	Acked-by: Jonathon Jongsma <jjongsma@redhat.com>

	spice_timer_queue: fix access after free
	Do not access to timer after we call the associated function.
	Some of these callbacks can call spice_timer_remove making the pointer
	pointing to freed data.
	This happen for instance when the client is disconnecting.
	This does not cause memory corruption on current allocator
	implementations as all freeing/accessing happen on a single thread quite
	closely and allocators use different pools for different thread.

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

2015-09-01  Frediano Ziglio  <fziglio@redhat.com>

	replay: compatibility with former version
	GMutex usage in replay.c was not working so replace with plain pthread.

	replay: do not define same type twice
	Avoid to use typedef twice for the same type as some compiler
	complaints about it.
	SpiceTimer and SpiceWatch are defined in server/spice-core.h
	as an abstract type which should be defined by some code (as
	server/tests/basic_event_loop.c does).

2015-09-01  Christophe Fergeau  <cfergeau@redhat.com>

	Update spice-common submodule
	Christophe Fergeau (1):
	      build-sys: Remove code generation files from EXTRA_DIST

	Frediano Ziglio (1):
	      common: Fix typo in comment

	build-sys: Add missing header files to _SOURCES
	2 newly-added header files were not added to _SOURCES, breaking make
	distcheck.

	Acked-by: Frediano Ziglio <fziglio@redhat.com>

2015-09-01  Marc-André Lureau  <marcandre.lureau@gmail.com>

	Remove useless pack attribute
	Acked-by: Frediano Ziglio <fziglio@redhat.com>
	Acked-by: Jonathon Jongsma <jjongsma@redhat.com>

	server: remove srand(time(NULL))
	This is clearly not a library responsability.

	Acked-by: Frediano Ziglio <fziglio@redhat.com>
	Acked-by: Jonathon Jongsma <jjongsma@redhat.com>

2015-09-01  Alon Levy  <alon@pobox.com>

	server/red_worker: remove redundant spice_warn_if in validate_surface
	Acked-by: Frediano Ziglio <fziglio@redhat.com>
	Acked-by: Jonathon Jongsma <jjongsma@redhat.com>

2015-09-01  Marc-André Lureau  <marcandre.lureau@gmail.com>

	server: remove hardcoded RED_MAX_RENDERERS
	Acked-by: Frediano Ziglio <fziglio@redhat.com>
	Acked-by: Jonathon Jongsma <jjongsma@redhat.com>

2015-08-28  Frediano Ziglio  <fziglio@redhat.com>

	Simplify set_surface_release_info
	Acked-by: Christophe Fergeau <cfergeau@redhat.com>

	replay: fix typo in message
	Acked-by: Christophe Fergeau <cfergeau@redhat.com>

2015-08-26  Frediano Ziglio  <fziglio@redhat.com>

	Avoid core calling spice_server_destroy
	spice_server_destroy calls reds_exit which is called also at exit time
	(is registered with atexit) so avoid to keep dangling pointers.
	Currently this does not happen as spice_server_destroy is not called
	by Qemu.

	prevent integer overflow on 32 bit
	On 32 bit machine timespec->tv_sec (time_t) is 32 bit.
	Also 1000 * 1000 * 1000 is 32 bit.
	The multiplication of 2 32 bit integers gives a 32 bit integer, however
	this can overflow.
	Converting the first factor to 64 bit before the multiplication solves
	the issue.

	remove unused SAME_PIXEL macro

2015-08-26  Christophe Fergeau  <cfergeau@redhat.com>

	build-sys: Remove test_spice_version.h
	This script was used at make distcheck time to verify consistency of the
	version number defined in configure.ac and in spice-server headers.
	Since commit ab12cf414c, these 2 version numbers can no longer be out of
	sync, so we can drop this script.

	server: Readd spice-experimental.h
	Commit 3c6b4e41 removed spice-experimental.h as this header was not
	used, nor supposed to be used. However, QEMU had been including it
	(without using any of its symbols) until commit v2.3.0-rc0~135^2~1

	As this is fairly recent (Nov 2014), building older QEMUs with new
	spice-server releases, or even bisecting QEMU will be broken as they
	will be looking for a no-longer available header.

	This commit readds a spice-experimental.h file, however it only contains
	a #warning indicating this file is deprecated. This means older QEMU
	will build now, but only if they were configured with --disable-werror.

	build-sys: Require a new enough spice-protocol in .pc file
	spice-server headers expose SpiceImageCompression which is only available
	from recent spice-protocol releases.
	This dependency must be expressed in Requires and not Requires.private

2015-08-25  Frediano Ziglio  <fziglio@redhat.com>

	remove wrong statement terminator from preprocessor macro
	Actually not causing problems as when used is always followed by another
	terminator but better to fix the definition.

	Acked-by: Pavel Grunt <pgrunt@redhat.com>

	Use MAX macro to compute the maximum value

	replay: use plain pthread for mutex/condition
	Mutex/conditional require Glib 2.32 which is not available in RHEL6.
	Use plain pthread to make this module compatible with RHEL6.

	Acked-by: Fabiano Fidencio <ffidenci@redhat.com>

	replay: fix check for QXL_SURF_FLAG_KEEP_DATA flag
	A logical and (&&) was used instead of a bit one (&).
	Was working just as is the only flag defined.

	Acked-by: Fabiano Fidencio <ffidenci@redhat.com>

2015-08-24  Frediano Ziglio  <fziglio@redhat.com>

	worker: remove unused members from Drawable
	Acked-by: Christophe Fergeau <cfergeau@redhat.com>

2015-08-22  Alon Levy  <alon@pobox.com>

	server/tests/spice-server-replay: introduce
	usage: spice-server-replay -p <port> -c <client command line> <cmdfile>

	will run the commands from cmdfile ignoring timestamps, right after a
	connection is established from the client, and will SIGINT the client
	on end of cmdfile, and exit itself after waiting for the client.

	spicy-stats from spice-gtk is useful for testing, it prints the summary
	of the traffic on each channel.

	You can also run with no client by doing:
	spice-server-replay <cmdfile>

	For example, the 300 MB file (compressed to 4 MB with xz -9) available
	at [1] produces the following output:

	spicy-stats total bytes read:
	total bytes read:
	inputs: 214
	display: 1968983
	cursor: 390
	main: 256373

	You could run it directly like so:
	curl http://annarchy.freedesktop.org/~alon/win7_boot_shutdown.cmd.xz | \
	  xzcat | server/tests/spice-server-replay -p 12345 -c `which spicy-stats` -

	Known Problems:
	* Implementation is wrong. Should do a single device->host conversion
	 (i.e. get_virt), and then marshall/demarshall that (i.e. RedDrawable).
	* segfault on file read done resulting in the above spicy-stats not
	 being reproducable (well, up to 1% yes).

	[1] http://annarchy.freedesktop.org/~alon/win7_boot_shutdown.cmd.xz

	Now based on glib including using an asyncqueue for reading the playback
	file, and proper freeing of the allocated commands, with --slow,
	--compression and a progress timer, and doesn't use more then nsurfaces.

2015-08-21  Alon Levy  <alon@pobox.com>

	server/red_worker: record to SPICE_WORKER_RECORD_FILENAME
	if the environment variable in the title is set and can be
	opened for writing a log of all display commands (no cursor
	commands yet) and any QXLWorker calls (particularily primary
	create and destroy) will be logged to that file, and possible
	to replay using the replay utility introduced later.

	For an example file (4 MB download, 300 MB after unpack with xz,
	these 300 MB are themselves reduced from 1.2GB using zlib compression
	for any chunk):

	(old file without a header)
	http://annarchy.freedesktop.org/~alon/win7_boot_shutdown.cmd.xz

	server/red_{record, replay}.[ch]: introduce
	Currently hand crafted with some sed scripts and alot of vim macros from
	red_parse_qxl after considering the logger in qemu/hw/qxl-logger.c and seeing
	it was incomplete. The only problem with logging from the server and
	not from qemu is that it requires coordinated shutdown to avoid half a message.

	Should be automatically generated from a declarative syntax, i.e. qxl.proto.

	Note: zlib compression is introduced in a disabled state, see ZLIB
	define

	Now with a simple versioned header and generated ids by the server
	instead of based on the recorded file, and doesn't use more then 1024
	surfaces (configurable).

2015-08-20  Alon Levy  <alon@pobox.com>

	server/dispatcher: add extra_dispatcher, hack for red_record

2015-08-20  Marc-André Lureau  <marcandre.lureau@redhat.com>

	tests: use glib main loop

2015-08-20  Alon Levy  <alon@pobox.com>

	Remove use of INLINE
	It's #define'd to 'inline', and only used in the GLZ encoder.

2015-08-20  Christophe Fergeau  <cfergeau@redhat.com>

	build-sys: Remove spice-protocol submodule
	It's seeing regular releases and is API stable, so we don't need to
	bundle it with spice-server

2015-08-20  Victor Toso  <victortoso@redhat.com>

	mjpeg and jpeg encoder: fix alignment warnings
	As the input line could be uint8_t*, uint16_t* or uint32_t*, changing
	the default from uint8_t* to void* seems the correct choice to deal with
	upcasting warnings.

	Regarding chunks->data allocation, I quote Frediano explantion:
	"Lines came from spice_bitmap_get_line. This function assume that bitmap
	data is split among chunks each containing some lines
	(always full lines). If chunk->data is allocated using malloc or similar
	SHOULD (not 100% sure) be 4 bytes aligned so in our cases
	(8, 16, 24 or 32 bit images) should be aligned enough.

	All the casts unfortunately came from the fact we compute based on
	pixel bytes to make it generic so we use uint8_t*."

	and

	"Looking at code looks like these chunks came from the virtual machine.
	So the question is... why should the virtual machine give use some
	not-pixel align data?
	I would put a large comment to state that we assume VM send aligned
	data, would be stupid for the VM to not align it!"

	clang output:
	jpeg_encoder.c:109:26: error: cast from 'uint8_t *'
	(aka 'unsigned char *') to 'uint16_t *' (aka 'unsigned short *')
	increases required alignment from 1 to 2 [-Werror,-Wcast-align]
	  uint16_t *src_line = (uint16_t *)line;
	                       ^~~~~~~~~~~~~~~~

	jpeg_encoder.c:144:26: error: cast from 'uint8_t *'
	(aka 'unsigned char *') to 'uint32_t *' (aka 'unsigned int *')
	increases required alignment from 1 to 4 [-Werror,-Wcast-align]
	  uint32_t *src_line = (uint32_t *)line;
	                       ^~~~~~~~~~~~~~~~

	mjpeg_encoder.c:260:23: error: cast from 'uint8_t *'
	(aka 'unsigned char *') to 'uint16_t *' (aka 'unsigned short *')
	increases required alignment from 1 to 2 [-Werror,-Wcast-align]
	  uint16_t pixel = *(uint16_t *)src;
	                    ^~~~~~~~~~~~~~~

	glz: WindowImageSegment lines lines_end as void*
	Instead of using uint8_t* which can cause several warnings on casting as
	the example below:

	./glz_encode_tmpl.c:321:29: error: cast from 'uint8_t *'
	(aka 'unsigned char *') to 'rgb16_pixel_t *' (aka 'unsigned short *')
	increases required alignment from 1 to 2 [-Werror,-Wcast-align]
	 ref_limit = (PIXEL *)(seg->lines_end);
	              ^~~~~~~~~~~~~~~~~~~~~~~~~

	migration_protocol: use SPICE_MAGIC_CONST
	spice-protocol has a new define to create the magic constants, let's use
	that.

2015-08-12  Victor Toso  <victortoso@redhat.com>

	red_parse_qxl: Do not compute abs unsigned int
	SpiceBitmap's stride is uint32_t.

	from clang:
	red_parse_qxl.c:452:41: error: taking the absolute value of unsigned
	type 'uint32_t' (aka 'unsigned int') has no effect

	bitmap_size = red->u.bitmap.y * abs(red->u.bitmap.stride);
	                                ^

2015-08-12  Alon Levy  <alon@pobox.com>

	server/inputs_channel: Cope with NULL keyboard in release_keys()
	This fixes a test_display_no_ssl segfault on client disconnect when
	the keyboard was never initialized.

2015-08-11  Victor Toso  <victortoso@redhat.com>

	red_parse_qxl: remove unused variable

2015-08-11  Jonathon Jongsma  <jjongsma@redhat.com>

	Remove unused struct RedsOutItem

	RedChannel: remove unused BufDescriptor struct

2015-08-11  Christophe Fergeau  <cfergeau@redhat.com>

	Remove unused snd_get_playback_compression() method

	Fix typo in comment in char_device.h

2015-08-11  Jonathon Jongsma  <jjongsma@redhat.com>

	Fix typo in comments

	Move RedsMigSpice to main-channel.h
	This is the place that needs the complete type definition. If it is
	defined in reds.h, it can create circular references.

	Cleanup: move static function declarations out of header
	It doesn't make much sense to have static function declarations in a
	header, even a private header. So move them down into the source file.

2015-08-11  Marc-André Lureau  <marcandre.lureau@gmail.com>

	worker: remove unused preload_group_id

	channel: minor simplification

	server: remove unused CursorData

	server: use more const CoreInterface

	worker: move red_init_*() functions
	There is a red_init() methods, we can group all the red_init_*() calls
	in it rather than calling red_init() followed by all these calls in our
	main function.

2015-08-04  Uri Lublin  <uril@redhat.com>

	spice-common: codegen: ptypes.py: keep attribute names in sets
	This fixes the build on RHEL-6

2015-07-29  Christophe Fergeau  <cfergeau@redhat.com>

	Adjust to new SpiceImageCompress name
	This has been renamed to SpiceImageCompression in order to avoid clashes
	with older spice-server in the SPICE_IMAGE_COMPRESS_ namespace. This
	commit is a straight rename of SpiceImageCompress to
	SpiceImageCompression and SPICE_IMAGE_COMPRESS_ to
	SPICE_IMAGE_COMPRESSION_

2015-07-28  Jeremy White  <jwhite@codeweavers.com>

	Add libraries such as -lm and -lpthread to the tests build line.
	This prevents a compile error on Debian Jessie, from git, such as this:
	/usr/bin/ld: test_playback.o: undefined reference to symbol 'sin@@GLIBC_2.2.5'
	//lib/x86_64-linux-gnu/libm.so.6: error adding symbols: DSO missing from command line

	This is fairly subtle, and Debian specific.  It only happens when you use
	autoreconf to generate a new libtool script.  Debian patches that script
	to require an explicit setting to link with all dependent libraries.

	It should be harmless on other distros, and it does save us Debian guys some
	hassle.

2015-07-20  Frediano Ziglio  <fziglio@redhat.com>

	reds: Assure we don't have stale statistic files before trying to create a new one
	If a previous Qemu executable is not able to delete the statistic file
	on the next creation with same name (statitics file are based on pid
	numbers so if pid get reused for another Qemu process you get the same
	name) it fails as you can't open a file with 0444 permissions (these
	are the permission used to create these files).
	This patch assure there are no stale file trying to remove it before the
	creation of the new one. As file is based on pid and name used for spice
	you are not deleting another file.

	Fixes: rhbz#1177326

2015-07-20  Francois Gouget  <fgouget@codeweavers.com>

	server: spice_debug() messages don't need a trailing '\n'.

	server: Weakly try to get a better latency value for the bandwidth test.
	NET_TEST_WARMUP_BYTES is 0 so the warmup ping is the same as the one we
	use to measure the latency. Even if it was not, the actual latency would
	be the MIN() of both anyway so we might as well use both roundtrip times
	to ward off latency jitter a bit.

	server: Don't reset the latency before showing it in the invalid net test error message.

2015-07-13  Pavel Grunt  <pgrunt@redhat.com>

	Use desired image compression for the first image
	red_marshall_image() allows to use other than QUIC compression only
	when auto_lz or auto_glz image compression is set. Other images don't
	have the problem because they are compressed using red_compress_image()

2015-06-30  Javier Celaya  <javier.celaya@flexvm.es>

	Handle preferred image compression messages

	Use image compress constants from spice-protocol

2015-06-29  Francois Gouget  <fgouget@codeweavers.com>

	server: Remove the rate_control_is_active field from MJpegEncoder.
	It is redundant with the corresponding callbacks.

	server: Fix an incorrect time calculation.

	HAVE_CLOCK_GETTIME is not used so remove it.

2015-06-29  Sandy Stutsman  <sstutsma@redhat.com>

	Lock the pixmap image cache for the entire fill_bits call
	Locking the individual calls that access the pixmap cache in fill_bits is
	not adequately thread safe.  Often a windows guest with multiple monitors
	will be sending the same image via different threads.  Both threads can
	be in fill_bits at the same time making changes to the cache for the same
	image.  This can result in images being deleted before all the client
	channels are finished with them or with the same image being send multiple
	times.  Here's what can happen with out the lock in fill_bits

	On the server in red_worker.c:fill_bits
	 Thread 1 calls pixmap_cache_hit for Image A and finds it isn't in cache
	 Thread 2 calls pixmap_cache_hit for Image A and finds it isn't in cache

	 Thread 1 adds Image 1 to pixmap_cache (1x)
	 Thread 2 adds Image 1 to pixmap_cache (2x)

	On the client
	 Channel 1 adds Image A to image_cache (1x)
	 Channel 2 replaces Image A in image_cache (1x)

	On server
	 Thread 1 sends Image A rendering commands
	 Thread N removes Image A from pixmap_cache (image remains - 1x)
	 Thread 2 sends Image A rendering commands

	On client
	 Channe1 renders from Image A
	 Channel N removes Image a from image_cache (image is completely removed)
	 Channel2 render command hangs waiting for Image A

2015-06-26  Frediano Ziglio  <fziglio@redhat.com>

	server: allows to set maximum monitors
	spice-server will attempt to limit number of monitors.
	Guest machine can send monitor list it accepts. Limiting the number sent
	by guest will limit the number of monitors client will try to enable.
	The guest usually see client monitors enabled and start using it so
	not seeing client monitor won't try to enable more monitor.
	In this case the additional monitor guest can support will always be
	seen as heads with no attached monitors.
	This allows limiting monitors number without changing guest drivers.

2015-06-26  Christophe Fergeau  <cfergeau@redhat.com>

	build-sys: Fix build with automake < 1.13
	AC_CONFIG_MACRO_DIRS is not available with older automake versions,
	which causes autogen.sh failures on RHEL6. m4_include() can be used
	instead.

2015-06-22  Francois Gouget  <fgouget@codeweavers.com>

	mjpeg: Convert rate control checks to asserts in encoder
	The checks would lead the reader to think these functions can be called
	when bit rate control is off when in fact they are only called when it
	is active.

	server: Refresh the input fps every 5 second, without a timer.

2015-06-22  Christophe Fergeau  <cfergeau@redhat.com>

	build-sys: Use spice-common m4 macro for lz4
	This will allow to share this detection code with spice-gtk.

	build-sys: Use spice-common m4 macro for opengl
	This factorizes a bit of configure.ac m4 code.

	build-sys: Use spice-common m4 macro for smartcard
	Besides the code factorization, this will allow smartcard support to be
	automatically enabled if libcacard is present and --disable-smartcard is
	not used.

2015-06-17  Marc-André Lureau  <marcandre.lureau@gmail.com>

	reds: increase listening socket backlog
	With a TCP socket, the backlog doesn't seem to matter much,
	perhaps because of latency or underlying protocol behaviour. However,
	on UNIX socket, it is fairly easy to reach the backlog limit and the
	client will get an EAGAIN error (but not ECONNREFUSED as stated in
	listen(7)) that is not easy to deal with: attempting to reconnect in a
	loop might busy-loop forever as there are no guarantee the server will
	accept new connections, so it will be inherently racy.

	Typically, Spice server can easily have up to 15 concurrent incoming
	connections that are established during initialization of the session.
	To improve the situation, raise the backlog limit to the default maximum
	system value, which is 128 on Linux.

2015-06-16  Cédric Bosdonnat  <cbosdonnat@suse.com>

	Add password length check
	Don't allow setting a too long password.

2015-06-16  Frediano Ziglio  <fziglio@redhat.com>

	Use spice_malloc instead of malloc
	Do not just check and give warning before crashing the program
	accessing a NULL pointer but use spice_malloc which exits with a
	proper message.

2015-06-15  Jonathon Jongsma  <jjongsma@redhat.com>

	Remove duplicate streaming enumeration
	There is already a enumeration in a public header that defines the
	different streaming options, so there's no need to duplicate that
	enumeration internally. Just use the public enum values.

	Use AS_HELP_STRING for configure options

2015-06-11  Frediano Ziglio  <fziglio@redhat.com>

	Fix typo in comment

	Use MIN macro to compute a minimum

2015-06-11  Javier Celaya  <javier.celaya@flexvm.es>

	LZ4: warn if trying to set lz4 but not supported

2015-06-09  Francois Gouget  <fgouget@codeweavers.com>

	server: Remove an unused structure.

2015-06-04  Marc-André Lureau  <marcandre.lureau@gmail.com>

	sound: do not modify client state on migration
	During migration, a volume jump is observed by the client. This is due
	to qemu setting up destination server with default sound state, and the
	server sending it after the client is connected. The volume is later
	restored after migration is finished so there is no need to send this
	default state values on connection.

	Tested with both AC97 & HDA devices.

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

2015-04-23  Christophe Fergeau  <cfergeau@redhat.com>

	build-sys: Pass --enable-python-checks when running autogen.sh
	This will tell spice-common configure.ac to test for the availability of
	python-six when building from git.

	Update spice-common submodule
	This fixes a few issues with older python-six versions:

	Christophe Fergeau (2):
	      configure.ac: Check for needed python modules for git builds
	      codegen: Use six.PY3 rather than six.PY2

2015-04-10  Christophe Fergeau  <cfergeau@redhat.com>

	build-sys: Replace cpu detection error with warning
	configure.ac currently errors out when trying to build on
	non-x86/non-ARM CPUs. Since the previous commits improved
	big endian support a lot, this commit replaces the error
	with a warning at configure time to make testing on big
	endian platforms easier.

	build-sys: Remove unused 'X86_64' conditional
	X86_64 was defined as an AM_CONDITIONAL, but then nothing was using it.
	This commit gets rid of it.

	ppc: Fix glz magic endianess
	This is a modified version of a patch initially by Erlon R. Cruz
	<erlon.cruz@br.flextronics.com>

	ppc: Fixing endianness for channel messages
	This is a modified version of a patch initially from
	Erlon R. Cruz <erlon.cruz@br.flextronics.com>

	ppc: Update spice-common for endianness-related fixes
	Alexander Wauck (1):
	      Make spice_codegen.py work on both Python 2 and 3

	Christophe Fergeau (17):
	      Remove unused header file
	      build-sys: Remove unused X check
	      build-sys: Remove unused win32 check
	      build-sys: Remove unused WITH_SMARTCARD conditional
	      build-sys: Small cleanup of AM_CPPFLAGS
	      build-sys: Add fallback for AS_VAR_APPEND
	      build-sys: Move posix checks to a separate m4 macro
	      build-sys: Move smartcard check to m4 macro
	      build-sys: Move celt check to m4 macro
	      build-sys: Move opus check to m4 macro
	      build-sys: Move opengl check to m4 macro
	      build-sys: Move pixman check to m4 macro
	      Remove unused 'invers' arg from canvas_get_*
	      Remove redundant #if defined(SW_CANVAS_CACHE) ||
	defined(SW_CANVAS_IMAGE_CACHE)
	      Remove another redundant (SW_CANVAS_CACHE) ||
	(SW_CANVAS_IMAGE_CACHE) #ifdef
	      Get rid of SW_CANVAS_IMAGE_CACHE
	      ssl_verify: Move wincrypt.h related #ifdef closer to the include

	Erlon Cruz (2):
	      ppc: Fix lz magic endianness
	      ppc: build-sys: Add big-endian support

	Fabiano Fidêncio (1):
	      Fix typo in pixman_image_get_stride() function

	Javier Celaya (6):
	      LZ4: Fix output buffer size
	      LZ4: Adjust reading the top_down flag
	      LZ4: Decode the image format from the stream
	      LZ4: Fix the row alignment when it is not on a 32bit boundary
	      LZ4: Add support for 24bit pixman surfaces
	      LZ4: Do not include arpa/inet.h in Windows builds

	Victor Toso (1):
	      common: fix build with mingw

	ppc: Fix endianness handling in initial SPICE connection
	This commit fixes enough endianness issues that it's possible to
	connect to a spice-server/qemu running on a big-endian box with a client
	running on a little-endian machine.

	I haven't tested more than getting to the bios/bootloader and typing a
	bit on the keyboard as I did not manage to boot a distro afterwards :(

	This is based on patches send by Erlon R. Cruz
	<erlon.cruz@br.flextronics.com>

2015-03-15  Uri Lublin  <uril@redhat.com>

	m4: WARN FLAGS: Drop -Wenum-compare
	My RHEL-6 gcc (4.4.7) complains a lot about it:
	   cc1: warning: command line option "-Wenum-compare" is
	   valid for C++/ObjC++ but not for C

	For older gcc version (e.g. 4.4.7), man gcc says
	-Wenum-compare is "C++ and Objective-C++ only".

	For newer gcc (e.g. 4.9.2), man gcc says
	"In C this warning is enabled by -Wall."

2015-02-25  Fabiano Fidêncio  <fidencio@redhat.com>

	Do not compress bitmaps on UNIX socket
	On UNIX socket do not perform unnecessary image compression

2015-02-24  Fabiano Fidêncio  <fidencio@redhat.com>

	tests: Fix build on Hurd
	As PATH_MAX is not defined on Hurd, let's check for it and define
	whenever it is necessary.

	https://bugs.freedesktop.org/show_bug.cgi?id=74313

2015-02-08  Uri Lublin  <uril@redhat.com>

	char-device: spice_char_device_write_to_device: protect against recursion
	This fixes Spice's smart card support and is related to
	commit 697f3214fd16adcd524456003619f7f44ddd031b.

	Reported-by: Swapna Krishnan <skrishna@redhat.com>

	Recursion is now possible starting with spice_char_device_write_to_device
	going through spice_char_device_wakeup (after going through qemu),
	calling again to spice_char_device_write_to_device.

	The protecting code is the same as the one protecting the read path.

	This function call loop makes the program to abort with the following messages:

	  usb-ccid: chardev: unexpected message of type 3000000
	  qemu: qemu_mutex_lock: Resource deadlock avoided

	Backtrace:

	(gdb) bt
	* #0  0x00007ffff3fc78c7 in raise () from /lib64/libc.so.6
	* #1  0x00007ffff3fc952a in abort () from /lib64/libc.so.6
	* #2  0x0000555555969a95 in error_exit (err=35,
	*     msg=0x5555559f8c90 <__func__.5119> "qemu_mutex_lock")
	*     at util/qemu-thread-posix.c:48
	* #3  0x0000555555969b82 in qemu_mutex_lock (mutex=0x5555562c4d60)
	*     at util/qemu-thread-posix.c:79
	* #4  0x0000555555714771 in qemu_chr_fe_write (s=0x5555562c4d60,
	*     buf=0x7fffffffd2a0 "", len=12) at qemu-char.c:219
	* #5  0x000055555586be49 in ccid_card_vscard_send_msg (s=0x5555565c5f80,
	*     type=VSC_Error, reader_id=0, payload=0x7fffffffd2e0 "", length=4)
	*     at hw/usb/ccid-card-passthru.c:75
	* #6  0x000055555586bf00 in ccid_card_vscard_send_error (s=0x5555565c5f80,
	*     reader_id=0, code=VSC_GENERAL_ERROR) at
	*     hw/usb/ccid-card-passthru.c:91
	* #7  0x000055555586c559 in ccid_card_vscard_handle_message (
	*     card=0x5555565c5f80, scr_msg_header=0x5555565c6008)
	*     at hw/usb/ccid-card-passthru.c:254
	* #8  0x000055555586c72f in ccid_card_vscard_read (opaque=0x5555565c5f80,
	*     buf=0x5555565034b0 "", size=12) at hw/usb/ccid-card-passthru.c:289
	* #9  0x00005555557149db in qemu_chr_be_write (s=0x5555562c4d60,
	*     buf=0x5555565034b0 "", len=12) at qemu-char.c:305
	* #10 0x000055555571cde5 in vmc_write (sin=0x5555562c4e78,
	*     buf=0x5555565034b0 "", len=12) at spice-qemu-char.c:41
	* #11 0x00007ffff4fa86aa in spice_char_device_write_to_device (
	*     dev=0x55555657f210) at char_device.c:462
	* #12 0x00007ffff4fa9b48 in spice_char_device_wakeup (dev=0x55555657f210)
	*     at char_device.c:862
	* #13 0x00007ffff4ff7658 in spice_server_char_device_wakeup
	*     (sin=0x5555562c4e78) at reds.c:2955
	* #14 0x000055555571d1d2 in spice_chr_write (chr=0x5555562c4d60,
	*     buf=0x7fffffffd560 "", len=12) at spice-qemu-char.c:189
	* #15 0x0000555555714789 in qemu_chr_fe_write (s=0x5555562c4d60,
	*     buf=0x7fffffffd560 "", len=12) at qemu-char.c:220
	* #16 0x000055555586be49 in ccid_card_vscard_send_msg (s=0x5555565c5f80,
	*     type=VSC_Error, reader_id=0, payload=0x7fffffffd5a0 "", length=4)
	*     at hw/usb/ccid-card-passthru.c:75
	* #17 0x000055555586bf00 in ccid_card_vscard_send_error
	* (s=0x5555565c5f80,
	*     reader_id=0, code=VSC_SUCCESS) at hw/usb/ccid-card-passthru.c:91
	* #18 0x000055555586c4fc in ccid_card_vscard_handle_message (
	*     card=0x5555565c5f80, scr_msg_header=0x5555565c6008)
	*     at hw/usb/ccid-card-passthru.c:242
	* #19 0x000055555586c72f in ccid_card_vscard_read (opaque=0x5555565c5f80,
	*     buf=0x5555565034b0 "", size=12) at hw/usb/ccid-card-passthru.c:289
	* #20 0x00005555557149db in qemu_chr_be_write (s=0x5555562c4d60,
	*     buf=0x5555565034b0 "", len=12) at qemu-char.c:305
	* #21 0x000055555571cde5 in vmc_write (sin=0x5555562c4e78,
	*     buf=0x5555565034b0 "", len=12) at spice-qemu-char.c:41
	* #22 0x00007ffff4fa86aa in spice_char_device_write_to_device (
	*     dev=0x55555657f210) at char_device.c:462
	* #23 0x00007ffff4fa8d37 in spice_char_device_write_buffer_add (
	*     dev=0x55555657f210, write_buf=0x555556501f70) at char_device.c:597
	* #24 0x00007ffff501142d in smartcard_channel_write_to_reader (
	*     write_buf=0x555556501f70) at smartcard.c:669
	* #25 0x00007ffff501034c in smartcard_char_device_notify_reader_add (
	*     st=0x55555657ef00) at smartcard.c:335
	* #26 0x00007ffff50112b3 in smartcard_add_reader (scc=0x555556493ee0,
	*     name=0x5555565023cc "E-Gate 0 0") at smartcard.c:642
	* #27 0x00007ffff50118d2 in smartcard_channel_handle_message (
	*     rcc=0x555556493ee0, type=101, size=22, msg=0x5555565023c0 "\003")
	*     at smartcard.c:757
	* #28 0x00007ffff4fbc168 in red_peer_handle_incoming
	*     (stream=0x555556588250, handler=0x555556497ff0) at red_channel.c:308
	* #29 0x00007ffff4fbc231 in red_channel_client_receive
	*     (rcc=0x555556493ee0) at red_channel.c:326
	* #30 0x00007ffff4fc0019 in red_channel_client_event (fd=59, event=1,
	*     data=0x555556493ee0) at red_channel.c:1574
	* #31 0x00005555558b6076 in watch_read (opaque=0x5555565002f0)
	*     at ui/spice-core.c:101
	* #32 0x00005555558e8d48 in qemu_iohandler_poll (pollfds=0x5555562b7630,
	*     ret=2) at iohandler.c:143
	* #33 0x00005555558e89a4 in main_loop_wait (nonblocking=0) at
	* main-loop.c:495
	* #34 0x00005555557219b0 in main_loop () at vl.c:1794
	* #35 0x0000555555729257 in main (argc=40, argv=0x7fffffffddc8,
	*     envp=0x7fffffffdf10) at vl.c:4350

2015-02-03  Javier Celaya  <javier.celaya@flexvm.es>

	LZ4: Send the original format with the compressed data

	LZ4: Do not reverse bottom-up images
	Reversing the bottom-up images in the server is not needed since Pixman,
	in the client, is able to deal with them. As a result, the previous code
	was more complex and wrong. This commit fixes and cleans it.

	LZ4: Fix encoder output size

	LZ4: Limit LZ4 to RGB formats
	Currently, the LZ4 encoding only (partially) supports RGB images, so
	we must check the image format before using it. In the future, indexed
	formats may be implemented too, but their use is usually very small
	compared to RGB.

2015-01-15  Marc-André Lureau  <marcandre.lureau@gmail.com>

	Remove spice-experimental
	Remove unneded symbols that nobody should be using anyway.
	ABI is modified with this patch, but the library version is not bumped.

	Do not perform network tests on UNIX socket
	By default, stream latency is 0 and bandwidth is infinite. On UNIX
	socket do not perform unnecessary testing and keep those values.

	reds-stream: add reds_stream_get_family() function

	reds: add Unix socket support
	Learn to listen on a Unix address. In this case, the connection is plain
	only (non-tls).

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

	inputs: Remove unneeded variable
	inputs_channel_handle_parsed() is casting its void * argument to
	a uint8_t * buf before recasting this 'buf' variable to different
	other types. This intermediate 'buf' variable is not needed, especially
	as we can then benefit from implicit casts from void * to the type we
	need.

	inputs: Split overlong line
	Cosmetic change.

	inputs: Fix key_up/key_down mismatch
	When handling a KEY_UP message, the various variables were called
	'key_down', and they were called 'key_up' when handling KEY_DOWN
	messages. This commit makes the naming consistent.

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

	Remove unused SPICE_CANVAS_INTERNAL

	client: Remove client code
	The client has been superseded by virt-viewer (
	http://virt-manager.org/download/sources/virt-viewer/ ) and is no longer
	being maintained.

2014-12-02  Javier Celaya  <javier.celaya@flexvm.es>

	Add LZ4 compression support.
	- Add lz4 encoder to compress an image of type LZ4 (see spice_common).
	- Add code in red_worker to use LZ4 when it is enabled, and the client
	  supports it through its display capability, or fallback to LZ.
	- Add enable_lz4 switch in the configure script. Show LZ4 support at the
	  end.

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

	configure.ac: Never add xinerama to SPICE_REQUIRES
	SPICE_REQUIRES is only used to generate the Requires.private line of
	spice-server.pc. The server code is not using xinerama, so we don't need
	to list xinerama in Requires.private.

	configure.ac: Only check for xinerama for client builds
	Xinerama support is only used for the X11 client, but is currently
	being checked even for server only builds. This commit ensures Xinerama
	is not checked for/added to spice-server.pc when not building the
	client.

2014-11-29  Marc-André Lureau  <marcandre.lureau@gmail.com>

	build-sys: fix out-of-tree build of tests
	Fixes the following build error:
	In file included from
	/home/elmarco/src/spice-new/src/spice/server/tests/test_display_base.h:4:0,
	                 from
	                 /home/elmarco/src/spice-new/src/spice/server/tests/test_display_no_ssl.c:11:
	                 /home/elmarco/src/spice-new/src/spice/server/spice.h:23:27:
	                 fatal error: spice-version.h: No such file or directory
	                  #include "spice-version.h"
	                                             ^

2014-11-27  Marc-André Lureau  <marcandre.lureau@gmail.com>

	Add explicit spice-core.h include
	Several functions use core interfaces, add and explicit include.

	Move spice_server_get_num_clients() declaration
	This function is not related to migration.

	Rename mm_timer/mm_time
	As suggested by Christophe on the mailing list.

	Remove guest side video time-stamping
	The multimedia time is defined by the server side monotonic time [1],
	but the drawing time-stamp is done in guest side, so it requires
	synchronization between host and guest. This is expensive, when no audio
	is playing, there is a ~30x/sec wakeup to update the qxl device mmtime,
	and it requires marking dirty the rom region.

	Instead, the video timestamping can be done more efficiently on server
	side, without visible drawbacks.

	[1] a better timestamp could be the audio time, since audio players are
	    usually sync with audio time)

	Related to:
	https://bugzilla.redhat.com/show_bug.cgi?id=912763

	build-sys: generate spice-version.h
	Editing the hexadecimal value of spice-version and keeping it in sync
	with actual release is a bit tedious. Let's generate it
	automatically (although handling of bumps will need temporarily static
	versions, when 0.12 -> 1.0 for example)

	Split spice.h
	Make it easier to read the Spice server API.

	spice.h: remove redundant declarations
	Those are already declared in <spice/qxl_dev.h>.

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

	Validate RedDrawable before allocating drawable
	Avoid unnecessary allocation (and possibly leaking) if the RedDrawable
	is not valid.

	Related to: rhbz#1135372

	chardev: remove write polling
	In an effort to reduce the wakeups per second, get rid of the
	"write_to_dev" timer when the implementation supports
	SPICE_CHAR_DEVICE_NOTIFY_WRITABLE.

	When this flag is set, the frontend instance is responsible for calling
	spice_char_device_wakeup() when the device is ready to perform IO.

	Related to:
	https://bugzilla.redhat.com/show_bug.cgi?id=912763

2014-11-24  Christophe Fergeau  <cfergeau@redhat.com>

	Don't set SpiceLinkReply::pub_key if client advertises SASL cap
	If the client advertises the SASL cap, it means it guarantees it will be
	able to use SASL if the server supports, and that it does not need a valid
	SpiceLinkReply::pub_key field when using SASL.

	When the client cap is set, we thus don't need to create a RSA public key
	if SASL is enabled server side.

	The reason for needing client guarantees about not looking at the pub_key
	field is that its presence and size is hardcoded in the protocol, but in
	some hardened setups (using fips mode), generating a RSA 1024 bit key as
	expected is forbidden and fails. With this new capability, the server
	knows the client will be able to handle SASL if needed, and can skip
	the generation of the key altogether. This means that on the setups
	described above, SASL authentication has to be used.

	Introduce red_link_info_test_capability()
	This just hides a bit of pointer arithmetic away from reds_send_link_ack.
	This helper will be used in the next commits.

	Add const to test_capability first argument
	We don't modify the capabilities content, so it can be marked as const.

2014-11-21  Alexander Tsoy  <alexander@tsoy.me>

	configure.ac: use portable shell
	This fixes the following errors when configure run in dash:

	 ./configure: 17366: ./configure: SPICE_NONPKGCONFIG_LIBS+= -pthread -lm -lrt: not found
	 ./configure: 17974: ./configure: SPICE_REQUIRES+= glib-2.0 >= 2.22: not found
	 ./configure: 18069: ./configure: SPICE_REQUIRES+= pixman-1 >= 0.17.7: not found
	 ./configure: 18165: ./configure: SPICE_REQUIRES+= celt051 >= 0.5.1.1: not found
	 ./configure: 18369: ./configure: SPICE_REQUIRES+= openssl: not found
	 ./configure: 18477: ./configure: SPICE_NONPKGCONFIG_LIBS+= : not found
	 ./configure: 18948: ./configure: SPICE_REQUIRES+= xinerama: not found
	 ./configure: 20377: test: no: unexpected operator
	 ./configure: 20409: test: no: unexpected operator
	 ./configure: 23423: test: xno: unexpected operator
	 ./configure: 23443: test: no: unexpected operator

2014-11-17  Christophe Fergeau  <cfergeau@redhat.com>

	manual: Add missing closure of XML tag
	The <model type='qxl'> examples in the reference documentation are
	missing a closing tag.

2014-10-17  Marc-André Lureau  <marcandre.lureau@gmail.com>

	server: fix crash when restarting VM with old client
	The server will reset the vdagent char device when the client does not
	implement SPICE_MAIN_CAP_AGENT_CONNECTED_TOKENS. This will nullify
	dev->sin and the following crash will be reached on restart:

	 #0  0x00007fb05aa264a1 in spice_char_device_write_to_device (dev=dev@entry=0x7fb066ae5d30) at char_device.c:443
	 #1  0x00007fb05aa27137 in spice_char_device_write_to_device (dev=0x7fb066ae5d30) at char_device.c:436
	 #2  spice_char_device_start (dev=0x7fb066ae5d30) at char_device.c:798
	 #3  0x00007fb05aa6a981 in spice_server_vm_start (s=<optimized out>) at reds.c:3795
	 #4  0x00007fb0644b7f89 in qdev_reset_one (dev=<optimized out>, opaque=<optimized out>) at hw/core/qdev.c:241
	 #5  0x00007fb0644b7918 in qbus_walk_children (bus=0x7fb06661e870, pre_devfn=0x0, pre_busfn=0x0,
	     post_devfn=0x7fb0644b7f80 <qdev_reset_one>, post_busfn=0x7fb0644b6350 <qbus_reset_one>, opaque=0x0)
	     at hw/core/qdev.c:422
	 #6  0x00007fb0644b7848 in qdev_walk_children (dev=0x7fb0665f47a0, pre_devfn=0x0, pre_busfn=0x0,
	     post_devfn=0x7fb0644b7f80 <qdev_reset_one>, post_busfn=0x7fb0644b6350 <qbus_reset_one>, opaque=0x0)
	     at hw/core/qdev.c:456
	 #7  0x00007fb0644b7918 in qbus_walk_children (bus=0x7fb06647cde0, pre_devfn=0x0, pre_busfn=0x0,
	     post_devfn=0x7fb0644b7f80 <qdev_reset_one>, post_busfn=0x7fb0644b6350 <qbus_reset_one>, opaque=0x0)
	     at hw/core/qdev.c:422
	 #8  0x00007fb0644399fd in qemu_devices_reset () at vl.c:1830

	After restart, qemu will reset the device instance (sin) when virtio
	port is opened:

	 #0  spice_char_device_state_reset_dev_instance (state=0x7fe4873876d0, sin=sin@entry=0x7fe486fb0c68)
	     at char_device.c:667
	 #1  0x00007fe47b277516 in attach_to_red_agent (sin=0x7fe486fb0c68) at reds.c:2838
	 #2  spice_server_char_device_add_interface (sin=0x7fe486fb0c68, s=0x7fe486fb2e60) at reds.c:2962
	 #3  spice_server_add_interface (s=0x7fe486fb2e60, sin=0x7fe486fb0c68) at reds.c:3104
	 #4  0x00007fe484c69e57 in vmc_register_interface (scd=0x7fe486fb0c60) at spice-qemu-char.c:123
	 #5  0x00007fe484ce96b4 in set_guest_connected (port=<optimized out>, guest_connected=1)
	     at hw/char/virtio-console.c:89
	 #6  0x00007fe484ba70ed in handle_control_message (len=8, buf=0x7fe486fbdf70, vser=0x7fe48739ae98)
	     at /usr/src/debug/qemu-2.1.0/hw/char/virtio-serial-bus.c:382

	Let's ignore the call to spice_char_device_{write,read}_to_device() when
	dev->sin is NULL, similary to other conditions, such as dev->running.

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

2014-10-14  Uri Lublin  <uril@redhat.com>

	migration: Don't assert() if MIGRATE_DATA comes before attaching the agent
	During seamless migration, after switching host, if a client was connected
	during the migration, it will have data to send back to the new
	qemu/spice-server instance. This is handled through MIGRATE_DATA messages.
	SPICE char devices use such MIGRATE_DATA messages to restore their state.

	However, the MIGRATE_DATA message can arrive any time after the new qemu
	instance has started, this can happen before or after the SPICE char
	devices have been created. In order to handle this, if the migrate data
	arrives early, it's stored in reds->agent_state.mig_data, and
	attach_to_red_agent() will restore the agent state as appropriate.

	Unfortunately this does not work as expected, for main
	channel (agent messages).
	If attach_to_red_agent() is called before the MIGRATE_DATA
	message reaches the server, all goes well,
	but if MIGRATE_DATA reaches the server before
	attach_to_red_agent() gets called, then some assert() gets
	triggered in spice_char_device_state_restore():

	((null):32507): Spice-ERROR **: char_device.c:937:spice_char_device_state_restore: assertion `dev->num_clients == 1 && dev->wait_for_migrate_data' failed
	Thread 3 (Thread 0x7f406b543700 (LWP 32543)):
	Thread 2 (Thread 0x7f40697ff700 (LWP 32586)):
	Thread 1 (Thread 0x7f4079b45a40 (LWP 32507)):

	When restoring state, a client must already be added to the
	spice-char-device.
	What happens is that a client is not being added to the char-device
	when when MIGRATE_DATA arrives first, which leaves both
	dev->num_clients and dev->wait_for_migrate_data value at 0.

	This commit changes the logic in spice_server_char_device_add_interface(),
	such that if there is migrate data pending in reds->agent_state.mig_data
	but no client was added to the spice-char-device yet,
	then first the client is added to the device by calling
	spice_char_device_client_add(), and only then the state is restored.

	=== How to Reproduce
	To reproduce, add delays to the migration connection between
	qmeu-kvm on the source host (SRC) and on the destination (DST).

	Specifically I added a man in the middle DLY host between
	migration ports from SRC to DST.

	+-----+    +-----+     +-----+
	| SRC |--> | DLY | --> | DST |
	+-----+    +-----+     +-----+

	DLY listens on port P1 (e.g. 4444) and DST listens on port
	PINCOMING (e.g. 4444, from qemu-kvm '-incoming' command line option)

	Precondition: make sure port P1 on DLY is accessible in iptables.
	Option 1: use ssh tcp port forwarding
	On DLY host run ssh:
	  ssh DLY:P1:DST:PINCOMING DST
	Then use the following migration command (on qemu-kvm monitor):
	  client_migrate_info spice DST PSPICE
	  migrate -d tcp:DLY:P1

	Option 2: Use a simple proxy program that forwards
	packets from SRC to DST while adding some delays.
	The program runs on DLY, listens to port D1, upon
	accept connects to DST:PINCOMING and forward all
	packets from DLY:D1 to DST:PINCOMING.
	Then use the same migrate command as in option 1:
	  client_migrate_info spice DST PSPICE
	  migrate -d tcp:DLY:P1

	=== How to Reproduce Ends

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

	Based-on-a-patch-by: Christophe Fergeau <cfergeau@redhat.com>

2014-10-10  Cole Robinson  <crobinso@redhat.com>

	m4: Update manywarnings from gnulib
	Fixes these noisy errors on Fedora 21:

	gcc: warning: switch '-Wmudflap' is no longer supported

2014-09-18  Christophe Fergeau  <cfergeau@redhat.com>

	Validate surface bounding box before using it
	It's possible for a buggy guest driver to pass invalid bounding box
	dimensions in QXL commands, which would then cause spice-server to
	segfault. This patch checks the size of the bounding box of the QXL
	command right after it has been parsed.

	This fixes rhbz#1135372

	Fix 'abberiviations' typo in comment

	Fix indentation in red_get_opaque_ptr
	This removes one extra space

	server/tests/Makefile.am: White-space cleanup
	Make sure the \ at the end of lines are nicely aligned

2014-09-12  Fabiano Fidêncio  <fidencio@redhat.com>

	Fix -Wunused-function

	Fix -Wmissing-field-initializers

	Fix -Wnonnull

	Fix -Wformat

	Fix -Wswitch

	Fix -Wsign

	Fix -Wunused-value

	Fix -Wunused-parameter

	server: Don't dump the bitmap when the format is invalid
	Caught by covscan:
	spice/server/spice_bitmap_utils.c:54: var_decl: Declaring variable "n_pixel_bits" without initializer.
	spice/server/spice_bitmap_utils.c:106: uninit_use: Using uninitialized value "n_pixel_bits".

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

	clean-up: remove unused function

	build-sys: check for spicy-screenshot

2014-09-08  Marc-André Lureau  <marcandre.lureau@gmail.com>

	reds: lookup corresponding channel id
	In reds_send_link_ack(), lookup the channel with the same id as the link
	message.

	The bug was found during code review a while ago.

	A reproducer bug was later reported:
	https://bugzilla.redhat.com/show_bug.cgi?id=1058625

	dispatcher: lower a monitor-config warning to a debug level
	Some QXLInterface implementations might not have or succeed
	with client_monitors_config(). Thus, lower warning to debug
	level.

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

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

	spice.h: Don't use 48kHz for playback/recording rates
	When adding Opus support, SPICE_INTERFACE_PLAYBACK_FREQ and
	SPICE_INTERFACE_RECORD_FREQ in the public header 'spice.h' were changed
	from 44100 to 48000.
	However, this was not really useful as these constants are not used in
	spice-server, but only by users of spice-server (ie QEMU).
	It turns out changing these values is actually harmful. QEMU uses these
	constants in 2 situations:
	1. when it's a version of QEMU with this commit, but we are compiling
	   against older spice-server headers (before Opus support was added)
	2. when it's a version of QEMU without commit 795ca114d35 which added
	   what is needed for Opus support

	When we are in the second situation, having 48000 in the public header
	will actually cause issues as spice-server will know QEMU does not
	support Opus, so internally spice-server will be using a 44100 rate for
	audio. However, QEMU will be using SPICE_INTERFACE_.*_FREQ and think it
	should use a 48000 rate, which will cause distorsions as experienced in
	bug https://bugzilla.redhat.com/show_bug.cgi?id=1129961

	Reverting these constants back to 44100 will fix audio in the 'new
	spice-server/old QEMU' scenario, and won't cause issues either when both
	support Opus as in this case these constants are not used.

2014-08-07  Marc-André Lureau  <marcandre.lureau@gmail.com>

	Fix crash when clearing surface memory
	The beginning of the surface data needs to be computed correctly if the
	stride is negative, otherwise, it should point already to the beginning
	of the surface data. This bug seems to exists since 4a208b (0.5.2)

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

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

	server: don't assert on invalid client message
	Some users have been reaching this error:
	snd_receive: ASSERT n failed

	A misbehaving client could easily hit that condition by sending too big
	messages. Instead of assert(), replace with a warning. When a message
	too big to fit is received, it will simply disconnect the channel.

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

2014-05-30  Jonathon Jongsma  <jjongsma@redhat.com>

	Fix assert in mjpeg_encoder_adjust_params_to_bit_rate()
	If mjpeg_encoder_reset_quality() is called with the same quality as currently
	set, it will not reset last_enc_size but not reset num_recent_enc_frames,
	violating some assumptions in _adjust_params_to_bit_rate(). To avoid aborting
	the server, simply return early from this function.

	Resolves: rhbz#1086820

2014-05-26  Wang Qiang  <wangqiang.hunan@gmail.com>

	Fix make failed when uncommented COMPRESS_STAT in red_worker.c
	https://bugs.freedesktop.org/show_bug.cgi?id=79246
	As a developer, I maybe want to see the detail compress stat of spice, like this:
	Method   	  count  	orig_size(MB)	enc_size(MB)	enc_time(s)
	QUIC     	     846	       948.02	      147.22	        7.51
	GLZ      	    2895	       594.90	       26.60	        1.33
	ZLIB GLZ 	       0	         0.00	        0.00	        0.00
	LZ       	       1	         3.15	        0.01	        0.00
	JPEG     	       0	         0.00	        0.00	        0.00
	JPEG-RGBA	       0	         0.00	        0.00	        0.00
	----------------------------------------------------------------------------
	Total    	    3742	      1546.07	      173.83	        8.84

	But when I uncommented the COMPRESS_STAT and COMPRESS_DEBUG in red_worker.c and make.
	I got some error(in Bugzilla). This error because of some simple syntax errors.
	Commit this patch to fix this issue.

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.