~serge-hallyn/ubuntu/raring/libvirt/libvirt-hugepages

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
12184
12185
12186
12187
12188
12189
12190
12191
12192
12193
12194
12195
12196
12197
12198
12199
12200
12201
12202
12203
12204
12205
12206
12207
12208
12209
12210
12211
12212
12213
12214
12215
12216
12217
12218
12219
12220
12221
12222
12223
12224
12225
12226
12227
12228
12229
12230
12231
12232
12233
12234
12235
12236
12237
12238
12239
12240
12241
12242
12243
12244
12245
12246
12247
12248
12249
12250
12251
12252
12253
12254
12255
12256
12257
12258
12259
12260
12261
12262
12263
12264
12265
12266
12267
12268
12269
12270
12271
12272
12273
12274
12275
12276
12277
12278
12279
12280
12281
12282
12283
12284
12285
12286
12287
12288
12289
12290
12291
12292
12293
12294
12295
12296
12297
12298
12299
12300
12301
12302
12303
12304
12305
12306
12307
12308
12309
12310
12311
12312
12313
12314
12315
12316
12317
12318
12319
12320
12321
12322
12323
12324
12325
12326
12327
12328
12329
12330
12331
12332
12333
12334
12335
12336
12337
12338
12339
12340
12341
12342
12343
12344
12345
12346
12347
12348
12349
12350
12351
12352
12353
12354
12355
12356
12357
12358
12359
12360
12361
12362
12363
12364
12365
12366
12367
12368
12369
12370
12371
12372
12373
12374
12375
12376
12377
12378
12379
12380
12381
12382
12383
12384
12385
12386
12387
12388
12389
12390
12391
12392
12393
12394
12395
12396
12397
12398
12399
12400
12401
12402
12403
12404
12405
12406
12407
12408
12409
12410
12411
12412
12413
12414
12415
12416
12417
12418
12419
12420
12421
12422
12423
12424
12425
12426
12427
12428
12429
12430
12431
12432
12433
12434
12435
12436
12437
12438
12439
12440
12441
12442
12443
12444
12445
12446
12447
12448
12449
12450
12451
12452
12453
12454
12455
12456
12457
12458
12459
12460
12461
12462
12463
12464
12465
12466
12467
12468
12469
12470
12471
12472
12473
12474
12475
12476
12477
12478
12479
12480
12481
12482
12483
12484
12485
12486
12487
12488
12489
12490
12491
12492
12493
12494
12495
12496
12497
12498
12499
12500
12501
12502
12503
12504
12505
12506
12507
12508
12509
12510
12511
12512
12513
12514
12515
12516
12517
12518
12519
12520
12521
12522
12523
12524
12525
12526
12527
12528
12529
12530
12531
12532
12533
12534
12535
12536
12537
12538
12539
12540
12541
12542
12543
12544
12545
12546
12547
12548
12549
12550
12551
12552
12553
12554
12555
12556
12557
12558
12559
12560
12561
12562
12563
12564
12565
12566
12567
12568
12569
12570
12571
12572
12573
12574
12575
12576
12577
12578
12579
12580
12581
12582
12583
12584
12585
12586
12587
12588
12589
12590
12591
12592
12593
12594
12595
12596
12597
12598
12599
12600
12601
12602
12603
12604
12605
12606
12607
12608
12609
12610
12611
12612
12613
12614
12615
12616
12617
12618
12619
12620
12621
12622
12623
12624
12625
12626
12627
12628
12629
12630
12631
12632
12633
12634
12635
12636
12637
12638
12639
12640
12641
12642
12643
12644
12645
12646
12647
12648
12649
12650
12651
12652
12653
12654
12655
12656
12657
12658
12659
12660
12661
12662
12663
12664
12665
12666
12667
12668
12669
12670
12671
12672
12673
12674
12675
12676
12677
12678
12679
12680
12681
12682
12683
12684
12685
12686
12687
12688
12689
12690
12691
12692
12693
12694
12695
12696
12697
12698
12699
12700
12701
12702
12703
12704
12705
12706
12707
12708
12709
12710
12711
12712
12713
12714
12715
12716
12717
12718
12719
12720
12721
12722
12723
12724
12725
12726
12727
12728
12729
12730
12731
12732
12733
12734
12735
12736
12737
12738
12739
12740
12741
12742
12743
12744
12745
12746
12747
12748
12749
12750
12751
12752
12753
12754
12755
12756
12757
12758
12759
12760
12761
12762
12763
12764
12765
12766
12767
12768
12769
12770
12771
12772
12773
12774
12775
12776
12777
12778
12779
12780
12781
12782
12783
12784
12785
12786
12787
12788
12789
12790
12791
12792
12793
12794
12795
12796
12797
12798
12799
12800
12801
12802
12803
12804
12805
12806
12807
12808
12809
12810
12811
12812
12813
12814
12815
12816
12817
12818
12819
12820
12821
12822
12823
12824
12825
12826
12827
12828
12829
12830
12831
12832
12833
12834
12835
12836
12837
12838
12839
12840
12841
12842
12843
12844
12845
12846
12847
12848
12849
12850
12851
12852
12853
12854
12855
12856
12857
12858
12859
12860
12861
12862
12863
12864
12865
12866
12867
12868
12869
12870
12871
12872
12873
12874
12875
12876
12877
12878
12879
12880
12881
12882
12883
12884
12885
12886
12887
12888
12889
12890
12891
12892
12893
12894
12895
12896
12897
12898
12899
12900
12901
12902
12903
12904
12905
12906
12907
12908
12909
12910
12911
12912
12913
12914
12915
12916
12917
12918
12919
12920
12921
12922
12923
12924
12925
12926
12927
12928
12929
12930
12931
12932
12933
12934
12935
12936
12937
12938
12939
12940
12941
12942
12943
12944
12945
12946
12947
12948
12949
12950
12951
12952
12953
12954
12955
12956
12957
12958
12959
12960
12961
12962
12963
12964
12965
12966
12967
12968
12969
12970
12971
12972
12973
12974
12975
12976
12977
12978
12979
12980
12981
12982
12983
12984
12985
12986
12987
12988
12989
12990
12991
12992
12993
12994
12995
12996
12997
12998
12999
13000
13001
13002
13003
13004
13005
13006
13007
13008
13009
13010
13011
13012
13013
13014
13015
13016
13017
13018
13019
13020
13021
13022
13023
13024
13025
13026
13027
13028
13029
13030
13031
13032
13033
13034
13035
13036
13037
13038
13039
13040
13041
13042
13043
13044
13045
13046
13047
13048
13049
13050
13051
13052
13053
13054
13055
13056
13057
13058
13059
13060
13061
13062
13063
13064
13065
13066
13067
13068
13069
13070
13071
13072
13073
13074
13075
13076
13077
13078
13079
13080
13081
13082
13083
13084
13085
13086
13087
13088
13089
13090
13091
13092
13093
13094
13095
13096
13097
13098
13099
13100
13101
13102
13103
13104
13105
13106
13107
13108
13109
13110
13111
13112
13113
13114
13115
13116
13117
13118
13119
13120
13121
13122
13123
13124
13125
13126
13127
13128
13129
13130
13131
13132
13133
13134
13135
13136
13137
13138
13139
13140
13141
13142
13143
13144
13145
13146
13147
13148
13149
13150
13151
13152
13153
13154
13155
13156
13157
13158
13159
13160
13161
13162
13163
13164
13165
13166
13167
13168
13169
13170
13171
13172
13173
13174
13175
13176
13177
13178
13179
13180
13181
13182
13183
13184
13185
13186
13187
13188
13189
13190
13191
13192
13193
13194
13195
13196
13197
13198
13199
13200
13201
13202
13203
13204
13205
13206
13207
13208
13209
13210
13211
13212
13213
13214
13215
13216
13217
13218
13219
13220
13221
13222
13223
13224
13225
13226
13227
13228
13229
13230
13231
13232
13233
13234
13235
13236
13237
13238
13239
13240
13241
13242
13243
13244
13245
13246
13247
13248
13249
13250
13251
13252
13253
13254
13255
13256
13257
13258
13259
13260
13261
13262
13263
13264
13265
13266
13267
13268
13269
13270
13271
13272
13273
13274
13275
13276
13277
13278
13279
13280
13281
13282
13283
13284
13285
13286
13287
13288
13289
13290
13291
13292
13293
13294
13295
13296
13297
13298
13299
13300
13301
13302
13303
13304
13305
13306
13307
13308
13309
13310
13311
13312
13313
13314
13315
13316
13317
13318
13319
13320
13321
13322
13323
13324
13325
13326
13327
13328
13329
13330
13331
13332
13333
13334
13335
13336
13337
13338
13339
13340
13341
13342
13343
13344
13345
13346
13347
13348
13349
13350
13351
13352
13353
13354
13355
13356
13357
13358
13359
13360
13361
13362
13363
13364
13365
13366
13367
13368
13369
13370
13371
13372
13373
13374
13375
13376
13377
13378
13379
13380
13381
13382
13383
13384
13385
13386
13387
13388
13389
13390
13391
13392
13393
13394
13395
13396
13397
13398
13399
13400
13401
13402
13403
13404
13405
13406
13407
13408
13409
13410
13411
13412
13413
13414
13415
13416
13417
13418
13419
13420
13421
13422
13423
13424
13425
13426
13427
13428
13429
13430
13431
13432
13433
13434
13435
13436
13437
13438
13439
13440
13441
13442
13443
13444
13445
13446
13447
13448
13449
13450
13451
13452
13453
13454
13455
13456
13457
13458
13459
13460
13461
13462
13463
13464
13465
13466
13467
13468
13469
13470
13471
13472
13473
13474
13475
13476
13477
13478
13479
13480
13481
13482
13483
13484
13485
13486
13487
13488
13489
13490
13491
13492
13493
13494
13495
13496
13497
13498
13499
13500
13501
13502
13503
13504
13505
13506
13507
13508
13509
13510
13511
13512
13513
13514
13515
13516
13517
13518
13519
13520
13521
13522
13523
13524
13525
13526
13527
13528
13529
13530
13531
13532
13533
13534
13535
13536
13537
13538
13539
13540
13541
13542
13543
13544
13545
13546
13547
13548
13549
13550
13551
13552
13553
13554
13555
13556
13557
13558
13559
13560
13561
13562
13563
13564
13565
13566
13567
13568
13569
13570
13571
13572
13573
13574
13575
13576
13577
13578
13579
13580
13581
13582
13583
13584
13585
13586
13587
13588
13589
13590
13591
13592
13593
13594
13595
13596
13597
13598
13599
13600
13601
13602
13603
13604
13605
13606
13607
13608
13609
13610
13611
13612
13613
13614
13615
13616
13617
13618
13619
13620
13621
13622
13623
13624
13625
13626
13627
13628
13629
13630
13631
13632
13633
13634
13635
13636
13637
13638
13639
13640
13641
13642
13643
13644
13645
13646
13647
13648
13649
13650
13651
13652
13653
13654
13655
13656
13657
13658
13659
13660
13661
13662
13663
13664
13665
13666
13667
13668
13669
13670
13671
13672
13673
13674
13675
13676
13677
13678
13679
13680
13681
13682
13683
13684
13685
13686
13687
13688
13689
13690
13691
13692
13693
13694
13695
13696
13697
13698
13699
13700
13701
13702
13703
13704
13705
13706
13707
13708
13709
13710
13711
13712
13713
13714
13715
13716
13717
13718
13719
13720
13721
13722
13723
13724
13725
13726
13727
13728
13729
13730
13731
13732
13733
13734
13735
13736
13737
13738
13739
13740
13741
13742
13743
13744
13745
13746
13747
13748
13749
13750
13751
13752
13753
13754
13755
13756
13757
13758
13759
13760
13761
13762
13763
13764
13765
13766
13767
13768
13769
13770
13771
13772
13773
13774
13775
13776
13777
13778
13779
13780
13781
13782
13783
13784
13785
13786
13787
13788
13789
13790
13791
13792
13793
13794
13795
13796
13797
13798
13799
13800
13801
13802
13803
13804
13805
13806
13807
13808
13809
13810
13811
13812
13813
13814
13815
13816
13817
13818
13819
13820
13821
13822
13823
13824
13825
13826
13827
13828
13829
13830
13831
13832
13833
13834
13835
13836
13837
13838
13839
13840
13841
13842
13843
13844
13845
13846
13847
13848
13849
13850
13851
13852
13853
13854
13855
13856
13857
13858
13859
13860
13861
13862
13863
13864
13865
13866
13867
13868
13869
13870
13871
13872
13873
13874
13875
13876
13877
13878
13879
13880
13881
13882
13883
13884
13885
13886
13887
13888
13889
13890
13891
13892
13893
13894
13895
13896
13897
13898
13899
13900
13901
13902
13903
13904
13905
13906
13907
13908
13909
13910
13911
13912
13913
13914
13915
13916
13917
13918
13919
13920
13921
13922
13923
13924
13925
13926
13927
13928
13929
13930
13931
13932
13933
13934
13935
13936
13937
13938
13939
13940
13941
13942
13943
13944
13945
13946
13947
13948
13949
13950
13951
13952
13953
13954
13955
13956
13957
13958
13959
13960
13961
13962
13963
13964
13965
13966
13967
13968
13969
13970
13971
13972
13973
13974
13975
13976
13977
13978
13979
13980
13981
13982
13983
13984
13985
13986
13987
13988
13989
13990
13991
13992
13993
13994
13995
13996
13997
13998
13999
14000
14001
14002
14003
14004
14005
14006
14007
14008
14009
14010
14011
14012
14013
14014
14015
14016
14017
14018
14019
14020
14021
14022
14023
14024
14025
14026
14027
14028
14029
14030
14031
14032
14033
14034
14035
14036
14037
14038
14039
14040
14041
14042
14043
14044
14045
14046
14047
14048
14049
14050
14051
14052
14053
14054
14055
14056
14057
14058
14059
14060
14061
14062
14063
14064
14065
14066
14067
14068
14069
14070
14071
14072
14073
14074
14075
14076
14077
14078
14079
14080
14081
14082
14083
14084
14085
14086
14087
14088
14089
14090
14091
14092
14093
14094
14095
14096
14097
14098
14099
14100
14101
14102
14103
14104
14105
14106
14107
14108
14109
14110
14111
14112
14113
14114
14115
14116
14117
14118
14119
14120
14121
14122
14123
14124
14125
14126
14127
14128
14129
14130
14131
14132
14133
14134
14135
14136
14137
14138
14139
14140
14141
14142
14143
14144
14145
14146
14147
14148
14149
14150
14151
14152
14153
14154
14155
14156
14157
14158
14159
14160
14161
14162
14163
14164
14165
14166
14167
14168
14169
14170
14171
14172
14173
14174
14175
14176
14177
14178
14179
14180
14181
14182
14183
14184
14185
14186
14187
14188
14189
14190
14191
14192
14193
14194
14195
14196
14197
14198
14199
14200
14201
14202
14203
14204
14205
14206
14207
14208
14209
14210
14211
14212
14213
14214
14215
14216
14217
14218
14219
14220
14221
14222
14223
14224
14225
14226
14227
14228
14229
14230
14231
14232
14233
14234
14235
14236
14237
14238
14239
14240
14241
14242
14243
14244
14245
14246
14247
14248
14249
14250
14251
14252
14253
14254
14255
14256
14257
14258
14259
14260
14261
14262
14263
14264
14265
14266
14267
14268
14269
14270
14271
14272
14273
14274
14275
14276
14277
14278
14279
14280
14281
14282
14283
14284
14285
14286
14287
14288
14289
14290
14291
14292
14293
14294
14295
14296
14297
14298
14299
14300
14301
14302
14303
14304
14305
14306
14307
14308
14309
14310
14311
14312
14313
14314
14315
14316
14317
14318
14319
14320
14321
14322
14323
14324
14325
14326
14327
14328
14329
14330
14331
14332
14333
14334
14335
14336
14337
14338
14339
14340
14341
14342
14343
14344
14345
14346
14347
14348
14349
14350
14351
14352
14353
14354
14355
14356
14357
14358
14359
14360
14361
14362
14363
14364
14365
14366
14367
14368
14369
14370
14371
14372
14373
14374
14375
14376
14377
14378
14379
14380
14381
14382
14383
14384
14385
14386
14387
14388
14389
14390
14391
14392
14393
14394
14395
14396
14397
14398
14399
14400
14401
14402
14403
14404
14405
14406
14407
14408
14409
14410
14411
14412
14413
14414
14415
14416
14417
14418
14419
14420
14421
14422
14423
14424
14425
14426
14427
14428
14429
14430
14431
14432
14433
14434
14435
14436
14437
14438
14439
14440
14441
14442
14443
14444
14445
14446
14447
14448
14449
14450
14451
14452
14453
14454
14455
14456
14457
14458
14459
14460
14461
14462
14463
14464
14465
14466
14467
14468
14469
14470
14471
14472
14473
14474
14475
14476
14477
14478
14479
14480
14481
14482
14483
14484
14485
14486
14487
14488
14489
14490
14491
14492
14493
14494
14495
14496
14497
14498
14499
14500
14501
14502
14503
14504
14505
14506
14507
14508
14509
14510
14511
14512
14513
14514
14515
14516
14517
14518
14519
14520
14521
14522
14523
14524
14525
14526
14527
14528
14529
14530
14531
14532
14533
14534
14535
14536
14537
14538
14539
14540
14541
14542
14543
14544
14545
14546
14547
14548
14549
14550
14551
14552
14553
14554
14555
14556
14557
14558
14559
14560
14561
14562
14563
14564
14565
14566
14567
14568
14569
14570
14571
14572
14573
14574
14575
14576
14577
14578
14579
14580
14581
14582
14583
14584
14585
14586
14587
14588
14589
14590
14591
14592
14593
14594
14595
14596
14597
14598
14599
14600
14601
14602
14603
14604
14605
14606
14607
14608
14609
14610
14611
14612
14613
14614
14615
14616
14617
14618
14619
14620
14621
14622
14623
14624
14625
14626
14627
14628
14629
14630
14631
14632
14633
14634
14635
14636
14637
14638
14639
14640
14641
14642
14643
14644
14645
14646
14647
14648
14649
14650
14651
14652
14653
14654
14655
14656
14657
14658
14659
14660
14661
14662
14663
14664
14665
14666
14667
14668
14669
14670
14671
14672
14673
14674
14675
14676
14677
14678
14679
14680
14681
14682
14683
14684
14685
14686
14687
14688
14689
14690
14691
14692
14693
14694
14695
14696
14697
14698
14699
14700
14701
14702
14703
14704
14705
14706
14707
14708
14709
14710
14711
14712
14713
14714
14715
14716
14717
14718
14719
14720
14721
14722
14723
14724
14725
14726
14727
14728
14729
14730
14731
14732
14733
14734
14735
14736
14737
14738
14739
14740
14741
14742
14743
14744
14745
14746
14747
14748
14749
14750
14751
14752
14753
14754
14755
14756
14757
14758
14759
14760
14761
14762
14763
14764
14765
14766
14767
14768
14769
14770
14771
14772
14773
14774
14775
14776
14777
14778
14779
14780
14781
14782
14783
14784
14785
14786
14787
14788
14789
14790
14791
14792
14793
14794
14795
14796
14797
14798
14799
14800
14801
14802
14803
14804
14805
14806
14807
14808
14809
14810
14811
14812
14813
14814
14815
14816
14817
14818
14819
14820
14821
14822
14823
14824
14825
14826
14827
14828
14829
14830
14831
14832
14833
14834
14835
14836
14837
14838
14839
14840
14841
14842
14843
14844
14845
14846
14847
14848
14849
14850
14851
14852
14853
14854
14855
14856
14857
14858
14859
14860
14861
14862
14863
14864
14865
14866
14867
14868
14869
14870
14871
14872
14873
14874
14875
14876
14877
14878
14879
14880
14881
14882
14883
14884
14885
14886
14887
14888
14889
14890
14891
14892
14893
14894
14895
14896
14897
14898
14899
14900
14901
14902
14903
14904
14905
14906
14907
14908
14909
14910
14911
14912
14913
14914
14915
14916
14917
14918
14919
14920
14921
14922
14923
14924
14925
14926
14927
14928
14929
14930
14931
14932
14933
14934
14935
14936
14937
14938
14939
14940
14941
14942
14943
14944
14945
14946
14947
14948
14949
14950
14951
14952
14953
14954
14955
14956
14957
14958
14959
14960
14961
14962
14963
14964
14965
14966
14967
14968
14969
14970
14971
14972
14973
14974
14975
14976
14977
14978
14979
14980
14981
14982
14983
14984
14985
14986
14987
14988
14989
14990
14991
14992
14993
14994
14995
14996
14997
14998
14999
15000
15001
15002
15003
15004
15005
15006
15007
15008
15009
15010
15011
15012
15013
15014
15015
15016
15017
15018
15019
15020
15021
15022
15023
15024
15025
15026
15027
15028
15029
15030
15031
15032
15033
15034
15035
15036
15037
15038
15039
15040
15041
15042
15043
15044
15045
15046
15047
15048
15049
15050
15051
15052
15053
15054
15055
15056
15057
15058
15059
15060
15061
15062
15063
15064
15065
15066
15067
15068
15069
15070
15071
15072
15073
15074
15075
15076
15077
15078
15079
15080
15081
15082
15083
15084
15085
15086
15087
15088
15089
15090
15091
15092
15093
15094
15095
15096
15097
15098
15099
15100
15101
15102
15103
15104
15105
15106
15107
15108
15109
15110
15111
15112
15113
15114
15115
15116
15117
15118
15119
15120
15121
15122
15123
15124
15125
15126
15127
15128
15129
15130
15131
15132
15133
15134
15135
15136
15137
15138
15139
15140
15141
15142
15143
15144
15145
15146
15147
15148
15149
15150
15151
15152
15153
15154
15155
15156
15157
15158
15159
15160
15161
15162
15163
15164
15165
15166
15167
15168
15169
15170
15171
15172
15173
15174
15175
15176
15177
15178
15179
15180
15181
15182
15183
15184
15185
15186
15187
15188
15189
15190
15191
15192
15193
15194
15195
15196
15197
15198
15199
15200
15201
15202
15203
15204
15205
15206
15207
15208
15209
15210
15211
15212
15213
15214
15215
15216
15217
15218
15219
15220
15221
15222
15223
15224
15225
15226
15227
15228
15229
15230
15231
15232
15233
15234
15235
15236
15237
15238
15239
15240
15241
15242
15243
15244
15245
15246
15247
15248
15249
15250
15251
15252
15253
15254
15255
15256
15257
15258
15259
15260
15261
15262
15263
15264
15265
15266
15267
15268
15269
15270
15271
15272
15273
15274
15275
15276
15277
15278
15279
15280
15281
15282
15283
15284
15285
15286
15287
15288
15289
15290
15291
15292
15293
15294
15295
15296
15297
15298
15299
15300
15301
15302
15303
15304
15305
15306
15307
15308
15309
15310
15311
15312
15313
15314
15315
15316
15317
15318
15319
15320
15321
15322
15323
15324
15325
15326
15327
15328
15329
15330
15331
15332
15333
15334
15335
15336
15337
15338
15339
15340
15341
15342
15343
15344
15345
15346
15347
15348
15349
15350
15351
15352
15353
15354
15355
15356
15357
15358
15359
15360
15361
15362
15363
15364
15365
15366
15367
15368
15369
15370
15371
15372
15373
15374
15375
15376
15377
15378
15379
15380
15381
15382
15383
15384
15385
15386
15387
15388
15389
15390
15391
15392
15393
15394
15395
15396
15397
15398
15399
15400
15401
15402
15403
15404
15405
15406
15407
15408
15409
15410
15411
15412
15413
15414
15415
15416
15417
15418
15419
15420
15421
15422
15423
15424
15425
15426
15427
15428
15429
15430
15431
15432
15433
15434
15435
15436
15437
15438
15439
15440
15441
15442
15443
15444
15445
15446
15447
15448
15449
15450
15451
15452
15453
15454
15455
15456
15457
15458
15459
15460
15461
15462
15463
15464
15465
15466
15467
15468
15469
15470
15471
15472
15473
15474
15475
15476
15477
15478
15479
15480
15481
15482
15483
15484
15485
15486
15487
15488
15489
15490
15491
15492
15493
15494
15495
15496
15497
15498
15499
15500
15501
15502
15503
15504
15505
15506
15507
15508
15509
15510
15511
15512
15513
15514
15515
15516
15517
15518
15519
15520
15521
15522
15523
15524
15525
15526
15527
15528
15529
15530
15531
15532
15533
15534
15535
15536
15537
15538
15539
15540
15541
15542
15543
15544
15545
15546
15547
15548
15549
15550
15551
15552
15553
15554
15555
15556
15557
15558
15559
15560
15561
15562
15563
15564
15565
15566
15567
15568
15569
15570
15571
15572
15573
15574
15575
15576
15577
15578
15579
15580
15581
15582
15583
15584
15585
15586
15587
15588
15589
15590
15591
15592
15593
15594
15595
15596
15597
15598
15599
15600
15601
15602
15603
15604
15605
15606
15607
15608
15609
15610
15611
15612
15613
15614
15615
15616
15617
15618
15619
15620
15621
15622
15623
15624
15625
15626
15627
15628
15629
15630
15631
15632
15633
15634
15635
15636
15637
15638
15639
15640
15641
15642
15643
15644
15645
15646
15647
15648
15649
15650
15651
15652
15653
15654
15655
15656
15657
15658
15659
15660
15661
15662
15663
15664
15665
15666
15667
15668
15669
15670
15671
15672
15673
15674
15675
15676
15677
15678
15679
15680
15681
15682
15683
15684
15685
15686
15687
15688
15689
15690
15691
15692
15693
15694
15695
15696
15697
15698
15699
15700
15701
15702
15703
15704
15705
15706
15707
15708
15709
15710
15711
15712
15713
15714
15715
15716
15717
15718
15719
15720
15721
15722
15723
15724
15725
15726
15727
15728
15729
15730
15731
15732
15733
15734
15735
15736
15737
15738
15739
15740
15741
15742
15743
15744
15745
15746
15747
15748
15749
15750
15751
15752
15753
15754
15755
15756
15757
15758
15759
15760
15761
15762
15763
15764
15765
15766
15767
15768
15769
15770
15771
15772
15773
15774
15775
15776
15777
15778
15779
15780
15781
15782
15783
15784
15785
15786
15787
15788
15789
15790
15791
15792
15793
15794
15795
15796
15797
15798
15799
15800
15801
15802
15803
15804
15805
15806
15807
15808
15809
15810
15811
15812
15813
15814
15815
15816
15817
15818
15819
15820
15821
15822
15823
15824
15825
15826
15827
15828
15829
15830
15831
15832
15833
15834
15835
15836
15837
15838
15839
15840
15841
15842
15843
15844
15845
15846
15847
15848
15849
15850
15851
15852
15853
15854
15855
15856
15857
15858
15859
15860
15861
15862
15863
15864
15865
15866
15867
15868
15869
15870
15871
15872
15873
15874
15875
15876
15877
15878
15879
15880
15881
15882
15883
15884
15885
15886
15887
15888
15889
15890
15891
15892
15893
15894
15895
15896
15897
15898
15899
15900
15901
15902
15903
15904
15905
15906
15907
15908
15909
15910
15911
15912
15913
15914
15915
15916
15917
15918
15919
15920
15921
15922
15923
15924
15925
15926
15927
15928
15929
15930
15931
15932
15933
15934
15935
15936
15937
15938
15939
15940
15941
15942
15943
15944
15945
15946
15947
15948
15949
15950
15951
15952
15953
15954
15955
15956
15957
15958
15959
15960
15961
15962
15963
15964
15965
15966
15967
15968
15969
15970
15971
15972
15973
15974
15975
15976
15977
15978
15979
15980
15981
15982
15983
15984
15985
15986
15987
15988
15989
15990
15991
15992
15993
15994
15995
15996
15997
15998
15999
16000
16001
16002
16003
16004
16005
16006
16007
16008
16009
16010
16011
16012
16013
16014
16015
16016
16017
16018
16019
16020
16021
16022
16023
16024
16025
16026
16027
16028
16029
16030
16031
16032
16033
16034
16035
16036
16037
16038
16039
16040
16041
16042
16043
16044
16045
16046
16047
16048
16049
16050
16051
16052
16053
16054
16055
16056
16057
16058
16059
16060
16061
16062
16063
16064
16065
16066
16067
16068
16069
16070
16071
16072
16073
16074
16075
16076
16077
16078
16079
16080
16081
16082
16083
16084
16085
16086
16087
16088
16089
16090
16091
16092
16093
16094
16095
16096
16097
16098
16099
16100
16101
16102
16103
16104
16105
16106
16107
16108
16109
16110
16111
16112
16113
16114
16115
16116
16117
16118
16119
16120
16121
16122
16123
16124
16125
16126
16127
16128
16129
16130
16131
16132
16133
16134
16135
16136
16137
16138
16139
16140
16141
16142
16143
16144
16145
16146
16147
16148
16149
16150
16151
16152
16153
16154
16155
16156
16157
16158
16159
16160
16161
16162
16163
16164
16165
16166
16167
16168
16169
16170
16171
16172
16173
16174
16175
16176
16177
16178
16179
16180
16181
16182
16183
16184
16185
16186
16187
16188
16189
16190
16191
16192
16193
16194
16195
16196
16197
16198
16199
16200
16201
16202
16203
16204
16205
16206
16207
16208
16209
16210
16211
16212
16213
16214
16215
16216
16217
16218
16219
16220
16221
16222
16223
16224
16225
16226
16227
16228
16229
16230
16231
16232
16233
16234
16235
16236
16237
16238
16239
16240
16241
16242
16243
16244
16245
16246
16247
16248
16249
16250
16251
16252
16253
16254
16255
16256
16257
16258
16259
16260
16261
16262
16263
16264
16265
16266
16267
16268
16269
16270
16271
16272
16273
16274
16275
16276
16277
16278
16279
16280
16281
16282
16283
16284
16285
16286
16287
16288
16289
16290
16291
16292
16293
16294
16295
16296
16297
16298
16299
16300
16301
16302
16303
16304
16305
16306
16307
16308
16309
16310
16311
16312
16313
16314
16315
16316
16317
16318
16319
16320
16321
16322
16323
16324
16325
16326
16327
16328
16329
16330
16331
16332
16333
16334
16335
16336
16337
16338
16339
16340
16341
16342
16343
16344
16345
16346
16347
16348
16349
16350
16351
16352
16353
16354
16355
16356
16357
16358
16359
16360
16361
16362
16363
16364
16365
16366
16367
16368
16369
16370
16371
16372
16373
16374
16375
16376
16377
16378
16379
16380
16381
16382
16383
16384
16385
16386
16387
16388
16389
16390
16391
16392
16393
16394
16395
16396
16397
16398
16399
16400
16401
16402
16403
16404
16405
16406
16407
16408
16409
16410
16411
16412
16413
16414
16415
16416
16417
16418
16419
16420
16421
16422
16423
16424
16425
16426
16427
16428
16429
16430
16431
16432
16433
16434
16435
16436
16437
16438
16439
16440
16441
16442
16443
16444
16445
16446
16447
16448
16449
16450
16451
16452
16453
16454
16455
16456
16457
16458
16459
16460
16461
16462
16463
16464
16465
16466
16467
16468
16469
16470
16471
16472
16473
16474
16475
16476
16477
16478
16479
16480
16481
16482
16483
16484
16485
16486
16487
16488
16489
16490
16491
16492
16493
16494
16495
16496
16497
16498
16499
16500
16501
16502
16503
16504
16505
16506
16507
16508
16509
16510
16511
16512
16513
16514
16515
16516
16517
16518
16519
16520
16521
16522
16523
16524
16525
16526
16527
16528
16529
16530
16531
16532
16533
16534
16535
16536
16537
16538
16539
16540
16541
16542
16543
16544
16545
16546
16547
16548
16549
16550
16551
16552
16553
16554
16555
16556
16557
16558
16559
16560
16561
16562
16563
16564
16565
16566
16567
16568
16569
16570
16571
16572
16573
16574
16575
16576
16577
16578
16579
16580
16581
16582
16583
16584
16585
16586
16587
16588
16589
16590
16591
16592
16593
16594
16595
16596
16597
16598
16599
16600
16601
16602
16603
16604
16605
16606
16607
16608
16609
16610
16611
16612
16613
16614
16615
16616
16617
16618
16619
16620
16621
16622
16623
16624
16625
16626
16627
16628
16629
16630
16631
16632
16633
16634
16635
16636
16637
16638
16639
16640
16641
16642
16643
16644
16645
16646
16647
16648
16649
16650
16651
16652
16653
16654
16655
16656
16657
16658
16659
16660
16661
16662
16663
16664
16665
16666
16667
16668
16669
16670
16671
16672
16673
16674
16675
16676
16677
16678
16679
16680
16681
16682
16683
16684
16685
16686
16687
16688
16689
16690
16691
16692
16693
16694
16695
16696
16697
16698
16699
16700
16701
16702
16703
16704
16705
16706
16707
16708
16709
16710
16711
16712
16713
16714
16715
16716
16717
16718
16719
16720
16721
16722
16723
16724
16725
16726
16727
16728
16729
16730
16731
16732
16733
16734
16735
16736
16737
16738
16739
16740
16741
16742
16743
16744
16745
16746
16747
16748
16749
16750
16751
16752
16753
16754
16755
16756
16757
16758
16759
16760
16761
16762
16763
16764
16765
16766
16767
16768
16769
16770
16771
16772
16773
16774
16775
16776
16777
16778
16779
16780
16781
16782
16783
16784
16785
16786
16787
16788
16789
16790
16791
16792
16793
16794
16795
16796
16797
16798
16799
16800
16801
16802
16803
16804
16805
16806
16807
16808
16809
16810
16811
16812
16813
16814
16815
16816
16817
16818
16819
16820
16821
16822
16823
16824
16825
16826
16827
16828
16829
16830
16831
16832
16833
16834
16835
16836
16837
16838
16839
16840
16841
16842
16843
16844
16845
16846
16847
16848
16849
16850
16851
16852
16853
16854
16855
16856
16857
16858
16859
16860
16861
16862
16863
16864
16865
16866
16867
16868
16869
16870
16871
16872
16873
16874
16875
16876
16877
16878
16879
16880
16881
16882
16883
16884
16885
16886
16887
16888
16889
16890
16891
16892
16893
16894
16895
16896
16897
16898
16899
16900
16901
16902
16903
16904
16905
16906
16907
16908
16909
16910
16911
16912
16913
16914
16915
16916
16917
16918
16919
16920
16921
16922
16923
16924
16925
16926
16927
16928
16929
16930
16931
16932
16933
16934
16935
16936
16937
16938
16939
16940
16941
16942
16943
16944
16945
16946
16947
16948
16949
16950
16951
16952
16953
16954
16955
16956
16957
16958
16959
16960
16961
16962
16963
16964
16965
16966
16967
16968
16969
16970
16971
16972
16973
16974
16975
16976
16977
16978
16979
16980
16981
16982
16983
16984
16985
16986
16987
16988
16989
16990
16991
16992
16993
16994
16995
16996
16997
16998
16999
17000
17001
17002
17003
17004
17005
17006
17007
17008
17009
17010
17011
17012
17013
17014
17015
17016
17017
17018
17019
17020
17021
17022
17023
17024
17025
17026
17027
17028
17029
17030
17031
17032
17033
17034
17035
17036
17037
17038
17039
17040
17041
17042
17043
17044
17045
17046
17047
17048
17049
17050
17051
17052
17053
17054
17055
17056
17057
17058
17059
17060
17061
17062
17063
17064
17065
17066
17067
17068
17069
17070
17071
17072
17073
17074
17075
17076
17077
17078
17079
17080
17081
17082
17083
17084
17085
17086
17087
17088
17089
17090
17091
17092
17093
17094
17095
17096
17097
17098
17099
17100
17101
17102
17103
17104
17105
17106
17107
17108
17109
17110
17111
17112
17113
17114
17115
17116
17117
17118
17119
17120
17121
17122
17123
17124
17125
17126
17127
17128
17129
17130
17131
17132
17133
17134
17135
17136
17137
17138
17139
17140
17141
17142
17143
17144
17145
17146
17147
17148
17149
17150
17151
17152
17153
17154
17155
17156
17157
17158
17159
17160
17161
17162
17163
17164
17165
17166
17167
17168
17169
17170
17171
17172
17173
17174
17175
17176
17177
17178
17179
17180
17181
17182
17183
17184
17185
17186
17187
17188
17189
17190
17191
17192
17193
17194
17195
17196
17197
17198
17199
17200
17201
17202
17203
17204
17205
17206
17207
17208
17209
17210
17211
17212
17213
17214
17215
17216
17217
17218
17219
17220
17221
17222
17223
17224
17225
17226
17227
17228
17229
17230
17231
17232
17233
17234
17235
17236
17237
17238
17239
17240
17241
17242
17243
17244
17245
17246
17247
17248
17249
17250
17251
17252
17253
17254
17255
17256
17257
17258
17259
17260
17261
17262
17263
17264
17265
17266
17267
17268
17269
17270
17271
17272
17273
17274
17275
17276
17277
17278
17279
17280
17281
17282
17283
17284
17285
17286
17287
17288
17289
17290
17291
17292
17293
17294
17295
17296
17297
17298
17299
17300
17301
17302
17303
17304
17305
17306
17307
17308
17309
17310
17311
17312
17313
17314
17315
17316
17317
17318
17319
17320
17321
17322
17323
17324
17325
17326
17327
17328
17329
17330
17331
17332
17333
17334
17335
17336
17337
17338
17339
17340
17341
17342
17343
17344
17345
17346
17347
17348
17349
17350
17351
17352
17353
17354
17355
17356
17357
17358
17359
17360
17361
17362
17363
17364
17365
17366
17367
17368
17369
17370
17371
17372
17373
17374
17375
17376
17377
17378
17379
17380
17381
17382
17383
17384
17385
17386
17387
17388
17389
17390
17391
17392
17393
17394
17395
17396
17397
17398
17399
17400
17401
17402
17403
17404
17405
17406
17407
17408
17409
17410
17411
17412
17413
17414
17415
17416
17417
17418
17419
17420
17421
17422
17423
17424
17425
17426
17427
17428
17429
17430
17431
17432
17433
17434
17435
17436
17437
17438
17439
17440
17441
17442
17443
17444
17445
17446
17447
17448
17449
17450
17451
17452
17453
17454
17455
17456
17457
17458
17459
17460
17461
17462
17463
17464
17465
17466
17467
17468
17469
17470
17471
17472
17473
17474
17475
17476
17477
17478
17479
17480
17481
17482
17483
17484
17485
17486
17487
17488
17489
17490
17491
17492
17493
17494
17495
17496
17497
17498
17499
17500
17501
17502
17503
17504
17505
17506
17507
17508
17509
17510
17511
17512
17513
17514
17515
17516
17517
17518
17519
17520
17521
17522
17523
17524
17525
17526
17527
17528
17529
17530
17531
17532
17533
17534
17535
17536
17537
17538
17539
17540
17541
17542
17543
17544
17545
17546
17547
17548
17549
17550
17551
17552
17553
17554
17555
17556
17557
17558
17559
17560
17561
17562
17563
17564
17565
17566
17567
17568
17569
17570
17571
17572
17573
17574
17575
17576
17577
17578
17579
17580
17581
17582
17583
17584
17585
17586
17587
17588
17589
17590
17591
17592
17593
17594
17595
17596
17597
17598
17599
17600
17601
17602
17603
17604
17605
17606
17607
17608
17609
17610
17611
17612
17613
17614
17615
17616
17617
17618
17619
17620
17621
17622
17623
17624
17625
17626
17627
17628
17629
17630
17631
17632
17633
17634
17635
17636
17637
17638
17639
17640
17641
17642
17643
17644
17645
17646
17647
17648
17649
17650
17651
17652
17653
17654
17655
17656
17657
17658
17659
17660
17661
17662
17663
17664
17665
17666
17667
17668
17669
17670
17671
17672
17673
17674
17675
17676
17677
17678
17679
17680
17681
17682
17683
17684
17685
17686
17687
17688
17689
17690
17691
17692
17693
17694
17695
17696
17697
17698
17699
17700
17701
17702
17703
17704
17705
17706
17707
17708
17709
17710
17711
17712
17713
17714
17715
17716
17717
17718
17719
17720
17721
17722
17723
17724
17725
17726
17727
17728
17729
17730
17731
17732
17733
17734
17735
17736
17737
17738
17739
17740
17741
17742
17743
17744
17745
17746
17747
17748
17749
17750
17751
17752
17753
17754
17755
17756
17757
17758
17759
17760
17761
17762
17763
17764
17765
17766
17767
17768
17769
17770
17771
17772
17773
17774
17775
17776
17777
17778
17779
17780
17781
17782
17783
17784
17785
17786
17787
17788
17789
17790
17791
17792
17793
17794
17795
17796
17797
17798
17799
17800
17801
17802
17803
17804
17805
17806
17807
17808
17809
17810
17811
17812
17813
17814
17815
17816
17817
17818
17819
17820
17821
17822
17823
17824
17825
17826
17827
17828
17829
17830
17831
17832
17833
17834
17835
17836
17837
17838
17839
17840
17841
17842
17843
17844
17845
17846
17847
17848
17849
17850
17851
17852
17853
17854
17855
17856
17857
17858
17859
17860
17861
17862
17863
17864
17865
17866
17867
17868
17869
17870
17871
17872
17873
17874
17875
17876
17877
17878
17879
17880
17881
17882
17883
17884
17885
17886
17887
17888
17889
17890
17891
17892
17893
17894
17895
17896
17897
17898
17899
17900
17901
17902
17903
17904
17905
17906
17907
17908
17909
17910
17911
17912
17913
17914
17915
17916
17917
17918
17919
17920
17921
17922
17923
17924
17925
17926
17927
17928
17929
17930
17931
17932
17933
17934
17935
17936
17937
17938
17939
17940
17941
17942
17943
17944
17945
17946
17947
17948
17949
17950
17951
17952
17953
17954
17955
17956
17957
17958
17959
17960
17961
17962
17963
17964
17965
17966
17967
17968
17969
17970
17971
17972
17973
17974
17975
17976
17977
17978
17979
17980
17981
17982
17983
17984
17985
17986
17987
17988
17989
17990
17991
17992
17993
17994
17995
17996
17997
17998
17999
18000
18001
18002
18003
18004
18005
18006
18007
18008
18009
18010
18011
18012
18013
18014
18015
18016
18017
18018
18019
18020
18021
18022
18023
18024
18025
18026
18027
18028
18029
18030
18031
18032
18033
18034
18035
18036
18037
18038
18039
18040
18041
18042
18043
18044
18045
18046
18047
18048
18049
18050
18051
18052
18053
18054
18055
18056
18057
18058
18059
18060
18061
18062
18063
18064
18065
18066
18067
18068
18069
18070
18071
18072
18073
18074
18075
18076
18077
18078
18079
18080
18081
18082
18083
18084
18085
18086
18087
18088
18089
18090
18091
18092
18093
18094
18095
18096
18097
18098
18099
18100
18101
18102
18103
18104
18105
18106
18107
18108
18109
18110
18111
18112
18113
18114
18115
18116
18117
18118
18119
18120
18121
18122
18123
18124
18125
18126
18127
18128
18129
18130
18131
18132
18133
18134
18135
18136
18137
18138
18139
18140
18141
18142
18143
18144
18145
18146
18147
18148
18149
18150
18151
18152
18153
18154
18155
18156
18157
18158
18159
18160
18161
18162
18163
18164
18165
18166
18167
18168
18169
18170
18171
18172
18173
18174
18175
18176
18177
18178
18179
18180
18181
18182
18183
18184
18185
18186
18187
18188
18189
18190
18191
18192
18193
18194
18195
18196
18197
18198
18199
18200
18201
18202
18203
18204
18205
18206
18207
18208
18209
18210
18211
18212
18213
18214
18215
18216
18217
18218
18219
18220
18221
18222
18223
18224
18225
18226
18227
18228
18229
18230
18231
18232
18233
18234
18235
18236
18237
18238
18239
18240
18241
18242
18243
18244
18245
18246
18247
18248
18249
18250
18251
18252
18253
18254
18255
18256
18257
18258
18259
18260
18261
18262
18263
18264
18265
18266
18267
18268
18269
18270
18271
18272
18273
18274
18275
18276
18277
18278
18279
18280
18281
18282
18283
18284
18285
18286
18287
18288
18289
18290
18291
18292
18293
18294
18295
18296
18297
18298
18299
18300
18301
18302
18303
18304
18305
18306
18307
18308
18309
18310
18311
18312
18313
18314
18315
18316
18317
18318
18319
18320
18321
18322
18323
18324
18325
18326
18327
18328
18329
18330
18331
18332
18333
18334
18335
18336
18337
18338
18339
18340
18341
18342
18343
18344
18345
18346
18347
18348
18349
18350
18351
18352
18353
18354
18355
18356
18357
18358
18359
18360
18361
18362
18363
18364
18365
18366
18367
18368
18369
18370
18371
18372
18373
18374
18375
18376
18377
18378
18379
18380
18381
18382
18383
18384
18385
18386
18387
18388
18389
18390
18391
18392
18393
18394
18395
18396
18397
18398
18399
18400
18401
18402
18403
18404
18405
18406
18407
18408
18409
18410
18411
18412
18413
18414
18415
18416
18417
18418
18419
18420
18421
18422
18423
18424
18425
18426
18427
18428
18429
18430
18431
18432
18433
18434
18435
18436
18437
18438
18439
18440
18441
18442
18443
18444
18445
18446
18447
18448
18449
18450
18451
18452
18453
18454
18455
18456
18457
18458
18459
18460
18461
18462
18463
18464
18465
18466
18467
18468
18469
18470
18471
18472
18473
18474
18475
18476
18477
18478
18479
18480
18481
18482
18483
18484
18485
18486
18487
18488
18489
18490
18491
18492
18493
18494
18495
18496
18497
18498
18499
18500
18501
18502
18503
18504
18505
18506
18507
18508
18509
18510
18511
18512
18513
18514
18515
18516
18517
18518
18519
18520
18521
18522
18523
18524
18525
18526
18527
18528
18529
18530
18531
18532
18533
18534
18535
18536
18537
18538
18539
18540
18541
18542
18543
18544
18545
18546
18547
18548
18549
18550
18551
18552
18553
18554
18555
18556
18557
18558
18559
18560
18561
18562
18563
18564
18565
18566
18567
18568
18569
18570
18571
18572
18573
18574
18575
18576
18577
18578
18579
18580
18581
18582
18583
18584
18585
18586
18587
18588
18589
18590
18591
18592
18593
18594
18595
18596
18597
18598
18599
18600
18601
18602
18603
18604
18605
18606
18607
18608
18609
18610
18611
18612
18613
18614
18615
18616
18617
18618
18619
18620
18621
18622
18623
18624
18625
18626
18627
18628
18629
18630
18631
18632
18633
18634
18635
18636
18637
18638
18639
18640
18641
18642
18643
18644
18645
18646
18647
18648
18649
18650
18651
18652
18653
18654
18655
18656
18657
18658
18659
18660
18661
18662
18663
18664
18665
18666
18667
18668
18669
18670
18671
18672
18673
18674
18675
18676
18677
18678
18679
18680
18681
18682
18683
18684
18685
18686
18687
18688
18689
18690
18691
18692
18693
18694
18695
18696
18697
18698
18699
18700
18701
18702
18703
18704
18705
18706
18707
18708
18709
18710
18711
18712
18713
18714
18715
18716
18717
18718
18719
18720
18721
18722
18723
18724
18725
18726
18727
18728
18729
18730
18731
18732
18733
18734
18735
18736
18737
18738
18739
18740
18741
18742
18743
18744
18745
18746
18747
18748
18749
18750
18751
18752
18753
18754
18755
18756
18757
18758
18759
18760
18761
18762
18763
18764
18765
18766
18767
18768
18769
18770
18771
18772
18773
18774
18775
18776
18777
18778
18779
18780
18781
18782
18783
18784
18785
18786
18787
18788
18789
18790
18791
18792
18793
18794
18795
18796
18797
18798
18799
18800
18801
18802
18803
18804
18805
18806
18807
18808
18809
18810
18811
18812
18813
18814
18815
18816
18817
18818
18819
18820
18821
18822
18823
18824
18825
18826
18827
18828
18829
18830
18831
18832
18833
18834
18835
18836
18837
18838
18839
18840
18841
18842
18843
18844
18845
18846
18847
18848
18849
18850
18851
18852
18853
18854
18855
18856
18857
18858
18859
18860
18861
18862
18863
18864
18865
18866
18867
18868
18869
18870
18871
18872
18873
18874
18875
18876
18877
18878
18879
18880
18881
18882
18883
18884
18885
18886
18887
18888
18889
18890
18891
18892
18893
18894
18895
18896
18897
18898
18899
18900
18901
18902
18903
18904
18905
18906
18907
18908
18909
18910
18911
18912
18913
18914
18915
18916
18917
18918
18919
18920
18921
18922
18923
18924
18925
18926
18927
18928
18929
18930
18931
18932
18933
18934
18935
18936
18937
18938
18939
18940
18941
18942
18943
18944
18945
18946
18947
18948
18949
18950
18951
18952
18953
18954
18955
18956
18957
18958
18959
18960
18961
18962
18963
18964
18965
18966
18967
18968
18969
18970
18971
18972
18973
18974
18975
18976
18977
18978
18979
18980
18981
18982
18983
18984
18985
18986
18987
18988
18989
18990
18991
18992
18993
18994
18995
18996
18997
18998
18999
19000
19001
19002
19003
19004
19005
19006
19007
19008
19009
19010
19011
19012
19013
19014
19015
19016
19017
19018
19019
19020
19021
19022
19023
19024
19025
19026
19027
19028
19029
19030
19031
19032
19033
19034
19035
19036
19037
19038
19039
19040
19041
19042
19043
19044
19045
19046
19047
19048
19049
19050
19051
19052
19053
19054
19055
19056
19057
19058
19059
19060
19061
19062
19063
19064
19065
19066
19067
19068
19069
19070
19071
19072
19073
19074
19075
19076
19077
19078
19079
19080
19081
19082
19083
19084
19085
19086
19087
19088
19089
19090
19091
19092
19093
19094
19095
19096
19097
19098
19099
19100
19101
19102
19103
19104
19105
19106
19107
19108
19109
19110
19111
19112
19113
19114
19115
19116
19117
19118
19119
19120
19121
19122
19123
19124
19125
19126
19127
19128
19129
19130
19131
19132
19133
19134
19135
19136
19137
19138
19139
19140
19141
19142
19143
19144
19145
19146
19147
19148
19149
19150
19151
19152
19153
19154
19155
19156
19157
19158
19159
19160
19161
19162
19163
19164
19165
19166
19167
19168
19169
19170
19171
19172
19173
19174
19175
19176
19177
19178
19179
19180
19181
19182
19183
19184
19185
19186
19187
19188
19189
19190
19191
19192
19193
19194
19195
19196
19197
19198
19199
19200
19201
19202
19203
19204
19205
19206
19207
19208
19209
19210
19211
19212
19213
19214
19215
19216
19217
19218
19219
19220
19221
19222
19223
19224
19225
19226
19227
19228
19229
19230
19231
19232
19233
19234
19235
19236
19237
19238
19239
19240
19241
19242
19243
19244
19245
19246
19247
19248
19249
19250
19251
19252
19253
19254
19255
19256
19257
19258
19259
19260
19261
19262
19263
19264
19265
19266
19267
19268
19269
19270
19271
19272
19273
19274
19275
19276
19277
19278
19279
19280
19281
19282
19283
19284
19285
19286
19287
19288
19289
19290
19291
19292
19293
19294
19295
19296
19297
19298
19299
19300
19301
19302
19303
19304
19305
19306
19307
19308
19309
19310
19311
19312
19313
19314
19315
19316
19317
19318
19319
19320
19321
19322
19323
19324
19325
19326
19327
19328
19329
19330
19331
19332
19333
19334
19335
19336
19337
19338
19339
19340
19341
19342
19343
19344
19345
19346
19347
19348
19349
19350
19351
19352
19353
19354
19355
19356
19357
19358
19359
19360
19361
19362
19363
19364
19365
19366
19367
19368
19369
19370
19371
19372
19373
19374
19375
19376
19377
19378
19379
19380
19381
19382
19383
19384
19385
19386
19387
19388
19389
19390
19391
19392
19393
19394
19395
19396
19397
19398
19399
19400
19401
19402
19403
19404
19405
19406
19407
19408
19409
19410
19411
19412
19413
19414
19415
19416
19417
19418
19419
19420
19421
19422
19423
19424
19425
19426
19427
19428
19429
19430
19431
19432
19433
19434
19435
19436
19437
19438
19439
19440
19441
19442
19443
19444
19445
19446
19447
19448
19449
19450
19451
19452
19453
19454
19455
19456
19457
19458
19459
19460
19461
19462
19463
19464
19465
19466
19467
19468
19469
19470
19471
19472
19473
19474
19475
19476
19477
19478
19479
19480
19481
19482
19483
19484
19485
19486
19487
19488
19489
19490
19491
19492
19493
19494
19495
19496
19497
19498
19499
19500
19501
19502
19503
19504
19505
19506
19507
19508
19509
19510
19511
19512
19513
19514
19515
19516
19517
19518
19519
19520
19521
19522
19523
19524
19525
19526
19527
19528
19529
19530
19531
19532
19533
19534
19535
19536
19537
19538
19539
19540
19541
19542
19543
19544
19545
19546
19547
19548
19549
19550
19551
19552
19553
19554
19555
19556
19557
19558
19559
19560
19561
19562
19563
19564
19565
19566
19567
19568
19569
19570
19571
19572
19573
19574
19575
19576
19577
19578
19579
19580
19581
19582
19583
19584
19585
19586
19587
19588
19589
19590
19591
19592
19593
19594
19595
19596
19597
19598
19599
19600
19601
19602
19603
19604
19605
19606
19607
19608
19609
19610
19611
19612
19613
19614
19615
19616
19617
19618
19619
19620
19621
19622
19623
19624
19625
19626
19627
19628
19629
19630
19631
19632
19633
19634
19635
19636
19637
19638
19639
19640
19641
19642
19643
19644
19645
19646
19647
19648
19649
19650
19651
19652
19653
19654
19655
19656
19657
19658
19659
19660
19661
19662
19663
19664
19665
19666
19667
19668
19669
19670
19671
19672
19673
19674
19675
19676
19677
19678
19679
19680
19681
19682
19683
19684
19685
19686
19687
19688
19689
19690
19691
19692
19693
19694
19695
19696
19697
19698
19699
19700
19701
19702
19703
19704
19705
19706
19707
19708
19709
19710
19711
19712
19713
19714
19715
19716
19717
19718
19719
19720
19721
19722
19723
19724
19725
19726
19727
19728
19729
19730
19731
19732
19733
19734
19735
19736
19737
19738
19739
19740
19741
19742
19743
19744
19745
19746
19747
19748
19749
19750
19751
19752
19753
19754
19755
19756
19757
19758
19759
19760
19761
19762
19763
19764
19765
19766
19767
19768
19769
19770
19771
19772
19773
19774
19775
19776
19777
19778
19779
19780
19781
19782
19783
19784
19785
19786
19787
19788
19789
19790
19791
19792
19793
19794
19795
19796
19797
19798
19799
19800
19801
19802
19803
19804
19805
19806
19807
19808
19809
19810
19811
19812
19813
19814
19815
19816
19817
19818
19819
19820
19821
19822
19823
19824
19825
19826
19827
19828
19829
19830
19831
19832
19833
19834
19835
19836
19837
19838
19839
19840
19841
19842
19843
19844
19845
19846
19847
19848
19849
19850
19851
19852
19853
19854
19855
19856
19857
19858
19859
19860
19861
19862
19863
19864
19865
19866
19867
19868
19869
19870
19871
19872
19873
19874
19875
19876
19877
19878
19879
19880
19881
19882
19883
19884
19885
19886
19887
19888
19889
19890
19891
19892
19893
19894
19895
19896
19897
19898
19899
19900
19901
19902
19903
19904
19905
19906
19907
19908
19909
19910
19911
19912
19913
19914
19915
19916
19917
19918
19919
19920
19921
19922
19923
19924
19925
19926
19927
19928
19929
19930
19931
19932
19933
19934
19935
19936
19937
19938
19939
19940
19941
19942
19943
19944
19945
19946
19947
19948
19949
19950
19951
19952
19953
19954
19955
19956
19957
19958
19959
19960
19961
19962
19963
19964
19965
19966
19967
19968
19969
19970
19971
19972
19973
19974
19975
19976
19977
19978
19979
19980
19981
19982
19983
19984
19985
19986
19987
19988
19989
19990
19991
19992
19993
19994
19995
19996
19997
19998
19999
20000
20001
20002
20003
20004
20005
20006
20007
20008
20009
20010
20011
20012
20013
20014
20015
20016
20017
20018
20019
20020
20021
20022
20023
20024
20025
20026
20027
20028
20029
20030
20031
20032
20033
20034
20035
20036
20037
20038
20039
20040
20041
20042
20043
20044
20045
20046
20047
20048
20049
20050
20051
20052
20053
20054
20055
20056
20057
20058
20059
20060
20061
20062
20063
20064
20065
20066
20067
20068
20069
20070
20071
20072
20073
20074
20075
20076
20077
20078
20079
20080
20081
20082
20083
20084
20085
20086
20087
20088
20089
20090
20091
20092
20093
20094
20095
20096
20097
20098
20099
20100
20101
20102
20103
20104
20105
20106
20107
20108
20109
20110
20111
20112
20113
20114
20115
20116
20117
20118
20119
20120
20121
20122
20123
20124
20125
20126
20127
20128
20129
20130
20131
20132
20133
20134
20135
20136
20137
20138
20139
20140
20141
20142
20143
20144
20145
20146
20147
20148
20149
20150
20151
20152
20153
20154
20155
20156
20157
20158
20159
20160
20161
20162
20163
20164
20165
20166
20167
20168
20169
20170
20171
20172
20173
20174
20175
20176
20177
20178
20179
20180
20181
20182
20183
20184
20185
20186
20187
20188
20189
20190
20191
20192
20193
20194
20195
20196
20197
20198
20199
20200
20201
20202
20203
20204
20205
20206
20207
20208
20209
20210
20211
20212
20213
20214
20215
20216
20217
20218
20219
20220
20221
20222
20223
20224
20225
20226
20227
20228
20229
20230
20231
20232
20233
20234
20235
20236
20237
20238
20239
20240
20241
20242
20243
20244
20245
20246
20247
20248
20249
20250
20251
20252
20253
20254
20255
20256
20257
20258
20259
20260
20261
20262
20263
20264
20265
20266
20267
20268
20269
20270
20271
20272
20273
20274
20275
20276
20277
20278
20279
20280
20281
20282
20283
20284
20285
20286
20287
20288
20289
20290
20291
20292
20293
20294
20295
20296
20297
20298
20299
20300
20301
20302
20303
20304
20305
20306
20307
20308
20309
20310
20311
20312
20313
20314
20315
20316
20317
20318
20319
20320
20321
20322
20323
20324
20325
20326
20327
20328
20329
20330
20331
20332
20333
20334
20335
20336
20337
20338
20339
20340
20341
20342
20343
20344
20345
20346
20347
20348
20349
20350
20351
20352
20353
20354
20355
20356
20357
20358
20359
20360
20361
20362
20363
20364
20365
20366
20367
20368
20369
20370
20371
20372
20373
20374
20375
20376
20377
20378
20379
20380
20381
20382
20383
20384
20385
20386
20387
20388
20389
20390
20391
20392
20393
20394
20395
20396
20397
20398
20399
20400
20401
20402
20403
20404
20405
20406
20407
20408
20409
20410
20411
20412
20413
20414
20415
20416
20417
20418
20419
20420
20421
20422
20423
20424
20425
20426
20427
20428
20429
20430
20431
20432
20433
20434
20435
20436
20437
20438
20439
20440
20441
20442
20443
20444
20445
20446
20447
20448
20449
20450
20451
20452
20453
20454
20455
20456
20457
20458
20459
20460
20461
20462
20463
20464
20465
20466
20467
20468
20469
20470
20471
20472
20473
20474
20475
20476
20477
20478
20479
20480
20481
20482
20483
20484
20485
20486
20487
20488
20489
20490
20491
20492
20493
20494
20495
20496
20497
20498
20499
20500
20501
20502
20503
20504
20505
20506
20507
20508
20509
20510
20511
20512
20513
20514
20515
20516
20517
20518
20519
20520
20521
20522
20523
20524
20525
20526
20527
20528
20529
20530
20531
20532
20533
20534
20535
20536
20537
20538
20539
20540
20541
20542
20543
20544
20545
20546
20547
20548
20549
20550
20551
20552
20553
20554
20555
20556
20557
20558
20559
20560
20561
20562
20563
20564
20565
20566
20567
20568
20569
20570
20571
20572
20573
20574
20575
20576
20577
20578
20579
20580
20581
20582
20583
20584
20585
20586
20587
20588
20589
20590
20591
20592
20593
20594
20595
20596
20597
20598
20599
20600
20601
20602
20603
20604
20605
20606
20607
20608
20609
20610
20611
20612
20613
20614
20615
20616
20617
20618
20619
20620
20621
20622
20623
20624
20625
20626
20627
20628
20629
20630
20631
20632
20633
20634
20635
20636
20637
20638
20639
20640
20641
20642
20643
20644
20645
20646
20647
20648
20649
20650
20651
20652
20653
20654
20655
20656
20657
20658
20659
20660
20661
20662
20663
20664
20665
20666
20667
20668
20669
20670
20671
20672
20673
20674
20675
20676
20677
20678
20679
20680
20681
20682
20683
20684
20685
20686
20687
20688
20689
20690
20691
20692
20693
20694
20695
20696
20697
20698
20699
20700
20701
20702
20703
20704
20705
20706
20707
20708
20709
20710
20711
20712
20713
20714
20715
20716
20717
20718
20719
20720
20721
20722
20723
20724
20725
20726
20727
20728
20729
20730
20731
20732
20733
20734
20735
20736
20737
20738
20739
20740
20741
20742
20743
20744
20745
20746
20747
20748
20749
20750
20751
20752
20753
20754
20755
20756
20757
20758
20759
20760
20761
20762
20763
20764
20765
20766
20767
20768
20769
20770
20771
20772
20773
20774
20775
20776
20777
20778
20779
20780
20781
20782
20783
20784
20785
20786
20787
20788
20789
20790
20791
20792
20793
20794
20795
20796
20797
20798
20799
20800
20801
20802
20803
20804
20805
20806
20807
20808
20809
20810
20811
20812
20813
20814
20815
20816
20817
20818
20819
20820
20821
20822
20823
20824
20825
20826
20827
20828
20829
20830
20831
20832
20833
20834
20835
20836
20837
20838
20839
20840
20841
20842
20843
20844
20845
20846
20847
20848
20849
20850
20851
20852
20853
20854
20855
20856
20857
20858
20859
20860
20861
20862
20863
20864
20865
20866
20867
20868
20869
20870
20871
20872
20873
20874
20875
20876
20877
20878
20879
20880
20881
20882
20883
20884
20885
20886
20887
20888
20889
20890
20891
20892
20893
20894
20895
20896
20897
20898
20899
20900
20901
20902
20903
20904
20905
20906
20907
20908
20909
20910
20911
20912
20913
20914
20915
20916
20917
20918
20919
20920
20921
20922
20923
20924
20925
20926
20927
20928
20929
20930
20931
20932
20933
20934
20935
20936
20937
20938
20939
20940
20941
20942
20943
20944
20945
20946
20947
20948
20949
20950
20951
20952
20953
20954
20955
20956
20957
20958
20959
20960
20961
20962
20963
20964
20965
20966
20967
20968
20969
20970
20971
20972
20973
20974
20975
20976
20977
20978
20979
20980
20981
20982
20983
20984
20985
20986
20987
20988
20989
20990
20991
20992
20993
20994
20995
20996
20997
20998
20999
21000
21001
21002
21003
21004
21005
21006
21007
21008
21009
21010
21011
21012
21013
21014
21015
21016
21017
21018
21019
21020
21021
21022
21023
21024
21025
21026
21027
21028
21029
21030
21031
21032
21033
21034
21035
21036
21037
21038
21039
21040
21041
21042
21043
21044
21045
21046
21047
21048
21049
21050
21051
21052
21053
21054
21055
21056
21057
21058
21059
21060
21061
21062
21063
21064
21065
21066
21067
21068
21069
21070
21071
21072
21073
21074
21075
21076
21077
21078
21079
21080
21081
21082
21083
21084
21085
21086
21087
21088
21089
21090
21091
21092
21093
21094
21095
21096
21097
21098
21099
21100
21101
21102
21103
21104
21105
21106
21107
21108
21109
21110
21111
21112
21113
21114
21115
21116
21117
21118
21119
21120
21121
21122
21123
21124
21125
21126
21127
21128
21129
21130
21131
21132
21133
21134
21135
21136
21137
21138
21139
21140
21141
21142
21143
21144
21145
21146
21147
21148
21149
21150
21151
21152
21153
21154
21155
21156
21157
21158
21159
21160
21161
21162
21163
21164
21165
21166
21167
21168
21169
21170
21171
21172
21173
21174
21175
21176
21177
21178
21179
21180
21181
21182
21183
21184
21185
21186
21187
21188
21189
21190
21191
21192
21193
21194
21195
21196
21197
21198
21199
21200
21201
21202
21203
21204
21205
21206
21207
21208
21209
21210
21211
21212
21213
21214
21215
21216
21217
21218
21219
21220
21221
21222
21223
21224
21225
21226
21227
21228
21229
21230
21231
21232
21233
21234
21235
21236
21237
21238
21239
21240
21241
21242
21243
21244
21245
21246
21247
21248
21249
21250
21251
21252
21253
21254
21255
21256
21257
21258
21259
21260
21261
21262
21263
21264
21265
21266
21267
21268
21269
21270
21271
21272
21273
21274
21275
21276
21277
21278
21279
21280
21281
21282
21283
21284
21285
21286
21287
21288
21289
21290
21291
21292
21293
21294
21295
21296
21297
21298
21299
21300
21301
21302
21303
21304
21305
21306
21307
21308
21309
21310
21311
21312
21313
21314
21315
21316
21317
21318
21319
21320
21321
21322
21323
21324
21325
21326
21327
21328
21329
21330
21331
21332
21333
21334
21335
21336
21337
21338
21339
21340
21341
21342
21343
21344
21345
21346
21347
21348
21349
21350
21351
21352
21353
21354
21355
21356
21357
21358
21359
21360
21361
21362
21363
21364
21365
21366
21367
21368
21369
21370
21371
21372
21373
21374
21375
21376
21377
21378
21379
21380
21381
21382
21383
21384
21385
21386
21387
21388
21389
21390
21391
21392
21393
21394
21395
21396
21397
21398
21399
21400
21401
21402
21403
21404
21405
21406
21407
21408
21409
21410
21411
21412
21413
21414
21415
21416
21417
21418
21419
21420
21421
21422
21423
21424
21425
21426
21427
21428
21429
21430
21431
21432
21433
21434
21435
21436
21437
21438
21439
21440
21441
21442
21443
21444
21445
21446
21447
21448
21449
21450
21451
21452
21453
21454
21455
21456
21457
21458
21459
21460
21461
21462
21463
21464
21465
21466
21467
21468
21469
21470
21471
21472
21473
21474
21475
21476
21477
21478
21479
21480
21481
21482
21483
21484
21485
21486
21487
21488
21489
21490
21491
21492
21493
21494
21495
21496
21497
21498
21499
21500
21501
21502
21503
21504
21505
21506
21507
21508
21509
21510
21511
21512
21513
21514
21515
21516
21517
21518
21519
21520
21521
21522
21523
21524
21525
21526
21527
21528
21529
21530
21531
21532
21533
21534
21535
21536
21537
21538
21539
21540
21541
21542
21543
21544
21545
21546
21547
21548
21549
21550
21551
21552
21553
21554
21555
21556
21557
21558
21559
21560
21561
21562
21563
21564
21565
21566
21567
21568
21569
21570
21571
21572
21573
21574
21575
21576
21577
21578
21579
21580
21581
21582
21583
21584
21585
21586
21587
21588
21589
21590
21591
21592
21593
21594
21595
21596
21597
21598
21599
21600
21601
21602
21603
21604
21605
21606
21607
21608
21609
21610
21611
21612
21613
21614
21615
21616
21617
21618
21619
21620
21621
21622
21623
21624
21625
21626
21627
21628
21629
21630
21631
21632
21633
21634
21635
21636
21637
21638
21639
21640
21641
21642
21643
21644
21645
21646
21647
21648
21649
21650
21651
21652
21653
21654
21655
21656
21657
21658
21659
21660
21661
21662
21663
21664
21665
21666
21667
21668
21669
21670
21671
21672
21673
21674
21675
21676
21677
21678
21679
21680
21681
21682
21683
21684
21685
21686
21687
21688
21689
21690
21691
21692
21693
21694
21695
21696
21697
21698
21699
21700
21701
21702
21703
21704
21705
21706
21707
21708
21709
21710
21711
21712
21713
21714
21715
21716
21717
21718
21719
21720
21721
21722
21723
21724
21725
21726
21727
21728
21729
21730
21731
21732
21733
21734
21735
21736
21737
21738
21739
21740
21741
21742
21743
21744
21745
21746
21747
21748
21749
21750
21751
21752
21753
21754
21755
21756
21757
21758
21759
21760
21761
21762
21763
21764
21765
21766
21767
21768
21769
21770
21771
21772
21773
21774
21775
21776
21777
21778
21779
21780
21781
21782
21783
21784
21785
21786
21787
21788
21789
21790
21791
21792
21793
21794
21795
21796
21797
21798
21799
21800
21801
21802
21803
21804
21805
21806
21807
21808
21809
21810
21811
21812
21813
21814
21815
21816
21817
21818
21819
21820
21821
21822
21823
21824
21825
21826
21827
21828
21829
21830
21831
21832
21833
21834
21835
21836
21837
21838
21839
21840
21841
21842
21843
21844
21845
21846
21847
21848
21849
21850
21851
21852
21853
21854
21855
21856
21857
21858
21859
21860
21861
21862
21863
21864
21865
21866
21867
21868
21869
21870
21871
21872
21873
21874
21875
21876
21877
21878
21879
21880
21881
21882
21883
21884
21885
21886
21887
21888
21889
21890
21891
21892
21893
21894
21895
21896
21897
21898
21899
21900
21901
21902
21903
21904
21905
21906
21907
21908
21909
21910
21911
21912
21913
21914
21915
21916
21917
21918
21919
21920
21921
21922
21923
21924
21925
21926
21927
21928
21929
21930
21931
21932
21933
21934
21935
21936
21937
21938
21939
21940
21941
21942
21943
21944
21945
21946
21947
21948
21949
21950
21951
21952
21953
21954
21955
21956
21957
21958
21959
21960
21961
21962
21963
21964
21965
21966
21967
21968
21969
21970
21971
21972
21973
21974
21975
21976
21977
21978
21979
21980
21981
21982
21983
21984
21985
21986
21987
21988
21989
21990
21991
21992
21993
21994
21995
21996
21997
21998
21999
22000
22001
22002
22003
22004
22005
22006
22007
22008
22009
22010
22011
22012
22013
22014
22015
22016
22017
22018
22019
22020
22021
22022
22023
22024
22025
22026
22027
22028
22029
22030
22031
22032
22033
22034
22035
22036
22037
22038
22039
22040
22041
22042
22043
22044
22045
22046
22047
22048
22049
22050
22051
22052
22053
22054
22055
22056
22057
22058
22059
22060
22061
22062
22063
22064
22065
22066
22067
22068
22069
22070
22071
22072
22073
22074
22075
22076
22077
22078
22079
22080
22081
22082
22083
22084
22085
22086
22087
22088
22089
22090
22091
22092
22093
22094
22095
22096
22097
22098
22099
22100
22101
22102
22103
22104
22105
22106
22107
22108
22109
22110
22111
22112
22113
22114
22115
22116
22117
22118
22119
22120
22121
22122
22123
22124
22125
22126
22127
22128
22129
22130
22131
22132
22133
22134
22135
22136
22137
22138
22139
22140
22141
22142
22143
22144
22145
22146
22147
22148
22149
22150
22151
22152
22153
22154
22155
22156
22157
22158
22159
22160
22161
22162
22163
22164
22165
22166
22167
22168
22169
22170
22171
22172
22173
22174
22175
22176
22177
22178
22179
22180
22181
22182
22183
22184
22185
22186
22187
22188
22189
22190
22191
22192
22193
22194
22195
22196
22197
22198
22199
22200
22201
22202
22203
22204
22205
22206
22207
22208
22209
22210
22211
22212
22213
22214
22215
22216
22217
22218
22219
22220
22221
22222
22223
22224
22225
22226
22227
22228
22229
22230
22231
22232
22233
22234
22235
22236
22237
22238
22239
22240
22241
22242
22243
22244
22245
22246
22247
22248
22249
22250
22251
22252
22253
22254
22255
22256
22257
22258
22259
22260
22261
22262
22263
22264
22265
22266
22267
22268
22269
22270
22271
22272
22273
22274
22275
22276
22277
22278
22279
22280
22281
22282
22283
22284
22285
22286
22287
22288
22289
22290
22291
22292
22293
22294
22295
22296
22297
22298
22299
22300
22301
22302
22303
22304
22305
22306
22307
22308
22309
22310
22311
22312
22313
22314
22315
22316
22317
22318
22319
22320
22321
22322
22323
22324
22325
22326
22327
22328
22329
22330
22331
22332
22333
22334
22335
22336
22337
22338
22339
22340
22341
22342
22343
22344
22345
22346
22347
22348
22349
22350
22351
22352
22353
22354
22355
22356
22357
22358
22359
22360
22361
22362
22363
22364
22365
22366
22367
22368
22369
22370
22371
22372
22373
22374
22375
22376
22377
22378
22379
22380
22381
22382
22383
22384
22385
22386
22387
22388
22389
22390
22391
22392
22393
22394
22395
22396
22397
22398
22399
22400
22401
22402
22403
22404
22405
22406
22407
22408
22409
22410
22411
22412
22413
22414
22415
22416
22417
22418
22419
22420
22421
22422
22423
22424
22425
22426
22427
22428
22429
22430
22431
22432
22433
22434
22435
22436
22437
22438
22439
22440
22441
22442
22443
22444
22445
22446
22447
22448
22449
22450
22451
22452
22453
22454
22455
22456
22457
22458
22459
22460
22461
22462
22463
22464
22465
22466
22467
22468
22469
22470
22471
22472
22473
22474
22475
22476
22477
22478
22479
22480
22481
22482
22483
22484
22485
22486
22487
22488
22489
22490
22491
22492
22493
22494
22495
22496
22497
22498
22499
22500
22501
22502
22503
22504
22505
22506
22507
22508
22509
22510
22511
22512
22513
22514
22515
22516
22517
22518
22519
22520
22521
22522
22523
22524
22525
22526
22527
22528
22529
22530
22531
22532
22533
22534
22535
22536
22537
22538
22539
22540
22541
22542
22543
22544
22545
22546
22547
22548
22549
22550
22551
22552
22553
22554
22555
22556
22557
22558
22559
22560
22561
22562
22563
22564
22565
22566
22567
22568
22569
22570
22571
22572
22573
22574
22575
22576
22577
22578
22579
22580
22581
22582
22583
22584
22585
22586
22587
22588
22589
22590
22591
22592
22593
22594
22595
22596
22597
22598
22599
22600
22601
22602
22603
22604
22605
22606
22607
22608
22609
22610
22611
22612
22613
22614
22615
22616
22617
22618
22619
22620
22621
22622
22623
22624
22625
22626
22627
22628
22629
22630
22631
22632
22633
22634
22635
22636
22637
22638
22639
22640
22641
22642
22643
22644
22645
22646
22647
22648
22649
22650
22651
22652
22653
22654
22655
22656
22657
22658
22659
22660
22661
22662
22663
22664
22665
22666
22667
22668
22669
22670
22671
22672
22673
22674
22675
22676
22677
22678
22679
22680
22681
22682
22683
22684
22685
22686
22687
22688
22689
22690
22691
22692
22693
22694
22695
22696
22697
22698
22699
22700
22701
22702
22703
22704
22705
22706
22707
22708
22709
22710
22711
22712
22713
22714
22715
22716
22717
22718
22719
22720
22721
22722
22723
22724
22725
22726
22727
22728
22729
22730
22731
22732
22733
22734
22735
22736
22737
22738
22739
22740
22741
22742
22743
22744
22745
22746
22747
22748
22749
22750
22751
22752
22753
22754
22755
22756
22757
22758
22759
22760
22761
22762
22763
22764
22765
22766
22767
22768
22769
22770
22771
22772
22773
22774
22775
22776
22777
22778
22779
22780
22781
22782
22783
22784
22785
22786
22787
22788
22789
22790
22791
22792
22793
22794
22795
22796
22797
22798
22799
22800
22801
22802
22803
22804
22805
22806
22807
22808
22809
22810
22811
22812
22813
22814
22815
22816
22817
22818
22819
22820
22821
22822
22823
22824
22825
22826
22827
22828
22829
22830
22831
22832
22833
22834
22835
22836
22837
22838
22839
22840
22841
22842
22843
22844
22845
22846
22847
22848
22849
22850
22851
22852
22853
22854
22855
22856
22857
22858
22859
22860
22861
22862
22863
22864
22865
22866
22867
22868
22869
22870
22871
22872
22873
22874
22875
22876
22877
22878
22879
22880
22881
22882
22883
22884
22885
22886
22887
22888
22889
22890
22891
22892
22893
22894
22895
22896
22897
22898
22899
22900
22901
22902
22903
22904
22905
22906
22907
22908
22909
22910
22911
22912
22913
22914
22915
22916
22917
22918
22919
22920
22921
22922
22923
22924
22925
22926
22927
22928
22929
22930
22931
22932
22933
22934
22935
22936
22937
22938
22939
22940
22941
22942
22943
22944
22945
22946
22947
22948
22949
22950
22951
22952
22953
22954
22955
22956
22957
22958
22959
22960
22961
22962
22963
22964
22965
22966
22967
22968
22969
22970
22971
22972
22973
22974
22975
22976
22977
22978
22979
22980
22981
22982
22983
22984
22985
22986
22987
22988
22989
22990
22991
22992
22993
22994
22995
22996
22997
22998
22999
23000
23001
23002
23003
23004
23005
23006
23007
23008
23009
23010
23011
23012
23013
23014
23015
23016
23017
23018
23019
23020
23021
23022
23023
23024
23025
23026
23027
23028
23029
23030
23031
23032
23033
23034
23035
23036
23037
23038
23039
23040
23041
23042
23043
23044
23045
23046
23047
23048
23049
23050
23051
23052
23053
23054
23055
23056
23057
23058
23059
23060
23061
23062
23063
23064
23065
23066
23067
23068
23069
23070
23071
23072
23073
23074
23075
23076
23077
23078
23079
23080
23081
23082
23083
23084
23085
23086
23087
23088
23089
23090
23091
23092
23093
23094
23095
23096
23097
23098
23099
23100
23101
23102
23103
23104
23105
23106
23107
23108
23109
23110
23111
23112
23113
23114
23115
23116
23117
23118
23119
23120
23121
23122
23123
23124
23125
23126
23127
23128
23129
23130
23131
23132
23133
23134
23135
23136
23137
23138
23139
23140
23141
23142
23143
23144
23145
23146
23147
23148
23149
23150
23151
23152
23153
23154
23155
23156
23157
23158
23159
23160
23161
23162
23163
23164
23165
23166
23167
23168
23169
23170
23171
23172
23173
23174
23175
23176
23177
23178
23179
23180
23181
23182
23183
23184
23185
23186
23187
23188
23189
23190
23191
23192
23193
23194
23195
23196
23197
23198
23199
23200
23201
23202
23203
23204
23205
23206
23207
23208
23209
23210
23211
23212
23213
23214
23215
23216
23217
23218
23219
23220
23221
23222
23223
23224
23225
23226
23227
23228
23229
23230
23231
23232
23233
23234
23235
23236
23237
23238
23239
23240
23241
23242
23243
23244
23245
23246
23247
23248
23249
23250
23251
23252
23253
23254
23255
23256
23257
23258
23259
23260
23261
23262
23263
23264
23265
23266
23267
23268
23269
23270
23271
23272
23273
23274
23275
23276
23277
23278
23279
23280
23281
23282
23283
23284
23285
23286
23287
23288
23289
23290
23291
23292
23293
23294
23295
23296
23297
23298
23299
23300
23301
23302
23303
23304
23305
23306
23307
23308
23309
23310
23311
23312
23313
23314
23315
23316
23317
23318
23319
23320
23321
23322
23323
23324
23325
23326
23327
23328
23329
23330
23331
23332
23333
23334
23335
23336
23337
23338
23339
23340
23341
23342
23343
23344
23345
23346
23347
23348
23349
23350
23351
23352
23353
23354
23355
23356
23357
23358
23359
23360
23361
23362
23363
23364
23365
23366
23367
23368
23369
23370
23371
23372
23373
23374
23375
23376
23377
23378
23379
23380
23381
23382
23383
23384
23385
23386
23387
23388
23389
23390
23391
23392
23393
23394
23395
23396
23397
23398
23399
23400
23401
23402
23403
23404
23405
23406
23407
23408
23409
23410
23411
23412
23413
23414
23415
23416
23417
23418
23419
23420
23421
23422
23423
23424
23425
23426
23427
23428
23429
23430
23431
23432
23433
23434
23435
23436
23437
23438
23439
23440
23441
23442
23443
23444
23445
23446
23447
23448
23449
23450
23451
23452
23453
23454
23455
23456
23457
23458
23459
23460
23461
23462
23463
23464
23465
23466
23467
23468
23469
23470
23471
23472
23473
23474
23475
23476
23477
23478
23479
23480
23481
23482
23483
23484
23485
23486
23487
23488
23489
23490
23491
23492
23493
23494
23495
23496
23497
23498
23499
23500
23501
23502
23503
23504
23505
23506
23507
23508
23509
23510
23511
23512
23513
23514
23515
23516
23517
23518
23519
23520
23521
23522
23523
23524
23525
23526
23527
23528
23529
23530
23531
23532
23533
23534
23535
23536
23537
23538
23539
23540
23541
23542
23543
23544
23545
23546
23547
23548
23549
23550
23551
23552
23553
23554
23555
23556
23557
23558
23559
23560
23561
23562
23563
23564
23565
23566
23567
23568
23569
23570
23571
23572
23573
23574
23575
23576
23577
23578
23579
23580
23581
23582
23583
23584
23585
23586
23587
23588
23589
23590
23591
23592
23593
23594
23595
23596
23597
23598
23599
23600
23601
23602
23603
23604
23605
23606
23607
23608
23609
23610
23611
23612
23613
23614
23615
23616
23617
23618
23619
23620
23621
23622
23623
23624
23625
23626
23627
23628
23629
23630
23631
23632
23633
23634
23635
23636
23637
23638
23639
23640
23641
23642
23643
23644
23645
23646
23647
23648
23649
23650
23651
23652
23653
23654
23655
23656
23657
23658
23659
23660
23661
23662
23663
23664
23665
23666
23667
23668
23669
23670
23671
23672
23673
23674
23675
23676
23677
23678
23679
23680
23681
23682
23683
23684
23685
23686
23687
23688
23689
23690
23691
23692
23693
23694
23695
23696
23697
23698
23699
23700
23701
23702
23703
23704
23705
23706
23707
23708
23709
23710
23711
23712
23713
23714
23715
23716
23717
23718
23719
23720
23721
23722
23723
23724
23725
23726
23727
23728
23729
23730
23731
23732
23733
23734
23735
23736
23737
23738
23739
23740
23741
23742
23743
23744
23745
23746
23747
23748
23749
23750
23751
23752
23753
23754
23755
23756
23757
23758
23759
23760
23761
23762
23763
23764
23765
23766
23767
23768
23769
23770
23771
23772
23773
23774
23775
23776
23777
23778
23779
23780
23781
23782
23783
23784
23785
23786
23787
23788
23789
23790
23791
23792
23793
23794
23795
23796
23797
23798
23799
23800
23801
23802
23803
23804
23805
23806
23807
23808
23809
23810
23811
23812
23813
23814
23815
23816
23817
23818
23819
23820
23821
23822
23823
23824
23825
23826
23827
23828
23829
23830
23831
23832
23833
23834
23835
23836
23837
23838
23839
23840
23841
23842
23843
23844
23845
23846
23847
23848
23849
23850
23851
23852
23853
23854
23855
23856
23857
23858
23859
23860
23861
23862
23863
23864
23865
23866
23867
23868
23869
23870
23871
23872
23873
23874
23875
23876
23877
23878
23879
23880
23881
23882
23883
23884
23885
23886
23887
23888
23889
23890
23891
23892
23893
23894
23895
23896
23897
23898
23899
23900
23901
23902
23903
23904
23905
23906
23907
23908
23909
23910
23911
23912
23913
23914
23915
23916
23917
23918
23919
23920
23921
23922
23923
23924
23925
23926
23927
23928
23929
23930
23931
23932
23933
23934
23935
23936
23937
23938
23939
23940
23941
23942
23943
23944
23945
23946
23947
23948
23949
23950
23951
23952
23953
23954
23955
23956
23957
23958
23959
23960
23961
23962
23963
23964
23965
23966
23967
23968
23969
23970
23971
23972
23973
23974
23975
23976
23977
23978
23979
23980
23981
23982
23983
23984
23985
23986
23987
23988
23989
23990
23991
23992
23993
23994
23995
23996
23997
23998
23999
24000
24001
24002
24003
24004
24005
24006
24007
24008
24009
24010
24011
24012
24013
24014
24015
24016
24017
24018
24019
24020
24021
24022
24023
24024
24025
24026
24027
24028
24029
24030
24031
24032
24033
24034
24035
24036
24037
24038
24039
24040
24041
24042
24043
24044
24045
24046
24047
24048
24049
24050
24051
24052
24053
24054
24055
24056
24057
24058
24059
24060
24061
24062
24063
24064
24065
24066
24067
24068
24069
24070
24071
24072
24073
24074
24075
24076
24077
24078
24079
24080
24081
24082
24083
24084
24085
24086
24087
24088
24089
24090
24091
24092
24093
24094
24095
24096
24097
24098
24099
24100
24101
24102
24103
24104
24105
24106
24107
24108
24109
24110
24111
24112
24113
24114
24115
24116
24117
24118
24119
24120
24121
24122
24123
24124
24125
24126
24127
24128
24129
24130
24131
24132
24133
24134
24135
24136
24137
24138
24139
24140
24141
24142
24143
24144
24145
24146
24147
24148
24149
24150
24151
24152
24153
24154
24155
24156
24157
24158
24159
24160
24161
24162
24163
24164
24165
24166
24167
24168
24169
24170
24171
24172
24173
24174
24175
24176
24177
24178
24179
24180
24181
24182
24183
24184
24185
24186
24187
24188
24189
24190
24191
24192
24193
24194
24195
24196
24197
24198
24199
24200
24201
24202
24203
24204
24205
24206
24207
24208
24209
24210
24211
24212
24213
24214
24215
24216
24217
24218
24219
24220
24221
24222
24223
24224
24225
24226
24227
24228
24229
24230
24231
24232
24233
24234
24235
24236
24237
24238
24239
24240
24241
24242
24243
24244
24245
24246
24247
24248
24249
24250
24251
24252
24253
24254
24255
24256
24257
24258
24259
24260
24261
24262
24263
24264
24265
24266
24267
24268
24269
24270
24271
24272
24273
24274
24275
24276
24277
24278
24279
24280
24281
24282
24283
24284
24285
24286
24287
24288
24289
24290
24291
24292
24293
24294
24295
24296
24297
24298
24299
24300
24301
24302
24303
24304
24305
24306
24307
24308
24309
24310
24311
24312
24313
24314
24315
24316
24317
24318
24319
24320
24321
24322
24323
24324
24325
24326
24327
24328
24329
24330
24331
24332
24333
24334
24335
24336
24337
24338
24339
24340
24341
24342
24343
24344
24345
24346
24347
24348
24349
24350
24351
24352
24353
24354
24355
24356
24357
24358
24359
24360
24361
24362
24363
24364
24365
24366
24367
24368
24369
24370
24371
24372
24373
24374
24375
24376
24377
24378
24379
24380
24381
24382
24383
24384
24385
24386
24387
24388
24389
24390
24391
24392
24393
24394
24395
24396
24397
24398
24399
24400
24401
24402
24403
24404
24405
24406
24407
24408
24409
24410
24411
24412
24413
24414
24415
24416
24417
24418
24419
24420
24421
24422
24423
24424
24425
24426
24427
24428
24429
24430
24431
24432
24433
24434
24435
24436
24437
24438
24439
24440
24441
24442
24443
24444
24445
24446
24447
24448
24449
24450
24451
24452
24453
24454
24455
24456
24457
24458
24459
24460
24461
24462
24463
24464
24465
24466
24467
24468
24469
24470
24471
24472
24473
24474
24475
24476
24477
24478
24479
24480
24481
24482
24483
24484
24485
24486
24487
24488
24489
24490
24491
24492
24493
24494
24495
24496
24497
24498
24499
24500
24501
24502
24503
24504
24505
24506
24507
24508
24509
24510
24511
24512
24513
24514
24515
24516
24517
24518
24519
24520
24521
24522
24523
24524
24525
24526
24527
24528
24529
24530
24531
24532
24533
24534
24535
24536
24537
24538
24539
24540
24541
24542
24543
24544
24545
24546
24547
24548
24549
24550
24551
24552
24553
24554
24555
24556
24557
24558
24559
24560
24561
24562
24563
24564
24565
24566
24567
24568
24569
24570
24571
24572
24573
24574
24575
24576
24577
24578
24579
24580
24581
24582
24583
24584
24585
24586
24587
24588
24589
24590
24591
24592
24593
24594
24595
24596
24597
24598
24599
24600
24601
24602
24603
24604
24605
24606
24607
24608
24609
24610
24611
24612
24613
24614
24615
24616
24617
24618
24619
24620
24621
24622
24623
24624
24625
24626
24627
24628
24629
24630
24631
24632
24633
24634
24635
24636
24637
24638
24639
24640
24641
24642
24643
24644
24645
24646
24647
24648
24649
24650
24651
24652
24653
24654
24655
24656
24657
24658
24659
24660
24661
24662
24663
24664
24665
24666
24667
24668
24669
24670
24671
24672
24673
24674
24675
24676
24677
24678
24679
24680
24681
24682
24683
24684
24685
24686
24687
24688
24689
24690
24691
24692
24693
24694
24695
24696
24697
24698
24699
24700
24701
24702
24703
24704
24705
24706
24707
24708
24709
24710
24711
24712
24713
24714
24715
24716
24717
24718
24719
24720
24721
24722
24723
24724
24725
24726
24727
24728
24729
24730
24731
24732
24733
24734
24735
24736
24737
24738
24739
24740
24741
24742
24743
24744
24745
24746
24747
24748
24749
24750
24751
24752
24753
24754
24755
24756
24757
24758
24759
24760
24761
24762
24763
24764
24765
24766
24767
24768
24769
24770
24771
24772
24773
24774
24775
24776
24777
24778
24779
24780
24781
24782
24783
24784
24785
24786
24787
24788
24789
24790
24791
24792
24793
24794
24795
24796
24797
24798
24799
24800
24801
24802
24803
24804
24805
24806
24807
24808
24809
24810
24811
24812
24813
24814
24815
24816
24817
24818
24819
24820
24821
24822
24823
24824
24825
24826
24827
24828
24829
24830
24831
24832
24833
24834
24835
24836
24837
24838
24839
24840
24841
24842
24843
24844
24845
24846
24847
24848
24849
24850
24851
24852
24853
24854
24855
24856
24857
24858
24859
24860
24861
24862
24863
24864
24865
24866
24867
24868
24869
24870
24871
24872
24873
24874
24875
24876
24877
24878
24879
24880
24881
24882
24883
24884
24885
24886
24887
24888
24889
24890
24891
24892
24893
24894
24895
24896
24897
24898
24899
24900
24901
24902
24903
24904
24905
24906
24907
24908
24909
24910
24911
24912
24913
24914
24915
24916
24917
24918
24919
24920
24921
24922
24923
24924
24925
24926
24927
24928
24929
24930
24931
24932
24933
24934
24935
24936
24937
24938
24939
24940
24941
24942
24943
24944
24945
24946
24947
24948
24949
24950
24951
24952
24953
24954
24955
24956
24957
24958
24959
24960
24961
24962
24963
24964
24965
24966
24967
24968
24969
24970
24971
24972
24973
24974
24975
24976
24977
24978
24979
24980
24981
24982
24983
24984
24985
24986
24987
24988
24989
24990
24991
24992
24993
24994
24995
24996
24997
24998
24999
25000
25001
25002
25003
25004
25005
25006
25007
25008
25009
25010
25011
25012
25013
25014
25015
25016
25017
25018
25019
25020
25021
25022
25023
25024
25025
25026
25027
25028
25029
25030
25031
25032
25033
25034
25035
25036
25037
25038
25039
25040
25041
25042
25043
25044
25045
25046
25047
25048
25049
25050
25051
25052
25053
25054
25055
25056
25057
25058
25059
25060
25061
25062
25063
25064
25065
25066
25067
25068
25069
25070
25071
25072
25073
25074
25075
25076
25077
25078
25079
25080
25081
25082
25083
25084
25085
25086
25087
25088
25089
25090
25091
25092
25093
25094
25095
25096
25097
25098
25099
25100
25101
25102
25103
25104
25105
25106
25107
25108
25109
25110
25111
25112
25113
25114
25115
25116
25117
25118
25119
25120
25121
25122
25123
25124
25125
25126
25127
25128
25129
25130
25131
25132
25133
25134
25135
25136
25137
25138
25139
25140
25141
25142
25143
25144
25145
25146
25147
25148
25149
25150
25151
25152
25153
25154
25155
25156
25157
25158
25159
25160
25161
25162
25163
25164
25165
25166
25167
25168
25169
25170
25171
25172
25173
25174
25175
25176
25177
25178
25179
25180
25181
25182
25183
25184
25185
25186
25187
25188
25189
25190
25191
25192
25193
25194
25195
25196
25197
25198
25199
25200
25201
25202
25203
25204
25205
25206
25207
25208
25209
25210
25211
25212
25213
25214
25215
25216
25217
25218
25219
25220
25221
25222
25223
25224
25225
25226
25227
25228
25229
25230
25231
25232
25233
25234
25235
25236
25237
25238
25239
25240
25241
25242
25243
25244
25245
25246
25247
25248
25249
25250
25251
25252
25253
25254
25255
25256
25257
25258
25259
25260
25261
25262
25263
25264
25265
25266
25267
25268
25269
25270
25271
25272
25273
25274
25275
25276
25277
25278
25279
25280
25281
25282
25283
25284
25285
25286
25287
25288
25289
25290
25291
25292
25293
25294
25295
25296
25297
25298
25299
25300
25301
25302
25303
25304
25305
25306
25307
25308
25309
25310
25311
25312
25313
25314
25315
25316
25317
25318
25319
25320
25321
25322
25323
25324
25325
25326
25327
25328
25329
25330
25331
25332
25333
25334
25335
25336
25337
25338
25339
25340
25341
25342
25343
25344
25345
25346
25347
25348
25349
25350
25351
25352
25353
25354
25355
25356
25357
25358
25359
25360
25361
25362
25363
25364
25365
25366
25367
25368
25369
25370
25371
25372
25373
25374
25375
25376
25377
25378
25379
25380
25381
25382
25383
25384
25385
25386
25387
25388
25389
25390
25391
25392
25393
25394
25395
25396
25397
25398
25399
25400
25401
25402
25403
25404
25405
25406
25407
25408
25409
25410
25411
25412
25413
25414
25415
25416
25417
25418
25419
25420
25421
25422
25423
25424
25425
25426
25427
25428
25429
25430
25431
25432
25433
25434
25435
25436
25437
25438
25439
25440
25441
25442
25443
25444
25445
25446
25447
25448
25449
25450
25451
25452
25453
25454
25455
25456
25457
25458
25459
25460
25461
25462
25463
25464
25465
25466
25467
25468
25469
25470
25471
25472
25473
25474
25475
25476
25477
25478
25479
25480
25481
25482
25483
25484
25485
25486
25487
25488
25489
25490
25491
25492
25493
25494
25495
25496
25497
25498
25499
25500
25501
25502
25503
25504
25505
25506
25507
25508
25509
25510
25511
25512
25513
25514
25515
25516
25517
25518
25519
25520
25521
25522
25523
25524
25525
25526
25527
25528
25529
25530
25531
25532
25533
25534
25535
25536
25537
25538
25539
25540
25541
25542
25543
25544
25545
25546
25547
25548
25549
25550
25551
25552
25553
25554
25555
25556
25557
25558
25559
25560
25561
25562
25563
25564
25565
25566
25567
25568
25569
25570
25571
25572
25573
25574
25575
25576
25577
25578
25579
25580
25581
25582
25583
25584
25585
25586
25587
25588
25589
25590
25591
25592
25593
25594
25595
25596
25597
25598
25599
25600
25601
25602
25603
25604
25605
25606
25607
25608
25609
25610
25611
25612
25613
25614
25615
25616
25617
25618
25619
25620
25621
25622
25623
25624
25625
25626
25627
25628
25629
25630
25631
25632
25633
25634
25635
25636
25637
25638
25639
25640
25641
25642
25643
25644
25645
25646
25647
25648
25649
25650
25651
25652
25653
25654
25655
25656
25657
25658
25659
25660
25661
25662
25663
25664
25665
25666
25667
25668
25669
25670
25671
25672
25673
25674
25675
25676
25677
25678
25679
25680
25681
25682
25683
25684
25685
25686
25687
25688
25689
25690
25691
25692
25693
25694
25695
25696
25697
25698
25699
25700
25701
25702
25703
25704
25705
25706
25707
25708
25709
25710
25711
25712
25713
25714
25715
25716
25717
25718
25719
25720
25721
25722
25723
25724
25725
25726
25727
25728
25729
25730
25731
25732
25733
25734
25735
25736
25737
25738
25739
25740
25741
25742
25743
25744
25745
25746
25747
25748
25749
25750
25751
25752
25753
25754
25755
25756
25757
25758
25759
25760
25761
25762
25763
25764
25765
25766
25767
25768
25769
25770
25771
25772
25773
25774
25775
25776
25777
25778
25779
25780
25781
25782
25783
25784
25785
25786
25787
25788
25789
25790
25791
25792
25793
25794
25795
25796
25797
25798
25799
25800
25801
25802
25803
25804
25805
25806
25807
25808
25809
25810
25811
25812
25813
25814
25815
25816
25817
25818
25819
25820
25821
25822
25823
25824
25825
25826
25827
25828
25829
25830
25831
25832
25833
25834
25835
25836
25837
25838
25839
25840
25841
25842
25843
25844
25845
25846
25847
25848
25849
25850
25851
25852
25853
25854
25855
25856
25857
25858
25859
25860
25861
25862
25863
25864
25865
25866
25867
25868
25869
25870
25871
25872
25873
25874
25875
25876
25877
25878
25879
25880
25881
25882
25883
25884
25885
25886
25887
25888
25889
25890
25891
25892
25893
25894
25895
25896
25897
25898
25899
25900
25901
25902
25903
25904
25905
25906
25907
25908
25909
25910
25911
25912
25913
25914
25915
25916
25917
25918
25919
25920
25921
25922
25923
25924
25925
25926
25927
25928
25929
25930
25931
25932
25933
25934
25935
25936
25937
25938
25939
25940
25941
25942
25943
25944
25945
25946
25947
25948
25949
25950
25951
25952
25953
25954
25955
25956
25957
25958
25959
25960
25961
25962
25963
25964
25965
25966
25967
25968
25969
25970
25971
25972
25973
25974
25975
25976
25977
25978
25979
25980
25981
25982
25983
25984
25985
25986
25987
25988
25989
25990
25991
25992
25993
25994
25995
25996
25997
25998
25999
26000
26001
26002
26003
26004
26005
26006
26007
26008
26009
26010
26011
26012
26013
26014
26015
26016
26017
26018
26019
26020
26021
26022
26023
26024
26025
26026
26027
26028
26029
26030
26031
26032
26033
26034
26035
26036
26037
26038
26039
26040
26041
26042
26043
26044
26045
26046
26047
26048
26049
26050
26051
26052
26053
26054
26055
26056
26057
26058
26059
26060
26061
26062
26063
26064
26065
26066
26067
26068
26069
26070
26071
26072
26073
26074
26075
26076
26077
26078
26079
26080
26081
26082
26083
26084
26085
26086
26087
26088
26089
26090
26091
26092
26093
26094
26095
26096
26097
26098
26099
26100
26101
26102
26103
26104
26105
26106
26107
26108
26109
26110
26111
26112
26113
26114
26115
26116
26117
26118
26119
26120
26121
26122
26123
26124
26125
26126
26127
26128
26129
26130
26131
26132
26133
26134
26135
26136
26137
26138
26139
26140
26141
26142
26143
26144
26145
26146
26147
26148
26149
26150
26151
26152
26153
26154
26155
26156
26157
26158
26159
26160
26161
26162
26163
26164
26165
26166
26167
26168
26169
26170
26171
26172
26173
26174
26175
26176
26177
26178
26179
26180
26181
26182
26183
26184
26185
26186
26187
26188
26189
26190
26191
26192
26193
26194
26195
26196
26197
26198
26199
26200
26201
26202
26203
26204
26205
26206
26207
26208
26209
26210
26211
26212
26213
26214
26215
26216
26217
26218
26219
26220
26221
26222
26223
26224
26225
26226
26227
26228
26229
26230
26231
26232
26233
26234
26235
26236
26237
26238
26239
26240
26241
26242
26243
26244
26245
26246
26247
26248
26249
26250
26251
26252
26253
26254
26255
26256
26257
26258
26259
26260
26261
26262
26263
26264
26265
26266
26267
26268
26269
26270
26271
26272
26273
26274
26275
26276
26277
26278
26279
26280
26281
26282
26283
26284
26285
26286
26287
26288
26289
26290
26291
26292
26293
26294
26295
26296
26297
26298
26299
26300
26301
26302
26303
26304
26305
26306
26307
26308
26309
26310
26311
26312
26313
26314
26315
26316
26317
26318
26319
26320
26321
26322
26323
26324
26325
26326
26327
26328
26329
26330
26331
26332
26333
26334
26335
26336
26337
26338
26339
26340
26341
26342
26343
26344
26345
26346
26347
26348
26349
26350
26351
26352
26353
26354
26355
26356
26357
26358
26359
26360
26361
26362
26363
26364
26365
26366
26367
26368
26369
26370
26371
26372
26373
26374
26375
26376
26377
26378
26379
26380
26381
26382
26383
26384
26385
26386
26387
26388
26389
26390
26391
26392
26393
26394
26395
26396
26397
26398
26399
26400
26401
26402
26403
26404
26405
26406
26407
26408
26409
26410
26411
26412
26413
26414
26415
26416
26417
26418
26419
26420
26421
26422
26423
26424
26425
26426
26427
26428
26429
26430
26431
26432
26433
26434
26435
26436
26437
26438
26439
26440
26441
26442
26443
26444
26445
26446
26447
26448
26449
26450
26451
26452
26453
26454
26455
26456
26457
26458
26459
26460
26461
26462
26463
26464
26465
26466
26467
26468
26469
26470
26471
26472
26473
26474
26475
26476
26477
26478
26479
26480
26481
26482
26483
26484
26485
26486
26487
26488
26489
26490
26491
26492
26493
26494
26495
26496
26497
26498
26499
26500
26501
26502
26503
26504
26505
26506
26507
26508
26509
26510
26511
26512
26513
26514
26515
26516
26517
26518
26519
26520
26521
26522
26523
26524
26525
26526
26527
26528
26529
26530
26531
26532
26533
26534
26535
26536
26537
26538
26539
26540
26541
26542
26543
26544
26545
26546
26547
26548
26549
26550
26551
26552
26553
26554
26555
26556
26557
26558
26559
26560
26561
26562
26563
26564
26565
26566
26567
26568
26569
26570
26571
26572
26573
26574
26575
26576
26577
26578
26579
26580
26581
26582
26583
26584
26585
26586
26587
26588
26589
26590
26591
26592
26593
26594
26595
26596
26597
26598
26599
26600
26601
26602
26603
26604
26605
26606
26607
26608
26609
26610
26611
26612
26613
26614
26615
26616
26617
26618
26619
26620
26621
26622
26623
26624
26625
26626
26627
26628
26629
26630
26631
26632
26633
26634
26635
26636
26637
26638
26639
26640
26641
26642
26643
26644
26645
26646
26647
26648
26649
26650
26651
26652
26653
26654
26655
26656
26657
26658
26659
26660
26661
26662
26663
26664
26665
26666
26667
26668
26669
26670
26671
26672
26673
26674
26675
26676
26677
26678
26679
26680
26681
26682
26683
26684
26685
26686
26687
26688
26689
26690
26691
26692
26693
26694
26695
26696
26697
26698
26699
26700
26701
26702
26703
26704
26705
26706
26707
26708
26709
26710
26711
26712
26713
26714
26715
26716
26717
26718
26719
26720
26721
26722
26723
26724
26725
26726
26727
26728
26729
26730
26731
26732
26733
26734
26735
26736
26737
26738
26739
26740
26741
26742
26743
26744
26745
26746
26747
26748
26749
26750
26751
26752
26753
26754
26755
26756
26757
26758
26759
26760
26761
26762
26763
26764
26765
26766
26767
26768
26769
26770
26771
26772
26773
26774
26775
26776
26777
26778
26779
26780
26781
26782
26783
26784
26785
26786
26787
26788
26789
26790
26791
26792
26793
26794
26795
26796
26797
26798
26799
26800
26801
26802
26803
26804
26805
26806
26807
26808
26809
26810
26811
26812
26813
26814
26815
26816
26817
26818
26819
26820
26821
26822
26823
26824
26825
26826
26827
26828
26829
26830
26831
26832
26833
26834
26835
26836
26837
26838
26839
26840
26841
26842
26843
26844
26845
26846
26847
26848
26849
26850
26851
26852
26853
26854
26855
26856
26857
26858
26859
26860
26861
26862
26863
26864
26865
26866
26867
26868
26869
26870
26871
26872
26873
26874
26875
26876
26877
26878
26879
26880
26881
26882
26883
26884
26885
26886
26887
26888
26889
26890
26891
26892
26893
26894
26895
26896
26897
26898
26899
26900
26901
26902
26903
26904
26905
26906
26907
26908
26909
26910
26911
26912
26913
26914
26915
26916
26917
26918
26919
26920
26921
26922
26923
26924
26925
26926
26927
26928
26929
26930
26931
26932
26933
26934
26935
26936
26937
26938
26939
26940
26941
26942
26943
26944
26945
26946
26947
26948
26949
26950
26951
26952
26953
26954
26955
26956
26957
26958
26959
26960
26961
26962
26963
26964
26965
26966
26967
26968
26969
26970
26971
26972
26973
26974
26975
26976
26977
26978
26979
26980
26981
26982
26983
26984
26985
26986
26987
26988
26989
26990
26991
26992
26993
26994
26995
26996
26997
26998
26999
27000
27001
27002
27003
27004
27005
27006
27007
27008
27009
27010
27011
27012
27013
27014
27015
27016
27017
27018
27019
27020
27021
27022
27023
27024
27025
27026
27027
27028
27029
27030
27031
27032
27033
27034
27035
27036
27037
27038
27039
27040
27041
27042
27043
27044
27045
27046
27047
27048
27049
27050
27051
27052
27053
27054
27055
27056
27057
27058
27059
27060
27061
27062
27063
27064
27065
27066
27067
27068
27069
27070
27071
27072
27073
27074
27075
27076
27077
27078
27079
27080
27081
27082
27083
27084
27085
27086
27087
27088
27089
27090
27091
27092
27093
27094
27095
27096
27097
27098
27099
27100
27101
27102
27103
27104
27105
27106
27107
27108
27109
27110
27111
27112
27113
27114
27115
27116
27117
27118
27119
27120
27121
27122
27123
27124
27125
27126
27127
27128
27129
27130
27131
27132
27133
27134
27135
27136
27137
27138
27139
27140
27141
27142
27143
27144
27145
27146
27147
27148
27149
27150
27151
27152
27153
27154
27155
27156
27157
27158
27159
27160
27161
27162
27163
27164
27165
27166
27167
27168
27169
27170
27171
27172
27173
27174
27175
27176
27177
27178
27179
27180
27181
27182
27183
27184
27185
27186
27187
27188
27189
27190
27191
27192
27193
27194
27195
27196
27197
27198
27199
27200
27201
27202
27203
27204
27205
27206
27207
27208
27209
27210
27211
27212
27213
27214
27215
27216
27217
27218
27219
27220
27221
27222
27223
27224
27225
27226
27227
27228
27229
27230
27231
27232
27233
27234
27235
27236
27237
27238
27239
27240
27241
27242
27243
27244
27245
27246
27247
27248
27249
27250
27251
27252
27253
27254
27255
27256
27257
27258
27259
27260
27261
27262
27263
27264
27265
27266
27267
27268
27269
27270
27271
27272
27273
27274
27275
27276
27277
27278
27279
27280
27281
27282
27283
27284
27285
27286
27287
27288
27289
27290
27291
27292
27293
27294
27295
27296
27297
27298
27299
27300
27301
27302
27303
27304
27305
27306
27307
27308
27309
27310
27311
27312
27313
27314
27315
27316
27317
27318
27319
27320
27321
27322
27323
27324
27325
27326
27327
27328
27329
27330
27331
27332
27333
27334
27335
27336
27337
27338
27339
27340
27341
27342
27343
27344
27345
27346
27347
27348
27349
27350
27351
27352
27353
27354
27355
27356
27357
27358
27359
27360
27361
27362
27363
27364
27365
27366
27367
27368
27369
27370
27371
27372
27373
27374
27375
27376
27377
27378
27379
27380
27381
27382
27383
27384
27385
27386
27387
27388
27389
27390
27391
27392
27393
27394
27395
27396
27397
27398
27399
27400
27401
27402
27403
27404
27405
27406
27407
27408
27409
27410
27411
27412
27413
27414
27415
27416
27417
27418
27419
27420
27421
27422
27423
27424
27425
27426
27427
27428
27429
27430
27431
27432
27433
27434
27435
27436
27437
27438
27439
27440
27441
27442
27443
27444
27445
27446
27447
27448
27449
27450
27451
27452
27453
27454
27455
27456
27457
27458
27459
27460
27461
27462
27463
27464
27465
27466
27467
27468
27469
27470
27471
27472
27473
27474
27475
27476
27477
27478
27479
27480
27481
27482
27483
27484
27485
27486
27487
27488
27489
27490
27491
27492
27493
27494
27495
27496
27497
27498
27499
27500
27501
27502
27503
27504
27505
27506
27507
27508
27509
27510
27511
27512
27513
27514
27515
27516
27517
27518
27519
27520
27521
27522
27523
27524
27525
27526
27527
27528
27529
27530
27531
27532
27533
27534
27535
27536
27537
27538
27539
27540
27541
27542
27543
27544
27545
27546
27547
27548
27549
27550
27551
27552
27553
27554
27555
27556
27557
27558
27559
27560
27561
27562
27563
27564
27565
27566
27567
27568
27569
27570
27571
27572
27573
27574
27575
27576
27577
27578
27579
27580
27581
27582
27583
27584
27585
27586
27587
27588
27589
27590
27591
27592
27593
27594
27595
27596
27597
27598
27599
27600
27601
27602
27603
27604
27605
27606
27607
27608
27609
27610
27611
27612
27613
27614
27615
27616
27617
27618
27619
27620
27621
27622
27623
27624
27625
27626
27627
27628
27629
27630
27631
27632
27633
27634
27635
27636
27637
27638
27639
27640
27641
27642
27643
27644
27645
27646
27647
27648
27649
27650
27651
27652
27653
27654
27655
27656
27657
27658
27659
27660
27661
27662
27663
27664
27665
27666
27667
27668
27669
27670
27671
27672
27673
27674
27675
27676
27677
27678
27679
27680
27681
27682
27683
27684
27685
27686
27687
27688
27689
27690
27691
27692
27693
27694
27695
27696
27697
27698
27699
27700
27701
27702
27703
27704
27705
27706
27707
27708
27709
27710
27711
27712
27713
27714
27715
27716
27717
27718
27719
27720
27721
27722
27723
27724
27725
27726
27727
27728
27729
27730
27731
27732
27733
27734
27735
27736
27737
27738
27739
27740
27741
27742
27743
27744
27745
27746
27747
27748
27749
27750
27751
27752
27753
27754
27755
27756
27757
27758
27759
27760
27761
27762
27763
27764
27765
27766
27767
27768
27769
27770
27771
27772
27773
27774
27775
27776
27777
27778
27779
27780
27781
27782
27783
27784
27785
27786
27787
27788
27789
27790
27791
27792
27793
27794
27795
27796
27797
27798
27799
27800
27801
27802
27803
27804
27805
27806
27807
27808
27809
27810
27811
27812
27813
27814
27815
27816
27817
27818
27819
27820
27821
27822
27823
27824
27825
27826
27827
27828
27829
27830
27831
27832
27833
27834
27835
27836
27837
27838
27839
27840
27841
27842
27843
27844
27845
27846
27847
27848
27849
27850
27851
27852
27853
27854
27855
27856
27857
27858
27859
27860
27861
27862
27863
27864
27865
27866
27867
27868
27869
27870
27871
27872
27873
27874
27875
27876
27877
27878
27879
27880
27881
27882
27883
27884
27885
27886
27887
27888
27889
27890
27891
27892
27893
27894
27895
27896
27897
27898
27899
27900
27901
27902
27903
27904
27905
27906
27907
27908
27909
27910
27911
27912
27913
27914
27915
27916
27917
27918
27919
27920
27921
27922
27923
27924
27925
27926
27927
27928
27929
27930
27931
27932
27933
27934
27935
27936
27937
27938
27939
27940
27941
27942
27943
27944
27945
27946
27947
27948
27949
27950
27951
27952
27953
27954
27955
27956
27957
27958
27959
27960
27961
27962
27963
27964
27965
27966
27967
27968
27969
27970
27971
27972
27973
27974
27975
27976
27977
27978
27979
27980
27981
27982
27983
27984
27985
27986
27987
27988
27989
27990
27991
27992
27993
27994
27995
27996
27997
27998
27999
28000
28001
28002
28003
28004
28005
28006
28007
28008
28009
28010
28011
28012
28013
28014
28015
28016
28017
28018
28019
28020
28021
28022
28023
28024
28025
28026
28027
28028
28029
28030
28031
28032
28033
28034
28035
28036
28037
28038
28039
28040
28041
28042
28043
28044
28045
28046
28047
28048
28049
28050
28051
28052
28053
28054
28055
28056
28057
28058
28059
28060
28061
28062
28063
28064
28065
28066
28067
28068
28069
28070
28071
28072
28073
28074
28075
28076
28077
28078
28079
28080
28081
28082
28083
28084
28085
28086
28087
28088
28089
28090
28091
28092
28093
28094
28095
28096
28097
28098
28099
28100
28101
28102
28103
28104
28105
28106
28107
28108
28109
28110
28111
28112
28113
28114
28115
28116
28117
28118
28119
28120
28121
28122
28123
28124
28125
28126
28127
28128
28129
28130
28131
28132
28133
28134
28135
28136
28137
28138
28139
28140
28141
28142
28143
28144
28145
28146
28147
28148
28149
28150
28151
28152
28153
28154
28155
28156
28157
28158
28159
28160
28161
28162
28163
28164
28165
28166
28167
28168
28169
28170
28171
28172
28173
28174
28175
28176
28177
28178
28179
28180
28181
28182
28183
28184
28185
28186
28187
28188
28189
28190
28191
28192
28193
28194
28195
28196
28197
28198
28199
28200
28201
28202
28203
28204
28205
28206
28207
28208
28209
28210
28211
28212
28213
28214
28215
28216
28217
28218
28219
28220
28221
28222
28223
28224
28225
28226
28227
28228
28229
28230
28231
28232
28233
28234
28235
28236
28237
28238
28239
28240
28241
28242
28243
28244
28245
28246
28247
28248
28249
28250
28251
28252
28253
28254
28255
28256
28257
28258
28259
28260
28261
28262
28263
28264
28265
28266
28267
28268
28269
28270
28271
28272
28273
28274
28275
28276
28277
28278
28279
28280
28281
28282
28283
28284
28285
28286
28287
28288
28289
28290
28291
28292
28293
28294
28295
28296
28297
28298
28299
28300
28301
28302
28303
28304
28305
28306
28307
28308
28309
28310
28311
28312
28313
28314
28315
28316
28317
28318
28319
28320
28321
28322
28323
28324
28325
28326
28327
28328
28329
28330
28331
28332
28333
28334
28335
28336
28337
28338
28339
28340
28341
28342
28343
28344
28345
28346
28347
28348
28349
28350
28351
28352
28353
28354
28355
28356
28357
28358
28359
28360
28361
28362
28363
28364
28365
28366
28367
28368
28369
28370
28371
28372
28373
28374
28375
28376
28377
28378
28379
28380
28381
28382
28383
28384
28385
28386
28387
28388
28389
28390
28391
28392
28393
28394
28395
28396
28397
28398
28399
28400
28401
28402
28403
28404
28405
28406
28407
28408
28409
28410
28411
28412
28413
28414
28415
28416
28417
28418
28419
28420
28421
28422
28423
28424
28425
28426
28427
28428
28429
28430
28431
28432
28433
28434
28435
28436
28437
28438
28439
28440
28441
28442
28443
28444
28445
28446
28447
28448
28449
28450
28451
28452
28453
28454
28455
28456
28457
28458
28459
28460
28461
28462
28463
28464
28465
28466
28467
28468
28469
28470
28471
28472
28473
28474
28475
28476
28477
28478
28479
28480
28481
28482
28483
28484
28485
28486
28487
28488
28489
28490
28491
28492
28493
28494
28495
28496
28497
28498
28499
28500
28501
28502
28503
28504
28505
28506
28507
28508
28509
28510
28511
28512
28513
28514
28515
28516
28517
28518
28519
28520
28521
28522
28523
28524
28525
28526
28527
28528
28529
28530
28531
28532
28533
28534
28535
28536
28537
28538
28539
28540
28541
28542
28543
28544
28545
28546
28547
28548
28549
28550
28551
28552
28553
28554
28555
28556
28557
28558
28559
28560
28561
28562
28563
28564
28565
28566
28567
28568
28569
28570
28571
28572
28573
28574
28575
28576
28577
28578
28579
28580
28581
28582
28583
28584
28585
28586
28587
28588
28589
28590
28591
28592
28593
28594
28595
28596
28597
28598
28599
28600
28601
28602
28603
28604
28605
28606
28607
28608
28609
28610
28611
28612
28613
28614
28615
28616
28617
28618
28619
28620
28621
28622
28623
28624
28625
28626
28627
28628
28629
28630
28631
28632
28633
28634
28635
28636
28637
28638
28639
28640
28641
28642
28643
28644
28645
28646
28647
28648
28649
28650
28651
28652
28653
28654
28655
28656
28657
28658
28659
28660
28661
28662
28663
28664
28665
28666
28667
28668
28669
28670
28671
28672
28673
28674
28675
28676
28677
28678
28679
28680
28681
28682
28683
28684
28685
28686
28687
28688
28689
28690
28691
28692
28693
28694
28695
28696
28697
28698
28699
28700
28701
28702
28703
28704
28705
28706
28707
28708
28709
28710
28711
28712
28713
28714
28715
28716
28717
28718
28719
28720
28721
28722
28723
28724
28725
28726
28727
28728
28729
28730
28731
28732
28733
28734
28735
28736
28737
28738
28739
28740
28741
28742
28743
28744
28745
28746
28747
28748
28749
28750
28751
28752
28753
28754
28755
28756
28757
28758
28759
28760
28761
28762
28763
28764
28765
28766
28767
28768
28769
28770
28771
28772
28773
28774
28775
28776
28777
28778
28779
28780
28781
28782
28783
28784
28785
28786
28787
28788
28789
28790
28791
28792
28793
28794
28795
28796
28797
28798
28799
28800
28801
28802
28803
28804
28805
28806
28807
28808
28809
28810
28811
28812
28813
28814
28815
28816
28817
28818
28819
28820
28821
28822
28823
28824
28825
28826
28827
28828
28829
28830
28831
28832
28833
28834
28835
28836
28837
28838
28839
28840
28841
28842
28843
28844
28845
28846
28847
28848
28849
28850
28851
28852
28853
28854
28855
28856
28857
28858
28859
28860
28861
28862
28863
28864
28865
28866
28867
28868
28869
28870
28871
28872
28873
28874
28875
28876
28877
28878
28879
28880
28881
28882
28883
28884
28885
28886
28887
28888
28889
28890
28891
28892
28893
28894
28895
28896
28897
28898
28899
28900
28901
28902
28903
28904
28905
28906
28907
28908
28909
28910
28911
28912
28913
28914
28915
28916
28917
28918
28919
28920
28921
28922
28923
28924
28925
28926
28927
28928
28929
28930
28931
28932
28933
28934
28935
28936
28937
28938
28939
28940
28941
28942
28943
28944
28945
28946
28947
28948
28949
28950
28951
28952
28953
28954
28955
28956
28957
28958
28959
28960
28961
28962
28963
28964
28965
28966
28967
28968
28969
28970
28971
28972
28973
28974
28975
28976
28977
28978
28979
28980
28981
28982
28983
28984
28985
28986
28987
28988
28989
28990
28991
28992
28993
28994
28995
28996
28997
28998
28999
29000
29001
29002
29003
29004
29005
29006
29007
29008
29009
29010
29011
29012
29013
29014
29015
29016
29017
29018
29019
29020
29021
29022
29023
29024
29025
29026
29027
29028
29029
29030
29031
29032
29033
29034
29035
29036
29037
29038
29039
29040
29041
29042
29043
29044
29045
29046
29047
29048
29049
29050
29051
29052
29053
29054
29055
29056
29057
29058
29059
29060
29061
29062
29063
29064
29065
29066
29067
29068
29069
29070
29071
29072
29073
29074
29075
29076
29077
29078
29079
29080
29081
29082
29083
29084
29085
29086
29087
29088
29089
29090
29091
29092
29093
29094
29095
29096
29097
29098
29099
29100
29101
29102
29103
29104
29105
29106
29107
29108
29109
29110
29111
29112
29113
29114
29115
29116
29117
29118
29119
29120
29121
29122
29123
29124
29125
29126
29127
29128
29129
29130
29131
29132
29133
29134
29135
29136
29137
29138
29139
29140
29141
29142
29143
29144
29145
29146
29147
29148
29149
29150
29151
29152
29153
29154
29155
29156
29157
29158
29159
29160
29161
29162
29163
29164
29165
29166
29167
29168
29169
29170
29171
29172
29173
29174
29175
29176
29177
29178
29179
29180
29181
29182
29183
29184
29185
29186
29187
29188
29189
29190
29191
29192
29193
29194
29195
29196
29197
29198
29199
29200
29201
29202
29203
29204
29205
29206
29207
29208
29209
29210
29211
29212
29213
29214
29215
29216
29217
29218
29219
29220
29221
29222
29223
29224
29225
29226
29227
29228
29229
29230
29231
29232
29233
29234
29235
29236
29237
29238
29239
29240
29241
29242
29243
29244
29245
29246
29247
29248
29249
29250
29251
29252
29253
29254
29255
29256
29257
29258
29259
29260
29261
29262
29263
29264
29265
29266
29267
29268
29269
29270
29271
29272
29273
29274
29275
29276
29277
29278
29279
29280
29281
29282
29283
29284
29285
29286
29287
29288
29289
29290
29291
29292
29293
29294
29295
29296
29297
29298
29299
29300
29301
29302
29303
29304
29305
29306
29307
29308
29309
29310
29311
29312
29313
29314
29315
29316
29317
29318
29319
29320
29321
29322
29323
29324
29325
29326
29327
29328
29329
29330
29331
29332
29333
29334
29335
29336
29337
29338
29339
29340
29341
29342
29343
29344
29345
29346
29347
29348
29349
29350
29351
29352
29353
29354
29355
29356
29357
29358
29359
29360
29361
29362
29363
29364
29365
29366
29367
29368
29369
29370
29371
29372
29373
29374
29375
29376
29377
29378
29379
29380
29381
29382
29383
29384
29385
29386
29387
29388
29389
29390
29391
29392
29393
29394
29395
29396
29397
29398
29399
29400
29401
29402
29403
29404
29405
29406
29407
29408
29409
29410
29411
29412
29413
29414
29415
29416
29417
29418
29419
29420
29421
29422
29423
29424
29425
29426
29427
29428
29429
29430
29431
29432
29433
29434
29435
29436
29437
29438
29439
29440
29441
29442
29443
29444
29445
29446
29447
29448
29449
29450
29451
29452
29453
29454
29455
29456
29457
29458
29459
29460
29461
29462
29463
29464
29465
29466
29467
29468
29469
29470
29471
29472
29473
29474
29475
29476
29477
29478
29479
29480
29481
29482
29483
29484
29485
29486
29487
29488
29489
29490
29491
29492
29493
29494
29495
29496
29497
29498
29499
29500
29501
29502
29503
29504
29505
29506
29507
29508
29509
29510
29511
29512
29513
29514
29515
29516
29517
29518
29519
29520
29521
29522
29523
29524
29525
29526
29527
29528
29529
29530
29531
29532
29533
29534
29535
29536
29537
29538
29539
29540
29541
29542
29543
29544
29545
29546
29547
29548
29549
29550
29551
29552
29553
29554
29555
29556
29557
29558
29559
29560
29561
29562
29563
29564
29565
29566
29567
29568
29569
29570
29571
29572
29573
29574
29575
29576
29577
29578
29579
29580
29581
29582
29583
29584
29585
29586
29587
29588
29589
29590
29591
29592
29593
29594
29595
29596
29597
29598
29599
29600
29601
29602
29603
29604
29605
29606
29607
29608
29609
29610
29611
29612
29613
29614
29615
29616
29617
29618
29619
29620
29621
29622
29623
29624
29625
29626
29627
29628
29629
29630
29631
29632
29633
29634
29635
29636
29637
29638
29639
29640
29641
29642
29643
29644
29645
29646
29647
29648
29649
29650
29651
29652
29653
29654
29655
29656
29657
29658
29659
29660
29661
29662
29663
29664
29665
29666
29667
29668
29669
29670
29671
29672
29673
29674
29675
29676
29677
29678
29679
29680
29681
29682
29683
29684
29685
29686
29687
29688
29689
29690
29691
29692
29693
29694
29695
29696
29697
29698
29699
29700
29701
29702
29703
29704
29705
29706
29707
29708
29709
29710
29711
29712
29713
29714
29715
29716
29717
29718
29719
29720
29721
29722
29723
29724
29725
29726
29727
29728
29729
29730
29731
29732
29733
29734
29735
29736
29737
29738
29739
29740
29741
29742
29743
29744
29745
29746
29747
29748
29749
29750
29751
29752
29753
29754
29755
29756
29757
29758
29759
29760
29761
29762
29763
29764
29765
29766
29767
29768
29769
29770
29771
29772
29773
29774
29775
29776
29777
29778
29779
29780
29781
29782
29783
29784
29785
29786
29787
29788
29789
29790
29791
29792
29793
29794
29795
29796
29797
29798
29799
29800
29801
29802
29803
29804
29805
29806
29807
29808
29809
29810
29811
29812
29813
29814
29815
29816
29817
29818
29819
29820
29821
29822
29823
29824
29825
29826
29827
29828
29829
29830
29831
29832
29833
29834
29835
29836
29837
29838
29839
29840
29841
29842
29843
29844
29845
29846
29847
29848
29849
29850
29851
29852
29853
29854
29855
29856
29857
29858
29859
29860
29861
29862
29863
29864
29865
29866
29867
29868
29869
29870
29871
29872
29873
29874
29875
29876
29877
29878
29879
29880
29881
29882
29883
29884
29885
29886
29887
29888
29889
29890
29891
29892
29893
29894
29895
29896
29897
29898
29899
29900
29901
29902
29903
29904
29905
29906
29907
29908
29909
29910
29911
29912
29913
29914
29915
29916
29917
29918
29919
29920
29921
29922
29923
29924
29925
29926
29927
29928
29929
29930
29931
29932
29933
29934
29935
29936
29937
29938
29939
29940
29941
29942
29943
29944
29945
29946
29947
29948
29949
29950
29951
29952
29953
29954
29955
29956
29957
29958
29959
29960
29961
29962
29963
29964
29965
29966
29967
29968
29969
29970
29971
29972
29973
29974
29975
29976
29977
29978
29979
29980
29981
29982
29983
29984
29985
29986
29987
29988
29989
29990
29991
29992
29993
29994
29995
29996
29997
29998
29999
30000
30001
30002
30003
30004
30005
30006
30007
30008
30009
30010
30011
30012
30013
30014
30015
30016
30017
30018
30019
30020
30021
30022
30023
30024
30025
30026
30027
30028
30029
30030
30031
30032
30033
30034
30035
30036
30037
30038
30039
30040
30041
30042
30043
30044
30045
30046
30047
30048
30049
30050
30051
30052
30053
30054
30055
30056
30057
30058
30059
30060
30061
30062
30063
30064
30065
30066
30067
30068
30069
30070
30071
30072
30073
30074
30075
30076
30077
30078
30079
30080
30081
30082
30083
30084
30085
30086
30087
30088
30089
30090
30091
30092
30093
30094
30095
30096
30097
30098
30099
30100
30101
30102
30103
30104
30105
30106
30107
30108
30109
30110
30111
30112
30113
30114
30115
30116
30117
30118
30119
30120
30121
30122
30123
30124
30125
30126
30127
30128
30129
30130
30131
30132
30133
30134
30135
30136
30137
30138
30139
30140
30141
30142
30143
30144
30145
30146
30147
30148
30149
30150
30151
30152
30153
30154
30155
30156
30157
30158
30159
30160
30161
30162
30163
30164
30165
30166
30167
30168
30169
30170
30171
30172
30173
30174
30175
30176
30177
30178
30179
30180
30181
30182
30183
30184
30185
30186
30187
30188
30189
30190
30191
30192
30193
30194
30195
30196
30197
30198
30199
30200
30201
30202
30203
30204
30205
30206
30207
30208
30209
30210
30211
30212
30213
30214
30215
30216
30217
30218
30219
30220
30221
30222
30223
30224
30225
30226
30227
30228
30229
30230
30231
30232
30233
30234
30235
30236
30237
30238
30239
30240
30241
30242
30243
30244
30245
30246
30247
30248
30249
30250
30251
30252
30253
30254
30255
30256
30257
30258
30259
30260
30261
30262
30263
30264
30265
30266
30267
30268
30269
30270
30271
30272
30273
30274
30275
30276
30277
30278
30279
30280
30281
30282
30283
30284
30285
30286
30287
30288
30289
30290
30291
30292
30293
30294
30295
30296
30297
30298
30299
30300
30301
30302
30303
30304
30305
30306
30307
30308
30309
30310
30311
30312
30313
30314
30315
30316
30317
30318
30319
30320
30321
30322
30323
30324
30325
30326
30327
30328
30329
30330
30331
30332
30333
30334
30335
30336
30337
30338
30339
30340
30341
30342
30343
30344
30345
30346
30347
30348
30349
30350
30351
30352
30353
30354
30355
30356
30357
30358
30359
30360
30361
30362
30363
30364
30365
30366
30367
30368
30369
30370
30371
30372
30373
30374
30375
30376
30377
30378
30379
30380
30381
30382
30383
30384
30385
30386
30387
30388
30389
30390
30391
30392
30393
30394
30395
30396
30397
30398
30399
30400
30401
30402
30403
30404
30405
30406
30407
30408
30409
30410
30411
30412
30413
30414
30415
30416
30417
30418
30419
30420
30421
30422
30423
30424
30425
30426
30427
30428
30429
30430
30431
30432
30433
30434
30435
30436
30437
30438
30439
30440
30441
30442
30443
30444
30445
30446
30447
30448
30449
30450
30451
30452
30453
30454
30455
30456
30457
30458
30459
30460
30461
30462
30463
30464
30465
30466
30467
30468
30469
30470
30471
30472
30473
30474
30475
30476
30477
30478
30479
30480
30481
30482
30483
30484
30485
30486
30487
30488
30489
30490
30491
30492
30493
30494
30495
30496
30497
30498
30499
30500
30501
30502
30503
30504
30505
30506
30507
30508
30509
30510
30511
30512
30513
30514
30515
30516
30517
30518
30519
30520
30521
30522
30523
30524
30525
30526
30527
30528
30529
30530
30531
30532
30533
30534
30535
30536
30537
30538
30539
30540
30541
30542
30543
30544
30545
30546
30547
30548
30549
30550
30551
30552
30553
30554
30555
30556
30557
30558
30559
30560
30561
30562
30563
30564
30565
30566
30567
30568
30569
30570
30571
30572
30573
30574
30575
30576
30577
30578
30579
30580
30581
30582
30583
30584
30585
30586
30587
30588
30589
30590
30591
30592
30593
30594
30595
30596
30597
30598
30599
30600
30601
30602
30603
30604
30605
30606
30607
30608
30609
30610
30611
30612
30613
30614
30615
30616
30617
30618
30619
30620
30621
30622
30623
30624
30625
30626
30627
30628
30629
30630
30631
30632
30633
30634
30635
30636
30637
30638
30639
30640
30641
30642
30643
30644
30645
30646
30647
30648
30649
30650
30651
30652
30653
30654
30655
30656
30657
30658
30659
30660
30661
30662
30663
30664
30665
30666
30667
30668
30669
30670
30671
30672
30673
30674
30675
30676
30677
30678
30679
30680
30681
30682
30683
30684
30685
30686
30687
30688
30689
30690
30691
30692
30693
30694
30695
30696
30697
30698
30699
30700
30701
30702
30703
30704
30705
30706
30707
30708
30709
30710
30711
30712
30713
30714
30715
30716
30717
30718
30719
30720
30721
30722
30723
30724
30725
30726
30727
30728
30729
30730
30731
30732
30733
30734
30735
30736
30737
30738
30739
30740
30741
30742
30743
30744
30745
30746
30747
30748
30749
30750
30751
30752
30753
30754
30755
30756
30757
30758
30759
30760
30761
30762
30763
30764
30765
30766
30767
30768
30769
30770
30771
30772
30773
30774
30775
30776
30777
30778
30779
30780
30781
30782
30783
30784
30785
30786
30787
30788
30789
30790
30791
30792
30793
30794
30795
30796
30797
30798
30799
30800
30801
30802
30803
30804
30805
30806
30807
30808
30809
30810
30811
30812
30813
30814
30815
30816
30817
30818
30819
30820
30821
30822
30823
30824
30825
30826
30827
30828
30829
30830
30831
30832
30833
30834
30835
30836
30837
30838
30839
30840
30841
30842
30843
30844
30845
30846
30847
30848
30849
30850
30851
30852
30853
30854
30855
30856
30857
30858
30859
30860
30861
30862
30863
30864
30865
30866
30867
30868
30869
30870
30871
30872
30873
30874
30875
30876
30877
30878
30879
30880
30881
30882
30883
30884
30885
30886
30887
30888
30889
30890
30891
30892
30893
30894
30895
30896
30897
30898
30899
30900
30901
30902
30903
30904
30905
30906
30907
30908
30909
30910
30911
30912
30913
30914
30915
30916
30917
30918
30919
30920
30921
30922
30923
30924
30925
30926
30927
30928
30929
30930
30931
30932
30933
30934
30935
30936
30937
30938
30939
30940
30941
30942
30943
30944
30945
30946
30947
30948
30949
30950
30951
30952
30953
30954
30955
30956
30957
30958
30959
30960
30961
30962
30963
30964
30965
30966
30967
30968
30969
30970
30971
30972
30973
30974
30975
30976
30977
30978
30979
30980
30981
30982
30983
30984
30985
30986
30987
30988
30989
30990
30991
30992
30993
30994
30995
30996
30997
30998
30999
31000
31001
31002
31003
31004
31005
31006
31007
31008
31009
31010
31011
31012
31013
31014
31015
31016
31017
31018
31019
31020
31021
31022
31023
31024
31025
31026
31027
31028
31029
31030
31031
31032
31033
31034
31035
31036
31037
31038
31039
31040
31041
31042
31043
31044
31045
31046
31047
31048
31049
31050
31051
31052
31053
31054
31055
31056
31057
31058
31059
31060
31061
31062
31063
31064
31065
31066
31067
31068
31069
31070
31071
31072
31073
31074
31075
31076
31077
31078
31079
31080
31081
31082
31083
31084
31085
31086
31087
31088
31089
31090
31091
31092
31093
31094
31095
31096
31097
31098
31099
31100
31101
31102
31103
31104
31105
31106
31107
31108
31109
31110
31111
31112
31113
31114
31115
31116
31117
31118
31119
31120
31121
31122
31123
31124
31125
31126
31127
31128
31129
31130
31131
31132
31133
31134
31135
31136
31137
31138
31139
31140
31141
31142
31143
31144
31145
31146
31147
31148
31149
31150
31151
31152
31153
31154
31155
31156
31157
31158
31159
31160
31161
31162
31163
31164
31165
31166
31167
31168
31169
31170
31171
31172
31173
31174
31175
31176
31177
31178
31179
31180
31181
31182
31183
31184
31185
31186
31187
31188
31189
31190
31191
31192
31193
31194
31195
31196
31197
31198
31199
31200
31201
31202
31203
31204
31205
31206
31207
31208
31209
31210
31211
31212
31213
31214
31215
31216
31217
31218
31219
31220
31221
31222
31223
31224
31225
31226
31227
31228
31229
31230
31231
31232
31233
31234
31235
31236
31237
31238
31239
31240
31241
31242
31243
31244
31245
31246
31247
31248
31249
31250
31251
31252
31253
31254
31255
31256
31257
31258
31259
31260
31261
31262
31263
31264
31265
31266
31267
31268
31269
31270
31271
31272
31273
31274
31275
31276
31277
31278
31279
31280
31281
31282
31283
31284
31285
31286
31287
31288
31289
31290
31291
31292
31293
31294
31295
31296
31297
31298
31299
31300
31301
31302
31303
31304
31305
31306
31307
31308
31309
31310
31311
31312
31313
31314
31315
31316
31317
31318
31319
31320
31321
31322
31323
31324
31325
31326
31327
31328
31329
31330
31331
31332
31333
31334
31335
31336
31337
31338
31339
31340
31341
31342
31343
31344
31345
31346
31347
31348
31349
31350
31351
31352
31353
31354
31355
31356
31357
31358
31359
31360
31361
31362
31363
31364
31365
31366
31367
31368
31369
31370
31371
31372
31373
31374
31375
31376
31377
31378
31379
31380
31381
31382
31383
31384
31385
31386
31387
31388
31389
31390
31391
31392
31393
31394
31395
31396
31397
31398
31399
31400
31401
31402
31403
31404
31405
31406
31407
31408
31409
31410
31411
31412
31413
31414
31415
31416
31417
31418
31419
31420
31421
31422
31423
31424
31425
31426
31427
31428
31429
31430
31431
31432
31433
31434
31435
31436
31437
31438
31439
31440
31441
31442
31443
31444
31445
31446
31447
31448
31449
31450
31451
31452
31453
31454
31455
31456
31457
31458
31459
31460
31461
31462
31463
31464
31465
31466
31467
31468
31469
31470
31471
31472
31473
31474
31475
31476
31477
31478
31479
31480
31481
31482
31483
31484
31485
31486
31487
31488
31489
31490
31491
31492
31493
31494
31495
31496
31497
31498
31499
31500
31501
31502
31503
31504
31505
31506
31507
31508
31509
31510
31511
31512
31513
31514
31515
31516
31517
31518
31519
31520
31521
31522
31523
31524
31525
31526
31527
31528
31529
31530
31531
31532
31533
31534
31535
31536
31537
31538
31539
31540
31541
31542
31543
31544
31545
31546
31547
31548
31549
31550
31551
31552
31553
31554
31555
31556
31557
31558
31559
31560
31561
31562
31563
31564
31565
31566
31567
31568
31569
31570
31571
31572
31573
31574
31575
31576
31577
31578
31579
31580
31581
31582
31583
31584
31585
31586
31587
31588
31589
31590
31591
31592
31593
31594
31595
31596
31597
31598
31599
31600
31601
31602
31603
31604
31605
31606
31607
31608
31609
31610
31611
31612
31613
31614
31615
31616
31617
31618
31619
31620
31621
31622
31623
31624
31625
31626
31627
31628
31629
31630
31631
31632
31633
31634
31635
31636
31637
31638
31639
31640
31641
31642
31643
31644
31645
31646
31647
31648
31649
31650
31651
31652
31653
31654
31655
31656
31657
31658
31659
31660
31661
31662
31663
31664
31665
31666
31667
31668
31669
31670
31671
31672
31673
31674
31675
31676
31677
31678
31679
31680
31681
31682
31683
31684
31685
31686
31687
31688
31689
31690
31691
31692
31693
31694
31695
31696
31697
31698
31699
31700
31701
31702
31703
31704
31705
31706
31707
31708
31709
31710
31711
31712
31713
31714
31715
31716
31717
31718
31719
31720
31721
31722
31723
31724
31725
31726
31727
31728
31729
31730
31731
31732
31733
31734
31735
31736
31737
31738
31739
31740
31741
31742
31743
31744
31745
31746
31747
31748
31749
31750
31751
31752
31753
31754
31755
31756
31757
31758
31759
31760
31761
31762
31763
31764
31765
31766
31767
31768
31769
31770
31771
31772
31773
31774
31775
31776
31777
31778
31779
31780
31781
31782
31783
31784
31785
31786
31787
31788
31789
31790
31791
31792
31793
31794
31795
31796
31797
31798
31799
31800
31801
31802
31803
31804
31805
31806
31807
31808
31809
31810
31811
31812
31813
31814
31815
31816
31817
31818
31819
31820
31821
31822
31823
31824
31825
31826
31827
31828
31829
31830
31831
31832
31833
31834
31835
31836
31837
31838
31839
31840
31841
31842
31843
31844
31845
31846
31847
31848
31849
31850
31851
31852
31853
31854
31855
31856
31857
31858
31859
31860
31861
31862
31863
31864
31865
31866
31867
31868
31869
31870
31871
31872
31873
31874
31875
31876
31877
31878
31879
31880
31881
31882
31883
31884
31885
31886
31887
31888
31889
31890
31891
31892
31893
31894
31895
31896
31897
31898
31899
31900
31901
31902
31903
31904
31905
31906
31907
31908
31909
31910
31911
31912
31913
31914
31915
31916
31917
31918
31919
31920
31921
31922
31923
31924
31925
31926
31927
31928
31929
31930
31931
31932
31933
31934
31935
31936
31937
31938
31939
31940
31941
31942
31943
31944
31945
31946
31947
31948
31949
31950
31951
31952
31953
31954
31955
31956
31957
31958
31959
31960
31961
31962
31963
31964
31965
31966
31967
31968
31969
31970
31971
31972
31973
31974
31975
31976
31977
31978
31979
31980
31981
31982
31983
31984
31985
31986
31987
31988
31989
31990
31991
31992
31993
31994
31995
31996
31997
31998
31999
32000
32001
32002
32003
32004
32005
32006
32007
32008
32009
32010
32011
32012
32013
32014
32015
32016
32017
32018
32019
32020
32021
32022
32023
32024
32025
32026
32027
32028
32029
32030
32031
32032
32033
32034
32035
32036
32037
32038
32039
32040
32041
32042
32043
32044
32045
32046
32047
32048
32049
32050
32051
32052
32053
32054
32055
32056
32057
32058
32059
32060
32061
32062
32063
32064
32065
32066
32067
32068
32069
32070
32071
32072
32073
32074
32075
32076
32077
32078
32079
32080
32081
32082
32083
32084
32085
32086
32087
32088
32089
32090
32091
32092
32093
32094
32095
32096
32097
32098
32099
32100
32101
32102
32103
32104
32105
32106
32107
32108
32109
32110
32111
32112
32113
32114
32115
32116
32117
32118
32119
32120
32121
32122
32123
32124
32125
32126
32127
32128
32129
32130
32131
32132
32133
32134
32135
32136
32137
32138
32139
32140
32141
32142
32143
32144
32145
32146
32147
32148
32149
32150
32151
32152
32153
32154
32155
32156
32157
32158
32159
32160
32161
32162
32163
32164
32165
32166
32167
32168
32169
32170
32171
32172
32173
32174
32175
32176
32177
32178
32179
32180
32181
32182
32183
32184
32185
32186
32187
32188
32189
32190
32191
32192
32193
32194
32195
32196
32197
32198
32199
32200
32201
32202
32203
32204
32205
32206
32207
32208
32209
32210
32211
32212
32213
32214
32215
32216
32217
32218
32219
32220
32221
32222
32223
32224
32225
32226
32227
32228
32229
32230
32231
32232
32233
32234
32235
32236
32237
32238
32239
32240
32241
32242
32243
32244
32245
32246
32247
32248
32249
32250
32251
32252
32253
32254
32255
32256
32257
32258
32259
32260
32261
32262
32263
32264
32265
32266
32267
32268
32269
32270
32271
32272
32273
32274
32275
32276
32277
32278
32279
32280
32281
32282
32283
32284
32285
32286
32287
32288
32289
32290
32291
32292
32293
32294
32295
32296
32297
32298
32299
32300
32301
32302
32303
32304
32305
32306
32307
32308
32309
32310
32311
32312
32313
32314
32315
32316
32317
32318
32319
32320
32321
32322
32323
32324
32325
32326
32327
32328
32329
32330
32331
32332
32333
32334
32335
32336
32337
32338
32339
32340
32341
32342
32343
32344
32345
32346
32347
32348
32349
32350
32351
32352
32353
32354
32355
32356
32357
32358
32359
32360
32361
32362
32363
32364
32365
32366
32367
32368
32369
32370
32371
32372
32373
32374
32375
32376
32377
32378
32379
32380
32381
32382
32383
32384
32385
32386
32387
32388
32389
32390
32391
32392
32393
32394
32395
32396
32397
32398
32399
32400
32401
32402
32403
32404
32405
32406
32407
32408
32409
32410
32411
32412
32413
32414
32415
32416
32417
32418
32419
32420
32421
32422
32423
32424
32425
32426
32427
32428
32429
32430
32431
32432
32433
32434
32435
32436
32437
32438
32439
32440
32441
32442
32443
32444
32445
32446
32447
32448
32449
32450
32451
32452
32453
32454
32455
32456
32457
32458
32459
32460
32461
32462
32463
32464
32465
32466
32467
32468
32469
32470
32471
32472
32473
32474
32475
32476
32477
32478
32479
32480
32481
32482
32483
32484
32485
32486
32487
32488
32489
32490
32491
32492
32493
32494
32495
32496
32497
32498
32499
32500
32501
32502
32503
32504
32505
32506
32507
32508
32509
32510
32511
32512
32513
32514
32515
32516
32517
32518
32519
32520
32521
32522
32523
32524
32525
32526
32527
32528
32529
32530
32531
32532
32533
32534
32535
32536
32537
32538
32539
32540
32541
32542
32543
32544
32545
32546
32547
32548
32549
32550
32551
32552
32553
32554
32555
32556
32557
32558
32559
32560
32561
32562
32563
32564
32565
32566
32567
32568
32569
32570
32571
32572
32573
32574
32575
32576
32577
32578
32579
32580
32581
32582
32583
32584
32585
32586
32587
32588
32589
32590
32591
32592
32593
32594
32595
32596
32597
32598
32599
32600
32601
32602
32603
32604
32605
32606
32607
32608
32609
32610
32611
32612
32613
32614
32615
32616
32617
32618
32619
32620
32621
32622
32623
32624
32625
32626
32627
32628
32629
32630
32631
32632
32633
32634
32635
32636
32637
32638
32639
32640
32641
32642
32643
32644
32645
32646
32647
32648
32649
32650
32651
32652
32653
32654
32655
32656
32657
32658
32659
32660
32661
32662
32663
32664
32665
32666
32667
32668
32669
32670
32671
32672
32673
32674
32675
32676
32677
32678
32679
32680
32681
32682
32683
32684
32685
32686
32687
32688
32689
32690
32691
32692
32693
32694
32695
32696
32697
32698
32699
32700
32701
32702
32703
32704
32705
32706
32707
32708
32709
32710
32711
32712
32713
32714
32715
32716
32717
32718
32719
32720
32721
32722
32723
32724
32725
32726
32727
32728
32729
32730
32731
32732
32733
32734
32735
32736
32737
32738
32739
32740
32741
32742
32743
32744
32745
32746
32747
32748
32749
32750
32751
32752
32753
32754
32755
32756
32757
32758
32759
32760
32761
32762
32763
32764
32765
32766
32767
32768
32769
32770
32771
32772
32773
32774
32775
32776
32777
32778
32779
32780
32781
32782
32783
32784
32785
32786
32787
32788
32789
32790
32791
32792
32793
32794
32795
32796
32797
32798
32799
32800
32801
32802
32803
32804
32805
32806
32807
32808
32809
32810
32811
32812
32813
32814
32815
32816
32817
32818
32819
32820
32821
32822
32823
32824
32825
32826
32827
32828
32829
32830
32831
32832
32833
32834
32835
32836
32837
32838
32839
32840
32841
32842
32843
32844
32845
32846
32847
32848
32849
32850
32851
32852
32853
32854
32855
32856
32857
32858
32859
32860
32861
32862
32863
32864
32865
32866
32867
32868
32869
32870
32871
32872
32873
32874
32875
32876
32877
32878
32879
32880
32881
32882
32883
32884
32885
32886
32887
32888
32889
32890
32891
32892
32893
32894
32895
32896
32897
32898
32899
32900
32901
32902
32903
32904
32905
32906
32907
32908
32909
32910
32911
32912
32913
32914
32915
32916
32917
32918
32919
32920
32921
32922
32923
32924
32925
32926
32927
32928
32929
32930
32931
32932
32933
32934
32935
32936
32937
32938
32939
32940
32941
32942
32943
32944
32945
32946
32947
32948
32949
32950
32951
32952
32953
32954
32955
32956
32957
32958
32959
32960
32961
32962
32963
32964
32965
32966
32967
32968
32969
32970
32971
32972
32973
32974
32975
32976
32977
32978
32979
32980
32981
32982
32983
32984
32985
32986
32987
32988
32989
32990
32991
32992
32993
32994
32995
32996
32997
32998
32999
33000
33001
33002
33003
33004
33005
33006
33007
33008
33009
33010
33011
33012
33013
33014
33015
33016
33017
33018
33019
33020
33021
33022
33023
33024
33025
33026
33027
33028
33029
33030
33031
33032
33033
33034
33035
33036
33037
33038
33039
33040
33041
33042
33043
33044
33045
33046
33047
33048
33049
33050
33051
33052
33053
33054
33055
33056
33057
33058
33059
33060
33061
33062
33063
33064
33065
33066
33067
33068
33069
33070
33071
33072
33073
33074
33075
33076
33077
33078
33079
33080
33081
33082
33083
33084
33085
33086
33087
33088
33089
33090
33091
33092
33093
33094
33095
33096
33097
33098
33099
33100
33101
33102
33103
33104
33105
33106
33107
33108
33109
33110
33111
33112
33113
33114
33115
33116
33117
33118
33119
33120
33121
33122
33123
33124
33125
33126
33127
33128
33129
33130
33131
33132
33133
33134
33135
33136
33137
33138
33139
33140
33141
33142
33143
33144
33145
33146
33147
33148
33149
33150
33151
33152
33153
33154
33155
33156
33157
33158
33159
33160
33161
33162
33163
33164
33165
33166
33167
33168
33169
33170
33171
33172
33173
33174
33175
33176
33177
33178
33179
33180
33181
33182
33183
33184
33185
33186
33187
33188
33189
33190
33191
33192
33193
33194
33195
33196
33197
33198
33199
33200
33201
33202
33203
33204
33205
33206
33207
33208
33209
33210
33211
33212
33213
33214
33215
33216
33217
33218
33219
33220
33221
33222
33223
33224
33225
33226
33227
33228
33229
33230
33231
33232
33233
33234
33235
33236
33237
33238
33239
33240
33241
33242
33243
33244
33245
33246
33247
33248
33249
33250
33251
33252
33253
33254
33255
33256
33257
33258
33259
33260
33261
33262
33263
33264
33265
33266
33267
33268
33269
33270
33271
33272
33273
33274
33275
33276
33277
33278
33279
33280
33281
33282
33283
33284
33285
33286
33287
33288
33289
33290
33291
33292
33293
33294
33295
33296
33297
33298
33299
33300
33301
33302
33303
33304
33305
33306
33307
33308
33309
33310
33311
33312
33313
33314
33315
33316
33317
33318
33319
33320
33321
33322
33323
33324
33325
33326
33327
33328
33329
33330
33331
33332
33333
33334
33335
33336
33337
33338
33339
33340
33341
33342
33343
33344
33345
33346
33347
33348
33349
33350
33351
33352
33353
33354
33355
33356
33357
33358
33359
33360
33361
33362
33363
33364
33365
33366
33367
33368
33369
33370
33371
33372
33373
33374
33375
33376
33377
33378
33379
33380
33381
33382
33383
33384
33385
33386
33387
33388
33389
33390
33391
33392
33393
33394
33395
33396
33397
33398
33399
33400
33401
33402
33403
33404
33405
33406
33407
33408
33409
33410
33411
33412
33413
33414
33415
33416
33417
33418
33419
33420
33421
33422
33423
33424
33425
33426
33427
33428
33429
33430
33431
33432
33433
33434
33435
33436
33437
33438
33439
33440
33441
33442
33443
33444
33445
33446
33447
33448
33449
33450
33451
33452
33453
33454
33455
33456
33457
33458
33459
33460
33461
33462
33463
33464
33465
33466
33467
33468
33469
33470
33471
33472
33473
33474
33475
33476
33477
33478
33479
33480
33481
33482
33483
33484
33485
33486
33487
33488
33489
33490
33491
33492
33493
33494
33495
33496
33497
33498
33499
33500
33501
33502
33503
33504
33505
33506
33507
33508
33509
33510
33511
33512
33513
33514
33515
33516
33517
33518
33519
33520
33521
33522
33523
33524
33525
33526
33527
33528
33529
33530
33531
33532
33533
33534
33535
33536
33537
33538
33539
33540
33541
33542
33543
33544
33545
33546
33547
33548
33549
33550
33551
33552
33553
33554
33555
33556
33557
33558
33559
33560
33561
33562
33563
33564
33565
33566
33567
33568
33569
33570
33571
33572
33573
33574
33575
33576
33577
33578
33579
33580
33581
33582
33583
33584
33585
33586
33587
33588
33589
33590
33591
33592
33593
33594
33595
33596
33597
33598
33599
33600
33601
33602
33603
33604
33605
33606
33607
33608
33609
33610
33611
33612
33613
33614
33615
33616
33617
33618
33619
33620
33621
33622
33623
33624
33625
33626
33627
33628
33629
33630
33631
33632
33633
33634
33635
33636
33637
33638
33639
33640
33641
33642
33643
33644
33645
33646
33647
33648
33649
33650
33651
33652
33653
33654
33655
33656
33657
33658
33659
33660
33661
33662
33663
33664
33665
33666
33667
33668
33669
33670
33671
33672
33673
33674
33675
33676
33677
33678
33679
33680
33681
33682
33683
33684
33685
33686
33687
33688
33689
33690
33691
33692
33693
33694
33695
33696
33697
33698
33699
33700
33701
33702
33703
33704
33705
33706
33707
33708
33709
33710
33711
33712
33713
33714
33715
33716
33717
33718
33719
33720
33721
33722
33723
33724
33725
33726
33727
33728
33729
33730
33731
33732
33733
33734
33735
33736
33737
33738
33739
33740
33741
33742
33743
33744
33745
33746
33747
33748
33749
33750
33751
33752
33753
33754
33755
33756
33757
33758
33759
33760
33761
33762
33763
33764
33765
33766
33767
33768
33769
33770
33771
33772
33773
33774
33775
33776
33777
33778
33779
33780
33781
33782
33783
33784
33785
33786
33787
33788
33789
33790
33791
33792
33793
33794
33795
33796
33797
33798
33799
33800
33801
33802
33803
33804
33805
33806
33807
33808
33809
33810
33811
33812
33813
33814
33815
33816
33817
33818
33819
33820
33821
33822
33823
33824
33825
33826
33827
33828
33829
33830
33831
33832
33833
33834
33835
33836
33837
33838
33839
33840
33841
33842
33843
33844
33845
33846
33847
33848
33849
33850
33851
33852
33853
33854
33855
33856
33857
33858
33859
33860
33861
33862
33863
33864
33865
33866
33867
33868
33869
33870
33871
33872
33873
33874
33875
33876
33877
33878
33879
33880
33881
33882
33883
33884
33885
33886
33887
33888
33889
33890
33891
33892
33893
33894
33895
33896
33897
33898
33899
33900
33901
33902
33903
33904
33905
33906
33907
33908
33909
33910
33911
33912
33913
33914
33915
33916
33917
33918
33919
33920
33921
33922
33923
33924
33925
33926
33927
33928
33929
33930
33931
33932
33933
33934
33935
33936
33937
33938
33939
33940
33941
33942
33943
33944
33945
33946
33947
33948
33949
33950
33951
33952
33953
33954
33955
33956
33957
33958
33959
33960
33961
33962
33963
33964
33965
33966
33967
33968
33969
33970
33971
33972
33973
33974
33975
33976
33977
33978
33979
33980
33981
33982
33983
33984
33985
33986
33987
33988
33989
33990
33991
33992
33993
33994
33995
33996
33997
33998
33999
34000
34001
34002
34003
34004
34005
34006
34007
34008
34009
34010
34011
34012
34013
34014
34015
34016
34017
34018
34019
34020
34021
34022
34023
34024
34025
34026
34027
34028
34029
34030
34031
34032
34033
34034
34035
34036
34037
34038
34039
34040
34041
34042
34043
34044
34045
34046
34047
34048
34049
34050
34051
34052
34053
34054
34055
34056
34057
34058
34059
34060
34061
34062
34063
34064
34065
34066
34067
34068
34069
34070
34071
34072
34073
34074
34075
34076
34077
34078
34079
34080
34081
34082
34083
34084
34085
34086
34087
34088
34089
34090
34091
34092
34093
34094
34095
34096
34097
34098
34099
34100
34101
34102
34103
34104
34105
34106
34107
34108
34109
34110
34111
34112
34113
34114
34115
34116
34117
34118
34119
34120
34121
34122
34123
34124
34125
34126
34127
34128
34129
34130
34131
34132
34133
34134
34135
34136
34137
34138
34139
34140
34141
34142
34143
34144
34145
34146
34147
34148
34149
34150
34151
34152
34153
34154
34155
34156
34157
34158
34159
34160
34161
34162
34163
34164
34165
34166
34167
34168
34169
34170
34171
34172
34173
34174
34175
34176
34177
34178
34179
34180
34181
34182
34183
34184
34185
34186
34187
34188
34189
34190
34191
34192
34193
34194
34195
34196
34197
34198
34199
34200
34201
34202
34203
34204
34205
34206
34207
34208
34209
34210
34211
34212
34213
34214
34215
34216
34217
34218
34219
34220
34221
34222
34223
34224
34225
34226
34227
34228
34229
34230
34231
34232
34233
34234
34235
34236
34237
34238
34239
34240
34241
34242
34243
34244
34245
34246
34247
34248
34249
34250
34251
34252
34253
34254
34255
34256
34257
34258
34259
34260
34261
34262
34263
34264
34265
34266
34267
34268
34269
34270
34271
34272
34273
34274
34275
34276
34277
34278
34279
34280
34281
34282
34283
34284
34285
34286
34287
34288
34289
34290
34291
34292
34293
34294
34295
34296
34297
34298
34299
34300
34301
34302
34303
34304
34305
34306
34307
34308
34309
34310
34311
34312
34313
34314
34315
34316
34317
34318
34319
34320
34321
34322
34323
34324
34325
34326
34327
34328
34329
34330
34331
34332
34333
34334
34335
34336
34337
34338
34339
34340
34341
34342
34343
34344
34345
34346
34347
34348
34349
34350
34351
34352
34353
34354
34355
34356
34357
34358
34359
34360
34361
34362
34363
34364
34365
34366
34367
34368
34369
34370
34371
34372
34373
34374
34375
34376
34377
34378
34379
34380
34381
34382
34383
34384
34385
34386
34387
34388
34389
34390
34391
34392
34393
34394
34395
34396
34397
34398
34399
34400
34401
34402
34403
34404
34405
34406
34407
34408
34409
34410
34411
34412
34413
34414
34415
34416
34417
34418
34419
34420
34421
34422
34423
34424
34425
34426
34427
34428
34429
34430
34431
34432
34433
34434
34435
34436
34437
34438
34439
34440
34441
34442
34443
34444
34445
34446
34447
34448
34449
34450
34451
34452
34453
34454
34455
34456
34457
34458
34459
34460
34461
34462
34463
34464
34465
34466
34467
34468
34469
34470
34471
34472
34473
34474
34475
34476
34477
34478
34479
34480
34481
34482
34483
34484
34485
34486
34487
34488
34489
34490
34491
34492
34493
34494
34495
34496
34497
34498
34499
34500
34501
34502
34503
34504
34505
34506
34507
34508
34509
34510
34511
34512
34513
34514
34515
34516
34517
34518
34519
34520
34521
34522
34523
34524
34525
34526
34527
34528
34529
34530
34531
34532
34533
34534
34535
34536
34537
34538
34539
34540
34541
34542
34543
34544
34545
34546
34547
34548
34549
34550
34551
34552
34553
34554
34555
34556
34557
34558
34559
34560
34561
34562
34563
34564
34565
34566
34567
34568
34569
34570
34571
34572
34573
34574
34575
34576
34577
34578
34579
34580
34581
34582
34583
34584
34585
34586
34587
34588
34589
34590
34591
34592
34593
34594
34595
34596
34597
34598
34599
34600
34601
34602
34603
34604
34605
34606
34607
34608
34609
34610
34611
34612
34613
34614
34615
34616
34617
34618
34619
34620
34621
34622
34623
34624
34625
34626
34627
34628
34629
34630
34631
34632
34633
34634
34635
34636
34637
34638
34639
34640
34641
34642
34643
34644
34645
34646
34647
34648
34649
34650
34651
34652
34653
34654
34655
34656
34657
34658
34659
34660
34661
34662
34663
34664
34665
34666
34667
34668
34669
34670
34671
34672
34673
34674
34675
34676
34677
34678
34679
34680
34681
34682
34683
34684
34685
34686
34687
34688
34689
34690
34691
34692
34693
34694
34695
34696
34697
34698
34699
34700
34701
34702
34703
34704
34705
34706
34707
34708
34709
34710
34711
34712
34713
34714
34715
34716
34717
34718
34719
34720
34721
34722
34723
34724
34725
34726
34727
34728
34729
34730
34731
34732
34733
34734
34735
34736
34737
34738
34739
34740
34741
34742
34743
34744
34745
34746
34747
34748
34749
34750
34751
34752
34753
34754
34755
34756
34757
34758
34759
34760
34761
34762
34763
34764
34765
34766
34767
34768
34769
34770
34771
34772
34773
34774
34775
34776
34777
34778
34779
34780
34781
34782
34783
34784
34785
34786
34787
34788
34789
34790
34791
34792
34793
34794
34795
34796
34797
34798
34799
34800
34801
34802
34803
34804
34805
34806
34807
34808
34809
34810
34811
34812
34813
34814
34815
34816
34817
34818
34819
34820
34821
34822
34823
34824
34825
34826
34827
34828
34829
34830
34831
34832
34833
34834
34835
34836
34837
34838
34839
34840
34841
34842
34843
34844
34845
34846
34847
34848
34849
34850
34851
34852
34853
34854
34855
34856
34857
34858
34859
34860
34861
34862
34863
34864
34865
34866
34867
34868
34869
34870
34871
34872
34873
34874
34875
34876
34877
34878
34879
34880
34881
34882
34883
34884
34885
34886
34887
34888
34889
34890
34891
34892
34893
34894
34895
34896
34897
34898
34899
34900
34901
34902
34903
34904
34905
34906
34907
34908
34909
34910
34911
34912
34913
34914
34915
34916
34917
34918
34919
34920
34921
34922
34923
34924
34925
34926
34927
34928
34929
34930
34931
34932
34933
34934
34935
34936
34937
34938
34939
34940
34941
34942
34943
34944
34945
34946
34947
34948
34949
34950
34951
34952
34953
34954
34955
34956
34957
34958
34959
34960
34961
34962
34963
34964
34965
34966
34967
34968
34969
34970
34971
34972
34973
34974
34975
34976
34977
34978
34979
34980
34981
34982
34983
34984
34985
34986
34987
34988
34989
34990
34991
34992
34993
34994
34995
34996
34997
34998
34999
35000
35001
35002
35003
35004
35005
35006
35007
35008
35009
35010
35011
35012
35013
35014
35015
35016
35017
35018
35019
35020
35021
35022
35023
35024
35025
35026
35027
35028
35029
35030
35031
35032
35033
35034
35035
35036
35037
35038
35039
35040
35041
35042
35043
35044
35045
35046
35047
35048
35049
35050
35051
35052
35053
35054
35055
35056
35057
35058
35059
35060
35061
35062
35063
35064
35065
35066
35067
35068
35069
35070
35071
35072
35073
35074
35075
35076
35077
35078
35079
35080
35081
35082
35083
35084
35085
35086
35087
35088
35089
35090
35091
35092
35093
35094
35095
35096
35097
35098
35099
35100
35101
35102
35103
35104
35105
35106
35107
35108
35109
35110
35111
35112
35113
35114
35115
35116
35117
35118
35119
35120
35121
35122
35123
35124
35125
35126
35127
35128
35129
35130
35131
35132
35133
35134
35135
35136
35137
35138
35139
35140
35141
35142
35143
35144
35145
35146
35147
35148
35149
35150
35151
35152
35153
35154
35155
35156
35157
35158
35159
35160
35161
35162
35163
35164
35165
35166
35167
35168
35169
35170
35171
35172
35173
35174
35175
35176
35177
35178
35179
35180
35181
35182
35183
35184
35185
35186
35187
35188
35189
35190
35191
35192
35193
35194
35195
35196
35197
35198
35199
35200
35201
35202
35203
35204
35205
35206
35207
35208
35209
35210
35211
35212
35213
35214
35215
35216
35217
35218
35219
35220
35221
35222
35223
35224
35225
35226
35227
35228
35229
35230
35231
35232
35233
35234
35235
35236
35237
35238
35239
35240
35241
35242
35243
35244
35245
35246
35247
35248
35249
35250
35251
35252
35253
35254
35255
35256
35257
35258
35259
35260
35261
35262
35263
35264
35265
35266
35267
35268
35269
35270
35271
35272
35273
35274
35275
35276
35277
35278
35279
35280
35281
35282
35283
35284
35285
35286
35287
35288
35289
35290
35291
35292
35293
35294
35295
35296
35297
35298
35299
35300
35301
35302
35303
35304
35305
35306
35307
35308
35309
35310
35311
35312
35313
35314
35315
35316
35317
35318
35319
35320
35321
35322
35323
35324
35325
35326
35327
35328
35329
35330
35331
35332
35333
35334
35335
35336
35337
35338
35339
35340
35341
35342
35343
35344
35345
35346
35347
35348
35349
35350
35351
35352
35353
35354
35355
35356
35357
35358
35359
35360
35361
35362
35363
35364
35365
35366
35367
35368
35369
35370
35371
35372
35373
35374
35375
35376
35377
35378
35379
35380
35381
35382
35383
35384
35385
35386
35387
35388
35389
35390
35391
35392
35393
35394
35395
35396
35397
35398
35399
35400
35401
35402
35403
35404
35405
35406
35407
35408
35409
35410
35411
35412
35413
35414
35415
35416
35417
35418
35419
35420
35421
35422
35423
35424
35425
35426
35427
35428
35429
35430
35431
35432
35433
35434
35435
35436
35437
35438
35439
35440
35441
35442
35443
35444
35445
35446
35447
35448
35449
35450
35451
35452
35453
35454
35455
35456
35457
35458
35459
35460
35461
35462
35463
35464
35465
35466
35467
35468
35469
35470
35471
35472
35473
35474
35475
35476
35477
35478
35479
35480
35481
35482
35483
35484
35485
35486
35487
35488
35489
35490
35491
35492
35493
35494
35495
35496
35497
35498
35499
35500
35501
35502
35503
35504
35505
35506
35507
35508
35509
35510
35511
35512
35513
35514
35515
35516
35517
35518
35519
35520
35521
35522
35523
35524
35525
35526
35527
35528
35529
35530
35531
35532
35533
35534
35535
35536
35537
35538
35539
35540
35541
35542
35543
35544
35545
35546
35547
35548
35549
35550
35551
35552
35553
35554
35555
35556
35557
35558
35559
35560
35561
35562
35563
35564
35565
35566
35567
35568
35569
35570
35571
35572
35573
35574
35575
35576
35577
35578
35579
35580
35581
35582
35583
35584
35585
35586
35587
35588
35589
35590
35591
35592
35593
35594
35595
35596
35597
35598
35599
35600
35601
35602
35603
35604
35605
35606
35607
35608
35609
35610
35611
35612
35613
35614
35615
35616
35617
35618
35619
35620
35621
35622
35623
35624
35625
35626
35627
35628
35629
35630
35631
35632
35633
35634
35635
35636
35637
35638
35639
35640
35641
35642
35643
35644
35645
35646
35647
35648
35649
35650
35651
35652
35653
35654
35655
35656
35657
35658
35659
35660
35661
35662
35663
35664
35665
35666
35667
35668
35669
35670
35671
35672
35673
35674
35675
35676
35677
35678
35679
35680
35681
35682
35683
35684
35685
35686
35687
35688
35689
35690
35691
35692
35693
35694
35695
35696
35697
35698
35699
35700
35701
35702
35703
35704
35705
35706
35707
35708
35709
35710
35711
35712
35713
35714
35715
35716
35717
35718
35719
35720
35721
35722
35723
35724
35725
35726
35727
35728
35729
35730
35731
35732
35733
35734
35735
35736
35737
35738
35739
35740
35741
35742
35743
35744
35745
35746
35747
35748
35749
35750
35751
35752
35753
35754
35755
35756
35757
35758
35759
35760
35761
35762
35763
35764
35765
35766
35767
35768
35769
35770
35771
35772
35773
35774
35775
35776
35777
35778
35779
35780
35781
35782
35783
35784
35785
35786
35787
35788
35789
35790
35791
35792
35793
35794
35795
35796
35797
35798
35799
35800
35801
35802
35803
35804
35805
35806
35807
35808
35809
35810
35811
35812
35813
35814
35815
35816
35817
35818
35819
35820
35821
35822
35823
35824
35825
35826
35827
35828
35829
35830
35831
35832
35833
35834
35835
35836
35837
35838
35839
35840
35841
35842
35843
35844
35845
35846
35847
35848
35849
35850
35851
35852
35853
35854
35855
35856
35857
35858
35859
35860
35861
35862
35863
35864
35865
35866
35867
35868
35869
35870
35871
35872
35873
35874
35875
35876
35877
35878
35879
35880
35881
35882
35883
35884
35885
35886
35887
35888
35889
35890
35891
35892
35893
35894
35895
35896
35897
35898
35899
35900
35901
35902
35903
35904
35905
35906
35907
35908
35909
35910
35911
35912
35913
35914
35915
35916
35917
35918
35919
35920
35921
35922
35923
35924
35925
35926
35927
35928
35929
35930
35931
35932
35933
35934
35935
35936
35937
35938
35939
35940
35941
35942
35943
35944
35945
35946
35947
35948
35949
35950
35951
35952
35953
35954
35955
35956
35957
35958
35959
35960
35961
35962
35963
35964
35965
35966
35967
35968
35969
35970
35971
35972
35973
35974
35975
35976
35977
35978
35979
35980
35981
35982
35983
35984
35985
35986
35987
35988
35989
35990
35991
35992
35993
35994
35995
35996
35997
35998
35999
36000
36001
36002
36003
36004
36005
36006
36007
36008
36009
36010
36011
36012
36013
36014
36015
36016
36017
36018
36019
36020
36021
36022
36023
36024
36025
36026
36027
36028
36029
36030
36031
36032
36033
36034
36035
36036
36037
36038
36039
36040
36041
36042
36043
36044
36045
36046
36047
36048
36049
36050
36051
36052
36053
36054
36055
36056
36057
36058
36059
36060
36061
36062
36063
36064
36065
36066
36067
36068
36069
36070
36071
36072
36073
36074
36075
36076
36077
36078
36079
36080
36081
36082
36083
36084
36085
36086
36087
36088
36089
36090
36091
36092
36093
36094
36095
36096
36097
36098
36099
36100
36101
36102
36103
36104
36105
36106
36107
36108
36109
36110
36111
36112
36113
36114
36115
36116
36117
36118
36119
36120
36121
36122
36123
36124
36125
36126
36127
36128
36129
36130
36131
36132
36133
36134
36135
36136
36137
36138
36139
36140
36141
36142
36143
36144
36145
36146
36147
36148
36149
36150
36151
36152
36153
36154
36155
36156
36157
36158
36159
36160
36161
36162
36163
36164
36165
36166
36167
36168
36169
36170
36171
36172
36173
36174
36175
36176
36177
36178
36179
36180
36181
36182
36183
36184
36185
36186
36187
36188
36189
36190
36191
36192
36193
36194
36195
36196
36197
36198
36199
36200
36201
36202
36203
36204
36205
36206
36207
36208
36209
36210
36211
36212
36213
36214
36215
36216
36217
36218
36219
36220
36221
36222
36223
36224
36225
36226
36227
36228
36229
36230
36231
36232
36233
36234
36235
36236
36237
36238
36239
36240
36241
36242
36243
36244
36245
36246
36247
36248
36249
36250
36251
36252
36253
36254
36255
36256
36257
36258
36259
36260
36261
36262
36263
36264
36265
36266
36267
36268
36269
36270
36271
36272
36273
36274
36275
36276
36277
36278
36279
36280
36281
36282
36283
36284
36285
36286
36287
36288
36289
36290
36291
36292
36293
36294
36295
36296
36297
36298
36299
36300
36301
36302
36303
36304
36305
36306
36307
36308
36309
36310
36311
36312
36313
36314
36315
36316
36317
36318
36319
36320
36321
36322
36323
36324
36325
36326
36327
36328
36329
36330
36331
36332
36333
36334
36335
36336
36337
36338
36339
36340
36341
36342
36343
36344
36345
36346
36347
36348
36349
36350
36351
36352
36353
36354
36355
36356
36357
36358
36359
36360
36361
36362
36363
36364
36365
36366
36367
36368
36369
36370
36371
36372
36373
36374
36375
36376
36377
36378
36379
36380
36381
36382
36383
36384
36385
36386
36387
36388
36389
36390
36391
36392
36393
36394
36395
36396
36397
36398
36399
36400
36401
36402
36403
36404
36405
36406
36407
36408
36409
36410
36411
36412
36413
36414
36415
36416
36417
36418
36419
36420
36421
36422
36423
36424
36425
36426
36427
36428
36429
36430
36431
36432
36433
36434
36435
36436
36437
36438
36439
36440
36441
36442
36443
36444
36445
36446
36447
36448
36449
36450
36451
36452
36453
36454
36455
36456
36457
36458
36459
36460
36461
36462
36463
36464
36465
36466
36467
36468
36469
36470
36471
36472
36473
36474
36475
36476
36477
36478
36479
36480
36481
36482
36483
36484
36485
36486
36487
36488
36489
36490
36491
36492
36493
36494
36495
36496
36497
36498
36499
36500
36501
36502
36503
36504
36505
36506
36507
36508
36509
36510
36511
36512
36513
36514
36515
36516
36517
36518
36519
36520
36521
36522
36523
36524
36525
36526
36527
36528
36529
36530
36531
36532
36533
36534
36535
36536
36537
36538
36539
36540
36541
36542
36543
36544
36545
36546
36547
36548
36549
36550
36551
36552
36553
36554
36555
36556
36557
36558
36559
36560
36561
36562
36563
36564
36565
36566
36567
36568
36569
36570
36571
36572
36573
36574
36575
36576
36577
36578
36579
36580
36581
36582
36583
36584
36585
36586
36587
36588
36589
36590
36591
36592
36593
36594
36595
36596
36597
36598
36599
36600
36601
36602
36603
36604
36605
36606
36607
36608
36609
36610
36611
36612
36613
36614
36615
36616
36617
36618
36619
36620
36621
36622
36623
36624
36625
36626
36627
36628
36629
36630
36631
36632
36633
36634
36635
36636
36637
36638
36639
36640
36641
36642
36643
36644
36645
36646
36647
36648
36649
36650
36651
36652
36653
36654
36655
36656
36657
36658
36659
36660
36661
36662
36663
36664
36665
36666
36667
36668
36669
36670
36671
36672
36673
36674
36675
36676
36677
36678
36679
36680
36681
36682
36683
36684
36685
36686
36687
36688
36689
36690
36691
36692
36693
36694
36695
36696
36697
36698
36699
36700
36701
36702
36703
36704
36705
36706
36707
36708
36709
36710
36711
36712
36713
36714
36715
36716
36717
36718
36719
36720
36721
36722
36723
36724
36725
36726
36727
36728
36729
36730
36731
36732
36733
36734
36735
36736
36737
36738
36739
36740
36741
36742
36743
36744
36745
36746
36747
36748
36749
36750
36751
36752
36753
36754
36755
36756
36757
36758
36759
36760
36761
36762
36763
36764
36765
36766
36767
36768
36769
36770
36771
36772
36773
36774
36775
36776
36777
36778
36779
36780
36781
36782
36783
36784
36785
36786
36787
36788
36789
36790
36791
36792
36793
36794
36795
36796
36797
36798
36799
36800
36801
36802
36803
36804
36805
36806
36807
36808
36809
36810
36811
36812
36813
36814
36815
36816
36817
36818
36819
36820
36821
36822
36823
36824
36825
36826
36827
36828
36829
36830
36831
36832
36833
36834
36835
36836
36837
36838
36839
36840
36841
36842
36843
36844
36845
36846
36847
36848
36849
36850
36851
36852
36853
36854
36855
36856
36857
36858
36859
36860
36861
36862
36863
36864
36865
36866
36867
36868
36869
36870
36871
36872
36873
36874
36875
36876
36877
36878
36879
36880
36881
36882
36883
36884
36885
36886
36887
36888
36889
36890
36891
36892
36893
36894
36895
36896
36897
36898
36899
36900
36901
36902
36903
36904
36905
36906
36907
36908
36909
36910
36911
36912
36913
36914
36915
36916
36917
36918
36919
36920
36921
36922
36923
36924
36925
36926
36927
36928
36929
36930
36931
36932
36933
36934
36935
36936
36937
36938
36939
36940
36941
36942
36943
36944
36945
36946
36947
36948
36949
36950
36951
36952
36953
36954
36955
36956
36957
36958
36959
36960
36961
36962
36963
36964
36965
36966
36967
36968
36969
36970
36971
36972
36973
36974
36975
36976
36977
36978
36979
36980
36981
36982
36983
36984
36985
36986
36987
36988
36989
36990
36991
36992
36993
36994
36995
36996
36997
36998
36999
37000
37001
37002
37003
37004
37005
37006
37007
37008
37009
37010
37011
37012
37013
37014
37015
37016
37017
37018
37019
37020
37021
37022
37023
37024
37025
37026
37027
37028
37029
37030
37031
37032
37033
37034
37035
37036
37037
37038
37039
37040
37041
37042
37043
37044
37045
37046
37047
37048
37049
37050
37051
37052
37053
37054
37055
37056
37057
37058
37059
37060
37061
37062
37063
37064
37065
37066
37067
37068
37069
37070
37071
37072
37073
37074
37075
37076
37077
37078
37079
37080
37081
37082
37083
37084
37085
37086
37087
37088
37089
37090
37091
37092
37093
37094
37095
37096
37097
37098
37099
37100
37101
37102
37103
37104
37105
37106
37107
37108
37109
37110
37111
37112
37113
37114
37115
37116
37117
37118
37119
37120
37121
37122
37123
37124
37125
37126
37127
37128
37129
37130
37131
37132
37133
37134
37135
37136
37137
37138
37139
37140
37141
37142
37143
37144
37145
37146
37147
37148
37149
37150
37151
37152
37153
37154
37155
37156
37157
37158
37159
37160
37161
37162
37163
37164
37165
37166
37167
37168
37169
37170
37171
37172
37173
37174
37175
37176
37177
37178
37179
37180
37181
37182
37183
37184
37185
37186
37187
37188
37189
37190
37191
37192
37193
37194
37195
37196
37197
37198
37199
37200
37201
37202
37203
37204
37205
37206
37207
37208
37209
37210
37211
37212
37213
37214
37215
37216
37217
37218
37219
37220
37221
37222
37223
37224
37225
37226
37227
37228
37229
37230
37231
37232
37233
37234
37235
37236
37237
37238
37239
37240
37241
37242
37243
37244
37245
37246
37247
37248
37249
37250
37251
37252
37253
37254
37255
37256
37257
37258
37259
37260
37261
37262
37263
37264
37265
37266
37267
37268
37269
37270
37271
37272
37273
37274
37275
37276
37277
37278
37279
37280
37281
37282
37283
37284
37285
37286
37287
37288
37289
37290
37291
37292
37293
37294
37295
37296
37297
37298
37299
37300
37301
37302
37303
37304
37305
37306
37307
37308
37309
37310
37311
37312
37313
37314
37315
37316
37317
37318
37319
37320
37321
37322
37323
37324
37325
37326
37327
37328
37329
37330
37331
37332
37333
37334
37335
37336
37337
37338
37339
37340
37341
37342
37343
37344
37345
37346
37347
37348
37349
37350
37351
37352
37353
37354
37355
37356
37357
37358
37359
37360
37361
37362
37363
37364
37365
37366
37367
37368
37369
37370
37371
37372
37373
37374
37375
37376
37377
37378
37379
37380
37381
37382
37383
37384
37385
37386
37387
37388
37389
37390
37391
37392
37393
37394
37395
37396
37397
37398
37399
37400
37401
37402
37403
37404
37405
37406
37407
37408
37409
37410
37411
37412
37413
37414
37415
37416
37417
37418
37419
37420
37421
37422
37423
37424
37425
37426
37427
37428
37429
37430
37431
37432
37433
37434
37435
37436
37437
37438
37439
37440
37441
37442
37443
37444
37445
37446
37447
37448
37449
37450
37451
37452
37453
37454
37455
37456
37457
37458
37459
37460
37461
37462
37463
37464
37465
37466
37467
37468
37469
37470
37471
37472
37473
37474
37475
37476
37477
37478
37479
37480
37481
37482
37483
37484
37485
37486
37487
37488
37489
37490
37491
37492
37493
37494
37495
37496
37497
37498
37499
37500
37501
37502
37503
37504
37505
37506
37507
37508
37509
37510
37511
37512
37513
37514
37515
37516
37517
37518
37519
37520
37521
37522
37523
37524
37525
37526
37527
37528
37529
37530
37531
37532
37533
37534
37535
37536
37537
37538
37539
37540
37541
37542
37543
37544
37545
37546
37547
37548
37549
37550
37551
37552
37553
37554
37555
37556
37557
37558
37559
37560
37561
37562
37563
37564
37565
37566
37567
37568
37569
37570
37571
37572
37573
37574
37575
37576
37577
37578
37579
37580
37581
37582
37583
37584
37585
37586
37587
37588
37589
37590
37591
37592
37593
37594
37595
37596
37597
37598
37599
37600
37601
37602
37603
37604
37605
37606
37607
37608
37609
37610
37611
37612
37613
37614
37615
37616
37617
37618
37619
37620
37621
37622
37623
37624
37625
37626
37627
37628
37629
37630
37631
37632
37633
37634
37635
37636
37637
37638
37639
37640
37641
37642
37643
37644
37645
37646
37647
37648
37649
37650
37651
37652
37653
37654
37655
37656
37657
37658
37659
37660
37661
37662
37663
37664
37665
37666
37667
37668
37669
37670
37671
37672
37673
37674
37675
37676
37677
37678
37679
37680
37681
37682
37683
37684
37685
37686
37687
37688
37689
37690
37691
37692
37693
37694
37695
37696
37697
37698
37699
37700
37701
37702
37703
37704
37705
37706
37707
37708
37709
37710
37711
37712
37713
37714
37715
37716
37717
37718
37719
37720
37721
37722
37723
37724
37725
37726
37727
37728
37729
37730
37731
37732
37733
37734
37735
37736
37737
37738
37739
37740
37741
37742
37743
37744
37745
37746
37747
37748
37749
37750
37751
37752
37753
37754
37755
37756
37757
37758
37759
37760
37761
37762
37763
37764
37765
37766
37767
37768
37769
37770
37771
37772
37773
37774
37775
37776
37777
37778
37779
37780
37781
37782
37783
37784
37785
37786
37787
37788
37789
37790
37791
37792
37793
37794
37795
37796
37797
37798
37799
37800
37801
37802
37803
37804
37805
37806
37807
37808
37809
37810
37811
37812
37813
37814
37815
37816
37817
37818
37819
37820
37821
37822
37823
37824
37825
37826
37827
37828
37829
37830
37831
37832
37833
37834
37835
37836
37837
37838
37839
37840
37841
37842
37843
37844
37845
37846
37847
37848
37849
37850
37851
37852
37853
37854
37855
37856
37857
37858
37859
37860
37861
37862
37863
37864
37865
37866
37867
37868
37869
37870
37871
37872
37873
37874
37875
37876
37877
37878
37879
37880
37881
37882
37883
37884
37885
37886
37887
37888
37889
37890
37891
37892
37893
37894
37895
37896
37897
37898
37899
37900
37901
37902
37903
37904
37905
37906
37907
37908
37909
37910
37911
37912
37913
37914
37915
37916
37917
37918
37919
37920
37921
37922
37923
37924
37925
37926
37927
37928
37929
37930
37931
37932
37933
37934
37935
37936
37937
37938
37939
37940
37941
37942
37943
37944
37945
37946
37947
37948
37949
37950
37951
37952
37953
37954
37955
37956
37957
37958
37959
37960
37961
37962
37963
37964
37965
37966
37967
37968
37969
37970
37971
37972
37973
37974
37975
37976
37977
37978
37979
37980
37981
37982
37983
37984
37985
37986
37987
37988
37989
37990
37991
37992
37993
37994
37995
37996
37997
37998
37999
38000
38001
38002
38003
38004
38005
38006
38007
38008
38009
38010
38011
38012
38013
38014
38015
38016
38017
38018
38019
38020
38021
38022
38023
38024
38025
38026
38027
38028
38029
38030
38031
38032
38033
38034
38035
38036
38037
38038
38039
38040
38041
38042
38043
38044
38045
38046
38047
38048
38049
38050
38051
38052
38053
38054
38055
38056
38057
38058
38059
38060
38061
38062
38063
38064
38065
38066
38067
38068
38069
38070
38071
38072
38073
38074
38075
38076
38077
38078
38079
38080
38081
38082
38083
38084
38085
38086
38087
38088
38089
38090
38091
38092
38093
38094
38095
38096
38097
38098
38099
38100
38101
38102
38103
38104
38105
38106
38107
38108
38109
38110
38111
38112
38113
38114
38115
38116
38117
38118
38119
38120
38121
38122
38123
38124
38125
38126
38127
38128
38129
38130
38131
38132
38133
38134
38135
38136
38137
38138
38139
38140
38141
38142
38143
38144
38145
38146
38147
38148
38149
38150
38151
38152
38153
38154
38155
38156
38157
38158
38159
38160
38161
38162
38163
38164
38165
38166
38167
38168
38169
38170
38171
38172
38173
38174
38175
38176
38177
38178
38179
38180
38181
38182
38183
38184
38185
38186
38187
38188
38189
38190
38191
38192
38193
38194
38195
38196
38197
38198
38199
38200
38201
38202
38203
38204
38205
38206
38207
38208
38209
38210
38211
38212
38213
38214
38215
38216
38217
38218
38219
38220
38221
38222
38223
38224
38225
38226
38227
38228
38229
38230
38231
38232
38233
38234
38235
38236
38237
38238
38239
38240
38241
38242
38243
38244
38245
38246
38247
38248
38249
38250
38251
38252
38253
38254
38255
38256
38257
38258
38259
38260
38261
38262
38263
38264
38265
38266
38267
38268
38269
38270
38271
38272
38273
38274
38275
38276
38277
38278
38279
38280
38281
38282
38283
38284
38285
38286
38287
38288
38289
38290
38291
38292
38293
38294
38295
38296
38297
38298
38299
38300
38301
38302
38303
38304
38305
38306
38307
38308
38309
38310
38311
38312
38313
38314
38315
38316
38317
38318
38319
38320
38321
38322
38323
38324
38325
38326
38327
38328
38329
38330
38331
38332
38333
38334
38335
38336
38337
38338
38339
38340
38341
38342
38343
38344
38345
38346
38347
38348
38349
38350
38351
38352
38353
38354
38355
38356
38357
38358
38359
38360
38361
38362
38363
38364
38365
38366
38367
38368
38369
38370
38371
38372
38373
38374
38375
38376
38377
38378
38379
38380
38381
38382
38383
38384
38385
38386
38387
38388
38389
38390
38391
38392
38393
38394
38395
38396
38397
38398
38399
38400
38401
38402
38403
38404
38405
38406
38407
38408
38409
38410
38411
38412
38413
38414
38415
38416
38417
38418
38419
38420
38421
38422
38423
38424
38425
38426
38427
38428
38429
38430
38431
38432
38433
38434
38435
38436
38437
38438
38439
38440
38441
38442
38443
38444
38445
38446
38447
38448
38449
38450
38451
38452
38453
38454
38455
38456
38457
38458
38459
38460
38461
38462
38463
38464
38465
38466
38467
38468
38469
38470
38471
38472
38473
38474
38475
38476
38477
38478
38479
38480
38481
38482
38483
38484
38485
38486
38487
38488
38489
38490
38491
38492
38493
38494
38495
38496
38497
38498
38499
38500
38501
38502
38503
38504
38505
38506
38507
38508
38509
38510
38511
38512
38513
38514
38515
38516
38517
38518
38519
38520
38521
38522
38523
38524
38525
38526
38527
38528
38529
38530
38531
38532
38533
38534
38535
38536
38537
38538
38539
38540
38541
38542
38543
38544
38545
38546
38547
38548
38549
38550
38551
38552
38553
38554
38555
38556
38557
38558
38559
38560
38561
38562
38563
38564
38565
38566
38567
38568
38569
38570
38571
38572
38573
38574
38575
38576
38577
38578
38579
38580
38581
38582
38583
38584
38585
38586
38587
38588
38589
38590
38591
38592
38593
38594
38595
38596
38597
38598
38599
38600
38601
38602
38603
38604
38605
38606
38607
38608
38609
38610
38611
38612
38613
38614
38615
38616
38617
38618
38619
38620
38621
38622
38623
38624
38625
38626
38627
38628
38629
38630
38631
38632
38633
38634
38635
38636
38637
38638
38639
38640
38641
38642
38643
38644
38645
38646
38647
38648
38649
38650
38651
38652
38653
38654
38655
38656
38657
38658
38659
38660
38661
38662
38663
38664
38665
38666
38667
38668
38669
38670
38671
38672
38673
38674
38675
38676
38677
38678
38679
38680
38681
38682
38683
38684
38685
38686
38687
38688
38689
38690
38691
38692
38693
38694
38695
38696
38697
38698
38699
38700
38701
38702
38703
38704
38705
38706
38707
38708
38709
38710
38711
38712
38713
38714
38715
38716
38717
38718
38719
38720
38721
38722
38723
38724
38725
38726
38727
38728
38729
38730
38731
38732
38733
38734
38735
38736
38737
38738
38739
38740
38741
38742
38743
38744
38745
38746
38747
38748
38749
38750
38751
38752
38753
38754
38755
38756
38757
38758
38759
38760
38761
38762
38763
38764
38765
38766
38767
38768
38769
38770
38771
38772
38773
38774
38775
38776
38777
38778
38779
38780
38781
38782
38783
38784
38785
38786
38787
38788
38789
38790
38791
38792
38793
38794
38795
38796
38797
38798
38799
38800
38801
38802
38803
38804
38805
38806
38807
38808
38809
38810
38811
38812
38813
38814
38815
38816
38817
38818
38819
38820
38821
38822
38823
38824
38825
38826
38827
38828
38829
38830
38831
38832
38833
38834
38835
38836
38837
38838
38839
38840
38841
38842
38843
38844
38845
38846
38847
38848
38849
38850
38851
38852
38853
38854
38855
38856
38857
38858
38859
38860
38861
38862
38863
38864
38865
38866
38867
38868
38869
38870
38871
38872
38873
38874
38875
38876
38877
38878
38879
38880
38881
38882
38883
38884
38885
38886
38887
38888
38889
38890
38891
38892
38893
38894
38895
38896
38897
38898
38899
38900
38901
38902
38903
38904
38905
38906
38907
38908
38909
38910
38911
38912
38913
38914
38915
38916
38917
38918
38919
38920
38921
38922
38923
38924
38925
38926
38927
38928
38929
38930
38931
38932
38933
38934
38935
38936
38937
38938
38939
38940
38941
38942
38943
38944
38945
38946
38947
38948
38949
38950
38951
38952
38953
38954
38955
38956
38957
38958
38959
38960
38961
38962
38963
38964
38965
38966
38967
38968
38969
38970
38971
38972
38973
38974
38975
38976
38977
38978
38979
38980
38981
38982
38983
38984
38985
38986
38987
38988
38989
38990
38991
38992
38993
38994
38995
38996
38997
38998
38999
39000
39001
39002
39003
39004
39005
39006
39007
39008
39009
39010
39011
39012
39013
39014
39015
39016
39017
39018
39019
39020
39021
39022
39023
39024
39025
39026
39027
39028
39029
39030
39031
39032
39033
39034
39035
39036
39037
39038
39039
39040
39041
39042
39043
39044
39045
39046
39047
39048
39049
39050
39051
39052
39053
39054
39055
39056
39057
39058
39059
39060
39061
39062
39063
39064
39065
39066
39067
39068
39069
39070
39071
39072
39073
39074
39075
39076
39077
39078
39079
39080
39081
39082
39083
39084
39085
39086
39087
39088
39089
39090
39091
39092
39093
39094
39095
39096
39097
39098
39099
39100
39101
39102
39103
39104
39105
39106
39107
39108
39109
39110
39111
39112
39113
39114
39115
39116
39117
39118
39119
39120
39121
39122
39123
39124
39125
39126
39127
39128
39129
39130
39131
39132
39133
39134
39135
39136
39137
39138
39139
39140
39141
39142
39143
39144
39145
39146
39147
39148
39149
39150
39151
39152
39153
39154
39155
39156
39157
39158
39159
39160
39161
39162
39163
39164
39165
39166
39167
39168
39169
39170
39171
39172
39173
39174
39175
39176
39177
39178
39179
39180
39181
39182
39183
39184
39185
39186
39187
39188
39189
39190
39191
39192
39193
39194
39195
39196
39197
39198
39199
39200
39201
39202
39203
39204
39205
39206
39207
39208
39209
39210
39211
39212
39213
39214
39215
39216
39217
39218
39219
39220
39221
39222
39223
39224
39225
39226
39227
39228
39229
39230
39231
39232
39233
39234
39235
39236
39237
39238
39239
39240
39241
39242
39243
39244
39245
39246
39247
39248
39249
39250
39251
39252
39253
39254
39255
39256
39257
39258
39259
39260
39261
39262
39263
39264
39265
39266
39267
39268
39269
39270
39271
39272
39273
39274
39275
39276
39277
39278
39279
39280
39281
39282
39283
39284
39285
39286
39287
39288
39289
39290
39291
39292
39293
39294
39295
39296
39297
39298
39299
39300
39301
39302
39303
39304
39305
39306
39307
39308
39309
39310
39311
39312
39313
39314
39315
39316
39317
39318
39319
39320
39321
39322
39323
39324
39325
39326
39327
39328
39329
39330
39331
39332
39333
39334
39335
39336
39337
39338
39339
39340
39341
39342
39343
39344
39345
39346
39347
39348
39349
39350
39351
39352
39353
39354
39355
39356
39357
39358
39359
39360
39361
39362
39363
39364
39365
39366
39367
39368
39369
39370
39371
39372
39373
39374
39375
39376
39377
39378
39379
39380
39381
39382
39383
39384
39385
39386
39387
39388
39389
39390
39391
39392
39393
39394
39395
39396
39397
39398
39399
39400
39401
39402
39403
39404
39405
39406
39407
39408
39409
39410
39411
39412
39413
39414
39415
39416
39417
39418
39419
39420
39421
39422
39423
39424
39425
39426
39427
39428
39429
39430
39431
39432
39433
39434
39435
39436
39437
39438
39439
39440
39441
39442
39443
39444
39445
39446
39447
39448
39449
39450
39451
39452
39453
39454
39455
39456
39457
39458
39459
39460
39461
39462
39463
39464
39465
39466
39467
39468
39469
39470
39471
39472
39473
39474
39475
39476
39477
39478
39479
39480
39481
39482
39483
39484
39485
39486
39487
39488
39489
39490
39491
39492
39493
39494
39495
39496
39497
39498
39499
39500
39501
39502
39503
39504
39505
39506
39507
39508
39509
39510
39511
39512
39513
39514
39515
39516
39517
39518
39519
39520
39521
39522
39523
39524
39525
39526
39527
39528
39529
39530
39531
39532
39533
39534
39535
39536
39537
39538
39539
39540
39541
39542
39543
39544
39545
39546
39547
39548
39549
39550
39551
39552
39553
39554
39555
39556
39557
39558
39559
39560
39561
39562
39563
39564
39565
39566
39567
39568
39569
39570
39571
39572
39573
39574
39575
39576
39577
39578
39579
39580
39581
39582
39583
39584
39585
39586
39587
39588
39589
39590
39591
39592
39593
39594
39595
39596
39597
39598
39599
39600
39601
39602
39603
39604
39605
39606
39607
39608
39609
39610
39611
39612
39613
39614
39615
39616
39617
39618
39619
39620
39621
39622
39623
39624
39625
39626
39627
39628
39629
39630
39631
39632
39633
39634
39635
39636
39637
39638
39639
39640
39641
39642
39643
39644
39645
39646
39647
39648
39649
39650
39651
39652
39653
39654
39655
39656
39657
39658
39659
39660
39661
39662
39663
39664
39665
39666
39667
39668
39669
39670
39671
39672
39673
39674
39675
39676
39677
39678
39679
39680
39681
39682
39683
39684
39685
39686
39687
39688
39689
39690
39691
39692
39693
39694
39695
39696
39697
39698
39699
39700
39701
39702
39703
39704
39705
39706
39707
39708
39709
39710
39711
39712
39713
39714
39715
39716
39717
39718
39719
39720
39721
39722
39723
39724
39725
39726
39727
39728
39729
39730
39731
39732
39733
39734
39735
39736
39737
39738
39739
39740
39741
39742
39743
39744
39745
39746
39747
39748
39749
39750
39751
39752
39753
39754
39755
39756
39757
39758
39759
39760
39761
39762
39763
39764
39765
39766
39767
39768
39769
39770
39771
39772
39773
39774
39775
39776
39777
39778
39779
39780
39781
39782
39783
39784
39785
39786
39787
39788
39789
39790
39791
39792
39793
39794
39795
39796
39797
39798
39799
39800
39801
39802
39803
39804
39805
39806
39807
39808
39809
39810
39811
39812
39813
39814
39815
39816
39817
39818
39819
39820
39821
39822
39823
39824
39825
39826
39827
39828
39829
39830
39831
39832
39833
39834
39835
39836
39837
39838
39839
39840
39841
39842
39843
39844
39845
39846
39847
39848
39849
39850
39851
39852
39853
39854
39855
39856
39857
39858
39859
39860
39861
39862
39863
39864
39865
39866
39867
39868
39869
39870
39871
39872
39873
39874
39875
39876
39877
39878
39879
39880
39881
39882
39883
39884
39885
39886
39887
39888
39889
39890
39891
39892
39893
39894
39895
39896
39897
39898
39899
39900
39901
39902
39903
39904
39905
39906
39907
39908
39909
39910
39911
39912
39913
39914
39915
39916
39917
39918
39919
39920
39921
39922
39923
39924
39925
39926
39927
39928
39929
39930
39931
39932
39933
39934
39935
39936
39937
39938
39939
39940
39941
39942
39943
39944
39945
39946
39947
39948
39949
39950
39951
39952
39953
39954
39955
39956
39957
39958
39959
39960
39961
39962
39963
39964
39965
39966
39967
39968
39969
39970
39971
39972
39973
39974
39975
39976
39977
39978
39979
39980
39981
39982
39983
39984
39985
39986
39987
39988
39989
39990
39991
39992
39993
39994
39995
39996
39997
39998
39999
40000
40001
40002
40003
40004
40005
40006
40007
40008
40009
40010
40011
40012
40013
40014
40015
40016
40017
40018
40019
40020
40021
40022
40023
40024
40025
40026
40027
40028
40029
40030
40031
40032
40033
40034
40035
40036
40037
40038
40039
40040
40041
40042
40043
40044
40045
40046
40047
40048
40049
40050
40051
40052
40053
40054
40055
40056
40057
40058
40059
40060
40061
40062
40063
40064
40065
40066
40067
40068
40069
40070
40071
40072
40073
40074
40075
40076
40077
40078
40079
40080
40081
40082
40083
40084
40085
40086
40087
40088
40089
40090
40091
40092
40093
40094
40095
40096
40097
40098
40099
40100
40101
40102
40103
40104
40105
40106
40107
40108
40109
40110
40111
40112
40113
40114
40115
40116
40117
40118
40119
40120
40121
40122
40123
40124
40125
40126
40127
40128
40129
40130
40131
40132
40133
40134
40135
40136
40137
40138
40139
40140
40141
40142
40143
40144
40145
40146
40147
40148
40149
40150
40151
40152
40153
40154
40155
40156
40157
40158
40159
40160
40161
40162
40163
40164
40165
40166
40167
40168
40169
40170
40171
40172
40173
40174
40175
40176
40177
40178
40179
40180
40181
40182
40183
40184
40185
40186
40187
40188
40189
40190
40191
40192
40193
40194
40195
40196
40197
40198
40199
40200
40201
40202
40203
40204
40205
40206
40207
40208
40209
40210
40211
40212
40213
40214
40215
40216
40217
40218
40219
40220
40221
40222
40223
40224
40225
40226
40227
40228
40229
40230
40231
40232
40233
40234
40235
40236
40237
40238
40239
40240
40241
40242
40243
40244
40245
40246
40247
40248
40249
40250
40251
40252
40253
40254
40255
40256
40257
40258
40259
40260
40261
40262
40263
40264
40265
40266
40267
40268
40269
40270
40271
40272
40273
40274
40275
40276
40277
40278
40279
40280
40281
40282
40283
40284
40285
40286
40287
40288
40289
40290
40291
40292
40293
40294
40295
40296
40297
40298
40299
40300
40301
40302
40303
40304
40305
40306
40307
40308
40309
40310
40311
40312
40313
40314
40315
40316
40317
40318
40319
40320
40321
40322
40323
40324
40325
40326
40327
40328
40329
40330
40331
40332
40333
40334
40335
40336
40337
40338
40339
40340
40341
40342
40343
40344
40345
40346
40347
40348
40349
40350
40351
40352
40353
40354
40355
40356
40357
40358
40359
40360
40361
40362
40363
40364
40365
40366
40367
40368
40369
40370
40371
40372
40373
40374
40375
40376
40377
40378
40379
40380
40381
40382
40383
40384
40385
40386
40387
40388
40389
40390
40391
40392
40393
40394
40395
40396
40397
40398
40399
40400
40401
40402
40403
40404
40405
40406
40407
40408
40409
40410
40411
40412
40413
40414
40415
40416
40417
40418
40419
40420
40421
40422
40423
40424
40425
40426
40427
40428
40429
40430
40431
40432
40433
40434
40435
40436
40437
40438
40439
40440
40441
40442
40443
40444
40445
40446
40447
40448
40449
40450
40451
40452
40453
40454
40455
40456
40457
40458
40459
40460
40461
40462
40463
40464
40465
40466
40467
40468
40469
40470
40471
40472
40473
40474
40475
40476
40477
40478
40479
40480
40481
40482
40483
40484
40485
40486
40487
40488
40489
40490
40491
40492
40493
40494
40495
40496
40497
40498
40499
40500
40501
40502
40503
40504
40505
40506
40507
40508
40509
40510
40511
40512
40513
40514
40515
40516
40517
40518
40519
40520
40521
40522
40523
40524
40525
40526
40527
40528
40529
40530
40531
40532
40533
40534
40535
40536
40537
40538
40539
40540
40541
40542
40543
40544
40545
40546
40547
40548
40549
40550
40551
40552
40553
40554
40555
40556
40557
40558
40559
40560
40561
40562
40563
40564
40565
40566
40567
40568
40569
40570
40571
40572
40573
40574
40575
40576
40577
40578
40579
40580
40581
40582
40583
40584
40585
40586
40587
40588
40589
40590
40591
40592
40593
40594
40595
40596
40597
40598
40599
40600
40601
40602
40603
40604
40605
40606
40607
40608
40609
40610
40611
40612
40613
40614
40615
40616
40617
40618
40619
40620
40621
40622
40623
40624
40625
40626
40627
40628
40629
40630
40631
40632
40633
40634
40635
40636
40637
40638
40639
40640
40641
40642
40643
40644
40645
40646
40647
40648
40649
40650
40651
40652
40653
40654
40655
40656
40657
40658
40659
40660
40661
40662
40663
40664
40665
40666
40667
40668
40669
40670
40671
40672
40673
40674
40675
40676
40677
40678
40679
40680
40681
40682
40683
40684
40685
40686
40687
40688
40689
40690
40691
40692
40693
40694
40695
40696
40697
40698
40699
40700
40701
40702
40703
40704
40705
40706
40707
40708
40709
40710
40711
40712
40713
40714
40715
40716
40717
40718
40719
40720
40721
40722
40723
40724
40725
40726
40727
40728
40729
40730
40731
40732
40733
40734
40735
40736
40737
40738
40739
40740
40741
40742
40743
40744
40745
40746
40747
40748
40749
40750
40751
40752
40753
40754
40755
40756
40757
40758
40759
40760
40761
40762
40763
40764
40765
40766
40767
40768
40769
40770
40771
40772
40773
40774
40775
40776
40777
40778
40779
40780
40781
40782
40783
40784
40785
40786
40787
40788
40789
40790
40791
40792
40793
40794
40795
40796
40797
40798
40799
40800
40801
40802
40803
40804
40805
40806
40807
40808
40809
40810
40811
40812
40813
40814
40815
40816
40817
40818
40819
40820
40821
40822
40823
40824
40825
40826
40827
40828
40829
40830
40831
40832
40833
40834
40835
40836
40837
40838
40839
40840
40841
40842
40843
40844
40845
40846
40847
40848
40849
40850
40851
40852
40853
40854
40855
40856
40857
40858
40859
40860
40861
40862
40863
40864
40865
40866
40867
40868
40869
40870
40871
40872
40873
40874
40875
40876
40877
40878
40879
40880
40881
40882
40883
40884
40885
40886
40887
40888
40889
40890
40891
40892
40893
40894
40895
40896
40897
40898
40899
40900
40901
40902
40903
40904
40905
40906
40907
40908
40909
40910
40911
40912
40913
40914
40915
40916
40917
40918
40919
40920
40921
40922
40923
40924
40925
40926
40927
40928
40929
40930
40931
40932
40933
40934
40935
40936
40937
40938
40939
40940
40941
40942
40943
40944
40945
40946
40947
40948
40949
40950
40951
40952
40953
40954
40955
40956
40957
40958
40959
40960
40961
40962
40963
40964
40965
40966
40967
40968
40969
40970
40971
40972
40973
40974
40975
40976
40977
40978
40979
40980
40981
40982
40983
40984
40985
40986
40987
40988
40989
40990
40991
40992
40993
40994
40995
40996
40997
40998
40999
41000
41001
41002
41003
41004
41005
41006
41007
41008
41009
41010
41011
41012
41013
41014
41015
41016
41017
41018
41019
41020
41021
41022
41023
41024
41025
41026
41027
41028
41029
41030
41031
41032
41033
41034
41035
41036
41037
41038
41039
41040
41041
41042
41043
41044
41045
41046
41047
41048
41049
41050
41051
41052
41053
41054
41055
41056
41057
41058
41059
41060
41061
41062
41063
41064
41065
41066
41067
41068
41069
41070
41071
41072
41073
41074
41075
41076
41077
41078
41079
41080
41081
41082
41083
41084
41085
41086
41087
41088
41089
41090
41091
41092
41093
41094
41095
41096
41097
41098
41099
41100
41101
41102
41103
41104
41105
41106
41107
41108
41109
41110
41111
41112
41113
41114
41115
41116
41117
41118
41119
41120
41121
41122
41123
41124
41125
41126
41127
41128
41129
41130
41131
41132
41133
41134
41135
41136
41137
41138
41139
41140
41141
41142
41143
41144
41145
41146
41147
41148
41149
41150
41151
41152
41153
41154
41155
41156
41157
41158
41159
41160
41161
41162
41163
41164
41165
41166
41167
41168
41169
41170
41171
41172
41173
41174
41175
41176
41177
41178
41179
41180
41181
41182
41183
41184
41185
41186
41187
41188
41189
41190
41191
41192
41193
41194
41195
41196
41197
41198
41199
41200
41201
41202
41203
41204
41205
41206
41207
41208
41209
41210
41211
41212
41213
41214
41215
41216
41217
41218
41219
41220
41221
41222
41223
41224
41225
41226
41227
41228
41229
41230
41231
41232
41233
41234
41235
41236
41237
41238
41239
41240
41241
41242
41243
41244
41245
41246
41247
41248
41249
41250
41251
41252
41253
41254
41255
41256
41257
41258
41259
41260
41261
41262
41263
41264
41265
41266
41267
41268
41269
41270
41271
41272
41273
41274
41275
41276
41277
41278
41279
41280
41281
41282
41283
41284
41285
41286
41287
41288
41289
41290
41291
41292
41293
41294
41295
41296
41297
41298
41299
41300
41301
41302
41303
41304
41305
41306
41307
41308
41309
41310
41311
41312
41313
41314
41315
41316
41317
41318
41319
41320
41321
41322
41323
41324
41325
41326
41327
41328
41329
41330
41331
41332
41333
41334
41335
41336
41337
41338
41339
41340
41341
41342
41343
41344
41345
41346
41347
41348
41349
41350
41351
41352
41353
41354
41355
41356
41357
41358
41359
41360
41361
41362
41363
41364
41365
41366
41367
41368
41369
41370
41371
41372
41373
41374
41375
41376
41377
41378
41379
41380
41381
41382
41383
41384
41385
41386
41387
41388
41389
41390
41391
41392
41393
41394
41395
41396
41397
41398
41399
41400
41401
41402
41403
41404
41405
41406
41407
41408
41409
41410
41411
41412
41413
41414
41415
41416
41417
41418
41419
41420
41421
41422
41423
41424
41425
41426
41427
41428
41429
41430
41431
41432
41433
41434
41435
41436
41437
41438
41439
41440
41441
41442
41443
41444
41445
41446
41447
41448
41449
41450
41451
41452
41453
41454
41455
41456
41457
41458
41459
41460
41461
41462
41463
41464
41465
41466
41467
41468
41469
41470
41471
41472
41473
41474
41475
41476
41477
41478
41479
41480
41481
41482
41483
41484
41485
41486
41487
41488
41489
41490
41491
41492
41493
41494
41495
41496
41497
41498
41499
41500
41501
41502
41503
41504
41505
41506
41507
41508
41509
41510
41511
41512
41513
41514
41515
41516
41517
41518
41519
41520
41521
41522
41523
41524
41525
41526
41527
41528
41529
41530
41531
41532
41533
41534
41535
41536
41537
41538
41539
41540
41541
41542
41543
41544
41545
41546
41547
41548
41549
41550
41551
41552
41553
41554
41555
41556
41557
41558
41559
41560
41561
41562
41563
41564
41565
41566
41567
41568
41569
41570
41571
41572
41573
41574
41575
41576
41577
41578
41579
41580
41581
41582
41583
41584
41585
41586
41587
41588
41589
41590
41591
41592
41593
41594
41595
41596
41597
41598
41599
41600
41601
41602
41603
41604
41605
41606
41607
41608
41609
41610
41611
41612
41613
41614
41615
41616
41617
41618
41619
41620
41621
41622
41623
41624
41625
41626
41627
41628
41629
41630
41631
41632
41633
41634
41635
41636
41637
41638
41639
41640
41641
41642
41643
41644
41645
41646
41647
41648
41649
41650
41651
41652
41653
41654
41655
41656
41657
41658
41659
41660
41661
41662
41663
41664
41665
41666
41667
41668
41669
41670
41671
41672
41673
41674
41675
41676
41677
41678
41679
41680
41681
41682
41683
41684
41685
41686
41687
41688
41689
41690
41691
41692
41693
41694
41695
41696
41697
41698
41699
41700
41701
41702
41703
41704
41705
41706
41707
41708
41709
41710
41711
41712
41713
41714
41715
41716
41717
41718
41719
41720
41721
41722
41723
41724
41725
41726
41727
41728
41729
41730
41731
41732
41733
41734
41735
41736
41737
41738
41739
41740
41741
41742
41743
41744
41745
41746
41747
41748
41749
41750
41751
41752
41753
41754
41755
41756
41757
41758
41759
41760
41761
41762
41763
41764
41765
41766
41767
41768
41769
41770
41771
41772
41773
41774
41775
41776
41777
41778
41779
41780
41781
41782
41783
41784
41785
41786
41787
41788
41789
41790
41791
41792
41793
41794
41795
41796
41797
41798
41799
41800
41801
41802
41803
41804
41805
41806
41807
41808
41809
41810
41811
41812
41813
41814
41815
41816
41817
41818
41819
41820
41821
41822
41823
41824
41825
41826
41827
41828
41829
41830
41831
41832
41833
41834
41835
41836
41837
41838
41839
41840
41841
41842
41843
41844
41845
41846
41847
41848
41849
41850
41851
41852
41853
41854
41855
41856
41857
41858
41859
41860
41861
41862
41863
41864
41865
41866
41867
41868
41869
41870
41871
41872
41873
41874
41875
41876
41877
41878
41879
41880
41881
41882
41883
41884
41885
41886
41887
41888
41889
41890
41891
41892
41893
41894
41895
41896
41897
41898
41899
41900
41901
41902
41903
41904
41905
41906
41907
41908
41909
41910
41911
41912
41913
41914
41915
41916
41917
41918
41919
41920
41921
41922
41923
41924
41925
41926
41927
41928
41929
41930
41931
41932
41933
41934
41935
41936
41937
41938
41939
41940
41941
41942
41943
41944
41945
41946
41947
41948
41949
41950
41951
41952
41953
41954
41955
41956
41957
41958
41959
41960
41961
41962
41963
41964
41965
41966
41967
41968
41969
41970
41971
41972
41973
41974
41975
41976
41977
41978
41979
41980
41981
41982
41983
41984
41985
41986
41987
41988
41989
41990
41991
41992
41993
41994
41995
41996
41997
41998
41999
42000
42001
42002
42003
42004
42005
42006
42007
42008
42009
42010
42011
42012
42013
42014
42015
42016
42017
42018
42019
42020
42021
42022
42023
42024
42025
42026
42027
42028
42029
42030
42031
42032
42033
42034
42035
42036
42037
42038
42039
42040
42041
42042
42043
42044
42045
42046
42047
42048
42049
42050
42051
42052
42053
42054
42055
42056
42057
42058
42059
42060
42061
42062
42063
42064
42065
42066
42067
42068
42069
42070
42071
42072
42073
42074
42075
42076
42077
42078
42079
42080
42081
42082
42083
42084
42085
42086
42087
42088
42089
42090
42091
42092
42093
42094
42095
42096
42097
42098
42099
42100
42101
42102
42103
42104
42105
42106
42107
42108
42109
42110
42111
42112
42113
42114
42115
42116
42117
42118
42119
42120
42121
42122
42123
42124
42125
42126
42127
42128
42129
42130
42131
42132
42133
42134
42135
42136
42137
42138
42139
42140
42141
42142
42143
42144
42145
42146
42147
42148
42149
42150
42151
42152
42153
42154
42155
42156
42157
42158
42159
42160
42161
42162
42163
42164
42165
42166
42167
42168
42169
42170
42171
42172
42173
42174
42175
42176
42177
42178
42179
42180
42181
42182
42183
42184
42185
42186
42187
42188
42189
42190
42191
42192
42193
42194
42195
42196
42197
42198
42199
42200
42201
42202
42203
42204
42205
42206
42207
42208
42209
42210
42211
42212
42213
42214
42215
42216
42217
42218
42219
42220
42221
42222
42223
42224
42225
42226
42227
42228
42229
42230
42231
42232
42233
42234
42235
42236
42237
42238
42239
42240
42241
42242
42243
42244
42245
42246
42247
42248
42249
42250
42251
42252
42253
42254
42255
42256
42257
42258
42259
42260
42261
42262
42263
42264
42265
42266
42267
42268
42269
42270
42271
42272
42273
42274
42275
42276
42277
42278
42279
42280
42281
42282
42283
42284
42285
42286
42287
42288
42289
42290
42291
42292
42293
42294
42295
42296
42297
42298
42299
42300
42301
42302
42303
42304
42305
42306
42307
42308
42309
42310
42311
42312
42313
42314
42315
42316
42317
42318
42319
42320
42321
42322
42323
42324
42325
42326
42327
42328
42329
42330
42331
42332
42333
42334
42335
42336
42337
42338
42339
42340
42341
42342
42343
42344
42345
42346
42347
42348
42349
42350
42351
42352
42353
42354
42355
42356
42357
42358
42359
42360
42361
42362
42363
42364
42365
42366
42367
42368
42369
42370
42371
42372
42373
42374
42375
42376
42377
42378
42379
42380
42381
42382
42383
42384
42385
42386
42387
42388
42389
42390
42391
42392
42393
42394
42395
42396
42397
42398
42399
42400
42401
42402
42403
42404
42405
42406
42407
42408
42409
42410
42411
42412
42413
42414
42415
42416
42417
42418
42419
42420
42421
42422
42423
42424
42425
42426
42427
42428
42429
42430
42431
42432
42433
42434
42435
42436
42437
42438
42439
42440
42441
42442
42443
42444
42445
42446
42447
42448
42449
42450
42451
42452
42453
42454
42455
42456
42457
42458
42459
42460
42461
42462
42463
42464
42465
42466
42467
42468
42469
42470
42471
42472
42473
42474
42475
42476
42477
42478
42479
42480
42481
42482
42483
42484
42485
42486
42487
42488
42489
42490
42491
42492
42493
42494
42495
42496
42497
42498
42499
42500
42501
42502
42503
42504
42505
42506
42507
42508
42509
42510
42511
42512
42513
42514
42515
42516
42517
42518
42519
42520
42521
42522
42523
42524
42525
42526
42527
42528
42529
42530
42531
42532
42533
42534
42535
42536
42537
42538
42539
42540
42541
42542
42543
42544
42545
42546
42547
42548
42549
42550
42551
42552
42553
42554
42555
42556
42557
42558
42559
42560
42561
42562
42563
42564
42565
42566
42567
42568
42569
42570
42571
42572
42573
42574
42575
42576
42577
42578
42579
42580
42581
42582
42583
42584
42585
42586
42587
42588
42589
42590
42591
42592
42593
42594
42595
42596
42597
42598
42599
42600
42601
42602
42603
42604
42605
42606
42607
42608
42609
42610
42611
42612
42613
42614
42615
42616
42617
42618
42619
42620
42621
42622
42623
42624
42625
42626
42627
42628
42629
42630
42631
42632
42633
42634
42635
42636
42637
42638
42639
42640
42641
42642
42643
42644
42645
42646
42647
42648
42649
42650
42651
42652
42653
42654
42655
42656
42657
42658
42659
42660
42661
42662
42663
42664
42665
42666
42667
42668
42669
42670
42671
42672
42673
42674
42675
42676
42677
42678
42679
42680
42681
42682
42683
42684
42685
42686
42687
42688
42689
42690
42691
42692
42693
42694
42695
42696
42697
42698
42699
42700
42701
42702
42703
42704
42705
42706
42707
42708
42709
42710
42711
42712
42713
42714
42715
42716
42717
42718
42719
42720
42721
42722
42723
42724
42725
42726
42727
42728
42729
42730
42731
42732
42733
42734
42735
42736
42737
42738
42739
42740
42741
42742
42743
42744
42745
42746
42747
42748
42749
42750
42751
42752
42753
42754
42755
42756
42757
42758
42759
42760
42761
42762
42763
42764
42765
42766
42767
42768
42769
42770
42771
42772
42773
42774
42775
42776
42777
42778
42779
42780
42781
42782
42783
42784
42785
42786
42787
42788
42789
42790
42791
42792
42793
42794
42795
42796
42797
42798
42799
42800
42801
42802
42803
42804
42805
42806
42807
42808
42809
42810
42811
42812
42813
42814
42815
42816
42817
42818
42819
42820
42821
42822
42823
42824
42825
42826
42827
42828
42829
42830
42831
42832
42833
42834
42835
42836
42837
42838
42839
42840
42841
42842
42843
42844
42845
42846
42847
42848
42849
42850
42851
42852
42853
42854
42855
42856
42857
42858
42859
42860
42861
42862
42863
42864
42865
42866
42867
42868
42869
42870
42871
42872
42873
42874
42875
42876
42877
42878
42879
42880
42881
42882
42883
42884
42885
42886
42887
42888
42889
42890
42891
42892
42893
42894
42895
42896
42897
42898
42899
42900
42901
42902
42903
42904
42905
42906
42907
42908
42909
42910
42911
42912
42913
42914
42915
42916
42917
42918
42919
42920
42921
42922
42923
42924
42925
42926
42927
42928
42929
42930
42931
42932
42933
42934
42935
42936
42937
42938
42939
42940
42941
42942
42943
42944
42945
42946
42947
42948
42949
42950
42951
42952
42953
42954
42955
42956
42957
42958
42959
42960
42961
42962
42963
42964
42965
42966
42967
42968
42969
42970
42971
42972
42973
42974
42975
42976
42977
42978
42979
42980
42981
42982
42983
42984
42985
42986
42987
42988
42989
42990
42991
42992
42993
42994
42995
42996
42997
42998
42999
43000
43001
43002
43003
43004
43005
43006
43007
43008
43009
43010
43011
43012
43013
43014
43015
43016
43017
43018
43019
43020
43021
43022
43023
43024
43025
43026
43027
43028
43029
43030
43031
43032
43033
43034
43035
43036
43037
43038
43039
43040
43041
43042
43043
43044
43045
43046
43047
43048
43049
43050
43051
43052
43053
43054
43055
43056
43057
43058
43059
43060
43061
43062
43063
43064
43065
43066
43067
43068
43069
43070
43071
43072
43073
43074
43075
43076
43077
43078
43079
43080
43081
43082
43083
43084
43085
43086
43087
43088
43089
43090
43091
43092
43093
43094
43095
43096
43097
43098
43099
43100
43101
43102
43103
43104
43105
43106
43107
43108
43109
43110
43111
43112
43113
43114
43115
43116
43117
43118
43119
43120
43121
43122
43123
43124
43125
43126
43127
43128
43129
43130
43131
43132
43133
43134
43135
43136
43137
43138
43139
43140
43141
43142
43143
43144
43145
43146
43147
43148
43149
43150
43151
43152
43153
43154
43155
43156
43157
43158
43159
43160
43161
43162
43163
43164
43165
43166
43167
43168
43169
43170
43171
43172
43173
43174
43175
43176
43177
43178
43179
43180
43181
43182
43183
43184
43185
43186
43187
43188
43189
43190
43191
43192
43193
43194
43195
43196
43197
43198
43199
43200
43201
43202
43203
43204
43205
43206
43207
43208
43209
43210
43211
43212
43213
43214
43215
43216
43217
43218
43219
43220
43221
43222
43223
43224
43225
43226
43227
43228
43229
43230
43231
43232
43233
43234
43235
43236
43237
43238
43239
43240
43241
43242
43243
43244
43245
43246
43247
43248
43249
43250
43251
43252
43253
43254
43255
43256
43257
43258
43259
43260
43261
43262
43263
43264
43265
43266
43267
43268
43269
43270
43271
43272
43273
43274
43275
43276
43277
43278
43279
43280
43281
43282
43283
43284
43285
43286
43287
43288
43289
43290
43291
43292
43293
43294
43295
43296
43297
43298
43299
43300
43301
43302
43303
43304
43305
43306
43307
43308
43309
43310
43311
43312
43313
43314
43315
43316
43317
43318
43319
43320
43321
43322
43323
43324
43325
43326
43327
43328
43329
43330
43331
43332
43333
43334
43335
43336
43337
43338
43339
43340
43341
43342
43343
43344
43345
43346
43347
43348
43349
43350
43351
43352
43353
43354
43355
43356
43357
43358
43359
43360
43361
43362
43363
43364
43365
43366
43367
43368
43369
43370
43371
43372
43373
43374
43375
43376
43377
43378
43379
43380
43381
43382
43383
43384
43385
43386
43387
43388
43389
43390
43391
43392
43393
43394
43395
43396
43397
43398
43399
43400
43401
43402
43403
43404
43405
43406
43407
43408
43409
43410
43411
43412
43413
43414
43415
43416
43417
43418
43419
43420
43421
43422
43423
43424
43425
43426
43427
43428
43429
43430
43431
43432
43433
43434
43435
43436
43437
43438
43439
43440
43441
43442
43443
43444
43445
43446
43447
43448
43449
43450
43451
43452
43453
43454
43455
43456
43457
43458
43459
43460
43461
43462
43463
43464
43465
43466
43467
43468
43469
43470
43471
43472
43473
43474
43475
43476
43477
43478
43479
43480
43481
43482
43483
43484
43485
43486
43487
43488
43489
43490
43491
43492
43493
43494
43495
43496
43497
43498
43499
43500
43501
43502
43503
43504
43505
43506
43507
43508
43509
43510
43511
43512
43513
43514
43515
43516
43517
43518
43519
43520
43521
43522
43523
43524
43525
43526
43527
43528
43529
43530
43531
43532
43533
43534
43535
43536
43537
43538
43539
43540
43541
43542
43543
43544
43545
43546
43547
43548
43549
43550
43551
43552
43553
43554
43555
43556
43557
43558
43559
43560
43561
43562
43563
43564
43565
43566
43567
43568
43569
43570
43571
43572
43573
43574
43575
43576
43577
43578
43579
43580
43581
43582
43583
43584
43585
43586
43587
43588
43589
43590
43591
43592
43593
43594
43595
43596
43597
43598
43599
43600
43601
43602
43603
43604
43605
43606
43607
43608
43609
43610
43611
43612
43613
43614
43615
43616
43617
43618
43619
43620
43621
43622
43623
43624
43625
43626
43627
43628
43629
43630
43631
43632
43633
43634
43635
43636
43637
43638
43639
43640
43641
43642
43643
43644
43645
43646
43647
43648
43649
43650
43651
43652
43653
43654
43655
43656
43657
43658
43659
43660
43661
43662
43663
43664
43665
43666
43667
43668
43669
43670
43671
43672
43673
43674
43675
43676
43677
43678
43679
43680
43681
43682
43683
43684
43685
43686
43687
43688
43689
43690
43691
43692
43693
43694
43695
43696
43697
43698
43699
43700
43701
43702
43703
43704
43705
43706
43707
43708
43709
43710
43711
43712
43713
43714
43715
43716
43717
43718
43719
43720
43721
43722
43723
43724
43725
43726
43727
43728
43729
43730
43731
43732
43733
43734
43735
43736
43737
43738
43739
43740
43741
43742
43743
43744
43745
43746
43747
43748
43749
43750
43751
43752
43753
43754
43755
43756
43757
43758
43759
43760
43761
43762
43763
43764
43765
43766
43767
43768
43769
43770
43771
43772
43773
43774
43775
43776
43777
43778
43779
43780
43781
43782
43783
43784
43785
43786
43787
43788
43789
43790
43791
43792
43793
43794
43795
43796
43797
43798
43799
43800
43801
43802
43803
43804
43805
43806
43807
43808
43809
43810
43811
43812
43813
43814
43815
43816
43817
43818
43819
43820
43821
43822
43823
43824
43825
43826
43827
43828
43829
43830
43831
43832
43833
43834
43835
43836
43837
43838
43839
43840
43841
43842
43843
43844
43845
43846
43847
43848
43849
43850
43851
43852
43853
43854
43855
43856
43857
43858
43859
43860
43861
43862
43863
43864
43865
43866
43867
43868
43869
43870
43871
43872
43873
43874
43875
43876
43877
43878
43879
43880
43881
43882
43883
43884
43885
43886
43887
43888
43889
43890
43891
43892
43893
43894
43895
43896
43897
43898
43899
43900
43901
43902
43903
43904
43905
43906
43907
43908
43909
43910
43911
43912
43913
43914
43915
43916
43917
43918
43919
43920
43921
43922
43923
43924
43925
43926
43927
43928
43929
43930
43931
43932
43933
43934
43935
43936
43937
43938
43939
43940
43941
43942
43943
43944
43945
43946
43947
43948
43949
43950
43951
43952
43953
43954
43955
43956
43957
43958
43959
43960
43961
43962
43963
43964
43965
43966
43967
43968
43969
43970
43971
43972
43973
43974
43975
43976
43977
43978
43979
43980
43981
43982
43983
43984
43985
43986
43987
43988
43989
43990
43991
43992
43993
43994
43995
43996
43997
43998
43999
44000
44001
44002
44003
44004
44005
44006
44007
44008
44009
44010
44011
44012
44013
44014
44015
44016
44017
44018
44019
44020
44021
44022
44023
44024
44025
44026
44027
44028
44029
44030
44031
44032
44033
44034
44035
44036
44037
44038
44039
44040
44041
44042
44043
44044
44045
44046
44047
44048
44049
44050
44051
44052
44053
44054
44055
44056
44057
44058
44059
44060
44061
44062
44063
44064
44065
44066
44067
44068
44069
44070
44071
44072
44073
44074
44075
44076
44077
44078
44079
44080
44081
44082
44083
44084
44085
44086
44087
44088
44089
44090
44091
44092
44093
44094
44095
44096
44097
44098
44099
44100
44101
44102
44103
44104
44105
44106
44107
44108
44109
44110
44111
44112
44113
44114
44115
44116
44117
44118
44119
44120
44121
44122
44123
44124
44125
44126
44127
44128
44129
44130
44131
44132
44133
44134
44135
44136
44137
44138
44139
44140
44141
44142
44143
44144
44145
44146
44147
44148
44149
44150
44151
44152
44153
44154
44155
44156
44157
44158
44159
44160
44161
44162
44163
44164
44165
44166
44167
44168
44169
44170
44171
44172
44173
44174
44175
44176
44177
44178
44179
44180
44181
44182
44183
44184
44185
44186
44187
44188
44189
44190
44191
44192
44193
44194
44195
44196
44197
44198
44199
44200
44201
44202
44203
44204
44205
44206
44207
44208
44209
44210
44211
44212
44213
44214
44215
44216
44217
44218
44219
44220
44221
44222
44223
44224
44225
44226
44227
44228
44229
44230
44231
44232
44233
44234
44235
44236
44237
44238
44239
44240
44241
44242
44243
44244
44245
44246
44247
44248
44249
44250
44251
44252
44253
44254
44255
44256
44257
44258
44259
44260
44261
44262
44263
44264
44265
44266
44267
44268
44269
44270
44271
44272
44273
44274
44275
44276
44277
44278
44279
44280
44281
44282
44283
44284
44285
44286
44287
44288
44289
44290
44291
44292
44293
44294
44295
44296
44297
44298
44299
44300
44301
44302
44303
44304
44305
44306
44307
44308
44309
44310
44311
44312
44313
44314
44315
44316
44317
44318
44319
44320
44321
44322
44323
44324
44325
44326
44327
44328
44329
44330
44331
44332
44333
44334
44335
44336
44337
44338
44339
44340
44341
44342
44343
44344
44345
44346
44347
44348
44349
44350
44351
44352
44353
44354
44355
44356
44357
44358
44359
44360
44361
44362
44363
44364
44365
44366
44367
44368
44369
44370
44371
44372
44373
44374
44375
44376
44377
44378
44379
44380
44381
44382
44383
44384
44385
44386
44387
44388
44389
44390
44391
44392
44393
44394
44395
44396
44397
44398
44399
44400
44401
44402
44403
44404
44405
44406
44407
44408
44409
44410
44411
44412
44413
44414
44415
44416
44417
44418
44419
44420
44421
44422
44423
44424
44425
44426
44427
44428
44429
44430
44431
44432
44433
44434
44435
44436
44437
44438
44439
44440
44441
44442
44443
44444
44445
44446
44447
44448
44449
44450
44451
44452
44453
44454
44455
44456
44457
44458
44459
44460
44461
44462
44463
44464
44465
44466
44467
44468
44469
44470
44471
44472
44473
44474
44475
44476
44477
44478
44479
44480
44481
44482
44483
44484
44485
44486
44487
44488
44489
44490
44491
44492
44493
44494
44495
44496
44497
44498
44499
44500
44501
44502
44503
44504
44505
44506
44507
44508
44509
44510
44511
44512
44513
44514
44515
44516
44517
44518
44519
44520
44521
44522
44523
44524
44525
44526
44527
44528
44529
44530
44531
44532
44533
44534
44535
44536
44537
44538
44539
44540
44541
44542
44543
44544
44545
44546
44547
44548
44549
44550
44551
44552
44553
44554
44555
44556
44557
44558
44559
44560
44561
44562
44563
44564
44565
44566
44567
44568
44569
44570
44571
44572
44573
44574
44575
44576
44577
44578
44579
44580
44581
44582
44583
44584
44585
44586
44587
44588
44589
44590
44591
44592
44593
44594
44595
44596
44597
44598
44599
44600
44601
44602
44603
44604
44605
44606
44607
44608
44609
44610
44611
44612
44613
44614
44615
44616
44617
44618
44619
44620
44621
44622
44623
44624
44625
44626
44627
44628
44629
44630
44631
44632
44633
44634
44635
44636
44637
44638
44639
44640
44641
44642
44643
44644
44645
44646
44647
44648
44649
44650
44651
44652
44653
44654
44655
44656
44657
44658
44659
44660
44661
44662
44663
44664
44665
44666
44667
44668
44669
44670
44671
44672
44673
44674
44675
44676
44677
44678
44679
44680
44681
44682
44683
44684
44685
44686
44687
44688
44689
44690
44691
44692
44693
44694
44695
44696
44697
44698
44699
44700
44701
44702
44703
44704
44705
44706
44707
44708
44709
44710
44711
44712
44713
44714
44715
44716
44717
44718
44719
44720
44721
44722
44723
44724
44725
44726
44727
44728
44729
44730
44731
44732
44733
44734
44735
44736
44737
44738
44739
44740
44741
44742
44743
44744
44745
44746
44747
44748
44749
44750
44751
44752
44753
44754
44755
44756
44757
44758
44759
44760
44761
44762
44763
44764
44765
44766
44767
44768
44769
44770
44771
44772
44773
44774
44775
44776
44777
44778
44779
44780
44781
44782
44783
44784
44785
44786
44787
44788
44789
44790
44791
44792
44793
44794
44795
44796
44797
44798
44799
44800
44801
44802
44803
44804
44805
44806
44807
44808
44809
44810
44811
44812
44813
44814
44815
44816
44817
44818
44819
44820
44821
44822
44823
44824
44825
44826
44827
44828
44829
44830
44831
44832
44833
44834
44835
44836
44837
44838
44839
44840
44841
44842
44843
44844
44845
44846
44847
44848
44849
44850
44851
44852
44853
44854
44855
44856
44857
44858
44859
44860
44861
44862
44863
44864
44865
44866
44867
44868
44869
44870
44871
44872
44873
44874
44875
44876
44877
44878
44879
44880
44881
44882
44883
44884
44885
44886
44887
44888
44889
44890
44891
44892
44893
44894
44895
44896
44897
44898
44899
44900
44901
44902
44903
44904
44905
44906
44907
44908
44909
44910
44911
44912
44913
44914
44915
44916
44917
44918
44919
44920
44921
44922
44923
44924
44925
44926
44927
44928
44929
44930
44931
44932
44933
44934
44935
44936
44937
44938
44939
44940
44941
44942
44943
44944
44945
44946
44947
44948
44949
44950
44951
44952
44953
44954
44955
44956
44957
44958
44959
44960
44961
44962
44963
44964
44965
44966
44967
44968
44969
44970
44971
44972
44973
44974
44975
44976
44977
44978
44979
44980
44981
44982
44983
44984
44985
44986
44987
44988
44989
44990
44991
44992
44993
44994
44995
44996
44997
44998
44999
45000
45001
45002
45003
45004
45005
45006
45007
45008
45009
45010
45011
45012
45013
45014
45015
45016
45017
45018
45019
45020
45021
45022
45023
45024
45025
45026
45027
45028
45029
45030
45031
45032
45033
45034
45035
45036
45037
45038
45039
45040
45041
45042
45043
45044
45045
45046
45047
45048
45049
45050
45051
45052
45053
45054
45055
45056
45057
45058
45059
45060
45061
45062
45063
45064
45065
45066
45067
45068
45069
45070
45071
45072
45073
45074
45075
45076
45077
45078
45079
45080
45081
45082
45083
45084
45085
45086
45087
45088
45089
45090
45091
45092
45093
45094
45095
45096
45097
45098
45099
45100
45101
45102
45103
45104
45105
45106
45107
45108
45109
45110
45111
45112
45113
45114
45115
45116
45117
45118
45119
45120
45121
45122
45123
45124
45125
45126
45127
45128
45129
45130
45131
45132
45133
45134
45135
45136
45137
45138
45139
45140
45141
45142
45143
45144
45145
45146
45147
45148
45149
45150
45151
45152
45153
45154
45155
45156
45157
45158
45159
45160
45161
45162
45163
45164
45165
45166
45167
45168
45169
45170
45171
45172
45173
45174
45175
45176
45177
45178
45179
45180
45181
45182
45183
45184
45185
45186
45187
45188
45189
45190
45191
45192
45193
45194
45195
45196
45197
45198
45199
45200
45201
45202
45203
45204
45205
45206
45207
45208
45209
45210
45211
45212
45213
45214
45215
45216
45217
45218
45219
45220
45221
45222
45223
45224
45225
45226
45227
45228
45229
45230
45231
45232
45233
45234
45235
45236
45237
45238
45239
45240
45241
45242
45243
45244
45245
45246
45247
45248
45249
45250
45251
45252
45253
45254
45255
45256
45257
45258
45259
45260
45261
45262
45263
45264
45265
45266
45267
45268
45269
45270
45271
45272
45273
45274
45275
45276
45277
45278
45279
45280
45281
45282
45283
45284
45285
45286
45287
45288
45289
45290
45291
45292
45293
45294
45295
45296
45297
45298
45299
45300
45301
45302
45303
45304
45305
45306
45307
45308
45309
45310
45311
45312
45313
45314
45315
45316
45317
45318
45319
45320
45321
45322
45323
45324
45325
45326
45327
45328
45329
45330
45331
45332
45333
45334
45335
45336
45337
45338
45339
45340
45341
45342
45343
45344
45345
45346
45347
45348
45349
45350
45351
45352
45353
45354
45355
45356
45357
45358
45359
45360
45361
45362
45363
45364
45365
45366
45367
45368
45369
45370
45371
45372
45373
45374
45375
45376
45377
45378
45379
45380
45381
45382
45383
45384
45385
45386
45387
45388
45389
45390
45391
45392
45393
45394
45395
45396
45397
45398
45399
45400
45401
45402
45403
45404
45405
45406
45407
45408
45409
45410
45411
45412
45413
45414
45415
45416
45417
45418
45419
45420
45421
45422
45423
45424
45425
45426
45427
45428
45429
45430
45431
45432
45433
45434
45435
45436
45437
45438
45439
45440
45441
45442
45443
45444
45445
45446
45447
45448
45449
45450
45451
45452
45453
45454
45455
45456
45457
45458
45459
45460
45461
45462
45463
45464
45465
45466
45467
45468
45469
45470
45471
45472
45473
45474
45475
45476
45477
45478
45479
45480
45481
45482
45483
45484
45485
45486
45487
45488
45489
45490
45491
45492
45493
45494
45495
45496
45497
45498
45499
45500
45501
45502
45503
45504
45505
45506
45507
45508
45509
45510
45511
45512
45513
45514
45515
45516
45517
45518
45519
45520
45521
45522
45523
45524
45525
45526
45527
45528
45529
45530
45531
45532
45533
45534
45535
45536
45537
45538
45539
45540
45541
45542
45543
45544
45545
45546
45547
45548
45549
45550
45551
45552
45553
45554
45555
45556
45557
45558
45559
45560
45561
45562
45563
45564
45565
45566
45567
45568
45569
45570
45571
45572
45573
45574
45575
45576
45577
45578
45579
45580
45581
45582
45583
45584
45585
45586
45587
45588
45589
45590
45591
45592
45593
45594
45595
45596
45597
45598
45599
45600
45601
45602
45603
45604
45605
45606
45607
45608
45609
45610
45611
45612
45613
45614
45615
45616
45617
45618
45619
45620
45621
45622
45623
45624
45625
45626
45627
45628
45629
45630
45631
45632
45633
45634
45635
45636
45637
45638
45639
45640
45641
45642
45643
45644
45645
45646
45647
45648
45649
45650
45651
45652
45653
45654
45655
45656
45657
45658
45659
45660
45661
45662
45663
45664
45665
45666
45667
45668
45669
45670
45671
45672
45673
45674
45675
45676
45677
45678
45679
45680
45681
45682
45683
45684
45685
45686
45687
45688
45689
45690
45691
45692
45693
45694
45695
45696
45697
45698
45699
45700
45701
45702
45703
45704
45705
45706
45707
45708
45709
45710
45711
45712
45713
45714
45715
45716
45717
45718
45719
45720
45721
45722
45723
45724
45725
45726
45727
45728
45729
45730
45731
45732
45733
45734
45735
45736
45737
45738
45739
45740
45741
45742
45743
45744
45745
45746
45747
45748
45749
45750
45751
45752
45753
45754
45755
45756
45757
45758
45759
45760
45761
45762
45763
45764
45765
45766
45767
45768
45769
45770
45771
45772
45773
45774
45775
45776
45777
45778
45779
45780
45781
45782
45783
45784
45785
45786
45787
45788
45789
45790
45791
45792
45793
45794
45795
45796
45797
45798
45799
45800
45801
45802
45803
45804
45805
45806
45807
45808
45809
45810
45811
45812
45813
45814
45815
45816
45817
45818
45819
45820
45821
45822
45823
45824
45825
45826
45827
45828
45829
45830
45831
45832
45833
45834
45835
45836
45837
45838
45839
45840
45841
45842
45843
45844
45845
45846
45847
45848
45849
45850
45851
45852
45853
45854
45855
45856
45857
45858
45859
45860
45861
45862
45863
45864
45865
45866
45867
45868
45869
45870
45871
45872
45873
45874
45875
45876
45877
45878
45879
45880
45881
45882
45883
45884
45885
45886
45887
45888
45889
45890
45891
45892
45893
45894
45895
45896
45897
45898
45899
45900
45901
45902
45903
45904
45905
45906
45907
45908
45909
45910
45911
45912
45913
45914
45915
45916
45917
45918
45919
45920
45921
45922
45923
45924
45925
45926
45927
45928
45929
45930
45931
45932
45933
45934
45935
45936
45937
45938
45939
45940
45941
45942
45943
45944
45945
45946
45947
45948
45949
45950
45951
45952
45953
45954
45955
45956
45957
45958
45959
45960
45961
45962
45963
45964
45965
45966
45967
45968
45969
45970
45971
45972
45973
45974
45975
45976
45977
45978
45979
45980
45981
45982
45983
45984
45985
45986
45987
45988
45989
45990
45991
45992
45993
45994
45995
45996
45997
45998
45999
46000
46001
46002
46003
46004
46005
46006
46007
46008
46009
46010
46011
46012
46013
46014
46015
46016
46017
46018
46019
46020
46021
46022
46023
46024
46025
46026
46027
46028
46029
46030
46031
46032
46033
46034
46035
46036
46037
46038
46039
46040
46041
46042
46043
46044
46045
46046
46047
46048
46049
46050
46051
46052
46053
46054
46055
46056
46057
46058
46059
46060
46061
46062
46063
46064
46065
46066
46067
46068
46069
46070
46071
46072
46073
46074
46075
46076
46077
46078
46079
46080
46081
46082
46083
46084
46085
46086
46087
46088
46089
46090
46091
46092
46093
46094
46095
46096
46097
46098
46099
46100
46101
46102
46103
46104
46105
46106
46107
46108
46109
46110
46111
46112
46113
46114
46115
46116
46117
46118
46119
46120
46121
46122
46123
46124
46125
46126
46127
46128
46129
46130
46131
46132
46133
46134
46135
46136
46137
46138
46139
46140
46141
46142
46143
46144
46145
46146
46147
46148
46149
46150
46151
46152
46153
46154
46155
46156
46157
46158
46159
46160
46161
46162
46163
46164
46165
46166
46167
46168
46169
46170
46171
46172
46173
46174
46175
46176
46177
46178
46179
46180
46181
46182
46183
46184
46185
46186
46187
46188
46189
46190
46191
46192
46193
46194
46195
46196
46197
46198
46199
46200
46201
46202
46203
46204
46205
46206
46207
46208
46209
46210
46211
46212
46213
46214
46215
46216
46217
46218
46219
46220
46221
46222
46223
46224
46225
46226
46227
46228
46229
46230
46231
46232
46233
46234
46235
46236
46237
46238
46239
46240
46241
46242
46243
46244
46245
46246
46247
46248
46249
46250
46251
46252
46253
46254
46255
46256
46257
46258
46259
46260
46261
46262
46263
46264
46265
46266
46267
46268
46269
46270
46271
46272
46273
46274
46275
46276
46277
46278
46279
46280
46281
46282
46283
46284
46285
46286
46287
46288
46289
46290
46291
46292
46293
46294
46295
46296
46297
46298
46299
46300
46301
46302
46303
46304
46305
46306
46307
46308
46309
46310
46311
46312
46313
46314
46315
46316
46317
46318
46319
46320
46321
46322
46323
46324
46325
46326
46327
46328
46329
46330
46331
46332
46333
46334
46335
46336
46337
46338
46339
46340
46341
46342
46343
46344
46345
46346
46347
46348
46349
46350
46351
46352
46353
46354
46355
46356
46357
46358
46359
46360
46361
46362
46363
46364
46365
46366
46367
46368
46369
46370
46371
46372
46373
46374
46375
46376
46377
46378
46379
46380
46381
46382
46383
46384
46385
46386
46387
46388
46389
46390
46391
46392
46393
46394
46395
46396
46397
46398
46399
46400
46401
46402
46403
46404
46405
46406
46407
46408
46409
46410
46411
46412
46413
46414
46415
46416
46417
46418
46419
46420
46421
46422
46423
46424
46425
46426
46427
46428
46429
46430
46431
46432
46433
46434
46435
46436
46437
46438
46439
46440
46441
46442
46443
46444
46445
46446
46447
46448
46449
46450
46451
46452
46453
46454
46455
46456
46457
46458
46459
46460
46461
46462
46463
46464
46465
46466
46467
46468
46469
46470
46471
46472
46473
46474
46475
46476
46477
46478
46479
46480
46481
46482
46483
46484
46485
46486
46487
46488
46489
46490
46491
46492
46493
46494
46495
46496
46497
46498
46499
46500
46501
46502
46503
46504
46505
46506
46507
46508
46509
46510
46511
46512
46513
46514
46515
46516
46517
46518
46519
46520
46521
46522
46523
46524
46525
46526
46527
46528
46529
46530
46531
46532
46533
46534
46535
46536
46537
46538
46539
46540
46541
46542
46543
46544
46545
46546
46547
46548
46549
46550
46551
46552
46553
46554
46555
46556
46557
46558
46559
46560
46561
46562
46563
46564
46565
46566
46567
46568
46569
46570
46571
46572
46573
46574
46575
46576
46577
46578
46579
46580
46581
46582
46583
46584
46585
46586
46587
46588
46589
46590
46591
46592
46593
46594
46595
46596
46597
46598
46599
46600
46601
46602
46603
46604
46605
46606
46607
46608
46609
46610
46611
46612
46613
46614
46615
46616
46617
46618
46619
46620
46621
46622
46623
46624
46625
46626
46627
46628
46629
46630
46631
46632
46633
46634
46635
46636
46637
46638
46639
46640
46641
46642
46643
46644
46645
46646
46647
46648
46649
46650
46651
46652
46653
46654
46655
46656
46657
46658
46659
46660
46661
46662
46663
46664
46665
46666
46667
46668
46669
46670
46671
46672
46673
46674
46675
46676
46677
46678
46679
46680
46681
46682
46683
46684
46685
46686
46687
46688
46689
46690
46691
46692
46693
46694
46695
46696
46697
46698
46699
46700
46701
46702
46703
46704
46705
46706
46707
46708
46709
46710
46711
46712
46713
46714
46715
46716
46717
46718
46719
46720
46721
46722
46723
46724
46725
46726
46727
46728
46729
46730
46731
46732
46733
46734
46735
46736
46737
46738
46739
46740
46741
46742
46743
46744
46745
46746
46747
46748
46749
46750
46751
46752
46753
46754
46755
46756
46757
46758
46759
46760
46761
46762
46763
46764
46765
46766
46767
46768
46769
46770
46771
46772
46773
46774
46775
46776
46777
46778
46779
46780
46781
46782
46783
46784
46785
46786
46787
46788
46789
46790
46791
46792
46793
46794
46795
46796
46797
46798
46799
46800
46801
46802
46803
46804
46805
46806
46807
46808
46809
46810
46811
46812
46813
46814
46815
46816
46817
46818
46819
46820
46821
46822
46823
46824
46825
46826
46827
46828
46829
46830
46831
46832
46833
46834
46835
46836
46837
46838
46839
46840
46841
46842
46843
46844
46845
46846
46847
46848
46849
46850
46851
46852
46853
46854
46855
46856
46857
46858
46859
46860
46861
46862
46863
46864
46865
46866
46867
46868
46869
46870
46871
46872
46873
46874
46875
46876
46877
46878
46879
46880
46881
46882
46883
46884
46885
46886
46887
46888
46889
46890
46891
46892
46893
46894
46895
46896
46897
46898
46899
46900
46901
46902
46903
46904
46905
46906
46907
46908
46909
46910
46911
46912
46913
46914
46915
46916
46917
46918
46919
46920
46921
46922
46923
46924
46925
46926
46927
46928
46929
46930
46931
46932
46933
46934
46935
46936
46937
46938
46939
46940
46941
46942
46943
46944
46945
46946
46947
46948
46949
46950
46951
46952
46953
46954
46955
46956
46957
46958
46959
46960
46961
46962
46963
46964
46965
46966
46967
46968
46969
46970
46971
46972
46973
46974
46975
46976
46977
46978
46979
46980
46981
46982
46983
46984
46985
46986
46987
46988
46989
46990
46991
46992
46993
46994
46995
46996
46997
46998
46999
47000
47001
47002
47003
47004
47005
47006
47007
47008
47009
47010
47011
47012
47013
47014
47015
47016
47017
47018
47019
47020
47021
47022
47023
47024
47025
47026
47027
47028
47029
47030
47031
47032
47033
47034
47035
47036
47037
47038
47039
47040
47041
47042
47043
47044
47045
47046
47047
47048
47049
47050
47051
47052
47053
47054
47055
47056
47057
47058
47059
47060
47061
47062
47063
47064
47065
47066
47067
47068
47069
47070
47071
47072
47073
47074
47075
47076
47077
47078
47079
47080
47081
47082
47083
47084
47085
47086
47087
47088
47089
47090
47091
47092
47093
47094
47095
47096
47097
47098
47099
47100
47101
47102
47103
47104
47105
47106
47107
47108
47109
47110
47111
47112
47113
47114
47115
47116
47117
47118
47119
47120
47121
47122
47123
47124
47125
47126
47127
47128
47129
47130
47131
47132
47133
47134
47135
47136
47137
47138
47139
47140
47141
47142
47143
47144
47145
47146
47147
47148
47149
47150
47151
47152
47153
47154
47155
47156
47157
47158
47159
47160
47161
47162
47163
47164
47165
47166
47167
47168
47169
47170
47171
47172
47173
47174
47175
47176
47177
47178
47179
47180
47181
47182
47183
47184
47185
47186
47187
47188
47189
47190
47191
47192
47193
47194
47195
47196
47197
47198
47199
47200
47201
47202
47203
47204
47205
47206
47207
47208
47209
47210
47211
47212
47213
47214
47215
47216
47217
47218
47219
47220
47221
47222
47223
47224
47225
47226
47227
47228
47229
47230
47231
47232
47233
47234
47235
47236
47237
47238
47239
47240
47241
47242
47243
47244
47245
47246
47247
47248
47249
47250
47251
47252
47253
47254
47255
47256
47257
47258
47259
47260
47261
47262
47263
47264
47265
47266
47267
47268
47269
47270
47271
47272
47273
47274
47275
47276
47277
47278
47279
47280
47281
47282
47283
47284
47285
47286
47287
47288
47289
47290
47291
47292
47293
47294
47295
47296
47297
47298
47299
47300
47301
47302
47303
47304
47305
47306
47307
47308
47309
47310
47311
47312
47313
47314
47315
47316
47317
47318
47319
47320
47321
47322
47323
47324
47325
47326
47327
47328
47329
47330
47331
47332
47333
47334
47335
47336
47337
47338
47339
47340
47341
47342
47343
47344
47345
47346
47347
47348
47349
47350
47351
47352
47353
47354
47355
47356
47357
47358
47359
47360
47361
47362
47363
47364
47365
47366
47367
47368
47369
47370
47371
47372
47373
47374
47375
47376
47377
47378
47379
47380
47381
47382
47383
47384
47385
47386
47387
47388
47389
47390
47391
47392
47393
47394
47395
47396
47397
47398
47399
47400
47401
47402
47403
47404
47405
47406
47407
47408
47409
47410
47411
47412
47413
47414
47415
47416
47417
47418
47419
47420
47421
47422
47423
47424
47425
47426
47427
47428
47429
47430
47431
47432
47433
47434
47435
47436
47437
47438
47439
47440
47441
47442
47443
47444
47445
47446
47447
47448
47449
47450
47451
47452
47453
47454
47455
47456
47457
47458
47459
47460
47461
47462
47463
47464
47465
47466
47467
47468
47469
47470
47471
47472
47473
47474
47475
47476
47477
47478
47479
47480
47481
47482
47483
47484
47485
47486
47487
47488
47489
47490
47491
47492
47493
47494
47495
47496
47497
47498
47499
47500
47501
47502
47503
47504
47505
47506
47507
47508
47509
47510
47511
47512
47513
47514
47515
47516
47517
47518
47519
47520
47521
47522
47523
47524
47525
47526
47527
47528
47529
47530
47531
47532
47533
47534
47535
47536
47537
47538
47539
47540
47541
47542
47543
47544
47545
47546
47547
47548
47549
47550
47551
47552
47553
47554
47555
47556
47557
47558
47559
47560
47561
47562
47563
47564
47565
47566
47567
47568
47569
47570
47571
47572
47573
47574
47575
47576
47577
47578
47579
47580
47581
47582
47583
47584
47585
47586
47587
47588
47589
47590
47591
47592
47593
47594
47595
47596
47597
47598
47599
47600
47601
47602
47603
47604
47605
47606
47607
47608
47609
47610
47611
47612
47613
47614
47615
47616
47617
47618
47619
47620
47621
47622
47623
47624
47625
47626
47627
47628
47629
47630
47631
47632
47633
47634
47635
47636
47637
47638
47639
47640
47641
47642
47643
47644
47645
47646
47647
47648
47649
47650
47651
47652
47653
47654
47655
47656
47657
47658
47659
47660
47661
47662
47663
47664
47665
47666
47667
47668
47669
47670
47671
47672
47673
47674
47675
47676
47677
47678
47679
47680
47681
47682
47683
47684
47685
47686
47687
47688
47689
47690
47691
47692
47693
47694
47695
47696
47697
47698
47699
47700
47701
47702
47703
47704
47705
47706
47707
47708
47709
47710
47711
47712
47713
47714
47715
47716
47717
47718
47719
47720
47721
47722
47723
47724
47725
47726
47727
47728
47729
47730
47731
47732
47733
47734
47735
47736
47737
47738
47739
47740
47741
47742
47743
47744
47745
47746
47747
47748
47749
47750
47751
47752
47753
47754
47755
47756
47757
47758
47759
47760
47761
47762
47763
47764
47765
47766
47767
47768
47769
47770
47771
47772
47773
47774
47775
47776
47777
47778
47779
47780
47781
47782
47783
47784
47785
47786
47787
47788
47789
47790
47791
47792
47793
47794
47795
47796
47797
47798
47799
47800
47801
47802
47803
47804
47805
47806
47807
47808
47809
47810
47811
47812
47813
47814
47815
47816
47817
47818
47819
47820
47821
47822
47823
47824
47825
47826
47827
47828
47829
47830
47831
47832
47833
47834
47835
47836
47837
47838
47839
47840
47841
47842
47843
47844
47845
47846
47847
47848
47849
47850
47851
47852
47853
47854
47855
47856
47857
47858
47859
47860
47861
47862
47863
47864
47865
47866
47867
47868
47869
47870
47871
47872
47873
47874
47875
47876
47877
47878
47879
47880
47881
47882
47883
47884
47885
47886
47887
47888
47889
47890
47891
47892
47893
47894
47895
47896
47897
47898
47899
47900
47901
47902
47903
47904
47905
47906
47907
47908
47909
47910
47911
47912
47913
47914
47915
47916
47917
47918
47919
47920
47921
47922
47923
47924
47925
47926
47927
47928
47929
47930
47931
47932
47933
47934
47935
47936
47937
47938
47939
47940
47941
47942
47943
47944
47945
47946
47947
47948
47949
47950
47951
47952
47953
47954
47955
47956
47957
47958
47959
47960
47961
47962
47963
47964
47965
47966
47967
47968
47969
47970
47971
47972
47973
47974
47975
47976
47977
47978
47979
47980
47981
47982
47983
47984
47985
47986
47987
47988
47989
47990
47991
47992
47993
47994
47995
47996
47997
47998
47999
48000
48001
48002
48003
48004
48005
48006
48007
48008
48009
48010
48011
48012
48013
48014
48015
48016
48017
48018
48019
48020
48021
48022
48023
48024
48025
48026
48027
48028
48029
48030
48031
48032
48033
48034
48035
48036
48037
48038
48039
48040
48041
48042
48043
48044
48045
48046
48047
48048
48049
48050
48051
48052
48053
48054
48055
48056
48057
48058
48059
48060
48061
48062
48063
48064
48065
48066
48067
48068
48069
48070
48071
48072
48073
48074
48075
48076
48077
48078
48079
48080
48081
48082
48083
48084
48085
48086
48087
48088
48089
48090
48091
48092
48093
48094
48095
48096
48097
48098
48099
48100
48101
48102
48103
48104
48105
48106
48107
48108
48109
48110
48111
48112
48113
48114
48115
48116
48117
48118
48119
48120
48121
48122
48123
48124
48125
48126
48127
48128
48129
48130
48131
48132
48133
48134
48135
48136
48137
48138
48139
48140
48141
48142
48143
48144
48145
48146
48147
48148
48149
48150
48151
48152
48153
48154
48155
48156
48157
48158
48159
48160
48161
48162
48163
48164
48165
48166
48167
48168
48169
48170
48171
48172
48173
48174
48175
48176
48177
48178
48179
48180
48181
48182
48183
48184
48185
48186
48187
48188
48189
48190
48191
48192
48193
48194
48195
48196
48197
48198
48199
48200
48201
48202
48203
48204
48205
48206
48207
48208
48209
48210
48211
48212
48213
48214
48215
48216
48217
48218
48219
48220
48221
48222
48223
48224
48225
48226
48227
48228
48229
48230
48231
48232
48233
48234
48235
48236
48237
48238
48239
48240
48241
48242
48243
48244
48245
48246
48247
48248
48249
48250
48251
48252
48253
48254
48255
48256
48257
48258
48259
48260
48261
48262
48263
48264
48265
48266
48267
48268
48269
48270
48271
48272
48273
48274
48275
48276
48277
48278
48279
48280
48281
48282
48283
48284
48285
48286
48287
48288
48289
48290
48291
48292
48293
48294
48295
48296
48297
48298
48299
48300
48301
48302
48303
48304
48305
48306
48307
48308
48309
48310
48311
48312
48313
48314
48315
48316
48317
48318
48319
48320
48321
48322
48323
48324
48325
48326
48327
48328
48329
48330
48331
48332
48333
48334
48335
48336
48337
48338
48339
48340
48341
48342
48343
48344
48345
48346
48347
48348
48349
48350
48351
48352
48353
48354
48355
48356
48357
48358
48359
48360
48361
48362
48363
48364
48365
48366
48367
48368
48369
48370
48371
48372
48373
48374
48375
48376
48377
48378
48379
48380
48381
48382
48383
48384
48385
48386
48387
48388
48389
48390
48391
48392
48393
48394
48395
48396
48397
48398
48399
48400
48401
48402
48403
48404
48405
48406
48407
48408
48409
48410
48411
48412
48413
48414
48415
48416
48417
48418
48419
48420
48421
48422
48423
48424
48425
48426
48427
48428
48429
48430
48431
48432
48433
48434
48435
48436
48437
48438
48439
48440
48441
48442
48443
48444
48445
48446
48447
48448
48449
48450
48451
48452
48453
48454
48455
48456
48457
48458
48459
48460
48461
48462
48463
48464
48465
48466
48467
48468
48469
48470
48471
48472
48473
48474
48475
48476
48477
48478
48479
48480
48481
48482
48483
48484
48485
48486
48487
48488
48489
48490
48491
48492
48493
48494
48495
48496
48497
48498
48499
48500
48501
48502
48503
48504
48505
48506
48507
48508
48509
48510
48511
48512
48513
48514
48515
48516
48517
48518
48519
48520
48521
48522
48523
48524
48525
48526
48527
48528
48529
48530
48531
48532
48533
48534
48535
48536
48537
48538
48539
48540
48541
48542
48543
48544
48545
48546
48547
48548
48549
48550
48551
48552
48553
48554
48555
48556
48557
48558
48559
48560
48561
48562
48563
48564
48565
48566
48567
48568
48569
48570
48571
48572
48573
48574
48575
48576
48577
48578
48579
48580
48581
48582
48583
48584
48585
48586
48587
48588
48589
48590
48591
48592
48593
48594
48595
48596
48597
48598
48599
48600
48601
48602
48603
48604
48605
48606
48607
48608
48609
48610
48611
48612
48613
48614
48615
48616
48617
48618
48619
48620
48621
48622
48623
48624
48625
48626
48627
48628
48629
48630
48631
48632
48633
48634
48635
48636
48637
48638
48639
48640
48641
48642
48643
48644
48645
48646
48647
48648
48649
48650
48651
48652
48653
48654
48655
48656
48657
48658
48659
48660
48661
48662
48663
48664
48665
48666
48667
48668
48669
48670
48671
48672
48673
48674
48675
48676
48677
48678
48679
48680
48681
48682
48683
48684
48685
48686
48687
48688
48689
48690
48691
48692
48693
48694
48695
48696
48697
48698
48699
48700
48701
48702
48703
48704
48705
48706
48707
48708
48709
48710
48711
48712
48713
48714
48715
48716
48717
48718
48719
48720
48721
48722
48723
48724
48725
48726
48727
48728
48729
48730
48731
48732
48733
48734
48735
48736
48737
48738
48739
48740
48741
48742
48743
48744
48745
48746
48747
48748
48749
48750
48751
48752
48753
48754
48755
48756
48757
48758
48759
48760
48761
48762
48763
48764
48765
48766
48767
48768
48769
48770
48771
48772
48773
48774
48775
48776
48777
48778
48779
48780
48781
48782
48783
48784
48785
48786
48787
48788
48789
48790
48791
48792
48793
48794
48795
48796
48797
48798
48799
48800
48801
48802
48803
48804
48805
48806
48807
48808
48809
48810
48811
48812
48813
48814
48815
48816
48817
48818
48819
48820
48821
48822
48823
48824
48825
48826
48827
48828
48829
48830
48831
48832
48833
48834
48835
48836
48837
48838
48839
48840
48841
48842
48843
48844
48845
48846
48847
48848
48849
48850
48851
48852
48853
48854
48855
48856
48857
48858
48859
48860
48861
48862
48863
48864
48865
48866
48867
48868
48869
48870
48871
48872
48873
48874
48875
48876
48877
48878
48879
48880
48881
48882
48883
48884
48885
48886
48887
48888
48889
48890
48891
48892
48893
48894
48895
48896
48897
48898
48899
48900
48901
48902
48903
48904
48905
48906
48907
48908
48909
48910
48911
48912
48913
48914
48915
48916
48917
48918
48919
48920
48921
48922
48923
48924
48925
48926
48927
48928
48929
48930
48931
48932
48933
48934
48935
48936
48937
48938
48939
48940
48941
48942
48943
48944
48945
48946
48947
48948
48949
48950
48951
48952
48953
48954
48955
48956
48957
48958
48959
48960
48961
48962
48963
48964
48965
48966
48967
48968
48969
48970
48971
48972
48973
48974
48975
48976
48977
48978
48979
48980
48981
48982
48983
48984
48985
48986
48987
48988
48989
48990
48991
48992
48993
48994
48995
48996
48997
48998
48999
49000
49001
49002
49003
49004
49005
49006
49007
49008
49009
49010
49011
49012
49013
49014
49015
49016
49017
49018
49019
49020
49021
49022
49023
49024
49025
49026
49027
49028
49029
49030
49031
49032
49033
49034
49035
49036
49037
49038
49039
49040
49041
49042
49043
49044
49045
49046
49047
49048
49049
49050
49051
49052
49053
49054
49055
49056
49057
49058
49059
49060
49061
49062
49063
49064
49065
49066
49067
49068
49069
49070
49071
49072
49073
49074
49075
49076
49077
49078
49079
49080
49081
49082
49083
49084
49085
49086
49087
49088
49089
49090
49091
49092
49093
49094
49095
49096
49097
49098
49099
49100
49101
49102
49103
49104
49105
49106
49107
49108
49109
49110
49111
49112
49113
49114
49115
49116
49117
49118
49119
49120
49121
49122
49123
49124
49125
49126
49127
49128
49129
49130
49131
49132
49133
49134
49135
49136
49137
49138
49139
49140
49141
49142
49143
49144
49145
49146
49147
49148
49149
49150
49151
49152
49153
49154
49155
49156
49157
49158
49159
49160
49161
49162
49163
49164
49165
49166
49167
49168
49169
49170
49171
49172
49173
49174
49175
49176
49177
49178
49179
49180
49181
49182
49183
49184
49185
49186
49187
49188
49189
49190
49191
49192
49193
49194
49195
49196
49197
49198
49199
49200
49201
49202
49203
49204
49205
49206
49207
49208
49209
49210
49211
49212
49213
49214
49215
49216
49217
49218
49219
49220
49221
49222
49223
49224
49225
49226
49227
49228
49229
49230
49231
49232
49233
49234
49235
49236
49237
49238
49239
49240
49241
49242
49243
49244
49245
49246
49247
49248
49249
49250
49251
49252
49253
49254
49255
49256
49257
49258
49259
49260
49261
49262
49263
49264
49265
49266
49267
49268
49269
49270
49271
49272
49273
49274
49275
49276
49277
49278
49279
49280
49281
49282
49283
49284
49285
49286
49287
49288
49289
49290
49291
49292
49293
49294
49295
49296
49297
49298
49299
49300
49301
49302
49303
49304
49305
49306
49307
49308
49309
49310
49311
49312
49313
49314
49315
49316
49317
49318
49319
49320
49321
49322
49323
49324
49325
49326
49327
49328
49329
49330
49331
49332
49333
49334
49335
49336
49337
49338
49339
49340
49341
49342
49343
49344
49345
49346
49347
49348
49349
49350
49351
49352
49353
49354
49355
49356
49357
49358
49359
49360
49361
49362
49363
49364
49365
49366
49367
49368
49369
49370
49371
49372
49373
49374
49375
49376
49377
49378
49379
49380
49381
49382
49383
49384
49385
49386
49387
49388
49389
49390
49391
49392
49393
49394
49395
49396
49397
49398
49399
49400
49401
49402
49403
49404
49405
49406
49407
49408
49409
49410
49411
49412
49413
49414
49415
49416
49417
49418
49419
49420
49421
49422
49423
49424
49425
49426
49427
49428
49429
49430
49431
49432
49433
49434
49435
49436
49437
49438
49439
49440
49441
49442
49443
49444
49445
49446
49447
49448
49449
49450
49451
49452
49453
49454
49455
49456
49457
49458
49459
49460
49461
49462
49463
49464
49465
49466
49467
49468
49469
49470
49471
49472
49473
49474
49475
49476
49477
49478
49479
49480
49481
49482
49483
49484
49485
49486
49487
49488
49489
49490
49491
49492
49493
49494
49495
49496
49497
49498
49499
49500
49501
49502
49503
49504
49505
49506
49507
49508
49509
49510
49511
49512
49513
49514
49515
49516
49517
49518
49519
49520
49521
49522
49523
49524
49525
49526
49527
49528
49529
49530
49531
49532
49533
49534
49535
49536
49537
49538
49539
49540
49541
49542
49543
49544
49545
49546
49547
49548
49549
49550
49551
49552
49553
49554
49555
49556
49557
49558
49559
49560
49561
49562
49563
49564
49565
49566
49567
49568
49569
49570
49571
49572
49573
49574
49575
49576
49577
49578
49579
49580
49581
49582
49583
49584
49585
49586
49587
49588
49589
49590
49591
49592
49593
49594
49595
49596
49597
49598
49599
49600
49601
49602
49603
49604
49605
49606
49607
49608
49609
49610
49611
49612
49613
49614
49615
49616
49617
49618
49619
49620
49621
49622
49623
49624
49625
49626
49627
49628
49629
49630
49631
49632
49633
49634
49635
49636
49637
49638
49639
49640
49641
49642
49643
49644
49645
49646
49647
49648
49649
49650
49651
49652
49653
49654
49655
49656
49657
49658
49659
49660
49661
49662
49663
49664
49665
49666
49667
49668
49669
49670
49671
49672
49673
49674
49675
49676
49677
49678
49679
49680
49681
49682
49683
49684
49685
49686
49687
49688
49689
49690
49691
49692
49693
49694
49695
49696
49697
49698
49699
49700
49701
49702
49703
49704
49705
49706
49707
49708
49709
49710
49711
49712
49713
49714
49715
49716
49717
49718
49719
49720
49721
49722
49723
49724
49725
49726
49727
49728
49729
49730
49731
49732
49733
49734
49735
49736
49737
49738
49739
49740
49741
49742
49743
49744
49745
49746
49747
49748
49749
49750
49751
49752
49753
49754
49755
49756
49757
49758
49759
49760
49761
49762
49763
49764
49765
49766
49767
49768
49769
49770
49771
49772
49773
49774
49775
49776
49777
49778
49779
49780
49781
49782
49783
49784
49785
49786
49787
49788
49789
49790
49791
49792
49793
49794
49795
49796
49797
49798
49799
49800
49801
49802
49803
49804
49805
49806
49807
49808
49809
49810
49811
49812
49813
49814
49815
49816
49817
49818
49819
49820
49821
49822
49823
49824
49825
49826
49827
49828
49829
49830
49831
49832
49833
49834
49835
49836
49837
49838
49839
49840
49841
49842
49843
49844
49845
49846
49847
49848
49849
49850
49851
49852
49853
49854
49855
49856
49857
49858
49859
49860
49861
49862
49863
49864
49865
49866
49867
49868
49869
49870
49871
49872
49873
49874
49875
49876
49877
49878
49879
49880
49881
49882
49883
49884
49885
49886
49887
49888
49889
49890
49891
49892
49893
49894
49895
49896
49897
49898
49899
49900
49901
49902
49903
49904
49905
49906
49907
49908
49909
49910
49911
49912
49913
49914
49915
49916
49917
49918
49919
49920
49921
49922
49923
49924
49925
49926
49927
49928
49929
49930
49931
49932
49933
49934
49935
49936
49937
49938
49939
49940
49941
49942
49943
49944
49945
49946
49947
49948
49949
49950
49951
49952
49953
49954
49955
49956
49957
49958
49959
49960
49961
49962
49963
49964
49965
49966
49967
49968
49969
49970
49971
49972
49973
49974
49975
49976
49977
49978
49979
49980
49981
49982
49983
49984
49985
49986
49987
49988
49989
49990
49991
49992
49993
49994
49995
49996
49997
49998
49999
50000
50001
50002
50003
50004
50005
50006
50007
50008
50009
50010
50011
50012
50013
50014
50015
50016
50017
50018
50019
50020
50021
50022
50023
50024
50025
50026
50027
50028
50029
50030
50031
50032
50033
50034
50035
50036
50037
50038
50039
50040
50041
50042
50043
50044
50045
50046
50047
50048
50049
50050
50051
50052
50053
50054
50055
50056
50057
50058
50059
50060
50061
50062
50063
50064
50065
50066
50067
50068
50069
50070
50071
50072
50073
50074
50075
50076
50077
50078
50079
50080
50081
50082
50083
50084
50085
50086
50087
50088
50089
50090
50091
50092
50093
50094
50095
50096
50097
50098
50099
50100
50101
50102
50103
50104
50105
50106
50107
50108
50109
50110
50111
50112
50113
50114
50115
50116
50117
50118
50119
50120
50121
50122
50123
50124
50125
50126
50127
50128
50129
50130
50131
50132
50133
50134
50135
50136
50137
50138
50139
50140
50141
50142
50143
50144
50145
50146
50147
50148
50149
50150
50151
50152
50153
50154
50155
50156
50157
50158
50159
50160
50161
50162
50163
50164
50165
50166
50167
50168
50169
50170
50171
50172
50173
50174
50175
50176
50177
50178
50179
50180
50181
50182
50183
50184
50185
50186
50187
50188
50189
50190
50191
50192
50193
50194
50195
50196
50197
50198
50199
50200
50201
50202
50203
50204
50205
50206
50207
50208
50209
50210
50211
50212
50213
50214
50215
50216
50217
50218
50219
50220
50221
50222
50223
50224
50225
50226
50227
50228
50229
50230
50231
50232
50233
50234
50235
50236
50237
50238
50239
50240
50241
50242
50243
50244
50245
50246
50247
50248
50249
50250
50251
50252
50253
50254
50255
50256
50257
50258
50259
50260
50261
50262
50263
50264
50265
50266
50267
50268
50269
50270
50271
50272
50273
50274
50275
50276
50277
50278
50279
50280
50281
50282
50283
50284
50285
50286
50287
50288
50289
50290
50291
50292
50293
50294
50295
50296
50297
50298
50299
50300
50301
50302
50303
50304
50305
50306
50307
50308
50309
50310
50311
50312
50313
50314
50315
50316
50317
50318
50319
50320
50321
50322
50323
50324
50325
50326
50327
50328
50329
50330
50331
50332
50333
50334
50335
50336
50337
50338
50339
50340
50341
50342
50343
50344
50345
50346
50347
50348
50349
50350
50351
50352
50353
50354
50355
50356
50357
50358
50359
50360
50361
50362
50363
50364
50365
50366
50367
50368
50369
50370
50371
50372
50373
50374
50375
50376
50377
50378
50379
50380
50381
50382
50383
50384
50385
50386
50387
50388
50389
50390
50391
50392
50393
50394
50395
50396
50397
50398
50399
50400
50401
50402
50403
50404
50405
50406
50407
50408
50409
50410
50411
50412
50413
50414
50415
50416
50417
50418
50419
50420
50421
50422
50423
50424
50425
50426
50427
50428
50429
50430
50431
50432
50433
50434
50435
50436
50437
50438
50439
50440
50441
50442
50443
50444
50445
50446
50447
50448
50449
50450
50451
50452
50453
50454
50455
50456
50457
50458
50459
50460
50461
50462
50463
50464
50465
50466
50467
50468
50469
50470
50471
50472
50473
50474
50475
50476
50477
50478
50479
50480
50481
50482
50483
50484
50485
50486
50487
50488
50489
50490
50491
50492
50493
50494
50495
50496
50497
50498
50499
50500
50501
50502
50503
50504
50505
50506
50507
50508
50509
50510
50511
50512
50513
50514
50515
50516
50517
50518
50519
50520
50521
50522
50523
50524
50525
50526
50527
50528
50529
50530
50531
50532
50533
50534
50535
50536
50537
50538
50539
50540
50541
50542
50543
50544
50545
50546
50547
50548
50549
50550
50551
50552
50553
50554
50555
50556
50557
50558
50559
50560
50561
50562
50563
50564
50565
50566
50567
50568
50569
50570
50571
50572
50573
50574
50575
50576
50577
50578
50579
50580
50581
50582
50583
50584
50585
50586
50587
50588
50589
50590
50591
50592
50593
50594
50595
50596
50597
50598
50599
50600
50601
50602
50603
50604
50605
50606
50607
50608
50609
50610
50611
50612
50613
50614
50615
50616
50617
50618
50619
50620
50621
50622
50623
50624
50625
50626
50627
50628
50629
50630
50631
50632
50633
50634
50635
50636
50637
50638
50639
50640
50641
50642
50643
50644
50645
50646
50647
50648
50649
50650
50651
50652
50653
50654
50655
50656
50657
50658
50659
50660
50661
50662
50663
50664
50665
50666
50667
50668
50669
50670
50671
50672
50673
50674
50675
50676
50677
50678
50679
50680
50681
50682
50683
50684
50685
50686
50687
50688
50689
50690
50691
50692
50693
50694
50695
50696
50697
50698
50699
50700
50701
50702
50703
50704
50705
50706
50707
50708
50709
50710
50711
50712
50713
50714
50715
50716
50717
50718
50719
50720
50721
50722
50723
50724
50725
50726
50727
50728
50729
50730
50731
50732
50733
50734
50735
50736
50737
50738
50739
50740
50741
50742
50743
50744
50745
50746
50747
50748
50749
50750
50751
50752
50753
50754
50755
50756
50757
50758
50759
50760
50761
50762
50763
50764
50765
50766
50767
50768
50769
50770
50771
50772
50773
50774
50775
50776
50777
50778
50779
50780
50781
50782
50783
50784
50785
50786
50787
50788
50789
50790
50791
50792
50793
50794
50795
50796
50797
50798
50799
50800
50801
50802
50803
50804
50805
50806
50807
50808
50809
50810
50811
50812
50813
50814
50815
50816
50817
50818
50819
50820
50821
50822
50823
50824
50825
50826
50827
50828
50829
50830
50831
50832
50833
50834
50835
50836
50837
50838
50839
50840
50841
50842
50843
50844
50845
50846
50847
50848
50849
50850
50851
50852
50853
50854
50855
50856
50857
50858
50859
50860
50861
50862
50863
50864
50865
50866
50867
50868
50869
50870
50871
50872
50873
50874
50875
50876
50877
50878
50879
50880
50881
50882
50883
50884
50885
50886
50887
50888
50889
50890
50891
50892
50893
50894
50895
50896
50897
50898
50899
50900
50901
50902
50903
50904
50905
50906
50907
50908
50909
50910
50911
50912
50913
50914
50915
50916
50917
50918
50919
50920
50921
50922
50923
50924
50925
50926
50927
50928
50929
50930
50931
50932
50933
50934
50935
50936
50937
50938
50939
50940
50941
50942
50943
50944
50945
50946
50947
50948
50949
50950
50951
50952
50953
50954
50955
50956
50957
50958
50959
50960
50961
50962
50963
50964
50965
50966
50967
50968
50969
50970
50971
50972
50973
50974
50975
50976
50977
50978
50979
50980
50981
50982
50983
50984
50985
50986
50987
50988
50989
50990
50991
50992
50993
50994
50995
50996
50997
50998
50999
51000
51001
51002
51003
51004
51005
51006
51007
51008
51009
51010
51011
51012
51013
51014
51015
51016
51017
51018
51019
51020
51021
51022
51023
51024
51025
51026
51027
51028
51029
51030
51031
51032
51033
51034
51035
51036
51037
51038
51039
51040
51041
51042
51043
51044
51045
51046
51047
51048
51049
51050
51051
51052
51053
51054
51055
51056
51057
51058
51059
51060
51061
51062
51063
51064
51065
51066
51067
51068
51069
51070
51071
51072
51073
51074
51075
51076
51077
51078
51079
51080
51081
51082
51083
51084
51085
51086
51087
51088
51089
51090
51091
51092
51093
51094
51095
51096
51097
51098
51099
51100
51101
51102
51103
51104
51105
51106
51107
51108
51109
51110
51111
51112
51113
51114
51115
51116
51117
51118
51119
51120
51121
51122
51123
51124
51125
51126
51127
51128
51129
51130
51131
51132
51133
51134
51135
51136
51137
51138
51139
51140
51141
51142
51143
51144
51145
51146
51147
51148
51149
51150
51151
51152
51153
51154
51155
51156
51157
51158
51159
51160
51161
51162
51163
51164
51165
51166
51167
51168
51169
51170
51171
51172
51173
51174
51175
51176
51177
51178
51179
51180
51181
51182
51183
51184
51185
51186
51187
51188
51189
51190
51191
51192
51193
51194
51195
51196
51197
51198
51199
51200
51201
51202
51203
51204
51205
51206
51207
51208
51209
51210
51211
51212
51213
51214
51215
51216
51217
51218
51219
51220
51221
51222
51223
51224
51225
51226
51227
51228
51229
51230
51231
51232
51233
51234
51235
51236
51237
51238
51239
51240
51241
51242
51243
51244
51245
51246
51247
51248
51249
51250
51251
51252
51253
51254
51255
51256
51257
51258
51259
51260
51261
51262
51263
51264
51265
51266
51267
51268
51269
51270
51271
51272
51273
51274
51275
51276
51277
51278
51279
51280
51281
51282
51283
51284
51285
51286
51287
51288
51289
51290
51291
51292
51293
51294
51295
51296
51297
51298
51299
51300
51301
51302
51303
51304
51305
51306
51307
51308
51309
51310
51311
51312
51313
51314
51315
51316
51317
51318
51319
51320
51321
51322
51323
51324
51325
51326
51327
51328
51329
51330
51331
51332
51333
51334
51335
51336
51337
51338
51339
51340
51341
51342
51343
51344
51345
51346
51347
51348
51349
51350
51351
51352
51353
51354
51355
51356
51357
51358
51359
51360
51361
51362
51363
51364
51365
51366
51367
51368
51369
51370
51371
51372
51373
51374
51375
51376
51377
51378
51379
51380
51381
51382
51383
51384
51385
51386
51387
51388
51389
51390
51391
51392
51393
51394
51395
51396
51397
51398
51399
51400
51401
51402
51403
51404
51405
51406
51407
51408
51409
51410
51411
51412
51413
51414
51415
51416
51417
51418
51419
51420
51421
51422
51423
51424
51425
51426
51427
51428
51429
51430
51431
51432
51433
51434
51435
51436
51437
51438
51439
51440
51441
51442
51443
51444
51445
51446
51447
51448
51449
51450
51451
51452
51453
51454
51455
51456
51457
51458
51459
51460
51461
51462
51463
51464
51465
51466
51467
51468
51469
51470
51471
51472
51473
51474
51475
51476
51477
51478
51479
51480
51481
51482
51483
51484
51485
51486
51487
51488
51489
51490
51491
51492
51493
51494
51495
51496
51497
51498
51499
51500
51501
51502
51503
51504
51505
51506
51507
51508
51509
51510
51511
51512
51513
51514
51515
51516
51517
51518
51519
51520
51521
51522
51523
51524
51525
51526
51527
51528
51529
51530
51531
51532
51533
51534
51535
51536
51537
51538
51539
51540
51541
51542
51543
51544
51545
51546
51547
51548
51549
51550
51551
51552
51553
51554
51555
51556
51557
51558
51559
51560
51561
51562
51563
51564
51565
51566
51567
51568
51569
51570
51571
51572
51573
51574
51575
51576
51577
51578
51579
51580
51581
51582
51583
51584
51585
51586
51587
51588
51589
51590
51591
51592
51593
51594
51595
51596
51597
51598
51599
51600
51601
51602
51603
51604
51605
51606
51607
51608
51609
51610
51611
51612
51613
51614
51615
51616
51617
51618
51619
51620
51621
51622
51623
51624
51625
51626
51627
51628
51629
51630
51631
51632
51633
51634
51635
51636
51637
51638
51639
51640
51641
51642
51643
51644
51645
51646
51647
51648
51649
51650
51651
51652
51653
51654
51655
51656
51657
51658
51659
51660
51661
51662
51663
51664
51665
51666
51667
51668
51669
51670
51671
51672
51673
51674
51675
51676
51677
51678
51679
51680
51681
51682
51683
51684
51685
51686
51687
51688
51689
51690
51691
51692
51693
51694
51695
51696
51697
51698
51699
51700
51701
51702
51703
51704
51705
51706
51707
51708
51709
51710
51711
51712
51713
51714
51715
51716
51717
51718
51719
51720
51721
51722
51723
51724
51725
51726
51727
51728
51729
51730
51731
51732
51733
51734
51735
51736
51737
51738
51739
51740
51741
51742
51743
51744
51745
51746
51747
51748
51749
51750
51751
51752
51753
51754
51755
51756
51757
51758
51759
51760
51761
51762
51763
51764
51765
51766
51767
51768
51769
51770
51771
51772
51773
51774
51775
51776
51777
51778
51779
51780
51781
51782
51783
51784
51785
51786
51787
51788
51789
51790
51791
51792
51793
51794
51795
51796
51797
51798
51799
51800
51801
51802
51803
51804
51805
51806
51807
51808
51809
51810
51811
51812
51813
51814
51815
51816
51817
51818
51819
51820
51821
51822
51823
51824
51825
51826
51827
51828
51829
51830
51831
51832
51833
51834
51835
51836
51837
51838
51839
51840
51841
51842
51843
51844
51845
51846
51847
51848
51849
51850
51851
51852
51853
51854
51855
51856
51857
51858
51859
51860
51861
51862
51863
51864
51865
51866
51867
51868
51869
51870
51871
51872
51873
51874
51875
51876
51877
51878
51879
51880
51881
51882
51883
51884
51885
51886
51887
51888
51889
51890
51891
51892
51893
51894
51895
51896
51897
51898
51899
51900
51901
51902
51903
51904
51905
51906
51907
51908
51909
51910
51911
51912
51913
51914
51915
51916
51917
51918
51919
51920
51921
51922
51923
51924
51925
51926
51927
51928
51929
51930
51931
51932
51933
51934
51935
51936
51937
51938
51939
51940
51941
51942
51943
51944
51945
51946
51947
51948
51949
51950
51951
51952
51953
51954
51955
51956
51957
51958
51959
51960
51961
51962
51963
51964
51965
51966
51967
51968
51969
51970
51971
51972
51973
51974
51975
51976
51977
51978
51979
51980
51981
51982
51983
51984
51985
51986
51987
51988
51989
51990
51991
51992
51993
51994
51995
51996
51997
51998
51999
52000
52001
52002
52003
52004
52005
52006
52007
52008
52009
52010
52011
52012
52013
52014
52015
52016
52017
52018
52019
52020
52021
52022
52023
52024
52025
52026
52027
52028
52029
52030
52031
52032
52033
52034
52035
52036
52037
52038
52039
52040
52041
52042
52043
52044
52045
52046
52047
52048
52049
52050
52051
52052
52053
52054
52055
52056
52057
52058
52059
52060
52061
52062
52063
52064
52065
52066
52067
52068
52069
52070
52071
52072
52073
52074
52075
52076
52077
52078
52079
52080
52081
52082
52083
52084
52085
52086
52087
52088
52089
52090
52091
52092
52093
52094
52095
52096
52097
52098
52099
52100
52101
52102
52103
52104
52105
52106
52107
52108
52109
52110
52111
52112
52113
52114
52115
52116
52117
52118
52119
52120
52121
52122
52123
52124
52125
52126
52127
52128
52129
52130
52131
52132
52133
52134
52135
52136
52137
52138
52139
52140
52141
52142
52143
52144
52145
52146
52147
52148
52149
52150
52151
52152
52153
52154
52155
52156
52157
52158
52159
52160
52161
52162
52163
52164
52165
52166
52167
52168
52169
52170
52171
52172
52173
52174
52175
52176
52177
52178
52179
52180
52181
52182
52183
52184
52185
52186
52187
52188
52189
52190
52191
52192
52193
52194
52195
52196
52197
52198
52199
52200
52201
52202
52203
52204
52205
52206
52207
52208
52209
52210
52211
52212
52213
52214
52215
52216
52217
52218
52219
52220
52221
52222
52223
52224
52225
52226
52227
52228
52229
52230
52231
52232
52233
52234
52235
52236
52237
52238
52239
52240
52241
52242
52243
52244
52245
52246
52247
52248
52249
52250
52251
52252
52253
52254
52255
52256
52257
52258
52259
52260
52261
52262
52263
52264
52265
52266
52267
52268
52269
52270
52271
52272
52273
52274
52275
52276
52277
52278
52279
52280
52281
52282
52283
52284
52285
52286
52287
52288
52289
52290
52291
52292
52293
52294
52295
52296
52297
52298
52299
52300
52301
52302
52303
52304
52305
52306
52307
52308
52309
52310
52311
52312
52313
52314
52315
52316
52317
52318
52319
52320
52321
52322
52323
52324
52325
52326
52327
52328
52329
52330
52331
52332
52333
52334
52335
52336
52337
52338
52339
52340
52341
52342
52343
52344
52345
52346
52347
52348
52349
52350
52351
52352
52353
52354
52355
52356
52357
52358
52359
52360
52361
52362
52363
52364
52365
52366
52367
52368
52369
52370
52371
52372
52373
52374
52375
52376
52377
52378
52379
52380
52381
52382
52383
52384
52385
52386
52387
52388
52389
52390
52391
52392
52393
52394
52395
52396
52397
52398
52399
52400
52401
52402
52403
52404
52405
52406
52407
52408
52409
52410
52411
52412
52413
52414
52415
52416
52417
52418
52419
52420
52421
52422
52423
52424
52425
52426
52427
52428
52429
52430
52431
52432
52433
52434
52435
52436
52437
52438
52439
52440
52441
52442
52443
52444
52445
52446
52447
52448
52449
52450
52451
52452
52453
52454
52455
52456
52457
52458
52459
52460
52461
52462
52463
52464
52465
52466
52467
52468
52469
52470
52471
52472
52473
52474
52475
52476
52477
52478
52479
52480
52481
52482
52483
52484
52485
52486
52487
52488
52489
52490
52491
52492
52493
52494
52495
52496
52497
52498
52499
52500
52501
52502
52503
52504
52505
52506
52507
52508
52509
52510
52511
52512
52513
52514
52515
52516
52517
52518
52519
52520
52521
52522
52523
52524
52525
52526
52527
52528
52529
52530
52531
52532
52533
52534
52535
52536
52537
52538
52539
52540
52541
52542
52543
52544
52545
52546
52547
52548
52549
52550
52551
52552
52553
52554
52555
52556
52557
52558
52559
52560
52561
52562
52563
52564
52565
52566
52567
52568
52569
52570
52571
52572
52573
52574
52575
52576
52577
52578
52579
52580
52581
52582
52583
52584
52585
52586
52587
52588
52589
52590
52591
52592
52593
52594
52595
52596
52597
52598
52599
52600
52601
52602
52603
52604
52605
52606
52607
52608
52609
52610
52611
52612
52613
52614
52615
52616
52617
52618
52619
52620
52621
52622
52623
52624
52625
52626
52627
52628
52629
52630
52631
52632
52633
52634
52635
52636
52637
52638
52639
52640
52641
52642
52643
52644
52645
52646
52647
52648
52649
52650
52651
52652
52653
52654
52655
52656
52657
52658
52659
52660
52661
52662
52663
52664
52665
52666
52667
52668
52669
52670
52671
52672
52673
52674
52675
52676
52677
52678
52679
52680
52681
52682
52683
52684
52685
52686
52687
52688
52689
52690
52691
52692
52693
52694
52695
52696
52697
52698
52699
52700
52701
52702
52703
52704
52705
52706
52707
52708
52709
52710
52711
52712
52713
52714
52715
52716
52717
52718
52719
52720
52721
52722
52723
52724
52725
52726
52727
52728
52729
52730
52731
52732
52733
52734
52735
52736
52737
52738
52739
52740
52741
52742
52743
52744
52745
52746
52747
52748
52749
52750
52751
52752
52753
52754
52755
52756
52757
52758
52759
52760
52761
52762
52763
52764
52765
52766
52767
52768
52769
52770
52771
52772
52773
52774
52775
52776
52777
52778
52779
52780
52781
52782
52783
52784
52785
52786
52787
52788
52789
52790
52791
52792
52793
52794
52795
52796
52797
52798
52799
52800
52801
52802
52803
52804
52805
52806
52807
52808
52809
52810
52811
52812
52813
52814
52815
52816
52817
52818
52819
52820
52821
52822
52823
52824
52825
52826
52827
52828
52829
52830
52831
52832
52833
52834
52835
52836
52837
52838
52839
52840
52841
52842
52843
52844
52845
52846
52847
52848
52849
52850
52851
52852
52853
52854
52855
52856
52857
52858
52859
52860
52861
52862
52863
52864
52865
52866
52867
52868
52869
52870
52871
52872
52873
52874
52875
52876
52877
52878
52879
52880
52881
52882
52883
52884
52885
52886
52887
52888
52889
52890
52891
52892
52893
52894
52895
52896
52897
52898
52899
52900
52901
52902
52903
52904
52905
52906
52907
52908
52909
52910
52911
52912
52913
52914
52915
52916
52917
52918
52919
52920
52921
52922
52923
52924
52925
52926
52927
52928
52929
52930
52931
52932
52933
52934
52935
52936
52937
52938
52939
52940
52941
52942
52943
52944
52945
52946
52947
52948
52949
52950
52951
52952
52953
52954
52955
52956
52957
52958
52959
52960
52961
52962
52963
52964
52965
52966
52967
52968
52969
52970
52971
52972
52973
52974
52975
52976
52977
52978
52979
52980
52981
52982
52983
52984
52985
52986
52987
52988
52989
52990
52991
52992
52993
52994
52995
52996
52997
52998
52999
53000
53001
53002
53003
53004
53005
53006
53007
53008
53009
53010
53011
53012
53013
53014
53015
53016
53017
53018
53019
53020
53021
53022
53023
53024
53025
53026
53027
53028
53029
53030
53031
53032
53033
53034
53035
53036
53037
53038
53039
53040
53041
53042
53043
53044
53045
53046
53047
53048
53049
53050
53051
53052
53053
53054
53055
53056
53057
53058
53059
53060
53061
53062
53063
53064
53065
53066
53067
53068
53069
53070
53071
53072
53073
53074
53075
53076
53077
53078
53079
53080
53081
53082
53083
53084
53085
53086
53087
53088
53089
53090
53091
53092
53093
53094
53095
53096
53097
53098
53099
53100
53101
53102
53103
53104
53105
53106
53107
53108
53109
53110
53111
53112
53113
53114
53115
53116
53117
53118
53119
53120
53121
53122
53123
53124
53125
53126
53127
53128
53129
53130
53131
53132
53133
53134
53135
53136
53137
53138
53139
53140
53141
53142
53143
53144
53145
53146
53147
53148
53149
53150
53151
53152
53153
53154
53155
53156
53157
53158
53159
53160
53161
53162
53163
53164
53165
53166
53167
53168
53169
53170
53171
53172
53173
53174
53175
53176
53177
53178
53179
53180
53181
53182
53183
53184
53185
53186
53187
53188
53189
53190
53191
53192
53193
53194
53195
53196
53197
53198
53199
53200
53201
53202
53203
53204
53205
53206
53207
53208
53209
53210
53211
53212
53213
53214
53215
53216
53217
53218
53219
53220
53221
53222
53223
53224
53225
53226
53227
53228
53229
53230
53231
53232
53233
53234
53235
53236
53237
53238
53239
53240
53241
53242
53243
53244
53245
53246
53247
53248
53249
53250
53251
53252
53253
53254
53255
53256
53257
53258
53259
53260
53261
53262
53263
53264
53265
53266
53267
53268
53269
53270
53271
53272
53273
53274
53275
53276
53277
53278
53279
53280
53281
53282
53283
53284
53285
53286
53287
53288
53289
53290
53291
53292
53293
53294
53295
53296
53297
53298
53299
53300
53301
53302
53303
53304
53305
53306
53307
53308
53309
53310
53311
53312
53313
53314
53315
53316
53317
53318
53319
53320
53321
53322
53323
53324
53325
53326
53327
53328
53329
53330
53331
53332
53333
53334
53335
53336
53337
53338
53339
53340
53341
53342
53343
53344
53345
53346
53347
53348
53349
53350
53351
53352
53353
53354
53355
53356
53357
53358
53359
53360
53361
53362
53363
53364
53365
53366
53367
53368
53369
53370
53371
53372
53373
53374
53375
53376
53377
53378
53379
53380
53381
53382
53383
53384
53385
53386
53387
53388
53389
53390
53391
53392
53393
53394
53395
53396
53397
53398
53399
53400
53401
53402
53403
53404
53405
53406
53407
53408
53409
53410
53411
53412
53413
53414
53415
53416
53417
53418
53419
53420
53421
53422
53423
53424
53425
53426
53427
53428
53429
53430
53431
53432
53433
53434
53435
53436
53437
53438
53439
53440
53441
53442
53443
53444
53445
53446
53447
53448
53449
53450
53451
53452
53453
53454
53455
53456
53457
53458
53459
53460
53461
53462
53463
53464
53465
53466
53467
53468
53469
53470
53471
53472
53473
53474
53475
53476
53477
53478
53479
53480
53481
53482
53483
53484
53485
53486
53487
53488
53489
53490
53491
53492
53493
53494
53495
53496
53497
53498
53499
53500
53501
53502
53503
53504
53505
53506
53507
53508
53509
53510
53511
53512
53513
53514
53515
53516
53517
53518
53519
53520
53521
53522
53523
53524
53525
53526
53527
53528
53529
53530
53531
53532
53533
53534
53535
53536
53537
53538
53539
53540
53541
53542
53543
53544
53545
53546
53547
53548
53549
53550
53551
53552
53553
53554
53555
53556
53557
53558
53559
53560
53561
53562
53563
53564
53565
53566
53567
53568
53569
53570
53571
53572
53573
53574
53575
53576
53577
53578
53579
53580
53581
53582
53583
53584
53585
53586
53587
53588
53589
53590
53591
53592
53593
53594
53595
53596
53597
53598
53599
53600
53601
53602
53603
53604
53605
53606
53607
53608
53609
53610
53611
53612
53613
53614
53615
53616
53617
53618
53619
53620
53621
53622
53623
53624
53625
53626
53627
53628
53629
53630
53631
53632
53633
53634
53635
53636
53637
53638
53639
53640
53641
53642
53643
53644
53645
53646
53647
53648
53649
53650
53651
53652
53653
53654
53655
53656
53657
53658
53659
53660
53661
53662
53663
53664
53665
53666
53667
53668
53669
53670
53671
53672
53673
53674
53675
53676
53677
53678
53679
53680
53681
53682
53683
53684
53685
53686
53687
53688
53689
53690
53691
53692
53693
53694
53695
53696
53697
53698
53699
53700
53701
53702
53703
53704
53705
53706
53707
53708
53709
53710
53711
53712
53713
53714
53715
53716
53717
53718
53719
53720
53721
53722
53723
53724
53725
53726
53727
53728
53729
53730
53731
53732
53733
53734
53735
53736
53737
53738
53739
53740
53741
53742
53743
53744
53745
53746
53747
53748
53749
53750
53751
53752
53753
53754
53755
53756
53757
53758
53759
53760
53761
53762
53763
53764
53765
53766
53767
53768
53769
53770
53771
53772
53773
53774
53775
53776
53777
53778
53779
53780
53781
53782
53783
53784
53785
53786
53787
53788
53789
53790
53791
53792
53793
53794
53795
53796
53797
53798
53799
53800
53801
53802
53803
53804
53805
53806
53807
53808
53809
53810
53811
53812
53813
53814
53815
53816
53817
53818
53819
53820
53821
53822
53823
53824
53825
53826
53827
53828
53829
53830
53831
53832
53833
53834
53835
53836
53837
53838
53839
53840
53841
53842
53843
53844
53845
53846
53847
53848
53849
53850
53851
53852
53853
53854
53855
53856
53857
53858
53859
53860
53861
53862
53863
53864
53865
53866
53867
53868
53869
53870
53871
53872
53873
53874
53875
53876
53877
53878
53879
53880
53881
53882
53883
53884
53885
53886
53887
53888
53889
53890
53891
53892
53893
53894
53895
53896
53897
53898
53899
53900
53901
53902
53903
53904
53905
53906
53907
53908
53909
53910
53911
53912
53913
53914
53915
53916
53917
53918
53919
53920
53921
53922
53923
53924
53925
53926
53927
53928
53929
53930
53931
53932
53933
53934
53935
53936
53937
53938
53939
53940
53941
53942
53943
53944
53945
53946
53947
53948
53949
53950
53951
53952
53953
53954
53955
53956
53957
53958
53959
53960
53961
53962
53963
53964
53965
53966
53967
53968
53969
53970
53971
53972
53973
53974
53975
53976
53977
53978
53979
53980
53981
53982
53983
53984
53985
53986
53987
53988
53989
53990
53991
53992
53993
53994
53995
53996
53997
53998
53999
54000
54001
54002
54003
54004
54005
54006
54007
54008
54009
54010
54011
54012
54013
54014
54015
54016
54017
54018
54019
54020
54021
54022
54023
54024
54025
54026
54027
54028
54029
54030
54031
54032
54033
54034
54035
54036
54037
54038
54039
54040
54041
54042
54043
54044
54045
54046
54047
54048
54049
54050
54051
54052
54053
54054
54055
54056
54057
54058
54059
54060
54061
54062
54063
54064
54065
54066
54067
54068
54069
54070
54071
54072
54073
54074
54075
54076
54077
54078
54079
54080
54081
54082
54083
54084
54085
54086
54087
54088
54089
54090
54091
54092
54093
54094
54095
54096
54097
54098
54099
54100
54101
54102
54103
54104
54105
54106
54107
54108
54109
54110
54111
54112
54113
54114
54115
54116
54117
54118
54119
54120
54121
54122
54123
54124
54125
54126
54127
54128
54129
54130
54131
54132
54133
54134
54135
54136
54137
54138
54139
54140
54141
54142
54143
54144
54145
54146
54147
54148
54149
54150
54151
54152
54153
54154
54155
54156
54157
54158
54159
54160
54161
54162
54163
54164
54165
54166
54167
54168
54169
54170
54171
54172
54173
54174
54175
54176
54177
54178
54179
54180
54181
54182
54183
54184
54185
54186
54187
54188
54189
54190
54191
54192
54193
54194
54195
54196
54197
54198
54199
54200
54201
54202
54203
54204
54205
54206
54207
54208
54209
54210
54211
54212
54213
54214
54215
54216
54217
54218
54219
54220
54221
54222
54223
54224
54225
54226
54227
54228
54229
54230
54231
54232
54233
54234
54235
54236
54237
54238
54239
54240
54241
54242
54243
54244
54245
54246
54247
54248
54249
54250
54251
54252
54253
54254
54255
54256
54257
54258
54259
54260
54261
54262
54263
54264
54265
54266
54267
54268
54269
54270
54271
54272
54273
54274
54275
54276
54277
54278
54279
54280
54281
54282
54283
54284
54285
54286
54287
54288
54289
54290
54291
54292
54293
54294
54295
54296
54297
54298
54299
54300
54301
54302
54303
54304
54305
54306
54307
54308
54309
54310
54311
54312
54313
54314
54315
54316
54317
54318
54319
54320
54321
54322
54323
54324
54325
54326
54327
54328
54329
54330
54331
54332
54333
54334
54335
54336
54337
54338
54339
54340
54341
54342
54343
54344
54345
54346
54347
54348
54349
54350
54351
54352
54353
54354
54355
54356
54357
54358
54359
54360
54361
54362
54363
54364
54365
54366
54367
54368
54369
54370
54371
54372
54373
54374
54375
54376
54377
54378
54379
54380
54381
54382
54383
54384
54385
54386
54387
54388
54389
54390
54391
54392
54393
54394
54395
54396
54397
54398
54399
54400
54401
54402
54403
54404
54405
54406
54407
54408
54409
54410
54411
54412
54413
54414
54415
54416
54417
54418
54419
54420
54421
54422
54423
54424
54425
54426
54427
54428
54429
54430
54431
54432
54433
54434
54435
54436
54437
54438
54439
54440
54441
54442
54443
54444
54445
54446
54447
54448
54449
54450
54451
54452
54453
54454
54455
54456
54457
54458
54459
54460
54461
54462
54463
54464
54465
54466
54467
54468
54469
54470
54471
54472
54473
54474
54475
54476
54477
54478
54479
54480
54481
54482
54483
54484
54485
54486
54487
54488
54489
54490
54491
54492
54493
54494
54495
54496
54497
54498
54499
54500
54501
54502
54503
54504
54505
54506
54507
54508
54509
54510
54511
54512
54513
54514
54515
54516
54517
54518
54519
54520
54521
54522
54523
54524
54525
54526
54527
54528
54529
54530
54531
54532
54533
54534
54535
54536
54537
54538
54539
54540
54541
54542
54543
54544
54545
54546
54547
54548
54549
54550
54551
54552
54553
54554
54555
54556
54557
54558
54559
54560
54561
54562
54563
54564
54565
54566
54567
54568
54569
54570
54571
54572
54573
54574
54575
54576
54577
54578
54579
54580
54581
54582
54583
54584
54585
54586
54587
54588
54589
54590
54591
54592
54593
54594
54595
54596
54597
54598
54599
54600
54601
54602
54603
54604
54605
54606
54607
54608
54609
54610
54611
54612
54613
54614
54615
54616
54617
54618
54619
54620
54621
54622
54623
54624
54625
54626
54627
54628
54629
54630
54631
54632
54633
54634
54635
54636
54637
54638
54639
54640
54641
54642
54643
54644
54645
54646
54647
54648
54649
54650
54651
54652
54653
54654
54655
54656
54657
54658
54659
54660
54661
54662
54663
54664
54665
54666
54667
54668
54669
54670
54671
54672
54673
54674
54675
54676
54677
54678
54679
54680
54681
54682
54683
54684
54685
54686
54687
54688
54689
54690
54691
54692
54693
54694
54695
54696
54697
54698
54699
54700
54701
54702
54703
54704
54705
54706
54707
54708
54709
54710
54711
54712
54713
54714
54715
54716
54717
54718
54719
54720
54721
54722
54723
54724
54725
54726
54727
54728
54729
54730
54731
54732
54733
54734
54735
54736
54737
54738
54739
54740
54741
54742
54743
54744
54745
54746
54747
54748
54749
54750
54751
54752
54753
54754
54755
54756
54757
54758
54759
54760
54761
54762
54763
54764
54765
54766
54767
54768
54769
54770
54771
54772
54773
54774
54775
54776
54777
54778
54779
54780
54781
54782
54783
54784
54785
54786
54787
54788
54789
54790
54791
54792
54793
54794
54795
54796
54797
54798
54799
54800
54801
54802
54803
54804
54805
54806
54807
54808
54809
54810
54811
54812
54813
54814
54815
54816
54817
54818
54819
54820
54821
54822
54823
54824
54825
54826
54827
54828
54829
54830
54831
54832
54833
54834
54835
54836
54837
54838
54839
54840
54841
54842
54843
54844
54845
54846
54847
54848
54849
54850
54851
54852
54853
54854
54855
54856
54857
54858
54859
54860
54861
54862
54863
54864
54865
54866
54867
54868
54869
54870
54871
54872
54873
54874
54875
54876
54877
54878
54879
54880
54881
54882
54883
54884
54885
54886
54887
54888
54889
54890
54891
54892
54893
54894
54895
54896
54897
54898
54899
54900
54901
54902
54903
54904
54905
54906
54907
54908
54909
54910
54911
54912
54913
54914
54915
54916
54917
54918
54919
54920
54921
54922
54923
54924
54925
54926
54927
54928
54929
54930
54931
54932
54933
54934
54935
54936
54937
54938
54939
54940
54941
54942
54943
54944
54945
54946
54947
54948
54949
54950
54951
54952
54953
54954
54955
54956
54957
54958
54959
54960
54961
54962
54963
54964
54965
54966
54967
54968
54969
54970
54971
54972
54973
54974
54975
54976
54977
54978
54979
54980
54981
54982
54983
54984
54985
54986
54987
54988
54989
54990
54991
54992
54993
54994
54995
54996
54997
54998
54999
55000
55001
55002
55003
55004
55005
55006
55007
55008
55009
55010
55011
55012
55013
55014
55015
55016
55017
55018
55019
55020
55021
55022
55023
55024
55025
55026
55027
55028
55029
55030
55031
55032
55033
55034
55035
55036
55037
55038
55039
55040
55041
55042
55043
55044
55045
55046
55047
55048
55049
55050
55051
55052
55053
55054
55055
55056
55057
55058
55059
55060
55061
55062
55063
55064
55065
55066
55067
55068
55069
55070
55071
55072
55073
55074
55075
55076
55077
55078
55079
55080
55081
55082
55083
55084
55085
55086
55087
55088
55089
55090
55091
55092
55093
55094
55095
55096
55097
55098
55099
55100
55101
55102
55103
55104
55105
55106
55107
55108
55109
55110
55111
55112
55113
55114
55115
55116
55117
55118
55119
55120
55121
55122
55123
55124
55125
55126
55127
55128
55129
55130
55131
55132
55133
55134
55135
55136
55137
55138
55139
55140
55141
55142
55143
55144
55145
55146
55147
55148
55149
55150
55151
55152
55153
55154
55155
55156
55157
55158
55159
55160
55161
55162
55163
55164
55165
55166
55167
55168
55169
55170
55171
55172
55173
55174
55175
55176
55177
55178
55179
55180
55181
55182
55183
55184
55185
55186
55187
55188
55189
55190
55191
55192
55193
55194
55195
55196
55197
55198
55199
55200
55201
55202
55203
55204
55205
55206
55207
55208
55209
55210
55211
55212
55213
55214
55215
55216
55217
55218
55219
55220
55221
55222
55223
55224
55225
55226
55227
55228
55229
55230
55231
55232
55233
55234
55235
55236
55237
55238
55239
55240
55241
55242
55243
55244
55245
55246
55247
55248
55249
55250
55251
55252
55253
55254
55255
55256
55257
55258
55259
55260
55261
55262
55263
55264
55265
55266
55267
55268
55269
55270
55271
55272
55273
55274
55275
55276
55277
55278
55279
55280
55281
55282
55283
55284
55285
55286
55287
55288
55289
55290
55291
55292
55293
55294
55295
55296
55297
55298
55299
55300
55301
55302
55303
55304
55305
55306
55307
55308
55309
55310
55311
55312
55313
55314
55315
55316
55317
55318
55319
55320
55321
55322
55323
55324
55325
55326
55327
55328
55329
55330
55331
55332
55333
55334
55335
55336
55337
55338
55339
55340
55341
55342
55343
55344
55345
55346
55347
55348
55349
55350
55351
55352
55353
55354
55355
55356
55357
55358
55359
55360
55361
55362
55363
55364
55365
55366
55367
55368
55369
55370
55371
55372
55373
55374
55375
55376
55377
55378
55379
55380
55381
55382
55383
55384
55385
55386
55387
55388
55389
55390
55391
55392
55393
55394
55395
55396
55397
55398
55399
55400
55401
55402
55403
55404
55405
55406
55407
55408
55409
55410
55411
55412
55413
55414
55415
55416
55417
55418
55419
55420
55421
55422
55423
55424
55425
55426
55427
55428
55429
55430
55431
55432
55433
55434
55435
55436
55437
55438
55439
55440
55441
55442
55443
55444
55445
55446
55447
55448
55449
55450
55451
55452
55453
55454
55455
55456
55457
55458
55459
55460
55461
55462
55463
55464
55465
55466
55467
55468
55469
55470
55471
55472
55473
55474
55475
55476
55477
55478
55479
55480
55481
55482
55483
55484
55485
55486
55487
55488
55489
55490
55491
55492
55493
55494
55495
55496
55497
55498
55499
55500
55501
55502
55503
55504
55505
55506
55507
55508
55509
55510
55511
55512
55513
55514
55515
55516
55517
55518
55519
55520
55521
55522
55523
55524
55525
55526
55527
55528
55529
55530
55531
55532
55533
55534
55535
55536
55537
55538
55539
55540
55541
55542
55543
55544
55545
55546
55547
55548
55549
55550
55551
55552
55553
55554
55555
55556
55557
55558
55559
55560
55561
55562
55563
55564
55565
55566
55567
55568
55569
55570
55571
55572
55573
55574
55575
55576
55577
55578
55579
55580
55581
55582
55583
55584
55585
55586
55587
55588
55589
55590
55591
55592
55593
55594
55595
55596
55597
55598
55599
55600
55601
55602
55603
55604
55605
55606
55607
55608
55609
55610
55611
55612
55613
55614
55615
55616
55617
55618
55619
55620
55621
55622
55623
55624
55625
55626
55627
55628
55629
55630
55631
55632
55633
55634
55635
55636
55637
55638
55639
55640
55641
55642
55643
55644
55645
55646
55647
55648
55649
55650
55651
55652
55653
55654
55655
55656
55657
55658
55659
55660
55661
55662
55663
55664
55665
55666
55667
55668
55669
55670
55671
55672
55673
55674
55675
55676
55677
55678
55679
55680
55681
55682
55683
55684
55685
55686
55687
55688
55689
55690
55691
55692
55693
55694
55695
55696
55697
55698
55699
55700
55701
55702
55703
55704
55705
55706
55707
55708
55709
55710
55711
55712
55713
55714
55715
55716
55717
55718
55719
55720
55721
55722
55723
55724
55725
55726
55727
55728
55729
55730
55731
55732
55733
55734
55735
55736
55737
55738
55739
55740
55741
55742
55743
55744
55745
55746
55747
55748
55749
55750
55751
55752
55753
55754
55755
55756
55757
55758
55759
55760
55761
55762
55763
55764
55765
55766
55767
55768
55769
55770
55771
55772
55773
55774
55775
55776
55777
55778
55779
55780
55781
55782
55783
55784
55785
55786
55787
55788
55789
55790
55791
55792
55793
55794
55795
55796
55797
55798
55799
55800
55801
55802
55803
55804
55805
55806
55807
55808
55809
55810
55811
55812
55813
55814
55815
55816
55817
55818
55819
55820
55821
55822
55823
55824
55825
55826
55827
55828
55829
55830
55831
55832
55833
55834
55835
55836
55837
55838
55839
55840
55841
55842
55843
55844
55845
55846
55847
55848
55849
55850
55851
55852
55853
55854
55855
55856
55857
55858
55859
55860
55861
55862
55863
55864
55865
55866
55867
55868
55869
55870
55871
55872
55873
55874
55875
55876
55877
55878
55879
55880
55881
55882
55883
55884
55885
55886
55887
55888
55889
55890
55891
55892
55893
55894
55895
55896
55897
55898
55899
55900
55901
55902
55903
55904
55905
55906
55907
55908
55909
55910
55911
55912
55913
55914
55915
55916
55917
55918
55919
55920
55921
55922
55923
55924
55925
55926
55927
55928
55929
55930
55931
55932
55933
55934
55935
55936
55937
55938
55939
55940
55941
55942
55943
55944
55945
55946
55947
55948
55949
55950
55951
55952
55953
55954
55955
55956
55957
55958
55959
55960
55961
55962
55963
55964
55965
55966
55967
55968
55969
55970
55971
55972
55973
55974
55975
55976
55977
55978
55979
55980
55981
55982
55983
55984
55985
55986
55987
55988
55989
55990
55991
55992
55993
55994
55995
55996
55997
55998
55999
56000
56001
56002
56003
56004
56005
56006
56007
56008
56009
56010
56011
56012
56013
56014
56015
56016
56017
56018
56019
56020
56021
56022
56023
56024
56025
56026
56027
56028
56029
56030
56031
56032
56033
56034
56035
56036
56037
56038
56039
56040
56041
56042
56043
56044
56045
56046
56047
56048
56049
56050
56051
56052
56053
56054
56055
56056
56057
56058
56059
56060
56061
56062
56063
56064
56065
56066
56067
56068
56069
56070
56071
56072
56073
56074
56075
56076
56077
56078
56079
56080
56081
56082
56083
56084
56085
56086
56087
56088
56089
56090
56091
56092
56093
56094
56095
56096
56097
56098
56099
56100
56101
56102
56103
56104
56105
56106
56107
56108
56109
56110
56111
56112
56113
56114
56115
56116
56117
56118
56119
56120
56121
56122
56123
56124
56125
56126
56127
56128
56129
56130
56131
56132
56133
56134
56135
56136
56137
56138
56139
56140
56141
56142
56143
56144
56145
56146
56147
56148
56149
56150
56151
56152
56153
56154
56155
56156
56157
56158
56159
56160
56161
56162
56163
56164
56165
56166
56167
56168
56169
56170
56171
56172
56173
56174
56175
56176
56177
56178
56179
56180
56181
56182
56183
56184
56185
56186
56187
56188
56189
56190
56191
56192
56193
56194
56195
56196
56197
56198
56199
56200
56201
56202
56203
56204
56205
56206
56207
56208
56209
56210
56211
56212
56213
56214
56215
56216
56217
56218
56219
56220
56221
56222
56223
56224
56225
56226
56227
56228
56229
56230
56231
56232
56233
56234
56235
56236
56237
56238
56239
56240
56241
56242
56243
56244
56245
56246
56247
56248
56249
56250
56251
56252
56253
56254
56255
56256
56257
56258
56259
56260
56261
56262
56263
56264
56265
56266
56267
56268
56269
56270
56271
56272
56273
56274
56275
56276
56277
56278
56279
56280
56281
56282
56283
56284
56285
56286
56287
56288
56289
56290
56291
56292
56293
56294
56295
56296
56297
56298
56299
56300
56301
56302
56303
56304
56305
56306
56307
56308
56309
56310
56311
56312
56313
56314
56315
56316
56317
56318
56319
56320
56321
56322
56323
56324
56325
56326
56327
56328
56329
56330
56331
56332
56333
56334
56335
56336
56337
56338
56339
56340
56341
56342
56343
56344
56345
56346
56347
56348
56349
56350
56351
56352
56353
56354
56355
56356
56357
56358
56359
56360
56361
56362
56363
56364
56365
56366
56367
56368
56369
56370
56371
56372
56373
56374
56375
56376
56377
56378
56379
56380
56381
56382
56383
56384
56385
56386
56387
56388
56389
56390
56391
56392
56393
56394
56395
56396
56397
56398
56399
56400
56401
56402
56403
56404
56405
56406
56407
56408
56409
56410
56411
56412
56413
56414
56415
56416
56417
56418
56419
56420
56421
56422
56423
56424
56425
56426
56427
56428
56429
56430
56431
56432
56433
56434
56435
56436
56437
56438
56439
56440
56441
56442
56443
56444
56445
56446
56447
56448
56449
56450
56451
56452
56453
56454
56455
56456
56457
56458
56459
56460
56461
56462
56463
56464
56465
56466
56467
56468
56469
56470
56471
56472
56473
56474
56475
56476
56477
56478
56479
56480
56481
56482
56483
56484
56485
56486
56487
56488
56489
56490
56491
56492
56493
56494
56495
56496
56497
56498
56499
56500
56501
56502
56503
56504
56505
56506
56507
56508
56509
56510
56511
56512
56513
56514
56515
56516
56517
56518
56519
56520
56521
56522
56523
56524
56525
56526
56527
56528
56529
56530
56531
56532
56533
56534
56535
56536
56537
56538
56539
56540
56541
56542
56543
56544
56545
56546
56547
56548
56549
56550
56551
56552
56553
56554
56555
56556
56557
56558
56559
56560
56561
56562
56563
56564
56565
56566
56567
56568
56569
56570
56571
56572
56573
56574
56575
56576
56577
56578
56579
56580
56581
56582
56583
56584
56585
56586
56587
56588
56589
56590
56591
56592
56593
56594
56595
56596
56597
56598
56599
56600
56601
56602
56603
56604
56605
56606
56607
56608
56609
56610
56611
56612
56613
56614
56615
56616
56617
56618
56619
56620
56621
56622
56623
56624
56625
56626
56627
56628
56629
56630
56631
56632
56633
56634
56635
56636
56637
56638
56639
56640
56641
56642
56643
56644
56645
56646
56647
56648
56649
56650
56651
56652
56653
56654
56655
56656
56657
56658
56659
56660
56661
56662
56663
56664
56665
56666
56667
56668
56669
56670
56671
56672
56673
56674
56675
56676
56677
56678
56679
56680
56681
56682
56683
56684
56685
56686
56687
56688
56689
56690
56691
56692
56693
56694
56695
56696
56697
56698
56699
56700
56701
56702
56703
56704
56705
56706
56707
56708
56709
56710
56711
56712
56713
56714
56715
56716
56717
56718
56719
56720
56721
56722
56723
56724
56725
56726
56727
56728
56729
56730
56731
56732
56733
56734
56735
56736
56737
56738
56739
56740
56741
56742
56743
56744
56745
56746
56747
56748
56749
56750
56751
56752
56753
56754
56755
56756
56757
56758
56759
56760
56761
56762
56763
56764
56765
56766
56767
56768
56769
56770
56771
56772
56773
56774
56775
56776
56777
56778
56779
56780
56781
56782
56783
56784
56785
56786
56787
56788
56789
56790
56791
56792
56793
56794
56795
56796
56797
56798
56799
56800
56801
56802
56803
56804
56805
56806
56807
56808
56809
56810
56811
56812
56813
56814
56815
56816
56817
56818
56819
56820
56821
56822
56823
56824
56825
56826
56827
56828
56829
56830
56831
56832
56833
56834
56835
56836
56837
56838
56839
56840
56841
56842
56843
56844
56845
56846
56847
56848
56849
56850
56851
56852
56853
56854
56855
56856
56857
56858
56859
56860
56861
56862
56863
56864
56865
56866
56867
56868
56869
56870
56871
56872
56873
56874
56875
56876
56877
56878
56879
56880
56881
56882
56883
56884
56885
56886
56887
56888
56889
56890
56891
56892
56893
56894
56895
56896
56897
56898
56899
56900
56901
56902
56903
56904
56905
56906
56907
56908
56909
56910
56911
56912
56913
56914
56915
56916
56917
56918
56919
56920
56921
56922
56923
56924
56925
56926
56927
56928
56929
56930
56931
56932
56933
56934
56935
56936
56937
56938
56939
56940
56941
56942
56943
56944
56945
56946
56947
56948
56949
56950
56951
56952
56953
56954
56955
56956
56957
56958
56959
56960
56961
56962
56963
56964
56965
56966
56967
56968
56969
56970
56971
56972
56973
56974
56975
56976
56977
56978
56979
56980
56981
56982
56983
56984
56985
56986
56987
56988
56989
56990
56991
56992
56993
56994
56995
56996
56997
56998
56999
57000
57001
57002
57003
57004
57005
57006
57007
57008
57009
57010
57011
57012
57013
57014
57015
57016
57017
57018
57019
57020
57021
57022
57023
57024
57025
57026
57027
57028
57029
57030
57031
57032
57033
57034
57035
57036
57037
57038
57039
57040
57041
57042
57043
57044
57045
57046
57047
57048
57049
57050
57051
57052
57053
57054
57055
57056
57057
57058
57059
57060
57061
57062
57063
57064
57065
57066
57067
57068
57069
57070
57071
57072
57073
57074
57075
57076
57077
57078
57079
57080
57081
57082
57083
57084
57085
57086
57087
57088
57089
57090
57091
57092
57093
57094
57095
57096
57097
57098
57099
57100
57101
57102
57103
57104
57105
57106
57107
57108
57109
57110
57111
57112
57113
57114
57115
57116
57117
57118
57119
57120
57121
57122
57123
57124
57125
57126
57127
57128
57129
57130
57131
57132
57133
57134
57135
57136
57137
57138
57139
57140
57141
57142
57143
57144
57145
57146
57147
57148
57149
57150
57151
57152
57153
57154
57155
57156
57157
57158
57159
57160
57161
57162
57163
57164
57165
57166
57167
57168
57169
57170
57171
57172
57173
57174
57175
57176
57177
57178
57179
57180
57181
57182
57183
57184
57185
57186
57187
57188
57189
57190
57191
57192
57193
57194
57195
57196
57197
57198
57199
57200
57201
57202
57203
57204
57205
57206
57207
57208
57209
57210
57211
57212
57213
57214
57215
57216
57217
57218
57219
57220
57221
57222
57223
57224
57225
57226
57227
57228
57229
57230
57231
57232
57233
57234
57235
57236
57237
57238
57239
57240
57241
57242
57243
57244
57245
57246
57247
57248
57249
57250
57251
57252
57253
57254
57255
57256
57257
57258
57259
57260
57261
57262
57263
57264
57265
57266
57267
57268
57269
57270
57271
57272
57273
57274
57275
57276
57277
57278
57279
57280
57281
57282
57283
57284
57285
57286
57287
57288
57289
57290
57291
57292
57293
57294
57295
57296
57297
57298
57299
57300
57301
57302
57303
57304
57305
57306
57307
57308
57309
57310
57311
57312
57313
57314
57315
57316
57317
57318
57319
57320
57321
57322
57323
57324
57325
57326
57327
57328
57329
57330
57331
57332
57333
57334
57335
57336
57337
57338
57339
57340
57341
57342
57343
57344
57345
57346
57347
57348
57349
57350
57351
57352
57353
57354
57355
57356
57357
57358
57359
57360
57361
57362
57363
57364
57365
57366
57367
57368
57369
57370
57371
57372
57373
57374
57375
57376
57377
57378
57379
57380
57381
57382
57383
57384
57385
57386
57387
57388
57389
57390
57391
57392
57393
57394
57395
57396
57397
57398
57399
57400
57401
57402
57403
57404
57405
57406
57407
57408
57409
57410
57411
57412
57413
57414
57415
57416
57417
57418
57419
57420
57421
57422
57423
57424
57425
57426
57427
57428
57429
57430
57431
57432
57433
57434
57435
57436
57437
57438
57439
57440
57441
57442
57443
57444
57445
57446
57447
57448
57449
57450
57451
57452
57453
57454
57455
57456
57457
57458
57459
57460
57461
57462
57463
57464
57465
57466
57467
57468
57469
57470
57471
57472
57473
57474
57475
57476
57477
57478
57479
57480
57481
57482
57483
57484
57485
57486
57487
57488
57489
57490
57491
57492
57493
57494
57495
57496
57497
57498
57499
57500
57501
57502
57503
57504
57505
57506
57507
57508
57509
57510
57511
57512
57513
57514
57515
57516
57517
57518
57519
57520
57521
57522
57523
57524
57525
57526
57527
57528
57529
57530
57531
57532
57533
57534
57535
57536
57537
57538
57539
57540
57541
57542
57543
57544
57545
57546
57547
57548
57549
57550
57551
57552
57553
57554
57555
57556
57557
57558
57559
57560
57561
57562
57563
57564
57565
57566
57567
57568
57569
57570
57571
57572
57573
57574
57575
57576
57577
57578
57579
57580
57581
57582
57583
57584
57585
57586
57587
57588
57589
57590
57591
57592
57593
57594
57595
57596
57597
57598
57599
57600
57601
57602
57603
57604
57605
57606
57607
57608
57609
57610
57611
57612
57613
57614
57615
57616
57617
57618
57619
57620
57621
57622
57623
57624
57625
57626
57627
57628
57629
57630
57631
57632
57633
57634
57635
57636
57637
57638
57639
57640
57641
57642
57643
57644
57645
57646
57647
57648
57649
57650
57651
57652
57653
57654
57655
57656
57657
57658
57659
57660
57661
57662
57663
57664
57665
57666
57667
57668
57669
57670
57671
57672
57673
57674
57675
57676
57677
57678
57679
57680
57681
57682
57683
57684
57685
57686
57687
57688
57689
57690
57691
57692
57693
57694
57695
57696
57697
57698
57699
57700
57701
57702
57703
57704
57705
57706
57707
57708
57709
57710
57711
57712
57713
57714
57715
57716
57717
57718
57719
57720
57721
57722
57723
57724
57725
57726
57727
57728
57729
57730
57731
57732
57733
57734
57735
57736
57737
57738
57739
57740
57741
57742
57743
57744
57745
57746
57747
57748
57749
57750
57751
57752
57753
57754
57755
57756
57757
57758
57759
57760
57761
57762
57763
57764
57765
57766
57767
57768
57769
57770
57771
57772
57773
57774
57775
57776
57777
57778
57779
57780
57781
57782
57783
57784
57785
57786
57787
57788
57789
57790
57791
57792
57793
57794
57795
57796
57797
57798
57799
57800
57801
57802
57803
57804
57805
57806
57807
57808
57809
57810
57811
57812
57813
57814
57815
57816
57817
57818
57819
57820
57821
57822
57823
57824
57825
57826
57827
57828
57829
57830
57831
57832
57833
57834
57835
57836
57837
57838
57839
57840
57841
57842
57843
57844
57845
57846
57847
57848
57849
57850
57851
57852
57853
57854
57855
57856
57857
57858
57859
57860
57861
57862
57863
57864
57865
57866
57867
57868
57869
57870
57871
57872
57873
57874
57875
57876
57877
57878
57879
57880
57881
57882
57883
57884
57885
57886
57887
57888
57889
57890
57891
57892
57893
57894
57895
57896
57897
57898
57899
57900
57901
57902
57903
57904
57905
57906
57907
57908
57909
57910
57911
57912
57913
57914
57915
57916
57917
57918
57919
57920
57921
57922
57923
57924
57925
57926
57927
57928
57929
57930
57931
57932
57933
57934
57935
57936
57937
57938
57939
57940
57941
57942
57943
57944
57945
57946
57947
57948
57949
57950
57951
57952
57953
57954
57955
57956
57957
57958
57959
57960
57961
57962
57963
57964
57965
57966
57967
57968
57969
57970
57971
57972
57973
57974
57975
57976
57977
57978
57979
57980
57981
57982
57983
57984
57985
57986
57987
57988
57989
57990
57991
57992
57993
57994
57995
57996
57997
57998
57999
58000
58001
58002
58003
58004
58005
58006
58007
58008
58009
58010
58011
58012
58013
58014
58015
58016
58017
58018
58019
58020
58021
58022
58023
58024
58025
58026
58027
58028
58029
58030
58031
58032
58033
58034
58035
58036
58037
58038
58039
58040
58041
58042
58043
58044
58045
58046
58047
58048
58049
58050
58051
58052
58053
58054
58055
58056
58057
58058
58059
58060
58061
58062
58063
58064
58065
58066
58067
58068
58069
58070
58071
58072
58073
58074
58075
58076
58077
58078
58079
58080
58081
58082
58083
58084
58085
58086
58087
58088
58089
58090
58091
58092
58093
58094
58095
58096
58097
58098
58099
58100
58101
58102
58103
58104
58105
58106
58107
58108
58109
58110
58111
58112
58113
58114
58115
58116
58117
58118
58119
58120
58121
58122
58123
58124
58125
58126
58127
58128
58129
58130
58131
58132
58133
58134
58135
58136
58137
58138
58139
58140
58141
58142
58143
58144
58145
58146
58147
58148
58149
58150
58151
58152
58153
58154
58155
58156
58157
58158
58159
58160
58161
58162
58163
58164
58165
58166
58167
58168
58169
58170
58171
58172
58173
58174
58175
58176
58177
58178
58179
58180
58181
58182
58183
58184
58185
58186
58187
58188
58189
58190
58191
58192
58193
58194
58195
58196
58197
58198
58199
58200
58201
58202
58203
58204
58205
58206
58207
58208
58209
58210
58211
58212
58213
58214
58215
58216
58217
58218
58219
58220
58221
58222
58223
58224
58225
58226
58227
58228
58229
58230
58231
58232
58233
58234
58235
58236
58237
58238
58239
58240
58241
58242
58243
58244
58245
58246
58247
58248
58249
58250
58251
58252
58253
58254
58255
58256
58257
58258
58259
58260
58261
58262
58263
58264
58265
58266
58267
58268
58269
58270
58271
58272
58273
58274
58275
58276
58277
58278
58279
58280
58281
58282
58283
58284
58285
58286
58287
58288
58289
58290
58291
58292
58293
58294
58295
58296
58297
58298
58299
58300
58301
58302
58303
58304
58305
58306
58307
58308
58309
58310
58311
58312
58313
58314
58315
58316
58317
58318
58319
58320
58321
58322
58323
58324
58325
58326
58327
58328
58329
58330
58331
58332
58333
58334
58335
58336
58337
58338
58339
58340
58341
58342
58343
58344
58345
58346
58347
58348
58349
58350
58351
58352
58353
58354
58355
58356
58357
58358
58359
58360
58361
58362
58363
58364
58365
58366
58367
58368
58369
58370
58371
58372
58373
58374
58375
58376
58377
58378
58379
58380
58381
58382
58383
58384
58385
58386
58387
58388
58389
58390
58391
58392
58393
58394
58395
58396
58397
58398
58399
58400
58401
58402
58403
58404
58405
58406
58407
58408
58409
58410
58411
58412
58413
58414
58415
58416
58417
58418
58419
58420
58421
58422
58423
58424
58425
58426
58427
58428
58429
58430
58431
58432
58433
58434
58435
58436
58437
58438
58439
58440
58441
58442
58443
58444
58445
58446
58447
58448
58449
58450
58451
58452
58453
58454
58455
58456
58457
58458
58459
58460
58461
58462
58463
58464
58465
58466
58467
58468
58469
58470
58471
58472
58473
58474
58475
58476
58477
58478
58479
58480
58481
58482
58483
58484
58485
58486
58487
58488
58489
58490
58491
58492
58493
58494
58495
58496
58497
58498
58499
58500
58501
58502
58503
58504
58505
58506
58507
58508
58509
58510
58511
58512
58513
58514
58515
58516
58517
58518
58519
58520
58521
58522
58523
58524
58525
58526
58527
58528
58529
58530
58531
58532
58533
58534
58535
58536
58537
58538
58539
58540
58541
58542
58543
58544
58545
58546
58547
58548
58549
58550
58551
58552
58553
58554
58555
58556
58557
58558
58559
58560
58561
58562
58563
58564
58565
58566
58567
58568
58569
58570
58571
58572
58573
58574
58575
58576
58577
58578
58579
58580
58581
58582
58583
58584
58585
58586
58587
58588
58589
58590
58591
58592
58593
58594
58595
58596
58597
58598
58599
58600
58601
58602
58603
58604
58605
58606
58607
58608
58609
58610
58611
58612
58613
58614
58615
58616
58617
58618
58619
58620
58621
58622
58623
58624
58625
58626
58627
58628
58629
58630
58631
58632
58633
58634
58635
58636
58637
58638
58639
58640
58641
58642
58643
58644
58645
58646
58647
58648
58649
58650
58651
58652
58653
58654
58655
58656
58657
58658
58659
58660
58661
58662
58663
58664
58665
58666
58667
58668
58669
58670
58671
58672
58673
58674
58675
58676
58677
58678
58679
58680
58681
58682
58683
58684
58685
58686
58687
58688
58689
58690
58691
58692
58693
58694
58695
58696
58697
58698
58699
58700
58701
58702
58703
58704
58705
58706
58707
58708
58709
58710
58711
58712
58713
58714
58715
58716
58717
58718
58719
58720
58721
58722
58723
58724
58725
58726
58727
58728
58729
58730
58731
58732
58733
58734
58735
58736
58737
58738
58739
58740
58741
58742
58743
58744
58745
58746
58747
58748
58749
58750
58751
58752
58753
58754
58755
58756
58757
58758
58759
58760
58761
58762
58763
58764
58765
58766
58767
58768
58769
58770
58771
58772
58773
58774
58775
58776
58777
58778
58779
58780
58781
58782
58783
58784
58785
58786
58787
58788
58789
58790
58791
58792
58793
58794
58795
58796
58797
58798
58799
58800
58801
58802
58803
58804
58805
58806
58807
58808
58809
58810
58811
58812
58813
58814
58815
58816
58817
58818
58819
58820
58821
58822
58823
58824
58825
58826
58827
58828
58829
58830
58831
58832
58833
58834
58835
58836
58837
58838
58839
58840
58841
58842
58843
58844
58845
58846
58847
58848
58849
58850
58851
58852
58853
58854
58855
58856
58857
58858
58859
58860
58861
58862
58863
58864
58865
58866
58867
58868
58869
58870
58871
58872
58873
58874
58875
58876
58877
58878
58879
58880
58881
58882
58883
58884
58885
58886
58887
58888
58889
58890
58891
58892
58893
58894
58895
58896
58897
58898
58899
58900
58901
58902
58903
58904
58905
58906
58907
58908
58909
58910
58911
58912
58913
58914
58915
58916
58917
58918
58919
58920
58921
58922
58923
58924
58925
58926
58927
58928
58929
58930
58931
58932
58933
58934
58935
58936
58937
58938
58939
58940
58941
58942
58943
58944
58945
58946
58947
58948
58949
58950
58951
58952
58953
58954
58955
58956
58957
58958
58959
58960
58961
58962
58963
58964
58965
58966
58967
58968
58969
58970
58971
58972
58973
58974
58975
58976
58977
58978
58979
58980
58981
58982
58983
58984
58985
58986
58987
58988
58989
58990
58991
58992
58993
58994
58995
58996
58997
58998
58999
59000
59001
59002
59003
59004
59005
59006
59007
59008
59009
59010
59011
59012
59013
59014
59015
59016
59017
59018
59019
59020
59021
59022
59023
59024
59025
59026
59027
59028
59029
59030
59031
59032
59033
59034
59035
59036
59037
59038
59039
59040
59041
59042
59043
59044
59045
59046
59047
59048
59049
59050
59051
59052
59053
59054
59055
59056
59057
59058
59059
59060
59061
59062
59063
59064
59065
59066
59067
59068
59069
59070
59071
59072
59073
59074
59075
59076
59077
59078
59079
59080
59081
59082
59083
59084
59085
59086
59087
59088
59089
59090
59091
59092
59093
59094
59095
59096
59097
59098
59099
59100
59101
59102
59103
59104
59105
59106
59107
59108
59109
59110
59111
59112
59113
59114
59115
59116
59117
59118
59119
59120
59121
59122
59123
59124
59125
59126
59127
59128
59129
59130
59131
59132
59133
59134
59135
59136
59137
59138
59139
59140
59141
59142
59143
59144
59145
59146
59147
59148
59149
59150
59151
59152
59153
59154
59155
59156
59157
59158
59159
59160
59161
59162
59163
59164
59165
59166
59167
59168
59169
59170
59171
59172
59173
59174
59175
59176
59177
59178
59179
59180
59181
59182
59183
59184
59185
59186
59187
59188
59189
59190
59191
59192
59193
59194
59195
59196
59197
59198
59199
59200
59201
59202
59203
59204
59205
59206
59207
59208
59209
59210
59211
59212
59213
59214
59215
59216
59217
59218
59219
59220
59221
59222
59223
59224
59225
59226
59227
59228
59229
59230
59231
59232
59233
59234
59235
59236
59237
59238
59239
59240
59241
59242
59243
59244
59245
59246
59247
59248
59249
59250
59251
59252
59253
59254
59255
59256
59257
59258
59259
59260
59261
59262
59263
59264
59265
59266
59267
59268
59269
59270
59271
59272
59273
59274
59275
59276
59277
59278
59279
59280
59281
59282
59283
59284
59285
59286
59287
59288
59289
59290
59291
59292
59293
59294
59295
59296
59297
59298
59299
59300
59301
59302
59303
59304
59305
59306
59307
59308
59309
59310
59311
59312
59313
59314
59315
59316
59317
59318
59319
59320
59321
59322
59323
59324
59325
59326
59327
59328
59329
59330
59331
59332
59333
59334
59335
59336
59337
59338
59339
59340
59341
59342
59343
59344
59345
59346
59347
59348
59349
59350
59351
59352
59353
59354
59355
59356
59357
59358
59359
59360
59361
59362
59363
59364
59365
59366
59367
59368
59369
59370
59371
59372
59373
59374
59375
59376
59377
59378
59379
59380
59381
59382
59383
59384
59385
59386
59387
59388
59389
59390
59391
59392
59393
59394
59395
59396
59397
59398
59399
59400
59401
59402
59403
59404
59405
59406
59407
59408
59409
59410
59411
59412
59413
59414
59415
59416
59417
59418
59419
59420
59421
59422
59423
59424
59425
59426
59427
59428
59429
59430
59431
59432
59433
59434
59435
59436
59437
59438
59439
59440
59441
59442
59443
59444
59445
59446
59447
59448
59449
59450
59451
59452
59453
59454
59455
59456
59457
59458
59459
59460
59461
59462
59463
59464
59465
59466
59467
59468
59469
59470
59471
59472
59473
59474
59475
59476
59477
59478
59479
59480
59481
59482
59483
59484
59485
59486
59487
59488
59489
59490
59491
59492
59493
59494
59495
59496
59497
59498
59499
59500
59501
59502
59503
59504
59505
59506
59507
59508
59509
59510
59511
59512
59513
59514
59515
59516
59517
59518
59519
59520
59521
59522
59523
59524
59525
59526
59527
59528
59529
59530
59531
59532
59533
59534
59535
59536
59537
59538
59539
59540
59541
59542
59543
59544
59545
59546
59547
59548
59549
59550
59551
59552
59553
59554
59555
59556
59557
59558
59559
59560
59561
59562
59563
59564
59565
59566
59567
59568
59569
59570
59571
59572
59573
59574
59575
59576
59577
59578
59579
59580
59581
59582
59583
59584
59585
59586
59587
59588
59589
59590
59591
59592
59593
59594
59595
59596
59597
59598
59599
59600
59601
59602
59603
59604
59605
59606
59607
59608
59609
59610
59611
59612
59613
59614
59615
59616
59617
59618
59619
59620
59621
59622
59623
59624
59625
59626
59627
59628
59629
59630
59631
59632
59633
59634
59635
59636
59637
59638
59639
59640
59641
59642
59643
59644
59645
59646
59647
59648
59649
59650
59651
59652
59653
59654
59655
59656
59657
59658
59659
59660
59661
59662
59663
59664
59665
59666
59667
59668
59669
59670
59671
59672
59673
59674
59675
59676
59677
59678
59679
59680
59681
59682
59683
59684
59685
59686
59687
59688
59689
59690
59691
59692
59693
59694
59695
59696
59697
59698
59699
59700
59701
59702
59703
59704
59705
59706
59707
59708
59709
59710
59711
59712
59713
59714
59715
59716
59717
59718
59719
59720
59721
59722
59723
59724
59725
59726
59727
59728
59729
59730
59731
59732
59733
59734
59735
59736
59737
59738
59739
59740
59741
59742
59743
59744
59745
59746
59747
59748
59749
59750
59751
59752
59753
59754
59755
59756
59757
59758
59759
59760
59761
59762
59763
59764
59765
59766
59767
59768
59769
59770
59771
59772
59773
59774
59775
59776
59777
59778
59779
59780
59781
59782
59783
59784
59785
59786
59787
59788
59789
59790
59791
59792
59793
59794
59795
59796
59797
59798
59799
59800
59801
59802
59803
59804
59805
59806
59807
59808
59809
59810
59811
59812
59813
59814
59815
59816
59817
59818
59819
59820
59821
59822
59823
59824
59825
59826
59827
59828
59829
59830
59831
59832
59833
59834
59835
59836
59837
59838
59839
59840
59841
59842
59843
59844
59845
59846
59847
59848
59849
59850
59851
59852
59853
59854
59855
59856
59857
59858
59859
59860
59861
59862
59863
59864
59865
59866
59867
59868
59869
59870
59871
59872
59873
59874
59875
59876
59877
59878
59879
59880
59881
59882
59883
59884
59885
59886
59887
59888
59889
59890
59891
59892
59893
59894
59895
59896
59897
59898
59899
59900
59901
59902
59903
59904
59905
59906
59907
59908
59909
59910
59911
59912
59913
59914
59915
59916
59917
59918
59919
59920
59921
59922
59923
59924
59925
59926
59927
59928
59929
59930
59931
59932
59933
59934
59935
59936
59937
59938
59939
59940
59941
59942
59943
59944
59945
59946
59947
59948
59949
59950
59951
59952
59953
59954
59955
59956
59957
59958
59959
59960
59961
59962
59963
59964
59965
59966
59967
59968
59969
59970
59971
59972
59973
59974
59975
59976
59977
59978
59979
59980
59981
59982
59983
59984
59985
59986
59987
59988
59989
59990
59991
59992
59993
59994
59995
59996
59997
59998
59999
60000
60001
60002
60003
60004
60005
60006
60007
60008
60009
60010
60011
60012
60013
60014
60015
60016
60017
60018
60019
60020
60021
60022
60023
60024
60025
60026
60027
60028
60029
60030
60031
60032
60033
60034
60035
60036
60037
60038
60039
60040
60041
60042
60043
60044
60045
60046
60047
60048
60049
60050
60051
60052
60053
60054
60055
60056
60057
60058
60059
60060
60061
60062
60063
60064
60065
60066
60067
60068
60069
60070
60071
60072
60073
60074
60075
60076
60077
60078
60079
60080
60081
60082
60083
60084
60085
60086
60087
60088
60089
60090
60091
60092
60093
60094
60095
60096
60097
60098
60099
60100
60101
60102
60103
60104
60105
60106
60107
60108
60109
60110
60111
60112
60113
60114
60115
60116
60117
60118
60119
60120
60121
60122
60123
60124
60125
60126
60127
60128
60129
60130
60131
60132
60133
60134
60135
60136
60137
60138
60139
60140
60141
60142
60143
60144
60145
60146
60147
60148
60149
60150
60151
60152
60153
60154
60155
60156
60157
60158
60159
60160
60161
60162
60163
60164
60165
60166
60167
60168
60169
60170
60171
60172
60173
60174
60175
60176
60177
60178
60179
60180
60181
60182
60183
60184
60185
60186
60187
60188
60189
60190
60191
60192
60193
60194
60195
60196
60197
60198
60199
60200
60201
60202
60203
60204
60205
60206
60207
60208
60209
60210
60211
60212
60213
60214
60215
60216
60217
60218
60219
60220
60221
60222
60223
60224
60225
60226
60227
60228
60229
60230
60231
60232
60233
60234
60235
60236
60237
60238
60239
60240
60241
60242
60243
60244
60245
60246
60247
60248
60249
60250
60251
60252
60253
60254
60255
60256
60257
60258
60259
60260
60261
60262
60263
60264
60265
60266
60267
60268
60269
60270
60271
60272
60273
60274
60275
60276
60277
60278
60279
60280
60281
60282
60283
60284
60285
60286
60287
60288
60289
60290
60291
60292
60293
60294
60295
60296
60297
60298
60299
60300
60301
60302
60303
60304
60305
60306
60307
60308
60309
60310
60311
60312
60313
60314
60315
60316
60317
60318
60319
60320
60321
60322
60323
60324
60325
60326
60327
60328
60329
60330
60331
60332
60333
60334
60335
60336
60337
60338
60339
60340
60341
60342
60343
60344
60345
60346
60347
60348
60349
60350
60351
60352
60353
60354
60355
60356
60357
60358
60359
60360
60361
60362
60363
60364
60365
60366
60367
60368
60369
60370
60371
60372
60373
60374
60375
60376
60377
60378
60379
60380
60381
60382
60383
60384
60385
60386
60387
60388
60389
60390
60391
60392
60393
60394
60395
60396
60397
60398
60399
60400
60401
60402
60403
60404
60405
60406
60407
60408
60409
60410
60411
60412
60413
60414
60415
60416
60417
60418
60419
60420
60421
60422
60423
60424
60425
60426
60427
60428
60429
60430
60431
60432
60433
60434
60435
60436
60437
60438
60439
60440
60441
60442
60443
60444
60445
60446
60447
60448
60449
60450
60451
60452
60453
60454
60455
60456
60457
60458
60459
60460
60461
60462
60463
60464
60465
60466
60467
60468
60469
60470
60471
60472
60473
60474
60475
60476
60477
60478
60479
60480
60481
60482
60483
60484
60485
60486
60487
60488
60489
60490
60491
60492
60493
60494
60495
60496
60497
60498
60499
60500
60501
60502
60503
60504
60505
60506
60507
60508
60509
60510
60511
60512
60513
60514
60515
60516
60517
60518
60519
60520
60521
60522
60523
60524
60525
60526
60527
60528
60529
60530
60531
60532
60533
60534
60535
60536
60537
60538
60539
60540
60541
60542
60543
60544
60545
60546
60547
60548
60549
60550
60551
60552
60553
60554
60555
60556
60557
60558
60559
60560
60561
60562
60563
60564
60565
60566
60567
60568
60569
60570
60571
60572
60573
60574
60575
60576
60577
60578
60579
60580
60581
60582
60583
60584
60585
60586
60587
60588
60589
60590
60591
60592
60593
60594
60595
60596
60597
60598
60599
60600
60601
60602
60603
60604
60605
60606
60607
60608
60609
60610
60611
60612
60613
60614
60615
60616
60617
60618
60619
60620
60621
60622
60623
60624
60625
60626
60627
60628
60629
60630
60631
60632
60633
60634
60635
60636
60637
60638
60639
60640
60641
60642
60643
60644
60645
60646
60647
60648
60649
60650
60651
60652
60653
60654
60655
60656
60657
60658
60659
60660
60661
60662
60663
60664
60665
60666
60667
60668
60669
60670
60671
60672
60673
60674
60675
60676
60677
60678
60679
60680
60681
60682
60683
60684
60685
60686
60687
60688
60689
60690
60691
60692
60693
60694
60695
60696
60697
60698
60699
60700
60701
60702
60703
60704
60705
60706
60707
60708
60709
60710
60711
60712
60713
60714
60715
60716
60717
60718
60719
60720
60721
60722
60723
60724
60725
60726
60727
60728
60729
60730
60731
60732
60733
60734
60735
60736
60737
60738
60739
60740
60741
60742
60743
60744
60745
60746
60747
60748
60749
60750
60751
60752
60753
60754
60755
60756
60757
60758
60759
60760
60761
60762
60763
60764
60765
60766
60767
60768
60769
60770
60771
60772
60773
60774
60775
60776
60777
60778
60779
60780
60781
60782
60783
60784
60785
60786
60787
60788
60789
60790
60791
60792
60793
60794
60795
60796
60797
60798
60799
60800
60801
60802
60803
60804
60805
60806
60807
60808
60809
60810
60811
60812
60813
60814
60815
60816
60817
60818
60819
60820
60821
60822
60823
60824
60825
60826
60827
60828
60829
60830
60831
60832
60833
60834
60835
60836
60837
60838
60839
60840
60841
60842
60843
60844
60845
60846
60847
60848
60849
60850
60851
60852
60853
60854
60855
60856
60857
60858
60859
60860
60861
60862
60863
60864
60865
60866
60867
60868
60869
60870
60871
60872
60873
60874
60875
60876
60877
60878
60879
60880
60881
60882
60883
60884
60885
60886
60887
60888
60889
60890
60891
60892
60893
60894
60895
60896
60897
60898
60899
60900
60901
60902
60903
60904
60905
60906
60907
60908
60909
60910
60911
60912
60913
60914
60915
60916
60917
60918
60919
60920
60921
60922
60923
60924
60925
60926
60927
60928
60929
60930
60931
60932
60933
60934
60935
60936
60937
60938
60939
60940
60941
60942
60943
60944
60945
60946
60947
60948
60949
60950
60951
60952
60953
60954
60955
60956
60957
60958
60959
60960
60961
60962
60963
60964
60965
60966
60967
60968
60969
60970
60971
60972
60973
60974
60975
60976
60977
60978
60979
60980
60981
60982
60983
60984
60985
60986
60987
60988
60989
60990
60991
60992
60993
60994
60995
60996
60997
60998
60999
61000
61001
61002
61003
61004
61005
61006
61007
61008
61009
61010
61011
61012
61013
61014
61015
61016
61017
61018
61019
61020
61021
61022
61023
61024
61025
61026
61027
61028
61029
61030
61031
61032
61033
61034
61035
61036
61037
61038
61039
61040
61041
61042
61043
61044
61045
61046
61047
61048
61049
61050
61051
61052
61053
61054
61055
61056
61057
61058
61059
61060
61061
61062
61063
61064
61065
61066
61067
61068
61069
61070
61071
61072
61073
61074
61075
61076
61077
61078
61079
61080
61081
61082
61083
61084
61085
61086
61087
61088
61089
61090
61091
61092
61093
61094
61095
61096
61097
61098
61099
61100
61101
61102
61103
61104
61105
61106
61107
61108
61109
61110
61111
61112
61113
61114
61115
61116
61117
61118
61119
61120
61121
61122
61123
61124
61125
61126
61127
61128
61129
61130
61131
61132
61133
61134
61135
61136
61137
61138
61139
61140
61141
61142
61143
61144
61145
61146
61147
61148
61149
61150
61151
61152
61153
61154
61155
61156
61157
61158
61159
61160
61161
61162
61163
61164
61165
61166
61167
61168
61169
61170
61171
61172
61173
61174
61175
61176
61177
61178
61179
61180
61181
61182
61183
61184
61185
61186
61187
61188
61189
61190
61191
61192
61193
61194
61195
61196
61197
61198
61199
61200
61201
61202
61203
61204
61205
61206
61207
61208
61209
61210
61211
61212
61213
61214
61215
61216
61217
61218
61219
61220
61221
61222
61223
61224
61225
61226
61227
61228
61229
61230
61231
61232
61233
61234
61235
61236
61237
61238
61239
61240
61241
61242
61243
61244
61245
61246
61247
61248
61249
61250
61251
61252
61253
61254
61255
61256
61257
61258
61259
61260
61261
61262
61263
61264
61265
61266
61267
61268
61269
61270
61271
61272
61273
61274
61275
61276
61277
61278
61279
61280
61281
61282
61283
61284
61285
61286
61287
61288
61289
61290
61291
61292
61293
61294
61295
61296
61297
61298
61299
61300
61301
61302
61303
61304
61305
61306
61307
61308
61309
61310
61311
61312
61313
61314
61315
61316
61317
61318
61319
61320
61321
61322
61323
61324
61325
61326
61327
61328
61329
61330
61331
61332
61333
61334
61335
61336
61337
61338
61339
61340
61341
61342
61343
61344
61345
61346
61347
61348
61349
61350
61351
61352
61353
61354
61355
61356
61357
61358
61359
61360
61361
61362
61363
61364
61365
61366
61367
61368
61369
61370
61371
61372
61373
61374
61375
61376
61377
61378
61379
61380
61381
61382
61383
61384
61385
61386
61387
61388
61389
61390
61391
61392
61393
61394
61395
61396
61397
61398
61399
61400
61401
61402
61403
61404
61405
61406
61407
61408
61409
61410
61411
61412
61413
61414
61415
61416
61417
61418
61419
61420
61421
61422
61423
61424
61425
61426
61427
61428
61429
61430
61431
61432
61433
61434
61435
61436
61437
61438
61439
61440
61441
61442
61443
61444
61445
61446
61447
61448
61449
61450
61451
61452
61453
61454
61455
61456
61457
61458
61459
61460
61461
61462
61463
61464
61465
61466
61467
61468
61469
61470
61471
61472
61473
61474
61475
61476
61477
61478
61479
61480
61481
61482
61483
61484
61485
61486
61487
61488
61489
61490
61491
61492
61493
61494
61495
61496
61497
61498
61499
61500
61501
61502
61503
61504
61505
61506
61507
61508
61509
61510
61511
61512
61513
61514
61515
61516
61517
61518
61519
61520
61521
61522
61523
61524
61525
61526
61527
61528
61529
61530
61531
61532
61533
61534
61535
61536
61537
61538
61539
61540
61541
61542
61543
61544
61545
61546
61547
61548
61549
61550
61551
61552
61553
61554
61555
61556
61557
61558
61559
61560
61561
61562
61563
61564
61565
61566
61567
61568
61569
61570
61571
61572
61573
61574
61575
61576
61577
61578
61579
61580
61581
61582
61583
61584
61585
61586
61587
61588
61589
61590
61591
61592
61593
61594
61595
61596
61597
61598
61599
61600
61601
61602
61603
61604
61605
61606
61607
61608
61609
61610
61611
61612
61613
61614
61615
61616
61617
61618
61619
61620
61621
61622
61623
61624
61625
61626
61627
61628
61629
61630
61631
61632
61633
61634
61635
61636
61637
61638
61639
61640
61641
61642
61643
61644
61645
61646
61647
61648
61649
61650
61651
61652
61653
61654
61655
61656
61657
61658
61659
61660
61661
61662
61663
61664
61665
61666
61667
61668
61669
61670
61671
61672
61673
61674
61675
61676
61677
61678
61679
61680
61681
61682
61683
61684
61685
61686
61687
61688
61689
61690
61691
61692
61693
61694
61695
61696
61697
61698
61699
61700
61701
61702
61703
61704
61705
61706
61707
61708
61709
61710
61711
61712
61713
61714
61715
61716
61717
61718
61719
61720
61721
61722
61723
61724
61725
61726
61727
61728
61729
61730
61731
61732
61733
61734
61735
61736
61737
61738
61739
61740
61741
61742
61743
61744
61745
61746
61747
61748
61749
61750
61751
61752
61753
61754
61755
61756
61757
61758
61759
61760
61761
61762
61763
61764
61765
61766
61767
61768
61769
61770
61771
61772
61773
61774
61775
61776
61777
61778
61779
61780
61781
61782
61783
61784
61785
61786
61787
61788
61789
61790
61791
61792
61793
61794
61795
61796
61797
61798
61799
61800
61801
61802
61803
61804
61805
61806
61807
61808
61809
61810
61811
61812
61813
61814
61815
61816
61817
61818
61819
61820
61821
61822
61823
61824
61825
61826
61827
61828
61829
61830
61831
61832
61833
61834
61835
61836
61837
61838
61839
61840
61841
61842
61843
61844
61845
61846
61847
61848
61849
61850
61851
61852
61853
61854
61855
61856
61857
61858
61859
61860
61861
61862
61863
61864
61865
61866
61867
61868
61869
61870
61871
61872
61873
61874
61875
61876
61877
61878
61879
61880
61881
61882
61883
61884
61885
61886
61887
61888
61889
61890
61891
61892
61893
61894
61895
61896
61897
61898
61899
61900
61901
61902
61903
61904
61905
61906
61907
61908
61909
61910
61911
61912
61913
61914
61915
61916
61917
61918
61919
61920
61921
61922
61923
61924
61925
61926
61927
61928
61929
61930
61931
61932
61933
61934
61935
61936
61937
61938
61939
61940
61941
61942
61943
61944
61945
61946
61947
61948
61949
61950
61951
61952
61953
61954
61955
61956
61957
61958
61959
61960
61961
61962
61963
61964
61965
61966
61967
61968
61969
61970
61971
61972
61973
61974
61975
61976
61977
61978
61979
61980
61981
61982
61983
61984
61985
61986
61987
61988
61989
61990
61991
61992
61993
61994
61995
61996
61997
61998
61999
62000
62001
62002
62003
62004
62005
62006
62007
62008
62009
62010
62011
62012
62013
62014
62015
62016
62017
62018
62019
62020
62021
62022
62023
62024
62025
62026
62027
62028
62029
62030
62031
62032
62033
62034
62035
62036
62037
62038
62039
62040
62041
62042
62043
62044
62045
62046
62047
62048
62049
62050
62051
62052
62053
62054
62055
62056
62057
62058
62059
62060
62061
62062
62063
62064
62065
62066
62067
62068
62069
62070
62071
62072
62073
62074
62075
62076
62077
62078
62079
62080
62081
62082
62083
62084
62085
62086
62087
62088
62089
62090
62091
62092
62093
62094
62095
62096
62097
62098
62099
62100
62101
62102
62103
62104
62105
62106
62107
62108
62109
62110
62111
62112
62113
62114
62115
62116
62117
62118
62119
62120
62121
62122
62123
62124
62125
62126
62127
62128
62129
62130
62131
62132
62133
62134
62135
62136
62137
62138
62139
62140
62141
62142
62143
62144
62145
62146
62147
62148
62149
62150
62151
62152
62153
62154
62155
62156
62157
62158
62159
62160
62161
62162
62163
62164
62165
62166
62167
62168
62169
62170
62171
62172
62173
62174
62175
62176
62177
62178
62179
62180
62181
62182
62183
62184
62185
62186
62187
62188
62189
62190
62191
62192
62193
62194
62195
62196
62197
62198
62199
62200
62201
62202
62203
62204
62205
62206
62207
62208
62209
62210
62211
62212
62213
62214
62215
62216
62217
62218
62219
62220
62221
62222
62223
62224
62225
62226
62227
62228
62229
62230
62231
62232
62233
62234
62235
62236
62237
62238
62239
62240
62241
62242
62243
62244
62245
62246
62247
62248
62249
62250
62251
62252
62253
62254
62255
62256
62257
62258
62259
62260
62261
62262
62263
62264
62265
62266
62267
62268
62269
62270
62271
62272
62273
62274
62275
62276
62277
62278
62279
62280
62281
62282
62283
62284
62285
62286
62287
62288
62289
62290
62291
62292
62293
62294
62295
62296
62297
62298
62299
62300
62301
62302
62303
62304
62305
62306
62307
62308
62309
62310
62311
62312
62313
62314
62315
62316
62317
62318
62319
62320
62321
62322
62323
62324
62325
62326
62327
62328
62329
62330
62331
62332
62333
62334
62335
62336
62337
62338
62339
62340
62341
62342
62343
62344
62345
62346
62347
62348
62349
62350
62351
62352
62353
62354
62355
62356
62357
62358
62359
62360
62361
62362
62363
62364
62365
62366
62367
62368
62369
62370
62371
62372
62373
62374
62375
62376
62377
62378
62379
62380
62381
62382
62383
62384
62385
62386
62387
62388
62389
62390
62391
62392
62393
62394
62395
62396
62397
62398
62399
62400
62401
62402
62403
62404
62405
62406
62407
62408
62409
62410
62411
62412
62413
62414
62415
62416
62417
62418
62419
62420
62421
62422
62423
62424
62425
62426
62427
62428
62429
62430
62431
62432
62433
62434
62435
62436
62437
62438
62439
62440
62441
62442
62443
62444
62445
62446
62447
62448
62449
62450
62451
62452
62453
62454
62455
62456
62457
62458
62459
62460
62461
62462
62463
62464
62465
62466
62467
62468
62469
62470
62471
62472
62473
62474
62475
62476
62477
62478
62479
62480
62481
62482
62483
62484
62485
62486
62487
62488
62489
62490
62491
62492
62493
62494
62495
62496
62497
62498
62499
62500
62501
62502
62503
62504
62505
62506
62507
62508
62509
62510
62511
62512
62513
62514
62515
62516
62517
62518
62519
62520
62521
62522
62523
62524
62525
62526
62527
62528
62529
62530
62531
62532
62533
62534
62535
62536
62537
62538
62539
62540
62541
62542
62543
62544
62545
62546
62547
62548
62549
62550
62551
62552
62553
62554
62555
62556
62557
62558
62559
62560
62561
62562
62563
62564
62565
62566
62567
62568
62569
62570
62571
62572
62573
62574
62575
62576
62577
62578
62579
62580
62581
62582
62583
62584
62585
62586
62587
62588
62589
62590
62591
62592
62593
62594
62595
62596
62597
62598
62599
62600
62601
62602
62603
62604
62605
62606
62607
62608
62609
62610
62611
62612
62613
62614
62615
62616
62617
62618
62619
62620
62621
62622
62623
62624
62625
62626
62627
62628
62629
62630
62631
62632
62633
62634
62635
62636
62637
62638
62639
62640
62641
62642
62643
62644
62645
62646
62647
62648
62649
62650
62651
62652
62653
62654
62655
62656
62657
62658
62659
62660
62661
62662
62663
62664
62665
62666
62667
62668
62669
62670
62671
62672
62673
62674
62675
62676
62677
62678
62679
62680
62681
62682
62683
62684
62685
62686
62687
62688
62689
62690
62691
62692
62693
62694
62695
62696
62697
62698
62699
62700
62701
62702
62703
62704
62705
62706
62707
62708
62709
62710
62711
62712
62713
62714
62715
62716
62717
62718
62719
62720
62721
62722
62723
62724
62725
62726
62727
62728
62729
62730
62731
62732
62733
62734
62735
62736
62737
62738
62739
62740
62741
62742
62743
62744
62745
62746
62747
62748
62749
62750
62751
62752
62753
62754
62755
62756
62757
62758
62759
62760
62761
62762
62763
62764
62765
62766
62767
62768
62769
62770
62771
62772
62773
62774
62775
62776
62777
62778
62779
62780
62781
62782
62783
62784
62785
62786
62787
62788
62789
62790
62791
62792
62793
62794
62795
62796
62797
62798
62799
62800
62801
62802
62803
62804
62805
62806
62807
62808
62809
62810
62811
62812
62813
62814
62815
62816
62817
62818
62819
62820
62821
62822
62823
62824
62825
62826
62827
62828
62829
62830
62831
62832
62833
62834
62835
62836
62837
62838
62839
62840
62841
62842
62843
62844
62845
62846
62847
62848
62849
62850
62851
62852
62853
62854
62855
62856
62857
62858
62859
62860
62861
62862
62863
62864
62865
62866
62867
62868
62869
62870
62871
62872
62873
62874
62875
62876
62877
62878
62879
62880
62881
62882
62883
62884
62885
62886
62887
62888
62889
62890
62891
62892
62893
62894
62895
62896
62897
62898
62899
62900
62901
62902
62903
62904
62905
62906
62907
62908
62909
62910
62911
62912
62913
62914
62915
62916
62917
62918
62919
62920
62921
62922
62923
62924
62925
62926
62927
62928
62929
62930
62931
62932
62933
62934
62935
62936
62937
62938
62939
62940
62941
62942
62943
62944
62945
62946
62947
62948
62949
62950
62951
62952
62953
62954
62955
62956
62957
62958
62959
62960
62961
62962
62963
62964
62965
62966
62967
62968
62969
62970
62971
62972
62973
62974
62975
62976
62977
62978
62979
62980
62981
62982
62983
62984
62985
62986
62987
62988
62989
62990
62991
62992
62993
62994
62995
62996
62997
62998
62999
63000
63001
63002
63003
63004
63005
63006
63007
63008
63009
63010
63011
63012
63013
63014
63015
63016
63017
63018
63019
63020
63021
63022
63023
63024
63025
63026
63027
63028
63029
63030
63031
63032
63033
63034
63035
63036
63037
63038
63039
63040
63041
63042
63043
63044
63045
63046
63047
63048
63049
63050
63051
63052
63053
63054
63055
63056
63057
63058
63059
63060
63061
63062
63063
63064
63065
63066
63067
63068
63069
63070
63071
63072
63073
63074
63075
63076
63077
63078
63079
63080
63081
63082
63083
63084
63085
63086
63087
63088
63089
63090
63091
63092
63093
63094
63095
63096
63097
63098
63099
63100
63101
63102
63103
63104
63105
63106
63107
63108
63109
63110
63111
63112
63113
63114
63115
63116
63117
63118
63119
63120
63121
63122
63123
63124
63125
63126
63127
63128
63129
63130
63131
63132
63133
63134
63135
63136
63137
63138
63139
63140
63141
63142
63143
63144
63145
63146
63147
63148
63149
63150
63151
63152
63153
63154
63155
63156
63157
63158
63159
63160
63161
63162
63163
63164
63165
63166
63167
63168
63169
63170
63171
63172
63173
63174
63175
63176
63177
63178
63179
63180
63181
63182
63183
63184
63185
63186
63187
63188
63189
63190
63191
63192
63193
63194
63195
63196
63197
63198
63199
63200
63201
63202
63203
63204
63205
63206
63207
63208
63209
63210
63211
63212
63213
63214
63215
63216
63217
63218
63219
63220
63221
63222
63223
63224
63225
63226
63227
63228
63229
63230
63231
63232
63233
63234
63235
63236
63237
63238
63239
63240
63241
63242
63243
63244
63245
63246
63247
63248
63249
63250
63251
63252
63253
63254
63255
63256
63257
63258
63259
63260
63261
63262
63263
63264
63265
63266
63267
63268
63269
63270
63271
63272
63273
63274
63275
63276
63277
63278
63279
63280
63281
63282
63283
63284
63285
63286
63287
63288
63289
63290
63291
63292
63293
63294
63295
63296
63297
63298
63299
63300
63301
63302
63303
63304
63305
63306
63307
63308
63309
63310
63311
63312
63313
63314
63315
63316
63317
63318
63319
63320
63321
63322
63323
63324
63325
63326
63327
63328
63329
63330
63331
63332
63333
63334
63335
63336
63337
63338
63339
63340
63341
63342
63343
63344
63345
63346
63347
63348
63349
63350
63351
63352
63353
63354
63355
63356
63357
63358
63359
63360
63361
63362
63363
63364
63365
63366
63367
63368
63369
63370
63371
63372
63373
63374
63375
63376
63377
63378
63379
63380
63381
63382
63383
63384
63385
63386
63387
63388
63389
63390
63391
63392
63393
63394
63395
63396
63397
63398
63399
63400
63401
63402
63403
63404
63405
63406
63407
63408
63409
63410
63411
63412
63413
63414
63415
63416
63417
63418
63419
63420
63421
63422
63423
63424
63425
63426
63427
63428
63429
63430
63431
63432
63433
63434
63435
63436
63437
63438
63439
63440
63441
63442
63443
63444
63445
63446
63447
63448
63449
63450
63451
63452
63453
63454
63455
63456
63457
63458
63459
63460
63461
63462
63463
63464
63465
63466
63467
63468
63469
63470
63471
63472
63473
63474
63475
63476
63477
63478
63479
63480
63481
63482
63483
63484
63485
63486
63487
63488
63489
63490
63491
63492
63493
63494
63495
63496
63497
63498
63499
63500
63501
63502
63503
63504
63505
63506
63507
63508
63509
63510
63511
63512
63513
63514
63515
63516
63517
63518
63519
63520
63521
63522
63523
63524
63525
63526
63527
63528
63529
63530
63531
63532
63533
63534
63535
63536
63537
63538
63539
63540
63541
63542
63543
63544
63545
63546
63547
63548
63549
63550
63551
63552
63553
63554
63555
63556
63557
63558
63559
63560
63561
63562
63563
63564
63565
63566
63567
63568
63569
63570
63571
63572
63573
63574
63575
63576
63577
63578
63579
63580
63581
63582
63583
63584
63585
63586
63587
63588
63589
63590
63591
63592
63593
63594
63595
63596
63597
63598
63599
63600
63601
63602
63603
63604
63605
63606
63607
63608
63609
63610
63611
63612
63613
63614
63615
63616
63617
63618
63619
63620
63621
63622
63623
63624
63625
63626
63627
63628
63629
63630
63631
63632
63633
63634
63635
63636
63637
63638
63639
63640
63641
63642
63643
63644
63645
63646
63647
63648
63649
63650
63651
63652
63653
63654
63655
63656
63657
63658
63659
63660
63661
63662
63663
63664
63665
63666
63667
63668
63669
63670
63671
63672
63673
63674
63675
63676
63677
63678
63679
63680
63681
63682
63683
63684
63685
63686
63687
63688
63689
63690
63691
63692
63693
63694
63695
63696
63697
63698
63699
63700
63701
63702
63703
63704
63705
63706
63707
63708
63709
63710
63711
63712
63713
63714
63715
63716
63717
63718
63719
63720
63721
63722
63723
63724
63725
63726
63727
63728
63729
63730
63731
63732
63733
63734
63735
63736
63737
63738
63739
63740
63741
63742
63743
63744
63745
63746
63747
63748
63749
63750
63751
63752
63753
63754
63755
63756
63757
63758
63759
63760
63761
63762
63763
63764
63765
63766
63767
63768
63769
63770
63771
63772
63773
63774
63775
63776
63777
63778
63779
63780
63781
63782
63783
63784
63785
63786
63787
63788
63789
63790
63791
63792
63793
63794
63795
63796
63797
63798
63799
63800
63801
63802
63803
63804
63805
63806
63807
63808
63809
63810
63811
63812
63813
63814
63815
63816
63817
63818
63819
63820
63821
63822
63823
63824
63825
63826
63827
63828
63829
63830
63831
63832
63833
63834
63835
63836
63837
63838
63839
63840
63841
63842
63843
63844
63845
63846
63847
63848
63849
63850
63851
63852
63853
63854
63855
63856
63857
63858
63859
63860
63861
63862
63863
63864
63865
63866
63867
63868
63869
63870
63871
63872
63873
63874
63875
63876
63877
63878
63879
63880
63881
63882
63883
63884
63885
63886
63887
63888
63889
63890
63891
63892
63893
63894
63895
63896
63897
63898
63899
63900
63901
63902
63903
63904
63905
63906
63907
63908
63909
63910
63911
63912
63913
63914
63915
63916
63917
63918
63919
63920
63921
63922
63923
63924
63925
63926
63927
63928
63929
63930
63931
63932
63933
63934
63935
63936
63937
63938
63939
63940
63941
63942
63943
63944
63945
63946
63947
63948
63949
63950
63951
63952
63953
63954
63955
63956
63957
63958
63959
63960
63961
63962
63963
63964
63965
63966
63967
63968
63969
63970
63971
63972
63973
63974
63975
63976
63977
63978
63979
63980
63981
63982
63983
63984
63985
63986
63987
63988
63989
63990
63991
63992
63993
63994
63995
63996
63997
63998
63999
64000
64001
64002
64003
64004
64005
64006
64007
64008
64009
64010
64011
64012
64013
64014
64015
64016
64017
64018
64019
64020
64021
64022
64023
64024
64025
64026
64027
64028
64029
64030
64031
64032
64033
64034
64035
64036
64037
64038
64039
64040
64041
64042
64043
64044
64045
64046
64047
64048
64049
64050
64051
64052
64053
64054
64055
64056
64057
64058
64059
64060
64061
64062
64063
64064
64065
64066
64067
64068
64069
64070
64071
64072
64073
64074
64075
64076
64077
64078
64079
64080
64081
64082
64083
64084
64085
64086
64087
64088
64089
64090
64091
64092
64093
64094
64095
64096
64097
64098
64099
64100
64101
64102
64103
64104
64105
64106
64107
64108
64109
64110
64111
64112
64113
64114
64115
64116
64117
64118
64119
64120
64121
64122
64123
64124
64125
64126
64127
64128
64129
64130
64131
64132
64133
64134
64135
64136
64137
64138
64139
64140
64141
64142
64143
64144
64145
64146
64147
64148
64149
64150
64151
64152
64153
64154
64155
64156
64157
64158
64159
64160
64161
64162
64163
64164
64165
64166
64167
64168
64169
64170
64171
64172
64173
64174
64175
64176
64177
64178
64179
64180
64181
64182
64183
64184
64185
64186
64187
64188
64189
64190
64191
64192
64193
64194
64195
64196
64197
64198
64199
64200
64201
64202
64203
64204
64205
64206
64207
64208
64209
64210
64211
64212
64213
64214
64215
64216
64217
64218
64219
64220
64221
64222
64223
64224
64225
64226
64227
64228
64229
64230
64231
64232
64233
64234
64235
64236
64237
64238
64239
64240
64241
64242
64243
64244
64245
64246
64247
64248
64249
64250
64251
64252
64253
64254
64255
64256
64257
64258
64259
64260
64261
64262
64263
64264
64265
64266
64267
64268
64269
64270
64271
64272
64273
64274
64275
64276
64277
64278
64279
64280
64281
64282
64283
64284
64285
64286
64287
64288
64289
64290
64291
64292
64293
64294
64295
64296
64297
64298
64299
64300
64301
64302
64303
64304
64305
64306
64307
64308
64309
64310
64311
64312
64313
64314
64315
64316
64317
64318
64319
64320
64321
64322
64323
64324
64325
64326
64327
64328
64329
64330
64331
64332
64333
64334
64335
64336
64337
64338
64339
64340
64341
64342
64343
64344
64345
64346
64347
64348
64349
64350
64351
64352
64353
64354
64355
64356
64357
64358
64359
64360
64361
64362
64363
64364
64365
64366
64367
64368
64369
64370
64371
64372
64373
64374
64375
64376
64377
64378
64379
64380
64381
64382
64383
64384
64385
64386
64387
64388
64389
64390
64391
64392
64393
64394
64395
64396
64397
64398
64399
64400
64401
64402
64403
64404
64405
64406
64407
64408
64409
64410
64411
64412
64413
64414
64415
64416
64417
64418
64419
64420
64421
64422
64423
64424
64425
64426
64427
64428
64429
64430
64431
64432
64433
64434
64435
64436
64437
64438
64439
64440
64441
64442
64443
64444
64445
64446
64447
64448
64449
64450
64451
64452
64453
64454
64455
64456
64457
64458
64459
64460
64461
64462
64463
64464
64465
64466
64467
64468
64469
64470
64471
64472
64473
64474
64475
64476
64477
64478
64479
64480
64481
64482
64483
64484
64485
64486
64487
64488
64489
64490
64491
64492
64493
64494
64495
64496
64497
64498
64499
64500
64501
64502
64503
64504
64505
64506
64507
64508
64509
64510
64511
64512
64513
64514
64515
64516
64517
64518
64519
64520
64521
64522
64523
64524
64525
64526
64527
64528
64529
64530
64531
64532
64533
64534
64535
64536
64537
64538
64539
64540
64541
64542
64543
64544
64545
64546
64547
64548
64549
64550
64551
64552
64553
64554
64555
64556
64557
64558
64559
64560
64561
64562
64563
64564
64565
64566
64567
64568
64569
64570
64571
64572
64573
64574
64575
64576
64577
64578
64579
64580
64581
64582
64583
64584
64585
64586
64587
64588
64589
64590
64591
64592
64593
64594
64595
64596
64597
64598
64599
64600
64601
64602
64603
64604
64605
64606
64607
64608
64609
64610
64611
64612
64613
64614
64615
64616
64617
64618
64619
64620
64621
64622
64623
64624
64625
64626
64627
64628
64629
64630
64631
64632
64633
64634
64635
64636
64637
64638
64639
64640
64641
64642
64643
64644
64645
64646
64647
64648
64649
64650
64651
64652
64653
64654
64655
64656
64657
64658
64659
64660
64661
64662
64663
64664
64665
64666
64667
64668
64669
64670
64671
64672
64673
64674
64675
64676
64677
64678
64679
64680
64681
64682
64683
64684
64685
64686
64687
64688
64689
64690
64691
64692
64693
64694
64695
64696
64697
64698
64699
64700
64701
64702
64703
64704
64705
64706
64707
64708
64709
64710
64711
64712
64713
64714
64715
64716
64717
64718
64719
64720
64721
64722
64723
64724
64725
64726
64727
64728
64729
64730
64731
64732
64733
64734
64735
64736
64737
64738
64739
64740
64741
64742
64743
64744
64745
64746
64747
64748
64749
64750
64751
64752
64753
64754
64755
64756
64757
64758
64759
64760
64761
64762
64763
64764
64765
64766
64767
64768
64769
64770
64771
64772
64773
64774
64775
64776
64777
64778
64779
64780
64781
64782
64783
64784
64785
64786
64787
64788
64789
64790
64791
64792
64793
64794
64795
64796
64797
64798
64799
64800
64801
64802
64803
64804
64805
64806
64807
64808
64809
64810
64811
64812
64813
64814
64815
64816
64817
64818
64819
64820
64821
64822
64823
64824
64825
64826
64827
64828
64829
64830
64831
64832
64833
64834
64835
64836
64837
64838
64839
64840
64841
64842
64843
64844
64845
64846
64847
64848
64849
64850
64851
64852
64853
64854
64855
64856
64857
64858
64859
64860
64861
64862
64863
64864
64865
64866
64867
64868
64869
64870
64871
64872
64873
64874
64875
64876
64877
64878
64879
64880
64881
64882
64883
64884
64885
64886
64887
64888
64889
64890
64891
64892
64893
64894
64895
64896
64897
64898
64899
64900
64901
64902
64903
64904
64905
64906
64907
64908
64909
64910
64911
64912
64913
64914
64915
64916
64917
64918
64919
64920
64921
64922
64923
64924
64925
64926
64927
64928
64929
64930
64931
64932
64933
64934
64935
64936
64937
64938
64939
64940
64941
64942
64943
64944
64945
64946
64947
64948
64949
64950
64951
64952
64953
64954
64955
64956
64957
64958
64959
64960
64961
64962
64963
64964
64965
64966
64967
64968
64969
64970
64971
64972
64973
64974
64975
64976
64977
64978
64979
64980
64981
64982
64983
64984
64985
64986
64987
64988
64989
64990
64991
64992
64993
64994
64995
64996
64997
64998
64999
65000
65001
65002
65003
65004
65005
65006
65007
65008
65009
65010
65011
65012
65013
65014
65015
65016
65017
65018
65019
65020
65021
65022
65023
65024
65025
65026
65027
65028
65029
65030
65031
65032
65033
65034
65035
65036
65037
65038
65039
65040
65041
65042
65043
65044
65045
65046
65047
65048
65049
65050
65051
65052
65053
65054
65055
65056
65057
65058
65059
65060
65061
65062
65063
65064
65065
65066
65067
65068
65069
65070
65071
65072
65073
65074
65075
65076
65077
65078
65079
65080
65081
65082
65083
65084
65085
65086
65087
65088
65089
65090
65091
65092
65093
65094
65095
65096
65097
65098
65099
65100
65101
65102
65103
65104
65105
65106
65107
65108
65109
65110
65111
65112
65113
65114
65115
65116
65117
65118
65119
65120
65121
65122
65123
65124
65125
65126
65127
65128
65129
65130
65131
65132
65133
65134
65135
65136
65137
65138
65139
65140
65141
65142
65143
65144
65145
65146
65147
65148
65149
65150
65151
65152
65153
65154
65155
65156
65157
65158
65159
65160
65161
65162
65163
65164
65165
65166
65167
65168
65169
65170
65171
65172
65173
65174
65175
65176
65177
65178
65179
65180
65181
65182
65183
65184
65185
65186
65187
65188
65189
65190
65191
65192
65193
65194
65195
65196
65197
65198
65199
65200
65201
65202
65203
65204
65205
65206
65207
65208
65209
65210
65211
65212
65213
65214
65215
65216
65217
65218
65219
65220
65221
65222
65223
65224
65225
65226
65227
65228
65229
65230
65231
65232
65233
65234
65235
65236
65237
65238
65239
65240
65241
65242
65243
65244
65245
65246
65247
65248
65249
65250
65251
65252
65253
65254
65255
65256
65257
65258
65259
65260
65261
65262
65263
65264
65265
65266
65267
65268
65269
65270
65271
65272
65273
65274
65275
65276
65277
65278
65279
65280
65281
65282
65283
65284
65285
65286
65287
65288
65289
65290
65291
65292
65293
65294
65295
65296
65297
65298
65299
65300
65301
65302
65303
65304
65305
65306
65307
65308
65309
65310
65311
65312
65313
65314
65315
65316
65317
65318
65319
65320
65321
65322
65323
65324
65325
65326
65327
65328
65329
65330
65331
65332
65333
65334
65335
65336
65337
65338
65339
65340
65341
65342
65343
65344
65345
65346
65347
65348
65349
65350
65351
65352
65353
65354
65355
65356
65357
65358
65359
65360
65361
65362
65363
65364
65365
65366
65367
65368
65369
65370
65371
65372
65373
65374
65375
65376
65377
65378
65379
65380
65381
65382
65383
65384
65385
65386
65387
65388
65389
65390
65391
65392
65393
65394
65395
65396
65397
65398
65399
65400
65401
65402
65403
65404
65405
65406
65407
65408
65409
65410
65411
65412
65413
65414
65415
65416
65417
65418
65419
65420
65421
65422
65423
65424
65425
65426
65427
65428
65429
65430
65431
65432
65433
65434
65435
65436
65437
65438
65439
65440
65441
65442
65443
65444
65445
65446
65447
65448
65449
65450
65451
65452
65453
65454
65455
65456
65457
65458
65459
65460
65461
65462
65463
65464
65465
65466
65467
65468
65469
65470
65471
65472
65473
65474
65475
65476
65477
65478
65479
65480
65481
65482
65483
65484
65485
65486
65487
65488
65489
65490
65491
65492
65493
65494
65495
65496
65497
65498
65499
65500
65501
65502
65503
65504
65505
65506
65507
65508
65509
65510
65511
65512
65513
65514
65515
65516
65517
65518
65519
65520
65521
65522
65523
65524
65525
65526
65527
65528
65529
65530
65531
65532
65533
65534
65535
65536
65537
65538
65539
65540
65541
65542
65543
65544
65545
65546
65547
65548
65549
65550
65551
65552
65553
65554
65555
65556
65557
65558
65559
65560
65561
65562
65563
65564
65565
65566
65567
65568
65569
65570
65571
65572
65573
65574
65575
65576
65577
65578
65579
65580
65581
65582
65583
65584
65585
65586
65587
65588
65589
65590
65591
65592
65593
65594
65595
65596
65597
65598
65599
65600
65601
65602
65603
65604
65605
65606
65607
65608
65609
65610
65611
65612
65613
65614
65615
65616
65617
65618
65619
65620
65621
65622
65623
65624
65625
65626
65627
65628
65629
65630
65631
65632
65633
65634
65635
65636
65637
65638
65639
65640
65641
65642
65643
65644
65645
65646
65647
65648
65649
65650
65651
65652
65653
65654
65655
65656
65657
65658
65659
65660
65661
65662
65663
65664
65665
65666
65667
65668
65669
65670
65671
65672
65673
65674
65675
65676
65677
65678
65679
65680
65681
65682
65683
65684
65685
65686
65687
65688
65689
65690
65691
65692
65693
65694
65695
65696
65697
65698
65699
65700
65701
65702
65703
65704
65705
65706
65707
65708
65709
65710
65711
65712
65713
65714
65715
65716
65717
65718
65719
65720
65721
65722
65723
65724
65725
65726
65727
65728
65729
65730
65731
65732
65733
65734
65735
65736
65737
65738
65739
65740
65741
65742
65743
65744
65745
65746
65747
65748
65749
65750
65751
65752
65753
65754
65755
65756
65757
65758
65759
65760
65761
65762
65763
65764
65765
65766
65767
65768
65769
65770
65771
65772
65773
65774
65775
65776
65777
65778
65779
65780
65781
65782
65783
65784
65785
65786
65787
65788
65789
65790
65791
65792
65793
65794
65795
65796
65797
65798
65799
65800
65801
65802
65803
65804
65805
65806
65807
65808
65809
65810
65811
65812
65813
65814
65815
65816
65817
65818
65819
65820
65821
65822
65823
65824
65825
65826
65827
65828
65829
65830
65831
65832
65833
65834
65835
65836
65837
65838
65839
65840
65841
65842
65843
65844
65845
65846
65847
65848
65849
65850
65851
65852
65853
65854
65855
65856
65857
65858
65859
65860
65861
65862
65863
65864
65865
65866
65867
65868
65869
65870
65871
65872
65873
65874
65875
65876
65877
65878
65879
65880
65881
65882
65883
65884
65885
65886
65887
65888
65889
65890
65891
65892
65893
65894
65895
65896
65897
65898
65899
65900
65901
65902
65903
65904
65905
65906
65907
65908
65909
65910
65911
65912
65913
65914
65915
65916
65917
65918
65919
65920
65921
65922
65923
65924
65925
65926
65927
65928
65929
65930
65931
65932
65933
65934
65935
65936
65937
65938
65939
65940
65941
65942
65943
65944
65945
65946
65947
65948
65949
65950
65951
65952
65953
65954
65955
65956
65957
65958
65959
65960
65961
65962
65963
65964
65965
65966
65967
65968
65969
65970
65971
65972
65973
65974
65975
65976
65977
65978
65979
65980
65981
65982
65983
65984
65985
65986
65987
65988
65989
65990
65991
65992
65993
65994
65995
65996
65997
65998
65999
66000
66001
66002
66003
66004
66005
66006
66007
66008
66009
66010
66011
66012
66013
66014
66015
66016
66017
66018
66019
66020
66021
66022
66023
66024
66025
66026
66027
66028
66029
66030
66031
66032
66033
66034
66035
66036
66037
66038
66039
66040
66041
66042
66043
66044
66045
66046
66047
66048
66049
66050
66051
66052
66053
66054
66055
66056
66057
66058
66059
66060
66061
66062
66063
66064
66065
66066
66067
66068
66069
66070
66071
66072
66073
66074
66075
66076
66077
66078
66079
66080
66081
66082
66083
66084
66085
66086
66087
66088
66089
66090
66091
66092
66093
66094
66095
66096
66097
66098
66099
66100
66101
66102
66103
66104
66105
66106
66107
66108
66109
66110
66111
66112
66113
66114
66115
66116
66117
66118
66119
66120
66121
66122
66123
66124
66125
66126
66127
66128
66129
66130
66131
66132
66133
66134
66135
66136
66137
66138
66139
66140
66141
66142
66143
66144
66145
66146
66147
66148
66149
66150
66151
66152
66153
66154
66155
66156
66157
66158
66159
66160
66161
66162
66163
66164
66165
66166
66167
66168
66169
66170
66171
66172
66173
66174
66175
66176
66177
66178
66179
66180
66181
66182
66183
66184
66185
66186
66187
66188
66189
66190
66191
66192
66193
66194
66195
66196
66197
66198
66199
66200
66201
66202
66203
66204
66205
66206
66207
66208
66209
66210
66211
66212
66213
66214
66215
66216
66217
66218
66219
66220
66221
66222
66223
66224
66225
66226
66227
66228
66229
66230
66231
66232
66233
66234
66235
66236
66237
66238
66239
66240
66241
66242
66243
66244
66245
66246
66247
66248
66249
66250
66251
66252
66253
66254
66255
66256
66257
66258
66259
66260
66261
66262
66263
66264
66265
66266
66267
66268
66269
66270
66271
66272
66273
66274
66275
66276
66277
66278
66279
66280
66281
66282
66283
66284
66285
66286
66287
66288
66289
66290
66291
66292
66293
66294
66295
66296
66297
66298
66299
66300
66301
66302
66303
66304
66305
66306
66307
66308
66309
66310
66311
66312
66313
66314
66315
66316
66317
66318
66319
66320
66321
66322
66323
66324
66325
66326
66327
66328
66329
66330
66331
66332
66333
66334
66335
66336
66337
66338
66339
66340
66341
66342
66343
66344
66345
66346
66347
66348
66349
66350
66351
66352
66353
66354
66355
66356
66357
66358
66359
66360
66361
66362
66363
66364
66365
66366
66367
66368
66369
66370
66371
66372
66373
66374
66375
66376
66377
66378
66379
66380
66381
66382
66383
66384
66385
66386
66387
66388
66389
66390
66391
66392
66393
66394
66395
66396
66397
66398
66399
66400
66401
66402
66403
66404
66405
66406
66407
66408
66409
66410
66411
66412
66413
66414
66415
66416
66417
66418
66419
66420
66421
66422
66423
66424
66425
66426
66427
66428
66429
66430
66431
66432
66433
66434
66435
66436
66437
66438
66439
66440
66441
66442
66443
66444
66445
66446
66447
66448
66449
66450
66451
66452
66453
66454
66455
66456
66457
66458
66459
66460
66461
66462
66463
66464
66465
66466
66467
66468
66469
66470
66471
66472
66473
66474
66475
66476
66477
66478
66479
66480
66481
66482
66483
66484
66485
66486
66487
66488
66489
66490
66491
66492
66493
66494
66495
66496
66497
66498
66499
66500
66501
66502
66503
66504
66505
66506
66507
66508
66509
66510
66511
66512
66513
66514
66515
66516
66517
66518
66519
66520
66521
66522
66523
66524
66525
66526
66527
66528
66529
66530
66531
66532
66533
66534
66535
66536
66537
66538
66539
66540
66541
66542
66543
66544
66545
66546
66547
66548
66549
66550
66551
66552
66553
66554
66555
66556
66557
66558
66559
66560
66561
66562
66563
66564
66565
66566
66567
66568
66569
66570
66571
66572
66573
66574
66575
66576
66577
66578
66579
66580
66581
66582
66583
66584
66585
66586
66587
66588
66589
66590
66591
66592
66593
66594
66595
66596
66597
66598
66599
66600
66601
66602
66603
66604
66605
66606
66607
66608
66609
66610
66611
66612
66613
66614
66615
66616
66617
66618
66619
66620
66621
66622
66623
66624
66625
66626
66627
66628
66629
66630
66631
66632
66633
66634
66635
66636
66637
66638
66639
66640
66641
66642
66643
66644
66645
66646
66647
66648
66649
66650
66651
66652
66653
66654
66655
66656
66657
66658
66659
66660
66661
66662
66663
66664
66665
66666
66667
66668
66669
66670
66671
66672
66673
66674
66675
66676
66677
66678
66679
66680
66681
66682
66683
66684
66685
66686
66687
66688
66689
66690
66691
66692
66693
66694
66695
66696
66697
66698
66699
66700
66701
66702
66703
66704
66705
66706
66707
66708
66709
66710
66711
66712
66713
66714
66715
66716
66717
66718
66719
66720
66721
66722
66723
66724
66725
66726
66727
66728
66729
66730
66731
66732
66733
66734
66735
66736
66737
66738
66739
66740
66741
66742
66743
66744
66745
66746
66747
66748
66749
66750
66751
66752
66753
66754
66755
66756
66757
66758
66759
66760
66761
66762
66763
66764
66765
66766
66767
66768
66769
66770
66771
66772
66773
66774
66775
66776
66777
66778
66779
66780
66781
66782
66783
66784
66785
66786
66787
66788
66789
66790
66791
66792
66793
66794
66795
66796
66797
66798
66799
66800
66801
66802
66803
66804
66805
66806
66807
66808
66809
66810
66811
66812
66813
66814
66815
66816
66817
66818
66819
66820
66821
66822
66823
66824
66825
66826
66827
66828
66829
66830
66831
66832
66833
66834
66835
66836
66837
66838
66839
66840
66841
66842
66843
66844
66845
66846
66847
66848
66849
66850
66851
66852
66853
66854
66855
66856
66857
66858
66859
66860
66861
66862
66863
66864
66865
66866
66867
66868
66869
66870
66871
66872
66873
66874
66875
66876
66877
66878
66879
66880
66881
66882
66883
66884
66885
66886
66887
66888
66889
66890
66891
66892
66893
66894
66895
66896
66897
66898
66899
66900
66901
66902
66903
66904
66905
66906
66907
66908
66909
66910
66911
66912
66913
66914
66915
66916
66917
66918
66919
66920
66921
66922
66923
66924
66925
66926
66927
66928
66929
66930
66931
66932
66933
66934
66935
66936
66937
66938
66939
66940
66941
66942
66943
66944
66945
66946
66947
66948
66949
66950
66951
66952
66953
66954
66955
66956
66957
66958
66959
66960
66961
66962
66963
66964
66965
66966
66967
66968
66969
66970
66971
66972
66973
66974
66975
66976
66977
66978
66979
66980
66981
66982
66983
66984
66985
66986
66987
66988
66989
66990
66991
66992
66993
66994
66995
66996
66997
66998
66999
67000
67001
67002
67003
67004
67005
67006
67007
67008
67009
67010
67011
67012
67013
67014
67015
67016
67017
67018
67019
67020
67021
67022
67023
67024
67025
67026
67027
67028
67029
67030
67031
67032
67033
67034
67035
67036
67037
67038
67039
67040
67041
67042
67043
67044
67045
67046
67047
67048
67049
67050
67051
67052
67053
67054
67055
67056
67057
67058
67059
67060
67061
67062
67063
67064
67065
67066
67067
67068
67069
67070
67071
67072
67073
67074
67075
67076
67077
67078
67079
67080
67081
67082
67083
67084
67085
67086
67087
67088
67089
67090
67091
67092
67093
67094
67095
67096
67097
67098
67099
67100
67101
67102
67103
67104
67105
67106
67107
67108
67109
67110
67111
67112
67113
67114
67115
67116
67117
67118
67119
67120
67121
67122
67123
67124
67125
67126
67127
67128
67129
67130
67131
67132
67133
67134
67135
67136
67137
67138
67139
67140
67141
67142
67143
67144
67145
67146
67147
67148
67149
67150
67151
67152
67153
67154
67155
67156
67157
67158
67159
67160
67161
67162
67163
67164
67165
67166
67167
67168
67169
67170
67171
67172
67173
67174
67175
67176
67177
67178
67179
67180
67181
67182
67183
67184
67185
67186
67187
67188
67189
67190
67191
67192
67193
67194
67195
67196
67197
67198
67199
67200
67201
67202
67203
67204
67205
67206
67207
67208
67209
67210
67211
67212
67213
67214
67215
67216
67217
67218
67219
67220
67221
67222
67223
67224
67225
67226
67227
67228
67229
67230
67231
67232
67233
67234
67235
67236
67237
67238
67239
67240
67241
67242
67243
67244
67245
67246
67247
67248
67249
67250
67251
67252
67253
67254
67255
67256
67257
67258
67259
67260
67261
67262
67263
67264
67265
67266
67267
67268
67269
67270
67271
67272
67273
67274
67275
67276
67277
67278
67279
67280
67281
67282
67283
67284
67285
67286
67287
67288
67289
67290
67291
67292
67293
67294
67295
67296
67297
67298
67299
67300
67301
67302
67303
67304
67305
67306
67307
67308
67309
67310
67311
67312
67313
67314
67315
67316
67317
67318
67319
67320
67321
67322
67323
67324
67325
67326
67327
67328
67329
67330
67331
67332
67333
67334
67335
67336
67337
67338
67339
67340
67341
67342
67343
67344
67345
67346
67347
67348
67349
67350
67351
67352
67353
67354
67355
67356
67357
67358
67359
67360
67361
67362
67363
67364
67365
67366
67367
67368
67369
67370
67371
67372
67373
67374
67375
67376
67377
67378
67379
67380
67381
67382
67383
67384
67385
67386
67387
67388
67389
67390
67391
67392
67393
67394
67395
67396
67397
67398
67399
67400
67401
67402
67403
67404
67405
67406
67407
67408
67409
67410
67411
67412
67413
67414
67415
67416
67417
67418
67419
67420
67421
67422
67423
67424
67425
67426
67427
67428
67429
67430
67431
67432
67433
67434
67435
67436
67437
67438
67439
67440
67441
67442
67443
67444
67445
67446
67447
67448
67449
67450
67451
67452
67453
67454
67455
67456
67457
67458
67459
67460
67461
67462
67463
67464
67465
67466
67467
67468
67469
67470
67471
67472
67473
67474
67475
67476
67477
67478
67479
67480
67481
67482
67483
67484
67485
67486
67487
67488
67489
67490
67491
67492
67493
67494
67495
67496
67497
67498
67499
67500
67501
67502
67503
67504
67505
67506
67507
67508
67509
67510
67511
67512
67513
67514
67515
67516
67517
67518
67519
67520
67521
67522
67523
67524
67525
67526
67527
67528
67529
67530
67531
67532
67533
67534
67535
67536
67537
67538
67539
67540
67541
67542
67543
67544
67545
67546
67547
67548
67549
67550
67551
67552
67553
67554
67555
67556
67557
67558
67559
67560
67561
67562
67563
67564
67565
67566
67567
67568
67569
67570
67571
67572
67573
67574
67575
67576
67577
67578
67579
67580
67581
67582
67583
67584
67585
67586
67587
67588
67589
67590
67591
67592
67593
67594
67595
67596
67597
67598
67599
67600
67601
67602
67603
67604
67605
67606
67607
67608
67609
67610
67611
67612
67613
67614
67615
67616
67617
67618
67619
67620
67621
67622
67623
67624
67625
67626
67627
67628
67629
67630
67631
67632
67633
67634
67635
67636
67637
67638
67639
67640
67641
67642
67643
67644
67645
67646
67647
67648
67649
67650
67651
67652
67653
67654
67655
67656
67657
67658
67659
67660
67661
67662
67663
67664
67665
67666
67667
67668
67669
67670
67671
67672
67673
67674
67675
67676
67677
67678
67679
67680
67681
67682
67683
67684
67685
67686
67687
67688
67689
67690
67691
67692
67693
67694
67695
67696
67697
67698
67699
67700
67701
67702
67703
67704
67705
67706
67707
67708
67709
67710
67711
67712
67713
67714
67715
67716
67717
67718
67719
67720
67721
67722
67723
67724
67725
67726
67727
67728
67729
67730
67731
67732
67733
67734
67735
67736
67737
67738
67739
67740
67741
67742
67743
67744
67745
67746
67747
67748
67749
67750
67751
67752
67753
67754
67755
67756
67757
67758
67759
67760
67761
67762
67763
67764
67765
67766
67767
67768
67769
67770
67771
67772
67773
67774
67775
67776
67777
67778
67779
67780
67781
67782
67783
67784
67785
67786
67787
67788
67789
67790
67791
67792
67793
67794
67795
67796
67797
67798
67799
67800
67801
67802
67803
67804
67805
67806
67807
67808
67809
67810
67811
67812
67813
67814
67815
67816
67817
67818
67819
67820
67821
67822
67823
67824
67825
67826
67827
67828
67829
67830
67831
67832
67833
67834
67835
67836
67837
67838
67839
67840
67841
67842
67843
67844
67845
67846
67847
67848
67849
67850
67851
67852
67853
67854
67855
67856
67857
67858
67859
67860
67861
67862
67863
67864
67865
67866
67867
67868
67869
67870
67871
67872
67873
67874
67875
67876
67877
67878
67879
67880
67881
67882
67883
67884
67885
67886
67887
67888
67889
67890
67891
67892
67893
67894
67895
67896
67897
67898
67899
67900
67901
67902
67903
67904
67905
67906
67907
67908
67909
67910
67911
67912
67913
67914
67915
67916
67917
67918
67919
67920
67921
67922
67923
67924
67925
67926
67927
67928
67929
67930
67931
67932
67933
67934
67935
67936
67937
67938
67939
67940
67941
67942
67943
67944
67945
67946
67947
67948
67949
67950
67951
67952
67953
67954
67955
67956
67957
67958
67959
67960
67961
67962
67963
67964
67965
67966
67967
67968
67969
67970
67971
67972
67973
67974
67975
67976
67977
67978
67979
67980
67981
67982
67983
67984
67985
67986
67987
67988
67989
67990
67991
67992
67993
67994
67995
67996
67997
67998
67999
68000
68001
68002
68003
68004
68005
68006
68007
68008
68009
68010
68011
68012
68013
68014
68015
68016
68017
68018
68019
68020
68021
68022
68023
68024
68025
68026
68027
68028
68029
68030
68031
68032
68033
68034
68035
68036
68037
68038
68039
68040
68041
68042
68043
68044
68045
68046
68047
68048
68049
68050
68051
68052
68053
68054
68055
68056
68057
68058
68059
68060
68061
68062
68063
68064
68065
68066
68067
68068
68069
68070
68071
68072
68073
68074
68075
68076
68077
68078
68079
68080
68081
68082
68083
68084
68085
68086
68087
68088
68089
68090
68091
68092
68093
68094
68095
68096
68097
68098
68099
68100
68101
68102
68103
68104
68105
68106
68107
68108
68109
68110
68111
68112
68113
68114
68115
68116
68117
68118
68119
68120
68121
68122
68123
68124
68125
68126
68127
68128
68129
68130
68131
68132
68133
68134
68135
68136
68137
68138
68139
68140
68141
68142
68143
68144
68145
68146
68147
68148
68149
68150
68151
68152
68153
68154
68155
68156
68157
68158
68159
68160
68161
68162
68163
68164
68165
68166
68167
68168
68169
68170
68171
68172
68173
68174
68175
68176
68177
68178
68179
68180
68181
68182
68183
68184
68185
68186
68187
68188
68189
68190
68191
68192
68193
68194
68195
68196
68197
68198
68199
68200
68201
68202
68203
68204
68205
68206
68207
68208
68209
68210
68211
68212
68213
68214
68215
68216
68217
68218
68219
68220
68221
68222
68223
68224
68225
68226
68227
68228
68229
68230
68231
68232
68233
68234
68235
68236
68237
68238
68239
68240
68241
68242
68243
68244
68245
68246
68247
68248
68249
68250
68251
68252
68253
68254
68255
68256
68257
68258
68259
68260
68261
68262
68263
68264
68265
68266
68267
68268
68269
68270
68271
68272
68273
68274
68275
68276
68277
68278
68279
68280
68281
68282
68283
68284
68285
68286
68287
68288
68289
68290
68291
68292
68293
68294
68295
68296
68297
68298
68299
68300
68301
68302
68303
68304
68305
68306
68307
68308
68309
68310
68311
68312
68313
68314
68315
68316
68317
68318
68319
68320
68321
68322
68323
68324
68325
68326
68327
68328
68329
68330
68331
68332
68333
68334
68335
68336
68337
68338
68339
68340
68341
68342
68343
68344
68345
68346
68347
68348
68349
68350
68351
68352
68353
68354
68355
68356
68357
68358
68359
68360
68361
68362
68363
68364
68365
68366
68367
68368
68369
68370
68371
68372
68373
68374
68375
68376
68377
68378
68379
68380
68381
68382
68383
68384
68385
68386
68387
68388
68389
68390
68391
68392
68393
68394
68395
68396
68397
68398
68399
68400
68401
68402
68403
68404
68405
68406
68407
68408
68409
68410
68411
68412
68413
68414
68415
68416
68417
68418
68419
68420
68421
68422
68423
68424
68425
68426
68427
68428
68429
68430
68431
68432
68433
68434
68435
68436
68437
68438
68439
68440
68441
68442
68443
68444
68445
68446
68447
68448
68449
68450
68451
68452
68453
68454
68455
68456
68457
68458
68459
68460
68461
68462
68463
68464
68465
68466
68467
68468
68469
68470
68471
68472
68473
68474
68475
68476
68477
68478
68479
68480
68481
68482
68483
68484
68485
68486
68487
68488
68489
68490
68491
68492
68493
68494
68495
68496
68497
68498
68499
68500
68501
68502
68503
68504
68505
68506
68507
68508
68509
68510
68511
68512
68513
68514
68515
68516
68517
68518
68519
68520
68521
68522
68523
68524
68525
68526
68527
68528
68529
68530
68531
68532
68533
68534
68535
68536
68537
68538
68539
68540
68541
68542
68543
68544
68545
68546
68547
68548
68549
68550
68551
68552
68553
68554
68555
68556
68557
68558
68559
68560
68561
68562
68563
68564
68565
68566
68567
68568
68569
68570
68571
68572
68573
68574
68575
68576
68577
68578
68579
68580
68581
68582
68583
68584
68585
68586
68587
68588
68589
68590
68591
68592
68593
68594
68595
68596
68597
68598
68599
68600
68601
68602
68603
68604
68605
68606
68607
68608
68609
68610
68611
68612
68613
68614
68615
68616
68617
68618
68619
68620
68621
68622
68623
68624
68625
68626
68627
68628
68629
68630
68631
68632
68633
68634
68635
68636
68637
68638
68639
68640
68641
68642
68643
68644
68645
68646
68647
68648
68649
68650
68651
68652
68653
68654
68655
68656
68657
68658
68659
68660
68661
68662
68663
68664
68665
68666
68667
68668
68669
68670
68671
68672
68673
68674
68675
68676
68677
68678
68679
68680
68681
68682
68683
68684
68685
68686
68687
68688
68689
68690
68691
68692
68693
68694
68695
68696
68697
68698
68699
68700
68701
68702
68703
68704
68705
68706
68707
68708
68709
68710
68711
68712
68713
68714
68715
68716
68717
68718
68719
68720
68721
68722
68723
68724
68725
68726
68727
68728
68729
68730
68731
68732
68733
68734
68735
68736
68737
68738
68739
68740
68741
68742
68743
68744
68745
68746
68747
68748
68749
68750
68751
68752
68753
68754
68755
68756
68757
68758
68759
68760
68761
68762
68763
68764
68765
68766
68767
68768
68769
68770
68771
68772
68773
68774
68775
68776
68777
68778
68779
68780
68781
68782
68783
68784
68785
68786
68787
68788
68789
68790
68791
68792
68793
68794
68795
68796
68797
68798
68799
68800
68801
68802
68803
68804
68805
68806
68807
68808
68809
68810
68811
68812
68813
68814
68815
68816
68817
68818
68819
68820
68821
68822
68823
68824
68825
68826
68827
68828
68829
68830
68831
68832
68833
68834
68835
68836
68837
68838
68839
68840
68841
68842
68843
68844
68845
68846
68847
68848
68849
68850
68851
68852
68853
68854
68855
68856
68857
68858
68859
68860
68861
68862
68863
68864
68865
68866
68867
68868
68869
68870
68871
68872
68873
68874
68875
68876
68877
68878
68879
68880
68881
68882
68883
68884
68885
68886
68887
68888
68889
68890
68891
68892
68893
68894
68895
68896
68897
68898
68899
68900
68901
68902
68903
68904
68905
68906
68907
68908
68909
68910
68911
68912
68913
68914
68915
68916
68917
68918
68919
68920
68921
68922
68923
68924
68925
68926
68927
68928
68929
68930
68931
68932
68933
68934
68935
68936
68937
68938
68939
68940
68941
68942
68943
68944
68945
68946
68947
68948
68949
68950
68951
68952
68953
68954
68955
68956
68957
68958
68959
68960
68961
68962
68963
68964
68965
68966
68967
68968
68969
68970
68971
68972
68973
68974
68975
68976
68977
68978
68979
68980
68981
68982
68983
68984
68985
68986
68987
68988
68989
68990
68991
68992
68993
68994
68995
68996
68997
68998
68999
69000
69001
69002
69003
69004
69005
69006
69007
69008
69009
69010
69011
69012
69013
69014
69015
69016
69017
69018
69019
69020
69021
69022
69023
69024
69025
69026
69027
69028
69029
69030
69031
69032
69033
69034
69035
69036
69037
69038
69039
69040
69041
69042
69043
69044
69045
69046
69047
69048
69049
69050
69051
69052
69053
69054
69055
69056
69057
69058
69059
69060
69061
69062
69063
69064
69065
69066
69067
69068
69069
69070
69071
69072
69073
69074
69075
69076
69077
69078
69079
69080
69081
69082
69083
69084
69085
69086
69087
69088
69089
69090
69091
69092
69093
69094
69095
69096
69097
69098
69099
69100
69101
69102
69103
69104
69105
69106
69107
69108
69109
69110
69111
69112
69113
69114
69115
69116
69117
69118
69119
69120
69121
69122
69123
69124
69125
69126
69127
69128
69129
69130
69131
69132
69133
69134
69135
69136
69137
69138
69139
69140
69141
69142
69143
69144
69145
69146
69147
69148
69149
69150
69151
69152
69153
69154
69155
69156
69157
69158
69159
69160
69161
69162
69163
69164
69165
69166
69167
69168
69169
69170
69171
69172
69173
69174
69175
69176
69177
69178
69179
69180
69181
69182
69183
69184
69185
69186
69187
69188
69189
69190
69191
69192
69193
69194
69195
69196
69197
69198
69199
69200
69201
69202
69203
69204
69205
69206
69207
69208
69209
69210
69211
69212
69213
69214
69215
69216
69217
69218
69219
69220
69221
69222
69223
69224
69225
69226
69227
69228
69229
69230
69231
69232
69233
69234
69235
69236
69237
69238
69239
69240
69241
69242
69243
69244
69245
69246
69247
69248
69249
69250
69251
69252
69253
69254
69255
69256
69257
69258
69259
69260
69261
69262
69263
69264
69265
69266
69267
69268
69269
69270
69271
69272
69273
69274
69275
69276
69277
69278
69279
69280
69281
69282
69283
69284
69285
69286
69287
69288
69289
69290
69291
69292
69293
69294
69295
69296
69297
69298
69299
69300
69301
69302
69303
69304
69305
69306
69307
69308
69309
69310
69311
69312
69313
69314
69315
69316
69317
69318
69319
69320
69321
69322
69323
69324
69325
69326
69327
69328
69329
69330
69331
69332
69333
69334
69335
69336
69337
69338
69339
69340
69341
69342
69343
69344
69345
69346
69347
69348
69349
69350
69351
69352
69353
69354
69355
69356
69357
69358
69359
69360
69361
69362
69363
69364
69365
69366
69367
69368
69369
69370
69371
69372
69373
69374
69375
69376
69377
69378
69379
69380
69381
69382
69383
69384
69385
69386
69387
69388
69389
69390
69391
69392
69393
69394
69395
69396
69397
69398
69399
69400
69401
69402
69403
69404
69405
69406
69407
69408
69409
69410
69411
69412
69413
69414
69415
69416
69417
69418
69419
69420
69421
69422
69423
69424
69425
69426
69427
69428
69429
69430
69431
69432
69433
69434
69435
69436
69437
69438
69439
69440
69441
69442
69443
69444
69445
69446
69447
69448
69449
69450
69451
69452
69453
69454
69455
69456
69457
69458
69459
69460
69461
69462
69463
69464
69465
69466
69467
69468
69469
69470
69471
69472
69473
69474
69475
69476
69477
69478
69479
69480
69481
69482
69483
69484
69485
69486
69487
69488
69489
69490
69491
69492
69493
69494
69495
69496
69497
69498
69499
69500
69501
69502
69503
69504
69505
69506
69507
69508
69509
69510
69511
69512
69513
69514
69515
69516
69517
69518
69519
69520
69521
69522
69523
69524
69525
69526
69527
69528
69529
69530
69531
69532
69533
69534
69535
69536
69537
69538
69539
69540
69541
69542
69543
69544
69545
69546
69547
69548
69549
69550
69551
69552
69553
69554
69555
69556
69557
69558
69559
69560
69561
69562
69563
69564
69565
69566
69567
69568
69569
69570
69571
69572
69573
69574
69575
69576
69577
69578
69579
69580
69581
69582
69583
69584
69585
69586
69587
69588
69589
69590
69591
69592
69593
69594
69595
69596
69597
69598
69599
69600
69601
69602
69603
69604
69605
69606
69607
69608
69609
69610
69611
69612
69613
69614
69615
69616
69617
69618
69619
69620
69621
69622
69623
69624
69625
69626
69627
69628
69629
69630
69631
69632
69633
69634
69635
69636
69637
69638
69639
69640
69641
69642
69643
69644
69645
69646
69647
69648
69649
69650
69651
69652
69653
69654
69655
69656
69657
69658
69659
69660
69661
69662
69663
69664
69665
69666
69667
69668
69669
69670
69671
69672
69673
69674
69675
69676
69677
69678
69679
69680
69681
69682
69683
69684
69685
69686
69687
69688
69689
69690
69691
69692
69693
69694
69695
69696
69697
69698
69699
69700
69701
69702
69703
69704
69705
69706
69707
69708
69709
69710
69711
69712
69713
69714
69715
69716
69717
69718
69719
69720
69721
69722
69723
69724
69725
69726
69727
69728
69729
69730
69731
69732
69733
69734
69735
69736
69737
69738
69739
69740
69741
69742
69743
69744
69745
69746
69747
69748
69749
69750
69751
69752
69753
69754
69755
69756
69757
69758
69759
69760
69761
69762
69763
69764
69765
69766
69767
69768
69769
69770
69771
69772
69773
69774
69775
69776
69777
69778
69779
69780
69781
69782
69783
69784
69785
69786
69787
69788
69789
69790
69791
69792
69793
69794
69795
69796
69797
69798
69799
69800
69801
69802
69803
69804
69805
69806
69807
69808
69809
69810
69811
69812
69813
69814
69815
69816
69817
69818
69819
69820
69821
69822
69823
69824
69825
69826
69827
69828
69829
69830
69831
69832
69833
69834
69835
69836
69837
69838
69839
69840
69841
69842
69843
69844
69845
69846
69847
69848
69849
69850
69851
69852
69853
69854
69855
69856
69857
69858
69859
69860
69861
69862
69863
69864
69865
69866
69867
69868
69869
69870
69871
69872
69873
69874
69875
69876
69877
69878
69879
69880
69881
69882
69883
69884
69885
69886
69887
69888
69889
69890
69891
69892
69893
69894
69895
69896
69897
69898
69899
69900
69901
69902
69903
69904
69905
69906
69907
69908
69909
69910
69911
69912
69913
69914
69915
69916
69917
69918
69919
69920
69921
69922
69923
69924
69925
69926
69927
69928
69929
69930
69931
69932
69933
69934
69935
69936
69937
69938
69939
69940
69941
69942
69943
69944
69945
69946
69947
69948
69949
69950
69951
69952
69953
69954
69955
69956
69957
69958
69959
69960
69961
69962
69963
69964
69965
69966
69967
69968
69969
69970
69971
69972
69973
69974
69975
69976
69977
69978
69979
69980
69981
69982
69983
69984
69985
69986
69987
69988
69989
69990
69991
69992
69993
69994
69995
69996
69997
69998
69999
70000
70001
70002
70003
70004
70005
70006
70007
70008
70009
70010
70011
70012
70013
70014
70015
70016
70017
70018
70019
70020
70021
70022
70023
70024
70025
70026
70027
70028
70029
70030
70031
70032
70033
70034
70035
70036
70037
70038
70039
70040
70041
70042
70043
70044
70045
70046
70047
70048
70049
70050
70051
70052
70053
70054
70055
70056
70057
70058
70059
70060
70061
70062
70063
70064
70065
70066
70067
70068
70069
70070
70071
70072
70073
70074
70075
70076
70077
70078
70079
70080
70081
70082
70083
70084
70085
70086
70087
70088
70089
70090
70091
70092
70093
70094
70095
70096
70097
70098
70099
70100
70101
70102
70103
70104
70105
70106
70107
70108
70109
70110
70111
70112
70113
70114
70115
70116
70117
70118
70119
70120
70121
70122
70123
70124
70125
70126
70127
70128
70129
70130
70131
70132
70133
70134
70135
70136
70137
70138
70139
70140
70141
70142
70143
70144
70145
70146
70147
70148
70149
70150
70151
70152
70153
70154
70155
70156
70157
70158
70159
70160
70161
70162
70163
70164
70165
70166
70167
70168
70169
70170
70171
70172
70173
70174
70175
70176
70177
70178
70179
70180
70181
70182
70183
70184
70185
70186
70187
70188
70189
70190
70191
70192
70193
70194
70195
70196
70197
70198
70199
70200
70201
70202
70203
70204
70205
70206
70207
70208
70209
70210
70211
70212
70213
70214
70215
70216
70217
70218
70219
70220
70221
70222
70223
70224
70225
70226
70227
70228
70229
70230
70231
70232
70233
70234
70235
70236
70237
70238
70239
70240
70241
70242
70243
70244
70245
70246
70247
70248
70249
70250
70251
70252
70253
70254
70255
70256
70257
70258
70259
70260
70261
70262
70263
70264
70265
70266
70267
70268
70269
70270
70271
70272
70273
70274
70275
70276
70277
70278
70279
70280
70281
70282
70283
70284
70285
70286
70287
70288
70289
70290
70291
70292
70293
70294
70295
70296
70297
70298
70299
70300
70301
70302
70303
70304
70305
70306
70307
70308
70309
70310
70311
70312
70313
70314
70315
70316
70317
70318
70319
70320
70321
70322
70323
70324
70325
70326
70327
70328
70329
70330
70331
70332
70333
70334
70335
70336
70337
70338
70339
70340
70341
70342
70343
70344
70345
70346
70347
70348
70349
70350
70351
70352
70353
70354
70355
70356
70357
70358
70359
70360
70361
70362
70363
70364
70365
70366
70367
70368
70369
70370
70371
70372
70373
70374
70375
70376
70377
70378
70379
70380
70381
70382
70383
70384
70385
70386
70387
70388
70389
70390
70391
70392
70393
70394
70395
70396
70397
70398
70399
70400
70401
70402
70403
70404
70405
70406
70407
70408
70409
70410
70411
70412
70413
70414
70415
70416
70417
70418
70419
70420
70421
70422
70423
70424
70425
70426
70427
70428
70429
70430
70431
70432
70433
70434
70435
70436
70437
70438
70439
70440
70441
70442
70443
70444
70445
70446
70447
70448
70449
70450
70451
70452
70453
70454
70455
70456
70457
70458
70459
70460
70461
70462
70463
70464
70465
70466
70467
70468
70469
70470
70471
70472
70473
70474
70475
70476
70477
70478
70479
70480
70481
70482
70483
70484
70485
70486
70487
70488
70489
70490
70491
70492
70493
70494
70495
70496
70497
70498
70499
70500
70501
70502
70503
70504
70505
70506
70507
70508
70509
70510
70511
70512
70513
70514
70515
70516
70517
70518
70519
70520
70521
70522
70523
70524
70525
70526
70527
70528
70529
70530
70531
70532
70533
70534
70535
70536
70537
70538
70539
70540
70541
70542
70543
70544
70545
70546
70547
70548
70549
70550
70551
70552
70553
70554
70555
70556
70557
70558
70559
70560
70561
70562
70563
70564
70565
70566
70567
70568
70569
70570
70571
70572
70573
70574
70575
70576
70577
70578
70579
70580
70581
70582
70583
70584
70585
70586
70587
70588
70589
70590
70591
70592
70593
70594
70595
70596
70597
70598
70599
70600
70601
70602
70603
70604
70605
70606
70607
70608
70609
70610
70611
70612
70613
70614
70615
70616
70617
70618
70619
70620
70621
70622
70623
70624
70625
70626
70627
70628
70629
70630
70631
70632
70633
70634
70635
70636
70637
70638
70639
70640
70641
70642
70643
70644
70645
70646
70647
70648
70649
70650
70651
70652
70653
70654
70655
70656
70657
70658
70659
70660
70661
70662
70663
70664
70665
70666
70667
70668
70669
70670
70671
70672
70673
70674
70675
70676
70677
70678
70679
70680
70681
70682
70683
70684
70685
70686
70687
70688
70689
70690
70691
70692
70693
70694
70695
70696
70697
70698
70699
70700
70701
70702
70703
70704
70705
70706
70707
70708
70709
70710
70711
70712
70713
70714
70715
70716
70717
70718
70719
70720
70721
70722
70723
70724
70725
70726
70727
70728
70729
70730
70731
70732
70733
70734
70735
70736
70737
70738
70739
70740
70741
70742
70743
70744
70745
70746
70747
70748
70749
70750
70751
70752
70753
70754
70755
70756
70757
70758
70759
70760
70761
70762
70763
70764
70765
70766
70767
70768
70769
70770
70771
70772
70773
70774
70775
70776
70777
70778
70779
70780
70781
70782
70783
70784
70785
70786
70787
70788
70789
70790
70791
70792
70793
70794
70795
70796
70797
70798
70799
70800
70801
70802
70803
70804
70805
70806
70807
70808
70809
70810
70811
70812
70813
70814
70815
70816
70817
70818
70819
70820
70821
70822
70823
70824
70825
70826
70827
70828
70829
70830
70831
70832
70833
70834
70835
70836
70837
70838
70839
70840
70841
70842
70843
70844
70845
70846
70847
70848
70849
70850
70851
70852
70853
70854
70855
70856
70857
70858
70859
70860
70861
70862
70863
70864
70865
70866
70867
70868
70869
70870
70871
70872
70873
70874
70875
70876
70877
70878
70879
70880
70881
70882
70883
70884
70885
70886
70887
70888
70889
70890
70891
70892
70893
70894
70895
70896
70897
70898
70899
70900
70901
70902
70903
70904
70905
70906
70907
70908
70909
70910
70911
70912
70913
70914
70915
70916
70917
70918
70919
70920
70921
70922
70923
70924
70925
70926
70927
70928
70929
70930
70931
70932
70933
70934
70935
70936
70937
70938
70939
70940
70941
70942
70943
70944
70945
70946
70947
70948
70949
70950
70951
70952
70953
70954
70955
70956
70957
70958
70959
70960
70961
70962
70963
70964
70965
70966
70967
70968
70969
70970
70971
70972
70973
70974
70975
70976
70977
70978
70979
70980
70981
70982
70983
70984
70985
70986
70987
70988
70989
70990
70991
70992
70993
70994
70995
70996
70997
70998
70999
71000
71001
71002
71003
71004
71005
71006
71007
71008
71009
71010
71011
71012
71013
71014
71015
71016
71017
71018
71019
71020
71021
71022
71023
71024
71025
71026
71027
71028
71029
71030
71031
71032
71033
71034
71035
71036
71037
71038
71039
71040
71041
71042
71043
71044
71045
71046
71047
71048
71049
71050
71051
71052
71053
71054
71055
71056
71057
71058
71059
71060
71061
71062
71063
71064
71065
71066
71067
71068
71069
71070
71071
71072
71073
71074
71075
71076
71077
71078
71079
71080
71081
71082
71083
71084
71085
71086
71087
71088
71089
71090
71091
71092
71093
71094
71095
71096
71097
71098
71099
71100
71101
71102
71103
71104
71105
71106
71107
71108
71109
71110
71111
71112
71113
71114
71115
71116
71117
71118
71119
71120
71121
71122
71123
71124
71125
71126
71127
71128
71129
71130
71131
71132
71133
71134
71135
71136
71137
71138
71139
71140
71141
71142
71143
71144
71145
71146
71147
71148
71149
71150
71151
71152
71153
71154
71155
71156
71157
71158
71159
71160
71161
71162
71163
71164
71165
71166
71167
71168
71169
71170
71171
71172
71173
71174
71175
71176
71177
71178
71179
71180
71181
71182
71183
71184
71185
71186
71187
71188
71189
71190
71191
71192
71193
71194
71195
71196
71197
71198
71199
71200
71201
71202
71203
71204
71205
71206
71207
71208
71209
71210
71211
71212
71213
71214
71215
71216
71217
71218
71219
71220
71221
71222
71223
71224
71225
71226
71227
71228
71229
71230
71231
71232
71233
71234
71235
71236
71237
71238
71239
71240
71241
71242
71243
71244
71245
71246
71247
71248
71249
71250
71251
71252
71253
71254
71255
71256
71257
71258
71259
71260
71261
71262
71263
71264
71265
71266
71267
71268
71269
71270
71271
71272
71273
71274
71275
71276
71277
71278
71279
71280
71281
71282
71283
71284
71285
71286
71287
71288
71289
71290
71291
71292
71293
71294
71295
71296
71297
71298
71299
71300
71301
71302
71303
71304
71305
71306
71307
71308
71309
71310
71311
71312
71313
71314
71315
71316
71317
71318
71319
71320
71321
71322
71323
71324
71325
71326
71327
71328
71329
71330
71331
71332
71333
71334
71335
71336
71337
71338
71339
71340
71341
71342
71343
71344
71345
71346
71347
71348
71349
71350
71351
71352
71353
71354
71355
71356
71357
71358
71359
71360
71361
71362
71363
71364
71365
71366
71367
71368
71369
71370
71371
71372
71373
71374
71375
71376
71377
71378
71379
71380
71381
71382
71383
71384
71385
71386
71387
71388
71389
71390
71391
71392
71393
71394
71395
71396
71397
71398
71399
71400
71401
71402
71403
71404
71405
71406
71407
71408
71409
71410
71411
71412
71413
71414
71415
71416
71417
71418
71419
71420
71421
71422
71423
71424
71425
71426
71427
71428
71429
71430
71431
71432
71433
71434
71435
71436
71437
71438
71439
71440
71441
71442
71443
71444
71445
71446
71447
71448
71449
71450
71451
71452
71453
71454
71455
71456
71457
71458
71459
71460
71461
71462
71463
71464
71465
71466
71467
71468
71469
71470
71471
71472
71473
71474
71475
71476
71477
71478
71479
71480
71481
71482
71483
71484
71485
71486
71487
71488
71489
71490
71491
71492
71493
71494
71495
71496
71497
71498
71499
71500
71501
71502
71503
71504
71505
71506
71507
71508
71509
71510
71511
71512
71513
71514
71515
71516
71517
71518
71519
71520
71521
71522
71523
71524
71525
71526
71527
71528
71529
71530
71531
71532
71533
71534
71535
71536
71537
71538
71539
71540
71541
71542
71543
71544
71545
71546
71547
71548
71549
71550
71551
71552
71553
71554
71555
71556
71557
71558
71559
71560
71561
71562
71563
71564
71565
71566
71567
71568
71569
71570
71571
71572
71573
71574
71575
71576
71577
71578
71579
71580
71581
71582
71583
71584
71585
71586
71587
71588
71589
71590
71591
71592
71593
71594
71595
71596
71597
71598
71599
71600
71601
71602
71603
71604
71605
71606
71607
71608
71609
71610
71611
71612
71613
71614
71615
71616
71617
71618
71619
71620
71621
71622
71623
71624
71625
71626
71627
71628
71629
71630
71631
71632
71633
71634
71635
71636
71637
71638
71639
71640
71641
71642
71643
71644
71645
71646
71647
71648
71649
71650
71651
71652
71653
71654
71655
71656
71657
71658
71659
71660
71661
71662
71663
71664
71665
71666
71667
71668
71669
71670
71671
71672
71673
71674
71675
71676
71677
71678
71679
71680
71681
71682
71683
71684
71685
71686
71687
71688
71689
71690
71691
71692
71693
71694
71695
71696
71697
71698
71699
71700
71701
71702
71703
71704
71705
71706
71707
71708
71709
71710
71711
71712
71713
71714
71715
71716
71717
71718
71719
71720
71721
71722
71723
71724
71725
71726
71727
71728
71729
71730
71731
71732
71733
71734
71735
71736
71737
71738
71739
71740
71741
71742
71743
71744
71745
71746
71747
71748
71749
71750
71751
71752
71753
71754
71755
71756
71757
71758
71759
71760
71761
71762
71763
71764
71765
71766
71767
71768
71769
71770
71771
71772
71773
71774
71775
71776
71777
71778
71779
71780
71781
71782
71783
71784
71785
71786
71787
71788
71789
71790
71791
71792
71793
71794
71795
71796
71797
71798
71799
71800
71801
71802
71803
71804
71805
71806
71807
71808
71809
71810
71811
71812
71813
71814
71815
71816
71817
71818
71819
71820
71821
71822
71823
71824
71825
71826
71827
71828
71829
71830
71831
71832
71833
71834
71835
71836
71837
71838
71839
71840
71841
71842
71843
71844
71845
71846
71847
71848
71849
71850
71851
71852
71853
71854
71855
71856
71857
71858
71859
71860
71861
71862
71863
71864
71865
71866
71867
71868
71869
71870
71871
71872
71873
71874
71875
71876
71877
71878
71879
71880
71881
71882
71883
71884
71885
71886
71887
71888
71889
71890
71891
71892
71893
71894
71895
71896
71897
71898
71899
71900
71901
71902
71903
71904
71905
71906
71907
71908
71909
71910
71911
71912
71913
71914
71915
71916
71917
71918
71919
71920
71921
71922
71923
71924
71925
71926
71927
71928
71929
71930
71931
71932
71933
71934
71935
71936
71937
71938
71939
71940
71941
71942
71943
71944
71945
71946
71947
71948
71949
71950
71951
71952
71953
71954
71955
71956
71957
71958
71959
71960
71961
71962
71963
71964
71965
71966
71967
71968
71969
71970
71971
71972
71973
71974
71975
71976
71977
71978
71979
71980
71981
71982
71983
71984
71985
71986
71987
71988
71989
71990
71991
71992
71993
71994
71995
71996
71997
71998
71999
72000
72001
72002
72003
72004
72005
72006
72007
72008
72009
72010
72011
72012
72013
72014
72015
72016
72017
72018
72019
72020
72021
72022
72023
72024
72025
72026
72027
72028
72029
72030
72031
72032
72033
72034
72035
72036
72037
72038
72039
72040
72041
72042
72043
72044
72045
72046
72047
72048
72049
72050
72051
72052
72053
72054
72055
72056
72057
72058
72059
72060
72061
72062
72063
72064
72065
72066
72067
72068
72069
72070
72071
72072
72073
72074
72075
72076
72077
72078
72079
72080
72081
72082
72083
72084
72085
72086
72087
72088
72089
72090
72091
72092
72093
72094
72095
72096
72097
72098
72099
72100
72101
72102
72103
72104
72105
72106
72107
72108
72109
72110
72111
72112
72113
72114
72115
72116
72117
72118
72119
72120
72121
72122
72123
72124
72125
72126
72127
72128
72129
72130
72131
72132
72133
72134
72135
72136
72137
72138
72139
72140
72141
72142
72143
72144
72145
72146
72147
72148
72149
72150
72151
72152
72153
72154
72155
72156
72157
72158
72159
72160
72161
72162
72163
72164
72165
72166
72167
72168
72169
72170
72171
72172
72173
72174
72175
72176
72177
72178
72179
72180
72181
72182
72183
72184
72185
72186
72187
72188
72189
72190
72191
72192
72193
72194
72195
72196
72197
72198
72199
72200
72201
72202
72203
72204
72205
72206
72207
72208
72209
72210
72211
72212
72213
72214
72215
72216
72217
72218
72219
72220
72221
72222
72223
72224
72225
72226
72227
72228
72229
72230
72231
72232
72233
72234
72235
72236
72237
72238
72239
72240
72241
72242
72243
72244
72245
72246
72247
72248
72249
72250
72251
72252
72253
72254
72255
72256
72257
72258
72259
72260
72261
72262
72263
72264
72265
72266
72267
72268
72269
72270
72271
72272
72273
72274
72275
72276
72277
72278
72279
72280
72281
72282
72283
72284
72285
72286
72287
72288
72289
72290
72291
72292
72293
72294
72295
72296
72297
72298
72299
72300
72301
72302
72303
72304
72305
72306
72307
72308
72309
72310
72311
72312
72313
72314
72315
72316
72317
72318
72319
72320
72321
72322
72323
72324
72325
72326
72327
72328
72329
72330
72331
72332
72333
72334
72335
72336
72337
72338
72339
72340
72341
72342
72343
72344
72345
72346
72347
72348
72349
72350
72351
72352
72353
72354
72355
72356
72357
72358
72359
72360
72361
72362
72363
72364
72365
72366
72367
72368
72369
72370
72371
72372
72373
72374
72375
72376
72377
72378
72379
72380
72381
72382
72383
72384
72385
72386
72387
72388
72389
72390
72391
72392
72393
72394
72395
72396
72397
72398
72399
72400
72401
72402
72403
72404
72405
72406
72407
72408
72409
72410
72411
72412
72413
72414
72415
72416
72417
72418
72419
72420
72421
72422
72423
72424
72425
72426
72427
72428
72429
72430
72431
72432
72433
72434
72435
72436
72437
72438
72439
72440
72441
72442
72443
72444
72445
72446
72447
72448
72449
72450
72451
72452
72453
72454
72455
72456
72457
72458
72459
72460
72461
72462
72463
72464
72465
72466
72467
72468
72469
72470
72471
72472
72473
72474
72475
72476
72477
72478
72479
72480
72481
72482
72483
72484
72485
72486
72487
72488
72489
72490
72491
72492
72493
72494
72495
72496
72497
72498
72499
72500
72501
72502
72503
72504
72505
72506
72507
72508
72509
72510
72511
72512
72513
72514
72515
72516
72517
72518
72519
72520
72521
72522
72523
72524
72525
72526
72527
72528
72529
72530
72531
72532
72533
72534
72535
72536
72537
72538
72539
72540
72541
72542
72543
72544
72545
72546
72547
72548
72549
72550
72551
72552
72553
72554
72555
72556
72557
72558
72559
72560
72561
72562
72563
72564
72565
72566
72567
72568
72569
72570
72571
72572
72573
72574
72575
72576
72577
72578
72579
72580
72581
72582
72583
72584
72585
72586
72587
72588
72589
72590
72591
72592
72593
72594
72595
72596
72597
72598
72599
72600
72601
72602
72603
72604
72605
72606
72607
72608
72609
72610
72611
72612
72613
72614
72615
72616
72617
72618
72619
72620
72621
72622
72623
72624
72625
72626
72627
72628
72629
72630
72631
72632
72633
72634
72635
72636
72637
72638
72639
72640
72641
72642
72643
72644
72645
72646
72647
72648
72649
72650
72651
72652
72653
72654
72655
72656
72657
72658
72659
72660
72661
72662
72663
72664
72665
72666
72667
72668
72669
72670
72671
72672
72673
72674
72675
72676
72677
72678
72679
72680
72681
72682
72683
72684
72685
72686
72687
72688
72689
72690
72691
72692
72693
72694
72695
72696
72697
72698
72699
72700
72701
72702
72703
72704
72705
72706
72707
72708
72709
72710
72711
72712
72713
72714
72715
72716
72717
72718
72719
72720
72721
72722
72723
72724
72725
72726
72727
72728
72729
72730
72731
72732
72733
72734
72735
72736
72737
72738
72739
72740
72741
72742
72743
72744
72745
72746
72747
72748
72749
72750
72751
72752
72753
72754
72755
72756
72757
72758
72759
72760
72761
72762
72763
72764
72765
72766
72767
72768
72769
72770
72771
72772
72773
72774
72775
72776
72777
72778
72779
72780
72781
72782
72783
72784
72785
72786
72787
72788
72789
72790
72791
72792
72793
72794
72795
72796
72797
72798
72799
72800
72801
72802
72803
72804
72805
72806
72807
72808
72809
72810
72811
72812
72813
72814
72815
72816
72817
72818
72819
72820
72821
72822
72823
72824
72825
72826
72827
72828
72829
72830
72831
72832
72833
72834
72835
72836
72837
72838
72839
72840
72841
72842
72843
72844
72845
72846
72847
72848
72849
72850
72851
72852
72853
72854
72855
72856
72857
72858
72859
72860
72861
72862
72863
72864
72865
72866
72867
72868
72869
72870
72871
72872
72873
72874
72875
72876
72877
72878
72879
72880
72881
72882
72883
72884
72885
72886
72887
72888
72889
72890
72891
72892
72893
72894
72895
72896
72897
72898
72899
72900
72901
72902
72903
72904
72905
72906
72907
72908
72909
72910
72911
72912
72913
72914
72915
72916
72917
72918
72919
72920
72921
72922
72923
72924
72925
72926
72927
72928
72929
72930
72931
72932
72933
72934
72935
72936
72937
72938
72939
72940
72941
72942
72943
72944
72945
72946
72947
72948
72949
72950
72951
72952
72953
72954
72955
72956
72957
72958
72959
72960
72961
72962
72963
72964
72965
72966
72967
72968
72969
72970
72971
72972
72973
72974
72975
72976
72977
72978
72979
72980
72981
72982
72983
72984
72985
72986
72987
72988
72989
72990
72991
72992
72993
72994
72995
72996
72997
72998
72999
73000
73001
73002
73003
73004
73005
73006
73007
73008
73009
73010
73011
73012
73013
73014
73015
73016
73017
73018
73019
73020
73021
73022
73023
73024
73025
73026
73027
73028
73029
73030
73031
73032
73033
73034
73035
73036
73037
73038
73039
73040
73041
73042
73043
73044
73045
73046
73047
73048
73049
73050
73051
73052
73053
73054
73055
73056
73057
73058
73059
73060
73061
73062
73063
73064
73065
73066
73067
73068
73069
73070
73071
73072
73073
73074
73075
73076
73077
73078
73079
73080
73081
73082
73083
73084
73085
73086
73087
73088
73089
73090
73091
73092
73093
73094
73095
73096
73097
73098
73099
73100
73101
73102
73103
73104
73105
73106
73107
73108
73109
73110
73111
73112
73113
73114
73115
73116
73117
73118
73119
73120
73121
73122
73123
73124
73125
73126
73127
73128
73129
73130
73131
73132
73133
73134
73135
73136
73137
73138
73139
73140
73141
73142
73143
73144
73145
73146
73147
73148
73149
73150
73151
73152
73153
73154
73155
73156
73157
73158
73159
73160
73161
73162
73163
73164
73165
73166
73167
73168
73169
73170
73171
73172
73173
73174
73175
73176
73177
73178
73179
73180
73181
73182
73183
73184
73185
73186
73187
73188
73189
73190
73191
73192
73193
73194
73195
73196
73197
73198
73199
73200
73201
73202
73203
73204
73205
73206
73207
73208
73209
73210
73211
73212
73213
73214
73215
73216
73217
73218
73219
73220
73221
73222
73223
73224
73225
73226
73227
73228
73229
73230
73231
73232
73233
73234
73235
73236
73237
73238
73239
73240
73241
73242
73243
73244
73245
73246
73247
73248
73249
73250
73251
73252
73253
73254
73255
73256
73257
73258
73259
73260
73261
73262
73263
73264
73265
73266
73267
73268
73269
73270
73271
73272
73273
73274
73275
73276
73277
73278
73279
73280
73281
73282
73283
73284
73285
73286
73287
73288
73289
73290
73291
73292
73293
73294
73295
73296
73297
73298
73299
73300
73301
73302
73303
73304
73305
73306
73307
73308
73309
73310
73311
73312
73313
73314
73315
73316
73317
73318
73319
73320
73321
73322
73323
73324
73325
73326
73327
73328
73329
73330
73331
73332
73333
73334
73335
73336
73337
73338
73339
73340
73341
73342
73343
73344
73345
73346
73347
73348
73349
73350
73351
73352
73353
73354
73355
73356
73357
73358
73359
73360
73361
73362
73363
73364
73365
73366
73367
73368
73369
73370
73371
73372
73373
73374
73375
73376
73377
73378
73379
73380
73381
73382
73383
73384
73385
73386
73387
73388
73389
73390
73391
73392
73393
73394
73395
73396
73397
73398
73399
73400
73401
73402
73403
73404
73405
73406
73407
73408
73409
73410
73411
73412
73413
73414
73415
73416
73417
73418
73419
73420
73421
73422
73423
73424
73425
73426
73427
73428
73429
73430
73431
73432
73433
73434
73435
73436
73437
73438
73439
73440
73441
73442
73443
73444
73445
73446
73447
73448
73449
73450
73451
73452
73453
73454
73455
73456
73457
73458
73459
73460
73461
73462
73463
73464
73465
73466
73467
73468
73469
73470
73471
73472
73473
73474
73475
73476
73477
73478
73479
73480
73481
73482
73483
73484
73485
73486
73487
73488
73489
73490
73491
73492
73493
73494
73495
73496
73497
73498
73499
73500
73501
73502
73503
73504
73505
73506
73507
73508
73509
73510
73511
73512
73513
73514
73515
73516
73517
73518
73519
73520
73521
73522
73523
73524
73525
73526
73527
73528
73529
73530
73531
73532
73533
73534
73535
73536
73537
73538
73539
73540
73541
73542
73543
73544
73545
73546
73547
73548
73549
73550
73551
73552
73553
73554
73555
73556
73557
73558
73559
73560
73561
73562
73563
73564
73565
73566
73567
73568
73569
73570
73571
73572
73573
73574
73575
73576
73577
73578
73579
73580
73581
73582
73583
73584
73585
73586
73587
73588
73589
73590
73591
73592
73593
73594
73595
73596
73597
73598
73599
73600
73601
73602
73603
73604
73605
73606
73607
73608
73609
73610
73611
73612
73613
73614
73615
73616
73617
73618
73619
73620
73621
73622
73623
73624
73625
73626
73627
73628
73629
73630
73631
73632
73633
73634
73635
73636
73637
73638
73639
73640
73641
73642
73643
73644
73645
73646
73647
73648
73649
73650
73651
73652
73653
73654
73655
73656
73657
73658
73659
73660
73661
73662
73663
73664
73665
73666
73667
73668
73669
73670
73671
73672
73673
73674
73675
73676
73677
73678
73679
73680
73681
73682
73683
73684
73685
73686
73687
73688
73689
73690
73691
73692
73693
73694
73695
73696
73697
73698
73699
73700
73701
73702
73703
73704
73705
73706
73707
73708
73709
73710
73711
73712
73713
73714
73715
73716
73717
73718
73719
73720
73721
73722
73723
73724
73725
73726
73727
73728
73729
73730
73731
73732
73733
73734
73735
73736
73737
73738
73739
73740
73741
73742
73743
73744
73745
73746
73747
73748
73749
73750
73751
73752
73753
73754
73755
73756
73757
73758
73759
73760
73761
73762
73763
73764
73765
73766
73767
73768
73769
73770
73771
73772
73773
73774
73775
73776
73777
73778
73779
73780
73781
73782
73783
73784
73785
73786
73787
73788
73789
73790
73791
73792
73793
73794
73795
73796
73797
73798
73799
73800
73801
73802
73803
73804
73805
73806
73807
73808
73809
73810
73811
73812
73813
73814
73815
73816
73817
73818
73819
73820
73821
73822
73823
73824
73825
73826
73827
73828
73829
73830
73831
73832
73833
73834
73835
73836
73837
73838
73839
73840
73841
73842
73843
73844
73845
73846
73847
73848
73849
73850
73851
73852
73853
73854
73855
73856
73857
73858
73859
73860
73861
73862
73863
73864
73865
73866
73867
73868
73869
73870
73871
73872
73873
73874
73875
73876
73877
73878
73879
73880
73881
73882
73883
73884
73885
73886
73887
73888
73889
73890
73891
73892
73893
73894
73895
73896
73897
73898
73899
73900
73901
73902
73903
73904
73905
73906
73907
73908
73909
73910
73911
73912
73913
73914
73915
73916
73917
73918
73919
73920
73921
73922
73923
73924
73925
73926
73927
73928
73929
73930
73931
73932
73933
73934
73935
73936
73937
73938
73939
73940
73941
73942
73943
73944
73945
73946
73947
73948
73949
73950
73951
73952
73953
73954
73955
73956
73957
73958
73959
73960
73961
73962
73963
73964
73965
73966
73967
73968
73969
73970
73971
73972
73973
73974
73975
73976
73977
73978
73979
73980
73981
73982
73983
73984
73985
73986
73987
73988
73989
73990
73991
73992
73993
73994
73995
73996
73997
73998
73999
74000
74001
74002
74003
74004
74005
74006
74007
74008
74009
74010
74011
74012
74013
74014
74015
74016
74017
74018
74019
74020
74021
74022
74023
74024
74025
74026
74027
74028
74029
74030
74031
74032
74033
74034
74035
74036
74037
74038
74039
74040
74041
74042
74043
74044
74045
74046
74047
74048
74049
74050
74051
74052
74053
74054
74055
74056
74057
74058
74059
74060
74061
74062
74063
74064
74065
74066
74067
74068
74069
74070
74071
74072
74073
74074
74075
74076
74077
74078
74079
74080
74081
74082
74083
74084
74085
74086
74087
74088
74089
74090
74091
74092
74093
74094
74095
74096
74097
74098
74099
74100
74101
74102
74103
74104
74105
74106
74107
74108
74109
74110
74111
74112
74113
74114
74115
74116
74117
74118
74119
74120
74121
74122
74123
74124
74125
74126
74127
74128
74129
74130
74131
74132
74133
74134
74135
74136
74137
74138
74139
74140
74141
74142
74143
74144
74145
74146
74147
74148
74149
74150
74151
74152
74153
74154
74155
74156
74157
74158
74159
74160
74161
74162
74163
74164
74165
74166
74167
74168
74169
74170
74171
74172
74173
74174
74175
74176
74177
74178
74179
74180
74181
74182
74183
74184
74185
74186
74187
74188
74189
74190
74191
74192
74193
74194
74195
74196
74197
74198
74199
74200
74201
74202
74203
74204
74205
74206
74207
74208
74209
74210
74211
74212
74213
74214
74215
74216
74217
74218
74219
74220
74221
74222
74223
74224
74225
74226
74227
74228
74229
74230
74231
74232
74233
74234
74235
74236
74237
74238
74239
74240
74241
74242
74243
74244
74245
74246
74247
74248
74249
74250
74251
74252
74253
74254
74255
74256
74257
74258
74259
74260
74261
74262
74263
74264
74265
74266
74267
74268
74269
74270
74271
74272
74273
74274
74275
74276
74277
74278
74279
74280
74281
74282
74283
74284
74285
74286
74287
74288
74289
74290
74291
74292
74293
74294
74295
74296
74297
74298
74299
74300
74301
74302
74303
74304
74305
74306
74307
74308
74309
74310
74311
74312
74313
74314
74315
74316
74317
74318
74319
74320
74321
74322
74323
74324
74325
74326
74327
74328
74329
74330
74331
74332
74333
74334
74335
74336
74337
74338
74339
74340
74341
74342
74343
74344
74345
74346
74347
74348
74349
74350
74351
74352
74353
74354
74355
74356
74357
74358
74359
74360
74361
74362
74363
74364
74365
74366
74367
74368
74369
74370
74371
74372
74373
74374
74375
74376
74377
74378
74379
74380
74381
74382
74383
74384
74385
74386
74387
74388
74389
74390
74391
74392
74393
74394
74395
74396
74397
74398
74399
74400
74401
74402
74403
74404
74405
74406
74407
74408
74409
74410
74411
74412
74413
74414
74415
74416
74417
74418
74419
74420
74421
74422
74423
74424
74425
74426
74427
74428
74429
74430
74431
74432
74433
74434
74435
74436
74437
74438
74439
74440
74441
74442
74443
74444
74445
74446
74447
74448
74449
74450
74451
74452
74453
74454
74455
74456
74457
74458
74459
74460
74461
74462
74463
74464
74465
74466
74467
74468
74469
74470
74471
74472
74473
74474
74475
74476
74477
74478
74479
74480
74481
74482
74483
74484
74485
74486
74487
74488
74489
74490
74491
74492
74493
74494
74495
74496
74497
74498
74499
74500
74501
74502
74503
74504
74505
74506
74507
74508
74509
74510
74511
74512
74513
74514
74515
74516
74517
74518
74519
74520
74521
74522
74523
74524
74525
74526
74527
74528
74529
74530
74531
74532
74533
74534
74535
74536
74537
74538
74539
74540
74541
74542
74543
74544
74545
74546
74547
74548
74549
74550
74551
74552
74553
74554
74555
74556
74557
74558
74559
74560
74561
74562
74563
74564
74565
74566
74567
74568
74569
74570
74571
74572
74573
74574
74575
74576
74577
74578
74579
74580
74581
74582
74583
74584
74585
74586
74587
74588
74589
74590
74591
74592
74593
74594
74595
74596
74597
74598
74599
74600
74601
74602
74603
74604
74605
74606
74607
74608
74609
74610
74611
74612
74613
74614
74615
74616
74617
74618
74619
74620
74621
74622
74623
74624
74625
74626
74627
74628
74629
74630
74631
74632
74633
74634
74635
74636
74637
74638
74639
74640
74641
74642
74643
74644
74645
74646
74647
74648
74649
74650
74651
74652
74653
74654
74655
74656
74657
74658
74659
74660
74661
74662
74663
74664
74665
74666
74667
74668
74669
74670
74671
74672
74673
74674
74675
74676
74677
74678
74679
74680
74681
74682
74683
74684
74685
74686
74687
74688
74689
74690
74691
74692
74693
74694
74695
74696
74697
74698
74699
74700
74701
74702
74703
74704
74705
74706
74707
74708
74709
74710
74711
74712
74713
74714
74715
74716
74717
74718
74719
74720
74721
74722
74723
74724
74725
74726
74727
74728
74729
74730
74731
74732
74733
74734
74735
74736
74737
74738
74739
74740
74741
74742
74743
74744
74745
74746
74747
74748
74749
74750
74751
74752
74753
74754
74755
74756
74757
74758
74759
74760
74761
74762
74763
74764
74765
74766
74767
74768
74769
74770
74771
74772
74773
74774
74775
74776
74777
74778
74779
74780
74781
74782
74783
74784
74785
74786
74787
74788
74789
74790
74791
74792
74793
74794
74795
74796
74797
74798
74799
74800
74801
74802
74803
74804
74805
74806
74807
74808
74809
74810
74811
74812
74813
74814
74815
74816
74817
74818
74819
74820
74821
74822
74823
74824
74825
74826
74827
74828
74829
74830
74831
74832
74833
74834
74835
74836
74837
74838
74839
74840
74841
74842
74843
74844
74845
74846
74847
74848
74849
74850
74851
74852
74853
74854
74855
74856
74857
74858
74859
74860
74861
74862
74863
74864
74865
74866
74867
74868
74869
74870
74871
74872
74873
74874
74875
74876
74877
74878
74879
74880
74881
74882
74883
74884
74885
74886
74887
74888
74889
74890
74891
74892
74893
74894
74895
74896
74897
74898
74899
74900
74901
74902
74903
74904
74905
74906
74907
74908
74909
74910
74911
74912
74913
74914
74915
74916
74917
74918
74919
74920
74921
74922
74923
74924
74925
74926
74927
74928
74929
74930
74931
74932
74933
74934
74935
74936
74937
74938
74939
74940
74941
74942
74943
74944
74945
74946
74947
74948
74949
74950
74951
74952
74953
74954
74955
74956
74957
74958
74959
74960
74961
74962
74963
74964
74965
74966
74967
74968
74969
74970
74971
74972
74973
74974
74975
74976
74977
74978
74979
74980
74981
74982
74983
74984
74985
74986
74987
74988
74989
74990
74991
74992
74993
74994
74995
74996
74997
74998
74999
75000
75001
75002
75003
75004
75005
75006
75007
75008
75009
75010
75011
75012
75013
75014
75015
75016
75017
75018
75019
75020
75021
75022
75023
75024
75025
75026
75027
75028
75029
75030
75031
75032
75033
75034
75035
75036
75037
75038
75039
75040
75041
75042
75043
75044
75045
75046
75047
75048
75049
75050
75051
75052
75053
75054
75055
75056
75057
75058
75059
75060
75061
75062
75063
75064
75065
75066
75067
75068
75069
75070
75071
75072
75073
75074
75075
75076
75077
75078
75079
75080
75081
75082
75083
75084
75085
75086
75087
75088
75089
75090
75091
75092
75093
75094
75095
75096
75097
75098
75099
75100
75101
75102
75103
75104
75105
75106
75107
75108
75109
75110
75111
75112
75113
75114
75115
75116
75117
75118
75119
75120
75121
75122
75123
75124
75125
75126
75127
75128
75129
75130
75131
75132
75133
75134
75135
75136
75137
75138
75139
75140
75141
75142
75143
75144
75145
75146
75147
75148
75149
75150
75151
75152
75153
75154
75155
75156
75157
75158
75159
75160
75161
75162
75163
75164
75165
75166
75167
75168
75169
75170
75171
75172
75173
75174
75175
75176
75177
75178
75179
75180
75181
75182
75183
75184
75185
75186
75187
75188
75189
75190
75191
75192
75193
75194
75195
75196
75197
75198
75199
75200
75201
75202
75203
75204
75205
75206
75207
75208
75209
75210
75211
75212
75213
75214
75215
75216
75217
75218
75219
75220
75221
75222
75223
75224
75225
75226
75227
75228
75229
75230
75231
75232
75233
75234
75235
75236
75237
75238
75239
75240
75241
75242
75243
75244
75245
75246
75247
75248
75249
75250
75251
75252
75253
75254
75255
75256
75257
75258
75259
75260
75261
75262
75263
75264
75265
75266
75267
75268
75269
75270
75271
75272
75273
75274
75275
75276
75277
75278
75279
75280
75281
75282
75283
75284
75285
75286
75287
75288
75289
75290
75291
75292
75293
75294
75295
75296
75297
75298
75299
75300
75301
75302
75303
75304
75305
75306
75307
75308
75309
75310
75311
75312
75313
75314
75315
75316
75317
75318
75319
75320
75321
75322
75323
75324
75325
75326
75327
75328
75329
75330
75331
75332
75333
75334
75335
75336
75337
75338
75339
75340
75341
75342
75343
75344
75345
75346
75347
75348
75349
75350
75351
75352
75353
75354
75355
75356
75357
75358
75359
75360
75361
75362
75363
75364
75365
75366
75367
75368
75369
75370
75371
75372
75373
75374
75375
75376
75377
75378
75379
75380
75381
75382
75383
75384
75385
75386
75387
75388
75389
75390
75391
75392
75393
75394
75395
75396
75397
75398
75399
75400
75401
75402
75403
75404
75405
75406
75407
75408
75409
75410
75411
75412
75413
75414
75415
75416
75417
75418
75419
75420
75421
75422
75423
75424
75425
75426
75427
75428
75429
75430
75431
75432
75433
75434
75435
75436
75437
75438
75439
75440
75441
75442
75443
75444
75445
75446
75447
75448
75449
75450
75451
75452
75453
75454
75455
75456
75457
75458
75459
75460
75461
75462
75463
75464
75465
75466
75467
75468
75469
75470
75471
75472
75473
75474
75475
75476
75477
75478
75479
75480
75481
75482
75483
75484
75485
75486
75487
75488
75489
75490
75491
75492
75493
75494
75495
75496
75497
75498
75499
75500
75501
75502
75503
75504
75505
75506
75507
75508
75509
75510
75511
75512
75513
75514
75515
75516
75517
75518
75519
75520
75521
75522
75523
75524
75525
75526
75527
75528
75529
75530
75531
75532
75533
75534
75535
75536
75537
75538
75539
75540
75541
75542
75543
75544
75545
75546
75547
75548
75549
75550
75551
75552
75553
75554
75555
75556
75557
75558
75559
75560
75561
75562
75563
75564
75565
75566
75567
75568
75569
75570
75571
75572
75573
75574
75575
75576
75577
75578
75579
75580
75581
75582
75583
75584
75585
75586
75587
75588
75589
75590
75591
75592
75593
75594
75595
75596
75597
75598
75599
75600
75601
75602
75603
75604
75605
75606
75607
75608
75609
75610
75611
75612
75613
75614
75615
75616
75617
75618
75619
75620
75621
75622
75623
75624
75625
75626
75627
75628
75629
75630
75631
75632
75633
75634
75635
75636
75637
75638
75639
75640
75641
75642
75643
75644
75645
75646
75647
75648
75649
75650
75651
75652
75653
75654
75655
75656
75657
75658
75659
75660
75661
75662
75663
75664
75665
75666
75667
75668
75669
75670
75671
75672
75673
75674
75675
75676
75677
75678
75679
75680
75681
75682
75683
75684
75685
75686
75687
75688
75689
75690
75691
75692
75693
75694
75695
75696
75697
75698
75699
75700
75701
75702
75703
75704
75705
75706
75707
75708
75709
75710
75711
75712
75713
75714
75715
75716
75717
75718
75719
75720
75721
75722
75723
75724
75725
75726
75727
75728
75729
75730
75731
75732
75733
75734
75735
75736
75737
75738
75739
75740
75741
75742
75743
75744
75745
75746
75747
75748
75749
75750
75751
75752
75753
75754
75755
75756
75757
75758
75759
75760
75761
75762
75763
75764
75765
75766
75767
75768
75769
75770
75771
75772
75773
75774
75775
75776
75777
75778
75779
75780
75781
75782
75783
75784
75785
75786
75787
75788
75789
75790
75791
75792
75793
75794
75795
75796
75797
75798
75799
75800
75801
75802
75803
75804
75805
75806
75807
75808
75809
75810
75811
75812
75813
75814
75815
75816
75817
75818
75819
75820
75821
75822
75823
75824
75825
75826
75827
75828
75829
75830
75831
75832
75833
75834
75835
75836
75837
75838
75839
75840
75841
75842
75843
75844
75845
75846
75847
75848
75849
75850
75851
75852
75853
75854
75855
75856
75857
75858
75859
75860
75861
75862
75863
75864
75865
75866
75867
75868
75869
75870
75871
75872
75873
75874
75875
75876
75877
75878
75879
75880
75881
75882
75883
75884
75885
75886
75887
75888
75889
75890
75891
75892
75893
75894
75895
75896
75897
75898
75899
75900
75901
75902
75903
75904
75905
75906
75907
75908
75909
75910
75911
75912
75913
75914
75915
75916
75917
75918
75919
75920
75921
75922
75923
75924
75925
75926
75927
75928
75929
75930
75931
75932
75933
75934
75935
75936
75937
75938
75939
75940
75941
75942
75943
75944
75945
75946
75947
75948
75949
75950
75951
75952
75953
75954
75955
75956
75957
75958
75959
75960
75961
75962
75963
75964
75965
75966
75967
75968
75969
75970
75971
75972
75973
75974
75975
75976
75977
75978
75979
75980
75981
75982
75983
75984
75985
75986
75987
75988
75989
75990
75991
75992
75993
75994
75995
75996
75997
75998
75999
76000
76001
76002
76003
76004
76005
76006
76007
76008
76009
76010
76011
76012
76013
76014
76015
76016
76017
76018
76019
76020
76021
76022
76023
76024
76025
76026
76027
76028
76029
76030
76031
76032
76033
76034
76035
76036
76037
76038
76039
76040
76041
76042
76043
76044
76045
76046
76047
76048
76049
76050
76051
76052
76053
76054
76055
76056
76057
76058
76059
76060
76061
76062
76063
76064
76065
76066
76067
76068
76069
76070
76071
76072
76073
76074
76075
76076
76077
76078
76079
76080
76081
76082
76083
76084
76085
76086
76087
76088
76089
76090
76091
76092
76093
76094
76095
76096
76097
76098
76099
76100
76101
76102
76103
76104
76105
76106
76107
76108
76109
76110
76111
76112
76113
76114
76115
76116
76117
76118
76119
76120
76121
76122
76123
76124
76125
76126
76127
76128
76129
76130
76131
76132
76133
76134
76135
76136
76137
76138
76139
76140
76141
76142
76143
76144
76145
76146
76147
76148
76149
76150
76151
76152
76153
76154
76155
76156
76157
76158
76159
76160
76161
76162
76163
76164
76165
76166
76167
76168
76169
76170
76171
76172
76173
76174
76175
76176
76177
76178
76179
76180
76181
76182
76183
76184
76185
76186
76187
76188
76189
76190
76191
76192
76193
76194
76195
76196
76197
76198
76199
76200
76201
76202
76203
76204
76205
76206
76207
76208
76209
76210
76211
76212
76213
76214
76215
76216
76217
76218
76219
76220
76221
76222
76223
76224
76225
76226
76227
76228
76229
76230
76231
76232
76233
76234
76235
76236
76237
76238
76239
76240
76241
76242
76243
76244
76245
76246
76247
76248
76249
76250
76251
76252
76253
76254
76255
76256
76257
76258
76259
76260
76261
76262
76263
76264
76265
76266
76267
76268
76269
76270
76271
76272
76273
76274
76275
76276
76277
76278
76279
76280
76281
76282
76283
76284
76285
76286
76287
76288
76289
76290
76291
76292
76293
76294
76295
76296
76297
76298
76299
76300
76301
76302
76303
76304
76305
76306
76307
76308
76309
76310
76311
76312
76313
76314
76315
76316
76317
76318
76319
76320
76321
76322
76323
76324
76325
76326
76327
76328
76329
76330
76331
76332
76333
76334
76335
76336
76337
76338
76339
76340
76341
76342
76343
76344
76345
76346
76347
76348
76349
76350
76351
76352
76353
76354
76355
76356
76357
76358
76359
76360
76361
76362
76363
76364
76365
76366
76367
76368
76369
76370
76371
76372
76373
76374
76375
76376
76377
76378
76379
76380
76381
76382
76383
76384
76385
76386
76387
76388
76389
76390
76391
76392
76393
76394
76395
76396
76397
76398
76399
76400
76401
76402
76403
76404
76405
76406
76407
76408
76409
76410
76411
76412
76413
76414
76415
76416
76417
76418
76419
76420
76421
76422
76423
76424
76425
76426
76427
76428
76429
76430
76431
76432
76433
76434
76435
76436
76437
76438
76439
76440
76441
76442
76443
76444
76445
76446
76447
76448
76449
76450
76451
76452
76453
76454
76455
76456
76457
76458
76459
76460
76461
76462
76463
76464
76465
76466
76467
76468
76469
76470
76471
76472
76473
76474
76475
76476
76477
76478
76479
76480
76481
76482
76483
76484
76485
76486
76487
76488
76489
76490
76491
76492
76493
76494
76495
76496
76497
76498
76499
76500
76501
76502
76503
76504
76505
76506
76507
76508
76509
76510
76511
76512
76513
76514
76515
76516
76517
76518
76519
76520
76521
76522
76523
76524
76525
76526
76527
76528
76529
76530
76531
76532
76533
76534
76535
76536
76537
76538
76539
76540
76541
76542
76543
76544
76545
76546
76547
76548
76549
76550
76551
76552
76553
76554
76555
76556
76557
76558
76559
76560
76561
76562
76563
76564
76565
76566
76567
76568
76569
76570
76571
76572
76573
76574
76575
76576
76577
76578
76579
76580
76581
76582
76583
76584
76585
76586
76587
76588
76589
76590
76591
76592
76593
76594
76595
76596
76597
76598
76599
76600
76601
76602
76603
76604
76605
76606
76607
76608
76609
76610
76611
76612
76613
76614
76615
76616
76617
76618
76619
76620
76621
76622
76623
76624
76625
76626
76627
76628
76629
76630
76631
76632
76633
76634
76635
76636
76637
76638
76639
76640
76641
76642
76643
76644
76645
76646
76647
76648
76649
76650
76651
76652
76653
76654
76655
76656
76657
76658
76659
76660
76661
76662
76663
76664
76665
76666
76667
76668
76669
76670
76671
76672
76673
76674
76675
76676
76677
76678
76679
76680
76681
76682
76683
76684
76685
76686
76687
76688
76689
76690
76691
76692
76693
76694
76695
76696
76697
76698
76699
76700
76701
76702
76703
76704
76705
76706
76707
76708
76709
76710
76711
76712
76713
76714
76715
76716
76717
76718
76719
76720
76721
76722
76723
76724
76725
76726
76727
76728
76729
76730
76731
76732
76733
76734
76735
76736
76737
76738
76739
76740
76741
76742
76743
76744
76745
76746
76747
76748
76749
76750
76751
76752
76753
76754
76755
76756
76757
76758
76759
76760
76761
76762
76763
76764
76765
76766
76767
76768
76769
76770
76771
76772
76773
76774
76775
76776
76777
76778
76779
76780
76781
76782
76783
76784
76785
76786
76787
76788
76789
76790
76791
76792
76793
76794
76795
76796
76797
76798
76799
76800
76801
76802
76803
76804
76805
76806
76807
76808
76809
76810
76811
76812
76813
76814
76815
76816
76817
76818
76819
76820
76821
76822
76823
76824
76825
76826
76827
76828
76829
76830
76831
76832
76833
76834
76835
76836
76837
76838
76839
76840
76841
76842
76843
76844
76845
76846
76847
76848
76849
76850
76851
76852
76853
76854
76855
76856
76857
76858
76859
76860
76861
76862
76863
76864
76865
76866
76867
76868
76869
76870
76871
76872
76873
76874
76875
76876
76877
76878
76879
76880
76881
76882
76883
76884
76885
76886
76887
76888
76889
76890
76891
76892
76893
76894
76895
76896
76897
76898
76899
76900
76901
76902
76903
76904
76905
76906
76907
76908
76909
76910
76911
76912
76913
76914
76915
76916
76917
76918
76919
76920
76921
76922
76923
76924
76925
76926
76927
76928
76929
76930
76931
76932
76933
76934
76935
76936
76937
76938
76939
76940
76941
76942
76943
76944
76945
76946
76947
76948
76949
76950
76951
76952
76953
76954
76955
76956
76957
76958
76959
76960
76961
76962
76963
76964
76965
76966
76967
76968
76969
76970
76971
76972
76973
76974
76975
76976
76977
76978
76979
76980
76981
76982
76983
76984
76985
76986
76987
76988
76989
76990
76991
76992
76993
76994
76995
76996
76997
76998
76999
77000
77001
77002
77003
77004
77005
77006
77007
77008
77009
77010
77011
77012
77013
77014
77015
77016
77017
77018
77019
77020
77021
77022
77023
77024
77025
77026
77027
77028
77029
77030
77031
77032
77033
77034
77035
77036
77037
77038
77039
77040
77041
77042
77043
77044
77045
77046
77047
77048
77049
77050
77051
77052
77053
77054
77055
77056
77057
77058
77059
77060
77061
77062
77063
77064
77065
77066
77067
77068
77069
77070
77071
77072
77073
77074
77075
77076
77077
77078
77079
77080
77081
77082
77083
77084
77085
77086
77087
77088
77089
77090
77091
77092
77093
77094
77095
77096
77097
77098
77099
77100
77101
77102
77103
77104
77105
77106
77107
77108
77109
77110
77111
77112
77113
77114
77115
77116
77117
77118
77119
77120
77121
77122
77123
77124
77125
77126
77127
77128
77129
77130
77131
77132
77133
77134
77135
77136
77137
77138
77139
77140
77141
77142
77143
77144
77145
77146
77147
77148
77149
77150
77151
77152
77153
77154
77155
77156
77157
77158
77159
77160
77161
77162
77163
77164
77165
77166
77167
77168
77169
77170
77171
77172
77173
77174
77175
77176
77177
77178
77179
77180
77181
77182
77183
77184
77185
77186
77187
77188
77189
77190
77191
77192
77193
77194
77195
77196
77197
77198
77199
77200
77201
77202
77203
77204
77205
77206
77207
77208
77209
77210
77211
77212
77213
77214
77215
77216
77217
77218
77219
77220
77221
77222
77223
77224
77225
77226
77227
77228
77229
77230
77231
77232
77233
77234
77235
77236
77237
77238
77239
77240
77241
77242
77243
77244
77245
77246
77247
77248
77249
77250
77251
77252
77253
77254
77255
77256
77257
77258
77259
77260
77261
77262
77263
77264
77265
77266
77267
77268
77269
77270
77271
77272
77273
77274
77275
77276
77277
77278
77279
77280
77281
77282
77283
77284
77285
77286
77287
77288
77289
77290
77291
77292
77293
77294
77295
77296
77297
77298
77299
77300
77301
77302
77303
77304
77305
77306
77307
77308
77309
77310
77311
77312
77313
77314
77315
77316
77317
77318
77319
77320
77321
77322
77323
77324
77325
77326
77327
77328
77329
77330
77331
77332
77333
77334
77335
77336
77337
77338
77339
77340
77341
77342
77343
77344
77345
77346
77347
77348
77349
77350
77351
77352
77353
77354
77355
77356
77357
77358
77359
77360
77361
77362
77363
77364
77365
77366
77367
77368
77369
77370
77371
77372
77373
77374
77375
77376
77377
77378
77379
77380
77381
77382
77383
77384
77385
77386
77387
77388
77389
77390
77391
77392
77393
77394
77395
77396
77397
77398
77399
77400
77401
77402
77403
77404
77405
77406
77407
77408
77409
77410
77411
77412
77413
77414
77415
77416
77417
77418
77419
77420
77421
77422
77423
77424
77425
77426
77427
77428
77429
77430
77431
77432
77433
77434
77435
77436
77437
77438
77439
77440
77441
77442
77443
77444
77445
77446
77447
77448
77449
77450
77451
77452
77453
77454
77455
77456
77457
77458
77459
77460
77461
77462
77463
77464
77465
77466
77467
77468
77469
77470
77471
77472
77473
77474
77475
77476
77477
77478
77479
77480
77481
77482
77483
77484
77485
77486
77487
77488
77489
77490
77491
77492
77493
77494
77495
77496
77497
77498
77499
77500
77501
77502
77503
77504
77505
77506
77507
77508
77509
77510
77511
77512
77513
77514
77515
77516
77517
77518
77519
77520
77521
77522
77523
77524
77525
77526
77527
77528
77529
77530
77531
77532
77533
77534
77535
77536
77537
77538
77539
77540
77541
77542
77543
77544
77545
77546
77547
77548
77549
77550
77551
77552
77553
77554
77555
77556
77557
77558
77559
77560
77561
77562
77563
77564
77565
77566
77567
77568
77569
77570
77571
77572
77573
77574
77575
77576
77577
77578
77579
77580
77581
77582
77583
77584
77585
77586
77587
77588
77589
77590
77591
77592
77593
77594
77595
77596
77597
77598
77599
77600
77601
77602
77603
77604
77605
77606
77607
77608
77609
77610
77611
77612
77613
77614
77615
77616
77617
77618
77619
77620
77621
77622
77623
77624
77625
77626
77627
77628
77629
77630
77631
77632
77633
77634
77635
77636
77637
77638
77639
77640
77641
77642
77643
77644
77645
77646
77647
77648
77649
77650
77651
77652
77653
77654
77655
77656
77657
77658
77659
77660
77661
77662
77663
77664
77665
77666
77667
77668
77669
77670
77671
77672
77673
77674
77675
77676
77677
77678
77679
77680
77681
77682
77683
77684
77685
77686
77687
77688
77689
77690
77691
77692
77693
77694
77695
77696
77697
77698
77699
77700
77701
77702
77703
77704
77705
77706
77707
77708
77709
77710
77711
77712
77713
77714
77715
77716
77717
77718
77719
77720
77721
77722
77723
77724
77725
77726
77727
77728
77729
77730
77731
77732
77733
77734
77735
77736
77737
77738
77739
77740
77741
77742
77743
77744
77745
77746
77747
77748
77749
77750
77751
77752
77753
77754
77755
77756
77757
77758
77759
77760
77761
77762
77763
77764
77765
77766
77767
77768
77769
77770
77771
77772
77773
77774
77775
77776
77777
77778
77779
77780
77781
77782
77783
77784
77785
77786
77787
77788
77789
77790
77791
77792
77793
77794
77795
77796
77797
77798
77799
77800
77801
77802
77803
77804
77805
77806
77807
77808
77809
77810
77811
77812
77813
77814
77815
77816
77817
77818
77819
77820
77821
77822
77823
77824
77825
77826
77827
77828
77829
77830
77831
77832
77833
77834
77835
77836
77837
77838
77839
77840
77841
77842
77843
77844
77845
77846
77847
77848
77849
77850
77851
77852
77853
77854
77855
77856
77857
77858
77859
77860
77861
77862
77863
77864
77865
77866
77867
77868
77869
77870
77871
77872
77873
77874
77875
77876
77877
77878
77879
77880
77881
77882
77883
77884
77885
77886
77887
77888
77889
77890
77891
77892
77893
77894
77895
77896
77897
77898
77899
77900
77901
77902
77903
77904
77905
77906
77907
77908
77909
77910
77911
77912
77913
77914
77915
77916
77917
77918
2012-07-02  Daniel Veillard  <veillard@redhat.com>

	Release of libvirt-0.9.13
	* configure.ac docs/news.html.in libvirt.spec.in: new version and
	  documentation update
	* po/*.po*: updated and regenerated localizations

2012-06-30  Doug Goldstein  <cardoe@cardoe.com>

	virsh: Cleanup virsh -V output
	Fixed up virsh -V output by removing invalid WITH_PROXY & WITH_ONE
	checks, adding several missing checks, and fixing the DTrace check.

2012-06-30  Eric Blake  <eblake@redhat.com>

	build: use correct limit for unsigned long long
	Reported by Jason Helfman as a build-breaker on FreeBSD.

	* src/conf/domain_conf.c (virDomainFSDefParseXML): Use POSIX
	spelling.
	* src/openvz/openvz_conf.c (openvzReadFSConf): Likewise.

2012-06-30  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	nwfilter: Fix memory leak
	Below patch fixes this coverity report:

	/libvirt/src/conf/nwfilter_conf.c:382:
	leaked_storage: Variable "varAccess" going out of scope leaks the storage it points to.

2012-06-29  Daniel P. Berrange  <berrange@redhat.com>

	Remove sub-mounts under /dev when starting an LXC container
	Since we are mounting a new /dev in the container, we must
	remove any sub-mounts like /dev/shm, /dev/mqueue, etc,
	otherwise they'll be recorded in /proc/mounts, but not be
	accessible to applications.

2012-06-29  Eiichi Tsukata  <eiichi.tsukata.xh@hitachi.com>

	Fix vm's outbound traffic control problem
	Hello,

	This is a patch to fix vm's outbound traffic control problem.

	Currently, vm's outbound traffic control by libvirt doesn't go well.
	This problem was previously discussed at libvir-list ML, however
	it seems that there isn't still any answer to the problem.
	http://www.redhat.com/archives/libvir-list/2011-August/msg00333.html

	I measured Guest(with virtio-net) to Host TCP throughput with the
	command "netperf -H".
	Here are the outbound QoS parameters and the results.

	outbound average rate[kilobytes/s] : Guest to Host throughput[Mbit/s]
	======================================================================
	1024  (8Mbit/s)                    : 4.56
	2048  (16Mbit/s)                   : 3.29
	4096  (32Mbit/s)                   : 3.35
	8192  (64Mbit/s)                   : 3.95
	16384 (128Mbit/s)                  : 4.08
	32768 (256Mbit/s)                  : 3.94
	65536 (512Mbit/s)                  : 3.23

	The outbound traffic goes down unreasonably and is even not controled.

	The cause of this problem is too large mtu value in "tc filter" command run by
	libvirt. The command uses burst value to set mtu and the burst is equal to
	average rate value if it's not set. This value is too large. For example
	if the average rate is set to 1024 kilobytes/s, the mtu value is set to 1024
	kilobytes. That's too large compared to the size of network packets.
	Here libvirt applies tc ingress filter to Host's vnet(tun) device.
	Tc ingress filter is implemented with TBF(Token Buckets Filter) algorithm. TBF
	uses mtu value to calculate the amount of token consumed by each packet. With too
	large mtu value, the token consumption rate is set too large. This leads to
	token starvation and deterioration of TCP throughput.

	Then, should we use the default mtu value 2 kilobytes?
	The anser is No, because Guest with virtio-net device uses 65536 bytes
	as mtu to transmit packets to Host, and the tc filter with the default mtu
	value 2k drops packets whose size is larger than 2k. So, the most packets
	is droped and again leads to deterioration of TCP throughput.

	The appropriate mtu value is 65536 bytes which is equal to the maximum value
	of network interface device defined in <linux/netdevice.h>. The value is
	not so large that it causes token starvation and not so small that it
	drops most packets.
	Therefore this patch set the mtu value to 64kb(== 65535 bytes).

	Again, here are the outbound QoS parameters and the TCP throughput with
	the libvirt patched.

	outbound average rate[kilobytes/s] : Guest to Host throughput[Mbit/s]
	======================================================================
	1024  (8Mbit/s)                    : 8.22
	2048  (16Mbit/s)                   : 16.42
	4096  (32Mbit/s)                   : 32.93
	8192  (64Mbit/s)                   : 66.85
	16384 (128Mbit/s)                  : 133.88
	32768 (256Mbit/s)                  : 271.01
	65536 (512Mbit/s)                  : 547.32

	The outbound traffic conforms to the given limit.

	Thank you,

2012-06-29  Peter Krempa  <pkrempa@redhat.com>

	network_conf: Don't free uninitialized pointers while parsing DNS SRV
	If the user specified invalid protocol type in a network's SRV record
	the error path ended up in freeing uninitialized pointers causing a
	daemon crash.

	*network_conf.c: virNetworkDNSSrvDefParseXML(): initialize local
	                                                variables

2012-06-28  Peter Krempa  <pkrempa@redhat.com>

	conf: Don't shadow error from virGetDomain()
	virGetDomain() does a good job of reporting errors itself. This patch
	removes shadowing of that error in virDomainListPopulate().

	maint: include ignore-value in internal.h
	The ignore_value macro is used across libvirt. This patch includes it in
	the internal header and cleans all other includes.

2012-06-28  Peter Krempa  <pkrempa@redhat.com>

	vbox: Add support for virConnectListAllDomains()
	VirtualBox doesn't use the common virDomainObj implementation so this
	patch adds a separate implementation using the VirtualBox API.

	This driver implementation supports all currently defined flags. As
	VirtualBox does not support transient guests, managed save images and
	autostarting we assume all guests are persistent, don't have a managed
	save image and are not autostarted. Filtering for existence of those
	properities results in empty list.

2012-06-28  Osier Yang  <jyang@redhat.com>

	storage: Error out if the target is already mounted for netfs pool
	mnt_fsname can not be the same, as we check the duplicate pool
	sources earlier before, means it can't be the same pool, moreover,
	a pool can't be started if it's already active anyway. So no reason
	to act as success.

2012-06-28  Marc-André Lureau  <marcandre.lureau@gmail.com>

	configure: show correct default argument in help
	Pushed without ack, under the trivial rule.

2012-06-27  Michal Privoznik  <mprivozn@redhat.com>

	events: Don't fail on registering events for two different domains
	virConnectDomainEventRegisterAny() takes a domain as an argument.
	So it should be possible to register the same event (be it
	VIR_DOMAIN_EVENT_ID_LIFECYCLE for example) for two different domains.
	That is, we need to take domain into account when searching for
	duplicate event being already registered.

2012-06-27  Doug Goldstein  <cardoe@cardoe.com>

	virsh: Add domdisplay cmd for VNC, SPICE and RDP
	v2:
	- Refactored to use virBuffer
	- Refactored to use virXPath wrappers
	- Added support for tls-port and password for SPICE
	- Added optional flag to disable SPICE password to the URI
	- Added support for RDP
	- Fixed code reviews

	Add a new 'domdisplay' command that provides a URI for VNC, SPICE and
	RDP connections. Presently the 'vncdisplay' command provides you with
	the port info that QEMU is listening on but there is no counterpart for
	SPICE and RDP. Additionally this provides you with the bind address as
	specified in the XML, which the existing 'vncdisplay' lacks. For SPICE
	connections it supports secure and unsecure channels and optionally
	providing the password for the SPICE channel.

2012-06-27  Daniel P. Berrange  <berrange@redhat.com>

	Remove accidentally added Patch: lines from mingw-libvirt.spec.in

2012-06-27  Christophe Fergeau  <cfergeau@redhat.com>

	doc: fix typo in virDomainDestroy API doc

2012-06-27  Guido Günther  <agx@sigxcpu.org>

	Add /tools/libvirt-guests.service to .gitignore
	since it's an autogenerated file

	Don't install systemd service files executable
	since they aren't. Detected by Debian's lintian.

2012-06-25  Michal Privoznik  <mprivozn@redhat.com>

	AUTHORS: Update
	Latest patchset enabling libvirt on s390(x) was developed by
	  Viktor Mihajlovski   <mihajlov@linux.vnet.ibm.com>
	  Thang Pham           <thang.pham@us.ibm.com>
	Add them to the AUTHORS file.

2012-06-25  Thang Pham  <thang.pham@us.ibm.com>

	S390: Added sysinfo for host on s390(x).
	In order to retrieve some sysinfo data we need to parse /proc/sysinfo and
	/proc/cpuinfo.

2012-06-25  Viktor Mihajlovski  <mihajlov@linux.vnet.ibm.com>

	S390: Fixed core identification for s390
	For the s390x architecture the sysfs core_id alone is not unique. As a
	result it can happen that libvirt thinks there are less host CPUs available
	than really present.
	Currently, a logical CPU is equivalent to a core for s390x. We therefore
	produce a fake core id from the CPU number.

2012-06-25  Thang Pham  <thang.pham@us.ibm.com>

	S390: Fixed Parser for /proc/cpuinfo needs to be adapted for your architecture
	Minimal CPU "parser" for s390 to avoid compile time warning.

	S390: CPU support for s390(x)
	Adding CPU encoder/decoder for s390 to avoid runtime error messages.

2012-06-25  Viktor Mihajlovski  <mihajlov@linux.vnet.ibm.com>

	S390: Override QEMU_CAPS_NO_ACPI for s390x
	Starting a KVM guest on s390 fails immediately. This is because
	"qemu --help" reports -no-acpi even for the s390(x) architecture but
	-no-acpi isn't supported there.
	Workaround is to remove QEMU_CAPS_NO_ACPI from the capability set
	after the version/capability extraction.

2012-06-25  Wido den Hollander  <wido@widodh.nl>

	storage backend rbd: Do not prefix rbd: on volume names.
	We used to prefix 'rbd:' to volume names, this is not necessary.

	Qemu takes RBD devices in this way, like: qemu -drive rbd:pool/image

	When attaching a network disk like RBD to a guest we however do not use this prefix.

	Currently you can't map a RBD volume name directly to a domain without removing the prefix.

2012-06-25  Osier Yang  <jyang@redhat.com>

	qemu: Improve error if setmem fails for lacking of balloon support
	"cannot set memory of an active domain" is misleading, it sounds
	like setting memory of active domain is not supported.

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

	Include the default listen address in the live guest XML
	If no 'listen' attribute or <listen> element is set in the
	guest XML, the default driver configured listen address is
	used. There is no way to client applications to determine
	what this address is though. When starting the guest, we
	should update the live XML to include this default listen
	address

2012-06-25  Michal Privoznik  <mprivozn@redhat.com>

	storage: Introduce --inactive for pool-dumpxml
	Storage is one of the last domains in libvirt where we don't fully
	utilize inactive and live XML. Okay, it might be because we don't
	have support for that. So implement such support. However, we need
	to fallback when talking to old daemon which doesn't support this
	new flag called VIR_STORAGE_XML_INACTIVE.

	storage: Switch to new def on pool-destroy
	Currently, we share the idea of old & new def with domains. Users can
	*-edit an object (domain, pool) which spawns a new internal
	representation for them. This is referenced via
	{domainObj,poolObj}->newDef [compared to ->def]. However, for pool we
	were never overwriting def with newDef. This must be done on
	pool-destroy (like we do analogically in domain detroy).

	sanlock: Properly indent
	One of latest patches (0fce94fe) didn't properly indented #define
	making syntax-check fail.

2012-06-25  Daniel Veillard  <veillard@redhat.com>

	Fix compilation on older sanlock
	Temporary fix since compilation broke with older version of
	sanlock following acbd4965c44c4dbc676dfe89aff970052e376073

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

	Remove stray debug fprintf in XML parser

2012-06-25  Daniel J Walsh  <dwalsh@redhat.com>

	Support bind mounting host files, as well as directories in LXC
	Currently libvirt-lxc checks to see if the destination exists and is a
	directory.  If it is not a directory then the mount fails.  Since
	libvirt-lxc can bind mount files on an inode, this patch is needed to
	allow us to bind mount files on files.  Currently we want to bind mount
	on top of /etc/machine-id, and /etc/adjtime

	If the destination of the mount point does not exists, it checks if the
	src is a directory and then attempts to create a directory, otherwise it
	creates an empty file for the destination.  The code will then bind mount
	over the destination.

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

	Allow NOCONFIGURE=1 to make autogen.sh skip ./configure
	Sometimes it is useful to re-bootstrap libvirt without running
	through a ./configure invocation immediately. eg if you want
	to run ./configure for Mingw32 rather than native.

	Fix unused parameters / functions in virsh on Win32
	The vshPrintRaw function is not used on Win32, and neither
	is the 'msg' parameter of vshAskReedit. Change the nesting
	of #ifdef WIN32 conditionals to address this

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

	Update to latest GNULIB to fix compat with Mingw64 toolchain
	On both x86_64-w64-mingw32 and i686-w64-mingw32 there were
	the following warnings/errors:

	  CC     fstat.lo
	../../../gnulib/lib/fstat.c:27:0: warning: "stat" redefined [enabled by default]
	In file included from ./sys/stat.h:32:0,
	                 from ../../../gnulib/lib/fstat.c:25:
	/usr/x86_64-w64-mingw32/sys-root/mingw/include/sys/stat.h:258:0: note: this is the location of the previous definition
	../../../gnulib/lib/fstat.c:28:0: warning: "fstat" redefined [enabled by default]
	In file included from ./sys/stat.h:32:0,
	                 from ../../../gnulib/lib/fstat.c:25:
	/usr/x86_64-w64-mingw32/sys-root/mingw/include/sys/stat.h:259:0: note: this is the location of the previous definition

	  CC     stat.lo
	../../../gnulib/lib/stat.c:32:0: warning: "stat" redefined [enabled by default]
	In file included from ./sys/stat.h:32:0,
	                 from ../../../gnulib/lib/stat.c:27:
	/usr/x86_64-w64-mingw32/sys-root/mingw/include/sys/stat.h:258:0: note: this is the location of the previous definition

	  CC     stdio-read.lo
	../../../gnulib/lib/stdio-read.c:102:1: error: redefinition of 'vscanf'
	In file included from ./stdio.h:43:0,
	                 from ../../../gnulib/lib/stdio-read.c:21:
	/usr/x86_64-w64-mingw32/sys-root/mingw/include/stdio.h:397:7: note: previous definition of 'vscanf' was here
	../../../gnulib/lib/stdio-read.c:108:1: error: redefinition of 'vfscanf'
	In file included from ./stdio.h:43:0,
	                 from ../../../gnulib/lib/stdio-read.c:21:
	/usr/x86_64-w64-mingw32/sys-root/mingw/include/stdio.h:384:7: note: previous definition of 'vfscanf' was here
	make[3]: *** [stdio-read.lo] Error 1
	make[3]: Leaving directory `/home/berrange/src/virt/libvirt/build/gnulib/lib'

	While on x86_64-w64-mingw32 only there was:

	In file included from ../../../gnulib/lib/regex.c:69:0:
	../../../gnulib/lib/regcomp.c: In function 'parse_dup_op':
	../../../gnulib/lib/regcomp.c:2624:39: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
	../../../gnulib/lib/regcomp.c: In function 'mark_opt_subexp':
	../../../gnulib/lib/regcomp.c:3859:19: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]

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

	winsock2.h must always be included before windows.h
	Some GNULIB headers (eg unistd.h) will often need to include
	winsock2.h for various symbols. There is a rule that winsock2.h
	must be included before windows.h. This means that any file
	which does

	  #ifdef WIN32
	  #include <windows.h>
	  #endif
	  #include <unistd.h>

	is potentially broken. A simple rule is that /all/ includes of
	windows.h must be matched with a preceding include of winsock2.h
	regardless of whether unistd.h is used currently

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

	Switch automated builds to use Mingw64 toolchain instead of Mingw32
	The Mingw32 toolchain is broadly obsoleted by the Mingw64 toolchain.
	The latter has been adopted by Fedora 17 and newer. Maintaining a
	RPM spec for Mingw32 is a needless burden, so switch to a Mingw64
	RPM spec (which provides 32 & 64 bit builds).

2012-06-25  Doug Goldstein  <cardoe@cardoe.com>

	virsh: Use virXPath wrappers for vncdisplay cmd
	Update the vncdisplay command to use the virXPath wrappers as well as
	check if the domain is up rather than using the port set to -1 to mean
	the domain is not up.

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

	Add support for shared sanlock leases
	A sanlock lease can be marked as shared (rather
	than exclusive)  using SANLK_RES_SHARED flag. This
	adds support for that flag and ensures that in auto
	disk mode, any shared disks use shared leases. This
	also makes any read-only disks be completely
	ignored.

	These changes remove the need for the option

	  ignore_readonly_and_shared_disks

	so that is removed

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

	Add support for guest bind mounts with LXC
	Currently you can configure LXC to bind a host directory to
	a guest directory, but not to bind a guest directory to a
	guest directory. While the guest container init could do
	this itself, allowing it in the libvirt XML means a stricter
	SELinux policy can be written

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

	Add support for RAM filesystems for LXC
	Introduce a new syntax for filesystems to allow use of a RAM
	filesystem

	   <filesystem type='ram'>
	      <source usage='10' units='MiB'/>
	      <target dir='/mnt'/>
	   </filesystem>

	The usage units default to KiB to limit consumption of host memory.

	* docs/formatdomain.html.in: Document new syntax
	* docs/schemas/domaincommon.rng: Add new attributes
	* src/conf/domain_conf.c: Parsing/formatting of RAM filesystems
	* src/lxc/lxc_container.c: Mounting of RAM filesystems

2012-06-23  Hu Tao  <hutao@cn.fujitsu.com>

	fix a bug of ref count in virnetserver.c
	The test of ref count is not protected by lock, which is unsafe because
	the ref count may have been changed by other threads during the test.

	This patch fixes this.

2012-06-22  Peter Krempa  <pkrempa@redhat.com>

	virsh: Improve error when trying to change vm's cpu count 0
	This patch adds a check for the count of processors the user requests
	for the guest machine so that invalid values produce a more helpful
	error message.

2012-06-22  Jim Fehlig  <jfehlig@suse.com>

	Fix deadlock on libvirtd shutdown
	When shutting down libvirtd, the virNetServer shutdown can deadlock
	if there are in-flight jobs being handled by virNetServerHandleJob().
	virNetServerFree() will acquire the virNetServer lock and call
	virThreadPoolFree() to terminate the workers, waiting for the workers
	to finish.  But in-flight workers will attempt to acquire the
	virNetServer lock, resulting in deadlock.

	Fix the deadlock by unlocking the virNetServer lock before calling
	virThreadPoolFree().  This is safe since the virNetServerPtr object
	is ref-counted and only decrementing the ref count needs to be
	protected.  Additionally, there is no need to re-acquire the lock
	after virThreadPoolFree() completes as all the workers have
	terminated.

2012-06-21  Gerd Hoffmann  <kraxel@redhat.com>

	qemu: Add xhci support
	qemu 1.1 features a xhci controller,
	this patch adds support for it.

2012-06-21  Peter Krempa  <pkrempa@redhat.com>

	virsh: add support for virConnectListAllDomains and clean up cmdList
	This patch makes use of the newly added api virConnectListAllDomains()
	to list domains in virsh.

	Virsh now represents lists of domains using an internal structure
	vshDomainList. This structure contains the virDomainPtr list as provided
	by virConnectListAllDomains() and the count of domains in the list.

	For backwards compatibility, the function vshDomainListCollect was added
	that tries to enumerate the domains using the new API and if the API is
	not supported falls back to the older approach with the two list
	functions.  The helper function also simulates filtering by all
	currently supported flags added with virConnectListAllDomains().

	This patch also cleans up the "list" command handler to use the new
	helpers and adds new command line flags to make use of filtering.

2012-06-21  Peter Krempa  <pkrempa@redhat.com>

	virsh: Rename namesorter to vshNameSorter and clean up indentation

2012-06-21  Osier Yang  <jyang@redhat.com>

	util: Fix the indention
	src/util/util.c: virFileOpenAs.

2012-06-21  Jim Fehlig  <jfehlig@suse.com>

	Initialize random generator in lxc controller
	The lxc contoller eventually makes use of virRandomBits(), which was
	segfaulting since virRandomInitialize() is never invoked.

	Program received signal SIGSEGV, Segmentation fault.
	0x00007ffff554d560 in random_r () from /lib64/libc.so.6
	(gdb) bt
	0  0x00007ffff554d560 in random_r () from /lib64/libc.so.6
	1  0x0000000000469eaa in virRandomBits (nbits=32) at util/virrandom.c:80
	2  0x000000000045bf69 in virHashCreateFull (size=256,
	    dataFree=0x4aa2a2 <hashDataFree>, keyCode=0x45bd40 <virHashStrCode>,
	    keyEqual=0x45bdad <virHashStrEqual>, keyCopy=0x45bdfa <virHashStrCopy>,
	    keyFree=0x45be37 <virHashStrFree>) at util/virhash.c:134
	3  0x000000000045c069 in virHashCreate (size=0, dataFree=0x4aa2a2 <hashDataFree>)
	    at util/virhash.c:164
	4  0x00000000004aa562 in virNWFilterHashTableCreate (n=0)
	    at conf/nwfilter_params.c:686
	5  0x00000000004aa95b in virNWFilterParseParamAttributes (cur=0x711d30)
	    at conf/nwfilter_params.c:793
	6  0x0000000000481a7f in virDomainNetDefParseXML (caps=0x702c90, node=0x7116b0,
	    ctxt=0x7101b0, bootMap=0x0, flags=0) at conf/domain_conf.c:4589
	7  0x000000000048cc36 in virDomainDefParseXML (caps=0x702c90, xml=0x710040,
	    root=0x7103b0, ctxt=0x7101b0, expectedVirtTypes=16, flags=0)
	    at conf/domain_conf.c:8658
	8  0x000000000048f011 in virDomainDefParseNode (caps=0x702c90, xml=0x710040,
	    root=0x7103b0, expectedVirtTypes=16, flags=0) at conf/domain_conf.c:9360
	9  0x000000000048ee30 in virDomainDefParse (xmlStr=0x0,
	    filename=0x702ae0 "/var/run/libvirt/lxc/x.xml", caps=0x702c90,
	    expectedVirtTypes=16, flags=0) at conf/domain_conf.c:9310
	10 0x000000000048ef00 in virDomainDefParseFile (caps=0x702c90,
	    filename=0x702ae0 "/var/run/libvirt/lxc/x.xml", expectedVirtTypes=16, flags=0)
	    at conf/domain_conf.c:9332
	11 0x0000000000425053 in main (argc=5, argv=0x7fffffffe2b8)
	    at lxc/lxc_controller.c:1773

2012-06-21  Osier Yang  <jyang@redhat.com>

	storage: Set the perms if the pool target already exists for fs pools
	The comment says:

	/* Now create the final dir in the path with the uid/gid/mode
	 * requested in the config. If the dir already exists, just set
	 * the perms.
	 */

	However, virDirCreate is only invoked if the target path doesn't
	exist yet (which is opposite with the comment), or the uid from
	the config is not -1 (I don't understand why, think it's just
	another mistake). And the result is the perms of the pool won't
	be changed if one tries to build the pool with different perms
	again.

	Besides these logic error fix, if no uid and gid are specified in
	the config, the practical used uid, gid are reflected.

2012-06-21  Eric Blake  <eblake@redhat.com>

	snapshot: implement new APIs for esx and vbox
	The two new APIs are rather trivial; based on bits and pieces of
	other existing APIs.  But rather than blindly return 0 or 1 for
	HasMetadata, I chose to first validate that the snapshot in
	question in fact exists.

	* src/esx/esx_driver.c (esxDomainSnapshotIsCurrent)
	(esxDomainSnapshotHasMetadata): New functions.
	* src/vbox/vbox_tmpl.c (vboxDomainSnapshotIsCurrent)
	(vboxDomainSnapshotHasMetadata): Likewise.

2012-06-21  Eric Blake  <eblake@redhat.com>

	snapshot: require existence before returning success
	Blindly returning success is misleading if the object no longer
	exists; it is a bit better to check for existence up front before
	returning information about that object.  This pattern matches the
	fact that most of our other APIs check for existence as a side
	effect prior to getting at the real piece of information being
	queried.

	* src/esx/esx_driver.c (esxDomainIsUpdated, esxDomainIsPersistent):
	Add existence checks.
	* src/vbox/vbox_tmpl.c (vboxDomainIsPersistent)
	(vboxDomainIsUpdated): Likewise.

2012-06-20  Peter Krempa  <pkrempa@redhat.com>

	drivers: Implement virListAllDomains for drivers using virDomainObj
	This patch adds support for listing all domains into drivers that use
	the common virDomainObj implementation: libxl, lxc, openvz, qemu, test,
	uml, vmware.

	For drivers that don't support managed save images the guests are
	treated as if they had none, so filtering guests that do have such an
	image on this driver succeeds and produces 0 results.

2012-06-20  Guido Günther  <agx@sigxcpu.org>

	openvz: check pointer size instead of int
	since int is 4 bytes on both i386 and amd64.

2012-06-20  Dipankar Sarma  <dipankar@in.ibm.com>

	Fix default USB controller for ppc64
	Fix the default usb controller for pseries systems if none
	specified.

2012-06-20  Eric Blake  <eblake@redhat.com>

	list: add qemu snapshot list support
	The two new functions are very similar to the existing functions;
	just a matter of different arguments and a call to a different
	helper function.

	* src/qemu/qemu_driver.c (qemuDomainSnapshotListNames)
	(qemuDomainSnapshotNum, qemuDomainSnapshotListChildrenNames)
	(qemuDomainSnapshotNumChildren): Support new flags.
	(qemuDomainListAllSnapshots): New functions.

2012-06-20  Eric Blake  <eblake@redhat.com>

	list: new helper function to collect snapshots
	Wraps the conversion from 'char *name' to virDomainSnapshotPtr in
	a reusable manner.

	* src/conf/virdomainlist.h (virDomainListSnapshots): New declaration.
	* src/conf/virdomainlist.c (virDomainListSnapshots): Implement it.
	* src/libvirt_private.syms (virdomainlist.h): Export it.

2012-06-20  Eric Blake  <eblake@redhat.com>

	list: provide RPC call for snapshots
	The generator doesn't handle lists of virDomainSnapshotPtr, so
	this commit requires a bit more work than some RPC additions.

	* src/remote/remote_protocol.x
	(REMOTE_PROC_DOMAIN_LIST_ALL_SNAPSHOTS)
	(REMOTE_PROC_DOMAIN_SNAPSHOT_LIST_ALL_CHILDREN): New RPC calls,
	with corresponding structs.
	* daemon/remote.c (remoteDispatchDomainListAllSnapshots)
	(remoteDispatchDomainSnapshotListAllChildren): New functions.
	* src/remote/remote_driver.c (remoteDomainListAllSnapshots)
	(remoteDomainSnapshotListAllChildren): Likewise.
	* src/remote_protocol-structs: Regenerate.

2012-06-20  Eric Blake  <eblake@redhat.com>

	list: provide python bindings for snapshots
	This adds support for the new virDomainListAllSnapshots (a domain
	function) and virDomainSnapshotListAllChildren (a snapshot function)
	to the libvirt-python bindings.  The implementation is done manually
	as the generator does not support wrapping lists of C pointers into
	python objects.

	* python/libvirt-override.c (libvirt_virDomainListAllSnapshots)
	(libvirt_virDomainSnapshotListAllChildren): New functions.
	* python/libvirt-override-api.xml: Document them.
	* python/libvirt-override-virDomain.py (listAllSnapshots): New
	file.
	* python/libvirt-override-virDomainSnapshot.py (listAllChildren):
	Likewise.
	* python/Makefile.am (CLASSES_EXTRA): Ship them.

2012-06-20  Eric Blake  <eblake@redhat.com>

	list: use the new snapshot API in virsh when possible
	Using the new API is so much shorter than the rest of the remainder
	of the function.

	* tools/virsh.c (vshSnapshotList): Use the new API.

2012-06-20  Eric Blake  <eblake@redhat.com>

	list: add virDomainListAllSnapshots API
	There was an inherent race between virDomainSnapshotNum() and
	virDomainSnapshotListNames(), where an additional snapshot could
	be created in the meantime, or where a snapshot could be deleted
	before converting the name back to a virDomainSnapshotPtr.  It
	was also an awkward name: the function operates on domains, not
	domain snapshots.  virDomainSnapshotListChildrenNames() suffered
	from the same inherent race, although its naming was nicer.

	This patch makes things nicer by grabbing a snapshot list
	atomically, in the format most useful to the user.

	* include/libvirt/libvirt.h.in (virDomainListAllSnapshots)
	(virDomainSnapshotListAllChildren): New declarations.
	* src/libvirt.c (virDomainSnapshotListNames)
	(virDomainSnapshotListChildrenNames): Add cross-references.
	(virDomainListAllSnapshots, virDomainSnapshotListAllChildren):
	New functions.
	* src/libvirt_public.syms (LIBVIRT_0.9.13): Export them.
	* src/driver.h (virDrvDomainListAllSnapshots)
	(virDrvDomainSnapshotListAllChildren): New callbacks.
	* python/generator.py (skip_function): Prepare for later
	hand-written versions.

2012-06-20  Eric Blake  <eblake@redhat.com>

	snapshot: expose new flags in virsh
	Previously, to get the name of all snapshots with children, it was
	necessary to get the name of all snapshots and then remove the
	name of leaf snapshots.  This is racy, and somewhat inefficient
	compared to planned API additions.  We can emulate --no-metadata on
	0.9.5-0.9.12, but for now, there is no emulation of --no-leaves.

	* tools/virsh.c (cmdSnapshotList): Add new options --no-leaves and
	--no-metadata.
	(vshSnapshotList): Emulate where possible.
	* tools/virsh.pod (snapshot-list): Document them.

2012-06-20  Eric Blake  <eblake@redhat.com>

	snapshot: add additional filters when getting lists
	It turns out that one-bit filtering makes it hard to select the inverse
	set, so it is easier to provide filtering groups.  For back-compat,
	omitting all bits within a group means the group is not used for
	filtering, and by definition of a group (each snapshot matches exactly
	one bit within the group, and the set of bits in the group covers all
	snapshots), selecting all bits also makes the group useless.

	Unfortunately, virDomainSnapshotListChildren defined the bit
	VIR_DOMAIN_SNAPSHOT_LIST_DESCENDANTS as an expansion rather than a
	filter, so we cannot make it part of a filter group, so that bit
	(and its counterpart VIR_DOMAIN_SNAPSHOT_LIST_ROOTS for
	virDomainSnapshotList) remains a single control bit.

	* include/libvirt/libvirt.h.in (virDomainSnapshotListFlags): Add a
	couple more flags.
	* src/libvirt.c (virDomainSnapshotNum)
	(virDomainSnapshotNumChildren): Document them.
	(virDomainSnapshotListNames, virDomainSnapshotListChildrenNames):
	Likewise, and add thread-safety caveats.
	* src/conf/virdomainlist.h (VIR_DOMAIN_SNAPSHOT_FILTERS_*): New
	convenience macros.
	* src/conf/domain_conf.c (virDomainSnapshotObjListCopyNames)
	(virDomainSnapshotObjListCount): Support the new flags.

2012-06-20  Martin Kletzander  <mkletzan@redhat.com>

	virsh: fix few typos on desc command
	virsh help fix:
	 - <--title> can also /get/ the title

	virsh man page:
	 - missing <domain-id>
	 - <new_desc> should be <new-desc>

2012-06-20  Martin Kletzander  <mkletzan@redhat.com>

	domain_conf: fix possible memory leak
	Until now, it was possible to crash libvirtd when defining domain with
	channel device with missing source element.

	When creating new virDomainChrDef, target.port is set to -1, but
	unfortunately it is an union with addresses that virDomainChrDefFree
	tries to free in case the deviceType is channel. Having the port set
	to -1 is intended, however the cleanest way to get around the problems
	with the crash seems to be renumbering the VIR_DOMAIN_CHR_CHANNEL_
	target types to cover new NONE type (with value 0) being the default
	(no target type yet).

2012-06-19  Peter Krempa  <pkrempa@redhat.com>

	error: Fix typos in argument checking macros
	Macro virCheckNullArgGoto is supposed to check for NULL argument but
	checks non-NULL instead.

	Macro virCheckNonNullArgReturn reports error as if the argument should
	be NULL when it shouldn't.

2012-06-19  Martin Kletzander  <mkletzan@redhat.com>

	virsh: make domiftune interface help string consistent
	Append '(MAC Address)' after the help string of domiftune virsh
	command as it takes the same type of argument as domif-{get,set}link
	which have it specified.

2012-06-19  Gao feng  <gaofeng@cn.fujitsu.com>

	LXC: avoid useless duplicate memory free
	when lxcContainerIdentifyCGroups failed, the memory it allocated
	has been freed, so we should not free this memory again in
	lxcContainerSetupPivortRoot and lxcContainerSetupExtraMounts.

2012-06-19  Peter Krempa  <pkrempa@redhat.com>

	driver: Clean up driver header to space indentation

2012-06-19  Eric Blake  <eblake@redhat.com>

	snapshot: merge count and name collection
	Another case where we can do the same amount of work with fewer
	lines of redundant code, which will make adding new filters easier.

	* src/conf/domain_conf.c (virDomainSnapshotNameData): Adjust
	struct.
	(virDomainSnapshotObjListCount): Delete, now taken care of...
	(virDomainSnapshotObjListCopyNames): ...here.
	(virDomainSnapshotObjListGetNames): Adjust caller to handle
	counting.
	(virDomainSnapshotObjListNum): Simplify.

2012-06-19  Eric Blake  <eblake@redhat.com>

	snapshot: merge domain and snapshot computation
	Now that domain listing is a thin wrapper around child listing,
	it's easier to have a common entry point.  This restores the
	hashForEach optimization lost in the previous patch when there
	are no snapshots being filtered out of the entire list.

	* src/conf/domain_conf.h (virDomainSnapshotObjListGetNames)
	(virDomainSnapshotObjListNum): Add parameter.
	(virDomainSnapshotObjListGetNamesFrom)
	(virDomainSnapshotObjListNumFrom): Delete.
	* src/libvirt_private.syms (domain_conf.h): Drop deleted functions.
	* src/conf/domain_conf.c (virDomainSnapshotObjListGetNames):
	Merge, and (re)add an optimization.
	* src/qemu/qemu_driver.c (qemuDomainUndefineFlags)
	(qemuDomainSnapshotListNames, qemuDomainSnapshotNum)
	(qemuDomainSnapshotListChildrenNames)
	(qemuDomainSnapshotNumChildren): Update callers.
	* src/qemu/qemu_migration.c (qemuMigrationIsAllowed): Likewise.
	* src/conf/virdomainlist.c (virDomainListPopulate): Likewise.

2012-06-19  Eric Blake  <eblake@redhat.com>

	snapshot: use metaroot node to simplify management
	This idea was first suggested by Daniel Veillard here:
	https://www.redhat.com/archives/libvir-list/2011-October/msg00353.html

	Now that I am about to add more complexity to snapshot listing, it
	makes sense to avoid code duplication and special casing for domain
	listing (all snapshots) vs. snapshot listing (descendants); adding
	a metaroot reduces the number of code lines by having the domain
	listing turn into a descendant listing of the metaroot.

	Note that this has one minor pessimization - if we are going to list
	ALL snapshots without filtering, then virHashForeach is more efficient
	than recursing through the child relationships; restoring that minor
	optimization will occur in the next patch.

	* src/conf/domain_conf.h (_virDomainSnapshotObj)
	(_virDomainSnapshotObjList): Repurpose some fields.
	(virDomainSnapshotDropParent): Drop unused parameter.
	* src/conf/domain_conf.c (virDomainSnapshotObjListGetNames)
	(virDomainSnapshotObjListCount): Simplify.
	(virDomainSnapshotFindByName, virDomainSnapshotSetRelations)
	(virDomainSnapshotDropParent): Match new field semantics.
	* src/qemu/qemu_driver.c (qemuDomainSnapshotCreateXML)
	(qemuDomainSnapshotReparentChildren, qemuDomainSnapshotDelete):
	Adjust clients.

2012-06-19  Guido Günther  <agx@sigxcpu.org>

	openvz: Fix wordsize on 64 bit architectures
	The word size there is 64 bit not 8.

2012-06-19  Peter Krempa  <pkrempa@redhat.com>

	conf: Add helper for listing domains on drivers supporting virDomainObj
	This patch adds common code to list domains in fashion used by
	virListAllDomains with all currently supported flags. The header file
	also contains macros that group filters together that are used to
	shorten filter conditions.

	conf: Store managed save image existence in virDomainObj
	This patch stores existence of the image in the object. At start of the
	daemon the state is checked and then updated in key moments in domain
	lifecycle.

2012-06-19  Peter Krempa  <pkrempa@redhat.com>

	remote: implement remote protocol for virConnectListAllDomains()
	This patch wires up the RPC protocol handlers for
	virConnectListAllDomains(). The RPC generator has no support for the way
	how virConnectListAllDomains() returns the results so the handler code
	had to be done manually.

	The new api is handled by REMOTE_PROC_CONNECT_LIST_ALL_DOMAINS, with
	number 273 and marked with high priority.

2012-06-19  Peter Krempa  <pkrempa@redhat.com>

	python: add API exports for virConnectListAllDomains()
	This patch adds export of the new API function
	virConnectListAllDomains() to the libvirt-python bindings. The
	virConnect object now has method "listAllDomains" that takes only the
	flags parameter and returns a python list of virDomain object
	corresponding to virDomainPtrs returned by the underlying api.

	The implementation is done manually as the generator does not support
	wrapping list of virDomainPtrs into virDomain objects.

2012-06-19  Peter Krempa  <pkrempa@redhat.com>

	lib: Add public api to enable atomic listing of guest
	This patch adds a new public api that lists domains. The new approach is
	different from those used before. There are key points to this:

	1) The list is acquired atomically and contains both active and inactive
	domains (guests). This eliminates the need to call two different list
	APIs, where the state might change in between the calls.

	2) The returned list consists of virDomainPtrs instead of names or ID's
	that have to be converted to virDomainPtrs anyways using separate calls
	for each one of them. This is more convenient and saves hypervisor calls.

	3) The returned list is auto-allocated. This saves a lot of hassle for
	the users.

	4) Built in support for filtering. The API call supports various
	filtering flags that modify the output list according to user needs.

	Available filter groups:
	    Domain status:
	    VIR_CONNECT_LIST_DOMAINS_ACTIVE, VIR_CONNECT_LIST_DOMAINS_INACTIVE

	    Domain persistence:
	    VIR_CONNECT_LIST_DOMAINS_PERSISTENT,
	    VIR_CONNECT_LIST_DOMAINS_TRANSIENT

	    Domain state:
	    VIR_CONNECT_LIST_DOMAINS_RUNNING, VIR_CONNECT_LIST_DOMAINS_PAUSED,
	    VIR_CONNECT_LIST_DOMAINS_SHUTOFF, VIR_CONNECT_LIST_DOMAINS_OTHER

	    Existence of managed save image:
	    VIR_CONNECT_LIST_DOMAINS_MANAGEDSAVE,
	    VIR_CONNECT_LIST_DOMAINS_NO_MANAGEDSAVE

	    Auto-start option:
	    VIR_CONNECT_LIST_DOMAINS_AUTOSTART,
	    VIR_CONNECT_LIST_DOMAINS_NO_AUTOSTART

	    Existence of snapshot:
	    VIR_CONNECT_LIST_DOMAINS_HAS_SNAPSHOT,
	    VIR_CONNECT_LIST_DOMAINS_NO_SNAPSHOT

	5) The python binding returns a list of domain objects that is very neat
	to work with.

	The only problem with this approach is no support from code generators
	so both RPC code and python bindings had to be written manually.

	*include/libvirt/libvirt.h.in: - add API prototype
	                               - clean up whitespace mistakes nearby
	*python/generator.py: - inhibit generation of the bindings for the new
	                        api
	*src/driver.h: - add driver prototype
	               - clean up some whitespace mistakes nearby
	*src/libvirt.c: - add public implementation
	*src/libvirt_public.syms: - export the new symbol

2012-06-19  Daniel P. Berrange  <berrange@redhat.com>

	Add a custom 404 error page for the website

2012-06-19  Gao feng  <gaofeng@cn.fujitsu.com>

	LXC: fix incorrect DEBUG info
	print debug info "container support is enabled"
	when host support the user or net namespace.

	LXC: fix memory leak in lxcContainerSetupExtraMounts
	kill the "return 0;" code, it will cause memory leak.

2012-06-19  Eric Blake  <eblake@redhat.com>

	build: fix whitespace damage
	Introduced in commit 1f8c33b67.

	* src/lxc/lxc_container.c (lxcContainerGetSubtree): Avoid TAB.

2012-06-18  Gao feng  <gaofeng@cn.fujitsu.com>

	LXC: fix memory leak in lxcContainerGetSubtree
	when libvirt_lxc trigger oom error in lxcContainerGetSubtree
	we should free the alloced memory for mounts.

	so when lxcContainerGetSubtree failed,we should do some
	memory cleanup in lxcContainerUnmountSubtree.

2012-06-18  Gao feng  <gaofeng@cn.fujitsu.com>

	LXC: fix memory leak in lxcContainerMountFSBlockHelper
	we alloc the memory for format in lxcContainerMountDetectFilesystem
	but without free it in lxcContainerMountFSBlockHelper.

	this patch just call VIR_FREE to free it.

2012-06-18  Michal Privoznik  <mprivozn@redhat.com>

	virsh: Update vol-create-as manpage
	as we support qed format as well.

	virsh: Tweak attach-* documentation
	as we are missing:
	attach-disk: --type can accept 'lun' too, not just cdrom or floppy.
	attach-disk: --target specify logical device name, not path
	attach-interface: --target silently drops strings with vnet* prefix

2012-06-16  Michal Privoznik  <mprivozn@redhat.com>

	qemu_agent: Wait for events instead of agent response
	With latest changes to qemu-ga success on some commands is not reported
	anymore, e.g. guest-shutdown or guest-suspend-*. However, errors are
	still being reported. Therefore, we need to find different source of
	indication if operation was successful. Events.

	qemu_agent: Add some more debug prints
	for agent ref count and qemuProcessHandleAgentDestroy

2012-06-16  Eric Blake  <eblake@redhat.com>

	snapshot: use new virsh function for snapshot-list
	Operating on a list of snapshot objects looks so much simpler.
	In particular, since the helper function already trimmed out
	irrelevant entries, we no longer have quite so many special cases
	on finding the first snapshot to operate on.  Also, vshTreePrint
	no longer has a generic callback struct; both clients now pass
	something different according to their own needs.

	* tools/virsh.c (cmdSnapshotList): Use previous patches.
	(vshTreeArrayLookup): Rename...
	(vshNodeListLookup): ...now that it only has one client.
	(cmdNodeListDevices): Adjust caller.

2012-06-16  Eric Blake  <eblake@redhat.com>

	snapshot: new virsh function factored from snapshot-list
	This patch is based on the fallback code out of cmdSnapshotList,
	with tweaks to keep the snapshot objects around rather than just
	their name, and to remove unwanted elements before returning.
	It looks forward to a future patch when we add a way to list all
	snapshot objects at once, and the next patch will simplify
	cmdSnapshotList to take advantage of this factorization.

	* tools/virsh.c (vshSnapshotList, vshSnapshotListFree): New functions.

2012-06-16  Eric Blake  <eblake@redhat.com>

	build: hoist qemu dependence on yajl to configure
	Commit 6e769eba made it a runtime error if libvirt was compiled
	without yajl support but targets a new enough qemu.  But enough
	users are hitting this on self-compiled libvirt that it is worth
	erroring out at compilation time, rather than an obscure failure
	when trying to use the built executable.

	* configure.ac: If qemu is requested and -version works, require
	yajl when qemu version is new enough.
	* src/qemu/qemu_capabilities.c (qemuCapsComputeCmdFlags): Add
	comment.

2012-06-16  Cole Robinson  <crobinso@redhat.com>

	autogen: Always abide --system
	If we do ./autogen.sh && ./configure, then later try ./autogen.sh --system,
	configure isn't invoked with the requested params. Instead
	config.status --recheck is run.

2012-06-16  Jim Fehlig  <jfehlig@suse.com>

	Check for errors when parsing bridge interface XML
	The return status of virInterfaceDefParseBridge() was not being
	checked, potentially resulting in the creation of a broken
	interface.

2012-06-15  Daniel P. Berrange  <berrange@redhat.com>

	Fix launch of libvirtd when DHCP snooping support is not available.
	When libpcap is not available, the NWFilter driver provides a
	no-op stub for the DHCP snooping initialization. This was
	mistakenly returning '-1' instead of '0', so the entire driver
	initialization failed

	Add more debug logging for libvirtd startup
	To facilitate future troubleshooting add a bunch more debugging
	statements into important startup parts of libvirt

2012-06-15  Osier Yang  <jyang@redhat.com>

	schema: Update domain XML schema
	'boot' tag shouldn't be exclusive with 'kernel', 'initrd', and 'cmdline',
	though the boot sequence doesn't make sense when the guest boots from
	kernel directly. But it's useful if booting from kernel is to install
	a newguest, even if it's not to install a guest, there is no hurt. And
	on the other hand, we allow 'boot' and the kernel tags when parsing.

2012-06-15  Wen Congyang  <wency@cn.fujitsu.com>

	virsh: allow the user to specify vmcore's format
	Add a new parameter --memory-only for 'virsh dump' command. So
	the user can decide the vmcore's format.

	qemu: allow the client to choose the vmcore's format
	This patch updates qemu driver to allow the client to choose the
	vmcore's format: memory only or including device state.

	qemu: implement qemu's dump-guest-memory
	dump-guest-memory is a new dump mechanism, and it can work when the
	guest uses host devices. This patch adds a API to use this new
	monitor command.
	We will always use json mode if qemu's version is >= 0.15, so I
	don't implement the API for text mode.

	qemu: fix potential dead lock
	If we lock the qemu_driver, we should call qemuDomainObjBeginJobWithDriver()
	not qemuDomainObjBeginJob().

2012-06-15  Osier Yang  <jyang@redhat.com>

	virsh: Null terminated the string memcpy from buffer explicitly
	Detected by valgrind:

	==16217== 1 errors in context 1 of 12:
	==16217== Invalid read of size 1
	==16217==    at 0x4A07804: __GI_strlen (mc_replace_strmem.c:284)
	==16217==    by 0x3019F167F6: xdr_string (in /lib64/libc-2.12.so)
	==16217==    by 0x3033709E8D: xdr_remote_nonnull_string (remote_protocol.c:31)
	==16217==    by 0x303370E5CB: xdr_remote_domain_update_device_flags_args (remote_protocol.c:2028)
	==16217==    by 0x30337197D1: virNetMessageEncodePayload (virnetmessage.c:341)
	==16217==    by 0x30337135E1: virNetClientProgramCall (virnetclientprogram.c:327)
	==16217==    by 0x30336F1EFD: callWithFD (remote_driver.c:4586)
	==16217==    by 0x30336F1F7B: call (remote_driver.c:4607)
	==16217==    by 0x30336F42F2: remoteDomainUpdateDeviceFlags (remote_client_bodies.h:2865)
	==16217==    by 0x30336D46E5: virDomainUpdateDeviceFlags (libvirt.c:9457)
	==16217==    by 0x41AEE8: cmdChangeMedia (virsh.c:15249)
	==16217==    by 0x413CB4: vshCommandRun (virsh.c:18669)
	==16217==  Address 0x4ec5e25 is 0 bytes after a block of size 293 alloc'd
	==16217==    at 0x4A04A28: calloc (vg_replace_malloc.c:467)
	==16217==    by 0x303364F1DB: virAllocN (memory.c:129)
	==16217==    by 0x41A844: vshPrepareDiskXML (virsh.c:15043)
	==16217==    by 0x41AECC: cmdChangeMedia (virsh.c:15246)
	==16217==    by 0x413CB4: vshCommandRun (virsh.c:18669)
	==16217==    by 0x423973: main (virsh.c:20261)

2012-06-15  Laine Stump  <laine@laine.org>

	docs: small typo in formatdomain.html

2012-06-15  Daniel P. Berrange  <berrange@redhat.com>

	Always pivot_root event if the new root source is '/'
	This reverts

	  commit c16b4c43fcdd8ec02581f38377983b2e0925bfcd
	  Author: Daniel P. Berrange <berrange@redhat.com>
	  Date:   Fri May 11 15:09:27 2012 +0100

	    Avoid LXC pivot root in the root source is still /

	This commit broke setup of /dev, because the code which
	deals with setting up a private /dev and /dev/pts only
	works if you do a pivotroot.

	The original intent of avoiding the pivot root was to
	try and ensure the new root has a minimumal mount
	tree. The better way todo this is to just unmount the
	bits we don't want (ie old /proc & /sys subtrees.
	So apply the logic from

	  commit c529b47a756960d332fbe9903943dae855e7b949
	  Author: Daniel P. Berrange <berrange@redhat.com>
	  Date:   Fri May 11 11:35:28 2012 +0100

	    Trim /proc & /sys subtrees before mounting new instances

	to the pivot_root codepath as well

2012-06-15  Daniel P. Berrange  <berrange@redhat.com>

	Improve error message diagnosing incorrect XML CPU mode
	Tell the user what CPU mode value is wrong

2012-06-14  Peter Krempa  <pkrempa@redhat.com>

	qemu: Enable disconnecting SPICE clients without changing password
	Libvirt updates the configuration of SPICE server only when something
	changes. This is unfortunate when the user wants to disconnect a
	existing spice session when the connected attribute is already
	"disconnect".

	This patch modifies the conditions for calling the password updater to
	be called when nothing changes, but the connected attribute is already
	"disconnect".

2012-06-14  Michal Privoznik  <mprivozn@redhat.com>

	virsh: Report name from edited object
	There is a little easter egg in virsh: one can easily clone
	an object (domain, network, ...). Just 'virsh edit' change the name
	and remove <uuid>. And then, in the end when reporting success
	the new name was printed out.
	However, with recent edit rewrite we lost the final part and are
	still printing the original name out.

	virsh: Honor reedit opts printing to a function
	When printing reedit options we make stdin raw. However,
	this results in stdout being raw as well. Therefore we need
	to return carriage when doing new line. Unfortunately,
	'\r' cannot be part of internationalized messages hence
	we must move them to formatting string which then in turn
	become huge and disarranged. To solve this, a new function
	is introduced which takes variable string arguments and
	prepend each with "\r\n" just before printing.

2012-06-14  Peter Krempa  <pkrempa@redhat.com>

	qemu: Fix off-by-one error while unescaping monitor strings
	While unescaping the commands the commands passed through to the monitor
	function qemuMonitorUnescapeArg() initialized lenght of the input string
	to strlen()+1 which is fine for alloc but not for iteration of the
	string.

	This patch fixes the off-by-one error and drops the pointless check for
	a single trailing slash that is automaticaly handled by the default
	branch of switch.

2012-06-14  Peter Krempa  <pkrempa@redhat.com>

	virsh: Don't generate invalid XML in attach-disk command
	The attach-disk command used with parameter --cache created an invalid
	XML snippet as the beginning of the <driver> element was not printed
	when used solely with --cache and no other attribute to driver.

2012-06-14  Laine Stump  <laine@laine.org>

	network: fully support/use VIR_NETWORK_XML_INACTIVE flag
	commit 52d064f42dbc857f4096dc60c0335395ffac73aa added
	VIR_NETWORK_XML_INACTIVE in order to allow suppressing the
	auto-generated list of VFs in network definitions, and a --inactive
	flag to virsh net-dumpxml to take advantage of the flag. However, it
	missed out on two opportunities:

	1) Use INACTIVE to get the current config of the network as it
	   exists on disk, rather than the currently active config.

	2) Add INACTIVE to the flags used for the virsh net-edit command, so
	   that it won't include the forward-pool interfaces that were
	   autogenerated, and so that a re-edit of the network prior to
	   restarting it will show any other edits made since the last restart
	   of the network. (prior to this patch, if you edited a network a 2nd
	   time without restarting, all of the previous edits would magically
	   disappear).

	In order to fit with the new #define-based generic edit function in
	virsh.c, a new function vshNetworkGetXMLDesc() was added. This
	function first tries to call virNetworkGetXMLDesc with the INACTIVE
	flag added, then retries without if the first attempt fails (in the
	manner expected when the server doesn't support it).

2012-06-14  Daniel P. Berrange  <berrange@redhat.com>

	Add some missing hook functions
	A core use case of the hook scripts is to be able to do things
	to a guest's network configuration. It is possible to hook into
	the 'start' operation for a QEMU guest which runs just before
	the guest is started. The TAP devices will exist at this point,
	but the QEMU process will not. It can be desirable to have a
	'started' hook too, which runs once QEMU has started.

	If libvirtd is restarted it will re-populate firewall rules,
	but there is no QEMU hook to trigger for existing domains.
	This is solved with a 'reconnect' hook.

	Finally, if attaching to an external QEMU process there needs
	to be an 'attach' hook script.

	This all also applies to the LXC driver

	* docs/hooks.html.in: Document new operations
	* src/util/hooks.c, src/util/hooks.c: Add 'started', 'reconnect'
	  and 'attach' operations for QEMU. Add 'prepare', 'started',
	  'release' and 'reconnect' operations for LXC
	* src/lxc/lxc_driver.c: Add hooks for 'prepare', 'started',
	  'release' and 'reconnect' operations
	* src/qemu/qemu_process.c: Add hooks for 'started', 'reconnect'
	  and 'reconnect' operations

2012-06-13  Daniel P. Berrange  <berrange@redhat.com>

	client rpc: Fix error checking after poll()
	First 'poll' can't return EWOULDBLOCK, and second, we're checking errno
	so far away from the poll() call that we've probably already trashed the
	original errno value.

2012-06-13  Jiri Denemark  <jdenemar@redhat.com>

	client rpc: Send keepalive requests from IO event loop
	In addition to keepalive responses, we also need to send keepalive
	requests from client IO loop to properly detect dead connection in case
	a libvirt API is called from the main loop, which prevents any timers to
	be called.

	server rpc: Remove APIs for manipulating filters on locked client
	We don't need to add or remove filters when client object is already
	locked anymore. There's no reason to keep the *Locked variants of those
	APIs.

	rpc: Remove unused parameter in virKeepAliveStopInternal
	The previous commit removed the only usage of ``all'' parameter in
	virKeepAliveStopInternal, which was actually the only reason for having
	virKeepAliveStopInternal. This effectively reverts most of commit
	6446a9e20cc65561ce6061742baf35a3a63d5ba1.

	rpc: Do not use timer for sending keepalive responses
	When a libvirt API is called from the main event loop (which seems to be
	common in event-based glib apps), the client IO loop would properly
	handle keepalive requests sent by a server but will not actually send
	them because the main event loop is blocked with the API. This patch
	gets rid of response timer and the thread which is processing keepalive
	requests is also responsible for queueing responses for delivery.

	client rpc: Separate call creation from running IO loop
	This makes it possible to create and queue new calls while we are
	running IO loop.

	rpc: Add APIs for direct triggering of keepalive timer
	Add virKeepAliveTimeout and virKeepAliveTrigger APIs that can be used to
	set poll timeouts and trigger keepalive timer. virKeepAliveTrigger
	checks if it is called to early and does nothing in that case.

	rpc: Refactor keepalive timer code
	The code that needs to be run every keepalive interval of inactivity was
	only called from a timer and thus from the main event loop. We will need
	to call the code directly from another place.

	client rpc: Drop unused return value of virNetClientSendNonBlock
	As we never drop non-blocking calls, the return value that used to
	indicate a call was dropped is no longer needed.

	client rpc: Just queue non-blocking call if another thread has the buck
	As non-blocking calls are no longer dropped, we don't really need to
	care that much about their fate and wait for the thread with the buck
	to process them. If another thread has the buck, we can just push a
	non-blocking call to the queue and be done with it.

2012-06-13  Jiri Denemark  <jdenemar@redhat.com>

	client rpc: Don't drop non-blocking calls
	So far, we were dropping non-blocking calls whenever sending them would
	block. In case a client is sending lots of stream calls (which are not
	supposed to generate any reply), the assumption that having other calls
	in a queue is sufficient to get a reply from the server doesn't work. I
	tried to fix this in b1e374a7ac56927cfe62435179bf0bba1e08b372 but
	failed and reverted that commit.

	With this patch, non-blocking calls are never dropped (unless the
	connection is being closed) and will always be sent.

2012-06-13  Jiri Denemark  <jdenemar@redhat.com>

	client rpc: Use event loop for writing
	Normally, when every call has a thread associated with it, the thread
	may get the buck and be in charge of sending all calls until its own
	call is done. When we introduced non-blocking calls, we had to add
	special handling of new non-blocking calls. This patch uses event loop
	to send data if there is no thread to get the buck so that any
	non-blocking calls left in the queue are properly sent without having to
	handle them specially. It also avoids adding even more cruft to client
	IO loop in the following patches.

	With this change in, non-blocking calls may see unpredictable delays in
	delivery when the client has no event loop registered. However, the only
	non-blocking calls we have are keepalives and we already require event
	loop for them, which makes this a non-issue until someone introduces new
	non-blocking calls.

2012-06-13  Jiri Denemark  <jdenemar@redhat.com>

	client rpc: Improve debug messages in virNetClientIO
	When analyzing our debug log, I'm always confused about what each of the
	pointers mean. Let's be explicit.

2012-06-13  Eric Blake  <eblake@redhat.com>

	build: fix 'make dist' on virgin checkout
	'make dist' was depending on *protocol-structs files, which are
	stored in git but in turn depended on generated files.  We still
	want to ship the protocol-structs files, but by renaming the
	tests to something not matching a file name, we separate 'make
	check' (which depends on the generated file) from 'make dist'
	(which only depends on the git files).  After all, the tarball
	should never depend on a generated file not stored in git.

	I found one more case of a git file depending on a generated
	file, in a bogus virkeycode.c listing; but at least this one
	had no associated rules so it never broke 'make dist'.

	Reported by Wen Congyang.  Latent bug has been present since
	commit 62dee6f, but only recently exposed by commit 7bff56a.

	* src/Makefile.am ($(srcdir)/util/virkeycode.c): Drop useless
	dependency.
	(BUILT_SOURCES): ...and build virkeymaps.h sooner.
	(PROTOCOL_STRUCTS): Rather than depend on the struct file...
	(check-local): ...convert things into a phony target of...
	(check-protocol): ...a new check.
	($(srcdir)/remote_protocol-struct): Rename to isolate the distributed
	file from the conditional test.
	(PDWTAGS): Deal with rename.  Swap to compare 'expected actual'.

2012-06-13  Eric Blake  <eblake@redhat.com>

	build: silence gettext warning
	Otherwise, 'make dist' gives multiple warnings like:

	libvirt.pot:20814: warning: internationalized messages should not contain the `\r' escape sequence

	* tools/virsh.c (vshAskReedit): Avoid \r in _().

2012-06-12  Guido Günther  <agx@sigxcpu.org>

	openvz: wire up domainUpdateDeviceFlags
	so we can update file system quota

	openvz: add persist parameter to openvzSetDiskQuota
	with persist=false the domain config file will not be updated.

	Introduce virDomainFSIndexByName
	for containers matching virDomainDiskIndexByName.

2012-06-12  Daniel P. Berrange  <berrange@redhat.com>

	Fix typo in RPM specfile
	libvirt.spec.in: s/{?rhel}/%{?rhel}/

2012-06-12  Eric Blake  <eblake@redhat.com>

	python: fix snapshot listing bugs
	Python exceptions are different than libvirt errors, and we had
	some corner case bugs on OOM situations.

	* python/libvirt-override.c (libvirt_virDomainSnapshotListNames)
	(libvirt_virDomainSnapshotListChildrenNames): Use correct error
	returns, avoid segv on OOM, and avoid memory leaks on error.

2012-06-12  Eric Blake  <eblake@redhat.com>

	python: use simpler methods
	* python/libvirt-override.c (libvirt_virDomainGetVcpus)
	(libvirt_virDomainGetVcpuPinInfo): Use Py_XDECREF instead of
	open-coding it.

2012-06-12  Michal Privoznik  <mprivozn@redhat.com>

	qemu: Don't overwrite security labels
	Currently, if qemuProcessStart fail at some point, e.g. because
	domain being started wants a PCI/USB device already assigned to
	a different domain, we jump to cleanup label where qemuProcessStop
	is performed. This unconditionally calls virSecurityManagerRestoreAllLabel
	which is wrong because the other domain is still using those devices.

	However, once we successfully label all devices/paths in
	qemuProcessStart() from that point on, we have to perform a rollback
	on failure - that is - we have to virSecurityManagerRestoreAllLabel.

2012-06-12  Michal Privoznik  <mprivozn@redhat.com>

	qemuProcessStop: Switch to flags
	Currently, we are passing only one boolean (migrated) so there is
	no real profit in this. But it creates starting position for
	next patch.

2012-06-12  Eric Blake  <eblake@redhat.com>

	snapshot: implement new APIs for qemu
	The two APIs are rather trivial; based on bits and pieces of other
	existing APIs.  It leaves the door open for future extension to
	qemu to report snapshots without metadata based on reading qcow2
	internal snapshot names.

	* src/qemu/qemu_driver.c (qemuDomainSnapshotIsCurrent)
	(qemuDomainSnapshotHasMetadata): New functions.

2012-06-12  Laine Stump  <laine@laine.org>

	docs: minor fixes to domain interface documentation
	A few examples for <interface> had a type='direct' interface with no
	sub-elements. This is not allowed - a type='direct' interface must
	have at least a source element. (Most likely the example was copied
	from the type='user' or type='ethernet' examples - they *do* allow an
	instance with no sub-elements).

	There was also one place that mistakenly used %lt; ... %gt; instead of
	&lt; ... &gt; (for some reason, I make that typo all the time).

2012-06-12  Eric Blake  <eblake@redhat.com>

	snapshot: RPC for new query APIs
	Pretty straightforward.

	* src/remote/remote_protocol.x
	(remote_domain_snapshot_is_current_args)
	(remote_domain_snapshot_is_current_ret)
	(remote_domain_snapshot_has_metadata_args)
	(remote_domain_snapshot_has_metadata_ret): New structs.
	(REMOTE_PROC_DOMAIN_SNAPSHOT_IS_CURRENT)
	(REMOTE_PROC_DOMAIN_SNAPSHOT_HAS_METADATA): New RPC calls.
	* src/remote/remote_driver.c (remote_driver): Call them.
	* src/remote_protocol-structs: Regenerate.

2012-06-12  Eric Blake  <eblake@redhat.com>

	snapshot: add 'virsh snapshot-info'
	Expose the recent API additions in virsh.  Borrows ideas from 'dominfo'
	for the general type of information to display.

	Output looks like:

	$ tools/virsh snapshot-info fedora-local tmp
	Name:           tmp
	Domain:         fedora-local
	Current:        no
	State:          disk-snapshot
	Parent:         -
	Children:       1
	Descendants:    2
	Metadata:       yes

	possibly with fewer lines when talking to older servers.

	* tools/virsh.c (cmdSnapshotInfo): New command.
	* tools/virsh.pod (snapshot-info): Document it.

2012-06-12  Eric Blake  <eblake@redhat.com>

	docs: link to FLOSS Weekly podcast, virt blogs
	Eric Blake and Guido Günther were guests during this week's
	FLOSS Weekly podcast, giving insights into libvirt as a Free
	Software project.  Also, there are several useful blogs on
	virt-related topics.

	* docs/relatedlinks.html.in (Blogs and Podcasts): New section.

2012-06-12  Daniel P. Berrange  <berrange@redhat.com>

	Two RPM conditional fixes for RHEL-7
	Ensure systemd is used in RHEL-7 and cgconfig is not used in
	RHEL-7

2012-06-12  Eric Blake  <eblake@redhat.com>

	snapshot: new query APIs
	Right now, starting from just a virDomainSnapshotPtr, and wanting to
	know if it is the current snapshot for its respective domain, you have
	to use virDomainSnapshotGetDomain(), then virDomainSnapshotCurrent(),
	then compare the two names returned by virDomainSnapshotGetName().
	It is a bit easier if we can directly query this information from the
	snapshot itself.

	Right now, it is possible to filter a snapshot listing based on
	whether snapshots have metadata that would prevent domain deletion,
	but the only way to learn if an individual snapshot has metadata is
	to see if that snapshot appears in the list returned by a listing.
	Additionally, I hope to expand the qemu driver in a future patch to
	use qemu-img to reconstruct snapshot XML corresponding to internal
	qcow2 snapshot names not otherwise tracked by libvirt (in part, so
	that libvirt can guarantee that new snapshots are not created with
	a name that would silently corrupt the existing portion of the qcow2
	file); if I ever get that in, then it would no longer be an all-or-none
	decision on whether snapshots have metadata, and becomes all the more
	important to be able to directly determine that information from a
	particular snapshot.

	Other query functions (such as virDomainIsActive) do not have a flags
	argument, but since virDomainHasCurrentSnapshot takes a flags argument,
	I figured it was safer to provide a flags argument here as well.

	* include/libvirt/libvirt.h.in (virDomainSnapshotIsCurrent)
	(virDomainSnapshotHasMetadata): New declarations.
	* src/libvirt.c (virDomainSnapshotIsCurrent)
	(virDomainSnapshotHasMetadata): New functions.
	* src/libvirt_public.syms (LIBVIRT_0.9.13): Export them.
	* src/driver.h (virDrvDomainSnapshotIsCurrent)
	(virDrvDomainSnapshotHasMetadata): New driver callbacks.

2012-06-11  Eric Blake  <eblake@redhat.com>

	snapshot: virsh indentation cleanup
	No semantic change; this will make it easier to refactor code.

	* tools/virsh.c (cmdSnapshotList): Drop level of indentation, and
	rename a variable.

2012-06-11  Eric Blake  <eblake@redhat.com>

	virsh: make tree listing more flexible
	Requiring the user to pass in parallel arrays of names and parents
	is annoying; it means that you can't qsort one of the arrays without
	invalidating the ordering of the other.  By refactoring this function
	to use callbacks, we isolate the layout to be independent of the
	printing, and a future patch can exploit that to improve layout.

	* tools/virsh.c (vshTreePrintInternal): Use callbacks rather than
	requiring a char** array.
	(vshTreeArrayLookup): New helper function.
	(vshTreePrint, cmdNodeListDevices, cmdSnapshotList): Update callers.

2012-06-11  Eric Blake  <eblake@redhat.com>

	virsh: remove limits on tree listing
	I am not a fan of fixed-width buffers.  All it takes is a
	linear chain of more than 100 snapshots to mess up 'virsh
	snapshot-list --tree'.  Now that virBuffer is more powerful,
	we might as well exploit its power.

	* tools/virsh.c (cmdNodeListDevicesPrint): Simplify to use a
	virBuffer instead of fixed-width prefix, factor guts, and rename...
	(vshTreePrint, vshTreePrintInternal): ...along with new helper.
	(cmdNodeListDevices, cmdSnapshotList): Update callers.

2012-06-11  Eric Blake  <eblake@redhat.com>

	buf: support peeking at string contents
	Right now, the only way to get at the contents of a virBuffer is
	to destroy it.  But there are cases in my upcoming patches where
	peeking at the contents makes life easier.  I suppose this does
	open up the potential for bad code to dereference a stale pointer,
	by disregarding the docs that the return value is invalid on the
	next virBuf operation, but such is life.

	* src/util/buf.h (virBufferCurrentContent): New declaration.
	* src/util/buf.c (virBufferCurrentContent): Implement it.
	* src/libvirt_private.syms (buf.h): Export it.
	* tests/virbuftest.c (testBufAutoIndent): Test it.

2012-06-11  Michal Privoznik  <mprivozn@redhat.com>

	rpc: Fix memleak in virNetMessageEncodeHeader
	My latest patch for RPC rework (a2c304f6872) introduced a memory leak.
	virNetMessageEncodeHeader() is calling VIR_ALLOC_N(msg->buffer, ...)
	despite fact, that msg->buffer isn't VIR_FREE()'d on all paths calling
	the function. Therefore, rather than injecting free statement switch to
	VIR_REALLOC_N().

2012-06-11  Daniel P. Berrange  <berrange@redhat.com>

	Fix privileges on /var/run/libvirt directory
	Previous commit

	  commit 32a9aac2e04c991340b66c855a1095e4e6445e54
	  Author: William Jon McCann <william.jon.mccann@gmail.com>
	  Date:   Thu May 3 12:36:27 2012 -0400

	    Use XDG Base Directories instead of storing in home directory

	Accidentally changed the umask when creating /var/run/libvirt
	to 077. This prevents /var/run/libvirt being readable by non-root,
	which is required for non-root to connect to libvirtd. Fix the
	code so that umask 077 is only used for the non-privileged libvirtd
	instance.

2012-06-11  Daniel P. Berrange  <berrange@redhat.com>

	Only migrate profile in non-privileged libvirtd instance
	Only the non-privileged libvirtd instance uses $HOME. So avoid
	running the code for migrating to XDG directories unless using
	a non-privileged libvirtd

2012-06-11  Eric Blake  <eblake@redhat.com>

	snapshot: avoid virsh crash with older servers
	Commits 51082301, 16d7b39, and 521cc447 introduced support for
	'virsh snapshot-list --from' when talking to a server older than
	0.9.5, but broke support for plain 'virsh snapshot-list' for the
	same old server in the process.  Because the code is not properly
	gated, we end up with a SIGSEGV during a strcmp with a NULL argument.

	* tools/virsh.c (cmdSnapshotList): Don't waste time on fallbacks
	when --from is not present.

2012-06-11  Osier Yang  <jyang@redhat.com>

	Update AUTHORS
	Commit a80bb970 forgot to update authors.

2012-06-11  Gao feng  <gaofeng@cn.fujitsu.com>

	LXC: fix memory leak in lxcContainerMountFSBlockAuto
	we forgot to free fslist,just add VIR_FREE(fslist).

2012-06-11  Gao feng  <gaofeng@cn.fujitsu.com>

	LXC: fix incorrect parameter of mount in lxcContainerMountFSBind
	when do remount,the source and target should be the same
	values specified in the initial mount() call.

	So change fs->dst to src.

2012-06-11  Gao feng  <gaofeng@cn.fujitsu.com>

	LXC: Delete unused variable src in lxcContainerMountBasicFS
	There is no code use the variable "src" in lxcContainerMountBasicFS.
	so delete it and VIR_FREE.

2012-06-11  Guido Günther  <agx@sigxcpu.org>

	msg_buf_size is unsigned long not size_t
	This fixes the build on 32bit systems which otherwise fails with:

	virnetmessagetest.c: In function 'testMessageHeaderEncode':
	virnetmessagetest.c:75:9: error: format '%zu' expects argument of type 'size_t', but argument 7 has type 'long unsigned int' [-Werror=format]

2012-06-09  Guido Günther  <agx@sigxcpu.org>

	Only check for cluster fs if we're using a filesystem
	otherwise migration fails for e.g. network filesystems like sheepdog
	with:

	   error: Invalid relative path 'virt-name': Invalid argument

	while we should fail with:

	    Migration may lead to data corruption if disks use cache != none

	References:

	    http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=676328
	    https://www.redhat.com/archives/libvirt-users/2012-May/msg00088.html

2012-06-09  Eric Blake  <eblake@redhat.com>

	snapshot: add virDomainSnapshotRef API
	virDomainSnapshotPtr has a refcount member, but no one was able
	to use it.  Furthermore, all of our other vir*Ptr objects have
	a *Ref method to match their *Free method.  Thankfully, this is
	client-side only, so we can use this new function regardless of
	how old the server side is!  (I have future patches to virsh
	that want to use it.)

	* include/libvirt/libvirt.h.in (virDomainSnapshotRef): Declare.
	* src/libvirt.c (virDomainSnapshotRef): Implement it.
	* src/libvirt_public.syms (LIBVIRT_0.9.13): Export it.

2012-06-08  Jiri Denemark  <jdenemar@redhat.com>

	util: Fix deadlock in virLogReset
	When libvirtd forks off a new child, the child then calls virLogReset(),
	which ends up closing file descriptors used as log outputs. However, we
	recently started logging closed file descriptors, which means we need to
	lock logging mutex which was already locked by virLogReset(). We don't
	really want to log anything when we are in the process of closing log
	outputs.

2012-06-08  Cole Robinson  <crobinso@redhat.com>

	Fix missing ) in 2 strings
	https://bugzilla.redhat.com/show_bug.cgi?id=801656

2012-06-08  Li Zhang  <zhlcindy@linux.vnet.ibm.com>

	Assign correct address type to spapr-vlan and spapr-vty.
	For pseries guest, spapr-vlan and spapr-vty is based
	on spapr-vio address. According to model of network
	device, the address type should be assigned automatically.
	For serial device, serial pty device is recognized as
	spapr-vty device, which is also on spapr-vio.

	So this patch is to correct the address type of
	spapr-vlan and spapr-vty, and build correct
	command line of spapr-vty.

	Reviewed-by:   Michael Ellerman<michaele@au1.ibm.com>

2012-06-08  Eric Blake  <eblake@redhat.com>

	maint: make it easier to copy FORTIFY_SOURCE snippet
	While libvirt intentionally avoids -Wundef (after all, C99
	guarantees sane semantics of treating undefined macros as 0),
	the glibc insanity of #warning on _FORTIFY_SOURCE coupled with
	what some people feel is the black magic of autoconf means
	that other projects are likely to copy our snippet verbatim.
	We can be nicer to other projects by making it easier to
	integrate into projects that use -Wundef.

	Suggested by Christophe Fergeau.

	* m4/virt-compile-warnings.m4 (LIBVIRT_COMPILE_WARNINGS): Be nice
	to other projects using -Wundef.

2012-06-07  Eric Blake  <eblake@redhat.com>

	command: avoid potential deadlock on handshake
	There is a theoretical problem of an extreme bug where we can get
	into deadlock due to command handshaking.  Thanks to a pair of pipes,
	we have a situation where the parent thinks the child reported an
	error and is waiting for a message from the child to explain the
	error; but at the same time the child thinks it reported success
	and is waiting for the parent to acknowledge the success; so both
	processes are now blocked.

	Thankfully, I don't think this deadlock is possible without at
	least one other bug in the code, but I did see exactly that sort
	of situation prior to commit da831af - I saw a backtrace where a
	double close bug in the parent caused the parent to read from the
	wrong fd and assume the child failed, even though the child really
	sent success.

	This potential deadlock is not quite like commit 858c247 (a deadlock
	due to multiple readers on one pipe preventing a write from completing),
	although the solution is similar - always close unused pipe fds before
	blocking, rather than after.

	* src/util/command.c (virCommandHandshakeWait): Close unused fds
	sooner.

2012-06-07  Martin Kletzander  <mkletzan@redhat.com>

	qemu: better detection of crashed domains
	When libvirtd is started and there is an unusable/not-connectable
	leftover from earlier started machine, it's more reasonable to say
	that the machine "crashed" if we know it was started with
	"-no-shutdown".
	This patch fixes that and also changes the other result (when machine
	was started without "-no-shutdown") to "unknown", because the previous
	"failed" reason means (according to include/libvirt/libvirt.h.in:174),
	that the machine failed to start.

2012-06-07  Eric Blake  <eblake@redhat.com>

	build: fix build without i18n
	If you compile without NLS support, where _() is a no-op macro,
	then we end up passing a string literal to a char*, provoking:

	In file included from virsh.c:3639:0:
	virsh-edit.c: In function ‘cmdSaveImageEdit’:
	virsh-edit.c:97:13: error: assignment discards ‘const’ qualifier from pointer target type [-Werror]
	virsh-edit.c:106:13: error: assignment discards ‘const’ qualifier from pointer target type [-Werror]

	* tools/virsh-edit.c: Be const-safe.

2012-06-07  Cole Robinson  <crobinso@redhat.com>

	spec: Build against systemd for udev
	They have now merged. Fedora details here:

	https://lists.fedoraproject.org/pipermail/devel/2012-June/168227.html

2012-06-07  Eric Blake  <eblake@redhat.com>

	build: fix build of fresh checkout
	Commit 7bff56a worked in an incremental build, but fails for a
	fresh clone; apparently, if make sees both an actual file
	spelling and an inference rule, only the exact spelling is used.

	  CCLD   libvirt_driver_test.la
	  CC     libvirt_driver_remote_la-remote_driver.lo
	remote/remote_driver.c:4707:34: fatal error: remote_client_bodies.h: No such file or directory
	compilation terminated.

	BUILT_SOURCES to the rescue, instead of trying to mess with .lo
	dependencies directly.

	* src/Makefile.am (REMOTE_DRIVER_PREREQS, %remote_driver.lo): Drop...
	(BUILT_SOURCES): ...and add here instead.

2012-06-06  Eric Blake  <eblake@redhat.com>

	build: ensure storage driver is used
	Commit 1c275e9a accidentally dropped the storage driver from
	libvirtd, because it depended on a C preprocessor macro that
	was not defined.  Furthermore, if you do './configure
	--without-storage-dir --with-storage-disk' or any other combination
	where you explicitly build a subset of storage backends excluding
	the dir backend, then the build is broken.

	Based on analysis by Osier Yang.

	* configure.ac (WITH_STORAGE): Define top-level conditional.
	* src/Makefile.am (mod_LTLIBRARIES): Build driver even when
	storage_dir is disabled.
	* daemon/libvirtd.c: Pick up storage driver for any backend, not
	just dir.
	* daemon/Makefile.am (libvirtd_LDADD): Likewise.

2012-06-05  Michal Privoznik  <mprivozn@redhat.com>

	rpc: Size up RPC limits
	Since we are allocating RPC buffer dynamically, we can increase limits
	for max. size of RPC message and RPC string. This is needed to cover
	some corner cases where libvirt is run on such huge machines that their
	capabilities XML is 4 times bigger than our current limit. This leaves
	users with inability to even connect.

	rpc: Switch to dynamically allocated message buffer
	Currently, we are allocating buffer for RPC messages statically.
	This is not such pain when RPC limits are small. However, if we want
	ever to increase those limits, we need to allocate buffer dynamically,
	based on RPC message len (= the first 4 bytes). Therefore we will
	decrease our mem usage in most cases and still be flexible enough in
	corner cases.

2012-06-05  Eric Blake  <eblake@redhat.com>

	build: fix 'make distcheck' issues
	We had a distributed file (remote_protocol.h, which in turn was
	a prereq to remote_driver.c) depending on a generated file
	(libvirt_probes.h), which is a no-no for a VPATH build from a
	read-only source tree (no wonder 'make distcheck' tests precisely
	that situation):

	     File `libvirt_driver_remote.la' does not exist.
	       File `libvirt_driver_remote_la-remote_driver.lo' does not exist.
	             Prerequisite `libvirt_probes.h' is newer than target `../../src/remote/remote_protocol.h'.
	            Must remake target `../../src/remote/remote_protocol.h'.
	Invoking recipe from Makefile:7464 to update target `../../src/remote/remote_protocol.h'.
	make[3]: Entering directory `/home/remote/eblake/libvirt-tmp2/build/libvirt-0.9.12/_build/src'
	  GEN    ../../src/remote/remote_protocol.h
	cannot create ../../src/remote/remote_protocol.h: Permission denied at ../../src/rpc/genprotocol.pl line 31.
	make[3]: *** [../../src/remote/remote_protocol.h] Error 13

	Rather than making distributed .c files depend on generated files, we
	really want to ensure that compilation into .lo files is not attempted
	until the generated files are present, done by this patch.  Since there
	were two different sets of conditionally generated files that both
	feed the .lo file, I had to introduce a new variable REMOTE_DRIVER_PREREQS
	to keep automake happy.

	After that fix, the next issue was that make treats './foo' and 'foo'
	differently in determining whether an implicit %foo rule is applicable,
	with the result that locking/qemu-sanlock.conf wasn't properly being
	built at the right times.  Also, the output for using the .aug test
	files was a bit verbose.

	After fixing the src directory, the next error is related to the docs
	directory, where the tarball is missing a stamp file and thus tries to
	regenerate files that are already present:

	  GEN    ../../docs/apibuild.py.stamp
	Traceback (most recent call last):
	  File "../../docs/apibuild.py", line 2511, in <module>
	    rebuild("libvirt")
	  File "../../docs/apibuild.py", line 2495, in rebuild
	    builder.serialize()
	  File "../../docs/apibuild.py", line 2424, in serialize
	    output = open(filename, "w")
	IOError: [Errno 13] Permission denied: '../../docs/libvirt-api.xml'
	make[5]: *** [../../docs/apibuild.py.stamp] Error 1

	and fixing that exposed another case of a distributed file (generated
	html) depending on a built file (libvirt.h), but only when doing an
	in-tree build, because of a file glob.

	* src/Makefile.am ($(srcdir)/remote/remote_driver.c): Change...
	(libvirt_driver_remote_la-remote_driver.lo): ...to the real
	dependency.
	($(builddir)/locking/%-sanlock.conf): Drop $(builddir), so that
	rule gets run in time for test_libvirt_sanlock.aug.
	(test_libvir*.aug): Cater to silent build.
	(conf_DATA): Don't ship qemu-sanlock.conf in the tarball, since it
	is trivial to regenerate.
	* docs/Makefile.am (EXTRA_DIST): Ship our stamp file.
	($(APIBUILD_STAMP)): Don't depend on generated file.

2012-06-05  Jiri Denemark  <jdenemar@redhat.com>

	tests: Refresh qemu-1.1.0 data
	QEMU 1.1.0 has been officially released. With 1.1.0 QEMU went back to
	three-digits version even for the initial release and I renamed the data
	files to match this fact. They were generated with

	qemu-system-x86_64 -help >tests/qemuhelpdata/qemu-1.1.0
	qemu-system-x86_64 \
	    -device ? \
	    -device pci-assign,? \
	    -device virtio-blk-pci,? \
	    -device virtio-net-pci,? \
	    -device scsi-disk,? 2>tests/qemuhelpdata/qemu-1.1.0-device

2012-06-05  Osier Yang  <jyang@redhat.com>

	virsh: Back out if the argument for vol-create-as is malformed

	virsh: Accept UUID as an argument for net-info and net-start

	virsh: Accept UUID as an argument for storage commands
	Affected commands are: pool-start, vol-create-from.

2012-06-05  Beat Jörg  <Beat.Joerg@ssatr.ch>

	Fix for parallel port passthrough for QEMU
	I came across a bug that the command line generated for passthrough
	of the host parallel port /dev/parport0 by libvirt for QEMU is incorrect.

	It currently produces:
	-chardev tty,id=charparallel0,path=/dev/parport0
	-device isa-parallel,chardev=charparallel0,id=parallel0

	The first parameter is "tty". It sould be "parport".

	If I launch qemu with -chardev parport,... it works as expected.

	I have already filled a bug report (
	https://bugzilla.redhat.com/show_bug.cgi?id=823879 ), the topic was
	already on the list some months ago:

	https://www.redhat.com/archives/libvirt-users/2011-September/msg00095.html

2012-06-05  Eric Blake  <eblake@redhat.com>

	maint: command.c whitespace cleanups
	Noticed during the previous commit.

	* src/util/command.c: Fix some spacing and break long lines.

2012-06-05  Eric Blake  <eblake@redhat.com>

	command: avoid deadlock on EPIPE situation
	It is possible to deadlock libvirt by having a domain with XML
	longer than PIPE_BUF, and by writing a hook script that closes
	stdin early.  This is because libvirt was keeping a copy of the
	child's stdin read fd open, which means the write fd in the
	parent will never see EPIPE (remember, libvirt should always be
	run with SIGPIPE ignored, so we should never get a SIGPIPE signal).
	Since there is no error, libvirt blocks waiting for a write to
	complete, even though the only reader is also libvirt.  The
	solution is to ensure that only the child can act as a reader
	before the parent does any writes; and then dealing with the
	fallout of dealing with EPIPE.

	Thankfully, this is not a security hole - since the only way to
	trigger the deadlock is to install a custom hook script, anyone
	that already has privileges to install a hook script already has
	privileges to do any number of other equally disruptive things
	to libvirt; it would only be a security hole if an unprivileged
	user could install a hook script to DoS a privileged user.

	* src/util/command.c (virCommandRun): Close parent's copy of child
	read fd earlier.
	(virCommandProcessIO): Don't let EPIPE be fatal; the child may
	be done parsing input.
	* tests/commandhelper.c (main): Set up a SIGPIPE situation.
	* tests/commandtest.c (test20): Trigger it.
	* tests/commanddata/test20.log: New file.

2012-06-05  Laine Stump  <laine@laine.org>

	util: fix "make rpm" when viratomic.h is used
	Although src/util/viratomic.h has been added to the repo, up until now
	it hasn't been used. Stefan Berger is using it in his proposed dhcp
	snooping patches, and an rpm build with those patches failed due to
	viratomic.h not being packed up with the rest of the sources.

2012-06-05  Eric Blake  <eblake@redhat.com>

	build: allow building with newer glibc-headers and -O0
	glibc 2.15 (on Fedora 17) coupled with explicit disabling of
	optimization during development dies a painful death:

	In file included from /usr/include/limits.h:27:0,
	                 from /usr/lib/gcc/x86_64-redhat-linux/4.7.0/include/limits.h:169,
	                 from /usr/lib/gcc/x86_64-redhat-linux/4.7.0/include/syslimits.h:7,
	                 from /usr/lib/gcc/x86_64-redhat-linux/4.7.0/include/limits.h:34,
	                 from util/bitmap.c:26:
	/usr/include/features.h:314:4: error: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Werror=cpp]
	cc1: all warnings being treated as errors

	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.

	* m4/virt-compile-warnings.m4 (LIBVIRT_COMPILE_WARNINGS): Squelch
	_FORTIFY_SOURCE when needed to avoid glibc #warnings.

2012-06-04  Wen Congyang  <wency@cn.fujitsu.com>

	fix make syntax-check failed

2012-06-04  Eric Blake  <eblake@redhat.com>

	build: fix sc_prohibit_readlink
	I noticed this during 'make syntax-check':

	prohibit_readlink
	grep: Unmatched ( or \(

	* cfg.mk (exclude_file_name_regexp--sc_prohibit_readlink): Fix
	mismatched '('.

2012-06-04  Jiri Denemark  <jdenemar@redhat.com>

	file: Log closing filedescriptors
	EBADF errors are logged as warnings as they normally indicate a double
	close bug. This patch also provides VIR_MASS_CLOSE helper to be user in
	the only case of mass close after fork when EBADF should rather be
	ignored.

	command: Fix debug message during handshake
	Probably a result of copy&paste...

2012-06-04  Radu Caragea  <dmns_serp@yahoo.com>

	Fix sync issue in virNetClientStreamEventRemoveCallback
	The stream lock is unlocked twice instead of being locked and then
	unlocked. Probably a typo.

2012-06-02  Michal Privoznik  <mprivozn@redhat.com>

	virsh: Allow users to reedit rejected XML
	If users *-edit but make a mistake in XML all changes are
	permanently lost. However, if virsh is not running within
	a script we can ask user if he wants to re-edit the file
	and correct the mistakes.

	virsh: Switch from generated cmd*Edit commands to nongenerated
	Currently, we either generate some cmd*Edit commands (cmdPoolEdit
	and cmdNetworkEdit) via sed script or copy the body of cmdEdit
	(e.g. cmdInterfaceEdit, cmdNWFilterEdit, etc.). This fact makes
	it harder to implement any new feature to our editing system.
	Therefore switch to new implementation - define macros to:
	- dump XML (EDIT_GET_XML)
	- take an action if XML wasn't changed,
	  usually just vshPrint() (EDIT_NOT_CHANGED)
	- define new object (EDIT_DEFINE) - the edited XML is in @doc_edited
	- free object defined by EDIT_DEFINE (EDIT_FREE)
	and #include "virsh-edit.c"

2012-06-02  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	nwfilter: Add multiple IP address support to DHCP snooping
	With support for multiple IP addresses per interface in place, this patch
	now adds support for multiple IP addresses per interface for the DHCP
	snooping code.


	Testing:

	Since the infrastructure I tested this with does not provide multiple IP
	addresses per MAC address (anymore), I either had to plug the VM's interface
	from the virtual bride connected directly to the infrastructure to virbr0
	to get a 2nd IP address from dnsmasq (kill and run dhclient inside the VM)
	or changed the lease file  (/var/run/libvirt/network/nwfilter.leases) and
	restart libvirtd to have a 2nd IP address on an existing interface.
	Note that dnsmasq can take a lease timeout parameter as part of the --dhcp-range
	command line parameter, so that timeouts can be tested that way
	(--dhcp-range 192.168.122.2,192.168.122.254,120). So, terminating and restarting
	dnsmasq with that parameter is another choice to watch an IP address disappear
	after 120 seconds.

	Regards,
	   Stefan

2012-06-02  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	nwfilter: move code for IP address map into separate file
	The goal of this patch is to prepare for support for multiple IP
	addresses per interface in the DHCP snooping code.

	Move the code for the IP address map that maps interface names to
	IP addresses into their own file. Rename the functions on the way
	but otherwise leave the code as-is. Initialize this new layer
	separately before dependent layers (iplearning, dhcpsnooping)
	and shut it down after them.

2012-06-02  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	nwfilter: add DHCP snooping
	This patch adds DHCP snooping support to libvirt. The learning method for
	IP addresses is specified by setting the "CTRL_IP_LEARNING" variable to one of
	"any" [default] (existing IP learning code), "none" (static only addresses)
	or "dhcp" (DHCP snooping).

	Active leases are saved in a lease file and reloaded on restart or HUP.

	The following interface XML activates and uses the DHCP snooping:

	    <interface type='bridge'>
	      <source bridge='virbr0'/>
	      <filterref filter='clean-traffic'>
	        <parameter name='CTRL_IP_LEARNING' value='dhcp'/>
	      </filterref>
	    </interface>

	All filters containing the variable 'IP' are automatically adjusted when
	the VM receives an IP address via DHCP. However, multiple IP addresses per
	interface are silently ignored in this patch, thus only supporting one IP
	address per interface. Multiple IP address support is added in a later
	patch in this series.

2012-06-02  Marti Raudsepp  <marti@juffo.org>

	qemu: move -name arg to be 1st in "ps x" output
	Currently, monitoring QEMU virtual machines with standard Unix
	sysadmin tools is harder than it has to be. The QEMU command line is
	often miles long and mostly redundant, it's hard to tell which process
	is which.

	This patch reorders the QEMU -name argument to be the first, so it's
	immediately visible in "ps x", htop and "atop -c" output.

2012-06-02  Laine Stump  <laine@laine.org>

	qemu: fix netdev alias name assignment wrt type='hostdev'
	This patch resolves:

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

	The problem is that an interface with type='hostdev' will have an
	alias of the form "hostdev%d", while the function that looks through
	existing netdevs to determine the name to use for a new addition will
	fail if there's an existing entry that does not match the form
	"net%d".

	This is another of the handful of places that need an exception due to
	the hybrid nature of <interface type='hostdev'> (which is not exactly
	an <interface> or a <hostdev>, but is both at the same time).

2012-05-31  Martin Kletzander  <mkletzan@redhat.com>

	tools: make virt-pki-validate work with acls and xattrs
	This patch makes virt-pki-validate work with certificates that have
	acl or xattr set. Otherwise it failing due to wrong permissions.

2012-05-31  Wen Congyang  <wency@cn.fujitsu.com>

	qemu: avoid closing fd more than once
	If we migrate to fd, spec->fwdType is not MIGRATION_FWD_DIRECT,
	we will close spec->dest.fd.local in qemuMigrationRun(). So we
	should set spec->dest.fd.local to -1 in qemuMigrationRun().

	Bug present since 0.9.5 (commit 326176179).

2012-05-31  Wen Congyang  <wency@cn.fujitsu.com>

	command: check for fork error before closing fd
	We should not set *outfd or *errfd if virExecWithHook() failed
	because the caller may close these fds.

	Bug present since v0.4.5 (commit 60ed1d2a).

2012-05-31  Eric Blake  <eblake@redhat.com>

	fdstream: avoid double close bug
	Wen Congyang reported that we have a double-close bug if we fail
	virFDStreamOpenInternal, since childfd duplicated one of the fds[]
	array contents.  In truth, since we always transfer both members
	of fds to other variables, we should close the fds through those
	other names, and just use fds[] for pipe().

	Bug present since 0.9.0 (commit e886237a).

	* src/fdstream.c (virFDStreamOpenFileInternal): Swap scope of
	childfd and fds[], to avoid a double close.

2012-05-31  Eric Blake  <eblake@redhat.com>

	command: avoid double close bugs
	KAMEZAWA Hiroyuki reported a nasty double-free bug when virCommand
	is used to convert a string into input to a child command.  The
	problem is that the poll() loop of virCommandProcessIO would close()
	the write end of the pipe in order to let the child see EOF, then
	the caller virCommandRun() would also close the same fd number, with
	the second close possibly nuking an fd opened by some other thread
	in the meantime.  This in turn can have all sorts of bad effects.

	The bug has been present since the introduction of virCommand in
	commit f16ad06f.

	This is based on his first attempt at a patch, at
	https://bugzilla.redhat.com/show_bug.cgi?id=823716

	* src/util/command.c (_virCommand): Drop inpipe member.
	(virCommandProcessIO): Add argument, to avoid closing caller's fd
	without informing caller.
	(virCommandRun, virCommandNewArgs): Adjust clients.

2012-05-31  Wen Congyang  <wency@cn.fujitsu.com>

	avoid fd leak
	virCommandRunAsync() will set errfd if it succeed. We should
	close it if virFDStreamOpenInternal() fails.

	avoid closing uninitialized fd
	If the system does not support bypass cache, we will close fd,
	but it is uninitialized.

2012-05-31  Martin Kletzander  <mkletzan@redhat.com>

	Fixes for check and rpm builds without sanlock (and qemu)
	Apart from the non-sanlock check build, there is also a little fix for
	qemu (EXTRA_DIST had qemu.conf and others inside even if the build was
	supposed to be without qemu).

2012-05-30  Wen Congyang  <wency@cn.fujitsu.com>

	build: include augeas-gentest.pl into dist file
	We generate *.aug from *.aug.in by augeas-gentest.pl, so this script
	should be included in dist file.

2012-05-30  Eric Blake  <eblake@redhat.com>

	build: use same perl binary throughout build
	Some of our rules used $(PERL), while others used 'perl'.  Always
	using the variable allows a developer to point to a different (often
	better) perl than the default one found on $PATH.

	* daemon/Makefile.am ($(srcdir)/remote_dispatch.h): s/perl/$(PERL).
	* src/Makefile.am ($(srcdir)/remote/remote_client_bodies.h)
	(PDWTAGS, %protocol.c, %_probes.stp): Likewise.

2012-05-30  Eric Blake  <eblake@redhat.com>

	build: fix testing of augeas files in VPATH builds
	Without this fix, a VPATH build (such as used by ./autobuild.sh)
	fails with messages like:

	make[3]: Entering directory `/home/remote/eblake/libvirt-tmp2/build/daemon'
	../../build-aux/augeas-gentest.pl libvirtd.conf ../../daemon/test_libvirtd.aug.in test_libvirtd.aug
	cannot read libvirtd.conf: No such file or directory at ../../build-aux/augeas-gentest.pl line 38.

	Since the test files are not part of the tarball, we can generate
	them into the build dir, but rather than create a subdirectory
	just for the test file, it is easier to test them directly in
	libvirt.git/src.

	* daemon/Makefile.am (AUG_GENTEST): Factor out definition.
	(test_libvirtd.aug): Look for correct file.
	* src/Makefile.am (AUG_GENTEST): Use $(PERL).
	(qemu/test_libvirtd_qemu.aug, lxc/test_libvirtd_lxc.aug)
	(locking/test_libvirt_sanlock.aug): Rename to avoid subdirectories.
	(check-augeas-qemu, check-augeas-lxc, check-augeas-sanlock): Reflect
	location of built tests.
	* configure.ac (PERL): Substitute perl.

2012-05-30  Eric Blake  <eblake@redhat.com>

	build: silence warning from autoconf
	Autoconf 2.60 and later insist on using ${datarootdir}, rather than
	the derived ${datadir} (although the latter defaults to the former,
	it is possible to set configure arguments so that they differ):

	config.status: creating libvirt.pc
	config.status: WARNING:  'libvirt.pc.in' seems to ignore the --datarootdir setting

	This patch follows the autoconf manual's suggestions for how to
	support 2.59 (RHEL 5) and newer simultaneously.

	* libvirt.pc.in (datarootdir): Define, so ${datadir} will not ignore
	datarootdir when using newer autoconf.

2012-05-30  Michal Privoznik  <mprivozn@redhat.com>

	virCommand: Extend debug message for handshake
	Currently, we are logging only one side of pipes we
	create in virCommandRequireHandshake(); This is enough
	in cases where pipe2() returns two consecutive FDs. However,
	it is not guaranteed and it may return any FDs.
	Therefore, it's wise to log the other ends as well.

2012-05-30  Martin Kletzander  <mkletzan@redhat.com>

	lxc: return correct number of CPUs
	When getting number of CPUs the host has assigned, there was always
	number "1" returned. Even though all lxc domains with no pinning
	launched by libvirt run on all pCPUs (by default, no matter what's the
	number), we should at least return the same number as the user
	specified when creating the domain.

	build: Fixed generating of libvirt_qemu_probes.h
	I added libvirt_qemu_probes.h into BUILT_SOURCES. That makes it
	generated, but most probably it is not the clearest way how to do
	that, but it fixes the build.

2012-05-30  Dave Allan  <dallan@redhat.com>

	examples: add consolecallback example python script
	A while back I wrote the attached code to demonstrate how to use
	events and serial console to create a serial console that stays up
	even when the VM is down.  It might need some work, as I am not
	terribly strong with Python.

	* examples/python/consolecallback.py: New file.
	* examples/python/Makefile.am (EXTRA_DIST): Ship it.

2012-05-30  Eric Blake  <eblake@redhat.com>

	build: don't lose probes.o files
	The previous patch fixed an incremental build, but missed that on
	a fresh checkout, we now have nothing left that stops make from
	nuking libvirt_qemu_probes.o.

	* src/Makefile.am ($(libvirt_driver_qemu_la_SOURCES)): Delete,
	since this variable is empty.
	(.PRECIOUS): Add %_probes.o, so they don't get nuked as an
	intermediate by-product after creating %_probes.lo.

2012-05-30  Eric Blake  <eblake@redhat.com>

	build: fix missing dependencies for libvirt-qemu.so
	The moment you specify a _DEPENDENCIES, older automake (stupidly)
	assumes that you will specify _all_ dependencies for that target.
	This stupidity has been fixed in automake 1.12, but we cannot rely on
	newer automake everywhere.  For libvirt_la_DEPENDENCIES, we took
	care of providing the full list, but for libvirt_qemu_la_DEPENDENCIES,
	we were missing the dependency on libvirt_qemu_impl.la, which resulted
	in a failed build:

	make[3]: Entering directory `/home/ajia/Workspace/libvirt/src'
	   CCLD   libvirt_driver_qemu.la
	libtool: link: `libvirt_qemu_probes.lo' is not a valid libtool object

	* src/Makefile.am (libvirt_driver_qemu_la_DEPENDENCIES): Delete;
	automake does a better job if it does the entire job.

2012-05-30  Eric Blake  <eblake@redhat.com>

	build: don't clean a file that belongs in the tarball
	Otherwise, 'make rpm' fails with:

	make[2]: *** No rule to make target `locking/test_libvirt_sanlock.aug.in', needed by `distdir'.  Stop.
	make[2]: Leaving directory `/home/dipankar/src/powerpc/libvirt-ppc/src'
	make[1]: *** [distdir] Error 1

	Reported by Dipankar Sarma.

	* src/Makefile.am (CLEANFILES): Clean only the generated file.

2012-05-29  Eric Blake  <eblake@redhat.com>

	virsh: avoid strncpy
	strncpy is generally evil - it runs the risk of missing NUL
	termination, and more often than not wastes time zeroing way
	more bytes than strictly necessary.  We've avoided this evil
	in our virStrncpy wrapper, except for places where we forgot
	to use the wrapper; meanwhile, we have also added an even
	higher layer wrapper for setting virTypedParameter values.

	* tools/virsh.c (cmdMemtune, cmdBlkdeviotune): Use modern API.
	* cfg.mk (exclude_file_name_regexp--sc_prohibit_strncpy): Tighten.

2012-05-29  Eric Blake  <eblake@redhat.com>

	build: update to latest gnulib
	Gnulib finally relaxed the isatty license, needed as first mentioned here:
	https://www.redhat.com/archives/libvir-list/2012-February/msg01022.html

	Other improvements include better syntax-check rules (we can delete one
	of ours now that it is a duplicate) and better compiler warning usage.

	* .gnulib: Update to latest, for isatty.
	* cfg.mk (sc_prohibit_strncpy): Drop a now-redundant rule.
	* bootstrap.conf (gnulib_modules): Add isatty.
	* bootstrap: Resync from gnulib.

2012-05-29  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	leak_fix.diff
	==3240== 23 bytes in 1 blocks are definitely lost in loss record 242 of 744
	==3240==    at 0x4C2A4CD: malloc (vg_replace_malloc.c:236)
	==3240==    by 0x8077537: __vasprintf_chk (vasprintf_chk.c:82)
	==3240==    by 0x509C677: virVasprintf (stdio2.h:199)
	==3240==    by 0x509C733: virAsprintf (util.c:1912)
	==3240==    by 0x1906583A: qemudStartup (qemu_driver.c:679)
	==3240==    by 0x511991D: virStateInitialize (libvirt.c:809)
	==3240==    by 0x40CD84: daemonRunStateInit (libvirtd.c:751)
	==3240==    by 0x5098745: virThreadHelper (threads-pthread.c:161)
	==3240==    by 0x7953D8F: start_thread (pthread_create.c:309)
	==3240==    by 0x805FF5C: clone (clone.S:115)

	Introduce virMacAddr typedef

2012-05-29  Daniel P. Berrange  <berrange@redhat.com>

	Fix typo in comment start
	src/libvirt.c: s,//,/,

2012-05-28  Daniel P. Berrange  <berrange@redhat.com>

	Santize the reporting of VIR_ERR_INVALID_ERROR
	To ensure consistent error reporting of invalid arguments,
	provide a number of predefined helper methods & macros.

	 - An arg which must not be NULL:

	   virCheckNonNullArgReturn(argname, retvalue)
	   virCheckNonNullArgGoto(argname, label)

	 - An arg which must be NULL

	   virCheckNullArgGoto(argname, label)

	 - An arg which must be positive (ie 1 or greater)

	   virCheckPositiveArgGoto(argname, label)

	 - An arg which must not be 0

	   virCheckNonZeroArgGoto(argname, label)

	 - An arg which must be zero

	   virCheckZeroArgGoto(argname, label)

	 - An arg which must not be negative (ie 0 or greater)

	   virCheckNonNegativeArgGoto(argname, label)

	* src/libvirt.c, src/libvirt-qemu.c,
	  src/nodeinfo.c, src/datatypes.c: Update to use
	  virCheckXXXX macros
	* po/POTFILES.in: Add libvirt-qemu.c and virterror_internal.h
	* src/internal.h: Define macros for checking invalid args
	* src/util/virterror_internal.h: Define macros for reporting
	  invalid args

2012-05-28  Eric Blake  <eblake@redhat.com>

	build: silence libtool during tests
	Libtool is picky about linking against a module library (aka a .so);
	giving lots of warnings like this in the tests directory:

	  CCLD   networkxml2argvtest

	*** Warning: Linking the executable networkxml2argvtest against the loadable module
	*** libvirt_driver_network.so is not portable!

	Fix that by splitting things into a convenience library which can
	be used directly by the tests, and making the real .so just wrap
	the convenience library.

	Based on a suggestion by Daniel P. Berrange.

	* configure.ac (--with-driver-modules): Fix help test.
	* src/Makefile.am (libvirt_driver_xen.la, libvirt_driver_libxl.la)
	(libvirt_driver_qemu.la, libvirt_driver_lxc.la)
	(libvirt_driver_uml.la): Factor into new convenience libraries.
	* tests/Makefile.am (xen_LDADDS, qemu_LDADDS, lxc_LDADDS)
	(networkxml2argvtest_LDADD): Link to convenience libraries, not
	shared libraries.

2012-05-28  Daniel P. Berrange  <berrange@redhat.com>

	Fix linking to DTrace probes file
	There was no rule forcing libvirt_qemu_probes.o to be built
	before libvirt_qemu_probes.lo was used. Also libvirtd was
	still referencing the .o file, rather than the .lo file.

	Both the .lo and .o file must be listed as DEPENDENCIES,
	otherwise libtool will unhelpfully delete the .o file
	once the .lo file is created.

2012-05-28  Daniel P. Berrange  <berrange@redhat.com>

	Fix Win32 build by linking to ole32
	The CoTaskMemFree function requires the ole32 DLL to be
	linked against. Currently this is only done for the
	VirtualBox driver. Also add it to libvirt_util.la

	* configure.ac: Unconditionally add ole32 DLL to Win32
	* src/Makefile.am: Link old32 to libvirt_util.la

2012-05-28  Martin Kletzander  <mkletzan@redhat.com>

	docs: typo in acceleration element
	"accel3d" was specified twice, the second one is obviously "accel2d"
	(also from the text down below.

2012-05-28  Daniel P. Berrange  <berrange@redhat.com>

	Autogenerate augeas test case from default config files
	When adding new config file parameters, the corresponding
	additions to the augeas lens' are constantly forgotten.
	Also there are augeas test cases, these don't catch the
	error, since they too are never updated.

	To address this, the augeas test cases need to be auto-generated
	from the example config files.

	* build-aux/augeas-gentest.pl: Helper to generate an
	  augeas test file, substituting in elements from the
	  example config files
	* src/Makefile.am, daemon/Makefile.am: Switch to
	  auto-generated augeas test cases
	* daemon/test_libvirtd.aug, daemon/test_libvirtd.aug.in,
	  src/locking/test_libvirt_sanlock.aug,
	  src/locking/test_libvirt_sanlock.aug.in,
	  src/lxc/test_libvirtd_lxc.aug,
	  src/lxc/test_libvirtd_lxc.aug.in,
	  src/qemu/test_libvirtd_qemu.aug,
	  src/qemu/test_libvirtd_qemu.aug.in: Remove example
	  config file data, replacing with a ::CONFIG:: placeholder

2012-05-28  Daniel P. Berrange  <berrange@redhat.com>

	Re-order config options in qemu driver augeas lens
	Currently all the config options are listed under a 'vnc_entry'
	group. Create a bunch of new groups & move options to the
	right place

	Fix mistakes in augeas lens
	Add nmissing 'host_uuid' entry to libvirtd.conf lens and
	rename spice_passwd to spice_password in qemu.conf lens

2012-05-28  Daniel P. Berrange  <berrange@redhat.com>

	Standardize whitespace used in example config files
	Instead of doing

	  # example_config

	use

	  #example_config

	so it is possible to programatically uncomment example config
	options, as distinct from their comment/descriptions

	Also delete rogue trailing comma not allowed by lens

2012-05-28  Daniel P. Berrange  <berrange@redhat.com>

	Add impl of APIs to get user directories on Win32
	Add an impl of +virGetUserRuntimeDirectory, virGetUserCacheDirectory
	virGetUserConfigDirectory and virGetUserDirectory for Win32 platform.
	Also create stubs for non-Win32 platforms which lack getpwuid_r()

	In adding these two helpers were added virFileIsAbsPath and
	virFileSkipRoot, along with some macros VIR_FILE_DIR_SEPARATOR,
	VIR_FILE_DIR_SEPARATOR_S, VIR_FILE_IS_DIR_SEPARATOR,
	VIR_FILE_PATH_SEPARATOR, VIR_FILE_PATH_SEPARATOR_S

	All this code was adapted from GLib2 under terms of LGPLv2+ license.

2012-05-28  Daniel P. Berrange  <berrange@redhat.com>

	Remove uid param from directory lookup APIs
	Remove the uid param from virGetUserConfigDirectory,
	virGetUserCacheDirectory, virGetUserRuntimeDirectory,
	and virGetUserDirectory

	These functions were universally called with the
	results of getuid() or geteuid(). To make it practical
	to port to Win32, remove the uid parameter and hardcode
	geteuid()

2012-05-28  Daniel P. Berrange  <berrange@redhat.com>

	Fix typos in RPM dependencies
	s/daemon-driver-nwilter/daemon-driver-nwfilter/
	s/daemon-network/daemon-driver-network/

	Fix check for socket existance / daemon spawn
	When you try to connect to a socket in the abstract namespace,
	the error will be ECONNREFUSED for a non-listening daemon. With
	the non-abstract namespace though, you instead get ENOENT. Add
	a check for this extra errno when auto-spawning the daemon

	Remove last usage of PATH_MAX and ban its future use
	Remove a number of pointless checks against PATH_MAX and
	add a syntax-check rule to prevent its use in future

2012-05-26  Jim Meyering  <meyering@redhat.com>

	maint: avoid new automake warning about AM_PROG_CC_STDC
	* configure.ac (AM_PROG_CC_STDC): Stop using this macro.
	It provokes warnings from newer automake and is superseded by
	autoconf's AC_PROG_CC, which we're already using.

2012-05-26  Eric Blake  <eblake@redhat.com>

	build: silence libtool warning on probes.o
	Libtool supports linking directly against .o files on some platforms
	(such as Linux), which happens to be the only place where we are
	actually doing that (for the dtrace-generated probes.o files).  However,
	it raises a big stink about the non-portability, even though we don't
	attempt it on platforms where it would actually fail:

	  CCLD   libvirt_driver_qemu.la

	*** Warning: Linking the shared library libvirt_driver_qemu.la against
	the non-libtool
	*** objects  libvirt_qemu_probes.o is not portable!

	This shuts libtool up by creating a proper .lo file that matches
	what libtool normally expects.

	* src/Makefile.am (%_probes.lo): New rule.
	(libvirt_probes.stp, libvirt_qemu_probes.stp): Simplify into...
	(%_probes.stp): ...shorter rule.
	(CLEANFILES): Clean new .lo files.
	(libvirt_la_BUILT_LIBADD, libvirt_driver_qemu_la_LIBADD)
	(libvirt_lxc_LDADD, virt_aa_helper_LDADD): Link against .lo file.
	* tests/Makefile.am (PROBES_O, qemu_LDADDS): Likewise.

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

	Improve docs about compiling libvirt from GIT
	Add a note about setting the LIBVIRT_DRIVER_DIR env variable,
	explain --system and fix example to use --disable-werror

2012-05-25  Eric Blake  <eblake@redhat.com>

	tests: run valgrind on real executables, not libtool wrappers
	* tests/Makefile.am (valgrind): Use libtool's ability to bypass
	libtool wrappers when running valgrind.

2012-05-25  Douglas Schilling Landgraf  <dougsland@redhat.com>

	qemu augeas: Add spice_tls/spice_tls_x509_cert_dir
	If vdsm is installed and configured in Fedora 17, we add the following
	items into qemu.conf:

	spice_tls=1
	spice_tls_x509_cert_dir="/etc/pki/vdsm/libvirt-spice"

	However, after this changes, augtool cannot identify qemu.conf anymore.

2012-05-25  Eric Blake  <eblake@redhat.com>

	tests: back to short test names
	With the switch to modules by default, I was getting super long
	test output:

	TEST: /home/remote/eblake/libvirt/tests/.libs/lt-interfacexml2xmltest

	compared to the former:

	TEST: interfacexml2xmltest

	* tests/testutils.c (virtTestMain): Trim off libtool goop.

2012-05-25  Eric Blake  <eblake@redhat.com>

	maint: ignore more files from version control
	* .gitignore: Exempt recent test binary and probes.h name change.

2012-05-24  Daniel P. Berrange  <berrange@redhat.com>

	Add sentinel for virErrorDomain enum
	Add a VIR_ERR_DOMAIN_LAST sentinel for virErrorDomain and
	replace the virErrorDomainName function by a VIR_ENUM_IMPL

	In the process the naming of error domains is sanitized

	* src/util/virterror.c: Use VIR_ENUM_IMPL for converting
	  error domains to strings
	* include/libvirt/virterror.h: Add VIR_ERR_DOMAIN_LAST

2012-05-24  Daniel P. Berrange  <berrange@redhat.com>

	Add parsing for VIR_ENUM_IMPL & VIR_ENUM_DECL in apibuild.py
	The apibuild.py parser needs to be able to parse & ignore
	any VIR_ENUM_IMPL/VIR_ENUM_DECL macros in the source. Add
	some special case code to deal with this rather than trying
	to figure out a generic syntax for parsing macros.

	* apibuild.py: Special case  VIR_ENUM_IMPL & VIR_ENUM_DECL

2012-05-24  Michal Privoznik  <mprivozn@redhat.com>

	security: Switch to C99-style struct initialization

2012-05-24  Wen Congyang  <wency@cn.fujitsu.com>

	fix building error on non fedora system
	We forget to define with_storage_rbd if the system is not fedora,
	or the version is less than 16.

2012-05-24  Daniel P. Berrange  <berrange@redhat.com>

	Add stub impl of virNetlinkEventServiceLocalPid for Win32
	The libvirt_private.syms file exports virNetlinkEventServiceLocalPid
	so there needs to be a no-op stub for Win32 to avoid linker errors

2012-05-24  Daniel P. Berrange  <berrange@redhat.com>

	Enable driver modules in libvirt RPM
	Turn on loadable modules for libvirtd. Add new sub-RPMs
	libvirt-daemon-driver-XXX, one for each loadable .so.
	Modify the libvirt-daemon-YYY RPMs to depend on each of
	the individual drivers they required

	* libvirt.spec.in: Enable driver modules

2012-05-24  Daniel P. Berrange  <berrange@redhat.com>

	Default to enable driver modules for libvirtd
	Always enable driver modules for libvirtd, if we have dlopen
	available. This allows more modular packaging by distros
	and ensures we don't break this config

	* configure.ac: Default to enable driver modules

2012-05-24  Daniel P. Berrange  <berrange@redhat.com>

	Add test case for loading driver modules
	To ensure all symbols used by loadable driver modules are
	exported in libvirt.so, add a test suite that simply loads
	each driver in turn

	* tests/Makefile.am, tests/virdrivermoduletest.c: Add
	  a test case for loading drivers

2012-05-24  Daniel P. Berrange  <berrange@redhat.com>

	Override default driver dir when running from GIT
	* daemon/libvirtd.c: Set custom driver module dir if the current
	  binary name is 'lt-libvirtd' (indicating execution directly
	  from GIT checkout)
	* src/driver.c, src/driver.h, src/libvirt_driver_modules.syms: Add
	  virDriverModuleInitialize to allow driver module location to
	  be changed

2012-05-24  Daniel P. Berrange  <berrange@redhat.com>

	Split QEMU dtrace probes into separate file
	When building as driver modules, it is not possible for the QEMU
	driver module to reference the DTrace/SystemTAP probes linked into
	the main libvirt.so. Thus we need to move the QEMU probes into a
	separate file 'libvirt_qemu_probes.d'. Also rename the existing
	file from 'probes.d' to 'libvirt_probes.d' while we're at it

	* daemon/Makefile.am, src/internal.h: Include libvirt_probes.h
	  instead of probes.h
	* src/Makefile.am: Add rules for libvirt_qemu_probes.d
	* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor_json.c,
	  src/qemu/qemu_monitor_text.c: Include libvirt_qemu_probes.h
	* src/libvirt_probes.d: Rename from probes.d
	* src/libvirt_qemu_probes.d: QEMU specific probes formerly
	  in probes.d

2012-05-24  Daniel P. Berrange  <berrange@redhat.com>

	Replace RTLD_LOCAL with RTLD_GLOBAL
	Since we have drivers which depend on each other (ie QEMU/LXC
	depend on the network driver APIs), we need to use RTLD_GLOBAL
	instead of RTLD_LOCAL. While this pollutes the calling binary
	with many more symbols, this is no worse than if we directly
	link to the drivers, and this only applies to libvirtd

	* src/driver.c: s/RTLD_LOCAL/RTLD_GLOBAL/

2012-05-24  Daniel P. Berrange  <berrange@redhat.com>

	Ensure LXC driver links against libblkid explicitly.
	Only libvirt_driver_storage.la links to libblkid currently. If
	we are running in a scenario with driver modules, LXC must
	directly link to it, since it can't assume the storage driver
	is present

2012-05-24  Daniel P. Berrange  <berrange@redhat.com>

	Remove libvirt_test.la library
	The libvirt_test.la library was introduced to allow test suites
	to reference internal-only symbols. These days, nearly every
	symbol we care about is in src/libvirt_private.syms, so there
	is no need for libvirt_test.la to continue to exist

	* src/Makefile.am: Delete libvirt_test.la & add new .syms files
	* src/libvirt_private.syms: Export symbols needed by test suite
	* tests/Makefile.am: Link to libvirt_test.la. Ensure LXC tests link
	  to network_driver.la
	* src/libvirt_esx.syms, src/libvirt_openvz.syms: Add exports needed
	  by test suite

2012-05-24  Daniel P. Berrange  <berrange@redhat.com>

	Fix broken linkage of libvirt_driver_nodedev.la
	libvirt_driver_nodedev.la should not link against either
	libvirt_util.la or gnulib.la, since libvirt.so brings
	in those deps.

	* src/Makefile.am: Fix broken linkage of libvirt_driver_nodedev.la

2012-05-24  Daniel P. Berrange  <berrange@redhat.com>

	Only build server side drivers as modules
	The driver modules all use symbols which are defined in libvirt.so.
	Thus for loading of modules to work, the binary that libvirt.so
	is linked to must export its symbols back to modules. If the
	libvirt.so itself is dlopen()d then the RTLD_GLOBAL flag must
	be set. Unfortunately few, if any, programming languages use
	the RTLD_GLOBAL flag when loading modules :-( This means is it
	not practical to use driver modules for any libvirt client side
	drivers (OpenVZ, VMWare, Hyper-V, Remote client, test).

	This patch changes the build process so only server side drivers
	are built as modules (Xen, QEMU, LXC, UML)

	* daemon/libvirtd.c: Add missing load of 'interface' driver
	* src/Makefile.am: Only build server side drivers as modules
	* src/libvirt.c: Don't load any driver modules

2012-05-24  Daniel P. Berrange  <berrange@redhat.com>

	Fix dep from libvirt-lock-sanlock RPM
	The libvirt-lock-sanlock RPM requires libvirtd, so its RPM dep
	should be on libvirt-daemon, not libvirt

2012-05-24  Guido Günther  <agx@sigxcpu.org>

	openvz: add quota argument when creating container

	openvz: support file system quota reporting

	Introduce filesystem limits to virDomainFSDef

	Introduce virDomainParseScaledValue
	and use it for virDomainParseMemory. This allows to parse arbitrary
	scaled value, not only memory related values as needed for the
	filesystem limits code following later in this series.

2012-05-23  Daniel P. Berrange  <berrange@redhat.com>

	Remove more bogus systemd service dependencies
	Adding syslog.target is obsolete, avahi.target does not
	exist and dbus.target is also obsolete

	Reported-by: Lennart Poettering <lpoetter@redhat.com>

2012-05-23  Jiri Denemark  <jdenemar@redhat.com>

	Revert "rpc: Discard non-blocking calls only when necessary"
	This reverts commit b1e374a7ac56927cfe62435179bf0bba1e08b372, which was
	rather bad since I failed to consider all sides of the issue. The main
	things I didn't consider properly are:

	- a thread which sends a non-blocking call waits for the thread with
	  the buck to process the call
	- the code doesn't expect non-blocking calls to remain in the queue
	  unless they were already partially sent

	Thus, the reverted patch actually breaks more than what it fixes and
	clients (which may even be libvirtd during p2p migrations) will likely
	end up in a deadlock.

2012-05-23  Peter Krempa  <pkrempa@redhat.com>

	qemu_hotplug: Don't free the PCI device structure after hot-unplug
	The pciDevice structure corresponding to the device being hot-unplugged
	was freed after it was "stolen" from activeList. The pointer was still
	used for eg-inactive list. This patch removes the free of the structure
	and frees it only if reset fails on the device.

2012-05-22  Laine Stump  <laine@laine.org>

	util: export virBufferTrim
	This was forgotten in commit cdb87b1c4b3c325c61e2a6a7d8edcca3ca73a765.

2012-05-22  Eric Blake  <eblake@redhat.com>

	virBuffer: add way to trim back extra text
	I'm tired of writing:

	bool sep = false;
	while (...) {
	    if (sep)
	       virBufferAddChar(buf, ',');
	    sep = true;
	    virBufferAdd(buf, str);
	}

	This makes it easier, allowing one to write:

	while (...)
	    virBufferAsprintf(buf, "%s,", str);
	virBufferTrim(buf, ",", -1);

	to trim any remaining comma.

	* src/util/buf.h (virBufferTrim): Declare.
	* src/util/buf.c (virBufferTrim): New function.
	* tests/virbuftest.c (testBufTrim): Test it.

2012-05-22  Wido den Hollander  <wido@widodh.nl>

	storage backend: Add RBD (RADOS Block Device) support
	This patch adds support for a new storage backend with RBD support.

	RBD is the RADOS Block Device and is part of the Ceph distributed storage
	system.

	It comes in two flavours: Qemu-RBD and Kernel RBD, this storage backend only
	supports Qemu-RBD, thus limiting the use of this storage driver to Qemu only.

	To function this backend relies on librbd and librados being present on the
	local system.

	The backend also supports Cephx authentication for safe authentication with
	the Ceph cluster.

	For storing credentials it uses the built-in secret mechanism of libvirt.

2012-05-22  Eric Blake  <eblake@redhat.com>

	build: fix unused variable after last patch
	The previous commit (2cb0899) left a dead variable behind.

	* src/libxl/libxl_driver.c (libxlClose): Drop dead variable.

2012-05-22  Daniel P. Berrange  <berrange@redhat.com>

	Fix potential events deadlock when unref'ing virConnectPtr
	When the last reference to a virConnectPtr is released by
	libvirtd, it was possible for a deadlock to occur in the
	virDomainEventState functions. The virDomainEventStatePtr
	holds a reference on virConnectPtr for each registered
	callback. When removing a callback, the virUnrefConnect
	function is run. If this causes the last reference on the
	virConnectPtr to be released, then virReleaseConnect can
	be run, which in turns calls qemudClose. This function has
	a call to virDomainEventStateDeregisterConn which is intended
	to remove all callbacks associated with the virConnectPtr
	instance. This will try to grab a lock on virDomainEventState
	but this lock is already held. Deadlock ensues

	Thread 1 (Thread 0x7fcbb526a840 (LWP 23185)):

	Since each callback associated with a virConnectPtr holds a
	reference on virConnectPtr, it is impossible for the qemudClose
	method to be invoked while any callbacks are still registered.
	Thus the call to virDomainEventStateDeregisterConn must in fact
	be a no-op. Thus it is possible to just remove all trace of
	virDomainEventStateDeregisterConn and avoid the deadlock.

	* src/conf/domain_event.c, src/conf/domain_event.h,
	  src/libvirt_private.syms: Delete virDomainEventStateDeregisterConn
	* src/libxl/libxl_driver.c, src/lxc/lxc_driver.c,
	  src/qemu/qemu_driver.c, src/uml/uml_driver.c: Remove
	  calls to virDomainEventStateDeregisterConn

2012-05-21  Jim Fehlig  <jfehlig@suse.com>

	Fix build when configuring with polkit0
	Commit 2223ea98 removed the only use of 'server' param in
	remoteDispatchAuthPolkit().  Mark the parameter with ATTRIBUTE_UNUSED
	to fix the build when configuring with polkit0.

2012-05-21  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	nwfilter: Add support for ipset
	This patch adds support for the recent ipset iptables extension
	to libvirt's nwfilter subsystem. Ipset allows to maintain 'sets'
	of IP addresses, ports and other packet parameters and allows for
	faster lookup (in the order of O(1) vs. O(n)) and rule evaluation
	to achieve higher throughput than what can be achieved with
	individual iptables rules.

	On the command line iptables supports ipset using

	iptables ... -m set --match-set <ipset name> <flags> -j ...

	where 'ipset name' is the name of a previously created ipset and
	flags is a comma-separated list of up to 6 flags. Flags use 'src' and 'dst'
	for selecting IP addresses, ports etc. from the source or
	destination part of a packet. So a concrete example may look like this:

	iptables -A INPUT -m set --match-set test src,src -j ACCEPT

	Since ipset management is quite complex, the idea was to leave ipset 
	management outside of libvirt but still allow users to reference an ipset.
	The user would have to make sure the ipset is available once the VM is
	started so that the iptables rule(s) referencing the ipset can be created.

	Using XML to describe an ipset in an nwfilter rule would then look as
	follows:

	  <rule action='accept' direction='in'>
	    <all ipset='test' ipsetflags='src,src'/>
	  </rule>

	The two parameters on the command line are also the two distinct XML attributes
	'ipset' and 'ipsetflags'.

	FYI: Here is the man page for ipset:

	https://ipset.netfilter.org/ipset.man.html

	Regards,
	    Stefan

2012-05-18  Eric Blake  <eblake@redhat.com>

	build: fix virnetlink on glibc 2.11
	We were being lazy - virnetlink.c was getting uint32_t as a
	side-effect from glibc 2.14's <unistd.h>, but older glibc 2.11
	does not provide uint32_t from <unistd.h>.  In fact, POSIX states
	that <unistd.h> need only provide intptr_t, not all of <stdint.h>,
	so the bug really is ours.  Reported by Jonathan Alescio.

	* src/util/virnetlink.h: Include <stdint.h>.

2012-05-18  Hu Tao  <hutao@cn.fujitsu.com>

	Adds support to param 'vcpu_time' in qemu_driver.
	This involves setting the cpuacct cgroup to a per-vcpu granularity,
	as well as summing the each vcpu accounting into a common array.
	Now that we are reading more than one cgroup file, we double-check
	that cpus weren't hot-plugged between reads to invalidate our
	summing.

2012-05-18  Hu Tao  <hutao@cn.fujitsu.com>

	Add a new param 'vcpu_time' to virDomainGetCPUStats
	Currently virDomainGetCPUStats gets total cpu usage, which consists
	of:

	  1. vcpu usage: the physical cpu time consumed by virtual cpu(s) of
	     domain
	  2. hypervisor: `total cpu usage' - `vcpu usage'

	The param 'vcpu_time' is for getting vcpu usages.

2012-05-18  Marc-André Lureau  <marcandre.lureau@gmail.com>

	tests: add ich6 codec type test to qemuxml2argv-sound-device
	Test new codec type element.

	qemu: honour sound <codec> sub-elements
	With ICH6 audio device, allow to specify codecs.
	By default, for compatibility reasons, if no codec is specified,
	"hda-duplex" will be used.

	domain: add <codec> sound sub-element
	Allow specifying sound device codecs. See formatdomain.html for
	more details.

	qemu: test CAPS_HDA_MICRO

2012-05-17  Michal Privoznik  <mprivozn@redhat.com>

	qemu: Don't delete USB device on failed qemuPrepareHostdevUSBDevices
	If qemuPrepareHostdevUSBDevices fail it will roll back devices added
	to the driver list of used devices. However, if it may fail because
	the device is being used already. But then again - with roll back.
	Therefore don't try to remove a usb device manually if the function
	fail. Although, we want to remove the device if any operation
	performed afterwards fail.

2012-05-17  Eric Blake  <eblake@redhat.com>

	nodeinfo: test more details
	Make it obvious why we need Osier's patch in commit 10d9038b
	to fix NUMA parsing of an AMD machine with two cores sharing
	a socket id.

	* tests/nodeinfotest.c (linuxTestCompareFiles): Enhance the test.
	* tests/nodeinfodata/linux-nodeinfo-sysfs-test-*-output.txt: Update.

2012-05-17  Daniel P. Berrange  <berrange@redhat.com>

	Add a virLogMessage alternative taking va_list args
	Allow the logging APIs to be called with a va_list for format
	args, instead of requiring var-args usage.

	* src/util/logging.h, src/util/logging.c: Add virLogVMessage

2012-05-16  Eric Blake  <eblake@redhat.com>

	build: fix recent syntax-check breakage
	The use of readlink() in lxc_container.c is intentional; we don't
	want an absolute pathname there.

	* src/util/cgroup.h (VIR_CGROUP_SYSFS_MOUNT): Indent properly.
	* cfg.mk (exclude_file_name_regexp--sc_prohibit_readlink): Add
	exemption.

2012-05-16  Michal Privoznik  <mprivozn@redhat.com>

	qemu: Rollback on used USB devices
	One of our latest USB device handling patches
	05abd1507d66aabb6cad12eeafeb4c4d1911c585 introduced a regression.
	That is, we first create a temporary list of all USB devices that
	are to be used by domain just starting up. Then we iterate over and
	check if a device from the list is in the global list of currently
	assigned devices (activeUsbHostdevs). If not, we add it there and
	continue with next iteration then. But if a device from temporary
	list is either taken already or adding to the activeUsbHostdevs fails,
	we remove all devices in temp list from the activeUsbHostdevs list.
	Therefore, if a device is already taken we remove it from
	activeUsbHostdevs even if we should not. Thus, next time we allow
	the device to be assigned to another domain.

2012-05-16  Daniel P. Berrange  <berrange@redhat.com>

	Fix build compat with older libselinux for LXC
	Most versions of libselinux do not contain the function
	selinux_lxc_contexts_path() that the security driver
	recently started using for LXC. We must add a conditional
	check for it in configure and then disable the LXC security
	driver for builds where libselinux lacks this function.

	* configure.ac: Check for selinux_lxc_contexts_path
	* src/security/security_selinux.c: Disable LXC security
	  if selinux_lxc_contexts_path() is missing

2012-05-16  Daniel P. Berrange  <berrange@redhat.com>

	Reject any non-option command line arguments
	Due to a bug in editing /etc/sysconfig/libvirtd, VDSM was causing
	libvirt processes to run with the following command line args

	   /usr/sbin/libvirtd --listen '#' 'by vdsm'

	While it correctly rejects any invalid option flags, libvirtd
	was not rejecting any non-option command line arguments

	* daemon/libvirtd.c: Reject non-option argv

2012-05-16  Daniel P. Berrange  <berrange@redhat.com>

	Remount cgroups controllers after setting up new /sys in LXC
	Normal practice is for cgroups controllers to be mounted at
	/sys/fs/cgroup. When setting up a container, /sys is mounted
	with a new sysfs instance, thus we must re-mount all the
	cgroups controllers. The complexity is that we must mount
	them in the same layout as the host OS. ie if 'cpu' and 'cpuacct'
	were mounted at the same location in the host we must preserve
	this in the container. Also if any controllers are co-located
	we must setup symlinks from the individual controller name to
	the co-located mount-point

	Trim /proc & /sys subtrees before mounting new instances
	Both /proc and /sys may have sub-mounts in them from the host
	OS. We must explicitly unmount them all before mounting the
	new instance over that location. If we don't then /proc/mounts
	will show the sub-mounts as existing, even though nothing will
	be able to access them, due to the over-mount.

2012-05-16  Daniel P. Berrange  <berrange@redhat.com>

	Avoid LXC pivot root in the root source is still /
	If the LXC config has a filesystem

	  <filesystem>
	     <source dir='/'/>
	     <target dir='/'/>
	  </filesystem>

	then there is no need to go down the pivot root codepath.
	We can simply use the existing root as needed.

2012-05-16  Daniel P. Berrange  <berrange@redhat.com>

	Mount fresh instance of sysfs/selinux in LXC
	Currently to make sysfs readonly, we remount the existing
	instance and then bind it readonly. Unfortunately this means
	sysfs is still showing device objects wrt the host OS namespace.
	We need it to reflect the container namespace, so we must mount
	a completely new instance of it. Do the same for selinuxfs since
	there is no benefit to bind mounting & this lets us simplify
	the code.

	* src/lxc/lxc_container.c: Mount fresh sysfs instance

2012-05-16  Daniel Walsh  <dwalsh@redhat.com>

	Convert the LXC driver to use the security driver API for mount options
	Instead of hardcoding use of SELinux contexts in the LXC driver,
	switch over to using the official security driver API.

	Add security driver APIs for getting mount options
	Some security drivers require special options to be passed to
	the mount system call. Add a security driver API for handling
	this data.

2012-05-16  Daniel Walsh  <dwalsh@redhat.com>

	Add support for LXC specific SELinux configuration
	The SELinux policy for LXC uses a different configuration file
	than the traditional svirt one. Thus we need to load
	/etc/selinux/targeted/contexts/lxc_contexts which contains
	something like this:

	 process = "system_u:system_r:svirt_lxc_net_t:s0"
	 file = "system_u:object_r:svirt_lxc_file_t:s0"
	 content = "system_u:object_r:virt_var_lib_t:s0"

	cleverly designed to be parsable by virConfPtr

2012-05-16  Daniel Walsh  <dwalsh@redhat.com>

	Use private data struct in SELinux driver
	Currently the SELinux driver stores its state in a set of global
	variables. This switches it to use a private data struct instead.
	This will enable different instances to have their own data.

	Don't enable the AppArmour security driver with LXC
	The AppArmour driver does not currently have support for LXC
	so ensure that when probing, it claims to be disabled

	Pass the virt driver name into security drivers
	To allow the security drivers to apply different configuration
	information per hypervisor, pass the virtualization driver name
	into the security manager constructor.

2012-05-16  Daniel P. Berrange  <berrange@redhat.com>

	Remove bogus udev.target dep from libvirtd unit
	There is no 'udev.target' unit in systemd (only 'udev.service')
	yet libvirtd's unit file had a dep on one. There's no compelling
	reason for a dep on udev, so remove it altogether.

	Reported-by: Avi Kivity <avi@redhat.com>

2012-05-16  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Add support for -no-user-config
	Thanks to this new option we are now able to use modern CPU models (such
	as Westmere) defined in external configuration file.

	The qemu-1.1{,-device} data files for qemuhelptest are filled in with
	qemu-1.1-rc2 output for now. I will update those files with real
	qemu-1.1 output once it is released.

2012-05-16  Daniel P. Berrange  <berrange@redhat.com>

	Set a sensible default master start port for ehci companion controllers
	The uhci1, uhci2, uhci3 companion controllers for ehci1 must
	have a master start port set. Since this value is predictable
	we should set it automatically if the app does not supply it

2012-05-16  Daniel P. Berrange  <berrange@redhat.com>

	Fix logic for assigning PCI addresses to USB2 companion controllers
	Currently each USB2 companion controller gets put on a separate
	PCI slot. Not only is this wasteful of PCI slots, but it is not
	in compliance with the spec for USB2 controllers. The master
	echi1 and all companion controllers should be in the same slot,
	with echi1 in function 7, and uhci1-3 in functions 0-2 respectively.

	* src/qemu/qemu_command.c: Special case handling of USB2 controllers
	  to apply correct pci slot assignment
	* tests/qemuxml2argvdata/qemuxml2argv-usb-ich9-ehci-addr.args,
	  tests/qemuxml2argvdata/qemuxml2argv-usb-ich9-ehci-addr.xml: Expand
	  test to cover automatic slot assignment

2012-05-16  Daniel P. Berrange  <berrange@redhat.com>

	Fix virDomainDeviceInfoIsSet() to check all struct fields
	The virDomainDeviceInfoIsSet API was only checking if an
	address or alias was set in the struct. Thus if only a
	rom bar setting / filename, boot index, or USB master
	value was set, they could be accidentally dropped when
	formatting XML

	Remove redundant trailing slash in user dir paths
	Callers of virGetUser{Config,Runtime,Cache}Directory all
	append further path component. We should not be
	adding a trailing slash in the return path otherwise we
	get paths containing '//'

2012-05-16  Daniel P. Berrange  <berrange@redhat.com>

	Allow stack traces to be included with log messages
	Sometimes it is useful to see the callpath for log messages.
	This change enhances the log filter syntax so that stack traces
	can be show by setting '1:+NAME' instead of '1:NAME'.

	This results in output like:

	2012-05-09 14:18:45.136+0000: 13314: debug : virInitialize:414 : register drivers
	/home/berrange/src/virt/libvirt/src/.libs/libvirt.so.0(virInitialize+0xd6)[0x7f89188ebe86]
	/home/berrange/src/virt/libvirt/tools/.libs/lt-virsh[0x431921]
	/lib64/libc.so.6(__libc_start_main+0xf5)[0x3a21e21735]
	/home/berrange/src/virt/libvirt/tools/.libs/lt-virsh[0x40a279]

	2012-05-09 14:18:45.136+0000: 13314: debug : virRegisterDriver:775 : driver=0x7f8918d02760 name=Test
	/home/berrange/src/virt/libvirt/src/.libs/libvirt.so.0(virRegisterDriver+0x6b)[0x7f89188ec717]
	/home/berrange/src/virt/libvirt/src/.libs/libvirt.so.0(+0x11b3ad)[0x7f891891e3ad]
	/home/berrange/src/virt/libvirt/src/.libs/libvirt.so.0(virInitialize+0xf3)[0x7f89188ebea3]
	/home/berrange/src/virt/libvirt/tools/.libs/lt-virsh[0x431921]
	/lib64/libc.so.6(__libc_start_main+0xf5)[0x3a21e21735]
	/home/berrange/src/virt/libvirt/tools/.libs/lt-virsh[0x40a279]

	* docs/logging.html.in: Document new syntax
	* configure.ac: Check for execinfo.h
	* src/util/logging.c, src/util/logging.h: Add support for
	  stack traces
	* tests/testutils.c: Adapt to API change

2012-05-15  Daniel P. Berrange  <berrange@redhat.com>

	Move user libvirtd socket out of abstract namespace
	The current unprivileged user libvirtd sockets are in the abstract
	namespace. This has a number of problems

	 - You can't connect to them remotely using the nc/ssh tunnel
	 - This is not portable for OS-X, BSD & probably others
	 - Parent directory permissions don't apply

2012-05-15  Daniel P. Berrange  <berrange@redhat.com>

	Add openvz_util.c to POTFILES

2012-05-15  Daniel P. Berrange  <berrange@redhat.com>

	Add bundled(gnulib) to RPM specfile
	According to Fedora guidelines, because we bundle gnulib we
	need to add a virtual Provides: bundled(gnulib).

	https://fedoraproject.org/wiki/Packaging:No_Bundled_Libraries#Requirement_if_you_bundle

2012-05-15  Guido Günther  <agx@sigxcpu.org>

	openvz: determine kb/pages only once
	to save some syscalls (as suggested by Eric Blake)

2012-05-15  Osier Yang  <jyang@redhat.com>

	libvirt-guests: Remove LISTFILE if it's empty when stopping service
	$LISTFILE is created even no domain is running, and the empty
	$LISTFILE could cause improper service status.

	    stopped ,with saved guests

	Which is not right, as there is no domain was saved.

2012-05-15  Osier Yang  <jyang@redhat.com>

	nodeinfo: Get the correct CPU number on AMD Magny Cours platform
	"Instead of developing one CPU with 12 cores, the Magny Cours is
	actually two 6 core “Bulldozer” CPUs combined in to one package"

	I.e, each package has two NUMA nodes, and the two numa nodes share
	the same core ID set (0-6), which means parsing the cores number
	from sysfs doesn't work in this case.

	And the wrong CPU number could cause three problems for libvirt:

	1) performance lost

	  A domain without "cpuset" or "placement='auto'" (to drive numad)
	specified will be only pinned to part of the CPUs.

	2) domain can be started

	  If a domain uses numad, and the advisory nodeset returned from
	numad contains node which exceeds the range of wrong total CPU
	number. The domain will fail to start, as the bitmask passed to
	sched_setaffinity could be fully filled with zero.

	3) wrong CPU number affects lots of stuffs.

	  E.g. for command "virsh vcpuinfo", "virsh vcpupin", it will always
	output with the truncated CPU list.

	For more details:

	https://www.redhat.com/archives/libvir-list/2012-May/msg00607.html

	This patch is to fix the problem by parsing /proc/cpuinfo to get
	the value of field "cpu cores", and use it as nodeinfo->cores if
	it's greater than the cores number from sysfs.

2012-05-15  Osier Yang  <jyang@redhat.com>

	qemu: Set memory policy using cgroup if placement is auto
	Like for 'static' placement, when the memory policy mode is
	'strict', set the memory policy by writing the advisory nodeset
	returned from numad to cgroup file cpuset.mems,

2012-05-15  Osier Yang  <jyang@redhat.com>

	qemu: Use the CPU index in capabilities to map NUMA node to cpu list.
	On some of the NUMA platforms, the CPU index in each NUMA node
	grows non-consecutive. While on other platforms, it can be inconsecutive,
	E.g.

	% numactl --hardware
	available: 4 nodes (0-3)
	node 0 cpus: 0 4 8 12 16 20 24 28
	node 0 size: 131058 MB
	node 0 free: 86531 MB
	node 1 cpus: 1 5 9 13 17 21 25 29
	node 1 size: 131072 MB
	node 1 free: 127070 MB
	node 2 cpus: 2 6 10 14 18 22 26 30
	node 2 size: 131072 MB
	node 2 free: 127758 MB
	node 3 cpus: 3 7 11 15 19 23 27 31
	node 3 size: 131072 MB
	node 3 free: 127226 MB
	node distances:
	node   0   1   2   3
	  0:  10  20  20  20
	  1:  20  10  20  20
	  2:  20  20  10  20
	  3:  20  20  20  10

	This patch is to fix the problem by using the CPU index in
	caps->host.numaCell[i]->cpus[i] to set the bitmask instead of
	assuming the CPU index of the NUMA nodes are always sequential.

2012-05-15  Li Zhang  <zhlcindy@linux.vnet.ibm.com>

	Assign spapr-vio bus address to ibmvscsi controller
	For pseries guest, the default controller model is
	ibmvscsi controller, this controller only can work
	on spapr-vio address.

	This patch is to assign spapr-vio address type to
	ibmvscsi controller and correct vscsi test case.

2012-05-15  David Weber  <wb@munzinger.de>

	sanlock: fix locking for readonly devices
	Add ignore param for readonly and shared disk in sanlock

2012-05-15  Eric Blake  <eblake@redhat.com>

	nodeinfo: add some more tests
	Test 2 data grabbed from a 2-core 1-node laptop.
	Test 3 data grabbed from a 48-cpu AMD Magny Cours box.

	* tests/nodeinfodata/linux-nodeinfo-sysfs-test-2*: New test data.
	* tests/nodeinfodata/linux-nodeinfo-sysfs-test-3*: Likewise.
	* tests/nodeinfotest.c (mymain): Run them.
	* cfg.mk
	(exclude_file_name_regexp--sc_prohibit_empty_lines_at_EOF): Exempt
	new test files.

2012-05-15  Eric Blake  <eblake@redhat.com>

	nodeinfo: avoid probing host filesystem during test
	We had previously weakened our nodeinfotest in order to ignore parsed
	node values, because the parse function was mistakenly relying on
	host files.  A better fix is to avoid using the numactl library, but
	to instead parse the same files that numactl would read, all while
	allowing the files to be relative to our choice of directory.

	* src/nodeinfo.c (CPU_SYS_PATH, NODE_SYS_PATH): Replace with...
	(SYSFS_SYSTEM_PATH): ...parent directory.
	(linuxNodeInfoCPUPopulate): Check NUMA nodes from requested
	directory (by inlining numactl code).
	(nodeGetCPUmap, nodeGetMemoryStats): Adjust macro use.
	* tests/nodeinfotest.c (linuxTestCompareFiles, linuxTestNodeInfo):
	Update test to match.

2012-05-15  Eric Blake  <eblake@redhat.com>

	nodeinfo: drop static variable
	We were wasting time to malloc a copy of a constant string, then
	copy it into static storage, for every call to nodeGetInfo.  At
	least we were lucky that it was a constant source, and thus not
	subject to even worse issues with one thread clobbering the static
	storage while another was using it.  This gets rid of the waste,
	by passing the string through the stack instead, as well as renaming
	internal functions to better match our conventions.

	* src/nodeinfo.c (sysfs_path): Delete.
	(get_cpu_value, count_thread_siblings, parse_socket): Add
	parameter, and rename...
	(virNodeGetCpuValue, virNodeCountThreadSiblings)
	(virNodeParseSocket): ... into a common namespace.
	(cpu_online, parse_core): Inline into callers.
	(linuxNodeInfoCPUPopulate): Update caller.
	(nodeGetInfo): Drop a useless malloc.

2012-05-14  Eric Blake  <eblake@redhat.com>

	build: really silence the 32-bit warning
	Commit cdce2f42d tried to silence a compiler warning on 32-bit builds,
	but the gcc shipped with RHEL 5 is old enough that the type conversion
	via multiplication by 1 was insufficient for the task.

	* src/qemu/qemu_monitor.c (qemuMonitorBlockJob): Previous attempt
	didn't get past all gcc versions.

2012-05-14  Eric Blake  <eblake@redhat.com>

	maint: fix AUTHORS
	Use the address specified in the actual commit, to placate
	'make syntax-check'.

2012-05-14  William Jon McCann  <william.jon.mccann@gmail.com>

	Use XDG Base Directories instead of storing in home directory
	As defined in:
	http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html

	This offers a number of advantages:
	 * Allows sharing a home directory between different machines, or
	sessions (eg. using NFS)
	 * Cleanly separates cache, runtime (eg. sockets), or app data from
	user settings
	 * Supports performing smart or selective migration of settings
	between different OS versions
	 * Supports reseting settings without breaking things
	 * Makes it possible to clear cache data to make room when the disk
	is filling up
	 * Allows us to write a robust and efficient backup solution
	 * Allows an admin flexibility to change where data and settings are stored
	 * Dramatically reduces the complexity and incoherence of the
	system for administrators

2012-05-14  Daniel Veillard  <veillard@redhat.com>

	Release of libvirt-0.9.12
	* configure.ac docs/news.html.in libvirt.spec.in: updates for the release
	* po/*.po: pushed new sources and synchronized new languages translations

2012-05-13  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Fix memory leaks in error paths related to transferred ownership
	Appending an item to a list transfers ownership of that item to the
	list owner. But an error can occur in between item allocation and
	appending it to the list. In this case the item has to be freed
	explicitly. This was not done in some special cases resulting in
	possible memory leaks.

	Reported by Coverity.

2012-05-11  Peter Krempa  <pkrempa@redhat.com>

	qemu: Don't skip detection of virtual cpu's on non KVM targets
	This patch lifts the limit of calling thread detection code only on KVM
	guests. With upstream qemu the thread mappings are reported also on
	non-KVM machines.

	QEMU adopted the thread_id information from the kvm branch.

	To remain compatible with older upstream versions of qemu the check is
	attempted but the failure to detect threads (or even run the monitor
	command - on older versions without SMP support) is treated non-fatal
	and the code reports one vCPU with pid of the hypervisor (in same
	fashion this was done on non-KVM guests).

2012-05-11  Peter Krempa  <pkrempa@redhat.com>

	qemu: Re-detect virtual cpu threads after cpu hot (un)plug.
	After a cpu hotplug the qemu driver did not refresh information about
	virtual processors used by qemu and their corresponding threads. This
	patch forces a re-detection as is done on start of QEMU.

	This ensures that correct information is reported by the
	virDomainGetVcpus API and "virsh vcpuinfo".

	A failure to obtain the thread<->vcpu mapping is treated non-fatal and
	the mapping is not updated in a case of failure as not all versions of
	QEMU report this in the info cpus command.

2012-05-11  Peter Krempa  <pkrempa@redhat.com>

	qemu: Refactor qemuDomainSetVcpusFlags
	This patch changes a switch statement into ifs when handling live vs.
	configuration modifications getting rid of redundant code in case when
	both live and persistent configuration gets changed.

2012-05-11  Eric Blake  <eblake@redhat.com>

	build: fix stamp file name
	Ever since commit c964b6a, make was trying to find the timestamp
	of '""./apibuild.py".stamp"', but only touching 'apibuild.py.stamp',
	and thus always rebuilding.  Reported by Daniel P. Berrange.

	* docs/Makefile.am (APIBUILD, APIBUILD_STAMP): Omit bogus quotes.

2012-05-11  Guannan Ren  <gren@redhat.com>

	usb: fix crash when failing to attach a second usb device
	when failing to attach another usb device to a domain for some reason
	which has one use device attached before, the libvirtd crashed.
	The crash is caused by null-pointer dereference error in invoking
	usbDeviceListSteal passed in NULL value usb variable.
	commit 05abd1507d66aabb6cad12eeafeb4c4d1911c585 introduces the bug.

2012-05-11  Eric Blake  <eblake@redhat.com>

	docs: mention migration issue of which credentials are used
	Based on a report by Seth Vidal.  Just because _you_ can use virsh
	to connect to both source and destinations does not mean that libvirtd
	on the source (aka _root_) can likewise connect to the destination;
	this matters when setting up a peer-to-peer migration instead of a
	native one.

	* docs/migration.html.in: Mention that in peer-to-peer, the owner
	of the source libvirtd (usually root) must be able to connect to
	the destination.

2012-05-10  Osier Yang  <jyang@redhat.com>

	build: Fix the typo in configure.ac
	s/nuamd/numad/,

2012-05-10  Alex Jia  <ajia@redhat.com>

	conf: Fix memory leaks in virStoragePoolDefParseSource
	Detected by valgrind. Leaks are introduced in commit 122fa379.

	src/conf/storage_conf.c: fix memory leaks.

	How to reproduce?
	$ make && make -C tests check TESTS=storagepoolxml2xmltest
	$ cd tests && valgrind -v --leak-check=full ./storagepoolxml2xmltest

	actual result:
	==28571== LEAK SUMMARY:
	==28571==    definitely lost: 40 bytes in 5 blocks
	==28571==    indirectly lost: 0 bytes in 0 blocks
	==28571==      possibly lost: 0 bytes in 0 blocks
	==28571==    still reachable: 1,054 bytes in 21 blocks
	==28571==         suppressed: 0 bytes in 0 blocks

2012-05-10  Eric Blake  <eblake@redhat.com>

	qemu: fix build when !HAVE_NUMACTL
	Commit 97010eb1f forgot to change the other side of an #ifdef.

	* src/qemu/qemu_process.c (qemuProcessInitNumaMemoryPolicy): Add
	argument.

2012-05-10  Jim Fehlig  <jfehlig@suse.com>

	Report error when parsing character device target type
	No useful error was being reported when an invalid character device
	target type is specified in the domainXML. E.g.

	    ...
	    <console type="pty">
	      <source path="/dev/pts/2"/>
	      <target type="kvm" port="0"/>
	    </console>
	    ...

	resulted in

	error: Failed to define domain from x.xml
	error: An error occurred, but the cause is unknown

	With this small patch, the error is more helpful

	error: Failed to define domain from x.xml
	error: XML error: unknown target type 'kvm' specified for character device

2012-05-09  Jiri Denemark  <jdenemar@redhat.com>

	netlink: Fix build with libnl-3
	Commit 642973135c54b93242c4548ef27d591b52b0994c added three direct
	references to nl_handle_* instead of using our aliases which hide
	differences between libnl-3 and libnl-1.

2012-05-09  Osier Yang  <jyang@redhat.com>

	numad: Update comments in libvirt.spec.in
	Not only support CPU placement now.

2012-05-09  Osier Yang  <jyang@redhat.com>

	numad: Check numactl-devel if compiled with numad support
	Since now we pre-set memory policy using libnuma to fully
	drive numad, it needs to check numactl-devel if "with_numad"
	is "yes".

	configure with groups "--with-numad=yes --with-numactl=yes",
	"--with-numad=no --with-numactl=yes", "--with-numad=yes
	--with-numactl=yes" works fine after the change.

2012-05-09  Osier Yang  <jyang@redhat.com>

	numad: Divide cur_balloon by 1024 before passing it to numad
	Numad expects MB by default.

	numad: Always output 'placement' of <vcpu>
	<vcpu> is not an optional node. The value for its 'placement'
	actually always defaults to 'static' in the underlying codes.
	(Even no 'cpuset' and 'placement' is specified, the domain
	process will be pinned to all the available pCPUs).

2012-05-09  Osier Yang  <jyang@redhat.com>

	numad: Copy 'placement' of <numatune> to <vcpu> by default
	With this patch, one can also fully drive numad by:

	  <vcpu>2</vcpu>
	  <numatune>
	    <memory placement='auto'/>
	  </numatune>

	New tests are added.

2012-05-09  Osier Yang  <jyang@redhat.com>

	numad: Set memory policy from numad advisory nodeset
	Though numad will manage the memory allocation of task dynamically,
	it wants management application (libvirt) to pre-set the memory
	policy according to the advisory nodeset returned from querying numad,
	(just like pre-bind CPU nodeset for domain process), and thus the
	performance could benefit much more from it.

	This patch introduces new XML tag 'placement', value 'auto' indicates
	whether to set the memory policy with the advisory nodeset from numad,
	and its value defaults to the value of <vcpu> placement, or 'static'
	if 'nodeset' is specified. Example of the new XML tag's usage:

	  <numatune>
	    <memory placement='auto' mode='interleave'/>
	  </numatune>

	Just like what current "numatune" does, the 'auto' numa memory policy
	setting uses libnuma's API too.

	If <vcpu> "placement" is "auto", and <numatune> is not specified
	explicitly, a default <numatume> will be added with "placement"
	set as "auto", and "mode" set as "strict".

	The following XML can now fully drive numad:

	1) <vcpu> placement is 'auto', no <numatune> is specified.

	   <vcpu placement='auto'>10</vcpu>

	2) <vcpu> placement is 'auto', no 'placement' is specified for
	   <numatune>.

	   <vcpu placement='auto'>10</vcpu>
	   <numatune>
	     <memory mode='interleave'/>
	   </numatune>

	And it's also able to control the CPU placement and memory policy
	independently. e.g.

	1) <vcpu> placement is 'auto', and <numatune> placement is 'static'

	   <vcpu placement='auto'>10</vcpu>
	   <numatune>
	     <memory mode='strict' nodeset='0-10,^7'/>
	   </numatune>

	2) <vcpu> placement is 'static', and <numatune> placement is 'auto'

	   <vcpu placement='static' cpuset='0-24,^12'>10</vcpu>
	   <numatune>
	     <memory mode='interleave' placement='auto'/>
	   </numatume>

	A follow up patch will change the XML formatting codes to always output
	'placement' for <vcpu>, even it's 'static'.

2012-05-09  Eric Blake  <eblake@redhat.com>

	snapshot: allow block devices past cgroup
	It turns out that when cgroups are enabled, the use of a block device
	for a snapshot target was failing with EPERM due to libvirt failing
	to add the block device to the cgroup whitelist.  See also
	https://bugzilla.redhat.com/show_bug.cgi?id=810200

	* src/qemu/qemu_driver.c
	(qemuDomainSnapshotCreateSingleDiskActive)
	(qemuDomainSnapshotUndoSingleDiskActive): Account for cgroup.
	(qemuDomainSnapshotCreateDiskActive): Update caller.

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

	tests: add some self-documentation to tests
	Alon tried './qemuxml2argvtest --help' to figure out a test failure,
	but it didn't help.  The information is in HACKING, but it doesn't
	hurt to make the tests also provide their own help.

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

	domain_conf: add "default" to list of valid spice channels
	qemu's behavior in this case is to change the spice server behavior to
	require secure connection to any channel not otherwise specified as
	being in plaintext mode. libvirt doesn't currently allow requesting this
	(via plaintext-channel=<channel name>).

	RHBZ: 819499

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

	domain_conf: add "usbredir" to list of valid spice channels
	Add "usbredir" channel to list of recognized spice channels.

	RHBZ: 819498

2012-05-08  Eric Blake  <eblake@redhat.com>

	build: avoid link failure on Windows
	We only know -lpthread exists on platforms where we build
	threads-pthread.c; but when we build threads-win32.c, LIB_PTHREAD
	is empty.

	* tests/Makefile.am (shunloadtest_LDADD): Use correct library.

2012-05-08  Jim Meyering  <meyering@redhat.com>

	virsh: avoid heap corruption leading to virsh abort
	* tools/virsh.c (vshParseSnapshotDiskspec): Fix off-by-3 memmove
	that would corrupt heap when parsing escaped --diskspec comma.
	Bug introduced via commit v0.9.4-260-g35d52b5.

2012-05-08  Laine Stump  <laine@laine.org>

	util: set src_pid for virNetlinkCommand when appropriate
	Until now, the nl_pid of the source address of every message sent by
	virNetlinkCommand has been set to the value of getpid(). Most of the
	time this doesn't matter, and in the one case where it does
	(communication with lldpad), it previously was the proper thing to do,
	because the netlink event service (which listens on a netlink socket
	for unsolicited messages from lldpad) coincidentally always happened
	to bind with a local nl_pid == getpid().

	With the fix for:

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

	that particular nl_pid is now effectively a reserved value, so the
	netlink event service will always bind to something else
	(coincidentally "getpid() + (1 << 22)", but it really could be
	anything). The result is that communication between lldpad and
	libvirtd is broken (lldpad gets a "disconnected" error when it tries
	to send a directed message).

	The solution to this problem caused by a solution, is to query the
	netlink event service's nlhandle for its "local_port", and send that
	as the source nl_pid (but only when sending to lldpad, of course - in
	other cases we maintain the old behavior of sending getpid()).

	There are two cases where a message is being directed at lldpad - one
	in virNetDevLinkDump, and one in virNetDevVPortProfileOpSetLink.

	The case of virNetDevVPortProfileOpSetLink is simplest to explain -
	only if !nltarget_kernel, i.e. the message isn't targetted for the
	kernel, is the dst_pid set (by calling
	virNetDevVPortProfileGetLldpadPid()), so only in that case do we call
	virNetlinkEventServiceLocalPid() to set src_pid.

	For virNetDevLinkDump, it's a bit more complicated. The call to
	virNetDevVPortProfileGetLldpadPid() was effectively up one level (in
	virNetDevVPortProfileOpCommon), although obscured by an unnecessary
	passing of a function pointer. This patch removes the function
	pointer, and calls virNetDevVPortProfileGetLldpadPid() directly in
	virNetDevVPortProfileOpCommon - if it's doing this, it knows that it
	should also call virNetlinkEventServiceLocalPid() to set src_pid too;
	then it just passes src_pid and dst_pid down to
	virNetDevLinkDump. Since (src_pid == 0 && dst_pid == 0) implies that
	the kernel is the destination, there is no longer any need to send
	nltarget_kernel as an arg to virNetDevLinkDump, so it's been removed.

	The disparity between src_pid being int and dst_pid being uint32_t may
	be a bit disconcerting to some, but I didn't want to complicate
	virNetlinkEventServiceLocalPid() by having status returned separately
	from the value.

2012-05-08  Laine Stump  <laine@laine.org>

	util: function to get local nl_pid used by netlink event socket
	This value will be needed to set the src_pid when sending netlink
	messages to lldpad. It is part of the solution to:

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

	Note that libnl's port generation algorithm guarantees that the
	nl_socket_get_local_port() will always be > 0 (since it is "getpid() +
	(n << 22>" where n is always < 1024), so it is okay to cast the
	uint32_t to int (thus allowing us to use -1 as an error sentinel).

2012-05-08  Laine Stump  <laine@laine.org>

	util: allow specifying both src and dst pid in virNetlinkCommand
	Until now, virNetlinkCommand has assumed that the nl_pid in the source
	address of outgoing netlink messages should always be the return value
	of getpid(). In most cases it actually doesn't matter, but in the case
	of communication with lldpad, lldpad saves this info and later uses it
	to send netlink messages back to libvirt. A recent patch to fix Bug
	816465 changed the order of the universe such that the netlink event
	service socket is no longer bound with nl_pid == getpid(), so lldpad
	could no longer send unsolicited messages to libvirtd. Adding src_pid
	as an argument to virNetlinkCommand() is the first step in notifying
	lldpad of the proper address of the netlink event service socket.

2012-05-08  Laine Stump  <laine@laine.org>

	util: fix libvirtd startup failure due to netlink error
	This is part of the solution to the problem detailed in:

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

	and further detailed in

	  https://www.redhat.com/archives/libvir-list/2012-May/msg00202.htm

	A short explanation is included in the comments of the patch itself.

	Note that this patch by itself breaks communication between lldpad and
	libvirtd, so the other 3 patches in the series must be applied at the
	same time as this patch.

2012-05-07  Guido Günther  <agx@sigxcpu.org>

	openvz: simplify openvzDomainDefineCmd by using virCommandPtr

2012-05-07  Guannan Ren  <gren@redhat.com>

	qemu: call usb search function for hostdev initialization and hotplug
	src/qemu/qemu_hostdev.c:
	refactor qemuPrepareHostdevUSBDevices function, make it focus on
	adding usb device to activeUsbHostdevs after check. After that,
	the usb hotplug function qemuDomainAttachHostDevice also could use
	it.
	expand qemuPrepareHostUSBDevices to perform the usb search,
	rollback on failure.

	src/qemu/qemu_hotplug.c:
	If there are multiple usb devices available with same vendorID and productID,
	but with different value of "bus, device", we give an error to let user
	use <address> to specify the desired one.

2012-05-07  Guannan Ren  <gren@redhat.com>

	usb: create functions to search usb device accurately
	usbFindDevice():get usb device according to
	                idVendor, idProduct, bus, device
	                it is the exact match of the four parameters

	usbFindDeviceByBus():get usb device according to bus, device
	                  it returns only one usb device same as usbFindDevice

	usbFindDeviceByVendor():get usb device according to idVendor,idProduct
	                     it probably returns multiple usb devices.

	usbDeviceSearch(): a helper function to do the actual search

2012-05-07  Cole Robinson  <crobinso@redhat.com>

	rpm: Handle different source URLs for maint releases

	docs: Add 'maintenance releases' link in 'News' sidebar

2012-05-07  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Emit compatible XML when migrating a domain
	When we added the default USB controller into domain XML, we efficiently
	broke migration to older versions of libvirt that didn't support USB
	controllers at all (0.9.4 and earlier) even for domains that don't use
	anything that the older libvirt can't provide. We still want to present
	the default USB controller in any XML seen by a user/app but we can
	safely remove it from the domain XML used during migration. If we are
	migrating to a new enough libvirt, it will add the controller XML back,
	while older libvirt won't be confused with it although it will still
	tell qemu to create the controller.

	Similar approach can be used in the future whenever we find out we
	always enabled some kind of device without properly advertising it in
	domain XML.

2012-05-05  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Don't use virDomainDefFormat* directly
	Always use appropriate qemuDomain{,Def}Format wrapper since it may do
	some additional magic based on the flags.

2012-05-05  Eric Blake  <eblake@redhat.com>

	qemu: reject blockiotune if qemu too old
	Commit 4c82f09e added a capability check for qemu per-device io
	throttling, but only applied it to domain startup.  As mentioned
	in the previous commit (98cec05), the user can still get an 'internal
	error' message during a hotplug attempt, when the monitor command
	doesn't exist.  It is confusing to allow tuning on inactive domains
	only to then be rejected when starting the domain.

	* src/qemu/qemu_driver.c (qemuDomainSetBlockIoTune): Reject
	offline tuning if online can't match it.

2012-05-05  Eric Blake  <eblake@redhat.com>

	qemu: don't modify domain on failed blockiotune
	If you have a qemu build that lacks the blockio tune monitor command,
	then this command:

	$ virsh blkdeviotune rhel6u2 hda --total_bytes_sec 1000
	error: Unable to change block I/O throttle
	error: internal error Unexpected error

	fails as expected (well, the error message is lousy), but the next
	dumpxml shows that the domain was modified anyway.  Worse, that means
	if you save the domain then restore it, the restore will likely fail
	due to throttling being unsupported, even though no throttling should
	even be active because the monitor command failed in the first place.

	* src/qemu/qemu_driver.c (qemuDomainSetBlockIoTune): Check for
	error before making modification permanent.

2012-05-05  Laine Stump  <laine@laine.org>

	util: remove error log from stubs of virNetlinkEventServiceStart|Stop
	These two functions are called from main() on all platforms, and
	always return success on platforms that don't support libnl. They
	still log an error message, though, which doesn't make sense - they
	should just be NOPs on those platforms. (Per a suggestion during
	review, I've turned the logs into debug messages rather than removing
	them completely).

2012-05-05  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	node_device: fix possible non-terminated string
	Error: STRING_NULL:
	/libvirt/src/node_device/node_device_linux_sysfs.c:80:
	string_null_argument: Function "saferead" does not terminate string "*buf".
	/libvirt/src/util/util.c:101:
	string_null_argument: Function "read" fills array "*buf" with a non-terminated string.
	/libvirt/src/node_device/node_device_linux_sysfs.c:87:
	string_null: Passing unterminated string "buf" to a function expecting a null-terminated string.

	uuid: fix possible non-terminated string
	Error: STRING_NULL:
	/libvirt/src/util/uuid.c:273:
	string_null_argument: Function "getDMISystemUUID" does not terminate string "*dmiuuid".
	/libvirt/src/util/uuid.c:241:
	string_null_argument: Function "saferead" fills array "*uuid" with a non-terminated string.
	/libvirt/src/util/util.c:101:
	string_null_argument: Function "read" fills array "*buf" with a non-terminated string.
	/libvirt/src/util/uuid.c:274:
	string_null: Passing unterminated string "dmiuuid" to a function expecting a null-terminated string.
	/libvirt/src/util/uuid.c:138:
	var_assign_parm: Assigning: "cur" = "uuidstr". They now point to the same thing.
	/libvirt/src/util/uuid.c:164:
	string_null_sink_loop: Searching for null termination in an unterminated array "cur".

2012-05-04  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	tests: fix resource leak
	Error: RESOURCE_LEAK:
	/libvirt/tests/qemuxml2argvtest.c:47:
	alloc_arg: Calling allocation function "virAlloc" on "ret".
	/libvirt/src/util/memory.c:101:
	alloc_fn: Storage is returned from allocation function "calloc".
	/libvirt/src/util/memory.c:101:
	var_assign: Assigning: "*((void **)ptrptr)" = "calloc(1UL, size)".
	/libvirt/tests/qemuxml2argvtest.c:54:
	leaked_storage: Variable "ret" going out of scope leaks the storage it points to.

	qemu: fix resource leak
	Error: RESOURCE_LEAK:
	/libvirt/src/qemu/qemu_driver.c:6968:
	alloc_fn: Calling allocation function "calloc".
	/libvirt/src/qemu/qemu_driver.c:6968:
	var_assign: Assigning: "nodeset" =  storage returned from "calloc(1UL, 1UL)".
	/libvirt/src/qemu/qemu_driver.c:6977:
	noescape: Variable "nodeset" is not freed or pointed-to in function "virTypedParameterAssign".
	/libvirt/src/qemu/qemu_driver.c:6997:
	leaked_storage: Variable "nodeset" going out of scope leaks the storage it points to.

	vmx: fix resource leak
	Error: RESOURCE_LEAK:
	/libvirt/src/vmx/vmx.c:2431:
	alloc_fn: Calling allocation function "calloc".
	/libvirt/src/vmx/vmx.c:2431:
	var_assign: Assigning: "networkName" =  storage returned from "calloc(1UL, 1UL)".
	/libvirt/src/vmx/vmx.c:2495:
	leaked_storage: Variable "networkName" going out of scope leaks the storage it points to.

2012-05-04  Guido Günther  <agx@sigxcpu.org>

	openvz: read vmguarpages/privvmpages to set memory tunables

2012-05-04  Osier Yang  <jyang@redhat.com>

	Coverity: Fix resource leak in virnetlink.c

	Coverity: Fix resource leak in nodeinfo.c
	Error: RESOURCE_LEAK:
	/builddir/build/BUILD/libvirt-0.9.10/src/nodeinfo.c:629: alloc_fn: Calling allocation function "fopen".
	/builddir/build/BUILD/libvirt-0.9.10/src/nodeinfo.c:629: var_assign: Assigning: "cpuinfo" =  storage returned from "fopen("/proc/cpuinfo", "r")".
	/builddir/build/BUILD/libvirt-0.9.10/src/nodeinfo.c:638: leaked_storage: Variable "cpuinfo" going out of scope leaks the storage it points to.

	Coverity: Fix resource leak in test driver
	Error: RESOURCE_LEAK:
	/builddir/build/BUILD/libvirt-0.9.10/src/test/test_driver.c:1041: alloc_arg: Calling allocation function "virXPathNodeSet" on "devs".
	/builddir/build/BUILD/libvirt-0.9.10/src/util/xml.c:621: alloc_arg: "virAllocN" allocates memory that is stored into "*list".
	/builddir/build/BUILD/libvirt-0.9.10/src/util/memory.c:129: alloc_fn: Storage is returned from allocation function "calloc".
	/builddir/build/BUILD/libvirt-0.9.10/src/util/memory.c:129: var_assign: Assigning: "*((void **)ptrptr)" = "calloc(count, size)".
	/builddir/build/BUILD/libvirt-0.9.10/src/util/xml.c:625: noescape: Variable "*list" is not freed or pointed-to in function "memcpy".
	/builddir/build/BUILD/libvirt-0.9.10/src/test/test_driver.c:1098: leaked_storage: Variable "devs" going out of scope leaks the storage it points to.

2012-05-04  Osier Yang  <jyang@redhat.com>

	Coverity: Fix resource leak in xen driver
	Coverity logs:

	Error: RESOURCE_LEAK:
	/builddir/build/BUILD/libvirt-0.9.10/src/xen/xen_inotify.c:103: alloc_fn: Calling allocation function "xenDaemonLookupByUUID".
	/builddir/build/BUILD/libvirt-0.9.10/src/xen/xend_internal.c:2534: alloc_fn: Storage is returned from allocation function "virGetDomain".
	/builddir/build/BUILD/libvirt-0.9.10/src/datatypes.c:191: alloc_arg: "virAlloc" allocates memory that is stored into "ret".
	/builddir/build/BUILD/libvirt-0.9.10/src/util/memory.c:101: alloc_fn: Storage is returned from allocation function "calloc".
	/builddir/build/BUILD/libvirt-0.9.10/src/util/memory.c:101: var_assign: Assigning: "*((void **)ptrptr)" = "calloc(1UL, size)".
	/builddir/build/BUILD/libvirt-0.9.10/src/datatypes.c:210: return_alloc: Returning allocated memory "ret".
	/builddir/build/BUILD/libvirt-0.9.10/src/xen/xend_internal.c:2534: var_assign: Assigning: "ret" = "virGetDomain(conn, name, uuid)".
	/builddir/build/BUILD/libvirt-0.9.10/src/xen/xend_internal.c:2541: return_alloc: Returning allocated memory "ret".
	/builddir/build/BUILD/libvirt-0.9.10/src/xen/xen_inotify.c:103: var_assign: Assigning: "dom" =  storage returned from "xenDaemonLookupByUUID(conn, rawuuid)".
	/builddir/build/BUILD/libvirt-0.9.10/src/xen/xen_inotify.c:126: leaked_storage: Variable "dom" going out of scope leaks the storage it points to.

	Error: RESOURCE_LEAK:
	/builddir/build/BUILD/libvirt-0.9.10/src/xen/xen_hypervisor.c:2742: alloc_fn: Calling allocation function "fopen".
	/builddir/build/BUILD/libvirt-0.9.10/src/xen/xen_hypervisor.c:2742: var_assign: Assigning: "cpuinfo" =  storage returned from "fopen("/proc/cpuinfo", "r")".
	/builddir/build/BUILD/libvirt-0.9.10/src/xen/xen_hypervisor.c:2763: noescape: Variable "cpuinfo" is not freed or pointed-to in function "xenHypervisorMakeCapabilitiesInternal".
	/builddir/build/BUILD/libvirt-0.9.10/src/xen/xen_hypervisor.c:2574:45: noescape: "xenHypervisorMakeCapabilitiesInternal" does not free or save its pointer parameter "cpuinfo".
	/builddir/build/BUILD/libvirt-0.9.10/src/xen/xen_hypervisor.c:2768: leaked_storage: Variable "cpuinfo" going out of scope leaks the storage it points to.

	Error: RESOURCE_LEAK:
	/builddir/build/BUILD/libvirt-0.9.10/src/xen/xen_hypervisor.c:2752: alloc_fn: Calling allocation function "fopen".
	/builddir/build/BUILD/libvirt-0.9.10/src/xen/xen_hypervisor.c:2752: var_assign: Assigning: "capabilities" =  storage returned from "fopen("/sys/hypervisor/properties/capabilities", "r")".
	/builddir/build/BUILD/libvirt-0.9.10/src/xen/xen_hypervisor.c:2763: noescape: Variable "capabilities" is not freed or pointed-to in function "xenHypervisorMakeCapabilitiesInternal".
	/builddir/build/BUILD/libvirt-0.9.10/src/xen/xen_hypervisor.c:2574:60: noescape: "xenHypervisorMakeCapabilitiesInternal" does not free or save its pointer parameter "capabilities".
	/builddir/build/BUILD/libvirt-0.9.10/src/xen/xen_hypervisor.c:2768: leaked_storage: Variable "capabilities" going out of scope leaks the storage it points to.

2012-05-04  Osier Yang  <jyang@redhat.com>

	Coverity: Fix resource leaks in phyp driver
	Coverity logs:

	Error: RESOURCE_LEAK:
	/builddir/build/BUILD/libvirt-0.9.10/src/phyp/phyp_driver.c:523: alloc_fn: Calling allocation function "fopen".
	/builddir/build/BUILD/libvirt-0.9.10/src/phyp/phyp_driver.c:523: var_assign: Assigning: "fd" =  storage returned from "fopen(local_file, "rb")".
	/builddir/build/BUILD/libvirt-0.9.10/src/phyp/phyp_driver.c:540: noescape: Variable "fd" is not freed or pointed-to in function "fread".
	/builddir/build/BUILD/libvirt-0.9.10/src/phyp/phyp_driver.c:542: noescape: Variable "fd" is not freed or pointed-to in function "feof".
	/builddir/build/BUILD/libvirt-0.9.10/src/phyp/phyp_driver.c:575: leaked_storage: Variable "fd" going out of scope leaks the storage it points to.
	/builddir/build/BUILD/libvirt-0.9.10/src/phyp/phyp_driver.c:585: leaked_storage: Variable "fd" going out of scope leaks the storage it points to.

	Error: RESOURCE_LEAK:
	/builddir/build/BUILD/libvirt-0.9.10/src/phyp/phyp_driver.c:2088: alloc_fn: Calling allocation function "phypVolumeLookupByName".
	/builddir/build/BUILD/libvirt-0.9.10/src/phyp/phyp_driver.c:2026: alloc_fn: Storage is returned from allocation function "virGetStorageVol".
	/builddir/build/BUILD/libvirt-0.9.10/src/datatypes.c:724: alloc_arg: "virAlloc" allocates memory that is stored into "ret".
	/builddir/build/BUILD/libvirt-0.9.10/src/util/memory.c:101: alloc_fn: Storage is returned from allocation function "calloc".
	/builddir/build/BUILD/libvirt-0.9.10/src/util/memory.c:101: var_assign: Assigning: "*((void **)ptrptr)" = "calloc(1UL, size)".
	/builddir/build/BUILD/libvirt-0.9.10/src/datatypes.c:753: return_alloc: Returning allocated memory "ret".
	/builddir/build/BUILD/libvirt-0.9.10/src/phyp/phyp_driver.c:2026: var_assign: Assigning: "vol" = "virGetStorageVol(pool->conn, pool->name, volname, key)".
	/builddir/build/BUILD/libvirt-0.9.10/src/phyp/phyp_driver.c:2030: return_alloc: Returning allocated memory "vol".
	/builddir/build/BUILD/libvirt-0.9.10/src/phyp/phyp_driver.c:2088: leaked_storage: Failing to save storage allocated by "phypVolumeLookupByName(pool, voldef->name)" leaks it.

	Error: RESOURCE_LEAK:
	/builddir/build/BUILD/libvirt-0.9.10/src/phyp/phyp_driver.c:2725: alloc_fn: Calling allocation function "phypGetStoragePoolLookUpByUUID".
	/builddir/build/BUILD/libvirt-0.9.10/src/phyp/phyp_driver.c:2689: alloc_fn: Storage is returned from allocation function "virGetStoragePool".
	/builddir/build/BUILD/libvirt-0.9.10/src/datatypes.c:592: alloc_arg: "virAlloc" allocates memory that is stored into "ret".
	/builddir/build/BUILD/libvirt-0.9.10/src/util/memory.c:101: alloc_fn: Storage is returned from allocation function "calloc".
	/builddir/build/BUILD/libvirt-0.9.10/src/util/memory.c:101: var_assign: Assigning: "*((void **)ptrptr)" = "calloc(1UL, size)".
	/builddir/build/BUILD/libvirt-0.9.10/src/datatypes.c:610: return_alloc: Returning allocated memory "ret".
	/builddir/build/BUILD/libvirt-0.9.10/src/phyp/phyp_driver.c:2689: var_assign: Assigning: "sp" = "virGetStoragePool(conn, pools[i], uuid)".
	/builddir/build/BUILD/libvirt-0.9.10/src/phyp/phyp_driver.c:2694: return_alloc: Returning allocated memory "sp".
	/builddir/build/BUILD/libvirt-0.9.10/src/phyp/phyp_driver.c:2725: leaked_storage: Failing to save storage allocated by "phypGetStoragePoolLookUpByUUID(conn, def->uuid)" leaks it.

	Error: RESOURCE_LEAK:
	/builddir/build/BUILD/libvirt-0.9.10/src/phyp/phyp_driver.c:2719: alloc_fn: Calling allocation function "phypStoragePoolLookupByName".
	/builddir/build/BUILD/libvirt-0.9.10/src/phyp/phyp_driver.c:2254: alloc_fn: Storage is returned from allocation function "virGetStoragePool".
	/builddir/build/BUILD/libvirt-0.9.10/src/datatypes.c:592: alloc_arg: "virAlloc" allocates memory that is stored into "ret".
	/builddir/build/BUILD/libvirt-0.9.10/src/util/memory.c:101: alloc_fn: Storage is returned from allocation function "calloc".
	/builddir/build/BUILD/libvirt-0.9.10/src/util/memory.c:101: var_assign: Assigning: "*((void **)ptrptr)" = "calloc(1UL, size)".
	/builddir/build/BUILD/libvirt-0.9.10/src/datatypes.c:610: return_alloc: Returning allocated memory "ret".
	/builddir/build/BUILD/libvirt-0.9.10/src/phyp/phyp_driver.c:2254: return_alloc_fn: Directly returning storage allocated by "virGetStoragePool".
	/builddir/build/BUILD/libvirt-0.9.10/src/phyp/phyp_driver.c:2719: leaked_storage: Failing to save storage allocated by "phypStoragePoolLookupByName(conn, def->name)" leaks it.

	Error: RESOURCE_LEAK:
	/builddir/build/BUILD/libvirt-0.9.10/src/phyp/phyp_driver.c:2270: alloc_fn: Calling allocation function "phypStoragePoolLookupByName".
	/builddir/build/BUILD/libvirt-0.9.10/src/phyp/phyp_driver.c:2254: alloc_fn: Storage is returned from allocation function "virGetStoragePool".
	/builddir/build/BUILD/libvirt-0.9.10/src/datatypes.c:592: alloc_arg: "virAlloc" allocates memory that is stored into "ret".
	/builddir/build/BUILD/libvirt-0.9.10/src/util/memory.c:101: alloc_fn: Storage is returned from allocation function "calloc".
	/builddir/build/BUILD/libvirt-0.9.10/src/util/memory.c:101: var_assign: Assigning: "*((void **)ptrptr)" = "calloc(1UL, size)".
	/builddir/build/BUILD/libvirt-0.9.10/src/datatypes.c:610: return_alloc: Returning allocated memory "ret".
	/builddir/build/BUILD/libvirt-0.9.10/src/phyp/phyp_driver.c:2254: return_alloc_fn: Directly returning storage allocated by "virGetStoragePool".
	/builddir/build/BUILD/libvirt-0.9.10/src/phyp/phyp_driver.c:2270: var_assign: Assigning: "sp" =  storage returned from "phypStoragePoolLookupByName(vol->conn, vol->pool)".
	/builddir/build/BUILD/libvirt-0.9.10/src/phyp/phyp_driver.c:2324: leaked_storage: Variable "sp" going out of scope leaks the storage it points to.
	/builddir/build/BUILD/libvirt-0.9.10/src/phyp/phyp_driver.c:2327: leaked_storage: Variable "sp" going out of scope leaks the storage it points t

2012-05-04  Osier Yang  <jyang@redhat.com>

	Coverity: Fix the forward_null error in Python binding codes
	Related coverity log:

	Error: FORWARD_NULL:
	/builddir/build/BUILD/libvirt-0.9.10/python/libvirt-override.c:355:
	assign_zero: Assigning: "params" = 0.
	/builddir/build/BUILD/libvirt-0.9.10/python/libvirt-override.c:458:
	var_deref_model: Passing null variable "params" to function
	"getPyVirTypedParameter", which dereferences it. (The dereference is assumed on
	the basis of the 'nonnull' parameter attribute.)

2012-05-04  Eric Blake  <eblake@redhat.com>

	qemu: avoid 32-bit compiler warning
	On 32-bit platforms, gcc warns that the comparison between a long
	and (ULLONG_MAX/1024/1024) is always false; throwing in a type
	conversion shuts up the warning.

	* src/qemu/qemu_monitor.c (qemuMonitorBlockJob): Shut gcc up.

2012-05-04  Serge Hallyn  <serge.hallyn@canonical.com>

	build: support libnl-3
	configure.ac: check for libnl-3 in addition to libnl-1

	src/Makefile.am: link against libnl when needed

	src/util/virnetlink.c:
	support libnl3 api.  To minimize impact on code flow, wrap the
	differences under the virNetlink* namespace.

	Unfortunately libnl3 moves netlink/msg.h to
	/usr/include/libnl3/netlink/msg.h, so the LIBNL_CFLAGS need to be added
	to a bunch of places where they weren't needed with libnl1.

2012-05-04  Eric Blake  <eblake@redhat.com>

	build: fix build on cygwin
	On cygwin, <rpc/rpc.h> lives in a different directory than
	/usr/include, so anything that uses it must modify CFLAGS.  This
	previously tripped up just 'make check', but now that we build
	all test programs unconditionally, it also trips up 'make'.

	* tests/Makefile.am (virnetmessagetest_CFLAGS): Find rpc headers.

2012-05-03  Dmitry Guryanov  <dguryanov@parallels.com>

	util: add functions for interating over json object
	Add function virJSONValueObjectKeysNumber, virJSONValueObjectGetKey
	and virJSONValueObjectGetValue, which allow you to iterate over all
	fields of json object: you can get number of fields and then get
	name and value, stored in field with that name by index.

2012-05-03  Li Zhang  <zhlcindy@linux.vnet.ibm.com>

	Correct indent errors in the function qemuDomainNetsRestart
	qemuDomainNetsRestart indents with 3 spaces.

	This patch is to correct it.

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

	build: update pid_t type static check
	The code uses long long for pid_t now.
	It fails on mingw64 without this change.

	build: fix output of pid values
	Fix a few more places where pid_t is printed with wrong type

2012-05-03  Eugen Feller  <eugen.feller@inria.fr>

	Added Snooze cloud manager to the IaaS section

2012-05-02  Eric Blake  <eblake@redhat.com>

	virsh: output scaled values with correct units
	The recent push to use correct scaling terms (kB for 1000, KiB for
	1024 - such as commit 9dfdead) missed some places in virsh.

	* tools/virsh.c (prettyCapacity, cmdDominfo, cmdFreecell)
	(cmdNodeinfo, cmdNodeMemStats, cmdMigrateSetMaxSpeed)
	(cmdBlockCopy, cmdBlockPull, cmdBlockJob): Use KiB, not kB, when
	referring to multiples of 1024.
	* tests/virshtest.c: Update expected output to match.

2012-05-02  Eric Blake  <eblake@redhat.com>

	virsh: make -h always give help
	https://bugzilla.redhat.com/show_bug.cgi?id=817244 mentions that
	unlike most other tools, where --help or --version prevent all
	further parsing of all later options, virsh was strange in that
	--version stopped parsing but --help tried to plow on to the end.
	There was no rationale for this original implementation (since
	2005!), so I think we can safely conform to common usage patterns.

	* tools/virsh.c (main): Drop useless 'help' variable.

2012-05-02  Laine Stump  <laine@laine.org>

	build: make ATTRIBUTE_NONNULL() a NOP unless STATIC_ANALYSIS is on
	The ATTRIBUTE_NONNULL(m) macro normally resolves to the gcc builtin
	__attribute__((__nonnull__(m))). The effect of this in gcc is
	unfortunately only to make gcc believe that "m" can never possibly be
	NULL, *not* to add in any checks to guarantee that it isn't ever NULL
	(i.e. it is an optimization aid, *not* something to verify code
	correctness.) - see the following gcc bug report for more details:

	  http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17308

	Static source analyzers such as clang and coverity apparently can use
	ATTRIBUTE_NONNULL(), though, to detect dead code (in the case that the
	arg really is guaranteed non-NULL), as well as situations where an
	obviously NULL arg is given to the function.

	https://bugzilla.redhat.com/show_bug.cgi?id=815270 is a good example
	of a bug caused by erroneous application of ATTRIBUTE_NONNULL().
	Several people spent a long time staring at this code and not finding
	the problem, because the problem wasn't in the function itself, but in
	the prototype that specified ATTRIBUTE_NONNULL() for an arg that
	actually *wasn't* always non-NULL, and caused a segv when dereferenced
	(even though the code that dereferenced the pointer was inside an if()
	that checked for a NULL pointer, that code was optimized out by gcc).

	There may be some very small gain to be had from the optimizations
	that can be inferred from ATTRIBUTE_NONNULL(), but it seems safer to
	err on the side of generating code that behaves as expected, while
	turning on the attribute for static analyzers.

2012-05-01  Daniel P. Berrange  <berrange@redhat.com>

	Make lxcContainerSetStdio the last thing to be called in container startup
	Once lxcContainerSetStdio is invoked, logging will not work as
	expected in libvirt_lxc. So make sure this is the last thing to
	be called, in particular after setting the security process label

	Ensure logging is initialized early in libvirt_lxc
	The virLogSetFromEnv call was done too late in startup to
	catch many log messages (eg from security driver initialization).
	To assist debugging also explicitly log the security details
	at startup

2012-05-01  Daniel P. Berrange  <berrange@redhat.com>

	Ensure LXC security driver is set unconditonally
	The driver->securityDriverName field may be NULL, if automatic
	probing is used to determine security driver. This meant that
	unless selinux was explicitly requested in lxc.conf, it was
	not being sent to the libvirt_lxc process.

	The driver->securityManager field is guaranteed non-NULL, since
	there will always be the 'none' security driver present if
	nothing else exists. So use that to set the driver name for
	libvirt_lxc

2012-05-01  Daniel P. Berrange  <berrange@redhat.com>

	Ensure libvirt_lxc process loads the live XML config
	Currently the libvirt_lxc process uses VIR_DOMAIN_XML_INACTIVE
	when loading the XML for the container. This means it loses
	any dynamic data such as the, just allocated, SELinux label.

	Further there is an inconsistency in the libvirt LXC driver
	whereby it saves the live config XML and then later overwrites
	the file with the live status XML instead. Add a comment about
	this for future reference.

	* src/lxc/lxc_controller.c: Remove VIR_DOMAIN_XML_INACTIVE
	  when loading XML
	* src/lxc/lxc_driver.c: Add comment about inconsistent
	  config file formats

2012-05-01  Eric Blake  <eblake@redhat.com>

	maint: avoid false positives on unmarked diagnostics
	Otherwise, a string such as _("Don't use \"" VAR "\".") would
	complain about unmarked diagnostics.

	* cfg.mk (sc_libvirt_unmarked_diagnostics): Handle \" in message.

2012-05-01  Josh Durgin  <josh.durgin@dreamhost.com>

	qemu: allow snapshotting of sheepdog and rbd disks

	qemu: change rbd auth_supported separation character to ;
	This works with newer qemu that doesn't allow escaping spaces.
	It's backwards compatible as well.

2012-05-01  Alex Jia  <ajia@redhat.com>

	util: Avoid libvirtd crash in virNetDevTapCreate
	In fact, the 'tapfd' is always NULL, the function 'virNetDevTapCreate()' hasn't
	assign 'fd' to 'tapfd', when the function 'virNetDevSetMAC()' is failed then
	goto 'error' label, finally, the VIR_FORCE_CLOSE() will deref a NULL 'tapfd'.

	* util/virnetdevtap.c (virNetDevTapCreateInBridgePort): fix a NULL pointer derefing.

	* How to reproduce?

	$ cat > /tmp/net.xml <<EOF
	<network>
	  <name>test</name>
	  <forward mode='nat'/>
	  <bridge name='br1' stp='off' delay='1' />
	  <mac address='00:00:00:00:00:00'/>
	  <ip address='192.168.100.1' netmask='255.255.255.0'>
	    <dhcp>
	      <range start='192.168.100.2' end='192.168.100.254' />
	    </dhcp>
	  </ip>
	</network>
	EOF

	$ virsh net-define /tmp/net.xml

	$ virsh net-start test
	error: Failed to start network brTest
	error: End of file while reading data: Input/output error

2012-05-01  Eric Blake  <eblake@redhat.com>

	storage: fix build with iscsi
	The previous storage patch missed an instance affected by the struct
	member rename.  It also had some botched whitespace detected by
	'make check'.

	* src/storage/storage_backend_iscsi.c
	(virStorageBackendISCSIFindPoolSources): Adjust to new struct.
	* src/conf/storage_conf.c (virStoragePoolSourceFormat): Fix
	indentation.

2012-04-30  Osier Yang  <jyang@redhat.com>

	storage: Break out the loop if duplicate pool is found
	It doesn't break out the "for" loop even if duplicate pool is
	found, and thus the "matchpool" could be overriden as NULL again
	if there is different pool afterwards.

	To address the problem in libvirt-user list:

	https://www.redhat.com/archives/libvirt-users/2012-April/msg00150.html

2012-04-30  Wido den Hollander  <wido@widodh.nl>

	storage: Allow multiple hosts for a storage pool
	The current storage pools for NFS and iSCSI only require one host to
	connect to. Future storage pools like RBD and Sheepdog will require
	multiple hosts.

	This patch allows multiple source hosts and rewrites the current
	storage drivers.

2012-04-30  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Make sure qemu can access its directory in hugetlbfs
	When libvirtd is started, we create "libvirt/qemu" directories under
	hugetlbfs mount point. Only the "qemu" subdirectory is chowned to qemu
	user and "libvirt" remains owned by root. If umask was too restrictive
	when libvirtd started, qemu user may lose access to "qemu"
	subdirectory. Let's explicitly grant search permissions to "libvirt"
	directory for all users.

2012-04-28  Michal Privoznik  <mprivozn@redhat.com>

	qemu_agent: Report error class at least
	Currently, qemu GA is not providing 'desc' field for errors like
	we are used to from qemu monitor. Therefore, we fall back to this
	general 'unknown error' string. However, GA is reporting 'class' which
	is not perfect, but much more helpful than generic error string.
	Thus we should fall back to class firstly and if even no class
	is presented, then we can fall back to that generic string.

	Before this patch:
	virsh # dompmsuspend --target mem f16
	error: Domain f16 could not be suspended
	error: internal error unable to execute QEMU command
	'guest-suspend-ram': unknown QEMU command error

	After this patch:
	virsh # dompmsuspend --target mem f16
	error: Domain f16 could not be suspended
	error: internal error unable to execute QEMU command
	'guest-suspend-ram': The command has not been found

2012-04-28  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	More coverity findings addressed
	More bug extermination in the category of:

	Error: CHECKED_RETURN:

	/libvirt/src/conf/network_conf.c:595:
	check_return: Calling function "virAsprintf" without checking return value (as is done elsewhere 515 out of 543 times).

	/libvirt/src/qemu/qemu_process.c:2780:
	unchecked_value: No check of the return value of "virAsprintf(&msg, "was paused (%s)", virDomainPausedReasonTypeToString(reason))".

	/libvirt/tests/commandtest.c:809:
	check_return: Calling function "setsid" without checking return value (as is done elsewhere 4 out of 5 times).

	/libvirt/tests/commandtest.c:830:
	unchecked_value: No check of the return value of "virTestGetDebug()".

	/libvirt/tests/commandtest.c:831:
	check_return: Calling function "virTestGetVerbose" without checking return value (as is done elsewhere 41 out of 42 times).

	/libvirt/tests/commandtest.c:833:
	check_return: Calling function "virInitialize" without checking return value (as is done elsewhere 18 out of 21 times).


	One note about the error in commandtest line 809: setsid() seems to fail when running the test -- could be removed ?

2012-04-28  Eric Blake  <eblake@redhat.com>

	blockjob: fix block-stream bandwidth race
	With RHEL 6.2, virDomainBlockPull(dom, dev, bandwidth, 0) has a race
	with non-zero bandwidth: there is a window between the block_stream
	and block_job_set_speed monitor commands where an unlimited amount
	of data was let through, defeating the point of a throttle.

	This race was first identified in commit a9d3495e, and libvirt was
	able to reduce the size of the window for that race.  In the meantime,
	the qemu developers decided to fix things properly; per this message:
	https://lists.gnu.org/archive/html/qemu-devel/2012-04/msg03793.html
	the fix will be in qemu 1.1, and changes block-job-set-speed to use
	a different parameter name, as well as adding a new optional parameter
	to block-stream, which eliminates the race altogether.

	Since our documentation already mentioned that we can refuse a non-zero
	bandwidth for some hypervisors, I think the best solution is to do
	just that for RHEL 6.2 qemu, so that the race is obvious to the user
	(anyone using stock RHEL 6.2 binaries won't have this patch, and anyone
	building their own libvirt with this patch for RHEL can also rebuild
	qemu to get the modern semantics, so it is no real loss in behavior).

	Meanwhile the code must be fixed to honor actual qemu 1.1 naming.
	Rename the parameter to 'modern', since the naming difference now
	covers more than just 'async' block-job-cancel.  And while at it,
	fix an unchecked integer overflow.

	* src/qemu/qemu_monitor.h (enum BLOCK_JOB_CMD): Drop unused value,
	rename enum to match conventions.
	* src/qemu/qemu_monitor.c (qemuMonitorBlockJob): Reflect enum rename.
	* src/qemu_qemu_monitor_json.h (qemuMonitorJSONBlockJob): Likewise.
	* src/qemu/qemu_monitor_json.c (qemuMonitorJSONBlockJob): Likewise,
	and support difference between RHEL 6.2 and qemu 1.1 block pull.
	* src/qemu/qemu_driver.c (qemuDomainBlockJobImpl): Reject
	bandwidth during pull with too-old qemu.
	* src/libvirt.c (virDomainBlockPull, virDomainBlockRebase):
	Document this.

2012-04-28  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	lxc: Fix coverity findings
	Error: UNINIT:
	/libvirt/src/lxc/lxc_driver.c:1412:
	var_decl: Declaring variable "fd" without initializer.
	/libvirt/src/lxc/lxc_driver.c:1460:
	uninit_use_in_call: Using uninitialized value "fd" when calling "virFileClose".
	/libvirt/src/util/virfile.c:50:
	read_parm: Reading a parameter value.

	Error: DEADCODE:
	/libvirt/src/lxc/lxc_controller.c:960:
	dead_error_condition: On this path, the condition "ret == 4" cannot be true.
	/libvirt/src/lxc/lxc_controller.c:959:
	at_most: After this line, the value of "ret" is at most -1.
	/libvirt/src/lxc/lxc_controller.c:959:
	new_values: Noticing condition "ret < 0".
	/libvirt/src/lxc/lxc_controller.c:961:
	dead_error_line: Execution cannot reach this statement "continue;".

	Error: UNINIT:
	/libvirt/src/lxc/lxc_controller.c:1104:
	var_decl: Declaring variable "consoles" without initializer.
	/libvirt/src/lxc/lxc_controller.c:1237:
	uninit_use: Using uninitialized value "consoles".

2012-04-28  Cole Robinson  <crobinso@redhat.com>

	python: Fix doc directory name for stable releases
	We were using the libvirt release version (like 0.9.11) and not
	the configure version (which for stable releases is 0.9.11.X)

	Most other places got this right so hopefully that's all the fallout
	from the version format change :)

2012-04-28  Cole Robinson  <crobinso@redhat.com>

	docs: Serialize running apibuild.py
	Use a witness file approach like we do for python/generator.py,
	as suggested by Eric. Fixes the build issue reported here:

	https://www.redhat.com/archives/libvir-list/2012-April/msg01435.html

2012-04-28  Cole Robinson  <crobinso@redhat.com>

	configure: Use ustar format for dist tarball
	Since for stable releases, some test files were over the 99 char
	limit for traditional tar filenames.

	Suggested by Osier here:
	https://www.redhat.com/archives/libvir-list/2012-April/msg01435.html

2012-04-27  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Use common helper when probing qemu capabilities
	QEMU binary is called several times when we probe different kinds of
	capabilities the binary supports. This patch introduces new common
	helper so that all probes use a consistent way of invoking qemu.

2012-04-27  Eric Blake  <eblake@redhat.com>

	qemu: improve errors related to offline domains
	https://bugzilla.redhat.com/show_bug.cgi?id=816662 pointed out
	that attempting 'virsh blockpull' on an offline domain gave a
	misleading error message about qemu lacking support for the
	operation, even when qemu was specifically updated to support it.
	The real problem is that we have several capabilities that are
	only determined when starting a domain, and therefore are still
	clear when first working with an inactive domain (namely, any
	capability set by qemuMonitorJSONCheckCommands).

	While this patch was able to hoist an existing check in one of the
	three culprits, it had to add redundant checks in the other two
	places (because you always have to check for an active domain after
	obtaining a VM job lock, but the capability bits were being checked
	prior to obtaining the job lock).

	Someday it would be nice to patch libvirt to cache the set of
	capabilities per qemu binary (as determined by inode and timestamp),
	rather than re-probing the binary every time a domain is started,
	and to teach the cache how to query the monitor during the one
	time the probe is made rather than having to wait until a guest
	is started; then, a capability probe would succeed even for offline
	guests because it just refers to the cache, and the single check for
	an active domain after grabbing the job lock would be sufficient.
	But since that will involve a lot more coding, I'm happy to go
	with this simpler solution for an immediate solution.

	* src/qemu/qemu_driver.c (qemuDomainPMSuspendForDuration)
	(qemuDomainSnapshotCreateXML, qemuDomainBlockJobImpl): Check for
	offline state before checking an online-only cap.

2012-04-27  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	macvtap: fix a typo
	Below patch fixes the following coverity findings

	Error: OVERRUN_STATIC:
	/libvirt/src/qemu/qemu_command.c:152:
	overrun-buffer-val: Overrunning static array "net->mac" of size 6 bytes by passing it as an argument to a function which indexes it at byte position 15.
	/libvirt/src/util/virnetdevmacvlan.c:948:
	access_dbuff_const: Calling "virNetDevMacVLanVPortProfileRegisterCallback" indexes array "macaddress" at byte position 15.
	/libvirt/src/util/virnetdevmacvlan.c:773:
	access_dbuff_const: Calling "memcpy" indexes array "macaddress" with index "16UL" at byte position 15.

	Error: OVERRUN_STATIC:
	/libvirt/src/qemu/qemu_migration.c:2744:
	overrun-buffer-val: Overrunning static array "net->mac" of size 6 bytes by passing it as an argument to a function which indexes it at byte position 15.
	/libvirt/src/util/virnetdevmacvlan.c:773:
	access_dbuff_const: Calling "memcpy" indexes array "macaddress" with index "16UL" at byte position 15.

	Error: OVERRUN_STATIC:
	/libvirt/src/qemu/qemu_driver.c:435:
	overrun-buffer-val: Overrunning static array "net->mac" of size 6 bytes by passing it as an argument to a function which indexes it at byte position 15.
	/libvirt/src/util/virnetdevmacvlan.c:1036:
	access_dbuff_const: Calling "virNetDevMacVLanVPortProfileRegisterCallback" indexes array "macaddress" at byte position 15.
	/libvirt/src/util/virnetdevmacvlan.c:773:
	access_dbuff_const: Calling "memcpy" indexes array "macaddress" with index "16UL" at byte position 15.

2012-04-27  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	nwfilter: address more coverity findings
	This patch addresses the following coverity findings:

	/libvirt/src/conf/nwfilter_params.c:390:
	var_assigned: Assigning: "varValue" = null return value from "virHashLookup".

	/libvirt/src/conf/nwfilter_params.c:392:
	dereference: Dereferencing a pointer that might be null "varValue" when calling "virNWFilterVarValueGetNthValue".

	/libvirt/src/conf/nwfilter_params.c:399:
	dereference: Dereferencing a pointer that might be null "tmp" when calling "virNWFilterVarValueGetNthValue".

2012-04-27  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	nwfilter: address coverity findings
	This patch addresses the following coverity findings:

	/libvirt/src/conf/nwfilter_params.c:157:
	deref_parm: Directly dereferencing parameter "val".

	/libvirt/src/conf/nwfilter_params.c:473:
	negative_returns: Using variable "iterIndex" as an index to array "res->iter".

	/libvirt/src/nwfilter/nwfilter_ebiptables_driver.c:2891:
	unchecked_value: No check of the return value of "virAsprintf(&protostr, "-d 01:80:c2:00:00:00 ")".

	/libvirt/src/nwfilter/nwfilter_ebiptables_driver.c:2894:
	unchecked_value: No check of the return value of "virAsprintf(&protostr, "-p 0x%04x ", l3_protocols[protoidx].attr)".

	/libvirt/src/nwfilter/nwfilter_ebiptables_driver.c:3590:
	var_deref_op: Dereferencing null variable "inst".

2012-04-27  Laine Stump  <laine@laine.org>

	util: fix error messages in virNetlinkEventServiceStart
	Some of the error messages in this function should have been
	virReportSystemError (since they have an errno they want to log), but
	were mistakenly written as netlinkError, which expects a libvirt error
	code instead. The result was that when one of the errors was
	encountered, "No error message provided" would be printed instead of
	something meaningful (see
	https://bugzilla.redhat.com/show_bug.cgi?id=816465 for an example).

2012-04-26  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Avoid bogus error at the end of tunnelled migration
	Once qemu monitor reports migration has completed, we just closed our
	end of the pipe and let migration tunnel die. This generated bogus error
	in case we did so before the thread saw EOF on the pipe and migration
	was aborted even though it was in fact successful.

	With this patch we first wake up the tunnel thread and once it has read
	all data from the pipe and finished the stream we close the
	filedescriptor.

	A small additional bonus of this patch is that real errors reported
	inside qemuMigrationIOFunc are not overwritten by virStreamAbort any
	more.

2012-04-26  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Fix detection of failed migration
	When QEMU reported failed or canceled migration, we correctly detected
	it but didn't really consider it as an error condition and migration
	protocol just went on. Luckily, some of the subsequent steps eventually
	failed end we reported an (unrelated and mostly random) error back to
	the caller.

2012-04-26  Jiri Denemark  <jdenemar@redhat.com>

	rpc: Discard non-blocking calls only when necessary
	Currently, non-blocking calls are either sent immediately or discarded
	in case sending would block. This was implemented based on the
	assumption that the non-blocking keepalive call is not needed as there
	are other calls in the queue which would keep the connection alive.
	However, if those calls are no-reply calls (such as those carrying
	stream data), the remote party knows the connection is alive but since
	we don't get any reply from it, we think the connection is dead.

	This is most visible in tunnelled migration. If it happens to be longer
	than keepalive timeout (30s by default), it may be unexpectedly aborted
	because the connection is considered to be dead.

	With this patch, we only discard non-blocking calls when the last call
	with a thread is completed and thus there is no thread left to keep
	sending the remaining non-blocking calls.

2012-04-26  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Preserve original error during migration
	In some cases (spotted with broken connection during tunneled migration)
	we were overwriting the original error with worse or even misleading
	errors generated when we were cleaning up after failed migration.

2012-04-26  Peter Krempa  <pkrempa@redhat.com>

	keepalive: Add ability to disable keepalive messages
	The docs for virConnectSetKeepAlive() advertise that this function
	should be able to disable keepalives on negative or zero interval time.

	This patch removes the check that prohibited this and adds code to
	disable keepalives on negative/zero interval.

	* src/libvirt.c: virConnectSetKeepAlive(): - remove check for negative
	                                             values
	* src/rpc/virnetclient.c
	* src/rpc/virnetclient.h: - add virNetClientKeepAliveStop() to disable
	                            keepalive messages
	* src/remote/remote_driver.c: remoteSetKeepAlive(): -add ability to
	                                                     disable keepalives

2012-04-26  Laine Stump  <laine@laine.org>

	util: fix crash when starting macvtap interfaces
	This patch resolves https://bugzilla.redhat.com/show_bug.cgi?id=815270

	The function virNetDevMacVLanVPortProfileRegisterCallback() takes an
	arg "virtPortProfile", and was checking it for non-NULL before using
	it. However, the prototype for
	virNetDevMacVLanPortProfileRegisterCallback had marked that arg with
	ATTRIBUTE_NONNULL(). Contrary to what one may think,
	ATTRIBUTE_NONNULL() does not provide any guarantee that an arg marked
	as such really is always non-null; the only effect to the code
	generated by gcc, is that gcc *assumes* it is non-NULL; this results
	in, for example, the check for a non-NULL value being optimized out.

	(Unfortunately, this code removal only occurs when optimization is
	enabled, and I am in the habit of doing local builds with optimization
	off to ease debugging, so the bug didn't show up in my earlier local
	testing).

	In general, virPortProfile might always be NULL, so it shouldn't be
	marked as ATTRIBUTE_NONNULL. One other function prototype made this
	same error, so this patch fixes it as well.

2012-04-26  Eric Blake  <eblake@redhat.com>

	build: fix bootstrap on RHEL
	Commit 8fe455fd364cd7462e02170084c45a58ee302cc3 tried to work around
	a regression introduced in upstream gnulib that requires gettext 0.18
	or newer on all projects using bootstrap, by making libvirt require
	gettext 0.18.  But this fails on RHEL 6.2, which still ships gettext
	0.17.  Revert that change, and instead, import the latest round of
	gnulib updates that fix that problem properly.

	If you have already built in the window where libvirt required 0.18,
	be aware that incremental updates may run into problems: this is
	because 'autopoint --force' will not downgrade m4/po.m4 back to an
	older version, but it must be downgraded back to 0.17 levels to work
	with this patch.  You may either manually remove that file then rerun
	bootstrap, or it may prove easier to just clean up all non-git files
	to start from a clean slate.

	* bootstrap.conf: Revert minimum gettext back to 0.17.
	* configure.ac: Likewise.
	* .gnulib: Update to latest, for bootstrap fixes.
	* bootstrap: Resync from gnulib.

2012-04-25  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	Add new functions to virSocketAddr
	Add 2 new functions to the virSocketAddr 'class':

	- virSocketAddrEqual: tests whether two IP addresses and their ports are equal
	- virSocketaddSetIPv4Addr: set a virSocketAddr given a 32 bit int

2012-04-25  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	macvtap: use embedded buffers
	Use embedded buffers for the MAC addresses and the VM's UUID.

2012-04-24  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	Improve on virAtomic implementation
	This patch improves the previously added virAtomicInt implementation
	by using gcc-builtins if possible. The needed builtins are available
	since GCC >= 4.1. At least the 4.0 docs don't mention them.

2012-04-24  Hu Tao  <hutao@cn.fujitsu.com>

	fix memleak in linuxParseCPUmap

2012-04-24  Peter Krempa  <pkrempa@redhat.com>

	build: Fix version of gettext macros
	Commit c9cd419caba9effa11ca53e8696e5f6a4b424d60 added copying of the
	makefile for translation files from gnulib. The makefile from gnulib is
	of version 0.18 but the build configuration cretes macros from version
	0.17 which breaks the build with message:

	*** error: gettext infrastructure mismatch: using a Makefile.in.in from
	gettext version 0.18 but the autoconf macros are from gettext version
	0.17

2012-04-24  Matthias Bolte  <matthias.bolte@googlemail.com>

	vbox: Fix passing an empty IMedium* array to IMachine::Delete
	vboxArray is not castable to a COM item type. vboxArray is a
	wrapper around the XPCOM and MSCOM specific array handling.

	In this case we can avoid passing NULL as an empty array to
	IMachine::Delete by passing a dummy IMedium* array with a single
	NULL item.

2012-04-24  Guido Günther  <agx@sigxcpu.org>

	openvz: add network interface stats
	This will only work for veth devices since venet devices don't have
	a target element.

2012-04-23  Eric Blake  <eblake@redhat.com>

	blockjob: enhance xml to track mirrors across libvirtd restart
	In order to track a block copy job across libvirtd restarts, we
	need to save internal XML that tracks the name of the file
	holding the mirror.  Displaying this name in dumpxml might also
	be useful to the user, even if we don't yet have a way to (re-)
	start a domain with mirroring enabled up front.  This is done
	with a new <mirror> sub-element to <disk>, as in:

	    <disk type='file' device='disk'>
	      <driver name='qemu' type='raw'/>
	      <source file='/var/lib/libvirt/images/original.img'/>
	      <mirror file='/var/lib/libvirt/images/copy.img' format='qcow2' ready='yes'/>
	      ...
	    </disk>

	For now, the element is output-only, in live domains; it is ignored
	when defining a domain or hot-plugging a disk (since those contexts
	use VIR_DOMAIN_XML_INACTIVE in parsing).  The 'ready' attribute appears
	when libvirt knows that the job has changed from the initial pulling
	phase over to the mirroring phase, although absence of the attribute
	is not a sure indicator of the current phase.  If we come up with a way
	to make qemu start with mirroring enabled, we can relax the xml
	restriction, and allow <mirror> (but not attribute 'ready') on input.
	Testing active-only XML meant tweaking the testsuite slightly, but it
	was worth it.

	* docs/schemas/domaincommon.rng (diskspec): Add diskMirror.
	* docs/formatdomain.html.in (elementsDisks): Document it.
	* src/conf/domain_conf.h (_virDomainDiskDef): New members.
	* src/conf/domain_conf.c (virDomainDiskDefFree): Clean them.
	(virDomainDiskDefParseXML): Parse them, but only internally.
	(virDomainDiskDefFormat): Output them.
	* tests/qemuxml2argvdata/qemuxml2argv-disk-mirror.xml: New test file.
	* tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-mirror.xml: Likewise.
	* tests/qemuxml2xmltest.c (testInfo): Alter members.
	(testCompareXMLToXMLHelper): Allow more test control.
	(mymain): Run new test.

2012-04-23  Eric Blake  <eblake@redhat.com>

	blockjob: add 'blockcopy' to virsh
	Rather than further overloading 'blockpull', I decided to create a
	new virsh command to expose the new flags of virDomainBlockRebase.

	Blocking until the command completes naturally is pointless, since
	the block copy job is intended to run indefinitely.  Instead, I
	made the command support three --wait modes: by default, it runs until
	mirroring is started; with --pivot, it pivots as soon as mirroring
	is started; and with --finish, it aborts (for a clean copy) as
	soon as mirroring is started.

	* tools/virsh.c (VSH_CMD_BLOCK_JOB_COPY): New mode.
	(blockJobImpl): Support new flags.
	(cmdBlockCopy): New command.
	(cmdBlockJob): Support new job info, new abort flag.
	* tools/virsh.pod (blockcopy, blockjob): Document the new command
	and flags.

2012-04-23  Eric Blake  <eblake@redhat.com>

	blockjob: add new API flags
	This patch introduces a new block job, useful for live storage
	migration using pre-copy streaming.  Justification for including
	this under virDomainBlockRebase rather than adding a new command
	includes: 1) there are now two possible block jobs in qemu, with
	virDomainBlockRebase starting either type of command, and
	virDomainBlockJobInfo and virDomainBlockJobAbort working to end
	either type; 2) reusing this command allows distros to backport
	this feature to the libvirt 0.9.10 API without a .so bump.

	Note that a future patch may add a more powerful interface named
	virDomainBlockJobCopy, dedicated to just the block copy job, in
	order to expose even more options (such as setting an arbitrary
	format type for the destination without having to probe it from a
	pre-existing destination file); adding a new command for targetting
	just block copy would be similar to how we already have
	virDomainBlockPull for targetting just the block pull job.

	Using a live VM with the backing chain:
	  base <- snap1 <- snap2
	as the starting point, we have:

	- virDomainBlockRebase(dom, disk, "/path/to/copy", 0,
	    VIR_DOMAIN_BLOCK_REBASE_COPY)
	creates /path/to/copy with the same format as snap2, with no backing
	file, so entire chain is copied and flattened

	- virDomainBlockRebase(dom, disk, "/path/to/copy", 0,
	    VIR_DOMAIN_BLOCK_REBASE_COPY|VIR_DOMAIN_BLOCK_REBASE_COPY_RAW)
	creates /path/to/copy as a raw file, so entire chain is copied and
	flattened

	- virDomainBlockRebase(dom, disk, "/path/to/copy", 0,
	    VIR_DOMAIN_BLOCK_REBASE_COPY|VIR_DOMAIN_BLOCK_REBASE_SHALLOW)
	creates /path/to/copy with the same format as snap2, but with snap1 as
	a backing file, so only snap2 is copied.

	- virDomainBlockRebase(dom, disk, "/path/to/copy", 0,
	    VIR_DOMAIN_BLOCK_REBASE_COPY|VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT)
	reuse existing /path/to/copy (must have empty contents, and format is
	probed[*] from the metadata), and copy the full chain

	- virDomainBlockRebase(dom, disk, "/path/to/copy", 0,
	    VIR_DOMAIN_BLOCK_REBASE_COPY|VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT|
	    VIR_DOMAIN_BLOCK_REBASE_SHALLOW)
	reuse existing /path/to/copy (contents must be identical to snap1,
	and format is probed[*] from the metadata), and copy only the contents
	of snap2

	- virDomainBlockRebase(dom, disk, "/path/to/copy", 0,
	    VIR_DOMAIN_BLOCK_REBASE_COPY|VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT|
	    VIR_DOMAIN_BLOCK_REBASE_SHALLOW|VIR_DOMAIN_BLOCK_REBASE_COPY_RAW)
	reuse existing /path/to/copy (must be raw volume with contents
	identical to snap1), and copy only the contents of snap2

	Less useful combinations:

	- virDomainBlockRebase(dom, disk, "/path/to/copy", 0,
	    VIR_DOMAIN_BLOCK_REBASE_COPY|VIR_DOMAIN_BLOCK_REBASE_SHALLOW|
	    VIR_DOMAIN_BLOCK_REBASE_COPY_RAW)
	fail if source is not raw, otherwise create /path/to/copy as raw and
	the single file is copied (no chain involved)

	- virDomainBlockRebase(dom, disk, "/path/to/copy", 0,
	    VIR_DOMAIN_BLOCK_REBASE_COPY|VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT|
	    VIR_DOMAIN_BLOCK_REBASE_COPY_RAW)
	makes little sense: the destination must be raw but have no contents,
	meaning that it is an empty file, so there is nothing to reuse

	The other three flags are rejected without VIR_DOMAIN_BLOCK_COPY.

	[*] Note that probing an existing file for its format can be a security
	risk _if_ there is a possibility that the existing file is 'raw', in
	which case the guest can manipulate the file to appear like some other
	format.  But, by virtue of the VIR_DOMAIN_BLOCK_REBASE_COPY_RAW flag,
	it is possible to avoid probing of raw files, at which point, probing
	of any remaining file type is no longer a security risk.

	It would be nice if we could issue an event when pivoting from phase 1
	to phase 2, but qemu hasn't implemented that, and we would have to poll
	in order to synthesize it ourselves.  Meanwhile, qemu will give us a
	distinct job info and completion event when we either cancel or pivot
	to end the job.  Pivoting is accomplished via the new:

	virDomainBlockJobAbort(dom, disk, VIR_DOMAIN_BLOCK_JOB_ABORT_PIVOT)

	Management applications can pre-create the copy with a relative
	backing file name, and use the VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT
	flag to have qemu reuse the metadata; if the management application
	also copies the backing files to a new location, this can be used
	to perform live storage migration of an entire backing chain.

	* include/libvirt/libvirt.h.in (VIR_DOMAIN_BLOCK_JOB_TYPE_COPY):
	New block job type.
	(virDomainBlockJobAbortFlags, virDomainBlockRebaseFlags): New enums.
	* src/libvirt.c (virDomainBlockRebase): Document the new flags,
	and implement general restrictions on flag combinations.
	(virDomainBlockJobAbort): Document the new flag.
	(virDomainSaveFlags, virDomainSnapshotCreateXML)
	(virDomainRevertToSnapshot, virDomainDetachDeviceFlags): Document
	restrictions.
	* include/libvirt/virterror.h (VIR_ERR_BLOCK_COPY_ACTIVE): New
	error.
	* src/util/virterror.c (virErrorMsg): Define it.

2012-04-23  Peter Krempa  <pkrempa@redhat.com>

	cpu: Improve error reporting on incompatible CPUs
	This patch modifies the CPU comparrison function to report the
	incompatibilities in more detail to ease identification of problems.

	* src/cpu/cpu.h:
	    cpuGuestData(): Add argument to return detailed error message.
	* src/cpu/cpu.c:
	    cpuGuestData(): Add passthrough for error argument.
	* src/cpu/cpu_x86.c
	    x86FeatureNames(): Add function to convert a CPU definition to flag
	                       names.
	    x86Compute(): - Add error message parameter
	                  - Add macro for reporting detailed error messages.
	                  - Improve error reporting.
	                  - Simplify calculation of forbidden flags.
	    x86DataIteratorInit():
	    x86cpuidMatchAny(): Remove functions that are no longer needed.
	* src/qemu/qemu_command.c:
	    qemuBuildCpuArgStr(): - Modify for new function prototype
	                          - Add detailed error reports
	                          - Change error code on incompatible processors
	                            to VIR_ERR_CONFIG_UNSUPPORTED instead of
	                            internal error
	* tests/cputest.c:
	    cpuTestGuestData(): Modify for new function prototype

2012-04-22  Wen Congyang  <wency@cn.fujitsu.com>

	building: remove libvirt_dbus.syms from EXTRA_DIST
	commit 2223ea98 removes src/libvirt_dbus.syms, but it forgets
	to remove it from EXTRA_DIST. It will cause 'make dist' failed.

2012-04-22  Matthias Bolte  <matthias.bolte@googlemail.com>

	win32: Properly handle TlsGetValue returning NULL
	virThreadSelf tries to access the virThreadPtr stored in TLS for the
	current thread via TlsGetValue. When virThreadSelf is called on a thread
	that was not created via virThreadCreate (e.g. the main thread) then
	TlsGetValue returns NULL as TlsAlloc initializes TLS slots to NULL.

	virThreadSelf can be called on the main thread via this call chain from
	virsh

	vshDeinit
	virEventAddTimeout
	virEventPollAddTimeout
	virEventPollInterruptLocked
	virThreadIsSelf

	triggering a segfault as virThreadSelf unconditionally dereferences the
	return value of TlsGetValue.

	Fix this by making virThreadSelf check the TLS slot value for NULL and
	setting the given virThreadPtr accordingly.

	Reported by Marcel Müller.

2012-04-21  Ryan Woodsmall  <rwoodsmall@gmail.com>

	esx: Fix segfault in esxConnectToHost
	Caused by commit 4445e16bfa8056980ac643fabf17186f9e685925 that
	made the code used the connection private data pointer before
	it was initialized.

2012-04-20  Guido Günther  <agx@sigxcpu.org>

	openvz: wire up getHostname

2012-04-20  Eric Blake  <eblake@redhat.com>

	virnetserver: handle sigaction correctly
	POSIX says that sa_sigaction is only safe to use if sa_flags
	includes SA_SIGINFO; conversely, sa_handler is only safe to
	use when flags excludes that bit.  Gnulib doesn't guarantee
	an implementation of SA_SIGINFO, but does guarantee that
	if SA_SIGINFO is undefined, we can safely define it to 0 as
	long as we don't dereference the 2nd or 3rd argument of
	any handler otherwise registered via sa_sigaction.

	Based on a report by Wen Congyang.

	* src/rpc/virnetserver.c (SA_SIGINFO): Stub for mingw.
	(virNetServerSignalHandler): Avoid bogus dereference.
	(virNetServerFatalSignal, virNetServerNew): Set flags properly.
	(virNetServerAddSignalHandler): Drop unneeded #ifdef.

2012-04-20  Eric Blake  <eblake@redhat.com>

	conf: remove redundant ()
	I almost copied-and-pasted some redundant () into my new code,
	and figured a general cleanup prereq patch would be better instead.

	No semantic change.

	* src/conf/domain_conf.c (virDomainLeaseDefParseXML)
	(virDomainDiskDefParseXML, virDomainFSDefParseXML)
	(virDomainActualNetDefParseXML, virDomainNetDefParseXML)
	(virDomainGraphicsDefParseXML, virDomainVideoAccelDefParseXML)
	(virDomainVideoDefParseXML, virDomainHostdevFind)
	(virDomainControllerInsertPreAlloced, virDomainDefParseXML)
	(virDomainObjParseXML, virDomainCpuSetFormat)
	(virDomainCpuSetParse, virDomainDiskDefFormat)
	(virDomainActualNetDefFormat, virDomainNetDefFormat)
	(virDomainTimerDefFormat, virDomainGraphicsListenDefFormat)
	(virDomainDefFormatInternal, virDomainNetGetActualHostdev)
	(virDomainNetGetActualBandwidth, virDomainGraphicsGetListen):
	Reduce extra ().

2012-04-20  Eric Blake  <eblake@redhat.com>

	build: avoid strtol and strtod
	Ensure we don't introduce any more lousy integer parsing in new
	code, while avoiding a scrub-down of existing legacy code.

	Note that we also need to enable sc_prohibit_atoi_atof (see cfg.mk
	local-checks-to-skip) before we are bulletproof, but that also
	entails scrubbing I'm not ready to do at the moment.

	* src/util/util.c (virStrToLong_i, virStrToLong_ui)
	(virStrToLong_l, virStrToLong_ul, virStrToLong_ll)
	(virStrToLong_ull, virStrToDouble): Mark exemptions.
	* src/util/virmacaddr.c (virMacAddrParse): Likewise.
	* cfg.mk (sc_prohibit_strtol): New syntax check.
	(exclude_file_name_regexp--sc_prohibit_strtol): Ignore files that
	I'm not willing to fix yet.
	(local-checks-to-skip): Re-enable sc_prohibit_atoi_atof.

2012-04-20  Eric Blake  <eblake@redhat.com>

	conf: tighten up XML integer parsing
	https://bugzilla.redhat.com/show_bug.cgi?id=617711 reported that
	even with my recent patched to allow <memory unit='G'>1</memory>,
	people can still get away with trying <memory>1G</memory> and
	silently get <memory unit='KiB'>1</memory> instead.  While
	virt-xml-validate catches the error, our C parser did not.

	Not to mention that it's always fun to fix bugs while reducing
	lines of code.  :)

	* src/conf/domain_conf.c (virDomainParseMemory): Check for parse error.
	(virDomainDefParseXML): Avoid strtoll.
	* src/conf/storage_conf.c (virStorageDefParsePerms): Likewise.
	* src/util/xml.c (virXPathLongBase, virXPathULongBase)
	(virXPathULongLong, virXPathLongLong): Likewise.

2012-04-20  Eric Blake  <eblake@redhat.com>

	virsh: avoid strtol
	We were forgetting to check errno for overflow.

	* tools/virsh.c (get_integer_keycode, vshCommandOptInt)
	(vshCommandOptUInt, vshCommandOptUL, vshCommandOptLongLong)
	(vshCommandOptULongLong): Rewrite to be safer.

2012-04-20  Eric Blake  <eblake@redhat.com>

	build: avoid type-punning in vbox
	Commit 78345c68 makes at least gcc 4.1.2 on RHEL 5 complain:

	cc1: warnings being treated as errors
	In file included from vbox/vbox_V4_0.c:13:
	vbox/vbox_tmpl.c: In function 'vboxDomainUndefineFlags':
	vbox/vbox_tmpl.c:5298: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]

	* src/vbox/vbox_tmpl.c (vboxDomainUndefineFlags): Use union to
	avoid compiler warning.

2012-04-20  Eric Blake  <eblake@redhat.com>

	build: fix fresh checkout on RHEL5
	Building a fresh checkout on RHEL 5 has been broken since commit
	29db7a00, due to a gnulib regression in the bootstrap script
	(incremental builds from a checkout earlier than that point were
	okay, though).

	* .gnulib: Update to latest, for bootstrap fixes.
	* bootstrap: Resync from gnulib.
	* gnulib/local/top/maint.mk.diff: Drop patch that was added
	upstream in the meantime.

2012-04-20  Eric Blake  <eblake@redhat.com>

	virsh: avoid uninitialized memory usage
	Detected by valgrind, via Alex Jia.  Caused by imcomplete
	copy-and-paste from vshWatchJob in commit 3b96a892.

	* tools/virsh.c (cmdBlockPull): fix uninitialized memory usage.

	* How to reproduce?
	$ qemu-img create /var/lib/libvirt/images/test 1M
	$ cat > /tmp/test.xml <<EOF
	<domain type='qemu'>
	  <name>test</name>
	  <memory>219200</memory>
	  <vcpu>1</vcpu>
	  <os>
	    <type arch='x86_64'>hvm</type>
	    <boot dev='hd'/>
	  </os>
	  <devices>
	    <disk type='file' device='disk'>
	      <driver name='qemu' type='raw'/>
	      <source file='/var/lib/libvirt/images/test'/>
	      <target dev='vda' bus='virtio'/>
	    </disk>
	    <input type='mouse' bus='ps2'/>
	    <graphics type='spice' autoport='yes' listen='0.0.0.0'/>
	  </devices>
	</domain>
	EOF
	$ virsh define /tmp/test.xml
	$ valgrind -v virsh blockpull test /var/lib/libvirt/images/test --wait

	actual result:

	==10906== 1 errors in context 1 of 1:
	==10906== Syscall param rt_sigaction(act->sa_flags) points to uninitialised byte(s)
	==10906==    at 0x39CF80F5BE: __libc_sigaction (sigaction.c:67)
	==10906==    by 0x43016C: cmdBlockPull (virsh.c:7638)
	==10906==    by 0x4150D4: vshCommandRun (virsh.c:18574)
	==10906==    by 0x425E73: main (virsh.c:20178)
	==10906==  Address 0x7fefffae8 is on thread 1's stack

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

	The policy kit and HAL node device drivers both require a DBus connection. The HAL device code further requires that the DBus connection is integrated with the event loop and provides such glue logic itself.
	The forthcoming FirewallD integration also requires a
	dbus connection with event loop integration. Thus we need
	to pull the current event loop glue out of the HAL driver.

	Thus we create src/util/virdbus.{c,h} files. This contains
	just one method virDBusGetSystemBus() which obtains a handle
	to the single shared system bus instance, with event glue
	automagically setup.

2012-04-19  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	nwfilter: Fix support for trusted DHCP servers
	Fix the support for trusted DHCP server in the ebtables code's
	hard-coded function applying DHCP only filtering rules:
	Rather than using a char * use the more flexible
	virNWFilterVarValuePtr that contains the trusted DHCP server(s)
	IP address. Process all entries.

	Since all callers so far provided NULL as parameter, no changes
	are necessary in any other code.

2012-04-19  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	Support for atomic operations on integers
	For threading support, add atomic add and sub operations working on
	integers. Base this on locking support provided by virMutex.

	Implement virHashRemoveAll function
	Implement function to remove all entries of a hash table.

2012-04-19  Peter Krempa  <pkrempa@redhat.com>

	virsh: Fix and clarify the --title flag for the list command in man page

2012-04-19  Eric Blake  <eblake@redhat.com>

	util: remove dead casts
	The sequence:
	  long long val;
	  if ((long long) val != val)
	is dead code.

	* src/util/util.c (virStrToLong_ll, virStrToLong_ull): Remove
	useless cast.

2012-04-18  D. Herrendoerfer  <d.herrendoerfer@herrendoerfer.name>

	util: only register callbacks for CREATE operations in virnetdevmacvlan.c
	Currently upon a migration a callback is created when a 802.1qbg link
	is set to PREASSOCIATE, this should not happen because this is a no-op
	on most switches, and does not lead to an ASSOCIATE state.  This patch
	only creates callbacks when CREATE or RESTORE is requested.  Migration
	and libvirtd restart scenarios are already handled elsewhere.

2012-04-18  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	Fix a memory leak
	The below patch fixes the following memory leak.

	==20624== 24 bytes in 2 blocks are definitely lost in loss record 532 of 1,867
	==20624==    at 0x4A05E46: malloc (vg_replace_malloc.c:195)
	==20624==    by 0x38EC27FC01: strdup (strdup.c:43)
	==20624==    by 0x4EB6BA3: virDomainChrSourceDefCopy (domain_conf.c:1122)
	==20624==    by 0x495D76: qemuProcessFindCharDevicePTYs (qemu_process.c:1497)
	==20624==    by 0x498321: qemuProcessWaitForMonitor (qemu_process.c:1258)
	==20624==    by 0x49B5F9: qemuProcessStart (qemu_process.c:3652)
	==20624==    by 0x468B5C: qemuDomainObjStart (qemu_driver.c:4753)
	==20624==    by 0x469171: qemuDomainStartWithFlags (qemu_driver.c:4810)
	==20624==    by 0x4F21735: virDomainCreate (libvirt.c:8153)
	==20624==    by 0x4302BF: remoteDispatchDomainCreateHelper (remote_dispatch.h:852)
	==20624==    by 0x4F72C14: virNetServerProgramDispatch (virnetserverprogram.c:416)
	==20624==    by 0x4F6D690: virNetServerHandleJob (virnetserver.c:164)
	==20624==    by 0x4E8F43D: virThreadPoolWorker (threadpool.c:144)
	==20624==    by 0x4E8EAB5: virThreadHelper (threads-pthread.c:161)
	==20624==    by 0x38EC606CCA: start_thread (pthread_create.c:301)
	==20624==    by 0x38EC2E0C2C: clone (clone.S:115) 

2012-04-18  Eric Blake  <eblake@redhat.com>

	blockjob: add virsh blockpull --wait
	I'm tired of shell-scripting to wait for completion of a block pull,
	when virsh can be taught to do the same.  I couldn't quite reuse
	vshWatchJob, as this is not a case of a long-running command where
	a second thread must be used to probe job status (at least, not unless
	I make virsh start doing blocking waits for an event to fire), but it
	served as inspiration for my simpler single-threaded loop.  There is
	up to a half-second delay between sending SIGINT and the job being
	aborted, but I didn't think it worth the complexity of a second thread
	and use of poll() just to minimize that delay.

	* tools/virsh.c (cmdBlockPull): Add new options to wait for
	completion.
	(blockJobImpl): Add argument.
	(cmdBlockJob): Adjust caller.
	* tools/virsh.pod (blockjob): Document new mode.

2012-04-18  Eric Blake  <eblake@redhat.com>

	qemu: use consistent error when qemu binary is too old
	Most of our errors complaining about an inability to support a
	particular action due to qemu limitations used CONFIG_UNSUPPORTED,
	but we had a few outliers.  Reported by Jiri Denemark.

	* src/qemu/qemu_command.c (qemuBuildDriveDevStr): Prefer
	CONFIG_UNSUPPORTED.
	* src/qemu/qemu_driver.c (qemuDomainReboot)
	(qemuDomainBlockJobImpl): Likewise.
	* src/qemu/qemu_hotplug.c (qemuDomainAttachPciControllerDevice):
	Likewise.
	* src/qemu/qemu_monitor.c (qemuMonitorTransaction)
	(qemuMonitorBlockJob, qemuMonitorSystemWakeup): Likewise.

2012-04-18  Eric Blake  <eblake@redhat.com>

	virsh: minor syntactic cleanups
	No semantic change.

	* tools/virsh.c: Fix some spacing issues, {} usage, long lines,
	and redundant ().

2012-04-18  Jean-Baptiste Rouault  <jean-baptiste.rouault@diateam.net>

	vbox: avoid provoking assertions in VBoxSVC
	Passing a NULL pointer to IMachine::delete virtualbox API
	causes VBoxSVC to raise an assertion. This patch passes
	an empty array instead.

2012-04-18  Osier Yang  <jyang@redhat.com>

	docs: Improve the schema for fs device
	<filesystemtgt> is redundant, as every group uses it; <address>
	shouldn't be in <filesystemtgt> in case of the meaning could be
	"filesystemtarget"; The elements <address>, <alias>, <target>,
	... should be interleaved.

2012-04-17  Osier Yang  <jyang@redhat.com>

	conf: Do not parse cpuset only if the placement is auto
	So that a domain xml which doesn't have "placement" specified, but
	"cpuset" is specified, could be parsed. And in this case, the
	"placement" mode will be set as "static".

	tests: Update read-bufsiz to delete the UUID of vm XML
	Since now we have fixed domain UUID for test driver, defining
	a domain with different name but same UUID doesn't work any
	more. This patch delete the UUID from the dumped XML so that
	it could be generated.

2012-04-17  Osier Yang  <jyang@redhat.com>

	test: Set the fixed uuid for the default XMLs
	The objects (domain, pool, network, etc) for testing are defined/
	started each time when opening a connect to test driver, and thus
	the UUID for the objects will be generated each time, with different
	values. e.g.

	% for i in {1..3}; do ./tools/virsh --connect \
	  test:///default dumpxml test | grep uuid; done
	  <uuid>a1b6ee1f-97de-f0ee-617a-0cdb74947df5</uuid>
	  <uuid>ee68d7d2-3eb9-593e-2769-797ce1f4c4aa</uuid>
	  <uuid>fecb1d3a-918a-8412-e534-76192cf32b18</uuid>

	It's the potential bug which can cause operations like below to fail:

	$ virsh -c test:///default dumpxml test > test.xml

	[ Some modificatons, though it's not supported, but it should work ]

	$ virsh -c test:///default define test.xml

	This patch set fixed UUID for objects which support it. (domain,
	pool, network).

2012-04-17  Osier Yang  <jyang@redhat.com>

	qemu: Split ide-drive into ide-cd and ide-hd
	A "ide-drive" device can be either a hard disk or a CD-ROM,
	if there is ",media=cdrom" specified for the backend, it's
	a CD-ROM, otherwise it's a hard disk.

	Upstream qemu splitted "ide-drive" into "ide-hd" and "ide-cd"
	since commit 1f56e32, and ",media=cdrom" is not required for
	ide-cd anymore. "ide-drive" is still supported for backwards
	compatibility, but no doubt we should go foward.

2012-04-17  Osier Yang  <jyang@redhat.com>

	qemu: Split scsi-disk into into scsi-hd and scsi-cd
	A "scsi-disk" device can be either a hard disk or a CD-ROM,
	if there is ",media=cdrom" specified for the backend, it's
	a CD-ROM, otherwise it's a hard disk.

	But upstream qemu splitted "scsi-disk" into "scsi-hd" and
	"scsi-cd" since commit b443ae, and ",media=cdrom" is not
	required for scsi-cd anymore. "scsi-disk" is still supported
	for backwards compatibility, but no doubt we should go
	foward.

2012-04-17  Jan Kiszka  <jan.kiszka@siemens.com>

	Do not enforce source type of console[0]
	If console[0] is an alias for serial[0], do not enforce the former to
	have a PTY source type. This breaks serial consoles on stdio and makes
	no sense.

2012-04-17  Stefan Bader  <stefan.bader@canonical.com>

	xen: do not use ioemu type for any emulated NIC
	When using the xm/xend stack to manage instances there is a bug
	that causes the emulated interfaces to be unusable when the vif
	config contains type=ioemu.

	The current code already has a special quirk to not use this
	keyword if no specific model is given for the emulated NIC
	(defaulting to rtl8139).
	Essentially it works because regardless of the type argument,i
	the Xen stack always creates emulated and paravirt interfaces and
	lets the guest decide which one to use. So neither xl nor xm stack
	actually require the type keyword for emulated NICs.

2012-04-17  Osier Yang  <jyang@redhat.com>

	openvz: Correct the comments for new node APIs
	It should be 0.9.12 instead of 0.9.11

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

	docs: fix 'omitted' typo in <cputune> doc
	'omitted' was mispelt 'commited' twice. One of the sentences with
	the typo was also missing an 'is' ('each VCPU *is* pinned to all...')
	which I added in this commit while I was at it.

	docs: add missing </span> in <vcpu placement> doc

2012-04-16  Michal Privoznik  <mprivozn@redhat.com>

	qemuProcessStart: Switch to flags instead of bunch booleans
	Currently, we have 3 boolean arguments we have to pass
	to qemuProcessStart(). As libvirt grows it is harder and harder
	to remember them and their position. Therefore we should
	switch to flags instead.

2012-04-16  Guido Günther  <agx@sigxcpu.org>

	docs: fix path to openvz network configuration file
	It's vznet.conf not vznetctl.conf, see e.g.:

	http://git.openvz.org/?p=vzctl;a=blob;f=bin/vznetcfg.in;h=e91f5c4a0744c1ea149e1b8c241b666052e10b12;hb=HEAD

2012-04-16  Cole Robinson  <crobinso@redhat.com>

	storage: lvm: use correct lv* command parameters
	lvcreate want's the parent pool's name, not the pool path
	lvchange and lvremove want lv specified as $vgname/$lvname

	This largely worked before because these commands strip off a
	starting /dev. But https://bugzilla.redhat.com/show_bug.cgi?id=714986
	is from a user using a 'nested VG' that was having problems.

	I couldn't find any info on nested LVM and the reporter never responded,
	but I reproduced with XML that specified a valid source name, and
	set target path to a symlink.

2012-04-16  Osier Yang  <jyang@redhat.com>

	qemu: Avoid the memory allocation and freeing

	numad: Ignore cpuset if placement is auto
	As explained in previous patch, numad will balance the affinity
	dynamically, so reflecting the cpuset from numad at the first
	time doesn't make much case, and may just could cause confusion.

2012-04-16  Osier Yang  <jyang@redhat.com>

	numad: Convert node list to cpumap before setting affinity
	Instead of returning a CPUs list, numad returns NUMA node
	list instead, this patch is to convert the node list to
	cpumap before affinity setting. Otherwise, the domain
	processes will be pinned only to CPU[$numa_cell_num],
	which will cause significiant performance losses.

	Also because numad will balance the affinity dynamically,
	reflecting the cpuset from numad back doesn't make much
	sense then, and it may just could produce confusion for
	the users. Thus the better way is not to reflect it back
	to XML. And in this case, it's better to ignore the cpuset
	when parsing XML.

	The codes to update the cpuset is removed in this patch
	incidentally, and there will be a follow up patch to ignore
	the manually specified "cpuset" if "placement" is "auto",
	and document will be updated too.

2012-04-16  Daniel Veillard  <veillard@redhat.com>

	Set Martin Kletzander as a commiter

2012-04-16  Guido Günther  <agx@sigxcpu.org>

	openvz: wire up more node information functions
	in detail nodeGetCPUStats, nodeGetMemoryStats, nodeGetCellsFreeMemory
	and nodeGetFreeMemory

2012-04-15  Guido Günther  <agx@sigxcpu.org>

	Fix macvtap detection by also checking for IFLA_VF_MAX
	since this isn't available on older kernels such as Debian Squeeze's
	2.6.32. This make --with-macvtap=check work as expected.

2012-04-14  Philipp Hahn  <hahn@univention.de>

	virnetdev: Check for defined IFLA_VF_*
	The linux-2.6.32 kernel header does not yet define IFLA_VF_MAX and others,
	which breaks compiling a new libvirt on old systems like Debian Squeeze.

	(I also have to add --without-macvtap --disable-werror --without-virtualport to
	 ./configure to get it to compile.)

2012-04-13  Daniel Veillard  <veillard@redhat.com>

	Web placeholder for pending patches on the web site
	This is based on recent developments on patch checker and the
	goal is to keep a list of pending patches needing review on the
	project web site. The page template in git just holds a pointer
	to the web page.

2012-04-13  Michal Privoznik  <mprivozn@redhat.com>

	gitignore: Reorder alphabetically
	Recent git reorders .gitignore alphabetically. However, changes are
	not committed and I am tired of discarding these changes from
	my patches.

	conf: Avoid double assignment in virDomainDiskRemove
	Although it should be harmless to do:
	    disk = disk = def->disks[i]
	some not-so-wise compilers may fool around.
	Besides, such assignment is useless here.

	qemu: Fix mem leak in qemuProcessInitCpuAffinity
	If placement mode is AUTO, on some return paths char *cpumap or
	char *nodeset are leaked.

2012-04-13  Stefan Bader  <stefan.bader@canonical.com>

	xend_internal: Use domain/status for shutdown check
	On newer xend (v3.x and after) there is no state and domid reported
	for inactive domains. When initially creating connections this is
	handled in various places by assigning domain->id = -1.
	But once an instance has been running, the id is set to the current
	domain id. And it does not change when the instance is shut down.
	So when querying the domain info, the hypervisor driver, which gets
	asked first will indicate it cannot find information, then the
	xend driver is asked and will set the status to NOSTATE because it
	checks for the -1 domain id.
	Checking domain/status for 0 seems to be more reliable for that.

	One note: I am not sure whether the domain->id also should get set
	back to -1 whenever any sub-driver thinks the instance is no longer
	running.

	BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=746007
	BugLink: http://bugs.launchpad.net/bugs/929626

2012-04-13  D. Herrendoerfer  <d.herrendoerfer@herrendoerfer.name>

	qemu,util: fix netlink callback registration for migration
	This patch adds a netlink callback when migrating a VEPA enabled
	virtual machine.  It fixes a Bug where a VM would not request a port
	association when it was cleared by lldpad.

	This patch requires the latest git version of lldpad to work.

2012-04-12  Michal Privoznik  <mprivozn@redhat.com>

	qemuOpenFile: Don't force chown on NFS
	If dynamic_ownership is off and we are creating a file on NFS
	we force chown. This will fail as chown/chmod are not supported
	on NFS. However, with no dynamic_ownership we are not required
	to do any chown.

2012-04-12  Alex Jia  <ajia@redhat.com>

	daemon: Plug memory leaks
	* daemon/libvirtd-config.c (daemonConfigFree): fix memory leaks.

	How to reproduce?

	% make && make -C tests check TESTS=libvirtdconftest
	% cd tests && valgrind -v --leak-check=full ./libvirtdconftest

	actual result:

	==11008== 185 bytes in 5 blocks are definitely lost in loss record 3 of 5
	==11008==    at 0x4A05FDE: malloc (vg_replace_malloc.c:236)
	==11008==    by 0x39CF07F6E1: strdup (strdup.c:43)
	==11008==    by 0x406626: daemonConfigLoadOptions (libvirtd-config.c:438)
	==11008==    by 0x406800: daemonConfigLoadData (libvirtd-config.c:492)
	==11008==    by 0x403CCF: testCorrupt (libvirtdconftest.c:110)
	==11008==    by 0x404FAD: virtTestRun (testutils.c:145)
	==11008==    by 0x403A34: mymain (libvirtdconftest.c:219)
	==11008==    by 0x404687: virtTestMain (testutils.c:700)
	==11008==    by 0x39CF01ECDC: (below main) (libc-start.c:226)
	==11008==
	==11008== LEAK SUMMARY:
	==11008==    definitely lost: 185 bytes in 5 blocks

2012-04-12  Eric Blake  <eblake@redhat.com>

	blockjob: allow for fast-finishing job
	In my testing, I was able to provoke an odd block pull failure:

	$ virsh blockpull dom vda --bandwidth 10000
	error: Requested operation is not valid: No active operation on device: drive-virtio-disk0

	merely by using gdb to artifically wait to do the block job set speed
	until after the pull had already finished.  But in reality, that should
	be a success, since the pull finished before we had a chance to set
	speed.  Furthermore, using a double job lock is not only annoying, but
	a bug in itself - if you do parallel virDomainBlockRebase, and hit
	the race window just right, the first call grabs the VM job to start
	a fast block job, then the second call grabs the VM job to start
	a long-running job with unspecified speed, then the first call finally
	regrabs the VM job and sets the speed, which ends up running the
	second job under the speed from the first call.  By consolidating
	things into a single job, we avoid opening that race, as well as reduce
	the time between starting the job and changing the speed, for less
	likelihood of the speed change happening after block job completion
	in the first place.

	* src/qemu/qemu_monitor.h (BLOCK_JOB_CMD): Add new mode.
	* src/qemu/qemu_driver.c (qemuDomainBlockRebase): Move secondary
	job call...
	(qemuDomainBlockJobImpl): ...here, for fewer locks.
	* src/qemu/qemu_monitor_json.c (qemuMonitorJSONBlockJob): Change
	return value on new internal mode.

2012-04-12  Eric Blake  <eblake@redhat.com>

	blockjob: wire up qemu async virDomainBlockJobAbort
	Without the VIR_DOMAIN_BLOCK_JOB_ABORT_ASYNC flag, libvirt will internally
	poll using qemu's "query-block-jobs" API and will not return until the
	operation has been completed.  API users are advised that this operation
	is unbounded and further interaction with the domain during this period
	may block.  Future patches may refactor things to allow other queries in
	parallel with this polling.  For older qemu, we synthesize the cancellation
	event, since qemu won't generate it.

	The choice of polling duration copies from the code in qemu_migration.c.

	Cc: Stefan Hajnoczi <stefanha@gmail.com>

2012-04-12  Eric Blake  <eblake@redhat.com>

	blockjob: optimize JSON event handler lookup
	Probably in the noise, but this will let us scale more efficiently
	as we learn to recognize even more qemu events.

	* src/qemu/qemu_monitor_json.c (eventHandlers): Sort.
	(qemuMonitorEventCompare): New helper function.
	(qemuMonitorJSONIOProcessEvent): Optimize event lookup.

2012-04-12  Adam Litke  <agl@us.ibm.com>

	blockjob: add API for async virDomainBlockJobAbort
	Block job cancellation can take a while.  Now that upstream qemu 1.1
	has asynchronous block cancellation, we want to expose that to the user.
	Therefore, the following updates are made to the virDomainBlockJob API:

	A new block job event type VIR_DOMAIN_BLOCK_JOB_CANCELED is managed by
	libvirt.  Regardless of the flags used with virDomainBlockJobAbort, this
	event will be raised: 1. when using synchronous block_job_cancel (the
	event will be synthesized by libvirt), and 2. whenever it is received
	from qemu (via asynchronous block-job-cancel).  Note that the event
	may be detected by libvirt even before the virDomainBlockJobAbort
	completes (always true when it is synthesized, but also possible if
	cancellation was fast).

	A new extension flag VIR_DOMAIN_BLOCK_JOB_ABORT_ASYNC is added to the
	virDomainBlockJobAbort API.  When enabled, this function will allow
	(but not require) asynchronous operation (ie, it returns as soon as
	possible, which might be before the job has actually been canceled).
	When the API is used in this mode, it is the responsibility of the
	caller to wait for a VIR_DOMAIN_BLOCK_JOB_CANCELED event or poll via
	the virDomainGetBlockJobInfo API to check the cancellation status.

	This patch also exposes the new flag through virsh, and makes virsh
	slightly easier to use (--async implies --abort, and lack of any options
	implies --info), although it leaves the qemu implementation for later
	patches.

	Cc: Stefan Hajnoczi <stefanha@gmail.com>

2012-04-12  Eric Blake  <eblake@redhat.com>

	blockjob: add qemu capabilities related to block pull jobs
	RHEL 6.2 was released with an early version of block jobs, which only
	worked on the qed file format, where the commands were spelled with
	underscore (contrary to QMP style), and where 'block_job_cancel' was
	synchronous and did not trigger an event.

	The upcoming qemu 1.1 release has fixed these short-comings [1][2]:
	the commands now work on multiple file types, are spelled with dash,
	and 'block-job-cancel' is asynchronous and emits an event upon conclusion.

	[1]qemu commit 370521a1d6f5537ea7271c119f3fbb7b0fa57063
	[2]https://lists.gnu.org/archive/html/qemu-devel/2012-04/msg01248.html

	This patch recognizes the new spellings, and fixes virDomainBlockRebase
	to give a graceful error when talking to a too-old qemu on a partial
	rebase attempt.  Fixes for the new semantics will come later.  This
	patch also removes a bogus ATTRIBUTE_NONNULL mistakenly added in
	commit 10ec36e2.

	* src/qemu/qemu_capabilities.h (QEMU_CAPS_BLOCKJOB_SYNC)
	(QEMU_CAPS_BLOCKJOB_ASYNC): New bits.
	* src/qemu/qemu_capabilities.c (qemuCaps): Name them.
	* src/qemu/qemu_monitor_json.c (qemuMonitorJSONCheckCommands): Set
	them.
	(qemuMonitorJSONBlockJob): Manage both command names.
	(qemuMonitorJSONDiskSnapshot): Minor formatting fix.
	* src/qemu/qemu_monitor.h (qemuMonitorBlockJob): Alter signature.
	* src/qemu/qemu_monitor_json.h (qemuMonitorJSONBlockJob): Likewise.
	* src/qemu/qemu_monitor.c (qemuMonitorBlockJob): Pass through
	capability bit.
	* src/qemu/qemu_driver.c (qemuDomainBlockJobImpl): Update callers.

2012-04-11  Peter Krempa  <pkrempa@redhat.com>

	qemu: Fix deadlock when qemuDomainOpenConsole cleans up a connection
	The new safe console handling introduced a possibility to deadlock the
	qemu driver when a new console connection forcibly disconnects a
	previous console stream that belongs to an already closed connection.

	The virStreamFree function calls subsequently a the virReleaseConnect
	function that tries to lock the driver while discarding the connection,
	but the driver was already locked in qemuDomainOpenConsole.

	Backtrace of the deadlocked thread:
	0  0x00007f66e5aa7f14 in __lll_lock_wait () from /lib64/libpthread.so.0
	1  0x00007f66e5aa3411 in _L_lock_500 () from /lib64/libpthread.so.0
	2  0x00007f66e5aa322a in pthread_mutex_lock () from/lib64/libpthread.so.0
	3  0x0000000000462bbd in qemudClose ()
	4  0x00007f66e6e178eb in virReleaseConnect () from/usr/lib64/libvirt.so.0
	5  0x00007f66e6e19c8c in virUnrefStream () from /usr/lib64/libvirt.so.0
	6  0x00007f66e6e3d1de in virStreamFree () from /usr/lib64/libvirt.so.0
	7  0x00007f66e6e09a5d in virConsoleHashEntryFree () from/usr/lib64/libvirt.so.0
	8  0x00007f66e6db7282 in virHashRemoveEntry () from/usr/lib64/libvirt.so.0
	9  0x00007f66e6e09c4e in virConsoleOpen () from /usr/lib64/libvirt.so.0
	10 0x00000000004526e9 in qemuDomainOpenConsole ()
	11 0x00007f66e6e421f1 in virDomainOpenConsole () from/usr/lib64/libvirt.so.0
	12 0x00000000004361e4 in remoteDispatchDomainOpenConsoleHelper ()
	13 0x00007f66e6e80375 in virNetServerProgramDispatch () from/usr/lib64/libvirt.so.0
	14 0x00007f66e6e7ae11 in virNetServerHandleJob () from/usr/lib64/libvirt.so.0
	15 0x00007f66e6da897d in virThreadPoolWorker () from/usr/lib64/libvirt.so.0
	16 0x00007f66e6da7ff6 in virThreadHelper () from/usr/lib64/libvirt.so.0
	17 0x00007f66e5aa0c5c in start_thread () from /lib64/libpthread.so.0
	18 0x00007f66e57e7fcd in clone () from /lib64/libc.so.6

	* src/qemu/qemu_driver.c: qemuDomainOpenConsole()
	        -- unlock the qemu driver right after acquiring the domain
	        object

2012-04-11  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Warn on possibly incorrect usage of EnterMonitor*
	qemuDomainObjEnterMonitor{,WithDriver} should not be called from async
	jobs, only EnterMonitorAsync variant is allowed.

	qemu: Track job owner for better debugging
	In case an API fails with "cannot acquire state change lock", searching
	for the API that possibly forgot to end its job is not always easy.
	Let's keep track of the job owner and print it out for easier
	identification.

2012-04-11  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Avoid excessive calls to qemuDomainObjSaveJob()
	As reported by Daniel Berrangé, we have a huge performance regression
	for virDomainGetInfo() due to the change which makes virDomainEndJob()
	save the XML status file every time it is called. Previous to that
	change, 2000 calls to virDomainGetInfo() took ~2.5 seconds. After that
	change, 2000 calls to virDomainGetInfo() take 2 *minutes* 45 secs.

	We made the change to be able to recover from libvirtd restart in the
	middle of a job. However, only destroy and async jobs are taken care of.
	Thus it makes more sense to only save domain state XML when these jobs
	are started/stopped.

2012-04-11  Jiri Denemark  <jdenemar@redhat.com>

	tests: Fix libvirtdconftest in VPATH build
	Without this, libvirtdconftest fails to build with "fatal error:
	daemon/libvirtd-config.h: No such file or directory"

2012-04-10  Jiri Denemark  <jdenemar@redhat.com>

	daemon: Add libvirtd-config.c to the list of files to translate

2012-04-10  Eric Blake  <eblake@redhat.com>

	build: avoid s390 compiler warnings
	I noticed these compiler warnings when building for the s390 architecture.

	* src/node_device/node_device_udev.c (udevDeviceMonitorStartup):
	Mark unused variable.
	* src/nodeinfo.c (linuxNodeInfoCPUPopulate): Avoid unused variable.

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

	Wire up <loader> to set the QEMU BIOS path
	* src/qemu/qemu_command.c: Wire up -bios with <loader>
	* tests/qemuxml2argvdata/qemuxml2argv-bios.args,
	  tests/qemuxml2argvdata/qemuxml2argv-bios.xml: Expand
	  existing BIOS test case to cover <loader>

2012-04-10  Peter Krempa  <pkrempa@redhat.com>

	virsh: Clean up usage of boolean flag variables
	This patch cleans up variables used to store boolean command flags that
	are inquired by vshCommandOptBool to use the bool data type instead of
	an integer.

	Additionally this patch cleans up flag variables that are inferred from
	existing flags.

2012-04-10  Peter Krempa  <pkrempa@redhat.com>

	virsh: Clarify use of the --managed-save flag for the list command
	The documentation for the flag doesn't clearly state that the flag only
	enhances the output and the user needs to specify other flags to list
	inactive domains, that are enhanced by this flag.

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

	Fix comment about GNUTLS initialization/cleanup

2012-04-10  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	Fix compilation error on 32bit
	Below code failed to compile on a 32 bit machine with error

	typewrappers.c: In function 'libvirt_intUnwrap':
	typewrappers.c:135:5: error: logical 'and' of mutually exclusive tests is always false [-Werror=logical-op]
	cc1: all warnings being treated as errors

	The patch fixes this error.

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

	Replace daemon-conf test script with a proper test case
	The daemon-conf test script continues to be very fragile to
	changes in libvirt. It currently fails 1 time in 3/4 due
	to race conditions in startup/shutdown of the test script.

	Replace it with a proper test case tailored to the code
	being tested

	* tests/Makefile.am: Remove daemon-conf, add libvirtdconftest
	* tests/daemon-conf: Delete obsolete test
	* tests/libvirtdconftest.c: Test config file handling

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

	Switch libvirtd config loading code to use error APIs
	Using VIR_ERROR means the test suite can't catch error messages
	easily. Use the proper error reporting APIs instead

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

	Add API for loading daemon config from in-memory blob
	Rename existing daemonConfigLoad API to daemonConfigLoadFile and
	add an alternative daemonConfigLoadData

	* daemon/libvirtd-config.c, daemon/libvirtd-config.h: Add
	  daemonConfigLoadData and rename daemonConfigLoad to
	  daemonConfigLoadFile
	* daemon/libvirtd.c: Update for renamed API

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

	Split libvirtd config file loading out into separate files
	To enable creation of unit tests, split the libvirtd config file
	loading code out into separate files.

	* daemon/libvirtd.c: Delete config loading code / structs
	* daemon/libvirtd-config.c, daemon/libvirtd-config.h: Config
	  file loading APIs

2012-04-10  MATSUDA, Daiki  <matsudadik@intellilink.co.jp>

	UML: fix iteration over consoles
	I found typo in UML driver.

	MATSUDA Daiki

2012-04-06  Eric Blake  <eblake@redhat.com>

	snapshot: fix memory leak on error
	Leak introduced in commit 0436d32.  If we allocate an actions array,
	but fail early enough to never consume it with the qemu monitor
	transaction call, we leaked memory.

	But our semantics of making the transaction command free the caller's
	memory is awkward; avoiding the memory leak requires making every
	intermediate function in the call chain check for error.  It is much
	easier to fix things so that the function that allocates also frees,
	while the call chain leaves the caller's data intact.  To do that,
	I had to hack our JSON data structure to make it easy to protect a
	portion of an arbitrary JSON tree from being freed.

	* src/util/json.h (virJSONType): Name the enum.
	(_virJSONValue): New field.
	* src/util/json.c (virJSONValueFree): Use it to protect a portion
	of an array.
	* src/qemu/qemu_monitor_json.c (qemuMonitorJSONTransaction): Avoid
	freeing caller's data.
	* src/qemu/qemu_driver.c (qemuDomainSnapshotCreateDiskActive):
	Free actions array on failure.

2012-04-06  Michal Privoznik  <mprivozn@redhat.com>

	qemu_ga: Don't overwrite errors on FSThaw
	We can tell qemuDomainSnapshotFSThaw if we want it to report errors or
	not. However, if we don't want to and an error has been already set by
	previous qemuReportError() we must keep copy of that error not just a
	pointer to it. Otherwise, it get overwritten if FSThaw reports an error.

2012-04-06  Stefan Bader  <stefan.bader@canonical.com>

	xen config: No vfb in HVM guest configuration
	This causes an implicit vkbd device to be added which takes
	6min to finally fail being initialized in the guest.

	http://lists.xen.org/archives/html/xen-devel/2012-04/msg00409.html

2012-04-06  Eric Blake  <eblake@redhat.com>

	tests: avoid compiler warnings
	gcc 4.7 warns about uninitialized struct members

	* tests/testutilsqemu.c (testQemuCapsInit): Populate new members.
	* tests/viruritest.c (mymain): Likewise.

2012-04-06  Laine Stump  <laine@laine.org>

	test: fix build errors with gcc 4.7.0 and -O0
	When building on Fedora 17 (which uses gcc 4.7.0) with -O0 in CFLAGS,
	three of the tests failed to compile.

	cputest.c and qemuxml2argvtest.c had non-static structs defined
	inside the macro that was being repeatedly invoked. Due to some so-far
	unidentified change in gcc, the stack space used by variables defined
	inside { } is not recovered/re-used when the block ends, so all these
	structs have become additive (this is the same problem worked around
	in commit cf57d345b). Fortunately, these two files could be fixed with
	a single line addition of "static" to the struct definition in the
	macro.

	virnettlscontexttest.c was a bit different, though. The problem structs
	in the do/while loop of macros had non-constant initializers, so it
	took a bit more work and piecemeal initialization instead of member
	initialization to get things to be happy.

	In an ideal world, none of these changes should be necessary, but not
	knowing how long it will be until the gcc regressions are fixed, and
	since the code is just as correct after this patch as before, it makes
	sense to fix libvirt's build for -O0 while also reporting the gcc
	problem.

2012-04-06  Guido Günther  <agx@sigxcpu.org>

	virURIParse: don't forget to copy the user part
	This got dropped with 300e60e15b22387dda41ed5985a9ebadfd86dd25

	Cheers,
	 -- Guido

2012-04-05  Laine Stump  <laine@laine.org>

	test: fix segfault in networkxml2argvtest
	This bug resolves https://bugzilla.redhat.com/show_bug.cgi?id=810100

	rpm builds for i686 were failing with a segfault in
	networkxml2argvtest. Running under valgrind showed that a region of
	memory was being referenced after it had been freed (as the result of
	realloc - see the valgrind report in the BZ).

	The problem (in replaceTokens() - added in commit 22ec60, meaning this
	bug was in 0.9.10 and 0.9.11) was that the pointers token_start and
	token_end were being computed based on the value of *buf, then *buf
	was being realloc'ed (potentially moving it), then token_start and
	token_end were used without recomputing them to account for movement
	of *buf.

	The solution is to change the code so that token_start and token_end
	are offsets into *buf rather than pointers. This way there is only a
	single pointer to the buffer, and nothing needs readjusting after a
	realloc. (You may note that some uses of token_start/token_end didn't
	need to be changed to add in "*buf +" - that's because there ended up
	being a +*buf and -*buf which canceled each other out).

	DV gets the credit for finding this bug and pointing out the valgrind
	report.

2012-04-05  Alex Jia  <ajia@redhat.com>

	conf: Plug memory leaks on virDomainDiskDefParseXML
	Detected by valgrind. Leaks are introduced in commit b22eaa7.

	* src/conf/domain_conf.c (virDomainDiskDefParseXML): fix memory leaks.

	How to reproduce?

	% make && make -C tests check TESTS=qemuxml2argvtest
	% cd tests && valgrind -v --leak-check=full ./qemuxml2argvtest

	actual result:

	==2143== 12 bytes in 2 blocks are definitely lost in loss record 74 of 179
	==2143==    at 0x4A05FDE: malloc (vg_replace_malloc.c:236)
	==2143==    by 0x39D90A67DD: xmlStrndup (xmlstring.c:45)
	==2143==    by 0x4F5EC0: virDomainDiskDefParseXML (domain_conf.c:3438)
	==2143==    by 0x502F00: virDomainDefParseXML (domain_conf.c:8304)
	==2143==    by 0x505FE3: virDomainDefParseNode (domain_conf.c:9080)
	==2143==    by 0x5069AE: virDomainDefParse (domain_conf.c:9030)
	==2143==    by 0x41CBF4: testCompareXMLToArgvHelper (qemuxml2argvtest.c:105)
	==2143==    by 0x41E5DD: virtTestRun (testutils.c:145)
	==2143==    by 0x416FA3: mymain (qemuxml2argvtest.c:399)
	==2143==    by 0x41DCB7: virtTestMain (testutils.c:700)
	==2143==    by 0x39CF01ECDC: (below main) (libc-start.c:226)

2012-04-05  Ilja Livenson  <ilja.livenson@gmail.com>

	openvz: support vzctl 3.1
	https://bugzilla.redhat.com/show_bug.cgi?id=809895

	Basically, openvz dropped strict version numbering (3.1 vs 3.1.0),
	which caused parsing to fail.

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

	Don't install sysctl file on non-Linux hosts
	* configure.ac: Set WITH_SYSCTL only on Linux hosts
	* daemon/Makefile.am: Conditionalize install-sysctl using WITH_SYSCTL

	Cc: Jason Helfman <jhelfman@e-e.com>

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

	Fix parallel build in docs/ directory
	Every now & then, with parallel builds, we get a failure to
	validate hvsupport.html.in.  I eventually noticed that this
	is because we get 2 instances of the generator running at
	once.

	We already list hvsupport.html.in in BUILT_SOURCES but this
	was not working. It turns out the flaw is that we were
	adding deps to the 'all:' target instead of the 'all-am:'
	target. BUILT_SOURCES is a dep of 'all', so any custom
	targets written in Makefile.am must use 'all-am:' so that
	they don't get run until BUILT_SOURCES are completely
	generated

	* docs/Makefile.am: s/all/all-am/

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

	Pull in GNULIB regex module for benefit of test suite on Win32

	Add linuxNodeInfoCPUPopulate to src/libvirt_linux.syms
	This symbol is used in the test suites

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

	Fix format specifiers in test cases on Win32
	Some of the test suites use fprintf with format specifiers
	that are not supported on Win32 and are not fixed by gnulib.

	The mingw32 compiler also has trouble detecting ssize_t
	correctly, complaining that 'ssize_t' does not match
	'signed size_t' (which it expects for %zd). Force the
	cast to size_t to avoid this problem

	* tests/testutils.c, tests/testutils.h: Fix printf
	  annotation on virTestResult. Use virVasprintf
	  instead of vfprintf
	* tests/virhashtest.c: Use VIR_WARN instead of fprintf(stderr).
	  Cast to size_t to avoid mingw32 compiler bug

2012-04-04  Michal Privoznik  <mprivozn@redhat.com>

	qemu: Build activeUsbHostdevs list on process reconnect
	If the daemon is restarted it will lose list of active
	USB devices assigned to active domains. Therefore we need
	to rebuild this list on qemuProcessReconnect().

	qemu: Delete USB devices used by domain on stop
	To prevent assigning one USB device to two domains,
	we keep a list of assigned USB devices. On domain
	startup - qemuProcessStart() - we insert devices
	used by domain into the list but remove them only
	on detach-device. Devices are, however, released
	on qemuProcessStop() as well.

	qemu: Don't leak temporary list of USB devices
	and add debug message when adding USB device
	to the list of active devices.

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

	Fix initial hypervisor conditionals
	The openvz, virtualbox and vmware drivers do not run inside
	libvirtd, therefore they should be grouped with the other
	client side drivers

	Remove bogus xen-devel dep from libvirt-devel RPM
	The public libvirt API does not have any application visible
	dependency on Xen libraries. The xen-devel dependency is thus
	bogus

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

	Introduce per-hypervisor virtual RPMs
	Introduce a set sub-RPMs, one per hypervisor, which can be used
	as dependency targets by applications wishing to pull in the
	full stack of packages required for a specific hypervisor. This
	avoids the application needing to know what the hypervisor specific
	package set is.

	ie, applications should not need to know that using the libvirt
	Xen hypervisor requires the 'xen' RPM - libvirt should take care
	of that knowledge. All the application wants is 'libvirt-daemon-xen'

	There are 5 sub-RPMs:

	  libvirt-daemon-qemu - non-native TCG based emulators
	  libvirt-daemon-kvm  - native KVM hypervisor
	  libvirt-daemon-uml  - User Mode linux
	  libvirt-daemon-xen  - Xen, either via XenD or libxl
	  libvirt-daemon-lxc  - Linux native containers

	When driver modules get turned on, these sub-RPMs will also
	gain dependencies on the appropriate driver module .so files

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

	Split config files & daemon off from main daemon RPM
	Take the libvirt RPM and split it into three pieces

	 - libvirt-daemon - libvirtd & other mandatory bits for its operation
	 - libvirt-daemon-config-network - the virbr0 config definition
	 - libvirt-daemon-config-nwfilter - the firewall config rules

	For backwards compatibility with existing installs / application RPM
	deps, the 'libvirt' RPM is retained, but will have a dependency on
	the 3 new RPMs.

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

	Remove API XML files from libvirt RPM
	The API XML files are now formally installed as part of the
	libvirt-devel RPM. Thus there is no need to include them as
	%doc in the main libvirt RPM

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

	Move all documentation into a -docs sub-RPM
	Currently documentation is split between the libvirt RPM and the
	libvirt-devel RPM. In the client-only build there is no libvirt
	RPM, so the docs need to live elsewhere. The obvious answer is a
	dedicated libvirt-docs RPM. For back-compatibility make the
	libvirt-devel RPM require the libvirt-docs RPM

	* libvirt.spec.in: Create separate libvirt-docs RPM

2012-04-03  Eric Blake  <eblake@redhat.com>

	docs: fix typo in previous patch
	* docs/news.html.in: Fix accidental deletion.

2012-04-03  Michal Privoznik  <mprivozn@redhat.com>

	news.html.in: Fix </br> void tag
	Void elements should be written with slash *after* the tag name,
	not before, so they are not confused with ending tags.

	virsh: Clarify escape sequence
	Currently, we put no strains on escape sequence possibly leaving users
	with console that cannot be terminated. However, not all ASCII
	characters can be used as escape sequence. Only those falling in
	@ - _ can be; implement and document this constraint.

2012-04-03  Daniel Veillard  <veillard@redhat.com>

	Release of libvirt 0.9.11
	* configure.ac docs/news.html.in libvirt.spec.in: update for the release
	* po/*.po*: updated a number of languages translation including new
	  indian languages and regenerated

	Revert "Refactor the libvirt RPM daemon pieces"
	This reverts commit 06a0d57f5a90e408a6280dc2f9db0badeeeb78ee.

2012-04-03  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Start nested job in qemuDomainCheckEjectableMedia
	Originally, qemuDomainCheckEjectableMedia was entering monitor with qemu
	driver lock. Commit 2067e31bf97667eab9f111b496f5e9a44e827c5b, which I
	made to fix that, revealed another issue we had (but didn't notice it
	since the driver was locked): we didn't set nested job when
	qemuDomainCheckEjectableMedia is called during migration. Thus the
	original fix I made was wrong.

2012-04-02  Philipp Hahn  <hahn@univention.de>

	Xen: Fix <clock> handling
	XenD-3.1 introduced managed domains. HV-domains have rtc_timeoffset
	(hgd24f37b31030 from 2007-04-03), which tracks the offset between the
	hypervisors clock and the domains RTC, and is persisted by XenD.
	In combination with localtime=1 this had a bug until XenD-3.4
	(hg5d701be7c37b from 2009-04-01) (I'm not 100% sure how that bug
	manifests, but at least for me in TZ=Europe/Berlin I see the previous
	offset relative to utc being applied to localtime again, which manifests
	in an extra hour being added)

	XenD implements the following variants for clock/@offset:
	- PV domains don't have a RTC → 'localtime' | 'utc'
	- <3.1: no managed domains → 'localtime' | 'utc'
	- ≥3.1: the offset is tracked for HV → 'variable'
	        due to the localtime=1 bug → 'localtime' | 'utc'
	- ≥3.4: the offset is tracked for HV → 'variable'

	Current libvirtd still thinks XenD only implements <clock offset='utc'/>
	and <clock offset='localtime'/>, which is wrong, since the semantic of
	'utc' and 'localtime' specifies, that the offset will be reset on
	domain-restart, while with 'variable' the offset is kept. (keeping the
	offset over "virsh edit" is important, since otherwise the clock might
	jump, which confuses certain guest OSs)

	xendConfigVersion was last incremented to 4 by the xen-folks for
	xen-3.1.0. I know of no way to reliably detect the version of XenD
	(user space tools), which may be different from the version of the
	hypervisor (kernel) version! Because of this only the change from
	'utc'/'localtime' to 'variable' in XenD-3.1 is handled, not the buggy
	behaviour of XenD-3.1 until XenD-3.4.

	For backward compatibility with previous versions of libvirt Xen-HV
	still accepts 'utc' and 'localtime', but they are returned as 'variable'
	on the next read-back from Xend to libvirt, since this is what XenD
	implements: The RTC is NOT reset back to the specified time on next
	restart, but the previous offset is kept.
	This behaviour can be turned off by adding the additional attribute
	adjustment='reset', in which case libvirt will report an error instead
	of doing the conversion. The attribute can also be used as a shortcut to
	offset='variable' with basis='...'.

	With these changes, it is also necessary to adjust the xen tests:

	"localtime = 0" is always inserted, because otherwise on updates the
	value is not changed within XenD.

	adjustment='reset' is inserted for all cases, since they're all <
	XEND_CONFIG_VERSION_3_1_0, only 3.1 introduced persistent
	rtc_timeoffset.

	Some statements change their order because code was moved around.

2012-04-02  Philipp Hahn  <hahn@univention.de>

	Support clock=variable relative to localtime
	Since Xen 3.1 the clock=variable semantic is supported. In addition to
	qemu/kvm Xen also knows about a variant where the offset is relative to
	'localtime' instead of 'utc'.

	Extends the libvirt structure with a flag 'basis' to specify, if the
	offset is relative to 'localtime' or 'utc'.

	Extends the libvirt structure with a flag 'reset' to force the reset
	behaviour of 'localtime' and 'utc'; this is needed for backward
	compatibility with previous versions of libvirt, since they report
	incorrect XML.

	Adapt the only user 'qemu' to the new name.
	Extend the RelaxNG schema accordingly.
	Document the new 'basis' attribute in the HTML documentation.
	Adapt test for the new attribute.

2012-04-02  Yuri Chornoivan  <yurchor@ukr.net>

	Fix typos and spacing in messages.

2012-04-02  Laine Stump  <laine@laine.org>

	qemu: fix memory leak in virDomainGetVcpus
	https://bugzilla.redhat.com/show_bug.cgi?id=808979

	The leak is really in virProcessInfoGetAffinity, as shown in the
	valgrind output given in the above bug report - it calls CPU_ALLOC(),
	but then fails to call CPU_FREE().

	This leak has existed in every version of libvirt since 0.7.5.

2012-03-31  Eric Blake  <eblake@redhat.com>

	conf: allow fuzz in XML with cur balloon > max
	Commit 1b1402b introduced a regression.  Since older libvirt versions
	would silently round memory up (until the previous patch), but populated
	current memory based on querying the guest, it was possible to have
	dumpxml show cur > max by the amount of the rounding.  For example, if
	a user requested 1048570 KiB memory (just shy of 1GiB), the qemu
	driver would actually run with 1048576 KiB, and libvirt 0.9.10 would
	output a current that was 6KiB larger than the maximum.  Situations
	where this could have an impact include, but are not limited to,
	migration from old to new libvirt, managedsave in old libvirt and
	start in new libvirt, snapshot creation in old libvirt and revert in
	new libvirt - without this patch, the new libvirt would reject the
	VM because of the rounding discrepancy.

	Fix things by adding a fuzz factor, and silently clamp current down to
	maximum in that case, rather than failing to reparse XML for an existing
	VM.  From a practical standpoint, this has no user impact: 'virsh
	dumpxml' will continue to query the running guest rather than rely on
	the incoming xml, which will see the currect current value, and even if
	clamping down occurs during parsing, it will be by at most the fuzz
	factor of a megabyte alignment, and rounded back up when passed back to
	the hypervisor.

	Meanwhile, we continue to reject cur > max if the difference is beyond
	the fuzz factor of nearest megabyte.  But this is not a real change in
	behavior, since with 0.9.10, even though the parser allowed it, later
	in the processing stream we would reject it at the qemu layer; so
	rejecting it in the parser just moves error detection to a nicer place.

	* src/conf/domain_conf.c (virDomainDefParseXML): Don't reject
	existing XML.
	Based on a report by Zhou Peng.

2012-03-31  Eric Blake  <eblake@redhat.com>

	qemu: reflect any memory rounding back to xml
	If we round up a user's memory request, we should update the XML
	to reflect the actual value in use by the VM, rather than giving
	an artificially small value back to the user.

	* src/qemu/qemu_command.c (qemuBuildNumaArgStr)
	(qemuBuildCommandLine): Reflect rounding back to XML.

2012-03-31  Eric Blake  <eblake@redhat.com>

	python: improve conversion validation
	Laszlo Ersek pointed out that in trying to convert a long to an
	unsigned int, we used:

	long long_val = ...;
	if ((unsigned int)long_val == long_val)

	According to C99 integer promotion rules, the if statement is
	equivalent to:

	(unsigned long)(unsigned int)long_val == (unsigned long)long_val

	since you get an unsigned comparison if at least one side is
	unsigned, using the largest rank of the two sides; but on 32-bit
	platforms, where unsigned long and unsigned int are the same size,
	this comparison is always true and ends up converting negative
	long_val into posigive unsigned int values, rather than rejecting
	the negative value as we had originally intended (python longs
	are unbounded size, and we don't want to do silent modulo
	arithmetic when converting to C code).

	Fix this by using direct comparisons, rather than casting.

	* python/typewrappers.c (libvirt_intUnwrap, libvirt_uintUnwrap)
	(libvirt_ulongUnwrap, libvirt_ulonglongUnwrap): Fix conversion
	checks.

2012-03-31  Daniel P. Berrange  <berrange@redhat.com>

	Fix client only RPM build & other misc RPM problems
	* libvirt.spec.in: Remove obsolete --with-remote-pid-file arg.
	  Add missing %{without_libxl} statement. Fix handling of docs
	  in client only build. Put systemtap files in -client RPM
	  instead of -daemon RPM
	* examples/xml/nwfilter/Makefile.am: Don't install examples if
	  nwfilter is disabled.

2012-03-31  Daniel P. Berrange  <berrange@redhat.com>

	Refactor the libvirt RPM daemon pieces
	There are a number of flaws with our packaging of the libvirtd
	daemon:

	 - Installing 'libvirt' does not install 'qemu-kvm' or 'xen'
	   etc which are required to actually run the hypervisor in
	   question
	 - Installing 'libvirt' pulls in the default configuration
	   files which may not be wanted & cause problems if installed
	   inside a guest
	 - It is not possible to explicitly required all the peices
	   required to manage a specific hypervisor

	This change takes the 'libvirt' RPM and and changes it thus

	 - libvirt: just a virtual package with dep on libvirt-daemon,
	   libvirt-daemon-config-network & libvirt-daemon-config-nwfilter
	 - libvirt-daemon: the libvirt daemon and related pieces
	 - libvirt-daemon-config-network: the default network config
	 - libvirt-daemon-config-nwfilter: the network filter configs
	 - libvirt-docs: the website HTML

	We then introduce some more virtual (empty) packages

	 - libvirt-daemon-qemu: Deps on libvirt-daemon & 'qemu'
	 - libvirt-daemon-kvm: Deps on libvirt-daemon & 'qemu-kvm'
	 - libvirt-daemon-lxc: Deps on libvirt-daemon
	 - libvirt-daemon-uml: Deps on libvirt-daemon
	 - libvirt-daemon-xen: Deps on libvirt-daemon & 'xen'

	 - libvirt-qemu: Deps on libvirt-daemon-qemu & libvirt-daemon-config-{network,nwfilter}
	 - libvirt-kvm: Deps on libvirt-daemon-kvm & libvirt-daemon-config-{network,nwfilter}
	 - libvirt-lxc: Deps on libvirt-daemon-lxc & libvirt-daemon-config-{network,nwfilter}
	 - libvirt-uml: Deps on libvirt-daemon-uml & libvirt-daemon-config-{network,nwfilter}
	 - libvirt-xen: Deps on libvirt-daemon-xen & libvirt-daemon-config-network

	My intent in the future is to turn on the driver modules by
	default, at which time 'libvirt-daemon' will cease to include
	any specific drivers, instead we'll get libvirt-daemon-driver-XXXX
	packages for each driver. The libvirt-daemon-XXX packages will
	then pull in each driver that they require.

	It is recommended that applications required a locally installed
	libvirtd daemon, use either 'Requires: libvirt-daemon-XXXX' or
	'Requires: libvirt-XXX' and *not* "Requires: libvirt-daemon"
	or 'Requires: libvirt'

	* libvirt.spec.in: Refactor RPMs
	* docs/packaging.html.in, docs/sitemap.html.in: Document
	  new RPM split rationale

2012-03-31  Hendrik Schwartke  <hendrik@os-t.de>

	qemu: support live change of the bridge used by a guest network device
	This patch was created to resolve this upstream bug:

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

	and is at least a partial solution to this RHEL RFE:

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

	Previously the only attribute of a network device that could be
	modified by virUpdateDeviceFlags() ("virsh update-device") was the
	link state; attempts to change any other attribute would log an error
	and fail.

	This patch adds recognition of a change in bridge device name, and
	supports reconnecting the guest's interface to the new device.
	Standard audit logs for detaching and attaching a network device are
	also generated. Although the current auditing function doesn't log the
	bridge being attached to, this will later be changed in a separate
	patch.

2012-03-31  Eric Blake  <eblake@redhat.com>

	build: fix build on cygwin
	Regression introduced when we changed types in commit 3e2c3d8f6.

	We've done this sort of cleanup before (see commit c685993d7).

	* src/conf/storage_conf.c (virStoragePoolDefFormat)
	(virStorageVolTargetDefFormat): Cast gid_t and uid_t.

2012-03-31  Eric Blake  <eblake@redhat.com>

	build: fix mingw ssize_t, syntax check
	We are so close to a release that we don't want to pull in a
	gnulib submodule update and risk regressions, since there has
	been a lot of other gnulib churn upstream.  However, there are
	a couple of gnulib issues that are worth fixing in isolation,
	by applying local patches to gnulib.

	There was an upstream gnulib bug in maint.mk that rendered most
	of our syntax checks ineffective (and fixing it flushed out a
	minor bug in our code):
	https://lists.gnu.org/archive/html/bug-gnulib/2012-03/msg00194.html

	There is still an upstream bug where gnulib uses the wrong type
	for ssize_t on mingw; we need the fix now even though it has not
	yet been accepted into gnulib:
	https://lists.gnu.org/archive/html/bug-gnulib/2012-03/msg00188.html

	* gnulib/local/top/maint.mk.diff: Pick up upstream gnulib
	maint.mk.
	* gnulib/local/m4/ssize_t.m4.diff: Work around gnulib bug.
	* src/libvirt.c: Remove unused header.
	* cfg.mk
	(exclude_file_name_regexp--sc_prohibit_empty_lines_at_EOF): Exempt
	gnulib local files.

2012-03-31  Laine Stump  <laine@laine.org>

	qemu: eliminate nested switch, simplify code
	qemuBuildHostNetStr had a switch-within-a-switch where both were
	looking at the same variable. This was apparently to take advantage of
	code common to three different cases (while also taking care of some
	code that was different). However, there were only 2 lines common to
	all, one of those can be eliminated by merging it into the
	virAsprintfs that are in each case. On top of that, all the extra
	empty cases cause Coverity complaints (because they are unreachable),
	but absence of the empty cases causes a compile error due to
	"enumeration value not handled in switch".

	The solution is to just make each toplevel case independent, folding
	in the common code to each.

2012-03-31  Laine Stump  <laine@laine.org>

	Revert "Set default name for SPICE agent channel"
	This patch reverts commit b0e2bb3. Its functionality has been replaced
	by commit 3269ee6.

2012-03-31  Laine Stump  <laine@laine.org>

	qemu: set default name for SPICE agent channel when generating command
	commit b0e2bb33 set a default value for the SPICE agent channel by
	inserting it during parsing of the channel XML. That method of setting
	a default is problematic because it makes a format/parse roundtrip
	unclean, and experience with setting other values as a side effect of
	parsing has led to headaches (e.g. automatically setting a MAC address
	in the parser when one isn't specified in the input XML).

	This patch does not revert commit b0e2bb33 (it will be reverted in a
	separate patch) but adds the alternate implementation of simply
	inserting the default value in the appropriate place on the qemu
	commandline when no value is provided.

2012-03-31  Michal Privoznik  <mprivozn@redhat.com>

	qemu_agent: Issue guest-sync prior to every command
	If we issue guest command and GA is not running, the issuing thread
	will block endlessly. We can check for GA presence by issuing
	guest-sync with unique ID (timestamp). We don't want to issue real
	command as even if GA is not running, once it is started, it process
	all commands written to GA socket.

2012-03-30  Michal Privoznik  <mprivozn@redhat.com>

	virnetdevtap: Don't check for flags in virNetDevTapCreateFlags
	With latest gnulib we are checking even the lowest level functions
	whether they check flags. Moreover, we are shadowing the real error
	on system without TUNSETIFF support.

2012-03-30  Daniel P. Berrange  <berrange@redhat.com>

	Fix typo in previous patch
	* src/remote/remote_driver.c: s/sizeof(ret)2/sizeof(ret2)/

2012-03-30  Daniel P. Berrange  <berrange@redhat.com>

	Consistent style for usage of sizeof operator
	The code is splattered with a mix of

	  sizeof foo
	  sizeof (foo)
	  sizeof(foo)

	Standardize on sizeof(foo) and add a syntax check rule to
	enforce it

2012-03-30  Daniel P. Berrange  <berrange@redhat.com>

	Disable build of commandhelper & ssh on Win32
	The commandhelper.c & ssh.c programs rely on various APIs not present
	on Win32. Disable them, since the tests that uses these helpers are
	already disabled

	* tests/commandhelper.c, tests/ssh.c: Disable on WIN32

2012-03-30  Daniel P. Berrange  <berrange@redhat.com>

	Don't redefine the CPU comparison constants in CPU test
	Defining an enum with names like "ERROR" causes  a world of
	hurt on Win32 whose headers have such symbol names already

	* tests/cputest.c: Remove redefinition of CPU constants

2012-03-30  Daniel P. Berrange  <berrange@redhat.com>

	Fix some format specifiers for size_t vs ssize_t
	A handful of places used %zd for format specifiers even
	though the args was size_t, not ssize_t.

	* src/remote/remote_driver.c, src/util/xml.c: s/%zd/%zu/

2012-03-30  Alex Jia  <ajia@redhat.com>

	conf: Prevent crash of libvirtd without channel target name
	* src/conf/domain_conf.c (virDomainChannelDefCheckABIStability): avoid
	  crashing libvirtd due to derefing a NULL pointer.

	For details, please see bug:
	RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=808371

2012-03-30  Wen Congyang  <wency@cn.fujitsu.com>

	fix a deadlock when qemu cannot start
	When qemu cannot start, we may call qemuProcessStop() twice.
	We have check whether the vm is running at the beginning of
	qemuProcessStop() to avoid libvirt deadlock. We call
	qemuProcessStop() with driver and vm locked. It seems that
	we can avoid libvirt deadlock. But unfortunately we may
	unlock driver and vm in the function qemuProcessKill() while
	vm->def->id is not -1. So qemuProcessStop() will be run twice,
	and monitor will be freed unexpectedly. So we should set
	vm->def->id to -1 at the beginning of qemuProcessStop().

2012-03-30  Eric Blake  <eblake@redhat.com>

	build: silence recent syntax check violations
	An upstream gnulib bug[1] meant that some of our syntax checks
	weren't being run.  Fix up our offenders before we upgrade to
	a newer gnulib.

	[1] https://lists.gnu.org/archive/html/bug-gnulib/2012-03/msg00194.html

	* src/util/virnetdevtap.c (virNetDevTapCreate): Use flags.
	* tests/lxcxml2xmltest.c (mymain): Strip useless ().

2012-03-30  Eric Blake  <eblake@redhat.com>

	build: avoid 'devname' for BSD
	Commit 21b5daa1 was the last time we cleaned this up.

	* tools/virt-host-validate-common.c (virHostValidateDevice):
	Rename local variable.

2012-03-29  Zhou Peng  <ailvpeng25@gmail.com>

	private.syms: Add virNetDevMacVLanRestartWithVPortProfile
	virNetDevMacVLanRestartWithVPortProfile is omitted in src/libvirt_private.syms,
	which causes link err.

2012-03-29  Christian Benvenuti  <benve@cisco.com>

	qemu: Make migration fail when port profile association fails on the dst host
	In the current V3 migration protocol, Libvirt does not
	check the result of the function

	  qemuMigrationVPAssociatePortProfiles

	This means that it is possible for a migration to complete
	successfully even when the VM loses network connectivity on
	the destination host.

	With this change libvirt aborts the migration
	(during the "finish" step) when the above function fails, that
	is to say when at least one of the port profile associations fails.

	Signed-off by: Christian Benvenuti <benve@cisco.com>

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

	Set default name for SPICE agent channel
	libvirt documentation for channels with type 'spicevmc' says that the
	'target' child node has:
	"an optional attribute name controls how the guest will have access
	 to the channel, and defaults to name='com.redhat.spice.0'."

	However, this default value is never set in libvirt code base,
	there's only a check in qemu_command.c to error out if the name
	attribute doesn't have the expected value (if it's set).

	This commit sets a default target name for spicevmc channels during
	the domain configuration parsing so that the code agrees with the
	documentation.

2012-03-28  Alex Jia  <ajia@redhat.com>

	virsh: plug memory leaks on failure path
	Leaks are introduced in commit 1cf0e3d and fe383bb.

	Fixing memory leaks, in addition, the patch also fixes a potential missing
	return value issue in 'if (from)' statement, without the fixing, although
	the programming met a error, the subsequent codes will be executed
	continually.

	* tools/virsh.c (cmdSnapshotList): fix memory leaks and missing return value.

	* How to reproduce?

	% virsh snapshot-list <domain> --parent --roots
	% virsh snapshot-list <domain> --parent --tree
	% virsh snapshot-list <domain> --roots --tree

	actual result:
	error: --parent and --roots are mutually exclusive
	error: Failed to disconnect from the hypervisor, 1 leaked reference(s)

	error: --parent and --tree are mutually exclusive
	error: Failed to disconnect from the hypervisor, 1 leaked reference(s)

	error: --roots and --tree are mutually exclusive
	error: Failed to disconnect from the hypervisor, 1 leaked reference(s)

	% virsh snapshot-create-as <domain> --name "hello"
	% virsh snapshot-create-as <domain> --name "libvirt"
	% virsh snapshot-list <domain> --roots --from "hello"

	actual result:
	error: --roots and --from are mutually exclusive
	 Name                 Creation Time             State
	------------------------------------------------------------
	 libvirt              2012-03-28 13:46:51 +0800 running

2012-03-28  Guannan Ren  <gren@redhat.com>

	python: make python APIs use these helper functions
	    *setPyVirTypedParameter
	    *libvirt_virDomainGetCPUStats

	python: Add new helper functions for python to C integral conversion
	    int libvirt_intUnwrap(PyObject *obj, int *val);
	    int libvirt_uintUnwrap(PyObject *obj, unsigned int *val);
	    int libvirt_longUnwrap(PyObject *obj, long *val);
	    int libvirt_ulongUnwrap(PyObject *obj, unsigned long *val);
	    int libvirt_longlongUnwrap(PyObject *obj, long long *val);
	    int libvirt_ulonglongUnwrap(PyObject *obj, unsigned long long *val);
	    int libvirt_doubleUnwrap(PyObject *obj, double *val);
	    int libvirt_boolUnwrap(PyObject *obj, bool *val);

2012-03-28  Eric Blake  <eblake@redhat.com>

	snapshot: fix virsh docs
	Commit d42a2ff forgot to touch up virsh documentation, and commit
	4e9953a mis-spelled the option name.

	* tools/virsh.pod (snapshot-create, snapshot-create-as): Fix typo
	and match recent change in flag meaning.

2012-03-28  Daniel P. Berrange  <berrange@redhat.com>

	Enable all warnings permanently & default to -Werror for GIT builds
	Given that we auto-detect whether each -Wxxxx flag is supported by
	GCC, and we are warning-free and use automake silent rules, there
	is no compelling reason to allow compile warnings to be disabled.

	Replace the --enable-compile-warnings flag with a simpler
	--enable-werror flag, which defaults to 'yes' if building
	from GIT, or 'no' if building from tar.gz

	This helps ensure that everyone writing patches for libvirt will
	take care to fix their warning problems before submitting for
	review

	* autobuild.sh: Force -Werror
	* configure.ac: Update for LIBVIRT_COMPILE_WARNINGS macro change
	* m4/virt-compile-warnings.m4: Permanently enable all warnings,
	  auto-enable Werror for GIT builds

2012-03-28  Daniel P. Berrange  <berrange@redhat.com>

	Enable build of test suite programs by default for GIT checkouts
	Add a new flag '--with-test-suite' to configure to control whether
	the test suite binaries are built by default. ie built with a
	plain 'make', as opposed to delayed until 'make check'

	For builds from tar.gz tests will not be built by default. For
	builds from GIT, tests with be on by default, to try and ensure
	that patch developers don't accidentally break the test suites
	without noticing.

	* configure.ac: Add --with-test-suite
	* tests/Makefile.am: Use noinst_PROGRAMS instead of check_PROGRAMS
	  if building tests by default. Consolidate setting of TESTS and
	  {noinst,check}_PROGRAMS to avoid duplication

2012-03-27  Stef Walter  <stefw@gnome.org>

	Change the default of mdns_adv to false
	 * Don't advertise information on the network without consent of
	   the user, either through manual configuration, or a user
	   interface that drives this option.
	 * Since libvirtd must be configured for network access anyway
	   (for all but ssh), this setting was not useful "out of the box",
	   so changing this default setting does not remove "out of the box"
	   functionality.

2012-03-27  Eric Blake  <eblake@redhat.com>

	snapshot: don't pass NULL to QMP command creation
	Commit d42a2ff caused a regression in creating a disk-only snapshot
	of a qcow2 disk; by passing the wrong variable to the monitor call,
	libvirt ended up creating JSON that looked like "format":null instead
	of the intended "format":"qcow2".

	To make it easier to diagnose this in the future, make JSON creation
	error out if "s:arg" is paired with NULL (it is still possible to
	use "n:arg" in the rare cases where qemu will accept a null).

	* src/qemu/qemu_driver.c
	(qemuDomainSnapshotCreateSingleDiskActive): Pass correct value.
	* src/qemu/qemu_monitor_json.c (qemuMonitorJSONMakeCommandRaw):
	Improve error message.

2012-03-27  Daniel P. Berrange  <berrange@redhat.com>

	Add LXC XML files to schema test & fix problems this uncovers
	* docs/schemas/domaincommon.rng: Add missing lxc & openvz
	  console target types. Allow arch on LXC <os> type element
	* tests/domainschematest: Include tests/lxcxml2xmldata/

2012-03-27  Daniel P. Berrange  <berrange@redhat.com>

	Add support for setting init argv for LXC
	Pass argv to the init binary of LXC, using a new <initarg> element.

	* docs/formatdomain.html.in: Document <os> usage for containers
	* docs/schemas/domaincommon.rng: Add <initarg> element
	* src/conf/domain_conf.c, src/conf/domain_conf.h: parsing and
	  formatting of <initarg>
	* src/lxc/lxc_container.c: Setup LXC argv
	* tests/Makefile.am, tests/lxcxml2xmldata/lxc-systemd.xml,
	  tests/lxcxml2xmltest.c, tests/testutilslxc.c,
	  tests/testutilslxc.h: Test parsing/formatting of LXC related
	  XML parts

2012-03-27  Daniel P. Berrange  <berrange@redhat.com>

	Detect location fo selinux mount point
	The SELinux mount point moved from /selinux to /sys/fs/selinux
	when systemd came along.

	* configure.ac: Probe for SELinux mount point
	* src/lxc/lxc_container.c: Use SELinux mount point determined
	  by configure.ac

2012-03-27  Daniel P. Berrange  <berrange@redhat.com>

	Expand docs for timer tick policy

2012-03-27  D. Herrendoerfer  <d.herrendoerfer@herrendoerfer.name>

	qemu,util: on restart of libvirt restart vepa callbacks
	When libvirtd is restarted, also restart the netlink event
	message callbacks for existing VEPA connections and send
	a message to lldpad for these existing links, so it learns
	the new libvirtd pid.

2012-03-27  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Avoid entering monitor with locked driver
	This avoids possible deadlock of the qemu driver in case a domain is
	begin migrated (in Begin phase) and unrelated connection to qemu driver
	is closed at the right time.

	I checked all callers of qemuDomainCheckEjectableMedia() and they are
	calling this function with qemu driver locked.

2012-03-27  Laine Stump  <laine@laine.org>

	build: fix "missing initializer" error in qemu_process.c
	Found when attempting to build on Fedora 17 alpha with:

	   ./autogen.sh --system --enable-compile-warnings=error

	(this same build command works without problem on Fedora 16). Since
	the consumer of the qemuProcessReconnectData doesn't assume that the
	other fields of the struct are initialized (although it uses them
	internally), the simpler solution is to just switch to C99-style
	struct initialization (which doesn't require specification of all
	fields).

2012-03-27  Laine Stump  <laine@laine.org>

	build: fix "missing initializer" errors in virsh.c
	Found when attempting to build on Fedora 17 alpha with:

	   ./autogen.sh --system --enable-compile-warnings=error

	(this same build command works without problem on Fedora 16). All
	other struct initializers for this struct have the extra field filled
	in (almost always to 0), so the two errant ones were fixed by adding
	in the extra 0 field.

2012-03-27  Laine Stump  <laine@laine.org>

	build: avoid frame size error when building without -O2
	libvirt always adds -Werror-frame-larger-than=4096 to the flags when
	it builds. When building on Fedora 17, two functions with multiple
	1024 buffers declared inside if {} blocks would generate frame size
	errors; apparently the version of gcc on Fedora 16 will merge these
	multiple buffers into a single buffer even when optimization is off,
	but Fedora 17 won't.

	The fix is to declare a single 1024 buffer at the top of the two
	offending functions, and reuse the single buffer throughout the
	functions.

2012-03-27  Martin Kletzander  <mkletzan@redhat.com>

	Added syntax-check rule for return with parentheses
	After cleanup introduced with previous commit, there is a need for
	syntax-check rule taking care of return(). Regexp used in 'prohibit'
	parameter is taken from the cleanup commit and modified so it fits
	'grep -E' format. Semicolon at the end is needed, otherwise the regexp
	could match return with cast.

	Exception is created for python source files because we don't have any
	documentation restricting the use of return that matches this case.

2012-03-27  Martin Kletzander  <mkletzan@redhat.com>

	Cleanup for a return statement in source files
	Return statements with parameter enclosed in parentheses were modified
	and parentheses were removed. The whole change was scripted, here is how:

	List of files was obtained using this command:
	git grep -l -e '\<return\s*([^()]*\(([^()]*)[^()]*\)*)\s*;' |             \
	grep -e '\.[ch]$' -e '\.py$'

	Found files were modified with this command:
	sed -i -e                                                                 \
	's_^\(.*\<return\)\s*(\(\([^()]*([^()]*)[^()]*\)*\))\s*\(;.*$\)_\1 \2\4_' \
	-e 's_^\(.*\<return\)\s*(\([^()]*\))\s*\(;.*$\)_\1 \2\3_'

	Then checked for nonsense.

	The whole command looks like this:
	git grep -l -e '\<return\s*([^()]*\(([^()]*)[^()]*\)*)\s*;' |             \
	grep -e '\.[ch]$' -e '\.py$' | xargs sed -i -e                            \
	's_^\(.*\<return\)\s*(\(\([^()]*([^()]*)[^()]*\)*\))\s*\(;.*$\)_\1 \2\4_' \
	-e 's_^\(.*\<return\)\s*(\([^()]*\))\s*\(;.*$\)_\1 \2\3_'

2012-03-26  Eric Blake  <eblake@redhat.com>

	Fix and test round-trip of query parameters
	When qparams support was dropped in commit bc1ff160, we forgot
	to add tests to ensure that viruri can do the same round trip
	handling of a URI. This round trip was broken, due to use
	of the old 'query' field of xmlUriPtr, instead of the new
	'query_raw'

	Also, we forgot to report an OOM error.

	* tests/viruritest.c (mymain): Add tests based on just-deleted
	qparamtest.
	(testURIParse): Allow difference in input and expected output.
	* src/util/viruri.c (virURIFormat): Add missing error. Use
	  query_raw, instead of query for xmlUriPtr object.

2012-03-24  Osier Yang  <jyang@redhat.com>

	spec: Add missed dependancy for numad
	numad is available since Fedora 17 and RHEL6.X. And it's not supported
	on s390[x] and ARM.

2012-03-24  Eric Blake  <eblake@redhat.com>

	snapshot: improve qemu handling of reused snapshot targets
	The oVirt developers have stated that the real reasons they want
	to have qemu reuse existing volumes when creating a snapshot are:
	1. the management framework is set up so that creation has to be
	done from a central node for proper resource tracking, and having
	libvirt and/or qemu create things violates the framework, and
	2. qemu defaults to creating snapshots with an absolute path to
	the backing file, but oVirt wants to manage a backing chain that
	uses just relative names, to allow for easier migration of a chain
	across storage locations.

	When 0.9.10 added VIR_DOMAIN_SNAPSHOT_CREATE_REUSE_EXT (commit
	4e9953a4), it only addressed point 1, but libvirt was still using
	O_TRUNC which violates point 2.  Meanwhile, the new qemu
	'transaction' monitor command includes a new optional mode argument
	that will force qemu to reuse the metadata of the file it just
	opened (with the burden on the caller to have valid metadata there
	in the first place).  So, this tweaks the meaning of the flag to
	cover both points as intended for use by oVirt.  It is not strictly
	backward-compatible to 0.9.10 behavior, but it can be argued that
	the O_TRUNC of 0.9.10 was a bug.

	Note that this flag is all-or-nothing, and only selects between
	'existing' and the default 'absolute-paths'.  A more flexible
	approach that would allow per-disk selections, as well as adding
	support for the 'no-backing-file' mode, would be possible by
	extending the <domainsnapshot> xml to have a per-disk mode, but
	until we have a management application expressing a need for that
	additional complexity, it is not worth doing.

	* src/libvirt.c (virDomainSnapshotCreateXML): Tweak documentation.
	* src/qemu/qemu_monitor.h (qemuMonitorDiskSnapshot): Add
	parameters.
	* src/qemu/qemu_monitor_json.h (qemuMonitorJSONDiskSnapshot):
	Likewise.
	* src/qemu/qemu_monitor.c (qemuMonitorDiskSnapshot): Pass them
	through.
	* src/qemu/qemu_monitor_json.c (qemuMonitorJSONDiskSnapshot): Use
	new monitor command arguments.
	* src/qemu/qemu_driver.c (qemuDomainSnapshotCreateDiskActive)
	(qemuDomainSnapshotCreateSingleDiskActive): Adjust callers.
	(qemuDomainSnapshotDiskPrepare): Allow qed, modify rules on reuse.

2012-03-24  Eric Blake  <eblake@redhat.com>

	snapshot: wire up qemu transaction command
	The hardest part about adding transactions is not using the new
	monitor command, but undoing the partial changes we made prior
	to a failed transaction.

	* src/qemu/qemu_driver.c (qemuDomainSnapshotCreateDiskActive): Use
	transaction when available.
	(qemuDomainSnapshotUndoSingleDiskActive): New function.
	(qemuDomainSnapshotCreateSingleDiskActive): Pass through actions.
	(qemuDomainSnapshotCreateXML): Adjust caller.

2012-03-24  Eric Blake  <eblake@redhat.com>

	snapshot: add support for qemu transaction command
	QEmu 1.1 is adding a 'transaction' command to the JSON monitor.
	Each element of a transaction corresponds to a top-level command,
	with the additional guarantee that the transaction flushes all
	pending I/O, then guarantees that all actions will be successful
	as a group or that failure will roll back the state to what it
	was before the monitor command.  The difference between a
	top-level command:

	{ "execute": "blockdev-snapshot-sync", "arguments":
	  { "device": "virtio0", ... } }

	and a transaction:

	{ "execute": "transaction", "arguments":
	  { "actions": [
	    { "type": "blockdev-snapshot-sync", "data":
	      { "device": "virtio0", ... } } ] } }

	is just a couple of changed key names and nesting the shorter
	command inside a JSON array to the longer command.  This patch
	just adds the framework; the next patch will actually use a
	transaction.

	* src/qemu/qemu_monitor_json.c (qemuMonitorJSONMakeCommand): Move
	guts...
	(qemuMonitorJSONMakeCommandRaw): ...into new helper.  Add support
	for array element.
	(qemuMonitorJSONTransaction): New command.
	(qemuMonitorJSONDiskSnapshot): Support use in a transaction.
	* src/qemu/qemu_monitor_json.h (qemuMonitorJSONDiskSnapshot): Add
	argument.
	(qemuMonitorJSONTransaction): New declaration.
	* src/qemu/qemu_monitor.h (qemuMonitorTransaction): Likewise.
	(qemuMonitorDiskSnapshot): Add argument.
	* src/qemu/qemu_monitor.c (qemuMonitorTransaction): New wrapper.
	(qemuMonitorDiskSnapshot): Pass argument on.
	* src/qemu/qemu_driver.c
	(qemuDomainSnapshotCreateSingleDiskActive): Update caller.

2012-03-24  Eric Blake  <eblake@redhat.com>

	snapshot: rudimentary qemu support for atomic disk snapshot
	Taking an external snapshot of just one disk is atomic, without having
	to pause and resume the VM.  This also paves the way for later patches
	to interact with the new qemu 'transaction' monitor command.

	The various scenarios when requesting atomic are:
	online, 1 disk, old qemu - safe, allowed by this patch
	online, more than 1 disk, old qemu - failure, this patch
	offline snapshot - safe, once a future patch implements offline disk snapshot
	online, 1 or more disks, new qemu - safe, once future patch uses transaction

	Taking an online system checkpoint snapshot is atomic, since it is
	done via a single 'savevm' monitor command.  Taking an offline system
	checkpoint snapshot is atomic, thanks to the previous patch.

	* src/qemu/qemu_driver.c (qemuDomainSnapshotCreateXML): Support
	new flag for single-disk setups.
	(qemuDomainSnapshotDiskPrepare): Check for atomic here.
	(qemuDomainSnapshotCreateDiskActive): Skip pausing the VM when
	atomic supported.
	(qemuDomainSnapshotIsAllowed): Use bool instead of int.

2012-03-24  Eric Blake  <eblake@redhat.com>

	snapshot: make offline qemu snapshots atomic
	Offline internal snapshots can be rolled back with just a little
	bit of refactoring, meaning that we are now automatically atomic.

	* src/qemu/qemu_domain.c (qemuDomainSnapshotForEachQcow2): Move
	guts...
	(qemuDomainSnapshotForEachQcow2Raw): ...to new helper, to allow
	rollbacks.

2012-03-24  Eric Blake  <eblake@redhat.com>

	snapshot: add atomic create flag
	Right now, it is appallingly easy to cause qemu disk snapshots
	to alter a domain then fail; for example, by requesting a two-disk
	snapshot where the second disk name resides on read-only storage.
	In this failure scenario, libvirt reports failure, but modifies
	the live domain XML in-place to record that the first disk snapshot
	was taken; and places a difficult burden on the management app
	to grab the XML and reparse it to see which disks, if any, were
	altered by the partial snapshot.

	This patch adds a new flag where implementations can request that
	the hypervisor make snapshots atomically; either no changes to
	XML occur, or all disks were altered as a group.  If you request
	the flag, you either get outright failure up front, or you take
	advantage of hypervisor abilities to make an atomic snapshot. Of
	course, drivers should prefer the atomic means even without the
	flag explicitly requested.

	There's no way to make snapshots 100% bulletproof - even if the
	hypervisor does it perfectly atomic, we could run out of memory
	during the followup tasks of updating our in-memory XML, and report
	a failure.  However, these sorts of catastrophic failures are rare
	and unlikely, and it is still nicer to know that either all
	snapshots happened or none of them, as that is an easier state to
	recover from.

	* include/libvirt/libvirt.h.in
	(VIR_DOMAIN_SNAPSHOT_CREATE_ATOMIC): New flag.
	* src/libvirt.c (virDomainSnapshotCreateXML): Document it.
	* tools/virsh.c (cmdSnapshotCreate, cmdSnapshotCreateAs): Expose it.
	* tools/virsh.pod (snapshot-create, snapshot-create-as): Document
	it.

2012-03-24  Eric Blake  <eblake@redhat.com>

	snapshot: add qemu capability for 'transaction' command
	We need a capability bit to gracefully error out if some of the
	additions in future patches can't be implemented by the running qemu.

	* src/qemu/qemu_capabilities.h (QEMU_CAPS_TRANSACTION): New cap.
	* src/qemu/qemu_capabilities.c (qemuCaps): Name it.
	* src/qemu/qemu_monitor_json.c (qemuMonitorJSONCheckCommands): Set
	it.

2012-03-24  Eric Blake  <eblake@redhat.com>

	build: drop obsolete qparams test
	Otherwise, 'make check' breaks since commit bc1ff160 deleted
	qparams.h.  A later patch will ensure that viruri takes over
	what qparams used to do.

	* tests/qparamtest.c (mymain): Delete, now that we have viruri.
	* tests/Makefile.am (check_PROGRAMS, TESTS, qparamtest_SOURCES):
	Delete old test.
	* .gitignore: Add recent test additions.

2012-03-24  Eric Blake  <eblake@redhat.com>

	build: fix incorrect enum declaration
	Recent changes have caused build failures on systems where pdwtags works:
	commit a26a196 mistakenly exported a public variable
	commits a26a196, 57ddcc2, 487c063 all had copy-paste bugs in
	hand-updating the golden API rather than rerunning pdwtags

	* include/libvirt/libvirt.h.in (virDomainEventTrayChangeReason):
	Make this a typedef, not external storage.
	* src/remote_protocol-structs (remote_procedure): Fix spelling.

2012-03-24  Li Zhang  <zhlcindy@linux.vnet.ibm.com>

	Add qemu support for ppc64 on FC16 or above for rpm packaging
	On Fedora16 or above, qemu is supported now. So it is added
	in rpm packaging.

2012-03-23  Daniel P. Berrange  <berrange@redhat.com>

	Fix typo s/virURIFormatQuery/virURIFormatParams/

2012-03-23  Osier Yang  <jyang@redhat.com>

	qemu: Update domain status to running while wakeup event is emitted
	This introduces a new running reason VIR_DOMAIN_RUNNING_WAKEUP,
	and new suspend event type VIR_DOMAIN_EVENT_STARTED_WAKEUP.

	While a wakeup event is emitted, the domain which entered into
	VIR_DOMAIN_PMSUSPENDED will be transferred to "running"
	with reason VIR_DOMAIN_RUNNING_WAKEUP, and a new domain lifecycle
	event emitted with type VIR_DOMAIN_EVENT_STARTED_WAKEUP.

2012-03-23  Osier Yang  <jyang@redhat.com>

	qemu: Update domain state to pmsuspended while suspend event occurs

	New domain state pmsuspended
	This introduces a new domain state pmsuspended to represent
	the domain which has been suspended by guest power management,
	e.g. (entered itno s3 state). Because a "running" state could
	be confused in this case, one will see the guest is paused
	actually while playing. And state "paused" is for the domain
	which was paused by virDomainSuspend.

2012-03-23  Osier Yang  <jyang@redhat.com>

	Add support for the suspend event
	This patch introduces a new event type for the QMP event
	SUSPEND:

	    VIR_DOMAIN_EVENT_ID_PMSUSPEND

	The event doesn't take any data, but considering there might
	be reason for wakeup in future, the callback definition is:

	typedef void
	(*virConnectDomainEventSuspendCallback)(virConnectPtr conn,
	                                        virDomainPtr dom,
	                                        int reason,
	                                        void *opaque);

	"reason" is unused currently, always passes "0".

2012-03-23  Osier Yang  <jyang@redhat.com>

	Add support for the wakeup event
	This patch introduces a new event type for the QMP event
	WAKEUP:

	    VIR_DOMAIN_EVENT_ID_PMWAKEUP

	The event doesn't take any data, but considering there might
	be reason for wakeup in future, the callback definition is:

	typedef void
	(*virConnectDomainEventWakeupCallback)(virConnectPtr conn,
	                                       virDomainPtr dom,
	                                       int reason,
	                                       void *opaque);

	"reason" is unused currently, always passes "0".

2012-03-23  Osier Yang  <jyang@redhat.com>

	qemu: Update tray status while tray moved event is emitted
	With this patch, libvirt won't start the guest with the medium
	source which already ejected by guest when doing migration, or
	saving/restoring.

	qemu: Prohibit setting tray status as open for block type disk

2012-03-23  Osier Yang  <jyang@redhat.com>

	qemu: Do not start with source for removable disks if tray is open
	This is similiar with physical world, one will be surprised if the
	box starts with medium exists while the tray is open.

	New tests are added, tests disk-{cdrom,floppy}-tray are for the qemu
	supports "-device" flag, and disk-{cdrom,floppy}-no-device-cap are
	for old qemu, i.e. which doesn't support "-device" flag.

2012-03-23  Osier Yang  <jyang@redhat.com>

	conf: Parse and for the tray attribute
	The "tray" is only allowed for removable disks, i.e. CDROM and
	Floppy disks.

2012-03-23  Osier Yang  <jyang@redhat.com>

	docs: Add documentation for new attribute tray of disk target
	Example XML:

	    <disk type='file' device='cdrom'>
	      <driver name='qemu' type='raw'/>
	      <source file='/tmp/cdrom.img'/>
	      <target dev='hdd' bus='ide' tray='open'/>
	    </disk>

2012-03-23  Osier Yang  <jyang@redhat.com>

	Add support for event tray moved of removable disks
	This patch introduces a new event type for the QMP event
	DEVICE_TRAY_MOVED, which occurs when the tray of a removable
	disk is moved (i.e opened or closed):

	    VIR_DOMAIN_EVENT_ID_TRAY_CHANGE

	The event's data includes the device alias and the reason
	for tray status' changing, which indicates why the tray
	status was changed. Thus the callback definition for the event
	is:

	enum {
	    VIR_DOMAIN_EVENT_TRAY_CHANGE_OPEN = 0,
	    VIR_DOMAIN_EVENT_TRAY_CHANGE_CLOSE,

	\#ifdef VIR_ENUM_SENTINELS
	    VIR_DOMAIN_EVENT_TRAY_CHANGE_LAST
	\#endif
	} virDomainEventTrayChangeReason;

	typedef void
	(*virConnectDomainEventTrayChangeCallback)(virConnectPtr conn,
	                                           virDomainPtr dom,
	                                           const char *devAlias,
	                                           int reason,
	                                           void *opaque);

2012-03-23  Prerna Saxena  <prerna@linux.vnet.ibm.com>

	Implement sysinfo on PowerPC.
	Libvirt on x86 parses 'dmidecode' to gather characteristics of host
	system. On PowerPC, this is now implemented by reading /proc/cpuinfo
	NOTE: memory-DIMM information is not presently implemented.

	Acked-by: Daniel Veillard <veillard@redhat.com>
	Acked-by: Daniel P Berrange <berrange@redhat.com>

2012-03-23  Daniel P. Berrange  <berrange@redhat.com>

	Lookup auth credentials in config file before prompting
	When SASL requests auth credentials, try to look them up in the
	config file first. If any are found, remove them from the list
	that the user is prompted for

2012-03-23  Daniel P. Berrange  <berrange@redhat.com>

	Refactor code prompting for SASL credentials
	SASL may prompt for credentials after either a 'start' or 'step'
	invocation. In both cases the code to handle this is the same.
	Refactor this code into a separate method to reduce the duplication,
	since the complexity is about to grow

	* src/remote/remote_driver.c: Refactor interaction with SASL

2012-03-23  Daniel P. Berrange  <berrange@redhat.com>

	Add helper API for finding auth file path
	* src/util/virauth.c, src/util/virauth.h: Add virAuthGetConfigFilePath
	* include/libvirt/virterror.h, src/util/virterror.c: Add
	  VIR_FROM_AUTH error domain

	Rename virRequest{Username,Password} to virAuthGet{Username,Password}
	Ensure that the functions in virauth.h have names matching the file
	prefix, by renaming  virRequest{Username,Password} to
	virAuthGet{Username,Password}

2012-03-23  Daniel P. Berrange  <berrange@redhat.com>

	Rename src/util/authhelper.[ch] to src/util/virauth.[ch]
	To follow latest naming conventions, rename src/util/authhelper.[ch]
	to src/util/virauth.[ch].

	* src/util/authhelper.[ch]: Rename to src/util/virauth.[ch]
	* src/esx/esx_driver.c, src/hyperv/hyperv_driver.c,
	  src/phyp/phyp_driver.c, src/xenapi/xenapi_driver.c: Update
	  for renamed include files

2012-03-23  Daniel P. Berrange  <berrange@redhat.com>

	Add a virKeyfilePtr object for parsing '.ini' files
	The '.ini' file format is a useful alternative to the existing
	config file style, when you need to have config files which
	are hashes of hashes. The 'virKeyFilePtr' object provides a
	way to parse these file types.

	* src/Makefile.am, src/util/virkeyfile.c,
	  src/util/virkeyfile.h: Add .ini file parser
	* tests/Makefile.am, tests/virkeyfiletest.c: Test
	  basic parsing capabilities

2012-03-23  Daniel P. Berrange  <berrange@redhat.com>

	Convert drivers over to use virURIPtr for query params
	Convert drivers currently using the qparams APIs, to instead
	use the virURIPtr query parameters directly.

	* src/esx/esx_util.c, src/hyperv/hyperv_util.c,
	  src/remote/remote_driver.c, src/xenapi/xenapi_utils.c: Remove
	  use of qparams
	* src/util/qparams.h, src/util/qparams.c: Delete
	* src/Makefile.am, src/libvirt_private.syms: Remove qparams

2012-03-23  Daniel P. Berrange  <berrange@redhat.com>

	Store parsed query parameters directly in the virURIPtr struct
	Avoid the need for each driver to parse query parameters itself
	by storing them directly in the virURIPtr struct. The parsing
	code is a copy of that from src/util/qparams.c  The latter will
	be removed in a later patch

	* src/util/viruri.h: Add query params to virURIPtr
	* src/util/viruri.c: Parse query parameters when creating virURIPtr
	* tests/viruritest.c: Expand test to cover params

2012-03-23  Daniel P. Berrange  <berrange@redhat.com>

	Use a libvirt custom struct for virURIPtr
	Instead of just typedef'ing the xmlURIPtr struct for virURIPtr,
	use a custom libvirt struct. This allows us to fix various
	problems with libxml2. This initially just fixes the query vs
	query_raw handling problems.

2012-03-23  Daniel P. Berrange  <berrange@redhat.com>

	Centralize error reporting for URI parsing/formatting problems
	Move error reporting out of the callers, into virURIParse
	and virURIFormat, to get consistency.

	* include/libvirt/virterror.h, src/util/virterror.c: Add VIR_FROM_URI
	* src/util/viruri.c, src/util/viruri.h: Add error reporting
	* src/esx/esx_driver.c, src/libvirt.c, src/libxl/libxl_driver.c,
	  src/lxc/lxc_driver.c, src/openvz/openvz_driver.c,
	  src/qemu/qemu_driver.c, src/qemu/qemu_migration.c,
	  src/remote/remote_driver.c, src/uml/uml_driver.c,
	  src/vbox/vbox_tmpl.c, src/vmx/vmx.c, src/xen/xen_driver.c,
	  src/xen/xend_internal.c, tests/viruritest.c: Remove error
	  reporting

2012-03-23  Daniel P. Berrange  <berrange@redhat.com>

	s/xmlURIPtr/virURIPtr/ in virURIFormat impl
	The parameter in the virURIFormat impl mistakenly used the
	xmlURIPtr type, instead of virURIPtr. Since they will soon
	cease to be identical, this needs fixing

2012-03-23  Daniel P. Berrange  <berrange@redhat.com>

	Use virURIFree instead of xmlFreeURI
	Since we defined a custom virURIPtr type, we should use a
	virURIFree method instead of assuming it will always be
	a typedef for xmlURIPtr

	* src/util/viruri.c, src/util/viruri.h, src/libvirt_private.syms:
	  Add a virURIFree method
	* src/datatypes.c, src/esx/esx_driver.c, src/libvirt.c,
	  src/qemu/qemu_migration.c, src/vmx/vmx.c, src/xen/xend_internal.c,
	  tests/viruritest.c: s/xmlFreeURI/virURIFree/

2012-03-23  Daniel P. Berrange  <berrange@redhat.com>

	Add test case for virURIPtr classs
	To ensure we properly escape & unescape IPv6 numeric addresses,
	add a test case

	* tests/Makefile.am, tests/viruritest.c: URI parsing test

2012-03-23  Daniel P. Berrange  <berrange@redhat.com>

	Leave all child processes running when stopping systemd service
	Currently the libvirt.service unit file for systemd does not
	specify any kill mode. So systemd kills off every process
	inside its cgroup. ie all dnsmasq processes, all virtual
	machines. This obviously not what we want. Set KillMode=process
	so that it only kills the top level process of libvirtd

	* daemon/libvirtd.service.in: Add KillMode=process

	Reported-By: Mark McLoughlin <markmc@redhat.com>

2012-03-23  Dave Allan  <dallan@redhat.com>

	Clarify virsh freecell manpage entry

2012-03-23  Zhou Peng  <ailvpeng25@gmail.com>

	docs: fix typo
	Bogus <code/>, and incorrect use of it's instead of its.

2012-03-23  Dave Allan  <dallan@redhat.com>

	Clarify what documentation is being referenced
	virsh.pod had several instances in which it referred to "the
	documentation" which was a little puzzling to me since it is
	documentation.  Reading the document from end to end makes it clear
	that it means a specific URI which was noted previously in the text,
	but I had never noticed those URIs in several years of referring to
	the man page.  This patch adds those URIs to several additional places
	in the text.

2012-03-22  Guannan Ren  <gren@redhat.com>

	python: add virDomainGetCPUStats python binding API
	    dom.getCPUStats(True, 0)
	      [{'cpu_time': 24699446159L, 'system_time': 10870000000L, 'user_time': 950000000L}]
	    dom.getCPUStats(False, 0)
	      [{'cpu_time': 8535292289L}, {'cpu_time': 1005395355L}, {'cpu_time': 9351766377L}, {'cpu_time': 5813545649L}]

	    *generator.py Add a new naming rule
	    *libvirt-override-api.xml The API function description
	    *libvirt-override.c Implement it.

2012-03-22  Alex Jia  <ajia@redhat.com>

	python: Avoid memory leaks on libvirt_virNodeGetCPUStats
	Detected by valgrind. Leaks are introduced in commit 4955602.

	* python/libvirt-override.c (libvirt_virNodeGetCPUStats): fix memory leaks
	and improve codes return value.

	For details, please see the following link:
	RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=770943

2012-03-22  Eric Blake  <eblake@redhat.com>

	build: drop a painfully long gnulib test
	On machines with massive amounts of CPUs, the gnulib 'test-lock'
	could take minutes, or even appear to deadlock, because of poor
	scaling of timing interactions between multiple cores.

	See https://bugzilla.redhat.com/show_bug.cgi?id=797284.
	For precedence, note that iwhd has done the same:
	https://lists.gnu.org/archive/html/bug-gnulib/2012-01/msg00311.html

	We can re-enable things if gnulib ever analyzes and improves the
	situation.

	* bootstrap.conf (gnulib_tool_option_extras): Avoid lock-tests.

2012-03-22  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Avoid dangling migration-out job when client dies
	When a client which started non-p2p migration dies in a bad time, the
	source libvirtd never clears the migration job and almost nothing can be
	done with the domain without restarting the daemon. This patch makes use
	of connection close callbacks and ensures that migration job is properly
	discarded when the client disconnects.

	qemu: Make autodestroy utilize connection close callbacks

	qemu: Add connection close callbacks
	Add support for registering arbitrary callback to be called for a domain
	when a connection gets closed.

	qemu: Avoid dangling migration-in job on shutoff domains
	Destination daemon should not rely on the client or source daemon
	(depending on the type of migration) to call Finish when migration
	fails, because the client may crash before it can do so. The domain
	prepared for incoming migration is set to be destroyed (and migration
	job cleaned up) when connection with the client closes but this is not
	enough. If the associated qemu process crashes after Prepare step and
	the domain is cleaned up before the connection gets closed, autodestroy
	is not called for the domain and migration jobs remains set. In case the
	domain is defined on destination host (i.e., it is not completely
	removed once destroyed) we keep the job set for ever. To fix this, we
	register a cleanup callback which is responsible to clean migration-in
	job when a domain dies anywhere between Prepare and Finish steps. Note
	that we can't blindly clean any job when spotting EOF on monitor since
	normally an API is running at that time.

	qemu: Add support for domain cleanup callbacks
	Add support for registering cleanup callbacks to be run when a domain
	transitions to shutoff state.

2012-03-22  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Use unlimited speed when migrating to file
	This reverts commit 61f2b6ba5fdef0613d6351b99913b5ef468144ce and most of
	commit d8916dc8e2f612ab3ce46f32c4bfeb0bd73f6007, which effectively
	brings back commit ef1065cf5acad13767c054758cbe7f4e8af5d241 written by
	Jim Fehlig:

	The qemu migration speed default is 32MiB/s as defined in migration.c

	/* Migration speed throttling */
	static int64_t max_throttle = (32 << 20);

	There's no need to throttle migration when targeting a file, so set
	migration speed to unlimited prior to migration, and restore to libvirt
	default value after migration.

	Default units is MB for migrate_set_speed monitor command, so
	(INT64_MAX / (1024 * 1024)) is used for unlimited migration speed.

	This was reverted because migration to file could not be canceled and
	even monitored since qemu was not processing any monitor commands until
	the migration finished. This is now different as we make sure the
	file descriptor we pass to qemu is able to properly report EAGAIN.
	Recent qemu changes might have helped as well.

	I tested managedsave with this patch in and indeed, it is 10x faster
	while I can still monitor its progress.

2012-03-21  Alex Jia  <ajia@redhat.com>

	python: Avoid memory leaks on libvirt_virNodeGetMemoryStats
	Detected by valgrind. Leaks are introduced in commit 17c7795.

	* python/libvirt-override.c (libvirt_virNodeGetMemoryStats): fix memory leaks
	and improve codes return value.

	For details, please see the following link:
	RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=770944

2012-03-21  Eric Blake  <eblake@redhat.com>

	python: always include config.h first
	On RHEL 5.7, I got this compilation failure:

	In file included from /usr/include/python2.4/pyport.h:98,
	                 from /usr/include/python2.4/Python.h:55,
	                 from libvirt.c:3:
	../gnulib/lib/time.h:468: error: expected ';', ',' or ')' before '__timer'

	Turns out that our '#define restrict __restrict' from config.h wasn't
	being picked up.  Gnulib _requires_ that all .c files include <config.h>
	first, otherwise the gnulib header overrides tend to misbehave.

	Problem introduced by patch c700613b8.

	* python/generator.py (buildStubs): Include <config.h> first.

2012-03-20  Martin Kletzander  <mkletzan@redhat.com>

	Minor docs fix
	End tag for "host" element was missing in example configuration

2012-03-20  Laine Stump  <laine@laine.org>

	conf: forbid use of multicast mac addresses
	A few times libvirt users manually setting mac addresses have
	complained of a networking failure that ends up being due to a multicast
	mac address being used for a guest interface. This patch prevents that
	by logging an error and failing if a multicast mac address is
	encountered in each of the three following cases:

	1) domain xml <interface> mac address.
	2) network xml bridge mac address.
	3) network xml dhcp/host mac address.

	There are several other places where a mac address can be input that
	aren't controlled in this manner because failure to do so has no
	consequences (e.g., if the address will be used to search through
	existing interfaces for a match).

	The RNG has been updated to add multiMacAddr and uniMacAddr along with
	the existing macAddr, and macAddr was switched to uniMacAddr where
	appropriate.

2012-03-20  Laine Stump  <laine@laine.org>

	conf: return immediately on error in dhcp host element
	If an error was encountered parsing a dhcp host entry mac address or
	name, parsing would continue and log a less descriptive error that
	might make it more difficult to notice the true nature of the problem.

	This patch returns immediately on logging the first error.

2012-03-20  Laine Stump  <laine@laine.org>

	util: fail attempts to use same mac address for guest and tap
	This patch is in response to:

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

	If a guest's tap device is created using the same MAC address the
	guest uses for its own network card (which connects to the tap
	device), the Linux kernel will log the following message and traffic
	will not pass:

	 kernel: vnet9: received packet with own address as source address

	This patch disallows MAC addresses with a first byte of 0xFE, but only in
	the case that the MAC address is used for a guest interface that's
	connected by way of a standard tap device. (In other words, the
	validation is done at runtime at the same place the MAC address is
	modified for the tap device, rather than when mac address is parsed,
	the idea being that it is then we know for sure the address will be
	problematic.)

2012-03-20  Martin Kletzander  <mkletzan@redhat.com>

	Cpu mapping cleanup
	Using inheritance, this patch cleans up the cpu_map.xml file and also
	sorts all CPU features according to the feature and registry
	values. Model features are sorted the same way as foeatures in the
	specification.
	Also few models that are related were organized together and parts of
	the XML are marked with comments

2012-03-20  Eric Blake  <eblake@redhat.com>

	snapshot: make quiesce a bit safer
	If a guest is paused, we were silently ignoring the quiesce flag,
	which results in unclean snapshots, contrary to the intent of the
	flag.  Since we can't quiesce without guest agent support, we should
	instead fail if the guest is not running.

	Meanwhile, if we attempt a quiesce command, but the guest agent
	doesn't respond, and we time out, we may have left the command
	pending on the guest's queue, and when the guest resumes parsing
	commands, it will freeze even though our command is no longer
	around to issue a thaw.  To be safe, we must _always_ pair every
	quiesce call with a counterpart thaw, even if the quiesce call
	failed due to a timeout, so that if a guest wakes up and starts
	processing a command backlog, it will not get stuck in a frozen
	state.

	* src/qemu/qemu_driver.c (qemuDomainSnapshotCreateDiskActive):
	Always issue thaw after a quiesce, even if quiesce failed.
	(qemuDomainSnapshotFSThaw): Add a parameter.

2012-03-19  Martin Kletzander  <mkletzan@redhat.com>

	virConfGetValue: Fixed NULL pointer check
	This patch fixes a NULL pointer check that was causing SegFault on
	some specific configurations. It also reverts commit 59d0c9801c1ab
	that was checking for this value in one place.

2012-03-17  Eric Blake  <eblake@redhat.com>

	virsh: trim aliases from -h output
	Commit af3f9aab taught 'virsh help' to ignore command aliases,
	but forgot 'virsh -h'.

	* tools/virsh.c (vshUsage): Handle aliases.

2012-03-16  Daniel P. Berrange  <berrange@redhat.com>

	Fix handling of blkio deviceWeight empty string
	A common coding pattern for changing blkio parameters is

	  1. virDomainGetBlkioParameters

	  2. change one or more params

	  3. virDomainSetBlkioParameters

	For this to work, it must be possible to roundtrip through
	the methods without error. Unfortunately virDomainGetBlkioParameters
	will return "" for the deviceWeight parameter for guests by default,
	which virDomainSetBlkioParameters will then reject as invalid.

	This fixes the handling of "" to be a no-op, and also improves the
	error message to tell you what was invalid

2012-03-16  Osier Yang  <jyang@redhat.com>

	remote: Fix migration leaks
	How to reproduce:

	% valgrind -v --leak-check=full virsh migrate mig \
	  qemu+ssh://$dest/system --unsafe

	== 8 bytes in 1 blocks are definitely lost in loss record 1 of 28
	==    at 0x4A04A28: calloc (vg_replace_malloc.c:467)
	==    by 0x3EB7115FB8: xdr_reference (in /lib64/libc-2.12.so)
	==    by 0x3EB7115F10: xdr_pointer (in /lib64/libc-2.12.so)
	==    by 0x4D1EA84: xdr_remote_string (remote_protocol.c:40)
	==    by 0x4D1EAD8: xdr_remote_domain_migrate_prepare3_ret (remote_protocol.c:4772)
	==    by 0x4D2FFD2: virNetMessageDecodePayload (virnetmessage.c:382)
	==    by 0x4D2789C: virNetClientProgramCall (virnetclientprogram.c:382)
	==    by 0x4D0707D: callWithFD (remote_driver.c:4549)
	==    by 0x4D070FB: call (remote_driver.c:4570)
	==    by 0x4D12AEE: remoteDomainMigratePrepare3 (remote_driver.c:4138)
	==    by 0x4CF7BE9: virDomainMigrateVersion3 (libvirt.c:4815)
	==    by 0x4CF9432: virDomainMigrate2 (libvirt.c:5454)
	==
	== LEAK SUMMARY:
	==    definitely lost: 8 bytes in 1 blocks
	==    indirectly lost: 0 bytes in 0 blocks
	==      possibly lost: 0 bytes in 0 blocks
	==    still reachable: 126,995 bytes in 1,343 blocks
	==         suppressed: 0 bytes in 0 blocks

	This patch also fixes the leaks in remoteDomainMigratePrepare and
	remoteDomainMigratePrepare2.

2012-03-16  Alex Jia  <ajia@redhat.com>

	libvirt: fix comment typo
	* src/libvirt.c (virStorageVolResize): correct comment typo according to
	  virStorageVolResizeFlags enum definition.

2012-03-16  Daniel P. Berrange  <berrange@redhat.com>

	Add support for forcing a private network namespace for LXC guests
	If no <interface> elements are included in an LXC guest XML
	description, then the LXC guest will just see the host's
	network interfaces. It is desirable to be able to hide the
	host interfaces, without having to define any guest interfaces.

	This patch introduces a new feature flag <privnet/> to allow
	forcing of a private network namespace for LXC. In the future
	I also anticipate that we will add <privuser/> to force a
	private user ID namespace.

	* src/conf/domain_conf.c, src/conf/domain_conf.h: Add support
	  for <privnet/> feature. Auto-set <privnet> if any <interface>
	  devices are defined
	* src/lxc/lxc_container.c: Honour request for private network
	  namespace

2012-03-16  Peter Krempa  <pkrempa@redhat.com>

	lib: Don't access configuration if none is present
	Commit e457d5ef2015e6106094b85f8bbd1582002edc4d adds ability to pass the
	default URI using the client configuration file. If the file is not
	present, it still accesses the NULL config object causing a segfault.

	Caught running "make check".

2012-03-16  Michal Privoznik  <mprivozn@redhat.com>

	qemuDomainDetachPciDiskDevice: Free allocated cgroup
	This function potentially allocates new virCgroup but never
	frees it.

2012-03-15  Laine Stump  <laine@laine.org>

	Emit graphics events when a SPICE client connects/disconnects
	Wire up the domain graphics event notifications for SPICE. Adapted
	from a RHEL-only patch written by Dan Berrange that used custom
	__com.redhat_SPICE events - equivalent events are now available in
	upstream QEMU (including a SPICE_CONNECTED event, which was missing in
	the __COM.redhat_SPICE version).

	* src/qemu/qemu_monitor_json.c: Wire up SPICE graphics events

2012-03-15  Osier Yang  <jyang@redhat.com>

	numad: Fix typo and warning
	src/libvirt_private.syms:
	  s/virDomainCpuPlacement/virDomainCpuPlacementMode/
	src/qemu/qemu_process.c
	  def->mem.cur_balloon expects "llu"
	--
	pushed under build-breaker rule

2012-03-15  Daniel P. Berrange  <berrange@redhat.com>

	Add container_uuid env variable to LXC guests
	Systemd has declared that all container virtualization technologies
	should set 'container_uuid' to identify themselves.

	http://cgit.freedesktop.org/systemd/systemd/commit/?id=09b967eaa51a39dabb7f238927f67bd682466dbc

2012-03-15  Daniel P. Berrange  <berrange@redhat.com>

	Allow overriding default URI in config file
	Currently if the URI passed to virConnectOpen* is NULL, then we

	 - Look for LIBVIRT_DEFAULT_URI env var
	 - Probe for drivers

	This changes it so that

	 - Look for LIBVIRT_DEFAULT_URI env var
	 - Look for 'uri_default' in $HOME/.libvirt/libvirt.conf
	 - Probe for drivers

2012-03-15  Osier Yang  <jyang@redhat.com>

	virsh: A bit smarter attach-disk
	Detects the file type of source path if no "--sourcetype" and
	"driver" is specified, instead of always set the disk type as
	"block".

2012-03-15  Alex Jia  <ajia@redhat.com>

	virsh: fix invalid free
	* tools/virsh.c (cmdDetachDisk): fix invalid free due to using
	  uninitialised value.

	* How to reproduce?
	# virsh detach-disk a b
	error: failed to get domain 'a'
	*** glibc detected *** virsh: double free or corruption (out): 0x00007fff410ed1a0 ***
	======= Backtrace: =========
	/lib64/libc.so.6[0x39cf0750c6]
	/usr/lib/libvirt.so.0(virFree+0x39)[0x7f045938a239]
	virsh[0x41c768]
	virsh[0x415075]
	virsh[0x425d64]
	/lib64/libc.so.6(__libc_start_main+0xfd)[0x39cf01ecdd]
	virsh[0x40a419]
	======= Memory map: ========
	00400000-0044e000 r-xp 00000000 08:0e 760441                             /usr/bin/virsh
	0064e000-00650000 rw-p 0004e000 08:0e 760441                             /usr/bin/virsh
	......
	39d7229000-39d722b000 r--p 00029000 08:0e 2183477                        /lib64/libk5crypto.so.3.1
	39d722b000-39d722c000 rw-p 0002b000 08:0e 2183477                        /lib64/lAborted (core dumped)

2012-03-15  Osier Yang  <jyang@redhat.com>

	qemu: Support numad
	numad is an user-level daemon that monitors NUMA topology and
	processes resource consumption to facilitate good NUMA resource
	alignment of applications/virtual machines to improve performance
	and minimize cost of remote memory latencies. It provides a
	pre-placement advisory interface, so significant processes can
	be pre-bound to nodes with sufficient available resources.

	More details: http://fedoraproject.org/wiki/Features/numad

	"numad -w ncpus:memory_amount" is the advisory interface numad
	provides currently.

	This patch add the support by introducing a new XML attribute
	for <vcpu>. e.g.

	  <vcpu placement="auto">4</vcpu>
	  <vcpu placement="static" cpuset="1-10^6">4</vcpu>

	The returned advisory nodeset from numad will be printed
	in domain's dumped XML. e.g.
	  <vcpu placement="auto" cpuset="1-10^6">4</vcpu>

	If placement is "auto", the number of vcpus and the current
	memory amount specified in domain XML will be used for numad
	command line (numad uses MB for memory amount):
	  numad -w $num_of_vcpus:$current_memory_amount / 1024

	The advisory nodeset returned from numad will be used to set
	domain process CPU affinity then. (e.g. qemuProcessInitCpuAffinity).

	If the user specifies both CPU affinity policy (e.g.
	(<vcpu cpuset="1-10,^7,^8">4</vcpu>) and placement == "auto"
	the specified CPU affinity will be overridden.

	Only QEMU/KVM drivers support it now.

	See docs update in patch for more details.

2012-03-14  Osier Yang  <jyang@redhat.com>

	qemu: Use scsi-block for lun passthrough instead of scsi-disk
	And don't allow to hotplug a usb disk with "device == lun". This
	is the missed pieces in previous virtio-scsi patchset:

	http://www.redhat.com/archives/libvir-list/2012-February/msg01052.html

2012-03-14  Michal Privoznik  <mprivozn@redhat.com>

	qemu: Reverse condition in qemuDomainCheckDiskPresence
	With current code, we pass true iff domain is cold booting. However,
	if disk is inaccessible and startupPolicy for that disk is set to
	'requisite' we have to fail iff cold booting.

2012-03-14  Peter Krempa  <pkrempa@redhat.com>

	cpu: Add cpu definition for Intel Sandy Bridge cpu type
	This patch adds support for the new tsc-deadline feature flag
	and a new model to the supported model list describing the
	Intel Sandy Bridge platform.

2012-03-13  Martin Kletzander  <mkletzan@redhat.com>

	Added support for AMD Bulldozer CPU
	AMD Bulldozer (or Opteron_G4 as called in QEMU) was added to the list
	of cpu models, flags were taken from upstream qemu cpu specifications
	and should be sorted by bit values (or first occurence in the feature
	specification part of cpu_map.xml).

	Based on QEMU upstream commit 885bb0369a4f0abe2c0185178f3cb347cb02cdf1.

2012-03-13  Michal Privoznik  <mprivozn@redhat.com>

	graphics: Cleanup port policy
	Even though we say in documentation setting (tls-)port to -1 is legacy
	compat style for enabling autoport, we're roughly doing this for VNC.
	However, in case of SPICE auto enable autoport iff both port & tlsPort
	are equal -1 as documentation says autoport plays with both.

2012-03-13  Guannan Ren  <gren@redhat.com>

	qemu: fix segfault when detaching non-existent network device
	In qemuDomainDetachNetDevice, detach was being used before it had been
	validated. If no matching device was found, this resulted in a
	dereference of a NULL pointer.

	This behavior was a regression introduced in commit
	cf90342be0022520e25cfa258cef1034b229a100, so it has not been a part of
	any official libvirt release.

2012-03-13  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Fix (managed)save and snapshots with host mode CPU
	When host-model and host-passthrouh CPU modes were introduced, qemu
	driver was properly modify to update guest CPU definition during
	migration so that we use the right CPU at the destination. However,
	similar treatment is needed for (managed)save and snapshots since they
	need to save the exact CPU so that a domain can be properly restored.
	To avoid repetition of such situation, all places that need live XML
	share the code which generates it.

	As a side effect, this patch fixes error reporting from
	qemuDomainSnapshotWriteMetadata().

2012-03-13  Eric Blake  <eblake@redhat.com>

	docs: fix usage example on setting log levels
	Reported by Michael S. Tsirkin.

	* docs/logging.html.in (log_examples): Use correct libvirtd.conf
	syntax.

2012-03-12  Eric Blake  <eblake@redhat.com>

	cpustats: report user and sys times
	Thanks to cgroups, providing user vs. system time of the overall
	guest is easy to add to our existing API.

	* include/libvirt/libvirt.h.in (VIR_DOMAIN_CPU_STATS_USERTIME)
	(VIR_DOMAIN_CPU_STATS_SYSTEMTIME): New constants.
	* src/util/virtypedparam.h (virTypedParameterArrayValidate)
	(virTypedParameterAssign): Enforce checking the result.
	* src/qemu/qemu_driver.c (qemuDomainGetPercpuStats): Fix offender.
	(qemuDomainGetTotalcpuStats): Implement new parameters.
	* tools/virsh.c (cmdCPUStats): Tweak output accordingly.

2012-03-12  Eric Blake  <eblake@redhat.com>

	cpustats: collect VM user and sys times
	As documented in linux.git/Documentation/cgroups/cpuacct.txt,
	cpuacct.stat returns user and system time in ticks (the same
	unit used in times(2)).  It would be a bit nicer if it were like
	getrusage(2) and reported timeval contents, or like cpuacct.usage
	and in nanoseconds, but we can't be picky.

	* src/util/cgroup.h (virCgroupGetCpuacctStat): New function.
	* src/util/cgroup.c (virCgroupGetCpuacctStat): Implement it.
	(virCgroupGetValueStr): Allow for multi-line files.
	* src/libvirt_private.syms (cgroup.h): Export it.

2012-03-12  Eric Blake  <eblake@redhat.com>

	qemu: support disk filenames with comma
	If there is a disk file with a comma in the name, QEmu expects a double
	comma instead of a single one (e.g., the file "virtual,disk.img" needs
	to be specified as "virtual,,disk.img" in QEmu's command line). This
	patch fixes libvirt to work with that feature. Fix RHBZ #801036.

	Based on an initial patch by Crístian Viana.

	* src/util/buf.h (virBufferEscape): Alter signature.
	* src/util/buf.c (virBufferEscape): Add parameter.
	(virBufferEscapeSexpr): Fix caller.
	* src/qemu/qemu_command.c (qemuBuildRBDString): Likewise.  Also
	escape commas in file names.
	(qemuBuildDriveStr): Escape commas in file names.
	* docs/schemas/basictypes.rng (absFilePath): Relax RNG to allow
	commas in input file names.
	* tests/qemuxml2argvdata/*-disk-drive-network-sheepdog.*: Update
	test.

2012-03-12  Daniel Veillard  <veillard@redhat.com>

	Fix a few typo in translated strings
	this was raised by our hindi localization team
	chandan kumar <chandankumar.093047@gmail.com>

2012-03-09  Martin Kletzander  <mkletzan@redhat.com>

	Removed more AMD-specific features from cpu64-rhel* models
	We found few more AMD-specific features in cpu64-rhel* models that
	made it impossible to start qemu guest on Intel host (with this
	setting) even though qemu itself starts correctly with them.
	This impacts one test, thus the fix in tests/cputestdata/.

2012-03-09  Laine Stump  <laine@laine.org>

	conf: eliminate redundant VIR_ALLOC of 1st element of network DNS hosts.
	virNetworkDNSHostsDefParseXML was calling VIR_ALLOC(def->hosts) if
	def->hosts was NULL. This is a waste of time, though, since
	VIR_REALLOC_N is called a few lines further down, prior to any use of
	def->hosts. (initializing def->nhosts to 0 is also redundant, because
	the newly allocated memory will always be cleared to all 0's anyway).

2012-03-09  Michal Privoznik  <mprivozn@redhat.com>

	qemuxml2argvtest: Pass some additional flags to graphics-spice-agentmouse
	One of the recent commits introduced support for
	spice agent-mouse. However, test for this feature
	require some tweaking: pass QEMU_CAPS_CHARDEV_SPICEVMC |
	QEMU_CAPS_NODEFCONFIG and add "-vga cirrus".

	qemuBuildCommandLine: Don't add tlsPort if none set
	If user hasn't supplied any tlsPort we default to setting it
	to zero in our internal structure. However, when building command
	line we test it against -1 which is obviously wrong.

2012-03-09  Peng Zhou  <ailvpeng25@gmail.com>

	qemu: spice agent-mouse support
	spice agent-mouse support

	Usage:
	  <graphics type='spice'>
	    <mouse mode='client'|'server'/>
	  <graphics/>

2012-03-09  Osier Yang  <jyang@redhat.com>

	virsh: Use option alias for outmoded "--persistent"
	Since VIR_DOMAIN_AFFECT_{LIVE,CONFIG,CURRENT} was created,
	all new virsh commands use "--config" to represents the
	persistent changing. This patch add "--config" option
	for the old commands which still use "--persistent",
	and "--persistent" is now alias of "--config".

	tools/virsh.c: (use "--config", and "--persistent" is
	    alias of "--config" now).
	    cmdDomIfSetLink, cmdDomIfGetLink, cmdAttachDevice,
	    cmdDetachDevice, cmdUpdateDevice, cmdAttachInterface,
	    cmdDetachInterface, cmdAttachDisk, cmdDetachDisk

	toos/virsh.pod: Update docs of the changed commands, and
	    add some missed docs for "--config" (detach-interface,
	    detach-disk, and detach-device).

2012-03-09  Laine Stump  <laine@laine.org>

	remove daemon/probes.h from .gitignore
	The file daemon/probes.h used to be generated as part of a build, but
	is no longer used. However, a stale copy of it lying around could
	cause a build to fail. Removing it from .gitignore will make it more
	likely someone will notice that they have it lying around.

2012-03-09  Laine Stump  <laine@laine.org>

	util: consolidate duplicated error messages in pci.c
	This is nearly identical to an earlier patch for virnetlink.c.

	There are special stub versions of all public functions in this file
	that are compiled when the platform isn't linux. Each of these
	functions had an almost identical message, differing only in the
	function name included in the message. Since log messages already
	contain the function name, we can just define a const char* with the
	common part of the string, and use that same string for all the log
	messages.

	If nothing else, this at least makes for less strings that need
	translating...

2012-03-09  Laine Stump  <laine@laine.org>

	qemu: eliminate memory leak in qemuDomainUpdateDeviceConfig
	This function was freeing a virDomainNetDef with
	VIR_FREE(). virDomainNetDef is a complex structure with many pointers
	to other dynamically allocated data; to properly free it
	virDomainNetDefFree() must be called instead, otherwise several
	strings (and potentially other things) will be leaked.

	qemu: support persistent hotplug of <hostdev> devices
	For some reason, although live hotplug of <hostdev> devices is
	supported, persistent hotplug is not. This patch adds the proper
	VIR_DOMAIN_DEVICE_HOSTDEV cases to the switches in
	qemuDomainAttachDeviceConfig and qemuDomainDetachDeviceConfig.

2012-03-09  Laine Stump  <laine@laine.org>

	util: standardize return from functions calling virNetlinkCommand
	There are several functions that call virNetlinkCommand, and they all
	follow a common pattern, with three exit labels: err_exit (or
	cleanup), malformed_resp, and buffer_too_small. All three of these
	labels do their own cleanup and have their own return. However, the
	malformed_resp label usually frees the same items as the
	cleanup/err_exit label, and the buffer_too_small label just doesn't
	free recvbuf (because it's known to always be NULL at the time we goto
	buffer_too_small.

	In order to simplify and standardize the code, I've made the following
	changes to all of these functions:

	1) err_exit is replaced with the more libvirt-ish "cleanup", which
	   makes sense because in all cases this code is also executed in the
	   case of success, so labelling it err_exit may be confusing.

	2) rc is initialized to -1, and set to 0 just before the cleanup
	   label. Any code that currently sets rc = -1 is made to instead goto
	   cleanup.

	3) malformed_resp and buffer_too_small just log their error and goto
	   cleanup. This gives us a single return path, and a single place to
	   free up resources.

	4) In one instance, rather then logging an error immediately, a char*
	   msg was pointed to an error string, then goto cleanup (and cleanup
	   would log an error if msg != NULL). It takes no more lines of code
	   to just log the message as we encounter it.

	This patch should have 0 functional effects.

2012-03-09  Laine Stump  <laine@laine.org>

	util: eliminate device object leaks related to virDomain*Remove*()
	There are several functions in domain_conf.c that remove a device
	object from the domain's list of that object type, but don't free the
	object or return it to the caller to free. In many cases this isn't a
	problem because the caller already had a pointer to the object and
	frees it afterward, but in several cases the removed object was just
	left floating around with no references to it.

	In particular, the function qemuDomainDetachDeviceConfig() calls
	functions to locate and remove net (virDomainNetRemoveByMac), disk
	(virDomainDiskRemoveByName()), and lease (virDomainLeaseRemove())
	devices, but neither it nor its caller qemuDomainModifyDeviceConfig()
	ever obtain a pointer to the device being removed, much less free it.

	This patch modifies the following "remove" functions to return a
	pointer to the device object being removed from the domain device
	arrays, to give the caller the option of freeing the device object
	using that pointer if needed. In places where the object was
	previously leaked, it is now freed:

	  virDomainDiskRemove
	  virDomainDiskRemoveByName
	  virDomainNetRemove
	  virDomainNetRemoveByMac
	  virDomainHostdevRemove
	  virDomainLeaseRemove
	  virDomainLeaseRemoveAt

	The functions that had been leaking:

	  libxlDomainDetachConfig - leaked a virDomainDiskDef
	  qemuDomainDetachDeviceConfig - could leak a virDomainDiskDef,
	                            a virDomainNetDef, or a
	                            virDomainLeaseDef
	  qemuDomainDetachLease   - leaked a virDomainLeaseDef

2012-03-09  Laine Stump  <laine@laine.org>

	qemu: don't 'remove' hostdev objects from domain if operation fails
	There were certain paths through the hostdev detach code that could
	lead to the lower level function failing (and not removing the object
	from the domain's hostdevs list), but the higher level function
	free'ing the hostdev object anyway. This would leave a stale
	hostdevdef pointer in the list, which would surely cause a problem
	eventually.

	This patch relocates virDomainHostdevRemove from the lower level
	functions qemuDomainDetachThisHostDevice and
	qemuDomainDetachHostPciDevice, to their caller
	qemuDomainDetachThisHostDevice, placing it just before the call to
	virDomainHostdevDefFree. This makes it easy to verify that either both
	operations are done, or neither.

	NB: The "dangling pointer" part of this problem was introduced in
	commit 13d5a6, so it is not present in libvirt versions prior to
	0.9.9. Earlier versions would return failure in certain cases even
	though the the device object was removed/deleted, but the removal and
	deletion operations would always both happen or neither.

2012-03-09  Laine Stump  <laine@laine.org>

	util: make virDomainLeaseDefFree global
	It will be used in a different file in an upcoming patch.

2012-03-09  Laine Stump  <laine@laine.org>

	util: consolidate duplicated error messages in virnetlink.c
	There are special stub versions of all public functions in this file
	that are compiled when either libnl isn't available or the platform
	isn't linux. Each of these functions had two almost identical message,
	differing only in the function name included in the message. Since log
	messages already contain the function name, we can just define a const
	char* with the common part of the string, and use that same string for
	all the log messages.

	Also, rather than doing #if defined ... #else ... #endif *inside the
	error log macro invocation*, this patch does #if defined ... just
	once, using it to decide which single string to define. This turns the
	error log in each function from 6 lines, to 1 line.

2012-03-09  Laine Stump  <laine@laine.org>

	util: log error on OOM in virNetDevOpenvswitchAddPort
	OOM conditions silently returned failure.

2012-03-09  Ansis Atteka  <aatteka@nicira.com>

	Attach vm-id to Open vSwitch interfaces.
	This patch will allow OpenFlow controllers to identify which interface
	belongs to a particular VM by using the Domain UUID.

	ovs-vsctl get Interface vnet0 external_ids
	{attached-mac="52:54:00:8C:55:2C", iface-id="83ce45d6-3639-096e-ab3c-21f66a05f7fa", iface-status=active, vm-id="142a90a7-0acc-ab92-511c-586f12da8851"}

	V2 changes:
	Replaced vm-uuid with vm-id. There was a discussion in Open vSwitch
	mailinglist that we should stick with the same DB key postfixes for the
	sake of consistency (e.g iface-id, vm-id ...).

2012-03-09  Laine Stump  <laine@laine.org>

	util: whitespace change to virNetDevOpenvswitchAddPort
	The indentation on the final lines of the function was off by four
	spaces, making me wonder for a second if there was something
	missing. (There wasn't.)

	util: add stub pciConfigAddressToSysfsFile for non-linux platforms
	Absence of this stub function caused a build failure on mingw32.

2012-03-08  Eric Blake  <eblake@redhat.com>

	rpc: generalize solution for VPATH builds
	Commit 5d4b0c4c80 tried to fix certain classes of VPATH builds,
	but was too limited.  In particular, Guannan Ren reported:

	>    For example: The libvirt source code resides in /home/testuser,
	>                 I make dist in /tmp/buildvpath, the XDR routine .c file will
	>                 include full path of the header file like:
	>
	>                 #include "/home/testuser/src/rpc/virnetprotocol.h"
	>                 #include "internal.h"
	>                 #include <arpa/inet.h>
	>
	>    If we distribute the tarball to another machine to compile,
	>    it will report error as follows:
	>
	>    rpc/virnetprotocol.c:7:59: fatal error:
	>    /home/testuser/src/rpc/virnetprotocol.h: No such file or directory

	* src/rpc/genprotocol.pl: Fix more include lines.

2012-03-08  Peter Krempa  <pkrempa@redhat.com>

	xml: Clean up schemas to use shared data types instead of local
	The schema files contained duplicate data types that can be shared from
	the basictypes.rng file.

2012-03-08  Michal Privoznik  <mprivozn@redhat.com>

	util: Don't overflow on errno in virFileAccessibleAs
	If we need to virFork() to check assess() under different
	UID+GID we need to translate returned status via WEXITSTATUS().
	Otherwise, we may return values greater than 255 which is
	obviously wrong.

2012-03-08  Peter Krempa  <pkrempa@redhat.com>

	sanlock: Use STREQ_NULLABLE instead of STREQ on strings that may be null
	The function sanlock_inquire can return NULL in the state string if the
	message consists only of a header. The return value is arbitrary and
	sent by the server. We should proceed carefully while touching such
	pointers.

	sanlock: Fix condition left crippled while debugging

2012-03-08  Michal Privoznik  <mprivozn@redhat.com>

	qemu: Don't parse device twice in attach/detach
	Some members are generated during XML parse (e.g. MAC address of
	an interface); However, with current implementation, if we
	are plugging a device both to persistent and live config,
	we parse given XML twice: first time for live, second for config.
	This is wrong then as the second time we are not guaranteed
	to generate same values as we did for the first time.
	To prevent that we need to create a copy of DeviceDefPtr;
	This is done through format/parse process instead of writing
	functions for deep copy as it is easier to maintain:
	adding new field to any virDomain*DefPtr doesn't require change
	of copying function.

	qemu: Fix startupPolicy for snapshot-revert
	Currently, startupPolicy='requisite' was determining cold boot
	by migrateFrom != NULL. That means, if domain was started up
	with migrateFrom set we didn't require disk source path and allowed
	it to be dropped. However, on snapshot-revert domain wasn't migrated
	but according to documentation, requisite should drop disk source
	as well.

2012-03-08  Eric Blake  <eblake@redhat.com>

	virsh: improve memory unit parsing
	The last vestige of the inaccurate 'kilobytes' when we meant 1024 is
	now gone.  And virsh is now useful for setting memory in units other
	than KiB.

	* tools/virsh.c (cmdSetmem, cmdSetmaxmem): Use new helper routine,
	allow passing bogus arguments on to hypervisor to test driver
	sanity checking, and fix leak on parse error.
	(vshMemtuneGetSize): New helper.
	(cmdMemtune): Use it.
	* tools/virsh.pod (setmem, setmaxmem, memtune): Document this.

2012-03-08  Eric Blake  <eblake@redhat.com>

	virsh: improve storage unit parsing
	Now can now do:

	virsh vol-resize $vol 10M
	virsh blockresize $dom $vol 10M

	to get both interfaces to resize to 10MiB.  The remaining wart
	is that vol-resize defaults to bytes, but blockresize defaults
	to KiB, but we can't break existing scripts; oh well, it's no
	worse than the same wart of the underlying virDomainBlockResize.

	The API for virStorageVolResize states that capacity must always
	be positive, and that the presence of shrink and delta flags is
	what implies a negative change.

	* tools/virsh.c (vshCommandOptScaledInt): New function.
	(cmdVolResize): Don't pass negative size.
	(cmdVolSize): Rename...
	(vshVolSize): ...and use new helper routine.
	(cmdBlockResize): Use new helper routine, and support new bytes
	flag.
	* tools/virsh.pod (NOTES): Document suffixes.
	(blockresize, vol-create-as, vol-resize): Point to notes.

2012-03-08  Eric Blake  <eblake@redhat.com>

	virsh: add command aliases, and rename nodedev-detach
	Just because our public API has a typo doesn't mean that virsh
	has to keep the typo.

	* tools/virsh.c (VSH_CMD_FLAG_ALIAS): New flag.
	(nodedevCmds): Use it.
	(cmdHelp): Omit alias commands.
	(cmdNodeDeviceDettach): Rename...
	(cmdNodeDeviceDetach): ...to this.
	* tools/virsh.pod (nodedev-detach): Document it.

2012-03-08  Eric Blake  <eblake@redhat.com>

	virsh: use option aliases
	Command line interfaces should use dash, not underscore, as many
	keyboard layouts allow that to be typed with fewer shift key presses.

	Also, the US spelling of --tunneled gets more google hits than the
	UK spelling of --tunnelled.

	* tools/virsh.c (opts_migrate): Allow US variant.
	(opts_blkdeviotune): Prefer - over _.
	* tools/virsh.pod (blkdeviotune): Fix spelling.

2012-03-08  Eric Blake  <eblake@redhat.com>

	virsh: add option aliases
	In the past, we have created some virsh options with less-than-stellar
	names.  For back-compat reasons, those names must continue to parse,
	but we don't want to document them in help output.  This introduces
	a new option type, an alias, which points to a canonical option name
	later in the option list.

	I'm actually quite impressed that our code has already been factored
	to do all option parsing through common entry points, such that I
	got this added in relatively few lines of code!

	* tools/virsh.c (VSH_OT_ALIAS): New option type.
	(opts_echo): Hook up an alias, for easy testing.
	(vshCmddefOptParse, vshCmddefHelp, vshCmddefGetOption): Allow for
	aliases.
	* tools/virsh.pod (NOTES): Document promise of back-compat.
	* tests/virshtest.c (mymain): Test new feature.

2012-03-08  Eric Blake  <eblake@redhat.com>

	xml: allow scaled memory on input
	Output is still in kibibytes, but input can now be in different
	scales for ease of typing.

	* src/conf/domain_conf.c (virDomainParseMemory): New helper.
	(virDomainDefParseXML): Use it when parsing.
	* docs/schemas/domaincommon.rng: Expand XML; rename memoryKBElement
	to memoryElement and update callers.
	* docs/formatdomain.html.in (elementsMemoryAllocation): Document
	scaling.
	* tests/qemuxml2argvdata/qemuxml2argv-memtune.xml: Adjust test.
	* tests/qemuxml2xmltest.c: Likewise.
	* tests/qemuxml2xmloutdata/qemuxml2xmlout-memtune.xml: New file.

2012-03-08  Eric Blake  <eblake@redhat.com>

	xml: use better types for memory values
	Using 'unsigned long' for memory values is risky on 32-bit platforms,
	as a PAE guest can have more than 4GiB memory.  Our API is
	(unfortunately) locked at 'unsigned long' and a scale of 1024, but
	the rest of our system should consistently use 64-bit values,
	especially since the previous patch centralized overflow checking.

	* src/conf/domain_conf.h (_virDomainDef): Always use 64-bit values
	for memory.  Change hugepage_backed to a bool.
	* src/conf/domain_conf.c (virDomainDefParseXML)
	(virDomainDefCheckABIStability, virDomainDefFormatInternal): Fix
	clients.
	* src/vmx/vmx.c (virVMXFormatConfig): Likewise.
	* src/xenxs/xen_sxpr.c (xenParseSxpr, xenFormatSxpr): Likewise.
	* src/xenxs/xen_xm.c (xenXMConfigGetULongLong): New function.
	(xenXMConfigGetULong, xenXMConfigSetInt): Avoid truncation.
	(xenParseXM, xenFormatXM): Fix clients.
	* src/phyp/phyp_driver.c (phypBuildLpar): Likewise.
	* src/openvz/openvz_driver.c (openvzDomainSetMemoryInternal):
	Likewise.
	* src/vbox/vbox_tmpl.c (vboxDomainDefineXML): Likewise.
	* src/qemu/qemu_command.c (qemuBuildCommandLine): Likewise.
	* src/qemu/qemu_process.c (qemuProcessStart): Likewise.
	* src/qemu/qemu_monitor.h (qemuMonitorGetBalloonInfo): Likewise.
	* src/qemu/qemu_monitor_text.h (qemuMonitorTextGetBalloonInfo):
	Likewise.
	* src/qemu/qemu_monitor_text.c (qemuMonitorTextGetBalloonInfo):
	Likewise.
	* src/qemu/qemu_monitor_json.h (qemuMonitorJSONGetBalloonInfo):
	Likewise.
	* src/qemu/qemu_monitor_json.c (qemuMonitorJSONGetBalloonInfo):
	Likewise.
	* src/qemu/qemu_driver.c (qemudDomainGetInfo)
	(qemuDomainGetXMLDesc): Likewise.
	* src/uml/uml_conf.c (umlBuildCommandLine): Likewise.

2012-03-08  Eric Blake  <eblake@redhat.com>

	xml: use long long internally, to centralize overflow checks
	On 64-bit platforms, unsigned long and unsigned long long are
	identical, so we don't have to worry about overflow checks.
	On 32-bit platforms, anywhere we narrow unsigned long long back
	to unsigned long, we have to worry about overflow; it's easier
	to do this in one place by having most of the code use the same
	or wider types, and only doing the narrowing at the last minute.
	Therefore, the memory set commands remain unsigned long, and
	the memory get command now centralizes the overflow check into
	libvirt.c, so that drivers don't have to repeat the work.

	This also fixes a bug where xen returned the wrong value on
	failure (most APIs return -1 on failure, but getMaxMemory
	must return 0 on failure).

	* src/driver.h (virDrvDomainGetMaxMemory): Use long long.
	* src/libvirt.c (virDomainGetMaxMemory): Raise overflow.
	* src/test/test_driver.c (testGetMaxMemory): Fix driver.
	* src/rpc/gendispatch.pl (name_to_ProcName): Likewise.
	* src/xen/xen_hypervisor.c (xenHypervisorGetMaxMemory): Likewise.
	* src/xen/xen_driver.c (xenUnifiedDomainGetMaxMemory): Likewise.
	* src/xen/xend_internal.c (xenDaemonDomainGetMaxMemory):
	Likewise.
	* src/xen/xend_internal.h (xenDaemonDomainGetMaxMemory):
	Likewise.
	* src/xen/xm_internal.c (xenXMDomainGetMaxMemory): Likewise.
	* src/xen/xm_internal.h (xenXMDomainGetMaxMemory): Likewise.
	* src/xen/xs_internal.c (xenStoreDomainGetMaxMemory): Likewise.
	* src/xen/xs_internal.h (xenStoreDomainGetMaxMemory): Likewise.
	* src/xenapi/xenapi_driver.c (xenapiDomainGetMaxMemory):
	Likewise.
	* src/esx/esx_driver.c (esxDomainGetMaxMemory): Likewise.
	* src/libxl/libxl_driver.c (libxlDomainGetMaxMemory): Likewise.
	* src/qemu/qemu_driver.c (qemudDomainGetMaxMemory): Likewise.
	* src/lxc/lxc_driver.c (lxcDomainGetMaxMemory): Likewise.
	* src/uml/uml_driver.c (umlDomainGetMaxMemory): Likewise.

2012-03-08  Eric Blake  <eblake@redhat.com>

	xml: drop unenforced minimum memory limit from RNG
	The test domain allows <memory>0</memory>, but the RNG was stating
	that memory had to be at least 4096000 bytes.  Hypervisors should
	enforce their own limits, rather than complicating the RNG.

	Meanwhile, some copy and paste had introduced some fishy constructs
	in various unit tests.

	* docs/schemas/domaincommon.rng (memoryKB, memoryKBElement): Drop
	limit that isn't enforced in code.
	* src/conf/domain_conf.c (virDomainDefParseXML): Require current
	<= maximum.
	* tests/qemuxml2argvdata/*.xml: Fix offenders.

2012-03-08  Eric Blake  <eblake@redhat.com>

	storage: support more scaling suffixes
	Disk manufacturers are fond of quoting sizes in powers of 10,
	rather than powers of 2 (after all, 2.1 GB sounds larger than
	2.0 GiB, even though the exact opposite is true).  So, we might
	as well follow coreutils' lead in supporting three types of
	suffix: single letter ${u} (which we already had) and ${u}iB
	for the power of 2, and ${u}B for power of 10.

	Additionally, it is impossible to create a file with more than
	2**63 bytes, since off_t is signed (if you have enough storage
	to even create one 8EiB file, I'm jealous).  This now reports
	failure up front rather than down the road when the kernel
	finally refuses an impossible size.

	* docs/schemas/basictypes.rng (unit): Add suffixes.
	* src/conf/storage_conf.c (virStorageSize): Use new function.
	* docs/formatstorage.html.in: Document it.
	* tests/storagevolxml2xmlin/vol-file-backing.xml: Test it.
	* tests/storagevolxml2xmlin/vol-file.xml: Likewise.

2012-03-08  Eric Blake  <eblake@redhat.com>

	xml: output memory unit for clarity
	Make it obvious to 'dumpxml' readers what unit we are using,
	since our default of KiB for memory (1024) differs from qemu's
	default of MiB; and differs from our use of bytes for storage.

	Tests were updated via:

	$ find tests/*data tests/*out -name '*.xml' | \
	  xargs sed -i 's/<\(memory\|currentMemory\|hard_limit\|soft_limit\|min_guarantee\|swap_hard_limit\)>/<\1 unit='"'KiB'>/"
	$ find tests/*data tests/*out -name '*.xml' | \
	  xargs sed -i 's/<\(capacity\|allocation\|available\)>/<\1 unit='"'bytes'>/"

	followed by a few fixes for the stragglers.

	Note that with this patch, the RNG for <memory> still forbids
	validation of anything except unit='KiB', since the code silently
	ignores the attribute; a later patch will expand <memory> to allow
	scaled input in the code and update the RNG to match.

	* docs/schemas/basictypes.rng (unit): Add 'bytes'.
	(scaledInteger): New define.
	* docs/schemas/storagevol.rng (sizing): Use it.
	* docs/schemas/storagepool.rng (sizing): Likewise.
	* docs/schemas/domaincommon.rng (memoryKBElement): New define; use
	for memory elements.
	* src/conf/storage_conf.c (virStoragePoolDefFormat)
	(virStorageVolDefFormat): Likewise.
	* src/conf/domain_conf.h (_virDomainDef): Document unit used
	internally.
	* src/conf/storage_conf.h (_virStoragePoolDef, _virStorageVolDef):
	Likewise.
	* tests/*data/*.xml: Update all tests.
	* tests/*out/*.xml: Likewise.
	* tests/define-dev-segfault: Likewise.
	* tests/openvzutilstest.c (testReadNetworkConf): Likewise.
	* tests/qemuargv2xmltest.c (blankProblemElements): Likewise.

2012-03-08  Eric Blake  <eblake@redhat.com>

	xml: share 'unit' in RNG
	The code supported unit='E' for "exabyte", but the RNG did not;
	conversely, the RNG supported "z" and "y" but the code did not
	(I'm jealous if you have that much storage, particularly since
	it won't fit in 64-bit off_t).  Also, the code supported
	<allocation unit='...'>, but not the RNG.

	In an effort to make 'unit' more worthwhile in future patches,
	it's easier to share it between files.

	In making this factorization, note that absFilePath is more
	permissive than 'path', so storage pools and storage volumes
	will now validate with a wider set of file names than before.
	I don't think this should be a problem in practice.

	* docs/schemas/storagepool.rng: Include basic types, rather than
	repeating things here.
	* docs/schemas/storagevol.rng: Likewise.
	* docs/schemas/basictypes.rng: Add 'unsignedLong', 'unit', and fix
	to match storage code.

2012-03-08  Eric Blake  <eblake@redhat.com>

	util: new function for scaling numbers
	Scaling an integer based on a suffix is something we plan on reusing
	in several contexts: XML parsing, virsh CLI parsing, and possibly
	elsewhere.  Make it easy to reuse, as well as adding in support for
	powers of 1000.

	* src/util/util.h (virScaleInteger): New function.
	* src/util/util.c (virScaleInteger): Implement it.
	* src/libvirt_private.syms (util.h): Export it.

2012-03-08  Eric Blake  <eblake@redhat.com>

	api: add overflow error
	Overflow can be user-induced, so it deserves more than being called
	an internal error.  Note that in general, 32-bit platforms have
	far more places to trigger this error (anywhere the public API
	used 'unsigned long' but the other side of the connection is a
	64-bit server); but some are possible on 64-bit platforms (where
	the public API computes the product of two numbers).

	* include/libvirt/virterror.h (VIR_ERR_OVERFLOW): New error.
	* src/util/virterror.c (virErrorMsg): Translate it.
	* src/libvirt.c (virDomainSetVcpusFlags, virDomainGetVcpuPinInfo)
	(virDomainGetVcpus, virDomainGetCPUStats): Use it.
	* daemon/remote.c (HYPER_TO_TYPE): Likewise.
	* src/qemu/qemu_driver.c (qemuDomainBlockResize): Likewise.

2012-03-08  Eric Blake  <eblake@redhat.com>

	docs: use correct terminology for 1024 bytes
	Yes, I like kilobytes better than kibibytes (when I say kilobytes,
	I generally mean 1024).  But since the term is ambiguous, it can't
	hurt to say what we mean, by using both the correct name and
	calling out the numeric equivalent.

	* src/libvirt.c (virDomainGetMaxMemory, virDomainSetMaxMemory)
	(virDomainSetMemory, virDomainSetMemoryFlags)
	(virNodeGetFreeMemory): Tweak wording.
	* docs/formatdomain.html.in: Likewise.
	* docs/formatstorage.html.in: Likewise.

2012-03-08  Laine Stump  <laine@laine.org>

	util: fix build mingw (and all non-linux) build failure
	ATTRIBUTE_UNUSED was accidentally forgotten on one arg of a stub
	function for functionality that's not present on non-linux
	platforms. This causes a non-linux build with
	--enable-compile-warnings=error to fail.

2012-03-07  Eric Blake  <eblake@redhat.com>

	rpc: allow truncated return for virDomainGetCPUStats
	The RPC code assumed that the array returned by the driver would be
	fully populated; that is, ncpus on entry resulted in ncpus * return
	value on exit.  However, while we don't support holes in the middle
	of ncpus, we do want to permit the case of ncpus on entry being
	longer than the array returned by the driver (that is, it should be
	safe for the caller to pass ncpus=128 on entry, and the driver will
	stop populating the array when it hits max_id).

	Additionally, a successful return implies that the caller will then
	use virTypedParamArrayClear on the entire array; for this to not
	free uninitialized memory, the driver must ensure that all skipped
	entries are explicitly zeroed (the RPC driver did this, but not
	the qemu driver).

	There are now three cases:
	server 0.9.10 and client 0.9.10 or newer: No impact - there were no
	hypervisor drivers that supported cpu stats

	server 0.9.11 or newer and client 0.9.10: if the client calls with
	ncpus beyond the max, then the rpc call will fail on the client side
	and disconnect the client, but the server is no worse for the wear

	server 0.9.11 or newer and client 0.9.11: the server can return a
	truncated array and the client will do just fine

	I reproduced the problem by using a host with 2 CPUs, and doing:
	virsh cpu-stats $dom --start 1 --count 2

	* daemon/remote.c (remoteDispatchDomainGetCPUStats): Allow driver
	to omit tail of array.
	* src/remote/remote_driver.c (remoteDomainGetCPUStats):
	Accommodate driver that omits tail of array.
	* src/libvirt.c (virDomainGetCPUStats): Document this.
	* src/qemu/qemu_driver.c (qemuDomainGetPercpuStats): Clear all
	unpopulated entries.

2012-03-07  Laine Stump  <laine@laine.org>

	conf: fix error log with "address address"
	Addresses https://bugzilla.redhat.com/show_bug.cgi?id=800762

2012-03-07  Daniel P. Berrange  <berrange@redhat.com>

	Ensure max_id is initialized in linuxParseCPUmap()

2012-03-07  KAMEZAWA Hiroyuki  <kamezawa.hiroyu@jp.fujitsu.com>

	cpu-stats command shows cpu statistics information of a domain.
	CPU0:
		cpu_time   88.231593093 seconds
	CPU1:
		cpu_time   123.613341883 seconds
	Total:
		cpu_time   211.844934976 seconds

2012-03-07  KAMEZAWA Hiroyuki  <kamezawa.hiroyu@jp.fujitsu.com>

	qemu driver for virDomainGetCPUstats using cpuacct cgroup.
	* For now, only "cpu_time" is supported.
	* cpuacct cgroup is used for providing percpu cputime information.

	* src/qemu/qemu.conf     - take care of cpuacct cgroup.
	* src/qemu/qemu_conf.c   - take care of cpuacct cgroup.
	* src/qemu/qemu_driver.c - added an interface
	* src/util/cgroup.c/h    - added interface for getting percpu cputime

2012-03-07  KAMEZAWA Hiroyuki  <kamezawa.hiroyu@jp.fujitsu.com>

	add nodeGetCPUmap() for getting available CPU IDs in a cpumap.

2012-03-07  Osier Yang  <jyang@redhat.com>

	docs: Fix typo
	It used "&lt" for ">", reported by Kyla Zhang <weizhan@redhat.com>

2012-03-07  Duncan Rance  <libvirt@dunquino.com>

	Build error on OSX in src/util/virnetlink.c
	I'm building on OSX with no libnl. I had to do this to get src/util/virnetlink.c to compile:

2012-03-06  Roopa Prabhu  <roprabhu@cisco.com>

	qemu: install port profile and mac address on netdev hostdevs
	These changes are applied only if the hostdev has a parent net device
	(i.e. if it was defined as "<interface type='hostdev'>" rather than
	just "<hostdev>").  If the parent netdevice has virtual port
	information, the original virtualport associate functions are called
	(these set and restore both mac and port profile on an
	interface). Otherwise, only mac address is set on the device.

	Note that This is only supported for SR-IOV Virtual Functions (not for
	standard PCI or USB netdevs), and virtualport association is only
	supported for 802.1Qbh. For all other types of cards and types of
	virtualport, a "Config Unsupported" error is returned and the
	operation fails.

2012-03-06  Roopa Prabhu  <roprabhu@cisco.com>

	util: Changes to support portprofiles for hostdevs
	This patch includes the following changes to virnetdevmacvlan.c and
	virnetdevvportprofile.c:

	 - removes some netlink functions which are now available in
	   virnetdev.c

	 - Adds a vf argument to all port profile functions.

	For 802.1Qbh devices, the port profile calls can use a vf argument if
	passed by the caller. If the vf argument is -1 it will try to derive the vf
	if the device passed is a virtual function.

	For 802.1Qbg devices, This patch introduces a null check for the device
	argument because during port profile assignment on a hostdev, this argument
	can be null.

2012-03-06  Roopa Prabhu  <roprabhu@cisco.com>

	util: support functions for mac/portprofile associations on hostdev
	This patch adds the following:

	- functions to set and get vf configs
	- Functions to replace and store vf configs (Only mac address is handled today.
	  But the functions can be easily extended for vlans and other vf configs)
	- function to dump link dev info (This is moved from virnetdevvportprofile.c)

2012-03-06  Roopa Prabhu  <roprabhu@cisco.com>

	util: two new pci util functions
	pciDeviceGetVirtualFunctionInfo returns pf netdevice name and virtual
	function index for a given vf. This is just a wrapper around existing functions
	to return vf's pf and vf_index with one api call

	pciConfigAddressToSysfsfile returns the sysfile pci device link
	from a 'struct pci_config_address'

2012-03-06  Laine Stump  <laine@laine.org>

	qemu: support type=hostdev network device live hotplug attach/detach
	qemuDomainAttachNetDevice

	  - re-ordered some things at start of function because
	    networkAllocateActualDevice should always be run and a slot
	    in def->nets always allocated, but host_net_add isn't needed
	    if the actual type is hostdev.

	  - if actual type is hostdev, defer to
	    qemuDomainAttachHostDevice (which will reach up to the NetDef
	    for things like MAC address when necessary). After return
	    from qemuDomainAttachHostDevice, slip directly to cleanup,
	    since the rest of the function is specific to emulated net
	    devices.

	  - put assignment of new NetDef into expanded def->nets down
	    below cleanup: (but only on success) since it is also needed
	    for emulated and hostdev net devices.

	qemuDomainDetachHostDevice

	  - after locating the exact device to detach, check if it's a
	    network device and, if so, use toplevel
	    qemuDomainDetachNetDevice instead so that the def->nets list
	    is properly updated, and 'actual device' properly returned to
	    network pool if appropriate. Otherwise, for normal hostdevs,
	    call the lower level qemuDomainDetachThisDevice.

	qemuDomainDetachNetDevice

	  - This is where it gets a bit tricky. After locating the device
	    on the def->nets list, if the network device type == hostdev,
	    call the *lower level* qemuDomainDetachThisDevice (which will
	    reach back up to the parent net device for MAC address /
	    virtualport when appropriate, then clear the device out of
	    def->hostdevs) before skipping past all the emulated
	    net-device-specific code to cleanup:, where the network
	    device is removed from def->nets, and the network device
	    object is freed.

	In short, any time a hostdev-type network device is detached, we must
	go through the toplevel virDomaineDetachNetDevice function first and
	last, to make sure 1) the def->nnets list is properly managed, and 2)
	any device allocated with networkAllocateActualDevice is properly
	freed. At the same time, in the middle we need to go through the
	lower-level vidDomainDetach*This*HostDevice to be sure that 1) the
	def->hostdevs list is properly managed, 2) the PCI device is properly
	detached from the guest and reattached to the host (if appropriate),
	and 3) any higher level teardown is called at the appropriate time, by
	reaching back up to the NetDef config (part (3) will be covered in a
	separate patch).

2012-03-06  Laine Stump  <laine@laine.org>

	qemu: use virDomainNetRemove instead of inline code
	The code being replaced is exactly identical to the newly global
	function, right down to the comment.

	conf: change virDomainNetRemove from static to global
	This exact code is duplicated in qemuDomainDetachNetDevice().

2012-03-06  Laine Stump  <laine@laine.org>

	qemu: support type='hostdev' network devices at domain start
	This patch makes sure that each network device ("interface") of
	type='hostdev' appears on both the hostdevs list and the nets list of
	the virDomainDef, and it modifies the qemu driver startup code so that
	these devices will be presented to qemu on the commandline as hostdevs
	rather than as network devices.

	It does not add support for hotplug of these type of devices, or code
	to honor the <mac address> or <virtualport> given in the config (both
	of those will be done in separate patches).

	Once each device is placed on both lists, much of what this patch does
	is modify places in the code that traverse all the device lists so
	that these hybrid devices are only acted on once - either along with
	the other hostdevs, or along with the other network interfaces. (In
	many cases, only one of the lists is traversed / a specific operation
	is performed on only one type of device. In those instances, the code
	can remain unchanged.)

	There is one special case - when building the commandline, interfaces
	are allowed to proceed all the way through
	networkAllocateActualDevice() before deciding to skip the rest of
	netdev-specific processing - this is so that (once we have support for
	networks with pools of hostdev devices) we can get the actual device
	allocated, then rely on the loop processing all hostdevs to generate
	the correct commandline.

	(NB: <interface type='hostdev'> is only supported for PCI network
	devices that are SR-IOV Virtual Functions (VF). Standard PCI[e] and
	USB devices, and even the Physical Functions (PF) of SR-IOV devices
	can only be assigned to a guest using the more basic <hostdev> device
	entry. This limitation is mostly due to the fact that non-SR-IOV
	ethernet devices tend to lose mac address configuration whenever the
	card is reset, which happens when a card is assigned to a guest;
	SR-IOV VFs fortunately don't suffer the same problem.)

2012-03-06  Laine Stump  <laine@laine.org>

	conf: parse/format type='hostdev' network interfaces
	This is the new interface type that sets up an SR-IOV PCI network
	device to be assigned to the guest with PCI passthrough after
	initializing some network device-specific things from the config
	(e.g. MAC address, virtualport profile parameters). Here is an example
	of the syntax:

	  <interface type='hostdev' managed='yes'>
	    <source>
	      <address type='pci' domain='0' bus='0' slot='4' function='3'/>
	    </source>
	    <mac address='00:11:22:33:44:55'/>
	    <address type='pci' domain='0' bus='0' slot='7' function='0'/>
	  </interface>

	This would assign the PCI card from bus 0 slot 4 function 3 on the
	host, to bus 0 slot 7 function 0 on the guest, but would first set the
	MAC address of the card to 00:11:22:33:44:55.

	NB: The parser and formatter don't care if the PCI card being
	specified is a standard single function network adapter, or a virtual
	function (VF) of an SR-IOV capable network adapter, but the upcoming
	code that implements the back end of this config will work *only* with
	SR-IOV VFs. This is because modifying the mac address of a standard
	network adapter prior to assigning it to a guest is pointless - part
	of the device reset that occurs during that process will reset the MAC
	address to the value programmed into the card's firmware.

	Although it's not supported by any of libvirt's hypervisor drivers,
	usb network hostdevs are also supported in the parser and formatter
	for completeness and consistency. <source> syntax is identical to that
	for plain <hostdev> devices, except that the <address> element should
	have "type='usb'" added if bus/device are specified:

	  <interface type='hostdev'>
	    <source>
	      <address type='usb' bus='0' device='4'/>
	    </source>
	    <mac address='00:11:22:33:44:55'/>
	  </interface>

	If the vendor/product form of usb specification is used, type='usb'
	is implied:

	  <interface type='hostdev'>
	    <source>
	      <vendor id='0x0012'/>
	      <product id='0x24dd'/>
	    </source>
	    <mac address='00:11:22:33:44:55'/>
	  </interface>

	Again, the upcoming patch to fill in the backend of this functionality
	will log an error and fail with "Unsupported Config" if you actually
	try to assign a USB network adapter to a guest using <interface
	type='hostdev'> - just use a standard <hostdev> entry in that case
	(and also for single-port PCI adapters).

2012-03-06  Laine Stump  <laine@laine.org>

	qemu: refactor hotplug detach of hostdevs
	This refactoring is necessary to support hotplug detach of
	type=hostdev network devices, but needs to be in a separate patch to
	make potential debugging of regressions more practical.

	Rather than the lowest level functions searching for a matching
	device, the search is now done in the toplevel function, and an
	intermediate-level function (qemuDomainDetachThisHostDevice()), which
	expects that the device's entry is already found, is called (this
	intermediate function will be called by qemuDomainDetachNetDevice() in
	order to support detach of type=hostdev net devices)

	This patch should result in 0 differences in functionality.

2012-03-06  Laine Stump  <laine@laine.org>

	qemu: re-order functions in qemu_hotplug.c
	Code movement only, no functional change. This is necessary to prevent
	a forward reference in an upcoming patch.

2012-03-06  Laine Stump  <laine@laine.org>

	conf: hostdev utility functions
	Three new functions useful in other files:

	virDomainHostdevInsert:

	Add a new hostdev at the end of the array. This would more sensibly be
	called virDomainHostdevAppend, but the existing functions for other
	types of devices are called Insert.

	virDomainHostdevRemove:

	Eliminates one entry from the hostdevs array, but doesn't free it;
	patterned after the code at the end of the two
	qemuDomainDetachHostXXXDevice functions (and also other pre-existing
	virDomainXXXRemove functions for other device types).

	virDomainHostdevFind:

	This function is patterned from the search loops at the top of
	qemuDomainDetachHostPciDevice and qemuDomainDetachHostUsbDevice, and
	will be used to re-factor those (and other detach-related) functions.

2012-03-06  Laine Stump  <laine@laine.org>

	conf: put subsys part of virDomainHostdevDef into its own struct
	To shorten some new code that accesses the many fields within the
	subsys struct of a hostdev, create a separate toplevel, typedefed
	virDomainHostdevSubsys struct so that we can define temporary pointers
	to the subsys part.

2012-03-06  Laine Stump  <laine@laine.org>

	conf: give each hostdevdef a parent pointer
	The parent can be any type of device. It defaults to type=none, and a
	NULL pointer. The intent is that if a hostdevdef is contained in the
	def for a higher level device (e.g. virDomainNetDef), hostdev->parent
	will point to the higher level device, and type will be set to that
	type of device. This way, during attach and detach of the device,
	parent can be checked, and appropriate callouts made to do higher
	level device initialization (e.g. setting MAC address).

	Also, although these hostdevs with parents will be added to a domain's
	hostdevs list, they will be treated slightly differently when
	traversing the list, e.g. virDomainHostdefDefFree for a hostdev that
	has a parent doesn't need to be called (and will be a NOP); it will
	simply be removed from the list (since the parent device object is in
	its own type-specific list, and will be freed from there).

2012-03-06  Laine Stump  <laine@laine.org>

	conf: HostdevDef parse/format helper functions
	In an upcoming patch, virDomainNetDef will acquire a
	virDomainHostdevDef, and the <interface> XML will take on some of the
	elements of a <hostdev>. To avoid duplicating the code for parsing and
	formatting the <source> element (which will be nearly identical in
	these two cases), this patch factors those parts out of the
	HostdevDef's parse and format functions, and puts them into separate
	helper functions that are now called by the HostdevDef
	parser/formatter, and will soon be called by the NetDef
	parser/formatter.

	One change in behavior - previously virDomainHostdevDefParseXML() had
	diverged from current common coding practice by logging an error and
	failing if it found any subelements of <hostdev> other than those it
	understood (standard libvirt practice is to ignore/discard unknown
	elements and attributes during parse). The new helper function ignores
	unknown elements, and thus so does the new
	virDomainHostdevDefParseXML.

2012-03-06  Laine Stump  <laine@laine.org>

	conf: make hostdev info a separate object
	In order to allow for a virDomainHostdevDef that uses the
	virDomainDeviceInfo of a "higher level" device (such as a
	virDomainNetDef), this patch changes the virDomainDeviceInfo in the
	HostdevDef into a virDomainDeviceInfoPtr. Rather than adding checks
	all over the code to check for a null info, we just guarantee that it
	is always valid. The new function virDomainHostdevDefAlloc() allocates
	a virDomainDeviceInfo and plugs it in, and virDomainHostdevDefFree()
	makes sure it is freed.

	There were 4 places allocating virDomainHostdevDefs, all of them
	parsers of one sort or another, and those have all had their
	VIR_ALLOC(hostdev) changed to virDomainHostdevDefAlloc(). Other than
	that, and the new functions, all the rest of the changes are just
	mechanical removals of "&" or changing "." to "->".

2012-03-06  Laine Stump  <laine@laine.org>

	conf: add device pointer to args of virDomainDeviceInfoIterate callback
	There will be cases where the iterator callback will need to know the
	type of the device whose info is being operated on, and possibly even
	need to use some of the device's config. This patch adds a
	virDomainDeviceDefPtr to the args of every callback, and fills it in
	appropriately as the devices are iterated through.

2012-03-06  Laine Stump  <laine@laine.org>

	qemu: rename virDomainDeviceInfoPtr variables to avoid confusion
	The virDomainDeviceInfoPtrs in qemuCollectPCIAddress and
	qemuComparePCIDevice are named "dev" and "dev1", but those functions
	will be changed (in order to match a change in the args sent to
	virDomainDeviceInfoIterate() callback args) to contain a
	virDomainDeviceDefPtr device.

	This patch renames "dev" to "info" (and "dev[n]" to "info[n]") to
	avoid later confusion.

2012-03-06  Laine Stump  <laine@laine.org>

	conf: reorder static functions in domain_conf.c
	No code change, movement only.  This is necessary to eliminate forward
	references.

2012-03-06  Laine Stump  <laine@laine.org>

	conf: relocate virDomainDeviceDef and virDomainHostdevDef
	This patch is only code movement + adding some forward definitions of
	typedefs.

	virDomainHostdevDef (not just a pointer to it, but an actual object)
	will be needed in virDomainNetDef and virDomainActualNetDef, so it
	must be relocated earlier in the file.

	Likewise, virDomainDeviceDef will be needed in virDomainHostdevDef, so
	it must be moved up even earlier. This, in turn, creates a forward
	reference problem, but fortunately only with pointers to other device
	types, so their typedefs can be moved up in the file, eliminating the
	problem.

2012-03-06  Laine Stump  <laine@laine.org>

	conf: add missing device types to virDomainDevice(Type|Def)
	Not all device types were represented in virDomainDeviceType, so some
	types of devices couldn't be represented in a virDomainDeviceDef
	(which requires a different type of pointer in the union for each
	different kind of device).

	Since serial, parallel, channel, and console devices are all
	virDomainChrDef, and the virDomainDeviceType is never used to produce
	a string from the type (and only used in the other direction
	internally to code, never to produce XML), I only added one "CHR"
	type, which is associated with "virDomainChrDefPtr chr" in the union.

2012-03-06  Jim Fehlig  <jfehlig@suse.com>

	Fix build after commit e3ba4025
	Commit e3ba4025 introduced a few build errors with HAVE_LIBNL undefined.

2012-03-06  Laine Stump  <laine@laine.org>

	util: eliminate crash in virNetDevMacVLanCreateWithVPortProfile
	Commit 723d5c (added after the release of 0.9.10) adds a
	NetlinkEventClient for each interface sent to
	virNetDevMacVLanCreateWithVPortProfile. This should only be done if
	the interface actually *has* a virtPortProfile, otherwise the event
	handler would be a NOP. The bigger problem is that part of the setup
	to create the NetlinkEventClient is to do a memcpy of virtPortProfile
	- if it's NULL, this triggers a segv.

	This patch just qualifies the code that adds the client - if
	virtPortProfile is NULL, it's skipped.

2012-03-06  Eric Blake  <eblake@redhat.com>

	blockResize: add flag for bytes
	Qemu supports sizing by bytes; we shouldn't force the user to
	round up if they really wanted an unaligned total size.

	* include/libvirt/libvirt.h.in (VIR_DOMAIN_BLOCK_RESIZE_BYTES):
	New flag.
	* src/libvirt.c (virDomainBlockResize): Document it.
	* src/qemu/qemu_monitor_json.c (qemuMonitorJSONBlockResize): Take
	size in bytes.
	* src/qemu/qemu_monitor_text.c (qemuMonitorTextBlockResize):
	Likewise.  Pass bytes, not megabytes, to monitor.
	* src/qemu/qemu_driver.c (qemuDomainBlockResize): Implement new
	flag.

2012-03-05  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Shared or readonly disks are always safe wrt migration
	No matter what cache mode is used, readonly disks are always safe wrt
	migration. Shared disks are required to be readonly or to disable
	host-side cache, which makes them safe as well.

2012-03-05  Peter Krempa  <pkrempa@redhat.com>

	libvirt-guests: Add parallel startup and shutdown of guests
	With this patch, it's possible to shut down guests in parallel. Parallel
	startup was possible before, but this functionality was not documented
	properly.

	To enable parallel startup set the START_DELAY to 0.

	Parallel shutdown has a configurable parameter PARALLEL_SHUTDOWN that
	defines the number of machines being shut down in parallel. Enabling
	this feature changes the semantics of SHUTDOWN_TIMEOUT parameter that is
	applied as a cumulative timeout to shutdown all guests on a URI.

2012-03-05  Jiri Denemark  <jdenemar@redhat.com>

	rpc: Fix client crash on connection close
	A multi-threaded client with event loop may crash if one of its threads
	closes a connection while event loop is in the middle of sending
	keep-alive message (either request or response). The right place for it
	is inside virNetClientIOEventLoop() between poll() and
	virNetClientLock(). We should only close a connection directly if no-one
	is using it and defer the closing to the last user otherwise. So far we
	only did so if the close was initiated by keep-alive timeout.

2012-03-05  Jiri Denemark  <jdenemar@redhat.com>

	build: Fix build with dtrace + apparmor
	Building virt-aa-helper with dtrace probes enabled, ldd complained about
	undefined references:

	./.libs/libvirt_util.a(libvirt_util_la-event_poll.o):(.note.stapsdt+0x24):
	undefined reference to `libvirt_event_poll_purge_timeout_semaphore'
	...

2012-03-05  Osier Yang  <jyang@redhat.com>

	Fix type and add missed comment for diskChange callback
	Comment for parameter devAlias is missed. And a typo should
	be caused by copy & paste.

	qemu: Fix indention

2012-03-05  Peter Krempa  <pkrempa@redhat.com>

	cpu: Add new flag supported by qemu to the cpu definition
	Some new cpu features were added to qemu. This patch adds some of them
	to our CPU map.

2012-03-03  Zeeshan Ali (Khattak)  <zeeshanak@gnome.org>

	Correct a check for capacity arg of storageVolumeResize()
	Lets say I got a volume with '1G' allocation and '10G' capacity. The
	available space in the parent pool is '5G'. With the current check for
	overcapacity, I can only try to resize to <= '6G'. You see the problem?

2012-03-03  Laine Stump  <laine@laine.org>

	util: combine bools in virNetDevTapCreateInBridgePort into flags
	With an additional new bool added to determine whether or not to
	discourage the use of the supplied MAC address by the bridge itself,
	virNetDevTapCreateInBridgePort had three booleans (well, 2 bools and
	an int used as a bool) in the arg list, which made it increasingly
	difficult to follow what was going on. This patch combines those three
	into a single flags arg, which not only shortens the arg list, but
	makes it more self-documenting.

2012-03-03  Ansis Atteka  <aatteka@nicira.com>

	util: centralize tap device MAC address 1st byte "0xFE" modification
	When a tap device for a domain is created and attached to a bridge,
	the first byte of the tap device MAC address is set to 0xFE, while the
	rest is set to match the MAC address that will be presented to the
	guest as its network device MAC address. Setting this high value in
	the tap's MAC address discourages the bridge from using the tap
	device's MAC address as the bridge's own MAC address (Linux bridges
	always take on the lowest numbered MAC address of all attached devices
	as their own).

	In one case within libvirt, a tap device is created and attached to
	the bridge with the intent that its MAC address be taken on by the
	bridge as its own (this is used to assure that the bridge has a fixed
	MAC address to prevent network outages created by the bridge MAC
	address "flapping" as guests are started and stopped). In this case,
	the first byte of the mac address is *not* altered to 0xFE.

	In the current code, callers to virNetDevTapCreateInBridgePort each
	make the MAC address modification themselves before calling, which
	leads to code duplication, and also prevents lower level functions
	from knowing the real MAC address being used by the guest. The problem
	here is that openvswitch bridges must be informed about this MAC
	address, or they will be unable to pass traffic to/from the guest.

	This patch centralizes the location of the MAC address "0xFE fixup"
	into virNetDevTapCreateInBridgePort(), meaning 1) callers of this
	function no longer need the extra strange bit of code, and 2)
	bitNetDevTapCreateBridgeInPort itself now is called with the guest's
	unaltered MAC address, and can pass it on, unmodified, to
	virNetDevOpenvswitchAddPort.

	There is no other behavioral change created by this patch.

2012-03-02  Peter Krempa  <pkrempa@redhat.com>

	daemon: Remove deprecated HAL from init script dependencies
	The init script for the daemon requests to start HAL although it has
	been deprecated long time ago. This patch removes the dependency.

2012-03-02  Eric Blake  <eblake@redhat.com>

	build: fix output of pid values
	Nuke the last vestiges of printing pid_t values with the wrong
	types, at least in code compiled on mingw64.  There may be other
	places, but for now they are only compiled on systems where the
	existing %d doesn't trigger gcc warnings.

	* src/rpc/virnetsocket.c (virNetSocketNew): Use %lld and casting,
	rather than assuming any particular int type for pid_t.
	* src/util/command.c (virCommandRunAsync, virPidWait)
	(virPidAbort): Likewise.
	(verify): Drop a now stale assertion.

2012-03-02  Eric Blake  <eblake@redhat.com>

	build: use correct type for pid and similar types
	No thanks to 64-bit windows, with 64-bit pid_t, we have to avoid
	constructs like 'int pid'.  Our API in libvirt-qemu cannot be
	changed without breaking ABI; but then again, libvirt-qemu can
	only be used on systems that support UNIX sockets, which rules
	out Windows (even if qemu could be compiled there) - so for all
	points on the call chain that interact with this API decision,
	we require a different variable name to make it clear that we
	audited the use for safety.

	Adding a syntax-check rule only solves half the battle; anywhere
	that uses printf on a pid_t still needs to be converted, but that
	will be a separate patch.

	* cfg.mk (sc_correct_id_types): New syntax check.
	* src/libvirt-qemu.c (virDomainQemuAttach): Document why we didn't
	use pid_t for pid, and validate for overflow.
	* include/libvirt/libvirt-qemu.h (virDomainQemuAttach): Tweak name
	for syntax check.
	* src/vmware/vmware_conf.c (vmwareExtractPid): Likewise.
	* src/driver.h (virDrvDomainQemuAttach): Likewise.
	* tools/virsh.c (cmdQemuAttach): Likewise.
	* src/remote/qemu_protocol.x (qemu_domain_attach_args): Likewise.
	* src/qemu_protocol-structs (qemu_domain_attach_args): Likewise.
	* src/util/cgroup.c (virCgroupPidCode, virCgroupKillInternal):
	Likewise.
	* src/qemu/qemu_command.c(qemuParseProcFileStrings): Likewise.
	(qemuParseCommandLinePid): Use pid_t for pid.
	* daemon/libvirtd.c (daemonForkIntoBackground): Likewise.
	* src/conf/domain_conf.h (_virDomainObj): Likewise.
	* src/probes.d (rpc_socket_new): Likewise.
	* src/qemu/qemu_command.h (qemuParseCommandLinePid): Likewise.
	* src/qemu/qemu_driver.c (qemudGetProcessInfo, qemuDomainAttach):
	Likewise.
	* src/qemu/qemu_process.c (qemuProcessAttach): Likewise.
	* src/qemu/qemu_process.h (qemuProcessAttach): Likewise.
	* src/uml/uml_driver.c (umlGetProcessInfo): Likewise.
	* src/util/virnetdev.h (virNetDevSetNamespace): Likewise.
	* src/util/virnetdev.c (virNetDevSetNamespace): Likewise.
	* tests/testutils.c (virtTestCaptureProgramOutput): Likewise.
	* src/conf/storage_conf.h (_virStoragePerms): Use mode_t, uid_t,
	and gid_t rather than int.
	* src/security/security_dac.c (virSecurityDACSetOwnership): Likewise.
	* src/conf/storage_conf.c (virStorageDefParsePerms): Avoid
	compiler warning.

2012-03-02  Eric Blake  <eblake@redhat.com>

	build: prohibit cross-inclusion
	Make it easier to detect invalid cross-directory includes, by
	adding a syntax check.  The check is designed to be extensible:
	the default case lists only the non-driver directories, and
	specific directories can list a different set (for example,
	util/ can only use itself, network/ can only use itself, util/,
	or conf/).

	* .gnulib: Update to latest, for syntax check improvment.
	* cfg.mk (sc_prohibit_cross_inclusion): New check.
	(sc_prohibit_strncmp, sc_libvirt_unmarked_diagnostics): Simplify.

2012-03-02  Hu Tao  <hutao@cn.fujitsu.com>

	avoid global variable shadowed
	If "conf/domain_conf.h" included in file nodeinfo.c, gcc complains about
	a variable shadowing. fix it for potential further including of the file.

	ref: https://www.redhat.com/archives/libvir-list/2012-February/msg00955.html

2012-03-02  Laine Stump  <laine@laine.org>

	util: remove unneeded #include in virrandom.c
	Commit 7c90026 added #include "conf/domain_conf.h" to
	util/virrandom.c. Fortunately it didn't actually use anything from
	domain_conf.h, since as far as I'm aware, files in util aren't allowed
	to reference anything in conf (although the opposite is allowed). So
	this #include is unnecessary.

	I verified it still compiles with the line removed, but have placed a
	one day moratorium on me doing any "trivial rule" pushes, so will
	wait for someone else to verify/ACK before pushing.

2012-03-01  Eric Blake  <eblake@redhat.com>

	virsh: expose partial pull
	Now virsh can call virDomainBlockRebase.

	* tools/virsh.c (cmdBlockPull): Add --base parameter.
	(blockJobImpl): Use it to expose BlockRebase API.
	* tools/virsh.pod (blockpull): Document it.

2012-03-01  Eric Blake  <eblake@redhat.com>

	qemu: pass block pull backing file to monitor
	This actually wires up the new optional parameter to block_stream:
	http://wiki.qemu.org/Features/LiveBlockMigration/ImageStreamingAPI

	The error checking is still sparse, since libvirt must not use
	qemu-img or header probing on a qcow2 file in use by qemu to
	check if the backing file name is valid; so for now, libvirt is
	relying on qemu to diagnose an incorrect backing name.  Fixing this
	will require libvirt to track the entire backing file chain at the
	time qemu is started and keeps it updated with snapshot and pull
	operations.

	* src/qemu/qemu_monitor_json.c (qemuMonitorJSONBlockJob): Add
	parameter, and update callers.
	* src/qemu/qemu_monitor_json.h (qemuMonitorJSONBlockJob): Update
	signature.
	* src/qemu/qemu_monitor.h (qemuMonitorBlockJob): Likewise.
	* src/qemu/qemu_driver.c (qemuDomainBlockJobImpl): Update caller.
	* src/qemu/qemu_monitor.c (qemuMonitorBlockJob): Likewise.

2012-03-01  Eric Blake  <eblake@redhat.com>

	qemu: require json for block jobs
	Block job commands are not part of upstream qemu until 1.1; and
	proper support of job completion and cancellation depends on being
	able to receive QMP events, which implies the JSON monitor.
	Additionally, some early versions of block job commands were
	backported to RHEL qemu, but these versions lacked asynchronous
	job cancellation and partial block pull, so there are several
	patches that will still be needed in this area of libvirt code
	to support both flavors of block job commands.

	Due to earlier patches in libvirt, we are guaranteed that all versions
	of qemu that support block job commands already require libvirt to
	use the JSON monitor.  That means that the text version of block jobs
	will not be used, and having to refactor two copies of the block job
	handlers makes no sense.  So instead, we delete the text handlers.

	* src/qemu/qemu_monitor.c (qemuMonitorBlockJob): Drop text monitor
	support.
	* src/qemu/qemu_monitor_text.h (qemuMonitorTextBlockJob): Delete.
	* src/qemu/qemu_monitor_text.c (qemuMonitorTextParseBlockJobOne)
	(qemuMonitorTextParseBlockJob, qemuMonitorTextBlockJob):
	Likewise.

2012-03-01  Laine Stump  <laine@laine.org>

	fix alphabetical order of virNetlink functions in symbol file

	util: wrap virnetlink.c to 80 columns

2012-03-01  Eric Blake  <eblake@redhat.com>

	build: update to latest gnulib
	It's been a while, and we're between releases, so now's as good
	a time as any to resync.  This also fixes a build-breaker on
	cygwin, where cygwin 1.7.11 introduced a header bug in <termios.h>.

	* .gnulib: Update to latest.
	* bootstrap: Resync.
	* cfg.mk (sc_prohibit_strncmp): Copy upstream changes to
	sc_prohibit_strcmp.

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

	Fix typo in domain XML documentation
	s/Modyfing/Modifying

2012-02-29  D. Herrendoerfer  <d.herrendoerfer@herrendoerfer.name>

	Add de-association handling to macvlan code
	Add de-association handling for 802.1qbg (vepa) via lldpad
	netlink messages. Also adds the possibility to perform an
	association request without waiting for a confirmation.

	util: Add netlink event handling to virnetlink.c
	This code adds a netlink event interface to libvirt.
	It is based upon the event_poll code and makes use of
	it. An event is generated for each netlink message sent
	to the libvirt pid.

2012-02-29  Martin Kletzander  <mkletzan@redhat.com>

	Support for cpu64-rhel* qemu cpu models
	In qemu there are 2 cpu models (cpu64-rhel5 and cpu64-rhel6) not
	supported by libvirt. This patch adds the support with the flags
	specifications from /usr/share/qemu-kvm/cpu-model/cpu-x86_64.conf
	The only difference is that AMD-specific features are removed so
	the processor type is not vendor-specific. Those features are either
	emulated or ignored by qemu if host CPU doesn't support them.

	lxc: Cleaner fix for compilation without SELinux
	Just a cleanup of commit 32f881c6c42f94da70a3782fe20a058fe3dc39cc.

2012-02-29  Peter Krempa  <pkrempa@redhat.com>

	libvirt-guests: Check if URI is reachable before launching commands
	This patch adds a check to the libvirt-guests script to check for the
	URI to be alive before attempting any calls. This avoids nasty error
	messages and allows us to fail gracefully and continue on other URIs
	configured in the script.

	libvirt-guests: Don't try to do a managed-save of transient guests
	The libvirt-guests script tried to do a managed save of transient guest
	that failed. This patch notifies which guests are transient (and not
	being saved) and saves only the persistent ones.

	libvirt-guests: Add documentation and clean up to use virsh's improved list
	This patch adds documentation to functions defined in the libvirt-guests
	init script and changes use of virsh's new commands to make the script
	easier.

2012-02-29  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Add pre-migration hook
	This hook is called during the Prepare phase on destination host and may
	be used for changing domain XML.

	hooks: Add support for capturing hook output
	Hooks may now be used as filters.

2012-02-29  Michal Privoznik  <mprivozn@redhat.com>

	storage: fix typo
	* src/storage/storage_driver.c (storageVolumeWipeInternal):
	    s/ pfitzner33/pfitzner33/.

2012-02-29  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Don't emit tls-port spice option if port is -1
	Bug introduced by commit eda0fc7a.

2012-02-29  Alex Jia  <ajia@redhat.com>

	docs: comments wiping supported algorithms
	The current scrub version doesn't support pfitzner7, pfitzner33 and schneier
	patterns on RHEL, we should comment it in virsh man page.

	* tools/virsh.pod: update wiping algorithms docs.

2012-02-29  Alex Jia  <ajia@redhat.com>

	util: fix a typo
	* src/util/event_poll.c: (virEventPollRunOnce): s/imeout/timeout/.

2012-02-29  Alex Jia  <ajia@redhat.com>

	storage: fix a typo
	* src/storage/storage_driver.c (storageVolumeWipeInternal): s/shneier/schneier.

	http://code.google.com/p/diskscrub/

2012-02-29  Daniel Veillard  <veillard@redhat.com>

	Do not include binaries in EXTRA_DIST
	commit f27f616ff899732fe90ce1f0f4abb3887cea5e17 broke "make dist"
	by adding qemumonitortest which is a generated binary to the
	EXTRA_DIST, hence breaking "make dist"

2012-02-29  Michal Privoznik  <mprivozn@redhat.com>

	docs: Fix libvirt name in qemu commandline namespace URL
	s/libirt/libvirt/g

2012-02-28  Laine Stump  <laine@laine.org>

	libxl: eliminate memory leak in libxmlDomainModifyDeviceFlags
	This call to virDomainDeviceDefParse is both unnecessary (since
	it will again be called at the top of the immediately following if(),
	and if not there, then at the top of the if following that), but it
	also creates a leak of one virDomainDeviceDef and one [whatever type
	of device the DeviceDef is pointing to; probably a virDomainDiskDef]
	in the case that the function has been called with
	VIR_DOMAIN_DEVICE_MODIFY_CONFIG (the second parse will overwrite the
	devicedef that was just created).

2012-02-28  Osier Yang  <jyang@redhat.com>

	virsh: Break long lines in virsh.pod
	No content changes, just breaking long lines.

	virsh: New command cmdChangeMedia
	One could use it to eject, insert, or update media of the CDROM
	or floppy drive. See the documentation for more details.

	virsh: Use vshFindDisk and vshPrepareDiskXML in cmdDetachDisk
	The first use of the two new helper functions.

2012-02-28  Osier Yang  <jyang@redhat.com>

	virsh: Two new helper functions for disk device changes
	vshFindDisk is to find the disk node in xml doc with given source
	path or target of disk device, and type (indicates disk type,
	normal disk or changeable disk).

	vshPrepareDiskXML is to make changes on the disk node (e.g. create
	and insert the new <source> node for inserting media of CDROM drive).

	They are marked as unused temporarily.

2012-02-28  Osier Yang  <jyang@redhat.com>

	tests: Add tests for virtio-scsi and ibmvscsi controllers

2012-02-28  Osier Yang  <jyang@redhat.com>

	qemu: Build command line for the new address format
	For any disk controller model which is not "lsilogic", the command
	line will be like:

	  -drive file=/dev/sda,if=none,id=drive-scsi0-0-3-0,format=raw \
	  -device scsi-disk,bus=scsi0.0,channel=0,scsi-id=3,lun=0,i\
	  drive=drive-scsi0-0-3-0,id=scsi0-0-3-0

	The relationship between the libvirt address attrs and the qdev
	properties are (controller model is not "lsilogic"; strings
	inside <> represent libvirt adress attrs):
	  bus=scsi<controller>.0
	  channel=<bus>
	  scsi-id=<target>
	  lun=<unit>

	* src/qemu/qemu_command.h: (New param "virDomainDefPtr def"
	  for function qemuBuildDriveDevStr; new param "virDomainDefPtr
	  vmdef" for function qemuAssignDeviceDiskAlias. Both for
	  virDomainDiskFindControllerModel's use).

	* src/qemu/qemu_command.c:
	  - New param "virDomainDefPtr def" for qemuAssignDeviceDiskAliasCustom.
	    For virDomainDiskFindControllerModel's use, if the disk bus is "scsi"
	    and the controller model is not "lsilogic", "target" is one part of
	    the alias name.
	  - According change on qemuAssignDeviceDiskAlias and qemuBuildDriveDevStr

	* src/qemu/qemu_hotplug.c:
	  - Changes to be consistent with declarations of qemuAssignDeviceDiskAlias
	    qemuBuildDriveDevStr, and qemuBuildControllerDevStr.

	* tests/qemuxml2argvdata/qemuxml2argv-pseries-vio-user-assigned.args,
	  tests/qemuxml2argvdata/qemuxml2argv-pseries-vio.args: Update the
	  generated command line.

2012-02-28  Osier Yang  <jyang@redhat.com>

	qemu: New cap flag to indicate if channel is supported by scsi-disk

2012-02-28  Osier Yang  <jyang@redhat.com>

	conf: Introduce new attribute for device address format
	* src/conf/domain_conf.h: Add new member "target" to struct
	  _virDomainDeviceDriveAddress.

	* src/conf/domain_conf.c: Parse and format "target"

	* Lots of tests (.xml) in tests/domainsnapshotxml2xmlout,
	  tests/qemuxml2argvdata, tests/qemuxml2xmloutdata, and
	  tests/vmx2xmldata/ are modified for newly introduced
	  attribute "target" for address of "drive" type.

2012-02-28  Osier Yang  <jyang@redhat.com>

	conf: Add helper function to look up disk controller model

2012-02-28  Paolo Bonzini  <pbonzini@redhat.com>

	qemu: add virtio-scsi controller model
	Adding a new model for virtio-scsi roughly follows the same scheme
	as the previous patch.

2012-02-28  Paolo Bonzini  <pbonzini@redhat.com>

	qemu: add ibmvscsi controller model
	KVM will be able to use a PCI SCSI controller even on POWER.  Let
	the user specify the vSCSI controller by other means than a default.

	After this patch, the QEMU driver will actually look at the model
	and reject anything but auto, lsilogic and ibmvscsi.

2012-02-28  Laine Stump  <laine@laine.org>

	qemu: fix cleanup of bridge during failure of qemuDomainAttachNetDevice
	In qemuDomainAttachNetDevice, the guest's tap interface has only been
	attached to the bridge if iface_connected is true. It's possible for
	an error to occur prior to that happening, and previously we would
	attempt to remove the tap interface from the bridge even if it hadn't
	been attached.

2012-02-28  Josh Durgin  <josh.durgin@dreamhost.com>

	qemu: unescape HMP commands before converting them to json
	QMP commands don't need to be escaped since converting them to json
	also escapes special characters. When a QMP command fails, however,
	libvirt falls back to HMP commands. These fallback functions
	(qemuMonitorText*) do their own escaping, and pass the result directly
	to qemuMonitorHMPCommandWithFd. If the monitor is in json mode, these
	pre-escaped commands will be escaped again when converted to json,
	which can result in the wrong arguments being sent.

	For example, a filename test\file would be sent in json as
	test\\file.

	This prevented attaching an image file with a " or \ in its name in
	qemu 1.0.50, and also broke rbd attachment (which uses backslashes to
	escape some internal arguments.)

	Reported-by: Masuko Tomoya <tomoya.masuko@gmail.com>

2012-02-27  Peter Krempa  <pkrempa@redhat.com>

	qemu: Add ability to abort existing console while creating new one
	This patch fixes console corruption, that happens if two concurrent
	sessions are opened for a single console on a domain. Result of this
	corruption was that each of the console streams recieved just a part
	of the data written to the pipe so every console rendered unusable.

	New helper function for safe console handling is used to establish the
	console stream connection. This function ensures that no other libvirt
	client is using the console (with the ability to disconnect consoles of
	libvirt clients) and that no UUCP style lockfile is placed on the PTY
	device.

	* src/qemu/qemu_domain.h
	        - add data structure to domain's private data dealing with
	          console connections
	* src/qemu/qemu_domain.c:
	        - allocate/free domain's console data structure
	* src/qemu/qemu_driver.c
	        - use the new helper function for console handling

2012-02-27  Peter Krempa  <pkrempa@redhat.com>

	util: Add helpers for safe domain console operations
	This patch adds a set of functions used in creating console streams for
	domains using PTYs and ensures mutually exclusive access to the PTYs.

	If mutually exclusive access is not used, two clients may open the same
	console, which results in corruption on both clients as both of them
	race to read data from the PTY.

	Two approaches are used to ensure this:
	1) Internal data structure holding open PTYs.
	        This is used internally and enables the user to forcibly
	        terminate another console connection eg. when somebody leaves
	        the console open on another host.

	2) UUCP style lock files:
	        This uses UUCP lock files according to the  FHS
	        ( http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLOCKLOCKFILES )
	        to check if other programs (like minicom) are not using the pty
	        device of the console.

	        This feature is disabled by default and may be enabled using
	        configure parameter
	        --with-console-lock-files=/path/to/lock/file/directory
	        or --with-console-lock-files=auto (which tries to infer the
	        location from OS used (currently only linux).

	        On usual linux systems, normal users may not write to the
	        /var/lock directory containing the locks. This poses problems
	        while in session mode. If the current user has no access to the
	        lockfile directory, check for presence of the file is still
	        done, but no lock file is created. This does NOT result in an
	        error.

2012-02-27  Peter Krempa  <pkrempa@redhat.com>

	fdstream: Add internal callback on stream close
	This patch adds another callback to a FDstream object. The original
	callback is used by the daemon stream driver to handle events.

	This callback is called if and only if the stream is about to be closed.
	This might be used to handle cleanup steps after a fdstream exits. This
	will be used later on in ensuring mutually exclusive access to consoles.

	* src/fdstream.c:
	        - emit the callback, when stream is being closed
	        - add data structures needed to handle the callback
	        - add function to register callback
	* src/fdstream.h:
	        - define function prototypes for the callback

2012-02-27  Peter Krempa  <pkrempa@redhat.com>

	fdstream: Emit stream abort callback even if poll() doesnt.
	This patch causes the fdstream driver to call the stream event callback
	if virStreamAbort() is called on a stream using this driver.

	A remote handler for a stream can only detect changes via stream events,
	so this event callback is necessary in order to enable a daemon to abort
	a stream in such a way that the client will see the change.

	* src/fdstream.c:
	        - modify close function to call stream event callback

2012-02-27  Peter Krempa  <pkrempa@redhat.com>

	virsh: add support for VIR_DOMAIN_CONSOLE_* flags
	This patch adds support for the newly introduced
	VIR_DOMAIN_CONSOLE_FORCE and VIR_DOMAIN_CONSOLE_SAFE flags. The console
	command now has an optional parameter --force that specifies that the
	user wants to forcibly interrupt an ongoing console session and create
	a new one. Flag --safe requests that the console should be opened only
	if the hypervisor driver supports safe console handling.

	The behaviour to this point was that the daemon opened two streams to
	the console, that competed for data from the pipe, and the result was
	that both of the consoles ended up scrambled.

	This patch doesn't modify operation of other commands dealing with
	console connections (start, create) as those open connections to newly
	started domains making it virtually impossible for another client to race
	for the console and steal it.

	* tools/console.c:
	        - add support for flag passthrough
	* tools/console.h:
	        - modify function prototypes to match impl.
	* tools/virsh.c:
	        - add flag --force for the console command

2012-02-27  Peter Krempa  <pkrempa@redhat.com>

	Add flags for virDomainOpenConsole
	This patch adds a set of flags to be used with the virDomainOpenConsole
	API call to specify if the user wishes to interrupt an existing console
	session or just to try open a new one.

	VIR_DOMAIN_CONSOLE_SAFE - specifies that the console connection should
	                          be opened only if the hypervisor supports
	                          mutually exclusive access to console devices

	VIR_DOMAIN_CONSOLE_FORCE - specifies that the caller wishes to interrupt
	                           existing session and force a creation of a
	                           new one.

2012-02-27  Peter Krempa  <pkrempa@redhat.com>

	pidfile: Make checking binary path in virPidFileRead optional
	This patch changes behavior of virPidFileRead to enable passing NULL as
	path to the binary the pid file should be checked against to skip this
	check. This enables using this function for reading files that have same
	semantics as pid files, but belong to unknown processes.

2012-02-27  Michal Privoznik  <mprivozn@redhat.com>

	qemu: Implement virDomainPMWakeup API
	using 'system-wakeup' monitor command. It is supported only in JSON,
	as we are enabling it if possible. Moreover, this command is available
	in qemu-1.1+ which definitely has JSON.

	virsh: Expose virDomainPMWakeup

	Introduce virDomainPMWakeup API
	This API allows a domain which previously called
	virDomainPMSuspendForDuration() to be woken up.

2012-02-25  Martin Kletzander  <mkletzan@redhat.com>

	Fixed URI parsing
	Function xmlParseURI does not remove square brackets around IPv6
	address when parsing. One of the solutions is making wrappers around
	functions working with xmlURI*. This assures that uri->server will be
	always properly assigned and it doesn't have to be changed when used
	on some new place in the code.
	For this purpose, functions virParseURI and virSaveURI were
	added. These function are wrappers around xmlParseURI and xmlSaveUri
	respectively.
	Also there is one new syntax check function to prohibit these functions
	anywhere else.

	File changes:
	 - src/util/viruri.h        -- declaration
	 - src/util/viruri.c        -- definition
	 - src/libvirt_private.syms -- symbol export
	 - src/Makefile.am          -- added source and header files
	 - cfg.mk                   -- added sc_prohibit_xmlURI
	 - all others               -- ID name and include fixes

2012-02-25  Martin Kletzander  <mkletzan@redhat.com>

	Fixed service handling in specfile
	After adding the libvirt-guests service into usual runlevels, we used
	to start the libvirt-guests service. However this is usually not a
	good practice. As mentioned on fedoraproject wiki, the installations
	can be in changeroots, in an installer context, or in other situations
	where we don't want the services autostarted.

2012-02-25  Laine Stump  <laine@laine.org>

	virsh: fix informational message in iface-bridge command
	See: https://bugzilla.redhat.com/show_bug.cgi?id=797066

	The position of the bridge name and ethernet device name were
	accidentally swapped in the message informing of success creating the
	bridge.

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

	Workaround python header file insanity
	The /usr/include/python/pyconfig.h file pollutes the global
	namespace with a huge number of HAVE_XXX and WITH_XXX
	defines. These change what we detected in our own config.h
	In particular if you try to build without DTrace, python's
	headers turn it back on with predictable fail.

	THe hack to workaround this is to rename WITH_DTRACE to
	WITH_DTRACE_PROBES to avoid the namespace clash

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

	Improve error reporting when virsh console is run without a TTY
	If attempting to run

	  ssh root@somehost virsh console someguest

	You'll get an error

	  2012-02-15 13:11:47.683+0000: 4765: info : libvirt version: 0.9.10, package: 1.fc18 (Unknown, 2012-02-15-11:48:57, lettuce.camlab.fab.redhat.com)
	  2012-02-15 13:11:47.683+0000: 4765: error : vshRunConsole:320 : unable to get tty attributes: Invalid argument
	  Connected to domain f16x86_64
	  Escape character is ^]

	There are several problems here

	 - The actual error message is bad for users
	 - We shouldn't rely on VIR_ERROR for this case
	 - The prompt makes it look like we still connected
	   because we didn't flush stdout.

	* virsh.c: Flush stdout before starting console and check
	  for a valid tty

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

	Error out when using SPICE TLS with spice_tls=0
	It's possible to disable SPICE TLS in qemu.conf. When this happens,
	libvirt ignores any SPICE TLS port or x509 directory that may have
	been set when it builds the qemu command line to use. However, it's
	not ignoring the secure channels that may have been set and adds
	tls-channel arguments to qemu command line.
	Current qemu versions don't report an error when this happens, and try to use
	TLS for the specified channels.

	Before this patch

	<domain type='kvm'>
	  <name>auto-tls-port</name>
	  <memory>65536</memory>
	  <os>
	    <type arch='x86_64' machine='pc'>hvm</type>
	  </os>
	  <devices>
	    <graphics type='spice' port='5900' tlsPort='-1' autoport='yes' listen='0' ke
	      <listen type='address' address='0'/>
	      <channel name='main' mode='secure'/>
	      <channel name='inputs' mode='secure'/>
	    </graphics>
	  </devices>
	</domain>

	generates

	-spice port=5900,addr=0,disable-ticketing,tls-channel=main,tls-channel=inputs

	and starts QEMU.

	After this patch, an error is reported if a TLS port is set in the XML
	or if secure channels are specified but TLS is disabled in qemu.conf.
	This is the behaviour the oVirt people (where I spotted this issue) said
	they would expect.

	This fixes bug #790436

2012-02-24  Jean-Baptiste Rouault  <jean-baptiste.rouault@diateam.net>

	vmx: Better Workstation vmx handling
	This patch adds support for vmx files with empty networkName
	values (which is the case for vmx generated by Workstation).
	It also adds support for vmx containing NATed network interfaces.

	Update test suite accordingly

2012-02-24  Benjamin Cama  <benoar@dolka.fr>

	virterror: Misleading error message when name is missing
	[forwarding this here from RH bug #796732]

	When creating a network (virsh net-create) with an erroneous XML
	containing an empty <name> element, the error message is misleading:

	error: Failed to create network from foo.xml
	error: missing domain name information

	It took me a bit of time to figure out that it was the *network* name
	that was missing (I generate this xml and didn't look at it, first).

	I realized that the same message is used for missing name when creating
	a domain, network, or device node.

2012-02-24  Dave Allan  <dallan@redhat.com>

	Update bug reporting page
	Remove suggestion that people file bugs against RHEL 5 and add a
	suggestion that people increase the visibility of their bugs by
	mentioning them on libvir-list.

2012-02-23  Eric Blake  <eblake@redhat.com>

	qemu: nicer error message on failed graceful destroy
	https://bugzilla.redhat.com/show_bug.cgi?id=795656 mentions
	that a graceful destroy request can time out, meaning that the
	error message is user-visible and should be more appropriate
	than just internal error.

	* src/qemu/qemu_driver.c (qemuDomainDestroyFlags): Swap error type.

2012-02-23  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Forbid migration with cache != none
	Migrating domains with disks using cache != none is unsafe unless the
	disk images are stored on coherent clustered filesystem. Thus we forbid
	migrating such domains unless VIR_MIGRATE_UNSAFE flags is used.

	Introduce virStorageFileIsClusterFS

	virsh: Add --unsafe option to migrate command

2012-02-22  Jiri Denemark  <jdenemar@redhat.com>

	Add support for unsafe migration
	This patch adds VIR_MIGRATE_UNSAFE flag for migration APIs and new
	VIR_ERR_MIGRATION_UNSAFE error code.  The error code should be returned
	whenever migrating a domain is considered unsafe (e.g., it's configured
	in a way that does not ensure data integrity once it is migrated).
	VIR_MIGRATE_UNSAFE flag may be used to force migration even though it
	would normally be considered unsafe and forbidden.

2012-02-22  Michal Privoznik  <mprivozn@redhat.com>

	configure: Define program name if not found
	AC_CHECK_PROG checks for program in given path. However, if it doesn't
	exists, [variable] is set to [value-if-not-found]. We don't want this
	to be the empty string in case of 'modprobe' and 'scrub' as we want to
	fallback to runtime detection.

	util: Fix virFileAccessibleAs return path from parent
	Despite documentation, if we do fork() parent always returns -1
	even if file is accessible. Which is wrong obviously.

2012-02-22  Peter Krempa  <pkrempa@redhat.com>

	virsh: Enhance list command to ease creation of shell scripts
	This patch adds new options to the "virsh list" command enabling
	filtering of persistent and transient domains along with the option to
	print only UUIDs or names of domains instead of printing the table.

	Option --name prints domain names (one per line) instead of the default
	table. Similarly --uuid prints domain's UUID. The option --table is
	an alias for the default behavior.

	Aditionally --persistent and/or --transient may be specified to filter
	the output of domains.

2012-02-22  Jean-Baptiste Rouault  <jean-baptiste.rouault@diateam.net>

	vmware: implement domainXMLFromNative

2012-02-22  Peter Krempa  <pkrempa@redhat.com>

	lib: Fix function documentation for virConnectListDomains
	Clarify the documentation of virConnectListDomains.

2012-02-22  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Correctly disable HTTP Expect header usage of libcurl
	Adding "Expect:" to the header list stops libcurl from sending a
	Expect header at all.

	Before, a dummy Expect header was added that might confuse HTTP
	proxies and result in HTTP error code 417 being reported.

2012-02-21  Peter Krempa  <pkrempa@redhat.com>

	virsh: Fix docs for list command
	Commit fad5cd210899dfde4afe36712754dc921c3f3051 introduced option to
	display domain's title in the list command output. There was a mistake
	in the virsh man page example for this command stating --note instead of
	--title.

2012-02-21  Cole Robinson  <crobinso@redhat.com>

	caps: Improve error if passed an unknown arch
	Previously we would have:

	"os type 'hvm' & arch 'idontexist' combination is not supported"

	Now we get

	"No guest options available for arch 'idontexist'"

	or if options available but guest OS type not applicable:

	"No os type 'xen' available for arch 'x86_64'"

2012-02-21  Peter Robinson  <pbrobinson@gmail.com>

	spec: use ix86 macros
	* libvirt.spec.in: Use %{ix86} rather than open-coded list.

2012-02-20  Lincoln Myers  <lincoln_myers@yahoo.com>

	Fix compilation on MacOS X
	* src/util/virfile.h: the virFileWrapperFdFlags being defined as
	  a globa variable instead of a type ended up generating a duplicate
	  symbol error.
	* AUTHORS: added Lincoln Myers

2012-02-17  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	nwfilter: improved logging during driver initialization
	Improve the logging during driver initialization when testing the command
	line tools.

2012-02-16  Alex Jia  <ajia@redhat.com>

	qemu: Prevent crash of libvirtd without guest agent
	* src/qemu/qemu_process.c (qemuFindAgentConfig): avoid crash libvirtd due to
	deref a NULL pointer.

	* How to reproduce?
	1. virsh edit the following xml into guest configuration:
	    <channel type='pty'>
	      <target type='virtio'/>
	    </channel>
	2. virsh start <domain>

	or
	% virt-install -n foo -r 1024 --disk path=/var/lib/libvirt/images/foo.img,size=1 \
	--channel pty,target_type=virtio -l <installation tree>

2012-02-16  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Unlock monitor when connecting to dest qemu fails
	When migrating a qemu domain, we enter the monitor, send some commands,
	try to connect to destination qemu, send other commands, end exit the
	monitor. However, if we couldn't connect to destination qemu we forgot
	to exit the monitor.

	Bug introduced by commit d9d518b1c8ef3b65658cc91f85ba33a63c0959a4.

2012-02-16  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Fix segfault when host CPU is empty
	In case libvirtd cannot detect host CPU model (which may happen if it
	runs inside a virtual machine), the daemon is likely to segfault when
	starting a new qemu domain. It segfaults when domain XML asks for host
	(either model or passthrough) CPU or does not ask for any specific CPU
	model at all.

2012-02-16  Michal Privoznik  <mprivozn@redhat.com>

	storage: Allow runtime detection of scrub
	Currently, if scrub (used for wiping algorithms) is not present
	at compile time, we don't support any other wiping algorithms than
	zeroing, even if it was installed later. Switch to runtime detection
	instead.

2012-02-16  Jim Fehlig  <jfehlig@suse.com>

	Fix polkit0 authentication
	Commit 7033c5f2 introduced some bugs in polkit0 authentication.

	Fix libvirtd segfault in remoteDispatchAuthPolkit().

	Fix polkit authentication bypass when caller UID = 0.

2012-02-16  Jim Fehlig  <jfehlig@suse.com>

	Fix build with polkit0
	Commit 8dd623b9 introduced a build error with --enable-compile-warnings=error

	  remote.c:2593: error: unused variable 'rv' [-Wunused-variable]

	Pushing under build-breaker rule.

2012-02-16  Alex Jia  <ajia@redhat.com>

	python: Expose virDomain{G,S}etInterfaceParameters APIs in python binding
	The v4 patch corrects indentation issues.

	The v3 patch follows latest python binding codes and change 'size'
	type from int to Py_ssize_t.

	An simple example to show how to use it:

	#!/usr/bin/env python

	import libvirt

	conn = libvirt.open(None)
	dom = conn.lookupByName('foo')

	print dom.interfaceParameters('vnet0', 0)

	params = {'outbound.peak': 10,
	          'inbound.peak': 10,
	          'inbound.burst': 20,
	          'inbound.average': 20,
	          'outbound.average': 30,
	          'outbound.burst': 30}

	print dom.setInterfaceParameters('vnet0', params, 0)
	print dom.interfaceParameters('vnet0', 0)

2012-02-16  Eric Blake  <eblake@redhat.com>

	snapshot: fix snapshot deletion use-after-free
	Bug introduced in commit 35abced.  On an inactive domain,
	$ virsh snapshot-create-as dom snap
	$ virsh snapshot-create dom
	$ virsh snapshot-create dom
	$ virsh snapshot-delete --children dom snap
	could crash libvirtd, due to a use-after-free that results
	when the callback freed the current element in the iteration.

	* src/conf/domain_conf.c (virDomainSnapshotForEachChild)
	(virDomainSnapshotActOnDescendant): Allow iteration to delete
	current child.

2012-02-16  Eric Blake  <eblake@redhat.com>

	daemon: fix logic bug with virAsprintf
	Regression introduced in commit 7033c5f2, due to improper conversion
	from snprintf to virAsprintf.

	* daemon/remote.c (remoteDispatchAuthList): Check return value
	correctly.

2012-02-16  Eric Blake  <eblake@redhat.com>

	daemon: plug memory leak
	Leak introduced in commit bb2eddc6.

	* daemon/remote.c (remoteDispatchAuthPolkit): Also free pkout on
	success.

2012-02-16  Ansis Atteka  <aatteka@nicira.com>

	network: support Open vSwitch
	This patch allows libvirt to add interfaces to already
	existing Open vSwitch bridges. The following syntax in
	domain XML file can be used:

	    <interface type='bridge'>
	      <mac address='52:54:00:d0:3f:f2'/>
	      <source bridge='ovsbr'/>
	      <virtualport type='openvswitch'>
	        <parameters interfaceid='921a80cd-e6de-5a2e-db9c-ab27f15a6e1d'/>
	      </virtualport>
	      <address type='pci' domain='0x0000' bus='0x00'
	                          slot='0x03' function='0x0'/>
	    </interface>

	or if libvirt should auto-generate the interfaceid use
	following syntax:

	    <interface type='bridge'>
	      <mac address='52:54:00:d0:3f:f2'/>
	      <source bridge='ovsbr'/>
	      <virtualport type='openvswitch'>
	      </virtualport>
	      <address type='pci' domain='0x0000' bus='0x00'
	                          slot='0x03' function='0x0'/>
	    </interface>

	It is also possible to pass an optional profileid. To do that
	use following syntax:

	   <interface type='bridge'>
	     <source bridge='ovsbr'/>
	     <mac address='00:55:1a:65:a2:8d'/>
	     <virtualport type='openvswitch'>
	       <parameters interfaceid='921a80cd-e6de-5a2e-db9c-ab27f15a6e1d'
	                   profileid='test-profile'/>
	     </virtualport>
	   </interface>

	To create Open vSwitch bridge install Open vSwitch and
	run the following command:

	    ovs-vsctl add-br ovsbr

2012-02-16  Laine Stump  <laine@laine.org>

	conf: rename virDomainNetGetActualDirectVirtPortProfile
	An upcoming patch will add a <virtualport> element to interfaces of
	type='bridge', so it makes sense to give this function a more generic
	name.

2012-02-16  Laine Stump  <laine@laine.org>

	qemu: increase the timeout before sending SIGKILL to qemu process
	The current default method of terminating the qemu process is to send
	a SIGTERM, wait for up to 1.6 seconds for it to cleanly shutdown, then
	send a SIGKILL and wait for up to 1.4 seconds more for the process to
	terminate. This is problematic because occasionally 1.6 seconds is not
	long enough for the qemu process to flush its disk buffers, so the
	guest's disk ends up in an inconsistent state.

	Since this only occasionally happens when the timeout prior to SIGKILL
	is 1.6 seconds, this patch increases that timeout to 10 seconds. At
	the very least, this should reduce the occurrence from "occasionally"
	to "extremely rarely". (Once SIGKILL is sent, it waits another 5
	seconds for the process to die before returning).

	Note that in the cases where it takes less than this for qemu to
	shutdown cleanly, libvirt will *not* wait for any longer than it would
	without this patch - qemuProcessKill polls the process and returns as
	soon as it is gone.

2012-02-16  Laine Stump  <laine@laine.org>

	qemu: drop driver lock while trying to terminate qemu process
	This patch is based on an earlier patch by Eric Blake which was never
	committed:

	https://www.redhat.com/archives/libvir-list/2011-November/msg00243.html

	Aside from rebasing, this patch only drops the driver lock once (prior
	to the first time the function sleeps), then leaves it dropped until
	it returns (Eric's patch would drop and re-acquire the lock around
	each call to sleep).

	At the time Eric sent his patch, the response (from Dan Berrange) was
	that, while it wasn't a good thing to be holding the driver lock while
	sleeping, we really need to rethink locking wrt the driver object,
	switching to a finer-grained approach that locks individual items
	within the driver object separately to allow for greater concurrency.

	This is a good plan, and at the time it made sense to not apply the
	patch because there was no known bug related to the driver lock being
	held in this function.

	However, we now know that the length of the wait in qemuProcessKill is
	sometimes too short to allow the qemu process to fully flush its disk
	cache before SIGKILL is sent, so we need to lengthen the timeout (in
	order to improve the situation with management applications until they
	can be updated to use the new VIR_DOMAIN_DESTROY_GRACEFUL flag added
	in commit 72f8a7f19753506ed957b78ad800c0f3892c9304). But, if we
	lengthen the timeout, we also lengthen the amount of time that all
	other threads in libvirtd are essentially blocked from doing anything
	(since just about everything needs to acquire the driver lock, if only
	for long enough to get a pointer to a domain).

	The solution is to modify qemuProcessKill to drop the driver lock
	while sleeping, as proposed in Eric's patch. Then we can increase the
	timeout with a clear conscience, and thus at least lower the chances
	that someone running with existing management software will suffer the
	consequence's of qemu's disk cache not being flushed.

	In the meantime, we still should work on Dan's proposal to make
	locking within the driver object more fine grained.

	(NB: although I couldn't find any instance where qemuProcessKill() was
	called with no jobs active for the domain (or some other guarantee
	that the current thread had at least one refcount on the domain
	object), this patch still follows Eric's method of temporarily adding
	a ref prior to unlocking the domain object, because I couldn't
	convince myself 100% that this was the case.)

2012-02-15  Daniel P. Berrange  <berrange@redhat.com>

	Fix typos in API XML file paths
	* libvirt.pc.in: Add missing '/api/' in path
	* libvirt.spec.in, mingw32-libvirt.spec.in: s/apis/api/

2012-02-15  Michal Privoznik  <mprivozn@redhat.com>

	qemu: Implement DomainPMSuspendForDuration
	via user agent. Allow targets mem & hybrid iff system_wakeup
	monitor command is available.

	qemu: Set capabilities based on supported monitor commands
	In the future (my next patch in fact) we may want to make
	decisions depending on qemu having a monitor command or not.
	Therefore, we want to set qemuCaps flag instead of querying
	on the monitor each time we are about to make that decision.

2012-02-15  Daniel P. Berrange  <berrange@redhat.com>

	Install API XML desc to a standard location
	Language bindings may well want to use the libvirt-api.xml and
	libvirt-qemu-api.xml files to either auto-generate themselves,
	or sanity check the manually written bindings for completeness.
	Currently these XML files are not installed as standard, merely
	ending up as a %doc file in the RPM.

	This changes them to be installed into $prefix/share/libvirt/apis/
	The *-refs.xml files are not installed, since those are only
	useful during generation of the online API doc files.

	The pkg-config file is enhanced so that you can query the install
	location of the API files. eg

	  # pkg-config --variable=libvirt_qemu_api libvirt
	  /home/berrange/builder/i686-pc-mingw32/sys-root/mingw/share/libvirt/libvirt-qemu-api.xml

	* docs/Makefile.am: Install libvirt-api.xml & libvirt-qemu-api.xml
	* libvirt.pc.in: Add vars for querying API install location
	* libvirt.spec.in, mingw32-libvirt.spec.in: Include API XML files

2012-02-14  Eric Blake  <eblake@redhat.com>

	qemu: make block io tuning smarter
	When blkdeviotune was first committed in 0.9.8, we had the limitation
	that setting one value reset all others.  But bytes and iops should
	be relatively independent.  Furthermore, setting tuning values on
	a live domain followed by dumpxml did not output the new settings.

	* src/qemu/qemu_driver.c (qemuDiskPathToAlias): Add parameter, and
	update callers.
	(qemuDomainSetBlockIoTune): Don't lose previous unrelated
	settings.  Make live changes reflect to dumpxml output.
	* tools/virsh.pod (blkdeviotune): Update documentation.

2012-02-13  Daniel Veillard  <veillard@redhat.com>

	Release of libvirt-0.9.10
	* configure.ac docs/news.html.in libvirt.spec.in: updated for the release
	* po/*.po*: update ja, it and uk localization, fixed the ja one

2012-02-13  Michal Privoznik  <mprivozn@redhat.com>

	virsh: Fix name of domain suspend command
	It's dompmsuspend, not suspend-duration.

	virpidfile: Allow whitespace character at the end of pidfile
	Some programs, notably dnsmasq, which are writing pidfiles on their
	own do append a whitespace character after pid, e.g. '\n'.

2012-02-13  Daniel Veillard  <veillard@redhat.com>

	Revert "qemu: add ibmvscsi controller model"
	This reverts commit 7b345b69f28eb112238b941b743c5f6d57bd4a04.

	Conflicts:

		tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-vscsi.xml

2012-02-13  Daniel Veillard  <veillard@redhat.com>

	Revert "qemu: add virtio-scsi controller model"
	This reverts commit c9abfadf3721505e8eaffbf56ef1e53202c1db3c.

	Conflicts:

		tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-virtio-scsi.xml

2012-02-11  Guannan Ren  <gren@redhat.com>

	python: make other APIs share common {get, set}PyVirTypedParameter
	        *libvirt_virDomainBlockStatsFlags
	        *libvirt_virDomainGetSchedulerParameters
	        *libvirt_virDomainGetSchedulerParametersFlags
	        *libvirt_virDomainSetSchedulerParameters
	        *libvirt_virDomainSetSchedulerParametersFlags
	        *libvirt_virDomainSetBlkioParameters
	        *libvirt_virDomainGetBlkioParameters
	        *libvirt_virDomainSetMemoryParameters
	        *libvirt_virDomainGetMemoryParameters
	        *libvirt_virDomainSetBlockIoTune
	        *libvirt_virDomainGetBlockIoTune

2012-02-11  Marc-André Lureau  <marcandre.lureau@gmail.com>

	virpidfile: replace fopen/fwrite/fscanf with more portable version
	Replace calls to fwrite() and fscanf() with more portable-friendly
	version, such as snprintf() and virStrToLong().

2012-02-10  Osier Yang  <jyang@redhat.com>

	util: Do not use PRIx64 macro
	It breaks the build on Mingw32,  because PRIx64 is coming
	from the Win32 headers, but virAsprintf uses the gnulib printf.

2012-02-10  Alex Jia  <ajia@redhat.com>

	rpc: Plug memory leaks on doRemoteOpen() failure path
	Detected by valgrind. Leaks are introduced in commit c1b2264.

	* src/remote/remote_driver.c (doRemoteOpen): free client program memory in failure path.

	* How to reproduce?
	% valgrind -v --leak-check=full virsh -c qemu:

	* Actual result

	==3969== 40 bytes in 1 blocks are definitely lost in loss record 8 of 28
	==3969==    at 0x4A04A28: calloc (vg_replace_malloc.c:467)
	    ==3969==    by 0x4C89C41: virAlloc (memory.c:101)
	    ==3969==    by 0x4D5A236: virNetClientProgramNew (virnetclientprogram.c:60)
	    ==3969==    by 0x4D47AB4: doRemoteOpen (remote_driver.c:658)
	    ==3969==    by 0x4D49FFF: remoteOpen (remote_driver.c:871)
	    ==3969==    by 0x4D13373: do_open (libvirt.c:1196)
	    ==3969==    by 0x4D14535: virConnectOpenAuth (libvirt.c:1422)
	    ==3969==    by 0x425627: main (virsh.c:18537)
	    ==3969==
	    ==3969== 40 bytes in 1 blocks are definitely lost in loss record 9 of 28
	    ==3969==    at 0x4A04A28: calloc (vg_replace_malloc.c:467)
	    ==3969==    by 0x4C89C41: virAlloc (memory.c:101)
	    ==3969==    by 0x4D5A236: virNetClientProgramNew (virnetclientprogram.c:60)
	    ==3969==    by 0x4D47AD7: doRemoteOpen (remote_driver.c:664)
	    ==3969==    by 0x4D49FFF: remoteOpen (remote_driver.c:871)
	    ==3969==    by 0x4D13373: do_open (libvirt.c:1196)
	    ==3969==    by 0x4D14535: virConnectOpenAuth (libvirt.c:1422)
	    ==3969==    by 0x425627: main (virsh.c:18537)
	    ==3969==
	    ==3969== LEAK SUMMARY:
	    ==3969==    definitely lost: 80 bytes in 2 blocks

2012-02-10  Osier Yang  <jyang@redhat.com>

	npiv: Auto-generate WWN if it's not specified
	The auto-generated WWN comply with the new addressing schema of WWN:

	<quote>
	the first nibble is either hex 5 or 6 followed by a 3-byte vendor
	identifier and 36 bits for a vendor-specified serial number.
	</quote>

	We choose hex 5 for the first nibble. And for the 3-bytes vendor ID,
	we uses the OUI according to underlying hypervisor type, (invoking
	virConnectGetType to get the virt type). e.g. If virConnectGetType
	returns "QEMU", we use Qumranet's OUI (00:1A:4A), if returns
	ESX|VMWARE, we use VMWARE's OUI (00:05:69). Currently it only
	supports qemu|xen|libxl|xenapi|hyperv|esx|vmware drivers. The last
	36 bits are auto-generated.

2012-02-10  Marcelo Cerri  <mhcerri@linux.vnet.ibm.com>

	Remove single quotes from audit records
	Some audit records generated by libvirt contain fields enclosed by single
	quotes. Since those fields are inside the msg field, which is enclosed by
	single quotes, these records generated by libvirt are not correctly parsed by
	libauparse.

2012-02-10  Lai Jiangshan  <laijs@cn.fujitsu.com>

	GetCPUStats: fix overflow test
	Bug introduced in commit c6ec021b.

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

	domain: add implicit USB controller
	Some tools, such as virt-manager, prefers having the default USB
	controller explicit in the XML document. This patch makes sure there
	is one. With this patch, it is now possible to switch from USB1 to
	USB2 from the release 0.9.1 of virt-manager.

	Fix tests to pass with this change.

2012-02-10  Guannan Ren  <gren@redhat.com>

	python: refactoring virTypedParameter conversion for NUMA tuning APIs
	          *getPyVirTypedParameter
	          *setPyVirTypedParameter
	          *virDomainSetNumaParameters
	          *virDomainGetNumaParameters

2012-02-10  Eric Blake  <eblake@redhat.com>

	docs: fix typo in python bindings
	* docs/python.html.in: Class is virConnect, not virConn.

2012-02-09  Laine Stump  <laine@laine.org>

	conf: small changes to comments in virDomainDeviceInfo
	romfile wasn't mentioned in the comment, and the fact that rombar is
	now supported for network interfaces also wasn't there.

2012-02-09  Osier Yang  <jyang@redhat.com>

	python: Correct arguments number for migrateSetMaxSpeed
	The API definition accepts "flags" argument, however, the
	implementation ignores it, though "flags" is unused currently,
	we should expose it instead of hard coding, the API
	implementation inside hypervisor driver is responsible to check
	if the passed "flags" is valid.

2012-02-09  Eric Blake  <eblake@redhat.com>

	qemu: fix persistent setting of blkiodevice weights
	virsh blkiotune dom --device-weights /dev/sda,400 --config

	wasn't working correctly.

	* src/qemu/qemu_driver.c (qemuDomainSetBlkioParameters): Use
	correct definition.

2012-02-09  Eric Blake  <eblake@redhat.com>

	qemu: make blkiodevice weights easier to read
	The merge code had too many indirections to easily analyze.

	* src/qemu/qemu_driver.c (qemuDomainMergeDeviceWeights): Pick
	better variable names.

2012-02-09  Eric Blake  <eblake@redhat.com>

	sysinfo: simplify function signature
	Now that no one is relying on the return value being a pointer to
	somewhere inside of the passed-in argument, we can simplify the
	callers to simply return success or failure.  Also wrap some long
	lines and add some const-correctness.

	* src/util/sysinfo.c (virSysinfoParseBIOS, virSysinfoParseSystem)
	(virSysinfoParseProcessor, virSysinfoParseMemory): Change return.
	(virSysinfoRead): Adjust caller.

2012-02-09  Daniel P. Berrange  <berrange@redhat.com>

	Populate /dev/std{in,out,err} symlinks in LXC containers
	Some applications expect /dev/std{in,out,err} to exist. Populate
	them during container startup as symlinks to /proc/self/fd

	Replace truncate() with ftruncate()
	Mingw32 does not have any truncate() API defined, but it does
	have ftruncate(). So replace use of the former with the latter

	Update symbols file for virFileDirectFd/virFileWrapperFd rename

2012-02-08  Peter Krempa  <pkrempa@redhat.com>

	virsh: Fix flag semantics and docs for "desc" command
	This patch fixes the domain modification impact flags for tie virsh
	desc command to match the new semantics and fix the docs to match
	actual behavior.

2012-02-08  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Fix memory leak when building -cpu argument
	Reported by Alex Jia:

	==21503== 112 (32 direct, 80 indirect) bytes in 1 blocks are
	definitely lost in loss record 37 of 40
	==21503==    at 0x4A04A28: calloc (vg_replace_malloc.c:467)
	==21503==    by 0x4A8991: virAlloc (memory.c:101)
	==21503==    by 0x505A6C: x86DataCopy (cpu_x86.c:247)
	==21503==    by 0x507B34: x86Compute (cpu_x86.c:1225)
	==21503==    by 0x43103C: qemuBuildCommandLine (qemu_command.c:3561)
	==21503==    by 0x41C9F7: testCompareXMLToArgvHelper
	(qemuxml2argvtest.c:183)
	==21503==    by 0x41E10D: virtTestRun (testutils.c:141)
	==21503==    by 0x41B942: mymain (qemuxml2argvtest.c:705)
	==21503==    by 0x41D7E7: virtTestMain (testutils.c:696)

2012-02-08  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Always use iohelper for domain save
	This is probably not strictly needed as save operation is not live but
	we may have other reasons to avoid blocking qemu's main loop.

2012-02-08  Jiri Denemark  <jdenemar@redhat.com>

	security: Driver 'none' cannot create confined guests
	In case the caller specifies that confined guests are required but the
	security driver turns out to be 'none', we should return an error since
	this driver clearly cannot meet that requirement.  As a result of this
	error, libvirtd fails to start when the host admin explicitly sets
	confined guests are required but there is no security driver available.

	Since security driver 'none' cannot create confined guests, we override
	default confined setting so that hypervisor drivers do not thing they
	should create confined guests.

2012-02-08  Jiri Denemark  <jdenemar@redhat.com>

	seclabel: Do not output relabel attribute for type 'none'
	Security label type 'none' requires relabel to be set to 'no' so there's
	no reason to output this extra attribute.  Moreover, since relabel is
	internally stored in a negative from (norelabel), the default value for
	relabel would be 'yes' in case there is no <seclabel> element in domain
	configuration.  In case VIR_DOMAIN_SECLABEL_DEFAULT turns into
	VIR_DOMAIN_SECLABEL_NONE, we would incorrectly output relabel='yes' for
	seclabel type 'none'.

	qemu: Always use iohelper for dumping domain core
	Qemu uses non-blocking I/O which doesn't play nice with regular file
	descriptors. We need to pass a pipe to qemu instead, which can easily be
	done using iohelper.

	util: Generalize virFileDirectFd
	virFileDirectFd was used for accessing files opened with O_DIRECT using
	libvirt_iohelper. We will want to use the helper for accessing files
	regardless on O_DIRECT and thus virFileDirectFd was generalized and
	renamed to virFileWrapperFd.

2012-02-08  Alex Jia  <ajia@redhat.com>

	virsh: Plug memory leak on cmdDesc

2012-02-08  Osier Yang  <jyang@redhat.com>

	virsh: Do not check the input XML at virsh layer for cmdDetachDevice
	Any device XML doesn't use the same order as libvirt generates, or
	uses decimal for attributes like "slot" of "<address>" will cause
	device detaching to fail, as virsh compares the XML simply earlier
	in strict manner before internal parsing.

	This is regression introduced by ea7182c.

2012-02-08  Eric Blake  <eblake@redhat.com>

	python: drop unused function
	Gcc warned about an unused static function.

	* python/libvirt-qemu-override.c (py_str): Delete.

2012-02-08  Prerna Saxena  <prerna@linux.vnet.ibm.com>

	On systems with dmidecode version 2.10 or older,
	 dmidecode displays processor information, followed by BIOS, system and
	 memory-DIMM details.
	 Calls to virSysinfoParseBIOS(), virSysinfoParseSystem() would update
	 the buffer pointer 'base', so the processor information would be lost
	 before virSysinfoParseProcessor() was called. Sysinfo would therefore
	 not be able to display processor details -- It only described <bios>,
	 <system> and <memory_device> details.
	 This patch attempts to insulate sysinfo from ordering of dmidecode
	 output.

	Before the fix:
	---------------
	virsh # sysinfo
	<sysinfo type='smbios'>
	  <bios>
	    ....
	  </bios>
	  <system>
	    ....
	  </system>
	  <memory_device>
	    ....
	  </memory_device>

	After the fix:
	-------------
	virsh # sysinfo
	<sysinfo type='smbios'>
	  <bios>
	    ....
	  </bios>
	  <system>
	    ....
	  </system>
	  <processor>
	    ....
	  </processor>
	  <memory_device>
	    ....
	  </memory_device>

2012-02-08  Cole Robinson  <crobinso@redhat.com>

	storage: Don't unsparsify images when cloning
	Input to the volume cloning code is a source volume and an XML
	descriptor for the new volume. It is possible for the new volume
	to have a greater size than source volume, at which point libvirt
	will just stick 0s on the end of the new image (for raw format
	anyways).

	Unfortunately a logic error messed up our tracking of the of the
	excess amount that needed to be written: end result is that sparse
	clones were made very much non-sparse, and cloning regular disk
	images could end up excessively sized (though data unaltered).

	Drop the 'remain' variable entriely here since it's redundant, and
	track actual allocation directly against the desired 'total'.

2012-02-08  Laine Stump  <laine@laine.org>

	build: don't require avahi during install
	See: https://bugzilla.redhat.com/show_bug.cgi?id=785269

	The specfile requires avahi during install if libvirt was built with
	avahi support, but there are many situations where it is undesirable
	to install avahi due to security concerns. This patch requires only
	the avahi-libs package, which is needed by libvirt to call the
	function that tries to attach to the avahi daemon, but will instead
	silently fail because the avahi-daemon is in the main avahi package,
	and that package isn't installed.

2012-02-08  Cole Robinson  <crobinso@redhat.com>

	Allow polkit auth for VNC and SSH users
	If you are sitting in front of a physical machine and logged in as
	a regular user, you can connect to the system libvirtd instance
	by providing a root password to policykit. This is how most
	virt-manager users talk to libvirt.

	However, if you are launching virt-manager over ssh -X, or over
	VNC started from say /etc/sysconfig/vncservers, our policykit policy
	rejects the user outright, providing no option to provide the root
	password. This is confusing to users and doesn't seem to serve much
	point.

	Change the policy to allow inactive (VNC) and non-local (SSH, VNC)
	to provide root credentials for accessing system libvirtd. We use
	auth_admin rather than auth_admin_keep so that credentials aren't
	cached at all, and every subsequent reconnection to libvirt requires
	auth.

	Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=625115
	Similar change to PackageKit policy:
	https://bugzilla.redhat.com/show_bug.cgi?id=528511

2012-02-07  Michal Privoznik  <mprivozn@redhat.com>

	pyhton: Don't link against libvirt_util.la
	As we already link with libvirt.la which contains libvirt_utils.la.
	Double linking causes global symbols to be presented twice and
	thus confusion. This partially reverts c700613b8d463212d142c97108b7a2352e23e559

2012-02-07  Eric Blake  <eblake@redhat.com>

	build: avoid gcc 4.7 warning about inlines
	gcc 4.7 complains:

	util/virhashcode.c:49:17: error: always_inline function might not be inlinable [-Werror=attributes]
	util/virhashcode.c:35:17: error: always_inline function might not be inlinable [-Werror=attributes]

	Normal 'inline' is a hint that the compiler may ignore; the fact
	that the function is static is good enough.  We don't care if the
	compiler decided not to inline after all.

	* src/util/virhashcode.c (getblock, fmix): Relax attribute.

2012-02-07  Dave Allan  <dallan@redhat.com>

	Clarify the purpose of domxml-from-native
	Someone mentioned to me that they interpreted this section of the KVM
	driver page as suggesting that new guests should be created by
	creating a qemu commandline and converting it to XML with
	domxml-from-native.  I don't think that's the intent of
	domxml-from-native, so I added that clarification.

2012-02-07  Philipp Hahn  <hahn@univention.de>

	xen-xm: SIGSEGV in xenXMDomainDefineXML: filename
	filename is not initialized to NULL while it's unconditionally freed in
	the error path.

2012-02-07  Philipp Hahn  <hahn@univention.de>

	xen-xm: fix data loss in domain edit
	On CentOS5:
	If "virsh edit $DOM" is used and an error happens (for example changing
	any live cycle action to a non-existing value), libvirt forgets that
	$DOM exists, since it is already removed from the internal hash tables,
	which are used for domain lookup.
	In once case (unreproducible) even the persistent configuration
	/etc/xen/$DOM was deleted.

	Instead of using the compound function xenXMConfigSaveFile() explicitly
	use xenFomatXM() and virConfWriteFile() to distinguish between a failure
	in converting the libvirt definition to the xen-xm format and a problem
	when writing the file.

2012-02-07  Eric Blake  <eblake@redhat.com>

	seclabel: make code and RNG match
	Commit b170eb99 introduced a bug: domains that had an explicit
	<seclabel type='none'/> when started would not be reparsed if
	libvirtd restarted.  It turns out that our testsuite was not
	exercising this because it never tried anything but inactive
	parsing.  Additionally, the live XML for such a domain failed
	to re-validate.  Applying just the tests/ portion of this patch
	will expose the bugs that are fixed by the other two files.

	* docs/schemas/domaincommon.rng (seclabel): Allow relabel under
	type='none'.
	* src/conf/domain_conf.c (virSecurityLabelDefParseXML): Per RNG,
	presence of <seclabel> with no type implies dynamic.  Don't
	require sub-elements for type='none'.
	* tests/qemuxml2xmltest.c (mymain): Add test.
	* tests/qemuxml2argvtest.c (mymain): Likewise.
	* tests/qemuxml2argvdata/qemuxml2argv-seclabel-none.xml: Add file.
	* tests/qemuxml2argvdata/qemuxml2argv-seclabel-none.args: Add file.
	Reported by Ansis Atteka.

2012-02-07  Peter Krempa  <pkrempa@redhat.com>

	maint: Add test output files to .gitignore
	Commit 8f00276c8a6140cec6a6d50441c802981d329c0c consolidated other
	.gitignore files to the master one, but forgot to add some test output
	files.

2012-02-06  Alex Jia  <ajia@redhat.com>

	Update myself in AUTHORS
	Move myself from 'Previous maintainers' section to 'the primary maintainers and
	people with commit access rights' section, because I have a commit rights now.

2012-02-06  Peter Krempa  <pkrempa@redhat.com>

	virsh: Fix resource leak while listing inactive domains with titles
	Commit fad5cd210899dfde4afe36712754dc921c3f3051 introduces a new flag
	that allows to show domain's title with domains. This commit introduced
	resource leak while listing inactive domains with titles.

2012-02-06  Philipp Hahn  <hahn@univention.de>

	xen_xm: Fix SIGSEGV in xenXMDomainDefineXML
	On CentOS5 with xen-3.0.3:

	 Program received signal SIGSEGV, Segmentation fault.
	 virFree (ptrptr=0x8) at util/memory.c:310
	 310         free(*(void**)ptrptr);
	 (gdb) bt
	 #0  virFree (ptrptr=0x8) at util/memory.c:310
	 #1  0x00002aaaaae167c8 in xenXMDomainDefineXML (conn=0x694e80, xml=0x6b2ce0 "P\fk") at xen/xm_internal.c:1199
	 #2  0x00002aaaaae070d7 in xenUnifiedDomainDefineXML (conn=0x8,
	     xml=0x6ac040 "<domain type='xen'>\n  <name>pv</name>\n  <uuid>20291bc0-453a-4d6c-c6ac-4e5af63b932c</uuid>\n  <memory>1048576</memory>\n  <currentMemory>1048576</currentMemory>\n  <vcpu>1</vcpu>\n  <os>\n    <type arch='x8"...) at xen/xen_driver.c:1524
	 #3  0x00002aaaaada7803 in virDomainDefineXML (conn=0x694e80,
	     xml=0x6ac040 "<domain type='xen'>\n  <name>pv</name>\n  <uuid>20291bc0-453a-4d6c-c6ac-4e5af63b932c</uuid>\n  <memory>1048576</memory>\n  <currentMemory>1048576</currentMemory>\n  <vcpu>1</vcpu>\n  <os>\n    <type arch='x8"...) at libvirt.c:7823
	 #4  0x0000000000426173 in cmdEdit (ctl=0x7fffffffb8e0, cmd=<value optimized out>) at virsh.c:14882
	 #5  0x000000000041c9ce in vshCommandRun (ctl=0x7fffffffb8e0, cmd=0x658c50) at virsh.c:17712
	 #6  0x000000000042c3b9 in main (argc=1, argv=<value optimized out>) at virsh.c:19317

2012-02-06  Jiri Denemark  <jdenemar@redhat.com>

	docs: Enhance documentation of the old-style boot configuration
	Also encourages people to use per-device boot elements for better
	control.

	qemu: Fix seamless spice migration
	Calling qemuDomainMigrateGraphicsRelocate notifies spice clients to
	connect to destination qemu so that they can seamlessly switch streams
	once migration is done. Unfortunately, current qemu is not able to
	accept any connections while incoming migration connection is open.
	Thus, we need to delay opening the migration connection to the point
	spice client is already connected to the destination qemu.

	tests: Fix build with -Werror

	apparmor: Add missing comma
	Typo introduced by c18a88ac

2012-02-06  Alex Jia  <ajia@redhat.com>

	virsh: Avoid invalid read of size errors
	Detected by valgrind. the codes are allocating 0 bytes memory to variable
	cpumap by vshCalloc function, and then the function VIR_USE_CPU will access
	it later, a invalid read error will be hit.

	* tools/virsh.c(cmdVcpuPin): fix invalid read error.

	* How to reproduce?
	% valgrind -v --read-var-info=yes virsh vcpupin <domain> 0 0

	* Actual result:

	==27271== ERROR SUMMARY: 5 errors from 2 contexts (suppressed: 8 from 6)
	==27271==
	==27271== 1 errors in context 1 of 2:
	==27271== Invalid read of size 1
	==27271==    at 0x39CF087E2E: __GI_memcpy (in /lib64/libc-2.12.so)
	==27271==    by 0x39CF114FDC: xdrmem_putbytes (in /lib64/libc-2.12.so)
	==27271==    by 0x39CF114707: xdr_opaque (in /lib64/libc-2.12.so)
	==27271==    by 0x4D56194: xdr_remote_domain_pin_vcpu_args (remote_protocol.c:1844)
	==27271==    by 0x4D6CCE1: virNetMessageEncodePayload (virnetmessage.c:341)
	==27271==    by 0x4D5A44B: virNetClientProgramCall (virnetclientprogram.c:327)
	==27271==    by 0x4D36EDB: callWithFD (remote_driver.c:4546)
	==27271==    by 0x4D36F7B: call (remote_driver.c:4567)
	==27271==    by 0x4D3B2C1: remoteDomainPinVcpu (remote_client_bodies.h:1566)
	==27271==    by 0x4D199D3: virDomainPinVcpu (libvirt.c:8585)
	==27271==    by 0x4241F4: cmdVcpuPin (virsh.c:5262)
	==27271==    by 0x4150A6: vshCommandRun (virsh.c:17712)
	==27271==  Address 0x5602b80 is 0 bytes after a block of size 0 alloc'd
	==27271==    at 0x4A04A28: calloc (vg_replace_malloc.c:467)
	==27271==    by 0x4C89BDF: virAllocN (memory.c:129)
	==27271==    by 0x423868: _vshCalloc.clone.2 (virsh.c:454)
	==27271==    by 0x423EF9: cmdVcpuPin (virsh.c:5190)
	==27271==    by 0x4150A6: vshCommandRun (virsh.c:17712)
	==27271==    by 0x426583: main (virsh.c:19289)
	==27271==
	==27271==
	==27271== 4 errors in context 2 of 2:
	==27271== Invalid read of size 1
	==27271==    at 0x424133: cmdVcpuPin (virsh.c:5245)
	==27271==    by 0x4150A6: vshCommandRun (virsh.c:17712)
	==27271==    by 0x426583: main (virsh.c:19289)
	==27271==  Address 0x5602b80 is 0 bytes after a block of size 0 alloc'd
	==27271==    at 0x4A04A28: calloc (vg_replace_malloc.c:467)
	==27271==    by 0x4C89BDF: virAllocN (memory.c:129)
	==27271==    by 0x423868: _vshCalloc.clone.2 (virsh.c:454)
	==27271==    by 0x423EF9: cmdVcpuPin (virsh.c:5190)
	==27271==    by 0x4150A6: vshCommandRun (virsh.c:17712)
	==27271==    by 0x426583: main (virsh.c:19289)

2012-02-04  Eric Blake  <eblake@redhat.com>

	maint: consolidate several .gitignore files
	Unlike .cvsignore under CVS, git allows for ignoring nested
	names.  We weren't very consistent where new tests were
	being ignored (some in .gitignore, some in tests/.gitignore),
	and I found it easier to just consolidate everything.

	* .gitignore: Subsume entries from subdirectories.
	* daemon/.gitignore: Delete.
	* docs/.gitignore: Likewise.
	* docs/devhelp/.gitignore: Likewise.
	* docs/html/.gitignore: Likewise.
	* examples/dominfo/.gitignore: Likewise.
	* examples/domsuspend/.gitignore: Likewise.
	* examples/hellolibvirt/.gitignore: Likewise.
	* examples/openauth/.gitignore: Likewise.
	* examples/domain-events/events-c/.gitignore: Likewise.
	* include/libvirt/.gitignore: Likewise.
	* src/.gitignore: Likewise.
	* src/esx/.gitignore: Likewise.
	* tests/.gitignore: Likewise.
	* tools/.gitignore: Likewise.

2012-02-04  Laine Stump  <laine@laine.org>

	qemu: eliminate "Ignoring open failure" when using root-squash NFS
	This eliminates the warning message reported in:

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

	It was caused by a failure to open an image file that is not
	accessible by root (the uid libvirtd is running as) because it's on a
	root-squash NFS share, owned by a different user, with permissions of
	660 (or maybe 600).

	The solution is to use virFileOpenAs() rather than open(). The
	codepath that generates the error is during qemuSetupDiskCGroup(), but
	the actual open() is in a lower-level generic function called from
	many places (virDomainDiskDefForeachPath), so some other pieces of the
	code were touched just to add dummy (or possibly useful) uid and gid
	arguments.

	Eliminating this warning message has the nice side effect that the
	requested operation may even succeed (which in this case isn't
	necessary, but shouldn't hurt anything either).

2012-02-04  Laine Stump  <laine@laine.org>

	util: refactor virFileOpenAs
	virFileOpenAs previously would only try opening a file as the current
	user, or as a different user, but wouldn't try both methods in a
	single call. This made it cumbersome to use as a replacement for
	open(2). Additionally, it had a lot of historical baggage that led to
	it being difficult to understand.

	This patch refactors virFileOpenAs in the following ways:

	* reorganize the code so that everything dealing with both the parent
	  and child sides of the "fork+setuid+setgid+open" method are in a
	  separate function. This makes the public function easier to understand.

	* Allow a single call to virFileOpenAs() to first attempt the open as
	  the current user, and if that fails to automatically re-try after
	  doing fork+setuid (if deemed appropriate, i.e. errno indicates it
	  would now be successful, and the file is on a networkFS). This makes
	  it possible (in many, but possibly not all, cases) to drop-in
	  virFileOpenAs() as a replacement for open(2).

	  (NB: currently qemuOpenFile() calls virFileOpenAs() twice, once
	  without forking, then again with forking. That unfortunately can't
	  be changed without at least some discussion of the ramifications,
	  because the requested file permissions are different in each case,
	  which is something that a single call to virFileOpenAs() can't deal
	  with.)

	* Add a flag so that any fchown() of the file to a different uid:gid
	  is explicitly requested when the function is called, rather than it
	  being implied by the presence of the O_CREAT flag. This just makes
	  for less subtle surprises to consumers. (Commit
	  b1643dc15c5de886fefe56ad18608d65f1325a2c added the check for O_CREAT
	  before forcing ownership. This patch just makes that restriction
	  more explicit.)

	* If either the uid or gid is specified as "-1", virFileOpenAs will
	  interpret this to mean "the current [gu]id".

	All current consumers of virFileOpenAs should retain their present
	behavior (after a few minor changes to their setup code and
	arguments).

2012-02-04  D. Herrendoerfer  <d.herrendoerfer@herrendoerfer.name>

	util: rename netlink.[ch] to virnetlink.[ch]
	Rename the src/util/netlink files to src/util/virnetlink to
	better fit the naming scheme. Also rename nlComm to virNetlinkCommand.

2012-02-04  Laine Stump  <laine@laine.org>

	virsh: add --graceful switch to destroy command
	This allows virsh to use the new VIR_DOMAIN_DESTROY_GRACEUL flag for
	virDomainDestroyFlags.

2012-02-04  Laine Stump  <laine@laine.org>

	qemu: new GRACEFUL flag for virDomainDestroy w/ QEMU support
	When libvirt's virDomainDestroy API is shutting down the qemu process,
	it first sends SIGTERM, then waits for 1.6 seconds and, if it sees the
	process still there, sends a SIGKILL.

	There have been reports that this behavior can lead to data loss
	because the guest running in qemu doesn't have time to flush its disk
	cache buffers before it's unceremoniously whacked.

	This patch maintains that default behavior, but provides a new flag
	VIR_DOMAIN_DESTROY_GRACEFUL to alter the behavior. If this flag is set
	in the call to virDomainDestroyFlags, SIGKILL will never be sent to
	the qemu process; instead, if the timeout is reached and the qemu
	process still exists, virDomainDestroy will return an error.

	Once this patch is in, the recommended method for applications to call
	virDomainDestroyFlags will be with VIR_DOMAIN_DESTROY_GRACEFUL
	included. If that fails, then the application can decide if and when
	to call virDomainDestroyFlags again without
	VIR_DOMAIN_DESTROY_GRACEFUL (to force the issue with SIGKILL).

	(Note that this does not address the issue of existing applications
	that have not yet been modified to use VIR_DOMAIN_DESTROY_GRACEFUL.
	That is a separate patch.)

2012-02-04  Philipp Hahn  <hahn@univention.de>

	virterror.c: Fix several spelling mistakes
	compat{a->i}bility
	erron{->e}ous
	nec{c->}essary.
	Either "the" or "a".

2012-02-04  Martin Kletzander  <mkletzan@redhat.com>

	Added missing memory reporting into python bindings
	Two types of memory stats were not reported by python bindings. This
	patch fixes both of them.

2012-02-04  Eric Blake  <eblake@redhat.com>

	python: use libvirt_util to avoid raw free
	This patch starts the process of elevating the python binding code
	to be on the same level as the rest of libvirt when it comes to
	requiring good coding styles.  Statically linking against the
	libvirt_util library makes it much easier to write good code,
	rather than having to open-code and reinvent things locally.

	Done by global search and replace of s/free(/VIR_FREE(/, followed
	by hand-inspection of remaining malloc and redundant memset.

	* cfg.mk (exclude_file_name_regexp--sc_prohibit_raw_allocation):
	Remove python from exemption.
	* python/Makefile.am (INCLUDES): Add gnulib and src/util.  Drop
	$(top_builddir)/$(subdir), as automake already guarantees that.
	(mylibs, myqemulibs): Pull in libvirt_util and gnulib.
	(libvirtmod_la_CFLAGS): Catch compiler warnings if configured to
	use -Werror.
	* python/typewrappers.c (libvirt_charPtrSizeWrap)
	(libvirt_charPtrWrap): Convert free to VIR_FREE.
	* python/generator.py (print_function_wrapper): Likewise.
	* python/libvirt-override.c: Likewise.

2012-02-04  Eric Blake  <eblake@redhat.com>

	build: expand rule to cover testsuite
	The bulk of this patch was done with:

	sed -i 's/\(\bfree *(/VIR_FREE(/g' tests/*.c

	followed by fixing the few compile errors that resulted.

	* cfg.mk (exclude_file_name_regexp--sc_prohibit_raw_allocation):
	Remove tests from exemption.
	* tests/testutils.h: Add common header.
	* tests/commandhelper.c: Fix offenders.
	* tests/cputest.c: Likewise.
	* tests/domainsnapshotxml2xmltest.c: Likewise.
	* tests/interfacexml2xmltest.c: Likewise.
	* tests/networkxml2argvtest.c: Likewise.
	* tests/networkxml2xmltest.c: Likewise.
	* tests/nodedevxml2xmltest.c: Likewise.
	* tests/nodeinfotest.c: Likewise.
	* tests/nwfilterxml2xmltest.c: Likewise.
	* tests/qemuargv2xmltest.c: Likewise.
	* tests/qemuxml2argvtest.c: Likewise.
	* tests/qemuxml2xmltest.c: Likewise.
	* tests/qemuxmlnstest.c: Likewise.
	* tests/qparamtest.c: Likewise.
	* tests/sexpr2xmltest.c: Likewise.
	* tests/storagepoolxml2xmltest.c: Likewise.
	* tests/storagevolxml2xmltest.c: Likewise.
	* tests/testutils.c: Likewise.
	* tests/virshtest.c: Likewise.
	* tests/xencapstest.c: Likewise.
	* tests/xmconfigtest.c: Likewise.
	* tests/xml2sexprtest.c: Likewise.

2012-02-04  Eric Blake  <eblake@redhat.com>

	build: prohibit raw malloc and free
	Our HACKING discourages use of malloc and free, for at least
	a couple of years now.  But we weren't enforcing it, until now :)

	For now, I've exempted python and tests, and will clean those up
	in subsequent patches.  Examples should be permanently exempt,
	since anyone copying our examples won't have use of our
	internal-only memory.h via libvirt_util.la.

	* cfg.mk (sc_prohibit_raw_allocation): New rule.
	(exclude_file_name_regexp--sc_prohibit_raw_allocation): and
	exemptions.
	* src/cpu/cpu.c (cpuDataFree): Avoid false positive.
	* src/conf/network_conf.c (virNetworkDNSSrvDefParseXML): Fix
	offenders.
	* src/libxl/libxl_conf.c (libxlMakeDomBuildInfo, libxlMakeVfb)
	(libxlMakeDeviceModelInfo): Likewise.
	* src/rpc/virnetmessage.c (virNetMessageSaveError): Likewise.
	* tools/virsh.c (_vshMalloc, _vshCalloc): Likewise.

2012-02-04  Eric Blake  <eblake@redhat.com>

	python: drop redundant function
	I noticed some redundant code while preparing my next patch.

	* python/generator.py (py_types): Fix 'const char *' mapping.
	* python/typewrappers.h (libvirt_charPtrConstWrap): Drop.
	* python/typewrappers.c (libvirt_charPtrConstWrap): Delete, since
	it is identical to libvirt_constcharPtrWrap.

2012-02-04  Eric Blake  <eblake@redhat.com>

	build: clean up CPPFLAGS/INCLUDES usage
	Our syntax checker missed all-lower-case variables (this will
	be fixed by the next .gnulib update).  Additionally, anywhere
	that we mix in-tree files with generated files, automake recommends
	listing builddir prior to srcdir for VPATH builds.

	* src/Makefile.am (*_la_CFLAGS): Favor $(top_srcdir).
	(INCLUDES): Likewise, and follow automake recommendations on
	builddir before srcdir.
	* python/Makefile.am (INCLUDES): Swap directory order.
	* tests/Makefile.am (INCLUDES): Likewise.
	* tools/Makefile.am (INCLUDES): Likewise.
	* daemon/Makefile.am (INCLUDES): Likewise.
	(libvirtd.init, libvirtd.service): Favor $().
	* examples/hellolibvirt/Makefile.am (hellolibvirt_LDADD):
	Likewise.
	* examples/openauth/Makefile.am (openauth_LDADD): Likewise.
	* examples/dominfo/Makefile.am (INCLUDES): Drop dead include.
	* examples/domsuspend/Makefile.am (INCLUDES): Likewise.

2012-02-04  Eric Blake  <eblake@redhat.com>

	command: allow merging stdout and stderr in string capture
	Sometimes, its easier to run children with 2>&1 in shell notation,
	and just deal with stdout and stderr interleaved.  This was already
	possible for fd handling; extend it to also work when doing string
	capture of a child process.

	* docs/internals/command.html.in: Document this.
	* src/util/command.c (virCommandSetErrorBuffer): Likewise.
	(virCommandRun, virExecWithHook): Implement it.
	* tests/commandtest.c (test14): Test it.
	* daemon/remote.c (remoteDispatchAuthPolkit): Use new command
	feature.

2012-02-04  Eric Blake  <eblake@redhat.com>

	maint: prune duplicate listings in AUTHORS
	* AUTHORS: Remove duplicates.
	* .mailmap: Update accordingly.

2012-02-04  Taku Izumi  <izumi.taku@jp.fujitsu.com>

	virsh: extension of virsh attach-disk for rawio
	This patch extends "virsh attach-disk" command so that
	we can specify "rawio" attribute.

2012-02-03  Martin Kletzander  <mkletzan@redhat.com>

	Fixed connection definition for non-SELinux builds
	This patch fixes the access of variable "con" in two files where the
	variable was declared only on SELinux builds and thus the build failed
	without SELinux. It's a rather nasty fix but helps fix the build
	quickly and without any major changes to the code.

	Added RSS reporting
	Added RSS information gathering into qemuMemoryStats into qemu driver
	and the reporting into virsh dommemstat.

	Added RSS information gathering into qemudGetProcessInfo
	One more parameter added into the function parsing /proc/<pid>/stat
	and the call of the function is fixed as well.

2012-02-03  Osier Yang  <jyang@redhat.com>

	Replace TAB with white spaces

2012-02-03  Jiri Denemark  <jdenemar@redhat.com>

	lxc: Fix build with AppArmor

2012-02-03  Alex Jia  <ajia@redhat.com>

	conf: Plug memory on virDomainDiskDefParseXML
	Detected by valgrind. Leak is introduced in commit 397e6a7.

	* src/conf/domain_conf.c(virDomainDiskDefParseXML): fix memory leak.

	How to reproduce?
	% make -C tests check TESTS=qemuxml2argvtest
	% cd tests && valgrind -v --leak-check=full ./qemuxml2argvtest

	* Actual result:

	==16352== 4 bytes in 1 blocks are definitely lost in loss record 12 of 147
	==16352==    at 0x4A05FDE: malloc (vg_replace_malloc.c:236)
	==16352==    by 0x39D90A67DD: xmlStrndup (xmlstring.c:45)
	==16352==    by 0x4E83D5: virDomainDiskDefParseXML (domain_conf.c:2894)
	==16352==    by 0x4F542D: virDomainDefParseXML (domain_conf.c:7626)
	==16352==    by 0x4F8683: virDomainDefParseNode (domain_conf.c:8390)
	==16352==    by 0x4F904E: virDomainDefParse (domain_conf.c:8340)
	==16352==    by 0x41C626: testCompareXMLToArgvHelper (qemuxml2argvtest.c:105)
	==16352==    by 0x41DED1: virtTestRun (testutils.c:142)
	==16352==    by 0x418172: mymain (qemuxml2argvtest.c:486)
	==16352==    by 0x41D5C7: virtTestMain (testutils.c:697)
	==16352==    by 0x39CF01ECDC: (below main) (in /lib64/libc-2.12.so)

2012-02-03  Daniel P. Berrange  <berrange@redhat.com>

	Set a security context on /dev and /dev/pts mounts
	To allow the container to access /dev and /dev/pts when under
	sVirt, set an explicit mount option. Also set a max size on
	the /dev mount to prevent DOS on memory usage

	* src/lxc/lxc_container.c: Set /dev mount context
	* src/lxc/lxc_controller.c: Set /dev/pts mount context

2012-02-03  Daniel P. Berrange  <berrange@redhat.com>

	Add support for sVirt in the LXC driver
	For the sake of backwards compat, LXC guests are *not*
	confined by default. This is because it is not practical
	to dynamically relabel containers using large filesystem
	trees. Applications can create confined containers though,
	by giving suitable XML configs

	* src/Makefile.am: Link libvirt_lxc to security drivers
	* src/lxc/libvirtd_lxc.aug, src/lxc/lxc_conf.h,
	  src/lxc/lxc_conf.c, src/lxc/lxc.conf,
	  src/lxc/test_libvirtd_lxc.aug: Config file handling for
	  security driver
	* src/lxc/lxc_driver.c: Wire up security driver functions
	* src/lxc/lxc_controller.c: Add a '--security' flag to
	  specify which security driver to activate
	* src/lxc/lxc_container.c, src/lxc/lxc_container.h: Set
	  the process label just before exec'ing init.

2012-02-03  Daniel P. Berrange  <berrange@redhat.com>

	Add two new security label types
	Curently security labels can be of type 'dynamic' or 'static'.
	If no security label is given, then 'dynamic' is assumed. The
	current code takes advantage of this default, and avoids even
	saving <seclabel> elements with type='dynamic' to disk. This
	means if you temporarily change security driver, the guests
	can all still start.

	With the introduction of sVirt to LXC though, there needs to be
	a new default of 'none' to allow unconfined LXC containers.

	This patch introduces two new security label types

	 - default:  the host configuration decides whether to run the
	             guest with type 'none' or 'dynamic' at guest start
	 - none:     the guest will run unconfined by security policy

	The 'none' label type will obviously be undesirable for some
	deployments, so a new qemu.conf option allows a host admin to
	mandate confined guests. It is also possible to turn off default
	confinement

	  security_default_confined = 1|0  (default == 1)
	  security_require_confined = 1|0  (default == 0)

	* src/conf/domain_conf.c, src/conf/domain_conf.h: Add new
	  seclabel types
	* src/security/security_manager.c, src/security/security_manager.h:
	  Set default sec label types
	* src/security/security_selinux.c: Handle 'none' seclabel type
	* src/qemu/qemu.conf, src/qemu/qemu_conf.c, src/qemu/qemu_conf.h,
	  src/qemu/libvirtd_qemu.aug: New security config options
	* src/qemu/qemu_driver.c: Tell security driver about default
	  config

2012-02-03  Daniel P. Berrange  <berrange@redhat.com>

	Re-add domain device seclabel parsing / formatting
	This re-introduces parsing & formatting for per device seclabels.
	There is a new virDomainDeviceSeclabelPtr struct and corresponding
	APIs for parsing/formatting.

2012-02-03  Daniel P. Berrange  <berrange@redhat.com>

	Revert changes to sec label parsing
	Revert parsing changes:

	  commit 302fe95ffa1bc5f1c61c0beb31a1adfbc38c668e
	  Author: Eric Blake <eblake@redhat.com>
	  Date:   Wed Jan 4 16:01:24 2012 -0700

	    seclabel: fix regression in libvirtd restart

	  commit b43432931aef92325920953ff92beabfbe5224c8
	  Author: Eric Blake <eblake@redhat.com>
	  Date:   Thu Dec 22 17:47:50 2011 -0700

	    seclabel: allow a seclabel override on a disk src

	These two commits changed the sec label parsing code so that
	the same code dealt with both the VM level sec label, and the
	per device label. Unfortunately, as we add more options to the
	VM level sec label, the logic required to use the same parsing
	code for the per device label becomes unintelligible.

	* src/conf/domain_conf.c: Remove support for parsing per
	  device sec labels

2012-02-03  Dave Allan  <dallan@redhat.com>

	Add detail to documentation on storage pools and volumes.
	The storage pools page contains details about the capabilities of the
	various pool types, but not an overview of how they are intended to be
	used.  This patch adds some explanation of what pools and volumes can
	be used for and why an administrator might want to use them.

2012-02-02  Alex Jia  <ajia@redhat.com>

	virsh: Plug memory leak on cmdUndefine
	Detected by valgrind. Leak is introduced in commit 3bb6bcf.

	Free 'vol' memory before allocating memory, the codes will miss one time
	free when 'vol_i = nvolumes' in for loop, so plug memory leak.

	* tools/virsh.c: fix memory leak on cmdUndefine.

	* How to reproduce?
	% dd if=/dev/null of=/var/lib/libvirt/images/foo bs=1 count=1 seek=10M
	% virsh define foo.xml                   (disk source file points to '/var/lib/libvirt/images/foo')
	% virsh vol-clone foo foo-clone default  (the original guest name is 'foo')
	% virsh pool-refresh default
	% virsh vol-list default                 (make sure 'foo-clone' volume exists)
	% virsh define foo-clone.xml             (disk source file points to '/var/lib/libvirt/images/foo-clone')
	% valgrind -v --leak-check=full virsh undefine foo-clone --remove-all-storage

	* Actual results:

	1. virsh output
	Domain foo-clone has been undefined
	Volume '/var/lib/libvirt/images/foo-clone' removed.

	error: Failed to disconnect from the hypervisor, 1 leaked reference(s)

	2. valgrind result

	==6515== 92 (40 direct, 52 indirect) bytes in 1 blocks are definitely lost in loss record 46 of 69
	==6515==    at 0x4A04A28: calloc (vg_replace_malloc.c:467)
	==6515==    by 0x4C89B71: virAlloc (memory.c:101)
	==6515==    by 0x4CFCACE: virGetStorageVol (datatypes.c:724)
	==6515==    by 0x4D4A8E0: remoteStorageVolLookupByPath (remote_driver.c:4664)
	==6515==    by 0x4D07153: virStorageVolLookupByPath (libvirt.c:12508)
	==6515==    by 0x4270E6: cmdUndefine (virsh.c:2828)
	==6515==    by 0x4151B6: vshCommandRun (virsh.c:17693)
	==6515==    by 0x4264D3: main (virsh.c:19270)
	==6515==
	==6515== LEAK SUMMARY:
	==6515==    definitely lost: 40 bytes in 1 blocks

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

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

	Update gnulib to fix mingw64 compilation errors

2012-02-02  Philipp Hahn  <hahn@univention.de>

	tests: dynamically replace dnsmasq path
	The path to the dnsmasq binary can be configured while in the test data
	the path is hard-coded to /usr/bin/. This break the test suite if a the
	binary is located in a different location, like /usr/local/sbin/.

	Replace the hard coded path in the test data by a token, which is
	dynamically replaced in networkxml2argvtest with the configured path
	after the test data has been loaded.

	(Another option would have been to modify configure.ac to generate the
	 test data during configure, but I do not know of an easy way do trick
	 configure into mass-generate those test files without listing every
	 single one, which I consider less flexible.)

	- unit-test the unit-test:
	  #include <assert.h>
	  #define TEST(in,token,rep,out) { char *buf = strdup(in); assert(!replaceTokens(&buf, token, rep) && !strcmp(buf, out)); free(buf); }
	  TEST("", "AA", "B", "");
	  TEST("A", "AA", "B", "A");
	  TEST("AA", "AA", "B", "B");
	  TEST("AAA", "AA", "B", "BA");
	  TEST("AA", "AA", "BB", "BB");
	  TEST("AA", "AA", "BBB", "BBB");
	  TEST("<AA", "AA", "B", "<B");
	  TEST("<AA", "AA", "BB", "<BB");
	  TEST("<AA", "AA", "BBB", "<BBB");
	  TEST("AA>", "AA", "B", "B>");
	  TEST("AA>", "AA", "BB", "BB>");
	  TEST("AA>", "AA", "BBB", "BBB>");
	  TEST("<AA>", "AA", "B", "<B>");
	  TEST("<AA>", "AA", "BB", "<BB>");
	  TEST("<AA>", "AA", "BBB", "<BBB>");
	  TEST("<AA|AA>", "AA", "B", "<B|B>");
	  TEST("<AA|AA>", "AA", "BB", "<BB|BB>");
	  TEST("<AA|AA>", "AA", "BBB", "<BBB|BBB>");
	  TEST("<AAAA>", "AA", "B", "<BB>");
	  TEST("<AAAA>", "AA", "BB", "<BBBB>");
	  TEST("<AAAA>", "AA", "BBB", "<BBBBBB>");
	  TEST("AAAA>", "AA", "B", "BB>");
	  TEST("AAAA>", "AA", "BB", "BBBB>");
	  TEST("AAAA>", "AA", "BBB", "BBBBBB>");
	  TEST("<AAAA", "AA", "B", "<BB");
	  TEST("<AAAA", "AA", "BB", "<BBBB");
	  TEST("<AAAA", "AA", "BBB", "<BBBBBB");
	  alarm(1); /* no infinite loop */
	  TEST("A", "A", "A", "A");
	  TEST("AA", "A", "A", "AA");
	  alarm(0);

2012-02-02  Eric Blake  <eblake@redhat.com>

	network: fix testsuite regression
	I slightly botched commit be9fb5a - I converted '--arg=value' to
	'--arg value', which has no semantic change, but did trip up the
	testsuite.

	* src/network/bridge_driver.c (networkBuildDnsmasqArgv): Restore
	expected output.

2012-02-02  Philipp Hahn  <hahn@univention.de>

	tests: virnettlscontexttest needs gnutls-2.6.0
	virnettlscontexttest uses gnutls_x509_crt_set_subject_alt_name() and
	GNUTLS_FSAN_APPEND, which - according to
	<http://www.gnu.org/software/gnutls/manual/gnutls.html> - are only
	available since 2.6.0.

	Since libvirt still works fine with gnutls-1.0.25 from RHEL5, only
	enable the test when the version of GNUTLS is at least 2.6.0.

2012-02-02  Philipp Hahn  <hahn@univention.de>

	xen_xs: name xendConfigVersion magic numbers
	libvirt supports 4 different versions of the user-land XenD daemon. When
	queried the daemon just returns its generation number, which is hard to
	match to the version of the Xen tools.

	Replace the magic generation numbers by named enum definitions to
	improve code readability.

2012-02-02  Alex Jia  <ajia@redhat.com>

	network: Avoid memory leaks on networkBuildDnsmasqArgv
	Detected by valgrind. Leaks introduced in commit 973af236.

	* src/network/bridge_driver.c: fix memory leaks on failure and successful path.

	* How to reproduce?
	% make -C tests check TESTS=networkxml2argvtest
	% cd tests && valgrind -v --leak-check=full ./networkxml2argvtest

	* Actual result:

	==2226== 3 bytes in 1 blocks are definitely lost in loss record 1 of 24
	==2226==    at 0x4A05FDE: malloc (vg_replace_malloc.c:236)
	==2226==    by 0x39CF0FEDE7: __vasprintf_chk (in /lib64/libc-2.12.so)
	==2226==    by 0x41DFF7: virVasprintf (stdio2.h:199)
	==2226==    by 0x41E0B7: virAsprintf (util.c:1695)
	==2226==    by 0x41A2D9: networkBuildDhcpDaemonCommandLine (bridge_driver.c:545)
	==2226==    by 0x4145C8: testCompareXMLToArgvHelper (networkxml2argvtest.c:47)
	==2226==    by 0x4156A1: virtTestRun (testutils.c:141)
	==2226==    by 0x414332: mymain (networkxml2argvtest.c:123)
	==2226==    by 0x414D97: virtTestMain (testutils.c:696)
	==2226==    by 0x39CF01ECDC: (below main) (in /lib64/libc-2.12.so)
	==2226==
	==2226== 3 bytes in 1 blocks are definitely lost in loss record 2 of 24
	==2226==    at 0x4A05FDE: malloc (vg_replace_malloc.c:236)
	==2226==    by 0x39CF0FEDE7: __vasprintf_chk (in /lib64/libc-2.12.so)
	==2226==    by 0x41DFF7: virVasprintf (stdio2.h:199)
	==2226==    by 0x41E0B7: virAsprintf (util.c:1695)
	==2226==    by 0x41A307: networkBuildDhcpDaemonCommandLine (bridge_driver.c:551)
	==2226==    by 0x4145C8: testCompareXMLToArgvHelper (networkxml2argvtest.c:47)
	==2226==    by 0x4156A1: virtTestRun (testutils.c:141)
	==2226==    by 0x414332: mymain (networkxml2argvtest.c:123)
	==2226==    by 0x414D97: virtTestMain (testutils.c:696)
	==2226==    by 0x39CF01ECDC: (below main) (in /lib64/libc-2.12.so)
	==2226==
	==2226== 5 bytes in 1 blocks are definitely lost in loss record 4 of 24
	==2226==    at 0x4A05FDE: malloc (vg_replace_malloc.c:236)
	==2226==    by 0x39CF0FEDE7: __vasprintf_chk (in /lib64/libc-2.12.so)
	==2226==    by 0x41DFF7: virVasprintf (stdio2.h:199)
	==2226==    by 0x41E0B7: virAsprintf (util.c:1695)
	==2226==    by 0x41A2AB: networkBuildDhcpDaemonCommandLine (bridge_driver.c:539)
	==2226==    by 0x4145C8: testCompareXMLToArgvHelper (networkxml2argvtest.c:47)
	==2226==    by 0x4156A1: virtTestRun (testutils.c:141)
	==2226==    by 0x414332: mymain (networkxml2argvtest.c:123)
	==2226==    by 0x414D97: virtTestMain (testutils.c:696)
	==2226==    by 0x39CF01ECDC: (below main) (in /lib64/libc-2.12.so)
	==2226==
	==2226== LEAK SUMMARY:
	==2226==    definitely lost: 11 bytes in 3 blocks

2012-02-02  Eric Blake  <eblake@redhat.com>

	block rebase: initial qemu implementation
	This is a trivial implementation, which works with the current
	released qemu 1.0 with backports of preliminary block pull but
	no partial rebase.  Future patches will update the monitor handling
	to support an optional parameter for partial rebase; but as qemu
	1.1 is unreleased, it can be in later patches, designed to be
	backported on top of the supported API.

	* src/qemu/qemu_driver.c (qemuDomainBlockJobImpl): Add parameter,
	and adjust callers.  Drop redundant check.
	(qemuDomainBlockPull): Move guts...
	(qemuDomainBlockRebase): ...to new function.

2012-02-02  Eric Blake  <eblake@redhat.com>

	block rebase: wire up remote protocol
	Nice and simple.

	* src/remote/remote_protocol.x (REMOTE_PROC_DOMAIN_BLOCK_REBASE):
	New RPC.
	* src/remote/remote_driver.c (remote_driver): Wire it up.
	* src/remote_protocol-structs: Regenerate.

2012-02-02  Eric Blake  <eblake@redhat.com>

	block rebase: add new API virDomainBlockRebase
	Qemu is adding the ability to do a partial rebase.  That is, given:

	base <- intermediate <- current

	virDomainBlockPull will produce:

	current

	but qemu now has the ability to leave base in the chain, to produce:

	base <- current

	Note that current qemu can only do a forward merge, and only with
	the current image as the destination, which is fully described by
	this API without flags.  But in the future, it may be possible to
	enhance this API for additional scenarios by using flags:

	Merging the current image back into a previous image (that is,
	undoing a live snapshot), could be done by passing base as the
	destination and flags with a bit requesting a backward merge.

	Merging any other part of the image chain, whether forwards (the
	backing image contents are pulled into the newer file) or backwards
	(the deltas recorded in the newer file are merged back into the
	backing file), could also be done by passing a new flag that says
	that base should be treated as an XML snippet rather than an
	absolute path name, where the XML could then supply the additional
	instructions of which part of the image chain is being merged into
	any other part.

	* include/libvirt/libvirt.h.in (virDomainBlockRebase): New
	declaration.
	* src/libvirt.c (virDomainBlockRebase): Implement it.
	* src/libvirt_public.syms (LIBVIRT_0.9.10): Export it.
	* src/driver.h (virDrvDomainBlockRebase): New driver callback.
	* src/rpc/gendispatch.pl (long_legacy): Add exemption.
	* docs/apibuild.py (long_legacy_functions): Likewise.

2012-02-02  Peter Krempa  <pkrempa@redhat.com>

	qemu: Add support for virDomainGetMetadata and virDomainSetMetadata
	This patch adds support for the new api into the qemu driver to support
	modification and retrieval of domain description and title. This patch
	does not add support for modifying the <metadata> element.

2012-02-02  Peter Krempa  <pkrempa@redhat.com>

	virsh: Add support for modifying domain description and titles
	This patch adds a new command "desc" to show and modify titles and
	description for the domains using the new API.

	This patch also adds a new flag for the "list" command to show titles in
	the domain list, to allow easy identification of VMs by storing a short
	description.

	Example:
	virsh # list --title
	 Id Name                 State      Title
	 -----------------------------------------------
	   0 Domain-0             running    Mailserver 1
	   2 fedora               paused

2012-02-02  Peter Krempa  <pkrempa@redhat.com>

	API: Add api to set and get domain metadata
	This patch adds API to modify domain metadata for running and stopped
	domains. The api supports changing description, title as well as the
	newly added <metadata> element. The API has support for storing data in
	the metadata element using xml namespaces.

	* include/libvirt/libvirt.h.in
	* src/libvirt_public.syms
	        - add function headers
	        - add enum to select metadata to operate on
	        - export functions
	* src/libvirt.c
	        - add public api implementation
	* src/driver.h
	        - add driver support
	* src/remote/remote_driver.c
	* src/remote/remote_protocol.x
	        - wire up the remote protocol
	* include/libvirt/virterror.h
	* src/util/virterror.c
	        - add a new error message note that metadata for domain are
	        missing

2012-02-02  Peter Krempa  <pkrempa@redhat.com>

	xml: Add element <title> to allow short description of domains
	This patch adds a new element <title> to the domain XML. This attribute
	can hold a short title defined by the user to ease the identification of
	domains. The title may not contain newlines and should be reasonably short.

	 *docs/formatdomain.html.in
	 *docs/schemas/domaincommon.rng
	        - add schema grammar for the new element and documentation
	  *src/conf/domain_conf.c
	  *src/conf/domain_conf.h
	        - add field to hold the new attribute
	        - add code to parse and create XML with the new attribute

2012-02-02  Laine Stump  <laine@laine.org>

	build: add missing virStorageFileResize to libvirt_private.syms
	This was forgotten when the function was originally written (not
	noticed because it wasn't used at the time). It's required for
	proper compilation with modules enabled after applying the recent
	virStorageVolResize patches.

	build: add missing virCommandAddCap to libvirt_private.syms
	This was forgotten when the function was initially written (not
	noticed because it wasn't used at the time). It's required for proper
	compilation with modules enabled after applying the recent rawio
	patches.

2012-02-01  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Silent bogus warning about unitialized variable
	GCC complaints about uninitialized use of len, which however is only
	used when errors != NULL and in that case len is always initialized.
	It's trivial to silence this by always initializing len.

2012-02-01  Michal Privoznik  <mprivozn@redhat.com>

	daemon: Allow overriding NOFILES ulimit for the daemon as well
	One of my latest patches (d8db0f9690) created support for setting
	the limit for the maximum of opened files by qemu user. However,
	since libvirtd keeps one FD opened per domain (well, for qemu at least)
	it will likely hit this limit on huge scenarios.

2012-02-01  Jiri Denemark  <jdenemar@redhat.com>

	python: Add binding for virDomainGetDiskErrors

	virsh: Implement domblkerror command
	This command lists all disk devices with errors

	qemu: Implement virDomainGetDiskErrors

	Remote protocol for virDomainGetDiskErrors

	virDomainGetDiskErrors public API
	We already provide ways to detect when a domain has been paused as a
	result of I/O error, but there was no way of getting the exact error or
	even the device that experienced it.  This new API may be used for both.

2012-02-01  Alex Jia  <ajia@redhat.com>

	python: correct a copy-paste error
	* python/libvirt-override-virStream.py: fix a copy-paste error in sendAll().

2012-02-01  Michal Privoznik  <mprivozn@redhat.com>

	command: Fix ATTRIBUTE_UNUSED on virSetCapabilities
	If we are building not on a WIN32 architecture and without HAVE_CAPNG
	virSetCapabilities has unused argument and virClearCapabilities
	is unused as well.

	qemu: Clenup qemuDomainSetInterfaceParameters
	which contained some useless lines, copied code, NULL
	dereference.

	qemu: Don't jump to endjob if no job was even started
	In qemuDomainShutdownFlags if we try to use guest agent,
	which has error or is not configured, we jump go endjob
	label even if we haven't started any job yet. This may
	lead to the daemon crash:
	1) virsh shutdown --mode agent on a domain without agent configured
	2) wait until domain quits
	3) virsh edit

2012-02-01  Taku Izumi  <izumi.taku@jp.fujitsu.com>

	qemu: fix my typo at commit 74e034964c32edb1732d0ff7642f3977f3587d72
	Fix my typo at
	  commit 74e034964c32edb1732d0ff7642f3977f3587d72

	"disk->rawio == -1" indicates that this value is not
	specified. So in case of this, domain must not
	be tainted.

2012-02-01  Alex Jia  <ajia@redhat.com>

	simplify block of codes
	Using new function 'virTypedParameterArrayClear' to simplify block of codes.

	* daemon/remote.c, src/remote/remote_driver.c: simplify codes.

2012-02-01  Eric Blake  <eblake@redhat.com>

	build: fix text regression
	Commit 8a09ee410 tickles a bug in libxml2-2.7.6 on RHEL 6.2,
	where libxml2 treats the pattern [^\n] as excluding literal
	backslash and n, instead of the intended newline, thus failing
	to validate any domain name containing 'n'.

	* docs/schemas/domaincommon.rng: Use literal newline instead.

2012-02-01  Laine Stump  <laine@laine.org>

	docs: fill out rawio description
	The original doc entry for rawio didn't mention the values it could
	have, the default, or the fact that setting it to "yes" for one disk
	effectively set it to "yes" for all disks in the domain.

2012-02-01  Taku Izumi  <izumi.taku@jp.fujitsu.com>

	qemu: make qemu processes to retain rawio capability
	This patch revises qemuProcessStart() function for qemu
	processes to retain CAP_SYS_RAWIO if needed.
	And in case of that, add taint flag to domain.

	util: extend virExecWithHook()
	This patch extends virExecWithHook() to receive
	capability information.

2012-02-01  Taku Izumi  <izumi.taku@jp.fujitsu.com>

	util: add functions to keep capabilities
	This patch introduces virSetCapabilities() function and implements
	virCommandAllowCap() function.

	Existing virClearCapabilities() is function to clear all capabilities.
	Instead virSetCapabilities() is function to set arbitrary capabilities.

2012-02-01  Taku Izumi  <izumi.taku@jp.fujitsu.com>

	conf: add rawio attribute to disk element of domain XML
	 This patch adds a new attribute "rawio" to the "disk" element
	 of domain XML. Valid values of "rawio" attribute are "yes"
	 and "no".
	 rawio='yes' indicates the disk is desirous of CAP_SYS_RAWIO.

	 If you specify the following XML:

	 <disk type='block' device='lun' rawio='yes'>
	  ...
	 </disk>

	 the domain will be granted CAP_SYS_RAWIO.
	 (of course, the domain have to be executed with root privilege)

	NOTE:
	   - "rawio" attribute is only valid when device='lun'
	   - At the moment, any other disks you won't use rawio can use rawio.

2012-02-01  Zeeshan Ali (Khattak)  <zeeshanak@gnome.org>

	Implement virStorageVolResize() for FS backend
	Currently only VIR_STORAGE_VOL_RESIZE_DELTA flag is supported.

2012-02-01  Eric Blake  <eblake@redhat.com>

	resize: slightly alter signature
	Our existing virDomainBlockResize takes an unsigned long long
	argument; if that command is later taught a DELTA and SHRINK flag,
	we cannot change its type without breaking API (but at least such
	a change would be ABI compatible).  Meanwhile, the only time a
	negative size makes sense is if both DELTA and SHRINK are used
	together, but if we keep the argument unsigned, applications can
	pass the positive delta amount by which they would like to shrink
	the system, and have the flags imply the negative value.  So,
	since this API has not yet been released, and in the interest of
	consistency with existing API, we swap virStorageVolResize to
	always pass an unsigned value.

	* include/libvirt/libvirt.h.in (virStorageVolResize): Use unsigned
	argument.
	* src/libvirt.c (virStorageVolResize): Likewise.
	* src/driver.h (virDrvStorageVolUpload): Adjust clients.
	* src/remote/remote_protocol.x (remote_storage_vol_resize_args):
	Likewise.
	* src/remote_protocol-structs: Regenerate.
	Suggested by Daniel P. Berrange.

2012-01-31  Philipp Hahn  <hahn@univention.de>

	XenXs: Update documentation
	Fix several references to now renamed functions and parameters when the
	functions were moved from src/xen/ to src/xenxs/.

2012-01-31  Laine Stump  <laine@laine.org>

	qemu: add "romfile" support to specify device boot ROM
	This patch addresses: https://bugzilla.redhat.com/show_bug.cgi?id=781562

	Along with the "rombar" option that controls whether or not a boot rom
	is made visible to the guest, qemu also has a "romfile" option that
	allows specifying a binary file to present as the ROM BIOS of any
	emulated or passthrough PCI device. This patch adds support for
	specifying romfile to both passthrough PCI devices, and emulated
	network devices that attach to the guest's PCI bus (just about
	everything other than ne2k_isa).

	One example of the usefulness of this option is described in the
	bugzilla report: 82576 sriov network adapters don't provide a ROM BIOS
	for the cards virtual functions (VF), but an image of such a ROM is
	available, and with this ROM visible to the guest, it can PXE boot.

	In libvirt's xml, the new option is configured like this:

	   <hostdev>
	     ...
	     <rom file='/etc/fake/boot.bin'/>
	     ...
	   </hostdev

	(similarly for <interface>).

2012-01-31  Laine Stump  <laine@laine.org>

	qemu: (and conf) support rombar for network devices
	When support for the rombar option was added, it was only added for
	PCI passthrough devices, configured with <hostdev>. The same option is
	available for any network device that is attached to the guest's PCI
	bus. This patch allows setting rombar for any PCI network device type.

	After adding cases to test this to qemuxml2argv-hostdev-pci-rombar.*,
	I decided to rename those files (to qemuxml2argv-pci-rom.*) to more
	accurately reflect the additional tests, and also noticed that up to
	now we've only been performing a domainschematest for that case, so I
	added the "pci-rom" test to both qemuxml2argv and qemuxml2xml (and in
	the process found some bugs whose fixes I squashed into previous
	commits of this series).

2012-01-31  Laine Stump  <laine@laine.org>

	conf: relocate rombar and boot order parse/format
	Since these two items are now in the virDomainDeviceInfo struct, it
	makes sense to parse/format them in the functions written to
	parse/format that structure. Not all types of devices allow them, so
	two internal flags are added to indicate when it is appropriate to do
	so.

	I was lucky - only one test case needed to be re-ordered!

2012-01-31  Laine Stump  <laine@laine.org>

	conf: put all guest-related HostdevDef data in one object
	To help consolidate the commonality between virDomainHostdevDef and
	virDomainNetDef into as few members as possible (and because I
	think it makes sense), this patch moves the rombar and bootIndex
	members into the "info" member that is common to both (and to all the
	other structs that use them).

	It's a bit problematic that this gives rombar and bootIndex to many
	device types that don't use them, but this is already the case for the
	master and mastertype members of virDomainDeviceInfo, and is properly
	commented as such in the definition.

	Note that this opens the door to supporting rombar for other devices
	that are attached to the guest PCI bus - virtio-blk-pci,
	virtio-net-pci, various other network adapters - which which have that
	capability in qemu, but previously had no support in libvirt.

2012-01-31  Laine Stump  <laine@laine.org>

	conf: remove duplicate call to VIR_FREE(info->alias)
	There is another identical call 4 lines up in the same function.

2012-01-30  Hendrik Schwartke  <hendrik@os-t.de>

	qemu: Fix segfault in qemuMonitorTextGetBlockInfo
	If some error occurs then the cleanup code calls VIR_FREE(info)
	without ensuring that info is initialized.

2012-01-30  Cole Robinson  <crobinso@redhat.com>

	xen: Don't add <console> to xml for dom0
	It just doesn't really make sense and confuses virt-manager

2012-01-30  Daniel P. Berrange  <berrange@redhat.com>

	Add virt-host-validate.1 to Mingw32 RPM spec file list

2012-01-29  KAMEZAWA Hiroyuki  <kamezawa.hiroyu@jp.fujitsu.com>

	remote handler for virDomainGetCPUStats()
	Unlike other users of virTypedParameter with RPC, this interface
	can return zero-filled entries because the interface assumes
	2 dimensional array. We compress these entries out from the
	server when generating the over-the-wire contents, then reconstitute
	them in the client.

2012-01-28  Eric Blake  <eblake@redhat.com>

	docs: reorder public header
	The bottom of the public header is reserved for deprecated APIs;
	it's nicer to arrange things in logical groups.

	* include/libvirt/libvirt.h.in (virConnectSetKeepAlive)
	(virDomainGetCPUStats): Float earlier in the file.

2012-01-28  Eric Blake  <eblake@redhat.com>

	docs: tweak recent suspend API additions
	* src/libvirt.c (virDomainPMSuspendForDuration): Clarify usage.

2012-01-28  KAMEZAWA Hiroyuki  <kamezawa.hiroyu@jp.fujitsu.com>

	Add new public API virDomainGetCPUStats()
	add new API virDomainGetCPUStats() for getting cpu accounting information
	per real cpus which is used by a domain.  The API is designed to allow
	future extensions for additional statistics.

	based on ideas by Lai Jiangshan and Eric Blake.

	* src/libvirt_public.syms: add API for LIBVIRT_0.9.10
	* src/libvirt.c: define virDomainGetCPUStats()
	* include/libvirt/libvirt.h.in: add virDomainGetCPUStats() header
	* src/driver.h: add driver API
	* python/generator.py: add python API (as not implemented)

2012-01-28  Michal Privoznik  <mprivozn@redhat.com>

	virsh: Expose new virDomainPMSuspendForDuration API
	under new command "dompmsuspend"

	Introduce virDomainPMSuspendForDuration API
	This API allows a domain to be put into one of S# ACPI states.
	Currently, S3 and S4 are supported. These states are shared
	with virNodeSuspendForDuration.
	However, for now we don't support any duration other than zero.
	The same apply for flags.

2012-01-28  Zeeshan Ali (Khattak)  <zeeshanak@gnome.org>

	resize: implement remote protocol for virStorageVolResize()
	Autogeneration saves the day.

2012-01-28  Zeeshan Ali (Khattak)  <zeeshanak@gnome.org>

	resize: add virStorageVolResize() API
	Add a new function to allow changing of capacity of storage volumes.
	Plan out several flags, even if not all of them will be implemented
	up front.

	Expose the new command via 'virsh vol-resize'.

2012-01-28  Eric Blake  <eblake@redhat.com>

	tests: fix reversed comparisons
	Otherwise, a failed test gives misleading output.

	* tests/commandtest.c (test13, test14, test16): Pass arguments in
	correct order.

2012-01-28  Cole Robinson  <crobinso@redhat.com>

	Return more error output if policykit auth fails.
	Several not uncommon issues can be diagnosed through pkcheck output, like
	lack of/malfunctioning desktop agent, or lack of/malfunctioning polkit
	dbus agent.

	Add new error code VIR_ERROR_AUTH_CANCELLED
	And hook it up for policykit auth. This allows virt-manager to detect
	that the user clicked the policykit 'cancel' button and not throw
	an 'authentication failed' error message at the user.

2012-01-28  Eric Blake  <eblake@redhat.com>

	qemu: avoid double free of qemu help output
	If yajl was not compiled in, we end up freeing an incoming
	parameter, which leads to a bogus free later on.  Regression
	introduced in commit 6e769eb.

	* src/qemu/qemu_capabilities.c (qemuCapsParseHelpStr): Avoid alloc
	on failure path, which in turn fixes bogus free.
	Reported by Cole Robinson.

2012-01-28  Eric Blake  <eblake@redhat.com>

	build: fix missing include
	Fix a build failure:

	virt-host-validate.c: In function 'main':
	virt-host-validate.c:82:5: error: implicit declaration of function 'setlocale' [-Werror=implicit-function-declaration]
	virt-host-validate.c:82:5: error: nested extern declaration of 'setlocale' [-Werror=nested-externs]
	virt-host-validate.c:82:20: error: 'LC_ALL' undeclared (first use in this function)

	* tools/virt-host-validate.c: Add <locale.h>.
	* .gitignore: Ignore built executable.

2012-01-28  Eric Blake  <eblake@redhat.com>

	xml: fix struct typos
	Noticed this while reviewing Dan's patches.

	* src/util/xml.c (virXMLRewritFileData): Rename to
	virXMLRewriteFileData.

2012-01-28  Daniel P. Berrange  <berrange@redhat.com>

	Move virEmitXMLWarning into xml.h
	The virEmitXMLWarning function should always have been in
	the xml.[hc] files, and should use virXML as its name
	prefix

	* src/util/util.c, src/util/util.h: Remove virEmitXMLWarning
	* src/util/xml.c, src/util/xml.h: Add virXMLEmitWarning

2012-01-28  Daniel P. Berrange  <berrange@redhat.com>

	Move virMacAddrXXX functions to src/util/virmacaddr.[ch]
	Move the virMacAddrXXX functions out of util.[ch] and into a
	new dedicate file virmacaddr.[ch]

	Rename virXXXXMacAddr to virMacAddrXXX
	Rename virFormatMacAddr, virGenerateMacAddr and virParseMacAddr
	to virMacAddrFormat, virMacAddrGenerate and virMacAddrParse
	respectively

2012-01-28  Daniel P. Berrange  <berrange@redhat.com>

	Add a virt-host-validate command to sanity check HV config
	To assist people in verifying that their host is operating in an
	optimal manner, provide a 'virt-host-validate' command. For each
	type of hypervisor, it will check any pre-requisites, or other
	good recommendations and report what's working & what is not.

	eg

	  # virt-host-validate
	  QEMU: Checking for device /dev/kvm                                         : FAIL (Check that the 'kvm-intel' or 'kvm-amd' modules are loaded & the BIOS has enabled virtualization)
	  QEMU: Checking for device /dev/vhost                                       : WARN (Load the 'vhost_net' module to improve performance of virtio networking)
	  QEMU: Checking for device /dev/net/tun                                     : PASS
	   LXC: Checking for Linux >= 2.6.26                                         : PASS

	This warns people if they have vmx/svm, but don't have /dev/kvm. It
	also warns about missing /dev/vhost net.

2012-01-27  Paolo Bonzini  <pbonzini@redhat.com>

	qemu: parse and create -cpu ...,-kvmclock
	QEMU supports a bunch of CPUID features that are tied to the kvm CPUID
	nodes rather than the processor's.  They are "kvmclock",
	"kvm_nopiodelay", "kvm_mmu", "kvm_asyncpf".  These are not known to
	libvirt and their CPUID leaf might move if (for example) the Hyper-V
	extensions are enabled. Hence their handling would anyway require some
	special-casing.

	However, among these the most useful is kvmclock; an additional
	"property" of this feature is that a <timer> element is a better model
	than a CPUID feature.  Although, creating part of the -cpu command-line
	from something other than the <cpu> XML element introduces some
	ugliness.

	Reviewed-by: Jiri Denemark <jdenemar@redhat.com>

2012-01-27  Paolo Bonzini  <pbonzini@redhat.com>

	conf: add kvmclock timer
	Add kvmclock timer to documentation, schema and parsers.  Keep the
	platform timer first since it is kind of special, and alphabetize
	the others when possible (i.e. when it does not change the ABI).

	Reviewed-by: Jiri Denemark <jdenemar@redhat.com>

2012-01-27  Paolo Bonzini  <pbonzini@redhat.com>

	qemu: do not create useless <cpu> element
	Avoid creating an empty <cpu> element when the QEMU command-line simply
	specifies the default "-cpu qemu32" or "-cpu qemu64".

	This requires the previous patch, which lets us represent "-cpu qemu32"
	as <os arch='i686'> in the generated XML.

2012-01-27  Paolo Bonzini  <pbonzini@redhat.com>

	qemu: get arch name from <cpu> element
	The qemu32 CPU model is chosen based on the <os arch=...> name when
	creating the QEMU command line for a 64-bit host.  For the opposite
	transformation we can test the guest CPU model for the "lm" feature.
	If it is absent, def->os.arch needs to be corrected.

	qemu: detect arch correctly for KVM
	When running under KVM, the arch is usually set to i686 because
	the name of the emulator is not qemu-system-x86_64.  Use the host
	arch instead.

2012-01-27  Paolo Bonzini  <pbonzini@redhat.com>

	x86: add kvm32 and kvm64, update qemu64
	Recently (or not so recently) QEMU added the kvm32 and kvm64
	architectures, representing a least common denominator of all
	hosts that can run KVM.  Add them to the machine map.

	Also, some features that TCG supports were added to qemu64.
	Add them to the cpu_map.xml whenever KVM is guaranteed to support
	those.  We still have to leave some out, because they would not
	be available to guests running on older hosts.

2012-01-27  Paolo Bonzini  <pbonzini@redhat.com>

	qemu: parse -enable-kvm

2012-01-27  Eric Blake  <eblake@redhat.com>

	qemu: require qmp on new enough qemu
	The qemu developers have made it clear that modern qemu will no
	longer guarantee human monitor command stability; furthermore,
	some features, such as async events, are only supported via qmp.
	If we are compiled without support for handling JSON, we cannot
	expect to sanely interact with modern qemu.

	However, things must continue to build on RHEL 5, where qemu
	is stuck at 0.10, and where yajl is not available.

	Another benefit of this patch: future additions of new monitor
	commands need only focus on qemu_monitor_json.c, instead of
	also wasting time with qemu_monitor_text.c.

	* src/qemu/qemu_capabilities.c (qemuCapsComputeCmdFlags): Report
	error if yajl is missing but qemu requires qmp.
	(qemuCapsParseHelpStr): Propagate error.
	(qemuCapsExtractVersionInfo): Update caller.
	* tests/qemuhelptest.c (testHelpStrParsing): Likewise.

2012-01-27  Eric Blake  <eblake@redhat.com>

	qemu: support qmp on RHEL/CentOS qemu
	I'm getting tired of remembering to backport RHEL-specific
	patches when building upstream libvirt on RHEL 6.x or CentOS.
	All the affected versions of RHEL qemu-kvm have backported
	enough patches to a) make JSON useful, and b) modify the
	-help text to mention libvirt as the preferred interface;
	which means this string in the help output is a reliable
	indicator that we can outsmart a strict version check,
	even when upstream qemu 0.12 lacked the needed features.

	* src/qemu/qemu_capabilities.c (qemuCapsComputeCmdFlags):
	Recognize particular help string present when enough features were
	backported to be worth using JSON.
	* tests/qemuhelptest.c (mymain): Update tests accordingly.

2012-01-27  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	nwfilter: Rebuild filters only if new filter is different than current
	Compare two filters' XML for equality and only rebuild/instantiate the new
	filter if the new and current filters are found to be different. This
	improves performance during an update of a filter with no obvious change
	or the reloading of filters during a 'kill -SIGHUP'

2012-01-27  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	nwfilter: Force instantiation of filters upon driver reload
	Introduce a function that rebuilds all running VMs' filters. Call
	this function when reloading the nwfilter driver.

	This addresses a problem introduced by the 2nd patch that typically
	causes no filters to be reinstantiate anymore upon driver reload
	since their XML has not changed. Yet the current behavior is that
	upon a SIGHUP all filters get reinstantiated.

2012-01-27  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Refactor qemuMonitorGetBlockInfo
	QEMU always sends details about all available block devices as an answer
	for "info block"/"query-block" command. On the other hand, our
	qemuMonitorGetBlockInfo was made for a single block devices queries
	only. Thus, when asking for multiple devices, we asked qemu multiple
	times to always get the same answer from which different parts were
	filtered. This patch makes qemuMonitorGetBlockInfo return a hash table
	of all block devices, which may later be used for getting details about
	specific devices.

	apparmor: Fix use of uninitialized random_data
	Without this, virt-aa-helper would segfault in -c or -r commands.

2012-01-27  Marcelo Cerri  <mhcerri@linux.vnet.ibm.com>

	Update VIRT_CONTROL audit record with pid.
	Added a new field "vm-pid" to the VIRT_CONTROL audit record. This information
	is useful to correlated another audit events to the events generated by
	libvirt.

2012-01-27  Eric Blake  <eblake@redhat.com>

	build: allow for 64-bit pid in daemon
	Convert daemon code to handle 64-bit pid_t (even though at the
	moment, it is not compiled on mingw).

	* daemon/remote.c (remoteDispatchAuthList)
	(remoteDispatchAuthPolkit): Print pid_t via %lld.

2012-01-27  Eric Blake  <eblake@redhat.com>

	daemon: convert virRun to virCommand
	Using snprintf to build up argv seems archaic.

	* daemon/remote.c (remoteDispatchAuthPolkit): Modernize command call.

2012-01-27  Eric Blake  <eblake@redhat.com>

	hash: minor touchups
	On RHEL5, I got:
	util/virrandom.c:66: warning: nested extern declaration of '_gl_verify_function66' [-Wnested-externs]

	The fix is to hoist the verify earlier.  Also some other hodge-podge
	fixes I noticed while reviewing Dan's recent series.

	* .gitignore: Ignore new test.
	* src/util/cgroup.c: Bump copyright year.
	* src/util/virhash.c: Fix typo in description.
	* src/util/virrandom.c (virRandomBits): Mark doc comment, and
	hoist assert to silence older gcc.

2012-01-27  Michal Privoznik  <mprivozn@redhat.com>

	util: Include stdint.h because of uint32_t
	Some files are using uint32_t or int64_t without including
	stdint.h which defines them. Fix this.

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

	Remove tabs from libvirt_public.syms & enforce it
	* src/libvirt_public.syms: Death to tabs
	* cfg.mk: Check .syms files for tabs

	Add missing docs for <viridian/> feature flag

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

	Replace hashing algorithm with murmurhash
	Recent discussions have illustrated the potential for DOS attacks
	with the hash table implementations used by most languages and
	libraries.

	   https://lwn.net/Articles/474912/

	libvirt has an internal hash table impl, and uses hash tables for
	a variety of purposes. The hash key generation code is pretty
	simple and thus not strongly collision resistant.

	This patch replaces the current libvirt hash key generator with
	the (public domain) Murmurhash3 code. In addition every hash
	table now gets a random seed value which is used to perturb the
	hashing code. This should make it impossible to mount any
	practical attack against libvirt hashing code.

	* bootstrap.conf: Import bitrotate module
	* src/Makefile.am: Add virhashcode.[ch]
	* src/util/util.c: Make virRandom() return a fixed 32 bit
	  integer value.
	* src/util/hash.c, src/util/hash.h, src/util/cgroup.c: Replace
	  hash code generation with a call to virHashCodeGen()
	* src/util/virhashcode.h, src/util/virhashcode.c: Add a new
	  virHashCodeGen() API using the Murmurhash3 algorithm.

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

	Rename  hash.h and hash.c to virhash.h and virhash.c
	In preparation for the patch to include Murmurhash3, which
	introduces a virhashcode.h and virhashcode.c files, rename
	the existing hash.h and hash.c to virhash.h and virhash.c
	respectively.

	Convert various virHash functions to use size_t / uint32
	In preparation for conversion over to use the Murmurhash3
	algorithm, convert various virHash APIs to use size_t or
	uint32 for their return values/parameters, instead of the
	variable size 'unsigned long' or 'int' types

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

	Introduce new API for generating random numbers
	The old virRandom() API was not generating good random numbers.
	Replace it with a new API virRandomBits which instead of being
	told the upper limit, gets told the number of bits of randomness
	required.

	* src/util/virrandom.c, src/util/virrandom.h: Add virRandomBits,
	  and move virRandomInitialize
	* src/util/util.h, src/util/util.c: Delete virRandom and
	  virRandomInitialize
	* src/libvirt.c, src/security/security_selinux.c,
	  src/test/test_driver.c, src/util/iohelper.c: Update for
	  changes from virRandom to virRandomBits
	* src/storage/storage_backend_iscsi.c: Remove bogus call
	  to virRandomInitialize & convert to virRandomBits

2012-01-26  Peter Krempa  <pkrempa@redhat.com>

	schema: Relax schema for domain name
	The domain schema enforced restrictions on the domain name string that
	the code doesn't. This patch relaxes the check, leaving the restrictions
	on the driver or hypervisor. The only invalid character is a newline.

2012-01-26  Michal Privoznik  <mprivozn@redhat.com>

	storage: Support different wiping algorithms
	Currently, we support only filling a volume with zeroes on wiping.
	However, it is not enough as data might still be readable by
	experienced and equipped attacker. Many technical papers have been
	written, therefore we should support other wiping algorithms.

2012-01-26  Eric Blake  <eblake@redhat.com>

	docs: fix virsh man page
	Typo introduced in commit 4e9953a, and remained in 6fba577.

	* tools/virsh.pod (snapshot-create): Fix pod error.

2012-01-26  Marc-André Lureau  <marcandre.lureau@gmail.com>

	Cast pointer to int using intptr_t
	Fix a few warnings with mingw64 x86_64.

2012-01-26  Eric Blake  <eblake@redhat.com>

	build: fix header order on mingw
	In file included from ../gnulib/lib/unistd.h:51:0,
	                 from ../src/util/util.h:30,
	                 from rpc/virkeepalive.c:29:
	/usr/x86_64-w64-mingw32/sys-root/mingw/include/winsock2.h:15:2: warning: #warning Please include winsock2.h before windows.h [-Wcpp]

	Reported by Marc-André Lureau.

	* src/util/threads-win32.h (includes): Pick up winsock2.h before
	windows.h, as required by mingw64.

2012-01-26  Marc-André Lureau  <marcandre.lureau@gmail.com>

	errcode is typedef by mingw, rename an argument name
	Fixes the following warning:
	util/virterror.c:1242:31: warning: declaration of 'errcode' shadows a global declaration [-Wshadow]

	Add missing virGetGroupName()
	Add missing function if !HAVE_GETPWUID_R.

2012-01-26  Cole Robinson  <crobinso@redhat.com>

	storage: Fix any VolLookupByPath if we have an empty logical pool
	On F16 at least, empty volume groups don't have a directory under /dev.
	The directory only appears once a logical volume is created.

	This tickles some behavior in BackendStablePath which ends with
	libvirt sleeping for 5 seconds while waiting for the directory to appear.
	This causes all sorts of problems for the virStorageVolLookupByPath API
	which virtinst uses, even if trying to resolve a path that is independent
	of the logical pool.

	In reality we don't even need to do that checking since logical pools
	always have a stable target path. Short circuit the polling in that
	case.

	Fixes bug 782261

2012-01-25  Eric Blake  <eblake@redhat.com>

	lxc: export container=lxc-libvirt for systemd
	Systemd detects containers based on whether they have
	an environment variable starting with 'container=lxc';
	using a longer name fits the expectations, while also
	allowing detection of who created the container.

	Requested by Lennart Poettering, in response to
	https://bugs.freedesktop.org/show_bug.cgi?id=45175

	* src/lxc/lxc_container.c (lxcContainerBuildInitCmd): Add another
	env-var.

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

	Don't bind mount onto a char device for /dev/ptmx in LXC
	The current setup code for LXC is bind mounting /dev/pts/ptmx
	on top of a character device /dev/ptmx. This is denied by SELinux
	policy and is just wrong. The target of a bind mount should just
	be a plain file

	* src/lxc/lxc_container.c: Don't bind /dev/pts/ptmx onto
	  a char device

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

	Add virFileTouch for creating empty files
	Add a virFileTouch API which ensures that a file will always
	exist, even if zero length

	* src/util/virfile.c, src/util/virfile.h,
	  src/libvirt_private.syms: Introduce virFileTouch

2012-01-25  Michal Privoznik  <mprivozn@redhat.com>

	virsh: Expose new VIR_DOMAIN_SNAPSHOT_CREATE_QUIESCE flag
	to cmdSnapshotCreate and cmdSnapshotCreateAs.

	snapshots: Introduce VIR_DOMAIN_SNAPSHOT_CREATE_QUIESCE flag
	With this flag, virDomainSnapshotCreate will use fs-freeze and
	fs-thaw guest agent commands to quiesce guest's disks.

	qemu_agent: Create file system freeze and thaw functions
	These functions simply issue command to guest agent which
	should freeze or unfreeze all file systems within guest.

2012-01-25  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Emit bootindex even for direct boot
	Direct boot (using kernel, initrd, and command line) is used by
	virt-install/virt-manager for network install. While any bootindex has
	no direct effect since -kernel is always first, we need it as a hint for
	SeaBIOS to present disks in the same order as they will be presented
	during normal boot.

2012-01-25  Laine Stump  <laine@laine.org>

	docs: fix a few small typos in formatdomain.html.in

2012-01-25  Eric Blake  <eblake@redhat.com>

	metadata: group metadata next to description
	It's better to group all the metadata together.  This is a
	cosmetic output change; since the RNG allows interleave, it
	doesn't matter where the user stuck it on input, and an XPath
	query will find the same information when parsing the output.

	* src/conf/domain_conf.c (virDomainDefFormatInternal): Output
	metadata earlier.
	* docs/formatdomain.html.in: Update documentation.
	* tests/domainsnapshotxml2xmlout/metadata.xml: Update test.
	* tests/qemuxml2xmloutdata/qemuxml2xmlout-metadata.xml: Likewise.

2012-01-25  Eric Blake  <eblake@redhat.com>

	build: simplify xmlFreeNode usage
	Noticed while reviewing the previous patch; thankfully, there
	are no violations.

	* cfg.mk (useless_free_options): Add xmlFreeNode.

2012-01-25  Zeeshan Ali (Khattak)  <zeeshanak@gnome.org>

	Allow custom metadata in domain configuration XML
	Applications can now insert custom nodes and hierarchies into domain
	configuration XML. Although currently not enforced, applications are
	required to use their own namespaces on every custom node they insert,
	with only one top-level element per namespace.

2012-01-25  Laszlo Ersek  <lersek@redhat.com>

	virCommandProcessIO(): make poll() usage more robust
	POLLIN and POLLHUP are not mutually exclusive. Currently the following
	seems possible: the child writes 3K to its stdout or stderr pipe, and
	immediately closes it. We get POLLIN|POLLHUP (I'm not sure that's possible
	on Linux, but SUSv4 seems to allow it). We read 1K and throw away the
	rest.

	When poll() returns and we're about to check the /revents/ member in a
	given array element, let's map all the revents bits to two (independent)
	ideas: "let's attempt to read()", and "let's attempt to write()". This
	should cover all errors, EOFs, and normal conditions; the read()/write()
	call should report any pending error.

	Under this approach, both POLLHUP and POLLERR are mapped to "needs read()"
	if we're otherwise prepared for POLLIN. POLLERR also maps to "needs
	write()" if we're otherwise prepared for POLLOUT. The rest of the mappings
	(POLLPRI etc.) would be easy, but probably useless for pipes.

	Additionally, SUSv4 doesn't appear to forbid POLLIN|POLLERR (or
	POLLOUT|POLLERR) set simultaneously. One could argue that the read() or
	write() call would return without blocking in these cases (with an error),
	so POLLIN / POLLOUT would be justified beside POLLERR.

	The code now penalizes POLLIN|POLLERR differently from plain POLLERR. The
	former (ie. read() returning -1) is terminal and we jump to cleanup, while
	plain POLLERR masks only the affected file descriptor for the future.
	Let's unify those.

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

	src/datatypes.h: fix typo

2012-01-24  Daniel P. Berrange  <berrange@redhat.com>

	Allow choice of shutdown method via virsh
	Extend the 'shutdown' and 'reboot' methods so that they both
	accept a new argument

	    --mode acpi|agent

	* tools/virsh.c: New args for shutdown/reboot
	* tools/virsh.pod: Document new args

2012-01-24  Daniel P. Berrange  <berrange@redhat.com>

	Wire up QEMU agent to reboot/shutdown APIs
	This makes use of the QEMU guest agent to implement the
	virDomainShutdownFlags and virDomainReboot APIs. With
	no flags specified, it will prefer to use the agent, but
	fallback to ACPI. Explicit choice can be made by using
	a suitable flag

	* src/qemu/qemu_driver.c: Wire up use of agent

2012-01-24  Daniel P. Berrange  <berrange@redhat.com>

	Add new virDomainShutdownFlags API
	Add a new API virDomainShutdownFlags and define:

	    VIR_DOMAIN_SHUTDOWN_DEFAULT        = 0,
	    VIR_DOMAIN_SHUTDOWN_ACPI_POWER_BTN = (1 << 0),
	    VIR_DOMAIN_SHUTDOWN_GUEST_AGENT    = (1 << 1),

	Also define some flags for the reboot API

	    VIR_DOMAIN_REBOOT_DEFAULT        = 0,
	    VIR_DOMAIN_REBOOT_ACPI_POWER_BTN = (1 << 0),
	    VIR_DOMAIN_REBOOT_GUEST_AGENT    = (1 << 1),

	Although these two APIs currently have the same flags, using
	separate enums allows them to expand separately in the future.

	Add stub impls of the new API for all existing drivers

2012-01-24  Daniel P. Berrange  <berrange@redhat.com>

	QEMU guest agent support
	There is now a standard QEMU guest agent that can be installed
	and given a virtio serial channel

	    <channel type='unix'>
	      <source mode='bind' path='/var/lib/libvirt/qemu/f16x86_64.agent'/>
	      <target type='virtio' name='org.qemu.guest_agent.0'/>
	    </channel>

	The protocol that runs over the guest agent is JSON based and
	very similar to the JSON monitor. We can't use exactly the same
	code because there are some odd differences in the way messages
	and errors are structured. The qemu_agent.c file is based on
	a combination and simplification of qemu_monitor.c and
	qemu_monitor_json.c

	* src/qemu/qemu_agent.c, src/qemu/qemu_agent.h: Support for
	  talking to the agent for shutdown
	* src/qemu/qemu_domain.c, src/qemu/qemu_domain.h: Add thread
	  helpers for talking to the agent
	* src/qemu/qemu_process.c: Connect to agent whenever starting
	  a guest
	* src/qemu/qemu_monitor_json.c: Make variable static

2012-01-24  Michal Privoznik  <mprivozn@redhat.com>

	hashtest: Initialize variable in virHashEqual test
	One of latest patches (b7bcb22ce2) enhanced testing for virHashEqual.
	However, hash2 variable might be used uninitialized.

2012-01-24  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	Add test case for virHashEqual function
	Add a test case to test the virHashEqual function.

	Compare two hash tables for equality
	Add function to compare two hash tables for equality.

2012-01-23  Eric Blake  <eblake@redhat.com>

	build: skip lxc with too-old glibc
	Since we already require the kernel to be new enough to support
	LO_FLAGS_AUTOCLEAR, we might as well also require glibc to be
	new enough to support epoll_create1().

	* configure.ac (with_lxc): We require glibc 2.9 for LXC.
	Reported and tested by Philipp Hahn.

2012-01-23  Guido Günther  <agx@sigxcpu.org>

	xen: Don't crash when we fail to init caps
	by dereferencing a NULL pointer in the call to
	virNodeSuspendGetTargetMask.

2012-01-21  Guido Günther  <agx@sigxcpu.org>

	xen: properly report out of memory when hvm_type is too small

2012-01-21  Taku Izumi  <izumi.taku@jp.fujitsu.com>

	virsh: let domif-{get,set}link take target name
	Other virsh domifXXX commands can accept target name
	as a parameter to specify interface. From viewpoint of
	consistency, virsh domif-getlink command should accept
	target name as a parameter. This patch achieves this.

2012-01-21  Eric Blake  <eblake@redhat.com>

	maint: cleanup qemu capabilities
	Fix inconsistent whitespace and long lines.

	* src/qemu/qemu_capabilities.h (qemuCapsFlags): Improve formatting.

2012-01-21  Eric Blake  <eblake@redhat.com>

	maint: enforce use of _LAST marker
	When converting a linear enum to a string, we have checks in
	place in the VIR_ENUM_IMPL macro to ensure that there is one
	string for every value, which lets us quickly flag if a user
	added a value but forgot to add a counterpart string.  However,
	this only works if we use the _LAST marker.

	* cfg.mk (sc_require_enum_last_marker): New syntax check.
	* src/conf/domain_conf.h (virDomainSnapshotState): Add new marker.
	* src/conf/domain_conf.c (virDomainSnapshotState): Fix offender.
	* src/qemu/qemu_monitor_json.c (qemuMonitorWatchdogAction)
	(qemuMonitorIOErrorAction, qemuMonitorGraphicsAddressFamily):
	Likewise.
	* src/util/virtypedparam.c (virTypedParameter): Likewise.

2012-01-21  Eric Blake  <eblake@redhat.com>

	API: make declaration of _LAST enum values conditional
	Although this is a public API break, it only affects users that
	were compiling against *_LAST values, and can be trivially
	worked around without impacting compilation against older
	headers, by the user defining VIR_ENUM_SENTINELS before using
	libvirt.h.  It is not an ABI break, since enum values do not
	appear as .so entry points.  Meanwhile, it prevents users from
	using non-stable enum values without explicitly acknowledging
	the risk of doing so.

	See this list discussion:
	https://www.redhat.com/archives/libvir-list/2012-January/msg00804.html

	* include/libvirt/libvirt.h.in: Hide all sentinels behind
	LIBVIRT_ENUM_SENTINELS, and add missing sentinels.
	* src/internal.h (VIR_DEPRECATED): Allow inclusion after
	libvirt.h.
	(LIBVIRT_ENUM_SENTINELS): Expose sentinels internally.
	* daemon/libvirtd.h: Use the sentinels.
	* src/remote/remote_protocol.x (includes): Don't expose sentinels.
	* python/generator.py (enum): Likewise.
	* tests/cputest.c (cpuTestCompResStr): Silence compiler warning.
	* tools/virsh.c (vshDomainStateReasonToString)
	(vshDomainControlStateToString): Likewise.

2012-01-20  Eric Blake  <eblake@redhat.com>

	error: drop old-style error reporting
	While we still don't want to enable gcc's new -Wformat-literal
	warning, I found a rather easy case where the warning could be
	reduced, by getting rid of obsolete error-reporting practices.
	This is the last place where we were passing the (unused) net
	and conn arguments for constructing an error.

	* src/util/virterror_internal.h (virErrorMsg): Delete prototype.
	(virReportError): Delete macro.
	* src/util/virterror.c (virErrorMsg): Make static.
	* src/libvirt_private.syms (virterror_internal.h): Drop export.
	* src/util/conf.c (virConfError): Convert to macro.
	(virConfErrorHelper): New function, and adjust error calls.
	* src/xen/xen_hypervisor.c (virXenErrorFunc): Delete.
	(xenHypervisorGetSchedulerType)
	(xenHypervisorGetSchedulerParameters)
	(xenHypervisorSetSchedulerParameters)
	(xenHypervisorDomainBlockStats)
	(xenHypervisorDomainInterfaceStats)
	(xenHypervisorDomainGetOSType)
	(xenHypervisorNodeGetCellsFreeMemory, xenHypervisorGetVcpus):
	Update callers.

2012-01-20  Eric Blake  <eblake@redhat.com>

	util: use new virTypedParameter helpers
	Reusing common code makes things smaller; it also buys us some
	additional safety, such as now rejecting duplicate parameters
	during a set operation.

	* src/qemu/qemu_driver.c (qemuDomainSetBlkioParameters)
	(qemuDomainSetMemoryParameters, qemuDomainSetNumaParameters)
	(qemuSetSchedulerParametersFlags)
	(qemuDomainSetInterfaceParameters, qemuDomainSetBlockIoTune)
	(qemuDomainGetBlkioParameters, qemuDomainGetMemoryParameters)
	(qemuDomainGetNumaParameters, qemuGetSchedulerParametersFlags)
	(qemuDomainBlockStatsFlags, qemuDomainGetInterfaceParameters)
	(qemuDomainGetBlockIoTune): Use new helpers.
	* src/esx/esx_driver.c (esxDomainSetSchedulerParametersFlags)
	(esxDomainSetMemoryParameters)
	(esxDomainGetSchedulerParametersFlags)
	(esxDomainGetMemoryParameters): Likewise.
	* src/libxl/libxl_driver.c
	(libxlDomainSetSchedulerParametersFlags)
	(libxlDomainGetSchedulerParametersFlags): Likewise.
	* src/lxc/lxc_driver.c (lxcDomainSetMemoryParameters)
	(lxcSetSchedulerParametersFlags, lxcDomainSetBlkioParameters)
	(lxcDomainGetMemoryParameters, lxcGetSchedulerParametersFlags)
	(lxcDomainGetBlkioParameters): Likewise.
	* src/test/test_driver.c (testDomainSetSchedulerParamsFlags)
	(testDomainGetSchedulerParamsFlags): Likewise.
	* src/xen/xen_hypervisor.c (xenHypervisorSetSchedulerParameters)
	(xenHypervisorGetSchedulerParameters): Likewise.

2012-01-20  Eric Blake  <eblake@redhat.com>

	util: add new file for virTypedParameter utils
	Preparation for another patch that refactors common patterns
	into the new file for fewer lines of code overall.

	* src/util/util.h (virTypedParameterArrayClear): Move...
	* src/util/virtypedparam.h: ...to new file.
	(virTypedParameterArrayValidate, virTypedParameterAssign): New
	prototypes.
	* src/util/util.c (virTypedParameterArrayClear): Likewise.
	* src/util/virtypedparam.c: New file.
	* po/POTFILES.in: Mark file for translation.
	* src/Makefile.am (UTIL_SOURCES): Build it.
	* src/libvirt_private.syms (util.h): Split...
	(virtypedparam.h): to new section.
	(virkeycode.h): Sort.
	* daemon/remote.c: Adjust callers.
	* tools/virsh.c: Likewise.

2012-01-20  Eric Blake  <eblake@redhat.com>

	lxc: use live/config helper
	Based on qemu changes made in commits ae523427 and 659ded58.

	* src/lxc/lxc_driver.c (lxcSetSchedulerParametersFlags)
	(lxcGetSchedulerParametersFlags, lxcDomainSetBlkioParameters)
	(lxcDomainGetBlkioParameters): Use helpers.
	(lxcDomainSetBlkioParameters): Allow setting live and config at
	once.

2012-01-20  Eric Blake  <eblake@redhat.com>

	build: silence some compiler warnings from gnulib
	Gnulib claims that there are some classes of warnings that are
	worth enabling during development, but where silencing those
	warnings causes code bloat that is not necessary in an optimized
	build.  The code bloat to silence the warnings is only enabled
	by -Dlint.  Follow the lead of coreutils in setting up -Dlint
	whenever full warnings are requested.

	* m4/virt-compile-warnings.m4 (LIBVIRT_COMPILE_WARNINGS): Add
	-Dlint, and move _FORTIFY_SOURCE to config.h instead of CFLAGS.

2012-01-20  Eric Blake  <eblake@redhat.com>

	threads: check for failure to set thread-local value
	We had a memory leak on a very arcane OOM situation (unlikely to ever
	hit in practice, but who knows if libvirt.so would ever be linked
	into some other program that exhausts all thread-local storage keys?).
	I found it by code inspection, while analyzing a valgrind report
	generated by Alex Jia.

	* src/util/threads.h (virThreadLocalSet): Alter signature.
	* src/util/threads-pthread.c (virThreadHelper): Reduce allocation
	lifetime.
	(virThreadLocalSet): Detect failure.
	* src/util/threads-win32.c (virThreadLocalSet): Likewise.
	(virCondWait): Fix caller.
	* src/util/virterror.c (virLastErrorObject): Likewise.

2012-01-19  Daniel P. Berrange  <berrange@redhat.com>

	Fix rpc generator to anchor matches for method names
	The RPC generator transforms methods matching certain
	patterns like 'id' or 'uuid', etc but does not anchor
	its matches to the end of the word. So if a method
	contains 'id' in the middle (eg virIdentity) then the
	RPC generator munges that.

	* src/rpc/gendispatch.pl: Anchor matches

2012-01-19  Daniel P. Berrange  <berrange@redhat.com>

	Rename APIs for fetching UNIX socket credentials
	To avoid a namespace clash with forthcoming identity APIs,
	rename the virNet*GetLocalIdentity() APIs to have the form
	virNet*GetUNIXIdentity()

	* daemon/remote.c, src/libvirt_private.syms: Update
	  for renamed APIs
	* src/rpc/virnetserverclient.c, src/rpc/virnetserverclient.h,
	  src/rpc/virnetsocket.c, src/rpc/virnetsocket.h: s/LocalIdentity/UNIXIdentity/

2012-01-19  Daniel P. Berrange  <berrange@redhat.com>

	Add virGetGroupName to convert from GID to group name

	Remove duplicate call to virNetSASLSessionGetIdentity
	* daemon/remote.c: remoteSASLFinish called the method
	  virNetSASLSessionGetIdentity twice, remove second call

	Also retrieve GID from SO_PEERCRED
	* daemon/remote.c, src/rpc/virnetserverclient.c,
	  src/rpc/virnetserverclient.h, src/rpc/virnetsocket.c,
	  src/rpc/virnetsocket.h: Add gid parameter

2012-01-19  Martin Kletzander  <mkletzan@redhat.com>

	Added capability checking for block <iotune> setting.
	There was missing capability for blkiotune and thus specifying these
	settings caused libvirt to run qemu with invalid parameters and then
	reporting qemu error instead of the standard libvirt one. The support
	for blkiotune setting was added in upstream qemu repo under commit
	0563e191516289c9d2f282a8c50f2eecef2fa773.

2012-01-18  Daniel P. Berrange  <berrange@redhat.com>

	Fix startup of LXC containers with filesystems containing symlinks
	Given an LXC guest with a root filesystem path of

	  /export/lxc/roots/helloworld/root

	During startup, we will pivot the root filesystem to end up
	at

	  /.oldroot/export/lxc/roots/helloworld/root

	We then try to open

	  /.oldroot/export/lxc/roots/helloworld/root/dev/pts

	Now consider if '/export/lxc' is an absolute symlink pointing
	to '/media/lxc'. The kernel will try to open

	  /media/lxc/roots/helloworld/root/dev/pts

	whereas it should be trying to open

	  /.oldroot//media/lxc/roots/helloworld/root/dev/pts

	To deal with the fact that the root filesystem can be moved,
	we need to resolve symlinks in *any* part of the filesystem
	source path.

	* src/libvirt_private.syms, src/util/util.c,
	  src/util/util.h: Add virFileResolveAllLinks to resolve
	  all symlinks in a path
	* src/lxc/lxc_container.c: Resolve all symlinks in filesystem
	  paths during startup

2012-01-18  Osier Yang  <jyang@redhat.com>

	qemu: Prohibit reattaching node device if it is in use
	It doesn't make sense to reattach a device to host while it's
	still in use, e.g, by a domain.

2012-01-18  Osier Yang  <jyang@redhat.com>

	qemu: Introduce inactive PCI device list
	pciTrySecondaryBusReset checks if there is active device on the
	same bus, however, qemu driver doesn't maintain an effective
	list for the inactive devices, and it passes meaningless argument
	for parameter "inactiveDevs". e.g. (qemuPrepareHostdevPCIDevices)

	if (!(pcidevs = qemuGetPciHostDeviceList(hostdevs, nhostdevs)))
	    return -1;

	..skipped...

	if (pciResetDevice(dev, driver->activePciHostdevs, pcidevs) < 0)
	    goto reattachdevs;

	NB, the "pcidevs" used above are extracted from domain def, and
	thus one won't be able to attach a device of which bus has other
	device even detached from host (nodedev-detach). To see more
	details of the problem:

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

	This patch is to resolve the problem by introducing an inactive
	PCI device list (just like qemu_driver->activePciHostdevs), and
	the whole logic is:

	  * Add the device to inactive list during nodedev-dettach
	  * Remove the device from inactive list during nodedev-reattach
	  * Remove the device from inactive list during attach-device
	    (for non-managed device)
	  * Add the device to inactive list after detach-device, only
	    if the device is not managed

	With the above, we have a sufficient inactive PCI device list, and thus
	we can use it for pciResetDevice. e.g.(qemuPrepareHostdevPCIDevices)

	if (pciResetDevice(dev, driver->activePciHostdevs,
	                   driver->inactivePciHostdevs) < 0)
	    goto reattachdevs;

2012-01-18  Martin Kletzander  <mkletzan@redhat.com>

	Permission change for systemtap examples.
	Execute bit on *.stp files in examples/systemtap/ caused dependency when
	building RPM packages. Disabling execute permission should help the auto
	dependency resolver to see that systemtap is not needed.

2012-01-18  Deepak C Shetty  <deepakcs@linux.vnet.ibm.com>

	Add new attribute wrpolicy to <driver> element
	This introduces new attribute wrpolicy with only supported
	value as immediate. This will be an optional
	attribute with no defaults. This helps specify whether
	to skip the host page cache.

	When wrpolicy is specified, meaning when wrpolicy=immediate
	a writeback is explicitly initiated for the dirty pages in
	the host page cache as part of the guest file write operation.

	Usage:
	<filesystem type='mount' accessmode='passthrough'>
	  <driver type='path' wrpolicy='immediate'/>
	  <source dir='/export/to/guest'/>
	  <target dir='mount_tag'/>
	</filesystem>

	Currently this only works with type='mount' for the QEMU/KVM driver.

2012-01-18  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Don't break domain with 0:0:2.0 assigned to anything but VGA
	In the past we didn't reserve 0:0:2.0 PCI address if there was no video
	device assigned to a domain, which made it impossible to add a video
	device later on. So we fixed it (commit v0.9.0-37-g7b2cac1) by always
	reserving that address. However, that breaks existing domains without
	video devices that already have another device assigned to the
	problematic address.

	This patch reserves address 0:0:2.0 only in case it was not explicitly
	assigned to another device, which means libvirt will try to keep this
	address free and will not automatically assign it new devices. But
	existing domains for which older libvirt already assigned the address to
	a non-video device will keep working as they used to work before 0.9.1.
	Moreover, users who want to create a domain without a video device and
	use its address for another device may do so by explicitly configuring
	the PCI address in domain XML.

2012-01-18  Eric Blake  <eblake@redhat.com>

	tests: avoid dirname in tests
	qemuxml2argvtest sanitizes PATH to just /bin, but on at least
	Fedora 16, dirname lives in /usr/bin instead.  Regression
	introduced in commit e7201afd.

	* tests/qemuxml2argvdata/qemu.sh: Avoid forking a dirname call,
	since dirname might not be in PATH after test sanitization.
	* tests/qemuxml2argvdata/qemu-supported-cpus.sh: Likewise.
	Diagnosed by Michal Privoznik.

2012-01-18  Martin Kletzander  <mkletzan@redhat.com>

	Fixed dumpxml of <iotune> parameters
	The output of dumpxml for <iotune> settings was misformatted, this
	patch just adds missing newlines.

2012-01-18  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	nwfilter: fix typing error in filter
	Fix a typing error in the no-ip-spoofing filter.
	Return DHCP request packets passing through this filter. Have
	the user use another filter to actually allow DHCP requests to be
	sent (action='accept').

2012-01-18  Daniel Veillard  <veillard@redhat.com>

	Remove dmidecode dependancy outside PC arches
	The new dependancy is only available on ix86, x86_64 and ia64

2012-01-17  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Add support for host CPU modes
	This adds support for host-model and host-passthrough CPU modes to qemu
	driver. The host-passthrough mode is mapped to -cpu host.

2012-01-17  Jiri Denemark  <jdenemar@redhat.com>

	Taint domains configured with cpu mode=host-passthrough
	There are several reasons for doing this:

	- the CPU specification is out of libvirt's control so we cannot
	  guarantee stable guest ABI
	- not every feature of a CPU may actually work as expected when
	  advertised directly to a guest
	- migration between two machines with exactly the same CPU may work but
	  no guarantees can be made
	- this mode is not supported and its use is at one's own risk

2012-01-17  Jiri Denemark  <jdenemar@redhat.com>

	cpu: Update guest CPU in host-* mode
	VIR_DOMAIN_XML_UPDATE_CPU flag for virDomainGetXMLDesc may be used to
	get updated custom mode guest CPU definition in case it depends on host
	CPU. This patch implements the same behavior for host-model and
	host-passthrough CPU modes.

2012-01-17  Jiri Denemark  <jdenemar@redhat.com>

	Add support for cpu mode attribute
	The mode can be either of "custom" (default), "host-model",
	"host-passthrough". The semantics of each mode is described in the
	following examples:

	- guest CPU is a default model with specified topology:
	    <cpu>
	      <topology sockets='1' cores='2' threads='1'/>
	    </cpu>

	- guest CPU matches selected model:
	    <cpu mode='custom' match='exact'>
	      <model>core2duo</model>
	    </cpu>

	- guest CPU should be a copy of host CPU as advertised by capabilities
	  XML (this is a short cut for manually copying host CPU specification
	  from capabilities to domain XML):
	    <cpu mode='host-model'/>

	  In case a hypervisor does not support the exact host model, libvirt
	  automatically falls back to a closest supported CPU model and
	  removes/adds features to match host. This behavior can be disabled by
	    <cpu mode='host-model'>
	      <model fallback='forbid'/>
	    </cpu>

	- the same as previous returned by virDomainGetXMLDesc with
	  VIR_DOMAIN_XML_UPDATE_CPU flag:
	    <cpu mode='host-model' match='exact'>
	      <model fallback='allow'>Penryn</model>       --+
	      <vendor>Intel</vendor>                         |
	      <topology sockets='2' cores='4' threads='1'/>  + copied from
	      <feature policy='require' name='dca'/>         | capabilities XML
	      <feature policy='require' name='xtpr'/>        |
	      ...                                          --+
	    </cpu>

	- guest CPU should be exactly the same as host CPU even in the aspects
	  libvirt doesn't model (such domain cannot be migrated unless both
	  hosts contain exactly the same CPUs):
	    <cpu mode='host-passthrough'/>

	- the same as previous returned by virDomainGetXMLDesc with
	  VIR_DOMAIN_XML_UPDATE_CPU flag:
	    <cpu mode='host-passthrough' match='minimal'>
	      <model>Penryn</model>                        --+ copied from caps
	      <vendor>Intel</vendor>                         | XML but doesn't
	      <topology sockets='2' cores='4' threads='1'/>  | describe all
	      <feature policy='require' name='dca'/>         | aspects of the
	      <feature policy='require' name='xtpr'/>        | actual guest CPU
	      ...                                          --+
	    </cpu>

2012-01-17  Jiri Denemark  <jdenemar@redhat.com>

	cpu: Optionally forbid fallback CPU models
	In case a hypervisor doesn't support the exact CPU model requested by a
	domain XML, we automatically fallback to a closest CPU model the
	hypervisor supports (and make sure we add/remove any additional features
	if needed). This patch adds 'fallback' attribute to model element, which
	can be used to disable this automatic fallback.

2012-01-17  Jiri Denemark  <jdenemar@redhat.com>

	tests: Print XML file name in verbose CPU test
	It's not totally obvious that a failure in

	    CPU guest data(x86): host/guest (models, pref="qemu64")

	test means one needs to fix

	    x86-host+guest,models,qemu64-result.xml

	where the expected XML is stored. Better to provide a nice hint in
	verbose mode for failed tests.

2012-01-17  Jiri Denemark  <jdenemar@redhat.com>

	Clarify semantics of virDomainMigrate{,ToURI}2
	Commit 5d784bd6d7b19314b0908aec6b46bfe377aeba42 was a nice attempt to
	clarify the semantics by requiring domain name from dxml to either match
	original name or dname. However, setting dxml domain name to dname
	doesn't really work since destination host needs to know the original
	domain name to be able to use it in migration cookies. This patch
	requires domain name in dxml to match the original domain name. The
	change should be safe and backward compatible since migration would fail
	just a bit later in the process.

2012-01-17  Osier Yang  <jyang@redhat.com>

	docs: Add missed RNG schema for interface
	We support <interface> of type "mcast", "server", and "client",
	but the RNG schema for them are missed. Attribute "address" is
	optional for "server" type. And these 3 types support
	<mac address='MAC'/>, too.

2012-01-17  Eric Blake  <eblake@redhat.com>

	build: fix bootstrap on fresh clone
	Commit 29db7a0 picked up a gnulib bug, where a change in
	bootstrap meant that it would fail to run libtoolize on
	projects, like libvirt, that used the older spelling
	AM_PROG_LIBTOOL instead of LT_INIT for the sake of building
	on RHEL 5.  Now that gnulib is fixed, we should pick up that
	fix.

	* .gnulib: Update to latest, for bootstrap fix.
	* bootstrap: Resync from gnulib.

2012-01-16  Osier Yang  <jyang@redhat.com>

	docs: Expose alias tag in domain RNG schema
	Though <alias> is ignored when defining a domain, it can cause
	failure if one validates (e.g. virt-xml-validate) the XML dumped
	from a running domain. This patch expose it in domain RNG schema
	for all the devices which support it.

	docs: Add readonly to filesystem RNG schema
	"<readonly/>" is supported by filesystem XML, and also documented.

2012-01-14  Michael Ellerman  <michael@ellerman.id.au>

	conf: Remove do-nothing validation functions
	There are three address validation routines that do nothing:
	  virDomainDeviceDriveAddressIsValid()
	  virDomainDeviceUSBAddressIsValid()
	  virDomainDeviceVirtioSerialAddressIsValid()

	Remove them, and replace their call sites with "1" which is what they
	currently return. In some cases this means we can remove an entire
	if block.

2012-01-14  Michael Ellerman  <michael@ellerman.id.au>

	tests: Add qemuxml2argv tests for PPC64 pseries machine
	Add four tests of the XML -> argv handling for the PPC64 pseries machine.

	The first is just a basic test of a bare bones machine.

	The three others test various aspects of the spapr-vio address handling.

	It seems that currently we can't include network devices, doing so leads
	to a segfault because the network driverState is not initialised. Working
	around that leads us to the problem that the 'default' network doesn't
	exist. So for now just leave network devices out.

2012-01-14  Michael Ellerman  <michael@ellerman.id.au>

	tests: Teach qemuxml2argvtest about spapr-vio addresses
	We can't call qemuCapsExtractVersionInfo() from test code, because it
	expects to be able to call the emulator, and for testing we have fake
	emulators that can't be executed. For that reason qemuxml2argvtest.c
	doesn't call qemuDomainAssignPCIAddresses(), instead it open codes its
	own version.

	That means we can't call qemuDomainAssignAddresses() from the test code,
	instead we need to manually call qemuDomainAssignSpaprVioAddresses().

	Also add logic to cope with qemuDomainAssignSpaprVioAddresses() failing,
	so that we can write a test that checks for a known failure in there.

2012-01-14  Michael Ellerman  <michael@ellerman.id.au>

	Make drive unit attribute optional in the XML schema
	The "unit" attribute of a drive address is optional in the code, so should
	also be in the XML schema.

2012-01-14  Paolo Bonzini  <pbonzini@redhat.com>

	qemu: add virtio-scsi controller model
	Adding a new model for virtio-scsi roughly follows the same scheme
	as the previous patch.

2012-01-14  Paolo Bonzini  <pbonzini@redhat.com>

	qemu: add ibmvscsi controller model
	KVM will be able to use a PCI SCSI controller even on POWER.  Let
	the user specify the vSCSI controller by other means than a default.

	After this patch, the QEMU driver will actually look at the model
	and reject anything but auto, lsilogic and ibmvscsi.

2012-01-14  Adam Litke  <agl@us.ibm.com>

	events: Return the correct number of registered events
	Commit d09f6ba5feb655925175dc80122ca2a1e14db2b9 introduced a regression in event
	registration.  virDomainEventCallbackListAddID() will only return a positive
	integer if the type of event being registered is VIR_DOMAIN_EVENT_ID_LIFECYCLE.
	For other event types, 0 is always returned on success.  This has the
	unfortunate side effect of not enabling remote event callbacks because
	remoteDomainEventRegisterAny() uses the return value from the local call to
	determine if an event callback needs to be registered on the remote end.

	Make sure virDomainEventCallbackListAddID() returns the callback count for the
	eventID being registered.

2012-01-13  Taku Izumi  <izumi.taku@jp.fujitsu.com>

	virsh domiflist: change output
	When using "virsh domifstat" command or "virsh domiftune" command,
	we pass an interface name as a parameter, so interface name is
	important.

	"virsh domiflist" output should display interface names
	on the first row.

2012-01-13  Paolo Bonzini  <pbonzini@redhat.com>

	export virNetDevGetVirtualFunctions as a private symbol
	This avoids a linking error.

2012-01-13  Osier Yang  <jyang@redhat.com>

	virsh: Two new fields for command domblklist
	Disk "type" and "device" are generally interesting stuff the
	user may want to known, too. To not break any scripts which
	parsed the output field, a new option "--details" is introduced
	to output the two introduced fields.

	qemu: Support copy on read for disk
	The new introduced optional attribute "copy_on_read</code> controls
	whether to copy read backing file into the image file. The value can
	be either "on" or "off". Copy-on-read avoids accessing the same backing
	file sectors repeatedly and is useful when the backing file is over a
	slow network. By default copy-on-read is off.

2012-01-13  Martin Kletzander  <mkletzan@redhat.com>

	Added check for maximum number of vcpus exceeding topology limit
	Earlier, when the number of vcpus was greater than the topology allowed,
	libvirt didn't raise an error and continued, resulting in running qemu
	with parameters making no sense. Even though qemu did not report any
	error itself, the number of vcpus was set to maximum allowed by the
	topology.

2012-01-13  Eric Blake  <eblake@redhat.com>

	build: update to latest gnulib
	Pick up recent gnulib improvements.

	* .gnulib: Update to latest.
	* bootstrap: Resync.
	* bootstrap.conf (gnulib_tool_option_extras): Adjust to bootstrap
	changes.
	* gnulib/lib/Makefile.am: Likewise.

2012-01-13  Eric Blake  <eblake@redhat.com>

	uuid: fix off-by-one
	Detected by Coverity.  Although unlikely, if we are ever started
	with stdin closed, we could reach a situation where we open a
	uuid file but then fail to close it, making that file the new
	stdin for the rest of the process.

	* src/util/uuid.c (getDMISystemUUID): Allow for stdin.

2012-01-13  Eric Blake  <eblake@redhat.com>

	build: fix virsh reformat fallout
	Commit 69f0b446 failed to update the expected test output.

	* tests/virshtest.c (testCompareListDefault)
	(testCompareListCustom): Adjust to recent code change.

2012-01-13  Daniel P. Berrange  <berrange@redhat.com>

	Rsync keymaps.csv file with GTK-VNC

2012-01-13  Daniel P. Berrange  <berrange@redhat.com>

	Re-write LXC controller end-of-file I/O handling yet again
	Currently the LXC controller attempts to deal with EOF on a
	tty by spawning a thread to do an edge triggered epoll_wait().
	This avoids the normal event loop spinning on POLLHUP. There
	is a subtle mistake though - even after seeing POLLHUP on a
	master PTY, it is still perfectly possible & valid to write
	data to the PTY. There is a buffer that can be filled with
	data, even when no client is present.

	The second mistake is that the epoll_wait() thread was not
	looking for the EPOLLOUT condition, so when a new client
	connects to the LXC console, it had to explicitly send a
	character before any queued output would appear.

	Finally, there was in fact no need to spawn a new thread to
	deal with epoll_wait(). The epoll file descriptor itself
	can be poll()'d on normally.

	This patch attempts to deal with all these problems.

	 - The blocking epoll_wait() thread is replaced by a poll
	   on the epoll file descriptor which then does a non-blocking
	   epoll_wait() to handle events
	 - Even if POLLHUP is seen, we continue trying to write
	   any pending output until getting EAGAIN from write.
	 - Once write returns EAGAIN, we modify the epoll event
	   mask to also look for EPOLLOUT

	* src/lxc/lxc_controller.c: Avoid stalled I/O upon
	  connected to an LXC console

2012-01-13  Daniel P. Berrange  <berrange@redhat.com>

	Allow 10 chars for domain IDs & 30 chars for names in virsh list
	Domain IDs are at least 16 bits for most hypervisors, theoretically
	event 32-bits.  3 characters is clearly too small an alignment.
	Increase alignment to 5 characters to allow 16-bit domain IDs to
	display cleanly. Commonly seen with LXC where domain IDs are the
	process IDs by default.  Also increase the 'name' field from 20
	to 30 characters to cope with longer guest names which are quite
	common

2012-01-12  Michal Privoznik  <mprivozn@redhat.com>

	stream: Check for stream EOF
	If client stream does not have any data to sink and neither received
	EOF, a dummy packet is sent to the daemon signalising client is ready to
	sink some data. However, after we added event loop to client a race may
	occur:

	Thread 1 calls virNetClientStreamRecvPacket and since no data are cached
	nor stream has EOF, it decides to send dummy packet to server which will
	sent some data in turn. However, during this decision and actual message
	exchange with server -

	Thread 2 receives last stream data from server. Therefore an EOF is set
	on stream and if there is a call waiting (which is not yet) it is woken
	up. However, Thread 1 haven't sent anything so far, so there is no call
	to be woken up. So this thread sent dummy packet to daemon, which
	ignores that as no stream is associated with such packet and therefore
	no reply will ever come.

	This race causes client to hang indefinitely.

2012-01-12  Osier Yang  <jyang@redhat.com>

	virsh: New command print summary of all virtual interfaces
	Just like command "domblklist", the command extracts "type",
	"source", "target", "model", and "MAC" of all virtual interfaces
	from domain XML (live or persistent).

2012-01-12  Deepak C Shetty  <deepakcs@linux.vnet.ibm.com>

	Do not generate security_model when fs driver is anything but 'path'
	QEMU does not support security_model for anything but 'path' fs driver type.
	Currently in libvirt, when security_model ( accessmode attribute) is not
	specified it auto-generates it irrespective of the fs driver type, which
	can result in a qemu error for drivers other than path. This patch ensures
	that the qemu cmdline is correctly generated by taking into account the
	fs driver type.

2012-01-12  Shradha Shah  <sshah@solarflare.com>

	Added new option to virsh net-dumpxml called --inactive
	The above option helps to differentiate between implicit and explicit
	interface pools.

	Functionality to implicitly get interface pool from SR-IOV PF.
	If a system has 64 or more VF's, it is quite tedious to mention each VF
	in the interface pool.
	The following modification will implicitly create an interface pool from
	the SR-IOV PF.

	Adding the element pf to network xml.
	This element will help the user to just specify the SR-IOV physical
	function in order to access all the Virtual functions attached to it.

2012-01-12  Shradha Shah  <sshah@solarflare.com>

	Added Function virNetDevGetVirtualFunctions
	This functions enables us to get the Virtual Functions attached to
	a Physical function given the name of a SR-IOV physical functio.

	In order to accomplish the task, added a getter function pciGetDeviceAddrString
	to get the BDF of the Virtual Function in a char array.

2012-01-12  Shradha Shah  <sshah@solarflare.com>

	Added function pciSysfsFile to enable access to the PCI SYSFS files.

2012-01-11  Daniel P. Berrange  <berrange@redhat.com>

	Disable netcf if building without libvirtd
	Although the netcf interface driver can in theory be used by
	the stateless drivers, in practice none of them want to use
	it because they have different ways of dealing with interfaces.

	Furthermore, if you have mingw32-netcf installed, then the
	libvirt mingw32 build will fail with

	  ../../src/interface/netcf_driver.c:644:5: error: unknown field 'close_used_without_including_unistd_h' specified in initializer

	 * configure.ac: disable netcf if built without libvirtd

2012-01-11  Eric Blake  <eblake@redhat.com>

	build: fix build on mingw with netcf available
	The autobuilder pointed out an odd failure on mingw:
	../../src/interface/netcf_driver.c:644:5: error: unknown field 'close_used_without_including_unistd_h' specified in initializer
	cc1: warnings being treated as errors

	This is because the gnulib headers #define close to different strings,
	according to which headers are included, in order to work around some
	odd mingw problems with close(), and these defines happen to also
	affect field members declared with a name of struct foo.close. As long
	as all headers are included before both the definition and use of the
	struct, the various #define doesn't matter, but the netcf file hit
	an instance where things were included in a different order.  Fix this
	for all clients that use a struct member named 'close'.

	* src/driver.h: Include <unistd.h> before using 'close'.

2012-01-11  Eric Blake  <eblake@redhat.com>

	build: avoid spurious compiler warning
	For some weird reason, i686-pc-mingw32-gcc version 4.6.1 at -O2 complained:
	../../src/conf/nwfilter_params.c: In function 'virNWFilterVarCombIterCreate':
	../../src/conf/nwfilter_params.c:346:23: error: 'minValue' may be used uninitialized in this function [-Werror=uninitialized]
	../../src/conf/nwfilter_params.c:319:28: note: 'minValue' was declared here
	../../src/conf/nwfilter_params.c:344:23: error: 'maxValue' may be used uninitialized in this function [-Werror=uninitialized]
	../../src/conf/nwfilter_params.c:319:18: note: 'maxValue' was declared here
	cc1: all warnings being treated as errors

	even though all paths of the preceding switch statement either
	assign the variables or return.

	* src/conf/nwfilter_params.c (virNWFilterVarCombIterAddVariable):
	Initialize variables.

2012-01-11  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	Add documentation new ways to access members of variables
	This patch adds documentation about the new 'ways' that users can
	access the contents of variables in filters:

	- access via index: $TEST[2]
	- access via iterators $TEST[@1]

2012-01-11  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	Add test cases for new ways to access variables in filters
	This patch adds a couple of XML parser / schema validator test cases
	for the new 'ways' to access variables via index or iterator.

	Address side effects of accessing vars via index
	Address side effect of accessing a variable via an index: Filters
	accessing a variable where an element is accessed that is beyond the
	size of the list (for example $TEST[10] and only 2 elements are available)
	cannot instantiate that filter. Test for this and report proper error
	to user.

2012-01-11  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	Add access to elements of variables via index
	This patch adds access to single elements of variables via index. Example:

	  <rule action='accept' direction='in' priority='500'>
	    <tcp srcipaddr='$ADDR[1]' srcportstart='$B[2]'/>
	  </rule>

2012-01-11  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	Introduce possibility to have an iterator per variable
	This patch introduces the capability to use a different iterator per
	variable.

	The currently supported notation of variables in a filtering rule like

	  <rule action='accept' direction='out'>
	     <tcp  srcipaddr='$A' srcportstart='$B'/>
	  </rule>

	processes the two lists 'A' and 'B' in parallel. This means that A and B
	must have the same number of 'N' elements and that 'N' rules will be 
	instantiated (assuming all tuples from A and B are unique).

	In this patch we now introduce the assignment of variables to different
	iterators. Therefore a rule like

	  <rule action='accept' direction='out'>
	     <tcp  srcipaddr='$A[@1]' srcportstart='$B[@2]'/>
	  </rule>

	will now create every combination of elements in A with elements in B since
	A has been assigned to an iterator with Id '1' and B has been assigned to an
	iterator with Id '2', thus processing their value independently.

	The first rule has an equivalent notation of

	  <rule action='accept' direction='out'>
	     <tcp  srcipaddr='$A[@0]' srcportstart='$B[@0]'/>
	  </rule>

2012-01-11  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	Optimize the elements the iterator visits.
	In this patch we introduce testing whether the iterator points to a
	unique set of entries that have not been seen before at one of the previous
	iterations. The point is to eliminate duplicates and with that unnecessary
	filtering rules by preventing identical filtering rules from being
	instantiated.
	Example with two lists:

	list1 = [1,2,1]
	list2 = [1,3,1]

	The 1st iteration would take the 1st items of each list -> 1,1
	The 2nd iteration would take the 2nd items of each list -> 2,3
	The 3rd iteration would take the 3rd items of each list -> 1,1 but
	skip them since this same pair has already been encountered in the 1st
	iteration

	Implementation-wise this is solved by taking the n-th element of list1 and
	comparing it against elements 1..n-1. If no equivalent is found, then there
	is no possibility of this being a duplicate. In case an equivalent element
	is found at position i, then the n-th element in the 2nd list is compared
	against the i-th element in the 2nd list and if that is not the same, then
	this is a unique pair, otherwise it is not unique and we may need to do
	the same comparison on the 3rd list.

2012-01-11  Jiri Denemark  <jdenemar@redhat.com>

	apparmor: Mark pid parameter as unused

2012-01-11  Alex Jia  <ajia@redhat.com>

	virsh: improve doMigrate function docs
	When running virsh migrate with --xml option and actual xml file doesn't
	exist, virsh hasn't output any error information, although return value
	is 1.

	* tools/virsh.c: Raising a appropriate error information when operation fails.

	* How to reproduce?
	% virsh migrate <domain> --live qemu+ssh://<target host>/system --xml non-existent.xml
	% echo $?

	* Fixed result:
	error: file 'non-existent.xml' doesn't exist

2012-01-11  Daniel P. Berrange  <berrange@redhat.com>

	Change security driver APIs to use virDomainDefPtr instead of virDomainObjPtr
	When sVirt is integrated with the LXC driver, it will be neccessary
	to invoke the security driver APIs using only a virDomainDefPtr
	since the lxc_container.c code has no virDomainObjPtr available.
	Aside from two functions which want obj->pid, every bit of the
	security driver code only touches obj->def. So we don't need to
	pass a virDomainObjPtr into the security drivers, a virDomainDefPtr
	is sufficient. Two functions also gain a 'pid_t pid' argument.

	* src/qemu/qemu_driver.c, src/qemu/qemu_hotplug.c,
	  src/qemu/qemu_migration.c, src/qemu/qemu_process.c,
	  src/security/security_apparmor.c,
	  src/security/security_dac.c,
	  src/security/security_driver.h,
	  src/security/security_manager.c,
	  src/security/security_manager.h,
	  src/security/security_nop.c,
	  src/security/security_selinux.c,
	  src/security/security_stack.c: Change all security APIs to use a
	  virDomainDefPtr instead of virDomainObjPtr

2012-01-11  Eric Blake  <eblake@redhat.com>

	snapshot: allow reuse of existing files in disk snapshot
	When disk snapshots were first implemented, libvirt blindly refused
	to allow an external snapshot destination that already exists, since
	qemu will blindly overwrite the contents of that file during the
	snapshot_blkdev monitor command, and we don't like a default of
	data loss by default.  But VDSM has a scenario where NFS permissions
	are intentionally set so that the destination file can only be
	created by the management machine, and not the machine where the
	guest is running, so that libvirt will necessarily see the destination
	file already existing; adding a flag will allow VDSM to force the file
	reuse without libvirt complaining of possible data loss.

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

	* include/libvirt/libvirt.h.in (virDomainSnapshotCreateFlags): Add
	VIR_DOMAIN_SNAPSHOT_CREATE_REUSE_EXT.
	* src/libvirt.c (virDomainSnapshotCreateXML): Document it.  Add
	note about partial failure.
	* tools/virsh.c (cmdSnapshotCreate, cmdSnapshotCreateAs): Add new
	flag.
	* tools/virsh.pod (snapshot-create, snapshot-create-as): Document
	it.
	* src/qemu/qemu_driver.c (qemuDomainSnapshotDiskPrepare)
	(qemuDomainSnapshotCreateXML): Implement the new flag.

2012-01-11  Eric Blake  <eblake@redhat.com>

	docs: standardize description of flags
	We had loads of different styles in describing the @flags parameter
	for various APIs, as well as several APIs that didn't list which
	enums provided the bit values valid for the flags.

	The end result is one of two formats:
	@flags: bitwise-OR of vir...Flags
	@flags: extra flags; not used yet, so callers should always pass 0

	* src/libvirt.c: Use common sentences for flags.  Also,
	(virDomainGetBlockIoTune): Mention virTypedParameterFlags.
	(virConnectOpenAuth): Mention virConnectFlags.
	(virDomainMigrate, virDomainMigrate2, virDomainMigrateToURI)
	(virDomainMigrateToURI2): Mention virDomainMigrateFlags.
	(virDomainMemoryPeek): Mention virDomainMemoryFlags.
	(virStoragePoolBuild): Mention virStoragePoolBuildFlags.
	(virStoragePoolDelete): Mention virStoragePoolDeleteFlags.
	(virStreamNew): Mention virStreamFlags.
	(virDomainOpenGraphics): Mention virDomainOpenGraphicsFlags.

2012-01-11  Laine Stump  <laine@laine.org>

	qemu: check for kvm availability before starting kvm guests
	This *kind of* addresses:

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

	(it doesn't eliminate the failure to start, but causes libvirt to give
	a better idea about the cause of the failure).

	If a guest uses a kvm emulator (e.g. /usr/bin/qemu-kvm) and the guest
	is started when kvm isn't available (either because virtualization is
	unavailable / has been disabled in the BIOS, or the kvm modules
	haven't been loaded for some reason), a semi-cryptic error message is
	logged:

	  libvirtError: internal error Child process (LC_ALL=C
	  PATH=/sbin:/usr/sbin:/bin:/usr/bin /usr/bin/qemu-kvm -device ? -device
	  pci-assign,? -device virtio-blk-pci,? -device virtio-net-pci,?) status
	  unexpected: exit status 1

	This patch notices at process start that a guest needs kvm, and checks
	for the presence of /dev/kvm (a reasonable indicator that kvm is
	available) before trying to execute the qemu binary. If kvm isn't
	available, a more useful (too verbose??) error is logged.

2012-01-10  Alex Jia  <ajia@redhat.com>

	qemu: fix a typo on qemuDomainSetBlkioParameters
	It should be a copy-paste error, the result is programming will result in an
	infinite loop again due to without iterating 'j' variable.

	* src/qemu/qemu_driver.c: fix a typo on qemuDomainSetBlkioParameters.

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

2012-01-10  Michal Privoznik  <mprivozn@redhat.com>

	Docs: Document Android application using libvirt
	This is actually a patch for VM Manager for Android.

	https://www.redhat.com/archives/libvirt-users/2011-November/msg00076.html

2012-01-10  Jim Fehlig  <jfehlig@suse.com>

	PolicyKit: Check auth before asking client to obtain it
	I previously mentioned [1] a PolicyKit issue where libvirt would
	proceed with authentication even though polkit-auth failed:

	testusr xen134:~> virsh list --all
	Attempting to obtain authorization for org.libvirt.unix.manage.
	polkit-grant-helper: given auth type (8 -> yes) is bogus
	Failed to obtain authorization for org.libvirt.unix.manage.
	 Id Name                 State
	----------------------------------
	  0 Domain-0             running
	  - sles11sp1-pv         shut off

	AFAICT, libvirt attempts to obtain a privilege it already has,
	causing polkit-auth to fail with above message.  Instead of calling
	obtain and then checking auth, IMO the workflow should be for the
	server to check auth first, and if that fails ask the client to
	obtain it and check again.  This workflow also allows for checking
	only successful exit of polkit-auth in virConnectAuthGainPolkit().

	[1] https://www.redhat.com/archives/libvir-list/2011-December/msg00837.html

2012-01-09  Laine Stump  <laine@laine.org>

	qemu: add new disk device='lun' for bus='virtio' & type='block'
	In the past, generic SCSI commands issued from a guest to a virtio
	disk were always passed through to the underlying disk by qemu, and
	the kernel would also pass them on.

	As a result of CVE-2011-4127 (see:
	http://seclists.org/oss-sec/2011/q4/536), qemu now honors its
	scsi=on|off device option for virtio-blk-pci (which enables/disables
	passthrough of generic SCSI commands), and the kernel will only allow
	the commands for physical devices (not for partitions or logical
	volumes). The default behavior of qemu is still to allow sending
	generic SCSI commands to physical disks that are presented to a guest
	as virtio-blk-pci devices, but libvirt prefers to disable those
	commands in the standard virtio block devices, enabling it only when
	specifically requested (hopefully indicating that the requester
	understands what they're asking for). For this purpose, a new libvirt
	disk device type (device='lun') has been created.

	device='lun' is identical to the default device='disk', except that:

	1) It is only allowed if bus='virtio', type='block', and the qemu
	   version is "new enough" to support it ("new enough" == qemu 0.11 or
	   better), otherwise the domain will fail to start and a
	   CONFIG_UNSUPPORTED error will be logged).

	2) The option "scsi=on" will be added to the -device arg to allow
	   SG_IO commands (if device !='lun', "scsi=off" will be added to the
	   -device arg so that SG_IO commands are specifically forbidden).

	Guests which continue to use disk device='disk' (the default) will no
	longer be able to use SG_IO commands on the disk; those that have
	their disk device changed to device='lun' will still be able to use SG_IO
	commands.

	*docs/formatdomain.html.in - document the new device attribute value.
	*docs/schemas/domaincommon.rng - allow it in the RNG
	*tests/* - update the args of several existing tests to add scsi=off, and
	 add one new test that will test scsi=on.
	*src/conf/domain_conf.c - update domain XML parser and formatter

	*src/qemu/qemu_(command|driver|hotplug).c - treat
	 VIR_DOMAIN_DISK_DEVICE_LUN *almost* identically to
	 VIR_DOMAIN_DISK_DEVICE_DISK, except as indicated above.

	Note that no support for this new device value was added to any
	hypervisor drivers other than qemu, because it's unclear what it might
	mean (if anything) to those drivers.

2012-01-09  Laine Stump  <laine@laine.org>

	qemu: add capabilities flags related to SG_IO
	This patch adds two capabilities flags to deal with various aspects
	of supporting SG_IO commands on virtio-blk-pci devices:

	  QEMU_CAPS_VIRTIO_BLK_SCSI
	    set if -device virtio-blk-pci accepts the scsi="on|off" option
	    When present, this is on by default, but can be set to off to disable
	    SG_IO functions.

	  QEMU_CAPS_VIRTIO_BLK_SG_IO
	    set if SG_IO commands are supported in the virtio-blk-pci driver
	    (present since qemu 0.11 according to a qemu developer, if I
	     understood correctly)

2012-01-08  Laine Stump  <laine@laine.org>

	config: report error when script given for inappropriate interface type
	This fixes https://bugzilla.redhat.com/show_bug.cgi?id=638633

	Although scripts are not used by interfaces of type other than
	"ethernet" in qemu, due to the fact that the parser stores the script
	name in a union that is only valid when type is ethernet or bridge,
	there is no way for anyone except the parser itself to catch the
	problem of specifying an interface script for an inappropriate
	interface type (by the time the parsed data gets back to the code that
	called the parser, all evidence that a script was specified is
	forgotten).

	Since the parser itself should be agnostic to which type of interface
	allows scripts (an example of why: a script specified for an interface
	of type bridge is valid for xen domains, but not for qemu domains),
	the solution here is to move the script out of the union(s) in the
	DomainNetDef, always populate it when specified (regardless of
	interface type), and let the driver decide whether or not it is
	appropriate.

	Currently the qemu, xen, libxml, and uml drivers recognize the script
	parameter and do something with it (the uml driver only to report that
	it isn't supported). Those drivers have been updated to log a
	CONFIG_UNSUPPORTED error when a script is specified for an interface
	type that's inappropriate for that particular hypervisor.

	(NB: There was earlier discussion of solving this problem by adding a
	VALIDATE flag to all libvirt APIs that accept XML, which would cause
	the XML to be validated against the RNG files. One statement during
	that discussion was that the RNG shouldn't contain hypervisor-specific
	things, though, and a proper solution to this problem would require
	that (again, because a script for an interface of type "bridge" is
	accepted by xen, but not by qemu).

2012-01-07  Eric Blake  <eblake@redhat.com>

	qemu: one more client to live/config helper
	Commit ae523427 missed one pair of functions that could use
	the helper routine.

	* src/qemu/qemu_driver.c (qemuSetSchedulerParametersFlags)
	(qemuGetSchedulerParametersFlags): Simplify.

2012-01-07  Daniel Veillard  <veillard@redhat.com>

	Release of libvirt-0.9.9
	* configure.ac docs/news.html.in libvirt.spec.in: update for the release
	* po/*.po*: updated localizations from transifex and regenerated

2012-01-07  Eric Blake  <eblake@redhat.com>

	tests: work around pdwtags 1.9 failure
	On rawhide, gcc is new enough to output new DWARF information that
	pdwtags has not yet learned, but the resulting 'make check' output
	was rather confusing:

	$ make -C src check
	...
	  GEN    virkeepaliveprotocol-structs
	die__process_function: DW_TAG_INVALID (0x4109) @ <0x58c> not handled!
	WARNING: your pdwtags program is too old
	WARNING: skipping the virkeepaliveprotocol-structs test
	WARNING: install dwarves-1.3 or newer
	...
	$ pdwtags --version
	v1.9

	I've filed the pdwtags deficiency as
	https://bugzilla.redhat.com/show_bug.cgi?id=772358

	* src/Makefile.am (PDWTAGS): Don't leave -t file behind on version
	mismatch.  Soften warning message, since 1.9 is newer than 1.3.
	Don't leak stderr from broken version.

2012-01-07  Eric Blake  <eblake@redhat.com>

	build: fix mingw virCommand build
	Commit db371a2 mistakenly added new functions inside a #ifndef WIN32
	guard, even though they are needed on all platforms.

	* src/util/command.c (virCommandFDSet): Move outside WIN32
	conditional.

2012-01-07  Eric Blake  <eblake@redhat.com>

	tests: avoid test failure on rawhide gnutls
	I hit a VERY weird testsuite failure on rawhide, which included
	_binary_ output to stderr, followed by a hang waiting for me
	to type something! (Here, using ^@ for NUL):

	$ ./commandtest
	TEST: commandtest
	      WARNING: gnome-keyring:: couldn't send data: Bad file descriptor
	.WARNING: gnome-keyring:: couldn't send data: Bad file descriptor
	.WARNING: gnome-keyring:: couldn't send data: Bad file descriptor
	WARNING: gnome-keyring:: couldn't send data: Bad file descriptor
	.8^@^@^@8^@^@^@^A^@^@^@^Bay^A^@^@^@)PRIVATE-GNOME-KEYRING-PKCS11-PROTOCOL-V-1

	I finally traced it to the fact that gnome-keyring, called via
	gnutls_global_init which is turn called by virNetTLSInit, opens
	an internal fd that it expects to communicate to via a
	pthread_atfork handler (never mind that it violates POSIX by
	using non-async-signal-safe functions in that handler:
	https://bugzilla.redhat.com/show_bug.cgi?id=772320).

	Our problem stems from the fact that we pulled the rug out from
	under the library's expectations by closing an fd that it had
	just opened.  While we aren't responsible for fixing the bugs
	in that pthread_atfork handler, we can at least avoid the bugs
	by not closing the fd in the first place.

	* tests/commandtest.c (mymain): Avoid closing fds that were opened
	by virInitialize.

2012-01-06  Alex Jia  <ajia@redhat.com>

	qemu: Avoid memory leaks on qemuParseRBDString
	Detected by valgrind. Leak introduced in commit 5745dc1.

	* src/qemu/qemu_command.c: fix memory leak on failure and successful path.

	* How to reproduce?
	% valgrind -v --leak-check=full ./qemuargv2xmltest

	* Actual result:

	==2196== 80 bytes in 1 blocks are definitely lost in loss record 3 of 4
	==2196==    at 0x4A05FDE: malloc (vg_replace_malloc.c:236)
	==2196==    by 0x39CF07F6E1: strdup (in /lib64/libc-2.12.so)
	==2196==    by 0x419823: qemuParseRBDString (qemu_command.c:1657)
	==2196==    by 0x4221ED: qemuParseCommandLine (qemu_command.c:5934)
	==2196==    by 0x422AFB: qemuParseCommandLineString (qemu_command.c:7561)
	==2196==    by 0x416864: testCompareXMLToArgvHelper (qemuargv2xmltest.c:48)
	==2196==    by 0x417DB1: virtTestRun (testutils.c:141)
	==2196==    by 0x415CAF: mymain (qemuargv2xmltest.c:175)
	==2196==    by 0x4174A7: virtTestMain (testutils.c:696)
	==2196==    by 0x39CF01ECDC: (below main) (in /lib64/libc-2.12.so)
	==2196==
	==2196== LEAK SUMMARY:
	==2196==    definitely lost: 80 bytes in 1 blocks

2012-01-06  Eric Blake  <eblake@redhat.com>

	build: drop check for ANSI compiler
	Using automake.git (will become 1.12 someday), I got this error:

	configure.ac:90: error: automatic de-ANSI-fication support has been removed
	/usr/local/share/aclocal-1.11a/protos.m4:13: AM_C_PROTOTYPES is expanded from...
	configure.ac:90: the top level
	autom4te: /usr/bin/m4 failed with exit status: 1

	In short, pre-C89 compilers are no longer a viable portability
	target.  Besides, our code base already requires C99, so worrying
	about pre-C89 seems pointless.

	* configure.ac (AM_C_PROTOTYPES): Drop, since newer automake no
	longer provides it.

2012-01-06  Hu Tao  <hutao@cn.fujitsu.com>

	qemu: fix a bug in numatune
	When setting numa nodeset for a domain which has no nodeset set
	before, libvirtd crashes by dereferencing the pointer to the old
	nodemask which is null in that case.

2012-01-06  Eric Blake  <eblake@redhat.com>

	qemu: fix use-after-free regression
	Commit baade4d fixed a memory leak on failure, but in the process,
	introduced a use-after-free on success, which can be triggered with:

	1. set bandwidth with --live
	2. query bandwidth
	3. set bandwidth with --live

	* src/qemu/qemu_driver.c (qemuDomainSetInterfaceParameters): Don't
	free newBandwidth on success.
	Reported by Hu Tao.

2012-01-05  Eric Blake  <eblake@redhat.com>

	seclabel: fix regression in libvirtd restart
	Commit b434329 has a logic bug: seclabel overrides don't set
	def->type, but the default value is 0 (aka static).  Restarting
	libvirtd would thus reject the XML for any domain with an
	override of <seclabel relabel='no'/> (which happens quite
	easily if a disk image lives on NFS), with a message:

	2012-01-04 22:29:40.949+0000: 6769: error : virSecurityLabelDefParseXMLHelper:2593 : XML error: security label is missing

	Fix the logic to never read from an override's def->type, and
	to allow a missing <label> subelement when relabel is no.  There's
	a lot of stupid double-negatives in the code (!norelabel) because
	of the way that we want the zero-initialized defaults to behave.

	* src/conf/domain_conf.c (virSecurityLabelDefParseXMLHelper): Use
	type field from correct location.

2012-01-05  Michal Privoznik  <mprivozn@redhat.com>

	command: Discard FD_SETSIZE limit for opened files
	Currently, virCommand implementation uses FD_ macros from
	sys/select.h. However, those cannot handle more opened files
	than FD_SETSIZE. Therefore switch to generalized implementation
	based on array of integers.

2012-01-05  Jim Fehlig  <jfehlig@suse.com>

	Support Xen domctl v8
	xen-unstable c/s 23874:651aed73b39c added another member to
	xen_domctl_getdomaininfo struct and bumped domctl version to 8.
	Add a corresponding domctl v8 struct in xen hypervisor sub-driver
	and detect domctl v8 during initialization.

	Fix xenstore serial console path for HVM guests
	The console path in xenstore is /local/domain/<id>/console/tty
	for PV guests (PV console) and /local/domain/<id>/serial/0/tty
	(serial console) for HVM guests.  Similar to Xen's in-tree console
	client, read the correct path for PV vs HVM.

2012-01-04  Jiri Denemark  <jdenemar@redhat.com>

	schemas: Allow '.' in CPU feature name
	We already support CPU features with '.' in their name (e.g., sse4.1) so
	we should not forbid that in the schema.

2012-01-04  Michal Privoznik  <mprivozn@redhat.com>

	virCommand: Properly handle POLLHUP
	It is a good practise to set revents to zero before doing any poll().
	Moreover, we should check if event we waited for really occurred or
	if any of fds we were polling on didn't encountered hangup.

2012-01-04  Yuri Chornoivan  <yurchor@ukr.net>

	Fix typos in messages.
	https://bugzilla.redhat.com/show_bug.cgi?id=770954

2012-01-04  Jiri Denemark  <jdenemar@redhat.com>

	virCPUDefCopy forgot to copy NUMA topology
	As a result of it, guest NUMA topology would be lost during migration.

2012-01-03  Eric Blake  <eblake@redhat.com>

	qemu: fix block stat naming
	Typo has existed since API introduction in commit ee0d8c3.

	* src/qemu/qemu_driver.c (qemuDomainBlockStatsFlags): Use correct
	name.

2012-01-03  Eric Blake  <eblake@redhat.com>

	domiftune: clean up previous patches
	Most severe here is a latent (but currently untriggered) memory leak
	if any hypervisor ever adds a string interface property; the
	remainder are mainly cosmetic.

	* include/libvirt/libvirt.h.in (VIR_DOMAIN_BANDWIDTH_*): Move
	macros closer to interface that uses them, and document type.
	* src/libvirt.c (virDomainSetInterfaceParameters)
	(virDomainGetInterfaceParameters): Formatting tweaks.
	* daemon/remote.c (remoteDispatchDomainGetInterfaceParameters):
	Avoid memory leak.
	* src/libvirt_public.syms (LIBVIRT_0.9.9): Sort lines.
	* src/libvirt_private.syms (domain_conf.h): Likewise.
	* src/qemu/qemu_driver.c (qemuDomainSetInterfaceParameters): Fix
	comments, break long lines.

2012-01-03  Peter Krempa  <pkrempa@redhat.com>

	virsh: Fix checking for reconnect conditions
	virshReportError() function frees the most recent error reported from
	libvirt. Condition that checks if connection to the daemon was broken
	during last command was then limited to check for SIGPIPE signal not
	taking into account possible errors signalized without SIGPIPE.

	This patch moves the check before the error is freed, to take into
	account code that does not emit SIGPIPE while failing.

	* tools/virsh.c: - move check for broken connection before error print.

2012-01-03  Peter Krempa  <pkrempa@redhat.com>

	network_conf: Fix whitespace to pass syntax-check

2012-01-02  Michal Novotny  <minovotn@redhat.com>

	Implement DNS SRV record into the bridge driver
	Hi,
	this is the fifth version of my SRV record for DNSMasq patch rebased
	for the current codebase to the bridge driver and libvirt XML file to
	include support for the SRV records in the DNS. The syntax is based on
	DNSMasq man page and tests for both xml2xml and xml2argv were added as
	well. There are some things written a better way in comparison with
	version 4, mainly there's no hack in tests/networkxml2argvtest.c and
	also the xPath context is changed to use a simpler query using the
	virXPathInt() function relative to the current node.

	Also, the patch is also fixing the networkxml2argv test to pass both
	checks, i.e. both unit tests and also syntax check.

	Please review,
	Michal

2012-01-01  Alex Jia  <ajia@redhat.com>

	qemu: Fix bandwidth memory leak on failure
	Detected by Coverity. Leaks introduced in commit e8d6b29.

2012-01-01  Eric Blake  <eblake@redhat.com>

	qemu: fix blkio memory leak on failure
	Leak detected by Coverity, and introduced in commit 93ab585.
	Reported by Alex Jia.

	* src/qemu/qemu_driver.c (qemuDomainSetBlkioParameters): Free
	devices array on error.

2011-12-31  Eric Blake  <eblake@redhat.com>

	docs: re-fix stray /
	Commit 6cb4acc reintroduced the bug fixed in commit d145fe3.

	* docs/formatdomain.html.in (elementsDisks): Fix again.

2011-12-30  Daniel Veillard  <veillard@redhat.com>

	Fix build on s390(x) and other stange arches
	The blocks to extract node information on a per-arch
	basis wasn't well balanced leading to a compilation
	failure if not on one of the handled arches (PCs and PPCs)

2011-12-30  Eric Blake  <eblake@redhat.com>

	seclabel: honor device override in selinux
	This wires up the XML changes in the previous patch to let SELinux
	labeling honor user overrides, as well as affecting the live XML
	configuration in one case where the user didn't specify anything
	in the offline XML.

	I noticed that the logs contained messages like this:

	2011-12-05 23:32:40.382+0000: 26569: warning : SELinuxRestoreSecurityFileLabel:533 : cannot lookup default selinux label for /nfs/libvirt/images/dom.img

	for all my domain images living on NFS.  But if we would just remember
	that on domain creation that we were unable to set a SELinux label (due to
	NFSv3 lacking labels, or NFSv4 not being configured to expose attributes),
	then we could avoid wasting the time trying to clear the label on
	domain shutdown.  This in turn is one less point of NFS failure,
	especially since there have been documented cases of virDomainDestroy
	hanging during an attempted operation on a failed NFS connection.

	* src/security/security_selinux.c (SELinuxSetFilecon): Move guts...
	(SELinuxSetFileconHelper): ...to new function.
	(SELinuxSetFileconOptional): New function.
	(SELinuxSetSecurityFileLabel): Honor override label, and remember
	if labeling failed.
	(SELinuxRestoreSecurityImageLabelInt): Skip relabeling based on
	override.

2011-12-30  Eric Blake  <eblake@redhat.com>

	seclabel: allow a seclabel override on a disk src
	Implement the parsing and formatting of the XML addition of
	the previous commit.  The new XML doesn't affect qemu command
	line, so we can now test round-trip XML->memory->XML handling.

	I chose to reuse the existing structure, even though per-device
	override doesn't use all of those fields, rather than create a
	new structure, in order to reuse more code.

	* src/conf/domain_conf.h (_virDomainDiskDef): Add seclabel member.
	* src/conf/domain_conf.c (virDomainDiskDefFree): Free it.
	(virSecurityLabelDefFree): New function.
	(virDomainDiskDefFormat): Print it.
	(virSecurityLabelDefFormat): Reduce output if model not present.
	(virDomainDiskDefParseXML): Alter signature, and parse seclabel.
	(virSecurityLabelDefParseXML): Split...
	(virSecurityLabelDefParseXMLHelper): ...into new helper.
	(virDomainDeviceDefParse, virDomainDefParseXML): Update callers.
	* tests/qemuxml2argvdata/qemuxml2argv-seclabel-dynamic-override.args:
	New file.
	* tests/qemuxml2xmltest.c (mymain): Enhance test.
	* tests/qemuxml2argvtest.c (mymain): Likewise.

2011-12-30  Eric Blake  <eblake@redhat.com>

	seclabel: extend XML to allow per-disk label overrides
	When doing security relabeling, there are cases where a per-file
	override might be appropriate.  For example, with a static label
	and relabeling, it might be appropriate to skip relabeling on a
	particular disk, where the backing file lives on NFS that lacks
	the ability to track labeling.  Or with dynamic labeling, it might
	be appropriate to use a custom (non-dynamic) label for a disk
	specifically intended to be shared across domains.

	The new XML resembles the top-level <seclabel>, but with fewer
	options (basically relabel='no', or <label>text</label>):

	<domain ...>
	  ...
	  <devices>
	    <disk type='file' device='disk'>
	      <source file='/path/to/image1'>
	        <seclabel relabel='no'/> <!-- override for just this disk -->
	      </source>
	      ...
	    </disk>
	    <disk type='file' device='disk'>
	      <source file='/path/to/image1'>
	        <seclabel relabel='yes'> <!-- override for just this disk -->
	          <label>system_u:object_r:shared_content_t:s0</label>
	        </seclabel>
	      </source>
	      ...
	    </disk>
	    ...
	  </devices>
	  <seclabel type='dynamic' model='selinux'>
	    <baselabel>text</baselabel> <!-- used for all devices without override -->
	  </seclabel>
	</domain>

	This patch only introduces the XML and documentation; future patches
	will actually parse and make use of it.  The intent is that we can
	further extend things as needed, adding a per-device <seclabel> in
	more places (such as the source of a console device), and possibly
	allowing a <baselabel> instead of <label> for labeling where we want
	to reuse the cNNN,cNNN pair of a dynamically labeled domain but a
	different base label.

	First suggested by Daniel P. Berrange here:
	https://www.redhat.com/archives/libvir-list/2011-December/msg00258.html

	* docs/schemas/domaincommon.rng (devSeclabel): New define.
	(disk): Use it.
	* docs/formatdomain.html.in (elementsDisks, seclabel): Document
	the new XML.
	* tests/qemuxml2argvdata/qemuxml2argv-seclabel-dynamic-override.xml:
	New test, to validate RNG.

2011-12-30  Eric Blake  <eblake@redhat.com>

	seclabel: move seclabel stuff earlier
	Pure code motion; no semantic change.

	* src/conf/domain_conf.h (virDomainSeclabelType)
	(virSecurityLabelDefPtr): Declare earlier.
	* src/conf/domain_conf.c (virSecurityLabelDefClear)
	(virSecurityLabelDefParseXML): Move earlier.
	(virDomainDefParseXML): Move seclabel parsing earlier.

2011-12-30  Eric Blake  <eblake@redhat.com>

	seclabel: refactor existing domain_conf usage
	A future patch will parse and output <seclabel> in more than one
	location in a <domain> xml; make it easier to reuse code.

	* src/conf/domain_conf.c (virSecurityLabelDefFree): Rename...
	(virSecurityLabelDefClear): ...and make static.
	(virSecurityLabelDefParseXML): Alter signature.
	(virDomainDefParseXML, virDomainDefFree): Adjust callers.
	(virDomainDefFormatInternal): Split output...
	(virSecurityLabelDefFormat): ...into new helper.

2011-12-30  Eric Blake  <eblake@redhat.com>

	schema: rewrite seclabel rng to match code
	The RNG for <seclabel> was too strict - if it was present, then it
	had to have sub-elements, even if those didn't make sense for the
	given attributes.  Also, we didn't have any tests of <seclabel>
	parsing or XML output.

	In this patch, I added more parsing tests than output tests (since
	the output populates and/or reorders fields not present in certain
	inputs).  Making the RNG reliable is a precursor to using <seclabel>
	variants in more places in the XML in later patches.

	See also:
	http://berrange.com/posts/2011/09/29/two-small-improvements-to-svirt-guest-configuration-flexibility-with-kvmlibvirt/

	* docs/schemas/domaincommon.rng (seclabel): Tighten rules.
	* tests/qemuxml2argvtest.c (mymain): New tests.
	* tests/qemuxml2xmltest.c (mymain): Likewise.
	* tests/qemuxml2argvdata/qemuxml2argv-seclabel-*.*: New files.

2011-12-29  Daniel Veillard  <veillard@redhat.com>

	Require avahi as an rpm dependancy
	As seen in https://bugzilla.redhat.com/show_bug.cgi?id=746111

	If compiled with the daemon and avahi support, then it's better
	to require avahi at the rpm level to avoid daemon startup errors.

2011-12-29  Hu Tao  <hutao@cn.fujitsu.com>

	domiftune: Enable the virDomain{S,G}etInterfaceParameters in virsh
	Add a new command domiftune to get/set interface parameters.

	* tools/virsh.c: implement the new command
	* tools/virsh.pod: documentation of the new command

2011-12-29  Hu Tao  <hutao@cn.fujitsu.com>

	domiftune: Add virDomain{S,G}etInterfaceParameters support to qemu driver
	* src/qemu/qemu_driver.c: implement the qemu driver support

	domiftune: Add a util function virDomainNetFind
	Add a util function virDomainNetFind to find a domain's net def.

	domiftune: Add support of new APIs to the remote driver
	* daemon/remote.c: implement the server side support
	* src/remote/remote_driver.c: implement the client side support
	* src/remote/remote_protocol.x: definitions for the new entry points
	* src/remote_protocol-structs: structure definitions

	domiftune: virDomain{S,G}etInterfaceParameters: the main entry points
	* src/libvirt.c: implement the main entry points

2011-12-29  Hu Tao  <hutao@cn.fujitsu.com>

	domiftune: Add API virDomain{S,G}etInterfaceParameters
	The APIs are used to set/get domain's network interface's parameters.
	Currently supported parameters are bandwidth settings.

	* include/libvirt/libvirt.h.in: new API and parameters definition
	* python/generator.py: skip the Python API generation
	* src/driver.h: add new entry to the driver structure
	* src/libvirt_public.syms: export symbols

2011-12-29  Daniel Veillard  <veillard@redhat.com>

	remove a static limit on max domains in python bindings
	* python/libvirt-override.c: remove the predefined array in the
	  virConnectListDomainsID binding and call virConnectNumOfDomains
	  to do a proper allocation

2011-12-29  Alex Jia  <ajia@redhat.com>

	python: Fix problems of virDomain{Set, Get}BlockIoTune bindings
	The parameter 'params' is useless for virDomainGetBlockIoTune API,
	and the return value type should be a virTypedParameterPtr but not
	integer. And "PyArg_ParseTuple" in functions
	libvirt_virDomain{Set,Get}BlockIoTune misses format unit for "format"
	argument.

	* libvirt-override-api.xml: Remove useless the parameter 'params'
	from virDomainGetBlockIoTune API, and change return value type from
	integer to virTypedParameterPtr.

	* python/libvirt-override.c: Add the missed format units.

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

2011-12-28  Eric Blake  <eblake@redhat.com>

	qemu: fix inf-loop in blkio parameters
	https://bugzilla.redhat.com/show_bug.cgi?id=770520

	We had two nested loops both trying to use 'i' as the iteration
	variable, which can result in an infinite loop when the inner
	loop interferes with the outer loop.  Introduced in commit 93ab585.

	* src/qemu/qemu_driver.c (qemuDomainSetBlkioParameters): Don't
	reuse iteration variable across two loops.

2011-12-28  Lai Jiangshan  <laijs@cn.fujitsu.com>

	virsh: move version command to host group
	Trivial patch, move version command to host commands group.

	It has no any related with any domain.

	It may connect to the daemon, so the flag is 0 but not VSH_CMD_FLAG_NOCONNECT.

2011-12-28  Eric Blake  <eblake@redhat.com>

	daemon: clean up daemonization
	Valgrind detected a pipe fd leak before the parent exits on success,
	introduced in commit 4296cea; by itself, the leak is not bad, since
	we immediately called _exit(), but we might as well be clean to make
	valgrind analysis easier.  Meanwhile, if the daemon grandchild detects
	an error, the parent failed to flush the error message before exiting.
	Also, we had the possibility of both parent and child returning to the
	caller, such that the user could see duplicated reports of failure
	from the two return paths.  And we might as well be robust to the
	(unlikely) situation of being started with stdin closed.

	* daemon/libvirtd.c (daemonForkIntoBackground): Use exit if an
	error message was generated, avoid fd leaks for valgrind's sake,
	avoid returning to caller in both parent and child, and don't
	close a just-dup'd stdin.
	Based on a report by Alex Jia.

	* How to reproduce?
	  % service libvirtd stop
	  % valgrind -v --track-fds=yes /usr/sbin/libvirtd --daemon

	* Actual valgrind result:

	==16804== FILE DESCRIPTORS: 7 open at exit.
	==16804== Open file descriptor 7:
	==16804==    at 0x321FAD8B87: pipe (in /lib64/libc-2.12.so)
	==16804==    by 0x41F34D: daemonForkIntoBackground (libvirtd.c:186)
	==16804==    by 0x4207A0: main (libvirtd.c:1420)

2011-12-26  Satoru SATOH  <satoru.satoh@gmail.com>

	docs: Move 'echo' command description into the generic commands section
	Virsh's echo command looks not having any relations with domains and its
	description should go into the generic commands section instead of the
	domain commands section (current).

	docs: Move 'send-key' command description into the domain commands section
	Virsh's send-key command manipulates domains and its description should
	go into the domain commands section instead of generic commands section
	(current).

2011-12-25  Michal Privoznik  <mprivozn@redhat.com>

	qemu: Keep list of USB devices attached to domains
	In order to avoid situation where a USB device is
	in use by two domains, we must keep a list of already
	attached devices like we do for PCI.

2011-12-24  Eric Blake  <eblake@redhat.com>

	docs: remove stray /
	Commit e5a84d74 added a new attribute in the wrong location;
	commit c8b9fa74 fixed the missing / at the end but not the extra
	/ in the middle.

	* docs/formatdomain.html.in (elementsDisks): Fix another typo.

2011-12-23  Eric Blake  <eblake@redhat.com>

	docs: fix missing / in xml examples
	* docs/formatdomain.html.in: Fix typos in examples.

2011-12-23  Eric Blake  <eblake@redhat.com>

	tests: fix schema checks sorting
	Commit 6fdbce12 attempted to sort the list of tests, but failed
	(without quotes, echo merges all the tests into a single line,
	so there was nothing to sort).

	* tests/schematestutils.sh: Fix thinko in previous patch.

2011-12-23  Michal Privoznik  <mprivozn@redhat.com>

	qemu: Support for overriding NOFILE limit
	This patch adds max_files option to qemu.conf which can be used to
	override system default limit on number of opened files that are
	allowed for qemu user.

2011-12-22  Michal Privoznik  <mprivozn@redhat.com>

	virsh: Use vshWatchJob in cmdManagedSave
	This patch alters saving code, so we can report progress
	and allow cancel via ^C.

	virsh: Use vshWatchJob in cmdSave
	This patch alters saving code, so we can report progress
	and allow cancel via ^C.

	virsh: Use vshWatchJob in cmdDump
	This patch alters dumping code, so we can report progress
	and allow cancel via ^C.

	virsh: Move job watch code to a separate function
	called vshWatchJob. This can be later used in other
	job oriented commands like dump, save, managedsave
	to report progress and allow user to cancel via ^C.

	qemuhelptest: Add new qemuCap flag
	Latest patch a1a83c587443 introduces new qemu capability flag
	QEMU_CAPS_FSDEV_READONLY. However, it was missing in qemuhelptest
	making test for qemu-1.0 fail.

2011-12-22  Osier Yang  <jyang@redhat.com>

	qemu: Support readonly filesystem passthrough
	Upstream QEMU starts to support it from commit 2c74c2cb.

2011-12-21  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	nwfilter: Do not require DHCP requests to be broadcasted
	Remove the requirement that DHCP messages have to be broadcasted.
	DHCP requests are most often sent via broadcast but can be directed
	towards a specific DHCP server. For example 'dhclient' takes '-s <server>'
	as a command line parameter thus allowing DHCP requests to be sent to a
	specific DHCP server.

2011-12-21  Osier Yang  <jyang@redhat.com>

	qemu: Release the lock on domobj if fails on finding the disk path

2011-12-21  Eric Blake  <eblake@redhat.com>

	tests: run schema checks in sorted order
	Having a test that depends on file system timestamps and/or inode
	allocation order gives non-deterministic output.

	* tests/schematestutils.sh: Run test in deterministic order.

2011-12-21  Michael Ellerman  <michael@ellerman.id.au>

	tests: Add fake PPC64 emulator for QEMU testing
	Create a fake PPC64 QEMU so that we can run PPC64 QEMU tests when we
	don't have a real version of the emulator available.

2011-12-21  Michael Ellerman  <michael@ellerman.id.au>

	qemu: Add spapr-vio address assignment
	Add logic to assign addresses for devices with spapr-vio addresses.

	We also do validation of addresses specified by the user, ie. ensuring
	that there are not duplicate addresses on the bus.

2011-12-21  Bharata B Rao  <bharata@linux.vnet.ibm.com>

	Add New address type spapr-vio to domain.rng
	Original patch by Bharata. Updated to use {1,16} in spaprvioReg based
	on example from Eric Blake.

2011-12-21  Michael Ellerman  <michael@ellerman.id.au>

	Add address type for SPAPR VIO devices
	For QEMU PPC64 we have a machine type ("pseries") which has a virtual
	bus called "spapr-vio". We need to be able to create devices on this
	bus, and as such need a way to specify the address for those devices.

	This patch adds a new address type "spapr-vio", which achieves this.

	The addressing is specified with a "reg" property in the address
	definition. The reg is optional, if it is not specified QEMU will
	auto-assign an address for the device.

2011-12-21  Alex Jia  <ajia@redhat.com>

	docs: improve virsh domxml-*-native command docs
	* tools/virsh.pod: improve virsh man page for domxml-from-native and
	domxml-to-native commands.

2011-12-21  Alex Jia  <ajia@redhat.com>

	virsh: plug mem leaks in domxml-*-native
	Detected by valgrind. Leaks introduced in commit 4d5383f.

	* tools/virsh.c: fix memory leaks on cmdDomXMLFromNative and cmdDomXMLToNative.

	* how to reproduce?

	  % virsh dumpxml ${guest} > foo.xml
	  % valgrind -v --leak-check=full virsh domxml-from-native qemu-argv foo.xml
	  % valgrind -v --leak-check=full virsh domxml-to-native qemu-argv foo.xml

	* actual valgrind results:

	==9724== 8,193 bytes in 1 blocks are definitely lost in loss record 31 of 33
	==9724==    at 0x4A05FDE: malloc (vg_replace_malloc.c:236)
	==9724==    by 0x4A06167: realloc (vg_replace_malloc.c:525)
	==9724==    by 0x4C7510B: virReallocN (memory.c:161)
	==9724==    by 0x4C84679: virFileReadLimFD (util.c:394)
	==9724==    by 0x4C84815: virFileReadAll (util.c:455)
	==9724==    by 0x41A89F: cmdDomXMLFromNative (virsh.c:5532)
	==9724==    by 0x414872: vshCommandRun (virsh.c:16464)
	==9724==    by 0x425623: main (virsh.c:17971)
	==9724==
	==9724== LEAK SUMMARY:
	==9724==    definitely lost: 8,193 bytes in 1 blocks
	==9724==    indirectly lost: 0 bytes in 0 blocks
	==9724==      possibly lost: 0 bytes in 0 blocks
	==9724==    still reachable: 127,128 bytes in 1,347 blocks

	==7409== 8,193 bytes in 1 blocks are definitely lost in loss record 31 of 33
	==7409==    at 0x4A05FDE: malloc (vg_replace_malloc.c:236)
	==7409==    by 0x4A06167: realloc (vg_replace_malloc.c:525)
	==7409==    by 0x4C7510B: virReallocN (memory.c:161)
	==7409==    by 0x4C84679: virFileReadLimFD (util.c:394)
	==7409==    by 0x4C84815: virFileReadAll (util.c:455)
	==7409==    by 0x41A7AF: cmdDomXMLToNative (virsh.c:5578)
	==7409==    by 0x414892: vshCommandRun (virsh.c:16463)
	==7409==    by 0x425633: main (virsh.c:17970)
	==7409==
	==7409== LEAK SUMMARY:
	==7409==    definitely lost: 8,193 bytes in 1 blocks
	==7409==    indirectly lost: 0 bytes in 0 blocks
	==7409==      possibly lost: 0 bytes in 0 blocks
	==7409==    still reachable: 127,128 bytes in 1,347 blocks

2011-12-21  Alex Jia  <ajia@redhat.com>

	console: plug memory leaks
	Using 'virReallocN' to allocate memory on virConsoleEventOnStdin,
	virConsoleEventOnStdout and virConsoleEventOnStream, however, the
	cleanup function virConsoleShutdown hasn't released these memory.

	* tools/console.c: fix memory leaks on virConsoleShutdown.

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

2011-12-21  Michael Ellerman  <michael@ellerman.id.au>

	qemu: Add a capability flag for -no-acpi
	Currently non-x86 guests must have <acpi/> defined in <features> to
	prevent libvirt from running qemu with -no-acpi. Although it works, it
	is a hack.

	Instead add a capability flag which indicates whether qemu understands
	the -no-acpi option. Use it to control whether libvirt emits -no-acpi.

	Current versions of qemu always display -no-acpi in their help output,
	so this patch has no effect. However the development version of qemu
	has been modified such that -no-acpi is only displayed when it is
	actually supported.

2011-12-21  Hu Tao  <hutao@cn.fujitsu.com>

	add new command numatune to virsh
	add new command numatune to virsh to get/set numa parameters

	Implement virDomain{G, S}etNumaParameters for the qemu driver

	Add virDomain{G, S}etNumaParameters support to the remote driver

	add new API virDomain{G, S}etNumaParameters
	Set up the types for the numa functions and insert them into the
	virDriver structure definition.

	use cpuset to manage numa
	This patch also sets cgroup cpuset parameters for numatune.

	Add functions to set/get cgroup cpuset parameters

2011-12-20  Eric Blake  <eblake@redhat.com>

	rpc: handle param_int, plug memory leaks
	The RPC code had several latent memory leaks and an attempt to
	free the wrong string, but thankfully nothing triggered them
	(blkiotune was the only one returning a string, and always as
	the last parameter).  Also, our cleanups for rpcgen ended up
	nuking a line of code that renders VIR_TYPED_PARAM_INT broken,
	because it was the only use of 'i' in a function, even though
	it was a member usage rather than a standalone declaration.

	* daemon/remote.c (remoteSerializeTypedParameters): Free the
	correct array element.
	(remoteDispatchDomainGetSchedulerParameters)
	(remoteDispatchDomainGetSchedulerParametersFlags)
	(remoteDispatchDomainBlockStatsFlags)
	(remoteDispatchDomainGetMemoryParameters): Don't leak strings.
	* src/rpc/genprotocol.pl: Don't nuke member-usage of 'buf' or 'i'.

2011-12-20  Eric Blake  <eblake@redhat.com>

	virsh: simplify printing of typed parameters
	No need to repeat code for formatting typed parameters.

	* tools/virsh.c (vshGetTypedParamValue): Support strings, and exit
	on OOM.
	(cmdSchedinfo, cmdBlkiotune, cmdMemtune, cmdBlkdeviotune): Use
	it for less code.

2011-12-20  Eric Blake  <eblake@redhat.com>

	docs: document <qemu:commandline> xml
	Even though we technically don't support <qemu:commandline> (as in,
	if you mis-use things, you get to keep the pieces), we should at
	least document how to use it.

	[See also http://berrange.com/posts/2011/12/19/using-command-line-arg-monitor-command-passthrough-with-libvirt-and-kvm/]

	* docs/drvqemu.html.in (qemucommand): New section.

2011-12-20  Alex Jia  <ajia@redhat.com>

	python: plug memory leak on libvirt_virConnectOpenAuth
	* Detected by valgrind. Leak introduced in commit 5ab109f.

	* python/libvirt-override.c: avoid memory leak on libvirt_virConnectOpenAuth.

	* How to reproduce?

	  % valgrind -v --leak-check=full virt-clone --print-xml
	  Note: it can hit the issue although options are incomplete.

	* Actual valgrind result:

	==1801== 12 bytes in 1 blocks are definitely lost in loss record 25 of 3,270
	==1801==    at 0x4A05FDE: malloc (vg_replace_malloc.c:236)
	==1801==    by 0xCF1F60E: libvirt_virConnectOpenAuth (libvirt-override.c:1507)
	==1801==    by 0x3AFEEDE7F3: PyEval_EvalFrameEx (ceval.c:3794)
	==1801==    by 0x3AFEEDF99E: PyEval_EvalFrameEx (ceval.c:3880)
	==1801==    by 0x3AFEEDF99E: PyEval_EvalFrameEx (ceval.c:3880)
	==1801==    by 0x3AFEEDF99E: PyEval_EvalFrameEx (ceval.c:3880)
	==1801==    by 0x3AFEEDF99E: PyEval_EvalFrameEx (ceval.c:3880)
	==1801==    by 0x3AFEEE0466: PyEval_EvalCodeEx (ceval.c:3044)
	==1801==    by 0x3AFEEE0541: PyEval_EvalCode (ceval.c:545)
	==1801==    by 0x3AFEEFB88B: run_mod (pythonrun.c:1351)
	==1801==    by 0x3AFEEFB95F: PyRun_FileExFlags (pythonrun.c:1337)
	==1801==    by 0x3AFEEFCE4B: PyRun_SimpleFileExFlags (pythonrun.c:941)

2011-12-19  Christophe Fergeau  <cfergeau@redhat.com>

	Fix typo in storage pool documentation
	Remove 2 words that shouldn't be here.

2011-12-19  Daniel P. Berrange  <berrange@redhat.com>

	Disable python explicitly in mingw32 autobuild

2011-12-19  Daniel P. Berrange  <berrange@redhat.com>

	Only add the timer when a callback is registered
	The lifetime of the virDomainEventState object is tied to
	the lifetime of the driver, which in stateless drivers is
	tied to the lifetime of the virConnectPtr.

	If we add & remove a timer when allocating/freeing the
	virDomainEventState object, we can get a situation where
	the timer still triggers once after virDomainEventState
	has been freed. The timeout callback can't keep a ref
	on the event state though, since that would be a circular
	reference.

	The trick is to only register the timer when a callback
	is registered with the event state & remove the timer
	when the callback is unregistered.

	The demo for the bug is to run

	  while true ; do date ; ../tools/virsh -q -c test:///default 'shutdown test; undefine test; dominfo test' ; done

	prior to this fix, it will frequently hang and / or
	crash, or corrupt memory

2011-12-19  Daniel P. Berrange  <berrange@redhat.com>

	Hide use of timers for domain event dispatch
	Currently all drivers using domain events need to provide a callback
	for handling a timer to dispatch events in a clean stack. There is
	no technical reason for dispatch to go via driver specific code. It
	could trivially be dispatched directly from the domain event code,
	thus removing tedious boilerplate code from all drivers

	Also fix the libxl & xen drivers to pass 'true' when creating the
	virDomainEventState, since they run inside the daemon & thus always
	expect events to be present.

	* src/conf/domain_event.c, src/conf/domain_event.h: Internalize
	  dispatch of events from timer callback
	* src/libxl/libxl_driver.c, src/lxc/lxc_driver.c,
	  src/qemu/qemu_domain.c, src/qemu/qemu_driver.c,
	  src/remote/remote_driver.c, src/test/test_driver.c,
	  src/uml/uml_driver.c, src/vbox/vbox_tmpl.c,
	  src/xen/xen_driver.c: Remove all timer dispatch functions

2011-12-19  Daniel P. Berrange  <berrange@redhat.com>

	Remove decl of all APIs related to domain event callbacks & queues
	The virDomainEventCallbackList and virDomainEventQueue APIs are
	now solely helpers used internally by virDomainEventState APIs.
	Remove their decls from domain_event.h since no driver code should
	need to use them any more.

	* src/conf/domain_event.c: Make virDomainEventCallbackList and
	  virDomainEventQueue APIs static & remove some unused APIs
	* src/conf/domain_event.h, src/libvirt_private.syms: Remove
	  virDomainEventCallbackList and virDomainEventQueue APIs

2011-12-19  Daniel P. Berrange  <berrange@redhat.com>

	Remove all domain event structs from header
	No caller of the domain events APIs should need to poke at the
	struct internals. Thus they should all be removed from the
	header file

	* src/conf/domain_event.h: Remove struct definitions
	* src/conf/domain_event.c: Add struct definitions

2011-12-19  Daniel P. Berrange  <berrange@redhat.com>

	Convert drivers to thread safe APIs for adding callbacks
	* src/libxl/libxl_driver.c, src/lxc/lxc_driver.c,
	  src/qemu/qemu_driver.c, src/remote/remote_driver.c,
	  src/test/test_driver.c, src/uml/uml_driver.c,
	  src/vbox/vbox_tmpl.c, src/xen/xen_driver.c: Convert
	  to threadsafe APIs

2011-12-19  Daniel P. Berrange  <berrange@redhat.com>

	Add APIs to allow management of callbacks purely with virDomainEventState
	While virDomainEventState has APIs for managing removal of callbacks,
	while locked, adding callbacks in the first place requires direct
	access to the virDomainEventCallbackList structure. This is not
	threadsafe since it is bypassing the virDomainEventState locks

	* src/conf/domain_event.c, src/conf/domain_event.h,
	  src/libvirt_private.syms: Add APIs for managing callbacks
	  via virDomainEventState.

2011-12-19  Daniel P. Berrange  <berrange@redhat.com>

	Return count of callbacks when registering callbacks
	When registering a callback for a particular event some callers
	need to know how many callbacks already exist for that event.
	While it is possible to ask for a count, this is not free from
	race conditions when threaded. Thus the API for registering
	callbacks should return the count of callbacks. Also rename
	virDomainEventStateDeregisterAny to virDomainEventStateDeregisterID

	* src/conf/domain_event.c, src/conf/domain_event.h,
	  src/libvirt_private.syms: Return count of callbacks when
	  registering callbacks
	* src/libxl/libxl_driver.c, src/libxl/libxl_driver.c,
	  src/qemu/qemu_driver.c, src/remote/remote_driver.c,
	  src/remote/remote_driver.c, src/uml/uml_driver.c,
	  src/vbox/vbox_tmpl.c, src/xen/xen_driver.c: Update
	  for change in APIs

2011-12-19  Daniel P. Berrange  <berrange@redhat.com>

	Convert Xen & VBox drivers to use virDomainEventState
	The Xen & VBox drivers deal with callbacks & dispatching of
	events directly. All the other drivers use a timer to dispatch
	events from a clean stack state, rather than deep inside the
	drivers. Convert Xen & VBox over to virDomainEventState so
	that they match behaviour of other drivers

	* src/conf/domain_event.c: Return count of remaining
	  callbacks when unregistering event callback
	* src/vbox/vbox_tmpl.c, src/xen/xen_driver.c,
	  src/xen/xen_driver.h: Convert to virDomainEventState

2011-12-17  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	nwfilter: do not create ebtables chain unnecessarily
	If only iptables rules are created then two unnecessary ebtables chains
	are also created. This patch fixes this and prevents these chains from
	being created. They have been cleaned up properly, though.

2011-12-16  Eric Blake  <eblake@redhat.com>

	build: disable dtrace on non-Linux builds
	Using dtrace (and systemtap in general) is Linux-specific.
	Running ./autobuild.sh shows that attempting a cross-build to
	target mingw was mistakenly trying to build dtrace code, merely
	because it was present on the compilation host.

	* configure.ac (with_dtrace): Don't attempt to use dtrace when
	doing a cross-build hosted on Linux but targetting elsewhere.
	Reported by Daniel P. Berrange.

2011-12-16  Peter Krempa  <pkrempa@redhat.com>

	migration: Add more specific error code/message on migration abort
	A generic error code was returned, if the user aborted a migration job.
	This made it hard to distinguish between a user requested abort and an
	error that might have occured. This patch introduces a new error code,
	which is returned in the specific case of a user abort, while leaving
	all other failures with their existing code. This makes it easier to
	distinguish between failure while mirgrating and an user requested
	abort.

	 * include/libvirt/virterror.h: - add new error code
	 * src/util/virterror.c: - add message for the new error code
	 * src/qemu/qemu_migration.h: - Emit operation aborted error instead of
	                                operation failed, on migration abort

2011-12-16  Eric Blake  <eblake@redhat.com>

	qemu: detect truncated file as invalid save image
	If managed save fails at the right point in time, then the save
	image can end up with 0 bytes in length (no valid header), and
	our attempts in commit 55d88def to detect and skip invalid save
	files missed this case.

	* src/qemu/qemu_driver.c (qemuDomainSaveImageOpen): Also unlink
	empty file as corrupt.  Reported by Dennis Householder.

2011-12-16  Michal Privoznik  <mprivozn@redhat.com>

	qemu: Don't drop hostdev config until security label restore
	Currently, on device detach, we parse given XML, find the device
	in domain object, free it and try to restore security labels.
	However, in some cases (e.g. usb hostdev) parsed XML contains
	less information than freed device. In usb case it is bus & device
	IDs. These are needed during label restoring as a symlink into
	/dev/bus is generated from them. Therefore don't drop device
	configuration until security labels are restored.

2011-12-16  Peter Krempa  <pkrempa@redhat.com>

	virsh: Add option to undefine storage with domains
	Add an option for virsh undefine command, to remove associated storage
	volumes while undefining a domain. This patch allows the user to remove
	associated (libvirt managed ) storage volumes while undefining a domain.

	The new option --storage for the undefine command takes a string
	argument that consists of comma separated list of target or source path
	of volumes to be undefined. Volumes are removed after the domain has
	been successfully undefined,

	If a volume is not part of a storage pool, the user is warned to remove
	the volume in question himself.

	Option --wipe-storage may be specified along with this, that ensures
	the image is wiped before removing.

	Option --remove-all-storage enables the user to remove all storage. The
	name is chosen long as the users should be aware what they're about to
	do.

2011-12-16  Eric Blake  <eblake@redhat.com>

	build: let autobuild check more code
	Some gcc warnings about no % in a printf format string only
	appear under --disable-nls.  And configure.ac should automatically
	be excluding modules on mingw without us having to be explicit.
	Improving autobuild.sh to stress more combinations can only help.

	* autobuild.sh: Add --disable-nls on first build.  Update mingw
	build to rely more on configure.ac detection.

2011-12-16  Jim Fehlig  <jfehlig@suse.com>

	Fix default migration speed in qemu driver
	In commit 6f84e110 I mistakenly set default migration speed to
	33554432 Mb!  The units of migMaxBandwidth is Mb, with conversion
	handled in qemuMonitor{JSON,Text}SetMigrationSpeed().

	Also, remove definition of QEMU_DOMAIN_FILE_MIG_BANDWIDTH_MAX since
	it is no longer used after reverting commit ef1065cf.

2011-12-15  Osier Yang  <jyang@redhat.com>

	python: Expose blockPeek and memoryPeek in Python binding
	A simple example to show how to use it:

	\#! /usr/bin/python

	import os
	import sys
	import libvirt

	disk = "/var/lib/libvirt/images/test.img"

	conn = libvirt.open(None)
	dom = conn.lookupByName('test')

	mem_contents = dom.memoryPeek(0, 32, libvirt.VIR_MEMORY_VIRTUAL);
	sys.stdout.write(mem_contents)

	% python test.py | hexdump
	0000000 1660 0209 0000 0000 0000 0000 0000 0000
	0000010 0000 0000 0000 0000 d3a0 01d0 0000 0000
	0000020

2011-12-15  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Fix race between async and query jobs
	If an async job run on a domain will stop the domain at the end of the
	job, a concurrently run query job can hang in qemu monitor and nothing
	can be done with that domain from this point on. An attempt to start
	such domain results in "Timed out during operation: cannot acquire state
	change lock" error.

	However, quite a few things have to happen at the right time... There
	must be an async job running which stops a domain at the end. This race
	was reported with dump --crash but other similar jobs, such as
	(managed)save and migration, should be able to trigger this bug as well.
	While this async job is processing its last monitor command, that is a
	query-migrate to which qemu replies with status "completed", a new
	libvirt API that results in a query job must arrive and stay waiting
	until the query-migrate command finishes. Once query-migrate is done but
	before the async job closes qemu monitor while stopping the domain, the
	other thread needs to wake up and call qemuMonitorSend to send its
	command to qemu. Before qemu gets a chance to respond to this command,
	the async job needs to close the monitor. At this point, the query job
	thread is waiting for a condition that no-one will ever signal so it
	never finishes the job.

2011-12-15  Osier Yang  <jyang@redhat.com>

	qemu: Do not free the device from activePciHostdevs if it's in use
	* src/qemu/qemu_hostdev.c (qemuDomainReAttachHostdevDevices):
	pciDeviceListFree(pcidevs) in the end free()s the device even if
	it's in use by other domain, which can cause a race.

	How to reproduce:

	<script>

	virsh nodedev-dettach pci_0000_00_19_0
	virsh start test
	virsh attach-device test hostdev.xml
	virsh start test2

	for i in {1..5}; do
	        echo "[ -- ${i}th time --]"
	        virsh nodedev-reattach pci_0000_00_19_0
	done

	echo "clean up"
	virsh destroy test
	virsh nodedev-reattach pci_0000_00_19_0
	</script>

	Device pci_0000_00_19_0 dettached

	Domain test started

	Device attached successfully

	error: Failed to start domain test2
	error: Requested operation is not valid: PCI device 0000:00:19.0 is in use by domain test

	[ -- 1th time --]
	Device pci_0000_00_19_0 re-attached

	[ -- 2th time --]
	Device pci_0000_00_19_0 re-attached

	[ -- 3th time --]
	Device pci_0000_00_19_0 re-attached

	[ -- 4th time --]
	Device pci_0000_00_19_0 re-attached

	[ -- 5th time --]
	Device pci_0000_00_19_0 re-attached

	clean up
	Domain test destroyed

	Device pci_0000_00_19_0 re-attached

	The patch also fixes another problem, there won't be error like
	"qemuDomainReAttachHostdevDevices: Not reattaching active
	device 0000:00:19.0" in daemon log if some device is in active.
	As pciResetDevice and pciReattachDevice won't be called for
	the device anymore. This is sensible as we already reported
	error when preparing the device if it's active. Blindly trying
	to pciResetDevice & pciReattachDevice on the device and getting
	an error is just redundant.

2011-12-15  Osier Yang  <jyang@redhat.com>

	qemu: Honor the original properties of PCI device when detaching
	This patch fixes two problems:
	    1) The device will be reattached to host even if it's not
	       managed, as there is a "pciDeviceSetManaged".
	    2) The device won't be reattached to host with original
	       driver properly. As it doesn't honor the device original
	       properties which are maintained by driver->activePciHostdevs.

2011-12-15  Wen Congyang  <wency@cn.fujitsu.com>

	spec: fix inverted logic on sanlock
	Commit d336dbdb tried to refactor sanlock to avoid building it
	on RHEL for architectures where it is not available, but used
	the wrong conditional.

	* libvirt.spec.in (with_sanlock): Use %ifarch, not %ifnarch.

2011-12-14  KAMEZAWA Hiroyuki  <kamezawa.hiroyu@jp.fujitsu.com>

	virsh: support multifunction in attach-disk
	PCI <address...> can be specified by attach-disk but multifunction cannot
	be specified. Add --multifunction support.

2011-12-14  Eric Blake  <eblake@redhat.com>

	docs: tweak 'virsh edit' wording
	I was wondering why 'virsh edit' didn't support the same
	'--inactive' option as 'virsh dumpxml'; reading the source
	code showed that --inactive was already implied, and that
	the only way to alter a running guest rather than affecting
	next boot is by hot-plugging individual devices, or by
	something complex like saving the guest and modifying the
	save image.

	* tools/virsh.pod (define, edit): Mention behavior when guest is
	already running.

2011-12-14  Peter Krempa  <pkrempa@redhat.com>

	python: Fix export of virDomainSnapshotListChildrenNames
	Commit f2013c9dd1ce468b8620ee35c232a93ef7026fb0 added implementation of
	virDomainSnapshotListChildrenNames override export, but registration of
	the newly exported function was not added.

	 *python/libvirt-override.c: - register export of function

2011-12-14  Lei Li  <lilei@linux.vnet.ibm.com>

	Provide a helper method virDomainLiveConfigHelperMethod
	This chunk of code below repeated in several functions, factor it into
	a helper method virDomainLiveConfigHelperMethod to eliminate duplicated code
	based on Eric and Adam's suggestion. I have tested it for all the
	relevant APIs changed.

2011-12-13  Peter Krempa  <pkrempa@redhat.com>

	virsh: Print error message if argument parsing fails for cmdNodesuspend
	If parsing of arguments failed, virsh did silently exit returning and
	error state, but not specifying the possible problem.

	 * tools/virsh: cmdNodesuspend: - error handling added

2011-12-13  Alex Jia  <ajia@redhat.com>

	tests: plug memory leak on linuxTestNodeInfo
	Detected by valgrind. Leak introduced in commit 82ff25e.

	* tests/nodeinfotest.c: avoid memory leak on nodeinfo test case.

	* how to reproduce?
	  % cd tests && valgrind -v --leak-check=full ./nodeinfotest

	* actual valgrind result:

	==22147== 65 bytes in 1 blocks are definitely lost in loss record 14 of 29
	==22147==    at 0x4A0610F: realloc (vg_replace_malloc.c:525)
	==22147==    by 0x330D6FED94: __vasprintf_chk (in /lib64/libc-2.12.so)
	==22147==    by 0x426697: virVasprintf (stdio2.h:199)
	==22147==    by 0x426757: virAsprintf (util.c:1695)
	==22147==    by 0x41585F: linuxTestNodeInfo (nodeinfotest.c:108)
	==22147==    by 0x416B21: virtTestRun (testutils.c:141)
	==22147==    by 0x4157EA: mymain (nodeinfotest.c:140)
	==22147==    by 0x416217: virtTestMain (testutils.c:696)
	==22147==    by 0x330D61ECDC: (below main) (in /lib64/libc-2.12.so)
	==22147==
	==22147== LEAK SUMMARY:
	==22147==    definitely lost: 65 bytes in 1 blocks
	==22147==    indirectly lost: 0 bytes in 0 blocks
	==22147==      possibly lost: 0 bytes in 0 blocks
	==22147==    still reachable: 126,126 bytes in 1,341 blocks

2011-12-13  Osier Yang  <jyang@redhat.com>

	storage: Fix a potential crash when creating vol object
	If the vol object is newly created, it increases the volumes count,
	but doesn't decrease the volumes count when do cleanup. It can
	cause libvirtd to crash when one trying to free the volume objects
	like:
	    for (i = 0; i < pool->volumes.count; i++)
	        virStorageVolDefFree(pool->volumes.objs[i]);

	It's more reliable if we add the newly created vol object in the
	end.

2011-12-13  Eric Blake  <eblake@redhat.com>

	docs: document <address> elements in one place
	Improve the documentation of what forms a valid <address> element,
	since these elements appear in numerous devices.

	* docs/formatdomain.html.in (elementsAddress): New section.
	(elementsControllers, elementsUSB, elementsNICS, elementsInput)
	(elementsHub, elementsCharChannel, elementsSound): Refer to it.

2011-12-13  Eric Blake  <eblake@redhat.com>

	build: follow directory install conventions
	Commit 4d9e51f6 fixed a 'make uninstall' failure, but failed
	to follow other conventions already present in src/Makefile.am.
	In particular, we prefer MKDIR_P over mkdir -p, and should
	have a matching rmdir during uninstall for every directory
	created during install (the idea being that uninstall in a
	DESTDIR should be clean, while installation in the final
	system should not fail with non-empty directories left behind).

	* tools/Makefile.am (install-sysconfig, install-initscript)
	(install-systemd): Use MKDIR_P.
	(uninstall-sysconfig, uninstall-initscript, uninstall-systemd):
	Also remove directories.
	* daemon/Makefile.am (install-data-local, install-data-polkit)
	(install-logrotate, install-sysconfig, install-sysctl)
	(install-init-redhat, install-init-upstart, install-init-systemd)
	(install-data-sasl): Use MKDIR_P.
	(uninstall-data-polkit, uninstall-sysconfig, uninstall-sysctl)
	(uninstall-init-redhat, uninstall-init-upstart)
	(uninstall-init-systemd): Also remove directory.
	(uninstall-logrotate): New rule.
	(uninstall-local): Add uninstall-logrotate.

2011-12-12  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Disable EOF processing during qemuDomainDestroy
	When destroying a domain qemuDomainDestroy kills its qemu process and
	starts a new job, which means it unlocks the domain object and locks it
	again after some time. Although the object is usually unlocked for a
	pretty short time, chances are another thread processing an EOF event on
	qemu monitor is able to lock the object first and does all the cleanup
	by itself. This leads to wrong shutoff reason and lifecycle event detail
	and virDomainDestroy API incorrectly reporting failure to destroy an
	inactive domain.

	Reported by Charlie Smurthwaite.

2011-12-12  Michal Privoznik  <mprivozn@redhat.com>

	virsh: Free returned MIME type string
	In terms of documentation to virDomainScreenshot, caller MUST free
	returned value. But virsh was not.

2011-12-12  Osier Yang  <jyang@redhat.com>

	Maint: Update AUTHORs
	Add Rommer in.

2011-12-12  Rommer  <rommer@active.by>

	storage: Activate/deactivate logical volumes only on local node
	Current "-ay | -an" has problems on pool starting/refreshing if
	the volumes are clustered. Rommer has posted a patch to list 2
	months ago.

	https://www.redhat.com/archives/libvir-list/2011-October/msg01116.html

	But IMO we shouldn't skip the inactived vols. So this is a squashed
	patch by Rommer.

2011-12-12  Josh Durgin  <josh.durgin@dreamhost.com>

	security: don't try to label network disks
	Network disks don't have paths to be resolved or files to be checked
	for ownership. ee3efc41e6233e625aa03003bf3127319ccd546f checked this
	for some image label functions, but was partially reverted in a
	refactor.  This finishes adding the check to each security driver's
	set and restore label methods for images.

2011-12-12  Dave Allan  <dallan@redhat.com>

	Fix make uninstall
	Make uninstall currently fails with the following message:

	rmdir /etc/sasl2/
	rmdir: failed to remove `/etc/sasl2/': Directory not empty

	That's fine (correct in fact) so force the command to return success
	with || :

2011-12-10  Laine Stump  <laine@laine.org>

	test: replace deprecated "fedora-13" machine with "pc-0.13"
	One of the xml tests in the test suite was created using a
	now-deprecated qemu machine type ("fedora-13", which was only ever
	valid for Fedora builds of qemu). Although strictly speaking it's not
	necessary to replace it with an actual supported qemu machine type
	(since the xml in question is never actually sent to qemu), this patch
	changes it to the actually-supported "pc-0.13" just for general
	tidiness. (Also, on some Fedora builds which contain a special patch
	to rid the world of "fedora-13", having it mentioned in the test suite
	will cause make check to fail.)

2011-12-10  Laine Stump  <laine@redhat.com>

	network: don't add iptables rules for externally managed networks
	This patch addresses https://bugzilla.redhat.com/show_bug.cgi?id=760442

	When a network has any forward type other than route, nat or none, the
	network configuration should be done completely external to libvirt -
	libvirt only uses these types to allow configuring guests in a manner
	that isn't tied to a specific host (all the host-specific information,
	in particular interface names, port profile data, and bandwidth
	configuration is in the network definition, and the guest
	configuration only references it).

	Due to a bug in the bridge network driver, libvirt was adding iptables
	rules for networks with forward type='bridge' etc. any time libvirtd
	was restarted while one of these networks was active.

	This patch eliminates that error by only "reloading" iptables rules if
	forward type is route, nat, or none.

2011-12-10  Michael Ellerman  <michael@ellerman.id.au>

	qemu: Prepare to cater for more general address assignment
	Currently qemuDomainAssignPCIAddresses() is called to assign addresses
	to PCI devices.

	We need to do something similar for devices with spapr-vio addresses.
	So create one place where address assignment will be done, that is
	qemuDomainAssignAddresses().

2011-12-10  Michael Ellerman  <michael@ellerman.id.au>

	qemu: Add address in qemuBuildChrDeviceStr() on pseries
	For the PPC64 pseries machine type we need to add address information
	for the spapr-vty device.

	qemu: Use spapr-vscsi on pseries machine type
	On the PPC64 pseries machine type we need to use the spapr-vscsi device
	rather than an lsi.

2011-12-10  Eric Blake  <eblake@redhat.com>

	network: allow '-' in model name
	In QEMU PPC64 we have a network device called "spapr-vlan". We can specify
	this using the existing syntax for network devices, however libvirt
	currently rejects "spapr-vlan" in virDomainNetDefParseXML() because of
	the "-". Fix the code to accept "-".

	* src/conf/domain_conf.c (virDomainNetDefParseXML): Allow '-' in
	model name, and be more efficient.
	* docs/schemas/domaincommon.rng: Limit valid model names to match code.
	Based on a patch by Michael Ellerman.

2011-12-10  Michal Privoznik  <mprivozn@redhat.com>

	threadpool: Use while loop on virCondWait
	instead of simple 'if' statement as virCondWait can return
	even if associated condition was not signaled.

	threads: Document spurious wakeups on virCondWait

2011-12-10  Alex Jia  <ajia@redhat.com>

	virsh: plug memory leak on cmdDomblklist
	Detected by valgrind. Leak introduced in commit 88a993b:

	* tools/virsh.c: fix memory leak on cmdDomblklist.

	* how to reproduce?
	  % valgrind -v --leak-check=full virsh domblklist <domain name>

	* actual valgrind result:

	==6573== 1,836 bytes in 1 blocks are definitely lost in loss record 110 of 124
	==6573==    at 0x4A05FDE: malloc (vg_replace_malloc.c:236)
	==6573==    by 0x330D71497D: xdr_string (in /lib64/libc-2.12.so)
	==6573==    by 0x4D26CED: xdr_remote_nonnull_string (remote_protocol.c:30)
	==6573==    by 0x4D28138: xdr_remote_domain_get_xml_desc_ret (remote_protocol.c:1418)
	==6573==    by 0x4D3C0C2: virNetMessageDecodePayload (virnetmessage.c:382)
	==6573==    by 0x4D3279F: virNetClientProgramCall (virnetclientprogram.c:382)
	==6573==    by 0x4D0D50B: callWithFD (remote_driver.c:4339)
	==6573==    by 0x4D0D5AB: call (remote_driver.c:4360)
	==6573==    by 0x4D16EAF: remoteDomainGetXMLDesc (remote_client_bodies.h:861)
	==6573==    by 0x4CF9F4F: virDomainGetXMLDesc (libvirt.c:4098)
	==6573==    by 0x4154D9: cmdDomblklist (virsh.c:1722)
	==6573==    by 0x4149E2: vshCommandRun (virsh.c:16365)
	==6573==
	==6573== 46,009 (352 direct, 45,657 indirect) bytes in 1 blocks are definitely lost in loss record 123 of 124
	==6573==    at 0x4A05FDE: malloc (vg_replace_malloc.c:236)
	==6573==    by 0x3318286DC6: xmlXPathNewContext (in /usr/lib64/libxml2.so.2.7.6)
	==6573==    by 0x4C79AE2: virXMLParseHelper (xml.c:779)
	==6573==    by 0x415512: cmdDomblklist (virsh.c:1726)
	==6573==    by 0x4149E2: vshCommandRun (virsh.c:16365)
	==6573==    by 0x427743: main (virsh.c:17867)
	==6573==
	==6573== LEAK SUMMARY:
	==6573==    definitely lost: 2,188 bytes in 2 blocks
	==6573==    indirectly lost: 45,657 bytes in 332 blocks
	==6573==      possibly lost: 0 bytes in 0 blocks
	==6573==    still reachable: 128,034 bytes in 1,364 blocks
	==6573==         suppressed: 0 bytes in 0 blocks

2011-12-10  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	fix error when parsing ppc64 models on x86 host
	When parsing ppc64 models on an x86 host an out-of-memory error message is displayed due
	to it checking for retcpus being NULL. Fix this by removing the check whether retcpus is NULL
	since we will realloc into this variable.
	Also in the X86 model parser display the OOM error at the location where it happens.

2011-12-10  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	fix memory leak in src/nodeinfo.c
	Fix memory leak:

	==27534== 24 bytes in 1 blocks are definitely lost in loss record 207 of 530
	==27534==    at 0x4A05E46: malloc (vg_replace_malloc.c:195)
	==27534==    by 0x38EC26EC37: vasprintf (in /lib64/libc-2.13.so)
	==27534==    by 0x4E998E6: virVasprintf (util.c:1677)
	==27534==    by 0x4E999F1: virAsprintf (util.c:1695)
	==27534==    by 0x4F1EAAC: nodeGetInfo (nodeinfo.c:593)
	==27534==    by 0x47948F: qemuCapsInitCPU (qemu_capabilities.c:855)
	==27534==    by 0x4796B1: qemuCapsInit (qemu_capabilities.c:915)
	==27534==    by 0x456550: qemuCreateCapabilities (qemu_driver.c:245)
	==27534==    by 0x4578C4: qemudStartup (qemu_driver.c:580)
	==27534==    by 0x4F20886: virStateInitialize (libvirt.c:852)
	==27534==    by 0x420E55: daemonRunStateInit (libvirtd.c:1156)
	==27534==    by 0x4E94C56: virThreadHelper (threads-pthread.c:157)

	Mark this leaked variable as const char * when it is passed into another
	function. 

2011-12-09  Michal Privoznik  <mprivozn@redhat.com>

	threadpool: Don't wait on condition if pool has no workers
	Pool creates new workers dynamically. However, it is possible
	for a pool to have no workers. If we want to free that pool,
	we don't want to wait on quit condition as it will never be
	signaled.

2011-12-09  Jiri Denemark  <jdenemar@redhat.com>

	bridge: Fix forward delay APIs
	Due to copy&paste error in c1df2c14b590b3d68b707aa4f3a570f95a6bc548,
	virNetDevBridge[SG]etSTPDelay APIs were accessing wrong file.

2011-12-09  Peter Krempa  <pkrempa@redhat.com>

	cpu: Add cpu flags supported by newest qemu
	Add support for newly supported Intel cpu features. Newly supported
	flags are: pclmuldq, dtes64, smx, fma, pdcm, movbe, xsave, osxsave and
	avx. This adds support for Intel's Sandy Bridge platform.

	virsh: return correct value from cmdDomIfGetLink
	Reported by Alex Jia <ajia@redhat.com>. Function cmdDomIfGetLink did not
	set a success return value on success path.

2011-12-09  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	Pass the VM's UUID into the nwfilter subsystem
	A preparatory patch for DHCP snooping where we want to be able to
	differentiate between a VM's interface using the tuple of
	<VM UUID, Interface MAC address>. We assume that MAC addresses could
	possibly be re-used between different networks (VLANs) thus do not only
	want to rely on the MAC address to identify an interface.

	At the current 'final destination' in virNWFilterInstantiate I am leaving
	the vmuuid parameter as ATTRIBUTE_UNUSED until the DHCP snooping patches arrive.
	(we may not post the DHCP snooping patches for 0.9.9, though)

	Mostly this is a pretty trivial patch. On the lowest layers, in lxc_driver
	and uml_conf, I am passing the virDomainDefPtr around until I am passing
	only the VM's uuid into the NWFilter calls.

2011-12-09  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	nwfilter: cleanup return codes in nwfilter subsystem
	This patch cleans up return codes in the nwfilter subsystem.

	Some functions in nwfilter_conf.c (validators and formatters) are
	keeping their bool return for now and I am converting their return
	code to true/false.

	All other functions now have failure return codes of -1 and success
	of 0.

	[I searched for all occurences of ' 1;' and checked all 'if ' and
	adapted where needed. After that I did a grep for 'NWFilter' in the source
	tree.]

2011-12-09  Alex Jia  <ajia@redhat.com>

	virsh: plug memory leak on cmdDomIfGetLink() sucessful path
	Detected by valgrind. Leak introduced in commit dc675f3:

	* tools/virsh.c: fix memory leak on cmdDomIfGetLink.

	* how to reproduce?
	  % valgrind -v --leak-check=full virsh domif-getlink <domain name> 0

	* actual valgrind result:

	==13102== 18 bytes in 1 blocks are definitely lost in loss record 9 of 47
	==13102==    at 0x4A05FDE: malloc (vg_replace_malloc.c:236)
	==13102==    by 0x322A6A67DD: xmlStrndup (in /usr/lib64/libxml2.so.2.7.6)
	==13102==    by 0x414892: cmdDomIfGetLink (virsh.c:1538)
	==13102==    by 0x4136A2: vshCommandRun (virsh.c:16363)
	==13102==    by 0x4253FB: main (virsh.c:17865)
	==13102==
	==13102== LEAK SUMMARY:
	==13102==    definitely lost: 18 bytes in 1 blocks
	==13102==    indirectly lost: 0 bytes in 0 blocks
	==13102==      possibly lost: 0 bytes in 0 blocks
	==13102==    still reachable: 127,888 bytes in 1,361 blocks
	==13102==         suppressed: 0 bytes in 0 blocks

2011-12-09  Alex Jia  <ajia@redhat.com>

	virsh: plug memory leak on cmdBlkdeviotune() sucessful path
	Detected by valgrind. Leak introduced in commit e9bd9a0:

	* tools/virsh.c: fix memory leak on cmdBlkdeviotune.

	* how to reproduce?
	  % valgrind -v --leak-check=full virsh blkdeviotune <domain name> <block device>

	* actual valgrind result:

	==12759== 576 bytes in 1 blocks are definitely lost in loss record 18 of 29
	==12759==    at 0x4A04A28: calloc (vg_replace_malloc.c:467)
	==12759==    by 0x42134E: _vshCalloc.clone.2 (virsh.c:422)
	==12759==    by 0x4217CB: cmdBlkdeviotune (virsh.c:6364)
	==12759==    by 0x4136A2: vshCommandRun (virsh.c:16363)
	==12759==    by 0x4253FB: main (virsh.c:17865)
	==12759==
	==12759== LEAK SUMMARY:
	==12759==    definitely lost: 576 bytes in 1 blocks
	==12759==    indirectly lost: 0 bytes in 0 blocks
	==12759==      possibly lost: 0 bytes in 0 blocks
	==12759==    still reachable: 126,964 bytes in 1,342 blocks
	==12759==         suppressed: 0 bytes in 0 blocks

2011-12-09  Eric Blake  <eblake@redhat.com>

	maint: allow bootstrap in a sandbox
	Jiri Denemark reported an instance of bootstrapping libvirt
	failing when run inside a sandbox, traced to rpm trying to
	access /var/ which was not permitted by the sandbox.

	Alex Jia reported that 0.9.8-rc1 failed to bootstrap if patch(1)
	is not installed.

	* bootstrap.conf (buildreq): Avoid rpm call if python-config
	exists.  Also, require patch, in case we have gnulib-local diffs.

2011-12-09  Laine Stump  <laine@redhat.com>

	test: fix potential lock corruption in test driver
	In some error situations, the function testDomainRestoreFlags() could
	unlock the test driver mutex without first locking it. This patch
	moves the lock operation earlier, so that it occurs before any
	potential jump down to the unlock call.

	I found this problem while auditing the test driver lock usage to
	determine the cause of a hang while running the following test:

	  cd tests; while true; do printf x; ./undefine; done

	This patch *does not* solve that problem, but we now understand its
	actual source, and danpb is working on a patch.

2011-12-09  Eric Blake  <eblake@redhat.com>

	spec: fix logic bug in deciding to turn on cgconfig
	https://bugzilla.redhat.com/show_bug.cgi?id=738725

	Commit ecd8725 tried to silence a spurious warning on the initial
	libvirt install, and commit ba6cbb1 tried to fix up the logic to the
	correct Fedora version, but the warning was still present due to a
	logic bug: since %{fedora} and %{rhel} are never simulatanously
	set, then 0%{rhel} <= 6 made the %if always true.  Checking for
	minimum versions (via >=) is okay, but checking for maximum versions
	(via <=) requires a prerequisite test that the platform being tested
	is non-zero.

	Also fix a bogus setting of with_libxl (although we previously
	hard-code with_libxl to 0 for rhel earlier in the file, so this
	was not as severe a bug).

	* libvirt.spec.in (with_cgconfig): Don't enable cgconfig on F16.

2011-12-09  Eric Blake  <eblake@redhat.com>

	spec: make it easier to autoreconf when building rpm
	Over time, Fedora and RHEL RPMs have often backported upstream
	patches that touched configure.ac and/or Makefile.am; this
	necessitates rerunning the autotools for the patch to be effective.
	Making this a one-liner spec tweak will make it easier for future
	backports to pull patches without having to find all the places
	to touch to properly use the autotools.  Meanwhile, there have been
	historical instances where an update in the autotools caused FTBFS
	situations, so this is not on by default.

	* libvirt.spec.in (enable_autotools): New variable, default off.
	(BuildRequires): Conditionally add autotools.
	(%build): Conditionally use them before configure.
	* mingw32-libvirt.spec.in: Likewise.

2011-12-08  Daniel P. Berrange  <berrange@redhat.com>

	When checking nttyFDs to see if it is != 1, be sure to use '1' and not '-1'
	* src/lxc/lxc_controller.c: Fix check for tty count

2011-12-08  Daniel P. Berrange  <berrange@redhat.com>

	Fix installation of libvirt-guests.service
	The installation rules for the libvirt-guests.service were
	totally broken

	 - Installing in the wrong location
	 - The location was not overridable
	 - The install-systemd rule was not invoked anywhere
	 - The install-systemd rule was not invoking install-initscript
	   which it depends on
	 - The installed service file lacked a .service extension

	* tools/Makefile.am: Fix install of libvirt-guests.service

2011-12-08  Daniel P. Berrange  <berrange@redhat.com>

	Ensure to prefix %{buildroot} when overriding systemd install location
	The %makeinstall macro does not set DESTDIR, instead of explicitly
	prefixes %{buildroot} onto all paths. Thus we need to do the same
	when setting the systemd unit dir

	* libvirt.spec.in: Prefix %{buildroot} onto %{unitdir}

2011-12-08  Bharata B Rao  <bharata@linux.vnet.ibm.com>

	Add ppc64 specific definitions to domain.rng
	ppc64 as new arch type and pseries as new machine type are
	added under <os> ...  </os>.

2011-12-08  Prerna Saxena  <prerna@linux.vnet.ibm.com>

	Clean up qemuBuildCommandLine to remove x86-specific
	 assumptions from generic code.

	This implements the minimal set of changes needed in libvirt to launch a
	PowerPC-KVM based guest.
	It removes x86-specific assumptions about choice of serial driver backend
	from generic qemu guest commandline generation code.
	It also restricts the ACPI capability to be available for an x86 or
	x86_64 domain.
	This is not a complete solution -- it still does not guarantee libvirt
	the capability to flag non-supported options in guest XML. (Eg, an ACPI
	specification in a PowerPC guest XML will still get processed, even
	though qemu-system-ppc64 does not support it while qemu-system-x86_64 does.)
	This drawback exists because libvirt falls back on qemu to query supported
	features, and qemu '-h' blindly lists all capabilities -- irrespective
	of whether they are available while emulating a given architecture or not.
	The long-term solution would be for qemu to list out capabilities based
	on architecture and platform -- so that libvirt can cleanly make out what
	devices are supported on an arch (say 'ppc64') and platform (say, 'mac99').

2011-12-08  Prerna Saxena  <prerna@linux.vnet.ibm.com>

	Add support for ppc64 qemu
	This enables libvirt to select the correct qemu binary (qemu-system-ppc64)
	for a guest vm based on arch 'ppc64'.
	Also, libvirt is enabled to correctly parse the list of supported PowerPC
	CPUs, generated by running 'qemu-system-ppc64 -cpu ?'

	Acked-by: Stefan Berger <stefanb@linux.vnet.ibm.com>

2011-12-08  Prerna Saxena  <prerna@linux.vnet.ibm.com>

	Modify the tests/nodeinfotest.c to use sysfs in addition
	 to proc/cpuinfo

	This patch creates a new sysfs hierarchy under
	tests/nodeinfodata/linux-nodeinfo-sysfs-test-1.
	Output files and /proc/cpuinfo files are also respectively added for
	both x86 and ppc64.

2011-12-08  Prerna Saxena  <prerna@linux.vnet.ibm.com>

	Use sysfs to gather host topology, in place of
	 /proc/cpuinfo

	Libvirt at present depends on /proc/cpuinfo to gather host
	details such as CPUs, cores, threads, etc. This is an architecture-
	dependent approach. An alternative is to use 'Sysfs', which provides
	a platform-agnostic interface to parse host CPU topology.

2011-12-08  Christophe Fergeau  <cfergeau@redhat.com>

	maint: move my name to commiters
	Since I have commit rights on libvirt-glib, I can also push to
	libvirt, Eric Blake told to move my name up to committers to better
	reflect reality.

2011-12-08  Daniel Veillard  <veillard@redhat.com>

	Release of libvirt-0.9.8
	* configure.ac docs/news.html.in libvirt.spec.in: updated for the release
	* po/*.po*: fetched localization update and regenerated

2011-12-08  Eric Blake  <eblake@redhat.com>

	spec: don't use chkconfig --list
	https://bugzilla.redhat.com/show_bug.cgi?id=694403 reports that
	the specfile is incorrectly checking for a running libvirt-guests
	service.  For example,

	$ LC_ALL=es_ES chkconfig --list libvirt-guests
	libvirt-guests 	  0:desactivado		 1:desactivado	   2:desactivado     3:activo	 4:activo  5:activo	    6:desactivado

	will fail to find 5:on, even though it is active.  But chkconfig
	already has a mode where you can silently use the exit status to
	check for an active service.

	* libvirt.spec.in (%post): Use simpler chkconfig options, to avoid
	issues with localization.

2011-12-08  Eric Blake  <eblake@redhat.com>

	build: fix build with older libxml2
	On RHEL 5, with libxml2-2.6.26, the build failed with:
	virsh.c: In function 'vshNodeIsSuperset':
	virsh.c:11951: warning: implicit declaration of function 'xmlChildElementCount'

	(or if warnings aren't errors, a link failure later on).

	* src/util/xml.h (virXMLChildElementCount): New prototype.
	* src/util/xml.c (virXMLChildElementCount): New function.
	* src/libvirt_private.syms (xml.h): Export it.
	* tools/virsh.c (vshNodeIsSuperset): Use it.

2011-12-08  Daniel P. Berrange  <berrange@redhat.com>

	Fix updating of haveTheBuck in RPC client to be race-free
	When one thread passes the buck to another thread, it uses
	virCondSignal to wake up the target thread. The variable
	'haveTheBuck' is not updated in a race-free manner when
	this occurs. The current thread sets it to false, and the
	woken up thread sets it to true. There is a window where
	a 3rd thread can come in and grab the buck.

	Even if this didn't lead to crashes & deadlocks, this would
	still result in unfairness in the buckpassing algorithm.

	A better solution is to *never* set haveTheBuck to false
	when we're passing the buck. Only set it to false when there
	is no further thread waiting for the buck.

	* src/rpc/virnetclient.c: Only set haveTheBuck to false
	  if no thread is waiting

2011-12-08  Daniel P. Berrange  <berrange@redhat.com>

	Revert fd066925440ba48acc95d8f31b2c98b1cc9d582d
	Commit fd066925440ba48acc95d8f31b2c98b1cc9d582d tried to fix
	a race condition in

	  commit fa9595003d043df9f2efe95521c00898cef27106
	  Author: Daniel P. Berrange <berrange@redhat.com>
	  Date:   Fri Nov 11 15:28:41 2011 +0000

	    Explicitly track whether the buck is held in remote client

	Unfortunately there is a second race condition whereby the
	event loop can trigger due to incoming data to read. Revert
	this fix, so a complete fix for the problem can be cleanly
	applied

	* src/rpc/virnetclient.c: Revert fd066925440ba48acc95d8f31b2c98b1cc9d582d

2011-12-08  Jim Fehlig  <jfehlig@suse.com>

	Prevent crash of libvirtd when attaching to existing qemu process
	With security_driver set to "none" in /etc/libvirt/qemu.conf,
	libvirtd would crash when attempted to attach to an existing
	qemu process.  Only copy the security model if it actually exists.

2011-12-08  Christophe Fergeau  <cfergeau@redhat.com>

	Add documentation for <disk><source type="dir">

	Fix typo in virDomainResume API doc
	It's referring to virSuspendDomain instead of
	virDomainSuspend.

2011-12-07  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Ignore shutdown event from destroyed domain
	During virDomainDestroy, QEMU may emit SHUTDOWN event as a response to
	SIGTERM and since domain object is still locked, the event is processed
	after the domain is destroyed. We need to ignore this event in such case
	to avoid changing domain state from shutoff to shutdown.

2011-12-07  Osier Yang  <jyang@redhat.com>

	npiv: Expose fabric_name outside
	This patch is to expose the fabric_name of fc_host class, which
	might be useful for users who wants to known which fabric the
	(v)HBA connects to.

	The patch also adds the missed capabilities' XML schema of scsi_host,
	(of course, with fabric_wwn added), and update the documents
	(docs/formatnode.html.in)

2011-12-07  Daniel P. Berrange  <berrange@redhat.com>

	Conditionalize daemonPath decl for Win32 which lacks UNIX sockets

2011-12-07  Daniel P. Berrange  <berrange@redhat.com>

	Improve error reporting when libvirtd is not installed
	Currently if you try to connect to a local libvirtd when
	libvirtd is not in $PATH, you'll get an error

	  error: internal error invalid use of command API

	This is because remoteFindDaemonPath() returns NULL, which
	causes us to pass NULL into virNetSocketConnectUNIX which
	in turn causes us to pass NULL into virCommandNewArgList.

	Adding missing error checks improves this to

	  error: internal error Unable to locate libvirtd daemon in $PATH

	* src/remote/remote_driver.c: Report error if libvirtd
	  cannot be found
	* src/rpc/virnetsocket.c: Report error if caller requested
	  spawning of daemon, but provided no binary path

2011-12-06  Eric Blake  <eblake@redhat.com>

	spec: fix sanlock dependency
	* libvirt.spec.in (with_sanlock): On RHEL, don't force sanlock
	on architectures where it isn't available.

2011-12-06  Eric Blake  <eblake@redhat.com>

	spec: add dmidecode as prereq
	https://bugzilla.redhat.com/show_bug.cgi?id=754909 complains that
	because libvirt didn't require dmidecode, that the logs are noisy
	and virConnectGetSysinfo needlessly fails.  Even 'virt-what' requires
	dmidecode, so it's not that onerous of a dependency.  We may be
	able to drop this in the future when we move to parsing sysfs data,
	but for now, listing the dependency will help matters.

	* libvirt.spec.in (Requires): Sort Requires before BuildRequires.
	Add dmidecode.

2011-12-06  Eric Blake  <eblake@redhat.com>

	build: reduce warnings from older gcc
	Older gcc warns (on every file!) that -Wabi and -Wdeprecated only
	make sense on C++ projects.  Newer gcc accepts these warnings for
	C, but it is not clear that they can do anything useful, so it
	is easier to just drop the warnings altogether.

	* m4/virt-compile-warnings.m4 (LIBVIRT_COMPILE_WARNINGS): Silence
	-Wabi and -Wdeprecated on older gcc.
	Reported by Peter Krempa.

2011-12-06  Jiri Denemark  <jdenemar@redhat.com>

	examples: Update event tests for shutdown event

2011-12-05  Daniel P. Berrange  <berrange@redhat.com>

	Fix incorrect symbols for virtime.h module breaking Mingw32
	The Mingw32 linker highlighted that the symbols for virtime.h
	declared in libvirt_private.syms were incorrect

	* src/libvirt_private.syms: Fix virtime.h symbols

2011-12-05  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Rework handling of shutdown event
	When QEMU guest finishes its shutdown sequence, qemu stops virtual CPUs
	and when started with -no-shutdown waits for us to kill it using
	SGITERM. Since QEMU is flushing its internal buffers, some time may pass
	before QEMU actually dies. We mistakenly used "paused" state (and
	events) for this which is quite confusing since users may see a domain
	going to pause while they expect it to shutdown. Since we already have
	"shutdown" state with "the domain is being shut down" semantics, we
	should use it for this state.

	However, the state didn't have a corresponding event so I created one
	and called its detail as VIR_DOMAIN_EVENT_SHUTDOWN_FINISHED (guest OS
	finished its shutdown sequence) with the intent to add
	VIR_DOMAIN_EVENT_SHUTDOWN_STARTED in the future if we have a
	sufficiently capable guest agent that can notify us when guest OS starts
	to shutdown.

2011-12-05  Guido Günther  <agx@sigxcpu.org>

	remote_driver: don't fail if keepalive check fails
	Otherwise connections to older libvirt abort with:

	$ virsh -c qemu+ssh://host.example.com/system list
	error: invalid connection pointer in virDrvSupportsFeature
	error: failed to connect to the hypervisor

	Tested against 0.8.3 and 0.9.8-rc2.

2011-12-05  Jiri Denemark  <jdenemar@redhat.com>

	Add support for QEMU 1.0

2011-12-05  Peter Krempa  <pkrempa@redhat.com>

	python: Expose binding for virNodeGetMemoryStats()
	This patch adds binding for virNodeGetMemoryStats method of libvirtd.
	Return value is represented as a python dictionary mapping field
	names to values.

	python: Expose binding for virNodeGetCPUStats()
	This patch adds binding for virNodeGetCPUStats method of libvirtd.
	Return value is represented as a python dictionary mapping field names
	to values.

2011-12-04  Eric Blake  <eblake@redhat.com>

	maint: fix improper use of 'an'
	https://bugzilla.redhat.com/show_bug.cgi?id=648855 mentioned a
	misuse of 'an' where 'a' is proper; that has since been fixed,
	but a search found other problems (some were a spelling error for
	'and', while most were fixed by 'a').

	* daemon/stream.c: Fix grammar.
	* src/conf/domain_conf.c: Likewise.
	* src/conf/domain_event.c: Likewise.
	* src/esx/esx_driver.c: Likewise.
	* src/esx/esx_vi.c: Likewise.
	* src/rpc/virnetclient.c: Likewise.
	* src/rpc/virnetserverprogram.c: Likewise.
	* src/storage/storage_backend_fs.c: Likewise.
	* src/util/conf.c: Likewise.
	* src/util/dnsmasq.c: Likewise.
	* src/util/iptables.c: Likewise.
	* src/xen/xen_hypervisor.c: Likewise.
	* src/xen/xend_internal.c: Likewise.
	* src/xen/xs_internal.c: Likewise.
	* tools/virsh.c: Likewise.

2011-12-04  Eric Blake  <eblake@redhat.com>

	build: require more tools from maintainers
	We want our tarballs to be complete - this means that any
	generated file that gets shipped as part of the tarball so that
	ordinary users don't have to rebuild it must be something
	that the maintainer can generate.  There have been various
	reports of random build failures when using libvirt.git
	instead of a tarball, and often it is due to missing a
	maintainer-specific tool to produce one of these generated
	files.  This patch raises the bar for what you must have
	installed to build libvirt.git, but does not impact what
	you can get away with for building tarballs.

	Note: It still remains possible to do a successful 'make dist'
	without these tools, when starting from a release tarball.

	* bootstrap.conf (buildreq): Add tools that maintainers need for a
	successful 'make dist' from a fresh git checkout.

2011-12-04  Eric Blake  <eblake@redhat.com>

	command: handle empty buffer argument correctly
	virBufferContentAndReset (intentionally) returns NULL for a buffer
	with no content, but it is feasible to invoke a command with an
	explicit empty string.

	* src/util/command.c (virCommandAddEnvBuffer): Reject empty string.
	(virCommandAddArgBuffer): Allow explicit empty argument.
	* tests/commandtest.c (test9): Test it.
	* tests/commanddata/test9.log: Adjust.

2011-12-04  Eric Blake  <eblake@redhat.com>

	build: fix build on Cygwin
	The RPC fixups needed on Linux are also needed on cygwin, and
	worked without further tweaking to the list of fixups.  Also,
	unlike BSD, Cygwin exports 'struct ifreq', but unlike Linux,
	Cygwin lacks the ioctls that we were using 'struct ifreq' to
	access.  This patch allows compilation under cygwin.

	* src/rpc/genprotocol.pl: Also perform fixups on cygwin.
	* src/util/virnetdev.c (HAVE_STRUCT_IFREQ): Also require AF_PACKET
	definition.
	* src/util/virnetdevbridge.c (virNetDevSetupControlFull): Only
	compile if SIOCBRADDBR works.

2011-12-03  Eric Blake  <eblake@redhat.com>

	build: fix build at -O2 on rawhide
	I had previously tested commit 059d746 with -O intentionally omitted
	from my CFLAGS; but that means that I missed out on this warning
	from gcc 4.6.2 when optimizations are enabled:

	util/buf.c: In function 'virBufferGetIndent':
	util/buf.c:86:1: error: function might be candidate for attribute 'pure' [-Werror=suggest-attribute=pure]

	While it is probably a good idea to add the attributes and silence
	this warning, it's also invasive; 'make -k' found more than 75 such
	complaints.  And it doesn't help that gcc 4.6.2 is still buggy
	(coreutils reported a case where gcc 4.6.2 incorrectly suggested
	marking a function pure that incremented a global variable; fixed
	in gcc 4.7).  So the best fix for now is to disable the warning.

	It also doesn't help that I stumbled across another problem - gcc
	documents that -Wsuggest-attribute=pure only warns if you use -O,
	or if you use -fipa-pure-const.  But in practice, when I omitted -O
	but added -fipa-pure-const, the warnings are fickle - I got warnings
	for simple compilation that disappeared when I also added -fPIC.
	And the way libtool compiles things is with -fPIC first, then without
	-fPIC but with errors sent to /dev/null - which meant that without
	disabling -Wsuggest-attribute=pure, I got a compile error with no
	message.  :(  See http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10197

	* m4/virt-compile-warnings.m4 (LIBVIRT_COMPILE_WARNINGS): Silence
	-Wsuggest-attribute warnings for now.

2011-12-03  Serge Hallyn  <serge.hallyn@canonical.com>

	apparmor: allow tunnelled migrations.
	The pathname for the pipe for tunnelled migration is unresolvable.  The
	libvirt apparmor driver therefore refuses access, causing migration to
	fail.  If we can't resolve the path, the worst that can happen is that
	we should have given permission to the file but didn't.  Otherwise
	(especially since this is a /proc/$$/fd/N file) the file is already open
	and libvirt won't be refused access by apparmor anyway.

	Also adjust virt-aa-helper to allow access to the
	*.tunnelmigrate.dest.name files.

	For more information, see https://launchpad.net/bugs/869553.

2011-12-02  Peter Krempa  <pkrempa@redhat.com>

	client: Check if other thread claims it has the buck before claiming it.
	Originaly, the code checked if another client is the queue and infered
	ownership of the buck from that. Commit fa9595003d043df9f2efe95521c008
	added a separate variable to track the buck. That caused, that a new
	call might enter claiming it has the buck, while another thread was
	signalled to take the buck. This ends in two threads claiming they hold
	the buck and entering poll(). This happens due to a race on waking up
	threads on the client lock mutex.

	This caused multi-threaded clients to hang, most prominently visible and
	reproducible on python based clients, like virt-manager.

	This patch causes threads, that have been signalled to take the buck to
	re-check if buck is held by another thread.

2011-12-02  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	Update of filters to handle multiple IP addresses
	With fragments borrowed from David Steven's previous submission and some
	further modifications:

	A set of modifications to filters to handle multiple IP addresses
	(and MAC addresses) per interface.

	Also:
	- enable DHCP traffic from VM to any DHCP server
	- will require an update to a libvirt-tck data file

2011-12-02  Eric Blake  <eblake@redhat.com>

	virsh: translate net-info help
	Reported by kato.tomoyuki@jp.fujitsu.com at
	https://bugzilla.redhat.com/show_bug.cgi?id=749564

	* tools/virsh.c (info_network_info): Mark string for translation.

2011-12-02  Eric Blake  <eblake@redhat.com>

	maint: typo fixes
	Many of these were mentioned by Yuri Chornoivan in:
	https://bugzilla.redhat.com/show_bug.cgi?id=669506

	* src/esx/esx_vi.c (esxVI_WaitForTaskCompletion): Fix spelling.
	* src/conf/netdev_vport_profile_conf.c
	(virNetDevVPortProfileParse): Likewise.
	* src/xen/xend_internal.c (xenDaemonDomainSetVcpusFlags):
	Likewise.
	* src/xen/xm_internal.c (xenXMDomainSetVcpusFlags): Likewise.
	* src/esx/esx_util.c (esxUtil_ResolveHostname): Likewise.
	* src/storage/storage_backend_fs.c
	(virStorageBackendFileSystemBuild): Likewise.
	* daemon/libvirtd.conf: Likewise.
	* src/util/logging.c (virLogMessage): Likewise.
	* src/uml/uml_conf.c (umlBuildCommandLineNet): Likewise.
	* src/vmx/vmx.c (virVMXFormatEthernet): Likewise.

2011-12-02  Eric Blake  <eblake@redhat.com>

	build: update to latest gnulib
	* .gnulib: Update to latest, for improved 'make syntax-check' and
	compiler warnings.
	* m4/virt-compile-warnings.m4 (LIBVIRT_COMPILE_WARNINGS):
	Re-silence -Wformat-nonliteral.
	* cfg.mk (_test_script_regex): Recognize our test scripts.
	* gnulib/local/lib/*.diff: Drop, now that gnulib has this.
	* tests/virsh-optparse: Fix use of compare.
	* tests/virsh-schedinfo: Likewise.

2011-12-02  Eric Blake  <eblake@redhat.com>

	build: properly skip tests
	I got this failure on FreeBSD:

	shunloadtest.c: In function 'main':
	shunloadtest.c:150: error: 'EXIT_AM_SKIP' undeclared (first use in this function)

	but inspection showed several other problems, all fixed here.

	* tests/domainsnapshotxml2xmltest.c [!WITH_QEMU]: Ensure
	EXIT_AM_SKIP is defined.
	* tests/esxutilstest.c [!WITH_ESX]: Likewise.
	* tests/openvzutilstest.c [!WITH_OPENVZ]: Likewise.
	* tests/qemuargv2xmltest.c [!WITH_QEMU]: Likewise.
	* tests/qemuhelptest.c [!WITH_QEMU]: Likewise.
	* tests/qemuxml2argvtest.c [!WITH_QEMU]: Likewise.
	* tests/qemuxml2xmltest.c [!WITH_QEMU]: Likewise.
	* tests/qemuxmlnstest.c [!WITH_QEMU]: Likewise.
	* tests/shunloadtest.c [!linux]: Likewise.
	* tests/vmx2xmltest.c [!WITH_VMX]: Likewise.
	* tests/xml2vmxtest.c [!WITH_VMX]: Likewise.

2011-12-02  Daniel P. Berrange  <berrange@redhat.com>

	Avoid crash in shunloadtest
	For unknown reasons, the shunloadtest will crash on Fedora 16
	inside dlopen()

	 (gdb) bt
	 #0  0x00000000000050e6 in ?? ()
	 #1  0x00007ff61a77b9d5 in floor () from /lib64/libm.so.6
	 #2  0x00007ff61e522963 in _dl_relocate_object () from /lib64/ld-linux-x86-64.so.2
	 #3  0x00007ff61e5297e6 in dl_open_worker () from /lib64/ld-linux-x86-64.so.2
	 #4  0x00007ff61e525006 in _dl_catch_error () from /lib64/ld-linux-x86-64.so.2
	 #5  0x00007ff61e52917a in _dl_open () from /lib64/ld-linux-x86-64.so.2
	 #6  0x00007ff61e0f6f26 in dlopen_doit () from /lib64/libdl.so.2
	 #7  0x00007ff61e525006 in _dl_catch_error () from /lib64/ld-linux-x86-64.so.2
	 #8  0x00007ff61e0f752f in _dlerror_run () from /lib64/libdl.so.2
	 #9  0x00007ff61e0f6fc1 in dlopen@@GLIBC_2.2.5 () from /lib64/libdl.so.2
	 #10 0x0000000000400a15 in main (argc=<optimized out>, argv=<optimized out>) at shunloadtest.c:105

	Changing from RTLD_NOW to RTLD_LAZY avoids this problem,
	but quite possibly does not fix the root cause.

	* shunloadtest.c: s/NOW/LAZY/

2011-12-02  Daniel P. Berrange  <berrange@redhat.com>

	Fix build for platforms lacking struct ifreq
	This ought to fix the build if you have net/if.h but do
	not have struct ifreq

	* configure.ac: Check for struct ifreq in net/if.h
	* src/util/virnetdev.c: Conditionalize to avoid use of
	  struct ifreq if it does not exist

2011-12-02  Eric Blake  <eblake@redhat.com>

	build: fix 'make dist' without dtrace
	probes.h can only be generated on Linux, and then only with dtrace
	installed.  If it is part of the tarball, then either 'make dist'
	will fail if you don't have that setup, or we would have to start
	keeping probes.h in libvirt.git.  Since we only need it to be
	generated when dtrace is in use, it's better to avoid shipping
	it in the first place, and avoid tracking it in git.

	Meanwhile, there is a build dependency - since the RPC code is
	generated, it can be built early; but when dtrace is enabled, we
	must ensure probes.h is built even earlier.  Commit 1afcfbdd tried
	to fix this, but did so in a way that added probes.h into the
	tarball, and broke VPATH as well.  Commit ecbca767 fixed VPATH,
	but didn't fix the more fundamental problem.  This patch solves
	the issue by adding a dependency instead.

	Tested with 'make dist' in a clean VPATH builds, for both
	'./configure --without-dtrace' and './configure --with-dtrace';
	all configurations were able to correctly build a tarball, and
	the dtrace configuration no longer sticks probes.h in the tarball.

	* src/Makefile.am (REMOTE_DRIVER_GENERATED): Don't ship probes.h;
	rather, make it a dependency.

2011-12-01  Lei Li  <lilei@linux.vnet.ibm.com>

	Fix a logic error for setting block I/O
	Fix a logic error, the initial value of ret = -1, if just set --config,
	it will goto endjob directly without doing its really job here.

2011-12-01  Daniel P. Berrange  <berrange@redhat.com>

	Don't use undocumented __isleap macro
	The glibc time.h header has an undocumented __isleap macro
	that we are using. Since it is undocumented & does not appear
	on any other OS, stop using it and just define the macro in
	libvirt code instead.

	* src/util/virtime.c: Remove __isleap usage

2011-12-01  Michal Privoznik  <mprivozn@redhat.com>

	virsh: Allow other escape characters for console
	Currently virsh supports only ^] as escape character for console.
	However, some users might want to use something else. This patch
	creates such ability by specifying '-e' switch on virsh command
	line.

2011-12-01  Peter Krempa  <pkrempa@redhat.com>

	bridge_driver: Don't define network if XML contains more IPv4 adreses.
	Only one IPv4 DHCP definition is supported. Originally the code checked
	for a multiple definition and returned an error, but the new domain
	definition was already added to networks. This patch moves the check
	before the newly defined network is added to active networks.

	 *src/network/bridge_driver.c: networkDefine(): - move multiple IPv4
	                                                  addresses check before
	                                                  definition is used.

2011-12-01  Eric Blake  <eblake@redhat.com>

	spec: mark directories in /var/run as ghosts
	We have several directories that are created on the fly, and which
	only contain state relevant to a running libvirtd process (all
	located in /var/run).  Since the directories are created as needed,
	and make no sense without a running libvirtd, we want them deleted
	if libvirt is uninstalled.  And in F15 and newer, /var/run is on
	tmpfs (forcing us to recreate on the fly); which means that someone
	trying to verify a complete rpm will fail if the directory does not
	currently exist because libvirtd has not been started since boot.
	The solution, then, is to mark the directories as %ghost, so that
	rpm knows that we own them and will clean it up if libvirt is
	uninstalled, but will no longer create the directory for us at
	install, nor complain at verify time if the directory does not exist.

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

	* libvirt.spec.in (%files): Add %ghost to temporary directories
	that we don't install, but want cleaned up on libvirt removal.

2011-12-01  Jiri Denemark  <jdenemar@redhat.com>

	virsh: Fix possible deadlock when virsh is about to exit
	Not only was ctl->quit accessed without a mutex but unfortunately,
	virEventAddTimeout only interrupts the poll when event loop is running
	so the hack needs to add a timeout that will make next poll return
	immediately without blocking.

2011-12-01  Alex Jia  <ajia@redhat.com>

	util: Plug memory leak on virNetDevMacVLanCreateWithVPortProfile() error path
	Detected by Coverity. Leak introduced in commit 90074ec.

2011-12-01  Alex Jia  <ajia@redhat.com>

	util: Plug memory leak on virNetDevBridgeGet() sucessful path
	Detected by Coverity. Leak introduced in commit c1df2c1.

	Two bugs here:
	1. memory leak on successful parse
	2. failure to parse still returned success

2011-12-01  Alex Jia  <ajia@redhat.com>

	uml: Plug memory leak on umlStartVMDaemon() error path
	Detected by Coverity.  Leak introduced in commit 8866eed.

	Two bugs here:
	1. logfd wasn't closed on all return paths
	2. if we failed to mark a domain autodestroy, then the domain
	was not made transient but we still returned success

2011-12-01  Alex Jia  <ajia@redhat.com>

	rpc: Plug memory leak on virNetClientSendInternal() error path
	Detected by Coverity. Leak introduced in commit 673adba.

	Two separate bugs here:
	1. call was not freed on all error paths
	2. virCondDestroy was called even if virCondInit failed

2011-12-01  Alex Jia  <ajia@redhat.com>

	conf: Plug memory leak on virDomainDefParseXML() error path
	Detected by Coverity. Leak introduced in commit 0873b68.

	qemu: Plug memory leak onqemuProcessWaitForMonitor() error path
	Detected by Coverity. Leak introduced in commit 109efd7.

2011-12-01  Prerna Saxena  <prerna@linux.vnet.ibm.com>

	Add PPC cpu driver.
	To add support for running libvirt on PowerPC, a CPU driver for the
	PowerPC platform must be added.
	Most generic cpu driver routines such as CPU compare, decode, etc
	are based on CPUID comparison and are not relevant for non-x86
	platforms.
	Here, we introduce stubs for relevant PowerPC routines invoked by libvirt.

2011-12-01  Hu Tao  <hutao@cn.fujitsu.com>

	qemu: filter blkio 0-device-weight at two other places
	filter 0-device-weight when:

	  - getting blkio parameters with --config
	  - starting up a domain

	When testing with blkio, I found these issues:

	  (dom is down)
	  virsh blkiotune dom --device-weights /dev/sda,300,/dev/sdb,500
	  virsh blkiotune dom --device-weights /dev/sda,300,/dev/sdb,0
	  virsh blkiotune dom
	  weight         : 800
	  device_weight  : /dev/sda,200,/dev/sdb,0

	  # issue 1: shows 0 device weight of /dev/sdb that may confuse user

	  (continued)
	  virsh start dom

	  # issue 2: If /dev/sdb doesn't exist, libvirt refuses to bring the
	  # dom up because it wants to set the device weight to 0 of a
	  # non-existing device. Since 0 means no weight-limit, we really don't
	  # have to set it.

2011-12-01  Eric Blake  <eblake@redhat.com>

	qemu: amend existing table of device weights
	Prior to this patch, for a running dom, the commands:

	$ virsh blkiotune dom --device-weights /dev/sda,502,/dev/sdb,498
	$ virsh blkiotune dom --device-weights /dev/sda,503
	$ virsh blkiotune dom
	weight         : 500
	device_weight  : /dev/sda,503

	claim that /dev/sdb no longer has a non-default weight, but
	directly querying cgroups says otherwise:

	$ cat /cgroup/blkio/libvirt/qemu/dom/blkio.weight_device
	8:0     503
	8:16    498

	After this patch, an explicit 0 is required to remove a device path
	from the XML, and omitting a device path that was previously
	specified leaves that device path untouched in the XML, to match
	cgroups behavior.

	* src/qemu/qemu_driver.c (parseBlkioWeightDeviceStr): Rename...
	(qemuDomainParseDeviceWeightStr): ...and use correct type.
	(qemuDomainSetBlkioParameters): After parsing string, modify
	rather than replacing existing table.
	* tools/virsh.pod (blkiotune): Tweak wording.

2011-12-01  Eric Blake  <eblake@redhat.com>

	conf: reject duplicate paths in device weights
	The next patch will make it possible to have virDomainSetBlkioParameters
	leave device weights unchanged if they are not mentioned in the incoming
	string, but this only works if the list of block weights does not allow
	duplicate paths.  Technically, a user can still confuse libvirt by
	passing alternate spellings that resolve to the same device, but it
	is not worth worrying about working around that kind of abuse.

	* src/conf/domain_conf.c (virDomainDefParseXML): Require unique
	paths.

2011-12-01  Hu Tao  <hutao@cn.fujitsu.com>

	virsh: fix setting weight and device-weights at the same time
	When setting both blkio weight and device-weights at the same time, the weight
	is lost. Fix it.

2011-12-01  Lei Li  <lilei@linux.vnet.ibm.com>

	Add tests for blkdeviotune

	Support virDomain{Set, Get}BlockIoTune in the python API
	Python support for both setting and getting block I/O throttle.

	Enable the blkdeviotune command in virsh
	Support virsh command blkdeviotune. Can set or query a block disk
	I/O throttle setting.

	Implement virDomain{Set, Get}BlockIoTune for the qemu driver
	Implement the block I/O throttle setting and getting support to qemu
	driver.

	Support block I/O throttle in XML
	Enable block I/O throttle for per-disk in XML, as the first
	per-disk IO tuning parameter.

	Add virDomain{Set, Get}BlockIoTune support to the remote driver
	Support Block I/O Throttle setting and query to remote driver.

2011-11-30  Daniel P. Berrange  <berrange@redhat.com>

	Fix leak build config file path
	* src/libvirt.c: Free user directory path

2011-11-30  Daniel P. Berrange  <berrange@redhat.com>

	Remove time APIs from src/util/util.h
	The virTimestamp and virTimeMs functions in src/util/util.h
	duplicate functionality from virtime.h, in a non-async signal
	safe manner. Remove them, and convert all code over to the new
	APIs.

	* src/util/util.c, src/util/util.h: Delete virTimeMs and virTimestamp
	* src/lxc/lxc_driver.c, src/qemu/qemu_domain.c,
	  src/qemu/qemu_driver.c, src/qemu/qemu_migration.c,
	  src/qemu/qemu_process.c, src/util/event_poll.c: Convert to use
	  virtime APIs

2011-11-30  Daniel P. Berrange  <berrange@redhat.com>

	Make logging async signal safe wrt time stamp generation
	Use the new virTimeStringNowRaw() API for generating log timestamps
	in an async signal safe manner

	* src/util/logging.c: Use virTimeStringNowRaw

2011-11-30  Daniel P. Berrange  <berrange@redhat.com>

	Add internal APIs for dealing with time
	The logging APIs need to be able to generate formatted timestamps
	using only async signal safe functions. This rules out using
	gmtime/localtime/malloc/gettimeday(!) and much more.

	Introduce a new internal API which is async signal safe.

	  virTimeMillisNowRaw replacement for gettimeofday. Uses clock_gettime
	                      where available, otherwise falls back to the unsafe
	                      gettimeofday

	  virTimeFieldsNowRaw  replacements for gmtime(), convert a timestamp
	  virTimeFieldsThenRaw into a broken out set of fields. No localtime()
	                       replacement is provided, because converting to
	                       local time is not practical with only async signal
	                       safe APIs.

	  virTimeStringNowRaw  replacements for strftime() which print a timestamp
	  virTimeStringThenRaw into a string, using a pre-determined format, with
	                       a fixed size buffer (VIR_TIME_STRING_BUFLEN)

	For each of these there is also a version without the Raw postfix
	which raises a full libvirt error. These versions are not async
	signal safe

	* src/Makefile.am, src/util/virtime.c, src/util/virtime.h: New files
	* src/libvirt_private.syms: New APis
	* configure.ac: Check for clock_gettime in -lrt
	* tests/virtimetest.c, tests/Makefile.am: Test new APIs

2011-11-30  Daniel P. Berrange  <berrange@redhat.com>

	Remove obsolete virGetPMCapabilities sym from private symbols file
	Fix the build on Mingw32 by removing the now obsolete
	virGetPMCapabilities symbol from the private exports file

	* src/libvirt_private.syms: Remove virGetPMCapabilities

2011-11-30  Daniel P. Berrange  <berrange@redhat.com>

	Don't mark suspend as active until we know it is running
	If suspend failed for some reason (e.g. too short duration) then
	subsequent attempts to trigger suspend were rejected because we
	had already marked a suspend as being in progress

	* src/util/virnodesuspend.c: Don't mark suspend as active
	  until we've successfully triggered it

2011-11-30  Daniel P. Berrange  <berrange@redhat.com>

	Add suspend info to Xen, LXC and UML hypervisor capabilities
	* src/lxc/lxc_conf.c, src/uml/uml_conf.c,
	  src/xen/xen_hypervisor.c: Initialize suspend capabilities
	* tests/xencapsdata/*xml: Add empty powermgmt capabilities

2011-11-30  Daniel P. Berrange  <berrange@redhat.com>

	Remove pointless strdup in node suspend code
	The command name for the suspend action does not need to be
	strdup'd. The constant string can be used directly. This
	also means the code can be trivially rearranged to make the
	switch clearer

	* src/util/virnodesuspend.c: Remove strdup of cmdString

2011-11-30  Daniel P. Berrange  <berrange@redhat.com>

	Do lazy init of host PM features
	To avoid probing the host power management features on any
	call to virInitialize, only initialize the mutex in
	virNodeSuspendInit. Do lazy load of the supported PM target
	mask when it is actually needed

	* src/util/virnodesuspend.c: Lazy init of supported features

2011-11-30  Daniel P. Berrange  <berrange@redhat.com>

	Remove powerMgmt_valid field from capabilities struct
	If we ensure that virNodeSuspendGetTargetMask always resets
	*bitmask to zero upon failure, there is no need for the
	powerMgmt_valid field.

	* src/util/virnodesuspend.c: Ensure *bitmask is zero upon
	  failure
	* src/conf/capabilities.c, src/conf/capabilities.h: Remove
	  powerMgmt_valid field
	* src/qemu/qemu_capabilities.c: Remove powerMgmt_valid

2011-11-30  Daniel P. Berrange  <berrange@redhat.com>

	Add export of node suspend capabilities APIs
	* src/libvirt_private.syms: Export virNodeSuspendSupportsTarget
	  and virNodeSuspendGetTargetMask

2011-11-30  Daniel P. Berrange  <berrange@redhat.com>

	Move suspend capabilities APIs out of util.h into virnodesuspend.c
	The node suspend capabilities APIs should not have been put into
	util.[ch]. Instead move them into virnodesuspend.[ch]

	* src/util/util.c, src/util/util.h: Remove suspend capabilities APIs
	* src/util/virnodesuspend.c, src/util/virnodesuspend.h: Add
	  suspend capabilities APIs
	* src/qemu/qemu_capabilities.c: Include virnodesuspend.h

2011-11-30  Daniel P. Berrange  <berrange@redhat.com>

	Rename suspend capabilities APIs
	Rename virGetPMCapabilities to virNodeSuspendGetTargetMask and
	virDiscoverHostPMFeature to virNodeSuspendSupportsTarget.

	* src/util/util.c, src/util/util.h: Rename APIs
	* src/qemu/qemu_capabilities.c, src/util/virnodesuspend.c: Adjust
	  for new names

2011-11-30  Daniel P. Berrange  <berrange@redhat.com>

	Sanitize virDiscoverHostPMFeature to return a boolean
	Since virDiscoverHostPMFeature is just checking one feature,
	there is no reason for it to return a bitmask. Change it to
	return a boolean

	* src/util/util.c, src/util/util.h: Make virDiscoverHostPMFeature
	  return a boolean

2011-11-30  Daniel P. Berrange  <berrange@redhat.com>

	Move the virHostPMCapability enum helpers into capabilities.c
	The virHostPMCapability enum helper was declared in util.h
	but implemented in capabilities.c, which is in a completely
	separate library at link time. Move the declaration into the
	capabilities.c file and rename it to match normal conventions

	* src/util/util.h: Remove virHostPMCapability enum decl
	* src/conf/capabilities.c: Add virCapsHostPMTarget enum

2011-11-30  Daniel P. Berrange  <berrange@redhat.com>

	Fix capabilities XML to use generic terms for suspend targets
	The capabilities XML uses the x86 specific terms 'S3', 'S4'
	and 'Hybrid-Syspend'. Switch it to use the same terminology
	as the API constants and virsh options, eg 'suspend_mem'
	'suspend_disk' and 'suspend_hybrid'

	* docs/formatcaps.html.in, docs/schemas/capability.rng,
	  src/conf/capabilities.c: Rename suspend constants

2011-11-30  Daniel P. Berrange  <berrange@redhat.com>

	Remove internal only virHostPMCapability enum
	The internal virHostPMCapability enum just duplicates the
	public virNodeSuspendTarget enum, but with different names.

	* src/util/util.c: Use VIR_NODE_SUSPEND_TARGET constants
	* src/util/util.h: Remove virHostPMCapability enum
	* src/conf/capabilities.c: Use VIR_NODE_SUSPEND_TARGET_LAST

2011-11-30  Daniel P. Berrange  <berrange@redhat.com>

	Fix values of PM target type constants
	The VIR_NODE_SUSPEND_TARGET constants are not flags, so they
	should just be assigned straightforward incrementing values.

	* include/libvirt/libvirt.h.in: Change VIR_NODE_SUSPEND_TARGET
	  values
	* src/util/virnodesuspend.c: Fix suspend target checks

2011-11-30  Alex Jia  <ajia@redhat.com>

	util: avoid null deref on qcowXGetBackingStore
	Detected by Coverity. the only case is caller passes a NULL to 'format' variable,
	then taking 'if (format)' false branch, the function qcow2GetBackingStoreFormat
	will directly dereferences the NULL 'format' pointer variable.

2011-11-30  Alex Jia  <ajia@redhat.com>

	virsh: correct return value error
	Fix cmdDomblklist to return 'true' on success instead of '0'

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

2011-11-30  Lei Li  <lilei@linux.vnet.ibm.com>

	Add new API virDomain{Set, Get}BlockIoTune
	This patch add new pulic API virDomainSetBlockIoTune and
	virDomainGetBlockIoTune.

2011-11-30  Hu Tao  <hutao@cn.fujitsu.com>

	blkiotune: add qemu support for blkiotune.device_weight
	Implement setting/getting per-device blkio weights in qemu,
	using the cgroups blkio.weight_device tunable.

2011-11-30  Hu Tao  <hutao@cn.fujitsu.com>

	blkiotune: add interface for blkiotune.device_weight
	This adds per-device weights to <blkiotune>.  Note that the
	cgroups implementation only supports weights per block device,
	and not per-file within the device; hence this option must be
	global to the domain definition rather than tied to individual
	<devices>/<disk> entries:

	<domain ...>
	  <blkiotune>
	    <device>
	      <path>/path/to/block</path>
	      <weight>1000</weight>
	    </device>
	  </blkiotune>
	..

	This patch also adds a parameter --device-weights to virsh command
	blkiotune for setting/getting blkiotune.weight_device for any
	hypervisor that supports it.  All <device> entries under
	<blkiotune> are concatenated into a single string attribute under
	virDomain{Get,Set}BlkioParameters, named "device_weight".

2011-11-30  Eric Blake  <eblake@redhat.com>

	qemu: fix blkiotune --live --config
	Without this,  'virsh blkiotune --live --config --weight=n'
	only affected live.

	* src/qemu/qemu_driver.c (qemuDomainSetBlkioParameters): Allow
	setting both configurations at once.

2011-11-30  Eric Blake  <eblake@redhat.com>

	qemu, lxc: drop redundant checks
	After the previous patch, there are now some redundant checks.

	* src/qemu/qemu_driver.c (qemudDomainGetVcpuPinInfo)
	(qemuGetSchedulerParametersFlags): Drop checks now guaranteed by
	libvirt.c.
	* src/lxc/lxc_driver.c (lxcGetSchedulerParametersFlags):
	Likewise.

2011-11-30  Eric Blake  <eblake@redhat.com>

	API: prevent query of --live and --config at once
	Drivers were inconsistent when presented both --live and --config
	at once.  For example, within qemu, getting memory parameters
	favored live, getting blkio tuning favored config, and getting
	scheduler parameters errored out.  Also, some, but not all,
	attempts to mix flags on query were filtered at the virsh level.
	We shouldn't have to duplicate efforts in every client app, nor
	in every driver.  So, it is simpler to just enforce that the two
	flags cannot both be used at once on query operations, which has
	precedent in libvirt.c, and which matches the documentation of
	virDomainModificationImpact.

	* src/libvirt.c (virDomainGetMemoryParameters)
	(virDomainGetBlkioParameters)
	(virDomainGetSchedulerParametersFlags, virDomainGetVcpuPinInfo):
	Borrow sanity checking from virDomainGetVcpusFlags.

2011-11-30  Eric Blake  <eblake@redhat.com>

	build: fix typo in last patch
	* src/remote_protocol-structs: Use correct RPC name.

2011-11-29  Osier Yang  <jyang@redhat.com>

	block_resize: Update test file for RPC
	Pushed under build failure rule.

	block_resize: Expose the new API to virsh

2011-11-29  Osier Yang  <jyang@redhat.com>

	block_resize: Implement qemu driver method
	It requires the domain is running, otherwise fails. Resize to a lower
	size is supported, but should be used with extreme caution.

	In order to prohibit the "size" overflowing after multiplied by
	1024. We do checking in the codes. For QMP mode, the default units
	is Bytes, the passed size needs to be multiplied by 1024, however,
	for HMP mode, the default units is "Megabytes", the passed "size"
	needs to be divided by 1024 then.

2011-11-29  Osier Yang  <jyang@redhat.com>

	block_resize: Implement qemu monitor functions
	Implements functions for both HMP and QMP mode.

	For HMP mode, qemu uses "M" as the units by default, so the passed "sized"
	is divided by 1024.

	For QMP mode, qemu uses "Bytes" as the units by default, the passed "sized"
	is multiplied by 1024.

	All of the monitor functions return -1 on failure, 0 on success, or -2 if
	not supported.

2011-11-29  Osier Yang  <jyang@redhat.com>

	block_resize: Wire up the remote protocol

2011-11-29  Osier Yang  <jyang@redhat.com>

	block_resize: Define the new API
	The new API is named as "virDomainBlockResize", intending to add
	support for qemu monitor command "block_resize" (both HMP and QMP).

	Similar with APIs like "virDomainSetMemoryFlags", the units for
	argument "size" is kilobytes.

2011-11-29  Michal Privoznik  <mprivozn@redhat.com>

	bandwidth: Fix funky identation

2011-11-29  Jiri Denemark  <jdenemar@redhat.com>

	virsh: Fix typos in man page

	lxc: Fix suspend/resume with freezer cgroup

2011-11-29  Osier Yang  <jyang@redhat.com>

	examples: Correct the example command to use testnode.xml
	 * s/-connection/-c/
	 * Removes the redundant '/'.
	 * Add "absolute" so that it's more clear.

	Pushed under trivial rule.

2011-11-29  Srivatsa S. Bhat  <srivatsa.bhat@linux.vnet.ibm.com>

	Add virsh command to initiate suspend on the host
	Add a new command 'nodesuspend' to perform a timed suspend on the host.

2011-11-29  Srivatsa S. Bhat  <srivatsa.bhat@linux.vnet.ibm.com>

	Implement the core API to suspend/resume the host
	Add the core functions that implement the functionality of the API.
	Suspend is done by using an asynchronous mechanism so that we can return
	the status to the caller before the host gets suspended. This asynchronous
	operation is achieved by suspending the host in a separate thread of
	execution. However, returning the status to the caller is only best-effort,
	but not guaranteed.

	To resume the host, an RTC alarm is set up (based on how long we want to
	suspend) before suspending the host. When this alarm fires, the host
	gets woken up.

	Suspend-to-RAM operation on a host running Linux can take upto more than 20
	seconds, depending on the load of the system. (Freezing of tasks, an operation
	preceding any suspend operation, is given up after a 20 second timeout).
	And Suspend-to-Disk can take even more time, considering the time required
	for compaction, creating the memory image and writing it to disk etc.
	So, we do not allow the user to specify a suspend duration of less than 60
	seconds, to be on the safer side, since we don't want to prematurely declare
	failure when we only had to wait for some more time.

2011-11-29  Srivatsa S. Bhat  <srivatsa.bhat@linux.vnet.ibm.com>

	Add the remote protocol implementation for virNodeSuspendForDuration
	Implement the remote protocol for virNodeSuspendForDuration() API.

	Add a public API to invoke suspend/resume on the host
	Implement the public definitions for the new API
	virNodeSuspendForDuration() which will be subsequently used to
	do a timed suspend on the host.

	Add 'Hybrid-Suspend' power management discovery for the host
	Some systems support a feature known as 'Hybrid-Suspend', apart from the
	usual system-wide sleep states such as Suspend-to-RAM (S3) or Suspend-to-Disk
	(S4). Add the functionality to discover this power management feature and
	export it in the capabilities XML under the <power_management> tag.

2011-11-29  Jiri Denemark  <jdenemar@redhat.com>

	rpc: Really send non-blocking calls while waiting for another call
	When another thread was dispatching while we wanted to send a
	non-blocking call, we correctly queued the call and woke up the thread
	but the thread just threw the call away since it forgot to recheck if
	its socket was writable.

2011-11-29  Michal Privoznik  <mprivozn@redhat.com>

	virsh: Don't traverse childless nodes in vshNodeIsSuperset
	If both nodes do not have any children, we pass zero to
	virBitmapAlloc which returns NULL. In turn we report OOM error
	and return false (meaning nodes are different). This is not true.

2011-11-29  Christian Franke  <nobody@nowhere.ws>

	virnetsocket: pass XAUTORITY for ssh connection
	When spawning an ssh connection, the environment variables
	DISPLAY, SSH_ASKPASS, ... are passed. However XAUTHORITY,
	which is necessary if the .Xauthority is in a non default
	place, was not passed.

2011-11-29  Lorin Hochstein  <lorin@isi.edu>

	conf: make virt-xml-validate work with vbox domains
	virt-xml-validate fails when run on a domain XML file of type 'vbox'.

	For failing test case, see https://bugzilla.redhat.com/show_bug.cgi?id=757097

	This patch updates the XML schema to accept all valid hypervisor
	types, as well as dropping hypervisor types that are not in use
	by the current code base.

2011-11-28  Michal Privoznik  <mprivozn@redhat.com>

	conf: Improve incorrect root element error messages
	When user pass wrong root element, it is not 'internal error' and
	we can give him hint what we are expecting.

2011-11-28  Daniel P. Berrange  <berrange@redhat.com>

	Refactor initial LXC mem tune / device ACL code
	To make lxcSetContainerResources smaller, pull the mem tune
	and device ACL setup code out into separate methods

	* src/lxc/lxc_controller.c: Introduce lxcSetContainerMemTune
	  and lxcSetContainerDeviceACL

2011-11-28  Daniel P. Berrange  <berrange@redhat.com>

	Add support for blkio tuning of LXC containers
	* src/lxc/lxc_controller.c: Refactor setting of initial blkio
	  tuning parameters
	* src/lxc/lxc_driver.c: Enable live change of blkio tuning

	Add support for CPU quota/period to LXC driver
	* src/lxc/lxc_driver.c: Support changing quota/period for LXC
	  containers
	* src/lxc/lxc_controller.c: Set initial quota/period at startup

2011-11-28  Daniel P. Berrange  <berrange@redhat.com>

	Support CPU placement in LXC driver
	While LXC does not have the concept of VCPUS, so we can't do
	per-VCPU pCPU placement, we can support the VM level CPU
	placement. Todo this simply set the CPU affinity of the LXC
	controller at startup. All child processes will inherit this
	affinity.

	* src/lxc/lxc_controller.c: Set process affinity

2011-11-28  Daniel P. Berrange  <berrange@redhat.com>

	Support NUMA memory placement for LXC containers
	Use numactl to set NUMA memory placement for LXC containers

	* src/lxc/lxc_controller.c: Support NUMA memory placement

2011-11-25  Michal Privoznik  <mprivozn@redhat.com>

	storage: Refetch file status after open
	This partly reverts my previous patch f88de3eb. We need to
	get file status after open, as given path could have been symlink,
	so fstat() will operate on different file than lstat().

2011-11-25  Paolo Bonzini  <pbonzini@redhat.com>

	util: fix thinko in runIO
	When aligning you need to clear the bits in the mask and leave the
	others aside.  Likely this code has never run, and will never run.

2011-11-25  Michal Privoznik  <mprivozn@redhat.com>

	storage: Skip socket and fifo on pool-start
	If pool directory contains special files like FIFO or sockets
	we want to skip those on pool-start or pool-refresh otherwise
	open() will get an error.

	conf: Don't drop console definition on domain restart
	One of my latest patches 2e37bf42d28d8bb5d045b206587c64643c64d02a
	copy serial console definition. On domain shutdown we save this
	info into state XML. However, later on the daemon start we simply
	drop this info and since we are not re-reading qemu log,
	vm->def->consoles[0] does not get populated with copy. Therefore
	we need to avoid dropping console definition if it is just alias
	for serial console.

2011-11-24  Jiri Denemark  <jdenemar@redhat.com>

	Fix version numbers for isAlive and setKeepAlive driver APIs

	build: Properly generate and check virkeepaliveprotocol-structs
	This fixes make dist broken by recent keepalive series

	examples: Use virConnectOpenAuth in events-c

	qemu: Cancel p2p migration when connection breaks
	If a connection to destination host is lost during peer-to-peer
	migration (because keepalive protocol timed out), we won't be able to
	finish the migration and it doesn't make sense to wait for qemu to
	transmit all data. This patch automatically cancels such migration
	without waiting for virDomainAbortJob to be called.

	qemu: Add support for keepalive messages during p2p migration

	Add keepalive support into domain-events examples

	Implement virConnectIsAlive in all drivers

	Introduce virConnectIsAlive API
	This API can be used to check if the socket associated with
	virConnectPtr is still open or it was closed (probably because keepalive
	protocol timed out). If there the connection is local (i.e., no socket
	is associated with the connection, it is trivially always alive.

	Implement keepalive protocol in remote driver

	Add support for async close of client RPC socket

	Implement keepalive protocol in libvirt daemon

	virsh: Always run event loop
	Since virsh already implements event loop, it has to also run it. So far
	the event loop was only running during virsh console command.

	Introduce virConnectSetKeepAlive
	virConnectSetKeepAlive public API can be used by a client connecting to
	remote server to start using keepalive protocol. The API is handled
	directly by remote driver and not transmitted over the wire to the
	server.

	Implement common keepalive handling
	These APIs are used by both client and server RPC layer to handle
	processing of keepalive messages.

	Define keepalive protocol
	The keepalive program has two procedures: PING, and PONG.
	Both are used only in asynchronous messages and the sender doesn't wait
	for any reply. However, the party which receives PING messages is
	supposed to react by sending PONG message the other party, but no
	explicit binding between PING and PONG messages is made. For backward
	compatibility neither server nor client are allowed to send keepalive
	messages before checking that remote party supports them.

	rpc: Add some debug messages to virNetClient

	rpc: Fix handling of non-blocking calls that could not be sent
	When virNetClientIOEventLoop is called for a non-blocking call and not
	even a single byte can be sent from this call without blocking, we
	properly reported that to the caller which properly frees the call. But
	we never removed the call from a call queue.

	rpc: Fix a typo in virNetClientSendNonBlock documentation

	rpc: Pass the buck only to the first available thread

2011-11-24  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	nwfilter: remove virConnectPtr from internal API calls
	Remove the virConnectPtr from the nwfilter's internal API calls as
	far as possible.

2011-11-23  Peter Krempa  <pkrempa@redhat.com>

	qemu: Avoid dereference of NULL pointer
	If something fails while initializing qemu job object in
	qemuDomainObjPrivateAlloc(), memory to the private pointer is freed, but
	after that, the pointer is still dereferenced, which may result in a
	segfault.

	* qemuDomainObjPrivateAlloc() - Don't dereference NULL pointer.

2011-11-23  Eric Blake  <eblake@redhat.com>

	qemu: fix a const-correctness issue
	Generally, functions which return malloc'd strings should be typed
	as 'char *', not 'const char *', to make it obvious that the caller
	is responsible to free things.  free(const char *) fails to compile,
	and although we have a cast embedded in VIR_FREE to work around poor
	code that frees const char *, it's better to not rely on that hack.

	* src/qemu/qemu_driver.c (qemuDiskPathToAlias): Change return type.
	(qemuDomainBlockJobImpl): Update caller.

2011-11-23  Eric Blake  <eblake@redhat.com>

	API: prefer 'disk' over 'block' or 'path'
	Given that we can now handle the target's disk shorthand, in addition
	to an absolute path to the file or block device used on the host,
	the term 'disk' fits a bit better as the parameter name than 'path'.

	* include/libvirt/libvirt.h.in: Update some parameter names.
	* src/libvirt.c (virDomainBlockStats, virDomainBlockStatsFlags)
	(virDomainBlockPeek, virDomainGetBlockInfo, virDomainBlockJobAbort)
	(virDomainGetBlockJobInfo, virDomainBlockJobSetSpeed)
	(virDomainBlockPull): Likewise.

2011-11-23  Eric Blake  <eblake@redhat.com>

	blockstats: support lookup by path in blockstats
	Commit 89b6284f made it possible to pass either a source name or
	the target device to most API demanding a disk designation, but
	forgot to update the documentation.  It also failed to update
	virDomainBlockStats to take both forms. This patch fixes both the
	documentation and the remaining function.

	Xen continues to use just device shorthand (that is, I did not
	implement path lookup there, since xen does not track a domain_conf
	to quickly tie a path back to the device shorthand).

	* src/libvirt.c (virDomainBlockStats, virDomainBlockStatsFlags)
	(virDomainGetBlockInfo, virDomainBlockPeek)
	(virDomainBlockJobAbort, virDomainGetBlockJobInfo)
	(virDomainBlockJobSetSpeed, virDomainBlockPull): Document
	acceptable disk naming conventions.
	* src/qemu/qemu_driver.c (qemuDomainBlockStats)
	(qemuDomainBlockStatsFlags): Allow lookup by source name.
	* src/test/test_driver.c (testDomainBlockStats): Likewise.

2011-11-23  Michal Privoznik  <mprivozn@redhat.com>

	nwfilter: Initialize virNWFilterAddIpAddrForIfname return variable
	Latest nwfilter patch ad6c67cf introduced uninitialized return
	value. This was spotted by 4.6.2 gcc.

2011-11-23  Daniel P. Berrange  <berrange@redhat.com>

	Fix disabling of virtual port profile code on old hosts
	The WITH_VIRTUALPORT macro is defined to 0 when disabled, not
	left undefined. So #if must be used instead of #ifdef

	* src/util/virnetdevvportprofile.c: s/#ifdef/#if/

2011-11-23  Daniel P. Berrange  <berrange@redhat.com>

	Fix uninitialized variable in NWfilter IP learning code
	* src/nwfilter/nwfilter_learnipaddr.c: Initialize ret variable

2011-11-23  Michal Prívozník  <mprivozn@redhat.com>

	virsh: Increase device-detach intelligence
	Up to now users have to give a full XML description on input when
	device-detaching. If they omitted something it lead to unclear
	error messages (like generated MAC wasn't found, etc.).
	With this patch users can specify only those information which
	specify one device sufficiently precise. Remaining information is
	completed from domain.

2011-11-23  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	Enable detection of multiple IP addresses
	In preparation of DHCP Snooping and the detection of multiple IP
	addresses per interface:

	The hash table that is used to collect the detected IP address of an
	interface can so far only handle one IP address per interface. With
	this patch we extend this to allow it to handle a list of IP addresses.

	Above changes the returned variable type of virNWFilterGetIpAddrForIfname()
	from char * to virNWFilterVarValuePtr; adapt all existing functions calling
	this function.

2011-11-23  Eli Qiao  <taget@linux.vnet.ibm.com>

	fix error message when using wrong URI alias

	When configuring a URI alias like this in 'libvirt.conf':

	uri_aliases = [
	  "jj#j=qemu+ssh://root@127.0.0.1/system",
	  "sleet=qemu+ssh://root@sleet.cloud.example.com/system",
	]
	virsh -c jj#j

	It will show this error message:
	'no connection driver available for No connection for URI jj#j'
	Actually,we expect this message below:
	Malformed 'uri_aliases' config entry 'jj#j=qemu+ssh://root@127.0.0.1/system', aliases may only contain 'a-Z, 0-9, _, -'

	Give this patch to fix this error.

2011-11-23  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	Pass additional parameter into applyDHCPOnly function
	In preparation for the DHCP Snooping code:
	Pass an additional parameter into the applyDHCPOnly function
	of the 'techdriver'.

2011-11-23  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	nwfilter: use shell variable to invoke 'ip(6)tables' command
	Introduce a shell variable 'IBT' to invoke the ip(6)tables command.

	Tested with libvirt-tck.

2011-11-23  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	nwfilter: use shell variable to invoke 'ebtables' command
	Introduce a shell variable 'EBT' to invoke the ebtables command.
	Hard-code the used ebtables table to '-t nat'.

	Tested with libvirt-tck.

2011-11-23  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	Improve error reporting of failures to apply filtering rules
	Display the executed command and failure message if a command failed to
	execute.

	Add documentation for STP filtering support
	Add documentation for the STP filtering support. Describe the XML attributes
	that are supported.

	Add test cases for STP traffic filtering
	This patch adds a few test cases for the XML parsing of STP filtering nodes.

	Add support for STP filtering
	This patch adds support for filtering of STP (spanning tree protocol) traffic
	to the parser and makes us of the ebtables support for STP filtering. This code
	now enables the filtering of traffic in chains with prefix 'stp'.

	Add a 'mac' chain
	With hunks borrowed from one of David Steven's previous patches, we now
	add the capability of having a 'mac' chain which is useful to filter
	for multiple valid MAC addresses.

2011-11-23  Eric Blake  <eblake@redhat.com>

	docs: fix grammar of capabilities
	* docs/formatcaps.html.in: Avoid run-on sentence, wrap lines.

2011-11-22  Daniel P. Berrange  <berrange@redhat.com>

	Add strings.h include to capabilities.h for ffs() function prototype
	On Mingw32 the ffs() function was not declared due to missing header
	include

	* src/conf/capabilities.c: The ffs() function lives in strings.h

2011-11-22  Osier Yang  <jyang@redhat.com>

	build: Update AUTHORS
	Add Chang Liu to the AUTHORS' list.

2011-11-22  Chang Liu  <lingjiao.lc@taobao.com>

	storage: Fallback to use lvchange first if lvremove fails
	virStorageBackendLogicalDeleteVol() could not remove the lv with error
	"could not remove open logical volume" sometimes. Generally it's caused
	by the volume is still active, even if lvremove tries to remove it with
	option "--force".

	This patch is to fix it by disbale the lv first using "lvchange -aln"
	and "lvremove -f" afterwards if the direct "lvremove -f" failed.

2011-11-22  Srivatsa S. Bhat  <srivatsa.bhat@linux.vnet.ibm.com>

	Export KVM Host Power Management capabilities
	This patch exports KVM Host Power Management capabilities as XML so that
	higher-level systems management software can make use of these features
	available in the host.

	The script "pm-is-supported" (from pm-utils package) is run to discover if
	Suspend-to-RAM (S3) or Suspend-to-Disk (S4) is supported by the host.
	If either of them are supported, then a new tag "<power_management>" is
	introduced in the XML under the <host> tag.

	However in case the query to check for power management features succeeded,
	but the host does not support any such feature, then the XML will contain
	an empty <power_management/> tag. In the event that the PM query itself
	failed, the XML will not contain any "power_management" tag.

	To use this, new APIs could be implemented in libvirt to exploit power
	management features such as S3/S4.

2011-11-22  Eric Blake  <eblake@redhat.com>

	conf: don't modify cpu set string during parsing
	None of the callers cared if str was updated to point to the next
	byte after the parsed cpuset; simplifying this results in quite
	a few code simplifications.  Additionally, virCPUDefParseXML was
	strdup()'ing a malloc()'d string; avoiding a memory copy resulted
	in less code.

	* src/conf/domain_conf.h (virDomainCpuSetParse): Alter signature.
	* src/conf/domain_conf.c (virDomainCpuSetParse): Don't modify str.
	(virDomainVcpuPinDefParseXML, virDomainDefParseXML): Adjust
	callers.
	* src/conf/cpu_conf.c (virCPUDefParseXML): Likewise.
	* src/xen/xend_internal.c (sexpr_to_xend_topology): Likewise.
	* src/xen/xm_internal.c (xenXMDomainPinVcpu): Likewise.
	* src/xenxs/xen_sxpr.c (xenParseSxpr): Likewise.
	* src/xenxs/xen_xm.c (xenParseXM): Likewise.

2011-11-22  Roopa Prabhu  <roprabhu@cisco.com>

	qemu: don't release network actual device twice
	For direct attach devices, in qemuBuildCommandLine, we seem to be freeing
	actual device on error path (with networkReleaseActualDevice). But the actual
	device is not deleted.

	qemuProcessStop eventually deletes the direct attach device and releases
	actual device. But by the time qemuProcessStop is called qemuBuildCommandLine
	has already freed actual device, leaving stray macvtap devices behind on error.
	So the simplest fix is to remove the networkReleaseActualDevice in
	qemuBuildCommandLine. This patch does just that.

2011-11-21  Michal Privoznik  <mprivozn@redhat.com>

	qemu: Copy console definition from serial
	Now, when we support multiple consoles per domain,
	the vm->def->console[0] can still remain an alias
	for vm->def->serial[0]; However, we need to copy
	it's source definition as well otherwise we'll regress
	on virDomainOpenConsole.

2011-11-21  Daniel P. Berrange  <berrange@redhat.com>

	Fix distribution of .syms files for previous commit
	* src/Makefile.am: Remove libvirt_bridge.syms and libvirt_macvtap.syms
	  from EXTRA_DIST. Add libvirt_dbus.syms

2011-11-21  Daniel P. Berrange  <berrange@redhat.com>

	Fix build on Mingw32 wrt export of virNetServerGetDBusConn
	Mingw32 complains if you request export of a symbol which does
	not in fact exist.

	* src/libvirt_bridge.syms, src/libvirt_macvtap.syms: Delete
	  obsolete files
	* src/libvirt_private.syms: Remove virNetServerGetDBusConn
	* src/libvirt_dbus.syms: Add virNetServerGetDBusConn

2011-11-21  Osier Yang  <jyang@redhat.com>

	storage: Skips backingStore of virtual snapshot lv
	lvs outputs "[$lvname_vorigin]" for the virtual snapshot lv
	(created with "--virtualsize"), and the original device pointed
	by "$lvname_vorigin" is just for lvm internal use, one should
	never use it.

	Per lvm's nameing rules, "[" is not valid as part of the vg/lv name.
	(man 8 lvm).

	<quote>
	VALID NAMES
	The following characters are valid for VG and LV names: a-z A-Z 0-9 + _
	. -

	VG and LV names cannot begin with a hyphen.   There  are  also  various
	reserved  names that are used internally by lvm that can not be used as
	LV or VG names.  A VG cannot be called anything that exists in /dev/ at
	the time of creation, nor can it be called '.' or '..'.  A LV cannot be
	called '.' '..' 'snapshot' or 'pvmove'. The LV name may also  not  con‐
	tain the strings '_mlog' or '_mimage'
	</quote>

	So we can skip the set the lv's backingStore by checking if the name
	begins with a "[".

2011-11-19  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	Add documentation for VLAN filtering support
	Add documentation for the VLAN filtering support. Describe the XML attributes
	that are supported.

	Add test cases for VLAN traffic filtering
	This patch adds a few test cases for the XML parsing of VLAN filtering nodes.

	Add support for VLAN filtering
	This patch adds support for filtering of VLAN (802.1Q) traffic to the
	parser and makes us of the ebtables support for VLAN filtering. This code
	now enables the filtering of traffic in chains with prefix 'vlan'.

2011-11-19  Jim Fehlig  <jfehlig@suse.com>

	Don't copy sexpr node value that is an empty string
	Xen4.1 initializes some unspecified sexpr config items to an empty
	string, unlike previous Xen versions that would leave the item unset.
	E.g. the kernel item for an HVM guest (non-direct kernel boot):

	Xen4.0 and earlier
	  ...
	  (image
	    (hvm
	      (kernel )
	  ...

	Xen4.1
	  ...
	  (image
	    (hvm
	      (kernel '')
	  ...

	The empty string for kernel causes some grief in subsequent parsing
	where existence of specified kernel is checked, e.g.

	  if (!def->os.kernel)
	  ...

	This patch solves the problem in sexpr_node_copy() by not copying
	a node containing an empty string.

2011-11-19  Eric Blake  <eblake@redhat.com>

	tests: avoid xend ABRT crash report
	I installed the xen development packages on my non-Xen F16 machine
	in order to compile-test xen code and ensure we don't break things
	on that front, but being a non-xen machine, /usr/sbin/xend is
	obviously not running.  Unfortunately, xen-4.1.2-1.fc16 has a bug
	where merely trying to probe xend status on a non-xen kernel causes
	xend to issue an ABRT crash report:

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

	Even though libvirt (correctly) skips the test, the xend crash report
	is unnecessary noise.  Fix this by first filtering out non-xen
	kernels even before attempting to probe xend.  The test still runs
	and passes on a RHEL 5 xen kernel after this patch.

	* tests/reconnect.c (mymain): Skip xend probe on non-xen kernel.
	* tests/statstest.c (mymain): Likewise.

2011-11-19  Eric Blake  <eblake@redhat.com>

	build: fix compile error with no macvtap
	Since commit 6ec8288a, compilation has failed on RHEL 5:

	util/virnetdevmacvlan.c:672: error: conflicting types for 'virNetDevMacVLanCreateWithVPortProfile'

	* src/util/virnetdevmacvlan.c
	(virNetDevMacVLanCreateWithVPortProfile): Add missing parameter.

2011-11-19  Hu Tao  <hutao@cn.fujitsu.com>

	enable cgroup cpuset by default
	This prepares for subsequent patches which introduce dependence
	on cgroup cpuset. Enable cgroup cpuset by default so users don't
	have to modify configuration file before encountering a cpuset
	error.

2011-11-19  Eric Blake  <eblake@redhat.com>

	build: fix accidental POTFILES.in regression
	The original patch for commit 4789fb2 considered renaming a file,
	then backed out the name change, but forgot to back out the POTFILES.in
	change, resulting in 'make syntax-check' failure.

2011-11-19  Eric Blake  <eblake@redhat.com>

	tests: test recent hash addition
	Excercise the new hash API, to ensure we avoid regressions.

	* tests/hashtest.c (testHashGetItems): New test.

2011-11-19  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	Add test cases for parsing of list values
	This patch adds test cases for parsing of parameters with
	multiple occurrances of the same name.

2011-11-19  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	Extend NWFilter parameter parser to cope with lists of values
	This patch modifies the NWFilter parameter parser to support multiple
	elements with the same name and to internally build a list of items.
	An example of the XML looks like this:

	        <parameter name='TEST' value='10.1.2.3'/>
	        <parameter name='TEST' value='10.2.3.4'/>
	        <parameter name='TEST' value='10.1.1.1'/>

	The list of values is then stored in the newly introduced data type
	virNWFilterVarValue.

	The XML formatter is also adapted to print out all items in alphabetical
	order sorted by 'name'.

	This patch also fixes a bug in the XML schema on the way.

2011-11-19  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	Create rules for each member of a list
	This patch extends the NWFilter driver for Linux (ebiptables) to create
	rules for each member of a previously introduced list. If for example
	an attribute value (internally) looks like this:

	IP = [10.0.0.1, 10.0.0.2, 10.0.0.3]

	then 3 rules will be generated for a rule accessing the variable 'IP',
	one for each member of the list. The effect of this is that this now
	allows for filtering for multiple values in one field. This can then be
	used to support for filtering/allowing of multiple IP addresses per
	interface.

	An iterator is introduced that extracts each member of a list and
	puts it into a hash table which then is passed to the function creating
	a rule. For the above example the iterator would cause 3 loops.

2011-11-19  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	Rework value part of name-value pairs
	NWFilters can be provided name-value pairs using the following
	XML notation:

	      <filterref filter='xyz'>
	        <parameter name='PORT' value='80'/>
	        <parameter name='VAL' value='abc'/>
	      </filterref>

	The internal representation currently is so that a name is stored as a
	string and the value as well. This patch now addresses the value part of it
	and introduces a data structure for storing a value either as a simple
	value or as an array for later support of lists.

	This patch adjusts all code that was handling the values in hash tables
	and makes it use the new data type.

2011-11-19  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	Documentation about chains' priorities, lists of elements etc.
	This patch adds several aspects of documentation about the network filtering
	system:

	- chains, chains' priorities and chains' default priorities
	- talks about lists of elements, i.e., a variable assigned multiple values
	  (part of already ACK-ed series)
	- already mentions the vlan, stp and mac chains added later on
	  (https://www.redhat.com/archives/libvir-list/2011-October/msg01238.html)
	- mentions limitations of vlan filtering (when sent by VM) on Linux systems

2011-11-19  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	Add test cases
	Add test case for the chain names with known prefixes and the chain
	priority.

2011-11-19  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	Interleave jumping into chains with filtering rules in 'root' table
	The previous patch extends the priority of filtering rules into negative
	numbers. We now use this possibility to interleave the jumping into
	chains with filtering rules to for example create the 'root' table of
	an interface with the following sequence of rules:

	Bridge chain: libvirt-I-vnet0, entries: 6, policy: ACCEPT
	-p IPv4 -j I-vnet0-ipv4
	-p ARP -j I-vnet0-arp
	-p ARP -j ACCEPT 
	-p 0x8035 -j I-vnet0-rarp
	-p 0x835 -j ACCEPT 
	-j DROP 

	The '-p ARP -j ACCEPT' rule now appears between the jumps.
	Since the 'arp' chain has been assigned priority -700 and the 'rarp'
	chain -600, the above ordering can now be achieved with the following
	rule:

	  <rule action='accept' direction='out' priority='-650'>
	    <mac protocolid='arp'/>
	  </rule>

	This patch now sorts the commands generating the above shown jumps into
	chains and interleaves their execution with those for generating rules.

2011-11-19  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	Extend rule priorities into negative numbers
	So far rules' priorities have only been valid in the range [0,1000].
	Now I am extending their priority into the range [-1000, 1000] for subsequently
	being able to sort rules and the access of (jumps into) chains following
	priorities.

2011-11-19  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	Enable chains with names having a known prefix
	This patch enables chains that have a known prefix in their name.
	Known prefixes are: 'ipv4', 'ipv6', 'arp', 'rarp'. All prefixes
	are also protocols that can be evaluated on the ebtables level.

	Following the prefix they will be automatically connected to an interface's
	'root' chain and jumped into following the protocol they evaluate, i.e.,
	a table 'arp-xyz' will be accessed from the root table using

	ebtables -t nat -A <iface root table> -p arp -j I-<ifname>-arp-xyz

	thus generating a 'root' chain like this one here:

	Bridge chain: libvirt-O-vnet0, entries: 5, policy: ACCEPT
	-p IPv4 -j O-vnet0-ipv4
	-p ARP -j O-vnet0-arp
	-p 0x8035 -j O-vnet0-rarp
	-p ARP -j O-vnet0-arp-xyz
	-j DROP 

	where the chain 'arp-xyz' is accessed for filtering of ARP packets.

2011-11-19  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	Extend the filter XML to support priorities of chains
	This patch extends the filter XML to support priorities of chains
	in the XML. An example would be:

	<filter name='allow-arpxyz' chain='arp-xyz' priority='200'>
	[...]
	</filter>

	The permitted values for priorities are [-1000, 1000].
	By setting the priority of a chain the order in which it is accessed
	from the interface root chain can be influenced.

2011-11-19  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	Use the actual names of chains in data structure
	Use the name of the chain rather than its type index (enum).
	This pushes the later enablement of chains with user-given names
	into the XML parser. For now we still only allow those names that
	are well known ('root', 'arp', 'rarp', 'ipv4' and 'ipv6').

2011-11-19  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	Use scripting for cleaning and renaming of chains
	Use scripts for the renaming and cleaning up of chains. This allows us to get
	rid of some of the code that is only capable of renaming and removing chains
	whose names are hardcoded.

	A shell function 'collect_chains' is introduced that is given the name
	of an ebtables chain and then recursively determines the names of all
	chains that are accessed from this chain and its sub-chains using 'jumps'.

	The resulting list of chain names is then used to delete all the found
	chains by first flushing and then deleting them.

	The same function is also used for renaming temporary filters to their final
	names.

	I tested this with the bash and dash as script interpreters.

2011-11-19  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	Make filter creation in root table more flexible
	Use the previously introduced chain priorities to sort the chains for access
	from an interface's 'root' table and have them created in the proper order.
	This gets rid of a lot of code that was previously creating the chains in a 
	more hardcoded way.

	To determine what protocol a filter is used for evaluation do prefix-
	matching, i.e., the filter 'arp' is used to filter for the 'arp' protocol,
	'ipv4' for the 'ipv4' protocol and 'arp-xyz' will also be used to filter
	for the 'arp' protocol following the prefix 'arp' in its name.

2011-11-19  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	Introduce an internal priority for chains
	For better handling of the sorting of chains introduce an internally used
	priority. Use a lookup table to store the priorities. For now their actual
	values do not matter just that the values cause the chains to be properly
	sorted through changes in the following patches. However, the values are
	chosen as negative so that once they are sorted along with filtering rules
	(whose priority may only be positive for now) they will always be instantiated
	before them (lower values cause instantiation before higher values). This
	is done to maintain backwards compatibility.

	Add function to get hash table's key/value pairs
	Add a function to the virHashTable for getting an array of the hash table's
	key-value pairs and have the keys (optionally) sorted.

2011-11-19  Daniel P. Berrange  <berrange@redhat.com>

	Add support for systemd init service
	This patch adds support for a systemd init service for libvirtd
	and libvirt-guests. The libvirtd.service is *not* written to use
	socket activation, since we want libvirtd to start on boot so it
	can do guest auto-start.

	The libvirt-guests.service is pretty lame, just exec'ing the
	original init script for now. Ideally we would factor out the
	functionality, into some shared tool.

	Instead of

	  ./configure --with-init-script=redhat

	You can now do

	  ./configure --with-init-script=systemd

	Or better still:

	  ./configure --with-init-script=systemd+redhat

	We can also now support install of the upstart init script

	* configure.ac: Add systemd, and systemd+redhat options to
	  --with-init-script option
	* daemon/Makefile.am: Install systemd services
	* daemon/libvirtd.sysconf: Add note about unused env variable
	  with systemd
	* daemon/libvirtd.service.in: libvirtd systemd service unit
	* libvirt.spec.in: Add scripts to installing systemd services
	  and migrating from legacy init scripts
	* tools/Makefile.am: Install systemd services
	* tools/libvirt-guests.init.sh: Rename to tools/libvirt-guests.init.in
	* tools/libvirt-guests.service.in: systemd service unit

2011-11-19  Daniel P. Berrange  <berrange@redhat.com>

	Add support for interfaces with type=direct to LXC
	Support creation of macvlan devices for LXC containers. Do not
	allow setting of bandwidth controls or vport profiles due to the
	complication that there is no host side visible device to work
	with.

	* src/lxc/lxc_driver.c: Support type=direct interfaces

2011-11-19  Daniel P. Berrange  <berrange@redhat.com>

	Allow creation of plain macvlan devices
	Update virNetDevMacVLanCreateWithVPortProfile to allow creation
	of plain macvlan devices, as well as macvtap devices. The former
	is useful for LXC containers

	* src/qemu/qemu_command.c: Explicitly request a macvtap device
	* src/util/virnetdevmacvlan.c, src/util/virnetdevmacvlan.h: Add
	  new flag to allow switching between macvlan and macvtap
	  creation

2011-11-19  Daniel P. Berrange  <berrange@redhat.com>

	Refactor LXC network setup to allow future enhancements
	The current lxcSetupInterfaces() method directly performs setup
	of the bridge devices. Since it will shortly need to also create
	macvlan devices, move the bridge related code into a separate
	method

	* src/lxc/lxc_driver.c: Split lxcSetupInterfaces() to create a
	  new lxcSetupInterfaceBridge()

2011-11-19  Daniel P. Berrange  <berrange@redhat.com>

	Add missing 'const' annotations for internal domain conf helpers
	The virDomainNetGetActualBridgeName and virDomainNetGetActualDirectDev
	methods both return strings that point to data in the virDomainDefPtr
	struct, and should therefore not be freed. The return values should
	thus be 'const char *' not 'char *'.

	* src/conf/domain_conf.c, src/conf/domain_conf.h: Mark const
	* src/network/bridge_driver.c: Update to use a const char *

2011-11-19  Daniel P. Berrange  <berrange@redhat.com>

	Fix up ordering of private symbols file
	Fix ordering of symbols after re-arranging network device
	management API source files

	* src/libvirt_private.syms: Fix ordering

2011-11-19  Daniel P. Berrange  <berrange@redhat.com>

	Move ifaceMacvtapLinkDump and ifaceGetNthParent functions
	Move the ifaceMacvtapLinkDump and ifaceGetNthParent functions
	into virnetdevvportprofile.c since they are specific to that
	code. This avoids polluting the headers with the Linux specific
	netlink data types

	* src/util/interface.c, src/util/interface.h: Move
	  ifaceMacvtapLinkDump and ifaceGetNthParent functions and delete
	  remaining file
	* src/util/virnetdevvportprofile.c: Add ifaceMacvtapLinkDump
	  and ifaceGetNthParent functions
	* src/network/bridge_driver.c, src/nwfilter/nwfilter_gentech_driver.c,
	  src/nwfilter/nwfilter_learnipaddr.c, src/util/virnetdevmacvlan.c:
	  Remove include of interface.h

2011-11-19  Daniel P. Berrange  <berrange@redhat.com>

	Move functions for dealing with physical/virtual devices
	Move virNetDevIsVirtualFunction, virNetDevGetVirtualFunctionIndex
	and virNetDevGetPhysicalFunction to virnetdev.c

	* src/util/interface.c, src/util/interface.h, src/util/virnetdev.c,
	  src/util/virnetdev.h: Move APIs

2011-11-19  Daniel P. Berrange  <berrange@redhat.com>

	Rename APIs for dealing with virtual/physical functions
	Rename ifaceIsVirtualFunction to virNetDevIsVirtualFunction,
	ifaceGetVirtualFunctionIndex to virNetDevGetVirtualFunctionIndex
	and ifaceGetPhysicalFunction to virNetDevGetPhysicalFunction

	* src/util/interface.c, src/util/interface.h: Rename APIs
	* src/util/virnetdevvportprofile.c: Update for API rename

2011-11-19  Daniel P. Berrange  <berrange@redhat.com>

	Move virNetDevValidateConfig to virnetdev.c
	* src/util/interface.c, src/util/interface.h: Remove virNetDevValidateConfig
	* src/util/virnetdev.c, src/util/virnetdev.h: Add virNetDevValidateConfig

2011-11-19  Daniel P. Berrange  <berrange@redhat.com>

	Rename ifaceCheck to virNetDevValidateConfig
	Rename the ifaceCheck method to virNetDevValidateConfig and change
	so that it always raises an error and returns -1 on error.

	* src/util/interface.c, src/util/interface.h: Rename ifaceCheck
	  to virNetDevValidateConfig
	* src/nwfilter/nwfilter_gentech_driver.c,
	  src/nwfilter/nwfilter_learnipaddr.c: Update for API rename

2011-11-19  Daniel P. Berrange  <berrange@redhat.com>

	Move virNetDevGetIPv4Address to virnetdev.c
	Move the virNetDevGetIPv4Address function to virnetdev.c

	* util/interface.c, util/interface.h: Remove virNetDevGetIPv4Address
	* util/virnetdev.c, util/virnetdev.h: Add virNetDevGetIPv4Address

2011-11-19  Daniel P. Berrange  <berrange@redhat.com>

	Rename ifaceGetIPAddress to virNetDevGetIPv4Address
	To match up with the existing virNetDevSetIPv4Address, rename
	ifaceGetIPAddress to virNetDevGetIPv4Address

	* util/interface.h, util/interface.c: Rename API
	* network/bridge_driver.c: Update for API rename

2011-11-19  Daniel P. Berrange  <berrange@redhat.com>

	Move virNetDevGetIndex & virNetDevGetVLanID to virnetdev.c
	Move virNetDevGetIndex & virNetDevGetVLanID to virnetdev.c to
	suit their functional purpose

	* util/interface.c, util/interface.h: Remove virNetDevGetIndex &
	  virNetDevGetVLanID
	* util/virnetdev.c, util/virnetdev.h: Add virNetDevGetIndex &
	  virNetDevGetVLanID

2011-11-19  Daniel P. Berrange  <berrange@redhat.com>

	Rename ifaceGetIndex and ifaceGetVLAN
	Rename the ifaceGetIndex method to virNetDevGetIndex and
	ifaceGetVlanID to virNetDevGetVLanID. Also change the error
	reporting behaviour to always raise errors and return -1 on
	failure

	* util/interface.c, util/interface.h: Rename ifaceGetIndex
	  and ifaceGetVLAN
	* nwfilter/nwfilter_gentech_driver.c, nwfilter/nwfilter_learnipaddr.c,
	  nwfilter/nwfilter_learnipaddr.c, util/virnetdevvportprofile.c: Update
	  for API renames and error handling changes

2011-11-19  Daniel P. Berrange  <berrange@redhat.com>

	Move MAC address replacement functions to virnetdev.c
	Move virNetDevReplaceMacAddress and virNetDevRestoreMacAddress
	to the virnetdev.c file where they naturally belong

	* util/interface.c, util/interface.h: Remove
	  virNetDevReplaceMacAddress and virNetDevRestoreMacAddress
	* util/virnetdev.c, util/virnetdev.h: Add
	  virNetDevReplaceMacAddress and virNetDevRestoreMacAddress

2011-11-19  Daniel P. Berrange  <berrange@redhat.com>

	Rename interface MAC address replacement APIs
	Rename ifaceReplaceMacAddress to virNetDevReplaceMacAddress
	and ifaceRestoreMacAddress to virNetDevRestoreMacAddress.

	* util/interface.c, util/interface.h, util/virnetdevmacvlan.c:
	  Rename APIs

2011-11-19  Daniel P. Berrange  <berrange@redhat.com>

	Move the low level macvlan creation APIs
	Move the low level macvlan creation APIs into the
	virnetdevmacvlan.c file where they more naturally
	belong

	* util/interface.c, util/interface.h: Remove virNetDevMacVLanCreate
	  and virNetDevMacVLanDelete
	* util/virnetdevmacvlan.c, util/virnetdevmacvlan.h: Add
	  virNetDevMacVLanCreate and virNetDevMacVLanDelete

2011-11-19  Daniel P. Berrange  <berrange@redhat.com>

	Rename low level macvlan creation APIs
	Rename ifaceMacvtapLinkAdd to virNetDevMacVLanCreate and
	ifaceLinkDel to virNetDevMacVLanDelete. Strictly speaking
	the latter isn't restricted to macvlan devices, but that's
	the only use libvirt has for it.

	* util/interface.c, util/interface.h,
	  util/virnetdevmacvlan.c: Rename APIs

2011-11-19  Daniel P. Berrange  <berrange@redhat.com>

	Rename high level macvlan creation APIs
	Rename virNetDevMacVLanCreate to virNetDevMacVLanCreateWithVPortProfile
	and virNetDevMacVLanDelete to virNetDevMacVLanDeleteWithVPortProfile

	To make way for renaming the other macvlan creation APIs in
	interface.c

	* util/virnetdevmacvlan.c, util/virnetdevmacvlan.h,
	  qemu/qemu_command.c, qemu/qemu_hotplug.c, qemu/qemu_process.c:
	  Rename APIs

2011-11-19  Daniel P. Berrange  <berrange@redhat.com>

	Rename and split the macvtap.c file
	Rename the macvtap.c file to virnetdevmacvlan.c to reflect its
	functionality. Move the port profile association code out into
	virnetdevvportprofile.c. Make the APIs available unconditionally
	to callers

	* src/util/macvtap.h: rename to src/util/virnetdevmacvlan.h,
	* src/util/macvtap.c: rename to src/util/virnetdevmacvlan.c
	* src/util/virnetdevvportprofile.c, src/util/virnetdevvportprofile.h:
	  Pull in vport association code
	* src/Makefile.am, src/conf/domain_conf.h, src/qemu/qemu_conf.c,
	  src/qemu/qemu_conf.h, src/qemu/qemu_driver.c: Update include
	  paths & remove conditional compilation

2011-11-19  Daniel P. Berrange  <berrange@redhat.com>

	Rename Macvtap management APIs
	In preparation for code re-organization, rename the Macvtap
	management APIs to have the following patterns

	  virNetDevMacVLanXXXXX     - macvlan/macvtap interface management
	  virNetDevVPortProfileXXXX - virtual port profile management

	* src/util/macvtap.c, src/util/macvtap.h: Rename APIs
	* src/conf/domain_conf.c, src/network/bridge_driver.c,
	  src/qemu/qemu_command.c, src/qemu/qemu_command.h,
	  src/qemu/qemu_driver.c, src/qemu/qemu_hotplug.c,
	  src/qemu/qemu_migration.c, src/qemu/qemu_process.c,
	  src/qemu/qemu_process.h: Update for renamed APIs

2011-11-19  Daniel P. Berrange  <berrange@redhat.com>

	Fix use of uninitialized variable in QEMU driver

2011-11-18  Bharata B Rao  <bharata@linux.vnet.ibm.com>

	qemu: Generate -numa option
	Add routines to generate -numa QEMU command line option based on
	<numa> ... </numa> XML specifications.

2011-11-18  Bharata B Rao  <bharata@linux.vnet.ibm.com>

	XML definitions for guest NUMA and parsing routines
	This patch adds XML definitions for guest NUMA specification and contains
	routines to parse the same. The guest NUMA specification looks like this:

	<cpu>
	        ...
	        <topology sockets='2' cores='4' threads='2'/>
	        <numa>
	                <cell cpus='0-7' memory='512000'/>
	                <cell cpus='8-15' memory='512000'/>
	        </numa>
	        ...
	</cpu>

2011-11-18  Eric Blake  <eblake@redhat.com>

	snapshot: refuse to generate names for non-regular backing files
	For whatever reason, the kernel allows you to create a regular
	file named /dev/sdc.12345; although this file will disappear the
	next time devtmpfs is remounted.  If you let libvirt generate
	the name of the external snapshot for a disk image originally
	using the block device /dev/sdc, then the domain will be rendered
	unbootable once the qcow2 file is lost on the next devtmpfs
	remount.  In this case, the user should have used 'virsh
	snapshot-create --xmlfile' or 'virsh snapshot-create-as --diskspec'
	to specify the name for the qcow2 file in a sane location, rather
	than relying on libvirt generating a name that is most likely to
	be wrong.  We can help avoid naive mistakes by enforcing that
	the user provide the external name for any backing file that is
	not a regular file.

	* src/conf/domain_conf.c (virDomainSnapshotAlignDisks): Only
	generate names if backing file exists as regular file.
	Reported by MATSUDA Daiki.

2011-11-17  Jim Fehlig  <jfehlig@suse.com>

	Fix build with polkit0
	I missed adding virNetServerGetDBusConn() to libvirtd_private.syms
	in commit b8adfcc6, which didn't cause a problem in 0.9.6 but
	results in this build error in 0.9.7

	libvirtd-remote.o: In function `remoteDispatchAuthPolkit':
	remote.c:(.text+0x188dd): undefined reference to `virNetServerGetDBusConn'

2011-11-17  Jim Fehlig  <jfehlig@suse.com>

	Revert commit 0f590c62
	As noted by Daniel Berrange [1], the proper fix for the older
	PolicyKit build issue is to add virNetServerGetDBusConn to
	libvirt_private.syms.  Revert unnecessary changes to
	daemon/Makefile.am

	[1] https://www.redhat.com/archives/libvir-list/2011-November/msg00852.html

2011-11-17  Laine Stump  <laine@laine.org>

	virsh: add iface-bridge and iface-unbridge commands
	One of the top questions by libvirt users is how to create a host
	bridge device so that guests can be directly on the physical
	network. There are several example documents that explain how to do
	this manually, but following them often results in confusion and
	failure. virt-manager does a good job of creating a bridge based on an
	existing network device, but not everyone wants to use virt-manager.

	This patch adds a new command, iface-bridge that makes it just about
	as simple as possible to create a new bridge device based on an
	existing ethernet/vlan/bond device (including associating IP
	configuration with the bridge rather than the now-attached device),
	and start that new bridge up ready for action, eg:

	    virsh iface-bridge eth0 br0

	For symmetry's sake, it also adds a command to remove a device from a
	bridge, restoring the IP config to the now-unattached device:

	    virsh iface-unbridge br0

	(I had a short debate about whether to do "iface-unbridge eth0"
	instead, but that would involve searching through all bridge devices
	for the one that contained eth0, which seems like a bit too much
	trouble).

	NOTE: These two commands require that the netcf library be available
	on the host. Hopefully this will provide some extra incentive for
	people using suse, debian, ubuntu, and other similar systems to polish
	up (and push downstream) the ports to those distros recently pushed to
	the upstream netcf repo by Dan Berrange. Anyone interested in helping
	with that effort in any way should join the netcf-devel mailing list
	(subscription info at
	https://fedorahosted.org/mailman/listinfo/netcf-devel)

	During creation of the bridge, it's possible to specify whether or not
	the STP protocol should be started up on the bridge and, if so, how
	many seconds the bridge should squelch traffic from newly added
	devices while learning new topology (defaults are stp='on' and
	delay='0', which seems to usually work best for bridges used in the
	context of libvirt guests).

	There is also an option to not immediately start the bridge (and a
	similar option to not immediately start the un-attached device after
	destroying the bridge. Default is to start the new device, because in
	the case of iface-unbridge not starting is strongly discouraged as it
	will leave the system with no network connectivity on that interface
	(because it's necessary to destroy/undefine the bridge device before
	the unattached device can be defined), and it seemed better to make
	the option for iface-bridge behave consistently.

	NOTE TO THOSE TRYING THESE COMMANDS FOR THE FIRST TIME: to guard
	against any "unexpected" change to configuration, it is advisable to
	issue an "virsh iface-begin" command before starting any interface
	config changes, and "virsh iface-commit" only after you've verified
	that everything is working as you expect. If something goes wrong,
	you can always run "virsh iface-rollback" or reboot the system (which
	should automatically do iface-rollback).

	Aside from adding the code for these two functions, and the two
	entries into the command table, the only other change to virsh.c was
	to add the option name to vshCommandOptInterfaceBy(), because the
	iface-unbridge command names its interface option as "bridge".

	virsh.pod has also been updated with short descriptions of these two
	new commands.

2011-11-16  Hu Tao  <hutao@cn.fujitsu.com>

	fix a bug in remoteSerializeTypedParameters
	This is a fatal typo believed to be very likely to happen when using
	both i and j at the same time for indexing.

2011-11-16  Daniel P. Berrange  <berrange@redhat.com>

	Don't return a fatal error if receiving unexpected stream data
	Due to the asynchronous nature of streams, we might continue to
	receive some stream packets from the server even after we have
	shutdown the stream on the client side. These should be discarded
	silently, rather than raising an error in the RPC layer.

	* src/rpc/virnetclient.c: Discard stream data silently

2011-11-16  Daniel P. Berrange  <berrange@redhat.com>

	Fix handling of stream EOF
	Very occasionally the sequence of events from poll would result
	in getting a HANGUP on its own, instead of a HANGUP+READABLE
	at the same time. In the former case we would send back an error
	event to the client, but never send the empty packet to indicate
	EOF.

2011-11-16  Daniel P. Berrange  <berrange@redhat.com>

	Allow non-blocking message sending on virNetClient
	Add a new virNetClientSendNonBlock which returns 2 on
	full send, 1 on partial send, 0 on no send, -1 on error

	If a partial send occurs, then a subsequent call to any
	of the virNetClientSend* APIs will finish any outstanding
	I/O.

	TODO: the virNetClientEvent event handler could be used
	to speed up completion of partial sends if an event loop
	is present.

	* src/rpc/virnetsocket.h, src/rpc/virnetsocket.c: Add new
	  virNetSocketHasPendingData() API to test for cached
	  data pending send.
	* src/rpc/virnetclient.c, src/rpc/virnetclient.h: Add new
	  virNetClientSendNonBlock() API to send non-blocking API

2011-11-16  Daniel P. Berrange  <berrange@redhat.com>

	Refactor code for enabling/disabling I/O callback in remote client
	* src/rpc/virnetclient.c: Add helper for setting I/O callback events

2011-11-16  Daniel P. Berrange  <berrange@redhat.com>

	Split virNetClientSend into 2 methods
	Stop multiplexing virNetClientSend for two different purposes,
	instead add virNetClientSendWithReply and virNetClientSendNoReply

	* src/rpc/virnetclient.c, src/rpc/virnetclient.h: Replace
	  virNetClientSend with virNetClientSendWithReply and
	  virNetClientSendNoReply
	* src/rpc/virnetclientprogram.c, src/rpc/virnetclientstream.c:
	  Update for new API names

2011-11-16  Daniel P. Berrange  <berrange@redhat.com>

	Refactor code for passing the buck in the remote client
	Remove some duplication by pulling the code for passing the
	buck out into a helper method

	* src/rpc/virnetclient.c: Introduce virNetClientIOEventLoopPassTheBuck

2011-11-16  Daniel P. Berrange  <berrange@redhat.com>

	Explicitly track whether the buck is held in remote client
	Instead of inferring whether the buck is held from the waitDispatch
	pointer, use an explicit 'bool haveTheBuck' field

	* src/rpc/virnetclient.c: Explicitly track the buck

2011-11-16  Daniel P. Berrange  <berrange@redhat.com>

	Remove all linked list handling from remote client event loop
	Directly messing around with the linked list is potentially
	dangerous. Introduce some helper APIs to deal with list
	manipulating the list

	* src/rpc/virnetclient.c: Create linked list handlers

2011-11-16  Eli Qiao  <taget@linux.vnet.ibm.com>

	util: Add netdev helper functions to private symbols

2011-11-16  Sage Weil  <sage@newdream.net>

	qemu/rbd: improve rbd device specification
	This improves the support for qemu rbd devices by adding support for a few
	key features (e.g., authentication) and cleaning up the way in which
	rbd configuration options are passed to qemu.

	An <auth> member of the disk source xml specifies how librbd should
	authenticate. The username attribute is the Ceph/RBD user to authenticate as.
	The usage or uuid attributes specify which secret to use. Usage is an
	arbitrary identifier local to libvirt.

	The old RBD support relied on setting an environment variable to
	communicate information to qemu/librbd.  Instead, pass those options
	explicitly to qemu.  Update the qemu argument parsing and tests
	accordingly.

2011-11-16  Jim Fehlig  <jfehlig@suse.com>

	Fix build with polkit0
	I missed adding libvirt_driver_remote.la to libvirtd_LDADD in
	commit b8adfcc6, which didn't cause a problem in 0.9.6 but
	results in this build error in 0.9.7

	libvirtd-remote.o: In function `remoteDispatchAuthPolkit':
	remote.c:(.text+0x188dd): undefined reference to `virNetServerGetDBusConn'

2011-11-16  Stefan Berger  <stefanb@us.ibm.com>

	Fix strchr call triggering gcc 4.3 & 4.4 bug
	Replacing the strchr call with two variables through a strstr call.
	Calling strchr with two variables triggers a gcc 4.3/4.4
	bug when used in combination with -Wlogical-op and at least -O1.

	maint: fix build
	include stdint.h to fix the build

2011-11-15  Daniel P. Berrange  <berrange@redhat.com>

	Remove ifaceSetMac and ifaceGetMac APIs
	The ifaceSetMac and ifaceGetMac APIs duplicate the functionality
	of the virNetDevSetMAC and virNetDevGetMAC APIs, but returning
	errno's instead of raising errors.

	* src/util/interface.c, src/util/interface.h: Remove
	  ifaceSetMac and ifaceGetMac APIs, adjusting callers
	  for new error behaviour

2011-11-15  Daniel P. Berrange  <berrange@redhat.com>

	Remove ifaceUp, ifaceDown, ifaceCtrl & ifaceIsUp APIs
	The ifaceUp, ifaceDown, ifaceCtrl & ifaceIsUp APIs can be replaced
	with calls to virNetDevSetOnline and virNetDevIsOnline

	* src/util/interface.c, src/util/interface.h: Delete ifaceUp,
	  ifaceDown, ifaceCtrl & ifaceIsUp
	* src/nwfilter/nwfilter_gentech_driver.c, src/util/macvtap.c:
	  Update to use virNetDevSetOnline and virNetDevIsOnline

2011-11-15  Daniel P. Berrange  <berrange@redhat.com>

	Move LXC veth.c code into shared utility APIs
	Move the virNetDevSetName and virNetDevSetNamespace APIs out
	of LXC's veth.c and into virnetdev.c.

	Move the remaining content of the file to src/util/virnetdevveth.c

	* src/lxc/veth.c: Rename to src/util/virnetdevveth.c
	* src/lxc/veth.h: Rename to src/util/virnetdevveth.h
	* src/util/virnetdev.c, src/util/virnetdev.h: Add
	  virNetDevSetName and virNetDevSetNamespace
	* src/lxc/lxc_container.c, src/lxc/lxc_controller.c,
	  src/lxc/lxc_driver.c: Update include paths

2011-11-15  Daniel P. Berrange  <berrange@redhat.com>

	Rename the LXC veth management APIs and delete duplicated APIs
	The src/lxc/veth.c file contains APIs for managing veth devices,
	but some of the APIs duplicate stuff from src/util/virnetdev.h.
	Delete thed duplicate APIs and rename the remaining ones to
	follow virNetDevVethXXXX

	* src/lxc/veth.c, src/lxc/veth.h: Rename APIs & delete duplicates
	* src/lxc/lxc_container.c, src/lxc/lxc_controller.c,
	  src/lxc/lxc_driver.c: Update for API renaming

2011-11-15  Daniel P. Berrange  <berrange@redhat.com>

	Split src/util/network.{c,h} into 5 pieces
	The src/util/network.c file is a dumping ground for many different
	APIs. Split it up into 5 pieces, along functional lines

	 - src/util/virnetdevbandwidth.c: virNetDevBandwidth type & helper APIs
	 - src/util/virnetdevvportprofile.c: virNetDevVPortProfile type & helper APIs
	 - src/util/virsocketaddr.c: virSocketAddr and APIs
	 - src/conf/netdev_bandwidth_conf.c: XML parsing / formatting
	   for virNetDevBandwidth
	 - src/conf/netdev_vport_profile_conf.c: XML parsing / formatting
	   for virNetDevVPortProfile

	* src/util/network.c, src/util/network.h: Split into 5 pieces
	* src/conf/netdev_bandwidth_conf.c, src/conf/netdev_bandwidth_conf.h,
	  src/conf/netdev_vport_profile_conf.c, src/conf/netdev_vport_profile_conf.h,
	  src/util/virnetdevbandwidth.c, src/util/virnetdevbandwidth.h,
	  src/util/virnetdevvportprofile.c, src/util/virnetdevvportprofile.h,
	  src/util/virsocketaddr.c, src/util/virsocketaddr.h: New pieces
	* daemon/libvirtd.h, daemon/remote.c, src/conf/domain_conf.c,
	  src/conf/domain_conf.h, src/conf/network_conf.c,
	  src/conf/network_conf.h, src/conf/nwfilter_conf.h,
	  src/esx/esx_util.h, src/network/bridge_driver.c,
	  src/qemu/qemu_conf.c, src/rpc/virnetsocket.c,
	  src/rpc/virnetsocket.h, src/util/dnsmasq.h, src/util/interface.h,
	  src/util/iptables.h, src/util/macvtap.c, src/util/macvtap.h,
	  src/util/virnetdev.h, src/util/virnetdevtap.c,
	  tools/virsh.c: Update include files

2011-11-15  Daniel P. Berrange  <berrange@redhat.com>

	Fix error reporting in port profile parsing/formatting APIs
	The virtual port profile parsing/formatting APIs do not
	correctly handle unknown profile type strings/numbers.
	They behave as a no-op, instead of raising an error

	* src/util/network.c, src/util/network.h: Fix error
	  handling of port profile APIs
	* src/conf/domain_conf.c, src/conf/network_conf.c: Update
	  for API changes

2011-11-15  Daniel P. Berrange  <berrange@redhat.com>

	Rename virVirtualPortProfileParams & APIs
	Rename the virVirtualPortProfileParams struct to be
	virNetDevVPortProfile, and rename the APIs to match
	this prefix.

	* src/util/network.c, src/util/network.h: Rename port profile
	  APIs
	* src/conf/domain_conf.c, src/conf/domain_conf.h,
	  src/conf/network_conf.c, src/conf/network_conf.h,
	  src/network/bridge_driver.c, src/qemu/qemu_hotplug.c,
	  src/util/macvtap.c, src/util/macvtap.h: Update for
	  renamed APIs/structs

2011-11-15  Stefan Berger  <stefanb@us.ibm.com>

	maint: Add Michael Wood as an author
	Add Michael Wood <esiotrot@gmail.com> as an author.

2011-11-15  Michael Wood  <esiotrot@gmail.com>

	PATCH: Fix build without MACVTAP
	Hi

	Commit c31d23a78715f1144c73862c46ab0436de8b5e85 removed the "conn"
	parameter from qemuPhysIfaceConnect(), but it's still used if
	WITH_MACVTAP is false.  Also, it's still mentioned in the comment
	above the function:

	/**
	 * qemuPhysIfaceConnect:
	 * @def: the definition of the VM (needed by 802.1Qbh and audit)
	 * @conn: pointer to virConnect object
	 * @driver: pointer to the qemud_driver
	 * @net: pointer to he VM's interface description with direct device type
	 * @qemuCaps: flags for qemu
	 *
	 * Returns a filedescriptor on success or -1 in case of error.
	 */
	int
	qemuPhysIfaceConnect(virDomainDefPtr def,
	                     struct qemud_driver *driver,
	                     virDomainNetDefPtr net,
	                     virBitmapPtr qemuCaps,
	                     enum virVMOperationType vmop)
	{
	    int rc;
	#if WITH_MACVTAP
	[...]
	#else
	    (void)def;
	    (void)conn;
	    (void)net;
	    (void)qemuCaps;
	    (void)driver;
	    (void)vmop;
	    qemuReportError(VIR_ERR_INTERNAL_ERROR,
	                    "%s", _("No support for macvtap device"));
	    rc = -1;
	#endif
	    return rc;
	}

	--
	Michael Wood <esiotrot@gmail.com>

	From f4fc43b4111a4c099395c55902e497b8965e2b53 Mon Sep 17 00:00:00 2001
	From: Michael Wood <esiotrot@gmail.com>
	Date: Sat, 12 Nov 2011 13:37:53 +0200
	Subject: [PATCH] Fix build without MACVTAP.

2011-11-15  Guido Günther  <agx@sigxcpu.org>

	storage: forbid rebuilding existing disk storage pools
	which would blow away all volumes. Honor VIR_STORAGE_POOL_BUILD_OVERWRITE
	to force a rebuild.

	This was caught by libvirt-tck's storage/110-disk-pool.t.

2011-11-12  Eric Blake  <eblake@redhat.com>

	API: add trivial qemu support for VIR_TYPED_PARAM_STRING
	Qemu will be the first driver to make use of a typed string in the
	next round of additions.  Separate out the trivial addition.

	* src/qemu/qemu_driver.c (qemudSupportsFeature): Advertise feature.
	(qemuDomainGetBlkioParameters, qemuDomainGetMemoryParameters)
	(qemuGetSchedulerParametersFlags, qemudDomainBlockStatsFlags):
	Allow typed strings flag where trivially supported.

2011-11-12  Eric Blake  <eblake@redhat.com>

	API: remote support for VIR_TYPED_PARAM_STRING
	Send and receive string typed parameters across RPC.  This also
	completes the back-compat mentioned in the previous patch - the
	only time we have an older client talking to a newer server is
	if RPC is in use, so filtering out strings during RPC prevents
	returning an unknown type to the older client.

	* src/remote/remote_protocol.x (remote_typed_param_value): Add
	another union value.
	* daemon/remote.c (remoteDeserializeTypedParameters): Handle
	strings on rpc.
	(remoteSerializeTypedParameters): Likewise; plus filter out
	strings when replying to older clients.  Adjust callers.
	* src/remote/remote_driver.c (remoteFreeTypedParameters)
	(remoteSerializeTypedParameters)
	(remoteDeserializeTypedParameters): Handle strings on rpc.
	* src/rpc/gendispatch.pl: Properly clean up typed arrays.
	* src/remote_protocol-structs: Update.
	Based on an initial patch by Hu Tao, with feedback from
	Daniel P. Berrange.

2011-11-12  Eric Blake  <eblake@redhat.com>

	API: add VIR_TYPED_PARAM_STRING
	This allows strings to be transported between client and server
	in the context of name-type-value virTypedParameter functions.
	For compatibility,

	    o new clients will not send strings to old servers, based on
	      a feature check
	    o new servers will not send strings to old clients without the
	      flag VIR_TYPED_PARAM_STRING_OKAY; this will be enforced at
	      the RPC layer in the next patch, so that drivers need not
	      worry about it in general.  The one exception is that
	      virDomainGetSchedulerParameters lacks a flags argument, so
	      it must not return a string; drivers that forward that
	      function on to virDomainGetSchedulerParametersFlags will
	      have to pay attention to the flag.
	    o the flag VIR_TYPED_PARAM_STRING_OKAY is set automatically,
	      based on a feature check (so far, no driver implements it),
	      so clients do not have to worry about it

	Future patches can then enable the feature on a per-driver basis.

	This patch also ensures that drivers can blindly strdup() field
	names (previously, a malicious client could stuff 80 non-NUL bytes
	into field and cause a read overrun).

	* src/libvirt_internal.h (VIR_DRV_FEATURE_TYPED_PARAM_STRING): New
	driver feature.
	* src/libvirt.c (virTypedParameterValidateSet)
	(virTypedParameterSanitizeGet): New helper functions.
	(virDomainSetMemoryParameters, virDomainSetBlkioParameters)
	(virDomainSetSchedulerParameters)
	(virDomainSetSchedulerParametersFlags)
	(virDomainGetMemoryParameters, virDomainGetBlkioParameters)
	(virDomainGetSchedulerParameters)
	(virDomainGetSchedulerParametersFlags, virDomainBlockStatsFlags):
	Use them.
	* src/util/util.h (virTypedParameterArrayClear): New helper
	function.
	* src/util/util.c (virTypedParameterArrayClear): Implement it.
	* src/libvirt_private.syms (util.h): Export it.
	Based on an initial patch by Hu Tao, with feedback from
	Daniel P. Berrange.

2011-11-12  Eli Qiao  <taget@linux.vnet.ibm.com>

	util: fix compile error on debian
	Add virnetdev.h,virnetdevbridge.h,virnetdevtap.h to private symbols,
	since debian linker no longer allows transitive link resolution

2011-11-12  Eric Blake  <eblake@redhat.com>

	qemu: fix domjobabort regression
	This reverts commit ef1065cf5ac; see also this bug report:
	https://bugzilla.redhat.com/show_bug.cgi?id=751900

	In qemu 0.15.1 and earlier, during migration to file, the
	qemu_savevm_state_begin and qemu_savevm_state_iterate methods
	will both process as much migration data as possible until either

	  1. The file descriptor returns EAGAIN
	  2. The bandwidth rate limit is reached

	If we set the rate limit to ULONG_MAX, test 2 never becomes true. We're
	passing a plain file descriptor to QEMU and POSIX does not support EAGAIN on
	regular files / block devices, so test 1 never becomes true either.

	In the 'virsh save --bypass-cache' case, we pass a pipe instead of a
	regular fd, but using a pipe adds I/O overhead, so always passing a
	pipe just so qemu can see EAGAIN doesn't seem nice.

	The ultimate fix needs to come from qemu - background migration must
	respect asynchronous abort requests, or else periodically return
	control to the main handling loop without an EAGAIN and without
	waiting to hit an insanely large amount of data.  But until a
	version of qemu is fixed to support "unlimited" data rates while
	still allowing cancellation, the best we can do is avoid the
	automatic use of unlimited rates from within libvirt (users can
	still explicitly change the migration rates, if they are aware that
	they are giving up the ability to cancel a job).

	Reverting the lone use of QEMU_DOMAIN_FILE_MIG_BANDWIDTH_MAX is
	the simplest patch; this slows migration back down to a default
	32M/sec cap, but also ensures that the main qemu processing loop
	will still be responsive to cancellation requests.  Hopefully
	upstream qemu will provide us a means of safely using unlimited
	speed, including a runtime probe of that capability.

	* src/qemu/qemu_migration.c (qemuMigrationToFile): Revert attempt
	to use unlimited migration bandwidth when migrating to file.

2011-11-12  Hu Tao  <hutao@cn.fujitsu.com>

	fix two bugs in bridge_driver.c
	steps to reproduce:

	1. having a network xml file(named default.xml) like this one:

	<network>
	  <name>default</name>
	  <uuid>c5322c4c-81d0-4985-a363-ad6389780d89</uuid>
	  <bridge name="virbr0" />
	  <forward/>
	  <ip address="192.168.122.1" netmask="255.255.255.0">
	    <dhcp>
	      <range start="192.168.122.2" end="192.168.122.254" />
	    </dhcp>
	  </ip>
	</network>

	in /etc/libvirt/qemu/networks/, and mark it as autostart:

	$ ls -l /etc/libvirt/qemu/networks/autostart
	total 0
	lrwxrwxrwx 1 root root 14 Oct 12 14:02 default.xml -> ../default.xml

	2. start libvirtd and the device virbr0 is not automatically up.

	The reason is that the function virNetDevExists is now returns 1 if
	the device exists, comparing to the former one returns 0 if the device
	exists. But with only this fix will cause a segmentation fault(the same
	steps as above)  that is fixed by the second chunk of code.

2011-11-12  Eric Blake  <eblake@redhat.com>

	build: drop useless dirent.h includes
	* .gnulib: Update to latest, for improved syntax-check.
	* src/lxc/lxc_container.c (includes): Drop unused include.
	* src/network/bridge_driver.c: Likewise.
	* src/node_device/node_device_linux_sysfs.c: Likewise.
	* src/openvz/openvz_driver.c: Likewise.
	* src/qemu/qemu_conf.c: Likewise.
	* src/storage/storage_backend_iscsi.c: Likewise.
	* src/storage/storage_backend_mpath.c: Likewise.
	* src/uml/uml_conf.c: Likewise.
	* src/uml/uml_driver.c: Likewise.

2011-11-12  Eric Blake  <eblake@redhat.com>

	xenapi: remove unused variable
	  CC     libvirt_driver_xenapi_la-xenapi_driver.lo
	xenapi/xenapi_driver.c: In function 'xenapiDomainGetVcpus':
	xenapi/xenapi_driver.c:1209:21: error: variable 'cpus' set but not used [-Werror=unused-but-set-variable]

	* src/xenapi/xenapi_driver.c (xenapiDomainGetVcpus): Silence
	compiler warning.

2011-11-11  Eric Blake  <eblake@redhat.com>

	maint: use mailmap, not AUTHORS, for secondary addresses
	* AUTHORS: Move Stefan's second entry...
	* .mailmap: ...here.

2011-11-11  Stefan Berger  <stefanb@us.ibm.com>

	maint: fix make syntax-check
	Add my 2nd email to the list of AUTHORS to get 'make syntax-check'
	to pass.

2011-11-11  Stefan Berger  <stefanb@linux.vnet.ibm.com>

	Remove code instantiating filters on direct interfaces
	Remove the code that instantiates network filters on direct type
	of interfaces. The parser already does not accept it.

2011-11-10  Daniel P. Berrange  <berrange@redhat.com>

	Disable numactl on ARM architectures too
	* libvirt.spec.in: Disable numactl on ARM

	Add libvirt confdir to files section in mingw32 spec
	* mingw32-libvirt.spec.in: Ensure we own the confdir

2011-11-10  Eric Blake  <eblake@redhat.com>

	nwfilter: simplify execution of ebiptables scripts
	It's not worth even worrying about a temporary file, unless we
	ever expect the script to exceed maximum command-line argument
	length limits.

	* src/nwfilter/nwfilter_ebiptables_driver.c (ebiptablesExecCLI):
	Run the commands as an argument to /bin/sh, rather than worrying
	about a temporary file.
	(ebiptablesWriteToTempFile): Delete unused function.

2011-11-10  Eric Blake  <eblake@redhat.com>

	nwfilter: avoid failure with noexec /tmp
	If /tmp is mounted with the noexec flag (common on security-conscious
	systems), then nwfilter will fail to initialize, because we cannot
	run any temporary script via virRun("/tmp/script"); but we _can_
	use "/bin/sh /tmp/script".  For that matter, using /tmp risks collisions
	with other unrelated programs; we already have /var/run/libvirt as a
	dedicated temporary directory for use by libvirt.

	* src/nwfilter/nwfilter_ebiptables_driver.c
	(ebiptablesWriteToTempFile): Use internal directory, not /tmp;
	drop attempts to make script executable; and detect close error.
	(ebiptablesExecCLI): Switch to virCommand, and invoke the shell to
	read the script, rather than requiring an executable script.

2011-11-10  Daniel P. Berrange  <berrange@redhat.com>

	Adjust naming of network device bandwidth management APIs
	Rename virBandwidth to virNetDevBandwidth, and virRate to
	virNetDevBandwidthRate.

	* src/util/network.c, src/util/network.h: Rename bandwidth
	  structs and APIs
	* src/conf/domain_conf.c, src/conf/domain_conf.h,
	  src/conf/network_conf.c, src/conf/network_conf.h,
	  src/lxc/lxc_driver.c, src/network/bridge_driver.c,
	  src/qemu/qemu_command.c, src/util/macvtap.c,
	  src/util/macvtap.h, tools/virsh.c: Update for API changes.

2011-11-10  Daniel P. Berrange  <berrange@redhat.com>

	Santize naming of socket address APIs
	The socket address APIs in src/util/network.h either take the
	form  virSocketAddrXXX, virSocketXXX or virSocketXXXAddr.

	Sanitize this so everything is virSocketAddrXXXX, and ensure
	that the virSocketAddr parameter is always the first one.

	* src/util/network.c, src/util/network.h: Santize socket
	  address API naming
	* src/conf/domain_conf.c, src/conf/network_conf.c,
	  src/conf/nwfilter_conf.c, src/network/bridge_driver.c,
	  src/nwfilter/nwfilter_ebiptables_driver.c,
	  src/nwfilter/nwfilter_learnipaddr.c,
	  src/qemu/qemu_command.c, src/rpc/virnetsocket.c,
	  src/util/dnsmasq.c, src/util/iptables.c,
	  src/util/virnetdev.c, src/vbox/vbox_tmpl.c: Update for
	  API renaming

2011-11-10  Daniel P. Berrange  <berrange@redhat.com>

	Split bridge.h into three separate files
	Following the renaming of the bridge management APIs, we can now
	split the source file into 3 corresponding pieces

	 * src/util/virnetdev.c: APIs for any type of network interface
	 * src/util/virnetdevbridge.c: APIs for bridge interfaces
	 * src/util/virnetdevtap.c: APIs for TAP interfaces

	* src/util/virnetdev.c, src/util/virnetdev.h,
	  src/util/virnetdevbridge.c, src/util/virnetdevbridge.h,
	  src/util/virnetdevtap.c, src/util/virnetdevtap.h: Copied
	  from bridge.{c,h}
	* src/util/bridge.c, src/util/bridge.h: Split into 3 pieces
	* src/lxc/lxc_driver.c, src/network/bridge_driver.c,
	  src/openvz/openvz_driver.c, src/qemu/qemu_command.c,
	  src/qemu/qemu_conf.h, src/uml/uml_conf.c, src/uml/uml_conf.h,
	  src/uml/uml_driver.c: Update #include directives

2011-11-10  Daniel P. Berrange  <berrange@redhat.com>

	Remove usage of brctl command line tool
	Convert the virNetDevBridgeSetSTP and virNetDevBridgeSetSTPDelay
	to use ioctls instead of spawning brctl.

	Implement the virNetDevBridgeGetSTP and virNetDevBridgeGetSTPDelay
	methods which were declared in the header but never existed

	* src/util/bridge.c: Convert to use bridge ioctls instead of brctl

2011-11-10  Daniel P. Berrange  <berrange@redhat.com>

	Add an API for retrieving the MAC address of an interface
	* src/util/bridge.c, src/util/bridge.h: Add virNetDevGetMAC

2011-11-10  Daniel P. Berrange  <berrange@redhat.com>

	Expose MTU management APIs
	The MTU management APIs are useful to other code inside libvirt,
	so should be exposed as non-static APIs.

	* src/util/bridge.c, src/util/bridge.h: Expose virNetDevSetMTU,
	  virNetDevSetMTUFromDevice & virNetDevGetMTU

2011-11-10  Daniel P. Berrange  <berrange@redhat.com>

	Turn two int parameters into bools in bridge APIs
	* src/util/bridge.c, src/util/bridge.h: s/int/bool/ in
	  virNetDevSetOnline and virNetDevBridgeSetSTP

2011-11-10  Daniel P. Berrange  <berrange@redhat.com>

	Rename all brXXXX APIs to follow new convention
	The existing brXXX APIs in src/util/bridge.h are renamed to
	follow one of three different conventions

	 - virNetDevXXX       - operations for any type of interface
	 - virNetDevBridgeXXX - operations for bridge interfaces
	 - virNetDevTapXXX    - operations for tap interfaces

	* src/util/bridge.h, src/util/bridge.c: Rename all APIs
	* src/lxc/lxc_driver.c, src/network/bridge_driver.c,
	  src/qemu/qemu_command.c, src/uml/uml_conf.c,
	  src/uml/uml_driver.c: Update for API renaming

2011-11-10  Daniel P. Berrange  <berrange@redhat.com>

	Make all brXXX APIs raise errors, instead of returning errnos
	Currently every caller of the brXXX APIs has to store the returned
	errno value and then raise an error message. This results in
	inconsistent error messages across drivers, additional burden on
	the callers and makes the error reporting inaccurate since it is
	hard to distinguish different scenarios from 1 errno value.

	* src/util/bridge.c: Raise errors instead of returning errnos
	* src/lxc/lxc_driver.c, src/network/bridge_driver.c,
	  src/qemu/qemu_command.c, src/uml/uml_conf.c,
	  src/uml/uml_driver.c: Remove error reporting code

2011-11-10  Daniel P. Berrange  <berrange@redhat.com>

	Remove 'brControl' object
	The bridge management APIs in src/util/bridge.c require a brControl
	object to be passed around. This holds the file descriptor for the
	control socket. This extra object complicates use of the API for
	only a minor efficiency gain, which is in turn entirely offset by
	the need to fork/exec the brctl command for STP configuration.

	This patch removes the 'brControl' object entirely, instead opening
	the control socket & closing it again within the scope of each method.

	The parameter names for the APIs are also made to consistently use
	'brname' for bridge device name, and 'ifname' for an interface
	device name. Finally annotations are added for non-NULL parameters
	and return check validation

	* src/util/bridge.c, src/util/bridge.h: Remove brControl object
	  and update API parameter names & annotations.
	* src/lxc/lxc_driver.c, src/network/bridge_driver.c,
	  src/uml/uml_conf.h, src/uml/uml_conf.c, src/uml/uml_driver.c,
	  src/qemu/qemu_command.c, src/qemu/qemu_conf.h,
	  src/qemu/qemu_driver.c: Remove reference to 'brControl' object

2011-11-10  Eric Blake  <eblake@redhat.com>

	build: fix mingw build of gnulib openpty
	Commit f7bd00c12 pulled in a gnulib module that fails to compile
	on mingw.  Work around it while waiting for an upstream gnulib fix.

	* gnulib/local/lib/pty.in.h (openpty): Provide forward
	declarations of opaque structs not present on mingw.
	* gnulib/local/lib/openpty.c (openpty): Provide stub for mingw.

2011-11-10  Eric Blake  <eblake@redhat.com>

	build: allow for local gnulib diffs
	Commit f7bd00c12 pulled in a gnulib module that fails to compile
	on mingw.  While it would be nice to pull in a newer version of
	.gnulib that fixes this, it is difficult to backport any .gnulib
	update to older releases.  So, it makes sense to take advantage
	of gnulib-tool's ability to support local diffs, where we can
	apply specific diffs in our use of gnulib without waiting for
	upstream gnulib to pick up those changes, as well as avoiding
	a wholesale .gnulib update.  The existence of local diffs will
	also make it easier to backport fixes against a tarball (as long
	as a tarball and libvirt.git share the same .gnulib commit, then
	the tarball can be patched by applying the same local diffs as
	a post-release libvirt.git commit, without having to rerun an
	entire gnulib-tool bootstrap).

	This patch introduces the framework for supporting local diffs,
	without actually introducing any.

	* bootstrap.conf (local_gl_dir): New variable.
	* autogen.sh (bootstrap_hash): Hash any local diffs, to force a
	re-bootstrap if just diffs change.
	* cfg.mk (_update_required): Likewise.

2011-11-09  Alex Jia  <ajia@redhat.com>

	lxc: free error object to avoid memory leak
	Detected by Coverity. Leak introduced in commit 9d201a5.

	* src/lxc/lxc_driver.c: Clean up on failure.

2011-11-09  Alex Jia  <ajia@redhat.com>

	lxc: free 'ttyFDs' array on return from lxcVmStart
	Detected by Coverity. Leak introduced in commit 0f31f7b.

	* src/lxc/lxc_driver.c: Clean up on failure.

2011-11-09  Osier Yang  <jyang@redhat.com>

	qemu: Fix improper error message for disk detaching
	s/virDomainDeviceTypeToString/virDomainDiskDeviceTypeToString/

	Report by Xu He Jie <xuhj@linux.vnet.ibm.

2011-11-09  Xu He Jie  <xuhj@linux.vnet.ibm.com>

	virsh: Add VSH_OFLAG_EMPTY_OK for attach-disk command
	As the description of removing CDROM media from
	  http://wiki.libvirt.org/page/QEMUSwitchToLibvirt#eject_DEV

	Add flag 'VSH_OFLAG_EMPTY_OK' to the option 'source' of attach-disk

	Then avoid outputting <source> in the XML if 'source' was empty,
	rather than trusting libvirt domain_conf.c to understand an empty
	string.

2011-11-08  Daniel Veillard  <veillard@redhat.com>

	Release of libvirt-0.9.7
	* confiure.ac docs/news.html.in libvirt.spec.in: update for release
	* po/*.po*: update localizations and rebuilt

2011-11-08  Eric Blake  <eblake@redhat.com>

	build: fix build on platforms without ptsname_r
	MacOS lacks ptsname_r, and gnulib doesn't (yet) provide it.
	But we can avoid it altogether, by using gnulib openpty()
	instead.  Note that we do _not_ want the pt_chown module;
	gnulib uses it only to implement a replacement openpty() if
	the system lacks both openpty() and granpt(), but all
	systems that we currently port to either have at least one of
	openpty() and/or grantpt(), or lack ptys altogether.  That is,
	we aren't porting to any system that requires us to deal with
	the hassle of installing a setuid pt_chown helper just to use
	gnulib's ability to provide openpty() on obscure platforms.

	* .gnulib: Update to latest, for openpty fixes
	* bootstrap.conf (gnulib_modules): Add openpty, ttyname_r.
	(gnulib_tool_option_extras): Exclude pt_chown module.
	* src/util/util.c (virFileOpenTty): Rewrite in terms of openpty
	and ttyname_r.
	* src/util/util.h (virFileOpenTtyAt): Delete dead prototype.

2011-11-07  Daniel P. Berrange  <berrange@redhat.com>

	Add missing defaultConsoleTargetType callback for AppArmour
	Every instance of virCapsPtr must have the defaultConsoleTargetType
	field set.

	* src/security/virt-aa-helper.c: Add defaultConsoleTargetType to
	  virCapsPtr

2011-11-07  Daniel P. Berrange  <berrange@redhat.com>

	Fix sending/receiving of FDs when stream returns EAGAIN
	The code calling sendfd/recvfd was mistakenly assuming those
	calls would never block. They can in fact return EAGAIN and
	this is causing us to drop the client connection when blocking
	ocurrs while sending/receiving FDs.

	Fixing this is a little hairy on the incoming side, since at
	the point where we see the EAGAIN, we already thought we had
	finished receiving all data for the packet. So we play a little
	trick to reset bufferOffset again and go back into polling for
	more data.

	* src/rpc/virnetsocket.c, src/rpc/virnetsocket.h: Update
	  virNetSocketSendFD/RecvFD to return 0 on EAGAIN, or 1
	  on success
	* src/rpc/virnetclient.c: Move decoding of header & fds
	  out of virNetClientCallDispatch and into virNetClientIOHandleInput.
	  Handling blocking when sending/receiving FDs
	* src/rpc/virnetmessage.h: Add a 'donefds' field to track
	  how many FDs we've sent / received
	* src/rpc/virnetserverclient.c: Handling blocking when
	  sending/receiving FDs

2011-11-05  Eric Blake  <eblake@redhat.com>

	build: silence compiler warning on BSD
	Building on 64-bit FreeBSD 8.2 complained about a cast between
	a pointer and a smaller integer.  Going through an intermediate
	cast shuts up the compiler.

	* src/util/threads-pthread.c (virThreadSelfID): Silence a warning.

2011-11-05  Eric Blake  <eblake@redhat.com>

	build: fix linking on BSD
	While building on FreeBSD (and after fixing a ptsname_r link error),
	I got this failure:

	./.libs/libvirt_util.a(libvirt_util_la-threads.o)(.text+0x240): In function `virThreadCreate':
	util/threads-pthread.c:185: undefined reference to `pthread_create'

	It turns out that gnulib used only pthread_join for LIB_PTHREAD,
	but on FreeBSD, libc provides that (as a stub function); whereas
	the more complex pthread_create really does require -pthread,
	which gnulib tracked under [LT]LIBMULTITHREAD.

	* configure.ac (LIBS): Check LIBMULTITHREAD alongside LIB_PTHREAD.
	* src/Makefile.am (THREAD_LIBS): New variable.
	(libvirt_util_la_LIBADD, libvirt_lxc_LDADD): Use it.

2011-11-05  Laine Stump  <laine@laine.org>

	remote: fix mingw32 build
	tty is initialized, and later set in code that is compiled for all
	platforms, but is only used in a section that's inside #ifndef WIN32.

2011-11-04  Eric Blake  <eblake@redhat.com>

	lxc: avoid use-after-free
	I got this weird failure:

	error: Failed to start domain simple
	error: internal error cannot mix caller fds with blocking execution

	and tracked it down to a use-after-free - virCommandSetOutputFD
	was storing the address of a stack-local variable, which then
	went out of scope before the virCommandRun that dereferenced it.

	Bug introduced in commit 451cfd05 (0.9.2).

	* src/lxc/lxc_driver.c (lxcBuildControllerCmd): Move log fd
	registration...
	(lxcVmStart): ...to caller.

2011-11-04  Daniel P. Berrange  <berrange@redhat.com>

	Fix naming of constant for disk event
	All constants related to events should have a prefix of
	VIR_DOMAIN_EVENT_

	* include/libvirt/libvirt.h.in, src/qemu/qemu_domain.c:
	  Rename VIR_DOMAIN_DISK_CHANGE_MISSING_ON_START to
	  VIR_DOMAIN_EVENT_DISK_CHANGE_MISSING_ON_START

2011-11-04  Jiri Denemark  <jdenemar@redhat.com>

	conf: Don't free uninitialized pointer
	This causes libvirtd to crash when both <boot dev='...'/> and <boot
	order='...'/> are used in one domain XML. Introduced by
	5fa3d775a9f8cdb3423373eb084219aaf778df11

2011-11-04  Eric Blake  <eblake@redhat.com>

	build: fix deep VPATH builds
	I ran into the following build failure:
	$ mkdir -p build1 build2/a/very/deep/hierarcy
	$ cd build2/a/very/deep/hierarcy
	$ ../../../../../configure && make
	$ cd ../../../../build1
	$ ../configure && make
	...
	../../src/remote/remote_protocol.c:7:55: fatal error: ../../../../../src/remote/remote_protocol.h: No such file or directory

	Turns out that we were sometimes generating the remote_protocol.c
	file with information from the VPATH build, which is bad, since
	any file shipped in the tarball should be idempotent no matter how
	deep the VPATH build tree that created it.

	* src/rpc/genprotocol.pl: Don't embed VPATH into generated file.

2011-11-04  Philipp Hahn  <hahn@univention.de>

	doc: Add <deviceboot> capability.
	Allow /capabilities/guest/features/deviceboot.

2011-11-03  Eric Blake  <eblake@redhat.com>

	lxc: use common code for process cleanup
	Based on a Coverity report - the return value of waitpid() should
	always be checked, to avoid problems with leaking resources.

	* src/lxc/lxc_controller.c (lxcControllerRun): Use simpler virPidAbort.

2011-11-03  Daniel P. Berrange  <berrange@redhat.com>

	Fix default console type setting
	The default console type may vary based on the OS type. ie a Xen
	paravirt guests wants a 'xen' console, while a fullvirt guests
	wants a 'serial' console.

	A plain integer default console type in the capabilities does
	not suffice. Instead introduce a callback that is passed the
	OS type.

	* src/conf/capabilities.h: Use a callback for default console
	  type
	* src/conf/domain_conf.c, src/conf/domain_conf.h: Use callback
	  for default console type. Add missing LXC/OpenVZ console types.
	* src/esx/esx_driver.c, src/libxl/libxl_conf.c,
	  src/lxc/lxc_conf.c, src/openvz/openvz_conf.c,
	  src/phyp/phyp_driver.c, src/qemu/qemu_capabilities.c,
	  src/uml/uml_conf.c, src/vbox/vbox_tmpl.c,
	  src/vmware/vmware_conf.c, src/xen/xen_hypervisor.c,
	  src/xenapi/xenapi_driver.c: Set default console type callback

2011-11-03  Daniel P. Berrange  <berrange@redhat.com>

	Set aliases for LXC/UML console devices
	To allow virDomainOpenConsole to access non-primary consoles,
	device aliases are required to be set. Until now only the QEMU
	driver has done this. Update LXC & UML to set aliases for any
	console devices

	* src/lxc/lxc_driver.c, src/uml/uml_driver.c: Set aliases
	  for console devices

2011-11-03  Daniel P. Berrange  <berrange@redhat.com>

	Default console target type with no <target> element
	When no <target> element was set at all, the default console
	target type was not being honoured

	* src/conf/domain_conf.c: Set default target type for consoles
	  with no <target>

2011-11-03  Daniel P. Berrange  <berrange@redhat.com>

	Add support for multiple consoles in LXC
	Currently the LXC controller only supports setup of a single
	text console. This is wired up to the container init's stdio,
	as well as /dev/console and /dev/tty1. Extending support for
	multiple consoles, means wiring up additional PTYs to /dev/tty2,
	/dev/tty3, etc, etc. The LXC controller is passed multiple open
	file handles, one for each console requested.

	* src/lxc/lxc_container.c, src/lxc/lxc_container.h: Wire up
	  all the /dev/ttyN links required to symlink to /dev/pts/NN
	* src/lxc/lxc_container.h: Open more container side /dev/pts/NN
	  devices, and adapt event loop to handle I/O from all consoles
	* src/lxc/lxc_driver.c: Setup multiple host side PTYs

2011-11-03  Daniel P. Berrange  <berrange@redhat.com>

	Rewrite LXC I/O forwarding to use main event loop
	The current I/O code for LXC uses a hand crafted event loop
	to forward I/O between the container & host app, based on
	epoll to handle EOF on PTYs. This event loop is not easily
	extensible to add more consoles, or monitor other types of
	file descriptors.

	Remove the custom event loop and replace it with a normal
	libvirt event loop. When detecting EOF on a PTY, disable
	the event watch on that FD, and fork off a background thread
	that does a edge-triggered epoll() on the FD. When the FD
	finally shows new incoming data, the thread re-enables the
	watch on the FD and exits.

	When getting EOF from a read() on the PTY, the existing code
	would do waitpid(WNOHANG) to see if the container had exited.
	Unfortunately there is a race condition, because even though
	the process has closed its stdio handles, it might still
	exist.

	To deal with this the new event loop uses a SIG_CHILD handler
	to perform the waitpid only when the container is known to
	have actually exited.

	* src/lxc/lxc_controller.c: Rewrite the event loop to use
	  the standard APIs.

2011-11-03  Daniel P. Berrange  <berrange@redhat.com>

	Fix crash formatting virtio console
	qemuBuildVirtioSerialPortDevStr was mistakenly accessing the
	target.name field in the virDomainChrDef object for chardevs
	belonging to a console. Those chardevs only have port set,
	and if there's > 1 console, the > 1port number results in
	trying to access a target.name with address 0x1

	* src/qemu/qemu_command.c: Fix target.name handling and
	  make code more robust wrt error reporting

	* src/qemu/qemu_command.c: Conditionally access target.name

2011-11-03  Daniel P. Berrange  <berrange@redhat.com>

	Allow multiple consoles per virtual guest
	While Xen only has a single paravirt console, UML, and
	QEMU both support multiple paravirt consoles. The LXC
	driver can also be trivially made to support multiple
	consoles. This patch extends the XML to allow multiple
	<console> elements in the XML. It also makes the UML
	and QEMU drivers support this config.

	* src/conf/domain_conf.c, src/conf/domain_conf.h: Allow
	  multiple <console> devices
	* src/lxc/lxc_driver.c, src/xen/xen_driver.c,
	  src/xenxs/xen_sxpr.c, src/xenxs/xen_xm.c: Update for
	  internal API changes
	* src/security/security_selinux.c, src/security/virt-aa-helper.c:
	  Only label consoles that aren't a copy of the serial device
	* src/qemu/qemu_command.c, src/qemu/qemu_driver.c,
	  src/qemu/qemu_process.c, src/uml/uml_conf.c,
	  src/uml/uml_driver.c: Support multiple console devices
	* tests/qemuxml2xmltest.c, tests/qemuxml2argvtest.c: Extra
	  tests for multiple virtio consoles. Set QEMU_CAPS_CHARDEV
	  for all console /channel tests
	* tests/qemuxml2argvdata/qemuxml2argv-channel-virtio-auto.args,
	  tests/qemuxml2argvdata/qemuxml2argv-channel-virtio.args
	  tests/qemuxml2argvdata/qemuxml2argv-console-virtio.args: Update
	  for correct chardev syntax
	* tests/qemuxml2argvdata/qemuxml2argv-console-virtio-many.args,
	  tests/qemuxml2argvdata/qemuxml2argv-console-virtio-many.xml: New
	  test file

2011-11-03  Daniel P. Berrange  <berrange@redhat.com>

	Remove translations in socket test case
	The test case errors should not be translated since they're only
	targetted at developers, not users.

	* tests/virnetsockettest.c: Remove error reporting with translations

2011-11-03  Guido Günther  <agx@sigxcpu.org>

	virnetsockettest: Use a temporary directory in /tmp
	to avoid exceeding UNIX_PATH_MAX

	Use ENAMETOOLONG if the the socket path is longer than UNIX_PATH_MAX

2011-11-03  Eric Blake  <eblake@redhat.com>

	xen: allow getting < max typed parameters
	Allow the user to call with nparams too small, per API documentation.

	* src/xen/xen_hypervisor.c (xenHypervisorGetSchedulerParameters):
	Allow fewer than max.
	* src/xen/xend_internal.c (xenDaemonGetSchedulerParameters):
	Likewise.

2011-11-03  Eric Blake  <eblake@redhat.com>

	test: drop redundant check
	libvirt.c guarantees that nparams is non-zero for scheduler parameters.

	* src/test/test_driver.c (testDomainGetSchedulerParamsFlags): Drop
	redundant check.  Avoid strcpy.

2011-11-03  Eric Blake  <eblake@redhat.com>

	lxc: allow getting < max typed parameters
	Allow the user to call with nparams too small, per API documentation.
	Also, libvirt.c filters out nparams of 0 for scheduler parameters.

	* src/lxc/lxc_driver.c (lxcDomainGetMemoryParameters): Allow fewer
	than max.
	(lxcGetSchedulerParametersFlags): Drop redundant check.

2011-11-03  Eric Blake  <eblake@redhat.com>

	libxl: allow getting < max typed parameters
	Allow the user to call with nparams too small, per API documentation.

	* src/libxl/libxl_driver.c
	(libxlDomainGetSchedulerParametersFlags): Allow fewer than max.

2011-11-03  Eric Blake  <eblake@redhat.com>

	esx: allow getting < max typed parameters
	Allow the user to call with nparams too small, per API documentation.

	* src/esx/esx_driver.c (esxDomainGetMemoryParameters): Drop
	redundant check.
	(esxDomainGetSchedulerParametersFlags): Allow fewer than max.

2011-11-03  Eric Blake  <eblake@redhat.com>

	API: document scheduler parameter names
	Document the parameter names that will be used by
	virDomain{Get,Set}SchedulerParameters{,Flags}, rather than
	hard-coding those names in each driver, to match what is
	done with memory, blkio, and blockstats parameters.

	* include/libvirt/libvirt.h.in (VIR_DOMAIN_SCHEDULER_CPU_SHARES)
	(VIR_DOMAIN_SCHEDULER_VCPU_PERIOD)
	(VIR_DOMAIN_SCHEDULER_VCPU_QUOTA, VIR_DOMAIN_SCHEDULER_WEIGHT)
	(VIR_DOMAIN_SCHEDULER_CAP, VIR_DOMAIN_SCHEDULER_RESERVATION)
	(VIR_DOMAIN_SCHEDULER_LIMIT, VIR_DOMAIN_SCHEDULER_SHARES): New
	field name macros.
	* src/qemu/qemu_driver.c (qemuSetSchedulerParametersFlags)
	(qemuGetSchedulerParametersFlags): Use new defines.
	* src/test/test_driver.c (testDomainGetSchedulerParamsFlags)
	(testDomainSetSchedulerParamsFlags): Likewise.
	* src/xen/xen_hypervisor.c (xenHypervisorGetSchedulerParameters)
	(xenHypervisorSetSchedulerParameters): Likewise.
	* src/xen/xend_internal.c (xenDaemonGetSchedulerParameters)
	(xenDaemonSetSchedulerParameters): Likewise.
	* src/lxc/lxc_driver.c (lxcSetSchedulerParametersFlags)
	(lxcGetSchedulerParametersFlags): Likewise.
	* src/esx/esx_driver.c (esxDomainGetSchedulerParametersFlags)
	(esxDomainSetSchedulerParametersFlags): Likewise.
	* src/libxl/libxl_driver.c (libxlDomainGetSchedulerParametersFlags)
	(libxlDomainSetSchedulerParametersFlags): Likewise.

2011-11-02  Daniel P. Berrange  <berrange@redhat.com>

	Fix off-by-one printing month in logging code
	The field 'mon' in 'struct tm' gives months 0-11, where as
	humans tend to expect months 1-12. Thus the month number
	needing adjusting by 1

	* src/util/logging.c: Use human friendly month number

2011-11-02  Daniel P. Berrange  <berrange@redhat.com>

	Add missing param initialization in qemuDomainBlockStatsFlags
	* src/qemu/qemu_driver.c: Fix use of uninitialized 'params'

2011-11-02  Wen Congyang  <wency@cn.fujitsu.com>

	fix crash when starting network
	commit 27908453 introduces a regression, and it will
	cause libvirt crashed when starting network.

	The reason is that tapfd may be NULL, but we dereference
	it without checking whether it is NULL.

2011-11-02  Eric Blake  <eblake@redhat.com>

	qemu: allow getting < max typed parameters
	Since all virTypedParameter APIs allow us to return the number
	of slots we actually populated, we should allow the user to
	call with nparams too small (without overrunning their array)
	or too large (ignoring the tail of the array that we can't fill),
	rather than requiring that they get things exactly right.

	Making this change will make it easier for a future patch to
	introduce VIR_TYPED_PARAM_STRING, with filtering in libvirt.c
	rather than in every single driver, since users already have
	to be prepared for *nparams to be smaller on exit than on entry.

	* src/qemu/qemu_driver.c (qemuDomainGetBlkioParameters)
	(qemuDomainGetMemoryParameters): Allow variable nparams on entry.
	(qemuGetSchedulerParametersFlags): Drop redundant check.
	(qemudDomainBlockStats, qemudDomainBlockStatsFlags): Rename...
	(qemuDomainBlockStats, qemuDomainBlockStatsFlags): ...to this.
	Don't return unavailable stats.

2011-11-02  Eric Blake  <eblake@redhat.com>

	docs: improve typed parameter documentation
	virDomainBlockStatsFlags was missing a check that was present in
	virDomainGetMemoryParameters.  Additionally, I found that the
	existing descriptions were a bit hard to read.  A later patch
	will fix qemu to return fewer than max parameters if @nparams
	was too small on input.

	* src/libvirt.c (virDomainGetMemoryParameters)
	(virDomainGetBlkioParameters, virDomainGetSchedulerParameters)
	(virDomainGetSchedulerParametersFlags):
	Tweak documentation wording.
	(virDomainBlockStatsFlags): Likewise, and add sanity check.

2011-11-02  Daniel P. Berrange  <berrange@redhat.com>

	Don't overwrite error message during VM cleanup
	If an LXC VM fails to start, quite a few cleanup paths will
	result in the original error message being overwritten. Some
	other cleanup paths also forgot to actually terminate the VM.

	* src/lxc/lxc_driver.c: Ensure VM is terminated on startup
	  failure and preserve original error

2011-11-02  Daniel P. Berrange  <berrange@redhat.com>

	Add support for probing filesystem with libblkid
	The LXC code for mounting container filesystems from block devices
	tries all filesystems in /etc/filesystems and possibly those in
	/proc/filesystems. The regular mount binary, however, first tries
	using libblkid to detect the format. Add support for doing the same
	in libvirt, since Fedora's /etc/filesystems is missing many formats,
	most notably ext4 which is the default filesystem Fedora uses!

	* src/Makefile.am: Link libvirt_lxc to libblkid
	* src/lxc/lxc_container.c: Probe filesystem format with libblkid

2011-11-02  Daniel P. Berrange  <berrange@redhat.com>

	Fix error message when failing to detect filesystem
	If we looped through /etc/filesystems trying to mount with each
	type and failed all options, we forget to actually raise an
	error message.

	* src/lxc/lxc_container.c: Raise error if unable to detect
	  the filesystems. Also fix existing error message

2011-11-02  Daniel P. Berrange  <berrange@redhat.com>

	Workaround for broken kernel autofs mounts
	The kernel automounter is mostly broken wrt to containers. Most
	notably if you start a new filesystem namespace and then attempt
	to unmount any autofs filesystem, it will typically fail with a
	weird error message like

	  Failed to unmount '/.oldroot/sys/kernel/security':Too many levels of symbolic links

	Attempting to detach the autofs mount using umount2(MNT_DETACH)
	will also fail with the same error. Therefore if we get any error on
	unmount()ing a filesystem from the old root FS when starting a
	container, we must immediately break out and detach the entire
	old root filesystem (ignoring any mounts below it).

	This has the effect of making the old root filesystem inaccessible
	to anything inside the container, but at the cost that the mounts
	live on in the kernel until the container exits. Given that SystemD
	uses autofs by default, we need LXC to be robust this scenario and
	thus this tradeoff is worthwhile.

	* src/lxc/lxc_container.c: Detach root filesystem if any umount
	  operation fails.

2011-11-02  Daniel P. Berrange  <berrange@redhat.com>

	Correctly handle '*' in /etc/filesystems
	The /etc/filesystems file can contain a '*' on the last line to
	indicate that /proc/filessystems should be tried next. We have
	a check that this '*' only occurs on the last line. Unfortunately
	when we then start reading /proc/filesystems, we mistakenly think
	we've seen '*' in /proc/filesystems and fail

	* src/lxc/lxc_container.c: Skip '*' validation when we're reading
	  /proc/filesystems

2011-11-02  Daniel P. Berrange  <berrange@redhat.com>

	Ensure errno is valid when returning from lxcContainerWaitForContinue
	Only some of the return paths of lxcContainerWaitForContinue will
	have set errno. In other paths we need to set it manually to avoid
	the caller getting a random stale errno value

	* src/lxc/lxc_container.c: Set errno in lxcContainerWaitForContinue

2011-11-02  Daniel P. Berrange  <berrange@redhat.com>

	Create /var/lib/libvirt/filesystems for LXC trees
	We already have a /var/lib/libvirt/images for OS install images.
	We need a separate /var/lib/libvirt/filesystems for OS install
	trees, since SELinux labelling will be different

	* libvirt.spec.in: Add /var/lib/libvirt/filesystems
	* src/Makefile.am: Create /var/lib/libvirt/filesystems

2011-11-02  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Support folders in the path of vpx:// connection URIs
	Allow the datacenter and compute resource parts of the path
	to be prefixed with folders. Therefore, the way the path is
	parsed has changed. Before, it was split in 2 or 3 items and
	the items' meanings were determined by their positions. Now
	the path can have 2 or more items and the the vCenter server
	is asked whether a folder, datacenter of compute resource
	with the specified name exists at the current hierarchy level.

	Before the datacenter and compute resource lookup automatically
	traversed folders during lookup. This is logic got removed
	and folders have to be specified explicitly.

	The proper datacenter path including folders is now used when
	accessing a datastore over HTTPS. This makes virsh dumpxml
	and define work for datacenters in folders.

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

2011-11-02  Patrice LACHANCE  <patlachance@gmail.com>

	esx: Support vSphere 5.x
	And virtual hardware version 8.

2011-11-02  Wen Ruo Lv  <lvroyce@linux.vnet.ibm.com>

	Fix URI alias prefix matching
	with /etc/libvirt/libvirt.conf below:
	uri_aliases = [
	  "hail=qemu:///system",
	  "sleet=qemu+ssh://root 9 115 122 57/system",
	  "sam=qemu+unix:///system?socket=/var/run/libvirt/libvirt-sock",
	]
	Neither "virsh -c hailly" nor "hai" should result in matching "hail=qemu:///system"

	Fix URI alias prefix matching when connecting

2011-11-02  Eric Blake  <eblake@redhat.com>

	docs: fix typo in <disk>/<target> example
	* docs/formatdomain.html.in: Use dev, not def.
	Reported by Alexander Biryukov.

2011-11-01  Michal Privoznik  <mprivozn@redhat.com>

	ServerClient: Flush cached data
	If daemon is using SASL it reads client data into a cache. This cache is
	big (usually 65KB) and can thus contain 2 or more messages. However,
	on socket event we can dispatch only one message. So if we read two
	messages at once, the second will not be dispatched as the socket event
	goes away with filling the cache.
	Moreover, when dispatching the cache we need to remember to take care
	of client max requests limit.

2011-11-01  Daniel P. Berrange  <berrange@redhat.com>

	Fix storage pool source comparison to avoid comparing with self
	If we are comparing storage pools we must skip comparing with
	ourself, so that re-defining an existing pool works

	* conf/storage_conf.c: Skip self when comparing

2011-11-01  Sage Weil  <sage@newdream.net>

	qemu: pass virConnectPtr into Domain{Attach,Detach}*
	The qemu RBD driver needs access to the conn in order to get the secret
	needed for connecting to the ceph cluster.

2011-11-01  Alex Jia  <ajia@redhat.com>

	qemu: plug memory leak
	Detected by Coverity. Leak introduced in commit 6cabc0b.

	* src/qemu/qemu_command.c: Clean up on failure.

2011-11-01  Matthias Bolte  <matthias.bolte@googlemail.com>

	python: Fix documentation of virStream recv
	This was fixed in be757a3f7baf93b for libvirt.c.

2011-10-31  Michal Privoznik  <mprivozn@redhat.com>

	startupPolicty: Minor cleanups
	This patch does some cleanups to my previous startupPolicy patchset.

2011-10-30  Osier Yang  <jyang@redhat.com>

	qemu: Restore the original states of PCI device when restarting daemon
	To support "managed" mode of host PCI device, we record the original
	states (unbind_from_stub, remove_slot, and reprobe) so that could
	reattach the device to host with original driver. But there is no XML
	for theses attrs, and thus after daemon is restarted, we lose the
	original states. It's easy to reproduce:

	    1) virsh start domain
	    2) virsh attach-device dom hostpci.xml (in 'managed' mode)
	    3) service libvirtd restart
	    4) virsh destroy domain

	    You will see the device won't be bound to the original driver
	if there was one.

	This patch is to solve the problem by introducing internal XML
	(won't be dumped to user, only dumped to status XML). The XML is:
	    <origstates>
	      <unbind/>
	      <remove_slot/>
	      <reprobe/>
	    </origstates>

	Which will be child node of <hostdev><source>...</souce></hostdev>.
	(only for PCI device).

	A new struct "virDomainHostdevOrigStates" is introduced for the XML,
	and the according members are updated when preparing the PCI device.
	And function "qemuUpdateActivePciHostdevs" is modified to honor
	the original states. Use of qemuGetPciHostDeviceList is removed
	in function "qemuUpdateActivePciHostdevs", and the "managed" value of
	the device config is honored by the change. This fixes another problem
	alongside:

	    qemuGetPciHostDeviceList set the device as "managed" force
	    regardless of whether the device is configured as "managed='yes'"
	    or not in XML, which is not right.

2011-10-30  Matthias Bolte  <matthias.bolte@googlemail.com>

	vbox: Add support for VirtualBox 4.1
	Deal with the incompatible changes in the VirtualBox 4.1 API.

	INetworkAdapter has its different AttachTo* method replaced by
	a settable attachmentType property.

	The maximum number of network adapters is now requestable per
	chipset type.

	The OpenMedium method got a bool parameter to request opening
	a medium under a new IID.

2011-10-30  Matthias Bolte  <matthias.bolte@googlemail.com>

	vbox: Support shared folders
	Shared folders are handled as filesystems and can also be hotplugged.

2011-10-30  Matthias Bolte  <matthias.bolte@googlemail.com>

	xenapi: Improve error reporting in xenapiOpen once again
	privP->session->error_description is a list and in order to get the
	complete error message all parts of the list should be concatenated.
	xenapiSessionErrorHandler does this when its third parameter is NULL.
	The current code discards all but the first part of the error message
	resulting in a potentially incomplete error message.

	This partly reverts 006be75ee214f9b4, that tried to avoid reporting
	a (null) in the error message. The actual problem is more general in
	returnErrorFromSession that might return NULL if there is no error.

	Make sure that returnErrorFromSession return non-NULL always. Also
	don't skip the last error message part.

2011-10-29  Roopa Prabhu  <roprabhu@cisco.com>

	macvtap: Fix error return value convention/inconsistencies
	- changed some return 1's to return -1
	- changed if (rc) error checks to if (rc < 0)
	- fixed some other minor convention violations

	I might have missed some. Can fix in another patch or can respin

	Reported-by: Eric Blake <eblake@redhat.com>
	Reported-by: Laine Stump <laine@laine.org>

2011-10-29  Josh Durgin  <josh.durgin@dreamhost.com>

	Use a common xml type for ceph secret usage.
	The types used in domaincommon.rng and secret.rng should be the same.

	Move genericName to basictypes.rng, then drop redundant types now
	that secret.rng uses basictypes.rng.

2011-10-29  Xu He Jie  <xuhj@linux.vnet.ibm.com>

	pci address conflict when virtio disk with drive type
	When using the xml as below:
	------------------------------------------------------
	<devices>
	  <emulator>/home/soulxu/data/work-code/qemu-kvm/x86_64-softmmu/qemu-system-x86_64</emulator>
	    <disk type='file' device='disk'>
	    <driver name='qemu' type='qcow2'/>
	    <source file='/home/soulxu/data/VM/images/linux.img'/>
	    <target dev='vda' bus='virtio'/>
	    <address type='drive' controller='0' bus='0' unit='0'/>
	  </disk>
	  <input type='mouse' bus='ps2'/>
	  <graphics type='vnc' port='-1' autoport='yes'/>
	  <video>
	    <model type='cirrus' vram='9216' heads='1'/>
	    <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
	  </video>
	  <memballoon model='virtio'>
	    <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
	  </memballoon>
	</devices>
	------------------------------------------------------

	Then can't startup qemu, the error message as below:
	virsh # start test-vm
	error: Failed to start domain test-vm
	error: internal error process exited while connecting to monitor: qemu-system-x86_64: -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3: PCI: slot 3 function 0 not available for virtio-balloon-pci, in use by virtio-blk-pci
	qemu-system-x86_64: -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3: Device 'virtio-balloon-pci' could not be initialized

	So adding check for bus type and address type. Only the address of pci type support by virtio bus.

2011-10-29  Eric Blake  <eblake@redhat.com>

	secret: fix bad patch application
	In hand-applying Josh and Sage's patch, I missed out on a break.

	* src/conf/secret_conf.c (virSecretDefFree): Fix my botch.

2011-10-29  Josh Durgin  <josh.durgin@dreamhost.com>

	storage: add auth to virDomainDiskDef
	Add additional fields to let you specify the how to authenticate with a disk.
	The secret to use may be referenced by a usage string or a UUID, i.e.:

	<auth username='myuser'>
	 <secret type='ceph' usage='secretname'/>
	</auth>

	or

	<auth username='myuser'>
	 <secret type='ceph' uuid='0a81f5b2-8403-7b23-c8d6-21ccc2f80d6f'/>
	</auth>

2011-10-29  Sage Weil  <sage@newdream.net>

	secret: add Ceph secret type
	Add a new secret type to store a Ceph authentication key. The name
	is simply an identifier for easy human reference.

	The xml looks like this:

	<secret ephemeral='no' private='no'>
	 <uuid>0a81f5b2-8403-7b23-c8d6-21ccc2f80d6f</uuid>
	 <usage type='ceph'>
	   <name>mycluster_admin</name>
	 </usage>
	</secret>

2011-10-29  Alex Jia  <ajia@redhat.com>

	qemu: plug memory leak
	Leak introduced in commit c1bc3d89.
	Detected by valgrind:

	==18462== 1,100 bytes in 1 blocks are definitely lost in loss record 183 of 184
	==18462==    at 0x4A05FDE: malloc (vg_replace_malloc.c:236)
	==18462==    by 0x4A06167: realloc (vg_replace_malloc.c:525)
	==18462==    by 0x4AADBB: virReallocN (memory.c:161)
	==18462==    by 0x4A975E: virBufferGrow (buf.c:117)
	==18462==    by 0x4A9D92: virBufferVasprintf (buf.c:290)
	==18462==    by 0x4A9EF7: virBufferAsprintf (buf.c:263)
	==18462==    by 0x429488: qemuBuildControllerDevStr (qemu_command.c:1993)
	==18462==    by 0x42C4B6: qemuBuildCommandLine (qemu_command.c:3803)
	==18462==    by 0x41A604: testCompareXMLToArgvHelper (qemuxml2argvtest.c:124)
	==18462==    by 0x41BB81: virtTestRun (testutils.c:141)
	==18462==    by 0x416DFF: mymain (qemuxml2argvtest.c:369)
	==18462==    by 0x41B277: virtTestMain (testutils.c:696)
	==18462==
	==18462== LEAK SUMMARY:
	==18462==    definitely lost: 1,100 bytes in 1 blocks
	==18462==    indirectly lost: 0 bytes in 0 blocks

	* src/qemu/qemu_command.c (qemuBuildCommandLine): Clean up on success.

2011-10-28  Eric Blake  <eblake@redhat.com>

	qemu: avoid leaking uninit data from hotplug to dumpxml
	Detected by Coverity.  The fix in 2c27dfa didn't catch all bad
	instances of memcpy().  Thankfully, on further analysis, all of
	the problematic uses are only triggered by old qemu that lacks
	-device.

	* src/qemu/qemu_hotplug.c (qemuDomainAttachPciDiskDevice)
	(qemuDomainAttachNetDevice, qemuDomainAttachHostPciDevice): Init
	all fields since monitor only populates some of them.

2011-10-28  Ryota Ozaki  <ozaki.ryota@gmail.com>

	util: Fix virUUIDGeneratePseudoRandomBytes
	It forgets to move a pointer to a buffer for UUID and as a result
	fills only the first byte of the buffer.

2011-10-28  Daniel P. Berrange  <berrange@redhat.com>

	Implement RPC driver support for virDomainOpenGraphics
	Since it needs to access file descriptors passed in the msg,
	the RPC driver for virDomainOpenGraphics needs to be manually
	implemented.

	* daemon/remote.c: RPC server dispatcher
	* src/remote/remote_driver.c: RPC client dispatcher
	* src/remote/remote_protocol.x: Define protocol

2011-10-28  Daniel P. Berrange  <berrange@redhat.com>

	Extend RPC server to allow FD passing
	The RPC server classes are extended to allow FDs to be received
	from clients with calls. There is not currently any way for a
	procedure to pass FDs back to the client with replies

	* daemon/remote.c, src/rpc/gendispatch.pl: Change virNetMessageHeaderPtr
	  param to virNetMessagePtr in dispatcher impls
	* src/rpc/virnetserver.c, src/rpc/virnetserverclient.c,
	  src/rpc/virnetserverprogram.c, src/rpc/virnetserverprogram.h:
	  Extend to support FD passing

2011-10-28  Daniel P. Berrange  <berrange@redhat.com>

	Add client side support for FD passing
	Extend the RPC client code to allow file descriptors to be sent
	to the server with calls, and received back with replies.

	* src/remote/remote_driver.c: Stub extra args
	* src/libvirt_private.syms, src/rpc/virnetclient.c,
	  src/rpc/virnetclient.h, src/rpc/virnetclientprogram.c,
	  src/rpc/virnetclientprogram.h: Extend APIs to allow
	  FD passing

2011-10-28  Daniel P. Berrange  <berrange@redhat.com>

	Extend RPC protocol to allow FD passing
	Define two new RPC message types VIR_NET_CALL_WITH_FDS and
	VIR_NET_REPLY_WITH_FDS. These message types are equivalent
	to VIR_NET_CALL and VIR_NET_REPLY, except that between the
	message header, and payload there is a 32-bit integer field
	specifying how many file descriptors have been passed.

	The actual file descriptors are sent/recv'd out of band.

	* src/rpc/virnetmessage.c, src/rpc/virnetmessage.h,
	  src/libvirt_private.syms: Add support for handling
	  passed file descriptors
	* src/rpc/virnetprotocol.x: Extend protocol for FD
	  passing

2011-10-28  Daniel P. Berrange  <berrange@redhat.com>

	Add APIs for virNetSocket for sending/receiving file descriptors
	Add APIs to the virNetSocket object, to allow file descriptors
	to be sent/received over UNIX domain socket connections

	* src/rpc/virnetsocket.c, src/rpc/virnetsocket.h,
	  src/libvirt_private.syms: Add APIs for FD send/recv

2011-10-28  Daniel P. Berrange  <berrange@redhat.com>

	Wire up QEMU implementation for virDomainOpenGraphics
	The QEMU monitor command 'add_client' can be used to connect to
	a VNC or SPICE graphics display. This allows for implementation
	of the virDomainOpenGraphics API

	* src/qemu/qemu_driver.c: Implement virDomainOpenGraphics
	* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
	  src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h,
	  src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h:
	  Add binding for 'add_client' command

2011-10-28  Daniel P. Berrange  <berrange@redhat.com>

	Extend graphics event to include UNIX socket
	Not all VNC/SPICE servers use a TCP socket for their connections.
	It is possible to configure a UNIX socket server. The graphics
	event must thus include a UNIX socket address type.

	* include/libvirt/libvirt.h.in: Add UNIX socket address type
	  for graphics event
	* src/qemu/qemu_monitor_json.c: Add 'unix' string to address
	  type enum

2011-10-28  Daniel P. Berrange  <berrange@redhat.com>

	Introduce the virDomainOpenGraphics API
	The virDomainOpenGraphics API allows a libvirt client to pass in
	a file descriptor for an open socket pair, and get it connected
	to the graphics display of the guest. This is limited to working
	with local libvirt hypervisors connected over a UNIX domain
	socket, since it will use UNIX FD passing

	* include/libvirt/libvirt.h.in: Define virDomainOpenGraphics
	* src/driver.h: Define driver for virDomainOpenGraphics
	* src/libvirt_public.syms, src/libvirt.c: Entry point for
	  virDomainOpenGraphics
	* src/libvirt_internal.h: VIR_DRV_FEATURE_FD_PASSING

2011-10-28  Daniel P. Berrange  <berrange@redhat.com>

	Remove trailing whitespace from all xfig files
	The 5th line of every xfig file has 'Letter   ' which
	annoys GITs trailing-whitespace commit hook. Hand edit
	the files to remove that trailing whitespace

	* docs/*.fig: Remove trailing whitespace

2011-10-28  Daniel P. Berrange  <berrange@redhat.com>

	Add documentation about migration.
	This adds a page documenting many aspects of migration:

	 - The types of migration (managed direct, p2p, unmanaged direct)
	 - Data transports (native, tunnelled)
	 - Migration URIs
	 - Config file handling
	 - Example scenarios

	* libvirt.css: Rules for data tables and diagrams
	* Makefile.am: Include extra png/fig files
	* migration-managed-direct.fig, migration-managed-direct.png,
	  migration-managed-direct.png, migration-managed-p2p.png,
	  migration-native.fig, migration-native.png,
	  migration-tunnel.fig, migration-tunnel.png,
	  migration-unmanaged-direct.fig, migration-unmanaged-direct.png:
	  Diagrams of migration
	* migration.html.in, sitemap.html.in: New migration doc

2011-10-28  Ryota Ozaki  <ozaki.ryota@gmail.com>

	virsh: Fix error message on vol-create-from failure
	If vol-create-from is failed due to 'input volume not found',
	virsh outputs like this:
	  $ sudo virsh vol-create-from testpool test-vol.xml test.img
	  error: failed to get vol 'test.img', specifying --pool might help
	  error: Storage volume not found: no storage vol with matching path
	However, '--pool' is incorrect because it is already specified as
	second argument ('testpool' in this case). It should be "--inputpool".

	The patch fixes this by using pooloptname, which will be "inputpool"
	in this case and "pool" in other cases, as error message.

2011-10-28  Tyler Coumbes  <coumbes@gmail.com>

	bridge: modify for use when sVirt is enabled with qemu
	This refactors the TAP creation code out of brAddTap into a new
	function brCreateTap to allow it to be used on its own. I have also
	changed ifSetInterfaceMac to brSetInterfaceMac and exported it since
	it is will be needed by code outside of util/bridge.c in the next
	patch.

	 AUTHORS                 |    1 +
	 src/libvirt_bridge.syms |    2 +
	 src/util/bridge.c       |  116 +++++++++++++++++++++++++++++++----------------
	 src/util/bridge.h       |    9 ++++
	 4 files changed, 89 insertions(+), 39 deletions(-)

2011-10-28  Jiri Denemark  <jdenemar@redhat.com>

	Use virXMLSaveFile when writing XML config

	Introduce virXMLSaveFile as a wrapper for virFileRewrite
	Every time we write XML into a file we call virEmitXMLWarning to write a
	warning that the file is automatically generated. virXMLSaveFile
	simplifies this into a single step and makes rewriting existing XML file
	safe by using virFileRewrite internally.

	Introduce virFileRewrite for safe file rewrite
	When saving config files we just overwrite old content of the file. In
	case something fails during that process (e.g. disk gets full) we lose
	both old and new content. This patch makes the process more robust by
	writing the new content into a separate file and only if that succeeds
	the original file is atomically replaced with the new one.

2011-10-27  Daniel P. Berrange  <berrange@redhat.com>

	Add a systemtap script for watching QEMU monitor interactions
	This change adds some systemtap/dtrace probes to the QEMU monitor
	client code. In particular it allows watching of all operations
	for a VM

	* examples/systemtap/qemu-monitor.stp: Watch all monitor commands
	* src/Makefile.am: Passing libdir/bindir/sbindir to dtrace2systemtap.pl
	* src/dtrace2systemtap.pl: Accept libdir/bindir/sbindir as args
	  and look for '# binary:' comment to mark probes against libvirtd
	  vs libvirt.so
	* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor_json.c,
	  src/qemu/qemu_monitor_text.c: Add probes for key functions

2011-10-27  Peter Krempa  <pkrempa@redhat.com>

	lxc: Revert zeroing count of allocated items if VIR_REALLOC_N fails
	Previous commit clears number of items alocated in lxcSetupLoopDevices
	if VIR_REALLOC_N fails. In that case, the pointer is not NULL, and
	causes leaking FDs that have been allocated.

	 *  src/lxc/lxc_controller.c: revert zeroing array size

2011-10-27  Daniel P. Berrange  <berrange@redhat.com>

	Fix typo in virFileAccessibleAs
	* src/util/util.c: s/git_t/gid_t/ in parameter list of virFileAccessibleAs

2011-10-27  Alex Jia  <ajia@redhat.com>

	lxc: avoid null deref on lxcSetupLoopDevices failure
	If the function lxcSetupLoopDevices(def, &nloopDevs, &loopDevs) failed,
	the variable loopDevs will keep a initial NULL value, however, the
	function VIR_FORCE_CLOSE(loopDevs[i]) will directly deref it.

	This patch also fixes returning a bogous number of devices from
	lxcSetupLoopDevices on an error path.

	* rc/lxc/lxc_controller.c: fixed a null pointer dereference.

2011-10-27  Alex Jia  <ajia@redhat.com>

	lxc: avoid missing '{' in the function
	Cppcheck detected a syntaxError on lxcDomainInterfaceStats.

	* src/lxc/lxc_driver.c: fixed missing '{' in the function lxcDomainInterfaceStats.

2011-10-27  Eric Blake  <eblake@redhat.com>

	qemu: simplify use of HAVE_YAJL
	Rather than making all clients of monitor commands that are JSON-only
	check whether yajl support was compiled in, it is simpler to just
	avoid setting the capability bit up front if we can't use the capability.

	* src/qemu/qemu_capabilities.c (qemuCapsComputeCmdFlags): Only set
	capability bit if we also have yajl library to use it.
	* src/qemu/qemu_driver.c (qemuDomainReboot): Drop #ifdefs.
	* src/qemu/qemu_process.c (qemuProcessStart): Likewise.
	* tests/qemuhelptest.c (testHelpStrParsing): Pass test even
	without yajl.
	* tests/qemuxml2argvtest.c (mymain): Simplify use of json flag.
	* tests/qemuxml2argvdata/qemuxml2argv-disk-drive-error-*.args:
	Update expected results to match.

2011-10-27  Eric Blake  <eblake@redhat.com>

	snapshot: minor cleanups from reviewing indentation
	Break some long lines, and use more efficient functions when possible,
	such as relying on virBufferEscapeString to skip output on a NULL arg.
	Ensure that output does not embed newlines, since auto-indent won't
	work in those situations.

	* src/conf/domain_conf.c (virDomainTimerDefFormat): Break output lines.
	(virDomainDefFormatInternal, virDomainDiskDefFormat)
	(virDomainActualNetDefFormat, virDomainNetDefFormat)
	(virDomainHostdevDefFormat): Minor cleanups.

2011-10-27  Eric Blake  <eblake@redhat.com>

	snapshot: simplify indentation of disk encryption xml
	Use auto-indent in more places.

	* src/conf/storage_encryption_conf.h (virStorageEncryptionFormat):
	Drop parameter.
	* src/conf/storage_encryption_conf.c (virStorageEncryptionFormat)
	(virStorageEncryptionSecretFormat): Simplify with auto-indent.
	* src/conf/domain_conf.c (virDomainDiskDefFormat): Adjust caller.
	* src/conf/storage_conf.c (virStorageVolTargetDefFormat): Likewise.

2011-10-27  Eric Blake  <eblake@redhat.com>

	snapshot: simplify indentation of nwfilter
	Fixing this involved some refactoring of common code out of
	domain_conf and nwfilter_conf into nwfilter_params.

	* src/conf/nwfilter_params.h (virNWFilterFormatParamAttributes):
	Adjust signature.
	* src/conf/nwfilter_params.c (_formatParameterAttrs)
	(virNWFilterFormatParamAttributes): Adjust indentation handling,
	and handle filterref here.
	(formatterParam): Delete unused struct.
	* src/conf/domain_conf.c (virDomainNetDefFormat): Adjust caller.
	* src/conf/nwfilter_conf.c (virNWFilterIncludeDefFormat): Likewise.

2011-10-27  Eric Blake  <eblake@redhat.com>

	storage: avoid null deref on qemu-img failure
	Detected by Coverity.  Only possible if qemu-img gives bogus output,
	but we might as well be robust.

	* src/storage/storage_backend.c
	(virStorageBackendQEMUImgBackingFormat): Check for strstr failure.

2011-10-27  Eric Blake  <eblake@redhat.com>

	build: avoid RHEL 5 build failure on LXC
	Per the discussion here, LXC on RHEL 5 makes no sense.
	https://www.redhat.com/archives/libvir-list/2011-September/msg01169.html

	* configure.ac (with_lxc): Reject RHEL 5.x LXC as too old.

2011-10-25  Eric Blake  <eblake@redhat.com>

	build: use gnulib fdatasync
	Commit 1726a73 hacked around MacOS' lack of fdatasync, since
	gnulib did not have it at the time.  But now that we use newer
	gnulib, we can avoid the hack.

	* bootstrap.conf (gnulib_modules): Add fdatasync.
	* configure.ac (AC_CHECK_FUNCS_ONCE): Drop our own check.

2011-10-25  Daniel P. Berrange  <berrange@redhat.com>

	Add REMOTE_PROC_DOMAIN_EVENT_DISK_CHANGE to remote_protocol-structs
	* src/remote_protocol-structs: Add new event

2011-10-25  Stefan Berger  <stefanb@us.ibm.com>

	nwfilter: extend schema to support new targets
	Extend the nwfilter schema to support the continue and return targets.

2011-10-25  Michal Privoznik  <mprivozn@redhat.com>

	util: Add virFileAccessibleAs to private symbols
	Commit 458b7099b2e791b58f1286002974927d3e8bcc80 introduced this
	function. However it was not added into libvirt_private.syms so
	the compilation may not succeed on some hosts.

	startupPolicy: Emit event on disk source dropping
	If a disk source gets dropped because it is not accessible,
	mgmt application might want to be informed about this. Therefore
	we need to emit an event. The event presented in this patch
	is however a bit superset of what written above. The reason is simple:
	an intention to be easily expanded, e.g. on 'user ejected disk
	in guest' events. Therefore, callback gets source string and disk alias
	(which should be unique among a domain) and reason (an integer);

	qemu: implement startupPolicy
	This patch implements on_missing feature in qemu driver.
	Upon qemu startup process an accessibility of CDROMs
	and floppy disks is checked. The source might get dropped
	if unavailable and on_missing is set accordingly.
	No event is emit thought. Look for follow up patch.

	qemu: Move device alias assigning before command line construction
	This patch is rather cosmetic as it only moves device alias
	assignation from command line construction just before that.
	However, it is needed in connotation of previous and next patch.

	util: Create virFileAccessibleAs function
	This function checks if a given path is accessible under
	given uid and gid.

2011-10-25  Michal Privoznik  <mprivozn@redhat.com>

	conf: Introduce optional startupPolicy attribute for cdrom and floppy
	This attribute says what to do with cdrom (or floppy) if
	the source is missing. It accepts:
	- mandatory - fail if missing for any reason (the default)
	- requisite - fail if missing on boot up, drop if missing on
	              migrate/restore/revert
	- optional  - drop if missing at any start attempt.

	However, this patch introduces only XML part of this new
	functionality.

2011-10-25  Eric Blake  <eblake@redhat.com>

	storage: make previous leak less likely to regress
	Splitting into two functions allows the user to call the right
	function, rather than having to remember that a *Free function is
	an exception to the rule.

	* src/conf/storage_conf.h (virStoragePoolSourceClear): New function.
	* src/libvirt_private.syms (storage_conf.h): Export it.
	* src/conf/storage_conf.c (virStoragePoolSourceFree): Split...
	(virStoragePoolSourceClear): ...into new function.
	(virStoragePoolDefFree, virStoragePoolDefParseSourceString):
	Update callers.
	* src/test/test_driver.c (testStorageFindPoolSources): Likewise.
	* src/storage/storage_backend_fs.c
	(virStorageBackendFileSystemNetFindPoolSourcesFunc)
	(virStorageBackendFileSystemNetFindPoolSources): Likewise.
	* src/storage/storage_backend_iscsi.c
	(virStorageBackendISCSIFindPoolSources): Likewise.
	* src/storage/storage_backend_logical.c
	(virStorageBackendLogicalFindPoolSources): Likewise.

2011-10-25  Eric Blake  <eblake@redhat.com>

	storage: plug iscsi memory leak
	Detected by Coverity.  virStoragePoolSourceFree does not free the
	actual passed-in pointer.  A bigger patch would be to rename it
	virStoragePoolSourceClear to match behavior, or even split it into
	two functions depending on needed behavior; but this is the minimal
	fix to the one location out of eight that leaked memory.

	* src/storage/storage_backend_iscsi.c
	(virStorageBackendISCSIFindPoolSources): Free memory.

2011-10-25  Eric Blake  <eblake@redhat.com>

	waitpid: improve safety
	Based on a report by Coverity.  waitpid() can leak resources if it
	fails with EINTR, so it should never be used without checking return
	status.  But we already have a helper function that does that, so
	use it in more places.

	* src/lxc/lxc_container.c (lxcContainerAvailable): Use safer
	virWaitPid.
	* daemon/libvirtd.c (daemonForkIntoBackground): Likewise.
	* tests/testutils.c (virtTestCaptureProgramOutput, virtTestMain):
	Likewise.
	* src/libvirt.c (virConnectAuthGainPolkit): Simplify with virCommand.

2011-10-25  Eric Blake  <eblake@redhat.com>

	qemu: avoid leaking uninit data from hotplug to dumpxml
	Detected by Coverity.  Both text and JSON monitors set only the
	bus and unit fields, which means driveAddr.controller spends
	life as garbage on the stack, and is then memcpy()'d into the
	in-memory representation which the user can see via dumpxml.

	* src/qemu/qemu_hotplug.c (qemuDomainAttachSCSIDisk): Only copy
	defined fields.

2011-10-24  Ryota Ozaki  <ozaki.ryota@gmail.com>

	virsh: Fix vol-info's 'Type' output
	We have a new vol type "dir" in addition to "file" and "block", but
	virsh doesn't know it. Fix it.

	Additionally, the patch lets virsh output "unknown" if not matched
	any of them.

2011-10-21  Ryota Ozaki  <ozaki.ryota@gmail.com>

	docs: Document filesystem type='block' for LXC
	Commit 77791dc0e allows LXC to use a host block device as a guest
	filesystem, but it isn't documented yet.

2011-10-21  David L Stevens  <dlstevens@us.ibm.com>

	support continue/return targets in nwfilter
		This patch adds support for "continue" and "return" actions
	in filter rules.

2011-10-21  Eric Blake  <eblake@redhat.com>

	snapshot: simplify indentation of network xml
	More simplifications possible due to auto-indent.  Also,
	<bandwidth> within <actual> was only using 6 instead of 8 spaces.

	* src/util/network.h (virVirtualPortProfileFormat)
	(virBandwidthDefFormat): Alter signature.
	* src/util/network.c (virVirtualPortProfileFormat)
	(virBandwidthDefFormat): Alter indentation.
	(virBandwidthChildDefFormat): Tweak to make use easier.
	* src/conf/network_conf.c (virPortGroupDefFormat)
	(virNetworkDefFormat): Adjust callers.
	* src/conf/domain_conf.c (virDomainNetDefFormat): Likewise.
	(virDomainActualNetDefFormat): Likewise, and fix bandwidth
	indentation.

2011-10-21  Eric Blake  <eblake@redhat.com>

	snapshot: simplify indentation of cpu features
	Auto-indent makes life a bit easier; this patch also drops unused
	arguments and replaces a misspelled flag name with two entry points
	instead, so that callers don't have to worry about how much spacing
	is present when embedding cpu elements.

	* src/conf/cpu_conf.h (virCPUFormatFlags): Delete.
	(virCPUDefFormat): Drop unused argument.
	(virCPUDefFormatBuf): Alter signature.
	(virCPUDefFormatBufFull): New prototype.
	* src/conf/cpu_conf.c (virCPUDefFormatBuf): Split...
	(virCPUDefFormatBufFull): ...into new function.
	(virCPUDefFormat): Adjust caller.
	* src/conf/domain_conf.c (virDomainDefFormatInternal): Likewise.
	* src/conf/capabilities.c (virCapabilitiesFormatXML): Likewise.
	* src/cpu/cpu.c (cpuBaselineXML): Likewise.
	* tests/cputest.c (cpuTestCompareXML): Likewise.

2011-10-21  Eric Blake  <eblake@redhat.com>

	snapshot: simplify indentation of sysinfo
	The improvements to virBuffer, along with a paradigm shift to pass
	the original buffer through rather than creating a second buffer,
	allow us to shave off quite a few lines of code.

	* src/util/sysinfo.h (virSysinfoFormat): Alter signature.
	* src/util/sysinfo.c (virSysinfoFormat, virSysinfoBIOSFormat)
	(virSysinfoSystemFormat, virSysinfoProcessorFormat)
	(virSysinfoMemoryFormat): Change indentation parameter.
	* src/conf/domain_conf.c (virDomainSysinfoDefFormat): Adjust
	caller.
	* src/qemu/qemu_driver.c (qemuGetSysinfo): Likewise.

2011-10-21  Eric Blake  <eblake@redhat.com>

	snapshot: test domainsnapshot indentation
	Add a test for the simple parts of my indentation changes, and
	fix the fallout.

	* tests/domainsnapshotxml2xmltest.c: New test.
	* tests/Makefile.am (domainsnapshotxml2xmltest_SOURCES): Build it.
	* src/conf/domain_conf.c (virDomainSnapshotDefFormat): Avoid NULL
	deref, match documented order.
	* src/conf/domain_conf.h (virDomainSnapshotDefFormat): Add const.
	* tests/domainsnapshotxml2xmlout/all_parameters.xml: Tweak output.
	* tests/domainsnapshotxml2xmlout/disk_snapshot.xml: Likewise.
	* tests/domainsnapshotxml2xmlout/full_domain.xml: Likewise.
	* .gitignore: Exempt new binary.

2011-10-21  Eric Blake  <eblake@redhat.com>

	snapshot: indent domain xml when nesting
	<domainsnapshot> is the first public instance of <domain> being
	used as a sub-element, although we have two other private uses
	(runtime state, and migration cookie).  Although indentation has
	no effect on XML parsing, using it makes the output more consistent.

	This uses virBuffer auto-indentation to obtain the effect, for all
	but the portions of <domain> that are not generated a line at a
	time into the same virBuffer.  Further patches will clean up the
	remaining problems.

	* src/conf/domain_conf.h (virDomainDefFormatInternal): New prototype.
	* src/conf/domain_conf.c (virDomainDefFormatInternal): Export.
	(virDomainObjFormat, virDomainSnapshotDefFormat): Update callers.
	* src/libvirt_private.syms (domain_conf.h): Add new export.
	* src/qemu/qemu_migration.c (qemuMigrationCookieXMLFormat): Use
	new function.
	(qemuMigrationCookieXMLFormatStr): Update caller.

2011-10-21  Eric Blake  <eblake@redhat.com>

	virbuf: add auto-indentation support
	Rather than having to adjust all callers in a chain to deal with
	indentation, it is nicer to have virBuffer do auto-indentation.

	* src/util/buf.h (_virBuffer): Increase size.
	(virBufferAdjustIndent, virBufferGetIndent): New prototypes.
	* src/libvirt_private.syms (buf.h): Export new functions.
	* src/util/buf.c (virBufferAdjustIndent, virBufferGetIndent): New
	functions.
	(virBufferSetError, virBufferAdd, virBufferAddChar)
	(virBufferVasprintf, virBufferStrcat, virBufferURIEncodeString):
	Implement auto-indentation.
	* tests/virbuftest.c (testBufAutoIndent): Test it.
	(testBufInfiniteLoop): Don't rely on internals.
	Idea by Daniel P. Berrange.

2011-10-21  Eric Blake  <eblake@redhat.com>

	virbuf: more detailed error reporting
	The next patch wants to add some sanity checking, which would
	be a different error than ENOMEM.  Many existing callers blindly
	report OOM failure if virBuf reports an error, and this will be
	wrong in the (unlikely) case that they actually had a usage error
	instead; but since the most common error really is ENOMEM, I'm
	not going to fix all callers.  Meanwhile, new discriminating
	callers can react differently depending on what failure happened.

	* src/util/buf.c (virBufferSetError): Add parameter.
	(virBufferGrow, virBufferVasprintf, virBufferEscapeString)
	(virBufferEscapeSexpr, virBufferEscapeShell): Adjust callers.

2011-10-21  Eric Blake  <eblake@redhat.com>

	virbuf: improve testsuite reporting
	I had some temporary test failures while working on virbuf
	improvements in later patches, with output that looked like:

	Expected [<]
	Actual [  <]

	which is pretty hard to figure out.  Adding an Offset designation
	made it much easier to find which particular '<' was at the
	wrong indentation, to fix the right part of the code.

	* tests/testutils.c (virtTestDifference): Make it easier to
	diagnose test failures.

2011-10-21  Eric Blake  <eblake@redhat.com>

	virbuf: fix const-correctness
	Although the compiler wasn't complaining (since it was the pointer,
	rather than what was being pointed to, that was actually const), it
	looks quite suspicious to call a function with an argument labeled
	const when the nature of the pointer (virBufferPtr) is hidden behind
	a typedef.  Dropping const makes the function declarations easier
	to read.

	* src/util/buf.h: Drop const from all functions that modify buffer
	argument.
	* src/util/buf.c (virBufferSetError, virBufferAdd)
	(virBufferContentAndReset, virBufferFreeAndReset)
	(virBufferAsprintf, virBufferVasprintf, virBufferEscapeString)
	(virBufferEscapeSexpr, virBufferEscape): Fix fallout.

2011-10-21  Laine Stump  <laine@laine.org>

	docs: fix incorrect info about routed networks
	In a recent expansion of the documentation on network forward modes, I
	incorrectly stated that incoming sessions to guests on routed networks
	were blocked. This is true for guests on NATed networks, but not
	routed. This patch corrects that error, and adds a pointer to the
	nwfilter page for those who do want to restrict incoming sessions to
	hosts on routed networks.

2011-10-21  tangchen  <tangchen@cn.fujitsu.com>

	qemu: allow json in domxml-to-native
	There is a little difference between the output of domxml-to-native and the actual commandline.
	No matter qemu is in control or readline mode, domxml-to-native always converts it to readline mode.

	That is because the parameter "monitor_json" for qemuBuildCommandLine() is always set to false
	in qemuDomainXMLToNative().

2011-10-21  Eric Blake  <eblake@redhat.com>

	docs: document managed=yes of hostdev passthrough
	Clarify some of the effects of managed passthrough <hostdev> devices;
	with recent changes (commit d093547), a nodedev-reattach is only needed
	to pair up to an explicit nodedev-dettach (but beware that older
	virt-manager has a bug where it uses explicit nodedev-dettach under the
	hood when using the gui to hotplug a hostdev device).

	* docs/formatdomain.html.in: Mention reattach.
	* tools/virsh.pod (nodedev): Mention managed mode.

2011-10-20  Daniel P. Berrange  <berrange@redhat.com>

	Fix virFileOpenTty definition on Win32
	Stub out a complete impl of virFileOpenTty to avoid unused
	parameter warnings

	* src/util/util.c: Fix virFileOpenTty on Win32

2011-10-20  Hu Tao  <hutao@cn.fujitsu.com>

	support setting bandwidth from virsh attach-interface
	Adds two options, inbound and outbound, to attach-interface to set
	bandwidth when attaching interfaces

2011-10-20  Serge E. Hallyn  <serge.hallyn@canonical.com>

	lxc: use hand-rolled code in place of unlockpt and grantpt
	The glibc ones (intentionally) cannot handle ptys opened in a
	devpts not mounted at /dev/pts.

	Drop the (un-exported, unused) virFileOpenTtyAt.

2011-10-20  Eric Blake  <eblake@redhat.com>

	build: ignore test executable
	* .gitignore: Add exemption.

2011-10-19  Philipp Hahn  <hahn@univention.de>

	qemu: Test name-space handling
	Add test cases for parsing the qemu-name-space.
	This is based on qemuxml2argv{test,data/}, but can not reside in
	qemuxml2argv{test,data/} because ...

	1. qemuxmlns-qemu-ns-domain.xml is not schema-valid and breaks
	domainschematest. The test is still important to detect xmlns:qemu
	bindings to a name-space other than
	http://libvirt.org/schemas/domain/qemu/1.0

	2. they break qemuxml2xml, because the xmlns:qemu binding is moved to
	the top-level <domain> element when converting from argv to xml.

2011-10-19  Philipp Hahn  <hahn@univention.de>

	qemu: Fix name-space handling
	The XML parser for the qemu specific extensions expects the qemu name-space
	to be bound to the 'qemu' prefix. This is too strict, since the name of the
	name-space-prefix is only meant as an internal lookup key. Only the associated
	URI is relevant.
	<domain>...
	  <qemu:commandline xmlns:qemu="http://libvirt.org/schemas/domain/qemu/1.0">
	  ...</qemu:commandline>
	</domain>

	<domain xmlns:ns0="http://libvirt.org/schemas/domain/qemu/1.0">...
	  <ns0:commandline>
	  ...</ns0:commandline>
	</domain>

	<domain xmlns:qemu="http://libvirt.org/schemas/domain/qemu/1.0">
	  <qemu:commandline xmlns:qemu="urn:foo">
	  ...</qemu:commandline>
	</domain>

	Remove the test for checking the name-space binding on the top-level <domain>
	element. Registering the name-space with XPath is enough.

2011-10-19  Xu He Jie  <xuhj@linux.vnet.ibm.com>

	compile: fix undefined reference to gnutls_x509_crt_get_dn with gcc-4.6.1
	When I compile libvirt with gcc-4.6.1 in ubuntu 11.10, got error as below:

	  CCLD   libvirtd
	/usr/bin/ld: ../src/.libs/libvirt_driver_qemu.a(libvirt_driver_qemu_la-qemu_migration.o): undefined reference to symbol 'gnutls_x509_crt_get_dn@@GNUTLS_1_4'
	/usr/bin/ld: note: 'gnutls_x509_crt_get_dn@@GNUTLS_1_4' is defined in DSO /usr/lib/x86_64-linux-gnu/libgnutls.so so try adding it to the linker command line
	/usr/lib/x86_64-linux-gnu/libgnutls.so: could not read symbols: Invalid operation
	collect2: ld returned 1 exit status
	make[3]: *** [libvirtd] Error 1

	It can compile with gcc-4.5.2 in ubuntu 11.04, but it can not compile with gcc-4.6.1 in ubuntu 11.10.

	I didn't find reason. Does Anyone know the reason or the different between gcc-4.5.2 and gcc-4.6.1?

	I still provide a patch for this. Just make it is working now.

2011-10-19  Daniel P. Berrange  <berrange@redhat.com>

	Replace virBufferAdd with virBufferAddLit for const string
	The statement

	        virBufferAdd(buf, "''", 2);

	triggers a syntax-check warning

	* src/util/buf.c: Replace virBufferAdd with virBufferAddLit

2011-10-19  Philipp Hahn  <hahn@univention.de>

	documentation: trivial spelling fix

2011-10-19  Daniel P. Berrange  <berrange@redhat.com>

	Allow for URI aliases when connecting to libvirt
	This adds support for a libvirt client configuration file
	either /etc/libvirt/libvirt.conf for privileged clients,
	or $HOME/.libvirt/libvirt.conf for unprivileged clients.

	It allows one parameter

	 uri_aliases = [
	   "hail=qemu+ssh://root@hail.cloud.example.com/system",
	   "sleet=qemu+ssh://root@sleet.cloud.example.com/system",
	 ]

	Any call to virConnectOpen with a non-NULL URI will first
	attempt to match against the uri_aliases list. An application
	can disable this by using VIR_CONNECT_NO_ALIASES

	* docs/uri.html.in: Document URI aliases
	* include/libvirt/libvirt.h.in: Add VIR_CONNECT_NO_ALIASES
	* libvirt.spec.in, mingw32-libvirt.spec.in: Add /etc/libvirt/libvirt.conf
	* src/Makefile.am: Install default config file
	* src/libvirt.c: Add support for URI aliases
	* src/remote/remote_driver.c: Don't try to handle URIs
	  with no scheme and which clearly are not paths
	* src/util/conf.c: Don't raise error on virConfFree(NULL)
	* src/xen/xen_driver.c: Don't raise error on URIs
	  with no scheme

2011-10-19  Daniel P. Berrange  <berrange@redhat.com>

	Add support for autodestroy of guests to the LXC and UML drivers
	We recently added support for VIR_DOMAIN_START_AUTODESTROY and
	an impl to the QEMU driver. It is very desirable to support in
	other drivers, so this adds it to LXC and UML

	* src/lxc/lxc_conf.h, src/lxc/lxc_driver.c,
	  src/uml/uml_conf.h, src/uml/uml_driver.c: Wire up autodestroy
	  functions

2011-10-19  Guido Günther  <agx@sigxcpu.org>

	Use virBufferEscapeShell in cmdEcho

	qemu: replace qemuMonitorEscapeShell by virBufferEscapeShell

	virBufferEscapeShell: Emit quotes for the empty string
	Make the empty string return '' to match cmdEcho's behavior.

2011-10-19  Eric Blake  <eblake@redhat.com>

	snapshot: detect when qemu lacks disk-snapshot support
	Noticed when testing new libvirt against old qemu that lacked the
	snapshot_blkdev HMP command.  Libvirt was mistakenly treating the
	command as successful, and re-writing the domain XML to use the
	just-created 0-byte file, rendering the domain broken on restart.

	* src/qemu/qemu_monitor_text.c (qemuMonitorTextDiskSnapshot):
	Notice another possible error message.
	* src/qemu/qemu_driver.c
	(qemuDomainSnapshotCreateSingleDiskActive): Don't keep 0-byte file
	on failure.

2011-10-18  Guido Günther  <agx@sigxcpu.org>

	virBufferEscapeShell: Fix escaping of single quotes.
	When checking if we need to escape a single quote we were looking at the
	character after the quote instead of at the quote itself.

2011-10-18  Xu He Jie  <xuhj@linux.vnet.ibm.com>

	compile: Add a missing function 'pciDeviceListFind' to libvirt_private.syms
	compile error:
	./src/.libs/libvirt_driver_qemu.a(libvirt_driver_qemu_la-qemu_hostdev.o): In function `qemuPrepareHostdevPCIDevices':
	/home/soulxu/data/work-code/libvirt/src/qemu/qemu_hostdev.c:183: undefined reference to `pciDeviceListFind'
	/home/soulxu/data/work-code/libvirt/src/qemu/qemu_hostdev.c:230: undefined reference to `pciDeviceListFind'
	./src/.libs/libvirt_driver_qemu.a(libvirt_driver_qemu_la-qemu_hostdev.o): In function `qemuGetActivePciHostDeviceList':
	/home/soulxu/data/work-code/libvirt/src/qemu/qemu_hostdev.c:102: undefined reference to `pciDeviceListFind'
	./src/.libs/libvirt_driver_qemu.a(libvirt_driver_qemu_la-qemu_hostdev.o): In function `qemuDomainReAttachHostdevDevices':
	/home/soulxu/data/work-code/libvirt/src/qemu/qemu_hostdev.c:370: undefined reference to `pciDeviceListFind'

2011-10-18  Osier Yang  <jyang@redhat.com>

	qemu: Do not wait if the PCI device is not managed when reattaching
	Waiting for qemu-kvm cleaning up the PCI bar(s) mapping with long time
	while the device is not managed is just waste of time.

2011-10-18  Jim Fehlig  <jfehlig@suse.com>

	Add AHCI support to qemu driver
	Tested with multiple AHCI controllers and multiple disks attached
	to a controller. E.g.,

	    <disk type='file' device='disk'>
	      <driver name='qemu' type='raw'/>
	      <source file='/var/lib/libvirt/images/test/disk0.raw'/>
	      <target dev='sda' bus='sata'/>
	      <address type='drive' controller='0' bus='0' unit='0'/>
	    </disk>
	    <disk type='file' device='disk'>
	      <driver name='qemu' type='raw'/>
	      <source file='/var/lib/libvirt/images/test/disk1.raw'/>
	      <target dev='sdb' bus='sata'/>
	      <address type='drive' controller='0' bus='0' unit='1'/>
	    </disk>
	    <disk type='file' device='disk'>
	      <driver name='qemu' type='raw'/>
	      <source file='/var/lib/libvirt/images/test/disk2.raw'/>
	      <target dev='sdc' bus='sata'/>
	      <address type='drive' controller='1' bus='0' unit='0'/>
	    </disk>
	    <controller type='sata' index='0'>
	      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
	    </controller>
	    <controller type='sata' index='1'>
	      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
	    </controller>

2011-10-18  Eric Blake  <eblake@redhat.com>

	snapshot: implement LIST_LEAVES flag in esx
	Relatively straight-forward filtering.

	* src/esx/esx_vi.h (esxVI_GetNumberOfSnapshotTrees)
	(esxVI_GetSnapshotTreeNames): Add parameter.
	* src/esx/esx_vi.c (esxVI_GetNumberOfSnapshotTrees)
	(esxVI_GetSnapshotTreeNames): Allow leaf filtering.
	* src/esx/esx_driver.c (esxDomainSnapshotNum)
	(esxDomainSnapshotListNames, esxDomainSnapshotNumChildren)
	(esxDomainSnapshotListChildrenNames): Pass new flag through.

2011-10-18  Philipp Hahn  <hahn@univention.de>

	Fix virt-sanlock-cleanup documentation
	The referenced page does not exist, but locking.html has a section about
	sanlock.

2011-10-17  Jiri Denemark  <jdenemar@redhat.com>

	Fix VPATH build
	probes.h is generated in build directory; setting a dependency on
	probes.h from source directory doesn't work well in VPATH builds. Caused
	by commit 1afcfbdda0cac112faa61f74ec943e46aa43f2f5

	qemu: Relax -no-shutdown check to [0.14.0, 0.15.0]
	The patch that fixes SIGTERM handling with -no-shutdown was taken into
	0.15.1 stable release of qemu.

2011-10-17  Philipp Hahn  <hahn@univention.de>

	Fix two comments related to error handling

2011-10-15  Wen Congyang  <wency@cn.fujitsu.com>

	build: fix 'make dist' error
	When I run 'make dist', I receive the following error messages:
	make[1]: Entering directory `/home/wency/source/libvirt/src'
	  GEN    remote/remote_protocol.h
	  GEN    remote/remote_protocol.c
	  GEN    remote/qemu_protocol.h
	  GEN    remote/qemu_protocol.c
	  GEN    remote/qemu_client_bodies.h
	  CC     libvirt_driver_remote_la-remote_protocol.lo
	In file included from ./remote/remote_protocol.h:16,
	                 from ./remote/remote_protocol.c:7:
	/internal.h:249:23: error: probes.h: No such file or directory
	make[1]: *** [libvirt_driver_remote_la-remote_protocol.lo] Error 1
	make[1]: Leaving directory `/home/wency/source/libvirt/src'
	make: *** [distdir] Error 1

	The reason is that we use probes.h before generating it.

2011-10-15  Roopa Prabhu  <roprabhu@cisco.com>

	Add missing strdup return value check
	Check strdup return value and fail if error

2011-10-15  Osier Yang  <jyang@redhat.com>

	qemu: Honor the orginal PCI dev properties when reattaching
	BZ# https://bugzilla.redhat.com/show_bug.cgi?id=736214

	The problem is caused by the original info of domain's PCI dev is
	maintained by qemu_driver->activePciHostdevs list, (E.g. dev->reprobe,
	which stands for whether need to reprobe driver for the dev when do
	reattachment). The fields (dev->reprobe, dev->unbind_from_stub, and
	dev->remove_slot) are initialized properly when preparing the PCI
	device for managed attachment. However, when do reattachment, it
	construct a complete new "pciDevice" without honoring the original
	dev info, and thus the dev won't get the original driver or can get
	other problem.

	This patch is to fix the problem by get the devs from list
	driver->activePciHostdevs.

	Tested with following 3 scenarios:
	  * the PCI was bound to some driver not pci-stub before attaching

	    result: the device will be bound to the original driver

	  * the PCI was bound to pci-stub before attaching

	    result: no driver reprobing, and still bound to pci-stub

	  * The PCI was not bound to any driver

	    result: no driver reprobing, and still not bound to any driver.

2011-10-15  Roopa Prabhu  <roprabhu@cisco.com>

	macvtap: avoid invalid free
	Commit 0472f39 plugged a leak, but introduced another bug:

	Actually looks like physfndev is conditionally allocated in getPhysfnDev
	Its better to modify getPhysfnDev to allocate physfndev every time.

2011-10-15  Laine Stump  <laine@laine.org>

	docs: fix network XML documentation
	A few people have attempted to use the new forwarding modes with older
	versions of libvirt. The docs where the modes are described have
	always stated the minimum required libvirt version, but the examples
	at the end didn't, which I believe is what has caused the confusion.

	Similarly, the section on portgroups now has a version tag added at
	the beginning.

	I also noticed that there was no example of defining a <dns> hostname,
	so I added one, as well as making the domain name example more
	recognizable (by adding ".com" to the domain).

2011-10-15  Jiri Denemark  <jdenemar@redhat.com>

	Clarify semantics of virDomainMigrate2
	Explicitly disallow conflicts between domain name from dxml and dname.

2011-10-15  Osier Yang  <jyang@redhat.com>

	qemu: Do not reattach PCI device used by other domain when shutdown
	When failing on starting a domain, it tries to reattach all the PCI
	devices defined in the domain conf, regardless of whether the devices
	are still used by other domain. This will cause the devices to be deleted
	from the list qemu_driver->activePciHostdevs, thus the devices will be
	thought as usable even if it's not true. And following commands
	nodedev-{reattach,reset} will be successful.

	How to reproduce:
	  1) Define two domains with same PCI device defined in the confs.
	  2) # virsh start domain1
	  3) # virsh start domain2
	  4) # virsh nodedev-reattach $pci_device

	You will see the device will be reattached to host successfully.
	As pciDeviceReattach just check if the device is still used by
	other domain via checking if the device is in list driver->activePciHostdevs,
	however, the device is deleted from the list by step 2).

	This patch is to prohibit the bug by:
	  1) Prohibit a domain starting or device attachment right at
	     preparation period (qemuPrepareHostdevPCIDevices) if the
	     device is in list driver->activePciHostdevs, which means
	     it's used by other domain.

	  2) Introduces a new field for struct _pciDevice, (const char *used_by),
	     it will be set as the domain name at preparation period,
	     (qemuPrepareHostdevPCIDevices). Thus we can prohibit deleting
	     the device from driver->activePciHostdevs if it's still used by
	     other domain when stopping the domain process.

	* src/pci.h (define two internal functions, pciDeviceSetUsedBy and
	    pciDevceGetUsedBy)
	* src/pci.c (new field "const char *used_by" for struct _pciDevice,
	    implementations for the two new functions)
	* src/libvirt_private.syms (Add the two new internal functions)
	* src/qemu_hostdev.h (Modify the definition of functions
	    qemuPrepareHostdevPCIDevices, and qemuDomainReAttachHostdevDevices)
	* src/qemu_hostdev.c (Prohibit preparation and don't delete the
	    device from activePciHostdevs list if it's still used by other domain)
	* src/qemu_hotplug.c (Update function usage, as the definitions are
	    changed)

2011-10-14  Philipp Hahn  <hahn@univention.de>

	Xen: Fake versions in xencapstest
	virInitialize() → xenRegister() → xenhypervisorInit() determines the
	version of the Hypervisor. This breaks xencapstest when building as root
	on a dom0 system, since xenHypervisorBuildCapabilities() adds the "hap"
	and "viridian" features based on the detected version.

	Add an optional parameter to xenhypervisorInit() to disable automatic
	detection of the Hypervisor version. The passed in arguments are used
	instead.

2011-10-14  Philipp Hahn  <hahn@univention.de>

	Xen: move versions to struct
	Calling virInitialize() → xenRegister() → xenhypervisorInit() directly
	opens a connection to the Xen Hypervisor, which breaks some unit tests.

	Move all static variables into a struct to make it easier to override
	them when testing.

2011-10-14  Eric Blake  <eblake@redhat.com>

	esx: drop dead code to silence Coverity
	Coverity detected that the only way to get to the cleanup label
	is if objectSpec had been successfully allocated, so the null
	check was dead code.

	* src/esx/esx_vi.c (esxVI_LookupObjectContentByType): Drop
	redundant null check.

2011-10-14  Jiri Denemark  <jdenemar@redhat.com>

	util: Fix typo in virGetHostname description

2011-10-14  Daniel P. Berrange  <berrange@redhat.com>

	Fix syntax problem in mingw32-libvirt.spec.in
	When defining macros, you can't put comments on the end of the
	line because they will get included in the macro definition

	* mingw32-libvirt.spec.in: Fix comment about hyperv

2011-10-14  Eric Blake  <eblake@redhat.com>

	macvtap: plug memory leak for 802.1Qbh
	Detected by Coverity.  Leak present since commit ca3b22b.

	* src/util/macvtap.c (doPortProfileOp8021Qbh): Release device name.

2011-10-14  Eric Blake  <eblake@redhat.com>

	qemu: plug memory leak on migration
	Detected by Coverity.  Leak introduced in commit 72de0d2.

	* src/qemu/qemu_migration.c (qemuMigrationCookieGraphicsXMLParse):
	Clean up on success.

2011-10-14  Eric Blake  <eblake@redhat.com>

	conf: plug memory leak on error
	Detected by Coverity.  Leak present since commit 874e65a; and
	while commit d50bb45 tried to fix the issue, it missed a path.

	* src/conf/domain_conf.c (virDomainDefParseBootXML): Always clean
	up useserial.

2011-10-14  Guido Günther  <agx@sigxcpu.org>

	Use virBufferEscapeShell in virNetSocketNewConnectSSH
	to escape the netcat command since it's passed to the shell. Adjust
	expected test case output accordingly.

	Add virBufferEscapeShell
	Escape strings so they're safe to pass to the shell. It's based on
	virsh's cmdEcho.

2011-10-14  Guido Günther  <agx@sigxcpu.org>

	Autodetect if the remote nc command supports the -q option
	Based on a patch by Marc Deslauriers <marc.deslauriers@ubuntu.com>

	RH: https://bugzilla.redhat.com/show_bug.cgi?id=562176
	Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/517478
	Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=573172

2011-10-14  Eric Blake  <eblake@redhat.com>

	storage: plug memory leak on error
	Detected by Coverity.  Present since commit 82c1740.

	* src/storage/storage_backend_logical.c
	(virStorageBackendLogicalMakeVol): Fix leak.

2011-10-14  Jiri Denemark  <jdenemar@redhat.com>

	util: Make getaddrinfo failure nonfatal in virGetHostname
	Setting a hostname that cannot be resolved is not the best configuration
	but since virGetHostname only calls getaddrinfo to get host's canonical
	name and we do not fail if the returned canonical name is NULL or
	"localhost", there is no reason why we should fail if getaddrinfo itself
	fails.

	qemu: Make sure BeginJob is always followed by EndJob
	Otherwise we can end up with a dangling job that can only be cleared by
	restarting libvirtd.

	qemu: Log debug messages when changing job
	Log debug messages anytime we call *BeginJob* or *EndJob* so that it's
	easier to spot incorrect usage of domain job APIs.

2011-10-14  Eric Blake  <eblake@redhat.com>

	qemu: fix text block info parsing
	Detected by Coverity.  p (the pointer to the string) is always true;
	when in reality, we wanted to know whether the integer value of the
	just-parsed string is '0' or '1'.  Logic bug since commit b1b5b51.

	* src/qemu/qemu_monitor_text.c (qemuMonitorTextGetBlockInfo): Set
	results to proper value.

2011-10-14  Eric Blake  <eblake@redhat.com>

	qemu: avoid text monitor null deref
	Detected by Coverity.  If, for some reason, our text monitor input
	does not match our assumptions, we end up incrementing p while it
	is NULL, then dereferencing the pointer 0x1, which will fault.

	* src/qemu/qemu_monitor_text.c
	(qemuMonitorTextGetBlockStatsParamsNumber): Rewrite to avoid
	deref of strchr failure.  Fix indentation.

2011-10-14  Eric Blake  <eblake@redhat.com>

	qemu: check for json allocation failure
	Detected by Coverity.  Introduced in commit b1b5b51.

	* src/qemu/qemu_monitor_json.c (qemuMonitorJSONGetBlockInfo):
	Avoid null dereference.

2011-10-14  Eric Blake  <eblake@redhat.com>

	build: add compiler attributes to virUUIDParse
	Coverity complained that most, but not all, clients of virUUIDParse
	were checking for errors.  Silence those coverity warnings by
	explicitly marking the cases where we trust the input, and fixing
	one instance that really should have been checking.  In particular,
	this silences a rather large percentage of the warnings I saw on my
	most recent Coverity analysis run.

	* src/util/uuid.h (virUUIDParse): Enforce rules.
	* src/util/uuid.c (virUUIDParse): Drop impossible check; at least
	Coverity will detect if we break rules and pass NULL.
	* src/xenapi/xenapi_driver.c (xenapiDomainCreateXML)
	(xenapiDomainLookupByID, xenapiDomainLookupByName)
	(xenapiDomainDefineXML): Ignore return when we trust data source.
	* src/vbox/vbox_tmpl.c (nsIDtoChar, vboxIIDToUUID_v3_x)
	(vboxCallbackOnMachineStateChange)
	(vboxCallbackOnMachineRegistered, vboxStoragePoolLookupByName):
	Likewise.
	* src/node_device/node_device_hal.c (gather_system_cap): Likewise.
	* src/xenxs/xen_sxpr.c (xenParseSxpr): Check for errors.

2011-10-14  Marc-André Lureau  <marcandre.lureau@gmail.com>

	virFDStream: close also given errfd (fd leak)
	In virFDStreamOpenFileInternal(), a errfd pipe is opened by
	virCommandRunAsync() and given to virFDStreamOpenInternal().

	It seems virFDStream should close errfd, just like the other
	fd it is given.

	This fixes screenshots leaking FDs:
	http://bugzilla.redhat.com/show_bug.cgi?id=745761

2011-10-14  Eric Blake  <eblake@redhat.com>

	command: avoid fd leak on failure
	virCommandTransferFD promises that the fd is no longer owned by
	the caller.  Normally, we want the fd to remain open until the
	child runs, but in error situations, we must close it earlier.

	* src/util/command.c (virCommandTransferFD): Close fd now if we
	can't track it to close later.
	(virCommandKeepFD): Adjust helper to make this easier.

2011-10-13  Serge E. Hallyn  <serge.hallyn@canonical.com>

	Fix typo in lxc_controller
	s/Mouting/Mounting.

2011-10-13  Eric Blake  <eblake@redhat.com>

	spec: mingw cleanups
	* libvirt.spec.in (%configure): Drop unused %{one} macro.
	* mingw32-libvirt.spec.in (%{rhel}): Compile ESX but not HyperV on
	mingw build for RHEL.
	(%build): Make configure honor spec conditionals.  Reorder to
	match libvirt.spec.
	* autobuild.sh (mingw): Update list to match.
	Suggested by Daniel P. Berrange.

2011-10-13  Eric Blake  <eblake@redhat.com>

	build: update to latest gnulib
	358 changes; most probably have no impact on libvirt, but we
	might as well stay current.

	* .gnulib: Update to latest.

2011-10-13  Michal Privoznik  <mprivozn@redhat.com>

	qemu: Check for domain being active on successful job acquire
	As this is needed. Although some functions check for domain
	being active before obtaining job, we need to check it after,
	because obtaining job unlocks domain object, during which
	a state of domain can be changed.

2011-10-13  Michal Privoznik  <mprivozn@redhat.com>

	events: Propose a separate lock for event queue
	Currently, push & pop from event queue (both server & client side)
	rely on lock from higher levels, e.g. on driver lock (qemu),
	private_data (remote), ...; This alone is not sufficient as not
	every function that interacts with this queue can/does lock,
	esp. in client where we have a different approach, "passing
	the buck".

	Therefore we need a separate lock just to protect event queue.

	For more info see:
	https://bugzilla.redhat.com/show_bug.cgi?id=743817

2011-10-13  Michal Privoznik  <mprivozn@redhat.com>

	qemu: Implement VIR_DUMP_RESET
	This patch extends qemudDomainCoreDump so it supports new VIR_DUMP_RESET
	flag. If this flag is set, domain is reset on successful dump. However,
	this is needed to be done after we start CPUs.

	virDomainCoreDump: Introduce VIR_DUMP_RESET flag
	This flag is intended to allow user to do so called system reset
	after dump, instead of sending ACPI reboot event.

2011-10-13  Philipp Hahn  <hahn@univention.de>

	example: Support debug output and loop switch
	Add support for enabling debug output via command line option.
	Allow to toggle the loop implementation between pure-Python and
	native-C.

	example: Redirect --help output to stdout/stderr
	When --help is requested, print usage() to stdout.
	When an illegal option is passed, print usage to stderr.

	example: Fix argument handling
	sys.argv contains the original command line arguments, while args only
	contains the arguments not handled by getopt(). Currently this is no
	problem since --help is the only command line option passable, which
	terminates the process, so the code is never reached. Any option added
	in the future will reveal the bug.

2011-10-13  Eric Blake  <eblake@redhat.com>

	snapshot: implement LIST_LEAVES flag in qemu
	With the recent refactoring of qemu snapshot relationships, it
	is now trivial to filter on leaves.

	* src/conf/domain_conf.c (virDomainSnapshotObjListCount)
	(virDomainSnapshotObjListCopyNames): Handle new flag.
	* src/qemu/qemu_driver.c (qemuDomainSnapshotListNames)
	(qemuDomainSnapshotNum, qemuDomainSnapshotListChildrenNames)
	(qemuDomainSnapshotNumChildren): Pass new flag through.

2011-10-13  Eric Blake  <eblake@redhat.com>

	snapshot: add API for filtering by leaves
	Counterpart to --roots.

	* include/libvirt/libvirt.h.in (VIR_DOMAIN_SNAPSHOT_LIST_LEAVES):
	New flag.
	* src/libvirt.c (virDomainSnapshotNum, virDomainSnapshotListNames)
	(virDomainSnapshotNumChildren)
	(virDomainSnapshotListChildrenNames): Document it.
	* tools/virsh.c (cmdSnapshotList): Expose it.
	* tools/virsh.pod (snapshot-list): Document --leaves.

2011-10-13  Philipp Hahn  <hahn@univention.de>

	xen: Return tap2 for tap2 disks
	For some versions of Xen the difference between "tap" and "tap2" is
	important. When converting back from xen-sxpr to libvirt-xml, that
	information is lost, which breaks re-defining the domain using that
	data.

	Explicitly return "tap2" for disks defined as "device/tap2".

2011-10-13  Philipp Hahn  <hahn@univention.de>

	xen: fix PyGrub boot device order
	When PyGrub is used as the bootloader in Xen, it gets passed the first
	bootable disk. Xend supports a "bootable"-flag for this, which isn't
	explicitly supported by libvirt.
	When converting libvirt-xml to xen-sxpr the "bootable"-flag gets
	implicitly set by xen.xend.XenConfig.device_add() for the first disk
	(marked as "Compat hack -- mark first disk bootable").
	When converting back xen-sxpr to libvirt-xml, the disks are returned in
	the internal order used by Xend ignoring the "bootable"-flag, which
	loses the original order. When the domain is then re-defined, the order
	of disks is changed, which breaks PyGrub, since a different disk gets
	passed.

	When converting xen-sxpr to libvirt-xml, use the "bootable"-flag to
	determine the first disk.

	This isn't perfect, since several disks can be marked as bootable using
	the Xend-API, but that is not supported by libvirt. In all known cases
	relevant to libvirt exactly one disk is marked as bootable.

2011-10-13  Philipp Hahn  <hahn@univention.de>

	tests: Add support for skipping tests
	AM_TESTS has support for skipping tests, while the C-implementation
	virtTestRun() does not support that feature.

	Print "_" or "SKIP" in verbose mode for tests returning EXIT_AM_SKIP=77.

2011-10-13  Harsh Prateek Bora  <harsh@linux.vnet.ibm.com>

	Introduce <driver> under <filesystem> to support open-by-handle
	VirtFS allows the user to choose between path/handle based fs driver.
	As of now, libvirt hardcoded path based driver only. This patch provides
	a solution to allow user to choose between path/handle based fs driver.

	Sample:

	    <filesystem type='mount'>
	      <driver type='handle'/>
	      <source dir='/folder/to/share1'/>
	      <target dir='mount_tag1'/>
	    </filesystem>

	    <filesystem type='mount'>
	      <driver type='path'/>
	      <source dir='/folder/to/share2'/>
	      <target dir='mount_tag2'/>
	    </filesystem>

2011-10-13  Sage Weil  <sage@newdream.net>

	buf: implement generic virBufferEscape
	Implement a generic helper to escape a given set of characters with a
	leading '\'.  Generalizes virBufferEscapeSexpr().

2011-10-12  Osier Yang  <jyang@redhat.com>

	daemon: Always advertise libvirtd service
	This is a regression introduced by new RPC codes, previously
	we advertise the service via ssh even if the daemon doesn't
	listen on TLS port (TCP is not choosed). Now the service is
	only advertised when it listens on TLS or TCP port. This breaks
	upper layer apps which intends to discover the service, such
	as virt-manager.

2011-10-12  Eric Blake  <eblake@redhat.com>

	snapshot: drop dead parameters
	The previous optimizations lead to some follow-on cleanups.

	* src/conf/domain_conf.c (virDomainSnapshotForEachChild)
	(virDomainSnapshotForEachDescendant): Drop dead parameter.
	(virDomainSnapshotActOnDescendant)
	(virDomainSnapshotObjListNumFrom)
	(virDomainSnapshotObjListGetNamesFrom): Update callers.
	* src/qemu/qemu_driver.c (qemuDomainSnapshotNumChildren)
	(qemuDomainSnapshotListChildrenNames, qemuDomainSnapshotDelete):
	Likewise.
	* src/conf/domain_conf.h: Update prototypes.

2011-10-12  Eric Blake  <eblake@redhat.com>

	snapshot: take advantage of new relations
	Among other improvements, virDomainSnapshotForEachDescendant is
	changed from iterative O(n^2) to recursive O(n).  A bit better
	than the O(n^3) implementation in virsh snapshot-list!

	* src/conf/domain_conf.c (virDomainSnapshotObjListNum)
	(virDomainSnapshotObjListNumFrom)
	(virDomainSnapshotObjeListGetNames, virDomainSnapshotForEachChild)
	(virDomainSnapshotForEachDescendant): Optimize.
	(virDomainSnapshotActOnDescendant): Tweak.
	(virDomainSnapshotActOnChild, virDomainSnapshotMarkDescendant):
	Delete, now that they are unused.

2011-10-12  Eric Blake  <eblake@redhat.com>

	snapshot: track qemu snapshot relations
	Maintain the parent/child relationships of all qemu snapshots.

	* src/qemu/qemu_driver.c (qemuDomainSnapshotLoad): Populate
	relationships after loading.
	(qemuDomainSnapshotCreateXML): Set relations on creation; tweak
	redefinition to reuse existing object.
	(qemuDomainSnapshotReparentChildren, qemuDomainSnapshotDelete):
	Clear relations on delete.

2011-10-12  Eric Blake  <eblake@redhat.com>

	snapshot: framework for more efficient relation traversal
	No one was using virDomainSnapshotHasChildren, but that was an
	O(n) function.  Exposing and tracking a bit more metadata for each
	snapshot will allow the same query to be made with an O(1) query
	of the member field.  For single snapshot operations (create,
	delete), callers can be trusted to maintain the metadata themselves,
	but for reloading, we can't compute parents as we go since there
	is no guarantee that parents were parsed before children, so we also
	provide a function to refresh the relationships, and which can
	be used to detect if the user has ignored our warnings and been
	directly modifying files in /var/lib/libvirt/qemu/snapshot.  This
	patch only adds metadata; later patches will actually use it.

	This layout intentionally hardcodes the size of each snapshot struct,
	by tracking sibling pointers, rather than having to deal with the
	headache of yet more memory management by directly sticking a
	dynamically sized child[] on each parent.

	* src/conf/domain_conf.h (_virDomainSnapshotObj)
	(_virDomainSnapshotObjList): Add members.
	(virDomainSnapshotUpdateRelations, virDomainSnapshotDropParent):
	New prototypes.
	(virDomainSnapshotHasChildren): Delete.
	* src/conf/domain_conf.c (virDomainSnapshotSetRelations)
	(virDomainSnapshotUpdateRelations, virDomainSnapshotDropParent):
	New functions.
	(virDomainSnapshotHasChildren): Drop unused function.
	* src/libvirt_private.syms (domain_conf): Update exports.

2011-10-12  Eric Blake  <eblake@redhat.com>

	snapshot: use correct qmp monitor command
	To date, JSON disk snapshots worked by accident, as they were always
	using hmp fallback due to a typo in commit e702b5b not picking up
	on the (intentional) difference in command names between the two
	monitor protocols.

	* src/qemu/qemu_monitor_json.c (qemuMonitorJSONDiskSnapshot):
	Spell QMP command correctly.
	Reported by Luiz Capitulino.

2011-10-12  Eric Blake  <eblake@redhat.com>

	snapshot: virsh shorthand for operating on current snap
	Rather than having to do:

	$ virsh snapshot-revert dom $(virsh snapshot-current dom --name)

	I thought it would be nice to do:

	$ virsh snapshot-revert dom --current

	I didn't add 'virsh snapshot-dumpxml --current' since we already have
	'virsh snapshot-current' for the same task.  snapshot-list accepted
	a name but did not require it, and that remains the case, with
	--current serving in place of that name.  For all other commands,
	name used to be required, and can now be replaced by --current;
	I intentionally made it so that omitting both --current and a name
	is an error (having the absence of a name imply --current seems
	just a bit too magic, so --current must be explicit).  I also had
	to keep snapshot-edit backwards-compatible, as the only command
	that already had a --current argument alongside a name, which still
	works to both edit a named snapshot and make it current.

	* tools/virsh.c (vshLookupSnapshot): New helper function.
	(cmdSnapshotEdit, cmdSnapshotList, cmdSnapshotParent)
	(cmdSnapshotDelete, cmdDomainSnapshotRevert): Use it, adding an
	option where needed.
	* tools/virsh.pod (snapshot-delete, snapshot-edit)
	(snapshot-list, snapshot-parent, snapshot-revert): Document
	use of --current.
	(snapshot-dumpxml): Mention alternative.

2011-10-12  Eric Blake  <eblake@redhat.com>

	build: fix mingw build without sasl
	Detected by autogen.sh on a cross-mingw build:

	Creating library file: .libs/libvirt.dll.a
	Cannot export virNetSASLContextCheckIdentity: symbol not defined
	Cannot export virNetSASLContextNewServer: symbol not defined
	...

	* src/libvirt_private.syms (virnetsaslcontext.h): Move symbols...
	* src/libvirt_sasl.syms: ...to new file.
	* src/Makefile.am (USED_SYM_FILES) [HAVE_SASL]: Use new file.
	(EXTRA_DIST): Ship it.

2011-10-12  Eric Blake  <eblake@redhat.com>

	build: fix 'make rpm'
	Since commit ddf3bd3, 'make rpm' failed with:

	RPM build errors:
	    File not found: /home/remote/eblake/rpmbuild/BUILDROOT/libvirt-0.9.6-1.fc14.eblake1318366440.x86_64/usr/share/systemtap/tapset/libvirtd.stp

	* libvirt.spec.in (with_dtrace): Match installed .stp files.

2011-10-12  Eric Blake  <eblake@redhat.com>

	build: fix 'make distcheck'
	I got these distcheck failures with sanlock enabled:

	ERROR: files left in build directory after distclean:
	./tools/virt-sanlock-cleanup
	./src/locking/qemu-sanlock.conf

	* src/Makefile.am (DISTCLEANFILES) [HAVE_SANLOCK]: Clean built
	file.
	* tools/Makefile.am (DISTCLEANFILES): Likewise.

2011-10-12  Eric Blake  <eblake@redhat.com>

	build: ship helper scripts
	Otherwise, 'make rpm' fails with:

	  GEN    libvirt_qemu.def
	make[2]: *** No rule to make target `dtrace2systemtap.pl', needed by `libvirt_probes.stp'.  Stop.

	* src/Makefile.am (EXTRA_DIST): Add recent script additions.

2011-10-12  Dan Horák  <dan@danny.cz>

	disable xenlight for non-Xen platforms
	when building libvirt in Fedora/s390x I've found that xenlight needs to
	be explicitly disabled in the spec file. Configure properly sets the
	library as non-existent, but the %files section still wants to package
	the 3 /var/*/libvirt/libxl directories. See also
	https://bugzilla.redhat.com/show_bug.cgi?id=745020

2011-10-12  Eric Blake  <eblake@redhat.com>

	build: fix 'make check' linkage with dtrace
	Building on Linux with dtrace enabled was failing 'make check':

	  CCLD   nodeinfotest
	../src/.libs/libvirt_test.a(libvirt_net_rpc_client_la-virnetclient.o): In function `virNetClientNew':
	/home/remote/eblake/libvirt/src/rpc/virnetclient.c:162: undefined reference to `libvirt_rpc_client_new_semaphore'

	On looking further, I see some earlier warnings emitted from libtool:

	*** Warning: Linking the shared library libvirt.la against the non-libtool
	*** objects  probes.o is not portable!

	Since src/probes.o is only built on Linux, and even then, only when
	dtrace is enabled, this failure does not affect other platforms, and
	despite libtool warning that it is not generally portable, it is not
	a problem for our use-case in libvirt.la.  But it turns out that while
	libtool is willing to jam raw .o files into an installed shared
	library (libvirt.la becomes libvirt.so), it is NOT willing to jam
	the same .o file into the convenience library libvirt_test.la.
	Perhaps this is a bug in libtool, but even if we get libtool fixed,
	libvirt must continue to build on platforms with older libtool.  So,
	the fix is the same as we are already using for the libvirt_lxc
	executable - don't rely on the .o file being in the convenience
	library, but instead use LDADD to pull it in directly.

	* tests/Makefile.am (PROBES_O): New macro.
	(LDADDS): Use it to fix link errors.

2011-10-12  Jiri Denemark  <jdenemar@redhat.com>

	build: Fix VPATH build with new probes

2011-10-11  Daniel P. Berrange  <berrange@redhat.com>

	Fix deps for probes.o to ensure correct build ordering

2011-10-11  Daniel P. Berrange  <berrange@redhat.com>

	Update examples for probing with systemtap
	This removes the old example for legacy probes and adds two
	new scripts demonstrating many of the new probe point facilities.

	The rpc-monitor.stp script will print out friendly details of all
	RPC traffic between a libvirt client/server. This is incredibly
	useful in seeing what RPC calls are being made, and also debugging
	problems in the RPC protocol code

	The events.stp script will print out lots of info about the poll
	event loop, which is useful for debugging event handling problems

	* examples/systemtap/events.stp, examples/systemtap/rpc-monitor.stp:
	  New examples
	* examples/systemtap/client.stp: Remove obsolete example

2011-10-11  Daniel P. Berrange  <berrange@redhat.com>

	Rewrite all the DTrace/SystemTAP probing
	The libvirtd daemon had a few crude system tap probes. Some of
	these were broken during the RPC rewrite. The new modular RPC
	code is structured in a way that allows much more effective
	tracing. Instead of trying to hook up the original probes,
	define a new set of probes for the RPC and event code.

	The master probes file is now src/probes.d.  This contains
	probes for virNetServerClientPtr, virNetClientPtr, virSocketPtr
	virNetTLSContextPtr and virNetTLSSessionPtr modules. Also add
	probes for the poll event loop.

	The src/dtrace2systemtap.pl script can convert the probes.d
	file into a libvirt_probes.stp file to make use from systemtap
	much simpler.

	The src/rpc/gensystemtap.pl script can generate a set of
	systemtap functions for translating RPC enum values into
	printable strings. This works for all RPC header enums (program,
	type, status, procedure) and also the authentication enum

	The PROBE macro will automatically generate a VIR_DEBUG
	statement, so any place with a PROBE can remove any existing
	manual DEBUG statements.

	* daemon/libvirtd.stp, daemon/probes.d: Remove obsolete probing
	* daemon/libvirtd.h: Remove probe macros
	* daemon/Makefile.am: Remove all probe buildings/install
	* daemon/remote.c: Update authentication probes
	* src/dtrace2systemtap.pl, src/rpc/gensystemtap.pl: Scripts
	  to generate STP files
	* src/internal.h: Add probe macros
	* src/probes.d: Master list of probes
	* src/rpc/virnetclient.c, src/rpc/virnetserverclient.c,
	  src/rpc/virnetsocket.c, src/rpc/virnettlscontext.c,
	  src/util/event_poll.c: Insert probe points, removing any
	  DEBUG statements that duplicate the info

2011-10-11  Daniel P. Berrange  <berrange@redhat.com>

	Fix missing lock calls on virNetTLSContextRef
	The virNetTLSContextRef API forgot to acquire/release the lock
	while changing ctxt->refs

	* src/rpc/virnettlscontext.c: Add lock calls

2011-10-11  Daniel P. Berrange  <berrange@redhat.com>

	Refactor TLS to facilitate dynamic probing
	Pull the call to gnutls_x509_crt_get_dn up into a higher function
	so that the 'dname' variable will be available for probe points

	* src/rpc/virnettlscontext.c: Pull gnutls_x509_crt_get_dn up
	  one level

2011-10-11  Daniel P. Berrange  <berrange@redhat.com>

	Add virSocketRef API to facilitate dynamic probing
	Instead of directly manipulating sock->refs, add a virSocketRef
	API

	* src/rpc/virnetsocket.c, src/rpc/virnetsocket.h: Add virSocketRef

2011-10-11  Daniel P. Berrange  <berrange@redhat.com>

	If receiving a stream error, mark EOF on the stream
	If we receive an error on the stream, set the EOF marker so
	that any further (bogus) incoming data is dropped.

	* src/rpc/virnetclientstream.c: Set EOF on stream

2011-10-11  Daniel P. Berrange  <berrange@redhat.com>

	Make libvirt.so include the RPC server code
	To avoid static linking libvirtd to the RPC server code, which
	then prevents sane introduction of DTrace probes, put it all
	in the libvirt.so, and export it

	* daemon/Makefile.am: Don't link to RPC libraries
	* src/Makefile.am: Link all RPC libraries to libvirt.so
	* src/libvirt_private.syms: Export all RPC functions

2011-10-11  Eric Blake  <eblake@redhat.com>

	snapshot: implement snapshot children listing in esx
	It was fairly trivial to return snapshot listing based on a
	point in the hierarchy, rather than starting at all roots.

	* src/esx/esx_driver.c (esxDomainSnapshotNumChildren)
	(esxDomainSnapshotListChildrenNames): New functions.

2011-10-11  Eric Blake  <eblake@redhat.com>

	snapshot: implement snapshot children listing in qemu
	Not too hard to wire up.  The trickiest part is realizing that
	listing children of a snapshot cannot use SNAPSHOT_LIST_ROOTS,
	and that we overloaded that bit to also mean SNAPSHOT_LIST_DESCENDANTS;
	we use that bit to decide which iteration to use, but don't want
	the existing counting/listing functions to see that bit.

	* src/conf/domain_conf.h (virDomainSnapshotObjListNumFrom)
	(virDomainSnapshotObjListGetNamesFrom): New prototypes.
	* src/conf/domain_conf.c (virDomainSnapshotObjListNumFrom)
	(virDomainSnapshotObjListGetNamesFrom): New functions.
	* src/libvirt_private.syms (domain_conf.h): Export them.
	* src/qemu/qemu_driver.c (qemuDomainSnapshotNumChildren)
	(qemuDomainSnapshotListChildrenNames): New functions.

2011-10-11  Eric Blake  <eblake@redhat.com>

	snapshot: remote protocol for snapshot children
	Very mechanical.  I'm so glad we've automated the generation of things,
	compared to what it was in 0.8.x days, where this would be much longer.

	* src/remote/remote_protocol.x
	(REMOTE_PROC_DOMAIN_SNAPSHOT_NUM_CHILDREN)
	(REMOTE_PROC_DOMAIN_SNAPSHOT_LIST_CHILDREN_NAMES): New rpcs.
	(remote_domain_snapshot_num_children_args)
	(remote_domain_snapshot_num_children_ret)
	(remote_domain_snapshot_list_children_names_args)
	(remote_domain_snapshot_list_children_names_ret): New structs.
	* src/remote/remote_driver.c (remote_driver): Use it.
	* src/remote_protocol-structs: Update.

2011-10-11  Eric Blake  <eblake@redhat.com>

	snapshot: virsh fallback for snapshot-list --descendants --from
	Given a list of snapshots and their parents, finding all descendants
	requires a hairy traversal.  This code is O(n^3); it could maybe be
	made to scale O(n^2) with the use of a hash table, but that costs more
	memory.  Hopefully there aren't too many people with a hierarchy
	so large as to approach REMOTE_DOMAIN_SNAPSHOT_LIST_NAMES_MAX (1024).

	* tools/virsh.c (cmdSnapshotList): Add final fallback.

2011-10-11  Eric Blake  <eblake@redhat.com>

	snapshot: virsh fallback for snapshot-list --from children
	Iterating over one level of children requires parsing all snapshots
	and their parents; a bit of code shuffling makes it pretty easy
	to do this as well.

	* tools/virsh.c (cmdSnapshotList): Add another fallback.

2011-10-11  Eric Blake  <eblake@redhat.com>

	snapshot: virsh fallback for snapshot-list --tree --from
	Emulating --from requires grabbing the entire list of snapshots
	and their parents, and recursively iterating over the list from
	the point of interest - but we already do that for --tree.  This
	turns on emulation for that situation.

	* tools/virsh.c (__vshControl): Rename member.
	(vshReconnect, cmdConnect, vshGetSnapshotParent): Update clients.
	(cmdSnapshotList): Add fallback.

2011-10-11  Eric Blake  <eblake@redhat.com>

	snapshot: virsh snapshot-list and children
	Sometimes, we only care about one branch of the snapshot hierarchy.
	Make it easier to list a single branch, by using the new APIs.

	Technically, I could emulate these new virsh options on old servers
	by doing a complete dump, then scraping xml to filter out just the
	snapshots that I care about, but I didn't want to do that in this patch.

	* tools/virsh.c (cmdSnapshotList): Add --from, --descendants.
	* tools/virsh.pod (snapshot-list): Document them.

2011-10-11  Eric Blake  <eblake@redhat.com>

	snapshot: new virDomainSnapshotListChildrenNames API
	The previous API addition allowed traversal up the hierarchy;
	this one makes it easier to traverse down the hierarchy.

	In the python bindings, virDomainSnapshotNumChildren can be
	generated, but virDomainSnapshotListChildrenNames had to copy
	from the hand-written example of virDomainSnapshotListNames.

	* include/libvirt/libvirt.h.in (virDomainSnapshotNumChildren)
	(virDomainSnapshotListChildrenNames): New prototypes.
	(VIR_DOMAIN_SNAPSHOT_LIST_DESCENDANTS): New flag alias.
	* src/libvirt.c (virDomainSnapshotNumChildren)
	(virDomainSnapshotListChildrenNames): New functions.
	* src/libvirt_public.syms: Export them.
	* src/driver.h (virDrvDomainSnapshotNumChildren)
	(virDrvDomainSnapshotListChildrenNames): New callbacks.
	* python/generator.py (skip_impl, nameFixup): Update lists.
	* python/libvirt-override-api.xml: Likewise.
	* python/libvirt-override.c
	(libvirt_virDomainSnapshotListChildrenNames): New wrapper function.

2011-10-11  Eric Blake  <eblake@redhat.com>

	docs: fix html bug
	</space> doesn't exist.  Introduced in commit 4bb4109f.

	* docs/formatdomain.html.in: Use correct end tag.

2011-10-11  Guido Günther  <agx@sigxcpu.org>

	xen_xs: Guard against set but empty kernel argument
	On xen 4.1 I observed configurations that look like:

	(image
	    (hvm
	        (kernel '')
	        (loader '/foo/bar')
	))

	The kernel element is there but unset. This leads to an empty <kernel/>
	element in the XML and even worse makes us skip the boot order parsing
	and therefore not emit a <boot device='$dev>'/> element which breaks CD
	booting.

2011-10-11  Guido Günther  <agx@sigxcpu.org>

	xen: add error handling to UUID parsing
	otherwise a missing UUID in a domain config just shows:

	error: An error occurred, but the cause is unknown

	Now we have:

	error: configuration file syntax error: config value uuid was missing

2011-10-11  Eric Blake  <eblake@redhat.com>

	maint: typo fixes
	I noticed a couple typos in recent commits, and fixed the remaining
	instances of them.

	* docs/internals/command.html.in: Fix spelling errors.
	* include/libvirt/libvirt.h.in (virConnectDomainEventCallback):
	Likewise.
	* python/libvirt-override.py (virEventAddHandle): Likewise.
	* src/lxc/lxc_container.c (lxcContainerChild): Likewise.
	* src/util/hash.c (virHashCreateFull): Likewise.
	* src/storage/storage_backend_logical.c
	(virStorageBackendLogicalMakeVol): Likewise.
	* src/esx/esx_driver.c (esxFormatVMXFileName): Likewise.
	* src/vbox/vbox_tmpl.c (vboxIIDIsEqual_v3_x): Likewise.

2011-10-11  Eric Blake  <eblake@redhat.com>

	snapshot: avoid accidental renames with snapshot-edit
	I was a bit surprised that 'virsh snapshot-edit dom name' silently
	allowed me to clone things, while still telling me the old name,
	especially since other commands like 'virsh edit dom' reject rename
	attempts (*).  This fixes things to be more explicit (**).

	(*) Technically, 'virsh edit dom' relies on virDomainDefineXML
	behavior, which rejects attempts to mix a new name with existing
	uuid or new uuid with existing name, but you can create a new
	domain by changing both uuid and name.  On the other hand, while
	snapshot-edit --clone is a true clone, creating a new domain
	would also have to decide whether to clone snapshot metadata,
	managed save, and any other secondary data related to the domain.
	Domain renames are not trivial either.

	(**) Renaming or creating a clone is still a risky proposition -
	for offline snapshots and system checkpoints, if the new name
	does not match an actual name recorded in the qcow2 internal
	snapshots, then you cannot revert to the new checkpoint.  But it
	is assumed that anyone using the new virsh flags knows what they
	are doing, and can deal with the fallout caused by a rename/clone;
	that is, we can't completely prevent a user from shooting
	themselves in the foot, so much as we are making the default
	action less risky.

	* tools/virsh.c (cmdSnapshotEdit): Add --rename, --clone.
	* tools/virsh.pod (snapshot-edit): Document them.

2011-10-11  Eric Blake  <eblake@redhat.com>

	snapshot: sort snapshot-list --tree
	Otherwise, the results are not repeatable.

	* tools/virsh.c (cmdSnapshotList): Print tree in predictable order.

2011-10-10  Osier Yang  <jyang@redhat.com>

	storage: Do not use comma as seperator for lvs output
	* src/storage/storage_backend_logical.c:

	If a logical vol is created as striped. (e.g. --stripes 3),
	the "device" field of lvs output will have multiple fileds which are
	seperated by comma. Thus the RE we write in the codes will not
	work well anymore. E.g. (lvs output for a stripped vol, uses "#" as
	seperator here):

	test_stripes##fSLSZH-zAS2-yAIb-n4mV-Al9u-HA3V-oo9K1B#\
	/dev/sdc1(10240),/dev/sdd1(0)#42949672960#4194304

	The RE we use:

	    const char *regexes[] = {
	        "^\\s*(\\S+),(\\S*),(\\S+),(\\S+)\\((\\S+)\\),(\\S+),([0-9]+),?\\s*$"
	    };

	Also the RE doesn't match the "devices" field of striped vol properly,
	it contains multiple "device path" and "offset".

	This patch mainly does:
	    1) Change the seperator into "#"
	    2) Change the RE for "devices" field from "(\\S+)\\((\\S+)\\)"
	       into "(\\S+)".
	    3) Add two new options for lvs command, (segtype, stripes)
	    4) Extend the RE to match the value for the two new fields.
	    5) Parse the "devices" field seperately in virStorageBackendLogicalMakeVol,
	       multiple "extents" info are generated if the vol is striped. The
	       number of "extents" is equal to the stripes number of the striped vol.

	A incidental fix: (virStorageBackendLogicalMakeVol)
	    Free "vol" if it's new created and there is error.

	Demo on striped vol with the patch applied:

	% virsh vol-dumpxml /dev/test_vg/vol_striped2
	<volume>
	  <name>vol_striped2</name>
	  <key>QuWqmn-kIkZ-IATt-67rc-OWEP-1PHX-Cl2ICs</key>
	  <source>
	    <device path='/dev/sda5'>
	      <extent start='79691776' end='88080384'/>
	    </device>
	    <device path='/dev/sda6'>
	      <extent start='62914560' end='71303168'/>
	    </device>
	  </source>
	  <capacity>8388608</capacity>
	  <allocation>8388608</allocation>
	  <target>
	    <path>/dev/test_vg/vol_striped2</path>
	    <permissions>
	      <mode>0660</mode>
	      <owner>0</owner>
	      <group>6</group>
	      <label>system_u:object_r:fixed_disk_device_t:s0</label>
	    </permissions>
	  </target>
	</volume>

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

2011-10-09  Michal Privoznik  <mprivozn@redhat.com>

	qemuDomainAttach: Initialize pidfile variable
	If parsing qemu command line fails (e.g. because of non-existing
	process number supplied), we jump to cleanup label where we free
	pidfile. Therefore it needs to be initialized. Otherwise we free
	random pointer.

2011-10-08  Eric Blake  <eblake@redhat.com>

	qemu: silence Coverity false positive
	Coverity complained that 4 out of 5 callers to virJSONValueObjectGetBoolean
	checked for errors.  But we documented that we don't care in this case.

	* src/qemu/qemu_monitor_json.c (qemuMonitorJSONGetBlockInfo): Use
	ignore_value.

2011-10-08  Eric Blake  <eblake@redhat.com>

	lxc: fix logic bug
	Detected by Coverity.  We want to increment the size_t counter,
	not the pointer to the counter.  Bug present since 5f5c6fde (0.9.5).

	* src/lxc/lxc_controller.c (lxcSetupLoopDevices): Use correct
	precedence.

2011-10-07  tangchen  <tangchen@cn.fujitsu.com>

	virsh: Update the help information for undefine command.
	virsh undefine command can now undefine an active guest, but the help information is still the old.
	This patch modifies it and make it coincident to the manpage of virsh.

2011-10-07  Daniel P. Berrange  <berrange@redhat.com>

	Don't send back unknown program errors for async messages
	If we send back an unknown program error for async messages,
	we will confuse the client because they only expect replies
	for method calls. Just log & drop any invalid async messages

	* src/rpc/virnetserver.c: Don't send error for async messages

2011-10-07  Daniel P. Berrange  <berrange@redhat.com>

	Fix deadlock when the RPC program is unknown
	Commit 597fe3cee68f561a181967b59a87b4e5c5880c4c accidentally
	introduced a deadlock when reporting an unknown RPC program.
	The virNetServerDispatchNewMessage method is called with
	the client locked, and must therefore not attempt to send
	any RPC messages back to the client. Only once the incoming
	message is passed off to the virNetServerHandleJob worker
	is it safe to start sending messages back

	* src/rpc/virnetserver.c: Delay checking for unknown RPC
	  program until in worker thread

2011-10-07  Eric Blake  <eblake@redhat.com>

	snapshot: simplify redefinition of disk snapshot
	Redefining disk-only snapshot xml should work even if the user
	did not explicitly pass VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY;
	the flag is only required for conditions where the <state>
	subelement is not already present in parsing (that is, defining
	a new snapshot).

	Also, fix the error code of some user-visible errors (the remaining
	VIR_ERR_INTERNAL_ERROR should not be user-visible, since parsing
	of <active> is only done from internal code).

	* src/conf/domain_conf.c (virDomainSnapshotDefParseString): Allow
	disks during redefinition of disk snapshot.

2011-10-07  Eric Blake  <eblake@redhat.com>

	snapshot: let virsh edit disk snapshots
	It was impossible for 'virsh snapshot-current dom name' to set name
	as the current snapshot, if name is a disk-only snapshot.

	Using strstr rather than full-blown xml parsing is safe, since the
	xml is assumed to be well-formed coming from libvirtd rather than
	arbitrary text coming from the user.

	* tools/virsh.c (cmdSnapshotCurrent, cmdSnapshotEdit): Pass
	disk_only flag when redefining a disk snapshot.

2011-10-07  Eric Blake  <eblake@redhat.com>

	snapshot: fix virsh error message typo
	* tools/virsh.c (cmdSnapshotList): Spell exclusive correctly.

2011-10-07  Michal Privoznik  <mprivozn@redhat.com>

	remote_driver: Avoid double free in EventControl building
	Don't xdr_free event data as they are freed by our caller
	virNetClientProgramDispatch.

2011-10-07  Eric Blake  <eblake@redhat.com>

	build: fix 'make distcheck' with pdwtags installed
	I am getting this failure with 'make distcheck':

	  GEN    ../../src/remote_protocol-structs
	/bin/sh: ../../src/remote_protocol-structs-t: Permission denied
	make[4]: *** [../../src/remote_protocol-structs] Error 1

	since it attempts a sub-run of a VPATH 'make check' where $(srcdir)
	is intentionally read-only.  I'm not sure which commit introduced
	the problem, although I suspect it was around 62dee6f when I
	refactored protocol struct checking to be more powerful.

	$(@F) is required by POSIX, and although it is not yet portable
	to all make implementations, we already require GNU make.

	* src/Makefile.am (PDWTAGS): Generate temp file into current
	directory, since $(srcdir) is read-only during distcheck.

2011-10-07  Guido Günther  <agx@sigxcpu.org>

	xenParseXM: don't dereference NULL pointer when script is empty

2011-10-07  Laine Stump  <laine@laine.org>

	qemu: add separate rerror_policy for disk errors
	Previously libvirt's disk device XML only had a single attribute,
	error_policy, to control both read and write error policy, but qemu
	has separate options for controlling read and write. In one case
	(enospc) a policy is allowed for write errors but not read errors.

	This patch adds a separate attribute that sets only the read error
	policy. If just error_policy is set, it will apply to both read and
	write error policy (previous behavior), but if the new rerror_policy
	attribute is set, it will override error_policy for read errors only.
	Possible values for rerror_policy are "stop", "report", and "ignore"
	("report" is the qemu-controlled default for rerror_policy when
	error_policy isn't specified).

	For consistency, the value "report" has been added to the possible
	values for error_policy as well.

2011-10-07  Laine Stump  <laine@laine.org>

	qemu: leave rerror policy at default when enospace is requested
	commit 12062ab set rerror=ignore when error_policy="enospace" was
	selected (since the rerror option in qemu doesn't accept "enospc", as
	the werror option does).

	After that patch was already pushed, Paolo Bonzini noticed it and
	commented that leaving rerror at the default ("report") would be a
	better choice. This patch corrects the problem - if error_policy =
	"enospace" is given, rerror is left off the qemu commandline,
	effectively setting it to "report". For other values, rerror is still
	set to match werror.

	Additionally, the parsing of error_policy was changed to no longer
	erroneously allow "default" as a choice - as with most other
	attributes, if you want the default setting, just don't specify an
	error_policy.

	Finally, two ommissions in the first patch were corrected - a
	long-dormant qemuxml2argv test for enospace was enabled, and fixed to
	pass, and the argv2xml parser in qemu_command.c was updated to
	recognize the different spelling on the qemu commandline.

2011-10-07  Eric Blake  <eblake@redhat.com>

	qemu: enable multifunction for older qemu
	Now that RHEL 6.2 Beta is out, it would be nice to test multifunction
	devices on that platform.  This changes things so that the multifunction
	cap bit can be set in two different ways: by version comparison (needed
	for qemu 0.13 which lacked a -device query), and by -device query
	(provided by qemu.git and backported to the RHEL beta build of
	qemu-kvm which still claims to be a modified 0.12, and therefore needed
	for RHEL).

	* src/qemu/qemu_capabilities.c (qemuCapsParseDeviceStr): Allow
	second method of setting multifunction cap bit.
	* tests/qemuhelptest.c (mymain): Test it.
	* tests/qemuhelpdata/qemu-kvm-0.12.1.2-rhel62-beta: New file.
	* tests/qemuhelpdata/qemu-kvm-0.12.1.2-rhel62-beta-device: Likewise.

2011-10-06  Guido Günther  <agx@sigxcpu.org>

	Document STREQ_NULLABLE and STRNEQ_NULLABLE

2011-10-06  Daniel P. Berrange  <berrange@redhat.com>

	Make LXC work with new network configuration types
	If using one of the new non-NAT/routed virtual network
	configurations, the LXC driver would not know how to
	setup the VETH devices. Adding in calls to setup the
	"actual" network configuration at VM startup and cleanup
	when shutting down fixes this.

	* src/lxc/lxc_driver.c: Setup/cleanup actual net devs

2011-10-06  Eric Blake  <eblake@redhat.com>

	init: raise default system aio limits
	https://bugzilla.redhat.com/show_bug.cgi?id=740899 documents that
	if qemu uses aio=native for its disks, then it consumes 128 aio
	requests per disk.  On a host with multiple guests, this can quickly
	run out of kernel aio requests with the default aio-max-nr of
	65536.  Kernel developers have confirmed that there is no up-front
	cost to raising this limit (a larger limit merely implies that more
	aio requests can be issued in parallel, which in turn will result
	in more kernel memory allocation, only if the system really does use
	that many requests).  Since the system default limit prevents 256
	disks, which is well within libvirt's current scalability, this
	patch installs a file to raise the limit and document it in case a
	system administrator has further cause to tune the limit.  The
	install only works on platforms new enough to source /etc/sysctl.d/*
	alongside /etc/sysctl.conf (F14 and RHEL 6).

	* daemon/libvirtd.sysctl: New file.
	* daemon/Makefile.am (EXTRA_DIST): Ship it.
	(install-init, uninstall-init): Install it.
	* libvirt.spec.in (%files): Include it in rpm.

2011-10-06  Eric Blake  <eblake@redhat.com>

	maint: fix minor issues in virterror public header
	Consistent use of tabs, fewer long lines, and a typo fix.

	* include/libvirt/virterror.h: Fix typos, layout.

2011-10-06  Eric Blake  <eblake@redhat.com>

	snapshot: enforce REVERT_FORCE on qemu
	Implements the documentation for snapshot revert vs. force.

	Part of the patch tightens existing behavior (previously, reverting
	to an old snapshot without <domain> was blindly attempted, now it
	requires force), while part of it relaxes behavior (previously, it
	was not possible to revert an active domain to an ABI-incompatible
	active snapshot, now force allows this transition).

	* src/qemu/qemu_driver.c (qemuDomainRevertToSnapshot): Check for
	risky situations, and allow force to get past them.

2011-10-06  Eric Blake  <eblake@redhat.com>

	snapshot: use qemu-img on disks in use at time of snapshot
	Once we know which set of disks belong to a snapshot, reverting or
	deleting that snapshot should visit just those disks, rather than
	also visiting disks that were hot-plugged in the meantime or
	skipping disks that were hot-unplugged in the meantime.

	* src/qemu/qemu_domain.c (qemuDomainSnapshotForEachQcow2): Use
	snapshot domain details when available.  Avoid NULL deref.

2011-10-06  Eric Blake  <eblake@redhat.com>

	snapshot: add REVERT_FORCE to API
	Although reverting to a snapshot is a form of data loss, this is
	normally expected.  However, there are two cases where additional
	surprises (failure to run the reverted state, or a break in
	connectivity to the domain) can come into play.  Requiring extra
	acknowledgment in these cases will make it less likely that
	someone can get into an unrecoverable state due to a default revert.

	Also create a new error code, so users can distinguish when forcing
	would make a difference, rather than having to blindly request force.

	* include/libvirt/libvirt.h.in (VIR_DOMAIN_SNAPSHOT_REVERT_FORCE):
	New flag.
	* src/libvirt.c (virDomainRevertToSnapshot): Document it.
	* include/libvirt/virterror.h (VIR_ERR_SNAPSHOT_REVERT_RISKY): New
	error value.
	* src/util/virterror.c (virErrorMsg): Implement it.
	* tools/virsh.c (cmdDomainSnapshotRevert): Add --force to virsh.
	* tools/virsh.pod (snapshot-revert): Document it.

2011-10-05  Eric Blake  <eblake@redhat.com>

	snapshot: implement snapshot roots listing in vbox
	Commit 9f5e53e introduced the ability to filter snapshots to
	just roots, but it was never implemented for VBox until now.

	The VBox implementation prohibits deletion of a snapshot with
	multiple children.  Hence, there can only be at most one root,
	which is found by searching for the snapshot with a NULL uuid.

	Prior to 4.0, snapshotGet looked up by UUID, and snapshotFind
	looked up by name; after that point, snapshotGet disappeared
	and snapshotFind handles uuid or name.

	* src/vbox/vbox_tmpl.c (vboxDomainSnapshotNum)
	(vboxDomainSnapshotListNames): Implement limiting list to root.

2011-10-05  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Don't fail virDomainGetInfo if we can't update balloon info
	Qemu driver tries to update balloon data in virDomainGetInfo and if it
	can't do so because there is another monitor job running, it just
	reports what's known in domain def. However, if there was no job running
	but getting the data from qemu fails, we would fail the whole API. This
	doesn't make sense. Let's make the failure nonfatal.

2011-10-05  Eric Blake  <eblake@redhat.com>

	snapshot: simplify esx snapshot name lookup
	No need to request the parent of a snapshot if we aren't going to use it.

	* src/esx/esx_vi.c (esxVI_GetSnapshotTreeByName): Make parent
	optional.
	* src/esx/esx_driver.c (esxDomainSnapshotCreateXML)
	(esxDomainSnapshotLookupByName, esxDomainRevertToSnapshot)
	(esxDomainSnapshotDelete): Simplify accordingly.

2011-10-05  Eric Blake  <eblake@redhat.com>

	snapshot: implement snapshot roots listing in esx
	Commit 9f5e53e introduced the ability to filter snapshots to
	just roots, but it was never implemented for ESX until now.

	* src/esx/esx_vi.h (esxVI_GetNumberOfSnapshotTrees)
	(esxVI_GetSnapshotTreeNames): Add parameter.
	* src/esx/esx_vi.c (esxVI_GetNumberOfSnapshotTrees)
	(esxVI_GetSnapshotTreeNames): Allow choice of recursion or not.
	* src/esx/esx_driver.c (esxDomainSnapshotNum)
	(esxDomainSnapshotListNames): Use it to limit to roots.

2011-10-05  Laine Stump  <laine@laine.org>

	qemu: correct misspelled 'enospc' option, and only use for werror
	This resolves:

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

	When support for setting the qemu disk error policy to "enospc" was
	added, it was inadvertently spelled "enospace". This patch corrects
	that on the qemu commandline (while retaining the "enospace" spelling
	for libvirt's XML).

	Also, while examining the qemu source, I found that "enospc" is not
	allowed for the read error policy, only for write error policy (makes
	sense). Since libvirt currently only has a single error policy
	setting, when "enospace" is selected, the read error policy is set to
	"ignore".

2011-10-05  Eric Blake  <eblake@redhat.com>

	snapshot: better virsh handling of missing current, parent
	Previously, virsh 'snapshot-parent' and 'snapshot-current' were
	completely silent in the case where the code conclusively proved
	there was no parent or current snapshot, but differed in exit
	status; this silence caused some confusion on whether the commands
	worked.  Furthermore, commit d1be48f introduced a regression where
	snapshot-parent would leak output about an unknown function, but
	only on the first attempt, when talking to an older server that
	lacks virDomainSnapshotGetParent.  This changes things to consistenly
	report an error message and exit with status 1 when no snapshot
	exists, and to avoid leaking unknown function warnings when using
	fallbacks.

	* tools/virsh.c (vshGetSnapshotParent): Alter signature, to
	distinguish between real error and missing parent.  Don't pollute
	last_error on success.
	(cmdSnapshotParent): Adjust caller.  Always output message on
	failure.
	(cmdSnapshotList): Adjust caller.
	(cmdSnapshotCurrent): Always output message on failure.

2011-10-05  Guido Günther  <agx@sigxcpu.org>

	Document that ff callbacks need to be invoked from a clean stack.
	Also fix a typo.

2011-10-04  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Fix migration with dname
	Destination libvirtd remembers the original name in the prepare phase
	and clears it in the finish phase. The original name is used when
	comparing domain name in migration cookie.

2011-10-04  Daniel P. Berrange  <berrange@redhat.com>

	Allow passing of command line args to LXC container
	When booting a virtual machine with a kernel/initrd it is possible
	to pass command line arguments using the <cmdline>...args...</cmdline>
	element in the guest XML. These appear to the kernel / init process
	in /proc/cmdline.

	When booting a container we do not have a custom /proc/cmdline,
	but we can easily set an environment variable for it. Ideally
	we could pass individual arguments to the init process as a
	regular set of 'char *argv[]' parameters, but that would involve
	libvirt parsing the <cmdline> XML text. This can easily be added
	later, even if we add the env variable now

	* docs/drvlxc.html.in: Document env variables passed to LXC
	* src/conf/domain_conf.c: Add <cmdline> to be parsed for
	  guests of type='exe'
	* src/lxc/lxc_container.c: Set LIBVIRT_LXC_CMDLINE env var

2011-10-04  Daniel P. Berrange  <berrange@redhat.com>

	Add support for bandwidth filtering on LXC guests
	Call virBandwidthEnable after creating the LXC veth, so that any
	bandwidth controls get applied

	* src/lxc/lxc_driver.c: Enable bandwidth limiting

2011-10-04  Laine Stump  <laine@laine.org>

	network: fill in bandwidth from portgroup for all forward modes
	This patch is a fix for:

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

	which was discovered by Dan Berrange while making bandwidth
	configuration work for LXC guests.

	Background: Although virtportprofile data from a network portgroup is
	only applicable for direct mode interfaces, the code that copies
	bandwidth data from the portgroup was also only being executed in the
	case of direct mode interfaces. The result was that interfaces using
	traditional virtual networks (forward mode='nat|route|none'), and
	those using a host bridge for forwarding, would not pick up bandwidth
	data from a portgroup defined in the network.

	This patch moves that code outside the conditional, so that bandwidth
	information is *alway* copied from the appropriate portgroup (unless
	the <interface> definition itself already has bandwidth information,
	which would take precedence over what's in the portgroup anyway).

2011-10-04  Neil Wilson  <neil@brightbox.co.uk>

	bridge_driver.c: Fix autoconf setting
	Code altered so that it is consistent with the associated comment. The
	'autoconf' variable is forced to zero.

2011-10-04  Marc-André Lureau  <marcandre.lureau@gmail.com>

	Set to NULL members that have been freed to prevent crashes
	Do not crash if virStreamFinish is called after error.

	==11000== Invalid read of size 4
	==11000==    at 0x373A8099A0: pthread_mutex_lock (pthread_mutex_lock.c:51)
	==11000==    by 0x4C7CADE: virMutexLock (threads-pthread.c:85)
	==11000==    by 0x4D57C31: virNetClientStreamRaiseError (virnetclientstream.c:203)
	==11000==    by 0x4D385E4: remoteStreamFinish (remote_driver.c:3541)
	==11000==    by 0x4D182F9: virStreamFinish (libvirt.c:14157)
	==11000==    by 0x40FDC4: cmdScreenshot (virsh.c:3075)
	==11000==    by 0x42BA40: vshCommandRun (virsh.c:14922)
	==11000==    by 0x42ECCA: main (virsh.c:16381)
	==11000==  Address 0x59b86c0 is 16 bytes inside a block of size 216 free'd
	==11000==    at 0x4A06928: free (vg_replace_malloc.c:427)
	==11000==    by 0x4C69E2B: virFree (memory.c:310)
	==11000==    by 0x4D57B56: virNetClientStreamFree (virnetclientstream.c:184)
	==11000==    by 0x4D3DB7A: remoteDomainScreenshot (remote_client_bodies.h:1812)
	==11000==    by 0x4CFD245: virDomainScreenshot (libvirt.c:2903)
	==11000==    by 0x40FB73: cmdScreenshot (virsh.c:3029)
	==11000==    by 0x42BA40: vshCommandRun (virsh.c:14922)
	==11000==    by 0x42ECCA: main (virsh.c:16381)

2011-10-03  Eric Blake  <eblake@redhat.com>

	snapshot: implement getparent for vbox
	Built by copying from existing functions.

	* src/vbox/vbox_tmpl.c (vboxDomainSnapshotGetParent): New function.

2011-10-03  Eric Blake  <eblake@redhat.com>

	snapshot: implement getparent for esx
	Pretty easy to paste together compared to existing functions.

	* src/esx/esx_driver.c (esxDomainSnapshotGetParent): New function.

2011-10-01  Laine Stump  <laine@laine.org>

	qemu: make PCI multifunction support more manual
	When support for was added for PCI multifunction cards (in commit
	9f8baf, first included in libvirt 0.9.3), it was done by always
	turning on the multifunction bit for all PCI devices. Since that time
	it has been realized that this is not an ideal solution, and that the
	multifunction bit must be selectively turned on. For example, see

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

	and the discussion before and after

	  https://www.redhat.com/archives/libvir-list/2011-September/msg01036.html

	This patch modifies multifunction support so that the multifunction=on
	option is only added to the qemu commandline for a device if its PCI
	<address> definition has the attribute "multifunction='on'", e.g.:

	  <address type='pci' domain='0x0000' bus='0x00'
	           slot='0x04' function='0x0' multifunction='on'/>

	In practice, the multifunction bit should only be turned on if
	function='0' AND other functions will be used in the same slot - it
	usually isn't needed for functions 1-7 (although there are apparently
	some exceptions, e.g. the Intel X53 according to the QEMU source
	code), and should never be set if only function 0 will be used in the
	slot. The test cases have been changed accordingly to illustrate.

	With this patch in place, if a user attempts to assign multiple
	functions in a slot without setting the multifunction bit for function
	0, libvirt will issue an error when the domain is defined, and the
	define operation will fail. In the future, we may decide to detect
	this situation and automatically add multifunction=on to avoid the
	error; even then it will still be useful to have a manual method of
	turning on multifunction since, as stated above, there are some
	devices that excpect it to be turned on for all functions in a slot.

	A side effect of this patch is that attempts to use the same PCI
	address for two different devices will now log an error (previously
	this would cause the domain define operation to fail, but there would
	be no log message generated). Because the function doing this log was
	almost completely rewritten, I didn't think it worthwhile to make a
	separate patch for that fix (the entire patch would immediately be
	obsoleted).

2011-10-01  Laine Stump  <laine@laine.org>

	conf: remove unused VIR_ENUM_DECL
	While adding a new enum, I noticed a VIR_ENUM_DECL for a type that
	doesn't exist. There is also of course no matching VIR_ENUM_IMPL for
	it.

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

	virsh: do not unlink NULL file
	error:could not take a screenshot of xp
	==6216== Syscall param unlink(pathname) points to unaddressable byte(s)
	==6216==    at 0x373A0D4937: unlink (syscall-template.S:82)
	==6216==    by 0x40FD73: cmdScreenshot (virsh.c:3070)
	==6216==    by 0x42BA0D: vshCommandRun (virsh.c:14920)
	==6216==    by 0x42EC97: main (virsh.c:16379)
	==6216==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
	==6216==
	error:Requested operation is not valid: domain is not running

2011-10-01  Serge E. Hallyn  <serge.hallyn@canonical.com>

	lvm storage backend: handle command_names=1 in lvm.conf
	If the regexes supported (?:pvs)?, then we could handle this by
	optionally matching but not returning the initial command name.  But it
	doesn't.  So add a new char* argument to
	virStorageBackendRunProgRegex().  If that argument is NULL then we act
	as usual.  Otherwise, if the string at that argument is found at the
	start of a returned line, we drop that before running the regex.

	With this patch, virt-manager shows me lvs with command_names 1 or 0.

	The definitions of PVS_BASE etc may want to be moved into the configure
	scripts (though given how PVS is found, IIUC that could only happen if
	pvs was a link to pvs_real), but in any case no sense dealing with that
	until we're sure this is an ok way to handle it.

2011-09-30  Michal Privoznik  <mprivozn@redhat.com>

	qemu: Check for outstanding async job too
	Currently, qemuDomainGetXMLDesc and qemudDomainGetInfo check for
	outstanding synchronous job before (eventual) monitor entering.
	However, there can be already async job set, e.g. migration.

2011-09-29  Peter Krempa  <pkrempa@redhat.com>

	qemu: Fix error message mentioning VNC instead of SPICE

2011-09-29  Xu He Jie  <xuhj@linux.vnet.ibm.com>

	virsh: Add 'reset' command for virsh

	remote: Implement 'reset' for remote driver

	qemu: Implement 'reset' for qemu driver

	api: Add public api for 'reset'
	Add new public api for 'reset'.
	It can reset domain immediately without any guest shutdown.

2011-09-29  Jiri Denemark  <jdenemar@redhat.com>

	logging: Add date to log timestamp

	logging: Do not log timestamp through syslog
	Syslog puts the timestamp to every message anyway so this removes
	redundant data.

2011-09-29  Matthias Bolte  <matthias.bolte@googlemail.com>

	hyperv: Report an error for acceptable URI schemes with a transport
	Before, URIs such as hyperv+ssh:// have been declined by the Hyper-V
	driver resulting in the remote driver trying to connect to an
	non-existing libvirtd.

	Now such URIs trigger an error in the yper-V driver suggesting to
	try again without the transport part in the scheme.

2011-09-29  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Report an error for acceptable URI schemes with a transport
	Before, URIs such as esx+ssh:// have been declined by the ESX driver
	resulting in the remote driver trying to connect to an non-existing
	libvirtd.

	Now such URIs trigger an error in the ESX driver suggesting to try
	again without the transport part in the scheme.

2011-09-29  Douglas Schilling Landgraf  <dougsland@redhat.com>

	formatdomain.html.in: fix tickpolicy
	there is no option "none":

	>From libvirt/src/conf/domain_conf.c

	<snip>
	VIR_ENUM_IMPL(virDomainTimerTickpolicy,
	VIR_DOMAIN_TIMER_TICKPOLICY_LAST,
	              "delay",
	              "catchup",
	              "merge",
	              "discard");
	</snip>

	Replacing with delay.

2011-09-29  Daniel Veillard  <veillard@redhat.com>

	virsh: describe attach-interface parameter target
	This patch is based on a improvement suggested by Kazuhiro Kikuchi
	of Fujitsu, it gives a description of the target parameter for that
	command

	* tools/virsh.pod: add description for target parameter of
	  attach-interface

2011-09-29  Daniel Veillard  <veillard@redhat.com>

	virsh: update man page for cpu_shares parameter
	The man page suggest that the cpu_shares parameter of schedinfo
	allows values 0-262144, but the kernel remaps values 0 and 1 to
	the minimum 2, just document that behaviour:

	[root@test ~]# cat /cgroup/cpu/libvirt/qemu/cpu.shares
	1024
	[root@test ~]# echo 0 > /cgroup/cpu/libvirt/qemu/cpu.shares
	[root@test ~]# cat /cgroup/cpu/libvirt/qemu/cpu.shares
	2
	[root@test ~]# echo 1 > /cgroup/cpu/libvirt/qemu/cpu.shares
	[root@test ~]# cat /cgroup/cpu/libvirt/qemu/cpu.shares
	2
	[root@test ~]#

	* tools/virsh.pod: update description of the cpu_shares parameter
	  to indicate the values 0 and 1 are automatically changed by the
	  kernel to minimal value 2

2011-09-29  Michal Privoznik  <mprivozn@redhat.com>

	qemu: Check for ejected media during startup and migration
	If the daemon is restarted so we reconnect to monitor, cdrom media
	can be ejected. In that case we don't want to show it in domain xml,
	or require it on migration destination.

	To check for disk status use 'info block' monitor command.

2011-09-29  Alex Jia  <ajia@redhat.com>

	qemu: add return value check
	* src/qemu/qemu_migration.c: if 'vmdef' is NULL, the function
	  virDomainSaveConfig still dereferences it, it doesn't make
	  sense, so should add return value check to make sure 'vmdef'
	  is non-NULL before calling virDomainSaveConfig, in addition,
	  in order to debug later, also should record error information
	  into log.

2011-09-28  Eric Blake  <eblake@redhat.com>

	snapshot: implement getparent in qemu
	First hypervisor implementation of the new API.
	Allows 'virsh snapshot-list --tree' to be more efficient.

	* src/qemu/qemu_driver.c (qemuDomainSnapshotGetParent): New
	function.

2011-09-28  Eric Blake  <eblake@redhat.com>

	snapshot: add virsh snapshot-list --tree
	Reuse the tree listing of nodedev-list, coupled with the new helper
	function to efficiently grab snapshot parent names, to produce
	tree output for a snapshot hierarchy.  For example:

	$ virsh snapshot-list dom --tree
	root1
	 |
	  +- sibling1
	  +- sibling2
	  |   |
	  |   +- grandchild
	  |
	  +- sibling3

	root2
	 |
	  +- child

	* tools/virsh.c (cmdSnapshotList): Add --tree.
	* tools/virsh.pod (snapshot-list): Document it.

2011-09-28  Eric Blake  <eblake@redhat.com>

	snapshot: refactor virsh snapshot parent computation
	Make parent computation reusable, using virDomainSnapshotGetParent
	when possible.

	* tools/virsh.c (vshGetSnapshotParent): New helper.
	(cmdSnapshotParent): Use it.

2011-09-28  Eric Blake  <eblake@redhat.com>

	snapshot: remote protocol for getparent
	Mostly straight-forward, although this is the first API that
	returns a new snapshot based on a snapshot rather than a domain.

	* src/remote/remote_protocol.x
	(REMOTE_PROC_DOMAIN_SNAPSHOT_GET_PARENT): New rpc.
	(remote_domain_snapshot_get_parent_args)
	(remote_domain_snapshot_get_parent_ret): New structs.
	* src/rpc/gendispatch.pl: Adjust generator.
	* src/remote/remote_driver.c (remote_driver): Use it.
	* src/remote_protocol-structs: Update.

2011-09-28  Eric Blake  <eblake@redhat.com>

	snapshot: new virDomainSnapshotGetParent API
	Although a client can already obtain a snapshot's parent by
	dumping and parsing the xml, then doing a snapshot lookup by
	name, it is more efficient to get the parent in one step, which
	in turn will make operations that must traverse a snapshot
	hierarchy easier to perform.

	* include/libvirt/libvirt.h.in (virDomainSnapshotGetParent):
	Declare.
	* src/libvirt.c (virDomainSnapshotGetParent): New function.
	* src/libvirt_public.syms: Export it.
	* src/driver.h (virDrvDomainSnapshotGetParent): New callback.

2011-09-28  Eric Blake  <eblake@redhat.com>

	docs: document node device XML
	Coupled with the recent virsh nodedev-* doc patch, this should now
	give a better picture of libvirt node device handling.

	* docs/formatnode.html.in: Fill in page.

2011-09-28  Eric Blake  <eblake@redhat.com>

	docs: document virsh nodedev-* commands
	This section of the man page was completely missing; I stumbled on
	it when I had no clue that I had to use nodedev-reattach after
	I was done playing with <hostdev> device passthrough to one of my
	guests.

	* tools/virsh.pod (NODEDEV COMMANDS): New section.
	(attach-device, detach-device): Add cross-references.

2011-09-28  Laine Stump  <laine@laine.org>

	security: properly chown/label bidirectional and unidirectional fifos
	This patch fixes the regression with using named pipes for qemu serial
	devices noted in:

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

	The problem was that, while new code in libvirt looks for a single
	bidirectional fifo of the name given in the config, then relabels that
	and continues without looking for / relabelling the two unidirectional
	fifos named ${name}.in and ${name}.out, qemu looks in the opposite
	order. So if the user had naively created all three fifos, libvirt
	would relabel the bidirectional fifo to allow qemu access, but qemu
	would attempt to use the two unidirectional fifos and fail (because it
	didn't have proper permissions/rights).

	This patch changes the order that libvirt looks for the fifos to match
	what qemu does - first it looks for the dual fifos, then it looks for
	the single bidirectional fifo. If it finds the dual unidirectional
	fifos first, it labels/chowns them and ignores any possible
	bidirectional fifo.

	(Note commit d37c6a3a (which first appeared in libvirt-0.9.2) added
	the code that checked for a bidirectional fifo. Prior to that commit,
	bidirectional fifos for serial devices didn't work because libvirt
	always required the ${name}.(in|out) fifos to exist, and qemu would
	always prefer those.

2011-09-28  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Preserve fakeReboot flag in domain status
	Thus, when libvirtd is restarted, it will know if a domain is supposed
	to be killed or reset when it shuts down.

	qemu: Finish domain shutdown on reconnect
	If a domain started with -no-shutdown shuts down while libvirtd is not
	running, it will be seen as paused when libvirtd reconnects to it. Use
	the paused reason to detect if a domain was stopped because of shutdown
	and finish the process just as if a SHUTDOWN event is delivered from
	qemu.

	qemu: Check domain status details when reconnecting monitor
	Current qemu is able to give us detailed domain status (not just if it
	is running or not) which we can translate into a status reason.

	qemu: Always remove domain object if MigratePrepare fails
	If migration failed in Prepare phase after virDomainAssignDef and before
	a job was started, the domain object was not properly removed.

2011-09-28  Jamie Strandboge  <jamie@canonical.com>

	fix AppArmor driver for pipe character devices
	The AppArmor security driver adds only the path specified in the domain
	XML for character devices of type 'pipe'. It should be using <path>.in
	and <path>.out. We do this by creating a new vah_add_file_chardev() and
	use it for char devices instead of vah_add_file(). Also adjust
	valid_path() to accept S_FIFO (since qemu chardevs of type 'pipe' use
	fifos). This is https://launchpad.net/bugs/832507

2011-09-28  Peter Krempa  <pkrempa@redhat.com>

	virsh: Allow using complete <capabilities> elements with cpu-baseline
	This patch cleans the cpu baseline function using new libvirt helper
	functions and fixes XPath expression that selects <cpu> elements from
	the source file, that can contain concatenated <capabilities> XMLs,
	domain XMLs and bare <cpu> elements. The fixed XPath expression ensures
	not to select NUMA <cpu id=... elements.

	This patch also removes vshRealloc function, that remained unused after
	cleaning up cpu-baseline.

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

2011-09-28  Peter Krempa  <pkrempa@redhat.com>

	virsh: Allow using domain and capabilities XMLs with cpu-compare
	This patch adds extraction of the <cpu> element from capabilities and
	domain definition XML documents to improve user experience.

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

2011-09-28  Eric Blake  <eblake@redhat.com>

	snapshot: fix man page typos
	pod2man from perl-5.8.8 (RHEL 5) errors out on ill-formed POD:

	*** ERROR: unterminated I<...> at line 1114 in file virsh.pod
	*** ERROR: unterminated I<...> at line 1851 in file virsh.pod

	Newer pod2man appears to be more tolerant (which is a shame,
	because it meant that this error is harder to detect).

	* tools/virsh.pod (undefine, snapshot-current): Add missing >.

2011-09-27  Laine Stump  <laine@laine.org>

	qemu: add ability to set PCI device "rombar" on or off
	This patch was made in response to:

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

	In short, qemu's default for the rombar setting (which makes the
	firmware ROM of a PCI device visible/not on the guest) was previously
	0 (not visible), but they recently changed the default to 1
	(visible). Unfortunately, there are some PCI devices that fail in the
	guest when rombar is 1, so the setting must be exposed in libvirt to
	prevent a regression in behavior (it will still require explicitly
	setting <rom bar='off'/> in the guest XML).

	rombar is forced on/off by adding:

	  <rom bar='on|off'/>

	inside a <hostdev> element that defines a PCI device. It is currently
	ignored for all other types of devices.

	At the moment there is no clean method to determine whether or not the
	rombar option is supported by QEMU - this patch uses the advice of a
	QEMU developer to assume support for qemu-0.12+. There is currently a
	patch in the works to put this information in the output of "qemu-kvm
	-device pci-assign,?", but of course if we switch to keying off that,
	we would lose support for setting rombar on all the versions of qemu
	between 0.12 and whatever version gets that patch.

2011-09-27  Eric Blake  <eblake@redhat.com>

	spec: F15 still uses cgconfig, RHEL lacks hyperv
	Commit ecd8725c dropped attempts to probe the cgconfig service on
	new enough Fedora where systemd took over that aspect of the system,
	but mistakenly used F14 instead of F15 as the cutoff point.

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

	Also, RHEL does not include HyperV support yet.

	* libvirt.spec.in (with_cgconfig): Check cgconfig service in F15.
	(%{?rhel}): Provide default for with_hyperv.

2011-09-27  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Relax -no-shutdown check to [0.14.0, 0.15.50)
	SIGTERM handling for -no-shutdown is already fixed in qemu git and
	libvirt can safely use it. The downside is that 0.15.50 version of qemu
	can be any qemu compiled from git, even that without the fix for
	SIGTERM. However, I think this patch is worth it since excluding 0.15.50
	from the check makes testing current qemu with libvirt much easier and
	someone running qemu from git should be able to rebuild fixed qemu from
	git if they hit the problem with a hang on shutdown.

	virsh: Better document --copy-storage migrate options
	Both --copy-storage-{all,inc} options require disk images to be present
	on destination host.

	virsh: Enhance documentation of commands starting jobs
	Some virsh commands start a (long-running) job that can be monitored
	using domjobinfo and aborted with domjobabort. Let's be explicit about
	this in virsh man page.

2011-09-27  Michal Privoznik  <mprivozn@redhat.com>

	virLockManagerNopInit: Rename flags to unused_flags
	As these might be not used and make syntax-check complains about checking
	them via virCheckFlags.

2011-09-27  Peter Krempa  <pkrempa@redhat.com>

	daemon: Don't remove pidfiles in init scripts
	Init scripts removed pid file of the daemon. Removing pid files may be
	harmful as new api for crash-safe pidfiles is used (introduced by
	c8a3a26).

2011-09-27  Michal Privoznik  <mprivozn@redhat.com>

	debug: Annotate some variables as unused
	as they are not used with debugging turned off.

2011-09-27  Osier Yang  <jyang@redhat.com>

	storage: Do not break the whole vol lookup process in the middle
	* src/storage/storage_driver.c: As virStorageVolLookupByPath lookups
	all the pool objs of the drivers, breaking when failing on getting
	the stable path of the pool will just breaks the whole lookup process,
	it can cause the API fails even if the vol exists indeed. It won't get
	any benefit. This patch is to fix it.

2011-09-24  Peter Krempa  <pkrempa@redhat.com>

	maint: update authors

2011-09-23  Oskari Saarenmaa  <os@ohmu.fi>

	Add unsafe cache mode support for disk driver
	QEMU 0.13 introduced cache=unsafe for -drive, this patch exposes
	it in the libvirt layer.

	  * Introduced a new QEMU capability flag ($prefix_CACHE_UNSAFE),
	    as even if $prefix_CACHE_V2 is set, we can't know if unsafe
	    is supported.

	  * Improved the reliability of qemu cache type detection.

2011-09-23  Daniel P. Berrange  <berrange@redhat.com>

	Fix synchronous reading of stream data
	commit 984840a2c292402926ad100aeea33f8859ff31a9 removed the
	notification of waiting calls when VIR_NET_CONTINUE messages
	arrive. This was to fix the case of a virStreamAbort() call
	being prematurely notified of completion.

	The problem is that sometimes there are dummy calls from a
	virStreamRecv() call waiting that *do* need to be notified.

	These dummy calls should have a status VIR_NET_CONTINUE. So
	re-add the notification upon VIR_NET_CONTINUE, but only if
	the waiter also has a status of VIR_NET_CONTINUE.

	* src/rpc/virnetclient.c: Notify waiting call if stream data
	  arrives
	* src/rpc/virnetclientstream.c:  Mark dummy stream read packet
	  with status VIR_NET_CONTINUE

2011-09-23  Michal Privoznik  <mprivozn@redhat.com>

	selinux: Correctly report warning if virt_use_nfs not set
	Previous patch c9b37fee tried to deal with virt_use_nfs. But
	setfilecon() returns EOPNOTSUPP on NFS so we need to move the
	warning to else branch.

2011-09-23  Peter Krempa  <pkrempa@redhat.com>

	virsh: Improve virsh manual for virsh memtune command
	Commit 0a22f54 added --min-guarantee option for the memtune command.
	This option is supported only by the ESX hypervisor. This patch adds a
	statement about this fact, to prevent user confusion.

	This patch also adds explanation how to clear/set to unlimited the
	memory tunables. (documments the -1 value).

2011-09-22  Osier Yang  <jyang@redhat.com>

	virsh: Do not ignore the specified flags for cmdSaveImageDefine
	Introduced by commit 42c52d53c, which added the support for new
	flags, but forgot to update the API use to pass the flags.

2011-09-22  Michal Privoznik  <mprivozn@redhat.com>

	qemu: Transfer inactive XML among cookie
	If a domain has inactive XML we want to transfer it to destination
	when migrating with VIR_MIGRATE_PERSIST_DEST. In order to harm
	the migration protocol as least as possible, a optional cookie was
	chosen.

2011-09-22  Daniel Veillard  <veillard@redhat.com>

	Release of libvirt-0.9.6

2011-09-22  Eric Blake  <eblake@redhat.com>

	snapshot: also delete empty directory
	The previous patch removed all snapshots, but not the directory
	where the snapshots lived, which is still a form of stale data.

	* src/qemu/qemu_domain.c (qemuDomainRemoveInactive): Wipe any
	snapshot directory.

2011-09-22  Eric Blake  <eblake@redhat.com>

	snapshot: remove snapshot metadata on transient exit
	Commit 282fe1f0 documented that transient domains will auto-delete
	any snapshot metadata when the last reference to the domain is
	removed, and that management apps are in charge of grabbing any
	snapshot metadata prior to that point.  However, this was not
	actually implemented for qemu until now.

	* src/qemu/qemu_driver.c (qemudDomainCreate)
	(qemuDomainDestroyFlags, qemuDomainSaveInternal)
	(qemudDomainCoreDump, qemuDomainRestoreFlags, qemudDomainDefine)
	(qemuDomainUndefineFlags, qemuDomainMigrateConfirm3)
	(qemuDomainRevertToSnapshot): Clean up snapshot metadata.
	* src/qemu/qemu_migration.c (qemuMigrationPrepareAny)
	(qemuMigrationPerformJob, qemuMigrationPerformPhase)
	(qemuMigrationFinish): Likewise.
	* src/qemu/qemu_process.c (qemuProcessHandleMonitorEOF)
	(qemuProcessReconnect, qemuProcessReconnectHelper)
	(qemuProcessAutoDestroyDom): Likewise.

2011-09-22  Eric Blake  <eblake@redhat.com>

	snapshot: prepare to remove transient snapshot metadata
	This patch is mostly code motion - moving some functions out
	of qemu_driver and into qemu_domain so they can be reused by
	multiple qemu_* files (since qemu_driver.h must not grow).
	It also adds a new helper function, qemuDomainRemoveInactive,
	which will be used in the next patch.

	* src/qemu/qemu_domain.h (qemuFindQemuImgBinary)
	(qemuDomainSnapshotWriteMetadata, qemuDomainSnapshotForEachQcow2)
	(qemuDomainSnapshotDiscard, qemuDomainSnapshotDiscardAll)
	(qemuDomainRemoveInactive): New prototypes.
	(struct qemu_snap_remove): New struct.
	* src/qemu/qemu_domain.c (qemuDomainRemoveInactive)
	(qemuDomainSnapshotDiscardAllMetadata): New functions.
	(qemuFindQemuImgBinary, qemuDomainSnapshotWriteMetadata)
	(qemuDomainSnapshotForEachQcow2, qemuDomainSnapshotDiscard)
	(qemuDomainSnapshotDiscardAll): Move here...
	* src/qemu/qemu_driver.c (qemuFindQemuImgBinary)
	(qemuDomainSnapshotWriteMetadata, qemuDomainSnapshotForEachQcow2)
	(qemuDomainSnapshotDiscard, qemuDomainSnapshotDiscardAll): ...from
	here.
	(qemuDomainUndefineFlags): Update caller.
	* src/conf/domain_conf.c (virDomainRemoveInactive): Doc fixes.

2011-09-22  Eric Blake  <eblake@redhat.com>

	snapshot: fix logic bug in qemu undefine
	Commit 19f8c98 introduced VIR_DOMAIN_UNDEFINE_SNAPSHOTS_METADATA,
	with the intent that omitting the flag makes undefine fail, and
	including the flag deletes metadata.  But it used the wrong logic.
	Also, hoist the transient domain sooner, so that we don't
	accidentally remove metadata of a transient domain.

	* src/qemu/qemu_driver.c (qemuDomainUndefineFlags): Check correct
	flag value.

2011-09-22  Eric Blake  <eblake@redhat.com>

	sanlock: fix memory leak
	Detected by Coverity.  The only way to get to error_unlink is if
	path was successfully assigned, so the if was useless.  Meanwhile,
	there was a return statement that did not free path.

	* src/locking/lock_driver_sanlock.c
	(virLockManagerSanlockSetupLockspace): Fix mem-leak, and drop
	useless if.

2011-09-22  Eric Blake  <eblake@redhat.com>

	virsh: fix regression in argv parsing
	Prior to commit 85d2810, we had an issue where:

	snapshot-create-as dom name --diskspec spec --diskspec spec

	failed to parse the second spec, because the first spec had marked
	that option as no longer requiring an argument.

	In commit 85d2810, I fixed it by making argv options no longer mark
	the option as seen.  But this in turn breaks mandatory argv options,
	which now complain that the argv option is missing.

	This patch reverts that part of 85d2810, and instead replaces it with
	fixes to no longer clear opts_need_arg of an argv argument.

	* tools/virsh.c (vshCmddefGetOption, vshCmddefGetData)
	(vshCommandParse): Fix option parsing for required argv option.
	(vshCmddefOptParse): Check that argv option is last.
	* tests/virsh-optparse: Enhance test.

2011-09-22  Osier Yang  <jyang@redhat.com>

	virsh: More friendly err if no pool is specified for looking up a vol
	There are 3 ways to lookup a volume, only virStorageVolLookupByName
	needs pool object. So if no --pool is specified, it will tries to
	get the volume via virStorageVolLookupByPath/virStorageVolLookupByKey.

	But if all 3 ways fails, and no --pool is specified, a friendly
	error might help the user get right way quickly.

2011-09-22  Osier Yang  <jyang@redhat.com>

	storage: Wait udev events are handled before removing lvm vol
	Related #BZ: https://bugzilla.redhat.com/show_bug.cgi?id=702260.

	There are two problems described in the BZ:
	1) "Can't remove open logical volume".
	2) "Unable to deactivate logical volume "foo""

	This patch just intends to fix 2), as 1) is expected if the vol
	is still used by something, and you never known if "lvchange -an"
	will fail or not either (sometime, it will succeed, sometimes not).
	We'd better not look for trouble, :-)

	For 2), that's caused by race between lvremove and udev event handling,
	the only workable way now is to wait the events handling are finished,
	though it might introduce latencies, as "udevadmin settle" exits
	after *all* events are handled, it's the only way we can fix
	the racing in libvirt layer.

	See https://bugzilla.redhat.com/show_bug.cgi?id=570359 for more
	details.

2011-09-22  Alex Jia  <ajia@redhat.com>

	qemu: avoid dereferencing a NULL pointer
	* src/qemu/qemu_process.c: Taking if (qemuDomainObjEndJob(driver, obj) == 0)
	  true branch then 'obj' is NULL, virDomainObjIsActive(obj) and
	  virDomainObjUnref(obj) will dereference NULL pointer.

2011-09-22  Oskari Saarenmaa  <os@ohmu.fi>

	tests: improve test failure diagnosis
	  * qemuhelptest prints test case name on failure.

2011-09-21  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Avoid loop of fake reboots
	Once virDomainReboot is called for a domain, guest OS initiated shutdown
	would always result in reboot instead of shutdown. Only
	virDomainShutdown would actually shutd such domain down. That's because
	we forgot to reset fakeReboot flag once we asked the domain to reboot.

2011-09-21  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Fix shutdown regression with buggy qemu
	The commit that prevents disk corruption on domain shutdown
	(96fc4784177ecb70357518fa863442455e45ad0e) causes regression with QEMU
	0.14.* and 0.15.* because of a regression bug in QEMU that was fixed
	only recently in QEMU git. The affected versions of QEMU do not quit on
	SIGTERM if started with -no-shutdown, which we use to implement fake
	reboot. Since -no-shutdown tells QEMU not to quit automatically on guest
	shutdown, domains started using the affected QEMU cannot be shutdown
	properly and stay in a paused state.

	This patch disables fake reboot feature on such QEMU by not using
	-no-shutdown, which makes shutdown work as expected. However,
	virDomainReboot will not work in this case and it will report "Requested
	operation is not valid: Reboot is not supported with this QEMU binary".

2011-09-21  Osier Yang  <jyang@redhat.com>

	API: prefer to use NULLSTR macro

2011-09-21  Eric Blake  <eblake@redhat.com>

	remote: fix crash on OOM
	Bug introduced in commit 675464b.  On an OOM, this would try to
	dereference a char* and free the contents as a pointer, which is
	doomed to failure.

	Adding a syntax check will prevent mistakes like this in the future.

	* cfg.mk (sc_prohibit_internal_functions): New syntax check.
	(exclude_file_name_regexp--sc_prohibit_internal_functions): Add
	exemptions.
	* daemon/remote.c (remoteRelayDomainEventIOError)
	(remoteRelayDomainEventIOErrorReason)
	(remoteRelayDomainEventGraphics, remoteRelayDomainEventBlockJob):
	Use correct free function.

2011-09-21  Eric Blake  <eblake@redhat.com>

	xen: use typical allocations
	The next patch will add a syntax check that flags this usage in xen
	as awkward - while it was valid memory management, it was very hard
	to maintain.  Swapping to a more traditional allocation may be a bit
	slower, but easier to understand.

	* src/xen/xend_internal.c (xenDaemonListDomainsOld): Use two-level
	allocation, rather than abusing allocation function.
	(xenDaemonLookupByUUID): Update caller.

2011-09-21  Osier Yang  <jyang@redhat.com>

	virsh: Remove useless codes of cmdVolPath
	Variable "name" is never used in the codes, it's useless.

2011-09-21  Eric Blake  <eblake@redhat.com>

	build: silence warning on 32-bit build
	gcc warns when building libvirt 0.9.5 on a 32-bit machine:

	qemu/qemu_migration.c: In function 'qemuMigrationToFile':
	qemu/qemu_migration.c:2727:38: error: large integer implicitly truncated to unsigned type [-Woverflow]

	* src/qemu/qemu_domain.h (QEMU_DOMAIN_FILE_MIG_BANDWIDTH_MAX): Cap
	to long when building for 32-bit platform.

2011-09-20  Daniel Veillard  <veillard@redhat.com>

	Release of libvirt-0.9.5
	* configure.ac docs/news.html.in libvirt.spec.in: update for the release
	* po/*.po*: fetch updated translations from transifex and rebuilt

2011-09-20  Daniel Veillard  <veillard@redhat.com>

	Fix crash on events due to allocation errors
	remoteRelayDomainEventBlockJob, remoteRelayDomainEventIOError,
	remoteRelayDomainEventIOErrorReason and remoteRelayDomainEventGraphics
	were using const string directly in rpc structure, before calling
	remoteDispatchDomainEventSend(). But that routine now frees up all
	the pointed allocated memory from the rpc structure and we end up
	with a double free.
	This now strdup() all the strings passed and provide mem_error goto
	labels to be used when an allocation error occurs.
	Note that the cleanup isn't completely finished because all relaying
	function also call make_nonnull_domain() which also allocate a string
	and never handle the error case. This patches doesn't try to address
	this as this is only error correctness a priori and touches far more
	functions in this module:

	* daemon/remote.c: fix string allocations and memory error handling
	  for remoteRelayDomainEventBlockJob, remoteRelayDomainEventIOError,
	  remoteRelayDomainEventIOErrorReason and remoteRelayDomainEventGraphics

2011-09-20  Daniel P. Berrange  <berrange@redhat.com>

	Update to require sanlock 1.8 for license compliance
	Inexplicably the sanlock code all got placed under the GPLv2-only,
	so libvirt's use of sanlock introduces a license incompatibility.
	The sanlock developers have now rearranged the code such that there
	is a 'sanlock_client.so' which is LGPLv2+ while their daemon remains
	GPLv2-only. To use the new client library we need to call the new
	sanlock_init and sanlock_align APIs instead of sanlock_direct_init
	and sanlock_direct_align. These APIs calls are now routed via the
	sanlock daemon, instead of doing direct I/O calls to disk.

	For all this we require sanlock >= 1.8

	* configure.ac: Check for sanlock_client.so instead of sanlock.so
	  and fix various comments
	* libvirt.spec.in: Mandate sanlock >= 1.8
	* src/Makefile.am: Link to -lsanlock_client
	* src/locking/lock_driver_sanlock.c: Use sanlock_init and
	  sanlock_align

2011-09-20  Osier Yang  <jyang@redhat.com>

	conf: Assign newDef of active domain as persistent conf if it is NULL
	Libvirt loads the domain conf from status XML if it's running when
	starting up. The problem is there is no record of the original conf.
	(dom->newDef is NULL here).

	So libvirt won't be able to restore the domain conf to original one
	when destroying/shutdown. E.g.

	1) attach a device without "--persistent"
	2) restart libvirtd
	3) destroy domain
	4) start domain

	One will see the the disk still exists.

	This patch is to fix the peoblem by assigning persistent domain conf
	to dom->newDef if it's NULL and the domain is running.

2011-09-20  Osier Yang  <jyang@redhat.com>

	storage: Ensure the device path exists before refreshing disk pool
	Doing libvirt_parthelper on an not existed device path will get
	an unfriendly error message. This patch is to prohibit it.

	daemon: Error and exit if specified value for timeout is not valid
	Silently setting "timeout" as -1 if the specified value is invalid
	is a bit confused.

2011-09-20  Peter Krempa  <pkrempa@redhat.com>

	Remove devname identifier from autogenerated RPC code
	Patch 79cf07a missed one instance of "devname" in source for RPC code
	generator.

2011-09-20  Eric Blake  <eblake@redhat.com>

	virsh: tweak previous domblkstat patch
	Translators are likely to botch trailing spacing; by doing the
	formatting outside of the translation, we can generally get
	better alignment.  Also, for consistency, use 'bytes read' to
	match 'bytes written'.

	* tools/virsh.c (domblkstat_output): Drop trailing space. Tweak
	rd_bytes output.
	(cmdDomblkstat, DOMBLKSTAT_LEGACY_PRINT): Update formatting.

2011-09-20  Peter Krempa  <pkrempa@redhat.com>

	virsh: doc: Fix supported driver types for attach-disk command
	Virsh man page lists driver types to be used with attach-device
	command, but does not specify that those are usable only with the XEN
	Hypervisor.

	This patch adds statement, that those options specified are applicable
	only on the Xen hypervisor and adds option usable with qemu emulator.

	This patch also changes type of error returned by QEMU driver if the
	user specifies incompatible driver type from VIR_ERR_INTERNAL_ERROR to
	VIR_ERR_CONFIG_UNSUPPORTED.

2011-09-20  Eric Blake  <eblake@redhat.com>

	maint: Prefer names over email in 'git shortlog'
	Alex recently committed some patches with just an email instead
	of a preferred name; this fixes things so 'git shortlog' gives
	nicer output.

	* .mailmap: Update.

2011-09-20  Peter Krempa  <pkrempa@redhat.com>

	virsh: Add more human-friendly output of domblkstat command
	Users of virsh complain that output of the domblkstat command
	is not intuitive enough. This patch adds explanation of fields
	returned by this command to the help section for domblkstat and
	the man page of virsh. Also a switch --human is added for
	domblkstat that prints the fields with more descriptive
	texts.

	This patch also changes sequence of the output fields and their
	names back to the order and spelling established by previous
	versions of virsh to maintain compatibility with scripts.

	Example of ordered and "translated" output:

	PRE-patch:

	virsh # domblkstat 1 vda
	vda wr_bytes 5170176
	vda wr_operations 511
	vda rd_bytes 82815488
	vda rd_operations 3726

	POST-patch:

	virsh # domblkstat 1 vda
	vda rd_req 3726
	vda rd_bytes 82815488
	vda wr_req 478
	vda wr_bytes 4965376

	Example of human readable output:

	virsh # domblkstat 1 vda --human
	Device: vda
	 number of read operations:      3726
	 number of read bytes:           82815488
	 number of write operations:     478
	 number of bytes written:        4965376

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

2011-09-20  ajia@redhat.com  <ajia@redhat.com>

	vmx: avoid memory leak
	* src/vmx/vmx.c: fix memory leak, 'def' has a initial value 'NULL', so
	  'goto cleanup' is perfected instead of adding a virConfFree before
	  'return NULL'.

2011-09-20  ajia@redhat.com  <ajia@redhat.com>

	util: avoid memory leak
	Leak in pciGetVirtualFunctionIndex present since commit 17d64ca.

	* src/util/pci.c: fix memory leak.

2011-09-20  ajia@redhat.com  <ajia@redhat.com>

	remote: avoid memory leak
	Leak present since introduction of remoteDomainBuildEventGraphics
	in commit 987e31e.

	* src/remote/remote_driver.c: fix memory leak.

2011-09-20  ajia@redhat.com  <ajia@redhat.com>

	qemu: avoid memory leak
	Leak introduced in commit 036ad50, affects only error case.

	* src/qemu/qemu_command.c: fix memory leak.

2011-09-20  ajia@redhat.com  <ajia@redhat.com>

	daemon: avoid memory leak
	Introduced in commit efa7fc9f.

	* daemon/remote.c: fix memory leak in remoteDispatchDomainBlockStatsFlags

2011-09-17  Eric Blake  <eblake@redhat.com>

	spec: silence warnings when installing in F16
	https://bugzilla.redhat.com/show_bug.cgi?id=738725 documents that
	'yum install libvirt' in Fedora 16 is rather noisy.  This fixes
	the problems.

	* libvirt.spec.in (%post client): Silence chkconfig warning about
	SysV services.
	(%post) [with_cgconfig]: Drop for Fedora 15 and newer, where
	systemd does this automatically.

2011-09-17  Eric Blake  <eblake@redhat.com>

	snapshot: allow disk snapshots of qcow2 disks
	For all types of disks other than qcow2, we were requesting that
	SELinux labeling visit the new file as if it were qcow2, which
	means labeling would try to find the backing files of an empty file.
	And for a pre-existing qcow2 disk, we were passing NULL, which meant
	that labelling tried to probe the file type (and if probing is
	disabled, per the default qemu.conf, this made snapshots fail).
	What we really want is to make SELinux labeling visit the new
	file as raw; it will later be converted to qcow2 if qemu successfully
	made the snapshot.

	* src/qemu/qemu_driver.c
	(qemuDomainSnapshotCreateSingleDiskActive): Force SELinux labeling
	to avoid probe of new file.

2011-09-17  Eric Blake  <eblake@redhat.com>

	snapshot: affect persistent xml after disk snapshot
	For external snapshots to be useful on persistent domains, we must
	alter the persistent definition alongside the running definition.
	Thanks to the possibility of disk hotplug as well as of edits that
	only affect the persistent xml, we can't assume that vm->def and
	vm->newDef have the same disk at the same index, so we can only
	update the persistent copy if the device destination matches up.

	* src/qemu/qemu_driver.c (qemuDomainSnapshotCreateDiskActive)
	(qemuDomainSnapshotCreateSingleDiskActive): Also affect newDef, if
	present.

2011-09-17  Eric Blake  <eblake@redhat.com>

	build: work around lack of MacOS fdatasync
	Mingw lacks fsync, but gnulib provides that.  Meanwhile, gnulib does
	not (yet) provide fdatasync, so this is a quick hack to fake that
	function on MacOS X; we can revert this configure change once gnulib
	gives us a real module.

	We have been implicitly relying on gnulib's largefile module being
	pulled in by other modules, but it's better to make that explicit.

	* bootstrap.conf (gnulib_modules): Add fsync.  Make largefile use
	explicit.
	* configure.ac (AC_CHECK_FUNCS_ONCE): Check for fdatasync, and
	fake it with fsync when not present.

2011-09-17  Daniel P. Berrange  <berrange@redhat.com>

	Prevent crash from dlclose() of libvirt.so
	When libvirt calls virInitialize it creates a thread local
	for the virErrorPtr storage, and registers a callback to
	cleanup memory when a thread exits. When libvirt is dlclose()d
	or otherwise made non-resident, the callback function is
	removed from memory, but the thread local may still exist
	and if a thread later exists, it will invoke the callback
	and SEGV. There may also be other thread locals with callbacks
	pointing to libvirt code, so it is in general never safe to
	unload libvirt.so from memory once initialized.

	To allow dlclose() to succeed, but keep libvirt.so resident
	in memory, link with '-z nodelete'. This issue was first
	found with the libvirt CIM provider, but can potentially
	hit many of the dynamic language bindings which all ultimately
	involve dlopen() in some way, either on libvirt.so itself,
	or on the glue code for the binding which in turns links
	to libvirt

	* configure.ac, src/Makefile.am: Ensure libvirt.so is linked
	  with -z nodelete
	* cfg.mk, .gitignore, tests/Makefile.am, tests/shunloadhelper.c,
	  tests/shunloadtest.c: A test case to unload libvirt while
	  a thread is still running.

2011-09-17  Alex Jia  <ajia@redhat.com>

	qemu: add return value check
	* src/qemu/qemu_command.c: missing return value check.

2011-09-16  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Introduce shutdown reason for paused state
	Qemu sends STOP event as part of the shutdown process. Detect such STOP
	event and consider shutdown to be reason of emitting such event. That's
	the best we can do until qemu provides us the reason directly in STOP
	event. This allows us to report shutdown reason for paused state so that
	apps can detect domains that failed to finish the shutdown process
	(e.g., because qemu is buggy and doesn't exit on SIGTERM or it is
	blocked in flushing disk buffers).

2011-09-16  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Prevent disk corruption on domain shutdown
	Ever since we introduced fake reboot, we call qemuProcessKill as a
	reaction to SHUTDOWN event. Unfortunately, qemu doesn't guarantee it
	flushed all internal buffers before sending SHUTDOWN, in which case
	killing the process forcibly may result in (virtual) disk corruption.

	By sending just SIGTERM without SIGKILL we give qemu time to to flush
	all buffers and exit. Once qemu exits, we will see an EOF on monitor
	connection and tear down the domain. In case qemu ignores SIGTERM or
	just hangs there, the process stays running but that's not any different
	from a possible hang anytime during the shutdown process so I think it's
	just fine.

	Also qemu (since 0.14 until it's fixed) has a bug in SIGTERM processing
	which causes it not to exit but instead send new SHUTDOWN event and keep
	waiting. I think the best we can do is to ignore duplicate SHUTDOWN
	events to avoid a SHUTDOWN-SIGTERM loop and leave the domain in paused
	state.

2011-09-16  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Properly detect crash of a rebooted domain
	When a domain is rebooted using libvirt API, we use fake reboot
	consisting of shutting down and resetting the domain. Thus we see a
	SHUTDOWN event and set gotShutdown flag. But we never reset it back and
	if the domain crashes after it was rebooted this way, we consider it was
	a normal shutdown and not a crash.

	qemu: Fix shutoff reason when domain crashes
	Commit 4454a9efc728b91e791b1f14c26ea23a19d57f48 changed shutoff reason
	from VIR_DOMAIN_SHUTOFF_CRASHED to VIR_DOMAIN_SHUTOFF_FAILED in case we
	see an unexpected EOF on monitor connection. But FAILED reason is
	dedicated for domains that fail to start. CRASHED reason is the right
	one to use in this situation.

	python: Fix bindings generated in VPATH build

2011-09-16  Eric Blake  <eblake@redhat.com>

	Revert "virsh: Use old API if remote libvirtd does not support new"
	This reverts commit 799912fa05b8c3aa37bd04c57b196755f3f70552; now
	that the rpc regression is fixed, virsh no longer needs the special
	case here.

2011-09-16  Eric Blake  <eblake@redhat.com>

	rpc: convert unknown procedures to VIR_ERR_NO_SUPPORT
	Libvirt special-cases a specific VIR_ERR_RPC from the remote driver
	back into VIR_ERR_NO_SUPPORT on the client, so that clients can
	handle missing rpc functions the same whether the hypervisor driver
	is local or remote.  However, commit c1b22644 introduced a regression:
	VIR_FROM_THIS changed from VIR_FROM_REMOTE to VIR_FROM_RPC, so the
	special casing no longer works if the server uses the newer error
	domain.

	* src/rpc/virnetclientprogram.c
	(virNetClientProgramDispatchError): Also cater to 0.9.3 and newer.

2011-09-16  Stefan Berger  <stefanb@us.ibm.com>

	Fix buzzilla 738778
	This patch fixes the bug shown in bugzilla 738778. It's not an nwfilter problem but a connection sharing / closure issue.

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

	Depending on the speed / #CPUs of the machine you are using you may not see this bug all the time.

2011-09-16  Alex Jia  <ajia@redhat.com>

	conf: avoid memory leak on virDomainDefParseXML
	* conf/domain_conf.c: allocate memory to def->redirdevs in
	  virDomainDefParseXML such as VIR_ALLOC_N(def->redirdevs, n),
	  however, virDomainDefFree(def) hasn't released these memory.

	* Detected in valgrind run:

	==19820== 209 (16 direct, 193 indirect) bytes in 1 blocks are definitely lost in loss record 25 of 26
	==19820==    at 0x4A04A28: calloc (vg_replace_malloc.c:467)
	==19820==    by 0x4A13AF: virAllocN (memory.c:129)
	==19820==    by 0x4D4A0E: virDomainDefParseXML (domain_conf.c:7258)
	==19820==    by 0x4D4C93: virDomainDefParseNode (domain_conf.c:7512)
	==19820==    by 0x4D562F: virDomainDefParse (domain_conf.c:7465)
	==19820==    by 0x415863: testCompareXMLToXMLFiles (qemuxml2xmltest.c:35)
	==19820==    by 0x415982: testCompareXMLToXMLHelper (qemuxml2xmltest.c:80)
	==19820==    by 0x416D31: virtTestRun (testutils.c:140)
	==19820==    by 0x415604: mymain (qemuxml2xmltest.c:192)
	==19820==    by 0x416437: virtTestMain (testutils.c:689)
	==19820==    by 0x3CA7A1ECDC: (below main) (in /lib64/libc-2.12.so)
	==19820==
	==19820== LEAK SUMMARY:
	==19820==    definitely lost: 16 bytes in 1 blocks
	==19820==    indirectly lost: 193 bytes in 5 blocks
	==19820==      possibly lost: 0 bytes in 0 blocks
	==19820==    still reachable: 1,054 bytes in 21 blocks

	* How to reproduce?
	% valgrind -v --leak-check=full ./tests/qemuxml2xmltest

2011-09-16  Peter Krempa  <pkrempa@redhat.com>

	build: storage: Macro 'MKFS' is undefined on some platforms.
	Mac OS X 10.6. Snow Leopard and probably other do not provide a mkfs
	command to create filesystems. Macro MKFS then remained undefined and
	did not provide any substitute, so that build failed on a missing
	argument.

	build: storage: Conditionaly compiled structure caused build fail on OSX
	Struct virStoragePoolProbeResult was compiled in conditionaly, but
	virStorageBackendFileSystemProbe used it unconditionaly. This patch
	exempts the struct from conditional include.

	Avoid using "devname" as an identifier.
	/usr/lib/stdlib.h in Mac OS X and probably also in BSD's
	exports this symbol :(

2011-09-16  Peter Krempa  <pkrempa@redhat.com>

	doc: Add statment about permissions needed to do a core dump
	Documentation did not specify, that some permissions are required on
	target path for coredump for the user running the hypervisor.

	Diff to v1:
	- reword statements

2011-09-16  Eric Blake  <eblake@redhat.com>

	snapshot: tweak snapshot-create-as diskspec docs
	With this patch, it is hopefully a bit more obvious that for
	snapshot-create-as, a literal '--diskspec' is mandatory if name
	or description was omitted, but optional if all earlier options
	were provided.

	These all denote two diskspecs and a description:
	virsh snapshot-create-as dom name desc vda vdb
	virsh snapshot-create-as dom name desc --diskspec vda --diskspec vdb
	virsh snapshot-create-as dom name desc --diskspec vda vdb
	virsh snapshot-create-as dom name desc vda --diskspec vdb
	virsh snapshot-create-as dom --diskspec vda --diskspec vdb name desc

	This gives two diskspecs but no description:
	virsh snapshot-create-as dom name --diskspec vda --diskspec vdb

	And this treats 'vda' as the description, with only one diskspec:
	virsh snapshot-create-as dom name vda vdb

	The help output now shows:
	    snapshot-create-as <domain> [<name>] [<description>] [--print-xml] [--no-metadata] [--halt] [--disk-only] [[--diskspec] <string>]...

	I also checked the help output for echo and send-key, which are two
	other variants of argv commands.

	* tools/virsh.pod (snapshot-create-as): Document when a literal
	--diskspec must preceed a diskspec argument.
	* tools/virsh.c (vshCmddefHelp): Update help output for argv when
	naming the option is useful.
	(vshCmddefGetData): Fix logic on when argv was seen.
	* tests/virsh-optparse: Add tests to avoid regressions.

2011-09-16  Cole Robinson  <crobinso@redhat.com>

	python: Fix libvirt.py generation to include virterror info
	Recent generator refactoring broke libvirt.py. With this patch, libvirt.py
	is generated exactly the same as before offending commit 9eba0d25.

2011-09-16  Eric Blake  <eblake@redhat.com>

	qemu_api: doc improvements
	The new doc text had a few readability issues.  Also, the
	monitor command text copied a bit too much from the attach case.

	* src/libvirt-qemu.c (virDomainQemuMonitorCommand)
	(virDomainQemuAttach): Fix typos and grammar.

2011-09-16  Peter Krempa  <pkrempa@redhat.com>

	doc: virsh: Fix command name in man page
	Fix cut&paste error having command named domif-setlink instead of
	domif-getlink.

2011-09-15  Alex Jia  <ajia@redhat.com>

	sanlock: add missing test command in virt-sanlock-cleanup.in
	* tools/virt-sanlock-cleanup.in: fix missing test command when judging
	  second condition.

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

2011-09-15  Michal Privoznik  <mprivozn@redhat.com>

	spec: Require augeas for sanlock
	Even though we BuildRequire augeas in some cases, we need to require
	it even after if we build with sanlock. virt-sanlock-cleanup use it.

2011-09-15  Jim Fehlig  <jfehlig@suse.com>

	Fix build after commit 829bce17
	Pushing under build-breaker rule.

2011-09-15  Jim Fehlig  <jfehlig@novell.com>

	Use max bandwidth from qemuDomainObjPrivate struct when migrating
	Adjust qemuMigrationRun() to use migMaxBandwidth in qemuDomainObjPrivate
	structure when setting qemu migration speed.  Caller-specified 'resource'
	parameter overrides migMaxBandwidth.

2011-09-15  Jim Fehlig  <jfehlig@novell.com>

	Set qemu migration speed unlimited when migrating to file
	The qemu migration speed default is 32MiB/s as defined in migration.c

	/* Migration speed throttling */
	static int64_t max_throttle = (32 << 20);

	There's no need to throttle migration when targeting a file, so set migration
	speed to unlimited prior to migration, and restore to libvirt default value
	after migration.

	Default units is MB for migrate_set_speed monitor command, so
	(INT64_MAX / (1024 * 1024)) is used for unlimited migration speed.

	Tested with both json and text monitors.

2011-09-15  Jim Fehlig  <jfehlig@novell.com>

	Save migration speed in qemuDomainMigrateSetMaxSpeed
	Now that migration speed is stored in qemuDomainObjPrivate structure,
	save the new value when invoking qemuDomainMigrateSetMaxSpeed().

	Allow setting migration speed on inactive domain too.

2011-09-15  Jim Fehlig  <jfehlig@novell.com>

	Impl virDomainMigrateGetMaxSpeed in qemu driver

	Store max migration bandwidth in qemuDomainObjPrivate struct
	The maximum bandwidth that can be consumed when migrating a domain
	is better classified as an operational vs configuration parameter of
	the dommain.  As such, store this parameter in qemuDomainObjPrivate
	structure.

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

	conf: add missing break in virDomainAuditRedirdev
	Also initialize to NULL a few variables that might get
	free before being set.

2011-09-15  Eric Blake  <eblake@redhat.com>

	network: add missing exports
	Commit c246b025 added new functions, but forgot to export them,
	resulting in a build failure when using modules.

	* src/libvirt_private.syms (network.h): Export new functions.

2011-09-14  Eric Blake  <eblake@redhat.com>

	snapshot: ABI stability must include memory sizing
	Commit 973fcd8f introduced the ability for qemu to reject snapshot
	reversion on an ABI incompatibility; but the very example that was
	first proposed on-list[1] as a demonstration of an ABI incompatibility,
	namely that of changing the max memory allocation, was not being
	checked for, resulting in a cryptic failure when running with larger
	max mem than what the snapshot was created with:
	error: operation failed: Error -22 while loading VM state

	This commit merely protects the three variables within mem that are
	referenced by qemu_command.c, rather than all 7 (the other 4 variables
	affect cgroup handling, but as far as I can tell, have no visible effect
	to the qemu guest).  This also affects migration and save file handling,
	which are other places where we perform ABI compatibility checks.

	[1] https://www.redhat.com/archives/libvir-list/2010-December/msg00331.html

	* src/conf/domain_conf.c (virDomainDefCheckABIStability): Add
	memory sizing checks.

2011-09-14  Eric Blake  <eblake@redhat.com>

	maint: ignore generated files
	* .gitignore: Exempt recently added generated files.

2011-09-14  Peter Krempa  <pkrempa@redhat.com>

	xml: Clean up rest of virtual XML document names for XML strings
	Commit 498d783 cleans up some of virtual file names for parsing strings
	in memory. This patch cleans up (hopefuly) the rest forgotten by the
	first patch.

	This patch also changes all of the previously modified "filenames" to
	valid URI's replacing spaces for underscores.

	Changes to v1:
	- Replace all spaces for underscores, so that the strings form valid
	  URI's
	- Replace spaces in places changed by commit 498d783

2011-09-14  Daniel Veillard  <veillard@redhat.com>

	Remove two references to files not generated
	This was breaking "make dist"

2011-09-14  Peter Krempa  <pkrempa@redhat.com>

	make: Fix 'make syntax-check' failing.
	Commit 2a0d75e5 added file python/libvirt-qemu-override.c that contains
	code that does not pass "make syntax-check". This patch adds an
	exception for this file and the check.

	prohibit_always_true_header_tests
	python/libvirt-qemu-override.c:17:#undef HAVE_PTHREAD_H
	maint.mk: do not test the above HAVE_<header>_H symbol(s);
	  with the corresponding gnulib module, they are always true
	make: *** [sc_prohibit_always_true_header_tests] Error 1

2011-09-14  Osier Yang  <jyang@redhat.com>

	qemu_api: Update libvirt spec file

	qemu_api: Update Makefile to generate libvirtmod_qemu lib

	qemu_api: Update Py binding generator to generate files for QEMU APIs
	It will generate:
	  libvirt-qemu.py
	  libvirt-qemu.h
	  libvirt-qemu.c
	  libvirt-qemu-export.c

	qemu_api: Add override XML and C files for QEMU APIs
	There is only one function (virDomainQemuMonitorCommand) need to
	be hand-craft.

	qemu_api: Add comments for API virDomainQemuMonitorCommand
	And fix argument @pid's type of virDomainQemuAttach.

	qemu_api: Update Makefile for subdir docs

	qemu_api: Modify apibuild.py to generate docs for QEMU APIs
	The generated docs are: libvirt-qemu-api.xml, libvirt-qemu-refs.xml

2011-09-14  Peter Krempa  <pkrempa@redhat.com>

	virsh: Use old API if remote libvirtd does not support new
	Commit ffe28ab74b821c916ec4ba8efb5c992454e4bd24 introduced regression
	while communicating with older libvirtd command 'domblkstat' used the new
	API and did not check for VIR_ERR_RPC error code signalling the remote
	server does not support this API and did not fall back to older API.
	Thereafter 'domblkstat' ended with "error: unknown procedure: 243".

2011-09-13  Guannan Ren  <gren@redhat.com>

	snapshot: fix double free of qemuImgBinary
	Regression introduced in commit 3881a470, due to an improper rebase
	of a cleanup written beforehand but only applied after a rebased of
	a refactoring that created a new function in commit 25fb3ef.

	Also avoids passing NULL to printf %s.

	* src/qemu/qemu_driver.c: In qemuDomainSnapshotForEachQcow2()
	it free up the memory of qemu_driver->qemuImgBinary in the
	cleanup tag which leads to the garbage value of qemuImgBinary
	in qemu_driver struct and libvirtd crash when running
	"virsh snapshot-create" command a second time.

2011-09-13  Daniel Veillard  <veillard@redhat.com>

	Do not log invalid operations in libvirtd logs
	  This is a bit painful for example when starting virt-manager
	it tends to clutter libvirtd.log with invalid operation on cpu pinning
	for defined but not running domains. A priori those kind of errors
	don't indicate an error when executing the command but on a precondition
	for running the API, and honnestly while the application should report
	it, logging it as an error in libvirtd.log is not really useful,

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

	* daemon/libvirtd.c: extend daemonErrorLogFilter() to filter out
	   errors of type VIR_ERR_OPERATION_INVALID

2011-09-09  Michal Privoznik  <mprivozn@redhat.com>

	virnetsocket: Pass KRB5CCNAME env variable
	So we can allow GSSAPI authentication for ssh.

	selinux: Detect virt_use_nfs boolean set
	If we fail setting label on a file and this file is on NFS share,
	it is wise to advise user to set virt_use_nfs selinux boolean
	variable.

2011-09-09  Philipp Hahn  <hahn@univention.de>

	Fix URL-escaping for domainDefine
	'+' in strings get translated to ' ' when editing domains.
	While xenDaemonDomainCreateXML() did URL-escape the sexpr,
	xenDaemonDomainDefineXML() did not.

	Remove the explicit urlencode() in xenDaemonDomainCreateXML() and add
	the direct encoding calls to xend_op_ext() because it calls xend_post()
	which uses "Content-Type: application/x-www-form-urlencoded". According
	to <http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4.1> this
	requires all parameters to be url-encoded as specified in rfc1738.

	Notice: virBufferAsprintf(..., "%s=%s", ...) is again replaced by three
	calls to virBufferURIEncodeString() and virBufferAddChar() because '='
	is a "reserved" character, which would get escaped by
	virBufferURIEncodeString(), which - by the way - escapes anything not
	c_isalnum().

2011-09-09  Peter Krempa  <pkrempa@redhat.com>

	xml: Change virtual file names of xml documents parsed in memory
	While parsing XML strings from memory, the previous convention in
	libvirt was to set the virtual file name to "domain.xml" or something
	similar. This could potentialy trick the user into looking for a file
	named domain.xml on the disk in an attempt to fix the error.

	This patch changes these filenames to something that can't be as easily
	confused for a valid filename.

	Examples of error messages:
	---------------------------
	Error while loading file from disk:

	15:07:59.015: 527: error : catchXMLError:709 : /path/to/domain.xml:1: StartTag: invalid element name
	<domain type='kvm'><
	--------------------^

	Error while parsing definition in memory:

	15:08:43.581: 525: error : catchXMLError:709 : (domain definition):2: error parsing attribute name
	  <name>vm1</name>
	--^

2011-09-08  Eric Blake  <eblake@redhat.com>

	snapshot: fix regression with system checkpoints
	Regression introduced in commit d6f6b2d194c.  Running
	'virsh snapshot-create dom' would mistakenly report that
	disks can only be specified for disk snapshots.

	* src/conf/domain_conf.c (virDomainSnapshotDefParseString): Only
	give error about no disk support when <disk> was found.

2011-09-08  Eric Blake  <eblake@redhat.com>

	maint: update to latest gnulib
	* .gnulib: Update to latest.

2011-09-08  Eric Blake  <eblake@redhat.com>

	snapshot: use new API for less work
	This has the added benefit of making 'snapshot-create dom --no-metadata'
	now able to tell you the name of the just-generated snapshot.

	* tools/virsh.c (vshSnapshotCreate, cmdSnapshotCurrent): Don't get
	XML just for name.

2011-09-08  Eric Blake  <eblake@redhat.com>

	snapshot: new APIs for inspecting snapshot object
	These functions access internals of the opaque object, and do
	not need any rpc counterpart.  It could be argued that we should
	have provided these when snapshot objects were first introduced,
	since all the other vir*Ptr objects have at least a GetName accessor.

	* include/libvirt/libvirt.h.in (virDomainSnapshotGetName)
	(virDomainSnapshotGetDomain, virDomainSnapshotGetConnect): Declare.
	* src/libvirt.c (virDomainSnapshotGetName)
	(virDomainSnapshotGetDomain, virDomainSnapshotGetConnect): New
	functions.
	* src/libvirt_public.syms: Export them.

2011-09-08  Soren Hansen  <soren@linux2go.dk>

	Don't treat pci_system_init failure as fatal if no PCI bus is present
	Xen PV domU's have no PCI bus. node_device_udev.c calls pci_system_init
	which looks for /sys/bus/pci. If it does not find /sys/bus/pci (which it
	won't in a Xen PV domU) it returns unsuccesfully (ENOENT), which libvirt
	considers fatal. This makes libvirt unusable in this environment, even
	though there are plenty of valid virtualisation options that work
	there (LXC, UML, and QEmu spring to mind)

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

2011-09-08  Alex Jia  <ajia@redhat.com>

	doc: fix incorrect option in send-key
	* tools/virsh.pod: fix a option typo of send-key section.

	virsh: fix typo in opts_send_key
	* tools/virsh.c: millseconds should be milliseconds in opts_send_key.

2011-09-08  Alex Jia  <ajia@redhat.com>

	rpc: avoid memory leak on virNetTLSContextValidCertificate
	* src/rpc/virnettlscontext.c: fix memory leak on
	  virNetTLSContextValidCertificate.

	* Detected in valgrind run:

	==25667==
	==25667== 6,085 (44 direct, 6,041 indirect) bytes in 1 blocks are definitely
	lost in loss record 326 of 351
	==25667==    at 0x4005447: calloc (vg_replace_malloc.c:467)
	==25667==    by 0x4F2791F3: _asn1_add_node_only (structure.c:53)
	==25667==    by 0x4F27997A: _asn1_copy_structure3 (structure.c:421)
	==25667==    by 0x4F276A50: _asn1_append_sequence_set (element.c:144)
	==25667==    by 0x4F2743FF: asn1_der_decoding (decoding.c:1194)
	==25667==    by 0x4F22B9CC: gnutls_x509_crt_import (x509.c:229)
	==25667==    by 0x805274B: virNetTLSContextCheckCertificate
	(virnettlscontext.c:1009)
	==25667==    by 0x804DE32: testTLSSessionInit (virnettlscontexttest.c:693)
	==25667==    by 0x804F14D: virtTestRun (testutils.c:140)
	==25667==
	==25667== 23,188 (88 direct, 23,100 indirect) bytes in 11 blocks are definitely
	lost in loss record 346 of 351
	==25667==    at 0x4005447: calloc (vg_replace_malloc.c:467)
	==25667==    by 0x4F22B841: gnutls_x509_crt_init (x509.c:50)
	==25667==    by 0x805272B: virNetTLSContextCheckCertificate
	(virnettlscontext.c:1003)
	==25667==    by 0x804DDD1: testTLSSessionInit (virnettlscontexttest.c:673)
	==25667==    by 0x804F14D: virtTestRun (testutils.c:140)

	* How to reproduce?
	% cd libvirt && ./configure && make && make -C tests valgrind
	or
	% valgrind -v --leak-check=full ./tests/virnettlscontexttest

2011-09-08  Alex Jia  <ajia@redhat.com>

	tests: avoid memory leak on testTLSSessionInit
	* tests/virnettlscontexttest: fix memory leak on virnettlscontext test case.

	* Detected in valgrind run:

	==25667==
	==25667== 86,651 (34,680 direct, 51,971 indirect) bytes in 10 blocks are
	definitely lost in loss record 350 of 351
	==25667==    at 0x4005447: calloc (vg_replace_malloc.c:467)
	==25667==    by 0x4F1F515D: gnutls_init (gnutls_state.c:270)
	==25667==    by 0x8053432: virNetTLSSessionNew (virnettlscontext.c:1181)
	==25667==    by 0x804DD24: testTLSSessionInit (virnettlscontexttest.c:624)
	==25667==    by 0x804F14D: virtTestRun (testutils.c:140)
	==25667==
	==25667== 100,578 (38,148 direct, 62,430 indirect) bytes in 11 blocks are
	definitely lost in loss record 351 of 351
	==25667==    at 0x4005447: calloc (vg_replace_malloc.c:467)
	==25667==    by 0x4F1F515D: gnutls_init (gnutls_state.c:270)
	==25667==    by 0x8053432: virNetTLSSessionNew (virnettlscontext.c:1181)
	==25667==    by 0x804DD3C: testTLSSessionInit (virnettlscontexttest.c:625)
	==25667==    by 0x804F14D: virtTestRun (testutils.c:140)

	* How to reproduce?
	% cd libvirt && ./configure && make && make -C tests valgrind
	or
	% valgrind -v --leak-check=full ./tests/virnettlscontexttest

2011-09-08  Alex Jia  <ajia@redhat.com>

	libxl: avoid a dereference of a null pointer
	Variable 'l_disk' initialized to a null pointer value, control jumps to 'case
	VIR_DOMAIN_DISK_DEVICE_DISK and then taking false branch, Within the expansion
	of the macro 'libxlError': Field access results in a dereference of a null
	pointer (loaded from variable 'l_disk').

	* src/libxl/libxl_driver.c: Field access results in a dereference of a null
	  pointer (loaded from variable 'l_disk')

2011-09-08  Eric Blake  <eblake@redhat.com>

	blockinfo: fix qemu regression in handling disk name
	Regression introduced in commit 89b6284fd, due to an incorrect
	conversion to the new means of converting disk names back to
	the correct object.

	* src/qemu/qemu_driver.c (qemuDomainGetBlockInfo): Avoid NULL deref.

2011-09-08  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Fix managed object lookup with optional occurrence
	Exit early if managed object is not found, instead of dereferencing
	a NULL pointer and triggering a segfault.

2011-09-07  Michal Privoznik  <mprivozn@redhat.com>

	Threadpool: Initialize new dynamic workers
	Although we were initializing worker threads during pool creating,
	we missed this during virThreadPoolSendJob. This bug led to segmenation
	fault as worker thread free() given argument.

2011-09-07  Matthias Bolte  <matthias.bolte@googlemail.com>

	mingw: Don't use interface as an identifier
	Because it's a define used in MSCOM and its usage as
	identifier results in a compile error.

2011-09-06  Peter Krempa  <pkrempa@redhat.com>

	link-state: virsh: Add wrapper commands for changing link state
	Two new commands are added to virsh that wrap usage of
	virDomainUpdateDeviceFlags for changing link state of domain's network
	interfaces. These wrappers extract network devices's xml configuration
	and modify the link state for easy manipulation from an user's perspective.

	 - domif-setlink - set link state of a domains virtual network interface
	 - domif-getlink - get link state

	* tools/virsh.c   - Add functionality to virsh
	* tools/virsh.pod - Manpage documentation

2011-09-06  Peter Krempa  <pkrempa@redhat.com>

	link-state: qemu: Add net intf modification to virUpdateDeviceFlags
	This patch enables modifying network device configuration using the
	virUpdateDeviceFlags API method. Matching of devices is accomplished
	using MAC addresses.

	While updating live configuration of a running domain, the user is
	allowed only to change link state of the interface. Additional
	modifications may be added later. For now the code checks for
	unsupported changes and thereafter changes the link state, if
	applicable.

	When updating persistent configuration of guest's network interface the
	whole configuration (except for the MAC address) may be modified and
	is stored for the next startup.

	* src/qemu/qemu_driver.c   - Add dispatching of virUpdateDevice for
	                             network devices update (live/config)
	* src/qemu/qemu_hotplug.c  - add setting of initial link state on live
	                             device addition
	                           - add function to change network device
	                             configuration. By now it supports only
	                             changing of link state
	* src/qemu/qemu_hotplug.h  - Headers to above functions
	* src/qemu/qemu_process.c  - set link states before virtual machine
	                             start. Qemu does not support setting of
	                             this on the command line.

2011-09-06  Peter Krempa  <pkrempa@redhat.com>

	link-state: qemu: Add monitor handling for link state modification
	This patch adds handlers for modification of guest's interface
	link state. Both HMP and QMP commands are supported, but as the
	link state functionality is from the beginning supported in QMP
	the HMP code will probably never be used.

2011-09-06  Peter Krempa  <pkrempa@redhat.com>

	link-state: conf: Add element to XML for controling link state
	A new element is introduced to XML that allows to control
	state of virtual network interfaces in hypervisors.

	Live modification of the link state allows networking tools
	propagate topology changes to guest OS or testing of
	scenarios in complex (virtual) networks.

	This patch adds elements to XML grammars and parsing and generating
	code.

2011-09-06  Peter Krempa  <pkrempa@redhat.com>

	link-state: util: Add equality comparison functions for structures
	This patch adds functions to compare structures containing network
	device configuration for equality. They serve for the purpose of
	disallowing unsupported changes to live network devices.

2011-09-06  Peter Krempa  <pkrempa@redhat.com>

	XML: Improve XML parsing error messages
	This patch modifies error handling function for the XML parser provided
	by libxml2.

	Originaly only a line number and error message were logged. With this
	new error handler function, the user is provided with a more complex
	description of the parsing error.

	Context of the error is printed in libXML2 style and filename of the
	file, that caused the error is printed. Example of an parse error:

	13:41:36.262: 16032: error : catchXMLError:706 :
	/etc/libvirt/qemu/rh_bad.xml:58: Opening and ending tag mismatch: name
	line 2 and domain
	</domain>
	---------^

	Context of the error gives the user hints that may help to quickly
	locate a corrupt xml file.

	fixes BZs:
	----------
	Bug 708735 - [RFE] Show column and line on XML parsing error
	https://bugzilla.redhat.com/show_bug.cgi?id=708735

	Bug 726771 - libvirt does not specify problem file if persistent xml is
	invalid
	https://bugzilla.redhat.com/show_bug.cgi?id=726771

2011-09-06  Marc-André Lureau  <marcandre.lureau@redhat.com>

	redirdev: allows to specify device address
	It is important to be able to attach USB redirected devices to a
	particular controller (one that supports USB2 for instance).
	Without this patch, only the default bus was used.

	     <redirdev bus='usb' type='spicevmc'>
	       <address type='usb' bus='0' port='4'/>
	     </redirdev>

2011-09-06  Daniel Veillard  <veillard@redhat.com>

	latency: fix make check for remote protocol structs and numbers

2011-09-06  Osier Yang  <jyang@redhat.com>

	latency: Update virsh command domblkstat to use new API
	The modified function fallbacks to use virDomainBlockStats if
	virDomainBlockStatsFlags is not supported by the hypervisor driver.
	If the new API is supported, it will be invoked instead of the
	old API.

	latency: Expose the new API for Python binding

	latency: Implemente internal API for qemu driver

2011-09-06  Osier Yang  <jyang@redhat.com>

	latency: Update monitor functions for new latency fields
	The mainly changes are:

	1) Update qemuMonitorGetBlockStatsInfo and it's children (Text/JSON)
	   functions to return the value of new latency fields.
	2) Add new function qemuMonitorGetBlockStatsParamsNumber, which is
	   to count how many parameters the underlying QEMU supports.
	3) Update virDomainBlockStats in src/qemu/qemu_driver.c to be
	   compatible with the changes by 1).

2011-09-06  Osier Yang  <jyang@redhat.com>

	latency: Wire up the remote protocol

	latency: Implemente the public API

	latency: Define the internal driver callback

	latency: Define new public API and structure

2011-09-06  Michal Privoznik  <mprivozn@redhat.com>

	qemu: Deal with stucked qemu on daemon startup
	If libvirt daemon gets restarted and there is (at least) one
	unresponsive qemu, the startup procedure hangs up. This patch creates
	one thread per vm in which we try to reconnect to monitor. Therefore,
	blocking in one thread will not affect other APIs.

	qemu: Introduce job queue size limit
	This patch creates an optional BeginJob queue size limit. When
	active, all other attempts above level will fail. To set this
	feature assign desired value to max_queued variable in qemu.conf.
	Setting it to 0 turns it off.

2011-09-06  Michal Privoznik  <mprivozn@redhat.com>

	daemon: Create priority workers pool
	This patch annotates APIs with low or high priority.
	In low set MUST be all APIs which might eventually access monitor
	(and thus block indefinitely). Other APIs may be marked as high
	priority. However, some must be (e.g. domainDestroy).

	For high priority calls (HPC), there are some high priority workers
	(HPW) created in the pool. HPW can execute only HPC, although normal
	worker can process any call regardless priority. Therefore, only those
	APIs which are guaranteed to end in reasonable small amount of time
	can be marked as HPC.

	The size of this HPC pool is static, because HPC are expected to end
	quickly, therefore jobs assigned to this pool will be served quickly.
	It can be configured in libvirtd.conf via prio_workers variable.
	Default is set to 5.

	To mark API with low or high priority, append priority:{low|high} to
	it's comment in src/remote/remote_protocol.x. This is similar to
	autogen|skipgen. If not marked, the generator assumes low as default.

2011-09-05  Eric Blake  <eblake@redhat.com>

	snapshot: use SELinux and lock manager with external snapshots
	With this, it is now possible to create external snapshots even
	when SELinux is enforcing, and to protect the new file with a
	lock manager.

	* src/qemu/qemu_driver.c
	(qemuDomainSnapshotCreateSingleDiskActive): Create and register
	new file with proper permissions and locks.
	(qemuDomainSnapshotCreateDiskActive): Update caller.

2011-09-05  Eric Blake  <eblake@redhat.com>

	snapshot: wire up live qemu disk snapshots
	Lots of earlier patches led up to this point - the qemu snapshot_blkdev
	monitor command can now be controlled by libvirt!  Well, insofar as
	SELinux doesn't prevent qemu from open(O_CREAT) on the files.  There's
	still some followup work before things work with SELinux enforcing,
	but this patch is big enough to post now.

	There's still room for other improvements, too (for example, taking a
	disk snapshot of an inactive domain, by using qemu-img for both internal
	and external snapshots; wiring up delete and revert control, including
	additional flags from my RFC; supporting active QED disk snapshots;
	supporting per-storage-volume snapshots such as LVM or btrfs snapshots;
	etc.).  But this patch is the one that proves the new XML works!

	* src/qemu/qemu_driver.c (qemuDomainSnapshotCreateXML): Wire in
	active disk snapshots.
	(qemuDomainSnapshotDiskPrepare)
	(qemuDomainSnapshotCreateDiskActive)
	(qemuDomainSnapshotCreateSingleDiskActive): New functions.

2011-09-05  Eric Blake  <eblake@redhat.com>

	snapshot: wire up new qemu monitor command
	No one uses this yet, but it will be important once
	virDomainSnapshotCreateXML learns a VIR_DOMAIN_SNAPSHOT_DISK_ONLY
	flag, and the xml allows passing in the new file names.

	* src/qemu/qemu_monitor.h (qemuMonitorDiskSnapshot): New prototype.
	* src/qemu/qemu_monitor_text.h (qemuMonitorTextDiskSnapshot):
	Likewise.
	* src/qemu/qemu_monitor_json.h (qemuMonitorJSONDiskSnapshot):
	Likewise.
	* src/qemu/qemu_monitor.c (qemuMonitorDiskSnapshot): New
	function.
	* src/qemu/qemu_monitor_json.c (qemuMonitorJSONDiskSnapshot):
	Likewise.

2011-09-05  Eric Blake  <eblake@redhat.com>

	snapshot: make it possible to audit external snapshot
	Snapshots alter the set of disk image files opened by qemu, so
	they must be audited.  But they don't involve a full disk definition
	structure, just the new filename.  Make the next patch easier by
	refactoring the audit routines to just operate on file name.

	* src/conf/domain_audit.h (virDomainAuditDisk): Update prototype.
	* src/conf/domain_audit.c (virDomainAuditDisk): Act on strings,
	not definition structures.
	(virDomainAuditStart): Update caller.
	* src/qemu/qemu_hotplug.c (qemuDomainChangeEjectableMedia)
	(qemuDomainAttachPciDiskDevice, qemuDomainAttachSCSIDisk)
	(qemuDomainAttachUsbMassstorageDevice)
	(qemuDomainDetachPciDiskDevice, qemuDomainDetachDiskDevice):
	Likewise.

2011-09-05  Eric Blake  <eblake@redhat.com>

	snapshot: reject unimplemented disk snapshot features
	My RFC for snapshot support [1] proposes several rules for when it is
	safe to delete or revert to an external snapshot, predicated on
	the existence of new API flags.  These will be incrementally added
	in future patches, but until then, blindly mishandling a disk
	snapshot risks corrupting internal state, so it is better to
	outright reject the attempts until the other pieces are in place,
	thus incrementally relaxing the restrictions added in this patch.

	[1] https://www.redhat.com/archives/libvir-list/2011-August/msg00361.html

	* src/qemu/qemu_driver.c (qemuDomainSnapshotCountExternal): New
	function.
	(qemuDomainUndefineFlags, qemuDomainSnapshotDelete): Use it to add
	safety valve.
	(qemuDomainRevertToSnapshot, qemuDomainSnapshotCreateXML): Add safety
	valve.

2011-09-05  Eric Blake  <eblake@redhat.com>

	snapshot: wire up disk-only flag to snapshot-create
	Expose the disk-only flag through virsh.  Additionally, make
	virsh snapshot-create-as take an arbitrary number of diskspecs,
	which can be used to build up the xml for <domainsnapshot>.

	* tools/virsh.c (cmdSnapshotCreate): Add --disk-only.
	(cmdSnapshotCreateAs): Likewise, and add argv diskspec.
	(vshParseSnapshotDiskspec): New helper function.
	(vshCmddefGetOption): Allow naming of argv field.
	* tools/virsh.pod (snapshot-create, snapshot-create-as): Document
	them.
	* tests/virsh-optparse: Test snapshot-create-as parsing.

2011-09-05  Eric Blake  <eblake@redhat.com>

	snapshot: add flag for requesting disk snapshot
	Prior to this patch, <domainsnapshot>/<disks> was ignored.  This
	changes it to be an error unless an explicit disk snapshot is
	requested (a future patch may relax things if it turns out to
	be useful to have a <disks> specification alongside a system
	checkpoint).

	* include/libvirt/libvirt.h.in
	(VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY): New flag.
	* src/libvirt.c (virDomainSnapshotCreateXML): Document it.
	* src/esx/esx_driver.c (esxDomainSnapshotCreateXML): Disk
	snapshots not supported yet.
	* src/vbox/vbox_tmpl.c (vboxDomainSnapshotCreateXML): Likewise.
	* src/qemu/qemu_driver.c (qemuDomainSnapshotCreateXML): Likewise.

2011-09-05  Eric Blake  <eblake@redhat.com>

	snapshot: add virsh domblklist command
	This adds a convenience function to virsh that parses out block
	information from the domain xml, making it much easier to see
	what strings can be used in all other contexts that demand a
	specific block name, especially when given the previous patch
	that allows using either target or unique source name.

	As an example on a domain with one disk and an empty cdrom drive:

	Target     Source
	-------------------------------------------
	vda        /var/lib/libvirt/images/fedora_12.img
	hdc        -

	* tools/virsh.c (cmdDomblklist): New function.
	* tools/virsh.pod (domblklist): Document it.

2011-09-05  Eric Blake  <eblake@redhat.com>

	snapshot: also support disks by path
	I got confused when 'virsh domblkinfo dom disk' required the
	path to a disk (which can be ambiguous, since a single file
	can back multiple disks), rather than the unambiguous target
	device name that I was using in disk snapshots.  So, in true
	developer fashion, I went for the best of both worlds - all
	interfaces that operate on a disk (aka block) now accept
	either the target name or the unambiguous path to the backing
	file used by the disk.

	* src/conf/domain_conf.h (virDomainDiskIndexByName): Add
	parameter.
	(virDomainDiskPathByName): New prototype.
	* src/libvirt_private.syms (domain_conf.h): Export it.
	* src/conf/domain_conf.c (virDomainDiskIndexByName): Also allow
	searching by path, and decide whether ambiguity is okay.
	(virDomainDiskPathByName): New function.
	(virDomainDiskRemoveByName, virDomainSnapshotAlignDisks): Update
	callers.
	* src/qemu/qemu_driver.c (qemudDomainBlockPeek)
	(qemuDomainAttachDeviceConfig, qemuDomainUpdateDeviceConfig)
	(qemuDomainGetBlockInfo, qemuDiskPathToAlias): Likewise.
	* src/qemu/qemu_process.c (qemuProcessFindDomainDiskByPath):
	Likewise.
	* src/libxl/libxl_driver.c (libxlDomainAttachDeviceDiskLive)
	(libxlDomainDetachDeviceDiskLive, libxlDomainAttachDeviceConfig)
	(libxlDomainUpdateDeviceConfig): Likewise.
	* src/uml/uml_driver.c (umlDomainBlockPeek): Likewise.
	* src/xen/xend_internal.c (xenDaemonDomainBlockPeek): Likewise.
	* docs/formatsnapshot.html.in: Update documentation.
	* tools/virsh.pod (domblkstat, domblkinfo): Likewise.
	* docs/schemas/domaincommon.rng (diskTarget): Tighten pattern on
	disk targets.
	* docs/schemas/domainsnapshot.rng (disksnapshot): Update to match.
	* tests/domainsnapshotxml2xmlin/disk_snapshot.xml: Update test.

2011-09-05  Eric Blake  <eblake@redhat.com>

	snapshot: add <disks> to snapshot xml
	Adds an optional element to <domainsnapshot>, which will be used
	to give user control over external snapshot filenames on input,
	and specify generated filenames on output.

	For now, no driver accepts this element; that will come later.

	<domainsnapshot>
	  ...
	  <disks>
	    <disk name='vda' snapshot='no'/>
	    <disk name='vdb' snapshot='internal'/>
	    <disk name='vdc' snapshot='external'>
	      <driver type='qcow2'/>
	      <source file='/path/to/new'/>
	    </disk>
	  </disks>
	  <domain>
	    ...
	    <devices>
	      <disk ...>
	        <driver name='qemu' type='raw'/>
	        <target dev='vdc'/>
	        <source file='/path/to/old'/>
	      </disk>
	    </devices>
	  </domain>
	</domainsnapshot>

	* src/conf/domain_conf.h (_virDomainSnapshotDiskDef): New type.
	(_virDomainSnapshotDef): Add new elements.
	(virDomainSnapshotAlignDisks): New prototype.
	* src/conf/domain_conf.c (virDomainSnapshotDiskDefClear)
	(virDomainSnapshotDiskDefParseXML, disksorter)
	(virDomainSnapshotAlignDisks): New functions.
	(virDomainSnapshotDefParseString): Parse new fields.
	(virDomainSnapshotDefFree): Clean them up.
	(virDomainSnapshotDefFormat): Output them.
	* src/libvirt_private.syms (domain_conf.h): Export new function.
	* docs/schemas/domainsnapshot.rng (domainsnapshot, disksnapshot):
	Add more xml.
	* docs/formatsnapshot.html.in: Document it.
	* tests/domainsnapshotxml2xmlin/disk_snapshot.xml: New test.
	* tests/domainsnapshotxml2xmlout/disk_snapshot.xml: Update.

2011-09-05  Eric Blake  <eblake@redhat.com>

	snapshot: support extra state in snapshots
	In order to distinguish disk snapshots from system checkpoints, a
	new state value that is only valid for snapshots is helpful.

	* include/libvirt/libvirt.h.in (VIR_DOMAIN_LAST): New placeholder.
	* src/conf/domain_conf.h (virDomainSnapshotState): New enum mapping.
	(VIR_DOMAIN_DISK_SNAPSHOT): New internal enum value.
	* src/conf/domain_conf.c (virDomainState): Use placeholder.
	(virDomainSnapshotState): Extend mapping by one for use in snapshot.
	(virDomainSnapshotDefParseString, virDomainSnapshotDefFormat):
	Handle new state.
	(virDomainObjSetState, virDomainStateReasonToString)
	(virDomainStateReasonFromString): Avoid compiler warnings.
	* tools/virsh.c (vshDomainState, vshDomainStateReasonToString):
	Likewise.
	* src/libvirt_private.syms (domain_conf.h): Export new functions.
	* docs/schemas/domainsnapshot.rng: Tighten state definition.
	* docs/formatsnapshot.html.in: Document it.
	* tests/domainsnapshotxml2xmlout/disk_snapshot.xml: New test.

2011-09-05  Eric Blake  <eblake@redhat.com>

	snapshot: expose halt-after-creation in virsh
	Easy enough to emulate even with older servers.

	* tools/virsh.c (cmdSnapshotCreate, cmdSnapshotCreateAs): Add
	--halt flag.
	(vshSnapshotCreate): Emulate halt when flag is unsupported.
	* tools/virsh.pod (snapshot-create, snapshot-create-as): Document
	it.

2011-09-05  Eric Blake  <eblake@redhat.com>

	snapshot: allow halting after snapshot
	Since a snapshot is fully recoverable, it is useful to have a
	snapshot as a means of hibernating a guest, then reverting to
	the snapshot to wake the guest up.  This mode of usage is
	similar to 'virsh save/virsh restore', except that virsh
	save uses an external file while virsh snapshot keeps the
	vm state internal to a qcow2 file.  However, it only works on
	persistent domains.

	In the usage pattern of snapshot/revert for hibernating a guest,
	there is no need to keep the guest running between the two points
	in time, especially since that would generate runtime state that
	would just be discarded.  Add a flag to make it possible to
	stop the domain after the snapshot has completed.

	* include/libvirt/libvirt.h.in (VIR_DOMAIN_SNAPSHOT_CREATE_HALT):
	New flag.
	* src/libvirt.c (virDomainSnapshotCreateXML): Document it.
	* src/qemu/qemu_driver.c (qemuDomainSnapshotCreateXML)
	(qemuDomainSnapshotCreateActive): Implement it.

2011-09-05  Eric Blake  <eblake@redhat.com>

	snapshot: expose new delete flag in virsh
	It would technically be possible to have virsh compute the list
	of descendants of a given snapshot, then delete those one at
	a time.  But it's complex, and not worth writing for a first
	cut at implementing the new flags.

	* tools/virsh.c (cmdSnapshotDelete): Add --children-only,
	--metadata.
	* tools/virsh.pod (snapshot-delete): Document them.

2011-09-05  Eric Blake  <eblake@redhat.com>

	snapshot: introduce new deletion flag
	Reverting to a state prior to an external snapshot risks
	corrupting any other branches in the snapshot hierarchy that
	were using the snapshot as a read-only backing file.  So
	disk snapshot code will default to preventing reverting to
	a snapshot that has any children, meaning that deleting just
	the children of a snapshot becomes a useful operation in
	preparing that snapshot for being a future reversion target.
	The code for the new flag is simple - it's one less deletion,
	plus a tweak to keep the current snapshot correct.

	* include/libvirt/libvirt.h.in
	(VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN_ONLY): New flag.
	* src/libvirt.c (virDomainSnapshotDelete): Document it, and
	enforce mutual exclusion.
	* src/qemu/qemu_driver.c (qemuDomainSnapshotDelete): Implement
	it.

2011-09-05  Eric Blake  <eblake@redhat.com>

	snapshot: reject transient disks where code is not ready
	The previous patch introduced new config, but if a hypervisor does
	not support that new config, someone can write XML that does not
	behave as documented.  This prevents some of those cases by
	explicitly rejecting transient disks for several hypervisors.

	Disk snapshots will require a new flag to actually affect a snapshot
	creation, so there's not much to reject there.

	* src/qemu/qemu_command.c (qemuBuildDriveStr): Reject transient
	disks for now.
	* src/libxl/libxl_conf.c (libxlMakeDisk): Likewise.
	* src/xenxs/xen_sxpr.c (xenFormatSxprDisk): Likewise.
	* src/xenxs/xen_xm.c (xenFormatXMDisk): Likewise.

2011-09-05  Eric Blake  <eblake@redhat.com>

	snapshot: additions to domain xml for disks
	As discussed here:
	https://www.redhat.com/archives/libvir-list/2011-August/msg00361.html
	https://www.redhat.com/archives/libvir-list/2011-August/msg00552.html

	Adds snapshot attribute and transient sub-element:

	<devices>
	  <disk type=... snapshot='no|internal|external'>
	    ...
	    <transient/>
	  </disk>
	</devices>

	* docs/schemas/domaincommon.rng (snapshot): New define.
	(disk): Add snapshot and persistent attributes.
	* docs/formatdomain.html.in: Document them.
	* src/conf/domain_conf.h (virDomainDiskSnapshot): New enum.
	(_virDomainDiskDef): New fields.
	* tests/qemuxml2argvdata/qemuxml2argv-disk-transient.xml: New
	test of rng, no args counterpart until qemu support is complete.
	* tests/qemuxml2argvdata/qemuxml2argv-disk-snapshot.args: New
	file, snapshot attribute does not affect args.
	* tests/qemuxml2argvdata/qemuxml2argv-disk-snapshot.xml: Likewise.
	* tests/qemuxml2argvtest.c (mymain): Run new test.

2011-09-05  Lei Li  <lilei@linux.vnet.ibm.com>

	Check for source conflicts in storage pools
	Fix bug #611823 storage driver should prohibit pools with duplicate
	underlying storage.

	Add internal API virStoragePoolSourceFindDuplicate() to do uniqueness
	check based on source location infomation for pool type.

	* AUTHORS: add Lei Li

2011-09-05  Marc-André Lureau  <marcandre.lureau@redhat.com>

	Add a usb1 & usb2 qemuxml2argv test

	Default USB device is on slot 1 function 2
	Fix qemuAssignDevicePCISlots() and the associated regression tests

	PIIX3 USB controller is on function 2
	Current code reserves slot 1 function 2 even if there is a user
	defined PIIX3 USB controller there.

2011-09-05  Philipp Hahn  <hahn@univention.de>

	Fix localtime handling for Xen-PV domains
	At least Xen-3.4.3 translates the /vm/localtime SXPR value to
	/domain/platform/localtime and /domain/image/{linux,hvm}/localtime when
	the domain is defined.  When reading back that information libvirt only
	handles HVM domains, but not PV domains: This results in libvirtd always
	returning
	    <clock offset="utc"/>
	while Xend used (localtime 1).

	For PV domains use /domain/image/linux/localtime.

2011-09-03  Eric Blake  <eblake@redhat.com>

	snapshot: store qemu domain details in xml
	When reverting to a snapshot, the inactive domain configuration
	has to be rolled back to what it was at the time of the snapshot.
	Additionally, if the VM is active and the snapshot was active,
	this now adds a failure if the two configurations are ABI
	incompatible, rather than risking qemu confusion.

	A future patch will add a VIR_DOMAIN_SNAPSHOT_FORCE flag, which
	will be required for two risky code paths - reverting to an
	older snapshot that lacked full domain information, and reverting
	from running to a live snapshot that requires starting a new qemu
	process.  Any reverting that stops a running vm is also a form
	of data loss (discarding the current running state to go back in
	time), but as that is what reversion usually implies, it is
	probably not worth requiring a force flag.

	* src/qemu/qemu_driver.c (qemuDomainSnapshotCreateXML): Copy out
	domain.
	(qemuDomainSnapshotCreateXML, qemuDomainRevertToSnapshot): Perform
	ABI compatibility checks.

2011-09-03  Eric Blake  <eblake@redhat.com>

	snapshot: update rng to support full domain in xml
	This patch will probably cause merge conflicts to those trying
	to do backports.  The end goal is simple - domaincommon.rng
	should be the state of domain.rng pre-patch, with a few lines
	tweaked in the header, while domain.rng post-patch is now just
	a shell that includes domaincommon.rng and sets the <start>.

	* docs/schemas/domain.rng: Move guts...
	* docs/schemas/domaincommon.rng: ...to new file.
	* docs/schemas/domainsnapshot.rng: Allow new xml.
	* docs/schemas/Makefile.am (schema_DATA): Distribute new file.
	* tests/domainsnapshotxml2xmlout/full_domain.xml: New test.
	* libvirt.spec.in (%files client): Ship new file.  Sort lines.
	* mingw32-libvirt.spec.in: Likewise.

2011-09-03  Eric Blake  <eblake@redhat.com>

	snapshot: correctly escape generated xml
	Commit 69278878 fixed one direction of arbitrarily-named snapshots,
	but not the round trip path.  While auditing domain_conf, I found
	a couple other instances that weren't escaping arbitrary strings.

	* src/conf/domain_conf.c (virDomainFSDefFormat)
	(virDomainGraphicsListenDefFormat, virDomainSnapshotDefFormat):
	Escape arbitrary strings.

2011-09-03  Eric Blake  <eblake@redhat.com>

	snapshot: allow full domain xml in snapshot
	Just like VM saved state images (virsh save), snapshots MUST
	track the inactive domain xml to detect any ABI incompatibilities.

	The indentation is not perfect, but functionality comes before form.

	Later patches will actually supply a full domain; for now, this
	wires up the storage to support one, but doesn't ever generate one
	in dumpxml output.

	Happily, libvirt.c was already rejecting use of VIR_DOMAIN_XML_SECURE
	from read-only connections, even though before this patch, there was
	no information to be secured by the use of that flag.

	And while we're at it, mark the libvirt snapshot metadata files
	as internal-use only.

	* src/libvirt.c (virDomainSnapshotGetXMLDesc): Document flag.
	* src/conf/domain_conf.h (_virDomainSnapshotDef): Add member.
	(virDomainSnapshotDefParseString, virDomainSnapshotDefFormat):
	Update signature.
	* src/conf/domain_conf.c (virDomainSnapshotDefFree): Clean up.
	(virDomainSnapshotDefParseString): Optionally parse domain.
	(virDomainSnapshotDefFormat): Output full domain.
	* src/esx/esx_driver.c (esxDomainSnapshotCreateXML)
	(esxDomainSnapshotGetXMLDesc): Update callers.
	* src/vbox/vbox_tmpl.c (vboxDomainSnapshotCreateXML)
	(vboxDomainSnapshotGetXMLDesc): Likewise.
	* src/qemu/qemu_driver.c (qemuDomainSnapshotCreateXML)
	(qemuDomainSnapshotLoad, qemuDomainSnapshotGetXMLDesc)
	(qemuDomainSnapshotWriteMetadata): Likewise.
	* docs/formatsnapshot.html.in: Rework doc example.
	Based on a patch by Philipp Hahn.

2011-09-03  Eric Blake  <eblake@redhat.com>

	snapshot: refactor domain xml output
	Minor semantic change - allow domain xml to be generated in place
	within a larger buffer, rather than having to go through a
	temporary string.

	* src/conf/domain_conf.c (virDomainDefFormatInternal): Add
	parameter.
	(virDomainDefFormat, virDomainObjFormat): Update callers.

2011-09-03  Eric Blake  <eblake@redhat.com>

	snapshot: prevent migration from stranding snapshot data
	Migration is another case of stranding metadata.  And since
	snapshot metadata is arbitrarily large, there's no way to
	shoehorn it into the migration cookie of migration v3.

	This patch consolidates two existing locations for migration
	validation into one helper function, then enhances that function
	to also do the new checks.  If we could always trust the source
	to validate migration, then the destination would not have to
	do anything; but since older servers that did not do checking
	can migrate to newer destinations, we have to repeat some of
	the same checks on the destination; meanwhile, we want to
	detect failures as soon as possible.  With migration v2, this
	means that validation will reject things at Prepare on the
	destination if the XML exposes the problem, otherwise at Perform
	on the source; with migration v3, this means that validation
	will reject things at Begin on the source, or if the source
	is old and the XML exposes the problem, then at Prepare on the
	destination.

	This patch is necessarily over-strict.  Once a later patch
	properly handles auto-cleanup of snapshot metadata on the
	death of a transient domain, then the only time we actually
	need snapshots to prevent migration is when using the
	--undefinesource flag on a persistent source domain.

	It is possible to recreate snapshot metadata on the destination
	with VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE and
	VIR_DOMAIN_SNAPSHOT_CREATE_CURRENT.  But for now, that is limited,
	since if we delete the snapshot metadata prior to migration,
	then we won't know the name of the current snapshot to pass
	along; and if we delete the snapshot metadata after migration
	and use the v3 migration cookie to pass along the name of the
	current snapshot, then we need a way to bypass the fact that
	this patch refuses migration with snapshot metadata present.

	So eventually, we may have to introduce migration protocol v4
	that allows feature negotiation and an arbitrary number of
	handshake exchanges, so as to pass as many rpc calls as needed
	to transfer all the snapshot xml hierarchy.

	But all of that is thoughts for the future; for now, the best
	course of action is to quit early, rather than get into a
	funky state of stale metadata; then relax restrictions later.

	* src/qemu/qemu_migration.h (qemuMigrationIsAllowed): Make static.
	* src/qemu/qemu_migration.c (qemuMigrationIsAllowed): Alter
	signature, and allow checks for both outgoing and incoming.
	(qemuMigrationBegin, qemuMigrationPrepareAny)
	(qemuMigrationPerformJob): Update callers.

2011-09-03  Eric Blake  <eblake@redhat.com>

	snapshot: support new undefine flags in qemu
	A nice benefit of deleting all snapshots at undefine time is that
	you don't have to do any reparenting or subtree identification - since
	everything goes, this is an O(n) process, whereas using multiple
	virDomainSnapshotDelete calls would be O(n^2) or worse.  But it is
	only doable for snapshot metadata, where we are in control of the
	data being deleted; for the actual snapshots, there's too much
	likelihood of something going wrong, and requiring even more API
	calls to figure out what failed in the meantime, so callers are
	better off deleting the snapshot data themselves one snapshot at
	a time where they can deal with failures as they happen.

	* src/qemu/qemu_driver.c (qemuDomainUndefineFlags): Honor new flags.

2011-09-03  Eric Blake  <eblake@redhat.com>

	snapshot: cache qemu-img location
	As more clients start to want to know this information, doing
	a PATH stat walk and malloc for every client adds up.

	We are only caching the location, not the capabilities, so even
	if qemu-img is updated in the meantime, it will still probably
	live in the same location.  So there is no need to worry about
	clearing this particular cache.

	* src/qemu/qemu_conf.h (qemud_driver): Add member.
	* src/qemu/qemu_driver.c (qemudShutdown): Cleanup.
	(qemuFindQemuImgBinary): Add an argument, and cache result.
	(qemuDomainSnapshotForEachQcow2, qemuDomainSnapshotDiscard)
	(qemuDomainSnapshotCreateInactive, qemuDomainSnapshotRevertInactive)
	(qemuDomainSnapshotCreateXML, qemuDomainRevertToSnapshot): Update
	callers.

2011-09-03  Eric Blake  <eblake@redhat.com>

	snapshot: refactor some qemu code
	Prepare for code sharing.  No semantic change.

	* src/qemu/qemu_driver.c (qemuFindQemuImgBinary)
	(qemuDomainSnapshotWriteMetadata)
	(qemuDomainSnapshotDiscard)
	(qemuDomainSnapshotForEachQcow2): Float up.
	(qemuDomainSnapshotDiscardDescendant): Likewise, and rename...
	(qemuDomainSnapshotDiscardAll): ...for generic use.
	(qemuDomainSnapshotDelete): Update caller.

2011-09-03  Eric Blake  <eblake@redhat.com>

	snapshot: teach virsh about new undefine flags
	Similar to 'undefine --managed-save' (commit 83e849c1), we must
	assume that the old API is unsafe; however, we cannot emulate
	metadata-only deletion on older servers.  Additionally, we have
	the wrinkle that while virDomainUndefineFlags and managed save
	cleanup were introduced in 0.9.4, it wasn't until 0.9.5 that
	snapshots block undefine of a domain.  Do the best we can given
	the server we are talking to.

	* tools/virsh.c (cmdUndefine): Add --snapshots-metadata flag.
	* tools/virsh.pod (undefine, destroy, shutdown): Document effect
	of snapshots.

2011-09-03  Eric Blake  <eblake@redhat.com>

	snapshot: prevent stranding snapshot data on domain destruction
	Just as leaving managed save metadata behind can cause problems
	when creating a new domain that happens to collide with the name
	of the just-deleted domain, the same is true of leaving any
	snapshot metadata behind.  For safety sake, extend the semantic
	change of commit b26a9fa9 to also cover snapshot metadata as a
	reason to reject undefining an inactive domain.  A future patch
	will make sure that shutdown of a transient domain automatically
	deletes snapshot metadata (whether by destroy, shutdown, or
	guest-initiated action).  Management apps of transient domains
	should take care to capture xml of snapshots, if it is necessary
	to recreate the snapshot metadata on a later transient domain
	with the same name and uuid.

	This also documents a new flag that hypervisors can choose to
	support as a shortcut for taking care of the metadata as part of
	the undefine process; however, nontrivial driver support for these
	flags will be deferred to future patches.

	Note that ESX and VBox can never be transient; therefore, they
	do not have to worry about automatic cleanup after shutdown
	(the persistent domain still remains); likewise they never
	store snapshot metadata, so the undefine flag is trivial.
	The nontrivial work remaining is thus in the qemu driver.

	* include/libvirt/libvirt.h.in
	(VIR_DOMAIN_UNDEFINE_SNAPSHOTS_METADATA): New flag.
	* src/libvirt.c (virDomainUndefine, virDomainUndefineFlags):
	Document new limitations and flag.
	* src/esx/esx_driver.c (esxDomainUndefineFlags): Trivial
	implementation.
	* src/vbox/vbox_tmpl.c (vboxDomainUndefineFlags): Likewise.
	* src/qemu/qemu_driver.c (qemuDomainUndefineFlags): Enforce
	the limitations.

2011-09-03  Eric Blake  <eblake@redhat.com>

	snapshot: add qemu snapshot redefine support
	Redefining a qemu snapshot requires a bit of a tweak to the common
	snapshot parsing code, but the end result is quite nice.

	Be careful that redefinitions do not introduce circular parent
	chains.  Also, we don't want to allow conversion between online
	and offline existing snapshots.  We could probably do some more
	validation for snapshots that don't already exist to make sure
	they are even feasible, by parsing qemu-img output, but that
	can come later.

	* src/conf/domain_conf.h (virDomainSnapshotParseFlags): New
	internal flags.
	* src/conf/domain_conf.c (virDomainSnapshotDefParseString): Alter
	signature to take internal flags.
	* src/esx/esx_driver.c (esxDomainSnapshotCreateXML): Update caller.
	* src/vbox/vbox_tmpl.c (vboxDomainSnapshotCreateXML): Likewise.
	* src/qemu/qemu_driver.c (qemuDomainSnapshotCreateXML): Support
	new public flags.

2011-09-03  Eric Blake  <eblake@redhat.com>

	snapshot: add qemu snapshot creation without metadata
	Supporting NO_METADATA on snapshot creation is interesting - we must
	still return a valid opaque snapshot object, but the user can't get
	anything out of it (unless we add a virDomainSnapshotGetName()),
	since it is no longer registered with the domain.

	Also, virsh now tries to query for secure xml, in anticipation of
	when we store <domain> xml inside <domainsnapshot>; for now, we
	can trivially support it, since we have nothing secure.

	* src/qemu/qemu_driver.c (qemuDomainSnapshotCreateXML): Support
	new flag.
	(qemuDomainSnapshotGetXMLDesc): Trivially support VIR_DOMAIN_XML_SECURE.

2011-09-03  Eric Blake  <eblake@redhat.com>

	snapshot: improve virsh snapshot-create, add snapshot-edit
	Wire up the new snapshot creation flags in virsh.  For convenience,
	teach 'snapshot-current' how to make an existing snapshot become
	current (can be used after upgrading to newer libvirt to recover
	from the fact that the older libvirt lost track of the current
	snapshot after a restart).  The snapshot-create-as command is
	intentionally not taught --redefine or --current, as this would
	imply adding a lot of other options for everything else that can
	appear in the <domainsnapshot> xml, but which is normally read-only.
	Besides, redefining will usually be done on files created by
	snapshot-dumpxml, rather than something built up by hand on the
	command line.  And now that we can redefine, we can edit.

	* tools/virsh.c (cmdSnapshotCreate): Add --redefine, --current,
	and --no-metadata.
	(cmdSnapshotCreateAs): Add --no-metadata.
	(cmdSnapshotCurrent): Add snapshotname to alter current snapshot.
	(cmdSnapshotEdit): New command.
	* tools/virsh.pod (snapshot-create, snapshot-create-as)
	(snapshot-current, snapshot-edit):  Document these.

2011-09-03  Eric Blake  <eblake@redhat.com>

	snapshot: refactor virsh snapshot creation
	The next patch will make snapshot creation more complex, so it's
	better to avoid repetition of the complexity.

	* tools/virsh.c (vshSnapshotCreate): New helper function.
	(cmdSnapshotCreate, cmdSnapshotCreateAs): Use it.

2011-09-03  Eric Blake  <eblake@redhat.com>

	snapshot: allow recreation of metadata
	The first two flags are essential for being able to replicate
	snapshot hierarchies across multiple hosts, which will come in
	handy for supervised migrations.  It also allows a management app
	to take a snapshot of a transient domain, save the metadata, stop
	the domain, recreate a new transient domain by the same name,
	redefine the snapshot, then revert to it.

	This is not quite as convenient as leaving the metadata behind
	after a domain is no longer around, but doing that has a few
	problems: 1. the libvirt API can only delete snapshot metadata
	if there is a valid domain handle to use to get to that snapshot
	object - if stale data is left behind without a domain, there is
	no way to request that the data be cleaned up. 2. creating a new
	domain with the same name but different uuid than the older
	domain where a snapshot existed cannot use the older snapshot
	data; this risks confusing libvirt, and forbidding the stale
	data is similar to the recent patch to forbid stale managed save.

	The first two flags might be useful on hypervisors with no metadata,
	but only for modifying the notion of the current snapshot;
	however, I don't know how to do that for ESX or VBox.

	The third flag is a convenience option, to combine a creation with
	a delete metadata into one step.  It is trivial for hypervisors
	with no metadata.

	The qemu changes will be involved enough to warrant a separate patch.

	* include/libvirt/libvirt.h.in
	(VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE)
	(VIR_DOMAIN_SNAPSHOT_CREATE_CURRENT)
	(VIR_DOMAIN_SNAPSHOT_CREATE_NO_METADATA): New flags.
	* src/libvirt.c (virDomainSnapshotCreateXML): Document them, and
	enforce mutual exclusion.
	* src/esx/esx_driver.c (esxDomainSnapshotCreateXML): Trivial
	implementation.
	* src/vbox/vbox_tmpl.c (vboxDomainSnapshotCreateXML): Likewise.
	* docs/formatsnapshot.html.in: Document re-creation.

2011-09-03  Eric Blake  <eblake@redhat.com>

	snapshot: identify qemu snapshot roots
	Filtering for roots is pretty easy to do.

	* src/conf/domain_conf.h (virDomainSnapshotObjListGetNames)
	(virDomainSnapshotObjListNum): Update prototype.
	* src/conf/domain_conf.c (virDomainSnapshotObjListCopyNames)
	(virDomainSnapshotObjListGetNames, virDomainSnapshotObjListCount)
	(virDomainSnapshotObjListNum): Support filtering.
	* src/qemu/qemu_driver.c (qemuDomainSnapshotNum)
	(qemuDomainSnapshotListNames): Update callers.

2011-09-03  Eric Blake  <eblake@redhat.com>

	snapshot: reflect new dumpxml and list options in virsh
	New flag bits are worth exposing via virsh.  In the case of
	snapshot-list --roots, it's possible to emulate this even when
	talking to an older server that lacks the bit; whereas
	--metadata requires a newer server.

	Although we don't use --security-info yet, the flag is already
	documented for other dumpxml operations, and turning it on now
	will make it useful when a future patch actually has to honor it.

	* tools/virsh.c (cmdSnapshotDumpXML, cmdSnapshotCurrent): Add
	--security-info.
	(cmdSnapshotList): Add --roots, --metadata.
	* tools/virsh.pod (snapshot-dumpxml, snapshot-current)
	(snapshot-list): Document these.

2011-09-03  Eric Blake  <eblake@redhat.com>

	snapshot: identify which snapshots have metadata
	To make it easier to know when undefine will fail because of existing
	snapshot metadata, we need to know how many snapshots have metadata.

	Also, it is handy to filter the list of snapshots to just those that
	have no parents; document that flag now, but implement it in later patches.

	* include/libvirt/libvirt.h.in (VIR_DOMAIN_SNAPSHOT_LIST_ROOTS)
	(VIR_DOMAIN_SNAPSHOT_LIST_METADATA): New flags.
	* src/libvirt.c (virDomainSnapshotNum)
	(virDomainSnapshotListNames): Document them.
	* src/esx/esx_driver.c (esxDomainSnapshotNum)
	(esxDomainSnapshotListNames): Implement trivial flag.
	* src/vbox/vbox_tmpl.c (vboxDomainSnapshotNum)
	(vboxDomainSnapshotListNames): Likewise.
	* src/qemu/qemu_driver.c (qemuDomainSnapshotNum)
	(qemuDomainSnapshotListNames): Likewise.

2011-09-03  Eric Blake  <eblake@redhat.com>

	snapshot: let qemu discard only snapshot metadata
	Adding this was trivial compared to the previous patch for fixing
	qemu snapshot deletion in the first place.

	* src/qemu/qemu_driver.c (qemuDomainSnapshotDiscard): Add
	parameter.
	(qemuDomainSnapshotDiscardDescendant, qemuDomainSnapshotDelete):
	Update callers.

2011-09-03  Eric Blake  <eblake@redhat.com>

	snapshot: allow deletion of just snapshot metadata
	A future patch will make it impossible to remove a domain if it
	would leave behind any libvirt-tracked metadata about snapshots,
	since stale metadata interferes with a new domain by the same name.
	But requiring snaphot contents to be deleted before removing a
	domain is harsh; with qemu, qemu-img can still make use of the
	contents after the libvirt domain is gone.  Therefore, we need
	an option to get rid of libvirt tracking information, but not
	the actual contents.  For hypervisors that do not track any
	metadata in libvirt, the implementation is trivial; all remaining
	hypervisors (really, just qemu) will be dealt with separately.

	* include/libvirt/libvirt.h.in
	(VIR_DOMAIN_SNAPSHOT_DELETE_METADATA_ONLY): New flag.
	* src/libvirt.c (virDomainSnapshotDelete): Document it.
	* src/esx/esx_driver.c (esxDomainSnapshotDelete): Trivially
	supported when there is no libvirt metadata.
	* src/vbox/vbox_tmpl.c (vboxDomainSnapshotDelete): Likewise.

2011-09-03  Eric Blake  <eblake@redhat.com>

	snapshot: simplify acting on just children
	Similar to the last patch in isolating the filtering from the
	client actions, so that clients don't have to reinvent the
	filtering.

	* src/conf/domain_conf.h (virDomainSnapshotForEachChild): New
	prototype.
	* src/libvirt_private.syms (domain_conf.h): Export it.
	* src/conf/domain_conf.c (virDomainSnapshotActOnChild)
	(virDomainSnapshotForEachChild): New functions.
	(virDomainSnapshotCountChildren): Delete.
	(virDomainSnapshotHasChildren): Simplify.
	* src/qemu/qemu_driver.c (qemuDomainSnapshotReparentChildren)
	(qemuDomainSnapshotDelete): Likewise.

2011-09-03  Eric Blake  <eblake@redhat.com>

	snapshot: track current domain across deletion of children
	Deleting a snapshot and all its descendants had problems with
	tracking the current snapshot.  The deletion does not necessarily
	proceed in depth-first order, so a parent could be deleted
	before a child, wreaking havoc on passing the notion of the
	current snapshot to the parent.  Furthermore, even if traversal
	were depth-first, doing multiple file writes to pass current up
	the chain one snapshot at a time is wasteful, comparing to a
	single update to the current snapshot at the end of the algorithm.

	* src/qemu/qemu_driver.c (snap_remove): Add field.
	(qemuDomainSnapshotDiscard): Add parameter.
	(qemuDomainSnapshotDiscardDescendant): Adjust accordingly.
	(qemuDomainSnapshotDelete): Properly reset current.

2011-09-03  Eric Blake  <eblake@redhat.com>

	snapshot: avoid crash when deleting qemu snapshots
	This one's nasty.  Ever since we fixed virHashForEach to prevent
	nested hash iterations for safety reasons (commit fba550f6),
	virDomainSnapshotDelete with VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN
	has been broken for qemu: it deletes children, while leaving
	grandchildren intact but pointing to a no-longer-present parent.
	But even before then, the code would often appear to succeed to
	clean up grandchildren, but risked memory corruption if you have
	a large and deep hierarchy of snapshots.

	For acting on just children, a single virHashForEach is sufficient.
	But for acting on an entire subtree, it requires iteration; and
	since we declared recursion as invalid, we have to switch to a
	while loop.  Doing this correctly requires quite a bit of overhaul,
	so I added a new helper function to isolate the algorithm from the
	actions, so that callers do not have to reinvent the iteration.

	Note that this _still_ does not handle CHILDREN correctly if one
	of the children is the current snapshot; that will be next.

	* src/conf/domain_conf.h (_virDomainSnapshotDef): Add mark.
	(virDomainSnapshotForEachDescendant): New prototype.
	* src/libvirt_private.syms (domain_conf.h): Export it.
	* src/conf/domain_conf.c (virDomainSnapshotMarkDescendant)
	(virDomainSnapshotActOnDescendant)
	(virDomainSnapshotForEachDescendant): New functions.
	* src/qemu/qemu_driver.c (qemuDomainSnapshotDiscardChildren):
	Replace...
	(qemuDomainSnapshotDiscardDescenent): ...with callback that
	doesn't nest hash traversal.
	(qemuDomainSnapshotDelete): Use new function.

2011-09-03  Eric Blake  <eblake@redhat.com>

	snapshot: speed up snapshot location
	Each snapshot lookup was iterating over the entire hash table, O(n),
	instead of honing in directly on the hash key, amortized O(1).

	Besides, fixing this means that virDomainSnapshotFindByName can now
	be used inside another virHashForeach iteration (without this patch,
	attempts to lookup a snapshot by name during a hash iteration will
	fail due to nested iteration).

	* src/conf/domain_conf.c (virDomainSnapshotFindByName): Simplify.
	(virDomainSnapshotObjListSearchName): Delete unused function.

2011-09-03  Eric Blake  <eblake@redhat.com>

	snapshot: add snapshot-list --parent to virsh
	Even though I recently added 'virsh snapshot-parent', doing it one
	snapshot at a time is painful, so make it possible to expand the
	snapshot-list table at once.

	* tools/virsh.c (cmdSnapshotList): Add --parent.
	* tools/virsh.pod (snapshot-list): Document it.

2011-09-03  Eric Blake  <eblake@redhat.com>

	snapshot: fine-tune qemu snapshot revert states
	For a system checkpoint of a running or paused domain, it's fairly
	easy to honor new flags for altering which state to use after the
	revert.  For an inactive snapshot, the revert has to be done while
	there is no qemu process, so do back-to-back transitions; this also
	lets us revert to inactive snapshots even for transient domains.

	* src/qemu/qemu_driver.c (qemuDomainRevertToSnapshot): Support new
	flags.

2011-09-03  Eric Blake  <eblake@redhat.com>

	snapshot: properly revert qemu to offline snapshots
	Commit 5e47785 broke reverts to offline system checkpoint snapshots
	with older qemu, since there is no longer any code path to use
	qemu -loadvm on next boot.  Meanwhile, reverts to offline system
	checkpoints have been broken for newer qemu, both before and
	after that commit, since -loadvm no longer works to revert to
	disk state without accompanying vm state.  Fix both of these by
	using qemu-img to revert disk state.

	Meanwhile, consolidate the (now 3) clients of a qemu-img iteration
	over all disks of a VM into one function, so that any future
	algorithmic fixes to the FIXMEs in that function after partial
	loop iterations are dealt with at once.  That does mean that this
	patch doesn't handle partial reverts very well, but we're not
	making the situation any worse in this patch.

	* src/qemu/qemu_driver.c (qemuDomainRevertToSnapshot): Use
	qemu-img rather than 'qemu -loadvm' to revert to offline snapshot.
	(qemuDomainSnapshotRevertInactive): New helper.
	(qemuDomainSnapshotCreateInactive): Factor guts...
	(qemuDomainSnapshotForEachQcow2): ...into new helper.
	(qemuDomainSnapshotDiscard): Use it.

2011-09-03  Eric Blake  <eblake@redhat.com>

	snapshot: improve reverting to qemu paused snapshots
	If you take a checkpoint snapshot of a running domain, then pause
	qemu, then restore the snapshot, the result should be a running
	domain, but the code was leaving things paused.  Furthermore, if
	you take a checkpoint of a paused domain, then run, then restore,
	there was a brief but non-deterministic window of time where the
	domain was running rather than paused.  Fix both of these
	discrepancies by always pausing before restoring.

	Also, check that the VM is active every time lock is dropped
	between two monitor calls.

	Finally, straighten out the events that get emitted on each
	transition.

	* src/qemu/qemu_driver.c (qemuDomainRevertToSnapshot): Always
	pause before reversion, and improve events.

2011-09-03  Eric Blake  <eblake@redhat.com>

	snapshot: fine-tune qemu saved images starting paused
	Implement the new running/paused overrides for saved state management.

	Unfortunately, for virDomainSaveImageDefineXML, the saved state
	updates are write-only - I don't know of any way to expose a way
	to query the current run/pause setting of an existing save image
	file to the user without adding a new API or modifying the domain
	xml of virDomainSaveImageGetXMLDesc to include a new element to
	reflect the state bit encoded into the save image.  However, I
	don't think this is a show-stopper, since the API is designed to
	leave the state bit alone unless an explicit flag is used to
	change it.

	* src/qemu/qemu_driver.c (qemuDomainSaveInternal)
	(qemuDomainSaveImageOpen): Adjust signature.
	(qemuDomainSaveFlags, qemuDomainManagedSave)
	(qemuDomainRestoreFlags, qemuDomainSaveImageGetXMLDesc)
	(qemuDomainSaveImageDefineXML, qemuDomainObjRestore): Adjust
	callers.

2011-09-03  Eric Blake  <eblake@redhat.com>

	snapshot: expose --running and --paused in virsh
	Pretty straight-forward exposure of new flags.  For most commands,
	we let the API reject mutually exclusive flags; but for save-image-edit,
	we do the sanity check ourselves to avoid looping on flag failure if
	the edit cycle is ever enhanced to allow the user to retry an edit
	to fix up an xml validation error.

	* tools/virsh.c (cmdManagedSave, cmdRestore, cmdSave)
	(cmdSaveImageDefine, cmdSaveImageEdit): Add new flags.
	* tools/virsh.pod (managedsave, restore, save, save-image-define)
	(save-image-edit): Document them.

2011-09-03  Eric Blake  <eblake@redhat.com>

	snapshot: fine-tune ability to start paused
	While it is nice that snapshots and saved images remember whether
	the domain was running or paused, sometimes the restoration phase
	wants to guarantee a particular state (paused to allow hot-plugging,
	or running without needing to call resume).  This introduces new
	flags to allow the control, and a later patch will implement the
	flags for qemu.

	* include/libvirt/libvirt.h.in (VIR_DOMAIN_SAVE_RUNNING)
	(VIR_DOMAIN_SAVE_PAUSED, VIR_DOMAIN_SNAPSHOT_REVERT_RUNNING)
	(VIR_DOMAIN_SNAPSHOT_REVERT_PAUSED): New flags.
	* src/libvirt.c (virDomainSaveFlags, virDomainRestoreFlags)
	(virDomainManagedSave, virDomainSaveImageDefineXML)
	(virDomainRevertToSnapshot): Document their use, and enforce
	mutual exclusion.

2011-09-03  Eric Blake  <eblake@redhat.com>

	snapshot: better events when starting paused
	There are two classes of management apps that track events - one
	that only cares about on/off (and only needs to track EVENT_STARTED
	and EVENT_STOPPED), and one that cares about paused/running (also
	tracks EVENT_SUSPENDED/EVENT_RESUMED).  To keep both classes happy,
	any transition that can go from inactive to paused must emit two
	back-to-back events - one for started and one for suspended (since
	later resuming of the domain will only send RESUMED, but the first
	class isn't tracking that).

	This also fixes a bug where virDomainCreateWithFlags with the
	VIR_DOMAIN_START_PAUSED flag failed to start paused when restoring
	from a managed save image.

	* include/libvirt/libvirt.h.in (VIR_DOMAIN_EVENT_SUSPENDED_RESTORED)
	(VIR_DOMAIN_EVENT_SUSPENDED_FROM_SNAPSHOT)
	(VIR_DOMAIN_EVENT_RESUMED_FROM_SNAPSHOT): New sub-events.
	* src/qemu/qemu_driver.c (qemuDomainRevertToSnapshot): Use them.
	(qemuDomainSaveImageStartVM): Likewise, and add parameter.
	(qemudDomainCreate, qemuDomainObjStart): Send suspended event when
	starting paused.
	(qemuDomainObjRestore): Add parameter.
	(qemuDomainObjStart, qemuDomainRestoreFlags): Update callers.
	* examples/domain-events/events-c/event-test.c
	(eventDetailToString): Map new detail strings.

2011-09-02  Marc-André Lureau  <marcandre.lureau@redhat.com>

	Learn to use spicevmc as a redirection type for usb-redir

	Add "redirdev" redirection device
	- create a new "redirdev" element for this purpose

2011-09-02  Marc-André Lureau  <marcandre.lureau@redhat.com>

	qemu: Don't append 0 at usb id, so that it is compatible with legacy -usb
	QEMU uses USB bus name "usb.0" when using the legacy -usb argument.
	If we want to allow USB devices to specify their addresses with legacy
	-usb, we should either in case of legacy bus name drop the 0 from the
	address bus, or just drop the 0 from device id. This patch does the
	later.

	Another solution would be to permit addressing on non-legacy USB
	controllers only.

2011-09-02  Marc-André Lureau  <marcandre.lureau@redhat.com>

	qemu: don't reserve slot 1 if a PIIX3 USB controller is defined there
	Applies only to piix3 and check if piix3 controller is on correct
	address, or report error

2011-09-02  Marc-André Lureau  <marcandre.lureau@redhat.com>

	Modify USB port to be defined as a port path
	So that devices can be attached to hubs. Example, to attach to first
	port of a usb-hub on port 1.

	      <hub type='usb'>
	         <address type='usb' bus='0' port='1'/>
	      </hub>

	      <input type='mouse' type='usb'>
	         <address type='usb' bus='0' port='1.1'/>
	      </hub>

	also add a test entry

2011-09-02  Marc-André Lureau  <marcandre.lureau@redhat.com>

	Add USB hub device
	domain parsing and serialization code, qemu driver backend and
	a couple of test

2011-09-02  Marc-André Lureau  <marcandre.lureau@redhat.com>

	Add USB companion controllers support
	Companion controllers take an extra 'master' attribute to associate
	them.

	Also add tests for this

2011-09-02  Marc-André Lureau  <marcandre.lureau@redhat.com>

	USB devices gain a new USB address child element
	Expand the domain and the QEmu driver code
	Adds a couple of tests

	test: USB controller can have a PCI address child element
	add a few tests for the new constructs

2011-09-02  Marc-André Lureau  <marcandre.lureau@redhat.com>

	Add a new controller type 'usb' with optionnal 'model'
	The model by default is piix3-uchi.

	Example:
	<controller type='usb' index='0' model='ich9-ehci'/>

2011-09-02  Marc-André Lureau  <marcandre.lureau@redhat.com>

	Add USB controller models
	List is: piix3-uhci piix4-uhci ehci ich9-ehci1 ich9-uhci1 ich9-uhci2
	ich9-uhci3 vt82c686b-uhci pci-ohci

	Rename virDomainControllerModel to virDomainControllerModelSCSI
	Since we are about to add USB controller support let's remove the
	ambiguity

	Add various USB devices QEMU_CAPS

2011-09-02  Eric Blake  <eblake@redhat.com>

	snapshot: fix corner case on OOM during creation
	Commit 6766ff10 introduced a corner case bug with snapshot creation:
	if a snapshot is created, but then we hit OOM while trying to
	create the return value of the function, then we have polluted the
	internal directory with the snapshot metadata with no way to clean
	it up from the running libvirtd.

	* src/qemu/qemu_driver.c (qemuDomainSnapshotCreateXML): Don't
	write metadata file on OOM condition.

2011-09-02  Eric Blake  <eblake@redhat.com>

	tests: add missing files
	Created by copying from qemuxml2argv-disk-drive-v2-wb.*, then
	s/writeback/directsync/.  Hopefully this matches Osier's intentions.

	* tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-directsync.args:
	* tests/qemuxml2argvdata/qemuxml2argv-disk-drive-cache-directsync.xml:
	Add missing files needed by 'make check'.

2011-09-02  Osier Yang  <jyang@redhat.com>

	Add directsync cache mode support for disk driver
	Newer QEMU introduced cache=directsync for -drive, this patchset
	is to expose it in libvirt layer.

	  * Introduced a new QEMU capability flag ($prefix_CACHE_DIRECTSYNC),
	    As even $prefix_CACHE_V2 is set, we can't known if directsync
	    is supported.

2011-09-02  Osier Yang  <jyang@redhat.com>

	storage: Add virsh support for fs pool formating

2011-09-02  Osier Yang  <jyang@redhat.com>

	storage: Add fs pool formatting
	This patch adds the ability to make the filesystem for a filesystem
	pool during a pool build.

	The patch adds two new flags, no overwrite and overwrite, to control
	when mkfs gets executed.  By default, the patch preserves the
	current behavior, i.e., if no flags are specified, pool build on a
	filesystem pool only makes the directory on which the filesystem
	will be mounted.

	If the no overwrite flag is specified, the target device is checked
	to determine if a filesystem of the type specified in the pool is
	present.  If a filesystem of that type is already present, mkfs is
	not executed and the build call returns an error.  Otherwise, mkfs
	is executed and any data present on the device is overwritten.

	If the overwrite flag is specified, mkfs is always executed, and any
	existing data on the target device is overwritten unconditionally.

2011-09-02  Osier Yang  <jyang@redhat.com>

	storage: Add mkfs and libblkid to build system

	API: Init conn in case of it might be used uninitialized
	There is a goto before "conn" is initialized.

2011-09-02  Eric Blake  <eblake@redhat.com>

	qemu: detect incomplete save files
	Several users have reported problems with 'virsh start' failing because
	it was encountering a managed save situation where the managed save file
	was incomplete.  Be more robust to this by using two different magic
	numbers, so that newer libvirt can gracefully handle an incomplete file
	differently than a complete one, while older libvirt will at least fail
	up front rather than trying to load only to have qemu fail at the end.

	Managed save is a convenience - it exists to preserve as much state
	as possible; if the state was not preserved, it is reasonable to just
	log that fact, then proceed with a fresh boot.  On the other hand,
	user saves are under user control, so we must fail, but by making
	the failure message distinct, the user can better decide how to handle
	the situation of an incomplete save file.

	* src/qemu/qemu_driver.c (QEMUD_SAVE_PARTIAL): New define.
	(qemuDomainSaveInternal): Use it to mark incomplete images.
	(qemuDomainSaveImageOpen, qemuDomainObjRestore): Add parameter
	that controls what to do with partial images.
	(qemuDomainRestoreFlags, qemuDomainSaveImageGetXMLDesc)
	(qemuDomainSaveImageDefineXML, qemuDomainObjStart): Update callers.
	Based on an initial idea by Osier Yang.

2011-09-02  Eric Blake  <eblake@redhat.com>

	qemu: refactor file opening
	In a SELinux or root-squashing NFS environment, libvirt has to go
	through some hoops to create a new file that qemu can then open()
	by name.  Snapshots are a case where we want to guarantee an empty
	file that qemu can open; also, reopening a save file to convert it
	from being marked partial to complete requires a reopen to avoid
	O_DIRECT headaches.  Refactor some existing code to make it easier
	to reuse in later patches.

	* src/qemu/qemu_migration.h (qemuMigrationToFile): Drop parameter.
	* src/qemu/qemu_migration.c (qemuMigrationToFile): Let cgroup do
	the stat, rather than asking caller to do it and pass info down.
	* src/qemu/qemu_driver.c (qemuOpenFile): New function, pulled from...
	(qemuDomainSaveInternal): ...here.
	(doCoreDump, qemuDomainSaveImageOpen): Use it here as well.

2011-09-02  Wen Congyang  <wency@cn.fujitsu.com>

	reserve slot 1 on pci bus0
	After supporting multi function pci device, we only reserve function 1 on slot 1.
	The user can use the other function on slot 1 in the xml config file. We should
	detect this wrong usage.

2011-09-02  Xu He Jie  <xuhj@linux.vnet.ibm.com>

	libvirtd: create run dir when running at non-root user
	When libvirtd is running at non-root user, it won't create ${HOME}/.libvirt.

	It will show error message:
	17:44:16.838: 7035: error : virPidFileAcquirePath:322 : Failed to open pid file

2011-09-02  Scott Moser  <smoser@ubuntu.com>

	lxc: do not require 'ifconfig' or 'ipconfig' in container
	Currently, the lxc implementation invokes 'ip' and 'ifconfig' commands
	inside a container using 'virRun'.  That has the side effect of requiring
	those commands to be present and to function in a manner consistent with
	the usage.  Some small roots (such as ttylinux) may not have 'ip' or
	'ifconfig'.

	This patch replaces the use of these commands with usage of
	netdevice.  The result is that lxc containers do not have to implement
	those commands, and lxc in libvirt is only dependent on the netdevice
	interface.

	I've tested this patch locally against the ubuntu libvirt version enough
	to verify its generally sane.  I attempted to build upstream today, but
	failed with:
	  /usr/bin/ld:
	    ../src/.libs/libvirt_driver_qemu.a(libvirt_driver_qemu_la-qemu_domain.o):
	   undefined reference to symbol 'xmlXPathRegisterNs@@LIBXML2_2.4.30

	Thats probably a local issue only, but I wanted to get this patch up and
	see what others thought of it.  This is ubuntu bug
	https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/828211 .

2011-09-02  Serge Hallyn  <serge.hallyn@canonical.com>

	Create ptmx as a device
	Hi,

	I'm seeing an issue with udev and libvirt-lxc.  Libvirt-lxc creates
	/dev/ptmx as a symlink to /dev/pts/ptmx.  When udev starts up, it
	checks the device type, sees ptmx is 'not right', and replaces it
	with a 'proper' ptmx.

	In lxc, /dev/ptmx is bind-mounted from /dev/pts/ptmx instead of being
	symlinked, so udev sees the right device type and leaves it alone.

	A patch like the following seems to work for me.  Would there be
	any objections to this?

	>From 4c5035de52de7e06a0de9c5d0bab8c87a806cba7 Mon Sep 17 00:00:00 2001
	From: Ubuntu <ubuntu@domU-12-31-39-14-F0-B3.compute-1.internal>
	Date: Wed, 31 Aug 2011 18:15:54 +0000
	Subject: [PATCH 1/1] make ptmx a bind mount rather than symlink

	udev on some systems checks the device type of /dev/ptmx, and replaces it if
	not as expected.  The symlink created by libvirt-lxc therefore gets replaced.
	By creating it as a bind mount, the device type is correct and udev leaves it
	alone.

2011-09-02  Adam Litke  <agl@us.ibm.com>

	BlockPull: Set initial bandwidth limit if specified
	The libvirt BlockPull API supports the use of an initial bandwidth limit but the
	qemu block_stream API does not.  To get the desired behavior we use the two APIs
	strung together: first BlockPull, then BlockJobSetSpeed.  We can do this at the
	driver level to avoid duplicated code in each monitor path.

2011-09-02  Adam Litke  <agl@us.ibm.com>

	BlockJob: Bandwidth parameter is in MB when using text monitor
	Due to an unfortunate precedent in qemu, the units for the bandwidth parameter
	to block_job_set_speed are different between the text monitor and the qmp
	monitor.  While the qmp monitor uses bytes/s, the text monitor expects MB/s.

	Correct the units for the text interface.

2011-09-02  Jim Fehlig  <jfehlig@suse.com>

	Increase size of buffer for xend response
	On systems with many pcpus, the sexpr returned by xend can be quite
	large for dom0 when it is configured to have #vcpus = #pcpus (default).
	E.g. on a 80 pcpu system, where dom0 had 80 vcpus, the sexpr details
	for dom0 was 73817 bytes!  Increase maximum buffer size to 256k.

2011-09-02  Jim Fehlig  <jfehlig@suse.com>

	Don't overwrite errors from xend_{get,req}
	xenDaemonDomainFetch() was overwriting errors reported by
	xend_get() and xend_req().  E.g. without patch

	error: failed Xen syscall xenDaemonDomainFetch failed to find this domain

	with patch

	error: internal error Xend returned HTTP Content-Length of 73817, which exceeds
	maximum of 65536

2011-09-02  Jim Fehlig  <jfehlig@suse.com>

	Change my email domain
	I'd like to change my primary email address to jfehlig@suse.com.
	This patch changes it in AUTHORS and .mailmap.

2011-09-02  Eric Blake  <eblake@redhat.com>

	virsh: improve send-key documentation
	The 'virsh man' description of send-key was incomplete and used the
	old style (literal 'optional name' instead of '[name]' metasyntax).
	Meanwhile, none of the other virsh help texts include examples, so
	I moved it out of virsh help and into the man page.

	* tools/virsh.pod (send-key): Give better details.
	* tools/virsh.c (info_send_key): Drop example from here.

2011-09-02  Eric Blake  <eblake@redhat.com>

	virsh: support 'virsh start --force-boot' on older servers
	Managed save was added in 0.8.0, virDomainCreateWithFlags in 0.8.2,
	and FORCE_BOOT in 0.9.5.  The virsh flag is more useful if we
	emulate it for all older servers (note that if a hypervisor fails
	the query for a managed save image, then it does not have one to
	be removed, so the flag can be safely ignored).

	* tools/virsh.c (cmdStart): Add emulation for new flag.

2011-09-02  Alex Jia  <ajia@redhat.com>

	virsh: avoid memory leak on cmdVolCreateAs
	* tools/virsh.c: fix memory leak on cmdVolCreateAs function.

	* Detected in valgrind run:

	==4746==
	==4746== 48 (40 direct, 8 indirect) bytes in 1 blocks are definitely lost in loss record 26 of 52
	==4746==    at 0x4A04A28: calloc (vg_replace_malloc.c:467)
	==4746==    by 0x4C76E51: virAlloc (memory.c:101)
	==4746==    by 0x4CD9418: virGetStoragePool (datatypes.c:592)
	==4746==    by 0x4D21367: remoteStoragePoolLookupByName (remote_driver.c:4126)
	==4746==    by 0x4CE42B0: virStoragePoolLookupByName (libvirt.c:10232)
	==4746==    by 0x40C276: vshCommandOptPoolBy (virsh.c:13660)
	==4746==    by 0x40CA37: cmdVolCreateAs (virsh.c:8094)
	==4746==    by 0x412AF2: vshCommandRun (virsh.c:13770)
	==4746==    by 0x422F11: main (virsh.c:15127)
	==4746==
	==4746== 1,011 bytes in 1 blocks are definitely lost in loss record 45 of 52
	==4746==    at 0x4A05FDE: malloc (vg_replace_malloc.c:236)
	==4746==    by 0x4A06167: realloc (vg_replace_malloc.c:525)
	==4746==    by 0x4C76ECB: virReallocN (memory.c:161)
	==4746==    by 0x4C60319: virBufferGrow (buf.c:72)
	==4746==    by 0x4C606AA: virBufferAdd (buf.c:106)
	==4746==    by 0x40CB37: cmdVolCreateAs (virsh.c:8118)
	==4746==    by 0x412AF2: vshCommandRun (virsh.c:13770)
	==4746==    by 0x422F11: main (virsh.c:15127)
	==4746==
	==4746== LEAK SUMMARY:
	==4746==    definitely lost: 1,051 bytes in 2 blocks
	==4746==    indirectly lost: 8 bytes in 1 blocks
	==4746==      possibly lost: 0 bytes in 0 blocks
	==4746==    still reachable: 390,767 bytes in 1,373 blocks
	==4746==         suppressed: 0 bytes in 0 blocks

	* How to reproduce?

	% valgrind -v --leak-check=full virsh vol-create-as default foo.img 10M \
	  --allocation 0 --format qcow2 --backing-vol bar.img

	Notes: bar.img doesn't exist.

2011-09-02  Eric Blake  <eblake@redhat.com>

	build: fix 'make check' with pdwtags
	Problem introduced by commit b12354b.

	* src/remote_protocol-structs: Remove spurious blank line.

2011-09-02  Jim Fehlig  <jfehlig@novell.com>

	virsh: Expose virDomainMigrateGetMaxSpeed API

2011-09-02  Jim Fehlig  <jfehlig@novell.com>

	Add public API for getting migration speed
	Includes impl of python binding since the generator was not
	able to cope.

	Note: Requires gendispatch.pl patch from Matthias Bolte

	https://www.redhat.com/archives/libvir-list/2011-August/msg01367.html

2011-09-01  Eric Blake  <eblake@redhat.com>

	virsh: prefer unsigned flags
	virsh had some leftover 'int flags', and even an 'int flag'
	declaration, compared to our preferred style of 'unsigned int flags'.

	* tools/virsh.c (cmdUndefine, cmdSave, cmdSaveImageDumpxml)
	(cmdSaveImageEdit, cmdManagedSave, cmdRestore, cmdDump)
	(cmdVcpuPin, cmdSetvcpus, cmdSetmem, cmdSetmaxmem, cmdDumpXML)
	(cmdDomXMLFromNative, cmdDomXMLToNative, doMigrate)
	(cmdInterfaceEdit, cmdInterfaceDumpXML, cmdEdit): Match coding
	style for flags.
	(struct vshComdOptDef): Rename field member.
	(vshCmddefOptParse, vshCmddefHelp): Adjust clients.

2011-09-01  Daniel P. Berrange  <berrange@redhat.com>

	Fix tracking of RPC messages wrt streams
	Commit 2c85644b0b51fbe5b6244e6773531af29933a727 attempted to
	fix a problem with tracking RPC messages from streams by doing

	-            if (msg->header.type == VIR_NET_REPLY) {
	+            if (msg->header.type == VIR_NET_REPLY ||
	+                (msg->header.type == VIR_NET_STREAM &&
	+                 msg->header.status != VIR_NET_CONTINUE)) {
	                 client->nrequests--;

	In other words any stream packet, with status NET_OK or NET_ERROR
	would cause nrequests to be decremented. This is great if the
	packet from from a synchronous virStreamFinish or virStreamAbort
	API call, but wildly wrong if from a server initiated abort.
	The latter resulted in 'nrequests' being decremented below zero.
	This then causes all I/O for that client to be stopped.

	Instead of trying to infer whether we need to decrement the
	nrequests field, from the message type/status, introduce an
	explicit 'bool tracked' field to mark whether the virNetMessagePtr
	object is subject to tracking.

	Also add a virNetMessageClear function to allow a message
	contents to be cleared out, without adversely impacting the
	'tracked' field as a naive memset() would do

	* src/rpc/virnetmessage.c, src/rpc/virnetmessage.h: Add
	  a 'bool tracked' field and virNetMessageClear() API
	* daemon/remote.c, daemon/stream.c, src/rpc/virnetclientprogram.c,
	  src/rpc/virnetclientstream.c, src/rpc/virnetserverclient.c,
	  src/rpc/virnetserverprogram.c: Switch over to use
	  virNetMessageClear() and pass in the 'bool tracked' value
	  when creating messages.

2011-09-01  Daniel P. Berrange  <berrange@redhat.com>

	Avoid use-after-free on streams, due to message callbacks
	When sending outbound stream RPC messages, a callback is
	used to re-enable stream data transmission. If the stream
	aborts while one of these messages is outstanding, the
	stream may have been free'd by the time it is invoked. This
	results in a use-after-free error

	* daemon/stream.c: Ref-count streams to avoid use-after-free

2011-09-01  Daniel P. Berrange  <berrange@redhat.com>

	Fix parted sector size assumption
	Parted does not report disk size in 512 byte units, but
	rather the disks' logical sector size, which with modern
	drives might be 4k.

	* src/storage/parthelper.c: Remove hardcoded 512 byte sector
	  size

2011-09-01  Osier Yang  <jyang@redhat.com>

	qemu: Fix a regression of domain save
	* src/qemu/qemu_driver.c - qemuDomainSaveInternal: Return directly
	will keep the domain object locked, introduced by 173015bec6a.

	Revert "test: Cleanup improper VIR_ERR_NO_SUPPORT use"
	This reverts commit 172214bd304ff958160307be2efd6614e9868946.

	storage: Fix incorrect error codes
	Commit 0376f4a69b intended to fix incorrect use of VIR_ERR_NO_SUPPORT,
	but replacing it with VIR_ERR_OPERATION_INVALID is not proper either.

	remote: Fix incorrect error codes
	Introduced by d4b53ef6c. For "no internalFlags support", the
	error code is changed into INTERNAL_ERROR.

	nodeinfo: Fix incorrect error codes
	Introduced by 5e495c8b, except the ones for checking if numa
	is supported by host, all the NO_SUPPORT are changed back. For
	the ones about numa checking, change them into INTERNAL_ERROR.

	lxc: Fix incorrect changes on error codes.
	Fix incorrect changes introduced by commit 6ac47762bb9.

	conf: Substitute OPERATION_INVALID with INTERNAL_ERROR

2011-09-01  Daniel P. Berrange  <berrange@redhat.com>

	Stop libxl driver polluting logs on non-Xen hosts
	If the libxl driver is compiled in, then everytime libvirtd
	starts up on a non-Xen Dom0 host, it logs a error message.
	Since this is an expected condition, we should not log at
	'error' level, only 'info'.

	* src/libxl/libxl_driver.c: Lower log level for certain
	  expected errors during driver init

2011-09-01  Daniel P. Berrange  <berrange@redhat.com>

	Fix memory leak parsing 'relabel' attribute in domain security XML
	* src/conf/domain_conf.c: Free the 'relabel' attribute

2011-09-01  Daniel P. Berrange  <berrange@redhat.com>

	Fix memory leak dispatching domain events
	When dispatching domain events we will create an XDR struct
	containing the event info. Some of this data may be allocated
	on the heap and so must be freed. The graphics event dispatcher
	had a broken attempt to free one field, but missed others. All
	the events have a dom->name string that needs freeing. The code
	should have used the xdr_free() procedure for doing all this

	* daemon/remote.c: Use xdr_free after dispatching events

2011-09-01  Daniel P. Berrange  <berrange@redhat.com>

	Don't leak memory if a cgroup is mounted multiple times
	It is possible (expected/likely in Fedora 15) for a cgroup controller
	to be mounted in multiple locations at the same time, due to bind
	mounts. Currently we leak memory if this happens, because we overwrite
	the previous 'mountPoint' string. Instead just accept the first match
	we find.

	* src/util/cgroup.c: Only accept first match for a cgroup
	  controller mount

2011-08-31  Eric Blake  <eblake@redhat.com>

	security: fix build
	Regression introduced in commit 183383889.

	* src/libvirt_private.syms (security_manager.h): Drop deleted
	symbol. Detected by build-bot.

2011-08-31  Guannan Ren  <gren@redhat.com>

	stream: remove redundant reference to client while sending stream data
	    *daemon/stream.c: remove virNetServerClientRef()

2011-08-31  Daniel P. Berrange  <berrange@redhat.com>

	Remove bogus virSecurityManagerSetProcessFDLabel method
	The virSecurityManagerSetProcessFDLabel method was introduced
	after a mis-understanding from a conversation about SELinux
	socket labelling. The virSecurityManagerSetSocketLabel method
	should have been used for all such scenarios.

	* src/security/security_apparmor.c, src/security/security_apparmor.c,
	  src/security/security_driver.h, src/security/security_manager.c,
	  src/security/security_manager.h, src/security/security_selinux.c,
	  src/security/security_stack.c: Remove SetProcessFDLabel driver

2011-08-31  Daniel P. Berrange  <berrange@redhat.com>

	Fix sanlock socket security labelling
	It is not possible to change the label of a TCP socket once it
	has been opened. When creating a TCP socket care must be taken
	to ensure the socket creation label is set & then cleared.
	Remove the bogus call to virSecurityManagerSetProcessFDLabel
	from the lock driver guest setup code and instead make use of
	virSecurityManagerSetSocketLabel

2011-08-31  Daniel P. Berrange  <berrange@redhat.com>

	Fix incorrect path length check in sanlock lockspace setup
	The code for creating a sanlock lockspace accidentally used
	SANLK_NAME_LEN instead of SANLK_PATH_LEN for a size check.
	This meant disk paths were limited to 48 bytes !

	* src/locking/lock_driver_sanlock.c: Fix disk path length
	  check

2011-08-31  Eric Blake  <eblake@redhat.com>

	snapshot: forbid snapshot on autodestroy domain
	There is no reason to forbid pausing an autodestroy domain
	(not to mention that 'virsh start --paused --autodestroy'
	succeeds in creating a paused autodestroy domain).

	Meanwhile, qemu was failing to enforce the API documentation that
	autodestroy domains cannot be saved.  And while the original
	documentation only mentioned save/restore, snapshots are another
	form of saving that are close enough in semantics as to make no
	sense on one-shot domains.

	* src/qemu/qemu_driver.c (qemudDomainSuspend): Drop bogus check.
	(qemuDomainSaveInternal, qemuDomainSnapshotCreateXML): Forbid
	saves of autodestroy domains.
	* src/libvirt.c (virDomainCreateWithFlags, virDomainCreateXML):
	Document snapshot interaction.

2011-08-31  Philipp Hahn  <hahn@univention.de>

	Fix error detection in device change
	According to qemu-kvm/qerror.c all messages start with a capital
	"Device ", but the current code only scans for the lower case "device ".
	This results in "virDomainUpdateDeviceFlags()" to not detect locked
	CD-ROMs and reporting success even in the case of a failure:
		# virsh qemu-monitor-command "$VM" change\ drive-ide0-0-0\ \"/var/lib/libvirt/images/ucs_2.4-0-sec4-20110714145916-dvd-amd64.iso\"
		Device 'drive-ide0-0-0' is locked
		# virsh update-device "$VM" /dev/stdin <<<"<disk type='file' device='cdrom'><driver name='qemu' type='raw'/><source file='/var/lib/libvirt/images/ucs_2.4-0-sec4-20110714145916-dvd-amd64.iso'/><target dev='hda' bus='ide'/><readonly/><alias name='ide0-0-0'/><address type='drive' controller='0' bus='0' unit='0'/></disk>"
		Device updated successfully

2011-08-30  Eric Blake  <eblake@redhat.com>

	start: allow discarding managed save
	There have been several instances of people having problems with
	a broken managed save file, and not aware that they could use
	'virsh managedsave-remove dom' to fix things.  Making it possible
	to do this as part of starting a domain makes the same functionality
	easier to find, and one less API call.

	* include/libvirt/libvirt.h.in (VIR_DOMAIN_START_FORCE_BOOT): New
	flag.
	* src/libvirt.c (virDomainCreateWithFlags): Document it.
	* src/qemu/qemu_driver.c (qemuDomainObjStart): Alter signature.
	(qemuAutostartDomain, qemuDomainStartWithFlags): Update callers.
	* tools/virsh.c (cmdStart): Expose it in virsh.
	* tools/virsh.pod (start): Document it.

2011-08-30  Eric Blake  <eblake@redhat.com>

	build: simplify use of verify
	Back in 2008 when this line of util.h was written, gnulib's verify
	module didn't allow the use of multiple verify() in one file
	in combination with our choice of gcc -W options.  But that has
	since been fixed in gnulib, and newer gnulib even maps verify()
	to the C1x feature of _Static_assert, which gives even nicer
	diagnostics with a new enough compiler, so we might as well go
	with the simpler verify().

	* src/util/util.h (VIR_ENUM_IMPL): Use simpler verify, now that
	gnulib module is smarter.

2011-08-30  Eric Blake  <eblake@redhat.com>

	qemu: properly label outgoing pipe for tunneled migration
	Commit 3261761 made it possible to use pipes instead of sockets
	for outgoing tunneled migration; however, it caused a regression
	because the pipe was never given a SELinux label.

	* src/qemu/qemu_migration.c (doTunnelMigrate): Label outgoing pipe.

2011-08-30  Guannan Ren  <gren@redhat.com>

	rpc: fix a typo in debugging log in virNetServerProgramSendStreamData
	The bufferOffset has been initialized to zero in virNetMessageEncodePayloadRaw(),
	so, we use bufferLength to represent the length of message which is going to be
	sent to client side.

2011-08-27  Eric Blake  <eblake@redhat.com>

	maint: fix spelling errors on lose
	* docs/drvqemu.html.in: Fix typo.
	* src/libvirt.c (virDomainCreateXML, virDomainCreateWithFlags):
	Likewise.

2011-08-27  Jim Fehlig  <jfehlig@novell.com>

	Fix generator to cope with call-by-ref long types
	From: Matthias Bolte <matthias.bolte@googlemail.com>
	Tested-by: Jim Fehlig <jfehlig@novell.com>

	Matthias provided this patch to fix an issue I encountered in the
	generator with APIs containing call-by-ref long type, e.g.

	int virDomainMigrateGetMaxSpeed(virDomainPtr domain,
	                                unsigned long *bandwidth,
	                                unsigned int flags);

2011-08-26  Matthias Bolte  <matthias.bolte@googlemail.com>

	hyperv: Add basic documentation

2011-08-26  Matthias Bolte  <matthias.bolte@googlemail.com>

	hyperv: Add basic driver for Microsoft Hyper-V
	Domain listing, basic information retrieval and domain life cycle
	management is implemented. But currently the domain XML output
	lacks the complete devices section.

	The driver uses OpenWSMAN to directly communicate with a Hyper-V
	server over its WS-Management interface exposed via Microsoft WinRM.

	The driver is based on the work of Michael Sievers. This started in
	the same master program project group at the University of Paderborn
	as the ESX driver.

	See Michael's blog for details: http://hyperv4libvirt.wordpress.com/

2011-08-26  Matthias Bolte  <matthias.bolte@googlemail.com>

	hyperv: Add OpenWSMAN based client for the Hyper-V WMI API
	Add a generator script to generate the structs and serialization
	information for OpenWSMAN.

	openwsman.h collects workarounds for problems in OpenWSMAN <= 2.2.6.
	There are also disabled sections that would use ws_serializer_free_mem
	but can't because it's broken in OpenWSMAN <= 2.2.6. Patches to fix
	this have been posted upstream.

2011-08-26  Matthias Bolte  <matthias.bolte@googlemail.com>

	hyperv: Add driver skeleton

	hyperv: Add configure check for OpenWSMAN

2011-08-26  Taku Izumi  <izumi.taku@jp.fujitsu.com>

	schedinfo: update man page about virsh schedinfo command
	This patch updates the man page about virsh schedinfo command.

	 - fix typo: 1844674407370955 -> 18446744073709551
	 - describe the value 0 of vcpu_period and vcpu_quota parameters

2011-08-26  KAMEZAWA Hiroyuki  <kamezawa.hiroyu@jp.fujitsu.com>

	Fix persistent migration config save
	When a user migrates a domain by command as

	libvirt saves vm's domain XML config in destination host after migration.
	But it saves vm->def. Then, the saved XML contains some garbage.

	  <domain type='kvm' id='50'>
	                     ^^^^^^^^
	  ...
	   <console type='pty' tty='/dev/pts/5'>
	                       ^^^^^^^^^^^^^^^^^

	Avoid saving unnecessary things by saving persistent vm definition.

2011-08-26  Jiri Denemark  <jdenemar@redhat.com>

	rpc: Don't close connection if program is unknown
	In case we add a new program in the future (we did that in the past and
	we are going to do it again soon) current daemon will behave badly with
	new client that wants to use the new program. Before the RPC rewrite we
	used to just send an error reply to any request with unknown program.
	With the RPC rewrite in 0.9.3 the daemon just closes the connection
	through which such request was sent. This patch fixes this regression.

2011-08-26  Michal Privoznik  <mprivozn@redhat.com>

	remote: Refuse connecting to remote socket
	If users wants to connect to remote unix socket, e.g.
	'qemu+unix://<remote>/system' currently the <remote> part is ignored,
	ending up connecting to localhost. Connecting to remote socket is not
	supported and user should have used TLS/TCP/SSH instead.

	virterror: Fix error message for VIR_ERR_INVALID_ARG
	When a detail message is presented, nobody expects prefix 'invalid
	argument in' but something more general, like 'invalid argument:'.

2011-08-26  Daniel P. Berrange  <berrange@redhat.com>

	Detect errors from the 'sendkey' command
	On success, the 'sendkey' command does not return any data, so
	any data in the reply should be considered to be an error
	message

	* src/qemu/qemu_monitor_text.c: Treat non-"" reply data as an
	  error message for 'sendkey' command

2011-08-26  Daniel P. Berrange  <berrange@redhat.com>

	Fix keymap used to talk with QEMU
	The QEMU 'sendkey' command expects keys to be encoded in the same
	way as the RFB extended keycode set. Specifically it wants extended
	keys to have the high bit of the first byte set, while the Linux
	XT KBD driver codeset uses the low bit of the second byte. To deal
	with this we introduce a new keymap 'RFB' and use that in the QEMU
	driver

	* include/libvirt/libvirt.h.in: Add VIR_KEYCODE_SET_RFB
	* src/qemu/qemu_driver.c: Use RFB keycode set instead of XT KBD
	* src/util/virkeycode-mapgen.py: Auto-generate the RFB keycode
	  set from the XT KBD set
	* src/util/virkeycode.c: Add RFB keycode entry to table. Add a
	  verify check on cardinality of the codeOffset table

2011-08-26  Jiri Denemark  <jdenemar@redhat.com>

	virsh: Clarify documentation of -d option
	The default is 4, not 0.

	qemu: Correctly label migration TCP socket

	security: Introduce SetSocketLabel
	This API labels all sockets created until ClearSocketLabel is called in
	a way that a vm can access them (i.e., they are labeled with svirt_t
	based label in SELinux).

	security: Rename SetSocketLabel APIs to SetDaemonSocketLabel
	The APIs are designed to label a socket in a way that the libvirt daemon
	itself is able to access it (i.e., in SELinux the label is virtd_t based
	as opposed to svirt_* we use for labeling resources that need to be
	accessed by a vm). The new name reflects this.

	Ignore unused streams in virStreamAbort
	When virStreamAbort is called on a stream that has not been used yet,
	quite confusing error is returned: "this function is not supported by
	the connection driver". Let's just ignore such streams as there's
	nothing to abort anyway.

	Do not try to cancel non-existent migration on source
	If migration failed on source daemon, the migration is automatically
	canceled by the daemon itself. Thus we don't need to call
	virDomainMigrateConfirm3(cancelled=1). Calling it doesn't cause any harm
	but the resulting error message printed in logs may confuse people.

2011-08-26  Eric Blake  <eblake@redhat.com>

	snapshot: track current snapshot across restarts
	Audit all changes to the qemu vm->current_snapshot, and make them
	update the saved xml file for both the previous and the new
	snapshot, so that there is always at most one snapshot with
	<active>1</active> in the xml, and that snapshot is used as the
	current snapshot even across libvirtd restarts.

	This patch does not fix the case of virDomainSnapshotDelete(,CHILDREN)
	where one of the children is the current snapshot; that will be later.

	* src/conf/domain_conf.h (_virDomainSnapshotDef): Alter member
	type and name.
	* src/conf/domain_conf.c (virDomainSnapshotDefParseString)
	(virDomainSnapshotDefFormat): Update clients.
	* docs/schemas/domainsnapshot.rng: Tighten rng.
	* src/qemu/qemu_driver.c (qemuDomainSnapshotLoad): Reload current
	snapshot.
	(qemuDomainSnapshotCreateXML, qemuDomainRevertToSnapshot)
	(qemuDomainSnapshotDiscard): Track current snapshot.

2011-08-26  Eric Blake  <eblake@redhat.com>

	snapshot: only pass snapshot to qemu command line when reverting
	Changing the current vm, and writing that change to the file
	system, all before a new qemu starts, is risky; it's hard to
	roll back if starting the new qemu fails for some reason.
	Instead of abusing vm->current_snapshot and making the command
	line generator decide whether the current snapshot warrants
	using -loadvm, it is better to just directly pass a snapshot all
	the way through the call chain if it is to be loaded.

	This frees up the last use of snapshot->def->active for qemu's
	use, so the next patch can repurpose that field for tracking
	which snapshot is current.

	* src/qemu/qemu_command.c (qemuBuildCommandLine): Don't use active
	field of snapshot.
	* src/qemu/qemu_process.c (qemuProcessStart): Add a parameter.
	* src/qemu/qemu_process.h (qemuProcessStart): Update prototype.
	* src/qemu/qemu_migration.c (qemuMigrationPrepareAny): Update
	callers.
	* src/qemu/qemu_driver.c (qemudDomainCreate)
	(qemuDomainSaveImageStartVM, qemuDomainObjStart)
	(qemuDomainRevertToSnapshot): Likewise.
	(qemuDomainSnapshotSetCurrentActive)
	(qemuDomainSnapshotSetCurrentInactive): Delete unused functions.

2011-08-26  Eric Blake  <eblake@redhat.com>

	snapshot: don't leak resources on qemu snapshot failure
	https://bugzilla.redhat.com/show_bug.cgi?id=727709
	mentions that if qemu fails to create the snapshot (such as what
	happens on Fedora 15 qemu, which has qmp but where savevm is only
	in hmp, and where libvirt is old enough to not try the hmp fallback),
	then 'virsh snapshot-list dom' will show a garbage snapshot entry,
	and the libvirt internal directory for storing snapshot metadata
	will have a bogus file.

	This fixes the fallout bug of polluting the snapshot-list with
	garbage on failure (the root cause of the F15 bug of not having
	fallback to hmp has already been fixed in newer libvirt releases).

	* src/qemu/qemu_driver.c (qemuDomainSnapshotCreateXML): Allocate
	memory before making snapshot, and cleanup on failure.  Don't
	dereference NULL if transient domain exited during snapshot creation.

2011-08-26  Alex Jia  <ajia@redhat.com>

	libvirt: avoid dead store in virDomainMigrateVersion3
	* src/qemu/qemu_migration.c: avoid dead 'ret' assignment and silence
	  clang warning.

	Detected by ccc-analyzer:

	libvirt.c:4277:5: warning: Value stored to 'ret' is never read
	    ret = domain->conn->driver->domainMigrateConfirm3
	    ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

2011-08-26  Alex Jia  <ajia@redhat.com>

	qemu: avoid dead store in doPeer2PeerMigrate3
	* src/qemu/qemu_migration.c: avoid dead 'ret' assignment and silence
	  clang warning.

	Detected by ccc-analyzer:

	  CC     libvirt_driver_qemu_la-qemu_migration.lo
	qemu/qemu_migration.c:2046:5: warning: Value stored to 'ret' is never read
	    ret = qemuMigrationConfirm(driver, sconn, vm,
	    ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

2011-08-25  Daniel P. Berrange  <berrange@redhat.com>

	Fix command test wrt gnutls initialize & fix debugging
	The VIR_TEST_DEBUG and VIR_TEST_VERBOSE env vars did not work
	because we replaced 'environ' with 'newenv'. Simply calling
	virTestGetDebug/Verbose() before replacing the 'environ' ensures
	we have processed the env variables.

	The gnutls initialization code opens /dev/urandom and keeps that
	FD around for later use. We have code which kills off FDs 3-5
	to avoid interfereing with our test case. Move the virInitialize
	call before this point, so it kills off the gnutls /dev/urandom
	FD which is irrelevant for testing purposes

	* tests/commandtest.c: Fix test debugging & make it robust against
	  opened FDs

2011-08-25  Michal Privoznik  <mprivozn@redhat.com>

	daemon: Move TLS initialization to virInitialize
	My previous patch 74c75671331d284e1f777f9692b72e9737520bf0
	introduced a regression by removing TLS initialization from client.

2011-08-25  Laine Stump  <laine@laine.org>

	util: only fchown newly created files in virFileOpenAs
	virFileOpenAs takes desired uid:gid as arguments, and not only uses
	them for a fork/setuid/setgid when retrying failed open operations,
	but additionally always forces the opened file to be owned by the
	given uid:gid.

	One example of the problems this causes is that, when restoring a
	domain from a file that is owned by the qemu user, opening the file
	chowns it to root. if dynamic_ownership=1 this is coincidentally
	expected, but if dynamic_ownership=0, no existing file should ever
	have its ownership changed.

	This patch adds an extra check before calling fchown() - it only does
	it if O_CREAT was passed to virFileOpenAs() in the openflags.

2011-08-25  Shradha Shah  <sshah@solarflare.com>

	qemu: fix off-by-one in pci slot reservation

2011-08-25  Steve Hodgson  <shodgson@solarflare.com>

	maint: attribute second author of previous patch

2011-08-25  Shradha Shah  <sshah@solarflare.com>

	pci: fix pciDeviceListSteal on multiple devices
	pciDeviceListSteal(pcidevs, dev) removes dev from pcidevs reducing
	the length of pcidevs, so moving onto what was the next dev is wrong.

	Instead callers should pop entry 0 repeatedly until pcidevs is empty.

2011-08-24  Eric Blake  <eblake@redhat.com>

	libvirt: log all flags parameters
	I was testing a virsh patch, and wanted to see if I had passed the
	flags I thought.  But with LIBVIRT_DEBUG in the environment, I just
	saw:

	14:24:52.359: 15022: debug : virDomainSnapshotNum:15586 : dom=0xc9c180, (VM: name=rhel_6-64, uuid=48f8e8e7-e14f-0e14-02f0-ce71997bdcab),

	including a trailing space.  This fixes the issues.

	* src/libvirt.c: Log flag parameters, even if currently unused.
	(VIR_DOMAIN_DEBUG_0): Drop trailing comma in log.
	(VIR_DOMAIN_DEBUG_1): Split guts into...
	(VIR_DOMAIN_DEBUG_2): ...new macro.

2011-08-24  Eric Blake  <eblake@redhat.com>

	virsh: add list --managed-save
	Knowing whether 'virsh start' will resume a saved image or do
	a fresh boot is useful enough to expose via 'virsh list'.

	Also, translate the state column.

	* tools/virsh.c (cmdList): add --managed-save flag
	* tools/virsh.pod (list): Document it.
	Based on a suggestion by Miklos Vajna.

2011-08-24  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Use $(PYTHON) instead of the shebang to run the generator

2011-08-24  Osier Yang  <jyang@redhat.com>

	qemu: Report error if qemu monitor command not found for BlockJob
	* src/qemu/qemu_monitor_json.c: Handle error "CommandNotFound" and
	  report the error.

	* src/qemu/qemu_monitor_text.c: If a sub info command is not found,
	  it prints the output of "help info", for other commands,
	  "unknown command" is printed.

	Without this patch, libvirt always report:

	  An error occurred, but the cause is unknown

	This patch was adapted from a patch by Osier Yang <jyang@redhat.com> to
	break out detection of unrecognized text monitor commands into a separate
	function.

2011-08-24  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Refactor a repeated string in the generator

2011-08-24  Eric Blake  <eblake@redhat.com>

	maint: fix comment typos
	* src/qemu/qemu_driver.c (qemuDomainSaveInternal): Fix typo.
	* src/conf/domain_event.c (virDomainEventDispatchMatchCallback):
	Likewise.
	* daemon/libvirtd.c (daemonRunStateInit): Likewise.
	* src/lxc/lxc_container.c (lxcContainerChildMountSort): Likewise.
	* src/util/virterror.c (virCopyError, virRaiseErrorFull): Likewise.
	* src/xenxs/xen_sxpr.c (xenParseSxprSound): Likewise.

2011-08-23  Osier Yang  <jyang@redhat.com>

	virsh: Substitute goto label out with cleanup
	Introduced by 241cbc13a, pushed under urgent rule.

2011-08-23  Osier Yang  <jyang@redhat.com>

	virsh: Do not try to free domain if it is NULL
	Without these patch, there will be error like below if domain
	is NULL.

	error: invalid domain pointer in virDomainFree

	Which is useless.

2011-08-23  Osier Yang  <jyang@redhat.com>

	xen: Cleanup improper VIR_ERR_NO_SUPPORT use

	test: Cleanup improper VIR_ERR_NO_SUPPORT use

	storage: Cleanup improper VIR_ERR_NO_SUPPORT use

	remote: Cleanup improper VIR_ERR_NO_SUPPORT use

2011-08-23  Osier Yang  <jyang@redhat.com>

	qemu: Cleanup improper VIR_ERR_NO_SUPPORT use
	* src/qemu/qemu_command.c: s/VIR_ERR_NO_SUPPORT/VIR_ERR_CONFIG_UNSUPPORTED/

	* src/qemu/qemu_driver.c: s/VIR_ERR_NO_SUPPORT/VIR_ERR_OPERATION_INVALID/

	* src/qemu/qemu_process.c: s/VIR_ERR_NO_SUPPORT/VIR_ERR_OPERATION_INVALID/

2011-08-23  Osier Yang  <jyang@redhat.com>

	nodeinfo: Cleanup improper VIR_ERR_NO_SUPPORT use

2011-08-23  Osier Yang  <jyang@redhat.com>

	lxc: Cleanup improper VIR_ERR_NO_SUPPORT use
	s/VIR_ERR_NO_SUPPORT/VIR_ERR_OPERATION_INVALID/

	Special case is changes on lxcDomainInterfaceStats, if it's not
	implemented on the platform, prints error like:

	    lxcError(VIR_ERR_OPERATION_INVALID, "%s",
	             _("interface stats not implemented on this platform"));

	As the function is supported by driver actually, error like
	VIR_ERR_NO_SUPPORT is confused.

2011-08-23  Osier Yang  <jyang@redhat.com>

	conf: Cleanup improper use of VIR_ERR_NO_SUPPORT in node_device_conf

	qemu: Substitute VIR_ERR_NO_SUPPORT with VIR_ERR_OPERATION_INVALID
	* src/qemu/qemu_monitor_text.c: Error like "this function is not
	supported by the connection driver" is confused obviously.

	virsh: Print error if specified bandwidth is invalid for blockjob
	It's strange that the command fails but without any error if one
	specifies as not a number.

2011-08-22  KAMEZAWA Hiroyuki  <kamezawa.hiroyu@jp.fujitsu.com>

	send-key: fix scan keycode map
	Now, bad key-code in send-key can cause segmentation fault in libvirt.
	(example)
	 % virsh send-key --codeset win32 12
	   error: End of file while reading data: Input/output error

	This is caused by overrun at scanning keycode array.

	Fix it.

2011-08-22  Eric Blake  <eblake@redhat.com>

	build: work around older systemtap header
	Systemtap 1.2 <sys/sdt.h> tried to expand STAP_PROBE3 into an
	initialization:
	  volatile __typeof__(arg) foo = arg;
	but that fails if arg was declared as 'char arg[100]'.
	Rather than make all callers to PROBE deal with the stupidity
	of <sys/sdt.h>, we instead make PROBE cast away the problem.
	Some of this preprocessor abuse copies ideas in src/libvirt.c.

	* daemon/libvirtd.h (PROBE): Add casts to all arguments, using...
	(VIR_ADD_CASTS, VIR_ADD_CAST, VIR_ADD_CAST2, VIR_ADD_CAST3)
	(VIR_ADD_CAST_EXPAND, VIR_ADD_CAST_PASTE, VIR_COUNT_ARGS)
	(VIR_ARG5, PROBE_EXPAND): New macros.
	Reported by Wen Congyang.

2011-08-19  Eric Blake  <eblake@redhat.com>

	virsh: properly interleave shared stdout and stderr
	Without this patch, invoking 'virsh >file 2>&1' results in
	error messages appearing before normal output, even if they
	occurred later in time than the normal output (since stderr
	is unbuffered, but stdout waits until a full buffer).

	* tools/virsh.c (print_job_progress, vshError): Flush between
	stream transitions.
	* tests/undefine: Test it.

2011-08-19  Eric Blake  <eblake@redhat.com>

	maint: simplify lots of libxml2 clients
	Repetitive patterns should be factored.  The sign of a good
	factorization is a change that kills 5x more lines than it adds :)

	* src/conf/domain_conf.c (virDomainDeviceDefParse)
	(virDomainSnapshotDefParseString): Use new convenience macros.
	* src/conf/storage_conf.c (virStoragePoolDefParseSourceString):
	Likewise.
	* src/cpu/cpu.c (cpuCompareXML, cpuBaselineXML): Likewise.
	* src/esx/esx_vi.c (esxVI_Context_Execute): Likewise.
	* src/qemu/qemu_migration.c (qemuMigrationCookieXMLParseStr):
	Likewise.
	* src/security/virt-aa-helper.c (caps_mockup): Likewise.
	* src/test/test_driver.c (testOpenFromFile): Likewise.
	* tests/cputest.c (cpuTestLoadXML, cpuTestLoadMultiXML):
	Likewise.
	* tools/virsh.c (cmdFreecell, makeCloneXML, cmdVNCDisplay)
	(cmdTTYConsole, cmdDetachInterface, cmdDetachDisk)
	(cmdSnapshotCreate, cmdSnapshotCreateAs, cmdSnapshotCurrent)
	(cmdSnapshotList, cmdSnapshotParent): Likewise.

2011-08-19  Eric Blake  <eblake@redhat.com>

	xml: add another convenience function
	Often, we want to use XPath functions on the just-parsed document;
	fold this into the parser function for convenience.

	* src/util/xml.h (virXMLParseHelper): Add argument.
	(virXMLParseStrHelper, virXMLParseFileHelper): Delete.
	(virXMLParseCtxt, virXMLParseStringCtxt, virXMLParseFileCtxt): New
	macros.
	* src/libvirt_private.syms (xml.h): Remove deleted functions.
	* src/util/xml.c (virXMLParseHelper): Add argument.
	(virXMLParseStrHelper, virXMLParseFileHelper): Delete.

2011-08-19  Eric Blake  <eblake@redhat.com>

	maint: treat more libxml2 functions as free-like
	* cfg.mk (useless_free_options): Add xmlFreeDoc, xmlBufferFree.
	* src/esx/esx_vi.c (ESX_VI__TEMPLATE__FREE): Fix offenders.
	* tools/virsh.c (cmdFreecell, cmdVNCDisplay, cmdTTYConsole)
	(cmdDetachInterface, cmdDetachDisk, cmdSnapshotCreate)
	(cmdSnapshotCreateAs, cmdSnapshotList, cmdSnapshotParent):
	Likewise.

2011-08-19  Eric Blake  <eblake@redhat.com>

	test: rewrite test to match change in behavior
	Test failure exposed in commit 7d3390f.

	* tests/undefine: Fix to match updated test driver semantics.

2011-08-19  Eric Blake  <eblake@redhat.com>

	build: fix typo in recent test patch
	* src/test/test_driver.c (testDomainUndefineFlags): Use right
	variable name.

2011-08-19  Eric Blake  <eblake@redhat.com>

	Revert "xen: Allow to undefine a running domain (xm_internal)"
	ACK was given too soon.  According to the code, the xm driver is
	only used for inactive domains, and has no notion of an active
	domain, thus, it cannot support undefine of a running domain.
	The real fix for xen needs to be in the unified driver and/or
	the xend level.

	This reverts commit 49186deda62161599877b0de6f7f4345c50d842a.

2011-08-19  Osier Yang  <jyang@redhat.com>

	xen: Allow to undefine a running domain (xm_internal)

	vmware: Allow to undefine a running domain

	uml: Allow to undefine a running domain

	test: Allow to undefine a running domain

	qemu: Allow to undefine a running domain

	openvz: Allow to undefine a running domain

	lxc: Allow to undefine a running domain

	libxl: Allow to undefine a running domain.
	Undefining a running domain will convert it to trasient, but keep
	the domain still running.

	qemu: Get memory balloon info correctly for text monitor
	* src/qemu/qemu_monitor_text.c: BALLOON_PREFIX was defined as
	"balloon: actual=", which cause "actual=" is stripped early before
	the real parsing. This patch changes BALLOON_PREFIX into "balloon: ",
	and modifies related functions, also renames
	"qemuMonitorParseExtraBalloonInfo" to "qemuMonitorParseBalloonInfo",
	as after the changing, it parses all the info returned by "info balloon".

2011-08-19  Eric Blake  <eblake@redhat.com>

	build: fix compilation on mingw64
	* .gnulib: Update to latest, for getcwd fixes.
	* bootstrap: Resync to gnulib.

2011-08-19  Michal Privoznik  <mprivozn@redhat.com>

	storage: Flush host cache after write
	Although we are flushing cache after some critical writes (e.g.
	volume creation), after some others we do not (e.g. volume cloning).
	This patch fix this issue. That is for volume cloning, writing
	header of logical volume, and storage wipe.

2011-08-19  Michal Privoznik  <mprivozn@redhat.com>

	daemon: initialize GnuTLS
	When spice_tls is set but listen_tls is not, we don't initialize
	GnuTLS library. So any later gnutls call (e.g. during migration,
	where we initialize a certificate) will access uninitialized GnuTLS
	internal structs and throws an error.

	Although, we might now initialize GnuTLS twice, it is safe according
	to the documentation:

	    This function can be called many times,
	    but will only do something the first time.

	This patch creates 2 functions: virNetTLSInit and virNetTLSDeinit
	with respect to written above.

2011-08-19  Taku Izumi  <izumi.taku@jp.fujitsu.com>

	schedinfo: add missing documentation
	This patch adds the missing documentation about the scheduler parameter
	"vcpu_period" and "vcpu_quota".

2011-08-19  Eric Blake  <eblake@redhat.com>

	maint: ignore generated file
	I did 'git add .' while in the middle of 'make syntax-check', and
	it picked up a temporary file that should not be committed.

	* .gitignore: Ignore sc_* from syntax check.

2011-08-18  Eric Blake  <eblake@redhat.com>

	build: fix virnetsocket on mingw
	Regression introduced in commit 5d30db0.

	* src/rpc/virnetsocket.c (virNetSocketNewListenUNIX) [WIN32]: Use
	correct signature.

2011-08-18  Eric Blake  <eblake@redhat.com>

	build: fix virpidfile on mingw
	Regression introduced in commit b7e5ca4.

	Mingw lacks kill(), but we were only using it for a sanity check;
	so we can go with one less check.

	Also, on OOM error, this function should outright fail rather than
	claim that the pid file was successfully read.

	* src/util/virpidfile.c (virPidFileReadPathIfAlive): Skip kill
	call where unsupported, and report error on OOM.

2011-08-18  Daniel P. Berrange  <berrange@redhat.com>

	Ensure async packets never get marked for sync replies
	If a client had initiated a stream abort, it will have a call
	waiting for a reply in the queue. If more data continues to
	arrive on the stream, the abort command could mistakenly get
	signalled as complete. Remove the code from async data processing
	that looked for waiting calls. Add a sanity check to ensure no
	async call can ever be marked as needing a reply

	* src/rpc/virnetclient.c: Ensure async data packets can't
	  trigger a reply

2011-08-18  Daniel P. Berrange  <berrange@redhat.com>

	Don't attempt to read from a stream if it is closed
	The I/O event callback processes incoming packets first, and then
	does outgoing packets. If the incoming packet caused the stream to
	close, then the attempt to process outgoing data resulted in an
	error. This caused libvirt to then send an error back to the client,
	but the stream had already been stopped. This confused the client
	since it sees 2 error events.

	* daemon/stream.c: Don't attempt read if stream is closed

2011-08-17  Tom Vijlbrief  <tom.vijlbrief@xs4all.nl>

	qemu: disk migration verbose progress
	A virsh command like:

	migrate --live --copy-storage-all Guest qemu+ssh://user@host/system
	--persistent --verbose

	shows

	Migration: [  0 %]

	during the storage copy and does not start counting
	until the ram transfer starts

	Fix this by scraping optional disk transfer status, and adding it
	into the progress meter.

2011-08-17  Eric Blake  <eblake@redhat.com>

	virsh: concatenate qemu-monitor-command arguments
	Call me lazy, but:

	virsh qemu-monitor-command dom --hmp info status

	is nicer than:

	virsh qemu-monitor-command dom --hmp 'info status'

	* tools/virsh.c (cmdQemuMonitorCommand): Allow multiple arguments,
	for convenience.

2011-08-17  Osier Yang  <jyang@redhat.com>

	qemu: Init reattaching related members of pciDevice before reattach
	Otherwise the device will still be bound to pci-stub driver even
	it's set as "managed=yes" when do detaching. Of course, it won't
	triger any driver reprobing too.

2011-08-17  Eric Blake  <eblake@redhat.com>

	virsh: tweak misleading wording
	Fixes confusing docs introduced in commit 98369d3.

	* tools/virsh.c (cmdSnapshotParent): Operates on named snapshot,
	not current.

2011-08-17  Daniel P. Berrange  <berrange@redhat.com>

	Tweak debugging message in RPC client code
	Make it clearer that a log message is for an outgoing message

2011-08-17  Daniel P. Berrange  <berrange@redhat.com>

	Fix race condition in abort of stream
	If a stream gets a server initiated abort, the client may still
	send an abort request before it receives the server side abort.
	This causes the server to send back another abort for the
	stream. Since the protocol defines that abort is the last thing
	to be sent, the client gets confused by this second abort from
	the server. If the stream is already shutdown, just drop any
	client requested abort, rather than sending back another message.
	This fixes the regression from previous versions.

	Tested as follows

	In one virsh session

	  virsh # start foo
	  virsh # console foo

	In other virsh session

	  virsh # destroy foo

	The first virsh session should be able to continue issuing
	commands without error. Prior to this patch it saw

	  virsh # list
	  error: Failed to list active domains
	  error: An error occurred, but the cause is unknown

	  virsh # list
	  error: Failed to list active domains
	  error: no call waiting for reply with prog 536903814 vers 1 serial 9

	* src/rpc/virnetserverprogram.c: Drop abort requests
	  for streams which no longer exist

2011-08-17  Daniel P. Berrange  <berrange@redhat.com>

	Ensure client streams are closed when marking a client for close
	Every active stream results in a reference being held on the
	virNetServerClientPtr object. This meant that if a client quit
	with any streams active, although all I/O was stopped the
	virNetServerClientPtr object would leak. This causes libvirtd
	to leak any file handles associated with open streams when a
	client quit

	To fix this, when we call virNetServerClientClose there is a
	callback invoked which lets the daemon release the streams
	and thus the extra references

	* daemon/remote.c: Add a hook to close all streams
	* daemon/stream.c, daemon/stream.h: Add API for releasing
	  all streams
	* src/rpc/virnetserverclient.c, src/rpc/virnetserverclient.h:
	  Allow registration of a hook to trigger when closing client

2011-08-17  Daniel P. Berrange  <berrange@redhat.com>

	Ensure stream is aborted when exiting console
	After running 'virsh console' in interactive mode, there was a
	missing call to virStreamAbort, which meant the server kept the
	stream resources open

	* tools/console.c: Abort stream when exiting

2011-08-17  Stefan Berger  <stefanb@us.ibm.com>

	maint: fix some compilation issues on non-linux platforms (part 2)
	Get rid of the #if __linux__ check in virPidFileReadPathIfAlive that
	was preventing a check of a symbolic link in /proc/<pid>/exe on
	non-linux platforms against an expected executable. Replace
	this with a run-time check testing whether the /proc/<pid>/exe is a
	symbolic link and if so call the function doing the comparison
	against the expected file the link is supposed to point to.

	maint: fix some compilation issues on non-linux platforms
	This patch fixes *some* compilation issues on non-Linux platforms (cygwin).

2011-08-17  Peter Krempa  <pkrempa@redhat.com>

	daemon: Add early libvirtd start verbose errors.
	Early errors during start of libvirtd didn't have
	an error reporting mechanism and caused libvirtd
	to exit silently (only the return value indicated
	an error).

	Libvirt logging is initialized very early using
	enviroment variables and the internal error reporting
	API is used to report early errors.

	 v2 changes:
	 - print errors unconditionaly before logging starts
	 - fix message to US spelling
	 v2.5 changes:
	 - initialize logging from enviroment
	 - log all early errors using VIR_ERROR
	 v3 changes:
	 - move virSetLogFromEnv() after virInitialize()

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

2011-08-17  Stefan Berger  <stefanb@us.ibm.com>

	maint: add missing symbols
	Add missing symbols to libvirt_private.syms.

2011-08-16  Roopa Prabhu  <roprabhu@cisco.com>

	macvtap: Fix getPhysfn to get the PF of a direct attach network interface
	This patch renames getPhysfn to getPhysfnDev and adds code to get the
	Physical function and Virtual Function index of the direct attach linkdev (if
	the direct attach interface is a SRIOV VF). The idea is to send the port
	profile message to a PF if the direct attach interface is a SRIOV VF.

	interface: Add functions to get sriov PF/VF relationship of a net interface
	This patch adds the following functions to get PF/VF relationship of an SRIOV
	network interface:
	ifaceIsVirtualFunction: Function to check if a network interface is a SRIOV VF
	ifaceGetVirtualFunctionIndex: Function to get VF index if a network interface is a SRIOV VF
	ifaceGetPhysicalFunction: Function to get the PF net interface name of a SRIOV VF net interface

	pci: Add helper functions for sriov devices
	This patch adds the following helper functions:
	pciDeviceIsVirtualFunction: Function to check if a pci device is a sriov VF
	pciGetVirtualFunctionIndex: Function to get the VF index of a sriov VF
	pciDeviceNetName: Function to get the network device name of a pci device
	pciConfigAddressCompare: Function to compare pci config addresses

	pci: Move some pci sriov helper code out of node device driver to util/pci
	This patch moves some of the sriov related pci code from node_device driver
	to src/util/pci.[ch]. Some functions had to go thru name and argument list
	change to accommodate the move.

2011-08-16  Eric Blake  <eblake@redhat.com>

	maint: ignore generated file
	* .gitignore: Ignore qemu-sanlock.conf.

2011-08-15  Laine Stump  <laine@laine.org>

	qemu: support event_idx parameter for virtio disk and net devices
	In some versions of qemu, both virtio-blk-pci and virtio-net-pci
	devices can have an event_idx setting that determines some details of
	event processing. When it is enabled, it "reduces the number of
	interrupts and exits for the guest". qemu will automatically enable
	this feature when it is available, but there may be cases where this
	new feature could actually make performance worse (NB: no such case
	has been found so far).

	As a safety switch in case such a situation is encountered in the
	field, this patch adds a new attribute "event_idx" to the <driver>
	element of both disk and interface devices. event_idx can be set to
	"on" (to force event_idx on in case qemu has it disabled by default)
	or "off" (for force event_idx off). In the case that event_idx support
	isn't present in qemu, the attribute is ignored (this on the advice of
	the qemu developer).

	docs/formatdomain.html.in: document the new flag (marking it as
	   "don't mess with this!"
	docs/schemas/domain.rng: add event_idx in appropriate places
	src/conf/domain_conf.[ch]: add event_idx to parser and formatter
	src/libvirt_private.syms: export
	   virDomainVirtioEventIdx(From|To)String
	src/qemu/qemu_capabilities.[ch]: detect and report event_idx in
	   disk/net
	src/qemu/qemu_command.c: add event_idx parameter to qemu commandline
	    when appropriate.
	tests/qemuxml2argvdata/qemuxml2argv-event_idx.args,
	tests/qemuxml2argvdata/qemuxml2argv-event_idx.xml,
	tests/qemuxml2argvtest.c,
	tests/qemuxml2xmltest.c: test cases for event_idx.

2011-08-15  Peter Krempa  <pkrempa@redhat.com>

	qemu: error message should show uri instead of (null)
	Fix pointer for error message uri if domain migration fails.

	BZ# 730244

2011-08-15  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Use fd: protocol for migration
	By opening a connection to remote qemu process ourselves and passing the
	socket to qemu we get much better errors than just "migration failed"
	when the connection is opened by qemu.

	qemu: Use virNetSocket for tunneled migration

	qemu: Refactor do{Tunnel,Native}Migrate functions
	The core of these two functions is very similar and most of it is even
	exactly the same. Factor out the core functionality into a separate
	function to remove code duplication and make further changes easier.

	Support changing UNIX socket owner in virNetSocketNewListenUNIX
	This patch allows owner's UID to be changed as well.

	Add backlog parameter to virNetSocketListen
	So that callers can change the default value.

2011-08-15  Daniel P. Berrange  <berrange@redhat.com>

	Add API for duplicating a socket/client file descriptor
	* src/rpc/virnetsocket.c, src/rpc/virnetsocket.h: Add
	  virNetSocketDupFD()
	* src/rpc/virnetclient.c, src/rpc/virnetclient.h: Add
	  virNetClientDupFD() and virNetClientGetFD()

2011-08-15  Douglas Schilling Landgraf  <dougsland@redhat.com>

	libvirtd.init.in: stop/restart() - wrong return value in case of failure
	The function stop() was always returning 0 (OK) from killproc() even
	in case of error.

2011-08-15  Osier Yang  <jyang@redhat.com>

	daemon: Fix regression of libvirtd reloading support
	This is introduced by commit df0b57a95a, which forgot to
	add signal handler for SIGHUP.

	A simple reproduce method:

	1) Create a domain XML under /etc/libvirt/qemu
	2) % kill -SIGHUP $(pidof libvirtd)
	3) % virsh list --all (the new created domain XML is not listed)

2011-08-13  Eric Blake  <eblake@redhat.com>

	maint: let emacs avoid tabs in rng files
	* .dir-locals.el: Add nxml-mode preferences.

2011-08-13  Philipp Hahn  <hahn@univention.de>

	Swap virDomain / virFomainSnapshot declaration
	In preparation for storing the domain description with the snapshot,
	swap the order of declaration.

2011-08-13  Eric Blake  <eblake@redhat.com>

	build: fix recent build failures
	With gcc 4.5.1:

	util/virpidfile.c: In function 'virPidFileAcquirePath':
	util/virpidfile.c:308:66: error: nested extern declaration of '_gl_verify_function2' [-Wnested-externs]

	Then in tests/commandtest.c, the new virPidFile APIs need to be used.

	* src/util/virpidfile.c (virPidFileAcquirePath): Move verify to
	top level.
	* tests/commandtest.c: Use new pid APIs.

2011-08-13  Daniel P. Berrange  <berrange@redhat.com>

	Convert libvirtd to use crash-safe pidfile APIs
	Remove the current libvirtd pidfile handling code, in favour of
	calling out to the new APIs. This ensures libvirtd's pidfile
	handling is crashsafe

	This also means that the non-root libvirtd instances (for handling
	qemu:///session URIs) can now safely use pidfiles without racing

	* daemon/libvirtd.c: Switch to use virPidFileAcquire and
	  virPidFileRelease

2011-08-13  Daniel P. Berrange  <berrange@redhat.com>

	Add some APIs which use locking for crashsafe pidfile handling
	In daemons using pidfiles to protect against concurrent
	execution there is a possibility that a crash may leave a stale
	pidfile on disk, which then prevents later restart of the daemon.

	To avoid this problem, introduce a pair of APIs which make
	use of virFileLock to ensure crash-safe & race condition-safe
	pidfile acquisition & releae

	* src/libvirt_private.syms, src/util/virpidfile.c,
	  src/util/virpidfile.h: Add virPidFileAcquire and virPidFileRelease

2011-08-13  Daniel P. Berrange  <berrange@redhat.com>

	Introduce functions for checking whether a pidfile is valid
	In some cases the caller of virPidFileRead might like extra checks
	to determine whether the pid just read is really the one they are
	expecting. This adds virPidFileReadIfAlive which will check whether
	the pid is still alive with kill(0, -1), and (on linux only) will
	look at /proc/$PID/path

	* libvirt_private.syms, util/virpidfile.c, util/virpidfile.h: Add
	  virPidFileReadIfValid and virPidFileReadPathIfValid
	* network/bridge_driver.c: Use new APIs to check PID validity

2011-08-13  Daniel P. Berrange  <berrange@redhat.com>

	Move pidfile functions into util/virpidfile.{c,h}
	The functions for manipulating pidfiles are in util/util.{c,h}.
	We will shortly be adding some further pidfile related functions.
	To avoid further growing util.c, this moves the pidfile related
	functions into a dedicated virpidfile.{c,h}. The functions are
	also all renamed to have 'virPidFile' as their name prefix

	* util/util.h, util/util.c: Remove all pidfile code
	* util/virpidfile.c, util/virpidfile.h: Add new APIs for pidfile
	  handling.
	* lxc/lxc_controller.c, lxc/lxc_driver.c, network/bridge_driver.c,
	  qemu/qemu_process.c: Add virpidfile.h include and adapt for API
	  renames

2011-08-13  Daniel P. Berrange  <berrange@redhat.com>

	Add virFileLock and virFileUnlock APIs
	Add some simple wrappers around the fcntl() discretionary file
	locking capability.

	* src/util/util.c, src/util/util.h, src/libvirt_private.syms: Add
	  virFileLock and virFileUnlock APIs

2011-08-13  Eric Blake  <eblake@redhat.com>

	virsh: fix dead store
	Two copy-and-paste bugs in a row.  :(

	* tools/virsh.c (cmdUndefine): Also avoid dead store.

2011-08-13  Eric Blake  <eblake@redhat.com>

	virsh: fix logic bug
	Bug introduced in commit 9a0ec36.

	* tools/virsh.c (cmdUndefine): Add missing line.

2011-08-12  Eric Blake  <eblake@redhat.com>

	vbox, xenapi: add virDomainUndefineFlags
	We forgot to add virDomainUndefineFlags for a couple of hypervisors.
	This wires up trivial versions (since neither hypervisor supports
	managed save yet, they do not need to support any flags).

	* src/vbox/vbox_tmpl.c (vboxDomainCreateXML): Update caller.
	(vboxDomainUndefine): Move guts...
	(vboxDomainUndefineFlags): ...to new function.
	* src/xenapi/xenapi_driver.c (xenapiDomainUndefine)
	(xenapiDomainUndefineFlags): Likewise.

2011-08-12  Eric Blake  <eblake@redhat.com>

	virsh: don't reject undefine on active domain
	The public API documents that undefine may be used to transition a
	running persistent domain into a transient one.  Many drivers still
	do not support this usage, but virsh shouldn't be getting in the
	way of those that do support it.

	This also drops a redundant conditional; vshCommandOptString
	guaranteed that name was non-NULL.

	* tools/virsh.c (cmdUndefine): Allow undefine on active domains;
	the drivers may still reject it, but it is a valid API usage.
	* tests/undefine (error): Fix the test to match.

2011-08-12  Philipp Hahn  <hahn@univention.de>

	Improve tokenizing of linkable terms
	Currently only tabs and blanks are used for tokenizing the description,
	which breaks when a term is at the end of a line or has () appended to
	it.
	1. Use also other white space characters such as new-lines and carriage
	   return for splitting.
	2. Remove some common non-word characters from the token before lookup.

2011-08-12  Daniel P. Berrange  <berrange@redhat.com>

	Add some docs about the RPC protocol and APIs
	* remote.html.in: Remove obsolete notes about internals of the
	  RPC protocol
	* internals/rpc.html.in: Extensive docs on RPC protocol/API
	* sitemap.html.in: Add new page

2011-08-12  Philipp Hahn  <hahn@univention.de>

	Align table cells on top
	When the description of an entry is too long and needs multiple lines,
	all other table cells of the same row are currently vertically aligned
	on center. Without row borders or different background colors for
	alternating rows this is hard to read.

	Change the style-sheet to align the table cells of a row on top.

2011-08-12  Peter Krempa  <pkrempa@redhat.com>

	virsh: Add dir type for listing volumes with vol-list
	Fix of output of detailed volume list. BZ #727088

2011-08-12  Peter Krempa  <pkrempa@redhat.com>

	storage: Directory shouldn't be listed as type 'file'
	Fix internals of libvirt for new storage volume type.
	Libvirt reported an invalid type of the volume.

	BZ #727088

2011-08-12  Eric Blake  <eblake@redhat.com>

	virsh: add snapshot-parent
	Down the road, I want to add virDomainSnapshotGetParent, and use
	the new API rather than xml scraping; but this virsh command can
	be implemented even without the new API.

	* tools/virsh.c (cmdSnapshotParent): New command.
	* tools/virsh.pod (snapshot-parent): Document it.

2011-08-12  Eric Blake  <eblake@redhat.com>

	qemu: silence clang false positive
	Our logic throws off analyzer tools:

	ptr var = NULL;
	if (flags == 0) flags = live ? _LIVE : _CONFIG;
	if (flags & _LIVE) do stuff
	if (flags & _CONFIG) var = non-null;
	if (flags & _LIVE) do more stuff
	else if (flags & _CONFIG) use var

	the tools keep thinking that var can still be NULL in the last
	if clause, adding the hint shuts them up.

	* src/qemu/qemu_driver.c (qemuDomainSetBlkioParameters): Add a
	static analysis hint.

2011-08-12  Laine Stump  <laine@laine.org>

	network: eliminate potential memory leak on parse failure
	While the first encountered dns host record is being parsed, it's
	possible for virNetworkDef::hosts to point to memory that has been
	allocated, but virNetworkDef::nhosts to still be 0. If there is a
	failure during that time, virNetworkDef::hosts will be leaked.

	Although this isn't currently the case for virNetworkDef::txtrecords,
	it could become that way through future re-factoring, and it hurts
	nothing to restructure the freeing of txtrecord data to match that of
	hosts data.

2011-08-11  Stefan Berger  <stefanb@us.ibm.com>

	nwfilter: tolerate disappearing interfaces while instantiating filter
	When instantiating a filter, a VM may disappear and remove its tap interfaces. Tolerate this case and don't report an error.

2011-08-11  Cole Robinson  <crobinso@redhat.com>

	qemu: Fix -chardev udp if parameters are omitted
	The following XML:

	    <serial type='udp'>
	      <source mode='connect' service='9999'/>
	    </serial>

	is accepted by domain_conf.c but maps to the qemu command line:

	-chardev udp,host=127.0.0.1,port=2222,localaddr=(null),localport=(null)

	qemu can cope with everything omitting except the connection port, which
	seems to also be the intent of domain_conf validation, so let's not
	generate bogus command lines for that case.
	The defaults are empty strings for addresses and 0 for the localport

	Additionally, tweak the qemu cli parsing to handle omitted host
	parameters
	for -serial udp

2011-08-11  Laine Stump  <laine@laine.org>

	docs: use IPv6 addresses in range reserved for documentation
	Someone in an IRC channel or an email pointed out a few days ago that
	the examples of IPv6 addresses in the libvirt documentation were not
	in the officially reserved "documentation" range. This addresses their
	concern.

2011-08-11  Eric Blake  <eblake@redhat.com>

	virsh: add virsh snapshot-current --name
	Sometimes, full XML is too much; since most snapshot commands
	operate on a snapshot name, there should be an easy way to get
	at the current snapshot's name.  For example:

	virsh snapshot-revert dom `virsh snapshot-current dom --name`

	* tools/virsh.c (cmdSnapshotCurrent): Add an option.
	* tools/virsh.pod (snapshot-current): Document it.

2011-08-11  Eric Blake  <eblake@redhat.com>

	virsh: fix snapshot-create-as to handle arbitrary names
	Found this working on the next patch to use xpath to parse
	arbitrary names back out.

	* tools/virsh.c (cmdSnapshotCreateAs): Escape user input.

2011-08-11  Eric Blake  <eblake@redhat.com>

	managedsave: prohibit use on transient domains
	Transient domains reject attempts to set autostart, and using
	virDomainCreate to restart a domain only works on persistent
	domains.  Therefore, managed save makes no sense on transient
	domains, and should be rejected up front rather than creating
	an otherwise unrecoverable managed save file.

	Besides, transient domains imply that a lot more management is
	being done by the upper layer; this includes the assumption
	that the upper layer is okay managing the saved state file
	created by virDomainSave, and does not need to use managed save.

	* src/libvirt.c: Document that transient domains are incompatible
	with managed save.
	* src/qemu/qemu_driver.c (qemuDomainManagedSave): Enforce it.
	* src/libxl/libxl_driver.c (libxlDomainManagedSave): Likewise.

2011-08-11  Laine Stump  <laine@laine.org>

	docs: describe new virtual switch configuration in network XML docs
	This should have been done with the rest of the patch for virtual
	switch / network device abstraction. If documents the new elements
	(and new usage of existing elements) in the <network> XML to support
	libvirt networks that use existing host bridges and macvtap direct
	connections, as well as the new <portgroup> element.

2011-08-10  Juerg Haefliger  <juerg.haefliger@hp.com>

	Bugfix: Check stdoutWatch before removing the handler.

2011-08-10  Eric Blake  <eblake@redhat.com>

	qemu: minor formatting cleanup
	I noticed some inconsistent use of 'else'.

	* src/qemu/qemu_driver.c (qemuCPUCompare)
	(qemuDomainSnapshotCreateXML, qemuDomainRevertToSnapshot)
	(qemuDomainSnapshotDiscard): Match coding conventions.

2011-08-10  Philipp Hahn  <hahn@univention.de>

	Fix memory leak while scanning snapshots
	If a snapshot with the name already exists, virDomainSnapshotAssignDef()
	just returns NULL, in which case the snapshot definition is leaked.
	Currently this leak is not a big problem, since qemuDomainSnapshotLoad()
	is only called once during initial startup of libvirtd.

2011-08-08  Eric Blake  <eblake@redhat.com>

	build: fix regression in large file support
	* .gnulib: Update to latest, for largefile fix.

2011-08-08  Daniel P. Berrange  <berrange@redhat.com>

	Allow use of file images for LXC container filesystems
	A previous commit gave the LXC driver the ability to mount
	block devices for the container filesystem. Through use of
	the loopback device functionality, we can build on this to
	support use of plain file images for LXC filesytems.

	By setting the LO_FLAGS_AUTOCLEAR flag we can ensure that
	the loop device automatically disappears when the container
	dies / shuts down

	* src/lxc/lxc_container.c: Raise error if we see a file
	  based filesystem, since it should have been turned into
	  a loopback device already
	* src/lxc/lxc_controller.c: Rewrite any filesystems of
	  type=file, into type=block, by binding the file image
	  to a free loop device

2011-08-08  Daniel P. Berrange  <berrange@redhat.com>

	Fix typo in LXC cgroups setup error message
	* src/lxc/lxc_controller.c: s/PYT/PTY/

2011-08-08  Daniel P. Berrange  <berrange@redhat.com>

	Allow use of block devices for guest filesystem
	Currently the LXC driver can only populate filesystems from
	host filesystems, using bind mounts. This patch allows host
	block devices to be mounted. It autodetects the filesystem
	format at mount time, and adds the block device to the cgroups
	ACL. Example usage is

	    <filesystem type='block' accessmode='passthrough'>
	      <source dev='/dev/sda1'/>
	      <target dir='/home'/>
	    </filesystem>

	* src/lxc/lxc_container.c: Mount block device filesystems
	* src/lxc/lxc_controller.c: Add block device filesystems
	  to cgroups ACL

2011-08-08  Daniel P. Berrange  <berrange@redhat.com>

	Don't mount /dev for application containers
	An application container shouldn't get a private /dev. Fix
	the regression from 6d37888e6a35a37e6faf7c0a1b1b4d9a5dee1285

	* src/lxc/lxc_container.c: Don't mount /dev for app containers

2011-08-06  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Avoid overwriting errors from virGetHostname

2011-08-05  Eric Blake  <eblake@redhat.com>

	qemu: avoid crash on process attach
	Detected by ccc-analyzer, reported by Alex Jia.

	qemuProcessStart always calls qemuProcessWaitForMonitor with a
	non-negative position, but qemuProcessAttach always calls with -1.
	In the latter case, there is no log file we can scrape, so we
	also should not be trying to scrape the logs if the qemu process
	died at the very end.

	* src/qemu/qemu_process.c (qemuProcessWaitForMonitor): Don't try
	to read from log in qemuProcessAttach case.

2011-08-05  Laine Stump  <laine@laine.org>

	network: eliminate lag in updating dnsmasq hosts files
	This addresses https://bugzilla.redhat.com/show_bug.cgi?id=713728

	When "defining" a new network (or one that exists but isn't currently
	active) the new definition is stored in network->def, but for a
	network that already exists and is active, the new definition is
	stored in network->newDef, and then moved over to network->def as soon
	as the network is destroyed.

	However, the code that writes the dhcp and dns hosts files used by
	dnsmasq was always using network->def for its information, even when
	the new data was actually in network->newDef, so the hosts files
	always lagged one edit behind the definition.

	This patch changes the code to keep the pointer to the new definition
	after it's been assigned into the network, and use it directly
	(regardless of whether it's stored in network->newDef or network->def)
	to construct the hosts files.

2011-08-04  Alex Jia  <ajia@redhat.com>

	qemu: avoid dead store in qemuMonitorTextBlockJob
	Value stored to 'ret' is never read, so remove this dead assignment.

	* src/qemu/qemu_monitor_text.c: kill dead assignment.

2011-08-04  Alex Jia  <ajia@redhat.com>

	qemu: avoid dead store in qemuProcessStart
	Value stored to 'ret' is never read, in fact, 'cleanup' section will
	directly return -1 when function is fail, so remove this dead assignment.

	* src/qemu/qemu_process.c: kill dead assignment.

2011-08-04  Guannan Ren  <gren@redhat.com>

	rpc:fix sasl session relocking intead of unlocking it
	When trying to use any SASL authentication for TCP sockets by
	setting auth_tls = "sasl" in libvirtd.conf on server side, the
	client will hang because of the sasl session relocking other than
	dropping the lock when exiting virNetSASLSessionExtKeySize()
	* src/rpc/virnetsaslcontext.c: virNetSASLSessionExtKeySize drop the
	  lock on exit

2011-08-04  Osier Yang  <jyang@redhat.com>

	daemon: Unlink unix socket paths on shutdown
	This patch introduces a internal RPC API "virNetServerClose", which
	is standalone with "virNetServerFree".  it closes all the socket fds,
	and unlinks the unix socket paths, regardless of whether the socket
	is still referenced or not.

	This is to address regression bug:
	https://bugzilla.redhat.com/show_bug.cgi?id=725702

2011-08-04  Eric Blake  <eblake@redhat.com>

	build: update to latest gnulib
	I noticed that with 0.9.4, gnulib ended up replacing pthread_sigmask
	on glibc, even though glibc's works perfectly fine.  It turns out
	to have been an upstream gnulib bug.

	* .gnulib: Update to latest, for pthread_sigmask fix.

2011-08-04  Matthias Bolte  <matthias.bolte@googlemail.com>

	Fix detection of GnuTLS 1.x.y
	Detection based on gnutls_session doesn't work because GnuTLS 2.x.y
	comes with a compat.h that defines gnutls_session to gnutls_session_t.

	Instead detect this based on LIBGNUTLS_VERSION_MAJOR. Move this from
	configure/config.h to gnutls_1_0_compat.h and make sure that all users
	include gnutls_1_0_compat.h properly.

	Also fix header guard in gnutls_1_0_compat.h.

2011-08-03  Daniel Veillard  <veillard@redhat.com>

	Release of libvirt-0.9.4
	* configure.ac docs/news.html.in libvirt.spec.in: updates for new
	  release
	* po/*.po*: pulled translations from the transifex teams and regenerated
	  localizations

2011-08-03  Eric Blake  <eblake@redhat.com>

	qemu: silence coverity false positives
	Coverity gets confused by our logic.  Add some hints to silence
	false positives.

	* src/qemu/qemu_driver.c (qemudDomainGetVcpuPinInfo): Add hint.
	(qemuDomainGetMemoryParameters): Likewise.

2011-08-03  Eric Blake  <eblake@redhat.com>

	util: plug memory leak
	Leak detected by Coverity; only possible on unlikely ptsname_r
	failure.  Additionally, the man page for ptsname_r states that
	failure is merely non-zero, not necessarily -1.

	* src/util/util.c (virFileOpenTtyAt): Avoid leak on ptsname_r
	failure.

2011-08-03  Eric Blake  <eblake@redhat.com>

	interface: drop dead code
	Coverity detected that ifaceGetNthParent had already dereferenced
	'nth' prior to the conditional; all callers already complied with
	passing a non-NULL pointer so make this part of the contract.

	* src/util/interface.h (ifaceGetNthParent): Add annotations.
	* src/util/interface.c (ifaceGetNthParent): Drop useless null check.

2011-08-03  Eric Blake  <eblake@redhat.com>

	rpc: silence coverity false positives
	In virNetServerNew, Coverity didn't realize that srv->mdsnGroupName
	can only be non-NULL if mdsnGroupName was non-NULL.

	In virNetServerRun, Coverity didn't realize that the array is non-NULL
	if the array count is non-zero.

	* src/rpc/virnetserver.c (virNetServerNew): Use alternate pointer.
	(virNetServerRun): Give coverity a hint.

2011-08-03  Eric Blake  <eblake@redhat.com>

	rpc: avoid null deref
	Detected by Coverity.

	* src/rpc/virnetserverclient.c (virNetServerClientDispatchRead):
	Avoid null deref on OOM.

2011-08-03  Eric Blake  <eblake@redhat.com>

	build: silence coverity false positives
	Coverity complained that 395 out of 409 virAsprintf calls are
	checked, and therefore assumed that the remaining cases are bugs
	waiting to happen.  But in each of these cases, a failed virAsprintf
	will properly set the target string to NULL, and pass on that
	failure to the caller, without wasting efforts to check the call.
	Adding the ignore_value silences Coverity.

	* src/conf/domain_audit.c (virDomainAuditGetRdev): Ignore
	virAsprintf return value, when it behaves like we need.
	* src/network/bridge_driver.c (networkDnsmasqLeaseFileNameDefault)
	(networkRadvdConfigFileName, networkBridgeDummyNicName)
	(networkRadvdPidfileBasename): Likewise.
	* src/util/storage_file.c (absolutePathFromBaseFile): Likewise.
	* src/openvz/openvz_driver.c (openvzGenerateContainerVethName):
	Likewise.
	* src/util/command.c (virCommandTranslateStatus): Likewise.

2011-08-03  Eric Blake  <eblake@redhat.com>

	qemu: avoid memory leaks
	Quite a few leaks detected by coverity.  For chr, the leaks were
	close enough to the allocations to plug in place; for disk, the
	leaks were separated from the allocation by enough other lines with
	intermediate failure cases that I refactored the cleanup instead.

	* src/qemu/qemu_command.c (qemuParseCommandLine): Plug leaks.

2011-08-03  Eric Blake  <eblake@redhat.com>

	qemu: plug child process leak on domain core dump
	Detected by Coverity.  Leak introduced by typo in commit 58e668d2.

	* src/qemu/qemu_driver.c (doCoreDump): Use correct function.

2011-08-03  Eric Blake  <eblake@redhat.com>

	qemu: remove dead code
	Warning detected by Coverity.  No need for the NULL check, and
	removing it silences the warning without any semantic change.

	* src/qemu/qemu_migration.c (qemuMigrationFinish): All entries to
	endjob had non-NULL vm.

2011-08-03  Eric Blake  <eblake@redhat.com>

	conf: avoid memory leak on disk operations
	Detected by Coverity.  Leak on meta introduced in commit 85aa40e.

	* src/conf/domain_conf.c (virDomainDiskDefForeachPath): Plug leak.

2011-08-03  Eric Blake  <eblake@redhat.com>

	rpc: avoid crash on error
	Detected by Coverity.  Freeing the wrong variable results in both
	a memory leak and the likelihood of the caller dereferencing through
	a freed pointer.

	* src/rpc/virnettlscontext.c (virNetTLSSessionNew): Free correct
	variable.

2011-08-03  Eric Blake  <eblake@redhat.com>

	qemu: avoid null deref on block pull error
	Coverity detected that 5 of 6 callers of virJSONValueArrayGet checked
	for a NULL return; and that by not checking we risk a null deref
	during an error.  The error is unlikely since the prior call to
	virJSONValueArraySize would probably have already caught any botched
	JSON array parse, but better safe than sorry.

	* src/qemu/qemu_monitor_json.c (qemuMonitorJSONGetBlockJobInfo):
	Check for NULL.
	(qemuMonitorJSONExtractPtyPaths): Fix typo.

2011-08-03  Eric Blake  <eblake@redhat.com>

	rpc: correctly process sasl whitelist globs
	Detected by Coverity.  We want to compare the result of fnmatch 'rv',
	not our pre-set return value 'ret'.

	* src/rpc/virnetsaslcontext.c (virNetSASLContextCheckIdentity):
	Check correct variable.

2011-08-03  Eric Blake  <eblake@redhat.com>

	build: allow caching the input to STATIC_ANALYSIS
	Right now, every re-run of configure re-evaluates whether a
	static analysis tool is in use.  But if you run configure under
	coverity, make a tweak, and then do an incremental rebuild with
	gcc but not coverity to test the tweak, then rerun a build under
	coverity, then configure does not get rerun, and static analysis
	ends up with lots of false positives.

	This patch caches the static analysis result, and also makes it
	easier to force static analysis even if the existing checks are
	insufficient to detect newer versions of the static analyzer tools.

	* configure.ac (lv_cv_static_analysis): New cache variable.

2011-08-03  Eric Blake  <eblake@redhat.com>

	fdstream: drop delete argument
	Revert 6a1f5f568f8.  Now that libvirt_iohelper takes fds by
	inheritance rather than by open() (commit 1eb66479), there is
	no longer a race where the parent can unlink() a file prior to
	the iohelper open()ing the same file.  From there, it makes
	more sense to have the callers both create and unlink, rather
	than the caller create and the stream unlink, since the latter
	was only needed when iohelper had to do the unlink.

	* src/fdstream.h (virFDStreamOpenFile, virFDStreamCreateFile):
	Callers are responsible for deletion.
	* src/fdstream.c (virFDStreamOpenFileInternal): Don't leak created
	file on failure.
	(virFDStreamOpenFile, virFDStreamCreateFile): Drop parameter.
	* src/lxc/lxc_driver.c (lxcDomainOpenConsole): Update callers.
	* src/qemu/qemu_driver.c (qemuDomainScreenshot)
	(qemuDomainOpenConsole): Likewise.
	* src/storage/storage_driver.c (storageVolumeDownload)
	(storageVolumeUpload): Likewise.
	* src/uml/uml_driver.c (umlDomainOpenConsole): Likewise.
	* src/vbox/vbox_tmpl.c (vboxDomainScreenshot): Likewise.
	* src/xen/xen_driver.c (xenUnifiedDomainOpenConsole): Likewise.

2011-08-03  Eric Blake  <eblake@redhat.com>

	screenshot: don't unlink bogus file
	The previous qemu patch could end up calling unlink(tmp) before
	tmp was the name of a valid file (unlinking a fileXXXXXX template
	instead), or calling unlink(tmp) twice on success (once here,
	and once at the end of the stream).  Meanwhile, vbox also suffered
	from the same leaked tmp file bug.

	* src/qemu/qemu_driver.c (qemuDomainScreenshot): Don't unlink on
	success, or on invalid name.
	* src/vbox/vbox_tmpl.c (vboxDomainScreenshot): Don't leak temp file.

2011-08-03  Eric Blake  <eblake@redhat.com>

	python: avoid unlikely sign extension bug
	Detected by Coverity; same analysis as for commit f73198df.

	* python/libvirt-override.c (libvirt_virDomainGetVcpuPinInfo): Use
	correct type.

2011-08-03  Eric Blake  <eblake@redhat.com>

	rpc: avoid uninitialized memory use
	Spotted by Coverity.  Gnutls documents that buffer must be NULL
	if gnutls_x509_crt_get_key_purpose_oid is to be used to determine
	the correct size needed for allocating a buffer.

	* src/rpc/virnettlscontext.c
	(virNetTLSContextCheckCertKeyPurpose): Initialize buffer.

2011-08-03  Eric Blake  <eblake@redhat.com>

	rpc: avoid double close on error
	Spotted by coverity.  If pipe2 fails, then we attempt to close
	uninitialized fds, which may result in a double-close.

	* src/rpc/virnetserver.c (virNetServerSignalSetup): Initialize fds.

2011-08-03  Michal Privoznik  <mprivozn@redhat.com>

	qemu: Unlink temporary file on failure
	Although virFDStreamOpenFile will unlink it once opened, when we hit
	error path, we must unlink it by hand.

2011-08-03  Eric Blake  <eblake@redhat.com>

	doc: fix confusing statement about required privileges
	src/libvirt.c: "may requires" is confusing; the s was extra.

2011-08-02  Eric Blake  <eblake@redhat.com>

	rpc: avoid libvirtd crash on unexpected client close
	Steps to reproduce this problem (vm1 is not running):
	for i in `seq 50`; do virsh managedsave vm1& done; killall virsh

	Pre-patch, virNetServerClientClose could end up setting client->sock
	to NULL prior to other cleanup functions trying to use client->sock.
	This fixes things by checking for NULL in more places, and by deferring
	the cleanup until after all queued messages have been served.

	* src/rpc/virnetserverclient.c (virNetServerClientRegisterEvent)
	(virNetServerClientGetFD, virNetServerClientIsSecure)
	(virNetServerClientLocalAddrString)
	(virNetServerClientRemoteAddrString): Check for closed socket.
	(virNetServerClientClose): Rearrange close sequence.
	Analysis from Wen Congyang.

2011-08-02  Alex Jia  <ajia@redhat.com>

	virsh: fix memory leak in cmdNetworkInfo
	* tools/virsh.c: avoid memory leak in cmdNetworkInfo.

	* how to reproduce?
	  % valgrind -v --leak-check=yes virsh net-info default

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

2011-08-02  Alex Jia  <ajia@redhat.com>

	doc: fix incorrect option in blockjob
	* tools/virsh.pod: change 'live' to 'abort' based on actual option

2011-08-02  Jean-Baptiste Rouault  <jean-baptiste.rouault@diateam.net>

	openvz: detect when a domain was shut down from the inside
	This patch adds an internal function openvzGetVEStatus to
	get the real state of the domain. This function is used in
	various places in the driver, in particular to detect when
	the domain has been shut down by the user with the "halt"
	command.

2011-08-01  Eric Blake  <eblake@redhat.com>

	qemu: fix crash when mixing sync and async monitor jobs
	Currently, we attempt to run sync job and async job at the same time. It
	means that the monitor commands for two jobs can be run in any order.

	In the function qemuDomainObjEnterMonitorInternal():
	    if (priv->job.active == QEMU_JOB_NONE && priv->job.asyncJob) {
	        if (qemuDomainObjBeginNestedJob(driver, obj) < 0)
	We check whether the caller is an async job by priv->job.active and
	priv->job.asynJob. But when an async job is running, and a sync job is
	also running at the time of the check, then priv->job.active is not
	QEMU_JOB_NONE. So we cannot check whether the caller is an async job
	in the function qemuDomainObjEnterMonitorInternal(), and must instead
	put the burden on the caller to tell us when an async command wants
	to do a nested job.

	Once the burden is on the caller, then only async monitor enters need
	to worry about whether the VM is still running; for sync monitor enter,
	the internal return is always 0, so lots of ignore_value can be dropped.

	* src/qemu/THREADS.txt: Reflect new rules.
	* src/qemu/qemu_domain.h (qemuDomainObjEnterMonitorAsync): New
	prototype.
	* src/qemu/qemu_process.h (qemuProcessStartCPUs)
	(qemuProcessStopCPUs): Add parameter.
	* src/qemu/qemu_migration.h (qemuMigrationToFile): Likewise.
	(qemuMigrationWaitForCompletion): Make static.
	* src/qemu/qemu_domain.c (qemuDomainObjEnterMonitorInternal): Add
	parameter.
	(qemuDomainObjEnterMonitorAsync): New function.
	(qemuDomainObjEnterMonitor, qemuDomainObjEnterMonitorWithDriver):
	Update callers.
	* src/qemu/qemu_driver.c (qemuDomainSaveInternal)
	(qemudDomainCoreDump, doCoreDump, processWatchdogEvent)
	(qemudDomainSuspend, qemudDomainResume, qemuDomainSaveImageStartVM)
	(qemuDomainSnapshotCreateActive, qemuDomainRevertToSnapshot):
	Likewise.
	* src/qemu/qemu_process.c (qemuProcessStopCPUs)
	(qemuProcessFakeReboot, qemuProcessRecoverMigration)
	(qemuProcessRecoverJob, qemuProcessStart): Likewise.
	* src/qemu/qemu_migration.c (qemuMigrationToFile)
	(qemuMigrationWaitForCompletion, qemuMigrationUpdateJobStatus)
	(qemuMigrationJobStart, qemuDomainMigrateGraphicsRelocate)
	(doNativeMigrate, doTunnelMigrate, qemuMigrationPerformJob)
	(qemuMigrationPerformPhase, qemuMigrationFinish)
	(qemuMigrationConfirm): Likewise.
	* src/qemu/qemu_hotplug.c: Drop unneeded ignore_value.

2011-08-01  Alex Jia  <ajia@redhat.com>

	qemu: fix return value issue
	whether or not previous return value is -1, the following codes will be
	executed for a inactive guest in src/qemu/qemu_driver.c:
	ret = virDomainSaveConfig(driver->configDir, persistentDef);
	and if everything is okay, 'ret' is assigned to 0, the previous 'ret'
	will be overwritten, this patch will fix this issue.

	* src/qemu/qemu_driver.c: avoid return value is overwritten when give a argument
	  in out of blkio weight range for a inactive guest.

	* how to reproduce?
	  % virsh blkiotune ${guestname} --weight 10
	  % echo $?

	  Note: guest must be inactive, argument 10 in out of blkio weight range,
	  and can get a error information by checking libvirtd.log, however,
	  virsh hasn't raised any error information, and return value is 0.

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

2011-08-01  Alex Jia  <ajia@redhat.com>

	qemu: fix return value issue in qemuDomainSetMemoryParameters
	whether or not previous return value is -1, the following codes will be
	executed for a inactive guest in qemuDomainSetMemoryParameters:
	ret = virDomainSaveConfig(driver->configDir, persistentDef);
	and if everything is okay, 'ret' is assigned to 0, the previous 'ret'
	will be overwritten, this patch will fix this issue.

	* src/qemu/qemu_driver.c: avoid return value is overwritten when set
	  min_guarante value to a inactive guest.

	* how to reproduce?
	  % virsh memtune ${guestname} --min_guarante 1024
	  % echo $?

	  Note: guest must be inactive, in fact, 'min_guarante' hasn't been implemented
	  in memory tunable, and I can get the error when check actual libvirtd.log,
	  however, virsh hasn't raised any error information, and return value is 0.

2011-08-01  Matthias Bolte  <matthias.bolte@googlemail.com>

	virsh: Fix vol-name and vol-pool commands
	This commands don't have a --pool option, so don't tell
	vshCommandOptVolBy that there could be one. This made
	vshCommandOptString for pooloptname fail and an "missing option"
	error was reported.

	Make pooloptname optional for vshCommandOptVolBy.

2011-08-01  Guannan Ren  <gren@redhat.com>

	Correct the default value of lock_manager in qemu.conf
	* src/qemu/qemu.conf: switch back the comment for the default lock
	  manager to sanlock

2011-08-01  Osier Yang  <jyang@redhat.com>

	qemu: Fix a regression of domjobabort
	Introduced by f9a837da73a11ef, the condition is not changed after
	the else clause is removed. So now it quit with "domain is not
	running" when the domain is running. However, when the domain is
	not running, it reports "no job is active".

	How to reproduce:

	1)
	% virsh start $domain
	% virsh domjobabort $domain
	error: Requested operation is not valid: domain is not running

	2)
	% virsh destroy $domain
	% virsh domjobabort $domain
	error: Requested operation is not valid: no job is active on the domain

	3)
	% virsh save $domain /tmp/$domain.save

	Before above commands finished, try to abort job in another terminal

	% virsh domabortjob $domain
	error: Requested operation is not valid: domain is not running

2011-08-01  Matthias Bolte  <matthias.bolte@googlemail.com>

	conf: Don't leak the virtual port profile in virNetworkDefFree
	Reported by Alex Jia.

2011-07-30  Eric Blake  <eblake@redhat.com>

	save: generate idempotent inactive xml for running domain
	Originally noticed by comparing the xml generated by virDomainSave
	with the xml produced by reparsing and redumping that xml, but I
	also did an audit of every last use of VIR_DOMAIN_XML_INACTIVE in
	domain_conf.c to ensure that no other discrepancies exist.

	* src/conf/domain_conf.c (virDomainDeviceInfoIsSet): Add
	parameter, and update all callers.  Make static.
	(virDomainNetDefFormat): Skip generated ifname.
	(virDomainDefFormatInternal): Skip default <seclabel>.
	(virDomainChrSourceDefParseXML): Skip generated pty path, and add
	parameter.  Update callers.
	* src/conf/domain_conf.h (virDomainDeviceInfoIsSet): Delete.
	* src/libvirt_private.syms (domain_conf.h): Update.

2011-07-30  Eric Blake  <eblake@redhat.com>

	conf: make 'vnet' prefix a macro
	Using a macro ensures that all the code is looking for the same
	prefix.

	* src/conf/domain_conf.h (VIR_NET_GENERATED_PREFIX): New macro.
	* src/conf/domain_conf.c (virDomainNetDefParseXML): Use it.
	* src/uml/uml_conf.c (umlConnectTapDevice): Likewise.
	* src/qemu/qemu_command.c (qemuNetworkIfaceConnect): Likewise.
	Suggested by Laine Stump.

2011-07-30  Laine Stump  <laine@laine.org>

	network: don't forward DNS requests from isolated networks
	This is in response to:

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

	which points out that a guest on an "isolated" network could
	potentially exploit the DNS forwarding provided by dnsmasq to create a
	communication channel to the outside.

	This patch eliminates that possibility by adding the "--no-resolv"
	argument to the dnsmasq commandline, which tells dnsmasq to not
	forward on any requests that it can't resolve itself (by looking at
	its own static hosts files and runtime list of dhcp clients), but to
	instead return a failure for those requests.

	This shouldn't cause any undesirable change from current
	behavior, even in the case where a guest is currently configured with
	multiple interfaces, one of them being connected to an isolated
	network, and another to a network that does have connectivity to the
	outside. If the isolated network's DNS server is queried for a name
	it doesn't know, it will return "Refused" rather than "Unknown", which
	indicates to the guest that it should query other servers, so it then
	queries the connected DNS server, and gets the desired response.

2011-07-30  Eric Blake  <eblake@redhat.com>

	build: fix include path for cygwin
	Without this, cygwin failed to compile:

	In file included from ../src/rpc/virnetmessage.h:24,
	                 from ../src/rpc/virnetclient.h:27,
	                 from remote/remote_driver.c:31:
	../src/rpc/virnetprotocol.h:9:21: error: rpc/rpc.h: No such file or directory

	With that fixed, compilation warned:

	rpc/virnetsocket.c: In function 'virNetSocketNewListenUNIX':
	rpc/virnetsocket.c:347: warning: format '%d' expects type 'int', but argument 8 has type 'gid_t' [-Wformat]
	rpc/virnetsocket.c: In function 'virNetSocketGetLocalIdentity':
	rpc/virnetsocket.c:743: warning: pointer targets in passing argument 5 of 'getsockopt' differ in signedness

	* src/Makefile.am (libvirt_driver_remote_la_CFLAGS)
	(libvirt_net_rpc_client_la_CFLAGS)
	(libvirt_net_rpc_server_la_CFLAGS): Include XDR_CFLAGS, for rpc
	headers on cygwin.
	* src/rpc/virnetsocket.c (virNetSocketNewListenUNIX)
	(virNetSocketGetLocalIdentity): Avoid compiler warnings.

2011-07-30  Eric Blake  <eblake@redhat.com>

	build: avoid non-portable shell in test setup
	POSIX states that 'a=1; a=2 b=$a command' has unspecified results
	for the value of $b visible within command.  In particular, on
	BSD, this resulted in PATH not picking up the in-test ssh.

	* tests/Makefile.am (lv_abs_top_builddir): New macro.
	(path_add, TESTS_ENVIRONMENT): Use it to avoid referring to an
	environment variable set previously within the same command line.
	Reported by Matthias Bolte.

2011-07-29  Matthias Bolte  <matthias.bolte@googlemail.com>

	tests: Don't use bash if we don't have to
	This tested failed on FreeBSD because it was using bash, that might
	not be installed.

2011-07-29  Osier Yang  <jyang@redhat.com>

	utils: More useful error message for hook script failure
	Commit 3709a386 ported hooks codes to new command execution API,
	together with the useful error message removed. Though we can't
	get "errbuf" from the new command execution API anymore, still
	we can give a more useful error.

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

2011-07-29  Matthias Bolte  <matthias.bolte@googlemail.com>

	freebsd: Fix build problem due to picking up the wrong libvirt.h
	Gettext annoyingly modifies CPPFLAGS in-place, putting
	-I/usr/local/include into the search patch if libintl headers
	must be used from that location.  But since we must support
	automake 1.9.6 which lacks AM_CPPFLAGS, and since CPPFLAGS is used
	prior to INCLUDES, this means that the build picks up the _old_
	installed libvirt.h in priority to the in-tree version, leading
	to all sorts of weird build failures on FreeBSD.

	Fix this by teaching configure to undo gettext's actions, but
	to keep any changes required by gettext at the end of INCLUDES
	after all in-tree locations are used first.  Also requires
	adding a wrapper Makefile.am and making gnulib-tool create
	just gnulib.mk files during the bootstrap process.

2011-07-29  Matthias Bolte  <matthias.bolte@googlemail.com>

	freebsd: Avoid /bin/true in commandtest
	Rely on PATH and use just true, because on FreeBSD it's /usr/bin/true.

2011-07-29  Matthias Bolte  <matthias.bolte@googlemail.com>

	tests: Unify style of test skipping code
	Prefer 'return EXIT_AM_SKIP' over 'exit(EXIT_AM_SKIP)'.

	Prefer 'int main(void)' over 'int main(int argc, char **argv)'.

	Fix mymain signature in commandtest and nodeinfotest.

2011-07-29  Eric Blake  <eblake@redhat.com>

	save: let qemu driver manipulate save files
	The goal here is that save-image-dumpxml fed back to
	save-image-define should not change the save file; anywhere that
	this is not the case is probably a bug in domain_conf.c.

	* src/qemu/qemu_driver.c (qemuDomainSaveImageGetXMLDesc)
	(qemuDomainSaveImageDefineXML): New functions.
	(qemuDomainSaveImageOpen): Add parameter.
	(qemuDomainRestoreFlags, qemuDomainObjRestore): Adjust clients.

2011-07-29  Eric Blake  <eblake@redhat.com>

	save: support qemu modifying xml on domain save/restore
	With this, it is possible to update the path to a disk backing
	image on either the save or restore action, without having to
	binary edit the XML embedded in the state file.

	This also modifies virDomainSave to output a smaller xml (only
	the inactive xml, which is all the more virDomainRestore parses),
	while still guaranteeing padding for most typical abi-compatible
	xml replacements, necessary so that the next patch for
	virDomainSaveImageDefineXML will not cause unnecessary
	modifications to the save image file.

	* src/qemu/qemu_driver.c (qemuDomainSaveInternal): Add parameter,
	only use inactive state, and guarantee padding.
	(qemuDomainSaveImageOpen): Add parameter.
	(qemuDomainSaveFlags, qemuDomainManagedSave)
	(qemuDomainRestoreFlags, qemuDomainObjRestore): Update callers.

2011-07-29  Eric Blake  <eblake@redhat.com>

	maint: add missing copyright notices
	I went with the shorter license notice used by src/libvirt.c,
	rather than spelling out the full LGPLv2+ clause into each of
	these files.

	* configure.ac: Declare copyright.
	* all Makefile.am: Likewise.

2011-07-29  Eric Blake  <eblake@redhat.com>

	xen: drop unused callbacks
	Found by:

	for f in $(sed -n 's/.*Drv[^ ]* \([^;]*\);.*/\1/p' src/xen/xen_driver.h)
	do
	  git grep "\(\.\|->\)$f\b" src/xen
	done | cat

	and looking through the resulting list to see which callback struct
	members are still necessary.

	* src/xen/xen_driver.h (xenUnifiedDriver): Drop all callbacks that
	are only used directly.
	* src/xen/xen_hypervisor.c (xenHypervisorDriver): Shrink list.
	* src/xen/xen_inotify.c (xenInotifyDriver): Likewise.
	* src/xen/xend_internal.c (xenDaemonDriver): Likewise.
	* src/xen/xm_internal.c (xenXMDriver): Likewise.
	* src/xen/xs_internal.c (xenStoreDriver): Likewise.

2011-07-29  Eric Blake  <eblake@redhat.com>

	xen: make direct call when there is only one subdriver
	No need to use a for loop if we know there is exactly one client.
	Found by:

	for f in $(sed -n 's/.*Drv[^ ]* \([^;]*\);.*/\1/p' src/xen/xen_driver.h)
	do
	  git grep "\(\.\|->\)$f\b" src/xen
	done | cat

	and looking through the resulting list to see which callback struct
	members are used exactly once.  The next patch will ensure that we
	don't reintroduce uses of these callbacks.

	* src/xen/xen_driver.c (xenUnifiedClose): Call close
	unconditionally, to match xenUnifiedOpen.
	(xenUnifiedNodeGetInfo, xenUnifiedDomainCreateXML)
	(xenUnifiedDomainSave, xenUnifiedDomainRestore)
	(xenUnifiedDomainCoreDump, xenUnifiedDomainUpdateDeviceFlags):
	Make direct call to lone implementation.
	* src/xen/xend_internal.h (xenDaemonDomainCoreDump)
	(xenDaemonUpdateDeviceFlags, xenDaemonCreateXML): Add prototypes.
	* src/xen/xend_internal.c (xenDaemonDomainCoreDump)
	(xenDaemonUpdateDeviceFlags, xenDaemonCreateXML): Export.

2011-07-29  Eric Blake  <eblake@redhat.com>

	xen: reduce callback special cases
	The callback struct is great when iterating through several
	possibilities, but when calling a known callback, it's just
	overhead.  We can make the direct call in those cases.

	* src/xen/xen_driver.c (xenUnifiedOpen, xenUnifiedDomainSuspend)
	(xenUnifiedDomainResume, xenUnifiedDomainDestroyFlags): Make
	direct calls instead of going through callback.

2011-07-29  Eric Blake  <eblake@redhat.com>

	xen: cleanup callback struct
	Using C99 initializers and xen-specific prefixes will make it
	so that future patches are less likely to add callback members
	to the xenUnifiedDriver struct, since the goal is to get rid
	of the callback struct in the first place.

	* src/xen/xen_driver.h (xenUnifiedDriver): Rename all struct
	members, to make it obvious which ones are still in use.
	* src/xen/xen_driver.c: Update all callers.
	* src/xen/xen_hypervisor.c (xenHypervisorDriver): Rewrite with C99
	initializers.
	* src/xen/xend_internal.c (xenDaemonDriver): Likewise.
	* src/xen/xs_internal.c (xenStoreDriver): Likewise.
	* src/xen/xm_internal.c (xenXMDriver): Likewise.
	* src/xen/xen_inotify.c (xenInotifyDriver): Likewise.

2011-07-29  Laine Stump  <laine@laine.org>

	libxl: fix build failure due to change in virDomainGraphicsDef
	This failure was introduced by commit dacee3d, which removed
	listenAddr from the unions in virDomainGraphicsDef in favor of putting
	it in the address attribute of virDomainGraphicsListenDef.

2011-07-29  Laine Stump  <laine@laine.org>

	qemu: support type=network in domain graphics <listen>
	The domain XML now understands the <listen> subelement of its
	<graphics> element (including when listen type='network'), and the
	network driver has an internal API that will turn a network name into
	an IP address, so the final logical step is to put the glue into the
	qemu driver so that when it is starting up a domain, if it finds
	<listen type='network' network='xyz'/> in the XML, it will call the
	network driver to get an IPv4 address associated with network xyz, and
	tell qemu to listen for vnc (or spice) on that address rather than the
	default address (localhost).

	The motivation for this is that a large installation may want the
	guests' VNC servers listening on physical interfaces rather than
	localhost, so that users can connect directly from the outside; this
	requires sending qemu the appropriate IP address to listen on. But
	this address will of course be different for each host, and if a guest
	might be migrated around from one host to another, it's important that
	the guest's config not have any information embedded in it that is
	specific to one particular host. <listen type='network.../> can solve
	this problem in the following manner:

	  1) on each host, define a libvirt network of the same name,
	     associated with the interface on that host that should be used
	     for listening (for example, a simple macvtap network: <forward
	     mode='bridge' dev='eth0'/>, or host bridge network: <forward
	     mode='bridge'/> <bridge name='br0'/>

	  2) in the <graphics> element of each guest's domain xml, tell vnc to
	     listen on the network name used in step 1:

	     <graphics type='vnc' port='5922'>
	       <listen type='network'network='example-net'/>
	     </graphics>

	(all the above also applies for graphics type='spice').

2011-07-29  Laine Stump  <laine@laine.org>

	conf: add <listen> subelement to domain <graphics> element
	Once it's plugged in, the <listen> element will be an optional
	replacement for the "listen" attribute that graphics elements already
	have. If the <listen> element is type='address', it will have an
	attribute called 'address' which will contain an IP address or dns
	name that the guest's display server should listen on. If, however,
	type='network', the <listen> element should have an attribute called
	'network' that will be set to the name of a network configuration to
	get the IP address from.

	* docs/schemas/domain.rng: updated to allow the <listen> element

	* docs/formatdomain.html.in: document the <listen> element and its
	  attributes.

	* src/conf/domain_conf.[hc]:

	  1) The domain parser, formatter, and data structure are modified to
	     support 0 or more <listen> subelements to each <graphics>
	     element. The old style "legacy" listen attribute is also still
	     accepted, and will be stored internally just as if it were a
	     separate <listen> element. On output (i.e. format), the address
	     attribute of the first <listen> element of type 'address' will be
	     duplicated in the legacy "listen" attribute of the <graphic>
	     element.

	  2) The "listenAddr" attribute has been removed from the unions in
	     virDomainGRaphicsDef for graphics types vnc, rdp, and spice.
	     This attribute is now in the <listen> subelement (aka
	     virDomainGraphicsListenDef)

	  3) Helper functions were written to provide simple access
	     (both Get and Set) to the listen elements and their attributes.

	* src/libvirt_private.syms: export the listen helper functions

	* src/qemu/qemu_command.c, src/qemu/qemu_hotplug.c,
	  src/qemu/qemu_migration.c, src/vbox/vbox_tmpl.c,
	  src/vmx/vmx.c, src/xenxs/xen_sxpr.c, src/xenxs/xen_xm.c

	  Modify all these files to use the listen helper functions rather
	  than directly referencing the (now missing) listenAddr
	  attribute. There can be multiple <listen> elements to a single
	  <graphics>, but the drivers all currently only support one, so all
	  replacements of direct access with a helper function indicate index
	  "0".

	* tests/* - only 3 of these are new files added explicitly to test the
	  new <listen> element. All the others have been modified to reflect
	  the fact that any legacy "listen" attributes passed in to the domain
	  parse will be saved in a <listen> element (i.e. one of the
	  virDomainGraphicsListenDefs), and during the domain format function,
	  both the <listen> element as well as the legacy attributes will be
	  output.

2011-07-28  Alex Jia  <ajia@redhat.com>

	virsh: avoid missing zero value judgement in cmdBlkiotune
	* tools/virsh.c: fix missing zero value judgement in cmdBlkiotune and correct
	  vshError information.

	  when weight is equal to 0, the cmdBlkiotune will not raise any error information
	  when judge weight value first time, and execute else branch to judge weight
	  value again, strncpy(temp->field, VIR_DOMAIN_BLKIO_WEIGHT, sizeof(temp->field))
	  will be not executed for ever. However, if and only if param->field is equal
	  to VIR_DOMAIN_BLKIO_WEIGHT, underlying qemuDomainSetBlkioParameters function
	  will check whether weight value is in range [100, 1000].

	* how to reproduce?

	  % virsh blkiotune ${guestname} --weight 0

2011-07-28  Eric Blake  <eblake@redhat.com>

	build: avoid type-punning compiler warning
	On RHEL 5, with gcc 4.1.2:

	rpc/virnetsaslcontext.c: In function 'virNetSASLSessionUpdateBufSize':
	rpc/virnetsaslcontext.c:396: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]

	* src/rpc/virnetsaslcontext.c (virNetSASLSessionUpdateBufSize):
	Use a union to work around gcc warning.

2011-07-28  Eric Blake  <eblake@redhat.com>

	qemu: fix nested job with driver lock held
	qemuMigrationUpdateJobStatus (called in a loop by migration
	and save tasks) uses qemuDomainObjEnterMonitorWithDriver;
	however, that function ended up starting a nested job without
	releasing the driver.

	Since no one else is making nested calls, we can inline the
	internal functions to properly track driver_locked.

	* src/qemu/qemu_domain.h (qemuDomainObjBeginNestedJob)
	(qemuDomainObjBeginNestedJobWithDriver)
	(qemuDomainObjEndNestedJob): Drop unused prototypes.
	* src/qemu/qemu_domain.c (qemuDomainObjEnterMonitorInternal):
	Reflect driver lock to nested job.
	(qemuDomainObjBeginNestedJob)
	(qemuDomainObjBeginNestedJobWithDriver)
	(qemuDomainObjEndNestedJob): Drop unused functions.

2011-07-28  Michal Privoznik  <mprivozn@redhat.com>

	qemu: Fix memory leak on metadata fetching
	As written in virStorageFileGetMetadataFromFD decription, caller
	must free metadata after use. Qemu driver miss this and therefore
	leak metadata which can grow to huge mem leak if somebody query
	for blockInfo a lot.

2011-07-28  Matthias Bolte  <matthias.bolte@googlemail.com>

	freebsd: Add gnulib environ module for the commandtest

2011-07-28  Michal Privoznik  <mprivozn@redhat.com>

	libvirt.c: Update outdated description of flags
	Because we do support flags for virDomainSetBlkioParameters and
	virDomainGetBlkioParameters, update appropriate description as well.

2011-07-28  Hu Tao  <hutao@cn.fujitsu.com>

	python: add python binding for virDomainSetMemoryParameters

	python: add python binding for virDomainGetMemoryParameters

	python: add python binding for virDomainSetBlkioParameters

	python: add python binding for virDomainGetBlkioParameters

2011-07-28  Alex Jia  <ajia@redhat.com>

	virsh: fix memory leak in cmdVolPath code
	* tools/virsh.c: avoid memory leak in cmdVolPath.
	* src/libvirt.c: Add doc for virStorageVolGetPath to tell one
	  must free() the returned path after use.

	* how to reproduce?

	% dd if=/dev/zero of=/var/lib/libvirt/images/foo.img count=1 bs=10M
	% virsh pool-refresh default
	% valgrind -v --leak-check=full virsh vol-path --vol \
	/var/lib/libvirt/images/foo.img

	* actual results:

	Detected in valgrind run:

	==16436== 32 bytes in 1 blocks are definitely lost in loss record 7 of 22
	==16436==    at 0x4A05FDE: malloc (vg_replace_malloc.c:236)
	==16436==    by 0x386A314B3D: xdr_string (in /lib64/libc-2.12.so)
	==16436==    by 0x3DF8CD770D: xdr_remote_nonnull_string (remote_protocol.c:3
	==16436==    by 0x3DF8CD7EC8: xdr_remote_storage_vol_get_path_ret
	% virsh pool-refresh default
	% valgrind -v --leak-check=full virsh vol-path --vol \
	/var/lib/libvirt/images/foo.img

2011-07-28  Osier Yang  <jyang@redhat.com>

	qemu: Improve docs for virsh dump format
	The error in getCompressionType will never be reported, change
	the errors codes into warning (VIR_WARN("%s", _(foo)); doesn't break
	syntax-check rule), and also improve the docs in qemu.conf to tell
	user the truth.

2011-07-28  Eric Blake  <eblake@redhat.com>

	qemu: improve thread documentation
	* src/qemu/THREADS.txt: Fix problems with typos, grammar, and
	outdated examples.

	virsh: expose change-protection during migration
	* tools/virsh.c (doMigrate): Add --change-protection flag.
	* tools/virsh.pod (migrate): Document it.

2011-07-28  Matthias Bolte  <matthias.bolte@googlemail.com>

	rpc: Fix memory leak in remoteDomainSet*Parameters functions
	Add a new helper remoteFreeTypedParameters and teach the generator
	to add it to the cleanup section.

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

2011-07-28  Lai Jiangshan  <laijs@cn.fujitsu.com>

	send-key: Implement Python API

2011-07-27  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Remove special case for virDomainAbortJob
	This doesn't abort migration job in any phase, yet.

	qemu: Remove special case for virDomainSuspend

	qemu: Remove special case for virDomainMigrateSetMaxDowntime
	Call qemu monitor command directly within a special job that is only
	allowed during outgoing migration.

	qemu: Remove special case for virDomainMigrateSetMaxSpeed
	Call qemu monitor command directly within a special job that is only
	allowed during outgoing migration.

	qemu: Remove special case for virDomainBlockStats
	Like other query commands, this can now be called directly during
	migration.

	qemu: Remove special case for virDomainGetBlockInfo
	Like other query commands, this can now be called directly during
	migration.

	qemu: Recover from interrupted migration

2011-07-27  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Migration job on source daemon
	Make MIGRATION_OUT use the new helper methods.

	This also introduces new protection to migration v3 process: the
	migration job is held from Begin to Confirm to avoid changes to a domain
	during migration (esp. between Begin and Perform phases). This change is
	automatically applied to p2p and tunneled migrations. For normal
	migration, this requires support from a client. In other words, if an
	old (pre 0.9.4) client starts normal migration of a domain, the domain
	will not be protected against changes between Begin and Perform steps.

2011-07-27  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Migration job on destination daemon
	Make MIGRATION_IN use the new helper methods.

	qemu: Implement migration job phases
	This patch introduces several helper methods to deal with jobs and
	phases during migration in a simpler manner.

2011-07-27  Eric Blake  <eblake@redhat.com>

	build: support warnings on RHEL 5
	Without this, a configure built by autoconf 2.59 was broken when
	trying to detect which compiler warning flags were supported.

	* .gnulib: Update to latest, for warnings.m4 fix.
	* bootstrap.conf: Add fclose explicitly, to match recent gnulib
	implicit dependency changes.
	* src/qemu/qemu_conf.c (includes): Drop unused include.
	* src/uml/uml_conf.c (include): Likewise.
	Reported by Daniel P. Berrange.

2011-07-27  Michal Privoznik  <mprivozn@redhat.com>

	bandwidth: Integrate bandwidth into portgroups
	Every DomainNetDef has a bandwidth, as does every portgroup.
	Whenever a DomainNetDef of type NETWORK is about to be used, a call is
	made to networkAllocateActualDevice(). This function chooses the "best"
	bandwidth object and places it in the DomainActualNetDef.
	From that point on, whenever some code needs to use the bandwidth data
	for the interface, it's retrieved with virDomainNetGetActualBandwidth(),
	which will always return the "best" info as determined in the
	previous step.

2011-07-27  Osier Yang  <jyang@redhat.com>

	doc: Add doc for blockpull and blockjob commands
	Commit b31abc6f0 introduce commands blockpull and blockjob, but
	forgot to add the docs meanwhile.

2011-07-27  Cole Robinson  <crobinso@redhat.com>

	python: Properly report errors if virStreamRecv fails
	We only want to raise the special value -2. -1 should return None
	which tells the bindings to throw an exception.

2011-07-26  Alex Jia  <ajia@redhat.com>

	tools: format percent strings of nodecpustats
	* tools/virsh.c: format strings display for virsh nodecpustats --percent.

	* how to reproduce?

	% virsh nodecpustats --percent
	usage:            2.0%
	    user  :       1.0%
	    system:       1.0%
	idle  :          98.0%
	iowait:           0.0%

	* after format strings

	% virsh nodecpustats --percent
	usage:            2.0%
	user:             1.0%
	system:           1.0%
	idle:            98.0%
	iowait:           0.0%

2011-07-26  Stefan Berger  <stefanb@us.ibm.com>

	Build: fix build if HAVE_AVAHI is not defined
	Fix the build if HAVE_AVAHI is not defined.

2011-07-26  Dave Allan  <dallan@redhat.com>

	Fix incorrect implication about list options
	The description of the list command seemed to suggest that it could
	take a set of domains as an argument, which is not correct in the
	current HEAD.  If virsh list is intended to take a list of domains,
	then this patch should be NAK'd and a bug opened against virsh list.

	Reported by hachi on #virt

	v2:

	Change language to include transient domains

	Osier pointed out that transient domains are not defined, so what I
	had originally proposed wasn't quite correct.

2011-07-26  Daniel P. Berrange  <berrange@redhat.com>

	Fix race in ref counting when handling RPC jobs
	When an incoming RPC message is ready for processing,

	  virNetServerClientDispatchRead()

	will invoke the 'dispatchFunc' callback. This is set to

	  virNetServerDispatchNewMessage

	This function puts the message + client in a queue for processing by the thread
	pool. The thread pool worker function is

	  virNetServerHandleJob

	The first thing this does is acquire an extra reference on the 'client'.

	Unfortunately, between the time the message+client are put on the thread pool
	queue, and the time the worker runs, the client object may have had its last
	reference removed.

	We clearly need to add the reference to the client object before putting the
	client on the processing queue

	* src/rpc/virnetserverclient.c: Add a reference to the client when
	  invoking the dispatch function
	* src/rpc/virnetserver.c: Don't acquire a reference to the client
	  when in the worker thread

2011-07-26  Wen Congyang  <wency@cn.fujitsu.com>

	set cpu bandwidth for the vm
	The cpu bandwidth is applied at the vcpu group level. We should apply it
	at the vm group level too, because the vm may do heavy I/O, and it will affect
	the other vm.

	We apply cpu bandwidth at the vcpu and the vm group level, so we must ensure
	that max(child_quota) <= parent_quota when we modify cpu bandwidth.

2011-07-26  Daniel P. Berrange  <berrange@redhat.com>

	Fix build with gnutls 1.0.x branch

	Fix typos in virsh.pod file
	* tools/virsh.pod: Fix missing > tag in docs

2011-07-26  Osier Yang  <jyang@redhat.com>

	network: Fix typo
	Introduced by commit 239322cb, reported by Ruben Kerkhof.

2011-07-26  Daniel P. Berrange  <berrange@redhat.com>

	Add libtasn1-devel as a BuildRequires for libvirt.spec
	* libvirt.spec.in: Add libtasn1-devel

2011-07-26  Daniel P. Berrange  <berrange@redhat.com>

	Add mutex protection to SASL and TLS modules
	The virNetSASLContext, virNetSASLSession, virNetTLSContext and
	virNetTLSSession classes previously relied in their owners
	(virNetClient / virNetServer / virNetServerClient) to provide
	locking protection for concurrent usage. When virNetSocket
	gained its own locking code, this invalidated the implicit
	safety the SASL/TLS modules relied on. Thus we need to give
	them all explicit locking of their own via new mutexes.

	* src/rpc/virnetsaslcontext.c, src/rpc/virnettlscontext.c: Add
	  a mutex per object

2011-07-26  Daniel P. Berrange  <berrange@redhat.com>

	Report error if unable to bind to any socket
	When setting up a server socket, we must skip EADDRINUSE errors
	from bind, since the IPv6 socket bind may have already bound to
	the IPv4 socket too. If we don't manage to bind to any sockets
	at all though, we should then report the EADDRINUSE error as
	normal.

	This fixes the case where libvirtd would not exit if some other
	program was listening on its TCP/TLS ports.

	* src/rpc/virnetsocket.c: Report EADDRINUSE

2011-07-26  Daniel P. Berrange  <berrange@redhat.com>

	Fix leak of mDNS object in virNetServer
	* src/rpc/virnetserver.c: Free mDNS object

	Fix memory leaks in MDNS code
	* src/rpc/virnetservermdns.c: Fix leaks

2011-07-26  Eric Blake  <eblake@redhat.com>

	virsh: use faster bit search
	Now that gnulib gives us ffs, we might as well use it.

	* tools/virsh.c (vshCmddefGetData): Use ffs rather than
	count_one_bits.

2011-07-26  Eric Blake  <eblake@redhat.com>

	virsh: make vcpucount use --current consistently
	Rename the existing --current flag to the new name --active,
	while adding a new flag --current to expose the new
	VIR_DOMAIN_AFFECT_CURRENT flag of virDomainGetVcpusFlags.

	For backwards compability, the output does not change (even
	though the label "current" no longer matches the spelling of
	the option that would trigger that number in isolation), and
	we accept "--current --live" as an undocumented synonym for
	"--active --live" to avoid breaking any existing clients.

	* tools/virsh.c (cmdVcpucount): Add --active flag, and rearrange
	existing flag handling to expose VIR_DOMAIN_AFFECT_CURRENT support.
	* tools/virsh.pod (vcpucount): Document this.

2011-07-26  Eric Blake  <eblake@redhat.com>

	vcpu: teach getVcpusFlags about current
	Now that virDomainSetVcpusFlags knows about VIR_DOMAIN_AFFECT_CURRENT,
	so should virDomainGetVcpusFlags.

	Unfortunately, the virsh counterpart 'virsh vcpucount' has already
	commandeered --current for a different meaning, so teaching virsh
	to expose this in the next patch will require a bit of care.

	* src/libvirt.c (virDomainGetVcpusFlags): Allow
	VIR_DOMAIN_AFFECT_CURRENT.
	* src/libxl/libxl_driver.c (libxlDomainGetVcpusFlags): Likewise.
	* src/qemu/qemu_driver.c (qemudDomainGetVcpusFlags): Likewise.
	* src/test/test_driver.c (testDomainGetVcpusFlags): Likewise.
	* src/xen/xen_driver.c (xenUnifiedDomainGetVcpusFlags): Likewise.

2011-07-26  Cole Robinson  <crobinso@redhat.com>

	python: Handle embedded NUL in stream.send data
	Otherwise things like volume upload are only useful with text data.

2011-07-26  Laine Stump  <laine@laine.org>

	util: change virFile*Pid functions to return < 0 on failure
	Although most functions in libvirt return 0 on success and < 0 on
	failure, there are a few functions lingering around that return errno
	(a positive value) on failure, and sometimes code calling those
	functions incorrectly assumes the <0 standard. I noticed one of these
	the other day when auditing networkStartDhcpDaemon after Guido Gunther
	found a place where success was improperly returned on failure (that
	patch has been acked and is pending a push). The problem was that it
	expected the return value from virFileReadPid to be < 0 on failure,
	but it was actually positive (it was also neglected to set the return
	code in this case, similar to the bug found by Guido).

	This all led to the fact that *all* of the virFile*Pid functions in
	util.c are returning errno on failure. This patch remedies that
	problem by changing them all to return -errno on failure, and makes
	any necessary changes to callers of the functions. (In the meantime, I
	also properly set the return code on failure of virFileReadPid in
	networkStartDhcpDaemon).

2011-07-26  Guido Günther  <agx@sigxcpu.org>

	Catch dnsmasq start failures
	While we checked the return value we didn't maks sure ret != 0 which
	resulted in dnsmasq errors being ignored.

2011-07-26  Daniel P. Berrange  <berrange@redhat.com>

	Fix import of private key with older gnutls
	With older GNUTLS the gnutls_x509_privkey_import function is
	unable to import our private key. Instead we must use the
	alternative gnutls_x509_privkey_import_pkcs8() (as certtool
	does).

	* virnettlscontexttest.c: Fix import of private key with
	  older gnutls. Also add missing newlines to key

2011-07-25  Daniel P. Berrange  <berrange@redhat.com>

	Fix TLS context tests with expired certs
	commit 5283ea9b1d8a4b0f2fd6796bf60615aca7b6c3e6 changed the
	semantics of the 'expire_offset' field in the test case struct
	so that instead of being an absolute timestamp, it was a delta
	relative to the current time. This broke the test cases which
	were testing expiry of certificates, by putting the expiry
	time into the future, instead of in the past.

	Fix this by changing the expiry values to be negative, so that
	the delta goes into the past again.

	* virnettlscontexttest.c: Fix expiry tests

2011-07-25  Wen Congyang  <wency@cn.fujitsu.com>

	rename cfs_* to vcpu_*
	In the XML file we now have

	  <cputune>
	    <shares>1024</shares>
	    <period>90000</period>
	    <quota>0</quota>
	  </cputune>

	But the schedinfo parameter are being named

	 cpu_shares: 1024
	 cfs_period: 90000
	 cfs_quota: 0

	The period/quota is per-vcpu value, so these new tunables should be named
	'vcpu_period' and 'vcpu_quota'.

2011-07-25  Cole Robinson  <crobinso@redhat.com>

	docs: Break up 'Basic Resources' XML section
	We had a bit too many elements crammed in there. Separate it into different
	headings:

	- CPU Allocation (<vcpus>)
	- CPU Tuning (<cputune>)
	- Memory allocation (<memory> and <currentMemory>)
	- Memory backing (<memoryBacking>)
	- Memory tuning (<memtune>)
	- Numa tuning (<numatune>)
	- Block I/O tuning (<blkiotune>)

2011-07-25  Taku Izumi  <izumi.taku@jp.fujitsu.com>

	python: add Python binding for virDomainGetVcpuPinInfo API
	This patch adds the Python bindings for virDomainGetVcpuPinInfo API.
	* python/generator.py: add it to generator skip list
	* python/libvirt-override-api.xml: provide an override description
	* python/libvirt-override.c: provide an override binding implementation

	python: add Python binding for virDomainPinVcpusFlags API
	This patch adds the Python bindings for virDomainPinVcpuFlags API.
	* python/generator.py: add it to the generator skip list
	* python/libvirt-override-api.xml: provide override description
	* python/libvirt-override.c: provide override bindings implementation

	python: add Python binding for virDomainGetSchedulerParametersFlags API
	This patch adds the Python bindings for
	virDomainGetSchedulerParametersFlags API.

	python: add Python binding for virDomainGetSchedulerParametersFlags API
	This patch adds the Python bindings for
	virDomainGetSchedulerParametersFlags API.
	* python/libvirt-override-api.xml: provide and override description
	* python/libvirt-override.c: implement the bindings

2011-07-25  Eric Blake  <eblake@redhat.com>

	tests: detect gnutls errors
	* tests/virnettlscontexttest.c (testTLSLoadKey): Report errors.

2011-07-25  Wieland Hoffmann  <themineo@googlemail.com>

	driver.h: Fix two driver documentation mistakes

2011-07-25  Michal Privoznik  <mprivozn@redhat.com>

	bandwidth: Add domain schema and xml2xml tests

	bandwidth: Add test cases for network

	bandwidth: Implement functions to enable and disable QoS
	These function executes 'tc' with appropriate arguments to set
	desired QoS setting on interface or bridge during its creation.

	bandwidth: Create format functions

2011-07-25  Michal Privoznik  <mprivozn@redhat.com>

	bandwidth: Add parsing and free functions
	These functions parse given XML node and return pointer to the
	output. Unknown elements are silently ignored. Attributes must
	be integer and must fit in unsigned long long.

	Free function frees elements of virBandwidth structure.

2011-07-25  Michal Privoznik  <mprivozn@redhat.com>

	bandwidth: Declare internal structures

2011-07-25  Michal Privoznik  <mprivozn@redhat.com>

	bandwidth: Define schema and create documentation
	Define new 'bandwidth' element with possible child element 'inbound'
	and 'outbound' addressing incoming and outgoing traffic respectively:

	<bandwidth>
	  <inbound average='1000' peak='2000' burst='5120'/>
	  <outbound average='500'/>
	</bandwidth>

	Leaving any element out means not to shape traffic in that
	direction.
	The units for average and peak (rate) are in kilobytes per second,
	for burst (size) are just in kilobytes.
	This element can be inserted into domain's 'interface' and
	'network'.

2011-07-25  Laine Stump  <laine@laine.org>

	network: provide internal API to return IP of a network
	The new listenNetwork attribute needs to learn an IP address based on a
	named network. This patch provides a function networkGetNetworkAddress
	which provides that.

	Some networks have an IP address explicitly in their configuration
	(ie, those with a forward type of "none", "route", or "nat"). For
	those, we can just return the IP address from the config.

	The rest will have a physical device associated with them (either via
	<bridge name='...'/>, <forward ... dev='...'/>, or possibly via a pool
	of interfaces inside the network's <forward> element) and we will need
	to ask the kernel for a current IP address of that device (via the
	newly added ifaceGetIPAddress)

	If networkGetNetworkAddress encounters an error while trying to learn
	the address for a network, it will return -1. In the case that libvirt
	has been compiled without the network driver, the call is a macro
	which reduces to -2. This allows differentiating between a failure of
	the network driver, and its complete absence.

2011-07-25  Laine Stump  <laine@laine.org>

	util: add an ifaceGetIPAddress to the interface utilities
	This function uses ioctl(SIOCGIFADDR), which limits it to returning
	the first IPv4 address of an interface, but that's what we want right
	now (the place we're going to use the address only accepts one).

2011-07-25  Eric Blake  <eblake@redhat.com>

	tests: fix compilation failures
	Even though gnutls is a hard-req for libvirt, and gnutls depends
	on libtasn1, that does not mean that you have to have the libtasn1
	development files installed.  Skip the test rather than failing
	compilation in that case.

	With newer gcc, the test consumed too much stack space.  Move
	things to static storage to fix that.

	* configure.ac (AC_CHECK_HEADERS): Check for libtasn1.h.
	(HAVE_LIBTASN1): New automake conditional.
	* tests/Makefile.am (virnettlsconvirnettlscontexttest_SOURCES)
	(virnettlscontexttest_LDADD): Allow compilation without libtasn1.
	* tests/virnettlscontexttest.c: Skip test if headers not present.
	(struct testTLSCertReq): Alter time members.
	(testTLSGenerateCert): Reflect the change.
	(mymain): Reduce stack usage.

2011-07-22  Daniel P. Berrange  <berrange@redhat.com>

	Pre-create /var/lib/libvirt/sanlock directory
	The sanlock plugin for libvirt expects the directory
	/var/lib/libvirt/sanlock to exist. Create this and add
	it to the RPM

	* libvirt.spec.in: Add /var/lib/libvirt/sanlock
	* src/Makefile.am: Create /var/lib/libvirt/sanlock

2011-07-22  Daniel P. Berrange  <berrange@redhat.com>

	Honour filesystem readonly flag & make special FS readonly
	A container should not be allowed to modify stuff in /sys
	or /proc/sys so make them readonly. Make /selinux readonly
	so that containers think that selinux is disabled.

	Honour the readonly flag when mounting container filesystems
	from the guest XML config

	* src/lxc/lxc_container.c: Support readonly mounts

2011-07-22  Daniel P. Berrange  <berrange@redhat.com>

	Refactor mounting of special filesystems
	Even in non-virtual root filesystem mode we should be mounting
	more than just a new /proc. Refactor lxcContainerMountBasicFS
	so that it does everything except for /dev and /dev/pts moving
	that into lxcContainerMountDevFS. Pass in a source prefix
	to lxcContainerMountBasicFS() so it can be used in both shared
	root and private root modes.

	* src/lxc/lxc_container.c: Unify mounting code for special
	  filesystems

2011-07-22  Daniel P. Berrange  <berrange@redhat.com>

	Pull code for doing a bind mount into separate method
	The bind mount setup is about to get more complicated.
	To avoid having to deal with several copies, pull it
	out into a separate lxcContainerMountFSBind method.

	Also pull out the iteration over container filesystems,
	so that it will be easier to drop in support for non-bind
	mount filesystems

	* src/lxc/lxc_container.c: Pull bind mount code out into
	  lxcContainerMountFSBind

2011-07-22  Daniel P. Berrange  <berrange@redhat.com>

	Fix typos in daemon config file from previous commit

2011-07-22  Daniel P. Berrange  <berrange@redhat.com>

	Add a test case for certificate validation
	This test case checks certification validation rules for

	 - Basic constraints
	 - Key purpose
	 - Key usage
	 - Start/expiry times

	It checks initial context creation sanity checks, and live
	session validation

2011-07-22  Daniel P. Berrange  <berrange@redhat.com>

	Allow certificate sanity checking to be disabled
	When libvirtd starts it it will sanity check its own certs,
	and before libvirt clients connect to a remote server they
	will sanity check their own certs. This patch allows such
	sanity checking to be skipped. There is no strong reason to
	need to do this, other than to bypass possible libvirt bugs
	in sanity checking, or for testing purposes.

	libvirt.conf gains tls_no_sanity_certificate parameter to
	go along with tls_no_verify_certificate. The remote driver
	client URIs gain a no_sanity URI parameter

	* daemon/test_libvirtd.aug, daemon/libvirtd.conf,
	  daemon/libvirtd.c, daemon/libvirtd.aug: Add parameter to
	  allow cert sanity checks to be skipped
	* src/remote/remote_driver.c: Add no_sanity parameter to
	  skip cert checks
	* src/rpc/virnettlscontext.c, src/rpc/virnettlscontext.h:
	  Add new parameter for skipping sanity checks independantly
	  of skipping session cert validation checks

2011-07-22  Matthias Bolte  <matthias.bolte@googlemail.com>

	build: Use $(PYTHON) instead of python for the keycode map generator
	Also prepend $(AM_V_GEN) to the command line, mark virkeycode-mapgen.py
	as executable and switch the shebang line from /bin/python to the
	commonly use /usr/bin/python.

2011-07-22  Matthias Bolte  <matthias.bolte@googlemail.com>

	xenapi: Fix double-freeing the session in xenapiClose
	xen_session_logout already frees the whole session object.
	Don't call xenSessionFree on a freed session object.

	Reported by Sharmila Radhakrishnan.

2011-07-22  Oskari Saarenmaa  <os@ohmu.fi>

	remote/ssh: optional "keyfile" parameter.
	New optional parameter "keyfile" for ssh transport allows the user to select
	the private key to be used to authenticate to the remote host.

2011-07-22  Laine Stump  <laine@laine.org>

	util: make interface.c functions consistently return < 0 on error
	All of the functions in util/interface.c were returning 0 on success,
	but some returned -1 on error, and some returned a positive value
	(usually the value of errno, but sometimes just 1). Libvirt's standard
	is to return < 0 on error (in the case of functions that need to
	return errno, -errno is returned.

	This patch modifies all functions in interface.c to consistently
	return < 0 on error, and makes changes to callers of those functions
	where necessary.

2011-07-22  Daniel P. Berrange  <berrange@redhat.com>

	Refactor the certification validation code
	There is some commonality between the code for sanity checking
	certs when initializing libvirt and the code for validating
	certs during a live TLS session handshake. This patchset splits
	up the sanity checking function into several smaller functions
	each doing a specific type of check. The cert validation code
	is then updated to also call into these functions

	* src/rpc/virnettlscontext.c: Refactor cert validation code

2011-07-22  Daniel P. Berrange  <berrange@redhat.com>

	Remove call to deprecated gnutls_certificate_type_set_priority (again)
	The gnutls_certificate_type_set_priority method is deprecated.
	Since we already set the default gnutls priority, it was not
	serving any useful purpose and can be removed

	* src/rpc/virnettlscontext.c: Remove gnutls_certificate_type_set_priority
	  call

2011-07-22  Daniel P. Berrange  <berrange@redhat.com>

	Ensure that libvirtd shuts down if initialization fails
	If the virStateInitialize call fails we must shutdown libvirtd
	since drivers will not be available. Just free'ing the virNetServer
	is not sufficient, we must send a SIGTERM to ourselves so that
	we interrupt the event loop and trigger a orderly shutdown

	* daemon/libvirtd.c: Kill ourselves if state init fails
	* src/rpc/virnetserver.c: Add some debugging to event loop

2011-07-22  Adam Litke  <agl@us.ibm.com>

	Asynchronous event for BlockJob completion
	When an operation started by virDomainBlockPull completes (either with
	success or with failure), raise an event to indicate the final status.
	This API allow users to avoid polling on virDomainGetBlockJobInfo if
	they would prefer to use an event mechanism.

	* daemon/remote.c: Dispatch events to client
	* include/libvirt/libvirt.h.in: Define event ID and callback signature
	* src/conf/domain_event.c, src/conf/domain_event.h,
	  src/libvirt_private.syms: Extend API to handle the new event
	* src/qemu/qemu_driver.c: Connect to the QEMU monitor event
	  for block_stream completion and emit a libvirt block pull event
	* src/remote/remote_driver.c: Receive and dispatch events to application
	* src/remote/remote_protocol.x: Wire protocol definition for the event
	* src/remote_protocol-structs: structure definitions for protocol verification
	* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
	  src/qemu/qemu_monitor_json.c: Watch for BLOCK_STREAM_COMPLETED event
	  from QEMU monitor

2011-07-22  Adam Litke  <agl@us.ibm.com>

	Enable virDomainBlockPull in the python API
	virDomainGetBlockJobInfo requires manual override since it returns a
	custom type.

	* python/generator.py: reenable bindings for this entry point
	* python/libvirt-override-api.xml python/libvirt-override.c:
	  manual overrides

2011-07-22  Adam Litke  <agl@us.ibm.com>

	Enable the virDomainBlockPull API in virsh
	Define two new virsh commands:
	 * blockpull: Initiate a blockPull for the given disk
	 * blockjob: Retrieve progress info, modify speed, and cancel active block jobs

	Share print_job_progress() with the migration code.

	* tools/virsh.c: implement the new commands

2011-07-22  Adam Litke  <agl@us.ibm.com>

	Implement virDomainBlockPull for the qemu driver
	The virDomainBlockPull* family of commands are enabled by the
	following HMP/QMP commands: 'block_stream', 'block_job_cancel',
	 'info block-jobs' / 'query-block-jobs', and 'block_job_set_speed'.

	* src/qemu/qemu_driver.c src/qemu/qemu_monitor_text.[ch]: implement disk
	  streaming by using the proper qemu monitor commands.
	* src/qemu/qemu_monitor_json.[ch]: implement commands using the qmp monitor

2011-07-22  Adam Litke  <agl@us.ibm.com>

	Add virDomainBlockPull support to the remote driver
	The generator can handle everything except virDomainGetBlockJobInfo().

	* src/remote/remote_protocol.x: provide defines for the new entry points
	* src/remote/remote_driver.c daemon/remote.c: implement the client and
	  server side for virDomainGetBlockJobInfo.
	* src/remote_protocol-structs: structure definitions for protocol verification
	* src/rpc/gendispatch.pl: Permit some unsigned long parameters

2011-07-22  Adam Litke  <agl@us.ibm.com>

	virDomainBlockPull: Implement the main entry points
	* src/libvirt.c: implement the main entry points

2011-07-22  Adam Litke  <agl@us.ibm.com>

	Add new API virDomainBlockPull* to headers
	Set up the types for the block pull functions and insert them into the
	virDriver structure definition.  Symbols are exported in this patch to
	prevent
	documentation compile failures.

	* include/libvirt/libvirt.h.in: new API
	* src/driver.h: add the new entry to the driver structure
	* python/generator.py: fix compiler errors, the actual python bindings
	* are
	  implemented later
	* src/libvirt_public.syms: export symbols
	* docs/apibuild.py: Extend 'unsigned long' parameter exception to this
	* API

2011-07-22  Eric Blake  <eblake@redhat.com>

	save: add virsh commands for manipulating save files
	Now you can edit a saved state file even if you forgot to grab
	a dumpxml file prior to saving a domain.  Plus, in-place editing
	feels so much nicer.

	* tools/virsh.c (cmdSaveImageDumpxml, cmdSaveImageDefine)
	(cmdSaveImageEdit): New commands.
	* tools/virsh.pod (save-image-dumpxml, save-image-define)
	(save-image-edit): Document them.

2011-07-22  Eric Blake  <eblake@redhat.com>

	save: wire up remote protocol
	* src/remote/remote_driver.c (remote_driver): Add new callbacks.
	* src/remote/remote_protocol.x (remote_procedure): New RPCs.
	(remote_domain_save_image_get_xml_desc_args)
	(remote_domain_save_image_get_xml_desc_ret)
	(remote_domain_save_image_define_xml_args): New structs.
	* src/remote_protocol-structs: Update.

2011-07-22  Eric Blake  <eblake@redhat.com>

	save: new API to manipulate save file images
	Modifying the xml on either save or restore only gets you so
	far - you have to remember to 'virsh dumpxml dom' just prior
	to the 'virsh save' in order to have an xml file worth modifying
	that won't be rejected due to abi breaks.  To make this more
	powerful, we need a way to grab the xml embedded within a state
	file, and from there, it's not much harder to also support
	modifying a state file in-place.

	Also, virDomainGetXMLDesc didn't document its flags.

	* include/libvirt/libvirt.h.in (virDomainSaveImageGetXMLDesc)
	(virDomainSaveImageDefineXML): New prototypes.
	* src/libvirt.c (virDomainSaveImageGetXMLDesc)
	(virDomainSaveImageDefineXML): New API.
	* src/libvirt_public.syms: Export them.
	* src/driver.h (virDrvDomainSaveImageGetXMLDesc)
	(virDrvDomainSaveImgeDefineXML): New driver callbacks.

2011-07-22  Eric Blake  <eblake@redhat.com>

	save: support bypass-cache flag in libvirt-guests init script
	libvirt-guests is a perfect use case for bypassing the file system
	cache - lots of filesystem traffic done at system shutdown, where
	caching is pointless, and startup, where reading large files only
	once just gets in the way.  Make this a configurable option in the
	init script, but defaulting to existing behavior.

	* tools/libvirt-guests.sysconf (BYPASS_CACHE): New variable.
	* tools/libvirt-guests.init.sh (start, suspend_guest): Use it.

2011-07-22  Eric Blake  <eblake@redhat.com>

	save: support bypass-cache flag in qemu.conf
	When auto-dumping a domain on crash events, or autostarting a domain
	with managed save state, let the user configure whether to imply
	the bypass cache flag.

	* src/qemu/qemu.conf (auto_dump_bypass_cache, auto_start_bypass_cache):
	Document new variables.
	* src/qemu/libvirtd_qemu.aug (vnc_entry): Let augeas parse them.
	* src/qemu/qemu_conf.h (qemud_driver): Store new preferences.
	* src/qemu/qemu_conf.c (qemudLoadDriverConfig): Parse them.
	* src/qemu/qemu_driver.c (processWatchdogEvent, qemuAutostartDomain):
	Honor them.

2011-07-22  Eric Blake  <eblake@redhat.com>

	save: support BYPASS_CACHE during qemu save/restore
	Wire together the previous patches to support file system cache
	bypass during API save/restore requests in qemu.

	* src/qemu/qemu_driver.c (qemuDomainSaveInternal, doCoreDump)
	(qemudDomainObjStart, qemuDomainSaveImageOpen, qemuDomainObjRestore)
	(qemuDomainObjStart): Add parameter.
	(qemuDomainSaveFlags, qemuDomainManagedSave, qemudDomainCoreDump)
	(processWatchdogEvent, qemudDomainStartWithFlags, qemuAutostartDomain)
	(qemuDomainRestoreFlags): Update callers.

2011-07-22  Eric Blake  <eblake@redhat.com>

	save: add virFileDirectFd wrapper type
	O_DIRECT has stringent requirements.  Rather than make lots of changes
	at each site that wants to use O_DIRECT, it is easier to offload
	the work through a helper process that mirrors the I/O between a
	pipe and the actual direct fd, so that the other end of the pipe
	no longer has to worry about constraints.

	Plus, if the kernel ever gains better posix_fadvise support, then we
	only have to touch a single file to let all callers benefit from a
	more efficient way to avoid file system caching.

	* src/util/virfile.h (virFileDirectFdFlag, virFileDirectFdNew)
	(virFileDirectFdClose, virFileDirectFdFree): New prototypes.
	* src/util/virdirect.c: Implement new wrapper object.
	* src/libvirt_private.syms (virfile.h): Export new symbols.
	* cfg.mk (useless_free_options): Add to list.
	* po/POTFILES.in: Add new translations.

2011-07-22  Eric Blake  <eblake@redhat.com>

	save: let iohelper work on O_DIRECT fds
	Required for a coming patch where iohelper will operate on O_DIRECT
	fds.  There, the user-space memory must be aligned to file system
	boundaries (at least 512, but using page-aligned works better, and
	some file systems prefer 64k).  Made tougher by the fact that
	VIR_ALLOC won't work on void *, but posix_memalign won't work on
	char * and isn't available everywhere.

	This patch makes some simplifying assumptions - namely, output
	to an O_DIRECT fd will only be attempted on an empty seekable
	file (hence, no need to worry about preserving existing data
	on a partial block, and ftruncate will work to undo the effects
	of having to round up the size of the last block written), and
	input from an O_DIRECT fd will only be attempted on a complete
	seekable file with the only possible short read at EOF.

	* configure.ac (AC_CHECK_FUNCS_ONCE): Check for posix_memalign.
	* src/util/iohelper.c (runIO): Use aligned memory, and handle
	quirks of O_DIRECT on last write.

2011-07-22  Eric Blake  <eblake@redhat.com>

	save: let iohelper handle inherited fd
	Rather than making the iohelper subject to a race in reopening
	the file, it is nicer to pass an already-open fd by inheritance.

	The old synopsis form must continue to work - if someone updates
	their libvirt package and installs a new libvirt_iohelper but
	without restarting the old libvirtd daemon, then the daemon can
	still make calls using the old syntax but the new iohelper.

	* src/util/iohelper.c (runIO): Split code for open...
	(prepare): ...to new function.
	(usage): Update synopsis.
	(main): Allow alternate calling form.
	* src/fdstream.c (virFDStreamOpenFileInternal): Use alternate form.

2011-07-22  Eric Blake  <eblake@redhat.com>

	save: support --xml to virsh save/restore
	Also, migrate was missing documentation for the --xml option
	added in commit ec5301cb.

	* tools/virsh.c (cmdSave, cmdRestore): Add xml argument.
	* tools/virsh.pod (save, restore, migrate): Document it.

2011-07-22  Eric Blake  <eblake@redhat.com>

	save: add --bypass-cache flag to virsh save/restore operations
	Wire up the new flag to several virsh commands.  Also, the
	'dump' command had undocumented flags.

	* tools/virsh.c (cmdSave, cmdManagedSave, cmdDump, cmdStart)
	(cmdRestore): Add new flag.
	* tools/virsh.pod (save, managedsave, dump, start, restore):
	Document flags.

2011-07-22  Eric Blake  <eblake@redhat.com>

	save: wire up trivial save/restore flags implementations
	For all hypervisors that support save and restore, the new API
	now performs the same functions as the old.

	VBox is excluded from this list, because its existing domainsave
	is broken (there is no corresponding domainrestore, and there
	is no control over the filename used in the save).  A later
	patch should change vbox to use its implementation for
	managedsave, and teach start to use managedsave results.

	* src/libxl/libxl_driver.c (libxlDomainSave): Move guts...
	(libxlDomainSaveFlags): ...to new function.
	(libxlDomainRestore): Move guts...
	(libxlDomainRestoreFlags): ...to new function.
	* src/test/test_driver.c (testDomainSave, testDomainSaveFlags)
	(testDomainRestore, testDomainRestoreFlags): Likewise.
	* src/xen/xen_driver.c (xenUnifiedDomainSave)
	(xenUnifiedDomainSaveFlags, xenUnifiedDomainRestore)
	(xenUnifiedDomainRestoreFlags): Likewise.
	* src/qemu/qemu_driver.c (qemudDomainSave, qemudDomainRestore):
	Rename and move guts.
	(qemuDomainSave, qemuDomainSaveFlags, qemuDomainRestore)
	(qemuDomainRestoreFlags): ...here.
	(qemudDomainSaveFlag): Rename...
	(qemuDomainSaveInternal): ...to this, and update callers.

2011-07-22  Eric Blake  <eblake@redhat.com>

	error: add new error type for reflecting partial API support
	VIR_ERR_INVALID_ARG implies that an argument cannot possibly
	be correct, given the current state of the API.
	VIR_ERR_CONFIG_UNSUPPORTED implies that a configuration is
	wrong, but arguments aren't configuration.
	VIR_ERR_NO_SUPPORT implies that a function is completely
	unimplemented.

	But in the case of a function that is partially implemented,
	yet the full power of the API is not available for that
	driver, none of the above messages make sense.  Hence a new
	error message, implying that the argument is known to comply
	with the current state of the API, and that while the driver
	supports aspects of the function, it does not support that
	particular use of the argument.

	A good use case for this is a driver that supports
	virDomainSaveFlags, but not the dxml argument of that API.

	It might be feasible to also use this new error for all functions
	that check flags, and which accept fewer flags than what is possible
	in the public API.  But doing so would get complicated, since
	neither libvirt.c nor the remote driver may do flag filtering,
	and every other driver would have to do a two-part check, first
	using virCheckFlags on all public flags (which gives
	VIR_ERR_INVALID_ARG for an impossible flag), followed by a
	particular mask check for VIR_ERR_ARGUMENT_UNSUPPORTED (for a
	possible public flag but unsupported by this driver).

	* include/libvirt/virterror.h (VIR_ERR_ARGUMENT_UNSUPPORTED): New
	error.
	* src/util/virterror.c (virErrorMsg): Give it a message.
	Suggested by Daniel P. Berrange.

2011-07-22  Eric Blake  <eblake@redhat.com>

	build: fix bugs with destroyFlags patches
	Build failure on xenapi_driver from compiler warnings (flags was unused).

	Build failure on xen (incorrect number of arguments).  And in fixing
	that, I obeyed the comments of struct xenUnifiedDriver that state
	that we want to minimize the number of callback functions in that
	struct, not add to it.

	* src/xen/xen_driver.c (xenUnifiedDomainDestroyFlags): Use correct
	arguments.
	(xenUnifiedDomainDestroy): Simplify.
	* src/xen/xen_driver.h (xenUnifiedDriver): Remove unused callback.
	* src/xen/xen_hypervisor.c (xenHypervisorDestroyDomain): Likewise.
	* src/xen/xend_internal.c (xenDaemonDomainDestroy): Likewise.
	* src/xen/xend_internal.h (xenDaemonDomainDestroyFlags): Likewise.
	* src/xen/xm_internal.c (xenXMDriver): Likewise.
	* src/xen/xs_internal.c (xenStoreDriver): Likewise.
	* src/xen/xen_inotify.c (xenInotifyDriver): Likewise.
	* src/xenapi/xenapi_driver.c (xenapiDomainDestroyFlags): Reject
	unknown flags.

2011-07-22  Michal Privoznik  <mprivozn@redhat.com>

	remote: Fix forgotten comma
	during conflict resolving

2011-07-22  Laine Stump  <laine@laine.org>

	network: internal API functions to manage assignment of physdev to guest
	The network driver needs to assign physical devices for use by modes
	that use macvtap, keeping track of which physical devices are in use
	(and how many instances, when the devices can be shared). Three calls
	are added:

	networkAllocateActualDevice - finds a physical device for use by the
	domain, and sets up the virDomainActualNetDef accordingly.

	networkNotifyActualDevice - assumes that the domain was already
	running, but libvirtd was restarted, and needs to be notified by each
	already-running domain about what interfaces they are using.

	networkReleaseActualDevice - decrements the usage count of the
	allocated physical device, and frees the virDomainActualNetDef to
	avoid later accidentally using the device.

	bridge_driver.[hc] - the new APIs. When WITH_NETWORK is false, these
	functions are all #defined to be "0" in the .h file (effectively
	becoming a NOP) to prevent link errors.

	qemu_(command|driver|hotplug|process).c - add calls to the above APIs
	    in the appropriate places.

	tests/Makefile.am - we need to include libvirt_driver_network.la
	    whenever libvirt_driver_qemu.la is linked, to avoid unreferenced
	    symbols (in functions that are never called by the test
	    programs...)

2011-07-22  Laine Stump  <laine@laine.org>

	qemu: use virDomainNetGetActual*() in qemuDomainXMLToNative
	This is the one function outside of domain_conf.c that plays around
	with (even modifying) the internals of the virDomainNetDef, and thus
	can't be fixed up simply by replacing direct accesses to the fields of
	the struct with the GetActual*() access functions.

	In this case, we need to check if the defined type is "network", and
	if it is *then* check the actual type; if the actual type is "bridge",
	then we can at least put the bridgename in a place where it can be
	used; otherwise (if type isn't "bridge"), we behave exactly as we used
	to - just null out *everything*.

2011-07-22  Laine Stump  <laine@laine.org>

	qemu: use virDomainNetGetActual*() functions where appropriate
	The qemu driver accesses fields in the virDomainNetDef directly, but
	with the advent of the virDomainActualNetDef, some pieces of
	information may be found in a different place (the ActualNetDef) if
	the network connection is of type='network' and that network is of
	forward type='bridge|private|vepa|passthrough'. The previous patch
	added functions to mask this difference from callers - they hide the
	decision making process and just pick the value from the proper place.

	This patch uses those functions in the qemu driver as a first step in
	making qemu work with the new network types. At this point, the
	virDomainActualNetDef is guaranteed always NULL, so the GetActualX()
	function will return exactly what the def->X that's being replaced
	would have returned (ie bisecting is not compromised).

	There is one place (in qemu_driver.c) where the internal details of
	the NetDef are directly manipulated by the code, so the GetActual
	functions cannot be used there without extra additional code; that
	file will be treated in a separate patch.

2011-07-22  Laine Stump  <laine@laine.org>

	network: separate Start/Shutdown functions for new network types
	Previously all networks were composed of bridge devices created and
	managed by libvirt, and the same operations needed to be done for all
	of them when they were started and stopped (create and start the
	bridge device, configure its MAC address and IP address, add iptables
	rules). The new network types are (for now at least) managed outside
	of libvirt, and the network object is used only to contain information
	about the network, which is then used as each individual guest
	connects itself.

	This means that when starting/stopping one of these new networks, we
	really want to do nothing, aside from marking the network as
	active/inactive.

	This has been setup as toplevel Start/Shutdown functions that do the
	small bit of common stuff, then have a switch statement to execute
	network type-specific start/shutdown code, then do a bit more common
	code. The type-specific functions called for the new host bridge and
	macvtap based types are currently empty.

	In the future these functions may actually do something, and we will
	surely add more functions that are similarly patterned. Once
	everything has settled, we can make a table of "sub-driver" function
	pointers for each network type, and store a pointer to that table in
	the network object, then we can replace the switch statements with
	calls to functions in the table.

	The final step in this will be to add a new table (and corresponding
	new functions) for new network types as they are added.

2011-07-22  Laine Stump  <laine@laine.org>

	conf: support abstracted interface info in network XML
	The network XML is updated in the following ways:

	1) The <forward> element can now contain a list of forward interfaces:

	     <forward .... >
	       <interface dev='eth10'/>
	       <interface dev='eth11'/>
	       <interface dev='eth12'/>
	       <interface dev='eth13'/>
	     </forward>

	   The first of these takes the place of the dev attribute that is
	   normally in <forward> - when defining a network you can specify
	   either one, and on output both will be present. If you specify
	   both on input, they must match.

	2) In addition to forward modes of 'nat' and 'route', these new modes
	   are supported:

	     private, passthrough, vepa - when this network is referenced by a
	     domain's interface, it will have the same effect as if the
	     interface had been defined as type='direct', e.g.:

	        <interface type='direct'>
	          <source mode='${mode}' dev='${dev}>
	          ...
	        </interface>

	     where ${mode} is one of the three new modes, and ${dev} is an interface
	     selected from the list given in <forward>.

	     bridge - if a <forward> dev (or multiple devs) is defined, and
	     forward mode is 'bridge' this is just like the modes 'private',
	     'passthrough', and 'vepa' above. If there is no forward dev
	     specified but a bridge name is given (e.g. "<bridge
	     name='br0'/>"), then guest interfaces using this network will use
	     libvirt's "host bridge" mode, equivalent to this:

	       <interface type='bridge'>
	          <source bridge='${bridge-name}'/>
	          ...
	       </interface>

	3) A network can have multiple <portgroup> elements, which may be
	   selected by the guest interface definition (by adding
	   "portgroup='${name}'" in the <source> element along with the
	   network name). Currently a portgroup can only contain a
	   virtportprofile, but the intent is that other configuration items
	   may be put there int the future (e.g. bandwidth config). When
	   building a guest's interface, if the <interface> XML itself has no
	   virtportprofile, and if the requested network has a portgroup with
	   a name matching the name given in the <interface> (or if one of the
	   network's portgroups is marked with the "default='yes'" attribute),
	   the virtportprofile from that portgroup will be used by the
	   interface.

	4) A network can have a virtportprofile defined at the top level,
	   which will be used by a guest interface when connecting in one of
	   the 'direct' modes if the guest interface XML itself hasn't
	   specified any virtportprofile, and if there are also no matching
	   portgroups on the network.

2011-07-22  Laine Stump  <laine@laine.org>

	conf: support abstracted interface info in domain interface XML
	the domain XML <interface> element is updated in the following ways:

	1) <virtualportprofile> can be specified when source type='network'
	(previously it was only valid for source type='direct')

	2) A new attribute "portgroup" has been added to the <source>
	element. When source type='network' (the only time portgroup is
	recognized), extra configuration information will be taken from the
	<portgroup> element of the given name in the network definition.

	3) Each virDomainNetDef now also potentially has a
	virDomainActualNetDef which is a private object (never
	exported/imported via the public API, and not defined in the RNG) that
	is used to maintain information about the physical device that was
	actually used for a NetDef of type VIR_DOMAIN_NET_TYPE_NETWORK.

	The virDomainActualNetDef will only be parsed/formatted if the
	parse/format function is called with the
	VIR_DOMAIN_XML_INTERNAL_ACTUAL_NET flag set (which is only needed when
	saving/loading a running domain's state info to the stateDir).

2011-07-22  Laine Stump  <laine@laine.org>

	conf: virDomainNetDef points to (rather than contains) virtPortProfile
	The virtPortProfile in the domain interface struct is now a separately
	allocated object *pointed to by* (rather than contained in) the main
	virDomainNetDef object. This is done to make it easier to figure out
	when a virtualPortProfile has/hasn't been specified in a particular
	config.

	conf: put virtPortProfile struct / functions in a common location
	virtPortProfiles are currently only used in the domain XML, but will
	soon also be used in the network XML. To prepare for that change, this
	patch moves the structure definition into util/network.h and the parse
	and format functions into util/network.c (I decided that this was a
	better choice than macvtap.h/c for something that needed to always be
	available on all platforms).

	util: define MAX
	If util.h is going to have a MIN, it may as well also have MAX.

2011-07-22  Michal Privoznik  <mprivozn@redhat.com>

	destroy: Implement internal API for xenapi driver

	destroy: Implement internal API for xen driver

	destroy: Implement internal API for vmware driver

	destroy: Implement internal API for vbox driver

	destroy: Implement internal API for uml driver

	destroy: Implement internal API for phyp driver

	destroy: Implement internal API for openvz driver

	destroy: Implement internal API for lxc driver

	destroy: Implement internal API for libxl driver

	destroy: Implement internal API for ESX driver

	destroy: Implement internal API for qemu driver

	destroy: Wire up the remote protocol

2011-07-22  Michal Privoznik  <mprivozn@redhat.com>

	destroy: Define new public API virDomainDestroyFlags
	This introduces new API virDomainDestroyFlags to allow
	domain destroying with flags, as the existing API virDomainDestroy
	misses flags.

	The set of flags is defined in virDomainDestroyFlagsValues enum,
	which is currently commented, because it is empty.

	Calling this API with no flags set (@flags == 0) is equivalent calling
	virDomainDestroy.

2011-07-22  Eric Blake  <eblake@redhat.com>

	save: wire up remote protocol
	* src/remote/remote_driver.c (remote_driver): Add new callbacks.
	* src/remote/remote_protocol.x (remote_procedure): New RPCs.
	(remote_domain_save_flags_args, remote_domain_restore_flags_args):
	New structs.
	* src/remote_protocol-structs: Update.

2011-07-22  Eric Blake  <eblake@redhat.com>

	save: new public API to bypass file system cache on save/restore
	In order to choose whether to use O_DIRECT when saving a domain image
	to a file, we need a new flag.  But virDomainSave was implemented
	before our policy of all new APIs having a flag argument.  Likewise
	for virDomainRestore when restoring from a file.

	The new flag name is chosen as CACHE_BYPASS so as not to preclude
	a future solution that uses posix_fadvise once the Linux kernel has
	a smarter implementation of that interface.

	* include/libvirt/libvirt.h.in (virDomainCreateFlags)
	(virDomainCoreDumpFlags): Add a flag.
	(virDomainSaveFlags, virDomainRestoreFlags): New prototypes.
	* src/libvirt.c (virDomainSaveFlags, virDomainRestoreFlags): New API.
	* src/libvirt_public.syms: Export them.
	* src/driver.h (virDrvDomainSaveFlags, virDrvDomainRestoreFlags):
	New driver callbacks.

2011-07-22  Eric Blake  <eblake@redhat.com>

	qemu: fix error message with migrate2 xml
	Otherwise, an ABI mismatch gives error messages attributing the target
	xml string as current, and the current domain state as the new xml.

	* src/qemu/qemu_migration.c (qemuMigrationBegin): Use correct
	argument order.

2011-07-22  Eric Blake  <eblake@redhat.com>

	build: rename files.h to virfile.h
	In preparation for a future patch adding new virFile APIs.

	* src/util/files.h, src/util/files.c: Move...
	* src/util/virfile.h, src/util/virfile.c: ...here, and rename
	functions to virFile prefix.  Macro names are intentionally
	left alone.
	* *.c: All '#include "files.h"' uses changed.
	* src/Makefile.am (UTIL_SOURCES): Reflect rename.
	* cfg.mk (exclude_file_name_regexp--sc_prohibit_close): Likewise.
	* src/libvirt_private.syms: Likewise.
	* docs/hacking.html.in: Likewise.
	* HACKING: Regenerate.

2011-07-22  Eric Blake  <eblake@redhat.com>

	command: avoid leaking fds across fork
	Since libvirt is multi-threaded, we should use FD_CLOEXEC as much
	as possible in the parent, and only relax fds to inherited after
	forking, to avoid leaking an fd created in one thread to a fork
	run in another thread.  This gets us closer to that ideal, by
	making virCommand automatically clear FD_CLOEXEC on fds intended
	for the child, as well as avoiding a window of time with non-cloexec
	pipes created for capturing output.

	* src/util/command.c (virExecWithHook): Use CLOEXEC in parent.  In
	child, guarantee that all fds to pass to child are inheritable.
	(getDevNull): Use CLOEXEC.
	(prepareStdFd): New helper function.
	(virCommandRun, virCommandRequireHandshake): Use pipe2.
	* src/qemu/qemu_command.c (qemuBuildCommandLine): Simplify caller.

2011-07-22  Eric Blake  <eblake@redhat.com>

	command: move all docs into .c file
	We already have a precedent of function documentation in C files,
	where it is closer to the implementation (witness libvirt.h vs.
	libvirt.c); maintaining docs in both files risks docs going stale.

	While I was at it, I used consistent doxygen style on all comments.

	* src/util/command.h: Remove duplicate docs, and move unique
	documentation...
	* src/util/command.c: ...here.
	Suggested by Matthias Bolte.

2011-07-21  Matthias Bolte  <matthias.bolte@googlemail.com>

	rpc: Make the dispatch generator handle 'void name(void)' style procedures
	The only 'void name(void)' style procedure in the protocol is 'close' that
	is handled special, but also programming errors like a missing _args or
	_ret suffix on the structs in the .x files can create such a situation by
	accident. Making the generator aware of this avoids bogus errors from the
	generator such as:

	  Use of uninitialized value in exists at ./rpc/gendispatch.pl line 967.

	Also this allows to get rid of the -c option and the special case code for
	the 'close' procedure, as the generator handles it now correctly.

	Reported by Michal Privoznik

2011-07-21  Eric Blake  <eblake@redhat.com>

	error: preserve errno when saving last error
	It is common to see the sequence:

	virErrorPtr save_err = virSaveLastError();
	// do cleanup
	virSetError(save_err);
	virFreeError(save_err);

	on cleanup paths.  But for functions where it is desirable to
	return the errno that caused failure, this sequence can clobber
	that errno.  virFreeError was already safe; this makes the other
	two functions in the sequence safe as well, assuming all goes
	well (on OOM, errno will be clobbered, but then again, save_err
	won't reflect the real error that happened, so you are no longer
	preserving the real situation - that's life with OOM).

	* src/util/virterror.c (virSaveLastError, virSetError): Preserve
	errno.

2011-07-21  Matthias Bolte  <matthias.bolte@googlemail.com>

	python: Fix makefile rule for code generation
	Commit 8665f85523f0451c changed generated.stamp to $(GENERATE).stamp,
	but missed one instance in the CLEANFILES list. This can break the
	build in case the generated code is deleted but the .stamp file stays
	around and therefore the code isn't regenerated.

2011-07-21  Daniel P. Berrange  <berrange@redhat.com>

	Fix uninitialized variable in QEMU CPU bandwidth code
	* src/qemu/qemu_driver.c: Fix uninitialized variable

2011-07-21  Wen Congyang  <wency@cn.fujitsu.com>

	fix make syntax-check error

	doc: Add documentation for new cputune elements period and quota
	We have added element period and quota. Document them in formatdomain.html.in.

	qemu: Implement cfs_period and cfs_quota's modification
	This patch implements cfs_period and cfs_quota's modification.
	We can use the command 'virsh schedinfo' to query or modify cfs_period and
	cfs_quota.
	If you query period or quota from config file, the value 0 means it does not set
	in the config file.
	If you set period or quota to config file, the value 0 means that delete current
	setting from config file.
	If you modify period or quota while vm is running, the value 0 means that use
	current value.

	qemu: Implement period and quota tunable XML configuration and parsing
	This patch implements period and quota tunable XML configuration and parsing.
	A quota or period of zero will be simply ignored.

	Update XML Schema for new entries
	Define the element cputune's child elements 'period' and 'quota':
	<cputune>
	  <period>100000</period>
	  <quota>50000</quota>
	</cputune>

	cgroup: Implement cpu.cfs_period_us and cpu.cfs_quota_us tuning API
	This patch provides 4 APIs to get and set cpu.cfs_period_us and cpu.cfs_quota_us.

	Introduce the function virCgroupForVcpu
	Introduce the function virCgroupForVcpu() to create sub directory for each vcpu.

2011-07-21  Lai Jiangshan  <laijs@cn.fujitsu.com>

	qemu: send-key: Implement the driver methods
	qemu driver just accept xt_kbd codeset's keycode, so the lib virtkey
	is used for translating keycodes from other codesets

	send-key: Expose the new API in virsh
	Also support string names for the linux keycode(auto detect)
	* tools/virsh.c: add new command "send-key"
	* tools/virsh.pod: documents the new command

2011-07-21  Lai Jiangshan  <laijs@cn.fujitsu.com>

	util: add virtkeycode module
	Add virtkey lib for usage-improvment and keycode translating.
	Add 4 internal API for the aim

	const char *virKeycodeSetTypeToString(int codeset);
	int virKeycodeSetTypeFromString(const char *name);
	int virKeycodeValueFromString(virKeycodeSet codeset, const char *keyname);
	int virKeycodeValueTranslate(virKeycodeSet from_codeset,
	                             virKeycodeSet to_offset,
	                             int key_value);

	* include/libvirt/libvirt.h.in: extend virKeycodeSet enum
	* src/Makefile.am: add new virtkeycode module and rule to generate
	  virkeymaps.h
	* src/util/virkeycode.c src/util/virkeycode.h: new module
	* src/util/virkeycode-mapgen.py: python generator for virkeymaps.h
	  out of keymaps.csv
	* src/libvirt_private.syms: extend private symbols for new module
	* .gitignore: add generated virkeymaps.h

2011-07-21  Lai Jiangshan  <laijs@cn.fujitsu.com>

	util: Add keymaps.csv
	Should keep it as the same as:
	http://git.gnome.org/browse/gtk-vnc/commit/src/keymaps.csv

	All master  keymaps are defined in a CSV file. THis covers
	Linux keycodes, OSX keycodes, AT set1, 2 & 3, XT keycodes,
	the XT encoding used by the Linux KBD driver, USB keycodes,
	Win32 keycodes, the XT encoding used by Xorg on Cygwin,
	the XT encoding used by Xorg on Linux with kbd driver.

	* src/Makefile.am: added to EXTRA_DIST
	* src/util/keymaps.csv: new file

2011-07-21  Eric Blake  <eblake@redhat.com>

	maint: fix typos on guaranteed
	* src/conf/domain_event.c (virDomainEventDispatch): Fix typo.
	* src/internal.h (ATTRIBUTE_FMT_PRINTF): Likewise.
	* src/libvirt.c (virStreamEventUpdateCallback): Likewise.
	* src/remote/remote_driver.c (doRemoteOpen): Likewise.
	* src/storage/storage_backend_fs.c (virStorageBackendProbeTarget):
	Likewise.
	* src/util/virterror.c (virConnCopyLastError, virCopyLastError):
	Likewise.
	* src/xen/xend_internal.h (xend_wait_for_devices): Likewise.

2011-07-21  Cole Robinson  <crobinso@redhat.com>

	rpc: Pass through DISPLAY so ssh can launch askpass
	Though we prefer users to have SSH keys setup, virt-manager users still
	depend on remote SSH connections to launch a password dialog. This fixes
	launch ssh-askpass

	Fix suggested by danpb

2011-07-20  Michal Privoznik  <mprivozn@redhat.com>

	sysinfo: Don't try to run dmidecode on archs missing it
	DMI table is Intel & Intel-compatible specific. Therefore other
	architectures miss dmidecode command. So we always fail in searching
	for that command on non-Intel architectures.

2011-07-20  Guannan Ren  <gren@redhat.com>

	Don't try to close a NULL virNetClientPtr
	* src/rpc/virnetclient.c: Skip close attempt if virNetClientPtr
	  is NULL

2011-07-20  Daniel P. Berrange  <berrange@redhat.com>

	Honour key usage/purpose criticality flag
	If a key purpose or usage field is marked as non-critical in the
	certificate, then a data mismatch is not (ordinarily) a cause for
	rejecting the connection

	* src/rpc/virnettlscontext.c: Honour key usage/purpose criticality

2011-07-20  Daniel P. Berrange  <berrange@redhat.com>

	Fix checking of key usage/purpose data
	If key usage or purpose data is not present in the cert, the
	RFC recommends that access be allowed. Also fix checking of
	key usage to include requirements for client/server certs,
	and fix key purpose checking to treat data as a list of bits

	Fix mixed up error messages when reporting TLS certificate problems
	* src/rpc/virnettlscontext.c: Fix mixed up error messages

2011-07-20  Michal Privoznik  <mprivozn@redhat.com>

	udev: Don't try to dump DMI on non-intel archs
	DMI is Intel & Intel-compatible specific. Don't try to dump information
	on non-compatible architectures, which results only in error message in
	logs.

2011-07-20  Eric Blake  <eblake@redhat.com>

	build: fix broken build
	* src/libxl/libxl_driver.c (libxlDomainUndefineFlags): Use correct
	enum value.
	* src/remote_protocol-structs (remote_procedure): Likewise.

2011-07-20  Osier Yang  <jyang@redhat.com>

	undefine: Extend virsh undefine to support the new flag
	If the domain has managed save image, and --managed-save is
	not specified, then it fails with an error telling the user
	that a managed save image still exists.

	If the domain has managed save image, and --managed-save is
	specified, it invokes virDomainUndefineFlags. If
	virDomainUndefineFlags fails, then it tries to remove the managed
	save image using virDomainManagedSaveRemove first, with
	invoking virDomainUndefine following. (For compatibility between
	new virsh with this patch and older libvirt without this patch).

	Similarly if the domain has no managed save image. See the codes for
	detail.

	NOTE: Have not removing the codes checking if the domain is running
	in function "cmdUndefine", it will go along with qemu driver's fix
	(allow to undefine a running domain).

2011-07-20  Osier Yang  <jyang@redhat.com>

	undefine: Implement undefineFlags for all other drivers

	undefine: Implement internal API for libxl driver
	* src/libxl/libxl_driver.c: New callback for libxl_driver,
	new function libxlDomainUndefineFlags, and changes libxlDomainUndefine
	as a wrapper of libxlDomainUndefineFlags.

	undefine: Implement internal API for qemu driver
	* src/qemu/qemu_driver.c: New call back for qemu_driver,
	New function qemudDomainUndefineFlags, and changes on
	qemudDomainUndefine.

	undefine: Wire up the remote protocol

2011-07-20  Osier Yang  <jyang@redhat.com>

	undefine: Define the new API
	This introduces a new API virDomainUndefineFlags to control the
	domain undefine process, as the existing API virDomainUndefine
	doesn't support flags.

	Currently only flag VIR_DOMAIN_UNDEFINE_MANAGED_SAVE is supported.
	If the domain has a managed save image, including
	VIR_DOMAIN_UNDEFINE_MANAGED_SAVE in @flags will also remove that
	file, and omitting the flag will cause undefine process to fail.

	This patch also changes the behavior of virDomainUndefine, if the
	domain has a managed save image, the undefine will be refused.

2011-07-20  Eric Blake  <eblake@redhat.com>

	maint: fix spelling of Red Hat
	* cfg.mk (sc_copyright_format): Add to rule.
	* src/util/files.h: Fix offenders.
	* src/util/files.c: Likewise.

2011-07-19  Daniel P. Berrange  <berrange@redhat.com>

	Add sanity checking of basic constraints, key purpose & key usage
	Gnutls requires that certificates have basic constraints present
	to be used as a CA certificate. OpenSSL doesn't add this data
	by default, so add a sanity check to catch this situation. Also
	validate that the key usage and key purpose constraints contain
	correct data

	* src/rpc/virnettlscontext.c: Add sanity checking of certificate
	  constraints

2011-07-19  Daniel P. Berrange  <berrange@redhat.com>

	Add some basic sanity checking of certificates before use
	If the libvirt daemon or libvirt client is configured with bogus
	certificates, it is very unhelpful to only find out about this
	when a TLS connection is actually attempted. Not least because
	the error messages you get back for failures are incredibly
	obscure.

	This adds some basic sanity checking of certificates at the
	time the virNetTLSContext object is created. This is at libvirt
	startup, or when creating a virNetClient instance.

	This checks that the certificate expiry/start dates are valid
	and that the certificate is actually signed by the CA that is
	loaded.

	* src/rpc/virnettlscontext.c: Add certificate sanity checks

2011-07-19  Daniel P. Berrange  <berrange@redhat.com>

	Fix reporting of errors for p2p migration
	Starting/ending jobs when closing the connection may reset any
	error which was reported earlier in p2p migration. We must
	save the original error before doing so. This means we can also
	just call virConnectClose as normal, instead of virUnrefConnect

	* src/qemu/qemu_migration.c: Preserve errors in p2p migration

2011-07-19  Daniel P. Berrange  <berrange@redhat.com>

	Add an explicit virNetClientClose method
	Since the I/O callback registered against virNetSocket will
	hold a reference on the virNetClient, we can't rely on the
	virNetClientFree to be able to close the network connection.
	The last reference will only go away when the event callback
	fires (likely due to EOF from the server).

	This is sub-optimal and can potentially cause a leak of the
	virNetClient object if the server were to not explicitly
	close the socket itself

	* src/remote/remote_driver.c: Explicitly close the client
	  object when disconnecting
	* src/rpc/virnetclient.c, src/rpc/virnetclient.h: Add a
	  virNetClientClose method

2011-07-19  Daniel P. Berrange  <berrange@redhat.com>

	Use a virFreeCallback on virNetSocket to ensure safe release
	When unregistering an I/O callback from a virNetSocket object,
	there is still a chance that an event may come in on the callback.
	In this case it is possible that the virNetSocket might have been
	freed already. Make use of a virFreeCallback when registering
	the I/O callbacks and hold a reference for the entire time the
	callback is set.

	* src/rpc/virnetsocket.c: Register a free function for the
	  file handle watch
	* src/rpc/virnetsocket.h, src/rpc/virnetserverservice.c,
	  src/rpc/virnetserverclient.c, src/rpc/virnetclient.c: Add
	  a free function for the socket I/O watches

2011-07-19  Daniel P. Berrange  <berrange@redhat.com>

	Add mutex locking and reference counting to virNetSocket
	Remove the need for a virNetSocket object to be protected by
	locks from the object using it, by introducing its own native
	locking and reference counting

	* src/rpc/virnetsocket.c: Add locking & reference counting

2011-07-19  Daniel P. Berrange  <berrange@redhat.com>

	Add some debugging for virNetClient reference counting
	* src/rpc/virnetclient.c: Add debugging of ref counts

2011-07-19  Eric Blake  <eblake@redhat.com>

	build: detect doc generation failure
	Commit 8665f85 introduced a slight regression in doc generation,
	since make only quits a rule on the first failed command ending
	with a newline rather than a semicolon.

	* docs/Makefile.am (html/index.html): Don't use xmllint unless
	xsltproc succeeded.
	* .gitignore: Ignore recently updated stamp file name.

2011-07-19  Alex Jia  <ajia@redhat.com>

	util: avoid fds leak when virEventPollAddHandle fail
	* src/util/event_poll.c: avoid file descriptors leak when
	  virEventPollAddHandle fail on virEventPollInit function.

2011-07-19  Eric Blake  <eblake@redhat.com>

	Revert "virsh: make migrate --tunnelled imply --p2p"
	This reverts commit 40143fb697c3cb042197632c0286e7dadf40afd4.

	The patch prevents future compatibility if migration ever learns
	how to do tunnelled without p2p.

2011-07-19  Daniel P. Berrange  <berrange@redhat.com>

	Unregister event callback if a fatal error occurs during dispatch
	If we get an I/O error in the async event callback for an RPC
	client, we might not have consumed all pending data off the
	wire. This could result in the callback being immediately
	invoked again. At which point the same I/O might occur. And
	we're invoked again. And again...And again...

	Unregistering the async event callback if an error occurs is
	a good safety net. The real error will be seen when the next
	RPC method is invoked

	* src/rpc/virnetclient.c: Unregister event callback on error

2011-07-19  Daniel P. Berrange  <berrange@redhat.com>

	Quieten build & ensure API build scripts exit with non-zero status
	The current API build scripts will continue and exit with a zero
	status even if they find problems. This has been the cause of many
	build problems, or hidden build errors, in the past. Change the
	scripts so they always exit with a non-zero status for any problems
	they do not understand. Also turn off all debug output by default
	so they respect $(AM_V_GEN)

	* docs/Makefile.am: Use $(AM_V_GEN) for API/HTML scripts
	* docs/apibuild.py, python/generator.py: Exit with non-zero status
	  if problems are found. Also be silent, not outputting any debug
	  messages.
	* src/Makefile.am: Use $(AM_V_GEN) for ESX generator
	* python/Makefile.am: Tweak rule

2011-07-19  Osier Yang  <jyang@redhat.com>

	tests: Fix virshtest failure after dominfo changed
	Caused by the new changed "dominfo" command.

	virsh: Extend virsh dominfo to display if managed save image exists
	* tools/virsh.c: new column "Managed save" for "cmdDominfo".
	* tools/virsh.pod: Update document of "managedsave" to tell one can
	  use "dominfo" to query whether a domain has any managed save image.

	doc: Correct documents for iface commands
	The problems:
	    * Duplicate documents for "iface-name"
	    * Lacks of document for "iface-mac"
	    * Inconsistent option names with virsh help strings.

2011-07-19  Eric Blake  <eblake@redhat.com>

	virsh: make migrate --tunnelled imply --p2p
	We can make the virsh migrate UI friendlier by supplying the
	missing bit automatically instead of erroring out when requesting
	--tunnelled without --p2p.

	* tools/virsh.c (doMigrate): Make --p2p optional when using
	--tunnelled.
	* tools/virsh.pod (migrate): Tweak wording accordingly.

2011-07-19  Eric Blake  <eblake@redhat.com>

	libvirt: do not mix internal flags into public API
	There were two API in driver.c that were silently masking flags
	bits prior to calling out to the drivers, and several others
	that were explicitly masking flags bits.  This is not
	forward-compatible - if we ever have that many flags in the
	future, then talking to an old server that masks out the
	flags would be indistinguishable from talking to a new server
	that can honor the flag.  In general, libvirt.c should forward
	_all_ flags on to drivers, and only the drivers should reject
	unknown flags.

	In the case of virDrvSecretGetValue, the solution is to separate
	the internal driver callback function to have two parameters
	instead of one, with only one parameter affected by the public
	API.  In the case of virDomainGetXMLDesc, it turns out that
	no one was ever mixing VIR_DOMAIN_XML_INTERNAL_STATUS with
	the dumpxml path in the first place; that internal flag was
	only used in saving and restoring state files, which happened
	to be in functions internal to a single file, so there is no
	mixing of the internal flag with a public flags argument.
	Additionally, virDomainMemoryStats passed a flags argument
	over RPC, but not to the driver.

	* src/driver.h (VIR_DOMAIN_XML_FLAGS_MASK)
	(VIR_SECRET_GET_VALUE_FLAGS_MASK): Delete.
	(virDrvSecretGetValue): Separate out internal flags.
	(virDrvDomainMemoryStats): Provide missing flags argument.
	* src/driver.c (verify): Drop unused check.
	* src/conf/domain_conf.h (virDomainObjParseFile): Delete
	declaration.
	(virDomainXMLInternalFlags): Move...
	* src/conf/domain_conf.c: ...here.  Delete redundant include.
	(virDomainObjParseFile): Make static.
	* src/libvirt.c (virDomainGetXMLDesc, virSecretGetValue): Update
	clients.
	(virDomainMemoryPeek, virInterfaceGetXMLDesc)
	(virDomainMemoryStats, virDomainBlockPeek, virNetworkGetXMLDesc)
	(virStoragePoolGetXMLDesc, virStorageVolGetXMLDesc)
	(virNodeNumOfDevices, virNodeListDevices, virNWFilterGetXMLDesc):
	Don't mask unknown flags.
	* src/interface/netcf_driver.c (interfaceGetXMLDesc): Reject
	unknown flags.
	* src/secret/secret_driver.c (secretGetValue): Update clients.
	* src/remote/remote_driver.c (remoteSecretGetValue)
	(remoteDomainMemoryStats): Likewise.
	* src/qemu/qemu_process.c (qemuProcessGetVolumeQcowPassphrase):
	Likewise.
	* src/qemu/qemu_driver.c (qemudDomainMemoryStats): Likewise.
	* daemon/remote.c (remoteDispatchDomainMemoryStats): Likewise.

2011-07-19  Alex Jia  <ajia@redhat.com>

	virsh: avoid double free of domain
	* tools/virsh.c: avoid double free of domain, when weight value of blkiotune
	  less than 0, codes will free domain and jump to cleanup section, however,
	  cleanup will free domain again.

	Detected in valgrind run:

	==21297== ERROR SUMMARY: 20 errors from 20 contexts (suppressed: 69 from 8)
	==21297==
	==21297== 1 errors in context 1 of 20:
	==21297== Invalid read of size 4
	==21297==    at 0x40E209B: virDomainFree (libvirt.c:2096)
	==21297==    by 0x8065274: cmdBlkiotune (virsh.c:3695)
	==21297==    by 0x8054CC1: vshCommandRun (virsh.c:13135)
	==21297==    by 0x806B967: main (virsh.c:14487)
	==21297==  Address 0x446ad48 is 0 bytes inside a block of size 36 free'd
	==21297==    at 0x4005B0A: free (vg_replace_malloc.c:325)
	==21297==    by 0x406814D: virFree (memory.c:310)
	==21297==    by 0x40D6635: virReleaseDomain (datatypes.c:243)
	==21297==    by 0x40D6C5E: virUnrefDomain (datatypes.c:280)
	==21297==    by 0x40E20B9: virDomainFree (libvirt.c:2101)
	==21297==    by 0x8065297: cmdBlkiotune (virsh.c:3613)
	==21297==    by 0x8054CC1: vshCommandRun (virsh.c:13135)
	==21297==    by 0x806B967: main (virsh.c:14487)
	==21297==
	==21297==
	==21297== 1 errors in context 2 of 20:
	==21297== Invalid read of size 4
	==21297==    at 0x40E1FE6: virDomainFree (libvirt.c:2092)
	==21297==    by 0x8065274: cmdBlkiotune (virsh.c:3695)
	==21297==    by 0x8054CC1: vshCommandRun (virsh.c:13135)
	==21297==    by 0x806B967: main (virsh.c:14487)
	==21297==  Address 0x446ad48 is 0 bytes inside a block of size 36 free'd
	==21297==    at 0x4005B0A: free (vg_replace_malloc.c:325)
	==21297==    by 0x406814D: virFree (memory.c:310)
	==21297==    by 0x40D6635: virReleaseDomain (datatypes.c:243)
	==21297==    by 0x40D6C5E: virUnrefDomain (datatypes.c:280)
	==21297==    by 0x40E20B9: virDomainFree (libvirt.c:2101)
	==21297==    by 0x8065297: cmdBlkiotune (virsh.c:3613)
	==21297==    by 0x8054CC1: vshCommandRun (virsh.c:13135)
	==21297==    by 0x806B967: main (virsh.c:14487)

	* how to reproduce?
	  % valgrind -v --leak-check=full virsh blkiotune guestname --weight -1

2011-07-19  Eric Blake  <eblake@redhat.com>

	docs: improve virsh man page synopses
	"optional" is not a very good meta-syntactic construct in our man
	page.  I scrubbed this, and additionally improved some documentation
	on mutually exclusive options.  For example,

	[[--live] [--config] | [--current]]

	implies a set of optional flags, where within the set you can have
	either --current or a choice of 0, 1, or both --live and --config.

	* tools/virsh.pod: Use "[name]" rather than "optional name" for
	optional arguments.

2011-07-19  Jiri Denemark  <jdenemar@redhat.com>

	build: Fix protocol-structs check in VPATH build
	$@ already included $(srcdir)

2011-07-18  Daniel P. Berrange  <berrange@redhat.com>

	Fix now dead cleanup of VMs on libvirtd restart
	When libvirtd restarts it will attempt to reconnect to existing
	LXC containers. If it loads a XML state file for the container
	the container will appear running. If we fail to read the PID
	file, or fail to connect to the LXC monitor, we should be killing
	off the guest, but if the VMs cgroup does not exist any more,
	cleanup will get skipped. Reading the PID file is also pointless
	since the PID is in the XML statefile

	In lxcReconnectVM we do not need to read the PID file. If part
	of the reconnect process fails we need to run the VM terminate
	code as a safety net.

	In lxcVMTerminate, if we can't obtain the VM cgroup, we know
	the process has died, but we must still run lxcVMCleanup to
	clear out the virDomainObjPtr live state

	* src/lxc/lxc_driver.c: Fix cleanup of dead VMs on restart

2011-07-18  Michal Privoznik  <mprivozn@redhat.com>

	docs: Fix spice documentation typo
	We missed ending tag for paragraph element

2011-07-17  Osier Yang  <jyang@redhat.com>

	rpc: Fix typos in rpc generator scripts
	These typos are introduced by file renaming in commit b17b4afaf.

	src/remote/qemu_protocol.x \
	src/remote/remote_protocol.x \
	src/rpc/gendispatch.pl:
	    s/remote_generator/gendispatch/

	src/rpc/genprotocol.pl:
	    s/remote\/remote_protocol/remote_protocol/

2011-07-16  Osier Yang  <jyang@redhat.com>

	qemu: Fix a regression of attaching device
	The regression is introduced by Commit da1eba6b, the new
	codes with this commit doesn't reset "ret" to "-1" when
	it fails on parsing the device XML (live device attachment)

	This patch changes the codes to reset the "ret" and "-1",
	and also changes the codes so that it don't modify "ret"
	for condition checking.

	How to reproduce:

	% cat test.xml
	<disk type='oops' device='disk'>
	  <driver name='qemu' type='raw'/>
	  <source file='/var/lib/libvirt/images/test.img'/>
	  <target dev='vda' bus='virtio'/>
	</disk>

	% virsh attach-device $domain test.xml
	Device attached successfully

	The device attachment failed actually with error "unknown disk type 'oops'",
	however, it reports success.

2011-07-16  Eric Blake  <eblake@redhat.com>

	build: also track RPC on-wire enum values
	As long as we guarantee RPC struct layout stability, we might as
	well also guarantee RPC enum value constancy.

	* src/Makefile.am (r1, r2, PDWTAGS): Adjust rule to pick up named
	and anonymous enums.
	* src/remote_protocol-structs: Add enum values.
	* src/qemu_protocol-structs: Likewise.
	* src/virnetprotocol-structs: Likewise.

2011-07-16  Eric Blake  <eblake@redhat.com>

	docs: document dxml argument to migrate2
	Commit 135554166 introduced a nice feature without documenting it.

	* src/libvirt.c (virDomainMigrate2): Add paragraph.

2011-07-16  Eric Blake  <eblake@redhat.com>

	build: add syntax check for proper flags use
	Enforce the recent flags cleanups - we want to use 'unsigned int flags'
	in any of our APIs (except where backwards compatibility is important,
	in the public migration APIs), and that all flags are checked for
	validity (except when there are stub functions that completely
	ignore the flags argument).

	There are a few minor tweaks done here to avoid false positives:
	signed arguments passed to open() are renamed oflags, and flags
	arguments that are legitimately ignored are renamed flags_unused.

	* cfg.mk (sc_flags_usage): New rule.
	(exclude_file_name_regexp--sc_flags_usage): And a few exemptions.
	(sc_flags_debug): Tweak wording.
	* src/util/iohelper.c (runIO, main): Rename variable.
	* src/util/util.c (virSetInherit): Likewise.
	* src/fdstream.h (virFDStreamOpenFile, virFDStreamCreateFile):
	Likewise.
	* src/fdstream.c (virFDStreamOpenFileInternal)
	(virFDStreamOpenFile, virFDStreamCreateFile): Likewise.
	* src/util/command.c (virExecWithHook) [WIN32]: Likewise.
	* src/util/util.c (virFileOpenAs, virDirCreate) [WIN32]: Likewise.
	* src/locking/lock_manager.c (virLockManagerPluginNew)
	[!HAVE_DLFCN_H]: Likewise.
	* src/locking/lock_driver_nop.c (virLockManagerNopNew)
	(virLockManagerNopAddResource, virLockManagerNopAcquire)
	(virLockManagerNopRelease, virLockManagerNopInquire): Likewise.

2011-07-16  Eric Blake  <eblake@redhat.com>

	xen: reject unknown flags
	Also fix a logic bug in xenXMDomain{Attach,Detach}DeviceFlags,
	where (flags & VIR_DOMAIN_DEVICE_MODIFY_CURRENT) is always false.

	* src/xen/xen_driver.c (xenUnifiedDomainXMLFromNative)
	(xenUnifiedDomainXMLToNative, xenUnifiedDomainBlockPeek): Reject
	unknown flags.
	* src/xen/xen_hypervisor.c (xenHypervisorOpen)
	(xenHypervisorGetDomainState): Likewise.
	* src/xen/xen_inotify.c (xenInotifyOpen): Likewise.
	* src/xen/xs_internal.c (xenStoreOpen, xenStoreDomainGetState)
	(xenStoreDomainReboot): Likewise.
	* src/xen/xend_internal.c (xenDaemonOpen, xenDaemonDomainReboot)
	(xenDaemonDomainCoreDump, xenDaemonDomainGetState)
	(xenDaemonDomainMigratePrepare, xenDaemonDomainSetVcpusFlags,
	xenDaemonDomainGetVcpusFlags, xenDaemonAttachDeviceFlags,
	xenDaemonDetachDeviceFlags): Likewise.
	(xenDaemonDomainGetXMLDesc): Prefer unsigned flags.
	* src/xen/xend_internal.h (xenDaemonDomainGetXMLDesc): Likewise.
	* src/xen/xm_internal.h (xenXMDomainGetXMLDesc): Likewise.
	* src/xen/xm_internal.c (xenXMDomainGetXMLDesc): Likewise.
	(xenXMOpen, xenXMDomainGetState, xenXMDomainSetVcpusFlags)
	(xenXMDomainGetVcpusFlags): Reject unknown flags.
	(xenXMDomainAttachDeviceFlags, xenXMDomainDetachDeviceFlags):
	Likewise, and avoid always-false conditional.
	* src/xen/xen_driver.h (XEN_MIGRATION_FLAGS): New define.

2011-07-16  Eric Blake  <eblake@redhat.com>

	esx: reject unknown flags
	Silently ignored flags get in the way of new features that
	use those flags.

	Regarding ESX migration flags - right now, ESX silently enforces
	VIR_MIGRATE_PERSIST_DEST, VIR_MIGRATE_UNDEFINE_SOURCE, and
	VIR_MIGRATE_LIVE, even if those flags were not supplied; it ignored
	other flags.  This patch does not change the implied bits (it permits
	but does not require them), but enforces only the supported bits.
	If further cleanup is needed to be more particular about migration
	flags, that should be a separate patch.

	* src/esx/esx_device_monitor.c (esxDeviceOpen): Reject unknown
	flags.
	* src/esx/esx_driver.c (esxOpen, esxDomainReboot)
	(esxDomainXMLFromNative, esxDomainXMLToNative)
	(esxDomainMigratePrepare, esxDomainMigratePerform)
	(esxDomainMigrateFinish): Likewise.
	* src/esx/esx_interface_driver.c (esxInterfaceOpen): Likewise.
	* src/esx/esx_network_driver.c (esxNetworkOpen): Likewise.
	* src/esx/esx_nwfilter_driver.c (esxNWFilterOpen): Likewise.
	* src/esx/esx_secret_driver.c (esxSecretOpen): Likewise.
	* src/esx/esx_storage_driver.c (esxStorageOpen): Likewise.

2011-07-16  Eric Blake  <eblake@redhat.com>

	virsh: improve option handling
	The documentation for vshCommandOptString claims that it returns
	-1 on a missing required argument, but in reality, that error
	message was unreachable (it was buried inside an if clause that
	is true only if the argument was present).  The code was so hairy
	that I decided a rewrite would make it easier to understand,
	and actually return the error values we want.

	Meanwhile, our construction guarantees that all vshCmdOpt have
	a non-null def member, so there are some redundant checks that
	can be trimmed.

	* tools/virsh.c (vshCommandOpt): Alter signature.
	(vshCommandOptInt, vshCommandOptUInt, vshCommandOptUL)
	(vshCommandOptString, vshCommandOptLongLong)
	(vshCommandOptULongLong, vshCommandOptBool): Adjust all callers.
	(vshCommandOptArgv): Remove dead condition.

2011-07-16  Eric Blake  <eblake@redhat.com>

	flags: fix domain_conf migration regression
	Commit 461e0f1a broke migration, because there was a code path
	that tried to enable an internal flag while still going through
	the public function.  Split the internal flag into a separate
	callback, and validate that flags do not overlap.

	* src/conf/domain_conf.c (virDomainDefFormat): Split...
	(virDomainDefFormatInternal): ...to separate the flag check.
	(virDomainObjFormat): Adjust caller.

2011-07-16  Dave Allan  <dallan@redhat.com>

	website: Point main page links to libvirt driver pages
	The "libvirt supports:" section on the main page of libvirt.org
	contains a list of hypervisors with links that point to the sites of
	the underlying virt technologies.  The entry for KVM points to
	http://www.linux-kvm.org/, for example.  People coming to libvirt.org
	for the first time are likely to know about those sites, and they're
	probably interested in how libvirt manages those technologies.  This
	patch points those links to the libvirt driver pages instead.  It also
	consolidates KVM and QEMU as there is only one libvirt driver page for
	them.  Finally, it adds a line about networking support.

	v2: incorporate Eric's feedback adding project links to driver pages.

	website: Add project links to KVM/QEMU driver page
	website: Add project links to Xen driver page
	website: Add project links to LXC driver page
	website: Add project links to OpenVZ driver page
	website: Add project links to UML driver page
	website: Add project links to Virtualbox driver page
	website: Add project links to ESX driver page
	website: Add project links to VMware driver page

2011-07-16  Eric Blake  <eblake@redhat.com>

	flags: fix qemu migration regression
	Commit f548480b broke migration v3 on qemu, because the driver
	passed flags on through to qemu_migration even though
	qemu_migration wasn't using those flags.

	* src/qemu/qemu_migration.h (QEMU_MIGRATION_FLAGS): New define.
	* src/qemu/qemu_driver.c: Simplify all migration callbacks.
	* src/qemu/qemu_migration.c (qemuMigrationConfirm): Fix regression.

2011-07-16  Eric Blake  <eblake@redhat.com>

	flags: use common dumpxml flags check
	The previous patches only cleaned up ATTRIBUTE_UNUSED flags cases;
	auditing the drivers found other places where flags was being used
	but not validated.  In particular, domainGetXMLDesc had issues with
	clients accepting a different set of flags than the common
	virDomainDefFormat helper function.

	* src/conf/domain_conf.c (virDomainDefFormat): Add common flag check.
	* src/uml/uml_driver.c (umlDomainAttachDeviceFlags)
	(umlDomainDetachDeviceFlags): Reject unknown
	flags.
	* src/vbox/vbox_tmpl.c (vboxDomainGetXMLDesc)
	(vboxDomainAttachDeviceFlags)
	(vboxDomainDetachDeviceFlags): Likewise.
	* src/qemu/qemu_driver.c (qemudDomainMemoryPeek): Likewise.
	(qemuDomainGetXMLDesc): Document common flag handling.
	* src/libxl/libxl_driver.c (libxlDomainGetXMLDesc): Likewise.
	* src/lxc/lxc_driver.c (lxcDomainGetXMLDesc): Likewise.
	* src/openvz/openvz_driver.c (openvzDomainGetXMLDesc): Likewise.
	* src/phyp/phyp_driver.c (phypDomainGetXMLDesc): Likewise.
	* src/test/test_driver.c (testDomainGetXMLDesc): Likewise.
	* src/vmware/vmware_driver.c (vmwareDomainGetXMLDesc): Likewise.
	* src/xenapi/xenapi_driver.c (xenapiDomainGetXMLDesc): Likewise.

2011-07-16  Eric Blake  <eblake@redhat.com>

	maint: fix typos
	Our XML prefers "shareable" over "sharable".

	* docs/internals/locking.html.in: s/sharable/shareable/
	* src/locking/lock_driver_sanlock.c
	(virLockManagerSanlockAddResource): Likewise.

2011-07-16  Hu Tao  <hutao@cn.fujitsu.com>

	add --cache, --serial, --shareable and --address to attach-disk
	This adds four options for virsh command attach-disk.

	--cache option allows user to specify cache mode of disk device
	from virsh command line when attaching a disk device.

	--serial option allows user to specify serial string of disk device
	from virsh command line when attaching a disk device.

	--shareable option allows user to specify whether the disk device is
	shareable between domains when attaching a disk device from virsh
	command line.

	--address option allows user to specify address of disk device when
	attaching a disk device.

2011-07-15  Daniel P. Berrange  <berrange@redhat.com>

	Fix error message for missing TLS write function
	* src/rpc/virnettlscontext.c: s/read/write/

2011-07-15  Daniel P. Berrange  <berrange@redhat.com>

	Fix reporting of cert validation failures
	If the server succesfully validates the client cert, it will send
	back a single byte, under TLS. If it fails, it will close the
	connection. In this case, we were just reporting the standard
	I/O error. The original RPC code had a special case hack for the
	GNUTLS_E_UNEXPECTED_PACKET_LENGTH error code to make us report
	a more useful error message

	* src/rpc/virnetclient.c: Return ENOMSG if we get
	  GNUTLS_E_UNEXPECTED_PACKET_LENGTH
	* src/rpc/virnettlscontext.c: Report cert failure if we
	  see ENOMSG

2011-07-15  Dave Allan  <dallan@redhat.com>

	Fix error code for storage operations
	Many volume operations will fail if the volume in question is being
	allocated.  These operations were returning VIR_ERR_INTERNAL_ERROR
	when they should be returning VIR_ERR_OPERATION_INVALID.

2011-07-15  Taku Izumi  <izumi.taku@jp.fujitsu.com>

	setvcpus: add "--current" option to "virsh setvcpus"
	This patch adds the --current option to "virsh setvcpus"
	command. Currently "virsh setvcpus" command supports
	"--live" and "--config" , but "--current" option.
	From view of consistency, it's reasonable to support
	"--current" option too.

	When --current is specified, it affects a "current"
	domain.

2011-07-15  Taku Izumi  <izumi.taku@jp.fujitsu.com>

	setvcpus: extend qemuDomainSetVcpusFlags() to support current flag
	This patch extends qemudDomainSetVcpusFlags() function to support
	VIR_DOMAIN_AFFECT_CURRENT flag.

2011-07-15  Taku Izumi  <izumi.taku@jp.fujitsu.com>

	setvcpus: extend virDomainSetVcpusFlags API to support current flag
	This patch extends virDomainSetVcpusFlags API to support
	VIR_DOMAIN_AFFECT_CURRENT flag.

	Now because most APIs accept VIR_DOMAIN_AFFECT_CURRENT flags,
	virDomainSetVcpusFlags API should also do.

2011-07-15  Daniel P. Berrange  <berrange@redhat.com>

	Add domain events support to UML driver
	* src/uml_conf.h: Add queue for dispatch of domain events
	* src/uml_driver.c: Trigger domain events upon important lifecycle transitions

2011-07-15  Eric Blake  <eblake@redhat.com>

	docs: mention EMOTIVE as a libvirt-using app
	* docs/apps.html.in: Add EMOTIVE.
	Reported by Alex Vaqué Brull <memfis@gmail.com>.

2011-07-15  Eric Blake  <eblake@redhat.com>

	virnetsocket: use new API for uniform child cleanup
	Rather than trying to clean up the ssh child ourselves, and risk
	subtle differences from the socket creation error path, we can
	just use the new APIs.

	* src/rpc/virnetsocket.c (virNetSocketFree): Use new function.

2011-07-15  Eric Blake  <eblake@redhat.com>

	fdstream: avoid child process leak on error
	By requesting the pid in virCommandRunAsync, fdstream was claiming
	that it would manually wait for the process.  But on the failure
	path, the child process was being leaked.

	* src/fdstream.c (virFDStreamOpenFileInternal): Auto-reap child.

2011-07-15  Eric Blake  <eblake@redhat.com>

	command: introduce virPidWait, virPidAbort
	When using virCommandRunAsync and saving the pid for later, it
	is useful to be able to reap that pid in the same way that it
	would have been auto-reaped by virCommand if we had passed
	NULL for the pid argument in the first place.

	* src/util/command.c (virPidWait, virPidAbort): New functions,
	created from...
	(virCommandWait, virCommandAbort): ...bodies of these.
	(includes): Drop duplicate <stdlib.h>.  Ensure that our pid_t
	assumptions hold.
	(virCommandRunAsync): Improve documentation.
	* src/util/command.h (virPidWait, virPidAbort): New prototypes.
	* src/libvirt_private.syms: Export them.
	* docs/internals/command.html.in: Document them.

2011-07-15  Jamie Strandboge  <jamie@canonical.com>

	update apparmor security driver for new udev paths
	In the Ubuntu development release we recently got a new udev that
	moves /var/run to /run, /var/lock to /run/lock and /dev/shm to /run/shm.
	This change in udev requires updating the apparmor security driver in
	libvirt[1].

	Attached is a patch that:
	 * adjusts src/security/virt-aa-helper.c to allow both
	LOCALSTATEDIR/run/libvirt/**/%s.pid and /run/libvirt/**/%s.pid. While
	the profile is not as precise, LOCALSTATEDIR/run/ is typically a symlink
	to /run/ anyway, so there is no additional access (remember that
	apparmor resolves symlinks, which is why this is still required even
	if /var/run points to /run).
	 * adjusts example/apparmor/libvirt-qemu paths for /dev/shm

	[1]https://launchpad.net/bugs/810270

	--
	Jamie Strandboge             | http://www.canonical.com

2011-07-14  Matthias Bolte  <matthias.bolte@googlemail.com>

	xenapi: Improve error reporting in xenapiOpen
	Use better suited error code and avoid NULL in error messsage
	as *privP->session->error_description can be NULL.

2011-07-14  Eric Blake  <eblake@redhat.com>

	build: fix VPATH build of todo
	Without this patch, the make rule in a VPATH build was trying to
	invoke ../../docs/../../docs/todo.pl, which didn't exist.

	* docs/Makefile.am (todo.html.in): Using $< already implies
	$(srcdir) in GNU make VPATH situations.

2011-07-14  Eric Blake  <eblake@redhat.com>

	build: check for virnetprotocol on-the-wire stability
	Similar to the recent qemu_protocol-structs addition.

	* src/virnetprotocol-structs: New file.
	* src/Makefile.am (%_protocol-structs): Factor body...
	(PDWTAGS): ...into new helper macro.
	(virnetprotocol-structs): New rule.
	(PROTOCOL_STRUCTS): Add virnetprotocol-structs.

2011-07-14  Wen Congyang  <wency@cn.fujitsu.com>

	build: disable some drivers when building without libvirt daemon
	We disable some drivers when building without libvirtd in configure,
	but we do not do the same thing in libvirt.spec. It may break rpm
	building without libvirtd.

2011-07-14  Michal Privoznik  <mprivozn@redhat.com>

	storage: Avoid memory leak on metadata fetching
	Getting metadata on storage allocates a memory (path) which need to
	be freed after use otherwise it gets leaked. This means after use of
	virStorageFileGetMetadataFromFD or virStorageFileGetMetadata one
	must call virStorageFileFreeMetadata to free it. This function frees
	structure internals and structure itself.

2011-07-14  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Don't overwrite errors by closefd in error paths
	When qemuMonitorCloseFileHandle is called in error path, we need to
	preserve the original error since a possible further error when running
	closefd monitor command is not very useful to users.

	qemu: Save domain status ASAP after creating qemu process
	When creating new qemu process we saved domain status XML only after the
	process was fully setup and running. In case libvirtd was killed before
	the whole process finished, once libvirtd started again it didn't know
	anything about the new process and we end up with an orphaned qemu
	process. Let's save the domain status XML as soon as we know the PID so
	that libvirtd can kill the process on restart.

2011-07-14  Eric Blake  <eblake@redhat.com>

	build: avoid ATTRIBUTE_UNUSED in headers
	The compiler might optimize based on our declaration that something
	is unused.  Putting that declaration in the header risks getting
	out of sync with the actual implementation, so it belongs better
	only in the .c files.  We were mostly compliant, and a new syntax
	check will help us in the future.

	* cfg.mk (sc_avoid_attribute_unused_in_header): New syntax check.
	* src/nodeinfo.h (nodeGetCPUStats, nodeGetMemoryStats): Delete
	attribute already present in .c file.
	* src/qemu/qemu_domain.h (qemuDomainEventFlush): Likewise.
	* src/util/virterror_internal.h (virReportErrorHelper): Parameters
	are actually used by .c file.
	* src/xenxs/xen_sxpr.h (xenFormatSxprDisk): Adjust prototype.
	* src/xenxs/xen_sxpr.c (xenFormatSxprDisk): Delete unused argument.
	(xenFormatSxpr): Adjust caller.
	* src/xen/xend_internal.c (xenDaemonAttachDeviceFlags)
	(xenDaemonUpdateDeviceFlags): Likewise.
	Suggested by Daniel Veillard.

2011-07-14  Eric Blake  <eblake@redhat.com>

	remote: prefer unsigned flags
	* src/remote/remote_driver.c (call, remoteOpenSecondaryDriver):
	Prefer unsigned flags.

2011-07-14  Eric Blake  <eblake@redhat.com>

	conf: delete unused flags arguments
	For static functions not used as callbacks, there's no need to
	keep an unused parameter.

	* src/conf/domain_conf.c (virDomainChrDefParseTargetXML)
	(virDomainTimerDefParseXML, virDomainHostdevSubsysUsbDefParseXML)
	(virDomainVcpuPinDefParseXML): Drop unused parameter.
	(virDomainChrDefParseXML, virDomainDefParseXML)
	(virDomainHostdevDefParseXML): Update callers.
	(virDomainNetDefParseXML): Mark flags used.

2011-07-14  Supriya Kannery  <supriyak@linux.vnet.ibm.com>

	virsh: Update virsh man page
	Valid loglevel range for virsh  is 0-4. Update virsh man page
	accordingly. Also explain virsh ENV variables and values.

2011-07-14  Jiri Denemark  <jdenemar@redhat.com>

	virsh: fix previous patch
	The last patch breaks make check for two reasons. First, it reverses the
	condition but leaves default level unchanged, so instead of not printing
	anything but errors before the patch it now prints all debug messages by
	default. Second, you forgot to change -d5 option passed to virsh in
	tests/virsh-optparse to -d0; the script wants to see all debug messages.

2011-07-14  Supriya Kannery  <supriyak@linux.vnet.ibm.com>

	virsh: Make "DEBUG" loglevel the superset
	Aligning loglevel values of virsh to that of libvirt.
	"DEBUG"=0 loglevel, when specified through commandline or
	env variable, should log all the messages. "ERROR=4"
	should log only error messages.

	virsh: Avoid using magic numbers for logging
	Replace magic numbers with loglevel variables.

2011-07-14  Jiri Denemark  <jdenemar@redhat.com>

	util: Avoid duplicating virFileOpenAsNoFork in virFileOpenAs
	In 2f4d2496a88055a8343b3efca618522da8715d92 I didn't notice that one
	part of virFileOpenAs doesn't actually call to virFileOpenAsNoFork but
	rather includes a copy of the code from there.

2011-07-14  Eric Blake  <eblake@redhat.com>

	build: don't hand-roll cloexec code
	No need to repeat common code.

	* bootstrap.conf (gnulib_modules): Import calloc-posix.
	* src/util/bridge.c (brInit): Use virSetCloseExec.
	(brSetInterfaceUp): Adjust flags name.
	* src/uml/uml_driver.c (umlSetCloseExec): Delete.
	(umlStartVMDaemon): Use util version instead.

2011-07-14  Eric Blake  <eblake@redhat.com>

	conf: prefer unsigned flags
	* src/conf/cpu_conf.h (virCPUDefFormat, virCPUDefFormatBuf):
	Change flags type.
	* src/conf/cpu_conf.c (virCPUDefFormat, virCPUDefFormatBuf):
	Likewise.
	* src/conf/storage_conf.c (_virStoragePoolOptions): Likewise.
	* src/datatypes.h (_virConnect, _virStream): Likewise.

	python: prefer unsigned flags
	* python/libvirt-override.c (libvirt_virConnectOpenAuth)
	(libvirt_virDomainSnapshotListNames)
	(libvirt_virDomainRevertToSnapshot): Change flags type.

2011-07-14  Eric Blake  <eblake@redhat.com>

	node_device: avoid implicit int
	'unsigned a' and 'unsigned int a' are synonyms, but we generally
	always spell out the 'int' in that case.  Fixing this will avoid
	a false positive in the next syntax-check commit.

	* src/conf/node_device_conf.h (pci_config_address)
	(_virNodeDevCapsDef): Prefer 'unsigned int' over 'unsigned'.

2011-07-14  Eric Blake  <eblake@redhat.com>

	virsh, daemon: prefer unsigned flags
	* tools/virsh.c (vshCmdDef): Change flags type.
	* daemon/remote.c (remoteDispatchOpen): Likewise.

	xenapi: reject unknown flags
	* src/xenapi/xenapi_driver.c (xenapiOpen, xenapiDomainReboot):
	Reject unknown flags.
	(xenapiDomainGetXMLDesc): Likewise, and pass known flags through
	to XML generation.

	vmware: reject unknown flags
	* src/vmware/vmware_driver.c (vmwareOpen, vmwareDomainReboot)
	(vmwareDomainCreateXML, vmwareDomainCreateWithFlags): Reject
	unknown flags.

	vbox: reject unknown flags
	* src/vbox/vbox_driver.c (vboxOpenDummy): Reject unknown flags.
	* src/vbox/vbox_tmpl.c (vboxOpen, vboxDomainReboot)
	(vboxNetworkOpen, vboxNetworkGetXMLDesc, vboxStorageOpen)
	(vboxStorageVolCreateXML, vboxStorageVolDelete)
	(vboxStorageVolGetXMLDesc, vboxDomainScreenshot): Likewise.

	uml: reject unknown flags
	* src/uml/uml_driver.c (umlOpen, umlDomainGetXMLDesc)
	(umlDomainBlockPeek): Reject unknown flags.

	test: reject unknown flags
	* src/test/test_driver.c (testOpen, testDomainCoreDump)
	(testOpenNetwork, testNetworkGetXMLDesc, testOpenInterface)
	(testInterfaceChangeBegin, testInterfaceChangeCommit)
	(testInterfaceChangeRollback, testInterfaceGetXMLDesc)
	(testInterfaceDefineXML, testInterfaceCreate)
	(testInterfaceDestroy, testStorageOpen, testStoragePoolStart)
	(testStorageFindPoolSources, testStoragePoolCreate)
	(testStoragePoolDefine, testStoragePoolBuild)
	(testStoragePoolDelete, testStoragePoolRefresh)
	(testStoragePoolGetXMLDesc, testStorageVolumeCreateXML)
	(testStorageVolumeCreateXMLFrom, testStorageVolumeDelete)
	(testStorageVolumeGetXMLDesc, testDevMonOpen)
	(testNodeNumOfDevices, testNodeListDevices)
	(testNodeDeviceGetXMLDesc, testNodeDeviceCreateXML)
	(testSecretOpen, testNWFilterOpen): Reject unknown flags.

	qemu: reject unknown flags
	* src/qemu/qemu_driver.c (qemudOpen, qemuDomainScreenshot)
	(qemuDomainXMLFromNative, qemuDomainXMLToNative)
	(qemudDomainBlockPeek, qemuCPUCompare, qemuCPUBaseline): Reject
	unknown flags.
	* src/qemu/qemu_migration.c (qemuMigrationConfirm): Likewise.
	(_qemuMigrationCookie, qemuMigrationCookieXMLParse)
	(qemuMigrationCookieXMLParseStr, qemuMigrationBakeCookie)
	(qemuMigrationEatCookie): Make flags unsigned.
	* src/qemu/qemu_domain.h: (qemuDomainDefFormatXML)
	(qemuDomainFormatXML): Prefer unsigned flags.
	* src/qemu/qemu_domain.c (qemuDomainDefFormatXML)
	(qemuDomainFormatXML): Likewise.
	(qemuDomainOpenLogHelper, qemuDomainCreateLog): Rename variable.

	phyp: reject unknown flags
	* src/phyp/phyp_driver.c (phypOpen, phypDomainReboot)
	(phypVIOSDriverOpen): Reject unknown flags.

	openvz: reject unknown flags
	* src/openvz/openvz_driver.c (openvzDomainReboot, openvzOpen):
	Reject unknown flags.

	lxc: reject unknown flags
	* src/lxc/lxc_driver.c (lxcOpen, lxcDomainSetMemoryParameters)
	(lxcDomainGetMemoryParameters): Reject unknown flags.
	* src/lxc/lxc_container.c (lxcContainerStart): Rename flags to
	cflags to reflect that it is not tied to libvirt.

	libxl: reject unknown flags
	* src/libxl/libxl_driver.c (libxlOpen, libxlDomainReboot)
	(libxlDomainXMLFromNative, libxlDomainXMLToNative)
	(libxlDomainCreateWithFlags): Reject unknown flags.

2011-07-14  Nan Zhang  <nzhang@redhat.com>

	virsh: fix missing prompt message for 'snapshot-delete' command
	Make the command 'virsh snapshot-delete' has the appropriate prompt
	message when executing sucessful or failed.

2011-07-14  Peter Krempa  <pkrempa@redhat.com>

	qemu: build failed due to unused variables
	While compiling on F15 build crashed (probably because of new GCC).

2011-07-13  Eric Blake  <eblake@redhat.com>

	storage: reject unknown flags
	* src/storage/storage_backend.c (virStorageBackendCreateBlockFrom)
	(virStorageBackendCreateQemuImg)
	(virStorageBackendCreateQcowCreate): Reject unknown flags.
	* src/storage/storage_backend_disk.c (virStorageBackendDiskBuildPool)
	(virStorageBackendDiskDeleteVol): Likewise.
	* src/storage/storage_backend_fs.c
	(virStorageBackendFileSystemNetFindPoolSources)
	(virStorageBackendFileSystemBuild)
	(virStorageBackendFileSystemDelete, createFileDir)
	(virStorageBackendFileSystemVolBuildFrom)
	(virStorageBackendFileSystemVolDelete): Likewise.
	* src/storage/storage_backend_iscsi.c
	(virStorageBackendISCSIFindPoolSources): Likewise.
	* src/storage/storage_backend_logical.c
	(virStorageBackendLogicalFindPoolSources)
	(virStorageBackendLogicalBuildPool)
	(virStorageBackendLogicalDeletePool)
	(virStorageBackendLogicalDeleteVol): Likewise.
	* src/storage/storage_driver.c (storageOpen, storagePoolCreate)
	(storagePoolDefine, storagePoolRefresh, storagePoolGetXMLDesc)
	(storageVolumeCreateXML, storageVolumeCreateXMLFrom)
	(storageVolumeGetXMLDesc): Likewise.

	node_device: reject unknown flags
	* src/node_device/node_device_driver.c (nodeNumOfDevices)
	(nodeListDevices, nodeDeviceGetXMLDesc, nodeDeviceCreateXML):
	Reject unknown flags.
	* src/node_device/node_device_hal.c (halNodeDrvOpen): Likewise.
	* src/node_device/node_device_udev.c (udevNodeDrvOpen): Likewise.

2011-07-13  Eric Blake  <eblake@redhat.com>

	util: reject unknown flags, and prefer unsigned flags
	Silently ignored flags get in the way of new features that
	use those flags.  Also, an upcoming syntax check will favor
	unsigned flags.

	* src/nodeinfo.h (nodeGetCPUStats, nodeGetMemoryStats): Drop
	unused attribute.
	* src/interface/netcf_driver.c (interfaceOpenInterface)
	(interfaceDefineXML, interfaceCreate, interfaceDestroy): Reject
	unknown flags.
	* src/network/bridge_driver.c (networkOpenNetwork)
	(networkGetXMLDesc): Likewise.
	* src/nwfilter/nwfilter_driver.c (nwfilterOpen): Likewise.
	* src/secret/secret_driver.c (secretOpen, secretDefineXML)
	(secretGetXMLDesc, secretSetValue): Likewise.
	* src/util/logging.c (virLogDefineFilter, virLogDefineOutput)
	(virLogMessage): Likewise; also use unsigned flags.
	* src/util/logging.h (virLogDefineFilter, virLogDefineOutput)
	(virLogMessage): Change signature.
	* src/util/command.c (virExecWithHook): Likewise.

2011-07-13  Eric Blake  <eblake@redhat.com>

	libvirt-qemu: use unsigned flags
	Like commit 1740c381, but for libvirt-qemu.

	* src/remote/qemu_protocol.x (qemu_monitor_command_args): Adjust
	type to match API.
	* src/qemu_protocol-structs: Update accordingly.

2011-07-13  Eric Blake  <eblake@redhat.com>

	maint: print flags in hex during debug
	Continuation of commit 313ac7fd, and enforce things with a syntax
	check.

	Technically, virNetServerClientCalculateHandleMode is not printing
	a mode_t, but rather a collection of VIR_EVENT_HANDLE_* bits;
	however, these bits are < 8, so there is no different in the
	output, and that was the easiest way to silence the new syntax check.

	* cfg.mk (sc_flags_debug): New syntax check.
	(exclude_file_name_regexp--sc_flags_debug): Add exemptions.
	* src/fdstream.c (virFDStreamOpenFileInternal): Print flags in
	hex, mode_t in octal.
	* src/libvirt-qemu.c (virDomainQemuMonitorCommand)
	(virDomainQemuAttach): Likewise.
	* src/locking/lock_driver_nop.c (virLockManagerNopInit): Likewise.
	* src/locking/lock_driver_sanlock.c (virLockManagerSanlockInit):
	Likewise.
	* src/locking/lock_manager.c: Likewise.
	* src/qemu/qemu_migration.c: Likewise.
	* src/qemu/qemu_monitor.c: Likewise.
	* src/rpc/virnetserverclient.c
	(virNetServerClientCalculateHandleMode): Print mode with %o.

2011-07-13  Eric Blake  <eblake@redhat.com>

	maint: exclude more files from syntax check
	* cfg.mk (VC_LIST_ALWAYS_EXCLUDE_REGEX): Exempt
	docs/api_extension/*.patch.
	(exclude_file_name_regexp--sc_prohibit_always_true_header_tests)
	(exclude_file_name_regexp--sc_prohibit_empty_lines_at_EOF)
	(exclude_file_name_regexp--sc_prohibit_fork_wrappers)
	(exclude_file_name_regexp--sc_trailing_blank): Simplify.
	(exclude_file_name_regexp--sc_prohibit_gettext_noop): Delete.
	(exclude_file_name_regexp--sc_prohibit_close)
	(exclude_file_name_regexp--sc_prohibit_nonreentrant)
	(exclude_file_name_regexp--sc_prohibit_sprintf): Tighten.

2011-07-13  Eric Blake  <eblake@redhat.com>

	util: honor anchored names when searching for executables
	I got bit in a debugging session on an uninstalled libvirtd; the
	code tried to call out to the installed $LIBEXECDIR/libvirt_iohelper
	instead of my just-built version.  So I set a breakpoint and altered
	the binary name to be "./src/libvirt_iohelper", and it still failed
	because I don't have "." on my PATH.

	According to POSIX, execvp only searches PATH if the name does
	not contain a slash.  Since we are trying to mimic that behavior,
	an anchored name should be relative to the current working dir.

	This tightens existing behavior, but most callers already pass
	an absolute name or a name with no slashes, so it probably won't
	be noticeable.

	* src/util/util.c (virFindFileInPath): Anchored relative names do
	not invoke a PATH search.

2011-07-13  Daniel P. Berrange  <berrange@redhat.com>

	Ensure signal handler propagates fatal signals to default handler
	When replacing the default SEGV/ABORT/BUS signal handlers you
	can't rely on the process being terminated after your custom
	handler runs. It is neccessary to manually restore the default
	handler and then re-raise the signal

	* src/rpc/virnetserver.c: Restore default handler and raise
	  signal

2011-07-13  Daniel P. Berrange  <berrange@redhat.com>

	Remove unused virNetServerProgramErrorHander typedef
	* src/rpc/virnetserverprogram.h: Remove unused typedef for
	  virNetServerProgramErrorHander function callback
	* daemon/remote.h: Remove decl for non-existant variables

2011-07-13  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Fix monitor unlocking in some error paths
	When monitor is entered with qemuDomainObjEnterMonitorWithDriver, the
	correct method for leaving and unlocking the monitor is
	qemuDomainObjExitMonitorWithDriver.

2011-07-13  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Consolidate qemuMigrationPrepare{Direct,Tunnel}
	Most of the code in these two functions is supposed to be identical but
	currently it isn't (which is natural since the code is duplicated).
	Let's move common parts of these functions into qemuMigrationPrepareAny.

	This also fixes qemuMigrationPrepareTunnel which didn't store received
	lockState in the domain object.

2011-07-13  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Add support for job phase
	Asynchronous jobs may take long time to finish and may consist of
	several phases which we need to now about to help with recovery/rollback
	after libvirtd restarts.

	qemu: Recover from interrupted jobs
	Detect and react on situations when libvirtd was restarted or killed
	when a job was active.

	qemu: Save job type in domain status XML
	If libvirtd is restarted when a job is running, the new libvirtd process
	needs to know about that to be able to recover and rollback the
	operation.

2011-07-13  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Allow all query commands to be run during long jobs
	Query commands are safe to be called during long running jobs (such as
	migration). This patch makes them all work without the need to
	special-case every single one of them.

	The patch introduces new job.asyncCond condition and associated
	job.asyncJob which are dedicated to asynchronous (from qemu monitor
	point of view) jobs that can take arbitrarily long time to finish while
	qemu monitor is still usable for other commands.

	The existing job.active (and job.cond condition) is used all other
	synchronous jobs (including the commands run during async job).

	Locking schema is changed to use these two conditions. While asyncJob is
	active, only allowed set of synchronous jobs is allowed (the set can be
	different according to a particular asyncJob) so any method that
	communicates to qemu monitor needs to check if it is allowed to be
	executed during current asyncJob (if any). Once the check passes, the
	method needs to normally acquire job.cond to ensure no other command is
	running. Since domain object lock is released during that time, asyncJob
	could have been started in the meantime so the method needs to recheck
	the first condition. Then, normal jobs set job.active and asynchronous
	jobs set job.asyncJob and optionally change the list of allowed job
	groups.

	Since asynchronous jobs only set job.asyncJob, other allowed commands
	can still be run when domain object is unlocked (when communicating to
	remote libvirtd or sleeping). To protect its own internal synchronous
	commands, the asynchronous job needs to start a special nested job
	before entering qemu monitor. The nested job doesn't check asyncJob, it
	only acquires job.cond and sets job.active to block other jobs.

2011-07-13  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Consolidate {Enter,Exit}Monitor{,WithDriver}
	EnterMonitor and ExitMonitor methods are very similar to their
	*WithDriver variants; consolidate them into EnterMonitorInternal and
	ExitMonitorInternal to avoid (mainly future) code duplication.

	qemu: Consolidate BeginJob{,WithDriver} into a single method
	This avoids code duplication and also avoids relying on good luck that
	ignore_value(virDomainObjUnref(obj)) doesn't set errno.

	qemu: Separate job related data into a new object

2011-07-13  Eric Blake  <eblake@redhat.com>

	maint: avoid incremental 'make syntax-check' failure
	Incrementally running 'make syntax-check' on a tree previously
	built after commit 62dee6f but before 44036460 fails sc_po_check
	(because the generated qemu_dispatch.h gained translatable strings).
	This is a followup to commit addaa537 for that scenario.

	* cfg.mk (sc_po_check): Add another prereq.
	($(srcdir)/daemon/qemu_dispatch.h): Add rule.

2011-07-13  Daniel P. Berrange  <berrange@redhat.com>

	Skip bugs which are CLOSED in todo list
	* docs/todo.pl: Skip closed bugs

2011-07-13  Daniel P. Berrange  <berrange@redhat.com>

	Add missing cleanup for transient guests in UML driver
	The UML inotify handler would kill off guests when certain
	conditions arise, but it forgot to remove transient guests
	from the list of domains

	* src/uml/uml_driver.c: Cleanup transient guests

2011-07-13  Daniel P. Berrange  <berrange@redhat.com>

	Add auditing to the UML driver
	* src/uml/uml_driver.c: Add audit hooks

	Add auditing to the LXC driver
	* src/lxc/lxc_driver.c: Add auditing hooks

2011-07-13  Daniel P. Berrange  <berrange@redhat.com>

	Add virtualization type in audit messages
	Since a host can run several different virtualization types at
	the same time, audit messages should allow domains to be identified.
	Add a 'virt={qemu,kvm,uml,lxc,...}' key to domain audit messages

	* src/conf/domain_audit.c: Identify virt type of guest

2011-07-13  Daniel P. Berrange  <berrange@redhat.com>

	Add auditing of filesystems
	When passing through filesystems from the host to a guest, the
	host filesystem passed must be audited

	* src/conf/domain_audit.{c,h}: Add virDomainAuditFS

2011-07-13  Daniel P. Berrange  <berrange@redhat.com>

	Move qemu_audit.h helpers into shared code
	The LXC and UML drivers can both make use of auditing. Move
	the qemu_audit.{c,h} files to src/conf/domain_audit.{c,h}

	* src/conf/domain_audit.c: Rename from src/qemu/qemu_audit.c
	* src/conf/domain_audit.h: Rename from src/qemu/qemu_audit.h
	* src/Makefile.am: Remove qemu_audit.{c,h}, add domain_audit.{c,h}
	* src/qemu/qemu_audit.h, src/qemu/qemu_cgroup.c,
	  src/qemu/qemu_command.c, src/qemu/qemu_driver.c,
	  src/qemu/qemu_hotplug.c, src/qemu/qemu_migration.c,
	  src/qemu/qemu_process.c: Update for changed audit API names

2011-07-12  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Initialize all instances of esxVMX_Data to zero
	To avoid using or freeing uninitialized memory or pointers.

	rpc: Fix compile error due to potentially unused parameter
	connectDBus is only used if HAVE_DBUS is set. Therefore mark
	it as potentially unused.

2011-07-12  Jim Fehlig  <jfehlig@novell.com>

	Fix build when using polkit0
	V2: Remove policy kit references from virNetServer and use DBus APIs
	    directly, if available.

2011-07-12  Daniel P. Berrange  <berrange@redhat.com>

	Implement code to attach to external QEMU instances.
	Given a PID, the QEMU driver reads /proc/$PID/cmdline and
	/proc/$PID/environ to get the configuration. This is fed
	into the ARGV->XML convertor to build an XML configuration
	for the process.

	/proc/$PID/exe is resolved to identify the full command
	binary path

	After checking for name/uuid uniqueness, an attempt is
	made to connect to the monitor socket. If successful
	then 'info status' and 'info kvm' are issued to determine
	whether the CPUs are running and if KVM is enabled.

	* src/qemu/qemu_driver.c: Implement virDomainQemuAttach
	* src/qemu/qemu_process.h, src/qemu/qemu_process.c: Add
	  qemuProcessAttach to connect to the monitor of an
	  existing QEMU process

2011-07-12  Daniel P. Berrange  <berrange@redhat.com>

	Add monitor API for checking whether KVM is enabled
	When attaching to an external QEMU process, it is neccessary
	to check if the process is using KVM or not. This can be done
	using a monitor command

	* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
	  src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h,
	  src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h: Add
	  API for checking if KVM is enabled

2011-07-12  Daniel P. Berrange  <berrange@redhat.com>

	Add a method for extracting QEMU argv from /proc
	To enable attaching to externally launched QEMU, we need
	to be able to reverse engineer a guest XML config based
	on the argv for a PID in /proc

	* src/qemu/qemu_command.c, src/qemu/qemu_command.h: Add
	  qemuParseCommandLinePid which extracts QEMU config from
	  argv in /proc, given a PID number

2011-07-12  Daniel P. Berrange  <berrange@redhat.com>

	Change extract pidfile & monitor config from QEMU command line
	When converting QEMU argv into a virDomainDefPtr, also extract
	the pidfile, monitor character device config and the monitor
	mode.

	* src/qemu/qemu_command.c, src/qemu/qemu_command.h: Extract
	  pidfile & monitor config from QEMU argv
	* src/qemu/qemu_driver.c, tests/qemuargv2xmltest.c: Add extra
	  params when calling qemuParseCommandLineString

2011-07-12  Daniel P. Berrange  <berrange@redhat.com>

	Keep pidfile path in qemuDomainObjPrivate struct
	Avoid re-formatting the pidfile path everytime we need it. Create
	it once when starting the guest, and preserve it until the guest
	is shutdown.

	* src/libvirt_private.syms, src/util/util.c,
	  src/util/util.h: Add virFileReadPidPath
	* src/qemu/qemu_domain.h: Add pidfile field
	* src/qemu/qemu_process.c: Store pidfile path in qemuDomainObjPrivate

2011-07-12  Daniel P. Berrange  <berrange@redhat.com>

	Add a new 'virsh qemu-attach' command.
	This command allows libvirt to attach to an existing QEMU
	instance.

	 $ qemu-kvm -cdrom ~/demo.iso \
	     -monitor unix:/tmp/demo,server,nowait \
	     -name foo \
	     -uuid cece4f9f-dff0-575d-0e8e-01fe380f12ea  &
	 $ QEMUPID=$!
	 $ virsh qemu-attach $QEMUPID

2011-07-12  Daniel P. Berrange  <berrange@redhat.com>

	Define remote wire protocol & impls for virDomainQemuAttach
	This tweaks the RPC generator to cope with some naming
	conventions used for the QEMU specific APIs

	* daemon/remote.c: Server side dispatcher
	* src/remote/remote_driver.c: Client side dispatcher
	* src/remote/qemu_protocol.x: Wire protocol definition
	* src/rpc/gendispatch.pl: Use '$structprefix' in method
	  names, fix QEMU flags and fix dispatcher method names

2011-07-12  Daniel P. Berrange  <berrange@redhat.com>

	Define a QEMU specific API to attach to a running QEMU process
	Introduce a new API in libvirt-qemu.so

	 virDomainPtr virDomainQemuAttach(virConnectPtr domain,
	                                  unsigned long long pid,
	                                  unsigned int flags);

	This allows libvirtd to attach to an existing, externally
	launched QEMU process. This is useful for QEMU developers who
	prefer to launch QEMU themselves for debugging/devel reasons,
	but still want the benefit of libvirt based tools like
	virt-top, virt-viewer, etc

	* include/libvirt/libvirt-qemu.h: Define virDomainQemuAttach
	* src/driver.h, src/libvirt-qemu.c, src/libvirt_qemu.syms:
	  Driver glue for virDomainQemuAttach

2011-07-12  Alex Jia  <ajia@redhat.com>

	qemu: update configuration file
	* src/qemu/qemu.conf: Add blkio controller into qemu.conf.

2011-07-12  Eric Blake  <eblake@redhat.com>

	qemu: avoid fd leak on core dump failure
	* src/qemu/qemu_driver.c (doCoreDump): Guarantee fd is closed.

	maint: rename virtaudit to match file contents
	* src/util/virtaudit.[ch]: Rename...
	* src/util/viraudit.[ch]: ...to match virAudit* API.
	* src/Makefile.am (UTIL_SOURCES): Reflect rename.
	* daemon/libvirtd.c: Likewise.
	* po/POTFILES.in: Likewise.
	* src/libvirt_private.syms: Likewise.
	* src/qemu/qemu_audit.c: Likewise.

2011-07-12  Oskari Saarenmaa  <os@ohmu.fi>

	remote/ssh: support for no_verify.
	Set StrictHostKeyChecking=no to auto-accept new ssh host keys if the
	no_verify extra parameter was specified.  This won't disable host key
	checking for already known hosts.  Includes a test and documentation.

2011-07-12  KAMEZAWA Hiroyuki  <kamezawa.hiroyu@jp.fujitsu.com>

	Fix virsh inject-nmi man page
	* tools/virsh.pod: move the description which was misplaced

2011-07-12  Michal Privoznik  <mprivozn@redhat.com>

	domain_conf: Free temporary variable
	* src/conf/domain_conf.c: caller must free returned value of
	  virXPathString in useserial

2011-07-12  Osier Yang  <jyang@redhat.com>

	esx: Fix a potential crash
	Initialize ptr data.datastorePathWithoutFileName as NULL, otherwise
	it might cause crash when trying to free it in cleanup.

2011-07-12  Eric Blake  <eblake@redhat.com>

	build: also check qemu_protocol for on-the-wire stability
	Since we are going to add some libvirt-qemu.so entry points in
	0.9.4, we might as well start checking for RPC stability, just
	as for libvirt.so.

	* src/Makefile.am (PROTOCOL_STRUCTS): New variable.
	(remote_protocol-structs): Rename...
	(%_protocol-structs): ...and make more generic.
	* src/qemu_protocol-structs: New file.

2011-07-12  Eric Blake  <eblake@redhat.com>

	build: avoid requiring -lm
	log2() is heavy when ffs() can do the same thing.  But ffs()
	requires gnulib support for mingw.

	This patch solves this linker error on Fedora 14.

	/usr/bin/ld: libvirt_lxc-domain_conf.o: undefined reference to symbol 'log2@@GLIBC_2.2.5'
	/usr/bin/ld: note: 'log2@@GLIBC_2.2.5' is defined in DSO /lib64/libm.so.6 so try adding it to the linker command line
	/lib64/libm.so.6: could not read symbols: Invalid operation
	collect2: ld returned 1 exit status

	* .gnulib: Update to latest, for ffs.
	* bootstrap.conf (gnulib_modules): Import ffs.
	* src/conf/domain_conf.c (virDomainDefParseXML): Use ffs instead
	of log2.
	Reported by Dave Allan.

2011-07-12  Jim Fehlig  <jfehlig@novell.com>

	Remove code no longer used after commit df0b57a9

2011-07-12  Matthias Bolte  <matthias.bolte@googlemail.com>

	Add domain type checking
	The drivers were accepting domain configs without checking if those
	were actually meant for them. For example the LXC driver happily
	accepts configs with type QEMU.

	Add a check for the expected domain types to the virDomainDefParse*
	functions.

2011-07-11  Alex Jia  <ajia@redhat.com>

	remote: Fix memory leak
	Detected in valgrind run:

	==9184== 1 bytes in 1 blocks are definitely lost in loss record 1 of 19
	==9184==    at 0x4A04A28: calloc (vg_replace_malloc.c:467)
	==9184==    by 0x3073715F78: xdr_array (xdr_array.c:97)
	==9184==    by 0x4CF97C9: xdr_remote_domain_get_security_label_ret (remote_protocol.c:1696)
	==9184==    by 0x4D08741: virNetMessageDecodePayload (virnetmessage.c:286)
	==9184==    by 0x4D00F78: virNetClientProgramCall (virnetclientprogram.c:318)
	==9184==    by 0x4CE3887: call (remote_driver.c:3933)
	==9184==    by 0x4CF71C6: remoteDomainGetSecurityLabel (remote_driver.c:1580)
	==9184==    by 0x4CCA480: virDomainGetSecurityLabel (libvirt.c:7340)
	==9184==    by 0x41993A: cmdDominfo (virsh.c:2414)
	==9184==    by 0x411E92: vshCommandRun (virsh.c:12730)
	==9184==    by 0x4211ED: main (virsh.c:14076)
	==9184==
	==9184== 2 bytes in 1 blocks are definitely lost in loss record 2 of 19
	==9184==    at 0x4A04A28: calloc (vg_replace_malloc.c:467)
	==9184==    by 0x3073715F78: xdr_array (xdr_array.c:97)
	==9184==    by 0x4CF974F: xdr_remote_node_get_security_model_ret (remote_protocol.c:1713)
	==9184==    by 0x4D08741: virNetMessageDecodePayload (virnetmessage.c:286)
	==9184==    by 0x4D00F78: virNetClientProgramCall (virnetclientprogram.c:318)
	==9184==    by 0x4CE3887: call (remote_driver.c:3933)
	==9184==    by 0x4CF6F96: remoteNodeGetSecurityModel (remote_driver.c:1648)
	==9184==    by 0x4CBF799: virNodeGetSecurityModel (libvirt.c:7382)
	==9184==    by 0x4197D7: cmdDominfo (virsh.c:2394)
	==9184==    by 0x411E92: vshCommandRun (virsh.c:12730)
	==9184==    by 0x4211ED: main (virsh.c:14076)
	==9184==
	==9184== 8 bytes in 1 blocks are definitely lost in loss record 3 of 19
	==9184==    at 0x4A04A28: calloc (vg_replace_malloc.c:467)
	==9184==    by 0x3073715F78: xdr_array (xdr_array.c:97)
	==9184==    by 0x4CF9729: xdr_remote_node_get_security_model_ret (remote_protocol.c:1710)
	==9184==    by 0x4D08741: virNetMessageDecodePayload (virnetmessage.c:286)
	==9184==    by 0x4D00F78: virNetClientProgramCall (virnetclientprogram.c:318)
	==9184==    by 0x4CE3887: call (remote_driver.c:3933)
	==9184==    by 0x4CF6F96: remoteNodeGetSecurityModel (remote_driver.c:1648)
	==9184==    by 0x4CBF799: virNodeGetSecurityModel (libvirt.c:7382)
	==9184==    by 0x4197D7: cmdDominfo (virsh.c:2394)
	==9184==    by 0x411E92: vshCommandRun (virsh.c:12730)
	==9184==    by 0x4211ED: main (virsh.c:14076)
	==9184==
	==9184== LEAK SUMMARY:
	==9184==    definitely lost: 11 bytes in 3 blocks

	* src/remote/remote_driver.c: Avoid leak on remoteDomainGetSecurityLabel
	  and remoteNodeGetSecurityModel.

2011-07-11  Eric Blake  <eblake@redhat.com>

	tests: simplify formatting
	The shell version would output 40 extra spaces for a test with
	a multiple of 40 sub-tests, and the C version can use the same
	printf optimization for avoiding a loop over single space output
	as the shell version.

	* tests/testutils.c (virtTestMain): Avoid loop for alignment.
	* tests/test-lib.sh: Fix formatting when counter is multiple of 40.

2011-07-11  Jim Fehlig  <jfehlig@novell.com>

	Do not drop kernel cmdline for xen pv domains
	Kernel cmdline args can be passed to xen pv domains even when a
	bootloader is specified.  The current config-to-sxpr mapping
	ignores cmdline when bootloader is present.

	Since the xend sub-driver is used with many xen toolstack versions,
	this patch takes conservative approach of adding an else block to
	existing !def->os.bootloader, and only appends sxpr if def->os.cmdline
	is non-NULL.

	V2: Fix existing testcase broken by this patch and add new testcases

2011-07-11  Wen Congyang  <wency@cn.fujitsu.com>

	kill vm if saving config failed in v3 protocol
	If virDomainSaveConfig() failed, we will return NULL to source,
	and the vm is still available to restart during confirm() step in
	v3 protocol. So we should kill it off in qemuMigrationFinish().

	In v2 protocol, we should not set vm to NULL, because we hold
	a reference of vm and should unrefernce it.

2011-07-11  Wen Congyang  <wency@cn.fujitsu.com>

	RPC: fix argument's name

	fix typo error

2011-07-11  Michal Privoznik  <mprivozn@redhat.com>

	bios: Add support for SGA
	This patch creates new <bios> element which, at this time has only the
	attribute useserial='yes|no'. This attribute allow users to use
	Serial Graphics Adapter and see BIOS messages from the very first moment
	domain boots up. Therefore, users can choose boot medium, set PXE, etc.

2011-07-11  Daniel Veillard  <veillard@redhat.com>

	Fix rpm build with sanlock and without QEmu
	The qemu-sanlock.conf file is not installed in this case

2011-07-09  Matthias Bolte  <matthias.bolte@googlemail.com>

	vbox: Fix logic in storage driver open function
	If the main driver is the vbox driver, then the open function
	has to return an error if the private data is invalid.

2011-07-09  Matthias Bolte  <matthias.bolte@googlemail.com>

	tests: Improve output of tests that decide to skip at runtime
	Don't print OK/FAIL for tests that decide to be skipped after
	calling virtTestMain. Delay printing of the indentation before
	the first test until we know that the test didn't decide to be
	skipped.

	Also make the reconnect test use VIRT_TEST_MAIN.

2011-07-09  Matthias Bolte  <matthias.bolte@googlemail.com>

	tests: Fix compressed test output padding logic
	The current logic tries to count from 1 to 40 and ignores paddings
	of 0 and 1 to 40. This doesn't work for counter + 1 mod 40 == 0
	like here for counter value 159

	TEST: virsh-all
	      ........................................ 40
	      ........................................ 80
	      ........................................ 120
	      ....................................... 159 OK
	PASS: virsh-all

	Also seq isn't portable. Therefore, calculate the correct padding
	length directly and use printf to output it at once.

2011-07-09  Matthias Bolte  <matthias.bolte@googlemail.com>

	tests: Use EXIT_AM_SKIP instead of 77 directly

2011-07-09  Matthias Bolte  <matthias.bolte@googlemail.com>

	rpc: Fix whitespace problem in generated code
	Add missing line break and fix indention level.

	Reported by Cole Robinson.

2011-07-09  Federico Simoncelli  <fsimonce@redhat.com>

	sanlock: avoid lockspace setup when auto_disk_lease is off
	When auto_disk_lease is off we should avoid the automatic lockspace
	creation.

2011-07-09  Eric Blake  <eblake@redhat.com>

	libvirtd: diagnose explicitly requested but missing conf file
	Fixes test regression introduced in commit 8e2e4780.

	* daemon/libvirtd.c (daemonConfigLoad): Add argument.
	(main): Update caller.

2011-07-08  Michael Santos  <michael.santos@gmail.com>

	qemu: clean up OOM checks

2011-07-08  Daniel P. Berrange  <berrange@redhat.com>

	Don't exit if the libvirtd config does not exist
	It is common for the $HOME/.libvirt/libvirtd.conf file to not
	exist. Treat this situation as non-fatal since we can carry
	on with our default settings just fine.

	* daemon/libvirtd.c: Treat ENOENT as non-fatal when loading
	  config

2011-07-08  Daniel P. Berrange  <berrange@redhat.com>

	Fix sending of reply to final RPC message
	The dispatch for the CLOSE RPC call was invoking the method
	virNetServerClientClose(). This caused the client connection
	to be immediately terminated. This meant the reply to the
	final RPC message was never sent. Prior to the RPC rewrite
	we merely flagged the connection for closing, and actually
	closed it when the next RPC call dispatch had completed.

	* daemon/remote.c: Flag connection for a delayed close
	* daemon/stream.c: Update to use new API for closing
	  failed connection
	* src/rpc/virnetserverclient.c, src/rpc/virnetserverclient.h:
	  Add support for a delayed connection close. Rename the
	  virNetServerClientMarkClose method to virNetServerClientImmediateClose
	  to clarify its semantics

2011-07-08  Daniel P. Berrange  <berrange@redhat.com>

	Fix leak of remote driver if final 'CLOSE' RPC call fails
	When closing a remote connection we issue a (fairly pointless)
	'CLOSE' RPC call to the daemon. If this fails we skip all the
	cleanup of private data, but the virConnectPtr object still
	gets released as normal. This causes a memory leak. Since the
	CLOSE RPC call is pretty pointless, just carry on freeing the
	remote driver if it fails.

	* src/remote/remote_driver.c: Ignore failure to issue CLOSE
	  RPC call

2011-07-08  Daniel P. Berrange  <berrange@redhat.com>

	Fix release of outgoing stream confirmation/abort message
	When sending back the final OK or ERROR message on completion
	of a stream, we were not decrementing the 'nrequests' tracker
	on the client. With the default requests limit of '5', this
	meant once a client had created 5 streams, they are unable to
	process any further RPC calls.  There was also a bug when
	handling an error from decoding a message length header, which
	meant a client connection would not immediately be closed.

	* src/rpc/virnetserverclient.c: Fix release of request after
	  stream completion & mark client for close on error

2011-07-08  Daniel P. Berrange  <berrange@redhat.com>

	Fix leak of 'msg' object in client stream code
	In one exit path we forgot to free the virNetMessage object causing
	a large memory leak for streams which send a lot of data. Some other
	paths were calling VIR_FREE directly instead of virNetMessageFree
	although this was (currently) harmless.

	* src/rpc/virnetclientstream.c: Fix leak of msg object
	* src/rpc/virnetclientprogram.c: Call virNetMessageFree instead
	  of VIR_FREE

2011-07-08  Daniel P. Berrange  <berrange@redhat.com>

	Fix potential crash in libvirtd with active streams
	If a client disconnects while it has a stream active, there is
	a race condition which could see libvirtd crash. This is because
	the client struct may be freed before the last stream event has
	triggered. This is trivially solved by holding an extra reference
	on the client for the stream callbak

	* daemon/stream.c: Acquire reference on client when adding the
	  stream callback

2011-07-08  Daniel P. Berrange  <berrange@redhat.com>

	Fix mistaken order of server cert/key parameters in constructor
	The virNetTLSContextNew was being passed key/cert parameters in
	the wrong order. This wasn't immediately visible because if
	virNetTLSContextNewPath was used, a second bug reversed the order
	of those parameters again.

	Only if the paths were manually specified in /etc/libvirt/libvirtd.conf
	did the bug appear

	* src/rpc/virnettlscontext.c: Fix order of params passed to
	  virNetTLSContextNew

2011-07-08  Michal Privoznik  <mprivozn@redhat.com>

	graphics: add support for action_if_connected in qemu
	This option accepts 3 values:
	-keep, to keep current client connected (Spice+VNC)
	-disconnect, to disconnect client (Spice)
	-fail, to fail setting password if there is a client connected (Spice)

2011-07-08  Jiri Denemark  <jdenemar@redhat.com>

	util: Don't try to fchown files opened as non-root
	When virFileOpenAs is called with VIR_FILE_OPEN_AS_UID flag and uid/gid
	different from root/root while libvirtd is running as root, we fork a
	new child, change its effective UID/GID to uid/gid and run
	virFileOpenAsNoFork. It doesn't make any sense to fchown() the opened
	file in this case since we already know that uid/gid can access the file
	when open succeeds and one of the following situations may happen:

	- the file is already owned by uid/gid and we skip fchown even before
	  this patch
	- the file is owned by uid but not gid because it was created in a
	  directory with SETGID set, in which case it is desirable not to change
	  the group
	- the file may be owned by a completely different user and/or group
	  because it was created on a root-squashed or even all-squashed NFS
	  filesystem, in which case fchown would most likely fail anyway

2011-07-08  Michal Privoznik  <mprivozn@redhat.com>

	qemu: Don't chown files on NFS share if dynamic_ownership is off
	When dynamic ownership is disabled we don't want to chown any files,
	not just local.

2011-07-08  John Williams  <john.williams@petalogix.com>

	microblaze: Add architecture support
	Add libvirt support for MicroBlaze architecture as a QEMU target.  Based on mips/mipsel pattern.

2011-07-08  Jim Fehlig  <jfehlig@novell.com>

	Skip some xen tests if xend is not running
	Currently, the xen statstest and reconnect tests are only compiled
	if xend is running.  Compile them unconditionally if xen headers
	are present, but skip the tests at runtime if xend is not running.

	This is in response to Eric's suggestion here

	https://www.redhat.com/archives/libvir-list/2011-July/msg00367.html

2011-07-08  Eric Blake  <eblake@redhat.com>

	util: drop unused safezero argument
	No caller was using the flags argument, and this function is internal
	only, so we might as well skip it.

	* src/util/util.h (safezero): Update signature.
	* src/util/util.c (safezero): Update function.
	* src/locking/lock_driver_sanlock.c
	(virLockManagerSanlockSetupLockspace)
	(virLockManagerSanlockCreateLease): Update all callers.
	* src/storage/storage_backend.c (createRawFile): Likewise.

2011-07-08  Eric Blake  <eblake@redhat.com>

	conf: prefer unsigned int for flags
	* src/conf/domain_conf.c (virDomainGraphicsDefParseXML)
	(virDomainDeviceInfoFormat, virDomainDeviceInfoParseXML)
	(virDomainDiskDefParseXML, virDomainControllerDefParseXML)
	(virDomainFSDefParseXML, virDomainNetDefParseXML)
	(virDomainChrDefParseTargetXML, virDomainChrDefParseXML)
	(virDomainSmartcardDefParseXML, virDomainInputDefParseXML)
	(virDomainTimerDefParseXML, virDomainSoundDefParseXML)
	(virDomainWatchdogDefParseXML, virDomainMemballoonDefParseXML)
	(virDomainVideoDefParseXML)
	(virDomainHostdevSubsysUsbDefParseXML)
	(virDomainHostdevSubsysPciDefParseXML)
	(virDomainHostdevDefParseXML, virSecurityLabelDefParseXML)
	(virDomainVcpuPinDefParseXML, virDomainDefParseXML)
	(virDomainDefParse, virDomainDiskDefFormat)
	(virDomainControllerDefFormat, virDomainFSDefFormat)
	(virDomainNetDefFormat, virDomainChrSourceDefFormat)
	(virDomainChrDefFormat, virDomainSmartcardDefFormat)
	(virDomainSoundDefFormat, virDomainMemballoonDefFormat)
	(virDomainWatchdogDefFormat, virDomainVideoDefFormat)
	(virDomainInputDefFormat, virDomainGraphicsDefFormat)
	(virDomainHostdevDefFormat, virDomainObjFormat): Switch signature.
	(virDomainObjTaint, virDomainSaveStatus): Use unsigned flags.

2011-07-08  Eric Blake  <eblake@redhat.com>

	drivers: prefer unsigned int for flags
	Now that the public APIs always use unsigned flags, the internal
	driver callbacks might as well do likewise.

	* src/driver.h (vrDrvOpen, virDrvDomainCoreDump)
	(virDrvDomainGetXMLDesc, virDrvNetworkGetXMLDesc)
	(virDrvNWFilterGetXMLDesc): Update type.
	* src/remote/remote_protocol.x (remote_open_args)
	(remote_domain_core_dump_args, remote_domain_get_xml_desc_args)
	(remote_network_get_xml_desc_args)
	(remote_nwfilter_get_xml_desc_args): Likewise.
	* src/test/test_driver.c: Update clients.
	* src/remote/remote_driver.c: Likewise.
	* src/xen/xen_hypervisor.c: Likewise.
	* src/xen/xen_hypervisor.h: Likewise.
	* src/xen/xen_driver.c: Likewise.
	* src/xen/xend_internal.c: Likewise.
	* src/xen/xend_internal.h: Likewise.
	* src/xen/xm_internal.c: Likewise.
	* src/xen/xm_internal.h: Likewise.
	* src/xen/xs_internal.c: Likewise.
	* src/xen/xs_internal.h: Likewise.
	* src/xen/xen_inotify.c: Likewise.
	* src/xen/xen_inotify.h: Likewise.
	* src/phyp/phyp_driver.c: Likewise.
	* src/openvz/openvz_driver.c: Likewise.
	* src/vmware/vmware_driver.c: Likewise.
	* src/vbox/vbox_driver.c: Likewise.
	* src/vbox/vbox_tmpl.c: Likewise.
	* src/xenapi/xenapi_driver.c: Likewise.
	* src/esx/esx_driver.c: Likewise.
	* src/esx/esx_interface_driver.c: Likewise.
	* src/esx/esx_network_driver.c: Likewise.
	* src/esx/esx_storage_driver.c: Likewise.
	* src/esx/esx_device_monitor.c: Likewise.
	* src/esx/esx_secret_driver.c: Likewise.
	* src/esx/esx_nwfilter_driver.c: Likewise.
	* src/interface/netcf_driver.c: Likewise.
	* src/nwfilter/nwfilter_driver.c: Likewise.
	* src/libxl/libxl_driver.c: Likewise.
	* src/qemu/qemu_driver.c: Likewise.
	* src/lxc/lxc_driver.c: Likewise.
	* src/uml/uml_driver.c: Likewise.
	* src/network/bridge_driver.c: Likewise.
	* src/secret/secret_driver.c: Likewise.
	* src/storage/storage_driver.c: Likewise.
	* src/node_device/node_device_hal.c: Likewise.
	* src/node_device/node_device_udev.c: Likewise.
	* src/remote_protocol-structs: Likewise.

2011-07-08  Eric Blake  <eblake@redhat.com>

	public API: prefer unsigned int for flags
	Most APIs use 'unsigned int flags'; but a few stragglers were using
	a signed value.  In particular, the vir*GetXMLDesc APIs were
	split-brain, with inconsistent choice of types.  Although it is
	an API break to use 'int' instead of 'unsigned int', it is ABI
	compatible (pre-compiled apps will have no difference in behavior),
	and generally apps can be recompiled without any issue (only rare
	apps that compiled with extremely high warning levels, or which
	pass libvirt API around as typed function pointers, would have to
	make any code changes to deal with the change).

	The migrate APIs use 'unsigned long flags', which can't be changed,
	due to ABI constraints.

	This patch intentionally touches only the public API, to prove the
	claim that most existing code (including driver callbacks and virsh)
	still compiles just fine in spite of the type change.

	* include/libvirt/libvirt.h.in (virConnectOpenAuth)
	(virDomainCoreDump, virDomainGetXMLDesc, virNetworkGetXMLDesc)
	(virNWFilterGetXMLDesc): Use unsigned int for flags.
	(virDomainHasCurrentSnapshot): Use consistent spelling.
	* src/libvirt.c (virConnectOpenAuth, virDomainCoreDump)
	(virDomainGetXMLDesc, virNetworkGetXMLDesc)
	(virNWFilterGetXMLDesc, do_open): Update accordingly.

2011-07-08  Eric Blake  <eblake@redhat.com>

	maint: print flags in hex during debug
	Debugging decimal flags is a pain.

	* src/libvirt.c: Always print flags in hex.

2011-07-08  Eric Blake  <eblake@redhat.com>

	virsh: make destroy sound less scary
	Destroy has a rather negative English connotation.  Try to reduce
	the impact, so newbies aren't as scared to use it.

	* tools/virsh.c: Tweak all destroy documentation.
	* tools/virsh.pod: Likewise.

2011-07-08  Eric Blake  <eblake@redhat.com>

	build: use gnulib pthread_sigmask
	Gnulib finally learned how to do pthread_sigmask on mingw.

	* .gnulib: Update to latest, for pthread_sigmask.
	* bootstrap.conf (gnulib_modules): Add pthread_sigmask.
	* configure.ac (AC_CHECK_FUNCS): Drop redundant check.
	* src/rpc/virnetclient.c (virNetClientSetTLSSession)
	(virNetClientIOEventLoop): Make code unconditional.
	* src/util/command.c (virFork): Likewise.
	* tools/virsh.c (doMigrate, cmdMigrate): Likewise.

2011-07-08  Eric Blake  <eblake@redhat.com>

	build: fix virBufferVasprintf on mingw
	Gnulib documents that mingw vsnprintf is broken (it returns -1
	on out-of-space, instead of the count of what would have been
	printed); but while we were using the snprintf wrapper, we had
	not yet been using the vsnprintf wrapper.

	Meanwhile, mingw (but not mingw64) has a replacement snprintf
	that fixes return values, but still lacks %1$s support; so in
	that case, gnulib didn't replace snprintf, but libintl then
	went ahead and installed a version that supported %1$s but not
	return values.  Gnulib has since been fixed to guarantee that
	the snprintf module will always guarantee the constraints needed
	by libintl.

	Also, we want to guarantee that strdup sets errno on failure.

	* .gnulib: Update to latest, for vsnprintf fix.
	* bootstrap.conf (gnulib_modules): Add vsnprintf, strdup-posix.
	Reported by Matthias Bolte.

2011-07-08  Jim Fehlig  <jfehlig@novell.com>

	Fix compilation of statstest.c during make check

2011-07-07  Matthias Bolte  <matthias.bolte@googlemail.com>

	python: Fix bogus label placement

2011-07-07  Laine Stump  <laine@laine.org>

	util: close the ioctl socket at the end of if(Get|Set)MacAddress
	Otherwise this will leak an fd each time one of these functions is
	called.

	util: rename err_exit to cleanup in interface.c
	This brings it in line with the recommendations in HACKING.

2011-07-07  Minoru Usui  <usui@mxm.nes.nec.co.jp>

	sysinfo: delete unnecessary white space of sysinfo.
	  * Trim each element and delete null entry of sysinfo by
	  virSkipSpacesBackwards().

2011-07-07  Eric Blake  <eblake@redhat.com>

	util: add virTrimSpaces
	The next patch wants to adjust an end pointer to trim trailing
	spaces but without modifying the underlying string, but a more
	generally useful ability to trim trailing spaces in place is
	also worth providing.

	* src/util/util.h (virTrimSpaces, virSkipSpacesBackwards): New
	prototypes.
	* src/util/util.c (virTrimSpaces, virSkipSpacesBackwards): New
	functions.
	* src/libvirt_private.syms (util.h): Export new functions.
	Inspired by a patch by Minoru Usui.

2011-07-07  Eric Blake  <eblake@redhat.com>

	util: fix virSkipSpaces
	Most clients of virSkipSpaces don't want to omit backslashes.
	Also, open-coding the list of spaces is not as nice as using
	c_isspace.

	* src/util/util.c (virSkipSpaces): Use c_isspace.
	(virSkipSpacesAndBackslash): New function.
	* src/util/util.h (virSkipSpacesAndBackslash): New prototype.
	* src/xen/xend_internal.c (sexpr_to_xend_topology): Update caller.
	* src/libvirt_private.syms (util.h): Export new function.

2011-07-07  Eric Blake  <eblake@redhat.com>

	docs: minor whitespace cleanups
	No change in wording.  One spacing change in a <pre>, noticed because
	of odd XML formatting online; the rest is in free-flowing text to
	make it easier to see nesting levels in the document.

	* docs/formatdomain.html.in: Adjust spacing.  Break long lines.

2011-07-06  Matthias Bolte  <matthias.bolte@googlemail.com>

	Reduce code duplication in virFileMakePath(Helper)
	Move stat and mkdir to virFileMakePathHelper.

	Also use the stat result to detect whether the existing path
	is a directory and set errno accordingly if it's not.

2011-07-06  Matthias Bolte  <matthias.bolte@googlemail.com>

	apparmor: Finish incomplete renaming of relabel to norelabel
	Commit 693eac388f1759d was incomplete here.

2011-07-06  Daniel P. Berrange  <berrange@redhat.com>

	Fix default value of security label 'relabel' attribute
	When no <seclabel> is present in the XML, the virDomainSeclabelDef
	struct is left as all zeros. Unfortunately, this means it gets setup
	as type=dynamic, with relabel=no, which is an illegal combination.

	Change the 'bool relabel' attribute in virDomainSeclabelDef to
	the inverse 'bool norelabel' so that the default initialization
	is sensible

	* src/conf/domain_conf.c, src/conf/domain_conf.h,
	  src/security/security_apparmor.c, src/security/security_selinux.c:
	  Replace 'relabel' with 'norelabel'

2011-07-06  Matthias Bolte  <matthias.bolte@googlemail.com>

	Fix return value semantic of virFileMakePath
	Some callers expected virFileMakePath to set errno, some expected
	it to return an errno value. Unify this to return 0 on success and
	-1 on error. Set errno to report detailed error information.

	Also optimize virFileMakePath if stat fails with an errno different
	from ENOENT.

2011-07-06  Matthias Bolte  <matthias.bolte@googlemail.com>

	nodedev: Let check_fc_host_linux report errors to the caller

2011-07-06  Jean-Baptiste Rouault  <jean-baptiste.rouault@diateam.net>

	Fix compilation error when SASL support is disabled
	This patch adds #if HAVE_SASL where needed in libvirtd.h

2011-07-06  Guannan Ren  <gren@redhat.com>

	pci: initialize state values on reattach
	add a new API pciDeviceReAttachInit() in pci.c to initialize state values for nodedev reattach

	Initialize three state value of device driver to 1. This is just for a new call to
	qemudNodeDeviceReAttach()

2011-07-06  Laine Stump  <laine@laine.org>

	xml: create an RNG file for common types and move some definitions there
	domain.rng, network.rng, and interface.rng already use a few of the
	same types (or in some cases *should* but don't), and an upcoming code
	change will have them sharing even more. To prepare for that, this
	patch takes those common data type definitions and moves them into
	basictypes.rng.

	This may break some rule about the need to RNG files to be autonomous
	or something, but I saw that storageencryption.rng is used in this
	way, so I figured it must not be completely against the law...

2011-07-06  Laine Stump  <laine@laine.org>

	docs: sort the file list in the schemas Makefile

	qemu: check flags in qemuDomainGetXMLDesc
	Although most functions with flags check to verify no application is
	passing in flag bits that are currently undefined, for some reason
	this function wasn't.

2011-07-06  Laine Stump  <laine@laine.org>

	conf: fix domain parse flags
	* Change all flags args from int to unsigned int

	* Allow passing flags in virDomainObjParseFile (and propogate those
	  flags all the way down the call chain). Previously the flags were
	  hardcoded (to VIR_DOMAIN_XML_INTERNAL_STATUS) several layers down
	  the chain. Pass that value in at the one place that is currently
	  calling virDomainObjParseFile.

2011-07-05  Matthias Bolte  <matthias.bolte@googlemail.com>

	tests: Disable networkxml2argvtest when configured without network
	Reported by Ruben Kerkhof.

	qemu: Fix virFileMakePath error handling in snapshot creation
	virFileMakePath returns an errno value on error, that will never
	be negative. An virFileMakePath error would have been ignored here,
	instead of being reported correctly.

2011-07-05  Matthias Bolte  <matthias.bolte@googlemail.com>

	conf: Fix declaration of virNetworkDNS(Hosts)Def struct
	The struct A {} A; construct triggers a linker error on OSX about
	duplicate symbols. This also differs from the common struct style.

	Switch to common style to fix this.

	Reported by Justin Clift.

2011-07-04  Daniel P. Berrange  <berrange@redhat.com>

	Add documentation for the seclabel XML element
	The domain XML documentation is missing information about the
	<seclabel> element used by security drivers

	* formatdomain.html.in: Document <seclabel>

2011-07-04  Daniel P. Berrange  <berrange@redhat.com>

	Allow for resource relabelling with static labels
	Add a new attribute to the <seclabel> XML to allow resource
	relabelling to be enabled with static label usage.

	  <seclabel model='selinux' type='static' relabel='yes'>
	    <label>system_u:system_r:svirt_t:s0:c392,c662</label>
	  </seclabel>

	* docs/schemas/domain.rng: Add relabel attribute
	* src/conf/domain_conf.c, src/conf/domain_conf.h: Parse
	  the 'relabel' attribute
	* src/qemu/qemu_process.c: Unconditionally clear out the
	  'imagelabel' attribute
	* src/security/security_apparmor.c: Skip based on 'relabel'
	  attribute instead of label type
	* src/security/security_selinux.c: Skip based on 'relabel'
	  attribute instead of label type and fill in <imagelabel>
	  attribute if relabel is enabled.

2011-07-04  Daniel P. Berrange  <berrange@redhat.com>

	Allow a base label to be specified in dynamic labelling mode
	Normally the dynamic labelling mode will always use a base
	label of 'svirt_t' for VMs. Introduce a <baselabel> field
	in the <seclabel> XML to allow this base label to be changed

	eg

	   <seclabel type='dynamic' model='selinux'>
	     <baselabel>system_u:object_r:virt_t:s0</baselabel>
	   </seclabel>

	* docs/schemas/domain.rng: Add <baselabel>
	* src/conf/domain_conf.c, src/conf/domain_conf.h: Parsing
	  of base label
	* src/qemu/qemu_process.c: Don't reset 'model' attribute if
	  a base label is specified
	* src/security/security_apparmor.c: Refuse to support base label
	* src/security/security_selinux.c: Use 'baselabel' when generating
	  label, if available

2011-07-04  Osier Yang  <jyang@redhat.com>

	storage: Do not override the exact error of createRawFile
	virStorageBackendCreateRaw: createRawFile already reported the
	exact error.

	Before the fix:

	error: Failed to create vol vol-create.img
	error: cannot create path '/var/lib/libvirt/images/vol-create.img': Unknown error 18446744073709551597

	After the fix:

	error: Failed to create vol vol-create.img
	error: cannot fill file '/var/lib/libvirt/images/vol-create.img': No space left on device

2011-07-04  Daniel Veillard  <veillard@redhat.com>

	Release of libvirt-0.9.3
	* configure.ac docs/news.html.in libvirt.spec.in: update for the
	  new release
	* po/*.po*: updated and regenerated localizations

2011-07-04  Wen Congyang  <wency@cn.fujitsu.com>

	initialize pointer to NULL
	cmd is not initialized to NULL, but we try to freed it if we
	meet some error.

2011-07-04  Eric Blake  <eblake@redhat.com>

	storage: avoid crash on parse error
	Coverity detected that we could crash on bogus input.  Meanwhile,
	strtok_r is rather heavy compared to strchr.

	* src/storage/storage_backend_iscsi.c (virStorageBackendIQNFound):
	  Check for parse failure, and use lighter-weight functions.

2011-07-04  Eric Blake  <eblake@redhat.com>

	vmware: avoid null deref on failed lookup
	* src/vmware/vmware_driver.c (vmwareDomainReboot): Check error
	  before dereferencing memory.

2011-07-04  Eric Blake  <eblake@redhat.com>

	qemu: avoid null deref on low memory
	Detected by Coverity.  qemuDomainEventQueue requires a non-NULL
	pointer; most callers silently drop the event if we encountered
	and OOM situation trying to create the event.

	* src/qemu/qemu_migration.c (qemuMigrationFinish): Check for OOM.

2011-07-04  Eric Blake  <eblake@redhat.com>

	cgroup: silence coverity warning
	Coverity noted that most clients reacted to failure to hash; but in
	a best-effort kill loop, we can ignore failure.

	* src/util/cgroup.c (virCgroupKillInternal): Ignore hash failure.

2011-07-04  Eric Blake  <eblake@redhat.com>

	rpc: silence coverity warning
	Coverity noted that 4 out of 5 calls to virNetClientStreamRaiseError
	checked the return value.  This case expects a particular value, so
	warn if our expectations went wrong due to some bug elsewhere.

	* src/rpc/virnetclient.c (virNetClientCallDispatchStream): Warn on
	  unexpected scenario.

2011-07-04  Eric Blake  <eblake@redhat.com>

	qemu: silence coverity warnings
	Coverity warns if the majority of callers check a function for
	errors, but a few don't; but in qemu_audit and qemu_domain, the
	choice to not check for failures was safe.  In qemu_command, the
	failure to generate a uuid can only occur on a bad pointer.

	* src/qemu/qemu_audit.c (qemuAuditCgroup): Ignore failure to get
	  cgroup controller.
	* src/qemu/qemu_domain.c (qemuDomainObjEnterMonitor)
	  (qemuDomainObjEnterMonitorWithDriver): Ignore failure to get
	  timestamp.
	* src/qemu/qemu_command.c (qemuParseCommandLine): Check for error.

2011-07-04  Eric Blake  <eblake@redhat.com>

	rpc: avoid memory leak on error
	Detected by Coverity.  The leak is on an error path, but I'm not
	sure whether that path is likely to be triggered in practice.

	* src/rpc/virnetserverservice.c (virNetServerServiceAccept): Plug leak.

2011-07-04  Eric Blake  <eblake@redhat.com>

	rpc: fix logic bug
	Spotted by Coverity.  If we don't update tmp each time through
	the loop, then if the filter being removed was not the head of
	the list, we accidentally lose all filters prior to the one we
	wanted to remove.

	* src/rpc/virnetserverclient.c (virNetServerClientRemoveFilter):
	    Don't lose unrelated filters.

2011-07-02  Eric Blake  <eblake@redhat.com>

	pci: avoid memory leak on error
	Detected by Coverity.  Some, but not all, error paths were clean;
	but they were repetitive so I refactored them.

	* src/util/pci.c (pciGetDevice): Plug leak.

2011-07-02  Eric Blake  <eblake@redhat.com>

	interface: avoid memory leak on parse error
	Detected by Coverity.  Unlikely to hit unless the file contents
	were corrupted.

	* src/util/interface.c (ifaceRestoreMacAddress): Plug leak.

2011-07-02  Eric Blake  <eblake@redhat.com>

	libvirtd: avoid memory leak on OOM
	Detected by Coverity; only strikes on OOM so not serious.

	* daemon/libvirtd.c (daemonPidFilePath): Plug leak.

2011-07-02  Eric Blake  <eblake@redhat.com>

	build: avoid 'make syntax-check' failure
	* tests/utiltest.c (DO_TEST): Fix indentation for cppi.

2011-07-02  Matthias Bolte  <matthias.bolte@googlemail.com>

	tests: Add a general util test
	Move non-esx specific tests from esxutilstest there and add a
	test for virParseVersionString.

2011-07-02  Eric Blake  <eblake@redhat.com>

	util: choose whether to require micro in version strings
	To avoid regressions, we let callers specify whether to require a
	minor and micro version.  Callers that were parsing uname() output
	benefit from defaulting to 0, whereas callers that were parsing
	version strings from other sources should not change in behavior.

	* src/util/util.c (virParseVersionString): Allow caller to choose
	whether to fail if minor or micro is missing.
	* src/util/util.h (virParseVersionString): Update signature.
	* src/esx/esx_driver.c (esxGetVersion): Update callers.
	* src/lxc/lxc_driver.c (lxcVersion): Likewise.
	* src/openvz/openvz_conf.c (openvzExtractVersionInfo): Likewise.
	* src/uml/uml_driver.c (umlGetVersion): Likewise.
	* src/vbox/vbox_MSCOMGlue.c (vboxLookupVersionInRegistry):
	Likewise.
	* src/vbox/vbox_tmpl.c (vboxExtractVersion): Likewise.
	* src/vmware/vmware_conf.c (vmwareExtractVersion): Likewise.
	* src/xenapi/xenapi_driver.c (xenapiGetVersion): Likewise.
	Reported by Matthias Bolte.

2011-07-02  Eric Blake  <eblake@redhat.com>

	build: consistently use CFLAGS
	According to the automake manual, CPPFLAGS (aka INCLUDES, as spelled
	in automake 1.9.6) should only include -I, -D, and -U directives; more
	generic directives like -Wall belong in CFLAGS since they affect more
	phases of the build process.  Therefore, we should be sticking CFLAGS
	additions into a CFLAGS container, not a CPPFLAGS container.

	* src/Makefile.am (libvirt_driver_vmware_la_CFLAGS): Use AM_CFLAGS.
	(INCLUDES): Move CFLAGS items...
	(AM_CFLAGS): ...to their proper location.
	* python/Makefile.am (INCLUDES, AM_CFLAGS): Likewise.
	* tests/Makefile.am (INCLUDES, AM_CFLAGS): Likewise.
	(commandtest_CFLAGS, commandhelper_CFLAGS)
	(virnetmessagetest_CFLAGS, virnetsockettest_CFLAGS): Use AM_CFLAGS.

2011-07-01  Daniel Veillard  <veillard@redhat.com>

	Explicitely invoke python for API doc generator
	This fixes the problem of not finding python in /usr/bin
	which broke build on FreeBSD

2011-07-01  Scott Moser  <smoser@ubuntu.com>

	fix virParseVersionString with linux 3.0
	linux 3.0 has no micro version number, and that is causing problems
	for virParseVersionString.  The patch below should allow for:
	  major
	  major.minor
	  major.minor.micro

	If major or minor are not present they just default to zero.
	We found this in Ubuntu (https://bugs.launchpad.net/bugs/802977)

2011-07-01  Eric Blake  <eblake@redhat.com>

	build: remove dead variables
	Detected by Coverity.  No real harm in leaving these, but fixing
	them cuts down on the noise for future analysis.

	* src/rpc/virnetserver.c (virNetServerAddService): Delete unused
	entry.
	* src/util/sysinfo.c (virSysinfoRead): Delete dead assignment to
	base.

2011-07-01  Daniel P. Berrange  <berrange@redhat.com>

	Remove bogus jsondata.h file reference which does not exist
	* tests/Makefile.am: Remove jsondata.h

2011-07-01  Eric Blake  <eblake@redhat.com>

	build: simplify sanlock distribution
	EXTRA_DIST files should unconditionally be part of the tarball,
	rather than depending on the presence of sanlock-devel.

	Meanwhile, parallel builds could fail if we don't use mkdir -p.

	* src/Makefile.am (EXTRA_DIST): Always ship sanlock .aug and
	template .conf files.
	(%-sanlock.conf): Use MKDIR_P.

2011-07-01  Eric Blake  <eblake@redhat.com>

	build: allow 'make syntax-check' on fresh checkout
	For good or for bad, I did a fresh checkout, ./autogen.sh, then
	'configure', then 'make syntax-check', and was surprised that it
	failed.  Running 'make' before 'make syntax-check' cleaned up the
	issue, but this patch makes it work up front.

	* cfg.mk (sc_po_check): Add prerequisites.

2011-07-01  Eric Blake  <eblake@redhat.com>

	build: ignore generated file
	* .gitignore: Exempt jsontest binary.

2011-07-01  Daniel P. Berrange  <berrange@redhat.com>

	Add conditionals to allow build without SASL
	* daemon/libvirtd.c, daemon/remote.c: Add #if HAVE_SASL and
	  suitable function stubs to allow build without SASL

2011-07-01  Eric Blake  <eblake@redhat.com>

	build: avoid double-close bug with pipe2
	Based on Coverity's finding on the previous patch, I audited
	gnulib's pipe2 code and found that we had the potential for
	a subtle double-close bug, unless gnulib guarantees that the
	contents of the fd array are unchanged on pipe2() failure.

	* .gnulib: Update to latest, for pipe2 fix.

2011-07-01  Eric Blake  <eblake@redhat.com>

	rpc: avoid freeing uninitialized variable
	Detected by Coverity.  Both are instances of bad things happening
	if pipe2 fails; the virNetClientNew failure could free garbage,
	and virNetSocketNewConnectCommand could close random fds.

	Note: POSIX doesn't guarantee the contents of fd[0] and fd[1]
	after pipe failure: http://austingroupbugs.net/view.php?id=467
	We may need to introduce a virPipe2 wrapper that guarantees
	that on pipe failure, the fds are explicitly set to -1, rather
	than our current state of assuming the fds are unchanged from
	their value prior to the failed pipe call.

	* src/rpc/virnetclient.c (virNetClientNew): Initialize variable.
	* src/rpc/virnetsocket.c (virNetSocketNewConnectCommand):
	Likewise.

2011-07-01  Eric Blake  <eblake@redhat.com>

	virsh: avoid uninitialized variable
	Detected by Coverity; neither vshCmddefHelp nor vshCmdOptParse
	was initializing opts_required.

	* tools/virsh.c (vshCmddefOptParse): Always initialize bitmaps.

2011-07-01  Eric Blake  <eblake@redhat.com>

	virsh: avoid integer overflow
	Detected by Coverity.  info.nrVirtCpu is unsigned short, but if
	cpumaplen is int, then the product of the two in vshMalloc risks
	unintended sign extension.  cmdVcpuinfo had already solved this
	by using size_t cpumaplen.

	* tools/virsh.c (cmdVcpuPin): Use correct type.

2011-07-01  Daniel P. Berrange  <berrange@redhat.com>

	Fix stream procedure number for virDomainMigratePrepareTunnel3
	The virDomainMigratePrepareTunnel3 impl in the remote driver
	was using the procedure number for the virDomainMigratePrepareTunnel
	method. This doesn't work out so well, because it makes the server
	ignore & drop all stream packets

	* src/remote/remote_driver.c: Fix procedure for PrepareTunnel3

2011-07-01  Daniel P. Berrange  <berrange@redhat.com>

	Send back an error if we get unexpected stream control message
	We ignore any stream data packets which come in for streams which
	are not registered, since these packets are async and do not have
	a reply. If we get a stream control packet though we must send back
	an actual error, otherwise a (broken) client may hang forever
	making it hard to diagnose the client bug.

	* src/rpc/virnetserverprogram.c: Send back error for unexpected
	  stream control messages

2011-07-01  Daniel P. Berrange  <berrange@redhat.com>

	Fix release of virNetMessagePtr instances in streams processing
	If a message packet for a invalid stream is received it is just
	free'd. This is not good because it doesn't let the client RPC
	request counter decrement. If a stream is shutdown with pending
	packets the message also isn't released properly because of an
	incorrect header type

	* daemon/stream.c: Fix message header type
	* src/rpc/virnetserverprogram.c: Send dummy reply instead of
	  free'ing ignored stream message

2011-07-01  Daniel P. Berrange  <berrange@redhat.com>

	Add missing include of signal.h in virnetsocket.c
	virNetSocketFree uses kill(SIGTERM) so we must include
	signal.h for the definitions

	* src/rpc/virnetsocket.c: Include signal.h

2011-07-01  Daniel P. Berrange  <berrange@redhat.com>

	Add test case for parsing JSON docs
	While investigating some memory leaks it was unclear whether the
	JSON code correctly free'd all memory during parsing. Add a test
	case which can be run under valgrind to clearly demonstrate that
	the parser is leak free.

	* tests/Makefile.am: Add 'jsontest'
	* tests/jsontest.c: A few simple JSON parsing tests

2011-07-01  Daniel P. Berrange  <berrange@redhat.com>

	Fix potential crash when saving guests
	The qemudDomainSaveFlag method will call EndJob on the 'vm'
	object it is passed in. This can result in the 'vm' object
	being free'd if the last reference is removed. Thus no caller
	of 'qemudDomainSaveFlag' must *ever* reference 'vm' again
	upon return.

	Unfortunately qemudDomainSave and qemuDomainManagedSave
	both call 'virDomainObjUnlock', which can result in a
	crash. This is non-deterministic since it involves a race
	with the monitor I/O thread.

	Fix this by making qemudDomainSaveFlag responsible for
	calling virDomainObjUnlock instead.

	* src/qemu/qemu_driver.c: Fix potential use after free
	  when saving guests

2011-07-01  Daniel P. Berrange  <berrange@redhat.com>

	Fix uninitialized value in QEMU monitor FD sending code
	The 'char control[CMSG_SPACE(sizeof(int))];' was not being
	wiped, so could potentially contain uninitialized bytes.
	While this was harmless in this case, it caused complaints
	from valgrind

	* src/qemu/qemu_monitor.c: memset 'control' variable
	  in qemuMonitorIOWriteWithFD

2011-07-01  Daniel P. Berrange  <berrange@redhat.com>

	Fix leak of JSON object for events
	The event handler functions do not free the virJSONValuePtr
	object. Every event received from a VM thus caused a memory
	leak

	* src/qemu/qemu_monitor_json.c: Fix leak of event object

2011-07-01  Daniel P. Berrange  <berrange@redhat.com>

	Remove bogus warning message in JSON code
	* src/util/json.c: Remove warning message

2011-07-01  Daniel P. Berrange  <berrange@redhat.com>

	Fix use of uninitialized memory when releasing PCI slots
	The 'function' field in the PCI address was not correctly
	initialized, so it was building the wrong address address
	string and so not removing all functions from the in use
	list.

	* src/qemu/qemu_command.c: Fix initialization of PCI function

2011-07-01  Daniel P. Berrange  <berrange@redhat.com>

	Fix leak of virStreamPtr object with callback added in fdstream impl
	When adding a callback to an FD stream, we take an extra reference
	on the virStreamPtr instance. We forgot to registered a free function
	with the callback, so when the callback was removed, the extra
	reference held on virStreamPtr was not released.

	* src/fdstream.c: Use a free callback to release reference on
	  virStreamPtr when removing callback

2011-07-01  Daniel P. Berrange  <berrange@redhat.com>

	Fix leak of mdnsGroupName in virNetServer object
	* src/rpc/virnetserver.c: Free mdnsGroupName

2011-07-01  Daniel P. Berrange  <berrange@redhat.com>

	Fix release of filtered stream messages
	The stream code was reusing a stream message object before
	it was removed from the linked list of filtered messages.
	This caused any later queued messages to be completely lost.

	* daemon/stream.c: Delay reuse of stream message until
	  after it is removed from the queue

2011-07-01  Daniel P. Berrange  <berrange@redhat.com>

	Ensure RPC message is cleared before being reused
	To save on memory reallocation, virNetMessage instances that
	have been transmitted, may be reused for a subsequent incoming
	message. We forgot to clear out the old data of the message
	fully, which caused later confusion upon read.

	* src/rpc/virnetserverclient.c: memset entire message before
	  reusing it

2011-07-01  Daniel P. Berrange  <berrange@redhat.com>

	Fix hardcoded limit on client requests in RPC code
	The virNetServerClient object had a hardcoded limit of 10 requests
	per client. Extend constructor to allow it to be passed in as a
	configurable variable. Wire this up to the 'max_client_requests'
	config parameter in libvirtd

	* daemon/libvirtd.c: Pass max_client_requests into services
	* src/rpc/virnetserverservice.c, src/rpc/virnetserverservice.h: Pass
	  nrequests_client_max to clients
	* src/rpc/virnetserverclient.c, src/rpc/virnetserverclient.h: Allow
	  configurable request limit

2011-06-30  Osier Yang  <jyang@redhat.com>

	tests: Add valgrind.supp into EXTRA_DIST

	virsh: Fix a problem of buildPoolXML
	It doesn't generate "<name>" and "<format>" nodes for "<source>"
	even if they are explicitly specified. This patch fixes it.

2011-06-30  Wen Congyang  <wency@cn.fujitsu.com>

	lock qemu_driver early in qemuGetSchedulerParametersFlags()
	If we pass VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG to
	qemuGetSchedulerParametersFlags() or *nparams is less than 1,
	we will unlock qemu_driver without locking it. It's very dangerous.

	We should lock qemu_driver after calling virCheckFlags().

2011-06-30  Wen Congyang  <wency@cn.fujitsu.com>

	save domain status after modifing vcpupin
	We should save domain status after modifing vcpupin. If not,
	we will get wrong vcpupin information after rebooting libvirtd.

2011-06-30  Wen Congyang  <wency@cn.fujitsu.com>

	Fix memory leak in virDomainVcpuPinDel()
	virDomainVcpuPinDefFree() does not free def->cputune.vcpupin if nvcpupin
	is 0, and does not set def->cputune.vcpupin to NULL.

	If we set nvcpupin to 0 but do not free vcpupin, vcpupin will not be freed
	when vm->def is freed.

	Use VIR_FREE() instead of virDomainVcpuPinDefFree() to free the memory
	and set def->cputune.vcpupint to NULL.

2011-06-29  Eric Blake  <eblake@redhat.com>

	build: avoid pod2man on tarball
	virt-sanlock-cleanup.8 has static contents (no dependency on
	configure), but is generated by pod2man (a perl dependency that
	maintainers must have, but which ordinary tarball users need
	not have).  Therefore, ensure that it is always part of the
	tarball, even though it is only conditionally installed.

	This is similar to commit 6db98a2d4b, but made simpler by the fact
	that the .8 page is static content.

	* tools/Makefile.am (EXTRA_DIST): Add virt-sanlock-cleanup.8.

2011-06-29  Minoru Usui  <usui@mxm.nes.nec.co.jp>

	sysinfo: fix illegal NULL return
	If virSysinfoParse{BIOS,System,Processor,Memory}()
	can't find newline('\n'), these return NULL.
	This patch fixes this.

2011-06-29  Daniel P. Berrange  <berrange@redhat.com>

	Ensure that EOF is dispatched to the stream callback
	When the remote client receives end of file on the stream
	it never invokes the stream callback. Applications relying
	on async event driven I/O will thus never see the EOF
	condition on the stream

	* src/rpc/virnetclient.c, src/rpc/virnetclientstream.c:
	  Ensure EOF is dispatched

2011-06-29  Daniel P. Berrange  <berrange@redhat.com>

	Fix locking wrt virNetClientStreamPtr object
	The client stream object can be used independently of the
	virNetClientPtr object, so must have full locking of its
	own and not rely on any caller.

	* src/remote/remote_driver.c: Remove locking around stream
	  callback
	* src/rpc/virnetclientstream.c: Add locking to all APIs
	  and callbacks

2011-06-29  Daniel P. Berrange  <berrange@redhat.com>

	Avoid referencing NULL pointer when copying stream error
	* src/rpc/virnetclientstream.c: Avoid referencing NULL

2011-06-29  Daniel P. Berrange  <berrange@redhat.com>

	Avoid free'ing a filtered RPC message in the server
	When a filter steals an RPC message, that message must
	not be freed, except by the filter code itself

	* src/rpc/virnetserverclient.c: Don't free stolen RPC
	  messages

2011-06-29  Daniel P. Berrange  <berrange@redhat.com>

	Improve two log messages in virNetMessage
	Improve log messages issued when encountering a bogus
	message length to include the actual length and the
	limit violated

	* src/rpc/virnetmessage.c: Improve log messages

2011-06-29  Daniel P. Berrange  <berrange@redhat.com>

	Ensure empty payload is written upon stream completion
	On stream completion it is neccessary to send back a
	message with an empty payload. The message header was
	not being filled out correctly, since we were not writing
	any payload. Add a method for encoding an empty payload
	which updates the message headers correctly.

	* src/rpc/virnetmessage.c, src/rpc/virnetmessage.h: Add
	  a virNetMessageEncodePayloadEmpty method
	* src/rpc/virnetserverprogram.c: Write empty payload on
	  stream completion

2011-06-29  Daniel P. Berrange  <berrange@redhat.com>

	Lower logging level when failing to register socket watch
	The RPC client treats failure to register a socket watch
	as non-fatal, since we do not mandate that a libvirt client
	application provide an event loop implementation. It is
	thus inappropriate to a log a message at VIR_LOG_WARN

	* src/rpc/virnetsocket.c: Lower logging level

2011-06-29  Daniel P. Berrange  <berrange@redhat.com>

	Fix propagation of RPC errors from streams
	If a streams error is raised, virNetClientIOEventLoop
	returns 0, but an error is set. Check for this and
	propagate it if present

	* src/rpc/virnetclient.c: Propagate streams error

2011-06-29  Daniel P. Berrange  <berrange@redhat.com>

	Fix crash when aborting a stream from a I/O callback
	If a callback being invoked from a stream issues a virStreamAbort
	operation, the stream data will be free'd but the callback will
	then still try to use this. Delay free'ing of the stream data when
	a callback is dispatching

	* src/fdstream.c: Delay stream free when callback is active

2011-06-29  Michal Privoznik  <mprivozn@redhat.com>

	screenshot: Set access rights to temporary file
	Although we create a temporary file, it is owned by root:root and have
	rights 0600. In case qemu does not run under root, it is unable to write
	to that file and thus we transfer 0B sized file.

2011-06-29  Matthias Bolte  <matthias.bolte@googlemail.com>

	dnsmasq: Fix errno handling and don't unlink non-existing files
	addnhostsSave and hostsfileSave expect < 0 return value on error from
	addnhostsWrite and hostsfileWrite but then pass err instead of -err
	to virReportSystemError that expects an errno value.

	Also addnhostsWrite returns -ENOMEM and errno, change this to -errno.

	addnhostsWrite and hostsfileWrite tried to unlink the tempfile after
	renaming it, making both fail on the final step. Remove the unnecessary
	unlink calls.

2011-06-29  Eric Blake  <eblake@redhat.com>

	maint: improve makefile whitespace
	None of these instances cause any semantic differences, but
	consistency is nice.

	* src/Makefile.am: Replace leading spaces with tabs.

2011-06-29  Osier Yang  <jyang@redhat.com>

	tests: Fix memory leak in virnetmessagetest
	Detected when playing with "make -C tests valgrind".

	conf: Fix memory leak in virNetworkDNSDefFormat

2011-06-29  Matthias Bolte  <matthias.bolte@googlemail.com>

	network: Don't ignore errors in dnsmasq config file creation

2011-06-29  Matthias Bolte  <matthias.bolte@googlemail.com>

	network: Fix dnsmasq hostsfile creation logic and related tests
	networkSaveDnsmasqHostsfile was added in 8fa9c2214247 (Apr 2010).
	It has a force flag. If the dnsmasq hostsfile already exists force
	needs to be true to overwrite it. networkBuildDnsmasqArgv sets force
	to false, networkDefine sets it to true. This results in the
	hostsfile being written only in networkDefine in the common case.
	If no error occurred networkSaveDnsmasqHostsfile returns true and
	networkBuildDnsmasqArgv adds the --dhcp-hostsfile to the dnsmasq
	command line.

	networkSaveDnsmasqHostsfile was changed in 89ae9849f744 (24 Jun 2011)
	to return a new dnsmasqContext instead of reusing one. This change broke
	the logic of the force flag as now networkSaveDnsmasqHostsfile returns
	NULL on error, but the early return -- if force was not set and the
	hostsfile exists -- returns 0. This turned the early return in an error
	case and networkBuildDnsmasqArgv didn't add the --dhcp-hostsfile option
	anymore if the hostsfile already exists. It did because networkDefine
	created the hostsfile already.

	Then 9d4e2845d498 fixed the return 0 case in networkSaveDnsmasqHostsfile
	but didn't apply the force option correctly to the new addnhosts file.
	Now force doesn't control an early return anymore, but influences the
	handling of the hostsfile context creation and dnsmasqSave is always
	called now. This commit also added test cases that reveal several
	problems. First, the tests now calls functions that try to write the
	dnsmasq config files to disk. If someone runs this tests as root this
	might overwrite actively used dnsmasq config files, this is a no-go. Also
	the tests depend on configure --localstatedir, this needs to be fixed as
	well, because it makes the tests fail when localstatedir is different
	from /var.

	This patch does several things to fix this:

	1) Move dnsmasqContext creation and saving out of networkBuildDnsmasqArgv
	to the caller to separate the command line generation from the config
	file writing. This makes the command line generation testable without the
	risk of interfering with system files, because the tests just don't call
	dnsmasqSave.

	2) This refactoring of networkSaveDnsmasqHostsfile makes the force flag
	useless as the saving happens somewhere else now. This fixes the wrong
	usage of the force flag in combination with then newly added addnhosts
	file by removing the force flag.

	3) Adapt the wrong test cases to the correct behavior, by adding the
	missing --dhcp-hostsfile option. Both affected tests contain DHCP host
	elements but missed the necessary --dhcp-hostsfile option.

	4) Rename networkSaveDnsmasqHostsfile to networkBuildDnsmasqHostsfile,
	because it doesn't save the dnsmasqContext anymore.

	5) Move all directory creations in dnsmasq context handling code from
	the *New functions to dnsmasqSave to avoid directory creations in system
	paths in the test cases.

	6) Now that networkBuildDnsmasqArgv doesn't create the dnsmasqContext
	anymore the test case can create one with the localstatedir that is
	expected by the tests instead of the configure --localstatedir given one.

2011-06-29  Matthias Bolte  <matthias.bolte@googlemail.com>

	Fix compilation with systemtap 1.3
	Version 1.3 of <sys/sdt.h> uses this macro

	  #define STAP_CAST(t) (size_t)t

	that breaks like this if t is a function

	  remote.c:1775: error: cast from function call of type 'const char *'
	  to non-matching type 'long unsigned int' [-Wbad-function-cast]

	For that to work it should probably look like this

	  #define STAP_CAST(t) ((size_t)(t))

	In systemtap 1.4 this was completely rewritten.

	Anyway, before commit df0b57a95a767c t was always a variable, but now
	also a function is used here, namely virNetSASLSessionGetIdentity.

	Use an intermediate variable to avoid this problem.

2011-06-29  Eric Blake  <eblake@redhat.com>

	build: fix mingw build
	./autobuild.sh died on several messages resembling:

	../../src/rpc/virnetsocket.c: In function 'virNetSocketNewListenTCP':
	../../src/rpc/virnetsocket.c:231:9: error: implicit declaration of function 'bind_used_without_requesting_gnulib_module_bind' [-Wimplicit-function-declaration]
	../../src/rpc/virnetsocket.c:231:9: error: nested extern declaration of 'bind_used_without_requesting_gnulib_module_bind' [-Wnested-externs]

	Basically, gnulib socket fds are not safe to pass to mingw socket
	functions unless we pull in those gnulib modules.

	* bootstrap.conf (gnulib_modules): Add modules to handle socket
	functions on mingw.

2011-06-29  Eric Blake  <eblake@redhat.com>

	sysinfo: fix parsing regression
	Detected by gcc -O2, introduced in commit 532ce9c2.  If dmidecode
	outputs a field unrecognized by the parsers, then the code would
	dereference an uninitialized eol variable.

	* src/util/sysinfo.c (virSysinfoParseBIOS)
	(virSysinfoParseSystem, virSysinfoParseProcessor)
	(virSysinfoParseMemory): Avoid uninitialized variable.

2011-06-29  Eric Blake  <eblake@redhat.com>

	build: update translated files
	The last patch was incomplete.  The translated strings merely
	moved between generated file names, rather than disappearing.

	* cfg.mk (generated_files): Update generated file names.
	* po/POTFILES.in: Add remote_dispatch.h

2011-06-29  Jiri Denemark  <jdenemar@redhat.com>

	build: Don't expect translatable strings in a dead file
	daemon/remote_dispatch_bodies.h is no longer with us and shouldn't be
	searched for translatable strings.

	daemon: Fix build without polkit

2011-06-29  Eric Blake  <eblake@redhat.com>

	remote: fix uninitialized variable
	Detected by gcc -O2:

	remote/remote_driver.c: In function 'doRemoteOpen':
	remote/remote_driver.c:2753:26: error: 'sasl' may be used uninitialized in this function [-Werror=uninitialized]

	* src/remote/remote_driver.c (remoteAuthSASL): Initialize sasl.

2011-06-29  Eric Blake  <eblake@redhat.com>

	build: fix 'make check' when pdwtags is available
	Problem introduced in commit 6818cf86.

	* src/remote_protocol-structs: Delete unused struct.

2011-06-29  Eric Blake  <eblake@redhat.com>

	build: sanlock-devel is not in F15 yet
	* libvirt.spec.in (with_sanlock): Only default on in rawhide.
	Reported by Gerhard Stenzel.

2011-06-29  Daniel P. Berrange  <berrange@redhat.com>

	Add documentation for configuration lock managers
	Add a page which documents how to configure lock managers,
	focusing on use of sanlock with the QEMU/KVM driver

	* docs/locking.html.in: Docs about lock managers
	* docs/sitemap.html.in: Add lock manager config to
	  the deployment section

2011-06-29  Daniel P. Berrange  <berrange@redhat.com>

	Support automatic creation of leases for disks in sanlock
	The current sanlock plugin requires a central management
	application to manually add <lease> elements to each guest,
	to protect resources that are assigned to it (eg writable
	disks). This makes the sanlock plugin useless for usage
	in more ad hoc deployment environments where there is no
	central authority to associate disks with leases.

	This patch adds a mode where the sanlock plugin will
	automatically create leases for each assigned read-write
	disk, using a md5 checksum of the fully qualified disk
	path. This can work pretty well if guests are using
	stable disk paths for block devices eg /dev/disk/by-path/XXXX
	symlinks, or if all hosts have NFS volumes mounted in
	a consistent pattern.

	The plugin will create one lockspace for managing disks
	with filename /var/lib/libvirt/sanlock/__LIBVIRT__DISKS__.
	For each VM disks, there will be another file to hold
	a lease /var/lib/libvirt/sanlock/5903e5d25e087e60a20fe4566fab41fd
	Each VM disk lease is usually 1 MB in size. The script
	virt-sanlock-cleanup should be run periodically to remove
	unused lease files from the lockspace directory.

	To make use of this capability the admin will need to do
	several tasks:

	 - Mount an NFS volume (or other shared filesystem)
	   on /var/lib/libvirt/sanlock
	 - Configure 'host_id' in /etc/libvirt/qemu-sanlock.conf
	   with a unique value for each host with the same NFS
	   mount
	 - Toggle the 'auto_disk_leases' parameter in qemu-sanlock.conf

	Technically the first step can be skipped, in which case
	sanlock will only protect against 2 vms on the same host
	using the same disk (or the same VM being started twice
	due to error by libvirt).

	* src/locking/libvirt_sanlock.aug,
	  src/locking/sanlock.conf,
	  src/locking/test_libvirt_sanlock.aug: Add config params
	  for configuring auto lease setup
	* libvirt.spec.in: Add virt-sanlock-cleanup program, man
	  page
	* tools/virt-sanlock-cleanup.in: Script to purge unused
	  disk resource lease files

2011-06-29  Daniel P. Berrange  <berrange@redhat.com>

	Support loading a configuration file for sanlock plugin
	Introduce a configuration file with a single parameter
	'require_lease_for_disks', which is used to decide whether
	it is allowed to start a guest which has read/write disks,
	but without any leases.

	* libvirt.spec.in: Add sanlock config file and augeas
	  lens
	* src/Makefile.am: Install sanlock config file and
	  augeas lens
	* src/locking/libvirt_sanlock.aug: Augeas master lens
	* src/locking/test_libvirt_sanlock.aug: Augeas test file
	* src/locking/sanlock.conf: Example sanlock config
	* src/locking/lock_driver_sanlock.c: Wire up loading
	  of configuration file

2011-06-29  Daniel P. Berrange  <berrange@redhat.com>

	Allow per-driver config file for lock manager plugins
	Allow a 'configFile' parameter to be passed into the lock
	drivers to provide configuration. Wire up the QEMU driver
	to pass in file names '/etc/libvirt/qemu-$NAME.conf
	eg qemu-sanlock.conf

	* src/locking/lock_driver.h, src/locking/lock_driver_nop.c,
	  src/locking/lock_driver_sanlock.c, src/locking/lock_manager.c,
	  src/locking/lock_manager.h: Add configFile parameter
	* src/qemu/qemu_conf.c: Pass in configuration file path to
	  lock driver plugins

2011-06-29  Laine Stump  <laine@laine.org>

	network: add domain to unqualified names defined with <host>
	If a domain name is defined for a network, add the --expand-hosts
	option to the dnsmasq commandline. This results in the domain being
	added to any hostname that is defined in a dns <host> element and
	contains no '.' characters (i.e. it is an "unqualified"
	hostname). Since PTR records are automatically created for any name
	defined in <host>, the result of a PTR request will change from the
	unqualified name to the qualified name.

	This also has the same effect on any hostnames that dnsmasq reads
	from the host's /etc/hosts file.

	(In the case of guest hostnames that were learned by dnsmasq via DHCP
	requests, they were already getting the domain name added on, even
	without --expand-hosts).

2011-06-29  Daniel P. Berrange  <berrange@redhat.com>

	Cleanup remote protocol definitions
	The standard remote protocol for libvirtd no longer needs to
	include definitions of the generic message header/error structs
	or status codes. This is all defined in the generic RPC protocol

	* src/remote/remote_protocol.x: Remove all RPC message definitions
	* src/remote/remote_protocol.h, src/remote/remote_protocol.c:
	  Re-generate
	* daemon/remote_generate_stubs.pl: Delete obsolete script

2011-06-29  Daniel P. Berrange  <berrange@redhat.com>

	Remove obsolete libvirtd mdns code
	libvirtd now uses the generic RPC code for MDNS, so its
	custom mdns APIs are no longer required

	* daemon/mdns.c, daemon/mdns.h: Removed obsolete files

2011-06-29  Daniel P. Berrange  <berrange@redhat.com>

	Convert libvirtd over to the new RPC handling APIs
	This guts the libvirtd daemon, removing all its networking and
	RPC handling code. Instead it calls out to the new virServerPtr
	APIs for all its RPC & networking work

	As a fallout all libvirtd daemon error reporting now takes place
	via the normal internal error reporting APIs. There is no need
	to call separate error reporting APIs in RPC code, nor should
	code use VIR_WARN/VIR_ERROR for reporting fatal problems anymore.

	* daemon/qemu_dispatch_*.h, daemon/remote_dispatch_*.h: Remove
	  old generated dispatcher code
	* daemon/qemu_dispatch.h, daemon/remote_dispatch.h: New dispatch
	  code
	* daemon/dispatch.c, daemon/dispatch.h: Remove obsoleted code
	* daemon/remote.c, daemon/remote.h: Rewrite for new dispatch
	  APIs
	* daemon/libvirtd.c, daemon/libvirtd.h: Remove all networking
	  code
	* daemon/stream.c, daemon/stream.h: Update for new APIs
	* daemon/Makefile.am: Link to libvirt-net-rpc-server.la

2011-06-29  Daniel P. Berrange  <berrange@redhat.com>

	Convert the remote driver to new RPC client APIs
	This guts the current remote driver, removing all its networking
	handling code. Instead it calls out to the new virClientPtr and
	virClientProgramPtr APIs for all RPC & networking work.

	* src/Makefile.am: Link remote driver with generic RPC code
	* src/remote/remote_driver.c: Gut code, replacing with RPC
	  API calls
	* src/rpc/gendispatch.pl: Update for changes in the way
	  streams are handled

2011-06-29  Daniel P. Berrange  <berrange@redhat.com>

	Add XDR_CFLAGS to libvirt-net-rpc.la library
	* src/Makefile.am: Add XDR_CFLAGS

2011-06-28  Daniel P. Berrange  <berrange@redhat.com>

	Ensure sanlock socket is labelled with the VM process label
	The libvirt sanlock plugin is intentionally leaking a file
	descriptor to QEMU. To enable QEMU to use this FD under
	SELinux, it must be labelled correctly. We dont want to use
	the svirt_image_t for this, since QEMU must not be allowed
	to actually use the FD. So instead we label it with svirt_t
	using virSecurityManagerSetProcessFDLabel

	* src/locking/domain_lock.c, src/locking/domain_lock.h,
	  src/locking/lock_driver.h, src/locking/lock_driver_nop.c,
	  src/locking/lock_driver_sanlock.c, src/locking/lock_manager.c,
	  src/locking/lock_manager.h: Optionally pass an FD back to
	  the hypervisor for security driver labelling
	* src/qemu/qemu_process.c: label the lock manager plugin
	  FD with the process label

2011-06-28  Daniel P. Berrange  <berrange@redhat.com>

	Add a virSecurityManagerSetProcessFDLabel
	Add a new security driver method for labelling an FD with
	the process label, rather than the image label

	* src/libvirt_private.syms, src/security/security_apparmor.c,
	  src/security/security_dac.c, src/security/security_driver.h,
	  src/security/security_manager.c, src/security/security_manager.h,
	  src/security/security_selinux.c, src/security/security_stack.c:
	  Add virSecurityManagerSetProcessFDLabel & impl

2011-06-28  Daniel P. Berrange  <berrange@redhat.com>

	Rename virSecurityManagerSetFDLabel method
	The virSecurityManagerSetFDLabel method is used to label
	file descriptors associated with disk images. There will
	shortly be a need to label other file descriptors in a
	different way. So the current name is ambiguous. Rename
	the method to virSecurityManagerSetImageFDLabel to clarify
	its purpose

	* src/libvirt_private.syms,
	  src/qemu/qemu_migration.c, src/qemu/qemu_process.c,
	  src/security/security_apparmor.c, src/security/security_dac.c,
	  src/security/security_driver.h, src/security/security_manager.c,
	  src/security/security_manager.h, src/security/security_selinux.c,
	  src/security/security_stack.c: s/FDLabel/ImageFDLabel/

2011-06-28  Matthias Bolte  <matthias.bolte@googlemail.com>

	Add node prefix to virNodeGet(CPU|Memory)Stats structs and defines

2011-06-28  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Fix update device for CURRENT + FORCE flags
	When CURRENT and FORCE flags were used together, UpdateDeviceFlags did
	nothing because it failed to transform CURRENT into either LIVE or
	CONFIG.

2011-06-28  Stefan Berger  <stefanb@us.ibm.com>

	nwfilter: Return error message about unresolvable variables
	This is in response to bugzilla 664629

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

	The patch below returns an appropriate error message if the chain of
	nwfilters is found to contain unresolvable variables and therefore
	cannot be instantiated.

	Example: The following XMl added to a domain:

	    <interface type='bridge'>
	      <mac address='52:54:00:9f:80:45'/>
	      <source bridge='virbr0'/>
	      <model type='virtio'/>
	      <filterref filter='test'/>
	    </interface>

	that references the following filter

	<filter name='test' chain='root'>
	  <filterref filter='clean-traffic'/>
	  <filterref filter='allow-dhcp-server'/>
	</filter>

	now displays upon 'virsh start mydomain'

	error: Failed to start domain mydomain
	error: internal error Cannot instantiate filter due to unresolvable variable: DHCPSERVER

	'DHPCSERVER' is contained in allow-dhcp-server.

2011-06-27  Eric Blake  <eblake@redhat.com>

	build: rename Vcpupin to VcpuPin
	We already have a public virDomainPinVcpu, which implies that
	Pin and Vcpu are treated as separate words.  Unreleased commit
	e261987c introduced virDomainGetVcpupinInfo as the first public
	API that used Vcpupin, although we had prior internal uses of
	that spelling.  For consistency, change the spelling to be two
	words everywhere, regardless of whether pin comes first or last.

	* daemon/remote.c: Treat vcpu and pin as separate words.
	* include/libvirt/libvirt.h.in: Likewise.
	* src/conf/domain_conf.c: Likewise.
	* src/conf/domain_conf.h: Likewise.
	* src/driver.h: Likewise.
	* src/libvirt.c: Likewise.
	* src/libvirt_private.syms: Likewise.
	* src/libvirt_public.syms: Likewise.
	* src/libxl/libxl_driver.c: Likewise.
	* src/qemu/qemu_driver.c: Likewise.
	* src/remote/remote_driver.c: Likewise.
	* src/xen/xend_internal.c: Likewise.
	* tools/virsh.c: Likewise.
	* src/remote/remote_protocol.x: Likewise.
	* src/remote_protocol-structs: Likewise.
	Suggested by Matthias Bolte.

2011-06-27  Minoru Usui  <usui@mxm.nes.nec.co.jp>

	sysinfo: cleanup function/struct names.
	Fix lack of 'virSysinfo' prefix of functions/structs in src/util/sysinfo.[ch]

	sysinfo: fix lack of error check in virSysinfoFormat().
	Fix lack of error check in virSysinfoFormat().

2011-06-27  Matthias Bolte  <matthias.bolte@googlemail.com>

	tests: Partly fix networkxml2argvtest being configure result dependent
	Convert networkDnsmasqLeaseFileName to a replaceable function pointer
	that allow the testsuite to use a version of that function that is not
	depending on configure --localstatedir.

	This fixes 5 of 6 test failures, when configure --localstatedir isn't
	set to /var.

2011-06-27  Osier Yang  <jyang@redhat.com>

	qemu: Remove bogus error codes for NUMA memory tuning
	This is no code between virSaveLastError and virGetLastError will
	set an error, remove the bogus codes.

2011-06-27  Laine Stump  <laine@laine.org>

	network: fix indentation in networkBuildDnsmasqArgv
	This block was inadvertently added with the wrong indentation.

2011-06-27  Ruben Kerkhof  <ruben@rubenkerkhof.com>

	Only include parthelper if built with storage_disk
	Parthelper is only compiled if both --with-libvirtd
	and --with-storage-disk are set.

2011-06-25  Eric Blake  <eblake@redhat.com>

	build: avoid uninitialized variable
	Caught by gcc -O2, during autobuild.sh.

	* src/qemu/qemu_driver.c (qemudDomainGetVcpupinInfo): Initialize vm.

2011-06-25  Eric Blake  <eblake@redhat.com>

	build: fix VPATH builds
	The build currently fails when trying to create virnetprotocol.c
	into $(builddir)/rpc, which doesn't exist.  But since the file
	is part of the tarball, it should be generated into $(srcdir).
	Caught by autobuild.sh.

	* src/Makefile.am (VIR_NET_RPC_GENERATED): Generate into srcdir.

2011-06-25  Taku Izumi  <izumi.taku@jp.fujitsu.com>

	vcpupin: add query option to virsh vcpupin command
	This patch teaches "virsh vcpupin" command to query if no list
	is given. Its feature is to show CPU affinity information in more
	reader-friendly way.

	 # virsh vcpupin VM --config
	 VCPU: CPU Affinity
	 ----------------------------------
	    0: 1-6,9-20
	    1: 10
	    2: 5,9-11,15-20
	    3: 1,3,5,7,9,11,13,15

	When cpulist is omitted, vcpu number is optional. When vcpu number is
	provided, information of only specified vcpu is displayed.

2011-06-25  Taku Izumi  <izumi.taku@jp.fujitsu.com>

	vcpuinfo: add the code to fallback to try new API
	The "virsh vcpuinfo" command results in failure when the target domain
	is inactive on KVM. This patch improves this behavior by adding the
	fallback to invoke virDomainGetVcpupinInfo API in case of
	virDomainGetVcpus API returns error and the target domain is inactive.

	vcpupin: implement the remote protocol to address the new API
	This patch implements the remote protocol to address the new API
	(virDomainGetVcpupinInfo).

	vcpupin: implement the code to support new API for the qemu driver
	This patch implements the code to address the new API (virDomainGetVcpupinInfo)
	in the qemu driver.

2011-06-25  Taku Izumi  <izumi.taku@jp.fujitsu.com>

	vcpupin: introduce the new libvirt API (virDomainGetVcpupinInfo)
	This patch introduces a new libvirt API (virDomainGetVcpupinInfo),
	as a counterpart to virDomainPinVcpuFlags.

	We can use virDomainGetVcpus API to retrieve CPU affinity information,
	but can't use this API against inactive domains (at least in case of KVM),
	as it lacks a flags parameter.
	The usual thing is to add a new virDomainGetVcpusFlags, but that API name
	is already occupied by the counterpart to virDomainGetMaxVcpus, which
	has a completely different signature.

	The virDomainGetVcpupinInfo is the new API to retrieve CPU affinity
	information of active and inactive domains.  While the usual convention
	is to list an array before its length, this API violates that rule
	in order to be more like virDomainGetVcpus (where maxinfo was doing
	double-duty as the length of two different arrays).

2011-06-25  Laine Stump  <laine@laine.org>

	docs: fix indentation of sub-elements of <ip> in network XML
	The sub-elements of <ip> had been placed at the same level of
	indentation as ip itself, implying that they were really elements of
	<network>. Within that, sub-elements of ip/dhcp were also at that same
	level. These have been double-indented.

	At the same time, I realized that the documentation for the new <dns>
	element had been placed right in the middle of the description of the
	sub-elements of <ip>. I moved it up out of the way.

2011-06-25  Eric Blake  <eblake@redhat.com>

	buf: protect against integer overflow
	It's unlikely that we'll ever want to escape a string as long as
	INT_MAX/6, but adding this check can't hurt.

	* src/util/buf.c (virBufferEscapeSexpr, virBufferEscapeString):
	Check for (unlikely) overflow.

2011-06-25  Eric Blake  <eblake@redhat.com>

	remote: protect against integer overflow
	Integer overflow and remote code are never a nice mix.

	This has existed since commit 56cd414.

	* src/libvirt.c (virDomainGetVcpus): Reject overflow up front.
	* src/remote/remote_driver.c (remoteDomainGetVcpus): Avoid overflow
	on sending rpc.
	* daemon/remote.c (remoteDispatchDomainGetVcpus): Avoid overflow on
	receiving rpc.

2011-06-25  Eric Blake  <eblake@redhat.com>

	build: update gnulib for intprops
	Done as a separate commit to make backporting the next patch easier.
	We are already using "intprops.h", but this makes it explicit.

	* .gnulib: Update, for syntax-check fix.
	* bootstrap.conf (gnulib_modules): Make intprops use explicit.
	* src/locking/domain_lock.c (includes): Drop unused header.
	* src/nwfilter/nwfilter_learnipaddr.c (includes): Use "", not <>,
	for gnulib.

2011-06-25  Eric Blake  <eblake@redhat.com>

	build: avoid long line tests
	'make syntax-check' regression introduced in commit 60b9c69.

	* tests/networkxml2argvdata/*.argv: Break long lines.

2011-06-25  Matthias Bolte  <matthias.bolte@googlemail.com>

	Rename iface(G|S)etMacaddr to iface(G|S)etMacAddress for consistency

	Fix typo in libvirt_private.syms
	Triggered a linker error on MinGW.

2011-06-25  Michal Novotny  <minovotn@redhat.com>

	Network: Add support for DNS hosts definition to the network XML
	This commit introduces names definition for the DNS hosts file using
	the following syntax:

	  <dns>
	    <host ip="192.168.1.1">
	      <name>alias1</name>
	      <name>alias2</name>
	    </host>
	  </dns>

	Some of the improvements and fixes were done by Laine Stump so
	I'm putting him into the SOB clause again ;-)

2011-06-25  Michal Novotny  <minovotn@redhat.com>

	Network: Add additional hosts internal infrastructure

	Network: Add regression tests for the command-line arguments
	The regression testing done by comparison of command-line
	generated from the network XML file and the expected
	command-line arguments (read from file).

	Network: modify dnsmasq commandline build function to allow testing
	The dnsmasq commandline was being built as a part of running
	dnsmasq. This patch puts the commandline build into a separate
	function (and exports it as a private API) making it possible to build
	a dnsmasq commandline without executing it, so that we can write a
	test program to verify that the proper commandlines are being created.

2011-06-25  Michal Novotny  <minovotn@redhat.com>

	Add TXT record support for virtual DNS service
	This commit introduces the <dns> element and <txt> record for the
	virtual DNS network. The DNS TXT record can be defined using following
	syntax in the network XML file:

	  <dns>
	    <txt name="example" value="example value" />
	  </dns>

	Also, the Relax-NG scheme has been altered to allow the texts without
	spaces only for the name element and some nitpicks about memory
	free'ing have been fixed by Laine so therefore I'm adding Laine to the
	SOB clause ;-)

2011-06-25  Matthias Bolte  <matthias.bolte@googlemail.com>

	python: Don't declare Py_ssize_t for Python 2.6
	Commit cd48c3f4e95597 added a Py_ssize_t typedef for Python < 2.7.
	But Py_ssize_t was added in Python 2.5. This makes the build fail
	for Python 2.6.

	Adjust the check to match Python < 2.5 to fix this.

2011-06-25  Matthias Bolte  <matthias.bolte@googlemail.com>

	tests: Improve IPv6 detection for virNetSocket tests
	getifaddrs can return an IPv6 address, but getaddrinfo can fail
	for an IPv6 address. Cover this combination.

2011-06-25  Jamie Strandboge  <jamie@canonical.com>

	Move load of AppArmor profile to GenLabel()
	Commit 12317957ecd6c37a2fb16275dcdeeacfe25c517 introduced an incompatible
	architectural change for the AppArmor security driver. Specifically,
	virSecurityManagerSetAllLabel() is now called much later in
	src/qemu/qemu_process.c:qemuProcessStart(). Previously, SetAllLabel() was
	called immediately after GenLabel() such that after the dynamic label (profile
	name) was generated, SetAllLabel() would be called to create and load the
	AppArmor profile into the kernel before qemuProcessHook() was executed. With
	12317957ecd6c37a2fb16275dcdeeacfe25c517, qemuProcessHook() is now called
	before SetAllLabel(), such that aa_change_profile() ends up being called
	before the AppArmor profile is loaded into the kernel (via ProcessLabel() in
	qemuProcessHook()).

	This patch addresses the change by making GenLabel() load the AppArmor
	profile into the kernel after the label (profile name) is generated.
	SetAllLabel() is then adjusted to only reload_profile() and append stdin_fn to
	the profile when it is specified. This also makes the AppArmor driver work
	like its SELinux counterpart with regard to SetAllLabel() and stdin_fn.
	Bug-Ubuntu: https://launchpad.net/bugs/801569

2011-06-24  Eric Blake  <eblake@redhat.com>

	docs: document correct flag name
	When adding virDomainGetVcpusFlags in commit ea3f5c6, I did
	enough rebasing that the doc comments in libvirt.c no longer
	matched the final chosen enum names in libvirt.h.

	And now we've gone ahead and deprecated the names
	VIR_DOMAIN_VCPU_{LIVE,CONFIG}.

	* src/libvirt.c (virDomainGetVcpusFlags): Fix comment.

2011-06-24  Eric Blake  <eblake@redhat.com>

	Revert "Add new API virDomainBlockPull* to headers"
	This reverts commit 7d56a16d036d9aa7292e10e884c129742036f8a7.

	Conflicts:

		python/generator.py
		src/libvirt_public.syms

2011-06-24  Eric Blake  <eblake@redhat.com>

	Revert "virDomainBlockPull: Implement the main entry points"
	This reverts commit 6419f596e114ee9f372136cc2b9eb19f1cbb7a77.

2011-06-24  Eric Blake  <eblake@redhat.com>

	Revert "Add virDomainBlockPull support to the remote driver"
	This reverts commit d1693bb160ea78954592c45a40eb856190c619c8.

	Conflicts:

		daemon/remote.c
		src/remote/remote_driver.c
		src/remote/remote_protocol.x

2011-06-24  Eric Blake  <eblake@redhat.com>

	Revert "Implement virDomainBlockPull for the qemu driver"
	This reverts commit 784ee08d2220d2a77424d5fc756b6eebe8efd5fa.

	Revert "Enable the virDomainBlockPull API in virsh"
	This reverts commit 3e2493ce28b7e20416e916fdf893a9569c267925.

2011-06-24  Eric Blake  <eblake@redhat.com>

	Revert "Enable virDomainBlockPull in the python API."
	This reverts commit d74b86f5d6ecae3d18a391f90a918fcac75914db.

	Conflicts:

		python/generator.py

2011-06-24  Eric Blake  <eblake@redhat.com>

	Revert "Asynchronous event for BlockPull completion"
	This reverts commit 12cd77a0c58a80179182f7d09e8e73f9f66b4677.

	Conflicts:

		python/libvirt-override-virConnect.py
		python/libvirt-override.c
		src/remote/remote_protocol.x

2011-06-24  Eric Blake  <eblake@redhat.com>

	build: avoid python 2.4 build failure
	I'm not sure when Py_ssize_t was introduced; but Fedora 14 Python 2.7
	has it, while RHEL 5 Python 2.4 lacks it.  It should be easy enough
	to adjust if someone runs into problems.

	* python/typewrappers.h (Py_ssize_t): Define for older python.

2011-06-24  Eric Blake  <eblake@redhat.com>

	build: fix NUMA build on RHEL 5
	Use NUMA's older nodemask_t (fixed-size map) rather than the newer
	'struct bitmask' (variable-size) in order to still compile on RHEL 5,
	with its numactl-devel-0.9.8.

	* src/qemu/qemu_process.c [HAVE_NUMA]: Prefer back-compat mode.
	(qemuProcessInitNumaMemoryPolicy): Use older nodemask_t.

2011-06-24  Minoru Usui  <usui@mxm.nes.nec.co.jp>

	Add Memory Device Information to virSysinfoRead() from dmidecode type 17
	* src/util/sysinfo.[ch]: also parse and save all the SMBIOS informations
	  about memory modules

	Add Processor Information to virSysinfoRead() from dmidecode type 4
	* src/util/sysinfo.c: add parsing and formatting of processor
	  information data

	Cleanup virSysinfoRead()
	* src/util/sysinfo.c: Separate BIOSInfo and SystemInfo part from
	                      virSysinfoRead()

2011-06-24  Daniel P. Berrange  <berrange@redhat.com>

	Make sure virnetprotocol.[ch] are in BUILT_SOURCES
	To ensure virnetprotocol.[ch] are generated before any other
	files, add them to BUILT_SOURCES and MAINTAINERCLEANFILES.
	At the same time, move ESX_DRIVER_GENERATED out of DISTCLEAN
	and into MAINTAINERCLEANFILES, since they are included in
	EXTRA_DIST

	* src/Makefile.am: Add virnetprotocol.[ch] to BUILT_SOURCES

2011-06-24  Eric Blake  <eblake@redhat.com>

	maint: typo fixes
	* src/xenxs/xen_sxpr.c (xenParseSxprPCI): Comment fix.
	* tests/object-locking.ml (driverTables): Likewise.
	* tests/testutils.c (virtTestDifferenceBin): Likewise.

2011-06-24  Daniel P. Berrange  <berrange@redhat.com>

	Fix some bugs in RPC protocol make rules
	The Makefile.am rules for generating RPC protocol had a couple
	of bugs

	 - A instance of remote/rpcgen_fix.pl  was not changed
	   to rpc/genprotocol.pl
	 - A dep from rpc/virnetmessage.h on the generated
	   rpc/virnetprotocol.h was missing
	 - The generated rpc/virnetprotocol.[ch] were not listed
	   in MAINTAINERCLEANFILES

	* Makefile.am: Fix RPC protocol generation

2011-06-24  Daniel P. Berrange  <berrange@redhat.com>

	Add missing translation of error message from QEMU reboot patch
	* src/qemu/qemu_process.c: Add missing _(...)

2011-06-24  Daniel P. Berrange  <berrange@redhat.com>

	Fix job type set in qemuMigrationPrepareDirect/PrepareTunnel
	The qemuMigrationPrepareDirect/PrepareTunnel methods accidentally
	set the domain job to  QEMU_JOB_MIGRATION_OUT when it should have
	been  QEMU_JOB_MIGRATION_IN. This didn't have any ill-effect, but
	it is none-the-less wrong.

	* src/qemu/qemu_migration.c: Fix job type

2011-06-24  Daniel P. Berrange  <berrange@redhat.com>

	Avoid high privileges taint warning for QEMU session driver
	The code emitting taint warnings was mistakenly thinking
	that guests run from the QEMU session driver were tainted
	for having high privileges. This is of course nonsense
	since the session driver is always unprivileged

	* src/qemu/qemu_domain.c: Don't warn for high privileges in
	  non-privileged QEMU

2011-06-24  Daniel P. Berrange  <berrange@redhat.com>

	Allow automatic kill of guests when a connection is closed
	If an application is using libvirt + KVM as a piece of its
	internal infrastructure to perform a specific task, it can
	be desirable to guarentee the VM dies when the virConnectPtr
	disconnects from libvirtd. This ensures the app can't leak
	any VMs it was using. Adding VIR_DOMAIN_START_AUTOKILL as
	a flag when starting guests enables this to be done.

	* include/libvirt/libvirt.h.in: All VIR_DOMAIN_START_AUTOKILL
	* src/qemu/qemu_driver.c: Support automatic killing of guests
	  upon connection close
	* tools/virsh.c: Add --autokill flag to 'start' and 'create'
	  commands

2011-06-24  Daniel P. Berrange  <berrange@redhat.com>

	Automatically kill target QEMU if migration aborts abnormally
	Migration is a multi-step process

	  1. Begin(src)
	  2. Prepare(dst)
	  3. Perform(src)
	  4. Finish(dst)
	  5. Confirm(src)

	At step 2, a QEMU process is lauched in the destination to
	accept the incoming migration. Occasionally the process
	that is controlling the migration workflow aborts, and fails
	to call step 4, Finish. This leaves a QEMU process running
	on the target (albeit with paused CPUs). Unfortunately because
	step 2 actives a job on the QEMU process, it is unkillable by
	normal means.

	By registering the VM for autokill against the src virConnectPtr
	in step 2, we can ensure that the guest is forcefully killed off
	if the connection is closed without step 4 being invoked

	* src/qemu/qemu_migration.c: Register autokill in PrepareDirect
	  and PrepareTunnel. Unregister autokill on successful run
	  of Finish
	* src/qemu/qemu_process.c: Unregister autokill when stopping a
	  process

2011-06-24  Daniel P. Berrange  <berrange@redhat.com>

	Add infrastructure to automatically destroy guests when a connection closes
	Sometimes it is useful to be able to automatically destroy a guest when
	a connection is closed. For example, kill an incoming migration if
	the client managing the migration dies. This introduces a map between
	guest 'uuid' strings and virConnectPtr objects. When a connection is
	closed, any associated guests are killed off.

	* src/qemu/qemu_conf.h: Add autokill hash table to qemu driver
	* src/qemu/qemu_process.c, src/qemu/qemu_process.h: Add APIs
	  for performing autokill of guests associated with a connection
	* src/qemu/qemu_driver.c: Initialize autodestroy map

2011-06-24  Daniel P. Berrange  <berrange@redhat.com>

	Support reboots with the QEMU driver
	For controlled shutdown we issue a 'system_powerdown' command
	to the QEMU monitor. This triggers an ACPI event which (most)
	guest OS wire up to a controlled shutdown. There is no equiv
	ACPI event to trigger a controlled reboot. This patch attempts
	to fake a reboot.

	 - In qemuDomainObjPrivatePtr we have a bool fakeReboot
	   flag.
	 - The virDomainReboot method sets this flag and then
	   triggers a normal 'system_powerdown'.
	 - The QEMU process is started with '-no-shutdown'
	   so that the guest CPUs pause when it powers off the
	   guest
	 - When we receive the 'POWEROFF' event from QEMU JSON
	   monitor if fakeReboot is not set we invoke the
	   qemuProcessKill command and shutdown continues
	   normally
	 - If fakeReboot was set, we spawn a background thread
	   which issues 'system_reset' to perform a warm reboot
	   of the guest hardware. Then it issues 'cont' to
	   start the CPUs again

	* src/qemu/qemu_command.c: Add -no-shutdown flag if
	  we have JSON support
	* src/qemu/qemu_domain.h: Add 'fakeReboot' flag to
	  qemuDomainObjPrivate struct
	* src/qemu/qemu_driver.c: Fake reboot using the
	  system_powerdown command if JSON support is available
	* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
	  src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h,
	  src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h: Add
	  binding for system_reset command
	* src/qemu/qemu_process.c: Reset the guest & start CPUs if
	  fakeReboot is set

2011-06-24  Daniel P. Berrange  <berrange@redhat.com>

	Move the RPC generator scripts into src/rpc
	Move the daemon/remote_generator.pl to src/rpc/gendispatch.pl
	and move the src/remote/rpcgen_fix.pl to src/rpc/genprotocol.pl

	* daemon/Makefile.am: Update for new name/location of generator
	* src/Makefile.am: Update for new name/location of generator

2011-06-24  Daniel P. Berrange  <berrange@redhat.com>

	Introduce generic RPC client objects
	To facilitate creation of new clients using XDR RPC services,
	pull alot of the remote driver code into a set of reusable
	objects.

	 - virNetClient: Encapsulates a socket connection to a
	   remote RPC server. Handles all the network I/O for
	   reading/writing RPC messages. Delegates RPC encoding
	   and decoding to the registered programs

	 - virNetClientProgram: Handles processing and dispatch
	   of RPC messages for a single RPC (program,version).
	   A program can register to receive async events
	   from a client

	 - virNetClientStream: Handles generic I/O stream
	   integration to RPC layer

	Each new client program now merely needs to define the list of
	RPC procedures & events it wants and their handlers. It does
	not need to deal with any of the network I/O functionality at
	all.

2011-06-24  Daniel P. Berrange  <berrange@redhat.com>

	Introduce generic RPC module for advertising via MDNS
	Allow RPC servers to advertise themselves using MDNS,
	via Avahi

	* src/rpc/virnetserver.c, src/rpc/virnetserver.h: Allow
	  registration of MDNS services via avahi
	* src/rpc/virnetserverservice.c, src/rpc/virnetserverservice.h: Add
	  API to fetch the listen port number
	* src/rpc/virnetsocket.c, src/rpc/virnetsocket.h: Add API to
	  fetch the local port number
	* src/rpc/virnetservermdns.c, src/rpc/virnetservermdns.h: Represent
	  an MDNS advertisement

2011-06-24  Daniel P. Berrange  <berrange@redhat.com>

	Introduce generic RPC server objects
	To facilitate creation of new daemons providing XDR RPC services,
	pull a lot of the libvirtd daemon code into a set of reusable
	objects.

	 * virNetServer: A server contains one or more services which
	   accept incoming clients. It maintains the list of active
	   clients. It has a list of RPC programs which can be used
	   by clients. When clients produce a complete RPC message,
	   the server passes this onto the corresponding program for
	   handling, and queues any response back with the client.

	 * virNetServerClient: Encapsulates a single client connection.
	   All I/O for the client is handled, reading & writing RPC
	   messages.

	 * virNetServerProgram: Handles processing and dispatch of
	   RPC method calls for a single RPC (program,version).
	   Multiple programs can be registered with the server.

	 * virNetServerService: Encapsulates socket(s) listening for
	   new connections. Each service listens on a single host/port,
	   but may have multiple sockets if on a dual IPv4/6 host.

	Each new daemon now merely has to define the list of RPC procedures
	& their handlers. It does not need to deal with any network related
	functionality at all.

2011-06-24  Daniel P. Berrange  <berrange@redhat.com>

	Integrate TLS/SASL directly into the socket APIs
	This extends the basic virNetSocket APIs to allow them to have
	a handle to the TLS/SASL session objects, once established.
	This ensures that any data reads/writes are automagically
	passed through the TLS/SASL encryption layers if required.

	* src/rpc/virnetsocket.c, src/rpc/virnetsocket.h: Wire up
	  SASL/TLS encryption

2011-06-24  Daniel P. Berrange  <berrange@redhat.com>

	Generic module for handling SASL authentication & encryption
	This provides two modules for handling SASL

	 * virNetSASLContext provides the process-wide state, currently
	   just a whitelist of usernames on the server and a one time
	   library init call

	 * virNetTLSSession provides the per-connection state, ie the
	   SASL session itself. This also include APIs for providing
	   data encryption/decryption once the session is established

	* src/Makefile.am: Add to libvirt-net-rpc.la
	* src/rpc/virnetsaslcontext.c, src/rpc/virnetsaslcontext.h: Generic
	  SASL handling code

2011-06-24  Daniel P. Berrange  <berrange@redhat.com>

	Generic module for handling TLS encryption and x509 certs
	This provides two modules for handling TLS

	 * virNetTLSContext provides the process-wide state, in particular
	   all the x509 credentials, DH params and x509 whitelists
	 * virNetTLSSession provides the per-connection state, ie the
	   TLS session itself.

	The virNetTLSContext provides APIs for validating a TLS session's
	x509 credentials. The virNetTLSSession includes APIs for performing
	the initial TLS handshake and sending/recving encrypted data

	* src/Makefile.am: Add to libvirt-net-rpc.la
	* src/rpc/virnettlscontext.c, src/rpc/virnettlscontext.h: Generic
	  TLS handling code

2011-06-24  Daniel P. Berrange  <berrange@redhat.com>

	Introduce a generic object for using network sockets
	Introduces a simple wrapper around the raw POSIX sockets APIs
	and name resolution APIs. Allows for easy creation of client
	and server sockets with correct usage of name resolution APIs
	for protocol agnostic socket setup.

	It can listen for UNIX and TCP stream sockets.

	It can connect to UNIX, TCP streams directly, or indirectly
	to UNIX sockets via an SSH tunnel or external command

	* src/Makefile.am: Add to libvirt-net-rpc.la
	* src/rpc/virnetsocket.c, src/rpc/virnetsocket.h: Generic
	  sockets APIs
	* tests/Makefile.am: Add socket test
	* tests/virnetsockettest.c: New test case
	* tests/testutils.c: Avoid overriding LIBVIRT_DEBUG settings
	* tests/ssh.c: Dumb helper program for SSH tunnelling tests

2011-06-24  Daniel P. Berrange  <berrange@redhat.com>

	Provide a simple object for encoding/decoding RPC messages
	This provides a new struct that contains a buffer for the RPC
	message header+payload, as well as a decoded copy of the message
	header. There is an API for applying a XDR encoding & decoding
	of the message headers and payloads. There are also APIs for
	maintaining a simple FIFO queue of message instances.

	Expected usage scenarios are:

	To send a message

	   msg = virNetMessageNew()

	   ...fill in msg->header fields..
	   virNetMessageEncodeHeader(msg)
	   ...loook at msg->header fields to determine payload filter
	   virNetMessageEncodePayload(msg, xdrfilter, data)
	   ...send msg->bufferLength worth of data from buffer

	To receive a message

	   msg = virNetMessageNew()
	   ...read VIR_NET_MESSAGE_LEN_MAX of data into buffer
	   virNetMessageDecodeLength(msg)
	   ...read msg->bufferLength-msg->bufferOffset of data into buffer
	   virNetMessageDecodeHeader(msg)
	   ...look at msg->header fields to determine payload filter
	   virNetMessageDecodePayload(msg, xdrfilter, data)
	   ...run payload processor

	* src/Makefile.am: Add to libvirt-net-rpc.la
	* src/rpc/virnetmessage.c, src/rpc/virnetmessage.h: Internal
	  message handling API.
	* testutils.c, testutils.h: Helper for printing binary differences
	* virnetmessagetest.c: Validate all XDR encoding/decoding

2011-06-24  Daniel P. Berrange  <berrange@redhat.com>

	Defines the basics of a generic RPC protocol in XDR
	This patch defines the basics of a generic RPC protocol in XDR.
	This is wire ABI compatible with the original remote_protocol.x.
	It takes everything except for the RPC calls / events from that
	protocol

	 - The basic header virNetMessageHeader (aka remote_message_header)
	 - The error object virNetMessageError  (aka remote_error)
	 - Two dummy objects virNetMessageDomain & virNetMessageNetwork
	   sadly needed to keep virNetMessageError ABI compatible with
	   the old remote_error

	The RPC protocol supports method calls, async events and
	bidirectional data streams as before

	* src/Makefile.am: Add rules for generating RPC code from
	  protocol & define a new libvirt-net-rpc.la helper library
	* src/rpc/virnetprotocol.x: New generic RPC protocol

2011-06-24  Eric Blake  <eblake@redhat.com>

	build: avoid python 2.4 build failure
	On RHEL 5, I got:

	/usr/bin/python ./generator.py /usr/bin/python
	  File "./generator.py", line 427
	    "virStreamFree", # Needed in custom virStream __del__, but free shouldn't
	                   ^
	SyntaxError: invalid syntax

	* python/generator.py (function_skip_python_impl): Use same syntax
	as other skip lists.

2011-06-24  Eric Blake  <eblake@redhat.com>

	build: avoid compiler failure
	GCC complained about a C99 for-loop declaration outside of C99 mode
	when compiling on RHEL 5.

	* src/qemu/qemu_driver.c (qemudDomainPinVcpuFlags): Avoid C99 for
	loop, since gcc 4.1.2 hates it.

2011-06-24  David S. Wang  <dwang2@cisco.com>

	documenting the 802.1Qbh parameters of a 'direct' interface
	This patch adds documentation about the 802.1Qbh related parameters
	of the virtualport element for 'direct' interfaces.

2011-06-24  Eric Blake  <eblake@redhat.com>

	build: update to latest gnulib
	Gnulib has been busy, with 397 commits; it's easier to update now
	even without any known libvirt issue to be fixed, rather than
	having to analyze an even larger changeset later on.

	* .gnulib: Update to latest, for lots of changes.
	* bootstrap: Synchronize to upstream.

2011-06-23  Stefan Berger  <stefanb@us.ibm.com>

	build: fix compilation on systems missing libnl and new includes
	This patch fixes the compilation of netlink.c and interface.c on those
	systems missing either libnl or that have an older linux/if_link.h
	include file not supporting macvtap or VF_PORTS.

	WITH_MACVTAP is '1' if newer include files were detected, '0' otherwise.

	IFLA_PORT_MAX is defined in linux/if_link.h if yet more functionality is
	supported.

2011-06-23  Matthias Bolte  <matthias.bolte@googlemail.com>

	configure: Make libnl optional unless macvtap is required
	If macvtap is required then libnl has to be available, otherwise
	libnl is optional.

2011-06-23  Cole Robinson  <crobinso@redhat.com>

	python: Generate virStreamFree but don't expose in bindings
	Turns out I was right in removing this the first time :) This is
	needed in our custom __del__ function, but the C code wasn't
	being generated. Add new infrastructure to do what we want

2011-06-23  Eric Blake  <eblake@redhat.com>

	maint: avoid future setgid problems
	* cfg.mk (sc_prohibit_setuid)
	(exclude_file_name_regexp--sc_prohibit_setuid): New rule.
	(VC_LIST_ALWAYS_EXCLUDE_REGEX): Always exempt po files.
	(exclude_file_name_regexp--sc_prohibit_asprintf): Simplify.
	(exclude_file_name_regexp--sc_prohibit_can_not): Drop.
	(exclude_file_name_regexp--sc_prohibit_doubled_word): Likewise.

2011-06-23  Matthias Bolte  <matthias.bolte@googlemail.com>

	docs: Make virConnectClose comply to apibuild.py expectations
	apibuild.py expects a sentence that starts with "Returns"
	describing the return value of a function.

2011-06-23  Osier Yang  <jyang@redhat.com>

	util: Fix memory leak in virJSONParserHandleStartMap

	qemu: Fix memory leak in qemuProcessWaitForMonitor
	Move "VIR_FREE(buf) into label "closelog", so that "buf" could be
	freed before returning.

2011-06-23  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Only check for NUMA availability if required
	We only care about NUMA availability if NUMA configuration is requested
	in domain XML.

2011-06-23  Matthew Booth  <mbooth@redhat.com>

	storage: fix volDelete return when volume still being allocated
	volDelete used to return VIR_ERR_INTERNAL_ERROR when attempting to
	delete a volume which was still being allocated. It should return
	VIR_ERR_OPERATION_INVALID.

	* src/storage/storage_driver.c: Fix return of volDelete.

2011-06-23  Eric Blake  <eblake@redhat.com>

	util: avoid PATH_MAX-sized array
	See previous patch for why this is good...

	* src/util/pci.c (struct _pciDevice, pciGetDevice, pciFreeDevice):
	Manage path dynamically.  Report snprintf overflow.
	* src/util/hostusb.c (struct _usbDevice, usbGetDevice)
	(usbFreeDevice): Likewise.

2011-06-23  Eric Blake  <eblake@redhat.com>

	xen: avoid PATH_MAX-sized array
	See previous patch for why this is good...

	* src/xen/xen_driver.h (xenXMConfCache): Manage filename
	dynamically.
	* src/xen/xm_internal.c (xenXMConfigCacheAddFile)
	(xenXMConfigFree, xenXMDomainDefineXML): Likewise.

2011-06-23  Eric Blake  <eblake@redhat.com>

	tests: avoid PATH_MAX-sized array
	See previous patch for why this is good...

	* src/test/test_driver.c (struct _testConn, testOpenFromFile)
	(testClose): Manage path dynamically.

2011-06-23  Eric Blake  <eblake@redhat.com>

	virStorageVol: avoid PATH_MAX-sized array
	POSIX allows implementations where PATH_MAX is undefined, leading
	to compilation error.  Not to mention that even if it is defined,
	it is often wasteful in relation to the amount of data being stored.

	All clients of vol->key were audited, and found not to care about
	whether key is static or dynamic, except for these offenders:

	* src/datatypes.h (struct _virStorageVol): Manage key dynamically.
	* src/datatypes.c (virReleaseStorageVol): Free key.
	(virGetStorageVol): Copy key.

2011-06-23  Eric Blake  <eblake@redhat.com>

	maint: add omitted copyright header
	Bug introduced in commit 6a597883.

	* src/util/netlink.h: Add boilerplate.

2011-06-23  Eric Blake  <eblake@redhat.com>

	docs: fix docs to match behavior of virConnectClose
	* src/libvirt.c (virConnectClose): Mention reference count return.
	Reported by Michal Novotny, analyzed by Matthias Bolte.

2011-06-23  Stefan Berger  <stefanb@us.ibm.com>

	cleanup: make several interface functions commonly available
	In a second cleanup step this patch makes several interface functions from macvtap.c commonly available by moving them into interface.c and prefixing their names with 'iface'. Those functions taking Linux-specific structures as parameters are only visible on Linux.

	ifaceRestoreMacAddress returns the return code from the ifaceSetMacAddr call and display an error message if setting the MAC address did not work. The caller is unchanged and still ignores the return code (which is ok).

2011-06-23  Stefan Berger  <stefanb@us.ibm.com>

	cleanup: make nlComm commonly available
	In a first cleanup step, make nlComm from macvtap.c commonly available
	for other code to use. Since nlComm uses Linux-specific structures as
	parameters it's prototype is only visible on Linux.

2011-06-23  Eric Blake  <eblake@redhat.com>

	maint: remove syntax-check exception
	We weren't using the @FOO@ notation for a Makefile substitution,
	but instead for a sed rule, so using [@]FOO@ instead avoids the
	need to exempt this syntax check.

	* cfg.mk (_makefile_at_at_check_exceptions): Delete.
	* tools/Makefile.am (virt-xml-validate, virt-pki-validate): Avoid
	tripping syntax-check.
	Reported by Daniel P. Berrange.

2011-06-23  Daniel P. Berrange  <berrange@redhat.com>

	Fix use-after-free in handling domain taint flags
	* src/conf/domain_conf.c: Fix use after free

2011-06-23  Daniel P. Berrange  <berrange@redhat.com>

	Remove macvtap dependency on domain configuration
	Files under src/util must not depend on src/conf
	Solve the macvtap problem by moving the definition
	of macvtap modes from domain_conf.h into macvtap.h

	* src/util/macvtap.c, src/util/macvtap.h: Add enum
	  for macvtap modes
	* src/conf/domain_conf.c, src/conf/domain_conf.h: Remove
	  enum for macvtap modes

2011-06-22  Osier Yang  <jyang@redhat.com>

	util: Correct the error prompt string
	virCommandProcessIO: It's reading from stdout or stderr of child,
	but not writing.

2011-06-22  Osier Yang  <jyang@redhat.com>

	qemu: Fix one memory leak
	* src/qemu/qemu_domain.c: (qemuDomainAppendLog)

	  Free "message" in "cleanup".

2011-06-22  Daniel Veillard  <veillard@redhat.com>

	Fix to python API extractor and API doc generation
	This fixes a number of issues most of them raised by Eric Blake on the
	generated documentation output:
	   - parsing of "long long int" and similar
	   - add parsing of unions within a struct
	   - remove spurious " * " fron comments on structure fields and enums
	   - fix concatenation of base type and name in arrays
	   - extend XSLT to cope with union in structs

	* docs/apibuild.py: fix and extend API extraction tool
	* docs/newapi.xsl: extend the stylesheets to cope with union in
	  public structures

2011-06-22  Michal Privoznik  <mprivozn@redhat.com>

	qemu: domain I/O asynchronous handling
	For virtio disks and interfaces, qemu allows users to enable or disable
	ioeventfd feature. This means, qemu can execute domain code, while
	another thread waits for I/O event. Basically, in some cases it is win,
	in some loss. This feature is available via 'ioeventfd' attribute in disk
	and interface <driver> element. It accepts 'on' and 'off'. Leaving this
	attribute out defaults to hypervisor decision.

2011-06-22  Eric Blake  <eblake@redhat.com>

	build: require newer netcf when it is available
	When building rpms for newer Fedora or RHEL, take advantage of the
	newer netcf packaging to guarantee interface snapshot support.

	* libvirt.spec.in (BuildRequires): Bump minimum version on
	platforms that support netcf 0.1.8.

2011-06-22  Eric Blake  <eblake@redhat.com>

	virsh: avoid bogus description
	https://bugzilla.redhat.com/show_bug.cgi?id=682121

	Gettext reserves the empty string for internal use, and it must
	not be passed through _().  We were violating this for commands
	that (for whatever reason) used "" for their description.

	* tools/virsh.c (vshCmddefHelp): Don't translate empty string.
	Reported by Tatsuo Kawasaki.

2011-06-21  Dirk Herrendoerfer  <d.herrendoerfer@herrendoerfer.name>

	set and restore MAC address of a NIC when using PASSTHROUGH mode
	The following patch addresses the problem that when a PASSTHROUGH
	mode DIRECT NIC connection is made the MAC address of the NIC is
	not automatically set and reset to the configured VM MAC and
	back again.

	The attached patch fixes this problem by setting and resetting the MAC
	while remembering the previous setting while the VM is running.
	This also works if libvirtd is restarted while the VM is running.

	the patch passes make syntax-check

2011-06-21  Cole Robinson  <crobinso@redhat.com>

	python: Mark event callback wrappers as private
	These functions aren't intended to be called directly by users, so mark
	them as private.

	While we're at it, remove unneeded exception handling, and break some
	long lines.

2011-06-21  Cole Robinson  <crobinso@redhat.com>

	python: events: Fix C->Python handle callback prototype
	If registering our own event loop implementation written in python,
	any handles or timeouts callbacks registered by libvirt C code must
	be wrapped in a python function. There is some argument trickery that
	makes this all work, by wrapping the user passed opaque value in
	a tuple, along with the callback function.

	Problem is, the current setup requires the user's event loop to know
	about this trickery, rather than just treating the opaque value
	as truly opaque.

	Fix this in a backwards compatible manner, and adjust the example
	python event loop to do things the proper way.

2011-06-21  Cole Robinson  <crobinso@redhat.com>

	python: Add bindings for virEvent*Handle/Timeout

	events: Correct virEventAddTimeout docs

2011-06-21  Cole Robinson  <crobinso@redhat.com>

	Promote virEvent*Handle/Timeout to public API
	Since we virEventRegisterDefaultImpl is now a public API, callers need
	a way to invoke the default registered Handle and Timeout functions. We
	already have general functions for these internally, so promote
	them to the public API.

	v2:
	    Actually add APIs to libvirt.h

2011-06-21  Cole Robinson  <crobinso@redhat.com>

	python: Implement virStreamSend/RecvAll helpers
	Pure python implementation. The handler callbacks have been altered
	a bit compared to the C API: RecvAll doesn't pass length of the data read
	since that can be trivially obtained from python string objects, and SendAll
	requires the handler to return the string data to send rather than
	store the data in a string pointer.

	python: Implement virStreamSend/Recv
	The return values for the python version are different that the C version
	of virStreamSend: on success we return a string, an error raises an exception,
	and if the stream would block we return int(-2). We need to do this
	since strings aren't passed by reference in python.

2011-06-21  Osier Yang  <jyang@redhat.com>

	conf: Make full use of goto label
	* virDomainDefParse: There is a goto label "no_memory", which
	reports OOM error, and then fallthrough label "error". This
	patch changes things like following:

	    virReportOOMError();
	    goto error;

	into:

	    goto no_memory;

2011-06-21  Osier Yang  <jyang@redhat.com>

	conf: Fix one memory leak
	Free def->numatune.memory.nodemask in virDomainDefFree.

2011-06-21  Cole Robinson  <crobinso@redhat.com>

	python: Implement bindings for virStreamEventAddCallback
	v2:
	    Don't generate virStreamFree

	python: generator: Don't print warning if nothing to warn about

2011-06-21  Cole Robinson  <crobinso@redhat.com>

	python: libvirt-override: use simpler debug
	In a couple instances we have to mark a debug variable as ATTRIBUTE_UNUSED
	to avoid warnings.

	v2:
	    Use #if 0 to comment out debug define

2011-06-21  Eric Blake  <eblake@redhat.com>

	virsh: enhance snapshot-create-as
	Similar to pool-create-as.

	* tools/virsh.c (cmdSnapshotCreateAs): Add --print-xml.
	* tools/virsh.pod: Document it.

2011-06-21  Eric Blake  <eblake@redhat.com>

	virsh: add snapshot-create-as command
	Producing an xml file just for name and description fields is
	overkill; this makes life easier from virsh.

	* tools/virsh.c (cmdSnapshotCreateAs): New command.
	(snapshotCmds): Install it.
	* tools/virsh.pod: Document it.

2011-06-21  Eric Blake  <eblake@redhat.com>

	virsh: clarify snapshot vs. save
	* tools/virsh.c (info_snapshot_create, info_save): Clarify
	description.
	* tools/virsh.pod (save): Likewise.

2011-06-20  Daniel P. Berrange  <berrange@redhat.com>

	Fix compile warnings in virsh vcpupin
	The 'char *cur' variable was being assigned from a
	'const char *' string, thus discarding constness.
	As well as causing a compile warning, it masked a
	piece of code which attempts to assign to the
	previously const string.

	* tools/virsh.c: Fix const-ness of 'cur' variable in vcpupin

2011-06-20  Matthias Bolte  <matthias.bolte@googlemail.com>

	remote generator: Allow to annotate arrays with typecasts
	Removes special case code from the generator and handle additional
	methods.

	The generated version of remoteDispatchDomainPinVcpu(Flags) has no
	length check, but this check was useless anyway as it was applied to
	data that was already deserialized from its XDR form.

2011-06-20  Matthias Bolte  <matthias.bolte@googlemail.com>

	remote: Handle functions that return optional strings

	remote: Generate virDomainGetBlockPullInfo
	It was already generatable but skipped.

2011-06-20  Taku Izumi  <izumi.taku@jp.fujitsu.com>

	vcpupin: add vcpupin resetting feature to qemu driver
	Pinning to all physical cpus means resetting, hence it is preferable to
	delete vcpupin setting of XML.

	This patch changes qemu driver to delete vcpupin setting by invoking
	virDomainVcpupinDel API when pinning the specified virtual cpu to
	all host physical cpus.

2011-06-20  Taku Izumi  <izumi.taku@jp.fujitsu.com>

	vcpupin: add virDomainVcpupinDel function
	This patch add the private API (virDomainVcpupinDel).
	This API can delete the vcpupin setting of a specified virtual cpu.

2011-06-20  Taku Izumi  <izumi.taku@jp.fujitsu.com>

	vcpupin: add reset option to virsh vcpupin command
	When resetting vcpupin setting, we have to specify all host physical
	cpus as a cpulist parameter of virsh vcpupin command. It's a little
	tedious.

	This patch changes to allow to receive the special keyword 'r' as a cpulist
	parameter of virsh vcpupin command when resetting vcpupin setting.

	If you set the following:

	 # virsh vcpupin VM 0 r

	the vcpu0 will be pinned to all physical cpus.

2011-06-20  Taku Izumi  <izumi.taku@jp.fujitsu.com>

	vcpupin: improve vcpupin definition of virsh vcpupin
	When using vcpupin command, we have to speficy comma-separated list as cpulist,
	but this is tedious in case the number of phsycal cpus is large.
	This patch improves this by introducing special markup "-" and "^" which are
	similar to XML schema of "cpuset" attribute.

	The example:

	 # virsh vcpupin Guest 0 0-15,^8

	 is identical to

	 # virsh vcpupin Guest 0 0,1,2,3,4,5,6,7,9,10,11,12,13,14,15

	NOTE: The expression is sequentially evaluated, so "0-15,^8" is not identical
	to "^8,0-15".

2011-06-20  Matthias Bolte  <matthias.bolte@googlemail.com>

	Fix preprocessor indentation in nodeinfo.c

	Move XenAPI driver to correct spec file section
	The XenAPI driver works like the ESX and PHyp driver by using its
	own HTTPS based remote protocol.

2011-06-20  Osier Yang  <jyang@redhat.com>

	numatune: Add tests for numatune XML
	Only add tests for qemuxmlargvtest.c, as there is no qemu command line
	for numatune XML, just want to make sure the XML could be validated
	well.

2011-06-20  Osier Yang  <jyang@redhat.com>

	numatune: Support NUMA memory tuning in qemu driver
	Implemented as setting NUMA policy between fork and exec as a hook,
	using libnuma. Only support memory tuning on domain process currently.

	For the nodemask out of range, will report soft warning instead of
	hard error in libvirt layer. (Kernel will be silent as long as one
	of set bit in the nodemask is valid on the host. E.g. For a host
	has two NUMA nodes, kernel will be silent for nodemask "01010101").
	So, soft warning is the only thing libvirt can do, as one might want
	to specify the numa policy prior to a node that doesn't exist yet,
	however, it may come as hotplug soon.

2011-06-20  Osier Yang  <jyang@redhat.com>

	numatune: Support persistent XML for numatune
	* src/conf/domain_conf.h: Introduce one new struct for representing
	NUMA tuning related stuffs.

	* src/conf/domain_conf.c: Parse and format numatune XML.

2011-06-20  Osier Yang  <jyang@redhat.com>

	numatune: Add doc for new numatune XML

2011-06-20  Osier Yang  <jyang@redhat.com>

	numatune: Define XML schema
	Example XML:

	<numatune>
	  <memory mode="strict" nodeset="0-10,^4"/>
	</numatune>

	Please enter the commit message for your changes. Lines starting

2011-06-20  Hu Tao  <hutao@cn.fujitsu.com>

	Update qemuDomainSetBlkioParameters to use flags

	update qemuDomainGetBlkioParameters to use flags

	Add new parameters for blkiotune
	Add --config, --live and --current for command blkiotune

2011-06-20  Wen Congyang  <wency@cn.fujitsu.com>

	build: fix building error when building without libvirtd
	When building libvirt without libvirtd, we will receive the following error
	message:

	make[3]: Entering directory `/home/wency/rpmbuild/BUILD/libvirt-0.9.2/tools'
	  CC     virsh-virsh.o
	  CC     virsh-console.o
	  GEN    virt-xml-validate
	  GEN    virt-pki-validate
	  CCLD   virsh
	./src/.libs/libvirt.so: undefined reference to `numa_available'
	./src/.libs/libvirt.so: undefined reference to `numa_max_node'
	collect2: ld returned 1 exit status

	The reason is that: we check numactl only when building qemu driver, and qemu
	driver will not be built when bulding without libvirtd. So with_numactl's
	value is check and we will not link libnuma.so.

	In the other function, we call numa_available() and numa_max_node() only
	when HAVE_NUMACTL is 1. We should do the same check in the function nodeGetMemoryStats().

2011-06-20  Jamie Strandboge  <jamie@canonical.com>

	apparmor: implement AppArmorSetFDLabel()
	During a savevm operation, libvirt will now use fd migration if qemu
	supports it. When the AppArmor driver is enabled, AppArmorSetFDLabel()
	is used but since this function simply returns '0', the dynamic AppArmor
	profile is not updated and AppArmor blocks access to the save file. This
	patch implements AppArmorSetFDLabel() to get the pathname of the file by
	resolving the fd symlink in /proc, and then gives that pathname to
	reload_profile(), which fixes 'virsh save' when AppArmor is enabled.

	Reference: https://launchpad.net/bugs/795800

2011-06-17  Daniel P. Berrange  <berrange@redhat.com>

	Add missing checks for NULL in domain lock manager
	The domain lock manager forgot to include a bunch of checks
	for NULL which could occur on OOM

	* src/locking/domain_lock.c: Add checks for NULL

2011-06-17  Daniel P. Berrange  <berrange@redhat.com>

	Fix errno return in safezero()
	Most of the safezero() implementations return -1 on error,
	setting errno. The safezero() impl using posix_fallocate()
	though returned a positive errno value on error (due to
	the unusual API contract of posix_fallocate() compared to
	most syscall APIs).

	* src/util/util.c: Ensure safezero() returns -1 and sets
	  errno on error.
	* src/storage/storage_backend.c: Change safezero != 0 to
	  < 0 for detecting errors

2011-06-17  Daniel P. Berrange  <berrange@redhat.com>

	Add missing error reporting when loading mac filter config for QEMU
	If the 'mac_filter' configuration parameter is enabled, and there
	is a failure to enable filtering, no error is reported back to
	the caller. Also fix some bogus whitespace indentation for
	hugetlbfs_mount

	* src/qemu/qemu_conf.c: Add missing error reporting

2011-06-17  Jiri Denemark  <jdenemar@redhat.com>

	virsh: Add support for virDomainGetControlInfo

	qemu: Implement virDomainGetControlInfo

	Wire protocol and remote driver for virDomainGetControlInfo

	Introduce virDomainGetControlInfo API
	The API can be used to query current state of an interface to VMM used
	to control a domain. In QEMU world this translates into monitor
	connection.

2011-06-16  Matthias Bolte  <matthias.bolte@googlemail.com>

	Fix documentation of virStreamRecv
	virStreamRecv is for reading.

	Also add some missing punctuation to virStreamSend's documentation.

2011-06-16  Eric Blake  <eblake@redhat.com>

	sendkey: use consistent API convention
	Even though rpc uses 'unsigned int' for the _len parameter that
	passes the length of item<length>, the public libvirt APIs all
	use 'int' and filter out lengths < 0, except for virDomainSendKey.

	* include/libvirt/libvirt.h.in (virDomainSendKey): All other APIs
	use int for array length.
	* src/libvirt.c (virDomainSendKey): Adjust.
	* src/driver.h (virDrvDomainSendKey): Likewise.
	* daemon/remote_generator.pl: Likewise.

2011-06-16  Eric Blake  <eblake@redhat.com>

	build: export correct function names
	Detected by autobuild.sh, when targetting mingw.
	Introduced in commit 98bfdff.

	* src/libvirt_private.syms: Fix typos.

2011-06-16  Eric Blake  <eblake@redhat.com>

	build: avoid compiler warning on non-Linux
	Detected by autobuild.sh when cross-building for mingw.
	Introduced in commits ce76e85 and af35cec.

	* src/nodeinfo.c (nodeGetCPUStats, nodeGetMemoryStats): Mark
	parameters as potentially unused.

2011-06-15  Matthias Bolte  <matthias.bolte@googlemail.com>

	remote generator: Handle struct returning functions better (part 2)
	Commit 64000eabedf2 is part 1, that only covered the daemon side by
	accident. Part 2 covers the client side too.

	Fix apibuild.py warnings about missing comment headers
	Also improve wording of some comments.

	remote generator: Handle struct returning functions better
	The position of the struct parameter in the function signature
	differs. Instead of hardcoding the handling for this add an annotation
	to the .x file to define the position.

2011-06-15  Daniel Gollub  <gollub@b1-systems.de>

	support for Xen HVM Viridian (Hyper-V) enlightenment interface
	Introduce libvirt support for Xen HVM Viridian (Hyper-V) enlightenment
	interface guest feature.

	 src/conf/domain_conf.c     |    3 ++-
	 src/conf/domain_conf.h     |    1 +
	 src/xen/xen_hypervisor.c   |   11 +++++++++++
	 src/xenapi/xenapi_driver.c |    2 ++
	 src/xenapi/xenapi_utils.c  |    2 ++
	 src/xenxs/xen_sxpr.c       |    4 ++++
	 src/xenxs/xen_xm.c         |   12 +++++++++++-
	 7 files changed, 33 insertions(+), 2 deletions(-)

2011-06-15  Eric Blake  <eblake@redhat.com>

	virsh: reduce complexity in argv iteration
	This reduces things from O(n^2) to O(n).

	* tools/virsh.c (vshCommandOptArgv): Change signature.
	(cmdEcho): Update caller.
	Based on a patch by Lai Jiangshan.

2011-06-15  Daniel P. Berrange  <berrange@redhat.com>

	Add support for network filter code in LXC driver
	The LXC driver networking uses veth device pairs. These can
	be easily hooked into the network filtering code.

	* src/lxc/lxc_driver.c: Add calls to setup/teardown nwfilter

2011-06-15  Daniel P. Berrange  <berrange@redhat.com>

	Fix allocation of veth's to not skip an index
	The algorithm for autoassigning vethXXX devices, was always
	skipping over the starting dev index when finding a free
	name for the guest device. This should only be done if the host
	device was autoallocated.

	* src/lxc/veth.c: Don't skip over veth indexes

2011-06-15  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Translate boot config into bootindex if possible
	Prefer bootindex=N option for -device over the old way -boot ORDER
	possibly accompanied with boot=on option for -drive. This gives us full
	control over which device will actually be used for booting guest OS.
	Moreover, if qemu doesn't support boot=on, this is the only way to boot
	of certain disks in some configurations (such as virtio disks when used
	together IDE disks) without transforming domain XML to use per device
	boot elements.

2011-06-15  Adam Litke  <agl@us.ibm.com>

	Asynchronous event for BlockPull completion
	When an operation started by virDomainBlockPullAll completes (either with
	success or with failure), raise an event to indicate the final status.  This
	allows an API user to avoid polling on virDomainBlockPullInfo if they would
	prefer to use the event mechanism.

	* daemon/remote.c: Dispatch events to client
	* include/libvirt/libvirt.h.in: Define event ID and callback signature
	* src/conf/domain_event.c, src/conf/domain_event.h,
	  src/libvirt_private.syms: Extend API to handle the new event
	* src/qemu/qemu_driver.c: Connect to the QEMU monitor event
	  for block_stream completion and emit a libvirt block pull event
	* src/remote/remote_driver.c: Receive and dispatch events to application
	* src/remote/remote_protocol.x: Wire protocol definition for the event
	* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
	  src/qemu/qemu_monitor_json.c: Watch for BLOCK_STREAM_COMPLETED event
	  from QEMU monitor

2011-06-15  Adam Litke  <agl@us.ibm.com>

	Enable virDomainBlockPull in the python API.
	virDomainBlockPullAll and virDomainBlockPullAbort are handled automatically.
	virDomainBlockPull and virDomainBlockPullInfo require manual overrides since
	they return a custom type.

	* python/generator.py: reenable bindings for this entry point
	* python/libvirt-override-api.xml python/libvirt-override.c:
	  manual overrides

	Acked-by: Daniel P. Berrange <berrange@redhat.com>

2011-06-15  Adam Litke  <agl@us.ibm.com>

	Enable the virDomainBlockPull API in virsh
	Define two new virsh commands:
	 * blockpull: Perform block pull operations (incremental plus start
	              and stop continuous streams)
	 * blockpullinfo: Retrieve progress info for continuous block pull

	Share print_job_progress() with the migration code.

	* tools/virsh.c: implement the new commands

2011-06-15  Adam Litke  <agl@us.ibm.com>

	Implement virDomainBlockPull for the qemu driver
	The virDomainBlockPull* family of commands are enabled by the
	'block_stream' and 'info block_stream' qemu monitor commands.

	* src/qemu/qemu_driver.c src/qemu/qemu_monitor_text.[ch]: implement disk
	  streaming by using the stream and info stream text monitor commands
	* src/qemu/qemu_monitor_json.[ch]: implement commands using the qmp monitor

	Acked-by: Daniel P. Berrange <berrange@redhat.com>

2011-06-15  Adam Litke  <agl@us.ibm.com>

	Add virDomainBlockPull support to the remote driver
	The generator can handle DomainBlockPullAll and DomainBlockPullAbort.
	DomainBlockPull and DomainBlockPullInfo must be written by hand.

	* src/remote/remote_protocol.x: provide defines for the new entry points
	* src/remote/remote_driver.c daemon/remote.c: implement the client and
	  server side
	* src/remote_protocol-structs: structure definitions for protocol verification

2011-06-15  Adam Litke  <agl@us.ibm.com>

	virDomainBlockPull: Implement the main entry points
	* src/libvirt.c: implement the main entry points

	Acked-by: Daniel P. Berrange <berrange@redhat.com>

2011-06-15  Adam Litke  <agl@us.ibm.com>

	Add new API virDomainBlockPull* to headers
	Set up the types for the block pull functions and insert them into the
	virDriver structure definition.  Symbols are exported in this patch to prevent
	documentation compile failures.

	* include/libvirt/libvirt.h.in: new API
	* src/driver.h: add the new entry to the driver structure
	* python/generator.py: fix compiler errors, the actual python bindings are
	  implemented later
	* src/libvirt_public.syms: export symbols

2011-06-15  Marc-André Lureau  <marcandre.lureau@gmail.com>

	spice: add <clipboard copypaste='yes|no'> option
	From a security pov copy and paste between the guest and the client is not
	always desirable. So we need to be able to enable/disable this. The best place
	to do this from an administration pov is on the hypervisor, so the qemu cmdline
	is getting a spice disable-copy-paste option, see bug 693645. Example qemu
	invocation:
	qemu -spice port=5932,disable-ticketing,disable-copy-paste

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

2011-06-15  Minoru Usui  <usui@mxm.nes.nec.co.jp>

	virNodeGetMemoryStats: Implement linux support

	virNodeGetMemoryStats: Implement virsh support

	virNodeGetMemoryStats: Implement remote protocol

	virNodeGetMemoryStats: Implement public API

	virNodeGetMemoryStats: Define internal driver API

	virNodeGetMemoryStats: Expose new API

	virNodeGetCPUStats: Implement linux support

	virNodeGetCPUStats: Implement virsh support

	virNodeGetCPUStats: Implement remote protocol

	virNodeGetCPUTime: Implement public API

	virNodeGetCPUStats: Define internal driver API

	virNodeGetCPUStats: Expose new API

2011-06-15  Guido Günther  <agx@sigxcpu.org>

	Skip nodeinfo test on non intel architectures
	since the testfiles assume a /proc/cpuinfo specific to this
	architecture. We e.g. can't parse the number of cores on other
	architectures.

2011-06-15  Michael Chapman  <mike@very.puzzling.org>

	Fix autostart flag when loading running domains
	Drivers load running persistent and transient domain configs before
	inactive persistent domain configs, however only the latter would set a
	domain's autostart flag. This mismatch between the loaded and on-disk
	state could later cause problems with "virsh autostart":

	  # virsh autostart example
	  error: Failed to mark domain example as autostarted
	  error: Failed to create symlink '/etc/libvirt/qemu/autostart/example.xml to '/etc/libvirt/qemu/example.xml': File exists

	This patch ensures the autostart flag is set correctly even when the
	domain is already defined.

	Fixes:

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

2011-06-15  Lai Jiangshan  <laijs@cn.fujitsu.com>

	send-key: Implementing the remote protocol

	send-key: Implementing the public API

	send-key: Defining the internal API

2011-06-15  Lai Jiangshan  <laijs@cn.fujitsu.com>

	send-key: Defining the public API
	Add public virDomainSendKey() and enum libvirt_keycode_set
	for the @codeset.

	Python version of virDomainSendKey() has not been implemented yet,
	it will be done soon.

2011-06-15  Lai Jiangshan  <laijs@cn.fujitsu.com>

	remote generator: Handle (unsigned) int arrays

2011-06-15  Lai Jiangshan  <laijs@cn.fujitsu.com>

	add VSH_OFLAG_REQ_OPT options
	A VSH_OFLAG_REQ_OPT option means --optionname is required when used.
	It will kill any ambiguity, even a !VSH_OFLAG_REQ option listed before
	a VSH_OFLAG_REQ option, if the !VSH_OFLAG_REQ option is a
	VSH_OFLAG_REQ_OPT option.

	It will help us use optional argument with VSH_OT_ARGV argument.

2011-06-15  Lai Jiangshan  <laijs@cn.fujitsu.com>

	allow name for VSH_OT_ARGV options
	A name will improve the usege, example

	# virsh help echo
	  NAME
	    echo - echo arguments

	  SYNOPSIS
	    echo [--shell] [--xml] [<string>]...

	  DESCRIPTION
	    Echo back arguments, possibly with quoting.

	  OPTIONS
	    --shell          escape for shell use
	    --xml            escape for XML use
	    <string>         arguments to echo

	"[<string>]..." is added to SYNOPSIS.
	"<string>         arguments to echo" is added to OPTIONS.

2011-06-15  Ohad Levy  <ohadlevy@gmail.com>

	docs: updated list of applications using libvirt.
	Added:
	* Virt ruby bindings
	* Foreman for provisioning and webui.

2011-06-14  Eric Blake  <eblake@redhat.com>

	storage: avoid an intermediate malloc
	Suggested here:
	https://www.redhat.com/archives/libvir-list/2011-May/msg00594.html

	* src/storage/storage_backend.c (virStorageBackendCreateQemuImg):
	Generate size inline.

2011-06-14  Eric Blake  <eblake@redhat.com>

	command: avoid double close
	Previously, the parent process opened 'null' to /dev/null, then
	the child process closes 'null' as well as 'childout'.  But if
	childout was set to be null, then this is a double close.  At
	least the double close was confined to the child process after a
	fork, and therefore there is no risk of another thread opening
	an fd of the same value to be bitten by the double close, but it
	is always better to avoid double-close to begin with.

	Additionally, if all three fds were specified, then opening
	'null' was wasted.

	This patch fixes things to lazily open null on the first use,
	then guarantees it gets closed exactly once.

	* src/util/command.c (getDevNull): New helper function.
	(virExecWithHook): Use it to avoid spurious opens and double close.

2011-06-14  Eric Blake  <eblake@redhat.com>

	command: reduce duplicated debug messages
	This also reduces malloc pressure for invoking a child when
	VIR_DEBUG is enabled.

	* src/util/command.c (virExecWithHook): Drop debug, since the only
	caller (virCommandRunAsync) also prints debug info.

2011-06-14  Eric Blake  <eblake@redhat.com>

	docs: improve VIR_DOMAIN_AFFECT_CURRENT description
	* include/libvirt/libvirt.h.in (virDomainModificationImpact): Reword.

2011-06-14  Cole Robinson  <crobinso@redhat.com>

	qemu: Fix parsing 'info chardev'
	If qemu supports -chardev, our char frontend aliases are ex. 'charserial0'
	not just 'serial0'. Typically we don't use this code path because the
	pty's are scraped from stdout.

	qemu: Scrape stdout for virtio console pty
	Currently we forget to do this and have to fallback to info chardev (which
	also fails, see following patch)

2011-06-14  Michal Privoznik  <mprivozn@redhat.com>

	virsh: Add daemon version reporting
	'virsh version' might report against which version of libvirtd is
	running.

2011-06-14  Guido Günther  <agx@sigxcpu.org>

	nodeinfo: remove superflous braces
	that break compilation on non intel architectures:

	mips:
	https://buildd.debian.org/status/fetch.php?pkg=libvirt&arch=mips&ver=0.9.2-1&stamp=1307570195
	powerpc:
	https://buildd.debian.org/status/fetch.php?pkg=libvirt&arch=powerpc&ver=0.9.2-1&stamp=1307550913
	s390:
	https://buildd.debian.org/status/fetch.php?pkg=libvirt&arch=s390&ver=0.9.2-1&stamp=1307641748
	sparc:
	https://buildd.debian.org/status/fetch.php?pkg=libvirt&arch=sparc&ver=0.9.2-1&stamp=1307552926

2011-06-14  Osier Yang  <jyang@redhat.com>

	util: Cleanup indention problem in virterror.c
	Push under trivial rule.

2011-06-14  Osier Yang  <jyang@redhat.com>

	qemu: Parse current balloon value returned by query_balloon
	Qemu once supported following memory stats which will returned by
	"query_balloon":

	    stat_put(dict, "actual", actual);
	    stat_put(dict, "mem_swapped_in", dev->stats[VIRTIO_BALLOON_S_SWAP_IN]);
	    stat_put(dict, "mem_swapped_out", dev->stats[VIRTIO_BALLOON_S_SWAP_OUT]);
	    stat_put(dict, "major_page_faults", dev->stats[VIRTIO_BALLOON_S_MAJFLT]);
	    stat_put(dict, "minor_page_faults", dev->stats[VIRTIO_BALLOON_S_MINFLT]);
	    stat_put(dict, "free_mem", dev->stats[VIRTIO_BALLOON_S_MEMFREE]);
	    stat_put(dict, "total_mem", dev->stats[VIRTIO_BALLOON_S_MEMTOT]);

	But it later disabled all the stats except "actual" by commit
	07b0403dfc2b2ac179ae5b48105096cc2d03375a.

	libvirt doesn't parse "actual", so user will always see a empty result
	with "virsh dommemstat $domain". Even qemu haven't disabled the stats,
	we should support parsing "actual".

2011-06-14  Taku Izumi  <izumi.taku@jp.fujitsu.com>

	vcpupin: Fix cpu affinity setting bug of qemu driver
	There is the case where cpu affinites for vcpu of qemu doesn't work
	correctly. For example, if only one vcpupin setting entry is provided
	and its setting is not for vcpu0, it doesn't work.

	   # virsh dumpxml VM
	   ...
	   <vcpu>4</vcpu>
	   <cputune>
	     <vcpupin vcpu='3' cpuset='9-11'/>
	   </cputune>
	   ...

	   # virsh start VM
	   Domain VM started

	   # virsh vcpuinfo VM
	   VCPU:           0
	   CPU:            31
	   State:          running
	   CPU time:       2.5s
	   CPU Affinity:   yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy

	   VCPU:           1
	   CPU:            12
	   State:          running
	   CPU time:       0.9s
	   CPU Affinity:   yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy

	   VCPU:           2
	   CPU:            30
	   State:          running
	   CPU time:       1.5s
	   CPU Affinity:   yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy

	   VCPU:           3
	   CPU:            13
	   State:          running
	   CPU time:       1.7s
	   CPU Affinity:   yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy

	This patch fixes this problem.

2011-06-14  Matthias Bolte  <matthias.bolte@googlemail.com>

	Fix dlopen dependency
	Since the addition of the lock manager framework in 6a943419c528fdd7
	dlopen is always required, but the checks in configure wasn't changed
	to reflect that. This didn't show up directly because the VirtualBox
	driver linking dlopen in covered it. But disabling the VirtualBox
	driver makes the build fail due to missing dlopen.

	Change the dlopen check in configure to pick up dlopen when available.

	Reported by Ruben Kerkhof.

2011-06-14  Hu Tao  <hutao@cn.fujitsu.com>

	Deprecate several CURRENT/LIVE/CONFIG enums
	This patch deprecates following enums:

	VIR_DOMAIN_MEM_CURRENT
	VIR_DOMAIN_MEM_LIVE
	VIR_DOMAIN_MEM_CONFIG

	VIR_DOMAIN_VCPU_LIVE
	VIR_DOMAIN_VCPU_CONFIG

	VIR_DOMAIN_DEVICE_MODIFY_CURRENT
	VIR_DOMAIN_DEVICE_MODIFY_LIVE
	VIR_DOMAIN_DEVICE_MODIFY_CONFIG

	And modify internal codes to use virDomainModificationImpact.

2011-06-14  Stefan Berger  <stefanb@us.ibm.com>

	qemu: Faster response time to qemu startup errors
	The below patch decreases the response time of libvirt to errors reported by Qemu upon startup by checking whether the qemu process is still alive while polling for the local socket to show up.

	This patch also introduces a special handling of signal for the Win32 part of virKillProcess.

2011-06-14  Eric Blake  <eblake@redhat.com>

	build: update to latest gnulib
	* .gnulib: Update to latest, for more strerror_r fixes.

2011-06-13  Taku Izumi  <izumi.taku@jp.fujitsu.com>

	vcpupin: add the new option to "virsh vcpupin" command
	This patch adds the new option (--live, --config and --current) to
	"virsh vcpupin" command. The behavior of above aption is the same as
	that of "virsh setmem", "virsh setvcpus", and whatnot.
	When the --config option is specified, the command affects a persistent
	domain, while --live option is specified, it affects a running (live) domain.
	The --current option cannot be used with --config or --live at the same
	time, and when --current is specified, it affects a "current" domain.

	vcpupin: implement the remote protocol to address the new API
	This patch implements the remote protocol for the new API
	(virDomainPinVcpuFlags).

	vcpupin: implement the code to address the new API in the qemu driver
	This patch implements the new API (virDomainPinVcpuFlags) in the qemu
	driver.

	vcpupin: introduce a new libvirt API (virDomainPinVcpuFlags)
	This patch introduces a new libvirt API virDomainPinVcpuFlags,
	a direct extension from the existing virDomainPinVcpu

2011-06-13  Jiri Denemark  <jdenemar@redhat.com>

	Use virTimeMs when appropriate

	Introduce virTimeMs for getting current time in ms

	test: Remove unused timeval

2011-06-13  Wen Congyang  <wency@cn.fujitsu.com>

	tests: add a test for multi function PCI device

2011-06-13  Wen Congyang  <wency@cn.fujitsu.com>

	support multifunction PCI device
	If qemu supports multi function PCI device, the format of the PCI address passed
	to qemu is "bus=pci.0,multifunction=on,addr=slot.function".

	If qemu does not support multi function PCI device, the format of the PCI address
	passed to qemu is "bus=pci.0,addr=slot".

2011-06-13  Wen Congyang  <wency@cn.fujitsu.com>

	the hotplugged PCI device should use the whole slot
	Hot pluging/unpluging multi PCI device is not supported now. So the function
	of hotplugged PCI device must be 0. When we hot unplug it, we should set release
	all functions in the slot.

	assign the whole slot to the PCI device that has no address
	If user does not specify the PCI address, we should auto assign an unused slot.

	Reimplement qemuDomainPCIAddressReserveSlot(): reserve all functions in the slot
	We will support multi function PCI device. So we should reserve all functions in
	the slot if we want to reserve a slot.

	the key of hash table should include the function value
	We save all used PCI address in the hash table. The key is generated by domain,
	bus and slot now. We will support multi function PCI device, so the key should
	be generated by domain, bus, slot and function.

	prevent hot unplugging multi function PCI device
	We do not support to hot unplug multi function PCI device now. If the device is
	one function of multi function PCI device, we shoul not allow to hot unplugg
	it.

	check whether qemu supports multi function PCI device
	qemu supports multi function PCI device at least version 0.13.0.

2011-06-10  Matthew Booth  <mbooth@redhat.com>

	xenapi: Improve error message on session failure
	XenAPI session login can fail for a number of reasons, but currently no
	specific
	reason is displayed to the user, e.g.:

	virsh -c XenAPI://citrix-xen.example.com/
	Enter username for citrix-xen.example.com: root
	Enter root's password for citrix-xen.example.com:
	error: authentication failed: (null)
	error: failed to connect to the hypervisor

	This patch displays the session error description on failure.

2011-06-10  Osier Yang  <jyang@redhat.com>

	qemu: Fix one type in the error prompt string
	s/hostdevwork/hostdev/

2011-06-10  Matthias Bolte  <matthias.bolte@googlemail.com>

	Move VMware Workstation/Player driver to correct spec file section
	The VMware driver works like the OpenVZ driver by using a commandline
	tool for management. It dosen't use it's own remote protocol.

2011-06-08  Eric Blake  <eblake@redhat.com>

	virt-aa-helper: add missing include
	Regression introduced in commit 02e8691.

	* src/security/virt-aa-helper.c (includes): Reflect move of virRun.

2011-06-08  Eric Blake  <eblake@redhat.com>

	daemon: plug memory leak
	Detected by Coverity.  Commit ef21beda was incomplete; it solved
	a leak one one path, but not on the other.

	* daemon/libvirtd.c (qemudSetLogging): Avoid leak on success.

2011-06-08  Eric Blake  <eblake@redhat.com>

	build: break some long lines
	As long as I was already touching the function...

	* src/qemu/qemu_hotplug.c (qemuDomainChangeGraphics): Line wrap.

2011-06-08  Eric Blake  <eblake@redhat.com>

	qemu: add missing break statement
	Detected by Coverity.  Bug introduced in commit 9d73efd (v0.8.8).

	* src/qemu/qemu_hotplug.c (qemuDomainChangeGraphics): Don't report
	error on success.

2011-06-08  Eric Blake  <eblake@redhat.com>

	build: silence coverity false positives
	Coverity complained about these intentional fallthrough cases, but
	not about other cases that were explicitly marked with nice comments.

	For some reason, Coverity doesn't seem smart enough to parse the
	up-front English comment in virsh about intentional fallthrough :)

	* tools/virsh.c (cmdVolSize): Mark fallthrough in a more typical
	fashion.
	* src/conf/nwfilter_conf.c (virNWFilterRuleDefDetailsFormat)
	(virNWFilterRuleDetailsParse): Mark explicit fallthrough.

2011-06-08  Eric Blake  <eblake@redhat.com>

	esx: avoid dead code
	Detected by Coverity.  The beginning of the function already filtered
	out NULL objectContentList as invalid.  Further investigation shows:

	esxVI_RetrieveProperties is generated and returns a list of objects
	that match the given propertyFilterSpec.
	esxVI_LookupObjectContentByType then tests whether the result
	corresponds to the expected occurrence and reports an error otherwise.
	This simplifies the callers of  esxVI_LookupObjectContentByType, but
	due to the missing dereference the check was never performed because
	the code thought that at least one item was obtained. NULL represents
	an empty list. This is a potential segfault fix because callers of
	esxVI_LookupObjectContentByType that specified "required" occurrence
	assume *objectContentList to be non-NULL when
	esxVI_LookupObjectContentByType succeeds.

	* src/esx/esx_vi.c (esxVI_LookupObjectContentByType): Check
	correct pointer.

2011-06-08  Eric Blake  <eblake@redhat.com>

	secret: drop dead code
	Detected by Coverity.  The only ways to get to the cleanup label
	were by an early abort (list still unassigned) or after successfully
	transferring list to dest, so there is no list to clean up.

	* src/secret/secret_driver.c (loadSecrets): Kill dead code.

2011-06-08  Eric Blake  <eblake@redhat.com>

	qemu: reorder checks for safety
	Detected by Coverity.  All existing callers happen to be in
	range, so this isn't too serious.

	* src/qemu/qemu_cgroup.c (qemuCgroupControllerActive): Check
	bounds before dereference.

2011-06-08  Eric Blake  <eblake@redhat.com>

	uuid: annotate non-null requirements
	Coverity already saw through a NULL dereference without these
	annotations, and gcc is still too puny to do good NULL analysis.
	But clang still benefits (and is easier to run than coverity),
	not to mention that adding this bit of documentation to the code
	may help future developers remember the constraints.

	* src/util/uuid.h (virGetHostUUID, virUUIDFormat): Document
	restrictions, for improved static analysis.

2011-06-08  Eric Blake  <eblake@redhat.com>

	debug: avoid null dereference on uuid lookup api
	Detected by Coverity.  Commit a98d8f0d tried to make uuid debugging
	more robust, but missed some APIs.  And on the APIs that it visited,
	the mere act of preparing the debug message ends up dereferencing
	uuid prior to the null check.  Which means the APIs which are supposed
	to gracefully reject NULL arguments now end up with SIGSEGV.

	* src/libvirt.c (VIR_UUID_DEBUG): New macro.
	(virDomainLookupByUUID, virDomainLookupByUUIDString)
	(virNetworkLookupByUUID, virNetworkLookupByUUIDString)
	(virStoragePoolLookupByUUID, virStoragePoolLookupByUUIDString)
	(virSecretLookupByUUID, virSecretLookupByUUIDString)
	(virNWFilterLookupByUUID, virNWFilterLookupByUUIDString): Avoid
	null dereference.

2011-06-08  Eric Blake  <eblake@redhat.com>

	python: avoid unlikely sign extension bug
	Detected by Coverity.  cpumap was allocated with a value of
	(unsigned short)*(int), which is an int computation, and then
	promotes to size_t.  On a 64-bit platform, this fails if bit
	32 of the product is set (because of sign extension giving
	a HUGE value to malloc), even though a naive programmer would
	assume that since the first value is unsigned, the product
	is also unsigned and at most 4GB would be allocated.

	Won't bite in practice (the product should never be that large),
	but worth using the right types to begin with, so that we are
	now computing (unsigned short)*(size_t).

	* python/libvirt-override.c (libvirt_virDomainGetVcpus): Use
	correct type.

2011-06-08  Eric Blake  <eblake@redhat.com>

	build: silence coverity false positive
	Similar in nature to commit fd21ecfd, which shut up valgrind.

	sigaction is apparently a nasty interface for analyzer tools,
	at least for how many false positives it generates.

	* src/util/command.c (virExecWithHook): Initialize entire var, since
	coverity gripes about the (unused and non-standard) sa_restorer.

2011-06-08  Eric Blake  <eblake@redhat.com>

	storage: avoid mishandling backing store > 2GB
	Detected by Coverity.  The code was doing math on shifted unsigned
	char (which promotes to int), then promoting that to unsigned long
	during assignment to size.  On 64-bit platforms, this risks sign
	extending values of size > 2GiB.  Bug present since commit
	489fd3 (v0.6.0).

	I'm not sure if a specially-crafted bogus qcow2 image could
	exploit this, although it's probably not possible, since we
	were already checking for the computed results being within
	range of our fixed-size buffer.

	* src/util/storage_file.c (qcowXGetBackingStore): Avoid sign
	extension.

2011-06-08  Eric Blake  <eblake@redhat.com>

	build: detect Coverity 5.3.0
	Coverity 5.3.0 still outputs lots of COVERITY_* variables, but no
	longer modifies COVERITY_BUILD_COMMAND in the environment.  Pick
	one that seems likely to stay around.

	* configure.ac (STATIC_ANALYSIS): Detect newer Coverity.

2011-06-08  Osier Yang  <jyang@redhat.com>

	build: Fix typos in configure.ac

	virsh: Expose virDomainMigrateSetMaxSpeed API to virsh
	API virDomainMigrateSetMaxSpeed was introduced since 0.9.0, but
	no command in virsh yet.

2011-06-08  Cole Robinson  <crobinso@redhat.com>

	lxc: Ensure container <init> actually exists
	Since we can't really get useful error reporting from virCommandExec since
	it needs to be the last thing we do.

	lxc: Verify root fs exists before mounting
	Otherwise the following virFileMakePath will create the directory for
	us and fail further ahead, which probably isn't intended.

	lxc: controller: Improve container error reporting
	Add a handshake with the cloned container process to try and detect
	if it fails to start.

	lxc: Improve guest startup error reporting
	Add a simple handshake with the lxc_controller process so we can detect
	process startup failures. We do this by adding a new --handshake cli arg
	to lxc_controller for passing a file descriptor. If the process fails to
	launch, we scrape all output from the logfile and report it to the user.

	lxc: Refactor controller command building
	Arranges things similar to the qemu driver. Will allow us to more easily
	report command error output.

	lxc: Don't report error in Wait/SendContinue
	We will reuse these shortly, and each use should have a different error
	message.

	lxc: Drop container stdio as late as possible
	Makes it more likely we get useful error output in the logs

2011-06-08  Cole Robinson  <crobinso@redhat.com>

	Move virRun, virExec*, virFork to util/command
	Seems reasonable to have all command wrappers in the same place

	v2:
	    Dont move SetInherit

	v3:
	    Comment spelling fix
	    Adjust WARN0 comment
	    Remove spurious #include movement
	    Don't include sys/types.h
	    Combine virExec enums

2011-06-07  Cole Robinson  <crobinso@redhat.com>

	util: Implement virRun as a wrapper around virCommand
	v2:
	    Simplify command building
	    Handle command building failure

	v3:
	    Remove unneeded NULL check

2011-06-07  Cole Robinson  <crobinso@redhat.com>

	util: Remove unused virExec wrapper
	v3:
	    Remove obsolete comment

2011-06-07  Cole Robinson  <crobinso@redhat.com>

	qemu: Convert virExec usage to virCommand
	v2:
	    Have virCommand cleanup intermediate process for us

	v3:
	    Preserve original FD closing behavior

2011-06-07  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Remove duplicated invalid-argument checks
	Those checks are already performed at the public API level.

2011-06-07  Osier Yang  <jyang@redhat.com>

	docs: Add doc for video element
	For backwards compatibility, if no <video> is set but there is a
	<graphics> tag, then we add a default <video> according to the
	guest type. Add docs to tell the user about this to not make
	them confused. Especially if they remove the video (such as via
	"virsh edit"), it will be surprised for them to see the video
	element is still in domain XML.

	Use VIR_USE_CPU instead of new wheel

2011-06-07  Matthias Bolte  <matthias.bolte@googlemail.com>

	Avoid virGetVersion failure on specific driver support configurations
	virGetVersion itself doesn't take a virConnectPtr, but in order to obtain
	the hypervisor version against which libvirt was compiled it is used in
	combination with virConnectGetType like this:

	hvType = virConnectGetType(conn)
	virGetVersion(&libVer, hvType, &typeVer)

	When virConnectGetType is called on a remote connection then the remote
	driver returns the type of the underlying driver on the server side, for
	example QEMU. Then virGetVersion compares hvType to a set of strings that
	depend on configure options and returns LIBVIR_VERSION_NUMBER in most
	cases. Now this fails in case libvirt on the client side is just compiled
	with the remote driver enabled only and the server side has the actual
	driver such as the QEMU driver. It just happens to work when the actual
	driver is enabled on client and server side. But that's not always true.
	I noticed this on FreeBSD:

	freebsd# virsh -c qemu+tcp://192.168.178.22/system version
	Compiled against library: libvir 0.9.2
	error: failed to get the library version
	error: this function is not supported by the connection driver: virGetVersion

	This is not FreeBSD specific, happens on Windows as well due to the
	similar driver support configuration. The problem is that virConnectGetType
	returns QEMU, but virGetVersion on the client side only accepts Remote
	as hvType due to all other drivers being disabled on the client side.

	Daniel P. Berrange suggested to get rid of all the conditional code in
	virGetVersion, ignoring the hvType and always setting typeVer to
	LIBVIR_VERSION_NUMBER. virConnectGetVersion is supposed to be used to
	obtain the hypervisor version.

2011-06-06  Matthias Bolte  <matthias.bolte@googlemail.com>

	docs: Make hvsupport.pl pick up the host device drivers
	Annotate the ESX device driver dummy.

	Refactor the udev and hal device driver strcuts to match the
	common annotation pattern.

2011-06-06  Daniel Veillard  <veillard@redhat.com>

	Release of libvirt-0.9.2
	* configure.ac docs/news.html.in libvirt.spec.in: update for release
	* po/*.po*: updated translations and regenerated

2011-06-06  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Fix driver method version annotations
	Change the driver comments for proper extraction and values by
	the scripts used for documentation

2011-06-06  Daniel P. Berrange  <berrange@redhat.com>

	Fix QEMU p2p v2 migration when run from a v3 client
	When peer-2-peer migration was invoked by a client supporting
	v3, but where the target server only supported v2, we'd not
	correctly shutdown the guest.

	* src/qemu/qemu_migration.c: Ensure guest is shutdown in
	  v2 peer 2 peer migration

2011-06-05  Matthias Bolte  <matthias.bolte@googlemail.com>

	vbox: Fix typo in error message

2011-06-04  Daniel P. Berrange  <berrange@redhat.com>

	Don't raise an error if the migration cookie is NULL
	The v2 migration protocol doesn't use cookies, so we should not
	be raising an error if the cookie parameters are NULL.

	* src/qemu/qemu_migration.c: Don't raise error if cookie is NULL

2011-06-04  Daniel P. Berrange  <berrange@redhat.com>

	Fix check of virKillProcess return status
	The error code for virKillProcess is returned in the errno variable
	not the return value. THis mistake caused the logs to be filled with
	errors when shutting down QEMU processes

	* src/qemu/qemu_process.c: Fix process kill check.

2011-06-04  Matthias Bolte  <matthias.bolte@googlemail.com>

	vbox: Fix version extraction on Windows for newer VirtualBox versions
	VirtualBox 4.0.8 changed the registry key layout. Before the version
	number was in a Version key. Now the Version key contains %VER% and
	the actual version number is in VersionExt now.

	Move value lookup code into its own function: vboxLookupRegistryValue.

2011-06-04  Eric Blake  <eblake@redhat.com>

	API: consolidate common unreleased enums
	This commit is safe precisely because there has been no release
	for any of the enum values being deleted (they were added post-0.9.1).

	After the 0.9.2 release, we can then take advantage of
	virDomainModificationImpact in more places.

	* include/libvirt/libvirt.h.in (virDomainModificationImpact): New
	enum.
	(virDomainSchedParameterFlags, virMemoryParamFlags): Delete, since
	these were never released, and the new enum works fine here.
	* src/libvirt.c	(virDomainGetMemoryParameters)
	(virDomainSetMemoryParameters)
	(virDomainGetSchedulerParametersFlags)
	(virDomainSetSchedulerParametersFlags): Update documentation.
	* src/qemu/qemu_driver.c (qemuDomainSetMemoryParameters)
	(qemuDomainGetMemoryParameters, qemuSetSchedulerParametersFlags)
	(qemuSetSchedulerParameters, qemuGetSchedulerParametersFlags)
	(qemuGetSchedulerParameters): Adjust clients.
	* tools/virsh.c (cmdSchedinfo, cmdMemtune): Likewise.
	Based on ideas by Daniel Veillard and Hu Tao.

2011-06-04  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Avoid use after free in qemuCaps parsing

	virsh: Document nodeinfo output

2011-06-04  Laine Stump  <laine@laine.org>

	security driver: ignore EINVAL when chowning an image file
	This fixes:

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

	Both of these complain of a failure to use an image file that resides
	on a read-only NFS volume. The function in the DAC security driver
	that chowns image files to the qemu user:group before using them
	already has special cases to ignore failure of chown on read-only file
	systems, and in a few other cases, but it hadn't been checking for
	EINVAL, which is what is returned if the qemu user doesn't even exist
	on the NFS server.

	Since the explanation of EINVAL in the chown man page almost exactly
	matches the log message already present for the case of EOPNOTSUPP,
	I've just added EINVAL to that same conditional.

2011-06-03  Matthias Bolte  <matthias.bolte@googlemail.com>

	Make dlopen usage in lock manager conditional
	This fixes a build failure on MinGW, due to MinGW not supporting dlopen.

2011-06-03  Neil Wilson  <neil@aldur.co.uk>

	Correct 'cputune' documentation example.

2011-06-03  Eric Blake  <eblake@redhat.com>

	build: silence coverity false positive
	Coverity couldn't see that priv is NULL on failure.  But on failure,
	we might as well guarantee that callers don't try to free uninitialized
	memory.

	* src/remote/remote_driver.c (remoteGenericOpen): Even on failure,
	pass priv back to caller.

2011-06-03  Eric Blake  <eblake@redhat.com>

	build: silence coverity false positive
	Coverity complained that infd could be -1 at the point where it is
	passed to write, when in reality, this code can only be reached if
	infd is non-negative.

	* src/util/command.c (virCommandProcessIO): Help out coverity.

2011-06-03  Eric Blake  <eblake@redhat.com>

	migrate: detect xml incompatibility
	Detected by Coverity.  Bug introduced in 08106e2044 (unreleased).

	* src/conf/domain_conf.c (virDomainChannelDefCheckABIStability):
	Use correct sizeof operand.

2011-06-03  Eric Blake  <eblake@redhat.com>

	event: avoid memory leak on cleanup
	Detected by Coverity.  Introduced in commit aaf2b70, and turned into
	a regression in the next few commits through 4e6e6672 (unreleased).

	* src/conf/domain_event.c (virDomainEventStateFree): Free object,
	per documentation.

2011-06-03  Eric Blake  <eblake@redhat.com>

	qemu: avoid memory leak on vcpupin
	Detected by Coverity.  This leaked a cpumap on every iteration
	of the loop.  Leak introduced in commit 1cc4d02 (v0.9.0).

	* src/qemu/qemu_process.c (qemuProcessSetVcpuAffinites): Plug
	leak, and hoist allocation outside loop.

2011-06-03  Eric Blake  <eblake@redhat.com>

	remote: avoid leak on failure
	Detected by Coverity.  Only possible in OOM situations.

	* daemon/remote.c (remoteDispatchDomainScreenshot): Plug leak.

2011-06-03  Eric Blake  <eblake@redhat.com>

	lock: avoid leak on failure
	Detected by Coverity.  Only possible on OOM situations.

	* src/locking/lock_manager.c (virLockManagerPluginNew): Plug leak.

2011-06-03  Eric Blake  <eblake@redhat.com>

	storage: avoid memory leak on stat failure
	Spotted by coverity.  Triggers on failed stat, although I'm not sure
	how easy that condition is, so I'm not sure if this is a runtime
	memory hog.  Regression introduced in commit 8077d64 (unreleased).

	* src/util/storage_file.c (virStorageFileGetMetadataFromFD):
	Reduce need for malloc, avoiding a leak.

2011-06-03  Eric Blake  <eblake@redhat.com>

	storage: avoid memory leak
	Coverity detected that options was being set by strdup but never
	freed.  But why even bother with an options variable?  The options
	parameter never changes!  Leak present since commit 44948f5b (0.7.0).

	This function could probably be rewritten to take better advantage
	of virCommand, but that is more invasive.

	* src/storage/storage_backend_fs.c
	(virStorageBackendFileSystemMount): Avoid wasted strdup, and
	guarantee proper cleanup on all paths.

2011-06-03  Eric Blake  <eblake@redhat.com>

	libvirtd: avoid leak on failure
	Spotted by Coverity.  Only possible on an OOM condition, so
	unlikely to bite in the wild.

	* daemon/libvirtd.c (qemudSetLogging): Don't leak memory.

2011-06-03  Eric Blake  <eblake@redhat.com>

	command: avoid leak on failure
	Detected by Coverity.  While it is possible on OOM condition, as
	well as with bad code that passes binary == NULL, it is unlikely
	to be encountered in the wild.

	* src/util/command.c (virCommandNewArgList): Don't leak memory.

2011-06-03  Daniel P. Berrange  <berrange@redhat.com>

	Explicitly set VM state to paused after migration completes
	In v3 migration, once migration is completed, the VM needs
	to be left in a paused state until after Finish3 has been
	executed on the target. Only then will the VM be killed
	off. When using non-JSON QEMU monitor though, we don't
	receive any 'STOP' event from QEMU, so we need to manually
	set our state offline & thus release lock manager leases.
	It doesn't hurt to run this on the JSON case too, just in
	case the event gets lost somehow

	* src/qemu/qemu_migration.c: Explicitly set VM state to
	  paused when migration completes

2011-06-03  Daniel P. Berrange  <berrange@redhat.com>

	Fix regressions BlockStats/Info APIs in QEMU driver
	The change 18c2a592064d69499f70428e498f4a3cb5161cda caused
	some regressions in behaviour of virDomainBlockStats
	and virDomainBlockInfo in the QEMU driver.

	The virDomainBlockInfo API stopped working for inactive
	guests if querying a block device.

	The virDomainBlockStats API did not promptly report
	an error if the guest was not running in some cases.

	* src/qemu/qemu_driver.c: Fix inactive guest handling
	  in BlockStats/Info APIs

2011-06-03  Jim Fehlig  <jfehlig@novell.com>

	Fix minor issues in libxenlight managed save
	There were a few minor issues in commit 5b6c961e
	- leak managed save path
	- leak managed save fd
	- functions that open an fd should also close it

2011-06-03  Heath Petersen  <HeathPetersen@Kandre.com>

	uml: correct command line networking parameters
	I have been finding that some UML command line networking parameters are
	being generated incorrectly.

	For more information, see
	https://bugzilla.redhat.com/show_bug.cgi?id=706295 .

2011-06-03  Eric Blake  <eblake@redhat.com>

	docs: document iface-* commands
	I intentionally set things up so 'virsh help interface' lists
	commands in alphabetical order, but 'man virsh' lists them in
	topical order; this matches our practice on some other commands.

	* tools/virsh.pod: Document all iface commands.
	* tools/virsh.c (ifaceCmds): Sort.

2011-06-03  Daniel P. Berrange  <berrange@redhat.com>

	Fix auditing of disk hotunplug operations
	The qemuAuditDisk calls in disk hotunplug operations were being
	passed 'ret >= 0', but the code which sets ret to 0 was not yet
	executed, and the error path had already jumped to the 'cleanup'
	label. This meant hotunplug failures were never audited, and
	hotunplug success was audited as a failure

	* src/qemu/qemu_hotplug.c: Fix auditing of hotunplug

2011-06-03  Daniel P. Berrange  <berrange@redhat.com>

	Avoid crash on NULL pointer in lock driver impls during hotplug
	When virLockDriverAcquire is invoked during hotplug the state
	parameter will be left as NULL.

	* src/locking/lock_driver_nop.c,
	  src/locking/lock_driver_sanlock.c: Don't reference NULL state
	  parameter

2011-06-03  Daniel P. Berrange  <berrange@redhat.com>

	Fix return value in lock manager hotplug methods
	Refactoring of the lock manager hotplug methods lost the
	ret = 0 assignment for successful return path

	* src/locking/domain_lock.c: Add missing ret = 0 assignments

2011-06-03  Daniel P. Berrange  <berrange@redhat.com>

	Make sure virDomainSave/virDomainManagedSave reset id to -1
	After successfull virDomainSave/virDomainManagedSave calls
	the guest will no longer be active, so the domain ID must
	be reset to -1

	* daemon/remote_generator.pl: Special case virDomainSave &
	  virDomainManagedSave for same reason as virDomainDestroy

2011-06-03  Daniel P. Berrange  <berrange@redhat.com>

	Fix handling of VIR_EVENT_HANDLE_ERROR in QEMU monitor
	Commit 4454a9efc728b91e791b1f14c26ea23a19d57f48 introduced bad
	behaviour on the VIR_EVENT_HANDLE_ERROR condition. This condition
	is only hit when an invalid FD is used in poll() (typically due
	to a double-close bug). The QEMU monitor code was treating this
	condition as non-fatal, and thus libvirt would poll() in a fast
	loop forever burning 100% CPU. VIR_EVENT_HANDLE_ERROR must be
	handled in the same way as VIR_EVENT_HANDLE_HANGUP, killing the
	QEMU instance.

	* src/qemu/qemu_monitor.c: Treat VIR_EVENT_HANDLE_ERROR as EOF

2011-06-03  Daniel P. Berrange  <berrange@redhat.com>

	Add call to sanlock_restrict() in QEMU lock driver
	In between fork and exec, a connection to sanlock is acquired
	and the socket file descriptor is intionally leaked to the
	child process. sanlock watches this FD for POLL_HANGUP to
	detect when QEMU has exited. We don't want a rogus/compromised
	QEMU from issuing sanlock RPC calls on the leaked FD though,
	since that could be used to DOS other guests. By calling
	sanlock_restrict() on the socket before exec() we can lock
	it down.

	* configure.ac: Check for sanlock_restrict API
	* src/locking/domain_lock.c: Restrict lock acquired in
	  process startup phase
	* src/locking/lock_driver.h: Add VIR_LOCK_MANAGER_ACQUIRE_RESTRICT
	* src/locking/lock_driver_sanlock.c: Add call to sanlock_restrict
	  when requested by VIR_LOCK_MANAGER_ACQUIRE_RESTRICT flag

2011-06-02  Eric Blake  <eblake@redhat.com>

	build: fix VPATH build break from previous patch
	Partial revert of commit c3c30d4de9d.

	* docs/Makefile.am (internals/%.html.tmp): Restore MKDIR_P; it is
	needed for intermediate file after all.
	Reported by Daniel P. Berrange.

2011-06-02  Michal Privoznik  <mprivozn@redhat.com>

	screenshot: Expose the new API in virsh
	* tools/virsh.c: Add screenshot command
	* tools/virsh.pod: Document new command
	* src/libvirt.c: Fix off-be-one error

2011-06-02  Daniel Veillard  <veillard@redhat.com>

	libxl : fix the version for the managed save APIs

2011-06-02  Markus Groß  <gross@univention.de>

	libxl: adds managed save and restore support
	Based on the equivalent qemu driver code

	* src/libxl/libxl_driver.c: refactor the Start save and restore
	  routines of the driver and adds the new entry points for
	  managed saves handling

2011-06-02  Markus Groß  <gross@univention.de>

	libxl: get maximum memory of running domain
	* src/libxl/libxl_driver.c: fix the libxlDomainGetInfo to return the
	  maximum memory for running domain

2011-06-02  Daniel P. Berrange  <berrange@redhat.com>

	Add a plugin for the 'sanlock' project
	Sanlock is a project that implements a disk-paxos locking
	algorithm. This is suitable for cluster deployments with
	shared storage.

	* src/Makefile.am: Add dlopen plugin for sanlock
	* src/locking/lock_driver_sanlock.c: Sanlock driver
	* configure.ac: Check for sanlock
	* libvirt.spec.in: Add a libvirt-lock-sanlock RPM

2011-06-02  Daniel P. Berrange  <berrange@redhat.com>

	Allow leases to be hotpluged with QEMU guests
	* src/conf/domain_conf.c, src/conf/domain_conf.h: APIs for
	  inserting/finding/removing virDomainLeaseDefPtr instances
	* src/qemu/qemu_driver.c: Wire up hotplug/unplug for leases
	* src/qemu/qemu_hotplug.h, src/qemu/qemu_hotplug.c: Support
	  for hotplug and unplug of leases

2011-06-02  Daniel P. Berrange  <berrange@redhat.com>

	Support passing QEMU lock state to dest during migration
	Some lock managers associate state with leases, allowing a process
	to temporarily release its leases, and re-acquire them later, safe
	in the knowledge that no other process has acquired + released the
	leases in between.

	This is already used between suspend/resume operations, and must
	also be used across migration. This passes the lockstate in the
	migration cookie. If the lock manager uses lockstate, then it
	becomes compulsory to use the migration v3 protocol to get the
	cookie support.

	* src/qemu/qemu_driver.c: Validate that migration v2 protocol is
	  not used if lock manager needs state transfer
	* src/qemu/qemu_migration.c: Transfer lock state in migration
	  cookie XML

2011-06-02  Daniel P. Berrange  <berrange@redhat.com>

	Integrate the QEMU driver with the lock manager infrastructure
	The QEMU integrates with the lock manager instructure in a number
	of key places

	 * During startup, a lock is acquired in between the fork & exec
	 * During startup, the libvirtd process acquires a lock before
	   setting file labelling
	 * During shutdown, the libvirtd process acquires a lock
	   before restoring file labelling
	 * During hotplug, unplug & media change the libvirtd process
	   holds a lock while setting/restoring labels

	The main content lock is only ever held by the QEMU child process,
	or libvirtd during VM shutdown. The rest of the operations only
	require libvirtd to hold the metadata locks, relying on the active
	QEMU still holding the content lock.

	* src/qemu/qemu_conf.c, src/qemu/qemu_conf.h,
	  src/qemu/libvirtd_qemu.aug, src/qemu/test_libvirtd_qemu.aug:
	  Add config parameter for configuring lock managers
	* src/qemu/qemu_driver.c: Add calls to the lock manager

2011-06-02  Daniel P. Berrange  <berrange@redhat.com>

	Add initial docs about the lock managers

2011-06-02  Daniel P. Berrange  <berrange@redhat.com>

	Add higher level lock API for domain objects
	To facilitate use of the locking plugins from hypervisor drivers,
	introduce a higher level API for locking virDomainObjPtr instances.
	In includes APIs targetted to VM startup, and hotplug/unplug

	* src/Makefile.am: Add domain lock API
	* src/locking/domain_lock.c, src/locking/domain_lock.h: High
	  level API for domain locking

2011-06-02  Daniel P. Berrange  <berrange@redhat.com>

	Add a 'nop' lock driver implementation.
	To allow hypervisor drivers to assume that a lock driver impl
	will be guaranteed to exist, provide a 'nop' impl that is
	compiled into the library

	* src/Makefile.am: Add nop driver
	* src/locking/lock_driver_nop.c, src/locking/lock_driver_nop.h:
	  Nop lock driver implementation
	* src/locking/lock_manager.c: Enable direct access of 'nop'
	  driver, instead of dlopen()ing it.

2011-06-02  Daniel P. Berrange  <berrange@redhat.com>

	Basic framework for lock manager plugins
	Define the basic framework lock manager plugins. The
	basic plugin API for 3rd parties to implemented is
	defined in

	  src/locking/lock_driver.h

	This allows dlopen()able modules for alternative locking
	schemes, however, we do not install the header. This
	requires lock plugins to be in-tree allowing changing of
	the lock manager plugin API in future.

	The libvirt code for loading & calling into plugins
	is in

	  src/locking/lock_manager.{c,h}

	* include/libvirt/virterror.h, src/util/virterror.c: Add
	  VIR_FROM_LOCKING
	* src/locking/lock_driver.h: API for lock driver plugins
	  to implement
	* src/locking/lock_manager.c, src/locking/lock_manager.h:
	  Internal API for managing locking
	* src/Makefile.am: Add locking code

2011-06-02  Daniel P. Berrange  <berrange@redhat.com>

	Support leases in guest XML and lock manager
	A lock manager may operate in various modes. The direct mode of
	operation is to obtain locks based on the resources associated
	with devices in the XML. The indirect mode is where the app
	creating the domain provides explicit leases for each resource
	that needs to be locked. This XML extension allows for listing
	resources in the XML

	  <devices>
	     ...
	     <lease>
	       <lockspace>somearea</lockspace>
	       <key>thequickbrownfoxjumpsoverthelazydog</key>
	       <target path='/some/lease/path' offset='23432'/>
	     </lease>
	     ...
	  </devices>

	The 'lockspace' is a unique identifier for the lockspace which
	the lease is associated

	The 'key' is a unique identifier for the resource associated
	with the lease.

	The 'target' is the file on disk where the leases are held.

	* docs/schemas/domain.rng: Add lease schema
	* src/conf/domain_conf.c, src/conf/domain_conf.h: parsing and
	  formatting for leases
	* tests/qemuxml2argvdata/qemuxml2argv-lease.args,
	  tests/qemuxml2argvdata/qemuxml2argv-lease.xml,
	  tests/qemuxml2xmltest.c: Test XML handling for leases

2011-06-02  Daniel P. Berrange  <berrange@redhat.com>

	Allow handshake with child process during startup
	Allow the parent process to perform a bi-directional handshake
	with the child process during fork/exec. The child process
	will fork and do its initial setup. Immediately prior to the
	exec(), it will stop & wait for a handshake from the parent
	process. The parent process will spawn the child and wait
	until the child reaches the handshake point. It will do
	whatever extra setup work is required, before signalling the
	child to continue.

	The implementation of this is done using two pairs of blocking
	pipes. The first pair is used to block the parent, until the
	child writes a single byte. Then the second pair pair is used
	to block the child, until the parent confirms with another
	single byte.

	* src/util/command.c, src/util/command.h,
	  src/libvirt_private.syms: Add APIs to perform a handshake

2011-06-02  Eric Blake  <eblake@redhat.com>

	security: plug regression introduced in disk probe logic
	Regression introduced in commit d6623003 (v0.8.8) - using the
	wrong sizeof operand meant that security manager private data
	was overlaying the allowDiskFormatProbing member of struct
	_virSecurityManager.  This reopens disk probing, which was
	supposed to be prevented by the solution to CVE-2010-2238.

	* src/security/security_manager.c
	(virSecurityManagerGetPrivateData): Use correct offset.

2011-06-02  Eric Blake  <eblake@redhat.com>

	tests: really fix QEMU XML-2-ARGV graphics-spice-timeout test
	Alas, /usr/bin/kvm is also not directly supported by testutilsqemu.c.

	In fact, _any_ test that uses <cpu match=...> has to use our faked
	qemu.sh in order to properly answer the 'qemu -cpu ?' probe done
	during qemu command line building.

	* tests/qemuxml2argvdata/*graphics-spice-timeout*: Switch emulator, again.

2011-06-02  Eric Blake  <eblake@redhat.com>

	build: avoid corrupting / in RHEL 5
	I noticed this while building from libvirt.git on RHEL 5.6:

	Generating internals/command.html.tmp
	mkdir: cannot create directory `/internals': Permission denied

	If I had been building as root instead, this pollutes /.

	Older autoconf lacks $(builddir), but it is rigorously equal to '.'
	in newer autoconf, so we could use '$(MKDIR_P) internals' instead.

	However, since internals/command.html is part of the tarball, we
	_already_ build it in $(srcdir), not $(builddir) during VPATH
	builds, so the mkdir is wasted effort!

	* docs/Makefile.am (internals/%.html.tmp): Drop unused mkdir.

2011-06-02  Jiri Denemark  <jdenemar@redhat.com>

	tests: Add a test for correct disk device ordering

	Fix order of disks and controllers
	Commit 2d6adabd53c8f1858191d521dc9b4948d1205955 replaced qsorting disk
	and controller devices with inserting them at the right position. That
	was to fix unnecessary reordering of devices. However, when parsing
	domain XML devices are just taken in the order in which they appear in
	the XML since. Use the correct insertion algorithm to honor device
	target.

2011-06-02  Matthias Bolte  <matthias.bolte@googlemail.com>

	Fix QEMU XML-2-ARGV graphics-spice-timeout test
	The test used an emulator that is not supported in testutilsqemu.c.
	Switch from qemu-kvm to kvm to fix this.

2011-06-01  Matthias Bolte  <matthias.bolte@googlemail.com>

	remote generator: Handle some virTypedParameterPtr using functions
	This doesn't cover the getters that allow to query nparams yet.

2011-06-01  Matthias Bolte  <matthias.bolte@googlemail.com>

	apibuild: Restrict long usage to existing functions and structs
	New APIs have to use long long instead of long.

	Also make apibuild errors fatal.

2011-06-01  Matthias Bolte  <matthias.bolte@googlemail.com>

	remote generator: Legacy support for hyper to long mappings
	Remove some special case code that took care of mapping hyper to the
	correct C types.

	As the list of procedures that is allowed to map hyper to long is fixed
	put it in the generator instead annotations in the .x files. This
	results in simpler .x file parsing code.

	Use macros for hyper to long assignments that perform overflow checks
	when long is smaller than hyper. Map hyper to long long by default.

	Suggested by Eric Blake.

2011-06-01  Daniel P. Berrange  <berrange@redhat.com>

	Remove call to deprecated gnutls_certificate_type_set_priority
	The gnutls_certificate_type_set_priority method is deprecated.
	Since we already set the default gnutls priority, and do not
	support OpenGPG credentials in any case, it was not serving
	any useful purpose and can be removed

	* src/remote/remote_driver.c: Remove src/remote/remote_driver.c
	  call

2011-06-01  Matthias Bolte  <matthias.bolte@googlemail.com>

	Use common parameter order for remote(De)SerializeTypedParameters
	We commonly use "value, length" order, let's stick to this.

	openvz: Add simple test for openvzReadNetworkConf
	Convert openvzLocateConfFile to a replaceable function pointer to
	allow testing the config file parsing without rewriting the whole
	OpenVZ config parsing to a more testable structure.

	openvz: Set virtType to openvz in openvzLoadDomains
	Otherwise virsh dumpxml will report <domain type='qemu'> instead
	of the expected <domain type='openvz'>.

2011-06-01  Osier Yang  <jyang@redhat.com>

	util: Fix incorrect error in PCI functions
	Substitute VIR_ERR_NO_SUPPORT with VIR_ERR_INTERNAL_ERROR. Error
	like following is not what user want to see.

	error : pciDeviceIsAssignable:1487 : this function is not supported
	by the connection driver: Device 0000:07:10.0 is behind a switch
	lacking ACS and cannot be assigned

2011-06-01  Eric Blake  <eblake@redhat.com>

	maint: use consistent file name for threading notes
	* daemon/THREADING.txt: Rename...
	* daemon/THREADS.txt: ...to match qemu thread notes.
	* daemon/Makefile.am (EXTRA_DIST): Reflect rename.

2011-06-01  Matthias Bolte  <matthias.bolte@googlemail.com>

	openvz: Restore original EOF handling in openvzGetProcessInfo
	This function is also affected by getline conversion. But this
	didn't result in a regression in general, because the difference
	would only affect the behavior of the function when the line in
	/proc/vz/vestat for the given vpsid wasn't found. Under normal
	conditions this should not happen.

2011-06-01  Matthias Bolte  <matthias.bolte@googlemail.com>

	openvz: Handle getline failures in openvzReadConfigParam properly
	The regression fix in 3aab7f2d6b068f0 altered the error handling.
	getline returns -1 on failure to read a line (including EOF). The
	original openvzReadConfigParam function using openvz_readline only
	treated EOF as not-found. The current getline version treats all
	getline failures as not-found.

	This patch fixes this and distinguishes EOF from other getline
	failures.

2011-06-01  Eric Blake  <eblake@redhat.com>

	* .gitignore: Exempt a new test binary.

2011-06-01  Cole Robinson  <crobinso@redhat.com>

	storage: List directory volumes for dir/fs/netfs pools
	Since directories can be used for <filesystem> passthrough, they are
	basically storage volumes.

	v2:
	    Skip ., .., lost+found dirs

	v3:
	    Use gnulib last_component

	v4:
	    Use gnulib "dirname.h", not system <dirname.h>
	    Don't skip lost+found

2011-05-31  Michal Privoznik  <mprivozn@redhat.com>

	tests: Add more complex domain scheme test data

	tests: Test for SPICE compression options
	and check regression

2011-05-31  Matthias Bolte  <matthias.bolte@googlemail.com>

	Ignore backward compatibility macros in apibuild.py
	This fixes this three warnings from the parser by allowing the parser
	to ignore some macros in the same way as it can ignore functions.

	Parsing ./../include/libvirt/libvirt.h
	Misformatted macro comment for _virSchedParameter
	 Expecting '* _virSchedParameter:' got '* virSchedParameter:'
	Misformatted macro comment for _virBlkioParameter
	 Expecting '* _virBlkioParameter:' got '* virBlkioParameter:'
	Misformatted macro comment for _virMemoryParameter
	 Expecting '* _virMemoryParameter:' got '* virMemoryParameter:'

2011-05-31  Michal Privoznik  <mprivozn@redhat.com>

	conf: Fix incorrect spice graphic XML format on compression options
	If spice graphics has no <channel> elements, the output graphics XML
	is messed up. To prevent this, we need to end the <graphics> element
	just before adding any compression selecting elements.

2011-05-31  Daniel P. Berrange  <berrange@redhat.com>

	Fix sysinfo/virsh build problems on Win32
	The virSysinfoIsEqual method was mistakenly inside a #ifndef WIN32
	conditional.

	The existing virSysinfoFormat is also stubbed out on Win32, even
	though the code works without any trouble. This breaks XML output
	on Win32, so the stub is removed.

	virsh migrate mistakenly had some variables inside the conditional

	* src/util/sysinfo.c: Build virSysinfoIsEqual on Win32 and remove
	  Win32 stub for virSysinfoFormat
	* tools/virsh.c: Fix variable declaration on Win32

2011-05-31  Jean-Baptiste Rouault  <jean-baptiste.rouault@diateam.net>

	openvz: fix bridge devices parsing in openvzReadNetworkConf()
	strchrnul() was called on the wrong string so it returned
	the same result for each iteration.

2011-05-31  Daniel P. Berrange  <berrange@redhat.com>

	Ensure hvsupport.html.in is built before HTML validation
	In a parallel make, HTML validation tries to run before
	hvsupport.html.in has been built.

	* docs/Makefile.am: List hvsupport.html.in as a built source

2011-05-31  Daniel P. Berrange  <berrange@redhat.com>

	Allow custom XML to be passed in during migration
	Update the qemuDomainMigrateBegin method so that it accepts
	an optional incoming XML document. This will be validated
	for ABI compatibility against the current domain config,
	and if this check passes, will be passed back out for use
	by the qemuDomainMigratePrepare method on the target

	* src/qemu/qemu_domain.c, src/qemu/qemu_domain.h,
	  src/qemu/qemu_migration.c: Allow custom XML to be passed

2011-05-31  Daniel P. Berrange  <berrange@redhat.com>

	Allow virsh to pass in a custom XML document for migration
	Switch virsh migrate over to use virDomainMigrate2 and
	virDomainMigrateToURI2. This is still compatible with
	older libvirts, because these methods dynamically choose
	whether to perform v1, v2 or v3 migration based on declared
	RPC support from the libvirtd instances

	Add a --xml arg which allows the user to pass in a custom
	XML document. This XML document must be ABI compatible
	with the current *live* XML document for the running guest
	on the source host. ABI compatibility will be enforced by
	any driver supporting this function

	* tools/virsh.c: Add '--xml' arg to migrate command

2011-05-31  Daniel P. Berrange  <berrange@redhat.com>

	Add an API for comparing the ABI of two guest configurations
	To allow a client app to pass in custom XML during migration
	of a guest it is neccessary to ensure the guest ABI remains
	unchanged. The virDomainDefCheckABIStablity method accepts
	two virDomainDefPtr structs and compares everything in them
	that could impact the guest machine ABI

	* src/conf/domain_conf.c, src/conf/domain_conf.h,
	  src/libvirt_private.syms: Add virDomainDefCheckABIStablity
	* src/conf/cpu_conf.c, src/conf/cpu_conf.h: Add virCPUDefIsEqual
	* src/util/sysinfo.c, src/util/sysinfo.h: Add virSysinfoIsEqual

2011-05-31  Daniel P. Berrange  <berrange@redhat.com>

	Remove unused 'target' field in virDomainHostdevDef
	The virDomainHostdevDef struct contains a 'char *target'
	field. This is set to 'NULL' when parsing XML and never
	used / set anywhere else. Clearly it is bogus & unused

	* src/conf/domain_conf.c, src/conf/domain_conf.h: Remove
	  target from virDomainHostdevDef

2011-05-31  Osier Yang  <jyang@redhat.com>

	lxc: Seperate domain config loading
	This patch seperate the domain config loading just as qemu driver
	does, first loading config of running or trasient domains, then
	of persistent inactive domains. And only try to reconnect the
	monitor of running domains, so that it won't always throws errors
	saying can't connect to domain monitor.

	And as "virDomainLoadConfig->virDomainAssignDef->virDomainObjAssignDef",
	already do things like "vm->newDef = def", removed the codes
	in "lxcReconnectVM" that does the same work.

2011-05-31  Matthias Bolte  <matthias.bolte@googlemail.com>

	Fix virTypedParameter alias comments
	Remove the Domain prefix from the comments.

	openvz: Automatically disable on non-Linux systems
	As OpenVZ is Linux specific.

2011-05-31  Markus Groß  <gross@univention.de>

	Support maximum and current memory flags in libxl driver
	Add support to set the maximum memory of the domain.
	Also add support to change the memory of the current
	state of the domain, which translates to a running
	domain or the config of the domain.

	Based on the code from the qemu driver.

2011-05-31  Markus Groß  <gross@univention.de>

	Add domainSave/Restore to libxl driver
	v3:
	* initialize xml pointer to avoid segfault
	* throw error message if domain is paused as
	  libxenlight itself will pause it

	v2:
	* header is now padded and has a version field
	* the correct restore function from libxl is used
	* only create the restore event once in libxlVmStart

2011-05-31  Markus Groß  <gross@univention.de>

	Add domainCoreDump to libxl driver
	v2:
	* incorporated Jim Fehlig's review

	Populate domid field of devices for libxenlight
	This patch fixes the population of the
	libxenlight data structures. Now the devices
	should be removed correctly from the xenstore
	if they are detached.

2011-05-29  Daniel P. Berrange  <berrange@redhat.com>

	Issue full error messages when processing QEMU monitor I/O
	Currently the QEMU monitor I/O handler code uses errno values
	to report errors. This results in a sub-optimal error messages
	on certain conditions, in particular when parsing JSON strings
	malformed data simply results in 'EINVAL'.

	This changes the code to use the standard libvirt error reporting
	APIs. The virError is stored against the qemuMonitorPtr struct,
	and when a monitor API is run, any existing stored error is copied
	into that thread's error local

	* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
	  src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_text.c: Use
	  virError APIs for all monitor I/O handling code

2011-05-29  Daniel P. Berrange  <berrange@redhat.com>

	Don't kill QEMU process when a monitor I/O parsing error occurs
	Currently whenever there is any failure with parsing the monitor,
	this is treated in the same was as end-of-file (ie QEMU quit).
	The domain is terminated, if not already dead.

	With this change, failures in parsing the monitor stream do not
	result in the death of QEMU. The guest continues running unchanged,
	but all further use of the monitor will be disabled.

	The VMM_FAILURE event will be emitted, and the mgmt application
	can decide when to kill/restart the guest to re-gain control

	* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Run a
	  different callback for monitor EOF vs error conditions.
	* src/qemu/qemu_process.c: Emit VMM_FAILURE event when monitor
	  fails

2011-05-29  Daniel P. Berrange  <berrange@redhat.com>

	Introduce a new event emitted when a virtualization failure occurs
	This introduces a new domain

	  VIR_DOMAIN_EVENT_ID_CONTROL_ERROR

	Which uses the existing generic callback

	typedef void (*virConnectDomainEventGenericCallback)(virConnectPtr conn,
	                                                     virDomainPtr dom,
	                                                     void *opaque);

	This event is intended to be emitted when there is a failure in
	some part of the domain virtualization system. Whether the domain
	continues to run/exist after the failure is an implementation
	detail specific to the hypervisor.

	The idea is that with some types of failure, hypervisors may
	prefer to leave the domain running in a "degraded" mode of
	operation. For example, if something goes wrong with the QEMU
	monitor, it is possible to leave the guest OS running quite
	happily. The mgmt app will simply loose the ability todo various
	tasks. The mgmt app can then choose how/when to deal with the
	failure that occured.
	* daemon/remote.c: Dispatch of new event
	* examples/domain-events/events-c/event-test.c: Demo catch
	  of event
	* include/libvirt/libvirt.h.in: Define event ID and callback
	* src/conf/domain_event.c, src/conf/domain_event.h: Internal
	  event handling
	* src/remote/remote_driver.c: Receipt of new event from daemon
	* src/remote/remote_protocol.x: Wire protocol for new event
	* src/remote_protocol-structs: add new event for checks

2011-05-29  Eric Blake  <eblake@redhat.com>

	sched: provide new API shims for remaining drivers
	Well, the remaining drivers that already had the get/set
	scheduler parameter functionality to begin with.

	For now, this blindly treats VIR_DOMAIN_SCHEDINFO_CURRENT as
	the only supported operation for these 5 domains; it will
	take domain-specific patches if more specific behavior is
	preferred.

	* src/esx/esx_driver.c (esxDomainGetSchedulerParameters)
	(esxDomainSetSchedulerParameters): Move guts...
	(esxDomainGetSchedulerParametersFlags)
	(esxDomainSetSchedulerParametersFlags): ...to new functions.
	* src/libxl/libxl_driver.c (libxlDomainGetSchedulerParameters)
	(libxlDomainSetSchedulerParameters)
	(libxlDomainGetSchedulerParametersFlags)
	(libxlDomainSetSchedulerParametersFlags): Likewise.
	* src/lxc/lxc_driver.c (lxcGetSchedulerParameters)
	(lxcSetSchedulerParameters, lxcGetSchedulerParametersFlags)
	(lxcSetSchedulerParametersFlags): Likewise.
	* src/test/test_driver.c (testDomainGetSchedulerParams)
	(testDomainSetSchedulerParams, testDomainGetSchedulerParamsFlags)
	(testDomainSetSchedulerParamsFlags): Likewise.
	* src/xen/xen_driver.c (xenUnifiedDomainGetSchedulerParameters)
	(xenUnifiedDomainSetSchedulerParameters)
	(xenUnifiedDomainGetSchedulerParametersFlags)
	(xenUnifiedDomainSetSchedulerParametersFlags): Likewise.

2011-05-29  Eric Blake  <eblake@redhat.com>

	virsh: improve schedinfo querying ability
	Since we can now set just --live or --config, we also need to be
	able to query that back.

	In the case of setting both --live and --config, it shouldn't matter
	which value we read back; otherwise, since querying treats the two
	flags as mutually exclusive, so does this patch.

	* tools/virsh.c (cmdSchedinfo): Use new API where appropriate.

2011-05-29  Eric Blake  <eblake@redhat.com>

	remote: introduce remoteGetSchedulerParametersFlags
	* daemon/remote.c (remoteDispatchDomainGetSchedulerParameters):
	New function.
	* src/remote/remote_driver.c (remoteDomainGetSchedulerParameters):
	Likewise.
	* src/remote/remote_protocol.x
	(remote_domain_get_scheduler_parameters_flags_args)
	(remote_domain_get_scheduler_parameters_flags_ret): New types.
	(remote_procedure): New RPC.
	* src/remote_protocol-structs: Likewise.

	qemu: introduce qemuGetSchedulerParametersFlags
	* src/qemu/qemu_driver.c (qemuGetSchedulerParameters): Move
	guts...
	(qemuGetSchedulerParametersFlags): ...to new callback, and honor
	flags more accurately.

2011-05-29  Eric Blake  <eblake@redhat.com>

	sched: introduce virDomainGetSchedulerParametersFlags
	If we can choose live or config when setting, then we need to
	be able to choose which one we are querying.

	Also, make the documentation clear that set must use a non-empty
	subset (some of the hypervisors fail if params is NULL).

	* include/libvirt/libvirt.h.in
	(virDomainGetSchedulerParametersFlags): New prototype.
	* src/libvirt.c (virDomainGetSchedulerParametersFlags): Implement
	it.
	* src/libvirt_public.syms: Export it.
	* python/generator.py (skip_impl): Don't auto-generate.
	* src/driver.h (virDrvDomainGetSchedulerParametersFlags): New
	callback.

2011-05-29  Eric Blake  <eblake@redhat.com>

	remote: consolidate typed parameter handling
	* src/remote/remote_protocol.x (remote_typed_param_value)
	(remote_typed_param):  New types.
	(remote_sched_param_value, remote_sched_param)
	(remote_blkio_param_value, remote_blkio_param)
	(remote_memory_param_value, remote_memory_param): Delete.
	(remote_domain_get_scheduler_parameters_ret)
	(remote_domain_set_scheduler_parameters_args)
	(remote_domain_set_scheduler_parameters_flags_args)
	(remote_domain_set_blkio_parameters_args)
	(remote_domain_get_blkio_parameters_ret)
	(remote_domain_set_memory_parameters_args)
	(remote_domain_get_memory_parameters_ret): Update clients.
	* src/remote_protocol-structs: Likewise.
	* src/remote/remote_driver.c (remoteSerializeTypedParameters)
	(remoteDeserializeTypedParameters): New functions.
	(remoteDomainSetMemoryParameters)
	(remoteDomainGetMemoryParameters, remoteDomainSetBlkioParameters)
	(remoteDomainGetBlkioParameters)
	(remoteDomainGetSchedulerParameters)
	(remoteDomainSetSchedulerParameters)
	(remoteDomainSetSchedulerParametersFlags): Update clients.
	* daemon/remote.c (remoteSerializeTypedParameters)
	(remoteDeserializeTypedParameters): New functions.
	(remoteDispatchDomainGetSchedulerParameters)
	(remoteDispatchDomainSetSchedulerParameters)
	(remoteDispatchDomainSetSchedulerParametersFlags)
	(remoteDispatchDomainSetMemoryParameters)
	(remoteDispatchDomainGetMemoryParameters)
	(remoteDispatchDomainSetBlkioParameters)
	(remoteDispatchDomainGetBlkioParameters): Update clients.

2011-05-29  Eric Blake  <eblake@redhat.com>

	maint: prefer newer API names internally
	Rather mechanical in nature.

	* src/driver.h: Use newer virTypedParameter API names.
	* src/libvirt.c: Likewise.
	* daemon/remote.c: Likewise.
	* src/esx/esx_driver.c: Likewise.
	* src/libxl/libxl_driver.c: Likewise.
	* src/lxc/lxc_driver.c: Likewise.
	* src/qemu/qemu_driver.c: Likewise.
	* src/remote/remote_driver.c: Likewise.
	* src/test/test_driver.c: Likewise.
	* src/xen/xen_driver.c: Likewise.
	* src/xen/xen_hypervisor.c: Likewise.
	* src/xen/xen_hypervisor.h: Likewise.
	* src/xen/xend_internal.c: Likewise.
	* tools/virsh.c: Likewise.

2011-05-29  Eric Blake  <eblake@redhat.com>

	libvirt.h: avoid regression, and document preferred name
	Commit 824dcaff was a regression (thankfully unreleased) for any
	client code that used 'struct _virSchedParameter' directly rather
	than the preferred virSchedParameter typedef.  Adding a #define
	avoids even that API change, while rearranging the file makes it
	clear what the old vs. new API is.

	* include/libvirt/libvirt.h.in: Rearrange older names to the
	bottom and improve documentation on preferred names.
	(virDomainGetSchedulerParameters, virDomainSetSchedulerParameters)
	(virDomainSetSchedulerParametersFlags)
	(virDomainSetBlkioParameters, virDomainGetBlkioParameters)
	(virDomainSetMemoryParameters, virDomainGetMemoryParameters):
	Use newer type names.
	* python/libvirt-override.c: Adjust code generation to cope.
	Suggested by Daniel P. Berrange.

2011-05-29  Daniel Veillard  <veillard@redhat.com>

	Fix a make check error
	Apparently introdunced in commit 376e1d9420b
	the generator produces u_int flags not unsigned int flags.

	* src/remote_protocol-structs: fix to the actual expected type and
	  alignment

2011-05-29  Richard Laager  <rlaager@wiktel.com>

	Fix virExecWithHook Prototype
	This was necessary to get libvirt to build on Solaris 11 Express and
	seems correct (as it makes this match the definition in util.c):

2011-05-28  Stefan Berger  <stefanb@us.ibm.com>

	nwfilter: reorder locks
	This patch reorders the locks for the nwfilter updates and the access
	the nwfilter objects. In the case that the IP address learning thread
	was instantiating filters while an update happened, the previous order
	lead to a deadlock.

2011-05-28  Laine Stump  <laine@laine.org>

	interface: reformat error logs
	It was suggested during review of a different patch that the libvirt
	interface driver API's should have "netcf:" in their log
	messages. This patch eliminates that from all interface driver API
	functions, and also eliminates the extra " - " in the case that netcf
	returns no details in its error info (which *never* happens at
	present, but could happen sometime in the future.

2011-05-28  Michal Privoznik  <mprivozn@redhat.com>

	interface: implement a test driver for network config transaction API.

	interface: Implement driver methods for network config transaction API
	This is the functionality at the end of the libvirt part of the call
	chain - for each function, the corresponding netcf API is called.

	interface: expose network config transaction API to virsh
	This implements the commands iface-begin, iface-commit, and iface-rollback,
	which simply call the corresponding functions in the libvirt API.

	interface: implement remote protocol for network config transaction API

	interface: implement public APIs for libvirt transactional network changes

	interface: define internal driver API for network config transactions

2011-05-28  Michal Privoznik  <mprivozn@redhat.com>

	interface: new public API for network config change transactions
	This is the API agreed on in:

	  https://www.redhat.com/archives/libvir-list/2011-May/msg00026.html

	(with a slight name change to use "...begin" rather than
	"...start"). This implements transactional changes to the host network
	config. When a transaction is begun with ncf_change_begin(), all other
	netcf APIs will continue to work as they always have, but a snapshot
	of the existing config will be taken, allowing reversion (rollback,
	using ncf_change_rollback()) to the exact state of config at the time
	ncf_change_begin() was called. Alternately, if it's determined that
	the new changes are acceptable, ncf_change_commit() can be called,
	which will eliminate the snapshot and make the changes permanent.

	As a failsafe measure, if neither ncf_change_commit() or
	ncf_change_rollback() is called by the next time the system reboots,
	the netcf-transaction initscript will be automatically called to
	rollback the changes.

2011-05-27  Matthias Bolte  <matthias.bolte@googlemail.com>

	openvz: Fix regression in openvzGetVPSUUID
	Commit f044376530f313a replaced openvz_readline with getline and
	changed EOF-handling in the openvzGetVPSUUID.

	This patch restores original EOF-handling.

	Reported by Jean-Baptiste Rouault.

2011-05-27  Matthias Bolte  <matthias.bolte@googlemail.com>

	Add sexpr.c to the list of file with translatable messages
	This should have been in the last commit.

	sexpr: Improve serialization error reporting

	Fix build with --with-driver-modules enabled
	Export a bunch of missing symbols and link the remote driver to gnulib.

2011-05-27  Hu Tao  <hutao@cn.fujitsu.com>

	qemu: implement the new flags for setting memory parameters
	* src/qemu/qemu_driver.c: update qemuDomainSetMemoryParameters to
	  look at the flag parameter and depending on it save the config
	  or the live amount

	qemu: implement the new flags for getting memory parameters
	* src/qemu/qemu_driver.c: update qemuDomainGetMemoryParameters to
	  look at the flag parameter and depending on it read the config
	  or the live amount

2011-05-27  Hu Tao  <hutao@cn.fujitsu.com>

	Add new flags for setting memory parameters
	The new flags allow to pick current state, config or the live
	parameter, with current being the existing API default (0).
	This also hooks this to --config, --live, --current parameters for
	the memtune virsh command

	* include/libvirt/libvirt.h.in: defines the new flags
	* tools/virsh.c: adds support at virsh level
	* tools/virsh.pod: updates virsh documentation

2011-05-27  KAMEZAWA Hiroyuki  <kamezawa.hiroyu@jp.fujitsu.com>

	qemu : support persistent add/delete network interface
	This patch allows to modify interfaces of domain(qemu)
	* src/conf/domain_conf.c src/conf/domain_conf.h src/libvirt_private.syms:
	  (virDomainNetInsert)     : Insert a network device to domain definition.
	  (virDomainNetIndexByMac) : Returns an index of net device in array.
	  (virDomainNetRemoveByMac): Remove a NIC of passed MAC address.
	* src/qemu/qemu_driver.c
	  (qemuDomainAttachDeviceConfig): add codes for NIC.
	  (qemuDomainDetachDeviceConfig): add codes for NIC.

2011-05-27  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Fix regression in absolute file name handling
	Before commit 145d6cb05c45f4 (in August 2010) absolute file names
	in VMX and domain XML configs were handled correctly. But this got
	lost during the refactoring. The test cases didn't highlight this
	problem because they have their own set of file name handling
	functions. The actual ones require a real connection to an ESX
	server. Also the test case functions always worked correctly.

	Fix the regression and add a new in-the-wild VMX file that contains
	such a problematic absolute path. Even though this test case won't
	protect against new regressions.

	Reported by lofic (IRC nick)

2011-05-27  Matthias Bolte  <matthias.bolte@googlemail.com>

	openvz: Add simple testcase for config file parsing function
	This testcase passes before the regression is added in f0443765, fails
	after that commit and passes again after the regression was fixed.

2011-05-27  Hu Tao  <hutao@cn.fujitsu.com>

	don't check flags in virDomainSetSchedulerParametersFlags
	drivers implementing domainSetSchedulerParametersFlags should check
	flags themselves.

2011-05-27  Taisuke Yamada  <tai@rakugaki.org>

	openvz: Fix regression in config file parsing
	As reported by Diego Blanco in

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

	commit f0443765 which replaced openvz_readline to getline(3)
	broke OpenVZ driver as it changed semantics of EOF-handling
	when parsing OpenVZ configuration.

	There're several other issues reported with current OpenVZ driver:

	 #1: unclear error message when parsing "CPUS=" line
	 #2: openvz driver goes into crashing loop
	 #3: "NETIF=" line in configuration is not parsed correctly
	 #4: aborts even when optional parameter is missing
	 #5: there's a potential memory leak

	This updated patch to fix #[145]. This patch does not fix #[23]
	as I haven't verified these yet, but this at least got me to run
	OpenVZ on libvirt once again.

2011-05-27  Eric Blake  <eblake@redhat.com>

	audit: fix minor off-by-one
	Coverity spotted this off-by-one.  Thankfully, no one in libvirt
	was ever calling virAuditSend with an argument of 3.

	* src/util/virtaudit.c (virAuditSend): Use correct comparison.

2011-05-27  Federico Simoncelli  <fsimonce@redhat.com>

	qemu: allow blkstat/blkinfo calls during migration
	Originally most of libvirt domain-specific calls were blocking
	during a migration.
	A new mechanism to allow specific calls (blkstat/blkinfo) to be
	executed in such condition has been implemented.
	In the long term it'd be desirable to get a more general
	solution to mark further APIs as migration safe, without needing
	special case code.

	 * src/qemu/qemu_migration.c: add some additional job signal
	   flags for doing blkstat/blkinfo during a migration
	 * src/qemu/qemu_domain.c: add a condition variable that can be
	   used to efficiently wait for the migration code to clear the
	   signal flag
	 * src/qemu/qemu_driver.c: execute blkstat/blkinfo using the
	   job signal flags during migration

2011-05-26  Markus Groß  <gross@univention.de>

	Add disk attach/detach support to libxl driver
	Based on the device attach/detach code from the QEMU driver,
	but using the new functions to create the structures associated.
	* src/libxl/libxl_driver.c: implements domainAttachDevice,
	  domainAttachDeviceFlags, domainDetachDevice, domainDetachDeviceFlags
	  and domainUpdateDeviceFlags

	Fix libxl vm def handling on domU cleanup
	* src/libxl/libxl_driver.c: in libxlVmCleanup, free up the
	  newDef definition if present overwise it would be leaked.

2011-05-26  Markus Groß  <gross@univention.de>

	Refactored libxl datastructure instantiation
	Create 3 new function refactored from previous list ones and
	exports them internally to the driver

	* src/libxl/libxl_conf.c src/libxl/libxl_conf.h: create libxlMakeDisk,
	  libxlMakeNic libxlMakeVfb out of the exsting static List functions
	  and exports them

2011-05-26  Markus Groß  <gross@univention.de>

	Fix modifying disk devices in qemu driver
	When modifying the disk devices of a live domain and the domain
	configuration, the function qemuDomainAttachDeviceConfig
	first sets dev->data->disk to NULL. Later qemuDomainAttachDeviceLive
	accesses dev->data.disk and causes a segfault.
	* src/qemu/qemu_driver.c: fix qemuDomainModifyDeviceFlags() accordingly

2011-05-26  Michal Privoznik  <mprivozn@redhat.com>

	schema: Add graphics element passwdValidTo attribute to schema
	We support this in code, but forgot to add this to RNG schema as well.
	According to documentation, the value match the dateTime type.

2011-05-26  Eric Blake  <eblake@redhat.com>

	build: fix 'make dist' for ./configure --without-remote
	Anything generated that must end up in the tarball must either
	have unconditional rules for generation (remote_protocol.c) or
	must live in libvirt.git for the case where the person running
	'make dist' has disabled the configure options that control the
	rebuild of the generated file (remote_protocol-structs).

	* src/Makefile.am (remote_protocol-structs): Add a dependency and
	document why it must live in git.
	($(srcdir)/remote/%_protocol.c, $(srcdir)/remote/%_protocol.c):
	Unconditionally generate.

2011-05-26  Richard W.M. Jones  <rjones@redhat.com>

	json: Avoid passing large positive 64 bit integers to QMP.
	http://lists.gnu.org/archive/html/qemu-devel/2011-05/threads.html#02162

	Currently, qemu silently clips any JSON integer in the range
	0x8000000000000000 - 0xffffffffffffffff (all numbers in this range
	will be clipped to 0x7fffffffffffffff == LLONG_MAX).

	To avoid this, pass these as signed 64 bit integers in the QMP
	request.

2011-05-26  Matthias Bolte  <matthias.bolte@googlemail.com>

	Fix sign mismatches between public API, driver API and XDR protocol
	In most cases this affects flags parameters that are unsigned in the
	public and driver API but signed in the XDR protocol. Switch the
	XDR protocol to unsigned for those.

	A counterexample is virNWFilterGetXMLDesc. Its flags parameter is signed
	in the public API and XDR protocol, but unsigned in the driver API.

2011-05-26  Matthias Bolte  <matthias.bolte@googlemail.com>

	remote generator: Fix XDR sign mismatch for virNodeGet(Cells)FreeMemory
	virNodeGetFreeMemory used unsigned long long in the public API but
	signed hyper in the XDR protocol. Convert the XDR protocol to use
	unsigned hyper.

	As explained by Eric before, this doesn't affect the on-the-wire protocol.

2011-05-26  Matthias Bolte  <matthias.bolte@googlemail.com>

	remote generator: Handle stream-using functions
	Extend procedure annotation in the .x file for stream handling.

	Adds a missing remoteStreamRelease call to remoteDomainScreenshot
	error path.

2011-05-26  Matthias Bolte  <matthias.bolte@googlemail.com>

	remote generator: Make call-by-reference handling stricter
	Several functions return values by reference parameters. This is realized
	by passing the members of remote_CALL_ret by reference to the called
	function.

	The position of this parameters in the function signature follows some
	patterns with some exceptions. This patterns and exceptions are hardcoded
	in the generator.

	Add an insert@<offset> annotation to the remote_CALL_ret struct members
	for functions that return lists to remove some of the hardcoded patterns
	and exceptions.

2011-05-26  Matthias Bolte  <matthias.bolte@googlemail.com>

	remote generator: Rename virNodeGetCellsFreeMemory parameters to common pattern
	This allows to remove some special case code from the generator.

	remote generator: Handle virDomainCreateWithFlags
	Add special case code for updating a given domain object instead of
	returning a new one.

	virsh: time_t is not a long on FreeBSD
	localtime_r expects time_t.

	time_t is not a long on FreeBSD, switch internal type to long long

	Allow to explicitly disable the secrets a directory storage driver

2011-05-26  Eric Blake  <eblake@redhat.com>

	build: avoid strerror_r pitfalls
	In particular, this guarantees that virStrerror always gives a
	useful result.

	* .gnulib: Update to latest, for (lots of) strerror_r fixes.

2011-05-25  Daniel P. Berrange  <berrange@redhat.com>

	Fix the signature of virDomainMigrateFinish3 for error reporting
	The current virDomainMigrateFinish3 method signature attempts to
	distinguish two types of errors, by allowing return with ret== 0,
	but ddomain == NULL, to indicate a failure to start the guest.
	This is flawed, because when ret == 0, there is no way for the
	virErrorPtr details to be sent back to the client.

	Change the signature of virDomainMigrateFinish3 so it simply
	returns a virDomainPtr, in the same way as virDomainMigrateFinish2
	The disk locking code will protect against the only possible
	failure mode this doesn't account for (loosing conenctivity to
	libvirtd after Finish3 starts the CPUs, but before the client
	sees the reply for Finish3).

	* src/driver.h, src/libvirt.c, src/libvirt_internal.h: Change
	  virDomainMigrateFinish3 to return a virDomainPtr instead of int
	* src/remote/remote_driver.c, src/remote/remote_protocol.x,
	  daemon/remote.c, src/qemu/qemu_driver.c, src/qemu/qemu_migration.c:
	  Update for API change

2011-05-25  Daniel P. Berrange  <berrange@redhat.com>

	Fix preservation of errors across migration steps
	When doing migration, if an error occurs in Perform, it must not
	be overwritten during Finish/Confirm steps. If an error occurs
	in Finish, it must not be overwritten in Confirm.

	Previous commit a9d12c2444e43a0d3e5135eb15b4b62a7c011427 added
	code to qemudDomainMigrateFinish2 to preserve the error. This
	is not the right place, because it is not applicable in non-p2p
	migration. The src/libvirt.c virDomainMigrateV2/3 methods need
	code to preserve errors for non-p2p migration, while the
	doPeer2PeerMigrate2 and doPeer2PeerMigrate3 methods contain
	code to preverse errors for p2p migration.

	Remove the bogus error preservation from qemudDomainMigrateFinish2
	and qemudDomainMigrateFinish3.

	Fix virDomainMigrateV3 and doPeer2PeerMigrate3 so that they
	preserve any error hit during the Finish3 step, before invoking
	Confirm3.

	Finally if qemuMigrationFinish fails to resume the CPUs, it must
	preserve the error before tearing down the VM, so that VM cleanup
	doesn't overwrite it.

	* src/libvirt.c: Preserve error before invoking Confirm3
	* src/qemu/qemu_driver.c: Remove bogus error preservation
	  code in qemudDomainMigrateFinish2/qemudDomainMigrateFinish3
	* src/qemu/qemu_migration.c: Preserve error before invoking Confirm3
	  and after resume fails in qemuMigrationFinish.

2011-05-25  Daniel P. Berrange  <berrange@redhat.com>

	Improve debug logging of migration APIs
	* src/libvirt.c: Add further debug lines in helper APIs for
	  migration
	* src/qemu/qemu_migration.c: Add debug lines for all internal
	  migration API parameters

2011-05-25  Daniel P. Berrange  <berrange@redhat.com>

	Fix error propagation in finish method for v3 migration
	Even when failing to start CPUs, the finish method was returning
	a success result. Fix this so that the QEMU process is killed
	off when finish fails under v3 protocol. Also rename the
	killOnFinish boolean to 'v3proto' to make it clearer that this
	is a tunable based on the migration protocol version

	* src/qemu/qemu_driver.c: Update for API change
	* src/qemu/qemu_migration.c, src/qemu/qemu_migration.h: Kill
	  VM in qemuMigrationFinish if failing to start CPUs

2011-05-25  Daniel P. Berrange  <berrange@redhat.com>

	Fix SPICE seamless migration hostname
	The SPICE seamless migration process requires data to be passed
	back from the target host, to the source host via a cookie.
	The cookie includes the target host's hostname, but this was not
	stored, merely validated. This patch explicitly records the
	remote hostname after parsing the cookie, and uses it when
	initiating the SPICE migration

	* qemu/qemu_migration.c: Fix SPICE seamless migration hostname

2011-05-25  Daniel P. Berrange  <berrange@redhat.com>

	Fix resume on destination when doing non-live tunnelled migration
	Before running perform in peer-2-peer migration, the current
	guest state must be recorded, so that non-live migration can
	currently unpause a running guest on completion.

	* src/qemu/qemu_migration.c: Move check for offline guest
	  to fix non-live migration

2011-05-25  Daniel P. Berrange  <berrange@redhat.com>

	Introduce two method migration APIs
	There are two pieces of information which are desirable for
	migration, which cannot be supplied by applications

	 - The explicit QEMU migration URI, while using Peer2Peer
	   migration
	 - An override for the target VM XML

	This introduces two new public APIs to support these extra
	parameters. There is no need for extra wire protocool changes,
	since this is supported by the v3 migration enhancements

	* include/libvirt/libvirt.h.in,
	  src/libvirt.c, src/libvirt_public.syms: Add virDomainMigrate2
	  and virDomainMigrateToURI2

2011-05-25  Daniel P. Berrange  <berrange@redhat.com>

	Add a second URI parameter to virDomainMigratePerform3 method
	The virDomainMigratePerform3 currently has a single URI parameter
	whose meaning varies. It is either

	 - A QEMU migration URI (normal migration)
	 - A libvirtd connection URI (peer2peer migration)

	Unfortunately when using peer2peer migration, without also
	using tunnelled migration, it is possible that both URIs are
	required.

	This adds a second URI parameter to the virDomainMigratePerform3
	method, to cope with this scenario. Each parameter how has a fixed
	meaning.

	NB, there is no way to actually take advantage of this yet,
	since virDomainMigrate/virDomainMigrateToURI do not have any
	way to provide the 2 separate URIs

	* daemon/remote.c, src/remote/remote_driver.c,
	  src/remote/remote_protocol.x, src/remote_protocol-structs: Add
	  the second URI parameter to perform3 message
	* src/driver.h, src/libvirt.c, src/libvirt_internal.h: Add
	  the second URI parameter to Perform3 method
	* src/libvirt_internal.h, src/qemu/qemu_migration.c,
	  src/qemu/qemu_migration.h: Update to handle URIs correctly

2011-05-25  Daniel P. Berrange  <berrange@redhat.com>

	Extend v3 migration protocol to allow app supplied XML for target
	This extends the v3 migration protocol such that the
	virDomainMigrateBegin3 and virDomainMigratePerform3
	methods accept an application supplied XML config for
	the target VM.

	If the 'xmlin' parameter is NULL, then Begin3 uses the
	current guest XML as normal. A driver implementing the
	Begin3 method should either reject all non-NULL 'xmlin'
	parameters, or strictly validate that the app supplied
	XML does not change guest ABI.

	The Perform3 method also needed the xmlin parameter to
	cope with the Peer2Peer migration sequence.

	NB it is not yet possible to use this capability since
	neither of the public virDomainMigrate/virDomainMigrateToURI
	methods have a way to pass in XML.

	* daemon/remote.c, src/remote/remote_driver.c,
	  src/remote/remote_protocol.x, src/remote_protocol-structs:
	  Add 'remote_string xmlin' parameter to begin3/perform3
	  RPC messages
	* src/libvirt.c, src/driver.h, src/libvirt_internal.h: Add
	  'const char *xmlin' parameter to Begin3/Perform3 methods
	* src/qemu/qemu_driver.c, src/qemu/qemu_migration.c,
	  src/qemu/qemu_migration.h: Pass xmlin parameter around
	  migration methods

2011-05-25  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Report an error when auth pointer is missing instead of declining
	Otherwise an attempt to use virConnectOpen or virConnectOpenAuth without
	auth pointer results in the driver declining the URI and libvirt falling
	back to the remote driver for an esx:// URI.

2011-05-25  Jim Fehlig  <jfehlig@novell.com>

	Fix initialization of current vcpus in libxl driver
	The cur_vcpus member of struct libxl_domain_build_info was incorrectly
	initialized to the number of vcpus, when it should have been interpreted
	as a bitmap, where bit X corresponds to online/offline status of vcpuX.

	To complicate matters, cur_vcpus is an int, so only 32 vcpus can be
	set online.  Add a check to ensure vcpus does not exceed this limit.

	V2: Eric Blake noted a compilation pitfal when '1 << 32' on an int.
	    Account for vcpus == 32.

2011-05-25  Eric Blake  <eblake@redhat.com>

	build: fix VIR_DEBUG on mingw
	We don't use the gnulib vsnprintf replacement, which means that
	on mingw, vsnprintf doesn't support %zn or %lln.

	And as it turns out, VIR_GET_VAR_STR was a rather inefficient
	reimplementation of virVasprintf logic.

	* src/util/logging.c (VIR_GET_VAR_STR): Drop.
	(virLogMessage): Inline a simpler version here.
	* src/util/virterror.c (VIR_GET_VAR_STR, virRaiseErrorFull):
	Likewise.
	Reported by Matthias Bolte.

2011-05-24  Michal Privoznik  <mprivozn@redhat.com>

	qemu: Don't change ownership of file when appending to it
	Saving domain to previously created file changes also its ownership.
	This is certainly not what users want if some conditions are met:
	it is a regular, local file and dynamic_ownership is off.

2011-05-24  Daniel P. Berrange  <berrange@redhat.com>

	Fix accidental revert of .gnulib update
	Change f88af9dc16cf891f88bb925885bdf5e328cf44df accidentally
	reverted the .gnulib update from f3cfc99e794bd77479878fc224c6581b61d57dbd

	* .gnulib: Update to 2c25c9ebe8db1415bfde25f0a451767332c8cf59

2011-05-24  Laine Stump  <laine@laine.org>

	qemu: fix typo in name - should be VHOST_NET, not VNET_HOST
	NB: the enum that uses the string vnet-host (now changed to vhost-net)
	is used in XML, but fortunately that hasn't been in an official
	release yet, so it can still be fixed.

2011-05-24  Daniel P. Berrange  <berrange@redhat.com>

	Fix QEMU -vnc arg generation with raw IPv6 addresses
	Since -vnc uses ':' to separate the address from the port, raw
	IPv6 addresses need to be escaped like [addr]:port

	* src/qemu/qemu_command.c: Escape raw IPv6 addresses with []
	* tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc.args,
	  tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc.xml: Tweak
	  to test Ipv6 escaping
	* docs/schemas/domain.rng: Allow Ipv6 addresses, or hostnames
	  in <graphics> listen attributes

2011-05-24  Daniel P. Berrange  <berrange@redhat.com>

	Fix peer2peer migration with transient VMs
	The qemuMigrationConfirm method shouldn't deal with final VM
	cleanup, since it can be called from the peer2peer migration,
	which expects to still use the 'vm' object afterwards.

	Push the cleanup code out of qemuMigrationConfirm, into its
	caller, qemuDomainMigrateConfirm3

	* src/qemu/qemu_driver.c: Add VM cleanup code to
	  qemuDomainMigrateConfirm3
	* src/qemu/qemu_migration.c, src/qemu/qemu_migration.h: Remove
	  job handling cleanup from qemuMigrationConfirm

2011-05-24  Daniel P. Berrange  <berrange@redhat.com>

	Perform feature flag compat checking in QEMU migration cookies
	To allow new mandatory migration cookie data to be introduced,
	add support for checking supported feature flags when parsing
	migration cookie.

	* src/qemu/qemu_migration.c: Feature flag checking in migration
	  cookie parsing

2011-05-24  Jiri Denemark  <jdenemar@redhat.com>

	Replace all remaining setgid/setuid calls with virSetUIDGID
	Two additional places need initgroups call to properly work in an
	environment where the UID is allowed to open/create stuff through its
	supplementary groups.

	util: Keep errno set to the root error after when returning from virSetUIDGID

2011-05-24  Michal Privoznik  <mprivozn@redhat.com>

	python: Don't free must-not-free variables
	py_str() function call PyString_AsString(). As written in documentation,
	the caller must not free the returned value, because it points to some
	internal structures.

	storage: Add comment to picking return value of qemu-img
	Commit d7b2679253504d6defa9fc7159b572cfd6a25a95 introduced
	a return value picking of qemu-img on '-h', but without any comment.

2011-05-24  Alon Levy  <alevy@redhat.com>

	spice: support streaming-video parameter
	This adds a streaming-video=filter|all|off attribute. It is used to change
	the behavior of video stream detection in spice, the default is filter (the
	default for libvirt is not to specify it - the actual default is defined in
	libspice-server.so).

	Usage:

	    <graphics type='spice' autoport='yes'>
	      <streaming mode='off'/>
	    </graphics>

	Tested with the above and with tests/qemuxml2argvtest.

2011-05-24  Stefan Berger  <stefanb@us.ibm.com>

	nwfilter: enable filtering of gratuitous ARP packets
	This patch enables filtering of gratuitous ARP packets using the following XML:

	<rule action='accept' direction='in' priority='425'>
	<arp gratuitous='true'/>
	</rule>

2011-05-24  Laine Stump  <laine@laine.org>

	qemu: don't require is_kvm for vhost-net support
	This was discussed in:

	  https://www.redhat.com/archives/libvir-list/2011-May/msg01370.html

	The capabilities code only sets the flag to allow use of vhost-net if
	kvm is detected (set if the help string contains "(qemu-kvm-" or
	"(kvm-"), but actually vhost-net is available in some qemu builds that
	don't have kvm in their name, so just checking for ",vhost=" is enough.

2011-05-24  Doug Goldstein  <cardoe@cardoe.com>

	Use per-user TLS certificates when possible
	When using TLS authentication and operating as the non-root user,
	initially attempt to use that specific user's TLS certificates before
	attempting to use the system wide TLS certificates.

2011-05-23  Michal Privoznik  <mprivozn@redhat.com>

	python: Fix typo in bindings
	This typo caused a bug in which we wanted to free() invalid pointer.

	storage: pick return value of qemu-img
	qemu-img returns non-zero status on -h. Therefore we need to
	provide virCommandRun() a non-NULL exit status pointer.

2011-05-22  Wen Congyang  <wency@cn.fujitsu.com>

	build: generate files when building without libvirtd
	Steps to reproduce this problem:
	1. # ./autogen.sh --without-libvirtd
	2. # make dist
	   ...
	   make[1]: Entering directory `/home/wency/source/libvirt-nodaemon/daemon'
	   make[1]: *** No rule to make target `remote_dispatch_prototypes.h', needed by `distdir'.  Stop.
	   make[1]: Leaving directory `/home/wency/source/libvirt-nodaemon/daemon'
	   make: *** [distdir] Error 1

2011-05-21  Osier Yang  <jyang@redhat.com>

	docs: Fix error syntax of vcpupin example XML
	Lacks of "/", push this directly in trivial rule.

2011-05-21  Matthias Bolte  <matthias.bolte@googlemail.com>

	remote generator: Add special case for virConnectGetType

2011-05-20  Richard W.M. Jones  <rjones@redhat.com>

	libvirt.spec: /var/cache/libvirt should be 0711.
	This allows qemu to create files in /var/cache/libvirt/qemu/, and
	specifically is required to fix virDomainMemoryPeek.

	remote: remove bogus virDomainFree.

2011-05-20  Richard W.M. Jones  <rjones@redhat.com>

	qemudDomainMemoryPeek: change ownership/selinux label on temporary file.
	Otherwise qemu is unable to write to it, with the error:

	libvir: QEMU error : internal error unable to execute QEMU command 'memsave': Could not open '/var/cache/libvirt/qemu/qemu.mem.RRNvLv'

2011-05-20  Matthias Bolte  <matthias.bolte@googlemail.com>

	remote generator: Don't rely on $_ being stable over a large function
	Replace $calls{$_} with $call in the dispatch bodies generator function.

	No functional change included.

2011-05-20  Eric Blake  <eblake@redhat.com>

	build: require newer gettext
	Now that RHEL 5.6 ships with gettext 0.17, we can get out of the
	stone age and use the newer gettext capabilities and improved
	macros for certain configure tests.

	* configure.ac (AM_GNU_GETTEXT_VERSION): Bump to 0.17.
	(MKINSTALLDIRS): Delete hack that is no longer needed.
	* bootstrap.conf (buildreq): Check for minimum gettext version.
	Based on a report by Wen Congyang.

2011-05-20  Supriya Kannery  <supriyak@in.ibm.com>

	virsh: Use Env variables for debug level and logfile
	Use variables VIRSH_DEBUG and VIRSH_LOG_FILE for controlling virsh logging.

2011-05-19  Daniel P. Berrange  <berrange@redhat.com>

	Don't generate cookies with v2 migration protocol.
	The v2 migration protocol had a limit on cookie length that was
	too small to be useful for QEMU. Avoid generating cookies with
	v2 protocol, so that old libvirtd can still reliably migrate a
	guest to new libvirtd uses v2 protocol.

	* src/qemu/qemu_driver.c: Avoid migration cookies with v2
	  migration

2011-05-19  Daniel P. Berrange  <berrange@redhat.com>

	Fix QEMU migration cookie crash for guests with no graphics
	When generating a cookie for a guest with no data, the
	QEMU_MIGRATION_COOKIE_GRAPHICS flag was set even if no
	graphics data was added. Avoid setting the flag unless
	it was needed, also add a safety check for mig->graphics
	being non-NULL

	* src/qemu/qemu_migration.c: Avoid cookie crash for guest
	  with no graphics

2011-05-19  Daniel P. Berrange  <berrange@redhat.com>

	Ensure p2p and direct migration use the new v3 protocol if available
	The internal virDomainMigratePeer2Peer and virDomainMigrateDirect
	helper methods were not checking whether the target supports the
	v3 migration protocol.

	* src/libvirt.c: Use v3 migration protocol for p2p/direct
	  migration if available.

2011-05-19  Daniel P. Berrange  <berrange@redhat.com>

	Blank out the 'listenAddr' parameter if empty string
	Some bogus apps are generating a VNC/SPICE/RFB listen attribute
	with no content. This then causes a failure with the graphics
	migration cookie parsing. Blank out the 'listenAddr' parameter
	after parsing domain XML if it is the empty string, so the host
	default takes over

	* src/qemu/qemu_migration.c: Blank out listenAddr parameter
	  if empty

2011-05-19  Eric Blake  <eblake@redhat.com>

	remote: remove special case for getting version
	The on-the-wire protocol is identical; XDR guarantees that
	both 'hyper' and 'unsigned hyper' are transmitted as 8 bytes.

	* src/remote/remote_protocol.x (remote_get_version_ret)
	(remote_get_lib_version_ret): Match public API.
	* daemon/remote_generator.pl: Drop special case.
	* src/remote_protocol-structs: Reflect updated type.

2011-05-19  Eric Blake  <eblake@redhat.com>

	build: silence clang false positive
	Clang couldn't quite see that the same condition of
	(flags & VIR_DOMAIN_MEM_CONFIG) is used twice, such that
	the second block is guaranteed that def was assigned in
	the first block.

	* src/libxl/libxl_driver.c (libxlDomainSetMemoryFlags): Add a hint
	for clang.

2011-05-19  Eric Blake  <eblake@redhat.com>

	virsh: optimize creation of default connection
	Ramon de Carvalho Valle reported a problem with:
	virsh connect qemu:///system
	as a non-root user.  The real root problem appears to be a regression
	in libvirtd being auto-started on the default qemu:///session URI;
	however, the symptom points to an independent flaw in virsh - we
	shouldn't be wasting efforts on making a connection if we aren't going
	to be using that connection.  Fixing virsh avoids Ramon's issue, while
	I work in the meantime to fix the real libvirtd regression.

	This patch looks big, but that's because 'gcc -Wmissing-field-initializers'
	gets triggered by './autobuild.sh --enable-compile-warnings=error', so I
	had to add 0 initialization to everyone (rather than my preference of
	just adding the non-zero flags to virshCmds and to cmdConnect).

	Meanwhile, if you use 'virsh -c URI', the connection must succeed; this
	patch _only_ optimizes the default connection to be deferred to a later
	point where we know if a particular command to be run needs a connection.

	* tools/virsh.c (VSH_CMD_FLAG_NOCONNECT): New flag.
	(vshCmdDef): Add new flags field.
	(vshCommandRun): Honor new flag.
	(domManagementCmds, domMonitoringCmds, storagePoolCmds)
	(storageVolCmds, networkCmds, nodedevCmds, ifaceCmds)
	(nwfilterCmds, secretCmds, virshCmds, snapshotCmds)
	(hostAndHypervisorCmds): Populate new field.
	(vshReconnect): Don't warn on initial connection.

2011-05-19  Matthias Bolte  <matthias.bolte@googlemail.com>

	Improve invalid argument checks for the public API

2011-05-19  Matthias Bolte  <matthias.bolte@googlemail.com>

	Clarify that virDomainGet(Memory|Blkio)Parameters doesn't support subsets
	Improve invalid argument checks in the size query case. The drivers already
	relied on this unchecked behavior.

	Relax the implementation of virDomainGet(Memory|Blkio)MemoryParameters
	in the drivers and allow to pass more memory than necessary for all
	parameters.

2011-05-19  Matthias Bolte  <matthias.bolte@googlemail.com>

	Clarify that virDomainSet(Memory|Blkio)Parameters can take parameter subsets

2011-05-19  Matthias Bolte  <matthias.bolte@googlemail.com>

	Clarify that virDomainSetSchedulerParameters(Flags) can take subsets
	Add invalid argument checks for params and nparams to the public API
	and remove them from the drivers (e.g. xend).

	Add subset handling to libxl and test drivers.

2011-05-19  Matthias Bolte  <matthias.bolte@googlemail.com>

	Clarify the semantic of virDomainGetSchedulerParameters arguments
	params and nparams are essential and cannot be NULL. Check this in
	libvirt.c and remove redundant checks from the drivers (e.g. xend).

	Instead of enforcing that nparams must point to exact same value as
	returned by virDomainGetSchedulerType relax this to a lower bound
	check. This is what some drivers (e.g. xen hypervisor and esx)
	already did. Other drivers (e.g. xend) didn't check nparams at all
	and assumed that there is enough space in params.

	Unify the behavior in all drivers to a lower bound check and update
	nparams to the number of valid values in params on success.

2011-05-19  Matthias Bolte  <matthias.bolte@googlemail.com>

	Clarify semantic of nparams argument of virDomainGetSchedulerType
	Some drivers assumed it can be NULL (e.g. qemu and lxc) and check it
	before assigning to it, other drivers assumed it must be non-NULL
	(e.g. test and esx) and just assigned to it.

	Unify this to nparams being optional and document it.

2011-05-18  Cole Robinson  <crobinso@redhat.com>

	Fix messages using VIR_ERR_XML_ERROR
	This error code has existed since the dawn of time, yet the messages it
	generates are almost universally busted. Here's a small sampling:

	src/conf/domain_conf.c:4889 : XML description for missing root element is not well formed or invalid
	src/conf/domain_conf.c:4951 : XML description for unknown device type is not well formed or invalid
	src/conf/domain_conf.c:5460 : XML description for maximum vcpus must be an integer is not well formed or invalid
	src/conf/domain_conf.c:5468 : XML description for invalid maxvcpus %(count)lu is not well formed or invalid

	Fix up the error code to instead be

	XML error: <msg>

	Adjust the few locations that were using the original correctly (or shouldn't
	have been using the error code at all).

	v2:
	    Fix wording of error code without a passed argument

2011-05-18  Eric Blake  <eblake@redhat.com>

	libvirt.h: consolidate typed parameter handling
	The new type is identical to the three old types that it replaces,
	and by creating a common type, this allows future patches to share
	common code that manipulates typed parameters.

	This change is backwards-compatible in API (recompilation works
	without any edits) and ABI (an older client that has not been
	recompiled uses the same layout) for code using only public
	names; only code using private names (those beginning with _)
	will have to adapt.

	* include/libvirt/libvirt.h.in (virTypedParameterType)
	(VIR_TYPED_PARAM_FIELD_LENGTH, _virTypedParameter): New enum,
	macro, and type.
	(virSchedParameter, virBlkioParameter, virMemoryParameter):
	Rewrite in terms of a common type, while keeping all old public
	names for backwards compatibility.
	(struct _virSchedParameter, struct _virBlkioParameter)
	(struct _virMemoryParameter): Delete - these are private names.
	* python/generator.py (enum): Cope with the refactoring.

2011-05-18  Eric Blake  <eblake@redhat.com>

	build: update to latest gnulib
	* .gnulib: Update, for bootstrap and other fixes.
	* bootstrap: Resynchronize with gnulib.

2011-05-18  Dirk Herrendorefer  <d.herrendoerfer@herrendoerfer.name>

	Add support for 'passthru' mode for direct network interfaces
	starting with kernel 2.6.38 macvtap supports a 'passthru' mode for
	attaching virtual functions of a SRIOV capable network card directly to a VM.
	This patch adds the capability to configure such a device.

2011-05-18  Michal Privoznik  <mprivozn@redhat.com>

	qemu: fix typo in spice migration code
	This typo caused XPath returning improper value and thus not
	working spice after migration.

2011-05-18  Hu Tao  <hutao@cn.fujitsu.com>

	virsh: add parameters --live, --config and --current to cmd schedinfo
	This enables user to modify cpu.shares even when domain is inactive.

	remote: introduce remoteSetSchedulerParametersFlags
	support for virDomainSetSchedulerParametersFlags of remote driver.

	qemu: introduce qemuSetSchedulerParametersFlags
	Support for virDomainSetSchedulerParametersFlags of qemu driver.

2011-05-18  Eric Blake  <eblake@redhat.com>

	sched: adjust parameter values to make current = 0
	See virDomainMemoryModFlags for precedent.

	* include/libvirt/libvirt.h.in (virDomainSchedParameterFlags): Set
	CURRENT as a synonym to 0.

2011-05-17  Hu Tao  <hutao@cn.fujitsu.com>

	introduce virDomainSetSchedulerParametersFlags
	This new function allows aditional flags to be passed into from
	the virsh command line.

2011-05-17  Eric Blake  <eblake@redhat.com>

	build: drop unused <sys/syslimits.h> header
	<sys/syslimits.h> is not standardized, so portable programs should
	not need to rely on it.  If there really is something that we need
	where <sys/syslimits.h> provided the limit but <limits.h> did not,
	then that would be a candidate for fixing in gnulib.  But this patch
	did not turn up any compilation failures on Linux.

	* src/internal.h (includes): Drop unused header.
	* daemon/libvirtd.h (includes): Likewise.
	* configure.ac (AC_CHECK_HEADERS): Likewise.
	Based on a report by Matthias Bolte.

2011-05-17  Daniel P. Berrange  <berrange@redhat.com>

	Fix prototype of virRun for Win32 targets
	* src/util/util.c: Fix virRun prototype

2011-05-17  Eric Blake  <eblake@redhat.com>

	build: tolerate unlimited group size
	POSIX allows sysconf(_SC_GETPW_R_SIZE_MAX) to return -1 if there
	is no fixed limit, and requires ERANGE errors to track real size.
	Model our behavior after the example in POSIX itself:
	http://pubs.opengroup.org/onlinepubs/9699919799/functions/getpwuid_r.html

	Also, on error for get*_r functions, errno is undefined, and the
	real error was the return value.

	* src/util/util.c (virGetUserEnt, virGetUserID, virGetGroupID)
	(virSetUIDGID):  Cope with sysconf failure or too small buffer.
	Reported by Matthias Bolte.

2011-05-17  Eric Blake  <eblake@redhat.com>

	openvz: fix logic bug in previous patch
	We want to free names on failure, not on success.

	* src/openvz/openvz_driver.c (openvzListDefinedDomains): Use
	correct condition.

2011-05-17  Cole Robinson  <crobinso@redhat.com>

	storage_backend: Convert virRunWithHook usage to virCommand
	virRunWithHook is now unused, so we can drop it. Tested w/ raw + qcow2
	volume creation and copying.

	v2:
	    Use opaque data to skip hook second time around
	    Simply command building

	v3:
	    Drop explicit FindFileInPath

2011-05-17  Cole Robinson  <crobinso@redhat.com>

	storage_backend: Fix error reporting with regex helper
	Some clients overwrite the error from the regex helper, or do half-baked
	error reporting with the exitstatus.

	storage: Covert regex helpers to virCommand
	v2:
	    Simplify command creation
	    Add a missing virCommandFree
	    Use virCommand auto-cleanup for async process

2011-05-17  Cole Robinson  <crobinso@redhat.com>

	openvz: Convert virExec usage to virCommand
	v2:
	    Use virCommand's autocleanup

	v3:
	    Don't free 'names' on success

2011-05-17  Cole Robinson  <crobinso@redhat.com>

	storage: iscsi: Convert virExec to virCommand
	v2:
	    Use virCommand auto-cleanup

2011-05-17  Matthias Bolte  <matthias.bolte@googlemail.com>

	Fix error reporting in stream creation code
	virStreamNew needs to dispatch the error that virGetStream reports
	on failure.

	remoteCreateClientStream can fail due to virStreamNew or due to
	VIR_ALLOC. Report OOM error for VIR_ALLOC failure to report errors
	in all error cases.

	Remove OOM error reporting from remoteCreateClientStream callers.

2011-05-17  Matthias Bolte  <matthias.bolte@googlemail.com>

	remote generator, client: Add more special case handling
	For virDomainDestroy and virDrvSupportsFeature.

	remote generator, client: Handle functions that return an optional string

	esx: Simplify some esxVI_Boolean to bool

	esx: Convert autoAnswer from esxVI_Boolean to a simple bool
	Just true/false is good enough for it. Also use it directly from the
	parsed URI instead of caching it in esxPrivate.

2011-05-17  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Fix race condition in esxVI_EnsureSession
	When the session has expired then multiple threads can race while
	reestablishing it.

	This race condition is not that critical as it requires a special usage
	pattern to be triggered. It can only happen when an application doesn't
	do API calls for quite some time (the session expires after 30 min
	inactivity) and then multiple threads doing simultaneous API calls and
	end up doing simultaneous calls to esxVI_EnsureSession.

2011-05-17  Jiri Denemark  <jdenemar@redhat.com>

	virsh: Correctly initialize libvirt
	virsh didn't call virInitialize(), which (among other things)
	initializes virLastErr thread local variable. As a result of that, virsh
	could just segfault in virEventRegisterDefaultImpl() since that is the
	first call that touches (resets) virLastErr.

	I have no idea what lucky coincidence made this bug visible but I was
	able to reproduce it in 100% cases but only in one specific environment
	which included building in sandbox.

2011-05-17  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Whitespace cleanup in the generator
	Break long lines and change spacing of keyword arguments to match
	Python style standards better.

	No functional change included.

2011-05-17  Daniel P. Berrange  <berrange@redhat.com>

	Fix leak of mime type string in screenshot dispatcher
	* daemon/remote.c: Free mime string

2011-05-17  Daniel P. Berrange  <berrange@redhat.com>

	Remove obsolete remoteDispatchOOMError method
	No new code should be using remoteDispatchOOMError()

	* daemon/dispatch.c, daemon/dispatch.h: Remove remoteDispatchOOMError

2011-05-17  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Change some alignments in the input file
	No functional change included.

	esx: Change generated method parameter autobinding
	Instead of specifying the type of the managed object directly specify
	the ServiceContent member name. This way the mapping dictionary can be
	removed.

2011-05-17  Daniel P. Berrange  <berrange@redhat.com>

	Fix remote dispatcher for screenshot command
	* daemon/remote.c: Update screenshot dispatcher to follow
	  standard practice

2011-05-17  Matthias Bolte  <matthias.bolte@googlemail.com>

	virsh: Report an error when virGetUserDirectory fails
	Otherwise virsh shows the interactive greeting and then silently exists
	instead of entering interactive mode.

2011-05-17  Eric Blake  <eblake@redhat.com>

	maint: mark more perl scripts executable
	* src/remote/rpcgen_fix.pl: Add executable bit.
	* tests/oomtrace.pl: Likewise.

	maint: mark perl script executable
	* docs/hvsupport.pl: Add execute bit.

2011-05-16  Eric Blake  <eblake@redhat.com>

	maint: ignore generated file
	* .gitignore: Ignore recently added file.

2011-05-16  Daniel P. Berrange  <berrange@redhat.com>

	Add missing initialization to 'ret' in qemu migration
	* src/qemu/qemu_migration.c: Add missing 'ret' initializer
	  in qemuMigrationCookieXMLParseStr

2011-05-16  Daniel P. Berrange  <berrange@redhat.com>

	Disable virCommandExec on Win32
	Mingw execve() has a broken signature. Disable this
	function until gnulib fixes the signature, since we
	don't really need this on Win32 anyway.

	* src/util/command.c: Disable virCommandExec on Win32

2011-05-16  Daniel P. Berrange  <berrange@redhat.com>

	Improve error message when XDR marshalling fails
	When failing to marshall an XDR message, include the
	full program/version/status/proc/type info, to allow
	easier debugging & diagnosis of the problem.

	* src/remote/remote_driver.c: Improve error when marshalling
	  fails

2011-05-16  Daniel P. Berrange  <berrange@redhat.com>

	Run tunnelled migration IO in separate thread
	By running the doTunnelSendAll code in a separate thread, the
	main thread can do qemuMigrationWaitForCompletion as with
	normal migration. This in turn ensures that job signals work
	correctly and that progress monitoring can be done

	* src/qemu/qemu_migration.c: Run tunnelled migration in
	  separate thread

2011-05-16  Daniel P. Berrange  <berrange@redhat.com>

	Don't overwrite error when stream send fails
	virStreamSend already sets an error message, so don't
	overwrite it

	* src/qemu/qemu_migration.c: Remove bogus error report

2011-05-16  Daniel P. Berrange  <berrange@redhat.com>

	Close all sockets before cancelling QEMU migration
	Cancelling the QEMU migration may cause QEMU to flush pending
	data on the migration socket. This may in turn block QEMU if
	nothing reads from the other end of the socket. Closing the
	socket before cancelling QEMU migration avoids this possible
	deadlock.

	* src/qemu/qemu_migration.c: Close sockets before cancelling
	  migration on failure

2011-05-16  Daniel P. Berrange  <berrange@redhat.com>

	Ensure we always read a full buffer in tunnelled migration
	The 'nbytes' variable was not re-initialized to the
	buffer size on each iteration of the tunnelled migration
	loop. While saferead() will ensure a full read, except
	on EOF, it is clearer to use the real buffer size

	* src/qemu/qemu_migration.c: Always read full buffer of data

2011-05-16  Daniel P. Berrange  <berrange@redhat.com>

	Make tunnelled migration honour resource restriction
	The doTunnelMigrate method forgot to set the bandwidth
	resource restriction

	* src/qemu/qemu_migration.c: Set resource restriction

2011-05-16  Daniel P. Berrange  <berrange@redhat.com>

	Refactor migration completion loop to allow code reuse
	The qemuMigrationWaitForCompletion method contains a loop which
	repeatedly queries QEMU to check migration progress, and also
	processes job signals (pause, setspeed, setbandwidth, cancel).

	The tunnelled migration loop does not currently support this
	functionality, but should. Refactor the code to allow it to
	be used with tunnelled migration.

2011-05-16  Daniel P. Berrange  <berrange@redhat.com>

	Implement migration v3 protocol in QEMU driver
	Implement the v3 migration protocol, which has two extra
	steps, 'begin' on the source host and 'confirm' on the
	source host. All other methods also gain both input and
	output cookies to allow bi-directional data passing at
	all stages.

	The QEMU peer2peer migration method gains another impl
	to provide the v3 migration. This finally allows migration
	cookies to work with tunnelled migration, which is required
	for Spice seamless migration & the lock manager transfer

	* src/qemu/qemu_driver.c: Wire up migrate v3 APIs
	* src/qemu/qemu_migration.c, src/qemu/qemu_migration.h: Add
	  begin & confirm methods, and peer2peer impl of v3

2011-05-16  Daniel P. Berrange  <berrange@redhat.com>

	Merge tunnel & non-tunnel migration impl into one
	Merge the doNonTunnelMigrate2 and doTunnelMigrate2 methods
	into one doPeer2PeerMigrate2 method, since they are substantially
	the same. With the introduction of v3 migration, this will be
	even more important, to avoid massive code duplication.

	* src/qemu/qemu_migration.c: Merge tunnel & non-tunnel migration

2011-05-16  Daniel P. Berrange  <berrange@redhat.com>

	Fix VM teardown if prepare returns invalid URI in v2 migration
	The v2 migration protocol was accidentally missing out the
	finish step, when prepare succeeded, but returned an invalid
	URI

	* src/libvirt.c: Teardown VM if prepare returns invalid URI

2011-05-16  Daniel P. Berrange  <berrange@redhat.com>

	Refactor tunnelled migration methods
	To facilitate the introduction of the v3 migration protocol,
	the doTunnelMigrate method is refactored into two pieces. One
	piece is intended to mirror the flow of virDomainMigrateVersion2,
	while the other is the helper for setting up sockets and processing
	the data.

	Previously socket setup would be done before the 'prepare' step,
	so errors could be dealt with immediately, avoiding need to shut
	off the destination QEMU. In the new split, socket setup is done
	after the 'prepare' step. This is not a serious problem, since
	the control flow already requires calling 'finish' to tear down
	the destination QEMU upon several errors.

	* src/qemu/qemu_migration.c:

2011-05-16  Daniel P. Berrange  <berrange@redhat.com>

	Wire up SPICE client relocation with QEMU migration
	Use the graphics information from the QEMU migration cookie to
	issue a 'client_migrate_info' monitor command to QEMU. This causes
	the SPICE client to automatically reconnect to the target host
	when migration completes

	* src/qemu/qemu_migration.c: Set data for SPICE client relocation
	  before starting migration on src
	* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
	  src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h,
	  src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h: Add
	  new qemuMonitorGraphicsRelocate() command

2011-05-16  Daniel P. Berrange  <berrange@redhat.com>

	Pass graphics setup from dst back to src via migration cookies
	Extend the QEMU migration cookie structure to allow information
	about the destination host graphics setup to be passed by to
	the source host. This will enable seamless migration of any
	connected graphics clients

	* src/qemu/qemu_migration.c: Add graphics info to migration
	  cookies
	* daemon/libvirtd.c: Always initialize gnutls to enable
	  x509 cert parsing in QEMU

2011-05-16  Daniel P. Berrange  <berrange@redhat.com>

	Introduce migration cookies to QEMU driver
	The migration protocol has support for a 'cookie' parameter which
	is an opaque array of bytes as far as libvirt is concerned. Drivers
	may use this for passing around arbitrary extra data they might
	need during migration. The QEMU driver needs to do a few things:

	 - Pass hostname/uuid to allow strict protection against localhost
	   migration attempts
	 - Pass SPICE/VNC server port from the target back to the source to
	   allow seamless relocation of client sessions
	 - Pass lock driver state from source to destination

	This patch introduces the basic glue for handling cookies
	but only includes the host/guest UUID & name.

	* src/libvirt_private.syms: Export virXMLParseStrHelper
	* src/qemu/qemu_migration.c, src/qemu/qemu_migration.h: Parsing
	  and formatting of migration cookies
	* src/qemu/qemu_driver.c: Pass in cookie parameters where possible
	* src/remote/remote_protocol.h, src/remote/remote_protocol.x: Change
	  cookie max length to 16384 bytes

2011-05-16  Daniel P. Berrange  <berrange@redhat.com>

	Fix locking with qemuMigrationPrepareTunnel method
	The qemuMigrationPrepareTunnel method should not unlock the
	qemu driver, since that is the caller's job.

	* src/qemu/qemu_migration.c: Fix qemuMigrationPrepareTunnel
	  unlocking of QEMU driver

2011-05-16  Daniel P. Berrange  <berrange@redhat.com>

	Remote driver implementation of new migration API
	* src/remote/remote_protocol.x: Define wire protocol for migration
	  protocol v3
	* daemon/remote.c: Server side dispatch
	* src/remote/remote_driver.c: Client side serialization
	* src/remote/remote_protocol.c, src/remote/remote_protocol.h,
	  daemon/remote_dispatch_args.h, daemon/remote_dispatch_prototypes.h,
	  daemon/remote_dispatch_ret.h, daemon/remote_dispatch_table.h:
	  Re-generate files
	* src/remote_protocol-structs: Declare new ABIs

2011-05-16  Daniel P. Berrange  <berrange@redhat.com>

	Introduce yet another migration version in API.
	Migration just seems to go from bad to worse. We already had to
	introduce a second migration protocol when adding the QEMU driver,
	since the one from Xen was insufficiently flexible to cope with
	passing the data the QEMU driver required.

	It turns out that this protocol still has some flaws that we
	need to address. The current sequence is

	 *  Src: DumpXML
	          - Generate XML to pass to dst

	 *  Dst: Prepare
	          - Get ready to accept incoming VM
	          - Generate optional cookie to pass to src

	 *  Src: Perform
	          - Start migration and wait for send completion
	          - Kill off VM if successful, resume if failed

	 *  Dst: Finish
	          - Wait for recv completion and check status
	          - Kill off VM if unsuccessful

	The problems with this are:

	 - Since the first step is a generic 'DumpXML' call, we can't
	   add in other migration specific data. eg, we can't include
	   any VM lease data from lock manager plugins
	 - Since the first step is a generic 'DumpXML' call, we can't
	   emit any 'migration begin' event on the source, or have
	   any hook that runs right at the start of the process
	 - Since there is no final step on the source, if the Finish
	   method fails to receive all migration data & has to kill
	   the VM, then there's no way to resume the original VM
	   on the source

	This patch attempts to introduce a version 3 that uses the
	improved 5 step sequence

	 *  Src: Begin
	          - Generate XML to pass to dst
	          - Generate optional cookie to pass to dst

	 *  Dst: Prepare
	          - Get ready to accept incoming VM
	          - Generate optional cookie to pass to src

	 *  Src: Perform
	          - Start migration and wait for send completion
	          - Generate optional cookie to pass to dst

	 *  Dst: Finish
	          - Wait for recv completion and check status
	          - Kill off VM if failed, resume if success
	          - Generate optional cookie to pass to src

	 *  Src: Confirm
	          - Kill off VM if success, resume if failed

	The API is designed to allow both input and output cookies
	in all methods where applicable. This lets us pass around
	arbitrary extra driver specific data between src & dst during
	migration. Combined with the extra 'Begin' method this lets
	us pass lease information from source to dst at the start of
	migration

	Moving the killing of the source VM out of Perform and
	into Confirm, means we can now recover if the dst host
	can't successfully Finish receiving migration data.

2011-05-16  Daniel P. Berrange  <berrange@redhat.com>

	Automatically generate the hvsupport.html.in file from source files
	The hvsupport.html.in file is forever out of date. By annotating
	the driver struct tables in each driver with version information,
	we can auto-generate the hvsupport.html.in file. Annotating the
	drivers will be mandatory for new patches, ensuring hvsupport.html.in
	is never out of date again.

	* docs/hvsupport.html.in: Delete
	* hvsupport.pl: Script to generate hvsupport.html.in
	* Makefile.am: Autogenerate hvsupport.html.in

2011-05-16  Daniel P. Berrange  <berrange@redhat.com>

	Add many version number annotations to drivers
	Add many version number annotations to the internal driver
	tables, to allow hvsupport.html to display more accurate
	information

2011-05-16  Daniel P. Berrange  <berrange@redhat.com>

	Convert all driver struct intializers to C99 style
	Change all the driver struct initializers to use the
	C99 style, leaving out unused fields. This will make
	it possible to add new APIs without changing every
	driver. eg change:

	    qemudDomainResume, /* domainResume */
	    qemudDomainShutdown, /* domainShutdown */
	    NULL, /* domainReboot */
	    qemudDomainDestroy, /* domainDestroy */

	to

	    .domainResume = qemudDomainResume,
	    .domainShutdown = qemudDomainShutdown,
	    .domainDestroy = qemudDomainDestroy,

	And get rid of any existing C99 style initializersr which
	set NULL, eg change

	     .listPools          = vboxStorageListPools,
	     .numOfDefinedPools  = NULL,
	     .listDefinedPools   = NULL,
	     .findPoolSources    = NULL,
	     .poolLookupByName   = vboxStoragePoolLookupByName,

	to

	     .listPools          = vboxStorageListPools,
	     .poolLookupByName   = vboxStoragePoolLookupByName,

2011-05-16  Daniel P. Berrange  <berrange@redhat.com>

	Tweak driver naming for consistency with public API
	Fix some driver names:

	  s/virDrvCPUCompare/virDrvCompareCPU/
	  s/virDrvCPUBaseline/virDrvBaselineCPU/
	  s/virDrvQemuDomainMonitorCommand/virDrvDomainQemuMonitorCommand/
	  s/virDrvSecretNumOfSecrets/virDrvNumOfSecrets/
	  s/virDrvSecretListSecrets/virDrvListSecrets/

	And some driver struct field names:

	  s/getFreeMemory/nodeGetFreeMemory/

2011-05-16  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Update domain state when reconnecting monitor
	A qemu domain can get paused when libvirtd is stopped (e.g., because of
	I/O error) so we should check its current state when reconnecting to it.

2011-05-16  Jiri Denemark  <jdenemar@redhat.com>

	Implement domain state reason
	Only in drivers which use virDomainObj, drivers that query hypervisor
	for domain status need to be updated separately in case their hypervisor
	supports this functionality.

	The reason is also saved into domain state XML so if a domain is not
	running (i.e., no state XML exists) the reason will be lost by libvirtd
	restart. I think this is an acceptable limitation.

2011-05-16  Jiri Denemark  <jdenemar@redhat.com>

	Implement basic virDomainGetState in all drivers
	Reason is currently always set to 0 (i.e., *_UNKNOWN).

	virsh: Prefer virDomainGetState over virDomainGetInfo

	Wire protocol format and remote driver for virDomainGetState

	virDomainGetState public API implementation

	Internal driver API for virDomainGetState

	virDomainGetState public API
	This API is supposed to replace virDomainGetInfo when the only purpose
	of calling it is getting current domain status.

2011-05-14  Eric Blake  <eblake@redhat.com>

	phyp: avoid a crash
	This has been present since the introduction of phypAttachDevice
	in commit 444fd07a.

	* src/phyp/phyp_driver.c (phypAttachDevice): Don't dereference
	NULL.

2011-05-14  Eric Blake  <eblake@redhat.com>

	stream: avoid use-after-free
	virFDStreamClose used a mutex after it was freed, and failed
	to destroy that mutex on its last use.

	* src/fdstream.c (virFDStreamFree): Inline into sole caller...
	(virFDStreamClose): ...to avoid use-after-free and leak.
	Reported by Matthias Bolte.

2011-05-14  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Refactor common code in the generator
	Move common code from Property and Parameter into new Member class.

	Rename the other base class to Type.

2011-05-14  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Improve dynamic cast detection in the generator
	Detect it based on usage as parameter, return type and member of other
	object types.

	esx: Improve list usage detection in the generator
	Detect it based on usage as parameter and return type too.

	esx: Remove 1000 lines of generated but unused code
	Don't make all object and enum types (de)serializable by default.
	Detect this from the input file instead.

	esx: Generate implicit _this macros
	Several vSphere API methods are called on global objects like the
	FileManager, the PerformanceManager or the SearchIndex. The generator
	input file allows to mark such methods and the generator generates
	such method in a way that automatically handles marked parameter. This
	is done by some special macros. Those were manually written and this
	patch moves them to the generator.

2011-05-14  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Move the Event type from the VI generator to manually written code
	Accept all types on deserialization in order to accept all Event subtypes.

	This will be used for the upcoming domain event support.

2011-05-14  Wen Congyang  <wency@cn.fujitsu.com>

	test: all test_scripts should be part of tarball when building without libvirtd
	Steps to reproduce this problem:
	1. # ./autogen.sh --without-libvirtd
	2. # make dist
	3. # rpmbuild --nodeps --define "_sourcedir `pwd`" -ba libvirt.spec
	   ...
	   make  check-TESTS
	   make[1]: Entering directory `/home/wency/rpmbuild/BUILD/libvirt-0.9.1/tests'
	   make[1]: *** No rule to make target `test_conf.sh', needed by `check-TESTS'.  Stop.
	   make[1]: Leaving directory `/home/wency/rpmbuild/BUILD/libvirt-0.9.1/tests'
	   make: *** [check-am] Error 2
	   error: Bad exit status from /var/tmp/rpm-tmp.7Rb9PV (%check)

	build: probes.d and libvirtd.stp should be part of tarball
	Steps to reproduce this problem:
	1. # ./autogen.sh --without-libvirtd
	2. # make dist
	3. # rpmbuild --nodeps --define "_sourcedir `pwd`" -ba libvirt.spec
	   ...
	   make[2]: Entering directory `/home/wency/rpmbuild/BUILD/libvirt-0.9.1/daemon'
	   make[2]: *** No rule to make target `probes.d', needed by `probes.h'.  Stop.
	   make[2]: Leaving directory `/home/wency/rpmbuild/BUILD/libvirt-0.9.1/daemon'
	   make[1]: *** [all-recursive] Error 1
	   make[1]: Leaving directory `/home/wency/rpmbuild/BUILD/libvirt-0.9.1'
	   make: *** [all] Error 2
	   error: Bad exit status from /var/tmp/rpm-tmp.WkAD7a (%build)

2011-05-14  Matthias Bolte  <matthias.bolte@googlemail.com>

	command: Fix compilation on FreeBSD
	kill, SIGTERM and SIGKILL require additional header.

	virsh: Fix uninitialized variable warning
	Reported on FreeBSD only.

	apparmor: Fix compilation by removing remains from virCommand conversion
	Commit aaf20355b87d3bfda7579a7f6a4a978e848635c3 was incomplete here and
	missed to remove some parts.

	configure: Fix mpath check on non-Linux systems

2011-05-14  Cole Robinson  <crobinso@redhat.com>

	remote: Convert SSH tunnel to virCommand

	storage: Convert qemu-img -help parsing to virCommand

	apparmor: Convert virExec usage to virCommand
	Untested

2011-05-14  Cole Robinson  <crobinso@redhat.com>

	util: Combine __virExec and virExecWithHook
	All callers were expecting argv logging, so the split is unneeded.

	v2:
	    Reindent new virExecWithHook call

2011-05-14  Cole Robinson  <crobinso@redhat.com>

	remote_driver: Convert virExecDaemonize usage to virCommand
	And drop the now unused virExecDaemonize

2011-05-14  Eric Blake  <eblake@redhat.com>

	remote: keep 'make check' happy
	* src/remote_protocol-structs (remote_domain_screenshot_args): Use
	spelling preferred by dwarves.

	libxl: fix typos in previous patch
	* src/libxl/libxl_driver.c (libxlDomainEventFlush, libxlShutdown)
	(libxlStartup): Fix typos.

2011-05-13  Cole Robinson  <crobinso@redhat.com>

	remote: Use virDomainEventState helpers
	One functionality change here is that we no longer force enable the event
	timeout for every queued event, only enable it for the first event after
	the queue has been flushed. This is how other drivers have already done it,
	and I haven't encountered problems in practice.

	v3:
	    Adjust for new virDomainEventStateNew argument

2011-05-13  Cole Robinson  <crobinso@redhat.com>

	libxl: Convert to virDomainEventState

	test: Use virDomainEventState helpers
	v3:
	    Adjust for new virDomainEventStateNew argument

	lxc: Use virDomainEventState helpers
	v3:
	    Adjust for new virDomainEventStateNew argument

2011-05-13  Cole Robinson  <crobinso@redhat.com>

	qemu: Use virDomainEventState helpers
	v2:
	    Drop libvirt_private.syms changes

	v3:
	    Adjust for new virDomainEventStateNew argument

2011-05-13  Cole Robinson  <crobinso@redhat.com>

	domain_event: Add common domain event queue/flush helpers
	The same code for queueing, flushing, and deregistering events exists
	in multiple drivers, which will soon use these common functions.

	v2:
	    Adjust libvirt_private.syms
	    isDispatching bool fixes
	    NONNULL tagging

	v3:
	    Add requireTimer parameter to virDomainEventStateNew

2011-05-13  Cole Robinson  <crobinso@redhat.com>

	domain_event: Add virDomainEventState structure
	This structure will be used to unify lots of duplicated event handling code
	across the state drivers.

	v2:
	    Check for state == NULL in StateFree
	    Add NONNULL tagging
	    Use bool for isDispatching

2011-05-13  Cole Robinson  <crobinso@redhat.com>

	xml: Use virXMLParse* helpers everywhere
	virt-aa-helper isn't even compile tested since I don't have the setup for
	it.

	v2:
	    virt-aa-helper fixes from Eric

2011-05-13  Cole Robinson  <crobinso@redhat.com>

	domain: Require <init> for container guests
	Use capabilities to allow a driver to register a default <init> if none
	is specified in the XML. Openvz was already open-coding this to be /sbin/init

	LXC currently falls over if no init is specified, so an explicit error is
	an improvement IMO.

	(Side note: I don't think we can set a default value for LXC. If we use
	/sbin/init but the user doesn't specify a separate root FS for their guest,
	the container will rerun the host's init which can be traumatic :). For
	virt-install I'm thinking of defaulting to /sbin/init if a root FS has
	been specified, otherwise require the user to manually specify <init>)

2011-05-13  Cole Robinson  <crobinso@redhat.com>

	xml: Make sure virXpathNodeSet always sets an error
	And update callers to actually respect the error

2011-05-13  Michal Privoznik  <mprivozn@redhat.com>

	vbox: Implement the driver methods
	* src/vbox/vbox_tmpl.c: New vboxDomainScreenshot() function

	qemu: Implement the driver methods
	* src/qemu/qemu_driver.c: new qemuDomainScreenshot() function
	* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
	  src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h,
	  src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h:
	  Monitor command

2011-05-13  Michal Privoznik  <mprivozn@redhat.com>

	virFDStream: Add option for delete file after it's opening
	This is needed if we want to transfer a temporary file. If the
	transfer is done with iohelper, we might run into a race condition,
	where we unlink() file before iohelper is executed.

	* src/fdstream.c, src/fdstream.h,
	  src/util/iohelper.c: Add new option
	* src/lxc/lxc_driver.c, src/qemu/qemu_driver.c,
	  src/storage/storage_driver.c, src/uml/uml_driver.c,
	  src/xen/xen_driver.c: Expand existing function calls

2011-05-13  Michal Privoznik  <mprivozn@redhat.com>

	screenshot: Implementing the remote protocol
	* src/remote/remote_protocol.x: Wire protocol definition
	* daemon/remote.c: Daemon part
	* src/remote/remote_driver.c: Client part
	* src/remote_protocol-structs: Add structures

	screenshot: Implementing the public API
	* src/libvirt.c: new function virDomainScreenshot

	screenshot: Defining the internal API
	* src/driver.h: Stub code for new API
	* src/esx/esx_driver.c, src/libxl/libxl_driver.c,
	  src/lxc/lxc_driver.c, src/openvz/openvz_driver.c,
	  src/phyp/phyp_driver.c, src/qemu/qemu_driver.c,
	  rc/remote/remote_driver.c, rc/test/test_driver.c,
	  src/uml/uml_driver.c, src/vbox/vbox_tmpl.c,
	  src/vmware/vmware_driver.c, src/xen/xen_driver.c,
	  src/xen/xen_driver.h, src/xen/xen_hypervisor.c,
	  src/xen/xen_inotify.c, src/xen/xend_internal.c,
	  src/xen/xm_internal.c, src/xen/xs_internal.c,
	  src/xenapi/xenapi_driver.c: Add dummy entries in driver
	  table for new APIs

2011-05-13  Michal Privoznik  <mprivozn@redhat.com>

	screenshot: Defining the public API
	Add public API for taking screenshots of current domain console.

	* include/libvirt/libvirt.h.in: add virDomainScreenshot
	* src/libvirt_public.syms: Export new symbol

2011-05-12  Wen Congyang  <wency@cn.fujitsu.com>

	build: avoid compiler warning during configure
	There is no need to redefine _GNU_SOURCE in tests that occur after
	gl_INIT, since that macro already AC_DEFINE'd it for us.

2011-05-12  Osier Yang  <jyang@redhat.com>

	docs: Fix documentation for cputune parameters
	This re-adds the example section originally written by Osier Yang,
	and indicates the version in which the cputune parameters became
	available in libvirt.

2011-05-12  Matthias Bolte  <matthias.bolte@googlemail.com>

	remote generator: Add skipgen/autogen flags to .x files
	Make procedure parsing more robust, by allowing arbitrary
	amounts of whitespaces.

	Also make some error messages more verbose.

2011-05-12  Eric Blake  <eblake@redhat.com>

	nwfilter: drop unused flag argument
	The public API and RPC over-the-wire format have no flags argument,
	so neither should the internal callback API.  This simplifies the
	RPC generator.

	* src/driver.h (virDrvNWFilterDefineXML): Drop argument that does
	not match public API.
	* src/nwfilter/nwfilter_driver.c (nwfilterDefine): Likewise.
	* src/libvirt.c (virNWFilterDefineXML): Likewise.
	* daemon/remote_generator.pl: Drop special case.

2011-05-12  Eric Blake  <eblake@redhat.com>

	maint: omit translation for all VIR_INFO
	We were 31/73 on whether to translate; since less than 50% translated
	and since VIR_INFO is less than VIR_WARN which also doesn't translate,
	this makes sense.

	* cfg.mk (sc_prohibit_gettext_markup): Add VIR_INFO, since it
	falls between WARN and DEBUG.
	* daemon/libvirtd.c (qemudDispatchSignalEvent, remoteCheckAccess)
	(qemudDispatchServer): Adjust offenders.
	* daemon/remote.c (remoteDispatchAuthPolkit): Likewise.
	* src/network/bridge_driver.c (networkReloadIptablesRules)
	(networkStartNetworkDaemon, networkShutdownNetworkDaemon)
	(networkCreate, networkDefine, networkUndefine): Likewise.
	* src/qemu/qemu_driver.c (qemudDomainDefine)
	(qemudDomainUndefine): Likewise.
	* src/storage/storage_driver.c (storagePoolCreate)
	(storagePoolDefine, storagePoolUndefine, storagePoolStart)
	(storagePoolDestroy, storagePoolDelete, storageVolumeCreateXML)
	(storageVolumeCreateXMLFrom, storageVolumeDelete): Likewise.
	* src/util/bridge.c (brProbeVnetHdr): Likewise.
	* po/POTFILES.in: Drop src/util/bridge.c.

2011-05-12  Eric Blake  <eblake@redhat.com>

	build: wrap macro body in one-shot do-while loop
	* src/libvirt.c (VIR_DOMAIN_DEBUG_1): Convert to single statement.
	Suggested by Jiri Denemark.

2011-05-12  Eric Blake  <eblake@redhat.com>

	build: drop need for VIR_DOMAIN_DEBUG0()
	This one's tricker than the VIR_DEBUG0() removal, but the end
	result is still C99 compliant, and reasonable with enough comments.

	* src/libvirt.c (VIR_ARG10, VIR_HAS_COMMA)
	(VIR_DOMAIN_DEBUG_EXPAND, VIR_DOMAIN_DEBUG_PASTE): New macros.
	(VIR_DOMAIN_DEBUG): Rewrite to handle one argument, moving
	multi-argument guts to...
	(VIR_DOMAIN_DEBUG_1): New macro.
	(VIR_DOMAIN_DEBUG0): Rename to VIR_DOMAIN_DEBUG_0.

2011-05-12  Christophe Fergeau  <cfergeau@redhat.com>

	fix xdr detection and use with recent glibc
	glibc 2.13.90 has obsoleted its rpc implementation in favour of
	the one provided by the TI-RPC library:

	> * The RPC implementation in libc is obsoleted.  Old programs keep working
	>   but new programs cannot be linked with the routines in libc anymore.
	>   Programs in need of RPC functionality must be linked against TI-RPC.
	>   The TI-RPC implemtation is IPv6 enabled and there are other benefits.
	>
	>   Visible changes of this change include (obviously) the inability to
	>   link
	>   programs using RPC functions without referencing the TI-RPC library,
	>   the
	>   removal of the RPC headers from the glibc headers, and the lack of
	>   symbols defined in <rpc/netdb.h> when <netdb.h> is installed.
	>   Implemented by Ulrich Drepper.
	(from glibc NEWS)

	Thus with recent glibc, we need to try linking with -ltirpc when looking
	for the XDR functions. The daemon also needs to use XDR_CFLAGS to be able
	to find the XDR headers stored in /usr/include/tirpc.

	When using TI-RPC, there are some warnings about redundant declarations, but
	the fix probably belongs in other modules:

	/usr/include/tirpc/rpc/rpcent.h:68:13: warning: redundant redeclaration of
	'setrpcent' [-Wredundant-decls]
	/usr/include/rpc/netdb.h:53:13: note: previous declaration of 'setrpcent'
	was here

	/usr/include/tirpc/rpc/rpcent.h:69:13: warning: redundant redeclaration of
	'endrpcent' [-Wredundant-decls]
	/usr/include/rpc/netdb.h:54:13: note: previous declaration of 'endrpcent'
	was here

	/usr/include/tirpc/rpc/rpc.h:84:12: warning: redundant redeclaration of
	'bindresvport' [-Wredundant-decls]
	/usr/include/netinet/in.h:440:12: note: previous declaration of
	'bindresvport' was here

2011-05-12  Eric Blake  <eblake@redhat.com>

	build: avoid gcc preprocessor extensions
	Use of ',##__VA_ARGS__' is a gcc extension not guaranteed by
	C99; thankfully, we can avoid it by lumping the format argument
	into the var-args set.

	* src/util/logging.h (VIR_DEBUG_INT, VIR_INFO_INT, VIR_WARN_INT)
	(VIR_ERROR_INT, VIR_DEBUG, VIR_INFO, VIR_WARN, VIR_ERROR): Stick
	to C99 var-arg macro syntax.
	* examples/domain-events/events-c/event-test.c (VIR_DEBUG):
	Simplify.

2011-05-12  Lai Jiangshan  <laijs@cn.fujitsu.com>

	libvirt,logging: cleanup VIR_XXX0()
	These VIR_XXXX0 APIs make us confused, use the non-0-suffix APIs instead.

	How do these coversions works? The magic is using the gcc extension of ##.
	When __VA_ARGS__ is empty, "##" will swallow the "," in "fmt," to
	avoid compile error.

	example: origin				after CPP
		high_level_api("%d", a_int)	low_level_api("%d", a_int)
		high_level_api("a  string")	low_level_api("a  string")

	About 400 conversions.

	8 special conversions:
	VIR_XXXX0("") -> VIR_XXXX("msg") (avoid empty format) 2 conversions
	VIR_XXXX0(string_literal_with_%) -> VIR_XXXX(%->%%) 0 conversions
	VIR_XXXX0(non_string_literal) -> VIR_XXXX("%s", non_string_literal)
	  (for security) 6 conversions

2011-05-12  Eric Blake  <eblake@redhat.com>

	maint: avoid a couple of gnulib regressions
	Double-close regression in upstream gnulib fclose was introduced
	to libvirt in commit 9d8e01a1d.

	Meanwhile, adding rpcgen as a bootstrap prerequisite in commit
	fb1e8d9c prevented RHEL 5 from running bootstrap.

	* .gnulib: Update to latest, for fclose and bootstrap fixes.
	* bootstrap: Synchronize from upstream.

2011-05-12  Eric Blake  <eblake@redhat.com>

	node_device: avoid null dereference on error
	If we plow on after udev_device_get_syspath fails, we will hit a NULL
	dereference.  Clang found one due to strdup later in udevSetParent,
	but in fact we hit a NULL dereference sooner because of the use of
	STREQ within virNodeDeviceFindBySysfsPath.

	* src/conf/node_device_conf.h (virNodeDeviceFindBySysfsPath): Mark
	path argument non-null.
	* src/node_device/node_device_udev.c (udevSetParent): Avoid null
	dereference.

2011-05-12  Eric Blake  <eblake@redhat.com>

	build: remove some dead assignments
	No syntactic effect; this merely silences some clang warnings.

	* src/libxl/libxl_driver.c (libxlDomainSetVcpusFlags): Drop
	redundant ret=0 statement.
	* src/qemu/qemu_monitor_text.c (qemuMonitorTextDriveDel):
	Likewise.

2011-05-11  Eric Blake  <eblake@redhat.com>

	tests: avoid crash when run under gcov
	Running ./autobuild.sh failed when gcov is installed, because
	commandtest ended up crashing during gcov's getenv() call after
	exit() had already started.  I traced this nasty bug back to
	a scoping issue present since the test introduction.

	* tests/commandtest.c (mymain): Move newenv...
	(newenv): ...to a scope that is still useful during exit().

2011-05-11  Eric Blake  <eblake@redhat.com>

	build: fix VPATH build with distributed generated files
	* daemon/Makefile.am (DAEMON_GENERATED, remote_dispatch_*.h)
	(qemu_dispatch_*.h): Update to live in srcdir, since they are
	distributed.
	Detected by Daniel P. Berrange's autobuilder.

	docs: avoid double 'the'
	* docs/testsuites.html.in: Keep 'make syntax-check' happy.

2011-05-11  Daniel Veillard  <veillard@redhat.com>

	Add documentation about test suites
	Create a new top level entry, add a new page listing the 3
	test suites, and then one page for the TCK and one page for
	libvirt-test-API

2011-05-11  Daniel P. Berrange  <berrange@redhat.com>

	Allow destroying QEMU VM even if a job is active
	Introduce a virProcessKill function that can be safely called
	even when the job mutex is held. This allows virDomainDestroy
	to kill any VM even if it is asleep in a monitor job. The PID
	will die and the thread asleep on the monitor will then wake
	up releasing the job mutex.

	* src/qemu/qemu_driver.c: Kill process before using qemuProcessStop
	  to ensure job is released
	* src/qemu/qemu_process.c: Add virProcessKill for killing off
	  QEMU processes

2011-05-11  Daniel P. Berrange  <berrange@redhat.com>

	Add support for YAJL version 2 API/ABI
	Version 2.0.0 or yajl changed API. It is fairly trivial for us to
	cope with both APIs in libvirt, so adapt.

	* configure.ac: Probe for yajl2 API
	* src/util/json.c: Conditional support for yajl2 API

2011-05-11  Paolo Bonzini  <pbonzini@redhat.com>

	libxl: support enabling the HPET
	libxl accepts hpet configuration in its domain info struct.  Parse the
	domain definition's <clock> element in order to set the value.


	Apologies from Eric Blake, for mistakenly committing the broken
	intermediate version.

2011-05-11  Paolo Bonzini  <pbonzini@redhat.com>

	libxl: support enabling the HPET
	libxl accepts hpet configuration in its domain info struct.  Parse the
	domain definition's <clock> element in order to set the value.

2011-05-11  Paolo Bonzini  <pbonzini@redhat.com>

	xen: parse and generate hpet item in sxpr
	Recent versions of Xen disable the virtual HPET by default.  This is
	usually more precise because tick policies are not implemented for
	the HPET in Xen.  However, there may be several reasons to control
	the HPET manually: 1) to test the emulation; 2) because distros may
	provide the knob while leaving the default to "enabled" for compatibility
	reasons.

	This patch provides support for the hpet item in both sexpr and xm
	formats, and translates it to a <timer> element.

2011-05-11  Doug Goldstein  <cardoe@gentoo.org>

	docs: updates to CA cert and client cert/key info
	Update the documentation to mention that the CA certificate and the
	client cert/key pair can come from the user's location or the global
	location independent of each other.

2011-05-11  Doug Goldstein  <cardoe@gentoo.org>

	virsh: flexibility in CA cert and user cert/key
	Allow the CA certificate to come from the user's home directory or from
	the global location independently of the client certificate/key pair.

	Mostly for the case when each user on a system has their own cert/key
	pair but the system as a whole shares the same CA.

2011-05-11  Matthias Bolte  <matthias.bolte@googlemail.com>

	remote generator: Make parsing stricter
	Anchor matches at the beginning of a line.

	Specialize some general matches.

	Add some comments to special cases.

2011-05-11  Matthias Bolte  <matthias.bolte@googlemail.com>

	remote generator: Unify unsigned int notation in .x files
	Rename u_int and unsigned to unsigned int. This gets rid of some special
	case code in the generator.

	remote generator: Fix comment ignoring regex

2011-05-11  Matthias Bolte  <matthias.bolte@googlemail.com>

	Rename internal DumpXML functions to GetXMLDesc
	This matches the public API and helps to get rid of some special
	case code in the remote generator.

	Rename driver API functions and XDR protocol structs.

	No functional change included outside of the remote generator.

2011-05-11  Lai Jiangshan  <laijs@cn.fujitsu.com>

	qemu,inject-nmi: Implement the driver methods

	inject-nmi: Expose the new API in virsh

	inject-nmi: Implementing the remote protocol

	inject-nmi: Implementing the public API

	inject-nmi: Defining the internal API

	inject-nmi: Defining the public API

2011-05-11  Cole Robinson  <crobinso@redhat.com>

	lxc: container: Build init cmd before we close stdout
	That way we can log the 'init' argv for debugging.

	lxc: container: Convert <init> exec to virCommand

	command: Add virCommandExec helper
	Actually execs the argv/env we've generated, replacing the current process.
	Kind of has a limited usage, but allows us to use virCommand in LXC
	driver to launch the 'init' process

	lxc: driver: Improve logging when launching emulator
	Log the full command line and a timestamp like we do for QEMU

	lxc: driver: Convert emulator launching to virCommand
	v2:
	    Shorten a few virCommand calls
	    s/remain/retain/

2011-05-11  Cole Robinson  <crobinso@redhat.com>

	command: Add virCommandEnvAddFormat
	Similar to virCommandArgAddFormat. We will use this shortly.

	v2:
	    Convert virCommandEnvAddPair to use the new function

2011-05-10  Matthias Bolte  <matthias.bolte@googlemail.com>

	Fix two uninitialized variable warnings
	gcc only reports them when compiling with -O3.

	apparmor: Fix uninitalized variable warning in virt-aa-helper

2011-05-10  Eric Blake  <eblake@redhat.com>

	build: translate generated strings
	Make sure that xgettext scans generated files for translatable
	strings, rather than just files stored in libvirt.git.

	* .gnulib: Update, for bootstrap and syntax-check fixes.
	* bootstrap: Resynchronize with gnulib.
	* cfg.mk (generated_files): Define.
	* po/POTFILES.in: Add more files with _().

2011-05-10  Daniel P. Berrange  <berrange@redhat.com>

	Remove bogus assert() from migration code
	assert() is forbidden in libvirt code, and these two cases would
	in fact never execute due to earlier error checks.

	* src/libvirt.c: Remove assert() usage

2011-05-09  Daniel P. Berrange  <berrange@redhat.com>

	Pull in gnulib fnmatch module
	The libvirtd daemon uses fnmatch. Although we don't yet build
	it on Win32, we should use gnulib's fnmatch module to ensure
	portability to all platforms.

	* bootstrap.conf: Add fnmatch

2011-05-09  Jiri Denemark  <jdenemar@redhat.com>

	json: Fix *GetBoolean functions
	They were not used anywhere so far so nobody noticed they are broken.

2011-05-09  Eric Blake  <eblake@redhat.com>

	build: rebuild generated files after rpcgen_fix.pl tweak
	Noticed this while trying to run rpcgen on cygwin.

	* src/Makefile.am ($(srcdir)/remote/%_protocol.h)
	($(srcdir)/remote/%_protocol.c): Add a dependency.

2011-05-09  Eric Blake  <eblake@redhat.com>

	build: fix VPATH builds
	* src/Makefile.am (REMOTE_DRIVER_GENERATED): Generated files
	should live in $(srcdir). Update rules to reflect this.

2011-05-09  Daniel Veillard  <veillard@redhat.com>

	Re-add libvirt.spec to tarball to allwo "make rpm"
	Commit e6972165 broke "make rpm" and rpmbuild -ta tarball

2011-05-07  Daniel P. Berrange  <berrange@redhat.com>

	build: Remove all generated RPC files from GIT
	Stop storing the generated files for the remote protocol client
	and server in source control. The generated files will still be
	included in the result of 'make dist' to avoid end-users needing
	to generate the files


	Unfortunately, this means that the strings marked for translation
	in generated files are not picked up by gnulib's syntax-check,
	I'm working on fixing that in gnulib.

	* .gitignore, cfg.mk, po/POTFILES.in: Reflect deletion.

2011-05-07  Daniel P. Berrange  <berrange@redhat.com>

	build: refactor generated RPC files
	Always generate the rpc files, and require rpcgen during bootstrap.

	* daemon/Makefile.am: Removed generated files with
	  maintainer-clean target
	* src/Makefile.am: Removed generated files with
	  maintainer-clean target. Always run 'rpcgen' if
	  generated files are missing

2011-05-07  Eric Blake  <eblake@redhat.com>

	build: rename generated files to .h, for automake's sake
	In preparation for removing generated files, it is necessary
	to tell automake that the generated files must be distributed
	but not directly compiled (since they are included into the
	body of a larger .c file that is compiled).  Hence, even though
	these files are code and not headers in the strict sense of
	the word, it is easier to rename them to .h for automake's sake.

	* daemon/remote_client_bodies.c: Rename to .h.
	* daemon/qemu_client_bodies.c: Likewise.
	* src/remote/remote_client_bodies.c: Likewise.
	* src/remote/qemu_client_bodies.c: Likewise.
	* daemon/Makefile.am (remote_dispatch_bodies.c)
	(qemu_dispatch_bodies.c): Rename to .h.
	(remote.c, EXTRA_DIST): Reflect rename.
	* daemon/remote.c: Likewise.
	* daemon/remote_generator.pl: Likewise.
	* src/Makefile.am (remote/remote_driver.c): Likewise.
	* src/remote/remote_driver.c: Likewise.
	* po/POTFILES.in: Likewise.
	* cfg.mk (exclude_file_name_regexp--sc_require_config_h)
	(exclude_file_name_regexp--sc_require_config_h_first)
	(exclude_file_name_regexp--sc_prohibit_empty_lines_at_EOF):
	Likewise.

2011-05-07  Matthias Bolte  <matthias.bolte@googlemail.com>

	remote generator, client: Handle arguments with limited length
	This adds length checks to all affected functions.

	remote generator, client: Handle functions that return lists

	remote: Refactor remote*Open and remote*Close functions
	Add generic versions of the open and close functions and call them.

	remote generator, client: Handle functions with optional return values

	remote generator, client: Handle functions with multiple return values

	remote generator, client: Handle functions with wrapped return values

	remote generator, client: Handle functions with simple return values

	remote generator, client: Handle simple remote driver functions
	Rename remoteSecretListSecrets to remoteListSecrets to match the normal
	naming pattern.

	remote generator: Reorder into prepare and print section

	remote generator, daemon: Handle functions with multiple return values
	Once again rename members in the XDR definitions to avoid special case
	code in the generator.

	remote generator, daemon: Combine multiple ifs in the generated code

	remote generator, daemon: Handle the CPU functions
	They require additional special cases.

	remote generator: Refactor duplicate code

	remote generator, daemon: Handle functions that return lists

	remote: Rename 'nameslen' to the common 'maxnames'
	Avoids special case handling in the remote generator.

	remote generator, daemon: Handle functions with optional arguments

	remote generator, daemon: Handle more functions
	This covers functions that return single wrapped objects and don't
	involve complexer code in the body.

	remote generator, daemon: Handle simple-return-value functions

	remote generator, daemon: Change capitalization of some words
	Again this will simplify the generator, due to less special case handling.

2011-05-07  Matthias Bolte  <matthias.bolte@googlemail.com>

	remote: Replace 'domain' with 'dom' in the XDR protocol
	This simplifies the remote protocol code generator.

	Also rename 'ret' to 'result' to resolve a naming conflict in the
	generator.

2011-05-07  Matthias Bolte  <matthias.bolte@googlemail.com>

	remote generator, daemon: Output function bodies too
	This patch just covers the simple functions without explicit return
	values. There is more to be handled.

	The generator collects the members of the XDR argument structs and uses
	this information to generate the function bodies.

	Exclude the generated files from offending syntax-checks.

	Suggested by Richard W.M. Jones

2011-05-07  Matthias Bolte  <matthias.bolte@googlemail.com>

	remote generator: Replace tabs with spaces and rename file
	No functional change included, just a whitespace change.

2011-05-07  Markus Groß  <gross@univention.de>

	Balloon dom0 in libxl driver
	Creating a domU on a freshly booted dom0 does not work,
	because the libxl driver does not allocate memory for the domU.
	After creating a domain with xl libvirt is able to create domains too.
	This patch reserves enough memory for the domU first.

2011-05-07  Eric Blake  <eblake@redhat.com>

	build: drop files generated by config.status from tarball
	The rule of thumb is that any file generated by config.status
	is a) reproducible by any user, b) dependent on configure options.
	Therefore, it is inappropriate to include such generated files
	in the tarball (for proof, Makefile is generated from Makefile.in;
	the former is not in the tarball while the latter is).

	* Makefile.am (EXTRA_DIST): Remove files covered by AC_OUTPUT.

2011-05-07  Doug Goldstein  <cardoe@gentoo.org>

	remote: check actual access to the cert
	Instead of calling stat(), check that we'll actually be able to access
	and read the file.

2011-05-07  Eric Blake  <eblake@redhat.com>

	maint: avoid comparisons to bool constants
	HACKING already mentions that comparisons against literal 'true'
	are unsafe; for consistency, also shorten comparisons against 'false'.

	* src/conf/domain_conf.c (virDomainNetDefParseXML): Simplify.
	* src/nwfilter/nwfilter_gentech_driver.c
	(virNWFilterDomainFWUpdateCB): Likewise.
	* tools/virsh.c (cmdVolDownload, vshCommandRun, vshPrintExtra):
	Likewise.

2011-05-06  Michal Privoznik  <mprivozn@redhat.com>

	Add warning message to XML definition files stored on disk
	Users often edit XML file stored in configuration directory
	thinking of modifying a domain/network/pool/etc. Thus it is wise
	to let them know they are using the wrong way and give them hint.

2011-05-06  Daniel P. Berrange  <berrange@redhat.com>

	Fix security driver handling of FIFOs with QEMU
	When setting up a FIFO for QEMU, it allows either a pair
	of fifos used unidirectionally, or a single fifo used
	bidirectionally. Look for the bidirectional fifo first
	when labelling since that is more useful

	* src/security/security_dac.c,
	  src/security/security_selinux.c: Fix fifo handling

2011-05-06  Daniel P. Berrange  <berrange@redhat.com>

	Make taint warnings also go into the domain logfile
	As well as taint warnings going to the main libvirt log,
	add taint warnings to the per-domain logfile

	  Domain id=3 is tainted: high-privileges
	  Domain id=3 is tainted: disk-probing
	  Domain id=3 is tainted: shell-scripts
	  Domain id=3 is tainted: custom-monitor

	* src/qemu/qemu_domain.c, src/qemu/qemu_domain.h: Enhance
	  qemuDomainTaint to also log to the domain logfile
	* src/qemu/qemu_driver.c: Pass -1 for logFD to taint methods to
	  auto-append to logfile
	* src/qemu/qemu_process.c: Pass open logFD at startup for taint
	  methods

2011-05-06  Daniel P. Berrange  <berrange@redhat.com>

	Add a qemuDomainAppendLog method for writing to the domain logfile
	The qemuDomainAppendLog method allows writing a formatted string
	to the end of the domain logfile, optionally opening it if needed.

	* src/qemu/qemu_domain.c, src/qemu/qemu_domain.h: Add
	  qemuDomainAppendLog

2011-05-06  Daniel P. Berrange  <berrange@redhat.com>

	Move qemuProcessLogReadFD and qemuProcessLogFD methods
	Move the qemuProcessLogReadFD and qemuProcessLogFD methods
	into qemu_domain.c, renaming them to qemuDomainCreateLog
	and qemuDomainOpenLog.

	* src/qemu/qemu_domain.c, src/qemu/qemu_domain.h: Add
	  qemuDomainCreateLog and qemuDomainOpenLog.
	* src/qemu/qemu_process.c: Remove qemuProcessLogFD
	  and qemuProcessLogReadFD

2011-05-06  Daniel P. Berrange  <berrange@redhat.com>

	Log taint warnings in QEMU driver
	Wire up logging of VM tainting to the QEMU driver

	 - If running QEMU as root user/group or without capabilities
	   being cleared
	 - If passing custom QEMU command line args
	 - If issuing custom QEMU monitor commands
	 - If using a network interface config with an associated
	   shell script
	 - If using a disk config relying on format probing

	The warnings, per-VM appear in the main libvirtd logs

	  11:56:17.571: 10832: warning : qemuDomainObjTaint:712 : Domain id=1 name='l2' uuid=c7a3edbd-edaf-9455-926a-d65c16db1802 is tainted: high-privileges
	  11:56:17.571: 10832: warning : qemuDomainObjTaint:712 : Domain id=1 name='l2' uuid=c7a3edbd-edaf-9455-926a-d65c16db1802 is tainted: disk-probing

	The taint flags are reset when the VM is stopped.

	* src/qemu/qemu_domain.c, src/qemu/qemu_domain.h: Helper APIs
	  for logging taint warnings
	* src/qemu/qemu_driver.c: Log tainting with custom QEMU monitor
	  commands and disk/net hotplug with unsupported configs
	* src/qemu/qemu_process.c: Log tainting at startup based on
	  unsupported configs

2011-05-06  Daniel P. Berrange  <berrange@redhat.com>

	Add field to virDomainObjPtr to track "tainting"
	Some configuration setups for guests are allowed, but strongly
	discouraged and unsupportable in production systems. Introduce
	a concept of 'tainting' to virDomainObjPtr to allow such setups
	to be identified. Drivers can then log warnings at suitable
	times

	* src/conf/domain_conf.c, src/conf/domain_conf.h: Declare taint
	  flags and add parsing/formatting of domain status XML

2011-05-06  Doug Goldstein  <cardoe@gentoo.org>

	virsh: improve TLS certificate error messages
	Print the name of the CA cert, certificate, and key file that resulted
	in the failure so that the user has an idea what to troubleshoot.

2011-05-06  Eric Blake  <eblake@redhat.com>

	virsh: use new method for easier log to file
	Easier to maintain, and no longer an arbitrary line length limit.

	* tools/virsh.c (vshOutputLogFile): Replace snprintf with
	virBuffer.

2011-05-06  Eric Blake  <eblake@redhat.com>

	buf: add virBufferVasprintf
	Match the fact that we have virAsprintf and virVasprintf.

	* src/util/buf.h (virBufferVasprintf): New prototype.
	* src/util/buf.c (virBufferAsprintf): Move guts...
	(virBufferVasprintf): ...to new function.
	* src/libvirt_private.syms (buf.h): Export it.
	* bootstrap.conf (gnulib_modules): Add stdarg, for va_copy.

2011-05-06  Eric Blake  <eblake@redhat.com>

	maint: rename virBufferVSprintf to virBufferAsprintf
	We already have virAsprintf, so picking a similar name helps for
	seeing a similar purpose.  Furthermore, the prefix V before printf
	generally implies 'va_list', even though this variant was '...', and
	the old name got in the way of adding a new va_list version.

	global rename performed with:

	$ git grep -l virBufferVSprintf \
	  | xargs -L1 sed -i 's/virBufferVSprintf/virBufferAsprintf/g'

	then revert the changes in ChangeLog-old.

2011-05-06  Cole Robinson  <crobinso@redhat.com>

	docs: <filesystem> attr is 'accessmode', not 'mode'

2011-05-05  Daniel P. Berrange  <berrange@redhat.com>

	Fix qemuMigrationToFile nonull annotation
	The qemuMigrationToFile method was accidentally annotated for
	the 'compressor' parameter to be non-null, instead of the
	'path' parameter. Thus GCC with -O2, unhelpfully deleted the
	entire 'if (compressor == NULL)' block of code during
	optimization. Thus NULL was passed to virCommandNew() with
	predictably bad results.

	* src/qemu/qemu_migration.h: Fix non-null annotation to be
	  against path instead of compressor

2011-05-05  Daniel P. Berrange  <berrange@redhat.com>

	Make QEMU migration use cached qemu capabilities data
	* src/qemu/qemu_migration.c, src/qemu/qemu_migration.h: Remove
	  qemuCaps parameters & use cached data
	* src/qemu/qemu_driver.c: Don't create & pass qemuCaps to
	  migration methods

	Make QEMU hotplug use cached qemu capabilities data
	* src/qemu/qemu_hotplug.h, src/qemu/qemu_hotplug.c: Remove
	  qemuCaps parameters from all methods
	* src/qemu/qemu_driver.c: Don't create & pass qemuCaps to
	  hotplug methods

2011-05-05  Daniel P. Berrange  <berrange@redhat.com>

	Persist qemu capabilities in the domain status file
	To cope with the QEMU binary being changed while a VM is running,
	it is neccessary to persist the original qemu capabilities at the
	time the VM is booted.

	* src/qemu/qemu_capabilities.c, src/qemu/qemu_capabilities.h: Add
	  an enum for a string rep of every capability
	* src/qemu/qemu_domain.c, src/qemu/qemu_domain.h: Support for
	  storing capabilities in the domain status XML
	* src/qemu/qemu_process.c: Populate & free QEMU capabilities at
	  domain startup

2011-05-05  Daniel Veillard  <veillard@redhat.com>

	Release of libvirt-0.9.1
	* configure.ac libvirt.spec.in docs/news.html.in: update and document
	  the release
	* po/*.po*: update localizations for german, polish, spanish, ukrainian
	  and vietnamese coming from transifex, regenerate

2011-05-05  Eric Blake  <eblake@redhat.com>

	maint: detect clang 2.9
	In Fedora 15, with clang 2.8, 'scan-build env' shows:
	CCC_ANALYZER_ANALYSIS=-analyzer-check-objc-mem -analyzer-check-security-syntactic -analyzer-check-dead-stores -analyzer-check-objc-unused-ivars -analyzer-check-objc-methodsigs

	But in rawhide, with clang 2.9, the same variable is set but
	empty, implying the default set of analysis.  We still want
	sa_assert defined in that case, to stop clang from hitting
	false positives.

	* configure.ac (STATIC_ANALYSIS): Detect clang even when the set
	of analyses is the default.

2011-05-05  Eric Blake  <eblake@redhat.com>

	storage: avoid null deref and leak on failure
	Detected by clang.  NULL deref added in commit 343a27a (Mar 11),
	but leak of voldef present since commit 2cd9b2d (Apr 09).

	* src/storage/storage_driver.c (storageVolumeCreateXML): Don't
	leak voldef or dereference null volobj.

2011-05-05  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Disable performance counter queries in esxDomainGetInfo
	The queried values aren't used yet.

2011-05-05  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Avoid null dereference on error in esxDomainGetInfo
	Add missing early exits and convert error logging to proper API level
	error reporting.

	Centralize cleanup code for the PerfQuerySpec object.

	Reported by Eric Blake, detected by clang.

2011-05-05  Eric Blake  <eblake@redhat.com>

	remote: avoid null dereference on error
	Clang found three instances of uninitialized use of nparams in
	the cleanup path.  Unfortunately, one is a false positive: clang
	couldn't see that ret->params.params_val is guaranteed to be
	NULL unless allocated within a function, and that nparams is
	guaranteed to be assigned prior to the allocation; hoisting the
	assignment to nparams to be earlier in the function shuts up
	that false positive.  But two of the reports also happened to
	highlight a real bug - the error path can dereference NULL.

	Regression introduced in commit 158ba873.

	* daemon/remote.c (remoteDispatchDomainGetMemoryParameters)
	(remoteDispatchDomainGetBlkioParameters): Don't clear fields if
	array was not allocated.
	(remoteDispatchDomainGetSchedulerParameters): Initialize nparams
	earlier.

2011-05-05  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Remove dead store in esxUtil_ParseDatastorePath
	The ++ on preliminaryFileName was a left over from a previous version
	of this function that explicitly returned the filename and did a strdup
	on preliminaryFileName afterwards.

	As the filename isn't returned explicitly anymore remove the preliminary
	variable for it and reuse the tmp variable instead.

	Reported by Eric Blake, detected by clang.

2011-05-04  Eric Blake  <eblake@redhat.com>

	qemu: update qemuCgroupControllerActive signature
	Clang warned about a dead assignment.  In the process, I noticed
	that we are only using the function for a bool value.  I audited
	all other callers in qemu_{migration,cgroup,driver,hotplug), and
	all were making the call in a bool context.

	Also, do bounds checking on the argument.

	* src/qemu/qemu_cgroup.c (qemuSetupCgroup): Delete dead
	assignment.
	(qemuCgroupControllerActive): Change return type to bool.
	* src/qemu/qemu_cgroup.h (qemuCgroupControllerActive): Likewise.

2011-05-04  Eric Blake  <eblake@redhat.com>

	util: remove dead assignment
	Clang complained about this, and it was easy enough to fix.

	* src/util/util.c (virFileOpenAs): Drop dead assignment.

2011-05-04  Eric Blake  <eblake@redhat.com>

	lxc: report correct error
	Clang noticed a dead assignment, which turned out to be the use
	of the wrong variable.  rc starts life as -1, and is only ever
	assigned to 0 just before a successful cleanup.

	* src/lxc/lxc_driver.c (lxcSetupInterfaces): Don't call
	virReportSystemError(-1).

2011-05-04  Eric Blake  <eblake@redhat.com>

	libxl: avoid compiler warning
	Detected by gcc:

	libxl/libxl_driver.c: In function 'libxlDomainDestroy':
	libxl/libxl_drier.c:1351:30: error: variable 'priv' set but not used [-Werror=unused-but-set-variable]

	* src/libxl/libxl_driver.c (libxlDomainDestroy): Delete unused
	variable.

2011-05-04  Eric Blake  <eblake@redhat.com>

	qemu: remove dead assignment
	Detected by clang.

	* src/qemu/qemu_migration.c (qemuMigrationToFile): Nothing later
	uses is_reg.

2011-05-04  Eric Blake  <eblake@redhat.com>

	storage: use virCommand to avoid compiler warning
	clang didn't like the last increment to nargs.  But why even
	track nargs ourselves, when virCommand does it for us?

	* src/storage/storage_backend_iscsi.c
	(virStorageBackendISCSIConnection): Switch to virCommand to avoid
	a dead-store warning on nargs.

2011-05-04  Eric Blake  <eblake@redhat.com>

	cgroup: avoid leaking a file
	Clang detected a dead store to rc.  It turns out that in fixing this,
	I also found a FILE* leak.

	This is a subtle change in behavior, although unlikely to hit.  The
	pidfile is a kernel file, so we've probably got more serious problems
	under foot if we fail to parse one.  However, the previous behavior
	was that even if one pid file failed to parse, we tried others,
	whereas now we give up on the first failure.  Either way, though,
	the function returns -1, so the caller will know that something is
	going wrong, and that not all pids were necessarily reaped.  Besides,
	there were other instances already in the code where failure in the
	inner loop aborted the outer loop.

	* src/util/cgroup.c (virCgroupKillInternal): Abort rather than
	resuming loop on fscanf failure, and cleanup file on error.

2011-05-04  Eric Blake  <eblake@redhat.com>

	qemu: silence clang false positives
	Clang 2.8 wasn't quite able to follow that persistentDef was
	assigned earlier if (flags & VIR_DOMAIN_MEM_CONFIG) is true.
	Silence this false positive, to make clang analysis easier to use.

	* src/qemu/qemu_driver.c (qemudDomainSetMemoryFlags): Add an
	annotation to silence clang's claim of a NULL dereference.

2011-05-04  Eric Blake  <eblake@redhat.com>

	virsh: avoid null pointer dereference
	Clang detected that vol-download will call unlink(NULL) if there
	is a parse error during option parsing.  Also, mingw doesn't like
	unlinking an open file.

	* tools/virsh.c (cmdVolDownload): Only unlink file if created.

2011-05-04  Eric Blake  <eblake@redhat.com>

	pci: fix null pointer dereference
	Clang detected a null-pointer dereference regression, introduced
	in commit 4e8969eb.  Without this patch, a device with
	unbind_from_stub set to false would eventually try to call
	virFileExists on uncomputed drvdir.

	* src/util/pci.c (pciUnbindDeviceFromStub): Ensure drvdir is set
	before use.

2011-05-04  Eric Blake  <eblake@redhat.com>

	qemu: avoid null pointer dereference
	This code has had problems historically.  As originally
	written, in commit 6bcf2501 (Jun 08), it could call unlink
	on a random string, nuking an unrelated file.

	Then commit 182a80b9 (Sep 09), the code was rewritten to
	allocate tmp, with both a use-after-free bug and a chance to
	call unlink(NULL).

	Commit e206946 (Mar 11) fixed the use-after-free, but not the
	NULL dereference.  Thanks to clang for catching this!

	* src/qemu/qemu_driver.c (qemudDomainMemoryPeek): Don't call
	unlink on NULL.

2011-05-04  Eric Blake  <eblake@redhat.com>

	tests: avoid null pointer dereference
	Unlikely to hit in real life, but clang noticed it.

	* tests/commandtest.c (checkoutput, test4, test18): Avoid
	unlink(NULL) on OOM.

2011-05-04  Eric Blake  <eblake@redhat.com>

	Revert "lxc: Do not try to reconnect inactive domain when do lxcStartup"
	This reverts commit 0e7f7f8566f3e7fcf5bce395555fa1b5cf1e136b.

	From the mailing list:

	> So, AFAICT, this patch means we will never reconnect to any LXC
	> VMs now.
	>
	> The correct solution, is to refactor LXC driver startup to work
	> the same way as the QEMU driver startup.
	>
	>   - Load all the live state XML files (to pick up running VMs)
	>   - Reconnect to all VMs
	>   - Load all the persistent config XML files (to pick up any additional
	>     inactive guets)

	But that solution is invasive enough to be post-0.9.1.

2011-05-03  Eric Blake  <eblake@redhat.com>

	tests: suppress more valgrind situations
	* tests/.valgrind.supp: Consolidate bash suppressions.  Ignore
	more libnl issues.

2011-05-03  Michal Privoznik  <mprivozn@redhat.com>

	Fix disability to run on systems with no PCI bus
	The patch which moved libpciaccess initialization to one place caused
	regression - we were not able to run on system with no PCI bus, like
	s390(x).

2011-05-03  Osier Yang  <jyang@redhat.com>

	lxc: Do not try to reconnect inactive domain when do lxcStartup
	Otherwise if there are inactive lxc domains, lxcStartup will
	try to reconnect to sockets of these domains, which results in
	errors in libvirtd log.

2011-05-03  Eric Blake  <eblake@redhat.com>

	tests: avoid compiler warning
	../../tests/xmconfigtest.c: In function 'testCompareParseXML':
	../../tests/xmconfigtest.c:49:19: error: 'conn' may be used uninitialized in this function [-Wuninitialized]

	* tests/xmconfigtest.c (testCompareParseXML): Initialize variable.

2011-05-02  Christophe Fergeau  <cfergeau@redhat.com>

	qemu: fix uninitialized variable warning
	This commit fixes
	qemu/qemu_driver.c: In function 'qemuDomainModifyDeviceFlags':
	qemu/qemu_driver.c:4041:8: warning: 'ret' may be used uninitialized in this
	function [-Wuninitialized]
	qemu/qemu_driver.c:4013:9: note: 'ret' was declared here

	The variable is set to -1 so that the error paths are taken when the code
	to set it didn't get a chance to run. Without initializing it, we could
	return some an undefined value from this function.

	While I was at it, I made a trivial whitespace change in the same function
	to improve readability.

2011-05-02  Gerhard Stenzel  <gstenzel@linux.vnet.ibm.com>

	fix missing VLAN id for Qbg example
	For IEEE 802.1Qbg, it is necessary to use a VLAN interface.
	vepa itself does not require a VLAN interface.

2011-05-01  Matthias Bolte  <matthias.bolte@googlemail.com>

	tests: Lower stack usage below 4096 bytes
	Make virtTestLoadFile allocate the buffer to read the file into.

	Fix logic error in virtTestLoadFile, stop reading on the first empty line.

	Use virFileReadLimFD in virtTestCaptureProgramOutput to avoid manual
	buffer handling.

2011-05-01  Matthias Bolte  <matthias.bolte@googlemail.com>

	tests: Update valgrind suppressions file

2011-05-01  Supriya Kannery  <supriyak@in.ibm.com>

	virsh: fix regression in log to file
	Commit 36deff04 introduced a regression due to which virsh is not able
	to log to a file - msg_buf was changed from an array to a pointer
	without corresponding change to usage of "sizeof()".

	Fix regression in virsh logging

2011-04-30  Matthias Bolte  <matthias.bolte@googlemail.com>

	nwfilter: Fix memory leak in the ebtables subdriver
	Call shutdown functions for all subcomponents in nwfilterDriverShutdown.

	Make sure that this shutdown functions can safely be called multiple times
	and independent from the actual subcomponents state.

2011-04-30  Matthias Bolte  <matthias.bolte@googlemail.com>

	qemu: Fix qemuDomainModifyDeviceFlags leaking the caps bitmap

2011-04-30  Matthias Bolte  <matthias.bolte@googlemail.com>

	Fix memory leak in __virExec
	Commit e0d014f2379dd made binary potentially allocated on the heap.
	It was freed in the parent in the error path, but not in the success path
	that doesn't goto the cleanup label.

	Found by 'make -C tests valgrind'.

2011-04-30  Eric Blake  <eblake@redhat.com>

	hash: fix memory leak regression
	Commit 1671d1d introduced a memory leak in virHashFree, and
	wholesale table corruption in virHashRemoveSet (elements not
	requested to be freed are lost).

	* src/util/hash.c (virHashFree): Free bucket array.
	(virHashRemoveSet): Don't lose elements.
	* tests/hashtest.c (testHashCheckForEachCount): New method.
	(testHashCheckCount): Expose the bug.

2011-04-30  Cole Robinson  <crobinso@redhat.com>

	docs: Document <filesystem> device
	Tried to dredge through old changelogs and commits to come up with it, so
	may not be completely accurate.

	v2:
	Drop ambiguous 'containers'
	Use same mail archive for all links

2011-04-30  Eric Blake  <eblake@redhat.com>

	build: fix getcwd portability problems
	* bootstrap.conf (gnulib_modules): Add getcwd-lgpl.
	* tests/commandtest.c (checkoutput): Drop unused cwd.
	* tests/commandhelper.c (main): Let getcwd malloc.
	* tests/testutils.c (virTestMain): Likewise.
	* tools/virsh.c (cmdPwd): Likewise.
	(virshCmds): Expose cmdPwd and cmdCd on mingw.

2011-04-30  Eric Blake  <eblake@redhat.com>

	tests: simplify common setup
	A few of the tests were missing basic sanity checks, while most
	of them were doing copy-and-paste initialization (in fact, some
	of them pasted the argc > 1 check more than once!).  It's much
	nicer to do things in one common place, and minimizes the size of
	the next patch that fixes getcwd usage.

	* tests/testutils.h (EXIT_AM_HARDFAIL): New define.
	(progname, abs_srcdir): Define for all tests.
	(VIRT_TEST_MAIN): Change callback signature.
	* tests/testutils.c (virtTestMain): Do more common init.
	* tests/commandtest.c (mymain): Simplify.
	* tests/cputest.c (mymain): Likewise.
	* tests/esxutilstest.c (mymain): Likewise.
	* tests/eventtest.c (mymain): Likewise.
	* tests/hashtest.c (mymain): Likewise.
	* tests/networkxml2xmltest.c (mymain): Likewise.
	* tests/nodedevxml2xmltest.c (myname): Likewise.
	* tests/nodeinfotest.c (mymain): Likewise.
	* tests/nwfilterxml2xmltest.c (mymain): Likewise.
	* tests/qemuargv2xmltest.c (mymain): Likewise.
	* tests/qemuhelptest.c (mymain): Likewise.
	* tests/qemuxml2argvtest.c (mymain): Likewise.
	* tests/qemuxml2xmltest.c (mymain): Likewise.
	* tests/qparamtest.c (mymain): Likewise.
	* tests/sexpr2xmltest.c (mymain): Likewise.
	* tests/sockettest.c (mymain): Likewise.
	* tests/statstest.c (mymain): Likewise.
	* tests/storagepoolxml2xmltest.c (mymain): Likewise.
	* tests/storagevolxml2xmltest.c (mymain): Likewise.
	* tests/virbuftest.c (mymain): Likewise.
	* tests/virshtest.c (mymain): Likewise.
	* tests/vmx2xmltest.c (mymain): Likewise.
	* tests/xencapstest.c (mymain): Likewise.
	* tests/xmconfigtest.c (mymain): Likewise.
	* tests/xml2sexprtest.c (mymain): Likewise.
	* tests/xml2vmxtest.c (mymain): Likewise.

2011-04-29  Eric Blake  <eblake@redhat.com>

	build: avoid test warnings on mingw
	* .gnulib: Update to latest, for getaddrinfo fixes.
	Reported by Matthias Bolte.

2011-04-29  Eric Blake  <eblake@redhat.com>

	virsh: avoid compiler warning on mingw
	We don't use gnulib's sanitizations for vfprintf, but vshDebug
	was used with %zu, which means that it would fail on mingw.
	Thank goodness the compiler indirectly caught this for us :)

	virsh.c: In function 'vshDebug':
	virsh.c:12105:5: warning: function might be possible candidate for
	'ms_printf' format attribute [-Wmissing-format-attribute]

	since mingw <stdio.h> hasn't yet added gcc attributes to vfprintf.

	* tools/virsh.c (vshDebug): Avoid vfprintf.
	(vshPrintExtra): Use lighter-weight fputs.
	Reported by Matthias Bolte.

2011-04-29  KAMEZAWA Hiroyuki  <kamezawa.hiroyu@jp.fujitsu.com>

	libvirt/qemu - support persistent update of disks
	Support update of disks by MODIFY_CONFIG

	This patch includes changes for qemu's disk to support
	virDomainUpdateDeviceFlags() with VIR_DOMAIN_DEVICE_MODIFY_CONFIG.

	This patch adds support for CDROM/foppy disk types.


	* src/qemu/qemu_driver.c
	(qemuDomainUpdateDeviceConfig): support cdrom/floppy.

2011-04-29  Jim Fehlig  <jfehlig@novell.com>

	Xen: Do not generate net ifname if domain is inactive
	V2: Use virAsprintf instead of snprintf/strdup

	The xend driver will generate a virDomainNetDef ifname if one is not
	specified in xend sexpr, even if domain is inactive.  The result is
	network interface XML containing 'vif-1.Y' on dev attribute of target
	element, e.g.

	  <interface type='bridge'>
	    <target dev='vif-1.0'/>
	    ...

	This patch changes the behavior to only generate the ifname if not
	specified in xend sexpr *and* domain is not inactive (id != -1).

2011-04-29  Yufang Zhang  <yuzhang@redhat.com>

	xen: check if device is assigned to guest before reattaching
	Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=664059

	Reattaching pci device back to host without destroying guest or
	detaching device from guest would cause host to crash. This patch adds
	a check before doing device reattach. If the device is being assigned
	to guest, libvirt refuses to reattach device to host. The patch only
	works for Xen, for it just checks xenstore to get pci device
	information.

2011-04-28  Laine Stump  <laine@laine.org>

	network: fix return value of hostsFileWrite
	The lone caller to hostsFileWrite (and the callers for at least 3
	levels up the return stack) assume that the return value will be < 0
	on failure. However, hostsFileWrite returns 0 on success, and a
	positive errno on failure. This patch changes hostsFileWrite to return
	-errno on failure.

2011-04-28  Eric Blake  <eblake@redhat.com>

	maint: fix comment typos
	* src/esx/esx_driver.c: Fix spelling of 'relative'.
	* src/util/util.c: Likewise.

2011-04-28  Jiri Denemark  <jdenemar@redhat.com>

	build: Use pkg-config for libssh2 check
	Currently the build fails if /usr/local/include does not exist since
	its use is hardcoded in configure.ac

	build: Ignore old audit library
	Check for audit_encode_nv_string in libaudit so that ancient audit
	library is ignored rather than trying to compile with libaudit support
	and failing.

2011-04-28  Osier Yang  <jyang@redhat.com>

	util: Initialize hooks at daemon shutdown if no hooks defined
	We support to initialize the hooks at daemon reload if there is no
	hooks script is defined, we should also support initialize the hooks
	at daemon shutdown if no hooks is defined.

	To address bz: https://bugzilla.redhat.com/show_bug.cgi?id=688859

2011-04-28  Wen Congyang  <wency@cn.fujitsu.com>

	fix virsh's regression
	This patch does the following things:
	1. The return value of cmdSchedInfoUpdate() can be -1, 0 and 1. So the
	   type of return value should be int not bool.(This function is not a
	   entry of a virsh command, but the name of this function likes cmdXXX)

	2. The type of cmdSchedinfo()'s, cmdFreecell()'s, cmdPoolList()'s and
	   cmdVolList()'s return value is bool not int, so change the type of
	   variable ret_val, func_ret and functionReturn.

	3. Add a variable functionReturn for cmdMigrate(), cmdAttachInterface(),
	   cmdDetachInterface(), cmdAttachDisk() and cmdDetachDisk() to save the
	   return value.

	4. Change the type of variable ret in the function cmdAttachDevice(),
	   cmdDetachDevice(), cmdUpdateDevice(), cmdAttachInterface(),
	   cmdDetachInterface(), cmdAttachDisk() and cmdDetachDisk() to int, as
	   we use it to save the return value of virXXX() and the type of virXXX()'s
	   return value is int not bool.

	5. Do some cleanup when virBuff.error is 1.

	The bug 1-4 were introduced by commit b56fa5bb.

2011-04-28  KAMEZAWA Hiroyuki  <kamezawa.hiroyu@jp.fujitsu.com>

	libvirt/qemu - support persistent attach/detach disks
	Support changes of disks by MODIFY_CONFIG for qemu.

	This patch includes patches for qemu's disk to support
	virDomainAt(De)tachDeviceFlags with VIR_DOMAIN_DEVICE_MODIFY_CONFIG.

	Other devices can be added incrementally.


	* /src/conf/domain_conf.c
	(virDomainDiskIndexByName): returns array index of disk in vmdef.
	(virDomainDiskRemoveByName): removes a disk which has the name in vmdef.
	* src/qemu/qemu_driver.c
	(qemuDomainAttachDeviceConfig): add support for Disks.
	(qemuDomainDetachDeviceConfig): add support for Disks.

2011-04-28  KAMEZAWA Hiroyuki  <kamezawa.hiroyu@jp.fujitsu.com>

	libvirt/qemu - support persistent modification of devices
	This patch adds functions for modify domain's persistent definition.
	To do error recovery in easy way, we use a copy of vmdef and update it.

	The whole sequence will be:

	  make a copy of domain definition.

	  if (flags & MODIFY_CONFIG)
	      update copied domain definition
	  if (flags & MODIF_LIVE)
	      do hotplug.
	  if (no error)
	      save copied one to the file and update cached definition.
	  else
	      discard copied definition.

	This patch is mixuture of Eric Blake's work and mine.
	From: Eric Blake <eblake@redhat.com>

	(virDomainObjCopyPersistentDef): make a copy of persistent vm definition
	(qemuDomainAttach/Detach/UpdateDeviceConfig) : callbacks. now empty
	(qemuDomainModifyDeviceFlags): add support for MODIFY_CONFIG and MODIFY_CURRENT

2011-04-28  Eric Blake  <eblake@redhat.com>

	build: fix 32-bit test failure
	Same fix as commit 1fc288e1e25.

	* tests/hashtest.c (testHashRemoveForEach): Use correct format.

2011-04-27  Jiri Denemark  <jdenemar@redhat.com>

	util: Simplify hash implementation
	So far first entries for each hash key are stored directly in the hash
	table while other entries mapped to the same key are linked through
	pointers. As a result of that, the code is cluttered with special
	handling for the first items.

	This patch makes all entries (even the first ones) linked through
	pointers, which significantly simplifies the code and makes it more
	maintainable.

2011-04-27  Jiri Denemark  <jdenemar@redhat.com>

	tests: More unit tests for internal hash APIs
	This adds several tests for remaining hash APIs (custom
	hasher/comparator functions are not covered yet, though).

	All tests pass both before and after the "Simplify hash implementation".

2011-04-27  Osier Yang  <jyang@redhat.com>

	build: Fix problem of building Python bindings
	If one specify "--with-python=yes" but no python-devel package
	is installed, we ignore it with just a notice message, which
	doesn't give clear guide to user.

2011-04-27  Wen Congyang  <wency@cn.fujitsu.com>

	release PCI address only when we have ensured it successfully
	Steps to reproduce this bug:
	1. # cat net.xml # 00:03.0 has been used
	    <interface type='network'>
	      <mac address='52:54:00:04:72:f3'/>
	      <source network='default'/>
	      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
	    </interface>

	2. # virsh attach-device vm1 net.xml
	   error: Failed to attach device from net.xml
	   error: internal error unable to reserve PCI address 0:0:3

	3. # virsh attach-device vm1 net.xml
	   error: Failed to attach device from net.xml
	   error: internal error unable to execute QEMU command 'device_add': Device 'rtl8139' could not be initialized

	The reason of this bug is that: we can not reserve PCI address 0:0:3 because it has
	been used, but we release PCI address when we reserve it failed.

2011-04-27  Hu Tao  <hutao@cn.fujitsu.com>

	free memory properly in cleanup patch
	virsh schedinfo inactive-domain will trigger the problem.

2011-04-27  Wen Congyang  <wency@cn.fujitsu.com>

	free buf->content when vsnprintf() failed
	When buf->error is 1, we do not return buf->content in the function
	virBufferContentAndReset(). So we should free buf->content when
	vsnprintf() failed.

2011-04-27  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Fix dynamic dispatch for CastFromAnyType functions
	This was broken by the refactoring in ac1e6586ec75. It resulted in a
	segfault for 'virsh vol-dumpxml' and related volume functions.

	Before the refactoring all users of the ESX_VI__TEMPLATE__DISPATCH
	macro dispatched on the item type, as the item is the input to all those
	functions.

	Commit ac1e6586ec75 made the dynamically dispatched CastFromAnyType
	functions use this macro too, but this functions dispatched on the
	actual type of the AnyType object. The item is the output of the
	CastFromAnyType functions.

	This difference was missed in the refactoring, making CastFromAnyType
	functions dereferencing the item pointer that is NULL at the time of
	the dispatch.

2011-04-27  Matthias Bolte  <matthias.bolte@googlemail.com>

	Move call to virReportOOMError into virFileBuildPath
	Suggested by Daniel P. Berrange

2011-04-27  Eric Blake  <eblake@redhat.com>

	build: use gnulib passfd for simpler SCM_RIGHTS code
	* .gnulib: Update to latest for passfd fixes.
	* bootstrap.conf (gnulib_modules): Add passfd.
	* src/util/util.c (virFileOpenAs): Simplify.

2011-04-26  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Add flags checking in DomainCoreDump

2011-04-26  Mark Wu  <dwu@redhat.com>

	Make crash and live flags mutually exclusive in virDomainCoreDump
	They don't make any sense when used together.

2011-04-26  Guido Günther  <agx@sigxcpu.org>

	Make sure DNSMASQ_STATE_DIR exists
	otherwise the directory returned by networkDnsmasqLeaseFileName will not
	be created if ipdef->nhosts == 0 in networkBuildDnsmasqArgv.

2011-04-26  Matthias Bolte  <matthias.bolte@googlemail.com>

	Fix small memory leaks in config parsing related functions
	Found by 'make -C tests valgrind'.

	xen_xm.c: Dummy allocation via virDomainChrDefNew is directly
	overwritten and lost. Free 'script' in success path too.

	vmx.c: Free virtualDev_string in success path too.

	domain_conf.c: Free compression in success path too.

2011-04-26  Matthias Bolte  <matthias.bolte@googlemail.com>

	Add virDomainEventRebootNew
	This will be used in the ESX driver event handling.

2011-04-26  Eric Blake  <eblake@redhat.com>

	build: make VIR_FREE do some type checking
	We can exploit the fact that gcc warns about int-to-pointer conversion
	in ternary cond?(void*):(int) in order to prevent future mistakes of
	calling VIR_FREE on a scalar lvalue.  For example, between commits
	158ba873 and 802e2df, we would have had this warning:

	cc1: warnings being treated as errors
	remote.c: In function 'remoteDispatchListNetworks':
	remote.c:3684:70: error: pointer/integer type mismatch in conditional expression

	There are still a number of places that malloc into a const char*;
	while it would probably be worth scrubbing them to use char*
	instead, that is a separate patch, so we have to cast away const
	in VIR_FREE for now.

	* src/util/memory.h (VIR_FREE): Make gcc warn about integers.
	Iteratively developed from a patch by Christophe Fergeau.

2011-04-25  Eric Blake  <eblake@redhat.com>

	threads: add one-time initialization support
	mingw lacks the counterpart to PTHREAD_MUTEX_INITIALIZER, so the
	best we can do is portably expose once-only runtime initialization.

	* src/util/threads.h (virOnceControlPtr): New opaque type.
	(virOnceFunc): New callback type.
	(virOnce): New prototype.
	* src/util/threads-pthread.h (virOnceControl): Declare.
	(VIR_ONCE_CONTROL_INITIALIZER): Define.
	* src/util/threads-win32.h (virOnceControl)
	(VIR_ONCE_CONTROL_INITIALIZER): Likewise.
	* src/util/threads-pthread.c (virOnce): Implement in pthreads.
	* src/util/threads-win32.c (virOnce): Implement in WIN32.
	* src/libvirt_private.syms: Export it.

2011-04-24  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Add a wrapper for shared CURL handles
	To be used to share a CURL handle between multiple threads in the
	upcoming domain event support.

	esx: Move CURL handling code to it's own type

2011-04-23  Matthias Bolte  <matthias.bolte@googlemail.com>

	daemon: Don't try to free an unsigned int in error paths

	daemon: Honor error variable name change in the generator
	Commit 36b652138be renamed err to rerr, do the same in the generator.

2011-04-22  KAMEZAWA Hiroyuki  <kamezawa.hiroyu@jp.fujitsu.com>

	libvirt/qemu - clean up UpdateDevice for consolidation.
	This patch strips reusable part of qemuDomainUpdateDeviceFlags()
	and consolidate it to qemuDomainModifyDeviceFlags().
	No functional changes.

	* src/qemu/qemu_driver.c
	(qemuDomainChangeDiskMediaLive) : pulled out code for updating disks.
	(qemuDomainUpdateDeviceLive) : core of UpdateDevice, extracted from
	UpdateDeviceFlags()
	(qemuDomainModifyDeviceFlags): add support for updating device in live domain.
	(qemuDomainUpdateDeviceFlags): reworked as a wrapper function of
	qemuDomainModifyDeviceFlags()

2011-04-22  KAMEZAWA Hiroyuki  <kamezawa.hiroyu@jp.fujitsu.com>

	libvirt/qemu - clean up At(De)tachDeviceFlags() for consolidation.
	clean up At(De)tachDeviceFlags() for consolidation.

	qemuDomainAttachDeviceFlags()/qemuDomainDetachFlags()/
	qemuDomainUpdateDeviceFlags() has similar logics and copied codes.

	This patch series tries to unify them to use shared code when it can.
	At first, clean up At(De)tachDeviceFlags() and devide it into functions.

	By this, this patch pulls out shared components between functions.
	Based on patch series by Eric Blake, I added some modification as
	switch-case with QEMU_DEVICE_ATTACH, QEMU_DEVICE_DETACH, QEMU_DEVICE_UPDATE

	* src/qemu/qemu_driver.c
	(qemuDomainAt(De)tachDeviceFlags) : pulled out to qemuDomainModifyDeviceFlags()
	(qemuDomainModifyDeviceFlags) : implements generic code for modifying domain.
	(qemuDomainAt(De)tachDeviceFlagsLive) : code for at(de)taching devices to
	domain in line. no changes in logic from old code.
	(qemuDomainAt(De)tachDeviceDiskLive) : for at(de)taching Disks.
	(qemuDomainAt(De)tachDeviceControllerLive) : for at(de)taching Controllers

2011-04-22  KAMEZAWA Hiroyuki  <kamezawa.hiroyu@jp.fujitsu.com>

	libvirt/qemu - Centralize device modification in the more flexible APIs
	Centralize device modification in the more flexible APIs, to allow future
	honoring of additional flags.  Explicitly reject the
	VIR_DOMAIN_DEVICE_MODIFY_FORCE flag on attach/detach.

	Based on Eric Blake<eblake@redhat.com>'s work.

	* src/qemu/qemu_driver.c
	(qemudDomainAttachDevice)(qemudDomainAttachDeviceFlags): Swap bodies,rename...
	(qemudDomainDetachDevice, qemudDomainDetachDeviceFlags): Likewise.

2011-04-22  Michal Privoznik  <mprivozn@redhat.com>

	Add support for s390(x) cpu options parsing
	Up to now we missed parser for cpuinfo on x390(x) machines. Those machines
	have only 1 thread, core, socket. What is missing is information about
	CPU frequency.

2011-04-22  Daniel P. Berrange  <berrange@redhat.com>

	Fix QEMU tunnelled migration FD handling
	The two ends of the pipe used for feeding QEMU tunnelled
	migration data were interchanged, so QEMU got given the
	"write" end instead of the "read" end.

	The qemuMigrationPrepareTunnel method was also immediately
	closing the "write" end of the pipe, so the stream failed
	to actually write anything.

	* src/qemu/qemu_migration.c: Swap tunnelled migration
	  pipe FDs & don't close pipe given to stream

2011-04-21  Eric Blake  <eblake@redhat.com>

	build: fix 32-bit test failure
	ARRAY_CARDINALITY is typed as size_t, not long; this matters on 32-bit
	platforms:

	hashtest.c: In function 'testHashRemoveForEach':
	hashtest.c:114: error: format '%lu' expects type 'long unsigned int', but argument 4 has type 'unsigned int' [-Wformat]

	* tests/hashtest.c (testHashRemoveForEach): Use correct format.

2011-04-21  Jiri Denemark  <jdenemar@redhat.com>

	Remove artificial minimum limit for guest memory
	Remove the artificial minimum of 4096 KB for guest memory. It's drivers'
	job to set the limit if needed.

2011-04-21  Eduardo Otubo  <otubo@linux.vnet.ibm.com>

	PHYP: Adding reboot domain function
	Adding reboot <domain> function for pHyp driver.

2011-04-21  Eric Blake  <eblake@redhat.com>

	build: fix syntax-check failure
	* .mailmap: Add an alias for last commit.

2011-04-20  Wen Congyang  <wency cn fujitsu com>

	fix tunnelled migration's regression
	If the migrateFrom is "stdio" not "stdin", qemuBuildCommandLine()
	will convert it to exec:cat or fd:n.

2011-04-20  Stefan Berger  <stefanb@us.ibm.com>

	nwfilter: no support for direct type of interface
	Ebtables filtering doesn't work on macvtap device. Remove support for direct type of interface.

2011-04-19  Eric Blake  <eblake@redhat.com>

	virsh: nuke use of TRUE and FALSE
	Gnulib already guarantees <stdbool.h>, so it is easier to just
	use the standardized spellings.

	* tools/virsh.c (vshCmdDef): Change callback to return real bool.
	(__vshControl): Change several fields to bool.
	(vshCommandOptBool): Change return type.
	All callers updated.
	* tools/Makefile.am (virsh-net-edit.c, virsh-pool-edit.c):
	Likewise.

2011-04-19  Wen Congyang  <wency@cn.fujitsu.com>

	qemu: fix the check of virDomainObjUnref()'s return value
	If vm is unlocked in virDomainObjUnref(), the return value is 0, not less
	than 0.

2011-04-19  Markus Groß  <gross@univention.de>

	Add cputune support to libxl driver
	Here is a new version of this patch:
	https://www.redhat.com/archives/libvir-list/2011-April/msg00337.html

	v2:
	  - store the cputune info for the whole runtime of the domain
	  - remove cputune info when domain is destroyed

	The nodeGetInfo code had to be moved into a helper
	function to reuse it without a virConnectPtr.

2011-04-19  Matthias Bolte  <matthias.bolte@googlemail.com>

	Update and sort msg_gen_function list and mark unmarked messages
	Inspired by Eric Blake

2011-04-19  Eric Blake  <eblake@redhat.com>

	phyp: another simplification
	Rather than copying and pasting lots of code, factor it into a
	single helper function.

	This commit adds a warning if tighter integer parsing would fail
	due to any stray bytes after the number, but should not change
	any behavior other than the bug fix for phypNumDomainsGeneric
	looking only at numeric lines.

	* src/phyp/phyp_driver.c (phypExecInt): New function.
	(phypGetVIOSPartitionID, phypNumDomainsGeneric, phypGetLparID)
	(phypGetLparMem, phypGetLparCPUGeneric, phypGetRemoteSlot)
	(phypGetVIOSNextSlotNumber, phypAttachDevice)
	(phypGetStoragePoolSize, phypStoragePoolNumOfVolumes)
	(phypNumOfStoragePools, phypInterfaceDestroy)
	(phypInterfaceDefineXML, phypInterfaceLookupByName)
	(phypInterfaceIsActive, phypNumOfInterfaces): Use it.
	(phypNumDomainsGeneric): Correctly find numeric line.

2011-04-18  Eric Blake  <eblake@redhat.com>

	maint: ignore built file
	* .gitignore: Add exemption for hashtest.

2011-04-18  Daniel P. Berrange  <berrange@redhat.com>

	build: fix qemu build failure in previous patch
	This last minute addition caused a build failure

	cc1: warnings being treated as errors
	qemu/qemu_process.c: In function 'qemuProcessHandleWatchdog':
	qemu/qemu_process.c:436:34: error: ignoring return value of 'virDomainObjUnref', declared with attribute warn_unused_result [-Wunused-result]
	make[3]: *** [libvirt_driver_qemu_la-qemu_process.lo] Error 1

2011-04-18  Daniel P. Berrange  <berrange@redhat.com>

	Change some variable names to follow standard in daemon dispatcher
	Replace some occurrances of

	  virDomainPtr domain;
	  virNetworkPtr network;

	With

	  virDomainPtr dom;
	  virNetworkPtr net;

	* daemon/remote.c: Fix variable naming to follow standard

2011-04-18  Daniel P. Berrange  <berrange@redhat.com>

	Write error check conditionals in more compact form for dispatcher
	Replace cases of

	     type = virConnectGetType(conn);
	     if (type == NULL)
	         goto cleanup;

	With

	     if (!(type = virConnectGetType(conn)))
	         goto cleanup;

	* daemon/remote.c: Write error checks in compat form

2011-04-18  Daniel P. Berrange  <berrange@redhat.com>

	Remove curly braces on all single-line conditional jumps in dispatcher
	Replace all occurrances of

	   if (....) {
	      goto cleanup;
	   }

	With

	   if (.....)
	      goto cleanup;

	to save one line of code

	* daemon/remote.c: Remove curly braces on single line conditionals

2011-04-18  Daniel P. Berrange  <berrange@redhat.com>

	Fix checking of return codes in dispatcher
	The libvirt APIs reserve any negative value for indicating an
	error. Thus checks

	    if (virXXXX() == -1)

	Should instead be

	    if (virXXXX() < 0)

	* daemon/remote.c: s/ == -1/ < 0/

2011-04-18  Daniel P. Berrange  <berrange@redhat.com>

	Merge all returns paths from dispatcher into single path
	The dispatcher functions have numerous places where they
	return to the caller. This leads to duplicated cleanup
	code, often resulting in memory leaks. It makes it harder
	to ensure that errors are dispatched before freeing objects,
	which may overwrite the original error.

	The standard pattern is now

	    remoteDispatchXXX(...) {
	        int rv = -1;

	        ....
	        if (XXX < 0)
	          goto cleanup;
	        ...
	        if (XXXX < 0)
	          goto cleanup;
	        ...

	        rv = 0;
	    cleanup:
	        if (rv < 0)
	           remoteDispatchError(rerr);
	        ...free all other stuff..
	        return rv;
	    }

	* daemon/remote.c: Centralize all cleanup paths
	* daemon/stream.c: s/remoteDispatchConnError/remoteDispatchError/
	* daemon/dispatch.c, daemon/dispatch.h: Replace
	  remoteDispatchConnError with remoteDispatchError
	  removing unused virConnectPtr

2011-04-18  Alan Pevec  <apevec@redhat.com>

	Experimental libvirtd upstart job
	To install it, disable libvirtd sysv initscript:
	    chkconfig libvirtd off
	    service libvirtd stop

	and enable libvirtd upstart job:
	    cp  /usr/share/doc/libvirt-*/libvirtd.upstart \
	        /etc/init/libvirtd.conf
	    initctl reload-configuration
	    initctl start libvirtd

	Test:
	    initctl status libvirtd
	libvirtd start/running, process 3929
	    killall -9 libvirtd
	    initctl status libvirtd
	libvirtd start/running, process 4047

	I looked into the possibility to use the upstart script from Ubuntu or
	at least getting inspiration from it but that's not possible. "expect
	daemon" is a nice thing but it only works if the process is defined with
	exec stanza instead of script ... no script. Unfortunately, with exec
	stanza environment variables can only be set within upstart script
	(i.e., configuration in /etc/sysconfig/libvirtd can't work). Hence, we
	need to use script stanza, source sysconfig, and execute libvirtd
	without --daemon. For similar reasons we can't use limit stanza and need
	to handle DAEMON_COREFILE_LIMIT in job's script.

2011-04-18  Wen Congyang  <wency@cn.fujitsu.com>

	enhance processWatchdogEvent()
	This patch does the following two things:
	1. hold an extra reference while handling watchdog event
	   If the domain is not persistent, and qemu quits unexpectedly before
	   calling processWatchdogEvent(), vm will be freed and the function
	   processWatchdogEvent() will be dangerous.

	2. unlock qemu driver and vm before returning from processWatchdogEvent()
	   When the function processWatchdogEvent() failed, we only free wdEvent,
	   but forget to unlock qemu driver and vm, free dumpfile.

2011-04-18  Wen Congyang  <wency@cn.fujitsu.com>

	qemu: avoid qemu_driver being unlocked twice when virThreadPoolNew() failed
	We do not lock qemu_driver when calling virThreadPoolNew(). If it failed,
	we will unlock qemu_driver. It is dangerous.

	We may use this pool during auto starting domains. So we must create it before
	calling qemuAutostartDomains(). Otherwise, libvirtd will crash.

2011-04-17  Richard Laager  <rlaager@wiktel.com>

	Fix two out-of-date comments in LVM backend

2011-04-17  Matthias Bolte  <matthias.bolte@googlemail.com>

	xen: Replace statsErrorFunc with a macro
	Also mark error messages in block_stats.c for translation, add the
	new macro to the msg_gen functions in cfg.mk and add block_stats.c
	to po/POTFILES.in

	Remove virConnectPtr from virRaiseErrorFull
	And from all related macros and functions.

2011-04-16  Jiri Denemark  <jdenemar@redhat.com>

	tests: Unit tests for internal hash APIs
	This is a basic set of tests for testing removals of hash entries during
	iteration.

2011-04-16  Wen Congyang  <wency@cn.fujitsu.com>

	build: include esx_vi.generated.* into dist file
	commit d4601696 introduces two more generated files: esx_vi.generated.h
	and esx_vi.generated.h. But we do not include them into dist file.
	It will break building if using dist file to build.

2011-04-16  Eric Blake  <eblake@redhat.com>

	tests: test recent virsh option parsing changes
	* tests/virsh-optparse: New file.
	* tests/Makefile.am (test_scripts): Use it.

2011-04-16  Eric Blake  <eblake@redhat.com>

	virsh: fix regression in parsing optional integer
	Regression introduced in 0.8.5, commit c1564268.  The command
	'virsh freecell 0' quit working when it changed from an optional
	string to an optional integer.

	This patch introduces a slight change that specifying an option
	twice is now detected as an error.  It also changes things so
	that a command that has more than 1 required option will not
	complain about missing options if one but not all of the options
	were given in long format, as in 'virsh vol-create --pool p file',
	as well as making positional parsing work for all optional
	options (each positional argument is associated with the earliest
	option that has not yet been seen by name).

	Optional boolean options can appear before required argument
	options, because they don't affect positional argument parsing,
	and obviously a required boolean option makes no sense.

	Technically, this patch renders VSH_OT_STRING and VSH_OT_DATA
	redundant; but cleaning that up can be a separate patch.

	No command should ever need more than 32 options, right? :)

	* tools/virsh.c (vshCmddefGetData, vshCmddefGetOption)
	(vshCommandCheckOpts): Alter parameters to use bitmaps.
	(vshCmddefOptParse): New function.
	(vshCommandParse): Update for better handling of positional
	arguments.
	(vshCmddefHelp): Allow unit tests to validate options.

2011-04-16  Eric Blake  <eblake@redhat.com>

	virsh: list required options first
	The current state of virsh parsing is that:

	$ virsh vol-info /path/to/image
	$ virsh vol-info --pool default /path/to/image
	$ virsh vol-info --pool default --vol /path/to/image

	all lookup the volume by path (technically, the last two also attempt
	a name lookup within a pool, whereas the first skips that step, but
	the end result is the same); meanwhile:

	$ virsh vol-info default /path/to/image

	complains about unexpected data.  Why?  Because the --pool option is
	optional, so default was parsed as the --vol argument, and
	/path/to/image.img doesn't match up with any remaining options that
	require an argument.  For proof, note that:

	$ virsh vol-info default --vol /path/to/image

	complains about looking up 'default' - the parser mis-associated both
	arguments with --vol.  Given the above, the only way to specify pool
	is with an explicit "--pool" argument (you can't specify it
	positionally).  However, named arguments can appear in any order, so:

	$ virsh vol-info /path/to/image --pool default
	$ virsh vol-info --vol /path/to/image --pool default

	have also always worked.  Therefore, this patch has no functional
	change on vol-info option parsing, but only on 'virsh help vol-info'
	synopsis layout.  However, it also allows the next patch to 1) enforce
	that required options are always first (without this patch, the next
	patch would fail the testsuite), and 2) allow the user to omit the
	"--pool" argument.  That is, the next patch makes it possible to do:

	$ virsh vol-info /path/to/image default

	which to date was not possible.

	* tools/virsh.c (opts_vol_create_from, opts_vol_clone)
	(opts_vol_upload, opts_vol_download, opts_vol_delete)
	(opts_vol_wipe, opts_vol_info, opts_vol_dumpxml, opts_vol_key)
	(opts_vol_path): List optional pool parameter after required
	arguments.

2011-04-16  Eric Blake  <eblake@redhat.com>

	phyp: avoid memory leaks in command values
	* src/phyp/phyp_driver.c (phypExecBuffer): New function. Use it
	throughout file for less code, and for plugging a few leaks.

2011-04-16  Eric Blake  <eblake@redhat.com>

	phyp: use consistent return string handling
	Use the name 'ret' for all phypExec results, to make it easier
	to wrap phypExec.  Don't allow a possibly NULL ret through printf.

	* src/phyp/phyp_driver.c (phypBuildVolume, phypDestroyStoragePool)
	(phypBuildStoragePool, phypBuildLpar): Avoid NULL dereference.
	(phypInterfaceDestroy): Avoid redundant free.
	(phypVolumeLookupByPath, phypVolumeGetPath): Use consistent
	naming.

2011-04-16  Eric Blake  <eblake@redhat.com>

	phyp: prefer memcpy over memmove when legal
	* src/phyp/phyp_driver.c (phypUUIDTable_AddLpar)
	(phypGetLparUUID, phypGetStoragePoolUUID, phypVolumeGetXMLDesc)
	(phypGetStoragePoolXMLDesc): Use faster method.

	phyp: use consistent style for labels
	* src/phyp/phyp_driver.c: Match label style of rest of project.
	(phypExec, phypUUIDTable_Pull): Drop an extra label.

	phyp: more return handling cleanup
	* src/phyp/phyp_driver.c (phypInterfaceDestroy)
	(phypInterfaceDefineXML, phypInterfaceLookupByName)
	(phypInterfaceIsActive, phypListInterfaces, phypNumOfInterfaces):
	Clean up return handling of recent additions.

	phyp: avoid memory leak on failure
	* src/phyp/phyp_driver.c (phypUUIDTable_Init): Avoid memory leak
	on error.

2011-04-16  Eric Blake  <eblake@redhat.com>

	phyp: avoid a logic bug
	Ever since commit ebc46f, the destroy function built two command
	variants but only used one.  I went with the variant that matches
	the idiom used in the counterpart of phypBuildStoragePool.

	* src/phyp/phyp_driver.c (phypDestroyStoragePool): Avoid
	clobbering cmd.  Fix error message typo.

2011-04-16  Eric Blake  <eblake@redhat.com>

	maint: use lighter-weight function for straight appends
	It costs quite a few processor cycles to go through printf parsing
	just to determine that we only meant to append.

	* src/xen/xend_internal.c (xend_op_ext): Consolidate multiple
	printfs into one.
	* src/qemu/qemu_command.c (qemuBuildWatchdogDevStr)
	(qemuBuildUSBInputDevStr, qemuBuildSoundDevStr)
	(qemuBuildSoundCodecStr, qemuBuildVideoDevStr): Likewise.
	(qemuBuildCpuArgStr, qemuBuildCommandLine): Prefer virBufferAdd
	over virBufferVsprintf for trivial appends.
	* src/phyp/phyp_driver.c (phypExec, phypUUIDTable_Push)
	(phypUUIDTable_Pull): Likewise.
	* src/conf/nwfilter_conf.c (macProtocolIDFormatter)
	(arpOpcodeFormatter, formatIPProtocolID, printStringItems)
	(virNWFilterPrintStateMatchFlags, virNWIPAddressFormat)
	(virNWFilterDefFormat): Likewise.
	* src/security/virt-aa-helper.c (main): Likewise.
	* src/util/sexpr.c (sexpr2string): Likewise.
	* src/xenxs/xen_sxpr.c (xenFormatSxprChr): Likewise.
	* src/xenxs/xen_xm.c (xenFormatXMDisk): Likewise.

2011-04-16  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Fix gcc 4.6 warning about initialized but unused variables
	This warnings come from partly generated code. Therefore, the best
	solution is to mark them as potentially being unused using the
	ATTRIBUTE_UNUSED macro. This is suggested by the gcc documentation.

	Reported by Christophe Fergeau

2011-04-16  Alexander Todorov  <atodorov@otb.bg>

	libvirt-guests: implement START_DELAY
	Allow libvirt-guests to stage a delay between guest startups,
	to avoid system load caused by back-to-back startup.

2011-04-15  Eric Blake  <eblake@redhat.com>

	maint: silence cppi warnings
	* src/nodeinfo.c (linuxNodeInfoCPUPopulate): Fix indentation of
	last patch.

2011-04-15  Laine Stump  <laine@laine.org>

	network: truncate bridges' dummy tap device names to IFNAMSIZ (15) chars
	This patch addresses:

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

	In order to give each libvirt-created bridge a fixed MAC address,
	commit 5754dbd56d4738112a86776c09e810e32f7c3224, added code to create
	a dummy tap device with guaranteed lowest MAC address and attach it to
	the bridge. This tap device was given the name "${bridgename}-nic".
	However, an interface device name must be IFNAMSIZ (15) characters or
	less, so a valid ${bridgename} such as "verylongname123" (15
	characters) would lead to an invalid tap device name
	("verylongname123-nic" - 19 characters), and that in turn led to a
	failure to bring up the network.

	The solution is to shorten the part of the original name used to
	generate the tap device name. However, simply truncating it is
	insufficient, because the last few characters of an interface name are
	often a number used to indicate one of a list of several similar
	devices (for example, "verylongname123", "verylongname124", etc) and
	simple truncation would lead to duplicate names (eg "verlongnam-nic"
	and "verylongnam-nic"). So instead we take the first 8 characters of
	$bridgename ("verylong" in the example), add on the final 3 bytes
	("123"), then add "-nic" (so "verylong123-nic").  Not pretty, but it
	is much more likely to generate a unique name, and is reproducible
	(unlike, say, a random number).

2011-04-15  Stefan Berger  <stefanb@us.ibm.com>

	ppc: Enable starting of Qemu VMs on ppc host
	Due to differences in /proc/cpuinfo the parsing of the cpu data is
	different between architectures. On PPC /proc/cpuinfo looks like this:

	[original formatting with tabs]

	processor    : 0
	cpu          : PPC970MP, altivec supported
	clock        : 2297.700000MHz
	revision     : 1.1 (pvr 0044 0101)

	processor    : 1
	cpu          : PPC970MP, altivec supported
	clock        : 2297.700000MHz
	revision     : 1.1 (pvr 0044 0101)

	[..]

	timebase     : 14318000
	platform     : pSeries
	model        : IBM,8844-AC1
	machine      : CHRP IBM,8844-AC1

	The patch adapts the parsing of the data found in /proc/cpuinfo.

	/sys/devices/system/cpu/cpuX/topology/physical_package_id also
	always returns -1. Check for it on ppc and make it '0' if found negative.

2011-04-15  Stefan Berger  <stefanb@us.ibm.com>

	Migrate VMs between different-endianess hosts
	This patch enables the migration of Qemu VMs between hosts of different endianess. I tested this by migrating a i686 VM between a x86 and ppc64 host.

	I am converting the 'int's in the VM's state header to uint32_t assuming this doesn't break compatibility with existing deployments other than Linux.

2011-04-15  Christophe Fergeau  <cfergeau@redhat.com>

	Fix gcc 4.6 warnings in vbox_tmpl.c

2011-04-15  Christophe Fergeau  <cfergeau@redhat.com>

	Fix gcc 4.6 warnings
	gcc 4.6 warns when a variable is initialized but isn't used afterwards:

	vmware/vmware_driver.c:449:18: warning: variable 'vmxPath' set but not used [-Wunused-but-set-variable]

	This patch fixes these warnings. There are still 2 offending files:

	- vbox_tmpl.c: the variable is used inside an #ifdef and is assigned several
	  times outside of #ifdef. Fixing the warning would have required wrapping
	  all the assignment inside #ifdef which hurts readability.

	vbox/vbox_tmpl.c: In function 'vboxAttachDrives':
	vbox/vbox_tmpl.c:3918:22: warning: variable 'accessMode' set but not used [-Wunused-but-set-variable]

	- esx_vi_types.generated.c: the name implies it's generated code and I
	  didn't want to dive into the code generator

	esx/esx_vi_types.generated.c: In function 'esxVI_FileQueryFlags_Free':
	esx/esx_vi_types.generated.c:1203:3: warning: variable 'item' set but not used [-Wunused-but-set-variable]

2011-04-15  Michal Novotny  <minovotn@redhat.com>

	Introduce virDomainChrDefNew()
	Make: passed
	Make check: passed
	Make syntax-check: passed

	this is the commit to introduce the function to create new character
	device definition for the domain as advised by Cole Robinson
	<crobinso@redhat.com>.

	The function is used on the relevant places and also new tests has
	been added.

2011-04-15  Michal Privoznik  <mprivozn@redhat.com>

	Spice: support audio, images and stream compression
	This extends the SPICE XML to allow variable compression settings for audio,
	images and streaming:
	    <graphics type='spice' port='5901' tlsPort='-1' autoport='yes'>
	        <image compression='auto_glz'/>
	        <jpeg compression='auto'/>
	        <zlib compression='auto'/>
	        <playback compression='on'/>
	    </graphics>

	All new elements are optional.

2011-04-14  Hu Tao  <hutao@cn.fujitsu.com>

	free cpumask of vcpupinDef
	cpumask doesn't get freed when vcpupinDef being freed, this leaks
	memory.

2011-04-14  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Make the parsed URI part of the private connection data
	This will be used to make esxVI_Context clonable.

	Also move cleanup code for esxPrivate to esxFreePrivate().

2011-04-14  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Mark error message in macros for translation

	esx: Extend VI generator to cover managed object types
	Generate lookup functions for managed object types.

	esx: Cleanup and refactor CastFromAnyType macros
	Add CastFromAnyType functions for the String type.

	esx: Cleanup VI generator code

2011-04-14  Michal Privoznik  <mprivozn@redhat.com>

	network: Fix NULL dereference during error recovery
	This fixes: https://bugzilla.redhat.com/show_bug.cgi?id=696660

	While starting a network, if brSetForwardDelay() fails, we go to err1
	where we want to access macTapIfName variable which was just
	VIR_FREE'd a few lines above. Instead, keep macTapIfName until we are
	certain of success.

2011-04-14  Matthias Bolte  <matthias.bolte@googlemail.com>

	docs: Serial and parallel device target ports actually start from 0
	Reported by Igor Galić

2011-04-14  Daniel P. Berrange  <berrange@redhat.com>

	Add missing checks for QEMU domain state in tunables APIs
	The methods qemuDomain{Get,Set}{Memory,Blkio,Scheduler}Parameters
	all forgot to do a check on virDomainIsActive(), resulting in bogus
	error messages from later parts of their impl

	* src/qemu/qemu_driver.c: Add missing checks on virDomainIsActive()

2011-04-14  Matthias Bolte  <matthias.bolte@googlemail.com>

	phyp: Fix too small buffer allocation in phypAttachDevice
	sizeof(domain->name) is the wrong thing. Instead of using strdup here
	rewrite escape_specialcharacters to allocate the buffer itself.

	Add a contains_specialcharacters to be used in phypOpen, as phypOpen is
	not interested in the escaped version.

2011-04-14  Matthias Bolte  <matthias.bolte@googlemail.com>

	phyp: Don't overwrite error from virDomainDeviceDefParse by OOM error

	phyp: Don't try to use a string from a failed virAsprintf

	phyp: Reduce code duplication in error and success paths
	Also fix memory leaks along the way in phypCreateServerSCSIAdapter and
	phypAttachDevice.

2011-04-14  Matthias Bolte  <matthias.bolte@googlemail.com>

	phyp: Remove stack allocating a 4kb volume key and fix related memory leaks
	Don't pre-allocate 4kb per key, make phypVolumeGetKey allocate the memory.

	Make phypBuildVolume return the volume key instead of using pre-allocated
	memory to store it.

	Also fix a memory leak in phypVolumeLookupByName when phypVolumeGetKey
	fails. Fix another memory leak in phypVolumeLookupByPath in the success
	path. Fix phypVolumeGetXMLDesc leaking voldef.key.

2011-04-14  Daniel P. Berrange  <berrange@redhat.com>

	Remove C99 variable declare in PHYP network driver
	Move the virInterfacePtr declaration to the top of the
	function to avoid jump uninitialized variable warnings

	* src/phyp/phyp_driver.c: Fix var declaration

2011-04-14  Daniel P. Berrange  <berrange@redhat.com>

	Replace REMOTE_DEBUG with VIR_DEBUG in daemon dispatcher
	The daemon dispatcher code had an obsolete macro

	  #define REMOTE_DEBUG(fmt, ...) VIR_DEBUG(fmt, __VA_ARGS__)

	This can be trivially removed

	* daemon/remote.c: s/REMOTE_DEBUG/VIR_DEBUG/

2011-04-14  Daniel P. Berrange  <berrange@redhat.com>

	Add missing checks for whether the connection is open in dispatcher
	Many functions did not check for whether a connection was
	open. Replace the macro which obscures control flow, with
	explicit checks, and ensure all dispatcher code has checks.

	* daemon/remote.c: Add connection checks

2011-04-14  Daniel P. Berrange  <berrange@redhat.com>

	Standard on error variable name in libvirtd dispatcher
	Some dispatcher methods have a parameter

	            remote_error *err,

	Instead of the more normal

	            remote_error *rerr,

	* daemon/remote.c: s/err/rerr/

2011-04-14  Daniel P. Berrange  <berrange@redhat.com>

	Remove all whitespace before function brackets in daemon dispatcher
	A lot of code in libvirtd's dispatcher used the style

	    dom = get_nonnull_domain (conn, args->dom);

	Instead of the normal libvirt style

	    dom = get_nonnull_domain(conn, args->dom);

	* daemon/remote.c: Remove all whitelist before function brackets

2011-04-14  Eduardo Otubo  <otubo@linux.vnet.ibm.com>

	PHYP: Adding network interface
	This is the implementation of the previous patch now using virInterface*
	API. Ended up this patch got much more simpler, smaller and easier to
	review. Here is some details:

	  * MAC size and interface name are fixed due to specifications on HMC,
	    both are created automatically and CAN'T be specified from user. They
	    have the following format:

	     * MAC: 122980003002
	     * Interface name: U9124.720.067BE8B-V3-C0

	  * I did replaced all the |grep|sed following the comments Eric Blake
	    did on the last patch.

	  * According to my last email, It's not possible to create a network
	    interface without assigning it to a specific lpar. Then, I am using
	    this very minimalistic XML file for testing:

	     <interface type='ethernet' name='LPAR01'>
	     </interface>

	    In this file I am using "name" as the lpar name which I am going to
	    assign the new network interface. I couldn't find a better way to
	    refer to it. Comments are welcome.

	  * Regarding the fact I am sleeping one second waiting for the HMC to
	    complete creation of the interface, I don't have means to check
	    if the whole process is done. All I do is execute a command, wait
	    until is complete (which is not enough in this case) check
	    the return and the exit status. The process of actually creating
	    a networking interface seems to take a little longer than just the
	    return of the ssh control.

2011-04-13  Hu Tao  <hutao@cn.fujitsu.com>

	qemu: fix a dead-lock problem
	In qemuDomainObjBeginJobWithDriver, when virCondWaitUntil timeouts,
	the function tries to call qemuDriverLock with virDomainObj locked,
	this causes the dead-lock problem. This patch fixes this.

2011-04-13  Jiri Denemark  <jdenemar@redhat.com>

	util: Fix crash when removing entries during hash iteration
	Commit 9677cd33eea4c65d78ba463b46b8b45ed2da1709 made it possible to
	remove current entry when iterating through all hash entries. However,
	it didn't properly handle a special case of removing first entry
	assigned to a given key which contains several entries in its collision
	list.

2011-04-12  Michal Privoznik  <mprivozn@redhat.com>

	Fix possible infinite loop in remote driver
	When we take out completed calls from queue we might end up
	in circular pointer. We don't want pointer to previous item
	point to element taken out.

2011-04-12  Eric Blake  <eblake@redhat.com>

	maint: fix grammar errors
	Jim Meyering recently improved gnulib to catch various grammar
	errors during 'make syntax-check'.

	* .gnulib: Update to latest, for syntax-check improvements.
	* include/libvirt/libvirt.h.in (virConnectAuthCallbackPtr): Use
	cannot rather than two words.
	* src/driver.c: Likewise.
	* src/driver.h (VIR_SECRET_GET_VALUE_INTERNAL_CALL): Likewise.
	* src/remote/remote_driver.c (initialize_gnutls): Likewise.
	* src/util/pci.c (pciBindDeviceToStub): Likewise.
	* src/storage/storage_backend.c (virStorageBackendCreateQemuImg):
	Likewise.
	(virStorageBackendUpdateVolTargetInfoFD): Avoid doubled word.
	* docs/formatdomain.html.in: Likewise.
	* src/qemu/qemu_process.c (qemuProcessStart): Likewise.
	* cfg.mk (exclude_file_name_regexp--sc_prohibit_can_not)
	(exclude_file_name_regexp--sc_prohibit_doubled_word): Exclude
	existing translation problems.

2011-04-11  Eric Blake  <eblake@redhat.com>

	docs: document freecell --all
	Based on a smaller patch developed by Moritoshi Oshiro:
	https://bugzilla.redhat.com/show_bug.cgi?id=693963

	* tools/virsh.pod (freecell): Mention all, and clarify that
	optional cellno requires --cellno.

2011-04-10  Matthias Bolte  <matthias.bolte@googlemail.com>

	xen: Remove PATH_MAX sized stack allocation from block stats code

2011-04-09  Taku Izumi  <izumi.taku@jp.fujitsu.com>

	setmaxmem: add the new options to "virsh setmaxmem" command
	This patch adds the new options (--live, --config, and --current) to
	"virsh setmaxmem" command. The behavior of above options is the same
	as that of "virsh setmem".  When the --config option is specified, a
	modification is effective for the persistent domain, while the --live
	option is specified, a modification is effective for an active
	domain. The --current option is specified, it affects a current
	domain.

	maxmem: implement virDomainSetMaxMemory API of the qemu driver
	This patch implements the code to support virDomainSetMaxMemory API,
	and to support VIR_DOMAIN_MEM_MAXIMUM flag in qemudDomainSetMemoryFlags function.
	As a result, we can change the maximum memory size of inactive QEMU guests.

	maxmem: introduces VIR_DOMAIN_MEM_MAXIMUM flag
	This patch introduces VIR_DOMAIN_MEM_MAXIMUM flag.

2011-04-09  Jean-Baptiste Rouault  <jean-baptiste.rouault@diateam.net>

	docs: remove "returns" word from beginning of lines
	Move "returns" keyword from beginning of API doc lines
	when it does not describe return values.
	Maybe the API doc extractor could be changed to look for
	"returns: " to avoid such confusion.

2011-04-09  Eric Blake  <eblake@redhat.com>

	build: really fix mingw startup
	Aargh; commit 8ae5dfd still didn't fix the mingw problem, because
	gnulib defined O_NONBLOCK to 0 for just mingw.  I've now fixed
	that in gnulib, but we need the latest pipe2 for libvirt to work.

	* .gnulib: Update to latest, for pipe2 fixes.

2011-04-08  Eric Blake  <eblake@redhat.com>

	build: fix mingw build
	Commit 02c39a2 introduced a mingw build regression, due to a
	regression in gnulib's areadlink module:

	../../../gnulib/lib/careadlinkat.c: In function 'careadlinkat':
	../../../gnulib/lib/careadlinkat.c:143:39: error: 'const struct allocator' has no member named 'malloc'

	* .gnulib: Update to latest, for careadlinkat fix.

2011-04-08  Eric Blake  <eblake@redhat.com>

	docs: tweak virsh restore warning
	* tools/virsh.pod: Fix grammar, and clarify wording.
	* src/qemu/qemu_driver.c (qemudDomainObjStart): Drop redundant
	condition.

2011-04-08  Wen Congyang  <wency@cn.fujitsu.com>

	do not build libvirt_iohelper when building without libvirtd
	The libexec program libvirt_iohelper is only for libvirtd. If we build rpm
	without libvirtd, we will receive the following messages:

	Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/wency/rpmbuild/BUILDROOT/libvirt-0.9.0-1.el6.x86_64
	error: Installed (but unpackaged) file(s) found:
	   /usr/libexec/libvirt_iohelper

2011-04-08  Stefan Berger  <stefanb@us.ibm.com>

	nwfilters: support for TCP flags evaluation
	This patch adds support for the evaluation of TCP flags in nwfilters.

	It adds documentation to the web page and extends the tests as well.
	Also, the nwfilter schema is extended.

	The following are some example for rules using the tcp flags:

	<rule action='accept' direction='in'>
	    <tcp state='NONE' flags='SYN/ALL' dsptportstart='80'/>
	</rule>
	<rule action='drop' direction='in'>
	    <tcp state='NONE' flags='SYN/ALL'/>
	</rule>

2011-04-08  Taku Izumi  <izumi.taku@jp.fujitsu.com>

	setmem: add --current option to virsh setmem command
	This patch adds the new option (--current) to the "virsh setmem" command.
	When --current option is specified, it affects a "current" domain.
	The word "current" denotes that if a domain is running, it affects
	a running domain only; otherwise it affects a persistent domain.

2011-04-08  Taku Izumi  <izumi.taku@jp.fujitsu.com>

	setmem: add VIR_DOMAIN_MEM_CURRENT support to qemu
	This patch adds virDomainSetMemoryFlags(,,VIR_DOMAIN_MEM_CURRENT) support
	code to qemu driver.

	Also, change virDomainObjIsActive to return bool, given its usage.

2011-04-08  Taku Izumi  <izumi.taku@jp.fujitsu.com>

	setmem: introduce VIR_DOMAIN_MEM_CURRENT flag
	This patch introduces VIR_DOMAIN_MEM_CURRENT flag and
	modifies virDomainSetMemoryFlags function to support it.

2011-04-08  Jim Fehlig  <jfehlig@novell.com>

	build: Install libxenlight log dir
	Add $localstatedir/log/libvirt/libxl when building libxenlight driver

2011-04-08  Taku Izumi  <izumi.taku@jp.fujitsu.com>

	setmaxmem: remove the code to invoke virDomainSetMemory in cmdSetmaxmem
	When the new maximum memory size becomes less than the current memory size,
	I think it is not the libvirt client but the each driver that decides the behavior
	(reject the operation or shrink the current memory size).

2011-04-08  Eric Blake  <eblake@redhat.com>

	virsh: fix mingw startup
	* .gnulib: Update to latest, for pipe2.
	* bootstrap.conf (gnulib_modules): Add pipe2.
	* src/util/event_poll.c (virEventPollInit): Use it, to avoid
	problematic virSetCloseExec on mingw.

2011-04-08  Eric Blake  <eblake@redhat.com>

	build: fix gitignore sorting
	Make it so we don't have to 'git add -f' particular files like
	po/POTFILES.in all the time (tested by fixing one of our
	special-case files as part of the patch).

	* .gnulib: Update to latest.
	* bootstrap: Resync from coreutils.
	* .gitignore: Sort whitelist entries correctly, including ignoring
	files rather than directories.
	* m4/virt-compile-warnings.m4: Convert tabs to space.

2011-04-08  Laine Stump  <laine@laine.org>

	docs: add an IPv6 address to network XML examples
	It was just pointed out that, although I added documentation for the
	IPv6 additions to the network XML, I neglected to use those additions
	in the examples. This patch adds an IPv6 address to each of the
	examples except for the "default" network, since that is a faithful
	reproduction of the default network config that's automatically
	installed, which doesn't include any IPv6 address (for good reason -
	because there is no such thing as IPv6 NAT, there is no one IPv6
	address that would work for all installations).

2011-04-08  Markus Groß  <gross@univention.de>

	Add domainSet/GetSchedulerParameters to libxl driver
	Libxenlight currently only supports the credit scheduler.
	Therefore setting or getting a parameter of other
	schedulers raise an error (for now).

2011-04-07  Osier Yang  <jyang@redhat.com>

	qemu: Remove the managed state file only if restoring succeeded
	1) Both "qemuDomainStartWithFlags" and "qemuAutostartDomain" try to
	restore the domain from managedsave'ed image if it exists (by
	invoking "qemuDomainObjRestore"), but it unlinks the image even
	if restoring fails, which causes data loss. (This problem exists
	for "virsh managedsave dom; virsh start dom").

	The fix for is to unlink the managed state file only if restoring
	succeeded.

	2) For "virsh save dom; virsh restore dom;", it can cause data
	corruption if one reuse the saved state file for restoring. Add
	doc to tell user about it.

	3) In "qemuDomainObjStart", if "managed_save" is NULL, we shouldn't
	fallback to start the domain, skipping it to cleanup as a incidental
	fix. Discovered by Eric.

2011-04-07  Wen Congyang  <wency@cn.fujitsu.com>

	reattach pci devices when qemuPrepareHostdevPCIDevices() failed
	Reattach all pci devices that we detached when qemuPrepareHostdevPCIDevices()
	failed.

	reattach pci device when pciBindDeviceToStub() failed
	We should bind pci device to original driver when pciBindDeviceToStub() failed.
	If the pci device is not bound to any driver before calling pciBindDeviceToStub(),
	we should only unbind it from pci-stub. If it is bound to pci-stub, we should not
	unbind it from pci-stub.

	rename pciUnBindDeviceFromStub() to pciUnbindDeviceFromStub() and float it up
	This patch do the following things:
	1. rename the function as 'Unbind' is better than 'UnBind'.
	2. pciUnbindDeviceFromStub() will be used in the function pciBindDeviceToStub() in
	   next patch. Float it up, instead of having to have a forward declaration

	remove devices from driver->activePciHostdevs when qemuPrepareHostdevPCIDevices() failed
	We should not mark pci devices as active when qemuPrepareHostdevPCIDevices()
	failed.

	pci: avoid invalid free, init path to NULL
	This bug was introduce by commit 57162db8, and it will cause libvirtd crashed.

2011-04-07  Eric Blake  <eblake@redhat.com>

	build: avoid compiler warning on cygwin
	In file included from util/threads.c:31:
	util/threads-pthread.c: In function 'virThreadSelfID':
	util/threads-pthread.c:214: warning: cast from function call of type 'pthread_t' to non-matching type 'int' [-Wbad-function-cast]

	* src/util/threads-pthread.c (virThreadSelfID) [!SYS_gettid]:
	Add intermediate cast to silence gcc.

2011-04-07  Markus Groß  <gross@univention.de>

	Add domainIsUpdated to libxl driver

2011-04-07  Jim Fehlig  <jfehlig@novell.com>

	Fix build for older gcc
	With gcc 4.3.4 I'm seeing the following warning failure

	cc1: warnings being treated as errors
	cc1: error: -funit-at-a-time is required for inlining of functions
	that are only called once [-Wdisabled-optimization]

	Add -funit-at-a-time to WARN_CFLAGS.

2011-04-07  Serge Hallyn  <serge.hallyn@canonical.com>

	Change locking for udev monitor and callbacks
	We're seeing bugs apparently resulting from thread unsafety of
	libpciaccess, such as
	https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/726099
	To prevent those, as suggested by danpb on irc, move the
	nodeDeviceLock(driverState) higher into the callers.  In
	particular:

	  udevDeviceMonitorStartup should hold the lock while calling
	  udevEnumerateDevices(), and udevEventHandleCallback should hold it
	  over its entire execution.

	It's not clear to me whether it is ok to hold the
	nodeDeviceLock while taking the virNodeDeviceObjLock(dev) on a
	device.  If not, then the lock will need to be dropped around
	the calling of udevSetupSystemDev(), and udevAddOneDevice()
	may not actually be safe to call from higher layers with the
	driverstate lock held.

	libvirt 0.8.8 with this patch on it seems to work fine for me.
	Assuming it looks ok and I haven't done anything obviously dumb,
	I'll ask the bug submitters to try this patch.

2011-04-07  Eric Blake  <eblake@redhat.com>

	tests: fix recent test failures
	* tests/qemuxml2argvdata/qemuxml2argv-*.args: Reflect reserved VGA
	port change.

2011-04-06  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Support for overriding NPROC limit
	This patch adds max_processes option to qemu.conf which can be used to
	override system default limit on number of processes that are allowed to
	be running for qemu user.

2011-04-06  Osier Yang  <jyang@redhat.com>

	qemu: Always reserves slot 0x02 for primary VGA.
	To address https://bugzilla.redhat.com/show_bug.cgi?id=692355

	This fix is to reserve slot 0x02 for primary VGA even if there
	is no "video" specified in domain XML to avoid the problem.

2011-04-06  Eric Blake  <eblake@redhat.com>

	libxl: avoid compiler warning
	cc1: warnings being treated as errors
	libxl/libxl_driver.c: In function 'libxlDomainSetVcpusFlags':
	libxl/libxl_driver.c:1570:14: error: cast from function call of type 'double' to non-matching type 'unsigned int' [-Wbad-function-cast]
	libxl/libxl_driver.c:1578:15: error: cast from function call of type 'double' to non-matching type 'unsigned int' [-Wbad-function-cast]

	This was the only use of floor() and ceil(), and floating-point
	is overkill for power-of-two manipulations.

	* src/libxl/libxl_driver.c (libxlDomainSetVcpusFlags): Avoid -lm
	for trivial computations.

2011-04-06  Daniel P. Berrange  <berrange@redhat.com>

	Fix typo in systemtap tapset directory name
	The systemtap directory for tapsets is called

	  /usr/share/systemtap/tapset

	Not

	 /usr/share/systemtap/tapsets

	* daemon/Makefile.am,libvirt.spec.in: s/tapsets/tapset/

2011-04-06  Daniel P. Berrange  <berrange@redhat.com>

	Don't try to enable stack protector on Win32
	The GCC Win32 compiler will claim to support -fstack-protector,
	but if it actually gets triggered by a suitable code pattern,
	linking will fail. Other non-Linux OS likely suffer the same
	way with gcc.

	* m4/virt-compile-warnings.m4: Only use stack protector when
	  the build target is Linux.

2011-04-06  Daniel P. Berrange  <berrange@redhat.com>

	Avoid compiler warnings about int -> void * casts
	GCC is a little confused about the cast of beginthread/beginthreadex
	from unsigned long -> void *. Go via an intermediate variable avoids
	the bogus warning, and makes the code a little cleaner

	* src/util/threads-win32.c: Avoid compiler warning in cast

2011-04-05  Daniel P. Berrange  <berrange@redhat.com>

	Improve SCSI volume key generation
	The SCSI volumes get a better 'key' field based on the fully
	qualified volume path. All SCSI volumes have a unique serial
	available in hardware which can be obtained by sending a
	suitable SCSI command. Call out to udev's 'scsi_id' command
	to fetch this value

	* src/storage/storage_backend_scsi.c: Improve volume key
	  field value stability and uniqueness

2011-04-05  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Ignore unusable binaries
	When initializing qemu guest capabilities, we should ignore qemu
	binaries that we are not able to extract version/help info from since
	they will be unusable for creating domains anyway. Ignoring them is also
	much better than letting initialization of qemu driver fail.

	qemu: Rewrite LOOKUP_PTYS macro into a function
	The macro is huge and gives us nothing but headache when maintaining it.

2011-04-05  Daniel P. Berrange  <berrange@redhat.com>

	Enable use of -Wold-style-definition compiler flag
	A couple of functions were declared using the old style foo()
	for no-parameters, instead of foo(void)

	* src/xen/xen_hypervisor.c, tests/testutils.c: Replace () with (void)
	  in some function declarations
	* m4/virt-compile-warnings.m4: Enable -Wold-style-definition

2011-04-05  Daniel P. Berrange  <berrange@redhat.com>

	Enable use of -Wmissing-noreturn
	* src/internal.h: Define a ATTRIBUTE_NO_RETURN annotation
	* src/lxc/lxc_container.c: Annotate lxcContainerDummyChild
	  with ATTRIBUTE_NO_RETURN
	* tests/eventtest.c: Mark async thread as ATTRIBUTE_NO_RETURN
	* m4/virt-compile-warnings.m4: Enable -Wmissing-noreturn

2011-04-05  Daniel P. Berrange  <berrange@redhat.com>

	Enable -Wmissing-format-attribute warning
	Add a couple of missing ATTRIBUTE_FMT_PRINTF annotations

	* tools/virsh.c, tests/testutils.c: Add printf format attribute
	* m4/virt-compile-warnings.m4: Enable -Wmissing-format-attribute

2011-04-05  Daniel P. Berrange  <berrange@redhat.com>

	Remove acinclude.m4 file
	Split the bit acinclude.m4 file into smaller pieces named
	as m4/virt-XXXXX.m4

	* .gitignore: Ignore gettext related files
	* acinclude.m4: Delete
	* m4/virt-compile-warnings.m4: Checks for GCC compiler flags
	* m4/virt-pkgconfig-back-compat.m4: Backcompat check for
	  pkgconfig program

2011-04-05  Daniel P. Berrange  <berrange@redhat.com>

	Use gnulib's manywarnings & warnings modules
	Remove custom code for checking compiler warnings, using
	gl_WARN_ADD instead. Don't list all flags ourselves, use
	gnulib's gl_MANYWARN_ALL_GCC to get all possible GCC flags,
	then turn off the ones we don't want yet.

	* acinclude.m4: Rewrite to use gl_WARN_ADD and gl_MANYWARN_ALL_GCC
	* bootstrap.conf: Add warnings & manywarnings
	* configure.ac: Switch to gl_WARN_ADD
	* m4/compiler-flags.m4: Obsoleted by gl_WARN_ADD

2011-04-05  Daniel P. Berrange  <berrange@redhat.com>

	Remove possible uninitialized variable in openvz driver
	* src/openvz/openvz_driver.c: Initialize saveptr variable

2011-04-05  Matthias Bolte  <matthias.bolte@googlemail.com>

	Use virBufferPtr for sexpr2string instead of manual buffer handling
	Removes 4kb stack allocation in the XenD subdriver.

	xend: Remove 4kb stack allocation

	uml: Remove PATH_MAX sized stack allocation from /proc parsing code

	storage: Remove PATH_MAX sized stack allocation from iSCSI backend

	qemu: Remove PATH_MAX sized stack allocation used in commandline building

	Remove PATH_MAX sized stack allocation from virFileOpenTtyAt

2011-04-05  Matthias Bolte  <matthias.bolte@googlemail.com>

	openvz: Remove several larger stack allocations
	Replace openvz_readline with getline in several places to get rid of stack
	allocated buffers to hold lines.

	openvzReadConfigParam allocates memory for return values instead of
	expecting a preexisting buffer.

2011-04-05  Matthias Bolte  <matthias.bolte@googlemail.com>

	daemon: Remove 4kb stack allocation of security label

	virsh: Remove two 4kb stack allocations

2011-04-05  Matthias Bolte  <matthias.bolte@googlemail.com>

	Use virFileAbsPath instead of manually creating the absolute path
	Removes multiple 4kb stack allocations.

	Removes TODO comments as suggested by Daniel P. Berrange.

2011-04-05  Matthias Bolte  <matthias.bolte@googlemail.com>

	xenxs: Remove PATH_MAX sized stack allocation in XM script parsing

	sasl: Remove stack allocated 8kb temporary buffers
	Move the buffers to the heap allocated client/private data structs.

2011-04-05  Matthias Bolte  <matthias.bolte@googlemail.com>

	qemu: Use heap allocated memory to read the monitor greeting
	Removing a 4kb stack allocation.

	Reduce stack buffer for virStrerror to the common 1kb instead of 4kb.

2011-04-05  Matthias Bolte  <matthias.bolte@googlemail.com>

	phyp: Remove 16kb stack allocation
	Allocate on the heap instead.

	virt-aa-helper: Remove PATH_MAX sized stack allocations

	ebtables: Remove PATH_MAX sized stack allocation

	pci: Remove PATH_MAX sized stack allocations
	Use virAsprintf instead of snprintf.

	Remove PATH_MAX sized stack allocations related to virFileBuildPath
	Make virFileBuildPath operate on the heap instead of the stack. It
	allocates a buffer instead of expecting a preexisting buffer.

	vmx: Use case-insensitive compare functions for all content

	vmx: Support persistent CPU shares

2011-04-05  Markus Groß  <gross@univention.de>

	Add autostart support to libxl driver
	The domainSetAutostart function is nearly identical to the one from qemu.

2011-04-05  Jesse Cook  <code.crashenx@gmail.com>

	Allow relative path for qemu backing file
	This patch enables the relative backing file path support provided by
	qemu-img create.

	If a relative path is specified for the backing file, it is converted
	to an absolute path using the storage pool path. The absolute path is
	used to verify that the backing file exists. If the backing file exists,
	the relative path is allowed and will be provided to qemu-img create.

2011-04-05  Eric Blake  <eblake@redhat.com>

	build: detect potentential uninitialized variables
	Even with -Wuninitialized (which is part of autobuild.sh
	--enable-compile-warnings=error), gcc does NOT catch this
	use of an uninitialized variable:

	{
	  if (cond)
	    goto error;
	  int a = 1;
	error:
	  printf("%d", a);
	}

	which prints 0 (supposing the stack started life wiped) if
	cond was true.  Clang will catch it, but we don't use clang
	as often.  Using gcc -Wjump-misses-init catches it, but also
	gives false positives:

	{
	  if (cond)
	    goto error;
	  int a = 1;
	  return a;
	error:
	  return 0;
	}

	Here, a was never used in the scope of the error block, so
	declaring it after goto is technically fine (and clang agrees).
	However, given that our HACKING already documents a preference
	to C89 decl-before-statement, the false positive warning is
	enough of a prod to comply with HACKING.

	[Personally, I'd _really_ rather use C99 decl-after-statement
	to minimize scope, but until gcc can efficiently and reliably
	catch scoping and uninitialized usage bugs, I'll settle with
	the compromise of enforcing a coding standard that happens to
	reject false positives if it can also detect real bugs.]

	* acinclude.m4 (LIBVIRT_COMPILE_WARNINGS): Add -Wjump-misses-init.
	* src/util/util.c (__virExec): Adjust offenders.
	* src/conf/domain_conf.c (virDomainTimerDefParseXML): Likewise.
	* src/remote/remote_driver.c (doRemoteOpen): Likewise.
	* src/phyp/phyp_driver.c (phypGetLparNAME, phypGetLparProfile)
	(phypGetVIOSFreeSCSIAdapter, phypVolumeGetKey)
	(phypGetStoragePoolDevice)
	(phypVolumeGetPhysicalVolumeByStoragePool)
	(phypVolumeGetPath): Likewise.
	* src/vbox/vbox_tmpl.c (vboxNetworkUndefineDestroy)
	(vboxNetworkCreate, vboxNetworkDumpXML)
	(vboxNetworkDefineCreateXML): Likewise.
	* src/xenapi/xenapi_driver.c (getCapsObject)
	(xenapiDomainDumpXML): Likewise.
	* src/xenapi/xenapi_utils.c (createVMRecordFromXml): Likewise.
	* src/security/security_selinux.c (SELinuxGenNewContext):
	Likewise.
	* src/qemu/qemu_command.c (qemuBuildCommandLine): Likewise.
	* src/qemu/qemu_hotplug.c (qemuDomainChangeEjectableMedia):
	Likewise.
	* src/qemu/qemu_process.c (qemuProcessWaitForMonitor): Likewise.
	* src/qemu/qemu_monitor_text.c (qemuMonitorTextGetPtyPaths):
	Likewise.
	* src/qemu/qemu_driver.c (qemudDomainShutdown)
	(qemudDomainBlockStats, qemudDomainMemoryPeek): Likewise.
	* src/storage/storage_backend_iscsi.c
	(virStorageBackendCreateIfaceIQN): Likewise.
	* src/node_device/node_device_udev.c (udevProcessPCI): Likewise.

2011-04-04  Daniel Veillard  <veillard@redhat.com>

	Release of libvirt-0.9.0
	* configure.ac docs/news.html.in libvirt.spec.in: update for the release
	* po/*.po*: update polish translation and regenerate

2011-04-03  Wen Congyang  <wency@cn.fujitsu.com>

	fix memory leak in qemuProcessHandleGraphics()
	If strdup("x509dname") or strdup("saslUsername") success, but
	strdup(x509dname) or strdup(saslUsername) failed, subject->nidentity
	is not the num elements of subject->identities, and we will leak some
	memory.

	do not lock vm while allocating memory
	There is no need to lock vm while allocating memory. If allocating
	memory failed, we forgot to unlock vm.

2011-04-02  Eric Blake  <eblake@redhat.com>

	docs: fix typo
	* docs/formatdomain.html.in: Fix KVM name.

	docs: correct invalid xml
	* docs/internals.html.in: Fix xml errors.
	* docs/formatstorageencryption.html.in: Likewise.
	* docs/drvesx.html.in: Likewise.
	* docs/archnetwork.html.in: Likewise.
	* docs/logging.html.in: Likewise.
	* docs/drvvmware.html.in: Likewise.
	* docs/api.html.in: Likewise.
	* docs/formatnwfilter.html.in: Likewise.
	* docs/formatdomain.html.in: Likewise.
	* docs/windows.html.in: Likewise.

2011-04-01  Eric Blake  <eblake@redhat.com>

	virsh: fix mingw failure on creating nonblocking pipe
	* .gnulib: Update to latest, for nonblocking module.
	* bootstrap.conf (gnulib_modules): Add nonblocking.
	* src/util/util.c (virSetBlocking): Defer to gnulib.

2011-04-01  Daniel Veillard  <veillard@redhat.com>

	Fix libxl driver startup
	  When you happen to have a libvirtd binary compiled with the
	libxenlight driver (say you have installed xen-4.1 libraries)
	but not running a xen enabled system, then libvirtd fails to start.

	The cause is that libxlStartup() returns -1 when failing to initialize
	the library, and this propagates to virStateInitialize() which consider
	this a failure. We should only exit libxlStartup with an error code
	if something like an allocation error occurs, not if the driver failed
	to initialize.

	* src/libxl/libxl_driver.c: fix libxlStartup() to not return -1
	  when failing to initialize the libxenlight library

2011-04-01  Jiri Denemark  <jdenemar@redhat.com>

	virsh: Fix documentation for memtune command
	Commit 78ba748ef14c520ff1c4af2b5b0a44586ac49c8c claims to fix
	documentation for swap_hard_limit virsh memtune option but it only fixes
	documentation in formatdomain.html and libvirt.h. This patch completes
	the task by fixing "virsh help memtune" output and memtune section of
	virsh man page.

2011-04-01  Guido Günther  <agx@sigxcpu.org>

	Make check_fc_host() and check_vport_capable() usable as rvalues
	as needed on non linux ports using HAL.

2011-04-01  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Ignore libvirt debug messages in qemu log
	qemu driver uses a 4K buffer for reading qemu log file. This is enough
	when only qemu's output is present in the log file. However, when
	debugging messages are turned on, intermediate libvirt process fills the
	log with a bunch of debugging messages before it executes qemu binary.
	In such a case the buffer may become too small. However, we are not
	really interested in libvirt messages so they can be filtered out from
	the buffer.

2011-04-01  Osier Yang  <jyang@redhat.com>

	qemu: Fix improper logic of qemuCgroupSetup
	It throws errors as long as the cgroup controller is not available,
	regardless of whether we really want to use it to do setup or not,
	which is not what we want, fixing it with throwing error when need
	to use the controller.

	And change "VIR_WARN" to "qemuReportError" for memory controller
	incidentally.

2011-04-01  Wen Congyang  <wency@cn.fujitsu.com>

	free tmp after unlinking it
	We create a temporary file to save memory, and we will remove it after reading
	memory to buffer. But we free the variable that contains the temporary filename
	before we remove it. So we should free tmp after unlinking it.

2011-04-01  Michal Privoznik  <mprivozn@redhat.com>

	Fix several formatting mistakes in doc

2011-04-01  Daniel P. Berrange  <berrange@redhat.com>

	Remove iohelper on Win32 since it is not required
	The iohelper binary is not required on Win32, although it compiles
	without trouble. Simply remove it from the RPM.

	* mingw32-libvirt.spec.in: Remove iohelper

2011-03-31  Daniel P. Berrange  <berrange@redhat.com>

	Fix domain events C example on Win32
	printf on Win32 does not necessarily support %lld and we don't
	have GNULIBs wrapper for printf(). Switch to use asprintf() for
	which we do have a gnulib wrapper with %lld support

	* examples/domain-events/events-c/event-test.c: Fix formatting
	  of %lld on Win32
	* cfg.mk: Don't require use of virAsprintf since this is an
	  example app for out of tree users to follow

2011-03-31  Eric Blake  <eblake@redhat.com>

	maint: avoid locale-sensitivity in string case comparisons
	strcase{cmp/str} have the drawback of being sensitive to the global
	locale; this is unacceptable in a library setting.  Prefer a
	hard-coded C locale alternative for all but virsh, which is user
	facing and where the global locale isn't changing externally.

	* .gnulib: Update to latest, for c-strcasestr change.
	* bootstrap.conf (gnulib_modules): Drop strcasestr, add c-strcase
	and c-strcasestr.
	* cfg.mk (sc_avoid_strcase): New rule.
	(exclude_file_name_regexp--sc_avoid_strcase): New exception.
	* src/internal.h (STRCASEEQ, STRCASENEQ, STRCASEEQLEN)
	(STRCASENEQLEN): Adjust offenders.
	* src/qemu/qemu_monitor_text.c (qemuMonitorTextEjectMedia):
	Likewise.
	* tools/virsh.c (namesorter): Document exception.

2011-03-31  Eric Blake  <eblake@redhat.com>

	docs: mention C89 syntax preferences
	* docs/hacking.html.in (Code formatting): Document that // comment
	and declaration-after-statement are discouraged.
	* HACKING: Regenerate.

2011-03-31  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Fix media eject with qemu-0.12.*
	In qemu-0.12.* "device '...' is locked" message was changed to "Device
	..." so libvirt was no longer detecting this as an error.

2011-03-30  Daniel Veillard  <veillard@redhat.com>

	The next release is 0.9.0 not 0.8.9
	Fix this which went into documentation

2011-03-30  Wen Congyang  <wency@cn.fujitsu.com>

	check whether qemuMonitorJSONHMP() failed
	If qemu quited unexpectedly when we call qemuMonitorJSONHMP(),
	libvirt will crash.
	Steps to reproduce this bug:
	1. use gdb to attach libvirtd, and set a breakpoint in the function
	   qemuMonitorSetCapabilities()
	2. start a vm
	3. let the libvirtd to run until qemuMonitorJSONSetCapabilities() returns.
	4. kill the qemu process
	5. continue running libvirtd

2011-03-30  Wen Congyang  <wency@cn.fujitsu.com>

	do not send monitor command after monitor meet error
	If the monitor met a error, and we will call qemuProcessHandleMonitorEOF().
	But we may try to send monitor command after qemuProcessHandleMonitorEOF()
	returned. Then libvirtd will be blocked in qemuMonitorSend().

	Steps to reproduce this bug:
	1. use gdb to attach libvirtd, and set a breakpoint in the function
	   qemuConnectMonitor()
	2. start a vm
	3. let the libvirtd to run until qemuMonitorOpen() returns.
	4. kill the qemu process
	5. continue running libvirtd

2011-03-30  Hu Tao  <hutao@cn.fujitsu.com>

	qemu: unlock qemu driver before return from domain save
	qemuDriverUnlock() wasn't called on 2 exit paths
	* src/qemu/qemu_driver.c: fix qemudDomainSave() to always unlock
	  the driver before exiting on error

2011-03-30  Naoya Horiguchi  <n-horiguchi@ah.jp.nec.com>

	extend logging to record configuration-related changes
	Currently libvirt's default logging is limited and it is difficult to
	determine what was happening when a proglem occurred (especially on a
	machines where one don't know the detail.)  This patch helps to do that
	by making additional logging available for the following events:

	  creating/defining/undefining domains
	  creating/defining/undefining/starting/stopping networks
	  creating/defining/undefining/starting/stopping storage pools
	  creating/defining/undefining/starting/stopping storage volumes.

	* AUTHORS: add Naoya Horiguchi
	* src/network/bridge_driver.c src/qemu/qemu_driver.c
	  src/storage/storage_driver.c: provide more VIR_INFO logging

2011-03-30  Daniel Veillard  <veillard@redhat.com>

	Add libvirt_iohelper to spec file
	The new iohelper binary was missing from the packaging spec

2011-03-29  Osier Yang  <jyang@redhat.com>

	cputune: New tests for cputune XML
	v1 - v2:
	  * Add missed tests/qemuxml2argvdata/qemuxml2argv-cputune.args

	cputune: Support cputune for xend driver
	Not sure if it's the correct way to add cputune xml for xend driver,
	and besides, seems "xm driver" and "xen hypervisor" also support
	vcpu affinity, do we need to add support for them too?

	cputune: Support cputune for lxc driver
	LXC driver doesn't support vcpu affinity yet, so just need
	to modify it to support cpu shares.

2011-03-29  Osier Yang  <jyang@redhat.com>

	cputune: Support cputune for qemu driver
	When domain startup, setting cpu affinity and cpu shares according
	to the cputune xml specified in domain xml.

	Modify "qemudDomainPinVcpu" to update domain config for vcpupin,
	and modify "qemuSetSchedulerParameters" to update domain config
	for cpu shares.

	v1 - v2:
	   * Use "VIR_ALLOC_N" instead of "VIR_ALLOC_VAR"
	   * But keep raising error when it fails on adding vcpupin xml
	     entry, as I still don't have a better idea yet.

2011-03-29  Osier Yang  <jyang@redhat.com>

	cputune: Implementations of parsing and formating cputune xml
	Implementations of following functions:
	  virDomainVcpupinIsDuplicate
	  virDomainVcpupinFindByVcpu
	  virDomainVcpupinAdd

	Update "virDomainDefParseXML" to parse, and "virDomainDefFormatXML"
	to build cputune xml, also implementations of new internal helper
	functions.

	v1 - v2:
	  * Resolve potential crash bug of "virDomainVcpupinAdd"

2011-03-29  Osier Yang  <jyang@redhat.com>

	cputune: Add data structures presenting cputune XML
	Also related new functions' declaration, and expose the new introduced
	functions in libvirt_private.syms.

	v1 - v2:
	  Don't expose "virAllocVar" in libvirt_private.syms

2011-03-29  Osier Yang  <jyang@redhat.com>

	cputune: Add document for cputune XML
	v1 - v3:
	  * More clear document for "cpu shares", adopted suggestions from
	    Matthias Bottle and Daniel Veillard.

	cputune: Add XML schema for cputune xml
	v1 - v2:
	  * Remove upper limit of cpu shares. (Suggested by Matthias Bottle)

2011-03-29  Eric Blake  <eblake@redhat.com>

	qemu: fix regression with fd labeling on migration
	My earlier testing for commit 34fa0de0 was done while starting
	just-built libvirt from an unconfined_t shell, where the fds happened
	to work when transferring to qemu.  But when installed and run under
	virtd_t, failure to label the raw file (with no compression) or the
	pipe (with compression) triggers SELinux failures when passing fds
	over SCM_RIGHTS to svirt_t qemu.

	* src/qemu/qemu_migration.c (qemuMigrationToFile): When passing
	FDs, make sure they are labeled.

2011-03-29  Eric Blake  <eblake@redhat.com>

	qemu: improve error message on failed fd transfer
	First fallout of fd: migration - it looks like SELinux enforcing
	_does_ require fd labeling (running uninstalled libvirtd from an
	unconstrained shell had no problems, but once faked out by doing
	 chcon `stat -c %C /usr/sbin/libvirtd` daemon/libvirtd
	 run_init $PWD/daemon/libvirtd
	to run it with the same context as an init script service, and with
	SELinux enforcing, I got a rather confusing failure:
	error: Failed to save domain fedora_12 to fed12.img
	error: internal error unable to send TAP file handle: No file descriptor supplied via SCM_RIGHTS

	This fixes the error message, then I need to figure out a subsequent
	patch that does the fsetfilecon() necessary to keep things happy.
	It also appears that libvirtd hangs on a failed fd transfer; I don't
	know if that needs an independent fix.

	* src/qemu/qemu_monitor_text.c (qemuMonitorTextSendFileHandle):
	Improve message, since TAP is no longer only client.

2011-03-29  Eric Blake  <eblake@redhat.com>

	maint: ignore new built file
	* .gitignore: Exclude libvirt_iohelper.

2011-03-29  Markus Groß  <gross@univention.de>

	Add domainSuspend/Resume to libxl driver
	* src/libxl/libxl_driver.c: implements libxlDomainSuspend and
	  libxlDomainResume

	Add domainGetOSType to libxl driver
	* src/libxl/libxl_driver.c: implements libxlDomainGetOSType

	Add domainGetSchedulerType to libxl driver
	* src/libxl/libxl_driver.c: implements libxlDomainGetSchedulerType

	Implements domainXMLTo/FromNative in libxl driver
	* src/Makefile.am src/libvirt_private.syms configure.ac: share and
	  reuse the sexpr routines from sexpr.h of the old xen driver
	* src/libxl/libxl_driver.c: implements libxlDomainXMLFromNative and
	  libxlDomainXMLToNative

2011-03-29  Markus Groß  <gross@univention.de>

	Add vcpu functions to libxl driver
	Hook the virtual cpu functions to their libxenlight counterparts

	* src/libxl/libxl_driver.c: implements libxlDomainSetVcpus,
	  libxlDomainGetVcpus, libxlDomainSetVcpusFlags,
	  libxlDomainGetVcpusFlags and libxlDomainPinVcpu

2011-03-29  Markus Groß  <gross@univention.de>

	List authors in copyright headers
	* src/libxl/libxl_conf.[ch] src/libxl/libxl_driver.[ch]: add authors
	  after the licence template

	Add event callbacks to libxl driver
	* src/libxl/libxl_conf.h: add the necessary fields to the driver
	  private structure
	* src/libxl/libxl_driver.c: add lifecycle event support and entry
	  points for event(de)register(any)

	Ignore return value of virDomainObjUnref
	* src/libxl/libxl_driver.c: use ignore_value() in libxlDomainObjUnref
	  and libxlCreateDomEvents

2011-03-29  Daniel P. Berrange  <berrange@redhat.com>

	Fix infinite loop in daemon if client quits with multiple streams open
	The daemon loops over the linked list of streams when a client
	quits, closing any that the client hadn't already closed. Except
	it didn't ever move to the next element in the list!

	* daemon/stream.c: Fix loop over linked list of streams

2011-03-29  Daniel P. Berrange  <berrange@redhat.com>

	Remote protocol support for storage vol upload/download APIs
	* daemon/remote.c, src/remote/remote_driver.c: Implementation
	  of storage vol upload/download APIs
	* src/remote/remote_protocol.x: Wire protocol definition for
	  upload/download
	* daemon/remote_dispatch_args.h, daemon/remote_dispatch_prototypes.h,
	  daemon/remote_dispatch_table.h, src/remote/remote_protocol.h,
	  src/remote/remote_protocol.c: Re-generate

2011-03-29  Daniel P. Berrange  <berrange@redhat.com>

	Support volume data upload/download APIs in storage driver
	Use generic FD streams to allow data upload/download to/from
	any storage volume

	* src/storage/storage_driver.c: Wire up upload/download APIs

2011-03-29  Daniel P. Berrange  <berrange@redhat.com>

	Add vol-upload and vol-download commands to virsh
	The new commands vol-upload and vol-download, allow a local file
	to be transferred to/from a storage volume.

	* tools/virsh.c: Add vol-upload and vol-download commands
	* tools/virsh.pod: Document new commands

2011-03-29  Daniel P. Berrange  <berrange@redhat.com>

	Add public APIs for storage volume upload/download
	New APIs are added allowing streaming of content to/from
	storage volumes.

	* include/libvirt/libvirt.h.in: Add virStorageVolUpload and
	  virStorageVolDownload APIs
	* src/driver.h, src/libvirt.c, src/libvirt_public.syms: Stub
	  code for new APIs
	* src/storage/storage_driver.c, src/esx/esx_storage_driver.c:
	  Add dummy entries in driver table for new APIs

2011-03-29  Daniel P. Berrange  <berrange@redhat.com>

	Enhance the streams helper to support plain file I/O
	The O_NONBLOCK flag doesn't work as desired on plain files
	or block devices. Introduce an I/O helper program that does
	the blocking I/O operations, communicating over a pipe that
	can support O_NONBLOCK

	* src/fdstream.c, src/fdstream.h: Add non-blocking I/O
	  on plain files/block devices
	* src/Makefile.am, src/util/iohelper.c: I/O helper program
	* src/qemu/qemu_driver.c, src/lxc/lxc_driver.c,
	  src/uml/uml_driver.c, src/xen/xen_driver.c: Update for
	  streams API change

2011-03-29  Daniel P. Berrange  <berrange@redhat.com>

	Update event loop example programs to demonstrate best practice
	The example C event loop code is a nasty hack and not compliant
	with the require API semantics. Delete this, so that developers
	don't mistakenly copy it. Instead call the new public event loop
	APIs.

	Update the python event loop example, so that it can optionally
	use the public event APIs, as an alternative to the pure python
	code. The pure python event code is a good working example, so
	don't delete it.

	Also make the python example use a read only connection to avoid
	authentication prompts

	* examples/domain-events/events-c/event-test.c: Replace event
	  loop code with use of public APIs
	* examples/domain-events/events-python/event-test.py: Allow
	  optional use of new public event APIs

2011-03-29  Eric Blake  <eblake@redhat.com>

	qemu: fix regression that hangs on save failure
	Regression introduced in commit 6034ddd55.

	* src/qemu/qemu_driver.c (qemudDomainSaveFlag): Jump to correct
	label.

2011-03-29  Eric Blake  <eblake@redhat.com>

	build: fix compilation on mingw
	* src/util/command.c (virCommandAbort) [WIN32]: Provide stub.
	Reported by Daniel P. Berrange's autobuilder.

2011-03-29  Eric Blake  <eblake@redhat.com>

	qemu: support fd: migration with compression
	Spawn the compressor ourselves, instead of requiring the shell.

	* src/qemu/qemu_migration.c (qemuMigrationToFile): Spawn
	compression helper process when needed.

2011-03-29  Eric Blake  <eblake@redhat.com>

	qemu: skip granting access during fd migration
	SELinux labeling and cgroup ACLs aren't required if we hand a
	pre-opened fd to qemu.  All the more reason to love fd: migration.

	* src/qemu/qemu_migration.c (qemuMigrationToFile): Skip steps
	that are irrelevant in fd migration.

2011-03-29  Eric Blake  <eblake@redhat.com>

	qemu: consolidate migration to file code
	This points out that core dumps (still) don't work for root-squash
	NFS, since the fd is not opened correctly.  This patch should not
	introduce any functionality change, it is just a refactoring to
	avoid duplicated code.

	* src/qemu/qemu_migration.h (qemuMigrationToFile): New prototype.
	* src/qemu/qemu_migration.c (qemuMigrationToFile): New function.
	* src/qemu/qemu_driver.c (qemudDomainSaveFlag, doCoreDump): Use
	it.

2011-03-29  Eric Blake  <eblake@redhat.com>

	qemu: use common API for reading difficult files
	Direct access to an open file is so much simpler than passing
	everything through a pipe!

	* src/qemu/qemu_driver.c (qemudOpenAsUID)
	(qemudDomainSaveImageClose): Delete.
	(qemudDomainSaveImageOpen): Rename...
	(qemuDomainSaveImageOpen): ...and drop read_pid argument.  Use
	virFileOpenAs instead of qemudOpenAsUID.
	(qemudDomainSaveImageStartVM, qemudDomainRestore)
	(qemudDomainObjRestore): Rename...
	(qemuDomainSaveImageStartVM, qemuDomainRestore)
	(qemDomainObjRestore): ...and simplify accordingly.
	(qemudDomainObjStart, qemuDriver): Update callers.

2011-03-29  Eric Blake  <eblake@redhat.com>

	qemu, storage: improve type safety
	* src/storage/storage_backend.c (createRawFileOpHook): Change
	signature.
	(struct createRawFileOpHookData): Delete unused struct.
	(virStorageBackendCreateRaw): Adjust caller.
	* src/qemu/qemu_driver.c (struct fileOpHookData): Delete unused
	struct.
	(qemudDomainSaveFileOpHook): Rename...
	(qemuDomainSaveFileOpHook): ...and change signature.
	(qemudDomainSaveFlag): Adjust caller.

2011-03-29  Eric Blake  <eblake@redhat.com>

	util: adjust indentation in previous patch
	Separating the indentation from the real patch made review easier.

	* src/util/util.c (virFileOpenAs): Whitespace changes.

2011-03-29  Eric Blake  <eblake@redhat.com>

	util: rename virFileOperation to virFileOpenAs
	This patch intentionally doesn't change indentation, in order to
	make it easier to review the real changes.

	* src/util/util.h (VIR_FILE_OP_RETURN_FD, virFileOperationHook):
	Delete.
	(virFileOperation): Rename...
	(virFileOpenAs): ...and reduce parameters.
	* src/util/util.c (virFileOperationNoFork, virFileOperation):
	Rename and simplify.
	* src/qemu/qemu_driver.c (qemudDomainSaveFlag): Adjust caller.
	* src/storage/storage_backend.c (virStorageBackendCreateRaw):
	Likewise.
	* src/libvirt_private.syms: Reflect rename.

2011-03-29  Eric Blake  <eblake@redhat.com>

	storage: simplify fd handling
	* src/storage/storage_backend.c (virStorageBackendCreateRaw): Use
	new virFileOperation flag.

2011-03-29  Eric Blake  <eblake@redhat.com>

	qemu: simplify domain save fd handling
	This makes root-squash NFS saves more efficient.

	* src/qemu/qemu_driver.c (qemudDomainSaveFlag): Use new
	virFileOperation flag to open fd only once.

2011-03-29  Eric Blake  <eblake@redhat.com>

	util: use SCM_RIGHTS in virFileOperation when needed
	Currently, the hook function in virFileOperation is extremely limited:
	it must be async-signal-safe, and cannot modify any memory in the
	parent process.  It is much handier to return a valid fd and operate
	on it in the parent than to deal with hook restrictions.

	* src/util/util.h (VIR_FILE_OP_RETURN_FD): New flag.
	* src/util/util.c (virFileOperationNoFork, virFileOperation):
	Honor new flag.

2011-03-29  Eric Blake  <eblake@redhat.com>

	qemu: allow simple domain save to use fd: protocol
	This allows direct saves (no compression, no root-squash NFS) to use
	the more efficient fd: migration, which in turn avoids a race where
	qemu exec: migration can sometimes fail because qemu does a generic
	waitpid() that conflicts with the pclose() used by exec:.  Further
	patches will solve compression and root-squash NFS.

	* src/qemu/qemu_driver.c (qemudDomainSaveFlag): Use new function
	when there is no compression.

2011-03-29  Eric Blake  <eblake@redhat.com>

	qemu: fix restoring a compressed save image
	Latent bug introduced in commit 2d6a581960 (Aug 2009), but not exposed
	until commit 1859939a (Jan 2011).  Basically, when virExec creates a
	pipe, it always marks libvirt's side as cloexec.  If libvirt then
	wants to hand that pipe to another child process, things work great if
	the fd is dup2()'d onto stdin or stdout (as with stdin: or exec:
	migration), but if the pipe is instead used as-is (such as with fd:
	migration) then qemu sees EBADF because the fd was closed at exec().

	This is a minimal fix for the problem at hand; it is slightly racy,
	but no more racy than the rest of libvirt fd handling, including the
	case of uncompressed save images.  A more invasive fix, but ultimately
	safer at avoiding leaking unintended fds, would be to _always and
	atomically_ open all fds as cloexec in libvirt (thanks to primitives
	like open(O_CLOEXEC), pipe2(), accept4(), ...), then teach virExec to
	clear that bit for all fds explicitly marked to be handed to the child
	only after forking.

	* src/qemu/qemu_command.c (qemuBuildCommandLine): Clear cloexec
	flag.
	* tests/qemuxml2argvtest.c (testCompareXMLToArgvFiles): Tweak test.

2011-03-29  Eric Blake  <eblake@redhat.com>

	util: allow clearing cloexec bit
	* src/util/util.h (virSetInherit): New prototype.
	* src/util/util.c (virSetCloseExec): Move guts...
	(virSetInherit): ...to new function, and allow clearing.
	* src/libvirt_private.syms (util.h): Export it.

	logging: always NUL-terminate circular buffer
	* src/util/logging.c (virLogStartup, virLogSetBufferSize):
	Over-allocate, so that a debugger can just print the circular
	buffer.  Suggested by Daniel Veillard.

	maint: use space, not tab, in remote_protocol-structs
	* src/Makefile.am (remote_protocol-structs): Flatten tabs.
	* src/remote_protocol-structs: Likewise.  Also add a hint to emacs
	to make it easier to keep spaces in the file.

2011-03-28  Eric Blake  <eblake@redhat.com>

	tests: don't alter state in $HOME
	Diego reported a bug where virsh tries to initialize a readline
	history directory during 'make check' run as root, but fails
	because /root was read-only.

	It turns out that I could reproduce this as non-root, by using:

	mv ~/.virsh{,.bak}
	chmod a-w ~
	make check -C tests TESTS=int-overflow
	chmod u+w ~
	mv ~/.virsh{.bak,}

	* tests/int-overflow: Don't trigger interactive mode.
	Reported by Diego Elio Pettenò.

2011-03-28  Eric Blake  <eblake@redhat.com>

	docs: document recent hook additions
	* src/qemu/qemu_process.c (qemuProcessStart, qemuProcessStop): Fix
	typos.
	* docs/hooks.html.in: Document 'prepare' and 'release' hooks.

2011-03-28  Eric Blake  <eblake@redhat.com>

	qemu: don't restore state label twice
	Otherwise, if something like doStopVcpus fails after the first
	restore, a second restore is attempted and throws a useless
	warning.

	* src/qemu/qemu_driver.c (qemudDomainSaveFlag): Avoid second
	restore of state label.

2011-03-28  Daniel P. Berrange  <berrange@redhat.com>

	Remove the Open Nebula driver
	The Open Nebula driver has been unmaintained since it was first
	introduced. The only commits have been for tree-wide cleanups.
	It also has a major design flaw, in that it only knows about guests
	that it has created itself, which makes it of very limited use.

	Discussions wrt evolution of the VMWare ESX driver, concluded that
	it should limit itself to single-node ESX operation and not try to
	manage the multi-node architecture of VirtualCenter. Open Nebula
	is a cluster like Virtual Center, not a single node system, so
	the same reasoning applies.

	The DeltaCloud project includes an Open Nebula driver and is a much
	better fit architecturally, since it is explicitly targetting the
	distributed multihost cluster scenario.

	Thus this patch deletes the libvirt Open Nebula driver with the
	recommendation that people use DeltaCloud for managing it instead.

	* configure.ac: Remove probe for xmlrpc & --with-one arg
	* daemon/Makefile.am, daemon/libvirtd.c, src/Makefile.am: Remove
	  ONE driver build
	* src/opennebula/one_client.c, src/opennebula/one_client.h,
	  src/opennebula/one_conf.c, src/opennebula/one_conf.h,
	  src/opennebula/one_driver.c, src/opennebula/one_driver.c: Delete
	  files
	* autobuild.sh, libvirt.spec.in, mingw32-libvirt.spec.in: Remove
	  build rules for Open Nebula
	* docs/drivers.html.in, docs/sitemap.html.in: Remove reference
	  to OpenNebula
	* docs/drvone.html.in: Delete file

2011-03-28  Osier Yang  <jyang@redhat.com>

	Fix syntax error in configure.ac
	Which will lead "./configure --with-audit=yes" breaks.

2011-03-28  Daniel Veillard  <veillard@redhat.com>

	Update of localisations, switch to transifex
	Last pull from i18n CVS, then push to transifex.net which is now
	our localization upstream:

	http://www.transifex.net/projects/p/libvirt/resource/strings/

2011-03-28  Daniel Veillard  <veillard@redhat.com>

	Update on the goal page
	Some things to note in this patch:
	   - we do extend libvirt scope beyond purely managing domains, there is
	     already a number of blocks which are here as helpr functions to
	     manage the resources on the host.
	   - we are expanding in the direction of libvirt being sufficient to do
	     most of the management on the Host (but within the limits of the need
	     for virtualization, e.g. managing users on the host is out of scope)
	   - we don't require anymore APIs to be supported by multiple
	     hypervisors to get in, it's already the case in practice, but we
	     should still make sure the semantic of those APIs are clear. We
	     added quite a bit for QEmu, but for example I saw on IRC that VBox
	     could emulate a network unplug/replug on a domain interface, and
	     that would be a good addition even if a priori no other hypervisor
	     supports it.
	   - Make clear that all libvirt APIs are available remotely, which is
	     key to use libvirt for building management tools.
	   - link the goal page from the project main page

	As for libvirt project directions, I think it just reflects the natural
	evolution in the last couple of years. We are less hypervisor agnostic
	and extending in the Host management. Clearly there is interest in
	making sure libvirt is complete in term of features for the hypervisors
	supported, especially the ones like KVM or LXC which don't really have
	integrated management library.

	* docs/goals.html.in: update the goals page
	* docs/index.html.in: link it from the top page

2011-03-26  Matthias Bolte  <matthias.bolte@googlemail.com>

	remote: Don't leak gnutls session on negotiation error

2011-03-26  Eric Blake  <eblake@redhat.com>

	hooks: fix regression in previous patch
	* src/util/hooks.c (virHookCheck): Missing hooks should just be
	debug, not warn.

2011-03-25  Philipp Hahn  <hahn@univention.de>

	Add missing { for qemudDomainInterfaceStats
	Add missing open curly brace between function declaration of non-linux
	variant of qemudDomainInterfaceStats() and its body.

2011-03-25  Eric Blake  <eblake@redhat.com>

	build: shorten libxenlight summary for consistent alignment
	* configure.ac: Use xenlight: rather than libxenlight: in summary.
	Suggested by Daniel Veillard.

2011-03-25  Jiri Denemark  <jdenemar@redhat.com>

	daemon: Avoid resetting errors before they are reported
	Commit f44bfb7 was supposed to make sure no additional libvirt API (esp.
	*Free) is called before remoteDispatchConnError() is called on error.
	However, the patch missed two instances.

2011-03-25  Eric Blake  <eblake@redhat.com>

	command: add virCommandAbort for cleanup paths
	Sometimes, an asynchronous helper is started (such as a compressor
	or iohelper program), but a later error means that we want to
	abort that child.  Make this easier.

	Note that since daemons and virCommandRunAsync can't mix, the only
	time virCommandFree can reap a process is if someone did
	virCommandRunAsync for a non-daemon and didn't stash the pid.

	* src/util/command.h (virCommandAbort): New prototype.
	* src/util/command.c (_virCommand): Add new field.
	(virCommandRunAsync, virCommandWait): Track whether pid was used.
	(virCommandFree): Reap child if caller did not request pid.
	(virCommandAbort): New function.
	* src/libvirt_private.syms (command.h): Export it.
	* tests/commandtest.c (test19): New test.

2011-03-25  Eric Blake  <eblake@redhat.com>

	command: don't mix RunAsync and daemons
	It doesn't make sense to run a daemon without synchronously
	waiting for the child process to reply whether the daemon has
	been kicked off and pidfile written yet.

	* src/util/command.c (VIR_EXEC_RUN_SYNC): New constant.
	(virCommandRun): Set temporary flag.
	(virCommandRunAsync): Use it to prevent async runs of intermediate
	child when spawning asynchronous daemon grandchild.

2011-03-25  Eric Blake  <eblake@redhat.com>

	command: properly diagnose process exit via signal
	Child processes don't always reach _exit(); if they die from a
	signal, then any messages should still be accurate.  Most users
	either expect a 0 status (thankfully, if status==0, then
	WIFEXITED(status) is true and WEXITSTATUS(status)==0 for all
	known platforms) or were filtering on WIFEXITED before printing
	a status, but a few were missing this check.  Additionally,
	nwfilter_ebiptables_driver was making an assumption that works
	on Linux (where WEXITSTATUS shifts and WTERMSIG just masks)
	but fails on other platforms (where WEXITSTATUS just masks and
	WTERMSIG shifts).

	* src/util/command.h (virCommandTranslateStatus): New helper.
	* src/libvirt_private.syms (command.h): Export it.
	* src/util/command.c (virCommandTranslateStatus): New function.
	(virCommandWait): Use it to also diagnose status from signals.
	* src/security/security_apparmor.c (load_profile): Likewise.
	* src/storage/storage_backend.c
	(virStorageBackendQEMUImgBackingFormat): Likewise.
	* src/util/util.c (virExecDaemonize, virRunWithHook)
	(virFileOperation, virDirCreate): Likewise.
	* daemon/remote.c (remoteDispatchAuthPolkit): Likewise.
	* src/nwfilter/nwfilter_ebiptables_driver.c (ebiptablesExecCLI):
	Likewise.

2011-03-25  Markus Groß  <gross@univention.de>

	Add memory functions to libxl driver

2011-03-25  Wen Congyang  <wency@cn.fujitsu.com>

	fix the check of the output of monitor command 'device_add'
	Hotpluging host usb device by text mode will fail, because the monitor
	command 'device_add' outputs 'husb: using...' if it succeeds, but we
	think the command should not output anything.

2011-03-25  Eric Blake  <eblake@redhat.com>

	build: enforce reference count checking
	Add the compiler attribute to ensure we don't introduce any more
	ref bugs like were just patched in commit 9741f34, then explicitly
	mark the remaining places in code that are safe.

	* src/qemu/qemu_monitor.h (qemuMonitorUnref): Mark
	ATTRIBUTE_RETURN_CHECK.
	* src/conf/domain_conf.h (virDomainObjUnref): Likewise.
	* src/conf/domain_conf.c (virDomainObjParseXML)
	(virDomainLoadStatus): Fix offenders.
	* src/openvz/openvz_conf.c (openvzLoadDomains): Likewise.
	* src/vmware/vmware_conf.c (vmwareLoadDomains): Likewise.
	* src/qemu/qemu_domain.c (qemuDomainObjBeginJob)
	(qemuDomainObjBeginJobWithDriver)
	(qemuDomainObjExitRemoteWithDriver): Likewise.
	* src/qemu/qemu_monitor.c (QEMU_MONITOR_CALLBACK): Likewise.
	Suggested by Daniel P. Berrange.

2011-03-25  Eric Blake  <eblake@redhat.com>

	maint: prohibit access(,X_OK)
	This simplifies several callers that were repeating checks already
	guaranteed by util.c, and makes other callers more robust to now
	reject directories.  remote_driver.c was over-strict - access(,R_OK)
	is only needed to execute a script file; a binary only needs
	access(,X_OK) (besides, it's unusual to see a file with x but not
	r permissions, whether script or binary).

	* cfg.mk (sc_prohibit_access_xok): New syntax-check rule.
	(exclude_file_name_regexp--sc_prohibit_access_xok): Exempt one use.
	* src/network/bridge_driver.c (networkStartRadvd): Fix offenders.
	* src/qemu/qemu_capabilities.c (qemuCapsProbeMachineTypes)
	(qemuCapsInitGuest, qemuCapsInit, qemuCapsExtractVersionInfo):
	Likewise.
	* src/remote/remote_driver.c (remoteFindDaemonPath): Likewise.
	* src/uml/uml_driver.c (umlStartVMDaemon): Likewise.
	* src/util/hooks.c (virHookCheck): Likewise.

2011-03-25  Markus Groß  <gross@univention.de>

	Get cpu time and current memory balloon from libxl

2011-03-24  Jiri Denemark  <jdenemar@redhat.com>

	Make error reporting in libvirtd thread safe
	Bug https://bugzilla.redhat.com/show_bug.cgi?id=689374 reported libvirtd
	crash during error dispatch.

	The reason is that libvirtd uses remoteDispatchConnError() with non-NULL
	conn parameter which means that virConnGetLastError() is used instead of
	its thread safe replacement virGetLastError().

	So when several libvirtd threads are reporting errors at the same time,
	the errors can get mixed or corrupted or in case of bad luck libvirtd
	itself crashes.

	Since Daniel B. is going to rewrite this code from scratch on top of his
	RPC infrastructure, I tried to come up with a minimal fix. Thus,
	remoteDispatchConnError() now just ignores its conn argument and always
	calls virGetLastError(). However, several callers had to be touched as
	well, since no libvirt API is allowed to be called before dispatching
	the error. Doing so would reset the error and we would have nothing to
	dispatch. As a result of that, the code is not very nice but that
	doesn't really make daemon/remote.c worse than it is now :-) And it will
	all die soon, which is good.

	The bug report also contains a reproducer in C which detects both mixed
	up error messages and libvirtd crash. Before this patch, I was able to
	crash libvirtd in about 20 seconds up to 3 minutes depending on number
	of CPU cores (more is better) and luck.

2011-03-24  Wen Congyang  <wency@cn.fujitsu.com>

	update domain status forcibly even if attach a device failed
	Steps to reproduce this bug:
	1. virsh attach-disk domain --source diskimage --target sdb --sourcetype file --driver qemu --subdriver qcow2
	   error: Failed to attach disk
	   error: operation failed: adding scsi-disk,bus=scsi0.0,scsi-id=1,drive=drive-scsi0-0-1,id=scsi0-0-1 device failed: Property 'scsi-disk.drive' can't find value 'drive-scsi0-0-1'
	2. service libvirtd restart
	   Stopping libvirtd daemon:                                  [  OK  ]
	   Starting libvirtd daemon:                                  [  OK  ]
	3. virsh attach-disk domain --source diskimage --target sdb --sourcetype file --driver qemu --subdriver raw
	   error: Failed to attach disk
	   error: operation failed: adding lsi,id=scsi0,bus=pci.0,addr=0x6 device failed: Duplicate ID 'scsi0' for device

	The reason is that we create a new scsi controller but we do not update
	/var/run/libvirt/qemu/domain.xml.

2011-03-24  Eric Blake  <eblake@redhat.com>

	build: nuke all .x-sc* files, and fix VPATH syntax-check
	Not every day you see a patch that nukes 27 files!

	* .gnulib: Update to latest, for maint.mk improvements
	* bootstrap: Resync to gnulib.
	* bootstrap.conf (ACLOCAL): Swap the secondary aclocal include
	directory, now that bootstrap picks up gnulib/m4 instead of m4.
	* Makefile.am (syntax_check_exceptions, EXTRA_DIST): No longer
	worry about nuked files.
	* cfg.mk (sc_x_sc_dist_check): Delete dead rule.
	(VC_LIST_ALWAYS_EXCLUDE_REGEX): Add HACKING.
	(exclude_file_name_regexp--sc_*): Inline and simplify contents...
	* .x-sc_*: ...from here, then delete the files.

2011-03-24  Eric Blake  <eblake@redhat.com>

	command: reject pidfile on non-daemon
	* src/util/command.c (virCommandRunAsync): Since virExec only
	creates pidfiles for daemon, enforce this in virCommand.

2011-03-24  Eric Blake  <eblake@redhat.com>

	domain_conf: drop unused ref-count in snapshot object
	The ref count was assigned to 1 at creation, then never modified again
	until it was decremented just before freeing the object.

	* src/conf/domain_conf.h (_virDomainSnapshotObj): Delete unused
	field.
	(virDomainSnapshotObjUnref): Delete unused prototype.
	* src/libvirt_private.syms: Likewise.
	* src/conf/domain_conf.c (virDomainSnapshotObjNew)
	(virDomainSnapshotObjListDataFree): Update users.
	(virDomainSnapshotObjUnref): Delete.

2011-03-24  Eric Blake  <eblake@redhat.com>

	rpm: add missing dependencies
	Among others, the missing radvd dependency showed up as:

	error: Failed to start network ipv6net
	error: Cannot find radvd - Possibly the package isn't installed: No such file
	or directory

	even when radvd was installed, because the RADVD preprocessor
	symbol was missing at configure time.

	* libvirt.spec.in (with_network): Add BuildRequires for radvd,
	iptables, and ip6tables.
	(BuildRequires): Add libxslt and augeas for docs and test.
	(with_libvirtd): Add module-init-tools for modprobe.
	(with_nwfilter): Add BuildRequires for ebtables.
	(with_esx): Fix esx build on RHEL 5, thanks to curl-devel rename.

2011-03-24  Eric Blake  <eblake@redhat.com>

	rpm: separate runtime and build requirements
	* libvirt.spec.in (Requires): Reorganize requirements a bit; no
	functional change.

2011-03-23  Osier Yang  <jyang@redhat.com>

	util: Fix return value for virJSONValueFromString if it fails
	Problem:
	  "parser.head" is not NULL even if it's free'ed by "virJSONValueFree",
	returning "parser.head" when "virJSONValueFromString" fails will cause
	unexpected errors (libvirtd will crash sometimes), e.g.
	  In function "qemuMonitorJSONArbitraryCommand":

	        if (!(cmd = virJSONValueFromString(cmd_str)))
	            goto cleanup;

	        if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0)
	            goto cleanup;

	        ......

	     cleanup:
	        virJSONValueFree(cmd);

	  It will continues to send command to monitor even if "virJSONValueFromString"
	is failed, and more worse, it trys to free "cmd" again.

	  Crash example:
	{"error":{"class":"QMPBadInputObject","desc":"Expected 'execute' in QMP input","data":{"expected":"execute"}}}
	{"error":{"class":"QMPBadInputObject","desc":"Expected 'execute' in QMP input","data":{"expected":"execute"}}}
	error: server closed connection:
	error: unable to connect to '/var/run/libvirt/libvirt-sock', libvirtd may need to be started: Connection refused
	error: failed to connect to the hypervisor

	  This fix is to:
	    1) return NULL for failure of "virJSONValueFromString",
	    2) and it seems "virJSONValueFree" uses incorrect loop index for type
	       of "VIR_JSON_TYPE_OBJECT", fix it together.

	* src/util/json.c

2011-03-23  Wen Congyang  <wency@cn.fujitsu.com>

	Initialization error of qemuCgroupData in Qemu host usb hotplug
	Steps to reproduce this bug:
	# cat usb.xml
	<hostdev mode='subsystem' type='usb'>
	  <source>
	    <address bus='0x001' device='0x003'/>
	  </source>
	</hostdev>
	# virsh attach-device vm1 usb.xml
	error: Failed to attach device from usb.xml
	error: server closed connection:

	The reason of this bug is that we set data.cgroup to NULL, and this will cause
	libvirtd crashed.

2011-03-23  Eric Blake  <eblake@redhat.com>

	qemu: simplify monitor callbacks
	A future patch will change reference counting idioms; consolidating
	this pattern now makes the next patch smaller (touch only the new
	macro rather than every caller).

	* src/qemu/qemu_monitor.c (QEMU_MONITOR_CALLBACK): New helper.
	(qemuMonitorGetDiskSecret, qemuMonitorEmitShutdown)
	(qemuMonitorEmitReset, qemuMonitorEmitPowerdown)
	(qemuMonitorEmitStop, qemuMonitorEmitRTCChange)
	(qemuMonitorEmitWatchdog, qemuMonitorEmitIOError)
	(qemuMonitorEmitGraphics): Use it to reduce duplication.

2011-03-23  Eric Blake  <eblake@redhat.com>

	build: fix missing initializer
	Commit cb4aba9b6 forgot xenapi.

	* src/xenapi/xenapi_driver.c (xenapiDriver): Adjust to recent API.

2011-03-23  Roopa Prabhu  <roprabhu@cisco.com>

	8021Qbh: use preassociate-rr during the migration prepare stage
	This patch introduces PREASSOCIATE-RR during incoming VM migration on the
	destination host. This is similar to the usage of PREASSOCIATE during
	migration in 8021qbg libvirt code today. PREASSOCIATE-RR is a VDP operation.
	With the latest at IEEE, 8021qbh will need to support VDP operations.
	A corresponding enic driver patch to support PREASSOCIATE-RR for 8021qbh
	will be posted for net-next-2.6 inclusion soon.

2011-03-22  Daniel P. Berrange  <berrange@redhat.com>

	Fix uninitialized variable & error reporting in LXC veth setup
	THe veth setup in LXC had a couple of flaws, first brInit did
	not report any error when it failed. Second vethCreate() did
	not correctly initialize the variable containing the return
	code, so could report failure even when it succeeded.

	* src/lxc/lxc_driver.c: Report error when brInit fails
	* src/lxc/veth.c: Fix uninitialized variable

2011-03-22  Daniel P. Berrange  <berrange@redhat.com>

	Wire up virDomainMigrateSetSpeed into QEMU driver
	Enhance the QEMU migration monitoring loop, so that it can get
	a signal to change migration speed on the fly

	* src/qemu/qemu_domain.h: Add signal for changing speed on the fly
	* src/qemu/qemu_driver.c: Wire up virDomainMigrateSetSpeed driver
	* src/qemu/qemu_migration.c: Support signal for changing speed

2011-03-22  Daniel P. Berrange  <berrange@redhat.com>

	Wire up virDomainMigrateSetSpeed for the remote RPC driver
	* src/remote/remote_protocol.x: Define wire protocol
	* daemon/remote.c, src/remote/remote_driver.c: Add new
	  functions for virDomainMigrateSetSpeed API
	* src/remote/remote_protocol.c, src/remote/remote_protocol.h,
	  daemon/remote_dispatch_args.h, daemon/remote_dispatch_prototypes.h,
	  daemon/remote_dispatch_table.h: Re-generate files

2011-03-22  Daniel P. Berrange  <berrange@redhat.com>

	Add public API for setting migration speed on the fly
	It is possible to set a migration speed limit when starting
	migration. This new API allows the speed limit to be changed
	on the fly to adjust to changing conditions

	* src/driver.h, src/libvirt.c, src/libvirt_public.syms,
	  include/libvirt/libvirt.h.in: Add virDomainMigrateSetMaxSpeed
	* src/esx/esx_driver.c, src/lxc/lxc_driver.c,
	  src/opennebula/one_driver.c, src/openvz/openvz_driver.c,
	  src/phyp/phyp_driver.c, src/qemu/qemu_driver.c,
	  src/remote/remote_driver.c, src/test/test_driver.c,
	  src/uml/uml_driver.c, src/vbox/vbox_tmpl.c,
	  src/vmware/vmware_driver.c, src/xen/xen_driver.c,
	  src/libxl/libxl_driver.c: Stub new API

2011-03-22  Eric Blake  <eblake@redhat.com>

	maint: update authors
	* AUTHORS: Update, to satisfy 'make syntax-check'.

2011-03-22  Daniel P. Berrange  <berrange@redhat.com>

	Disable libxl build in RPM on Fedora < 16
	The xen RPM in Fedora isn't new enough to support libxl builds
	yet. Disable it until Fedora 16

	* libvirt.spec.in: Disable libxl on Fedora < 16

2011-03-22  Hu Tao  <hutao@cn.fujitsu.com>

	qemu: fallback to HMP drive_add/drive_del
	fallback to HMP drive_add/drive_del commands if not found in QMP

2011-03-22  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Only use HMP passthrough if it is supported
	Avoids calling text monitor methods when it is know they will not
	succeed and also results in nicer error messages.

	qemu: Detect support for HMP passthrough

2011-03-22  Thibault Vincent  <thibault.vincent@smartjog.com>

	qemu: add two hook script events "prepare" and "release"
	Fix for bug https://bugzilla.redhat.com/show_bug.cgi?id=618970

	The "prepare" hook is called very early in the VM statup process
	before device labeling, so that it can allocate ressources not
	managed by libvirt, such as DRBD, or for instance create missing
	bridges and vlan interfaces.
	* src/util/hooks.c src/util/hooks.h: add definitions for new hooks
	  VIR_HOOK_QEMU_OP_PREPARE and VIR_HOOK_QEMU_OP_RELEASE
	* src/qemu/qemu_process.c: use them in qemuProcessStart and
	  qemuProcessStop()

2011-03-22  Daniel Veillard  <veillard@redhat.com>

	Update the set of maintainers for the project
	Wen Congyang gained commiter access

	Created a new section of previous commiters to the project
	but not involved much anymore: Karel Zak, Atsushi SAKAI,
	Dave Leskovec and Dan Smith

2011-03-22  Eric Blake  <eblake@redhat.com>

	qemu: simplify interface fd handling in monitor
	With only a single caller to these two monitor commands, I
	didn't need to wrap a new WithFds version, but just change
	the command itself.

	* src/qemu/qemu_monitor.h (qemuMonitorAddNetdev)
	(qemuMonitorAddHostNetwork): Add parameters.
	* src/qemu/qemu_monitor.c (qemuMonitorAddNetdev)
	(qemuMonitorAddHostNetwork): Add support for fd passing.
	* src/qemu/qemu_hotplug.c (qemuDomainAttachNetDevice): Use it to
	simplify code.

2011-03-22  Eric Blake  <eblake@redhat.com>

	qemu: simplify PCI configfd handling in monitor
	This is also a bug fix - on the error path, qemu_hotplug would
	leave the configfd file leaked into qemu.  At least the next
	attempt to hotplug a PCI device would reuse the same fdname,
	and when the qemu getfd monitor command gets a new fd by the
	same name as an earlier one, it closes the earlier one, so there
	is no risk of qemu running out of fds.

	* src/qemu/qemu_monitor.h (qemuMonitorAddDeviceWithFd): New
	prototype.
	* src/qemu/qemu_monitor.c (qemuMonitorAddDevice): Move guts...
	(qemuMonitorAddDeviceWithFd): ...to new function, and add support
	for fd passing.
	* src/qemu/qemu_hotplug.c (qemuDomainAttachHostPciDevice): Use it
	to simplify code.
	Suggested by Daniel P. Berrange.

2011-03-22  Eric Blake  <eblake@redhat.com>

	qemu: simplify monitor fd error handling
	qemu_monitor was already returning -1 and setting errno to EINVAL
	on any attempt to send an fd without a unix socket, but this was
	a silent failure in the case of qemuDomainAttachHostPciDevice.
	Meanwhile, qemuDomainAttachNetDevice was doing some sanity checking
	for a better error message; it's better to consolidate that to a
	central point in the API.

	* src/qemu/qemu_hotplug.c (qemuDomainAttachNetDevice): Move sanity
	checking...
	* src/qemu/qemu_monitor.c (qemuMonitorSendFileHandle): ...into
	central location.
	Suggested by Chris Wright.

2011-03-22  Eric Blake  <eblake@redhat.com>

	udev: fix regression with qemu:///session
	https://bugzilla.redhat.com/show_bug.cgi?id=684655 points out
	a regression introduced in commit 2215050edd - non-root users
	can't connect to qemu:///session because libvirtd dies when
	it can't use pciaccess initialization.

	* src/node_device/node_device_udev.c (udevDeviceMonitorStartup):
	Don't abort udev driver (and libvirtd overall) if non-root user
	can't use pciaccess.

2011-03-21  Eric Blake  <eblake@redhat.com>

	logging: fix off-by-one bug
	Valgrind caught that our log wrap-around was going 1 past the end.
	Regression introduced in commit b16f47a; previously the
	buffer was static and size+1 bytes, but now it is dynamic and
	exactly size bytes.

	* src/util/logging.c (virLogStr): Don't write past end of log.

2011-03-21  Wen Congyang  <wency@cn.fujitsu.com>

	do not report OOM error when prepareCall() failed
	We have reported error in the function prepareCall(), and
	the error is not only OOM error. So we should not report
	OOM error in the function call() when prepareCall() failed.

2011-03-21  Eric Blake  <eblake@redhat.com>

	util: guarantee sane errno in virFileIsExecutable
	If virFileIsExecutable is to replace access(file,X_OK), then
	errno must be usable on failure.

	* src/util/util.c (virFileIsExecutable): Set errno on failure.

2011-03-21  Cole Robinson  <crobinso@redhat.com>

	docs: Document first release with spice and qxl

2011-03-21  Osier Yang  <jyang@redhat.com>

	doc: Add schema definition for imagelabel
	<imagelable> is not generated by running domain, actually we parse
	it in src/conf/domain_conf.c, this patch is to fix it, otherwise any
	validation (virt-xml-validate) on the domain xml dumped from shutoff
	domain containing <imagelable> will fail.

	* docs/schemas/domain.rng

2011-03-19  Tiziano Mueller  <dev-zero@gentoo.org>

	update virGetVersion description
	The current description suggests that you always have to provide
	a valid typeVer pointer. But if you want only the libvirt version
	it's also possible to set type and typeVer to NULL to skip the
	hypervisor part.

2011-03-19  Hu Tao  <hutao@cn.fujitsu.com>

	Don't return an error on failure to create blkio controller
	This patch enables cgroup controllers as much as possible by skipping
	the creation of blkio controller when running with old kernels that
	doesn't support multi-level directory for blkio controller.

2011-03-19  Jim Fehlig  <jfehlig@novell.com>

	Don't build libxenlight driver for Xen 4.0
	The libxenlight driver does not build against the tech preview
	version of libxenlight in Xen 4.0.  Only enable building the
	driver against more complete libxenlight found in Xen 4.1.

2011-03-19  Eric Blake  <eblake@redhat.com>

	qemu: respect locking rules
	THREADS.txt states that the contents of vm should not be read or
	modified while the vm lock is not held, but that the lock must not
	be held while performing a monitor command.  This fixes all the
	offenders that I could find.

	* src/qemu/qemu_process.c (qemuProcessStartCPUs)
	(qemuProcessInitPasswords, qemuProcessStart): Don't modify or
	refer to vm state outside lock.
	* src/qemu/qemu_driver.c (qemudDomainHotplugVcpus): Likewise.
	* src/qemu/qemu_hotplug.c (qemuDomainChangeGraphicsPasswords):
	Likewise.

2011-03-19  Laine Stump  <laine@laine.org>

	network driver: log error and abort network startup when radvd isn't found
	This is detailed in:

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

	Since radvd is executed by daemonizing it, the attempt to exec the
	radvd binary doesn't happen until after libvirtd has already received
	an exit code from the intermediate forked process, so no error is
	detected or logged by __virExec().

	We can't require radvd as a prerequisite for the libvirt package (many
	installations don't use IPv6, so they don't need it), so instead we
	add in a check to verify there is an executable radvd binary prior to
	trying to exec it.

2011-03-19  Jean-Baptiste Rouault  <jean-baptiste.rouault@diateam.net>

	openvz: fix a simple bug in openvzListDefinedDomains()
	This patch adds missing curly brackets to an if
	statement in openvzListDefinedDomains()

2011-03-19  Eric Blake  <eblake@redhat.com>

	build: translate changes in previous patch
	* po/POTFILES.in: Add src/util/hash.c for 'make syntax-check'.

2011-03-19  Daniel P. Berrange  <berrange@redhat.com>

	Fix delayed event delivery when SASL is active
	When SASL is active, it was possible that we read and decoded
	more data off the wire than we initially wanted. The loop
	processing this data terminated after only one message to
	avoid delaying the calling thread, but this could delay
	event delivery. As long as there is decoded SASL data in
	memory, we must process it, before returning to the poll()
	event loop.

	This is a counterpart to the same kind of issue solved in

	  commit 68d2c3482fa16801f8e6ca5c42698319bb87f385

	in a different area of the code

	* src/remote/remote_driver.c: Process all pending SASL data

2011-03-19  Daniel P. Berrange  <berrange@redhat.com>

	Ensure binary is resolved wrt $PATH in virExec
	virExec would only resolved the binary to $PATH if no env
	variables were being set. Since there is no execvep() API
	in POSIX, we use virFindFileInPath to manually resolve
	the binary and then use execv() instead of execvp().

2011-03-18  Jim Fehlig  <jfehlig@novell.com>

	Add libxenlight driver
	Add a new xen driver based on libxenlight [1], which is the primary
	toolstack starting with Xen 4.1.0.  The driver is stateful and runs
	privileged only.

	Like the existing xen-unified driver, the libxenlight driver is
	accessed with xen:// URI.  Driver selection is based on the status
	of xend.  If xend is running, the libxenlight driver will not load
	and xen:// connections are handled by xen-unified.  If xend is not
	running *and* the libxenlight driver is available, xen://
	connections are deferred to the libxenlight driver.

	V6:
	 - Address several code style issues noted by Daniel Veillard
	 - Make drive work with xen:/// URI
	 - Hold domain object reference while domain is injected in
	   libvirt event loop.  Race found and fixed by Markus Groß.

	V5:
	 - Ensure events are unregistered when domain private data
	   is destroyed.  Discovered and fixed by Markus Groß.

	V4:
	 - Handle restart of libvirtd, reconnecting to previously
	   started domains
	 - Rebased to current master
	 - Tested against Xen 4.1 RC7-pre (c/s 22961:c5d121fd35c0)

	V3:
	  - Reserve vnc port within driver when autoport=yes

	V2:
	  - Update to Xen 4.1 RC6-pre (c/s 22940:5a4710640f81)
	  - Rebased to current master
	  - Plug memory leaks found by Stefano Stabellini and valgrind
	  - Handle SHUTDOWN_crash domain death event

	[1] http://lists.xensource.com/archives/html/xen-devel/2009-11/msg00436.html

2011-03-18  Jiri Denemark  <jdenemar@redhat.com>

	util: Forbid calling hash APIs from iterator callback
	Calling most hash APIs is not safe from inside of an iterator callback.
	Exceptions are APIs that do not modify the hash table and removing
	current hash entry from virHashFroEach callback.

	This patch make all APIs which are not safe fail instead of just relying
	on the callback being nice not calling any unsafe APIs.

2011-03-18  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Fix copy&paste error messages in text monitor

2011-03-18  Wen Congyang  <wency@cn.fujitsu.com>

	do not unref obj in qemuDomainObjExitMonitor*
	Steps to reproduce this bug:
	# cat test.sh
	  #! /bin/bash -x
	  virsh start domain
	  sleep 5
	  virsh qemu-monitor-command domain 'cpu_set 2 online' --hmp
	# while true; do ./test.sh ; done

	Then libvirtd will crash.

	The reason is that:
	we add a reference of obj when we open the monitor. We will reduce this
	reference when we free the monitor.

	If the reference of monitor is 0, we will free monitor automatically and
	the reference of obj is reduced.

	But in the function qemuDomainObjExitMonitorWithDriver(), we reduce this
	reference again when the reference of monitor is 0.

	It will cause the obj be freed in the function qemuDomainObjEndJob().

	Then we start the domain again, and libvirtd will crash in the function
	virDomainObjListSearchName(), because we pass a null pointer(obj->def->name)
	to strcmp().

2011-03-18  Wen Congyang  <wency@cn.fujitsu.com>

	qemu: check driver name while attaching disk
	This bug was reported by Shi Jin(jinzishuai@gmail.com):
	=============
	# virsh attach-disk RHEL6RC /var/lib/libvirt/images/test3.img vdb \
	        --driver file --subdriver qcow2
	Disk attached successfully

	# virsh save RHEL6RC /var/lib/libvirt/images/memory.save
	Domain RHEL6RC saved to /var/lib/libvirt/images/memory.save

	# virsh restore /var/lib/libvirt/images/memory.save
	error: Failed to restore domain from /var/lib/libvirt/images/memory.save
	error: internal error unsupported driver name 'file'
	       for disk '/var/lib/libvirt/images/test3.img'
	=============

	We check the driver name when we start or restore VM, but we do
	not check it while attaching a disk. This adds the same check on disk
	driverName used in qemuBuildCommandLine to qemudDomainAttachDevice.

2011-03-18  Daniel Veillard  <veillard@redhat.com>

	Improve logging documentation including the debug buffer
	* docs/logging.html.in: document the fact that starting from
	  0.9.0 the server logs goes to libvirtd.log instead of syslog
	  by default, describe the debug buffer, restructure the page
	  and add a couple more examples

2011-03-18  Daniel Veillard  <veillard@redhat.com>

	Avoid taking lock in libvirt debug dump
	As pointed out, locking the buffer from the signal handler
	cannot been guaranteed to be safe, so to avoid any hazard
	we prefer the trade off of dumping logs possibly messed up
	by concurrent logging activity rather than risk a daemon
	crash.

	* src/util/logging.c: change virLogEmergencyDumpAll() to not
	  take any lock on the log buffer but reset buffer content variables
	  to an empty set before starting the actual dump.

2011-03-18  Wen Congyang  <wency@cn.fujitsu.com>

	unlock the monitor when unwatching the monitor
	Steps to reproduce this bug:
	# virsh qemu-monitor-command domain 'cpu_set 2 online' --hmp
	The domain has 2 cpus, and we try to set the third cpu online.
	The qemu crashes, and this command will hang.

	The reason is that the refs is not 1 when we unwatch the monitor.
	We lock the monitor, but we do not unlock it. So virCondWait()
	will be blocked.

2011-03-18  Hu Tao  <hutao@cn.fujitsu.com>

	Add vim configuration that makes vim auto-indent code

	Make virDomainObjParseNode() static
	Make virDomainObjParseNode() static since it is called only
	in one file.

2011-03-18  Nikunj A. Dadhania  <nikunj@linux.vnet.ibm.com>

	virsh: fix memtune's help message for swap_hard_limit
	* Correct the documentation for cgroup: the swap_hard_limit indicates
	  mem+swap_hard_limit.
	* Change cgroup private apis to: virCgroupGet/SetMemSwapHardLimit

2011-03-18  Alex Williamson  <alex.williamson@redhat.com>

	Add PCI sysfs reset access
	I'm proposing we make use of $PCIDIR/reset in qemu-kvm to reset
	devices on VM reset.  We need to add it to libvirt's list of
	files that get ownership for device assignment.

2011-03-18  Jim Fehlig  <jfehlig@novell.com>

	Support Xen sysctl v8, domctl v7
	xen-unstable c/s 21118:28e5409e3fb3 bumped sysctl version to 8.
	xen-unstable c/s 21212:de94884a669c introduced CPU pools feature,
	adding another member to xen_domctl_getdomaininfo struct.  Add a
	corresponding domctl v7 struct in xen hypervisor sub-driver and
	detect sysctl v8 during initialization.

2011-03-18  Matthias Bolte  <matthias.bolte@googlemail.com>

	remote: Add missing virCondDestroy calls
	The virCond of the remote_thread_call struct was leaked in some
	places. This results in leaking the underlying mutex. Which in turn
	leaks a handle on Windows.

	Reported by Aliaksandr Chabatar and Ihar Smertsin.

2011-03-17  Eric Blake  <eblake@redhat.com>

	build: improve rpm generation for distro backports
	When building for an older distro, it's convenient to just
	tell rpmbuild to define dist (for example, to .el6_0), rather
	than also remembering to define rhel to 6.

	* libvirt.spec.in: Guess %{rhel} based on %{dist}.
	Based on an idea by Jiri Denemark.

2011-03-17  Laine Stump  <laine@laine.org>

	macvtap: log an error if on failure to connect to netlink socket
	A bug in libnl (see https://bugzilla.redhat.com/show_bug.cgi?id=677724
	and https://bugzilla.redhat.com/show_bug.cgi?id=677725) makes it very
	easy to create a failure to connect to the netlink socket when trying
	to open a macvtap network device ("type='direct'" in domain interface
	XML). When that error occurred (during a call to libnl's nl_connect()
	from libvirt's nlComm(), there was no log message, leading virsh (for
	example) to report "unknown error".

	There were two other cases in nlComm where an error in a libnl
	function might return with failure but no error reported. In all three
	cases, this patch logs a message which will hopefully be more useful.

	Note that more detailed information about the failure might be
	available from libnl's nl_geterror() function, but it calls
	strerror(), which is not threadsafe, so we can't use it.

2011-03-16  Osier Yang  <jyang@redhat.com>

	storage: Fix a problem which will cause libvirtd crashed
	If pool xml has no definition for "port", then "Segmentation fault"
	happens when jumping to "cleanup:" to do "VIR_FREE(port)", as "port"
	was not initialized in this situation.

	* src/conf/storage_conf.c

2011-03-16  Eric Blake  <eblake@redhat.com>

	qemu: support migration to fd
	* src/qemu/qemu_monitor.h (qemuMonitorMigrateToFd): New
	prototype.
	* src/qemu/qemu_monitor.c (qemuMonitorMigrateToFd): New function.

2011-03-16  Eric Blake  <eblake@redhat.com>

	qemu: improve efficiency of dd during snapshots
	POSIX states about dd:

	If the bs=expr operand is specified and no conversions other than
	sync, noerror, or notrunc are requested, the data returned from each
	input block shall be written as a separate output block; if the read
	returns less than a full block and the sync conversion is not
	specified, the resulting output block shall be the same size as the
	input block. If the bs=expr operand is not specified, or a conversion
	other than sync, noerror, or notrunc is requested, the input shall be
	processed and collected into full-sized output blocks until the end of
	the input is reached.

	Since we aren't using conv=sync, there is no zero-padding, but our
	use of bs= means that a short read results in a short write.  If
	instead we use ibs= and obs=, then short reads are collected and dd
	only has to do a single write, which can make dd more efficient.

	* src/qemu/qemu_monitor.c (qemuMonitorMigrateToFile):
	Avoid 'dd bs=', since it can cause short writes.

2011-03-16  Eric Blake  <eblake@redhat.com>

	virsh: allow empty string arguments
	"virsh connect ''" should try to connect to the default connection,
	but the previous patch made it issue a warning about an invalid URI.

	* tools/virsh.c (VSH_OFLAG_EMPTY_OK): New option flag.
	(vshCommandOptString): Per the declaration, value is required to
	be non-NULL.  Honor new flag.
	(opts_connect): Allow empty string connection.

2011-03-15  Wen Congyang  <wency@cn.fujitsu.com>

	qemu: Fallback to HMP when cpu_set QMP command is not found

2011-03-15  Daniel P. Berrange  <berrange@redhat.com>

	Change message for VIR_FROM_RPC error domain
	The VIR_FROM_RPC error domain is used generically for any RPC
	problem, not simply XML-RPC problems.

	* src/util/virterror.c: s/XML-RPC/RPC/

2011-03-15  Daniel P. Berrange  <berrange@redhat.com>

	Add compat function for geteuid()
	* configure.ac: Check for geteuid()
	* src/util/util.h: Compat for geteuid()

2011-03-15  Daniel P. Berrange  <berrange@redhat.com>

	Fix misc bugs in virCommandPtr
	The virCommandNewArgs() method would free the virCommandPtr
	if it failed to add the args. This meant errors reported in
	virCommandAddArgSet() were lost. Simply removing the check
	for errors from the constructor means they can be reported
	correctly later

	The virCommandAddEnvPassCommon() method failed to check for
	errors before reallocating the cmd->env array, causing a
	potential SEGV if cmd was NULL

	The virCommandAddArgSet() method needs to validate that at
	least 1 element in 'val's parameter is non-NULL, otherwise
	code like

	    cmd = virCommandNew(binary)
	    virCommandAddAtg(cmd, "foo")

	Would end up trying todo  execve("foo"), if binary was
	NULL.

2011-03-15  Daniel P. Berrange  <berrange@redhat.com>

	Add virSetBlocking() to allow O_NONBLOCK to be toggle on or off
	The virSetNonBlock() API only allows enabling non-blocking
	operations. It doesn't allow turning blocking back on. Add
	a new API to allow arbitrary toggling.

	* src/libvirt_private.syms, src/util/util.h
	  src/util/util.c: Add virSetBlocking

2011-03-15  Eric Blake  <eblake@redhat.com>

	qemu: use more appropriate error
	Fixes bug in commit acacced

	* src/qemu/qemu_command.c (qemuBuildCommandLine):
	s/INVALID_ARG/CONFIG_UNSUPPORTED/.
	Reported by Daniel P. Berrange.

2011-03-15  Justin Clift  <jclift@redhat.com>

	docs: update windows page for initial libvirt 0.8.8 installer

2011-03-15  Taku Izumi  <izumi.taku@jp.fujitsu.com>

	libvirt: fix a simple bug in virDomainSetMemoryFlags()
	This patch fix a simple bug in virDomainSetMemoryFlags function.
	The patch sent before lacks the consideration of the case
	where the driver doesn't support virDomainSetMemoryFlags API.

2011-03-15  Daniel P. Berrange  <berrange@redhat.com>

	Make LXC container startup/shutdown/I/O more robust
	The current LXC I/O controller looks for HUP to detect
	when a guest has quit. This isn't reliable as during
	initial bootup it is possible that 'init' will close
	the console and let mingetty re-open it. The shutdown
	of containers was also flakey because it only killed
	the libvirt I/O controller and expected container
	processes to gracefully follow.

	Change the I/O controller such that when it see HUP
	or an I/O error, it uses kill($PID, 0) to see if the
	process has really quit.

	Change the container shutdown sequence to use the
	virCgroupKillPainfully function to ensure every
	really goes away

	This change makes the use of the 'cpu', 'devices'
	and 'memory' cgroups controllers compulsory with
	LXC

	* docs/drvlxc.html.in: Document that certain cgroups
	  controllers are now mandatory
	* src/lxc/lxc_controller.c: Check if PID is still
	  alive before quitting on I/O error/HUP
	* src/lxc/lxc_driver.c: Use virCgroupKillPainfully

2011-03-15  Daniel Veillard  <veillard@redhat.com>

	Allow to dynamically set the size of the debug buffer
	This is the part allowing to dynamically resize the debug log
	buffer from it's default 64kB size. The buffer is now dynamically
	allocated.
	It adds a new API virLogSetBufferSize() which resizes the buffer
	If passed a zero size, the buffer is deallocated and we do the small
	optimization of not formatting messages which are not output anymore.
	On the daemon side, it just adds a new option log_buffer_size to
	libvirtd.conf and call virLogSetBufferSize() if needed
	* src/util/logging.h src/util/logging.c src/libvirt_private.syms:
	  make buffer dynamic and add virLogSetBufferSize() internal API
	* daemon/libvirtd.conf: document the new log_buffer_size option
	* daemon/libvirtd.c: read and use the new log_buffer_size option

2011-03-15  Eric Blake  <eblake@redhat.com>

	qemu: consolidate duplicated monitor migration code
	* src/qemu/qemu_monitor_text.h (qemuMonitorTextMigrate): Declare
	in place of individual monitor commands.
	* src/qemu/qemu_monitor_json.h (qemuMonitorJSONMigrate): Likewise.
	* src/qemu/qemu_monitor_text.c (qemuMonitorTextMigrateToHost)
	(qemuMonitorTextMigrateToCommand, qemuMonitorTextMigrateToFile)
	(qemuMonitorTextMigrateToUnix): Delete.
	* src/qemu/qemu_monitor_json.c (qemuMonitorJSONMigrateToHost)
	(qemuMonitorJSONMigrateToCommand, qemuMonitorJSONMigrateToFile)
	(qemuMonitorJSONMigrateToUnix): Delete.
	* src/qemu/qemu_monitor.c (qemuMonitorMigrateToHost)
	(qemuMonitorMigrateToCommand, qemuMonitorMigrateToFile)
	(qemuMonitorMigrateToUnix): Consolidate shared code.

2011-03-15  Eric Blake  <eblake@redhat.com>

	qemu: use lighter-weight fd:n on incoming tunneled migration
	Outgoing migration still uses a Unix socket and or exec netcat until
	the next patch.

	* src/qemu/qemu_migration.c (qemuMigrationPrepareTunnel):
	Replace Unix socket with simpler pipe.
	Suggested by Paolo Bonzini.

2011-03-15  Eric Blake  <eblake@redhat.com>

	maint: make spacing in .sh files easier
	Commit 7f193757 renamed libvirt-guests.init from .in to .sh, which
	made it slip past sc_TAB_in_indentation.  I nearly reintroduced a
	tab, so I'm pushing this to prevent that from happening.

	* cfg.mk (sc_TAB_in_indentation): Update rule to include .sh files.
	* .dir-locals.el: List spacing preference for .sh files.

2011-03-15  Osier Yang  <jyang@redhat.com>

	qemu: Check the unsigned integer overflow
	As perhaps other hypervisor drivers use different capacity units,
	do the checking in qemu driver instead of in conf/domain_conf.c.

2011-03-15  Minoru Usui  <usui@mxm.nes.nec.co.jp>

	Fix performance problem of virStorageVolCreateXMLFrom()
	This patch changes zerobuf variable from array to VIR_ALLOC_N().

2011-03-15  Eric Blake  <eblake@redhat.com>

	libvirt-guests: avoid globbing when splitting $URIS
	* tools/libvirt-guests.init.sh (start, stop, gueststatus): Avoid
	shell globbing, since valid URIs can contain '?'.

2011-03-15  Philipp Hahn  <hahn@univention.de>

	libvirt-guest.init: quoting variables
	At least protect the $uri variable against further expansion by properly
	quoting it. While doing that, also quote all other variables to protect
	against shell meta characters.

	docs/formatdomain.html.in: Fix spelling PIC->PCI
	Not "Programmable Interrupt Controller" but "Peripheral Component
	Interconnect".

2011-03-15  Laine Stump  <laine@laine.org>

	audit: eliminate potential null pointer deref when auditing macvtap devices
	The newly added call to qemuAuditNetDevice in qemuPhysIfaceConnect was
	assuming that res_ifname (the name of the macvtap device) was always
	valid, but this isn't the case. If openMacvtapTap fails, it always
	returns NULL, which would result in a segv.

	Since the audit log only needs a record of devices that are actually
	sent to qemu, and a failure to open the macvtap device means that no
	device will be sent to qemu, we can solve this problem by only doing
	the audit if openMacvtapTap is successful (in which case res_ifname is
	guaranteed valid).

2011-03-14  Michal Privoznik  <mprivozn@redhat.com>

	virsh: Insert error messages to avoid a quiet abortion of commands
	in case of incorrect option parsing.

2011-03-14  Laine Stump  <laine@laine.org>

	network driver: don't send default route to clients on isolated networks
	Normally dnsmasq will send a default route (the address of the host in
	the network definition) to any client requesting an address via
	DHCP. On an isolated network this makes no sense, as we have iptables
	to prevent any traffic going out via that interface, so anything sent
	that way would be dropped anyway.

	This extra/unusable default route becomes problematic if you have
	setup a guest with multiple network interfaces, with one connected to
	an isolated network and another that provides connectivity to the
	outside (example - one interface directly connecting to a physical
	interface via macvtap, with a second connected to an isolated network
	so that the host and guest can communicate (macvtap doesn't support
	guest<->host communication without an external switch that supports
	vepa, or reflecting all traffic back)). In this case, if the guest
	chooses the default route of the isolated network, the guest will not
	be able to get network traffic beyond the host.

	To prevent dnsmasq from sending a default route, you can tell it to
	send 0 bytes of data for the default route option (option number 3)
	with --dhcp-option=3 (normally the data to send for the option would
	follow the option number; no extra data means "don't send this option").

	I have checked on RHEL5 (a good representative of the oldest supported
	libvirt platforms) and its version of dnsmasq (2.45) does support
	--dhcp-option, so this shouldn't create any compatibility problems.

2011-03-14  Jiri Denemark  <jdenemar@redhat.com>

	python: Use hardcoded python path in libvirt.py
	This partially reverts (and fixes that part in a different way) commit
	e4384459c93e3e786aa483c7f077d1d22148f689, which replaced
	``/usr/bin/python'' with ``/usr/bin/env python'' in all examples or
	scripts used during build to generate other files.

	However, python bindings module is compiled and linked against a
	specific python discovered or explicitly provided in configure phase.
	Thus libvirt.py, which is generated and installed into the system,
	should use the same python binary for which the module has been built.

	The hunk in Makefile.am replaces $(srcdir) with $(PYTHON), which might
	seem wrong but it is not. generator.py didn't use any of its command
	line arguments so passing $(srcdir) to it was redundant.

2011-03-14  Jiri Denemark  <jdenemar@redhat.com>

	virsh: Allow starting domains by UUID

2011-03-14  Osier Yang  <jyang@redhat.com>

	virsh: Free stream when shutdown console
	Otherwise connection of hypervisor driver will be leaked when
	one shutdown the guest in console. e.g.

	[root@localhost]# init 0
	......
	init: Re-executing /sbin/init
	Halting system...
	Power down.

	error: Failed to disconnect from the hypervisor, 1 leaked reference(s)

2011-03-14  Guido Günther  <agx@sigxcpu.org>

	Add missing checks for read only connections
	As pointed on CVE-2011-1146, some API forgot to check the read-only
	status of the connection for entry point which modify the state
	of the system or may lead to a remote execution using user data.
	The entry points concerned are:
	  - virConnectDomainXMLToNative
	  - virNodeDeviceDettach
	  - virNodeDeviceReAttach
	  - virNodeDeviceReset
	  - virDomainRevertToSnapshot
	  - virDomainSnapshotDelete

	* src/libvirt.c: fix the above set of entry points to error on read-only
	                 connections

2011-03-12  Laine Stump  <laine@laine.org>

	network driver: Use a separate dhcp leases file for each network
	By default, all dnsmasq processes share the same leases file. libvirt
	also uses the --dhcp-lease-max option to control the maximum number of
	leases allowed. The problem is that libvirt puts in a number equal to
	the number of addresses in the range for the one network handled by a
	single instance of dnsmasq, but dnsmasq checks the total number of
	leases in the file (which could potentially contain many more).

	The solution is to tell each instance of dnsmasq to create and use its
	own leases file. (/var/lib/libvirt/network/<net-name>.leases).

	This file is created by dnsmasq when it starts, but not deleted when
	it exists. This is fine when the network is just being stopped, but if
	the leases file was left around when a network was undefined, we could
	end up with an ever-increasing number of dead files - instead, we
	explicitly unlink the leases file when a network is undefined.

	Note that Ubuntu carries a patch against an older version of libvirt for this:

	hhttps://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/713071
	ttp://bazaar.launchpad.net/~serge-hallyn/ubuntu/maverick/libvirt/bugall/revision/109

	I was certain I'd also seen discussion of this on libvir-list or
	libvirt-users, but couldn't find it.

2011-03-12  Laine Stump  <laine@laine.org>

	network driver: Fix indentation from previous commit
	The previous commit put a large portion of networkBuildDnsmasqArgv
	inside an if { } block. This readjusts the indentation.

2011-03-12  Laine Stump  <laine@laine.org>

	network driver: Start dnsmasq even if no dhcp ranges/hosts are specified.
	This fixes a regression introduced in commit ad48df, and reported on
	the libvirt-users list:

	  https://www.redhat.com/archives/libvirt-users/2011-March/msg00018.html

	The problem in that commit was that we began searching a list of ip
	address definitions (rather than just having one) to look for a dhcp
	range or static host; when we didn't find any, our pointer (ipdef) was
	left at NULL, and when ipdef was NULL, we returned without starting up
	dnsmasq.

	Previously dnsmasq was started even without any dhcp ranges or static
	entries, because it's still useful for DNS services.

	Another problem I noticed while investigating was that, if there are
	IPv6 addresses, but no IPv4 addresses of any kind, we would jump out
	at an ever higher level in the call chain.

	This patch does the following:

	1) networkBuildDnsmasqArgv() = all uses of ipdef are protected from
	   NULL dereference. (this patch doesn't change indentation, to make
	   review easier. The next patch will change just the
	   indentation). ipdef is intended to point to the first IPv4 address
	   with DHCP info (or the first IPv4 address if none of them have any
	   dhcp info).

	2) networkStartDhcpDaemon() = if the loop looking for an ipdef with
	   DHCP info comes up empty, we then grab the first IPv4 def from the
	   list. Also, instead of returning if there are no IPv4 defs, we just
	   return if there are no IP defs at all (either v4 or v6). This way a
	   network that is IPv6-only will still get dnsmasq listening for DNS
	   queries.

	3) in networkStartNetworkDaemon() - we will startup dhcp not just if there
	   are any IPv4 addresses, but also if there are any IPv6 addresses.

2011-03-12  Matthias Bolte  <matthias.bolte@googlemail.com>

	Don't use INT64_MAX in libvirt.h because it requires stdint.h
	VIR_DOMAIN_MEMORY_PARAM_UNLIMITED uses INT64_MAX but stdint.h
	was not and should not be included. Therefore, libvirt.h was
	not self-contained.

	Instead of including stdint.h specify the value directly.

2011-03-12  Philipp Hahn  <hahn@univention.de>

	libvirt-guest.init: handle domain name with spaces
	awk splits the line on consecutive spaces, which breaks getting the name
	of a domain whose name contains spaces. Use sed instead to strip the
	"Name:" prefix from the line

2011-03-12  Philipp Hahn  <hahn@univention.de>

	domain.rng vs. formatdomain.html#elementsUSB
	The Relax-NG schema for domains regarding <hostdev> doesn't match what's
	implemented in src/conf/domain_conf.c#virDomainHostdevDefFormat(): The
	implementation only requires @type, but the schema currently either
	required none or all three attributes (@mode, @type, and @managed) to be
	defined together, because they are declared in the same
	<optional)-section. (@managed is currently even undocumented on
	<http://libvirt.org/formatdomain.html#elementsUSB>).

	Thus the following minimal <hostdev>-example fails to validate:
	<domain type='test'>
	        <name>N</name>
	        <memory>4096</memory>
	        <bootloader>/bin/false</bootloader>
	        <os>
	                <type arch='x86_64' machine='xenpv'>linux</type>
	        </os>
	        <devices>
	                <hostdev type='pci'>
	                        <source>
	                                <address bus='0x06' slot='0x00' function='0x0'/>
	                        </source>
	                </hostdev>
	        </devices>
	</domain>

	The schema is changed to match the current implementation:
	1. @mode is optional (which defaults to 'subsystem')
	2. @type is required
	3. @managed is optional (which defaults to 'no')

	The documentation is updated to mention @managed.

2011-03-12  Eric Blake  <eblake@redhat.com>

	qemu: fix -global argument usage
	* src/qemu/qemu_command.c (qemuBuildCommandLine): Pass two
	separate arguments, and fix indentation.

	docs: fix missing </p>
	* docs/formatdomain.html.in: Fix typo in last patch.
	Reported by Matthias Bolte.

2011-03-12  Philipp Hahn  <hahn@univention.de>

	Ignore backing file errors in FS storage pool
	Currently a single storage volume with a broken backing file will disable the
	whole storage pool. This can happen when the backing file is on some
	unavailable network storage or if the backing volume is deleted, while the
	storage volumes using it remain.
	Since the storage pool can not be re-activated, re-creating the missing
	or deleting the now useless volumes using libvirt only is not possible.

	Fixing this is a little bit tricky:
	1. virStorageBackendProbeTarget() only detects the missing backing file,
	   if the backing file format is not explicitly specified. If the
	   backing file is created using
		   kvm-img create -f qcow2 -o backing_fmt=qcow2,backing_file=... ...
	   no error is detected at this stage.
	   The new return code -3 signals that the backing file could not be
	   opened.
	2. The backingStore.format must be >= 0, since values < 0 would break
	   virStorageVolTargetDefFormat() when dumping the XML data such as
	       <format type='...'/>
	   Because of this the format is faked as VIR_STORAGE_FILE_RAW.
	3. virStorageBackendUpdateVolTargetInfo() always opens the backing file
	   and thus always detects a missing backing file.
	   Since it "only" updates the capacity, allocation, owner, group, mode
	   and SELinux label, just ignore errors at this stage, print an error
	   message and continue.
	4. Using vol-dump on a broken volume still doesn't work, but at least
	   vol-destroy and pool-refresh do work now.

	To reproduce:
	  dir=$(mktemp -d)
	  virsh pool-create-as tmp dir '' '' '' '' "$dir"
	  virsh vol-create-as --format qcow2 tmp back 1G
	  virsh vol-create-as --format qcow2 --backing-vol-format qcow2 --backing-vol back tmp cow 1G
	  virsh vol-delete --pool tmp back
	  virsh pool-refresh tmp
	After the last step, the pool will be gone (because it was not persistent). As
	long as the now broken image stays in the directory, you will not be able to
	re-create or re-start the pool.

2011-03-12  Gerhard Stenzel  <gstenzel@linux.vnet.ibm.com>

	documenting the 802.1Qbg parameters of a 'direct' interface
	This patchs adds documentation about the 802.1Qbg related parameters
	of the virtualport element in a 'direct' interface definition.

2011-03-11  Gui Jianfeng  <guijianfeng@cn.fujitsu.com>

	remote-protocol: implement new BlkioParameters API
	Remote protocol implementation of virDomainSetBlkioParameters and virDomainGetBlkioParameters.

	virsh: Adding blkiotune command to virsh tool
	Adding blkiotune command to virsh tool

	qemu: implement new BlkioParameters API
	Implement domainSetBlkioParameters and domainGetBlkioParameters for QEmu

	libvirt: implements virDomain{Get,Set}BlkioParameters
	Implements virDomainSetBlkioParameters and virDomainGetBlkioParameters and initialization

	libvirt: add virDomain{Get,Set}BlkioParameters
	Add virDomainSetBlkioParameters virDomainGetBlkioParameters

2011-03-11  Taku Izumi  <izumi.taku@jp.fujitsu.com>

	setmem: add the new options to "virsh setmem" command
	This patch adds the new options (--live and --config)  to "virsh setmem" command.
	The behavior of above options is the same as that of "virsh setvcpus" and so on.
	That is, when the --config option is specified, a modification is effective for
	the persistent domain. Moreover we can modify the memory size of inactive domains
	as well as that of active domains.

	setmem: implement the remote protocol to address the new API
	This patch implements the remote protocol to address the new API.

	setmem: implement the code to address the new API in the qemu driver
	This patch implements the code to address the new API
	in the qemu driver.

	setmem: introduce a new libvirt API (virDomainSetMemoryFlags)
	This patch introduces a new libvirt API (virDomainSetMemoryFlags) and
	a flag (virDomainMemoryModFlags).

2011-03-11  Guido Günther  <agx@sigxcpu.org>

	Make sure we reset the umask on the error path

2011-03-10  Eric Blake  <eblake@redhat.com>

	audit: audit use of /dev/net/tun, /dev/tapN, /dev/vhost-net
	Opening raw network devices with the intent of passing those fds to
	qemu is worth an audit point.  This makes a multi-part audit: first,
	we audit the device(s) that libvirt opens on behalf of the MAC address
	of a to-be-created interface (which can independently succeed or
	fail), then we audit whether qemu actually started the network device
	with the same MAC (so searching backwards for successful audits with
	the same MAC will show which fd(s) qemu is actually using).  Note that
	it is possible for the fd to be successfully opened but no attempt
	made to pass the fd to qemu (for example, because intermediate
	nwfilter operations failed) - no interface start audit will occur in
	that case; so the audit for a successful opened fd does not imply
	rights given to qemu unless there is a followup audit about the
	attempt to start a new interface.

	Likewise, when a network device is hot-unplugged, there is only one
	audit message about the MAC being discontinued; again, searching back
	to the earlier device open audits will show which fds that qemu quits
	using (and yes, I checked via /proc/<qemu-pid>/fd that qemu _does_
	close out the fds associated with an interface on hot-unplug).  The
	code would require much more refactoring to be able to definitively
	state which device(s) were discontinued at that point, since we
	currently don't record anywhere in the XML whether /dev/vhost-net was
	opened for a given interface.

	* src/qemu/qemu_audit.h (qemuAuditNetDevice): New prototype.
	* src/qemu/qemu_audit.c (qemuAuditNetDevice): New function.
	* src/qemu/qemu_command.h (qemuNetworkIfaceConnect)
	(qemuPhysIfaceConnect, qemuOpenVhostNet): Adjust prototype.
	* src/qemu/qemu_command.c (qemuNetworkIfaceConnect)
	(qemuPhysIfaceConnect, qemuOpenVhostNet): Add audit points and
	adjust parameters.
	(qemuBuildCommandLine): Adjust caller.
	* src/qemu/qemu_hotplug.c (qemuDomainAttachNetDevice): Likewise.

2011-03-10  Eric Blake  <eblake@redhat.com>

	qemu: don't request cgroup ACL access for /dev/net/tun
	Since libvirt always passes /dev/net/tun to qemu via fd, we should
	never trigger the cases where qemu tries to directly open the
	device.  Therefore, it is safer to deny the cgroup device ACL.

	* src/qemu/qemu_cgroup.c (defaultDeviceACL): Remove /dev/net/tun.
	* src/qemu/qemu.conf (cgroup_device_acl): Reflect this change.

2011-03-10  Eric Blake  <eblake@redhat.com>

	qemu: support vhost in attach-interface
	* src/qemu/qemu_hotplug.c (qemuDomainAttachNetDevice): Honor vhost
	designations, similar to qemu_command code paths.
	* src/qemu/qemu_command.h (qemuOpenVhostNet): New prototype.
	* src/qemu/qemu_command.c (qemuOpenVhostNet): Export.

2011-03-10  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Stop guest CPUs before creating a snapshot

	qemu: Refactor qemuDomainSnapshotCreateXML

	qemu: Escape snapshot name passed to {save,load,del}vm

2011-03-10  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Fallback to HMP for snapshot commands
	qemu driver in libvirt gained support for creating domain snapshots
	almost a year ago in libvirt 0.8.0. Since then we enabled QMP support
	for qemu >= 0.13.0 but QMP equivalents of {save,load,del}vm commands are
	not implemented in current qemu (0.14.0) so the domain snapshot support
	is not very useful.

	This patch detects when the appropriate QMP command is not implemented
	and tries to use human-monitor-command (aka HMP passthrough) to run
	it's HMP equivalent.

2011-03-10  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Rename qemuMonitorCommandWithHandler as qemuMonitorText*
	To make it more obvious that it is only used for text monitor. The
	naming also matches the style of qemuMonitorTextCommandWithFd.

	qemu: Rename qemuMonitorCommand{,WithFd} as qemuMonitorHMP*
	So that it's obvious that they are supposed to be used with HMP commands.

	qemu: Setup infrastructure for HMP passthrough
	JSON monitor command implementation can now just directly call text
	monitor implementation and it will be automatically encapsulated into
	QMP's human-monitor-command.

	qemu: Fix warnings in event handlers
	Some qemu monitor event handlers were issuing inadequate warning when
	virDomainSaveStatus() failed. They copied the message from I/O error
	handler without customizing it to provide better information on why
	virDomainSaveStatus() was called.

2011-03-10  Osier Yang  <jyang@redhat.com>

	storage: Update qemu-img flag checking
	For newer qemu-img, the help string for "backing file format" is
	"[-F backing_fmt]".

	Fix the wrong logic error by commit e997c268.

	* src/storage/storage_backend.c

2011-03-10  Osier Yang  <jyang@redhat.com>

	qemu: Replace deprecated option of qemu-img
	qemu-img silently disable "-e", so we can't use it for volume
	encryption anymore, change it into "-o encryption=on" if qemu
	supports "-o" option.

2011-03-10  Eric Blake  <eblake@redhat.com>

	audit: also audit cgroup ACL permissions
	* src/qemu/qemu_audit.h (qemuAuditCgroupMajor)
	(qemuAuditCgroupPath): Add parameter.
	* src/qemu/qemu_audit.c (qemuAuditCgroupMajor)
	(qemuAuditCgroupPath): Add 'acl=rwm' to cgroup audit entries.
	* src/qemu/qemu_cgroup.c: Update clients.
	* src/qemu/qemu_driver.c (qemudDomainSaveFlag): Likewise.

2011-03-10  Eric Blake  <eblake@redhat.com>

	cgroup: allow fine-tuning of device ACL permissions
	Adding audit points showed that we were granting too much privilege
	to qemu; it should not need any mknod rights to recreate any
	devices.  On the other hand, lxc should have all device privileges.
	The solution is adding a flag parameter.

	This also lets us restrict write access to read-only disks.

	* src/util/cgroup.h (virCgroup*Device*): Adjust prototypes.
	* src/util/cgroup.c (virCgroupAllowDevice)
	(virCgroupAllowDeviceMajor, virCgroupAllowDevicePath)
	(virCgroupDenyDevice, virCgroupDenyDeviceMajor)
	(virCgroupDenyDevicePath): Add parameter.
	* src/qemu/qemu_driver.c (qemudDomainSaveFlag): Update clients.
	* src/lxc/lxc_controller.c (lxcSetContainerResources): Likewise.
	* src/qemu/qemu_cgroup.c: Likewise.
	(qemuSetupDiskPathAllow): Also, honor read-only disks.

2011-03-10  Eric Blake  <eblake@redhat.com>

	audit: rename remaining qemu audit functions
	Also add ATTRIBUTE_NONNULL markers.

	* src/qemu/qemu_audit.h: The pattern qemuDomainXXXAudit is
	inconsistent; prefer qemuAuditXXX instead.
	* src/qemu/qemu_audit.c: Reflect the renames.
	* src/qemu/qemu_driver.c: Likewise.
	* src/qemu/qemu_hotplug.c: Likewise.
	* src/qemu/qemu_migration.c: Likewise.
	* src/qemu/qemu_process.c: Likewise.

2011-03-10  Eric Blake  <eblake@redhat.com>

	audit: also audit cgroup controller path
	Although the cgroup device ACL controller path can be worked out
	by researching the code, it is more efficient to include that
	information directly in the audit message.

	* src/util/cgroup.h (virCgroupPathOfController): New prototype.
	* src/util/cgroup.c (virCgroupPathOfController): Export.
	* src/libvirt_private.syms: Likewise.
	* src/qemu/qemu_audit.c (qemuAuditCgroup): Use it.

2011-03-10  Eric Blake  <eblake@redhat.com>

	audit: split cgroup audit types to allow more information
	Device names can be manipulated, so it is better to also log
	the major/minor device number corresponding to the cgroup ACL
	changes that libvirt made.  This required some refactoring
	of the relatively new qemu cgroup audit code.

	Also, qemuSetupChardevCgroup was only auditing on failure, not success.

	* src/qemu/qemu_audit.h (qemuDomainCgroupAudit): Delete.
	(qemuAuditCgroup, qemuAuditCgroupMajor, qemuAuditCgroupPath): New
	prototypes.
	* src/qemu/qemu_audit.c (qemuDomainCgroupAudit): Rename...
	(qemuAuditCgroup): ...and drop a parameter.
	(qemuAuditCgroupMajor, qemuAuditCgroupPath): New functions, to
	allow listing device major/minor in audit.
	(qemuAuditGetRdev): New helper function.
	* src/qemu/qemu_driver.c (qemudDomainSaveFlag): Adjust callers.
	* src/qemu/qemu_cgroup.c (qemuSetupDiskPathAllow)
	(qemuSetupHostUsbDeviceCgroup, qemuSetupCgroup)
	(qemuTeardownDiskPathDeny): Likewise.
	(qemuSetupChardevCgroup): Likewise, fixing missing audit.

2011-03-09  Eric Blake  <eblake@redhat.com>

	audit: tweak audit messages to match conventions
	* src/qemu/qemu_audit.c (qemuDomainHostdevAudit): Avoid use of
	"type", which has a pre-defined meaning.
	(qemuDomainCgroupAudit): Likewise, as well as "item".

2011-03-09  Eric Blake  <eblake@redhat.com>

	docs: silence warnings about generated API docs
	I noticed these while testing 'make dist'.

	Parsing ./../src/util/event.c
	Function comment for virEventRegisterDefaultImpl lacks description of return value
	Function comment for virEventRunDefaultImpl lacks description of return value
	Parsing ./../src/util/virterror.c
	Missing comment for function virSetErrorLogPriorityFunc

	* src/util/event.c (virEventRegisterDefaultImpl)
	(virEventRunDefaultImpl): Document return types.
	* src/util/virterror.c (virSetErrorLogPriorityFunc): Provide docs.

2011-03-09  Eric Blake  <eblake@redhat.com>

	docs: document <driver name='vhost'/> for interfaces
	* docs/formatdomain.html.in: Document virtio backend selection.

2011-03-09  Guido Günther  <agx@sigxcpu.org>

	Make sure the rundir is accessible by the user
	otherwise the user might not have enough permissions to access the
	socket if root's umask is 077.

	http://bugs.debian.org/614210

2011-03-09  Cole Robinson  <crobinso@redhat.com>

	Don't overwrite virRun error messages
	virRun gives pretty useful error output, let's not overwrite it unless there
	is a good reason. Some places were providing more information about what
	the commands were _attempting_ to do, however that's usually less useful from
	a debugging POV than what actually happened.

2011-03-09  Guido Günther  <agx@sigxcpu.org>

	libvirtd: Remove indirect linking
	as described at
	http://wiki.debian.org/ToolChain/DSOLinking
	https://fedoraproject.org/wiki/UnderstandingDSOLinkChange

	otherwise the build fails on current Debian unstable with:

	CCLD   libvirtd
	/usr/bin/ld: ../src/.libs/libvirt_driver_lxc.a(libvirt_driver_lxc_la-lxc_container.o): undefined reference to symbol 'capng_apply'
	/usr/bin/ld: note: 'capng_apply' is defined in DSO //usr/lib/libcap-ng.so.0 so try adding it to the linker command line

	CCLD   libvirtd
	/usr/bin/ld: ../src/.libs/libvirt_driver_storage.a(libvirt_driver_storage_la-storage_backend.o): undefined reference to symbol 'fgetfilecon'
	/usr/bin/ld: note: 'fgetfilecon' is defined in DSO //lib/libselinux.so.1 so try adding it to the linker command line
	//lib/libselinux.so.1: could not read symbols: Invalid operation

	and similar errors.

2011-03-09  Hu Tao  <hutao@cn.fujitsu.com>

	Fix a wrong error message thrown to user
	* src/qemu/qemu_driver.c: qemuDomainUpdateDeviceFlags() is not disk
	  specific as the message suggests

2011-03-09  Eric Blake  <eblake@redhat.com>

	build: avoid compiler warning on cygwin
	On cygwin:

	  CC       libvirt_driver_security_la-security_dac.lo
	security/security_dac.c: In function 'virSecurityDACSetProcessLabel':
	security/security_dac.c:618: warning: format '%d' expects type 'int', but argument 7 has type 'uid_t' [-Wformat]

	We've done this before (see src/util/util.c).

	* src/security/security_dac.c (virSecurityDACSetProcessLabel): On
	cygwin, uid_t is a 32-bit long.

2011-03-09  Eric Blake  <eblake@redhat.com>

	build: fix build on cygwin
	On cygwin:

	  CC        libvirt_util_la-cgroup.lo
	util/cgroup.c: In function 'virCgroupKillRecursiveInternal':
	util/cgroup.c:1458: warning: implicit declaration of function 'virCgroupNew' [-Wimplicit-function-declaration]

	* src/util/cgroup.c (virCgroupKill): Don't build on platforms
	where virCgroupNew is unsupported.

2011-03-09  Wen Congyang  <wency@cn.fujitsu.com>

	build: fix building error when building without libvirtd
	When building libvirt without libvirtd, I receive the following errors:
	make[1]: Leaving directory `/home/wency/source/test/libvirt/src'
	 (cd daemon && make  top_distdir=../libvirt-0.8.8 distdir=../libvirt-0.8.8/daemon \
	     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
	make[1]: Entering directory `/home/wency/source/test/libvirt/daemon'
	make[1]: *** No rule to make target `libvirtd.8.in', needed by `distdir'.  Stop.

	This bug was caused by commit 6db98a2d.

2011-03-09  Eric Blake  <eblake@redhat.com>

	docs: correct range of default NAT subnet
	* docs/formatdomain.html.in: Fix typo.

2011-03-09  Guido Günther  <agx@sigxcpu.org>

	virsh: Remove indirect link against libxml2
	as described at
	http://wiki.debian.org/ToolChain/DSOLinking
	https://fedoraproject.org/wiki/UnderstandingDSOLinkChange

	otherwise the build fails on current Debian unstable with:

	CCLD   virsh
	/usr/bin/ld: virsh-virsh.o: undefined reference to symbol 'xmlSaveTree@@LIBXML2_2.6.8'
	/usr/bin/ld: note: 'xmlSaveTree@@LIBXML2_2.6.8' is defined in DSO //usr/lib/libxml2.so.2 so try adding it to the linker command line
	//usr/lib/libxml2.so.2: could not read symbols: Invalid operation

2011-03-09  Michal Privoznik  <mprivozn@redhat.com>

	virsh: Change option parsing functions to return tri-state information
	This is needed to detect situations when optional argument was
	specified with non-integer value: '--int-opt foo'. To keep functions
	uniform vshCommandOptString function was also changed, because it
	returns tri-state value as well. Given result pointer is updated only
	in case of success. If parsing fails, result is not updated at all.

	virsh: change vshCommandOptString return type and fix const-correctness
	This function should return pointer to const, because we don't want
	to change command option value. Therefore we can ensure const-correctness.

2011-03-09  Cole Robinson  <crobinso@redhat.com>

	docs/formatdomain: Add release info for disk <driver> attributes

2011-03-08  Daniel Veillard  <veillard@redhat.com>

	Fix build on cygwin
	Apparently some signals found on Unix are not exposed, this led
	to a compilation failure
	* src/util/logging.c: make code related to each signal dependant
	  upon the definition of that signal

2011-03-08  Wen Congyang  <wency@cn.fujitsu.com>

	support to detach USB disk

	rename qemuDomainDetachSCSIDiskDevice to qemuDomainDetachDiskDevice
	The way to detach a USB disk is the same as that to detach a SCSI
	disk. Rename this function and we can use it to detach a USB disk.

2011-03-08  Cole Robinson  <crobinso@redhat.com>

	qemu_hotplug: Reword error if spice password change not available
	Currently it sounds like spice is completely unsupported, which is
	confusing.

2011-03-08  Wen Congyang  <wency@cn.fujitsu.com>

	unlock eventLoop before calling callback function
	When I use newest libvirt to save a domain, libvirtd will be deadlock.
	Here is the output of gdb:
	(gdb) thread 3
	[Switching to thread 3 (Thread 0x7f972a1fc710 (LWP 30265))]#0  0x000000351fe0e034 in __lll_lock_wait () from /lib64/libpthread.so.0
	(gdb) bt
	    at qemu/qemu_driver.c:2074
	    ret=0x7f972a1fbbe0) at remote.c:2273
	(gdb) thread 7
	[Switching to thread 7 (Thread 0x7f9730bcd710 (LWP 30261))]#0  0x000000351fe0e034 in __lll_lock_wait () from /lib64/libpthread.so.0
	(gdb) bt
	(gdb) p *(virMutexPtr)0x6fdd60
	$2 = {lock = {__data = {__lock = 2, __count = 0, __owner = 30261, __nusers = 1, __kind = 0, __spins = 0, __list = {__prev = 0x0, __next = 0x0}},
	    __size = "\002\000\000\000\000\000\000\000\065v\000\000\001", '\000' <repeats 26 times>, __align = 2}}
	(gdb) p *(virMutexPtr)0x1a63ac0
	$3 = {lock = {__data = {__lock = 2, __count = 0, __owner = 30265, __nusers = 1, __kind = 0, __spins = 0, __list = {__prev = 0x0, __next = 0x0}},
	    __size = "\002\000\000\000\000\000\000\000\071v\000\000\001", '\000' <repeats 26 times>, __align = 2}}
	(gdb) info threads
	  7 Thread 0x7f9730bcd710 (LWP 30261)  0x000000351fe0e034 in __lll_lock_wait () from /lib64/libpthread.so.0
	  6 Thread 0x7f972bfff710 (LWP 30262)  0x000000351fe0b43c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
	  5 Thread 0x7f972b5fe710 (LWP 30263)  0x000000351fe0b43c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
	  4 Thread 0x7f972abfd710 (LWP 30264)  0x000000351fe0b43c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
	* 3 Thread 0x7f972a1fc710 (LWP 30265)  0x000000351fe0e034 in __lll_lock_wait () from /lib64/libpthread.so.0
	  2 Thread 0x7f97297fb710 (LWP 30266)  0x000000351fe0b43c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
	  1 Thread 0x7f9737aac800 (LWP 30260)  0x000000351fe0803d in pthread_join () from /lib64/libpthread.so.0

	The reason is that we will try to lock some object in callback function, and we may call event API with locking the same object.
	In the function virEventDispatchHandles(), we unlock eventLoop before calling callback function. I think we should
	do the same thing in the function virEventCleanupTimeouts() and virEventCleanupHandles().

2011-03-07  Daniel P. Berrange  <berrange@redhat.com>

	Expose event loop implementation as a public API
	Not all applications have an existing event loop they need
	to integrate with. Forcing them to implement the libvirt
	event loop integration APIs is an undue burden. This just
	exposes our simple poll() based implementation for apps
	to use. So instead of calling

	   virEventRegister(....callbacks...)

	The app would call

	   virEventRegisterDefaultImpl()

	And then have a thread somewhere calling

	    static bool quit = false;
	    ....
	    while (!quit)
	      virEventRunDefaultImpl()

	* daemon/libvirtd.c, tools/console.c,
	  tools/virsh.c: Convert to public event loop APIs
	* include/libvirt/libvirt.h.in, src/libvirt_private.syms: Add
	  virEventRegisterDefaultImpl and virEventRunDefaultImpl
	* src/util/event.c: Implement virEventRegisterDefaultImpl
	  and virEventRunDefaultImpl using poll() event loop
	* src/util/event_poll.c: Add full error reporting
	* src/util/virterror.c, include/libvirt/virterror.h: Add
	  VIR_FROM_EVENTS

2011-03-07  Daniel P. Berrange  <berrange@redhat.com>

	Move event code out of the daemon/ into src/util/
	The event loop implementation is used by more than just the
	daemon, so move it into the shared area.

	* daemon/event.c, src/util/event_poll.c: Renamed
	* daemon/event.h, src/util/event_poll.h: Renamed
	* tools/Makefile.am, tools/console.c, tools/virsh.c: Update
	  to use new virEventPoll APIs
	* daemon/mdns.c, daemon/mdns.c, daemon/Makefile.am: Update
	  to use new virEventPoll APIs

2011-03-07  Daniel P. Berrange  <berrange@redhat.com>

	Convert daemon/virsh over to use primary event APIs, rather than impl
	The daemon code calls virEventAddHandleImpl directly instead
	of calling the wrapper virEventAddHandle.

	* tools/console.c, daemon/libvirtd.c, daemon/mdns.c: Convert to
	  use primary event APIs

2011-03-07  Daniel Veillard  <veillard@redhat.com>

	Cleaning up some of the logging code
	* src/util/logging.c: fix virLogDumpAllFD() to avoid snprintf, simplify
	  the code and provide more useful signal descriptions. Also remove an
	  unused variable.

2011-03-06  Osier Yang  <jyang@redhat.com>

	qemu: Support vram for video of qxl type
	For qemu names the primary vga as "qxl-vga":

	  1) if vram is specified for 2nd qxl device:

	    -vga qxl -global qxl-vga.vram_size=$SIZE \
	    -device qxl,id=video1,vram_size=$SIZE,...

	  2) if vram is not specified for 2nd qxl device, (use the default
	     set by global):

	    -vga qxl -global qxl-vga.vram_size=$SIZE \
	    -device qxl,id=video1,...

	For qemu names all qxl devices as "qxl":

	  1) if vram is specified for 2nd qxl device:

	    -vga qxl -global qxl.vram_size=$SIZE \
	    -device qxl,id=video1,vram_size=$SIZE ...

	  2) if vram is not specified for 2nd qxl device:

	    -vga qxl -global qxl-vga.vram_size=$SIZE \
	    -device qxl,id=video1,...

	"-global" is the only way to define vram_size for the primary qxl
	device, regardless of how qemu names it, (It's not good a good
	way, as original idea of "-global" is to set a global default for
	a driver property, but to specify vram for first qxl device, we
	have to use it).

	For other qxl devices, as they are represented by "-device", could
	specify it directly and seperately for each, and it overrides the
	default set by "-global" if specified.

	v1 - v2:
	  * modify "virDomainVideoDefaultRAM" so that it returns 16M as the
	    default vram_size for qxl device.

	  * vram_size * 1024 (qemu accepts bytes for vram_size).

	  * apply default vram_size for qxl device for which vram_size is
	    not specified.

	  * modify "graphics-spice" tests (more sensiable vram_size)

	  * Add an argument of virDomainDefPtr type for qemuBuildVideoDevStr,
	    to use virDomainVideoDefaultRAM in qemuBuildVideoDevStr).

	v2 - v3:
	  * Modify default video memory size for qxl device from 16M to 24M

	  * Update codes to be consistent with changes on qemu_capabilities.*

2011-03-05  Phil Petty  <phpetty@cisco.com>

	fixes for several memory leaks

2011-03-04  Daniel Veillard  <veillard@redhat.com>

	Dump the debug buffer to libvirtd.log on fatal signal
	In case of imminent crash or upon request (signal USR2),
	dump the logging buffer to the libvirtd.log file for
	post-mortem analysis
	* daemon/libvirtd.c: create a sig_fatal() handler connected to
	  SIGFPE SIGSEGV SIGILL SIGABRT SIGBUS and SIGUSR2, just dumping
	  the log buffer using virLogEmergencyDumpAll

	Add an an internal API for emergency dump of debug buffer
	virLogEmergencyDumpAll() allows to dump the content of the
	debug buffer from within a signal handler. It saves to all
	log file or stderr if none is found
	* src/util/logging.h src/util/logging.c: add the new API
	  and cleanup the old virLogDump code
	* src/libvirt_private.syms: exports it as a private symbol

	Fix a counter bug in the log buffer
	* src/util/logging.c: the start pointer need to wrap around too

	Add logrotate support for libvirtd.log
	As the file may grow quite a bit especially with debug turned on.
	* daemon/libvirtd.logrotate.in daemon/Makefile.am libvirt.spec.in:
	  add new logrotate file for the daemon log

	Change default log policy to libvirtd.log instead of syslog
	Syslog is not the best place to go search for libvirt error
	logs, change it to a default file output libvirtd.log, but
	still keep standard error if not run as a daemon.
	Depending on whether it's run as root or user, the log is saved
	in the local state dir or in $HOME/.libvirt.
	* daemon/libvirtd.c: change default logging to go to libvirtd.log

	Force all logs to go to the round robbin memory buffer
	Initially only the log actually written out by libvirt were
	saved on the memory buffer, this patch forces all informations
	including info and debug to be saved in memory too. This is
	useful to get full data in case of crash.

2011-03-04  Laine Stump  <laine@laine.org>

	qemu: avoid corruption of domain hashtable and misuse of freed domains
	This was also found while investigating

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

	An EOF on a domain's monitor socket results in an event being queued
	to handle the EOF. The handler calls qemuProcessHandleMonitorEOF. If
	it is a transient domain, this leads to a call to
	virDomainRemoveInactive, which removes the domain from the driver's
	hashtable and unref's it. Nowhere in this code is the qemu driver lock
	acquired.

	However, all modifications to the driver's domain hashtable *must* be
	done while holding the driver lock, otherwise the hashtable can become
	corrupt, and (even more likely) another thread could call a different
	hashtable function and acquire a pointer to the domain that is in the
	process of being destroyed.

	To prevent such a disaster, qemuProcessHandleMonitorEOF must get the
	qemu driver lock *before* it gets the DomainObj's lock, and hold it
	until it is finished with the DomainObj. This guarantees that nobody
	else modifies the hashtable at the same time, and that anyone who had
	already gotten the DomainObj from the hashtable prior to this call has
	finished with it before we remove/destroy it.

2011-03-04  Laine Stump  <laine@laine.org>

	qemu: Add missing lock of virDomainObj before calling virDomainUnref
	This was found while researching the root cause of:

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

	virDomainUnref should only be called with the lock held for the
	virDomainObj in question. However, when a transient qemu domain gets
	EOF on its monitor socket, it queues an event which frees the monitor,
	which unref's the virDomainObj without first locking it. If another
	thread has already locked the virDomainObj, the modification of the
	refcount could potentially be corrupted. In an extreme case, it could
	also be potentially unlocked by virDomainObjFree, thus left open to
	modification by anyone else who would have otherwise waited for the
	lock (not to mention the fact that they would be accessing freed
	data!).

	The solution is to have qemuMonitorFree lock the domain object right
	before unrefing it. Since the caller to qemuMonitorFree doesn't expect
	this lock to be held, if the refcount doesn't go all the way to 0,
	qemuMonitorFree must unlock it after the unref.

2011-03-04  KAMEZAWA Hiroyuki  <kamezawa.hiroyu@jp.fujitsu.com>

	AUTHORS: adjust to preferred spelling
	maybe sounds strange but I've used this signature for years.
	see http://en.wikipedia.org/wiki/Family_name

2011-03-04  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Escape password for XML
	Passwords are allowed to contain <, >, &, ', " characters.
	Those need to be replaced by the corresponding entities.

	Reported by Hereward Cooper.

2011-03-03  Eric Blake  <eblake@redhat.com>

	util: correct retry path in virFileOperation
	In virFileOperation, the parent does a fallback to a non-fork
	attempt if it detects that the child returned EACCES.  However,
	the child was calling _exit(-EACCES), which does _not_ appear
	as EACCES in the parent.

	* src/util/util.c (virFileOperation): Correctly pass EACCES from
	child to parent.

2011-03-03  Soren Hansen  <soren@linux2go.dk>

	Pass virSecurityManagerPtr to virSecurityDAC{Set, Restore}ChardevCallback
	virSecurityDAC{Set,Restore}ChardevCallback expect virSecurityManagerPtr,
	but are passed virDomainObjPtr instead. This makes
	virSecurityDACSetChardevLabel set a wrong uid/gid on chardevs. This
	patch fixes this behaviour.

2011-03-03  Eric Blake  <eblake@redhat.com>

	maint: update to latest gnulib
	* .gnulib: Update to latest, for syntax-check improvement.
	* .x-sc_prohibit_empty_lines_at_EOF: Add more exemptions.

	maint: avoid long lines in more tests
	* tests/xml2sexprdata/*.sexpr: Add backslash-newlines.
	* tests/sexpr2xmldata/*.sexpr: Likewise.
	* tests/qemuxml2argvdata/qemuxml2argv-disk-aio.args: Likewise.

2011-03-03  Jiri Denemark  <jdenemar@redhat.com>

	util: Allow removing hash entries in virHashForEach
	This fixes a possible crash of libvirtd during its startup. When qemu
	driver reconnects to running domains, it iterates over all domain
	objects in a hash. When reconnecting to an associated qemu monitor
	fails and the domain is transient, it's immediately removed from the
	hash. Despite the fact that it's explicitly forbidden to do so. If
	libvirtd is lucky enough, virHashForEach will access random memory when
	the callback finishes and the deamon will crash.

	Since it's trivial to fix virHashForEach to allow removal of hash
	entries while iterating through them, I went this way instead of fixing
	qemuReconnectDomain callback (and possibly others) to avoid deleting the
	entries.

2011-03-03  Daniel P. Berrange  <berrange@redhat.com>

	Attempt to improve an error message
	Replace the 'Unknown failure' error message with something a
	little bit more descriptive.

	* src/util/virterror.c: Improve error message

2011-03-02  Eric Blake  <eblake@redhat.com>

	qemu: avoid double close on domain restore
	qemudDomainSaveImageStartVM was evil - it closed the incoming fd
	argument on some, but not all, code paths, without informing the
	caller about that action.  No wonder that this resulted in
	double-closes: https://bugzilla.redhat.com/show_bug.cgi?id=672725

	* src/qemu/qemu_driver.c (qemudDomainSaveImageStartVM): Alter
	signature, to avoid double-close.
	(qemudDomainRestore, qemudDomainObjRestore): Update callers.

2011-03-02  Daniel P. Berrange  <berrange@redhat.com>

	add additional event debug points
	Followup to commit 2222bd24

2011-03-01  Eric Blake  <eblake@redhat.com>

	qemu: only request sound cgroup ACL when required
	When a SPICE or VNC graphics controller is present, and sound is
	piggybacked over a channel to the graphics device rather than
	directly accessing host hardware, then there is no need to grant
	host hardware access to that qemu process.

	* src/qemu/qemu_cgroup.c (qemuSetupCgroup): Prevent sound with
	spice, and with vnc when vnc_allow_host_audio is 0.
	Reported by Daniel Berrange.

2011-02-28  Daniel P. Berrange  <berrange@redhat.com>

	Add check for kill() to fix build of cgroups on win32
	The kill() function doesn't exist on Win32, so it needs to be
	checked for at build time & code disabled in cgroups

	* configure.ac: Check for kill()
	* src/util/cgroup.c: Stub out virCGroupKill* functions
	  when kill() isn't available

2011-02-26  Michal Novotny  <minovotn@redhat.com>

	Add support for multiple serial ports into the Xen driver
	this is the patch to add support for multiple serial ports to the
	libvirt Xen driver. It support both old style (serial = "pty") and
	new style (serial = [ "/dev/ttyS0", "/dev/ttyS1" ]) definition and
	tests for xml2sexpr, sexpr2xml and xmconfig have been added as well.

	Written and tested on RHEL-5 Xen dom0 and working as designed but
	the Xen version have to have patch for RHBZ #614004 but this patch
	is for upstream version of libvirt.

	Also, this patch is addressing issue described in RHBZ #670789.

2011-02-26  Michal Novotny  <minovotn@redhat.com>

	Fix port value parsing for serial and parallel ports
	this is the patch to fix the virDomainChrDefParseTargetXML() functionality
	to parse the target port from XML if available. This is necessary for
	multiple serial port support which is the second part of this patch.

2011-02-25  Daniel P. Berrange  <berrange@redhat.com>

	Add APIs for killing off processes inside a cgroup
	The virCgroupKill method kills all PIDs found in a cgroup

	The virCgroupKillRecursively method does this recursively
	for child cgroups.

	The virCgroupKillPainfully method does a recursive kill
	several times in a row until everything has really died

2011-02-25  Daniel P. Berrange  <berrange@redhat.com>

	Allow hash tables to use generic pointers as keys
	Relax the restriction that the hash table key must be a string
	by allowing an arbitrary hash code generator + comparison func
	to be provided

	* util/hash.c, util/hash.h: Allow any pointer as a key
	* internal.h: Include stdbool.h as standard.
	* conf/domain_conf.c, conf/domain_conf.c,
	  conf/nwfilter_params.c, nwfilter/nwfilter_gentech_driver.c,
	  nwfilter/nwfilter_gentech_driver.h, nwfilter/nwfilter_learnipaddr.c,
	  qemu/qemu_command.c, qemu/qemu_driver.c,
	  qemu/qemu_process.c, uml/uml_driver.c,
	  xen/xm_internal.c: s/char */void */ in hash callbacks

2011-02-25  Daniel P. Berrange  <berrange@redhat.com>

	Remove deallocator parameter from hash functions
	Since the deallocator is passed into the constructor of
	a hash table it is not desirable to pass it into each
	function again. Remove it from all functions, but provide
	a virHashSteal to allow a item to be removed from a hash
	table without deleteing it.

	* src/util/hash.c, src/util/hash.h: Remove deallocator
	  param from all functions. Add virHashSteal
	* src/libvirt_private.syms: Add virHashSteal
	* src/conf/domain_conf.c, src/conf/nwfilter_params.c,
	  src/nwfilter/nwfilter_learnipaddr.c,
	  src/qemu/qemu_command.c, src/xen/xm_internal.c: Update
	  for changed hash API

2011-02-25  Daniel P. Berrange  <berrange@redhat.com>

	Make commandtest more robust wrt its execution environment
	When executed from cron, commandtest would fail to correctly
	identify daemon processes. Set session ID and process group
	IDs at startup to ensure we have a consistent environment to
	run in.

	* tests/commandtest.c: Call setsid() and setpgid()

2011-02-25  Philipp Hahn  <hahn@univention.de>

	Fix spelling mistake: seek
	Replace wrong "set" by correct "seek" in error message.

2011-02-25  Eric Blake  <eblake@redhat.com>

	audit: audit qemu pci and usb device passthrough
	* src/qemu/qemu_audit.h (qemuDomainHostdevAudit): New prototype.
	* src/qemu/qemu_audit.c (qemuDomainHostdevAudit): New function.
	(qemuDomainStartAudit): Call as appropriate.
	* src/qemu/qemu_hotplug.c (qemuDomainAttachHostPciDevice)
	(qemuDomainAttachHostUsbDevice, qemuDomainDetachHostPciDevice)
	(qemuDomainDetachHostUsbDevice): Likewise.

	audit: audit qemu memory and vcpu adjusments
	* src/qemu/qemu_audit.h (qemuDomainMemoryAudit)
	(qemuDomainVcpuAudit): New prototypes.
	* src/qemu/qemu_audit.c (qemuDomainResourceAudit)
	(qemuDomainMemoryAudit, qemuDomainVcpuAudit): New functions.
	(qemuDomainStartAudit): Call as appropriate.
	* src/qemu/qemu_driver.c (qemudDomainSetMemory)
	(qemudDomainHotplugVcpus): Likewise.

	audit: add qemu hooks for auditing cgroup events
	* src/qemu/qemu_audit.h (qemuDomainCgroupAudit): New prototype.
	* src/qemu/qemu_audit.c (qemuDomainCgroupAudit): Implement it.
	* src/qemu/qemu_driver.c (qemudDomainSaveFlag): Add audit.
	* src/qemu/qemu_cgroup.c (qemuSetupDiskPathAllow)
	(qemuSetupChardevCgroup, qemuSetupHostUsbDeviceCgroup)
	(qemuSetupCgroup, qemuTeardownDiskPathDeny): Likewise.

	audit: prepare qemu for listing vm in cgroup audits
	* src/qemu/qemu_cgroup.h (struct qemuCgroupData): New helper type.
	(qemuSetupDiskPathAllow, qemuSetupChardevCgroup)
	(qemuTeardownDiskPathDeny): Drop unneeded prototypes.
	(qemuSetupDiskCgroup, qemuTeardownDiskCgroup): Adjust prototype.
	* src/qemu/qemu_cgroup.c
	(qemuSetupDiskPathAllow, qemuSetupChardevCgroup)
	(qemuTeardownDiskPathDeny): Mark static and use new type.
	(qemuSetupHostUsbDeviceCgroup): Use new type.
	(qemuSetupDiskCgroup): Alter signature.
	(qemuSetupCgroup): Adjust caller.
	* src/qemu/qemu_hotplug.c (qemuDomainAttachHostUsbDevice)
	(qemuDomainDetachPciDiskDevice, qemuDomainDetachSCSIDiskDevice):
	Likewise.
	* src/qemu/qemu_driver.c (qemudDomainAttachDevice)
	(qemuDomainUpdateDeviceFlags): Likewise.

	cgroup: determine when skipping non-devices
	* src/util/cgroup.c (virCgroupAllowDevicePath)
	(virCgroupDenyDevicePath): Don't fail with EINVAL for
	non-devices.
	* src/qemu/qemu_driver.c (qemudDomainSaveFlag): Update caller.
	* src/qemu/qemu_cgroup.c (qemuSetupDiskPathAllow)
	(qemuSetupChardevCgroup, qemuSetupHostUsbDeviceCgroup)
	(qemuSetupCgroup, qemuTeardownDiskPathDeny): Likewise.

2011-02-25  Eric Blake  <eblake@redhat.com>

	virExec: avoid uninitialized memory usage
	valgrind warns:

	==21079== Syscall param rt_sigaction(act->sa_mask) points to uninitialised byte(s)
	==21079==    at 0x329840F63E: __libc_sigaction (sigaction.c:67)
	==21079==    by 0x4E5A8E7: __virExec (util.c:661)

	Regression introduced in commit ab07533e.  Technically, sa_mask
	shouldn't affect operation if sa_flags selects sa_handler, and
	sa_handler selects SIG_IGN, but better safe than sorry.

	* src/util/util.c (__virExec): Supply missing sigemptyset.

2011-02-24  Daniel P. Berrange  <berrange@redhat.com>

	Allow 32-on-64 execution for LXC guests
	Using the 'personality(2)' system call, we can make a container
	on an x86_64 host appear to be i686. Likewise for most other
	Linux 64bit arches.

	* src/lxc/lxc_conf.c: Fill in 32bit capabilities for x86_64 hosts
	* src/lxc/lxc_container.h, src/lxc/lxc_container.c: Add API to
	  check if an arch has a 32bit alternative
	* src/lxc/lxc_controller.c: Set the process personality when
	  starting guest

2011-02-24  Daniel P. Berrange  <berrange@redhat.com>

	Put <stdbool.h> into internal.h so it is available everywhere
	Remove the <stdbool.h> header from all source files / headers
	and just put it into internal.h

	* src/internal.h: Add <stdbool.h>

2011-02-24  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Switch over command line capabilities to virBitmap
	This is done for two reasons:
	- we are getting very close to 64 flags which is the maximum we can use
	  with unsigned long long
	- by using LL constants in enum we already violates C99 constraint that
	  enum values have to fit into int

	qemu: Rename qemud\?CmdFlags to qemuCaps
	The new name complies more with the fact that it contains a set of
	qemuCapsFlags.

	qemu: Use helper functions for handling cmd line capabilities
	Three new functions (qemuCapsSet, qemuCapsClear, and qemuCapsGet) were
	introduced replacing direct bit operations.

	qemu: Rename QEMUD_CMD_FLAG_* to QEMU_CAPS_*
	The new names comply more with the fact that they are all members of
	enum qemuCapsFlags.

	util: Add API for converting virBitmap into printable string

	util: Use unsigned long as a base type for virBitmap

2011-02-23  Daniel P. Berrange  <berrange@redhat.com>

	Expose name + UUID to LXC containers via env variables
	When spawning 'init' in the container, set

	  LIBVIRT_LXC_UUID=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
	  LIBVIRT_LXC_NAME=YYYYYYYYYYYY

	to allow guest software to detect & identify that they
	are in a container

	* src/lxc/lxc_container.c: Set LIBVIRT_LXC_UUID and
	  LIBVIRT_LXC_NAME env vars

2011-02-23  Daniel P. Berrange  <berrange@redhat.com>

	Fix discard of expected errors
	In a couple of commands virsh catches & ignores errors, but fails
	to reset last_error. Thus the error is ignored, but still reported
	to the user.

	* tools/virsh.c: Reset last_error if ignoring an error

2011-02-23  Daniel P. Berrange  <berrange@redhat.com>

	Fix off-by-1 in virFileAbsPath.
	The virFileAbsPath was not taking into account the '/' directory
	separator when allocating memory for combining cwd + path. Convert
	to use virAsprintf to avoid this type of bug completely.

	* src/util/util.c: Convert virFileAbsPath to use virAsprintf

2011-02-23  Daniel P. Berrange  <berrange@redhat.com>

	Fix group/mode for /dev/pts inside LXC container
	Normal practice for /dev/pts is to have it mode=620,gid=5
	but LXC was leaving mode=000,gid=0 preventing unprivilegd
	users in the guest use of PTYs

	* src/lxc/lxc_controller.c: Fix /dev/pts setup

2011-02-23  Eric Blake  <eblake@redhat.com>

	security: avoid memory leak
	Leak introduced in commit d6623003.

	* src/qemu/qemu_driver.c (qemuSecurityInit): Avoid leak on failure.
	* src/security/security_stack.c (virSecurityStackClose): Avoid
	leaking component drivers.

2011-02-22  Roopa Prabhu  <roprabhu@cisco.com>

	802.1Qbh: Delay IFF_UP'ing interface until migration final stage
	Current code does an IFF_UP on a 8021Qbh interface immediately after a port
	profile set. This is ok in most cases except when its the migration prepare
	stage. During migration we want to postpone IFF_UP'ing the interface on the
	destination host until the source host has disassociated the interface.
	This patch moves IFF_UP of the interface to the final stage of migration.
	The motivation for this change is to postpone any addr registrations on the
	destination host until the source host has done the addr deregistrations.

	While at it, for symmetry with associate move ifDown of a 8021Qbh interface
	to before disassociate

2011-02-22  Osier Yang  <jyang@redhat.com>

	storage: make debug log more useful
	"__func__" is useless there, as VIR_DEBUG will print the function
	name.

	* src/storage/storage_backend_mpath.c

2011-02-22  Osier Yang  <jyang@redhat.com>

	virsh: replace vshPrint with vshPrintExtra for snapshot list Otherwise extra information will be printed even if "--quiet" is specified.
	* tools/virsh.c

2011-02-22  Wen Congyang  <wency@cn.fujitsu.com>

	check device-mapper when building with mpath or disk storage driver
	Currently, we need virIsDevMapperDevice() when we build libvirt with
	disk or mpath storage drivers.  So we should check device-mapper-devel
	when we build with disk storage driver but without mpath storage
	driver.

2011-02-22  Eric Blake  <eblake@redhat.com>

	build: add dependency on gnutls-utils
	* libvirt.spec.in (Requires): Add gnutls-utils, for virt-pki-validate.
	Suggested by Daniel P. Berrange.

2011-02-22  Markus Groß  <gross@univention.de>

	Renamed functions in xenxs

	Moved XM formatting functions to xenxs

	Moved XM parsing functions to xenxs

	Moved SEXPR formatting functions to xenxs

	Moved SEXPR parsing functions to xenxs

	Moved some SEXPR functions from xen-unified

	Moved SEXPR unit to utils

2011-02-22  Wen Congyang  <wency@cn.fujitsu.com>

	protect the scsi controller to be deleted when it is in use
	Steps to reproduce this bug:
	1. virsh attach-disk domain --source imagefile --target sdb --sourcetype file --driver qemu --subdriver raw
	2. virsh detach-device controller.xml # remove scsi controller 0
	3. virsh detach-disk domain sdb
	   error: Failed to detach disk
	   error: operation failed: detaching scsi0-0-1 device failed: Device 'scsi0-0-1' not found

	I think we should not detach a controller when it is used by some other device.

2011-02-22  Eric Blake  <eblake@redhat.com>

	maint: fix grammar in error message
	* python/tests/create.py: Use correct wording.

2011-02-22  Dan Kenigsberg  <danken@redhat.com>

	virt-*-validate.in: quote all variable references
	Alas, the shell is not a real programming language.

	Patch generated by manual confirmation of vim's
	s/[^"]\@<=\$\S\+\s\@=/"&"/gc
	and
	s/\(echo \)\@<=[^"].*\$.*$/"&"/c matches.

	This patch generate a lot of noise and carries little benefits, as
	I do not really expect $PKI to contain spaces or backticks. I'm just
	fuming, and would not really mind if this patch is ignored

2011-02-22  Dan Kenigsberg  <danken@redhat.com>

	virt-pki-validate: behave when CERTTOOL is missing

2011-02-22  Eric Blake  <eblake@redhat.com>

	autobuild.sh: use VPATH build
	Try to avoid future regressions on the VPATH front.

	* autobuild.sh: Uncomment VPATH use.
	* .gitignore: Exclude build directory.

2011-02-22  Eric Blake  <eblake@redhat.com>

	maint: fix 'make dist' in VPATH build
	A diff of 'make dist' from in-tree vs. a VPATH build showed
	that we were missing docs/api_extension/*.patch files, but
	shipping other files that we didn't need.

	* bootstrap.conf (gnulib_extra_files): Don't distribute files we
	don't care about.
	* docs/Makefile.am (patches): Perform wildcard correctly.

2011-02-22  Eric Blake  <eblake@redhat.com>

	build: don't require pod2man for tarball builds
	Right now, 'man libvirtd' includes information that depends on
	configure results, so it must be generated on the fly and live
	in $(builddir); however, requiring pod2man on all end user
	machines is overkill.  Meanwhile, 'man virsh' doesn't mention
	any configure results, so it can be built at 'make dist' time.
	If that situation changes in the future, we can generate virsh.1
	in the same way that we generate libvirtd.8.

	* daemon/Makefile.am (libvirtd.8.in): New rule, to run pod2man in
	advance of distribution.
	(libvirtd.8): Use only sed from tarball.
	(EXTRA_DIST): Ship new file.
	(libvirtd.pod): Delete unused rule.
	(man8_MANS): Let automake know which section to use.
	(CLEANFILES, MAINTAINERCLEANFILES): Adjust to new files.
	* tools/Makefile.am (dist_man1_MANS): Distribute pre-built man
	pages, fine since they don't require any substitution.
	(virt-xml-validate.1, virt-pki-validate.1): Change input source.
	(virsh.1): Build into srcdir.
	(CLEANFILES, MAINTAINERCLEANFILES): Adjust to new build style.
	* daemon/.gitignore: Update.
	Reported by Diego Elio Pettenò.

2011-02-21  Eric Blake  <eblake@redhat.com>

	maint: kill all remaining uses of old DEBUG macro
	Done mechanically with:
	$ git grep -l '\bDEBUG0\? *(' | xargs -L1 sed -i 's/\bDEBUG0\? *(/VIR_&/'

	followed by manual deletion of qemudDebug in daemon/libvirtd.c, along
	with a single 'make syntax-check' fallout in the same file, and the
	actual deletion in src/util/logging.h.

	* src/util/logging.h (DEBUG, DEBUG0): Delete.
	* daemon/libvirtd.h (qemudDebug): Likewise.
	* global: Change remaining clients over to VIR_DEBUG counterpart.

2011-02-21  Eric Blake  <eblake@redhat.com>

	hash: make virHashFree more free-like
	Two-argument free functions are uncommon; match the style elsewhere
	by caching the callback at creation.

	* src/util/hash.h (virHashCreate, virHashFree): Move deallocator
	argument to creation.
	* cfg.mk (useless_free_options): Add virHashFree.
	* src/util/hash.c (_virHashTable): Track deallocator.
	(virHashCreate, virHashFree): Update to new signature.
	* src/conf/domain_conf.c (virDomainObjListDeinit)
	(virDomainObjListInit, virDomainDiskDefForeachPath)
	(virDomainSnapshotObjListDeinit, virDomainSnapshotObjListInit):
	Update callers.
	* src/conf/nwfilter_params.c (virNWFilterHashTableFree)
	(virNWFilterHashTableCreate): Likewise.
	* src/conf/nwfilter_conf.c (virNWFilterTriggerVMFilterRebuild):
	Likewise.
	* src/cpu/cpu_generic.c (genericHashFeatures, genericBaseline):
	Likewise.
	* src/xen/xm_internal.c (xenXMOpen, xenXMClose): Likewise.
	* src/nwfilter/nwfilter_learnipaddr.c (virNWFilterLearnInit)
	(virNWFilterLearnShutdown): Likewise.
	* src/qemu/qemu_command.c (qemuDomainPCIAddressSetCreate)
	(qemuDomainPCIAddressSetFree): Likewise.
	* src/qemu/qemu_process.c (qemuProcessWaitForMonitor): Likewise.

2011-02-21  Jiri Denemark  <jdenemar@redhat.com>

	build: Fix API docs generation in VPATH build
	XSLT allows for two ways of generating the output of transformation.
	Either implicit, which xsltproc prints to stdout and can be redirected
	to a file using -o file. Or explicit, which means the stylesheet
	contains <xsl:document> element which specifies where the output should
	be saved. This can be used for generating more files by a single run of
	xsltproc and -o directory/ can change the directory where the output
	files will be stored.

	devhelp.xsl is special in that it combines both options in one
	stylesheet, which doesn't work well with -o:

	xsltproc --nonet -o ./devhelp/ ./devhelp/devhelp.xsl ./libvirt-api.xml

	Outputs 4 *.html files into ./devhelp but then tries to write to
	./devhelp/ as a file (hence the I/O error) rather than writing output to
	the fifth file devhelp/libvirt.devhelp.

	This patch modifies devhelp.xsl so that all files are generated using
	<xsl:document> element and -o directory/ can be used to override output
	directory where those files are saved.

2011-02-21  Daniel P. Berrange  <berrange@redhat.com>

	Remove all object hashtable caches from virConnectPtr
	The virConnectPtr struct will cache instances of all other
	objects. APIs like virDomainLookupByUUID will return a
	cached object, so if you do virDomainLookupByUUID twice in
	a row, you'll get the same exact virDomainPtr instance.

	This does not have any performance benefit, since the actual
	logic in virDomainLookupByUUID (and other APIs returning
	virDomainPtr, etc instances) is not short-circuited. All
	it does is to ensure there is only one single virDomainPtr
	in existance for any given UUID.

	The caching has a number of downsides though, all relating
	to stale data. If APIs aren't careful to always overwrite
	the 'id' field in virDomainPtr it may become out of data.
	Likewise for the name field, if a guest is renamed, or if
	a guest is deleted, and then a new one created with the
	same UUID but different name.

	This has been an ongoing, endless source of bugs for all
	applications using libvirt from languages with garbage
	collection, causing them to get virDomainPtr instances
	from long ago with stale data.

	The caching is also a waste of memory resources, since
	both applications, and language bindings often maintain
	their own hashtable caches of object instances.

	This patch removes all the hash table caching, so all
	APIs return brand new virDomainPtr (etc) object instances.

	* src/datatypes.h: Delete all hash tables.
	* src/datatypes.c: Remove all object caching code

2011-02-19  Stefan Berger  <stefanb@us.ibm.com>

	nwfilter: enable rejection of packets
	This patch adds the possibility to not just drop packets, but to also have them rejected where iptables at least sends an ICMP msg back to the originator. On ebtables this again maps into dropping packets since rejecting is not supported.

	I am adding 'since 0.8.9' to the docs assuming this will be the next version of libvirt.

2011-02-19  Guido Günther  <agx@sigxcpu.org>

	Drop empty argument from dnsmasq call
	since dnsmasq >= 2.56 now bails out with empty arguments. See
	    http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=613944
	for the Debian bug and
	    http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=589885
	for the upstream reasoning.

2011-02-19  Eric Blake  <eblake@redhat.com>

	build: fix broken mingw cross-compilation
	Two regressions:
	Commit df1011ca broke builds for systems that lack devmapper
	(non-Linux, as well as Linux with ./autogen.sh --without-libvirtd
	and without the libraries present).
	Commit ce6fd650 broke cross-compilation, due to a gnulib bug.

	* .gnulib: Update to latest, for cross-compilation fix.
	* src/util/util.c (virIsDevMapperDevice): Provide stub for
	platforms not using storage driver.
	* configure.ac (devmapper): Arrange to define HAVE_LIBDEVMAPPER_H.
	devmapper issue reported by Wen Congyang.

2011-02-19  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Ignore malformed host UUID from BIOS
	Etienne Gosset reported that libvirt fails to connect to his ESX
	server because it failed to parse its malformed host UUID, that
	contains an additional space and lacks one hexdigit in the last
	group:

	xxxxxxxx-xxxx-xxxx-xxxx- xxxxxxxxxxx

	Don't treat this as a fatal error, just ignore it.

2011-02-19  Michal Privoznik  <mprivozn@redhat.com>

	virsh: freecell --all getting wrong NUMA nodes count
	Virsh freecell --all was not only getting wrong NUMA nodes count, but
	even the NUMA nodes IDs. They doesn't have to be continuous, as I've
	found out during testing this. Therefore a modification of
	nodeGetCellsFreeMemory() error message.

2011-02-19  Eric Blake  <eblake@redhat.com>

	build: speed up non-maintainer builds
	* configure.ac (gl_ASSERT_NO_GNULIB_POSIXCHECK): Use to reduce
	time spent in configure.

2011-02-18  Eric Blake  <eblake@redhat.com>

	build: recompute symbols after changing configure options
	$ ./configure
	...
	$ make
	...
	  GEN    libvirt.syms
	...
	$ ./configure --with-driver-modules
	...
	$ make
	...

	libvirt.syms doesn't get regenerated but it should as it should
	contain virDriverLoadModule now.

	* src/Makefile.am (libvirt.syms): Depend on configure changes.
	Reported by Matthias Bolte.

2011-02-18  Jiri Denemark  <jdenemar@redhat.com>

	maint: Expand tabs in python code
	Also cfg.mk is tweaked to force this for all future changes to *.py
	files.

2011-02-18  Osier Yang  <jyang@redhat.com>

	Requires gettext for client package
	libvirt-guests invokes functions in gettext.sh, so we need to
	require gettext package in spec file.

	Demo with the fix:
	% rpm -q gettext
	package gettext is not installed

	% rpm -ivh libvirt-client-0.8.8-1.fc14.x86_64.rpm
	error: Failed dependencies:
		gettext is needed by libvirt-client-0.8.8-1.fc14.x86_64

	* libvirt.spec.in

2011-02-18  Jim Fehlig  <jfehlig@novell.com>

	Do not add drive 'boot=on' param when a kernel is specified
	libvirt-tck was failing several domain tests [1] with qemu 0.14, which
	is now less tolerable of specifying 2 bootroms with the same boot index [2].

	Drop the 'boot=on' param if kernel has been specfied.

	[1] https://www.redhat.com/archives/libvir-list/2011-February/msg00559.html
	[2] http://lists.nongnu.org/archive/html/qemu-devel/2011-02/msg01892.html

2011-02-18  Christophe Fergeau  <teuf@gnome.org>

	remove duplicated call to reportOOMError

	remove space between function name and (
	There were several occurrences of an extra space inserted between
	a function name and the ( opening the argument list in
	datatypes.c. This is not consistent with the coding style used in
	the rest of this file so removing this extra space makes the
	code slightly more readable.

	don't check for NULL before calling virHashFree
	virHashFree follows the convention described in HACKING that
	XXXFree() functions can be called with a NULL argument.

	remove no longer needed calls to virReportOOMError
	Now that the virHash handling functions call virReportOOMError by
	themselves when needed, users of the virHash API no longer need to
	do it by themselves. Since users of the virHash API were not
	consistently calling virReportOOMError after memory failures from
	the virHash code, this has the added benefit of making OOM
	reporting from this code more consistent and reliable.

	factor common code in virHashAddEntry and virHashUpdateEntry
	The only difference between these 2 functions is that one errors
	out when the entry is already present while the other modifies
	the existing entry. Add an helper function with a boolean argument
	indicating whether existing entries should be updated or not, and
	use this helper in both functions.

	add hash table rebalancing in virHashUpdateEntry
	The code in virHashUpdateEntry and virHashAddEntry is really
	similar. However, the latter rebalances the hash table when
	one of its buckets contains too many elements while the former
	does not. Fix this discrepancy.

2011-02-18  Eric Blake  <eblake@redhat.com>

	hash: modernize debug code
	* src/util/hash.c (virHashGrow) [DEBUG_GROW]: Use modern logging.
	Reported by Christophe Fergeau.

2011-02-18  Eric Blake  <eblake@redhat.com>

	build: improve 'make install' for VPATH builds
	This still doesn't fix {html,devhelp}/libvirt-{libvirt-virterror}.html,
	but it's progress in the right direction.

	* docs/Makefile.am (%.html): Build into srcdir.

2011-02-18  Wen Congyang  <wency@cn.fujitsu.com>

	check more error info about whether drive_add failed
	When we attach a disk, but we specify a wrong format of disk image,
	qemu monitor command drive_add will fail, but libvirt does not detect
	this error.

2011-02-18  Eric Blake  <eblake@redhat.com>

	logging: make VIR_ERROR and friends preserve errno
	Followup to commit 17e19add, and would have prevented the bug
	independently fixed in commit 76c57a7c.

	* src/util/logging.c (virLogMessage): Preserve errno, since
	logging should be as unintrusive as possible.

2011-02-18  Eric Blake  <eblake@redhat.com>

	maint: avoid 'make syntax-check' from tarball
	* .gnulib: update to latest gnulib for maint.mk fixes

2011-02-18  Laine Stump  <laine@laine.org>

	Give each virtual network bridge its own fixed MAC address
	This fixes https://bugzilla.redhat.com/show_bug.cgi?id=609463

	The problem was that, since a bridge always acquires the MAC address
	of the connected interface with the numerically lowest MAC, as guests
	are started and stopped, it was possible for the MAC address to change
	over time, and this change in the network was being detected by
	Windows 7 (it sees the MAC of the default route change), so on each
	reboot it would bring up a dialog box asking about this "new network".

	The solution is to create a dummy tap interface with a MAC guaranteed
	to be lower than any guest interface's MAC, and attach that tap to the
	bridge as soon as it's created. Since all guest MAC addresses start
	with 0xFE, we can just generate a MAC with the standard "0x52, 0x54,
	0" prefix, and it's guaranteed to always win (physical interfaces are
	never connected to these bridges, so we don't need to worry about
	competing numerically with them).

	Note that the dummy tap is never set to IFF_UP state - that's not
	necessary in order for the bridge to take its MAC, and not setting it
	to UP eliminates the clutter of having an (eg) "virbr0-nic" displayed
	in the output of the ifconfig command.

	I chose to not auto-generate the MAC address in the network XML
	parser, as there are likely to be consumers of that API that don't
	need or want to have a MAC address associated with the
	bridge.

	Instead, in bridge_driver.c when the network is being defined, if
	there is no MAC, one is generated. To account for virtual network
	configs that already exist when upgrading from an older version of
	libvirt, I've added a %post script to the specfile that searches for
	all network definitions in both the config directory
	(/etc/libvirt/qemu/networks) and the state directory
	(/var/lib/libvirt/network) that are missing a mac address, generates a
	random address, and adds it to the config (and a matching address to
	the state file, if there is one).

	docs/formatnetwork.html.in: document <mac address.../>
	docs/schemas/network.rng: add nac address to schema
	libvirt.spec.in: %post script to update existing networks
	src/conf/network_conf.[ch]: parse and format <mac address.../>
	src/libvirt_private.syms: export a couple private symbols we need
	src/network/bridge_driver.c:
	    auto-generate mac address when needed,
	    create dummy interface if mac address is present.
	tests/networkxml2xmlin/isolated-network.xml
	tests/networkxml2xmlin/routed-network.xml
	tests/networkxml2xmlout/isolated-network.xml
	tests/networkxml2xmlout/routed-network.xml: add mac address to some tests

2011-02-18  Laine Stump  <laine@laine.org>

	Allow brAddTap to create a tap device that is down
	An upcoming patch has a use for a tap device to be created that
	doesn't need to be actually put into the "up" state, and keeping it
	"down" keeps the output of ifconfig from being unnecessarily cluttered
	(ifconfig won't show down interfaces unless you add "-a").

	bridge.[ch]: add "up" as an arg to brAddTap()
	uml_conf.c, qemu_command.c: add "up" (set to "true") to brAddTap() call.

2011-02-18  Laine Stump  <laine@laine.org>

	Add txmode attribute to interface XML for virtio backend
	This is in response to:

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

	Explanation

	qemu's virtio-net-pci driver allows setting the algorithm used for tx
	packets to either "bh" or "timer". This is done by adding ",tx=bh" or
	",tx=timer" to the "-device virtio-net-pci" commandline option.

	'bh' stands for 'bottom half'; when this is set, packet tx is all done
	in an iothread in the bottom half of the driver. (In libvirt, this
	option is called the more descriptive "iothread".)

	'timer' means that tx work is done in qemu, and if there is more tx
	data than can be sent at the present time, a timer is set before qemu
	moves on to do other things; when the timer fires, another attempt is
	made to send more data. (libvirt retains the name "timer" for this
	option.)

	The resulting difference, according to the qemu developer who added
	the option is:

	    bh makes tx more asynchronous and reduces latency, but potentially
	    causes more processor bandwidth contention since the cpu doing the
	    tx isn't necessarily the cpu where the guest generated the
	    packets.

	Solution

	This patch provides a libvirt domain xml knob to change the option on
	the qemu commandline, by adding a new attribute "txmode" to the
	<driver> element that can be placed inside any <interface> element in
	a domain definition. It's use would be something like this:

	    <interface ...>
	      ...
	      <model type='virtio'/>
	      <driver txmode='iothread'/>
	      ...
	    </interface>

	I chose to put this setting as an attribute to <driver> rather than as
	a sub-element to <tune> because it is specific to the virtio-net
	driver, not something that is generally usable by all network drivers.
	(note that this is the same placement as the "driver name=..."
	attribute used to choose kernel vs. userland backend for the
	virtio-net driver.)

	Actually adding the tx=xxx option to the qemu commandline is only done
	if the version of qemu being used advertises it in the output of

	    qemu -device virtio-net-pci,?

	If a particular txmode is requested in the XML, and the option isn't
	listed in that help output, an UNSUPPORTED_CONFIG error is logged, and
	the domain fails to start.

2011-02-18  Laine Stump  <laine@laine.org>

	Restructure domain struct interface "driver" data for easier expansion
	When the <driver> element (and its "name" attribute) was added to the
	domain XML's interface element, a "backend" enum was simply added to
	the toplevel of the virDomainNetDef struct.

	Ignoring the naming inconsistency ("name" vs. "backend"), this is fine
	when there's only a single item contained in the driver element of the
	XML, but doesn't scale well as we add more attributes that apply to
	the backend of the virtio-net driver, or add attributes applicable to
	other drivers.

	This patch changes virDomainNetDef in two ways:

	1) Rename the item in the struct from "backend" to "name", so that
	   it's the same in the XML and in the struct, hopefully avoiding
	   confusion for someone unfamiliar with the function of the
	   attribute.

	2) Create a "driver" union within virDomainNetDef, and a "virtio"
	   struct in that struct, which contains the "name" enum value.

	3) Move around the virDomainNetParse and virDomainNetFormat functions
	   to allow for simple plugin of new attributes without disturbing
	   existing code. (you'll note that this results in a seemingly
	   redundant if() in the format function, but that will no longer be
	   the case as soon as a 2nd attribute is added).

	In the future, new attributes for the virtio driver backend can be
	added to the "virtio" struct, and any other network device backend that
	needs an attribute will have its own struct added to the "driver"
	union.

2011-02-17  Jiri Denemark  <jdenemar@redhat.com>

	build: Fix VPATH build
	Even VPATH make dist succeeds now

2011-02-17  Daniel P. Berrange  <berrange@redhat.com>

	Move all the QEMU migration code to a new file
	The introduction of the v3 migration protocol, along with
	support for migration cookies, will significantly expand
	the size of the migration code. Move it all to a separate
	file to make it more manageable

	The functions are not moved 100%. The API entry points
	remain in the main QEMU driver, but once the public
	virDomainPtr is resolved to the internal virDomainObjPtr,
	all following code is moved.

	This will allow the new v3 API entry points to call into the
	same shared internal migration functions

	* src/qemu/qemu_domain.c, src/qemu/qemu_domain.h: Add
	  qemuDomainFormatXML helper method
	* src/qemu/qemu_driver.c: Remove all migration code
	* src/qemu/qemu_migration.c, src/qemu/qemu_migration.h: Add
	  all migration code.

2011-02-17  Daniel P. Berrange  <berrange@redhat.com>

	Split all QEMU process mangement code into separate file
	Move the qemudStartVMDaemon and qemudShutdownVMDaemon
	methods into a separate file, renaming them to
	qemuProcessStart, qemuProcessStop. All helper methods
	called by these are also moved & renamed to match

	* src/Makefile.am: Add qemu_process.c/.h
	* src/qemu/qemu_command.c: Add qemuDomainAssignPCIAddresses
	* src/qemu/qemu_command.h: Add VNC port min/max
	* src/qemu/qemu_domain.c, src/qemu/qemu_domain.h: Add
	  domain event queue helpers
	* src/qemu/qemu_driver.c, src/qemu/qemu_driver.h: Remove
	  all QEMU process startup/shutdown functions
	* src/qemu/qemu_process.c, src/qemu/qemu_process.h: Add
	  all QEMU process startup/shutdown functions

2011-02-17  Osier Yang  <jyang@redhat.com>

	storage: Allow to delete device mapper disk partition
	The name convention of device mapper disk is different, and 'parted'
	can't be used to delete a device mapper disk partition. e.g.

	Name                 Path
	-----------------------------------------
	3600a0b80005ad1d7000093604cae912fp1 /dev/mapper/3600a0b80005ad1d7000093604cae912fp1

	Error: Expecting a partition number.

	This patch introduces 'dmsetup' to fix it.

	Changes:
	  - New function "virIsDevMapperDevice" in "src/utils/utils.c"
	  - remove "is_dm_device" in "src/storage/parthelper.c", use
	    "virIsDevMapperDevice" instead.
	  - Requires "device-mapper" for 'with-storage-disk" in "libvirt.spec.in"
	  - Check "dmsetup" in 'configure.ac' for "with-storage-disk"
	  - Changes on "src/Makefile.am" to link against libdevmapper
	  - New entry for "virIsDevMapperDevice" in "src/libvirt_private.syms"

	Changes from v1 to v3:
	  - s/virIsDeviceMapperDevice/virIsDevMapperDevice/g
	  - replace "virRun" with "virCommand"
	  - sort the list of util functions in "libvirt_private.syms"
	  - ATTRIBUTE_NONNULL(1) for virIsDevMapperDevice declaration.

	e.g.

	Name                 Path
	-----------------------------------------
	3600a0b80005ad1d7000093604cae912fp1 /dev/mapper/3600a0b80005ad1d7000093604cae912fp1

	Vol /dev/mapper/3600a0b80005ad1d7000093604cae912fp1 deleted

	Name                 Path
	-----------------------------------------

2011-02-17  Daniel Veillard  <veillard@redhat.com>

	Release of libvirt-0.8.8
	* configure.ac docs/news.html.in libvirt.spec.in: bump version and add docs
	* po/*.po*: updated Gujarati, Polish and Dutch localisations and regenerated

2011-02-17  Osier Yang  <jyang@redhat.com>

	qemu: Error prompt when saving a shutoff domain
	"qemudDomainSaveFlag" goto wrong label "endjob", which will cause
	error when security manager trying to restore label (regression).

	As it's more reasonable to check if vm is shutoff immediately, and
	return right away if it is, remove the checking in "qemudDomainSaveFlag",
	and add checking in "qemudDomainSave".

	* src/qemu/qemu_driver.c

2011-02-17  Eric Blake  <eblake@redhat.com>

	maint: delete unused 'make install' step
	Libxml2-Logo-90x34.gif was removed from the repository in Sep 2009
	(commit d6d528c) because our docs no longer reference it.

	* docs/Makefile.am (install-data-local): Don't install missing file.

2011-02-16  Eric Blake  <eblake@redhat.com>

	cgroup: preserve correct errno on failure
	* src/util/cgroup.c (virCgroupSetValueStr, virCgroupGetValueStr)
	(virCgroupRemoveRecursively): VIR_DEBUG can clobber errno.
	(virCgroupRemove): Use VIR_DEBUG rather than DEBUG.

2011-02-16  Zdenek Styblik  <stybla@turnovfree.net>

	Update czech localization

2011-02-16  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Fix command line generation with faked host CPU
	The code expected that host CPU architecture matches the architecture on
	which libvirt runs. This is normally true but not in tests, where host
	CPU is faked to produce consistent results.

	tests: Fake host capabilities properly
	Since we fake host CPU we should also fake host arch instead of taking
	the real architecture tests are running on.

2011-02-16  Eric Blake  <eblake@redhat.com>

	docs: fix typos
	* docs/drvopenvz.html.in: Spell administrator correctly.
	* docs/drvuml.html.in: Likewise.
	* src/qemu/qemu.conf: Likewise.  Fix other typos, too.

2011-02-16  Matthias Bolte  <matthias.bolte@googlemail.com>

	Avoid empty strings when --with-packager(-version) is not specified
	Make with_packager and with_packager_version default to "no". This way
	--without-packager-version (as shorthand for --with-packager(-version)=no)
	works correctly too.

	Prior to this patch libvirt outputs a line like this when
	--with-packager(-version) was not specified

	# ./daemon/libvirtd
	14:11:15.018: 31796: info : libvirt version: 0.8.8, package:  ()

	Now the unspecified parts are correctly omitted.

	Reported by Osier Yang.

2011-02-16  Eric Blake  <eblake@redhat.com>

	build: address clang reports about virCommand
	clang had 5 reports against virCommand; three were false positives
	(a NULL deref in ProcessIO solved by sa_assert, and two uninitialized
	memory operations solved by adding an initializer), but two were real.

	* src/util/command.c (virCommandProcessIO): Fix real bug of
	possible NULL dereference.  Teach clang that buf is never NULL.
	(virCommandRun): Teach clang that infd is only ever accessed when
	initialized.

2011-02-16  Eric Blake  <eblake@redhat.com>

	build: silence some clang warnings
	* tools/virsh.c (cmdHelp): Kill dead variables.

	qemu: don't mask real error with oom report
	* src/qemu/qemu_command.c (qemuBuildCommandLine): Don't report oom
	after qemuBuildControllerDevStr, which reported its own errors.

2011-02-16  Eric Blake  <eblake@redhat.com>

	qemu: avoid NULL derefs
	The processWatchdogEvent fix is real, although it can only trigger
	on OOM, since bad things happen if doCoreDump is called with a NULL
	pathname argument.  The other fixes silence clang, but aren't a real
	bug because virReportErrorHelper tolerates a NULL format string even
	though *printf does not.

	* src/qemu/qemu_driver.c (processWatchdogEvent): Exit on OOM.
	(qemuDomainIsActive, qemuDomainIsPersistent, qemuDomainIsUpdated):
	Provide valid message.

2011-02-16  Eric Blake  <eblake@redhat.com>

	virDomainMemoryStats: avoid null dereference
	* src/libvirt.c (virDomainMemoryStats): Check domain before flags.

2011-02-15  Justin Clift  <jclift@redhat.com>

	docs: added link for nimbus to apps page

2011-02-15  Daniel P. Berrange  <berrange@redhat.com>

	Fix leak of mutex attributes in POSIX threads impl
	* src/util/threads-pthread.c: Fix mutex leak

2011-02-15  Daniel P. Berrange  <berrange@redhat.com>

	Fix leak in SCSI storage backend
	The SCSI storage backend leaks a string containing the pathname
	for each block device it discovers

	* src/storage/storage_backend_scsi.c: Free the device name

2011-02-15  Matthias Bolte  <matthias.bolte@googlemail.com>

	Output commandline on status != 0 in virCommandWait
	This helps identifying which command exited with status != 0.

2011-02-15  Christophe Fergeau  <teuf@gnome.org>

	add missing error handling to virGetDomain
	When creating the virDomain::snapshots hash table, virGetDomain
	wasn't checking if the creation was successful. This would then
	lead to failures in the vir*DomainSnapshot functions. Better to
	report this error early and make virGetDomain fail if the
	snapshots hash couldn't be created.
	* src/datatypes.c: report failure to make a hash table

2011-02-15  Christophe Fergeau  <teuf@gnome.org>

	call virReportOOMError when appropriate in hash.c
	A couple of allocation were not calling virReportOOMError on allocation
	errors

	* src/util/hash.c: add the needed call in virHashCreate and
	  virHashAddOrUpdateEntry

2011-02-15  Osier Yang  <jyang@redhat.com>

	storage: Create enough volumes for mpath pool
	"virStorageBackendCreateVols":
	  "names->next" serves as condition expression for "do...while",
	however, "names" was shifted before, it then results in one less
	loop, and thus, one less volume will be created for mpath pool,
	the patch is to fix it.

	* src/storage/storage_backend_mpath.c

2011-02-15  Eric Blake  <eblake@redhat.com>

	maint: kill dead assignments
	* src/network/bridge_driver.c (networkStartNetworkDaemon): Delete
	unused assignments.

	qemu: avoid NULL deref on error
	* src/qemu/qemu_command.c (qemuParseCommandLineDisk): Report error
	before cleaning def.

2011-02-15  Eric Blake  <eblake@redhat.com>

	build: silence false positive clang report
	clang complained that STREQ(group->controllers[i].mountPoint,...)  was
	a NULL dereference when i==VIR_CGROUP_CONTROLLER_CPUSET, because it
	assumes the worst about virCgroupPathOfController.  Marking the
	argument const doesn't yet have an effect, per this clang bug:
	http://llvm.org/bugs/show_bug.cgi?id=7758

	So, we use sa_assert, which was designed to shut up false positives
	from tools like clang.

	* src/util/cgroup.c (virCgroupMakeGroup): Teach clang that there
	is no NULL dereference.

2011-02-15  Eric Blake  <eblake@redhat.com>

	qemu: ignore failure of qemu -M ? on older qemu
	https://bugzilla.redhat.com/show_bug.cgi?id=676563

	Regression introduced in commit 2211518.

	* src/qemu/qemu_capabilities.c (qemuCapsProbeMachineTypes): Allow
	non-zero exit status.

2011-02-15  Eric Blake  <eblake@redhat.com>

	xml: avoid compiler warning
	Detected by clang.

	* src/util/xml.c (virXPathStringLimit): Use %zd, not obsolete %Zd.

2011-02-15  Stefan Berger  <stefanb@us.ibm.com>

	nwfilter: reorder match extensions relative to state match
	This patch reorders the connlimit and comment match extensions relative to the state match (-m state); connlimit being most useful if found after a -m state --state NEW and not before it.

2011-02-15  Jiri Denemark  <jdenemar@redhat.com>

	conf: Fix XML generation for smartcards
	When formatting XML for smartcard device with mode=host, libvirt
	generates invalid XML if the device has address info associated:

	<smartcard mode='host' <address type='ccid' controller='0' slot='1'/>

2011-02-15  Daniel P. Berrange  <berrange@redhat.com>

	Fix cleanup on VM state after failed QEMU startup
	Commit 9962e406c664ed5521f5aca500c860a331cb3979 introduced a
	problem where if the VM failed to startup, it would not be
	correctly cleaned up. Amongst other things the SELinux
	security label would not be removed, which prevents the VM
	from ever starting again.

	The virDomainIsActive() check at the start of qemudShutdownVMDaemon
	checks for vm->def->id not being -1. By moving the assignment of the
	VM id to the start of qemudStartVMDaemon, we can ensure cleanup will
	occur on failure

	* src/qemu/qemu_driver.c: Move initialization of 'vm->def->id'
	  so that qemudShutdownVMDaemon() will process the shutdown

2011-02-14  Jiri Denemark  <jdenemar@redhat.com>

	libvirt-qemu: Fix enum type declaration

2011-02-14  Christophe Fergeau  <teuf@gnome.org>

	fix OOM handling in hash routines
	* src/util/hash.c: virHashAddEntry and virHashUpdateEntry were missing NULL
	  checks on strdup
	* AUTHORS: add Christophe Fergeau

2011-02-13  Matthias Bolte  <matthias.bolte@googlemail.com>

	Update src/README
	Add missing subdirectories.

2011-02-12  Eric Blake  <eblake@redhat.com>

	virsh: avoid mingw compiler warnings
	Compilation on mingw was warning about %lld use in fprintf, and
	in the gnulib strptime module about dead labels.

	* tools/virsh.c (vshPrint): Change redirect.
	(vshPrintExtra): Allow use within vshPrint.  Avoid fprintf on
	arbitrary formats, since we aren't using gnulib module; instead,
	use virVasprintf to pre-format.
	(vshError): Likewise.
	* .gnulib: Update to latest, for mingw strptime warning fix.
	Reported by Matthias Bolte.

2011-02-12  Eric Blake  <eblake@redhat.com>

	build: avoid problems with autogen.sh runs from tarball
	Introduced by commit fac97c65c distributing cfg.mk, which
	previously could blindly assume it was in a git checkout.

	* cfg.mk (_update_required): Also check for .git.
	* autogen.sh: Don't run bootstrap from a tarball.
	Reported by Daniel Veillard.

2011-02-12  Matthias Bolte  <matthias.bolte@googlemail.com>

	docs: Distribute XSLT files to generate HACKING

	qemu: Report a more informative error for missing cgroup controllers
	Also use VIR_ERR_OPERATION_INVALID instead of VIR_ERR_NO_SUPPORT, as
	the operation could succeed when the cgroup controller was mounted.

2011-02-12  Osier Yang  <jyang@redhat.com>

	xen: Prevent updating device when attaching a device
	When attaching a device that already exists, xend driver updates
	the device with "device_configure", it causes problems (e.g. for
	disk device, 'device_configure' only can be used to update device
	like CDROM), on the other hand, we provide additional API
	(virDomainUpdateDevice) to update device, this fix is to raise up
	errors instead of updating the existed device which is not CDROM
	device.

	Changes from v1 to v2:
	  - allow to update CDROM

	* src/xen/xend_internal.c

2011-02-12  Eric Blake  <eblake@redhat.com>

	build: fix cygwin strerror_r failure
	Building the 0.8.8 release candidate on cygwin produced this compiler
	warning, which is indicative of catastrophic failure on any attempt to
	print an error message with errno turned to a string:

	  CC       strerror_r.lo
	strerror_r.c: In function 'rpl_strerror_r':
	strerror_r.c:67: warning: assignment makes integer from pointer without a cast

	This has been fixed in gnulib.

	* .gnulib: Update to latest, for strerror_r fix.
	* src/util/memory.c (includes): Satisfy 'make syntax-check'.

2011-02-12  Philipp Hahn  <hahn@univention.de>

	qemu: Fix escape_monitor(escape_shell(command))
	Suspending a VM which contains shell meta characters doesn't work with
	libvirt-0.8.7:
	/var/log/libvirt/qemu/andreas_231-ne\ doch\ nicht.log:
	  sh: -c: line 0: syntax error near unexpected token `doch'
	  sh: -c: line 0: `cat | { dd bs=4096 seek=1 if=/dev/null && dd bs=1048576; }

	Although target="andreas_231-ne doch nicht" contains shell meta
	characters (here: blanks), they are not properly escaped by
	src/qemu/qemu_monitor_{json,text}.c#qemuMonitor{JSON,Text}MigrateToFile()

	First, the filename needs to be properly escaped for the shell, than
	this command line has to be properly escaped for qemu again.

	For this to work, remove the old qemuMonitorEscapeArg() wrapper, rename
	qemuMonitorEscape() to it removing the handling for shell=TRUE, and
	implement a new qemuMonitorEscapeShell() returning strings using single
	quotes.

	Using double quotes or escaping special shell characters with backslashes
	would also be possible, but the set of special characters heavily
	depends on the concrete shell (dsh, bash, zsh) and its setting (history
	expansion, interactive use, ...)

2011-02-11  Daniel P. Berrange  <berrange@redhat.com>

	Imprint all logs with version + package build information
	The logging functions are enhanced so that immediately prior to
	the first log message being printed to any output channel, the
	libvirt package version will be printed.

	eg

	 $ LIBVIRT_DEBUG=1 virsh
	 18:13:28.013: 17536: info : libvirt version: 0.8.7
	 18:13:28.013: 17536: debug : virInitialize:361 : register drivers
	 ...

	The 'configure' script gains two new arguments which can be
	used as

	   --with-packager="Fedora Project, x86-01.phx2.fedoraproject.org, 01-27-2011-18:00:10"
	   --with-packager-version="1.fc14"

	to allow distros to append a custom string with package specific
	data.

	The RPM specfile is modified so that it appends the RPM version,
	the build host, the build date and the packager name.

	eg

	 $ LIBVIRT_DEBUG=1 virsh
	 18:14:52.086: 17551: info : libvirt version: 0.8.7, package: 1.fc13 (Fedora Project, x86-01.phx2.fedoraproject.org, 01-27-2011-18:00:10)
	 18:14:52.086: 17551: debug : virInitialize:361 : register drivers

	Thus when distro packagers receive bug reports they can clearly
	see what version was in use, even if the bug reporter mistakenly
	or intentionally lies about version/builds

	* src/util/logging.c: Output version data prior to first log message
	* libvirt.spec.in: Include RPM release, date, hostname & packager
	* configure.ac: Add --with-packager & --with-packager-version args

2011-02-11  Wen Congyang  <wency@cn.fujitsu.com>

	qemu: fix attach-interface regression
	QEMUD_CMD_FLAG_PCI_MULTIBUS should be set in the function
	qemuCapsExtractVersionInfo()

	The flag QEMUD_CMD_FLAG_PCI_MULTIBUS is used in the function
	qemuBuildDeviceAddressStr(). All callers get qemuCmdFlags
	by the function qemuCapsExtractVersionInfo() except that
	testCompareXMLToArgvFiles() in qemuxml2argvtest.c.

	So we should set QEMUD_CMD_FLAG_PCI_MULTIBUS in the function
	qemuCapsExtractVersionInfo() instead of qemuBuildCommandLine()
	because the function qemuBuildCommandLine() does not be called
	when we attach a pci device.

	tests: set QEMUD_CMD_FLAG_PCI_MULTIBUS in testCompareXMLToArgvFiles()

	set QEMUD_CMD_FLAG_PCI_MULTIBUS before calling qemuBuildCommandLine()
	as the flags is not set by qemuCapsExtractVersionInfo().

2011-02-10  Daniel P. Berrange  <berrange@redhat.com>

	Avoid pthread_sigmask on Win32 platforms
	Win32 doesn't have a concept of signal masks so disable that
	code. It is unclear how SIGINT is delivered (if at all) on
	Win32, so this might further work to provide an alternative
	to pthread_sigmask

	* tools/virsh.c: Avoid pthread_sigmask on Win32

2011-02-10  Daniel P. Berrange  <berrange@redhat.com>

	Reduce log level when cgroups aren't mounted
	Quite a few hosts don't have cgroups mounted and so see warnings
	from libvirt logged, which then cause bug reports, etc. Reduce
	the log level to INFO so they're not visible by default

	* src/qemu/qemu_driver.c: Reduce log level for cgroups

2011-02-10  Daniel P. Berrange  <berrange@redhat.com>

	Avoid warnings from nwfilter driver when run non-root
	When run non-root the nwfilter driver logs error messages about
	being unable to find iptables/ebtables commands (they are in
	/sbin which isn't in $PATH). The nwfilter driver can't ever work
	as non-root, so simply skip it entirely thus avoiding the error
	messages

	* src/conf/nwfilter_conf.h, src/nwfilter/nwfilter_driver.c,
	  src/nwfilter/nwfilter_gentech_driver.c,
	  src/nwfilter/nwfilter_gentech_driver.h: Pass 'bool privileged'
	  flag down to final driver impl
	* src/nwfilter/nwfilter_ebiptables_driver.c: Skip initialization
	  if not privileged

2011-02-10  Michal Privoznik  <mprivozn@redhat.com>

	Fix typo in parsing of spice 'auth' data
	A typo s/spice/vnc/ caused parsing of the spice 'auth' data
	to write into the wrong part of the struct, blowing away
	other unrelated data.

	* src/conf/domain_conf.c: s/vnc/spice/ in parsing spice auth

2011-02-10  Eric Blake  <eblake@redhat.com>

	build: distribute 'make syntax-check' tweaks
	* Makefile.am (EXTRA_DIST): Distribute cfg.mk.

2011-02-10  Michal Novotny  <minovotn@redhat.com>

	docs: Add information about libvirt-php new location

2011-02-10  Eric Blake  <eblake@redhat.com>

	maint: whitespace cleanup
	* .dir-locals.el (html-mode): Let emacs help out.
	* cfg.mk (sc_TAB_in_indentation): Check more files.
	* docs/internals/command.html.in: Fix offenders.
	* docs/formatdomain.html.in: Likewise.
	* docs/internals.html.in: Likewise.
	Reported by Jiri Denemark.

2011-02-10  Daniel P. Berrange  <berrange@redhat.com>

	Adjust some log levels in udev driver
	Most of te VIR_INFO calls in the udev driver are only relevant
	to developers so can switch to VIR_DEBUG. Failure to initialize
	libpciaccess though is a fatal error

	* src/node_device/node_device_udev.c: Adjust log levels

2011-02-10  Daniel P. Berrange  <berrange@redhat.com>

	Add check for binary existing in machine type probe
	When probing machine types if the QEMU binary does not exist
	we get a hard to diagnose error, due to the execve() in the
	child failing

	error: internal error Child process exited with status 1.

	Add an explicit check so that we get

	error: Cannot find QEMU binary /usr/libexec/qem3u-kvm: No such file or directory

	* src/qemu/qemu_capabilities.c: Check for QEMU binary

2011-02-10  Daniel P. Berrange  <berrange@redhat.com>

	Add a little more debugging for async events
	To make it easier to investigate problems with async event
	delivery, add two more debugging lines

	* daemon/remote.c: Debug when an event is queued for dispatch
	* src/remote/remote_driver.c: Debug when an event is received
	  for processing

2011-02-10  Daniel P. Berrange  <berrange@redhat.com>

	Move connection driver modules directory
	When built as modules, the connection drivers live
	in $LIBDIR/libvirt/drivers. Now we add lock manager
	drivers, we need to distinguish. So move the existing
	modules to 'connection-driver'

	* src/Makefile.am: Move module install dir
	* src/driver.c: Move module search dir

2011-02-10  Daniel P. Berrange  <berrange@redhat.com>

	Reset logging filter function when forking
	To ensure child processes will log all error messages, reset
	the logging filter function when forking

	* src/util/util.c: Reset log filter in fork

2011-02-10  Daniel P. Berrange  <berrange@redhat.com>

	Block SIGPIPE around virExec hook functions
	Some functionality run in virExec hooks may do I/O which
	can trigger SIGPIPE. Renable SIGPIPE blocking around the
	hook function

	* src/util/util.c: Block SIGPIPE around hooks

2011-02-10  Daniel P. Berrange  <berrange@redhat.com>

	Support SCSI RAID type & lower log level for unknown types
	The Linux kernel headers don't have a value for SCSI type 12,
	but HAL source code shows this to be a 'raid'. Add workaround
	for this type. Lower log level for unknown types since
	this is not a fatal error condition. Include the device sysfs
	path in the log output to allow identification of which device
	has problems.

	* src/node_device/node_device_udev.c: Add SCSI RAID type

2011-02-10  Daniel P. Berrange  <berrange@redhat.com>

	Only initialize/cleanup libpciaccess once
	libpciaccess has many bugs in its pci_system_init/cleanup
	functions that makes calling them multiple times unwise.
	eg it will double close() FDs, and leak other FDs.

	* src/node_device/node_device_udev.c: Only initialize
	  libpciaccess once

2011-02-09  Serge E. Hallyn  <serge.hallyn@canonical.com>

	Don't use CLONE_NEWUSER for now
	Until now, user namespaces have not done much, but (for that
	reason) have been innocuous to glob in with other CLONE_
	flags.  Upcoming userns development, however, will make tasks
	cloned with CLONE_NEWUSER far more restricted.  In particular,
	for some time they will be unable to access files with anything
	other than the world access perms.

	This patch assumes that noone really needs the user namespaces
	to be enabled.  If that is wrong, then we can try a more
	baroque patch where we create a file owned by a test userid with
	700 perms and, if we can't access it after setuid'ing to that
	userid, then return 0.  Otherwise, assume we are using an
	older, 'harmless' user namespace implementation.

	Comments appreciated.  Is it ok to do this?

2011-02-09  Eric Blake  <eblake@redhat.com>

	sysinfo: implement qemu support
	* src/qemu/qemu_driver.c (qemuGetSysinfo): New function.
	(qemuDriver): Install it.

	sysinfo: refactor xml formatting
	* src/util/sysinfo.h (virSysinfoFormat): New prototype.
	* src/conf/domain_conf.c (virDomainSysinfoDefFormat): Move guts...
	* src/util/sysinfo.c (virSysinfoFormat): ...into new function.
	* src/libvirt_private.syms: Export it.

	sysinfo: implement virsh support
	* tools/virsh.c (cmdSysinfo): New function.
	(hostAndHypervisorCmds): Add it.
	* tools/virsh.pod: Document it.

2011-02-09  Eric Blake  <eblake@redhat.com>

	sysinfo: implement the remote protocol
	Done by editing the first three files, then running
	'make -C src rpcgen', then editing src/remote_protocol-structs
	to match.

	* daemon/remote.c (remoteDispatchGetSysinfo): New function.
	* src/remote/remote_driver.c (remoteGetSysinfo, remote_driver):
	Client side serialization.
	* src/remote/remote_protocol.x (remote_get_sysinfo_args)
	(remote_get_sysinfo_ret): New types.
	(REMOTE_PROC_GET_SYSINFO): New enum value.
	* daemon/remote_dispatch_args.h: Regenerate.
	* daemon/remote_dispatch_prototypes.h: Likewise.
	* daemon/remote_dispatch_ret.h: Likewise.
	* daemon/remote_dispatch_table.h: Likewise.
	* src/remote/remote_protocol.c: Likewise.
	* src/remote/remote_protocol.h: Likewise.
	* src/remote_protocol-structs: Likewise.

2011-02-09  Eric Blake  <eblake@redhat.com>

	sysinfo: implement the public API
	* src/libvirt.c (virConnectGetSysinfo): New function.
	* docs/formatdomain.html.in: Mention it.

	sysinfo: define internal driver API
	* src/driver.h (virDrvGetSysinfo): New typedef.
	(_virDriver): New callback member.
	* src/esx/esx_driver.c (esxDriver): Add stub for driver.
	* src/lxc/lxc_driver.c (lxcDriver): Likewise.
	* src/opennebula/one_driver.c (oneDriver): Likewise.
	* src/openvz/openvz_driver.c (openvzDriver): Likewise.
	* src/phyp/phyp_driver.c (phypDriver): Likewise.
	* src/qemu/qemu_driver.c (qemuDriver): Likewise.
	* src/remote/remote_driver.c (remote_driver): Likewise.
	* src/test/test_driver.c (testDriver): Likewise.
	* src/uml/uml_driver.c (umlDriver): Likewise.
	* src/vbox/vbox_tmpl.c (Driver): Likewise.
	* src/vmware/vmware_driver.c (vmwareDriver): Likewise.
	* src/xen/xen_driver.c (xenUnifiedDriver): Likewise.
	* src/xenapi/xenapi_driver.c (xenapiDriver): Likewise.

2011-02-09  Eric Blake  <eblake@redhat.com>

	sysinfo: expose new API
	The new virConnectGetSysinfo() API allows one to get the system
	information associated to a connection host, providing the same
	data as a guest that uses <os><smbios mode='host'/></os>, and in
	a format that can be pasted into the guest and edited when using
	<os><smbios mode='sysinfo'/></os>.

	* include/libvirt/libvirt.h.in (virConnectGetSysinfo): Declare.
	* src/libvirt_public.syms: Export new symbol.

2011-02-09  Daniel Veillard  <veillard@redhat.com>

	Adding Michal Novotny for previous patch

2011-02-09  Michal Novotny  <minovotn@redhat.com>

	Add libvirt-php information page
	This adds a ibvirt-php information page with some
	basic information on libvirt-php project compilation, contribution
	and other useful information.

2011-02-09  Gui Jianfeng  <guijianfeng@cn.fujitsu.com>

	cgroup: Add documentation for blkiotune elements.
	Add documentation for blkiotune elements.

2011-02-09  Gui Jianfeng  <guijianfeng@cn.fujitsu.com>

	LXC: LXC Blkio weight configuration support.
	LXC Blkio weight configuration support.

	Reviewed-by: "Nikunj A. Dadhania" <nikunj@linux.vnet.ibm.com>

2011-02-09  Gui Jianfeng  <guijianfeng@cn.fujitsu.com>

	qemu: Implement blkio tunable XML configuration and parsing.
	Implement blkio tunable XML configuration and parsing.

	Reviewed-by: "Nikunj A. Dadhania" <nikunj@linux.vnet.ibm.com>

2011-02-09  Gui Jianfeng  <guijianfeng@cn.fujitsu.com>

	cgroup: Update XML Schema for new entries.
	Update XML Schema for new entries.

2011-02-09  Gui Jianfeng  <guijianfeng@cn.fujitsu.com>

	cgroup: Implement blkio.weight tuning API.
	Implement blkio.weight tuning API.

	Acked-by: Daniel P. Berrange <berrange@redhat.com>

2011-02-09  Gui Jianfeng  <guijianfeng@cn.fujitsu.com>

	cgroup: Enable cgroup hierarchy for blkio cgroup
	Enable cgroup hierarchy for blkio cgroup

	Acked-by: Daniel P. Berrange <berrange@redhat.com>

2011-02-09  Eric Blake  <eblake@redhat.com>

	maint: update AUTHORS
	* AUTHORS: Adjust for recent commits.

2011-02-08  Daniel Veillard  <veillard@redhat.com>

	Update Dutch and Polish localizations

	Revert "Czech translation updates"
	This reverts commit 9169c0eeb4b68a0001b57d35d11e41f9c1bc6148.
	The patch didn't applied cleanly and completely broke po regeneration

2011-02-08  Zdenek Styblik  <stybla@turnovfree.net>

	Czech translation updates

2011-02-08  Hero Phương  <herophuong93@gmail.com>

	Vietnamese translations for libvirt

2011-02-08  Niels de Vos  <ndevos@redhat.com>

	docs/index.html.in: update KVM url

2011-02-05  Eric Blake  <eblake@redhat.com>

	spicevmc: support older -device spicevmc of qemu 0.13.0
	qemu 0.13.0 (at least as built for Fedora 14, and also backported to
	RHEL 6.0 qemu) supported an older syntax for a spicevmc channel; it's
	not as flexible (it has an implicit name and hides the chardev
	aspect), but now that we support spicevmc, we might as well target
	both variants.

	* src/qemu/qemu_capabilities.h (QEMUD_CMD_FLAG_DEVICE_SPICEVMC):
	New flag.
	* src/qemu/qemu_capabilities.c (qemuCapsParseDeviceStr): Set it
	correctly.
	* src/qemu/qemu_command.h (qemuBuildVirtioSerialPortDevStr): Drop
	declaration.
	* src/qemu/qemu_command.c (qemuBuildVirtioSerialPortDevStr): Alter
	signature, check flag.
	(qemuBuildCommandLine): Adjust caller and check flag.
	* tests/qemuhelptest.c (mymain): Update test.
	* tests/qemuxml2argvtest.c (mymain): New test.
	* tests/qemuxml2argvdata/qemuxml2argv-channel-spicevmc-old.xml:
	New file.
	* tests/qemuxml2argvdata/qemuxml2argv-channel-spicevmc-old.args:
	Likewise.

2011-02-05  Eric Blake  <eblake@redhat.com>

	smartcard: add spicevmc support
	Adds <smartcard mode='passthrough' type='spicevmc'/>, which uses the
	new <channel name='smartcard'/> of <graphics type='spice'>.

	* docs/schemas/domain.rng: Support new XML.
	* docs/formatdomain.html.in: Document it.
	* src/conf/domain_conf.h (virDomainGraphicsSpiceChannelName): New
	enum value.
	(virDomainChrSpicevmcName): New enum.
	(virDomainChrSourceDef): Distinguish spicevmc types.
	* src/conf/domain_conf.c (virDomainGraphicsSpiceChannelName): Add
	smartcard.
	(virDomainSmartcardDefParseXML): Parse it.
	(virDomainChrDefParseXML, virDomainSmartcardDefParseXML): Set
	spicevmc name.
	(virDomainChrSpicevmc): New enum conversion functions.
	* src/libvirt_private.syms: Export new functions.
	* src/qemu/qemu_command.c (qemuBuildChrChardevStr): Conditionalize
	name.
	* tests/qemuxml2argvtest.c (domain): New test.
	* tests/qemuxml2argvdata/qemuxml2argv-smartcard-passthrough-spicevmc.args:
	New file.
	* tests/qemuxml2argvdata/qemuxml2argv-smartcard-passthrough-spicevmc.xml:
	Likewise.

2011-02-04  Daniel P. Berrange  <berrange@redhat.com>

	spicevmc: support new qemu chardev
	Inspired by https://bugzilla.redhat.com/show_bug.cgi?id=615757

	Add a new character device backend for virtio serial channels that
	activates the QEMU spice agent on the main channel using the vdagent
	spicevmc connection.  The <target> must be type='virtio', and supports
	an optional name that specifies how the guest will see the channel
	(for now, name must be com.redhat.spice.0).

	<channel type='spicevmc'>
	  <target type='virtio'/>
	  <address type='virtio-serial' controller='1' bus='0' port='3'/>
	</channel>

	* docs/schemas/domain.rng: Support new XML.
	* docs/formatdomain.html.in: Document it.
	* src/conf/domain_conf.h (virDomainChrType): New enum value.
	* src/conf/domain_conf.c (virDomainChr): Add spicevmc.
	(virDomainChrDefParseXML, virDomainChrSourceDefParseXML)
	(virDomainChrDefParseTargetXML): Parse and enforce proper use.
	(virDomainChrSourceDefFormat, virDomainChrDefFormat): Format.
	* src/qemu/qemu_command.c (qemuBuildChrChardevStr)
	(qemuBuildCommandLine): Add qemu support.
	* tests/qemuxml2argvtest.c (domain): New test.
	* tests/qemuxml2argvdata/qemuxml2argv-channel-spicevmc.xml: New
	file.
	* tests/qemuxml2argvdata/qemuxml2argv-channel-spicevmc.args:
	Likewise.

2011-02-04  Eric Blake  <eblake@redhat.com>

	smartcard: turn on qemu support
	* src/qemu/qemu_command.c (qemuBuildCommandLine): Emit smartcard
	options.
	(qemuAssignDeviceAliases): Assign an alias for smartcards.
	(qemuBuildControllerDevStr): Manage the usb-ccid controller.
	* tests/qemuxml2argvtest.c (mymain): Add new tests.
	* tests/qemuxml2argvdata/qemuxml2argv-smartcard-host.args: New
	file.
	* tests/qemuxml2argvdata/qemuxml2argv-smartcard-host-certificates.args:
	Likewise.
	* tests/qemuxml2argvdata/qemuxml2argv-smartcard-passthrough.args:
	Likewise.
	* tests/qemuxml2argvdata/qemuxml2argv-smartcard-controller.args:
	Likewise.

	smartcard: enable SELinux support
	* src/security/security_selinux.c
	(SELinuxRestoreSecuritySmartcardCallback)
	(SELinuxSetSecuritySmartcardCallback): New helper functions.
	(SELinuxRestoreSecurityAllLabel, SELinuxSetSecurityAllLabel): Use
	them.

2011-02-04  Eric Blake  <eblake@redhat.com>

	smartcard: check for qemu capability
	Qemu smartcard/spicevmc support exists on branches (such as
	http://cgit.freedesktop.org/~alon/qemu/commit/?h=usb_ccid.v15&id=024a37b)
	but is not yet upstream.  The added -help output matches a scratch build
	that will be close to the RHEL 6.1 qemu-kvm.

	* src/qemu/qemu_capabilities.h (QEMUD_CMD_FLAG_CCID_EMULATED)
	(QEMUD_CMD_FLAG_CCID_PASSTHRU, QEMUD_CMD_FLAG_CHARDEV_SPICEVMC):
	New flags.
	* src/qemu/qemu_capabilities.c (qemuCapsComputeCmdFlags)
	(qemuCapsParseDeviceStr): Check for smartcard capabilities.
	(qemuCapsExtractVersionInfo): Tweak comment.
	* tests/qemuhelptest.c (mymain): New test.
	* tests/qemuhelpdata/qemu-kvm-0.12.1.2-rhel61: New file.
	* tests/qemuhelpdata/qemu-kvm-0.12.1.2-rhel61-device: Likewise.

2011-02-04  Eric Blake  <eblake@redhat.com>

	smartcard: add domain conf support
	* src/conf/domain_conf.h (virDomainSmartcardType): New enum.
	(virDomainSmartcardDef, virDomainDeviceCcidAddress): New structs.
	(virDomainDef): Include smartcards.
	(virDomainSmartcardDefIterator): New typedef.
	(virDomainSmartcardDefFree, virDomainSmartcardDefForeach): New
	prototypes.
	(virDomainControllerType, virDomainDeviceAddressType): Add ccid
	enum values.
	(virDomainDeviceInfo): Add ccid address type.
	* src/conf/domain_conf.c (virDomainSmartcard): Convert between
	enum and string.
	(virDomainSmartcardDefParseXML, virDomainSmartcardDefFormat)
	(virDomainSmartcardDefFree, virDomainDeviceCcidAddressParseXML)
	(virDomainDefMaybeAddSmartcardController): New functions.
	(virDomainDefParseXML): Parse the new XML.
	(virDomainDefFormat): Convert back to XML.
	(virDomainDefFree): Clean up.
	(virDomainDeviceInfoIterate): Iterate over passthrough aliases.
	(virDomainController, virDomainDeviceAddress)
	(virDomainDeviceInfoParseXML, virDomainDeviceInfoFormat)
	(virDomainDefAddImplicitControllers): Support new values.
	* src/libvirt_private.syms (domain_conf.h): New exports.
	* cfg.mk (useless_free_options): List new function.

2011-02-04  Eric Blake  <eblake@redhat.com>

	smartcard: add XML support for <smartcard> device
	Assuming a hypervisor that supports multiple smartcard devices in the
	guest, this would be a valid XML description:

	<devices>
	  <smartcard mode='host'/>
	  <smartcard mode='host-certificates'>
	    <certificate>/path/to/cert1</certificate>
	    <certificate>/path/to/cert2</certificate>
	    <certificate>/path/to/cert3</certificate>
	  </smartcard>
	  <smartcard mode='passthrough' type='tcp'>
	    <source mode='bind' host='127.0.0.1' service='2001'/>
	    <protocol type='raw'/>
	  </smartcard>
	</devices>

	(As of this commit, the qemu hypervisor will be the first
	implementation, but it only supports one smartcard.)

	* docs/formatdomain.html.in (Smartcard devices): New section.
	* docs/schemas/domain.rng (smartcard): New define, used in
	devices.
	* tests/qemuxml2argvdata/qemuxml2argv-smartcard-host.xml: New file
	to test schema.
	* tests/qemuxml2argvdata/qemuxml2argv-smartcard-host-certificates.xml:
	Likewise.
	* tests/qemuxml2argvdata/qemuxml2argv-smartcard-passthrough-tcp.xml:
	Likewise.
	* tests/qemuxml2argvdata/qemuxml2argv-smartcard-controller.xml:
	Likewise.

2011-02-04  Alon Levy  <alevy@redhat.com>

	docs/index.html.in: update QEMU url

2011-02-04  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Support booting from hostdev PCI devices

	Support booting from hostdev devices

2011-02-04  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Add shortcut for HMP pass through
	Currently users who want to use virDomainQemuMonitorCommand() API or
	it's virsh equivalent has to use the same protocol as libvirt uses for
	communication to qemu. Since the protocol is QMP with current qemu and
	HMP much more usable for humans, one ends up typing something like the
	following:

	    virsh qemu-monitor-command DOM \
	'{"execute":"human-monitor-command","arguments":{"command-line":"info kvm"}}'

	which is not a very convenient way of debugging qemu.

	This patch introduces --hmp option to qemu-monitor-command, which says
	that the provided command is in HMP. If libvirt uses QMP to talk with
	qemu, the command will automatically be converted into QMP. So the
	example above is simplified to just

	    virsh qemu-monitor-command --hmp DOM "info kvm"

	Also the result is converted from

	    {"return":"kvm support: enabled\r\n"}

	to just plain HMP:

	    kvm support: enabled

	If libvirt talks to qemu in HMP, --hmp flag is obviously a noop.

2011-02-04  Stefan Berger  <stefanb@us.ibm.com>

	macvtap: fix 2 nla_put expressions (non-serious bug)
	This patch fixes 2 occurrences of nla_put expression with a '!' in
	front of them that basically prevented the detection that the buffer
	is too small. However, code further below would then detect that the
	buffer is too small when further parts are added to the netlink message.

2011-02-04  Eric Blake  <eblake@redhat.com>

	qemu: avoid double shutdown
	* src/qemu/qemu_driver.c (qemudShutdownVMDaemon): Check that vm is
	still active.
	Reported by Wen Congyang as follows:

	Steps to reproduce this bug:

	1. use gdb to debug libvirtd, and set breakpoint in the function
	   qemuConnectMonitor()
	2. start a vm, and the libvirtd will be stopped in qemuConnectMonitor()
	3. kill -STOP $(cat /var/run/libvirt/qemu/<domain>.pid)
	4. continue to run libvirtd in gdb, and libvirtd will be blocked in the
	   function qemuMonitorSetCapabilities()
	5. kill -9 $(cat /var/run/libvirt/qemu/<domain>.pid)

	Here is log of the qemu:
	=========
	LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin ...
	char device redirected to /dev/pts/3
	2011-01-27 09:38:48.101: shutting down
	2011-01-27 09:41:26.401: shutting down
	=========

	The vm is shut down twice. I do not know whether this behavior has
	side effect, but I think we should shutdown the vm only once.

2011-02-03  Davidlohr Bueso  <dave@gnu.org>

	Fix conflicts with glibc globals
	When compiling libvirt with GCC 3.4.6 the following warning is being triggered quite a lot:

	util/memory.h:60: warning: declaration of 'remove' shadows a global declaration
	/usr/include/stdio.h:175: warning: shadowed declaration is here

	Fix this by renaming the parameter to 'toremove'.

2011-02-03  Daniel Veillard  <veillard@redhat.com>

	Fix compilation when building without sasl
	Use of saslDecoded field need to be guarded by #if HAVE_SASL/endif
	* src/remote/remote_driver.c: fix remoteIOEventLoop accordingly

2011-02-03  Eric Blake  <eblake@redhat.com>

	docs: more on qemu locking patterns
	* src/qemu/THREADS.txt: Improve documentation.

2011-02-03  Niels de Vos  <ndevos@redhat.com>

	qemuBuildDeviceAddressStr() checks for QEMUD_CMD_FLAG_PCI_MULTIBUS
	Depending if the qemu binary supports multiple pci-busses, the device
	options will contain "bus=pci" or "bus=pci.0".

	Only x86_64 and i686 seem to have support for multiple PCI-busses. When
	a guest of these architectures is started, set the
	QEMUD_CMD_FLAG_PCI_MULTIBUS flag.

2011-02-02  Daniel P. Berrange  <berrange@redhat.com>

	Don't sleep in poll() if there is existing SASL decoded data
	In the SASL codepath we typically read far more data off the
	wire than we immediately need. When using a connection from a
	single thread this isn't a problem, since only our reply will
	be pending (or an event we can handle directly). When using a
	connection from multiple threads though, we may read the data
	from replies from other threads. If those replies occur after
	our own reply, they'll not be processed. The other thread will
	then go into poll() and wait for its reply which has already
	been received and decoded. The solution is to set poll() timeout
	to 0 if there is pending SASL data.

	* src/remote/remote_driver.c: Don't sleep in poll() if SASL
	  data exists

2011-02-02  Justin Clift  <jclift@redhat.com>

	docs: renamed hudson project link to jenkins, matching project rename

2011-02-02  Stefan Berger  <stefanb@us.ibm.com>

	macvtap: fix variable in debugging output
	This patch fixes a variable in the debugging output.

2011-02-02  Eric Blake  <eblake@redhat.com>

	build: fix parted detection at configure time
	* configure.ac (PARTED_FOUND): Issue configure error if
	--with-storage-disk=yes but no parted is found.

2011-02-01  Osier Yang  <jyang@redhat.com>

	docs: Update docs for cpu_shares setting
	* tools/virsh.pod

2011-02-01  Osier Yang  <jyang@redhat.com>

	qemu: Build command line for incoming tunneled	migration
	Command line building for incoming tunneled migration is missed,
	as a result, all the tunneled migration will fail with "unknown
	migration protocol".

	* src/qemu/qemu_command.c

2011-02-01  Paweł Krześniak  <pawel.krzesniak@gmail.com>

	bridge_driver: handle DNS over IPv6
	* dnsmasq listens on all defined IPv[46] addresses for network
	* Add ip6tables rules to allow DNS traffic to host

2011-02-01  Juerg Haefliger  <juerg.haefliger@hp.com>

	tests: handle backspace-newline pairs in test input files
	This patch teaches testutil how to read multi-line input files with
	backspace-newline line continuation markers.

	The patch also breaks up all the single-line arguments test input files into
	multi-line files with lines shorter than 80 characters.

2011-01-31  Osier Yang  <jyang@redhat.com>

	qemu: More clear error parsing domain def failure of tunneled migration
	* src/qemu/qemu_driver.c

2011-01-31  Wen Congyang  <wency@cn.fujitsu.com>

	Initialization error of controller in QEmu SCSI hotplug
	Bug manifests itself by:

	1. # virsh attach-disk --target sdb ...
	2. # virsh attach-disk --target sdh ...
	   error: Failed to attach disk
	   error: operation failed: target scsi:0 already exists

	sdh uses scsi:1, rather than scsi:0.

	* src/qemu/qemu_hotplug.c: properly set controller idx in
	  qemuDomainFindOrCreateSCSIDiskController()

2011-01-31  Daniel Veillard  <veillard@redhat.com>

	Osier get commit rights

2011-01-30  Eric Blake  <eblake@redhat.com>

	maint: reject raw close, popen in 'make syntax-check'
	commit f1fe9671e was supposed to make sure we use files.h
	macros to avoid double close, but it didn't work.

	Meanwhile, virCommand is vastly superior to system(), fork(),
	and popen() (also to virExec, but we haven't completed that
	conversion), so enforce that, too.

	* cfg.mk (sc_prohibit_close): Fix typo that excluded close, and
	add pclose.
	(sc_prohibit_fork_wrappers): New rule, for fork, system, and popen.
	* .x-sc_prohibit_close: More exemptions.
	* .x-sc_prohibit_fork_wrappers: New file.
	* Makefile.am (syntax_check_exceptions): Ship new file.
	* src/datatypes.c (virReleaseConnect): Tweak comment to avoid
	false positive.
	* src/util/files.h (VIR_CLOSE): Likewise.

2011-01-30  Eric Blake  <eblake@redhat.com>

	build: avoid close, system
	* src/fdstream.c (virFDStreamOpenFile, virFDStreamCreateFile):
	Use VIR_FORCE_CLOSE instead of close.
	* tests/commandtest.c (mymain): Likewise.
	* tools/virsh.c (editFile): Use virCommand instead of system.
	* src/util/util.c (__virExec): Special case preservation of std
	file descriptors to child.

2011-01-29  Matthias Bolte  <matthias.bolte@googlemail.com>

	Prefer C style comments over C++ ones
	Pure cosmetic change.

	esx: Ensure max-memory has 4 megabyte granularity

2011-01-29  Matthias Bolte  <matthias.bolte@googlemail.com>

	Add VIR_DIV_UP to divide memory or storage request sizes with round up
	Use it in all places where a memory or storage request size is converted
	to a larger granularity. This avoids requesting too small memory or storage
	sizes that could result from the truncation done by a simple division.

	This extends the round up fix in 6002e0406c338668ea0ecbfeb6c1ef20a8b67efe
	to the whole codebase.

	Instead of reporting errors for odd values in the VMX code round them up.

	Update the QEMU Argv tests accordingly as the original memory size 219200
	isn't a even multiple of 1024 and is rounded up to 215 megabyte now. Change
	it to 219100 and 219136. Use two different values intentionally to make
	sure that rounding up works.

	Update virsh.pod accordingly, as rounding down and rejecting are replaced
	by rounding up.

2011-01-29  Eric Blake  <eblake@redhat.com>

	qemu: fix augeas support for vnc_auto_unix_socket
	Fixes test failure that was overlooked after commit 1e1f7a8950.

	* daemon/Makefile.am (check-local): Let 'make check' fail on error.
	* daemon/test_libvirtd.aug: Move qemu-specific option...
	* src/qemu/test_libvirtd_qemu.aug: ...into correct test.
	* src/qemu/libvirtd_qemu.aug: Parse new option.

2011-01-29  Michal Privoznik  <mprivozn@redhat.com>

	virsh: added --all flag to freecell command
	This will iterate over all NUMA nodes, showing
	free memory for each and sum at the end.
	Existing default behavior is not changed.

2011-01-29  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Don't try to change max-memory of an active domain
	Report an VIR_ERR_OPERATION_INVALID error in that case instead of letting
	the SOAP call fail with an VIR_ERR_INTERNAL_ERROR error.

2011-01-29  Eric Blake  <eblake@redhat.com>

	qemu aio: enable support
	qemu allows the user to choose what io storage api should be used,
	either the default (threads) or native (linux aio) which in the latter
	case can result in better performance.

	Based on a patch originally by Matthias Dahl.

	Red Hat Bugzilla #591703

2011-01-29  Matthias Dahl  <mdvirt@designassembly.de>

	qemu aio: parse aio support from qemu -help

	qemu aio: add XML parsing
	Allows io={threads|native} as an optional attribute to <driver>.

2011-01-28  Juerg Haefliger  <juerg.haefliger@hp.com>

	docs: replace CRLF with LF

2011-01-28  Daniel P. Berrange  <berrange@redhat.com>

	Remove bogus log warning lines when launching QEMU
	The refactoring of QEMU command startup was comitted with
	a couple of VIR_WARN lines left in from debugging.

	* src/qemu/qemu_driver.c: Remove log warning lines

2011-01-28  Daniel P. Berrange  <berrange@redhat.com>

	Remove double close of qemu monitor
	When qemuMonitorSetCapabilities() fails, there is no need to
	call qemuMonitorClose(), because the caller will already see
	the error code and tear down the entire VM. The extra call to
	qemuMonitorClose resulted in a double-free due to it removing
	a ref count prematurely.

	* src/qemu/qemu_driver.c: Remove premature close of monitor

2011-01-28  Daniel P. Berrange  <berrange@redhat.com>

	Prevent overfilling of self-pipe in python event loop
	If the event loop takes a very long time todo something, it is
	possible for the 'self pipe' buffer to become full at which
	point the entire event loop + remote driver deadlock. Use a
	boolean flag to ensure we have strict one-in, one-out behaviour
	on writes/reads of the 'self pipe'

2011-01-28  Osier Yang  <jyang@redhat.com>

	docs: Add docs for new extra parameter pkipath
	* docs/remote.html.in

2011-01-28  Eric Blake  <eblake@redhat.com>

	qemu: fix error messages
	Regression in commit caa805ea let a lot of bad messages slip in.

	* cfg.mk (msg_gen_function): Fix function name.
	* src/qemu/qemu_cgroup.c (qemuRemoveCgroup): Fix fallout from
	'make syntax-check'.
	* src/qemu/qemu_driver.c (qemudDomainGetInfo)
	(qemuDomainWaitForMigrationComplete, qemudStartVMDaemon)
	(qemudDomainSaveFlag, qemudDomainAttachDevice)
	(qemuDomainUpdateDeviceFlags): Likewise.
	* src/qemu/qemu_hotplug.c (qemuDomainAttachHostUsbDevice)
	(qemuDomainDetachPciDiskDevice, qemuDomainDetachSCSIDiskDevice):
	Likewise.

2011-01-28  Hu Tao  <hutao@cn.fujitsu.com>

	qemu: Report more accurate error on failure to attach device.
	When attaching device from a xml file and the device is mis-configured,
	virsh gives mis-leading message "out of memory". This patch fixes this.

2011-01-28  Wen Congyang  <wency@cn.fujitsu.com>

	Force guest suspend at timeout
	If the memory of guest OS is changed constantly, the live migration
	can not be ended ever for ever.

	We can use the command 'virsh migrate-setmaxdowntime' to control the
	live migration. But the value of maxdowntime is diffcult to calculate
	because it depends on the transfer speed of network and constantly
	changing memroy size. We need a easy way to control the live migration.

	This patch adds the support of forcing guest to suspend at timeout.
	With this patch, when we migrate the guest OS, we can specify a
	timeout. If the live migration timeouts, auto-suspend the guest OS,
	where the migration will complete offline.

2011-01-28  Wen Congyang  <wency@cn.fujitsu.com>

	Show migration progress.
	Show migration progress if `migrate --verbose'.

2011-01-28  Hu Tao  <hutao@cn.fujitsu.com>

	Cancel migration if user presses Ctrl-C when migration is in progress
	While migration is in progress and virsh is waiting for its
	completion, user may want to terminate the progress by pressing
	Ctrl-C. But virsh just exits on user's Ctrl-C leaving migration
	in background that user isn't even aware of. It's not reasonable.

	This patch changes the behaviour for migration. For other
	commands Ctrl-C still terminates virsh itself.

2011-01-28  Eric Blake  <eblake@redhat.com>

	qemu: use separate alias for chardev and associated device
	* src/qemu/qemu_command.c (qemuBuildChrChardevStr): Alter the
	chardev alias.
	(qemuBuildCommandLine): Output an id for the chardev counterpart.
	* tests/qemuxml2argvdata/*: Update tests to match.
	Reported by Daniel P. Berrange.

2011-01-28  Wen Congyang  <wency@cn.fujitsu.com>

	avoid vm to be deleted if qemuConnectMonitor failed
	Steps to reproduce this bug:
	1. service libvirtd start
	2. virsh start <domain>
	3. kill -STOP $(cat /var/run/libvirt/qemu/<domain>.pid)
	4. service libvirtd restart
	5. kill -9 $(cat /var/run/libvirt/qemu/<domain>.pid)

	Then libvirtd will core dump or be in deadlock state.

	Make sure that json is built into libvirt and the version
	of qemu is newer than 0.13.0.

	The reason of libvirtd cores dump is that:
	We add vm->refs when we alloc the memory, and decrease it
	in the function qemuHandleMonitorEOF() in other thread.

	We add vm->refs in the function qemuConnectMonitor() and
	decrease it when the vm is inactive.

	The libvirtd will block in the function qemuMonitorSetCapabilities()
	because the vm is stopped by signal SIGSTOP. Now the vm->refs is 2.

	Then we kill the vm by signal SIGKILL. The function
	qemuMonitorSetCapabilities() failed, and then we will decrease vm->refs
	in the function qemuMonitorClose().
	In another thread, mon->fd is broken and the function
	qemuHandleMonitorEOF() is called.

	If qemuHandleMonitorEOF() decreases vm->refs before qemuConnectMonitor()
	returns, vm->refs will be decrease to 0 and the memory is freed.

	We will call qemudShutdownVMDaemon() as qemuConnectMonitor() failed.
	The memory has been freed, so qemudShutdownVMDaemon() is too dangerous.

	We will reference NULL pointer in the function virDomainConfVMNWFilterTeardown():
	=============
	void
	virDomainConfVMNWFilterTeardown(virDomainObjPtr vm) {
	    int i;

	    if (nwfilterDriver != NULL) {
	        for (i = 0; i < vm->def->nnets; i++)
	            virDomainConfNWFilterTeardown(vm->def->nets[i]);
	    }
	}
	============
	vm->def->nnets is not 0 but vm->def->nets is NULL(We don't set vm->def->nnets
	to 0 when we free vm).

	We should add an extra reference of vm to avoid vm to be deleted if
	qemuConnectMonitor() failed.

2011-01-28  Jiri Denemark  <jdenemar@redhat.com>

	tests: Fix virtio channel tests
	As noticed by Eric, commit 8e28c5d40200b4c5d483bd585d237b9d870372e5,
	which fixed generation of virtio-serial port numbers, forgot to adjust
	test files which resulted in make check failure.

2011-01-28  Justin Clift  <jclift@redhat.com>

	docs: expand the man page text for virsh setmaxmem
	Addresses BZ # 622534:

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

2011-01-28  Eric Blake  <eblake@redhat.com>

	event: fix event-handling allocation crash
	Regression introduced in commit e6b68d7 (Nov 2010).

	Prior to that point, handlesAlloc was always a multiple of
	EVENT_ALLOC_EXTENT (10), and was an int (so even if the subtraction
	had been able to wrap, a negative value would be less than the count
	not try to free the handles array).  But after that point,
	VIR_RESIZE_N made handlesAlloc grow geometrically (with a pattern of
	10, 20, 30, 45 for the handles array) but still freed in multiples of
	EVENT_ALLOC_EXTENT; and the count changed to size_t.  Which means that
	after 31 handles have been created, then 30 handles destroyed,
	handlesAlloc is 5 while handlesCount is 1, and since (size_t)(1 - 5)
	is indeed greater than 1, this then tried to free 10 elements, which
	had the awful effect of nuking the handles array while there were
	still live handles.

	Nuking live handles puts libvirtd in an inconsistent state, and was
	easily reproducible by starting and then stopping 60 faqemu guests.

	* daemon/event.c (virEventCleanupTimeouts, virEventCleanupHandles):
	Avoid integer wrap-around causing us to delete the entire array
	while entries are still active.
	* tests/eventtest.c (mymain): Expose the bug.

2011-01-27  Justin Clift  <jclift@redhat.com>

	docs: fix incorrect XML element mentioned by setmem text

2011-01-27  Osier Yang  <jyang@redhat.com>

	remote: Add extra parameter pkipath for URI
	This new parameter allows user specifies where the client
	cerficate, client key, CA certificate of x509 is, instead of
	hardcoding it. If 'pkipath' is not specified, and the user
	is not root, try to find files in $HOME/.pki/libvirt, as long
	as one of client cerficate, client key, CA certificate can
	not be found, use default global location (LIBVIRT_CACERT,
	LIBVIRT_CLIENTCERT, LIBVIRT_CLIENTKEY, see
	src/remote/remote_driver.h)

	Example of use:

	[root@Osier client]# virsh -c qemu+tls://10.66.93.111/system?pkipath=/tmp/pki/client
	error: Cannot access CA certificate '/tmp/pki/client/cacert.pem': No such file
	or directory
	error: failed to connect to the hypervisor
	[root@Osier client]# ls -l
	total 24
	-rwxrwxr-x. 1 root root 6424 Jan 24 21:35 a.out
	-rw-r--r--. 1 root root 1245 Jan 23 19:04 clientcert.pem
	-rw-r--r--. 1 root root  132 Jan 23 19:04 client.info
	-rw-r--r--. 1 root root 1679 Jan 23 19:04 clientkey.pem

	[root@Osier client]# cp /tmp/cacert.pem .
	[root@Osier client]# virsh -c qemu+tls://10.66.93.111/system?pkipath=/tmp/pki/client
	Welcome to virsh, the virtualization interactive terminal.

	Type:  'help' for help with commands
	'quit' to quit

	virsh #

	* src/remote/remote_driver.c: adds support for the new pkipath URI parameter

2011-01-27  Osier Yang  <jyang@redhat.com>

	storage: Round up capacity for LVM volume creation
	If vol->capacity is odd, the capacity will be rounded down
	by devision, this patch is to round it up instead of rounding
	down, to be safer in case of one writes to the volume with the
	size he used to create.

	- src/storage/storage_backend_logical.c: make sure size is not rounded down

2011-01-27  Daniel Veillard  <veillard@redhat.com>

	Update localization files from Fedora i10n

2011-01-27  David Allan  <dallan@redhat.com>

	Do not use virtio-serial port 0 for generic ports
	Per the discussion in:

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

	The port numbering should start from 1, not 0.  We assign maxport + 1,
	so start maxport at 0.

2011-01-26  Laine Stump  <laine@laine.org>

	Manually kill gzip if restore fails before starting qemu
	If a guest image is saved in compressed format, and the restore fails
	in some way after the intermediate process used to uncompress the
	image has been started, but before qemu has been started to hook up to
	the uncompressor, libvirt will endlessly wait for the uncompressor to
	finish, but it never will because it's still waiting to have something
	hooked up to drain its output.

	The solution is to close the pipes on both sides of the uncompressor,
	then send a SIGTERM before calling waitpid on it (only if the restore
	has failed, of course).

2011-01-26  Daniel P. Berrange  <berrange@redhat.com>

	Fix setup of lib directory with autogen.sh --system
	On x86_64 hosts, /usr/lib64 must be used instead of /usr/lib
	Rather than attempt to whitelist architectures, just check
	for existance of /usr/lib64

	* autogen.sh: Fix to use /usr/lib64 if it exists

2011-01-26  Daniel P. Berrange  <berrange@redhat.com>

	Add check for poll error events in monitor
	Handle poll errors in the same way as hangup event

	* src/qemu/qemu_monitor.c: Handle error events

2011-01-26  Daniel P. Berrange  <berrange@redhat.com>

	Filter out certain expected error messages from libvirtd
	Add a hook to the error reporting APIs to allow specific
	error messages to be filtered out. Wire up libvirtd to
	remove VIR_ERR_NO_DOMAIN & similar error codes from the
	logs. They are still logged at DEBUG level.

	* daemon/libvirtd.c: Filter VIR_ERR_NO_DOMAIN and friends
	* src/libvirt_private.syms, src/util/virterror.c,
	  src/util/virterror_internal.h: Hook for changing error
	  reporting level

2011-01-26  Daniel P. Berrange  <berrange@redhat.com>

	Revert all previous error log priority hacks
	This reverts the additions in commit

	  abff683f78ffd01df5005fb7a457c0b38b8eb6e1

	taking us back to state where all errors are fully logged
	in both libvirtd and normal clients.

	THe intent was to stop VIR_ERR_NO_DOMAIN (No such domain
	with UUID XXXX) messages from client apps polluting syslog
	The change affected all error codes, but more seriously,
	it also impacted errors from internal libvirtd infrastructure
	For example guest autostart no longer logged errors. The
	libvirtd network code no longer logged some errors. This
	makes debugging incredibly hard

	* daemon/libvirtd.c: Remove error log priority filter
	* src/util/virterror.c, src/util/virterror_internal.h: Remove
	  callback for overriding log priority

2011-01-26  Daniel P. Berrange  <berrange@redhat.com>

	Cleanup code style in logging APIs
	Remove use of brackets around following return statement.
	Fix indentation of two switch statements

2011-01-26  Laine Stump  <laine@laine.org>

	Set SELinux context label of pipes used for qemu migration
	This patch is a partial resolution to the following bug:

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

	(to complete the fix, an updated selinux-policy package is required,
	to add the policy that allows libvirt to set the context of a fifo,
	which was previously not allowed).

	Explanation : When an incoming migration is over a pipe (for example,
	if the image was compressed and is being fed through gzip, or was on a
	root-squash nfs server, so needed to be opened by a child process
	running as a different uid), qemu cannot read it unless the selinux
	context label for the pipe has been set properly.

	The solution is to check the fd used as the source of the migration
	just before passing it to qemu; if it's a fifo (implying that it's a
	pipe), we call the newly added virSecurityManagerSetFDLabel() function
	to set the context properly.

2011-01-26  Laine Stump  <laine@laine.org>

	Add a function to the security driver API that sets the label of an open fd.
	A need was found to set the SELinux context label on an open fd (a
	pipe, as a matter of fact). This patch adds a function to the security
	driver API that will set the label on an open fd to secdef.label. For
	all drivers other than the SELinux driver, it's a NOP. For the SElinux
	driver, it calls fsetfilecon().

	If the return is a failure, it only returns error up to the caller if
	1) the desired label is different from the existing label, 2) the
	destination fd is of a type that supports setting the selinux context,
	and 3) selinux is in enforcing mode. Otherwise it will return
	success. This follows the pattern of the existing function
	SELinuxSetFilecon().

2011-01-26  Justin Clift  <jclift@redhat.com>

	docs: add a link to the bindings page under the downloads menu item
	So people looking to download the language bindings, but don't know
	they're under the "Docs" area.

2011-01-26  Michal Privoznik  <mprivozn@redhat.com>

	virsh: require --mac to avoid detach-interface ambiguity
	bugfix for https://bugzilla.redhat.com/show_bug.cgi?id=671050

	virsh simply refutes to detach-interface in case when multiple
	interfaces are attached and --mac is not specified.

2011-01-26  Wen Congyang  <wency@cn.fujitsu.com>

	dispatch error before return

2011-01-26  Osier Yang  <jyang@redhat.com>

	qemu: Error prompt when managed save a shutoff domain
	The problem was introduced by commit 4303c91, which removed the checking
	of domain state, this patch is to fix it.

	Otherwise, improper error will be thrown, e.g.

	error: Failed to save domain rhel6 state
	error: cannot resolve symlink /var/lib/libvirt/qemu/save/rhel6.save: No such
	file or directory

2011-01-25  Eric Blake  <eblake@redhat.com>

	build: avoid corrupted gnulib/tests/Makefile
	Running 'make check' can sometimes fail in the gnulib/tests
	subdirectory, when doing an incremental build, because
	./bootstrap generates a Makefile.am that tries to refer to
	../../.. instead of ../.., and gets lost.

	This may be an upstream gnulib bug, where a more elegant
	solution will present itself in the future:
	http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/24898

	But in the meantime, I was able to reproduce both the issue,
	and this solution to work around it.

	* bootstrap.conf (bootstrap_epilogue): Ensure that no stray
	../../.. components remain in gnulib/tests/Makefile.in.
	Reported by Serge Hallyn.

2011-01-25  Cole Robinson  <crobinso@redhat.com>

	qemu: sound: Support intel 'ich6' model
	In QEMU, the card itself is a PCI device, but it requires a codec
	(either -device hda-output or -device hda-duplex) to actually output
	sound. Specifying <sound model='ich6'/> gives us -device intel-hda
	-device hda-duplex I think it's important that a simple <sound model='ich6'/>
	sets up a useful codec, to have consistent behavior with all other sound cards.

	This is basically Dan's proposal of

	    <sound model='ich6'>
	        <codec type='output' slot='0'/>
	        <codec type='duplex' slot='3'/>
	    </sound>

	without the codec bits implemented.

	The important thing is to keep a consistent API here, we don't want some
	<sound> devs require tweaking codecs but not others. Steps I see to
	accomplishing this:

	    - every <sound> device has a <codec type='default'/> (unless codecs are
	        manually specified)
	    - <codec type='none'/> is required to specify 'no codecs'
	    - new audio settings like mic=on|off could then be exposed in
	        <sound> or <codec> in a consistent manner for all sound models

	v2:
	    Use model='ich6'

	v3:
	    Use feature detection, from eblake
	    Set codec id, bus, and cad values

	v4:
	    intel-hda isn't supported if -device isn't available

	v5:
	    Comment spelling fixes

2011-01-22  Matthias Bolte  <matthias.bolte@googlemail.com>

	vmx: Use VIR_ERR_CONFIG_UNSUPPORTED when appropriated

2011-01-22  Eric Blake  <eblake@redhat.com>

	event: fix event-handling data race
	This bug has been present since before the time that commit
	f8a519 (Dec 2008) tried to make the dispatch loop re-entrant.

	Dereferencing eventLoop.handles outside the lock risks crashing, since
	any other thread could have reallocated the array in the meantime.
	It's a narrow race window, however, and one that would have most
	likely resulted in passing bogus data to the callback rather than
	actually causing a segv, which is probably why it has gone undetected
	this long.

	* daemon/event.c (virEventDispatchHandles): Cache data while
	inside the lock, as the array might be reallocated once outside.

2011-01-22  Eric Blake  <eblake@redhat.com>

	build: fix 'make check' with older git
	* .gnulib: Update to latest, for maintainer-makefile fix.
	Reported by Matthias Bolte.

2011-01-22  Cole Robinson  <crobinso@redhat.com>

	Push unapplied fixups for previous patch
	- Add augeas tests
	- Clarify vnc_auto_unix_socket precedence in qemu.conf

2011-01-22  Cole Robinson  <crobinso@redhat.com>

	qemu: Add conf option to auto setup VNC unix sockets
	If vnc_auto_unix_socket is enabled, any VNC devices without a hardcoded
	listen or socket value will be setup to serve over a unix socket in
	/var/lib/libvirt/qemu/$vmname.vnc.

	We store the generated socket path in the transient VM definition at
	CLI build time.

2011-01-22  Cole Robinson  <crobinso@redhat.com>

	qemu: Allow serving VNC over a unix domain socket
	QEMU supports serving VNC over a unix domain socket rather than traditional
	TCP host/port. This is specified with:

	<graphics type='vnc' socket='/foo/bar/baz'/>

	This provides better security access control than VNC listening on
	127.0.0.1, but will cause issues with tools that rely on the lax security
	(virt-manager in fedora runs as regular user by default, and wouldn't be
	able to access a socket owned by 'qemu' or 'root').

	Also not currently supported by any clients, though I have patches for
	virt-manager, and virt-viewer should be simple to update.

	v2:
	    schema: Make listen vs. socket a <choice>

2011-01-22  Cole Robinson  <crobinso@redhat.com>

	qemu: Set domain def transient at beginning of startup process
	This will allow us to record transient runtime state in vm->def, like
	default VNC parameters. Accomplish this by adding an extra 'live' parameter
	to SetDefTransient, with similar semantics to the 'live' flag for
	AssignDef.

2011-01-22  Eric Blake  <eblake@redhat.com>

	maint: support --no-git option during autogen.sh
	https://bugzilla.redhat.com/show_bug.cgi?id=562743

	Also, fixes gnulib bug in dealing with strerror_r from glibc 2.13.

	* .gnulib: Update to latest, for improved bootstrap.
	* bootstrap: Resync from gnulib.
	* autogen.sh (bootstrap): Add --bootstrap-sync, to make it easier
	to keep bootstrap up-to-date.  Pass optional --no-git through.
	Reported by Aleksey Avdeev.

2011-01-22  Jim Fehlig  <jfehlig@novell.com>

	[v2] qemu: Retry JSON monitor cont cmd on MigrationExpected error
	When restoring a saved qemu instance via JSON monitor, the vm is
	left in a paused state.  Turns out the 'cont' cmd was failing with
	"MigrationExpected" error class and "An incoming migration is
	expected before this command can be executed" error description
	due to migration (restore) not yet complete.

	Detect if 'cont' cmd fails with "MigrationExpecte" error class and
	retry 'cont' cmd.

	V2: Fix potential double-free noted by Laine Stump

2011-01-22  Osier Yang  <jyang@redhat.com>

	qemu: report more proper error for unsupported graphics
	Report VIR_ERR_CONFIG_UNSUPPORTED instead of VIR_ERR_INTERNAL_ERROR,
	as it's valid in our domain schema, just unsupported by hypervisor
	here.

	* src/qemu/qemu_command.c

2011-01-22  Daniel P. Berrange  <berrange@redhat.com>

	Fix startup with VNC password expiry on old QEMU
	The code which set VNC passwords correctly had fallback for
	the set_password command, but was lacking it for the
	expire_password command. This made it impossible to start
	a guest. It also failed to check whether QEMU was still
	running after the initial 'set_password' command completed

	* src/qemu/qemu_hotplug.c: Fix error handling when
	  password expiry fails
	* src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_text.c: Fix
	  return code for missing expire_password command

2011-01-22  Daniel P. Berrange  <berrange@redhat.com>

	Fix error reporting when machine type probe fails
	Avoid overwriting the real error message with a generic
	OOM failure message, when machine type probe fails

	* src/qemu/qemu_driver.c: Don't overwrite error

2011-01-22  Daniel P. Berrange  <berrange@redhat.com>

	Avoid crash in security driver if model is NULL
	If the XML security model is NULL, it is assumed that the current
	model will be used with dynamic labelling. The verify step is
	meaningless and potentially crashes if dereferencing NULL

	* src/security/security_manager.c: Skip NULL model on verify

2011-01-21  Wen Congyang  <wency@cn.fujitsu.com>

	qemu: Fix a possible deadlock in p2p migration
	The function virUnrefConnect() may call virReleaseConnect() to release
	the dest connection, and the function virReleaseConnect() will call
	conn->driver->close().

	So the function virUnrefConnect() should be surrounded by
	qemuDomainObjEnterRemoteWithDriver() and
	qemuDomainObjExitRemoteWithDriver() to prevent possible deadlock between
	two communicating libvirt daemons.

	See commit f0c8e1cb3774d6f09e2681ca1988bf235a343007 for further details.

2011-01-20  Eric Blake  <eblake@redhat.com>

	docs: document <controller> element
	* docs/formatdomain.html.in: Talk about <controller> and <address>
	throughout.

2011-01-20  Justin Clift  <jclift@redhat.com>

	docs: move the apps page to the top level as its good promo

	docs: added new entries to apps page, plus adjusted a few existing
	Added new entries for Hudson, LCFG, Tivoli Provisioning Manager,
	virt-what, and Zenoss.  Adjusted the existing entries for BuildBot
	and vmware2libvirt.

2011-01-19  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Avoid sending STOPPED event twice
	In some circumstances, libvirtd would issue two STOPPED events after it
	stopped a domain. This was because an EOF event can arrive after a qemu
	process is killed but before qemuMonitorClose() is called.

	qemuHandleMonitorEOF() should ignore EOF when the domain is not running.

	I wasn't able to reproduce this bug directly, only after adding an
	artificial sleep() into qemudShutdownVMDaemon().

2011-01-19  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Fail if per-device boot is used but deviceboot is not supported

	spec: Start libvirt-guests only if it's on in current runlevel

2011-01-19  Daniel P. Berrange  <berrange@redhat.com>

	Remove redundant brackets around return values
	A large number of return values used 'return (0)' instead
	of simply 'return 0'. Remove all these redundant brackets
	so the style is consistent throughout the file

	* src/libvirt.c: Remove redundant brackets

2011-01-19  Daniel P. Berrange  <berrange@redhat.com>

	Increase size of driver table to make UML work again
	The driver table only has 10 slots, but there are potentially
	11 drivers that need activating. Improve the error message
	when driver registration fails

	* src/libvirt.c: Increase driver table size & improve errors

2011-01-19  Daniel P. Berrange  <berrange@redhat.com>

	Turn libvirt.c error reporting functions into macros
	The virLibConnError() function (and related ones) do not correctly
	report line number info. Turn them all into macros so line numbers
	are reported correctly. Drop the connection object in all of them
	since it is no longer used.

	Also from the virLibConnWarning() equivalents completely. Now
	that the Xen driver is running 100% inside libvirtd, those
	codepaths for secondary drivers cannot be reached.

	* src/libvirt.c: Replace error functions with macros

2011-01-19  Eric Blake  <eblake@redhat.com>

	docs: document <sysinfo> and <smbios> elements
	* docs/formatdomain.html.in: Talk about <sysinfo> throughout.

	build: use more gnulib modules for simpler code
	* .gnulib: Update to latest, for sigpipe and sigaction modules.
	* bootstrap.conf (gnulib_modules): Add siaction, sigpipe, strerror_r.
	* tools/virsh.c (vshSetupSignals) [!SIGPIPE]: Delete, now that
	gnulib guarantees it.
	(SA_SIGINFO): Define for mingw fallback.
	* src/util/virterror.c (virStrerror): Simplify, now that gnulib
	guarantees the POSIX interface.
	* configure.ac (AC_CHECK_FUNCS_ONCE): Drop redundant check.
	(AM_PROG_CC_STDC): Move earlier, to keep autoconf happy.

2011-01-19  Matthias Bolte  <matthias.bolte@googlemail.com>

	Remove two unused PATH_MAX-sized char arrays from the stack

	Use VIR_ERR_OPERATION_INVALID when appropriated
	VIR_ERR_OPERATION_INVALID means that the operation is not valid
	for the current state of the involved object.

	Fix misuse of VIR_ERR_INVALID_* error code
	VIR_ERR_INVALID_* is meant for invalid pointers only.

2011-01-19  Matthias Bolte  <matthias.bolte@googlemail.com>

	Simplify "NWFilterPool" to "NWFilter"
	The public object is called NWFilter but the corresponding private
	object is called NWFilterPool. I don't see compelling reasons for this
	Pool suffix. One might argue that an NWFilter is a "pool" of rules, etc.

	Remove the Pool suffix from NWFilterPool. No functional change included.

2011-01-19  Matthias Bolte  <matthias.bolte@googlemail.com>

	datatypes: Fix outdated function names in the documentation

	Add documentation for VIR_DOMAIN_MEMORY_PARAM_UNLIMITED
	Otherwise apibuild.py complains about it.

	datatypes: Get virSecretFreeName in sync with the other free functions

2011-01-19  Matthias Bolte  <matthias.bolte@googlemail.com>

	docs: Move the "Network Filtering" page one level up in the hierarchy
	"Network Filtering" is not directly related to "Networks".

	Suggested by Daniel P. Berrange.

2011-01-19  Justin Clift  <jclift@redhat.com>

	docs: add buildbot to the apps page

2011-01-19  Eric Blake  <eblake@redhat.com>

	qemu: don't fail capabilities check on 0.12.x
	Fixes regression introduced in commit 2211518, where all qemu 0.12.x
	fails to start, as does qemu 0.13.x lacking the pci-assign device.
	Prior to 2211518, the code was just ignoring a non-zero exit status
	from the qemu child, but the virCommand code checked this to avoid
	masking any other issues, which means the real bug of provoking
	non-zero exit status has been latent for a longer time.

	* src/qemu/qemu_capabilities.c (qemuCapsExtractVersionInfo): Check
	for -device driver,? support.
	(qemuCapsExtractDeviceStr): Avoid failure if all probed devices
	are unsupported.
	Reported by Ken Congyang.

2011-01-19  Justin Clift  <jclift@redhat.com>

	docs: add new conversion heading to the apps listing

	docs: updated windows page for new 0.8.7 installer

2011-01-18  Eric Blake  <eblake@redhat.com>

	qemu: use -incoming fd:n to avoid qemu holding fd indefinitely
	https://bugzilla.redhat.com/show_bug.cgi?id=620363

	When using -incoming stdio or -incoming exec:, qemu keeps the
	stdin fd open long after the migration is complete.  Not to
	mention that exec:cat is horribly inefficient, by doubling the
	I/O and going through a popen interface in qemu.

	The new -incoming fd: of qemu 0.12.0 closes the fd after using
	it, and allows us to bypass an intermediary cat process for
	less I/O.

	* src/qemu/qemu_command.h (qemuBuildCommandLine): Add parameter.
	* src/qemu/qemu_command.c (qemuBuildCommandLine): Support
	migration via fd: when possible.  Consolidate migration handling
	into one spot, now that it is more complex.
	* src/qemu/qemu_driver.c (qemudStartVMDaemon): Update caller.
	* tests/qemuxml2argvtest.c (mymain): Likewise.
	* tests/qemuxml2argvdata/qemuxml2argv-restore-v2-fd.args: New file.
	* tests/qemuxml2argvdata/qemuxml2argv-restore-v2-fd.xml: Likewise.

2011-01-18  Jiri Denemark  <jdenemar@redhat.com>

	tests: Add tests for per-device boot elements

	qemu: Support per-device boot ordering
	Support for this is included in qemu and seabios from upstream git.

2011-01-18  Jiri Denemark  <jdenemar@redhat.com>

	Introduce per-device boot element
	Currently, boot order can be specified per device class but there is no
	way to specify exact disk/NIC device to boot from.

	This patch adds <boot order='N'/> element which can be used inside
	<disk/> and <interface/>. This is incompatible with the older os/boot
	element. Since not all hypervisors support per-device boot
	specification, new deviceboot flag is included in capabilities XML for
	hypervisors which understand the new boot element. Presence of the flag
	allows (but doesn't require) users to use the new style boot order
	specification.

2011-01-18  Jiri Denemark  <jdenemar@redhat.com>

	conf: Move boot parsing into a separate function

2011-01-17  Eric Blake  <eblake@redhat.com>

	build: let xgettext see strings in libvirt-guests
	* tools/libvirt-guests.init.in: Rename...
	* tools/libvirt-guests.init.sh: ...so that xgettext's language
	detection via suffix will work.
	* po/POTFILES.in: Update all references.
	* tools/Makefile.am (EXTRA_DIST, libvirt-guests.init): Likewise.

2011-01-17  Laurent Léonard  <laurent@open-minds.org>

	libvirt-guests: remove bashisms
	* tools/libvirt-guests.init.sh: Use only POSIX shell features, which
	includes using gettext.sh for translation rather than $"".
	* tools/Makefile.am (libvirt-guests.init): Supply a few more substitutions.
	* po/POTFILES.in: Mark that libvirt-guests.init needs translation.

2011-01-17  Daniel Veillard  <veillard@redhat.com>

	A couple of fixes for the search PHP code

2011-01-16  Matthias Bolte  <matthias.bolte@googlemail.com>

	tests: Remove obsolete secaatest
	Before the security driver was refactored in d6623003 seclabeltest and
	secaatest were basically the same. seclabeltest was meant for SELinux
	and secaatest for AppArmor. Both tests exited early when the specific
	security driver backend wasn't enabled.

	With the new security manager trying to initialize a disabled security
	driver backend is an error that can't be distinguished from other errors
	anymore. Therefore, the updated seclabeltest just asks for the first
	available backend as this will always work even with SELinux and AppArmor
	backend being disabled due to the new Nop backend.

	Remove the obsolete secaatest and compile and run the seclabeltest
	unconditional.

	This fixes make check on systems that support AppArmor.

2011-01-16  Matthias Bolte  <matthias.bolte@googlemail.com>

	virsh: Use WITH_SECDRIVER_APPARMOR to detect AppArmor support
	There is no ENABLE_SECDRIVER_APPARMOR.

2011-01-15  Nikunj A. Dadhania  <nikunj@linux.vnet.ibm.com>

	memtune: Let virsh know the unlimited value for memory tunables
	Display or set unlimited values for memory parameters. Unlimited is
	represented by INT64_MAX in memory cgroup.

	Reported-by: Justin Clift <jclift@redhat.com>

2011-01-15  Eric Blake  <eblake@redhat.com>

	maint: improve sc_prohibit_strncmp syntax check
	* .gnulib: Update, for sc_prohibit_strcmp fix.
	* cfg.mk: Adjust copyright; the only FSF portions come from when
	this file was copied from coreutils.
	(sc_prohibit_strncmp): Copy bug-fixes from sc_prohibit_strcmp.
	* .x-sc_prohibit_strcmp: Delete, now that rule is smarter.
	* .x-sc_prohibit_strncmp: Likewise.
	* Makefile.am (syntax_check_exceptions): Track deletion.

2011-01-15  Eric Blake  <eblake@redhat.com>

	datatypes: avoid redundant __FUNCTION__
	virLibConnError already includes __FUNCTION__ in its output, so we
	were redundant.  Furthermore, clang warns that __FUNCTION__ is not
	a string literal (at least __FUNCTION__ will never contain %, so
	it was not a security risk).

	* src/datatypes.c: Replace __FUNCTION__ with a descriptive string.

2011-01-15  Laine Stump  <laine@laine.org>

	Enable tuning of qemu network tap device "sndbuf" size
	This is in response to a request in:

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

	In short, under heavy load, it's possible for qemu's networking to
	lock up due to the tap device's default 1MB sndbuf being
	inadequate. adding "sndbuf=0" to the qemu commandline -netdevice
	option will alleviate this problem (sndbuf=0 actually sets it to
	0xffffffff).

	Because we must be able to explicitly specify "0" as a value, the
	standard practice of "0 means not specified" won't work here. Instead,
	virDomainNetDef also has a sndbuf_specified, which defaults to 0, but
	is set to 1 if some value was given.

	The sndbuf value is put inside a <tune> element of each <interface> in
	the domain. The intent is that further tunable settings will also be
	placed inside this element.

	     <interface type='network'>
	       ...
	       <tune>
	         <sndbuf>0</sndbuf>
	       ...
	       </tune>
	     </interface>

2011-01-15  Laine Stump  <laine@laine.org>

	Add XML config switch to enable/disable vhost-net support
	This patch is in response to

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

	The existing libvirt support for the vhost-net backend to the virtio
	network driver happens automatically - if the vhost-net device is
	available, it is always enabled, otherwise the standard userland
	virtio backend is used.

	This patch makes it possible to force whether or not vhost-net is used
	with a bit of XML. Adding a <driver> element to the interface XML, eg:

	     <interface type="network">
	       <model type="virtio"/>
	       <driver name="vhost"/>

	will force use of vhost-net (if it's not available, the domain will
	fail to start). if driver name="qemu", vhost-net will not be used even
	if it is available.

	If there is no <driver name='xxx'/> in the config, libvirt will revert
	to the pre-existing automatic behavior - use vhost-net if it's
	available, and userland backend if vhost-net isn't available.

2011-01-15  Marc-André Lureau  <marcandre.lureau@redhat.com>

	Use the new set_password monitor command to set password.
	We try to use that command first when setting a VNC/SPICE password. If
	that doesn't work we fallback to the legacy VNC only password

	Allow an expiry time to be set, if that doesn't work, throw an error
	if they try to use SPICE.

	Change since v1:
	- moved qemuInitGraphicsPasswords to qemu_hotplug, renamed
	  to qemuDomainChangeGraphicsPasswords.
	- updated what looks like a typo (that appears to work anyway) in
	  initial patch from Daniel:
	    - ret = qemuInitGraphicsPasswords(driver, vm,
	    -                                 VIR_DOMAIN_GRAPHICS_TYPE_SPICE,
	    -                                 &vm->def->graphics[0]->data.vnc.auth,
	    -                                 driver->vncPassword);
	    + ret = qemuInitGraphicsPasswords(driver, vm,
	    +                                 VIR_DOMAIN_GRAPHICS_TYPE_SPICE,
	    +                                 &vm->def->graphics[0]->data.spice.auth,
	    +                                 driver->spicePassword);

	Based on patch by Daniel P. Berrange <berrange@redhat.com>.

2011-01-15  Marc-André Lureau  <marcandre.lureau@redhat.com>

	qemu: add set_password and expire_password monitor commands

2011-01-15  Jim Fehlig  <jfehlig@novell.com>

	Fix 'make check' after commit 04197350
	I broke 'make check' with commit 04197350 by unconditionally
	emitting 'hap=' in xen xm driver.  Only emit 'hap=' if
	xendConfigVersion >= 3.  I've tested sending 'hap=' to a Xen 3.2
	machine without support for hap setting and verified that xend
	silently drops the unrecognized setting.

2011-01-15  Eric Blake  <eblake@redhat.com>

	qemu: move monitor device out of domain_conf common code
	* src/conf/domain_conf.h (virDomainChrDeviceType): Drop monitor.
	* src/conf/domain_conf.c (virDomainChrDevice)
	(virDomainChrDefParseTargetXML, virDomainChrDefFormat): Drop
	monitor support.
	* src/qemu/qemu_command.h (qemuBuildCommandLine): Alter signature.
	* src/qemu/qemu_monitor.h (qemuMonitorOpen): Likewise.
	* src/qemu/qemu_domain.h (_qemuDomainObjPrivate): Change type of
	monConfig.
	* src/qemu/qemu_domain.c (qemuDomainObjPrivateFree)
	(qemuDomainObjPrivateXMLFormat, qemuDomainObjPrivateXMLParse):
	Adjust to type change.
	* src/qemu/qemu_command.c (qemuBuildCommandLine): Likewise.
	* src/qemu/qemu_driver.c (qemuPrepareMonitorChr)
	(qemudStartVMDaemon, qemuDomainXMLToNative, qemuConnectMonitor)
	(qemudShutdownVMDaemon): Likewise.
	* src/qemu/qemu_hotplug.c (qemuDomainAttachNetDevice): Likewise.
	* src/qemu/qemu_monitor.c (qemuMonitorOpen): Likewise.
	* tests/qemuxml2argvtest.c (testCompareXMLToArgvFiles): Likewise.

2011-01-15  Eric Blake  <eblake@redhat.com>

	domain_conf: split source data out from ChrDef
	This opens up the possibility of reusing the smaller ChrSourceDef
	for both qemu monitor and a passthrough smartcard device.

	* src/conf/domain_conf.h (_virDomainChrDef): Factor host
	details...
	(_virDomainChrSourceDef): ...into new struct.
	(virDomainChrSourceDefFree): New prototype.
	* src/conf/domain_conf.c (virDomainChrDefFree)
	(virDomainChrDefParseXML, virDomainChrDefFormat): Split...
	(virDomainChrSourceDefClear, virDomainChrSourceDefFree)
	(virDomainChrSourceDefParseXML, virDomainChrSourceDefFormat):
	...into new functions.
	(virDomainChrDefParseTargetXML): Update clients to reflect type
	split.
	* src/vmx/vmx.c (virVMXParseSerial, virVMXParseParallel)
	(virVMXFormatSerial, virVMXFormatParallel): Likewise.
	* src/xen/xen_driver.c (xenUnifiedDomainOpenConsole): Likewise.
	* src/xen/xend_internal.c (xenDaemonParseSxprChar)
	(xenDaemonFormatSxprChr): Likewise.
	* src/vbox/vbox_tmpl.c (vboxDomainDumpXML, vboxAttachSerial)
	(vboxAttachParallel): Likewise.
	* src/security/security_dac.c (virSecurityDACSetChardevLabel)
	(virSecurityDACSetChardevCallback)
	(virSecurityDACRestoreChardevLabel)
	(virSecurityDACRestoreChardevCallback): Likewise.
	* src/security/security_selinux.c (SELinuxSetSecurityChardevLabel)
	(SELinuxSetSecurityChardevCallback)
	(SELinuxRestoreSecurityChardevLabel)
	(SELinuxSetSecurityChardevCallback): Likewise.
	* src/security/virt-aa-helper.c (get_files): Likewise.
	* src/lxc/lxc_driver.c (lxcVmStart, lxcDomainOpenConsole):
	Likewise.
	* src/uml/uml_conf.c (umlBuildCommandLineChr): Likewise.
	* src/uml/uml_driver.c (umlIdentifyOneChrPTY, umlIdentifyChrPTY)
	(umlDomainOpenConsole): Likewise.
	* src/qemu/qemu_command.c (qemuBuildChrChardevStr)
	(qemuBuildChrArgStr, qemuBuildCommandLine)
	(qemuParseCommandLineChr): Likewise.
	* src/qemu/qemu_domain.c (qemuDomainObjPrivateXMLFormat)
	(qemuDomainObjPrivateXMLParse): Likewise.
	* src/qemu/qemu_cgroup.c (qemuSetupChardevCgroup): Likewise.
	* src/qemu/qemu_hotplug.c (qemuDomainAttachNetDevice): Likewise.
	* src/qemu/qemu_driver.c (qemudFindCharDevicePTYsMonitor)
	(qemudFindCharDevicePTYs, qemuPrepareChardevDevice)
	(qemuPrepareMonitorChr, qemudShutdownVMDaemon)
	(qemuDomainOpenConsole): Likewise.
	* src/qemu/qemu_command.h (qemuBuildChrChardevStr)
	(qemuBuildChrArgStr): Delete, now that they are static.
	* src/libvirt_private.syms (domain_conf.h): New exports.
	* cfg.mk (useless_free_options): Update list.
	* tests/qemuxml2argvtest.c (testCompareXMLToArgvFiles): Update
	tests.

2011-01-15  Jiri Denemark  <jdenemar@redhat.com>

	cpu: Add support for Westmere CPU model

2011-01-14  Eric Blake  <eblake@redhat.com>

	qemu: improve device flag parsing
	* src/qemu/qemu_capabilities.h (qemuCapsParseDeviceStr): New
	prototype.
	* src/qemu/qemu_capabilities.c (qemuCapsParsePCIDeviceStrs)
	Rename and split...
	(qemuCapsExtractDeviceStr, qemuCapsParseDeviceStr): ...to make it
	easier to add and test device-specific checks.
	(qemuCapsExtractVersionInfo): Update caller.
	* tests/qemuhelptest.c (testHelpStrParsing): Also test parsing of
	device-related flags.
	(mymain): Update expected flags.
	* tests/qemuhelpdata/qemu-0.12.1-device: New file.
	* tests/qemuhelpdata/qemu-kvm-0.12.1.2-rhel60-device: New file.
	* tests/qemuhelpdata/qemu-kvm-0.12.3-device: New file.
	* tests/qemuhelpdata/qemu-kvm-0.13.0-device: New file.

2011-01-14  Eric Blake  <eblake@redhat.com>

	util: add missing string->integer conversion functions
	It was awkward having only int conversion in the virStrToLong family,
	but only long conversion in the virXPath family.  Make both families
	support both types.

	* src/util/util.h (virStrToLong_l, virStrToLong_ul): New
	prototypes.
	* src/util/xml.h (virXPathInt, virXPathUInt): Likewise.
	* src/util/util.c (virStrToLong_l, virStrToLong_ul): New
	functions.
	* src/util/xml.c (virXPathInt, virXPathUInt): Likewise.
	* src/libvirt_private.syms (util.h, xml.h): Export them.

2011-01-14  Justin Clift  <jclift@redhat.com>

	docs: clarify virsh setvcpus and setmem usage with active domains
	Addresses BZ # 622534:

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

2011-01-14  Eric Blake  <eblake@redhat.com>

	qemu: convert capabilities to use virCommand
	* src/qemu/qemu_capabilities.c (qemuCapsProbeMachineTypes)
	(qemuCapsProbeCPUModels, qemuCapsParsePCIDeviceStrs)
	(qemuCapsExtractVersionInfo): Use virCommand rather than virExec.

2011-01-14  Justin Clift  <jclift@redhat.com>

	virsh: ensure --maximum flag used only with --config for setvcpus

2011-01-14  Jim Fehlig  <jfehlig@novell.com>

	Document HAP domain feature
	Add HAP feature to schema and documentation.

2011-01-14  Jim Fehlig  <jfehlig@novell.com>

	Add HAP to xen hypervisor capabilities
	xen-unstable c/s 16931 introduced a per-domain setting for hvm
	guests to enable/disable hardware assisted paging.  If disabled,
	software techniques such as shadow page tables are used.  If enabled,
	and the feature exists in underlying hardware, hardware support for
	paging is used.

	Xen does not provide a mechanism to discover the HAP capability, so
	we advertise its availability for hvm guests on Xen >= 3.3.

2011-01-14  Jim Fehlig  <jfehlig@novell.com>

	Add support for HAP feature to xen drivers
	xen-unstable c/s 16931 introduced a per-domain setting for hvm
	guests to enable/disable hardware assisted paging.  If disabled,
	software techniques such as shadow page tables are used.  If enabled,
	and the feature exists in underlying hardware, hardware support for
	paging is used.

	This provides implementation for mapping HAP setting to/from
	domxml/native formats in xen drivers.

2011-01-14  Jim Fehlig  <jfehlig@novell.com>

	Add HAP to virDomainFeature enum
	Extend the virDomainFeature enumeration to include HAP (hardware
	assisted paging) feature.

	Hardware features such as Extended Page Table and Nested Page
	Table augment hypervisor software techniques such as shadow
	page table.  Adding HAP to the virDomainFeature enumeration
	allows users to select between hardware and software memory
	management mechanisms for their guests.

2011-01-13  Eric Blake  <eblake@redhat.com>

	tests: virsh is no longer in builddir/src
	Commit 870dba0 (Mar 2008) added builddir/src to PATH to pick
	up virsh.  Later, virsh was moved to tools; commit db68d6b
	(Oct 2009) noticed this, but only added the new location rather
	than deleting the old location.

	* tests/Makefile.am (path_add): Drop now-useless directory.
	Suggested by Daniel P. Berrange.

2011-01-13  Eric Blake  <eblake@redhat.com>

	virFindFileInPath: only find executable non-directory
	Without this patch, at least tests/daemon-conf (which sticks
	$builddir/src in the PATH) tries to execute the directory
	$builddir/src/qemu rather than a real qemu binary.

	* src/util/util.h (virFileExists): Adjust prototype.
	(virFileIsExecutable): New prototype.
	* src/util/util.c (virFindFileInPath): Reject non-executables and
	directories.  Avoid huge stack allocation.
	(virFileExists): Use lighter-weight syscall.
	(virFileIsExecutable): New function.
	* src/libvirt_private.syms (util.h): Export new function.

2011-01-13  Daniel Veillard  <veillard@redhat.com>

	Fix old PHP syntax in the search online form

2011-01-13  Eric Blake  <eblake@redhat.com>

	build: restore mingw build
	* bootstrap.conf (gnulib_modules): Add chown.

2011-01-13  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Fix memory leak in HostSystem managed object free function

2011-01-13  Justin Clift  <jclift@redhat.com>

	docs: fix trivial typos in currentMemory description

2011-01-13  Wen Congyang  <wency@cn.fujitsu.com>

	doc: improve the documentation of desturi

	report error when specifying wrong desturi
	When we do peer2peer migration, the dest uri is an address of the
	target host as seen from the source machine. So we must specify
	the ip or hostname of target host in dest uri. If we do not specify
	it, report an error to the user.

2011-01-13  Osier Yang  <jyang@redhat.com>

	qemu: Reject SDL graphic if it's not supported by qemu
	If the emulator doesn't support SDL graphic, we should reject
	the use of SDL graphic xml with error messages, but not ignore
	it silently, and pretend things are fine.

	"-sdl" flag was exposed explicitly by qemu since 0.10.0, more detail:
	http://www.redhat.com/archives/libvir-list/2011-January/msg00442.html

	And we already have capability flag "QEMUD_CMD_FLAG_0_10", which
	could be used to prevent the patch affecting the older versions
	of QEMU.

	* src/qemu/qemu_command.c

2011-01-12  Justin Clift  <jclift@redhat.com>

	docs: reorder apps page alphabetically, plus add libguestfs entries

	docs: add entry for archipel to the apps page

	docs: use xml entity encoding for extended character last name

2011-01-12  Matthias Bolte  <matthias.bolte@googlemail.com>

	vbox: Silently ignore missing registry key on Windows
	Don't report an error when the VirtualBox registry key is missing,
	as this just indicates that VirtualBox is not installed in general.

	This matches the behavior of the XPCOM glue that silently ignores
	a missing VBoxXPCOMC.so.

2011-01-11  Richard W.M. Jones  <rjones@redhat.com>

	qemu: Watchdog IB700 is not a PCI device (RHBZ#667091).
	Skip IB700 when assigning PCI slots.

	Note: the I6300ESB watchdog _is_ a PCI device.

	To test this: I applied this patch to libvirt-0.8.3-2.fc14 (rebasing
	it slightly: qemu_command.c didn't exist in that version) and
	installed this on my machine, then tested that I could successfully
	add an ib700 watchdog device to a guest, start the guest, and the
	ib700 was available to the guest.  I also added an i6300esb (PCI)
	watchdog to another guest, and verified that libvirt assigned a PCI
	device to it, that the guest could be started, and that i6300esb was
	present in the guest.

	Note that if you previously had a domain with a ib700 watchdog, it
	would have had an <address type='pci' .../> clause added to it in the
	libvirt configuration.  This patch does not attempt to remove this.
	You cannot start such a domain -- qemu gives an error if you try.
	With this patch you are able to remove the bogus address element
	without libvirt adding it back.

2011-01-11  Eric Blake  <eblake@redhat.com>

	cpu: plug memory leak
	* src/cpu/cpu_x86.c (x86ModelLoad): Free data before overwriting.

	network: plug memory leak
	* src/conf/network_conf.c (virNetworkDefParseXML): Release ipNodes.

	network: plug unininitialized read found by valgrind
	* src/util/network.c (virSocketAddrMask): Zero out port, so that
	iptables can initialize just the netmask then call
	virSocketFormatAddr without an uninitialized read in getnameinfo.

2011-01-11  Justin Clift  <jclift@redhat.com>

	docs: updated memtune info again in virsh command reference

2011-01-11  Cole Robinson  <crobinso@redhat.com>

	python: Use PyCapsule API if available
	On Fedore 14, virt-manager spews a bunch of warnings to the console:

	/usr/lib64/python2.7/site-packages/libvirt.py:1781: PendingDeprecationWarning: The CObject type is marked Pending Deprecation in Python 2.7.  Please use capsule objects instead.

	Have libvirt use the capsule API if available. I've verified this compiles
	fine on older python (2.6 in RHEL6 which doesn't have capsules), and
	virt-manager seems to function fine.

2011-01-11  Cole Robinson  <crobinso@redhat.com>

	event-test: Simplify debug on/off
	Make it easy to change debugging if being used by a client program.

2011-01-11  Cole Robinson  <crobinso@redhat.com>

	remote: Don't lose track of events when callbacks are slow
	After the remote driver runs an event callback, it unconditionally disables the
	loop timer, thinking it just flushed every queued event. This doesn't work
	correctly though if an event is queued while a callback is running.

	The events actually aren't being lost, it's just that the event loop didn't
	think there was anything that needed to be dispatched. So all those 'lost
	events' should actually get re-triggered if you manually kick the loop by
	generating a new event (like creating a new guest).

	The solution is to disable the dispatch timer _before_ we invoke any event
	callbacks. Events queued while a callback is running will properly reenable the
	timer.

	More info at https://bugzilla.redhat.com/show_bug.cgi?id=624252

2011-01-11  Daniel P. Berrange  <berrange@redhat.com>

	Refactor the security drivers to simplify usage
	The current security driver usage requires horrible code like

	    if (driver->securityDriver &&
	        driver->securityDriver->domainSetSecurityHostdevLabel &&
	        driver->securityDriver->domainSetSecurityHostdevLabel(driver->securityDriver,
	                                                              vm, hostdev) < 0)

	This pair of checks for NULL clutters up the code, making the driver
	calls 2 lines longer than they really need to be. The goal of the
	patchset is to change the calling convention to simply

	  if (virSecurityManagerSetHostdevLabel(driver->securityDriver,
	                                        vm, hostdev) < 0)

	The first check for 'driver->securityDriver' being NULL is removed
	by introducing a 'no op' security driver that will always be present
	if no real driver is enabled. This guarentees driver->securityDriver
	!= NULL.

	The second check for 'driver->securityDriver->domainSetSecurityHostdevLabel'
	being non-NULL is hidden in a new abstraction called virSecurityManager.
	This separates the driver callbacks, from main internal API. The addition
	of a virSecurityManager object, that is separate from the virSecurityDriver
	struct also allows for security drivers to carry state / configuration
	information directly. Thus the DAC/Stack drivers from src/qemu which
	used to pull config from 'struct qemud_driver' can now be moved into
	the 'src/security' directory and store their config directly.

	* src/qemu/qemu_conf.h, src/qemu/qemu_driver.c: Update to
	  use new virSecurityManager APIs
	* src/qemu/qemu_security_dac.c,  src/qemu/qemu_security_dac.h
	  src/qemu/qemu_security_stacked.c, src/qemu/qemu_security_stacked.h:
	  Move into src/security directory
	* src/security/security_stack.c, src/security/security_stack.h,
	  src/security/security_dac.c, src/security/security_dac.h: Generic
	  versions of previous QEMU specific drivers
	* src/security/security_apparmor.c, src/security/security_apparmor.h,
	  src/security/security_driver.c, src/security/security_driver.h,
	  src/security/security_selinux.c, src/security/security_selinux.h:
	  Update to take virSecurityManagerPtr object as the first param
	  in all callbacks
	* src/security/security_nop.c, src/security/security_nop.h: Stub
	  implementation of all security driver APIs.
	* src/security/security_manager.h, src/security/security_manager.c:
	  New internal API for invoking security drivers
	* src/libvirt.c: Add missing debug for security APIs

2011-01-11  Osier Yang  <jyang@redhat.com>

	conf: Report error if invalid type specified for character device
	If invalid type is specified, e.g.
	<serial type='foo'>
	    <target port='0'/>
	</serial>

	We replace 'foo' with "null" type implicitly, without reporting an
	error message to tell the user, and "start" or "edit" the domain
	will be success.

	It's not good to guess what the user wants, This patch is to fix
	the problem.

	* src/conf/domain_conf.c

2011-01-10  Jiri Denemark  <jdenemar@redhat.com>

	daemon: Fix core dumps if unix_sock_group is set
	Setting unix_sock_group to something else than default "root" in
	/etc/libvirt/libvirtd.conf prevents system libvirtd from dumping core on
	crash. This is because we used setgid(unix_sock_group) before binding to
	/var/run/libvirt/libvirt-sock* and setgid() back to original group.
	However, if a process changes its effective or filesystem group ID, it
	will be forbidden from leaving core dumps unless fs.suid_dumpable sysctl
	is set to something else then 0 (and it is 0 by default).

	Changing socket's group ownership after bind works better. And we can do
	so without introducing a race condition since we loosen access rights by
	changing the group from root to something else.

2011-01-08  Guido Günther  <agx@sigxcpu.org>

	Add AM_MAINTAINER_MODE
	and keep it enabled by default. This allows downstreams to turn it off
	via:

	./configure --disable-maintainer-mode

	as discussed in

	https://www.redhat.com/archives/virt-tools-list/2010-October/msg00049.html

2011-01-08  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Move occurrence check into esxVI_LookupObjectContentByType
	This simplifies the callers of esxVI_LookupObjectContentByType.

2011-01-07  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Add domain autostart support

2011-01-07  Diego Elio Pettenò  <flameeyes@gmail.com>

	commandtest: avoid printing loader-control variables from commandhelper
	This avoids throwing the tests off if LD_LIBRARY_PATH or LD_PRELOAD or
	other variables are set.

2011-01-07  Justin Clift  <jclift@redhat.com>

	docs: updated release of virsh cmd reference, with memtune info

2011-01-07  Matthias Bolte  <matthias.bolte@googlemail.com>

	vmx: Add support for video device VRAM size
	Update test suite accordingly.

	vbox: Use correct VRAM size unit
	VirtualBox uses megabyte, libvirt uses kilobyte.

2011-01-07  Osier Yang  <jyang@redhat.com>

	API: Improve log for domain related APIs
	Add VM name/UUID in log for domain related APIs.
	Format: "dom=%p, (VM: name=%s, uuid=%s), param0=%s, param1=%s

	*src/libvirt.c (introduce two macros: VIR_DOMAIN_DEBUG, and
	VIR_DOMAIN_DEBUG0)

2011-01-06  Eric Blake  <eblake@redhat.com>

	schema: tighten <serial><protocol type=...> relaxNG
	* docs/schemas/domain.rng (qemucdevSrcDef): Restrict list of
	supported <protocol type=> values.

2011-01-06  Kay Schubert  <kayegypt@web.de>

	bridge: Fix generation of dnsmasq's --dhcp-hostsfile option
	I added a host definition to a network definition:

	<network>
	  <name>Lokal</name>
	  <uuid>2074f379-b82c-423f-9ada-305d8088daaa</uuid>
	  <bridge name='virbr1' stp='on' delay='0' />
	  <ip address='192.168.180.1' netmask='255.255.255.0'>
	    <dhcp>
	      <range start='192.168.180.128' end='192.168.180.254' />
	      <host mac='23:74:00:03:42:02' name='somevm' ip='192.168.180.10' />
	    </dhcp>
	  </ip>
	</network>

	But due to the wrong if-statement the argument --dhcp-hostsfile doesn't get
	added to the dnsmasq command. The patch below fixes it for me.

2011-01-06  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Fix bogus warning about uninitialized saveptr
	The warning is bogus since strtok_r doesn't use the value when it's
	first called and initializes it for the following calls.

2011-01-06  Laine Stump  <laine@laine.org>

	Don't chown qemu saved image back to root after save if dynamic_ownership=0
	When dynamic_ownership=0, saved images must be owned by the same uid
	as is used to run the qemu process, otherwise restore won't work. To
	accomplish this, qemuSecurityDACRestoreSavedStateLabel() needs to
	simply return when it's called.

	This fix is in response to:

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

2011-01-06  Eric Blake  <eblake@redhat.com>

	maint: document dislike of mismatched if/else bracing
	* docs/hacking.html.in (Curly braces): Tighten recommendations to
	disallow if (cond) one-line; else { block; }.
	* HACKING: Regenerate.
	Suggested by Daniel P. Berrange.

2011-01-06  Laine Stump  <laine@laine.org>

	Log an error on attempts to add a NAT rule for non-IPv4 addresses
	Although the upper-layer code protected against it, it was possible to
	call iptablesForwardMasquerade() with an IPv6 address and have it
	attempt to add a rule to the MASQUERADE chain of ip6tables (which
	doesn't exist).

	This patch changes that function to check the protocol of the given
	address, generate an error log if it's not IPv4 (AF_INET), and finally
	hardcodes all the family parameters sent down to lower-level functions.

2011-01-06  Laine Stump  <laine@laine.org>

	Improve error reporting when parsing dhcp info for virtual networks
	This is partially in response to

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

	The crash in that report was coincidentally fixed when we switched
	from using inet_pton() to using virSocketParseAddr(), but the absence
	of an ip address in a dhcp static host definition was still silently
	ignored (and that entry discarded from the saved XML). This patch
	turns that into a logged failure; likewise if the entry has neither a
	mac address nor a name attribute (the entry is useless without at
	least one of those, plus an ip address).

	Since the network name is now pulled into this function in order for
	those error logs to be more informative, the other error messages in
	the function have also been changed to take advantage.

2011-01-05  Justin Clift  <jclift@redhat.com>

	docs: added libvirt-announce to contact page
	Also added explicit links to the subscription and
	archive pages for the user and developer mailing
	lists.

2011-01-05  Stefan Berger  <stefanb@us.ibm.com>

	qemu driver: fix positioning to end of log file
	While doing some testing with Qemu and creating huge logfiles I encountered the case where the VM could not start anymore due to the lseek() to the end of the Qemu VM's log file failing. The patch below fixes the problem by replacing the previously used 'int' with 'off_t'.

	To reproduce this error, you could do the following:

	dd if=/dev/zero of=/var/log/libvirt/qemu/<name of VM>.log bs=1024 count=$((1024*2048))

	and you should get an error like this:

	error: Failed to start domain <name of VM>
	error: Unable to seek to -2147482651 in /var/log/libvirt/qemu/<name of VM>.log: Success

2011-01-05  Eric Blake  <eblake@redhat.com>

	build: satisfy 'make syntax-check' regarding year change
	* .gnulib: Update to latest, to pick up 2011 copyrights.

2011-01-04  Daniel Veillard  <veillard@redhat.com>

	Release of libvirt-0.8.7
	* configure.ac libvirt.spec.in docs/news.html.in: bump version and add
	  documentation
	* po/*po*: regenerate po and pot files

2011-01-04  Eric Blake  <eblake@redhat.com>

	build: avoid compilation warnings
	Detected on cygwin:
	util/util.c: In function 'virSetUIDGID':
	util/util.c:2824: warning: format '%d' expects type 'int', but argument 7 has type 'gid_t' [-Wformat]
	(and three other lines)

	* src/util/util.c (virSetUIDGID): Cast, as is done elsewhere in
	this file, to avoid printf type mismatch warnings.

2011-01-04  Hu Tao  <hutao@cn.fujitsu.com>

	threadpool: allow NULL jobdata
	Don't require non-null jobdata to virThreadPoolSendJob().

2011-01-04  Chris Wright  <chrisw@redhat.com>

	node_device: udev driver does not handle SR-IOV devices
	The udev driver does not update a PCI device with its SR-IOV capabilities,
	when applicable, the way the hal driver does.  As a result, dumping the
	device's XML will not include the relevant physical or virtual function
	information.

	With this patch, the XML is correct:

	# virsh nodedev-dumpxml pci_0000_09_00_0
	<device>
	  <name>pci_0000_09_00_0</name>
	  <parent>pci_0000_00_1c_0</parent>
	  <driver>
	    <name>vxge</name>
	  </driver>
	  <capability type='pci'>
	    <domain>0</domain>
	    <bus>9</bus>
	    <slot>0</slot>
	    <function>0</function>
	    <product id='0x5833'>X3100 Series 10 Gigabit Ethernet PCIe</product>
	    <vendor id='0x17d5'>Neterion Inc.</vendor>
	    <capability type='virt_functions'>
	      <address domain='0x0000' bus='0x0a' slot='0x00' function='0x1'/>
	      <address domain='0x0000' bus='0x0a' slot='0x00' function='0x2'/>
	      <address domain='0x0000' bus='0x0a' slot='0x00' function='0x3'/>
	    </capability>
	  </capability>
	</device>

	# virsh nodedev-dumpxml pci_0000_0a_00_1
	<device>
	  <name>pci_0000_0a_00_1</name>
	  <parent>pci_0000_00_1c_0</parent>
	  <driver>
	    <name>vxge</name>
	  </driver>
	  <capability type='pci'>
	    <domain>0</domain>
	    <bus>10</bus>
	    <slot>0</slot>
	    <function>1</function>
	    <product id='0x5833'>X3100 Series 10 Gigabit Ethernet PCIe</product>
	    <vendor id='0x17d5'>Neterion Inc.</vendor>
	    <capability type='phys_function'>
	      <address domain='0x0000' bus='0x09' slot='0x00' function='0x0'/>
	    </capability>
	  </capability>
	</device>

	Cc: Dave Allan <dallan@redhat.com>

2011-01-01  Eric Blake  <eblake@redhat.com>

	virExec: fix logic bug
	As pointed out in https://bugzilla.redhat.com/show_bug.cgi?id=659855#c9,
	commit c3568ec2 introduced a regression where we no longer close any
	fd's beyond FD_SETSIZE.

	* src/util/util.c (__virExec): Continue to close fd's beyond
	keepfd range.
	Reported by Stefan Praszalowicz.

2011-01-01  Laine Stump  <laine@laine.org>

	Improve virSocketAddrMask[ByPrefix] API
	The original version of these functions would modify the address sent
	in, meaning that the caller would usually need to copy the address
	first. This change makes the original a const, and puts the resulting
	masked address into a new arg (which could point to the same
	virSocketAddr as the original, if the caller really wants to modify
	it).

	This also makes the API consistent with virSocketAddrBroadcast[ByPrefix].

2011-01-01  Laine Stump  <laine@laine.org>

	Set broadcast address for IPv4 addresses on virtual network bridges
	Previously we used ioctl() to set the IP address and netmask of the
	bridges used for virtual networks, and apparently the SIOCSIFNETMASK
	ioctl implicitly set the broadcast address for the interface. The new
	method of using the "ip" command requires broadcast address to be
	explicitly specified though.

	Utility functions to produce an IPv4 broadcast address
	These functions work only for IPv4, becasue IPv6 doesn't have the same
	concept of "broadcast address" as IPv4. They merely OR the inverse of
	the netmask with the given host address, thus turning on all the host
	bits.

2010-12-30  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Fix "occurence" typo (again)
	Also include some whitespace changes. No functional change included.

2010-12-28  Matthias Bolte  <matthias.bolte@googlemail.com>

	vbox: Add support for VirtualBox 4.0
	Add vboxArrayGetWithUintArg to handle new signature variations. Also
	refactor vboxArrayGet* implementation to use a common helper function.

	Deal with the incompatible changes in the VirtualBox 4.0 API. This
	includes major changes in virtual machine and storage medium lookup,
	in RDP server property handling, in session/lock handling and other
	minor areas.

	VirtualBox 4.0 also dropped the old event API and replaced it with a
	completely new one. This is not fixed yet and will be addressed in
	another patch. Therefore, currently the domain events are supported
	for VirtualBox 3.x only.

	Based on initial work from Jean-Baptiste Rouault.

2010-12-28  Matthias Bolte  <matthias.bolte@googlemail.com>

	Fix misuse of VIR_ERR_INVALID_DOMAIN
	VIR_ERR_INVALID_DOMAIN is meant for invalid domain pointers.
	VIR_ERR_NO_DOMAIN is meant for non-existing domains.

2010-12-28  Matthias Bolte  <matthias.bolte@googlemail.com>

	vbox: Handle different IID representation in Version 2.2 on Windows
	On Windows IID's are represented as GUID by value, instead of nsID
	by reference on non-Windows platforms.

	Patch the vbox_CAPI_v2_2.h header to deal with this difference.

	Rewrite vboxIID abstraction that deals with the different IID
	representations. Add support for the GUID representation. Also unify
	the four context dependent free functions for vboxIIDs

	  vboxIIDUnalloc, vboxIIDFree, vboxIIDUtf8Free, vboxIIDUtf16Free

	into vboxIIDUnalloc that is now safe to be called (even multiple
	times) on a vboxIID independent of the source and context of the
	vboxIID.

	The new vboxIID is designed to be used as a stack allocated variable.
	It has a value member that represents the actual IID value.

2010-12-24  MORITA Kazutaka  <morita.kazutaka@lab.ntt.co.jp>

	update docs for network disks

2010-12-24  Wen Congyang  <wency@cn.fujitsu.com>

	build: fix building error when building without libvirtd
	When I build libvirt without libvirtd, I receive some errors:
	cp: cannot stat `/home/wency/rpmbuild/BUILDROOT/libvirt-0.8.6-1.el6.x86_64/etc/libvirt/qemu/networks/default.xml': No such file or directory

	My build step:
	# ./autogen.sh --without-libvirtd
	# make dist
	# rpmbuild --nodeps --define "_sourcedir `pwd`" --define "_without_libvirtd 1" -ba libvirt.spec

	The reason is we disable network when we do not build libvirt daemon in configure.ac.
	After fixing this bug, I build libvirt without libvirtd, I receive other errors:
	RPM build errors:
	    Installed (but unpackaged) file(s) found:
	   /usr/share/doc/libvirt-0.8.6/html/32favicon.png
	   /usr/share/doc/libvirt-0.8.6/html/api.html
	..

2010-12-24  Eric Blake  <eblake@redhat.com>

	qemu: add -incoming fd:n capability checking
	* src/qemu/qemu_capabilities.h (QEMUD_CMD_FLAG_MIGRATE_QEMU_FD):
	New enum value.
	* src/qemu/qemu_capabilities.c (qemuCapsComputeCmdFlags): Populate
	flags according to qemu version.
	* tests/qemuhelptest.c (mymain): Adjust test.

2010-12-24  Jiri Denemark  <jdenemar@redhat.com>

	spec: Enable ESX driver on RHEL

2010-12-24  Daniel P. Berrange  <berrange@redhat.com>

	spec: Automatically turn on cgconfig service
	A number of the libvirt APIs require the use of cgroups. This is not
	enabled by default on a RHEL6 install. After discussion with cgroups
	team, it was decided that upon installation of the libvirt RPM, we
	should automatically turn on the cgroups service. This will activate a
	default configuration that turns on all cgroups controllers libvirt
	requires for full operation.

2010-12-24  Jiri Denemark  <jdenemar@redhat.com>

	bridge: Fix uninitialized variable

2010-12-24  Laine Stump  <laine@laine.org>

	Replace setuid/setgid/initgroups with virSetUIDGID()
	This patch fixes https://bugzilla.redhat.com/show_bug.cgi?id=664406

	If qemu is run as a different uid, it has been unable to access mode
	0660 files that are owned by a different user, but with a group that
	the qemu is a member of (aside from the one group listed in the passwd
	file), because initgroups() is not being called prior to the
	exec. initgroups will change the group membership of the process (and
	its children) to match the new uid.

	To make this happen, the setregid()/setreuid() code in
	qemuSecurityDACSetProcessLabel has been replaced with a call to
	virSetUIDGID(), which does both of those, plus calls initgroups.

	Similar, but not identical, code in qemudOpenAsUID() has been replaced
	with virSetUIDGID(). This not only consolidates the functionality to a
	single location, but also potentially fixes some as-yet unreported
	bugs.

2010-12-24  Laine Stump  <laine@laine.org>

	new virSetUIDGID() utility function
	virSetUIDGID() sets both the real and effective group and user of the
	process, and additionally calls initgroups() to assure that the
	process joins all the auxiliary groups that the given uid is a member
	of.

	Preserve errno across calls to error reporting functions & VIR_FREE
	There are cases when we want log an error message, and possibly free
	some memory as part of the cleanup, while still preserving errno for a
	caller, but the functions that log errors, and virFree (VIR_FREE) make
	system calls that will clear errno. This patch preserves errno during
	those most basic functions (corresponding to virReportSystemError(),
	virReportOOMError(), networkReportError(), etc, as well as
	virStrError()). It does *not preserve errno across calls to higher
	level items such as virDispatchError(), as it's assumed the caller is
	all finished with any need for errno by the time it dispatches the
	error.

2010-12-24  Laine Stump  <laine@laine.org>

	Run radvd for virtual networks with IPv6 addresses
	Running an instance of the router advertisement daemon (radvd) allows
	guests using the virtual network to automatically acquire an IPv6
	address and default route. Note that acquiring an address only works
	for networks with a prefix length of exactly 64 - radvd is still run
	in other circumstances, and still advertises routes, but autoconf will
	not work because it requires exactly 64 bits of address info from the
	network prefix.

	This patch avoids a race condition with the pidfile by manually
	daemonizing radvd rather than allowing it to daemonize itself, then
	creating our own pidfile (in addition to radvd's own file, which is
	unnecessary, but there is no way to tell radvd to not create it). This
	is accomplished by exec'ing it with "--debug 1" in the commandline,
	and using virCommand's features to fork, create a pidfile, and detach
	from the newly forked process.

2010-12-24  Laine Stump  <laine@laine.org>

	Turn on IPv6 support in the bridge_driver.c virtual network driver
	At this point everything is already in place to make IPv6 happen, we just
	need to add a few rules, remove some checks for IPv4-only, and document
	the changes to the XML on the website.

2010-12-24  Laine Stump  <laine@laine.org>

	Update iptables.c to also support ip6tables.
	All of the iptables functions eventually call down to a single
	bottom-level function, and fortunately, ip6tables syntax (for all the
	args that we use) is identical to iptables format (except the
	addresses), so all we need to do is:

	1) Get an address family down to the lowest level function in each
	   case, either implied through an address, or explicitly when no
	   address is in the parameter list, and

	2) At the lowest level, just decide whether to call "iptables" or
	   "ip6tables" based on the family.

	The location of the ip6tables binary is determined at build time by
	autoconf. If a particular target system happens to not have ip6tables
	installed, any attempts to run it will generate an error, but that
	won't happen unless someone tries to define an IPv6 address for a
	network. This is identical behavior to IPv4 addresses and iptables.

2010-12-24  Laine Stump  <laine@laine.org>

	Support multiple IP addresses on one network in bridge_driver.c
	This patch reorganizes the code in bridge_driver.c to account for the
	concept of a single network with multiple IP addresses, without adding
	in the extra variable of IPv6. A small bit of code has been
	temporarily added that checks all given addresses to verify they are
	IPv4 - this will be removed when full IPv6 support is turned on.

2010-12-24  Laine Stump  <laine@laine.org>

	Change virtual network XML parsing/formatting to support IPv6
	This commit adds support for IPv6 parsing and formatting to the
	virtual network XML parser, including moving around data definitions
	to allow for multiple <ip> elements on a single network, but only
	changes the consumers of this API to accommodate for the changes in
	API/structure, not to add any actual IPv6 functionality. That will
	come in a later patch - this patch attempts to maintain the same final
	functionality in both drivers that use the network XML parser - vbox
	and "bridge" (the Linux bridge-based driver used by the qemu
	hypervisor driver).

	* src/libvirt_private.syms: Add new private API functions.
	* src/conf/network_conf.[ch]: Change C data structure and
	  parsing/formatting.
	* src/network/bridge_driver.c: Update to use new parser/formatter.
	* src/vbox/vbox_tmpl.c: update to use new parser/formatter
	* docs/schemas/network.rng: changes to the schema -
	  * there can now be more than one <ip> element.
	  * ip address is now an ip-addr (ipv4 or ipv6) rather than ipv4-addr
	  * new optional "prefix" attribute that can be used in place of "netmask"
	  * new optional "family" attribute - "ipv4" or "ipv6"
	    (will default to ipv4)
	  * define data types for the above
	* tests/networkxml2xml(in|out)/nat-network.xml: add multiple <ip> elements
	  (including IPv6) to a single network definition to verify they are being
	  correctly parsed and formatted.

2010-12-24  Laine Stump  <laine@laine.org>

	make the <dhcp> element optional in network.rng
	In practice this has always been optional, but the RNG has shown it as
	mandatory, and since all the examples for make check had it, it was
	never noticed. One of the existing test cases has been changed to
	check for this.

	I also noticed that the dhcp/host/ip was still defined as <text/>,
	but should really be <ref name='ipv4-addr'/>

2010-12-24  Laine Stump  <laine@laine.org>

	Replace brSetInetAddress/brSetInetNetmask with brAddInetAddress
	brSetInetAddress can only set a single IP address on the bridge, and
	uses a method (ioctl(SIOCSETIFADDR)) that only works for IPv4. Replace
	it and brSetInetNetmask with a single function that uses the external
	"ip addr add" command to add an address/prefix to the interface - this
	supports IPv6, and allows adding multiple addresses to the interface.

	Although it isn't currently used in the code, we also add a
	brDelInetAddress for completeness' sake.

	Also, while we're modifying bridge.c, we change brSetForwardDelay and
	brSetEnableSTP to use the new virCommand API rather than the
	deprecated virRun, and also log an error message in bridge_driver.c if
	either of those fail (previously the failure would be completely
	silent).

2010-12-24  Laine Stump  <laine@laine.org>

	Make virtual network netmasks optional
	When a netmask isn't specified for an IPv4 address, one can be implied
	based on what network class range the address is in. The
	virNetworkDefPrefix function does this for us, so netmask isn't
	required.

2010-12-24  Laine Stump  <laine@laine.org>

	Pass prefix rather than netmask into iptables functions
	IPv6 will use prefix exclusively, and IPv4 will also optionally be
	able to use it, and the iptables functions really need a prefix
	anyway, so use the new virNetworkDefPrefix() function to send prefixes
	into iptables functions instead of netmasks.

	Also, in a couple places where a netmask is actually needed, use the
	new private API function for it rather than getting it directly. This
	will allow for cases where no netmask or prefix is specified (it
	returns the default for the current class of network.)

2010-12-24  Laine Stump  <laine@laine.org>

	Consistently return 0 on success, -1 on failure in bridge_driver.c
	Some functions in this file were returning 1 on success and 0 on
	failure, and others were returning 0 on success and -1 on
	failure. Switch them all to return the libvirt-preferred 0/-1.

	Fix logging of failed iptables commands
	The functions in iptables.c all return -1 on failure, but all their
	callers (which all happen to be in bridge_driver.c) assume that they
	are returning an errno, and the logging is done accordingly. This
	patch fixes all the error checking and logging to assume < 0 is an
	error, and nothing else.

2010-12-24  Laine Stump  <laine@laine.org>

	New virNetworkDef utility functions
	Later patches will add the possibility to define a network's netmask
	as a prefix (0-32, or 0-128 in the case of IPv6). To make it easier to
	deal with definition of both kinds (prefix or netmask), add two new
	functions:

	virNetworkDefNetmask: return a copy of the netmask into a
	virSocketAddr. If no netmask was specified in the XML, create a
	default netmask based on the network class of the virNetworkDef's IP
	address.

	virNetworkDefPrefix: return the netmask as numeric prefix (or the
	default prefix for the network class of the virNetworkDef's IP
	address, if no netmask was specified in the XML)

2010-12-24  Laine Stump  <laine@laine.org>

	New virSocketAddr utility functions
	virSocketPrefixToNetmask: Given a 'prefix', which is the number of 1
	bits in a netmask, fill in a virSocketAddr object with a netmask as an
	IP address (IPv6 or IPv4).

	virSocketAddrMask: Mask off the host bits in one virSocketAddr
	according to the netmask in another virSocketAddr.

	virSocketAddrMaskByPrefix, Mask off the host bits in a virSocketAddr
	according to a prefix (number of 1 bits in netmask).

	VIR_SOCKET_FAMILY: return the family of a virSocketAddr

2010-12-24  Wen Congyang  <wency@cn.fujitsu.com>

	fix syntax error in configure.ac
	When I run configure, I receive some syntax error.

	.....
	checking where to find <rpc/rpc.h>... none
	checking for library containing dlopen... -ldl
	/configure: line 52500: test: =: unary operator expected
	/configure: line 52766: test: =: unary operator expected
	checking linux/kvm.h usability... yes
	checking linux/kvm.h presence... yes
	.....

2010-12-24  Matthias Bolte  <matthias.bolte@googlemail.com>

	docs: Make VMware Workstation / Player page appear in the menu
	By adding it to sitemap.html.in. Also <ul> can't be nested in <p>.

2010-12-23  Matthias Bolte  <matthias.bolte@googlemail.com>

	qemu: Reparent children when deleting a snapshot
	Shorten qemuDomainSnapshotWriteSnapshotMetadata function name
	and make it take a snapshot pointer instead of dealing with
	the current snapshot. Update other functions accordingly.

	Add a qemuDomainSnapshotReparentChildren hash iterator to
	reparent the children of a snapshot that is being deleted. Use
	qemuDomainSnapshotWriteMetadata to write updated metadata
	to disk.

	This fixes a problem where outdated parent information breaks
	the snapshot tree and hinders the deletion of child snapshots.

	Reported by Philipp Hahn.

2010-12-23  Jean-Baptiste Rouault  <jean-baptiste.rouault@diateam.net>

	Add info about VMware driver to the libvirt website

2010-12-23  Jiri Denemark  <jdenemar@redhat.com>

	virsh: Add --force option to update-device

2010-12-23  Jim Fehlig  <jfehlig@novell.com>

	Set bitmap size when allocating a bitmap
	I began noticing a race when reserving VNC ports as described here

	https://www.redhat.com/archives/libvir-list/2010-November/msg00379.html

	Turns out that we were not initializing the size field of bitmap
	struct when allocating the bitmap.  This subsequently caused
	virBitmapSetBit() to fail since bitmap->size is 0, hence we never
	actually reserved the port.

2010-12-23  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Add support for storage volume wiping

	esx: Add support for storage volume deletion

2010-12-23  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Return SPICE ports on domain shutdown
	Commit ed0d9f6c0cdd56f38ce31b8d9b5293162addaa23 added support for
	automatic port allocation for SPICE but forgot to mark such ports as
	unused when they are not used anymore.

2010-12-23  Eric Blake  <eblake@redhat.com>

	virterror: avoid API breakage with vmware
	Fix glitch in commit cddd2a06 (thankfully post-0.8.6, so no
	released version has the glitch).

	Document and try to workaround glitch in commit 46e9b0f (in 0.8.0),
	which invalidated 6 virErrorNumber values dating as far back as 0.7.1.

	My audit did not find any other glitches until pre-0.1.0 days.  I'm
	not sure how to add a syntax-check off the top of my head, but
	hopefully the explicit numbering will make people think twice about
	renumbering in the future.

	* include/libvirt/virterror.h (virErrorDomain): Avoid inserting
	new values in the middle, and add explicit numbering to help avoid
	this in the future.
	(virErrorNumber): Add explicit numbering, and document the snafu.
	* src/remote/remote_driver.c (remoteIO): Compensate for the snafu.

2010-12-22  Hu Tao  <hutao@cn.fujitsu.com>

	Fix memory leak in virsh

2010-12-22  Justin Clift  <jclift@redhat.com>

	docs: fixed typo, added table of contents

2010-12-22  Matthias Bolte  <matthias.bolte@googlemail.com>

	Distribute libvirt_vmx.syms
	This fixes the build from a tarball and makes autobuild.sh
	work again.

	This should actually have been part of this earlier commit:

	  esx: Move VMX handling code out of the driver directory
	  42b2f35d36a9e33f03e973130267c19cff910f2e

	Reported by Eric Blake.

2010-12-22  Matthias Bolte  <matthias.bolte@googlemail.com>

	vmware: Fix undefine symbol with loadable drivers enabled
	All other drivers are explicitly linked to gnulib. The VMware
	driver lacked this, resulting in mdir_name being an undefine
	symbol.

	Explicitly link the VMware driver to gnulib to fix this.

2010-12-22  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Move VMX handling code out of the driver directory
	Now the VMware driver doesn't depend on the ESX driver anymore.

	Add a WITH_VMX option that depends on WITH_ESX and WITH_VMWARE.
	Also add a libvirt_vmx.syms file.

	Move some escaping functions from esx_util.c to vmx.c.

	Adapt the test suite, ESX and VMware driver to the new code layout.

2010-12-22  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Fix cluster resource lookup when connecting to a vCenter
	Connecting to a ESX(i) server that is part of a cluster failed
	when the connection also involved a vCenter.

	Accept ClusterComputeResource type in addition to ComputeResource
	type in the object lookup function.

	Reported by Guillaume Le Louët.

2010-12-22  Eric Blake  <eblake@redhat.com>

	maint: avoid space-tab
	* daemon/Makefile.am: Avoid spurious space before tabs.
	* src/Makefile.am: Likewise.
	* examples/dominfo/Makefile.am: Likewise.
	* examples/domsuspend/Makefile.am: Likewise.
	* tools/Makefile.am: Likewise.
	* src/datatypes.h (VIR_CONNECT_MAGIC): Likewise.
	* src/internal.h (TODO): Likewise.
	* src/qemu/qemu_monitor.h (QEMU_MONITOR_MIGRATE): Likewise.
	* src/xen/xen_hypervisor.c (XEN_V2_OP_GETAVAILHEAP): Likewise.
	* src/xen/xs_internal.h: Likewise.

	command: avoid hanging on daemon processes
	* src/util/command.c (virCommandRun): Don't capture output on
	daemons.
	* tests/commandtest.c (test18): Expose the bug.
	Reported by Laine Stump.

	build: skip vmware driver when building for RHEL
	* libvirt.spec.in: Provide vmware conditionals.

2010-12-21  Osier Yang  <jyang@redhat.com>

	storage: Ignore dangling symbolic link for filesystem pool
	If there is a dangling symbolic link in filesystem pool, the pool
	will fail to start or refresh, this patch is to fix it by ignoring
	it with a warning log.

2010-12-21  Josh Durgin  <joshd@hq.newdream.net>

	Skip file-based security checks for network disks
	Network disks are accessed by qemu directly, and have no
	associated file on the host, so checking for file ownership etc.
	is unnecessary.

2010-12-21  Justin Clift  <jclift@redhat.com>

	docs: added compiling page and significantly expanded windows page
	Also added an additional menu placement for the windows page, in
	order to attract further potential testers.

2010-12-21  Eric Blake  <eblake@redhat.com>

	build: make building on cygwin easier
	* configure.ac (dlopen): Cygwin dlopen is in libc; avoid spurious
	failure.
	(XDR_CFLAGS): Define when needed.
	* src/Makefile.am (libvirt_driver_remote_la_CFLAGS): Use it.

	qemu: use virAsprintf instead of PATH_MAX
	* src/qemu/qemu_driver.c (qemudLogFD, qemudLogReadFD)
	(qemudStartup, qemudGetProcessInfo): Use heap instead of stack.

2010-12-21  Eric Blake  <eblake@redhat.com>

	tests: avoid spurious failure of nodeinfotest
	When running 'make check' under a multi-cpu Dom0 xen machine,
	nodeinfotest had a spurious failure it was reading from
	/sys/devices/system/cpu, but xen has no notion of topology.  The test
	was intended to be isolated from reading any real system files; the
	regression was introduced in Mar 2010 with commit aa2f6f96dd.

	Fix things by allowing an early exit for the testsuite.

	* src/nodeinfo.c (linuxNodeInfoCPUPopulate): Add parameter.
	(nodeGetInfo): Adjust caller.
	* tests/nodeinfotest.c (linuxTestCompareFiles): Likewise.

2010-12-21  Eric Blake  <eblake@redhat.com>

	tests: avoid data race
	I got some spurious failures when commandhelper won the race and
	ran to the point of parent detection prior to the intermediate
	daemonizing process getting a chance to exit.  This fixes it.

	* tests/commandhelper.c (main): Checking for re-parenting to
	init(1) is racy; instead check that we belong to a new session.

2010-12-21  Eric Blake  <eblake@redhat.com>

	build: improve testsuite results with older automake
	* tests/Makefile.am (TESTS_ENVIRONMENT, commandtest_CFLAGS)
	(commandhelper_CFLAGS): Avoid $(builddir) and $(abs_builddir) in
	automake 1.9.6; fixes spurious failures of commandtest.

	build: allow older libselinux again
	* configure.ac (with_selinux): Check for <selinux/label.h>.
	* src/security/security_selinux.c (getContext): New function.
	(SELinuxRestoreSecurityFileLabel): Use it to restore compilation
	when using older libselinux.

2010-12-21  Eric Blake  <eblake@redhat.com>

	build: allow autoconf 2.59 again
	Autoconf 2.59 doesn't define ${localedir}, so libvirt was failing
	to compile due to a missing LOCALEDIR until today's configmake fix.

	* .gnulib: Update to latest for configmake fix.
	* configure.ac (libpcap): Avoid AS_CASE.

2010-12-21  Wen Congyang  <wency@cn.fujitsu.com>

	build: fix typo that broke 'make dist'
	* src/Makefile.am (VMWARE_DRIVER_SOURCES): Fix vmware_driver.h.

2010-12-20  Eric Blake  <eblake@redhat.com>

	libvirt-guests: avoid sourcing failure
	* tools/libvirt-guests.init.in (libvirtd): Skip function library
	if it is not present.
	Suggested by Guido Günther.

2010-12-20  Paweł Krześniak  <pawel.krzesniak@gmail.com>

	bridge_driver: avoid double call to VIR_FREE
	While not technically a double free (since VIR_FREE NULLs the
	pointer), this is unnecessary extra code.

	This crept in when the function was converted from virRun to virCommand.

	The AUTHORS file has also been updated.

2010-12-18  Matthias Bolte  <matthias.bolte@googlemail.com>

	docs: Add additional indentation to level 3 menu items
	formatnetwork.html has a menu item at level 3. libvirt.css
	doesn't have a explicit rule for level 3 and level 3 and
	level 2 items end up at the same indentation level.

	Add an additional 1em indentation to level 3 menu items.

2010-12-18  Matthias Bolte  <matthias.bolte@googlemail.com>

	vbox: Don't leak domain names in vboxListDefinedDomains

2010-12-18  Matthias Bolte  <matthias.bolte@googlemail.com>

	vbox: Don't leak arrays from XPCOM
	XPCOM returns an array as a pointer to an array of pointers to the
	actual items. When the array isn't needed anymore the items are
	released, but the actual array containing the pointers to the items
	was not freed and leaked.

	Free the actual array using ComUnallocMem.

	This doesn't affect MSCOM as SafeArrayDestroy releases all items
	and frees the array.

2010-12-18  Matthias Bolte  <matthias.bolte@googlemail.com>

	vbox: Handle different array representations of XPCOM and MSCOM
	Add a vboxArray to hide the details from the general driver code.

2010-12-18  Matthias Bolte  <matthias.bolte@googlemail.com>

	vbox: Add glue layer for MSCOM on Windows
	Don't require dlopen, but link to ole32 and oleaut32 on Windows.

	Don't expose g_pVBoxFuncs anymore. It was only used to get the
	version of the API. Make VBoxCGlueInit return the version instead.
	This simplifies the implementation of the MSCOM glue layer.

	Get the VirtualBox version from the registry.

	Add a dummy implementation of the nsIEventQueue to the MSCOM glue
	as there seems to be no direct equivalent with MSCOM. It might be
	implemented using the normal window message loop. This requires
	additional investigation.

2010-12-18  Matthias Bolte  <matthias.bolte@googlemail.com>

	vbox: Match struct layout of the MSCOM implementation on Windows

	vbox: Use stdcall convention for all COM methods on Windows
	MSCOM requires stdcall convention.

2010-12-18  Jean-Baptiste Rouault  <jean-baptiste.rouault@diateam.net>

	Add VMware Workstation and Player driver

2010-12-18  Eric Blake  <eblake@redhat.com>

	maint: improve tests distribution
	* tests/Makefile.am (EXTRA_DIST): Sort, and add directories.
	(SUBDIRS): Drop automake recursion into subdirs.
	* tests/commanddata/Makefile.am: Delete.
	* tests/confdata/Makefile.am: Likewise.
	* tests/sexpr2xmldata/Makefile.am: Likewise.
	* tests/xencapsdata/Makefile.am: Likewise.
	* tests/xmconfigdata/Makefile.am: Likewise.
	* tests/xml2sexprdata/Makefile.am: Likewise.

	build: fix typo that broke 'make dist'
	* src/Makefile.am (QEMU_DRIVER_SOURCES): Ship qemu_cgroup.h.

2010-12-18  Daniel P. Berrange  <dan@berrange.com>

	Update QEMU test cases for new file locations & API renames
	* qemuargv2xmltest.c, qemuhelptest.c,
	  qemuxml2argvtest.c, testutilsqemu.c: Update includes and
	  cope with API renames

2010-12-17  Daniel P. Berrange  <berrange@redhat.com>

	Move QEMU hotplug helper code out of the QEMU driver
	The QEMU driver file is far too large. Move all the hotplug
	helper code out into a separate file. No functional change.

	* src/qemu/qemu_hotplug.c, src/qemu/qemu_hotplug.h,
	  src/Makefile.am: Add hotplug helper file
	* src/qemu/qemu_driver.c: Delete hotplug code

2010-12-17  Daniel P. Berrange  <berrange@redhat.com>

	Move QEMU domain lock / job helper code to separate file
	To allow the APIs to be used from separate files, move the domain
	lock / job helper code into qemu_domain.c

	* src/qemu/qemu_domain.c, src/qemu/qemu_domain.h: Add domain lock
	  / job code
	* src/qemu/qemu_driver.c: Remove domain lock / job code

2010-12-17  Daniel P. Berrange  <berrange@redhat.com>

	Move QEMU driver lock helpers to a separate file
	To allow their use from other source files, move qemuDriverLock
	and qemuDriverUnlock to qemu_conf.h and make them non-static

	* src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Add qemuDriverLock
	  qemuDriverUnlock
	* src/qemu/qemu_driver.c: Remove qemuDriverLock and qemuDriverUnlock

2010-12-17  Daniel P. Berrange  <berrange@redhat.com>

	Move QEMU hostdev helper code out of the QEMU driver
	The QEMU driver file is far too large. Move all the hostdev
	helper code out into a separate file. No functional change.

	* src/qemu/qemu_hostdev.c, src/qemu/qemu_hostdev.h,
	  src/Makefile.am: Add hostdev helper file
	* src/qemu/qemu_driver.c: Delete hostdev code

2010-12-17  Daniel P. Berrange  <berrange@redhat.com>

	Move QEMU cgroup helper code out of the QEMU driver
	The QEMU driver file is far too large. Move all the cgroup
	helper code out into a separate file. No functional change.

	* src/qemu/qemu_cgroup.c, src/qemu/qemu_cgroup.h,
	  src/Makefile.am: Add cgroup helper file
	* src/qemu/qemu_driver.c: Delete cgroup code

2010-12-17  Daniel P. Berrange  <berrange@redhat.com>

	Move QEMU audit helper code out of the QEMU driver
	The QEMU driver file is far too large. Move all the audit
	helper code out into a separate file. No functional change.

	* src/qemu/qemu_audit.c, src/qemu/qemu_audit.h,
	  src/Makefile.am: Add audit helper file
	* src/qemu/qemu_driver.c: Delete audit code

2010-12-17  Daniel P. Berrange  <berrange@redhat.com>

	Move QEMU private data & namespace code into separate file
	Move the code for handling the QEMU virDomainObjPtr private
	data, and custom XML namespace into a separate file

	* src/qemu/qemu_domain.c, src/qemu/qemu_domain.h: New file
	  for private data & namespace code
	* src/qemu/qemu_driver.c, src/qemu/qemu_driver.h: Remove
	  private data & namespace code
	* src/qemu/qemu_driver.h, src/qemu/qemu_command.h: Update
	  includes
	* src/Makefile.am: Add src/qemu/qemu_domain.c

2010-12-17  Daniel P. Berrange  <berrange@redhat.com>

	Move QEMU command line management into a separate file
	The qemu_conf.c code is doing three jobs, driver config file
	loading, QEMU capabilities management and QEMU command line
	management. Move the command line code into its own file

	* src/qemu/qemu_command.c, src/qemu/qemu_command.h: New
	  command line management code
	* src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Delete command
	  line code
	* src/qemu/qemu_conf.h, src/qemu_conf.c: Adapt for API renames
	* src/Makefile.am: add src/qemu/qemu_command.c
	* src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_text.c: Add
	  import of qemu_command.h

2010-12-17  Daniel P. Berrange  <berrange@redhat.com>

	Move QEMU capabilities management into a separate file
	The qemu_conf.c code is doing three jobs, driver config file
	loading, QEMU capabilities management and QEMU command line
	management. Move the capabilities code into its own file

	* src/qemu/qemu_capabilities.c, src/qemu/qemu_capabilities.h: New
	  capabilities management code
	* src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Delete capabilities
	  code
	* src/qemu/qemu_conf.h: Adapt for API renames
	* src/Makefile.am: add src/qemu/qemu_capabilities.c

2010-12-17  Eric Blake  <eblake@redhat.com>

	maint: doc fix
	* src/libvirt.c: Avoid duplicate word.

2010-12-14  Hu Tao  <hutao@cn.fujitsu.com>

	Add a new function doStartCPUs

	Add a new function doStopCPUs

	Add a macro timeval_to_ms to compute micro seconds from timeval

2010-12-14  Jiri Denemark  <jdenemar@redhat.com>

	cpu: Unify CPUID data structures
	So far, CPUID data were stored in two different data structures. First
	of them was a structure allowing direct access for CPUID data according
	to function number and the second was a plain array of struct
	cpuX86cpuid. This was a silly design which resulted in converting data
	from one type to the other and back again or implementing similar
	functionality for both data structures.

	The patch leaves only the direct access structure. This makes the code
	both smaller and more maintainable since operations on different objects
	can use common low-level operations.

	All 57 tests for cpu subsystem still pass after this rewrite.

2010-12-14  Jiri Denemark  <jdenemar@redhat.com>

	util: Fix logical error in virReportSystemErrorFull

	util: Fix error message in __virExec
	Remove superfluous ": %s" suffix from the error message.

	daemon: Change CWD to / before daemonizing
	We were doing so for child processes but not for libvirtd itself.

2010-12-14  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Add support for storage volume cloning

2010-12-14  Eric Blake  <eblake@redhat.com>

	selinux: avoid memory overhead of matchpathcon
	https://bugzilla.redhat.com/show_bug.cgi?id=658657

	* src/security/security_selinux.c
	(SELinuxRestoreSecurityFileLabel): Use selabel_lookup instead of
	matchpathcon.
	Suggested by Daniel Walsh.

2010-12-14  Eric Blake  <eblake@redhat.com>

	daemon, threads: plug a memory leak
	* daemon/libvirtd.c (qemudStartWorker, qemudStartEventLoop): Avoid
	leaking pthread_attr resources.
	* src/util/threads-pthread.c (virThreadCreate): Likewise.

	tests: test Fedora 14 qemu-kvm -help parsing
	* tests/qemuhelpdata/qemu-kvm-0.13.0: New file.
	* tests/qemuhelptest.c (mymain): New test from Fedora 14 qemu-kvm,
	which covers some options (like -fstype passthrough) not tested elsewhere.

	tests: test RHEL 6.0 qemu-kvm -help parsing
	* tests/qemuhelpdata/qemu-kvm-0.12.1.2-rhel60: New file.
	* tests/qemuhelptest.c (mymain): New test from RHEL 6.0 qemu-kvm,
	which covers some options (like -vga=qxl) not tested elsewhere.
	* .x-sc_prohibit_empty_lines_at_EOF: Exempt qemu help output.

	sysinfo: convert to virCommand
	* src/util/sysinfo.c (virSysinfoRead): Use virCommand instead of
	virExec.

	sysinfo: formatting cleanups
	* src/util/sysinfo.c: Indentation and () fixups.

2010-12-14  Eric Blake  <eblake@redhat.com>

	build: allow mingw compilation with virCommand
	Allows compilation, but no creation of child processes yet.  Take it
	one step at a time.

	* src/util/util.c (virExecWithHook) [WIN32]: New dummy function.
	* src/libvirt_private.syms: Export it.

2010-12-14  Eric Blake  <eblake@redhat.com>

	build: update gnulib for pipe on mingw
	* .gnulib: Update to latest.
	* bootstrap.conf (gnulib_modules): Import pipe-posix and waitpid
	for mingw.
	* src/remote/remote_driver.c (pipe) [WIN32]: Drop dead macro.
	* daemon/event.c (pipe) [WIN32]: Drop dead function.

	test: fix commandtest under autobuild.sh
	* tests/commandtest.c (mymain): Kill off any leaked-in fds.
	* autobuild.sh: Don't leak fds.

2010-12-14  Diego Elio Pettenò  <flameeyes@gmail.com>

	build: quote AC_LANG_PROGRAM to avoid warnings with autoconf 2.68

2010-12-14  Diego Elio Pettenò  <flameeyes@gmail.com>

	build: properly handle ./configure --with-libpcap
	Without this fix, ./configure --with-libpcap will cause --with-libpcap=yes
	to be implicitly passed down, which cause yes/bin/pcap-config to be
	searched for rather than /usr/bin/pcap-config.

	Also output pcap: no when pcap is not found or disabled.

2010-12-14  Osier Yang  <jyang@redhat.com>

	qemu: Introduce two new job types
	Currently, all of domain "save/dump/managed save/migration"
	use the same function "qemudDomainWaitForMigrationComplete"
	to wait the job finished, but the error messages are all
	about "migration", e.g. when a domain saving job is canceled
	by user, "migration was cancled by client" will be throwed as
	an error message, which will be confused for user.

	As a solution, intoduce two new job types(QEMU_JOB_SAVE,
	QEMU_JOB_DUMP), and set "priv->jobActive" to "QEMU_JOB_SAVE"
	before saving, to "QEMU_JOB_DUMP" before dumping, so that we
	could get the real job type in
	"qemudDomainWaitForMigrationComplete", and give more clear
	message further.

	And as It's not important to figure out what's the exact job
	is in the DEBUG and WARN log, also we don't need translated
	string in logs, simply repace "migration" with "job" in some
	statements.

	* src/qemu/qemu_driver.c

2010-12-14  Laurent Léonard  <laurent@open-minds.org>

	Missing "Default-Stop" field in LSB comment in libvirt-guests
	The "Default-Stop" field in LSB comment in libvirt-guests is missing and should
	be added. I also suggests to add runlevel 2 to the "Default-Start" field.

	--
	Laurent Léonard

2010-12-14  Eric Blake  <eblake@redhat.com>

	daemon: plug a memory leak
	* daemon/libvirtd.c (qemudFreeClient): Avoid a leak.
	(qemudDispatchServer): Avoid null dereference.

2010-12-14  Roopa Prabhu  <roprabhu@cisco.com>

	802.1Qbh: Add support for IFLA_VF_MAC
	Current code does not pass VM mac address to a 802.1Qbh direct attach
	interface using IFLA_VF_MAC.  This patch adds support in macvtap code to
	send IFLA_VF_MAC netlink request during port profile association on a
	802.1Qbh interface.

	Stefan Cc'ed for comments because this patch changes a condition for
	802.1Qbg

	802.1Qbh support for IFLA_VF_MAC in enic driver has been posted and is
	pending acceptance at http://marc.info/?l=linux-netdev&m=129185244410557&w=2

2010-12-11  Eric Blake  <eblake@redhat.com>

	command: ease use with virBuffer, and fix qemu leak
	* src/util/command.h (virCommandAddArgBuffer)
	(virCommandAddEnvBuffer): New prototypes.
	* src/util/command.c (virCommandAddArgBuffer)
	(virCommandAddEnvBuffer): Implement them.
	* src/libvirt_private.syms (command.h): Export them.
	* src/qemu/qemu_conf.c (qemudBuildCommandLine): Use them, plugging
	a memory leak on rbd_hosts in the process.

	conf: plug memory leaks
	* src/conf/domain_conf.c (virDomainGraphicsDefParseXML)
	(virDomainDeviceVirtioSerialAddressParseXML)
	(virDomainDiskDefFree): Free various leaks.

	tests: plug memory leaks
	* tests/qemuxml2argvtest.c (testCompareXMLToArgvFiles): Don't
	allocate, since we don't use virDomainChrDefFree.

	virExec: avoid undefined behavior
	* src/util/util.c (__virExec): Don't use FD_ISSET on out-of-bounds fd.

2010-12-11  Laine Stump  <laine@laine.org>

	Convert dhcpStartDhcpDaemon from virRun to virCommand
	This is pretty straightforward - even though dnsmasq gets daemonized
	and uses a pid file, those things are both handled by the dnsmasq
	binary itself. And libvirt doesn't need any of the output of the
	dnsmasq command either, so we just setup the args and call
	virRun(). Mainly it was just a (mostly) mechanical job of replacing
	the APPEND_ARG() macro (and some other *printfs()) with
	virCommandAddArg*().

2010-12-11  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Refactor storage pool type lookup into a function

2010-12-11  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Improve error reporting for failed tasks
	Instead of just reporting that a task failed get the
	localized message from the TaskInfo error and include
	it in the reported error message.

	Implement minimal deserialization support for the
	MethodFault type in order to obtain the actual fault
	type.

	For example, this changes the reported error message
	when trying to create a volume with zero size from

	  Could not create volume

	to

	  Could not create volume: InvalidArgument - A specified parameter was not correct.

	Not perfect yet, but better than before.

2010-12-10  Eric Blake  <eblake@redhat.com>

	command: plug memory leak
	* src/util/command.c (virCommandFree): Free data from
	virCommandSetInputBuffer.

	build: distribute commandtest files
	* tests/Makefile.am (SUBDIRS): Add commanddata.
	* tests/commandtest.c (checkoutput): Delete correct file.
	(test4): Delete pid file.
	(mymain): Delete unused variable.
	* tests/commanddata/Makefile.am: New file.
	* configure.ac (AC_OUTPUT): Build new makefile.
	Reported by Dominik Klein.

2010-12-10  Hu Tao  <hutao@cn.fujitsu.com>

	Update documentation of watchdog dump option and add test data for it
	The xml watchdog dump option is converted to qemu watchdog pause arg
	but it is not reasonable to convert it back from qemu watchdog pause
	arg since there already is a xml watchdog pause option, so a test for
	the dump option to convert it from arg to xml is not added.

2010-12-10  Dan Kenigsberg  <danken@redhat.com>

	spec: do not start libvirt-guests if that service is off
	starting a service during rpm installation is impolite. It is even worse if done
	during upgrade, for a service that was explicitly turned off.

2010-12-10  Josh Durgin  <joshd@hq.newdream.net>

	tests: Add tests for network disks

	qemu: Add RBD support and some network disk fixes
	Changes common to all network disks:
	-Make source name optional in the domain schema, since NBD doesn't use it
	-Add a hostName type to the domain schema, and use it instead of genericName, which doesn't include .
	-Don't leak host names or ports
	-Set the source protocol in qemuParseCommandline

2010-12-10  MORITA Kazutaka  <morita.kazutaka@lab.ntt.co.jp>

	add network disk support
	This patch adds network disk support to libvirt/QEMU.  The currently
	supported protocols are nbd, rbd, and sheepdog.  The XML syntax is like
	this:

	    <disk type="network" device="disk">
	      <driver name="qemu" type="raw" />
	      <source protocol='rbd|sheepdog|nbd' name="...some image identifier...">
	        <host name="mon1.example.org" port="6000">
	        <host name="mon2.example.org" port="6000">
	        <host name="mon3.example.org" port="6000">
	      </source>
	      <target dev="vda" bus="virtio" />
	    </disk>

2010-12-10  Wen Congyang  <wency@cn.fujitsu.com>

	correct the signal's name
	The signal's name is wrong...

2010-12-10  Hu Tao  <hutao@cn.fujitsu.com>

	Add a watchdog action `dump'
	`dump' watchdog action lets libvirtd to dump the guest when receives a
	watchdog event (which probably means a guest crash)

	Currently only qemu is supported.

2010-12-10  Hu Tao  <hutao@cn.fujitsu.com>

	Add a new function doCoreDump
	This patch prepares for the next patch.

	threadpool impl
	* src/util/threadpool.c, src/util/threadpool.h: Thread pool
	  implementation
	* src/Makefile.am: Build thread pool
	* src/libvirt_private.syms: Export public functions

2010-12-10  Eric Blake  <eblake@redhat.com>

	command: avoid memory leak
	* src/util/command.c (virCommandRun): Fix yesterday's regression
	on logging, and avoid leaking log-only output captures.
	Reported by Hu Tao.

2010-12-09  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Distinguish between domain shutdown and crash
	When we get an EOF event on monitor connection, it may be a result of
	either crash or graceful shutdown. QEMU which supports async events
	(i.e., we are talking to it using JSON monitor) emits SHUTDOWN event on
	graceful shutdown. In case we don't get this event by the time monitor
	connection is closed, we assume the associated domain crashed.

2010-12-09  Ryan Harper  <ryanh@us.ibm.com>

	qemu: call drive_del in DetachPciDiskDevice
	Currently libvirt doesn't confirm whether the guest has responded to the
	disk removal request.  In some cases this can leave the guest with
	continued access to the device while the mgmt layer believes that it has
	been removed.  With a recent qemu monitor command[1] we can
	deterministically revoke a guests access to the disk (on the QEMU side)
	to ensure no futher access is permitted.

	This patch adds support for the drive_del() command and introduces it
	in the disk removal paths.  If the guest is running in a QEMU without this
	command we currently explicitly check for unknown command/CommandNotFound
	and log the issue.

	If QEMU supports the command we issue the drive_del command after we attempt
	to remove the device.  The guest may respond and remove the block device
	before we get to attempt to call drive_del.  In that case, we explicitly check
	for 'Device not found' from the monitor indicating that the target drive
	was auto-deleted upon guest responds to the device removal notification.

	1. http://thread.gmane.org/gmane.comp.emulators.qemu/84745

2010-12-09  Ryan Harper  <ryanh@us.ibm.com>

	qemu: call drive_unplug in DetachPciDiskDevice
	Currently libvirt doesn't confirm whether the guest has responded to the
	disk removal request.  In some cases this can leave the guest with
	continued access to the device while the mgmt layer believes that it has
	been removed.  With a recent qemu monitor command[1] we can
	deterministically revoke a guests access to the disk (on the QEMU side)
	to ensure no futher access is permitted.

	This patch adds support for the drive_unplug() command and introduces it
	in the disk removal paths.  There is some discussion to be had about how
	to handle the case where the guest is running in a QEMU without this
	command (and the fact that we currently don't have a way of detecting
	what monitor commands are available).

	Changes since v2:
	 - use VIR_ERROR to report when unplug command not found
	Changes since v1:
	 - return > 0 when command isn't present, < 0 on command failure
	 - detect when drive_unplug command isn't present and log error
	   instead of failing entire command

2010-12-09  Anthony Liguori  <aliguori@us.ibm.com>

	qemud: fix memory leak in io error events
	The extra data isn't being free()'d for IO error events that have a reason.

2010-12-08  Osier Yang  <jyang@redhat.com>

	qemu: Only build devstr when needs (attach PCI controller)
	- qemudDomainAttachPciControllerDevice: Don't build "devstr"
	  if "-device" of qemu is not available, as "devstr" will only
	  be used by "qemuMonitorAddDevice", which depends on "-device"
	  argument of qemu is supported.

	- "qemudDomainSaveImageOpen": Fix indent problem.

	* src/qemu/qemu_driver.c

2010-12-08  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Enable disabled debug messages

	qemu: Use -vga none only if it is supported
	Commit febc591683cf51e4551f8bcf3ce279a776056e1c introduced -vga none in
	case no video card is included in domain XML. However, old qemu
	versions do not support this and such domain cannot be successfully
	started.

2010-12-08  Justin Clift  <jclift@redhat.com>

	virsh: fix a typo in the memtune help description

	docs: updated virsh command reference download links to new version
	The new version lists every virsh command, its description, and
	the version of libvirt where it became available.

	configure: improve misleading libnl missing error message
	This fixes a misleading error message saying the libnl package
	needs to be installed, when it's really the libnl-devel package
	needing to be installed.

2010-12-08  Eric Blake  <eblake@redhat.com>

	maint: update to latest gnulib
	* .gnulib: Update to latest, for at least a stdint.h fix
	* src/storage/storage_driver.c (storageVolumeZeroSparseFile)
	(storageWipeExtent): Use better type, although it still triggers
	spurious -Wformat warning on MacOS's gcc.

2010-12-08  Justin Clift  <jclift@redhat.com>

	Moved the nodeinfo command to the 'host' help keyword group

2010-12-08  Eric Blake  <eblake@redhat.com>

	openvz: avoid potential buffer overflow
	* src/openvz/openvz_conf.c (openvzLoadDomains): Replace unsafe
	sscanf with safe direct parsing.
	(openvzGetVEID): Avoid lost integer overflow detection.
	(openvzAssignUUIDs): Likewise, and detect readdir failure.

2010-12-08  Eric Blake  <eblake@redhat.com>

	openvz: convert popen to virCommand
	popen must be matched with pclose (not fclose), or it will leak
	resources.  Furthermore, it is a lousy interface when it comes to
	signal handling.  We're much better off using our decent command
	wrapper.  Note that virCommand guarantees that VIR_FREE(outbuf) is
	both required and safe to call, whether virCommandRun succeeded or
	failed.

	* src/openvz/openvz_conf.c (openvzLoadDomains, openvzGetVEID):
	Replace popen with virCommand usage.

2010-12-08  Eric Blake  <eblake@redhat.com>

	command: improve behavior on no output
	Guarantee that outbuf/errbuf are allocated on success, even if to the
	empty string.  Caller always has to free the result, and empty output
	check requires checking if *outbuf=='\0'.  Makes the API easier to use
	safely.  Failure is best effort allocation (some paths, like
	out-of-memory, cannot allocate a buffer, but most do), so caller must
	free buffer on failure.

	* docs/internals/command.html.in: Update documentation.
	* src/util/command.c (virCommandSetOutputBuffer)
	(virCommandSetErrorBuffer, virCommandProcessIO) Guarantee empty
	string on no output.
	* tests/commandtest.c (test17): New test.

2010-12-08  Eric Blake  <eblake@redhat.com>

	command: enforce fd vs. buffer considerations
	* docs/internals/command.html.in: Better documentation of buffer
	vs. fd considerations.
	* src/util/command.c (virCommandRunAsync): Reject raw execution
	with string io.
	(virCommandRun): Reject execution with user-specified fds not
	visiting a regular file.

2010-12-08  Jiri Denemark  <jdenemar@redhat.com>

	tests: Fix commandtest in VPATH build

2010-12-08  Eric Blake  <eblake@redhat.com>

	tests: fix leaks in commandtest
	Most leaks could only occur on error cleanup paths.

	command: improve allocation failure reporting
	* src/util/command.c (virCommandAddEnvString): Remove duplicate
	code.
	(virCommandToString, virCommandRun, virCommandRunAsync)
	(virCommandWait): Report NULL command as ENOMEM, not invalid
	usage.
	Reported by Jiri Denemark.

2010-12-08  Jiri Denemark  <jdenemar@redhat.com>

	tests: Fix detection of expected error

	tests: Fix code formating in commandtest

2010-12-07  Eric Blake  <eblake@redhat.com>

	uuid: require smbios uuid and domain uuid to match
	* src/conf/domain_conf.c (virDomainDefParseXML): Prefer sysinfo
	uuid over generating one, and if both uuids are present, require
	them to be identical.
	* src/qemu/qemu_conf.c (qemuBuildSmbiosSystemStr): Allow skipping
	the uuid.
	(qemudBuildCommandLine): Adjust caller; <smbios mode=host/> must
	not use host uuid in place of guest uuid.

	smbios: allow () in smbios strings
	* docs/schemas/domain.rng (sysinf-value): Expand pattern.
	* tests/qemuxml2argvdata/qemuxml2argv-smbios.xml: Prefer '' over
	"" for attribute values.  Copy real hardware values.
	* tests/qemuxml2argvdata/qemuxml2argv-smbios.args: Likewise.

	smbios: support system family
	* docs/schemas/domain.rng (sysinfo-system-name): Also allow
	family.
	* src/util/sysinfo.h (struct _virSysinfoDef): Add system_family.
	* src/conf/domain_conf.c (virSysinfoParseXML)
	(virDomainSysinfoDefFormat): Support it.
	* src/util/sysinfo.c (virSysinfoDefFree, virSysinfoRead): Likewise.
	* src/qemu/qemu_conf.c (qemuBuildSmbiosSystemStr): Likewise.
	* tests/qemuxml2argvdata/qemuxml2argv-smbios.xml: Adjust test.
	* tests/qemuxml2argvdata/qemuxml2argv-smbios.args: Likewise.

2010-12-07  Eric Blake  <eblake@redhat.com>

	qemu: avoid adding "" in smbios arguments
	The log lists things like -smbios type=1,vendor="Red Hat", which
	is great for shell parsing, but not so great when you realize that
	execve() then passes those literal "" on as part of the command
	line argument, such that qemu sets SMBIOS with extra literal quotes.

	The eventual addition of virCommand is needed before we have the API
	to shell-quote a string representation of a command line, so that the
	log can still be pasted into a shell, but without inserting extra
	bytes into the execve() arguments.

	* src/qemu/qemu_conf.c (qemuBuildSmbiosBiosStr)
	(qemuBuildSmbiosSystemStr): Qemu doesn't like quotes around uuid
	arguments, and the remaining quotes are passed literally to
	smbios, making <smbios mode='host'/> inaccurate.  Removing the
	quotes makes the log harder to parse, but that can be fixed later
	with virCommand improvements.
	* tests/qemuxml2argvdata/qemuxml2argv-smbios.args: 'Fix' test; it
	will need fixing again once virCommand learns how to shell-quote a
	potential command line.

2010-12-07  Osier Yang  <jyang@redhat.com>

	virsh: Remove redundant commands in group domain
	"echo" is already in group "virsh", "freecell" and "hostname" are
	already in group "host", so remove them from group "domain"

	* tools/virsh.c

2010-12-07  Dan Kenigsberg  <danken@redhat.com>

	Fix funny off-by-one error in clock-variable
	Humans consider January as month #1, while gmtime_r(3) calls it month #0.

	While fixing it, render qemu's rtc parameter with leading zeros, as is more
	commonplace.

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

2010-12-07  Laurent Léonard  <laurent@open-minds.org>

	syntax error "Bad fd number" when stopping libvirt-guests
	When libvirt-guests is being stopped, I get the following message:
	$Running guests on default URI: test-vm
	$Suspending guests on default URI...
	$Suspending test-vm: /etc/init.d/libvirt-guests: 340: Syntax error: Bad fd
	number

2010-12-07  Eric Blake  <eblake@redhat.com>

	threads: add virThreadID for debugging use
	* src/util/threads.h (virThreadID): New prototype.
	* src/util/threads-pthread.c (virThreadID): New function.
	* src/util/threads-win32.c (virThreadID): Likewise.
	* src/libvirt_private.syms (threads.h): Export it.
	* daemon/event.c (virEventInterruptLocked): Use it to avoid
	warning on BSD systems.

2010-12-07  Osier Yang  <jyang@redhat.com>

	util: Fix bug which will cause libvirtd crash
	"virCommandRun": if "cmd->outbuf" or "cmd->errbuf" is NULL,
	libvirtd will be crashed when trying to start a qemu domain
	(which invokes "virCommandRun"), it caused by we try to use
	"*cmd->outbuf" and "*cmd->errbuf" regardless of cmd->outbuf
	or cmd->errbuf is NULL.

	* src/util/command.c (virCommandRun)

2010-12-06  Jiri Denemark  <jdenemar@redhat.com>

	tests: Don't ignore return value of getcwd()

	build: Fix internal docs generation in VPATH builds

2010-12-06  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Fix a possible deadlock in p2p migration
	Two more calls to remote libvirtd have to be surrounded by
	qemuDomainObjEnterRemoteWithDriver() and
	qemuDomainObjExitRemoteWithDriver() to prevent possible deadlock between
	two communicating libvirt daemons.

	See commit f0c8e1cb3774d6f09e2681ca1988bf235a343007 for further details.

2010-12-06  Jiri Denemark  <jdenemar@redhat.com>

	Change return value of VIR_DRV_SUPPORTS_FEATURE to bool
	virDrvSupportsFeature API is allowed to return -1 on error while all but
	one uses of VIR_DRV_SUPPORTS_FEATURE only check for (non)zero return
	value. Let's make this macro return zero on error, which is what
	everyone expects anyway.

2010-12-05  Matthias Bolte  <matthias.bolte@googlemail.com>

	qemu: Don't try to set input FD to -1

2010-12-04  Matthias Bolte  <matthias.bolte@googlemail.com>

	Implement virVMOperationType{To|From}String independent from WITH_MACVTAP
	As this symbols are exported independent from WITH_MACVTAP.

2010-12-03  Eric Blake  <eblake@redhat.com>

	build: avoid shadowing devname() on BSD systems
	* tools/virsh.c (cmdRunConsole, cmdConsole): Rename problematic
	symbol.
	Reported by Justin Clift.

2010-12-03  Osier Yang  <jyang@redhat.com>

	virsh: Remove redundant optional option for cmdHelp
	Remove the optional option "group", as cmdHelp should accepts
	only one option ("virsh help" supports both command and command
	group now, and user rarely uses the options, so it doesn't matter
	much for it being longer, :-)

	* tools/virsh.c

2010-12-03  Jean-Baptiste Rouault  <jean-baptiste.rouault@diateam.net>

	Create file in virFileWriteStr() if it doesn't exist
	This patch adds a mode_t parameter to virFileWriteStr().
	If mode is different from 0, virFileWriteStr() will try
	to create the file if it doesn't exist.

	* src/util/util.h (virFileWriteStr): Alter signature.
	* src/util/util.c (virFileWriteStr): Allow file creation.
	* src/network/bridge_driver.c (networkEnableIpForwarding)
	(networkDisableIPV6): Adjust clients.
	* src/node_device/node_device_driver.c
	(nodeDeviceVportCreateDelete): Likewise.
	* src/util/cgroup.c (virCgroupSetValueStr): Likewise.
	* src/util/pci.c (pciBindDeviceToStub, pciUnBindDeviceFromStub):
	Likewise.

2010-12-03  Justin Clift  <jclift@redhat.com>

	man pages: update the description for the virsh help command
	Now includes information on keyword usage, and provides examples.

2010-12-03  Osier Yang  <jyang@redhat.com>

	virsh: move two commands from domain group to storage pool group
	* tools/virsh.c (find-storage-pool-sources-as and find-storage-pool-sources
	should't be in command group "Domain Management", move them to group
	"Storage Pool".

2010-12-03  Daniel P. Berrange  <berrange@redhat.com>

	Remove bogus includes

	uml: convert to virCommand
	* src/uml/uml_conf.c (umlBuildCommandLineChr)
	(umlBuildCommandLine): Rewrite with virCommand.
	* src/uml/uml_conf.h (umlBuildCommandLine): Update signature.
	* src/uml/uml_driver.c (umlStartVMDaemon): Adjust caller.

2010-12-03  Eric Blake  <eblake@redhat.com>

	qemu: convert to virCommand
	* src/qemu/qemu_conf.c (qemudExtractVersionInfo): Check for file
	before executing it here, rather than in callers.
	(qemudBuildCommandLine): Rewrite with virCommand.
	* src/qemu/qemu_conf.h (qemudBuildCommandLine): Update signature.
	* src/qemu/qemu_driver.c (qemuAssignPCIAddresses)
	(qemudStartVMDaemon, qemuDomainXMLToNative): Adjust callers.

2010-12-03  Daniel P. Berrange  <berrange@redhat.com>

	Port hooks and iptables code to new command execution APIs
	This proof of concept shows how two existing uses of virExec
	and virRun can be ported to the new virCommand APIs, and how
	much simpler the code becomes

	virCommand: docs for usage of new command APIs
	* docs/internals/command.html.in: New file.
	* docs/Makefile.am: Build new docs.
	* docs/subsite.xsl: New glue file.
	* docs/internals.html.in, docs/sitemap.html.in: Update glue.

2010-12-03  Daniel P. Berrange  <berrange@redhat.com>

	Introduce new APIs for spawning processes
	This introduces a new set of APIs in src/util/command.h
	to use for invoking commands. This is intended to replace
	all current usage of virRun and virExec variants, with a
	more flexible and less error prone API.

	* src/util/command.c: New file.
	* src/util/command.h: New header.
	* src/Makefile.am (UTIL_SOURCES): Build it.
	* src/libvirt_private.syms: Export symbols internally.
	* tests/commandtest.c: New test.
	* tests/Makefile.am (check_PROGRAMS): Run it.
	* tests/commandhelper.c: Auxiliary program.
	* tests/commanddata/test2.log - test15.log: New expected outputs.
	* cfg.mk (useless_free_options): Add virCommandFree.
	(msg_gen_function): Add virCommandError.
	* po/POTFILES.in: New translation.
	* .x-sc_avoid_write: Add exemption.
	* tests/.gitignore: Ignore new built file.

2010-12-03  Eric Blake  <eblake@redhat.com>

	util: add virVasprintf
	* src/util/util.h (virVasprintf): New declaration.
	* src/util/util.c (virVasprintf): New function.
	(virAsprintf): Use it.
	* src/util/virtaudit.c (virAuditSend): Likewise.
	* src/libvirt_private.syms: Export it.
	* cfg.mk (sc_prohibit_asprintf): Also prohibit vasprintf.
	* .x-sc_prohibit_asprintf: Add exemption.

	util: fix saferead type
	* src/util/util.c (saferead): Fix return type.
	(safewrite): Fix indentation.

2010-12-02  Daniel P. Berrange  <berrange@redhat.com>

	Tweak daemon event debug to include errno
	* daemon/event.c: Include errno in debug info upon poll() failure

2010-12-02  Daniel P. Berrange  <berrange@redhat.com>

	Fix memory leak in logging setup
	The logging setup requires const char * strings, but the
	virLogSetFromEnv() strdup's the env variables, thus causing
	a memory leak

	* src/util/logging.c: Avoid strdup'ing env variables

2010-12-02  Jiri Denemark  <jdenemar@redhat.com>

	tests: Add tests for CPU selection in qemu driver

2010-12-02  Jiri Denemark  <jdenemar@redhat.com>

	tests: Support for faking emulator in qemuxml2argv
	This patch allows for using custom scripts instead of /usr/bin/qemu
	emulator in domain XML. To do so, one would specify relative path to the
	custom script in <emulator/>. The path needs to be relative to
	qemuxml2argvdata directory and it will be transparently made absolute in
	runtime. The expected command line needs to contain the exact relative
	path as was used in domain XML.

	The problem is RelaxNG schema for domain XML only allows for absolute
	path within <emulator/>. To workaround it, an extra '/' must be added at
	the beginning of the path. That is, instead of "./qemu.sh" or
	"../emulator/qemu.sh" one would use "/./qemu.sh" or
	"/../emulator/qemu.sh". The extra slash is removed before further
	processing. I don't like this workaround, it's very ugly but it's the
	best option I was able to come up with. Relaxing domain XML schema is
	not an option IMO.

2010-12-02  Jiri Denemark  <jdenemar@redhat.com>

	schemas: Fix cpu element schema
	Both vendor and topology elements are optional.

2010-12-02  Osier Yang  <jyang@redhat.com>

	virsh: Remove using phy as default disk driver in cmdAttachDisk
	* tools/virsh.c (virsh shouldn't use 'phy' as the disk driver if
	user doesn't specify "--driver", it causes bugs, as not all of
	hypervisor driver supports 'phy', and actually hypervisor should
	known the correct default disk driver and subdriver, so remove it)

2010-12-02  Eric Blake  <eblake@redhat.com>

	maint: update .gitignore
	* .gitignore: Ignore recent built file, sort.

2010-12-02  Guido Günther  <agx@sigxcpu.org>

	OpenVZ: drop fd leackage
	Drop unused (and unclosed) errfd and close outfd on exit. Otherwise
	polling the running domains with virt-manager let's us quickly run out
	of fds.

2010-12-02  Osier Yang  <jyang@redhat.com>

	qemu: Use macro for max and min vnc port instead of number
	* src/qemu/qemu_driver.c (though MACROS QEMU_VNC_PORT_MAX, and
	QEMU_VNC_PORT_MIN are defined at the beginning, numbers (65535, 5900)
	are still used, replace them)

2010-12-02  Osier Yang  <jyang@redhat.com>

	qemu: Fix typo in qemuTeardownDiskPathDeny
	typo in error message, it should be by copy-a-paste
	from "qemuSetupDiskPathAllow".

	* src/qemu/qemu_driver.c (qemuTeardownDiskPathDeny)

2010-12-02  Eric Blake  <eblake@redhat.com>

	qemu: plug memory leak
	* src/qemu/qemu_driver.c (qemudShutdown): Free all strings and the
	ebtables structure.
	* src/libvirt_private.syms (ebtablesContextFree): Export missing
	symbol.
	* src/util/ebtables.c (ebtablesContextFree): Allow early exit.

	libvirtd: avoid memory leak on shutdown
	* daemon/libvirtd.c (qemudRunLoop): Free any remaining client data.

2010-12-02  Daniel P. Berrange  <berrange@redhat.com>

	Fix flaw in thread creation APIs
	The arguments passed to the thread function must be allocated on
	the heap, rather than the stack, since it is possible for the
	spawning thread to continue before the new thread runs at all.
	In such a case, it is possible that the area of stack where the
	thread args were stored is overwritten.

	* src/util/threads-pthread.c, src/util/threads-win32.c: Allocate
	  thread arguments on the heap

2010-12-02  Osier Yang  <jyang@redhat.com>

	virsh: update help for "virsh help help"
	As virsh help supports both command and command group now,
	update "cmdHelp" to print consite help, (this patch is
	increment of "7829052757953023b0826e0293ffe18ed4ab89e9").

	And also remove redundant empty line in "vshUsage".

	* tools/virsh.c

2010-12-02  Matthias Bolte  <matthias.bolte@googlemail.com>

	Fix undefined symbol errors when macvtap support is disabled
	Use macvtap specific functions depending on WITH_MACVTAP.

	Use #if instead of #ifdef to check for WITH_MACVTAP, because
	WITH_MACVTAP is always defined with value 0 or 1.

	Also export virVMOperationType{To|From}String unconditional,
	because they are used unconditional in the domain config code.

2010-12-01  Jean-Baptiste Rouault  <jean-baptiste.rouault@diateam.net>

	Fix warning when macvtap support is disabled

2010-12-01  Justin Clift  <jclift@redhat.com>

	virsh: remove a badly placed line break in virsh -h output
	The output was previously:

	    -c | --connect <uri>    hypervisor connection URI
	    -r | --readonly         connect readonly
	    -d | --debug <num>      debug level [0-5]
	    -h | --help             this help
	    -q | --quiet            quiet mode
	    -t | --timing           print timing information
	    -l | --log <file>       output logging to file
	    -v | --version[=short]  program version

	    -V | --version=long     version and full options

	(note the blank line between the --version types)

	This patch removes the extra blank line.

2010-12-01  Jiri Denemark  <jdenemar@redhat.com>

	tests: Add unit tests for internal CPU APIs

	cpu: Add support for overriding path to CPU map XML file

2010-12-01  Hu Tao  <hutao@cn.fujitsu.com>

	Fall back to QEMUD_SAVE_FORMAT_RAW if compression method fails.
	When dumping a domain, it's reasonable to save dump-file in raw format
	if dump format is misconfigured or the corresponding compress program
	is not available rather then fail dumping.

2010-12-01  Osier Yang  <jyang@redhat.com>

	virsh: Categorize commands into groups for virsh help
	Change the virsh help out. The new output of "virsh help" and
	"virsh --help" will be like:

	 Secret (help keyword 'secret'):
	    secret-define                  define or modify a secret from an XML file
	    secret-dumpxml                 secret attributes in XML
	    secret-set-value               set a secret value
	    secret-get-value               Output a secret value
	    secret-undefine                undefine a secret
	    secret-list                    list secrets

	 Snapshot (help keyword 'snapshot'):
	    snapshot-create                Create a snapshot
	    snapshot-current               Get the current snapshot
	    snapshot-delete                Delete a domain snapshot
	    snapshot-dumpxml               Dump XML for a domain snapshot
	    snapshot-list                  List snapshots for a domain
	    snapshot-revert                Revert a domain to a snapshot

	Also support output help information of specified command group, e.g.

	% ./tools/virsh help "Network Filter"
	 Network Filter (help keyword 'filter'):
	    nwfilter-define                define or update a network filter from an XML file
	    nwfilter-undefine              undefine a network filter
	    nwfilter-dumpxml               network filter information in XML
	    nwfilter-list                  list network filters
	    nwfilter-edit                  edit XML configuration for a network filter

	Each group has a help keyword, e.g.

	% ./tools/virsh help filter
	 Network Filter (help keyword 'filter'):
	    nwfilter-define                define or update a network filter from an XML file
	    nwfilter-undefine              undefine a network filter
	    nwfilter-dumpxml               network filter information in XML
	    nwfilter-list                  list network filters
	    nwfilter-edit                  edit XML configuration for a network filter

	* tools/virsh.c:
	  - introduce new struct "vshCmdGrp" and macros to define the groups.
	  - split previous array "commands" into small arrays which are orgnized
	    by group
	  - changed some functions, e.g. "vshCmdDefSearch"
	  - Added new functions, e.g. "vshCmdGrpSearch"
	  - commands of each group are in "alphabetical order" now.
	  - command groups are in "alphabetical order" now.
	  - the commands are categorized with reference of
	    http://wiki.libvirt.org/page/VirshHelpV2 (by Justin)
	  - the modifications doesn't affect tests

	* TODO:
	  - doc

2010-12-01  Eric Blake  <eblake@redhat.com>

	maint: allow 'make syntax-check' to run again
	* cfg.mk (VC_LIST_ALWAYS_EXCLUDE_REGEX): Permanently exempt
	docs/news.html.in from all future syntax checks.

2010-12-01  Daniel Veillard  <veillard@redhat.com>

	Release of libvirt 0.8.6
	- configure.ac libvirt.spec.in: bump version, add a missing systemtap
	  build requirement
	- docs/news.html.in: add informations about the release
	- po/*: updated Polish and Dutch localizations, and regenerated
	- tests/qemuxml2argvtest.c: Fix build problem

2010-12-01  Stefan Berger  <stefanb@us.ibm.com>

	802.1Qbg: use pre-associate state at beginning of inc. migr
	This patch introduces the usage of the pre-associate state of the IEEE 802.1Qbg standard on incoming VM migration on the target host. It is in response to bugzilla entry 632750.

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

	For being able to differentiate the exact reason as to why a macvtap device is being created, either due to a VM creation or an incoming VM migration, I needed to pass that reason as a parameter from wherever qemudStartVMDaemon is being called in order to determine whether to send an ASSOCIATE (VM creation) or a PRE-ASSOCIATE (incoming VM migration) towards lldpad.

	I am also fixing a problem with the virsh domainxml-to-native call on the way.

	Gerhard successfully tested the patch with a recent blade network 802.1Qbg-compliant switch.

	The patch should not have any side-effects on the 802.1Qbh support in libvirt, but Roopa (cc'ed) may want to verify this.

2010-12-01  Guido Günther  <agx@sigxcpu.org>

	Ignore files generated by "make tags"

	OpenVZ: Fix some overwritten error codes
	Don't overwrite errors during domain creation/definition to ease
	tracking down problems.

2010-12-01  Guido Günther  <agx@sigxcpu.org>

	OpenVZ: take veid from vmdef->name when defining new domains
	We currently use the next free veid although there's one given in the
	domain xml. This currently breaks defining new domains since vmdef->name
	and veid don't match leading to the following error later on:

	    error: Failed to define domain from 110.xml
	    error: internal error Could not set UUID

	Since silently ignoring vmdef->name is not nice respect it instead. We
	avoid veid collisions in the upper levels already.

2010-11-30  Matthias Bolte  <matthias.bolte@googlemail.com>

	Log client errors in libvirtd at debug priority
	This reverts commit

	 Log all errors at level INFO to stop polluting syslog
	 04bd0360f32ec628ecf7943b3fd1468d6eb2dde5.

	and makes virRaiseErrorFull() log errors at debug priority
	when called from inside libvirtd. This stops libvirtd from
	polluting it's own log with client errors at error priority
	that'll be reported and logged on the client side anyway.

2010-11-30  Wen Congyang  <wency@cn.fujitsu.com>

	correct the arguments of migrate_speed
	When we set migrate_speed by json, we receive the following
	error message:
	libvirtError: internal error unable to execute QEMU command
	'migrate_set_speed': Invalid parameter type, expected: number

	The reason is that: the arguments of migrate_set_speed
	by json is json number, not json string.

2010-11-29  Jiri Denemark  <jdenemar@redhat.com>

	tests: Fix detection of expected errors

2010-11-29  Justin Clift  <jclift@redhat.com>

	docs: updated c# bindings with arnauds latest changes

2010-11-29  Daniel P. Berrange  <berrange@redhat.com>

	Fix memory leaks in audit & VirtualBox code
	* src/util/virtaudit.c: Free audit string
	* src/vbox/vbox_XPCOMCGlue.c: Free library name

2010-11-29  Daniel P. Berrange  <berrange@redhat.com>

	Remove bogus check for Xen in example program
	The dominfo.py example script has a bogus check for /proc/xen
	existing. The default connection cannot be assumed to be Xen
	any more

	* examples/python/dominfo.py: Remove check for Xen

2010-11-26  Jiri Denemark  <jdenemar@redhat.com>

	doc: Fix spelling of virBufferVSprintf

2010-11-25  Jiri Denemark  <jdenemar@redhat.com>

	Fix host CPU counting on unusual NUMA topologies
	The nodeinfo structure includes

	    nodes   : the number of NUMA cell, 1 for uniform mem access
	    sockets : number of CPU socket per node
	    cores   : number of core per socket
	    threads : number of threads per core

	which does not work well for NUMA topologies where each node does not
	consist of integral number of CPU sockets.

	We also have VIR_NODEINFO_MAXCPUS macro in public libvirt.h which
	computes maximum number of CPUs as (nodes * sockets * cores * threads).

	As a result, we can't just change sockets to report total number of
	sockets instead of sockets per node. This would probably be the easiest
	since I doubt anyone is using the field directly. But because of the
	macro, some apps might be using sockets indirectly.

	This patch leaves sockets to be the number of CPU sockets per node (and
	fixes qemu driver to comply with this) on machines where sockets can be
	divided by nodes. If we can't divide sockets by nodes, we behave as if
	there was just one NUMA node containing all sockets. Apps interested in
	NUMA should consult capabilities XML, which is what they probably do
	anyway.

	This way, the only case in which apps that care about NUMA may break is
	on machines with funky NUMA topology. And there is a chance libvirt
	wasn't able to start any guests on those machines anyway (although it
	depends on the topology, total number of CPUs and kernel version).
	Nothing changes at all for apps that don't care about NUMA.

2010-11-25  Philipp Hahn  <hahn@univention.de>

	Fix broken XML entity for '>'
	Add missing 'g' to '&gt;' of '<product />' source-element.

2010-11-25  Eric Blake  <eblake@redhat.com>

	security, storage: plug memory leaks for security_context_t
	security_context_t happens to be a typedef for char*, and happens to
	begin with a string usable as a raw context string.  But in reality,
	it is an opaque type that may or may not have additional information
	after the first NUL byte, where that additional information can
	include pointers that can only be freed via freecon().

	Proof is from this valgrind run of daemon/libvirtd:

	==6028== 839,169 (40 direct, 839,129 indirect) bytes in 1 blocks are definitely lost in loss record 274 of 274
	==6028==    at 0x4A0515D: malloc (vg_replace_malloc.c:195)
	==6028==    by 0x3022E0D48C: selabel_open (label.c:165)
	==6028==    by 0x3022E11646: matchpathcon_init_prefix (matchpathcon.c:296)
	==6028==    by 0x3022E1190D: matchpathcon (matchpathcon.c:317)
	==6028==    by 0x4F9D842: SELinuxRestoreSecurityFileLabel (security_selinux.c:382)

	800k is a lot of memory to be leaking.

	* src/storage/storage_backend.c
	(virStorageBackendUpdateVolTargetInfoFD): Avoid leak on error.
	* src/security/security_selinux.c
	(SELinuxReserveSecurityLabel, SELinuxGetSecurityProcessLabel)
	(SELinuxRestoreSecurityFileLabel): Use correct function to free
	security_context_t.

2010-11-25  Eric Blake  <eblake@redhat.com>

	network: plug memory leak
	* src/conf/network_conf.c (virNetworkDHCPRangeDefParseXML): Free
	xml strings when no longer referenced.

2010-11-25  Eric Blake  <eblake@redhat.com>

	maint: prohibit most uses of xmlGetProp
	Making this change makes it easier to spot the memory leaks
	that will be fixed in the next patch.

	* cfg.mk (sc_prohibit_xmlGetProp): New rule.
	* .x-sc_prohibit_xmlGetProp: New exception.
	* Makefile.am (EXTRA_DIST): Ship exception file.
	* tools/virsh.c (cmdDetachInterface, cmdDetachDisk): Adjust
	offenders.
	* src/conf/storage_conf.c (virStoragePoolDefParseSource):
	Likewise.
	* src/conf/network_conf.c (virNetworkDHCPRangeDefParseXML)
	(virNetworkIPParseXML): Likewise.

2010-11-25  Eric Blake  <eblake@redhat.com>

	qemu: plug memory leak
	https://bugzilla.redhat.com/show_bug.cgi?id=656795

	* src/qemu/qemu_monitor.c (qemuMonitorFree): Also free the buffer.

2010-11-25  Eric Blake  <eblake@redhat.com>

	maint: ensure syntax check exceptions are distributed
	* Makefile.am (EXTRA_DIST): Factor exceptions files...
	(syntax_check_excpetions): into new list.  Include recently added
	exceptions.
	* cfg.mk (sc_x_sc_dist_check): New check, copied from coreutils.

	build: enforce files.h usage
	* cfg.mk (sc_prohibit_close): New syntax-check rule.
	* src/util/pci.c (pciWaitForDeviceCleanup): Fix violation.
	* .x-sc_prohibit_close: New exceptions.
	* Makefile.am (EXTRA_DIST): Distribute new file.

2010-11-25  Matthias Bolte  <matthias.bolte@googlemail.com>

	Always close drivers when a virConnectPtr is released
	virConnectClose calls virUnrefConnect which in turn closes
	all open drivers when the refcount of that connection dropped
	to zero. This works fine when you free all other objects that
	hold a ref to the connection before you close it, because in
	this case virUnrefConnect is the one that removes the last
	ref to the connection.

	But it doesn't work when you close the connection first before
	freeing the other objects. This is because the other virUnref*
	functions call virReleaseConnect when they detect that the
	connection's refcount dropped to zero. In this case another
	virUnref* function (different from virUnrefConnect) removes the
	last ref to the connection. This results in not closing the
	open drivers and leaking things that should have been cleaned
	up in the driver close functions.

	To fix this move the driver close calls to virReleaseConnect.

2010-11-25  Osier Yang  <jyang@redhat.com>

	Implementations of virDomainIsUpdated for drivers except qemu
	Except LXC and UML driver, implementations of all other drivers
	simply return 0, because these drivers doesn't have config both
	in memory and on disk, no need to track if the domain of these
	drivers updated or not.

	Rename "xenUnifiedDomainisPersistent" to "xenUnifiedDomainIsPersistent"

	* esx/esx_driver.c
	* lxc/lxc_driver.c
	* opennebula/one_driver.c
	* openvz/openvz_driver.c
	* phyp/phyp_driver.c
	* test/test_driver.c
	* uml/uml_driver.c
	* vbox/vbox_tmpl.c
	* xen/xen_driver.c
	* xenapi/xenapi_driver.c

2010-11-24  Osier Yang  <jyang@redhat.com>

	implement callback function for qemu driver
	* src/qemu/qemu_driver.c (add function qemuDomainIsUpdated)

	implement the remote protocol
	* daemon/remote.c
	* daemon/remote_dispatch_args.h
	* daemon/remote_dispatch_prototypes.h
	* daemon/remote_dispatch_ret.h
	* daemon/remote_dispatch_table.h
	* src/remote/remote_driver.c
	* src/remote/remote_protocol.c
	* src/remote/remote_protocol.h
	* src/remote/remote_protocol.x
	* src/remote_protocol-structs

	implement public API virDomainIsUpdated
	* src/libvirt.c

	define internal driver API
	* src/driver.h (new typedef, new callback member for "_virDriver")
	* src/esx/esx_driver.c
	* src/lxc/lxc_driver.c
	* src/opennebula/one_driver.c
	* src/openvz/openvz_driver.c
	* src/phyp/phyp_driver.c
	* src/qemu/qemu_driver.c
	* src/remote/remote_driver.c
	* src/test/test_driver.c
	* src/uml/uml_driver.c
	* src/vbox/vbox_tmpl.c
	* src/xen/xen_driver.c
	* src/xenapi/xenapi_driver.c

2010-11-24  Osier Yang  <jyang@redhat.com>

	virDomainIsUpdated: define the new public API
	introduce new public API "virDomainIsUpdated"

	* src/conf/domain_conf.h (new member "updated" for "virDomainObj")
	* src/libvirt_public.syms
	* include/libvirt/libvirt.h.in

2010-11-24  Eric Blake  <eblake@redhat.com>

	maint: sort exports
	* src/libvirt_private.syms (buf.h): Sort.

2010-11-24  Matthias Bolte  <matthias.bolte@googlemail.com>

	remote: Fix TLS transport on Windows
	gnulib wraps Windows' SOCKET handle based send() and recv() functions
	into file descriptor based ones that are used in libvirt.

	Even though GnuTLS is using gnulib too, it explicitly doesn't use
	gnulib's replacement functions on Windows. By default GnuTLS uses the
	SOCKET handle based send() and recv(). This makes gnutls_handshake()
	fail internally with a WSAENOTSOCK error because libvirt passes a
	file descriptor; GnuTLS needs the SOCKET handle.

	To avoid this mismatch make sure that GnuTLS uses gnulib's replacment
	functions, by setting custom pull() and push() functions for GnuTLS.

2010-11-24  Cole Robinson  <crobinso@redhat.com>

	tests: Fix dispatching internal error reports
	Without this fix, the test suite doesn't print error messages when a libvirt
	function fails. Additionally, only print error reports if DEBUG or VERBOSE
	requested.

2010-11-23  Eric Blake  <eblake@redhat.com>

	libvirtd: fix bug when shrinking number of clients
	* daemon/libvirtd.c (qemudRunLoop): Pass allocation size, not
	current count, to VIR_SHRINK_N.
	* docs/hacking.html.in: Update doc example.
	* HACKING: Regenerate.

2010-11-23  Daniel P. Berrange  <berrange@redhat.com>

	Rename 'remove' param to 'toremove' to avoid clash with stdio.h
	The stdio.h header has a function called 'remove' declared. This
	clashes with the 'remove' parameter in virShrinkN

	* src/util/memory.c: Rename 'remove' to 'toremove'

2010-11-23  Daniel P. Berrange  <berrange@redhat.com>

	Fix 32-bit int truncation in QED header check
	* src/util/memory.c: Avoid 32-bit truncation extracting a 64bit int

2010-11-23  Daniel P. Berrange  <berrange@redhat.com>

	Fix error handling in virsh when listing storage volumes
	virsh was not checking for a error code when listing storage
	volumes. So when listing volumes in a pool that was shutoff,
	no output was displayed

	* tools/virsh.c: Fix error handling when listing volumes

2010-11-23  Daniel P. Berrange  <berrange@redhat.com>

	Improve SCSI volume name generation
	The SCSI volumes currently get a name like '17:0:0:1' based
	on $host:$bus:$target:$lun. The names are intended to be unique
	per pool and stable across pool restarts. The inclusion of the
	$host component breaks this, because the $host number for iSCSI
	pools is dynamically allocated by the kernel at time of login.
	This changes the name to be 'unit:0:0:1', ie removes the leading
	host component. The 'unit:' prefix is just to ensure the volume
	name doesn't start with a number and make it clearer when seen
	out of context.

	* src/storage/storage_backend_scsi.c: Improve volume name
	  field value stability and uniqueness

2010-11-23  Daniel P. Berrange  <berrange@redhat.com>

	Fix error codes returned when a storage pool is inactive
	Many operations are not valid on inactive storage pools. The
	storage driver is currently returning VIR_ERR_INTERNAL_ERROR
	in these cases, rather than the more suitable error code
	VIR_ERR_OPERATION_INVALID

	* src/storage/storage_driver.c: Fix error code when pool
	  is not active

2010-11-23  Daniel P. Berrange  <berrange@redhat.com>

	Check whether pools are already active upon libvirtd startup
	When libvirt starts up all storage pools default to the inactive
	state, even if the underlying storage is already active on the
	host. This introduces a new API into the internal storage backend
	drivers that checks whether a storage pool is already active. If
	the pool is active at libvirtd startup, the volume list will be
	immediately populated.

	* src/storage/storage_backend.h: New internal API for checking
	  storage pool state
	* src/storage/storage_driver.c: Check whether a pool is active
	  upon driver startup
	* src/storage/storage_backend_fs.c, src/storage/storage_backend_iscsi.c,
	  src/storage/storage_backend_logical.c, src/storage/storage_backend_mpath.c,
	  src/storage/storage_backend_scsi.c: Add checks for pool state

2010-11-23  Daniel P. Berrange  <berrange@redhat.com>

	Remove bogus port handling code in virsh
	The "find-storage-pool-sources-as" command takes two arguments,
	a hostname and a port number. For some reason the code would
	also then look for a port number appended to the hostname
	string by searching for ':'. This totally breaks if the user
	gives an IPv6 address, and is redundant, since you can already
	provide a port as a separate argument

	* tools/virsh.c: Remove bogus port number handling code

2010-11-23  Daniel P. Berrange  <berrange@redhat.com>

	Allow iSCSI IQN to be set with find-storage-pool-sources-as command
	Allow an iSCSI initiator IQN to be set with the XML for the
	find-storage-pool-sources-as virsh command

	* tools/virsh.c: Add iSCSI IQN support

2010-11-23  Daniel P. Berrange  <berrange@redhat.com>

	Switch the virsh XML generation to use virBuffer instead of virAsprintf
	The code generating XML for storage pool source discovery is
	hardcoded to only allow a hostname and optional port number.
	Refactor this code to make it easier to add support for extra
	parameters.

	* tools/virsh.c: Refactor XML generator

2010-11-23  Daniel P. Berrange  <berrange@redhat.com>

	Add support for iSCSI target auto-discovery
	Since the previous patch added support for parsing the output of
	the 'sendtargets' command, it is now trivial to support the
	storage pool discovery API.

	Given a hostname and optional portnumber and initiator IQN,
	the code can return a full list of storage pool source docs,
	each one representing a iSCSI target.

	* src/storage/storage_backend_iscsi.c: Wire up target
	  auto-discovery

2010-11-23  Daniel P. Berrange  <berrange@redhat.com>

	Stop iSCSI targets automatically logging back in after logout
	The Linux iSCSI initiator toolchain has the dubious feature that
	if you ever run the 'sendtargets' command to merely query what
	targets are available from a server, the results will be recorded
	in /var/lib/iscsi. Any time the '/etc/init.d/iscsi' script runs
	in the future, it will then automatically login to all those
	targets. /etc/init.d/iscsi is automatically run whenever a NIC
	comes online.

	So from the moment you ask a server what targets are available,
	your client will forever more automatically try to login to all
	targets without ever asking if you actually want it todo this.

	To stop this stupid behaviour, we need to run

	  iscsiadm --portal $PORTAL --target $TARGET
	   --op update --name node.startup --value manual

	For every target on the server.

	* src/storage/storage_backend_iscsi.c: Disable automatic login
	  for targets found as a result of a 'sendtargets' command

2010-11-23  Daniel P. Berrange  <berrange@redhat.com>

	Refactor iSCSI driver code to facilitate future changes
	The following series of patches are adding significant
	extra functionality to the iSCSI driver. THe current
	internal helper methods are not sufficiently flexible
	to cope with these changes. This patch refactors the
	code to avoid needing to have a virStoragePoolObjPtr
	instance as a parameter, instead passing individual
	target, portal and initiatoriqn parameters.

	It also removes hardcoding of port 3260 in the portal
	address, instead using the XML value if any.

	* src/storage/storage_backend_iscsi.c: Refactor internal
	  helper methods

2010-11-23  Daniel P. Berrange  <berrange@redhat.com>

	Fix parsing of port attribute in storage XML configuration
	The XML docs describe a 'port' attribute for the
	storage source <host> element, but the parser never
	handled it.

	* docs/schemas/storagepool.rng: Define port attribute
	* src/conf/storage_conf.c: Add missing parsing/formatting
	  of host port number
	* src/conf/storage_conf.h: Remove bogus/unused 'protocol' field

2010-11-23  Daniel P. Berrange  <berrange@redhat.com>

	Don't catch SIGCHLD in libvirtd
	libvirtd no longer deals with SIGCHLD in its signal handler
	since the QEMU driver switched to always daemonize processes.
	Thus remove the sigaction for it, to avoid warning log
	messages

	* daemon/libvirtd.c: Don't catch SIGCHLD

2010-11-23  Daniel P. Berrange  <berrange@redhat.com>

	Ensure logfile isn't truncated by shutdown message.
	When running non-root, the QEMU log file is usually opened with
	truncation, since there is no logrotate for non-root usage.
	This means that when libvirt logs the shutdown timestamp, the
	log is accidentally truncated

	* src/qemu/qemu_driver.c: Never truncate log file with shutdown
	  message

2010-11-23  Daniel P. Berrange  <berrange@redhat.com>

	Remove trailing ':' from timestamp
	The QEMU logger appends a ':' to the timestamp when it deems
	it neccessary, so the virTimestamp API should not duplicate
	this

	* src/util/util.c: Remove trailing ':' from timestamp

2010-11-23  Daniel P. Berrange  <berrange@redhat.com>

	Log all errors at level INFO to stop polluting syslog
	Everytime a public API returns an error, libvirtd pollutes
	syslog with that error message. Reduce the error logging
	level to INFO so these don't appear by default.

	* src/util/virterror.c: Log all errors at INFO

2010-11-23  Daniel P. Berrange  <berrange@redhat.com>

	Ensure virExec preserves logging environment
	The virFork call resets all logging handlers that may have been
	set. Re-enable them after fork in virExec, so that env variables
	fir LIBVIRT_LOG_OUTPUTS and LIBVIRT_LOG_FILTERS take effect
	until the execve()

	* src/util/util.c: Preserve logging in child in virExec

2010-11-23  Daniel P. Berrange  <berrange@redhat.com>

	Include a thread identifier in log messages
	To allow messages from different threads to be untangled,
	include an integer thread identifier in log messages.

	* src/util/logging.c: Include thread ID
	* src/util/threads.h, src/util/threads.h, src/util/threads-pthread.c:
	  Add new virThreadSelfID() function
	* configure.ac: Check for sys/syscall.h

2010-11-23  Cole Robinson  <crobinso@redhat.com>

	qemu: setvcpus: Save config changes to disk
	Currently changes to the persistent config aren't flushed to disk, meaning
	they are lost if the domain is redefined or libvirtd is restarted.

2010-11-23  Cole Robinson  <crobinso@redhat.com>

	qemu: setvcpus: Simplify altering the persistent config
	Do this by adding a helper function to get the persistent domain config. This
	should be useful for other functions that may eventually want to alter
	the persistent domain config (attach/detach device). Also make similar changes
	to the test drivers setvcpus command.

	A caveat is that the function will return the running config for a transient
	domain, rather than error. This simplifies callers, as long as they use
	other methods to ensure the guest is persistent.

2010-11-23  Cole Robinson  <crobinso@redhat.com>

	qemu: setvcpus: Fix maxvcpus check
	Doing 'virsh setvcpus $vm --config 10' doesn't check the value against the
	domains maxvcpus value. A larger value for example will prevent the guest
	from starting.

	Also make a similar change to the test driver.

2010-11-23  Cole Robinson  <crobinso@redhat.com>

	conf: domain: Improve vcpus validation reporting

2010-11-23  Cole Robinson  <crobinso@redhat.com>

	Make state driver device hotplug/update actually transient
	The current semantics of non-persistent hotplug/update are confusing: the
	changes will persist as long as the in memory domain definition isn't
	overwritten. This means hotplug changes stay around until the domain is
	redefined or libvirtd is restarted.

	Call virDomainObjSetDefTransient at VM startup, so that we properly discard
	hotplug changes when the VM is shutdown.

2010-11-23  Cole Robinson  <crobinso@redhat.com>

	domain_conf: Add virDomainObjSetDefTransient
	This function sets the running domain definition as transient, by reparsing
	the persistent config and assigning it to newDef. This ensures that any
	changes made to the running definition and not the persistent config are
	discarded when the VM is shutdown.

	xend: Escape reserved sexpr characters
	If we don't escape ' or \ xend can't parse the generated sexpr. This
	might over apply the EscapeSexpr routine, but it shouldn't hurt.

	buf: Simplify virBufferEscapeString
	We are about to copy this function, so clean it up before we do.

	xend: urlencode: Properly escape '&'
	Since we send the sexpr to xend via HTTP, we need to properly escape
	'&'

	conf: Fix parsing python style triple quotes
	An incorrect check broke matching the closing set of quotes. Update
	tests to cover this case for XM config files.

	conf: Convert ParseString to use STRPREFIX

	schemas: domain: Add more valid file path chars
	Also, standardize path usage on 'filePath' and 'absFilePath'

2010-11-23  Adam Litke  <agl@us.ibm.com>

	qed: Minor updates to QED support patches
	This patch makes two corrections to the newly-added QED support patch series:

	 - Correct the QED header field offsets
	 - Remove XML parsing for VIR_STORAGE_FILE_AUTO_SAFE

2010-11-22  Justin Clift  <jclift@redhat.com>

	docs: removed outdated reference to virt-mem
	The virt-mem program is no longer shipped, but was still being
	referenced at the bottom of the virsh and libvirtd man pages.

	This patch removes it from those man pages, addressing
	BZ# 639603:

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

2010-11-20  Stefan Berger  <stefanb@us.ibm.com>

	nwfilter: re-order lock grabbed by IP addr. learn thread
	The IP address learning thread was causing a deadlock when it instantiated a filter while a filter update/change was ongoing. The reason for this was the ordering of locks due to the following calls

	virNWFilterUnlockFilterUpdates()
	virNWFilterPoolObjFindByName()

	The below patch now puts the order of the locks in the above shown order when instantiating the filter from the IP address learning thread.

2010-11-20  Adam Litke  <agl@us.ibm.com>

	Support for probing qed image metadata
	Implement getBackingStore() for QED images.  The header format is defined in
	the QED spec: http://wiki.qemu.org/Features/QED .

	Cc: Stefan Hajnoczi <stefan.hajnoczi@uk.ibm.com>
	Cc: Anthony Liguori <aliguori@linux.vnet.ibm.com>

2010-11-20  Adam Litke  <agl@us.ibm.com>

	storage_file: Add a new flag to mark backing files that are safe to probe

2010-11-20  Adam Litke  <agl@us.ibm.com>

	QED: Basic support for QED images
	Add an entry in fileTypeInfo for QED image files.

	Cc: Stefan Hajnoczi <stefan.hajnoczi@uk.ibm.com>
	Cc: Anthony Liguori <aliguori@linux.vnet.ibm.com>

2010-11-20  Adam Litke  <agl@us.ibm.com>

	Allow probing of image formats without version information
	Disk image formats that wish to opt-out of version validation are supposed to
	set versionOffset to -1 in their fileTypeInfo entry.

	By unconditionally returning False for these formats,
	virStorageFileMatchesVersion() incorrectly reports a version mismatch when the
	test was actually skipped.  The correct behavior is to return True so these
	formats can be successfully probed using the magic bytes alone.

2010-11-19  Eric Blake  <eblake@redhat.com>

	maint: tighten strncmp syntax check
	Using 'int ret = strcmp(a, b)' in a qsort function is a valid use of
	str[n]cmp that should _not_ be turned to STREQ, but it was falling
	foul of our specific syntax-check.  Meanwhile, gnulib's maint.mk
	already has a tighter bound for strcmp, so we can copy that regex and
	just check for strncmp, which results in fewer false positives that
	require exceptions.

	* cfg.mk (sc_prohibit_strcmp_and_strncmp): Rename...
	(sc_prohibit_strncmp): ...to this, and tighten, to mirror
	maint.mk's sc_prohibit_strcmp's better regex.
	* Makefile.am (syntax_check_exceptions): Update exception rule.
	* .x-sc_prohibit_strcmp_and_strncmp: Rename...
	* .x-sc_prohibit_strncmp: ...and trim.

2010-11-19  Daniel P. Berrange  <berrange@redhat.com>

	virExec: fix bug in setting up child stderr/out with /dev/null

2010-11-19  Eric Blake  <eblake@redhat.com>

	capabilities, cpu: use new array API
	* src/conf/capabilities.h (_virCaps, _virCapsHost, _virCapsGuest)
	(_virCapsGuestArch): Add additional fields.
	* src/conf/cpu_conf.h (_virCPUDef): Likewise.
	* src/conf/capabilities.c (virCapabilitiesFormatXML): Reflect
	updated type.
	(virCapabilitiesAddGuest, virCapabilitiesAddHostFeature)
	(virCapabilitiesAddHostMigrateTransport)
	(virCapabilitiesAddHostNUMACell, virCapabilitiesAddGuestFeature)
	(virCapabilitiesAddGuestDomain): Use new array APIs.
	* src/conf/cpu_conf.c (virCPUDefAddFeature, virCPUDefCopy)
	(virCPUDefParseXML): Likewise.
	* tests/testutilsqemu.c (testQemuCapsInit): Adjust test.

	daemon: use safer memory growth macros
	* daemon/libvirtd.h (qemud_server): Change types of members
	tracking array sizes, and add allocation trackers.
	* daemon/event.c (virEventLoop): Likewise.
	(virEventAddHandleImpl, virEventAddTimeoutImpl)
	(virEventCleanupTimeouts, virEventCleanupHandles): Use
	VIR_RESIZE_N instead of VIR_REALLOC_N.  Tweak debug messages to
	match type changes.
	* daemon/libvirtd.c (qemudDispatchServer, qemudRunLoop): Likewise.

	memory: make it easier to avoid quadratic scaling of arrays
	* src/util/memory.h (VIR_RESIZE_N): New macro.
	* src/util/memory.c (virResizeN): New function.
	* src/libvirt_private.syms: Export new helper.
	* docs/hacking.html.in: Document it.
	* HACKING: Regenerate.

	memory: make it safer to expand arrays
	* src/util/memory.h (VIR_REALLOC_N): Update docs.
	(VIR_EXPAND_N, VIR_SHRINK_N): New macros.
	(virAlloc, virAllocN, virReallocN, virAllocVar, virFree): Add some
	gcc attributes.
	* src/util/memory.c (virExpandN, virShrinkN): New functions.
	(virReallocN): Update docs.
	* src/libvirt_private.syms: Export new helpers.
	* docs/hacking.html.in: Prefer newer interfaces over
	VIR_REALLOC_N, since uninitialized memory can bite us.
	* HACKING: Regenerate.

2010-11-19  Osier Yang  <jyang@redhat.com>

	doc: Add doc for missed options of migrate
	* tools/virsh.pod (add doc for options like "--p2p", "--direct",
	"--copy-storage-all", "dname", etc.)

	doc: add doc for missed parameters of attach-disk
	* tools/virsh.pod (add docs for --persistent and --sourcetype
	of attach-disk, break the long lines in the meantime)

2010-11-19  Daniel Veillard  <veillard@redhat.com>

	Fix a failure to restore SELinux label for character devices
	The code in SELinuxRestoreSecurityChardevLabel() was trying to
	use SELinuxSetFilecon directly for devices or file types while
	it should really use SELinuxRestoreSecurityFileLabel encapsulating
	routine, which avoid various problems like resolving symlinks,
	making sure he file exists and work around NFS problems

2010-11-18  Matthias Bolte  <matthias.bolte@googlemail.com>

	virt-aa-helper: Fix several compile errors
	Include locale.h for setlocale().

	Revert the usage string back to it's original form.

	Use puts() instead of fputs(), as fputs() expects a FILE*.

	Add closing parenthesis to some vah_error() calls.

	Use argv[0] instead of an undefined argv0.

2010-11-18  Eric Blake  <eblake@redhat.com>

	build: fix autobuild failures on gcov upgrade
	Last time I ran ./autobuild.sh was on F13; and upgrading to F14
	exposed these leftovers due to a newer gcov than what was in the stale
	files, in the form of spurious messages that break 'make check':

	+profiling:/home/remote/eblake/libvirt-tmp/tools/virsh-console.gcda:Version mismatch - expected 405R got 404R

	and concluding with a bug in the autobuild.sh script itself:

	./autobuild.sh: line 44: test: =: unary operator expected

	* autobuild.sh: avoid syntax error on failed test
	* tools/Makefile.am (CLEANFILES): Clean coverage files.

2010-11-18  Osier Yang  <jyang@redhat.com>

	doc: update virsh manual
	* tools/virsh.pod (change things like "edit domain.xml" into
	  "vi domain.xml", so that it's more clear for user)

2010-11-18  Eric Blake  <eblake@redhat.com>

	maint: avoid remaining sprintf uses
	* cfg.mk (sc_prohibit_sprintf): New rule.
	(sc_prohibit_asprintf): Avoid false positives.
	* docs/hacking.html.in (Printf-style functions): Document the
	policy.
	* HACKING: Regenerate.
	* .x-sc_prohibit_sprintf: New exemptions.
	* Makefile.am (syntax_check_exceptions): Ship new file.
	* src/vbox/vbox_tmpl.c (vboxStartMachine, vboxAttachUSB): Use
	virAsprintf instead.
	* src/uml/uml_driver.c (umlOpenMonitor): Use snprintf instead.
	* tools/virsh.c (cmdDetachInterface): Likewise.
	* src/security/security_selinux.c (SELinuxGenSecurityLabel):
	Likewise.
	* src/openvz/openvz_driver.c (openvzDomainDefineCmd): Likewise,
	and ensure large enough buffer.

2010-11-18  Eric Blake  <eblake@redhat.com>

	virt-aa-helper: translate error messages
	These messages are visible to the user, so they should be
	consistently translated.

	* cfg.mk (msg_gen_function): Add vah_error, vah_warning.
	* src/security/virt-aa-helper.c: Translate messages.
	(catchXMLError): Fix capitalization.

2010-11-18  Eric Blake  <eblake@redhat.com>

	maint: update to latest gnulib
	Allows bootstrap to work on FreeBSD, where gzip doesn't have a '.'
	in its version; and silences false positives in the new
	'make syntax-check' rule.

	* .gnulib: Update to latest.
	* bootstrap: Synchronize to upstream.
	* .x-sc_bindtextdomain: New exemptions.
	* Makefile.am (syntax_check_exceptions): Ship new file.
	* .gitignore: Regenerate per latest bootstrap, anchor entries that
	are only in the root directory, and consolidate entries from other
	generated .gitignore files.
	* build-aux/.gitignore, m4/.gitignore, po/.gitignore: Remove from
	version control, since bootstrap generates them.

2010-11-18  Eric Blake  <eblake@redhat.com>

	maint: improve i18n on non-Linux
	Per the gettext developer:
	http://lists.gnu.org/archive/html/bug-gnu-utils/2010-10/msg00019.html
	http://lists.gnu.org/archive/html/bug-gnu-utils/2010-10/msg00021.html

	gettext() doesn't work correctly on all platforms unless you have
	called setlocale().  Furthermore, gnulib's gettext.h has provisions
	for setting up a default locale, which is the preferred method for
	libraries to use gettext without having to call textdomain() and
	override the main program's default domain (virInitialize already
	calls bindtextdomain(), but this is insufficient without the
	setlocale() added in this patch; and a redundant bindtextdomain()
	in this patch doesn't hurt, but serves as a good example for other
	packages that need to bind a second translation domain).

	This patch is needed to silence a new gnulib 'make syntax-check'
	rule in the next patch.

	* daemon/libvirtd.c (main): Setup locale and gettext.
	* src/lxc/lxc_controller.c (main): Likewise.
	* src/security/virt-aa-helper.c (main): Likewise.
	* src/storage/parthelper.c (main): Likewise.
	* tools/virsh.c (main): Fix exit status.
	* src/internal.h (DEFAULT_TEXT_DOMAIN): Define, for gettext.h.
	(_): Simplify definition accordingly.
	* po/POTFILES.in: Add src/storage/parthelper.c.

2010-11-17  Eric Blake  <eblake@redhat.com>

	maint: use gnulib configmake rather than open-coding things
	* bootstrap.conf (gnulib_modules): Add configmake.
	* daemon/Makefile.am (libvirtd_CFLAGS): Drop defines provided by
	gnulib.
	* src/Makefile.am (INCLUDES): Likewise.
	* tests/Makefile.am (INCLUDES): Likewise.
	* tools/Makefile.am (virsh_CFLAGS): Likewise.
	* daemon/libvirtd.c (qemudInitPaths, usage, main): Update
	clients.
	* src/cpu/cpu_map.c (CPUMAPFILE): Likewise.
	* src/driver.c (DEFAULT_DRIVER_DIR): Likewise.
	* src/internal.h (_): Likewise.
	* src/libvirt.c (virInitialize): Likewise.
	* src/lxc/lxc_conf.h (LXC_CONFIG_DIR, LXC_STATE_DIR, LXC_LOG_DIR):
	Likewise.
	* src/lxc/lxc_conf.c (lxcCapsInit, lxcLoadDriverConfig):
	Likewise.
	* src/network/bridge_driver.c (NETWORK_PID_DIR)
	(NETWORK_STATE_DIR, DNSMASQ_STATE_DIR, networkStartup): Likewise.
	* src/nwfilter/nwfilter_driver.c (nwfilterDriverStartup):
	Likewise.
	* src/qemu/qemu_conf.c (qemudLoadDriverConfig): Likewise.
	* src/qemu/qemu_driver.c (qemudStartup): Likewise.
	* src/remote/remote_driver.h (LIBVIRTD_PRIV_UNIX_SOCKET)
	(LIBVIRTD_PRIV_UNIX_SOCKET_RO, LIBVIRTD_CONFIGURATION_FILE)
	(LIBVIRT_PKI_DIR): Likewise.
	* src/secret/secret_driver.c (secretDriverStartup): Likewise.
	* src/security/security_apparmor.c (VIRT_AA_HELPER): Likewise.
	* src/security/virt-aa-helper.c (main): Likewise.
	* src/storage/storage_backend_disk.c (PARTHELPER): Likewise.
	* src/storage/storage_driver.c (storageDriverStartup): Likewise.
	* src/uml/uml_driver.c (TEMPDIR, umlStartup): Likewise.
	* src/util/hooks.c (LIBVIRT_HOOK_DIR): Likewise.
	* tools/virsh.c (main): Likewise.
	* docs/hooks.html.in: Likewise.

2010-11-17  Stefan Berger  <stefanb@us.ibm.com>

	replace last instances of close()
	I am replacing the last instances of close() I found with VIR_CLOSE() / VIR_FORCE_CLOSE respectively.

	The first part patches virsh, which I missed out on previously.

	The 2nd patch I had left out intentionally to look at it more carefully:
	The 'closed' variable could be easily removed since it wasn't used anywhere else. The possible race condition that could result from the filedescriptor being closed and not set to -1 (and possibly let us write into 'something' totally different if the fd was allocated by another thread) seems to be prevented by the qemuMonitorLock() already placed around the code that reads from or writes to the fd. So the change of this code as shown in the patch should not have any side-effects.

2010-11-17  Stefan Berger  <stefanb@us.ibm.com>

	nwfilter: also purge ip(6)tables rules before detecting IP address
	Rather than only cleaning any remaining ebtables rules, also clean those applied to iptables and ip6tables when detecting the IP address of an interface. Previous applied iptables rules may hinder DHCP packets.

2010-11-17  Stefan Berger  <stefanb@us.ibm.com>

	deprecate fclose() and introduce VIR_{FORCE_}FCLOSE()
	Similarly to deprecating close(), I am now deprecating fclose() and
	introduce VIR_FORCE_FCLOSE() and VIR_FCLOSE(). Also, fdopen() is replaced with
	VIR_FDOPEN().

	Most of the files are opened in read-only mode, so usage of
	VIR_FORCE_CLOSE() seemed appropriate. Others that are opened in write
	mode already had the fclose()<  0 check and I converted those to
	VIR_FCLOSE()<  0.

	I did not find occurrences of possible double-closed files on the way.

2010-11-17  Osier Yang  <jyang@redhat.com>

	daemon: fix indention problem in daemon/libvirt.c
	* daemon/libvirtd.c

	qemu: fix typos in qemu_monitor_text.c
	* src/qemu/qemu_monitor_text.c (qemuMonitorTextChangeMedia)

2010-11-17  Osier Yang  <jyang@redhat.com>

	qemu: record timestamp in qemu domain log
	Currently only support domain start and shutdown, for domain start,
	record timestamp before the qemu command line, and for domain shutdown,
	just say it's shutting down with timestamp.

	* src/qemu/qemu_driver.c (qemudStartVMDaemon, qemudShutdownVMDaemon
	  introduced two macros - START_POSTFIX, SHUTDOWN_POSTFIX)

2010-11-17  Osier Yang  <jyang@redhat.com>

	virsh: add net-info command
	To list basic information about the network.

	* tools/virsh.c
	* tools/virsh.pod

2010-11-16  Eric Blake  <eblake@redhat.com>

	nwfilter: use /bin/sh rather than requiring bash
	* src/nwfilter/nwfilter_ebiptables_driver.c (CMD_EXEC): Fix syntax
	error in previous patch.
	Reported by Stefan Berger.

	nwfilter: use /bin/sh rather than requiring bash
	* src/nwfilter/nwfilter_ebiptables_driver.c
	(ebiptablesWriteToTempFile): Use /bin/sh.
	(bash_cmd_path): Delete.
	(ebiptablesDriverInit, ebiptablesDriverShutdown): No need to
	search for bash.
	(CMD_EXEC): Prefer $() over ``, since we can assume POSIX.
	(iptablesSetupVirtInPost): Use portable 'test' syntax.
	(iptablesLinkIPTablesBaseChain): Use POSIX $(()) syntax.

2010-11-16  Laine Stump  <laine@laine.org>

	interface.rng: Make miimon and arpmon optional for bond interfaces
	This has been optional in netcf for awhile, but the change hadn't been
	propogated to the libvirt copy of the RNG.

2010-11-16  Stefan Berger  <stefanb@us.ibm.com>

	macvtap: convert send / recv function to use libnl
	In a second step I am converting the netlink send/receive functions to
	use libnl.

	I tested this with 802.1Qbg profiles and my test server and did not see
	a regression.

	Caveat: The online documentation of libnl talks about nl_socket_alloc()
	but the header file provides nl_handle_alloc() -- this could be a hint
	to a possible problem between libnl versions...

	http://www.infradead.org/~tgr/libnl/doc/group__socket.html

	versus

	http://libnl.sourcearchive.com/documentation/1.1/group__socket_gf903c9ea089735b1ba8e40dae801c47d.html

2010-11-16  Laine Stump  <laine@laine.org>

	Fix ipv4-addr definition in interface.rng
	Eric Blake pointed out a deficiency in this regex when it was
	copy-pasted into network.rng. This is just propogating the fix back to
	its origin.

2010-11-15  Matthias Bolte  <matthias.bolte@googlemail.com>

	Use python discovered through env instead of hardcoding a path
	This is more flexible regarding the location of the python binary
	but doesn't allow to pass the -u flag. The -i flag can be passed
	from inside the script using the PYTHONINSPECT env variable.

	This fixes a problem with the esx_vi_generator.py on FreeBSD.

2010-11-15  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Avoid warnings about breaking strict-aliasing rules on FreeBSD

	Make sure struct sockaddr_in is defined on FreeBSD

	configure: Disable FS storage driver if mntent.h is not available
	This is the case on FreeBSD.

	daemon: Include stdlib.h in dispatch.c
	Otherwise GCC complains about malloc being unknown on FreeBSD.

2010-11-13  Justin Clift  <jclift@redhat.com>

	docs: updated virsh command reference with libvirt.org links

2010-11-13  Matthias Bolte  <matthias.bolte@googlemail.com>

	configure: Remove bashism and replace 'test ==' with 'test ='
	This also fixes configure problems on FreeBSD, as test doesn't
	understand '==' there.

	virsh: Fix compile error in VPATH build
	tools/console.c depends on daemon/event.h.

	Generate HACKING from docs/hacking.html.in

	docs: Prepare hacking.html.in to generate HACKING from it
	Tweak pre tags to achieve proper indentation of their
	plaintext representation. Also use more b/i/code tags.

2010-11-13  Justin Clift  <jclift@redhat.com>

	docs: updated csharp pages with latest info

	docs: trivial typo fix

	docs: added virsh command reference page.
	Using temporary location links for the moment, until we get a
	proper place to store the files on the libvirt.org server.

2010-11-12  Cole Robinson  <crobinso@redhat.com>

	rpm: Fix summary wording

2010-11-12  John Morrissey  <jwm@horde.net>

	qemu: Remove unnecessary quoting from the process name argument

2010-11-12  Matthias Bolte  <matthias.bolte@googlemail.com>

	phyp: Don't do a flags check in the storage driver
	This makes the storage driver fail when the connection is
	opened with the VIR_CONNECT_RO flag, resulting in a read-only
	connection with no storage driver.

	qemu: Add qemu-system-s390x to the emulators list

2010-11-12  Stefan Berger  <stefanb@us.ibm.com>

	macvtap: convert nl msg construction to use libnl
	In a first step I am converting the netlink message construction in
	macvtap code to use libnl. It's pretty much a 1:1 conversion except that
	now the message needs to be allocated and deallocated.

2010-11-12  Laine Stump  <laine@laine.org>

	Do a better job of validating IP and MAC addresses in network.rng
	IP addresses and MAC addresses had been defined in the RNG simply as
	<text/> meaning that, according to the RNG, any string could go in
	there. Of course the C parsing code does a much better job of
	validating, but we may as well have this describing the contents
	accurately (even though it's currently only used during "make check").

	re-indent network.rng following structural change
	This commit is whitespace changes only, do avoid obscuring actual code
	changes.

2010-11-12  Laine Stump  <laine@laine.org>

	Put network.rng contents inside <grammar> for uniformity with other RNGs
	All the other RNG files in libvirt are enclosed within <grammar>. This
	commit makes the syntactical changes necessary to make network.rng fit
	that pattern. (This is the first step in adding some data type
	definitions to network.rng for more exact validation of IP and MAC
	addresses).

	Formatting changes (indentation) will be done in a subsequent commit,
	so that actual changes to the code won't be obscured by whitespace.

2010-11-12  Jamie Strandboge  <jamie@canonical.com>

	virt-aa-helper should require <uuid> in XML
	When <uuid> is not in the XML, a virUUIDGenerate() ends up being called which
	is unnecessary and can lead to crashes if /dev/urandom isn't available
	because virRandomInitialize() is not called within virt-aa-helper. This patch
	adds verify_xpath_context() and updates caps_mockup() to use it.

	Bug-Ubuntu: https://launchpad.net/bugs/672943

2010-11-12  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Support SMBIOS host mode

2010-11-12  Laine Stump  <laine@laine.org>

	remote_driver.c: fix non-literal format strings w/o args

2010-11-12  Laine Stump  <laine@laine.org>

	ignore SELinuxSetFilecon error in SELinuxSetSecurityFileLabel if on nfs
	If virDomainAttachDevice() was called with an image that was located
	on a root-squashed NFS server, and in a directory that was unreadable
	by root on the machine running libvirtd, the attach would fail due to
	an attempt to change the selinux label of the image with EACCES (which
	isn't covered as an ignore case in SELinuxSetFilecon())

	NFS doesn't support SELinux labelling anyway, so we mimic the failure
	handling of commit 93a18bbafaf11729d3ca1241e11bee133d77fa77, which
	just ignores the errors if the target is on an NFS filesystem (in
	SELinuxSetSecurityAllLabel() only, though.)

	This can be seen as a follow-on to commit
	347d266c51705f4987fa5ce2a0ecb314ed8745ce, which ignores file open
	failures of files on NFS that occur directly in
	virDomainDiskDefForeachPath() (also necessary), but does not ignore
	failures in functions that are called from there (eg
	SELinuxSetSecurityFileLabel()).

2010-11-12  Daniel P. Berrange  <berrange@redhat.com>

	Fix reference counting bug in virsh console
	The event watches need to be removed before the event loop
	terminates, otherwise they cause a dangling reference to
	be held on the virStreamPtr, which in turns holds a reference
	on virConnectPtr, which in turn causes errors like

	  "Failed to disconnect from the hypervisor"

	* tools/console.c: Remove watches before event loop quits
	* tools/virsh.c: Print out dangling reference count

2010-11-12  Daniel P. Berrange  <berrange@redhat.com>

	Wire up virDomainOpenConsole for LXC, Xen and UML
	Introduce implementations of the virDomainOpenConsole() API
	for LXC, Xen and UML drivers.

	* src/lxc/lxc_driver.c, src/lxc/lxc_driver.c,
	  src/xen/xen_driver.c: Wire up virDomainOpenConsole

2010-11-12  Daniel P. Berrange  <berrange@redhat.com>

	Fix busy-wait loop on closed file descriptor
	When closing open streams after a client quits, the event
	callback was not removed. This mean that poll() was using
	a closed FD and returning POLLNVAL in a busy-wait loop.

	* daemon/stream.c: Disconnect stream callbacks

2010-11-12  Daniel P. Berrange  <berrange@redhat.com>

	Re-write virsh console to use streams
	This re-writes the 'virsh console' command so that it uses
	the new streams API. This lets it run remotely and/or as a
	non-root user. This requires that virsh be linked against
	the simple event loop from libvirtd in daemon/event.c
	As an added bonus, it can now connect to any console device,
	not just the first one.

	* tools/Makefile.am: Link to event.c
	* tools/console.c, tools/console.h: Rewrite to use the
	  virDomainOpenConsole() APIs with streams
	* tools/virsh.c: Support choosing the console name
	  via --devname $NAME

2010-11-12  Daniel P. Berrange  <berrange@redhat.com>

	Convert daemon/events.c to use virMutex and virThread
	The code currently uses pthreads APIs directly. This is not
	portable to Win32 threads. Switch it over to use the portability
	APIs. Also add a wrapper for pipe() which is subtely different
	on Win32

	* daemon/event.c: Switch to use virMutex & virThread.

2010-11-12  Daniel P. Berrange  <berrange@redhat.com>

	Introduce portability APIs for creating threads
	The util/threads.c/h code already has APIs for mutexes,
	condition variables and thread locals. This commit adds
	in code for actually creating threads.

	* src/libvirt_private.syms: Export new symbols
	* src/util/threads.h: Define APIs virThreadCreate, virThreadSelf,
	  virThreadIsSelf and virThreadJoin
	* src/util/threads-win32.c, src/util/threads-win32.h: Win32
	  impl of threads
	* src/util/threads-pthread.c, src/util/threads-pthread.h: POSIX
	  impl of threads

2010-11-12  Daniel P. Berrange  <berrange@redhat.com>

	Support virDomainOpenConsole with QEMU
	This provides an implementation of the virDomainOpenConsole
	API with the QEMU driver. For the streams code, this reuses
	most of the code previously added for the tunnelled migration
	streams since it is generic.

	* src/qemu/qemu_driver.c: Support virDomainOpenConsole

2010-11-12  Daniel P. Berrange  <berrange@redhat.com>

	Add a generic internal API for handling any FD based stream
	To avoid the need for duplicating implementations of virStream
	drivers, provide a generic implementation that can handle any
	FD based stream. This code is copied from the existing impl
	in the QEMU driver, with the locking moved into the stream
	impl, and addition of a read callback

	The FD stream code will refuse to operate on regular files or
	block devices, since those can't report EAGAIN properly when
	they would block on I/O

	* include/libvirt/virterror.h, include/libvirt/virterror.h: Add
	  VIR_FROM_STREAM error domain
	* src/qemu/qemu_driver.c: Remove code obsoleted by the new
	  generic streams driver.
	* src/fdstream.h, src/fdstream.c, src/fdstream.c,
	  src/libvirt_private.syms: Generic reusable FD based streams

2010-11-12  Daniel P. Berrange  <berrange@redhat.com>

	Lower logging level in remote driver streams
	Now that bi-directional, non-blocking streams are supported
	in the remote driver, some of the VIR_WARN statements need
	to be reduced to VIR_DEBUG.

	* src/remote/remote_driver.c: Lower logging level

2010-11-12  Daniel P. Berrange  <berrange@redhat.com>

	Remote driver client and server for virDomainOpenConsole
	This provides an implementation of the virDomainOpenConsole
	API for the remote driver client and server.

	* daemon/remote.c: Server side impl
	* src/remote/remote_driver.c: Client impl
	* src/remote/remote_protocol.x: Wire definition

2010-11-12  Daniel P. Berrange  <berrange@redhat.com>

	Introduce a virDomainOpenConsole API
	To enable virsh console (or equivalent) to be used remotely
	it is necessary to provide remote access to the /dev/pts/XXX
	pseudo-TTY associated with the console/serial/parallel device
	in the guest. The virStream API provide a bi-directional I/O
	stream capability that can be used for this purpose. This
	patch thus introduces a virDomainOpenConsole API that uses
	the stream APIs.

	* src/libvirt.c, src/libvirt_public.syms,
	  include/libvirt/libvirt.h.in, src/driver.h: Define the
	  new virDomainOpenConsole API
	* src/esx/esx_driver.c, src/lxc/lxc_driver.c,
	  src/opennebula/one_driver.c, src/openvz/openvz_driver.c,
	  src/phyp/phyp_driver.c, src/qemu/qemu_driver.c,
	  src/remote/remote_driver.c, src/test/test_driver.c,
	  src/uml/uml_driver.c, src/vbox/vbox_tmpl.c,
	  src/xen/xen_driver.c, src/xenapi/xenapi_driver.c: Stub
	  API entry point

2010-11-12  Daniel P. Berrange  <berrange@redhat.com>

	Support callbacks on virStream APIs in remote driver client
	The current remote driver code for streams only supports
	blocking I/O mode. This is fine for the usage with migration
	but is a problem for more general use cases, in particular
	bi-directional streams.

	This adds supported for the stream callbacks and non-blocking
	I/O. with the minor caveat is that it doesn't actually do
	non-blocking I/O for sending stream data, only receiving it.
	A future patch will try to do non-blocking sends, but this is
	quite tricky to get right.

	* src/remote/remote_driver.c: Allow non-blocking I/O for
	  streams and support callbacks

2010-11-11  Daniel P. Berrange  <dan@berrange.com>

	Fix LXC container console device setup
	The /dev/console device inside the container must NOT map
	to the real /dev/console device node, since this allows the
	container control over the current host console. A fun side
	effect of this is that starting a container containing a
	real Fedora OS will kill off your X server.

	Remove the /dev/console node, and replace it with a symlink
	to the primary console TTY

	* src/lxc/lxc_container.c: Replace /dev/console with a
	  symlink to /dev/pty/0
	* src/lxc/lxc_controller.c: Remove /dev/console from cgroups
	  ACL

2010-11-11  Eric Blake  <eblake@redhat.com>

	virsh: supply long option for -V
	* tools/virsh.c (vshParseArgv): Use NULL instead of 0 for pointer,
	and symbolic names for has_arg.  Give --version an optional arg.
	(vshUsage): Document this.
	* tools/virsh.pod: Likewise.

2010-11-11  Cole Robinson  <crobinso@redhat.com>

	qemu: Add flag to force a CDROM eject
	QEMU allows forcing a CDROM eject even if the guest has locked the device.
	Expose this via a new UpdateDevice flag, VIR_DOMAIN_DEVICE_MODIFY_FORCE.

	This has been requested for RHEV:

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

	v2: Change flag name, bool cleanups

2010-11-11  Eric Blake  <eblake@redhat.com>

	rpm: fix /var/lib/libvirt permissions
	https://bugzilla.redhat.com/show_bug.cgi?id=649511

	Regression of forcing 0700 permissions (which breaks guest startup
	because the qemu user can't see /var/lib/libvirt/*.monitor) was
	introduced in commit 66823690e, as part of libvirt 0.8.2.

	* libvirt.spec.in (%files): Drop %{_localstatedir}/lib/libvirt,
	since libvirt depends on libvirt-client.
	(%files client): Guarantee 755 permissions on
	%(_localstatedir}/lib/libvirt, since the qemu user must be able to
	do pathname resolution to a subdirectory.

2010-11-10  Daniel Veillard  <veillard@redhat.com>

	Augment bug reporting documentation
	With some instruction on how to attach useful gdb backtraces

2010-11-10  Adam Litke  <agl@us.ibm.com>

	Allow non-file disk backingStores
	I am trying to use a qcow image with libvirt where the backing 'file' is a
	qemu-nbd server.  Unfortunately virDomainDiskDefForeachPath() assumes that
	backingStore is always a real file so something like 'nbd:0:3333' is rejected
	because a file with that name cannot be accessed.  Note that I am not worried
	about directly using nbd images.  That would require a new disk type with XML
	markup, etc.  I only want it to be permitted as a backingStore

	The following patch implements danpb's suggestion:
	> I think I'm inclined to push the logic for skipping NBD one stage higher.
	> I'd rather expect virStorageFileGetMetadata() to return all backing
	> stores, even if not files. The virDomainDiskDefForeachPath() method
	> should definitely ignore non-file backing stores though.
	>
	> So what I'm thinking is to extend the virStorageFileMetadata struct and
	> just add a 'bool isFile' field to it. Default this field to true, unless
	> you see the prefix of nbd: in which case set it to false. The
	> virDomainDiskDefForeachPath() method can then skip over any backing
	> store with isFile == false

	Cc: Daniel P. Berrange <berrange@redhat.com>

2010-11-10  Matthias Bolte  <matthias.bolte@googlemail.com>

	xencapstest: Don't fail when Xen is installed
	xencapstest calls xenHypervisorMakeCapabilitiesInternal with conn == NULL
	which calls xenDaemonNodeGetTopology with conn == NULL when a recent
	enough Xen was detected (sys_interface_version >= SYS_IFACE_MIN_VERS_NUMA).
	But xenDaemonNodeGetTopology insists in having conn != NULL and fails,
	because it expects to be able to talk to an actual xend.

	We cannot do that in a 'make check' test. Therefore, only call the xend
	subdriver function when conn isn't NULL.

	Reported by Andy Howell and Jim Fehlig.

2010-11-10  Laine Stump  <laine@laine.org>

	virsh: fix non-literal string format
	These are in the newly added -V output.

2010-11-10  Stefan Berger  <stefanb@us.ibm.com>

	bye to close(), welcome to VIR_(FORCE_)CLOSE()
	Using automated replacement with sed and editing I have now replaced all
	occurrences of close() with VIR_(FORCE_)CLOSE() except for one, of
	course. Some replacements were straight forward, others I needed to pay
	attention. I hope I payed attention in all the right places... Please
	have a look. This should have at least solved one more double-close
	error.

2010-11-10  Matthias Bolte  <matthias.bolte@googlemail.com>

	Fix syntax-check error in domain.rng
	Replace tab with spaces.

	esx: Add support for memtune/min_guarantee
	Also add a test case for the VMX handling of it.

2010-11-09  Jiri Denemark  <jdenemar@redhat.com>

	schema: Move timer element inside clock
	Both conf/domain_conf.c and domain XML documentation have <timer>
	elements inside /domain/clock. Change domain.rng schema to be consistent
	with them.

2010-11-09  Daniel P. Berrange  <berrange@redhat.com>

	Misc test case fixes for SPICE
	* docs/schemas/domain.rng: Fix merge error which left SPICE channel
	  elements under VNC schema.
	* tests/qemuhelptest.c: Add SPICE flag to kvm-83 test
	* tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.xml: Add
	  <memballoon> element

2010-11-09  Jiri Denemark  <jdenemar@redhat.com>

	virsh: Add .xml suffix to tmp files used in *edit commands
	This helps editors with detecting the temporary files as XML since the
	temporary files do not contain <?xml ...?> declaration.

	Requested by https://bugzilla.redhat.com/show_bug.cgi?id=602277

2010-11-09  Daniel P. Berrange  <berrange@redhat.com>

	Support SPICE channel security options
	This extends the SPICE XML to allow channel security options

	    <graphics type='spice' port='-1' tlsPort='-1' autoport='yes'>
	      <channel name='main' mode='secure'/>
	      <channel name='record' mode='insecure'/>
	    </graphics>

	Any non-specified channel uses the default, which allows both
	secure & insecure usage

	* src/conf/domain_conf.c, src/conf/domain_conf.h,
	  src/libvirt_private.syms: Add XML syntax for specifying per
	  channel security options for spice.
	* src/qemu/qemu_conf.c: Configure channel security with spice

2010-11-09  Daniel P. Berrange  <berrange@redhat.com>

	Support multiple QXL video cards
	QEMU crashes & burns if you try multiple Cirrus video cards, but
	QXL copes fine. Adapt QEMU config code to allow multiple QXL
	video cards

	* src/qemu/qemu_conf.c: Support multiple QXL video cards

2010-11-09  Daniel P. Berrange  <berrange@redhat.com>

	Define XML syntax for password expiry
	This extends the XML syntax for <graphics> to allow a password
	expiry time to be set

	eg

	  <graphics type='vnc' port='5900' autoport='yes' keymap='en-us' passwd='12345' passwdValidTo='2010-04-09T15:51:00'/>

	The timestamp is in UTC.

	* src/conf/domain_conf.h: Pull passwd out into separate struct
	  virDomainGraphicsAuthDef to allow sharing between VNC & SPICE
	* src/conf/domain_conf.c: Add parsing/formatting of new passwdValidTo
	  argument
	* src/opennebula/one_conf.c, src/qemu/qemu_conf.c, src/qemu/qemu_driver.c,
	  src/xen/xend_internal.c, src/xen/xm_internal.c: Update for changed
	  struct containing VNC password

2010-11-09  Daniel P. Berrange  <berrange@redhat.com>

	Add SPICE support for QEMU driver configuration file
	In common with VNC, the QEMU driver configuration file is used
	specify the host level TLS certificate location and a default
	password / listen address

	* src/qemu/qemu.conf: Add spice_listen, spice_tls,
	  spice_tls_x509_cert_dir & spice_password config params
	* src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Parsing of
	  spice config parameters and updating -spice arg generation
	  to use them
	* tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-rhel6.args,
	  tests/qemuxml2argvtest.c: Expand test case to cover driver
	  level configuration

2010-11-09  Daniel P. Berrange  <berrange@redhat.com>

	Support automatic port number allocation for SPICE
	* src/qemu/qemu_driver.c: Allocate the TCP ports for SPICE
	  before starting guest

2010-11-09  Daniel P. Berrange  <berrange@redhat.com>

	Implement QEMU/KVM support for SPICE graphics
	This supports the -spice argument posted for review against
	the latest upstream QEMU/KVM. This supports the bare minimum
	config with port, TLS port & listen address. The x509 bits are
	added in a later patch.

	* src/qemu_conf.c, src/qemu_conf.h: Add SPICE flag. Check for
	  -spice availability. Format -spice arg for command line
	* qemuhelptest.c: Add SPICE flag
	* qemuxml2argvdata/qemuxml2argv-graphics-spice.args: Add <graphics>
	  for spice
	* qemuxml2argvdata/qemuxml2argv-graphics-spice.xml: Add -spice arg
	* qemuxml2argvtest.c: Add SPICE flag

2010-11-09  Daniel P. Berrange  <berrange@redhat.com>

	Implement QEMU/KVM QXL video card support in QEMU driver
	This supports the '-vga qxl' parameter in upstream QEMU/KVM
	which has SPICE support added. This isn't particularly useful
	until you get the next patch for -spice support. Also note that
	while the libvirt XML supports multiple video devices, this
	patch only supports a single one. A later patch can add support
	for 2nd, 3rd, etc PCI devices for QXL

	* src/qemu/qemu_conf.h: Flag for QXL support
	* src/qemu/qemu_conf.c: Probe for '-vga qxl' support and implement it
	* tests/qemuxml2argvtest.c, tests/qemuxml2xmltest.c,
	  tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.args,
	  tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.xml: Test
	  case for generating spice args with RHEL6 kvm

2010-11-09  Daniel P. Berrange  <berrange@redhat.com>

	Add a <graphics> type for SPICE protocol
	This adds an element

	 <graphics type='spice' port='5903' tlsPort='5904' autoport='yes' listen='127.0.0.1'/>

	This is the bare minimum that should be exposed in the guest
	config for SPICE. Other parameters are better handled as per
	host level configuration tunables

	* docs/schemas/domain.rng: Define the SPICE <graphics> schema
	* src/domain_conf.h, src/domain_conf.c: Add parsing and formatting
	  for SPICE graphics config
	* src/qemu_conf.c: Complain about unsupported graphics types

2010-11-09  Daniel P. Berrange  <berrange@redhat.com>

	Add a QXL graphics card type to domain XML schema
	* src/qemu_conf.c: Add dummy entry in enumeration
	* docs/schemas/domain.rng: Add 'qxl' as a type for the <video> tag
	* src/domain_conf.c, src/domain_conf.h: Add QXL to video type
	  enumerations

2010-11-09  Daniel Veillard  <veillard@redhat.com>

	Show compiled in options in virsh -V
	  To ease debugging this trivial patch allows to find what was compiled
	in in the local version of libvirt, this doesn't work for remote access
	but that's probably sufficient. With the patch I get on my machine:

	paphio:~/libvirt/tools -> ./virsh -V
	Virsh command line tool of libvirt 0.8.4
	See web site at http://libvirt.org/

	Compiled with support for:
	 Hypervisors: Xen QEmu/KVM UML OpenVZ LXC ESX PHYP Test
	 Networking: Remote Daemon Network Bridging Netcf Nwfilter
	 Storage: Dir Disk Filesystem SCSI Multipath iSCSI LVM
	 Miscellaneous: SELinux Secrets Debug Readline
	paphio:~/libvirt/tools ->

	* tools/virsh.c: add -V option
	* tools/virsh.pod: document the extension

2010-11-09  Jiri Denemark  <jdenemar@redhat.com>

	maint: Commit .gitignore sorting done by bootstrap

	qemu: Fix non-literal format string

2010-11-09  Matthias Bolte  <matthias.bolte@googlemail.com>

	xen-proxy: Remove it entirely and use libvirtd instead
	Suggested by danpb, as it's not up-to-date anymore and
	lacks many functions that were added to libvirtd.

	lxc: Exit on first error in lxcDomainGetMemoryParameters
	There is no point in trying to fill params beyond the first error,
	because when lxcDomainGetMemoryParameters returns -1 then the caller
	cannot detect which values in params are valid.

	Allow virDomainGetMemoryParameters on read-only connections
	Also fix a typo in the documentation of the function.

2010-11-08  Justin Clift  <jclift@redhat.com>

	virsh: fix incorrect help text mentioning non-existent network 'id'

2010-11-08  Daniel Veillard  <veillard@redhat.com>

	Add a new test for sysinfo and smbios handling

2010-11-08  Daniel Veillard  <veillard@redhat.com>

	Add sysinfo/smbios support to the QEmu driver
	The patch is based on the possiblity in the QEmu command line to
	add -smbios options allowing to override the default values picked
	by QEmu. We need to detect this first from QEmu help output.
	If the domain is defined with smbios to be inherited from host
	then we pass the values coming from the Host own SMBIOS, but
	if the domain is defined with smbios to come from sysinfo, we
	use the ones coming from the domain definition.

	* src/qemu/qemu_conf.h: add the QEMUD_CMD_FLAG_SMBIOS_TYPE enum
	  value
	* src/qemu/qemu_conf.c: scan the help output for the smbios support,
	  and if available add support based on the domain definitions,
	  and host data
	* tests/qemuhelptest.c: add the new enum in the outputs

2010-11-08  Daniel Veillard  <veillard@redhat.com>

	Read the host sysinfo for the QEmu driver
	Read and store the data when initializing the driver.

2010-11-08  Daniel Veillard  <veillard@redhat.com>

	Add a sysinfo util module and read host info API
	Move existing routines about virSysinfoDef to an util module,
	add a new entry point virSysinfoRead() to read the host values
	with dmidecode

	* src/conf/domain_conf.c src/conf/domain_conf.h src/util/sysinfo.c
	  src/util/sysinfo.h: move to a new module, add virSysinfoRead()
	* src/Makefile.am: handle the new module build
	* src/libvirt_private.syms: new internal symbols
	* include/libvirt/virterror.h src/util/virterror.c: defined a new
	  error code for that module
	* po/POTFILES.in: add new file for translations

2010-11-08  Daniel Veillard  <veillard@redhat.com>

	Add smbios element to schema and configuration to HVM os
	the element has a mode attribute allowing only 3 values:
	  - emulate: use the smbios emulation from the hypervisor
	  - host: try to use the smbios values from the node
	  - sysinfo: grab the values from the <sysinfo> fields

	* docs/schemas/domain.rng: extend the schemas
	* src/conf/domain_conf.h: add the flag to the domain config
	* src/conf/domain_conf.h: parse and serialize the smbios if present

2010-11-08  Daniel Veillard  <veillard@redhat.com>

	Sysinfo parsing and saving to/from configuration files
	* src/conf/domain_conf.h: defines a new internal type added to the
	  domain structure
	* src/conf/domain_conf.c: parsing and serialization of that new type

	Sysinfo extension to relax-ng schemas
	Currently includes a subset of the SMBIOS strings set

2010-11-06  Matthias Bolte  <matthias.bolte@googlemail.com>

	qemu: Remove redundant slash in save directory path

2010-11-06  Chris Lalancette  <clalance@redhat.com>

	Implement virsh qemu-monitor-command.
	Now that the virsh parsing has been revamped, we can
	implement qemu-monitor-command.  This is basically the same
	as it was in previous iterations, but has now been tested to
	work both with the plain text monitor and the QMP monitor.

2010-11-05  Daniel P. Berrange  <dan@berrange.com>

	Fix off-by-1 in todo page generator
	The todo.pl script had an off-by-1 which meant any category
	with only a single bug would not appear

	* docs/todo.pl: Fix off-by-1

2010-11-03  Stefan Berger  <stefanb@us.ibm.com>

	macvtap: libvirtd forgot macvtap dev name when restarted
	During a shutdown/restart cycle libvirtd forgot the macvtap device name that it had created on behalf of a VM so that a stale macvtap device remained on the host when the VM terminated. Libvirtd has to actively tear down a macvtap device and it uses its name for identifying which device to tear down.

	The solution is to not blank out the <target dev='...'/> completely, but only blank it out on VMs that are not active. So, if a VM is active, the device name makes it into the XML and is also being parsed. If a VM is not active, the device name is discarded.

2010-11-03  Osier Yang  <jyang@redhat.com>

	tests: fix daemon-conf testing failure
	libvirtd.conf uses "libvirt" as the value of "unix_sock_group",
	however, group "libvirt" may not exist on the system, in this case
	the case will always fail.

	As a solution, replace "libvirt" with "$USER" in "tmp.conf".

2010-11-03  Daniel Veillard  <veillard@redhat.com>

	Fix virPipeReadUntilEOF on more than 1024 bytes of data
	virPipeReadUntilEOF is used to read the stdout of exec'ed
	and this could fail to capture the full output and read only
	1024 bytes.
	  The problem is that this is based on a poll loop, and in the
	loop we read at most 1024 bytes per file descriptor, but we also
	note in the loop if poll indicates that the process won't output
	more than that on that fd by setting finished[i] = 1.
	  The simplest way is that if we read a full buffer make sure
	finished[i] is still 0 because we will need another pass in the
	loop.

2010-11-03  Eric Blake  <eblake@redhat.com>

	virterror: supply missing spaces
	* src/util/virterror.c (virErrorDomainName): Always supply
	trailing space if category was present.

	xen: work with xen 4.0.1 headers
	* src/xen/xen_driver.h (includes): Include main xen headers
	here...
	* src/xen/xs_internal.c (includes): ...rather than in just one of
	the sub-drivers.

2010-11-03  Jim Fehlig  <jfehlig@novell.com>

	Fix build with polkit 0
	Commit e8066d53 broke the build with polkit0:

	remote.c: In function 'remoteDispatchAuthPolkit':
	remote.c:4177: error: 'rv' undeclared (first use in this function)

	Add missing identifier.

2010-11-02  Daniel P. Berrange  <berrange@redhat.com>

	Change calling conventions in remote driver client internals
	The remoteIO() method has wierd calling conventions, where
	it is passed a pre-allocated 'struct remote_call *' but
	then free()s it itself, instead of letting the caller free().
	This fixes those weird semantics

	* src/remote/remote_driver.c: Sanitize semantics of remoteIO
	  method wrt to memory release

2010-11-02  Daniel P. Berrange  <berrange@redhat.com>

	Fix comment for <video> tag in domain RNG schema
	The comment for the <video> tag was a cut+paste error duplicating
	info about the <graphics> tag

	* docs/schemas/domain.rng: Fix comment for <video> tag

2010-11-02  Daniel P. Berrange  <berrange@redhat.com>

	Misc error handling fixes in text mode monitor commands
	A couple of places in the text monitor were overwriting the
	'ret' variable with a >= 0 value before success was actually
	determined. So later error paths would not correctly return
	the -1 value. The drive_add code was not checking for errors
	like missing command

	* src/qemu/qemu_monitor_text.c: Misc error handling fixes

2010-11-02  Daniel P. Berrange  <berrange@redhat.com>

	Ignore open failures when relabelling disk images
	NFS in root squash mode may prevent opening disk images to
	determine backing store. Ignore errors in this scenario.

	* src/security/security_selinux.c: Ignore open failures on disk
	  images

2010-11-02  Daniel P. Berrange  <berrange@redhat.com>

	Treat failure to relabel stdin_path as non-fatal on NFS
	NFS does not support file labelling, so ignore this error
	for stdin_path when on NFS.

	* src/security/security_selinux.c: Ignore failures on labelling
	  stdin_path on NFS
	* src/util/storage_file.c, src/util/storage_file.h: Refine
	  virStorageFileIsSharedFS() to allow it to check for a
	  specific FS type.

2010-11-02  Daniel P. Berrange  <berrange@redhat.com>

	Revert commit 06f81c63ebc19cb0e51f9b397991f6d6ae56d090
	Commit 06f81c63ebc19cb0e51f9b397991f6d6ae56d090 attempted to make
	QEMU driver ignore the failure to relabel 'stdin_path' if it was
	on NFS. The actual result was that it ignores *all* failures to
	label any aspect of the VM, unless stdin_path is non-NULL and
	is not on NFS.

	* src/qemu/qemu_driver.c: Treat all relabel failures as terminal

2010-11-02  Jiri Denemark  <jdenemar@redhat.com>

	Fix several warnings about a non-literal format string
	They only popped up during --disable-nls build. Without this configure
	option, gcc wasn't able to detect them.

2010-11-02  Osier Yang  <jyang@redhat.com>

	util: Add helper function to build timestamp string
	* src/util/util.h
	* src/util/util.c
	* src/libvirt_private.syms

2010-11-02  Eric Blake  <eblake@redhat.com>

	docs: fix typo
	* docs/drvqemu.html.in (qemu): Fix typo.

	build: avoid compiler warning in xen code
	* src/xen/xend_internal.c (xenDaemonFormatSxpr): Hoist verify
	outside of function to avoid a -Wnested-externs warning.
	* src/xen/xm_internal.c (xenXMDomainConfigFormat): Likewise.
	Reported by Daniel P. Berrange.

2010-11-02  Diego Elio Pettenò  <flameeyes@gmail.com>

	misc: encode the Emacs suggstions from HACKING into a .dir-locals.el file
	With this file in place, opening any source file in libvirt will set up
	Emacs for proper indentation.

	qemu: add the USB devices to the cgroup whitelist
	Make sure that the QEmu process within the cgroup can access the device
	file for the USB device that has to be connected to the virtual domain.

2010-11-01  Eric Blake  <eblake@redhat.com>

	xen: work with ia64 MAX_VIRT_CPUS of 64
	* src/xen/xen_hypervisor.c (MAX_VIRT_CPUS): Move...
	* src/xen/xen_driver.h (MAX_VIRT_CPUS): ...so all xen code can see
	same value.
	* src/xen/xend_internal.c (sexpr_to_xend_domain_info)
	(xenDaemonDomainGetVcpusFlags, xenDaemonParseSxpr)
	(xenDaemonFormatSxpr): Work if MAX_VIRT_CPUS is 64 on a platform
	where long is 64-bits.
	* src/xen/xm_internal.c (xenXMDomainConfigParse)
	(xenXMDomainConfigFormat): Likewise.

2010-10-30  Diego Elio Pettenò  <flameeyes@gmail.com>

	build: cleanup declaration of xen tests.
	Only build statstest and reconnect if they should be used, so add them
	behind the ENABLE_XEN_TESTS conditional.

2010-10-30  KAMEZAWA Hiroyuki  <kamezawa.hiroyu@jp.fujitsu.com>

	qemu: check compression program availability of virsh save and dump

2010-10-30  KAMEZAWA Hiroyuki  <kamezawa.hiroyu@jp.fujitsu.com>

	add compression support for "virsh dump"
	Add dump_image_format[] to qemu.conf and support compressed dump
	at virsh dump. coredump compression is important for saving disk space
	in an environment where multiple guests run.

	In general, "disk space for dump" is specially allocated and will be
	a dead space in the system. It's used only at emergency. So, it's better
	to have both of save_image_format and dump_image_format. "save" is done
	in scheduled manner with enough calculated disk space for it.

	This code reuses some of save_image_format[] and supports the same format.

	Changelog:
	 - modified libvirtd_qemu.aug
	 - modified test_libvirtd_qemu.aug
	 - fixed error handling of qemudSaveCompressionTypeFromString()

2010-10-29  Lai Jiangshan  <laijs@cn.fujitsu.com>

	qemu_driver: add virCgroupMounted
	When we mount any cgroup without "-o devices", we will fail to start vms:

	error: Failed to start domain vm1
	error: Unable to deny all devices for vm1: No such file or directory

	When we mount any cgroup without "-o cpu", we will fail to get schedinfo:
	Scheduler      : posix
	error: unable to get cpu shares tunable: No such file or directory

	We should only use the cgroup controllers which are mounted on host.
	So I add virCgroupMounted() for qemuCgroupControllerActive()

2010-10-29  Daniel Veillard  <veillard@redhat.com>

	Release of libvirt-0.8.5
	* configure.ac libvirt.spec.in: new version
	* docs/news.html.in: update news page and improve format
	* po/*.po*: Update po again

	Updating localization and regenerating before release

2010-10-29  Matthias Bolte  <matthias.bolte@googlemail.com>

	vbox: Don't warn when the linker search path doesn't contain VBoxXPCOMC.so
	This is actually a workaround, to unbreak make check on systems
	without VirtualBox.

2010-10-29  Matthias Bolte  <matthias.bolte@googlemail.com>

	vbox: Stop hardcoding a single path for VBoxXPCOMC.so
	This partly reverts df90ca7661b0a789bd790ccf8258a4527c13eb8d.

	Don't disable the VirtualBox driver when configure can't find
	VBoxXPCOMC.so, rely on detection at runtime again instead.

	Keep --with-vbox=/path/to/virtualbox intact, added to for:
	https://bugzilla.redhat.com/show_bug.cgi?id=609185

	Detection order for VBoxXPCOMC.so:

	1. VBOX_APP_HOME environment variable
	2. configure provided location
	3. hardcoded list of known locations
	4. dynamic linker search path

	Also cleanup the glue code and improve error reporting.

2010-10-29  Justin Clift  <jclift@redhat.com>

	virsh: improve the help description for managedsave and start
	Updated the descriptions for managedsave and start in virsh and
	the virsh man page, and also for managedsave-remove in the virsh
	man page.

2010-10-29  KAMEZAWA Hiroyuki  <kamezawa.hiroyu@jp.fujitsu.com>

	audit: printf warning fix
	fix warning
	  CC     libvirt_util_la-virtaudit.lo
	cc1: warnings being treated as errors
	util/virtaudit.c: In function 'virAuditEncode':
	util/virtaudit.c:146: error: implicit declaration of function 'virAsprintf' [-Wimplicit-function-declaration]
	util/virtaudit.c:146: error: nested extern declaration of 'virAsprintf' [-Wnested-externs]

2010-10-28  Stefan Berger  <stefanb@us.ibm.com>

	eliminate possibility of a double-closed file descriptor
	The 2nd and 3rd hunk show the only double-closed file descriptor code part that I found while trying to clean up close(). The first hunk seems a harmless cleanup in that same file.

2010-10-28  Eric Blake  <eblake@redhat.com>

	qemu: check for vm after starting a job
	https://bugzilla.redhat.com/show_bug.cgi?id=638285 - when migrating
	a guest, it was very easy to provoke a race where an application
	could query block information on a VM that had just been migrated
	away.  Any time qemu code obtains a job lock, it must also check
	that the VM was not taken down in the time where it was waiting
	for the lock.

	* src/qemu/qemu_driver.c (qemudDomainSetMemory)
	(qemudDomainGetInfo, qemuDomainGetBlockInfo): Check that vm still
	exists after obtaining job lock, before starting monitor action.

2010-10-28  Laine Stump  <laine@laine.org>

	Only attempt removal of the rule allowing tftp if it was added
	During virtual network startup, the iptables rule that allows tftp
	traffic is only added if network->def->tftproot is non-empty, but when
	the virtual network is destroyed, we had been unconditionally trying
	to delete the rule. This was harmless, except that it created a bogus
	error message.

	This patch conditionalizes the delete command in the same manner that
	the insert command is already conditionalized.

2010-10-28  Justin Clift  <jclift@redhat.com>

	docs: updated the C# bindings page with arnauds latest changes

	docs: update ruby bindings maintainer to chris lalancette

2010-10-28  Eric Blake  <eblake@redhat.com>

	build: use shorter file names for 'make dist'
	* docs/api_extension/{0013,0014}*.patch: Rename to shorter files.
	* docs/api_extension.html.in: Reflect rename.

2010-10-28  Justin Clift  <jclift@redhat.com>

	docs: reworded and reordered the bindings page, plus minor tweaks
	Reordered the bindings into alphabetical order, added a link to
	the php-libvirt source on Github, plus gave the direct package
	names needed for Python usage on RHEL/Fedora, and Ubuntu.

2010-10-28  Matthias Bolte  <matthias.bolte@googlemail.com>

	mingw: Add body for virFork and remove double virDriverLoadModule export
	Commit 9bd3cce0d2d54e6ab893bb8137218b83d9294714 added virFork and
	virDriverLoadModule to libvirt_private.syms, but virFork didn't have
	a body on Win32 and virDriverLoadModule was already correctly
	exported conditional via libvirt_driver_modules.syms.

2010-10-28  Daniel P. Berrange  <berrange@redhat.com>

	Add disk/net resource auditing to QEMU driver
	Add auditing of all initial disk/net assignments to QEMU guests
	at startup. Add auditing for all hotplug & unplug events and
	disk media changes.

	* src/qemu/qemu_driver.c: Add disk/net resource auditing

2010-10-28  Daniel P. Berrange  <berrange@redhat.com>

	Add auditing of security label in QEMU driver
	Add auditing of the allocated security label in the QEMU driver
	VM startup code

	* src/qemu/qemu_driver.c: Audit security label

2010-10-28  Daniel P. Berrange  <berrange@redhat.com>

	Add auditing of start/stop events to the QEMU driver
	Add audit hooks to report all start and stop events on QEMU
	guest domains.

	* src/qemu/qemu_driver.c: Audit start/stop events

2010-10-28  Daniel P. Berrange  <berrange@redhat.com>

	Add printf format attribute annotation to virAuditSend method
	* src/util/virtaudit.h: Add printf format attribute annotation

2010-10-28  Daniel P. Berrange  <berrange@redhat.com>

	Add audit helper for escaping log message strings
	Add a helper API for ecscaping the value in audit log
	messages

	* src/util/virtaudit.h, src/util/virtaudit.c,
	  src/libvirt_private.syms: Add virAuditEncode

2010-10-28  Daniel P. Berrange  <berrange@redhat.com>

	Remove audit hooks from the selinux security driver code
	This reverts commit b8e2de8899594edcd78b3a7cb1b39b89bbed2891
	The hooks will be re-added in the QEMU driver itself.

	* src/security/security_selinux.c: Remove audit hooks

2010-10-28  Daniel P. Berrange  <berrange@redhat.com>

	Remove all auditing hooks from libvirtd dispatch code
	Revert most of commit a8b5f9bd27d65c2ced064b9267ca31dee7ad9c86.
	The audit hooks will be re-added directly in the QEMU driver code
	in a future commit

	* daemon/remote.c: Remove all audit logging hooks
	* src/qemu/qemu_driver.c: Remove all audit logging hooks

2010-10-27  Philipp Hahn  <hahn@univention.de>

	Fix xen API documentation
	*src/xen/xend_internal.c: fix a couple of comments in function descriptions

2010-10-27  Justin Clift  <jclift@redhat.com>

	docs: added a table of contents to the first 11 docs files
	There are a 58 docs files, so adding an autogenerated Table Of
	Contents to them all will take some time.  This is the first
	piece of the work done.

	docs: reformated the bindings page html markup to match other pages

2010-10-27  Eric Blake  <eblake@redhat.com>

	virsh: use - not _ in memtune option names
	* tools/virsh.c (opts_memtune): All other options in virsh use -
	for separating words.

2010-10-27  Eric Blake  <eblake@redhat.com>

	build: fix shell detection bug
	A missing shell was noisy, and the use of command to decipher a
	shell's absolute path requires "" rather than ''.

	* configure.ac (lv_cv_wrapper_shell): Fix logic errors if candidate
	shell is not available.
	* .gitignore: Ignore file created when /bin/sh is old dash.
	Reported by Matthias Bolte.

2010-10-27  Eric Blake  <eblake@redhat.com>

	maint: fix syntax-check failure of previous patch
	* cfg.mk (sc_prohibit_trailing_blank_lines): Delete; this is
	adequately covered by maint.mk's sc_prohibit_empty_lines_at_EOF.
	* .x-sc_prohibit_empty_lines_at_EOF: New file, to exempt raw
	patches.
	* Makefile.am (EXTRA_DIST): Include new exemption.

	docs: revamp api_extension example, using vcpu patch series
	* docs/api_extension/*: Replace example files.
	* docs/api_extension.html.in: Rewrite to match new example files.

2010-10-27  Diego Elio Pettenò  <flameeyes@gmail.com>

	qemu: don't use %.3d format for bus/addr of USB devices
	When using 0-prefixed numbers, QEmu will interpret them as octal numbers
	(as C convention says); this means that if you attach a device that has
	addr > 10 (decimal) you're going to attach a different device.

2010-10-26  Eric Blake  <eblake@redhat.com>

	virsh: fix range of memtune command
	* tools/virsh.c (cmdMemtune): Use long long for memory
	sizes. Simplify allocation, and plug memory leak.

	virsh: improve help text where integers are expected
	* tools/virsh.c (opts_freecell, opts_memtune, opts_vcpupin)
	(opts_setvcpus, opts_setmaxmem, opts_setmem)
	(opts_migrate_setmaxdowntime): Use VSH_OT_INT when only an integer
	is expected.
	(vshCmddefHelp, vshCmddefGetData): Allow mandatory VSH_OT_INT
	arguments.

2010-10-26  Eric Blake  <eblake@redhat.com>

	qemu: work around dash 0.5.5 bug in managed save
	Older dash mistakenly truncates regular files when using <> redirection;
	this kills our use of double dd to reduce storage overhead when
	saving qemu images.  But qemu insists on running a command through
	/bin/sh, so we work around it by having qemu run $sh -c 'real command'
	when we have a replacement $sh in mind.

	* configure.ac (VIR_WRAPPER_SHELL): Define to a replacement shell,
	if /bin/sh is broken on <> redirection.
	* src/qemu/qemu_monitor.h (VIR_WRAPPER_SHELL_PREFIX)
	(VIR_WRAPPER_SHELL_SUFFIX): New macros.
	* src/qemu/qemu_monitor_text.c (qemuMonitorTextMigrateToFile): Use
	them.
	* src/qemu/qemu_monitor_json.c (qemuMonitorJSONMigrateToFile):
	Likewise.

2010-10-26  Justin Clift  <jclift@redhat.com>

	docs: make the location of the xml catalog file a configure option
	The default location for the XML catalog file, /etc/xml/catalog,
	used when validating the generated html docs, isn't correct for
	MacOS X.

	This commit adds an option to the configure script, allowing the
	default to be overridden:

	  --with-xml-catalog-file=/path/to/xml/catalog/file

2010-10-26  Daniel P. Berrange  <berrange@redhat.com>

	Avoid squashing errors during network startup cleanup path
	When failing to start a virtual network, we have to cleanup,
	tearing down any iptables rules. If the iptables rules were
	not present yet though, this raises an error, which squashes
	the original error we were handling.

	* src/network/bridge_driver.c: When failing to start a virtual
	  network, don't squash the original error in cleanup

2010-10-26  Justin Clift  <jclift@redhat.com>

	docs: install the generated html files when make install is run
	Previously, only the API docs were installed, rather than the
	complete documentation set.  This commit ensures the complete
	documentation set is installed.

2010-10-26  Matthias Bolte  <matthias.bolte@googlemail.com>

	Fix build for SystemTap 1.0
	With SystemTap 1.0 a part of the generated macros in probes.h
	expands to:

	volatile __typeof__(((name))) arg2 = (name);

	GCC reports an 'invalid initialize' error when name has type
	char[]. Therfore, add casts to char* to avoid this.

2010-10-26  Jiri Denemark  <jdenemar@redhat.com>

	xen: Fix domain dump
	Remove redundant 'live' parameter which caused an error from xend:

	    "xend.err 'Too many values for live'"

2010-10-26  Daniel P. Berrange  <berrange@redhat.com>

	Fix formatting of network address in iptables helpers
	The network address was being set to 192.168.122.0 instead
	of 192.168.122.0/24. Fix this by removing the unneccessary
	'network' field from virNetworkDef and just pass the
	network address and netmask into the iptables APIs directly.

	* src/conf/network_conf.h, src/conf/network_conf.c: Remove
	  the 'network' field from virNEtworkDef.
	* src/network/bridge_driver.c: Update for iptables API changes
	* src/util/iptables.c, src/util/iptables.h: Require the
	  network address + netmask pair to be passed in

2010-10-26  Osier Yang  <jyang@redhat.com>

	virsh: Add option 'model' for attach-interface
	* tools/virsh.c: add missing option from the CLI to allows setting
	  up the NIC model type when attaching an interface
	* tools/virsh.pod: extend documentation
	* AUTHORS: add Osier Yang to the list

2010-10-26  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Fix detection of drive readonly option
	So far, readonly=on option is used when qemu supports -device. However,
	there are qemu versions which support readonly option with -drive
	although they don't have support for -device.

2010-10-26  Philipp Hahn  <hahn@univention.de>

	Fix documentation for virEventAddTimeout()
	* src/util/event.h: Fix copy&paste error from virEventAddHandle()

2010-10-26  Eric Blake  <eblake@redhat.com>

	maint: ignore new test executable
	* tests/.gitignore: Sort, and add sockettest.

2010-10-23  Justin Clift  <jclift@redhat.com>

	daemon: updates previous 1 line patch for correctness
	The previous commit, 880da47a05b9fb8381e79b03ead5dd2d8a6a937a,
	worked on my system, but wasn't actually correct.  This follow
	up patch corrects it properly.

	daemon: exclude requirement for probes.h on systems without systemtap
	This 1-liner was actually written by Eric Blake, over IRC. It
	addresses a compilation failure in make dist and make rpm for
	systems without the dtrace/systemtap development libraries
	installed.

2010-10-23  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Add documentation about certificates and connection problems

2010-10-23  Jiri Denemark  <jdenemar@redhat.com>

	tests: Silence qemuxml2argv test

2010-10-23  Eric Blake  <eblake@redhat.com>

	dnsmasq: avoid potential crash
	* src/util/dnsmasq.c (hostsfileAdd): Don't free uninitialized
	memory on allocation failure.

2010-10-22  Justin Clift  <jclift@redhat.com>

	docs: added a table of contents to the new c sharp bindings page

	docs: removed old changelog file, as it is no longer relevant
	We instead point to the live git log URL for the few links still
	needing to point to something.

2010-10-22  Matthias Bolte  <matthias.bolte@googlemail.com>

	vbox: Fix compile errors due to the virSocketAddr series

2010-10-22  Daniel P. Berrange  <berrange@redhat.com>

	Don't try to parse a NULL ip address for boot server
	The boot server IP address is optional, so it needs to be
	checked before attempting to parse it.

	* src/conf/network_conf.c: Don't parse NULL ip address for
	  boot server

2010-10-22  Daniel P. Berrange  <berrange@redhat.com>

	Convert virNetwork to use virSocketAddr everywhere
	Instead of storing the IP address string in virNetwork related
	structs, store the parsed virSocketAddr. This will make it
	easier to add IPv6 support in the future, by letting driver
	code directly check what address family is present

	* src/conf/network_conf.c, src/conf/network_conf.h,
	  src/network/bridge_driver.c: Convert to use virSocketAddr
	  in virNetwork, instead of char *.
	* src/util/bridge.c, src/util/bridge.h,
	  src/util/dnsmasq.c, src/util/dnsmasq.h,
	  src/util/iptables.c, src/util/iptables.h: Convert to
	  take a virSocketAddr instead of char * for any IP
	  address parameters
	* src/util/network.h: Add macros to determine if an address
	  is set, and what address family is set.

2010-10-22  Daniel P. Berrange  <berrange@redhat.com>

	Include socket address in client probe data
	It is useful to know where the client is connecting from,
	so include the socket address in probe data.

	* daemon/libvirtd.h: Use virSocketAddr for storing client
	  address and keep printable address handy for logging
	* daemon/libvirtd.c: Include socket address in client
	  connect/disconnect probes
	* daemon/probes.d: Add socket address to probes
	* examples/systemtap/client.stp: Print socket address
	* src/util/network.h: Add sockaddr_un to virSocketAddr union

2010-10-22  Daniel P. Berrange  <berrange@redhat.com>

	Add dtrace static probes in libvirtd
	Adds initial support for dtrace static probes in libvirtd
	daemon, assuming use of systemtap dtrace compat shim on
	Linux. The probes are inserted for network client connect,
	disconnect, TLS handshake states and authentication protocol
	states.

	This can be tested by running the xample program and then
	attempting to connect with any libvirt client (virsh,
	virt-manager, etc).

	 # stap examples/systemtap/client.stp
	  Client fd=44 connected readonly=0
	  Client fd=44 auth polkit deny pid:24997,uid:500
	  Client fd=44 disconnected
	  Client fd=46 connected readonly=1
	  Client fd=46 auth sasl allow test
	  Client fd=46 disconnected

	The libvirtd.stp file should also really not be required,
	since it is duplicated info that is already available in
	the main probes.d definition file. A script to autogenerate
	the .stp file is needed, either in libvirtd tree, or better
	as part of systemtap itself.

	* Makefile.am: Add examples/systemtap subdir
	* autobuild.sh: Disable dtrace for mingw32
	* configure.ac: Add check for dtrace
	* daemon/.gitignore: Ignore generated dtrace probe file
	* daemon/Makefile.am: Build dtrace probe header & object
	  files
	* daemon/libvirtd.stp: SystemTAP convenience probeset
	* daemon/libvirtd.c: Add connect/disconnect & TLS probes
	* daemon/remote.c: Add SASL and PolicyKit auth probes
	* daemon/probes.d: Master probe definition
	* daemon/libvirtd.h: Add convenience macro for probes
	  so that compilation is a no-op when dtrace is not available
	* examples/systemtap/Makefile.am, examples/systemtap/client.stp
	  Example systemtap script using dtrace probe markers
	* libvirt.spec.in: Enable dtrace on F13/RHEL6
	* mingw32-libvirt.spec.in: Force disable dtrace

2010-10-22  Daniel P. Berrange  <berrange@redhat.com>

	Add test suite for virSocket APIs
	Add a test suite for check parsing, formatting, range calculation
	and netmask checking APIs in virSocketAddr.

	* tests/sockettest.c, tests/Makefile.am: Add new test case

2010-10-22  Daniel P. Berrange  <berrange@redhat.com>

	Ban use of all inet_* functions
	All the inet_* functions can be replaced with calls to the
	virSocket APIs. Since many of the inet_* funtions are unsafe,
	and the remainder are obsolete, forbid all future use of them
	in libvirt.

	* Makefile.nonreentrant: Ban use of inet_*

2010-10-22  Daniel P. Berrange  <berrange@redhat.com>

	Remove all use of inet_pton and inet_ntop
	The  inet_pton and inet_ntop functions are obsolete, replaced
	by getaddrinfo+getnameinfo with the AI_NUMERICHOST flag set.
	These can be accessed via the virSocket APIs.

	The bridge.c code had methods for fetching the IP address of
	a bridge which used inet_ntop. Aside from the use of inet_ntop
	these methods are broken, because a NIC can have multiple
	addresses and this only returns one address. Since the methods
	are never used, just remove them.

	* src/conf/network_conf.c, src/nwfilter/nwfilter_learnipaddr.c:
	  Replace inet_pton and inet_ntop with virSocket APIs
	* src/util/bridge.c, src/util/bridge.h: Remove unused methods
	  which called inet_ntop.

2010-10-22  Daniel P. Berrange  <berrange@redhat.com>

	Remove both addrToString methods
	The addrToString functionality is now available via the
	virSocketFormatAddrFull method.

	* daemon/remote.c, src/remote/remote_driver.c: Remove
	  addrToString methods

2010-10-22  Daniel P. Berrange  <berrange@redhat.com>

	Fix error reporting for virSocketParse
	The virSocketParse method was not doing any error reporting
	which meant the true cause of the problem was lost. Remove
	all error reporting from callers, and push it into virSocketParse

	* src/util/network.c: Add error reporting to virSocketParse
	* src/conf/domain_conf.c, src/conf/network_conf.c,
	  src/network/bridge_driver.c: Remove error reporting in
	  callers of virSocketParse

2010-10-22  Daniel P. Berrange  <berrange@redhat.com>

	Expand virSocketFormat to be more flexible
	The getnameinfo() function is more flexible than inet_ntop()
	avoiding the need to if/else the code based on socket family.
	Also make it support UNIX socket addrs and allow inclusion
	of a port (service) address. Finally do proper error reporting
	via normal APIs.

	* src/conf/domain_conf.c, src/nwfilter/nwfilter_ebiptables_driver.c,
	  src/qemu/qemu_conf.c: Fix error handling with virSocketFormat
	* src/util/network.c: Rewrite virSocketFormat to use getnameinfo
	  and cope with UNIX socket addrs.

2010-10-22  Daniel P. Berrange  <berrange@redhat.com>

	Remove pointless nwIPAddress struct & void *casts
	The nwIPAddress was simply a wrapper about virSocketAddr.
	Just use the latter directly, removing all the extra field
	de-references from code & helper APIs for parsing/formatting.

	Also remove all the redundant casts from strong types to
	void * and then immediately back to strong types.

	* src/conf/nwfilter_conf.h: Remove nwIPAddress
	* src/conf/nwfilter_conf.c, src/nwfilter/nwfilter_ebiptables_driver.c:
	  Update to use virSocketAddr and remove void * casts.

2010-10-22  Daniel P. Berrange  <berrange@redhat.com>

	Fix netmask checks for IPv6 in virSocketCheckNetmask
	There was a typo in the IPv6 path of virSocketCheckNetmask which
	caused it to never execute.

	* src/util/network.c: s/AF_INET/AF_INET6/ in virSocketCheckNetmask

2010-10-22  Daniel P. Berrange  <berrange@redhat.com>

	Fix passing of address family to virSocketParseAddr
	The virSocketParseAddr function was accepting any AF_* constant
	and using that to set the ai_flags field in struct addrinfo.
	This is invalid, since address families must go in the ai_family
	field of the struct.

	* src/util/network.c: Fix handling of address family
	* src/conf/network_conf.c, src/network/bridge_driver.c: Pass
	  AF_UNSPEC instead of relying on it being 0.

2010-10-22  Daniel P. Berrange  <berrange@redhat.com>

	Include length with virSocketAddr data
	Some operations on socket addresses need to know the length of
	the sockaddr struct for the particular address family. This
	info was being discarded when passing around virSocketAddr
	instances. Turn it from a union into a struct containing
	union+socklen_t fields, so length is always kept around.

	* src/util/network.h: Add socklen_t field to virSocketAddr
	* src/util/network.c, src/network/bridge_driver.c,
	  src/conf/domain_conf.c: Update to take account of new
	  struct definition.

2010-10-22  Daniel P. Berrange  <berrange@redhat.com>

	Remove useless code in error path of getnameinfo()
	If getnameinfo() with NI_NUMERICHOST set fails, there are no
	grounds to expect inet_ntop to succeed, since these calls
	are functionally equivalent. Remove useless inet_ntop code
	in the getnameinfo() error path.

	* daemon/remote.c, src/remote/remote_driver.c: Remove
	  calls to inet_ntop

2010-10-21  Eric Blake  <eblake@redhat.com>

	maint: sort private sym lists
	* src/libvirt_private.syms: Sort by header name, then within
	header, and drop duplicate virNetworkDefParseNode,
	virFileLinkPointsTo and virXPathBoolean.

2010-10-21  Daniel P. Berrange  <berrange@redhat.com>

	Enable JSON and netdev features in QEMU >= 0.13
	The QEMU 0.13 release is finally out and from testing in RHEL-6
	we know that its JSON and netdev features are now good enough
	for us to use by default.

	* src/qemu/qemu_conf.c: Enable JSON + netdev for QEMU >= 0.13

2010-10-21  Eric Blake  <eblake@redhat.com>

	audit: simplify declaration
	* src/util/virtaudit.c (virAuditSend): one less ifdef, since gcc
	does not care if an ATTRIBUTE_UNUSED var gets used in some paths.

2010-10-21  Matthias Bolte  <matthias.bolte@googlemail.com>

	qemu: Exit on first error in qemuDomainGetMemoryParameters
	There is no point in trying to fill params beyond the first error,
	because when qemuDomainGetMemoryParameters returns -1 then the caller
	cannot detect which values in params are valid.

	virsh: Don't read nparams when virDomainGetMemoryParameters fails
	Also exit early when nparams is 0.

	Rename VIR_DOMAIN_SWAP_HARD_LIMIT to VIR_DOMAIN_MEMORY_SWAP_HARD_LIMIT
	To get them under the common VIR_DOMAIN_MEMORY_* prefix.

	Fix formatting of the memtune XML element
	Also output the min_guarantee element when set.

2010-10-20  Jiri Denemark  <jdenemar@redhat.com>

	Fix make check on RHEL-5
	The test for <vcpu> element is unrelated to vnc so the easiest fix is to
	remove related configuration.

2010-10-20  Matthias Bolte  <matthias.bolte@googlemail.com>

	Don't let daemon-conf test fail when auditing is disabled

2010-10-20  Nikunj A. Dadhania  <nikunj@linux.vnet.ibm.com>

	Update comments for the memory tunables macros
	* include/libvirt/libvirt.h.in: Update comment with actual description

2010-10-20  Daniel Veillard  <veillard@redhat.com>

	Add John Morrissey to AUTHORS

2010-10-20  John Morrissey  <jwm@horde.net>

	Add process= support for 'qemu-kvm -name'
	This sets the process name to the same value as the Windows title,
	but since the name is limited to 16 chars only this is kept as a
	configuration option and turned off by default
	* src/qemu/qemu.conf src/qemu/qemu_conf.[ch]: hceck for support in the
	  QEmu help output, add the option in qemu conf file and augment
	  qemudBuildCommandLine to add it if switched on
	* src/qemu/libvirtd_qemu.aug src/qemu/test_libvirtd_qemu.aug: augment
	  the augeas lenses accordingly
	* tests/qemuhelptest.c: cope with the extra flag being detected now

2010-10-20  Stefan Berger  <stefanb@us.ibm.com>

	nwfilter: avoid dir. enforcement for certain types of rules
	 Avoid the enforcement of direction if
	- icmp rules specify the type/code information
	- the 'skipMatch' variable is set to 'true'

2010-10-20  Justin Clift  <jclift@redhat.com>

	docs: added initial page for c# binding, with links to it
	Adds a new page for the C# language bindings being developed by Arnaud
	Champion.

2010-10-20  Guido Günther  <agx@sigxcpu.org>

	Don't fail lxc domain start when memory controller support is missing
	Debian stock kernel has CONFIG_CGROUP_MEM_RES_CTLR disabled due to the
	overhead [1]. Allow to start containers if the corresponding files in
	the cgroup filesystem are missing. This fixes Debian bug #566180 [2].

	[1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=534964
	[2] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=566180

2010-10-20  Matthias Bolte  <matthias.bolte@googlemail.com>

	Fix compile errors in remote.c and newly added audit code

2010-10-20  Daniel P. Berrange  <berrange@redhat.com>

	Fix symbol exports & remove duplicated libvirt_util.la linkage
	The libvirt_util.la library was mistakenly linked into libvirtd
	directly. Since libvirt_util.la is already linked to libvirt.so,
	this resulted in libvirtd getting two copies of the code and
	more critically 2 copies of static global variables.

	Testing in turn exposed a issue with loadable modules. The
	gnulib replacement functions are not exported to loadable
	modules. Rather than trying to figure out the name sof all
	gnulib functions & export them, just linkage all loadable
	modules against libgnu.la statically.

	* daemon/Makefile.am: Remove linkage of libvirt_util.la
	  and libvirt_driver.la
	* src/Makefile.am: Link driver modules against libgnu.la
	* src/libvirt.c: Don't try to load modules which were
	  compiled out
	* src/libvirt_private.syms: Export all other internal
	  symbols that are required  by drivers

2010-10-20  Miloslav Trmač  <mitr@redhat.com>

	Audit SELinux label assignment.
	A more natural auditing point would perhaps be
	SELinuxSetSecurityProcessLabel, but this happens in the child after root
	permissions are dropped, so the kernel would refuse the audit record.

2010-10-20  Miloslav Trmač  <mitr@redhat.com>

	Audit VM start/stop/suspend/resume
	Most operations are audited at the libvirtd level; auditing in
	src/libvirt.c would result in two audit entries per operation (one in
	the client, one in libvirtd).

	The only exception is a domain stopping of its own will (e.g. because
	the user clicks on "shutdown" inside the interface).  There can often be
	no client connected at the time the domain stops, so libvirtd does not
	have any virConnectPtr object on which to attach an event watch.  This
	patch therefore adds auditing directly inside the qemu driver (other
	drivers are not supported).

2010-10-20  Daniel P. Berrange  <berrange@redhat.com>

	Basic framework for auditing integration
	Integrate with libaudit.so for auditing of important operations.
	libvirtd gains a couple of config entries for auditing. By
	default it will enable auditing, if its enabled on the host.
	It can be configured to force exit if auditing is disabled
	on the host. It will can also send audit messages via libvirt
	internal logging API

	Places requiring audit reporting can use the VIR_AUDIT
	macro to report data. This is a no-op unless auditing is
	enabled

	* autobuild.sh, mingw32-libvirt.spec.in: Disable audit
	  on mingw
	* configure.ac: Add check for libaudit
	* daemon/libvirtd.aug, daemon/libvirtd.conf,
	  daemon/test_libvirtd.aug, daemon/libvirtd.c: Add config
	  options to enable auditing
	* include/libvirt/virterror.h, src/util/virterror.c: Add
	  VIR_FROM_AUDIT source
	* libvirt.spec.in: Enable audit
	* src/util/virtaudit.h, src/util/virtaudit.c: Simple internal
	  API for auditing messages

2010-10-20  Daniel P. Berrange  <berrange@redhat.com>

	Fix statstest when driver modules are enabled
	The statstest is xen specific. Instead of filling the code with
	a huge number of #ifdef WITH_XEN, just make its entire compilation
	conditional in the Makefile.am. Also ensure it links to the Xen
	driver so that it builds when driver modules are enabled

	* tests/Makefile.am: Make statstest xen conditional. Link to
	  xen driver
	* tests/Makefile.am: Remove all conditionals

2010-10-20  Eric Blake  <eblake@redhat.com>

	virsh: consolidate memtune docs
	* tools/virsh.pod (memtune): Drop second copy, fill to 80 columns,
	enhance wording.

	vcpu: remove dead xen code
	* src/xen/xen_driver.h (xenUnifiedDriver): Remove now-unused
	domainGetMaxVcpus, domainSetVcpus.
	* src/xen/proxy_internal.c (xenProxyDriver): Likewise.
	* src/xen/xen_hypervisor.c (xenHypervisorDriver): Likewise.
	* src/xen/xen_inotify.c (xenInotifyDriver): Likewise.
	* src/xen/xend_internal.c (xenDaemonDriver)
	(xenDaemonDomainSetVcpus): Likewise.
	* src/xen/xm_internal.c (xenXMDriver, xenXMDomainSetVcpus):
	Likewise.
	* src/xen/xs_internal.c (xenStoreDriver): Likewise.

2010-10-20  Eric Blake  <eblake@redhat.com>

	vcpu: improve support for setting xen vcpu counts
	Tested with RHEL 5.6 (xendConfigVersion 2, where xend_internal
	controls live domains and xm_internal controls inactive domains).
	Hopefully this works with xendConfigVersion 3 (where xend_internal
	controls everything).

	* src/xen/xen_driver.c (xenUnifiedDomainSetVcpusFlags): Support
	more flags.
	(xenUnifiedGetMaxVcpus): Export.
	* src/xen/xm_internal.h (xenXMDomainSetVcpusFlags): New prototype.
	* src/xen/xend_internal.h (xenDaemonDomainSetVcpusFlags): Likewise.
	* src/xen/xen_driver.h (xenUnifiedGetMaxVcpus): Likewise.
	* src/xen/xm_internal.c (xenXMDomainSetVcpusFlags): New function.
	* src/xen/xend_internal.c (xenDaemonDomainSetVcpusFlags): Likewise.

2010-10-20  Eric Blake  <eblake@redhat.com>

	vcpu: improve support for getting xen vcpu counts
	* src/xen/xen_driver.c (xenUnifiedDomainGetVcpusFlags): Support
	more flags.
	* src/xen/xend_internal.h (xenDaemonDomainGetVcpusFlags): New
	prototype.
	* src/xen/xm_internal.h (xenXMDomainGetVcpusFlags): Likewise.
	* src/xen/xend_internal.c (virDomainGetVcpusFlags): New function.
	* src/xen/xm_internal.c (xenXMDomainGetVcpusFlags): Likewise.

2010-10-20  Eric Blake  <eblake@redhat.com>

	vcpu: improve vcpu support in xen command line
	This patch series focuses on xendConfigVersion 2 (xm_internal) and 3
	(xend_internal), but leaves out changes for xenapi drivers.

	See this link for more details about vcpu_avail for xm usage.
	http://lists.xensource.com/archives/html/xen-devel/2009-11/msg01061.html

	This relies on the fact that def->maxvcpus can be at most 32 with xen.

	* src/xen/xend_internal.c (xenDaemonParseSxpr)
	(sexpr_to_xend_domain_info, xenDaemonFormatSxpr): Use vcpu_avail
	when current vcpus is less than maximum.
	* src/xen/xm_internal.c (xenXMDomainConfigParse)
	(xenXMDomainConfigFormat): Likewise.
	* tests/xml2sexprdata/xml2sexpr-pv-vcpus.sexpr: New file.
	* tests/sexpr2xmldata/sexpr2xml-pv-vcpus.sexpr: Likewise.
	* tests/sexpr2xmldata/sexpr2xml-pv-vcpus.xml: Likewise.
	* tests/xmconfigdata/test-paravirt-vcpu.cfg: Likewise.
	* tests/xmconfigdata/test-paravirt-vcpu.xml: Likewise.
	* tests/xml2sexprtest.c (mymain): New test.
	* tests/sexpr2xmltest.c (mymain): Likewise.
	* tests/xmconfigtest.c (mymain): Likewise.

2010-10-20  Eric Blake  <eblake@redhat.com>

	vcpu: complete vcpu support in qemu driver
	* src/qemu/qemu_driver.c (qemudDomainSetVcpusFlags)
	(qemudDomainGetVcpusFlags): Support all feasible flag
	combinations.

	vcpu: improve vcpu support in qemu command line
	* src/qemu/qemu_conf.c (qemuParseCommandLineSmp): Distinguish
	between vcpus and maxvcpus, for new enough qemu.
	* tests/qemuargv2xmltest.c (mymain): Add new test.
	* tests/qemuxml2argvtest.c (mymain): Likewise.
	* tests/qemuxml2xmltest.c (mymain): Likewise.
	* tests/qemuxml2argvdata/qemuxml2argv-smp.args: New file.

	vcpu: support all flags in test driver
	* src/test/test_driver.c (testDomainGetVcpusFlags)
	(testDomainSetVcpusFlags): Support all flags.
	(testDomainUpdateVCPUs): Update cpu count here.

	vcpu: add virsh support
	* tools/virsh.c (cmdSetvcpus): Add new flags.  Let invalid
	commands through to driver, to ease testing of hypervisor argument
	validation.
	(cmdMaxvcpus, cmdVcpucount): New commands.
	(commands): Add new commands.
	* tools/virsh.pod (setvcpus, vcpucount, maxvcpus): Document new
	behavior.

2010-10-20  Eric Blake  <eblake@redhat.com>

	vcpu: support maxvcpu in domain_conf
	Although this patch adds a distinction between maximum vcpus and
	current vcpus in the XML, the values should be identical for all
	drivers at this point.  Only in subsequent per-driver patches will
	a distinction be made.

	In general, virDomainGetInfo should prefer the current vcpus.

	* src/conf/domain_conf.h (_virDomainDef): Adjust vcpus to unsigned
	short, to match virDomainGetInfo limit.  Add maxvcpus member.
	* src/conf/domain_conf.c (virDomainDefParseXML)
	(virDomainDefFormat): parse and print out vcpu details.
	* src/xen/xend_internal.c (xenDaemonParseSxpr)
	(xenDaemonFormatSxpr): Manage both vcpu numbers, and require them
	to be equal for now.
	* src/xen/xm_internal.c (xenXMDomainConfigParse)
	(xenXMDomainConfigFormat): Likewise.
	* src/phyp/phyp_driver.c (phypDomainDumpXML): Likewise.
	* src/openvz/openvz_conf.c (openvzLoadDomains): Likewise.
	* src/openvz/openvz_driver.c (openvzDomainDefineXML)
	(openvzDomainCreateXML, openvzDomainSetVcpusInternal): Likewise.
	* src/vbox/vbox_tmpl.c (vboxDomainDumpXML, vboxDomainDefineXML):
	Likewise.
	* src/xenapi/xenapi_driver.c (xenapiDomainDumpXML): Likewise.
	* src/xenapi/xenapi_utils.c (createVMRecordFromXml): Likewise.
	* src/esx/esx_vmx.c (esxVMX_ParseConfig, esxVMX_FormatConfig):
	Likewise.
	* src/qemu/qemu_conf.c (qemuBuildSmpArgStr)
	(qemuParseCommandLineSmp, qemuParseCommandLine): Likewise.
	* src/qemu/qemu_driver.c (qemudDomainHotplugVcpus): Likewise.
	* src/opennebula/one_conf.c (xmlOneTemplate): Likewise.

2010-10-20  Eric Blake  <eblake@redhat.com>

	vcpu: make old API trivially wrap to new API
	Note - this wrapping is completely mechanical; the old API will
	function identically, since the new API validates that the exact
	same flags are provided by the old API.  On a per-driver basis,
	it may make sense to have the old API pass a different set of flags,
	but that should be done in the per-driver patch that implements
	the full range of flag support in the new API.

	* src/esx/esx_driver.c (esxDomainSetVcpus, escDomainGetMaxVpcus):
	Move guts...
	(esxDomainSetVcpusFlags, esxDomainGetVcpusFlags): ...to new
	functions.
	(esxDriver): Trivially support the new API.
	* src/openvz/openvz_driver.c (openvzDomainSetVcpus)
	(openvzDomainSetVcpusFlags, openvzDomainGetMaxVcpus)
	(openvzDomainGetVcpusFlags, openvzDriver): Likewise.
	* src/phyp/phyp_driver.c (phypDomainSetCPU)
	(phypDomainSetVcpusFlags, phypGetLparCPUMAX)
	(phypDomainGetVcpusFlags, phypDriver): Likewise.
	* src/qemu/qemu_driver.c (qemudDomainSetVcpus)
	(qemudDomainSetVcpusFlags, qemudDomainGetMaxVcpus)
	(qemudDomainGetVcpusFlags, qemuDriver): Likewise.
	* src/test/test_driver.c (testSetVcpus, testDomainSetVcpusFlags)
	(testDomainGetMaxVcpus, testDomainGetVcpusFlags, testDriver):
	Likewise.
	* src/vbox/vbox_tmpl.c (vboxDomainSetVcpus)
	(vboxDomainSetVcpusFlags, virDomainGetMaxVcpus)
	(virDomainGetVcpusFlags, virDriver): Likewise.
	* src/xen/xen_driver.c (xenUnifiedDomainSetVcpus)
	(xenUnifiedDomainSetVcpusFlags, xenUnifiedDomainGetMaxVcpus)
	(xenUnifiedDomainGetVcpusFlags, xenUnifiedDriver): Likewise.
	* src/xenapi/xenapi_driver.c (xenapiDomainSetVcpus)
	(xenapiDomainSetVcpusFlags, xenapiDomainGetMaxVcpus)
	(xenapiDomainGetVcpusFlags, xenapiDriver): Likewise.
	(xenapiError): New helper macro.

2010-10-20  Eric Blake  <eblake@redhat.com>

	vcpu: implement the remote protocol
	Done by editing the first three files, then running
	'make -C src rpcgen', then editing src/remote_protocol-structs
	to match.

	* daemon/remote.c (remoteDispatchDomainSetVcpusFlags)
	(remoteDispatchDomainGetVcpusFlags): New functions.
	* src/remote/remote_driver.c (remoteDomainSetVcpusFlags)
	(remoteDomainGetVcpusFlags, remote_driver): Client side
	serialization.
	* src/remote/remote_protocol.x
	(remote_domain_set_vcpus_flags_args)
	(remote_domain_get_vcpus_flags_args)
	(remote_domain_get_vcpus_flags_ret)
	(REMOTE_PROC_DOMAIN_SET_VCPUS_FLAGS)
	(REMOTE_PROC_DOMAIN_GET_VCPUS_FLAGS): Define wire format.
	* daemon/remote_dispatch_args.h: Regenerate.
	* daemon/remote_dispatch_prototypes.h: Likewise.
	* daemon/remote_dispatch_table.h: Likewise.
	* src/remote/remote_protocol.c: Likewise.
	* src/remote/remote_protocol.h: Likewise.
	* src/remote_protocol-structs: Likewise.

2010-10-20  Eric Blake  <eblake@redhat.com>

	vcpu: implement the public APIs
	Factors common checks (such as nonzero vcpu count) up front, but
	drivers will still need to do additional flag checks.

	* src/libvirt.c (virDomainSetVcpusFlags, virDomainGetVcpusFlags):
	New functions.
	(virDomainSetVcpus, virDomainGetMaxVcpus): Refer to new API.

2010-10-20  Eric Blake  <eblake@redhat.com>

	vcpu: define internal driver API
	* src/driver.h (virDrvDomainSetVcpusFlags)
	(virDrvDomainGetVcpusFlags): New typedefs.
	(_virDriver): New callback members.
	* src/esx/esx_driver.c (esxDriver): Add stub for driver.
	* src/lxc/lxc_driver.c (lxcDriver): Likewise.
	* src/opennebula/one_driver.c (oneDriver): Likewise.
	* src/openvz/openvz_driver.c (openvzDriver): Likewise.
	* src/phyp/phyp_driver.c (phypDriver): Likewise.
	* src/qemu/qemu_driver.c (qemuDriver): Likewise.
	* src/remote/remote_driver.c (remote_driver): Likewise.
	* src/test/test_driver.c (testDriver): Likewise.
	* src/uml/uml_driver.c (umlDriver): Likewise.
	* src/vbox/vbox_tmpl.c (Driver): Likewise.
	* src/xen/xen_driver.c (xenUnifiedDriver): Likewise.
	* src/xenapi/xenapi_driver.c (xenapiDriver): Likewise.

2010-10-20  Eric Blake  <eblake@redhat.com>

	vcpu: add new public API
	API agreed on in
	https://www.redhat.com/archives/libvir-list/2010-September/msg00456.html,
	but modified for enum names to be consistent with virDomainDeviceModifyFlags.

	* include/libvirt/libvirt.h.in (virDomainVcpuFlags)
	(virDomainSetVcpusFlags, virDomainGetVcpusFlags): New
	declarations.
	* src/libvirt_public.syms: Export new symbols.

2010-10-19  Eric Blake  <eblake@redhat.com>

	vcpu: add current attribute to <vcpu> element
	Syntax agreed on in
	https://www.redhat.com/archives/libvir-list/2010-September/msg00476.html

	<domain ...>
	  <vcpu current='x'>y</vcpu>
	...

	can now be used to specify 1 <= x <= y current vcpus, in relation
	to the boot-time max of y vcpus.  If current is omitted, then
	current and max are assumed to be the same value.

	* docs/schemas/domain.rng: Add new attribute.
	* docs/formatdomain.html.in: Document it.
	* tests/qemuxml2argvdata/qemuxml2argv-smp.xml: Add to
	domainschematest.
	* tests/xml2sexprdata/xml2sexpr-pv-vcpus.xml: Likewise.

2010-10-19  Stefan Berger  <stefanb@us.ibm.com>

	nwfilter: changes to rules in VM->host table
	In the table built for traffic coming from the VM going to the host make the following changes:

	- don't ACCEPT the packets but do a 'RETURN' and let the host-specific firewall rules in subsequent rules evaluate whether the traffic is allowed to enter

	- use the '-m state' in the rules as everywhere else

2010-10-19  Eric Blake  <eblake@redhat.com>

	build: avoid false positive syntax-check failure
	* .x-sc_po_check: Exclude docs directory.

2010-10-19  Matthias Bolte  <matthias.bolte@googlemail.com>

	proxy: Fix undefined reference to virClose
	Add src/util/files.c to libvirt_proxy_SOURCES.

2010-10-19  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Handle non-UTF-8 encoded VMX files
	ESX(i) uses UTF-8, but a Windows based GSX server writes
	Windows-1252 encoded VMX files.

	Add a test case to ensure that libxml2 provides Windows-1252
	to UTF-8 conversion.

2010-10-19  Stefan Berger  <stefanb@us.ibm.com>

	Introduce VIR_CLOSE to be used rather than close()
	Since bugs due to double-closed file descriptors are difficult to track down in a multi-threaded system, I am introducing the VIR_CLOSE(fd) macro to help avoid mistakes here.

	There are lots of places where close() is being used. In this patch I am only cleaning up usage of close() in src/conf where the problems were.

	I also dare to declare close() as being deprecated in libvirt code base (HACKING).

2010-10-19  Dan Kenigsberg  <danken@redhat.com>

	root_squash: virFileOperation may fail with EPERM too
	Over root-squashing nfs, when virFileOperation() is called as uid==0,
	it may fail with EACCES, but also with EPERM, due to
	virFileOperationNoFork()'s failed attemp to chown a writable file.

	qemudDomainSaveFlag() should expect this case, too.

2010-10-19  Dan Kenigsberg  <danken@redhat.com>

	Run initgroups() in qemudOpenAsUID()
	qemudOpenAsUID is intended to open a file with the credentials of a
	specified uid. Current implementation fails if the file is accessible to
	one of uid's groups but not owned by uid.

	This patch replaces the supplementary group list that the child process
	inherited from libvirtd with the default group list of uid.

2010-10-19  Nikunj A. Dadhania  <nikunj@linux.vnet.ibm.com>

	memtune: Add min_guarantee to the virsh memtune command
	* tools/virsh.c: Add new memory tunable "min_guarantee", currently only
	  ESX can use this
	* tools/virsh.pod: Update the manpage

	Update docs for memory parameters and memtune command
	* docs/formatdomain.html.in: Add memtune element details, added min_guarantee
	* src/libvirt.c: Update virDomainGetMemoryParameters api description, make
	  it more clear that the user first needs to call the api to get the number
	  of parameters supported and then call again to get the values.
	* tools/virsh.pod: Add usage of new command memtune in virsh manpage

2010-10-19  Dan Kenigsberg  <danken@redhat.com>

	qemu: let qemu group look below /var/lib/libvirt/qemu/
	Vdsm needs to communicate with its guest agent via unix domain socket,
	which qemu creates due to the following domain xml device:

	    <channel type='unix'>
	      <target type='virtio' name='com.redhat.rhevm.vdsm'/>
	      <source mode='bind' path='/var/lib/libvirt/qemu/channels/fcp-xp-1.com.redhat.rhevm.vdsm'/>
	    </channel>

	The location of the socket below /var/lib/libvirt/qemu/channels makes
	sense, to humans and selinux policy alike. However, that socket should
	be accessible to vdsm, too.

	Due to other (storage) reasons, vdsm is to join the "qemu" group. With
	this patch, vdsm can look below /var/lib/libvirt/qemu and connect to the
	socket.

	The socket itself should be chmod'ed to allow qemu group read/write, but
	that's for another project.

	BZ#643407

2010-10-16  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Fix check in esxDomainGetInfo's perf metric handling

2010-10-16  Eric Blake  <eblake@redhat.com>

	build: use latest gnulib, for ignore-value fix
	* .gnulib: Update to latest.

	virsh: add tests for recent cli improvements
	* tests/virshtest.c (mymain): Add tests of command parsing and
	echo command.

	virsh: new echo command
	* tools/virsh.c (cmdEcho): New command.
	(commands): Add it.
	* tools/virsh.pod (echo): Document it.

	virsh: add support for accepting arbitrary argv
	* tools/virsh.c (vshCmdOptType): Add VSH_OT_ARGV.  Delete
	unused VSH_OT_NONE.
	(vshCmddefGetData): Special case new opt flag.
	(vshCmddefHelp): Display help for argv.
	(vshCommandOptArgv): New function.

2010-10-16  Eric Blake  <eblake@redhat.com>

	docs: document how to disable memballoon
	https://bugzilla.redhat.com/show_bug.cgi?id=623903 documents a qemu
	bug that causes libvirt to hang if virt-manager happens to be
	querying balloon info when a guest is paused.  Until the qemu bug
	is fixed, people need to know how to avoid the issue.

	* docs/formatdomain.html.in (Memory balloon device): Mention
	model='none'.

2010-10-15  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Explictly declare VMX file content as UTF-8

2010-10-15  Laine Stump  <laine@laine.org>

	Fix warning about a non-literal format string in qemu_driver.c

2010-10-15  Eric Blake  <eblake@redhat.com>

	build: skip xenapi driver when building for RHEL
	https://bugzilla.redhat.com/show_bug.cgi?id=643118

	* libvirt.spec.in: Provide xenapi conditionals.

2010-10-15  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Handle name escaping properly
	VMware uses a mix of percent-, pipe- and base64-encoding in
	different combinations in different places.

	Add a testcase for this.

2010-10-14  Stefan Berger  <stefanb@us.ibm.com>

	nwfilter: prevent filters with different name but same UUID
	Patch to prevent multiple nwfilters with different name but same UUID.

2010-10-14  Eric Blake  <eblake@redhat.com>

	maint: add recent author
	* AUTHORS: List Harsh Prateek Bora, for 'make syntax-check'.

	build: fix accidental submodule reversion
	* .gnulib: Undo change in previous commit.

2010-10-14  Harsh Prateek Bora  <harsh@linux.vnet.ibm.com>

	new attribute accessmode to filesystem element
	This introduces new attribute to filesystem element
	to support customizable access mode for mount type.
	Valid accessmode are: passthrough, mapped and squash.

	Usage:
	        <filesystem type='mount' accessmode='passthrough'>
	          <source dir='/export/to/guest'/>
	          <target dir='mount_tag'/>
	        </filesystem>

	passthrough is the default model if not specified, that's
	also the current behaviour.

2010-10-14  Stefan Berger  <stefanb@us.ibm.com>

	nwfilter: cut off connections after changing filters
	The following filter transition from a filter allowing incoming TCP connections

	  <rule action='accept' direction='in' priority='401'>
	    <tcp/>
	  </rule>
	  <rule action='accept' direction='out' priority='500'>
	    <tcp/>
	  </rule>

	to one that does not allow them

	  <rule action='drop' direction='in' priority='401'>
	    <tcp/>
	  </rule>
	  <rule action='accept' direction='out' priority='500'>
	    <tcp/>
	  </rule>

	did previously not cut off existing (ssh) connections but only prevented newly initiated ones. The attached patch allows to cut off existing connections as well, thus enforcing what the filter is showing.

	I had only tested with a configuration where the physical interface is connected to the bridge where the filters are applied. This patch now also solves a filtering problem where the physical interface is not connected to the bridge, but the bridge is given an IP address and the host routes between bridge and physical interface. Here the filters drop non-allowed traffic on the outgoing side on the host.

2010-10-14  Eric Blake  <eblake@redhat.com>

	build: provide URL in 'configure --help'
	* configure.ac (AC_INIT): Provide email and URL.

	build: fix mingw build
	* .gnulib: Update to latest, for termios fix.
	* configure.ac (AC_CHECK_HEADERS): Drop redundent check.
	* bootstrap: Synchronize from upstream.
	Reported by Daniel P. Berrange.

2010-10-14  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Prohibit migration of guests with host devices
	Explicitly raising a nice error in the case user tries to migrate a
	guest with assigned host devices is much better than waiting for a
	mysterious error with no clue for the reason.

	tests: Honor LIBVIRT_{DEBUG,LOG_*} variables

	tests: Do not override LIBVIRT_DEBUG variable

	cpu: Use vendor in baseline CPU only if all hosts use it
	When only some host CPUs given to cpuBaseline contain <vendor> element,
	baseline CPU should not contain it. Otherwise the result would not be
	compatible with the host CPUs without vendor. CPU vendors are still
	taken into account when computing baseline CPU, it's just removed from
	the result.

	cpu: Fix vendor for recent CPU models
	Recent CPU models were specified using invalid vendor element
	<vendor>NAME</vendor>, which was silently ignored due to a bug in the
	code which was parsing it.

2010-10-14  Stefan Berger  <stefanb@us.ibm.com>

	test: silence nwfilter test
	 This patch silences the nwfilter test case.

2010-10-14  Eric Blake  <eblake@redhat.com>

	tests: fix spurious test failure
	Failure introduced in commit 3a092f389.

	* tests/xml2sexprdata/xml2sexpr-boot-grub.sexpr: Fix typo.

2010-10-14  Eric Blake  <eblake@redhat.com>

	memory: fix remote protocol compilation
	'make -C src rpcgen' is supposed to be idempotent.  But commit
	f928f43b7b mistakently manually edited a generated file rather
	than fixing the upstream file.

	* src/remote/remote_protocol.x (remote_memory_param_value): Use
	correct spelling of enum values.
	* src/remote/remote_protocol.c: Regenerate.

2010-10-13  Daniel P. Berrange  <berrange@redhat.com>

	Enable support for nested SVM
	This enables support for nested SVM using the regular CPU
	model/features block. If the CPU model or features include
	'svm', then the '-enable-nesting' flag will be added to the
	QEMU command line. Latest out of tree patches for nested
	'vmx', no longer require the '-enable-nesting' flag. They
	instead just look at the cpu features. Several of the models
	already include svm support, but QEMU was just masking out
	the svm bit silently. So this will enable SVM on such
	models

	* src/qemu/qemu_conf.h: flag for -enable-nesting
	* src/qemu/qemu_conf.c: Use -enable-nesting if VMX or SVM are in
	  the CPUID
	* src/cpu/cpu.h, src/cpu/cpu.c: API to check for a named feature
	* src/cpu/cpu_x86.c: x86 impl of feature check
	* src/libvirt_private.syms: Add cpuHasFeature
	* src/qemuhelptest.c: Add nesting flag where required

2010-10-13  Daniel P. Berrange  <berrange@redhat.com>

	Improve error reporting in test suites
	Before running each test case clear the thread local error
	indicator. After running each test case, dispatch any error
	that was reported

	* tests/testutils.c: Fix error reporting in test suites

2010-10-13  Daniel P. Berrange  <berrange@redhat.com>

	Update todo list file to point at bugzilla/website
	The TODO list changes frequently so cannot be well maintained
	under GIT. Update the TODO file to point people at bugzilla
	and the libvirt website

	* TODO: Point at bugzilla/website

2010-10-13  Daniel P. Berrange  <berrange@redhat.com>

	Fix Xen SEXPR generation to properly quote strings containing ()
	* src/xen/sexpr.c: Ensure () are escaped in sexpr2string
	* tests/sexpr2xmldata/sexpr2xml-boot-grub.sexpr,
	  tests/sexpr2xmldata/sexpr2xml-boot-grub.xml,
	  tests/xml2sexprdata/xml2sexpr-boot-grub.sexpr,
	  tests/xml2sexprdata/xml2sexpr-boot-grub.xml: Data files to
	  check escaping
	* tests/sexpr2xmltest.c, tests/xml2sexprtest.c: Add boot-grub
	  escaping test case

2010-10-13  Stefan Berger  <stefanb@us.ibm.com>

	nwfilter: resolve deadlock between VM ops and filter update
	 This is from a bug report and conversation on IRC where Soren reported that while a filter update is occurring on one or more VMs (due to a rule having been edited for example), a deadlock can occur when a VM referencing a filter is started.

	The problem is caused by the two locking sequences of

	qemu driver, qemu domain, filter             # for the VM start operation
	filter, qemu_driver, qemu_domain            # for the filter update operation

	that obviously don't lock in the same order. The problem is the 2nd lock sequence. Here the qemu_driver lock is being grabbed in qemu_driver:qemudVMFilterRebuild()

	The following solution is based on the idea of trying to re-arrange the 2nd sequence of locks as follows:

	qemu_driver, filter, qemu_driver, qemu_domain

	and making the qemu driver recursively lockable so that a second lock can occur, this would then lead to the following net-locking sequence

	qemu_driver, filter, qemu_domain

	where the 2nd qemu_driver lock has been ( logically ) eliminated.

	The 2nd part of the idea is that the sequence of locks (filter, qemu_domain) and (qemu_domain, filter) becomes interchangeable if all code paths where filter AND qemu_domain are locked have a preceding qemu_domain lock that basically blocks their concurrent execution

	So, the following code paths exist towards qemu_driver:qemudVMFilterRebuild where we now want to put a qemu_driver lock in front of the filter lock.

	-> nwfilterUndefine()   [ locks the filter ]
	    -> virNWFilterTestUnassignDef()
	        -> virNWFilterTriggerVMFilterRebuild()
	            -> qemudVMFilterRebuild()

	-> nwfilterDefine()
	    -> virNWFilterPoolAssignDef() [ locks the filter ]
	        -> virNWFilterTriggerVMFilterRebuild()
	            -> qemudVMFilterRebuild()

	-> nwfilterDriverReload()
	    -> virNWFilterPoolLoadAllConfigs()
	        ->virNWFilterPoolObjLoad()
	            -> virNWFilterPoolAssignDef() [ locks the filter ]
	                -> virNWFilterTriggerVMFilterRebuild()
	                    -> qemudVMFilterRebuild()

	-> nwfilterDriverStartup()
	    -> virNWFilterPoolLoadAllConfigs()
	        ->virNWFilterPoolObjLoad()
	            -> virNWFilterPoolAssignDef() [ locks the filter ]
	                -> virNWFilterTriggerVMFilterRebuild()
	                    -> qemudVMFilterRebuild()

	Qemu is not the only driver using the nwfilter driver, but also the UML driver calls into it. Therefore qemuVMFilterRebuild() can be exchanged with umlVMFilterRebuild() along with the driver lock of qemu_driver that can now be a uml_driver. Further, since UML and Qemu domains can be running on the same machine, the triggering of a rebuild of the filter can touch both types of drivers and their domains.

	In the patch below I am now extending each nwfilter callback driver with functions for locking and unlocking the (VM) driver (UML, QEMU) and introduce new functions for locking all registered callback drivers and unlocking them. Then I am distributing the lock-all-cbdrivers/unlock-all-cbdrivers call into the above call paths. The last shown callpath starting with nwfilterDriverStart() is problematic since it is initialize before the Qemu and UML drives are and thus a lock in the path would result in a NULL pointer attempted to be locked -- the call to virNWFilterTriggerVMFilterRebuild() is never called, so we never lock either the qemu_driver or the uml_driver in that path. Therefore, only the first 3 paths now receive calls to lock and unlock all callback drivers. Now that the locks are distributed where it matters I can remove the qemu_driver and uml_driver lock from qemudVMFilterRebuild() and umlVMFilterRebuild() and not requiring the recursive locks.

	For now I want to put this out as an RFC patch. I have tested it by 'stretching' the critical section after the define/undefine functions each lock the filter so I can (easily) concurrently execute another VM operation (suspend,start). That code is in this patch and if you want you can de-activate it. It seems to work ok and operations are being blocked while the update is being done.
	I still also want to verify the other assumption above that locking filter and qemu_domain always has a preceding qemu_driver lock.

2010-10-13  Eric Blake  <eblake@redhat.com>

	virsh: update comment about parsing
	* tools/virsh.c: Update comments to match patch series.

	virsh: move code into topological order
	* tools/virsh.c (vshCommandParse): Float up, to avoid the need for
	a forward declaration.

2010-10-13  Eric Blake  <eblake@redhat.com>

	virsh: simplify top-level option parsing
	This makes 'virsh --conn test:///default help help' work right;
	previously, the abbreviation confused our hand-rolled option parsing.

	* tools/virsh.c (vshParseArgv): Use getopt_long feature, rather
	than (incorrectly) reparsing options ourselves.

2010-10-13  Lai Jiangshan  <laijs@cn.fujitsu.com>

	virsh: add -- support
	"--" means no option at the following arguments.

2010-10-13  Lai Jiangshan  <laijs@cn.fujitsu.com>

	virsh: support single quote
	Some users may type command like this at the virsh shell:
	virsh # somecmd 'some arg'

	because they often use single quote in linux shell.

2010-10-13  Lai Jiangshan  <laijs@cn.fujitsu.com>

	virsh: add escaper \ for command string parsing
	add escaper \ for command string parsing, example:

	virsh # cd /path/which/have/a/double\"quote

2010-10-13  Eric Blake  <eblake@redhat.com>

	virsh: document options in man page
	* tools/virsh.pod: Document top-level options.

2010-10-13  Lai Jiangshan  <laijs@cn.fujitsu.com>

	virsh: rework command parsing
	Old virsh command parsing mashes all the args back into a string and
	miss the quotes, this patches fix it. It is also needed for introducing
	qemu-monitor-command which is very useful.

	This patches uses the new vshCommandParser abstraction and adds
	vshCommandArgvParse() for arguments vector, so we don't need
	to mash arguments vector into a command sting.

	And the usage was changed:
	old:
	virsh [options] [commands]

	new:
	virsh [options]... [<command_string>]
	virsh [options]... <command> [args...]

	So we still support commands like:
	"define D.xml; dumpxml D" was parsed as a commands-string.

	and support commands like:
	we will not mash them into a string, we use new argv parser for it.

	But we don't support the command like:
	"define D.xml; dumpxml" was parsed as a command-name, but we have no such command-name.

2010-10-13  Lai Jiangshan  <laijs@cn.fujitsu.com>

	virsh: add vshCommandParser abstraction
	add vshCommandParser and make vshCommandParse() accept different
	parsers.

	the current code for parse command string is integrated as
	vshCommandStringParse().

2010-10-13  Lai Jiangshan  <laijs@cn.fujitsu.com>

	virsh: better handling the boolean option
	in old code the following commands are equivalent:
	     virsh # dumpxml --update-cpu=vm1
	     virsh # dumpxml --update-cpu vm1
	because the old code split the option argument into 2 parts:
	--update-cpu=vm1 is split into update-cpu and vm1,
	and update-cpu is a boolean option, so the parser takes vm1 as another
	argument, very strange.

	after this patch applied, the first one will become illegal.

	To achieve this, we don't parse/check options when parsing command sting,
	but check options when parsing a command argument. And the argument is
	not split when parsing command sting.

2010-10-13  Lai Jiangshan  <laijs@cn.fujitsu.com>

	virsh: allow zero length arguments
	the following command is allowed at shell, we also make it allowed at virsh shell.

2010-10-13  Eric Blake  <eblake@redhat.com>

	virsh: poison raw allocation routines
	* tools/virsh.c (malloc, calloc, realloc, strdup): Enforce that
	within this file, we use the safe vsh wrappers instead.
	(cmdNodeListDevices, cmdSnapshotCreate, main): Fix violations of
	this policy.

2010-10-13  Lai Jiangshan  <laijs@cn.fujitsu.com>

	virsh: better support double quote
	In origin code, double quote is only allowed at the begin or end
	"complicated argument"
	--some_opt="complicated string"  (we split this argument into 2 parts,
	option and data, the data is "complicated string").

	This patch makes it allow double quote at any position of
	an argument:
	complicated" argument"
	complicated" "argument
	--"some opt=complicated string"

	This patch is also needed for the following patches,
	the following patches will not split option argument into 2 parts,
	so we have to allow double quote at any position of an argument.

2010-10-13  Guido Günther  <agx@sigxcpu.org>

	Don't fail on missing D-Bus
	We don't fail when we can't contact HAL so we shouldn't fail if we can't
	contact D-Bus either.

2010-10-13  Daniel Veillard  <veillard@redhat.com>

	Fixes for documentation extraction
	* include/libvirt/libvirt.h.in: some of the function type description
	  were broken so they could not be automatically documented
	* src/util/event.c docs/apibuild.py: event.c exports one public API
	  so it needs to be scanned too, avoid a few warnings

2010-10-13  Daniel P. Berrange  <berrange@redhat.com>

	Implement support for virtio plan9fs filesystem passthrough in QEMU
	Make use of the existing <filesystem> element to support plan9fs
	filesystem passthrough in the QEMU driver

	    <filesystem type='mount'>
	      <source dir='/export/to/guest'/>
	      <target dir='/import/from/host'/>
	    </filesystem>

	NB, the target is not actually a directory, it is merely a arbitrary
	string tag that is exported to the guest as a hint for where to mount
	it.

2010-10-13  Daniel P. Berrange  <berrange@redhat.com>

	Add todo.pl and config example to EXTRA_DIST
	* docs/Makefile.am: Add todo.pl and todo.cfg-example to EXTRA_DIST

2010-10-13  Matthias Bolte  <matthias.bolte@googlemail.com>

	Fix several minor problems introduced by the memtune series
	Add proper documentation to the new VIR_DOMAIN_MEMORY_* macros in
	libvirt.h.in to placate apibuild.py.

	Mark args as unused in for libvirt_virDomain{Get,Set}MemoryParameters
	in the Python bindings and add both to the libvirtMethods array.

	Update remote_protocol-structs to placate make syntax-check.

	Undo unintended modifications in vboxDomainGetInfo.

	Update the function table of the VirtualBox and XenAPI drivers.

2010-10-13  Nikunj A. Dadhania  <nikunj@linux.vnet.ibm.com>

	Remote protocol implementation of virDomainSet/GetMemoryParameters

	Adding memtune command to virsh tool
	The command helps to control the memory/swap parameters for the system, for
	eg. hard_limit (max memory the vm can use), soft_limit (limit during memory
	contention), swap_hard_limit(max swap the vm can use)

2010-10-13  Daniel Veillard  <veillard@redhat.com>

	Avoid checking against strncpy in virsh.c
	since the replacement function virStrcpy is not available

2010-10-13  Nikunj A. Dadhania  <nikunj@linux.vnet.ibm.com>

	Implement domainGetMemoryParamters for LXC
	Driver interface for getting memory parameters, eg. hard_limit,
	soft_limit and swap_hard_limit.

	Implement domainSetMemoryParamters for LXC
	Add support in the lxc driver for various memory controllable parameters

	Adding memtunables to libvirt-lxc command
	libvirt-lxc now configures the hardlimit, softlimit and swaplimit, if
	specified in the domain xml file or picks up the defaults.

	Adding memtunables to qemuSetupCgroup
	QEmu startup will pick up the memory tunables specified in the domain
	configuration file

	Implement domainGetMemoryParamters for QEmu
	Driver interface for getting memory parameters, eg. hard_limit,
	soft_limit and swap_hard_limit based on cgroup support

	Implement domainSetMemoryParamters for QEmu
	Driver interface for setting memory hard_limit, soft_limit and swap
	hard_limit based on cgroup support

	Implement cgroup memory controller tunables
	Provides interfaces for setting/getting memory tunables like hard_limit,
	soft_limit and swap_hard_limit

	XML parsing for memory tunables
	Adding parsing code for memory tunables in the domain xml file
	also change the internal define structures used for domain memory
	informations
	Adds a new specific test

2010-10-13  Daniel Veillard  <veillard@redhat.com>

	Cleanup some tabs issues

2010-10-13  Nikunj A. Dadhania  <nikunj@linux.vnet.ibm.com>

	Adds xml entries for memory tunables in domain schema
	The patch adds xml entries to the domain.rng file.

	v2:
	+ Fix typo min_guarantee

2010-10-13  Nikunj A. Dadhania  <nikunj@linux.vnet.ibm.com>

	Adding virDomainSetMemoryParameters and virDomainGetMemoryParameters API
	Public api to set/get memory tunables supported by the hypervisors.

	dv:
	* some cleanups in libvirt.c
	* adding extra checks in libvirt.c new entry points

	v4:
	* Move exporting public API to this patch
	* Add unsigned int flags to the public api for future extensions

	v3:
	* Add domainGetMemoryParamters and NULL in all the driver interface

	v2:
	* Initialize domainSetMemoryParameters to NULL in all the driver
	  interface structure.

2010-10-13  Nikunj A. Dadhania  <nikunj@linux.vnet.ibm.com>

	Adding structure and defines for virDomainSet/GetMemoryParameters
	This patch adds a structure virMemoryParameter, it contains the name of
	the
	parameter and the type of the parameter along with a union.

	dv:
	+ rename enums to VIR_DOMAIN_MEMORY_PARAM_*
	+ remove some extraneous tabs

	v4:
	+ Add unsigned int flags to the public api for future extensions

	v3:
	+ Protoype for virDomainGetMemoryParameters and dummy python binding.

	v2:
	+ Includes dummy python bindings for the library to build cleanly.
	+ Define string constants like "hard_limit", etc.
	+ re-order this patch.

2010-10-12  Jiri Denemark  <jdenemar@redhat.com>

	cpu: Remove redundant features
	Some features provided by the recently added CPU models were mentioned
	twice for each model. This was a result of automatic generation of the
	XML from qemu's CPU configuration file without noticing this redundancy.

2010-10-12  Eric Blake  <eblake@redhat.com>

	util: add missing export
	Commit 1fe2927a3 forgot to export a symbol.

	* src/libvirt_private.syms (virHexToBin): Add.
	* src/.gitignore: Ignore temporary file.

2010-10-12  Daniel P. Berrange  <berrange@redhat.com>

	Set sensible defaults for cpu match and feature policy
	To enable the CPU XML from the capabilities to be pasted directly
	into the guest XML with no editing, pick a sensible default for
	match and feature policy. The CPU match will be exact and the
	feature policy will be require. This should ensure safety for
	migration and give DWIM semantics for users

	* src/conf/cpu_conf.c: Default to exact match and require policy
	* docs/formatdomain.html.in: Document new defaults

2010-10-12  Daniel P. Berrange  <berrange@redhat.com>

	Add automatic generation of a todo item page
	This adds a script to generate the todo item page from
	bugzilla. This requires a valid username+password for
	bugzilla, so it is intended that this only be run on
	the libvirt.org website via cron. Normal usage will just
	generate an empty stub page.

	* docs/todo.pl: Script to extract todo items from bugzilla
	* docs/todo.cfg-example: Example config file
	* docs/sitemap.html.in: Add todo page
	* docs/Makefile.am: Generation rules for todo items

2010-10-12  Jiri Denemark  <jdenemar@redhat.com>

	xen: Fix virDomain{At,De}tachDevice
	According to API documentation virDomain{At,De}tachDevice calls are
	supposed to only work on active guests for device hotplug. For anything
	beyond that, their *Flags variants have to be used.

	Despite the variant which was acked on libvirt mailing list
	(https://www.redhat.com/archives/libvir-list/2010-January/msg00385.html)
	commit ed9c14a7ef86d7a45a6d57cbfee5410fca428633 (by Jim Fehlig)
	introduced automagic behavior of these API calls for xen driver. Since
	January, these calls always change persistent configuration of a guest
	and if the guest is currently active, they also hot(un)plug the device.

	That change didn't follow API documentation and also broke device
	hot(un)plug for older xend implementations which do not support changing
	persistent configuration of a guest and hot(un)plugging in one step.

	This patch should not break anything for active guests. On the other
	hand, changing inactive guests is not supported any more.

2010-10-12  Jiri Denemark  <jdenemar@redhat.com>

	xen: xenXMDomain*DeviceFlags should obey all flags
	xenXMDomain*DeviceFlags() silently ignores requests to modify live
	configuration of an active guest while still touching its persistent
	configuration.

	xen: Fix logic bug in xenDaemon*DeviceFlags

2010-10-12  Jiri Denemark  <jdenemar@redhat.com>

	xen: Make xenDaemon*DeviceFlags errors less confusing
	When a user calls to virDomain{Attach,Detach,Update}DeviceFlags() with
	flags == VIR_DOMAIN_DEVICE_MODIFY_LIVE on an inactive guest running on
	an old Xen hypervisor (such as RHEL-5) xend_internal driver reports:

	    Xend version does not support modifying persistent config

	which is pretty confusing since no-one requested to modify persistent
	config.

2010-10-12  Guido Günther  <agx@sigxcpu.org>

	Return a suitable error message if we can't find a matching emulator

2010-10-09  Guido Günther  <agx@sigxcpu.org>

	Pass -n to ip(6)tables
	to avoid long timeouts waiting for DNS servers

2010-10-07  Stefan Berger  <stefanb@us.ibm.com>

	nwfilter: Add 2nd example to the html docs
	This patch adds another example to the nwfilter html page and provides 2 solutions for how to write a filter meeting the given requirements using newly added features.

	nwfilter: Extend docs with info about the state attribute
	I am adding a row with information about the newly supported state
	attribute to each of the tables describing supported attributes of protocols.

	nwfilter: Extend schema to accept state attribute
	Extend the nwfilter.rng schema to accept state attribute.

	nwfilter: Add test case for testing the state attribute
	This patch adds a test case for testing the XML parser's and instantiator's
	support of the state attribute. The other test case tests existing
	capabilities. Both test cases will be used in TCK again.

	nwfilter: Instantiate state match in ip(6)tables rules
	In this patch I am extending the rule instantiator to create the state
	match according to the state attribute in the XML. Only one iptables
	rule in the incoming or outgoing direction will be created for a rule
	in direction 'in' or 'out' respectively. A rule in direction 'inout' does
	get iptables rules in both directions.

	nwfilter: Extend XML parser and gen. to support state attr.
	The patch below extends the XML parser and generator so that every l3 protocol
	now can have a state attribute.

2010-10-06  Eric Blake  <eblake@redhat.com>

	build: require pkg-config for bootstrap
	* .gnulib: Update to latest, for bootstrap fixes.
	* bootstrap: Synchronize with upstream.
	* bootstrap.conf: Add pkg-config pre-requisite.
	* autogen.sh: Tweak wording message.
	Reported by Justin Clift, and with feedback from Bruno Haible.

2010-10-06  Jiri Denemark  <jdenemar@redhat.com>

	xen: Fix bogus error when attaching a device
	The xm internal xen driver only supports disk and network devices to be
	added to a guest. On an attempt to attach any other device the xm driver
	used VIR_ERR_XML_ERROR which resulted in a completely bogus error
	message:

	error: Failed to attach device from pci.xml
	error: XML description for unknown device is not well formed or invalid

2010-10-05  Justin Clift  <jclift@redhat.com>

	configure: disable network and storage-fs drivers on mac os x
	Disabling these two drivers on MacOS X, where they are known to
	not work, allows libvirt (including the daemon) to compile without
	any further changes.

2010-10-04  Stefan Berger  <stefanb@us.ibm.com>

	nwfilter: fix memory leaks
	Fixing memory leak shown by valgrind and freeing buffer in two more places.

2010-10-02  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Add support for virtual serial device network backing
	Since version 4.1 ESX(i) can expose virtual serial devices over TCP.

	Add support in the VMX handling code for this, add test cases to cover
	it and add links to some documentation.

	ESX supports two additional protocols: TELNETS and TLS. Add them to
	the list of serial-over-TCP protocols.

2010-10-02  Eric Blake  <eblake@redhat.com>

	vcpu: improve cpuset attribute
	The <vcpu cpuset=...> attribute has been available since commit
	e193b5dd, but without documentation or RNG validation.

	* docs/schemas/domain.rng (vcpu): Further validate cpuset.
	* docs/formatdomain.html.in: Document it.
	* src/conf/domain_conf.c: Fix typos.

2010-10-01  Matthias Bolte  <matthias.bolte@googlemail.com>

	phyp: Verify that domain XML contains at least one disk element
	phypBuildLpar expects that at least one disk element is provided.

2010-10-01  Jamie Strandboge  <jamie@canonical.com>

	virt-aa-helper-test cleanups
	Don't cat | sed, just sed.  Suggested by Eric Blake.

2010-10-01  Jamie Strandboge  <jamie@canonical.com>

	implement usb and pci hot attach in AppArmor driver
	Description: Implement AppArmorSetSecurityHostdevLabel() and
	AppArmorRestoreSecurityHostdevLabel() for hostdev and pcidev attach.

	virt-aa-helper also has to be adjusted because *FileIterate() is used for pci
	and usb devices and the corresponding XML for hot attached hostdev and pcidev
	is not in the XML passed to virt-aa-helper. The new '-F filename' option is
	added to append a rule to the profile as opposed to the existing '-f
	filename', which rewrites the libvirt-<uuid>.files file anew. This new '-F'
	option will append a rule to an existing libvirt-<uuid>.files if it exists,
	otherwise it acts the same as '-f'.

	load_profile() and reload_profile() have been adjusted to add an 'append'
	argument, which when true will use '-F' instead of '-f' when executing
	virt-aa-helper.

	All existing calls to load_profile() and reload_profile() have been adjusted
	to use the old behavior (ie append==false) except AppArmorSetSavedStateLabel()
	where it made sense to use the new behavior.

	This patch also adds tests for '-F'.

	Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/640993

2010-10-01  Stefan Berger  <stefanb@us.ibm.com>

	nwfilter: Add a test case for testing the comment attribute
	This patch adds a test case for testing the XML parser's and instantiator's
	support of the comment attribute.

	nwfilter: Extend docs with information about comment attr.
	I am adding a row with information about the newly supported comment
	attribute to each of the tables describing supported attributes of protocols.

	nwfilter: Extend nwfilter schema to accept comment attrib.
	Extend the nwfilter.rng schema to accept comment attributes for all protocol
	types.

2010-10-01  Stefan Berger  <stefanb@us.ibm.com>

	nwfilter: Instantiate comments in ip(6)tables rules
	In this patch I am extending the rule instantiator to create the comment
	node where supported, which is the case for iptables and ip6tables.

	Since commands are written in the format

	cmd='iptables ...-m comment --comment \"\" '

	certain characters ('`) in the comment need to be escaped to
	prevent comments from becoming commands themselves or cause other
	forms of (bash) substitutions. I have tested this with various input and in
	my tests the input made it straight into the comment. A test case for TCK
	will be provided separately that tests this.

2010-10-01  Stefan Berger  <stefanb@us.ibm.com>

	nwfilter: Extend XML parser and generator w/ comment attribute
	The patch below extends the XML parser and generator so that every protocol
	now can have a comment node. Comments are limited to 256 characters.

2010-10-01  Eric Blake  <eblake@redhat.com>

	build: fix example build on MacOS X
	Partial reversion of commit 76d87a59, now that bootstrap is smarter.

	* .gnulib: Update to latest, for poll and bootstrap fixes.
	* bootstrap: Resync from gnulib.
	* autogen.sh: Drop redundant tool checks; bootstrap does them
	better, by honoring environment variables.
	* examples/domain-events/events-c/Makefile.am (INCLUDES)
	(event_test_LDADD): Use gnulib library during build.
	* bootstrap.conf (gnulib_tool_option_extras): Revert --libtool
	addition, now that updated bootstrap does it for us.
	Reported by Justin Clift.

2010-09-29  Eduardo Otubo  <otubo@linux.vnet.ibm.com>

	phyp: Checking for NULL values when building new guest
	When creating a new gust, the function phypBuildLpar() was not
	checking for NULL values

	src/phyp/phyp_driver.c: check the definition arguments to avoid a segmentation
	  fault in phypBuildLpar()

2010-09-29  Justin Clift  <jclift@redhat.com>

	configure: tweak logic flow of virtport check
	This fixes a small logic bug, where passing --without-macvtap
	on the configure line, or otherwise indicating a lack of
	support for macvtap, causes configure to bail.

2010-09-29  Justin Clift  <jclift@redhat.com>

	mpath: disable devmapper-multipath checking on non-linux
	The configure script was breaking on MacOS X unless passed:

	  --without-storage-mpath

	This patch leverages Stefan Bergers earlier work for nwfilter,
	so non-linux systems don't even attempt to build multipath.

2010-09-29  Stefan Berger  <stefanb@us.ibm.com>

	Rework configure logic for virtualport support
	In this patch I am reworking the logic around detecting virtual port support and requiring the libnl dependency.

	- It requires --with-macvtap and displays an error in case of --without-macvtap --with-virtualport.
	- It tests for availability of certain data in include files and displays an error in case the include file is not at the correct level and --with-virtualport was chosen
	- displays 'checking' messages for macvtap and virtualport support and results
	- libnl support is required when macvtap is found or requested; if libnl is not there, please supply without-macvtap

2010-09-29  Justin Clift  <jclift@redhat.com>

	mac os x: use awk selected by build system rather than first in path
	Prior to this patch, the ChangeLog generation was hard coded to use
	"awk", when it should have been using the AWK variable set by our
	build system.

	This breaks compilation on a newly installed OS X system, where the
	default path has the Mac (non GNU) awk in the default search PATH
	before any installed GNU awk (gawk).

2010-09-28  Justin Clift  <jclift@redhat.com>

	nwfilter: remove recently added workaround define for macos x
	This reverses commit 04c3704, which added a define to nwfilter to
	allow libvirtd compilation on Mac OS X.  Stefan Bergers commit, 2e7294d,
	is the proper solution, removing the requirement for nwfilter on non-Linux.

2010-09-28  Justin Clift  <jclift@redhat.com>

	virtualbox: fix a typo in the expected location on mac os x
	Mac OS X provides an "/Applications" folder, not an "/Application" folder,
	so installed VirtualBox wasn't being detected by default.

	This 1 character patch fixes this.

2010-09-28  Dan Kenigsberg  <danken@redhat.com>

	python: drop unnecessary conn assignment
	Since 554d82a200289938d5639a782a9f12e3e2e968f0, conn is unused. Let's
	drop it - but keep the signature of the constructor for backward
	compatibility.

2010-09-28  Stefan Berger  <stefanb@us.ibm.com>

	nwfilter: Don't compile nwfilter driver on other systems than Linux
	Don't compile the nwfilter driver (instantiating the rules) on other systems than Linux.

2010-09-27  Justin Clift  <jclift@redhat.com>

	nwfilter: add a missing define, so libvirtd builds on macos x
	The nwfilter code uses ETH_ALEN, which isn't defined on MacOS X.
	This is a simple workaround, to add it when missing.

2010-09-25  Stefan Berger  <stefanb@us.ibm.com>

	nwfilter: report if ip(6)tables rules would not be active
	The patch below reports a warning in the log if the generated ip(6)tables rules would not be effective due to the proc filesystem entries

	    /proc/sys/net/bridge/bridge-nf-call-iptables
	    /proc/sys/net/bridge/bridge-nf-call-ip6tables

	containing a '0'. The warning tells the user what to do. I am rate-limiting the warning message to appear only every 10 seconds.

2010-09-24  Jamie Strandboge  <jamie@canonical.com>

	app-armor: add 'rw' for appropriate devices
	Description: Check for VIR_DOMAIN_CHR_TYPE in serial ports and add 'rw' for
	defined serial ports, parallel ports and channels

	Bug-Ubuntu: LP: #578527, LP: #609055

2010-09-24  Jamie Strandboge  <jamie@canonical.com>

	add extra tests to virt-aa-helper-test for new '-p' option

2010-09-24  Eric Blake  <eblake@redhat.com>

	docs: grammar cleanups on logging examples
	* docs/logging.html.in: Fix spelling and grammar.

2010-09-23  Philipp Hahn  <hahn@univention.de>

	Fix spelling of Xen in comments

2010-09-23  Eric Blake  <eblake@redhat.com>

	maint: update to latest gnulib
	* .gnulib: Update to latest.
	* bootstrap.conf (gnulib_modules): Add new termios module.
	(gnulib_tool_option_extras): Make libtool usage explicit.
	* src/util/util.c (includes): Gnulib now guarantees termios.h.
	* bootstrap: Resync from gnulib.

2010-09-23  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Allow '-' in VMX entry names
	Add a test for this.

	Reported by Frank Dirks.

2010-09-23  Chris Wright  <chrisw@redhat.com>

	pciFindStubDriver should return NULL on error
	pciFindStubDriver currently returns 0 in one of the error cases.
	While it's correct...NULL is more readable.

2010-09-23  Jiri Denemark  <jdenemar@redhat.com>

	libvirt-guests: start late and stop early
	libvirt-guests init script should be started as late as possible during
	host startup and stopped as early as possible during host shutdown to
	make sure required services are already/still up and running at the time
	libvirt-guests runs.

2010-09-23  Daniel P. Berrange  <berrange@redhat.com>

	Make SASL work over UNIX domain sockets
	The addrToString methods were not coping with UNIX domain sockets
	which have no normal host+port address. Hardcode special handling
	for these so that SASL routines can work over UNIX sockets. Also
	fix up SSF logic in remote client so that it presumes that a UNIX
	socket is secure

	* daemon/remote.c: Fix addrToString for UNIX sockets.
	* src/remote/remote_driver.c: Fix addrToString for UNIX sockets
	  and fix SSF logic to work for TLS + UNIX sockets in the same
	  manner

2010-09-23  Daniel P. Berrange  <berrange@redhat.com>

	Refactor some daemon code to facilitate introduction of static probes
	Refactor some daemon code to facilitate the introductioin of static
	probes, sanitizing function exit paths in many places

	* daemon/libvirtd.c: Pass the dname string into remoteCheckDN
	  to let caller deal with failure paths. Add separate exit paths
	  to remoteCheckCertificate for auth failure vs denial. Merge
	  all exit paths in qemudDispatchServer to one cleanup block
	* daemon/remote.c: Add separate exit paths to SASL & PolicyKit
	  functions for auth failure vs denial

2010-09-22  Eric Blake  <eblake@redhat.com>

	nodeinfo: work when hot-plugging is disabled
	Fixes https://bugzilla.redhat.com/show_bug.cgi?id=635857.

	* src/nodeinfo.c (cpu_online): Allow missing directory for all
	CPUs, not just cpu0.

2010-09-22  Stefan Berger  <stefanb@us.ibm.com>

	This patch fixes a bug appearing on big endian machines where the returned XML is not the one that is expected (see test/nwfilterxml2xmltest). The problem is due to for example the casting of pointers to unsigned integers to void * and then back to 16 bit integers.

2010-09-17  Eric Blake  <eblake@redhat.com>

	tests: silence qemuargv2xmltest noise
	Before this patch, the testsuite was noisy:

	TEST: qemuargv2xmltest
	      ........................................ 40
	      ................20:41:28.046: warning : qemuParseCommandLine:6565 : unknown QEMU argument '-unknown', adding to the qemu namespace
	20:41:28.046: warning : qemuParseCommandLine:6565 : unknown QEMU argument 'parameter', adding to the qemu namespace
	.                        57  OK
	PASS: qemuargv2xmltest

	It's not a real failure (which is why the test was completing
	successfully), so much as an intentional warning to the user that use
	of the qemu namespace has the potential for undefined effects that
	leaked through the default logging behavior.  After this patch series,
	all tests can access any logged data, and this particular test can
	explicitly check for the presence or absence of the warning, such that
	the test output becomes:

	TEST: qemuargv2xmltest
	      ........................................ 40
	      .................                        57  OK
	PASS: qemuargv2xmltest

	* tests/testutils.h (virtTestLogContentAndReset): New prototype.
	* tests/testutils.c (struct virtTestLogData): New struct.
	(virtTestLogOutput, virtTestLogClose, virtTestLogContentAndReset):
	New functions.
	(virtTestMain): Always capture log data emitted during tests.
	* tests/qemuargv2xmltest.c (testCompareXMLToArgvHelper, mymain):
	Use flag to mark which tests expect noisy stderr.
	(testCompareXMLToArgvFiles): Add parameter to test whether stderr
	was appropriately silent.

2010-09-17  Eric Blake  <eblake@redhat.com>

	tests: clean up qemuargv2xmltest
	Since commit 107a7bd06bc, the extraFlags argument was unused.

	* tests/qemuargv2xmltest.c (DO_TEST): Drop extraFlags argument.
	Adjust all callers.

2010-09-16  Justin Clift  <jclift@redhat.com>

	docs: reworked the policykit patch submitted by Patrick Dignan
	Tweaked the PolicyKit documentation improvement patch submitted
	by Patrick Dignan.

	Additionally, removed the reference to PolicyKit.conf, which is
	no longer used by PolicyKit, plus added a link to the expanded
	PolicyKit example page on the wiki.

2010-09-16  Justin Clift  <jclift@redhat.com>

	docs: fix the xml validity errors regarding name and id
	Got sick of seeing the "validity error : ID Objects already defined"
	errors, which this patch addresses.

2010-09-16  Eric Blake  <eblake@redhat.com>

	build: avoid non-portable IPv6 struct member, for MacOS X
	* src/util/network.c (getIPv6Addr): Manually join s6_addr bytes,
	instead of assuming s6_addr16 shorts.
	Reported by Justin Clifton; solution suggested by Bruno Haible.

2010-09-16  Justin Clift  <jclift@redhat.com>

	virsh: change wexitstatus order to allow compilation on mac osx
	This is the simple fix Daniel Veillard suggested last year:

	  http://www.redhat.com/archives/libvir-list/2009-May/msg00459.html

2010-09-16  Justin Clift  <jclift@redhat.com>

	libvirtd: improve the error message displayed on tls client auth failure
	This address BZ # 556599:

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

2010-09-14  Eric Blake  <eblake@redhat.com>

	maint: silence warning from libtool
	I got tired of seeing this.

	config.status: executing libtool commands
	/bin/rm: cannot remove `libtoolT': No such file or directory
	config.status: executing po-directories commands

	While I was at it, there were a couple other unused variables.

	* configure.ac (RM, MV, TAR): Drop; nothing in libvirt directly uses
	this, and assigning RM interferes with libtool.

2010-09-14  Soren Hansen  <soren@linux2go.dk>

	Rebuild network filter for UML guests on updates
	When nwfilter support was added to UML, I didn't realise the UML driver
	needed instrumentation to make updating nwfilters on the fly work. This
	patch adds this bit of glue.

2010-09-14  Jiri Denemark  <jdenemar@redhat.com>

	virsh: Use virBuffer for generating XML
	cmdAttachInterface and cmdAttachDisk still used vshRealloc and sprintf
	for generating XML, which is hardly maintainable. Let's get rid of this
	old code.

2010-09-14  Eric Blake  <eblake@redhat.com>

	build: use portable sed expressions
	* src/Makefile.am (libvirt.def, libvirt_qemu.def): '\}' and '\t'
	are not required by POSIX.  Use '}' and literal tab instead.
	(install-data-local): Avoid sed -i.
	* tests/read-bufsiz: Likewise.
	Reported by Mitchell Hashimoto.

2010-09-14  Justin Clift  <jclift@redhat.com>

	docs: improve wording for the dev guide
	Wording tweak suggested by David Jorm, author of the libvirt App Dev Guide.

2010-09-13  Jiri Denemark  <jdenemar@redhat.com>

	tests: Fix preprocessor indentation

2010-09-10  Justin Clift  <jclift@redhat.com>

	docs: add the app dev guide
	Added a workable initial page for the libvirt Application
	Development Guide, giving the online viewable options +
	the available download ones (pdf, epub, srpm).

	Added a link to the PDF to the main Downloads page, plus
	neatened the html tags throughout the page as they
	were a bit of a mess.

	Added --enable-compile-warnings=error to the autogen line,
	as suggested by Eric Blake.

2010-09-10  Daniel Veillard  <veillard@redhat.com>

	Libvirt release 0.8.4
	update news, spec and french localizaton

2010-09-10  Cole Robinson  <crobinso@redhat.com>

	buf: Fix possible infinite loop in EscapeString, VSnprintf
	The current code will go into an infinite loop if the printf generated
	string is >= 1000, AND exactly 1 character smaller than the amount of free
	space in the buffer. When this happens, we are dropped into the loop body,
	but nothing will actually change, because count == (buf->size - buf->use - 1),
	and virBufferGrow returns unchanged if count < (buf->size - buf->use)

	Fix this by removing the '- 1' bit from 'size'. The *nprintf functions handle
	the NULL byte for us anyways, so we shouldn't need to manually accommodate
	for it.

	Here's a bug where we are actually hitting this issue:
	https://bugzilla.redhat.com/show_bug.cgi?id=602772

	v2: Eric's improvements: while -> if (), remove extra va_list variable,
	    make sure we report buffer error if snprintf fails

	v3: Add tests/virbuftest which reproduces the infinite loop before this
	    patch, works correctly after

2010-09-10  Guido Günther  <agx@sigxcpu.org>

	Fix block statistics with newer versions of Xen
	Apparently the xen block device statistics moved from
	"/sys/devices/xen-backend/vbd-%d-%d/statistics/%s"
	to
	"/sys/bus/xen-backend/devices/vbd-%d-%d/statistics/%s"

	* src/xen/block_stats.c: try the extra path in case of failure to
	  find the statistics in /sys

2010-09-10  Jiri Denemark  <jdenemar@redhat.com>

	virsh: Option for overriding disk type in attach-disk
	Unless --driver tap|file option was given to attach-disk, virsh would
	generate <disk type='block'> XML which might be fine for Xen but not for
	other hypervisors. This patch introduces a new option --sourcetype which
	can be used to explicitly set the type of disk source. The option
	accepts either "file" or "block" types.

2010-09-10  Daniel P. Berrange  <berrange@redhat.com>

	Fix dependancies for remote generated files
	Very occasionally during a parallel make, dispatch.c would
	be compiled before the generated remote headers had been
	fully written. This would cause it to compile an empty
	union, and result in really wierd runtime bugs that are
	near impossible to diagnose.

	* daemon/Makefile.am: Fix remote build deps

2010-09-10  Daniel P. Berrange  <berrange@redhat.com>

	Ensure remote daemon unions are always non-zero length
	If the remote daemon args/ret unions ever become zero length
	(due to a build / Makefile bug) then bad stuff happens at
	runtime. Add a compile time assertion to check for this kind
	of problem

	* daemon/remote.h: Ensure non-zero length unions

2010-09-10  Daniel P. Berrange  <berrange@redhat.com>

	Fix off-by-1 in QEMU boot arg array handling
	A QEMU guest can have upto VIR_DOMAIN_BOOT_LAST boot entries
	defined. When building the QEMU arg, each entry takes a
	single byte. This means the array must be declared to be
	VIR_DOMAIN_BOOT_LAST+1 bytes in length to allow for the
	trailing null

	* src/qemu/qemu_conf.c: Fix off-by-1 boot arg array size

2010-09-10  Jiri Denemark  <jdenemar@redhat.com>

	bridge: Fix static-only DHCP configuration
	For static-only DHCP, i.e. with no <range> but at least one <host>
	element within <dhcp> element, we have to add "--dhcp-range IP,static"
	option to dnsmasq to actually enable the service. Without this option,
	dnsmasq will not respond to DHCP requests.

2010-09-10  Luiz Capitulino  <lcapitulino@redhat.com>

	qemu: qemuMonitorJSONEjectMedia(): Fix arguments' type
	QMP in QEMU 0.13 has been fixed to enforce type correctness,
	this means that boolean types must be true or false, not
	integers.

	qemu: qemuMonitorJSONMigrate(): Fix arguments' type
	QMP in QEMU 0.13 has been fixed to enforce type correctness,
	this means that boolean types must be true or false, not
	integers.

2010-09-10  Soren Hansen  <soren@linux2go.dk>

	Add nwfilter support to UML driver
	Extend user-mode-linux driver to support nwfilter.

2010-09-10  Matthias Bolte  <matthias.bolte@googlemail.com>

	test: Don't overwrite storage volume target path and key
	Only generate target path and key when they are not defined
	in the XML config.

2010-09-09  Daniel Veillard  <veillard@redhat.com>

	Remove hack to get static binaries in DV environment

2010-09-08  Justin Clift  <jclift@redhat.com>

	Moved my name up to the primary list, as I have commit rights now.
	As recommended by Eric. :)

2010-09-08  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Use SessionIsActive when available
	Before this commit SessionIsActive was not used because ESX(i)
	doesn't implement it. vCenter supports SessionIsActive, so use
	it here, but keep the fall back mechanism for ESX(i) and GSX.

	esx: Fall back to path as key when QueryVirtualDiskUuid isn't available
	QueryVirtualDiskUuid is only available on an ESX(i) server. vCenter
	returns an NotImplemented fault and a GSX server is missing the
	VirtualDiskManager completely. Therefore only use QueryVirtualDiskUuid
	with an ESX(i) server and fall back to path as storage volume key for
	vCenter and GSX server.

2010-09-08  Eric Blake  <eblake@redhat.com>

	mingw: match recent changes in spec file
	* libvirt.spec.in (%file): List new installed files.
	* configure.ac (with_init_script): Assume default of none when
	cross-compiling.

2010-09-07  Jiri Denemark  <jdenemar@redhat.com>

	build: Fix permissions of sysconfig files

2010-09-05  Daniel Veillard  <veillard@redhat.com>

	Update of localization files
	- Updated dutch, spanish and russian, regenerated the po/pot files

2010-09-04  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Use the VirtualDisk UUID as storage volume key
	VirtualDisks are .vmdk file based. Other files in a datastore
	like .iso or .flp files don't have a UUID attached, fall back
	to the path as key for them.

	esx: Add .vmdk storage volume creation

2010-09-04  Jean-Baptiste Rouault  <jean-baptiste.rouault@diateam.net>

	OpenVZ: add ethernet interface type support
	This patch adds support for ethernet interface type to OpenVZ domains
	as stated in this previous message: http://www.redhat.com/archives/libvir-
	list/2010-July/msg00658.html

2010-09-03  Eric Blake  <eblake@redhat.com>

	build: avoid uninitialized variable warning
	* src/vbox/vbox_tmpl.c (vboxAttachDrives): Capture return value.

2010-09-03  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Rework datastore path parsing and handling
	Instead of splitting the path part of a datastore path into
	directory and file name, keep this in one piece. An example:

	  "[datastore] directory/file"

	was split into this before:

	  datastoreName = "datastore"
	  directoryName = "directory"
	  fileName = "file"

	Now it's split into this:

	  datastoreName = "datastore"
	  directoryName = "directory"
	  directoryAndFileName = "directory/file"

	This simplifies code using esxUtil_ParseDatastorePath, because
	directoryAndFileName is used more often than fileName. Also the
	old approach expected the datastore path to reference an actual
	file, but this isn't always correct, especially when listing
	volumes. In that case esxUtil_ParseDatastorePath is used to parse
	a path that references a directory. This fails for a vpx://
	connection because the vCenter returns directory paths with a
	trailing '/'. The new approach is robust against this and the
	actual decision if the datastore path should reference a file or
	a directory is up to the caller of esxUtil_ParseDatastorePath.

	Update the tests accordingly.

2010-09-03  Eric Blake  <eblake@redhat.com>

	vbox: factor a large function
	* src/vbox/vbox_tmpl.c (vboxDomainDefineXML): Split...
	(vboxSetBootDeviceOrder, vboxAttachDrives, vboxAttachSound)
	(vboxAttachNetwork, vboxAttachSerial, vboxAttachParallel)
	(vboxAttachVideo, vboxAttachDisplay, vboxAttachUSB): ...into new
	helper functions.

	lxc: avoid large stacks with veth creation
	* src/lxc/veth.h (vethCreate): Change prototype.
	* src/lxc/veth.c (vethCreate): Always malloc veth2, and allocate
	veth1 if needed.
	(getFreeVethName): Adjust signature, and use virAsprintf.
	* src/lxc/lxc_driver.c (lxcSetupInterfaces): Adjust caller.

2010-09-02  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Fix generator for string return values
	Distinguish between strings as parameters (const char *)
	and strings as return values (char **).

2010-09-02  Eric Blake  <eblake@redhat.com>

	openvz: use virAsprintf to avoid large stacks
	* src/openvz/openvz_conf.c (openvzLocateConfFile): Alter
	signature.
	(openvzGetVPSUUID, openvzSetDefinedUUID)
	(openvzWriteVPSConfigParam, openvzReadVPSConfigParam)
	(openvzCopyDefaultConfig): Adjust callers.

	openvz: formatting cleanups
	* src/openvz/openvz_conf.c: Whitespace fixes.
	* src/openvz/openvz_driver.c: Likewise.

	network: use virAsprintf when appropriate
	* src/conf/network_conf.c (virNetworkAllocateBridge): Avoid
	limited buffer from snprintf.

2010-09-02  Eric Blake  <eblake@redhat.com>

	build: add some modules
	snprintf is currently implicitly picked up by getaddrinfo, but we
	might as well make it explicit so that mingw doesn't break if
	getaddrinfo changes to drop the dependency.

	func doesn't matter for gcc compilation, but may help other compilers
	cope with our use of __func__.

	* bootstrap.conf (gnulib_modules): Add snprintf and func.

2010-09-01  Ryan Harper  <ryanh@us.ibm.com>

	virsh: remove driver check from attach-disk command
	Virsh shouldn't check for driver support but rather let the backend handled this.
	After removing the check, I can successfully attach file-based images to a qemu
	VM with attach-disk.

	% virsh attach-disk vm2 /images/test02.img vdc --driver qemu --type disk --subdriver raw
	Disk attached successfully

	This command generates the following XML:

	<disk type='block' device='disk'>
	      <driver name='qemu' type='raw'/>
	      <source dev='/images/test02.img'/>
	      <target dev='vdc' bus='virtio'/>
	      <alias name='virtio-disk2'/>
	      <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
	</disk>

2010-09-01  Soren Hansen  <soren@linux2go.dk>

	Use global directory as UML's monitorDir for privileged connections
	For privileged UML connections (uml:///system), we shouldn't use root's
	home dir, but rather somewhere in /var/run/libvirt/uml-guest.

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

2010-09-01  Soren Hansen  <soren@linux2go.dk>

	Explicitly pass uml_dir argument to user-mode-linux
	uml_dir overrides user-mode-linux's default of ~/.uml. This is needed
	for a couple of different reasons:

	libvirt expects this to default to virGetUserDirectory(geteuid()) +
	'/.uml'. However, user-mode-linux actually uses the HOME environment
	variable to determine where to look for the uml sockets, but if running
	libvirtd under sudo (which I routinely do during development), $HOME is
	pointing at my user's homedir, while my euid is 0, so libvirt looks in
	/root.

	Also (and this was my actual motivation for this patch), if HOME isn't
	set at all, user-mode-linux utterly fails. Looking at the code, it seems
	it's meant to emit a warning, but alas, it doesn't for some reason.
	If running libvirtd from upstart, HOME is not set, so any system using
	upstart will need this change.

2010-09-01  Eric Blake  <eblake@redhat.com>

	maint: track moved file
	* daemon/.gitignore: Move libvirt-guests.init...
	* tools/.gitignore: ...to its new location.

2010-08-31  Jim Fehlig  <jfehlig@novell.com>

	Add tests for Xen's blktap2 implementation
	xml2sexpr and sexpr2xml tests for blktap2

	Add blktap2 support to xend driver
	Xen4.0 includes a new blktap2 implementation, which is specified
	with 'tap2' prefix.  AFAICT it's configuration syntax is identical
	to blktap, with exception of 'tap2' vs 'tap' prefix.  This patch
	takes the simple approach of accepting and generating sexp
	containing 'tap2' prefix.

2010-08-31  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Map the .vmx annotation to the domain XML description
	Take care of escaping '"' and '|' (the escape character).

	Add tests for this.

2010-08-31  Matthias Bolte  <matthias.bolte@googlemail.com>

	Move hextobin as virHexToBin to util.c
	virHexToBin will be used in the .vmx handling code.

2010-08-27  Eduardo Otubo  <otubo@linux.vnet.ibm.com>

	PHYP: Bad comparison when checking for existing domain name
	When creating a new domain from XML, the check for an existing
	domain name should compare the return of the function to a valid
	LPAR ID (!= -1) and not to error (== -1).

2010-08-27  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Fix esxVI_BuildSelectSet's invalid argument check
	The check was altered in 8c48743b9737ad4d246ab6043fd299316f9a2091
	and got too strict, I've no clue how that snuck in. This check
	makes every try to open a connection using the ESX driver fail
	with an invalid argument error.

	Revert the change to the check and add a comment to prevent future
	mistakes with this check.

2010-08-27  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Add read-only storage volume access
	This allows to list existing volumes and to retrieve information
	about them.

2010-08-25  Jiri Denemark  <jdenemar@redhat.com>

	Move libvirt-guests init script and config to tools
	Since libvirt-guests init script and its configuration do not require
	libvirtd to be running/installed, it was a bad idea to put them into
	daemon directory. libvirt.spec even includes these files in
	libvirt-client subpackage, which may result in build failure for
	client-only builds when the whole daemon directory is just skipped.

	spec: Fix undefined with_libnl
	When building libvirt RPM without macvtap, with_libnl would be
	undefined.

2010-08-25  Soren Hansen  <soren@linux2go.dk>

	Support virDomainAttachDevice and virDomainDetachDevice for disks in UML
	UML supports hot plugging and unplugging of various devices. This patch
	exposes this functionality for disks.

	Rename qemudShrinkDisks to virDomainDiskRemove and move to domain_conf.c
	Other drivers will need this same functionality, so move it to up to
	conf/domain_conf.c and give it a more general name.

2010-08-25  Serge Hallyn  <serge.hallyn@canonical.com>

	docs: fix lxc examples
	* docs/drvlxc.html.in: Use correct VM name, and mention that
	libvirt_lxc might be in an alternate location.

2010-08-24  Daniel P. Berrange  <berrange@redhat.com>

	Fix handling of sparse NUMA topologies
	When finding a sparse NUMA topology, libnuma will return ENOENT
	the first time it is invoked. On subsequent invocations it
	will return success, but with an all-1's CPU mask. Check for
	this, to avoid polluting the capabilities XML with 4096 bogus
	CPUs

	* src/nodeinfo.c: Check for all-1s CPU mask

2010-08-24  Daniel P. Berrange  <berrange@redhat.com>

	Log return value for virConnectGetCapabilities
	Enabling debug doesn't show the capabilities XML for a connection.
	Add an extra debug statement for the return value

	* src/libvirt.c: Enable debug logging of capabilities XML

2010-08-24  Daniel P. Berrange  <berrange@redhat.com>

	Try harder to send RPC error message back to client
	When failing to serialize the normal RPC reply, try harder to
	send a error message back to the client, instead of immediately
	closing the connection.

	* daemon/dispatch.c: Improve error messages when RPC reply
	  can not be sent

2010-08-24  Daniel P. Berrange  <berrange@redhat.com>

	Add explicit warning messages when failing to serialize to XDR
	When libvirtd fails to serialize a message to XDR the client
	connection is terminated immediately. To enable this to be
	diagnosed, log the message which caused the problem on the
	server

	* daemon/dispatch.c: Log XDR serialization failures

2010-08-24  Soren Hansen  <soren@linux2go.dk>

	Allow chardev of type 'file' for UML domains.
	Like the comment suggested, we just open the file and pass the file
	descriptor to uml. The input "stream" is set to "null", since I couldn't
	find any useful way to actually use a file for input for a chardev and
	this also mimics what e.g. QEmu does internally.

2010-08-24  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Improve object-by-type lookup performance
	Instead of using one big traversal spec for lookup use a set of
	more fine grained traversal specs that are selected based on the
	actual needs of the lookup.

	This gives up to 20% speedup for certain operations like domain
	listing due to less HTTP(S) traffic.

2010-08-24  Jiri Denemark  <jdenemar@redhat.com>

	xen tests: Fix PV-VFB tests with RHEL-5 API
	RHEL-5 Xen doesn't support the old style vnc configuration. In sexpr, we
	can't really check it with rhel5-api turned on. However, for XM
	configuration files it's sufficient to use cfg version 1 instead of 2.

	xml2sexprtest: Remove graphics from unrelated tests
	This caused unnecessary make check failures when libvirt is configured
	--with-rhel5-api

2010-08-24  Jiri Denemark  <jdenemar@redhat.com>

	xen tests: Fix missing "type ioemu" with rhel5-api
	The most common cause of errors with rhel5-api turn on was missing
	"(type ioemu)" in sexpr or its equivalent in XM configuration file. This
	happens because the presence of that part in sexpr (or cfg) depends on
	xen version the host is running. Let's avoid it by explicitly specifying
	interface model which ensures "type ioemu" will always be emitted.

	This patch adds

	    <model type='e1000'/>

	withing the interface element in all affected xml files. And

	    (model 'e1000')

	to all corresponding sexpr files with similar fix to cfg files. Such
	configuration works regardless on Xen version.

2010-08-24  Jiri Denemark  <jdenemar@redhat.com>

	nodeinfotest: Print libvirt error on failure
	If linuxNodeInfoCPUPopulate() fails, the test would just print "FAILED"
	which is not very informative. It's better to print the real error.

2010-08-24  Eric Blake  <eblake@redhat.com>

	xenapi: support xenapi 5.6.0 headers
	* src/xenapi/xenapi_driver.c (xenapiDomainGetInfo): Avoid using
	XEN_VM_POWER_STATE_UNKNOWN, which disappeared in newer xenapi.
	* src/xenapi/xenapi_utils.c (mapPowerState): Likewise.

2010-08-23  Daniel P. Berrange  <berrange@redhat.com>

	Add support for -enable-kqemu flag
	Previously QEMU enabled KQEMU by default and had -no-kqemu.
	0.11.x switched to requiring -enable-kqemu. 0.12.x dropped
	kqemu entirely. This patch adds support for -enable-kqemu
	so 0.11.x works. It replaces a huge set of if() with a
	switch() to make the code a bit more readable.

	* src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Support
	  -enable-kqemu

2010-08-21  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Use MD5 sum of mount path as storage pool UUID
	With the previous storage pool UUID source not all storage pools
	had a proper UUID, especially GSX storage pools. The mount path
	is unique per host and cannot change during the lifetime of the
	datastore. Therefore, it's MD5 sum can be used as UUID.

	Use gnulib's crypto/md5 module to generate the MD5 sum.

2010-08-21  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Make sure dumpxml outputs proper ID for active domains

	xenapi: Fix compile error in previous commit

2010-08-21  Jim Fehlig  <jfehlig@novell.com>

	Add actions to virDomainLifecycle enum
	Xen supports on_crash actions coredump-{destroy,restart}.  libvirt
	cannot parse config returned by xend that contains either of these
	actions

	xen52 # xm li -l test | grep on_crash
	    (on_crash coredump-restart)
	xen52 # virsh dumpxml test
	error: internal error unknown lifecycle type coredump-restart

	This patch adds a new virDomainLifecycleCrash enum and appends
	the new options to existing destroy, restart, preserve, and
	rename-restart options.

2010-08-20  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Remove code duplication
	We already filled the PCI address structure when we checked whether it's
	free or not, so let's just use the structure here instead of filling it
	again.

	qemu: Check for errors when converting PCI address to string

	qemu: Fix JSON migrate_set_downtime command

2010-08-20  Eric Blake  <eblake@redhat.com>

	vbox: factor a large function
	* src/vbox/vbox_tmpl.c (vboxDomainCreateWithFlags): Split...
	(vboxStartMachine): ...into new helper.

	vbox: add location used in rpmfusion release
	* configure.ac (vbox_xpcomc_dir): Add another potential dir.

	xenapi: avoid sprintf
	* src/xenapi/xenapi_utils.h (createVifNetwork): Delete prototype.
	* src/xenapi/xenapi_utils.c (createVifNetwork): Change signature,
	and use virAsprintf.  Detect allocation failure.
	(createVMRecordFromXml): Adjust caller.

	storage: avoid s[n]printf
	* src/storage/storage_backend.c (virStorageBackendCreateQemuImg)
	(virStorageBackendCreateQcowCreate): Use virAsprintf instead.
	* src/storage/storage_backend_disk.c
	(virStorageBackendDiskCreateVol, virStorageBackendDiskPartFormat):
	Likewise.

	maint: whitespace cleanups
	* src/storage/storage_backend_disk.c
	(virStorageBackendDiskPartFormat): Fix spacing.

	build: delete dead comments
	* src/qemu/qemu_driver.c (qemudGetProcessInfo): Clean up.
	* src/uml/uml_driver.c (umlGetProcessInfo): Likewise.
	* src/xen/sexpr.c (_string2sexpr): Likewise.

2010-08-20  Patrick Dignan  <pat_dignan@dell.com>

	storage: add support for Vendor and Model in XML
	I wrote a patch to add support for listing the Vendor and Model of a
	storage pool in the storage pool XML.  This would allow vendor
	extensions of specific devices.  The patch includes a test for the new
	attributes as well.

	Patrick Dignan

2010-08-20  Eric Blake  <eblake@redhat.com>

	uml: fix logic bug in checking reply length
	* src/uml/uml_driver.c (umlMonitorCommand): Validate that enough
	bytes were read to dereference both res.length, and that many
	bytes from res.data.
	Reported by Soren Hansen.

	nwfilter: use consistent OOM reporting
	* src/nwfilter/nwfilter_driver.c (nwfilterLog): Delete.
	(nwfilterDriverStartup): Use virReportOOMError instead.

2010-08-19  Eric Blake  <eblake@redhat.com>

	build: fix compiler warning
	node_device/node_device_driver.c: In function 'nodeDeviceVportCreateDelete':
	node_device/node_device_driver.c:423: error: implicit declaration of function 'stat' [-Wimplicit-function-declaration]

	* src/node_device/node_device_driver.c (includes): Add <sys/stat.h>.

2010-08-18  Daniel Veillard  <veillard@redhat.com>

	xen: Fix scheduler setting problems
	Doing `virsh schedinfo rhel5u3 --cap 65535' the hypervisor does the
	call, but does not change the value nor raise an error. Best is just to
	consider it's not in the allowed values. The problem is that the error
	won't be output since the xend driver will then be called and raise an
	error

	    error: this function is not supported by the hypervisor: unsupported
	    in xendConfigVersion < 4

	which will override the useful information from
	xenUnifiedDomainSetSchedulerParameters(). So best is to also invert the
	order in which the xen sub-drivers are called.

	* src/xen/xen_hypervisor.c: mark 65535 cap value as out of bound
	* src/xen/xen_hypervisor.c: reverse the order of the calls to the xen
	  sub drivers to get the error message if needed

2010-08-18  Jiri Denemark  <jdenemar@redhat.com>

	nodedev: Free the right pointers when getting WWNs fails

2010-08-18  Dave Allan  <dallan@redhat.com>

	nodedev: Fix sysfs paths for vport operations
	Some kernels, such as the one used in RHEL-5, have vport_create and
	vport_delete operation files in /sys/class/scsi_host/hostN directory
	instead of /sys/class/fc_host/hostN. Let's check both paths for
	compatibility reasons.

	This also removes unnecessary '/' characters from sysfs paths containing
	LINUX_SYSFS_FC_HOST_PREFIX.

2010-08-18  Daniel Berrange  <berrange@redhat.com>

	xen: Fix device count on detach

	remote: Fix incorrect use of private data field
	NodeDeviceCreateXML and NodeDeviceDestroy methods added for NPIV were
	using the wrong privateData field for the remote driver. This doesn't
	impact KVM, since the remote driver handles everything, thus
	privateData == devMonPrivateData. It does impact Xen though, because
	the remote driver only handles a subset of methods and thus
	privateData != devMonPrivateData.

2010-08-18  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Fix memory leak when looking up an non-existing domain by name
	In case an optional object cannot be found the lookup function is
	left early and the cleanup code is not executed.

	This pattern occurs in some other functions too.

2010-08-18  Chris Lalancette  <clalance@redhat.com>

	Fix up qemu domain save/managed save locking.
	The current version of the qemu managed save implementation
	is subject to a race where the domain shuts down between
	the time that we start the command and the time that we
	actually try to do the save.  Close this race by making
	qemuDomainSaveFlags() expect both the driver and the passed-in
	vm object to be locked before executing.

2010-08-17  Eric Blake  <eblake@redhat.com>

	docs: mention domain <clock> improvements
	Add documentation for features added a while ago.

	* docs/formatdomain.html.in (Time keeping): Update documentation
	of <clock> element to match 0.8.0 addition.

2010-08-17  Stefan Berger  <stefanb@us.ibm.com>

	cygwin: build fix
	Fixing a problem in the build on cygwin due to missing #define's.

2010-08-17  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Fix copy&paste error in warning message
	This also makes the message consistent with the message used in error
	path of qemudDomainAttachHostPciDevice.

	qemu: Release PCI slot when detaching disk and net devices

2010-08-17  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Re-reserve all PCI addresses on libvirtd restart
	When reconnecting to existing VMs, we re-reserved only those PCI
	addresses which were explicitly mentioned in domain XML. Since some
	addresses are always reserved (e.g., 0:0:0 and 0:0:1), we need to handle
	those too.

	Also all this should only be done if device flag is supported by qemu.

2010-08-17  Jamie Strandboge  <jamie@canonical.com>

	build: fix AppArmor compilation
	* src/security/virt-aa-helper.c: Add missing include.

2010-08-17  Stefan Berger  <stefanb@us.ibm.com>

	nwfilter: extend nwfilter reload support
	In this patch I am extending and fixing the nwfilter module's reload support to stop all ongoing threads (for learning IP addresses of interfaces) and rebuild the filtering rules of all interfaces of all VMs when libvirt is started. Now libvirtd rebuilds the filters upon the SIGHUP signal and libvirtd restart.

	About the patch: The nwfilter functions require a virConnectPtr. Therefore I am opening a connection in qemudStartup, which later on needs to be closed outside where the driver lock is held since otherwise it ends up in a deadlock due to virConnectClose() trying to lock the driver as well.

	I have tested this now for a while with several machines running and needing the IP address learner thread(s). The rebuilding of the firewall rules seems to work fine following libvirtd restart or a SIGHUP. Also the termination of libvirtd worked fine.

2010-08-15  Eric Blake  <eblake@redhat.com>

	build: allow mingw VPATH build
	* .gnulib: Update to latest.
	Reported by Matthias Bolte.

2010-08-15  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Explicitly disable unused floppy devices
	floppy0.present defaults to true. Therefore, it needs to be
	explicitly set to false when the XML config doesn't specify the
	corresponding floppy device.

	Also update tests accordingly.

2010-08-15  Matthias Bolte  <matthias.bolte@googlemail.com>

	Generate libvirt_qemu.def from libvirt_qemu.syms for MinGW builds

2010-08-15  Eduardo Otubo  <otubo@linux.vnet.ibm.com>

	PHYP: Add rudimentary network driver
	I changed virStorage[Open|Close] to virVIOSDriver[Open|Close] so
	the network driver can use it - since the network driver deals
	with Open/Close in the same way.

2010-08-15  Soren Hansen  <soren@linux2go.dk>

	Make umlConnectTapDevice ask brAddTap for a persistent tap device.
	This patch does two things:

	 * It makes umlConnectTapDevice ask brAddTap for a persistent tap by
	   passing it a NULL tapfd argument.
	 * Stops umlConnectTapDevice from immediately dismantling the bridge
	   it just set up.

2010-08-15  Soren Hansen  <soren@linux2go.dk>

	Close fd's of persistent tap devices
	When passing a NULL tapfd argument to brAddTap, we need to close the fd
	of the tap device. If we don't, libvirt will keep the fd open
	indefinitely and renders the the guest unable to configure its side of
	the tap device.

	Make sure all command line arguments get passed to UML
	If umlBuildCommandLineChr fails (e.g. due to an unsupported chardev
	type), it returns NULL. umlBuildCommandLine does not check for this and
	sets this as an argument on the comand line, effectively ending the
	argument list. This patch checks for this case and sets the chardev to
	"none".

2010-08-14  Stefan Berger  <stefanb@us.ibm.com>

	nwfilter: Discard class D,E IP addresses when sniffing pkts
	When sniffing the network traffic, discard class D and E IP addresses when sniffing traffic. This was a reason why filters were not correctly rebuilt on VMs on the local 192.* network when libvirt was restarted and those VMs did not use a DHCP request to get its IP address.

	nwfilter: serialize execution of scripts with ebtables cmds
	While testing the SIGHUP handling and reloading of the nwfilter driver, I found that when the filters are rebuilt and mutlipe threads handled the individual interfaces, concurrently running multiple external bash scripts causes strange failures even though the executed ebtables commands are working on different tables for different interfaces. I cannot say for sure where the concurrency problems are caused, but introducing this lock definitely helps.

2010-08-14  Matthias Bolte  <matthias.bolte@googlemail.com>

	Only require XDR when building libvirtd or the remote driver

2010-08-13  Chris Lalancette  <clalance@redhat.com>

	Move the tunnelled migration unix socket to /var/lib/libvirt/qemu
	Since the qemu process is running as qemu:qemu, it can't actually
	look at the unix socket in /var/run/libvirt/qemu which is owned by
	root and has permission 700.  Move the unix socket to
	/var/lib/libvirt/qemu, which is already owned by qemu:qemu.

	Thanks to Justin Clift for test this out for me.

2010-08-13  Chris Lalancette  <clalance@redhat.com>

	Fix tunnelled migration with qemu running as qemu:qemu.
	The problem is that on the source of the migration, libvirtd
	is responsible for creating the unix socket over which the data
	will flow.  Since libvirtd is running as root, this file will
	be created as root.  When the qemu process running as qemu:qemu
	goes to access the unix file to write data to it, it will get
	permission denied and fail.  Make sure to change the owner
	of the unix file to qemu:qemu.

	Thanks to Justin Clift for testing this patch out for me.

2010-08-13  Stefan Berger  <stefanb@us.ibm.com>

	Fix valgrind complaints when using kill -SIGHUP on libvirtd
	This patch fixes a couple of complaints from valgrind when tickling libvirtd with SIGHUP.

	The first two files contain fixes for memory leaks. The 3rd one initializes an uninitialized variable. The 4th one is another memory leak.

2010-08-13  Daniel Veillard  <veillard@redhat.com>

	qemu: avoid calling the balloon info command if disabled
	 Basically a followup of the previous patch about balloon desactivation
	if desactivated, to not ask for balloon information to qemu as we will
	just get an error back.
	 This can make a huge difference in the time needed for domain
	information or list when a machine is loaded, and balloon has been
	desactivated in the guests.

	* src/qemu/qemu_driver.c: do not get the balloon info if the balloon
	  suppor is disabled

2010-08-12  Jiri Denemark  <jdenemar@redhat.com>

	bridge: Add --dhcp-no-override option to dnsmasq
	--dhcp-no-override description from dnsmasq man page:

	      Disable  re-use  of  the  DHCP servername and filename fields as
	      extra option space. If it can, dnsmasq moves the boot server and
	      filename  information  (from  dhcp-boot)  out of their dedicated
	      fields into DHCP options. This make extra space available in the
	      DHCP  packet  for options but can, rarely, confuse old or broken
	      clients. This flag forces "simple and safe" behaviour  to  avoid
	      problems in such a case.

	It seems some virtual network card ROMs are this old/buggy so let's add
	--dhcp-no-override as a workaround for them. We don't use extra DHCP
	options so this should be safe. The option was added in dnsmasq-2.41,
	which becomes the minimum required version.

2010-08-12  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Improve VMX file name parsing and formatting
	For parsing try to match by datastore mount path first, if that
	fails fallback to /vmfs/volumes/<datastore>/<path> parsing. This
	also fixes problems with GSX on Windows. Because GSX on Windows
	doesn't use /vmfs/volumes/ style file names.

	For formatting use the datastore mount path too, instead of using
	/vmfs/volumes/<datastore>/<path> as fixed format.

2010-08-12  Jiri Denemark  <jdenemar@redhat.com>

	bridge: Fix potential segfault when preparing dnsmasq arguments
	We add --dhcp-lease-max=xxx argument when network->def->nranges > 0 but
	we only allocate space for in the opposite case :-) I guess we are lucky
	enough to miscount somewhere else so that we actually allocate more
	space than we need since no-one has hit this bug so far.

2010-08-11  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Split VMX code into a general and an ESX specific part
	Introduce esxVMX_Context containing functions pointers to
	glue both parts together in a generic way.

	Move the ESX specific part to esx_driver.c.

	This is a step towards making the VMX code reusable in a
	potential VMware Workstation and VMware Player driver.

2010-08-11  Daniel Veillard  <veillard@redhat.com>

	allow memballoon type of none to desactivate it
	  The balloon device is automatically added to qemu guests if supported,
	but it may be useful to desactivate it. The simplest to not change the
	existing behaviour is to allow
	  <memballoon type="none"/>
	as an extra option to desactivate it (it is automatically added if the
	memballoon construct is missing for the domain).
	The following simple patch just adds the extra option and does not
	change the default behaviour but avoid creating a balloon device if
	type="none" is used.

	* docs/schemas/domain.rng: add the extra type attribute value
	* src/conf/domain_conf.c src/conf/domain_conf.h: add the extra enum
	  value
	* src/qemu/qemu_conf.c: if enum is NONE, don't activate the device,
	  i.e. don't pass the args to qemu/kvm

2010-08-11  Jiri Denemark  <jdenemar@redhat.com>

	Avoid unnecessary bootstrap runs in VPATH builds

2010-08-11  Doug Goldstein  <cardoe@gentoo.org>

	Add a detailed message when tap device add fails
	Added a more detailed error message when adding a tap devices fails and
	the kernel is missing tun support.

	Fix return value usage
	Fix the error checking to use the return value from brAddTap() instead
	of checking the current errno value which might have been changed by
	clean up calls inside of brAddTap().

2010-08-11  Eric Blake  <eblake@redhat.com>

	nodeinfo: skip offline CPUs
	https://bugzilla.redhat.com/622515 - When hot-unplugging CPUs,
	libvirt failed to start a guest that had been pinned to CPUs that
	were still online.

	Tested on a dual-core laptop, where I also discovered that, per
	http://www.cyberciti.biz/files/linux-kernel/Documentation/cpu-hotplug.txt,
	/sys/devices/system/cpu/cpu0/online does not exist on systems where it
	cannot be hot-unplugged.

	* src/nodeinfo.c (linuxNodeInfoCPUPopulate): Ignore CPUs that are
	currently offline.  Detect readdir failure.
	(parse_socket): Move guts...
	(get_cpu_value): ...to new function, shared with...
	(cpu_online): New function.

2010-08-10  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Hack around asynchronous device_del
	device_del command is not synchronous for PCI devices, it merely asks
	the guest to release the device and returns. If the host wants to use
	that device before the guest actually releases it, we are in big
	trouble. To avoid this, we already added a loop which waits up to 10
	seconds until the device is actually released before we do anything else
	with that device. But we only added this loop for managed PCI devices
	before we try reattach them back to the host.

	However, we need to wait even for non-managed devices. We don't reattach
	them automatically, but we still want to prevent the host from using it.
	This was revealed thanks to sVirt: when we relabel sysfs files
	corresponding to the PCI device before the guest finished releasing the
	device, qemu is no longer allowed to access those files and if it wants
	(as a result of guest's request) to write anything to them, it just
	exits, which kills the guest.

	This is not a proper fix and needs some further work both on libvirt and
	qemu side in the future.

2010-08-10  Eric Blake  <eblake@redhat.com>

	maint: update an email address preference
	* AUTHORS (Soren Hansen): Update address.
	* .mailmap: Alias other addresses to new preference.

2010-08-10  Diego Elio Pettenò  <flameeyes@gmail.com>

	build-sys: only build the test programs during the check phase.
	This avoids building the tests when testing libvirt is not the aim.

2010-08-10  Soren Hansen  <soren@linux2go.dk>

	Add "ubd" to the list of disk prefixes
	virDiskNameToIndex has a list of disk name prefixes that it uses in the
	process of finding the disk's index. This list is missing "ubd" which
	is the disk prefix used for UML domains.

2010-08-10  Daniel Veillard  <veillard@redhat.com>

	Extend virSocketParseAddr() to allow a NULL result pointer
	That way it can be used to verify a numeric address without storing
	the details
	* src/util/network.c: change virSocketParseAddr to allow a null @addr
	  parameter

2010-08-10  Philipp Hahn  <hahn@univention.de>

	bootloader_args is named bootargs in xen-xm
	According to <xen-3.4.3/tools/python/xen/xm/create.py:158>
		gopts.var('bootargs', val='NAME',
				  fn=set_value, default=None,
				  use="Arguments to pass to boot loader")
	the "bootloader_args" parameter needs to be translated into "bootargs"
	when using "virsh domxml-to-native xen-xm".
	The reverse direction (domxml-from-native) is already okay.

	This patch fixes domxml-to-native and adds two test files to catch this
	problem.

2010-08-06  Eduardo Otubo  <otubo@linux.vnet.ibm.com>

	phyp: refactor phypListDomainsGeneric to eliminate buffer overflow
	src/phyp/phyp_driver.c:phypListDomainsGeneric was crashing due to a buffer
	overflow if any line returned from virRun wasn't <=10 characters.

	Since virStrToLong_i recognizes any non-numeric as a terminator (not
	just NULL), there actually is no need to copy the number into a
	separate string anyway, so this patch eliminates that copy, the fixed
	length buffer, and therefore the potential to overflow.

	This change also provided the oppurtunity to eliminate the character
	counting loop, instead using the return from virStrToLong_i to point
	past the end of the number, then simply skip the \n to get to the
	next.

2010-08-06  Justin Clift  <jclift@redhat.com>

	docs: fix an incorrect keyword in updated hooks page

2010-08-06  Diego Elio Pettenò  <flameeyes@gmail.com>

	build-sys: fix build when daemon is disabled by not installing libvirtd.8
	Since the rule to build libvirtd.8 is within the WITH_LIBVIRTD conditional,
	so declare the man page in there as well. Without this change, build
	without daemon will fail.

2010-08-06  Justin Clift  <jclift@redhat.com>

	docs: significant expansion of custom hook script information

2010-08-06  Doug Goldstein  <cardoe@gentoo.org>

	Fix return value usage
	Fix the error checking to use the return value from brAddTap() instead
	of checking the current errno value which might have been changed by
	clean up calls inside of brAddTap().

	qemu: improve error if tun device is missing
	Added a more detailed error message when adding a tap devices fails and
	the kernel is missing tun support.

2010-08-05  Eric Blake  <eblake@redhat.com>

	build: rerun bootstrap if po/Makevars got nuked
	There has been a frequent complaint of:

	make[2]: Entering directory `/home/remote/eblake/libvirt/po'
	make[2]: *** No rule to make target `/config.status', needed by `Makefile'.  Stop.

	It happens after nuking and regenerating the po directory,
	which is a common action after running anything like
	'make dist' or 'make rpm' that dirties all the .po files.

	Teach autogen.sh that it must regenerate po/Makevars to avoid
	the missing variable declaration, and teach cfg.mk to recognize
	that a nuked po directory is cause to rerun autogen.sh.

	* cfg.mk (_update_required): Check for po/Makevars.
	* autogen.sh (bootstrap): Run bootstrap if it got lost.
	Diagnosed by Justin Clift.

2010-08-05  Daniel Veillard  <veillard@redhat.com>

	Do not use boot=on on IDE device
	the followup on the boot=on problem, basically it's not needed to
	specify it when booting out of IDE devices when using KVM
	* src/qemu/qemu_conf.c: do not use boot=on for IDE devices
	* tests/qemuxml2argvdata/qemuxml2argv*.args: this changes the output
	  for 5 of the tests

2010-08-04  Daniel Veillard  <veillard@redhat.com>

	Release of libvirt-0.8.3
	* configure.ac docs/news.html.in libvirt.spec.in: updates
	* po/*.po*: update and regenerated

2010-08-04  Jiri Denemark  <jdenemar@redhat.com>

	qemu: Fix PCI address allocation
	Patch version revamped by Eric Blake <eblake@redhat.com> of Jiri
	Denemark <jdenemar@redhat.com> original patch

	When attaching a PCI device which doesn't explicitly set its PCI
	address, libvirt allocates the address automatically. The problem is
	that when checking which PCI address is unused, we only check for those
	with slot number higher than the highest slot number ever used.

	Thus attaching/detaching such device several times in a row (31 is the
	theoretical limit, less then 30 tries are enough in practise) makes any
	further device attachment fail. Furthermore, attaching a device with
	predefined PCI address to 0:0:31 immediately forbids attachment of any
	PCI device without explicit address.

	This patch changes the logic so that we always check all PCI addresses
	before we say there is no PCI address available.

	Modifications from v1: revert back to remembering the last slot
	reserved, but allow wraparound to not be limited by the end.
	In this way, slots are still assigned in the same order as
	before the patch, rather than filling in the gaps closest to
	0 and risking making windows guests mad.

	* src/qemu/qemu_conf.c: fix pci reservation code to do a round-robbin
	  check of all available PCI splot availability before failing.

2010-08-04  Jean-Baptiste Rouault  <jean-baptiste.rouault@diateam.net>

	OpenVZ: implement suspend/resume driver APIs
	* src/openvz/openvz_driver.c: implements openvzDomainSuspend and
	  openvzDomainResume

2010-08-03  Laine Stump  <laine@laine.org>

	Don't leak delay string when freeing virInterfaceBridgeDefs

	Fix build error in virsh.c
	Another gettext string with no format args sent to printf as a format string.

2010-08-03  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Set storage pool target path to host.mountInfo.path
	Now all storage pool types expose the target path.

2010-08-03  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Make storage pool lookup by name and UUID more robust
	Don't rely on summary.url anymore, because its value is different
	between an esx:// and vpx:// connection. Use host.mountInfo.path
	instead.

	Don't fallback to lookup by UUID (actually lookup by absolute path)
	in esxVI_LookupDatastoreByName when lookup by name fails. Add a
	seperate function for this: esxVI_LookupDatastoreByAbsolutePath

2010-08-03  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Restrict vpx:// to handle a single host in a vCenter
	Now a vpx:// connection has an explicitly specified host. This
	allows to enabled several functions for a vpx:// connection
	again, like host UUID, hostname, general node info, max vCPU
	count, free memory, migration and defining new domains.

	Lookup datacenter, compute resource, resource pool and host
	system once and cache them. This simplifies the rest of the
	code and reduces overall HTTP(S) traffic a bit.

	esx:// and vpx:// can be mixed freely for a migration.

	Ensure that migration source and destination refer to the
	same vCenter. Also directly encode the resource pool and
	host system object IDs into the migration URI in the prepare
	function. Then directly build managed object references in
	the perform function instead of re-looking up already known
	information.

2010-08-03  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Map some managed object types
	Datacenter, ComputeResource and HostSystem will be used for
	simplified handling and caching.

	esx: Parse the path of the URI
	The path will be used to specify the datacenter, compute resource
	and host system to be used with a vpx:// connection.

2010-08-03  Eric Blake  <eblake@redhat.com>

	qemu: don't lose error on setting monitor capabilities
	Spotted by clang.  Regression introduced in commit e72cc3c11d.

	* src/qemu/qemu_driver.c (qemuConnectMonitor): Don't lose error status.

2010-08-03  Eric Blake  <eblake@redhat.com>

	build: avoid compiler warning, for real this time
	* tools/virsh.c (vshParseArgv): Drop spurious argument to printf.

	Fix virsh error message when -d arg is not numeric

2010-08-03  Daniel Veillard  <veillard@redhat.com>

	Add Aurelien to AUTHORS

2010-08-03  Aurelien ROUGEMONT  <beorn@binaries.fr>

	Fix a couple of typo in iSCSI backend
	- a pure typo error and a wrong command referenced in an error message.

2010-08-03  Daniel Veillard  <veillard@redhat.com>

	Make virsh -d check its input
	it was using atoi direct without checking leading to confusion
	in case of flag error for example with -c

	* tools/virsh.c: vshParseArgv() use virStrToLong_i and remove the
	  unchecked atoi used to parse teh parameter

2010-08-02  Laine Stump  <laine@redhat.com>

	Add iptables rule to fixup DHCP response checksum.
	This patch attempts to take advantage of a newly added netfilter
	module to correct for a problem with some guest DHCP client
	implementations when used in conjunction with a DHCP server run on the
	host systems with packet checksum offloading enabled.

	The problem is that, when the guest uses a RAW socket to read the DHCP
	response packets, the checksum hasn't yet been fixed by the IP stack,
	so it is incorrect.

	The fix implemented here is to add a rule to the POSTROUTING chain of
	the mangle table in iptables that fixes up the checksum for packets on
	the virtual network's bridge that are destined for the bootpc port (ie
	"dhcpc", ie port 68) port on the guest.

	Only very new versions of iptables will have this support (it will be
	in the next upstream release), so a failure to add this rule only
	results in a warning message. The iptables patch is here:

	  http://patchwork.ozlabs.org/patch/58525/

	A corresponding kernel module patch is also required (the backend of
	the iptables patch) and that will be in the next release of the
	kernel.

2010-08-02  Chris Lalancette  <clalance@redhat.com>

	Fix the ACS checking in the PCI code.
	When trying to assign a PCI device to a guest, we have
	to check that all bridges upstream of that device support
	ACS.  That means that we have to find the parent bridge of
	the current device, check for ACS, then find the parent bridge
	of that device, check for ACS, etc.  As it currently stands,
	the code to do this iterates through all PCI devices on the
	system, looking for a device that has a range of busses that
	included the current device's bus.

	That check is not restrictive enough, though.  Depending on
	how we iterated through the list of PCI devices, we could first
	find the *topmost* bridge in the system; since it necessarily had
	a range of busses including the current device's bus, we
	would only ever check the topmost bridge, and not check
	any of the intermediate bridges.

	Note that this also caused a fairly serious bug in the
	secondary bus reset code, where we could erroneously
	find and reset the topmost bus instead of the inner bus.

	This patch changes pciGetParentDevice() so that it first
	checks if a bridge device's secondary bus exactly matches
	the bus of the device we are looking for.  If it does, we've
	found the correct parent bridge and we are done.  If it does not,
	then we check to see if this bridge device's busses *include* the
	bus of the device we care about.  If so, we mark this bridge device
	as best, and go on.  If we later find another bridge device whose
	busses include this device, but is more restrictive, then we
	free up the previous best and mark the new one as best.  This
	algorithm ensures that in the normal case we find the direct
	parent, but in the case that the parent bridge secondary bus
	is not exactly the same as the device, we still find the
	correct bridge.

	This patch was tested by me on a 4-port NIC with a
	bridge without ACS (where assignment failed), a 4-port
	NIC with a bridge with ACS (where assignment succeeded),
	and a 2-port NIC with no bridges (where assignment
	succeeded).

2010-08-02  Chris Lalancette  <clalance@redhat.com>

	Free up memballoon def.
	Forgetting to do this was causing a memory leak.

	Don't put a semicolon on the end of a VIR_ENUM_IMPL.

2010-08-02  Chris Lalancette  <clalance@redhat.com>

	Fix a bogus warning when parsing <hostdev>
	When parsing hostdev, the following message would be emitted:

	10:17:19.052: error : virDomainHostdevDefParseXML:3748 : internal error unknown node alias

	However, alias is appropriately parsed in
	virDomainDeviceInfoParseXML anyway.  Disable the error message
	in the initial XML parsing loop.

2010-08-01  Matthias Bolte  <matthias.bolte@googlemail.com>

	Remove duplicate </p> from downloads.html.in

2010-07-31  Matthias Bolte  <matthias.bolte@googlemail.com>

	Update ID after stopping a domain

2010-07-31  Jean-Baptiste Rouault  <jean-baptiste.rouault@diateam.net>

	openvzDomainCreateWithFlags: set domain id to the correct value
	When an openvz domain is defined with virDomainDefineXML,
	domain id is set to -1. A call to virDomainGetInfo after
	starting the domain would then fail because this invalid
	id is passed to openvzGetProcessInfo.

2010-07-31  Eric Blake  <eblake@redhat.com>

	storage: kill dead stores
	Found by clang.  Clang complained that virStorageBackendProbeTarget
	could dereference NULL if backingStoreFormat was NULL, but since all
	callers passed a valid pointer, I added attributes instead of null
	checks.

	* src/storage/storage_backend.c
	(virStorageBackendQEMUImgBackingFormat): Kill dead store.
	* src/storage/storage_backend_fs.c (virStorageBackendProbeTarget):
	Likewise.  Skip null checks, by adding attributes.

2010-07-31  Eric Blake  <eblake@redhat.com>

	qemu: kill some dead stores
	Spotted by clang.

	* src/qemu/qemu_monitor.c (qemuMonitorClose): Kill dead store.
	* src/qemu/qemu_driver.c (qemudDomainSaveImageStartVM): Likewise.

2010-07-31  Eric Blake  <eblake@redhat.com>

	network: kill dead store
	* src/network/bridge_driver.c (networkDefine): Kill dead store.

2010-07-30  Matthias Bolte  <matthias.bolte@googlemail.com>

	xenapi: Update ID after starting a domain

	esx: Update ID after starting a domain

2010-07-30  Chris Lalancette  <clalance@redhat.com>

	Fix DMI uuid parsing.
	valgrind was complaining that virUUIDParse was depending on
	an uninitialized value.  Indeed it was; virSetHostUUIDStr()
	didn't initialize the dmiuuid buffer to 0's, meaning that
	anything after the string read from /sys was uninitialized.
	Clear out the dmiuuid buffer before use, and make sure to
	always leave a \0 at the end.

2010-07-30  Daniel Veillard  <veillard@redhat.com>

	Do not activate boot=on on devices when not using KVM
	  Basically the 'boot=on' boot selection device is something present in
	KVM but not in upstream QEmu, as a result if we boot a QEmu domain
	without KVM acceleration we must disable boot=on ... even if the front
	end kvm binary expose that capability in the help page.

	* src/qemu/qemu_conf.c: in qemudBuildCommandLine if -no-kvm
	  is passed, then deactivate QEMUD_CMD_FLAG_DRIVE_BOOT

2010-07-30  Chris Lalancette  <clalance@redhat.com>

	Fix a memory leak in the qemudBuildCommandLine.
	ADD_ARG_LIT should only be used for literal arguments,
	since it duplicates the memory.  Since virBufferContentAndReset
	is already allocating memory, we should only use ADD_ARG.

2010-07-30  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Fix freeing of heterogeneous lists
	Always call the free function of the base type. The base type
	function then dynamically dispatches the call to the free function
	for the actual type.

	esx: Switch from name to number checks in the subdrivers

2010-07-30  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Improve blocked task detection and fix race condition
	esxVI_WaitForTaskCompletion can take a UUID to lookup the
	corresponding domain and check if the current task for it
	is blocked by a question. It calls another function to do
	this: esxVI_LookupAndHandleVirtualMachineQuestion looks up
	the VirtualMachine and checks for a question. If there is
	a question it calls esxVI_HandleVirtualMachineQuestion to
	handle it.

	If there was no question or it has been answered the call
	to esxVI_LookupAndHandleVirtualMachineQuestion returns 0.
	If any error occurred during the lookup and answering
	process -1 is returned. The problem with this is, that -1
	is also returned when there was no error but the question
	could not be answered. So esxVI_WaitForTaskCompletion cannot
	distinguish between this two situations and reports that a
	question is blocking the task even when there was actually
	another problem.

	This inherent problem didn't surface until vSphere 4.1 when
	you try to define a new domain. The driver tries to lookup
	the domain that is just in the process of being registered.
	There seems to be some kind of race condition and the driver
	manages to issue a lookup command before the ESX server was
	able to register the domain. This used to work before.

	Due to the return value problem described above the driver
	reported a false error message in that case.

	To solve this esxVI_WaitForTaskCompletion now takes an
	additional occurrence parameter that describes whether or
	not to expect the domain to be existent. Also add a new
	parameter to esxVI_LookupAndHandleVirtualMachineQuestion
	that allows to distinguish if the call returned -1 because
	of an actual error or because the question could not be
	answered.

2010-07-30  Eric Blake  <eblake@redhat.com>

	esx: silence spurious compiler warning
	* src/esx/esx_vi_types.c (_DESERIALIZE_NUMBER)
	(ESX_VI__TEMPLATE__DESERIALIZE_NUMBER): Add range check to shut up
	gcc 4.5.0 regarding long long.

	build: distribute libvirt_qemu.syms
	* src/Makefile.am (EXTRA_DIST): Ensure 'make distcheck' and
	'rpmbuild' can reproduce a build.
	* daemon/Makefile.am (DAEMON_SOURCES): Likewise.

2010-07-30  Eric Blake  <eblake@redhat.com>

	build: restore operation of bit-rotted 'make cov'
	'./autobuild.sh' with lcov installed discovered that our
	coverage support has been bit-rotting for a while.  This
	restores it back to a successful state, although I have
	not yet spent any time looking through the resulting files to
	look for low-hanging fruit in the unit test coverage front.

	* configure.ac: Clear COMPILER_FLAGS at right place.
	* Makefile.am (cov): Newer genhtml no longer likes plain -s.
	* m4/compiler-flags.m4 (gl_COMPILER_FLAGS): Don't AC_SUBST
	COMPILER_FLAGS; it is a shell variable for use in configure only.
	* src/Makefile.am (AM_CFLAGS, AM_LDFLAGS): New variables, to make
	it easier to provide global flag additions.  Use throughout, to
	uniformly apply coverage flags.
	* .gitignore: Globally ignore gcov output.
	* daemon/.gitignore: Simplify.
	* src/.gitignore: Likewise.
	* tests/.gitignore: Likewise.

2010-07-30  Eric Blake  <eblake@redhat.com>

	xen: fix logic bug
	The recent switch to enable -Wlogical-op paid off again.
	gcc 4.5.0 (rawhide) is smarter than 4.4.4 (Fedora 13).

	* src/xen/xend_internal.c (xenDaemonAttachDeviceFlags)
	(xenDaemonUpdateDeviceFlags, xenDaemonDetachDeviceFlags): Use
	correct operator.

2010-07-30  Eric Blake  <eblake@redhat.com>

	build: fix 'make syntax-check' failure
	src/lxc/veth.c:150:        VIR_DEBUG(_("Failed to delete '%s' (%d)"),
	src/lxc/veth.c:188:            VIR_DEBUG(_("Failed to disable '%s' (%d)"),
	maint.mk: do not mark these strings for translation

	* src/lxc/veth.c (vethDelete, vethInterfaceUpOrDown): Don't
	translate VIR_DEBUG.

2010-07-30  Ryota Ozaki  <ozaki.ryota@gmail.com>

	lxc: Fix return values of veth.c functions
	Previously, the functions in src/lxc/veth.c could sometimes return
	positive values on failure rather than -1. This made accurate error
	reporting difficult, and led to one failure to catch an error in a
	calling function.

	This patch makes all the functions in veth.c consistently return 0 on
	success, and -1 on failure. It also fixes up the callers to the veth.c
	functions where necessary.

	Note that this patch may be related to the bug:

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

	It will not fix the bug, but should unveil what happens.

	* po/POTFILES.in - add veth.c, which previously had no translatable strings
	* src/lxc/lxc_controller.c
	* src/lxc/lxc_container.c
	* src/lxc/lxc_driver.c    - fixup callers to veth.c, and remove error logs,
	                            as they are now done in veth.c
	* src/lxc/veth.c - make all functions consistently return -1 on error.
	* src/lxc/veth.h - use ATTRIBUTE_NONNULL to protect against NULL args.

2010-07-30  Laine Stump  <laine@redhat.com>

	Eliminate memory leak in xenUnifiedDomainInfoListFree
	This fixes a leak described in

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

	xenUnifiedDomainInfoList has a pointer to a list of pointers to
	xenUnifiedDomain. We were freeing up all the domains, but neglecting
	to free the list.

	This was found by Paolo Bonzini <pbonzini@redhat.com>.

2010-07-29  Ryota Ozaki  <ozaki.ryota@gmail.com>

	lxc: Fix 'autostart' doesn't take effect actually
	lxcStartup forgot to call lxcAutostartConfigs. Fix it.

	This patch should fix https://bugzilla.redhat.com/show_bug.cgi?id=589863 .

2010-07-29  Matthias Bolte  <matthias.bolte@googlemail.com>

	Fix --with-xen-proxy related compile error
	Move virDomainChrTargetTypeToString out of the #ifndef PROXY
	block, because it's used outside of it.

2010-07-29  Chris Lalancette  <clalance@redhat.com>

	Fix a potential race in pciInitDevice.
	If detecting the FLR flag of a pci device fails, then we
	could run into the situation of trying to close a file
	descriptor twice, once in pciInitDevice() and once in pciFreeDevice().
	Fix that by removing the pciCloseConfig() in pciInitDevice() and
	just letting pciFreeDevice() handle it.

	Thanks to Chris Wright for pointing out this problem.

	While we are at it, fix an error check.  While it would actually
	work as-is (since success returns 0), it's still more clear to
	check for < 0 (as the rest of the code does).

2010-07-29  Cole Robinson  <crobinso@redhat.com>

	qemu: virtio console support
	Enable specifying a virtio console device with:

	<console type='pty'>
	  <target type='virtio'/>
	</console>

2010-07-29  Cole Robinson  <crobinso@redhat.com>

	domain conf: Track <console> target type
	All <console> devices now export a <target> type attribute. QEMU defaults
	to 'serial', UML defaults to 'uml, xen can be either 'serial' or 'xen'
	depending on fullvirt. Understandably there is lots of test fallout.

	This will be used to differentiate between a serial vs. virtio console for
	QEMU.

2010-07-29  Cole Robinson  <crobinso@redhat.com>

	domain conf: char: Add an explicit targetType field
	targetType only tracks the actual <target> format we are parsing. Currently
	we only fill abide this value for channel devices.

2010-07-29  Cole Robinson  <crobinso@redhat.com>

	domain conf: Rename character prop targetType -> deviceType
	There is actually a difference between the character device type (serial,
	parallel, channel, ...) and the target type (virtio, guestfwd). Currently
	they are awkwardly conflated.

	Start to pull them apart by renaming targetType -> deviceType. This is
	an entirely mechanical change.

2010-07-29  Cole Robinson  <crobinso@redhat.com>

	docs: domain: Document virtio <channel>

2010-07-29  Cole Robinson  <crobinso@redhat.com>

	tests: Test qemuxml2xml when expected xml changes
	Add tests for auto memballon, implicit IDE, SCSI, virtio channel
	controllers, and console/serial back compat.

	Additionally, an explicit qemuxml2argvtest for scsi disks is added.

2010-07-28  Gerhard Stenzel  <gerhard.stenzel@de.ibm.com>

	fix handling of PORT_PROFILE_RESPONSE_INPROGRESS netlink message
	During function test of the 802.1Qbg implementation in lldpad we came
	across a small problem in the handling of the netlink message
	corresponding to PORT_PROFILE_RESPONSE_INPROGRESS. This should not
	result in returning the default rc=1.

	- src/util/macvtap.c: fix getPortProfileStatus() to return 0 in that
	  case and also fix an indentation problem

2010-07-28  Eric Blake  <eblake@redhat.com>

	maint: fix comment typos
	* src/network/bridge_driver.c
	(networkAddMasqueradingIptablesRules): Fix spelling and grammar.

2010-07-28  Chris Lalancette  <clalance@redhat.com>

	Fix up confusing indentation in qemudDomainAttachHostPciDevice.

2010-07-28  Eric Blake  <eblake@redhat.com>

	maint: turn on gcc logical-op checking
	This would have detected the bug in commit 38ad33931 (Aug 09), which
	we missed until commit f828ca35 (Jul 10); over 11 months later.

	However, on Fedora 13, it also triggers LOTS of warnings from
	the libcurl-devel header for two files:

	esx/esx_vi.c: In function 'esxVI_CURL_Perform':
	esx/esx_vi.c:232: error: logical '&&' with non-zero constant will always evaluate as true [-Wlogical-op]
	esx/esx_vi.c:232: error: logical '&&' with non-zero constant will always evaluate as true [-Wlogical-op]
	esx/esx_vi.c:232: error: logical '&&' with non-zero constant will always evaluate as true [-Wlogical-op]
	...
	xenapi/xenapi_driver.c: In function 'call_func':
	xenapi/xenapi_driver.c:1872: error: logical '&&' with non-zero constant will always evaluate as true [-Wlogical-op]
	xenapi/xenapi_driver.c:1872: error: logical '&&' with non-zero constant will always evaluate as true [-Wlogical-op]
	xenapi/xenapi_driver.c:1872: error: logical '&&' with non-zero constant will always evaluate as true [-Wlogical-op]
	...

	libcurl allows to disable the type-checking code that triggers those
	warnings, along with the reduction in type-safety of calls to some
	libcurl functions. I figure this is worth the improved compiler
	checking throughout the rest of libvirt.

	* acinclude.m4 (--enable-compile-warnings=error): Add -Wlogical-op.
	* configure.ac: Add -DCURL_DISABLE_TYPECHECK to LIBCURL_CFLAGS to
	avoid compilation warning.

	Suggested by Daniel P. Berrange.
	Tweaked by Matthias Bolte.

2010-07-28  Eric Blake  <eblake@redhat.com>

	libvirt-guests: add reload, condrestart
	Optional per LSB, but required by Fedora:
	https://fedoraproject.org/wiki/Packaging/SysVInitScript

	* daemon/libvirt-guests.init.in (main): Add more required
	commands.

2010-07-28  Eric Blake  <eblake@redhat.com>

	libvirt-guests: enhance status
	LSB and https://fedoraproject.org/wiki/Packaging/SysVInitScript
	require status to output something useful, rather than just use
	the exit code.

	* daemon/libvirt-guests.init.in (rh_status): Break into new routine,
	and provide output.
	(usage): Document status.

2010-07-28  Eric Blake  <eblake@redhat.com>

	libvirt-guests: detect invalid arguments
	Reject extra arguments.
	Return the correct status for unknown arguments, as mandated by
	https://fedoraproject.org/wiki/Packaging/SysVInitScript
	Add --help, as a permitted extension.

	* daemon/libvirt-guests.init.in (usage): New function.  Use it in
	more places, and return correct value.

2010-07-28  Daniel P. Berrange  <berrange@redhat.com>

	Invert logic for checking for QEMU disk cache options
	QEMU has had two different syntax for disk cache options

	 Old: on|off
	 New: writeback|writethrough|none

	QEMU recently added another 'unsafe' option which broke the
	libvirt check. We can avoid this & future breakage, if we
	do a negative check for the old syntax, instead of a positive
	check for the new syntax

	* src/qemu/qemu_conf.c: Invert cache option check

2010-07-28  Cole Robinson  <crobinso@redhat.com>

	qemu: Allow setting boot menu on/off
	Add a new element to the <os> block:

	  <bootmenu enable="yes|no"/>

	Which maps to -boot,menu=on|off on the QEMU command line.

	I decided to use an explicit 'enable' attribute rather than just make the
	bootmenu element boolean. This allows us to treat lack of a bootmenu element
	as 'use hypervisor default'.

2010-07-28  Cole Robinson  <crobinso@redhat.com>

	docs: Link wiki FAQ to main page
	Since DV recommended keeping the build instructions distributed with the
	source, move them from the old FAQ to the downloads page.

	qemu: Error on unsupported graphics config
	Throw an explicit error if multiple graphics devices are specified, or
	an unsupported type is specified (rdp).

2010-07-27  Jiri Denemark  <jdenemar@redhat.com>

	libvirt-guests: Don't throw errors if libvirtd is not installed
	When only client parts of libvirt are installed (i.e., no libvirtd
	daemon), libvirt-guests init script in its default configuration would
	throw seriously looking errors during host shutdown:

	Running guests on default URI: error: unable to connect to
	'/var/run/libvirt/libvirt-sock', libvirtd may need to be started: No
	such file or directory
	error: failed to connect to the hypervisor

	This patch changes the script to print rather harmless message in that
	situation:

	Running guests on default URI: libvirtd not installed; skipping this
	URI.

2010-07-27  Chris Lalancette  <clalance@redhat.com>

	Force FLR on for buggy SR-IOV devices.
	Some buggy PCI devices actually support FLR, but
	forget to advertise that fact in their PCI config space.
	However, Virtual Functions on SR-IOV devices are
	*required* to support FLR by the spec, so force has_flr
	on if this is a virtual function.

2010-07-27  Eric Blake  <eblake@redhat.com>

	build: fix VPATH builds
	After the recent libvirt-qemu library addition, VPATH builds fail with:

	  CC     libvirt_qemu_la-libvirt-qemu.lo
	In file included from ../../src/libvirt-qemu.c:29:
	../../include/libvirt/libvirt-qemu.h:17:22: error: libvirt.h: No such file or directory
	...
	  CCLD   libvirt-qmeu.la
	/usr/bin/ld: cannot open linker script file libvirt_qemu.syms: No such file or directory

	This fixes both issues (there are still some documentation VPATH issues,
	but those don't show up with 'make check').

	* configure.ac (LIBVIRT_QEMU_SYMBOL_FILE): While libvirt.syms is
	generated and lives in $(builddir), libvirt_qemu.syms is static
	and lives in $(srcdir).
	* include/libvirt/libvirt-qemu.h (includes): Pull in libvirt.h via
	the public location, since this is a public header.

2010-07-27  Chris Wright  <chrisw@redhat.com>

	pciResetDevice: use inactive devices to determine safe reset
	When doing a PCI secondary bus reset, we must be sure that there are no
	active devices on the same bus segment.  The active device tracking is
	designed to only track host devices that are active in use by guests.
	This ignores host devices that are actively in use by the host.  So the
	current logic will reset host devices.

	Switch this logic around and allow sbus reset when we are assigning all
	devices behind a bridge to the same guest at guest startup or as a result
	of a single attach-device command.

	* src/util/pci.h: change signature of pciResetDevice to add an
	  inactive devices list
	* src/qemu/qemu_driver.c src/xen/xen_driver.c: use (or not) the new
	  functionality of pciResetDevice() depending on the place of use
	* src/util/pci.c: implement the interface and logic changes

2010-07-27  Chris Wright  <chrisw@redhat.com>

	qemudDomainAttachHostPciDevice refactor to use new helpers
	- src/qemu/qemu_driver.c: Eliminate code duplication by using the new
	  helpers qemuPrepareHostdevPCIDevices and qemuDomainReAttachHostdevDevices.
	  This reduces the number of open coded calls to pciResetDevice.

	Add helpers qemuPrepareHostdevPCIDevice and qemuDomainReAttachHostdevDevices
	- src/qemu/qemu_driver.c: These new helpers take hostdev list and count
	  directly rather than getting them indirectly from domain definition.
	  This will allow reuse for the attach-device case.

	qemuGetPciHostDeviceList take hostdev list directly
	- src/qemu/qemu_driver.c: Update qemuGetPciHostDeviceList to take a
	  hostdev list and count directly, rather than getting this indirectly
	  from domain definition. This will allow reuse for the attach-device case.

2010-07-25  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Support vSphere 4.1
	Also accept version > 4.1, but output a warning.

2010-07-25  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Add vpx:// scheme to allow direct connection to a vCenter
	Add a pointer to the primary context of a connection and use it in all
	driver functions that don't dependent on the context type. This includes
	almost all functions that deal with a virDomianPtr. Therefore, using
	a vpx:// connection allows you to perform all the usual domain related
	actions like start, destroy, suspend, resume, dumpxml etc.

	Some functions that require an explicitly specified ESX server don't work
	yet. This includes the host UUID, the hostname, the general node info, the
	max vCPU count and the free memory. Also not working yet are migration and
	defining new domains.

2010-07-24  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Don't ignore the vcenter query parameter
	Since 070f61002f47b602c15d1e4950a122ac9edefe1b the vcenter query
	parameter has been ignored, because the refactoring to use
	esxUtil_ParseQuery was incomplete. This effectively broke migration,
	because the vcenter query parameter is essential for a migration.

	esx: Add autodetection for the SCSI controller model
	This works for file-backed SCSI disk device with a datastore
	related source path.

	esx: Allow 'vmpvscsi' as SCSI controller model

2010-07-24  Matthias Bolte  <matthias.bolte@googlemail.com>

	secaatest: Fix compilation
	Since 68719c4bddb85fbcc931a5b7d99ac7c8a0af09b0 virSecurityDriverStartup
	takes and additional parameter to control disk format probing.

	Pass false as third parameter.

2010-07-24  Matthias Bolte  <matthias.bolte@googlemail.com>

	virt-aa-helper-test: Fix failure due to the new disk format probing option
	Commit 68719c4bddb85fbcc931a5b7d99ac7c8a0af09b0 added the disk format
	probing option. This makes virt-aa-helper-test fail because the domain
	config didn't specifiy the disk format and it didn't pass '-p 1' to
	virt-aa-helper to allow disk format probing.

	Specify the disk format in the domain config. Pass the '-p 1' option
	to virt-aa-helper for the test case with two disks. This way this test
	also covers this new option.

2010-07-24  Matthias Bolte  <matthias.bolte@googlemail.com>

	virt-aa-helper: Make getopt accept the p option
	Commit 68719c4bddb85fbcc931a5b7d99ac7c8a0af09b0 added the
	p option to control disk format probing, but it wasn't added
	to the getopt_long optstring parameter.

	Add the p option to the getopt_long optstring parameter.

2010-07-24  Matthias Bolte  <matthias.bolte@googlemail.com>

	virt-aa-helper: Fix return value of add_file_path
	Commit a8853344994a7c6aaca882a5e949ab5536821ab5 added this
	function and wrapped vah_add_file in it. vah_add_file may
	return -1, 0, 1. It returns 1 in case the call to valid_path
	detects a restricted file. The original code treated a return
	value != 0 as error. The refactored code treats a return
	value < 0 as error. This triggers segfault in virt-aa-helper
	and breaks virt-aa-helper-test for the restricted file tests.

	Make sure that add_file_path returns -1 on error.

2010-07-24  Matthias Bolte  <matthias.bolte@googlemail.com>

	virt-aa-helper: Ignore open errors again
	virt-aa-helper used to ignore errors when opening files.
	Commit a8853344994a7c6aaca882a5e949ab5536821ab5 refactored
	the related code and changed this behavior. virt-aa-helper
	didn't ignore open errors anymore and virt-aa-helper-test
	fails.

	Make sure that virt-aa-helper ignores open errors again.

2010-07-24  Eric Blake  <eblake@redhat.com>

	qemu-api: avoid build failure
	* src/remote_protocol-structs: Tweak to match intentional type
	change (with no ABI change) in remote protocol.

2010-07-24  Chris Lalancette  <clalance@redhat.com>

	Add tests for the new Qemu namespace XML.
	Thanks to DV for knocking together the Relax-NG changes
	quickly for me.

	Changes since v1:
	 - Change the domain.rng to correspond to the new schema
	 - Don't allocate caps->ns in testQemuCapsInit since it is a static table

	Changes since v2:
	 - Change domain.rng to add restrictions on allowed environment names

	Changes since v3:
	 - Remove a bogus comment in the tests

2010-07-24  Chris Lalancette  <clalance@redhat.com>

	Qemu remote protocol.
	Since we are adding a new "per-hypervisor" protocol, we
	make it so that the qemu remote protocol uses a new
	PROTOCOL and PROGRAM number.  This allows us to easily
	distinguish it from the normal REMOTE protocol.

	This necessitates changing the proc in remote_message_header
	from a "remote_procedure" to an "unsigned", which should
	be the same size (and thus preserve the on-wire protocol).

	Changes since v1:
	 - Fixed up a couple of script problems in remote_generate_stubs.pl
	 - Switch an int flag to a bool in dispatch.c

	Changes since v2:
	 - None

	Changes since v3:
	 - Change unsigned proc to signed proc, to conform to spec

2010-07-24  Chris Lalancette  <clalance@redhat.com>

	Qemu arbitrary monitor commands.
	Implement the qemu driver's virDomainQemuMonitorCommand
	and hook it into the API entry point.

	Changes since v1:
	 - Rename the (external) qemuMonitorCommand to qemuDomainMonitorCommand
	 - Add virCheckFlags to qemuDomainMonitorCommand

	Changes since v2:
	 - Drop ATTRIBUTE_UNUSED from the flags

	Changes since v3:
	 - Add a flag to priv so we only print out monitor command warning once.  Note
	   that this has not been plumbed into qemuDomainObjPrivateXMLFormat or
	   qemuDomainObjPrivateXMLParse, which means that if you run a monitor command,
	   restart libvirtd, and then run another monitor command, you may get an
	   an erroneous VIR_INFO.  It's a pretty minor matter, and I didn't think it
	   warranted the additional code.
	 - Add BeginJob/EndJob calls around EnterMonitor/ExitMonitor

2010-07-24  Chris Lalancette  <clalance@redhat.com>

	Qemu Monitor API entry point.
	Add the library entry point for the new virDomainQemuMonitorCommand()
	entry point.  Because this is not part of the "normal" libvirt API,
	it gets its own header file, library file, and will eventually
	get its own over-the-wire protocol later in the series.

	Changes since v1:
	 - Go back to using the virDriver table for qemuDomainMonitorCommand, due to
	   linking issues
	 - Added versioning information to the libvirt-qemu.so

	Changes since v2:
	 - None

	Changes since v3:
	 - Add LGPL header to libvirt-qemu.c
	 - Make virLibConnError and virLibDomainError macros instead of function calls

	Changes since v4:
	 - Move exported symbols to libvirt_qemu.syms

2010-07-24  Chris Lalancette  <clalance@redhat.com>

	Handle arbitrary qemu command-lines in qemuParseCommandLine.
	Now that we have the ability to specify arbitrary qemu
	command-line parameters in the XML, use it to handle unknown
	command-line parameters when doing a native-to-xml conversion.

	Changes since v1:
	 - Rename num_extra to num_args
	 - Fix up a memory leak on an error path

	Changes since v2:
	 - Add a VIR_WARN when adding the argument via qemu:arg

	Changes since v3:
	 - None

2010-07-24  Chris Lalancette  <clalance@redhat.com>

	Qemu arbitrary command-line arguments.
	Implement the qemu hooks for XML namespace data.  This
	allows us to specify a qemu XML namespace, and then
	specify:

	<qemu:commandline>
	 <qemu:arg value='arg'/>
	 <qemu:env name='name' value='value'/>
	</qemu:commandline>

	In the domain XML.

	Changes since v1:
	 - Change the <qemu:arg>arg</qemu:arg> XML to <qemu:arg value='arg'/> XML
	 - Fix up some memory leaks in qemuDomainDefNamespaceParse
	 - Rename num_extra and extra to num_args and args, respectively
	 - Fixed up some error messages
	 - Make sure to escape user-provided data in qemuDomainDefNamespaceFormatXML

	Changes since v2:
	 - Add checking to ensure environment variable names are valid
	 - Invert the logic in qemuDomainDefNamespaceFormatXML to return early

	Changes since v3:
	 - Change strspn() to c_isalpha() check of first letter of environment variable

2010-07-24  Chris Lalancette  <clalance@redhat.com>

	Add namespace callback hooks to domain_conf.
	This patch adds namespace XML parsers to be hooked into
	the main domain parser.  This allows for individual hypervisor
	drivers to add per-namespace XML into the main domain XML.

	Changes since v1:
	 - Use a statically declared table for caps->ns, removing the need to
	   allocate/free it.

	Changes since v2:
	 - None

	Changes since v3:
	 - None

2010-07-24  Philipp Hahn  <hahn@univention.de>

	Fix SEGV on exit after domainEventDeregister()
	When the last callback is removed using domainEventDeregister(), the
	events dispatcher is deregistered from the C-library, but
	domainEventsCallbacks is still an empty list.
	On shutdown __del__() deregisters the dispatacher again, which SEGVs

		# You need the event-loop implementation from the Python examples;
		# give the file a name which is importable by Python.
		ln examples/domain-events/events-python/event-test.py eloop.py
		python -c 'from eloop import *
		import sys

		def dump(*args): print " ".join(map(str, args))

		virEventLoopPureStart()
		c = libvirt.open("xen:///")
		c.domainEventRegister(dump, None)
		c.domainEventDeregister(dump)
		sys.exit(0)'

	domainEventDeregister() needs to delete domainEventCallbacks so subsequent
	calls to __del__() and domainEventRegister() choose the right code paths.
	Setting it to None is not enough, since calling domainEventRegiser() again
	would trigger an TypeError.

2010-07-23  Daniel P. Berrange  <berrange@redhat.com>

	Fix .mailmap after accidental wrong committer address

2010-07-23  Chris Wright  <chrisw@redhat.com>

	pciSharesBusWithActive fails to find multiple devices on bus
	The first conditional is always true which means the iterator will
	never find another device on the same bus.

	    if (dev->domain != check->domain ||
	        dev->bus != check->bus ||
	  ----> (check->slot == check->slot &&
	         check->function == check->function)) <-----

	The goal of that check is to verify that the device is either:

	  in a different pci domain
	  on a different bus
	  is the same identical device

	This means libvirt may issue a secondary bus reset when there are
	devices
	on that bus that actively in use by the host or another guest.

	* src/util/pci.c: fix a bogus test in pciSharesBusWithActive()

2010-07-23  Daniel P. Berrange  <berrange@redhat.com>

	Fix incorrect use of private data in remote driver
	The remote driver is using the wrong privateData field in
	a couple of functions. THis is harmless for stateful
	drivers like QEMU/UML/LXC, but will crash with Xen

	* src/remote/remote_driver.c: Fix use of privateData field

2010-07-23  Daniel P. Berrange  <berrange@redhat.com>

	Set a stable & high MAC addr for guest TAP devices on host
	A Linux software bridge will assume the MAC address of the enslaved
	interface with the numerically lowest MAC addr. When the bridge
	changes MAC address there is a period of network blackout, so a
	change should be avoided. The kernel gives TAP devices a completely
	random MAC address. Occassionally the random TAP device MAC is lower
	than that of the physical interface (eth0, eth1etc) that is enslaved,
	causing the bridge to change its MAC.

	This change sets an explicit MAC address for all TAP devices created
	using the configured MAC from the XML, but with the high byte set
	to 0xFE. This should ensure TAP device MACs are higher than any
	physical interface MAC.

	* src/qemu/qemu_conf.c, src/uml/uml_conf.c: Pass in a MAC addr
	  for the TAP device with high byte set to 0xFE
	* src/util/bridge.c, src/util/bridge.h: Set a MAC when creating
	  the TAP device to override random MAC

2010-07-23  Daniel P. Berrange  <berrange@redhat.com>

	Fix PCI address assignment if no IDE controller is present
	The PCI slot 1 must be reserved at all times, since PIIX3 is
	always present, even if no IDE device is in use for guest disks

	* src/qemu/qemu_conf.c: Always reserve slot 1 for PIIX3

2010-07-23  Ryota Ozaki  <ozaki.ryota@gmail.com>

	lxc: force kill of init process by sending SIGKILL if needed
	Init process may remain after sending SIGTERM for some reason.
	For example, if original init program is used, it is definitely
	not killed by SIGTERM.

	* src/lxc/lxc_controller.c: kill with SIGKILL if SIGTERM wasn't
	  sufficient

2010-07-22  Laine Stump  <laine@laine.org>

	Remove erroneous setting of return value to errno.
	One error exit in virStorageBackendCreateBlockFrom was setting the
	return value to errno. The convention for volume build functions is to
	return 0 on success or -1 on failure. Not only was it not necessary to
	set the return value (it defaults to -1, and is set to 0 when
	everything has been successfully completed), in the case that some
	caller were checking for < 0 rather than != 0, they would incorrectly
	believe that it completed successfully.

	Change virDirCreate to return -errno on failure.
	virDirCreate also previously returned 0 on success and errno on
	failure. This makes it fit the recommended convention of returning 0
	on success, -errno (ie a negative number) on failure.

	Make virStorageBackendCopyToFD return -errno.
	Previously virStorageBackendCopyToFD would simply return -1 on
	error. This made the error return from one of its callers inconsistent
	(createRawFileOpHook is supposed to return -errno, but if
	virStorageBackendCopyToFD failed, createRawFileOpHook would just
	return -1). Since there is a useful errno in every case of error
	return from virStorageBackendCopyToFD, and since the other uses of
	that function ignore the return code (beyond simply checking to see if
	it is < 0), this is a safe change.

2010-07-22  Laine Stump  <laine@laine.org>

	Change virFileOperation to return -errno (ie < 0) on error.
	virFileOperation previously returned 0 on success, or the value of
	errno on failure. Although there are other functions in libvirt that
	use this convention, the preferred (and more common) convention is to
	return 0 on success and -errno (or simply -1 in some cases) on
	failure. This way the check for failure is always (ret < 0).

	* src/util/util.c - change virFileOperation and virFileOperationNoFork to
	                    return -errno on failure.

	* src/storage/storage_backend.c, src/qemu/qemu_driver.c
	  - change the hook functions passed to virFileOperation to return
	    -errno on failure.

2010-07-21  Daniel P. Berrange  <berrange@redhat.com>

	Document the memory balloon device
	* formatdomain.html.in: Document <memballoon> element

2010-07-21  Daniel P. Berrange  <berrange@redhat.com>

	Re-arrange PCI device address assignment to match QEMU's default
	To try and ensure that people upgrading from old QEMU get guests
	with the same PCI device ordering, change the way we assign addrs
	to match QEMU's default order. This should make Windows less
	annoyed.

	* src/qemu/qemu_conf.c: Follow QEMU's default PCI ordering
	  logic when assigning addresses
	* tests/*.args: Update for changed PCI addresses

2010-07-21  Daniel P. Berrange  <dan@berrange.com>

	Explicitly represent balloon device in XML and handle PCI address
	To allow compatibility with older QEMU PCI device slot assignment
	it is necessary to explicitly track the balloon device in the
	XML. This introduces a new device

	   <memballoon model='virtio|xen'/>

	It can also have a PCI address, auto-assigned if necessary.

	The memballoon will be automatically added to all Xen and QEMU
	guests by default.

	* docs/schemas/domain.rng: Add <memballoon> element
	* src/conf/domain_conf.c, src/conf/domain_conf.h: parsing
	  and formatting for memballoon device. Always add a memory
	  balloon device to Xen/QEMU if none exists in XML
	* src/libvirt_private.syms: Export memballoon model APIs
	* src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Honour the
	  PCI device address in memory balloon device
	* tests/*: Update to test new functionality

2010-07-21  Daniel P. Berrange  <dan@berrange.com>

	Rearrange VGA/IDE controller address reservation
	The first VGA and IDE devices need to have fixed PCI address
	reservations. Currently this is handled inline with the other
	non-primary VGA/IDE devices. The fixed virtio balloon device
	at slot 3, ensures auto-assignment skips the slots 1/2. The
	virtio address will shortly become configurable though. This
	means the reservation of fixed slots needs to be done upfront
	to ensure that they don't get re-used for other devices.

	This is more or less reverting the previous changeset:

	  commit 83acdeaf173b2a1206b755c1ab317cac36facd90
	  Author: Daniel P. Berrange <berrange@redhat.com>
	  Date:   Wed Feb 3 16:11:29 2010 +0000

	  Fix restore of QEMU guests with PCI device reservation

	The difference is that this time, instead of unconditionally
	reserving the address, we only reserve the address if it was
	initially type=none. Addresses of type=pci were handled
	earlier in process by qemuDomainPCIAddressSetCreate(). This
	ensures restore step doesn't have problems

	* src/qemu/qemu_conf.c: Reserve first VGA + IDE address
	  upfront

2010-07-21  Daniel P. Berrange  <dan@berrange.com>

	Remove inappropriate use of VIR_ERR_NO_SUPPORT
	The VIR_ERR_NO_SUPPORT refers to an API which is not implemented.
	There is a separate VIR_ERR_CONFIG_UNSUPPORTED for XML config
	options that are not available with the current hypervisor.

	* src/qemu/qemu_conf.c, src/qemu/qemu_driver.c: Remove
	  many VIR_ERR_NO_SUPPORT replace with VIR_ERR_CONFIG_UNSUPPORTED

2010-07-21  Chris Lalancette  <clalance@redhat.com>

	Fix a NULL dereference in the case that the arg in question didn't exist.

2010-07-21  Daniel P. Berrange  <berrange@redhat.com>

	Remove bogus free of static strings
	Remove bogus free of statically allocated strings introduced
	in 03ca42046a54c5cfadb2e69194896abf06f6a10f

	* src/conf/capabilities.c: Don't free static strings for
	  default disk driver type/name

2010-07-20  Chris Lalancette  <clalance@redhat.com>

	Fix a deadlock in bi-directional p2p concurrent migration.
	If you try to execute two concurrent migrations p2p
	from A->B and B->A, the two libvirtd's will deadlock
	trying to perform the migrations.  The reason for this is
	that in p2p migration, the libvirtd's are responsible for
	making the RPC Prepare, Migrate, and Finish calls.  However,
	they are currently holding the driver lock while doing so,
	which basically guarantees deadlock in this scenario.

	This patch fixes the situation by adding
	qemuDomainObjEnterRemoteWithDriver and
	qemuDomainObjExitRemoteWithDriver helper methods.  The Enter
	take an additional object reference, then drops both the
	domain object lock and the driver lock.  The Exit takes
	both the driver and domain object lock, then drops the
	reference.  Adding calls to these Enter and Exit helpers
	around remote calls in the various migration methods
	seems to fix the problem for me in testing.

	This should make the situation safe. The additional domain
	object reference ensures that the domain object won't disappear
	while this operation is happening.  The BeginJob that is called
	inside of qemudDomainMigratePerform ensures that we can't execute a
	second migrate (or shutdown, or save, etc) job while the
	migration is active.  Finally, the additional check on the state
	of the vm after we reacquire the locks ensures that we can't
	be surprised by an external event (domain crash, etc).

2010-07-20  Chris Lalancette  <clalance@redhat.com>

	Make virsh setmaxmem balloon only when successful.
	After playing around with virsh setmaxmem for a bit,
	I ran into some surprising behavior; if a hypervisor does
	not support the virDomainSetMaxMemory() API, but the value
	specified for setmaxmem is less than the current amount
	of memory in the domain, the domain would be ballooned
	down *before* an error was reported.

	To make this more consistent, run virDomainSetMaxMemory()
	before trying to shrink; that way, if an error is thrown,
	no changes to the running domain are made.

2010-07-20  Chris Lalancette  <clalance@redhat.com>

	Use unsigned long in cmdSetmem.
	The virsh command "setmem" takes as input a number that
	should represent an unsigned long number of kilobytes.  Fix
	cmdSetmem to properly parse this as an unsigned long instead
	of an int.

2010-07-20  Laine Stump  <laine@laine.org>

	fsync new storage volumes even if new volume was copied.
	Originally the storage volume files were opened with O_DSYNC to make
	sure they were flushed to disk immediately. It turned out that this
	was extremely slow in some cases, so the O_DSYNC was removed in favor
	of just calling fsync() after all the data had been written. However,
	this call to fsync was inside the block that is executed to zero-fill
	the end of the volume file. In cases where the new volume is copied
	from an old volume, and they are the same length, this fsync would
	never take place.

	Now the fsync is *always* done, unless there is an error (in which
	case it isn't important, and is most likely inappropriate.

2010-07-20  Laine Stump  <laine@laine.org>

	Don't skip zero'ing end of volume file when inputvol is shorter than newvol
	A missing set of braces around an error condition caused us to skip
	zero'ing out the remainder of a new volume file if the new volume was
	longer than the original (the goto was supposed to be taken only in
	the case of error, but was always being taken).

2010-07-20  Chris Lalancette  <clalance@redhat.com>

	Always clear out the last_error in virshReportError.
	Otherwise you can get bogus "unknown error" printouts on
	subsequent commands.

	Fix up inconsistent virsh option error reporting.
	The virsh option error reporting was not being used
	consistently; some commands would spit out errors on
	missing required options while others would just silently fail.
	However, vshCommandOptString knows which ones are required
	and which ones aren't, so make it spit out an error where
	appropriate.  The rest of the patch is just cleaning up
	the uses of vshCommandOptString to deal with the new error
	reporting.

2010-07-20  Daniel P. Berrange  <berrange@redhat.com>

	Use the extract backing store format in storage volume lookup
	The storage volume lookup code was probing for the backing store
	format, instead of using the format extracted from the file
	itself. This meant it could report in accurate information. If
	a format is included in the file, then use that in preference,
	with probing as a fallback.

	* src/storage/storage_backend_fs.c: Use extracted backing store
	  format

2010-07-20  Daniel P. Berrange  <berrange@redhat.com>

	Rewrite qemu-img backing store format handling
	When creating qcow2 files with a backing store, it is important
	to set an explicit format to prevent QEMU probing. The storage
	backend was only doing this if it found a 'kvm-img' binary. This
	is wrong because plenty of kvm-img binaries don't support an
	explicit format, and plenty of 'qemu-img' binaries do support
	a format. The result was that most qcow2 files were not getting
	a backing store format.

	This patch runs 'qemu-img -h' to check for the two support
	argument formats

	  '-o backing_format=raw'
	  '-F raw'

	and use whichever option it finds

	* src/storage/storage_backend.c: Query binary to determine
	  how to set the backing store format

2010-07-20  Daniel P. Berrange  <berrange@redhat.com>

	Add ability to set a default driver name/type when parsing disks
	Record a default driver name/type in capabilities struct. Use this
	when parsing disks if value is not set in XML config.

	* src/conf/capabilities.h: Record default driver name/type for disks
	* src/conf/domain_conf.c: Fallback to default driver name/type
	  when parsing disks
	* src/qemu/qemu_driver.c: Set default driver name/type to raw

2010-07-20  Daniel P. Berrange  <berrange@redhat.com>

	Disable all disk probing in QEMU driver & add config option to re-enable
	Disk format probing is now disabled by default. A new config
	option in /etc/qemu/qemu.conf will re-enable it for existing
	deployments where this causes trouble

2010-07-20  Daniel P. Berrange  <berrange@redhat.com>

	Pass security driver object into all security driver callbacks
	The implementation of security driver callbacks often needs
	to access the security driver object. Currently only a handful
	of callbacks include the driver object as a parameter. Later
	patches require this is many more places.

	* src/qemu/qemu_driver.c: Pass in the security driver object
	  to all callbacks
	* src/qemu/qemu_security_dac.c, src/qemu/qemu_security_stacked.c,
	  src/security/security_apparmor.c, src/security/security_driver.h,
	  src/security/security_selinux.c: Add a virSecurityDriverPtr
	  param to all security callbacks

2010-07-20  Daniel P. Berrange  <berrange@redhat.com>

	Convert all disk backing store loops to shared helper API
	Update the QEMU cgroups code, QEMU DAC security driver, SELinux
	and AppArmour security drivers over to use the shared helper API
	virDomainDiskDefForeachPath().

	* src/qemu/qemu_driver.c, src/qemu/qemu_security_dac.c,
	  src/security/security_selinux.c, src/security/virt-aa-helper.c:
	  Convert over to use virDomainDiskDefForeachPath()

2010-07-20  Daniel P. Berrange  <berrange@redhat.com>

	Add an API for iterating over disk paths
	There is duplicated code which iterates over disk backing stores
	performing some action. Provide a convenient helper for doing
	this to eliminate duplication & risk of mistakes with disk format
	probing

	* src/conf/domain_conf.c, src/conf/domain_conf.h,
	  src/libvirt_private.syms: Add virDomainDiskDefForeachPath()

2010-07-20  Daniel P. Berrange  <berrange@redhat.com>

	Require format to be passed into virStorageFileGetMetadata
	Require the disk image to be passed into virStorageFileGetMetadata.
	If this is set to VIR_STORAGE_FILE_AUTO, then the format will be
	resolved using probing. This makes it easier to control when
	probing will be used

	* src/qemu/qemu_driver.c, src/qemu/qemu_security_dac.c,
	  src/security/security_selinux.c, src/security/virt-aa-helper.c:
	  Set VIR_STORAGE_FILE_AUTO when calling virStorageFileGetMetadata.
	* src/storage/storage_backend_fs.c: Probe for disk format before
	  calling virStorageFileGetMetadata.
	* src/util/storage_file.h, src/util/storage_file.c: Remove format
	  from virStorageFileMeta struct & require it to be passed into
	  method.

2010-07-19  Daniel P. Berrange  <berrange@redhat.com>

	Refactor virStorageFileGetMetadataFromFD to separate functionality
	The virStorageFileGetMetadataFromFD did two jobs in one. First
	it probed for storage type, then it extracted metadata for the
	type. It is desirable to be able to separate these jobs, allowing
	probing without querying metadata, and querying metadata without
	probing.

	To prepare for this, split out probing code into a new pair of
	methods

	  virStorageFileProbeFormatFromFD
	  virStorageFileProbeFormat

	* src/util/storage_file.c, src/util/storage_file.h,
	  src/libvirt_private.syms: Introduce virStorageFileProbeFormat
	  and virStorageFileProbeFormatFromFD

2010-07-19  Daniel P. Berrange  <berrange@redhat.com>

	Remove 'type' field from FileTypeInfo struct
	Instead of including a field in FileTypeInfo struct for the
	disk format, rely on the array index matching the format.
	Use verify() to assert the correct number of elements in the
	array.

	* src/util/storage_file.c: remove type field from FileTypeInfo

2010-07-19  Daniel P. Berrange  <berrange@redhat.com>

	Extract the backing store format as well as name, if available
	When QEMU opens a backing store for a QCow2 file, it will
	normally auto-probe for the format of the backing store,
	rather than assuming it has the same format as the referencing
	file. There is a QCow2 extension that allows an explicit format
	for the backing store to be embedded in the referencing file.
	This closes the auto-probing security hole in QEMU.

	This backing store format can be useful for libvirt users
	of virStorageFileGetMetadata, so extract this data and report
	it.

	QEMU does not require disk image backing store files to be in
	the same format the file linkee. It will auto-probe the disk
	format for the backing store when opening it. If the backing
	store was intended to be a raw file this could be a security
	hole, because a guest may have written data into its disk that
	then makes the backing store look like a qcow2 file. If it can
	trick QEMU into thinking the raw file is a qcow2 file, it can
	access arbitrary files on the host by adding further backing
	store links.

	To address this, callers of virStorageFileGetMeta need to be
	told of the backing store format. If no format is declared,
	they can make a decision whether to allow format probing or
	not.

2010-07-19  Daniel P. Berrange  <berrange@redhat.com>

	CVE-2010-2242 Apply a source port mapping to virtual network masquerading
	IPtables will seek to preserve the source port unchanged when
	doing masquerading, if possible. NFS has a pseudo-security
	option where it checks for the source port <= 1023 before
	allowing a mount request. If an admin has used this to make the
	host OS trusted for mounts, the default iptables behaviour will
	potentially allow NAT'd guests access too. This needs to be
	stopped.

	With this change, the iptables -t nat -L -n -v rules for the
	default network will be

	Chain POSTROUTING (policy ACCEPT 95 packets, 9163 bytes)
	 pkts bytes target     prot opt in     out     source               destination
	   14   840 MASQUERADE  tcp  --  *      *       192.168.122.0/24    !192.168.122.0/24    masq ports: 1024-65535
	   75  5752 MASQUERADE  udp  --  *      *       192.168.122.0/24    !192.168.122.0/24    masq ports: 1024-65535
	    0     0 MASQUERADE  all  --  *      *       192.168.122.0/24    !192.168.122.0/24

	* src/network/bridge_driver.c: Add masquerade rules for TCP
	  and UDP protocols
	* src/util/iptables.c, src/util/iptables.c: Add source port
	  mappings for TCP & UDP protocols when masquerading.

2010-07-17  Justin Clift  <jclift@redhat.com>

	man pages: update authors and copyright notice for libvirtd and virsh
	This patch removes the individual author names from the libvirtd and virsh
	man pages, instead referring to the main AUTHORS file distributed with
	libvirt.  This approach is needed, as we can't guarantee unicode support
	across all versions of pod2man used with libvirt.

	Additionally, this patch includes the libvirtd man page in the spec file
	used with "make rpm".  Without this patch "make rpm" is broken.

2010-07-16  Chris Lalancette  <clalance@redhat.com>

	Fix compile on i686.
	When printing out size_t, we need to use %zu to make sure it
	will continue to compile on both 32-bit and 64-bit platforms.

	Remove unused and bitrotting vshCommandOptStringList

	Remove error checking after using vshMalloc.
	vshMalloc and friends always exit() on allocation failure,
	so there is no reason to do checking for NULL in the code
	that uses it.

	Remove the "showerror" parameter from vshConnectionUsability.
	Nobody was using it anyway.

2010-07-16  David Allan  <dallan@redhat.com>

	RFC: Canonicalize block device paths
	There are many naming conventions for partitions associated with a
	block device.  Some of the major ones are:

	/dev/foo -> /dev/foo1
	/dev/foo1 -> /dev/foo1p1
	/dev/mapper/foo -> /dev/mapper/foop1
	/dev/disk/by-path/foo -> /dev/disk/by-path/foo-part1

	The universe of possible conventions isn't clear.  Rather than trying
	to understand all possible conventions, this patch divides devices
	into two groups, device mapper devices and everything else.  Device
	mapper devices seem always to follow the convention of device ->
	devicep1; everything else is canonicalized.

2010-07-15  Ryota Ozaki  <ozaki.ryota@gmail.com>

	daemon: dispatch.c should include stdio.h (and stdarg.h)
	dispatch.c requires stdio.h (and stdarg.h), however, currently
	dispatch.c implicitly relys on rpc/xdr.h to include stdio.h.
	If rpc/xdr.h unxpectedly does not include stdio.h, the compilation
	of dispatch.c fails.

	This can happen, for example, when portablexdr is installed
	under /usr/local; because portablexdr's rpc/xdr.h does not
	include stdio.h and gcc looks up it not /usr/include/rpc/xdr.h.

	Note that stdarg.h is also included according to man va_start,
	although stdio.h seems including it anyway.

2010-07-15  Jim Meyering  <meyering@redhat.com>

	uml_driver: correct logic error in umlMonitorCommand
	* src/uml/uml_driver.c (umlMonitorCommand): Correct flaw that would
	cause unconditional "incomplete reply ..." failure, since "nbytes"
	was always 0 or 1.

	qemuConnectMonitor: fix a bug that would have masked SELinux failure
	* src/qemu/qemu_driver.c (qemuConnectMonitor): Correct erroneous
	parenthesization in two expressions.  Without this fix, failure
	to set or clear SELinux security context in the monitor would go
	undiagnosed.  Also correct a diagnostic and split some long lines.

2010-07-14  Cole Robinson  <crobinso@redhat.com>

	python: Fix IOErrorReasonCallback bindings
	A copy and paste error was causing us to dispatch the incorrect
	routine. Spotted by Dan Kenigsberg.

	.gitignore: Ignore generated libvirtd docs

2010-07-14  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Make esxVI_*_Deserialize dynamically dispatched
	This will be used to deserialize the response from a call
	to esxVI_SearchDatastore_Task properly.

2010-07-13  Matthias Bolte  <matthias.bolte@googlemail.com>

	Add openauth example to demonstrate a custom auth callback

2010-07-13  Laine Stump  <laine@redhat.com>

	Eliminate compiler warning due to gettext string with no format args

2010-07-13  Justin Clift  <jclift@redhat.com>

	docs: fix so generated .html files are removed with make clean

2010-07-13  Jiri Denemark  <jdenemar@redhat.com>

	cpuCompare: Fix crash on unexpected CPU XML
	When comparing a CPU without <model> element, such as

	    <cpu>
	        <topology sockets='1' cores='1' threads='1'/>
	    </cpu>

	libvirt would happily crash without warning.

2010-07-13  Jiri Denemark  <jdenemar@redhat.com>

	cpu: Fail when CPU type cannot be detected from XML
	When autodetecting whether XML describes guest or host CPU, the presence
	of <arch> element is checked. If it's present, we treat the XML as host
	CPU definition. Which is right, since guest CPU definitions do not
	contain <arch> element. However, if at the same time the root <cpu>
	element contains `match' attribute, we would silently ignore it and
	still treat the XML as host CPU. We should rather refuse such invalid
	XML.

	cpuCompare: Fix comparison of two host CPUs
	When a CPU to be compared with host CPU describes a host CPU instead of
	a guest CPU, the result is incorrect. This is because instead of
	treating additional features in host CPU description as required, they
	were treated as if they were mentioned with all possible policies at the
	same time.

	qemu: Use -nodefconfig when probing for CPU models
	In case qemu supports -nodefconfig, libvirt adds uses it when launching
	new guests. Since this option may affect CPU models supported by qemu,
	we need to use it when probing for available models.

2010-07-13  Jiri Denemark  <jdenemar@redhat.com>

	virsh: Fix man page syntax
	pod2man prints the following warning when generating virsh.1:

	    tools/virsh.pod:890: Unmatched =back

2010-07-13  Daniel P. Berrange  <berrange@redhat.com>

	Fix potential crash in QEMU monitor JSON impl
	An indentation mistake meant that a check for return status
	was not properly performed in all cases. This could result
	in a crash on NULL pointer in a following line.

	* src/qemu/qemu_monitor_json.c: Fix check for return status
	  when processing JSON for blockstats

2010-07-12  Daniel P. Berrange  <berrange@redhat.com>

	Fix build by removing unknown pod2man flag
	Some versions of pod2man do not support the -u flag, so this
	can't be used

	* daemon/Makefile.am: Remove -u flag from pod2man

2010-07-12  Daniel P. Berrange  <berrange@redhat.com>

	Ensure we return the callback ID in python events binding
	A missing return statement in the python binding meant that
	the callers could not get the callback ID, and thus not be
	able to unregister event callbacks

	* python/libvirt-override-virConnect.py: Add missing return
	  statement

2010-07-10  Justin Clift  <jclift@redhat.com>

	html docs: added firewall explanation page by daniel berrange

2010-07-09  Justin Clift  <jclift@redhat.com>

	libvirtd: add man page for libvirtd
	With gracious thanks to Chris Lalancette for helping knock the
	description section into shape.

	This addresses BZ #595350

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

2010-07-09  Justin Clift  <justin@salasaga.org>

	virsh: add new --details option to vol-list
	This patch adds a new --details option to the virsh vol-list
	command, making its output more useful when many luns are
	present.

	Addresses BZ # 605543

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

2010-07-09  Justin Clift  <jclift@redhat.com>

	authors: update my authors details

2010-07-08  Chris Lalancette  <clalance@redhat.com>

	Fix a compile error in the previous commit.

	Implement virsh managedsave-remove command.

2010-07-07  Jiri Denemark  <jdenemar@redhat.com>

	cpu: Add new models from qemu's target-x86_64.conf

2010-07-07  Jiri Denemark  <jdenemar@redhat.com>

	cpu: Add support for CPU vendor
	By specifying <vendor> element in CPU requirements a guest can be
	restricted to run only on CPUs by a given vendor. Host CPU vendor is
	also specified in capabilities XML.

	The vendor is checked when migrating a guest but it's not forced, i.e.,
	guests configured without <vendor> element can be freely migrated.

2010-07-07  Jiri Denemark  <jdenemar@redhat.com>

	cpuBaseline: Detect empty set of common features
	In case the set of CPUs has no features in common, report incompatible
	CPUs instead of returning the simplest CPU model with all features
	disabled.

	cpuBaseline: Don't mess with the CPU returned by arch driver
	All features in the baseline CPU definition were always created with
	policy='require' even though an arch driver returned them with different
	policy settings.

	Make html docs in non-srcdir build

2010-07-05  Daniel Veillard  <veillard@redhat.com>

	Release of libvirt-0.8.2
	- configure.ac docs/news.html.in libvirt.spec.in: updated
	- po/*/o* : updated or.po and regenerated

2010-07-03  Matthias Bolte  <matthias.bolte@googlemail.com>

	vbox: Let configure detect/set the XPCOMC directory
	This allows the user to give an explicit path to configure

	  ./configure --with-vbox=/path/to/virtualbox

	instead of having the VirtualBox driver probe a set of possible
	paths at runtime. If no explicit path is specified then configure
	probes the set of "known" paths.

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

2010-07-02  Cole Robinson  <crobinso@redhat.com>

	udev: Parse PCI devices even if libpciaccess fails
	We only use libpciaccess for resolving device product/vendor. If
	initializing the library fails (say if using qemu:///session), don't
	warn so loudly, and carry on as usual.

	qemu: Improve some qemu.conf error reporting
	Log some info if we can't find a config file. Make parse failures
	fatal, and actually raise an error message.

	util: virExec: Dispatch all errors raised after fork
	Any error message raised after the process has forked needs
	to be followed by virDispatchError, otherwise we have no chance of
	ever seeing it. This was selectively done for hook functions in the past,
	but really applies to all post-fork errors.

2010-06-30  Ryota Ozaki  <ozaki.ryota@gmail.com>

	cgroup: Fix compilation broken on MinGW due to dirent->d_type
	As pointed out by Eric Blake, using dirent->d_type breaks
	compilation on MinGW. This patch addresses this by using
	'#if defined' as same as doing for virCgroupForDriver.

2010-06-30  Justin Clift  <justin@salasaga.org>

	html docs: add link to PHP bindings by Radek Hladik

2010-06-30  Eric Blake  <eblake@redhat.com>

	virsh: tweak help output for VSH_OT_DATA
	https://bugzilla.redhat.com/show_bug.cgi?id=609044 complained
	that 'virsh help pool-create-as' didn't document the shortcut
	that you can do 'virsh pool-create-as $name $type --target $target'
	rather than having to supply the four optional source- arguments
	in order to fill out the necessary positional arguments.

	This one-liner changes the help output to hopefully make this more obvious:

	  NAME
	    pool-create-as - create a pool from a set of args

	  SYNOPSIS
	    pool-create-as <name> [--print-xml] <type> [<source-host>] [<source-path>] [<source-dev>] [<source-name>] [<target>] [--source-format <string>]

	  DESCRIPTION
	    Create a pool.

	  OPTIONS
	    [--name] <string>  name of the pool
	    --print-xml      print XML document, but don't define/create
	    [--type] <string>  type of the pool
	    [--source-host] <string>  source-host for underlying storage
	    [--source-path] <string>  source path for underlying storage
	    [--source-dev] <string>  source device for underlying storage
	    [--source-name] <string>  source name for underlying storage
	    [--target] <string>  target for underlying storage
	    --source-format <string>  format for underlying storage

	* tools/virsh.c (vshCmddefHelp): Make it more obvious that data
	arguments may, but not must, be specified by option leaders.

2010-06-30  Daniel P. Berrange  <berrange@redhat.com>

	Avoid invoking the qemu monitor destroy callback if the constructor fails
	Some, but not all, codepaths in the qemuMonitorOpen() method
	would trigger the destroy callback. The caller does not expect
	this to be invoked if construction fails, only during normal
	release of the monitor. This resulted in a possible double-unref
	of the virDomainObjPtr, because the caller explicitly unrefs
	the virDomainObjPtr  if qemuMonitorOpen() fails

	* src/qemu/qemu_monitor.c: Don't invoke destroy callback from
	  qemuMonitorOpen() failure paths

2010-06-30  Ryota Ozaki  <ozaki.ryota@gmail.com>

	cgroup: Add missing errno == ENOENT check in virCgroupRemoveRecursively
	ENOENT happens normally when a subsystem is enabled with any other
	subsystems and the directory of the target group has already removed
	in a prior loop. In that case, the function should just return without
	leaving an error message.

	NB this is the same behavior as before introducing virCgroupRemoveRecursively.

2010-06-29  Chris Lalancette  <clalance@redhat.com>

	Fix crash when detaching devices from qemu domains.
	Make sure to *not* call qemuDomainPCIAddressReleaseAddr if
	QEMUD_CMD_FLAG_DEVICE is *not* set (for older qemu).  This
	prevents a crash when trying to do device detachment from
	a qemu guest.

	Check for active PCI devices when doing nodedevice operations.
	In the current libvirt PCI code, there is no checking whether
	a PCI device is in use by a guest when doing node device
	detach or reattach.  This causes problems when a device is
	assigned to a guest, and the administrator starts issuing
	nodedevice commands.  Make it so that we check the list
	of active devices when trying to detach/reattach, and only
	allow the operation if the device is not assigned to a guest.

2010-06-29  Justin Clift  <justin@salasaga.org>

	virsh: add new --details option to pool-list
	This patch adds a new --details option to the virsh pool-list
	command, making its output more useful to people who use virsh
	for significant lengths of time.

	Addresses BZ # 605543

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

2010-06-29  Eric Blake  <eblake@redhat.com>

	virFileResolveLink: guarantee an absolute path
	https://bugzilla.redhat.com/show_bug.cgi?id=608092

	* src/util/util.c (virFileResolveLink): Use
	canonicalize_file_name, rather than areadlink.

2010-06-29  Eric Blake  <eblake@redhat.com>

	phyp: don't steal storage management from other drivers
	Fix regression introduced in commit a4a287242 - basically, the
	phyp storage driver should only accept the same URIs that the
	main phyp driver is willing to accept.  Blindly accepting all
	URIs meant that the phyp storage driver was being consulted for
	'virsh -c qemu:///session pool-list --all', rather than the
	qemu storage driver, then since the URI was not for phyp, attempts
	to then use the phyp driver crashed because it was not initialized.

	* src/phyp/phyp_driver.c (phypStorageOpen): Only accept connections
	already open to a phyp driver.

2010-06-29  Laine Stump  <laine@redhat.com>

	Avoid calling virStorageFileIsSharedFS with NULL
	This code was just recently added (by me) and didn't account for the
	fact that stdin_path is sometimes NULL. If it's NULL, and
	SetSecurityAllLabel fails, a segfault would result.

2010-06-29  Ryota Ozaki  <ozaki.ryota@gmail.com>

	lxc: Fix virsh console doesn't work after restarting libvirtd
	Because tty path is unexpectedly not saved in the live configuration
	file of a domain, libvirtd cannot get the console of the domain back
	after restarting.

	The reason why the tty path isn't saved is that, to save the tty path,
	the save function, virDomainSaveConfig, requires that the target domain
	is running (pid != -1), however, lxc driver calls the function before
	starting the domain to pass the configuration to controller.

	To ensure to save the tty path, the patch lets lxc driver call the save
	function again after starting the domain.

2010-06-29  Ryota Ozaki  <ozaki.ryota@gmail.com>

	lxc: Fix error handlings in lxcContainerRenameAndEnableInterfaces
	The function is expected to return negative value on failure,
	however, it returns positive value when either setInterfaceName
	or vethInterfaceUpOrDown fails. Because the function returns
	the return value of either as is, however, the two functions
	may return positive value on failure.

	The patch fixes the defects and add error messages.

2010-06-29  Ryota Ozaki  <ozaki.ryota@gmail.com>

	lxc: Change VIR_ERROR to VIR_DEBUG for just a debugging message
	The message is actually not of error but of debugging.
	02:22:56.091: error : lxcControllerMain:316 : monitor=3 client=4 appPty=19 contPty=7

2010-06-28  Laine Stump  <laine@laine.org>

	Selectively ignore domainSetSecurityAllLabel failure in domain restore
	When the saved domain image is on an NFS share, at least some part of
	domainSetSecurityAllLabel will fail (for example, selinux labels can't
	be modified). To allow domain restore to still work in this case, just
	ignore the errors.

	use virStorageFileIsSharedFS utility function in qemudDomainSaveFlag
	Previously, this function had it's own bit of code performing the same
	function. Since there's now an equivalent utility function, let's use it.

2010-06-28  Laine Stump  <laine@laine.org>

	Enhance virStorageFileIsSharedFS
	virStorageFileIsSharedFS would previously only work if the entire path
	in question was stat'able by the uid of the libvirtd process. This
	patch changes it to crawl backwards up the path retrying the statfs
	call until it gets to a partial path that *can* be stat'ed.

	This is necessary to use the function to learn the fstype for files
	stored as a different user (and readable only by that user) on a
	root-squashed remote filesystem.

2010-06-28  Laine Stump  <laine@laine.org>

	Set proper selinux label on image file during qemu domain restore
	Also restore the label to its original value after qemu is finished
	with the file.

	Prior to this patch, qemu domain restore did not function properly if
	selinux was set to enforce.

2010-06-26  Eric Blake  <eblake@redhat.com>

	build: fix regression with libvirt-api.xml generation
	(EXTRA_DIST): Remove redundant listing of xml files.
	(html/%-%.html, html/%-virterror.html, %-api.xml, %-refs.xml):
	Rewrite with...
	(python_generated_files): ...new macro, since make didn't see
	through the dependency chain correctly otherwise.

2010-06-26  Chris Lalancette  <clalance@redhat.com>

	Fix a reference leak for node devices.
	There were some major, and some minor bugs having to do with
	the reference counting of node devices in daemon/remote.c.

	Some functions were completely failing to unreference node devices;
	this would lead to many open file descriptors, which would eventually
	fail.

	The minor bugs were along the same lines, but were in rarely
	used error paths.

2010-06-25  Daniel P. Berrange  <berrange@redhat.com>

	Don't squash file permissions when migration fails
	If an active migration operation fails, or is cancelled by the
	admin, the QEMU on the destination is shutdown and the one on
	the source continues running. It is important in shutting down
	the QEMU on the destination, the security drivers don't reset
	the file labelling/permissions.

	* src/qemu/qemu_driver.c: Don't reset labelling/permissions
	  on migration abort

2010-06-25  Eric Blake  <eblake@redhat.com>

	phyp: optimize use of sed
	Minor speedups by using the full power of sed.

	* src/phyp/phyp_driver.c (phypGetVIOSFreeSCSIAdapter)
	(phypDiskType, phypListDefinedDomains): Use fewer processes, by
	folding other work into sed.
	(phypGetVIOSPartitionID): Likewise.  Also avoid non-portable use
	of 'sed -s'.

2010-06-25  Eduardo Otubo  <otubo@linux.vnet.ibm.com>

	phyp: add storage management driver
	Add the storage management driver to the Power Hypervisor driver.
	This is a big but simple patch, it's just a new set of functions.

	This patch includes:
	 * Storage driver: The set of pool-* and vol-* functions.
	 * attach-disk function.
	 * Support for IVM on the new functions.

2010-06-25  Eduardo Otubo  <otubo@linux.vnet.ibm.com>

	phyp: add rudimentary storage driver
	* src/phyp/phyp_driver.c (phypStorageDriver): New driver.
	(phypStorageOpen, phypStorageClose): New functions.
	(phypRegister): Register it.

2010-06-25  Eric Blake  <eblake@redhat.com>

	phyp: reduce scope of driver functions
	Several phyp functions are not namespace clean, and had no reason
	to be exported since no one outside the phyp driver needed to use
	them.  Rather than do lots of forward declarations, I was able
	to topologically sort the file.  So, this patch looks huge, but
	is really just a matter of marking things static and dealing with
	the compiler fallout.

	* src/phyp/phyp_driver.h (PHYP_DRIVER_H): Add include guard.
	(phypCheckSPFreeSapce): Delete unused declaration.
	(phypGetSystemType, phypGetVIOSPartitionID, phypCapsInit)
	(phypBuildLpar, phypUUIDTable_WriteFile, phypUUIDTable_ReadFile)
	(phypUUIDTable_AddLpar, phypUUIDTable_RemLpar, phypUUIDTable_Pull)
	(phypUUIDTable_Push, phypUUIDTable_Init, phypUUIDTable_Free)
	(escape_specialcharacters, waitsocket, phypGetLparUUID)
	(phypGetLparMem, phypGetLparCPU, phypGetLparCPUGeneric)
	(phypGetRemoteSlot, phypGetBackingDevice, phypDiskType)
	(openSSHSession): Move declarations to phyp_driver.c and make static.
	* src/phyp/phyp_driver.c: Rearrange file contents to provide
	topological sorting of newly-static funtions (no semantic changes
	other than reduced scope).
	(phypGetBackingDevice, phypDiskType): Mark unused, for now.

2010-06-25  Eric Blake  <eblake@redhat.com>

	maint: add gnulib gettimeofday module
	* bootstrap.conf (gnulib_modules): Add gettimeofday.

2010-06-25  Daniel P. Berrange  <berrange@redhat.com>

	Fix test case failure due to missing -nodefconfig
	The previous change which split -nodefconfig probing off
	from -device broke the test case because it missed adding
	the QEMUD_CMD_FLAG_NODEFCONFIG to the test

	* src/util/bridge.c: Set QEMUD_CMD_FLAG_NODEFCONFIG for all
	  configs with QEMUD_CMD_FLAG_DEVICE set

2010-06-25  Daniel P. Berrange  <berrange@redhat.com>

	Fix migration in text mode and shared storage migration in json mode
	The patches for shared storage migration were not correctly written
	for json mode. Thus the 'blk' and 'inc' parameters were never being
	set. In addition they didn't set the QEMU_MONITOR_MIGRATE_BACKGROUND
	so migration was synchronous. Due to multiple bugs in QEMU's JSON
	impl this wasn't noticed because it treated the sync migration requst
	as asynchronous anyway. Finally 'background' parameter was converted
	to take arbitrary flags but not renamed, and not all uses were changed
	to unsigned int.

	* src/qemu/qemu_driver.c: Set QEMU_MONITOR_MIGRATE_BACKGROUND in
	  doNativeMigrate
	* src/qemu/qemu_monitor_json.c: Process QEMU_MONITOR_MIGRATE_NON_SHARED_DISK
	  and QEMU_MONITOR_MIGRATE_NON_SHARED_INC flags
	* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
	  src/qemu/qemu_monitor_json.h, src/qemu/qemu_monitor_text.c,
	  src/qemu/qemu_monitor_text.h: change 'int background' to
	  'unsigned int flags' in migration APIs. Add logging of flags
	  parameter

2010-06-25  Daniel P. Berrange  <berrange@redhat.com>

	Avoid blocking all APIs during incoming migration
	During incoming migration the QEMU monitor is not able to be
	used. The incoming migration code did not keep hold of the
	job lock because migration is split across multiple API calls.
	This meant that further monitor commands on the guest would
	hang until migration finished with no timeout.

	In this change the qemuDomainMigratePrepare method sets the
	job flag just before it returns. The qemuDomainMigrateFinish
	method checks for this job flag & clears it once done. This
	prevents any use of the monitor between prepare+finish steps.

	The qemuDomainGetJobInfo method is also updated to refresh
	the job elapsed time. This means that virsh domjobinfo can
	return time data during incoming migration

	* src/qemu/qemu_driver.c: Keep a job active during incoming
	  migration. Refresh job elapsed time when returning job info

2010-06-25  Daniel P. Berrange  <berrange@redhat.com>

	Set labelling for character devices in security drivers
	When configuring serial, parallel, console or channel devices
	with a file, dev or pipe backend type, it is necessary to label
	the file path in the security drivers. For char devices of type
	file, it is neccessary to pre-create (touch) the file if it does
	not already exist since QEMU won't be allowed todo so itself.
	dev/pipe configs already require the admin to pre-create before
	starting the guest.

	* src/qemu/qemu_security_dac.c: set file ownership for character
	  devices
	* src/security/security_selinux.c: Set file labeling for character
	  devices
	* src/qemu/qemu_driver.c: Add character devices to cgroup ACL

2010-06-25  Daniel P. Berrange  <berrange@redhat.com>

	Add API for iterating over all character devices
	The parallel, serial, console and channel devices are all just
	character devices. A lot of code needs todo the same thing to
	all these devices. This provides an convenient API for iterating
	over all of them.

	* src/conf/domain_conf.c, src/conf/domain_conf.c,
	  src/libvirt_private.syms: Add virDomainChrDefForeach

2010-06-25  Daniel P. Berrange  <berrange@redhat.com>

	Add missing parameter in python Disk IO error callback
	The IO error callback was forgetting to pass the action
	parameter, causing a stack trace when IO errors arrive

	* python/libvirt-override-virConnect.py: Add missing action
	  parameter in IO error callback

2010-06-25  Laine Stump  <laine@laine.org>

	Check for presence of qemu -nodefconfig option before using it
	We previously assumed that if the -device option existed in qemu, that
	-nodefconfig would also exist. It turns out that isn't the case, as
	demonstrated by qemu-kvm-0.12.3 in Fedora 13.

	*/src/qemu/qemu_conf.[hc] - add a new QEMUD_CMD_FLAG, set it via the
	                            help output, and check it before adding
	                            -nodefconfig to the qemu commandline.

2010-06-25  Eduardo Otubo  <otubo@linux.vnet.ibm.com>

	Adding Storage Management driver (style and indentation)
	This is just the indentation, style  and cleanup patch.

2010-06-24  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Use bool instead of int where appropriated

2010-06-24  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Add support for the controller element
	Also don't abuse the disk driver name to specify the SCSI controller
	model anymore:

	  <driver name='buslogic'/>

	Use the newly added model attribute of the controller element for this:

	  <controller type='scsi' index='0' model='buslogic'/>

	The disk driver name approach is deprecated now, but still works for
	backward compatibility reasons.

	Update the documentation and tests accordingly.

	Fix usage of the words controller and id in the VMX handling code. Use
	controller, bus and unit properly.

2010-06-24  Matthias Bolte  <matthias.bolte@googlemail.com>

	Add optional model attribute to the controller element
	This is a step towards controller support for the ESX driver.

2010-06-24  Matthias Bolte  <matthias.bolte@googlemail.com>

	Add wide SCSI bus disk address generation support
	The domain XML parsing code autogenerates disk address and
	controller elements when they are not explicitly specified.
	The code assumes a narrow SCSI bus (7 units per bus). ESX
	uses a wide SCSI bus (16 units per bus).

	This is a step towards controller support for the ESX driver.

2010-06-24  Matthias Bolte  <matthias.bolte@googlemail.com>

	Cleanup some LIBADD and CFLAGS
	Move libnl to libvirt_util.la, because macvtap.c requires it.

	Add GnuTLS to libvirt_driver.la, because libvirt.c calls gcrypt functions.
	When built without loadable driver modules, then the remote driver pulls
	in GnuTLS.

	Move libgnu.la from libvirt_parthelper_CFLAGS to libvirt_parthelper_LDADD.

2010-06-24  Ryota Ozaki  <ozaki.ryota@gmail.com>

	cgroup: Enable memory.use_hierarchy of cgroup for domain
	Through conversation with Kumar L Srikanth-B22348, I found
	that the function of getting memory usage (e.g., virsh dominfo)
	doesn't work for lxc with ns subsystem of cgroup enabled.

	This is because of features of ns and memory subsystems.
	Ns creates child cgroup on every process fork and as a result
	processes in a container are not assigned in a cgroup for
	domain (e.g., libvirt/lxc/test1/). For example, libvirt_lxc
	and init (or somewhat specified in XML) are assigned into
	libvirt/lxc/test1/8839/ and libvirt/lxc/test1/8839/8849/,
	respectively. On the other hand, memory subsystem accounts
	memory usage within a group of processes by default, i.e.,
	it does not take any child (and descendant) groups into
	account. With the two features, virsh dominfo which just
	checks memory usage of a cgroup for domain always returns
	zero because the cgroup has no process.

	Setting memory.use_hierarchy of a group allows to account
	(and limit) memory usage of every descendant groups of the group.
	By setting it of a cgroup for domain, we can get proper memory
	usage of lxc with ns subsystem enabled. (To be exact, the
	setting is required only when memory and ns subsystems are
	enabled at the same time, e.g., mount -t cgroup none /cgroup.)

2010-06-24  Ryota Ozaki  <ozaki.ryota@gmail.com>

	cgroup: Change virCgroupRemove to remove all descendant groups at first
	As same as normal directories, a cgroup cannot be removed if it
	contains sub groups. This patch changes virCgroupRemove to remove
	all descendant groups (subdirectories) of a target group before
	removing the target group.

	The handling is required when we run lxc with ns subsystem of cgroup.
	Ns subsystem automatically creates child cgroups on every process
	forks, but unfortunately the groups are not removed on process exits,
	so we have to remove them by ourselves.

	With this patch, such child (and descendant) groups are surely removed
	at lxc shutdown, i.e., lxcVmCleanup which calls virCgroupRemove.

2010-06-23  Eric Blake  <eblake@redhat.com>

	virsh: document attach-disk better
	http://bugzilla.redhat.com/601143, part 1 - document existing
	behavior.  Ever since Mar 2010 (commit ced154cb), the use of
	'attach-disk' or 'attach-device' to change cdrom/floppy media has been
	documented but deprecated, but the replacement to use 'update-device'
	was not documented.

	* tools/virsh.c (cmdAttachInterface, cmdAttachDisk): Fix bad error
	message.
	* tools/virsh.pod (attach-device, attach-disk): Refer to
	update-device for cdrom and floppy behavior.
	(update-device): Add documentation.

2010-06-23  Alan Pevec  <apevec@redhat.com>

	network: allow tftp port if tftp is defined
	add iptables rules to allow TFTP from the virtual network if <tftp>
	element is defined in the network definition.

	Fedora bz#580215

	* src/network/bridge_driver.c: open UDP port 69 for TFTP traffic if
	  tftproot is defined

2010-06-23  Alan Pevec  <apevec@redhat.com>

	bridge_driver.c: fix file description

2010-06-23  Daniel P. Berrange  <berrange@redhat.com>

	Add '-nodefconfig' command line arg to QEMU
	We already use the '-nodefaults' command line arg with QEMU to stop
	it adding any default devices to guests. Unfortunately, QEMU will
	load global config files from /etc/qemu that may also add default
	devices. These aren't blocked by '-nodefaults', so we need to also
	add the '-nodefconfig' arg to prevent that.

	Unfortunately these global config files are also used to define
	custom CPU models. So in blocking global hardware device addition
	we also block definitions of new CPU models. Libvirt doesn't know
	about these custom CPU models though, so it would never make use
	of them anyway. Thus blocking them via -nodefconfig isn't a show
	stopping problem. We would need to expand libvirt's own CPU model
	XML database to support these instead.

	* src/qemu/qemu_conf.c: Add '-nodefconfig' if available
	* tests/qemuxml2argvdata/: Add '-nodefconfig' to all data files which
	  have '-nodefaults' present

2010-06-23  Daniel P. Berrange  <berrange@redhat.com>

	Fix reference handling leak on qemuMonitor
	The current code pattern requires that callers of qemuMonitorClose
	check for the return value == 0, and if so, set priv->mon = NULL
	and release the reference held on the associated virDomainObjPtr

	The change d84bb6d6a3bd2fdd530184cc9743249ebddbee71 violated that
	requirement, meaning that priv->mon never gets set to NULL, and
	a reference count is leaked on virDomainObjPtr.

	This design was a bad one, so remove the need to check the return
	valueof qemuMonitorClose(). Instead allow registration of a
	callback that's invoked just when the last reference on qemuMonitorPtr
	is released.

	Finally there was a potential reference leak in qemuConnectMonitor
	in the failure path.

	* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add a destroy
	  callback invoked from qemuMonitorFree
	* src/qemu/qemu_driver.c: Use the destroy callback to release the
	  reference on virDomainObjPtr when the monitor is freed. Fix other
	  potential reference count leak in connecting to monitor

2010-06-23  Daniel P. Berrange  <berrange@redhat.com>

	Make checks for inactive QEMU guest more robust
	Before issuing monitor commands it is neccessary to check whether
	the guest is still running. Most places use virDomainIsActive()
	correctly, but a few relied on 'priv->mon != NULL'. In theory
	these should be equivalent, but the release of the last reference
	count on priv->mon can be delayed a small amount of time until
	the event handler is finally deregistered. A further ref counting
	bug also means that priv->mon might be never released. In such a
	case, code could mistakenly issue a monitor command and wait for
	a response that will never arrive, effectively leaving the QEMU
	driver waiting on virCondWait() forever..

	To protect against these possibilities, make sure all code uses
	virDomainIsActive(), not 'priv->mon != NULL'

	* src/qemu/qemu_driver.c: Replace 'priv->mon != NULL' with
	  calls to 'priv->mon != NULL'()

2010-06-23  Daniel P. Berrange  <berrange@redhat.com>

	Improve some error messages about unsupported APIs/URIs
	If there is no driver for a URI we report

	  "no hypervisor driver available"

	This is bad because not all virt drivers are hypervisors (ie container
	based virt).

	If there is no driver support for an API we report

	  "this function is not supported by the hypervisor"

	This is bad for the same reason, and additionally because it is
	also used for the network, interface & storage drivers.

	* src/util/virterror.c: Improve error messages

2010-06-22  Jiri Denemark  <jdenemar@redhat.com>

	Don't leak open fd to virsh in libvirt-guests init script
	Running virsh while having /var/lib/libvirt/libvirt-guests file open
	makes SELinux emit messages about preventing virsh from reading that
	file. Since virsh doesn't really want to read anything, it's better to
	run it with /dev/null on stdin to prevent those messages.

2010-06-22  Stefan Berger  <stefanb@us.ibm.com>

	nwfilter: fix loadable module support
	Following Daniel Berrange's multiple helpful suggestions for improving
	this patch and introducing another driver interface, I now wrote the
	below patch where the nwfilter driver registers the functions to
	instantiate and teardown the nwfilters with a function in
	conf/domain_nwfilter.c called virDomainConfNWFilterRegister. Previous
	helper functions that were called from qemu_driver.c and qemu_conf.c
	were move into conf/domain_nwfilter.h with slight renaming done for
	consistency. Those functions now call the function expored by
	domain_nwfilter.c, which in turn call the functions of the new driver
	interface, if available.

2010-06-21  Justin Clift  <justin@salasaga.org>

	virsh: remove a doubled up include for errno.h

2010-06-21  Jiri Denemark  <jdenemar@redhat.com>

	Misc cleanups
	- Fix documentation for virGetStorageVol: it has 'key' argument instead
	  of 'uuid'.
	- Remove TODO comment from virReleaseStorageVol: we use volume key as an
	  identifier instead of UUID.
	- Print human-readable UUID string in debug message in virReleaseSecret.

	Do not free static buffer with UUID
	As anywhere else, uuid is defined as a fixed size array inside
	_virSecret structure; we shouldn't try to free it.

	Remove unnecessary check for non-NULL uuid
	The first thing we do in all these functions is to check uuid != NULL
	and fail if it isn't.

	Index hashes by UUID instead of name
	Per-connection hashes for domains, networks, storage pools and network
	filter pools were indexed by names which was not the best choice. UUIDs
	are better identifiers, so lets use them.

2010-06-21  Philipp Hahn  <hahn@univention.de>

	Allow one-or-more <boot dev="..."/> entries
	According to docs/formatdomain.html.in, "The boot element can be
	repeated multiple times to setup a priority list of boot devices to try
	in turn." The Relax-NG schema required / allowed exactly one entry.

2010-06-19  Stefan Berger  <stefanb@us.ibm.com>

	nwfilter: extensions of docs with
	As requested, here a couple of paragraphs about the recently added statematch attribute and some advanced (and tricky) traffic filtering topics.

2010-06-18  Cole Robinson  <crobinso@redhat.com>

	Add ACK'd v2 changes for previous commit

2010-06-18  Cole Robinson  <crobinso@redhat.com>

	qemu: Fix crash on failed VM startup
	If VM startup fails early enough (can't find a referenced USB device),
	libvirtd will crash trying to clear the VNC port bit, since port = 0,
	which overflows us out of the bitmap bounds.

	Fix this by being more defensive in the bitmap operations, and only
	clearing a previously set VNC port.

2010-06-18  Philipp Hahn  <hahn@univention.de>

	Fix description of virStorageVolGetInfo()
	Probably a copy-paste-bug in python/libvirt-override-api.xml:
	virStorageVolGetInfo() extracts information about a "storage volume",
	not the "storage pool" as virStoragePoolGetInfo() does.

2010-06-18  Justin Clift  <justin@salasaga.org>

	virsh: add --uuid option to vol-pool
	Adds an optional switch, --uuid, for telling the virsh vol-pool command
	to return the pool UUID rather than pool name.

2010-06-18  Eric Blake  <eblake@redhat.com>

	qemu: reduce file padding requirements
	Followup to https://bugzilla.redhat.com/show_bug.cgi?id=599091,
	commit 20206a4b, to reduce disk waste in padding.

	* src/qemu/qemu_monitor.h (QEMU_MONITOR_MIGRATE_TO_FILE_BS): Drop
	back to 4k.
	(QEMU_MONITOR_MIGRATE_TO_FILE_TRANSFER_SIZE): New macro.
	* src/qemu/qemu_driver.c (qemudDomainSaveFlag): Update comment.
	* src/qemu/qemu_monitor_text.c (qemuMonitorTextMigrateToFile): Use
	two invocations of dd to output non-aligned large blocks.
	* src/qemu/qemu_monitor_json.c (qemuMonitorJSONMigrateToFile):
	Likewise.

2010-06-18  Stefan Berger  <stefanb@us.ibm.com>

	nwfilter: add XML attribute to control iptables state match
	This patch adds an optional XML attribute to a nwfilter rule to give the user control over whether the rule is supposed to be using the iptables state match or not. A rule may now look like shown in the XML below with the statematch attribute either having value '0' or 'false' (case-insensitive).

	[...]
	<rule action='accept' direction='in' statematch='false'>
	<tcp srcmacaddr='1:2:3:4:5:6'
	           srcipaddr='10.1.2.3' srcipmask='32'
	           dscp='33'
	           srcportstart='20' srcportend='21'
	           dstportstart='100' dstportend='1111'/>
	</rule>
	[...]

	I am also extending the nwfilter schema and add this attribute to a test case.

2010-06-18  Justin Clift  <justin@salasaga.org>

	virsh: ensure persistence and autostart are shown for dominfo and pool-info
	This patch adds the persistence status (yes/no) to the output of the virsh
	dominfo and pool-info commands.  This patch also adds the autostart status
	to the output of the virsh pool-info command.

	Red Hat BZ for this:

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

2010-06-18  Eduardo Otubo  <otubo@linux.vnet.ibm.com>

	phyp: adding support for IVM
	Use virBuffer* API to conditionally keep the portion of the command
	line specific to HMC, so that IVM can work.

2010-06-17  Stefan Berger  <stefanb@us.ibm.com>

	nwfilter: use match target on incoming traffic
	The following patch enables the iptables match target to be used by
	default for incoming traffic. So far it has only be used for outgoing
	traffic.

	macvtap: work-around for 2.6.32 and older kernels
	This patch works around a recent extension of the netlink driver I had made use of when building the netlink messages. Unfortunately older kernels don't accept IFLA_IFNAME + name of interface as a replacement for the interface's index, so this patch now gets the interface index ifindex if it's not provided (ifindex <= 0).

2010-06-17  Justin Clift  <justin@salasaga.org>

	virsh: change printf() calls to vshPrint()
	Trivial fix changing printf() calls to vshPrint() where the ctl
	variable is available.

2010-06-17  Justin Clift  <justin@salasaga.org>

	virsh: improve help text for vol query commands
	Improves the help text for vol-path, vol-name, and vol-key, which
	previously referred to volume UUIDs.

	Addresses BZ # 598365.

2010-06-17  Justin Clift  <justin@salasaga.org>

	virsh: add pool support to vol-key command
	Presently the vol-key command only supports being provided with
	a volume path.

	This patch adds support for providing it with a pool and volume
	identifier pair as well.

	    virsh # vol-key --pool <pool-name-or-uuid> <vol-name-or-path>

2010-06-17  Matthias Bolte  <matthias.bolte@googlemail.com>

	Add several missing vir*Free calls in libvirtd's remote code
	Justin Clift reported a problem with adding virStoragePoolIsPersistent
	to virsh's pool-info command, resulting in a strange problem. Here's
	an example:

	    virsh # pool-create-as images_dir3 dir - - - - "/home/images2"
	    Pool images_dir3 created

	    virsh # pool-info images_dir3
	    Name:           images_dir3
	    UUID:           90301885-94eb-4ca7-14c2-f30b25a29a36
	    State:          running
	    Capacity:       395.20 GB
	    Allocation:     30.88 GB
	    Available:      364.33 GB

	    virsh # pool-destroy images_dir3
	    Pool images_dir3 destroyed

	At this point the images_dir3 pool should be gone (because it was
	transient) and we should be able to create a new pool with the same name:

	    virsh # pool-create-as images_dir3 dir - - - - "/home/images2"
	    Pool images_dir3 created

	    virsh # pool-info images_dir3
	    Name:           images_dir3
	    UUID:           90301885-94eb-4ca7-14c2-f30b25a29a36
	    error: Storage pool not found

	The new pool got the same UUID as the first one, but we didn't specify
	one. libvirt should have picked a random UUID, but it didn't.

	It turned out that virStoragePoolIsPersistent leaks a reference to the
	storage pool object (actually remoteDispatchStoragePoolIsPersistent does).
	As a result, pool-destroy doesn't remove the virStoragePool for the
	"images_dir3" pool from the virConnectPtr's storagePools hash on libvirtd's
	side. Then the second pool-create-as get's the stale virStoragePool object
	associated with the "images_dir3" name. But this object has the old UUID.

	This commit ensures that all get_nonnull_* and make_nonnull_* calls for
	libvirt objects are matched properly with vir*Free calls. This fixes the
	reference leaks and the reported problem.

	All remoteDispatch*IsActive and remoteDispatch*IsPersistent functions were
	affected. But also remoteDispatchDomainMigrateFinish2 was affected in the
	success path. I wonder why that didn't surface earlier. Probably because
	domainMigrateFinish2 is executed on the destination host and in the common
	case this connection is opened especially for the migration and gets closed
	after the migration is done. So there was no chance to run into a problem
	because of the leaked reference.

2010-06-17  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Update case insensitive .vmx tests
	Commit b9efc7dc3b97ef667ab99cee884b8485ebcb2f91 made virFileHasSuffix
	case insensitive. Honor this in the tests by switching vmdk to VMDK.

	esx: Accept 'disk' as harddisk device type in .vmx files

2010-06-17  Eric Blake  <eblake@redhat.com>

	phyp: sed cleanups
	* src/phyp/phyp_driver.c (phypNumDomainsGeneric): Avoid glob
	collision by quoting sed argument.
	(phypDomainSetCPU): Avoid non-portable \+ in sed.
	(phypGetVIOSPartitionID, phypDiskType, phypListDomainsGeneric)
	(phypListDefinedDomains): Micro-optimize anchored substitutions.

2010-06-16  Justin Clift  <justin@salasaga.org>

	virsh: mark autostart answers for translation
	This is a trivial fix for several autostart yes/no strings that
	weren't correctly marked for translation.

2010-06-15  Eric Blake  <eblake@redhat.com>

	virsh: add start --paused support
	Make 'start --paused' mirror 'create --paused'.

	* tools/virsh.c (cmdStart): Use new virDomainCreateWithFlags API
	when needed.
	* tools/virsh.pod (start): Document --paused.

2010-06-15  Eric Blake  <eblake@redhat.com>

	qemu: support starting persistent domain paused
	Match earlier change for qemu pause support with virDomainCreateXML.

	* src/qemu/qemu_driver.c (qemudDomainObjStart): Add parameter; all
	callers changed.
	(qemudDomainStartWithFlags): Implement flag support.

2010-06-15  Eric Blake  <eblake@redhat.com>

	drivers: add virDomainCreateWithFlags if virDomainCreate exists
	* src/esx/esx_driver.c (esxDomainCreate): Move guts...
	(esxDomainCreateWithFlags): ...to new function.
	(esxDriver): Trivially support the new API.
	* src/lxc/lxc_driver.c (lxcDomainStart, lxcDomainStartWithFlags)
	(lxcDriver): Likewise.
	* src/opennebula/one_driver.c (oneDomainStart)
	(oneDomainStartWithFlags, oneDriver): Likewise.
	* src/openvz/openvz_driver.c (openvzDomainCreate)
	(openvzDomainCreateWithFlags, openvzDriver): Likewise.
	* src/qemu/qemu_driver.c (qemudDomainStart)
	(qemudDomainStartWithFlags, qemuDriver): Likewise.
	* src/test/test_driver.c (testDomainCreate)
	(testDomainCreateWithFlags, testDriver): Likewise.
	* src/uml/uml_driver.c (umlDomainStart, umlDomainStartWithFlags)
	(umlDriver): Likewise.
	* src/vbox/vbox_tmpl.c (vboxDomainCreate)
	(vboxDomainCreateWithFlags, Driver): Likewise.
	* src/xen/xen_driver.c (xenUnifiedDomainCreate)
	(xenUnifiedDomainCreateWithFlags, xenUnifiedDriver): Likewise.
	* src/xenapi/xenapi_driver.c (xenapiDomainCreate)
	(xenapiDomainCreateWithFlags, xenapiDriver): Likewise.

2010-06-15  Eric Blake  <eblake@redhat.com>

	remote: protocol implementation for virDomainCreateWithFlags
	Define the wire format for the new virDomainCreateWithFlags
	API, and implement client and server side of marshaling code.

	* daemon/remote.c (remoteDispatchDomainCreateWithFlags): Add
	server side dispatch for virDomainCreateWithFlags.
	* src/remote/remote_driver.c (remoteDomainCreateWithFlags)
	(remote_driver): Client side serialization.
	* src/remote/remote_protocol.x
	(remote_domain_create_with_flags_args)
	(remote_domain_create_with_flags_ret)
	(REMOTE_PROC_DOMAIN_CREATE_WITH_FLAGS): Define wire format.
	* daemon/remote_dispatch_args.h: Regenerate.
	* daemon/remote_dispatch_prototypes.h: Likewise.
	* daemon/remote_dispatch_table.h: Likewise.
	* src/remote/remote_protocol.c: Likewise.
	* src/remote/remote_protocol.h: Likewise.
	* src/remote_protocol-structs: Likewise.

2010-06-15  Eric Blake  <eblake@redhat.com>

	libvirt: introduce domainCreateWithFlags API
	Persistent domain creation needs the same features as transient
	domains, but virDomainCreate lacks the flags argument present in
	virDomainCreateXML.  virDomainCreateFlags is already claimed as
	a public enum, so we have to break convention and expose
	virDomainCreateWithFlags.

	* include/libvirt/libvirt.h.in (virDomainCreateWithFlags): Add.
	* src/driver.h (virDrvDomainCreateWithFlags): Internal API.
	* src/libvirt.c (virDomainCreateWithFlags): Glue public API to
	driver API.
	* src/libvirt_public.syms (LIBVIRT_0.8.2): Expose public API.
	* src/esx/esx_driver.c (esxDriver): Add stub for driver.
	* src/lxc/lxc_driver.c (lxcDriver): Likewise.
	* src/opennebula/one_driver.c (oneDriver): Likewise.
	* src/openvz/openvz_driver.c (openvzDriver): Likewise.
	* src/phyp/phyp_driver.c (phypDriver): Likewise.
	* src/qemu/qemu_driver.c (qemuDriver): Likewise.
	* src/remote/remote_driver.c (remote_driver): Likewise.
	* src/test/test_driver.c (testDriver): Likewise.
	* src/uml/uml_driver.c (umlDriver): Likewise.
	* src/vbox/vbox_tmpl.c (Driver): Likewise.
	* src/xen/xen_driver.c (xenUnifiedDriver): Likewise.
	* src/xenapi/xenapi_driver.c (xenapiDriver): Likewise.

2010-06-15  Eric Blake  <eblake@redhat.com>

	maint: simplify some ignore files
	* .hgignore: Delete, no longer used.
	* examples/python/.gitignore: Delete, covered globally.
	* include/.gitignore: Likewise.
	* python/tests/.gitignore: Likewise.
	* docs/schemas/.gitignore: Likewise.
	* tests/xml2sexprdata/.gitignore: Likewise.
	* tests/sexpr2xmldata/.gitignore: Likewise.
	* tests/confdata/.gitignore: Likewise.
	* tests/xencapsdata/.gitignore: Likewise.
	* tests/xmconfigdata/.gitignore: Likewise.
	* tests/xml2sexprdata/.gitignore: Likewise.

2010-06-15  Eric Blake  <eblake@redhat.com>

	parthelper: fix compilation without optimization
	Daniel's patch works with gcc and CFLAGS containing -O (the
	autoconf default), but fails with non-gcc or with other
	CFLAGS (such as -g), since c-ctype.h declares c_isdigit as
	a macro only for certain compilation settings.

	* src/Makefile.am (libvirt_parthelper_LDFLAGS): Add gnulib
	library, for when c_isdigit is not a macro.
	* src/storage/parthelper.c (main): Avoid out-of-bounds
	dereference, noticed by Jim Meyering.

2010-06-15  Daniel P. Berrange  <berrange@redhat.com>

	Fix enumeration of partitions in disks with a trailing digit in path
	Disks with a trailing digit in their path (eg /dev/loop0 or
	/dev/dm0) have an extra 'p' appended before the partition
	number (eg, to form /dev/loop0p1 not /dev/loop01). Fix the
	partition lookup to append this extra 'p' when required

	* src/storage/parthelper.c: Add a 'p' before partition
	  number if required

2010-06-12  Eric Blake  <eblake@redhat.com>

	uml: sanity check external data before using it
	Otherwise, a malicious packet could cause a DoS via spurious
	out-of-memory failure.

	* src/uml/uml_driver.c (umlMonitorCommand): Validate that incoming
	data is reliable before using it to allocate/dereference memory.
	Don't report bogus errno on short read.
	Reported by Jim Meyering.

2010-06-12  Matthias Bolte  <matthias.bolte@googlemail.com>

	Improve error message for disabled client-side drivers
	Report that libvirt was built without that driver instead of
	trying to connect to a libvirtd, when we know that this is
	going to fail.

2010-06-11  Matthias Bolte  <matthias.bolte@googlemail.com>

	vbox: check getenv("DISPLAY") for NULL in vboxDomainDumpXML
	Otherwise this will segfault if DISPLAY is not defined.

2010-06-11  Matthias Bolte  <matthias.bolte@googlemail.com>

	Check getenv("PATH") for NULL in virFindFileInPath
	Otherwise this will segfault if PATH is not defined.

	Reported by Emre Erenoglu

2010-06-11  Justin Clift  <justin@salasaga.org>

	virsh: add snapshot backing store support to vol-create-as
	This patch adds two new parameters to the vol-create-as command:

	 --backing-vol <volume-name-or-key-or-path>
	 --backing-vol-format <format-of-backing-vol>

	  virsh # vol-create-as guest_images_lvm snapvol1 5G --backing-vol \
	              rhel6vm1lun1
	  Vol snapvol1 created

	  virsh # vol-create-as image_dir qcow2snap2 5G --format qcow2 \
	              --backing-vol imagevol1.qcow2 \
	              --backing-vol-format qcow2
	  Vol qcow2snap2 created

	Additionally, the virsh man page update fixes incorrect snapshot
	parameters that were included in my prior bulk volume command patch.

2010-06-10  Eric Blake  <eblake@redhat.com>

	build: fix some mingw issues
	On Fedora 13 with sufficient mingw32-* packages installed, running
	./autobuild.sh failed to cross-compile to mingw because
	mingw32-pthreads installed a broken <pthread.h>.  With that
	issue fixed, the build still failed due to use of O_SYNC.
	Meanwhile, recent .spec.in changes got out of sync.

	* bootstrap.conf (gnulib_modules): Add fcntl-h, for O_SYNC.
	* .gnulib: Update to latest, to work around buggy pthreads-win32
	library.
	* bootstrap: Import latest from gnulib.
	* mingw32-libvirt.spec.in: Distribute new file.

2010-06-10  Eric Blake  <eblake@redhat.com>

	build: avoid pthreads-win32 on mingw
	* src/util/threads.c (includes) [WIN32]: On mingw, favor native
	threading over pthreads-win32 library.
	* src/util/thread.h [WIN32] Likewise.
	Suggested by Daniel P. Berrange.

2010-06-09  Daniel P. Berrange  <berrange@redhat.com>

	Fix cgroup setup code to cope with root squashing NFS
	When a disk is on a root squashed NFS server, it may not be
	possible to stat() the disk file in virCgroupAllowDevice.
	The virStorageFileGetMeta method may also fail to extract
	the parent backing store. Both of these errors have to be
	ignored to avoid breaking NFS deployments

	* src/qemu/qemu_driver.c: Ignore errors in cgroup setup to
	   keep root squash NFS happy

2010-06-09  Justin Clift  <justin@salasaga.org>

	virsh: fixed trivial comment and debug message in vshCommandOptVolBy function

	virsh: remove xen reference in header comment
	With libvirt and virsh now being used for much more than Xen, this
	patch removes the outdated reference to Xen in the file header.

2010-06-09  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Add proxy query parameter
	Allow to specify a proxy to be used by libcurl.

	esx: Refactor esxUtil_ParseQuery's parameter handling
	Pass a struct containing the parameters instead of passing each
	one individually. This make future extensions a bit simpler.

2010-06-09  Justin Clift  <justin@salasaga.org>

	virsh: add the volume commands to the virsh man page
	This patch also includes the new vol-pool command.

	virsh: add new vol-pool command
	This patch adds a new "vol-pool" command to virsh, to round out the
	identifier conversion functions for volumes in virsh.  Now it is
	possible to work with volumes when starting from just a volume key
	or volume path.

2010-06-09  Eric Blake  <eblake@redhat.com>

	virsh: add --paused option to create
	* tools/virsh.c (opts_create): Add --paused option.
	(cmdCreate): Pass appropriate flag.
	* tools/virsh.pod: Document it.

2010-06-09  Eric Blake  <eblake@redhat.com>

	qemu: allow creation of a paused domain
	https://bugzilla.redhat.com/show_bug.cgi?id=589465

	Some guests (eg with badly configured grub, or Windows' installation cd)
	require quick response from the console user. That's why we have a
	"launchPaused" option in vdsm.

	To implement it via libvirt, we need to ask libvirt not to call
	qemuMonitorStartCPUs() after starting qemu.  Calling virDomainStop
	immediately after the domain is up is inherently raceful.

	* src/qemu/qemu_driver.c (qemudStartVMDaemon): Add new parameter;
	all callers adjusted.
	(qemudDomainCreate): Implement support for new flag.

2010-06-09  Eric Blake  <eblake@redhat.com>

	virDomainCreateXML: support new flag
	* include/libvirt/libvirt.h.in (virDomainCreateFlags): Add
	VIR_DOMAIN_START_PAUSED.
	* src/libvirt.c (virDomainCreateXML): Update documentation.
	* src/lxc/lxc_driver.c (lxcDomainCreateAndStart): Reject new flag
	as unimplemented.
	* src/opennebula/one_driver.c (oneDomainCreateAndStart):
	Likewise.
	* src/openvz/openvz_driver.c (openvzDomainCreateXML): Likewise.
	* src/phyp/phyp_driver.c (phypDomainCreateAndStart): Likewise.
	* src/qemu/qemu_driver.c (qemudDomainCreate): Likewise.
	* src/test/test_driver.c (testDomainCreateXML): Likewise.
	* src/uml/uml_driver.c (umlDomainCreate): Likewise.
	* src/vbox/vbox_tmpl.c (vboxDomainCreateXML): Likewise.
	* src/xen/xend_internal.c (xenDaemonCreateXML): Likewise.
	* src/xenapi/xenapi_driver.c (xenapiDomainCreateXML): Likewise.

2010-06-09  David Allan  <dallan@redhat.com>

	Fix leaks in udev device add/remove v3
	* This patch is a modification of a patch submitted by Nigel Jones.
	  It fixes several memory leaks on device addition/removal:

	1. Free the virNodeDeviceDefPtr in udevAddOneDevice if the return
	   value is non-zero

	2. Always release the node device reference after the device has been
	   processed.

	* Refactored for better readability per the suggestion of clalance

2010-06-09  David Allan  <dallan@redhat.com>

	Add multiIQN tests
	* Fix broken rng schema
	* Add test input & output files

	Add multiiqn XML dump
	* Use virBufferEscapeString() per Dan B.

2010-06-08  Daniel P. Berrange  <berrange@redhat.com>

	Fix test breakage from virtio serial changes
	The virtio serial changes broke the test suite because they forgot
	to add the new address attribute to the domain XML schema. The
	xml2xml test also broke because the XML no longer roundtrips. This
	is due to testing of auto-addition of <controller> elements. Split
	that test case off into a separate XML file to avoid breakage

	* docs/schemas/domain.rng: Allow port number for virtio serial addresses
	* tests/qemuxml2argvdata/qemuxml2argv-channel-virtio.args,
	  tests/qemuxml2argvdata/qemuxml2argv-channel-virtio.xml: Revert to
	  a simple config to avoid breaking xml2xml test
	* tests/qemuxml2argvdata/qemuxml2argv-channel-virtio-auto.xml,
	  tests/qemuxml2argvdata/qemuxml2argv-channel-virtio-auto.args: Add
	  complex test case for auto-controller addition for xml2argv test
	* tests/qemuxml2argvtest.c: Add channel-virtio-auto test

2010-06-08  Daniel P. Berrange  <berrange@redhat.com>

	Enable probing of VPC disk format type
	A look at the QEMU source revealed the missing bits of info about
	the VPC file format, so we can enable this now

	* src/util/storage_file.c: Enable VPC format, providing version
	  and disk size offset fields

2010-06-08  Daniel P. Berrange  <berrange@redhat.com>

	Ensure that PCI device is reattached to host if hotadd fails
	When an attempt to hotplug a PCI device to a guest fails,
	the device was left attached to pci-stub. It is neccessary
	to reset the device and then attach it to the host driver
	again.

	* src/qemu/qemu_driver.c: Reattach PCI device to host if
	  hotadd fails

2010-06-08  Daniel P. Berrange  <berrange@redhat.com>

	Don't raise errors in the selinux restore code
	The restore code is done in places where errors cannot be
	raised, since they will overwrite over pre-existing errors.

	* src/security/security_selinux.c: Only warn about failures
	  in label restore, don't report errors

2010-06-08  Daniel P. Berrange  <berrange@redhat.com>

	Fix check for errors in device_add command in QEMU text monitor
	Any output at all from device_add indicates an error in the
	command execution. Thus it needs to check for reply != ""

	* src/qemu/qemu_monitor_text.c: Fix reply check for errors
	  to treat any output as an error

2010-06-08  Daniel P. Berrange  <berrange@redhat.com>

	Prefer UDEV to HAL drivers if both a compiled
	HAL is deprecated and UDEV is the future. Thus if both
	options are compiled, we should prefer use of UDEV over
	HAL

	* src/node_device/node_device_driver.c: Switch init
	  order to try UDEV first, then HAL

2010-06-08  Daniel J Walsh  <dwalsh@redhat.com>

	Add support for setting socket MLS level in SELinux driver
	When SELinux is running in MLS mode, libvirtd will have a
	different security level to the VMs. For libvirtd to be
	able to connect to the monitor console, the client end of
	the UNIX domain socket needs a different label. This adds
	infrastructure to set the socket label via the security
	driver framework

	* src/qemu/qemu_driver.c: Call out to socket label APIs in
	  security driver
	* src/qemu/qemu_security_stacked.c: Wire up socket label
	  drivers
	* src/security/security_driver.h: Define security driver
	  entry points for socket labelling
	* src/security/security_selinux.c: Set socket label based on
	  VM label

2010-06-08  Daniel P. Berrange  <berrange@redhat.com>

	Network duplicate UUID/name checking
	The network driver is not doing correct checking for
	duplicate UUID/name values. This introduces a new method
	virNetworkObjIsDuplicate, based on the previously
	written virDomainObjIsDuplicate.

	* src/conf/network_conf.c, src/conf/network_conf.c,
	  src/libvirt_private.syms: Add virNetworkObjIsDuplicate,
	* src/network/bridge_driver.c: Call virNetworkObjIsDuplicate
	  for checking uniqueness of uuid/names

2010-06-08  Daniel P. Berrange  <berrange@redhat.com>

	Fix error codes for missing storage pools
	The storage pool driver is mistakenly using the error code
	VIR_ERR_INVALID_STORAGE_POOL which is for diagnosing invalid
	pointers. This patch switches it to use VIR_ERR_NO_STORAGE_POOL
	which is the correct code for cases where the storage pool does
	not exist

	* src/storage/storage_driver.c: Replace VIR_ERR_INVALID_STORAGE_POOL
	  with VIR_ERR_NO_STORAGE_POOL

2010-06-08  Daniel P. Berrange  <berrange@redhat.com>

	Storage pool duplicate UUID/name checking
	The storage pool driver is not doing correct checking for
	duplicate UUID/name values. This introduces a new method
	virStoragePoolObjIsDuplicate, based on the previously
	written virDomainObjIsDuplicate.

	* src/conf/storage_conf.c, src/conf/storage_conf.c,
	  src/libvirt_private.syms: Add virStoragePoolObjIsDuplicate,
	* src/storage/storage_driver.c: Call virStoragePoolObjIsDuplicate
	  for checking uniqueness of uuid/names

2010-06-08  Daniel P. Berrange  <berrange@redhat.com>

	Fix auto-adding of virtio serial controllers
	The domain parsing code would auto-add a virtio serial controller
	if it saw any virtio serial channel defined. Unfortunately it
	always added a controller with index=0, even if the channel address
	specified an index != 0. It only added one controller, even if
	multiple controllers were referenced by channels. Finally, it let
	the ports+vectors parameters initialize to zero instead of -1, which
	prevented the controllers accepting any ports.

	* src/conf/domain_conf.c: Initialize ports+vectors when adding
	  virtio serial controllers. Add all neccessary virtio serial
	  controllers, instead of hardcoding controller 0
	* qemuxml2argvdata/qemuxml2argv-channel-virtio.args,
	  qemuxml2argvdata/qemuxml2argv-channel-virtio.xml: Expand to
	  test controller auto-add behaviour

2010-06-08  Daniel P. Berrange  <berrange@redhat.com>

	Include port number with virtio serial devices
	To ensure that the device addressing scheme is stable across
	hotplug/unplug, all virtio serial channels needs to have an
	associated port number in their address. This is then specified
	to QEMU using the nr=NNN parameter

	* src/conf/domain_conf.c, src/conf/domain_conf.h: Parsing
	  for port number in vioserial address types.
	* src/qemu/qemu_conf.c: Set 'nr=NNN' parameter with virtio
	  serial port number
	* tests/qemuxml2argvdata/qemuxml2argv-channel-virtio.args,
	  tests/qemuxml2argvdata/qemuxml2argv-channel-virtio.xml: Expand
	  data set to ensure coverage of port addressing

2010-06-08  Daniel P. Berrange  <berrange@redhat.com>

	Disable use of 'reason' field in block IO event in QEMU
	QEMU upstream decided against adding a 'reason' field to
	the block IO event in QMP. Disable this code to remove a
	annoying warning message. It will be renabled when the
	error string reason is re-introduced in QEMU

2010-06-08  Daniel P. Berrange  <berrange@redhat.com>

	Ensure UNIX domain sockets are removed on daemon shutdown
	When libvirtd exits it is leaving UNIX domain sockets on
	the filesystem. These need to be removed.

	The qemudInitPaths() method has signficant code churn to
	switch from using a pre-allocated buffer on the stack, to
	dynamically allocating on the heap.

	* daemon/libvirtd.c, daemon/libvirtd.h: Store a reference
	  to the UNIX domain socket path and unlink it on shutdown

2010-06-08  Justin Clift  <justin@salasaga.org>

	virsh: fix minor virsh man page typos and formatting problems

2010-06-08  Jamie Strandboge  <jamie@ubuntu.com>

	Fix AppArmor save/restore.Add stdin_path to qemudStartVMDaemon() args.
	Refactor to update AppArmor security driver to adjust profile for
	save/restore. This addresses the following bugs:

	 https://bugzilla.redhat.com/show_bug.cgi?id=529363
	 https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/457716

2010-06-08  Jamie Strandboge  <jamie@ubuntu.com>

	Add stdin_path to qemudStartVMDaemon() args.
	Adjust args to qemudStartVMDaemon() to also specify path to stdin_fd,
	so this can be passed to the AppArmor driver via SetSecurityAllLabel().

	This updates all calls to qemudStartVMDaemon() as well as setting up
	the non-AppArmor security driver *SetSecurityAllLabel() declarations
	for the above. This is required for the following
	"apparmor-fix-save-restore" patch since AppArmor resolves the passed
	file descriptor to the pathname given to open().

2010-06-06  Jim Meyering  <meyering@redhat.com>

	avoid syntax-check failure
	* .mailmap: Map a stray commit-author email address to the canonical one.
	Reported by Justin Clift.

2010-06-05  Laine Stump  <laine@laine.org>

	Adjust block size used by dd to speed QEMU domain save operations.
	See https://bugzilla.redhat.com/show_bug.cgi?id=599091

	Saving a paused 512MB domain took 3m47s with the old block size of 512
	bytes. Changing the block size to 1024*1024 decreased the time to 56
	seconds. (Doubling again to 2048*1024 yielded 0 improvement; lowering
	to 512k increased the save time to 1m10s, about 20%)

2010-06-05  Laine Stump  <laine@laine.org>

	Fix dereference of potentially freed pointer in qemudDomainSaveFlags
	The pointer to the xml describing the domain is saved into an object
	prior to calling VIR_REALLOC_N() to make the size of the memory it
	points to a multiple of QEMU_MONITOR_MIGRATE_TO_FILE_BS. If that
	operation needs to allocate new memory, the pointer that was saved is
	no longer valid.

	To avoid this situation, adjust the size *before* saving the pointer.

	(This showed up when experimenting with very large values of
	QEMU_MONITOR_MIGRATE_TO_FILE_BS).

2010-06-05  Jim Fehlig  <jfehlig@linux-ypgk.site>

	Fixes for commit 211dd1e9
	Fixes for issues in commit 211dd1e9 noted by by Jim Meyering.

	1. Allocate content buffer of size content_length + 1 to ensure
	   NUL-termination.
	2. Limit content buffer size to 64k
	3. Fix whitespace issue

	V2:
	  - Add comment to clarify allocation of content buffer
	  - Add ATTRIBUTE_NONNULL where appropriate
	  - User NULLSTR macro

2010-06-05  Eric Blake  <eblake@redhat.com>

	autobuild.sh: avoid bashism
	* autobuild.sh: Replace 'set -o pipefail' with POSIX alternative.
	Reported by Matthias Bolte.

2010-06-04  Jim Fehlig  <jfehlig@novell.com>

	Allocate buffer to hold xend response
	There are cases when a response from xend can exceed 4096 bytes, in
	which case anything beyond 4096 is ignored. This patch changes the
	current fixed-size, stack-allocated buffer to a dynamically allocated
	buffer based on Content-Length in HTTP header.

2010-06-03  David Allan  <dallan@redhat.com>

	Update nodedev scsi_host data before use
	* It appears that the udev event for HBA creation arrives before the
	  associated sysfs data is fully populated, resulting in bogus data
	  for the nodedev entry until the entry is refreshed.  This problem is
	  particularly troublesome when creating NPIV vHBAs because it results
	  in libvirt failing to find the newly created adapter and waiting for
	  the full timeout period before erroneously failing the create
	  operation.  This patch forces an update before any attempt to use
	  any scsi_host nodedev entry.

	Fix device destroy return value
	* Set return value in error cases
	* Clarify error message when parent device is not vport capable

2010-06-03  Eduardo Otubo  <otubo@linux.vnet.ibm.com>

	phyp: Strict check when listing domains

2010-06-03  Stefan Berger  <stefanb@us.ibm.com>

	add 802.1Qbh and 802.1Qbg handling
	This patch that adds support for configuring 802.1Qbg and 802.1Qbh
	switches. The 802.1Qbh part has been successfully tested with real
	hardware. The 802.1Qbg part has only been tested with a (dummy)
	server that 'behaves' similarly to how we expect lldpad to 'behave'.

	The following changes were made during the development of this patch:

	 - Merging Scott's v13-pre1 patch
	 - Fixing endptr related bug while using virStrToLong_ui() pointed out
	   by Jim Meyering
	 - Addressing Jim Meyering's comments to v11
	 - requiring mac address to the vpDisassociateProfileId() function to
	   pass it further to the 802.1Qbg disassociate part (802.1Qbh untouched)
	 - determining pid of lldpad daemon by reading it from /var/run/libvirt.pid
	   (hardcode as is hardcode alson in lldpad sources)
	 - merging netlink send code for kernel target and user space target
	   (lldpad) using one function nlComm() to send the messages
	 - adding a select() after the sending and before the reading of the
	   netlink response in case lldpad doesn't respond and so we don't hang
	 - when reading the port status, in case of 802.1Qbg, no status may be
	   received while things are 'in progress' and only at the end a status
	   will be there.
	 - when reading the port status, use the given instanceId and vf to pick
	   the right IFLA_VF_PORT among those nested under IFLA_VF_PORTS.
	 - never sending nor parsing IFLA_PORT_SELF type of messages in the
	   802.1Qbg case
	 - iterating over the elements in a IFLA_VF_PORTS to pick the right
	   IFLA_VF_PORT by either IFLA_PORT_PROFILE and given profileId
	   (802.1Qbh) or IFLA_PORT_INSTANCE_UUID and given instanceId (802.1Qbg)
	   and reading the current status in IFLA_PORT_RESPONSE.
	 - recycling a previous patch that adds functionality to interface.c to
	   - get the vlan identifier on an interface
	   - get the flags of an interface and some convenience function to
	     check whether an interface is 'up' or not (not currently used here)
	 - adding function to determine the root physical interface of an
	   interface. For example if a macvtap is linked to eth0.100, it will
	   find eth0. Also adding a function that finds the vlan on the 'way to
	   the root physical interface'
	 - conveying the root physical interface name and index in case of 802.1Qbg
	 - conveying mac address of macvlan device and vlan identifier in
	   IFLA_VFINFO_LIST[ IFLA_VF_INFO[ IFLA_VF_MAC(mac), IFLA_VF_VLAN(vlan) ] ]
	   to (future) lldpad via netlink
	  - To enable build with --without-macvtap rename the
	    [dis|]associatePortProfileId functions, prepend 'vp' before their
	    name and make them non-static functions.
	  - Renaming variable multicast to nltarget_kernel and inverting
	    the logic
	  - Addressing Jim Meyering's comments; this also touches existing
	    code for example for correcting indentation of break statements or
	    simplification of switch statements.
	  - Renamed occurrencvirVirtualPortProfileDef to virVirtualPortProfileParamses
	  - 802.1Qbg part prepared for sending a RTM_SETLINK and getting
	    processing status back plus a subsequent RTM_GETLINK to
	    get IFLA_PORT_RESPONSE.
	    Note: This interface for 802.1Qbg may still change
	  - [David Allan] move getPhysfn inside IFLA_VF_PORT_MAX to avoid
	compiler
	    warning when latest if_link.h isn't available
	  - move from Stefan's 802.1Qb{g|h} XML v8 to v9
	  - move hostuuid and vf index calcs to inside doPortProfileOp8021Qbh
	  - remove debug fprintfs
	  - use virGetHostUUID (thanks Stefan!)
	  - fix compile issue when latest if_link.h isn't available
	  - change poll timeout to 10s, at 1/8 intervals
	     - if polling times out, log msg and return -ETIMEDOUT
	  - Add Stefan's code for getPortProfileStatus
	  - Poll for up to 2 secs for port-profile status, at 1/8 sec intervals:
	     - if status indicates error, abort openMacvtapTap
	     - if status indicates success, exit polling
	     - if status is "in-progress" after 2 secs of polling, exit
	       polling loop silently, without error

	My patch finishes out the 802.1Qbh parts, which Stefan had mostly complete.
	I've tested using the recent kernel updates for VF_PORT netlink msgs and
	enic for Cisco's 10G Ethernet NIC.  I tested many VMs, each with several
	direct interfaces, each configured with a port-profile per the XML.  VM-to-VM,
	and VM-to-external work as expected.  VM-to-VM on same host (using same NIC)
	works same as VM-to-VM where VMs are on diff hosts.  I'm able to change
	settings on the port-profile while the VM is running to change the virtual
	port behaviour.  For example, adjusting a QoS setting like rate limit.  All
	VMs with interfaces using that port-profile immediatly see the effect of the
	change to the port-profile.

	I don't have a SR-IOV device to test so source dev is a non-SR-IOV device,
	but most of the code paths include support for specifing the source dev and
	VF index.  We'll need to complete this by discovering the PF given the VF
	linkdev.  Once we have the PF, we'll also have the VF index.  All this info-
	mation is available from sysfs.

2010-06-02  Eric Blake  <eblake@redhat.com>

	bitmap: reject zero-size bitmap
	* src/util/bitmap.c (virBitmapAlloc): Tighten sanity check.

2010-06-02  Cole Robinson  <crobinso@redhat.com>

	hostusb: Properly handle 'usbX' sysfs files
	Fedora bug https://bugzilla.redhat.com/show_bug.cgi?id=598272

	Some files under /sys/bus/usb/devices/ have the format 'usbX', where
	X is the USB bus number. Use STRPREFIX to correctly parse the bus numbers.

2010-06-02  Justin Clift  <justin@salasaga.org>

	Add --source-format argument to virsh pool-define-as and pool-create-as
	This is the corresponding patch for the virsh man page (virsh.pod).

2010-06-02  Justin Clift  <justin@salasaga.org>

	Add --source-format argument to virsh pool-define-as and pool-create-as
	When creating pools from dedicated disks, the existing pool-define-as
	and pool-create-as commands are a bit non-optimal.

	Ideally, a person would be able to specify all of the required options
	directly on the command line instead of having to edit the XML.

	At the moment, there is no way to specify the format type (ie gpt) so it
	gets included in the XML the pool is constructed with.

	Please find attached a simple (tested) patch to add an optional
	"--source-format 'type'" to virsh.  This is patched against current git
	master and will apply cleanly.

	Also created a Red Hat BZ ticket for this (#597790) for tracking.

2010-06-02  Justin Clift  <justin@salasaga.org>

	Trivial virsh.pod additions --all for "list" command and similar
	This is just a trivial patch to virsh.pod (from git master). It adds the
	following pieces to the virsh man page:

	  + Shows the --inactive and --all optional parameters for the list
	    command.

	    Closes Bugzilla #575512, reported by Renich Bon Ciric
	    https://bugzilla.redhat.com/show_bug.cgi?id=575512

	  + Corrects the existing description of the list command, to now say
	    that only running domains are listed if no domains are specified.

	    The man page up until this point has said all domains are listed if
	    no domains are specified, which is incorrect.

	  + Adds the "shut off" state to the list of states for the list
	    command.

	  + Adds a missing =back around line 755, that pod2man was complaining
	    was missing.

2010-06-02  Eric Blake  <eblake@redhat.com>

	build: fix VPATH 'make syntax-check'
	* cfg.mk (sc_check_author_list): Look in correct location.

2010-06-02  Eric Blake  <eblake@redhat.com>

	build: depend on correct file
	Otherwise, VPATH builds fail with:

	make[1]: *** No rule to make target `libvirt-guests.init', needed by `all'.

	Regression introduced in commit 482e08a9.

	* daemon/Makefile.am (%.init): Look in correct place for
	config.status.

2010-06-02  Cole Robinson  <crobinso@redhat.com>

	qemu: Add a qemu.conf option for clearing capabilities
	Currently there is no way to opt out of libvirt dropping POSIX
	capabilities for qemu. This at least is a useful debugging tool, but
	is also wanted by users (and distributors):

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

	v2: Clarify qemu.conf comment, warn about security implications

	v3: Add .aug changes

2010-05-29  Jim Meyering  <meyering@redhat.com>

	build: make cpp indentation conform
	* src/storage/storage_backend.h (VIR_STORAGE_VOL_OPEN_DEFAULT):
	Adjust s/#define/# define/, and align continued lines.

2010-05-29  Cole Robinson  <crobinso@redhat.com>

	storage: Check for invalid storage mode before opening
	If a directory pool contains pipes or sockets, a pool start can fail or hang:

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

	We already try to avoid these special files, but only attempt after
	opening the path, which is where the problems lie. Unify volume opening
	into helper functions, which use the proper open() flags to avoid error,
	followed by fstat to validate storage mode.

	Previously, virStorageBackendUpdateVolTargetInfoFD attempted to enforce the
	storage mode check, but allowed callers to detect this case and silently
	continue. In practice, only the FS backend was using this feature, the rest
	were treating unknown mode as an error condition. Unfortunately the InfoFD
	function wasn't raising an error message here, so error reporting was
	busted.

	This patch adds 2 functions: virStorageBackendVolOpen, and
	virStorageBackendVolOpenModeSkip. The latter retains the original opt out
	semantics, the former now throws an explicit error.

	This patch maintains the previous volume mode checks: allowing specific
	modes for specific pool types requires a bit of surgery, since VolOpen
	is called through several different helper functions.

	v2: Use ATTRIBUTE_NONNULL. Drop stat check, just open with
	    O_NONBLOCK|O_NOCTTY.

	v3: Move mode check logic back to VolOpen. Use 2 VolOpen functions with
	    different error semantics.

	v4: Make second VolOpen function more extensible. Didn't opt to change
	    FS backend defaults, this can just be to fix the original bug.

	v5: Prefix default flags with VIR_, use ATTRIBUTE_RETURN_CHECK

2010-05-29  Stefan Berger  <stefanb@us.ibm.com>

	macvtap: cannot support target device name
	Since the macvtap device needs active tear-down and the teardown logic
	is based on the interface name, it can happen that if for example 1 out
	of 3 interfaces was successfully created, that during the failure path
	the macvtap's target device name is used to tear down an interface that
	is doesn't own (owned by another VM).

	So, in this patch, the target interface name is reset so that there is
	no target interface name and the interface name is always cleared after
	a tear down.

2010-05-29  David Allan  <dallan@redhat.com>

	Improve nodedev parent/child relationships
	* If a nodedev has a parent that we don't want to display, we should
	  continue walking up the udev device tree to see if any of its
	  earlier ancestors are devices that we display.  It makes the tree
	  much nicer looking than having a whole lot of devices hanging off
	  the root node.

2010-05-29  Jiri Denemark  <jdenemar@redhat.com>

	Fix libvirt-guests init script
	Firstly, the init script has to touch its file under /var/lock/subsys
	when started, otherwise the system would think it's not running and
	won't stop it during shutdown.

	Secondly, for some reason there is a policy to automatically enable
	init scripts when they are installed, so let the specfile do this. We
	also need to start the init script to ensure it will be stopped during
	the first shutdown after installing the package.

	Also $LISTFILE should be enclosed by quotes everywhere as suggested by
	Eric.

2010-05-28  Jim Meyering  <meyering@redhat.com>

	maint: new syntax-check rule to ensure that AUTHORS stays in sync
	* cfg.mk (sc_check_AUTHOR_list): New rule.
	* .mailmap: New file, to tell git log how to map email addresses.

2010-05-28  Paolo Smiraglia  <paolo.smiraglia@gmail.com>

	hooks: fix typo
	* src/util/hooks.c (virHookLxcOp): Use correct bound.

2010-05-28  Eric Blake  <eblake@redhat.com>

	build: silence cppi warning, clarify vbox headers
	These files are borrowed from upstream release versions, and should
	not need further edits in the context of libvirt (instead, a new
	upstream vbox release would entail adding a new header file).  We do
	not re-generate these files as part of libvirt, nor do we want to lose
	our minor edits (such as cppi cleanups).

	* src/vbox/vbox_CAPI_v2_2.h: Clarify file origins.
	* src/vbox/vbox_CAPI_v3_0.h: Likewise.
	* src/vbox/vbox_CAPI_v3_1.h: Likewise.
	* src/vbox/vbox_CAPI_v3_2.h: Likewise.  Reindent with cppi.

2010-05-28  Cole Robinson  <crobinso@redhat.com>

	network: bridge: Don't start network if it collides with host routing
	Fedora bug https://bugzilla.redhat.com/show_bug.cgi?id=235961

	If using the default virtual network, an easy way to lose guest network
	connectivity is to install libvirt inside the VM. The autostarted
	default network inside the guest collides with host virtual network
	routing. This is a long standing issue that has caused users quite a
	bit of pain and confusion.

	On network startup, parse /proc/net/route and compare the requested
	IP+netmask against host routing destinations: if any matches are found,
	refuse to start the network.

	v2: Drop sscanf, fix a comment typo, comment that function could use
	    libnl instead of /proc

	v3: Consider route netmask. Compare binary data rather than convert to
	    string.

	v4: Return to using sscanf, drop inet functions in favor of virSocket,
	    parsing safety checks. Don't make parse failures fatal, in case
	    expected format changes.

	v5: Try and continue if we receive unexpected. Delimit parsed lines to
	    prevent scanning past newline

2010-05-28  Eric Blake  <eblake@redhat.com>

	maint: update AUTHORS with recent contributors
	git shortlog $(git log -1 --format=%H AUTHORS).. | grep -v "^ "

	then add missing entries to AUTHORS.

	* AUTHORS: Update.

2010-05-28  Cole Robinson  <crobinso@redhat.com>

	xen: Fix chardev listen sexpr formatting
	'listen' isn't a valid qemu-dm option, as reported a long time ago here:

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

	Matches the near identical logic in qemu_conf.c

	v2: When parsing sexpr, only match on ",server", rather than
	    full ',server,nowait'.

2010-05-28  Cole Robinson  <crobinso@redhat.com>

	xen: Remove unused function

2010-05-28  David Allan  <dallan@redhat.com>

	v2 of Cole's wlan support
	* Incorporated Jim's feedback (v1 & v2)

	* Moved case of DEVTYPE == "wlan" up as it's definitive that we have a network interface.

	* Made comment more detailed about the wired case to explain better
	  how it differentiates between wired network interfaces and USB
	  devices.

2010-05-27  Марк Коренберг  <socketpair gmail com>

	Add docs on drive <serial> element
	* docs/formatdomain.html.in: Document <serial> element within
	  <disk> and fix typo on <driver/> element

2010-05-27  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Simplify goto usage
	Eliminate almost all backward jumps by replacing this common pattern:

	int
	some_random_function(void)
	{
	    int result = 0;
	    ...

	  cleanup:
	    <unconditional cleanup code>
	    return result;

	  failure:
	    <cleanup code in case of an error>
	    result = -1;
	    goto cleanup
	}

	with this simpler pattern:

	int
	some_random_function(void)
	{
	    int result = -1;
	    ...
	    result = 0;

	  cleanup:
	    if (result < 0) {
	        <cleanup code in case of an error>
	    }

	    <unconditional cleanup code>
	    return result;
	}

	Add a bool success variable in functions that don't have a int result
	that can be used for the new pattern.

	Also remove some unnecessary memsets in error paths.

2010-05-27  Jean-Baptiste Rouault  <jean-baptiste.rouault@diateam.net>

	Support for VirtualBox version 3.2

2010-05-27  Matthias Bolte  <matthias.bolte@googlemail.com>

	Use printf instead of echo -e in libvirt.spec.in
	make rpm created dummy tests containing '-e #!/bin/sh' for me.

	Install, distribute and package domainsnapshot.rng

2010-05-27  Eric Blake  <eblake@redhat.com>

	build: support 'make check' in pristine tree
	Otherwise, 'make check' in the python dir tries to reference a file in
	docs that is built by 'make' but not by 'make check'.

	* docs/Makefile.am (check-local): New rule.
	Reported by Matthias Bolte.

2010-05-27  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Expose host UUID in the capabilities XML
	Parse the BIOS UUID. This information may not be available, in that
	case no host UUID is exposed in the capabilities XML.

2010-05-27  Daniel P. Berrange  <berrange@redhat.com>

	Fix integer overflow in hotplug methods
	The hotplug methods still had the qemuCmdFlags variable declared
	as an int, instead of unsigned long long. This caused flag checks
	to be incorrect for flags > 31

	* src/qemu/qemu_driver.c: Fix integer overflow in hotplug

2010-05-27  Alex Williamson  <alex.williamson@redhat.com>

	Pass pre-opened PCI device sysfs config file to QEMU
	This allows libvirt to open the PCI device sysfs config file prior
	to dropping privileges so qemu can access the full config space.
	Without this, a de-privileged qemu can only access the first 64
	bytes of config space.

	* src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Detect support
	  for pci-assign.configfd option. Use this option when formatting
	  PCI device string if possible
	* src/qemu/qemu_driver.c: Pre-open PCI sysfs config file and pass
	  to QEMU

2010-05-26  Cole Robinson  <crobinso@redhat.com>

	daemon: sysconf: Update comment about VNC audio

2010-05-26  Chris Lalancette  <clalance@redhat.com>

	Fix failing virGetHostname.
	We've been running into a lot of situations where
	virGetHostname() is returning "localhost", where a plain
	gethostname() would have returned the correct thing.  This
	is because virGetHostname() is *always* trying to canonicalize
	the name returned from gethostname(), even when it doesn't
	have to.

	This patch changes virGetHostname so that if the value returned
	from gethostname() is already FQDN or localhost, it returns
	that string directly.  If the value returned from gethostname()
	is a shortened hostname, then we try to canonicalize it.  If
	that succeeds, we returned the canonicalized hostname.  If
	that fails, and/or returns "localhost", then we just return
	the original string we got from gethostname() and hope for
	the best.

	Note that after this patch it is up to clients to check whether
	"localhost" is an allowed return value.  The only place
	where it's currently not is in qemu migration.

2010-05-26  Matthias Bolte  <matthias.bolte@googlemail.com>

	xen-proxy build broken
	The virVirtualPortProfileFormat just went below the
	virVirtualPortProfileParamsParseXML function and got inside the

	The attached patch moves virVirtualPortProfileFormat below the #ifndef
	PROXY block.

2010-05-26  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Add read-only storage pool access
	Allows listing existing pools and requesting information about them.

	Alter the esxVI_ProductVersion enum in a way that allows to check for
	product type by masking.

2010-05-26  Eric Blake  <eblake@redhat.com>

	build: fix HTML errors in nwfilter docs
	A build on Ubuntu reported:

	|| Generating formatnwfilter.html.tmp
	/dados/develop/libvirt/docs/formatnwfilter.html.in|390| HTML parser error : Unexpected end tag : p
	||     </p>
	||         ^
	/dados/develop/libvirt/docs/formatnwfilter.html.in|705| HTML parser error : Unexpected end tag : code
	||          <td>End of range of valid source ports</code></td>
	||                                                       ^
	/dados/develop/libvirt/docs/formatnwfilter.html.in|710| HTML parser error : Unexpected end tag : code
	||          <td>Start of range of valid destination ports</code></td>
	||                                                              ^

	* docs/formatnwfilter.html.in: Fix invalid HTML constructs.
	Reported by Eduardo Otubo.

2010-05-26  Eric Blake  <eblake@redhat.com>

	build: fix compilation without macvtap
	* src/util/macvtap.c: (associatePortProfileId)
	(disassociatePortProfileId): Move inside HAVE_MACVTAP
	conditional.
	Reported by Eduardo Otubo.

2010-05-26  Jim Meyering  <jim@meyering.net>

	tests: avoid new failure of the daemon-conf test
	* tests/daemon-conf: Accommodate the fact that out template,
	daemon/libvirtd.conf now contains an invalid host_uuid.
	Convert it to a valid one before the final libvirtd-running
	test that must terminate normally.

	libvirtd: diagnose invalid host UUID
	* daemon/libvirtd.c (remoteReadConfigFile): Diagnose an invalid
	host UUID rather than silently exiting with status 7.

2010-05-26  Stefan Berger  <stefanb@us.ibm.com>

	vepa: parsing for 802.1Qb{g|h} XML
	This patch parses the following two XML descriptions, one for
	802.1Qbg and one for 802.1Qbh, and stores the data internally.
	The actual triggering of the switch setup protocol has not been
	implemented here but the relevant code to do that should go into
	the functions associatePortProfileId() and disassociatePortProfileId().

	   <interface type='direct'>
	      <source dev='eth0.100' mode='vepa'/>
	      <model type='virtio'/>
	      <virtualport type='802.1Qbg'>
	        <parameters managerid='12' typeid='0x123456' typeidversion='1'
	         instanceid='fa9b7fff-b0a0-4893-8e0e-beef4ff18f8f'/>
	      </virtualport>
	      <filterref filter='clean-traffic'/>
	    </interface>

	    <interface type='direct'>
	      <source dev='eth0.100' mode='vepa'/>
	      <model type='virtio'/>
	      <virtualport type='802.1Qbh'>
	        <parameters profileid='my_profile'/>
	      </virtualport>
	    </interface>

	I'd suggest to use this patch as a base for triggering the setup
	protocol with the 802.1Qb{g|h} switch.

	Several rounds of changes were made to this patch. The
	following is a list of these changes.
	- Renamed structure virVirtualPortProfileDef to virVirtualPortProfileParams
	  as per Daniel Berrange's request
	- Addressing Daniel Berrange's comments:
	 - removing macvtap.h's dependency on domain_conf.h by
	   moving the virVirtualPortProfileDef structure into macvtap.h
	   and not passing virtDomainNetDefPtr to any functions in
	   macvtap.c
	- Addressed most of Chris Wright's comments:
	  - indicating error in case virtualport XML node cannot be parsed
	    properly
	  - parsing hex and decimal numbers using virStrToLong_ui() with
	    parameter '0' for base
	  - tgifname (target interface name) variable wasn't necessary
	    to pass to openMacvtapTap function anymore
	- assigning the virtual port data structure to the virDomainNetDef
	  only if it was previously parsed
	- make sure that the error code returned by openMacvtapTap() is a negative n
	  in case the associatePortProfileId() function failed.
	- renaming vsi in the XML to virtualport
	- replace all occurrences of vsi in the source as well
	- removing mode and MAC address parameters from the functions that
	  will communicate with the hareware diretctly or indirectly
	- moving the associate and disassociate functions to the end of the
	  file for subsequent patches to easier make them generally available
	  for export
	- passing the macvtap interface name rather than the link device since
	  this otherwise gives funny side effects when using netlink messages
	  where IFLA_IFNAME and IFLA_ADDRESS are specified and the link dev
	  all of a sudden gets the MAC address of the macvtap interface.
	- Removing rc = -1 error indications in the case of 802.1Qbg|h setup in case
	  we wanted to use hook scripts for the setup and so the setup doesn't fail
	  here.
	- if instance ID UUID is not supplied it will automatically be generated
	  - adapted schema to make instance ID UUID optional
	  - added test case
	- parser and XML generator have been separated into their own
	  functions so they can be re-used elsewhere (passthrough case
	  for example)
	- Adapted XML parser and generator support the above shown type
	  (802.1Qbg, 802.1Qbh).
	- Adapted schema to above XML
	- Adapted test XML to above XML
	- Passing through the VM's UUID which seems to be necessary for
	  802.1Qbh -- sorry no host UUID
	- adding virtual function ID to association function, in case it's
	  necessary to use (for SR-IOV)

2010-05-26  Stefan Berger  <stefanb@us.ibm.com>

	vepa+vsi: Introduce dependency on libnl
	This patch introduces a dependency on libnl, which subsequent patches
	will then use.

	Changes from V1 to V2:
	- added diffstats
	- following changes in tree

2010-05-26  Cole Robinson  <crobinso@redhat.com>

	storage: Sanitize pool target paths
	Spurious / in a pool target path makes life difficult for apps using the
	GetVolByPath, and doing other path based comparisons with pools. This
	has caused a few issues for virt-manager users:

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

	Add a new util API which removes spurious /, virFileSanitizePath. Sanitize
	target paths when parsing pool XML, and for paths passed to GetVolByPath.

	v2: Leading // must be preserved, properly sanitize path=/, sanitize
	    away /./ -> /

	v3: Properly handle starting ./ and ending /.

	v4: Drop all '.' handling, just sanitize / for now.

2010-05-26  Daniel P. Berrange  <berrange@redhat.com>

	Expose a host UUID in the capabilities XML
	Allow for a host UUID in the capabilities XML. Local drivers
	will initialize this from the SMBIOS data. If a sanity check
	shows SMBIOS uuid is invalid, allow an override from the
	libvirtd.conf configuration file

	* daemon/libvirtd.c, daemon/libvirtd.conf: Support a host_uuid
	  configuration option
	* docs/schemas/capability.rng: Add optional host uuid field
	* src/conf/capabilities.c, src/conf/capabilities.h: Include
	  host UUID in XML
	* src/libvirt_private.syms: Export new uuid.h functions
	* src/lxc/lxc_conf.c, src/qemu/qemu_driver.c,
	  src/uml/uml_conf.c: Set host UUID in capabilities
	* src/util/uuid.c, src/util/uuid.h: Support for host UUIDs
	* src/node_device/node_device_udev.c: Use the host UUID functions
	* tests/confdata/libvirtd.conf, tests/confdata/libvirtd.out: Add
	  new host_uuid config option to test

2010-05-25  Daniel P. Berrange  <berrange@redhat.com>

	Fix handling of disk backing stores with cgroups
	The cgroups ACL code was only allowing the primary disk image.
	It is possible to chain images together, so we need to search
	for backing stores and add them to the ACL too. Since the ACL
	only handles block devices, we ignore the EINVAL we get from
	plain files. In addition it was missing code to teardown the
	cgroup when hot-unplugging a disk

	* src/qemu/qemu_driver.c: Allow backing stores in cgroup ACLs
	  and add missing teardown code in unplug path

2010-05-25  Chris Lalancette  <clalance@redhat.com>

	Fix up basic migration.
	Basic live migration was broken by the commit that added
	non-shared block support in two ways:

	1)  It added a virCheckFlags() to doNativeMigrate().  Besides
	the fact that typical usage of virCheckFlags() is in driver
	entry points, and doNativeMigrate() is not an entry point,
	it was missing important flags like VIR_MIGRATE_LIVE.  Move
	the virCheckFlags to the top-level qemuDomainMigratePrepare2
	and friends.

	2)  It also added a memory leak in qemuMonitorTextMigrate()
	by not freeing the memory used by virBufferContentAndReset().
	This is fixed by storing the pointer in a temporary variable
	and freeing it at the end.

	With this patch in place, normal live migration works again.

	v3: Instead of the churn for virCheckFlagsUI and UL, instead
	always promote flags to an unsigned long and always use %lx
	for the fprintf.
	v2: Add back flags check, which required adding virCheckFlagsUI
	and virCheckFlagsUL

2010-05-25  Cole Robinson  <crobinso@redhat.com>

	qemu: Allow using regular audio backends with VNC
	Currently all host audio backends are disabled if a VM is using VNC, in
	favor of the QEMU VNC audio extension. Unfortunately no released VNC
	client supports this extension, so users have no way of getting audio
	to work if using VNC.

	Add a new config option in qemu.conf which allows changing libvirt's
	behavior, but keep the default intact.

	v2: Fix doc typos, change name to vnc_allow_host_audio

2010-05-25  Cole Robinson  <crobinso@redhat.com>

	storage: mpath: Fix incorrect VIR_ERROR use

2010-05-25  Chris Lalancette  <clalance@redhat.com>

	Allow nwfilter functions to be compiled with C++
	Unfortunately the NWFilter functions were outside of the
	"extern C { ... }" declaration in include/libvirt/libvirt.h.in,
	which means that they couldn't be properly used with C++.  Move
	them inside of the braces, which should fix the problem.

2010-05-25  Stefan Berger  <stefanb@us.ibm.com>

	nwfilter: documentation
	This patch adds documentation of the nwfilter subsystem of libvirt to
	the existing (web) docs.

2010-05-25  Eric Blake  <eblake@redhat.com>

	maint: update AUTHORS with recent contributors
	git shortlog $(git log -1 --format=%H AUTHORS).. | grep -v "^ "

	then add missing entries to AUTHORS.

	* AUTHORS: Update.

2010-05-25  Alex Williamson  <alex.williamson@redhat.com>

	qemu: Release bus address on PCI host device remove

	qemu: avoid corrupting guest info struct on host device PCI hot add
	The device path doesn't make use of guestAddr, so the memcpy corrupts
	the guest info struct.

2010-05-25  Daniel P. Berrange  <berrange@redhat.com>

	Query block allocation extent from QEMU monitor
	The virDomainGetBlockInfo API allows query physical block
	extent and allocated block extent. These are normally the
	same value unless storing a special format like qcow2
	inside a block device. In this scenario we can query QEMU
	to get the actual allocated extent.

	Since last time:

	 - Return fatal error in text monitor
	 - Only invoke monitor command for block devices
	 - Fix error handling JSON code

	* src/qemu/qemu_driver.c: Fill in block aloction extent when VM
	  is running
	* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
	  src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h,
	  src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h: Add
	  API to query the highest block extent via info blockstats

2010-05-25  Jim Meyering  <jim@meyering.net>

	lxcSetSchedulerParameters: reverse order of tests; diagnose a failure
	* src/lxc/lxc_driver.c (lxcSetSchedulerParameters): Ensure that
	"->field" is "cpu_shares" before possibly giving a diagnostic about
	a type for a "cpu_shares" value.
	Also, virCgroupSetCpuShares could fail without evoking a diagnostic.
	Add one.

2010-05-25  Chris Lalancette  <clalance@redhat.com>

	Don't overwrite virDomainAssignDef errors.

2010-05-24  Cole Robinson  <crobinso@redhat.com>

	storage: Combine some duplicate code
	Volume detection in the scsi backend was duplicating code already
	present in storage_backend.c. Let's drop the duplicate code.

	Also, change the shared function name to be less generic, and remove
	some error squashing in the other call site.

2010-05-24  Cole Robinson  <crobinso@redhat.com>

	storage: mpath: Clean up some error handling
	We were squashing error messages in a few cases. Recode to follow common
	ret = -1 convention.

	v2: Handle more error squashing issues further up in MakeNewVol and
	    CreateVols. Use ret = -1 convention in MakeVols.

2010-05-24  Jiri Denemark  <jdenemar@redhat.com>

	Remove dead code after refactoring qemudDomainStart
	The event is already generated and sent by qemudDomainObjStart, no need
	to do anything about here.

2010-05-23  Jim Meyering  <meyering@redhat.com>

	libvirtd: start each diagnostic with "argv0: "
	Some diagnostics had a hard-coded "libvirtd: " prefix, some used
	"error: " and some used "argv[0]: ".  Always use "argv[0]: ".
	* daemon/libvirtd.c (argv0): New global.
	(main): Set it.
	(version, usage): Remove argv0 parameter.  Use global; update callers.
	(daemonForkIntoBackground): Use argv0:, not error:.
	(qemudWritePidFile): Start each diagnostic with argv0:.
	Suggested by Eric Blake.

2010-05-23  Jim Meyering  <meyering@redhat.com>

	libvirtd: mark strings for translation, including --help output
	* daemon/libvirtd.c (daemonForkIntoBackground, main): Mark strings
	for translation.
	(usage): Rework --help so that it is translatable, replacing
	each embedded, configuration-dependent, macro with an `%s'.

	libvirtd: don't ignore virInitialize failure
	* daemon/libvirtd.c (main): Diagnose virInitialize failure
	and exit nonzero.

2010-05-22  Eric Blake  <eblake@redhat.com>

	build: fix cppi warnings
	* src/util/bitmap.h (includes): Placate cppi.

2010-05-22  Eric Blake  <eblake@redhat.com>

	build: force init scripts to rebuild on changed --prefix
	Otherwise, './configure --prefix=/foo && make &&
	 ./configure --prefix=/bar && make' leaves the wrong files
	in libvirtd.init (/foo instead of /bar).

	* daemon/Makefile.am (libvirtd.init): Add dependency on
	config.status.  Reported by Cole Robinson.

2010-05-22  Matthias Bolte  <matthias.bolte@googlemail.com>

	build: Distribute the whole tests/qemuhelpdata directory
	Instead of distributing the individual files.

	Now it's less error prone and consistent with the rest of
	the data directories in the tests directory.

2010-05-22  Cole Robinson  <crobinso@redhat.com>

	.gitignore: Add libvirt-guests.init

2010-05-22  Jim Fehlig  <jfehlig@novell.com>

	Fix race in finding available vnc port
	The qemu driver contains a subtle race in the logic to find next
	available vnc port.  Currently it iterates through all available ports
	and returns the first for which bind(2) succeeds.  However it is possible
	that a previously issued port has not yet been bound by qemu, resulting
	in the same port used for a subsequent domain.

	This patch addresses the race by using a simple bitmap to "reserve" the
	ports allocated by libvirt.

	V2:
	  - Put port bitmap in struct qemud_driver
	  - Initialize bitmap in qemudStartup

	V3:
	  - Check for failure of virBitmapGetBit
	  - Additional check for port != -1 before calling virbitmapClearBit

	V4:
	  - Check for failure of virBitmap{Set,Clear}Bit

2010-05-22  Jim Fehlig  <jfehlig@novell.com>

	Add defines for QEMU_VNC_PORT_{MIN,MAX} and use them

2010-05-22  Jim Fehlig  <jfehlig@novell.com>

	Add simple bitmap operations to utils
	V2:
	  - Move bitmap impl to src/util/bitmap.[ch]
	  - Use CHAR_BIT instead of explicit '8'
	  - Use size_t instead of unsigned int
	  - Fix calculation of bitmap size in virBitmapAlloc
	  - Ensure bit is within range of map in the set, clear, and get
	    operations
	  - Use bool in virBitmapGetBit
	  - Add virBitmapFree to free-like funcs in cfg.mk

	V3:
	  - Check for overflow in virBitmapAlloc
	  - Fix copy and paste bug in virBitmapAlloc
	  - Use size_t in prototypes
	  - Add ATTRIBUTE_NONNULL in prototypes where appropriate
	    and remove NULL check from impl

	V4:
	  - Add ATTRIBUTE_RETURN_CHECK in prototypes where appropriate.

2010-05-22  Cole Robinson  <crobinso@redhat.com>

	daemon: Export SDL audio environment variables
	/etc/sysconfig/libvirtd has a few environment variables for configuring
	libvirt SDL audio. The libvirtd process doesn't see these, however, because
	they are never exported. Let's export the variables after sourcing the
	sysconfig script.

	There is another problem here that the commented out values in the
	sysconfig script are not neccessarily the actual defaults, we are qemus
	mercy here. Not sure how to solve that.

2010-05-21  Chris Lalancette  <clalance@redhat.com>

	Remove isValidIfname.
	We shouldn't be checking validity in domain_conf, since
	it can be used by multiple different hosts and hypervisors.
	Remove the check completely.

2010-05-21  Jiri Denemark  <jdenemar@redhat.com>

	Init script for handling guests on shutdown/boot
	Example output during shutdown:

	Running guests on default URI: console, rhel6-1, rhel5-64
	Running guests on lxc:/// URI: lxc-shell
	Running guests on xen:/// URI: error: no hypervisor driver available for xen:///
	error: failed to connect to the hypervisor
	Running guests on vbox+tcp://orkuz/system URI: no running guests.
	Suspending guests on default URI...
	Suspending console: done
	Suspending rhel6-1: done
	Suspending rhel5-64: done
	Suspending guests on lxc:/// URI...
	Suspending lxc-shell: error: Failed to save domain 9cba8bfb-56f4-6589-2d12-8a58c886dd3b state
	error: this function is not supported by the hypervisor: virDomainManagedSave

	Note, the "Suspending $guest: " shows progress during the suspend phase
	if domjobinfo gives meaningful output.

	Example output during boot:

	Resuming guests on default URI...
	Resuming guest rhel6-1: done
	Resuming guest rhel5-64: done
	Resuming guest console: done
	Resuming guests on lxc:/// URI...
	Resuming guest lxc-shell: already active

	Configuration used for generating the examples above:
	URIS='default lxc:/// xen:/// vbox+tcp://orkuz/system'

	The script uses /var/lib/libvirt/libvirt-guests files to note all active
	guest it should try to resume on next boot. It's content looks like:

	default 7f8b9d93-30e1-f0b9-47a7-cb408482654b 085b4c95-5da2-e8e1-712f-6ea6a4156af2 fb4d8360-5305-df3a-2da1-07d682891b8c
	lxc:/// 9cba8bfb-56f4-6589-2d12-8a58c886dd3b

2010-05-21  Jiri Denemark  <jdenemar@redhat.com>

	Autostart domains using virDomainObjStart

	Refactor qemudDomainStart
	We need a common internal function for starting managed domains to be
	used during autostart. This patch factors out relevant code from
	qemudDomainStart into qemudDomainObjStart and makes it use the
	refactored code for domain restore instead of calling qemudDomainRestore
	API directly.

	Factor out def assignment to existing domain from virDomainAssignDef
	We need to be able to assign new def to an existing virDomainObj which
	is already locked. This patch factors out the relevant code from
	virDomainAssignDef into virDomainObjAssignDef.

	Refactor qemudDomainRestore
	We need to be able to restore a domain which we already locked and
	started a job for it without undoing these steps. This patch factors
	out internals of qemudDomainRestore into separate functions which work
	for locked objects.

2010-05-21  Jim Meyering  <meyering@redhat.com>

	maint: update po/POTFILES.in
	* po/POTFILES.in: Add 3 files.

	maint: enforce policy wrt VIR_DEBUG and VIR_DEBUG0
	* cfg.mk (sc_prohibit_gettext_markup): Just like VIR_WARN*.

	maint: don't mark VIR_DEBUG or VIR_DEBUG0 diagnostics for translation
	Run this command:
	  git grep -l VIR_DEBUG|xargs perl -pi -e \
	    's/(VIR_DEBUG0?)\s*\(_\((".*?")\)/$1($2/'

	maint: enforce policy wrt VIR_ERROR and VIR_ERROR0
	* cfg.mk (msg_gen_function): Add VIR_ERROR and VIR_ERROR0,
	so that sc_libvirt_unmarked_diagnostics will check them, too.

	maint: change "" in err ? err->message : "" to _("unknown error"), ...
	These changes avoid false-positive syntax-check failure,
	and also make the resulting diagnostics more comprehensible.

	maint: more of same, but manual: convert VIR_ERROR("%s" to VIR_ERROR0(

	maint: VIR_ERROR/VIR_ERROR0: mark up the remaining ones manually
	Handle concatenated strings manually.

	maint: mark translatable string args of VIR_ERROR
	Run this:
	  git grep -l 'VIR_ERROR\s*("'|xargs perl -pi -e \
	    's/(VIR_ERROR)\s*\((".*?"),/$1(_($2),/'

	maint: mark translatable string args of VIR_ERROR0
	Run this:
	  git grep -l 'VIR_ERROR0\s*("'|xargs perl -pi -e \
	    's/(VIR_ERROR0)\s*\((".*?")\)/$1(_($2))/'

2010-05-21  Jim Meyering  <meyering@redhat.com>

	maint: use VIR_ERROR0 rather than VIR_ERROR with a bare "%s"
	Change VIR_ERROR("%s", "..."
	to     VIR_ERROR0("..."

	and

	Change VIR_ERROR("%s", _("...")
	to     VIR_ERROR0(_("...")

	Use this command:
	  git grep -E -l 'VIR_ERROR\("%s", (_\()?"'|xargs perl -pi -e \
	  's/VIR_ERROR\("%s", (_\()?"/VIR_ERROR0($1"/'

2010-05-21  Chris Wright  <chrisw@redhat.com>

	qemu driver: fix version check typos
	* src/qemu/qemu_conf.c (qemudParseHelpStr): Fix errors that made
	it impossible to diagnose invalid minor and micro version number
	components.

2010-05-21  Cole Robinson  <crobinso@redhat.com>

	daemon: A few initscript corrections
	Fedora bug https://bugzilla.redhat.com/show_bug.cgi?id=565238

	- Avahi service is called 'avahi-daemon'
	- chkconfig descriptions must use \ for line continuations

2010-05-21  Cole Robinson  <crobinso@redhat.com>

	qemu: Use ShutdownVMDaemon for all startup cleanup paths
	The current cleanup: in StartVMDaemon path is a poor duplication.
	qemuShutdownVMDaemon can handle teardown for inactive VMs, so let's use it.

	v2: Remove old abort: label, only use cleanup:

2010-05-21  Chris Lalancette  <clalance@redhat.com>

	Domain snapshot RNG and tests.

2010-05-21  Chris Lalancette  <clalance@redhat.com>

	Fix up the python bindings for snapshotting.
	This involved a few fixes.  To start with,
	an virDomainSnapshot object is really tied to a
	domain, not a connection, so we have to generate
	a slightly different object so that we can get
	at self._dom for the object.

	Next, we had to "dummy" up an override piece of
	XML with a bogus argument that the function doesn't
	actually take.  That's so that the generator places
	virDomainRevertToSnapshot underneath the correct
	class (namely, the virDomain class).

	Finally, we had to hand-implement the
	virDomainRevertToSnapshot implementation, ignoring the
	bogus pointer we are being passed.

	With all of this in place, I was able to successfully
	take a snapshot and revert to it using only the
	Python bindings.

2010-05-21  Jim Meyering  <meyering@redhat.com>

	qemu_conf.c: also recognize new first line of qemu -help output
	* src/qemu/qemu_conf.c (QEMU_VERSION_STR_1, QEMU_VERSION_STR_2):
	Define these instead of...
	(QEMU_VERSION_STR): ... this.  Remove definition.
	(qemudParseHelpStr): Check first for the new, shorter prefix,
	"QEMU emulator version", and then for the old one,
	"QEMU PC emulator version" when trying to parse the version number.
	Based on a patch by Chris Wright.

	lxc_controller.c: don't ignore failed "accept"
	* src/lxc/lxc_controller.c (ignorable_epoll_accept_errno): New function.
	(lxcControllerMain): Handle a failed accept carefully:
	most errno values indicate legitimate failure and must be fatal.
	However, ignore a special case: that in which an incoming client quits
	between the poll() indicating its presence, and our accept() which
	is trying to process it.

2010-05-20  Cole Robinson  <crobinso@redhat.com>

	qemu: Don't deny ShutdownVMDaemon for non-running VMs
	Clients that require this already seem to do so. Calling this function
	with pid < 1 also should not cause problems.

	qemu: Remove explicit VNC XML cleanup
	This only exists for a certain cleanup path in StartVMDaemon, but is
	unneeded since domain_conf.c handles this for us automatically.

	qemu: Properly cleanup in security startup error path
	Everything after hostdev setup needs to jump to cleanup on error.

2010-05-20  Jim Meyering  <meyering@redhat.com>

	libvirtd: don't ignore virInitialize failure
	* daemon/libvirtd.c (main): Diagnose virInitialize failure
	and exit nonzero.

2010-05-20  Alex Williamson  <alex.williamson@redhat.com>

	Rename qemuBuildCommandLine tapfds -> vmfds.
	There doesn't seem to be anything specific to tap devices for this
	array of file descriptors which need to stay open of the guest to use.
	Rename then for others to make use of.

2010-05-20  Jim Meyering  <meyering@redhat.com>

	maint: prohibit newline at end of diagnostic
	* cfg.mk (sc_prohibit_newline_at_end_of_diagnostic): New rule.
	Idea proposed by Jiri Denemark.

	maint: remove unwanted newline at end of diagnostic
	* src/xen/xend_internal.c (xenDaemonDomainDefineXML): Remove \n.
	* src/network/bridge_driver.c (networkAddMasqueradingIptablesRules):
	Likewise.

	qemudDomainMigrateFinish2: handle a case of virDomainSaveStatus failure
	* src/qemu/qemu_driver.c (qemudDomainMigrateFinish2): Don't ignore
	virDomainSaveStatus failure.
	* src/conf/domain_conf.h (virDomainSaveStatus): Use
	ATTRIBUTE_RETURN_CHECK, so this doesn't happen again.

2010-05-20  Eric Blake  <eblake@redhat.com>

	docs: distribute more coding convention documentation
	These files may be useful for anyone making modifications to
	source files in a tarball distribution.

	* src/Makefile.am (EXTRA_DIST): Add THREADS.txt.
	* daemon/Makefile.am (EXTRA_DIST): Add THREADING.txt.

2010-05-20  Eric Blake  <eblake@redhat.com>

	build: distribute missing file
	Commit f30ccb2458829 was incomplete.

	* .gitignore: Ignore intermediate directory during failed 'make
	distcheck'.
	* tests/Makefile.am (qemuhelpdata): Distribute new file.

2010-05-20  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Make esxVI_*_CastFromAnyType dynamically dispatched
	This will be used in the ESX storage driver in order to handle
	the DatastoreInfo type and inheriting types properly.

	esx: Allow esxVI_X_DynamicCast to be called successfully on X objects
	This semantic will be used in the ESX storage driver.

2010-05-20  Jim Meyering  <meyering@redhat.com>

	tests: the remote_protocol check also accommodates older pdwtags
	This test was failing on systems using pdwtags from dwarves-1.3.
	Reported by Matthias Bolte.
	Two-pronged fix:
	  - use --verbose to work also with dwarves-1.3; adapt regular
	    expressions to handle now-varying separators
	  - require a minimum number of post-split clauses, in order to
	    skip upon any future format change.
	    Currently there are 318; if there are 300 or fewer,
	    give a warning similar to when pdwtags is missing.
	* src/Makefile.am (remote_protocol-structs): Use pdwtags' --verbose
	option to make 1.3 emit member sizes and offsets.
	Consistently output WARNING messages to stderr.

2010-05-19  Jim Meyering  <meyering@redhat.com>

	initialize "meta" in virStorageFileGetMetadata, not in each caller
	Do not require each caller of virStorageFileGetMetadata and
	virStorageFileGetMetadataFromFD to first clear the storage of the
	"meta" buffer.  Instead, initialize that storage in
	virStorageFileGetMetadataFromFD.
	* src/util/storage_file.c (virStorageFileGetMetadataFromFD): Clear
	"meta" here, not before each of the following callers.
	* src/qemu/qemu_driver.c (qemuSetupDiskCgroup): Don't clear "meta" here.
	(qemuTeardownDiskCgroup): Likewise.
	* src/qemu/qemu_security_dac.c (qemuSecurityDACSetSecurityImageLabel):
	Likewise.
	* src/security/security_selinux.c (SELinuxSetSecurityImageLabel):
	Likewise.
	* src/security/virt-aa-helper.c (get_files): Likewise.

	(qemu*DiskCgroup): avoid dead code
	* src/qemu/qemu_driver.c (qemuTeardownDiskCgroup): Remove
	bogus empty-body while-loop.
	(qemuSetupDiskCgroup): Likewise.

	maint: more VIR_WARN corrections: now manually
	* po/POTFILES.in: Remove src/util/logging.c and src/util/uuid.c.
	* src/phyp/phyp_driver.c (phypUUIDTable_ReadFile): Correct more
	VIR_WARN uses, now manually.
	(phypUUIDTable_Init, phypUUIDTable_Pull): Likewise.

	maint: use VIR_WARN0("...") rather than VIR_WARN("%s", "...")
	Run this command:
	  git grep -l 'VIR_WARN("%s", "'|xargs perl -pi -e \
	    's/VIR_WARN\("%s", "/VIR_WARN0("/'
	* src/phyp/phyp_driver.c (phypDomainGetInfo): Perform the above.
	(phypDomainCreateAndStart, phypUUIDTable_ReadFile): Likewise.

	maint: enforce no-markup policy wrt VIR_WARN-like macros
	* cfg.mk (sc_prohibit_gettext_markup): New rule, to enforce
	this policy.  Contrary to most diagnostic-emitting functions,
	where we require _(...) markup, here, we require that _() *not*
	be used for certain functions (or function-like macros).

	maint: remove _(...) from VIR_WARN arg manually
	* src/util/uuid.c (virUUIDGenerate): Remove _(...) manually.

2010-05-19  Jim Meyering  <meyering@redhat.com>

	maint: don't mark VIR_WARN or VIR_WARN0 diagnostics for translation
	Approximately 60 messages were marked.  Since these diagnostics are
	intended solely for developers and maintainers, encouraging translation
	is deemed to be counterproductive:
	http://thread.gmane.org/gmane.comp.emulators.libvirt/25050/focus=25052

	Run this command:
	  git grep -l VIR_WARN|xargs perl -pi -e \
	    's/(VIR_WARN0?)\s*\(_\((".*?")\)/$1($2/'

2010-05-19  Jim Meyering  <meyering@redhat.com>

	note a typo: VIR_MIGRATE_TUNNELLED should be VIR_MIGRATE_TUNNELED,
	so that searches for properly spelled "TUNNELED" turn up
	the surprising spelling of this public symbol.
	* include/libvirt/libvirt.h.in: Add a comment.

2010-05-19  Jiri Denemark  <jdenemar@redhat.com>

	Add support for SSE4.1 and SSE4.2 CPU features

	Fix potential NULL dereference in remoteDomainMigratePrepare2

2010-05-19  Jim Meyering  <meyering@redhat.com>

	do not ignore qemuMonitorAddDrive failure; make uses identical
	There were three very similar uses of qemuMonitorAddDrive.
	This change makes the three 17-line sequences identical.
	* src/qemu/qemu_driver.c (qemudDomainAttachPciDiskDevice): Detect
	failure.  Add VIR_WARN and braces.
	(qemudDomainAttachSCSIDisk): Add VIR_WARN and braces.
	(qemudDomainAttachUsbMassstorageDevice): Likewise.

	ebtablesAddRemoveRule, iptablesAddRemoveRule: don't skip va_end
	* src/util/ebtables.c (ebtablesAddRemoveRule): Don't skip
	va_end(args) on an error path.
	* src/util/iptables.c (iptablesAddRemoveRule): Identical change.

	qemudDomainRestore: handle a case of virDomainSaveStatus failure
	* src/qemu/qemu_driver.c (qemudDomainRestore): Don't ignore
	virDomainSaveStatus failure.

	python: don't ignore virInitialize failure in module initialization
	* python/libvirt-override.c (initlibvirtmod): Upon virInitialize
	failure, skip the Py_InitModule call.

	tests: do not ignore virInitialize failure
	* tests/nodeinfotest.c (mymain): Do not ignore virInitialize failure.
	Most other callers of virInitialize test for failure.

	qemuMonitorTextMigrate: avoid leak on OOM-error path
	* src/qemu/qemu_monitor_text.c (qemuMonitorTextMigrate): Also
	free "safedest" buffer when failing.

	virNWFilterDefParseXML: avoid leak on error paths
	* src/conf/nwfilter_conf.c (virNWFilterDefParseXML): Also free "ret"
	via cleanup.

	linuxNodeInfoCPUPopulate: avoid used-uninitialized via a test
	* tests/nodeinfotest.c (linuxTestCompareFiles): Don't use
	nodeinfo->member uninitialized.  linuxNodeInfoCPUPopulate requires
	that some of its nodeinfo members (including threads) be initialized
	upon input.  The nodeinfotest.c program lacked the initialization,
	while the only other use (nodeGetInfo) did perform it.
	It's not trivial to move the initialization into the function,
	since nodeGetInfo sets at least one member after clearing the
	buffer but before calling linuxNodeInfoCPUPopulate.

	virDomainNetDefParseXML: avoid leak upon multiple "filterref"
	* src/conf/domain_conf.c (virDomainNetDefParseXML): Don't leak
	memory when parsing two or more "filterref" elements.

2010-05-18  Jim Meyering  <meyering@redhat.com>

	ebiptablesWriteToTempFile: don't close a negative file descriptor
	* src/nwfilter/nwfilter_ebiptables_driver.c (ebiptablesWriteToTempFile):
	Skip the close if "fd" is negative.

2010-05-18  Daniel P. Berrange  <berrange@redhat.com>

	Protect against NULL pointer flaws in monitor usage
	History has shown that there are frequent bugs in the QEMU driver
	code leading to the monitor being invoked with a NULL pointer.
	Although the QEMU driver code should always report an error in
	this case before invoking the monitor, as a safety net put in a
	generic check in the monitor code entry points.

	* src/qemu/qemu_monitor.c: Safety net to check for NULL monitor
	  object

2010-05-18  Daniel P. Berrange  <berrange@redhat.com>

	Fix multiple potential NULL pointer references in monitor usage
	Any method which intends to invoke a monitor command must have
	a check for virDomainObjIsActive() before using the monitor to
	ensure that priv->mon != NULL.

	There is one subtle edge case in this though. If a method invokes
	multiple monitor commands, and calls qemuDomainObjExitMonitor()
	in between two of these commands then there is no guarentee that
	priv->mon != NULL anymore. This is because the QEMU process may
	exit or die at any time, and because qemuDomainObjEnterMonitor()
	releases the lock on virDomainObj, it is possible for the background
	thread to close the monitor handle and thus qemuDomainObjExitMonitor
	will release the last reference allowing priv->mon to become NULL.

	This affects several methods, most notably migration but also some
	hotplug methods. This patch takes a variety of approaches to solve
	the problem, depending on the particular usage scenario. Generally
	though it suffices to add an extra virDomainObjIsActive() check
	if qemuDomainObjExitMonitor() was called during the method.

	* src/qemu/qemu_driver.c: Fix multiple potential NULL pointer flaws
	  in usage of the monitor

2010-05-18  Jim Meyering  <meyering@redhat.com>

	maint: add more free-like functions to the list and deal with fallout
	* cfg.mk (useless_free_options): Add many vir*Free* function names,
	and then remove the useless if-before-free tests exposed by running
	make syntax-check.
	* src/conf/interface_conf.c (virInterfaceDefFree): Remove useless "if".
	(virInterfaceAssignDef): Likewise.
	* src/conf/network_conf.c (virNetworkAssignDef): Likewise.
	* src/conf/storage_conf.c (virStoragePoolObjAssignDef): Likewise.
	* src/node_device/node_device_hal.c (dev_create): Likewise.
	* src/security/virt-aa-helper.c (vahDeinit): Likewise.
	* src/test/test_driver.c (testNodeDeviceCreateXML): Likewise.
	* src/util/conf.c (virConfSetValue): Likewise.

	maint: add virCgroupFree to the list of free-like functions
	This makes the useless-if-before-free test in maint.mk spot
	uses of virCgroupFree just like it does for free and the other
	listed functions.
	* cfg.mk (useless_free_options): Add virCgroupFree.
	Prompted by suggestion from Eric Blake.

	qemudDomainSetVcpus: avoid NULL-deref on failed uuid look-up
	* src/qemu/qemu_driver.c (qemudDomainSetVcpus): Upon look-up failure,
	i.e., vm==NULL, goto cleanup, rather than to "endjob", superficially
	since the latter would dereference vm, but more fundamentally because
	we certainly don't want to call qemuDomainObjEndJob before we've
	even attempted qemuDomainObjBeginJob.

	lxcFreezeContainer: avoid test-after-deref of never-NULL pointer
	* src/lxc/lxc_driver.c (lxcFreezeContainer): Remove test-after-deref.
	Correct indentation in expression.

2010-05-18  Matthias Bolte  <matthias.bolte@googlemail.com>

	Add CIFS to the list of network file systems
	ESX supports NFS and CIFS. The ESX storage driver will reflect this.

2010-05-18  Matthias Bolte  <matthias.bolte@googlemail.com>

	Add VIR_STORAGE_POOL_INACCESSIBLE to denote inaccessible storage pools
	This status will be used by the ESX storage driver.

	For example a running NFS pool is inaccessible when the NFS server is
	currently unreachable.

2010-05-18  Eric Blake  <eblake@redhat.com>

	qemu_conf: fix flag value
	(gdb) p/x QEMUD_CMD_FLAG_VNET_HOST
	$7 = 0xffffffff80000000

	Oops - that meant we were incorrectly setting QEMU_CMD_FLAG_RTC_TD_HACK
	for qemu-kvm-0.12.3 (and probably botching a few other settings as well).

	Fixes Red Hat BZ#592070

	* src/qemu/qemu_conf.h (QEMUD_CMD_FLAG_VNET_HOST): Avoid sign
	extension.
	* tests/qemuhelpdata/qemu-kvm-0.12.3: New file.
	* tests/qemuhelptest.c (mymain): Add another case.

2010-05-18  Cole Robinson  <crobinso@redhat.com>

	qemu: Clarify a couple error messages
	A fedora translator filed:

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

	Pointing out these two error messages as unclear: "write save" sounds
	like a typo without context, and lack of a colon made the second message
	difficult to parse.

2010-05-18  Eric Blake  <eblake@redhat.com>

	virFileResolveLink: fix return value
	virFileResolveLink was returning a positive value on error,
	thus confusing callers that assumed failure was < 0.  The
	confusion is further evidenced by callers that would have
	ended up calling virReportSystemError with a negative value
	instead of a valid errno.

	Fixes Red Hat BZ #591363.

	* src/util/util.c (virFileResolveLink): Live up to documentation.
	* src/qemu/qemu_security_dac.c
	(qemuSecurityDACRestoreSecurityFileLabel): Adjust callers.
	* src/security/security_selinux.c
	(SELinuxRestoreSecurityFileLabel): Likewise.
	* src/storage/storage_backend_disk.c
	(virStorageBackendDiskDeleteVol): Likewise.

2010-05-18  Cole Robinson  <crobinso@redhat.com>

	tests: Skip daemon-conf test if dir exceeds UNIX_PATH_MAX
	The max path length for unix sockets is pretty small (108, see man 7 unix).
	If 'make check' is run from a directory that exceeds this, one of the tests
	will fail, and in such a way that requires manually editting the test to
	determine why.

	There are certainly other ways to handle this, but I've chosen just to skip
	the offending test if we will exceed the length limitation.

	v2: Drop bashism, use test infrastructure to warn and skip

2010-05-18  Cole Robinson  <crobinso@redhat.com>

	pci: Give an explicit error if device not found
	v2: Use intended F_OK. Drop devdir param, just check dev->path for device
	existence.

	v3: Use virReportSystemError, include dev->path in error message.

2010-05-18  Eric Blake  <eblake@redhat.com>

	build: fix cygwin build, correctly this time
	Fix the cygwin regression introduced in commit 48445ccff, but
	without repeating the fresh build regression of commit
	2d550542e.

	* src/Makefile.am (libvirt_test_la_LIBADD): Split out subset of
	locally-built libraries...
	(libvirt_test_la_BUILT_LIBADD): ...into new variable.
	(libvirt_test_la_DEPENDENCIES): Depend only on the subset that
	automake would have given us for free if we didn't have to add our
	own extra file.

2010-05-18  Jim Meyering  <meyering@redhat.com>

	umlAutostartDomain: avoid NULL-deref upon virGetLastError failure
	* src/uml/uml_driver.c (umlAutostartDomain): Handle a NULL return
	from virGetLastError.

2010-05-17  Eric Blake  <eblake@redhat.com>

	build: fix up some compiler flags
	Matthias noted that the line:
	virt_aa_helper_LDFLAGS = $(WARN_CFLAGS)
	looks inconsistent, so I did an audit.

	Currently, the set of compiler warning flags passed to gcc as $CC are
	equally permitted as the set of linker flags passed to gcc as $LD, so
	there was no problem with that usage.  But if we ever get in a
	situation where $CC and $LD treat particular flags differently, using
	the right variable form will make it easier.

	In the process, I spotted a couple of typos that were omitting useful
	flags, as well as specifying a -l under the wrong variable.

	* acinclude.m4 (LIBVIRT_COMPILE_WARNINGS): Define WARN_LDFLAGS as
	an alias for WARN_CFLAGS.
	* tools/Makefile.am (virsh_LDFLAGS): Use more canonical spelling.
	* proxy/Makefile.am (libvirt_proxy_LDFLAGS): Likewise. Move
	library...
	(libvirt_proxy_LDADD): ...here.
	* src/Makefile.am (virt_aa_helper_LDFLAGS): Use more canonical
	spelling of WARN_LDFLAGS.
	(libvirt_parthelper_LDFLAGS, libvirt_lxc_LDFLAGS): Likewise.  Use
	correct spelling of COVERAGE_LDFLAGS.
	Reported by Matthias Bolte.

2010-05-17  Jim Meyering  <meyering@redhat.com>

	build: avoid compile failure on linux kernels older than 2.6.19
	* configure.ac: Check for <linux/magic.h>.
	* src/util/storage_file.c: Include <linux/magic.h> only if present.
	Linux kernels prior to 2.6.19 lacked it.
	[__linux__] (NFS_SUPER_MAGIC): Define if not already defined.

	x86ModelHasFeature: avoid NULL-dereference for unmatched CPU "feature"
	* src/cpu/cpu_x86.c (x86ModelHasFeature): Do not dereference the pointer
	returned by x86cpuidFind without first ensuring it is non-NULL.

2010-05-17  Cole Robinson  <crobinso@redhat.com>

	qemu: Report cmdline output if VM dies early
	qemuReadLogOutput early VM death detection is racy and won't always work.
	Startup then errors when connecting to the VM monitor. This won't report
	the emulator cmdline output which is typically the most useful diagnostic.

	Check if the VM has died at the very end of the monitor connection step,
	and if so, report the cmdline output.

	See also: https://bugzilla.redhat.com/show_bug.cgi?id=581381

2010-05-17  Cole Robinson  <crobinso@redhat.com>

	qemu: Fix previous commit, use comparision in if()

2010-05-17  Jim Meyering  <meyering@redhat.com>

	qemu_driver: avoid NULL dereference
	* src/qemu/qemu_driver.c (qemudDomainStart): After setting vm to NULL,
	goto cleanup, rather than dereferencing the NULL pointer.

2010-05-17  Daniel P. Berrange  <berrange@redhat.com>

	Remove debugging fprintf() calls
	* src/qemu/qemu_driver.c: Remove debugging fprintf() calls
	  accidentally left in code

2010-05-15  Jim Meyering  <meyering@redhat.com>

	qemudDomainSetVcpus: avoid NULL-deref
	* src/qemu/qemu_driver.c (qemudDomainSetVcpus): Avoid NULL-deref
	upon unknown UUID.  Call qemuDomainObjBeginJob(vm) only after
	ensuring that vm != NULL, not before.  This potential NULL-deref
	was introduced by commit 2c555d87b0041e0d1ec4742386d2161d1b2f0600.

2010-05-15  Eric Blake  <eblake@redhat.com>

	Revert "build: fix cygwin build"
	This reverts commit 2d550542ee729c1d9a4d92de344892650817b213.

	The patch worked for incremental builds, but broke fresh
	builds, because it interfered with automake's automatic
	dependency generation.  Until I figure out how to make
	automake do what we want, I'd rather leave cygwin broken
	but fresh Linux builds working.

2010-05-15  Eric Blake  <eblake@redhat.com>

	build: fix cygwin build
	make[3]: *** No rule to make target `-lxml2', needed by `libvirt.la'.  Stop.

	Due to treating the wrong string as a dependency.

	* src/Makefile.am (libvirt_la_DEPENDENCIES): Depend only on
	locally-built file, not on strings that might resolve as '-lxml2'.

2010-05-15  Stefan Berger  <stefanb@us.ibm.com>

	nwfilter: Add missing driver lock in qemu driver
	This adds a missing driver lock in the qemu driver to protect
	the list of domains.

2010-05-15  Ryota Ozaki  <ozaki.ryota@gmail.com>

	Fix a misuse of virAsprintf in qemudDomainMemoryPeek
	The code specifies driver->cacheDir as the format string,
	but it usually doesn't contain '%s', so the subsequent
	argument, "/qemu.mem.XXXXXX", is always ignored.

	The patch fixes the misuse.

2010-05-14  Daniel P. Berrange  <berrange@redhat.com>

	Make domain save work when dynamic_ownership=0
	Setting dynamic_ownership=0 in /etc/libvirt/qemu.conf prevents
	libvirt's DAC security driver from setting uid/gid on disk
	files when starting/stopping QEMU, allowing the admin to manage
	this manually. As a side effect it also stopped setting of
	uid/gid when saving guests to a file, which completely breaks
	save when QEMU is running non-root. Thus saved state labelling
	code must ignore the dynamic_ownership parameter

	* src/qemu/qemu_security_dac.c: Ignore dynamic_ownership=0 when
	  doing save/restore image labelling

2010-05-14  Daniel P. Berrange  <berrange@redhat.com>

	Don't reset user/group/security label on shared filesystems during migrate
	When QEMU runs with its disk on NFS, and as a non-root user, the
	disk is chownd to that non-root user. When migration completes
	the last step is shutting down the QEMU on the source host. THis
	normally resets user/group/security label. This is bad when the
	VM was just migrated because the file is still in use on the dest
	host. It is thus neccessary to skip the reset step for any files
	found to be on a shared filesystem

	* src/libvirt_private.syms: Export virStorageFileIsSharedFS
	* src/util/storage_file.c, src/util/storage_file.h: Add a new
	  method virStorageFileIsSharedFS() to determine if a file is
	  on a shared filesystem (NFS, GFS, OCFS2, etc)
	* src/qemu/qemu_driver.c: Tell security driver not to reset
	  disk labels on migration completion
	* src/qemu/qemu_security_dac.c, src/qemu/qemu_security_stacked.c,
	  src/security/security_selinux.c, src/security/security_driver.h,
	  src/security/security_apparmor.c: Add ability to skip disk
	  restore step for files on shared filesystems.

2010-05-14  Daniel P. Berrange  <berrange@redhat.com>

	Fix handling of disk backing stores with cgroups
	The cgroups ACL code was only allowing the primary disk image.
	It is possible to chain images together, so we need to search
	for backing stores and add them to the ACL too. Since the ACL
	only handles block devices, we ignore the EINVAL we get from
	plain files. In addition it was missing code to teardown the
	cgroup when hot-unplugging a disk

	* src/qemu/qemu_driver.c: Allow backing stores in cgroup ACLs
	  and add missing teardown code in unplug path

2010-05-14  Daniel P. Berrange  <berrange@redhat.com>

	Fix possible crash in handling IO Error event
	If the IO error event does not include a reason, then there
	is a possible crash dispatching the event

	* src/conf/domain_event.c: Missing check for a NULL reason before
	  strduping allows for a crash

2010-05-14  Daniel P. Berrange  <berrange@redhat.com>

	Add support for NIC hotplug using netdev_add in QEMU
	QEMU is gaining a new monitor command netdev_add for hotplugging
	NICs using the netdev backend code. We already support this on
	the command this, though it is disabled. This adds support for
	hotplug too, also to remain disabled until 0.13 QEMU is released

	* src/qemu/qemu_driver.c: Support netdev hotplug for NICs
	* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
	  src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h,
	  src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h: Add
	  support for netdev_add and netdev_remove commands

2010-05-13  Eric Blake  <eblake@redhat.com>

	datatypes: fix comment typo
	* src/datatypes.c: Use correct word.

2010-05-12  Jiri Denemark  <jdenemar@redhat.com>

	Fix monitor ref counting when adding event handle
	When closing a monitor using qemuMonitorClose(), we are aware of
	the possibility the monitor is still being used somewhere:

	    /* NB: ordinarily one might immediately set mon->watch to -1
	     * and mon->fd to -1, but there may be a callback active
	     * that is still relying on these fields being valid. So
	     * we merely close them, but not clear their values and
	     * use this explicit 'closed' flag to track this state */

	but since we call virEventAddHandle() on that monitor without increasing
	its ref counter, the monitor is still freed which makes possible users
	of it quite unhappy. The unhappiness can lead to a hang if qemuMonitorIO
	tries to lock mutex which no longer exists.

2010-05-12  Jiri Denemark  <jdenemar@redhat.com>

	Remove watches before calling REMOTE_PROC_CLOSE
	First calling REMOTE_PROC_CLOSE and then removing watches might lead to
	a hang as HANGUP event can be triggered before the watches are actually
	removed but after virConnectPtr is already freed. As a result of that
	remoteDomainEventFired() would try to lock uninitialized mutex, which
	would hang for ever.

2010-05-12  Jim Meyering  <meyering@redhat.com>

	tests: use GPLv2+, not GPLv3
	* tests/cpuset: Change from GPLv3 to GPLv2+
	* tests/read-bufsiz: Likewise.
	* tests/read-non-seekable: Likewise.
	* tests/start: Likewise.
	* tests/undefine: Likewise.
	* tests/vcpupin: Likewise.
	* tests/virsh-all: Likewise.
	* tests/virsh-schedinfo: Likewise.
	* tests/virsh-synopsis: Likewise.

2010-05-12  Eric Blake  <eblake@redhat.com>

	libvirt_proxy: link with -lpthread if needed
	Continuation of earlier patches to fix LIB_PTHREAD, only
	triggered by ./configure --with-xen-proxy (a la autobuild.sh).

	* proxy/Makefile.am (libvirt_proxy_LDADD): Add LIB_PTHREAD.

2010-05-12  Cole Robinson  <crobinso@redhat.com>

	node_device: udev: Fix PCI product/vendor swappage
	Product and vendor values were swapped in the XML, which made virt-manager
	PCI device listing kinda useless.

2010-05-12  Eric Blake  <eblake@redhat.com>

	build: update gnulib
	* .gnulib: Update to latest.
	* bootstrap.conf (gnulib_modules): Import netdb.
	* src/esx/esx_util.c (AI_ADDRCONFIG): Rely on gnulib.
	* src/remote/remote_driver.c (AI_ADDRCONFIG): Likewise.
	* tools/virsh.c (WEXITSTATUS, O_SYNC): Likewise.

	build: allow older gettext
	* bootstrap.conf (gnulib_modules): Use gettext-h, not gettext,
	since the latter drags in a depedency on gettext 0.18.
	Suggested by Bruno Haible.

2010-05-12  Jim Meyering  <meyering@redhat.com>

	tests: correct PATH in new test, for when running manually
	* tests/virsh-schedinfo: This test sets PATH internally, just in
	case you're running it manually.  Normally, the PATH setting from
	tests/Makefile.am's TESTS_ENVIRONMENT is sufficient.  Prepend the
	correct directory, and take advantage of the PATH setting in one
	more case.

2010-05-11  Daniel P. Berrange  <berrange@redhat.com>

	Add env variable for debugging gnutls usage
	Allow debugging of GNUTLS interactions by setting

	  LIBVIRT_GNUTLS_DEBUG=10 LIBVIRT_DEBUG=1 virsh

	* src/remote/remote_driver.c: Use LIBVIRT_GNUTLS_DEBUG to
	  enable gnutls debugging

2010-05-11  Jim Meyering  <meyering@redhat.com>

	tests: adjust copyrights on scripts: s/FSF/Red Hat/
	* tests/cpuset: Change copyright holder from FSF to Red Hat, Inc.
	* tests/read-bufsiz: Likewise.
	* tests/read-non-seekable: Likewise.
	* tests/start: Likewise.
	* tests/undefine: Likewise.
	* tests/vcpupin: Likewise.
	* tests/virsh-all: Likewise.
	* tests/virsh-synopsis: Likewise.

	virsh: schedinfo --set invalid=value would simply ignore the option
	For example, virsh -c test:///default schedinfo 1 --set P=k would
	mistakenly exit successfully, giving no indication that it had failed
	to set the scheduling parameter "P".
	* tools/virsh.c (cmdSchedinfo): Diagnose an invalid --set j=k option,
	rather than silently ignoring it.
	* tests/virsh-schedinfo: New test for the above.
	* tests/Makefile.am (test_scripts): Add it.
	Reported by Jintao Yang in http://bugzilla.redhat.com/586632

	virsh: fix a typo in a diagnostic
	* tools/virsh.c (cmdSchedInfoUpdate): Fix typo in a diagnostic:
	s/an long long/a long long/.  One in a comment, too.

2010-05-11  Eric Blake  <eblake@redhat.com>

	delMacvtap: typo fix
	* src/util/macvtap.c (delMacvtap): Fix documentation.

	maint: allow VPATH use of remote_protocol-structs
	* src/Makefile.am (remote_protocol-structs): Ensure file lives in srcdir.

	docs/Makefile.am: remove unnecessary subshells
	* docs/Makefile.am (ChangeLog.html.in, %.html.tmp, %.html)
	(html/index.html, $(devhelphtml)): Avoid spurious subshells.

2010-05-11  Eric Blake  <eblake@redhat.com>

	maint: avoid spurious output if program not present
	Some shells warn about missing programs before redirection;
	the idiomatic way to silence them is to run the program check
	inside a subshell, with the redirections outside the subshell.
	But a subshell is only needed in places where it is reasonable
	to expect the use of such a noisy shell in the first place.

	* src/Makefile.am (remote_protocol-structs): Use subshell, for
	FreeBSD 8.0 /bin/sh.
	* cfg.mk (sc_preprocessor_indentation): Avoid subshell, since the
	only users running cfg.mk can be assumed to have decent tools.

2010-05-11  Eric Blake  <eblake@redhat.com>

	storage_encryption: silence clang warning
	For printf("%*s",foo,bar), clang complains if foo is not int:

	warning: field width should have type 'int', but argument has
	type 'unsigned int' [-Wformat]

	* src/conf/storage_encryption_conf.c
	(virStorageEncryptionSecretFormat, virStorageEncryptionFormat):
	Use correct type.
	* src/conf/storage_encryption_conf.h (virStorageEncryptionFormat):
	Likewise.

2010-05-08  Jim Meyering  <meyering@redhat.com>

	help avoid accidental remote_protocol.x changes
	Now, if you update remote_protocol.x without also updating
	remote_protocol-structs to match, then "make check" will fail.
	* src/Makefile.am (remote_protocol-structs): Extract list of
	structs and member names from remote_protocol.o.
	(check-local): Depend on it.
	* src/remote_protocol-structs: New file.

2010-05-08  Eric Blake  <eblake@redhat.com>

	mingw32-libvirt.spec: bring up to date
	Right now, mingw32-portablexdr is not available in Fedora, but is
	present in fedora-mingw.git.  With that package, plus
	redhat-rpm-config and this patch, it is once again possible to build
	mingw32-libvirt from a Fedora 12 host.

	* mingw32-libvirt.spec.in (__debug_install_post): Override.
	(%files): Mention recent additions.

2010-05-08  Matthias Bolte  <matthias.bolte@googlemail.com>

	Manually revert "Fix pthread related link error for virt-aa-helper"
	This reverts commit b5b8a6db69ba16a8225962bf7659b6ff6756bc18.

	That commit was not necessary. The problem is fixed by commit
	0e9b3a269be9ce821615aba4aece87c4451d43ac, but I didn't rebuild
	it properly after pulling in the commit and didn't notice it.

2010-05-08  Ersek Laszlo  <lacos@caesar.elte.hu>

	Fix a typo in docs

2010-05-08  Eric Blake  <eblake@redhat.com>

	build: use LIBADD, not LDFLAGS, for adding libraries
	Per automake, LDFLAGS is used early in the line, and LIBADD
	(libraries) or LDADD (programs) is used late.  On platforms like
	cygwin, without lazy linking, this order matters.  Therefore, libtool
	commands, -L, and similar should be in LDFLAGS, but -l should be in
	L*ADD.

	* src/Makefile.am (*_LDFLAGS): Move libraries...
	(*_LIBADD): ...to their LIBADD counterpart.

2010-05-08  Eric Blake  <eblake@redhat.com>

	maint: whitespace cleanups
	* src/Makefile.am: Fix some space-tab issues.

2010-05-07  Matthias Bolte  <matthias.bolte@googlemail.com>

	Fix pthread related link error for virt-aa-helper
	Link virt-aa-helper explicitly with pthread. This is at least
	required on Ubuntu 10.04.

	qemu: Fix warning about a non-literal format string

2010-05-07  Jim Meyering  <meyering@redhat.com>

	avoid link error in tests using libvirt_util; due to pthread_sigmask
	* src/Makefile.am (libvirt_util_la_LDFLAGS): Add $(LIB_PTHREAD),
	required, now that we're using gnulib's pthread module.

2010-05-07  Matthew Booth  <mbooth@redhat.com>

	Remove unused nwfilter field from struct remote_error
	Change 965466c1 added a new field to struct remote_error, which broke
	the RPC protocol. Fortunately the new field is unused, so this change
	simply removes it again.

	* src/remote/remote_protocol.(c|h|x): Remove remote_nwfilter from struct
	  remote_error

2010-05-07  Wolfgang Mauerer  <wolfgang.mauerer@siemens.com>

	Implement SCSI disk unplugging
	With the introduction of the generic qemu device model, unplugging
	SCSI disks works like a charm, so support it in libvirt.

	* src/qemu/qemu_driver.c: Add qemudDomainDetachSCSIDiskDevice() to do the
	  unplugging, extend qemudDomainDetachDeviceAdd().

2010-05-07  Eric Blake  <eblake@redhat.com>

	qemu: use better types
	* src/qemu/qemu_driver.c (qemudFindDisk): Mark parameter const.
	(qemudShrinkDisks): Mark parameter unsigned.

2010-05-07  Wolfgang Mauerer  <wolfgang.mauerer@siemens.com>

	Refactor disk unplugging
	We can reuse some of the code for other purposes.

2010-05-07  Eric Blake  <eblake@redhat.com>

	build: simplify checks for sched.h
	* configure.ac: Remove redundant checks.

2010-05-07  Eric Blake  <eblake@redhat.com>

	build: update gnulib
	81 patches to gnulib, picks up several new syntax checks.

	* .gnulib: Update to latest.
	* .x-sc_prohibit_always_true_header_tests: New file.
	* bootstrap.conf (gnulib_modules): Add sched.
	* src/util/processinfo.c (includes): <sched.h> is now guaranteed.
	* src/network/bridge_driver.c (includes): Drop useless
	<strings.h>.
	* src/openvz/openvz_conf.c (includes): Likewise.
	* src/openvz/openvz_driver.c (includes): Likewise.
	* src/phyp/phyp_driver.c (includes): Likewise.
	* src/qemu/qemu_driver.c (includes): Likewise.
	* src/uml/uml_driver.c (includes): Likewise.

2010-05-07  Eric Blake  <eblake@redhat.com>

	build: drop more redundant configure checks
	* configure.ac (AC_CHECK_FUNCS_ONCE, AC_SYS_LARGEFILE): Rely on
	gnulib for strtok_r and large file support.
	(AC_OBJEXT): Drop call now done by AC_PROG_CC.
	(m4_foreach_w): Drop macro guaranteed by gnulib.
	(AC_C_CONST): Drop call declared obsolete by autoconf.

	build: use gnulib's sys/wait.h
	* configure.ac: Drop sys/wait.h check.
	* src/libvirt.c (includes): Use header unconditionally.
	* src/remote/remote_driver.c (includes): Likewise.
	* src/storage/storage_backend.c (includes): Likewise.
	* src/util/ebtables.c (includes): Likewise.
	* src/util/hooks.c (includes): Likewise.
	* src/util/iptables.c (includes): Likewise.
	* src/util/util.c (includes): Likewise.

	build: use gnulib's uname
	* bootstrap.conf (gnulib_modules): Add uname.
	* configure.ac: Drop uname and sys/utsname.h checks.
	* src/nodeinfo.c (nodeGetInfo): Use uname unconditionally.

2010-05-07  Eric Blake  <eblake@redhat.com>

	build: rely on gnulib's pthread module
	Gnulib can guarantee that pthread.h exists, but for now, it is a dummy
	header with no support for most pthread_* functions.  Modify our
	use of pthread to use function checks, rather than header checks,
	to determine how much pthread support is present.

	* bootstrap.conf (gnulib_modules): Add pthread.
	* configure.ac: Drop all pthread.h checks.  Optimize function
	checks.  Add check for pthread functions.
	* src/Makefile.am (libvirt_lxc_LDADD): Ensure proper link.
	* src/remote/remote_driver.c (remoteIOEventLoop): Depend on
	pthread_sigmask, now that gnulib guarantees pthread.h.
	* src/util/util.c (virFork): Likewise.
	* src/util/threads.c (threads-pthread.c): Depend on
	pthread_mutexattr_init, as a witness of full pthread support.
	* src/util/threads.h (threads-pthread.h): Likewise.

2010-05-06  Eric Blake  <eblake@redhat.com>

	build: silence a clang false positive
	* src/qemu/qemu_monitor.c (qemuMonitorIOWriteWithFD): Work around
	recent clang shortcoming in analysis.

2010-05-06  Stefan Berger  <stefanb@us.ibm.com>

	rpmbuild: add ebtables & ip(6)tables dependency for rpm
	Add ebtables,iptables & iptables-ipv6 dependency to rpm.

	Changes from V1 to V2:
	  -passing --without-libpcap to configure script, if libpcap is not to be used

2010-05-05  Eric Blake  <eblake@redhat.com>

	util: fix va_start usage bug
	Detected by clang.  POSIX requires that the second argument to
	va_start be the name of the last variable; and in some implementations,
	passing *path instead of path would dereference bogus memory instead
	of pulling arguments off the stack.

	* src/util/util.c (virBuildPathInternal): Use correct argument to
	va_start.

2010-05-05  Kenneth Nagin  <NAGIN@il.ibm.com>

	qemu: live migration with non-shared storage for kvm
	Support for live migration between hosts that do not share storage was
	added to qemu-kvm release 0.12.1.
	It supports two flags:
	-b migration without shared storage with full disk copy
	-i migration without shared storage with incremental copy (same base image
	shared between source and destination).

	I tested the live migration without shared storage (both flags) for native
	and p2p with and without tunnelling.  I also verified that the fix doesn't
	affect normal migration with shared storage.

2010-05-05  Matthias Bolte  <matthias.bolte@googlemail.com>

	configure.ac: Avoid uname, which breaks cross-compilation
	When cross-compiling on Linux, configure will misdetect the target as
	Linux because it uses uname instead of relying on the $host variable.
	This results in including libvirt_linux.syms into libvirt.syms and
	therefore trying to export undefined symbols.

	Replace uname checks with $host checks to fix this.

2010-05-04  Jiri Denemark  <jdenemar@redhat.com>

	Don't wipe generated iface target in active domains
	Wipe generated interface target only when reading configuration of
	inactive domains.

2010-05-04  Daniel Veillard  <veillard@redhat.com>

	Various fixes for the spec file
	This includes various things:
	 - fix the Requires: libvirt-client to use %{name} to allow easy
	   renaming
	 - when building ESX support one need libcurl-devel
	 - remove Makefile[.in] from xml/nwfilter in the docs, as this breaks
	   parallel install ation of i686 and x86_64 packages
	 - don't include nwfilter config files if not building with the daemon
	all relatively trivial which is why I packed them together
	* libvirt.spec.in: fix various small bugs

2010-05-04  Jim Meyering  <meyering@redhat.com>

	docs: hacking: explain why using curly braces well is important
	* docs/hacking.html.in: Use the "curly braces" section from coreutils'
	HACKING, adapting for libvirt's different formatting style.
	* HACKING: Sync from the above, still mostly manually.

2010-05-04  Jiri Denemark  <jdenemar@redhat.com>

	lxc: Check domain is active/inactive as required by operation
	Report VIR_ERR_OPERATION_INVALID when operation which requires running
	domain is called on inactive domain and vice versa.

	lxc: Make SetMemory work for active domains only

	lxc: Use virDomainFindByUUID for domain lookup
	Consistently use virDomainFindByUUID instead of virDomainFindByID and
	virDomainFindByName and report VIR_ERR_NO_DOMAIN when domain cannot be
	found.

2010-05-04  Matthias Bolte  <matthias.bolte@googlemail.com>

	mingw: Fix two undefined symbols
	Add an empty body for virCondWaitUntil and move virPipeReadUntilEOF
	out of the '#ifndef WIN32' block, because it compiles fine with MinGW
	in combination with gnulib.

2010-05-04  Eric Blake  <eblake@redhat.com>

	build: avoid compiler warning
	Necessary on cygwin, where uid_t and gid_t are 4-byte long rather
	than int, causing gcc -Wformat warnings.

	* src/util/util.c (virFileOperationNoFork, virDirCreateNoFork)
	(virFileOperation, virDirCreate, virGetUserEnt): Cast uid_t and
	gid_t before passing to printf.
	* .gitignore: Ignore Windows executables.

2010-05-04  Stefan Berger  <stefanb@us.ibm.com>

	nwfilter: skip some interfaces on filter update
	When a filter is updated, only those interfaces must have their old
	rules cleared that either reference the filter directly or indirectly
	through another filter. Remember between the different steps of the
	instantiation of the filters which interfaces must be skipped. I am
	using a hash map to remember the names of the interfaces and store a
	bogus pointer to ~0 into it that need not be freed.

	pass info where request stems from to have rules applied
	For the decision on whether to instantiate the rules, the check for a
	pending IP address learn request is not sufficient since then only the
	thread could instantiate the rules. So, a boolean needs to be passed
	when the thread instantiates the filter rules late and the IP address
	learn request is still pending in order to override the check for the
	pending learn request. If the rules are to be updated while the thread
	is active, this will not be done immediately but the thread will do that
	later on.

2010-05-04  Eric Blake  <eblake@redhat.com>

	build: prefer WIN32 over __MINGW32__ checks
	WIN32 is always defined when __MINGW32__ is defined, but the
	converse is not true.  WIN32 is more generic, if someone were
	to ever attempt porting to a microsoft compiler.  This does
	not affect Cygwin, which intentionally does not define WIN32.

	* src/qemu/qemu_driver.c (qemuDomainGetBlockInfo): Use more
	generic flag macro.
	* src/storage/storage_backend.c
	(virStorageBackendUpdateVolTargetInfoFD)
	(virStorageBackendRunProgRegex): Likewise.
	* tools/console.h (vshRunConsole): Likewise.

2010-05-04  Ryota Ozaki  <ozaki.ryota@gmail.com>

	cgroup: Fix possible memory leak in virCgroupMakeGroup
	* src/util/cgroup.c: free temporal path string before breaking loop

2010-05-04  Eric Blake  <eblake@redhat.com>

	dnsmasqReload: avoid mingw link failure
	* src/util/dnsmasq.c (dnsmasqReload): Mingw lacks kill, but is not
	running a dnsmasq daemon either.

2010-05-04  Matthias Bolte  <matthias.bolte@googlemail.com>

	mingw: Fix symbol export
	In commit 98fb83ce25f46e0236706fa6e0943032d921935f I changed the
	version script handling. But it seems that I didn't test this properly
	and broke it. The .def file is passed to the compiler directly, but it
	should get passed to the linker instead.

	Set VERSION_SCRIPT_FLAGS to -Wl, to pass the .def file correctly to
	the linker.

	This fixes the undefined symbol errors while linking virsh.

2010-05-04  Matthias Bolte  <matthias.bolte@googlemail.com>

	dnsmasq.c: Fix OOM error reporting
	Also do some indentation clean up.

2010-05-03  Laine Stump  <laine@laine.org>

	Fix memory leaks in cmdInterfaceEdit and cmdNWFilterEdit.
	This applies a fix to thos functions similar to that made to cmdEdit
	in 270895063d1cf86ab42fa220a8d090c24d58dbc0, thus fnixing a memory
	leak - if tmp is unlinked and NULLed early in the function, the memory
	used by tmp is never freed. Since we will always unlink tmp prior to
	freeing its memory at the end of the function, just remove the earlier
	code and let cleanup: do the cleanup.

2010-05-03  Ryota Ozaki  <ozaki.ryota@gmail.com>

	lxc: Fix failure on starting a domain with multiple interfaces
	[Error message]
	error: Failed to start domain lxc_test1
	error: internal error Failed to create veth device pair: 512

	The reason of the failure is that lxc driver unexpectedly re-uses
	an auto-assigned veth name and tries to create the created veth
	again. The failure will happen when a domain has multiple network
	interfaces and the names of those are not specified in XML.

	The patch fixes the problem by resetting buffers of veth names
	in every iteration of creating veth.

	* src/lxc/lxc_driver.c: prevent re-using auto-assigned veth name
	  Reported by Kumar L Srikanth-B22348.

2010-05-01  Eric Blake  <eblake@redhat.com>

	autobuild.sh: provide default prefix
	Without this patch and with a clean environment, ./autobuild.sh
	tried to use ./configure --prefix=/, and fails.

	* autobuild.sh (AUTOBUILD_INSTALL_ROOT): Provide sensible
	default.  Suggested by Daniel P. Berrange.

2010-05-01  Daniel Veillard  <veillard@redhat.com>

	Release of libvirt-0.8.1
	* configure.ac docs/news.html.in libvirt.spec.in: updates for release
	* po/*.po*: updated localizations and regenerated

2010-05-01  Cole Robinson  <crobinso@redhat.com>

	domain: Fix PCI address decimal parsing regression
	<hostdev> address parsing previously attempted to detect the number
	base: currently it is hardcoded to base 16, which can break PCI
	assignment via virt-manager. Revert to the previous behavior.

	* src/conf/domain_conf.c: virDomainDevicePCIAddressParseXML, switch to
	  virStrToLong_ui(bus, NULL, 0, ...) to autodetect base

2010-04-30  Daniel P. Berrange  <berrange@redhat.com>

	Add support for another explicit IO error event
	This introduces a new event type

	   VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON

	This event is the same as the previous VIR_DOMAIN_ID_IO_ERROR
	event, but also includes a string describing the cause of
	the event.

	Thus there is a new callback definition for this event type

	typedef void (*virConnectDomainEventIOErrorReasonCallback)(virConnectPtr conn,
	                                                           virDomainPtr dom,
	                                                           const char *srcPath,
	                                                           const char *devAlias,
	                                                           int action,
	                                                           const char *reason,
	                                                           void *opaque);

	This is currently wired up to the QEMU block IO error events

	* daemon/remote.c: Dispatch IO error events to client
	* examples/domain-events/events-c/event-test.c: Watch for
	  IO error events
	* include/libvirt/libvirt.h.in: Define new IO error event ID
	  and callback signature
	* src/conf/domain_event.c, src/conf/domain_event.h,
	  src/libvirt_private.syms: Extend API to handle IO error events
	* src/qemu/qemu_driver.c: Connect to the QEMU monitor event
	  for block IO errors and emit a libvirt IO error event
	* src/remote/remote_driver.c: Receive and dispatch IO error
	  events to application
	* src/remote/remote_protocol.x: Wire protocol definition for
	  IO error events
	* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
	  src/qemu/qemu_monitor_json.c: Watch for BLOCK_IO_ERROR event
	  from QEMU monitor

2010-04-30  Jiri Denemark  <jdenemar@redhat.com>

	Report all errors in SELinuxRestoreSecurityFileLabel

2010-04-30  Stefan Berger  <stefanb@us.ibm.com>

	Prevent updates while IP address learn thread is running
	Prevent updating and tearing down of filter while the IP
	address learning thread is running and has its own filtering
	rules applied.

	Syncronize the teardown of rules with the thread
	Introduce a function to notify the IP address learning
	thread to terminate and thus release the lock on the interface.
	Notify the thread before grabbing the lock on the interface
	and tearing down the rules. This prevents a 'virsh destroy' to
	tear down the rules that the IP address learning thread has
	applied.

2010-04-30  Stefan Berger  <stefanb@us.ibm.com>

	Clean all tables before applying 'basic' rules
	The functions invoked by the IP address learning thread
	that apply some basic filtering rules did not clean up
	any previous filtering rules that may still be there
	(due to a libvirt restart for example). With the
	patch below all the rules are cleaned up first.

	Also, I am introducing a function to drop all traffic
	in case the IP address learning thread could not apply
	the rules.

2010-04-30  Daniel Veillard  <veillard@redhat.com>

	MAke virFileHasSuffix case insensitive
	* src/util/util.c: as it's used for checking things like .iso suffixes

2010-04-30  Stefan Berger  <stefanb@us.ibm.com>

	nwfilter: Also pick IP address from a DHCP ACK message
	The local DHCP server on virtbr0 sends DHCP ACK messages when a VM is
	started and requests an IP address while the initial DHCP lease on the
	VM's MAC address hasn't expired. So, also pick the IP address of the VM
	if that type of message is seen.
	Thanks to Gerhard Stenzel for providing a test case for this.

	Changes from V1 to V2:
	- cleanup: replacing DHCP option numbers through constants

2010-04-30  Dustin Kirkland  <kirkland@canonical.com>

	Fix virt-pki-validate's determination of CN
	Ubuntu's gntls package generates an Issuer line that looks like this:
	        Issuer: C=US,ST=NY,L=Rochester,O=example.com,CN=example.com CA,EMAIL=hostmaster@example.com

	While Red Hat's looks like this
	Issuer: CN=Red Hat Emerging Technologies

	Note the leading whitespace, and the additional fields in the former.

	This patch updates the regular expression to:
	 * trim leading characters before "Issuer:"
	 * trim anything between Issuer: and CN=
	 * trim anything after the next ,

	I've tested this against the certool output of both RH and Ubuntu
	generated certs.

2010-04-30  Jim Meyering  <meyering@redhat.com>

	qemudDomainSaveFlag: remove dead store
	* src/qemu/qemu_driver.c (qemudDomainSaveFlag): Remove dead store to "rc".

2010-04-30  Daniel P. Berrange  <berrange@redhat.com>

	Fix detection of disk in IO events
	When using -device syntax, the IO event will have a different
	prefix, 'drive-' that needs to be skipped over before matching
	against the libvirt disk alias

	* src/qemu/qemu_driver.c: Skip QEMU_DRIVE_HOST_PREFIX in IO event

2010-04-30  Daniel P. Berrange  <berrange@redhat.com>

	Implement python binding for virDomainGetBlockInfo
	This binds the virDomainGetBlockInfo API to python's blockInfo
	method on the domain object

	>>> c = libvirt.openReadOnly('qemu:///session')
	>>> d = c.lookupByName('demo')
	>>> f = d.blockInfo("/dev/loop0", 0)
	>>> print f
	[1048576000L, 104857600L, 104857600L]

	* python/libvirt-override-api.xml: Define override signature
	* python/generator.py: Skip C impl generator for virDomainGetBlockInfo
	* python/libvirt-override.c: Manual impl of virDomainGetBlockInfo

2010-04-30  Daniel P. Berrange  <berrange@redhat.com>

	Add new domblkinfo command to virsh
	  virsh # domblkinfo demoguest /dev/hda2
	  Capacity:       1048576000
	  Allocation:     104857600
	  Physical:       104857600

	* tools/virsh.c: Implement domblkinfo command mapping to the
	  new virDomainGetBlockInfo API

2010-04-30  Daniel P. Berrange  <berrange@redhat.com>

	Implement virDomainGetBlockInfo in QEMU driver
	* src/qemu/qemu_driver.c: Implementation of virDomainGetBlockInfo
	* src/util/storage_file.h: Add DEV_BSIZE
	* src/storage/storage_backend.c: Remove DEV_BSIZE

	Remote protocol impl for virDomainGetBlockInfo
	* daemon/remote.c: Server side dispatcher
	* daemon/remote_dispatch_args.h, daemon/remote_dispatch_prototypes.h,
	  daemon/remote_dispatch_ret.h, daemon/remote_dispatch_table.h: Update
	  with new API
	* src/remote/remote_driver.c: Client side dispatcher
	* src/remote/remote_protocol.c, src/remote/remote_protocol.h: Update
	* src/remote/remote_protocol.x: Define new wire protocol

2010-04-30  Daniel P. Berrange  <berrange@redhat.com>

	Internal driver API infrastructure for virDomainGetBlockInfo
	This defines the internal driver API and stubs out each driver

	* src/driver.h: Define virDrvDomainGetBlockInfo signature
	* src/libvirt.c, src/libvirt_public.syms: Glue public API to drivers
	* src/esx/esx_driver.c, src/lxc/lxc_driver.c, src/opennebula/one_driver.c,
	  src/openvz/openvz_driver.c, src/phyp/phyp_driver.c,
	  src/test/test_driver.c, src/uml/uml_driver.c, src/vbox/vbox_tmpl.c,
	  src/xen/xen_driver.c, src/xenapi/xenapi_driver.c: Stub out driver

2010-04-30  Daniel P. Berrange  <berrange@redhat.com>

	Add virDomainGetBlockInfo API to query disk sizing
	Some applications need to be able to query a guest's disk info,
	even for paths not managed by the storage pool APIs. This adds
	a very simple API to get this information, modelled on the
	virStorageVolGetInfo API, but with an extra field 'physical'.
	Normally 'physical' and 'allocation' will be identical, but
	in the case of a qcow2-like file stored inside a block device
	'physical' will give the block device size, while 'allocation'
	will give the qcow2 image size

	* include/libvirt/libvirt.h.in: Define virDomainGetBlockInfo

2010-04-29  Chris Lalancette  <clalance@redhat.com>

	Fix a virsh edit memory leak
	When running virsh edit, we are unlinking and setting
	the tmp variable to NULL before going to the end of the
	function, meaning that we never free tmp.  Since the
	exit to the function will always unlink and free tmp,
	just remove this bit of code and let it get done at the
	end.

	Fix a qemuDomainPCIAddressSetFree memory leak
	qemuDomainPCIAddressSetFree was freeing up the hash
	table for the pci addresses, but not freeing up the addr
	structure.  Looking over the callers of this function, it
	seems like they expect it to also free up the structure,
	so do that here.

	Fix a memory leak in the node_device_udev code
	We were over-writing a pointer without freeing it in
	case of a disk device, leading to a memory leak.

	Fix build on Ubuntu.
	When building on Ubuntu with make -j3 (or more), it would always
	fail when trying to build virt-aa-helper.  I'm not an expert in
	automake by any means, but I think the entry for virt-aa-helper
	is mis-using LDADD; it shouldn't be putting direct paths to
	libvirt_conf.la and libvirt_util.la, but instead referencing those
	names.  With this patch in place, I'm able to successfully build
	on Ubuntu 9.04 with make -j3.

	Report better error if qemuSnapshotIsAllowed failed.

2010-04-29  Daniel P. Berrange  <berrange@redhat.com>

	Remove unused goto label from qemudDomainCreate
	The previous commit changes a goto from 'endjob' to 'cleanup',
	leaving the endjob label unused. Remove it to avoid compile
	warning.

	* src/qemu/qemu_driver.c: Remove 'endjob' label

2010-04-29  Stefan Berger  <stefanb@us.ibm.com>

	nwfilter: python bindings for nwfilter
	I have primarily followed the pattern of the 'secret' driver to provide
	support for the missing python bindings for the network filter API.

2010-04-29  Jim Meyering  <meyering@redhat.com>

	qemuDomainSnapshotCreateXML: avoid NULL dereferences
	* src/qemu/qemu_driver.c (qemuDomainSnapshotCreateXML): When setting
	"vm" to NULL, jump over vm-dereferencing code to "cleanup".
	(qemuDomainRevertToSnapshot): Likewise.

	qemudDomainCreate: correct a slightly misdirected goto
	* src/qemu/qemu_driver.c (qemudDomainCreate): Goto cleanup,
	not "endjob", since we know "vm" is already NULL.  No semantic change.

2010-04-29  Matthias Bolte  <matthias.bolte@googlemail.com>

	cygwin/mingw: Fix version script handling
	Let configure detect ld instead of hardcoding /usr/bin/ld, because
	MinGW may have ld in /bin.

	Only use a .def file to export symbols on MinGW. Cygwin's ld supports
	the normal .syms file used on Linux.

2010-04-28  Eric Blake  <eblake@redhat.com>

	build: fix autogen rule for VPATH build
	* cfg.mk (gnulib_srcdir): Override maint.mk default.
	(_update_required): Run in correct directory.

2010-04-28  Daniel Veillard  <veillard@redhat.com>

	Move dnsmasq host file to a separate directory
	use /var/lib/libvirt/dnsmasq since /var/lib/libvirt/network is
	unreadable by the dnsmasq binary

	* src/network/bridge_driver.c: update DNSMASQ_STATE_DIR
	* src/Makefile.am: create it on make install
	* libvirt.spec.in: take the new directory into account

2010-04-28  Stefan Berger  <stefanb@us.ibm.com>

	nwfilter: allow to mix filterrefs and rules in the schema
	So far the references to other filters needed to appear before filtering
	rules. With the below patch they can now appear in any order.

	Also I forgot to add a couple of 'rarp's.

2010-04-28  Daniel P. Berrange  <berrange@redhat.com>

	Fix handling of security driver restore failures in QEMU domain save
	In cases where the security driver failed to restore a label after a
	guest has saved, we mistakenly jumped to the error cleanup paths.
	This is not good, because the operation has in fact completed and
	cannot be rolled back completely. Label restore is non-critical, so
	just log the problem instead. Also add a missing restore call in
	the error cleanup path

	* src/qemu/qemu_driver.c: Fix handling of security driver
	  restore failures in QEMU domain save

2010-04-28  Daniel P. Berrange  <berrange@redhat.com>

	Fix QEMU domain save to block devices with cgroups enabled
	When cgroups is enabled, access to block devices is likely to be
	restricted to a whitelist. Prior to saving a guest to a block device,
	it is necessary to add the block device to the whitelist. This is
	not required upon restore, since QEMU reads from stdin

	* src/qemu/qemu_driver.c: Add block device to cgroups whitelist
	  if neccessary during domain save.

2010-04-28  Daniel P. Berrange  <berrange@redhat.com>

	Fix QEMU save/restore with block devices
	The save process was relying on use of the shell >> append
	operator to ensure the save data was placed after the libvirt
	header + XML. This doesn't work for block devices though.
	Replace this code with use of 'dd' and its 'seek' parameter.
	This means that we need to pad the header + XML out to a
	multiple of dd block size (in this case we choose 512).

	The qemuMonitorMigateToCommand() monitor API is used for both
	save/coredump, and migration via UNIX socket. We can't simply
	switch this to use 'dd' since this causes problems with the
	migration usage. Thus, create a dedicated qemuMonitorMigateToFile
	which can accept an filename + offset, and remove the filename
	from the current qemuMonitorMigateToCommand() API

	* src/qemu/qemu_driver.c: Switch to qemuMonitorMigateToFile
	  for save and core dump
	* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
	  src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h,
	  src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h: Create
	  a new qemuMonitorMigateToFile, separate from the existing
	  qemuMonitorMigateToCommand to allow handling file offsets

2010-04-28  Daniel P. Berrange  <berrange@redhat.com>

	Avoid create/unlink with block devs used for QEMU save
	It is possible to use block devices with domain save/restore. Upon
	failure QEMU unlinks the path being saved to. This isn't good when
	it is a block device !

	* src/qemu/qemu_driver.c: Don't unlink block devices if save fails

2010-04-28  Daniel P. Berrange  <berrange@redhat.com>

	Fix crash when cleaning up from failed save attempt
	If a transient QEMU crashes during save attempt, then the virDomainPtr
	object may be freed. If a persistent QEMU crashes during save, then
	the 'priv->mon' field is no longer valid since it will be inactive.

	* src/qemu/qemu_driver.c: Fix two crashes when QEMU exits
	  during a save attempt

2010-04-28  Stefan Berger  <stefanb@us.ibm.com>

	nwfilter: let qemu's after-migration packet pass
	Qemu currently sends an Ethernet packet with protocol id 0x835 once a VM
	was successfully migrated. The content of the packet looks like a
	gratuitous RARP, just with the wrong protocol ID, which should be
	0x8035. I wrote some filters to let either one of the packets pass and
	am adapting the clean-traffic sample filter to use it. I am also
	doing some changes on the existing ARP filter which was lacking a
	test for source MAC address.

2010-04-28  Chris Lalancette  <clalance@redhat.com>

	Fix up the error message if we can't parse the snapshot XML.

2010-04-28  Klaus Ethgen  <Klaus@Ethgen.de>

	The base used for conversion of USB values should be 16 not 10.

2010-04-27  Chris Lalancette  <clalance@redhat.com>

	Fix up the locking in the snapshot code.
	In particular I was forgetting to take the qemuMonitorPrivatePtr
	lock (via qemuDomainObjBeginJob), which would cause problems
	if two users tried to access the same domain at the same time.
	This patch also fixes a problem where I was forgetting to remove
	a transient domain from the list of domains.

	Thanks to Stephen Shaw for pointing out the problem and testing
	out the initial patch.

2010-04-27  Daniel Veillard  <veillard@redhat.com>

	cleanup the download section of the documentation
	Just removing reverences to the deprecated CVS server and the old git
	on et.redhat.com

2010-04-27  Stefan Berger  <stefanb@us.ibm.com>

	nwfilter: add support for RAPR protocol
	This patch adds support for the RARP protocol. This may be needed due to
	qemu sending out a RARP packet (at least that's what it seems to want to
	do even though the protocol id is wrong) when migration finishes and
	we'd need a rule to let the packets pass.

	Unfortunately my installation of ebtables does not understand -p RARP
	and also seems to otherwise depend on strings in /etc/ethertype
	translated to protocol identifiers. Therefore I need to pass -p 0x8035
	for RARP. To generally get rid of the dependency of that file I switch
	all so far supported protocols to use their protocol identifier in the
	-p parameter rather than the string.

	I am also extending the schema and added a test case.

	changes from v1 to v2:
	- added test case into patch

2010-04-27  Jiri Denemark  <jdenemar@redhat.com>

	Ignore qemu STOP event when stopping CPUs
	With JSON qemu monitor, we get a STOP event from qemu whenever qemu
	stops guests CPUs. The downside of it is that vm->state is changed to
	PAUSED and a new generic paused event is send to applications. However,
	when we ask qemu to stop the CPUs we are not really interested in qemu
	event and we usually want to issue a more specific event.

	By setting vm->status to PAUSED before actually sending the request to
	qemu (and resetting it back if the request fails) we can ignore the
	event since the event handler does nothing when the guest is already
	paused. This solution is quite hacky but unfortunately it's the best
	solution which I was able to come up with and it doesn't introduce a
	race condition.

2010-04-27  Jiri Denemark  <jdenemar@redhat.com>

	Fix build with DEBUG_RAW_IO=1

2010-04-27  David Allan  <dallan@redhat.com>

	Fix indentation for storage conf XML
	* virStorageEncryptionFormat is called from both
	  virDomainDiskDefFormat and virStorageVolTargetDefFormat.  The proper
	  indentation in the generated XML depends on the caller.  My earlier
	  patch to fix the incorrect indentation for the domain XML broke the
	  indentation for the storage XML.  This patch adopts Laine's
	  suggestion of requring the caller of virStorageEncryptionFormat to
	  provide an unsigned int with the number of spaces the output should
	  be indented.  The patch modifies both callers to provide the
	  additional argument.

	* Add a regression test for the domain XML

	* src/conf/domain_conf.c src/conf/storage_conf.c
	  src/conf/storage_encryption_conf.c src/conf/storage_encryption_conf.h:
	  change the indentation code
	* tests/qemuxml2xmltest.c
	  tests/qemuxml2argvdata/qemuxml2argv-encrypted-disk.args
	  tests/qemuxml2argvdata/qemuxml2argv-encrypted-disk.xml: add a regression test

2010-04-27  Daniel Veillard  <veillard@redhat.com>

	Don't try to build qemu and lxc on non-Linux platforms
	as their drivers requires linux only headers

2010-04-27  Matthias Bolte  <matthias.bolte@googlemail.com>

	cygwin: Handle differences in the XDR implementation
	Cygwin's XDR implementation defines xdr_u_int64_t instead of
	xdr_uint64_t and lacks IXDR_PUT_INT32/IXDR_GET_INT32.

	Alter the IXDR_GET_LONG regex in rpcgen_fix.pl so it doesn't destroy
	the #define IXDR_GET_INT32 IXDR_GET_LONG in remote_protocol.x.

	Also fix the remote_protocol.h regex in rpcgen_fix.pl.

2010-04-27  Matthias Bolte  <matthias.bolte@googlemail.com>

	Cygwin's GCC doesn't like this .sa_handler initialization for some reason

	linux/if.h header is not available on non-Linux platforms

2010-04-27  Stefan Berger  <stefanb@us.ibm.com>

	nwfilter: enable hex number inputs in filter XML
	With this patch I want to enable hex number inputs in the filter XML. A
	number that was entered as hex is also printed as hex unless a string
	representing the meaning can be found.

	I am also extending the schema and adding a test case. A problem with
	the DSCP value is fixed on the way as well.

	Changes from V1 to V2:

	- using asHex boolean in all printf type of functions to select the
	output format in hex or decimal format

2010-04-26  Satoru SATOH  <satoru.satoh@gmail.com>

	Starts dnsmasq from libvirtd with --dhcp-hostsfile option
	This patch makes libvirtd start the dnsmasq daemon with a
	--dhcp-hostsfile option instead of --dhcp-host options for each
	'//ip/dhcp/host' entries defined in network xml file.

	the dnsmasq host file is stored into /var/lib/libvirt/network

	* src/network/bridge_driver.c: define the directory for the hostfiles
	  and save/delete them to be used by dnsmasq

2010-04-26  Satoru SATOH  <satoru.satoh@gmail.com>

	Add build support for dnsmasq module
	* po/POTFILES.in: the new module contains translatable strings
	* src/Makefile.am: include the files in the utils set
	* src/libvirt_private.syms: exports the symbols internally

2010-04-26  Satoru SATOH  <satoru.satoh@gmail.com>

	Add dnsmasq module files
	It implements an idea to save dhcp hosts' macaddr vs. ipaddr mappings to
	static file and make dnsmasq loading it with "--dhcp-hostsfile" option,
	originally suggested by Dan, and can address the problem that too
	many "--dhcp-host" args hitting ARG_MAX limit

	* src/util/dnsmasq.h src/util/dnsmasq.c: adds the 2 new files

2010-04-26  Daniel Veillard  <veillard@redhat.com>

	Fix make dist missing ESX generated files
	new method generated files are missing from dist tarball.

2010-04-24  Chris Lalancette  <clalance@redhat.com>

	Fix memory leak in virsh snapshot-list.
	We were forgetting to release the memory allocated by
	virDomainSnapshotListNames.  Free the memory properly.

	Fix printing of pathnames on error in qemuDomainSnapshotLoad.
	While doing some testing of the snapshot code I noticed that
	if qemuDomainSnapshotLoad failed, it would print a NULL as
	part of the error.  That's not desirable, so leave the
	full_path variable around until after we are done printing
	errors.

	Fix virDomainSnapshotObjFree memory leak.
	We were freeing the virDomainSnapshotDefPtr, but not
	the virDomainSnapshotObjPtr in virDomainSnapshotObjFree.

	Make virDomainSnapshotObjListDeinit static.

	Fix a memory leak in the snapshot code in libvirtd.
	While running libvirtd under valgrind and doing some
	snapshot testing I noticed that we would always leak a
	connection reference.  The problem was actually that we
	were leaking a domain reference in the libvirtd remote
	snapshot code, which was in turn causing a leaked
	connection reference.  Fix the situation by explicitly
	taking and dropping a domain reference where we need it.

2010-04-24  Matthias Bolte  <matthias.bolte@googlemail.com>

	cygwin: Check explicitly for getmntent_r
	Cygwin has mntent.h but lacks getmntent_r. Update preprocessor
	checks to catch this combination.

	Some NWFilter symbols are conditional and have to be exported conditional

	xen: Fix inside_daemon beeing unused when libvirtd is disabled
	The defined __sun is there, because inside_daemon is used in xenUnifiedOpen
	if __sun is defined.

	Disable stateful OpenNebula driver if libvirtd is disabled
	Also move the equivalent checks for LXC and UML before their header
	checks. This way configure doesn't check for the headers when the driver
	gets disabled anyway.

	Improve configure error message about missing Linux headers

2010-04-24  Eric Blake  <eblake@redhat.com>

	build: fix typo in previous commit
	* configure.ac: Avoid syntax error.

2010-04-24  Eric Blake  <eblake@redhat.com>

	build: don't include winsock2.h on cygwin
	Under cygwin, winsock2.h is intentionally incompatible with,
	<sys/socket.h>, and checking for existence is wrong.

	Under mingw, HAVE_WINSOCK2_H is defined on our behalf by
	gnulib, in a way that does not interfere with cygwin.

	* configure.ac: Drop unnecessary header check.
	Reported by Matthias Bolte.

2010-04-24  Luiz Capitulino  <lcapitulino@redhat.com>

	QEmu JSON drop timestamp from command object
	It's not needed and is currently ignored, but this is a bug.

	It will get fixed soon and QMP will return an error for keys
	it doesn't know about, this will break libvirt.

	* src/qemu/qemu_monitor_json.c: remove qemuMonitorJSONCommandAddTimestamp()
	  and the place where it's invoked in qemuMonitorJSONMakeCommand()

2010-04-23  Stefan Berger  <stefanb@us.ibm.com>

	nwfilter: extend schema + add testcase w/ connlimit-above
	I am extending the schema with the recently added connlimit-above
	attribute and adding a test case for it to the test suite.

2010-04-23  Marco Bozzolan  <redshift@gmx.com>

	maint: update AUTHORS
	* AUTHORS: Use preferred name.

2010-04-23  Daniel P. Berrange  <berrange@redhat.com>

	Fix crash in nwfilter driver check
	The nwfilterDriverActive() could de-reference a NULL pointer
	if it hadn't be started at the point it was called. It was
	also not thread safe, since it lacked locking around data
	accesses.

	* src/nwfilter/nwfilter_driver.c: Fix locking & NULL checks
	  in nwfilterDriverActive()

2010-04-23  Eric Blake  <eblake@redhat.com>

	addrToString: give better error message
	The user probably doesn't care what the gai error numbers are, as
	much as what the failed conversion IP address was.

	* src/remote/remote_driver.c (addrToString): Mention which address
	could not be converted.
	* daemon/remote.c (addrToString): Likewise.

2010-04-23  Eric Blake  <eblake@redhat.com>

	maint: update AUTHORS with recent contributors
	git shortlog $(git log -1 --format=%H AUTHORS).. | grep -v "^ "

	then add missing entries to AUTHORS.

	* AUTHORS: Update.

2010-04-23  Spencer Shimko  <sshimko@tresys.com>

	qemu: fix security context references in DAC code
	* The error messages coming from qemu's DAC support contain strings
	  from the original SELinux security driver code.  This just removes
	  references to "security context" and other SELinux-isms from the DAC
	  code.

2010-04-23  Stefan Berger  <stefanb@us.ibm.com>

	Changes from V1 to V2:  - using INT_BUFSIZE_BOUND() to determine the length of the buffersize for printing and integer into
	 - not explicitly initializing static var threadsTerminate to false
	anymore, since that's done automatically

	Changes after V2:
	  - removed while looks in case of OOM error
	  - removed on ifaceDown() call
	  - preceding one ifaceDown() call with an ifaceCheck() call

	Since the name of an interface can be the same between stops and starts
	of different VMs I have to switch the IP address learning thread to use
	the index of the interface to determine whether an interface is still
	available or not - in the case of macvtap the thread needs to listen for
	traffic on the physical interface, thus having to time out periodically
	to check whether the VM's macvtap device is still there as an indication
	that the VM is still alive. Previously the following sequence of 2 VMs
	with macvtap device

	virsh start testvm1; virsh destroy testvm1 ; virsh start testvm2

	would not terminate the thread upon testvm1's destroy since the name of
	the interface on the host could be the same (i.e, macvtap0) on testvm1
	and testvm2, thus it was easily race-able. The thread would then
	determine the IP address parameter for testvm2 but apply the rule set
	for testvm1. :-(
	I am also introducing a lock for the interface (by name) that the thread
	must hold while it listens for the traffic and releases when it
	terminates upon VM termination or 0.5 second thereafter. Thus, the new
	thread for a newly started VM with the same interface name will not
	start while the old one still holds the lock. The only other code that I
	see that also needs to grab the lock to serialize operation is the one
	that tears down the firewall that were established on behalf of an
	interface.

	I am moving the code applying the 'basic' firewall rules during the IP
	address learning phase inside the thread but won't start the thread
	unless it is ensured that the firewall driver has the ability to apply
	the 'basic' firewall rules.

2010-04-23  David Allan  <dallan@redhat.com>

	Properly indent encryption tags
	* Fix for the bug reported at:

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

2010-04-23  Jiri Denemark  <jdenemar@redhat.com>

	Fix locking in qemudDomainCoreDump
	The hang fix in d376b7d63ec1ef24ba4c812d58b9a414ddb561f8 was incomplete
	since it left quite a few {Enter,Exit}Monitor calls which require driver
	to be unlocked. Since the driver is locked throughout the whole
	function, {Enter,Exit}MonitorWithDriver need to be used instead to
	ensure driver is not locked when issuing monitor commands.

	Poll for migration end every 50ms instead of 50us
	The comment in qemuDomainWaitForMigrationComplete says we are polling
	every 50ms but the code sleeps only for 50us. This was already discussed
	during review but apparently forgotten when the series was pushed.

2010-04-23  Spencer Shimko  <sshimko@tresys.com>

	configure.ac SELinux fixes
	* Fix a logic error in configure.ac that prevented --with-selinux=no
	  from being used with --with-secdriver-selinux=no.

	* Fix some strings to clarify the difference between --with-selinux
	  and --with-secdriver-selinux.

2010-04-23  Daniel P. Berrange  <berrange@redhat.com>

	Fix QEMU text monitor command error checking
	The text monitor code was checking for a '\n' prefix on several
	places. Previously this would work, but since the monitor code
	re-write the '\n' is already stripped off, so mustn't be checked
	for.

	* src/qemu/qemu_monitor_text.c: Fix monitor error checking

2010-04-23  Daniel P. Berrange  <berrange@redhat.com>

	Fix CPU hotplug command names
	Probably as a result of a merge error, the CPU hotplug command
	names were completely wrong.

	* src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_text.c: Fix
	  the CPU hotplug command names

2010-04-23  Daniel P. Berrange  <berrange@redhat.com>

	Fix printing of event detail in python events demo program
	The events demo program is slightly misleading printing

	  myDomainEventCallback1 EVENT: Domain f14i686(-1) Added

	which is not distinguishing Add vs Update events. It should have
	been doing

	  myDomainEventCallback1 EVENT: Domain f14i686(-1) Defined Updated

	* examples/domain-events/events-python/event-test.py: Fully print
	  event detail info string

2010-04-22  Dustin Kirkland  <kirkland@canonical.com>

	portability fixes to tools/virt-pki-validate.in
	A few fixes will help make tools/virt-pki-validate.in useful on Debian
	and Ubuntu.  And one fix should be useful to everyone (see #3).

	 1) note our gnutls-bin package (in addition to your gnutls-utils
	package) in the no-certtool error text

	 2) fix a bashism, == should be = in the case where /bin/sh is a symlink
	to dash

	 3) $(SYSCONFDIR) cannot evaluate; set a single shell SYSCONFDIR
	variable to the autoconf @SYSCONFDIR@ value, and use $SYSCONFDIR
	everywhere

	Bug report:
	 * https://bugs.edge.launchpad.net/ubuntu/+source/libvirt/+bug/562266

2010-04-22  Eric Blake  <eblake@redhat.com>

	maint: enforce whitespace on shell scripts
	Noticed because virt-pki-validate was very inconsistent on
	using tabs vs. 8 spaces, sometimes mixing both paradigms on
	a single line.

	'git diff -b' shows significant changes only in cfg.mk.

	* cfg.mk (sc_TAB_in_indentation): Add a few files.
	* daemon/libvirtd.init.in: Avoid tabs.
	* tools/virt-pki-validate.in: Likewise.

2010-04-22  Eric Blake  <eblake@redhat.com>

	testutilsqemu: avoid uninitialized variable
	* tests/testutilsqemu.c (testQemuCapsInit): Initialize variables.

2010-04-22  Jiri Denemark  <jdenemar@redhat.com>

	Fake host CPU for qemu tests

	Use configured CPU model if possible
	Adds ability to provide a preferred CPU model for CPUID data decoding.
	Such model would be considered as the best possible model (if it's
	supported by hypervisor) regardless on number of features which have to
	be added or removed for describing required CPU.

2010-04-22  Jiri Denemark  <jdenemar@redhat.com>

	Support removing features when converting data to CPU
	So far, when CPUID data were converted into CPU model and features, the
	features can only be added to the model. As a result, when a guest asked
	for something like "qemu64,-svm" it would get a qemu32 plus a bunch of
	additional features instead.

	This patch adds support for removing feature from the base model.
	Selection algorithm remains the same: the best CPU model is the model
	which requires lowest number of features to be added/removed from it.

2010-04-22  Jiri Denemark  <jdenemar@redhat.com>

	Move MIN macro to util.h so that others can use it

	Deal with CPU models in []
	Qemu committed a patch which list some CPU names in [] when asked for
	supported CPUs (qemu -cpu ?). Yet, it needs such CPUs to be passed
	without those square braces. When probing for supported CPU models, we
	can just strip the square braces and pretend we have never seen them.

	Fix initial VCPU pinning in qemu driver
	First, inital VCPU pinning is set correctly but then it is reset by
	assigning qemu process to a new cgroup (which contains all CPUs). It's
	easily fixed by swapping these two actions.

2010-04-22  Eric Blake  <eblake@redhat.com>

	maint: ignore 'make syntax-check' failure files
	* .gitignore: Add exemption.
	* cfg.mk (local-checks-to-skip): Ignore a test to silence a skip
	warning.

2010-04-22  Chris Lalancette  <clalance@redhat.com>

	Make avahi startup more robust.
	If the hostname of the current virtualization machine
	could not be resolved, then libvirtd would fail to
	start.  However, for disconnected operation (on a laptop,
	for instance) the hostname may very legitimately not
	be resolvable.  This patch makes it so that if we can't
	resolve the hostname, avahi doesn't fail, it just uses
	a less useful MDNS string.

2010-04-22  Guido Günther  <agx@sigxcpu.org>

	Ignore empty type attribute in driver element of virtual disks
	Fixes http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=578347

2010-04-22  Eric Blake  <eblake@redhat.com>

	build: fix preprocessor indentation
	* src/esx/esx_vi.h: Placate cppi.

2010-04-21  Chris Wong  <wongc-redhat@hoku.net>

	esx: Don't treat an empty root snapshot list as error
	An empty root snapshot list was considered as error condition. Creating a
	new snapshot would fail if the domain didn't have snapshots yet, because
	the snapshot-create function tries to lookup the list of existing snapshots
	in order to verify that the snapshot name is unique. This fails if the
	domain doesn't have snapshots yet.

	Removing the NULL check from esxVI_LookupRootSnapshotTreeList fixes this.

2010-04-21  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Gather some XML generation macros in esx_vi.h

	esx: Fix FindByIp response handling
	FindByIp may return nothing if there is no host or virtual machine
	with the given IP address. Handle that case properly.

	esx: Fix virtualHW.version generation
	The supported virtualHW.version doesn't depend on the API version,
	but on the product version.

2010-04-21  Stefan Berger  <stefanb@us.ibm.com>

	nwfilter: add support for connlimit match
	This patch adds support for the connlimit match in iptables that is used
	to limit the number of outgoing directions.

	Extend fwall-drv interface and call functions via interface
	I am moving some of the eb/iptables related functions into the interface
	of the firewall driver and am making them only accessible via the driver's
	interface. Otherwise exsiting code is adapted where needed. I am adding one
	new function to the interface that checks whether the 'basic' rules can be
	applied,  which will then be used by a subsequent patch.

2010-04-21  Eric Blake  <eblake@redhat.com>

	build: avoid compiler warning
	According to GCC, ATTRIBUTE_UNUSED means that an attribute _might_
	be unused, not _must_ be unused.  Therefore, it is easier to
	blindly mark a variable, than to try and do preprocessor limiting
	of when we know it is unused.

	* src/remote/remote_driver.c (remoteAuthenticate): Mark attribute
	as potentially unused.
	Reported by Gustovo Morozowski.

2010-04-21  Matthias Bolte  <matthias.bolte@googlemail.com>

	Explicitly set virStoragePoolTypeInfo FS and NETFS defaults
	No semantic change, the now explicitly set default are all zero and
	that's what GCC sets unspecified struct members to.

	esx: Add support for the VMXNET 2 (Enhanced) NIC model
	Add a test case and document it.

	Mark in_open parameter of remoteAuthenticate as unused when it's unused
	Otherwise compiling with -Werror will fail.

2010-04-20  Philipp Hahn  <hahn@univention.de>

	Install nwfilter xml files from source directory.
	During an out-of-tree build, the current working directory is the build
	directory. Since the FILTERS are static and not modified or
	auto-generated during the build process, they need to be explicitly
	fetched from the source directory during install.

	Prefix the files with $(srcdir), which gets expanded to the absolute or
	relative path to the source directory, even when duing out-of-tree
	builds.

2010-04-20  Philipp Hahn  <hahn@univention.de>

	Don't ship generated python/libvirt.? files.
	libvirt.c and libvirt.h are auto-generated files. Mentioning their names
	in *_SOURCES includes them in the distribution. During an out-of-tree
	build these shipped files are included instead of the auto-generated
	version, potentially breaking the build (as it happend in 0.8.0, because
	the shipped libvirt.h was missing the declaration for
	'libvirt_virDomainUpdateDeviceFlags')

	Use the nodist_*_SOURCES automake variable instead.

2010-04-20  Daniel P. Berrange  <berrange@redhat.com>

	Fixup python binding for virDomainSnapshot APIs
	The generator code was totally wrong for the virDomainSnapshot
	APIs, not generating the wrapper class, and giving methods the
	wrong names

	* generator.py: Set metadata for virDomainSnapshot type & APIs
	* libvirt-override-api.xml, libvirt-override.c: Hand-code the
	  virDomainSnapshotListNames glue layer

2010-04-19  Daniel P. Berrange  <berrange@redhat.com>

	Fix network hotplug to use device_add in QEMU
	The initial boot of VMs uses -device for NICs where available. The
	corresponding monitor command is device_add, but the network hotplug
	code was still using device_del by mistake.

	* src/qemu/qemu_driver.c: Use device_add for NIC hotplug where
	  available

2010-04-19  Daniel P. Berrange  <berrange@redhat.com>

	Fix error reporting for getfd + host_net_add in QEMU
	If either of the getfd or host_net_add monitor commands return
	any text, this indicates an error condition. Don't ignore this!

	* src/qemu/qemu_monitor_text.c: Report errors for getfd and
	  host_net_add

2010-04-19  Daniel P. Berrange  <berrange@redhat.com>

	Fix device_del in JSON mode for QEMU
	The 'device_del' command expects a parameter called 'id' but we
	were passing 'config'.

	* src/qemu/qemu_monitor_json.c: Fix device_del command parameter

2010-04-18  Matthias Bolte  <matthias.bolte@googlemail.com>

	nwfilter: Free nwfilter hash of virConnectPtr
	And close the driver on connection close.

2010-04-17  Matthias Bolte  <matthias.bolte@googlemail.com>

	Replace printf with logging macros

2010-04-17  Jiri Denemark  <jdenemar@redhat.com>

	Mark internal.h for translation

2010-04-16  Jiri Denemark  <jdenemar@redhat.com>

	Use virCheckFlags for APIs added in 0.8.0

2010-04-16  Jiri Denemark  <jdenemar@redhat.com>

	Introduce virCheckFlags for consistent flags checking
	The idea is that every API implementation in driver which has flags
	parameter should first call virCheckFlags() macro to check the function
	was called with supported flags:

	    virCheckFlags(VIR_SUPPORTED_FLAG_1 |
	                  VIR_SUPPORTED_FLAG_2 |
	                  VIR_ANOTHER_SUPPORTED_FLAG, -1);

	The error massage which is printed when unsupported flags are passed
	looks like:

	    invalid argument in virFooBar: unsupported flags (0x2)

	Where the unsupported flags part only prints those flags which were
	passed but are not supported rather than all flags passed.

2010-04-16  Stefan Berger  <stefanb@us.ibm.com>

	nwfilter: Clear all state tracking from a drop rule
	Don't use state-matching in a drop rule.

2010-04-16  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Replace scanf with STRSKIP and strtok_r
	This also fixes a portability problem with the %a format modifier.
	%a is not portable and made esxDomainDumpXML fail at runtime in
	MinGW builds.

2010-04-16  Matthias Bolte  <matthias.bolte@googlemail.com>

	Update to latest gnulib to get strtok_r relaxed to LGPLv2+
	strtok_r will be used in the ESX driver to replace scanf-based code.

	MinGW lacks strtok_r, so we need gnulib to provide it, but until now
	strtok_r was licensed LGPL3.

2010-04-16  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Add nwfilter driver stub
	This stops libvirt trying to connect to a non-existing libvirtd on the
	ESX server in order to find a nwfilter driver.

2010-04-16  Eric Blake  <eblake@redhat.com>

	remote: react to failures on wakeupFD
	* src/remote/remote_driver.c (remoteIO, remoteIOEventLoop): Report
	failures on pipe used for wakeup.
	Reported by Chris Lalancette.

2010-04-16  Eric Blake  <eblake@redhat.com>

	util: ensure safe{read,write,zero} return is checked
	Based on a warning from coverity.  The safe* functions
	guarantee complete transactions on success, but don't guarantee
	freedom from failure.

	* src/util/util.h (saferead, safewrite, safezero): Add
	ATTRIBUTE_RETURN_CHECK.
	* src/remote/remote_driver.c (remoteIO, remoteIOEventLoop): Ignore
	some failures.
	(remoteIOReadBuffer): Adjust error messages on read failure.
	* daemon/event.c (virEventHandleWakeup): Ignore read failure.

2010-04-16  Eric Blake  <eblake@redhat.com>

	maint: another preprocessor fix
	Regression introduced in commit 62170b995.

	* src/util/memory.h: Placate cppi, and fit 80 columns.

2010-04-16  Daniel P. Berrange  <berrange@redhat.com>

	Fix CDROM media change for QEMU when using -device syntax
	Disk devices in QEMU have two parts, the guest device and the host
	backend driver. Historically these two parts have had the same
	"unique" name. With the switch to using -device though, they now
	have separate names. Thus when changing CDROM media, for guests
	using -device syntax, we need to prepend the QEMU_DRIVE_HOST_PREFIX
	constant

	* src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Add helper function
	  qemuDeviceDriveHostAlias() for building a host backend alias
	* src/qemu/qemu_driver.c: Use qemuDeviceDriveHostAlias() to determine
	  the host backend alias for performing eject/change commands in the
	  monitor

2010-04-16  Daniel P. Berrange  <berrange@redhat.com>

	Update QEMU device_add command in JSON mode
	The device_add command was added in JSON mode in a way I didn't
	expect. Instead of passing the normal device string to the JSON
	command:

	    { "execute": "device_add", "arguments": { "device": "ne2k_pci,id=nic.1,netdev=net.1" } }

	We need to split up the device string into a full JSON object

	    { "execute": "device_add", "arguments": { "driver": "ne2k_pci", "id": "nic.1", "netdev": "net.1" } }

	* src/qemu/qemu_conf.h, src/qemu/qemu_conf.c: Rename the
	  qemuCommandLineParseKeywords method to qemuParseKeywords
	  and export it to monitor
	* src/qemu/qemu_monitor_json.c: Split up device string into
	  a JSON object for device_add command

2010-04-16  Daniel P. Berrange  <berrange@redhat.com>

	Rename parameter in qemuMonitorDeviceDel
	The parameter for the qemuMonitorDeviceDel() is a device alias,
	not a device config string. Rename the parameter reflect this
	and avoid confusion to readers.

	* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
	  src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h,
	  src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h:
	  Rename devicestr to devalias in qemuMonitorDeviceDel()

2010-04-16  Daniel P. Berrange  <berrange@redhat.com>

	Remove code from JSON monitor for commands that won't be ported
	The QEMU developers have stated that they will not be porting
	the commands 'pci_add', 'pci_del', 'usb_add', 'usb_del' to the
	JSON mode monitor, since they're obsoleted by 'device_add'
	and 'device_del'. libvirt has (untested) code that would have
	supported those commands in theory, but since we already use
	device_add/del where available, there's no need to keep the
	legacy stuff anymore.

	The text mode monitor keeps support for all commands for sake
	of historical compatability.

	* src/qemu/qemu_monitor_json.c: Remove 'pci_add', 'pci_del',
	  'usb_add', 'usb_del' commands

2010-04-16  Daniel P. Berrange  <berrange@redhat.com>

	Run test suite as part of RPM build process
	To ensure that patches in the RPM don't break any functionality
	it is neccessary to run the test suites during build. It currently
	has 3 tests disabled

	 - daemon-conf: this is totally broken, since it relies on
	   being able to resolve the 'libvirt' group & being able to
	   resolve hostnames at daemon startup. This isn't possible
	   in a mock build root
	 - seclabeltest: fails to initialize selinux in the mock
	   build root. Possibly fixable
	 - nodeinfotest: broken on s390 + ppc - this is a real bug

	* libvirt.spec.in: Add a %check section, with 3 tests
	   temporarily disabled

2010-04-16  Daniel P. Berrange  <berrange@redhat.com>

	Fix QEMU memory stats JSON mode
	The QEMU driver is mistakenly calling directly into the text
	mode monitor for the domain memory stats query.

	* src/qemu/qemu_driver.c: Replace qemuMonitorTextGetMemoryStats with
	  qemuMonitorGetMemoryStats
	* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add the new
	  wrapper for qemuMonitorGetMemoryStats
	* src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h: Add
	  qemuMonitorJSONGetMemoryStats implementation

2010-04-16  Daniel P. Berrange  <berrange@redhat.com>

	Fix QEMU command building errors to reflect unsupported configuration
	Instead of reporting VIR_ERR_INTERNAL_ERROR use the more specific
	VIR_ERR_CONFIG_UNSUPPORTED

	* src/qemu/qemu_conf.c: Report VIR_ERR_CONFIG_UNSUPPORTED for
	  unsupported video adapters

2010-04-15  Stefan Berger  <stefanb@us.ibm.com>

	nwfilter: fix tear down order and consolidate functions
	To avoid race-conditions, the tear down of a filter has to happen before
	the tap interface disappears and another tap interface with the same
	name can re-appear. This patch tries to fix this. In one place, where
	communication with the qemu monitor may fail, I am only tearing the
	filters down after knowing that the function did not fail.

	I am also moving the tear down functions into an include file for other
	drivers to reuse.

2010-04-15  Stefan Berger  <stefanb@us.ibm.com>

	Trivial fix: Add braces to for statement to avoid crashes
	I am adding braces around the for statement that are now needed to due the
	new sa_assert immediately following the for statement.

2010-04-15  Matthias Bolte  <matthias.bolte@googlemail.com>

	Fix close_used_without_including_unistd_h error
	Triggered by gnulib when compiling with MinGW.

	Fix apibuild.py warnings about missing ':'

2010-04-14  David Allan  <dallan@redhat.com>

	Implement variable length structure allocator
	* This patch implements a memory allocator to obtain memory for
	  structures whose last member is a variable length array.  C99 refers
	  to these variable length objects as structs containing flexible
	  array members.
	* Fixed macro parentheses per Eric Blake

2010-04-15  Jim Meyering  <meyering@redhat.com>

	qemudDomainAttachSCSIDisk: avoid FP NULL-ptr-deref from clang
	* src/util/conf.c (virConfParseValue): Add an sa_assert.

	xend_internal.c: assure clang that we do not dereference NULL
	* src/xen/xend_internal.c (xend_parse_sexp_desc_char): Add three
	uses of sa_assert, each preceding a strchr(value,... to assure
	clang that "value" is non-NULL.

	qemudDomainAttachSCSIDisk: avoid FP NULL-ptr-deref from clang
	* src/qemu/qemu_driver.c (qemudDomainAttachSCSIDisk):
	Initialize "cont" to NULL, so clang knows it's set.
	Add an sa_assert so it knows it's non-NULL when dereferenced.

	virGetHostnameLocalhost: avoid FP NULL-ptr-deref from clang
	* src/util/util.c (virGetHostnameLocalhost): Add an sa_assert
	to tell clang it's ok to dereference "info" after a non-failing
	getaddrinfo call.

	nwfilter_ebiptables_driver.c: avoid NULL dereference
	* src/nwfilter/nwfilter_ebiptables_driver.c (ebiptablesApplyNewRules):
	Don't dereference a NULL or uninitialized pointer when given
	an empty list of rules.  Add an sa_assert(inst) in each loop to
	tell clang that the uses of "inst[i]" are valid.

	build: set STATIC_ANALYSIS when running via clang or coverity
	* configure.ac (STATIC_ANALYSIS): Define when run via clang's
	scan-build or coverity-prevent's cov-build.
	Use the CLANG_CC and COVERITY_BUILD_COMMAND envvars as witnesses.

	sa_assert: assert-like macro, enabled only for use with static analyzers
	Among some here, there is a strong aversion to the use of "assert", yet
	some others think it is essential (when applied judiciously) even --
	perhaps "especially" -- at the heart of libraries and core hypervisor-
	related code.
	Here is a compromise that lets us make assertions about the code (e.g.,
	to tell static analyzers about invariants) without even a hint of risk
	of an abort.
	* src/internal.h [STATIC_ANALYSIS]: Include <assert.h>.
	(sa_assert): Define.  A no-op most of the time, but equivalent
	to classical assert when STATIC_ANALYSIS is nonzero.

2010-04-15  Eric Blake  <eblake@redhat.com>

	build: fix recent 'make syntax-check' failure
	* src/esx/esx_vi_methods.h: Placate cppi.

	virt-aa-helper-test: avoid non-portable echo -n
	* tests/virt-aa-helper-test (testme): Use printf instead.

2010-04-14  Jim Meyering  <meyering@redhat.com>

	schematestutils.sh: improve shell portability: avoid "echo -e"
	* tests/schematestutils.sh: Use printf rather than echo -e.

	virStorageBackendFileSystemMount: prefer strdup over virAsprintf
	* src/storage/storage_backend_fs.c (virStorageBackendFileSystemMount):
	Use virAsprintf only when needed.  In this case, strdup works fine.

	virStorageBackendFileSystemMount: placate clang
	* src/storage/storage_backend_fs.c (virStorageBackendFileSystemMount):
	Clang was not smart enough, and mistakenly reported that "options"
	could be used uninitialized.  Initialize it.

2010-04-14  Laine Stump  <laine@laine.org>

	Implement forgotten backend of virInterfaceIsActive()
	Somehow the backend of this function was never implemented in
	libvirt's netcf driver, and nobody noticed until now. (The required
	netcf function was already in place, so nothing needs to change
	there.)
	* src/interface/netcf_driver.c: add in the backend function, and point
	                                to it from the table of driver functions.

2010-04-14  Jim Meyering  <meyering@redhat.com>

	openvzGetProcessInfo: address clang-detected low-probability flaw
	* src/openvz/openvz_driver.c (openvzGetProcessInfo): Reorganize
	so that unexpected /proc/vz/vestat content cannot make us use
	uninitialized variables.  Without this change, an input line with
	a matching "readvps", but fewer than 4 numbers would result in our
	using at least "systime" uninitialized.

	vshCommandRun: avoid used-uninitialized timing-related report from clang
	* tools/virsh.c (vshCommandRun): Test only the initial value of
	ctl->timing, so that static analyzers don't have to consider that
	it might be changed by cmd->def->handler.

2010-04-14  Stefan Berger  <stefanb@us.ibm.com>

	nwfilter: use virFindFileInPath for needed CLI tools
	I am getting rid of determining the path to necessary CLI tools at
	compile time. Instead, now the firewall driver has an initialization
	function that uses virFindFileInPath() to determine the path to
	necessary CLI tools and a shutdown function to free allocated memory.
	The rest of the patch mostly deals with availability of the CLI tools
	and to not call certain code blocks if a tool is not available and that
	strings now have to be built slightly differently.

2010-04-14  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Extend esx_vi_generator.py to cover methods too
	Generate almost all SOAP method mapping code.

	Update the driver code to use the complete paramater list of some methods
	that had parameters skipped before.

	Improve the ESX_VI__METHOD marco to do automatic output deserialization
	based on output occurrence. Also incorporate automatic _this binding and
	output pointer check.

2010-04-14  Jim Meyering  <meyering@redhat.com>

	esxVMX_GatherSCSIControllers: avoid NULL dereference
	* src/esx/esx_vmx.c (esxVMX_GatherSCSIControllers): Do not dereference
	a NULL disk->driverName.  We already detect this condition in another
	case.  Check for it here, too.

2010-04-14  Chris Lalancette  <clalance@redhat.com>

	Fix build of openvz on RHEL-5.
	When building libvirt on RHEL-5, I saw this error:

	cc1: warnings being treated as errors
	openvz/openvz_conf.c: In function 'openvzGetVPSUUID':
	openvz/openvz_conf.c:835: warning: 'saveptr' may be used uninitialized in this function
	make[3]: *** [libvirt_driver_openvz_la-openvz_conf.lo] Error 1

	gcc in RHEL-5 gets upset about this usage of strtok_r (even though
	it is perfectly valid).  Just set *saveptr to NULL at the
	start to quiet it down.

2010-04-14  Chris Lalancette  <clalance@redhat.com>

	Fix up formatting of remote protocol stuff.

	Fix messsage -> message.

	Fix up a debug typo.

	Remove some debugging leftovers.

2010-04-13  Stefan Berger  <stefanb@us.ibm.com>

	Consolidate interface related functions in interface.c
	Changes from v1 to v2:
	- changed function name prefixes to 'iface' from previous 'Iface'

	- Further to make make syntax-check pass:
	 - indentation fix in interface.h
	 - added entry to POTFILES.in

	I am consolidating network interface related functions used in nwfilter
	and macvtap code in utils/interface.c. All function names are prefixed
	with 'Iface'. The following functions are now available through
	interface.h:

	int ifaceCtrl(const char *name, bool up);
	int ifaceUp(const char *name);
	int ifaceDown(const char *name);

	int ifaceCheck(bool reportError, const char *ifname,
	               const unsigned char *macaddr, int ifindex);

	int ifaceGetIndex(bool reportError, const char *ifname, int *ifindex);

	I added 'int ifindex' as parameter to ifaceCheck to the original
	function and modified the code accordingly.

2010-04-13  Daniel P. Berrange  <berrange@redhat.com>

	Fix nodeinfotest on NUMA machines
	The nodeinfotest was reliant on the host NUMA topology, but all
	the test data files assumed 1 single NUMA node. This test thus
	failed on any NUMA machine with > 1 node

	* tests/nodeinfotest.c: Hardcode 1 single numa node

2010-04-13  Eric Blake  <eblake@redhat.com>

	build: include usleep gnulib module
	Without this module, attempts to sleep for 1 or more seconds
	on mingw instead become a no-delay no-op.

	* bootstrap.conf (gnulib_modules): Add usleep.

2010-04-13  Daniel Berteaud  <daniel@firewall-services.com>

	Fix spec file for builds without lxc
	* libvirt.spec.in: fix a cut and paste error

2010-04-13  Eric Blake  <eblake@redhat.com>

	build: fix syntax-check problems
	* .x-sc_prohibit_gettext_noop: Add new exemption.
	* .x-sc_prohibit_test_minus_ao: Likewise.
	* Makefile.am (EXTRA_DIST): Distribute new files.
	* .gitignore: Ignore built file.

2010-04-13  Stefan Berger  <stefanb@us.ibm.com>

	add nwfilter functions to virsh man page
	With Eric Blake's spelling corrections applied.

	Unfortunately after the 0.8.0 release, but here's a beginning of the
	documentation of the nwfilter functionality.

2010-04-13  Daniel Veillard  <veillard@redhat.com>

	Release of libvirt-0.8.0
	* configure.ac docs/news.html.in libvirt.spec.in src/libvirt_public.syms:
	  updates for release of 0.8.0
	* po/*.po po/libvirt.pot: updated a lar set of localizations, and merge
	  the messages

	Add documentation for synchronous hooks
	* docs/sitemap.html.in: add in navigation under
	  Documentation/Deployment/Hooks
	* docs/hooks.html.in: new doc describing current support for 0.8.0

2010-04-12  Chris Lalancette  <clalance@redhat.com>

	Rename virsh "revert-to-snapshot" to "snapshot-revert"

2010-04-12  Luiz Capitulino  <lcapitulino@redhat.com>

	Small fixes to virsh man page
	* tools/virsh.pod: add two missing 's' and section about 'dominfo' is
	  duplicated

2010-04-12  Stefan Berger  <stefanb@us.ibm.com>

	nwfilter: Fix memory leak on daemon init and shutdown
	This patch fixes a memory leak on daemon init and shutdown. The module
	was initialized twice and not shut down.

2010-04-10  Stefan Berger  <stefanb@us.ibm.com>

	nwfilter: Process DHCP option to determine whether packet is a DHCP_OFFER
	I mistakenly took the op field in the DHCP message as the DHCP_OFFER
	type. Rather than basing the decision to read the VM's IP address on
	that field, process the appended DHCP options where option 53 indicates
	the actual type of the packet. I am also reading the broadcast address
	of the VM, but don't use it so far.

2010-04-09  David Allan  <dallan@redhat.com>

	Add enospace option to qemu disk error policy
	* Dan Kenigsberg requested explicit support for the qemu default disk error policy which is enospace

2010-04-09  Daniel P. Berrange  <berrange@redhat.com>

	More event callback fixes
	In a couple of cases typos meant we were firing the wrong type
	of event. In the python code my previous commit accidentally
	missed some chunks of the code.

	* python/libvirt-override-virConnect.py: Add missing python glue
	  accidentally left out of previous commit
	* src/conf/domain_event.c, src/qemu/qemu_monitor_json.c: Fix typos
	  in event name / method name to invoke

2010-04-09  Stefan Berger  <stefanb@us.ibm.com>

	Undoing 2nd application of the patch...

	Fix error in nwfilter test driver
	Trivial fix for the c&p error in the nwfilter test driver.

	Fix error in nwfilter test driver
	Trivial fix for the c&p error in the nwfilter test driver.

2010-04-09  Daniel Veillard  <veillard@redhat.com>

	Fix some cppi prepocessor indentation issues
	* src/conf/nwfilter_conf.c src/util/hooks.c: added spaces to avoid
	  "make syntax-check" failures

2010-04-09  Ryan Harper  <ryanh@us.ibm.com>

	qemu: catch cdrom change error
	Currently when we attempt to change the cdrom in a qemu VM the monitor
	doesn't generate an error if the target filename doesn't exist.  I've
	submitted a patch[1] for this.  This patch is the libvirt qemu-driver
	side which catches the error message from the monitor and reportes the
	error to libvirt.  This means that virsh attach-disk cdrom commands
	won't appear to succeed when qemu change command actually failed.

	* src/qemu/qemu_monitor_text.c: in qemuMonitorTextChangeMedia() look
	  for failure to access the new data

2010-04-09  redshift  <redshift@gmx.com>

	Avoid using multicast addresses for Ethernet MAC examples
	* docs/formatdomain.html.in: use '00:11:22:33:44:55' instead of
	  '11:22:33:44:55:66'

2010-04-09  Stefan Berger  <stefanb@us.ibm.com>

	nwfilter: More XML parser test cases
	This patch adds a couple more nwfilter test cases for the XML parser tests.

2010-04-09  Matthias Bolte  <matthias.bolte@googlemail.com>

	Cleanup the msg_gen_function list in cfg.mk
	Remove symbols that don't exist anymore (e.g. ERROR0) or aren't
	message generating functions (e.g. VIR_FREE) or are now reported
	as unmarked because the grep command is different, but that should
	not be marked at all (e.g. DEBUG0).

	Also don't restrict one of the grep lines in the
	libvirt_unmarked_diagnostics rule to match exactly one space
	between function name and opening parenthesis.

2010-04-09  Matthias Bolte  <matthias.bolte@googlemail.com>

	remote: Replace some virRaiseError with remoteError

	remote: Remove virConnectPtr from error/errorf
	Also unify error/errorf to remoteError and update cfg.mk accordingly.

	Remove undefined symbols from symbols file

2010-04-09  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Add domain snapshot support
	Fix invalid code generating in esx_vi_generator.py regarding deep copy
	types that contain enum properties.

	Add strptime and timegm to bootstrap.conf. Both are used to convert a
	xsd:dateTime to calendar time.

	Add a testcase of the xsd:dateTime conversion.

2010-04-09  Matthias Bolte  <matthias.bolte@googlemail.com>

	Generate libvirt.def from libvirt.syms
	The MinGW linker needs the libvirt.def file.

2010-04-08  Jiri Denemark  <jdenemar@redhat.com>

	Fix unterminated B<...> in virsh man page

2010-04-08  Daniel P. Berrange  <berrange@redhat.com>

	Fix up python bindings for new event callbacks
	The generator was disabled for the new event callbacks, since they
	need to be hand written. This patch  adds the C and python glue to
	expose the new APIs in the python binding. The python example
	program is extended to demonstrate of the code

	* python/libvirt-override.c: Registration and dispatch of events
	   at the C layer
	* python/libvirt-override-virConnect.py: Python glue for events
	* examples/domain-events/events-python/event-test.py: Demo use
	  of new event callbacks

2010-04-08  Daniel P. Berrange  <berrange@redhat.com>

	Add missing nwfilter_learnipaddr.c to POTFILES.in
	* po/POTFILES.in: Add src/nwfilter/nwfilter_learnipaddr.c

2010-04-08  Daniel P. Berrange  <berrange@redhat.com>

	Fix Win32 portability problems
	The network filter / snapshot / hooks code introduced some
	non-portable pices that broke the win32 build

	* configure.ac: Check for net/ethernet.h required by nwfile config
	   parsing code
	* src/conf/nwfilter_conf.c: Define ethernet protocol  constants
	  if net/ethernet.h is missing
	* src/util/hooks.c: Disable hooks build on Win32 since it lacks
	  fork/exec/pipe
	* src/util/threads-win32.c: Fix unchecked return value
	* tools/virsh.c: Disable SIGPIPE on Win32 since it doesn't exist.
	  Fix non-portable strftime() formats

2010-04-08  Stefan Berger  <stefanb@us.ibm.com>

	nwfilter: fix for directionality of ICMP traffic
	Changes from V1 to V2 of this patch
	- I had reversed the logic thinking that icmp type 0 is a echo
	request,but it's reply -- needed to reverse the logic
	- Found that ebtables takes the --ip-tos argument only as a hex number

	This patch enables the skipping of some of the ICMP traffic rules on the
	iptables level under certain circumstances so that the following filter
	properly enables unidirectional pings:

	<filter name='testcase'>
	    <uuid>d6b1a2af-def6-2898-9f8d-4a74e3c39558</uuid>
	    <!-- allow incoming ICMP Echo Request -->
	    <rule action='accept' direction='in' priority='500'>
	        <icmp type='8'/>
	    </rule>
	    <!-- allow outgoing ICMP Echo Reply -->
	    <rule action='accept' direction='out' priority='500'>
	        <icmp type='0'/>
	    </rule>
	    <!-- drop all other ICMP traffic -->
	    <rule action='drop' direction='inout' priority='600'>
	        <icmp/>
	    </rule>
	</filter>

2010-04-08  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Allow 'lsisas1068' as SCSI controller type
	Extend tests to cover all SCSI controller types and document the
	new type.

	The lsisas1068 SCSI controller type was added in ESX 4.0. The VMX
	parser reports an error when this controller type is present. This
	makes virsh dumpxml fail for every domain that uses this controller
	type.

	This patch fixes this and adds lsisas1068 to the list of accepted
	SCSI controller types.

	Reported by Jonathan Kelley.

2010-04-08  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Report an error for invalid arguments in esxList(Defined)Domains

2010-04-08  Diego Elio Pettenò  <flameeyes@gmail.com>

	Avoid searching for windres when not building for Windows
	Just checking for a windres tool might hit even on Linux systems when
	building for Linux (e.g.: when using Gentoo and having built binutils
	with multitarget support), and will then fail to link properly at the
	end of the build.

	* configure.ac: Avoid searching for windres on non windows target

2010-04-08  Stefan Berger  <stefanb@us.ibm.com>

	Executable does not belong into repository.
	Removing the tests/nwfilterxml2xmltest executable that got in with a previous patch.

2010-04-08  Stefan Berger  <stefanb@us.ibm.com>

	nwfilter: Support for learning a VM's IP address
	This patch implements support for learning a VM's IP address. It uses
	the pcap library to listen on the VM's backend network interface (tap)
	or the physical ethernet device (macvtap) and tries to capture packets
	with source or destination MAC address of the VM and learn from DHCP
	Offers, ARP traffic, or first-sent IPv4 packet what the IP address of
	the VM's interface is. This then allows to instantiate the network
	traffic filtering rules without the user having to provide the IP
	parameter somewhere in the filter description or in the interface
	description as a parameter. This only supports to detect the parameter
	IP, which is for the assumed single IPv4 address of a VM. There is not
	support for interfaces that may have multiple  IP addresses (IP
	aliasing) or IPv6 that may then require more than one valid IP address
	to be detected. A VM can have multiple independent interfaces that each
	uses a different IP address and in that case it will be attempted to
	detect each one of the address independently.

	So, when for example an interface description in the domain XML has
	looked like this up to now:

	    <interface type='bridge'>
	      <source bridge='mybridge'/>
	      <model type='virtio'/>
	      <filterref filter='clean-traffic'>
	        <parameter name='IP' value='10.2.3.4'/>
	      </filterref>
	    </interface>

	you may omit the IP parameter:

	    <interface type='bridge'>
	      <source bridge='mybridge'/>
	      <model type='virtio'/>
	      <filterref filter='clean-traffic'/>
	    </interface>

	Internally I am walking the 'tree' of a VM's referenced network filters
	and determine with the given variables which variables are missing. Now,
	the above IP parameter may be missing and this causes a libvirt-internal
	thread to be started that uses the pcap library's API to listen to the
	backend interface  (in case of macvtap to the physical interface) in an
	attempt to determine the missing IP parameter. If the backend interface
	disappears the thread terminates assuming the VM was brought down. In
	case of a macvtap device a timeout is being used to wait for packets
	from the given VM (filtering by VM's interface MAC address). If the VM's
	macvtap device disappeared the thread also terminates. In all other
	cases it tries to determine the IP address of the VM and will then apply
	the rules late on the given interface, which would have happened
	immediately if the IP parameter had been explicitly given. In case an
	error happens while the firewall rules are applied, the VM's backend
	interface is 'down'ed preventing it to communicate. Reasons for failure
	for applying the network firewall rules may that an ebtables/iptables
	command failes or OOM errors. Essentially the same failure reasons may
	occur as when the firewall rules are applied immediately on VM start,
	except that due to the late application of the filtering rules the VM
	now is already running and cannot be hindered anymore from starting.
	Bringing down the whole VM would probably be considered too drastic.
	While a VM's IP address is attempted to be determined only limited
	updates to network filters are allowed. In particular it is prevented
	that filters are modified in such a way that they would introduce new
	variables.

	A caveat: The algorithm does not know which one is the appropriate IP
	address of a VM. If the VM spoofs an IP address in its first ARP traffic
	or IPv4 packets its filtering rules will be instantiated for this IP
	address, thus 'locking' it to the found IP address. So, it's still
	'safer' to explicitly provide the IP address of a VM's interface in the
	filter description if it is known beforehand.

	* configure.ac: detect libpcap
	* libvirt.spec.in: require libpcap[-devel] if qemu is built
	* src/internal.h: add the new ATTRIBUTE_PACKED define
	* src/Makefile.am src/libvirt_private.syms: add the new modules and symbols
	* src/nwfilter/nwfilter_learnipaddr.[ch]: new module being added
	* src/nwfilter/nwfilter_driver.c src/conf/nwfilter_conf.[ch]
	  src/nwfilter/nwfilter_ebiptables_driver.[ch]
	  src/nwfilter/nwfilter_gentech_driver.[ch]: plu the new functionality in
	* tests/nwfilterxml2xmltest: extend testing

2010-04-08  Jim Meyering  <meyering@redhat.com>

	xenXMDomainDefineXML: remove dead store and useless/leaky virGetDomain
	* src/xen/xm_internal.c (xenXMDomainDefineXML): Remove useless and
	leak-inducing call to virGetDomain, as well as decl of now-unused local.

	createRawFileOpHook: avoid dead stores
	* src/storage/storage_backend.c (createRawFileOpHook): Remove dead
	stores and declaration of each stored-to variable.

	qemudDomainGetSecurityLabel: avoid dead store to "type"
	* src/qemu/qemu_driver.c (qemudDomainGetSecurityLabel): Remove store
	and declaration.

2010-04-08  Jiri Denemark  <jdenemar@redhat.com>

	Fix CPU comparison for x86 arch
	When comparing a CPU to host CPU, the result would be
	VIR_CPU_COMPARE_SUPERSET (or even VIR_CPU_COMPARE_INCOMPATIBLE if strict
	match was required) even though the two CPUs were identical.

	Cleanup x86Compute()
	No change in semantics.

	Properly advertise cpuselection guest capability
	There's no sense in advertising cpuselection capability when host CPU
	is not properly detected and advertised in host capabilities.

	Don't ignore guest CPU selection when unsupported by HV
	When qemu libvirt driver doesn't support guest CPU selection with given
	qemu binary, guests requiring specific CPU should fail to start instead
	of being silently supplied with a default CPU.

	Document all options of virsh dumpxml

2010-04-08  Jim Meyering  <meyering@redhat.com>

	qemuDomainSnapshotLoad: avoid dead store
	* src/qemu/qemu_driver.c (qemuDomainSnapshotLoad): Remove dead store
	into "snap", as well as its declaration.

2010-04-07  Eric Blake  <eblake@redhat.com>

	maint: s/initialis/initializ/
	git grep found 12 of the former but 100 of the latter in src/.

	* src/remote/remote_driver.c (initialise_gnutls): Rename...
	(initialize_gnutls): ...to this.
	(doRemoteOpen): Adjust caller.
	* src/xen/xen_driver.c (xenUnifiedOpen): Adjust output string.
	* src/util/network.c: Adjust comments.
	Suggested by Matthias Bolte.

2010-04-07  Jim Meyering  <meyering@redhat.com>

	domain_event.c: don't deref NULL on an OOM error path
	* src/conf/domain_event.c (virDomainEventGraphicsNewFromDom):
	Return NULL when handling out-of-memory error, rather than
	falling through with ev=NULL and then assigning to ev->member.
	(virDomainEventGraphicsNewFromObj): Likewise.

2010-04-07  Stefan Berger  <stefanb@us.ibm.com>

	nwfiler: fix due to non-symmetric src mac address match in iptables
	The attached patch fixes a problem due to the mac match in iptables only
	supporting --mac-source and no --mac-destination, thus it not being
	symmetric. Therefore a rule like this one

	<rule action='drop' direction='out'>
	  <all match='no' srcmacaddr='$MAC'/>
	</rule>

	should only have the MAC match on traffic leaving the VM and not test
	for the same source MAC address on traffic that the VM receives.

2010-04-07  Jim Meyering  <meyering@redhat.com>

	qemu_driver.c: don't close an arbitrary file descriptor
	* src/qemu/qemu_driver.c (qemudStartVMDaemon): Initialize "logfile"
	to ensure that we don't use it uninitialized -- thus closing an
	arbitrary file descriptor -- in the cleanup block.

2010-04-07  Daniel Veillard  <veillard@redhat.com>

	Fix a typo in comment

2010-04-07  Jamie Strandboge  <jamie@ubuntu.com>

	Update of the apparmore regression tests
	* tests/virt-aa-helper-test: test augmented with hostdev and sdl display
	  checks

	Improve the apparmor example
	* examples/apparmor/libvirt-qemu examples/apparmor/usr.sbin.libvirtd
	  examples/apparmor/usr.lib.libvirt.virt-aa-helper: Update the examples

	Improve virt-aa-helper to handle SDL graphics and cleanups
	* src/security/virt-aa-helper.c: add support for SDL devices and 3
	  code cleanups

	Adjust virt-aa-helper to handle pci devices
	* src/security/virt-aa-helper.c: adjust virt-aa-helper to handle pci
	  devices. Update valid_path() to have an override array to check against,
	  and add "/sys/devices/pci" to it. Then rename file_iterate_cb() to
	  file_iterate_hostdev_cb() and create file_iterate_pci_cb() based on it

	Add backingstore support to apparmor
	adjust virt-aa-helper to handle backing store
	* src/security/virt-aa-helper.c: look for backing store metadata
	  for disk definitions.

	Add VIR_DOMAIN_XML_INACTIVE flag when parsing domain XML
	To avoid an error when hitting the <seclabel...> definition
	* src/security/virt-aa-helper.c: add VIR_DOMAIN_XML_INACTIVE flag
	  to virDomainDefParseString

	virt-aa-helper should not fail if profile was removed
	Don't exit with error if the user unloaded the profile outside of
	 libvirt
	* src/security/virt-aa-helper.c: check the exit error from apparmor_parser
	  before exiting with a failure

	Do nor clear caps when invoking virt-aa-helper
	The calls to virExec() in security_apparmor.c when
	invoking virt-aa-helper use VIR_EXEC_CLEAR_CAPS. When compiled without
	libcap-ng, this is not a problem (it's effectively a no-op) but with
	libcap-ng this causes MAC_ADMIN to be cleared. MAC_ADMIN is needed by
	virt-aa-helper to manipulate apparmor profiles and without it VMs will
	not start[1]. This patch calls virExec with the default VIR_EXEC_NONE
	instead.
	* src/security/security_apparmor.c: fallback to VIR_EXEC_NONE flags for
	  virExec of virt_aa_helper

2010-04-07  Matthias Bolte  <matthias.bolte@googlemail.com>

	Fix 'avialable' typo
	Reported by Paul Jenner

2010-04-07  Eric Blake  <eblake@redhat.com>

	build: avoid autogen on 'make clean'
	Tested by running 'git submodule foreach git pull origin master' and
	'git add .gnulib', then seeing that 'make clean' skips autogen
	although 'make' properly runs it.

	* cfg.mk (_clean_requested): New check, to speed up 'make clean'
	even if gnulib submodule is outdated.
	Suggested by Daniel P. Berrange.

2010-04-07  Stefan Berger  <stefanb@us.ibm.com>

	Fix for nwfilter: Add filter schema for nwfilter XML, extend domain XML schema
	Fixing the regular expressions for variables where the first letter must be a $.

2010-04-07  Matthias Bolte  <matthias.bolte@googlemail.com>

	macvtap: Remove virConnectPtr from ReportError
	Also rename ReportError to macvtapError.

	phyp: Remove virConnectPtr from PHYP_ERROR

2010-04-07  Jim Meyering  <meyering@redhat.com>

	virterror.c: avoid erroneous case "fall-through"
	* src/util/virterror.c (virErrorMsg): Insert missing "break;"

2010-04-07  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Mark error messages for translation
	Also define ESX_ERROR and ESX_VI_ERROR in a central place, instead of
	defining them in each source file.

	Add ESX_ERROR and ESX_VI_ERROR to the msg_gen_function list in cfg.mk.

	Update po/POTFILES.in accordingly.

2010-04-07  Matthias Bolte  <matthias.bolte@googlemail.com>

	vbox: Mark all error messages for translation
	Add vboxError to the msg_gen_function list in cfg.mk.

2010-04-06  Stefan Berger  <stefanb@us.ibm.com>

	nwfilter: Add filter schema for nwfilter XML, extend domain XML schema
	This patch adds a relaxng nwfilter schema along with a test that
	verifies all the test output XML against the schema. The input XMLs
	contain a lot of intentional out-of-range values that make them fail the
	schema verification, so I am not verifying against those.

2010-04-06  Stefan Berger  <stefanb@us.ibm.com>

	nwfilter: Fix instantiated layer 2 rules for 'inout' direction
	With Eric Blake's suggestions applied.

	The following rule for direction 'in'

	<rule direction='in' action='drop'>
	  <mac srcmacaddr='1:2:3:4:5:6'/>
	</rule>

	drops all traffic from the given mac address.
	The following rule for direction 'out'

	<rule direction='out' action='drop'>
	  <mac dstmacaddr='1:2:3:4:5:6'/>
	</rule>

	drops all traffic to the given mac address.
	The following rule in direction 'inout'

	<rule direction='inout' action='drop'>
	  <mac srcmacaddr='1:2:3:4:5:6'/>
	</rule>

	now drops all traffic from and to the given MAC address.
	So far it would have dropped traffic from the given MAC address
	and outgoing traffic with the given source MAC address, which is not useful
	since the packets will always have the VM's MAC address as source
	MAC address. The attached patch fixes this.

	This is the last bug I currently know of and want to fix.

2010-04-06  Eric Blake  <eblake@redhat.com>

	virsh: improve documentation
	Document several missing commands.  There's more work that could be
	done, but incremental improvements is better than no patch at all.

	* tools/virsh.pod (autostart, connect): Improve grammar.
	(create): Improve example.
	(domjobabort, domjobinfo, domxml-from-native, domxml-to-native):
	Document.
	(storage pool commands): New section.

2010-04-06  Chris Lalancette  <clalance@redhat.com>

	Clarify an error message in setmem.

	Fix up comments for isEncrypted, isSecure, domainIsActive, and domainIsPersistent.

	Document snapshot virsh commands in the man page.

2010-04-06  Chris Lalancette  <clalance@redhat.com>

	Better error reporting in virsh.
	When hitting failures in virsh, a common idiom is
	to jump to a cleanup label, free some resources, and
	then return a FALSE error code to vshCommandRun.
	In theory, vshCommandRun is then supposed to print
	out the last error.  The problem is that many of
	the cleanup paths have library calls to free resources,
	and all of those library calls clear out the last error.
	This is leading to situations where no error is being
	reported at all.

	This patch remedies the situation somewhat by
	printing out the errors inside the command methods
	themselves when we know it will go through a cleanup
	path that will lose the error.

2010-04-06  Chris Lalancette  <clalance@redhat.com>

	Website documentation for the snapshot XML.

	Increase the number of available VNC ports.
	When starting up qemu VNC autoport guests, we were
	only looking through ports 5900 to 6000, meaning we
	were limited to 100 total clients.  Increase that
	limit to 65535 (the last available port), so we can
	have up to 59635 VNC autoport guests.

2010-04-06  Stefan Berger  <stefanb@us.ibm.com>

	This patch fixes some compilation issues for the RHEL5 build. I am also removing the IPV6 constant where it appears in the wrong place.

2010-04-06  Matthias Bolte  <matthias.bolte@googlemail.com>

	Fix compiler warning about unused conn parameter
	This only affects builds without NUMA support.

	openvz: Remove virConnectPtr from openvzError
	Also remove unused enum values OPENVZ_WARN and OPENVZ_ERR.

	one: Remove virConnectPtr from oneError

	uml: Remove virConnectPtr from umlReportError

	Remove virConnectPtr from eventReportError

	Remove virConnectPtr from virLibConnError

	xen: Remove virConnectPtr from xenUnifiedError

	Remove virConnectPtr from nodeReportError

	netcf: Remove virConnectPtr from interfaceReportError

	xen: Remove virConnectPtr from virXenInotifyError

	xen: Remove virConnectPtr from virXenStoreError

	xen: Remove virConnectPtr from virXenError/virXenErrorFunc

	xen: Remove virConnectPtr from virXMError

	xen: Remove virConnectPtr from virXendError

	proxy: Remove virConnectPtr from virProxyError

	vbox: Remove virConnectPtr from vboxError

	test: Remove virConnectPtr from testError

	Remove unnecessary trailing \n in log messages

	Fix compiler warning about non-literal format string

2010-04-06  Stefan Berger  <stefanb@us.ibm.com>

	This patch removes the virConnectPtr parameter from all functions where it's not necessary starting out with removing it as a parameter to the error reporting function.

2010-04-05  Chris Lalancette  <clalance@redhat.com>

	Snapshot virsh implementation.

2010-04-05  Jiri Denemark  <jdenemar@redhat.com>

	Snapshots for VBox

2010-04-05  Chris Lalancette  <clalance@redhat.com>

	Snapshot QEMU driver.

	Only assign newDef when we have a new def.
	While playing around with def/newDef with the qemu code,
	I noticed that newDef was *always* getting set to a value,
	even when I didn't redefine the domain.  I think the problem
	is the virDomainLoadConfig is always doing virDomainAssignDef
	regardless of whether the domain already exists in the hashtable.
	In turn, virDomainAssignDef is assigning the definition (which
	is actually a duplicate) to newDef.  Fix this so that newDef stays
	NULL until we actually have a new def.

	Snapshot internal methods.

	Snapshot API framework.

2010-04-05  David Allan  <dallan@redhat.com>

	Clarified error message
	* Since the file pattern matches RNG schemas as well as C sources, the error message should mention both.

2010-04-05  Laine Stump  <laine@laine.org>

	Eliminate compiler warning about non-const format string

2010-04-05  Matthias Bolte  <matthias.bolte@googlemail.com>

	xenapi: Add managedsave entries to the driver struct
	Commit 15c647a91e8c5bcfcb02ac4e755160c5c99a2a1e added the new
	managedsave entries to all driver structs except the XenAPI one.

2010-04-04  Stefan Berger  <stefanb@us.ibm.com>

	Get rid of the regular expressions when evaluating variable names and values. Rather use the strspn() function. Along with this cleanup the initialization function for the code that used the regular expression can also be removed.

2010-04-04  Matthias Bolte  <matthias.bolte@googlemail.com>

	nwfilter: Fix random index in virNWFilterRuleDefDetailsFormat
	An uninitialized int value was used to index an array. This can
	result in a segfault in nwfilterxml2xmltest.

	xenapi: Fix uninitialized variable warning

2010-04-04  Daniel Veillard  <veillard@redhat.com>

	Add a managedsave command to virsh
	This command implements the managed save operation

	* tools/virsh.c: new command
	* tools/virsh.pod: documentation

2010-04-04  Daniel Veillard  <veillard@redhat.com>

	Implement managed save operations for qemu driver
	The images are saved in /var/lib/libvirt/qemu/save/
	and named $domainname.save . The directory is created appropriately
	at daemon startup. When a domain is started while a saved image is
	available, libvirt will try to load this saved image, and start the
	domain as usual in case of failure. In any case the saved image is
	discarded once the domain is created.

	* src/qemu/qemu_conf.h: adds an extra save path to the driver config
	* src/qemu/qemu_driver.c: implement the 3 new operations and handling
	  of the image directory

2010-04-04  Daniel Veillard  <veillard@redhat.com>

	Implement remote protocol for managed save
	* src/remote/remote_protocol.x src/remote/remote_protocol.h
	  src/remote/remote_protocol.c src/remote/remote_driver.c: add the entry
	  points in the remote driver
	* daemon/remote.c daemon/remote_dispatch_args.h
	  daemon/remote_dispatch_prototypes.h daemon/remote_dispatch_table.h:
	  and implement the daemon counterpart

2010-04-04  Daniel Veillard  <veillard@redhat.com>

	Add managed save API entry points
	virDomainManagedSave() is to be run on a running domain. Once the call
	complete, as in virDomainSave() the domain is stopped upon completion,
	but there is no restore counterpart as any order to start the domain
	from the API would load the state from the managed file, similary if
	the domain is autostarted when libvirtd starts.
	Once a domain has restarted his managed save image is destroyed,
	basically managed save image can only exist for a stopped domain,
	for a running domain that would be by definition outdated data.

	* include/libvirt/libvirt.h.in src/libvirt.c src/libvirt_public.syms:
	  adds the new entry points virDomainManagedSave(),
	  virDomainHasManagedSaveImage() and virDomainManagedSaveRemove()
	* src/driver.h src/esx/esx_driver.c src/lxc/lxc_driver.c
	  src/opennebula/one_driver.c  src/openvz/openvz_driver.c
	  src/phyp/phyp_driver.c src/qemu/qemu_driver.c src/vbox/vbox_tmpl.c
	  src/remote/remote_driver.c src/test/test_driver.c src/uml/uml_driver.c
	  src/xen/xen_driver.c: add corresponding new internal drivers entry
	  points

2010-04-03  Eric Blake  <eblake@redhat.com>

	build: improve check for out-of-date .gnulib submodule
	git reset --hard 96e5a2d4d5b13bf2cc887562dc11d146b78d5950
	./autogen.sh
	make -s
	git pull
	make -s    <-- expecting auto-bootstrap here, doesn't happen

	Use git diff to expose whether the submodule has untracked changes,
	which are typical on an incremental pull if .gnulib was updated but
	the user did not manually run 'git submodule update'.

	After this patch is applied, I encountered a new problem when
	following the reproducing pattern.  Basically, the change to .gnulib
	between libvirt's commit 96e5a2d4 and this patch introduced a change
	to sys_ioctl.in.h, but gnulib (intentionally) does not make the
	replacement headers depend on Makefile changes.  Therefore, I ended up
	with the generated replacement header being broken:
	gnulib/lib/sys/ioctl.h complained about a use of @.  But that seems
	like something that should be fixed upstream in gnulib's bootstrap
	script (that is, when doing a gnulib update, all files created from
	.in.h file should probably be deleted).  Without the benefit of that
	proposed gnulib fix, I worked around the problem by manually removing
	the stale gnulib/lib/sys/ioctl.h.

	* autogen.sh (t): Also run bootstrap if the gnulib submodule needs
	to be updated.
	* cfg.mk (_autogen): Likewise.
	Reported by Matthias Bolte.

2010-04-03  Stefan Berger  <stefanb@us.ibm.com>

	Use the virStrToLong_ui() function rather than the virStrToLong_i() where possible.

	The attached patch optimizes the validation of the name of an interface.

	This patch adds a couple of test cases for the XML parsing test suite covering various filterable protocols. For each test case an input XML and an output XML is provided checking the input XML after parsing and converting back into XML against the exepcted output XML.

2010-04-03  Stefan Berger  <stefanb@us.ibm.com>

	The following issues are fixed in the patch below:
	- ebtables requires that some of the command line parameters are passed as hex numbers; so have those attributes call a function that prints 16 and 8 bit integers as hex nunbers.

	- ip6tables requires '--icmpv6-type' rather than '--icmp-type'

	- ebtables complains about protocol identifiers lower than 0x600, so already discard anything lower than 0x600 in the parser

	- make the protocol entry types more readable using a #define for its entries

	- continue parsing a filtering rule even if a faulty entry is encountered; return an error value at the end and let the caller decide what to do with the rule's object

	- fix an error message

2010-04-03  Eric Blake  <eblake@redhat.com>

	build: import latest gnulib
	A lot of syntax check rules have to be rewritten, but the
	result is easier to maintain.  I tested each syntax rule
	by intentionally introducing a temporary violation of the rule.
	Additionally, some false positives for unmarked_diagnostics
	crept in, and an improved copyright_format test caught some bugs.

	* .gnulib: Update to latest.
	* cfg.mk (sc_prohibit_test_minus_ao): Delete, it was moved into
	gnulib's maint.mk.
	(sc_avoid_write, sc_prohibit_strcmp_and_strncmp)
	(sc_prohibit_asprintf, sc_prohibit_strncpy, sc_prohibit_readlink)
	(sc_prohibit_gethostname, sc_prohibit_gettext_noop)
	(sc_prohibit_VIR_ERR_NO_MEMORY, sc_prohibit_nonreentrant)
	(sc_prohibit_ctype_h, sc_TAB_in_indentation)
	(sc_avoid_ctype_macros)
	(sc_prohibit_virBufferAdd_with_string_literal)
	(sc_prohibit_gethostby, sc_copyright_format): Rewrite in terms of
	new maint.mk macros.
	(sc_libvirt_unmarked_diagnostics): Fix whitespace.
	* .x-sc_unmarked_diagnostics: New file.
	* tests/object-locking.ml: Fix copyright.
	* tools/virt-pki-validate.in: Likewise.
	* tools/virt-xml-validate.in: Likewise.

2010-04-02  Chris Lalancette  <clalance@redhat.com>

	Add a missing break statement to nwfilter errors.

	Make virDomainLoadConfig static.

2010-04-02  Jiri Denemark  <jdenemar@redhat.com>

	VBox: Fix use of uninitialized value

2010-04-02  Laine Stump  <laine@laine.org>

	Changes to clock timer XML to match final design.
	The clock timer XML is being updated in the following ways (based on
	further off-list discussion that was missed during the initial
	implementation):

	1) 'wallclock' is changed to 'track', and the possible values are 'boot'
	 (corresponds to old 'host'), 'guest', and 'wall'.

	2) 'mode' has an additional value 'smpsafe'

	3) when tickpolicy='catchup', there can be an optional sub-element of
	   timer called 'catchup':

	   <catchup threshold=123 slew=120 limit=10000/>

	Those three values are all longs, always optional, and if they are present,
	they are positive. Internally, 0 indicates "unspecified".

	* docs/schemas/domain.rng: updated RNG definition to account for changes

	* src/conf/domain_conf.h: change the C struct and enums to match changes.

	* src/conf/domain_conf.c: timer parse and format functions changed to
	                          handle the new selections and new element.

	* src/libvirt_private.syms: *TimerWallclock* changes to *TimerTrack*

	* src/qemu/qemu_conf.c: again, account for Wallclock --> Track change.

2010-04-02  Laine Stump  <laine@laine.org>

	Allow domain disk images on root-squash NFS to coexist with security driver.
	(suggested by Daniel Berrange, tested by Dan Kenigsberg)

	virStorageFileGetMetadata will fail for disk images that are stored on
	a root-squash NFS share that isn't world-readable.
	SELinuxSetSecurityImageLabel is called during the startup of every
	domain (as long as security_driver != "none"), and it will propogate
	the error from virStorageFileGetMetadata, causing the domain startup
	to fail. This is, however, a common scenario when qemu is run as a
	non-root user and the disk image is stored on NFS.

	Ignoring this failure (which doesn't matter in this case, since the
	next thing done by SELinuxSetSecurityImageLabel - setting the file
	context - will also fail (and that function already ignores failures
	due to root-squash NFS) will allow us to continue bringing up the
	domain. The result is that we don't need to disable the entire
	security driver just because a domain's disk image is stored on
	root-squashed NFS.

2010-04-02  Laine Stump  <laine@laine.org>

	Eliminate compile warnings in nwfilter error log calls

2010-04-02  Chris Lalancette  <clalance@redhat.com>

	Don't use virFileReadLimFD in qemuDomainRestore.
	virFileReadLimFD is a poor fit for reading the header
	of the restore file.  The problem is that virFileReadLimFD
	returns an error when there is more data after the amount
	you ask to read, but that is *expected* in this case.

	This patch is essentially a revert of
	1a4d5c9543641c444dccd682f6256ee3faf22a80, but I don't think
	that commit does what it says anyway.  It purports to prevent
	an unwarranted OOM error, but since virFileReadLimFD will
	allocate memory up to the maximum anyway, the upper limit
	on the total amount of memory allocated is the same for either
	the old version or the new version.  Since the old saferead
	actually works and virFileReadLimFD does not, revert to
	using saferead.

2010-04-01  Jim Fehlig  <jfehlig@novell.com>

	Only parse 'CPU XML' in virCPUDefParseXML()
	Received report of user crashing libvirtd with

	virsh capabilities > capabilities.xml
	virsh cpu-compare capabilities.xml

	While user has been informed about proper usage of cpu-compare,
	segfaulting libvirt should be avoided.

	Do not parse CPU definition in virCPUDefParseXML() if XML is not
	a 'cpu' node.

2010-04-01  Daniel P. Berrange  <berrange@redhat.com>

	Keep build quiet for generated file
	Adds $(AM_V_GEN) to many more manual makefile.am rules that
	were generating files

2010-04-01  Daniel P. Berrange  <berrange@redhat.com>

	Keep track of guest paused state after disk IO / watchdog events
	When a watchdog/IO error occurs, one of the possible actions that
	QEMU might take is to pause the guest. In this scenario libvirt
	needs to update its internal state for the VM, and emit a
	lifecycle event:

	  VIR_DOMAIN_EVENT_SUSPENDED

	with a detail being one of:

	  VIR_DOMAIN_EVENT_SUSPENDED_IOERROR
	  VIR_DOMAIN_EVENT_SUSPENDED_WATCHDOG

	To future proof against possible QEMU support for multiple monitor
	consoles, this patch also hooks into the 'STOPPED' event in QEMU
	and emits a generic VIR_DOMAIN_EVENT_SUSPENDED_PAUSED event

	* include/libvirt/libvirt.h.in: Add VIR_DOMAIN_EVENT_SUSPENDED_IOERROR
	* src/qemu/qemu_driver.c: Update VM state to paused when IO error
	  or watchdog events occurrs
	* src/qemu/qemu_monitor_json.c: Fix typo in disk IO event name

2010-04-01  Matthias Bolte  <matthias.bolte@googlemail.com>

	Replace sscanf in PCI device address parsing
	This also fixes a problem with MinGW's GCC on Windows. GCC complains
	about the L modifier being unknown.

	Parsing in pciIterDevices is stricter now and doesn't accept trailing
	characters after the actual <domain>:<bus>:<slot>.<function> sequence
	anymore.

	Parsing in pciWaitForDeviceCleanup is also stricter now and expects
	the <start>-<end> : <domain>:<bus>:<slot>.<function> sequence to be
	terminated by \n.

	Change domain from unsigned long long to unsigned int in
	pciWaitForDeviceCleanup, because everywhere else domain is handled as
	unsigned int too.

2010-04-01  Matthias Bolte  <matthias.bolte@googlemail.com>

	xen: Use virStrToLong_i instead of sscanf for XenD port parsing
	Parsing is stricter now and doesn't accept trailing characters
	after the actual value anymore.

	xenapi: Use virStrToLong_i instead of sscanf for CPU map parsing
	Parsing is stricter now and doesn't accept trailing characters
	after the actual value anymore.

	openvz: Use strtok_r instead of sscanf for VPS UUID parsing
	Also free 2k stack space.

	xen: Use virParseMacAddr instead of sscanf
	This also fixes a bug in xenXMDomainConfigParse where uninitialized
	memory would be used as MAC address if sscanf fails.

	vbox: Replace atoi with virStrToLong_i
	Parsing is stricter now and doesn't accept trailing characters
	after the actual value or non-number strings anymore. atoi just
	returns 0 in case it cannot parse a number from the given string.
	Now an error is reported for such a string.

2010-04-01  Matthias Bolte  <matthias.bolte@googlemail.com>

	cgroup: Replace sscanf with virStrToLong_ll
	The switch from %lli to %lld in virCgroupGetValueI64 is intended,
	as virCgroupGetValueU64 uses base 10 too, and virCgroupSetValueI64
	uses %lld to format the number to string.

	Parsing is stricter now and doesn't accept trailing characters
	after the actual value anymore.

2010-04-01  Matthias Bolte  <matthias.bolte@googlemail.com>

	Refactor major.minor.micro version parsing into a function
	virParseVersionString uses virStrToLong_ui instead of sscanf.

	This also fixes a bug in the UML driver, that always returned 0
	as version number.

	Introduce STRSKIP to check if a string has a certain prefix and
	to skip this prefix.

2010-04-01  Matthias Bolte  <matthias.bolte@googlemail.com>

	Replace sscanf in nwfilter rule parsing
	Parsing is stricter now and doesn't accept trailing characters
	after the actual value anymore.

	Replace sscanf in legacy device address parsing
	Parsing is stricter now and doesn't accept trailing characters
	after the actual <domain>:<bus>:<slot> sequence anymore.

2010-04-01  Stefan Berger  <stefanb@us.ibm.com>

	While writing a couple of test cases for the nwfilter's XML parser I found some cases where the output ended up not looking as expected. So the following changes are in the patch below:
	- if the protocol ID in the MAC header is an integer, just write it into
	the datastructure without trying to find a corresponding string for it
	and if none is found failing
	- when writing the protocol ID as string, simply write it as integer if
	no corresponding string can be found
	- same changes for arpOpcode parsing and printing
	- same changes for protocol ID in an IP packet
	- DSCP value needs to be written into the data structure
	- IP protocol version number is redundant at this level, so remove it
	- parse the protocol ID found inside an IP packet not only as string but
	also as uint8
	- arrange the display of the src and destination masks to be shown after
	the src and destination ip address respectively in the XML
	- the existing libvirt IP address parser accepts for example '25' as an
	IP address. I want this to be parsed as a CIDR type netmask. So try to
	parse it as an integer first (CIDR netmask) and if that doesn't work as
	a dotted IP address style netmask.
	- instantiation of rules with MAC masks didn't work because they weren't
	printed into a buffer, yet.

	ESX test case needs '/' in interface name
	To fix an ESX test case, valid interface names need '/' as valid letter.

2010-04-01  Matthias Bolte  <matthias.bolte@googlemail.com>

	Fix linker errors in proxy
	domain_conf.c:494: undefined reference to 'virNWFilterHashTableFree'
	domain_conf.c:5107: undefined reference to 'virNWFilterFormatParamAttributes'

	Add missing source to the proxy and disable XML parsing code in
	nwfilter_params.c for a proxy build.

2010-04-01  Eric Blake  <eblake@redhat.com>

	build: more fallout from test -a
	* cfg.mk (sc_prohibit_test_minus_ao): Also check for [.
	* docs/Makefile.am (%.html, html/index.html): Avoid non-portable
	test usage.
	* libvirt.spec.in (%post): Likewise.
	* tools/virt-pki-validate.in (servercert.pem): Likewise.
	* configure.ac (LOGNAME): Use test, not [, in files processed by
	autoconf.
	Detected by Matthias Bolte.

2010-04-01  Matthias Bolte  <matthias.bolte@googlemail.com>

	Fix apibuild.py warning about virNWFilterLookupByUUIDString
	The function name was written with capital I in the Filter part.

	website: Add archive link for libvirt-users list

2010-03-31  Eric Blake  <eblake@redhat.com>

	maint: remove redundant tests after virStrToLong
	virStrToLong* guarantees (via strtol) that the end pointer will be set
	to the point at which parsing stopped (even on failure, this point is
	the start of the input string).

	* src/esx/esx_driver.c (esxGetVersion): Remove pointless
	conditional.
	* src/qemu/qemu_conf.c (qemuParseCommandLinePCI)
	(qemuParseCommandLineUSB, qemuParseCommandLineSmp): Likewise.
	* src/qemu/qemu_monitor_text.c
	(qemuMonitorTextGetMigrationStatus): Likewise.

2010-03-31  Eric Blake  <eblake@redhat.com>

	maint: update AUTHORS
	* AUTHORS: Add recent contributors.

2010-03-31  Paolo Smiraglia  <paolo.smiraglia@gmail.com>

	virConnectGetLibVersion: Avoid error message on success.
	* src/libvirt.c (virConnectGetLibVersion): Don't emit error on
	success.

2010-03-31  Eric Blake  <eblake@redhat.com>

	virsh: add 'exit' as an alias for 'quit'
	Call me lazy: some shells use exit (e.g. sh), others use quit (e.g. ftp),
	but I never remember which.  So it's faster to write a patch to make
	virsh take both than it is to take a 50-50 guess, and get it wrong
	in half of my attempts.

	* tools/virsh.c (commands): Add 'exit'.
	* tools/virsh.pod: Document it.

2010-03-31  Jim Meyering  <meyering@redhat.com>

	maint: fix cpp indentation syntax-check failure
	* src/esx/esx_vi_types.h: Filter through cppi.

	maint: mark xenapiSessionErrorHandler messages for translation
	* cfg.mk (msg_gen_function): Add xenapiSessionErrorHandler.
	* po/POTFILES.in: Add src/xenapi/xenapi_driver.c
	* src/xenapi/xenapi_driver.c: Mark strings for translation.
	* src/xenapi/xenapi_utils.c (xenapiUtil_ParseQuery):

2010-03-31  Stefan Berger  <stefanb@us.ibm.com>

	Blank out invalid interface names with escaped letters etc.
	Check that interface names only contain valid characters. Blank them out
	otherwise.
	Valid characters in this code are currently a-z,A-Z,0-9, '-' and '_'.

2010-03-31  Matthias Bolte  <matthias.bolte@googlemail.com>

	Add virt-aa-helper and secaatest to .gitignore

	esx: Remove redundant semicolons

2010-03-31  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Generate most SOAP mapping and improve inheritance handling
	The Python script generates the mappings based on the type descriptions
	in the esx_vi_generator.input file.

	This also improves the inheritance handling and allows to get rid of the
	ugly, inflexible, and error prone _base/_super approach. Now every struct
	that represents a SOAP type contains a _type member, that allows to
	recreate C++-like dynamic dispatch for "method" calls in C.

2010-03-31  Daniel Veillard  <veillard@redhat.com>

	Distribute nwfilter xml files and add them to rpm
	* examples/xml/nwfilter/Makefile.am: add all xml to the distribution
	* libvirt.spec.in: reference them from the rpm spec file to have them
	  available in the main libvirt package

	Make sure nwfilter headers are part of distribution
	* src/Makefile.am: adds a few missing header files in the associated
	  file variables, it's needed otherwise the missing headers breaks
	  compilation from a distribution tarball

2010-03-31  Eric Blake  <eblake@redhat.com>

	maint: show which compiler warning triggered
	* acinclude.m4 (LIBVIRT_COMPILE_WARNINGS): Add
	-fdiagnostics-show-option.

2010-03-31  Eric Blake  <eblake@redhat.com>

	build: automate the rerun of autogen.sh
	Automate the reuse of autogen.sh, rather than just erroring out.

	* cfg.mk (_update_required): Run autogen.sh, rather than just
	warning about it.
	(_autogen): New target.

2010-03-30  Stefan Berger  <stefanb@us.ibm.com>

	A cosmetic change that makes the entries in the int-2-string maps look more readable. Add some missing entries: ipv6 and icmpv6.

2010-03-30  Stefan Berger  <stefanb@us.ibm.com>

	Use libvirt's existing ipv6/ipv4 parser/printer rather than self-written ones
	This patch changes the network filtering code to use libvirt's existing
	IPv4 and IPv6 address parsers/printers rather than my self-written ones.

	I am introducing a new function in network.c that counts the number of
	bits in a netmask and ensures that the given address is indeed a netmask,
	return -1 on error or values of 0-32 for IPv4 addresses and 0-128 for
	IPv6 addresses. I then based the function checking for valid netmask
	on invoking this function.

2010-03-30  Stefan Berger  <stefanb@us.ibm.com>

	Add ip6tables support for IPv6 filtering
	This patch adds IPv6 filtering support for the following protocols:
	- tcp-ipv6
	- udp-ipv6
	- udplite-ipv6
	- esp-ipv6
	- ah-ipv6
	- sctp-ipv6
	- all-ipv6
	- icmpv6

	Many of the IPv4 data structure could be re-used for IPv6 support.
	Since ip6tables also supports pretty much the same command line parameters
	as iptables does, also much of the code could be re-used and now
	command lines are invoked with the ip(6)tables tool parameter passed
	through the functions as a parameter.

2010-03-30  Stefan Berger  <stefanb@us.ibm.com>

	Remove driver dependency from nwfilter_conf.c
	This patch removes the driver dependency from nwfilter_conf.c and moves
	a callback function calling into the driver into
	nwfilter_gentech_driver.c and passes a pointer to that callback function
	upon initialization of nwfilter_conf.c.

	Add support for so-far missing protocols for iptables filtering
	This patch adds filtering support for the so-far missing protocols 'ah',
	'esp' and 'udplite'.

2010-03-30  Daniel Veillard  <veillard@redhat.com>

	Fix daemon hook script initialization
	* daemon/libvirtd.c: we should error out only if virHookInitialize()
	  return value is negative

2010-03-30  Laine Stump  <laine@laine.org>

	Implement the qemu-kvm backend of clock timer elements
	Since the timers are defined to cover all possible config cases for
	several different hypervisors, many of these possibilities generate an
	error on qemu. Here is what is currently supported:

	RTC: If the -rtc commandline option is available, allow setting
	"clock=host"
	     or "clock=vm" based on the rtc timer clock='host|guest' value. Also
	     add "driftfix=slew" if the tickpolicy is 'catchup', or add nothing
	if
	     tickpolicy is 'delay'. (Other tickpolicies will raise an error).

	     If -rtc isn't available, but -rtc-td-hack is, add that option
	     if the tickpolicy is 'catchup', add -rtc-td-hack, if it is 'delay'
	     add nothing, and if it's anything else, raise an error.

	PIT: If -no-kvm-pit-reinjection is available, and tickpolicy is
	     'delay', add that option. if tickpolicy is 'catchup', do
	     nothing. Anything else --> raise an error.

	     If -no-kvm-pit-reinjection *isn't* available, but -tdf is, when
	     tickpolicy is 'catchup' add -tdf. If it's 'delay', do
	     nothing. Anything else --> raise an error.

	     If neither of those commandline options is available, and
	     tickpolicy is anything other than 'delay' (or unspecified), raise
	     an error.

	HPET: If -no-hpet flag is available and present='no', add -no-hpet.
	      If -no-hpet is not available, and present='yes', raise an error.
	      If present is unspecified, the default is to do whatever this
	      particular qemu does by default, so don't raise an error.

	All other timer types are unsupported by QEMU, so they will raise an
	error.

	* src/qemu/qemu_conf.c: extend qemuBuildClockArgStr() to generate the
	  command line arguments for the new options

2010-03-30  Laine Stump  <laine@laine.org>

	Add flags to indicate presence of timekeeping-related qemu options
	* src/qemu/qemu_conf.h: define 4 new flags
	* src/qemu/qemu_conf.c: check the help text of qemu for presence of
	                        features indicated by each flag.
	* tests/qemuhelptest.c: add appropriate flags into the masks for each test

2010-03-30  Laine Stump  <laine@laine.org>

	Add timer element to domain schema
	timers are sub-elements of clocks. A clock can have zero or more
	instances of timer. Within the timer, only the name attribute is
	required; all other attributes are optional.

	A simpler representation of a timer element is:

	  <timer name='platform|pit|rtc|hpet|tsc'
	         wallclock='host|guest'
	         tickpolicy='delay|catchup|merge|discard'
	         frequency='123'
	         mode='auto|native|emulate|paravirt'
	         present='yes|no'/>

	frequency is a ulong. All other attributes are simple enums.

2010-03-30  Laine Stump  <laine@laine.org>

	Implement XML parser/formatter for "timer" subelement of domain clock
	This extension is described in

	http://www.redhat.com/archives/libvir-list/2010-March/msg00304.html

	Currently all attributes are optional, except name.

	* src/conf/domain_conf.h: add data definition for virDomainTimerDef
	  and add a list of them to virDomainClockDef
	* src/conf/domain_conf.c: XML parser and formatter for a timer inside a clock
	* src/libvirt_private.syms: add new Timer enum helper functions to symbols

2010-03-30  Daniel P. Berrange  <berrange@redhat.com>

	Fix QEMU cpu affinity at startup to include all threads
	The QEMU cpu affinity is used in NUMA scenarios to ensure that
	guest memory is allocated from a specific node. Normally memory
	is allocate on demand in vCPU threads, but when using hugepages
	the initial thread leader allocates memory upfront. libvirt was
	not setting affinity of the thread leader, or I/O threads. This
	patch changes the code to set the process affinity in between
	the fork()/exec() of QEMU. This ensures that every single QEMU
	thread gets the affinity

	* src/qemu/qemu_driver.c: Set affinity on entire QEMU process
	  at startup

2010-03-30  Daniel Veillard  <veillard@redhat.com>

	Updating the commiters list
	Laine Stump, Stefan Berger, Eric Blake now have commit rights !

2010-03-30  Eric Blake  <eblake@redhat.com>

	virsh: support VISUAL, and allow metacharacters in EDITOR
	Common Unix practice is to prefer VISUAL over EDITOR, particularly if
	the editor of choice spawns a new window.  Thus, it is also common to
	see settings like EDITOR='emacs -nw', with the expectation that the
	shell will parse this as an argument to 'emacs' and not try to invoke
	a file containing a space.

	If a user puts junk in EDITOR, they deserve what they get (much more
	than virsh will misbehave); furthermore, sudo scrubs EDITOR by
	default.  So the blind use of metacharacters in EDITOR should not be
	considered too much of a security issue.

	* tools/virsh.c (editFile): Prefer VISUAL over EDITOR.  Don't
	reject shell metacharacters in EDITOR.
	* tools/virsh.pod (edit, net-edit, ENVIRONMENT): Document VISUAL.
	Fixes https://bugzilla.redhat.com/show_bug.cgi?id=487738.

2010-03-30  Eric Blake  <eblake@redhat.com>

	virsh: improve man page
	* tools/virsh.pod: (DESCRIPTION): Improve grammar.  Mention other drivers.
	(ENVIRONMENT): Document EDITOR.
	(COPYRIGHT): Bump.

2010-03-30  Stefan Berger  <stefanb@us.ibm.com>

	Add dummy nwfilter driver to test driver
	This patch adds a dummy nwfilter driver to the test driver so that the
	int-overflow test passes without modifications.

2010-03-30  Stefan Berger  <stefanb@us.ibm.com>

	Fix "make check" run requesting authentication
	This patch fixes the 'make check' runs for me which, under certain
	circumstances and login configurations, did invoke popups requesting
	authentication. I removed the parameter conn from being passed into the
	error reporting function.

	* src/conf/nwfilter_conf.h src/conf/nwfilter_conf.c: remove conn from
	  error reporting parameters.

2010-03-30  Daniel Veillard  <veillard@redhat.com>

	Fix a merge error leftover

2010-03-30  Daniel Veillard  <veillard@redhat.com>

	Add script hook support to the LXC driver
	Right now this implements only 2 basic hooks:
	- before the lxc control process is being launched
	- after the lxc control process is terminated
	the XML description of the domain is passed to the hook script stdin
	/etc/libvirt/hook/lxc

	* src/lxc/lxc_driver.c: implement synchronous script hooks for LXC
	  at domain startup and end

2010-03-30  Daniel Veillard  <veillard@redhat.com>

	Add script hook support to the QEmu driver
	Right now this implements only 2 basic hooks:
	- before the qemu process is being launched
	- after the qemu process is terminated
	the XML description of the domain is passed to the hook script stdin
	/etc/libvirt/hook/qemu

	* src/qemu/qemu_driver.c: implement synchronous script hooks for QEmu
	  at domain startup and end

2010-03-30  Daniel Veillard  <veillard@redhat.com>

	Add the script hook support to the libvirt daemon
	It supports 3 kind of probing times, at daemon startup, when the
	daemon reloads its drivers on SIGHUP and when the daemon exits

	* daemon/libvirtd.c: daemon hooks for startup, reload and exit

2010-03-30  Daniel Veillard  <veillard@redhat.com>

	Add hook utilities
	This exports 3 basic routines:
	  - virHookInitialize() initializing the hook support by looking for
	    scripts availability
	  - virHookPresent() used to test if there is a hook for a given driver
	  - virHookCall() which actually calls a synchronous script hook with
	    the needed parameters
	Note that this doesn't expose any public API except for the locations
	and arguments passed to the scripts

	* src/Makefile.am: add the 2 new files
	* src/util/hooks.h src/util/hooks.c: implements the 3 functions
	* src/libvirt_private.syms: export the 3 symbols internally
	* po/POTFILES.in: add src/util/hooks.c to translatables modules

2010-03-30  Daniel Veillard  <veillard@redhat.com>

	Add an error module and message for the hooks subsystem
	* include/libvirt/virterror.h: add VIR_FROM_HOOK and VIR_ERR_HOOK_SCRIPT_FAILED
	* src/util/virterror.c: associated strings

2010-03-30  Daniel Veillard  <veillard@redhat.com>

	Export virPipeReadUntilEOF internally
	used to read the data from virExec stdout/err file descriptors

	* src/util/util.c src/util/util.h: not static anymore and export it
	* src/libvirt_private.syms: allow access internally

2010-03-27  Jiri Denemark  <jdenemar@redhat.com>

	Introduce UPDATE_CPU flag for virDomainGetXMLDesc
	This flag is used in migration prepare step to send updated XML
	definition of a guest.

	Also ``virsh dumpxml --update-cpu [--inactive] guest'' command can be
	used to see the updated CPU requirements.

2010-03-27  Jiri Denemark  <jdenemar@redhat.com>

	Helper function for making a copy of virCPUDefPtr

2010-03-27  Jiri Denemark  <jdenemar@redhat.com>

	cpuUpdate() for updating guest CPU according to host CPU
	Useful mainly for migration. cpuUpdate changes guest CPU requirements in
	the following way:

	- match == "strict" || match == "exact"
	    - optional features which are supported by host CPU are changed into
	      required features
	    - optional features which are not supported by host CPU are disabled
	    - all other features remain untouched
	- match == "minimum"
	    - match is changed into "exact"
	    - optional features and all features not mentioned in guest CPU
	      specification which are supported by host CPU become required
	      features
	    - other optional features are disabled
	    - all other features remain untouched

	This ensures that no feature will suddenly disappear from the guest
	after migration.

2010-03-27  Jiri Denemark  <jdenemar@redhat.com>

	Don't replace persistent domain config with migrated config
	When a domain is defined on host1, migrated to host2 and then migrated
	back to host1, its current configuration would overwrite the libvirtd's
	in-memory copy of persistent configuration of that domain. This is not
	desired as we want to preserve the persistent configuration untouched.

	This patch introduces new 'live' parameter to virDomainAssignDef.
	Passing 'true' for 'live' means the configuration passed to
	virDomainAssignDef describes a configuration of live instance of the
	domain. This applies for saved domains which are being restored or for
	incoming domains during migration.

	All callers have been changed to pass the appropriate value.

2010-03-27  Jim Meyering  <meyering@redhat.com>

	filter new files through cppi, so syntax-check passes once again
	* src/conf/nwfilter_conf.h: Indent cpp directives.
	* src/conf/nwfilter_params.h: Likewise.
	* src/datatypes.h: Likewise.
	* src/nwfilter/nwfilter_driver.h: Likewise.
	* src/nwfilter/nwfilter_ebiptables_driver.h: Likewise.
	* src/nwfilter/nwfilter_gentech_driver.h: Likewise.

2010-03-27  David Allan  <dallan@redhat.com>

	Add disk error policy to domain XML
	* Fixes per feedback from Dan and Daniel
	* Added test datafiles
	* Re-disabled JSON flags
	* Added code to print the error policy attribute when generating XML
	* Re-add empty tag

2010-03-27  Eric Blake  <eblake@redhat.com>

	build: don't lose prior configure args on autogen.sh
	My prior patch forced an autogen.sh run, and I was surprised that the
	suggested './autogen.sh' lost the fact that I had previously used
	'./autogen.sh -C' for speed.

	* autogen.sh: Use config.status, if present and there were no arguments.

2010-03-27  Eric Blake  <eblake@redhat.com>

	build: update gnulib
	Picks up fixes for gethostname compilation problems on mingw.

	* .gnulib: Update to latest.
	* build-aux/.gitignore: Regenerate.
	* cfg.mk (local-checks-to-skip): Avoid new test not relevent to
	libvirt.

2010-03-27  Stefan Berger  <stefanb@us.ibm.com>

	Add some examples filters
	This patch adds some example filters to libvirt. They are automatically
	installed into the proper directory for libvirt to pick them up.

2010-03-27  Stefan Berger  <stefanb@us.ibm.com>

	Extensions for iptables rules
	This patch adds support for L3/L4 filtering using iptables. This adds
	support for 'tcp', 'udp', 'icmp', 'igmp', 'sctp' etc. filtering.

	As mentioned in the introduction, a .c file provided by this patch
	is #include'd into a .c file. This will need work, but should be alright
	for review.

2010-03-27  Stefan Berger  <stefanb@us.ibm.com>

	Add IPv6 support for the ebtables layer
	This patch adds IPv6 support for the ebtables layer. Since the parser
	etc. are all parameterized, it was fairly easy to add this...

	Add qemu support
	Add support for Qemu to have firewall rules applied and removed on VM
	startup and shutdown respectively. This  patch also provides support for
	the updating of a filter that causes all VMs that reference the filter
	to have their ebtables/iptables rules updated.

	Core driver implementation with ebtables support
	This patch implements the core driver and provides
	- management functionality for managing the filter XMLs
	- compiling the internal filter representation into ebtables rules
	- applying ebtables rules on a network (tap,macvtap) interface
	- tearing down ebtables rules that were applied on behalf of an
	interface
	- updating of filters while VMs are running and causing the firewalls to
	be rebuilt
	- other bits and pieces

	Add XML parser extensions for network filtering
	This patch adds XML processing for the network filter schema
	and extends the domain XML processing to parse the top level
	referenced filter along with potentially provided parameters

	Add virsh support for new CLI commands
	This patch adds virsh support for the five new CLI commands to manage
	network filters.

	Definition of the wire format, RPC client & server
	This patch adds the definition of the wire format for RPC calls
	and implementation of the RPC client & server code

	Implementation of the public API
	This patch adds the implementation of the public API for the network
	filtering (ACL) extensions to libvirt.c .

	Add internal API
	This patch adds the internal API extensions for network filtering (ACL) support.

	Add public API
	This patch adds extensions to libvirt's public API necessary for
	controlling the new functionality from remote for example.

	Add recursive locks
	This patch adds recursive locks necessary due to the processing of
	network filter XML that can reference other network filters, including
	references that cause looks. Loops in the XML are prevented but their
	detection requires recursive locks.

2010-03-27  David Allan  <dallan@redhat.com>

	Fix build break
	* Add types to switch; the switch is only exectuted for known types because of a preceding conditional, so this fix is merely to placate the compiler.

2010-03-27  Stefan Berger  <stefanb@us.ibm.com>

	Use enum of virDomainNetType
	To find out where the net type 'direct' needs to be handled I introduced
	the 'enum virDomainNetType' in the virDomainNetDef structure and let the
	compiler tell me where the case statement is missing. Then I added the
	unhandled device statement to the UML driver.

	* src/conf/domain_conf.h: change _virDomainNetDef type from int to
	  virDomainNetType enum
	* src/conf/domain_conf.c src/lxc/lxc_driver.c src/qemu/qemu_conf.c
	  src/uml/uml_conf.c: make sure all enum cases are properly handled
	  in switches

2010-03-27  Daniel Veillard  <veillard@redhat.com>

	Silence cppi syntax-check warning

2010-03-26  Stefan Berger  <stefanb@us.ibm.com>

	Mention direct device support since 0.7.7 in docs
	In the documentation mention that the direct device support is there
	since libvirt 0.7.7. A Linux kernel 2.6.34 is required for macvtap to be
	available as standard device.

2010-03-26  Daniel P. Berrange  <berrange@redhat.com>

	Implement VNC password change in QEMU
	Use the new virDomainUpdateDeviceFlags API to allow the VNC password
	to be changed on the fly

	* src/internal.h: Define STREQ_NULLABLE() which is like STREQ()
	  but does not crash if either argument is NULL, and treats two
	  NULLs as equal.
	* src/libvirt_private.syms: Export virDomainGraphicsTypeToString
	* src/qemu/qemu_driver.c: Support VNC password change on a live
	  machine
	* src/qemu/qemu_monitor.c: Disable crazy debugging info. Treat a
	  NULL password as "" (empty string), allowing passwords to be
	  disabled in the monitor

2010-03-26  Daniel P. Berrange  <berrange@redhat.com>

	Allow parsing <graphics> in device XML
	Expand the parser for the standalone <device> XML format to
	allow inclusion of the <graphics> device type

	* src/conf/domain_conf.h: Add virDomainGraphicsDef to
	  the virDomainDeviceDef struct
	* src/conf/domain_conf.c: Wire up parser for virDomainGraphicsDef
	  to virDomainDeviceDefParse method

2010-03-26  Daniel P. Berrange  <berrange@redhat.com>

	Introduce a update-device command in virsh
	Support the new virDomainUpdateDeviceFlags API in virsh by adding
	a new 'update-device' command. In the future this should be augmented
	with an explicit 'change-disk' command for media change to make it
	end user discoverable, as attach-disk is.

	* tools/virsh.c: Add 'update-device' command

2010-03-26  Daniel P. Berrange  <berrange@redhat.com>

	Implement virDomainUpdateDeviceFlags API in all drivers with media change
	To allow the new virDomainUpdateDeviceFlags() API to be universally
	used with all drivers, this patch adds an impl to all the current
	drivers which support CDROM or Floppy disk media change via the
	current virDomainAttachDeviceFlags API

	* src/qemu/qemu_driver.c, src/vbox/vbox_tmpl.c,
	  src/xen/proxy_internal.c, src/xen/xen_driver.c,
	  src/xen/xend_internal.c: Implement media change via the
	  virDomainUpdateDeviceFlags API
	* src/xen/xen_driver.h, src/xen/xen_hypervisor.c,
	  src/xen/xen_inotify.c, src/xen/xm_internal.c,
	  src/xen/xs_internal.c: Stubs for Xen driver entry points

2010-03-26  Daniel P. Berrange  <berrange@redhat.com>

	Remote protocol impl for virDomainUpdateDeviceFlags
	This defines the wire format for the new virDomainUpdateDeviceFlags()
	API, and implements the server & client side of the marshalling code.

	* daemon/remote.c: Server side dispatch for virDomainUpdateDeviceFlags
	* src/remote/remote_driver.c: Client side serialization for
	  virDomainUpdateDeviceFlags
	* src/remote/remote_protocol.x: Define wire format for
	  virDomainUpdateDeviceFlags
	* daemon/remote_dispatch_args.h, daemon/remote_dispatch_prototypes.h,
	  daemon/remote_dispatch_table.h, src/remote/remote_protocol.c,
	  src/remote/remote_protocol.h: Re-generate code

2010-03-26  Daniel P. Berrange  <berrange@redhat.com>

	Introduce a new virDomainUpdateDeviceFlags public API
	The current virDomainAttachDevice API can be (ab)used to change
	the media of an existing CDROM/Floppy device. Going forward there
	will be more devices that can be configured on the fly and overloading
	virDomainAttachDevice for this is not too pleasant. This patch adds
	a new virDomainUpdateDeviceFlags() explicitly just for modifying
	existing devices.

	* include/libvirt/libvirt.h.in: Add virDomainUpdateDeviceFlags
	* src/driver.h: Internal API for virDomainUpdateDeviceFlags
	* src/libvirt.c, src/libvirt_public.syms: Glue public API to
	  driver API
	* src/esx/esx_driver.c, src/lxc/lxc_driver.c, src/opennebula/one_driver.c,
	  src/openvz/openvz_driver.c, src/phyp/phyp_driver.c, src/qemu/qemu_driver.c,
	  src/remote/remote_driver.c, src/test/test_driver.c, src/uml/uml_driver.c,
	  src/vbox/vbox_tmpl.c, src/xen/xen_driver.c, src/xenapi/xenapi_driver.c: Add
	  stubs for new driver entry point

2010-03-26  Daniel P. Berrange  <berrange@redhat.com>

	Add domain events for graphics network clients
	This introduces a new event type

	   VIR_DOMAIN_EVENT_ID_GRAPHICS

	The same event can be emitted in 3 scenarios

	  typedef enum {
	      VIR_DOMAIN_EVENT_GRAPHICS_CONNECT = 0,
	      VIR_DOMAIN_EVENT_GRAPHICS_INITIALIZE,
	      VIR_DOMAIN_EVENT_GRAPHICS_DISCONNECT,
	  } virDomainEventGraphicsPhase;

	Connect/disconnect are triggered at socket accept/close.
	The initialize phase is immediately after the protocol
	setup and authentication has completed. ie when the
	client is authorized and about to start interacting with
	the graphical desktop

	This event comes with *a lot* of potential information

	 - IP address, port & address family of client
	 - IP address, port & address family of server
	 - Authentication scheme (arbitrary string)
	 - Authenticated subject identity. A subject may have
	   multiple identities with some authentication schemes.
	   For example, vencrypt+sasl results in a x509dname
	   and saslUsername identities.

	This results in a very complicated callback :-(

	   typedef enum {
	      VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV4,
	      VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV6,
	   } virDomainEventGraphicsAddressType;

	   struct _virDomainEventGraphicsAddress {
	       int family;
	       const char *node;
	       const char *service;
	   };
	   typedef struct _virDomainEventGraphicsAddress virDomainEventGraphicsAddress;
	   typedef virDomainEventGraphicsAddress *virDomainEventGraphicsAddressPtr;

	   struct _virDomainEventGraphicsSubject {
	      int nidentity;
	      struct {
	          const char *type;
	          const char *name;
	      } *identities;
	   };
	   typedef struct _virDomainEventGraphicsSubject virDomainEventGraphicsSubject;
	   typedef virDomainEventGraphicsSubject *virDomainEventGraphicsSubjectPtr;

	   typedef void (*virConnectDomainEventGraphicsCallback)(virConnectPtr conn,
	                                                         virDomainPtr dom,
	                                                         int phase,
	                                                         virDomainEventGraphicsAddressPtr local,
	                                                         virDomainEventGraphicsAddressPtr remote,
	                                                         const char *authScheme,
	                                                         virDomainEventGraphicsSubjectPtr subject,
	                                                         void *opaque);

	The wire protocol is similarly complex

	   struct remote_domain_event_graphics_address {
	     int family;
	     remote_nonnull_string node;
	     remote_nonnull_string service;
	   };

	   const REMOTE_DOMAIN_EVENT_GRAPHICS_IDENTITY_MAX = 20;

	   struct remote_domain_event_graphics_identity {
	     remote_nonnull_string type;
	     remote_nonnull_string name;
	   };

	   struct remote_domain_event_graphics_msg {
	     remote_nonnull_domain dom;
	     int phase;
	     remote_domain_event_graphics_address local;
	     remote_domain_event_graphics_address remote;
	     remote_nonnull_string authScheme;
	     remote_domain_event_graphics_identity subject<REMOTE_DOMAIN_EVENT_GRAPHICS_IDENTITY_MAX>;
	   };

	This is currently implemented in QEMU for the VNC graphics
	protocol, but designed to be usable with SPICE graphics in
	the future too.

	* daemon/remote.c: Dispatch graphics events to client
	* examples/domain-events/events-c/event-test.c: Watch for
	  graphics events
	* include/libvirt/libvirt.h.in: Define new graphics event ID
	  and callback signature
	* src/conf/domain_event.c, src/conf/domain_event.h,
	  src/libvirt_private.syms: Extend API to handle graphics events
	* src/qemu/qemu_driver.c: Connect to the QEMU monitor event
	  for VNC events and emit a libvirt graphics event
	* src/remote/remote_driver.c: Receive and dispatch graphics
	  events to application
	* src/remote/remote_protocol.x: Wire protocol definition for
	  graphics events
	* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
	  src/qemu/qemu_monitor_json.c: Watch for VNC_CONNECTED,
	  VNC_INITIALIZED & VNC_DISCONNETED events from QEMU monitor

2010-03-26  Daniel P. Berrange  <berrange@redhat.com>

	Add support for an explicit IO error event
	This introduces a new event type

	   VIR_DOMAIN_EVENT_ID_IO_ERROR

	This event includes the action that is about to be taken
	as a result of the watchdog triggering

	  typedef enum {
	     VIR_DOMAIN_EVENT_IO_ERROR_NONE = 0,
	     VIR_DOMAIN_EVENT_IO_ERROR_PAUSE,
	     VIR_DOMAIN_EVENT_IO_ERROR_REPORT,
	  } virDomainEventIOErrorAction;

	In addition it has the source path of the disk that had the
	error and its unique device alias. It does not include the
	target device name (/dev/sda), since this would preclude
	triggering IO errors from other file backed devices (eg
	serial ports connected to a file)

	Thus there is a new callback definition for this event type

	typedef void (*virConnectDomainEventIOErrorCallback)(virConnectPtr conn,
	                                                     virDomainPtr dom,
	                                                     const char *srcPath,
	                                                     const char *devAlias,
	                                                     int action,
	                                                     void *opaque);

	This is currently wired up to the QEMU block IO error events

	* daemon/remote.c: Dispatch IO error events to client
	* examples/domain-events/events-c/event-test.c: Watch for
	  IO error events
	* include/libvirt/libvirt.h.in: Define new IO error event ID
	  and callback signature
	* src/conf/domain_event.c, src/conf/domain_event.h,
	  src/libvirt_private.syms: Extend API to handle IO error events
	* src/qemu/qemu_driver.c: Connect to the QEMU monitor event
	  for block IO errors and emit a libvirt IO error event
	* src/remote/remote_driver.c: Receive and dispatch IO error
	  events to application
	* src/remote/remote_protocol.x: Wire protocol definition for
	  IO error events
	* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
	  src/qemu/qemu_monitor_json.c: Watch for BLOCK_IO_ERROR event
	  from QEMU monitor

2010-03-26  Daniel P. Berrange  <berrange@redhat.com>

	Add support for an explicit watchdog event
	This introduces a new event type

	   VIR_DOMAIN_EVENT_ID_WATCHDOG

	This event includes the action that is about to be taken
	as a result of the watchdog triggering

	 typedef enum {
	     VIR_DOMAIN_EVENT_WATCHDOG_NONE = 0,
	     VIR_DOMAIN_EVENT_WATCHDOG_PAUSE,
	     VIR_DOMAIN_EVENT_WATCHDOG_RESET,
	     VIR_DOMAIN_EVENT_WATCHDOG_POWEROFF,
	     VIR_DOMAIN_EVENT_WATCHDOG_SHUTDOWN,
	     VIR_DOMAIN_EVENT_WATCHDOG_DEBUG,
	 } virDomainEventWatchdogAction;

	Thus there is a new callback definition for this event type

	 typedef void (*virConnectDomainEventWatchdogCallback)(virConnectPtr conn,
	                                                       virDomainPtr dom,
	                                                       int action,
	                                                       void *opaque);

	* daemon/remote.c: Dispatch watchdog events to client
	* examples/domain-events/events-c/event-test.c: Watch for
	  watchdog events
	* include/libvirt/libvirt.h.in: Define new watchdg event ID
	  and callback signature
	* src/conf/domain_event.c, src/conf/domain_event.h,
	  src/libvirt_private.syms: Extend API to handle watchdog events
	* src/qemu/qemu_driver.c: Connect to the QEMU monitor event
	  for watchdogs and emit a libvirt watchdog event
	* src/remote/remote_driver.c: Receive and dispatch watchdog
	  events to application
	* src/remote/remote_protocol.x: Wire protocol definition for
	  watchdog events
	* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
	  src/qemu/qemu_monitor_json.c: Watch for WATCHDOG event
	  from QEMU monitor

2010-03-26  Daniel P. Berrange  <berrange@redhat.com>

	Add support for an explicit  RTC change event
	This introduces a new event type

	   VIR_DOMAIN_EVENT_ID_RTC_CHANGE

	This event includes the new UTC offset measured in seconds.
	Thus there is a new callback definition for this event type

	 typedef void (*virConnectDomainEventRTCChangeCallback)(virConnectPtr conn,
	                                                        virDomainPtr dom,
	                                                        long long utcoffset,
	                                                        void *opaque);

	If the guest XML configuration for the <clock> is set to
	offset='variable', then the XML will automatically be
	updated with the new UTC offset value. This ensures that
	during migration/save/restore the new offset is preserved.

	* daemon/remote.c: Dispatch RTC change events to client
	* examples/domain-events/events-c/event-test.c: Watch for
	  RTC change events
	* include/libvirt/libvirt.h.in: Define new RTC change event ID
	  and callback signature
	* src/conf/domain_event.c, src/conf/domain_event.h,
	  src/libvirt_private.syms: Extend API to handle RTC change events
	* src/qemu/qemu_driver.c: Connect to the QEMU monitor event
	  for RTC changes and emit a libvirt RTC change event
	* src/remote/remote_driver.c: Receive and dispatch RTC change
	  events to application
	* src/remote/remote_protocol.x: Wire protocol definition for
	  RTC change events
	* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
	  src/qemu/qemu_monitor_json.c: Watch for RTC_CHANGE event
	  from QEMU monitor

2010-03-26  Daniel P. Berrange  <berrange@redhat.com>

	Add support for an explicit guest reboot event
	The reboot event is not a normal lifecycle event, since the
	virtual machine on the host does not change state. Rather the
	guest OS is resetting the virtual CPUs. ie, the QEMU process
	does not restart. Thus, this does not belong in the current
	lifecycle events callback.

	This introduces a new event type

	    VIR_DOMAIN_EVENT_ID_REBOOT

	It takes no parameters, besides the virDomainPtr, so it can
	use the generic callback signature.

	* daemon/remote.c: Dispatch reboot events to client
	* examples/domain-events/events-c/event-test.c: Watch for
	  reboot events
	* include/libvirt/libvirt.h.in: Define new reboot event ID
	* src/conf/domain_event.c, src/conf/domain_event.h,
	  src/libvirt_private.syms: Extend API to handle reboot events
	* src/qemu/qemu_driver.c: Connect to the QEMU monitor event
	  for reboots and emit a libvirt reboot event
	* src/remote/remote_driver.c: Receive and dispatch reboot
	  events to application
	* src/remote/remote_protocol.x: Wire protocol definition for
	  reboot events

2010-03-26  Daniel P. Berrange  <berrange@redhat.com>

	Rename domain lifecycle event message
	To avoid confusion, rename the current REMOTE_PROC_DOMAIN_EVENT
	message to REMOTE_PROC_DOMAIN_EVENT_LIFECYCLE. This does not
	cause ABI problems, since the names are only relevant at the source
	code level. On the wire they encoding is a plain integer whose
	value does not change

	* src/remote/remote_protocol.x: Rename REMOTE_PROC_DOMAIN_EVENT
	  to REMOTE_PROC_DOMAIN_EVENT_LIFECYCLE.
	* daemon/remote.c, src/remote/remote_driver.c: Update code for
	  renamed event

2010-03-26  Daniel P. Berrange  <berrange@redhat.com>

	Convert domain events example to new API
	Convert the domain events example program to use the new
	events APIs for one of its callback registrations to demo the
	new API and interoperability with the old API.

	* examples/domain-events/events-c/event-test.c: Convert to
	  new events API

2010-03-26  Daniel P. Berrange  <berrange@redhat.com>

	Remote driver & daemon impl of new event API
	This wires up the remote driver to handle the new events APIs.
	The public API allows an application to request a callback filters
	events to a specific domain object, and register multiple callbacks
	for the same event type. On the wire there are two strategies for
	this

	 - Register multiple callbacks with the remote daemon, each
	   with filtering as needed
	 - Register only one callback per event type, with no filtering

	Both approaches have potential inefficiency. In the first scheme,
	the same event gets sent over the wire many times if multiple
	callbacks are registered. With the second scheme, unneccessary
	events get sent over the wire if a per-domain filter is set on
	the client. The second scheme is far easier to implement though,
	so this patch takes that approach.

	* daemon/dispatch.h: Don't export remoteRelayDomainEvent since it
	  is no longer needed for unregistering callbacks, instead the
	  unique callback ID is used
	* daemon/libvirtd.c, daemon/libvirtd.h: Track and unregister
	  callbacks based on callback ID, instead of function pointer
	* daemon/remote.c: Switch over to using virConnectDomainEventRegisterAny
	  instead of legacy virConnectDomainEventRegister function. Refactor
	  remoteDispatchDomainEventSend() to cope with arbitrary event types
	* src/driver.h, src/driver.c: Move verify() call into source file
	  instead of header, to avoid polluting the global namespace with
	  the verify function name
	* src/remote/remote_driver.c: Implement new APIs for event
	  registration. Refactor processCallDispatchMessage() to cope
	  with arbitrary incoming event types. Merge remoteDomainQueueEvent()
	  into processCallDispatchMessage() to avoid duplication of code.
	  Rename remoteDomainReadEvent() to remoteDomainReadEventLifecycle()
	* src/remote/remote_protocol.x: Define wire format for the new
	  virConnectDomainEventRegisterAny and virConnectDomainEventDeregisterAny
	  functions

2010-03-26  Daniel P. Berrange  <berrange@redhat.com>

	Support new event register/deregister APis in all drivers except remote
	The libvirtd daemon impl will need to switch over to using the
	new event APIs. To make this simpler, ensure all drivers currently
	providing events support both the new APIs and old APIs.

	* src/lxc/lxc_driver.c, src/qemu/qemu_driver.c, src/test/test_driver.c,
	  src/vbox/vbox_tmpl.c, src/xen/xen_driver.c: Implement the new
	  virConnectDomainEvent(Dereg|Reg)isterAny driver entry points

2010-03-26  Daniel P. Berrange  <berrange@redhat.com>

	Add new internal domain events APIs for handling other event types
	The current internal domain events API tracks callbacks based on
	the function pointer, and only supports lifecycle events. This
	adds new internal APIs for registering callbacks for other event
	types. These new APIs are postfixed with the word 'ID' to indicate
	that they operated based on event ID, instead of hardcoded to
	lifecycle events

	* src/conf/domain_event.c, src/conf/domain_event.h,
	  src/libvirt_private.syms: Add new APIs for handling callbacks
	  for non-lifecycle events

2010-03-26  Daniel P. Berrange  <berrange@redhat.com>

	Refactor domain events to handle multiple event types
	The internal domain events APIs are designed to handle the lifecycle
	events. This needs to be refactored to allow arbitrary new event
	types to be handled.

	 * The signature of virDomainEventDispatchFunc changes to use
	   virConnectDomainEventGenericCallback instead of the lifecycle
	   event specific virConnectDomainEventCallback
	 * Every registered callback gains a unique ID to allow its
	   removal based on ID, instead of function pointer
	 * Every registered callback gains an 'eventID' to allow callbacks
	   for different types of events to be distinguished
	 * virDomainEventDispatch is adapted to filter out callbacks
	   whose eventID does not match the eventID of the event being
	   dispatched
	 * virDomainEventDispatch is adapted to filter based on the
	   domain name and uuid, if this filter is set for a callback.
	 * virDomainEvent type/detail fields are moved into a union to
	   allow different data fields for other types of events to be
	   added later

	* src/conf/domain_event.h, src/conf/domain_event.c: Refactor
	  to allow handling of different types of events
	* src/lxc/lxc_driver.c, src/qemu/qemu_driver.c,
	  src/remote/remote_driver.c, src/test/test_driver.c,
	  src/xen/xen_driver.c: Change dispatch function signature
	  to use virConnectDomainEventGenericCallback

2010-03-26  Daniel P. Berrange  <berrange@redhat.com>

	Make internal domain events struct definitions private
	The virtual box driver was directly accesing the domain events
	structs instead of using the APIs provided. To prevent this kind
	of abuse, make the struct definitions private, forcing use of the
	internal APIs. This requires adding one extra internal API.

	* src/conf/domain_event.h, src/conf/domain_event.c: Move
	  virDomainEventCallback and virDomainEvent structs into
	  the source file instead of header
	* src/vbox/vbox_tmpl.c: Use official APIs for dispatching domain
	  events instead of accessing structs directly.

2010-03-26  Daniel P. Berrange  <berrange@redhat.com>

	Introduce a new public API for domain events
	The current API for domain events has a number of problems

	 - Only allows for domain lifecycle change events
	 - Does not allow the same callback to be registered multiple times
	 - Does not allow filtering of events to a specific domain

	This introduces a new more general purpose domain events API

	  typedef enum {
	     VIR_DOMAIN_EVENT_ID_LIFECYCLE = 0,       /* virConnectDomainEventCallback */
	      ...more events later..
	  }

	  int virConnectDomainEventRegisterAny(virConnectPtr conn,
	                                       virDomainPtr dom, /* Optional, to filter */
	                                       int eventID,
	                                       virConnectDomainEventGenericCallback cb,
	                                       void *opaque,
	                                       virFreeCallback freecb);

	  int virConnectDomainEventDeregisterAny(virConnectPtr conn,
	                                         int callbackID);

	Since different event types can received different data in the callback,
	the API is defined with a generic callback. Specific events will each
	have a custom signature for their callback. Thus when registering an
	event it is neccessary to cast the callback to the generic signature

	eg

	  int myDomainEventCallback(virConnectPtr conn,
	                            virDomainPtr dom,
	                            int event,
	                            int detail,
	                            void *opaque)
	  {
	    ...
	  }

	  virConnectDomainEventRegisterAny(conn, NULL,
	                                   VIR_DOMAIN_EVENT_ID_LIFECYCLE,
	                                   VIR_DOMAIN_EVENT_CALLBACK(myDomainEventCallback)
	                                   NULL, NULL);

	The VIR_DOMAIN_EVENT_CALLBACK() macro simply does a "bad" cast
	to the generic signature

	* include/libvirt/libvirt.h.in: Define new APIs for registering
	  domain events
	* src/driver.h: Internal driver entry points for new events APIs
	* src/libvirt.c: Wire up public API to driver API for events APIs
	* src/libvirt_public.syms: Export new APIs
	* src/esx/esx_driver.c, src/lxc/lxc_driver.c, src/opennebula/one_driver.c,
	  src/openvz/openvz_driver.c, src/phyp/phyp_driver.c,
	  src/qemu/qemu_driver.c, src/remote/remote_driver.c,
	  src/test/test_driver.c, src/uml/uml_driver.c,
	  src/vbox/vbox_tmpl.c, src/xen/xen_driver.c,
	  src/xenapi/xenapi_driver.c: Stub out new API entries

2010-03-26  Eric Blake  <eblake@redhat.com>

	maint: update syntax-check rule to also catch test's -o operator
	* cfg.mk (sc_prohibit_test_minus_a): Rename...
	(sc_prohibit_test_minus_ao): ...and flag '-o', too.

2010-03-26  Jim Meyering  <meyering@redhat.com>

	tests: teach syntax-check that virDomainDefFree has free-like semantics
	* cfg.mk (useless_free_options): Add virDomainDefFree to the list
	of free-like functions.
	* src/test/test_driver.c (testDomainCreateXML): Remove useless-if-
	before-virDomainDefFree.
	* src/conf/domain_conf.c (virDomainAssignDef): Likewise

2010-03-25  Jiri Denemark  <jdenemar@redhat.com>

	Add entry point logging for cpu functions

2010-03-25  Eric Blake  <eblake@redhat.com>

	build: don't use "test cond1 -o cond2": it's not portable
	* configure.ac: Use "test cond1 || test cond2" instead.
	* m4/compiler-flags.m4 (gl_COMPILER_FLAGS): Likewise.
	* tests/test-lib.sh (verbose): Likewise.

2010-03-25  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Make the conf parser compare names case insensitive in VMX mode
	The keys of entries in a VMX file are case insensitive. Both scsi0:1.fileName
	and scsi0:1.filename are valid. Therefore, make the conf parser compare names
	case insensitive in VMX mode to accept every capitalization variation.

	Also add test cases for this.

2010-03-25  Matthias Bolte  <matthias.bolte@googlemail.com>

	vbox: Fix segfault on empty device source
	<source file=''/> results in def->disks[i]->src == NULL. But
	vboxDomainDefineXML and vboxDomainAttachDevice didn't check
	def->disks[i]->src for NULL and expected it to be a valid string.

	Add checks for def->disks[i]->src != NULL to fix the segfault.

2010-03-24  Philipp Hahn  <hahn@univention.de>

	python example: poll(-0.001) does not sleep forever
	The conversion from seconds to milliseconds should only be done for
	actual delays >= 0, not for the magic -1 value used for infinite
	timeouts.

2010-03-24  Jim Meyering  <meyering@redhat.com>

	build: suppress distracting build output
	* src/Makefile.am (augeas-check): New target, just to give the existing
	rule a name.  At the same time, prefix the commands with $(AM_V_GEN),
	to avoid unexpected build output with V=0 which is the default.

	maint: add syntax-check rule to prohibit use of test's -a operator
	* cfg.mk (sc_prohibit_test_minus_a): New rule.

	build: don't use "test cond1 -a cond2" in configure: it's not portable
	* configure.ac: Use "test cond1 && test cond2" instead.

	tests: shell script portability and clean-up
	* tests/test-lib.sh: "echo -n" is not portable.  Use printf instead.
	Remove unnecessary uses of "eval-in-subshell" (subshell is sufficient).
	Remove uses of tests' -a operator; it is not portable.
	Instead, use "test cond && test cond2".
	* tests/schematestutils.sh: Replace use of test's -a.

2010-03-24  Matthias Bolte  <matthias.bolte@googlemail.com>

	tests: Don't add extra padding if counter mod 40 is 0
	This change only affects the output of tests that have an exact
	multiple of 40 test cases. For example the domainschematest currently:

	TEST: domainschematest
	      ........................................ 40
	      ........................................ 80
	      ........................................ 120
	      ........................................ 160
	      ........................................                                         200 OK
	PASS: domainschematest

	It outputs additional 40 spaces on the last line.

	The domainschematest output is fixed by the change in test-lib.sh. The
	change in testutils.c fixes this for tests written in C. Currently no
	C test has an exact multiple of 40 test cases, but I checked it and
	the same problem exists there.

	This patch stops that in both cases.

2010-03-23  Jiri Denemark  <jdenemar@redhat.com>

	Fix error reporting when parsing CPU XML strings

	Use common XML parsing functions

	Introduce XML parsing utility functions

2010-03-23  Jim Meyering  <meyering@redhat.com>

	virDomainDiskDefAssignAddress: return int, not void
	Before, this function would blindly accept an invalid def->dst
	and then abuse the idx=-1 it would get from virDiskNameToIndex,
	when passing it invalid strings like "xvda:disk" and "sda1".
	Now, this function returns -1 upon failure.
	* src/conf/domain_conf.c (virDomainDiskDefAssignAddress): as above.
	Update callers.
	* src/conf/domain_conf.h: Update prototype.
	* src/qemu/qemu_conf.c: Update callers.

	tests: do not use the ":disk" suffix in sample xml input
	* tests/xml2sexprdata/xml2sexpr-curmem.xml: Remove ":disk" suffix from
	"<target dev=" value.
	* tests/xml2sexprdata/xml2sexpr-pv-localtime.xml: Likewise.
	* tests/xml2sexprdata/xml2sexpr-curmem.sexpr: Update expected output
	to match.
	* tests/xml2sexprdata/xml2sexpr-pv-localtime.sexpr: Likewise.

	virDiskNameToIndex: ignore trailing digits
	* src/util/util.c (virDiskNameToIndex): Accept sda1, and map it to "sda".
	I.e., accept and ignore any string of trailing digits.

2010-03-23  Matthias Bolte  <matthias.bolte@googlemail.com>

	util: Add stubs for some functions on Windows
	virSetCloseExec and virExecDaemonize were missing a body on Windows.

	Add HAVE_PTHREAD_H guard for pthread_sigmask
	Correctly disable pthread related code if pthread is not avialable,
	in order to get it compile with MinGW on Windows.

	bootstrap: Enable copy-mode for MinGW builds
	MSYS' ln doesn't work well in the way bootstrap uses it with relative paths.

	util: Handle lack of (f)chmod and (f)chown on Windows
	Even if gnulib can provide stubs, it won't help that much. So just
	replace affected util functions (virFileOperation and virDirCreate)
	with stubs on Windows. Both functions aren't used on libvirt's
	client side, so this is fine for MinGW builds.

2010-03-23  Matthias Bolte  <matthias.bolte@googlemail.com>

	bootstrap: Remove rsync from buildreq list
	rsync is used to download .po files, but SKIP_PO=true is set and
	downloading .po files is skipped.

	This also fixes a problem with MinGW builds, because rsync is not
	available for MinGW.

2010-03-23  Matthias Bolte  <matthias.bolte@googlemail.com>

	util: Make some conditional symbols unconditional
	Add dummy bodies for HAVE_GETPWUID_R and HAVE_MNTENT_H dependent
	functions for MinGW builds.

	Make sure virtTestCaptureProgramOutput has a body on Windows
	Now the virsh tests compile at least.

	Fix export of virConnectAuthPtrDefault for MinGW builds
	Use the __declspec(dllexport/dllimport) stuff to export the symbol,
	otherwise accessing virConnectAuthPtrDefault triggers a segfault.

	Remove interfaceRegister from libvirt_private.syms
	This symbol is conditional, it would need to be exported conditional to
	work properly with MinGW. So just remove it, as no other driver register
	function is listed in the symbols files.

	Export conditional state driver symbols only when they are defined
	This is necessary for MinGW builds.

	Make sure uid_t and gid_t are available

	esx: Add esxVI_LookupVirtualMachineByName
	Used in esxDomainLookupByName and to be used in esxDomainDefineXML later.

	esx: Fix potential memory leak in esxVI_BuildFullTraversalSpecItem
	If esxVI_String_DeepCopyValue or esxVI_SelectionSpec_AppendToList fail
	then selectionSpec would leak. Add a free call in the failure path to
	fix the leak.

	esx: Cleanup file header comments
	Replace 'method' with 'function' and get the filename's suffix right.

2010-03-23  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Generate method mappings via macros
	This is actually a consequence of the reworked required parameter
	checking: Unify the required parameter check into a Validate function
	instead of doing it separately im the (de)serialization part.

	The required parameter checking for the mapped methods parameter was
	done in the (de)serialize functions before. Now it's explicitly done
	in the mapped method itself.

2010-03-22  Jim Fehlig  <jfehlig@novell.com>

	Avoid libvirtd crash when cgroups is not configured on host
	Invoking virDomainSetMemory() on lxc driver results in libvirtd
	segfault when cgroups has not been configured on the host.

	Ensure driver->cgroup is non-null before invoking
	virCgroupForDomain().  To prevent similar segfaults in the future,
	ensure driver parameter to virCgroupForDomain() is non-null before
	dereferencing.

2010-03-22  Cole Robinson  <crobinso@redhat.com>

	security: selinux: Fix crash when releasing non-existent label
	This can be triggered by the qemuStartVMDaemon cleanup path if a
	VM references a non-existent USB device (by product) in the XML.

2010-03-22  Guido Günther  <agx@sigxcpu.org>

	Don't crash without a security driver
	"virsh dominfo <vm>" crashes if there's no primary security driver set
	since we only intialize the secmodel.model and secmodel.doi if we have
	one. Attached patch checks for securityPrimaryDriver instead of
	securityDriver since the later is always set in qemudSecurityInit().

	Closes: http://bugs.debian.org/574359

2010-03-20  Jiri Denemark  <jdenemar@redhat.com>

	Add migrate-setmaxdowntime command to virsh

	Implement virDomainMigrateSetMaxDowntime in qemu driver

	Implement virDomainMigrateSetMaxDowntime in remote driver

	Wire protocol and dispatcher for virDomainMigrateSetMaxDowntime

	Public virDomainMigrateSetMaxDowntime API

	Internal driver API for virDomainMigrateSetMaxDowntime

2010-03-20  David Allan  <dallan@redhat.com>

	Virsh support for vol wiping

	Simplified version of volume wiping based on feedback from the list.

	Implement remote bits for vol wiping

	Implement the public API for vol wiping

	Define the internal driver API for vol wiping
	Also add vol wiping to ESX storage driver struct

	Add public API for volume wiping

2010-03-19  Laine Stump  <laine@laine.org>

	Support vhost-net mode at qemu startup for virtio network devices
	Attempt to turn on vhost-net mode for devices of type NETWORK, BRIDGE,
	and DIRECT (macvtap).

	* src/qemu/qemu_conf.h: add vhostfd to qemuBuildHostNetStr prototype
	  add qemudOpenVhostNet prototype new flag to set when :,vhost=" found in
	  qemu help
	* src/qemu/qemu_conf.c: * set QEMUD_CMD_FLAG_VNET_HOST is ",vhost=" found
	  in qemu help
	   - qemudOpenVhostNet - opens /dev/vhost-net to pass to qemu if everything
	     is in place to use it.
	   - qemuBuildHostNetStr - add vhostfd to commandline if it's not empty
	     (higher levels decide whether or not to fill it in)
	   - qemudBuildCommandLine - if /dev/vhost-net is successfully opened, add
	     its fd to tapfds array so it isn't closed on qemu exec, and populate
	     vhostfd_name to be passed in to commandline builder.
	* src/qemu/qemu_driver.c: add filler 0 for new arg to qemuBuildHostNetStr,
	  along with a note that this must be implemented in order for hot-plug of
	  vhost-net virtio devices to work properly (once qemu "netdev_add" monitor
	  command is implemented).

2010-03-19  Matthias Bolte  <matthias.bolte@googlemail.com>

	qemu: Fix FD leak in qemudStartVMDaemon
	The logfile FD is dup2'ed in __virExec in the child. The FD needs to
	be closed in the parent, otherwise it leaks.

2010-03-19  Eric Blake  <eblake@redhat.com>

	util: ensure virMutexInit is not recursive
	POSIX states that creation of a mutex with default attributes
	is unspecified whether the mutex is recursive or non-recursive.
	We specifically want non-recursive (deadlock is desirable in
	flushing out coding bugs that used our mutex incorrectly).

	* src/util/threads-pthread.c (virMutexInit): Specifically request
	non-recursive mutex, rather than relying on unspecified default.

2010-03-19  Eric Blake  <eblake@redhat.com>

	maint: enforce recent copyright style
	* cfg.mk (sc_copyright_format): New rule.

2010-03-18  Eric Blake  <eblake@redhat.com>

	maint: make Red Hat copyright notices consistent
	Spell out 'Red Hat, Inc.':
	 git grep -i 'Copyright.*Red Hat' | grep -v Inc

	Include (C) consistently:
	 git grep -i 'Copyright [^(].*Red Hat'

	* src/lxc/lxc_container.c: Update copyright formatting.
	* src/node_device/node_device_udev.c: Likewise.
	* src/node_device/node_device_udev.h: Likewise.
	* src/xen/xend_internal.h: Likewise.
	* src/xen/xm_internal.c: Likewise.
	* src/xen/xm_internal.h: Likewise.
	* tests/xmconfigtest.c: Likewise.
	* tests/object-locking.ml: Likewise.
	* tools/virt-pki-validate.in: Likewise.
	* tools/virt-xml-validate.in: Likewise.

2010-03-18  Eric Blake  <eblake@redhat.com>

	maint: fix typo
	* cfg.mk (sc_prohibit_gettext_noop): Fix typo

	maint: enforce recent N_ usage
	* cfg.mk (sc_prohibit_gettext_noop): New rule applied in "make syntax-check"

2010-03-18  Daniel Veillard  <veillard@redhat.com>

	Fix logroate rpm build breakage
	related to fix of bug https://bugzilla.redhat.com/show_bug.cgi?id=547514

2010-03-18  Daniel Veillard  <veillard@redhat.com>

	Fix LSB compliance of init script
	https://bugzilla.redhat.com/show_bug.cgi?id=538701

	* daemon/libvirtd.init.in: daemon/libvirtd.init.in were not mentionned
	  in the usage message and if a missing or wrong argument is given it
	  should return 2, not 1

2010-03-18  Matthias Bolte  <matthias.bolte@googlemail.com>

	docs: <pre> cannot be nested in <p>
	xsltproc complained about this.

2010-03-18  Philip Hahn  <hahn@univention.de>

	python: Fix networkLookupByUUID
	According to:

	http://libvirt.org/html/libvirt-libvirt.html#virNetworkLookupByUUID

	virNetworkLookupByUUID() expects a virConnectPtr as its first argument,
	thus making it a method of the virConnect Python class.

	Currently it's a method of libvirt.virNetwork.

	@@ -805,13 +805,6 @@ class virNetwork:
	         if ret == -1: raise libvirtError ('virNetworkGetAutostart() failed', net=self)
	         return ret

	-    def networkLookupByUUID(self, uuid):
	-        """Try to lookup a network on the given hypervisor based on its UUID. """
	-        ret = libvirtmod.virNetworkLookupByUUID(self._o, uuid)
	-        if ret is None:raise libvirtError('virNetworkLookupByUUID() failed', net=self)
	-        __tmp = virNetwork(self, _obj=ret)
	-        return __tmp
	-
	 class virInterface:
	     def __init__(self, conn, _obj=None):
	         self._conn = conn
	@@ -1689,6 +1682,13 @@ class virConnect:
	         __tmp = virDomain(self,_obj=ret)
	         return __tmp

	+    def networkLookupByUUID(self, uuid):
	+        """Try to lookup a network on the given hypervisor based on its UUID. """
	+        ret = libvirtmod.virNetworkLookupByUUID(self._o, uuid)
	+        if ret is None:raise libvirtError('virNetworkLookupByUUID() failed', conn=self)
	+        __tmp = virNetwork(self, _obj=ret)
	+        return __tmp
	+

2010-03-18  Cole Robinson  <crobinso@redhat.com>

	.gitignore: Ignore generated daemon/libvirtd.logrotate

	Fix make dist with XenAPI changes

2010-03-17  Jiri Denemark  <jdenemar@redhat.com>

	Allow suspend during live migration
	Currently no command can be sent to a qemu process while another job is
	active. This patch adds support for signaling long-running jobs (such as
	migration) so that other threads may request predefined operations to be
	done during such jobs. Two signals are defined so far:
	    - QEMU_JOB_SIGNAL_CANCEL
	    - QEMU_JOB_SIGNAL_SUSPEND

	The first one is used by qemuDomainAbortJob.

	The second one is used by qemudDomainSuspend for suspending a domain
	during migration, which allows for changing live migration into offline
	migration. However, there is a small issue in the way qemudDomainSuspend
	is currently implemented for migrating domains. The API calls returns
	immediately after signaling migration job which means it is asynchronous
	in this specific case.

2010-03-17  Jim Meyering  <meyering@redhat.com>

	do not require two ./autogen.sh runs to permit "make"
	* autogen.sh (bootstrap_hash): New function.
	Running bootstrap may update the gnulib SHA1, yet we were computing
	t=$(git submodule status ...) *prior* to running bootstrap, and
	then recording that sometimes-stale value in the stamp file upon
	a successful bootstrap run.  That would require two (lengthy!)
	bootstrap runs to update the stamp file.

2010-03-17  Matthias Bolte  <matthias.bolte@googlemail.com>

	phyp: Use virRequestUsername and virRequestPassword

	xenapi: Don't leak url and caps in case of error

	xenapi: Check for NULL before accessing the scheme

	xenapi: Request a username if there is non in the URI
	Use virRequestUsername and virRequestPassword.

	xenapi: Check for valid private data in xenapiSessionErrorHandle

	esx: Move username and password helper functions to authhelper.c

2010-03-17  Jim Meyering  <meyering@redhat.com>

	fix two "make syntax check" failures
	* src/xenapi/xenapi_driver.c (xenapiOpen): Remove useless-if-before-free.
	* po/POTFILES.in: Add src/xenapi/xenapi_utils.c.

2010-03-16  Jiri Denemark  <jdenemar@redhat.com>

	Use WARN_CFLAGS when compiling virsh.c

	Use fsync() at the end of file allocation instead of O_DSYNC
	Instead of opening storage file with O_DSYNC, make sure data are written
	to a disk only before we claim allocation has finished.

2010-03-16  Jim Meyering  <meyering@redhat.com>

	Revert f5a6ce44ce8368d4183b69a31b77f67688d9af43
	* src/qemu/qemu_driver.c (qemudDomainAttachSCSIDisk): The ".controller"
	member is an index, and *may* be 0.  As such, the commit that we're
	reverting broke SCSI disk hot-plug on controller 0.
	Reported by Wolfgang Mauerer.

2010-03-16  Cole Robinson  <crobinso@redhat.com>

	security: Set permissions for kernel/initrd
	Fixes URL installs when running virt-install as root on Fedora.

	qemu: Fix USB by product with security enabled
	We need to call PrepareHostdevs to determine the USB device path before
	any security calls. PrepareHostUSBDevices was also incorrectly skipping
	all USB devices.

	qemu: Add some debugging at domain startup

2010-03-16  Daniel Veillard  <veillard@redhat.com>

	qemu: pass the information when disks are read-only
	* src/qemu/qemu_conf.c: add the ",readonly=on" for read-only disks
	  and also parse it back in qemuParseCommandLineDisk()
	* tests/qemuxml2argvtest.c
	  tests/qemuxml2argvdata/qemuxml2argv-disk-drive-readonly-disk.args
	  tests/qemuxml2argvdata/qemuxml2argv-disk-drive-readonly-disk.xml:
	  add a specific regression test

2010-03-15  Jiri Denemark  <jdenemar@redhat.com>

	Fix syntax-check errors

	Fix error messages in qemu text monitor

2010-03-15  Sharadha Prabhakar  <sharadha.prabhakar@citrix.com>

	xenapi: Initial commit of the new driver

2010-03-13  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Improve documentation about remote URIs

	macvtap: Only export symbols if support is enabled

2010-03-13  Chris Lalancette  <clalance@redhat.com>

	Only use the numa functions when they are available.

2010-03-12  Chris Lalancette  <clalance@redhat.com>

	Make nodeGetInfo report the correct number of NUMA nodes.
	The nodeGetInfo code was always assuming that machine had a
	single NUMA node, which is not correct.  The good news is that
	libnuma gives us this information pretty easily, so let's
	properly report it.

	NOTE: With recent hardware starting to support CPU hot-add
	and hot-remove, both this code and the nodeCapsInitNUMA()
	code are quickly going to become obsolete.  We'll have to
	think of a more dynamic solution for dealing with NUMA
	nodes and CPUs that can come and go at will.

2010-03-12  Chris Lalancette  <clalance@redhat.com>

	Fix crash in virsh after bogus command
	If you ran virsh in interactive mode and ran a command
	that virsh could not parse, it would then SEGV
	on subsequent commands.  The problem is that we are
	freeing the vshCmd structure in the syntaxError label
	at the end of vshCommandParse, but forgetting to
	set ctl->cmd to NULL.  This means that on the next command,
	we would try to free the same structure again, leading
	to badness.

	* tools/virsh.c: Make sure to set ctl->cmd to NULL after
	  freeing it in vshCommandParse()

2010-03-12  Chris Lalancette  <clalance@redhat.com>

	Fix virsh command 'cd'
	* tools/virsh.c: cmdCd was returning a 0 on success and -1 on error,
	  when the rest of the code expected a TRUE on success and a
	  FALSE on error.

2010-03-12  Laine Stump  <laine@laine.org>

	Fix compiler warnings in virsh.c
	No functional change. These all generated compiler warnings which, for
	some reason weren't converted to errors by
	--enable-compiler-warnings=error.

	* tools/virsh.c:
	  - change return type from int to void on two functions that don't
	    return a value.
	  - remove unused variables/labels from two functions
	  - eliminate non-literal format strings
	  - typecast char* into xmlChar* when calling
	  - xmlParseBalancedChunkMemory

2010-03-12  Laine Stump  <laine@laine.org>

	Silence compiler complaints about non-literal format strings
	* src/util/macvtap.c: replace _("....") with "%s", _("...") in two places

2010-03-12  Daniel Veillard  <veillard@redhat.com>

	Update commiters list

2010-03-12  Chris Lalancette  <clalance@redhat.com>

	Fix hang in qemudDomainCoreDump.
	Currently if you dump the core of a qemu guest with
	qemudDomainCoreDump, subsequent commands will hang
	up libvirtd.  This is because qemudDomainCoreDump
	uses qemuDomainWaitForMigrationComplete, which expects
	the qemuDriverLock to be held when it's called.  This
	patch does the simple thing and moves the qemuDriveUnlock
	to the end of the qemudDomainCoreDump so that the driver
	lock is held for the entirety of the call (as it is done
	in qemudDomainSave).  We will probably want to make the
	lock more fine-grained than that in the future, but
	we can fix both qemudDomainCoreDump and qemudDomainSave
	at the same time.

	Make sure qemudDomainSetVcpus doesn't hang.
	The code to add job support into libvirtd caused a problem
	in qemudDomainSetVcpus.  In particular, a qemuDomainObjEndJob()
	call was added at the end of the function, but a
	corresponding qemuDomainObjBeginJob() was not.  Additionally,
	a call to qemuDomainObj{Enter,Exit}Monitor() was also missed
	in qemudDomainHotplugVcpus().  These missing calls conspired to
	cause a hang in the libvirtd process after the command was
	finished.  Fix this by adding the missing calls.

2010-03-11  Chris Lalancette  <clalance@redhat.com>

	Remove qemudDomainSetMaxMemory.
	As previously discussed[1], this patch removes the
	qemudDomainSetMaxMemory() function, since it doesn't
	work.  This means that instead of getting somewhat
	cryptic errors, you will now get:

	error: Unable to change MaxMemorySize
	error: this function is not supported by the hypervisor: virDomainSetMaxMemory

	Which describes the situation perfectly.

	[1] https://www.redhat.com/archives/libvir-list/2010-February/msg00928.html

2010-03-11  Chris Lalancette  <clalance@redhat.com>

	Fix a JSON CPU information bug.
	When using the JSON monitor, qemuMonitorJSONExtractCPUInfo
	was returning 0 on success.  Unfortunately, higher levels of
	the cpuinfo code expect that it returns the number of CPUs
	it found on success.  This one-line patch fixes it so that
	it returns the correct number.  This makes "virsh vcpuinfo <domain>"
	work when using the JSON monitor.

2010-03-11  Ed Swierk  <eswierk@aristanetworks.com>

	Allow devices without a parent
	* Allow devices without parent links to be created and set their parent to the root "computer" node

2010-03-11  Eric Blake  <eblake@redhat.com>

	build: change to gnulib module list should rerun bootstrap
	* autogen.sh (curr_status): Also include hash of bootstrap.conf
	when checking for changes that require bootstrap rerun.
	* cfg.mk (_update_required): Likewise.

2010-03-11  Eric Blake  <eblake@redhat.com>

	build: enforce preprocessor indentation
	Since cppi is not part of Fedora Core 12, the check is conditional:
	without cppi, running 'make syntax-check' merely warns:

	$ make sc_preprocessor_indentation
	preprocessor_indentation
	maint.mk: skipping test sc_preprocessor_indentation: cppi not installed

	* cfg.mk (sc_preprocessor_indentation): New syntax-check rule.
	(preprocessor_exempt): New macro, with first exemption.

2010-03-11  Jim Meyering  <meyering@redhat.com>

	build: update gnulib submodule to newer (but not latest)
	This is a stop-gap measure to make autogen.sh rerun ./bootstrap,
	(required due to recent bootstrap.conf addition) while we prepare
	the fix to automatically detect the case of an updated modules list.

2010-03-11  David Allan  <dallan@redhat.com>

	Free resources on error in udev startup
	* The udev driver didn't properly free resources that it allocates when setting up the 'computer' device in the error case.

2010-03-11  Daniel Veillard  <veillard@redhat.com>

	Make virsh reconnect when losing connection
	When the daemon libvirtd restarts, a connected virsh gets a SIGPIPE
	and dies. This change the behaviour to try to reconnect if the
	signal was received or command error indicated a connection or RPC
	failure. Note that the failing command is not restarted.

	* tools/virsh.c: catch SIGPIPE signals as well as connection related
	  failures, add some automatic reconnection code and appropriate error
	  messages.

2010-03-10  Chris Lalancette  <clalance@redhat.com>

	Fix up nodeinfo parsing code.
	As pointed out by eblake, I made a real hash of the
	nodeinfo code with commit
	aa2f6f96ddd7a57011c3d25586d588100651feb2.  This patch
	cleans it up:

	1)  Do more work at compile time instead of runtime (minor)
	2)  Properly handle the hex digits that come from
	/sys/devices/system/cpu/cpu*/topology/thread_siblings
	3)  Fix up some error paths that could cause SEGV
	4)  Used unsigned's for the cpu numbers (cpu -1 doesn't
	make any sense)

	Along with the recent patch from jdenemar to zero out
	the nodeinfo structure, I've re-tested this on the
	machines having the problems, and it seems to be good.

2010-03-10  Daniel Veillard  <veillard@redhat.com>

	Change logrotate to be per-hypervisor logs
	Having a single logrotate configuration file for all hypervisors
	did not work as logrotate would get confused if an hypervisor not
	supported on that platform was still listed. Simplest is to split
	the logrotate as separate per hypervisor files and change the
	spec file to only install the ones compiled in.
	* daemon/libvirtd.lxc.logrotate.in daemon/libvirtd.qemu.logrotate.in
	  daemon/libvirtd.uml.logrotate.in: copy and split the original
	  daemon/libvirtd.logrotate.in file
	* daemon/Makefile.am: update to support the different files and
	  cleanup in sed suggested by Eric Blake
	* libvirt.spec.in: only install the relevant logrotate configs
	* daemon/.gitignore: update logrotate generated list

2010-03-10  Eric Blake  <eblake@redhat.com>

	build: consistently indent preprocessor directives
	* global: patch created by running:
	for f in $(git ls-files '*.[ch]') ; do
	    cppi $f > $f.t && mv $f.t $f
	done

2010-03-10  Eric Blake  <eblake@redhat.com>

	virsh: use N_ rather than gettext_noop
	With N_() in place, we can use it for a smaller file.

	* doc/api-extension/0008-Step-8-of-8-Add-virsh-support.patch:
	Replace all uses of gettext_noop with N_.
	* tools/virsh.c: Likewise, throughout the file.

2010-03-10  Eric Blake  <eblake@redhat.com>

	virsh: fix existing N_ uses
	It is a bad idea to call gettext on an already-translated
	string.  In cases where a string must be translated separately
	from where it is exposed to xgettext, the gettext manual
	recommends the idiom of N_() wrapping gettext_noop for
	marking the string.

	* src/internal.h (N_): Fix definition to match gettext manual.
	* tools/virsh.c: (cmdHelp, cmdList, cmdDomstate, cmdDominfo)
	(cmdVcpuinfo, vshUsage): Replace incorrect use of N_ with _.
	(vshCmddefHelp): Likewise.  Mark C format strings appropriately.

2010-03-10  Jim Meyering  <meyering@redhat.com>

	doc: fix typos in hacking.html.in; mark HACKING as read-only
	* HACKING: Mark as read-only.  Soon we'll generate it from...
	* docs/hacking.html.in: ... this file.  More typo fixes.

2010-03-10  Jiri Denemark  <jdenemar@redhat.com>

	Fix copy&paste typos in virProcessInfoGetAffinity

2010-03-10  Jiri Denemark  <jdenemar@redhat.com>

	Wipe nodeinfo structure before filling it
	The nodeinfo structure wasn't initialized in qemu driver and with the
	recent change in CPU topology parsing, old value of nodeinfo->sockets
	could be used and incremented giving totally bogus results.

	Let's just wipe the structure completely.

2010-03-10  Jim Meyering  <meyering@redhat.com>

	doc: fix more typos in HACKING
	* HACKING: More spelling/typo fixes.

2010-03-10  Eric Blake  <eblake@redhat.com>

	AUTHORS: add recent contributors

	hacking: add a section on preprocessor conventions
	* doc/hacking.html.in (preprocessor): New section to document
	recently-discussed style issues.

	hacking: fix typos
	* docs/hacking.html.in (committers): Fix spelling and grammar.

2010-03-09  Laine Stump  <laine@laine.org>

	Fix format string warnings
	A few more non-literal format strings in error log messages have crept
	in. Fix them in the standard way - turn the format string into "%s"
	with the original string as the arg.

2010-03-09  Stefan Berger  <stefanb@us.ibm.com>

	macvtap build detection fix
	* configure.ac: fix the header test used for macvtap availability
	  detection

2010-03-09  Soren Hansen  <soren@ubuntu.com>

	Fix virDomainGetXMLDesc cache settings output
	If a special cache strategy for a disk has been specified in a domain
	definition, but no driverName has been set, virDomainGetXMLDesc would not
	include the <driver> tag at all.

	* src/conf/domain_conf.c: make sure any <driver> tag setting is
	  serialized if set.

2010-03-08  David Allan  <dallan@redhat.com>

	Update hacking.html.in
	* Added section on use of goto
	* Added missing content from HACKING document

2010-03-08  Chris Lalancette  <clalance@redhat.com>

	Get thread and socket information in virsh nodeinfo.
	The current code for "nodeinfo" is pretty naive
	about socket and thread information.  To determine the
	sockets, it just takes the number of cpus and divides
	by the number of cores.  For the thread count, it always
	sets it to 1.  With more recent Intel machines, however,
	hyperthreading is again an option, meaning that these
	heuristics no longer work and give bogus numbers.  This
	patch goes through /sys to get the additional
	information so we properly report it.

	Note that I had to edit the tests not to report on
	socket and thread counts, since these are determined
	dynamically now.

	v2: As pointed out by Eric Blake, gnulib provides
	    count-one-bits (which is LGPLv2+).  Use it instead
	    of a hand-coded popcnt.

2010-03-08  Adam Litke  <agl@us.ibm.com>

	Fix locking in qemudDomainMemoryStats
	When adding domainMemoryStats API support for the qemu driver, I didn't
	follow the locking rules exactly.  The job condition must be held when
	executing monitor commands.  This corrects the segfaults I was seeing
	when calling domainMemoryStats in a multi-threaded environment.

	* src/qemu/qemu_driver.c: in qemudDomainMemoryStats() add missing
	  calls to qemuDomainObjBeginJob/qemuDomainObjEndJob

2010-03-08  Laine Stump  <laine@laine.org>

	Eliminate large stack buffer in doTunnelSendAll
	doTunnelSendAll function (used by QEMU migration) uses a 64k buffer on
	the stack, which could be problematic. This patch replaces that with a
	buffer from the heap.

	While in the neighborhood, this patch also improves error reporting in
	the case that saferead fails - previously, virStreamAbort() was called
	(resetting errno) before reporting the error. It's been changed to
	report the error first.

	* src/qemu/qemu_driver.c: fix doTunnelSendAll() to use a malloc'ed
	  buffer

2010-03-08  Eric Blake  <eblake@redhat.com>

	build: consistently use C99 varargs macros
	Prior to this patch, there was an inconsistent mix between GNU and C99.

	For consistency, and potential portability to other compilers, stick
	with the C99 vararg macro syntax.

	* src/conf/cpu_conf.c (virCPUReportError): Use C99 rather than GNU
	  vararg macro syntax.
	* src/conf/domain_conf.c (virDomainReportError): Likewise.
	* src/conf/domain_event.c (eventReportError): Likewise.
	* src/conf/interface_conf.c (virInterfaceReportError): Likewise.
	* src/conf/network_conf.c (virNetworkReportError): Likewise.
	* src/conf/node_device_conf.h (virNodeDeviceReportError): Likewise.
	* src/conf/secret_conf.h (virSecretReportError): Likewise.
	* src/conf/storage_conf.h (virStorageReportError): Likewise.
	* src/esx/esx_device_monitor.c (ESX_ERROR): Use C99 rather than
	  GNU vararg macro syntax.
	* src/esx/esx_driver.c (ESX_ERROR): Likewise.
	* src/esx/esx_interface_driver.c (ESX_ERROR): Likewise.
	* src/esx/esx_network_driver.c (ESX_ERROR): Likewise.
	* src/esx/esx_secret_driver.c (ESX_ERROR): Likewise.
	* src/esx/esx_storage_driver.c (ESX_ERROR): Likewise.
	* src/esx/esx_util.c (ESX_ERROR): Likewise.
	* src/esx/esx_vi.c (ESX_VI_ERROR): Likewise.
	* src/esx/esx_vi_methods.c (ESX_VI_ERROR): Likewise.
	* src/esx/esx_vi_types.c (ESX_VI_ERROR): Likewise.
	* src/esx/esx_vmx.c (ESX_ERROR): Likewise.
	* src/util/hostusb.c (usbReportError): Use C99 rather than GNU
	  vararg macro syntax.
	* src/util/json.c (virJSONError): Likewise.
	* src/util/macvtap.c (ReportError): Likewise.
	* src/util/pci.c (pciReportError): Likewise.
	* src/util/stats_linux.c (virStatsError): Likewise.
	* src/util/util.c (virUtilError): Likewise.
	* src/util/xml.c (virXMLError): Likewise.
	* src/xen/proxy_internal.c (virProxyError): Use C99 rather than
	  GNU vararg macro syntax.
	* src/xen/sexpr.c (virSexprError): Likewise.
	* src/xen/xen_driver.c (xenUnifiedError): Likewise.
	* src/xen/xen_hypervisor.c (virXenError): Likewise.
	* src/xen/xen_inotify.c (virXenInotifyError): Likewise.
	* src/xen/xend_internal.c (virXendError): Likewise.
	* src/xen/xm_internal.c (xenXMError): Likewise.
	* src/xen/xs_internal.c (virXenStoreError): Likewise.
	* src/cpu/cpu.h (virCPUReportError): Use C99 rather than GNU
	  vararg macro syntax.
	* src/datatypes.c (virLibConnError): Likewise.
	* src/interface/netcf_driver.c (interfaceReportError): Likewise.
	* src/libvirt.c (virLibStreamError): Likewise.
	* src/lxc/lxc_conf.h (lxcError): Likewise.
	* src/network/bridge_driver.c (networkReportError): Likewise.
	* src/nodeinfo.c (nodeReportError): Likewise.
	* src/opennebula/one_conf.h (oneError): Likewise.
	* src/openvz/openvz_conf.h (openvzError): Likewise.
	* src/phyp/phyp_driver.c (PHYP_ERROR): Likewise.
	* src/qemu/qemu_conf.h (qemuReportError): Likewise.
	* src/remote/remote_driver.c (errorf): Likewise.
	* src/security/security_driver.h (virSecurityReportError): Likewise.
	* src/test/test_driver.c (testError): Likewise.
	* src/uml/uml_conf.h (umlReportError): Likewise.
	* src/vbox/vbox_driver.c (vboxError): Likewise.
	* src/vbox/vbox_tmpl.c (vboxError): Likewise.

2010-03-06  Jim Meyering  <meyering@redhat.com>

	ebtablesAddRemoveRule: avoid dead store
	* src/util/ebtables.c (ebtablesAddRemoveRule): Avoid dead store
	to local, "s".

	virInterfaceDefParseBond: avoid dead stores
	* src/conf/interface_conf.c (virInterfaceDefParseBond): Avoid dead stores
	to local, "node".  Remove declaration, too.

	xenXMDomainConfigParse: avoid dead store
	* src/xen/xm_internal.c (xenXMDomainConfigParse): Avoid dead store
	to local, "data".  Remove declaration, too.

	qemudDomainAttachSCSIDisk: handle empty controller list
	* src/qemu/qemu_driver.c (qemudDomainAttachSCSIDisk): Handle
	the (theoretical) case of an empty controller list, so that
	clang does not think the subsequent dereference of "cont"
	would dereference an undefined variable (due to preceding
	loop not iterating even once).

	qemu restore: don't let corrupt input provoke unwarranted OOM
	* src/qemu/qemu_driver.c (qemudDomainRestore): A corrupt save file
	(in particular, a too-large header.xml_len value) would cause an
	unwarranted out-of-memory error.  Do not trust the just-read
	header.xml_len.  Instead, merely use that as a hint, and
	read/allocate up to that number of bytes from the file.
	Also verify that header.xml_len is positive; if it were negative,
	passing it to virFileReadLimFD could cause trouble.

	virFileReadLimFD: diagnose maxlen <= 0, rather than passing it on...
	to saferead_lim, which interprets it as a size_t.
	* src/util/util.c (virFileReadLimFD): Do not malfunction when
	maxlen < -1.  Return -1,EINVAL in that case.  Handle maxlen==0
	in the same manner.

	xen: don't let bogus packets trigger over-allocation and segfault
	* src/xen/proxy_internal.c (xenProxyDomainDumpXML): An invalid packet
	could include a too-large "ans.len" value, which would make us allocate
	too much memory and then copy data from beyond the end of "ans",
	possibly evoking a segfault.  Ensure that the value we use is no
	larger than the remaining portion of "ans".
	Also, change unnecessary memmove to memcpy (src and dest obviously
	do not overlap, so no need to use memmove).
	(xenProxyDomainGetOSType): Likewise.
	(xenProxyGetCapabilities): Likewise.

	qemuMonitorTextGetMemoryStats: decrease risk of false positive in parsing
	The code erroneously searched the entire "reply" for a comma, when
	its intent was to search only that portion after "balloon: actual="
	* src/qemu/qemu_monitor_text.c (qemuMonitorTextGetMemoryStats):
	Search for "," only starting *after* the BALLOON_PREFIX string.
	Otherwise, we'd be more prone to false positives.

2010-03-06  Daniel Veillard  <veillard@redhat.com>

	Release of libvirt-0.7.7
	* configure.ac libvirt.spec.in: update with new version
	* docs/news.html.in: add list of changes in 0.7.7
	* po/*po*: updated spanish and russian localisations, rebuilt

2010-03-05  Daniel P. Berrange  <berrange@redhat.com>

	Fix USB passthrough based on product/vendor
	Changeset

	  commit 5073aa994af460e775cb3e548528e28d7660fcc8
	  Author: Cole Robinson <crobinso@redhat.com>
	  Date:   Mon Jan 11 11:40:46 2010 -0500

	Added support for product/vendor based passthrough, but it only
	worked at the security driver layer. The main guest XML config
	was not updated with the resolved bus/device ID. When the QEMU
	argv refactoring removed use of product/vendor, this then broke
	launching guests.

	THe solution is to move the product/vendor resolution up a layer
	into the QEMU driver. So the first thing QEMU does is resolve
	the product/vendor to a bus/device and updates the XML config
	with this info. The rest of the code, including security drivers
	and QEMU argv generated can now rely on bus/device always being
	set.

	* src/util/hostusb.c, src/util/hostusb.h: Split vendor/product
	  resolution code out of usbGetDevice and into usbFindDevice.
	  Add accessors for bus/device ID
	* src/security/virt-aa-helper.c, src/security/security_selinux.c,
	  src/qemu/qemu_security_dac.c: Remove vendor/product from the
	  usbGetDevice() calls
	* src/qemu/qemu_driver.c: Use usbFindDevice to resolve vendor/product
	  into a bus/device ID

2010-03-05  Daniel P. Berrange  <berrange@redhat.com>

	Convert QEMU driver all hotunplug code from pci_del to device_del
	The pci_del command is not being ported to QMP. Convert all the
	QEMU hotplug code over to use device_del whenever it is available
	to avoid the pci_del problem

	* src/qemu/qemu_driver.c: Convert unplug code to device_del

2010-03-05  Daniel P. Berrange  <berrange@redhat.com>

	Support hot-unplug for USB devices in QEMU
	Previously hot-unplug could not be supported for USB devices
	in QEMU, since usb_del required the guest visible address
	which libvirt never knows. With 'device_del' command we can
	now unplug based on device alias, so support that.

	* src/qemu/qemu_driver.c: Use device_del to remove USB devices

2010-03-05  Daniel P. Berrange  <berrange@redhat.com>

	Tweak container initialization to make upstart/init happier
	Upstart crashes & burns in a heap if $TERM environment variable
	is missing. Presumably the kernel always sets this when booting
	init on a real machine, so libvirt should set it for containers
	too.

	To make a typical inittab / mingetty setup happier, we need to
	symlink the primary console /dev/pts/0 to /dev/tty1.

	Improve logging in certain scenarios to make troubleshooting
	easier

	* src/lxc/lxc_container.c: Create /dev/tty1 and set $TERM

2010-03-05  Daniel P. Berrange  <berrange@redhat.com>

	Misc fixes for LXC cgroups setup
	When using the 'ns' cgroup controller, the moment a process calls
	'unshare(CLONE_NEWNS)', it will be given a private cgroup tree
	under its current location. This really messages up the LXC
	controller process, because it ends up creating the containers'
	cgroup in the wrong place. The fix is fairly easy, just move
	the cgroup setup before the code which calls unshare(). The
	'ns' controller will still create extra undesired cgroups, but
	they at least won't break libvirt's setup now.

	The patch also adds a missing cgroups allow rule for /dev/tty
	device node

2010-03-05  Daniel P. Berrange  <berrange@redhat.com>

	Avoid creating top level cgroups if just querying for existance
	When getting the driver/domain cgroup it is possible to specify
	whether it should be auto created. If auto-creation was turned
	off, libvirt still mistakenly created its own top level cgroup

	* src/util/cgroup.c: Honour autocreate flag for top level cgroup

2010-03-05  Stefan Berger  <stefanb@us.ibm.com>

	web docs -- macvtap mode explanation
	This adds more information about the different macvtap device modes,
	spells out VEPA and adds a link to a pdf at the ieee site.

2010-03-05  Laine Stump  <laine@laine.org>

	Change default for storage uid/gid from getuid()/getgid() to -1/-1
	This allows the config to have a setting that means "leave it alone",
	eg when building a pool where the directory already exists the user
	may want the current uid/gid of the directory left intact. This
	actually gets us back to older behavior - before recent changes to the
	pool building code, we weren't as insistent about honoring the uid/gid
	settings in the XML, and virt-manager was taking advantage of this
	behavior.

	As a side benefit, removing calls to getuid/getgid from the XML
	parsing functions also seems like a good idea. And having a default
	that is different from a common/useful value (0 == root) is a good
	thing in general, as it removes ambiguity from decisions (at least one
	place in the code was checking for (perms.uid == 0) to see if a
	special uid was requested).

	Note that this will only affect newly created pools and volumes. Due
	to the way that the XML is parsed, then formatted for newly created
	volumes, all existing pools/volumes already have an explicit uid and
	gid set.

	src/conf/storage_conf.c: Remove calls to setuid/setgid for default values
	                         of uid/gid, and set them to -1 instead

	src/storage/storage_backend.c:
	src/storage/storage_backend_fs.c:
	        Make account for the new default values of perms.uid
	        and perms.gid.

2010-03-05  Diego Elio Pettenò  <flameeyes@gmail.com>

	build: vbox: avoid build failure when linking with --no-add-needed
	With the recent changes to the linking defaults in Fedora 13 (namely
	enabling --no-add-needed behaviour by default), we have to pass the
	dlopen()-providing libraries directly at the link of the module; use the
	same AC_SEARCH_LIBS function as used before to look for it and add it to
	the Makefile.

	build: avoid dlopen-related link failure on rawhide/F13
	Instead of using AC_CHECK_LIB and hardcoding -ldl, search for the library
	needed to get dlopen() and then use the cached value.

2010-03-04  Daniel P. Berrange  <berrange@redhat.com>

	Support VCPU hotplug in QEMU guests
	QEMU has a monitor command 'set_cpu' which allows a specific
	CPU to be toggled between online& offline state. libvirt CPU
	hotplug does not work in terms of individual indexes CPUs.
	Thus to support this, we iteratively toggle the online state
	when the total number of vCPUs is adjusted via libvirt

	NB, currently untested since QEMU segvs when running this!

	* src/qemu/qemu_driver.c: Toggle online state for CPUs when
	  doing hotplug
	* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
	  src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h,
	  src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h: Add
	  monitor API for toggling a CPU's online status via 'set_cpu

2010-03-04  Daniel P. Berrange  <berrange@redhat.com>

	Fix parser checking of storage pool device
	The storage backend implementations all presume that the XML parser
	is validating correctness of the source specification. The check for
	a source device was lost at some point. This allowed for a potential
	crash in the disk backend. Re-introduce the sanity check

	* src/conf/storage_conf.c: Re-add check for source device

2010-03-04  Daniel P. Berrange  <berrange@redhat.com>

	Fix mis-leading error message in pool delete API
	When trying to delete a pool the error message claimed the volume
	could not be deleted.

	* src/storage/storage_driver.c: Error message referred to
	  volumes instead of pools

2010-03-04  Daniel P. Berrange  <berrange@redhat.com>

	Fix typo in QEMU migration command name
	The QMP code was running query-migration instead of query-migrate.
	This doesn't work so well

	* src/qemu/qemu_monitor_json.c: s/query-migration/query-migrate/

2010-03-04  Daniel P. Berrange  <berrange@redhat.com>

	Don't raise error message from cgroups if QEMU fails to start
	The code to remove the cgroup after QEMU failed to startup could
	be obscuring a real error from earlier on. It is not neccessary
	to raise an error in this case, so tell cgroups to keep quiet

	* src/qemu/qemu_driver.c: Don't raise cgroups error in QEMU start
	  cleanup code.

2010-03-04  Daniel P. Berrange  <berrange@redhat.com>

	Add missing device type check in QEMU PCI hotunplug
	The QEMU hotunplug code for PCI devices was looking at host
	devices in the guest config without first filtering non
	PCI devices. This means it was reading garbage

	* src/qemu/qemu_driver.c: Filter out non-PCI devices

2010-03-04  Chris Lalancette  <clalance@redhat.com>

	Add a define for NFS_SUPER_MAGIC
	Commit 3c12a67b766cce51b47861ccde2be41de369f832 added
	a dependency on the NFS_SUPER_MAGIC macro, which is
	defined in linux/magic.h.  Unfortunately linux/magic.h
	is not available in RHEL-5, and causes a compile error.
	Just define it locally, since this is something that
	can't change.

2010-03-04  Laine Stump  <laine@laine.org>

	Make domain save work on root-squash NFS
	Move *all* file operations related to creation and writing of libvirt
	header to the domain save file into a hook function that is called by
	virFileOperation. First try to call virFileOperation as root. If that
	fails with EACCESS, and (in the case of Linux) statfs says that we're
	trying to save the file on an NFS share, rerun virFileOperation,
	telling it to fork a child process and setuid to the qemu user. This
	is the only way we can successfully create a file on a root-squashed
	NFS server.

	This patch (along with setting dynamic_ownership=0 in qemu.conf)
	makes qemudDomainSave work on root-squashed NFS.

	* src/qemu/qemu_driver.c: provide new qemudDomainSaveFileOpHook()
	  utility, use it in qemudDomainSave() if normal creation of the
	  file as root failed, and after checking the filesystem type for
	  the storage is NFS. In that case we also bypass the security
	  driver, as this would fail on NFS.

2010-03-03  Laine Stump  <laine@laine.org>

	Fix domain restore for files on root-squash NFS
	If qemudDomainRestore fails to open the domain save file, create a
	pipe, then fork a process that does setuid(qemu_user) and opens the
	file, then reads this file and stuffs it into the pipe. the parent
	libvirtd process will use the other end of the pipe as its fd, then
	reap the child process after it's done reading.

	This makes domain restore work on a root-squash NFS share that is only
	visible to the qemu user.

	* src/qemu/qemu_driver.c: add new qemudOpenAsUID() helper function,
	  and use it in qemudDomainRestore() if reading as root directly failed.

2010-03-03  Daniel P. Berrange  <berrange@redhat.com>

	Fix USB/PCI device address aliases in QEMU hotplug driver
	The USB/PCI device hotplug code for the QEMU driver was forgetting
	to allocate a unique device alias.

	* src/qemu/qemu_driver.c: Fill in device alias for USB/PCI devices

2010-03-03  Daniel P. Berrange  <berrange@redhat.com>

	Fix detection of errors in QEMU device_add command
	The code assumed that 'device_add' returned an empty string upon
	success. This is not true, it sometimes prints random debug info.
	THus we need to check for an explicit fail string

	* src/qemu/qemu_monitor_text.c: Fix error checking of the device_add
	  monitor command

2010-03-03  Eric Blake  <eblake@redhat.com>

	esx: don't ignore failure on close
	Another warning caught by coverity.  Continue to perform best-effort
	closing and resource release, but warn the caller about the failure.

	* src/esx/esx_driver.c (esxClose): Return an error on failure to close.

2010-03-03  Eric Blake  <eblake@redhat.com>

	uml: avoid crash on partial read
	Coverity detected a potential dereference of uninitialized memory
	if recvfrom got cut short.

	* src/uml/uml_driver.c (umlMonitorCommand): Validate complete read
	prior to dereferencing res.

2010-03-03  Eric Blake  <eblake@redhat.com>

	virsh: silence compiler warning
	gcc warns:
	virsh.c:1879: warning: '0' flag ignored with '-' flag in gnu_printf format

	* tools/virsh.c (cmdDomjobinfo): Delete useless flag.

2010-03-03  Jiri Denemark  <jdenemar@redhat.com>

	Fix safezero()
	Various safezero() implementations used either -1, errno or -errno
	return values. This patch fixes them all to return -1 and set errno
	appropriately.

	There was also a bug in size parameter passed to safewrite() which could
	result in an attempt to write gigabytes out of a megabyte buffer.

2010-03-03  Daniel P. Berrange  <berrange@redhat.com>

	Fix QEMU domain state after a save attempt fails
	When a VM save attempt failed, the VM would be left in a paused
	state. It is neccessary to resume CPU execution upon failure
	if it was running originally

	* src/qemu/qemu_driver.c: Resume CPUs upon save failure

2010-03-03  Daniel P. Berrange  <berrange@redhat.com>

	Support job cancellation in QEMU driver
	This supports cancellation of jobs for the QEMU driver against
	the virDomainMigrate, virDomainSave and virDomainCoreDump APIs.
	It is not yet supported for the virDomainRestore API, although
	it is desirable.

	* src/qemu/qemu_driver.c: Issue 'migrate_cancel' command if
	  virDomainAbortJob is issued during a migration operation
	* tools/virsh.c: Add a domjobabort command

2010-03-03  Daniel P. Berrange  <berrange@redhat.com>

	Remote driver implementation for the virDomainAbortJob APi
	This defines the wire protocol for the new API

	* src/remote/remote_protocol.x: Wire protocol definition
	* src/remote/remote_driver.c,daemon/remote.c: Client and server
	  side implementation
	* daemon/remote_dispatch_args.h, daemon/remote_dispatch_prototypes.h,
	  daemon/remote_dispatch_table.h, src/remote/remote_protocol.c,
	  src/remote/remote_protocol.h: Re-generate from remote_protocol.x

2010-03-03  Daniel P. Berrange  <berrange@redhat.com>

	Wire up internal entry points for virDomainAbortJob API
	This provides the internal glue for the driver API

	* src/driver.h: Internal API contract
	* src/libvirt.c, src/libvirt_public.syms: Connect public API
	  to driver API
	* src/esx/esx_driver.c, src/lxc/lxc_driver.c, src/opennebula/one_driver.c,
	  src/openvz/openvz_driver.c, src/phyp/phyp_driver.c,
	  src/qemu/qemu_driver.c, src/remote/remote_driver.c,
	  src/test/test_driver.c src/uml/uml_driver.c, src/vbox/vbox_tmpl.c,
	  src/xen/xen_driver.c: Stub out entry points

2010-03-03  Daniel P. Berrange  <berrange@redhat.com>

	Introduce public API for cancelling async domain jobs
	The new virDomainAbortJob() method provides a way for a second
	thread to abort an ongoing job run by another thread. This
	extends to any API with  which the virDomainGetJobInfo() API
	is intended to work. Cancellation is not guarenteed, rather best
	effort on part of the hypervisor and not required to be implmented.

	* include/libvirt/libvirt.h.in: Define virDomainAbortJob()

2010-03-03  Daniel P. Berrange  <berrange@redhat.com>

	Add QEMU driver support for job info on migration ops
	Introduce support for  virDomainGetJobInfo in the QEMU driver. This
	allows for monitoring of any API that uses the 'info migrate' monitor
	command. ie virDomainMigrate, virDomainSave and virDomainCoreDump

	Unfortunately QEMU does not provide a way to monitor incoming migration
	so we can't wire up virDomainRestore yet.

	The virsh tool gets a new command 'domjobinfo' to query status

	* src/qemu/qemu_driver.c: Record virDomainJobInfo and start time
	  in qemuDomainObjPrivatePtr objects. Add generic shared handler
	  for calling 'info migrate' with all migration based APIs.
	* src/qemu/qemu_monitor_text.c: Fix parsing of 'info migration' reply
	* tools/virsh.c: add new 'domjobinfo' command to query progress

2010-03-03  Daniel P. Berrange  <berrange@redhat.com>

	Remote driver implmentation of job info API
	* src/remote/remote_protocol.x: Define wire protocol format
	  for virDomainGetJobInfo API
	* src/remote/remote_driver.c, daemon/remote.c: Implement client
	  and server marshalling code for virDomainGetJobInfo()
	* daemon/remote_dispatch_args.h, daemon/remote_dispatch_prototypes.h
	  daemon/remote_dispatch_ret.h, daemon/remote_dispatch_table.h,
	  src/remote/remote_protocol.c, src/remote/remote_protocol.h: Rebuild
	  files from src/remote/remote_protocol.x

2010-03-03  Daniel P. Berrange  <berrange@redhat.com>

	Stub out internal driver entry points for job processing
	The internal glue layer for the new pubic API

	* src/driver.h: Define internal driver API contract
	* src/libvirt.c, src/libvirt_public.syms: Wire up public
	  API to internal driver API
	* src/esx/esx_driver.c, src/lxc/lxc_driver.c, src/opennebula/one_driver.c,
	  src/openvz/openvz_driver.c, src/phyp/phyp_driver.c,
	  src/qemu/qemu_driver.c, src/remote/remote_driver.c,
	  src/test/test_driver.c, src/uml/uml_driver.c, src/vbox/vbox_tmpl.c,
	  src/xen/xen_driver.c: Stub new entry point

2010-03-03  Daniel P. Berrange  <berrange@redhat.com>

	Introduce public API for domain async job handling
	Introduce a new public API that provides a way to get progress
	info on currently running jobs on a virDomainpPtr. APIs that
	are initially within scope of this idea are

	 virDomainMigrate
	 virDomainMigrateToURI
	 virDomainSave
	 virDomainRestore
	 virDomainCoreDump

	These all take a potentially long time and benefit from monitoring.
	The virDomainJobInfo struct allows for various pieces of information
	to be reported

	 - Percentage completion
	 - Time
	 - Overall data
	 - Guest memory data
	 - Guest disk/file data

	* include/libvirt/libvirt.h.in: Add virDomainGetJobInfo
	* python/generator.py, python/libvirt-override-api.xml,
	  python/libvirt-override.c: Override for virDomainGetJobInfo API
	* python/typewrappers.c, python/typewrappers.h: Introduce wrapper
	  for unsigned long long type

2010-03-02  Eric Blake  <eblake@redhat.com>

	build: silence coverity warning in node_device
	All other uses of get_str_prop in this file that ignored
	failure explicitly cast to void.

	* src/node_device/node_device_hal.c (dev_create): Silence coverity
	warning.

2010-03-02  Rolf Eike Beer  <eike@sf-mail.de>

	Fix error messages when parsing USB devices in QEMU
	A number of the error messages raised when parsing USB devices
	refered to PCI devices by mistake

	* src/qemu/qemu_conf.c: s/PCI/USB/ in qemuParseCommandLineUSB()

2010-03-02  Rolf Eike Beer  <eike@sf-mail.de>

	Fix USB hotplug device string in QEMU driver
	The USB hotplug method was mistakenly generating a PCI address
	string

	* src/qemu/qemu_driver.c: Fix USB hotplug device string

2010-03-02  Wolfgang Mauerer  <wolfgang.mauerer@siemens.com>

	Use device_del to remove SCSI controllers
	when the underlying qemu supports the drive/device model and the
	controller has been added this way.
	* src/qemu/qemu_driver.c: use qemuMonitorDelDevice() when detaching
	  PCI controller and if supported
	* src/qemu/qemu_monitor.[ch]: add new qemuMonitorDelDevice() function
	* src/qemu/qemu_monitor_json.[ch]: JSON backend for DelDevice command
	* src/qemu/qemu_monitor_text.[ch]: Text backend for DelDevice command

	Fix PCI address handling when controllers are deleted
	* src/qemu/qemu_driver.c: in qemudDomainDetachPciControllerDevice()
	  when a controller is not present in the system anymore, the PCI
	  address must be deleted from libvirt's hashtable because it can
	  be re-used for other purposes.

	Fix data structure handling when controllers are attached
	* src/qemu/qemu_driver.c: in qemudDomainAttachDevice(), one must not
	  delete the data part when the operation succeeds because it is
	  required later on. The correct pattern to handlethe parsed
	  representation of the device information on success
	  is dev->data.controller = NULL; virDomainDeviceDefFree(dev);,
	  which leaves the structure pointed at by data in memory.

	Tiny spelling fix

2010-03-02  Eric Blake  <eblake@redhat.com>

	libvirtd: avoid false-positive NULL-deref warning from clang
	* daemon/libvirtd.c (qemudWorker): Rewrite loop to silence a
	warning.

2010-03-02  Jim Meyering  <meyering@redhat.com>

	x86Decode: avoid NULL-dereference upon questionable input
	* src/cpu/cpu_x86.c (x86Decode): Don't dereference NULL when passed
	a NULL "models" pointer, or when passed a nonzero "nmodels" value
	and a corresponding NULL models[i].

	phypUUIDTable_Push: do not corrupt output stream upon partial write
	* src/phyp/phyp_driver.c (phypUUIDTable_Push): Move incr/decr
	of ptr/nread into the loop where those variables are used.
	Also, remove "exit" label and just-preceding "goto".

	openvzDomainDefineCmd: remove useless increment
	* src/openvz/openvz_driver.c (openvzDomainDefineCmd): Remove
	useless increment of "max_veid".

	maint: disallow TAB-in-indentation also in *.rng files
	* cfg.mk (sc_TAB_in_indentation): Also check .rng files.

	maint: convert leading TABs in *.rng files to equivalent spaces
	* docs/schemas/capability.rng: Likewise.
	* docs/schemas/network.rng: Likewise.
	* docs/schemas/nodedev.rng: Likewise.
	* docs/schemas/storagepool.rng: Likewise.
	* docs/schemas/storagevol.rng: Likewise.
	Use these commands:
	t=$'\t'
	git ls-files | grep '\.rng$' | xargs grep -lE "^ *$t" \
	  | xargs perl -MText::Tabs -ni -le \
	    '$m=/^( *\t[ \t]*)(.*)/; print $m ? expand($1) . $2 : $_'

2010-03-02  Daniel P. Berrange  <berrange@redhat.com>

	Expand docs about clock modes
	* formatdomain.html.in: Document new clock options

2010-03-02  Daniel P. Berrange  <berrange@redhat.com>

	Allow configurable timezones with QEMU
	Allow an arbitrary timezone with QEMU by setting the $TZ environment
	variable when launching QEMU

	* src/qemu/qemu_conf.c: Set TZ environment variable if a timezone
	  is requested
	* tests/qemuxml2argvtest.c: Add test case for timezones
	* tests/qemuxml2argvdata/qemuxml2argv-clock-france.xml,
	  tests/qemuxml2argvdata/qemuxml2argv-clock-france.args: Data
	  for timezone tests

2010-03-02  Daniel P. Berrange  <berrange@redhat.com>

	Allow a timezone to be specified instead of sync to host timezone
	This extends the XML to allow for

	  <clock offset='timezone' timezone='Europe/Paris'/>

	This is useful if the admin has not configured any timezone on the
	host OS, but still wants to synchronize a guest to a specific one.

	* src/conf/domain_conf.h, src/conf/domain_conf.c: Support extra
	  'timezone' attribute on clock configuration
	* docs/schemas/domain.rng: Add 'timezone' attribute
	* src/xen/xend_internal.c, src/xen/xm_internal.c: Reject configs
	  with a configurable timezone

2010-03-02  Daniel P. Berrange  <berrange@redhat.com>

	Support variable clock offset mode in QEMU
	This allows QEMU guests to be started with an arbitrary clock
	offset

	The test case can't actually be enabled, since QEMU argv expects
	an absolute timestring, and this will obviously change every
	time the test runs :-( Hopefully QEMU will allow a relative
	time offset in the future.

	* src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Use the -rtc arg
	  if available to support variable clock offset mode
	* tests/qemuhelptest.c: Add QEMUD_CMD_FLAG_RTC for qemu 0.12.1
	* qemuxml2argvdata/qemuxml2argv-clock-variable.args,
	  qemuxml2argvdata/qemuxml2argv-clock-variable.xml,
	  qemuxml2argvtest.c: Test case, except we can't actually enable
	  it yet.

2010-03-02  Daniel P. Berrange  <berrange@redhat.com>

	Add new clock mode allowing variable adjustments
	This introduces a third option for clock offset synchronization,
	that allows an arbitrary / variable adjustment to be set. In
	essence the XML contains the time delta in seconds, relative to
	UTC.

	  <clock offset='variable' adjustment='123465'/>

	The difference from 'utc' mode, is that management apps should
	track adjustments and preserve them at next reboot.

	* docs/schemas/domain.rng: Schema for new clock mode
	* src/conf/domain_conf.c, src/conf/domain_conf.h: Parse
	  new clock time delta
	* src/libvirt_private.syms, src/util/xml.c, src/util/xml.h: Add
	  virXPathLongLong() method

2010-03-02  Daniel P. Berrange  <berrange@redhat.com>

	Change the internal domain conf representation of localtime/utc
	The XML will soon be extended to allow more than just a simple
	localtime/utc boolean flag. This change replaces the plain
	'int localtime' with a separate struct to prepare for future
	extension

	* src/conf/domain_conf.c, src/conf/domain_conf.h: Add a new
	  virDomainClockDef structure
	* src/libvirt_private.syms: Export virDomainClockOffsetTypeToString
	  and virDomainClockOffsetTypeFromString
	* src/qemu/qemu_conf.c, src/vbox/vbox_tmpl.c, src/xen/xend_internal.c,
	  src/xen/xm_internal.c: Updated to use new structure for localtime

2010-03-01  Jim Meyering  <meyering@redhat.com>

	udevEnumerateDevices: remove dead code
	* src/node_device/node_device_udev.c (udevEnumerateDevices): Remove
	unnecessary call to udev_list_entry_get_name.

	qemudNetworkIfaceConnect: remove dead store
	* src/qemu/qemu_conf.c (qemudNetworkIfaceConnect): Remove extraneous
	virSaveLastError call, whose result was unused.

	cmdPoolDiscoverSources: initialize earlier to avoid FP from clang
	* tools/virsh.c (cmdPoolDiscoverSources): Always initialize srcSpec.
	Otherwise, clang would report that srcSpec could be used uninitialized
	in the call to virConnectFindStoragePoolSources.

2010-03-01  Eric Blake  <eblake@redhat.com>

	qemu: avoid null dereference on failed migration
	* src/qemu/qemu_monitor_text.c: qemuMonitorTextGetMigrationStatus: Check for
	  failed strchr, to silence a coverity warning.

2010-03-01  Stefan Berger  <stefanb@us.ibm.com>

	Free the macvtap mode string
	* src/conf/domain_conf.c: forgot to free the attribute value in
	  virDomainNetDefParseXML()

2010-03-01  Daniel Veillard  <veillard@redhat.com>

	Update of indian, spanish and russian translations
	and regeneration of the po/pot files

2010-02-26  David Allan  <dallan@redhat.com>

	Revert fs pool formatting
	* We are reverting this patch pending a discussion of the right way to implement.

2010-02-27  Jim Meyering  <meyering@redhat.com>

	build: update gnulib submodule to latest
	* .gnulib: Update to latest.
	Commit 89bdf84bcd9c6032e37 inadvertently rewound the .gnulib
	submodule by 51 commits.  This corrects it.
	Spotted by Eric Blake.

	build: avoid warning about return-with-value in void function
	* tools/virsh.c: Just "return;", not "return NULL;".

	libvirtd: do not ignore failure to set group ID in privileged mode
	* daemon/libvirtd.c (qemudListenUnix): Diagnose and fail upon
	failure to set or restore group-ID.

2010-02-26  Chris Lalancette  <clalance@redhat.com>

	Only build virDomainObjFormat if not building proxy.
	While building under RHEL-5, I got a compile warning because
	virDomainObjFormat was defined but not used.  That came about
	because in RHEL-5 we build with "#define PROXY", and
	virDomainObjFormat is only used with !PROXY.  Move the
	define.

2010-02-26  Jim Meyering  <meyering@redhat.com>

	openvzGetVEID: don't leak (memory + file descriptor)
	* src/openvz/openvz_conf.c (openvzGetVEID): Always call fclose.
	Diagnose parse failure also when vzlist output is empty.
	If somehow we read a -1, diagnose that (albeit as a parse failure).

2010-02-26  Cole Robinson  <crobinso@redhat.com>

	Use standard spacing for user/pass prompt
	Kind of minor, but it annoys me that the default auth callback
	doesn't put a space between the prompt and the input, like a typical
	terminal, ssh, etc. This patch changes the current prompt:

	Please enter your authentication name:myuser

	to

	Please enter your authentication name: myuser

2010-02-26  Cole Robinson  <crobinso@redhat.com>

	libvirtd: Better initscript error reporting
	From time to time I bork my install, and hate it when the initscript
	returns no info. This patch removes the sanity check, which lets
	the shell give us 'command not found' or 'permission denied' errors.

	qemu: Report binary path if error parsing -help

2010-02-26  Cole Robinson  <crobinso@redhat.com>

	remote: Improve daemon startup error reporting
	If I toggle enable_tcp in libvirtd.conf and add --listen in
	/etc/init.d/libvirtd, I get the unhelpful error:

	Starting libvirtd daemon: error: Unable to initialize network sockets.

	Running without --daemon provides much more useful info:

	sudo libvirtd --listen
	11:29:26.117: error : remoteCheckCertFile:270 : Cannot access CA certificate '/etc/pki/CA/cacert.pem': No such file or directory

	The daemon architecture makes it difficult to report this useful
	info if daemonized, so point users to /var/log/messages and
	dropping the --daemon flag if they want more info.

2010-02-26  Cole Robinson  <crobinso@redhat.com>

	virsh: Show errors reported by nonAPI functions
	Only API calls trigger the error callback, which is required for
	proper virsh error reporting. Since we use non API functions from
	util/, make sure we properly report these errors.

	Fixes lack of error message from 'virsh create idontexit.xml'

2010-02-26  Cole Robinson  <crobinso@redhat.com>

	remote: Improve error message when libvirtd isn't running
	While this could lead people in the wrong direction, people most commonly
	hit this error when libvirtd isn't running, so let's mention a possible
	fix.

2010-02-25  Jim Meyering  <meyering@redhat.com>

	build: avoid warning about unused variables
	* tools/virsh.c (cmdCPUBaseline): Remove declarations of unused
	variables, p and cur.

	build: avoid "make rpm" failure in docs/
	Add missing rule to build html/libvirt-libvirt.html.
	Use a GNU Make pattern rule to avoid running apibuild.py once
	for each out-of-date target, in a parallel build.
	* docs/Makefile.am

	build: teach apibuild.py to work in a non-srcdir build
	* docs/Makefile.am (libvirt-api.xml libvirt-refs.xml): Generalize
	apibuild.py to work in a non-srcdir build.  Pass "srcdir" to it.
	* docs/apibuild.py (rebuild): Honor the $srcdir envvar.

	build: avoid non-srcdir "make distcheck" failures (CLEANFILES)
	* docs/Makefile.am (MAINTAINERCLEANFILES): Use this variable
	for generated-and-distributed files, not "CLEANFILES".
	Besides, "make clean" and "make distclean" should not delete
	distributed files.

	build: make git submodule checking more reliable
	* cfg.mk (_curr_status): Accommodate leading "+" or "-" in the output
	of git submodule status.
	* autogen.sh: Likewise.

	build: avoid non-srcdir "make distcheck" failures (srcdir vs wildcard)
	* tests/xencapsdata/Makefile.am: Use $(wildcard in $(srcdir)-aware manner
	* tests/xmconfigdata/Makefile.am: Likewise.
	* tests/xml2sexprdata/Makefile.am: Likewise.
	* tests/sexpr2xmldata/Makefile.am (EXTRA_DIST): Likewise.
	* Makefile.am (XML_EXAMPLES): Use $(wildcard in $(srcdir)-aware manner.

	build: avoid non-srcdir "make distcheck" failure (test_conf.sh)
	* tests/confdata/Makefile.am (EXTRA_DIST): Apply $(wildcard... to
	$(srcdir)/..., and then remove the prefix.

	build: avoid non-srcdir installation failure (sitemap.html.in)
	* docs/Makefile.am (EXTRA_DIST): Add sitemap.html.in.

	build: avoid non-srcdir installation failure (apibuild.py)
	* docs/Makefile.am (libvirt-api.xml): Insert missing "$(srcdir)/".
	Also, remove unnecessary sub-shell.

	build: fix typos in makefile variable names
	* configure.ac: Fix typos:
	s/DRIVER_MODULES_CFLAGS/DRIVER_MODULE_CFLAGS/
	s/DRIVER_MODULES_LIBS/DRIVER_MODULE_LIBS/

2010-02-25  Jim Meyering  <meyering@redhat.com>

	build: ensure that MKINSTALLDIRS is AC_SUBST-defined
	since we're using gettext-0.14.1, which uses that now-obsolete
	automake symbol.  Otherwise, make distcheck would fails like this:

	    make[2]: Entering directory `/t/libvirt-0.7.6/_build/po'
	    /bin/sh @MKINSTALLDIRS@ /t/libvirt-0.7.6/_inst/share
	    /bin/sh: @MKINSTALLDIRS@: No such file or directory
	    make[2]: *** [install-data-yes] Error 127

	* configure.ac (MKINSTALLDIRS): Define.
	For reference, we're currently hamstrung by our desire
	to support RHEL5, which still uses gettext-0.14:
	http://bugzilla.redhat.com/523713

2010-02-25  Eric Blake  <eblake@redhat.com>

	maint: relax git minimum version
	Requiring git 1.6.4, just for the optional GNULIB_SRCDIR support,
	was too harsh.  Resynchronize from gnulib.

	* .gnulib: Import from latest gnulib.
	* bootstrap: Re-synchronize from .gnulib/build-aux.
	* bootstrap.conf: Drop git to 1.5.5.
	* README-hacking: Document use of GNULIB_SRCDIR.

2010-02-25  Richard Jones  <rjones@redhat.com>

	Ignore SIGWINCH in remote client call to poll(2) (RHBZ#567931).
	In bug 567931 we found that virt-top would exit occasionally
	when the terminal window was resized.  Tracking this down it
	turned out that SIGWINCH was being delivered to the process at
	exactly the point where the libvirt remote driver was calling
	poll(2) waiting for a reply from libvirtd.

	This caused the poll(2) call to be interrupted (returning errno
	EINTR).  However handling EINTR the same way as EAGAIN was not
	the solution to this problem since we found previously that this
	would break Ctrl-C handling (commit 47fec8eac2bb3).

	The correct solution is to mask out SIGWINCH for the duration
	of the poll(2) system call.  The per-thread mask is changed and
	restored immediately after the call.  Since we are using
	pthread_sigmask, this should not affect other threads, and
	since we restore the signal mask immediately afterwards it should
	not affect the current thread visibly either.  Other possibly
	problematic signals are SIGCHLD and SIGPIPE and these are
	masked too.

	Note use of ignore_value: It's not fatal if we cannot mask out
	SIGWINCH, and in any case pthread_sigmask never fails on Linux
	as long as you supply the correct arguments.

	I tested this patch and it cures the original problem with
	virt-top.

2010-02-24  Stefan Berger  <stefanb@us.ibm.com>

	Add descriptions for macvtap direct type interfaces
	This adds a description about the 'direct' type of interface recently
	added for macvtap device type support on the host.

2010-02-24  Dave Allan  <dallan@redhat.com>

	Format FS pools on creation
	Create the filesystem on the partition used by the pool
	* configure.ac: check for mkfs availability
	* libvirt.spec.in: add extra require on util-linux for mkfs
	* src/storage/storage_backend_fs.c: run mkfs with the expected
	  fs type when creating a filesystem pool

2010-02-24  Eric Blake  <eblake@redhat.com>

	maint: sort .gitignore
	Fallout from the new bootstrap.

	* .gitignore: Commit sorting done by bootstrap.
	* build-aux/.gitignore: Likewise.
	* po/.gitignore: Likewise.

2010-02-24  Eric Blake  <eblake@redhat.com>

	maint: import modern bootstrap
	Copy the latest gnulib bootstrap, which runs autoreconf and
	generates po/Makevars for us.  Other improvements include some
	improved prerequisite tool checking.

	This also fixes a bug in the .pot files, regarding the copyright holder.

	* bootstrap: Update to version in .gnulib/build-aux.
	* bootstrap.conf (MSGID_BUGS_ADDRESS, COPYRIGHT_HOLDER, SKIP_PO)
	(gnulib_mk, ACLOCAL, bootstrap_epilogue): Provide overrides.
	* autogen.sh (autoreconf): Avoid redundant autoreconf if bootstrap
	was run.
	* po/Makevars: Delete, now that bootstrap creates it.
	* po/.gitignore: Update.

2010-02-24  Eric Blake  <eblake@redhat.com>

	maint: start factoring bootstrap
	Borrow ideas from gnulib/build-aux/bootstrap, in order to factor the
	specifics of libvirt into bootstrap.conf, while allowing future
	upgrades of bootstrap to happen with less effort.

	* bootstrap (gnulib_tool): Update invocation to be closer to
	gnulib's version.  Move libvirt specifics...
	* bootstrap.conf: ...into new file.

2010-02-24  Eric Blake  <eblake@redhat.com>

	maint: fix quoting in autogen.sh
	* autogen.sh (srcdir, THEDIR, OBJ_DIR): Use proper quoting.
	(.git-module-status): Abort if bootstrap fails.

2010-02-24  Jim Meyering  <meyering@redhat.com>

	build: update gnulib submodule to latest
	* cfg.mk (local-checks-to-skip): Disable sc_prohibit_hash_without_use
	for now, since it fails with a false-positive match.

	virFork: placate static analyzers: ignore pthread_sigmask return value
	* src/util/util.c: Include "ignore-value.h".
	(virFork): We really do want to ignore pthread_sigmask failure.

2010-02-23  Cole Robinson  <crobinso@redhat.com>

	docs: Fix syntax warnings from recent changes.

	docs: network: Document <domain> element

	docs: network: Document STP and delay attributes

	docs: domain: Document <description> element

	docs: storage: Document multipath pools

	docs: storage: Document SCSI pools

	docs: storage: Fix backingStore <format> docs

	docs: storage: <volume><key> is always generated.

	docs: storage: Document capacity/alloc 'unit'

	storage: conf: Correctly calculate exabyte unit
	We were using 'Y' to mean exabyte, when the correct abbreviation would be
	'E' ('Y' is yettabyte, which is exabyte * 1024 * 1024). While it isn't
	strictly backwards compatible, I highly doubt anyone was actually using
	this broken behavior, so I don't see any harm in in dropping 'Y' handling.

2010-02-23  Jiri Denemark  <jdenemar@redhat.com>

	virsh.c: avoid all leaks in OOM path in cmdCPUBaseline

2010-02-22  Jiri Denemark  <jdenemar@redhat.com>

	Create raw storage files with O_DSYNC (again)
	Recently we introduced O_DSYNC flag when creating raw storage files to
	avoid filling all disk cache with dirty pages. However, the patch got
	lost when virStorageBackendCreateRaw was reworked using
	virFileOperation. Let's use O_DSYNC again.

2010-02-21  David Allan  <dallan@redhat.com>

	Fixed reference count in virsh pool-build command
	* tools/virsh.c: call virStoragePoolFree() in the main path too

2010-02-21  Dan Kenigsberg  <danken@redhat.com>

	docs: add 3 missing spaces

2010-02-20  David Allan  <dallan@redhat.com>

	Fix daemon-conf invalid failures
	The daemon-conf test would fail on my system if there was a system libvirtd
	running.  In the course of troubleshooting that problem, I discovered that the
	daemon-conf script would always fail if run by itself because it found the line:

	\# that each "PARAMETER = VALUE" line in this file have the parameter

	which it mistook for a line containing a parameter.  I have changed the test to
	avoid mistaking a line containing \"PARAMETER = VALUE\" for a parameter line.

	The corrupted config tests turned out to be failing because the test daemon was
	discovering the pid file from the running daemon and exiting before it processed
	the test config file.  Specifying the pid file for the corrupt config tests in
	the same way as for the valid config test solved that problem.

2010-02-20  Jim Meyering  <meyering@redhat.com>

	virsh.c: avoid leak on OOM error path
	* tools/virsh.c (cmdCPUBaseline): Also free "buffer" and "list" upon OOM.

	virBufferVSprintf: do not omit va_end(argptr) call
	* src/util/buf.c (virBufferVSprintf): Do not omit va_end(argptr).
	Improved-by: Daniel Veillard.

	xend_internal.c: don't dereference NULL for unexpected input
	* src/xen/xend_internal.c (xenDaemonDomainSetAutostart): Avoid a NULL
	dereference upon non-SEXPR_VALUE'd on_xend_start.  This bug was
	introduced by commit 37ce5600c0bb1aed9e2f2888922388de4340ebd3.

2010-02-20  Laine Stump  <laine@laine.org>

	Use virFileOperation hook function in virStorageBackendFileSystemVolBuild
	There were a few operations on the storage volume file that were still
	being done as root, which will fail if the file is on a root-squashed
	NFS share. The result was that attempts to create a storage volume of
	type "raw" on a root-squashed NFS share would fail.

	This patch uses the newly introduced "hook" function in
	virFileOperation to execute all those file operations in the child
	process that's run under the uid that owns the file (and, presumably,
	has permission to write to the NFS share)

	* src/storage/storage_backend.c: use virFileOperation() in
	  virStorageBackendCreateRaw, turning virStorageBackendCreateRaw()
	  into a new createRawFileOpHook() hook

2010-02-20  Laine Stump  <laine@laine.org>

	Rename virFileCreate to virFileOperation, add hook function
	It turns out it is also useful to be able to perform other operations
	on a file created while running as a different uid (eg, write things
	to that file), and possibly to do this to a file that already
	exists. This patch adds an optional hook function to the renamed (for
	more accuracy of purpose) virFileOperation; the hook will be called
	after the file has been opened (possibly created) and gid/mode
	checked/set, before closing it.

	As with the other operations on the file, if the VIR_FILE_OP_AS_UID
	flag is set, this hook function will be called in the context of a
	child process forked from the process that called virFileOperation.
	The implication here is that, while all data in memory is available to
	this hook function, any modification to that data will not be seen by
	the caller - the only indication in memory of what happened in the
	hook will be the return value (which the hook should set to 0 on
	success, or one of the standard errno values on failure).

	Another piece of making the function more flexible was to add an
	"openflags" argument. This arg should contain exactly the flags to be
	passed to open(2), eg O_RDWR | O_EXCL, etc.

	In the process of adding the hook to virFileOperation, I also realized
	that the bits to fix up file owner/group/mode settings after creation
	were being done in the parent process, which could fail, so I moved
	them to the child process where they should be.

	* src/util/util.[ch]: rename and rework virFileCreate-->virFileOperation,
	  and redo flags in virDirCreate
	* storage/storage_backend.c, storage/storage_backend_fs.c: update the
	  calls to virFileOperation/virDirCreate to reflect changes in the API,
	  but don't yet take advantage of the hook.

2010-02-19  Dustin Xiong  <x_k_123@hotmail.com>

	qemu: Check for IA64 kvm
	ACPI feature bit dropped: I asked internally if the -no-acpi option
	had any meaning for IA64, and was told 'probably not'.

2010-02-19  Cole Robinson  <crobinso@redhat.com>

	remote: Print ssh stderr on connection failure

2010-02-19  Yuji NISHIDA  <nishidy@nict.go.jp>

	fix multiple veth problem for OpenVZ
	Fix multiple veth problem.
	NETIF setting was overwritten after first CT because any CT could not be
	found by name.
	* src/openvz/openvz_conf.c src/openvz/openvz_conf.h: add the
	  openvzGetVEID lookup function
	* src/openvz/openvz_driver.c: use it in openvzDomainSetNetwork()

2010-02-19  Chris Lalancette  <clalance@redhat.com>

	Better error reporting for failed migration
	If the hostname as returned by "gethostname" resolves
	to "localhost" (as it does with the broken Fedora-12
	installer), then live migration will fail because the
	source will try to migrate to itself.  Detect this
	situation up-front and abort the live migration before
	we do any real work.

	* src/util/util.h src/util/util.c: add a new virGetHostnameLocalhost
	  with an optional localhost check, and rewire virGetHostname() to use
	  it
	* src/libvirt_private.syms: expose the new function
	* src/qemu/qemu_driver.c: use it in qemudDomainMigratePrepare2()

2010-02-19  Chris Lalancette  <clalance@redhat.com>

	Make virDomainObjFormat static
	* src/conf/domain_conf.c: make function static
	* src/conf/domain_conf.h: remove it from header

	Make an error message in PCI util code clearer
	* src/util/pci.c: update 2 message on pciRead errors

2010-02-19  Stefan Berger  <stefanb@us.ibm.com>

	macvtap mac_filter support
	This patch adds the mac_filter support to the macvtap device.

2010-02-19  Jim Meyering  <meyering@redhat.com>

	virsh: be careful to return "FALSE" upon OOM
	* tools/virsh.c (cmdCPUBaseline): Add an explicit "return" statement
	after the "no_memory:" label.

	virBufferStrcat: do not skip va_end
	* src/util/buf.c (virBufferStrcat): Do not skip va_end due to
	an early return.

	qparams.c: do not skip va_end, twice
	* src/util/qparams.c (new_qparam_set, append_qparams): Do not skip
	va_end due to an early return.

	xenDaemonDomainSetAutostart: avoid appearance of impropriety
	* src/xen/xend_internal.c (xenDaemonDomainSetAutostart): Rewrite to
	avoid dereferencing the result of sexpr_lookup.  While in this
	particular case, it was guaranteed never to be NULL, due to the
	preceding "if sexpr_node(...)" guard, it's cleaner to skip the
	sexpr_node call altogether, and also saves a lookup.

2010-02-19  Stefan Berger  <stefanb@us.ibm.com>

	macvtap IFF_VNET_HDR configuration
	This patch sets or unsets the IFF_VNET_HDR flag depending on what device
	is used in the VM. The manipulation of the flag is done in the open
	function and is only fatal if the IFF_VNET_HDR flag could not be cleared
	although it has to be (or if an ioctl generally fails). In that case the
	macvtap tap is closed again and the macvtap interface torn.

	* src/qemu/qemu_conf.c src/qemu/qemu_conf.h: pass qemuCmdFlags to
	  qemudPhysIfaceConnect()
	* src/util/macvtap.c src/util/macvtap.h: add vnet_hdr boolean to
	  openMacvtapTap(), and private function configMacvtapTap()
	* src/qemu/qemu_driver.c: add extra qemuCmdFlags when calling
	  qemudPhysIfaceConnect()

2010-02-19  Laine Stump  <laine@laine.org>

	Use virFork() in __virExec(), virFileCreate() and virDirCreate()
	For __virExec() this is a semantic NOP except for when fork()
	fails. __virExec() would previously forget to restore the signal mask
	in this case; virFork() corrects this behavior.

	virFileCreate() and virDirCreate() gain the code to reset the logging
	and properly deal with the signal handling race condition.

	This also removes a log message that had a typo ("cannot fork o create
	file '%s'") - this error is now logged in a more generic manner in
	virFork() (more generic, but really just as informative, since the
	fact that it's forking to create a file is immaterial to the fact that
	it simply can't fork)

	* src/util/util.c: use the generic virFork() in the 3 functions

2010-02-19  Laine Stump  <laine@laine.org>

	Add virFork() function to utils
	virFork() contains bookkeeping that must be done any time a process
	forks. Currently this includes:

	1) Call virLogLock() prior to fork() and virLogUnlock() just after,
	   to avoid a deadlock if some other thread happens to hold that lock
	   during the fork.

	2) Reset the logging hooks and send all child process log messages to
	   stderr.

	3) Block all signals prior to fork(), then either a) reset the signal
	   mask for the parent process, or b) clear the signal mask for the
	   child process.

	Note that the signal mask handling in __virExec erroneously fails to
	restore the signal mask when fork() fails. virFork() fixes this
	problem.

	Other than this, it attempts to behave as closely to fork() as
	possible (including preserving errno for the caller), with a couple
	exceptions:

	1) The return value is 0 (success) or -1 (failure), while the pid is
	   returned via the pid_t* argument. Like fork(), if pid < 0 there is
	   no child process, otherwise both the child and the parent will
	   return to the caller, and both should look at the return value,
	   which will indicate if some of the extra processing outlined above
	   encountered an error.

	2) If virFork() returns with pid < 0 or with a return value < 0
	   indicating an error condition, the error has already been
	   reported. You can log an additional message if you like, but it
	   isn't necessary, and may be awkwardly extraneous.

	Note that virFork()'s child process will *never* call _exit() - if a
	child process is created, it will return to the caller.

	* util.c util.h: add virFork() function, based on what is currently
	                 done in __virExec().

2010-02-19  Matthew Booth  <mbooth@redhat.com>

	Add QEMU support for virtio channel
	Support virtio-serial controller and virtio channel in QEMU backend.
	Will output
	the following for virtio-serial controller:

	-device
	virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x4,max_ports=16,vectors=4

	and the following for a virtio channel:

	-chardev pty,id=channel0 \
	-device
	virtserialport,bus=virtio-serial0.0,chardev=channel0,name=org.linux-kvm.port.0

	* src/qemu/qemu_conf.c: Add argument output for virtio
	* tests/qemuxml2argvtest.c
	  tests/qemuxml2argvdata/qemuxml2argv-channel-virtio.args: Add test for
	  QEMU command line generation

2010-02-19  Matthew Booth  <mbooth@redhat.com>

	Add domain support for virtio channel
	Add support for virtio-serial by defining a new 'virtio' channel target type
	and a virtio-serial controller. Allows the following to be specified in a
	domain:

	<controller type='virtio-serial' index='0' ports='16' vectors='4'/>
	<channel type='pty'>
	  <target type='virtio' name='org.linux-kvm.port.0'/>
	  <address type='virtio-serial' controller='0' bus='0'/>
	</channel>

	* docs/schemas/domain.rng: Add virtio-serial controller and virtio
	  channel type.
	* src/conf/domain_conf.[ch]: Domain parsing/serialization for
	  virtio-serial controller and virtio channel.
	* tests/qemuxml2xmltest.c
	  tests/qemuxml2argvdata/qemuxml2argv-channel-virtio.xml: add domain xml
	  parsing test
	* src/libvirt_private.syms src/qemu/qemu_conf.c:
	  virDomainDefAddDiskControllers() renamed to
	  virDomainDefAddImplicitControllers()

2010-02-18  Matthew Booth  <mbooth@redhat.com>

	Remove unused functions from domain_conf
	Remove virDomainDevicePCIAddressEqual and virDomainDeviceDriveAddressEqual,
	which are defined but not used anywhere.

	* src/conf/domain_conf.[ch] src/libvirt_private.syms: Remove
	  virDomainDevicePCIAddressEqual and virDomainDeviceDriveAddressEqual.

2010-02-18  Matthew Booth  <mbooth@redhat.com>

	Fix typo in comment
	* src/qemu/qemu_driver.c: qemudStartVMDaemon() fix typo in comment

2010-02-18  Jim Meyering  <meyering@redhat.com>

	get_virtual_functions_linux: would mistakenly always return zero
	* src/node_device/node_device_linux_sysfs.c(get_virtual_functions_linux):
	Return "ret", rather than always returning 0.

2010-02-18  Cole Robinson  <crobinso@redhat.com>

	qemu: Explicitly error if guest virtual network is inactive
	Currently we just error with ex. 'virbr0: No such device'.

	Since we are using public API calls here, we need to ensure that any
	raised error is properly saved and restored, since API entry points
	always reset messages.

2010-02-18  Cole Robinson  <crobinso@redhat.com>

	network: bridge: Fix IsActive, IsPersistent
	We were accessing the wrong private data structure, which would
	cause a segfault.

	virterror: Make SetError work if no previous error was set
	virGetLastError returns NULL if no error has been set, not on
	allocation error like virSetError assumed. Use virLastErrorObject
	instead. This fixes virSetError when no error is currently stored.

	libvirt: Update docs for hotplug only commands
	The commands updated are SetMem, SetMaxMem, SetVcpus, and PinVcpu.

2010-02-18  Stefan Berger  <stefanb@us.ibm.com>

	macvtap teardown rework
	Rework and simplification of teardown of the macvtap device.

	Basically all devices with the same MAC address and link device are kept
	alive and not attempted to be torn down. If a macvtap device linked to a
	physical interface with a certain MAC address 'M' is to be created it
	will automatically fail if the interface is 'up'ed and another macvtap
	with the same properties (MAC addr 'M', link dev) happens to be 'up'.
	This will prevent the VM from starting or the device from being attached
	to a running VM. Stale interfaces are assumed to be there for some
	reason and not stem from libvirt.

	In the VM shutdown path, it's assuming that an interface name is always
	available so that if the device type is DIRECT it can be torn down
	using its name.

	* src/util/macvtap.h src/libvirt_macvtap.syms: change of deleting routine
	* src/util/macvtap.c: cleanups and change of deleting routine
	* src/qemu/qemu_driver.c: change cleanup on shutdown
	* src/qemu/qemu_conf.c: don't delete Macvtap in qemudPhysIfaceConnect()

2010-02-18  Matthew Booth  <mbooth@redhat.com>

	Fix whitespace in domain.rng
	* src/schemas/domain.rng: Replace tabs with 8 spaces

2010-02-18  Daniel P. Berrange  <berrange@redhat.com>

	Update QEMU JSON balloon command handling
	The QEMU JSON monitor changed balloon commands to return/accept
	bytes instead of kilobytes. Update libvirt to cope with this

	* src/qemu/qemu_monitor_json.c: Expect/use bytes for ballooning

2010-02-18  Jim Meyering  <meyering@redhat.com>

	openvzLoadDomains: don't ignore failing virUUIDFormat
	* src/openvz/openvz_conf.c (openvzLoadDomains): Diagnose failure of
	virUUIDFormat.

2010-02-18  Cole Robinson  <crobinso@redhat.com>

	python: Actually add virConnectGetVersion to generated bindings
	The recent commit to implement a python version of this function
	didn't drop an explicit 'ignore' check in the generator, so this
	never ended up in the bindings.

2010-02-17  Eric Blake  <ebb9@byu.net>

	build: inform libtool of m4 directory
	Silence a libtoolize warning.
	*  configure.ac (AC_CONFIG_MACRO_DIR): Add.

2010-02-17  Jiri Denemark  <jdenemar@redhat.com>

	Adds a cpu-baseline command for virsh
	* tools/virsh.c: add a command to compute a CPU baseline based on
	  multiple CPU definitions in an XML chunk
	* tools/virsh.pod: add it to the man page

2010-02-17  Jim Meyering  <meyering@redhat.com>

	vshCommandParse: placate coverity
	There is no real leak here, but Coverity-Prevent thinks there is.
	It does not see that while there are four ways to return from
	vshCommandGetToken with VSH_TK_END, none of them results in allocation
	of a result.
	* tools/virsh.c (vshCommandParse): Add a (currently) useless VIR_FREE,
	to ensure that we never leak when vshCommandGetToken returns VSH_TK_END.

	qemuMonitorTextAddUSBDisk: avoid unconditional leak
	* src/qemu/qemu_monitor_text.c (qemuMonitorTextAddUSBDisk): Free
	command output buffer.

	tests: avoid NULL deref upon OOM failure
	* tests/qemuxml2argvtest.c (testCompareXMLToArgvFiles): Handle malloc
	failure.

	qemuInitPasswords: avoid unconditional leak
	* src/qemu/qemu_driver.c (qemuInitPasswords): Free pass-phrase buffer.

	qemuMonitorTextAddDevice: avoid unconditional leak
	* src/qemu/qemu_monitor_text.c (qemuMonitorTextAddDevice): Free the
	device name buffer.

	libvirt-override.c: avoid a leak upon call with invalid argument
	* python/libvirt-override.c (libvirt_virConnectBaselineCPU): Don't leak
	the xmlcpus buffer upon encountering a non-string list element.

	vboxDomainDumpXML: avoid a leak on OOM error path
	* src/vbox/vbox_tmpl.c (vboxDomainDumpXML): Free vboxCallback buffer
	upon OOM.

	virNodeDevCapScsiHostParseXML: avoid an unconditional leak
	* src/conf/node_device_conf.c (virNodeDevCapScsiHostParseXML):
	Free the "nodes" buffer allocated by virXPathNodeSet.

	uml_driver.c: avoid leak upon failure
	* src/uml/uml_driver.c (umlMonitorCommand): This function would
	sometimes return -1, yet fail to free the "reply" it had allocated.
	Hence, no caller would know to free the corresponding argument.
	When returning -1, be sure to free all allocated resources.

	vbox_tmpl.c: avoid an unconditional leak
	* src/vbox/vbox_tmpl.c (vboxDomainDumpXML): Free def.
	Improved by Matthias Bolte.

	openvz (openvzFreeDriver): avoid leaks
	* src/openvz/openvz_conf.c (openvzFreeDriver): Also free driver buffer.
	Based on a suggestion from Matthias Bolte.

	virStorageBackendIsMultipath: avoid dead store
	* src/storage/storage_backend_mpath.c (virStorageBackendIsMultipath):
	The result of dm_get_next_target was never used (and isn't needed),
	so don't store it.

2010-02-17  Cole Robinson  <crobinso@redhat.com>

	qemu: Make SetVcpu command hotplug only
	Similar to the Set*Mem commands, this implementation was bogus and
	misleading. Make it clear this is a hotplug only operation, and that the
	hotplug piece isn't even implemented.

	Also drop the overkill maxvcpus validation: we don't perform this check
	at XML define time so clearly no one is missing it, and there is
	always the risk that our info will be out of date, possibly preventing
	legitimate CPU values.

2010-02-17  Cole Robinson  <crobinso@redhat.com>

	qemu: Make Set*Mem commands hotplug only
	SetMem and SetMaxMem are hotplug only APIs, any persistent config
	changes are supposed to go via XML definition. The original implementation
	of these calls were incorrect and had the nasty side effect of making
	a psuedo persistent change that would be lost after libvirtd restart
	(I didn't know any better).

	Fix these APIs to rightly reject non running domains.

2010-02-16  Daniel P. Berrange  <berrange@redhat.com>

	Treat missing QEMU 'thread_id' as non-fatal in JSON monitor
	The plain QEMU tree does not include 'thread_id' in the JSON
	output. Thus we need to treat it as non-fatal if missing.

	* src/qemu/qemu_monitor_json.c: Treat missing thread_id as non-fatal

2010-02-16  Daniel P. Berrange  <berrange@redhat.com>

	Fix check for primary IDE controller in QEMU PCI slot assignment
	A typo in the check for the primary IDE controller could cause
	a crash on restore depending on the exact guest config.

	* src/qemu/qemu_conf.c: Fix s/video/controller/ typo & slot
	  number typo

2010-02-16  Daniel P. Berrange  <berrange@redhat.com>

	Make error reporting for QEMU JSON mode more friendly
	Current error reporting for JSON mode returns the full JSON
	command string and full JSON error string. This is not very
	user friendly, so this change makes the error report only
	contain the basic command name, and friendly error message
	description string. The full JSON data is logged instead.

	* src/qemu/qemu_monitor_json.c: Always return the 'desc' field from
	  the JSON error message to users.

2010-02-16  Daniel P. Berrange  <berrange@redhat.com>

	Run 'qmp_capabilities' command at QEMU monitor startup
	When in JSON mode, QEMU requires that 'qmp_capabilities' is run as
	the first command in the monitor. This is a no-op when run in the
	text mode monitor

	* src/qemu/qemu_driver.c: Run capabilities negotiation when
	  connecting to the monitor
	* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
	  src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h: Add
	  support for the 'qmp_capabilities' command, no-op in text mode.

2010-02-16  Stefan Berger  <stefanb@us.ibm.com>

	macvtap support for libvirt -- schema extensions
	* docs/schemas/domain.rng: extends the domain xml schema to support the
	  new interface type 'direct'

	macvtap support for libvirt -- qemu support
	This part adds support for qemu making a macvtap tap device available
	via file descriptor passed to qemu command line. This also attempts to
	tear down the macvtap device when a VM terminates. This includes support
	for attachment and detachment to/from running VM.
	* src/qemu/qemu_conf.[ch] src/qemu/qemu_driver.c: add support in the
	  QEmu driver

2010-02-16  Stefan Berger  <stefanb@us.ibm.com>

	macvtap support for libvirt -- helper code
	This part adds the helper code to setup and tear down macvtap devices
	using direct communication with the device driver via netlink sockets.
	The rather short messages received from the netlink layer are now
	written into a dynamically allocated buffer

	* src/util/macvtap.h src/util/macvtap.c: provides the new module
	* po/POTFILES.in: the module contains translated strings

2010-02-16  Stefan Berger  <stefanb@us.ibm.com>

	macvtap support for libvirt -- parse new interface XML
	This part adds support to domain_conf.{c|h} for parsing the new
	interface XML of type 'direct'. The parsed mode is now stored as
	an int.
	* src/conf/domain_conf.c src/conf/domain_conf.h: extend parsing code
	* src/util/macvtap.h: empty header to not break compilation

	macvtap support for libvirt -- build support
	This patch adds build support for libvirt checking for certain contents
	of /usr/include/linux/if_link.h to see whether macvtap support is
	compilable on that system. One can disable macvtap support in libvirt
	via --without-macvtap passed to configure.
	* configure.ac src/Makefile.am: new build support
	* src/libvirt_macvtap.syms: list of exported symbols
	* src/util/macvtap.c: empty module to not break compilation

2010-02-15  Matthias Bolte  <matthias.bolte@googlemail.com>

	interface: Use proper return codes in the open function
	The open function returned -1 in case of an error, but -1 maps
	to VIR_DRV_OPEN_DECLINED instead of VIR_DRV_OPEN_ERROR.

2010-02-15  Matthias Bolte  <matthias.bolte@googlemail.com>

	Convert virSecurityReportError into a macro
	The virRaiseError macro inside of virSecurityReportError expands to
	virRaiseErrorFull and includes the __FILE__, __FUNCTION__ and __LINE__
	information. But this three values are always the same for every call
	to virSecurityReportError and do not reflect the actual error context.

	Converting virSecurityReportError into a macro results in getting the
	correct __FILE__, __FUNCTION__ and __LINE__ information.

2010-02-13  Daniel P. Berrange  <berrange@redhat.com>

	Add persistence of PCI addresses to QEMU
	Current PCI addresses are allocated at time of VM startup.
	To make them truely persistent, it is neccessary to do this
	at time of virDomainDefine/virDomainCreate. The code in
	qemuStartVMDaemon still remains in order to cope with upgrades
	from older libvirt releases

	* src/qemu/qemu_driver.c: Rename existing qemuAssignPCIAddresses
	  to qemuDetectPCIAddresses. Add new qemuAssignPCIAddresses which
	  does auto-allocation upfront. Call qemuAssignPCIAddresses from
	  qemuDomainDefine and qemuDomainCreate to assign PCI addresses that
	  can then be persisted. Don't clear PCI addresses at shutdown if
	  they are intended to be persistent

2010-02-13  Daniel P. Berrange  <berrange@redhat.com>

	Fix crash in LXC driver open method when URI has no path
	If giving a lxc://  URI instead of lxc:/// the open method
	would crash ona NULL pointer

	* src/lxc/lxc_driver.c: Cope with a NULL URI path

2010-02-13  Daniel P. Berrange  <berrange@redhat.com>

	Fix USB device path formatting mixup
	* src/util/hostusb.c: The device path for a USB device wants the
	  bus/device IDs in decimal not octal

2010-02-13  Daniel P. Berrange  <berrange@redhat.com>

	Support 'block_passwd' command for QEMU disk encryption
	The old text mode monitor prompts for a password when disks are
	encrypted. This interactive approach doesn't work for JSON mode
	monitor. Thus there is a new 'block_passwd' command that can be
	used.

	* src/qemu/qemu_driver.c: Split out code for looking up a disk
	  secret from findVolumeQcowPassphrase, into a new method
	  getVolumeQcowPassphrase. Enhance qemuInitPasswords() to also
	  set the disk encryption password via the monitor
	* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
	  src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h,
	  src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h: Add
	  support for the 'block_passwd' monitor command.

2010-02-12  Jiri Denemark  <jdenemar@redhat.com>

	Implement cpuBaseline in remote and qemu drivers

	Wire protocol format and dispatcher for virConnectBaselineCPU

	virConnectBaselineCPU public API implementation

	Internal driver API for virConnectBaselineCPU

	virConnectBaselineCPU public API

	Implement cpuArchBaseline in x86 CPU driver

	Implement cpuArchBaseline in generic CPU driver

	Functions for computing baseline CPU from a set of host CPUs
	Baseline CPU is the best CPU which can be used for a guest on any of the
	hosts.

2010-02-12  Matthias Bolte  <matthias.bolte@googlemail.com>

	Fix compliation of AppArmor related code
	Broken by the latest commits to remove the virConnectPtr parameter
	from internal functions.

2010-02-12  Jim Meyering  <meyering@redhat.com>

	qemu_driver.c: honor dname parameter once again
	Since c26cb9234f4b9fa46d7caa3385ae36704167c53f, the dname
	parameter has been ignored by these two functions.  Use it.
	* src/qemu/qemu_driver.c (qemudDomainMigratePrepareTunnel): Honor dname
	parameter once again.
	(qemudDomainMigratePrepare2): Likewise.

	plug four virStoragePoolSourceFree-related leaks
	* src/conf/storage_conf.c (virStoragePoolDefParseSourceString):
	* src/storage/storage_backend_fs.c:
	(virStorageBackendFileSystemNetFindPoolSourcesFunc):
	(virStorageBackendFileSystemNetFindPoolSources):
	* src/test/test_driver.c (testStorageFindPoolSources):

2010-02-11  Jim Meyering  <meyering@redhat.com>

	remote_driver.c: avoid leak on OOM error path
	* src/remote/remote_driver.c (doRemoteOpen): Don't leak a qparam_set
	buffer upon OOM error.

2010-02-11  Jiri Denemark  <jdenemar@redhat.com>

	Mark all error messages for translation

	Add cpu_generic.c to the list of translated files

	Swap position of nmodels and models parameters in cpuDecode()
	All other libvirt functions use array first and then number of elements
	in that array. Let's make cpuDecode follow this rule.

2010-02-11  Jiri Denemark  <jdenemar@redhat.com>

	Fix <cpu> element in domain XML schema
	The current schema is more permissive than the XML parsing code in
	libvirt. Precisely, 'match' attribute is optional in schema while in
	reality its use is bound to <model> element:

	- <cpu> element without 'match' attribute is allowed only if <topology>
	  element is the only child element of <cpu>

	- <cpu> element with 'match' attribute requires <model> element to be
	  present; <topology> and <feature> elements are optional

2010-02-11  Chris Lalancette  <clalance@redhat.com>

	Fix up a misspelled comment.

2010-02-11  Daniel P. Berrange  <berrange@redhat.com>

	Fix disk stats retrieval with QEMU >= 0.12
	With QEMU >= 0.12 the host and guest side of disks no longer have
	the same naming convention. Specifically the host side will now
	get a 'drive-' prefix added to its name. The 'info blockstats'
	monitor command returns the host side name, so it is neccessary
	to strip this off when looking up stats since libvirt stores the
	guest side name !

	* src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Move 'drive-' prefix
	  string to a defined constant
	* src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_text.c: Strip
	  off 'drive-' prefix (if found) when looking up disk stats

2010-02-10  Cole Robinson  <crobinso@redhat.com>

	qemu: Increase guest startup timeout to 30 seconds
	Currently the timeout for reading startup output is 3 seconds. If the
	host is under any sort of load, we can easily trigger this. Lets bump
	it to 30 seconds.

	Since the polling loop checks to see if the process has died, we shouldn't
	erroneously hit this timeout if qemu bombs (only if it is stuck in some
	infinite loop).

2010-02-10  Cole Robinson  <crobinso@redhat.com>

	qemu: Properly report a startup timeout error
	The timeout errors were unconditionally being overwritten by the less
	helpful 'unable to start guest' error.

	test: Fake security driver support in capabilities
	Having some value in capabilities helps testing this stuff in
	virt-manager.

2010-02-10  Daniel P. Berrange  <berrange@redhat.com>

	Annotate some virConnectPtr as mandatory non-null
	Use the ATTRIBUTE_NONNULL annotation to mark some virConnectPtr
	args as mandatory non-null so the compiler can warn of mistakes

	* src/conf/domain_event.h: All virConnectPtr args must be non-null
	* src/qemu/qemu_conf.h: qemudBuildCommandLine and
	  qemudNetworkIfaceConnect() must be given non-null connection
	* tests/qemuxml2argvtest.c: Provide a non-null (dummy) connection to
	  qemudBuildCommandLine()

2010-02-10  Daniel P. Berrange  <berrange@redhat.com>

	Remove virConnectPtr from secret XML APIs
	The virConnectPtr is no longer required for error reporting since
	that is recorded in a thread local. Remove use of virConnectPtr
	from all APIs in secret_conf.{h,c} and update all callers to
	match

	Remove virConnectPtr from interface XML APIs
	The virConnectPtr is no longer required for error reporting since
	that is recorded in a thread local. Remove use of virConnectPtr
	from all APIs in interface_conf.{h,c} and update all callers to
	match

	Remove virConnectPtr from CPU XML APIs
	The virConnectPtr is no longer required for error reporting since
	that is recorded in a thread local. Remove use of virConnectPtr
	from all APIs in cpu_conf.{h,c} and update all callers to
	match

	Remove virConnectPtr from storage APIs & driver
	The virConnectPtr is no longer required for error reporting since
	that is recorded in a thread local. Remove use of virConnectPtr
	from all APIs in storage_conf.{h,c} and storage_encryption_conf.{h,c}
	and update all callers to match

	Remove virConnectPtr from all node device XML APIs
	The virConnectPtr is no longer required for error reporting since
	that is recorded in a thread local. Remove use of virConnectPtr
	from all APIs in node_device_conf.{h,c} and update all callers to
	match

	Remove virConnectPtr from network XML APis
	The virConnectPtr is no longer required for error reporting since
	that is recorded in a thread local. Remove use of virConnectPtr
	from all APIs in network_conf.{h,c} and update all callers to
	match

2010-02-10  Daniel P. Berrange  <berrange@redhat.com>

	Remove virConnectPtr from USB/PCI device iterators
	All callers now pass a NULL virConnectPtr into the USB/PCi device
	iterator functions. Therefore the virConnectPtr arg can now be
	removed from these functions

	* src/util/hostusb.h, src/util/hostusb.c: Remove virConnectPtr
	  from usbDeviceFileIterate
	* src/util/pci.c, src/util/pci.h: Remove virConnectPtr arg from
	  pciDeviceFileIterate
	* src/qemu/qemu_security_dac.c, src/security/security_selinux.c: Update
	  to drop redundant virConnectPtr arg

2010-02-10  Daniel P. Berrange  <berrange@redhat.com>

	Fix generation of floppy disk arg for QEMU's -global arg
	* src/qemu/qemu_conf.c: Fix ',' vs '.' typo in floppy disk arg

	Fix compile error in Xen proxy from virConnectPtr changes
	* proxy/libvirt_proxy.c: Remove 'conn' arg to virDomainDefFormat

2010-02-10  Daniel P. Berrange  <berrange@redhat.com>

	Convert qemu command line flags to 64-bit int
	The QEMU flags are commonly stored as a signed or unsigned int,
	allowing only 31 flags. This limit is rather close, so to aid
	future patches, change it to a 64-bit int

	* src/qemu/qemu_conf.c, src/qemu/qemu_conf.h, src/qemu/qemu_driver.c,
	  tests/qemuargv2xmltest.c, tests/qemuhelptest.c, tests/qemuxml2argvtest.c:
	  Use 'unsigned long long' for QEMU flags

2010-02-10  Daniel P. Berrange  <berrange@redhat.com>

	Remove use of virConnectPtr from security driver APIs
	The virConnectPtr is no longer required for error reporting since
	that is recorded in a thread local. Remove use of virConnectPtr
	from all APIs in security_driver.{h,c} and update all callers to
	match

	Remove virConnectPtr from all domain XML parsing/formatting APIs

	Remove virConnectPtr from LXC driver

	Remove passing of virConnectPtr throughout QEMU driver

2010-02-10  Daniel P. Berrange  <berrange@redhat.com>

	Fix security driver configuration
	The security driver was mistakenly initialized before the QEMU
	config file was loaded. This prevents it being turned off again.
	The capabilities XML was also getting the wrong security driver
	name, due to the stacked driver arrangement.

	* src/qemu/qemu_driver.c: Fix initialization order and capabilities
	  model name

2010-02-10  Jim Meyering  <meyering@redhat.com>

	virAsprintf: remove its warn_unused_result attribute
	* src/util/util.h (virAsprintf): Remove ATTRIBUTE_RETURN_CHECK, since
	it is perfectly fine to ignore the return value, now that the pointer
	is guaranteed to be set to NULL upon failure.
	* src/util/storage_file.c (absolutePathFromBaseFile): Remove now-
	unnecessary use of ignore_value.

	absolutePathFromBaseFile: avoid an unnecessary use of assert
	* src/util/storage_file.c (absolutePathFromBaseFile): While this use
	of virAsprintf is slightly cleaner than using stpncpy(stpcpy(...,
	it does impose an artificial limitation on the length of the base_file
	name.  Rather than asserting that it does not exceed INT_MAX, return
	NULL when it does.

2010-02-10  Daniel Veillard  <veillard@redhat.com>

	Escape strings serialized in XML
	* src/conf/node_device_conf.c: string saved into XML should be escaped
	  with the use of virBufferEscapeString()

2010-02-09  Jiri Denemark  <jdenemar@redhat.com>

	Create raw storage files with O_DSYNC
	When creating preallocated large raw files opening them with O_DSYNC
	prevents long delays in reading because cache pages can be immediately
	reused without writing them on a disk first.

2010-02-09  Daniel P. Berrange  <berrange@redhat.com>

	Re-generate remote protocol files for new APIs
	Re-generate remote protocol files for changes in commit
	daeb6f6b40432f74150c96fa99ef12df31344fbb

	* daemon/remote_dispatch_args.h, daemon/remote_dispatch_prototypes.h,
	  daemon/remote_dispatch_table.h, src/remote/remote_protocol.c,
	  src/remote/remote_protocol.h: Re-generate files

2010-02-09  Matthias Bolte  <matthias.bolte@googlemail.com>

	Remove conn parameter from USB functions
	It was used for error reporting only.

	Remove conn parameter from JSON error macro

	Remove conn parameter from PCI functions
	It was used for error reporting only.

	Remove conn parameter from Linux stats functions
	It was used for error reporting only.

	Remove conn parameter from storage file functions
	It was used for error reporting only.

	Remove conn parameter from util functions
	It was used for error reporting only.

	Remove conn parameter from virXPath* functions
	It was used for error reporting only.

	Remove conn parameter from virReportSystemError

	Remove conn parameter from virReportOOMError

2010-02-09  Jim Fehlig  <jfehlig@novell.com>

	Modify virsh commands
	Change all virsh commands that invoke virDomain{Attach,Detach}Device()
	to use virDomain{Attach,Detach}DeviceFlags() instead.

	Add a "--persistent" flag to these virsh commands, allowing user to
	specify that the domain persisted config be modified as well.

	V2: Only invoke virDomain{Attach,Detach}DeviceFlags() if
	"--persistent" flag is specified.  Otherwise invoke
	virDomain{Attach,Detach}Device() to retain current behavior.

2010-02-09  Jim Fehlig  <jfehlig@novell.com>

	domain{Attach,Detach}DeviceFlags handler for drivers
	Implementation of domain{Attach,Detach}DeviceFlags handlers
	in the drivers.

	Server side dispatcher
	Server side dispatcher for Domain{Attach,Detach}DeviceFlags.

	Remote driver
	Implementation of Domain{Attach,Detach}DeviceFlags in remote driver.

	Wire protocol format
	Definition of wire protocol format for
	virDomain{Attach,Detach}DeviceFlags.

2010-02-09  Jim Fehlig  <jfehlig@novell.com>

	Public API Implementation
	Implementation of public API for virDomain{Attach,Detach}DeviceFlags.

	V2: Don't break remote compatibility with older libvirtd

2010-02-09  Jim Fehlig  <jfehlig@novell.com>

	Internal API
	Definition of internal API for virDomain{Attach,Detach}DeviceFlags.

2010-02-09  Jim Fehlig  <jfehlig@novell.com>

	Public API
	Definition of public API for virDomain{Attach,Detach}DeviceFlags.

	V2: Adjust libvrt_public.syms to anticipated 0.7.7 release.

2010-02-09  Jim Fehlig  <jfehlig@novell.com>

	doc: restrict virDomain{Attach,Detach}Device to active domains
	virDomain{Attach,Detach}Device is now only permitted on active
	domains.  Explicitly state this restriction in the API
	documentation.

	V2: Only change doc, dropping the hunk that forced the restriction
	    in libvirt frontend.

2010-02-06  Jim Meyering  <meyering@redhat.com>

	build: update gnulib submodule to latest
	* .gnulib: This fixes a warning in test-gettimeofday.c,
	seen via "make check".  Reported by Daniel Veillard.

2010-02-05  Jim Meyering  <meyering@redhat.com>

	(absolutePathFromBaseFile): fix up preceding commit
	When configured with --enable-gcc-warnings, it didn't even compile.
	* src/util/storage_file.c: Include <assert.h>.
	(absolutePathFromBaseFile): Assert that converting size_t to int is valid.
	Reverse length/string args to match "%.*s".
	Explicitly ignore the return value of virAsprintf.

	absolutePathFromBaseFile: don't leak when first arg contains no "/"
	* src/util/storage_file.c: Include "dirname.h".
	(absolutePathFromBaseFile): Rewrite not to leak, and to require
	fewer allocations.
	* bootstrap (modules): Add dirname-lgpl.
	* .gnulib: Update submodule to the latest.

	sexpr_string: avoid leak on OOM error path
	* src/xen/sexpr.c (sexpr_string): Free sexpr buffer upon allocation
	failure.

	virDomainChrDefParseXML: don't leak upon invalid input
	* src/conf/domain_conf.c (virDomainChrDefParseXML): Don't leak a
	virDomainChrDef buffer upon "unknown target type for char device" error.

	virExecWithHook: avoid leak on OOM error path
	* src/util/util.c (virExecWithHook): Free argv_str string before
	returning upon failure to allocate space for environment.

	cgroup.c: don't leak mem+FD upon OOM
	* src/util/cgroup.c (virCgroupDetectPlacement): Close the mapping
	FILE* also upon error.

	cgroup.c: avoid unconditional leaks
	* src/util/cgroup.c (virCgroupCpuSetInherit) [HAVE_MNTENT_H]:
	Don't leak CPU-set inheritance value strings.

2010-02-05  Matthias Bolte  <matthias.bolte@googlemail.com>

	website: Add a 1em right margin
	This stops the text and pre-boxes from touching the right border.

	storage: Replace storageLog with VIR_ERROR

	opennebula: Remove unnecessary casts

	esx: Remove unnecessary casts

	cpu conf: Use virBufferFreeAndReset instead of virBufferContentAndReset and VIR_FREE

	docs: Refer to virReportOOMError in the HACKING file
	Instead of refering to __virRaiseError(VIR_ERROR_NO_MEMORY).

	esx: Cleanup preprocessing structure in esxVI_EnsureSession

	docs: Emphasize that devices have to be inside the <devices> element
	Also cleanup indentation of domain XML examples.

2010-02-04  Doug Goldstein  <cardoe@gentoo.org>

	virt-pki-validate contains unexpanded SYSCONFDIR variable
	* tools/virt-pki-validate.in: use an automake variable instead of a
	  shell variable so the resulting shell actually work

2010-02-04  Daniel Veillard  <veillard@redhat.com>

	Release of libvirt-0.7.6
	* configure.ac docs/news.html.in libvirt.spec.in: version bump and doc
	  updates
	* po/*.po*: updated and regenerated the localizations

2010-02-04  Daniel P. Berrange  <berrange@redhat.com>

	Fix restore of QEMU guests with PCI device reservation
	When restoring from a saved guest image, the XML would already
	contain the PCI slot ID of the IDE controller & video card.
	The attempt to explicitly reserve this upfront would thus fail
	everytime.

	* src/qemu/qemu_conf.c: Reserve IDE controller / video card
	  slot at time of need, rather than upfront

2010-02-04  Laine Stump  <laine@laine.org>

	Another fork() log locking cleanup in file creation
	Similar fix as previous one but for fork() usage when creating
	a file or directory

	* src/util/util.c: virLogLock() and virLogUnlock() around fork()
	  in virFileCreate() and virDirCreateSimple()

2010-02-04  Cole Robinson  <crobinso@redhat.com>

	Fix log locking problem when using fork() in the library
	Ad pointed out by Dan Berrange:
	So if some thread in libvirtd is currently executing a logging call,
	while another thread calls virExec(), that other thread no longer
	exists in the child, but its lock is never released. So when the
	child then does virLogReset() it deadlocks.

	The only way I see to address this, is for the parent process to call
	virLogLock(), immediately before fork(), and then virLogUnlock()
	afterwards in both parent & child. This will ensure that no other
	thread
	can be holding the lock across fork().

	* src/util/logging.[ch] src/libvirt_private.syms: export virLogLock() and
	  virLogUnlock()
	* src/util/util.c: lock just before forking and unlock just after - in
	  both parent and child.

2010-02-03  David Allan  <dallan@redhat.com>

	Fix locking for udev device add/remove
	The original udev node device backend neglected to lock the driverState
	struct containing the device list when adding and removing devices
	* src/node_device/node_device_udev.c: add necessary locks in
	  udevRemoveOneDevice() and udevAddOneDevice()

2010-02-03  Jim Meyering  <meyering@redhat.com>

	interface_conf.c: don't use a negative value as allocation size
	* src/conf/interface_conf.c (virInterfaceDefParseProtoIPv4): If
	virXPathNodeSet returns -1, indicate failure by returning -1 right away.
	(virInterfaceDefParseProtoIPv6): Likewise.

	virStoragePoolSourceListNewSource: avoid unconditional leak
	* src/conf/storage_conf.c (virStoragePoolSourceListNewSource):
	Remove an unused (and leaked) allocation.

	xs_internal.c: don't use a negative value as allocation size
	* src/xen/xs_internal.c (xenStoreDomainIntroduced): Don't use -1
	as an allocation size upon xenStoreNumOfDomains failure.
	(xenStoreDomainReleased): Likewise.

2010-02-03  Daniel P. Berrange  <berrange@redhat.com>

	Ensure QEMU DAC security driver is activated at all times
	If the primary security driver (SELinux/AppArmour) was disabled
	then the secondary QEMU DAC security driver was also disabled.
	This is mistaken, because the latter must be active at all times

	* src/qemu/qemu_driver.c: Ensure DAC driver is always active

2010-02-03  Jim Meyering  <meyering@redhat.com>

	xen_hypervisor.c: remove all "domain == NULL" tests, ...
	* src/xen/xen_hypervisor.c: Remove all "domain == NULL" tests.
	* src/xen/xen_hypervisor.h: Instead, use ATTRIBUTE_NONNULL to
	mark each "domain" parameter as "known always to be non-NULL".

	xen_hypervisor.c: avoid NULL deref for NULL domain argument
	* src/xen/xen_hypervisor.c (xenHypervisorGetVcpus): Don't attempt
	to diagnose an unlikely NULL-domain or NULL-domain->conn error.

2010-02-03  Daniel P. Berrange  <berrange@redhat.com>

	Tweak USB hostdevice XML handling
	When attaching a USB host device based on vendor/product, libvirt
	will resolve the vendor/product into a device/bus pair. This means
	that when printing XML we should allow device/bus info to be printed
	at any time if present

	* src/conf/domain_conf.c, docs/schemas/domain.rng: Allow USB device
	  bus info alongside vendor/product

2010-02-03  Daniel P. Berrange  <berrange@redhat.com>

	Fix QEMU hotplug device alias assignment
	To allow devices to be hot(un-)plugged it is neccessary to ensure
	they all have a unique device aliases. This fixes the hotplug
	methods to assign device aliases before invoking the monitor
	commands which need them

	* src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Expose methods
	  for assigning device aliases for disks, host devices and
	  controllers
	* src/qemu/qemu_driver.c: Assign device aliases when hotplugging
	  all types of device
	* tests/qemuxml2argvdata/qemuxml2argv-hostdev-pci-address-device.args,
	  tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address-device.args:
	  Update for changed hostdev naming scheme

2010-02-03  Daniel P. Berrange  <berrange@redhat.com>

	Disable QEMU monitor IO debugging by default

2010-02-03  Daniel P. Berrange  <berrange@redhat.com>

	Re-arrange QEMU device alias assignment code
	This patch re-arranges the QEMU device alias assignment code to
	make it easier to call into the same codeblock when performing
	device hotplug. The new code has the ability to skip over already
	assigned names to facilitate hotplug

	* src/qemu/qemu_driver.c: Call qemuAssignDeviceNetAlias()
	  instead of qemuAssignNetNames
	* src/qemu/qemu_conf.h: Export qemuAssignDeviceNetAlias()
	  instead of qemuAssignNetNames
	* src/qemu/qemu_driver.c: Merge the legacy disk/network alias
	  assignment code into the main methods

2010-02-03  Daniel P. Berrange  <berrange@redhat.com>

	Remove direct storage of hostnet_name & vlan
	The current way of assigning names to the host network backend and
	NIC device in QEMU was over complicated, by varying naming scheme
	based on the NIC model and backend type. This simplifies the naming
	to simply be 'net0' and 'hostnet0', allowing code to easily determine
	the host network name and vlan based off the primary device alias
	name 'net0'. This in turn allows removal of alot of QEMU specific
	code from the XML parser, and makes it easier to assign new unique
	names for NICs that are hotplugged

	* src/conf/domain_conf.c, src/conf/domain_conf.h: Remove hostnet_name
	  and vlan fields from virNetworkDefPtr
	* src/qemu/qemu_conf.c, src/qemu/qemu_conf.h, src/qemu/qemu_driver.c:
	  Use a single network alias naming scheme regardless of NIC type
	  or backend type. Determine VLANs from the alias name.
	* tests/qemuxml2argvdata/qemuxml2argv-net-eth-names.args,
	  tests/qemuxml2argvdata/qemuxml2argv-net-virtio-device.args,
	  tests/qemuxml2argvdata/qemuxml2argv-net-virtio-netdev.args: Update
	  for new simpler naming scheme

2010-02-03  Daniel P. Berrange  <berrange@redhat.com>

	Remove use of -netdev arg with QEMU
	The QEMU 0.12.x tree has the -netdev command line argument, but not
	corresponding monitor command. We can't enable the former, without
	the latter since it will break hotplug/unplug.

	* src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Disable -netdev usage
	  until 0.13 at earliest
	* tests/qemuxml2argvtest.c: Add test for -netdev syntax
	* tests/qemuxml2argvdata/qemuxml2argv-net-virtio-netdev.args,
	  tests/qemuxml2argvdata/qemuxml2argv-net-virtio-netdev.xml: Test
	  data files for -netdev syntax

2010-02-03  Daniel P. Berrange  <berrange@redhat.com>

	Assign PCI addresses before hotplugging devices
	PCI disk, disk controllers, net devices and host devices need to
	have PCI addresses assigned before they are hot-plugged

	* src/qemu/qemu_conf.c: Add APIs for ensuring a device has an
	  address and releasing unused addresses
	* src/qemu/qemu_driver.c: Ensure all devices have addresses
	  when hotplugging.

2010-02-03  Daniel P. Berrange  <berrange@redhat.com>

	Rewrite way QEMU PCI addresses are allocated
	The current QEMU code allocates PCI addresses incrementally starting
	at 4. This is not satisfactory because the user may have given some
	addresses in their XML config, which need to be skipped over when
	allocating addresses to remaining devices.

	It is thus neccessary to maintain a list of already allocated PCI
	addresses and then only allocate ones that remain unused. This is
	also required for domain device hotplug to work properly later.

	* src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Add APIs for creating
	  list of existing PCI addresses, and allocating new addresses.
	  Refactor address assignment to use this code
	* src/qemu/qemu_driver.c: Pull PCI address assignment up into the
	  qemuStartVMDaemon() method, as a prelude to moving it into the
	  'define' method. Update list of allocated addresses when connecting
	  to a running VM at daemon startup.
	* tests/qemuxml2argvtest.c, tests/qemuargv2xmltest.c,
	  tests/qemuxml2xmltest.c: Remove USB product test since all
	  passthrough is done based on address
	* tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-product.args,
	  tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-product.xml: Kil
	  unused data files

2010-02-03  Daniel P. Berrange  <berrange@redhat.com>

	Introduce generic virDomainDeviceInfo iterator function
	The virDomainDeviceInfoIterate() function will provide a
	convenient way to iterate over all devices in a domain.

	* src/conf/domain_conf.c, src/conf/domain_conf.h,
	  src/libvirt_private.syms: Add virDomainDeviceInfoIterate()
	  function.

2010-02-03  Daniel P. Berrange  <berrange@redhat.com>

	Make hotplug use new device_add where possible
	Since QEMU startup uses the new -device argument, the hotplug
	code needs todo the same. This converts disk, network and
	host device hotplug to use the device_add command

	* src/qemu/qemu_driver.c: Use new device_add monitor APIs
	  whereever possible

2010-02-03  Daniel P. Berrange  <berrange@redhat.com>

	Introduce internal QEMU monitor APIs for drive + device hotadd
	The way QEMU is started has been changed to use '-device' and
	the new style '-drive' syntax. This needs to be mirrored in
	the hotplug code, requiring addition of two new APIs.

	* src/qemu/qemu_monitor.h, src/qemu/qemu_monitor.c: Define APIs
	  qemuMonitorAddDevice() and qemuMonitorAddDrive()
	* src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h,
	  src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h:
	  Implement the new monitor APIs

2010-02-02  Daniel P. Berrange  <berrange@redhat.com>

	Split out QEMU code for building PCI/USB hostdev arg values
	To allow for better code reuse from hotplug methods, the code for
	generating PCI/USB hostdev arg values is split out into separate
	methods

	* qemu/qemu_conf.h, qemu/qemu_conf.c: Introduce new APis for
	  qemuBuildPCIHostdevPCIDevStr, qemuBuildUSBHostdevUsbDevStr
	  and qemuBuildUSBHostdevDevStr

2010-02-02  Daniel P. Berrange  <berrange@redhat.com>

	Standard internal API syntax for building QEMU command line arguments
	All the helper functions for building command line arguments
	now return a 'char *', instead of acepting a 'char **' or
	virBufferPtr argument

	* qemu/qemu_conf.c: Standardize syntax for building args
	* qemu/qemu_conf.h: Export all functions for building args
	* qemu/qemu_driver.c: Update for changed syntax for building
	  NIC/hostnet args

2010-02-02  Jim Meyering  <meyering@redhat.com>

	libvirtd.c: avoid closing a negative socket file descriptor
	* daemon/libvirtd.c (qemudListenUnix): Close socket only if non-negative.

	storage_backend.c: avoid closing a negative file descriptor
	* src/storage/storage_backend.c (virStorageBackendRunProgRegex):
	Don't close a negative (read-only) file descriptor.

	avoid a probable EINVAL from lseek
	* src/qemu/qemu_driver.c (qemudLogReadFD): Don't pass a negative
	offset (from a preceding failed attempt to seek to EOF) to this use
	of lseek.

2010-02-02  Matthias Bolte  <matthias.bolte@googlemail.com>

	udev: Don't let strtoul parse USB busnum and devnum as octal
	udevGetUintProperty was called with base set to 0 for busnum and devnum.
	With base 0 strtoul parses the number as octal if it start with a 0. But
	busnum and devnum are decimal and udev returns them padded with leading
	zeros. So strtoul parses them as octal. This works for certain decimal
	values like 001-007, but fails for values like 008.

	Change udevProcessUSBDevice to use base 10 for busnum and devnum.

2010-02-02  Jim Meyering  <meyering@redhat.com>

	util.c (two more): don't use a negative value as allocation size
	* src/util/util.c (virGetUserID, virGetGroupID): In the unlikely event
	that sysconf(_SC_GETPW_R_SIZE_MAX) fails, don't use -1 as the size in
	the subsequent allocation.

	json.c: avoid an unconditional leak from most qemuMonitorJSON* functions
	* src/util/json.c (virJSONValueFree): Free the "value" pointer, too.

	avoid format-related warnings
	* src/qemu/qemu_monitor_text.c (qemuMonitorTextGetAllPCIAddresses):
	Use %s.
	* src/storage/storage_backend_iscsi.c (virStorageBackendCreateIfaceIQN):
	Likewise.
	* tools/virsh.c (cmdSecretSetValue): Likewise.

2010-02-02  Eric Blake  <ebb9@byu.net>

	maint: avoid excess parens in STREQ
	* src/internal.h (STREQ, STRCASEEQ, STRNEQ, STRCASENEQ, STREQLEN)
	(STRCASEEQLEN, STRNEQLEN, STRCASENEQLEN, STRPREFIX): Avoid
	redundant parenthesis.
	* examples/domain-events/events-c/event-test.c (STREQ): Likewise.
	* src/storage/parthelper.c (STREQ): Likewise.

2010-02-02  Jiri Denemark  <jdenemar@redhat.com>

	Move models/nmodels mismatch checking one level up

2010-02-01  Jiri Denemark  <jdenemar@redhat.com>

	Log flags in virConnectCompareCPU
	* src/libvirt.c: extend the debug statement to log flags too

2010-02-01  Chris Lalancette  <clalance@redhat.com>

	Fix PCI host reattach on domain detach.
	Similar to the race fixed by
	be34c3c7efbb1ea8999530f98b99c5dde3793f84, make sure
	to wait around for KVM to release the resources from
	a hot-detached PCI device before attempting to
	rebind that device to the host driver.

2010-02-01  Matthew Booth  <mbooth@redhat.com>

	Clarify controllers -device string in QEMU driver
	The QEMU driver contained code to generate a -device string for piix4-ide, but
	wasn't using it. This change removes this string generation. It also adds a
	comment explaining why IDE and FDC controllers don't generate -device strings.

	The change also generates an error if a sata controller is specified for a QEMU
	domain, as this isn't supported.

	* src/qemu/qemu_conf.c: Remove VIR_DOMAIN_CONTROLLER_TYPE_IDE handler in
	  qemuBuildControllerDevStr(). Ignore IDE and FDC controllers. Error if
	  SATA controller is discovered. Add comments.

2010-02-01  Chris Lalancette  <clalance@redhat.com>

	Fix up a comment in virHashUpdateEntry

2010-02-01  Chris Lalancette  <clalance@redhat.com>

	Look in /usr/libexec for the qemu-kvm binary.
	On RHEL-5 the qemu-kvm binary is located in /usr/libexec.
	To reduce confusion for people trying to run upstream libvirt
	on RHEL-5 machines, make the qemu driver look in /usr/libexec
	for the qemu-kvm binary.

	To make this work, I modified virFindFileInPath to handle an
	absolute path correctly.  I also ran into an issue where
	NULL was sometimes being passed for the file parameter
	to virFindFileInPath; it didn't crash prior to this patch
	since it was building paths like /usr/bin/(null).  This
	is non-standard behavior, though, so I added a NULL
	check at the beginning.

2010-01-30  Eric Blake  <ebb9@byu.net>

	maint: fix spelling error in hacking
	* HACKING: STRCASEEQ is case insensitive.
	* docs/hacking.html.in: Likewise.

2010-01-30  Jim Meyering  <meyering@redhat.com>

	util.c (virGetUserEnt): don't use a negative value as allocation size
	* src/util/util.c (virGetUserEnt): In the unlikely event that
	sysconf(_SC_GETPW_R_SIZE_MAX) fails, don't use -1 as the size in
	the subsequent allocation.

2010-01-28  Jim Fehlig  <jfehlig@novell.com>

	Support Xen 4.0 sysctl version 7
	xen-unstable c/s 20762 bumped XEN_SYSCTL_INTERFACE_VERSION to 7.  The
	interface change does not affect libvirt, other than xenHypervisorInit()
	failing since version 7 is not tried.

	The attached patch accommodates the upcoming Xen 4.0 release by checking
	for XEN_SYSCTL_INTERFACE_VERSION 7.  If found, it sets
	XEN_DOMCTL_INTERFACE_VERSION to 6, which is also new to Xen 4.0.

2010-01-27  Matthew Booth  <mbooth@redhat.com>

	Add missing sata controller type to domain.rng
	* docs/schemas/domain.rng: Add sata controller type

2010-01-27  Jim Meyering  <meyering@redhat.com>

	cpu_x86.c: avoid NULL-deref for invalid arguments
	* src/cpu/cpu_x86.c (x86Decode): Do not dereference NULL
	when "models" is NULL and nmodels is 1 or greater.

	portability to non-glibc: don't use realpath(..., NULL)
	it causes a NULL-dereference on some systems like Solaris 10.
	* src/node_device/node_device_linux_sysfs.c. Include <stdlib.h>.
	(get_sriov_function): Use canonicalize_file_name, not realpath.
	* bootstrap (modules): Add canonicalize-lgpl.

	pci.c: correct an erroneous expression
	* src/util/pci.c (pciDeviceDownstreamLacksACS): Fix a typo
	that rendered a subexpression always false.

2010-01-27  Matthias Bolte  <matthias.bolte@googlemail.com>

	udev: Set the state driver name

	Remove undefined symbols from libvirt_private.syms

2010-01-27  Matthias Bolte  <matthias.bolte@googlemail.com>

	udev: Remove event handle on shutdown
	This fixes a segfault when the event handler is called after shutdown
	when the global driver state is NULL again.

	Also fix a locking issue in an error path.

2010-01-27  Matthias Bolte  <matthias.bolte@googlemail.com>

	Don't call disabled timer callbacks in event-test.c
	This fixes a segfault in the remote driver that occurs for example when
	the event-test is run inside a domain-0 and libvirtd is also running.

	esx: Output error details from libcurl

	Add missing function parameter documentation

2010-01-26  Jim Meyering  <meyering@redhat.com>

	hostusb: closedir only if non-NULL; rename labels: s/error/cleanup/
	* src/util/hostusb.c (usbSysReadFile): Rename labels s/error/cleanup/
	(usbFindBusByVendor): Likewise.  And closedir only if non-NULL.

2010-01-26  Laine Stump  <laine@laine.org>

	Cleanup of large buffer on stack in virFileMakePath
	virFileMakePath is a recursive function that was creates a buffer
	PATH_MAX bytes long for each recursion (one recursion for each element
	in the path). This changes it to have no buffers on the stack, and to
	allocate just one buffer total, no matter how many elements are in the
	path. Because the modified algorithm requires a char* to be passed in
	rather than const char *, it is now 2 functions - a toplevel API
	function that remains identical in function, and a 2nd helper function
	called for the recursions, which 1) doesn't allocate anything, and 2)
	takes a char* arg, so it can modify the contents.
	* src/util/util.c: rewrite virFileMakePath

2010-01-26  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Stop passing around virConnectPtr for error reporting

2010-01-26  Chris Lalancette  <clalance@redhat.com>

	Revert "Fix libvirtd restart for domains with PCI passthrough devices"
	This reverts commit cdc42d0a4865199a941d330dbb6ca1ef426323ae.
	As DanB pointed out, this patch is actually wrong.  The real
	bug that was causing me to see this problem is a bug
	introduced in a RHEL-5 libvirt snapshot, and I'm going to
	fix the real bug there.

2010-01-26  Chris Lalancette  <clalance@redhat.com>

	Fix a crash when restarting libvirtd.
	If you shutdown libvirtd while a domain with PCI
	devices is running, then try to restart libvirtd,
	libvirtd will crash.

	This happens because qemuUpdateActivePciHostdevs() is calling
	pciDeviceListSteal() with a dev of 0x0 (NULL), and then trying
	to dereference it.  This patch fixes it up so that
	qemuUpdateActivePciHostdevs() steals the devices after first
	Get()'ting them, avoiding the crash.

2010-01-26  Chris Lalancette  <clalance@redhat.com>

	Fix two instances of misspelled 'pseudo'

2010-01-26  Jim Meyering  <meyering@redhat.com>

	qemuMonitorTextAttachDrive: avoid two leaks
	* src/qemu/qemu_monitor_text.c (qemuMonitorTextAttachDrive): Most other
	failures in this function would "goto cleanup", but one mistakenly
	returned directly, skipping the cleanup and resulting in a leak.
	In addition, iterating the "try_command" loop would clobber, and
	thus leak, the "cmd" allocated on the first iteration,
	so be careful to free it in addition to "reply" beforehand.

2010-01-26  Matthias Bolte  <matthias.bolte@googlemail.com>

	qemu: Search binaries in PATH instead of hardcoding /usr/bin

2010-01-26  Daniel P. Berrange  <berrange@redhat.com>

	Implement QMP support for extracting CPU thread ID
	The KVM build of QEMU includs the thread ID of each vCPU in the
	'query-cpus' output. This is required for pinning guests to
	particular host CPUs

	* src/qemu/qemu_monitor_json.c: Extract 'thread_id' from CPU info

2010-01-26  Daniel P. Berrange  <berrange@redhat.com>

	Misc fixes to QMP monitor support for QEMU
	* src/util/json.c, src/util/json.h: Declare returned strings
	  to be const
	* src/qemu/qemu_monitor.c: Wire up JSON mode for qemuMonitorGetPtyPaths
	* src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h: Fix
	  const correctness. Add missing error message in the function
	  qemuMonitorJSONGetAllPCIAddresses. Add implementation of the
	  qemuMonitorGetPtyPaths function calling 'query-chardev'.

2010-01-26  Daniel P. Berrange  <berrange@redhat.com>

	Add some missing include files which break build in certain platforms
	Two files were using functions from <sys/stat.h> but not including
	in. Most of the time they got this automatically via another header,
	but certain build flag combinations can reveal the problem

	* src/lxc/lxc_container.c, src/node_device/node_device_linux_sysfs.c:
	  Add <sys/stat.h>

2010-01-26  Daniel P. Berrange  <berrange@redhat.com>

	Fix setup of compatability serial devices from console device
	The <console> tag is supposed to result in addition of a single
	<serial> device for HVM guests. The 'targetType' attribute was
	missing though causing the compatibility code to add a second
	<console> device

	* src/conf/domain_conf.c: Set targetType for serial device

2010-01-26  Jim Meyering  <meyering@redhat.com>

	usbGetDevice: don't leak a "usbDevice" buffer on failure path
	* src/util/hostusb.c (usbGetDevice): Free "dev" when returning NULL.

	qemuMonitorTextGetMemoryStats: plug a leak on an error path
	* src/qemu/qemu_monitor_text.c (qemuMonitorCommandWithHandler):
	Always free *reply, upon failure.

2010-01-25  Jim Meyering  <meyering@redhat.com>

	usbFindBusByVendor: don't leak a DIR buffer and FD
	* src/util/hostusb.c (usbFindBusByVendor): Don't leak a DIR buffer
	and file descriptor.

2010-01-25  Eric Blake  <ebb9@byu.net>

	Start modernizing configure
	* configure.ac: reanmed configura.in, use AC_CONFIG_HEADERS instead of
	  AM_CONFIG_HEADER

2010-01-23  Chris Lalancette  <clalance@redhat.com>

	Fix libvirtd restart for domains with PCI passthrough devices
	When libvirtd shuts down, it places a <state/> tag in the XML
	state file it writes out for guests with PCI passthrough
	devices.  For devices that are attached at bootup time, the
	state tag is empty.  However, at libvirtd startup time, it
	ignores anything with a <state/> tag in the XML, effectively
	hiding the guest.
	This patch remove the check for VIR_DOMAIN_XML_INTERNAL_STATUS
	when parsing the XML.
	* src/conf/domain_conf.c: remove VIR_DOMAIN_XML_INTERNAL_STATUS
	  flag check in virDomainHostdevSubsysPciDefParseXML()

2010-01-23  Chris Lalancette  <clalance@redhat.com>

	qemu: Fix race between device rebind and kvm cleanup
	Certain hypervisors (like qemu/kvm) map the PCI bar(s) on
	the host when doing device passthrough.  This can lead to a race
	condition where the hypervisor is still cleaning up the device while
	libvirt is trying to re-attach it to the host device driver.  To avoid
	this situation, we look through /proc/iomem, and if the hypervisor is
	still holding onto the bar (denoted by the string in the matcher variable),
	then we can wait around a bit for that to clear up.

	v2: Thanks to review by DV, make sure we wait the full timeout per-device

2010-01-22  Chris Lalancette  <clalance@redhat.com>

	Fix device assignment with root devices
	The patches to add ACS checking to PCI device passthrough
	introduced a bug.  With the current code, if you try to
	passthrough a device on the root bus (i.e. bus 0), then
	it denies the passthrough.  This is because the code in
	pciDeviceIsBehindSwitchLackingACS() to check for a parent
	device doesn't take into account the possibility of the
	root bus.  If we are on the root bus, it means we
	legitimately can't find a parent, and it also means that
	we don't have to worry about whether ACS is enabled.
	Therefore return 0 (indicating we don't lack ACS) from
	pciDeviceIsBehindSwitchLackingACS().

	Add a rule to check for uses of readlink.

	Use virFileResolveLink instead of readlink in AppArmor

	Fix a compile warning in parthelper.c

2010-01-22  Taizo ITO  <taizo.ito@hde.co.jp>

	Add virConnectGetVersion Python API
	adds a new python API call for retrieving the running
	hypervisor version used by a connection: virConnectGetVersion

	* python/generator.py: skip virConnectGetVersion from autogenerated
	* python/libvirt-override-api.xml python/libvirt-override.c: define
	  direct native bindings

2010-01-22  Jamie Strandboge  <jamie@canonical.com>

	Remove AppArmor compile warnings
	* src/security/security_apparmor.c: unused variable in
	  AppArmorSetSecurityAllLabel and unused parameter in
	  AppArmorReleaseSecurityLabel

2010-01-22  Chris Lalancette  <clalance@redhat.com>

	Remove unused PROC_MOUNT_BUF_LEN #define

2010-01-22  Daniel Veillard  <veillard@redhat.com>

	Update polish translation and regenerate localizations

2010-01-21  Daniel P. Berrange  <berrange@redhat.com>

	Add docs about new mailing list
	* docs/contact.html.in: Document new users mailing list

2010-01-21  Adam Litke  <agl@us.ibm.com>

	domMemoryStats / qemu: Fix parsing of unknown stats
	Fix a small problem with the qemu memory stats parsing algorithm.  If qemu
	reports a stat that libvirt does not recognize, skip past it so parsing can
	continue.  This corrects a potential infinite loop in the parsing code that can
	only be triggered if new statistics are added to qemu.

	* src/qemu/qemu_monitor_text.c: qemuMonitorParseExtraBalloonInfo add a
	  skip for extra ','

2010-01-21  David Allan  <dallan@redhat.com>

	Corrected log level of WWN path message
	* src/node_device/node_device_linux_sysfs.c: open_wwn_file() the
	  VIR_ERROR resllay should be just a VIR_DEBUG

2010-01-21  Daniel Veillard  <veillard@redhat.com>

	Fix an error when looking for devices in syspath
	* src/node_device/node_device_udev.c: udevSetupSystemDev() only print the
	  error message if lookup failed in both DMI_DEVPATH and DMI_DEVPATH_FALLBACK

2010-01-21  Dan Kenigsberg  <danken@redhat.com>

	Allow surrounding whitespace in uuid
	* src/util/uuid.c: extend virUUIDParse to allow leading and trailing
	  spaces in UUIDs

2010-01-21  Jim Meyering  <meyering@redhat.com>

	fix "make distcheck" failure
	* tests/Makefile.am (qemuhelpdata): Add qemu-0.12.1.

	avoid more format-related warnings
	* src/qemu/qemu_conf.c (qemuBuildDriveStr): Use "%s".
	* src/qemu/qemu_monitor_json.c (qemuMonitorJSONGetGuestPCIAddress):
	(qemuMonitorJSONGetGuestDriveAddress): Likewise.

	avoid format-related warnings
	* src/conf/domain_conf.c (virDomainDeviceInfoParseXML): Use "%s".

2010-01-21  Daniel P. Berrange  <berrange@redhat.com>

	Fix off-by-1 in SCSI drive hotplug
	The loop looking for the controller associated with a SCI drive had
	an off by one, causing it to miss the last controller.

	* src/qemu/qemu_driver.c: Fix off-by-1 in searching for SCSI
	  drive hotplug

2010-01-21  Daniel P. Berrange  <berrange@redhat.com>

	Fix leak in hotplug code in QEMU driver
	The hotplug code in QEMU was leaking memory because although the
	inner device object was being moved into the main virDomainDefPtr
	config object, the outer container virDomainDeviceDefPtr was not.

	 * src/qemu/qemu_driver.c: Clarify code to show that the inner
	   device object is owned by the main domain config upon
	   successfull attach.

2010-01-21  Daniel P. Berrange  <berrange@redhat.com>

	Add configuration option to turn off dynamic permissions management
	Add the ability to turn off dynamic management of file permissions
	for libvirt guests.

	* qemu/libvirtd_qemu.aug: Support 'dynamic_ownership' flag
	* qemu/qemu.conf: Document 'dynamic_ownership' flag.
	* qemu/qemu_conf.c: Load 'dynamic_ownership' flag
	* qemu/test_libvirtd_qemu.aug: Test 'dynamic_ownership' flag

2010-01-21  Daniel P. Berrange  <berrange@redhat.com>

	Fix security driver calls in hotplug cleanup paths
	The hotplug code was not correctly invoking the security driver
	in error paths. If a hotplug attempt failed, the device would
	be left with VM permissions applied, rather than restored to the
	original permissions. Also, a CDROM media that is ejected was
	not restored to original permissions. Finally there was a bogus
	call to set hostdev permissions in the hostdev unplug code

	* qemu/qemu_driver.c: Fix security driver usage in hotplug/unplug

2010-01-21  Daniel P. Berrange  <berrange@redhat.com>

	Add missing call to re-attach host devices if VM startup fails
	If there is a problem with VM startup, PCI devices may be left
	assigned to pci-stub / pci-back. Adding a call to reattach
	host devices in the cleanup path is required.

	* qemu/qemu_driver.c: qemuDomainReAttachHostDevices() when
	  VM startup fails

2010-01-21  Daniel P. Berrange  <berrange@redhat.com>

	Switch QEMU driver over to use the DAC security driver
	Remove all the QEMU driver calls for setting file ownership and
	process uid/gid. Instead wire in the QEMU DAC security driver,
	stacking it ontop of the primary SELinux/AppArmour driver.

	* qemu/qemu_driver.c: Switch over to new DAC security driver

2010-01-21  Daniel P. Berrange  <berrange@redhat.com>

	Introduce a new DAC security driver for QEMU
	This new security driver is responsible for managing UID/GID changes
	to the QEMU process, and any files/disks/devices assigned to it.

	* qemu/qemu_conf.h: Add flag for disabling automatic file permission
	  changes
	* qemu/qemu_security_dac.h, qemu/qemu_security_dac.c: New DAC driver
	  for QEMU guests
	* Makefile.am: Add new files

2010-01-21  Daniel P. Berrange  <berrange@redhat.com>

	Introduce a stacked security driver impl for QEMU
	* qemu/qemu_conf.h: Add securityPrimaryDriver and
	  securitySecondaryDriver fields to 'struct qemud_driver'
	* Makefile.am: Add new files
	* qemu/qemu_security_stacked.c, qemu/qemu_security_stacked.h: A
	  simple stacked security driver

2010-01-21  Daniel P. Berrange  <berrange@redhat.com>

	Pull initial disk labelling out into libvirtd instead of exec hook
	Pulling the disk labelling code out of the exec hook, and into
	libvirtd will allow it to access shared state in the daemon. It
	will also make debugging & error reporting easier / more reliable.

	* qemu/qemu_driver.c: Move initial disk labelling calls up into
	  libvirtd. Add cleanup of disk labels upon failure

2010-01-21  Daniel P. Berrange  <berrange@redhat.com>

	Fix leak of allocated security label
	If a VM fails to start, we can't simply free the security label
	strings, we must call the domainReleaseSecurityLabel() method
	otherwise the reserved 'mcs' level will be leaked in SElinux

	* src/qemu/qemu_driver.c: Invoke domainReleaseSecurityLabel()
	  when domain fails to start

2010-01-21  Daniel P. Berrange  <berrange@redhat.com>

	Refactor setup & cleanup of security labels in security driver
	The current security driver architecture has the following
	split of logic

	 * domainGenSecurityLabel

	    Allocate the unique label for the domain about to be started

	 * domainGetSecurityLabel

	    Retrieve the current live security label for a process

	 * domainSetSecurityLabel

	    Apply the previously allocated label to the current process
	    Setup all disk image / device labelling

	 * domainRestoreSecurityLabel

	    Restore the original disk image / device labelling.
	    Release the unique label for the domain

	The 'domainSetSecurityLabel' method is special because it runs
	in the context of the child process between the fork + exec.

	This is require in order to set the process label. It is not
	required in order to label disks/devices though. Having the
	disk labelling code run in the child process limits what it
	can do.

	In particularly libvirtd would like to remember the current
	disk image label, and only change shared image labels for the
	first VM to start. This requires use & update of global state
	in the libvirtd daemon, and thus cannot run in the child
	process context.

	The solution is to split domainSetSecurityLabel into two parts,
	one applies process label, and the other handles disk image
	labelling. At the same time domainRestoreSecurityLabel is
	similarly split, just so that it matches the style. Thus the
	previous 4 methods are replaced by the following 6 new methods

	 * domainGenSecurityLabel

	    Allocate the unique label for the domain about to be started
	    No actual change here.

	 * domainReleaseSecurityLabel

	   Release the unique label for the domain

	 * domainGetSecurityProcessLabel

	   Retrieve the current live security label for a process
	   Merely renamed for clarity.

	 * domainSetSecurityProcessLabel

	   Apply the previously allocated label to the current process

	 * domainRestoreSecurityAllLabel

	    Restore the original disk image / device labelling.

	 * domainSetSecurityAllLabel

	    Setup all disk image / device labelling

	The SELinux and AppArmour drivers are then updated to comply with
	this new spec. Notice that the AppArmour driver was actually a
	little different. It was creating its profile for the disk image
	and device labels in the 'domainGenSecurityLabel' method, where as
	the SELinux driver did it in 'domainSetSecurityLabel'. With the
	new method split, we can have consistency, with both drivers doing
	that in the domainSetSecurityAllLabel method.

	NB, the AppArmour changes here haven't been compiled so may not
	build.

2010-01-21  Daniel P. Berrange  <berrange@redhat.com>

	Make security drivers responsible for checking dynamic vs static labelling
	The QEMU driver is doing 90% of the calls to check for static vs
	dynamic labelling. Except it is forgetting todo so in many places,
	in particular hotplug is mistakenly assigning disk labels. Move
	all this logic into the security drivers themselves, so the HV
	drivers don't have to think about it.

	* src/security/security_driver.h: Add virDomainObjPtr parameter
	  to virSecurityDomainRestoreHostdevLabel and to
	  virSecurityDomainRestoreSavedStateLabel
	* src/security/security_selinux.c, src/security/security_apparmor.c:
	  Add explicit checks for VIR_DOMAIN_SECLABEL_STATIC and skip all
	  chcon() code in those cases
	* src/qemu/qemu_driver.c: Remove all checks for VIR_DOMAIN_SECLABEL_STATIC
	  or VIR_DOMAIN_SECLABEL_DYNAMIC. Add missing checks for possibly NULL
	  driver entry points.

2010-01-21  David Allan  <dallan@redhat.com>

	Implement support for multi IQN
	Allows the initiator to use a variety of IQNs rather than just the
	system IQN when creating iSCSI pools.
	* docs/schemas/storagepool.rng: extends the syntax with <iqn name="..."/>
	* src/conf/storage_conf.[ch]: read and stores the iqn name
	* src/storage/storage_backend_iscsi.[ch]: implement the IQN selection
	  when detected

2010-01-21  Jiri Denemark  <jdenemar@redhat.com>

	Let make fail when XHTML validation fails

2010-01-21  Laine Stump  <laine@laine.org>

	Fix uses of virFileMakePath
	* src/lxc/lxc_container.c src/lxc/lxc_controller.c src/lxc/lxc_driver.c
	  src/network/bridge_driver.c src/qemu/qemu_driver.c
	  src/uml/uml_driver.c: virFileMakePath returns 0 for success, or the
	  value of errno on failure, so error checking should be to test
	  if non-zero, not if lower than 0

2010-01-21  Laine Stump  <laine@laine.org>

	Create storage pool directories with proper uid/gid/mode
	Previously the uid/gid/mode in the xml was ignored when creating new
	storage pool directories. This commit attempts to honor the requested
	permissions, and spits out an error if it can't.

	Note that when creating the directory, the rest of the path leading up
	to the final element is created using current uid/gid/mode, and the
	final element gets the settings from xml. It is NOT an error for the
	directory to already exist; in this case, the perms for the existing
	directory are just set (if necessary).

	* src/storage/storage_backend_fs.c: update the virStorageBackendFileSystemBuild
	  function to check the directory hierarchy separately then create the
	  leaf directory with the right attributes

2010-01-21  Laine Stump  <laine@laine.org>

	Create storage volumes directly with desired uid/gid
	In order to avoid problems trying to chown files that were created by
	root on a root-squashing nfs server, fork a new process that setuid's
	to the desired uid before creating the file. (It's only done this way
	if the pool containing the new volume is of type 'netfs', otherwise
	the old method of creating the file followed by chown() is used.)

	This changes the semantics of the "create_func" slightly - previously
	it was assumed that this function just created the file, then the
	caller would chown it to the desired uid. Now, create_func does both
	operations.

	There are multiple functions that can take on the role of create_func:

	createFileDir - previously called mkdir(), now calls virDirCreate().
	virStorageBackendCreateRaw - previously called open(),
	                             now calls virFileCreate().
	virStorageBackendCreateQemuImg - use virRunWithHook() to setuid/gid.
	virStorageBackendCreateQcowCreate - same.
	virStorageBackendCreateBlockFrom - preserve old behavior (but attempt
	                                   chown when necessary even if not root)

	* src/storage/storage_backend.[ch] src/storage/storage_backend_disk.c
	  src/storage/storage_backend_fs.c src/storage/storage_backend_logical.c
	  src/storage/storage_driver.c: change the create_func implementations,
	  also propagate the pool information to be able to detect NETFS ones.

2010-01-21  Laine Stump  <laine@laine.org>

	New utility functions virFileCreate and virDirCreate
	These functions create a new file or directory with the given
	uid/gid. If the flag VIR_FILE_CREATE_AS_UID is given, they do this by
	forking a new process, calling setuid/setgid in the new process, and
	then creating the file. This is better than simply calling open then
	fchown, because in the latter case, a root-squashing nfs server would
	create the new file as user nobody, then refuse to allow fchown.

	If VIR_FILE_CREATE_AS_UID is not specified, the simpler tactic of
	creating the file/dir, then chowning is is used. This gives better
	results in cases where the parent directory isn't on a root-squashing
	NFS server, but doesn't give permission for the specified uid/gid to
	create files. (Note that if the fork/setuid method fails to create the
	file due to access privileges, the parent process will make a second
	attempt using this simpler method.)

	If the bit VIR_FILE_CREATE_ALLOW_EXIST is set in the flags, an
	existing file/directory will not cause an error; in this case, the
	function will simply set the permissions of the file/directory to
	those requested. If VIR_FILE_CREATE_ALLOW_EXIST is not specified, an
	existing file/directory is considered (and reported as) an error.

	Return from both of these functions is 0 on success, or the value of
	errno if there was a failure.

	* src/util/util.[ch]: add the 2 new util functions

2010-01-21  Laine Stump  <laine@laine.org>

	Add virRunWithHook util function
	* src/util/util.[ch]: similar to virExecWithHook, but waits for child to
	  exit. Useful for doing things like setuid after the fork but before the
	  exec.

2010-01-21  Matthias Bolte  <matthias.bolte@googlemail.com>

	Unset copied environment variables in qemuxml2argvtest
	The test expected all environment variables copied in qemudBuildCommandLine
	to have known values. So all of them have to be either set to a known value
	or be unset. SDL_VIDEODRIVER and QEMU_AUDIO_DRV are not handled at all but
	should be handled. Unset both, otherwise the test will fail if they are set
	in the testing environment.

	* src/qemu/qemu_conf.c: add a comment about copied environment variables
	  and qemuxml2argvtest
	* tests/qemuxml2argvtest.c: unset SDL_VIDEODRIVER and QEMU_AUDIO_DRV

2010-01-21  Matthias Bolte  <matthias.bolte@googlemail.com>

	qemu: Don't allocate zero bytes

2010-01-21  Jim Meyering  <meyering@redhat.com>

	clean-up: remove unnecessary closedir call
	* src/node_device/node_device_linux_sysfs.c (get_virtual_functions_linux):
	Remove unnecessary closedir.  Spotted by Dave Allan.

	node_device_linux_sysfs.c: avoid opendir/fd leak on error path
	* src/node_device/node_device_linux_sysfs.c(get_virtual_functions_linux):
	Don't leak a DIR buffer and file descriptor on error path.

	domain_conf.c: avoid a leak and the need for "cleanup:" block
	* src/conf/domain_conf.c (virDomainChrDefFormat): Plug a leak on
	an error path, and at the same time, eliminate the need for a
	"cleanup:" block.  Before, the "return -1" after the switch
	would leak an "addr" string.  Now, by reversing the port,addr-
	getting blocks we can free "addr" immediately and skip the goto.

2010-01-21  Daniel P. Berrange  <berrange@redhat.com>

	Make all bitfields unsigned ints to avoid unexpected values in casts
	The 'int virInterfaceIsActive()' method was directly returning the
	value of the 'int active:1' bitfield in virIntefaceDefPtr. A bitfield
	with a signed integer, will hold the values 0 and -1, not 0 and +1
	as might be expected. This meant that virInterfaceIsActive() was
	always returning -1 when the interface was active, not +1 & thus all
	callers thought an error had occurred. To protect against this kind
	of mistake again, change all bitfields to be unsigned ints

	* daemon/libvirtd.h, src/conf/domain_conf.h, src/conf/interface_conf.h,
	  src/conf/network_conf.h: Change bitfields to unsigned int.

2010-01-21  Daniel P. Berrange  <berrange@redhat.com>

	Fix QEMU driver custom domain status XML extensions
	Invoking the virConnectGetCapabilities() method causes the QEMU
	driver to rebuild its internal capabilities object. Unfortunately
	it was forgetting to register the custom domain status XML hooks
	again.

	To avoid this kind of error in the future, the code which builds
	capabilities is refactored into one single method, which can be
	called from all locations, ensuring reliable rebuilds.

	* src/qemu/qemu_driver.c: Fix rebuilding of capabilities XML and
	  guarentee it is always consistent

2010-01-20  Jiri Denemark  <jdenemar@redhat.com>

	Document cpu-compare command in virsh man page

	Document <cpu> elements in capabilities and domain XML

2010-01-20  Matthias Bolte  <matthias.bolte@googlemail.com>

	docs: Remove outdated information about remote limitations

2010-01-20  Jim Meyering  <meyering@redhat.com>

	logging: confirm that we want to ignore a write error
	* src/util/logging.c (virLogMessage): Include "ignore-value.h".
	Use it to ignore the return value of safewrite.
	Use STDERR_FILENO, rather than "2".
	* bootstrap (modules): Add ignore-value.
	* gnulib: Update to latest, for ignore-value that is now LGPLv2+.

	xen_driver: don't leak a parsed-config buffer
	* src/xen/xen_driver.c (xenUnifiedDomainXMLFromNative): Also
	free "conf" before returning.

2010-01-20  Laine Stump  <laine@laine.org>

	Update interface.rng and xml test files to match netcf 0.1.5
	The RNG now supports IPv6 and bonds attached to bridges, along with
	some other minor tweaks. All test files from netcf have been copied to
	the test directory and added to the xml2xml and schema tests (and they
	all pass, of course ;-)

2010-01-20  Laine Stump  <laine@laine.org>

	Support bond interfaces attached to bridges in interface xml.
	This was accomplished in xml parsing by doing away with the
	stripped-down virInterfaceBareDef object, and just always using
	virInterfaceDef, but with restrictions in certain places (eg, the type
	of subordinate interface allowed in parsing depends on the parent
	interface).

	xml formatting was similarly adjusted. In addition, the formatting
	functions keep track of the level of interface nesting, and insert
	extra leading spaces on each line accordingly (using %*s).

	The only change in formatted xml from previous (aside frmo supporting
	new combinations of interface types) is that the subordinate ethernet
	interfaces take up 2 lines rather than one, eg:

	   <interface type='ethernet' name='eth0'>
	   </interface>

	instead of:

	   <interface type='ethernet' name='eth0'/>

2010-01-20  Laine Stump  <laine@laine.org>

	Allow empty bridges in interface xml.

	Support delay property in interface bridge xml.

2010-01-20  Jim Meyering  <meyering@redhat.com>

	storage_conf: plug a leak on OOM error path
	* src/conf/storage_conf.c (virStoragePoolSourceListNewSource):
	Free just-allocated "source" upon VIR_REALLOC_N failure.

2010-01-20  Jiri Denemark  <jdenemar@redhat.com>

	Remove superfluous new lines from messages
	I noticed some debug messages are printed with an empty lines after
	them. This patch removes these empty lines from all invocations of the
	following macros:
	    VIR_DEBUG
	    VIR_DEBUG0
	    VIR_ERROR
	    VIR_ERROR0
	    VIR_INFO
	    VIR_WARN
	    VIR_WARN0

	Use pciDeviceIsAssignable in qemu driver

	Tests for ACS in PCIe switches
	New pciDeviceIsAssignable() function for checking whether a given PCI
	device can be assigned to a guest was added. Currently it only checks
	for ACS being enabled on all PCIe switches between root and the PCI
	device. In the future, it could be the right place to check whether a
	device is unbound or bound to a stub driver.

2010-01-19  Daniel Veillard  <veillard@redhat.com>

	Add Jiri Denemark <jdenemar@redhat.com> to commiters

2010-01-19  Jiri Denemark  <jdenemar@redhat.com>

	Allow for CPU topology specification without model
	Currently CPU topology may only be specified together with CPU model:
	    <cpu match='exact'>
	        <model>name</model>
	        <topology sockets='1' cores='2' threads='3'/>
	    </cpu>

	This patch allows for CPU topology specification without the need for
	also specifying CPU model:
	    <cpu>
	        <topology sockets='1' cores='2' threads='3'/>
	    </cpu>

	'match' attribute and 'model' element are made optional with the
	restriction that 'match' attribute has to be set when 'model' is
	present.

2010-01-19  Jiri Denemark  <jdenemar@redhat.com>

	Add debug messages for CPU incompatibility
	When comparing incompatible CPUs, the reason for this incompatibility is
	logged as a debug message.

2010-01-19  Jiri Denemark  <jdenemar@redhat.com>

	Take disabled/forced CPU features into account
	When comparing x86 CPUs, features with 'disabled' policy were mistakenly
	required to be supported by the host CPU.

	Likewise, features with 'force' policy which were supported by host CPU
	would make CPUs incompatible if 'strict' match was used by guest CPU.

	This patch fixes both issues.

2010-01-19  Jiri Denemark  <jdenemar@redhat.com>

	Implement CPU topology support for QEMU driver
	QEMU's command line equivalent for the following domain XML fragment
	    <vcpus>2</vcpus>
	    <cpu ...>
	        ...
	        <topology sockets='1' cores='2', threads='1'/>
	    </cpu>

	is

	    -smp 2,sockets=1,cores=2,threads=1

	This syntax was introduced in QEMU-0.12.

	Version 2 changes:
	- -smp argument build split into a separate function
	- always add ",sockets=S,cores=C,threads=T" to -smp if qemu supports it
	- use qemuParseCommandLineKeywords for command line parsing

	Version 3 changes:
	- ADD_ARG_LIT => ADD_ARG and line reordering in qemudBuildCommandLine
	- rebased

2010-01-19  Jiri Denemark  <jdenemar@redhat.com>

	Enhance qemuParseCommandLineKeywords
	Current version expects name=value,... list and when an incorrect string
	such as "a,b,c=d" would be parsed as "a,b,c" keyword with "d" value
	without reporting any error, which is probably not the expected
	behavior.

	This patch adds an extra argument called allowEmptyValue, which if
	non-zero will permit keywords with no value; "a,b=c,,d=" will be parsed
	as follows:
	    keyword value
	    "a"     NULL
	    "b"     "c"
	    ""      NULL
	    "d"     ""

	In case allowEmptyValue is zero, the string is required to contain
	name=value pairs only; retvalues is guaranteed to contain non-NULL
	pointers. Now, "a,b,c=d" will result in an error.

2010-01-18  Daniel P. Berrange  <berrange@redhat.com>

	Convert VirtIO balloon over to -device syntax
	Replace

	   -balloon virtio

	With

	   -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3

	This allows it to get correct assigned PCI address as declared in
	previous patch

	 * src/qemu/qemu_conf.c: Convert Virtio ballon to -device and
	   give it an explicit PCI address
	 * tests/qemuxml2argvdata/qemuxml2argv-*args: Add in virtio balloon
	   where appropriate

2010-01-18  Daniel P. Berrange  <berrange@redhat.com>

	Auto-assign PCI addresses
	Instead of relying on QEMU to assign PCI addresses and then querying
	them with 'info pci', manually assign all PCI addresses before starting
	the guest.  These addresses are not stable across reboots. That will
	come in a later patch

	NB, the PIIX3 (IDE, FDC, ISA-Bridge) will always have slot 1 and
	VGA will always have slot 2. We declare the Virtio Balloon gets
	slot 3, and then all remaining slots are for configured devices.

	* src/qemu/qemu_conf.c: If -device is supported, then assign all PCI
	  addresses when building the command line
	* src/qemu/qemu_driver.c: Don't query monitor for PCI addresses if
	  they have already been assigned
	* tests/qemuxml2argvdata/qemuxml2argv-hostdev-pci-address-device.args,
	  tests/qemuxml2argvdata/qemuxml2argv-net-virtio-device.args,
	  tests/qemuxml2argvdata/qemuxml2argv-sound-device.args,
	  tests/qemuxml2argvdata/qemuxml2argv-watchdog-device.args: Update
	  to include PCI slot/bus information

2010-01-18  Daniel P. Berrange  <berrange@redhat.com>

	Pass -vga none if no video card specified
	QEMU always configures a VGA card. If no video card is included in
	the libvirt XML, it is neccessary to explicitly turn off the default
	using -vga none

	* src/qemu/qemu_conf.c: Pass -vga none if no video card is configured
	* tests/qemuargv2xmltest.c, tests/qemuxml2argvtest.c: Test for
	  handling -vga none.
	* tests/qemuxml2argvdata/qemuxml2argv-nographics-vga.args,
	  tests/qemuxml2argvdata/qemuxml2argv-nographics-vga.xml: Test
	  data files

2010-01-18  Daniel P. Berrange  <berrange@redhat.com>

	Add support for explicit -sdl flag to QEMU
	Not all QEMU builds default to SDL graphics for their display.
	Newer QEMU now has an explicit -sdl flag, which we can use to
	explicitly request SDL intead of relying on the default. This
	protects libvirt against unexpected changes in graphics default

	* src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Probe for -sdl
	  flag and use it if it is found
	* tests/qemuhelptest.c: Add SDL flag to tests

2010-01-18  Daniel P. Berrange  <berrange@redhat.com>

	Convert guestfwd to -device, and add -sdl explicit args
	The old syntax was

	   -chardev SOMECONFIG
	   -nic user,guestfwd=tcp:IP:PORT-chardev:CHARDEV

	The new syntax is

	   -chardev SOMECONFIG
	   -netdev user,guestfwd=tcp:IP:PORT,chardev=ID,id=user-ID

2010-01-18  Daniel P. Berrange  <berrange@redhat.com>

	Convert PCI device assignment over to -device
	The old syntax is

	  -pcidevice host=BUS:SLOT:FUNCTION

	The new syntax is

	  -device pci-assign,host=BUS:SLOT:FUNCTION,addr=<PCI SLOT>,id=host0

2010-01-18  Daniel P. Berrange  <berrange@redhat.com>

	Convert USB input devices to -device

2010-01-18  Daniel P. Berrange  <berrange@redhat.com>

	Convert USB hostdevices over to -device
	The old syntax was

	   -usbdevice host:PRODUCT:VENDOR

	Or

	   -usbdevice host:BUS.DEV

	The new syntax is

	   -device usb-host,product=PRODUCT,vendor=VENDOR

	Or

	   -device usb-host,hostbus=BUS,hostaddr=DEV

2010-01-18  Daniel P. Berrange  <berrange@redhat.com>

	Convert USB disks over to -device
	The previous syntax was severely limited in its options

	  -usbdevice disk:/home/berrange/output.img

	The new syntax is the same as for other disk types

	  -drive file=/home/berrange/output.img,if=none,id=usb-1,index=1
	  -device usb-storage,drive=usb-1

	Again, the index= arg is wrong here, and will be removed in a
	later merge

2010-01-18  Daniel P. Berrange  <berrange@redhat.com>

	Convert NICs over to use -device & -netdev where possible
	The current syntax uses a pair of args

	   -net nic,macaddr=52:54:00:56:6c:55,vlan=3,model=pcnet,name=pcnet.0
	   -net user,vlan=3,name=user.0

	The new syntax does not  need the vlan craziness anymore, and
	so has a simplified pair of args

	   -netdev user,id=user.0
	   -device pcnet,netdev=user.0,id=pcnet.0,mac=52:54:00:56:6c:55,addr=<PCI SLOT>

2010-01-18  Daniel P. Berrange  <berrange@redhat.com>

	Convert disk drive over to use -device where available
	The current preferred syntax for disk drives uses

	  -drive file=/vms/plain.qcow,if=virtio,index=0,boot=on,format=qcow

	The new syntax splits this up into a pair of linked args

	  -drive file=/vms/plain.qcow,if=none,id=drive-virtio-0,format=qcow2
	  -device virtio-blk-pci,drive=drive-virtio-0,id=virtio-0,addr=<PCI SLOT>

	SCSI/IDE devices also get a bus property linking them to the
	controller

	  -device scsi-disk,drive=drive-scsi0-0-0,id=scsi0-0-0,bus=scsi0.0,scsi-id=0
	  -device ide-drive,drive=drive-ide0-0-0,id=ide0-0-0,bus=ide0,unit=0

2010-01-18  Daniel P. Berrange  <berrange@redhat.com>

	Convert audio devices over to -device syntax
	The current syntax for audio devices is a horrible multiplexed
	arg

	    -soundhw sb16,pcspk,ac97

	The new syntax is

	    -device sb16,id=sound0

	or

	    -device AC97,id=sound1,addr=<PCI SLOT>

	NB, pcspk still uses the old -soundhw syntax

2010-01-18  Daniel P. Berrange  <berrange@redhat.com>

	Convert watchdog to -device
	The current syntax for watchdogs is

	    -watchdog i6300esb

	The new syntax will now be

	    -device i6300esb,id=watchdogNN,addr=<PCI-SLOT>

2010-01-18  Daniel P. Berrange  <berrange@redhat.com>

	Convert character devices over to use -device
	The current character device syntax uses either

	  -serial tty,path=/dev/ttyS2

	Or

	  -chardev tty,id=serial0,path=/dev/ttyS2 -serial chardev:serial0

	With the new -device support, we now prefer

	  -chardev file,id=serial0,path=/tmp/serial.log -device isa-serial,chardev=serial0

	This patch changes the existing -chardev syntax to use this new
	scheme, and fallbacks to the old plain -serial syntax for old
	QEMU.

	The monitor device changes to

	  -chardev socket,id=monitor,path=/tmp/test-monitor,server,nowait -mon chardev=monitor

	In addition, this patch adds --nodefaults, which kills off the
	default serial, parallel, vga and nic devices. THis avoids the
	need for us to explicitly turn each off

2010-01-18  Daniel P. Berrange  <berrange@redhat.com>

	Assign device aliases for all devices at startup
	When starting a guest, give every device a unique alias. This will
	be used for the 'id' parameter in -device args in later patches.
	It can also be used to uniquely identify devices in the monitor

	For old QEMU without -device, assign disk names based on QEMU's
	historical naming scheme.

	* src/qemu/qemu_conf.c: Assign unique device aliases
	* src/qemu/qemu_driver.c: Remove obsolete qemudDiskDeviceName
	  and use the device alias in eject & blockstats commands

2010-01-18  Jim Meyering  <meyering@redhat.com>

	storage_backend_fs.c: do not ignore probe failure
	* src/storage/storage_backend_fs.c (virStorageBackendFileSystemRefresh):
	Correct parentheses.  The documented intent is to ignore non-regular
	files, yet due to a parenthesization error all errors were handled
	that way.

2010-01-18  Daniel P. Berrange  <berrange@redhat.com>

	Probe for -device and use -nodefaults
	Probe for the new -device flag and if available set the -nodefaults
	flag, instead of using -net none, -serial none or -parallel none.
	Other device types will be converted to use -device in later patches.
	The -nodefaults flag will help avoid unwelcome surprises from future
	QEMU releases

	* src/qemu/qemu_conf.c: Probe for -device. Add -nodefaults flag.
	  Remove -net none, -serial none or -parallel none
	* src/qemu/qemu_conf.h: Define QEMU_CMD_FLAG_DEVICE
	* tests/qemuhelpdata/qemu-0.12.1: New data file for 0.12.1 QEMU
	* tests/qemuhelptest.c: Test feature extraction from 0.12.1 QEMU

2010-01-18  Daniel P. Berrange  <berrange@redhat.com>

	Add device info to serial, parallel, channel, input & fs devices
	Although the serial, parallel, chanel, input & fs devices do
	not have PCI address info, they can all have device aliases.
	Thus it neccessary to associate the virDomainDeviceInfo data
	with them all.

	* src/conf/domain_conf.c, src/conf/domain_conf.h: Add hooks for
	  parsing / formatting device info for serial, parallel, channel
	  input and fs devices.
	* docs/schemas/domain.rng: Associate device info with character
	  devices, input & fs device

2010-01-18  Daniel P. Berrange  <berrange@redhat.com>

	Introduce device aliases
	This patch introduces the support for giving all devices a short,
	unique name, henceforth known as a 'device alias'.  These aliases
	are not set by the end user, instead being assigned by the hypervisor
	if it decides it want to support this concept.

	The QEMU driver sets them whenever using the -device arg syntax
	and uses them for improved hotplug/hotunplug. it is the intent
	that other APIs (block / interface stats & device hotplug) be
	able to accept device alias names in the future.

	The XML syntax is

	   <alias name="video0"/>

	This may appear in any type of device that supports device info.

	* src/conf/domain_conf.c, src/conf/domain_conf.h: Add a 'alias'
	  field to virDomainDeviceInfo struct & parse/format it in XML
	* src/libvirt_private.syms: Export virDomainDefClearDeviceAliases
	* src/qemu/qemu_conf.c: Replace use of "nic_name" field with the
	  standard device alias
	* src/qemu/qemu_driver.c: Clear device aliases at shutdown

2010-01-18  Daniel P. Berrange  <berrange@redhat.com>

	Clear assigned PCI devices at shutdown
	The PCI device addresses are only valid while the VM is running,
	since they are auto-assigned by QEMU. After shutdown they must
	all be cleared. Future QEMU driver enhancement will allow for
	persistent PCI address assignment

	* src/conf/domain_conf.h, src/conf/domain_conf.c, src/libvirt_private.syms
	  Add virDomainDefClearPCIAddresses() method for wiping out auto assigned
	  PCI addresses
	* src/qemu/qemu_driver.c: Clear PCI addresses at VM shutdown

2010-01-18  Daniel P. Berrange  <berrange@redhat.com>

	Auto-add disk controllers based on defined disks
	Existing applications using libvirt are not aware of the disk
	controller concept. Thus, after parsing the <disk> definitions
	in the XML, it is neccessary to create <controller> elements
	to satisfy all requested disks, as per their defined drive
	addresses

	* src/conf/domain_conf.c, src/conf/domain_conf.h,
	  src/libvirt_private.syms: Add virDomainDefAddDiskControllers()
	  method for populating disk controllers, and call it after
	  parsing disk definitions.
	* src/qemu/qemu_conf.c: Call virDomainDefAddDiskControllers()
	  when doing ARGV -> XML conversion
	* tests/qemuxml2argvdata/qemuxml2argv*.xml: Add disk controller
	  data to all data files which don't have it already

2010-01-18  Daniel P. Berrange  <berrange@redhat.com>

	Avoid free'ing a constant string in chardev lookup code
	 * src/qemu/qemu_monitor_text.c: Don't free const string in
	   qemuMonitorTextGetPtyPaths()

2010-01-18  Daniel P. Berrange  <berrange@redhat.com>

	Remove restriction on duplicated sound devices in parser
	It is perfectly acceptable to have multiple sound devices of
	same type in guest configuration. If the underlying hypervisor
	does not like this, it is its job to complain, not the XML
	parser's

	* src/conf/domain_conf.c: Remove hack which deleted duplicated
	  sound device models.
	* tests/xml2sexprdata/xml2sexpr-fv-sound.xml: Remove duplicate
	  models

2010-01-18  Daniel P. Berrange  <berrange@redhat.com>

	Detect PCI addresses at QEMU startup
	Hotunplug of devices requires that we know their PCI address. Even
	hotplug of SCSI drives, required that we know the PCI address of
	the SCSI controller to attach the drive to. We can find this out
	by running 'info pci' and then correlating the vendor/product IDs
	with the devices we booted with.

	Although this approach is somewhat fragile, it is the only viable
	option with QEMU < 0.12, since there is no way for libvirto set
	explicit PCI addresses when creating devices in the first place.
	For QEMU > 0.12, this code will not be used.

	* src/qemu/qemu_driver.c: Assign all dynamic PCI addresses on
	  startup of QEMU VM, matching vendor/product IDs
	* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
	  src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h,
	  src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h: Add
	  API for fetching PCI device address mapping

2010-01-18  Daniel P. Berrange  <berrange@redhat.com>

	Properly support SCSI drive hotplug
	The current SCSI hotplug support attaches a brand new SCSI controller
	for every disk. This is broken because the semantics differ from those
	used when starting the VM initially. In the latter case, each SCSI
	controller is filled before a new one is added.

	If the user specifies an high drive index (sdazz) then at initial
	startup, many intermediate SCSI controllers may be added with no
	drives.

	This patch changes SCSI hotplug so that it exactly matches the
	behaviour of initial startup. First the SCSI controller number is
	determined for the drive to be hotplugged. If any controller upto
	and including that controller number is not yet present, it is
	attached. Then finally the drive is attached to the last controller.

	NB, this breaks SCSI hotunplug, because there is no 'drive_del'
	command in current QEMU. Previous SCSI hotunplug was broken in
	any case because it was unplugging the entire controller, not
	just the drive in question.

	A future QEMU will allow proper SCSI hotunplug of a drive.

	This patch is derived from work done by Wolfgang Mauerer on disk
	controllers.

	* src/qemu/qemu_driver.c: Fix SCSI hotplug to add a drive to
	 the correct controller, instead of just attaching a new
	  controller.
	* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
	  src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h,
	  src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h: Add
	  support for 'drive_add' command

2010-01-18  Wolfgang Mauerer  <wolfgang.mauerer@siemens.com>

	Implement SCSI controller hotplug/unplug for QEMU
	This patch allows for explicit hotplug/unplug of SCSI controllers.
	Ordinarily this is not required, since QEMU/libvirt will attach
	a new SCSI controller whenever one is required. Allowing explicit
	hotplug of controllers though, enables the caller to specify a
	static PCI address, instead of auto-assigning the next available
	PCI slot. Or it will when we have static PCI addressing.

	This patch is derived from Wolfgang Mauerer's disk controller
	patch series.

	* src/qemu/qemu_driver.c: Support hotplug & unplug of SCSI
	  controllers
	* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
	  src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h,
	  src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h: Add
	  new API for attaching PCI SCSI controllers

2010-01-18  Jim Meyering  <meyering@redhat.com>

	vbox_tmpl.c: remove useless array-is-non-NULL comparisons
	* src/vbox/vbox_tmpl.c (vboxStorageVolDelete): Remove always-true
	array-is-non-NULL test.  git grep 'key\[.*\];'|grep -F .h
	src/datatypes.h:    char key[PATH_MAX];
	(vboxStorageVolGetInfo): Likewise.
	(vboxStorageVolGetXMLDesc): Likewise.
	(vboxStorageVolGetPath): Likewise.
	(vboxDomainDefineXML): Likewise. (but now with "mac[]")

	lxc_driver: remove useless comparison
	* src/lxc/lxc_driver.c (lxcSetupInterfaces): Remove always-true
	array-is-non-NULL test.  git grep 'mac\[.*\];'|grep -F .h
	src/conf/domain_conf.h:    unsigned char mac[VIR_MAC_BUFLEN];

	build: update gnulib submodule to latest

	gnulib added a new syntax-check test: use $(VAR), not @VAR@
	The latter is not officially "wrong", but *is* terribly anachronistic.
	I think automake documentation or comments call that syntax obsolescent.
	* cfg.mk (_makefile_at_at_check_exceptions): Exempt @SCHEMADIR@
	and @SYSCONFDIR@ uses -- there are no Makefile variables for those.
	* docs/Makefile.am: Use $(INSTALL), not @INSTALL@.
	* examples/dominfo/Makefile.am: Similar.
	* examples/domsuspend/Makefile.am: Similar.
	* proxy/Makefile.am: Similar.
	* python/Makefile.am: Similar.
	* python/tests/Makefile.am: Similar.
	* src/Makefile.am: Similar.
	* tests/Makefile.am: Similar.

	storage_backend.h: include required headers
	* src/storage/storage_backend.h: Include <stdint.h>.

	esx_vi_types.c: include required headers
	* src/esx/esx_vi_types.c: Include <stdint.h>.

	vbox: include required headers
	* src/vbox/vbox_driver.c: Include <stdint.h> <unistd.h> <sys/types.h>.

	cpu_x86_data.h: include required header
	* src/cpu/cpu_x86_data.h: Include <stdint.h>.

	util.c: include required header, no longer masked by gnulib
	Until recently, some gnulib-generated replacement headers
	included *other* headers that were not strictly necessary,
	thus masking the need in this file for an explicit <stdlib.h>.
	* src/util/util.c: Include <stdlib.h> for declarations of e.g.,
	strtol, random_r, getenv, etc.

2010-01-18  Jiri Denemark  <jdenemar@redhat.com>

	Use closest CPU model when decoding from CPUID
	Current implementation of x86Decode() used for CPUID -> model+features
	translation does not always select the closest CPU model. When walking
	through all models from cpu_map.xml the function considers a new
	candidate as a better choice than a previously selected candidate only
	if the new one is a superset of the old one. In case the new candidate
	is closer to host CPU but lacks some feature comparing to the old
	candidate, the function does not choose well.

	This patch changes the algorithm so that the closest model is always
	selected. That is, the model which requires the lowest number of
	additional features to describe host CPU.

2010-01-18  Diego Elio Pettenò  <flameeyes@gmail.com>

	Change detection of xen so that it's actually automatic rather than forced.
	This ensures that ./configure will work fine if xen development packages
	are not around, rather than fail. When passing ./configure --with-xen, the
	lack of xen development packages become fatal.

2010-01-18  Diego Elio Pettenò  <flameeyes@gmail.com>

	Standardise ./configure --help options reporting.
	Always use AC_HELP_STRING for the help text for options at ./configure,
	so that the output is properly aligned.

	Use proper quadrigraphs for outputting the brackets.

	Always use autoconf-style [default=$foo] output to state the default, both
	where it was stated before and where it wasn't.

	This time, include Matthias Bolte notes regarding defaults, and removing
	PFX specification from phyp.

2010-01-18  Matthias Bolte  <matthias.bolte@googlemail.com>

	qemu: Use log output for pty assignment if 'info chardev' is unavailable
	qemudFindCharDevicePTYsMonitor reports an error if 'info chardev' didn't
	provide information for a requested device, even if the log output parsing
	had found the pty path for that device. This makes pty assignment fail for
	older QEMU/KVM versions. For example KVM 72 on Debian doesn't support
	'info chardev', so qemuMonitorTextGetPtyPaths cannot parse any useful
	information and the hash for device-id-to-pty-path mapping stays empty.

	Make qemudFindCharDevicePTYsMonitor report an error only if the log output
	parsing and the 'info chardev' parsing failed to provide the pty path.

2010-01-18  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Add VNC support
	* src/conf/domain_conf.c: add defaults for the video device
	* src/esx/esx_vmx.[ch]: add VNC support to the VMX handling
	* tests/vmx2xmltest.c, tests/xml2vmxtest.c: add tests for the VNC support

	esx: Make the domain part of the hostname optional
	Before the driver assumed that there is always a domain part. That's
	not true. Now the domain part is handled as optional.

	esx: Add stubs for secondary driver types
	This stops libvirt from probing for a libvirtd on the ESX server and
	sets the base for the implementation of the secondary drivers.

2010-01-18  David Jorm  <dfj@dfj.bne.redhat.com>

	BZs 528709 548485

2010-01-16  Matthias Bolte  <matthias.bolte@googlemail.com>

	Fix validation of news.html

2010-01-16  Daniel P. Berrange  <berrange@redhat.com>

	Fix build of Xen proxy daemon
	* src/conf/domain_conf.c: Allow virDomainDeviceInfoIsSet,
	  virDomainDeviceInfoClear & virDomainDeviceInfoFormat when
	  building Xen proxy

	Remove obsolete comment in QEMU JSON code
	* src/qemu/qemu_monitor_json.c: We fill in the PCI function number
	   now, so remove obsolete XXX comment

2010-01-16  Daniel P. Berrange  <berrange@redhat.com>

	Specify bus/unit instead of index for disks with QEMU
	The current code for using -drive simply sets the -drive 'index'
	parameter. QEMU internally converts this to bus/unit depending
	on the type of drive. This does not give us precise control over
	the bus/unit assignment though. This change switches over to make
	libvirt explicitly calculate the bus/unit number.

	In addition bus/unit/index are actually irrelevant for VirtIO
	disks, since each virtio disk is a separate PCI device. No disk
	controller is involved.

	Doing the conversion to bus/unit in libvirt allows us to correctly
	attach SCSI controllers when required.

	* src/qemu/qemu_conf.c: Specify bus/unit instead of index for
	  disks
	* tests/qemuxml2argvdata/qemuxml2argv-disk*.args: Switch over from
	  using index=NNNN, to bus=NN, unit=NN for SCSI/IDE/Floppy disks

2010-01-16  Daniel P. Berrange  <berrange@redhat.com>

	Split code for building QEMU -drive arg in separate method
	To enable it to be called from multiple locations, split out
	the code for building the -drive arg string. This will be needed
	by later patches which do drive hotplug, the conversion to use
	-device, and the conversion to controller/bus/unit addressing

	* src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Add qemuBuildDriveStr
	  for building -drive arg string

2010-01-16  Daniel P. Berrange  <berrange@redhat.com>

	Convert monitor over to use virDomainDeviceAddress
	Convert the QEMU monitor APIs over to use virDomainDeviceAddress
	structs for passing addresses in/out, instead of individual bits.
	This makes the number of parameters smaller & easier to deal with.
	No functional change

	* src/qemu/qemu_driver.c, src/qemu/qemu_monitor.c,
	  src/qemu/qemu_monitor.h, src/qemu/qemu_monitor_text.c,
	  src/qemu/qemu_monitor_text.h: Change monitor hotplug APIs to
	  take an explicit address ptr for all host/guest addresses

2010-01-16  Jim Fehlig  <jfehlig@novell.com>

	Minor fixes for API extension doc
	Update the API Extensions doc to reflect new source directory layout.

2010-01-16  Wolfgang Mauerer  <wolfgang.mauerer@siemens.com>

	Add new domain device: "controller"
	This augments virDomainDevice with a <controller> element
	that is used to represent disk controllers (e.g., scsi
	controllers). The XML format is given by

	  <controller type="scsi" index="<num>">
	     <address type="pci" domain="0xNUM" bus="0xNUM" slot="0xNUM"/>
	  </controller>

	where type denotes the disk interface (scsi, ide,...), index
	is an integer that identifies the controller for association
	with disks, and the <address> element specifies the controller
	address on the PCI bus as described in previous commits
	The address element can be omitted; in this case, an address
	will be assigned automatically.

	Most of the code in this patch is from Wolfgang Mauerer's
	previous disk controller series

	 * docs/schemas/domain.rng: Define syntax for <controller>
	   XML element
	 * src/conf/domain_conf.c, src/conf/domain_conf.h: Define
	   virDomainControllerDef struct, and routines for parsing
	   and formatting XML
	* src/libvirt_private.syms: Add virDomainControllerInsert
	   and virDomainControllerDefFree

2010-01-16  Daniel P. Berrange  <berrange@redhat.com>

	Set default disk controller/bus/unit props
	When parsing the <disk> element specification, if no <address>
	is provided for the disk, then automatically assign one based on
	the <target dev='sdXX'/> device name. This provides for backwards
	compatability with existing applications using libvirt, while also
	allowing new apps to have complete fine grained control.

	* src/conf/domain_conf.h, src/conf/domain_conf.c,
	  src/libvirt_private.syms: Add virDomainDiskDefAssignAddress()
	  for assigning a controller/bus/unit address based on disk target
	* src/qemu/qemu_conf.c: Call virDomainDiskDefAssignAddress() after
	  generating XML from ARGV
	* tests/qemuxml2argvdata/*.xml: Add in drive address information
	  to all XML files

2010-01-16  Daniel P. Berrange  <berrange@redhat.com>

	Add address info to sound, video and watchdog devices
	Add the virDomainDeviceAddress information to the sound, video
	and watchdog devices. This means all of them gain the new XML
	element

	  <address .... />

	This brings them upto par with disk/net/hostdev devices which
	already have address info

	* src/conf/domain_conf.h: Add virDomainDeviceAddress to sound,
	  video & watchdog device struts.
	* src/conf/domain_conf.c: Hook up parsing/formatting for
	  virDomainDeviceAddress in sound, video & watchdog devices
	* docs/schemas/domain.rng: Associate device address info
	  with sound, video & watchdog

2010-01-16  Daniel P. Berrange  <berrange@redhat.com>

	Extend the virDomainDeviceAddress struture to allow disk controller addresses
	Introduce a new structure

	      struct _virDomainDeviceDriveAddress {
	        unsigned int controller;
	        unsigned int bus;
	        unsigned int unit;
	      };

	and plug that into virDomainDeviceAddress and generates XML that
	looks like

	  <address type='drive' controller='1' bus='0' unit='5'/>

	This syntax will be used by the QEMU driver to explicitly control
	how drives are attached to the bus

	* src/conf/domain_conf.h, src/conf/domain_conf.c: Parsing and
	  formatting of drive addresses
	* docs/schemas/domain.rng: Define new address format for drives

2010-01-16  Daniel P. Berrange  <berrange@redhat.com>

	Introduce a standardized data structure for device addresses
	All guest devices now use a common device address structure
	summarized by:

	  enum virDomainDeviceAddressType {
	    VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE,
	    VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI,
	  };

	  struct _virDomainDevicePCIAddress {
	    unsigned int domain;
	    unsigned int bus;
	    unsigned int slot;
	    unsigned int function;
	  };

	  struct _virDomainDeviceInfo {
	    int type;
	    union {
	        virDomainDevicePCIAddress pci;
	    } addr;
	  };

	This replaces the anonymous structs in Disk/Net/Hostdev data
	structures. Where available, the address is *always* printed
	in the XML file, instead of being hidden in the internal state
	file.

	  <address type='pci' domain='0x0000' bus='0x1e' slot='0x07' function='0x0'/>

	The structure definition is based on Wolfgang Mauerer's disk
	controller patch series.

	* docs/schemas/domain.rng: Define the <address> syntax and
	  associate it with disk/net/hostdev devices
	* src/conf/domain_conf.h, src/conf/domain_conf.c,
	  src/libvirt_private.syms: APIs for parsing/formatting address
	  information. Also remove the QEMU specific 'pci_addr' attributes
	* src/qemu/qemu_driver.c: Replace use of 'pci_addr' attrs with
	  new standardized format.

2010-01-16  Daniel P. Berrange  <berrange@redhat.com>

	Make test suite output less verbose
	Only print out '.' for each test case, full test output can be
	re-enabled with VIR_TEST_VERBOSE=1, or VIR_TEST_DEBUG=XXXX

	Sample output now looks like

	  TEST: statstest
	        ........................................ 40
	        ...................................      75  OK
	  PASS: statstest
	  TEST: qparamtest
	        ................................         32  OK
	  PASS: qparamtest
	  TEST:
	        ............                             12  OK

2010-01-15  Matthias Bolte  <matthias.bolte@googlemail.com>

	Fix compilation of virt-aa-helper.c
	Commit 5073aa994af460e775cb3e548528e28d7660fcc8 added an additional
	'}' to a case block that messed up the block structure of the get_files
	function.

2010-01-15  Jim Meyering  <meyering@redhat.com>

	xen: do not report a write-to-Xen-daemon failure as a read failure
	* src/xen/xend_internal.c (wr_sync): Correct the diagnostic.

2010-01-15  Matthias Bolte  <matthias.bolte@googlemail.com>

	Fix linkage of virt-aa-helper to libgnu.a

2010-01-14  Cole Robinson  <crobinso@redhat.com>

	util: Make sure virExec hook failures are raised
	With the introduction virDispatchError, hook function errors are
	never sent through the error callback, so users will never see
	these messages.

	Fix this by calling virDispatchError after hook failure.

2010-01-14  Cole Robinson  <crobinso@redhat.com>

	Implement path lookup for USB by vendor:product
	Based off how QEMU does it, look through /sys/bus/usb/devices/* for
	matching vendor:product info, and if found, use info from the surrounding
	files to build the device's /dev/bus/usb path.

	This fixes USB device assignment by vendor:product when running qemu
	as non-root (well, it should, but for some reason I couldn't reproduce
	the failure people are seeing in [1], but it appears to work properly)

	[1] https://bugzilla.redhat.com/show_bug.cgi?id=542450

2010-01-14  Cole Robinson  <crobinso@redhat.com>

	daemon: Don't blindly unregister domain events
	The daemon will attempt to unregister domain events on client disconnect,
	even if no events were ever registered. This raises an unneeded error.

	Track in the qemu_client structure if events have been registered, and
	check this when performing cleanup.

2010-01-14  Cole Robinson  <crobinso@redhat.com>

	daemon: Fix various error reporting issues
	Many node device calls weren't properly relaying error messages, and
	domain event registeration was not checking for error.

	events: Report errors on failure

2010-01-13  Cole Robinson  <crobinso@redhat.com>

	node_device: udev: Fix memory leak
	We are setting the same property two different ways without
	free'ing in between. Just drop the second assignment.

	node_device: udev: Enumerate floppy devices
	There are quite a few differences between how udev exposes legacy
	and USB floppy devs, but this patch takes care of both variants.

2010-01-13  Cole Robinson  <crobinso@redhat.com>

	node_device: udev: Use base 16 for product/vendor
	udev doesn't prefix USB product/vendor info with '0x', so the
	strtol conversions were wrong for the product field (vendor already
	set the correct base). Make the change for PCI product/vendor as
	well to be safe.

	This fixes USB device assignment via virt-manager.

2010-01-13  Cole Robinson  <crobinso@redhat.com>

	util: Remove logging handlers in virExec
	This allows debug statements and raised errors in hook functions to
	actually be logged somewhere (stderr). Users can enable debugging in the
	daemon and now see more info in /var/log/libvirt/...

2010-01-13  Jim Fehlig  <jfehlig@novell.com>

	Fix migration in xend driver
	Upstream xen has changed parameters to the migration operation
	several times over the past 18 months.  Changeset 17553 removed
	the resouce parameter,  Changesets 17709, 17753, and 20326 added
	ssl, node, and change_home_server parameters respectively.

	Fortunately, testing has revealed that xend will fail the
	operation if a parameter is missing but happily honor it if
	unknown parameters are provided.  Thus all currently supported
	parameters can be provided, satisfying current xend but not
	regressing older versions.

2010-01-13  Cole Robinson  <crobinso@redhat.com>

	Commit bootstrap .gitignore additions

2010-01-12  Cole Robinson  <crobinso@redhat.com>

	qemu: Disable errors in qemudShutdownVMDaemon

	libvirt.c: Preserve MigratePerform failure

	qemu: migrate: Save MigratePerform error in MigrateFinish.
	This way we won't squash the original error report in
	MigratePerform, as is done for P2P and Tunneled migration.

	virterror: Add virSetError
	Can be used to re-set an old error, which may have been squashed by
	other functions (like cleanup routines). Will be used in subsequent patches

2010-01-12  Daniel P. Berrange  <berrange@redhat.com>

	Ensure error handling callback functions are called from safe context
	The virRaiseErrorFull() may invoke the error handler callback
	functions an application has registered. This is not good
	because the connection object may not be available at this
	point, and the caller may be holding locks. This creates a
	problem if the error handler calls back into libvirt.

	The solutuon is to move invocation of the handler into the
	final cleanup code in the public API entry points, where it
	is guarenteed to have safe state.

	* src/libvirt.c: Invoke virDispatchError() in all error paths
	* src/util/virterror.c: Remove virSetConnError/virSetGlobalError,
	  replacing with virDispatchError(). Move invocation of the
	  error callbacks into virDispatchError() instead of the
	  virRaiseErrorFull function which is not in a safe context

2010-01-12  Daniel P. Berrange  <berrange@redhat.com>

	Revert 7aee22939f7f67a60e24472e5acc40b3b5b9d152
	Revert commit 7aee22939f7f67a60e24472e5acc40b3b5b9d152 since it
	is mistakenly adding an extra parameter to virsh that does not
	belong there.

2010-01-12  David Jorm  <dfj@dfj.bne.redhat.com>

	cpu_shares parameter limit documented

2010-01-12  Matthias Bolte  <matthias.bolte@googlemail.com>

	Document the domain XML cache attribute for disk devices

2010-01-12  Matthias Bolte  <matthias.bolte@googlemail.com>

	qemu: Fix a memory leak in qemudExtractTTYPath
	qemudWaitForMonitor calls qemudReadLogOutput with qemudFindCharDevicePTYs
	as callback. qemudFindCharDevicePTYs calls qemudExtractTTYPath to assign
	a string to chr->data.file.path. Afterwards qemudWaitForMonitor may call
	qemudFindCharDevicePTYsMonitor that overwrites chr->data.file.path without
	freeing the old value. This results in leaking the memory allocated by
	qemudExtractTTYPath.

	Report an OOM error if the strdup in qemudFindCharDevicePTYsMonitor fails.

2010-01-11  Guido Günther  <agx@sigxcpu.org>

	Also look for dmi information in /sys/class
	older kernels such as 2.6.26 have it there.

2010-01-11  Laine Stump  <laine@laine.org>

	Fix UUID random generator to use /dev/random
	Only use pseudo-random generator for uuid if using /dev/random fails.
	* src/util/uuid.c: The original code. would only print the warning
	  message if using /dev/random failed, but would still go ahead and call
	  virUUIDGeneratePseudoRandomBytes in all cases anyway.

2010-01-09  Jim Meyering  <meyering@redhat.com>

	avoid another "make distcheck" failure
	* docs/Makefile.am (uninstall-local): Separate $$f from preceding
	dir name with a "/" and use $$(basename $$f) rather than $$f, since
	some values of $$f are prefixed with devhelp/.

	avoid newly-introduced test failure
	* tests/qemuxml2argvdata/qemuxml2argv-hugepages.args: Update
	expected output to match, now that we use -mem-prealloc.

	proxy_internal.c: mark "request" parameter as nonnull
	* src/xen/proxy_internal.c (xenProxyCommand): Mark "request"
	as an always-non-NULL parameter.

	don't test "res == NULL" after we've already dereferenced "res"
	* src/xen/proxy_internal.c (xenProxyCommand): "res" is known to be
	non-NULL at that point, so remove the "res == NULL" guard.

	fix 7 "make check" test failures in non-srcdir build
	* tests/capabilityschematest: Define and use $srcdir.
	* tests/domainschematest: Likewise.
	* tests/interfaceschematest: Likewise.
	* tests/networkschematest: Likewise.
	* tests/nodedevschematest: Likewise.
	* tests/storagepoolschematest: Likewise.
	* tests/storagevolschematest: Likewise.

2010-01-09  Jim Meyering  <jim@meyering.net>

	let "configure --disable-shared" work once again
	Without this change, ./autogen.sh --disable-shared && make would
	evoke a "can not build a shared library" failure for libvirtmod.la
	due to the new use of libtool's -shared link option in
	python/Makefile.am.  Now, --disable-shared also
	disables building python.

	* configure.in: Make --disable-shared imply --without-python and
	silently override --with-python.
	Improved by: Diego Elio Pettenò <flameeyes@gmail.com>

2010-01-09  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Dump the raw response in case of an SOAP fault
	Currently only the faultcode and faultstring are deserialized, the
	detail part is ignored. The implementation of many new SOAP types
	would be necessary to deserialize the detail part correctly. As an
	intermediate solution the raw response is dumped to the debug log.

	esx: Warn if the ESX server is in maintenance mode

	Replace old CVS references with GIT

2010-01-08  Daniel Veillard  <veillard@redhat.com>

	Qemu: ask for memory preallocation with large pages
	The -mem-prealloc flag should be used when using large pages
	This ensures qemu tries to allocate all required memory immediately,
	rather than when first used. The latter mode will crash qemu
	if hugepages aren't available when accessed, while the former
	should gracefully fallback to non-hugepages.

	* src/qemu/qemu_conf.c: add -mem-prealloc flag to qemu command line
	  when using large pages

2010-01-08  Jim Fehlig  <jfehlig@novell.com>

	xen hypervisor: xen domctl version 6
	xen-unstable c/s 20685 changed the domctl interface, adding a field to
	xen_domctl_getdomaininfo structure.  This additional field causes stack
	corruption in libvirt.  xen-unstable c/s 20711 rightly bumped the domctl
	interface version so it is at least possible to handle the new field.
	This change accounts for shr_pages field added to xen_domctl_getdomaininfo
	structure.

2010-01-07  Jim Meyering  <meyering@redhat.com>

	network/bridge_driver.c: avoid potential NULL-dereference
	* src/network/bridge_driver.c (networkBuildDnsmasqArgv): Correct
	test for NULL *argv.

2010-01-07  Matthias Bolte  <matthias.bolte@googlemail.com>

	virsh: Use VIR_FREE instead of free
	virsh uses other parts of the internal API already, so use VIR_FREE also.

	virsh: Add persistent history using libreadline

2010-01-07  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Fix 'vpx' MAC address range and allow arbitrary MAC addresses
	The MAC addresses with 00:50:56 prefix are split into several ranges:

	  00:50:56:00:00:00 - 00:50:56:3f:ff:ff  'static' range (manually assigned)
	  00:50:56:80:00:00 - 00:50:56:bf:ff:ff  'vpx' range (assigned by a VI Client)

	Erroneously the 'vpx' range was assumed to be larger and to occupy the
	remaining addresses of the 00:50:56 prefix that are not part of the 'static'
	range.

	00:50:56 was used as prefix for generated MAC addresses, this is not possible
	anymore, because there are gaps in the allowed ranges. Therefore, change the
	prefix to 00:0c:29 which is the prefix for auto generated MAC addresses anyway.

	Allow arbitrary MAC addresses to be used and set the checkMACAddress VMX option
	to false in case the MAC address doesn't fall into any predefined range.

	* docs/drvesx.html.in: update website accordingly
	* src/esx/esx_driver.c: set the auto generation prefix to 00:0c:29
	* src/esx/esx_vmx.c: fix MAC address range handling and allow arbitrary MAC
	  addresses
	* tests/vmx2xml*, tests/xml2vmx*: add some basic MAC address range tests

2010-01-07  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Fix deserialization for VI API calls CancelTask and UnregisterVM

2010-01-07  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Fix and improve the libcurl debug callback
	The data passed to the callback is not guaranteed to be zero terminated,
	take care of that by coping the data and adding a zero terminator.

	Also dump the data for other types than CURLINFO_TEXT.

	Set CURLOPT_VERBOSE to 1 so the debug callback is called when enabled.

2010-01-07  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Don't warn about an empty URI path

	esx: Also allow virtualHW version 4 for ESX 4.0
	A domain with virtualHW version 4 is allowed on an ESX 4.0 server.
	If a domain is migrated from an ESX 3.5 server to an ESX 4.0 server
	then the virtualHW version stays the same. So a ESX 4.0 server can
	host domains with virtualHW version 4.

	Don't free an uninitalized pointer in update_driver_name()
	This invalid free results in heap corruption. Some symptoms I saw
	because of this were libvirtd crashing and virt-manager hanging
	while trying to enumerate devices.

2010-01-07  Jim Meyering  <meyering@redhat.com>

	xend_internal: don't let invalid input provoke NULL dereference
	* src/xen/xend_internal.c (xenDaemonOpen_unix): Do not dereference
	a NULL "conn".  Move first deref to follow the "conn == NULL" test.

2010-01-07  Adam Litke  <agl@us.ibm.com>

	qemu: Always enable the virtio balloon driver
	The behavior for the qemu balloon device has changed.  Formerly, a virtio
	balloon device was provided by default.  Now, '-balloon virtio' must be
	specified on the command line to enable it.  This patch causes libvirt to
	add '-balloon virtio' to the command line whenever the -balloon option is
	available.
	* src/qemu/qemu_conf.c src/qemu/qemu_conf.h: check for the new flag and
	  add "-baloon vitio" to qemu command when needed
	* tests/qemuhelptest.c: add the new flag for detection

2010-01-07  David Allan  <dallan@redhat.com>

	Don't update vol details after build
	This patch removes the call to vol update after the volume build completes.
	The update call is currently meaningless anyway because the vol build is passed
	a copy of the definition, so the update result is thrown away.  More
	importantly, if the user specified a selinux label for the volume, the update
	call results in a double free of the label
	* src/storage/storage_backend_fs.c: remove the update call

2010-01-07  Diego Elio Pettenò  <flameeyes@gmail.com>

	Disable building of static Python module
	* python/Makefile.am: python modules are loaded at runtime so the static
	  version is not needed, avoid building it

2010-01-07  Matthew Booth  <mbooth@redhat.com>

	Fix parsing of 'info chardev' line endings
	This change makes the 'info chardev' parser ignore any trailing
	whitespace on a line. This fixes a specific problem handling a '\r\n'
	line ending.

	* src/qemu/qemu_monitor_text.c: Ignore trailing whitespace in
	  'info chardev' output.

2010-01-06  Jim Meyering  <meyering@redhat.com>

	vbox_tmpl.c: don't leak a domain pointer upon failure to create
	* src/vbox/vbox_tmpl.c (vboxDomainCreateXML): "Unref" the domain
	upon failure.  Patch by Matthias Bolte.

	vbox_tmpl.c: avoid NULL deref upon vboxDomainCreateXML failure
	* src/vbox/vbox_tmpl.c (vboxDomainCreateXML): Don't call
	vboxDomainUndefine on a NULL "dom".

	qemu_driver.c: remove useless, warning-provoking test
	* src/qemu/qemu_driver.c (qemudDomainMigratePrepare2): Remove useless
	test of always-non-NULL uri_out parameter.  Use ATTRIBUTE_NONNULL to
	inform tools.

	qemu_driver.c: avoid NULL dereference upon disk-op failure
	* src/qemu/qemu_driver.c (qemudDomainAttachDevice): Call
	virCgroupDenyDevicePath only if cgroup is non-NULL.

2010-01-05  Jim Meyering  <meyering@redhat.com>

	openvz_conf.c: don't dereference NULL upon failure
	* src/openvz/openvz_conf.c (openvzLoadDomains): Avoid NULL deref
	of "dom".

2009-12-28  Matthias Bolte  <matthias.bolte@googlemail.com>

	Distribute vmx2xml and xml2vmx test data files

2009-12-24  Daniel Veillard  <veillard@redhat.com>

	Release of libvirt-0.7.5

2009-12-23  Daniel Veillard  <veillard@redhat.com>

	Update and regenerate localizations
	upate of as.po bn_IN.po de.po es.po gu.po hi.po kn.po ml.po mr.po or.po
	pa.po pl.po ru.po ta.po te.po zh_CN.po and regeneration

2009-12-23  Matthias Bolte  <matthias.bolte@googlemail.com>

	The secret driver is stateful, link it directly to libvirtd
	All other stateful drivers are linked directly to libvirtd
	instead of libvirt.so. Link the secret driver to libvirtd too.

	* daemon/Makefile.am: link the secret driver to libvirtd
	* daemon/libvirtd.c: add #ifdef WITH_SECRETS blocks
	* src/Makefile.am: don't link the secret driver to libvirt.so
	* src/libvirt_private.syms: remove the secretRegister symbol

2009-12-23  Matthias Bolte  <matthias.bolte@googlemail.com>

	Remove undefined symbols from libvirt_private.syms
	MinGW's ld gives an error when trying to export undefined symbols.

	boolean shadows a typedef in rpcndr.h when compiled with MinGW
	Alter the offending variable names to fix this.

2009-12-23  Jiri Denemark  <jdenemar@redhat.com>

	Rename DATADIR to PKGDATADIR to fix win32 build
	* src/Makefile.am src/cpu/cpu_map.c: rename in Makefile and in the
	  cpu map loading code

	Move cpu_map.xml to -client RPM
	All the cpu code is part of libvirt library and it might be used by
	drivers which do not require libvirtd to be running.

2009-12-23  Daniel Veillard  <veillard@redhat.com>

	convert missing server entry points into unsupported errors
	If using a remote access, sometimes an RPC entry point is not
	available, and currently we just end up with a raw:
	    error: unknown procedure: xxx
	error, while this should be more cleanly reported as an unsupported
	entry point like for local access

	* src/remote/remote_driver.c: convert missing remote entry points into
	  the unsupported feature error

2009-12-22  Olivier Fourdan  <ofourdan@redhat.com>

	fix some error report when on remote access
	When querying about a domain from 0.3.3 (or RHEL 5.3) domain located
	on a 0.6.3 (RHEL-5) machine, the errors are not properly reported.
	This patch from Olivier Fourdan <ofourdan@redhat.com> , slightly
	modified to not change the semantic when the domain os details cannot
	be provided

	* src/xen/proxy_internal.c src/xen/xen_hypervisor.c: add some missing
	  error reports

2009-12-22  Matthias Bolte  <matthias.bolte@googlemail.com>

	Fix undefined reference to 'close_used_without_including_unistd_h'
	Found while trying to cross-compile libvirt on Fedora 12 for Windows.
	gnulib redefines 'close' to 'close_used_without_including_unistd_h'
	in sys/socket.h if winsock2.h is present and unistd.h has not been
	included before sys/socket.h. Reorder some includes to fix this.

	Fix argument type of virProcessInfoSetAffinity dummy function

	Define ATTRIBUTE_SENTINEL for GCC < 4.0 too
	ATTRIBUTE_SENTINEL was defined for GCC >= 4.0 only, resulting in
	compile errors when using GCC < 4.0.

	Fix compilation  with configure --disable-nls

	cpu: Fix memory leaks in x86FeatureLoad and x86ModelLoad
	Also backup and restore the original ctxt->node value in x86FeatureLoad.

	Fix configure check for SASL
	The option --with-sasl defaults to 'check', but an inverted test logic
	lets the SASL check fail with an error instead of disabling SASL.
	Fix the test logic so SASL support gets disabled if SASL is missing and
	--with-sasl is set to check.

	Fix GnuTLS pkg-config check
	The testlogic for $PKG_CONFIG was inverted, checking for an empty string
	before using PKG_CHECK_MODULES. Use -x instead of -z and add an else branch
	to the if checking for $GNUTLS_FOUND = no to add -lgcrypt in case the
	GnuTLS libraries are detected by pkg-config.

	Report an error if no XDR library can be found

2009-12-22  Daniel P. Berrange  <berrange@redhat.com>

	Disable JSON mode monitor until QEMU is more mature
	* src/qemu/qemu_conf.h: Remove QEMU_CMD_FLAG_0_12 and just leave
	  the lone JSON flag
	* src/qemu/qemu_conf.c: Enable JSON on QEMU 0.13 or later, but
	  leave it disabled for now

2009-12-22  Jiri Denemark  <jdenemar@redhat.com>

	Only probe for CPU models if required
	* src/qemu/qemu_conf.c: CPU models should be probed only if the
	  a guest's XML contains CPU model, not each time a qemu command line
	  is generated.

2009-12-22  Daniel Veillard  <veillard@redhat.com>

	Add some people missing from the AUTHORS list

2009-12-22  Jiri Denemark  <jdenemar@redhat.com>

	Add cpu_map.xml to libvirt.spec
	* libvirt.spec.in: embbed it in the main libvirt binary rpm

	Install cpu_map.xml
	* src/Makefile.am: install it in $(pkgdatadir) i.e. /usr/share/libvirt/
	  usually

2009-12-22  Chris Lalancette  <clalance@redhat.com>

	Make Xen VT-d PCI attach/detach work
	The Xen code for making HVM VT-d PCI passthrough attach and detach
	wasn't working properly:

	1)  In xenDaemonAttachDevice(), we were always trying to reconfigure
	a PCI passthrough device, even the first time we added it.  This was
	because the code in virDomainXMLDevID() was not checking xenstore for
	the existence of the device, and always returning 0 (meaning that
	the device already existed).

	2)  In xenDaemonDetachDevice(), we were trying to use "device_destroy"
	to detach a PCI device.  While you would think that is the right
	method to call, it's actually wrong for PCI devices.  In particular,
	in upstream Xen (and soon in RHEL-5 Xen), device_configure is actually
	used to destroy a PCI device.

	To fix the attach
	problem I add a lookup into xenstore to see if the device we are
	trying to attach already exists.  To fix the detach problem I change
	it so that for PCI detach (only), we use device_configure with the
	appropriate sxpr to do the detachment.

	* src/xen/xend_internal.c: don't use device_destroy for PCI devices
	  and fix the other issues.
	* src/xen/xs_internal.c src/xen/xs_internal.h: add
	  xenStoreDomainGetPCIID()

2009-12-22  Daniel P. Berrange  <berrange@redhat.com>

	Fix detection of JSON when restarting libvirtd
	The XML XPath for detecting JSON in the running VM statefile was
	wrong causing all VMs to get JSON mode enabled at libvirtd restart.

	In addition if a VM was running a JSON enabled QEMU once, and then
	altered to point to a non-JSON enabled QEMU later the 'monJSON'
	flag would not get reset to 0.

	* src/qemu/qemu_driver.c: Fix setting/detection of JSON mode

2009-12-21  Adam Litke  <agl@us.ibm.com>

	Document the dommemstat command in the virsh man page
	* tools/virsh.pod: Provide a basic mention of the dommemstat command in
	  the virsh man page.

2009-12-21  Daniel Veillard  <veillard@redhat.com>

	Change virsh dommemstats command to dommemstat
	As Paul Jenner pointed out all other statistics commands use the
	singular form

	* tools/virsh.c: rename dommemstats to dommemstat as well as function
	  name and associated structures

2009-12-21  Daniel P. Berrange  <berrange@redhat.com>

	Fix reporting of TLS connection errors
	The code for connecting to a server tries each socket in turn
	until it finds one that connects. Unfortunately for TLS sockets
	if it connected, but failed TLS handshake it would treat that
	as a failure to connect, and try the next socket. This is bad,
	it should have reported the TLS failure immediately.

	$ virsh -c qemu://somehost.com/system
	error: unable to connect to libvirtd at 'somehost.com': Invalid argument
	error: failed to connect to the hypervisor

	$ ./tools/virsh -c qemu://somehost.com/system
	error: server certificate failed validation: The certificate hasn't got a known issuer.
	error: failed to connect to the hypervisor

	 * src/remote/remote_driver.c: Stop trying to connect if the
	   TLS handshake fails

2009-12-21  Daniel Veillard  <veillard@redhat.com>

	Fix typo in qemudDomainAttachHostPciDevice()
	* src/qemu/qemu_driver.c: The 'if' statement is supposed to check return
	  value of pci = pciGetDevice(conn, ...); , but check uses if (!dev),
	  fix it

2009-12-20  Adam Litke  <agl@us.ibm.com>

	python: Add python bindings for virDomainMemoryStats
	Enable virDomainMemoryStats in the python API.  dom.memoryStats() will return a
	dictionary containing the supported statistics.  A dictionary is required
	because the meaining of each quantity cannot be inferred from its index in a
	list.

	* python/generator.py: reenable bindings for this entry point
	* python/libvirt-override-api.xml python/libvirt-override.c: the
	  generator can't handle this new function, add the new binding,
	  and the XML description

2009-12-20  Adam Litke  <agl@us.ibm.com>

	Add a new command dommemstats for virDomainMemoryStats
	Define a new command 'dommemstats' to report domain memory statistics.  The
	output format is inspired by 'domblkstat' and 'domifstat' and consists of
	tag/value pairs, one per line.  The command can complete successfully and
	print no output if virDomainMemoryStats is supported by the driver, but not
	the guest operating system.

	Sample output:
	swap_in 0
	swap_out 0
	major_fault 54
	minor_fault 58259
	unused 487680
	available 502472

	All stats referring to a quantity of memory (eg. all above except major and
	minor faults) represent the quantity in KBytes.

	* tools/virsh.c: implements the new command

2009-12-20  Adam Litke  <agl@us.ibm.com>

	Add domainMemoryStats support to remote driver
	Use a dynamically sized xdr_array to pass memory stats on the wire.  This
	supports the addition of future memory stats and reduces the message size
	since only supported statistics are returned.

	* src/remote/remote_protocol.x: provide defines for the new entry point
	* src/remote/remote_driver.c daemon/remote.c: implement the client and
	  server side
	* daemon/remote_dispatch_args.h daemon/remote_dispatch_prototypes.h
	  daemon/remote_dispatch_ret.h daemon/remote_dispatch_table.h
	  src/remote/remote_protocol.c src/remote/remote_protocol.h: generated
	  stubs

2009-12-20  Adam Litke  <agl@us.ibm.com>

	Implements domainMemStats in the qemu driver
	Support for memory statistics reporting is accepted for qemu inclusion.
	Statistics are reported via the monitor command 'info balloon' as a comma
	seprated list:

	(qemu) info balloon
	balloon: actual=1024,mem_swapped_in=0,mem_swapped_out=0,major_page_faults=88,minor_page_faults=105535,free_mem=1017065472,total_mem=1045229568

	Libvirt, qemu, and the guest operating system may support a subset of the
	statistics defined by the virtio spec.  Thus, only statistics recognized by
	components will be reported.

	* src/qemu/qemu_driver.c src/qemu/qemu_monitor_text.[ch]: implement the
	  new entry point by using info balloon monitor command

2009-12-20  Adam Litke  <agl@us.ibm.com>

	domMemoryStats: Add public symbol to libvirt API
	* src/libvirt.c: implement the main entry point
	* src/libvirt_public.syms: add it to the exported symbols

2009-12-20  Adam Litke  <agl@us.ibm.com>

	Add new API virDomainMemoryStats to header and drivers
	Set up the types for the domainMemoryStats function and insert it into the
	virDriver structure definition.  Because of static initializers, update
	every driver and set the new field to NULL.

	* include/libvirt/libvirt.h.in: new API
	* src/driver.h src/*/*_driver.c src/vbox/vbox_tmpl.c: add the new
	  entry to the driver structure
	* python/generator.py: fix compiler errors, the actual python binding is
	  implemented later

2009-12-19  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Add more links to external documentation

	esx: Destroy virtual machine on a vCenter if available
	If a virtual machine is destroyed on a ESX server then immediately
	undefining this virtual machine on a vCenter may fail, because the
	vCenter has not been informed about the status change yet. Therefore,
	destroy a virtual machine on a vCenter if available, so the vCenter
	is up-to-date when the virtual machine should be undefined.

	esx: Undefine virtual machine on a vCenter if available
	Undefining a virtual machine on an ESX server leaves a orphan on the
	vCenter behind. So undefine a virtual machine on a vCenter if available
	to fix this problem.

	esx: Don't warn about '/' paths

	esx: Use occurrence enum to specify expected result of a SOAP call
	Also move XPath expression composition into esxVI_Context_Execute().

	esx: Fix occurence typo

	esx: Extend documentation about 'vcenter' and add some about 'auto_answer'

	esx: Extend vCenter query parameter
	If an ESX host is managed by a vCenter, it knows the IP address of the
	vCenter. Setting the vCenter query parameter to * allows to connect to the
	vCenter known to an ESX host without the need to specify its IP address
	or hostname explicitly.

	esx: Removed unused inttypes.h include

	esx: Replace libxml1 'xmlChildrenNode' with libxml2 'children'

	esx: Use more suitable error code in esxVI_LookupVirtualMachineByUuid()

2009-12-19  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Improve domain lookup by UUID
	esxDomainLookupByUUID() and esxDomainIsActive() lookup a domain by asking
	ESX for all known domains and searching manually for the one with the
	matching UUID. This is inefficient. The VI API allows to lookup by UUID
	directly: FindByUuid().

	* src/esx/esx_driver.c: change esxDomainLookupByUUID() and esxDomainIsActive()
	  to use esxVI_LookupVirtualMachineByUuid(), also reorder some functions to
	  keep them in sync with the driver struct

2009-12-19  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Add automatic question handling
	Questions can block tasks, to handle them automatically the driver can answers
	them with the default answer. The auto_answer query parameter allows to enable
	this automatic question handling.

	* src/esx/README: add a detailed explanation for automatic question handling
	* src/esx/esx_driver.c: add automatic question handling for all task related
	  driver functions
	* src/esx/esx_util.[ch]: add handling for the auto_answer query parameter
	* src/esx/esx_vi.[ch], src/esx/esx_vi_methods.[ch], src/esx/esx_vi_types.[ch]:
	  add new VI API methods and types and additional helper functions for
	  automatic question handling

2009-12-19  Matthias Bolte  <matthias.bolte@googlemail.com>

	Fix compilation with gcrypt < 1.4.2
	Commit 33a198c1f6a4a1bc7f34d50a31032e03bec10fee increased the gcrypt
	version requirement to 1.4.2 because the GCRY_THREAD_OPTION_VERSION
	define was added in this version.

	The configure script doesn't check for the gcrypt version. To support
	gcrypt versions < 1.4.2 change the virTLSThreadImpl initialization
	to use GCRY_THREAD_OPTION_VERSION only if it's defined.

2009-12-19  Diego Elio Pettenò  <flameeyes@gmail.com>

	Don't mix LDFLAGS and LIBS in the configure script
	* configure.in: If you pass libraries in the LDFLAGS variable, and then
	  try AC_CHECK_FUNCS to find whether a function is present or not,
	  it'll fail badly when using the --as-needed linker flag. Instead,
	  pass the libraries through the LIBS library, so that they are passed
	  after the conftest.c source file and the tests are done properly.

	Don't make it possible to define HAVE_HAL but not enable it in automake
	* configure.in: With the previous logic, if libhal_get_all_devices
	  function was not found, HAVE_HAL would be defined for the preprocessor
	  but it wouldn't be enabled in automake conditionals, causing the final
	  link to fail with missing references to HAL entries.

2009-12-18  Jiri Denemark  <jdenemar@redhat.com>

	Implement virsh command 'cpu-compare'
	* tools/virsh.c: provide a way to us teh new API with virsh

	Implement CPU selection in QEMU driver
	* src/qemu/qemu_conf.c src/qemu/qemu_conf.h src/qemu/qemu_driver.c:
	  add the new entry point, extend capabilities and code to interract
	  with qemu

	Adds CPU map for models and features
	* src/cpu/cpu_map.xml: newdescription file
	* src/Makefile.am: include it in dist

2009-12-18  Jiri Denemark  <jdenemar@redhat.com>

	Adds CPU selection infrastructure
	Each driver supporting CPU selection must fill in host CPU capabilities.
	When filling them, drivers for hypervisors running on the same node as
	libvirtd can use cpuNodeData() to obtain raw CPU data. Other drivers,
	such as VMware, need to implement their own way of getting such data.
	Raw data can be decoded into virCPUDefPtr using cpuDecode() function.

	When implementing virConnectCompareCPU(), a hypervisor driver can just
	call cpuCompareXML() function with host CPU capabilities.

	For each guest for which a driver supports selecting CPU models, it must
	set the appropriate feature in guest's capabilities:

	    virCapabilitiesAddGuestFeature(guest, "cpuselection", 1, 0)

	Actions needed when a domain is being created depend on whether the
	hypervisor understands raw CPU data (currently CPUID for i686, x86_64
	architectures) or symbolic names has to be used.

	Typical use by hypervisors which prefer CPUID (such as VMware and Xen):

	- convert guest CPU configuration from domain's XML into a set of raw
	  data structures each representing one of the feature policies:

	    cpuEncode(conn, architecture, guest_cpu_config,
	              &forced_data, &required_data, &optional_data,
	              &disabled_data, &forbidden_data)

	- create a mask or whatever the hypervisor expects to see and pass it
	  to the hypervisor

	Typical use by hypervisors with symbolic model names (such as QEMU):

	- get raw CPU data for a computed guest CPU:

	    cpuGuestData(conn, host_cpu, guest_cpu_config, &data)

	- decode raw data into virCPUDefPtr with a possible restriction on
	  allowed model names:

	    cpuDecode(conn, guest, data, n_allowed_models, allowed_models)

	- pass guest->model and guest->features to the hypervisor

	* src/cpu/cpu.c src/cpu/cpu.h src/cpu/cpu_generic.c
	  src/cpu/cpu_generic.h src/cpu/cpu_map.c src/cpu/cpu_map.h
	  src/cpu/cpu_x86.c src/cpu/cpu_x86.h src/cpu/cpu_x86_data.h
	* configure.in: check for CPUID instruction
	* src/Makefile.am: glue the new files in
	* src/libvirt_private.syms: add new private symbols
	* po/POTFILES.in: add new cpu files containing translatable strings

2009-12-18  Jiri Denemark  <jdenemar@redhat.com>

	Remote driver CPU flags support
	* src/remote/remote_driver.c: add the new entry point

	CPU flags wire protocol format and server side
	* src/remote/remote_protocol.x: update with new entry point
	* daemon/remote.c: add the new server dispatcher
	* daemon/remote_dispatch_args.h daemon/remote_dispatch_prototypes.h
	  daemon/remote_dispatch_ret.h daemon/remote_dispatch_table.h
	  src/remote/remote_protocol.c src/remote/remote_protocol.h: regenerated

	Public API implementation
	* src/libvirt.c: adds the public entry point virConnectCompareCPU()

	Adds the internal driver API
	* src/driver.h: add an extra entry point in the structure
	* src/esx/esx_driver.c src/lxc/lxc_driver.c src/opennebula/one_driver.c
	  src/openvz/openvz_driver.c src/phyp/phyp_driver.c src/qemu/qemu_driver.c
	  src/remote/remote_driver.c src/test/test_driver.c src/uml/uml_driver.c
	  src/vbox/vbox_tmpl.c src/xen/xen_driver.c: add NULL entry points for
	  all drivers

	New public API definition virConnectCompareCPU()
	* include/libvirt/libvirt.h.in: add it in the public API as
	  well as the new flags
	* src/libvirt_public.syms: export it

2009-12-18  Daniel Veillard  <veillard@redhat.com>

	Fixes syntax-check with previous commit
	* po/POTFILES.in: adds src/conf/cpu_conf.c in teh set of files with
	  translatable content
	* src/conf/cpu_conf.c: remove an unused include

2009-12-18  Jiri Denemark  <jdenemar@redhat.com>

	XML parsing/formating code for CPU flags
	* include/libvirt/virterror.h src/util/virterror.c: add new domain
	  VIR_FROM_CPU for errors
	* src/conf/cpu_conf.c src/conf/cpu_conf.h: new parsing module
	* src/Makefile.am proxy/Makefile.am: include new files
	* src/conf/capabilities.[ch] src/conf/domain_conf.[ch]: reference
	  new code
	* src/libvirt_private.syms: private export of new entry points

2009-12-18  Jiri Denemark  <jdenemar@redhat.com>

	XML schema for CPU flags
	XML schema for CPU flags

	Firstly, CPU topology and model with optional features have to be
	advertised in host capabilities:

	    <host>
	        <cpu>
	            <arch>ARCHITECTURE</arch>
	            <features>
	                <!-- old-style features are here -->
	            </features>
	            <model>NAME</model>
	            <topology sockets="S" cores="C" threads="T"/>
	            <feature name="NAME"/>
	        </cpu>
	        ...
	    </host>

	Secondly, drivers which support detailed CPU specification have to
	advertise
	it in guest capabilities:

	    <guest>
	    ...
	    <features>
	            <cpuselection/>
	        </features>
	    </guest>

	And finally, CPU may be configured in domain XML configuration:

	<domain>
	    ...
	    <cpu match="MATCH">
	        <model>NAME</model>
	        <topology sockets="S" cores="C" threads="T"/>
	        <feature policy="POLICY" name="NAME"/>
	    </cpu>
	</domain>

	Where MATCH can be one of:
	    - 'minimum'     specified CPU is the minimum requested CPU
	    - 'exact'       disable all additional features provided by host CPU
	    - 'strict'      fail if host CPU doesn't exactly match

	POLICY can be one of:
	    - 'force'       turn on the feature, even if host doesn't have it
	    - 'require'     fail if host doesn't have the feature
	    - 'optional'    match host
	    - 'disable'     turn off the feature, even if host has it
	    - 'forbid'      fail if host has the feature

	'force' and 'disable' policies turn on/off the feature regardless of its
	availability on host. 'force' is unlikely to be used but its there for
	completeness since Xen and VMWare allow it.

	'require' and 'forbid' policies prevent a guest from being started on a host
	which doesn't/does have the feature. 'forbid' is for cases where you disable
	the feature but a guest may still try to access it anyway and you don't want
	it to succeed.

	'optional' policy sets the feature according to its availability on host.
	When a guest is booted on a host that has the feature and then migrated to
	another host, the policy changes to 'require' as we can't take the feature
	away from a running guest.

	Default policy for features provided by host CPU but not specified in domain
	configuration is set using match attribute of cpu tag. If 'minimum' match is
	requested, additional features will be treated as if they were specified
	with 'optional' policy. 'exact' match implies 'disable' policy and 'strict'
	match stands for 'forbid' policy.

	* docs/schemas/capability.rng docs/schemas/domain.rng: extend the
	  RelaxNG schemas to add CPU flags support

2009-12-18  Daniel P. Berrange  <berrange@redhat.com>

	Initialize gcrypt threading
	GNUTLS uses gcrypt for its crypto functions. gcrypt requires
	that the app/library initializes threading before using it.
	We don't want to force apps using libvirt to know about
	gcrypt, so we make virInitialize init threading on their
	behalf. This location also ensures libvirtd has initialized
	it correctly. This initialization is required even if libvirt
	itself were only using one thread, since another non-libvirt
	library (eg GTK-VNC) could also be using gcrypt from another
	thread

	* src/libvirt.c: Register thread functions for gcrypt
	* configure.in: Add -lgcrypt to linker flags

2009-12-18  Daniel P. Berrange  <berrange@redhat.com>

	Fix bug in storage driver accessing wrong private data
	* src/storage/storage_driver.c: Fix IsPersistent() and IsActivE()
	  methods on storage pools to use 'storagePrivateData' instead
	  of 'privateData'. Also fix naming convention of objects

2009-12-16  Jim Meyering  <meyering@redhat.com>

	esx_vi.c: do not call through NULL function pointer
	* src/esx/esx_vi.c (esxVI_List_CastFromAnyType): For invalid
	inputs, fail right away.  Do not "goto failure" where a NULL
	input pointer would be dereferenced.

	esx_util.c: avoid NULL deref for invalid inputs
	* src/esx/esx_util.c (esxUtil_ParseDatastoreRelatedPath): Return
	right away for invalid inputs, rather than using them (which would
	dereference NULL pointers) in clean-up code.

2009-12-16  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Don't goto failure for invalid arguments in VMX code
	This also fixes a NULL-deref of virtualDev in esxVMX_ParseSCSIController
	found by Jim Meyering.

	Fix memory leak in qemudBuildCommandLine

2009-12-16  Jim Meyering  <meyering@redhat.com>

	avoid calling exit with a constant; use EXIT_* instead
	This appeases a new gnulib-provided "syntax-check".
	* daemon/libvirtd.c (main): Use EXIT_FAILURE, not 1.
	* proxy/libvirt_proxy.c (main): Likewise, and EXIT_SUCCESS, not 0.
	* tests/conftest.c (main): Likewise.
	* tests/reconnect.c (main): Likewise.
	* tests/testutils.h (EXIT_AM_SKIP): Define.
	* tests/nodeinfotest.c (mymain): Use EXIT_AM_SKIP, not 77.
	* tests/qemuargv2xmltest.c: Likewise.
	* tests/qemuxml2xmltest.c: Likewise.
	* tests/virshtest.c (mymain): Likewise.

	maint: remove from VC two gnulib-provided files
	* build-aux/link-warning.h: Remove file from version control.
	* build-aux/mktempd: Likewise.
	* build-aux/.gitignore: Adjust.

	avoid malfunction when virFileResolveLink is applied to non-POSIX FS
	The virFileResolveLink utility function relied on the POSIX guarantee
	that stat.st_size of a symlink is the length of the value.  However,
	on some types of file systems, it is invalid, so do not rely on it.
	Use gnulib's areadlink module instead.
	* bootstrap (modules): Add areadlink.
	* src/util/util.c: Include "areadlink.h".
	Let areadlink perform the readlink and malloc.
	* configure.in (AC_CHECK_FUNCS): Remove readlink.  No need,
	since it's presence is guaranteed by gnulib.

	build: update gnulib submodule to latest

	xm_internal.c: remove misleading dead code
	* src/xen/xm_internal.c (xenXMConfigGetULong): Remove useless and
	misleading test (always false) for val->str == NULL before code that
	always dereferences val->str.  "val" comes from virConfGetValue, and
	at that point, val->str is guaranteed to be non-NULL.
	(xenXMConfigGetBool): Likewise.
	* src/util/conf.c (virConfSetValue): Ensure that vir->str is never NULL,
	not even if someone tries to set such a value via virConfSetValue.

	libvirt.c: don't let a NULL "cpumaps" argument provoke a NULL-deref
	* src/libvirt.c (virDomainGetVcpus): Describe new, stronger
	requirement on "maplen"s relationship to "cpumaps".

2009-12-15  Jim Meyering  <meyering@redhat.com>

	qemu migration: avoid NULL-deref given an invalid input
	* src/qemu/qemu_driver.c (doNonTunnelMigrate): Don't let a
	NULL "uri_out" provoke a NULL-dereference in doNativeMigrate:
	supply omitted goto-after-qemudReportError.

	qemu_driver.c: don't unlink(NULL) on OOM error path
	* src/qemu/qemu_driver.c (qemudDomainMigratePrepareTunnel): Upon an
	out of memory error, we would end up with unixfile==NULL and attempt
	to unlink(NULL).  Skip the unlink when it's NULL.

	remote_driver.c: also zero out ->saslDecodedOffset member
	* src/remote/remote_driver.c (remoteIOReadMessage): ...rather than
	zeroing out priv->saslDecodedLength twice.

	qemu_driver.c: avoid double free on error path
	* src/qemu/qemu_driver.c (qemudDomainMigrateFinish2): Set
	"event" to NULL after qemuDomainEventQueue frees it, so a
	subsequent free (after endjob label) upon qemuMonitorStartCPUs
	failure does not cause a double free.

	libvirtd: avoid a NULL dereference on error path
	* daemon/libvirtd.c (qemudDispatchServer): Since "client" may be
	NULL in the "cleanup:" block, free client->rx only when it's not.

2009-12-15  Matthias Bolte  <matthias.bolte@googlemail.com>

	Fix and improve domain xml video element description
	The description mismatched the actual structure since the video element
	was introduced. The nvram attribute is actually called vram. Specify the
	unit of the vram attribute.

2009-12-15  Matthias Bolte  <matthias.bolte@googlemail.com>

	Fix install location for Python bindings
	Commit 66137344feb488ea87b0d92f3c03844d9a7a7786 changed the Python detection
	mechanism in configure to use AM_PATH_PYTHON. This results in a changed
	install location for the Python bindings, at least on Fedora 12 64bit systems.

	Before this commit libvirt.py and libvirtmod.so were installed to

	  /usr/lib64/python2.6/site-packages

	After this commit they are installed to

	  /usr/lib/python2.6/site-packages

	Mixed Python packages (containing *.py and *.so files) should be installed to
	the pyexecdir directory detected by AM_PATH_PYTHON.

	This restores the install location from before the AM_PATH_PYTHON commit.

	* configure.in: remove unnecessary pythondir export
	* python/Makefile.am: switch from pythondir to pyexecdir

2009-12-14  Daniel Veillard  <veillard@redhat.com>

	Relax the allowed values for machine type in schema
	* docs/schemas/domain.rng: don't try to validate based on a list, open
	  up the machine type to a regexp allowing a-z A-Z 0-9 _ - and .

2009-12-14  Jim Meyering  <meyering@redhat.com>

	virsh: avoid double-free
	* tools/virsh.c (vshCommandParse): Avoid double-free of "tkdata".
	Set it to NULL immediately after free in the (cmd == NULL) case,
	just as in the other case, in case the final free(tkdata) is
	triggered by a syntax error.

	node_device_driver.c: don't write beyond EOB for 4K-byte symlink
	* src/node_device/node_device_driver.c (update_driver_name): The
	previous code would write one byte beyond the end of the 4KiB
	stack buffer when presented with a symlink value of exactly that
	length (very unlikely).  Remove the automatic buffer and use
	virFileResolveLink in place of readlink.  Suggested by Daniel Veillard.

2009-12-14  Matthew Booth  <mbooth@redhat.com>

	Fix owner and group in example volume XML
	The owner and group in the documentation examples were confusingly given as
	'0744'. They should be numeric uid and gid. Changed the examples to use the
	default uid and gid assigned to qemu in F12.

	* docs/formatstorage.html.in: Change example owner and group in volume XML

2009-12-14  Daniel Veillard  <veillard@redhat.com>

	add missing doc for device <shareable/> option

2009-12-14  Laine Stump  <laine@laine.org>

	Eliminate failure to delete empty storage pools
	* src/storage/storage_backend_fs.c: virStorageBackendFileSystemDelete
	  was incorrectly calling unlink() in an attempt to remove a directory.
	  It should be calling rmdir() instead.

2009-12-14  Jiri Denemark  <jdenemar@redhat.com>

	Fix use of virEventAddHandleImpl()
	src/node_device/node_device_udev.c was using a function available only
	on the daemon code, fix this and use the function available globally

	* src/node_device/node_device_udev.c: replace use of virEventAddHandleImpl
	  by virEventAddHandle

2009-12-14  Matthew Booth  <mbooth@redhat.com>

	Cleanup temporary #define after use
	* src/qemu/qemu_driver.c: #undef LOOKUP_PTYS after use in
	  qemudFindCharDevicePTYsMonitor()

2009-12-14  Dave Allan  <dallan@redhat.com>

	Implement --pool option for virsh vol-path
	This patch fixes the problem reported in:

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

	The bug reporter says that vol-delete does not support the --pool
	option, but that's not the case in the current head.  This patch makes
	vol-path behave the same way as vol-delete

	* tools/virsh.c: Modified vol-path to use the same logic as vol-delete,
	  allowing the syntax: virsh vol-path --pool testdirpool testvol0

2009-12-14  Cole Robinson  <crobinso@redhat.com>

	nodedev: Add removable storage 'media_label' prop
	Provides the CDROM label for current media. Only implemented for the
	udev backend.

2009-12-14  Dave Allan  <dallan@redhat.com>

	expose SR IOV physical/virtual function relationships
	exposes the relationships between physical
	and virtual functions on SR IOV capable devices.

2009-12-14  Paolo Bonzini  <pbonzini@redhat.com>

	Fix possible NULL pointer dereference
	If there are no references remaining to the object, vm is set to NULL
	and vm->persistent cannot be accessed.  Fixed by this trivial patch.

	* src/qemu/qemu_driver.c (qemudDomainCoreDump): Avoid possible
	  NULL pointer dereference on --crash dump.

2009-12-14  Jamie Strandboge  <jamie@canonical.com>

	add AppArmor test and examples to dist
	tests/virt-aa-helper-test and examples/apparmor are not included in
	official tarballs, but should be. Attached is a patch to fix that
	which works when apparmor is and is not available.

2009-12-14  Paolo Bonzini  <pbonzini@redhat.com>

	add --live support to "virsh dump"
	This is trivial for QEMU since you just have to not stop the vm before
	starting the dump.  And for Xen, you just pass the flag down to xend.

	* include/libvirt/libvirt.h.in (virDomainCoreDumpFlags): Add VIR_DUMP_LIVE.
	* src/qemu/qemu_driver.c (qemudDomainCoreDump): Support live dumping.
	* src/xen/xend_internal.c (xenDaemonDomainCoreDump): Support live dumping.
	* tools/virsh.c (opts_dump): Add --live. (cmdDump): Map it to VIR_DUMP_LIVE.

2009-12-14  Paolo Bonzini  <pbonzini@redhat.com>

	add --crash support to "virsh dump"
	This patch adds the --crash option (already present in "xm dump-core")
	to "virsh dump".  virDomainCoreDump already has a flags argument, so
	the API/ABI is untouched.

	* include/libvirt/libvirt.h.in (virDomainCoreDumpFlags): New flag for
	  CoreDump
	* src/test/test_driver.c (testDomainCoreDump): Do not crash
	  after dump unless VIR_DUMP_CRASH is given.
	* src/qemu/qemu_driver.c (qemudDomainCoreDump): Shutdown the domain
	  instead of restarting it if --crash is passed.
	* src/xen/xend_internal.c (xenDaemonDomainCoreDump): Support --crash.
	* tools/virsh.c (opts_dump): Add --crash.
	  (cmdDump): Map it to flags for virDomainCoreDump and pass them.

2009-12-14  Paolo Bonzini  <pbonzini@redhat.com>

	fix various breakages in qemu Dump command
	1) qemuMigrateToCommand uses ">>" so we have to truncate the file
	before starting the migration;

	2) the command wasn't updated to chown the driver and set/restore
	the security lavels;

	3) the VM does not have to be resumed if migration fails;

	4) the file is not removed when migration fails.

	* src/qemu/qemu_driver.c (qemuDomainCoreDump): Truncate file before
	  dumping, set/restore ownership and security labels for the file.

2009-12-14  Daniel Veillard  <veillard@redhat.com>

	Fix a couple of problems in last patch
	Those were pointed by DanB in his review but not yet fixed

	* src/qemu/qemu_driver.c: qemudWaitForMonitor() use EnterMonitorWithDriver()
	  and ExitMonitorWithDriver() there
	* src/qemu/qemu_monitor_text.c: checking fro strdu failure and hash
	  table add error in qemuMonitorTextGetPtyPaths()

2009-12-14  Matthew Booth  <mbooth@redhat.com>

	Get QEMU pty paths from the monitor
	This change makes the QEMU driver get pty paths from the output of the
	monitor 'info chardev' command. This output is structured, and contains
	both the name of the device and the path on the same line. This is
	considerably more reliable than parsing the startup log output, which
	requires the parsing code to know which order QEMU will print pty
	information in.

	Note that we still need to parse the log output as the monitor itself
	may be on a pty. This should be rare, however, and the new code will
	replace all pty paths parsed by the log output method once the monitor
	is available.

	* src/qemu/qemu_monitor.(c|h) src/qemu_monitor_text.(c|h): Implement
	  qemuMonitorGetPtyPaths().
	* src/qemu/qemu_driver.c: Get pty path information using
	  qemuMonitorGetPtyPaths().

2009-12-14  Matthew Booth  <mbooth@redhat.com>

	Extract the assigned pty device for QEmu channels
	* src/qemu/qemu_driver.c: Parse pty devices for channels

	Make QEMU driver use -chardev everywhere if available
	Change -monitor, -serial and -parallel output to use -chardev if it is
	available.
	* src/qemu/qemu_conf.c: Update qemudBuildCommandLine to use -chardev where
	  available.
	* tests/qemuxml2argvtest.c tests/qemuxml2argvdata/: Add -chardev equivalents
	  for all current serial and parallel tests.

2009-12-14  Ryota Ozaki  <ozaki.ryota@gmail.com>

	Suppress cgroup error message on sucess startup
	Even if qemudStartVMDaemon suceeds, an error was logged such as
	'qemuRemoveCgroup:1778 : internal error Unable to find cgroup for'.
	This is because qemudStartVMDaemon calls qemuRemoveCgroup to
	ensure that old cgroup does not remain. This workaround makes
	sense but leaving an error message may confuse users.
	* src/qemu/qemu_driver.c: a an option to the function to suppress the
	  error being logged

2009-12-11  Matthias Bolte  <matthias.bolte@googlemail.com>

	Fix reference leak in remoteDispatchStorageVolCreateXmlFrom

	Fix memory leak in virStorageBackendCopyToFD

2009-12-11  Daniel Veillard  <veillard@redhat.com>

	Fix 'make syntax-check' after iptables.c cleanup

2009-12-11  Paolo Bonzini  <pbonzini@redhat.com>

	retrieve paused/running state at migration start
	This patch fixes the bug where paused/running state is not
	transmitted during migration.  As a result, in the QEMU driver
	for example the machine was always started on the destination
	end.

	In order to do so, just read the state and if it is appropriate and
	set the VIR_MIGRATE_PAUSED flag.

	* src/libvirt.c (virDomainMigrateVersion1, virDomainMigrateVersion2):
	  Automatically add VIR_MIGRATE_PAUSED when appropriate.
	* src/xen/xend_internal.c (xenDaemonDomainMigratePerform): Give a nicer
	  error message when migration of paused domains is attempted.

2009-12-11  Paolo Bonzini  <pbonzini@redhat.com>

	add virsh --suspend arg to migrate command
	This adds a new flag, VIR_MIGRATE_PAUSED, that mandates pausing
	the migrated VM before starting it.

	* include/libvirt/libvirt.h.in (virDomainMigrateFlags): Add VIR_MIGRATE_PAUSED.
	* src/qemu/qemu_driver.c (qemudDomainMigrateFinish2): Handle VIR_MIGRATE_PAUSED.
	* tools/virsh.c (opts_migrate): Add --suspend. (cmdMigrate): Handle it.
	* tools/virsh.pod (migrate): Document it.

2009-12-11  Paolo Bonzini  <pbonzini@redhat.com>

	fix migration of paused vms upon failure
	This makes a small change on the failed-migration path.  Up to now,
	all VMs that failed non-live migration after the "stop" command
	were restarted.  This must not be done when the VM was paused in
	the first place.

	* src/qemu/qemu_driver.c (qemudDomainMigratePerform): Do not restart
	  a paused VM that fails migration.  Set paused state after "stop",
	  reset it after failure.

2009-12-11  Diego Elio Pettenò  <flameeyes@gmail.com>

	Small change of RNG syntax for domain
	* docs/schemas/domain.rng: As trang seems to bug with <optional><oneOrMore>
	  replace it with <zeroOrMore>

2009-12-11  Richard Jones  <rjones@redhat.com>

	qemu driver: Fix segfault in libvirt/libvirtd when uri->path is NULL.
	See also:
	https://bugzilla.redhat.com/show_bug.cgi?id=545400#c1

2009-12-11  Diego Elio Pettenò  <flameeyes@gmail.com>

	Fix a wellformedness problem in secret.rng
	* docs/schemas/secret.rng: ref tag for usagevolume wasn't closed

2009-12-10  Mark McLoughlin  <markmc@redhat.com>

	remove iptablesReloadRules() and related code
	We don't use this method of reloading rules anymore, so we can just
	kill the code.

	This simplifies things a lot because we no longer need to keep a
	table of the rules we've added.

	* src/util/iptables.c: kill iptablesReloadRules()

2009-12-10  Mark McLoughlin  <markmc@redhat.com>

	remove all traces of lokkit support
	Long ago we tried to use Fedora's lokkit utility in order to register
	our iptables rules so that 'service iptables restart' would
	automatically load our rules.

	There was one fatal flaw - if the user had configured iptables without
	lokkit, then we would clobber that configuration by running lokkit.

	We quickly disabled lokkit support, but never removed it. Let's do
	that now.

	The 'my virtual network stops working when I restart iptables' still
	remains. For all the background on this saga, see:

	  https://bugzilla.redhat.com/227011

	* src/util/iptables.c: remove lokkit support

	* configure.in: remove --enable-lokkit

	* libvirt.spec.in: remove the dirs used only for saving rules for lokkit

	* src/Makefile.am: ditto

	* src/libvirt_private.syms, src/network/bridge_driver.c,
	  src/util/iptables.h: remove references to iptablesSaveRules

2009-12-10  Mark McLoughlin  <markmc@redhat.com>

	reload iptables rules on libvirtd restart
	This is the expected behaviour, I think - reloading libvirtd should
	be a subset of restarting it.

	Note, we reload the rules after we've determined which networks
	are active (because we only add the rules for active networks)
	and before we start autostart networks (to avoid re-adding the
	rules).

	* src/network/bridge_driver.c: reload iptables rules on startup

2009-12-10  Mark McLoughlin  <markmc@redhat.com>

	reload iptables rules simply by re-adding them
	Currently, when we add iptables rules, we keep them on a list so that
	we can easily reload them on e.g. 'service libvirtd reload'.

	However, we don't save this list to disk, so if libvirtd is restarted
	we lose the ability to reload the rules.

	The fix is simple - just re-add the damn things on reload.

	Note, we delete the rules before re-adding them, just like the current
	behaviour of iptRulesReload().

	* src/network/bridge_driver.c: re-add the iptables rules on reload.

2009-12-10  Matthias Bolte  <matthias.bolte@googlemail.com>

	Add virBufferFreeAndReset() and replace free()
	Replace free(virBufferContentAndReset()) with virBufferFreeAndReset().
	Update documentation and replace all remaining calls to free() with
	calls to VIR_FREE(). Also add missing calls to virBufferFreeAndReset()
	and virReportOOMError() in OOM error cases.

2009-12-09  Jim Fehlig  <jfehlig@novell.com>

	Plumb domain description tag in xend backend
	xen-unstable changesets 20321 and 20521 added support for
	description in xend domain config.  This patch extends that
	support in xend backend.
	* src/xen/xend_internal.c: add parse and output of domain description

2009-12-09  Richard Jones  <rjones@redhat.com>

	Update location of C# bindings.

2009-12-09  Daniel P. Berrange  <berrange@redhat.com>

	Make QEMU text monitor parsing more robust
	The QEMU 0.10.0 release (and possibly other 0.10.x) has a bug where
	it sometimes/often forgets to display the initial monitor greeting
	line, soley printing a (qemu).  This in turn confuses the text
	console parsing because it has a '(qemu)' it is not expecting. The
	confusion results in a negative malloc. Bad things follow.

	This re-writes the text console handling to be more robust. The key
	idea is that it should only look for a (qemu), once it has seen the
	original command echo'd back. This ensures it'll skip the bogus stray
	(qemu) with broken QEMUs.

	* src/qemu/qemu_monitor.c: Add some (disabled) debug code
	* src/qemu/qemu_monitor_text.c: Re-write way command replies
	  are detected

2009-12-09  Daniel P. Berrange  <berrange@redhat.com>

	Fix virDomainObj ref handling in QEMU driver
	Since the monitor I/O is processed out of band from the main
	thread(s) invoking monitor  commands, the virDomainObj may be
	deleted by the I/O thread. The qemuDomainObjBeginJob takes an
	extra reference to protect against final deletion, but this
	reference is released by the corresponding EndJob call. THus
	after the EndJob call it may not be valid to reference the
	virDomainObj any more. To allow callers to detect this, the
	EndJob call is changed to return the remaining reference count.

	* src/conf/domain_conf.c: Make virDomainObjUnref return the
	  remaining reference count
	* src/qemu/qemu_driver.c: Avoid referencing virDomainObjPtr
	  after qemuDomainObjEndJob if it has been deleted.

2009-12-09  Daniel Veillard  <veillard@redhat.com>

	Fix the news file non-ascii characters
	by adding an explicit HTML encoding meta description

2009-12-09  Matthias Bolte  <matthias.bolte@googlemail.com>

	Use AM_PATH_PYTHON and python-config to detect Python configuration
	Using AM_PATH_PYTHON solves the site-packages directory problem. At least
	in Ubuntu with Python 2.6 and later site-packages is renamed to dist-packages
	and site-packages is not part of sys.path anymore. So installing the libvirt
	Python bindings to site-packages renders them unusable, because they can be
	imported from there without manually including site-packages into sys.path.

	AM_PATH_PYTHON detects the correct site-packages/dist-packages directory.

	python-config --includes gives the correct include path for the Python header
	files. The old probing code stays there as fallback mechanism.

	* configure.in: use AM_PATH_PYTHON and python-config
	* python/Makefile.am: remove -I because PYTHON_INCLUDES contains it now

2009-12-09  Matthias Bolte  <matthias.bolte@googlemail.com>

	Add missing commas to the 0.7.4 news section

2009-12-08  Daniel Veillard  <veillard@redhat.com>

	Change generated HTML to UTF-8 encoding
	* docs/ChangeLog.xsl docs/newapi.xsl docs/site.xsl: change all
	  stylesheets to output UTF-8 HTML instead of ISO Latin 1 which was
	  breaking on some people names.

	Avoid an type-punned pointer aliasing pbm
	Fix this warning, there is no need to use an intermediate,
	different array pointer.
	network.c: In function 'getIPv6Addr':
	network.c:50: warning: dereferencing type-punned pointer will break strict-aliasing rules
	* src/util/network.c: avoid an intermediary pointer cast

2009-12-08  Daniel P. Berrange  <berrange@redhat.com>

	Hook up JSON monitor to emit basic lifecycle events
	* src/qemu/qemu_monitor_json.c: Hook up reset, shutdown,
	  poweroff and stop events

	Add QEMU monitor callbacks for basic lifecycle events
	* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add callbacks
	  for reset, shutdown, poweroff and stop events. Add convenience
	  methods for emiting those events

2009-12-08  Daniel P. Berrange  <berrange@redhat.com>

	Switch over to passing a callback table to QEMU monitor
	With addition of events there will be alot of callbacks.
	To avoid having to add many APIs to register callbacks,
	provide them all at once in a big table

	* src/qemu/qemu_driver.c: Pass in a callback table to QEMU
	  monitor code
	* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h Replace
	  the EOF and disk secret callbacks with a callback table

2009-12-08  Daniel P. Berrange  <berrange@redhat.com>

	Support for JSON mode monitor
	Initial support for the new QEMU monitor protocol  using JSON
	as the data encoding format instead of plain text

	* po/POTFILES.in: Add src/qemu/qemu_monitor_json.c
	* src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Hack to turn on QMP
	  mode. Replace with a version number check on >= 0.12 later
	* src/qemu/qemu_monitor.c: Delegate to json monitor if enabled
	* src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h: Add
	  impl of QMP protocol
	* src/Makefile.am: Add src/qemu/qemu_monitor_json.{c,h}

2009-12-08  Daniel P. Berrange  <berrange@redhat.com>

	Introduce callbacks for serializing domain object private data to XML
	Now that drivers are using a private domain object state blob,
	the virDomainObjFormat/Parse methods are no longer able to
	directly serialize all neccessary state to/from XML. It is
	thus neccessary to introduce a pair of callbacks fo serializing
	private state.

	The code for serializing vCPU PIDs and the monitor device
	config can now move out of domain_conf.c and into the
	qemu_driver.c where they belong.

	* src/conf/capabilities.h: Add callbacks for serializing private
	  state to/from XML
	* src/conf/domain_conf.c, src/conf/domain_conf.h: Remove the
	  monitor, monitor_chr, monitorWatch, nvcpupids and vcpupids
	  fields from virDomainObjPtr. Remove code that serialized
	  those fields
	* src/libvirt_private.syms: Export virXPathBoolean
	* src/qemu/qemu_driver.c: Add callbacks for serializing monitor
	  and vcpupid data to/from XML
	* src/qemu/qemu_monitor.h, src/qemu/qemu_monitor.c: Pass monitor
	  char device config into qemuMonitorOpen directly.

2009-12-08  Daniel P. Berrange  <berrange@redhat.com>

	Switch LXC driver to use a private data blob for virDomainObj state
	* src/lxc/lxc_driver.c: Introduce lxcDomainObjPrivate for storing
	  monitor device state

	Switch UML driver to use a private data blob for virDomainObj state
	* src/uml/uml_driver.c: Introduce umlDomainObjPrivateData for storing
	  monitor device state. Remove unneccessary VIR_FREE on vcpupids

2009-12-08  Daniel P. Berrange  <berrange@redhat.com>

	Pull code to start CPUs executing out of qemudInitCpuAffinity()
	The code to start CPUs executing has nothing todo with CPU
	affinity masks, so pull it out of the qemudInitCpuAffinity()
	method and up into qemudStartVMDaemon()

	* src/qemu/qemu_driver.c: Pull code to start CPUs executing out
	  of qemudInitCpuAffinity()

2009-12-08  Daniel P. Berrange  <berrange@redhat.com>

	Add a 'format' arg to qemuMonitorChangeMedia() since JSON will support it
	The current QEMU disk media change does not support setting the
	disk format. The new JSON monitor will support this, so add an
	extra parameter to pass this info in

	* src/qemu/qemu_driver.c: Pass in disk format when changing media
	* src/qemu/qemu_monitor.h, src/qemu/qemu_monitor.c,
	  src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h:
	  Add a 'format' arg to qemuMonitorChangeMedia()

2009-12-08  Daniel P. Berrange  <berrange@redhat.com>

	Fix migration cancellation for QEMU
	* src/qemu/qemu_monitor_text.c: Add missing underscore in the
	  migrate_cancel monitor command impl

2009-12-08  Daniel P. Berrange  <berrange@redhat.com>

	Move qemuMonitorEscape + migrate status enum into shared monitor code
	The qemuMonitorEscape() method, and the VIR_ENUM for migration
	status will be needed by the JSON monitor too, so move that code
	into the shared qemu_monitor.c file instead of qemu_monitor_text.c

	* src/qemu/qemu_monitor.h: Declare qemuMonitorMigrationStatus enum
	  and qemuMonitorEscapeArg and qemuMonitorEscapeShell methods
	* src/qemu/qemu_monitor.c: Implement qemuMonitorMigrationStatus enum
	  and qemuMonitorEscapeArg and qemuMonitorEscapeShell methods
	* src/qemu/qemu_monitor_text.c: Remove above methods/enum

2009-12-08  Daniel P. Berrange  <berrange@redhat.com>

	Fix crash when deleting monitor while a command is in progress
	If QEMU shuts down while we're in the middle of processing a
	monitor command, the monitor will be freed, and upon cleaning
	up we attempt to do  qemuMonitorUnlock(priv->mon) when priv->mon
	is NULL.

	To address this we introduce proper reference counting into
	the qemuMonitorPtr object, and hold an extra reference whenever
	executing a command.

	* src/qemu/qemu_driver.c: Hold a reference on the monitor while
	  executing commands, and only NULL-ify the priv->mon field when
	  the last reference is released
	* src/qemu/qemu_monitor.h, src/qemu/qemu_monitor.c: Add reference
	  counting to handle safe deletion of monitor objects

2009-12-08  Guido Günther  <agx@sigxcpu.org>

	udev_device_get_devpath might return NULL
	Fix crash on strdup in that case.

2009-12-08  Daniel Veillard  <veillard@redhat.com>

	Fix a compilation failure if yajl not avail
	configure:     yajl: no
	CC     libvirt_util_la-json.lo
	util/json.c:32:27: error: yajl/yajl_gen.h: No such file or directory
	util/json.c:33:29: error: yajl/yajl_parse.h: No such file or directory

	* src/util/json.c: remove the includes if yajl not configured in

2009-12-08  Matthias Bolte  <matthias.bolte@googlemail.com>

	Fix compilation for configure --disable-nls

	vbox: Update IIDs from version 3.1-beta2 to 3.1-final
	This solves the 'nsIEventQueue object is null' error when trying
	to connect to a VirtualBox 3.1 hypervisor instance.

2009-12-08  Daniel P. Berrange  <berrange@redhat.com>

	Fix ReprotError vs ReportError typo in JSON code
	* src/util/json.c: Fix ReprotError typo when YAJL is not available

	Fix inverted conditional test in configure.ac check for yajl
	* configure.in: Fix inverted conditional test when yajl is not
	  found

2009-12-07  Daniel P. Berrange  <berrange@redhat.com>

	Introduce a simple API for handling JSON data
	This introduces simple API for handling JSON data. There is
	an internal data structure 'virJSONValuePtr' which stores a
	arbitrary nested JSON value (number, string, array, object,
	nul, etc).  There are APIs for constructing/querying objects
	and APIs for parsing/formatting string formatted JSON data.

	This uses the YAJL library for parsing/formatting from

	 http://lloyd.github.com/yajl/

	* src/util/json.h, src/util/json.c: Data structures and APIs
	  for representing JSON data, and parsing/formatting it
	* configure.in: Add check for yajl library
	* libvirt.spec.in: Add build requires for yajl
	* src/Makefile.am: Add json.c/h
	* src/libvirt_private.syms: Export JSON symbols to drivers

2009-12-07  Daniel P. Berrange  <berrange@redhat.com>

	Add --system flag to autogen.sh to make it easy to build with right prefix
	Add a --system flag to autogen.sh which gets turned into the args
	--prefix=/usr --sysconfdir=/etc --localstatedir=/var to make it
	easy to build with settings that match an RPM build

	* autogen.sh: Add --system flag

2009-12-05  Jiri Denemark  <jdenemar@redhat.com>

	Export all symbols from xml.h for internal use
	Some of the very useful calls for XML parsing provided by util/xml.[ch]
	were not exported as private symbols. This patch fixes this.

2009-12-05  Matthias Bolte  <matthias.bolte@googlemail.com>

	vbox: Use virIndexToDiskName() in vboxGenerateMediumName()

2009-12-05  Jiri Denemark  <jdenemar@redhat.com>

	Tests for interface type/model configuration
	add a set of tests for Xen interface type and model configurations

2009-12-04  Jiri Denemark  <jdenemar@redhat.com>

	Support for interface model='netfront'
	Xen HVM guests with PV drivers end up with two network interfaces for
	each configured interface. One of them being emulated by qemu and the
	other one paravirtual. As this might not be desirable, the attached
	patch provides a way for users to specify that only paravirtual network
	interface should be presented to the guest.

	The configuration was inspired by qemu/kvm driver, for which users can
	specify model='virtio' to use paravirtual network interface.

	The patch adds support for model='netfront' which results in
	type=netfront instead of type=ioemu (or nothing for newer xen versions)
	in guests native configuration. Xen's qemu ignores interfaces with
	type != ioemu and only paravirtual network device will be seen in the
	guest.

	Four possible configuration scenarios follow:

	- no model specified in domain's XML
	    - libvirt will behave like before this change; it will set
	      type=ioemu for HVM guests on xen host which is not newer than
	      XEND_CONFIG_MAX_VERS_NET_TYPE_IOEMU
	    - covered by existing tests

	- PV guest, any model
	    - no functional change, model is passed as is (and ignored by the
	      hypervisor)
	    - covered by existing tests (e.g., *-net-e1000.*)
	- HVM guest, model=netfront
	    - type is set to "netfront", model is not specified
	    - covered by new *-net-netfront.* tests

	- HVM guest, model != netfront
	    - type is set to "ioemu", model is passed as is
	    - covered by new *-net-ioemu.* tests

	The fourth scenario feels like a regression for xen newer than
	XEND_CONFIG_MAX_VERS_NET_TYPE_IOEMU as users who had a model specified
	in their guest's configuration won't see a paravirtual interface in
	their guests any more. On the other hand, the reason for specifying a
	model is most likely the fact that they want to use such model which
	implies emulated interface. Users of older xen won't be affected at all
	as their xen provides paravirtual interface regardless of the type used.

	- src/xen/xend_internal.c: add netfront support for the xend backend
	- src/xen/xm_internal.c: add netfront support for the XM serialization too

2009-12-04  Pritesh Kothari  <pritesh.kothari@sun.com>

	vbox: Add support for version 3.1
	Also fixed serial port configuration which was broken due to recent
	change in virDomainChrDef where targetType was newly added.

	* src/Makefile.am: add new files
	* src/vbox/vbox_driver.c: add case for version 3.1
	* src/vbox/vbox_tmpl.c: refactor common patterns into macros, support for
	  version 3.1, serial port configuration fix
	* src/vbox/vbox_CAPI_v3_1.h, src/vbox/vbox_V3_1.c: generated code

2009-12-04  Matthias Bolte  <matthias.bolte@googlemail.com>

	Add virIndexToDiskName and fix mapping gap
	esxVMX_IndexToDiskName handles indices up to 701. This limit comes
	from a mapping gap in virDiskNameToIndex:

	  sdzy -> 700
	  sdzz -> 701
	  sdaaa -> 728
	  sdaab -> 729

	This line in virDiskNameToIndex causes this gap:

	  idx = (idx + i) * 26;

	Fixing it by altering this line to:

	  idx = (idx + (i < 1 ? 0 : 1)) * 26;

	Also add a new version of virIndexToDiskName that handles the inverse
	mapping for arbitrary indices.

	* src/esx/esx_vmx.[ch]: remove esxVMX_IndexToDiskName
	* src/util/util.[ch]: add virIndexToDiskName and fix mapping gap
	* tests/esxutilstest.c: update test to verify that the gap is fixed

2009-12-04  Matthias Bolte  <matthias.bolte@googlemail.com>

	Fix some locking issues
	* src/conf/domain_conf.c: don't call virDomainObjUnlock twice
	* src/qemu/qemu_driver.c: relock driver lock if an error occurs in
	  qemuDomainObjBeginJobWithDriver, enter/exit monitor with driver
	  in qemudDomainSave

2009-12-03  Daniel Veillard  <veillard@redhat.com>

	Fix missing background color

2009-12-02  Daniel P. Berrange  <berrange@redhat.com>

	Fix event test timer checks on kernels with HZ=100
	On kernels with HZ=100, the resolution of sleeps in poll() is
	quite bad. Doing a precise check on the expiry time vs the
	current time will thus often thing the timer has not expired
	even though we're within 10ms of the expected expiry time. This
	then causes another pointless sleep in poll() for <10ms. Timers
	do not need to have such precise expiration, so we treat a timer
	as expired if it is within 20ms of the expected expiry time. This
	also fixes the eventtest.c test suite on kernels with HZ=100

	* daemon/event.c: Add 20ms fuzz when checking for timer expiry

2009-11-30  Daniel P. Berrange  <berrange@redhat.com>

	Fix typo in QEMU driver webpage
	* docs/drvqemu.html.in: Fix typo describing URI driver protocol

2009-11-30  Paolo Bonzini  <pbonzini@redhat.com>

	Add another SENTINEL attribute
	* src/xen/xend_internal.c (xend_op): Add ATTRIBUTE_SENTINEL.

2009-11-27  Wolfgang Mauerer  <wolfgang.mauerer@siemens.com>

	Clarify documentation for private symbols
	The instruction "See Makefile.am" in libvirt.private_syms
	always makes me think that this file is autogenerated
	and should not be touched manually. This patch spares
	every reader of libvirt.private_syms the hassle of
	reading Makefile.am before augmenting libvirt.private_syms.

	Fix help message
	The configuration file setting is overriden by -f or --config, but
	not with -c

2009-11-26  Daniel P. Berrange  <berrange@redhat.com>

	Fix threading problems in python bindings
	* libvirt-override.c: Add many missing calls to allow threading
	  when entering C code, otherwise python blocks & then deadlocks
	  when we have an async event to dispatch back into python code.
	  Fix return value check for virDomainPinVcpu binding.

	Supress annoying libcap-ng errors from valgrind
	* tests/.valgrind.supp: Ignore capng problems

	Fix two leaks in test driver
	* src/test/test_driver.c: Fix leak of vcpu info, and nodedevice
	  info

	Free cgroup device ACL list on driver shutdown
	* src/qemu/qemu_driver.c: Free cgroup ACLs

2009-11-26  Matthias Bolte  <matthias.bolte@googlemail.com>

	xen: Fix unconditional freeing in xenDaemonListDefinedDomains()
	Commit 790f0b3057787bb64da8c46c111ff8d3eff7b2af causes the contents of
	the names array to be freed even on success, resulting in no listing of
	defined but inactive Xen domains.

	Spotted by Jim Fehlig

2009-11-24  Daniel P. Berrange  <berrange@redhat.com>

	Fix default disk type when parsing QEMU argv
	* src/qemu/qemu_conf.c: Fix default disk type to be 'FILE'
	  again, after previous commit accidentally changed it

2009-11-24  Gerhard Stenzel  <gerhard.stenzel@de.ibm.com>

	remove port filter when network device is detached
	* src/qemu/qemu_driver.c: remove the port filter if the network device
	  is detached via virDomainDetachDevice.

2009-11-23  Daniel P. Berrange  <berrange@redhat.com>

	Support QEMU's virtual FAT block device driver
	Introduce a new type="dir"  mode for <disks> that allows use of
	QEMU's  virtual FAT block device driver. eg

	    <disk type='dir' device='floppy'>
	      <source dir='/tmp/test'/>
	      <target dev='fda' bus='fdc'/>
	      <readonly/>
	    </disk>

	gets turned into

	  -drive file=fat:floppy:/tmp/test,if=floppy,index=0

	Only read-only disks are supported with virtual FAT mode

	* src/conf/domain_conf.c, src/conf/domain_conf.h: Add type="dir"
	* docs/schemas/domain.rng: Document new disk type
	* src/xen/xend_internal.c, src/xen/xm_internal.c: Raise error for
	  unsupported disk types
	* tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom-empty.args: Fix
	  empty disk file handling
	* tests/qemuxml2argvdata/qemuxml2argv-disk-drive-fat.args,
	  tests/qemuxml2argvdata/qemuxml2argv-disk-drive-fat.xml,
	  tests/qemuxml2argvdata/qemuxml2argv-floppy-drive-fat.args,
	  tests/qemuxml2argvdata/qemuxml2argv-floppy-drive-fat.xml
	  tests/qemuxml2argvtest.c: Test QEMU vitual FAT driver
	* src/qemu/qemu_conf.c: Support generating fat:/some/dir type
	  disk args
	* src/security/security_selinux.c: Temporarily skip labelling
	  of directory based disks

2009-11-23  Daniel P. Berrange  <berrange@redhat.com>

	Alternate CPU affinity impl to cope with NR_CPUS > 1024
	The cpu_set_t type can only cope with NR_CPUS <= 1024, beyond this
	it is neccessary to use alternate CPU_SET maps with a dynamically
	allocated CPU map

	* src/util/processinfo.c: Support new unlimited size CPU set type

2009-11-23  Daniel P. Berrange  <berrange@redhat.com>

	Pull schedular affinity code out into a separate module
	* src/Makefile.am: Add processinfo.h/processinfo.c
	* src/util/processinfo.c, src/util/processinfo.h: Module providing
	  APIs for getting/setting process CPU affinity
	* src/qemu/qemu_driver.c: Switch over to new APIs for schedular
	  affinity
	* src/libvirt_private.syms: Export virProcessInfoSetAffinity
	  and virProcessInfoGetAffinity to internal drivers

	Ignore docs/ directory for strcmp() syntax check
	* .x-sc_prohibit_strcmp_and_strncmp: Ignore docs/

2009-11-23  Dan Kenigsberg  <danken@redhat.com>

	Fix news.html validation

2009-11-21  Daniel Veillard  <veillard@redhat.com>

	Release of libvirt-0.7.4
	0.7.3 was broken

	* configure.in docs/news.html.in: release of 0.7.4
	* configure.in libvirt.spec.in: require netcf >= 0.1.4
	* src/Makefile.am: node_device/node_device_udev.h was missing from
	  NODE_DEVICE_DRIVER_UDEV_SOURCES breaking compilation on platforms with
	  udev

2009-11-21  Daniel Veillard  <veillard@redhat.com>

	Release of libvirt-0.7.3
	* configure.in docs/news.html.in libvirt.spec.in: describe new release
	* po/*.po*: regenerate

2009-11-20  Daniel P. Berrange  <berrange@redhat.com>

	Enable udev instead of hal on F12 / RHEL-6 or later
	HAL has been deprecated since F12 and RHEL-6, so if building on
	these platforms, switch on the udev driver instead

	* libvirt.spec.in: Activate udev on F12/RHEL6

2009-11-20  Cole Robinson  <crobinso@redhat.com>

	Document overriding domain interface target
	* docs/formatdomain.html.in: document that vnet and vif are reserved
	  names and will be ignored if manually specified.

	python: Actually implement list*Interfaces bindings
	* python/generator.py python/libvirt-override-api.xml
	  python/libvirt-override.c: implement the bindings for
	  virConnectListInterfaces() and virConnectListDefinedInterfaces()

2009-11-20  Daniel Veillard  <veillard@redhat.com>

	514532 Fix man page, most operation are synchronous
	* tools/virsh.pod: the man page was stating that most operations
	  are asynchronous while in fact most of them are synchronous except
	  domain shutdown, setvcpus and setmem.

	504262 Check for duplicated UUID in XM Xen defines
	* src/xen/xm_internal.c: the XM driver was not checking for previously
	  defined UUID on new defines. Similar to virDomainObjIsDuplicate()
	  behaviour.

2009-11-20  Daniel Veillard  <veillard@redhat.com>

	512069 fix domain XML schemas for backward compatibility
	For backward compatibility we used to add the tty path as
	a tty attribute on console of type pty, duplicating the value
	now found in source/@path, but the Relax-NG grammar wasn't
	extended for this
	    <console type='pty' tty='/dev/pts/8'>
	      <source path='/dev/pts/8'/>
	      <target port='0'/>
	    </console>

	* docs/schemas/domain.rng: allow an optional tty attribute
	  containing a devicePath

2009-11-20  Steve Yarmie  <steve.yarmie@gmail.com>

	qemu-kvm needs -enable-kvm flag for VT optimization
	Recent qemu releases require command option '-enable-qemu' in order
	for the kvm functionality be activated. Libvirt needs to pass this flag
	to qemu when starting a domain. Note that without the option,
	even if both the kernel and qemu support KVM, KVM will not be activated
	and VMs will be very slow.

	* src/qemu/qemu_conf.h src/qemu/qemu_conf.c: parse the extra command
	  line option from help and add it when running kvm
	* tests/qemuhelptest.c: this modified the flags output for qemu-0.10.5
	  and qemu-kvm-0.11.0-rc2 regression tests

2009-11-20  Steve Yarmie  <steve.yarmie@gmail.com>

	fix deprecated iptables command syntax
	* src/util/iptables.c: `--option !  this` is deprecated in favor of
	  `! --option this` syntax, change the output command accordingly

2009-11-19  Dave Allan  <dallan@redhat.com>

	remove sysfs_path and parent_sysfs_path from XML
	Erroneously included the sysfs_path and parent_sysfs_path elements in
	the node device xml, they were not supposed to show up there

	* src/conf/node_device_conf.c: remove the output of the 2 fields

2009-11-19  Dave Allan  <dallan@redhat.com>

	Removing devicePath member from dev struct
	I realized that I inadvertently added a member to the def struct to
	contain each device's sysfs path when there was an existing member in the
	dev struct for "OS specific path to device metadat, eg sysfs"  Since the
	udev backend needs to record the sysfs path while it's in the process of
	creating the device, before the dev struct gets allocated, I chose to
	remove the member from the dev struct.

	* src/conf/node_device_conf.c src/conf/node_device_conf.h
	  src/node_device/node_device_driver.c src/node_device/node_device_hal.c
	  src/node_device/node_device_udev.c: remove devicePath from the
	  structure and use def->sysfs_path instead

2009-11-19  Dave Allan  <dallan@redhat.com>

	report OOM in two places in node_device_driver.c
	* src/node_device/node_device_driver.c: two places where not calling
	  virReportOOMError after strdup failure

2009-11-19  Daniel P. Berrange  <berrange@redhat.com>

	Ensure driver lock is released when entering QEMU monitor
	The qemudStartVMDaemon() and several functions it calls use
	the QEMU monitor. The QEMU driver is locked while this function
	is executing, so it is rquired to release the driver lock and
	reacquire it either side of issuing a monitor command. It
	failed todo so, leading to deadlock

	* qemu/qemu_driver.c: Release driver when in qemudStartVMDaemon
	  and things it calls

2009-11-17  Daniel Veillard  <veillard@redhat.com>

	Updated localization and regenerated the pos
	updated el.po es.po or.po pl.po ta.po te.po
	ran make update-po

2009-11-17  Matthew Booth  <mbooth@redhat.com>

	Fix typo in error message

2009-11-17  Matthias Bolte  <matthias.bolte@googlemail.com>

	Whitespace cleanup for pre-tags on the website

2009-11-17  Daniel P. Berrange  <berrange@redhat.com>

	Fix type in configure output summary
	* configure.in: Fix typo in PCIACCESS_LIBS

2009-11-17  Daniel Veillard  <veillard@redhat.com>

	Remove a compilation warning on uninitialized var

2009-11-16  Guido Günther  <agx@sigxcpu.org>

	only remove masquerade roles for VIR_NETWORK_FORWARD_NAT
	Fixes http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=549949

2009-11-15  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Fix CPU clock Hz to MHz conversion

	esx: Fix memory leak in esxVI_HostCpuIdInfo_Free()

2009-11-15  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Fix MAC address formatting
	VMware uses two MAC address prefixes: 00:0c:29 and 00:50:56. The 00:0c:29
	prefix is used for ESX server generated addresses. The 00:50:56 prefix is
	split into two parts. MAC addresses above 00:50:56:3f:ff:ff are generated
	by a vCenter. The rest of the 00:50:56 prefix can be assigned manually.
	Any MAC address within the 00:0c:29 and 00:50:56 prefix can be specified
	in a domain XML config and the driver will handle the details internally.

	* src/esx/esx_vmx.c: fix MAC address formatting
	* tests/xml2vmxdata/*: update test files accordingly

2009-11-15  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx: Handle 'vmxnet3' in esxVMX_FormatEthernet()
	In commit 3c80fac2588cbc9e5ee7e7069e1ca4468f2359d3 'vmxnet3' handling
	was added to esxVMX_ParseEthernet(), but not to the inverse function
	esxVMX_FormatEthernet().

	esx: Add documentation to the website
	* docs/drivers.html.in: list the ESX driver
	* docs/drvesx.html.in: the new ESX driver documentation
	* docs/hvsupport.html.in: add the ESX driver to the matrix
	* docs/index.html.in, docs/sitemap.html.in: list the ESX driver
	* src/esx/esx_driver.c: fix and cleanup some comments

2009-11-15  Matthias Bolte  <matthias.bolte@googlemail.com>

	Change DTD references to use public instead of system identifier
	Debian's /etc/xml/catalog doesn't contain system identifiers, so use
	public identifiers instead.

	* docs/Makefile.am: use public instead of system identifier
	* docs/site.xsl: use matching public identifier

2009-11-15  Jim Fehlig  <jfehlig@novell.com>

	Fix compilation of libvirt against xen-unstable
	* src/xen/xen_hypervisor.c: xen-unstable changeset 19788 removed
	  MAX_VIRT_CPUS from public headers, breaking compilation of libvirt
	  on -unstable.  Its semanitc was retained with XEN_LEGACY_MAX_VCPUS.
	  Ensure MAX_VIRT_CPUS is defined accordingly.

2009-11-13  Daniel P. Berrange  <berrange@redhat.com>

	Fix probing for libpciaccess
	If 'with_udev=check' then missing pciaccess should not be a fatal
	error. It should merely disable the udev driver.

	* configure.in: Fix pciaccess check to be non-fatal

2009-11-13  Daniel P. Berrange  <berrange@redhat.com>

	Remove obsolte devicekit checks
	Device kit support was removed, but the configure.ac checks were
	left in place. A number of the XXX_REQUIRED=X.Y.Z variables were
	not declared in the correct location (ie top of the file)

	* configure.in: Remove device kit checks & move mis-placed variables
	  to correct location

2009-11-13  Daniel P. Berrange  <berrange@redhat.com>

	Fix incorrect reference counting logic in qemu monitor open
	The QEMU monitor open method would not take a reference on
	the virDomainObjPtr until it had successfully opened the
	monitor. The cleanup code upon failure to open though would
	call qemuMonitorClose() which would in turn decrement the
	reference count. This caused the virDoaminObjPtr to be mistakenly
	freed and then the whole driver crashes

	* src/qemu/qemu_monitor.c: Fix reference counting in
	  qemuMonitorOpen

2009-11-13  Daniel P. Berrange  <berrange@redhat.com>

	Don't return fatal error in HAL driver init if HAL isn't running
	The HAL driver returns a fatal error code in the case where HAL
	is not running. This causes the entire libvirtd daemon to quit
	which isn't desirable. Instead it should simply disable the HAL
	driver

	* src/node_device/node_device_hal.c: Quietly disable HAL if it is
	  not running

2009-11-13  Daniel P. Berrange  <berrange@redhat.com>

	Fix cleanup when state driver init fails
	* daemon/libvirtd.c: Fix incorrect goto label causing cleanup to
	  be missed when state driver init fails

2009-11-13  Matthew Booth  <mbooth@redhat.com>

	Small guestfwd code cleanup
	* src/qemu/qemu_conf.c: Remove and inline qemudBuildCommandLineChrDevTargetStr

	Small indentation cleanup of domain schema

2009-11-13  Jamie Strandboge  <jamie@canonical.com>

	AppArmor code cleanups
	* src/security/security_apparmor.c: a few code cleanups following a
	  review on the list

2009-11-13  Jamie Strandboge  <jamie@canonical.com>

	AppArmor handling of accesses to readonly files
	Fixes https://launchpad.net/bugs/453335

	* src/security/virt-aa-helper.c: suppress confusing and misleading
	  apparmor denied message when kvm/qemu tries to open a libvirt specified
	  readonly file (such as a cdrom) with write permissions. libvirt uses
	  the readonly attribute for the security driver only, and has no way
	  of telling kvm/qemu that the device should be opened readonly

2009-11-13  Jamie Strandboge  <jamie@canonical.com>

	AppArmor require absolute paths
	Fixes https://launchpad.net/bugs/460271

	* src/security/virt-aa-helper.c: require absolute path for dynamic added
	  files. This is required by AppArmor and conveniently prevents adding
	  tcp consoles to the profile

2009-11-13  Jamie Strandboge  <jamie@canonical.com>

	AppArmor updates of examples
	* examples/apparmor/libvirt-qemu: adds pulseaudio, alsa and preliminary
	  save/restore to the example apparmor abstraction
	* examples/apparmor/usr.sbin.libvirtd: allows libvirtd access to inet
	  dgram, inet6 dgram, inet6 stream and /usr/lib/libvirt/*

2009-11-13  Daniel P. Berrange  <berrange@redhat.com>

	Check that domain is running when starting console
	The 'virsh console' command did not check if the domain was
	already running before attempting to fetch the XML and extract
	the console PTY path. This caused a slightly unhelpful / misleading
	error message for the user. The explicit check ensures the user
	gets an explicit 'domain is not running' message.

	* tools/virsh.c: Validate that state != VIR_DOMAIN_SHUTOFF in
	  virsh console command

2009-11-13  Daniel P. Berrange  <berrange@redhat.com>

	Fix incorrect variable passed to LXC event callback
	The wrong variable was being passed in with the LXC event callback
	resulting in a later deadlock or crash

	* src/lxc/lxc_driver.c: Pass 'vm' instead of 'driver' to event
	  callback

2009-11-13  Daniel P. Berrange  <berrange@redhat.com>

	Fix check for existance of cgroups at creation
	In the scenario where the cgroups were mounted but the
	particular group did not exist, and the caller had not
	requested auto-creation, the code would fail to return
	an error condition. This caused the lxc_controller to
	think the cgroup existed, and it then later failed when
	attempting to use it

	* src/util/cgroup.c: Raise an error if the cgroup path does not
	  exist

2009-11-13  Daniel P. Berrange  <berrange@redhat.com>

	Fix race condition in HAL driver startup
	There is a race condition in HAL driver startup where the callback
	can get triggered before we have finished startup. This then causes
	a deadlock in the driver.

	* src/node_device/node_device_hal.c: RElease driver lock before
	  registering DBus callbacks

2009-11-13  Daniel P. Berrange  <berrange@redhat.com>

	Fix formatting of XML for an inactive guest
	If the virDomainDefPtr object has an 'id' of -1, then forcably
	set the VIR_DOMAIN_XML_INACTIVE flag to ensure generated XML
	does not include any cruft from the previously running guest
	such as console PTY path, or VNC port.

	* src/conf/domain_conf.c: Set VIR_DOMAIN_XML_INACTIVE if
	  def->id is -1. Replace checks for def->id == -1 with
	  check against flags & VIR_DOMAIN_XML_INACTIVE.

2009-11-13  Daniel P. Berrange  <berrange@redhat.com>

	Remove capng_lock() call when spawning LXC container init process
	The capng_lock() call sets the SECURE_NO_SETUID_FIXUP and SECURE_NOROOT
	bits on the process. This prevents the kernel granting capabilities to
	processes with an effective UID of 0, or with setuid programs. This is
	not actually what we want in the container init process. It should be
	allowed to run setuid processes & keep capabilities when root. All that
	is required is masking a handful of dangerous capabilities from the
	bounding set.

	* src/lxc/lxc_container.c: Remove bogus capng_lock() call.

2009-11-13  Daniel P. Berrange  <berrange@redhat.com>

	Fix initscript to check daemon pidfile
	The libvirtd initscript could get confused between the system and
	session instances of the daemon. To avoid this it is neccessary
	to check the pidfile explicitly.

	* daemon/libvirtd.init.in: Always check the pidfile of the system
	  daemon to avoid confusion with the session daemons

2009-11-13  Jamie Strandboge  <jamie@canonical.com>

	Fix virt-aa-helper when host and os.type arch differ
	* src/security/virt-aa-helper.c: get_definition() now calls the new
	  caps_mockup() function which will parse the XML for os.type,
	  os.type.arch and then sets the wordsize.  These attributes are needed
	  only to get a valid virCapsPtr for virDomainDefParseString(). The -H
	  and -b options are now removed from virt-aa-helper (they weren't used
	  yet anyway).
	* tests/virt-aa-helper-test: extend and fixes tests, chmod'ed 755

2009-11-13  David Allan  <dallan@redhat.com>

	Add translation of PCI vendor and product IDs
	uses libpciaccess to provide human readable names for PCI vendor and
	device IDs
	* configure.in: add a requirement for libpciaccess >= 0.10.0
	* src/Makefile.am: add the associated compilation flags and link
	* src/node_device/node_device_udev.c: lookup the libpciaccess for
	  vendor name and product name based on their ids

	Remove DevKit node device backend
	* configure.in src/Makefile.am: remove the configuration check and
	  build instructions
	* src/node_device/node_device_devkit.c: removed the module
	* src/node_device/node_device_driver.c src/node_device/node_device_driver.h:
	  removed references to the old backend

	Add scsi_target device type
	* src/conf/node_device_conf.h src/conf/node_device_conf.c: add specific
	  support for SCSI target in node device capabilities
	* src/node_device/node_device_udev.c: add some extra detection code
	  when handling udev output

	Implement a node device backend using libudev
	* configure.in: add new --with-udev, disabled by default, and requiring
	  libudev > 145
	* src/node_device/node_device_udev.c src/node_device/node_device_udev.h:
	  the new node device backend
	* src/node_device/node_device_linux_sysfs.c: moved node_device_hal_linux.c
	  to a better file name
	* src/conf/node_device_conf.c src/conf/node_device_conf.h: add a couple
	  of fields in node device definitions, and an API to look them up,
	  remove a couple of unused fields from previous patch.
	* src/node_device/node_device_driver.c src/node_device/node_device_driver.h:
	  plug the new driver
	* po/POTFILES.in src/Makefile.am src/libvirt_private.syms: add the new
	  files and symbols
	* src/util/util.h src/util/util.c: add a new convenience macro
	  virBuildPath and virBuildPathInternal() function

	Add several fields to node device capabilities
	* src/conf/node_device_conf.h src/conf/node_device_conf.c: add the new
	  fields in the structure as well as parsing and serialization

2009-11-12  Cole Robinson  <crobinso@redhat.com>

	Add virConnectGetLibvirtVersion API
	There is currently no way to determine the libvirt version of a remote
	libvirtd we are connected to. This is a useful piece of data to enable
	feature detection.

2009-11-12  Maximilian Wilhelm  <max@rfc2324.org>

	Implement finer grained migration control for Xen
	* src/xen/xen_driver.c: Add support for VIR_MIGRATE_PERSIST_DEST flag
	* src/xen/xend_internal.c: Add support for VIR_MIGRATE_UNDEFINE_SOURCE flag
	* include/libvirt/virterror.h, src/util/virterror.c: Add new errorcode
	  VIR_ERR_MIGRATE_PERSIST_FAILED

2009-11-12  pritesh  <Pritesh.Kothari@Sun.COM>

	Support for SATA Disks in virDomainDiskBus
	* src/conf/domain_conf.h src/conf/domain_conf.c: add the new entry in
	  the enum and lists of virDomainDiskBus
	* src/qemu/qemu_conf.c: same for virDomainDiskQEMUBus

2009-11-12  Ryota Ozaki  <ozaki.ryota@gmail.com>

	LXC implement missing DomainInterfaceStats API
	* src/lxc/lxc_driver.c: add lxcDomainInterfaceStats implementing
	  virDomainInterfaceStats()

2009-11-12  Daniel P. Berrange  <berrange@redhat.com>

	Filter out stale domains from xenstore listing
	The xenstore database sometimes has stale domain IDs which are not
	present in the hypervisor anymore. Filter these out to avoid causing
	confusion

	* src/xen/xs_internal.c: Filter domain IDs against HV's list
	* src/xen/xen_hypervisor.h, src/xen/xen_hypervisor.c: Add new
	  xenHypervisorHasDomain() method for checking ID validity

2009-11-12  Jonas Eriksson  <jonas.j.eriksson@ericsson.com>

	Fix logic in xenUnifiedNumOfDomains to match xenUnifiedListDomains
	The xenUnifiedNumOfDomains and xenUnifiedListDomains methods work
	together as a pair, so it is critical they both apply the same
	logic. With the current mis-matched logic it is possible to sometimes
	get into a state when you miss certain active guests.

	* src/xen/xen_driver.c: Change xenUnifiedNumOfDomains ordering to
	  match xenUnifiedListDomains.

2009-11-12  Daniel P. Berrange  <berrange@redhat.com>

	Disable IPv6 socket auto-binding to IPv4 socket
	Sometimes getaddrinfo returns IPv4 addresses before IPv6 addresses.
	IPv6 sockets default to attempting to bind to IPv4 addresses too.
	So if the IPv4 address is activated first, then binding to IPv6
	will unneccessarily fail.

	* daemon/libvirtd.c: Bind to IPv6 and IPv4 addresses separately

2009-11-12  Daniel P. Berrange  <berrange@redhat.com>

	Exclude numactl on s390[x]
	The numactl package is not applicable for s390[x] arches, so do
	not enable it as a build dep.

	* libvirt.spec.in: Exclude numactl on s390[x]

2009-11-12  Ryota Ozaki  <ozaki.ryota@gmail.com>

	Fix error handling in qemuMonitorOpen
	* src/qemu/qemu_monitor.c: add error check for qemuMonitorOpenXXX
	  returned file descriptor

2009-11-11  Daniel P. Berrange  <berrange@redhat.com>

	Fix save and restore with non-privileged guests and SELinux
	When running qemu:///system instance, libvirtd runs as root,
	but QEMU may optionally be configured to run non-root. When
	then saving a guest to a state file, the file is initially
	created as root, and thus QEMU cannot write to it. It is also
	missing labelling required to allow access via SELinux.

	* src/qemu/qemu_driver.c: Set ownership on save image before
	  running migrate command in virDomainSave impl. Call out to
	  security driver to set save image labelling
	* src/security/security_driver.h: Add driver APIs for setting
	  and restoring saved state file labelling
	* src/security/security_selinux.c: Implement saved state file
	  labelling for SELinux

2009-11-11  Gerhard Stenzel  <gstenzel@linux.vnet.ibm.com>

	disable mac_filter config switch by default
	* src/qemu/qemu.conf:  disables the mac_filter config switch by default
	  to match existing convention, also document the option

2009-11-11  Ryota Ozaki  <ozaki.ryota@gmail.com>

	Prevent initializing ebtables if disabled in qemu.conf
	* src/qemu/qemu_conf.c: don't initialize ebtables if
	  disabled

2009-11-11  Eduardo Otubo  <otubo@linux.vnet.ibm.com>

	phyp: too much timeout when polling socket
	* src/phyp/phyp_driver.c: a 10s timeout on socket availability was way
	  too long, reduced to 1ms

2009-11-11  Ryota Ozaki  <ozaki.ryota@gmail.com>

	Fix warning on make due to missing cast (int)
	* src/qemu/qemu_monitor.c src/qemu/qemu_monitor_text.c: cast size_t to
	  int when passing to '%d'

2009-11-11  Eduardo Otubo  <otubo@linux.vnet.ibm.com>

	phyp: Reorder keyboard_interactive label in openSSHSession()
	Finish changes intended to be part of commit
	6c70802374d1cb9316769fea750a6c2c198901ff

2009-11-11  Daniel P. Berrange  <berrange@redhat.com>

	Implmentation of new APIs to checking state/persistence of objects
	This implements the virConnectIsSecure, virConnectIsEncrypted,
	virDomainIsPersistent, virDomainIsActive, virNetworkIsActive,
	virNetworkIsPersistent, virStoragePoolIsActive,
	virStoragePoolIsPersistent, virInterfaceIsActive APIs in
	(nearly) all drivers. Exceptions are:

	 phyp: missing domainIsActive/Persistent
	 esx: missing domainIsPersistent
	 opennebula: missing domainIsActive/Persistent

	* src/remote/remote_protocol.x: Define remote wire ABI for newly
	  added APIs.
	* daemon/remote_dispatch*.h: Re-generated from remote_protocol.x
	* src/esx/esx_driver.c, src/lxc/lxc_driver.c, src/network/bridge_driver.c,
	  src/opennebula/one_driver.c, src/openvz/openvz_conf.c,
	  src/openvz/openvz_driver.c, src/phyp/phyp_driver.c,
	  src/remote/remote_driver.c, src/storage/storage_driver.c,
	  src/test/test_driver.c, src/uml/uml_driver.c, src/vbox/vbox_tmpl.c,
	  src/xen/xen_driver.c, src/xen/xen_driver.h, src/xen/xen_inotify.c,
	  src/xen/xen_inotify.h: Implement all the new APIs where possible

2009-11-11  Daniel P. Berrange  <berrange@redhat.com>

	New APIs for checking some object properties
	Introduce a number of new APIs to  expose some boolean properties
	of objects, which cannot otherwise reliably determined, nor are
	aspects of the XML configuration.

	 * virDomainIsActive: Checking virDomainGetID is not reliable
	   since it is not possible to distinguish between error condition
	   and inactive domain for ID of -1.
	 * virDomainIsPersistent: Check whether a persistent config exists
	   for the domain

	 * virNetworkIsActive: Check whether the network is active
	 * virNetworkIsPersistent: Check whether a persistent config exists
	   for the network

	 * virStoragePoolIsActive: Check whether the storage pool is active
	 * virStoragePoolIsPersistent: Check whether a persistent config exists
	   for the storage pool

	 * virInterfaceIsActive: Check whether the host interface is active

	 * virConnectIsSecure: whether the communication channel to the
	   hypervisor is secure
	 * virConnectIsEncrypted: whether any network based commnunication
	   channels are encrypted

	NB, a channel can be secure, even if not encrypted, eg if it does
	not involve the network, like a UNIX socket, or pipe.

	 * include/libvirt/libvirt.h.in: Define public API
	 * src/driver.h: Define internal driver API
	 * src/libvirt.c: Implement public API entry point
	 * src/libvirt_public.syms: Export API symbols
	 * src/esx/esx_driver.c, src/lxc/lxc_driver.c,
	   src/interface/netcf_driver.c, src/network/bridge_driver.c,
	   src/opennebula/one_driver.c, src/openvz/openvz_driver.c,
	   src/phyp/phyp_driver.c, src/qemu/qemu_driver.c,
	   src/remote/remote_driver.c, src/test/test_driver.c,
	   src/uml/uml_driver.c, src/vbox/vbox_tmpl.c,
	   src/xen/xen_driver.c: Stub out driver tables

2009-11-11  Daniel Veillard  <veillard@redhat.com>

	Various fixes following a code review part 2
	* daemon/libvirtd.c tools/virsh.c: Steve Grubb <sgrubb@redhat.com> found
	  a few more issues

	Various fixes following a code review
	* src/libvirt.c src/lxc/lxc_conf.c src/lxc/lxc_container.c
	  src/lxc/lxc_controller.c src/node_device/node_device_hal.c
	  src/openvz/openvz_conf.c src/qemu/qemu_driver.c
	  src/qemu/qemu_monitor_text.c src/remote/remote_driver.c
	  src/storage/storage_backend_disk.c src/storage/storage_driver.c
	  src/util/logging.c src/xen/sexpr.c src/xen/xend_internal.c
	  src/xen/xm_internal.c: Steve Grubb <sgrubb@redhat.com> sent a code
	  review and those are the fixes correcting the problems

2009-11-10  Daniel P. Berrange  <berrange@redhat.com>

	Allow timeouts waiting for QEMU job lock
	Some monitor commands may take a very long time to complete. It is
	not desirable to block other incoming API calls forever. With this
	change, if an existing API call is holding the job lock, additional
	API calls will not wait forever. They will time out after a short
	period of time, allowing application to retry later.

	* include/libvirt/virterror.h, src/util/virterror.c: Add new
	  VIR_ERR_OPERATION_TIMEOUT error code
	* src/qemu/qemu_driver.c: Change to a timed condition variable
	  wait for acquiring the monitor job lock

2009-11-10  Daniel P. Berrange  <berrange@redhat.com>

	Release driver and domain lock when running monitor commands
	QEMU monitor commands may sleep for a prolonged period of time.
	If the virDomainObjPtr or qemu driver lock is held this will
	needlessly block execution of many other API calls. it also
	prevents asynchronous monitor events from being dispatched
	while a monitor command is executing, because deadlock will
	ensure.

	To resolve this, it is neccessary to release all locks while
	executing a monitor command. This change introduces a flag
	indicating that a monitor job is active, and a condition
	variable to synchronize access to this flag. This ensures that
	only a single thread can be making a state change or executing
	a monitor command at a time, while still allowing other API
	calls to be completed without blocking

	* src/qemu/qemu_driver.c: Release driver and domain lock when
	  running monitor commands. Re-add locking to disk passphrase
	  callback
	* src/qemu/THREADS.txt: Document threading rules

2009-11-10  Daniel P. Berrange  <berrange@redhat.com>

	Fully asynchronous monitor I/O processing
	Change the QEMU monitor file handle watch to poll for both
	read & write events, as well as EOF. All I/O to/from the
	QEMU monitor FD is now done in the event callback thread.

	When the QEMU driver needs to send a command, it puts the
	data to be sent into a qemuMonitorMessagePtr object instance,
	queues it for dispatch, and then goes to sleep on a condition
	variable. The event thread sends all the data, and then waits
	for the reply to arrive, putting the response / error data
	back into the qemuMonitorMessagePtr and notifying the condition
	variable.

	There is a temporary hack in the disk passphrase callback to
	avoid acquiring the domain lock.  This avoids a deadlock in
	the command processing, since the domain lock is still held
	when running monitor commands. The next commit will remove
	the locking when running commands & thus allow re-introduction
	of locking the disk passphrase callback

	* src/qemu/qemu_driver.c: Temporarily don't acquire lock in
	  disk passphrase callback. To be reverted in next commit
	* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Remove
	  raw I/O functions, and a generic qemuMonitorSend() for
	  invoking a command
	* src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h:
	  Remove all low level I/O, and use the new qemuMonitorSend()
	  API. Provide a qemuMonitorTextIOProcess() method for detecting
	  command/reply/prompt boundaries in the monitor data stream

2009-11-10  Eduardo Otubo  <otubo@linux.vnet.ibm.com>

	phyp: ssh authentication with public key fixed
	Use ssh keyfiles from the current user's home directory instead of trying
	to use keyfiles from a hardcoded /home/user directory. Fallback to
	username/password authentication if keyfiles are not available or keyfile
	authentication failed.

2009-11-10  Daniel P. Berrange  <berrange@redhat.com>

	Add reference counting on virDomainObjPtr objects
	Add reference counting on the virDomainObjPtr objects. With the
	forthcoming asynchronous QEMU monitor, it will be neccessary to
	release the lock on virDomainObjPtr while waiting for a monitor
	command response. It is neccessary to ensure one thread can't
	delete a virDomainObjPtr while another is waiting. By introducing
	reference counting threads can make sure objects they are using
	are not accidentally deleted while unlocked.

	* src/conf/domain_conf.h, src/conf/domain_conf.c: Add
	  virDomainObjRef/Unref APIs, remove virDomainObjFree
	* src/openvz/openvz_conf.c: replace call to virDomainObjFree
	  with virDomainObjUnref

2009-11-10  Daniel P. Berrange  <berrange@redhat.com>

	Locking of the qemuMonitorPtr object
	In preparation of the monitor I/O process becoming fully asynchronous,
	it is neccessary to ensure all access to internals of the qemuMonitorPtr
	object is protected by a mutex lock.

	* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add mutex for locking
	  monitor.
	* src/qemu/qemu_driver.c: Add locking around all monitor commands

2009-11-10  Daniel P. Berrange  <berrange@redhat.com>

	Wrap text mode monitor APIs, pass qemuMonitorPtr directly to APIs
	Change the QEMU driver to not directly invoke the text mode monitor
	APIs. Instead add a generic wrapper layer, which will eventually
	invoke either the text or JSON protocol code as needed. Pass an
	qemuMonitorPtr object into the monitor APIs instead of virDomainObjPtr
	to complete the de-coupling of the monitor impl from virDomainObj
	data structures

	* src/qemu/qemu_conf.h: Remove qemuDomainObjPrivate definition
	* src/qemu/qemu_driver.c: Add qemuDomainObjPrivate definition.
	  Pass qemuMonitorPtr into all monitor APIs instead of the
	  virDomainObjPtr instance.
	* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add thin
	  wrappers for all qemuMonitorXXX command APIs, calling into
	  qemu_monitor_text.c/h
	* src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h:
	  Rename qemuMonitor -> qemuMonitorText & update to accept
	  qemuMonitorPtr instead of virDomainObjPtr

2009-11-10  Daniel P. Berrange  <berrange@redhat.com>

	Move encryption lookup back into qemu driver file
	Decouple the monitor code from the virDomainDefPtr structure
	by moving the disk encryption lookup code back into the
	qemu_driver.c file. Instead provide a function callback to
	the monitor code which can be invoked to retrieve encryption
	data as required.

	* src/qemu/qemu_driver.c: Add findDomainDiskEncryption,
	  and findVolumeQcowPassphrase. Pass address of the method
	  findVolumeQcowPassphrase into qemuMonitorOpen()
	* src/qemu/qemu_monitor.c: Associate a disk
	  encryption function callback with the qemuMonitorPtr
	  object.
	* src/qemu/qemu_monitor_text.c: Remove findDomainDiskEncryption
	  and findVolumeQcowPassphrase.

2009-11-10  Daniel P. Berrange  <berrange@redhat.com>

	Make use of private data structure for monitor state
	Introduce a new qemuDomainObjPrivate object which is used to store
	the private QEMU specific data associated with each virDomainObjPtr
	instance. This contains a single member, an instance of the new
	qemuMonitorPtr object which encapsulates the QEMU monitor state.
	The internals of the latter are private to the qemu_monitor* files,
	not to be shown to qemu_driver.c

	* src/qemu/qemu_conf.h: Definition of qemuDomainObjPrivate.
	* src/qemu/qemu_driver.c: Register a functions for creating
	  and freeing qemuDomainObjPrivate instances with the domain
	  capabilities. Remove the qemudDispatchVMEvent() watch since
	  I/O watches are now handled by the monitor code itself. Pass
	  a new qemuHandleMonitorEOF() callback into qemuMonitorOpen
	  to allow notification when the monitor quits.
	* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Introduce
	  the 'qemuMonitor' object. Temporarily add new APIs
	  qemuMonitorWrite, qemuMonitorRead, qemuMonitorWaitForInput
	  to allow text based monitor impl to perform I/O.
	* src/qemu/qemu_monitor_text.c: Call APIs for reading/writing
	  to monitor instead of accessing the file handle directly.

2009-11-10  Daniel P. Berrange  <berrange@redhat.com>

	Move code for low level QEMU monitor interaction into separate file
	The qemu_driver.c code should not contain any code that interacts
	with the QEMU monitor at a low level. A previous commit moved all
	the command invocations out. This change moves out the code which
	actually opens the monitor device.

	* src/qemu/qemu_driver.c: Remove qemudOpenMonitor & methods called
	  from it.
	* src/Makefile.am: Add qemu_monitor.{c,h}
	* src/qemu/qemu_monitor.h: Add qemuMonitorOpen()
	* src/qemu/qemu_monitor.c: All code for opening the monitor

2009-11-10  Daniel P. Berrange  <berrange@redhat.com>

	Add a new timed condition variable wait API
	* src/util/threads.h, src/util/threads-pthread.c,
	  src/libvirt_private.syms: Add virCondWaitUntil()

	Fix errno handling for pthreads wrappers
	* src/util/threads-pthread.c: pthreads APIs do not set errno, instead
	  the return value is the positive errno. Set errno based on the return
	  value in the wrappers

	Make pciDeviceList struct opaque
	* src/util/pci.c, src/util/pci.h: Make the pciDeviceList struct
	  opaque to callers of the API. Add accessor methods for managing
	  devices in the list
	* src/qemu/qemu_driver.c: Update to use APIs instead of directly
	  accessing pciDeviceList fields

2009-11-10  Matthias Bolte  <matthias.bolte@googlemail.com>

	Add missing OOM error checks, reports and cleanups

2009-11-09  Matthew Booth  <mbooth@redhat.com>

	Add documentation for <channel> domain element
	* src/formatdomain.html.in: Add <channel> element documentation

	Separate character device doc guest and host parts
	* docs/formatdomain.html.in: refactors the existing character device
	  documentation to make it explicit which directives configure the guest
	  interface, and which configure the host interface.

2009-11-09  Gerhard Stenzel  <gerhard.stenzel@de.ibm.com>

	Removes the ebtablesSaveRules() function
	As it was basically unimplemented and more confusing than useful
	at the moment.
	* src/libvirt_private.syms: remove from internal symbols list
	* src/qemu/qemu_bridge_filter.c src/util/ebtables.c: remove code and
	  one use of the unimplemented function

2009-11-08  Matthias Bolte  <matthias.bolte@googlemail.com>

	opennebula: Fix potential memory/mutex leak in state driver startup
	In case of an error the domains hash and the driver mutex may leak.

	* src/opennebula/one_driver.c: free/destroy domains hash and driver
	  mutex in error cases

2009-11-08  Matthias Bolte  <matthias.bolte@googlemail.com>

	Add a Python example that lists active ESX domains
	It also demonstrates how to use the libvirt.openAuth() method.

	* examples/python/Makefile.am: add esxlist.py to EXTRA_DIST
	* examples/python/README: add some notes about esxlist.py
	* examples/python/esxlist.py: the new example

2009-11-07  Matthias Bolte  <matthias.bolte@googlemail.com>

	phyp: Use actual error code instead of 0

	phyp: Don't use VIR_ALLOC if a stack variable is good enough

	phyp: Fix several UUID table related problems
	- Make reading ID from file working for IDs > 127
	- Fix inverse error check for writing ID to file
	- Use feof() to distinguish EOF from real error of fread()
	- Don't interpret libssh2 error codes as number of bytes

	phyp: Check for exit_status < 0 before parsing the result

	phyp: memcpy/memmove/memset can't fail, so don't check for error
	Also reset UUID to all 0 instead of all 48 (== '0') in phypUUIDTable_RemLpar()

	phyp: Make generic domain listing functions return -1 in case of error
	phypNumDomainsGeneric() and phypListDomainsGeneric() return 0 in case
	of an error. This makes it impossible to distinguish between an actual
	error and no domains being defined on the hypervisor. It also turn the
	no domains situation into an error. Return -1 in case of an error to
	fix this problem.

	phyp: Break potential infinite loops

	phyp: Fix memory/session leaks and potential invalid frees

	Fix configure check for libssh2
	* configure.in: add -L$libssh2_path to LIBS for the AC_TRY_LINK check

2009-11-07  Daniel Veillard  <veillard@redhat.com>

	524280 pass max lease option to dnsmasq
	* src/network/bridge_driver.c: when exec'ing dnsmaq, if there are
	  DHCP ranges defined, then compute and pass the --dhcp-lease-max
	  deriving the maximum number of leases

	Store the range size when adding a DHCP range
	* src/conf/network_conf.h: extend the structure to store the range
	* src/conf/network_conf.c: before adding a range parse the IP addresses
	  do some checking and keep the size

	Repair getIPv4Addr after the ntohl conversion
	* src/util/network.c: getIPv4Addr() got broken when the input
	  network address value got converted from network to host byte order

2009-11-06  Cole Robinson  <crobinso@redhat.com>

	qemu: Allow cpu pinning for all logical CPUs, not just physical
	This is what virsh already expects when printing output, and what
	'man cpuset' claims to support.

	qemu: Use same create/define overwrite logic for migration prepare.

	qemu: Break out function to check if we can create/define/restore
	Use this function in the qemu, uml, lxc, and test drivers.

2009-11-06  Matthew Booth  <mbooth@redhat.com>

	Cleanup whitespace in docs
	This patch is the result of running the following command in the docs
	directory: sed -i 's/\t/        /g; s/\s*$//' *.html.in

	* docs/*.html.in:convert tabs into 8 spaces and remove trailing whitespace

2009-11-06  Matthew Booth  <mbooth@redhat.com>

	Use virBuffer when building QEMU char dev command line
	* src/qemu/qemu_conf.c: Update qemudBuildCommandLineChrDevStr to use a
	  virBuffer

	Cleanup virBuffer usage in qemdBuildCommandLine
	* src/qemu_qemu_conf.c: Cleanup usage of virBuffer in qemudBuildCommandLine

2009-11-06  Paolo Bonzini  <pbonzini@redhat.com>

	Add sentinel attribute for NULL terminated arg lists
	* src/internal.h (ATTRIBUTE_SENTINEL): New, it's a ggc feature and
	  protected as such
	* src/util/buf.c (virBufferStrcat): Use it.
	* src/util/ebtables.c (ebtablesAddRemoveRule): Use it.
	* src/util/iptables.c (iptableAddRemoveRule: Use it.
	* src/util/qparams.h (new_qparam_set, append_qparams): Use it.
	* docs/apibuild.py: avoid breaking the API generator with that new
	  internal keyword macro

2009-11-06  Cole Robinson  <crobinso@redhat.com>

	test: Update inactive guest config on shutdown
	This matches the expected behavior of state drivers such as QEMU.

	test: Add testDomainShutdownState helper
	Performs changes needed when stopping a VM (which are currently duplicated
	in several places, and forgotten in others).

2009-11-06  Paolo Bonzini  <pbonzini@redhat.com>

	Fix some cut-and-paste error in migration code
	* src/qemu/qemu_driver.c: in qemudDomainMigratePerform call
	  doPeer2PeerMigrate for VIR_MIGRATE_PEER2PEER.

2009-11-06  Matthew Booth  <mbooth@redhat.com>

	Properly convert port numbers to/from network byte order
	* src/util/network.c: Add htons and ntohs in virSocket(Get|Set)Port

2009-11-06  Eduardo Otubo  <otubo@linux.vnet.ibm.com>

	POWER add create() and destroy() support
	* src/phyp/phyp_driver.[ch]: add new entry points and a number of
	  cleanups

2009-11-05  Matthew Booth  <mbooth@redhat.com>

	Ensure guestfwd address is IPv4 and various cleanups
	* include/libvirt/virterror.h src/util/virterror.c: add a new error
	  VIR_ERR_CONFIG_UNSUPPORTED for valid but unsupported configuration options
	* src/conf/domain_conf.c: Throw an error if guestfwd address isn't IPv4
	  and cleanup a number of parsing return error values.

2009-11-05  Daniel Veillard  <veillard@redhat.com>

	Forgot test case on previous commit

2009-11-05  Matthew Booth  <mbooth@redhat.com>

	Support for <channel> in domain and QEmu backend
	allows the following to be specified in a domain:
	<channel type='pipe'>
	  <source path='/tmp/guestfwd'/>
	  <target type='guestfwd' address='10.0.2.1' port='4600'/>
	</channel>

	* proxy/Makefile.am: add network.c as dep of domain_conf.c
	* docs/schemas/domain.rng src/conf/domain_conf.[ch]: extend the domain
	  schemas and the parsing/serialization side for the new construct

	QEmu support will add the following on the qemu command line:
	 -chardev pipe,id=channel0,path=/tmp/guestfwd
	 -net user,guestfwd=tcp:10.0.2.1:4600-chardev:channel0

	* src/qemu/qemu_conf.c: Add argument output for channel
	* tests/qemuxml2(argv|xml)test.c: Add test for <channel> domain syntax

2009-11-05  Matthew Booth  <mbooth@redhat.com>

	Detect availability of QEMU -chardev CLI option
	* src/qemu/qemu_conf.h: defines a new QEMUD_CMD_FLAG_CHARDEV flag
	* src/qemu/qemu_conf.c: parse the output for -chardev and set flag
	  appropriately

2009-11-05  Matthew Booth  <mbooth@redhat.com>

	Allow character devices to have different target types
	A character device's target (it's interface in the guest) had only a
	single property: port. This patch is in preparation for adding targets
	which require other properties.
	Since this changes the conf type for character devices this affects
	a number of drivers:

	* src/conf/domain_conf.[ch] src/esx/esx_vmx.c src/qemu/qemu_conf.c
	  src/qemu/qemu_driver.c src/uml/uml_conf.c src/uml/uml_driver.c
	  src/vbox/vbox_tmpl.c src/xen/xend_internal.c src/xen/xm_internal.c:
	  target properties are moved into a union in virDomainChrDef, and a
	  targetType field is added to identify which union member should be
	  used. All current code which touches a virDomainChrDef is updated both
	  to use the new union field, and to populate targetType if necessary.

2009-11-05  Ryota Ozaki  <ozaki.ryota@gmail.com>

	LXC allow container to have ethN interfaces
	Current implementation of lxc driver creates vethN named
	interface(s) in the host and passes as it is to a container.
	The reason why it doesn't use ethN is due to the limitation
	that one namespace cannot have multiple iterfaces that have
	an identical name so that we give up creating ethN named
	interface in the host for the container.

	However, we should be able to allow the container to have
	ethN by changing the name after clone(CLONE_NEWNET).

	* src/lxc/lxc_container.c src/lxc/veth.c src/lxc/veth.h: do the clone
	  and then renames interfaces eth0 ... ethN to keep the interface names
	  familiar in the domain

2009-11-05  Ryota Ozaki  <ozaki.ryota@gmail.com>

	LXC cleanup deep indentation in lxcDomainSetAutostart
	* src/lxc/lxc_driver.c: refactor lxcDomainSetAutostart() to avoid deep
	  indentation of the code

	LXC messages cleanup and fix lxcError
	* src/lxc/lxc_container.c src/lxc/lxc_controller.c src/lxc/lxc_driver.c
	  src/lxc/veth.c: most of cleanups are just capitalizing their messages
	  though, some fixes wrong error messages and awkward indentations, and
	  improves error messages.

	LXC fix wrong or out-of-date function descriptions
	* src/lxc/lxc_container.c src/lxc/lxc_controller.c src/lxc/lxc_driver.c
	  src/lxc/veth.c: fix broken function comments

2009-11-05  Cole Robinson  <crobinso@redhat.com>

	docs: <clock> property is 'offset', not 'sync'

2009-11-04  Gerhard Stenzel  <gstenzel@linux.vnet.ibm.com>

	add MAC address based port filtering to qemu
	* src/qemu/qemu.conf src/qemu/qemu_conf.c src/qemu/qemu_conf.h: there is
	  a new config type option for mac filtering
	* src/qemu/qemu_bridge_filter.[ch]: new module for the ebtable entry points
	* src/qemu/qemu_driver.c: plug the MAC filtering at the right places
	  in the domain life cycle
	* src/Makefile.am po/POTFILES.in: add the new module

	New ebtables module wrapper
	* configure.in: look for ebtables binary location if present
	* src/Makefile.am: add the new module
	* src/util/ebtables.[ch]: new module and internal APIs around
	  the ebtables binary
	* src/libvirt_private.syms: export the symbols only internally

2009-11-04  Cole Robinson  <crobinso@redhat.com>

	test: Implement virDomainPinVcpu

	test: Implement virDomainGetVcpus

	test: Update vcpu runtime info in SetVcpus

	test: Use privateData to track running VM vcpu state

	test: Break out wrapper for setting up started domain state.
	This should be a no op for now, but we will use this function to set up
	transient state in the future.

	test: Fixes for SetVcpus
	- Implement DomainGetMaxVCPUs
	- Use GetMaxVCPUs to validate requested CPU amount
	- Deny the 'hotplug' for a running domain.

	qemu: Remove compiled out localhost migration support
	Pretty sure this would deadlock now that we have proper locking, so
	remove the code.

	storage: conf: Fix memory leak in encryption parsing

	Various error reporting fixes
	- Don't duplicate SystemError
	- Use proper error code in domain_conf
	- Fix a broken error call in qemu_conf
	- Don't use VIR_ERR_ERROR in security driver (isn't a valid code in this case)

2009-11-04  Cole Robinson  <crobinso@redhat.com>

	Improve error reporting for virConnectGetHostname calls
	All drivers have copy + pasted inadequate error reporting which wraps
	util.c:virGetHostname. Move all error reporting to this function, and improve
	what we report.

	Changes from v1:
	  Drop the driver wrappers around virGetHostname. This means we still need
	  to keep the new conn argument to virGetHostname, but I think it's worth
	  it.

2009-11-04  Laine Stump  <laine@laine.org>

	Fix improper error return in virInterfaceDefParseProtoIPvX
	* src/conf/interface_conf.c: the code was erronously returning -1
	  in the two functions if <dhcp> is not provided

	Make monitor type (miimon/arpmon) optional in bond xml
	* src/conf/interface_conf.c: lack of one of these in the live xml output
	  was causing the parse in virInterfaceDefParseBond() to fail

	Fix virInterfaceIpDefPtr leak during virInterfaceIpDefFree
	* src/conf/interface_conf.c: forgot to free the structure itself

	Support for IPv6 / multiple addresses per interfaces
	This patch updates the xml parsing and formatting, and the associated
	virInterfaceDef data structure to support IPv6, along the way adding
	support for multiple protocols per interface, and multiple IP
	addresses per protocol.
	* src/conf/interface_conf.[ch]: update the structures, code for parsing
	  and serialization

2009-11-04  Laine Stump  <laine@laine.org>

	Support reporting live interface IP/netmask
	This patch adds the flag VIR_INTERFACE_XML_INACTIVE to
	virInterfaceGetXMLDesc's flags. When it is*not* set (the default), the
	live interface info will be returned in the XML (in particular, the IP
	address(es) and netmask(s) will be retrieved by querying the interface
	directly, rather than  reporting what's in the config file). The
	backend of this is in netcf's ncf_if_xml_state() function.

	* configure.in libvirt.spec.in: requires netcf >= 0.1.3
	* include/libvirt/libvirt.h.in: adds flag VIR_INTERFACE_XML_INACTIVE
	* src/conf/interface_conf.c src/interface/netcf_driver.c src/libvirt.c:
	  update the parsing and backend routines accordingly
	* tools/virsh.c: change interface edit to inactive definition and
	  adds the inactive flag for interface dump

2009-11-04  Laine Stump  <laine@laine.org>

	Make startmode optional in toplevel interface definition
	The minimal XML returned from ncf_if_xml_state() doesn't contain this
	attribute (which makes no sense in the case of reporting current
	status of the interface), and it was preventing it from passing
	through the parse/format step.

	* src/conf/interface_conf.[ch]: add a new virInterfaceStartMode value
	  and modify loading/saving accordingly

2009-11-04  Daniel P. Berrange  <berrange@redhat.com>

	Move libvirtd event loop into background thread
	The virStateInitialize() call for starting up stateful drivers
	may require that the event loop is running already. This it is
	neccessary to start the event loop before this call. At the
	same time, network clients must not be processed until afte
	virStateInitialize has completed.

	The qemudListenUnix() and remoteListenTCP() methods must
	therefore not register file handle watches, merely open the
	network sockets & listen() on them. This means clients can
	connected and are queued, pending completion of initialization

	The qemudRunLoop() method is moved into a background thread
	that is started early to allow access to the event loop during
	driver initialization. The main process thread leader pretty
	much does nothing once the daemon is running, merely waits
	for the event loop thread to quit

	* daemon/libvirtd.c, daemon/libvirtd.h: Move event loop into
	  a background thread
	* daemon/THREADING.txt: Rewrite docs to better reflect reality

2009-11-04  Dan Kenigsberg  <danken@redhat.com>

	give up python interpreter lock before calling cb
	suggested by danpb on irc, patch by danken fixed for proper C syntax

	* python/libvirt-override.c: on event callback release the python
	  interpreter lock and take it again when coming back so that the
	  callback can reinvoke libvirt.

2009-11-03  Laine Stump  <laine@laine.org>

	Allow NULL mac address in virGetInterface
	There are places where an interface will not have a mac address, and netcf
	returns this as a NULL pointer rather than a pointer to an empty string.
	Rather than checking for this all over the place in libvirt, just save it
	in the virInterface object as an empty string.

	* src/datatypes.c: allow NULL mac in virGetInterface()

2009-11-03  Daniel Veillard  <veillard@redhat.com>

	Fix compilation problems
	introduced on commit 9231aa7d9563745c64e4f69afabca65d28bfae25
	* src/qemu/qemu_driver.c: in qemudRemoveDomainStatus fix a reference
	  to an undefined variable buf and free up an allocated string

2009-11-03  Chris Lalancette  <clalance@redhat.com>

	Fix up NLS warnings.
	When building with --disable-nls, I got a few messages like this:

	storage/storage_backend.c: In function 'virStorageBackendCreateQemuImg':
	storage/storage_backend.c:571: warning: format not a string literal and no format arguments

	Fix these up.

2009-11-03  Chris Lalancette  <clalance@redhat.com>

	Remove redundant virFileDeletePID() call
	qemudShutdownVMDaemon() calls qemudRemoveDomainStatus(), which
	then calls virFileDeletePID().  qemudShutdownVMDaemon() then
	unnecessarily calls virFileDeletePID() again.  Remove this second
	usage of it, and also slightly refactor qemudRemoveDomainStatus()
	to VIR_WARN appropriate error messages.

2009-11-03  Daniel P. Berrange  <berrange@redhat.com>

	Fix return value in virStateInitialize impl for LXC
	The LXC driver was mistakenly returning -1 for lxcStartup()
	in scenarios that are not an error. This caused the libvirtd
	to quit for unprivileged users. This fixes the return code
	of LXC driver, and also adds a "name" field to the virStateDriver
	struct and logging to make it easier to find these problems
	in the future

	* src/driver.h: Add a 'name' field to state driver to allow
	  easy identification during failures
	* src/libvirt.c: Log name of failed driver for virStateInit
	  failures
	* src/lxc/lxc_driver.c: Don't return a failure code for
	  lxcStartup() if LXC is not available on this host, simply
	  disable the driver.
	* src/network/bridge_driver.c, src/node_device/node_device_devkit.c,
	  src/node_device/node_device_hal.c, src/opennebula/one_driver.c,
	  src/qemu/qemu_driver.c, src/remote/remote_driver.c,
	  src/secret/secret_driver.c, src/storage/storage_driver.c,
	  src/uml/uml_driver.c, src/xen/xen_driver.c: Fill in name
	  field in virStateDriver struct

2009-11-03  Matthias Bolte  <matthias.bolte@googlemail.com>

	ESX: Fix memory leak in list handling functions.
	If an error occurs between the allocation of an item and appending it
	to the list, the item leaks. Free such orphaned items in error cases.

	* src/esx/esx_vi.c: free orphaned items in error cases

2009-11-03  Matthias Bolte  <matthias.bolte@googlemail.com>

	ESX: Don't automatically follow redirects.
	The default transport for the VI API is HTTPS. If the server redirects
	from HTTPS to HTTP the driver would silently follow that redirection.
	The user assumes to communicate with the server over a secure transport
	but isn't.

	This patch disables automatical redirection following. The driver reports
	an error if the server tries to redirect.

	* src/esx/esx_vi.c: refactor the call to curl_easy_perform() into a
	  function and do error handling there, disable automatical redirection
	  following for curl
	* src/esx/esx_vi.h: change the type of responseCode to int

2009-11-03  Matthias Bolte  <matthias.bolte@googlemail.com>

	ESX: Unify naming of VI API utility and convenience functions.
	Unified function naming scheme:
	- 'lookup' functions query the ESX or vCenter for information
	- 'get' functions return information from a local object

	* src/esx/esx_driver.c, src/esx/esx_vi.[ch]: unify function naming

2009-11-03  Matthias Bolte  <matthias.bolte@googlemail.com>

	ESX: Change disk selection for datastore detection.
	In order to register a new virtual machine the ESX driver needs to upload
	a VMX file to a datastore. Try to put this file beside the main VMDK file
	of the virtual machine. Change the disk selection for datastore detection
	to choose the first file-based harddisk instead of just the first disk.
	The first disk may be a CDROM disk and ISO images are normaly not located
	in the virtual machine's directory.

	* src/esx/esx_driver.c: change disk selection for datastore detection

2009-11-03  Matthias Bolte  <matthias.bolte@googlemail.com>

	ESX: Fallback to the preliminary name if the datastore cannot be found.
	This allows to use domain-xml-from-native with VMX files that reference
	unavailable datastores.

	* src/esx/esx_vmx.c: fallback to the preliminary name if the datastore
	  cannot be found

2009-11-03  Daniel P. Berrange  <berrange@redhat.com>

	Rename internal APis
	Rename virDomainIsActive to virDomainObjIsActive, and
	virInterfaceIsActive to virInterfaceObjIsActive and finally
	virNetworkIsActive to virNetworkObjIsActive.

	* src/conf/domain_conf.c, src/conf/domain_conf.h,
	  src/conf/interface_conf.h, src/conf/network_conf.c,
	  src/conf/network_conf.h, src/lxc/lxc_driver.c,
	  src/network/bridge_driver.c, src/opennebula/one_driver.c,
	  src/openvz/openvz_driver.c, src/qemu/qemu_driver.c,
	  src/test/test_driver.c, src/uml/uml_driver.c: Update for
	  renamed APIs.

2009-11-03  Matthew Booth  <mbooth@redhat.com>

	Fix --with-init-script configure option
	* configure.in daemon/Makefile.am: the --with-init-script configure
	  option was broken, and always defaulted based on the existence of
	  /etc/redhat-release. This was a systematic typo based on
	  mixed use of init-script and init-scripts.

2009-11-03  Daniel P. Berrange  <berrange@redhat.com>

	Don't let parent of daemon exit until basic initialization is done
	The daemonizing code lets the parent exit almost immediately. This
	means that it may think it has successfully started even when
	important failures occur like not being able to acquire the PID
	file. It also means network sockets are not yet open.

	To address this when daemonizing the parent passes an open pipe
	file descriptor to the child. The child does its basic initialization
	and then writes a status code to the pipe indicating either success,
	or failure. This ensures that when daemonizing, the parent does not
	exit until the pidfile is acquired & basic network sockets are open.

	Initialization of the libvirt drivers is still done asynchronously
	since this may take a very long time.

	* daemon/libvirtd.c: Force parent to stay around until basic config
	  file, pidfile & network socket init is completed

2009-11-03  Daniel P. Berrange  <berrange@redhat.com>

	Pull signal setup code out into separate method
	* daemon/libvirtd.c: Introduce a daemonSetupSignals() method
	  and put all signal handling code there
	* daemon/libvirtd.h: Add sigread/sigwrite to qemud_server type

2009-11-03  Yuji NISHIDA  <nishidy@nict.go.jp>

	Set KMEMSIZE for OpenVZ domains being defined
	* src/openvz/openvz_driver.c: add a new openvzDomainSetMemoryInternal()
	  function, used to initialize the KMEMSIZE parameter of a container.

2009-11-03  Daniel P. Berrange  <berrange@redhat.com>

	Fix duplicating logging of errors in libvirtd
	The libvirt default error handling callback will print all errors
	to stderr. The libvirtd default logging callback will do the same.
	Set a no-op error handling callback in libvirtd to prevent this
	duplication

	* daemon/libvirtd.c: Register a no-op error handling function

2009-11-03  Daniel P. Berrange  <berrange@redhat.com>

	Fix initialization order bugs
	virInitialize must be the first libvirt function called to ensure
	threads, error handling & random number generator are all setup.

	Move UNIX socket directory permissions change to place of use

2009-11-03  Daniel P. Berrange  <berrange@redhat.com>

	Misc cleanup to network socket init
	* daemon/libvirtd.c: Change qemudNetworkInit() so that it doesn't try
	to free its argument, leaving the caller todo cleanup as is normal
	practice. Add missing policykit cleanup to qemudCleanup, and remove
	server watch if set. Remove duplicated call to listen() on TCP sockets

2009-11-03  Daniel P. Berrange  <berrange@redhat.com>

	Annotate many methods with ATTRIBUTE_RETURN_CHECK & fix problems
	Nearly all of the methods in src/util/util.h have error codes that
	must be checked by the caller to correct detect & report failure.
	Add ATTRIBUTE_RETURN_CHECK to ensure compile time validation of
	this

	* daemon/libvirtd.c: Add explicit check on return value of virAsprintf
	* src/conf/domain_conf.c: Add missing check on virParseMacAddr return
	  value status & report error
	* src/network/bridge_driver.c: Add missing OOM check on virAsprintf
	  and report error
	* src/qemu/qemu_conf.c: Add missing check on virParseMacAddr return
	  value status & report error
	* src/security/security_selinux.c: Remove call to virRandomInitialize
	  that's done in libvirt.c already
	* src/storage/storage_backend_logical.c: Add check & log on virRun
	  return status
	* src/util/util.c: Add missing checks on virAsprintf/Run status
	* src/util/util.h: Annotate all methods with ATTRIBUTE_RETURN_CHECK
	  if they return an error status code
	* src/vbox/vbox_tmpl.c: Add missing check on virParseMacAddr
	* src/xen/xm_internal.c: Add missing checks on virAsprintf
	* tests/qemuargv2xmltest.c: Remove bogus call to virRandomInitialize()

2009-11-03  Daniel P. Berrange  <berrange@redhat.com>

	Allow for a driver specific private data blob in virDomainObjPtr
	The virDomainObjPtr object stores state about a running domain.
	This object is shared across all drivers so it is not appropriate
	to include driver specific state here. This patch adds the ability
	to request a blob of private data per domain object instance. The
	driver must provide a allocator & deallocator for this purpose

	THis patch abuses the virCapabilitiesPtr structure for storing the
	allocator/deallocator callbacks, since it is already being abused
	for other internal things relating to parsing. This should be moved
	out into a separate object at some point.

	* src/conf/capabilities.h: Add privateDataAllocFunc and
	  privateDataFreeFunc fields
	* src/conf/domain_conf.c: Invoke the driver allocators / deallocators
	  when creating/freeing virDomainObjPtr instances.
	* src/conf/domain_conf.h: Pass virCapsPtr into virDomainAssignDef
	  to allow access to the driver specific allocator function
	* src/lxc/lxc_driver.c, src/opennebula/one_driver.c,
	  src/openvz/openvz_driver.c, src/qemu/qemu_driver.c,
	  src/test/test_driver.c, src/uml/uml_driver.c: Update for
	  change in virDomainAssignDef contract

2009-11-02  Matthias Bolte  <matthias.bolte@googlemail.com>

	Don't use private struct member names of in6_addr
	__in6_u.__u6_addr16 is the private name for this struct member,
	s6_addr16 is the public one
	* src/util/network.c: dont use the private field, but the public one.

2009-11-02  Matthew Booth  <mbooth@redhat.com>

	More network utility functions
	* src/util/network.[ch] Add functions for address->text and get/set
	  port number
	* src/libvirt_private.syms: add new entry points

2009-10-30  Matthew Booth  <mbooth@redhat.com>

	Fix typo in network.c function comments
	* src/util/network.c: fix a few typo

2009-10-30  Daniel Veillard  <veillard@redhat.com>

	Add symbols from new network.h module
	* src/libvirt_private.syms: keep all symbols from network.h private

	Set of new network related utilities
	* src/util/network.h src/util/network.c: utilities to parse network
	  addresses, check netmask and compute ranges

2009-10-30  Pritesh Kothari  <Pritesh.Kothari@Sun.COM>

	Fix configure detection of device mapper
	* configure.in: the PKG_CHECK_MODULES() for it would not work on
	  Ubuntu and SuSE, so add a direct check fallback

2009-10-30  Daniel Veillard  <veillard@redhat.com>

	Remote code caught EINTR making it ininterruptable
	John Levon raised the issue that remoteIOEventLoop() poll call was
	reissued after EINTR was caught making it uninterruptible.
	* src/remote/remote_driver.c: catch EAGAIN instead as suggested by
	  Richard Jones

2009-10-29  Daniel P. Berrange  <berrange@redhat.com>

	Convert virDomainObjListPtr to use a hash of domain objects
	The current virDomainObjListPtr object stores domain objects in
	an array. This means that to find a particular objects requires
	O(n) time, and more critically acquiring O(n) mutex locks.

	The new impl replaces the array with a virHashTable, keyed off
	UUID. Finding a object based on UUID is now O(1) time, and only
	requires a single mutex lock. Finding by name/id is unchanged
	in complexity.

	In changing this, all code which iterates over the array had
	to be updated to use a hash table iterator function callback.
	Several of the functions which were identically duplicating
	across all drivers were pulled into domain_conf.c

	* src/conf/domain_conf.h, src/conf/domain_conf.c: Change
	  virDomainObjListPtr to use virHashTable. Add a initializer
	  method virDomainObjListInit, and rename virDomainObjListFree
	  to virDomainObjListDeinit, since its not actually freeing
	  the container, only its contents. Also add some convenient
	  methods virDomainObjListGetInactiveNames,
	  virDomainObjListGetActiveIDs and virDomainObjListNumOfDomains
	  which can be used to implement the correspondingly named
	  public API entry points in drivers
	* src/libvirt_private.syms: Export new methods from domain_conf.h
	* src/lxc/lxc_driver.c, src/opennebula/one_driver.c,
	  src/openvz/openvz_conf.c, src/openvz/openvz_driver.c,
	  src/qemu/qemu_driver.c, src/test/test_driver.c,
	  src/uml/uml_driver.c, src/vbox/vbox_tmpl.c: Update all code
	  to deal with hash tables instead of arrays for domains

2009-10-29  Mark McLoughlin  <markmc@redhat.com>

	libvirt-devel should only require libvirt-client
	There's a long known issue where if you install libvirt in a guest,
	the default virtual network will conflict with the default virtual
	network in the host.

	That's one of the reasons we have the libvirt-client RPM - it allows
	you to install the client library without having the host side
	installed.

	Rich Jones points out that if you install libvirt-devel in a guest,
	then you get libvirtd installed and the network conflict:

	  https://bugzilla.redhat.com/531200

	libvirt-devel should only require libvirt-client - e.g. nothing in
	the devel package pertains to anything in the libvirt RPM. The Fedora
	packaging guidelines say:

	  https://fedoraproject.org/wiki/Packaging/Guidelines#Devel_Packages

	  Devel packages must require the base package using a fully versioned
	  dependency ...

	But for all intents and purposes, libvirt-client is our base RPM.

	* libvirt.spec.in: make libvirt-devel require libvirt-client

2009-10-28  Cole Robinson  <crobinso@redhat.com>

	virterror: Add a missing 'break' for VIR_ERR_INVALID_SECRET

	qemu: migrate: Don't require manual URI to specify a port
	The xen driver will generate a migration port if only a hostname is passed
	in the optional migrate URI, so let's do the same in qemu.

	Fix p2p migration without a passed uri.

	qemu: Fix an error message in GetVcpus

	test: Support virStorageFindPoolSources
	The results are hardcoded into the test driver, no option to read from a
	testfile is implemented at this time.

	storage: Add ParseSourceString function for use with FindPoolSources.
	This will simplify adding FindPoolSources support to more pool backends in
	the future (as well as the test driver).

	storage: Break out function to add pool source to a SourceList.
	Similar in theory to *AssignDef type functions, this duplicate functionality
	will be used by an future FindPoolSources implementations.

	storage: Break out pool source parsing to a separate function.
	We need to parse a source XML block for FindPoolSources, so this is a step
	in sharing the parsing. The new storage pool XML 2 XML tests cover this area
	pretty well to ensure we aren't causing regressions.

2009-10-28  Chris Lalancette  <clalance@redhat.com>

	Update the documentation for virDomainMigrateToURI

2009-10-28  Paolo Bonzini  <pbonzini@redhat.com>

	Add support for an external TFTP boot server
	This patch adds an optional attribute to the <bootp> tag, that
	allows to specify a TFTP server address other than the address of
	the DHCP server itself.

	This can be used to forward the BOOTP settings of the host down to the
	guest.  This is something that configurations such as Xen's default
	network achieve naturally, but must be done manually for NAT.

	* docs/formatnetwork.html.in: Document new attribute.
	* docs/schemas/network.rng: Add it to schema.
	* src/conf/network_conf.h: Add it to struct.
	* src/conf/network_conf.c: Add it to parser and pretty printer.
	* src/network/bridge_driver.c: Put it in the dnsmasq command line.
	* tests/networkxml2xmlin/netboot-proxy-network.xml
	  tests/networkxml2xmlout/netboot-proxy-network.xml
	  tests/networkxml2xmltest.c: add new tests

2009-10-27  Cole Robinson  <crobinso@redhat.com>

	test: Support virNodeDeviceCreate and virNodeDeviceDestroy

2009-10-27  Dan Kenigsberg  <danken@redhat.com>

	Fix some typos in comments

2009-10-27  Matthias Bolte  <matthias.bolte@googlemail.com>

	Fix problems in the Xen inotify driver.
	In xenInotifyXendDomainsDirLookup() the wrong UUID variable is used
	to search in the config info list.

	In xenInotifyEvent() the event is dispatched if it's NULL.

	Both were introduced in bc898df2c74fe3c8efedfbbd430737bac950e65e.

2009-10-27  Matthias Bolte  <matthias.bolte@googlemail.com>

	Fix error message in qemudLoadDriverConfig()
	* src/qemu/qemu_conf.c: change the error message to refer to
	  'cgroup_controllers' instead of 'cgroup_device_acl'

2009-10-26  Chris Lalancette  <clalance@redhat.com>

	Add a new syntax-check rule for gethostname.
	We should always be using virGetHostname in place of
	gethostname; thus add in a new syntax-check rule to make
	sure no new uses creep in.

	Various syntax-check fixes.
	Make a pass over the syntax-check files, tightening up regex's,
	un-ignoring certain files, and cleaning things up.

	Tighten up nonreentrant syntax-check.
	We can slightly tighten up the regex's used to detect the use of
	nonreentrant functions.  We can also check src/util/virterror.c
	by modifying a comment; I think it's worth it to get the additional
	coverage.

	Replace a gethostname by virGetHostname in libvirtd.c

	Replace two strcmp() by STREQ() in qemu_driver.c

	Replace gethostname by virGetHostname in xend_internal.c

	Remove a completely bogus reference increment in the Xen driver.
	xenUnifiedDomainEventRegister() calls out to
	virDomainEventCallbackListAdd(), which increments the reference
	count on the connection.  That is fine, but then
	xenUnifiedDomainEventRegister() increments the usage count again,
	leading to a usage count leak.  Remove the increment in the xen
	register, and the UnrefConnect in the xen unregister.

	Add a default log_level to qemudSetLogging to remove a build warning.
	(original patch from Charles Duffy)

	Better error message when libvirtd fails to start.

2009-10-22  Matthias Bolte  <matthias.bolte@googlemail.com>

	Fix potential false-positive OOM error reporting.
	If no matching device was found (cap == NULL) then no strdup() call
	was made and *wwnn and *wwpn are untouched. Checking them for NULL
	in this situation may result in reporting an false-positive OOM error
	because *wwnn and *wwpn may be initialized to NULL by the caller.

	Only check *wwnn and *wwpn for NULL if a matching device was found
	(cap != NULL) and thus strdup() was called.

	* src/conf/node_device_conf.c: only report an OOM error if there
	  really is one

2009-10-22  Daniel Veillard  <veillard@redhat.com>

	Consolidate virXPathNodeSet()
	virXPathNodeSet() could return -1 when doing an evaluation failure
	due to xmlXPathEval() from libxml2 behaviour.
	* src/util/xml.c: make sure we always return 0 unless the returned
	  XPath type is of the wrong type (meaning the query passed didn't
	  evaluate to a node set and code must be fixed)

2009-10-21  Richard Jones  <rjones@redhat.com>

	Support QEMU watchdog device.
	This adds simple support for configuring a guest with a QEMU/KVM
	virtual hardware watchdog device.

2009-10-21  Dan Kenigsberg  <danken@redhat.com>

	Do not log rotate very small logs
	Without this, after few weeks without use, each defined domain grows a
	tail of empty gzipped logs, instead of keeping just the last log of
	interest.

	* daemon/libvirtd.logrotate.in: only rotate when the log is over 100 KBytes

2009-10-21  Daniel Veillard  <veillard@redhat.com>

	528575 avoid libvirtd crash on LCX domain autostart
	https://bugzilla.redhat.com/show_bug.cgi?id=528575
	virsh -c lxc:/// autostart vm1
	was crashing the daemon

	* src/lxc/lxc_conf.h src/lxc/lxc_conf.c: initialize the driver
	  autostartDir to avoid a NULL reference and implement autostart for LXC

2009-10-21  Jim Fehlig  <jfehlig@novell.com>

	Fix virsh.c compilation warning
	* tools/virsh.c: call to vshError() containing 'doexit' parameter
	  sneaked in after said parameter was removed

	Fix SELinux linking issues
	* src/Makefile.am: add selinux CFLAGS and linker flags to security driver

2009-10-21  Ryota Ozaki  <ozaki.ryota@gmail.com>

	LXC implement missing macaddr assignment feature
	Currently MAC address configuration of container veth is just ignored.
	This patch implements the missing feature.

	* src/lxc/veth.c, src/lxc/veth.h: add setMacAddr
	* src/lxc/lxc_driver.c: set macaddr of container veth if specified

2009-10-21  Daniel Veillard  <veillard@redhat.com>

	Fix a make dist error due to wrong EXTRA_DIST paths
	* tests/Makefile.am: networkpoolxml2xmlout and networkpoolxml2xmlin are
	  really networkxml2xmlout and networkxml2xmlin

2009-10-21  Cole Robinson  <crobinso@redhat.com>

	node device: Break out get_wwns and get_parent_node helpers
	These will be used by the test driver, so move them to a shareable space.

	node device: Fix locking issue in virNodeDeviceDestroy
	Certain error paths won't unlock the node device object.

2009-10-21  Cole Robinson  <crobinso@redhat.com>

	tests: Centralize VIR_TEST_DEBUG lookup, and document it
	Provide a simple interface for other tests to lookup the testDebug variable.
	Also remove a redundant error message in interface tests.

	If anyone feels inclined to change this env variable to match the existing
	LIBVIRT_* format, it should now be easier to do so.

2009-10-21  Cole Robinson  <crobinso@redhat.com>

	tests: Initialize virRandom in for test suite.
	Otherwise any virRandom calls will result in a segfault.

2009-10-19  Daniel P. Berrange  <berrange@redhat.com>

	Remove bogus const annotations to hash iterator
	Most of the hash iterators need to modify either payload of
	data args. The const annotation prevents this.

	* src/util/hash.h, src/util/hash.c: Remove const-ness from
	  virHashForEach/Iterator
	* src/xen/xm_internal.c: Remove bogus casts

2009-10-19  Dan Kenigsberg  <danken@redhat.com>

	fix virDomainMigrateToURI doc
	* src/libvirt.c: remove reverences to non existent dconn parameter
	  when using that entry point.

2009-10-19  Ryota Ozaki  <ozaki.ryota@gmail.com>

	LXC fix virCgroupGetValueStr problem with \n
	A cgroup file returns integer value terminated with '\n' and remaining
	it has sometimes harmful effects, for example it leads virStrToLong_ull
	to fail.
	* src/util/cgroup.c: strip out terminating \n when reading a value

2009-10-17  Matthias Bolte  <matthias.bolte@googlemail.com>

	Remove bashisms from schema tests.
	Introduced in commit 39a7be470cc5477a96a4d53194291bf4c7b07185.

	* tests/*schematest: replace 'source' with '.'
	* tests/schematestutils.sh: remove 'function' keyword and add '()'

2009-10-16  Cole Robinson  <crobinso@redhat.com>

	tests: Add storage volume XML 2 XML tests.

	tests: Add network XML to XML tests.

	schema: Update network schema.
	Make things a bit more readable, and properly handle forward mode 'route'.

	tests: Add XML 2 XML tests for storage pools.
	Move existing schema data to an input directory. Add extra files for more
	thorough XML testing.

	tests: Break out duplicate schema verification functionality.
	All schema tests have identical functionality, so avoid the duplication.

	tests: Fix text output for interface XML 2 XML

2009-10-15  Mark McLoughlin  <markmc@redhat.com>

	Don't copy old machines from a domain which has none
	If the the qemu and kvm binaries are the same, we don't include machine
	types in the kvm domain info.

	However, the code which refreshes the machine types info from the
	previous capabilities structure first looks at the kvm domain's info,
	finds it matches and then copies the empty machine types list over
	for the top-level qemu domain.

	That doesn't make sense, we shouldn't copy an empty machin types list.

	* src/qemu/qemu_conf.c: qemudGetOldMachinesFromInfo(): don't copy an
	  empty machine types list.

2009-10-15  Laine Stump  <laine@laine.org>

	Avoid crash in virBufferEscapeString
	* src/util/buf.c: if virBufferEscapeString was called on a buffer that
	  had 0 bytes of space, a size of -1 will be passed to snprintf, resulting
	  in a segmentation fault, this preallocate some space.

2009-10-14  Jim Fehlig  <jfehlig@novell.com>

	Add ocfs2 to list of fs pool types
	* src/conf/storage_conf.c src/conf/storage_conf.h: extend the enums
	  and values
	* docs/schemas/storagepool.rng: add to the list of storage pool type
	  formats

2009-10-14  Ryota Ozaki  <ozaki.ryota@gmail.com>

	LXC complement PATH environment variable
	* src/lxc/lxc_driver.c: without PATH, the controller will definitely
	  fail to call ip command

2009-10-14  Chris Lalancette  <clalance@redhat.com>

	Finer grained migration control
	Normally, when you migrate a domain from host A to host B,
	the domain on host A remains defined but shutoff and the domain
	on host B remains running but is a "transient".  Add a new
	flag to virDomainMigrate() to allow the original domain to be
	undefined on source host A, and a new flag to virDomainMigrate() to
	allow the new domain to be persisted on the destination host B.

2009-10-14  Daniel Veillard  <veillard@redhat.com>

	Release of 0.7.2

	Fixing ca.po

	Updated and regenerated localizations
	* de.po ja.po it.po hi.po gu.po or.po mr.po ml.po kn.po ru.po pl.po
	  pa.po te.po ta.po: many updates

2009-10-13  Cole Robinson  <crobinso@redhat.com>

	network: Fix printing XML 'delay' attribute
	When specifying bridge delay via network XML define, we were looking for
	the 'delay' attribute, but would dump the value as 'forwardDelay'. Have
	the output match the expected input (and schema).

2009-10-13  Daniel P. Berrange  <berrange@redhat.com>

	Fix virFileReadLimFD/virFileReadAll to handle EINTR
	The fread_file_lim() function uses fread() but never handles
	EINTR results, causing unexpected failures when reading QEMU
	help arg info. It was unneccessarily using FILE * instead
	of plain UNIX file handles, which prevented use of saferead()

	* src/util/util.c: Switch fread_file_lim over to use saferead
	  instead of fread, remove FILE * use, and rename

2009-10-13  Cole Robinson  <crobinso@redhat.com>

	storage: Fix generating iscsi 'auth' xml
	We were missing a closing tag, so the XML wasn't proper.

	schema: Update storage pool schema.
	- mpath pools weren't listed
	- scsi pools were missing an adapter section
	- iscsi pools were missing an auth section
	- Logical pools do not require a source name to be specified

2009-10-13  Cole Robinson  <crobinso@redhat.com>

	remote: Don't print a warning every time a remote call fails
	$ sudo virsh pool-start idontexist
	10:58:18.716: warning : processCallDispatchReply:7612 : Method call error
	error: failed to get pool 'idontexist'
	error: Storage pool not found: no pool with matching name 'idontexist'

	That warning doesn't server much purpose being printed via a virsh call. So
	remove the message.

2009-10-13  Cole Robinson  <crobinso@redhat.com>

	storage: Report errors in FindPoolSources

	test: Activate interfaces specified through driver config file.
	This matches the behavior of domains, storage, etc. Also, fix up some
	whitespace issues in the area.

2009-10-13  Daniel P. Berrange  <berrange@redhat.com>

	Fix QEMU restore from file in raw format
	The logic for running the decompression programs was broken in
	commit f238709304f9f6c57204cdd943e542cbae38fa5f, so that for
	non-raw formats the decompression program was never run, and
	for raw formats, it tried to exec an argv[] with initial NULL
	in the program name.

	* src/qemu/qemu_driver.c: Fix logic in runing decompression program

2009-10-13  Ryota Ozaki  <ozaki.ryota@gmail.com>

	LXC fix return code handling in lxcVmStart
	In lxcVmStart we first should not reuse rc for another purpose
	than the return value.

	* src/lxc/lxc_driver.c: don't reuse rc for local procedure calls

2009-10-13  Daniel Veillard  <veillard@redhat.com>

	Add a target for libvirt.devhelp
	* docs/Makefile.am: the lack of a target for devhelp/libvirt.devhelp
	  broke 'make dist'

	Fix a missing % on endif in spec file
	* libvirt.spec.in: missing % broke 'make rpm'

2009-10-12  Mark McLoughlin  <markmc@redhat.com>

	Take domain type into account when looking up default machine
	If one has e.g.

	  <guest>
	    <os_type>hvm</os_type>
	    <arch name='x86_64'>
	      <wordsize>64</wordsize>
	      <emulator>/usr/bin/qemu-system-x86_64</emulator>
	      <machine>pc-0.11</machine>
	      <machine canonical='pc-0.11'>pc</machine>
	      <machine>pc-0.10</machine>
	      <machine>isapc</machine>
	      <domain type='qemu'>
	      </domain>
	      <domain type='kvm'>
	        <emulator>/usr/bin/kvm</emulator>
	        <machine>pc</machine>
	        <machine>isapc</machine>
	      </domain>
	    </arch>
	  </guest>

	and start a guest with:

	  <domain type='kvm'>
	    ...
	    <os>
	      <type arch='x86_64'>hvm</type>
	      ...
	    </os>
	  </domain>

	then the default machine type should be 'pc' and not 'pc-0.11'

	Issue was reported by Anton Protopopov.

	* src/capabilities.[ch]: pass the domain type to
	  virCapabilitiesDefaultGuestArch() and use it to look up the default
	  machine type from a specific guest domain if needed.

	* src/conf/domain_conf.c, src/xen/xm_internal.c: update

	* tests/qemuxml2argvdata/qemuxml2argv-machine-aliases2.xml: update
	  the domain type to 'kvm' and remove the machine type to check
	  that the default gets looked up correctly

2009-10-12  Mark McLoughlin  <markmc@redhat.com>

	Fix schema to allow missing machine type
	The domain/os/type element may have an arch specified without having
	a machine variant specified. In fact, this is what python-virtinst
	does when defining a guest.

	* docs/schemas/domain.rng: allow missing machine type

2009-10-09  Daniel P. Berrange  <berrange@redhat.com>

	Rewrite example domain events programm for python
	The existing python demo for domain events does not fully
	implement the event loop contract. This makes the code useless
	for real world applications. This change re-writes the demo so
	that it has a full event loop implementation which is suitable
	for application usage & better demonstrates integration

	* examples/domain-events/events-python/event-test.py: Rewrite
	  to include a real world usable event loop implementation

2009-10-09  Daniel P. Berrange  <berrange@redhat.com>

	Remove some auto-generated files
	Removes some auto-generated files still under version control.
	It also moves the rule for generating NEWS into the Makefile.am
	that's in the same directory as the output file to avoid confusion

	* docs/libvirt-api.xml, docs/libvirt-refs.xml, NEWS: Remove
	  auto-generated files from source control
	* Makefile.am: Add rule for generating NEWS file
	* docs/Makefile.am: Remove rule for generating NEWS file

2009-10-09  Daniel P. Berrange  <berrange@redhat.com>

	Support a new peer-to-peer migration mode & public API
	Introduces several new public API options for migration

	 - VIR_MIGRATE_PEER2PEER: With this flag the client only
	   invokes the virDomainMigratePerform method, expecting
	   the source host driver to do whatever is required to
	   complete the entire migration process.
	 - VIR_MIGRATE_TUNNELLED: With this flag the actual data
	   for migration will be tunnelled over the libvirtd RPC
	   channel. This requires that VIR_MIGRATE_PEER2PEER is
	   also set.
	 - virDomainMigrateToURI: This is variant of the existing
	   virDomainMigrate method which does not require any
	   virConnectPtr for the destination host. Given suitable
	   driver support, this allows for all the same modes as
	   virDomainMigrate()

	The URI for VIR_MIGRATE_PEER2PEER must be a valid libvirt
	URI. For non-p2p migration a hypervisor specific migration
	URI is used.

	virDomainMigrateToURI without a PEER2PEER flag is only
	support for Xen currently, and it involves XenD talking
	directly to XenD, no libvirtd involved at all.

	* include/libvirt/libvirt.h.in: Add VIR_MIGRATE_PEER2PEER
	  flag for migration
	* src/libvirt_internal.h: Add feature flags for peer to
	  peer migration (VIR_FEATURE_MIGRATE_P2P) and direct
	  migration (VIR_MIGRATE_PEER2PEER mode)
	* src/libvirt.c: Implement support for VIR_MIGRATE_PEER2PEER
	  and virDomainMigrateToURI APIs.
	* src/xen/xen_driver.c: Advertise support for DIRECT migration
	* src/xen/xend_internal.c: Add TODO item for p2p migration
	* src/libvirt_public.syms: Export virDomainMigrateToURI
	  method
	* src/qemu/qemu_driver.c: Add support for PEER2PEER and
	  migration, and adapt TUNNELLED migration.
	* tools/virsh.c: Add --p2p and --direct args and use the
	  new virDomainMigrateToURI method where possible.

2009-10-09  Daniel P. Berrange  <berrange@redhat.com>

	Re-arrange doTunnelMigrate to simplify cleanup code
	Re-arrange the doTunnelMigrate method putting all non-QEMU local
	state setup steps first. This maximises chances of success before
	then starting destination QEMU for receiving incoming migration.
	Altogether this can reduce the number of goto cleanup labels to
	something more managable.

	* qemu/qemu_driver.c: Re-order steps in doTunnelMigrate

2009-10-09  Daniel P. Berrange  <berrange@redhat.com>

	Separate out code for sending tunnelled data
	Simplify the doTunnelMigrate code by pulling out the code for
	sending all tunnelled data into separate helper

	* qemu/qemu_driver.c: introduce doTunnelSendAll() method

2009-10-09  Daniel P. Berrange  <berrange@redhat.com>

	Pull connection handling code out of doTunnelMigrate
	Simplify the doTunnelMigrate() method by pulling out the code
	which opens/closes the virConnectPtr  object into a parent
	method

	* qemu/qemu_driver.c: Add doPeer2PeerMigrate which then calls
	  doTunnelMigrate with dconn & dom_xml

2009-10-09  Daniel P. Berrange  <berrange@redhat.com>

	Fix stream abort upon I/O failure during migration
	virStreamAbort is needed when the caller wishes to terminate
	the stream early, not when virStreamSend fails.

	* qemu/qemu_driver.c: Fix calling of virStreamAbort during
	  tunnelled migration

2009-10-09  Daniel P. Berrange  <berrange@redhat.com>

	Refactor native QEMU migration code
	The code for tunnelled migration was added in a dedicated method,
	but the native migration code is still inline in the top level
	qemudDomainMigratePerform() API. Move the native code out into
	a dedicated method too to make things more maintainable.

	* src/qemu/qemu_driver.c: Pull code for performing a native
	  QEMU migration out into separate method

2009-10-09  Daniel P. Berrange  <berrange@redhat.com>

	Don't force dconn to be NULL in virDomainMigrate
	The code for tunnelled migration wierdly required the app to pass
	a  NULL 'dconn' parameter, only to have to use virConnectOpen
	itself shortly thereafter to get a 'dconn' object. Remove this
	bogus check & require the app to always pas 'dconn' as before

	* src/libvirt.c: Require 'dconn' for virDomainMigrate calls again
	  and remove call to virConnectOpen

2009-10-09  Daniel P. Berrange  <berrange@redhat.com>

	Remove unneccessary uri_in parameter from virMigratePrepareTunnel
	Since virMigratePrepareTunnel() is used for migration over the
	native libvirt connection, there is never any need to pass the
	target URI to this method.

	* daemon/remote.c, src/driver.h, src/libvirt.c, src/libvirt_internal.h,
	  src/qemu/qemu_driver.c, src/remote/remote_driver.c,
	  src/remote/remote_protocol.c, src/remote/remote_protocol.h,
	  src/remote/remote_protocol.x: Remove 'uri_in' parameter from
	  virMigratePrepareTunnel() method

2009-10-09  Daniel P. Berrange  <berrange@redhat.com>

	Move the VIR_DRV_FEATURE* constants
	Move the VIR_DRV_FEATURE* constants into libvirt_internal.h
	since these flags are indicating whether  APIs in the
	libvirt_internal.h file are supported by a driver

	* src/driver.h: Remove VIR_DRV_FEATURE* constants
	* src/libvirt_internal.h: Add VIR_DRV_FEATURE* constants, using
	  an enum instead of #define
	* src/internal.h: pull in libvirt_internal.h

2009-10-09  Daniel P. Berrange  <berrange@redhat.com>

	Fix configure.ac message vertical alignment
	* configure.in: Align messages in configuration summary

2009-10-09  Amy Griffis  <amy.griffis@hp.com>

	LXC add augeas support for config file
	* src/lxc/libvirtd_lxc.aug src/lxc/test_libvirtd_lxc.aug: augeas schemas
	  for lxc.conf
	* src/Makefile.am libvirt.spec.in: glue the new augeas files in

2009-10-08  Amy Griffis  <amy.griffis@hp.com>

	LXC add driver config file lxc.conf
	* src/lxc/lxc.conf: new configuration file, there is currently one
	  tunable "log_with_libvirtd" that controls whether an lxc controller will
	  log only to the container log file, or whether it will honor libvirtd's
	  log output configuration. This provides a way to have libvirtd and its
	  children log to a single file.  The default is to log to the container
	  log file.
	* src/Makefile.am libvirt.spec.in: add the new file
	* src/lxc/lxc_conf.[ch] src/lxc/lxc_driver.c: read the new log value
	  from the configuration file and pass the log informations when
	  starting up a container.

	LXC do not truncate container log files on restart
	* src/lxc/lxc_driver.c: use O_APPEND instead of O_TRUNC when opening
	  the log file on lxcVmStart()

	LXC initialize logging configuration
	* src/lxc/lxc_driver.c src/lxc/lxc_controller.c: before launching the
	  lxc controller, have the lxc driver query the log settings and setup
	  envp[]. This provides the advantage of honoring the actual log
	  configuration instead of only what had been set in the environment.
	  The lxc controller now simply has to call virLogSetFromEnv().

	Add debug for envp[] in virExecWithHook()
	* src/util/util.c: output some debug if caller of virExecWithHook have
	  set envp[]

2009-10-08  Amy Griffis  <amy.griffis@hp.com>

	Add accessors for logging filters and outputs
	When configuring logging settings, keep more information about the
	output destination. Add accessors to retrieve the filter and output
	settings in the original string form; this to be used to set up
	environment for a child process that also logs.

	* src/util/logging.[ch]: add virLogGetFilters and virLogGetOutputs
	  accessors and modify the internals (including virLogDefineOutput())
	  to save the data needed for the accessors

2009-10-08  Amy Griffis  <amy.griffis@hp.com>

	Add virFileAbsPath() utility
	* src/util/util.[ch]: Add virFileAbsPath() function to ensure an
	  absolute path for a potentially realtive path.
	* src/libvirt_private.syms: add it in libvirt private symbols

2009-10-08  Jamie Strandboge  <jamie@canonical.com>

	Documentation and examples for SVirt Apparmor driver
	* docs/drvqemu.html.in: include documentation for AppArmor sVirt
	  confinement
	* examples/apparmor/TEMPLATE examples/apparmor/libvirt-qemu
	  examples/apparmor/usr.lib.libvirt.virt-aa-helper
	  examples/apparmor/usr.sbin.libvirtd: example templates and
	  configuration files for SVirt Apparmor when using KVM/QEmu

	sVirt AppArmor security driver
	* configure.in: look for AppArmor and devel
	* src/security/security_apparmor.[ch] src/security/security_driver.c
	  src/Makefile.am: add and plug the new driver
	* src/security/virt-aa-helper.c: new binary which is used exclusively by
	  the AppArmor security driver to manipulate AppArmor.
	* po/POTFILES.in: registers the new files
	* tests/Makefile.am tests/secaatest.c tests/virt-aa-helper-test:
	  tests for virt-aa-helper and the security driver, secaatest.c is
	  identical to seclabeltest.c except it initializes the 'apparmor'
	  driver instead of 'selinux'

2009-10-08  Cole Robinson  <crobinso@redhat.com>

	cgroup: Fix -Werror breakage

2009-10-08  Daniel P. Berrange  <berrange@redhat.com>

	Misc win32 build fixes
	* daemon/Makefile.am: Fix missing sasl rule
	* src/datatypes.c: Add unistd.h to avoid gnulib bug
	* src/util/cgroup.c: Disable mntent if not available

2009-10-07  Ryota Ozaki  <ozaki.ryota@gmail.com>

	Fix handling return value of qemuMonitorSetBalloon
	* src/qemu/qemu_driver.c: The positive return value of
	  qemuMonitorSetBalloon should be handled as a success

2009-10-07  Ryota Ozaki  <ozaki.ryota@gmail.com>

	LXC implement memory control APIs
	The patch implements the missing memory control APIs for lxc, i.e.,
	domainGetMaxMemory, domainSetMaxMemory, domainSetMemory, and improves
	domainGetInfo to return proper amount of used memory via cgroup.

	* src/libvirt_private.syms: Export virCgroupGetMemoryUsage
	  and add missing virCgroupSetMemory
	* src/lxc/lxc_driver.c: Implement missing memory functions
	* src/util/cgroup.c, src/util/cgroup.h: Add the function
	  to get used memory

2009-10-07  Jamie Strandboge  <jamie@canonical.com>

	Add a domain argument to SVirt *RestoreImageLabel
	When James Morris originally submitted his sVirt patches (as seen in
	libvirt 0.6.1), he did not require on disk labelling for
	virSecurityDomainRestoreImageLabel. A later commit[2] changed this
	behavior to assume on disk labelling, which halts implementations for
	path-based MAC systems such as AppArmor and TOMOYO where
	vm->def->seclabel is required to obtain the label.

	* src/security/security_driver.h src/qemu/qemu_driver.c
	  src/security/security_selinux.c: adds the 'virDomainObjPtr vm'
	  argument back to *RestoreImageLabel

2009-10-07  Chris Lalancette  <clalance@redhat.com>

	Fix up "make check"
	While running make check, I noticed that it was actually using
	the virsh binary from my system, in /usr/bin/virsh, and not the
	one that was just compiled.  This is actually caused by a bug
	in Makefile.am, where we didn't update the PATH to include tools.

	While here, I also updated all of the scripts to properly define
	the srcdir, abs_top_srcdir, and abs_top_builddir environment
	variables.  This is required if you want to be able to run the
	tests standalone (i.e. ./test instead of from make check).  I've
	tested this on both RHEL-5 and Fedora-10 machines, and make check
	works on both, as does running the individual tests by hand.

2009-10-06  Mark McLoughlin  <markmc@redhat.com>

	Create /var/log/libvirt/{lxc,uml} dirs
	Otherwise logrotate barfs:

	  error: error accessing /var/log/libvirt/uml: No such file or directory
	  error: libvirtd:1 glob failed for /var/log/libvirt/uml/*.log
	  error: found error in /var/log/libvirt/qemu/*.log /var/log/libvirt/uml/*.log /var/log/libvirt/lxc/*.log , skipping

	* qemud/Makefile.am: always create /var/log/libvirt/{lxc,uml} when
	  installing the logrotate conf; not ideal, but easier than making
	  the logrotate conf depend on which drivers are enabled

2009-10-06  Daniel P. Berrange  <berrange@redhat.com>

	Fix rebuilding of devhelp files
	The devhelp/ directory files depend on libvirt-api.xml being
	uptodate, but automake always processes SUBDIRS before the
	current directory. So devhelp would be built and then the
	libvirt-api.xml re-build, invalidating the devhelp data again.

	To fix this all the rules for devhelp are moved directly
	into the docs/Makefile.am allowing make to see the global
	dependancy chain and thus build things in the correct order

	* docs/Makefile.am: Add rules for devhelp rebuild
	* docs/devhelp/Makefile.am: Remove devhelp rebuild
	* configure.in: Remove docs/devhelp/Makefile.am

2009-10-06  Daniel P. Berrange  <berrange@redhat.com>

	Fix ordering of <exports> in API description file
	* docs/apibuild.py: Make uniq() function sort keys before returning
	  them to ensure consitent ordering of <exports> in XML file

2009-10-06  Cole Robinson  <crobinso@redhat.com>

	test: Support loading node device info from file/XML
	Also add some XML examples.

	node conf: Make parsing routines consistent with other drivers
	Add virNodeDeviceParseFile, and make virNodeDeviceParseNode non-static. These
	will be used by the test driver.

	test: Implement node device driver.
	Add a simple 'computer' device for the default driver. Only implement
	the basic calls, no creation or destroy happening.

	nodedev: Break out virNodeDeviceHasCap to node_conf
	Will be used by test driver node device implementation.

	nodedev: Add locking in nodeNumOfDevices

	test: Throw a proper error in GetBridgeName
	Throw error in GetBridgeName if net has no bridge.

	python: Add a newline after custom classes
	In the generated bindings, custom classes are squashed against the following
	class, which hurts readability.

2009-10-06  Cole Robinson  <crobinso@redhat.com>

	python: Fix generated virInterface method names
	A mistake in the generator was causing virInterface methods to be generated
	with unpredicatable names ('ceUndefine', instead of just 'undefine'). This
	fixes the method names to match existing convention.

	Does anyone care if we are breaking API compat? My guess is that no one is
	using the python interface bindings yet.

2009-10-06  Cole Robinson  <crobinso@redhat.com>

	python: Use a pure python implementation of 'vir*GetConnect'
	The API docs explictly warn that we shouldn't use the C vir*GetConnect calls
	in bindings: doing so can close the internal connection pointer and cause
	things to get screwy. Implement these calls in python.

	python: Don't generate bindings for vir*Ref
	They are only for use in implementing the bindings, so shouldn't be
	exposed to regular API users.

2009-10-06  Cole Robinson  <crobinso@redhat.com>

	python: Don't generate conflicting conn.createXML functions.
	A special case in the generator wasn't doing its job, and duplicate
	conn.createXML functions were being generated. The bindings diff is:

	@@ -1079,14 +1079,6 @@ class virConnect:
	         return __tmp

	     def createXML(self, xmlDesc, flags):
	-        """Create a new device on the VM host machine, for example,
	-           virtual HBAs created using vport_create. """
	-        ret = libvirtmod.virNodeDeviceCreateXML(self._o, xmlDesc, flags)
	-        if ret is None:raise libvirtError('virNodeDeviceCreateXML() failed', conn=self)
	-        __tmp = virNodeDevice(self, _obj=ret)
	-        return __tmp
	-
	-    def createXML(self, xmlDesc, flags):
	         """Launch a new guest domain, based on an XML description
	           similar to the one returned by virDomainGetXMLDesc() This
	           function may requires privileged access to the hypervisor.
	@@ -1327,6 +1319,14 @@ class virConnect:
	         __tmp = virNetwork(self, _obj=ret)
	         return __tmp

	+    def nodeDeviceCreateXML(self, xmlDesc, flags):
	+        """Create a new device on the VM host machine, for example,
	+           virtual HBAs created using vport_create. """
	+        ret = libvirtmod.virNodeDeviceCreateXML(self._o, xmlDesc, flags)
	+        if ret is None:raise libvirtError('virNodeDeviceCreateXML() failed', conn=self)
	+        __tmp = virNodeDevice(self, _obj=ret)
	+        return __tmp
	+
	     def nodeDeviceLookupByName(self, name):
	         """Lookup a node device by its name. """
	         ret = libvirtmod.virNodeDeviceLookupByName(self._o, name)

2009-10-06  Cole Robinson  <crobinso@redhat.com>

	python: Remove use of xmllib in generator.py
	xmllib has been deprecated since python 2.0, and running the generator throws
	a warning. Move to using xml.sax

	python: Remove FastParser from generator.
	FastParser uses sgmlop, a non-standard python module meant as a replacement
	for xmllib (which is deprecated since python 2.0). Fedora doesn't even carry
	this module, and the generator doesn't have high performance requirements, so
	just rip the code out.

	configure: Add explict --with-python option.
	--with-python currently already works for enabling/disabling the python
	bindings, but doesn't show up in the help output.

2009-10-05  Daniel Veillard  <veillard@redhat.com>

	526769 change logrotate config default to weekly
	* daemon/libvirtd.logrotate.in: change to weekly rotation of logs,
	  keep a month worth of data and also extend to cover LXC and UML
	  domain logs

2009-10-02  Daniel P. Berrange  <berrange@redhat.com>

	Fix typo in Makefile.am breaking NEWS file generation
	* docs/Makefile.am: Fix syntax error in NEWS rule, '$' should be '$$'
	  to escape correctly

2009-10-02  Daniel P. Berrange  <berrange@redhat.com>

	Fix emission of domain events messages
	The code which updated the message length after writing the
	payload wrote the updated length word in the wrong place since
	the XDR object was given a buffer pointing to the start of the
	header payload, rather than message start.

	* daemon/remote.c: Fix updating of event message length so that
	  we actually send the payload, not just the header

2009-10-02  Paolo Bonzini  <pbonzini@redhat.com>

	unbreak `make rpcgen'
	Fix "make rpcgen", broken by the directory reorganization.

	* src/Makefile.am (rpcgen): Fix path to rpcgen_fix.pl.

2009-10-02  Paolo Bonzini  <pbonzini@redhat.com>

	unbreak migration
	Fix migration, broken in two different ways by the QEMU monitor
	abstraction.  Note that the QEMU console emits a "\r\n" as the
	line-ending.

	* src/qemu/qemu_monitor_text.c (qemuMonitorGetMigrationStatus):
	Fix "info migrate" command and its output's parsing.

2009-10-02  Chris Lalancette  <clalance@redhat.com>

	Tunnelled migration.
	Implementation of tunnelled migration, using a Unix Domain Socket
	on the qemu backend.  Note that this requires very new versions of
	qemu (0.10.7 at least) in order to get the appropriate bugfixes.

2009-10-01  Jiri Denemark  <jdenemar@redhat.com>

	Fix build in separate build directory
	* cfg.mk: use $(srcdir)/ prefix for Makefile.nonreentrant include
	* examples/domain-events/events-c/Makefile.am tools/Makefile.am
	  examples/hellolibvirt/Makefile.am: extend the include paths to
	  use $(top_srcdir)/include too.

2009-10-01  Paolo Bonzini  <pbonzini@redhat.com>

	Fix documentation and comment typos
	Fix a few mispellings :-) of "successfully" and regenerate
	docs/libvirt-*.xml.
	* src/libvirt.c: Fix typos.
	* src/secret/secret_driver.c: Fix typos.
	* docs/libvirt-api.xml: Regenerate.
	* docs/libvirt-refs.xml: Regenerate.

2009-10-01  Chris Lalancette  <clalance@redhat.com>

	Various monitor improvements for migration.
	The upcoming tunnelled migration needs to be able to set
	a migration in progress in the background, as well as
	be able to cancel a migration when a problem has happened.
	This patch allows for both of these to properly work.

2009-10-01  Mark McLoughlin  <markmc@redhat.com>

	Fix USB device re-labelling
	A simple misplaced break out of a switch results in:

	  libvir: error : Failed to open file '/sys/bus/pci/devices/0000:00:54c./vendor': No such file or directory
	  libvir: error : Failed to open file '/sys/bus/pci/devices/0000:00:54c./device': No such file or directory
	  libvir: error : this function is not supported by the hypervisor: Failed to read product/vendor ID for 0000:00:54c.

	when trying to passthrough a USB host device to qemu.

	* src/security_selinux.c: fix a switch/break thinko

2009-10-01  Daniel Veillard  <veillard@redhat.com>

	Avoid a libvirtd crash on broken input 523418
	* src/conf/domain_conf.c: a simple typo in an XML domain file could lead
	  to a crash, because we called STRPREFIX() on the looked up value without
	  checking it was non-null.

2009-10-01  Florian Vichot  <florian.vichot@diateam.net>

	Incorrect error message in virDomainNetDefParseXML
	* src/conf/domain_conf.c: when declaring a <interface type="bridge">
	  tag, <source> needs a "bridge" attribute, but the parser complains
	  about a missing "dev" attribute.

2009-09-30  Daniel Veillard  <veillard@redhat.com>

	Fix a few 'make rpm' breakages
	* Makefile.am: examples/domain-events/events-python should be added
	  to dist tarball
	* libvirt.spec.in: there is no makefile in domain-events but in
	  domain-events/events-c and python/libvirtclass.txt has vanished

	523639 Allows a <description> tag for domains
	* docs/schemas/domain.rng: allow one <description> tag in the top level
	  of the <domain> to store user information as text
	* src/conf/domain_conf.c src/conf/domain_conf.h: extend the structure
	  to store this text, grab it at parse time and save it back when
	  present after <uuid>

2009-09-30  Chris Lalancette  <clalance@redhat.com>

	Add src/util/storage_file.c to the POTFILES.in.

	Add a qemu feature flag for unix socket migration.

	Pass remote_message_header to the dispatch functions.
	This is necessary for the dispatch functions to be able to use
	streams in the future.

	Let remoteClientStream only do RX if requested.
	Right now, the stream stuff assumes that a stream is always
	going to be used for transmit.  This is not the case, and in
	fact doesn't work with the tunnelled migration stuff.  Add
	a flag to remoteClientStream() to allow it to do RX only.

	Fix up a few typos in the tree.

	Fix up some warnings from stream DEBUG statements.

2009-09-30  Matthias Bolte  <matthias.bolte@googlemail.com>

	Fix apibuild.py warnings
	Function comments for virStreamEvent{Add,Update,Remove}Callback() are
	missing a trailing ':'. Therefore apibuild.py fails to parse the comment
	and warns about the missing ':'.

	* docs/libvirt-api.xml, docs/libvirt-refs.xml: updated by apibuild.py
	* src/libvirt.c: add missing ':' in function comments

2009-09-30  Matthias Bolte  <matthias.bolte@googlemail.com>

	Change signature of remoteSendStreamData() to fix compile warning
	The actual type of size_t is architecture dependent. Because the len
	parameter is used as unsigned int in remoteSendStreamData(), change its
	type to unsigned int.

	* daemon/dispatch.[ch]: change size_t to unsigned int for
	  remoteSendStreamData()

2009-09-30  Mark McLoughlin  <markmc@redhat.com>

	Re-label image file backing stores
	Use virStorageFileGetMetadata() to find any backing stores for images
	and re-label them

	Without this, qemu cannot access qcow2 backing files, see:

	  https://bugzilla.redhat.com/497131

	* src/security/security_selinux.c: re-label backing store files in
	  SELinuxSetSecurityImageLabel()

2009-09-30  Mark McLoughlin  <markmc@redhat.com>

	Add virStorageFileGetMetadata() helper
	* src/util/storage_file.c: add virStorageFileGetMetadata() so that
	  the caller does not need to open the file

2009-09-30  Mark McLoughlin  <markmc@redhat.com>

	Move virStorageGetMetadataFromFD() to libvirt_util
	Finally, we get to the point of all this.

	Move virStorageGetMetadataFromFD() to virStorageFileGetMetadataFromFD()
	and move to src/util/storage_file.[ch]

	There's no functional changes in this patch, just code movement

	* src/storage/storage_backend_fs.c: move code from here ...

	* src/util/storage_file.[ch]: ... to here

	* src/libvirt_private.syms: export virStorageFileGetMetadataFromFD()

2009-09-30  Mark McLoughlin  <markmc@redhat.com>

	Introduce virStorageFileMetadata structure
	Introduce a metadata structure and make virStorageGetMetadataFromFD()
	fill it in.

	* src/util/storage_file.h: add virStorageFileMetadata

	* src/backend/storage_backend_fs.c: virStorageGetMetadataFromFD() now
	  fills in the virStorageFileMetadata structure

2009-09-30  Mark McLoughlin  <markmc@redhat.com>

	Split virStorageGetMetadataFromFD() from virStorageBackendProbeTarget()
	Prepare the code probing a file's format and associated metadata for
	moving into libvirt_util.

	* src/storage/storage_backend_fs.c: re-factor the format and metadata
	  probing code in preparation for moving it

2009-09-30  Mark McLoughlin  <markmc@redhat.com>

	Move file format enum to libvirt_util
	Rename virStorageVolFormatFileSystem to virStorageFileFormat and
	move to src/util/storage_file.[ch]

	* src/Makefile.am: add src/util/storage_file.[ch]

	* src/conf/storage_conf.[ch]: move enum from here ...

	* src/util/storage_file.[ch]: .. to here

	* src/libvirt_private.syms: update To/FromString exports

	* src/storage/storage_backend.c, src/storage/storage_backend_fs.c,
	  src/vbox/vbox_tmpl.c: update for above changes

2009-09-30  Matthias Bolte  <matthias.bolte@googlemail.com>

	Fix memory leaks in libvirtd's message processing
	Commit 47cab734995fa9521b1df05d37e9978eedd8d3a2 changed the way how
	qemud_client_message objects were reused. Before this commit
	remoteDispatchClientRequest() reused the received message for normal responses
	and to report non-fatal errors. If a fatal error occurred qemudWorker() frees
	the message. After this commit non-fatal errors are reported by
	remoteSerializeReplyError() using a new qemud_client_message object and the
	original message leaks.

	To fix this leak the original message has to be freed if
	remoteSerializeReplyError() succeeds. If remoteSerializeReplyError()
	fails the original message is freed in qemudWorker().

	* daemon/dispatch.c: free qemud_client_message objects that will not be reused
	  and would leak otherwise, also free the allocated qemud_client_message object
	  in remoteSerializeError() if an error occurs

2009-09-30  Daniel P. Berrange  <berrange@redhat.com>

	Fix QEMU test suite with new VNC env variable
	* qemuxml2argvdata/qemuxml2argv-graphics-vnc-sasl.args,
	  qemuxml2argvdata/qemuxml2argv-graphics-vnc-tls.args,
	  qemuxml2argvdata/qemuxml2argv-graphics-vnc.args,
	  qemuxml2argvdata/qemuxml2argv-input-xen.args: Add in
	  QEMU_AUDIO_DRV=none env variable

2009-09-29  Pritesh Kothari  <Pritesh.Kothari@Sun.COM>

	VBox vboxDomainDestroy forgot to wait for completion
	* src/vbox/vbox_tmpl.c: the vboxDomainDestroy forgot to wait for
	  completion of the PowerDown command

2009-09-29  Daniel P. Berrange  <berrange@redhat.com>

	Remove hand-crafted UUID parsers
	* src/libvirt.c: Remove hand-crafted UUID parsers in favour of
	  calling virParseUUID

2009-09-29  Daniel P. Berrange  <berrange@redhat.com>

	Allow control over QEMU audio backend
	When using VNC for graphics + keyboard + mouse, we shouldn't
	then use the host OS for audio. Audio should go back over
	VNC.

	When using SDL for graphics, we should use the host OS for
	audio since that's where the display is. We need to allow
	certain QEMU env variables to be passed through to guest
	too to allow choice of QEMU audio backend.

	* qemud/libvirtd.sysconf: Mention QEMU/SDL audio env vars
	* src/qemu_conf.c: Passthrough QEMU/SDL audio env for SDL display,
	  disable host audio for VNC display

2009-09-29  Daniel P. Berrange  <berrange@redhat.com>

	Handle data streams in remote client
	* src/remote_internal.c: Add helper APIs for processing data streams

	Handle outgoing data streams in libvirtd
	* daemon/dispatch.c: Set streamTX flag on outgoing data packets
	* daemon/qemud.h: Add streamTX flag to track outgoing data
	* daemon/qemud.c: Re-enable further TX when outgoing data packet
	  has been fully sent.
	* daemon/stream.h, daemon/stream.c: Add method for enabling TX.
	  Support reading from streams and transmitting data out to client

	Handle incoming data streams in libvirtd
	* daemon/stream.c: Handle incoming stream data packets, queuing until
	  stream becomes writable. Handle stream completion handshake
	* po/POTFILES.in: Add daemon/stream.c

2009-09-29  Daniel P. Berrange  <berrange@redhat.com>

	Helper functions for processing data streams in libvirtd
	Defines the extensions to the remote protocol for generic
	data streams. Adds a bunch of helper code to the libvirtd
	daemon for working with data streams.

	* daemon/Makefile.am: Add stream.c/stream.h to build
	* daemon/stream.c, qemud/stream.h: Generic helper functions for
	  creating new streams, associating streams with clients, finding
	  existing streams for a client and removing/deleting streams.
	* src/remote/remote_protocol.x: Add a new 'REMOTE_STREAM' constant
	  for the 'enum remote_message_type' for encoding stream data
	  in wire messages. Add a new 'REMOTE_CONTINUE' constant to
	  'enum remote_message_status' to indicate further data stream
	  messsages are expected to follow.  Document how the
	  remote_message_header is used to encode data streams
	* src/remote/remote_protocol.h: Regenerate
	* daemon/dispatch.c: Remove assumption that a error message
	  sent to client is always type=REMOTE_REPLY. It may now
	  also be type=REMOTE_STREAM. Add convenient method for
	  sending outgoing stream data packets. Log and ignore
	  non-filtered incoming stream packets. Add a method for
	  serializing a stream error message
	* daemon/dispatch.h:  Add API for serializing stream errors
	  and sending stream data packets
	* daemon/qemud.h: Add struct qemud_client_stream for tracking
	  active data streams for clients. Tweak filter function
	  operation so that it accepts a client object too.
	* daemon/qemud.c: Refactor code for free'ing message objects
	  which have been fully transmitted into separate method.
	  Release all active streams when client shuts down. Change
	  filter function to be responsible for queueing the message

2009-09-29  Daniel P. Berrange  <berrange@redhat.com>

	Add public API definition for data stream handling
	* include/libvirt/libvirt.h.in: Public API contract for
	  virStreamPtr object
	* src/libvirt_public.syms: Export data stream APIs
	* src/libvirt_private.syms: Export internal helper APIs
	* src/libvirt.c: Data stream API driver dispatch
	* src/datatypes.h, src/datatypes.c: Internal helpers for virStreamPtr
	  object
	* src/driver.h: Define internal driver API for streams
	* .x-sc_avoid_write: Ignore src/libvirt.c because it trips
	  up on comments including write()
	* python/Makefile.am: Add libvirt-override-virStream.py
	* python/generator.py: Add rules for virStreamPtr class
	* python/typewrappers.h, python/typewrappers.c: Wrapper
	  for virStreamPtr
	* docs/libvirt-api.xml, docs/libvirt-refs.xml: Regenerate
	  with new APIs

2009-09-29  Pritesh Kothari  <Pritesh.Kothari@Sun.COM>

	Vbox call OpenHardDisk with "" instead of NULL
	* src/vbox/vbox_tmpl.c: UTF-16 fixed version of Florian Vichot initial
	  patch

2009-09-29  Jim Fehlig  <jfehlig@novell.com>

	Avoid double free in errors in virsh
	* tools/virsh.c: it was possible to get vshDeinit to call itself back
	  via vshError, remove the doexit parameter of vshError to avoid the
	  possibility and make sure to exit directly after in those case.

2009-09-29  Daniel P. Berrange  <berrange@redhat.com>

	Fix crash in device hotplug cleanup code
	* src/qemu/qemu_driver.c: Fix crash in scenario where XML
	  parsing of hotplugged device failed & thus 'dev' is NULL

	Standardize debugging messages in QEMU monitor code
	* src/qemu/qemu_monitor_text.c: Always print command and reply
	  in qemuMonitorCommandWithHandler. Print all args in each monitor
	  command API & remove redundant relpy printing

	Remove low level monitor APIs from header file
	* src/qemu/qemu_monitor_text.h: Remove qemudMonitorCommand,
	  qemudMonitorCommandWithFd, qemudMonitorCommandWithHandler,
	  qemudMonitorCommandExtra low level APIs
	* src/qemu/qemu_monitor_text.c: Replace s/qemud/qemuMonitor/

	Add API for issuing 'host_net_remove' monitor command
	* src/qemu/qemu_monitor.h, src/qemu/qemu_monitor.c: Add new
	  qemuMonitorRemoveHostNetwork() command for removing host
	  networks
	* src/qemu/qemu_driver.c: Convert NIC hotplug methods over
	  to use qemuMonitorRemoveHostNetwork()

	Add API for issuing 'host_net_add' monitor command
	* src/qemu/qemu_conf.h, src/qemu/qemu_conf.c: Remove prefix arg
	  from qemuBuildHostNetStr which is no longer required
	* src/qemu/qemu_driver.c: Refactor to use qemuMonitorAddHostNetwork()
	  API for adding host network
	* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add new
	  qemuMonitorAddHostNetwork() method for adding host networks

	Add API for issuing 'pci_add nic' monitor command
	* src/qemu/qemu_conf.c: Remove separator from qemuBuildNicStr()
	  args, and remove hardcoded 'nic' prefix. Leave it upto callers
	  instead
	* src/qemu/qemu_driver.c: Switch over to using the new
	  qemuMonitorAddPCINetwork() method for NIC hotplug
	* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add new
	  qemuMonitorAddPCINetwork API for PCI network device hotplug

	Add API for issuing 'getfd' and 'closefd' monitor commands
	* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add new
	  qemuMonitorCloseFileHandle and qemuMonitorSendFileHandle
	  APIs for processing file handles
	* src/qemu/qemu_driver.c: Convert NIC hotplug method over to
	  use   qemuMonitorCloseFileHandle and qemuMonitorSendFileHandle

	Add API for issuing 'pci_add storage' monitor command
	* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add new
	  API qemuMonitorAddPCIDisk()
	* src/qemu/qemu_driver.c: Convert over to using the new
	  qemuMonitorAddPCIDisk() method, and remove now obsolete
	  qemudEscape() method

	Add API for issuing 'pci_del' monitor command
	* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add new API
	  qemuMonitorRemovePCIDevice() for removing PCI device
	* src/qemu/qemu_driver.c: Convert all places removing PCI devices
	  over to new qemuMonitorRemovePCIDevice() API

	Add API for issuing 'pci_add host' monitor command
	* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add new
	  API qemuMonitorAddPCIHostDevice()
	* src/qemu/qemu_driver.c: Switch to using qemuMonitorAddPCIHostDevice()
	  for PCI host device hotplug

2009-09-29  Daniel P. Berrange  <berrange@redhat.com>

	Add APIs for sending 'usb_add' command for host devices
	One API adds an exact device based on bus+dev, the other adds
	any device matching vendor+product

	* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add new
	  qemuMonitorAddUSBDeviceExact() and qemuMonitorAddUSBDeviceMatch()
	  commands.
	* src/qemu/qemu_driver.c: Switch over to using the new
	    qemuMonitorAddUSBDeviceExact() and qemuMonitorAddUSBDeviceMatch()

2009-09-29  Daniel P. Berrange  <berrange@redhat.com>

	Add API for using 'usb_add' for disk devices
	* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add new
	  qemuMonitorAddUSBDisk() API
	* src/qemu/qemu_driver.c: Switch USB disk hotplug to the new
	  src/qemu/qemu_driver.c API.

	Add API for issuing 'migrate' command with exec protocol
	* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add new
	  qemuMonitorMigrateToCommand() API
	* src/qemu/qemu_driver.c: Switch over to using the
	  qemuMonitorMigrateToCommand() API for core dumps and save
	  to file APIs

	Add API for issuing a 'migrate' monitor command for TCP
	* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add new API
	  qemuMonitorMigrateToHost() for doing TCP migration
	* src/qemu/qemu_driver.c: Convert to use qemuMonitorMigrateToHost().
	  Also handle proper URIs (tcp:// as well as tcp:)

	Add API for running 'info migration' monitor command
	* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add new
	  qemuMonitorGetMigrationStatus() command.
	* src/qemu/qemu_driver.c: Use new qemuMonitorGetMigrationStatus()
	  command to check completion status.

	Add API for issuing the 'migrate_set_speed' monitor command
	* src/qemu/qemu_driver.c: Use new qemuMonitorSetMigrationSpeed()
	  API during migration
	* src/qemu/qemu_monitor.h, src/qemu/qemu_monitor.c: Add new
	  qemuMonitorSetMigrationSpeed() API

	Add API for issuing 'info blockstats' command
	* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add a new
	  qemuMonitorGetBlockStatsInfo() command
	* src/qemu/qemu_driver.c: Remove directly use of blockstats in
	  favour of calling qemuMonitorGetBlockStatsInfo()

	Add APIs for issuing 'memsave' and 'pmemsave' monitor commands
	* src/qemu/qemu_monitor.h, src/qemu/qemu_monitor.c: Add new APIs
	  qemuMonitorSaveVirtualMemory() and qemuMonitorSavePhysicalMemory()
	* src/qemu/qemu_driver.c: Use the new qemuMonitorSaveVirtualMemory()
	  and qemuMonitorSavePhysicalMemory() APIs

	Add APIs for issuing 'eject' and 'change dev' monitor commands
	* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add new APis
	  qemuMonitorChangeMedia and qemuMonitorEjectMedia. Pull in code
	  for qemudEscape
	* src/qemu/qemu_driver.c: Remove code that directly issues 'eject'
	  and 'change' commands in favour of API calls.

	Add API for issuing 'balloon' monitor command
	* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add new
	  qemuMonitorSetBalloon() based on existing code in
	  qemudDomainSetMemoryBalloon
	* src/qemu/qemu_driver.c: Remove use of qemudDomainSetMemoryBalloon()
	  in favour of qemuMonitorSetBalloon(). Fix error code when balloon
	  is not supported

	Add API for running 'info balloon' monitor command
	* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Pull old
	  qemudDomainGetMemoryBalloon() code into a new method called
	  qemuMonitorGetBalloonInfo()
	* src/qemu/qemu_driver.c: Update to call qemuMonitorGetBalloonInfo()
	  and remove qemudDomainGetMemoryBalloon().

	Add API for the 'system_powerdown' monitor command
	* src/qemu/qemu_driver.c: Remove use of 'system_powerdown'
	* src/qemu/qemu_monitor.h, src/qemu/qemu_monitor.c: Add a new
	  qemuMonitorSystemPowerdown() api call

	Add API for 'stop' monitor command
	* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add a new
	  qemuMonitorStopCPUs() API
	* src/qemu/qemu_driver.c: Replace direct monitor commands for 'stop'
	  with qemuMonitorStopCPUs()

	Rename qemudMonitorSendCont to qemuMonitorStartCPUs
	* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Rename
	  Rename qemudMonitorSendCont to qemuMonitorStartCPUs
	* src/qemu/qemu_driver.c: Update callers for new name

	Add API for 'change vnc password' monitor command
	* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add a
	  new qemuMonitorSetVNCPassword() API
	* src/qemu/qemu_driver.c: Refactor qemudInitPasswords to
	  call qemuMonitorSetVNCPassword()

	Add API for 'info cpus' monitor command
	* src/qemu/qemu_monitor.h, src/qemu/qemu_monitor.c: Add a new
	  qemuMonitorGetCPUInfo() command
	* src/qemu/qemu_driver.c: Refactor qemudDetectVcpuPIDs to
	  use qemuMonitorGetCPUInfo()

2009-09-29  Daniel P. Berrange  <berrange@redhat.com>

	Pull QEMU monitor interaction out to separate file
	Pull out all the QEMU monitor interaction code to a separate
	file. This will make life easier when we need to drop in a
	new implementation for the forthcoming QMP machine friendly
	monitor support.

	Next step is to add formal APIs for each monitor command,
	and remove direct commands for sending/receiving generic
	data.

	* src/Makefile.am: Add qemu_monitor.c to build
	* src/qemu/qemu_driver.c: Remove code for monitor interaction
	* src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h: New
	  file for monitor interaction
	* po/POTFILES.in: Add src/qemu/qemu_monitor_text.c

2009-09-29  Laine Stump  <laine@laine.org>

	Maintain value of ctxt->node in virInterfaceDefParseDhcp
	* src/conf/interface_conf.c: This was causing subsequent calls to
	  virXPathxxx() to fail, since ctxt->node was left pointing at the
	  dhcp node, rather than the protocol node.

2009-09-29  Daniel Veillard  <veillard@redhat.com>

	Fix some XPath relative node resets
	* src/util/xml.c: The virXPath... function take extra care to preserve
	  the XPath context node (ctxt->node) but in the case of virXPathString
	  and virXPathBoolean they forgot to do this on the error path. This
	  patch fixes this and move all ctxt->node = relnode instuctions just
	  after the xmlXPathEval() to make sure this doesn't happen if this code
	  is modified.

2009-09-29  Mark McLoughlin  <markmc@redhat.com>

	util.h needs libvirt.h for virConnectPtr
	Seems standard to include internal.h in order to pull in libvirt.h

	* src/util/util.h: include internal.h

2009-09-28  Daniel P. Berrange  <berrange@redhat.com>

	Don't require full daemon install for libvirt python bindings
	* libvirt.spec.in: libvirt-python only needs to depend on
	  libvirt-clients

2009-09-28  Daniel P. Berrange  <berrange@redhat.com>

	Fix API doc extractor to stop munging comment formatting
	The python method help docs are copied across from the C
	funtion comments, but in the process all line breaks and
	indentation was being lost. This made the resulting text
	and code examples completely unreadable. Both the API
	doc extractor and the python generator were destroying
	whitespace & this fixes them to preserve it exactly.

	* docs/apibuild.py: Preserve all whitespace when extracting
	  function comments. Print function comment inside a <![CDATA[
	  section to fully preserve all whitespace. Look for the
	  word 'returns' to describe return values, instead of 'return'
	  to avoid getting confused with code examples including the
	  C 'return' statement.
	* python/generator.py: Preserve all whitespace when printing
	  function help docs
	* src/libvirt.c: Change any return parameter indicated by
	  'return' to be 'returns', to avoid confusing the API extractor
	* docs/libvirt-api.xml: Re-build for fixed descriptions

2009-09-24  Mark McLoughlin  <markmc@redhat.com>

	Fix cdub's surname spelling

2009-09-24  Daniel Veillard  <veillard@redhat.com>

	Added Matthias Bolte as commiter

2009-09-24  Charles Duffy  <charles@dyfis.net>

	Fix secret_driver compile warning, bug.
	Set def to NULL in secretLoad(), otherwise we can access a
	random pointer on error.

	Fix unitialized variable in qemudDomainDetachHostPciDevice()
	* src/qemu/qemu_driver.c: initialize detach var

2009-09-24  Mark McLoughlin  <markmc@redhat.com>

	Fix a typo in virNetHasValidPciAddr() too
	* src/conf/domain_conf.h: check domain/bus/slot, not domain/domain/slot

2009-09-24  Jiri Denemark  <jdenemar@redhat.com>

	Fix a typo in virDiskHasValidPciAddr()

2009-09-23  Matthias Bolte  <matthias.bolte@googlemail.com>

	ESX: Check if a datastore is accessible first
	An inaccessible datastore has no valid URL property so don't
	access its URI property.

	* src/esx/esx_vi.c: esxVI_LookupDatastoreByName(): check if datastore is
	  accessible before accessing its URL property
	* src/esx/esx_vmx.c: update to changed datastore properties

2009-09-23  Matthias Bolte  <matthias.bolte@googlemail.com>

	ESX remove phantom mode
	* src/esx/esx_driver.c: remove phantom mode

	ESX replace esxUtil_EqualSuffix() with virFileHasSuffix()
	* src/esx/esx_util.[ch]: remove esxUtil_EqualSuffix()
	* src/esx/esx_driver.c, src/esx/esx_vmx.c: replace esxUtil_EqualSuffix()
	  with virFileHasSuffix()

2009-09-23  Matthias Bolte  <matthias.bolte@googlemail.com>

	ESX add esxDomainDefineXML()
	A given domain XML gets converted to a VMX config, uploaded to the host
	and registered as new virtual machine.

	* src/esx/esx_driver.c: refactor datastore related path parsing into
	  esxUtil_ParseDatastoreRelatedPath()
	* src/esx/esx_util.[ch]: add esxUtil_ParseDatastoreRelatedPath()
	* src/esx/esx_vi.[ch]: add esxVI_Context_UploadFile(), add datastores to
	  the traversal in esxVI_BuildFullTraversalSpecList(), add
	  esxVI_LookupDatastoreByName()
	* src/esx/esx_vi_methods.[ch]: add esxVI_RegisterVM_Task()
	* src/esx/esx_vi_types.c: make some error message more verbose
	* src/esx/esx_vmx.[ch]: add esxVMX_AbsolutePathToDatastoreRelatedPath()
	  to convert a path into a datastore related path, add esxVMX_ParseFileName()
	  to convert from VMX path format to domain XML path format, extend the other
	  parsing function to be datastore aware, add esxVMX_FormatFileName() to
	  convert from domain XML path format to VMX path format, fix VMX ethernet
	  entry formating
	* tests/esxutilstest.c: add test for esxUtil_ParseDatastoreRelatedPath()
	* tests/vmx2xmldata/*: update domain XML files to use datastore related paths
	* tests/xml2vmxdata/*: update domain XML files to use datastore related paths,
	  update VMX files to use absolute paths

2009-09-23  Matthias Bolte  <matthias.bolte@googlemail.com>

	ESX add esxVI_Occurence enum to for occurences
	Add esxVI_Occurence enum to describe expected occurence of items
	* src/esx/esx_driver.c: update the use of esxVI_LookupVirtualMachineByUuid()
	* src/esx/esx_vi.c: add an esxVI_Occurence parameter to
	  esxVI_LookupVirtualMachineByUuid() and take care if esxVI_FindByUuid()
	  can't find anything for a given uuid
	* src/esx/esx_vi.h: add esxVI_Occurence enum
	* src/esx/esx_vi_methods.c: expect null or more items to be returned
	  from esxVI_FindByUuid()

	ESX Whitespace cleanup

	ESX add x86_64 detection based on the CPUID
	* src/esx/esx_driver.c: add esxSupportsLongMode() and update esxCapsInit()
	* src/esx/esx_vi.[ch]: Add AnyType handling for lists
	* src/esx/esx_vi_types.c: bind VI type HostCpuIdInfo

	ESX add tests for the VMX to/from domain XML mapping
	* tests/.gitignore: ignore new test binaries
	* tests/Makefile.am: add new tests
	* tests/esxutilstest.c: test esxVMX_IndexToDiskName()
	* tests/vmx2xmldata/*: config files for the VMX to domain XML test
	* tests/vmx2xmltest.c: test the VMX to domain XML mapping
	* tests/xml2vmxdata/*: config files for the domain XML to VMX test
	* tests/xml2vmxtest.c: test the domain XML to VMX mapping

2009-09-23  Matthias Bolte  <matthias.bolte@googlemail.com>

	ESX Add esxDomainXMLToNative()
	Extend and cleanup the VMX to domain XML mapping. Add the domain XML to
	VMX mapping functions.

	* src/esx/esx_driver.c: add esxDomainXMLToNative()
	* src/esx/esx_vmx.[ch]: add esxVMX_SCSIDiskNameToControllerAndID(),
	  esxVMX_IDEDiskNameToControllerAndID(), esxVMX_FloppyDiskNameToController(),
	  esxVMX_GatherSCSIControllers(), add basic handling for the VMX guestOS entry
	  to distinguish between i686 and x86_64, make SCSI virtualDev VMX entry
	  optional as it should be, map the VMX networkName entry to the domain XML
	  interface bridge name, add basic mapping for serial devices in pipe mode,
	  add several esxVMX_Format*() functions

2009-09-23  Matthias Bolte  <matthias.bolte@googlemail.com>

	ESX Set challenge for auth callback to hostname
	This enables the auth callback to automatically distinguish between
	requests for ESX host and vCenter credentials.

	* src/esx/esx_util.[ch]: set challenge for auth callback to hostname

2009-09-23  Matthias Bolte  <matthias.bolte@googlemail.com>

	ESX Add esxNodeGetFreeMemory()
	* src/esx/esx_driver.c: add esxNodeGetFreeMemory(), cache IP address
	* src/esx/esx_vi.[ch]: refactor resource pool query into esxVI_GetResourcePool()
	* src/esx/esx_vi_types.[ch]: bind VI type ResourcePoolResourceUsage

2009-09-23  Chris Lalancette  <clalance@redhat.com>

	Fix up "make syntax-check" after the tree restructuring.

2009-09-23  Paolo Bonzini  <pbonzini@redhat.com>

	network: add 'bootp' and 'tftp' config
	Currently, libvirtd will start a dnsmasq process for the virtual
	network, but (aside from killing the dnsmasq process and replacing it),
	there's no way to define tftp boot options.

	This change introduces the appropriate tags to the dhcp configuration:

	 <network>
	   <name>default</name>
	   <bridge name="virbr%d" />
	   <forward/>
	   <ip address="192.168.122.1" netmask="255.255.255.0">
	     <tftp root="/var/lib/tftproot" />
	     <dhcp>
	       <range start="192.168.122.2" end="192.168.122.254" />
	       <bootp file="pxeboot.img"/>
	     </dhcp>
	   </ip>
	 </network>

	When the attributes are present, these are passed to the
	arguments to dnsmasq:

	 dnsmasq [...] --enable-tftp --tftp-root /srv/tftp --dhcp-boot pxeboot.img
	               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^
	                      from <tftp />                     from <bootp />

	At present, only local tftp servers are supported (ie, dnsmasq runs as
	the tftp server), but we could improve this in future by adding a
	server= attribute.


	2009-09-21  Paolo Bonzini  <pbonzini@redhat.com>
	            Jeremy Kerr  <jk@ozlabs.org>

		* docs/formatnetwork.html.in: Document new tags.
		* docs/formatnetwork.html: Regenerate.
		* docs/schemas/network.rng: Update.
		* src/network_conf.c (virNetworkDefFree): Free new fields.
		(virNetworkDHCPRangeDefParseXML): Parse <bootp>.
		(virNetworkIPParseXML): New, parsing <dhcp> and <tftp>.
		(virNetworkDefParseXML): Use virNetworkIPParseXML instead of
		virNetworkDHCPRangeDefParseXML.
		(virNetworkDefFormat): Pretty print new fields.
		* src/network_conf.h (struct _virNetworkDef): Add netboot fields.
		* src/network_driver.c (networkBuildDnsmasqArgv): Add
		TFTP and BOOTP arguments.

		* tests/Makefile.am (EXTRA_DIST): Add networkschemadata.
		* tests/networkschematest: Look in networkschemadata.
		* tests/networkschemadata/netboot-network.xml: New.

2009-09-23  Chris Lalancette  <clalance@redhat.com>

	Introduce virStrncpy.
	Add the virStrncpy function, which takes a dst string, source string,
	the number of bytes to copy and the number of bytes available in the
	dest string.  If the source string is too large to fit into the
	destination string, including the \0 byte, then no data is copied and
	the function returns NULL.  Otherwise, this function copies n bytes
	from source into dst, including the \0, and returns a pointer to the
	dst string.  This function is intended to replace all unsafe uses
	of strncpy in the code base, since strncpy does *not* guarantee that
	the buffer terminates with a \0.

2009-09-22  Daniel P. Berrange  <berrange@redhat.com>

	Fix handling of Xen(ner) detection
	Latest upstream QEMU can be built with Xen support, which introduces
	a -xen-domid argument. This was  mistakenly detected as -domid due
	to old Xenner support. Adapt to cope with both syntax. Also only
	set domid if the virt type is xen, or the guest type is xen

	* src/qemu_conf.c, src/qemu_conf.h: Detect new -xen-domid flag in
	  preference to -domid.
	* tests/qemuxml2argvdata/qemuxml2argv-bootloader.args,
	  tests/qemuxml2argvdata/qemuxml2argv-input-xen.args: Add missing
	  -domid param
	* tests/qemuxml2argvdata/qemuxml2argv-misc-uuid.args: Remove bogus
	  -boot param.
	* tests/qemuxml2argvtest.c: Add missing QEMUD_CMD_FLAG_DOMID params

2009-09-22  Daniel P. Berrange  <berrange@redhat.com>

	Ignore auto-generated header file
	* include/libvirt/.gitignore: Ignore libvirt.h

2009-09-22  Matthias Bolte  <matthias.bolte@googlemail.com>

	Fix xen driver refcounting.
	The commit cb51aa48a777ddae6997faa9f28350cb62655ffd "Fix up connection
	reference counting." changed the driver closing and virConnectPtr
	unref-logic in virConnectClose().

	Before this commit virConnectClose() closed all drivers of the given
	virConnectPtr and virUnrefConnect()'ed it afterwards. After this
	commit the driver-closing is done in virUnrefConnect() if and only if
	the ref-count of the virConnectPtr dropped to zero.

	This change in execution order leads to a virConnectPtr leak, at least
	for connections to Xen.

	The relevant call sequences:

	virConnectOpen() -> xenUnifiedOpen() ...

	... xenInotifyOpen() -> virConnectRef(conn)

	... xenStoreOpen() -> xenStoreAddWatch() -> conn->refs++

	virConnectClose() -> xenUnifiedClose() ...

	... xenInotifyClose() -> virUnrefConnect(conn)

	... xenStoreClose() -> xenStoreRemoveWatch() -> virUnrefConnect(conn)

	Before the commit this additional virConnectRef/virUnrefConnect calls
	where no problem, because virConnectClose() closed the drivers
	explicitly and the additional refs added by the Xen subdrivers were
	removed properly. After the commit this additional refs result in a
	virConnectPtr leak (including a leak of the hypercall file handle;
	that's how I noticed this problem), because now the drivers are only
	close if and only if the ref-count drops to zero, but this cannot
	happen anymore, because the additional refs from the Xen subdrivers
	would only be removed if the drivers get closed, but that doesn't
	happen because the ref-count cannot drop to zero.

	The fix for this problem is simple: remove the
	virConnectRef/virUnrefConnect calls from the Xen subdrivers (see
	attached patch). Maybe someone could explain why the Xen Inotify and
	Xen Store driver do this extra ref-counting, but none of the other Xen
	subdrivers. It seems unnecessary to me and can be removed without
	problems.

2009-09-22  Dan Kenigsberg  <danken@redhat.com>

	Fix a number of small typos

2009-09-22  Ryota Ozaki  <ozaki.ryota@gmail.com>

	lxc: suspend/resume support
	* src/conf/domain_conf.c: Don't assume all virDomainObjPtr have
	  a non-NULL monitor_chr field in virDomainObjFormat.
	* src/lxc/lxc_driver.c: Implement suspend/resume driver APis
	* src/util/cgroup.c, src/util/cgroup.h: Support the 'freezer'
	  cgroup controller
	* src/libvirt_private.syms: Export virCgroupSetFreezerState
	  and virCgroupGetFreezerState

2009-09-22  Yuji NISHIDA  <nishidy@nict.go.jp>

	OpenVZ Fix a restriction about domain names
	* src/openvz/openvz_driver.c: try to autogenerate a non-conflicting
	  id for the domain and use the name field as the name not as id.

2009-09-22  Florian Vichot  <florian.vichot@diateam.net>

	add doc for graphic and video elements
	* docs/formatdomain.html.in: explain the new syntax of the video and
	  graphic elements in the domain XML

2009-09-22  Charles Duffy  <charles@dyfis.net>

	prevent attempt to call cat -c during virDomainSave to raw
	This was prevent virDomainSave from working properly by default,
	which is a bad thing.

2009-09-22  Chris Lalancette  <clalance@redhat.com>

	Fix up 'neccessary -> necessary' in a comment.

	Don't do virSetConnError when virDrvSupportsFeature is successful.

	Fix a double-free in qemudRunLoop()

	Fix up comments for domainXML{To,From}Native.

	Simple fix of a comment in qemuStringToArgvEnv.

	Remove an unnecessary variable from remoteIOReadMessage().

2009-09-21  Daniel P. Berrange  <berrange@redhat.com>

	Remove auto-generated header file from repo
	* include/libvirt/libvirt.h: Delete auto-generated file

	Tweak specfile to fix RHEL6 rules & ESX/PHYP enablement
	* libvirt.spec.in: ESX/PHYP drivers do not require libvirtd.
	  RHEL-6 should include LXC on all arches

	Move example XML files into examples/xml
	* docs/storage/: Move to examples/xml/storage/
	* docs/test*.xml: Move to examples/xml/test/
	* docs/Makefile.am: Remove example XML files from dist
	* Makefile.am: Add examples/xml to EXTRA_DIST
	* tests/virshtest.c: Update for moved test XML
	* libvirt.spec.in: Include example XML files as docs
	* tests/int-overflow: UPdate for moved XML

	Remove all generated docs from source control
	* docs/*.html, docs/devhelp/*.html, docs/html/*.html: Delete
	* docs/.gitignore, docs/devhelp/.gitignore, docs/html/.gitignore:
	  Ignore generated docs files
	* docs/Makefile.am: Rebuild all HTML docs for 'all' target
	  and include them in EXTRA_DIST and CLEANFILES
	* docs/devhelp/Makefile.am: Include HTML in CLEANFILES

	Fix missing data file in qemuhelpdata
	* tests/Makefile.am: Add missing data file to extra dist

	Misc syntax-check fixes

2009-09-21  Daniel P. Berrange  <berrange@redhat.com>

	Move remote protocol definition into src/remote/
	When making changes to the remote protocol, src/ is always built
	first, so rpcgen should live there, to avoid having to run make
	in the 'daemon/' directory before building src/

	* src/Makefile.am: Add rules for rpcgen, and drop -I../daemon from
	  remote client build
	* daemon/Makefile.am: Add -I../src/remote/ to libvirtd build
	  and remove rpcgen rules
	* daemon/libvirtd.c: Adapt include of remote_driver.h taking
	  into account new -I flag
	* daemon/remote_protocol.c, daemon/remote_protocol.h,
	  daemon/remote_protocol.x: Move to src/remote/
	* daemon/rpcgen_fix.pl: Move to src/remote/rpcgen_fix.pl

2009-09-21  Daniel P. Berrange  <berrange@redhat.com>

	Add a README file to src/ explaining the directory structure
	* src/README: New file

	Move all shared utility files to src/util/
	* src/bridge.c, src/bridge.h, src/buf.c, src/buf.h, src/cgroup.c,
	  src/cgroup.h, src/conf.c, src/conf.h, src/event.c, src/event.h,
	  src/hash.c, src/hash.h, src/hostusb.c, src/hostusb.h,
	  src/iptables.c, src/iptables.h, src/logging.c, src/logging.h,
	  src/memory.c, src/memory.h, src/pci.c, src/pci.h, src/qparams.c,
	  src/qparams.h, src/stats_linux.c, src/stats_linux.h,
	  src/threads-pthread.c, src/threads-pthread.h, src/threads-win32.c,
	  src/threads-win32.h, src/threads.c, src/threads.h, src/util.c,
	  src/util.h, src/uuid.c, src/uuid.h, src/virterror.c,
	  src/virterror_internal.h, src/xml.c, src/xml.h: Move all files
	  into src/util/
	* daemon/Makefile.am: Add -Isrc/util/ to build flags
	* src/Makefile.am: Add -Isrc/util/ to build flags and update for
	  moved files
	* src/libvirt_private.syms: Export cgroup APIs since they're now
	  in util rather than linking directly to drivers
	* src/xen/xs_internal.c: Disable bogus virEventRemoveHandle call
	  when built under PROXY
	* proxy/Makefile.am: Update for changed file locations. Remove
	  bogus build of event.c
	* tools/Makefile.am, tests/Makefile.am: Add -Isrc/util/ to build flags

	Move all XML configuration handling to src/conf/
	* src/capabilities.c, src/capabilities.h, src/domain_conf.c,
	  src/domain_conf.h, src/domain_event.c, src/domain_event.h,
	  src/interface_conf.c, src/interface_conf.h,
	  src/network_conf.c, src/network_conf.h, src/node_device_conf.c,
	  src/node_device_conf.h, src/secret_conf.c, src/secret_conf.h,
	  src/storage_conf.c, src/storage_conf.h, src/storage_encryption_conf.c,
	  src/storage_encryption_conf.h: Move to src/conf/
	* src/Makefile.am: Add -Isrc/conf to the individual build targets
	  which need to use XML config APIs. Remove LIBXML_CFLAGS, LIBSSH2_CFLAGS
	  and SELINUX_CFLAGS from global INCLUDES and only have them in build
	  targets which actually need them.  Create a libvirt_conf.la
	  convenience library for all config parsers
	* src/hostusb.h: Remove bogus include of domain_conf.h
	* tests/Makefile.am: Add -Isrc/conf. Remove bogus -I$builddir/src
	  since it never has any generated header files
	* daemon/Makefile.am: Add -Isrc/conf
	* proxy/Makefile.am: Add -Isrc/conf and cope with renamed files
	* src/hash.c: Remove bogus include of libxml/threads.h

	Make pki_check.sh into an installed & supported tool
	* docs/pki_check.sh: Move to tool/virt-pki-validate.in and add
	  in POD man page documentation
	* tools/.gitignore: Ignore generated virt-pki-validate file
	* tools/Makefile.am: Install & build virt-pki-validate and
	  virt-pki-validate.1
	* docs/remote.html, docs/remote.html.in: Refer to new tool
	  name virt-pki-validate
	* libvirt.spec.in, mingw32-libvirt.spec.in: Add virt-pki-validate
	  and virt-pki-validate.1 to files list

	Re-arrange python generator to make it clear what's auto-generated
	* README: New file describing what each file is used for
	* livvirt-override.c, libvirt-override.py, libvirt-override-api.xml,
	  libvirt-override-virConnect.py: Manually written code overriding
	  the generator
	* typewrappers.c, typewrappers.h: Data type wrappers
	* generator.py: Automatically pre-prend contents of libvirt-override.py
	  to generated libvirt.py. Output into libvirt.py directly instead of
	  libvirtclass.py. Don't generate libvirtclass.txt at all. Write C
	  files into libvirt.c/.h directly
	* Makefile.am: Remove rule for creating libvirt.py from libvirt-override.py
	  and libvirtclass.py, since generator.py does it directly

	Remove obsolete files
	* docs/Goals, RENAMES, mylibtool: Removed

	Move docs/examples into examples/
	* Makefile.am: Add examples/dominfo examples/domsuspend examples/python
	  as SUBDIRS
	* configure.in: Update AC_OUTPUT for new/old Makefiles
	* docs/Makefile.am: Remove examples from SUBDIRS
	* docs/examples/info1.c: Move to examples/dominfo/info1.c
	* docs/examples/suspend.c: Move to examples/domsuspend/suspend.c
	* docs/examples: Remove all remaining files
	* docs/examples/python: Moved to examples/python/
	* examples/dominfo/Makefile.am, examples/domsuspend/Makefile.am: New
	  build files
	* libvirt.spec.in: Update to take account of moved examples

	Remove unused images from docs/ directory
	* 16favicon.png, Libxml2-Logo-90x34.gif, libvirHeader.png,
	  libvirLogo.png, windows-cygwin-1.png, windows-cygwin-2.png,
	  windows-cygwin-3.png: Remove unreferenced files
	* Makefile.am: Remove deleted files from EXTRA_DIST

	Rename daemon main code
	* daemon/qemud.c: Rename to daemon/libvirtd.c
	* daemon/qemud.h: Rename to daemon/libvirtd.h
	* daemon/Makefile.am, daemon/dispatch.h, daemon/mdns.c,
	  daemon/remote.h: Update for renamed libvirtd.h file

	Move config files to align with driver sources
	* daemon/default-network.xml: Move to src/network/default.xml
	* daemon/libvirtd_qemu.aug, daemon/test_libvirtd_qemu.aug: Move
	  to src/qemu/
	* src/qemu.conf: Move to src/qemu/qemu.conf
	* daemon/Makefile.am: Remove rules for default-nmetwork.xml and
	  libvirtd_qemu.aug and test_libvirtd_qemu.aug. Fix typo in
	  uninstall-local that would install polkit again.
	* src/Makefile.am: Add rules for installing network/default.xml
	  and the qemu/*.aug files. Add test case for QEMU augeas files.
	  Add uninstall-local rule for files/directories created during
	  install. Rename install-exec-local to install-data-local.
	  Only install qemu.conf if WITH_QEMU is set.
	* tests/networkschematest: Update for XML location move

2009-09-21  Daniel P. Berrange  <berrange@redhat.com>

	Move virsh into tools/ directory
	Move the virsh tool and its man page into the tools directory

	* Makefile.am: Remove rules for virsh.1 man page
	* virsh.1: Remove auto-generated file
	* docs/Makefile.am: Remove rules for virsh.pod man page
	* docs/virsh.pod: Move to tools/ directory
	* src/Makefile.am, src/.gitignore: Remove rules for virsh
	* src/console.c, src/console.h, src/*.ico, src/virsh_win_icon.rc,
	  src/virsh.c: Move into tools/ directory
	* tools/Makefile.am: Add rules for building virsh
	* tools/.gitignore: Ignore virsh built files
	* tests/virshtest.c, tests/int-overflow: Update for new
	  virsh location

2009-09-21  Daniel P. Berrange  <berrange@redhat.com>

	Move security drivers to src/security/
	* src/Makefile.am, src/qemu/qemu_conf.h, src/qemu/qemu_driver.c,
	  tests/seclabeltest.c: Adapt for changed paths
	* src/security.c: Rename to src/security/security_driver.c
	* src/security.h: Rename to src/security/security_driver.h
	* src/security_selinux.c, src/security_selinux.h: Move to src/security/

	Move secret driver into src/secret/
	* daemon/qemud.c, src/Makefile.am: Adapt for changed paths
	* src/secret_driver.c, src/secret_driver.h: Move to src/secret/

	Move netcf interface driver into src/interface/
	* daemon/qemud.c, src/Makefile.am: Adapt for changed paths
	* src/interface_driver.c: Rename to src/interface/netcf_driver.c
	* src/interface_driver.h: Rename to src/interface/netcf_driver.h

	Move network driver into src/network
	* daemon/qemud.c, src/Makefile.am: Adapt for changed paths
	* src/network_driver.c: Rename to src/network/bridge_driver.c
	* src/network_driver.h: Rename to src/network/bridge_driver.h

	Move remote driver to src/remote/
	* daemon/mdns.c: Remove bogus include
	* daemon/qemud.c, src/Makefile.am, src/libvirt.c: Adapt for
	  changed paths
	* src/remote_internal.c: Rename to src/remote/remote_driver.c
	* src/remote_internal.h: Rename to src/remote/remote_driver.h

	Move test driver into src/test/
	* src/Makefile.am, src/libvirt.c: Adjust for changed paths
	* src/test.c: Rename to src/test/test_driver.c,
	* src/test.h: Rename to src/test/test_driver.h

	Move node device drivers to src/node_device/
	* daemon/qemud.c, src/Makefile.am: Update for changed paths
	* src/node_device*.{h,c}: Move to src/node_device/
	* src/storage/storage_backend.c: Remove bogus import of node_device.c

	Move storage drivers into src/storage/
	* daemon/qemud.c, src/Makefile.am: Adapt for changed paths
	* src/storage*.c, src/storage/*.h, src/parthelpre.c: Move
	  to src/storage/

	Move OpenVZ driver to src/openvz/
	* src/openvz_conf.c, src/openvz_conf.h, src/openvz_driver.c,
	  src/openvz_driver.h: Move to src/openvz/
	* src/Makefile.am, src/libvirt.c: Adjust for changed paths

	Move UML driver to src/uml/
	* src/uml_conf.c, src/uml_conf.h, src/uml_driver.c,
	  src/uml_driver.h: Move to src/uml/
	* daemon/qemud.c, src/Makefile.am: Adjust for changed paths

	Move QEMU driver to src/qemu/
	* src/qemu_conf.c, src/qemu_conf.h, src/qemu_driver.c,
	  src/qemu_driver.h: Move to src/qemu/
	* daemon/qemud.c, src/Makefile.am, tests/qemuargv2xmltest.c,
	  tests/qemuhelptest.c, tests/qemuxml2argvtest.c,
	  tests/qemuxml2xmltest.c: Adapt for changed paths

	Move LXC driver into src/lxc/
	* src/lxc_conf.c, src/lxc_conf.h, src/lxc_container.c,
	  src/lxc_container.h, src/lxc_controller.c, src/lxc_driver.c,
	  src/lxc_driver.h, src/veth.c, src/veth.h: Move to src/lxc/
	* src/opennebula/one_driver.c: Remove bogus veth.h include
	* src/Makefile.am: Adjust for lxc paths
	* daemon/qemud.c: Adjust include for lxc

	Move xen driver code into src/xen/ directory
	* src/Makefile.am, src/proxy_internal.c, src/proxy_internal.h
	  src/sexpr.c, src/sexpr.h, src/xen_unified.c, src/xen_unified.h,
	  src/xen_internal.c, src/xen_internal.h, src/xen_inotify.c,
	  src/xen_inotify.h, src/xend_internal.c, src/xend_internal.h,
	  src/xm_internal.c, src/xm_internal.h, src/xs_internal.c,
	  src/xs_internal.h: Move to src/xen/ directory
	* proxy/Makefile.am, proxy/libvirt_proxy.c, src/Makefile.am,
	  src/libvirt.c, tests/sexpr2xmltest.c, tests/statstest.c,
	  tests/xencapstest.c, tests/xmconfigtest.c, tests/xml2sexprtest.c:
	  Adapt to changed xen location
	* src/stats_linux.h, src/stats_linux.c: Remove xen specific block
	  stats APIs
	* src/qemu_driver.c, src/uml_driver.c: Add missing sys/un.h include
	  uncovered after change to stats_linux.h
	* src/xen/block_stats.h, src/xen/block_stats.c: Add xen specific
	  block stats APIs

	Rename qemud/ directory to daemon/
	* qemud/: Rename to daemon/
	* Makefile.am, configure.in, src/Makefile.am, src/remote_internal.c,
	  tests/Makefile.am, tests/eventtest.c: s/qemud/daemon/ where needed

2009-09-21  Daniel P. Berrange  <berrange@redhat.com>

	Refactor libvirt.spec to allow client-only builds
	Some architectures in certain RHEL versions do not include any
	hypervisors. Update the specfile to allow those to easily build
	a remote client only version of libvirt. ie no libvirtd related
	bits at all.

	* qemud/Makefile.am: Always instal SASL config since its needed
	  by client too
	* libvirt.spec.in: Re-factor specfile conditionals to allow entire
	  server side build to be disabled easily, eg a remote client only
	  build. Make RHEL-5 do client only build for s390/ppc. Make RHEL-6
	  do a client only build for all non-x86_64 archs. Enable LXC on
	  RHEL-6. Enable all Fedora >= 6 features on RHEL-6 too. Add some
	  more conditionals around dnsmasq/iptables/hal Requires tags.
	  Add missing e2fsprogs-devel BR for RHEL-5 as workaround for broken
	  parted. Fix the device mapper BR for RHEL-5. Add conditional rules
	  for ESX build. Add conditional rules for SELinux + HAL builds.
	  Fix a mistaken %{with_qemu} to be %{with_network} when setting
	  up default network XML

2009-09-21  Mark McLoughlin  <markmc@redhat.com>

	Fix leak in PCI hostdev hot-unplug
	* src/qemu_driver.c: sync the hostdev hot-unplug code with the disk/net
	  code.

2009-09-17  Mark McLoughlin  <markmc@redhat.com>

	Fix net/disk hot-unplug segfault
	When we hot-unplug the last device, we're currently double-freeing
	the device definition.

	Reported by Martin Banas here:

	  https://bugzilla.redhat.com/523953

	* src/qemu_driver.c: fix double free

2009-09-16  Shahar Klein  <shaharklein@yahoo.com>

	ESX add support for vmxnet3 virtual device
	* src/esx/esx_vmx.c: add it to the list of accepted devices when
	  parsing the Ethernet section.

2009-09-15  Jim Meyering  <meyering@redhat.com>

	doc: don't emit trailing blanks into generated and VC'd NEWS file
	* docs/Makefile.am ($(top_builddir)/NEWS): Filter out trailing
	white space.

2009-09-15  Daniel Veillard  <veillard@redhat.com>

	More whitespace problems

	Fix some last minute whitespace problems.

	Release of libvirt 0.7.1
	* configure.in docs/news.html.in libvirt.spec.in src/libvirt_public.syms:
	  updates to new release
	* NEWS docs/devhelp/libvirt-libvirt.html docs/html/libvirt-libvirt.html
	  docs/libvirt-api.xml docs/libvirt-refs.xml docs/news.html
	  include/libvirt/libvirt.h: regenerated

	Update a number of localizations and regenerate
	* as.po bn_IN.po de.po gu.po hi.po kn.po ko.po ml.po mr.po or.po pa.po
	  pl.po ta.po te.po zh_CN.po got updated

2009-09-15  Daniel P. Berrange  <berrange@redhat.com>

	Fix dlopen of secrets driver
	* src/Makefile.am: Add gnulib.la for base64 functions
	* src/libvirt_private.syms: Export virFileNameMatchesSuffix

	Add UUID definition required by storage encryption import
	* docs/schemas/storagevol.rng: storage encryption rules require
	  that UUID type be defined

	Remove accidentally added UUID re-definition in storage schema
	* docs/schemas/storageencryption.rng: Remove UUID definition
	  since its provided by the domain.rng/storagevol.rng schemas
	  that import this

	Rebuild API docs

	Make secrets RNG more strict
	* docs/schemas/secret.rng: Require volume element to be an absolute
	  path. Fix whitespace indentation

	Fill in secret UUID for qcow encryption
	* src/storage_backend_fs.c: Lookup & fill in secret passphrase UUID
	  for storage volumes using encryption

	Add usage type/id as a public API property of virSecret
	* include/libvirt/libvirt.h, include/libvirt/libvirt.h.in: Add
	  virSecretGetUsageType, virSecretGetUsageID and virLookupSecretByUsage
	* python/generator.py: Mark virSecretGetUsageType, virSecretGetUsageID
	  as not throwing exceptions
	* qemud/remote.c: Implement dispatch for virLookupSecretByUsage
	* qemud/remote_protocol.x: Add usage type & ID as attributes of
	  remote_nonnull_secret. Add RPC calls for new public APIs
	* qemud/remote_dispatch_args.h, qemud/remote_dispatch_prototypes.h,
	  qemud/remote_dispatch_ret.h, qemud/remote_dispatch_table.h,
	  qemud/remote_protocol.c, qemud/remote_protocol.h: Re-generate
	* src/datatypes.c, src/datatypes.h: Add usageType and usageID as
	  properties of virSecretPtr
	* src/driver.h: Add virLookupSecretByUsage driver entry point
	* src/libvirt.c: Implement virSecretGetUsageType, virSecretGetUsageID
	  and virLookupSecretByUsage
	* src/libvirt_public.syms: Export virSecretGetUsageType, virSecretGetUsageID
	  and virLookupSecretByUsage
	* src/remote_internal.c: Implement virLookupSecretByUsage entry
	* src/secret_conf.c, src/secret_conf.h: Remove the
	  virSecretUsageType enum, now in public API. Make volume
	  path mandatory when parsing XML
	* src/secret_driver.c: Enforce usage uniqueness when defining secrets.
	  Implement virSecretLookupByUsage api method
	* src/virsh.c: Include usage for secret-list command

2009-09-15  Daniel P. Berrange  <berrange@redhat.com>

	Fix UUID handling in secrets/storage encryption APIs
	Convert all the secret/storage encryption APIs / wire format to
	handle UUIDs in raw format instead of non-canonical printable
	format. Guarentees data format correctness.

	* docs/schemas/storageencryption.rng: Make UUID mandatory for a secret
	  and validate fully
	* docs/schemas/secret.rng: Fully validate UUID
	* include/libvirt/libvirt.h, include/libvirt/libvirt.h.in, Add
	  virSecretLookupByUUID and virSecretGetUUID. Make
	  virSecretGetUUIDString follow normal API design pattern
	* python/generator.py: Skip generation of virSecretGetUUID,
	  virSecretGetUUIDString and virSecretLookupByUUID
	* python/libvir.c, python/libvirt-python-api.xml: Manual impl
	  of virSecretGetUUID,virSecretGetUUIDString and virSecretLookupByUUID
	* qemud/remote.c: s/virSecretLookupByUUIDString/virSecretLookupByUUID/
	  Fix get_nonnull_secret/make_nonnull_secret to use unsigned char
	* qemud/remote_protocol.x: Fix remote_nonnull_secret to use a
	  remote_uuid instead of remote_nonnull_string for UUID field.
	  Rename REMOTE_PROC_SECRET_LOOKUP_BY_UUID_STRING to
	  REMOTE_PROC_SECRET_LOOKUP_BY_UUID_STRING and make it take an
	  remote_uuid  value
	* qemud/remote_dispatch_args.h, qemud/remote_dispatch_prototypes.h,
	  qemud/remote_dispatch_ret.h, qemud/remote_dispatch_table.h,
	  qemud/remote_protocol.c, qemud/remote_protocol.h: Re-generate
	* src/datatypes.h, src/datatypes.c: Store UUID in raw format instead
	  of printable. Change virGetSecret to use raw format UUID
	* src/driver.h: Rename virDrvSecretLookupByUUIDString to
	  virDrvSecretLookupByUUID and use raw format UUID
	* src/libvirt.c: Add virSecretLookupByUUID and virSecretGetUUID
	  and re-implement virSecretLookupByUUIDString and
	  virSecretGetUUIDString in terms of those
	* src/libvirt_public.syms: Add virSecretLookupByUUID and
	  virSecretGetUUID
	* src/remote_internal.c: Rename remoteSecretLookupByUUIDString
	  to remoteSecretLookupByUUID. Fix typo in args for
	  remoteSecretDefineXML impl. Use raw UUID format for
	  get_nonnull_secret and make_nonnull_secret
	* src/storage_encryption_conf.c, src/storage_encryption_conf.h:
	  Storage UUID in raw format, and require it to be present in
	  XML. Use UUID parser to validate.
	* secret_conf.h, secret_conf.c: Generate a UUID if none is provided.
	  Storage UUID in raw format.
	* src/secret_driver.c: Adjust to deal with raw UUIDs. Save secrets
	  in a filed with printable UUID, instead of base64 UUID.
	* src/virsh.c: Adjust for changed public API contract of
	  virSecretGetUUIDString.
	* src/storage_Backend.c: DOn't undefine secret we just generated
	  upon successful volume creation. Fix to handle raw UUIDs. Generate
	  a non-clashing UUID
	* src/qemu_driver.c: Change to use lookupByUUID instead of
	  lookupByUUIDString

2009-09-14  Pritesh Kothari  <Pritesh.Kothari@Sun.COM>

	VBox bug when starting machine from old versions
	* src/vbox/vbox_tmpl.c: fix a bug where one can't start domains defined
	  with older builds or with empty "FRONTEND/Type" tag in their xml
	  files.

2009-09-14  Daniel P. Berrange  <berrange@redhat.com>

	Save vcpuinfo in status file
	* src/qemu_driver.c: Don't trust monitor for vcpu PID info on
	  restart
	* src/domain_conf.c: Save and load vCPU PID info from domain
	  status file

	Fix win32 platform build
	* configure.in: Only define WITH_SECRETS if libvirtd is present
	* src/Makefile.am: Only build secrets driver if WITH_SECRETS is
	  defined. Always add SECRET_DRIVER_SOURCES to EXTRA_DIST

	Restart libvirtd upon RPM upgrade
	* libvirt.spec.in: Restart libvirtd in %post

2009-09-14  Matthias Bolte  <matthias.bolte@googlemail.com>

	ESX cleanup of CPU model strings
	* src/esx/esx_driver.c: also strip (C) and (TM) from the CPU model
	  strings

	ESX avoid potential leaks
	* src/esx/esx_driver.c: reorder some function calls to avoid potential
	  virDomainPtr leaks

2009-09-14  Pritesh Kothari  <Pritesh.Kothari@Sun.COM>

	VBox 3.0.6 API change support
	* src/vbox/vbox_CAPI_v3_0.h: this includes minor API changes for VBox
	  3.0.6 released some days ago.

2009-09-11  Miloslav Trmač  <mitr@redhat.com>

	Add support for qcow encrypted volumes to qemu.
	Integrate with QEMU monitor to provide encryption passphrase when
	starting a guest using encrypted qcow volumes

	* src/qemu_driver.c (findDomainDiskEncryption,
	  findVolumeQcowPassphrase,
	  qemudMonitorSendVolumePassphrase, qemudMonitorSendCont): Send a volume
	  passphrase if qemu asks for it.

2009-09-11  Miloslav Trmač  <mitr@redhat.com>

	Provide missing passphrase when creating a volume.
	If the <encryption format='qcow'> element does not specify a secret
	during volume creation, generate a suitable secret and add it to the
	<encryption> tag.  The caller can view the updated <encryption> tag
	using virStorageVolGetXMLDesc().

	Similarly, when <encryption format='default'/> is specified while
	creating a qcow or qcow2-formatted volume, change the format to "qcow"
	and generate a secret as described above.

	* src/storage_encryption_conf.h (VIR_STORAGE_QCOW_PASSPHRASE_SIZE,
	  virStorageGenerateQcowPasphrase),
	  src/storage_encryption_conf.c (virStorageGenerateQcowPasphrase),
	  src/libvirt_private.syms: Add virStorageGenerateQcowPasphrase().
	* src/storage_backend.c (virStoragegenerateQcowEncryption,
	  virStorageBackendCreateQemuImg): Generate a passphrase and
	  <encryption> when creating a qcow-formatted encrypted volume and the
	  user did not supply the information.

2009-09-11  Miloslav Trmač  <mitr@redhat.com>

	Add virsh commands for secrets APIs
	* src/virsh.c: Add virsh commands.
	* docs/virsh.pod, virsh.1: Update documentation.

2009-09-11  Miloslav Trmač  <mitr@redhat.com>

	Local file implementation of secret driver API
	This implementation stores the secrets in an unencrypted text file,
	for simplicity in implementation and debugging.

	(Symmetric encryption, e.g. using gpgme, will not be difficult to add.
	Because the TLS private key used by libvirtd is stored unencrypted,
	encrypting the secrets file does not currently provide much additional
	security.)

	* include/libvirt/virterror.h, src/virterror.c (VIR_ERR_NO_SECRET): New
	  error number.
	* po/POTFILES.in, src/Makefile.am: Add secret_driver.
	* bootstrap: Use gnulib's base64 module.
	* src/secret_driver.c, src.secret_driver.h, src/libvirt_private.syms:
	  Add local secret driver.
	* qemud/qemud.c (qemudInitialize): Use the local secret driver.

2009-09-11  Miloslav Trmač  <mitr@redhat.com>

	Add an internal <secret> XML handling API
	Add a <secret> XML handling API, separate from the local driver, to
	avoid manually generating XML in other parts of libvirt.

	* src/secret_conf.c, src/secret_conf.h: New files.
	* po/POTFILES.in, src/Makefile.am: Add secret_conf.

2009-09-10  Miloslav Trmač  <mitr@redhat.com>

	Mask out flags used internally for virSecretGetValue
	Add a VIR_SECRET_GET_VALUE_INTERNAL_CALL flag value, replacing the
	originally separate libvirt_internal_call parameter.  The flag is used
	to differentiate external virSecretGetValue() calls from internal calls
	by libvirt drivers that need to use the secret even if it is private.

	* src/libvirt_internal.h Remove VIR_DOMAIN_XML_FLAGS_MASK
	* src/driver.h Add VIR_SECRET_GET_VALUE_FLAGS_MASK constant and
	  VIR_SECRET_GET_VALUE_INTERNAL_CALL. Re-add the
	  VIR_DOMAIN_XML_FLAGS_MASK constant
	* src/libvirt.c (virSecretGetValue): Don't allow the user to specify
	  internal flags.

2009-09-10  Daniel P. Berrange  <berrange@redhat.com>

	Fix use of dlopen modules
	Remove the bogus dependancy between node_device.c & storage_backend.c
	by moving the virWaitForDevices into util.h where it can be shared
	safely

	* src/storage_backend_disk.c, src/storage_backend_logical.c,
	  src/storage_backend_mpath.c, src/storage_backend_scsi.c: Replace
	  virStorageBackendWaitForDevices with virFileWaitForDevices
	* src/storage_backend.c, src/storage_backend.h: Remove
	  virStorageBackendWaitForDevices, virWaitForDevices
	* src/util.h, src/util.c: Add virFileWaitForDevices
	* configure.in: Move xmlrpc check further down after pkgconfig
	  is detected
	* src/Makefile.am: Add missing XMLRPC_CFLAGS/LIBS to opennebula
	* src/libvirt_private.syms: Add many missing exports

2009-09-10  Miloslav Trmač  <mitr@redhat.com>

	Consolidate "cont" into qemudMonitorSendCont()
	The interface allows qemudMonitorSendCont() to report errors that are
	not overridden by its callers.

	Also fix a potential infinite loop in qemuDomainCoreDump() if sending
	cont repeatedly fails.

	* src/qemu_driver.c (qemudMonitorSendCont): New function.
	  (qemudAutostartConfigs): Reset error before each call to
	  qemudStartVMDaemon().
	  (qemudInitCpus, qemudDomainResume, qemudDomainCoreDump,
	  qemudDomainRestore, qemudDomainMigratePerform,
	  qemudDomainMigrateFinish2): Use qemudMonitorSendCont().

2009-09-10  Miloslav Trmač  <mitr@redhat.com>

	Add <usage> to <secret> docs
	* docs/formatsecret.html.in, docs/formatsecret.html: Document <usage
	  type='volume'>, replacing stand-alone <volume>.
	* docs/schemas/secret.rng: Update schema to require <usage
	  type='volume'>

2009-09-10  Daniel P. Berrange  <berrange@redhat.com>

	Cleanup sec driver error reporting to use virReportSystemError
	* src/security_selinux.c: Use virReportSystemError whereever an
	  errno is involved
	* src/qemu_driver.c: Don't overwrite error message from the
	  security driver

	Support relabelling of USB and PCI devices
	* src/security.h: Driver API for relabelling host devices
	* src/security_selinux.c: Implement relabelling of PCI and USB
	  devices
	* src/qemu_driver.c: Relabel USB/PCI devices before hotplug

	Port QEMU driver to use USB/PCI device helpers
	* src/qemu_driver.c: Remove usbfs/sysfs iterator code and call
	  into generic helper APIs instead when setting device permissions

	Add helper APIs for iterating over PCI device resource files
	* src/pci.h, src/pci.c: Helper for iterating over PCI device
	  resource files
	* src/libvirt_private.syms: Export pciDeviceFileIterate

	Add helper module for dealing with USB host devices
	* src/Makefile.am: Add usb.h and usb.h to libvirt_util.la
	* src/libvirt_private.syms: Export symbols
	* src/usb.c, src/usb.h: Helper APIs for USB host devices

	Fix more OOM handling bugs
	* src/qemu_conf.c: Fix leak of values upon OOM
	* src/xend_internal.c: Fix missing check for OOM failure
	* tests/qemuargv2xmltest.c, tests/qemuxml2argvtest.c: Free
	  stateDir upon exit to avoid leak

	Fix logging buffer overrun read
	* src/logging.c: Fix buffer offset in logging read

2009-09-10  Daniel P. Berrange  <berrange@redhat.com>

	Fix misc thread locking bugs / bogus warnings
	Fix all thread locking bugs reported by object-locking test
	case.

	NB, some of the driver locking is getting too coarse. Driver
	mutexes really need to be turned into RW locks instead to
	significantly increase concurrency.

	* src/lxc_driver.c: Fix useof driver when unlocked in the methods
	  lxcDomainGetInfo, lxcSetSchedulerParameters, and
	  lxcGetSchedulerParameters
	* src/opennebula/one_driver.c: Fix missing unlock in oneDomainUndefine.
	  Fix use of driver when unlocked in oneDomainGetInfo,
	  oneGetOSType, oneDomainShutdown
	* src/qemu_driver.c: Fix use of driver when unlocked in
	  qemudDomainSavem, qemuGetSchedulerType, qemuSetSchedulerParameters
	  and qemuGetSchedulerParameters
	* src/storage_driver.c: Re-work storagePoolCreate to avoid bogus
	  lock checking warning. Re-work storageVolumeCreateXMLFrom to
	  remove a potential NULL de-reference & avoid bogus lock check
	  warnings
	* src/test.c: Remove testDomainAssignDef since it break lock chekc
	  warnings.
	* tests/object-locking.ml: Add oneDriverLock, oneDriverUnlock
	  and one_driver_t methods/types to allow lock checking on the
	   OpenNebula drivers

2009-09-10  Mark McLoughlin  <markmc@redhat.com>

	Test that domain-specific qemu machine types are used correctly
	* tests/testutilsqemu.c: add a machine types list for /usr/bin/kvm
	  which doesn't have any aliases, while the guest has aliases

	* tests/qemuxml2argvdata/qemuxml2argv-machine-aliases2.*,
	  tests/qemuxml2argvtest.c: add a test using /usr/bin/kvm and make
	  sure that 'pc' machine type doesn't get canonicalized using the
	  aliases in the guest machine type list

2009-09-10  Mark McLoughlin  <markmc@redhat.com>

	Simplify and fix qemudCanonicalizeMachine()
	The algorithm is quite simple:

	  If the emulator matches a guest's domain:
	    if domain has machine type info:
	      check the domain's machine type info
	    else
	      check the guest's default machine type info
	  else if the emulator matches the guest's default emulator:
	     check the guest's default machine type info

	The previous implementation was incorrectly falling back to the default
	machine type info if the domain's machine type info didn't have an
	alias.

	* src/qemu_driver.c: simplify and fix qemudCanonicalizeMachine()

2009-09-10  Mark McLoughlin  <markmc@redhat.com>

	Probe machine types from kvm binary too
	Currently we only probe the main qemu binary for machine types, but we
	should also probe the kvm binary.

	* src/qemu_conf.c: probe kvm binary machines in qemudCapsInitGuest()

2009-09-10  Mark McLoughlin  <markmc@redhat.com>

	Look up machine types from all domains in qemudGetOldMachines()
	Rather than just looking at the default domain info, look at all
	domains

	* src/qemu_conf.c: look at all domains in qemudGetOldMachines()

2009-09-10  Mark McLoughlin  <markmc@redhat.com>

	Split up qemudGetOldMachines()
	We need to look at all the domain infos in guest capabilities, not
	just the defaults.

	In order to allow that, split out a qemudGetOldMachinesFromInfo()
	from qemudGetOldMachines(). We'll make more use of it in the next
	patch.

	* src/qemu_conf.c: split out qemudGetOldMachinesFromInfo() from
	  qemudGetOldMachines()

2009-09-10  Mark McLoughlin  <markmc@redhat.com>

	Test qemu machine aliases
	* tests/testutilsqemu.c: make 'pc' an alias for qemu-system-x86_64

	* tests/qemuxml2argvdata/qemuxml2argv-machine-aliases1.*,
	  tests/qemuxml2argvtest.c: add a test which uses qemu-system-x86_64
	  and make sure the machine type is canonicalized.

2009-09-10  Mark McLoughlin  <markmc@redhat.com>

	Re-factor qemu test machine allocation code
	* test/testutilsqemu.c: split out code to testQemuAllocMachines()
	  and make use of the ARRAY_CARDINALITY macro

2009-09-10  Mark McLoughlin  <markmc@redhat.com>

	Canonicalize the qemu machine type in qemuxml2argvtest
	This doesn't have any affect on the current tests because we don't have
	any machine aliases in the current test data.

	* src/qemu_conf.h, src/qemu_driver.c: expose qemudCanonicalizeMachine()
	  for the tests

	* tests/qemuxml2argvtest.c: canonicalize the machine type

2009-09-10  Mark McLoughlin  <markmc@redhat.com>

	Dump qemu driver capabilities if test debugging enabled
	* src/testutils.[ch]: make testDebug externally available

	* src/testutilsqemu.c: if VIR_TEST_DEBUG is set, dump the qemu
	  driver capabilities to stderr

2009-09-10  Mark McLoughlin  <markmc@redhat.com>

	Fix formatting of machine types in capabilities XML
	* src/capabilities.c: fix machine type formatting in
	  virCapabilitiesFormatXML()

2009-09-10  Mark McLoughlin  <markmc@redhat.com>

	Add qemu -help test data for qemu-kvm-0.11.0-rc2
	* tests/qemuhelpdata/qemu-kvm-0.11.0-rc2: add data

	* tests/qemuhelptest.c: add expected output

2009-09-10  Mark McLoughlin  <markmc@redhat.com>

	Add a more featureful qemu capabilities test data
	Things added include

	  - x86_64 host
	  - Migration features
	  - NUMA topology
	  - Security model
	  - Canonical machine types
	  - Domain machine types
	  - An arm guest
	  - More machine types for mips, mipsel, sparc and ppc
	  - An x86_64 xenner guest

	This file was generated on a Fedora 12 machine using latest libvirt
	and qemu-kvm-0.11.0-rc2

	* tests/capabilityschemadata/caps-qemu-kvm.xml: add more features
	  to test

2009-09-10  Mark McLoughlin  <markmc@redhat.com>

	Add arm arch to capabilities schema
	* docs/schemas/capabilities.rng: add arm and sort arches

	Update capabilities schema to allow multiple machines per domain
	* docs/schemas/capabilities.rng: allow multiple machines per domain
	  just like they are allowed for guests

	Add esx and tcp migration uri transports to capabilities schema
	* docs/schemas/capabilities.rng: include esx and tcp uri_transport

2009-09-10  Chris Lalancette  <clalance@redhat.com>

	Fix regression from "Avoid polling on FDs with no events"
	After the mentioned patch was applied, I noticed that
	shutting down a kvm guest from inside (i.e. poweroff) caused
	the guest to shutdown, but not removed from the list of
	active guests.  DanB pointed out that the problem is that
	the virEventAddHandle() call in the qemu driver was asking
	to watch for 0 events, not HANGUP | ERROR as it should.  Add
	these events so that shutdown works again.

2009-09-10  Jim Meyering  <meyering@redhat.com>

	qemu_driver.c: factor out more duplication
	* src/qemu_driver.c (qemudDomainRestore): Use the new ...TypeToString
	function here, too.

2009-09-10  Ryota Ozaki  <ozaki.ryota@gmail.com>

	Close logfile fd after spawning qemu
	* src/qemu_driver.c: avoid a leak of file descriptor when exec'ing qemu

2009-09-10  Charles Duffy  <charles@dyfis.net>

	Reintroduce support for lzop compression
	lzop was removed due to some confusion over whether it provided functional
	advantages distinct from xz. This has been addressed in the mailing list post
	archived at http://permalink.gmane.org/gmane.comp.emulators.libvirt/16487, and
	support for lzop is re-added here.

	* libvirt.spec.in: add dependancy on lzop
	* src/qemu.conf: update documentation of save_image_format
	* src/qemu_driver.c: re-add lzop compression option

2009-09-09  Daniel Veillard  <veillard@redhat.com>

	Deprecate lzma and lzop in favor of xz, add dep
	* src/qemu_driver.c: drop lzma and lzop images compression options
	  as they are deprecated by xz
	* libvirt.spec.in: add requires for xz/bzip2/gzip as they are needed
	  to implement the compression options

2009-09-09  Maximilian Wilhelm  <max@rfc2324.org>

	Check for libssh2 >= 1.0 for phy driver
	* configure.in: phyp driver uses libssh2_session_block_directions()
	  which is only available in libssh2 >= 1.0, so check for this symbol
	  too when configuring

2009-09-09  Jim Meyering  <meyering@redhat.com>

	qemu_driver.c: factor out duplication in compression-type handling
	* src/qemu_driver.c (QEMUD_SAVE_FORMAT_LAST): Define.
	(qemudSaveCompressionTypeFromString): Declare.
	(qemudSaveCompressionTypeToString): Declare.
	(qemudDomainSave): Use those functions rather than open-coding them.
	Use "cat >> '%s' ..." in place of equivalent
	"dd of='%s' oflag=append conv=notrunc ...".

	also allow use of XZ for Qemu image compression
	* src/qemu_driver.c (enum qemud_save_formats) [QEMUD_SAVE_FORMAT_XZ]:
	New member.
	[QEMUD_SAVE_FORMAT_LZMA]: Mark as deprecated.
	Use an explicit value for each member.
	(qemudDomainSave, qemudDomainRestore): Handle the new member.
	* src/qemu.conf: Mention xz, too.

	openvz_conf.c: remove dead store to "p"; use strchrnul
	* src/openvz_conf.c (openvzReadNetworkConf): Replace open-coded
	while loop with equivalent use of strchrnul.
	* bootstrap (modules): Add strchrnul.

	build: update gnulib submodule to latest

2009-09-08  Daniel Veillard  <veillard@redhat.com>

	Remove some tabs used for indent

2009-09-08  Matthias Bolte  <matthias.bolte@googlemail.com>

	Avoid another leak in src/xend_internal.c
	* src/xend_internal.c: in xenDaemonLookupByID() if virGetDomain fails
	  free up the name

2009-09-08  Daniel Veillard  <veillard@redhat.com>

	Updated a number of localizations and regenerated

	Add flags and requires for Multipath storage
	* libvirt.spec.in: the new multipath module requires device-mapper
	  and device-mapper-devel for build

2009-09-08  Dave Allan  <dallan@redhat.com>

	Multipath storage support module
	* configure.in src/Makefile.am src/storage_backend.[ch]
	  src/storage_conf.[ch] src/storage_backend_mpath.[ch] po/POTFILES.in:
	  add a new module for storage multipath, it requires device-mapper

2009-09-08  Matthias Bolte  <matthias.bolte@googlemail.com>

	Avoid a leak in xenDaemonLookupByID
	* src/xend_internal.c: free name in xenDaemonLookupByID() if
	  virGetDomain() fails

2009-09-08  Miloslav Trmač  <mitr@redhat.com>

	Add a missing comment
	* src/libvirt_private.syms: Add a missing comment for
	  storage_encryption_conf.h entries

	Fix a pasto in storage_encryption_conf.c
	* src/storage_encryption_conf.c: small typo fix in top comment

2009-09-08  Jim Meyering  <meyering@redhat.com>

	xm_internal.c: remove four useless comparisons after strchr
	* src/xm_internal.c (xenXMDomainConfigParse): After t=strchr...
	don't test *t; it's known.  This was *not* detected by clang,
	but I spotted it since once instance was in the vicinity of the
	dead increment of "data".

	xm_internal.c: remove dead increment of "data"
	* src/xm_internal.c (xenXMDomainConfigParse): Don't increment it.

	network_driver.c: remove dead store to "err"
	* src/network_driver.c (networkSetAutostart): ...and its decl.

	iptables.c: remove dead store to "s"
	* src/iptables.c (iptablesAddRemoveRule): Remove dead store.

	util.c: avoid dead store to "flag"
	* src/util.c (virExecDaemonize): Change flag |= VAR to "flag | VAR".

	domain_conf.c: remove two dead stores
	* src/domain_conf.c (virDomainSaveXML): Remove use and decl of "err".
	(virDomainDefParseXML): Likewise.

	xm_internal.c: remove two ret=... dead stores
	* src/xm_internal.c (xenXMDomainCreate): Remove dead stores.

	xm_internal.c: remove dead stores of local, "type"
	* src/xm_internal.c (xenXMDomainConfigParse): Remove declaration
	and useless containing if-block, too.

2009-09-07  Pritesh Kothari  <Pritesh.Kothari@Sun.COM>

	VBox fix minor bugs in display and added OOM checks
	* src/vbox/vbox_tmpl.c: minor bug in selecting the graphics type. if the
	  graphics type was desktop it was assumed that display is set for it,
	  and thus crashed on strdup. Also adds a number of missing OOM checks.

2009-09-07  Jim Meyering  <meyering@redhat.com>

	network_conf.c: remove dead store to "err"
	* src/network_conf.c (virNetworkDefParseXML): ...and its decl.

	openvz_driver.c: avoid dead store to "err"
	* src/openvz_driver.c (openvzGenerateContainerVethName): Remove use
	and decl of "err".

	xend_internal.c: Remove two dead stores to "ret"
	* src/xend_internal.c (xenDaemonCreateXML): Don't set "ret" after
	last use.

	storage_driver.c: remove two dead stores to "backend"
	* src/storage_driver.c (storagePoolGetInfo, storagePoolDefine):
	Remove variable, backend, since its value was never used.

2009-09-07  Daniel Veillard  <veillard@redhat.com>

	Merge branch 'tmp'

2009-09-07  Matthias Bolte  <matthias.bolte@googlemail.com>

	Some close/fclose/closedir calls are missing
	* src/openvz_conf.c src/qemu_driver.c src/storage_backend_scsi.c
	  src/xen_inotify.c: closes various file descriptors leaks

2009-09-05  Jim Meyering  <meyering@redhat.com>

	lxc_container.c: avoid a leak on error paths
	* src/lxc_container.c (lxcContainerMountBasicFS): Don't leak upon failure.
	Add "cleanup:" label and change each post-allocation failure to
	use "goto cleanup" rather than returning immediately.

	qemu_conf.c: add a comment suggesting why we leave a dead-store
	* src/qemu_conf.c (qemuBuildHostNetStr): Do not remove the type_sep=','
	dead store, since not having it would be a problem if we ever add a
	new attribute=VAL option.

	hash.c: remove a dead store
	* src/hash.c (virHashFree): Remove useless assignment to inside_table.

	interface_conf.c: remove a dead-store and declaration
	* src/interface_conf.c (virInterfaceDefParseDhcp): Remove unused "old".

	eventtest.c: detect write failure and avoid dead stores
	* tests/eventtest.c (mymain): Exit nonzero upon write failure.
	This also avoids several dead stores of the form ret = safewrite...

	openvz_conf.c: Remove dead store to copy_fd
	* src/openvz_conf.c (openvz_copyfile): Remove unused assignment.

	storage_backend_logical.c: appease clang: remove useless increment
	* src/storage_backend_logical.c (virStorageBackendLogicalBuildPool):
	Don't increment "n" when we won't use the result.

2009-09-05  Matthias Bolte  <matthias.bolte@googlemail.com>

	ESX raise error if UUID parse failed
	* src/esx/esx_util.c: let esxUtil_GetConfigUUID() report an error if
	  virUUIDParse() fails

	ESX add domain undefine based on esxVI_UnregisterVM
	* src/esx/esx_driver.c: add esxDomainUndefine() based on
	  esxVI_UnregisterVM()
	* src/esx/esx_vi_methods.[ch]: add esxVI_UnregisterVM()

	ESX add esxGetCapabilities() with basic defaults
	* src/esx/esx_driver.c: add esxCapsInit() with default caps and add
	  esxGetCapabilities()

	ESX simplify SOAP request and response handling
	* src/esx/esx_vi.[ch]: convert esxVI_RemoteRequest_Execute() to a
	  simpler esxVI_Context_Execute() version, remove esxVI_RemoteRequest
	  and convert esxVI_RemoteResponse to esxVI_Response
	* src/esx/esx_vi_methods.c: update and simplify callers to use
	  esxVI_Context_Execute() instead of esxVI_RemoteRequest_Execute()

	ESX use virXPathNode*() to simplify XPath handling
	* src/esx/esx_vi.[ch]: use virXPathNode*() in
	  esxVI_RemoteRequest_Execute() and remove
	  esxVI_RemoteResponse_DeserializeXPathObject*()
	* src/esx/esx_vi_methods.c: update callers to use the new syntax of
	  esxVI_RemoteRequest_Execute()

	ESX: make esxVI_GetVirtualMachineIdentity() robust
	* src/esx/esx_driver.c: add configStatus to the requested properties
	  to check it in esxVI_GetVirtualMachineIdentity()
	* src/esx/esx_vi.[ch]: add esxVI_GetManagedEntityStatus()
	  and use it in esxVI_GetVirtualMachineIdentity()
	* src/esx/esx_vi_types.[ch]: add VI type esxVI_ManagedEntityStatus

2009-09-04  Matthias Bolte  <matthias.bolte@googlemail.com>

	ESX: Fix VMX path parsing and URL encoding
	* src/esx/esx_driver.c: handle spaces in VMX file path and use a
	  virBuffer to encode spaces correctly in the resulting URL
	* src/esx/esx_vi.c: include the URL in the error message in case
	  of a download error

2009-09-04  Pritesh Kothari  <Pritesh.Kothari@Sun.COM>

	VBox add Storage Volume support
	* src/vbox/vbox_driver.c src/vbox/vbox_tmpl.c: adds the driver for
	  storage volumes

2009-09-04  Ryota Ozaki  <ozaki.ryota@gmail.com>

	Fix several memory leaks
	* src/domain_conf.c src/network_conf.c src/qemu_conf.c
	  src/storage_backend_fs.c: various problems spotted by valgrind
	  through libvirt code

2009-09-04  Pritesh Kothari  <Pritesh.Kothari@Sun.COM>

	VBox driver cleanups
	* src/vbox/vbox_tmpl.c: a bit of cleanup

2009-09-04  Laine Stump  <laine@laine.org>

	Minor comment changes
	* src/libvirt.c: fix some minor grammer (and one other) nits in comments
	  that end up in generated API reference documentation

	Fix a memory leak in virsh
	* src/virsh.c: cmdNodeDeviceDumpXML wasn't freeing
	  virNodeDeviceGetXMLDesc() return string

2009-09-04  Daniel P. Berrange  <berrange@redhat.com>

	Fix ID field in virDomainPtr after starting Xen VM
	* src/xend_internal.c: Lookup guest after starting persistent
	  config in order to refresh the domain ID field

2009-09-04  Daniel Veillard  <veillard@redhat.com>

	PHYP driver cleanups
	* libvirt.spec.in: activate phyp and fix the BuildDep to libssh2-devel
	* src/phyp/phyp_driver.c: fix a debug macro to use the normal logging API

2009-09-04  Eduardo Otubo  <otubo@linux.vnet.ibm.com>

	Switch Power Hypervisor to libssh2
	* configure.in src/Makefile.am: change detection and flags
	* src/phyp/phyp_driver.c src/phyp/phyp_driver.h: connection now
	  need to be done as part of the driver code, cleaned up by DV

2009-09-04  Chris Lalancette  <clalance@redhat.com>

	Allow libvirtd to RPC to external libvirtd
	* src/remote_internal.c: in remoteOpen() allow the daemon itself to make
	  RPCs to an external libvirtd, but only if the URI is fully specified.

2009-09-04  Daniel P. Berrange  <berrange@redhat.com>

	Fix memory leak of monitor character device
	* src/qemu_driver.c: Free the vm->monitor_chr field at VM shutdown.
	  Unlink the UNIX domain socket at VM shutdown to avoid littering
	  FS with old sockets

	Automatically set correct ownership of QEMU state directories
	* src/qemu_driver.c: Change ownership of /var/{lib,cache}/libvirt/qemu
	  to match user/group that QEMU VMs are configured to run as.

2009-09-04  Daniel P. Berrange  <berrange@redhat.com>

	Move QEMU monitor socket in /var/lib/libvirt/qemu
	Separate the guest created QEMU monitor socket location
	from the libvirtd create XML / PID data files, to improve
	security separation when running QEMU non-root

	* libvirt.spec.in: Leave /var/run/libvirt/qemu as root:root
	* src/qemu_conf.h: Add libDir and cacheDir directory paths
	* src/qemu_driver.c: Move QEMU monitor socket from
	  stateDir to libDir to avoid making security critical directory
	  accessible to QEMU guests.
	* src/util.c: Delay running hook till after damonizing to
	  ensure pidfile is still written before changing UID/GID

2009-09-04  Daniel P. Berrange  <berrange@redhat.com>

	Avoid polling on FDs with no events enabled
	If a file descriptor with events=0 was added to the libvirtd
	event loop, it would still be added to the poll() fds' array.
	While it wouldn't see any POLLIN/OUT events, it'd still get
	triggered for HANGUP/ERROR events which was not in compliance
	with the libvirt events API contract.

	* qemud/event.c: Don't poll on FDs with events=0
	* tests/eventtest.c: Add test case to validate fix to event.c

2009-09-04  Jim Meyering  <meyering@redhat.com>

	xen_internal.c: remove two unused local variables
	* src/xen_internal.c (xenHypervisorSetSchedulerParameters): Remove
	set-but-never-used local variables, cap_set and weight_set.

2009-09-04  Matthias Bolte  <matthias.bolte@googlemail.com>

	esx_vi: return -1 upon failure, as intended
	* src/esx/esx_vi.c (esxVI_Enumeration_Deserialize): Fix
	reversed goto and result=-1 statements.

2009-09-04  Jim Meyering  <meyering@redhat.com>

	python: let libvirt_virConnectDomainEventCallback indicate success
	* python/libvir.c (libvirt_virConnectDomainEventCallback): Return 0
	when successful, rather than always returning -1.
	clang flagged this function for its dead-store of "ret=0".
	Once "ret" was set to 0, it was never used, and
	the function would always return -1.

	mdns.c: remove dead initialization
	* qemud/mdns.c (libvirtd_mdns_client_callback): Remove dead
	initialization.

	node_device_conf.c: remove dead initialization
	* src/node_device_conf.c (virNodeDeviceDefFormat): Remove dead
	initialization.

	openvz_conf.c: don't use undefined local, "net"
	* src/openvz_conf.c (openvzReadNetworkConf): Initialize "net".
	Otherwise, upon openvzRead... failure, we would "goto error;"
	where an uninitialized "net" could be dereferenced.

	test.c: don't use undefined local, "def"
	* src/test.c (testOpenVolumesForPool): Upon early virAsprintf or
	virXPathNodeSet failure, "goto error" would take us to
	virStorageVolDefFree(def), but with "def" not defined.
	Initialize it to NULL.

	uml_conf.c: don't return an uninitialized pointer
	* src/uml_conf.c (umlBuildCommandLineChr): Initialize "ret".

	storage_backend.c: assure clang that inputvol can't be NULL
	* src/storage_backend.c: Include "internal.h".
	(virStorageBackendCopyToFD): Mark inputvol parameter as "nonnull".
	Remove test for non-NULL inputvol.  Both callers ensure it's non-NULL.

	libvir.c: avoid NULL dereference in virStoragePoolSetAutostart
	* src/libvirt.c (virStoragePoolSetAutostart): Return -1 if the pool
	argument is invalid, rather than "goto error" where we could dereference
	that possibly-NULL "pool".
	(virConnectFindStoragePoolSources): Likewise.
	(virConnectNumOfDomains): Likewise.
	Daniel P. Berrange spotted that the two latter functions
	needed the same treatment.

	remote_internal.c: appease clang
	* src/remote_internal.c (remoteNetworkOpen): Mark "conn" parameter
	as non-NULL.  Remove now-unnecessary "conn == NULL" test.
	(remoteDevMonOpen): Likewise.
	(remoteSecretOpen): Likewise.
	(remoteStorageOpen): Likewise.
	(remoteInterfaceOpen): Likewise.

	infra: define ATTRIBUTE_NONNULL to mark non-NULL parameters
	* src/internal.h (ATTRIBUTE_NONNULL): Define.

	lxc: don't unlink(NULL) in main
	* src/lxc_controller.c (main): Unlink sockpath only if it's non-NULL.

	lxc: avoid NULL dereference upon getmntent failure
	* src/lxc_container.c (lxcContainerUnmountOldFS): Don't pass
	a NULL pointer to qsort.

	storage_conf.c: avoid overflow upon use of "z" or "Z" (zebi) suffix
	* src/storage_conf.c (virStorageSize): Don't try to compute 1024^7,
	since it's too large for a 64-bit type.

	storage_backend_fs: avoid NULL dereference on opendir failure
	* src/storage_backend_fs.c (virStorageBackendFileSystemRefresh):
	Don't call closedir on a NULL pointer.

2009-09-03  Pritesh Kothari  <Pritesh.Kothari@Sun.COM>

	VBox cleanup and update of networking shutdown
	* src/vbox/vbox_tmpl.c: merged vboxNetworkUndefine() and
	  vboxNetworkDestroy() and added code to handle multiple hostonly
	  interfaces.

	VBox cleanup and update of networking XML functions
	* src/vbox/vbox_tmpl.c: merged vboxNetworkCreateXML() and
	  vboxNetworkDefineXML() and added code to handle multiple hostonly
	  interfaces.

2009-09-03  Daniel P. Berrange  <berrange@redhat.com>

	Add support for setting disk drive serial numbers
	* docs/schemas/domain.rng: Add <serial> element to disks
	* src/domain_conf.h, src/domain_conf.c: XML parsing and
	  formatting for disk serial numbers
	* src/qemu_conf.c: Set serial number when launching guests
	* tests/qemuxml2argvdata/qemuxml2argv-disk-drive-shared.args,
	  tests/qemuxml2argvdata/qemuxml2argv-disk-drive-shared.xml: Add
	  serial number to XML test

2009-09-03  Daniel P. Berrange  <berrange@redhat.com>

	Support configuration of huge pages in guests
	Add option to domain XML for

	     <memoryBacking>
	        <hugepages/>
	     </memoryBacking>

	* configure.in: Add check for mntent.h
	* qemud/libvirtd_qemu.aug, qemud/test_libvirtd_qemu.aug, src/qemu.conf
	  Add 'hugetlbfs_mount' config parameter
	* src/qemu_conf.c, src/qemu_conf.h: Check for -mem-path flag in QEMU,
	  and pass it when hugepages are requested.
	  Load hugetlbfs_mount config parameter, search for mount if not given.
	* src/qemu_driver.c: Free hugetlbfs_mount/path parameter in driver shutdown.
	  Create directory for QEMU hugepage usage, chowning if required.
	* docs/formatdomain.html.in: Document memoryBacking/hugepages elements
	* docs/schemas/domain.rng: Add memoryBacking/hugepages elements to schema
	* src/util.c, src/util.h, src/libvirt_private.syms: Add virFileFindMountPoint
	  helper API
	* tests/qemuhelptest.c: Add -mem-path constants
	* tests/qemuxml2argvtest.c, tests/qemuxml2xmltest.c: Add tests for hugepage
	  handling
	* tests/qemuxml2argvdata/qemuxml2argv-hugepages.xml,
	  tests/qemuxml2argvdata/qemuxml2argv-hugepages.args: Data files for
	  hugepage tests

2009-09-03  Daniel P. Berrange  <berrange@redhat.com>

	Fix misc OOM bugs
	* tests/testutils.c: Run test function twice, once to prime it for
	  static allocations, once to count the non-static allocations.
	* tests/testutilsqemu.c: Initialize variable correctl
	* src/capabilities.c: Don't free machines variable upon failure
	  since caller must do that
	* src/xm_internal.c: Add missing check for OOM in building VIF
	  config param

2009-09-03  Pritesh Kothari  <Pritesh.Kothari@Sun.COM>

	VBox support for defining/dumping video devices
	* src/vbox/vbox_tmpl.c: add setting of video and acceleration in
	  VBox driver, and the ability to save this back for serialization

	Generic parsing support for video acceleration
	* docs/schemas/domain.rng: augment the video model with an optional
	  acceleration element with optional accel2d and accel3d flags
	* src/domain_conf.c src/domain_conf.h: exten the virDomainVideoDef
	  structure with an optional accel field, virDomainVideoAccelDefParseXML
	  and virDomainVideoAccelDefFormat functions to parse and serialize
	  the structure.

2009-09-02  Chris Lalancette  <clalance@redhat.com>

	Fix bugs in virDomainMigrate v2 code.
	Paolo Bonzini points out that in my refactoring of the code for
	virDomainMigrate(), I added a check for the return value from
	virDomainMigratePerform().  The problem is that we don't want to
	exit if we fail, we actually want to go on and do
	virDomainMigrateFinish2() with a non-0 return code to clean things
	up.  Remove the check.

	While reproducing this issue, I also noticed that we wouldn't
	always properly propagate an error message.  In particular, I
	found that if you blocked off the migration ports (with iptables)
	and then tried the migration, it would actually fail but we would
	get no failure output from Qemu.  Therefore, we would think we
	succeeded, and leave a huge mess behind us.  Execute the monitor
	command "info migrate", and look for a failure string in there
	as well.

2009-09-02  Matthias Bolte  <matthias.bolte@googlemail.com>

	VMware ESX: Don't warn on some query parameter
	* src/esx/esx_util.c: esxUtil_ParseQuery() warns if a known query
	  parameter should be ignored due to the corresponding char/int pointer
	  being NULL, instead of silently ignoring it. Fix the control flow.

	VMware ESX: Allow ethernet address type 'vpx'
	* src/esx/esx_vmx.c: add an extra type of addressType beside 'static'
	  and 'generated', 'vpx' indicates that the MAC address was generated
	  by a vCenter.

2009-09-02  Daniel P. Berrange  <berrange@redhat.com>

	Don't blindly reorder disk drives
	Calling qsort() on the disks array causes disk to be
	unneccessarily re-ordered, potentially breaking the
	ability to boot if the boot disk gets moved later in
	the list. The new algorithm will insert a new disk as
	far to the end of the list as possible, while being
	ordered correctly wrt other disks on the same bus.

	* src/domain_conf.c, src/domain_conf.h: Remove disk sorting
	  routines. Add API to insert a disk into existing list at
	  the optimal position, without resorting disks
	* src/libvirt_private.syms: Export virDomainDiskInsert
	* src/xend_internal.c, src/xm_internal.c: Remove calls to
	  qsort, use virDomainDiskInsert instead.
	* src/qemu_driver.c: Remove calls to qsort, use virDoaminDiskInsert
	  instead. Fix reordering bugs when hotunplugging disks and
	  networks. Fix memory leak in disk/net unplug

2009-09-02  Pritesh Kothari  <Pritesh.Kothari@Sun.COM>

	Support for getting/setting number of cpus in VBox
	* src/vbox/vbox_tmpl.c: adds support for getting/setting number of cpus

2009-09-02  Daniel P. Berrange  <berrange@redhat.com>

	Misc fixes to secrets API code
	* proxy/Makefile.am: Build storage_encryption_conf.c since its a
	  dependancy of domain_conf.c
	* src/storage_encryption_conf.c: Disable XML parsing APis when
	  build under proxy
	* src/test.c: Add a dummy no-op secrets driver for test suite

	Only add glusterfs dep for Fedora >= 11
	* libvirt.spec.in: Conditionalize glusterfs requires line for
	  Fedora >= 11, since other distros don't have it available

	Remove redundant base64 include file
	* src/storage_encryption_conf.c: Remove base64.h

	Add Miloslav Trmač to AUTHORS file

2009-09-02  Miloslav Trmač  <mitr@redhat.com>

	Make handling of monitor prompts more general.
	* src/qemu_driver.c: Support arbitrary callbacks for "secondary
	  prompts".  Reimplement qemudMonitorCommandExtra using such a
	  callback.

2009-09-02  Miloslav Trmač  <mitr@redhat.com>

	Don't assume buffered output echoes the command.
	The if ((nlptr...)) implicitly assumes commptr != NULL (and that "buf"
	starts with "cmd").  Make the assumption explicit, it will be broken in
	a future patch.

	* src/qemu_driver.c: Don't assume buffered monitor output echoes the
	  command.

2009-09-02  Miloslav Trmač  <mitr@redhat.com>

	Attach encryption information to virDomainDiskDef.
	The XML allows <encryption format='unencrypted'/>, this implementation
	canonicalizes the internal representation so that "disk->encryption" is
	non-NULL iff encryption information is available.

	A domain with partial encryption information can be defined,
	completeness of the information is not verified.  The domain won't
	start until the remaining information is added, of course.

	* docs/formatdomain.html, docs/formatdomain.html.in: Document
	  new encryption options for disks
	* docs/schemas/domain.rng: Pull in storage encryption schema
	  rules
	* src/domain_conf.h, src/domain_conf.c: Wire up storage encryption
	  XML parsing/formatting APIs

2009-09-02  Miloslav Trmač  <mitr@redhat.com>

	Add support for encrypted (qcow) volume creation.
	Supports only virStorageVolCreateXML, not virStorageVolCreateXMLFrom.

	Curiously, qemu-img does not need the passphrase for anything to create
	an encrypted volume.  This implementation thus does not need to touch
	any secrets to work with cooperating clients.  More generic passphrase
	handling is added in the next patch.

	* src/storage_backend.c: Request encryption when creating qcow/qcow2
	  files
	* src/storage_backend_disk.c, src/storage_backend_fs.c,
	  src/storage_backend_logical.c: Refuse to create volumes with
	  encryption params set.

2009-09-02  Miloslav Trmač  <mitr@redhat.com>

	Recognize encryption format of qcow volumes.
	(The implementation is not very generic, but that can be very
	easily rectified if/when new encryption formats appear.)

	* src/storage_backend_fs.c: Probe for qcow/qcow2 encryption
	  algorithm field

2009-09-02  Miloslav Trmač  <mitr@redhat.com>

	Attach encryption information to virStorageVolDef.
	The XML allows <encryption format='unencrypted'/>, this implementation
	canonicalizes the internal representation so that "vol->encryption" is
	non-NULL iff the volume is encrypted.

	Note that partial encryption information (e.g. specifying an encryption
	format, but not the key/passphrase) is valid, libvirt will automatically
	choose value for the missing information during volume creation.  The
	user can read the volume XML, and use the unmodified <encryption> tag in
	future operations (without having to be able to understand) its contents.

	* docs/formatstorage.html, docs/formatstorage.html.in: Document
	  storage volume encryption options
	* src/storage_conf.c, src/storage_conf.h: Hook up storage
	  encryption XML handling
	* tests/storagevolschemadata/vol-qcow2.xml: Test case for encryption
	  schema changes

2009-09-02  Miloslav Trmač  <mitr@redhat.com>

	Add volume encryption information handling.
	Define an <encryption> tag specifying volume encryption format and
	format-depenedent parameters (e.g. passphrase, cipher name, key
	length, key).

	Currently the only defined parameter is a reference to a "secret"
	(passphrase/key) managed using the virSecret* API.

	Only the qcow/qcow2 encryption format, and a "default" format used to
	let libvirt choose the format during volume creation, is currently
	supported.

	This patch does not add any users; the <encryption> tag is added in
	the following patches to both volumes (to support encrypted volume
	creation) and domains.

	* docs/*.html: Re-generate
	* docs/formatstorageencryption.html.in, docs/sitemap.html.in:
	  Add page describing storage encryption data format
	* docs/schemas/Makefile.am, docs/schemas/storageencryption.rng:
	  Add RNG schema for storage encryption format
	* po/POTFILES.in: Add src/storage_encryption_conf.c
	* src/libvirt_private.syms: Export virStorageEncryption* functions
	* src/storage_encryption_conf.h, src/storage_encryption_conf.c: Internal
	  helper APIs for dealing with storage encryption format
	* libvirt.spec.in, mingw32-libvirt.spec.in: Add storageencryption.rng
	  RNG schema

2009-09-02  Miloslav Trmač  <mitr@redhat.com>

	Secret manipulation API docs refresh & wire up python generator
	Sample session:

	>>> import libvirt
	>>> c = libvirt.open('qemu:///session')

	>>> c.listSecrets()
	['12247729-47d2-a783-88ce-b329d4781cd3', 'reee', 'abc']

	>>> s = c.secretDefineXML("<secret ephemeral='no' private='no'>\n<description>Something for use</description>\n<volume>/foo/bar</volume>\n</secret>\n")

	>>> s.UUIDString()
	'340c2dfb-811b-eda8-da9e-25ccd7bfd650'

	>>> s.XMLDesc()
	"<secret ephemeral='no' private='no'>\n  <uuid>340c2dfb-811b-eda8-da9e-25ccd7bfd650</uuid>\n  <description>Something for use</description>\n  <volume>/foo/bar</volume>\n</secret>\n"

	>>> s.setValue('abc\0xx\xffx')
	0

	>>> s.value()
	'abc\x00xx\xffx'

	>>> s.undefine()
	0

	* python/generator.py: Add rules for virSecret APIs
	* python/libvir.c, python/libvirt-python-api.xml: Manual impl of
	  virSecretSetValue, virSecretGetValue$ and virConnectListSecrets APIs
	* python/libvirt_wrap.h, python/types.c: Wrapper for virSecret objects
	* docs/libvirt-api.xml, docs/libvirt-refs.xml,
	  docs/html/libvirt-virterror.html, docs/html/libvirt-libvirt.html,
	  docs/devhelp/libvirt-virterror.html, docs/devhelp/libvirt-libvirt.html:
	  Re-generate with 'make api'

2009-09-02  Miloslav Trmač  <mitr@redhat.com>

	Secret manipulation remote client
	* src/remote_internal.c: Implement client binding for new secrets
	  APIs
	* src/datatypes.h: Add 'void *secretPrivateData' to virConnectPtr
	  struct

	Secret manipulation libvirtd wire protocol & remote dispatcher
	* qemud/remote_protocol.x: Define wire protocol for secrets public
	  APIs
	* qemud/remote_protocol.h, qemud/remote_protocol.c,
	  qemud/remote_dispatch_table.h, qemud/remote_dispatch_ret.h,
	  qemud/remote_dispatch_prototypes.h, qemud/remote_dispatch_args.h:
	  Re-generate from updated protocol definition
	* qemud/remote.c: Implement RPC dispatchers for new secrets APIs

	Secret manipulation public API implementation
	* include/libvirt/virterror.h, src/virterror.c: Add VIR_ERR_INVALID_SECRET
	  and VIR_FROM_SECRET
	* src/libvirt.c: Define stubs for every new public API

	Secret manipulation internal API
	* include/libvirt/virterror.h, src/virterror.c: Add VIR_WAR_NO_SECRET
	* src/libvirt_private.syms, src/datatypes.h, src/datatypes.c: Type
	  virSecret struct definition and helper APIs
	* src/driver.h: Sub-driver API definitions for secrets
	* src/libvirt.c: Define new sub-driver for secrets

2009-09-02  Miloslav Trmač  <mitr@redhat.com>

	Secret manipulation public API
	This patch adds a "secret" as a separately managed object, using a
	special-purpose API to transfer the secret values between nodes and
	libvirt users.

	* docs/schemas/secret.rng, docs/schemas/Makefilem.am: Add new
	  schema for virSecret objects
	* docs/*html: Re-generated
	* docs/formatsecret.html.in, docs/sitemap.html.in: Add page
	  describing the virSecret XML schema
	* include/libvirt/libvirt.h.in: Define the new virSecret public
	  API
	* src/libvirt_public.syms: Export symbols for new public APIs
	* mingw32-libvirt.spec.in, libvirt.spec.in: Add secret.rng to
	  files list

2009-09-01  Daniel Veillard  <veillard@redhat.com>

	Update chinese, polish and spanish localizations
	* po/*: and update the po set

2009-09-01  Charles Duffy  <charles@dyfis.net>

	support lzop save compression for qemu
	Per prior discussion -- this was, indeed, trivial.

	I'm a little disappointed to be breaking the ordering characteristics of
	the enum (as it had been ordered by increasing time requirements and
	decreasing output size), but breaking any save files with the old
	constants in the headers would of course be worse.

	>From 2a9cdcfc88de091a8d34aa3fc3b1208d7681790e Mon Sep 17 00:00:00 2001
	From: Charles Duffy <Charles_Duffy@dell.com>
	Date: Fri, 28 Aug 2009 11:49:54 -0500
	Subject: [PATCH] support lzop save compression for qemu

	One of the larger disincentives towards use of compression for migrated-out save
	files is performance impact. This patch adds support for lzop; CPU time for
	compression is about 5x faster than gzip (the next most performant algorithm)
	and decompression is about 3x faster.

2009-09-01  Chris Lalancette  <clalance@redhat.com>

	OpenVZ: accept NULL as type for GetMaxVCPUs.
	All of the other drivers that support the getMaxVcpus callback
	also accept a NULL value for type.  Make openvz also accept a
	NULL value.

	Remove use of strncpy in qemudExtractMonitorPath.
	qemudExtractMonitorPath() was doing a VIR_ALLOC_N followed by a
	strncpy.  However, this isn't necessary; we can do the same thing
	using strndup, which is much safer.

	Fix up virNodeGetCellsFreeMemory
	The documentation for virNodeGetCellsFreeMemory claims the values
	returned are in kilobytes, but that's actually wrong; the value
	returned is actually in bytes.  Fix up the documentation to be
	correct.

2009-08-30  Jim Fehlig  <jfehlig@novell.com>

	Fix sexpr2string() to handle empty list.
	S-expression containing empty lists, e.g. (cpus (() () () ())),
	was not being handled properly in sexpr2string() serialization.
	Emit an empty list when encountering NIL sexpr kind.

2009-08-28  Daniel P. Berrange  <berrange@redhat.com>

	Fix driver entry table for UML numa APIs
	* src/uml_driver.c: Fix numa API driver entries to avoid
	  infinite loop

2009-08-28  Pritesh Kothari  <Pritesh.Kothari@Sun.COM>

	Fix crash in virsh vol-key command
	* src/virsh.c: Pass in pool object to avoid crash in key lookup

2009-08-26  Daniel P. Berrange  <berrange@redhat.com>

	Refactor policycode auth code to avoid compiler warnings
	* src/remote_internal.c: Split remoteAuthPolkit into separate
	  impls for v0 and v1 to avoid compile warnings due to unused
	  variables/params
	* qemud/remote.c: Remove accidental tabs

2009-08-25  Daniel P. Berrange  <berrange@redhat.com>

	Support new PolicyKit 1.0 API
	* configure.in: Check for pkcheck which indicates new policykit
	* qemud/Makefile.am: Install different versions of policy
	* qemud/libvirtd.policy: Rename to libvirtd.policy-0
	* qemud/libvirtd.policy-1: new style policy
	* qemud/qemud.c, qemud/qemud.h, qemud/remote.c: Support new
	  policykit API via external pkcheck helper
	* src/remote_internal.c: Don't prompt for polkit auth with new
	  policykit API
	* libvirt.spec.in: deal with new policy install locations & deps

2009-08-21  Darryl L. Pierce  <dpierce@redhat.com>

	517157 fix selinux problem with images on NFS
	* src/security_selinux.c: ignores EOPNOTSUPP when attempting to access an
	  NFS share

2009-08-21  Mark McLoughlin  <markmc@redhat.com>

	spec file: add URL to Source tag
	See https://fedoraproject.org/wiki/Packaging:SourceURL

2009-08-20  Mattias Bolte  <matthias.bolte@googlemail.com>

	Fix phypOpen() escape_specialcharacters
	Matthias correctly points out that escape_specialcharaters() takes a
	length, and since we are now malloc()'ing string in phypOpen instead of
	making it a static array, we can't use sizeof(string) anymore.  Calculate
	the proper strlen and then use that both to allocate the string and also
	pass it to escape_specialcharacters().

2009-08-20  Mattias Bolte  <matthias.bolte@googlemail.com>

	Power Hypervisor: fix potential segfault
	I came across this line in the phypOpen function:

	char string[strlen(conn->uri->path)];

	Here the path part of the given URI is used without checking it for
	NULL, this can cause a segfault as strlen expects a string != NULL.
	Beside that uuid_db and connection_data leak in case of an error.

	In this line

	conn->uri->path = string;

	the original path of the URI leaks. The patch adds a VIR_FREE call
	before setting the new path.

	The attached patch is compile-tested but I don't have a Power
	Hypervisor installation at hand to test it for real.

	Matthias

2009-08-20  Chris Lalancette  <clalance@redhat.com>

	Small fixes for qemu save compression.
	Fix up a small memory leak pointed out by DanB; I was forgetting
	to release memory allocated to driver->saveImageFormat.
	Also add the "save_image_format" and "security" entries to
	the augeas lens.

2009-08-20  Daniel P. Berrange  <berrange@redhat.com>

	Add test for recently fixed crash with latest XenD
	Test case for the fix applied in

	  commit 14435163a086c0bcdff04308077fa46a5fa08bb0
	  Author: Daniel Veillard <veillard@redhat.com>
	  Date:   Fri Jun 26 18:14:16 2009 +0000

	* tests/sexpr2xmldata/sexpr2xml-pv-vfb-type-crash.sexpr,
	  tests/sexpr2xmldata/sexpr2xml-pv-vfb-type-crash.xml: Data
	  files exhibiting the crash
	* tests/sexpr2xmltest.c: Process new data files

2009-08-20  Daniel P. Berrange  <berrange@redhat.com>

	Fix some typos & remove unhelpful acronyms in QEMU docs

2009-08-19  Daniel P. Berrange  <berrange@redhat.com>

	Add documentation about the QEMU driver security features
	* docs/drvqemu.html.in: Document DAC usage, SELinux integration,
	  Linux capabilities, and Cgroups device ACLs

2009-08-18  Mark McLoughlin  <markmc@redhat.com>

	Fix bridge/tap system error reporting
	* src/qemu_conf.c, src/uml_conf.c: use virReportSystemError() to report
	  system errors

2009-08-18  Mark McLoughlin  <markmc@redhat.com>

	Don't expose 'vnet%d' to the user
	https://bugzilla.redhat.com/517371

	Matt Booth points out that if you use a non-existent bridge name when
	start a guest you get a weird error message:

	  Failed to add tap interface 'vnet%d' to bridge 'virbr0'

	and dev='vnet%d' appears in the dumpxml output.

	Fix that by not including 'vnet%d' in the error message and freeing the
	'vnet%d' string if adding the tap device to the bridge fails.

	* src/qemu_conf.c, src/uml_conf.c: fix qemudNetworkIfaceConnect()
	  and umlConnectTapDevice() to not expose 'vnet%d' to the user

2009-08-18  Mark McLoughlin  <markmc@redhat.com>

	Maintain a list of active PCI hostdevs and use it in pciResetDevice()
	As we start/shutdown guests, or hotplug/hot-unplug devices, we can add
	or delete devices as appropriate from a list of active devices.

	Then, in pciReset(), we can use this to determine whether its safe to
	reset a device as a side effect of resetting another device.

	* src/qemu_conf.h: add activePciHostdevs to qemud_driver

	* src/qemu_driver.c: maintain the activePciHostdevs list, and pass it
	  to pciResetDevice()

	* src/pci.[ch]: pass the activeDevs list to pciResetDevice() and use
	  it to determine whether a Secondary Bus Reset is safe

2009-08-18  Mark McLoughlin  <markmc@redhat.com>

	Simplify PCI hostdev prepare/re-attach using a pciDeviceList type
	The qemuPrepareHostDevices() and qemuDomainReAttachHostDevices()
	functions are clutter with a bunch of calls to pciGetDevice() and
	pciFreeDevice() obscuring the basic logic.

	Add a pciDeviceList type and add a qemuGetPciHostDeviceList() function
	to build a list from a domain definition. Use this in prepare/re-attach
	fto simplify things and eliminate the multiple pciGetDevice calls.

	This is especially useful because in the next patch we need to iterate
	the hostdevs list a third time and we also need a list type for keeping
	track of active devices.

	* src/pci.[ch]: add pciDeviceList type and also a per-device 'managed'
	  property

	* src/libvirt_private.syms: export the new functions

	* src/qemu_driver.c: add qemuGetPciHostDeviceList() and re-write
	  qemuPrepareHostDevices() and qemuDomainReAttachHostDevices() to use it

2009-08-18  Mark McLoughlin  <markmc@redhat.com>

	Use pci_addr=auto with QEMU's pci_add monitor command
	Newer versions of QEMU accept 'pci_add auto', but older versions require
	'pci_add pci_addr=auto'

	* src/qemu_driver.c: use pci_addr= in qemudDomainAttachHostPciDevice()
	  for older versions of QEMU

2009-08-18  Mark McLoughlin  <markmc@redhat.com>

	Fix thinko in PCI hostdev detach
	* src/qemu_driver.c: Add missing break statement in
	  qemudDomainDetachHostDevice()

2009-08-18  Mark McLoughlin  <markmc@redhat.com>

	Reset PCI host devices after hot-unplug
	When we hot-unplug a PCI host device from a guest, we should reset it.

	Both managed and unmanaged devices should be reset, but only managed
	devices should be re-attached.

	* src/qemu_driver.c: reset devices in qemudDomainDetachHostPciDevice()

2009-08-18  Mark McLoughlin  <markmc@redhat.com>

	Reset unmanaged PCI host devices before hotplug
	Right now we're only resetting managed devices before hotplug, but we
	should reset them irrespective of whether they are managed.

	* src/qemu_driver.c: reset all PCI hostdevs before hotplug

2009-08-18  Mark McLoughlin  <markmc@redhat.com>

	Revert changes to allow pciResetDevice() reset multiple devices
	It turns out that the previous attempt at this doesn't work well
	in the case of hotplug. We need qemuCheckPciHostDevice() to
	disallow the reset affecting devices already attach to the guest,
	but we still need to avoid double locking the virDomainObjPtr.

	This is all getting messy, I've a better idea.

	This reverts commit 6318808270dd7679cd5dc082dcf2c7d85a432bd6 and
	c106c8a18c63d9e4f2547724a4a563706f8f6778.

	* src/qemu_driver.c, src/pci.[ch], src/xen_unified.c,
	  src/libvirt_private.syms: revert a bunch of stuff.

2009-08-18  Mark McLoughlin  <markmc@redhat.com>

	Fix list updating after disk/network/hostdev hot-unplug
	The current code makes a poor effort at updating the device arrays after
	hot-unplug. Fix that and combine the two code paths into one.

	* src/qemu_driver.c: fix list updating in qemudDomainDetachNetDevice(),
	  qemudDomainDetachPciDiskDevice() and qemudDomainDetachHostPciDevice()

2009-08-18  Mark McLoughlin  <markmc@redhat.com>

	Re-name remote_internal.c:driver to remote_driver
	Confused me when poking at another 'driver' variable in gdb which gcc
	had optimized away

	* src/remote_internal.c: rename driver to remote_driver

2009-08-18  Mark McLoughlin  <markmc@redhat.com>

	Cosmetic change to 'virsh nodedev-list --tree' output
	Maybe it's just me, but I try to select an item from the tree using
	double-click and get annoyed when "+-" gets included in the selection.

	* src/virsh.c: add a space between "+-" and the node device name
	  in 'virsh nodedev-list --tree'

2009-08-18  Chris Lalancette  <clalance@redhat.com>

	Fix up connection reference counting.
	Currently the reference counting for connections is busted.  I
	first noticed it while trying to use virConnectRef; it would
	eventually cause a crash in the remote_internal driver, although
	that was really just a victim.  Really, we should only call the
	close callbacks on the methods when the references drop to 0.  To
	accomplish this, move all of the close callbacks into
	virUnrefConnect (since there are lots of internal users of that
	function), and arrange for virConnectClose to call that.

	V2: Make sure to drop the connection lock before we call the close
	    callbacks, otherwise we could deadlock the daemon
	V3: Fix up a crash when we got an error from one of the drivers

2009-08-17  Daniel P. Berrange  <berrange@redhat.com>

	Fix LXC driver crash when kernel doesn't support clone
	* src/domain_conf.c: Make virDomainObjListFree a no-op if list
	  is NULL
	* src/domain_event.c: make virDomainEventCallbackListFree a no-op
	  if event list is NULL
	* src/lxc_driver.c: Log a message if LXC driver does not startup
	  due to lacking kernel support

2009-08-17  Chris Lalancette  <clalance@redhat.com>

	Compressed save image format for Qemu.
	Implement a compressed save image format for qemu.  While ideally
	we would have the choice between compressed/non-compressed
	available to the libvirt API, unfortunately there is no "flags"
	parameter to the virDomainSave() API.  Therefore, implement this
	as a qemu.conf option.  gzip, bzip2, and lzma are implemented, and
	it should be very easy to implement additional compression
	methods.

	One open question is if/how we should detect the compression
	binaries.  One way to do it is to do compile-time setting of the
	paths (via configure.in), but that doesn't seem like a great thing
	to do.  My preferred solution is not to detect at all;
	when we go to run the commands that need them, if they
	aren't available, or aren't available in one of the standard paths,
	then we'll fail.  That's also the solution implemented in this patch.

	In the future, we'll have a more robust (managed) save/restore API,
	at which time we can expose this functionality properly in the API.

	V2: get rid of redundant dd command and just use >> to append data.
	V3: Add back the missing pieces for the enum and bumping the save version.
	V4: Make the compressed field in the save_header an int.
	    Implement LZMA compression.

2009-08-14  Daniel P. Berrange  <berrange@redhat.com>

	Remove 'the the' typo in docs

2009-08-14  Mark McLoughlin  <markmc@redhat.com>

	Check active domain hostdevs before allowing PCI reset
	If a PCI device reset causes other devices to be reset, allow it so long
	as those other devices are note assigned to another active domain.

	Note, we need to take the driver lock qemudNodeDeviceReset() because the
	check function will iterate over the domain list.

	* src/qemu_conf.c: add qemuCheckPciHostDevice() to iterate over active
	  domains checking whether the affected device is assigned

	* src/pci.[ch]: add pciDeviceEquals() helper

2009-08-14  Mark McLoughlin  <markmc@redhat.com>

	Allow pciResetDevice() to reset multiple devices
	When using a Secondary Bus Reset, all devices on the bus are reset.

	Extend the pciResetDevice() API so that a 'check' callback can be
	supplied which will verify that it is safe to reset the other devices
	on the bus.

	The virDomainObjPtr parameter is needed so that when the check function
	iterates over the domain list, it can avoid double locking.

	* src/pci.[ch]: add a 'check' callback to pciResetDevice(), re-work
	  pciIterDevices() to pass the check function to the iter functions,
	  use the check function in the bus iterator, return the first unsafe
	  device from pciBusCheckOtherDevices() and include its details in
	  the bus reset error message.

	* src/qemu_driver.c, src/xen_uninified.c: just pass NULL as the
	  check function for now

2009-08-14  Mark McLoughlin  <markmc@redhat.com>

	Improve PCI host device reset error message
	Currently, if we are unable to reset a PCI device we return a fairly
	generic 'No PCI reset capability available' error message.

	Fix that by returning an error from the individual reset messages and
	using that error to construct the higher level error mesage.

	* src/pci.c: set errors in pciTryPowerManagementReset() and
	  pciTrySecondaryBusReset() on failure; use those error messages
	  in pciResetDevice(), or explain that no reset support is available

2009-08-14  Mark McLoughlin  <markmc@redhat.com>

	Reset and re-attach PCI host devices on guest shutdown
	When the guest shuts down, we should attempt to restore all PCI host
	devices to a sane state.

	In the case of managed hostdevs, we should reset and re-attach the
	devices. In the case of unmanaged hostdevs, we should just reset them.

	Note, KVM will already reset assigned devices when the guest shuts
	down using whatever means it can, so we are only doing it to cover the
	cases the kernel can't handle.

	* src/qemu_driver.c: add qemuDomainReAttachHostDevices() and call
	  it from qemudShutdownVMDaemon()

2009-08-14  Mark McLoughlin  <markmc@redhat.com>

	Allow PM reset on multi-function PCI devices
	It turns out that a PCI Power Management reset only affects individual
	functions, and not the whole device.

	The PCI Power Management spec talks about resetting the 'device' rather
	than the 'function', but Intel's Dexuan Cui informs me that it is
	actually a per-function reset.

	Also, Yu Zhao has added pci_pm_reset() to the kernel, and it doesn't
	reject multi-function devices, so it must be true! :-)

	(A side issue is that we could defer the PM reset to the kernel if we
	could detect that the kernel has PM reset support, but barring version
	number checks we don't have a way to detect that support)

	* src/pci.c: remove the pciDeviceContainsOtherFunctions() check from
	  pciTryPowerManagementReset() and prefer PM reset over bus reset
	  where both are available

	Cc: Cui, Dexuan <dexuan.cui@intel.com>
	Cc: Yu Zhao <yu.zhao@intel.com>

2009-08-14  Mark McLoughlin  <markmc@redhat.com>

	Detect KVM's PCI device assignment support
	PCI device assignment is only supported in KVM's fork of qemu, so we
	should really detect its availability and give a nice error if its
	not supported.

	* src/qemu_conf.[ch]: introduce QEMUD_CMD_FLAG_PCIDEVICE indicating
	  that the -pcidevice command line option is available

	* tests/*: update the tests

2009-08-14  Mark McLoughlin  <markmc@redhat.com>

	Add host PCI device hotplug support
	Attaching a host PCI device to a qemu guest is done with a
	straightforward 'pci_add auto host host=XX:XX.X' command.

	Like with NIC and disk hotplug, we need to retain the guest PCI address
	assigned by qemu so that we can use it for hot-unplug.

	Identifying a device for detach is done using the host PCI address.

	Managed mode is handled by detaching/resetting the device before
	attaching it to the guest and re-attaching it after detaching it from
	the guest.

	* src/qemu_driver.c: add qemudDomainAttachHostPciDevice() and
	  qemudDomainDetachHostPciDevice()

	* src/domain_conf.h: add somewhere to store the guest PCI address

	* src/domain_conf.c: handle formatting and parsing the guest PCI
	  address

2009-08-14  Mark McLoughlin  <markmc@redhat.com>

	Re-factor hostdev hotplug
	Re-factor the hostdev hotplug code so that we can easily add PCI
	hostdev hotplug to qemudDomainAttachHostDevice().

	* src/qemu_driver.c: rename qemudDomainAttachHostDevice() to
	  qemudDomainAttachHostUsbDevice(); make qemudDomainAttachHostDevice()
	  handle all hostdev types

	* src/libvirt_private.syms: export a couple of hostdev related
	  ToString() functions

2009-08-13  Daniel P. Berrange  <berrange@redhat.com>

	Make LXC / UML drivers robust against NUMA topology brokenness
	Some kernel versions expose broken NUMA topology for some machines.
	This causes the LXC/UML drivers to fail to start. QEMU driver was
	already fixed for this problem

	* src/lxc_conf.c: Log and ignore failure to populate NUMA info
	* src/uml_conf.c: Log and ignore failure to populate NUMA info
	* src/capabilities.c: Reset nnumaCell to 0 after freeing

2009-08-11  Mark McLoughlin  <markmc@redhat.com>

	Fix some URLs in virsh manpage
	* docs/virsh.pod: don't reference format.html anymore, reference
	  the formatdomain.html etc. pages

	* virsh.1: re-generate

2009-08-11  Chris Lalancette  <clalance@redhat.com>

	Remove a duplicated assignment in Xen PCI parsing.

	Fix up a few minor indentation issues.

	Fix phyp escape_specialcharacters.
	A couple of minor fixes to phyp escape_specialcharacters.  Make it
	a static function (since it's only used in phyp/phyp_driver.c), and
	make it take a dstlen parameter.  This paves the way for removing
	strncpy in the future.

	Make openvzGetVPSUUID take a len.
	Minor fix to openvzGetVPSUUID to make it take a length parameter.
	This ensures that it doesn't make assumptions about the length
	of the UUID buffer, and paves the way for removal of strncpy in
	the future.

	Minor cleanup of error path for c_oneVmInfo.

	Fix up a whitespace in comments in src/console.c

	Fix up a stray whitespace in virHashGrow.

	Run 'cont' on successful migration finish.
	As of qemu 0.10.6, qemu now honors the -S flag on incoming migration.
	That means that when the migration completes, we have to issue a
	'cont' command to get the VM running again.  We do it unconditionally
	since it won't hurt on older qemu.

	Split virDomainMigrate into functions.
	Re-factor virDomainMigrate to split out the version 1 and version 2
	protocols into their own functions.  In reality, the two versions share
	very little in common, so forcing them together in the same function was
	just confusing.  This will also make adding tunnelled migration easier.

	Fix QEMU domain status after restore.
	When doing a restore, we were forgetting to update the state file
	for the VM.  That means that if you do a save/restore, then shut
	down libvirtd, then start it back up, you'll see the state of the
	guest as "paused", even though it is really running.  We were
	just forgetting a "virDomainSaveStatus" call in the restor path.

2009-08-10  Mark McLoughlin  <markmc@redhat.com>

	Handle kernels with no ipv6 support
	If the ipv6 kernel module is not loaded, then we get this when starting
	a virtual network:

	  libvir: Network Config error :
	  cannot enable /proc/sys/net/ipv6/conf/virbr0/disable_ipv6:
	  No such file or directory

	If disable_ipv6 is not present, we should just merrily continue on our
	way.

	* src/network_driver.c: make networkDisableIPV6() not fail if the kernel
	  has no ipv6 support

2009-08-10  Mark McLoughlin  <markmc@redhat.com>

	Set perms on /var/lib/libvirt/boot to 0711
	Allow qemu user to open kernel/initrds in this dir, but still prevent
	others from listing it.

	* libvirt.spec.in: set /var/lib/libvirt/boot perms to 0711

2009-08-10  Mark McLoughlin  <markmc@redhat.com>

	chown kernel/initrd before spawning qemu
	If we're running qemu unprivileged, we need to chown any supplied kernel
	or initrd before spawning it.

	* src/qemu_driver.c: rename qemuDomainSetDiskOwnership() to
	  qemuDomainSetFileOwnership(), pass it a path string instead of a disk
	  definition and use it for chowning the kernel/initrd in
	  qemuDomainSetAllDeviceOwnership()

2009-08-07  Daniel P. Berrange  <berrange@redhat.com>

	Add link to AbiCloud web management system

2009-08-07  Chris Lalancette  <clalance@redhat.com>

	Remove unsafe strncpy from esx_vmx.c
	While trying to remove uses of unsafe strncpy in the tree, I came
	across a couple of usages in the ESX driver.  To my eyes, the snprintf
	replacements do the same thing in less code, and are also safer.

	Tested-by: Mattias Bolte <matthias.bolte@googlemail.com>

2009-08-06  Amy Griffis  <amy.griffis@hp.com>

	Update logging documentation
	* docs/logging.html[.in] try to include a little more description about
	  the corner cases, things someone might get hung up on on.

	Consolidate code for parsing the logging env
	* src/logging.c src/logging.h src/libvirt_private.syms:
	  define new functions virLogSetFromEnv and virLogParseDefaultPriority
	* qemud/qemud.c src/libvirt.c tests/eventtest.c: cleanup to use the
	  unified functions

	Cleanup VIR_LOG_DEBUG parsing in eventtest
	* tests/eventtest.c: don't covert high priority levels to debug level.
	  Consider an invalid priority level setting a setup failure.

	Several fixes to libvirtd's log setup
	* qemud/qemud.c src/logging.[ch]: Similar as for general libvirt, don't
	  convert high priority levels to debug level. Ignore LIBVIRT_LOG_FILTERS
	  and LIBVIRT_LOG_OUTPUTS when they're set to the empty string, otherwise
	  they can override a valid setting from the config file. Send all
	  settings through the parser functions for validation, so that the
	  existence of a bad setting doesn't nullify a good setting that should
	  have applied -- particularly the default output. Keep the order of
	  precedence consistent for all variables between the environment and
	  the config file.  Warn when an invalid log level, filter, or output
	  is ignored.
	* src/libvirt_private.syms: export internally a few convenience functions

	Tighten libvirt's parsing of logging env
	* src/libvirt.c src/logging.c: Don't convert high priority levels to the
	  debug level. Don't parse LIBVIRT_LOG_FILTERS and LIBVIRT_LOG_OUTPUTS
	  when they're set to the empty string. Warn when the user specifies an
	  invalid value (empty string remains a noop).
	* po/POTFILES.in: src/logging.c now include translatable strings

2009-08-06  Matthias Bolte  <matthias.bolte@googlemail.com>

	Cleanup structure name naming
	* src/esx/esx_driver.c src/esx/esx_util.[ch] src/esx/esx_vi.[ch]:
	  just a name change

	Fix memleak if esxOpen fails
	* src/esx/esx_driver.c: if esxOpen failed, priv->transport wasn't freed

	Add proper OOM reporting for esxDomainGetOSType
	* src/esx/esx_driver.c: catch an unchecked strdup in
	  esxDomainGetOSType()

2009-08-05  Daniel Veillard  <veillard@redhat.com>

	Release of libvirt-0.7.0
	* configure.in NEWS docs/* libvirt.spec.in include/libvirt/libvirt.h:
	  Release of 0.7.0
	* po/*.po*: updated and regenerated the localization pool

2009-08-05  Ryota Ozaki  <ozaki.ryota@gmail.com>

	Add an allocation unit when calling qemu-img
	* src/storage_backend.c: as the absence of units can be interpreted
	  in diverging ways depending on the version

2009-08-05  Daniel P. Berrange  <berrange@redhat.com>

	Add uniqness checking for LXC define/create methods
	* src/lxc_driver.c: Check for name & UUID uniqueness when
	  defining or creating domains

	Fix removal of transient VMs when LXC aborts
	* src/lxc_driver.c: Remove transient VM after monitor triggered
	  shutdown

	Don't try to activate cgroups if not present for LXC
	* src/lxc_controller.c: Don't throw error in LXC startup if
	  the cgroups driver mount isn't available. Improve error
	  logging for resource setup

	Fix configure checks from previous commits
	* configure.in: Don't set AM_CONDITIIONAL until *after* making
	  the checks

	Avoid a warning if compiling without inotify
	* src/xm_internal.c: split the implementations of xenInotifyActive()

2009-08-05  Aron Griffis  <aron.griffis@hp.com>

	Typo and comment fixes
	* docs/schemas/*.rng: the comments were wrong
	* src/qemu_conf.c: typo in an error message

2009-08-05  Cole Robinson  <crobinso@redhat.com>

	Refresh /etc/xen if inotify wasn't
	* src/xm_internal.c: in case of multiple connections to the xen driver
	  and some clients were not using domain events, the whole /etc/xen
	  monitoring would break leading to disapearing domains.

	Don't loose id on xen domain redefine
	* src/xm_internal.c: bug when redefining a domain, if it was running
	  we would loose its id

2009-08-05  Daniel Veillard  <veillard@redhat.com>

	Remove a stray semicolon
	* src/xend_internal.c: extraneous ; in xenDaemonParseSxprGraphicsNew

2009-08-05  Maximilian Wilhelm  <max@rfc2324.org>

	Workaround for broken GCC in Debian Etch
	* src/storage_conf.c src/internal.h: move previous check in internal.h
	  and add a workaround for a GCC bug in Debian Etch on limit definitions

	Xen Inotify support needs sys/inotify.h
	* configure.in: to activate Xen Inotify checking we need to check for
	  sys/inotify.h availability

	LXC driver requires sched.h and unshare()
	* configure.in: make it check by default for both

	Configure UML support only if sys/inotify.h present
	* configure.in: UML support requires sys/inotify.h so make it check
	  by default.

	Fix libcurl automatic check and ESX status
	* configure.in: if libcurl is not present ESX should be desactivated
	  so default to check for esx

2009-08-05  Matthias Bolte  <matthias.bolte@googlemail.com>

	Extend the ESX URL to habdle ports and GSX
	* src/esx/esx_driver.c src/esx/esx_vi.[ch] src/esx/esx_vmx.[ch]:
	  adds version checking for GSX 2.0, allows to pass a specific port
	  for the connection and also add a new specific gsx scheme for
	  easier connections to GSX hosts

2009-08-05  Daniel P. Berrange  <berrange@redhat.com>

	Fix escaping of 8-bit high characters
	Fix  https://bugzilla.redhat.com/show_bug.cgi?id=479517

	* src/buf.c: Cast to 'unsigned char' before doing compare to
	  avoid rejecting 8-bit high characters

2009-08-03  Daniel P. Berrange  <berrange@redhat.com>

	Fix memory leak in openvz driver
	* src/openvz_driver.c: Remove unneccessary strdup() on hypervisor
	  type api call

2009-08-02  Chris Lalancette  <clalance@redhat.com>

	Remove ATTRIBUTE_UNUSED from flags to qemudDomainMigratePerform.

	Add a comment about setting errors after qemudStartVMDaemon().

	Fix an erroneous debug error to KVM; it should read QEMU/KVM.

	Remove a stray semicolon in qemudDomainMigratePrepare2.

	Convert a few stray users of free() in libvirt.c to VIR_FREE().

	Use virGetHostname instead of gethostname.
	Fix up qemudDomainMigratePrepare2 to use virGetHostname instead of
	gethostname.  Besides the fact that virGetHostname is far more clever,
	there was a latent bug in the handling that could cause a buffer overflow
	on a very long hostname.

	Fix up a minor indentation issue with virDomainMigratePrepare.

	Fix virCapabilitiesDefaultGuestMachine documentation.

	Fix up a silly typo in apibuild.py.

2009-08-01  Daniel P. Berrange  <berrange@redhat.com>

	Protected against potential crash scenarios
	* src/qemu_driver.c: Check that monitor device is not NULL
	  before runing a command to protect against bugs in caller

	Improve diagnostics when pidfile writing fails
	* src/util.c: Include path & pid when logging pidfile failure

	Fix crash when attempting to shutdown inactive QEMU vm
	* src/qemu_driver.c: Add check that QEMU is active before attemting
	  to shutdown. Fix error code for check in destroy method

2009-07-31  Daniel P. Berrange  <berrange@redhat.com>

	Enable ESX driver build on Mingw32
	* autobuild.sh, mingw32-libvirt.spec.in: Enable esx on mingw32
	* src/esx/esx_driver.c: Define AI_ADDRCONFIG if not set
	* src/esx/esx_util.c, src/esx/esx_vi_types.c: Always use
	  %lld & friends, since gnulib guarentees we have these
	  and not the target's own variants

2009-07-31  Daniel P. Berrange  <berrange@redhat.com>

	Disable IPv6 on virtual networks
	If the bridge device is configured to have IPv6 address and
	accept router advertisments, then a malicious guest can send
	out bogus advertisments and hijack/DOS host IPv6 connectivity

	* src/network_driver.c: Set accept_ra=0, disable_ipv6=1, autoconf=0
	  for IPv6 sysctl on virual network bridge devices

2009-07-31  Mark McLoughlin  <markmc@redhat.com>

	Fix PCIe FLR detection
	PCIe DevCap register is actually 32 bits, not 16 bits. Since FLR is
	bit 28, we clearly are failing to detect FLR support.

	Known to fix device reset with some SR-IOV devices.

	* src/pci.c: fix pciDetectFunctionLevelReset()

2009-07-31  Mark McLoughlin  <markmc@redhat.com>

	Set perms on /var/lib/libvirt/images to 0711
	Allow qemu user to open images in this dir, but still prevent others
	from listing it.

	* libvirt.spec.in: set /var/lib/libvirt/images perms to 0711

2009-07-31  Daniel P. Berrange  <berrange@redhat.com>

	Fix problem writing QEMU pidfile
	* src/util.c: Don't drop capabilities until after the PID file has
	  been written. Kill off child if writing the PID file fails
	* src/qemu_driver.c: Remove bogus trailing '/' in state dir

	Allow dnsmasq to provide DNS without DHCP
	* src/network_driver.c: Always start dnsmasq to allow it to provide
	  DNS, even if no DHCP ranges are enabled

2009-07-30  Maximilian Wilhelm  <max@rfc2324.org>

	Avoid warning when compiling without IFF_VNET_HDR
	* src/bridge.c: avoid a couple of unused var/func warnings

2009-07-30  Daniel P. Berrange  <berrange@redhat.com>

	Fix build on mingw32 by disabling netcf
	* autobuild.sh, mingw32-libvirt.spec.in: Set --without-netcf for
	  mingw32 builds

2009-07-30  Matthias Bolte  <matthias.bolte@googlemail.com>

	ESX Scheduler documentation and cleanup
	* esx/esx_driver.c: add some documentation about the CPU scheduler
	  parameters and remove some old, unnecessary compensation code, since
	  virsh uses the proposed parameter types now.

2009-07-30  Henrik Persson  <henrik.e.persson@ericsson.com>

	Fix vcpupin on Xen problem
	* src/xend_internal.c: the update on the cpu affinity map format
	  had na error and made the changes in the wrong buffer, fix those

2009-07-30  Daniel P. Berrange  <berrange@redhat.com>

	Fix RPM upgrades from F11 to F12
	* libvirt.spec.in: Create qemu/kvm user/group in %pre script

2009-07-30  Aron Griffis  <aron.griffis@hp.com>

	Fix an initialization problem in previous patch
	* src/bridge.c: fix struct ifreq ifr init in brAddTap()

2009-07-30  Bryan Kearney  <bkearney@redhat.com>

	Update the java bindings page
	* docs/java.html[.in]: update the java bindings html page to reflect the
	  new repositories, JNA usage, and maven access

2009-07-30  Aron Griffis  <aron.griffis@hp.com>

	Remove MAX_TAP_ID and let kernel do numbering
	* src/bridge.c: no need to format the device string in brAddTap()
	  this can be delegated to the kernel and removes an arbitrary limit.

2009-07-29  Ron Yorston  <rmy@tigress.co.uk>

	Kernel command line support for UML
	* src/uml_conf.c: add support for additional kernel command line
	  arguments.

2009-07-29  Daniel P. Berrange  <berrange@redhat.com>

	Fix deadlock in remote driver domain events
	* src/remote_internal.c: Release driver lock when dispatching events
	  to callbacks

2009-07-29  Ryota Ozaki  <ozaki.ryota@gmail.com>

	qemu: fix monitor socket reconnection
	* src/qemu_driver.c: fix qemudOpenMonitorUnix() to retry on ENOENT
	  instead of EACCES which is the error one receive when the socket
	  error hasn't shown up yet

2009-07-29  Mark McLoughlin  <markmc@redhat.com>

	Fix polkit/netcf disabling on older fedoras
	polkit was disabled by default for a reason - because we selectively
	enable it on newer fedoras rather than disable it on older fedoras

	Same fix needed for netcf

2009-07-29  Mark McLoughlin  <markmc@redhat.com>

	Capilize libvirt-client summary
	Fixes:

	  W: summary-not-capitalized client side library and utilities of the libvirt library

2009-07-29  Mark McLoughlin  <markmc@redhat.com>

	Move ldconfig calls to libvirt-client %post/%postun
	Now that the library has moved to libvirt-client

2009-07-29  Mark McLoughlin  <markmc@redhat.com>

	Convert NEWS to UTF-8
	* docs/news.xsl: request UTF-8 as the output encoding

	* NEWS: re-generate with UTF-8 encoding

2009-07-29  Mark McLoughlin  <markmc@redhat.com>

	Fix trailing whitespace in NEWS
	git wouldn't let me push without this

2009-07-29  Mark McLoughlin  <markmc@redhat.com>

	No need to build require both python-devel and python
	Since python-devel requires python

	Pointed out by Itamar Reis Peixoto

2009-07-29  Mark McLoughlin  <markmc@redhat.com>

	Remove executable perms from /etc/sysconfig/libvirtd
	Changed by Rich Jones for:

	  libvirt.x86_64: E: executable-marked-as-config-file /etc/sysconfig/libvirtd

	See:

	  https://bugzilla.redhat.com/226055

2009-07-29  Mark McLoughlin  <markmc@redhat.com>

	Use a %postun -p for one line scriptlet
	Changed by Rich Jones, presumably for this:

	  libvirt.x86_64: W: one-line-command-in-%postun /sbin/ldconfig

	see:

	  https://bugzilla.redhat.com/226055

2009-07-29  Mark McLoughlin  <markmc@redhat.com>

	Don't explicitly require libxml2
	Originally done by rjones as part of this package review:

	  https://bugzilla.redhat.com/226055

2009-07-29  Mark McLoughlin  <markmc@redhat.com>

	Fix some unowned directories
	danpb's fix for:

	  https://bugzilla.redhat.com/483442

2009-07-29  Mark McLoughlin  <markmc@redhat.com>

	Kill qemu BuildRequires
	It's not needed at build time

	Removed in Fedora by:

	  * Fri Jun  5 2009 Mark McLoughlin <markmc@redhat.com> - 0.6.4-2.fc12
	  - Remove the qemu BuildRequires

2009-07-29  Mark McLoughlin  <markmc@redhat.com>

	Enable netcf by default
	Disabled on < f12 for now until netcf is in Fedora updates

	BuildRequires netcf if enabled, pass --without-netcf if its disabled

	* libvirt.spec.in: enabled netcf by default

2009-07-29  Mark McLoughlin  <markmc@redhat.com>

	Default to with_polkit
	Unless there's some reason we shouldn't

2009-07-29  Mark McLoughlin  <markmc@redhat.com>

	Make vbox support configurable
	Added by DV with:

	  * Fri Apr 24 2009 Daniel Veillard <veillard@redhat.com> - 0.6.3-1.fc12
	  - release of 0.6.3
	  - VirtualBox driver

2009-07-29  Mark McLoughlin  <markmc@redhat.com>

	Build with --without-capng if capng is disabled
	* libvirt.spec: pass --without-capng if appropriate

	BuildRequires libcap-ng-devel not capng-devel
	Fedora CVS changelog is "Fix libcap-ng-devel require, Daniel"

2009-07-28  Shahar Klein  <shaharklein@yahoo.com>

	Drop curl host check when using ESX without check
	* src/esx/esx_vi.c: drop host check if no_verify=1, but as Matthias
	  pointed out if no_verify=2 we should check the host is the right
	  one

2009-07-28  Mark McLoughlin  <markmc@redhat.com>

	Reduce glusterfs dependency to 2.0.1
	* libvirt.spec.in: require glusterfs-client >= 2.0.1

2009-07-27  Daniel P. Berrange  <berrange@redhat.com>

	Fix crashes in Xen capabilities code
	* src/xen_internal.c: Don't free memory now owned by the virCapsPtr
	   structure
	* tests/testutilsxen.c: Fix up for change in internal API

	Fix typo in xen capabilities code

	Fill in vCPU <-> pCPU current mapping, and vCPU cpuTime for QEMU
	* src/qemu_driver.c: implement missing features in qemudDomainGetVcpus
	  for 'cpu' and 'cpuTime' fields

2009-07-27  Mark McLoughlin  <markmc@redhat.com>

	Add support for attaching network/bridge NICs in QEMU driver
	In order to hotplug a network/bridge backed NIC, we need to first create
	the tap file descriptor, add the tap interface to the bridge and then
	pass the file descriptor to the qemu process using the 'getfd' monitor
	command.

	Once the tapfd has been accepted, we create the network backend using
	host_net_add, supplying the name assigned to the tapfd. If this fails,
	we need to close the tapfd in qemu using the 'closefd' monitor command.

	If the version of qemu does not support the getfd/closefd monitor
	commands we detect "unknown command" in the getfd reply and fail the
	attach operation.

	* src/qemu_driver.c: add support for tapfd based hotplug in
	  qemudDomainAttachNetDevice()

2009-07-27  Mark McLoughlin  <markmc@redhat.com>

	Add SCM_RIGHTS support to QEMU monitor code
	Add qemudMonitorCommandWithFd() which allows a file descriptor to be
	sent to qemu over a unix monitor socket using SCM_RIGHTS. See the
	unix(7) and cmsg(3) man pages.

	* src/qemu_conf.c: add a scm_fd param to qemudMonitorCommandExtra(),
	  add qemudMonitorCommandWithFd(), implement SCM_RIGHTS support in
	  qemudMonitorSendUnix()

2009-07-27  Mark McLoughlin  <markmc@redhat.com>

	Use sendmsg() on QEMU monitor socket
	Switch from using write() to using sendmsg() on QEMU's monitor socket
	so that we can add support for SCM_RIGHTS.

	* src/qemu_driver.c: add sendmsg() based qemudMonitorSendUnix() and use
	  it when the monitor fd is a unix socket

2009-07-27  Mark McLoughlin  <markmc@redhat.com>

	Factor qemudMonitorSend() out of qemudMonitorCommandExtra()
	Add a little helper function to write the monitor command followed by
	carriage return in a single write.

	This doesn't make any real difference, but allows us to more easily
	switch to using sendmsg() when using the monitor over a unix socket.

	* src/qemu_conf.c: split qemudMonitorSend() out

2009-07-27  Mark McLoughlin  <markmc@redhat.com>

	Clean up error handling in qemudDomainAttachNetDevice()
	In subsequent patches we're going to have a file descriptor to close
	too, so centralize the error handling cleanups to make things easier.

	* src/qemu_conf.c: in qemudDomainAttachNetDevice() consolidate the
	  error handling cleanups together

2009-07-27  Mark McLoughlin  <markmc@redhat.com>

	Make qemuBuildHostNetStr() take tapfd as a string
	With hotplug, we're going to want to pass a tapfd name rather than an
	actual file descriptor, so prepare the way by passing a string tapfd to
	qemuBuildHostNetStr().

	* src/qemu_conf.h: qemuBuildHostNetStr() takes a string tapfd now

	* src/qemu_conf.c: pass qemuBuildHostNetStr() a string rather than an
	  actual file descriptor

	* src/qemu_driver.c: update qemudDomainAttachNetDevice() for change

2009-07-27  Mark McLoughlin  <markmc@redhat.com>

	Move vnet_hdr logic into qemudNetworkIfaceConnect() and export it
	* src/qemu_conf.h: export qemudNetworkIfaceConnect()

	* src/qemu_conf.c: move vnet_hdr logic into qemudNetworkIfaceConnect()
	  since we need it for hotplug too

2009-07-27  Mark McLoughlin  <markmc@redhat.com>

	Only probe qemu for machine types when binary changes
	By probing for qemu machine types, we increased the time of a
	GetCapabilities call from 100us to a whopping 60ms.

	This patch takes the approach of only probing for machine types
	when the mtime of the emulator binary changed since the last time
	the capabilities were generated.

	* src/capabilities.h: cache the emulator binary mtime

	* src/qemu_conf.c: add qemudGetOldMachines() to copy the machine
	  types from the old caps struct if the mtime for the binary hasn't
	  changed

	* src/qemu_conf.h, src/qemu_driver.c: pass the old caps pointer to
	  qemudCapsInit()

2009-07-27  Mark McLoughlin  <markmc@redhat.com>

	Add canonical machine name to capabilities output
	e.g. <machine canonical='pc'>pc-0.11</machine>

	* src/capabilities.c: output the canonical machine names in the
	  capabilities output, if available

	* docs/schemas/capabilities.rng: add the new attribute

2009-07-27  Mark McLoughlin  <markmc@redhat.com>

	Probe QEMU directly for machine aliases if not found in capabilties
	Not all possible emulators are actually in the capabilities, so if we
	don't find the supplied emulator we should probe it directly for machine
	types.

	* src/qemu_driver.c: add qemudCanonicalizeMachineDirect() to directly
	  probe an emulator for the canonical machine type

2009-07-27  Mark McLoughlin  <markmc@redhat.com>

	Canonicalize qemu machine types
	In qemu-0.11 there is a 'pc-0.10' machine type which allows you to run
	guests with a machine which is compatible with the pc machine in
	qemu-0.10 - e.g. using the original PCI class for virtio-blk and
	virtio-console and disabling MSI support in virtio-net. The idea here
	is that we don't want to suprise guests by changing the hardware when
	qemu is updated.

	I've just posted some patches for qemu-0.11 which allows libvirt to
	canonicalize the 'pc' machine alias to the latest machine version.

	This patches makes us use that so that when a guest is configured to
	use the 'pc' machine type, we resolve that to 'pc-0.11' machine and
	save that in the guest XML.

	See also:

	  https://fedoraproject.org/wiki/Features/KVM_Stable_Guest_ABI

	* src/qemu_conf.c: add qemudCanonicalizeMachine() to canonicalize
	  the machine type according to the machine aliases in capabilities

	* src/qemu_driver.c: parse aliases in qemudParseMachineTypesStr()

2009-07-27  Mark McLoughlin  <markmc@redhat.com>

	Add virCapsGuestMachine structure
	A subsequent commit will add a "canonical" field to this structure,
	this patch basically just prepares the way for that.

	The new type is added, along with virCapabilitiesAlloc/FreeMachines()
	helpers and a whole bunch of code to make the transition.

	One quirk is that virCapabilitiesAddGuestDomain() and
	virCapabilitiesAddGuest() take ownership of the machine list rather
	than duping it. This makes sense to avoid needless copying.

	* src/capabilities.h: add the virCapsGuestMachine struct and use it
	  in virCapsGuestDomainInfo, add prototypes for new functions and
	  update the AddGuest() prototypes

	* src/capabilities.c: add code for allocating and freeing the new
	  type, change the machines parameter to AddGuest() etc.

	* src/libvirt_private.syms: export the new helpers

	* src/qemu_conf.c: update all the machine type code to use the new
	  struct

	* src/xen_internal.c: ditto

	* tests/testutilsqemu.c: ditto

2009-07-27  Mark McLoughlin  <markmc@redhat.com>

	Probe for QEMU machine types
	Currently we hardcode the QEMU machine types. We should really just
	parse the output of 'qemu -M ?' so the lists don't get out of sync.

	xenner doesn't support '-M ?', so we still need to hardcode that.

	The horrible (const char *const *) is removed in a subsequent patch.

	* src/qemu_conf.c: kill the arch_info*machines tables, retain the
	  hardcoded xenner machine type, add qemudProbeMachineTypes() to
	  run and parse 'qemu -M ?' and use it in qemudCapsInitGuest()

2009-07-27  Mark McLoughlin  <markmc@redhat.com>

	Cleanup qemu binary detection logic in qemudCapsInitGuest()
	There's no need for the hasbase/hasaltbase confusion, just store the
	first binary path found in a variable.

	* src/qemu_conf.c: kill hasbase/hasaltbase logic in qemudCapsInitGuest()

2009-07-27  Matthias Bolte  <matthias.bolte@googlemail.com>

	ESX driver accept VI API version 4.0
	* src/esx/esx_driver.c src/esx/esx_vi.c src/esx/esx_vi.h
	  src/esx/esx_vmx.c src/esx/esx_vmx.h: extend the VI API version checks
	  to accept version 4.0 and takes care of the virtualHW.version change
	  from 4 to 7.

	Allow leading dots in VMX config entry names
	* src/conf.c: the virConfParser must accept leading dot when in VMX mode

	Add no_verify query parameter to ESX URIs
	* src/esx/esx_driver.c src/esx/esx_util.c src/esx/esx_util.h
	  src/esx/esx_vi.c src/esx/esx_vi.h: adds a no_verify query parameter to
	  stop libcurl from verifying theserver certificate for the https
	  transport.

	Fix memory leaks in esxDomainDumpXML
	* src/esx/esx_driver.c: remove leaks in esxDomainDumpXML() and simplify
	  esxDomainXMLFromNative()

2009-07-27  Cole Robinson  <crobinso@redhat.com>

	Commit newly generated docs, after changes from commit 2348cf.

	Add phyp files to POTFILES, to make syntax-check happy.

	test: Implement BlockStats and InterfaceStats
	We fake stats values based on the current time, similar to how it's done
	for cpu time.

	test: Generate net interface names when assigning XML.
	We need interface names to implement InterfaceStats.

	Don't allow NULL paths for BlockStats and InterfaceStats
	Do the check in libvirt.c, to save drivers from the burden. This changes
	behavior slightly in the qemu driver: we no longer explictly error if
	passed an empty string. An error will still be thrown when the device
	lookup fails.

	python: Raise exceptions if virDomain*Stats fail.
	The generator couldn't tell that the stats return values were pointers.
	Stick a white list in the function which tries to make this distinction.

2009-07-25  Guido Günther  <agx@sigxcpu.org>

	document tcp listen and raw wire option

2009-07-25  Daniel P. Berrange  <berrange@redhat.com>

	Fix misc build problems due to new drivers
	* autobuild.sh: Disable esx/phyp build on mingw32
	* configure.in: Fix handling of --without-phyp so it actually works
	* libvirt.spec.in: Add missing interface.rng
	* mingw32-libvirt.spec.in: Disable phyp/esx drivers
	* src/phyp/phyp_driver.c: Fix missing i18n of error messages

2009-07-25  Pritesh Kothari  <Pritesh.Kothari@Sun.COM>

	Add support for VBox 3 and event callbacks on vbox
	* src/vbox/vbox_driver.c: remove some old 2.5 switches and plug the
	  3.0 driver
	* src/vbox/vbox_V3_0.c src/vbox/vbox_CAPI_v3_0.h: the driver for
	  VirtualBox 3.0
	* src/vbox/vbox_tmpl.c: handle the new driver and add event support
	* src/Makefile.am: plug in the new module

2009-07-24  Daniel P. Berrange  <berrange@redhat.com>

	Fix cgroup compile warnings
	* src/cgroup.c: Fix cast to uint64 from unsigned long long

2009-07-24  Daniel Veillard  <veillard@redhat.com>

	Desactivate phyp build and indicate libssh builreq

2009-07-24  Eduardo Otubo  <otubo@linux.vnet.ibm.com>

	First version of the Power Hypervisor driver
	Features supported:
	- Connects to HMC/VIOS or IVM systems.
	- Life cycle commands (resume and shutdown).
	- dumpxml
	- 'list' and 'list --all'

	What is being implemented:
	- better and centralized control for UUID
	- definexml
	- CPU management commands

	* src/domain_conf.c src/domain_conf.h: first version of the driver
	* configure.in src/Makefile.am include/libvirt/virterror.h
	  src/domain_conf.[ch] src/libvirt.c src/virterror.c: glue the driver
	  in the general framework

2009-07-24  Jim Meyering  <meyering@redhat.com>

	docs: say that the old repository is deprecated...
	* docs/downloads.html.in: but will remain for sake of old links.

2009-07-24  Daniel Veillard  <veillard@redhat.com>

	Added Matthias Bolte to AUTHORS list

2009-07-24  Matthias Bolte  <matthias.bolte@googlemail.com>

	First version of the driver for VMWare ESX
	* src/esx/esx_*.[ch]: the driver, uses a remote minimal SOAP client
	  to talk to the VI services on ESX nodes.
	* configure.in include/libvirt/virterror.h src/Makefile.am src/driver.h
	  src/libvirt.c src/virterror.c: glue in the new driver

2009-07-24  Daniel P. Berrange  <berrange@redhat.com>

	Make QEMU cgroups use configurable
	 * qemud/libvirtd_qemu.aug, qemud/test_libvirtd_qemu.aug,
	   src/qemu.conf: Add 'cgroups_controllers' and 'cgroups_device_acl'
	   parameters
	 * src/qemu_conf.h, src/qemu_conf.c: Load & parse configuration params
	   for cgroups
	 * src/qemu_driver.c: Only use cgroups controllers that are activated,
	   and use configured device whitelist instead of default, if set.

	Use cgroups for block device whitelisting in QEMU guests
	* src/qemu_driver.c: Set a restrictive block device whitelist for
	  all QEMU guests. Update whitelist when hotplugging disks.
	* src/cgroup.h, src/cgroup.c: Add some more convenience methods
	  for dealing with block device whitelists.

	Implement schedular tunables API using cgroups
	* src/qemu_driver.c:  Add driver methods qemuGetSchedulerType,
	  qemuGetSchedulerParameters, qemuSetSchedulerParameters
	* src/lxc_driver.c: Fix to use unsigned long long consistently
	  for schedular parameters
	* src/cgroup.h, src/cgroup.c: Fix cpu_shares to take unsigned
	  long long
	* src/util.c, src/util.h, src/libvirt_private.syms: Add a
	  virStrToDouble helper
	* src/virsh.c: Fix handling of --set arg to schedinfo command
	  to honour the designated data type of each schedular tunable
	  as declared by the driver

	Place every QEMU guest in a private cgroup
	* src/qemu_driver.c: Place guest in cgroup upon startup. Remove
	  cgroup upon shutdown

2009-07-24  Daniel P. Berrange  <berrange@redhat.com>

	Refactor cgroups to allow a group per driver to be managed directly
	Allow the driver level cgroup to be managed explicitly by the
	hypervisor drivers, in order to detect whether to enable or
	disable cgroup support for domains. Provides better error
	reporting of failures. Also allow for creation of cgroups for
	unprivileged drivers if controller is accessible by the user.

	* src/cgroup.c, src/cgroup.h: Add an API to obtain a driver cgroup
	* src/lxc_conf.h, src/lxc_controller.c, src/lxc_driver.c:
	  Obtain a driver cgroup at startup and use that instead of
	  re-creating everytime.
	* src/util.c, src/util.h, src/libvirt_private.syms: Add a
	  virGetUserName() helper

2009-07-24  Daniel P. Berrange  <berrange@redhat.com>

	Make cgroups a little more efficient
	* src/cgroup.c: Detect the mount location of every controller at
	  time a virCgroupPtr is created. Detect current process' placement
	  within group to avoid assuming it is in the root. Pass controller
	  ID into SetValueStr/GetValueStr to enable much duplicated code to
	  be eliminated

2009-07-24  Laine Stump  <laine@laine.org>

	Add bare format string to printf-derivatives troubles
	* src/datatypes.c src/domain_conf.c src/interface_conf.c
	  src/lxc_driver.c src/qemu_driver.c src/storage_backend.c src/virsh.c:
	  add bare %s format string to printf-derivatives called with no format
	  string

2009-07-23  Daniel P. Berrange  <berrange@redhat.com>

	Don't restore labels on shared/readonly disks
	* src/security_selinux.c: Skip relabelling of shared/readonly
	  disks upon shutdown, since this breaks other VMs still active
	  using those disks

	Use virFileReadAll/virFileWriteStr for key cgroup read/write helpers

	Use enums for cgroup controller types / labels

	Add domain autostart for LXC driver
	* src/lxc_driver.c: Implement support for domain autostart

	Add domain events support to LXC driver
	* src/lxc_conf.h: Add queue for dispatch of domain events
	* src/lxc_driver.c: Trigger domain events upon important lifecycle transitions

2009-07-23  Daniel P. Berrange  <berrange@redhat.com>

	Fix misc Win32 compile warnings
	GCC >= 4.4 assumes the 'printf' attribute refers to the native
	runtime libraries format specifiers. Thanks to gnulib, libvirt
	has GNU format specifiers everywhere.  This means we need to
	use 'gnu_printf' with GCC >= 4.4 to get correct compiler
	checking of printf format specifiers.

	* HACKING: Document new rules for ATTRIBUTE_FMT_PRINTF
	* autobuild.sh, mingw32-libvirt.spec.in: Disable OpenNebula
	  driver on mingw32 builds
	* qemud/dispatch.h, qemud/qemu.h, src/buf.h src/internal.h,
	  src/logging.h, src/security.h, src/sexpr.h, src/util.h,
	  src/virterror_internal.h, src/xend_internal.c: Change
	  over to ATTRIBUTE_FMT_PRINTF.
	* src/virsh.c: Disable 'cd' and 'pwd' commands on Win32
	  since they don't compile
	* src/threads-win32.c: Add missing return value check

2009-07-23  Jim Paris  <jim@jtan.com>

	Always add -no-kvm and -no-kqemu, for qemu domains
	If the qemu binary supports "-no-kvm" and/or "-no-kqemu", they should
	always be added for plain "qemu" domains.  Previously, we omitted them
	whenever the host and guest architectures implied that they would be
	disabled automatically, but that logic was flawed in some cases
	(such as i686 and x86_64).
	* src/qemu_conf.c: fix the conditions for adding "-no-kvm" and/or "-no-kqemu"

2009-07-23  Laine Stump  <laine@laine.org>

	Release conn lock before reporting errors (end)
	* src/datatypes.c: more cleanup, where lock must be released before
	  calling error handling which tries to get it.

	Rename variable for compilation in Mingw32 (end)
	* qemud/remote.c src/interface_conf.[ch] src/veth.[ch]: more renaming
	  from interface to iface

2009-07-22  Nguyen Anh Quynh  <aquynh@gmail.com>

	Add support for physical memory access for QEmu
	* include/libvirt/libvirt.h include/libvirt/libvirt.h.in: adds the new
	  flag VIR_MEMORY_PHYSICAL for virDomainMemoryPeek
	* src/libvirt.c: update the front-end checking
	* src/qemu_driver.c: extend the QEmu driver

2009-07-22  Jim Meyering  <meyering@redhat.com>

	avoid a make distcheck failure: distribute docs/schemas/interface.rng
	* docs/schemas/Makefile.am (schema_DATA): Add interface.rng.

	avoid a make distcheck failure: distribute tests/interfaceschemadata/
	* tests/Makefile.am (EXTRA_DIST): Add interfaceschemadata.

2009-07-22  Laine Stump  <laine@laine.org>

	Release conn lock before reporting interface errors
	* src/datatypes.c: fix a lock problem on error handling, as the
	  error report takes the lock, it must be released before, fixes
	  the problem but just for Interface objects

	Update modified mac address in place in virGetInterface
	* src/datatypes.c: handle the nasty case where an interface
	  mac address change, while it's already in use

	Fix multiple memory leaks in virsh
	* virsh.c: fix a number of leaks of virDomain, virStoragePool,
	  virNodeDevice, etc.

2009-07-22  Daniel P. Berrange  <berrange@redhat.com>

	Fix typo in storage cloning

2009-07-22  Mark McLoughlin  <markmc@redhat.com>

	Add support for network device detach
	qemu network devices are hot-unplugged in two stages - first the PCI NIC
	is removed using 'pci_del <pci_addr>' and then the backend is removed
	using 'host_net_remove <vlan> <name>'.

	In order to perform these operations we need to have retained the
	PCI address, backend name and vlan number.

	* src/qemu_driver.c: add qemudDomainDetachNetDevice()

2009-07-22  Mark McLoughlin  <markmc@redhat.com>

	Retain PCI address from NIC attach
	When we pci_add a NIC, we need to retain the PCI address assigned by
	qemu for using during detach.

	* src/qemu_driver.c: use qemudParsePciAddReply() to pull the PCI
	  address from the pci_add reply

	* src/domain_conf.c: handle storing and parsing the PCI address in the
	  domain state XML file

2009-07-22  Mark McLoughlin  <markmc@redhat.com>

	Re-factor pci_add reply parsing and parse domain/bus numbers
	The current code for parsing pci_add replies ignores the the domain and
	bus numbers. Re-write the code to rectify that.

	Also, since pci_add is used for NIC hotplug as well ask disk hotplug,
	re-factor the code into a separate function.

	* src/qemu_driver.c: add qemudParsePciAddReply() function which can
	  handle parsing domain and bus numbers

2009-07-22  Mark McLoughlin  <markmc@redhat.com>

	Remove the network backend if NIC hotplug fails
	If we fail to pci_add a NIC, we should remove the network backend and
	leave things the way we found them. To do that, we pre-allocate a
	host_net_remove monitor command and issue that if the pci_add fails.
	If the remove fails, we just log a warning.

	We can only do this if we have a name for the network backend and
	we know the vlan number its associated with.

	* src/qemu_driver.c: host_net_remove the network backend if the
	  pci_add fails

2009-07-22  Mark McLoughlin  <markmc@redhat.com>

	Basic qemu NIC hotplug support
	Implement basic NIC hotplug support using the 'host_net_add' and
	'pci_add' qemu monitor commands.

	For now, we don't support 'bridge' or 'network' types.

	Also, if pci_add fails, we currently fail to remove the backend
	which we added.

	Finally, NIC hot-unplug support is missing.

	* src/qemu_driver.c: add qemudDomainAttachNetDevice()

	* src/qemu_conf.[ch]: export qemuBuildNicStr(), qemuBuildHostNetStr()
	  and qemuAssignNames()

	* src/libvirt_private.syms: export virDomainNetTypeToString()

2009-07-22  Mark McLoughlin  <markmc@redhat.com>

	Make qemuCmdFlags available in qemudDomainAttachDevice()
	qemudDomainChangeEjectableMedia() currently extracts the qemu command
	line flags, but other device attaching code might need it, so move
	the qemudExtractVersionInfo() call up a frame.

	* src/qemu_driver.c: move the qemudExtractVersionInfo() call from
	  qemudDomainChangeEjectableMedia() to qemudDomainAttachDevice()

2009-07-22  Mark McLoughlin  <markmc@redhat.com>

	Store the interface vlan number in the domain state
	Currently, an interface's vlan number corresponds to its index in
	the table of network interfaces. That is no longer true when we
	allow devices to be removed.

	To fix this, we store the vlan number in the domain's state XML
	so that it survives libvirtd restarts.

	* src/domain_conf.h: add vlan number to virDomainNetDef

	* src/domain_conf.c: store it in XML as <state vlan='N'/>, defaulting
	  to -1 if this is state saved by a previous version of libvirt

	* src/qemu_conf.c: assign vlan numbers before starting qemu

2009-07-22  Mark McLoughlin  <markmc@redhat.com>

	Add NIC and hostnet names to domain state XML
	The qemu driver needs to assign and keep track of identifiers for
	network devices so that it can remove them. We need to keep this state
	across libvirtd restarts, but it's not configuration that needs to
	be kept across guest restarts.

	* src/domain_conf.c: parse and format <state nic="foo" hostnet="bar"/>

2009-07-22  Mark McLoughlin  <markmc@redhat.com>

	Assign names to qemu NICs and network backends
	We need these so that we can remove the devices via the monitor.

	* src/domain_conf.h: add nic_name and hostnet_name to virDomainNetDef

	* src/domain_conf.c: free nic_name and hostnet_name

	* src/qemu_conf.c: add qemuAssignNetNames(), use it if qemu has
	  support for the param and pass the names on the command line

	* tests/qemuxml2argv*: add a test for this

2009-07-22  Mark McLoughlin  <markmc@redhat.com>

	Add checks for some NIC hotplug related features added in qemu-0.10.0
	Add QEMUD_CMD_FLAG_NET_NAME to indicate that '-net ...,name=foo' is
	supported and QEMUD_CMD_FLAG_HOST_NET_ADD to indicate that the
	'host_net_add' monitor command is available.

	Set both these flags if the qemu version is greater than 0.10.0.
	Checking via the '-help' output would not work for the monitor command
	and even for the command line arg, it would be quite fragile.

	* src/qemu_conf.h: add new flags as aliases of QEMUD_CMD_FLAG_0_10

	* src/qemu_conf.c: set QEMUD_CMD_FLAG_0_10 for versions >= 0.10.0

	* tests/qemuhelptest.c: set QEMUD_CMD_FLAG_0_10 for the appropriate
	  qemu versions

2009-07-22  Mark McLoughlin  <markmc@redhat.com>

	Factor qemuBuildHostNetStr() out from qemuBuildCommandLine()
	Re-factor this code so that it can be used for NIC hotplug
	too. The awkward prefix and type_sep arguments are needed to
	allow us to do "host_net_add tap vlan=..."

	* src/qemu_conf.c: factor the net backend string formatting
	  code into its own function

2009-07-22  Mark McLoughlin  <markmc@redhat.com>

	Factor qemuBuildNicStr() out from qemuBuildCommandLine()
	Re-factor this code so that it can be used for NIC hotplug
	too. The awkward arguments are needed to allow use to do
	"pci_add auto nic macaddr=..."

	* src/qemu_conf.c: factor the nic string formatting code into
	  its own function

2009-07-22  Mark McLoughlin  <markmc@redhat.com>

	Retain disk PCI address across libvirtd restarts
	When we hot-plug a disk device into a qemu guest, we need to retain its
	PCI address so that it can be removed again later. Currently, we do
	retain the slot number, but not across libvirtd restarts.

	Add <state devaddr="xxxx:xx:xx"/> to the disk device XML config when the
	VIR_DOMAIN_XML_INTERNAL_STATUS flag is used. We still don't parse the
	domain and bus number, but the format allows us to do that in future.

	* src/domain_conf.h: replace slotnum with pci_addr struct, add helper
	  for testing whether the address is valid

	* src/domain_conf.c: handle formatting and parsing the address

	* src/qemu_driver.c: store the parsed slot number as a full PCI address,
	  and use this address with the pci_del monitor command

	* src/vbox/vbox_tmpl.c: we're debug printing slotnum here even though
	  it can never be set, just delete it

2009-07-22  Mark McLoughlin  <markmc@redhat.com>

	Add internal XML parsing/formatting flag
	We need to store things like device names and PCI slot numbers in the
	qemu domain state file so that we don't lose that information on
	libvirtd restart. Add a flag to indicate that this information should
	be parsed or formatted.

	Make bit 16 and above of the flags bitmask for internal use only and
	consume the first bit for this new status flag.

	* include/libvirt/libvirt.h: add VIR_DOMAIN_XML_FLAGS_MASK

	* src/libvirt.c: reject private flags in virDomainGetXMLDesc()

	* src/domain_conf.h: add VIR_DOMAIN_XML_INTERNAL_STATUS

	* src/domain_conf.c: pass the flag from virDomainObjParseXML() and
	  virDomainSaveStatus

2009-07-22  Laine Stump  <laine@laine.org>

	Rename variable for compilation in Mingw32
	* src/virsh.c: rename interface into iface

2009-07-22  Thomas Treutner  <thomas@scripty.at>

	Fix documentation of virStoragePoolUndefine return
	* src/libvirt.c: the documented return was wrong

2009-07-22  Daniel P. Berrange  <berrange@redhat.com>

	Fix typo in check for glusterfs format pools
	* src/storage_backend_fs.c: Replace = with == for comparison

2009-07-21  Harshavardhana  <harsha@gluster.com>

	Set specific flags for glusterfs fs mounts
	* src/storage_backend_fs.c: due to Fuse O_DIRECT problem one need
	  to mount glusterfs with direct-IO mode, until fixed

2009-07-21  Pritesh Kothari  <Pritesh.Kothari@Sun.COM>

	Fix reconnect bug for VBox
	* src/vbox/vbox_tmpl.c: reconnecting to vbox:///session was failing

2009-07-21  Daniel Veillard  <veillard@redhat.com>

	Activate the interface drivers, and cleanups
	* src/libvirt.c: activate the interface drivers
	* po/POTFILES.in: add the netcf driver as a source of localization strings
	* src/interface_driver.c: NETCF_ENOMEM -> VIR_ERR_NO_MEMORY mapping was
	  breaking syntax checking

2009-07-21  Laine Stump  <laine@laine.org>

	Netcf based interface driver implementation
	* src/interface_driver.c src/interface_driver.h: the new driver
	* src/Makefile.am qemud/Makefile.am qemud/qemud.c: hook the new driver
	  in the build system and get ti activated by the daemon
	* src/libvirt_private.syms: export needed symbols internally

	Add a test interface driver
	* test.c: includes an interface driver to the test framework

2009-07-21  Daniel Veillard  <veillard@redhat.com>

	Remove trailing blank lines

2009-07-21  Laine Stump  <laine@laine.org>

	Add interface object list manipulation functions
	* interface_conf.c interface_conf.h: utilities function usful for
	  interface driver like the test interface driver

	virGetinterface matching of MAC and interface name
	MAC address of a particular interface may change over time, and the
	reduced virInterface object (which contains just name and mac) needs
	to reflect these changes. Since we can't modify the mac address of an
	existing virInterface (some other thread may currently be using it) we
	just create a new virInterface, and let the old one die a dignified
	death when its refct goes to 0.
	* src/datatypes.c: fix the matching and lifetime of virInterface object
	  accordingly

	Add an error code for conflicting mac addresses
	* include/libvirt/virterror.h src/virterror.c: if a driver's
	  virInterfaceLookupByMACString() function finds more than one interface
	  with the desired MAC Address, this new error is raised.

2009-07-21  Jun Koi  <junkoi2004@gmail.com>

	Fix an uninitialized variable in Unix socket open
	* src/qemu_driver.c: qemudOpenMonitorUnix() had an uninitialized loop
	  counter

2009-07-21  Daniel Veillard  <veillard@redhat.com>

	rpm spec cleanup and split off client only package
	* libvirt.spec.in: make a client rpm with shared libs, client binaries
	  and resources needed by those, and a small number of fixes and
	  cleanups in the spec file.

2009-07-17  Jim Meyering  <meyering@redhat.com>

	build: do not emit a trailing blank line into VC'd file, NEWS
	* docs/Makefile.am ($(top_builddir)/NEWS): Adjust rule to filter
	out any trailing blank lines when generating this file.
	* NEWS: Regenerate, so that it contains entries for 0.6.5.

2009-07-17  Daniel Veillard  <veillard@redhat.com>

	Remove some unused variables and cut long lines
	* src/virsh.c: a bit of cleanup on previous commit

2009-07-17  Laine Stump  <laine@laine.org>

	Add virsh commands for network interface management
	* src/virsh.c: add a number of interface related commands:
	  iface-list, iface-name, iface-mac, iface-dumpxml, iface-define,
	  iface-undefine, iface-edit, iface-start and iface-destroy

2009-07-17  Cole Robinson  <crobinso@redhat.com>

	Fix gitweb link on download page.

2009-07-17  Cole Robinson  <crobinso@redhat.com>

	qemu: Try multiple times to open unix monitor socket
	Unlike the pty monitor (which we know exists since we scrape its path from
	stdout), we have no way of knowing that the unix monitor socket should exist/
	be initialized. As a result, some of my KVM guests randomly fail to start on
	F10 host.

	Try to open the unix socket in a 3 second timeout loop. Ignore EACCES (path
	does not exist if a first time run) and ECONNREFUSED (leftover socket from
	a previous run hasn't been removed yet). Fixes things for me.

2009-07-17  Cole Robinson  <crobinso@redhat.com>

	storage: Implement CreateVolFrom for logical and disk backend.
	With the previous refactoring, this is a simple process, since the global
	'CreateBlockFrom' in storage_backend does all the work.

	storage: Don't try sparse detection if writing to block device.
	We don't gain any space savings, so skip the detection to speed up
	the cloning operation.

	storage: Implement 'CreateBlockFrom' helper.
	Add a 'CreateBlockFrom' in the global storage_backend, which sets up the
	destination block device: CopyFromFD does the rest of the cloning.

	storage: Break out actual raw cloning to separate function.
	The CreateRaw function has some 'file' only assumptions, so break the agnostic
	cloning bits to a separate function.

	storage: cleanup: do away with 'createFile'
	Have storage building functions be definitions of
	virStorageBackendBuildVolFrom: we will need to do this in the future anyways
	if we ever support the flags attribute.

	storage: Move most of the FS creation functions to common backend.
	These will be used by other pool cloning implementations.

2009-07-17  Cole Robinson  <crobinso@redhat.com>

	storage: Refactor FS backend 'create' function choosing.
	Break out separate functions for

	- Determining the supported '*-img' tool,
	- The tool's associated create function,
	- Desired function for cloning (CreateXMLFrom).

	This will be eventually used to unify cloning across all backends.

2009-07-17  Cole Robinson  <crobinso@redhat.com>

	storage: Fix deadlock when cloning across pools.
	We need to unlock the first pool before looking up the second, since the
	search locks every pool it checks.

	storage: disk: Use capacity, not allocation, when creating volume.
	There isn't any way to dictate allocation when creating disk volumes, so
	capacity is the only relevant value.

2009-07-17  Cole Robinson  <crobinso@redhat.com>

	storage: disk: Default to 'ext2' for new volumes.
	Currently, if no format is specified for a new disk volume, we pass the
	invalid value "none" as the FS type to 'parted mkpart'.

	There doesn't seem to be a way to have parted not format the drive, so
	just default to using 'ext2' in this case: this shouldn't cause any harm,
	since we are creating a new partition in the first place.

2009-07-17  Cole Robinson  <crobinso@redhat.com>

	storage: disk: Fix segfault creating volume without target path
	Remove unneeded target path duplication, which could carelessly dereference
	NULL. Make it clear where 'key' is actually filled in.

	storage: disk: Fix parthelper '-g' option handling.
	Typo was breaking 'parthelper -g', preventing disk pool definition.

2009-07-17  Jim Meyering  <meyering@redhat.com>

	build: submodule machinery now works also when no tag is reachable
	The code in cfg.mk to detect when the git submodule was out of date
	worked most of the time, but not when checked out in a certain way.
	* cfg.mk: Extract submodule hash from command output and file,
	and compare only that, since the format of the full line may vary.
	Reported by Mike Burns, with some diagnosis by Daniel P Berrange.

2009-07-17  Daniel P. Berrange  <berrange@redhat.com>

	Run QEMU guests as an unprivileged user
	* configure.in: Add --with-qemu-user and --with-qemu-group args
	* libvirt.spec.in: use 'qemu' for user/group for Fedora >= 12
	* qemud/libvirtd_qemu.arg, qemud/test_libvirtd_qemu.aug,
	  src/qemu.conf: Add 'user' and 'group' args for configuration
	* src/Makefile.am: Create %localstatedir/cache/libvirt/qemu
	* src/qemu_conf.c, src/qemu_conf.h: Load user/group from config
	* src/qemu_driver.c: Change user ID/group ID when launching QEMU
	  guests. Change user/group ownership on disks/usb/pci devs.
	  Put memory dumps in %localstatedir/cache/libvirt/qemu
	* src/util.c, src/util.h: Add convenient APIs for converting
	  username/groupname to user ID / group ID

2009-07-16  Laine Stump  <laine@laine.org>

	Implement the new virinterface functions
	* src/driver.h: add new driver functions virDrvNumOfDefinedInterfaces
	  and virDrvListDefinedInterfaces
	* src/libvirt.c: implements the entry points, calling new driver
	  functions
	* qemud/remote.c qemud/remote_dispatch_args.h qemud/remote_protocol.[chx]
	  qemud/remote_dispatch_prototypes.h qemud/remote_dispatch_ret.h
	  qemud/remote_dispatch_table.h src/remote_internal.c: implement the
	  client/server side of the RPC

	Public API for new virInterface functions
	* include/libvirt/libvirt.h[.in]: adds signatures for the new exported
	  functions virConnectNumOfDefinedInterfaces and
	  virConnectListDefinedInterfaces
	* src/libvirt_public.syms: export the new symbols

2009-07-16  Daniel Veillard  <veillard@redhat.com>

	Fix configure flags in spec file
	* libvirt.spec.in: we were still using deprecated configure switches

2009-07-16  Daniel P. Berrange  <berrange@redhat.com>

	Rename a bunch of internal methods to clarify their meaning
	This renames a lot of the methods in the remote driver client
	to more accurately reflect their responsibility of IO handling
	vs message handling.

2009-07-16  Daniel P. Berrange  <berrange@redhat.com>

	Simplify remote driver error reporting
	Remove redundant error reporting functions which obscured the
	filename/line number reporting. Removed code which created a
	virDomain/virNetwork object, since those are silently dropped
	in error reporting functions now

	* src/remote_internal.c: Remove error() and errorf() in favour of
	 macros, and remove server_error in favour of direct call

2009-07-16  Daniel P. Berrange  <berrange@redhat.com>

	Refactor message sending to allow code reuse for data streams
	Splits up the 'call' method moving generic IO code out into
	separate method to allow it to be easily reused for sending
	data streams

	* src/remote_internal.c: Split 'call' into two methods, the first
	  with same name serializes a set of method arguments into a
	  message, the second 'remoteIO' takes a pre-serialized messages,
	  sends it and awaits a reply

2009-07-16  Daniel P. Berrange  <berrange@redhat.com>

	Refactor incoming message handling to prepare for data stream support
	* src/remote_internal.c: Rename processCallRecvMsg to
	  processCallDispatch, and move code specific to method replies
	  into processCallDispatchReply, and rename processCallAsyncEvent
	  to processCallDispatchMessage

2009-07-16  Daniel P. Berrange  <berrange@redhat.com>

	Rename 'direction' to 'type' in remote_message_header
	The 'remote_message_header' struct has a mis-leadingly named
	field 'direction'. It is really a reflection of the type of
	message, and some types can be sent in either direction. Thus
	the field is more accurately named 'type'. No function change.

	* qemud/remote_protocol.x: Rename 'direction' to 'type' in
	  'remote_message_header. Write better docs describing the
	  message header field semantics & usage
	* qemud/remote_protocol.c, qemud/remote_protocol.h: Regenerate
	* qemud/remote.c, qemud/dispatch.c, src/remote_internal.c
	  Update to reflect rename of 'direction' to 'type'

2009-07-16  Daniel P. Berrange  <berrange@redhat.com>

	Define an API for registering incoming message dispatch filters
	All incoming messages currently get routed to the generic method
	remoteDispatchClientRequest() for processing. To allow incoming
	data stream messages to bypass this and be routed to a specific
	location, a concept of dispatch filters is introduced.

	* qemud/qemud.h: Add a qemud_client_filter struct and a callback
	  qemud_client_filter_func. Maintain a list of filters on every
	  struct qemud_client
	* qemud/qemud.c: Move remoteDecodeClientMessageHeader() out of
	  qemudWorker() into qemudDispatchClientRead(). Check registered
	  message filters in qemudDispatchClientRead() to decide where
	  to send incoming messages for dispatch.

2009-07-16  Daniel P. Berrange  <berrange@redhat.com>

	Split out code for handling incoming method call messages
	The remoteDispatchClientRequest() method is currently hardwired to
	assume there is only one type of incoming message, a method call.
	To allow for alternate types of incoming messags, the code that is
	specific to method calls is being split into a separate method
	remoteDispatchClientCall

	* qemud/dispatch.c: Move method call specific code out into
	  remoteDispatchClientCall. Add a helper remoteSerializeError
	  for returning error messages to client

2009-07-16  Daniel P. Berrange  <berrange@redhat.com>

	Change the way client event loop watches are managed
	The current qemudRegisterClientEvent() code is used both for
	registering the initial socket watch, and updating the already
	registered watch. This causes unneccessary complexity in alot
	of code which only cares about updating existing watches. The
	updating of a watch cannot ever fail, nor is a reference to the
	'qemud_server' object required.

	This introduces a new qemudUpdateClientEvent() method for that
	case, allowing the elimination of unneccessary error checking
	and removal of the server back-reference in struct qemud_client.

	* qemud/qemud.h: Remove 'server' field from struct qemud_client.
	  Add qemudUpdateClientEvent() method. Remove 'update' param
	  from qemudRegisterClientEvent method
	* qemud/dispatch.c, qemud/qemud.c, qemud/remote.c: Update alot
	  of code to use qemudUpdateClientEvent() instead of
	  qemudRegisterClientEvent(). Move more logic from remoteRelayDomainEvent
	  into remoteDispatchDomainEventSend.

2009-07-16  Daniel P. Berrange  <berrange@redhat.com>

	Move queuing of RPC replies into dispatch code
	This removes an assumption from qemudWorker() code that every
	incoming message will generate a reply.

	* qemud/dispatch.c: remoteDispatchClientRequest now has responsibility
	  for queuing the reply message to the RPC call
	* qemud/qemud.c: Do not queue the RPC call reply in qemudWorker(),
	  allowing remoteDispatchClientRequest() to take care of it

2009-07-16  Daniel P. Berrange  <berrange@redhat.com>

	Change code generator to give async event messages their own postfix
	The naming convention for structs used in the RPC layer is for
	incoming requests to be called XXXX_args, and the associated
	outgoing reply to be called XXXX_ret.  Asynchronously emitted
	messages (eg events) are re-using the XXXX_ret naming scheme.
	This patch changes that such that async messages are XXXX_msg,
	and stops adding entries for them in the dispatch table, avoiding
	the need for a dummy no-op implementation.

	* qemud/remote.c: Remove dummy remoteDispatchDomainEvent, no
	  longer required. Update to replace remote_domain_event_ret
	  with xdr_remote_domain_event_msg
	* qemud/remote_protocol.x: Rename remote_domain_event_ret to
	  remote_domain_event_msg
	* qemud/remote_generate_stubs.pl: Adding handling for new
	  XXX_msg structs.
	* src/remote_internal.c: Rename remote_domain_event_ret to
	  remote_domain_event_msg
	* qemud/remote_dispatch_prototypes.h, qemud/remote_dispatch_ret.h,
	  qemud/remote_dispatch_table.h, qemud/remote_protocol.h,
	  qemud/remote_protocol.c: auto-regenerate

2009-07-16  Daniel P. Berrange  <berrange@redhat.com>

	Separate code for encoding outgoing remote message headers
	Introduces an API for encoding the header field for outgoing messages
	allowing some duplicated code to be eliminated

	* qemud/dispatch.c, qemud/dispatch.h: add remoteEncodeClientMessageHeader
	  for encoding message header. Update remoteDispatchClientRequest to
	  use this method.
	* qemud/remote.c: Update remoteDispatchDomainEventSend to use the
	  generic remoteEncodeClientMessageHeader() for encoding event
	  message hedaders. Push some logic from remoteRelayDomainEvent
	  down into remoteDispatchDomainEventSend.

2009-07-16  Daniel P. Berrange  <berrange@redhat.com>

	Decode incoming request header before invoking dispatch code
	Separate the decoding of incoming request header out from the
	dispatch code. This will allow later code to making dispatcher
	routing decisions based on the header field data.

	* qemud/dispatch.c, qemud/dispatch.h: Add remoteDecodeClientMessageHeader
	  API for decoding the header of a client message. Update the
	  remoteDispatchClientRequest method to assume a pre-decoded
	  header.
	* qemud/qemud.h: Include a 'remote_message_header' field in
	  'struct qemud_client_message' for pre-decoded header data
	* qemud/qemud.c: Decode the incoming client message header before
	  invoking remoteDispatchClientRequest

2009-07-16  Daniel P. Berrange  <berrange@redhat.com>

	Split generic RPC message dispatch code out from remote protocol API handlers
	* po/POTFILES.in: Add qemud/dispatch.c
	* qemud/dispatch.c, qemud/dispatch.h: Generic code handling dispatch of
	  RPC messages.
	* qemud/Makefile.am: Add dispatch.c to build
	* qemud/qemud.c: Include dispatch.h
	* qemud/qemud.h: Remove remoteDispatchClientRequest, remoteRelayDomainEvent
	  now in dispatch.h
	* qemud/remote.c: Remove remoteDispatchClientRequest, remoteRelayDomainEvent
	  now in dispatch.c, and dispatch_args, dispatch_ret, dispatch_fn & dispatch_data
	  now in remote.h
	* qemud/remote.h: Add typedefs for dispatch_args, dispatch_ret,
	  dispatch_fn, dispath_data. Add remoteGetDispatchData() API

2009-07-16  Paolo Bonzini  <pbonzini@redhat.com>

	Implement qemu dump capabilities
	* src/qemu_driver.c (qemudDomainCoreDump): New
	  (qemuDriver): Add core dump function. The behaviour is similar
	  as the current Xen dump

	add cd and pwd commands to virsh
	* src/virsh.c: adds cd and pwd commands to virsh useful for save and
	  restore commands
	* docs/virsh.pod virsh.1: update the documentation
	* AUTHORS: add Paolo Bonzini

2009-07-16  Jim Meyering  <meyering@redhat.com>

	make "make syntax-check" consistent with "git diff --check"
	This makes "make syntax-check" fail when a version-controlled
	file contains a trailing blank line.
	* cfg.mk (sc_prohibit_trailing_blank_lines): New rule.

	remove all trailing blank lines
	by running this command:
	git ls-files -z | xargs -0 perl -pi -0777 -e 's/\n\n+$/\n/'
	This is in preparation for a more strict make syntax-check
	rule that will detect trailing blank lines.

2009-07-16  Daniel P. Berrange  <berrange@redhat.com>

	Fix free of unitialized data upon PCI open fail

	Fix SELinux denial during hotplug
	* src/qemu_driver.c: Relabel disk images *before* running QEMU
	hotplug monitor commands

	Fix PCI device hotplug/unplug with newer QEMU
	* src/qemu_driver.c: Try new monitor syntax for hotplug first. If
	  that fails fallback to old KVM specific syntax

	Fix problem with QEMU monitor welcome prompt confusing libvirt after a libvirtd daemon restart with active guests
	* src/qemu_driver: Read and dicard pending monitor data
	  before issuing new monitor commands.

	Ensure spawned children have a stderr/out set to /dev/null if requested

	Allow autostart of libvirtd to be disabled with LIBVIRT_AUTOSTART=0
	* src/remote_internal.c: Disable libvirtd autostart if the
	  LIBVIRT_AUTOSTART=0 env variable is set
	* src/libvirt.c: Document environment variables can impact
	  the virConnectOpen API

2009-07-16  Daniel Veillard  <veillard@redhat.com>

	netcf XML validation and input and output tests
	* tests/interfaceschematest: test all XML data against the interface
	  schemas
	* tests/interfacexml2xmltest.c: parse and reserialize all XML data
	  and check the output is identical
	* tests/Makefile.am: hook up the tests
	* tests/.gitignore: add ignore test

	Add netcf XML schemas and test data
	* docs/schemas/interface.rng: schemas for the interface XML files
	  directly imported from netcf-0.1.0
	* tests/interfaceschemadata/*.xml: set of test files from netcf-0.1.0
	  changed to use single quote instead of double quote

	add support for netcf XML import and export
	* src/interface_conf.c src/interface_conf.h: the import and export
	  routines and the internal APIs
	* src/Makefile.am: hook the new file in the makefiles
	* src/libvirt_private.syms: export a few private symbols internally
	* po/POTFILES.in: the new file contains translatable strings

2009-07-15  Daniel P. Berrange  <berrange@redhat.com>

	Ensure test:/// URIs get routed to the non-privileged libvirtd
	* src/remote_internal.c: Ensure that all test:/// URIs are dealt
	  with by the auto-started, per-user unprivileged libvirtd instances

	Fix error reporting for security driver over remote protocol
	* qemud/remote.c: Send back the actual libvirt connection error
	  rather than formatting a generic error for security driver
	  methods
	* src/libvirt.c: Fix virDomainGetSecurityLabel, and
	  virNodeGetSecurityModel to correctly set the error on
	  the virConnectPtr object, and raise a full error rather
	  than warning when not supported

2009-07-15  Garry Dolley  <gdolley@arpnetworks.com>

	Update the links for RHEL libvirt bugzillas

2009-07-13  Garry Dolley  <gdolley@ucla.edu>

	Update links to bugzilla
	* docs/bugs.html[.in]: general tickets are under the 'Virtualization
	  Tools' product category and Fedora specific tickets are under the
	  'Fedora' product category.

2009-07-11  Cole Robinson  <crobinso@redhat.com>

	Fix docs and code disagreements for character devices.
	The 'pipe' character type wasn't documented.
	TCP uses a <protocol> element, not <wire>
	We weren't doing strict validation for protocol and source mode values.

	qemu: Check driver is initialized up front, to avoid segfault.
	If the qemu_driver was not initialized (possibly due to an error on driver
	startup), we can segfault if attempting to connect to the URI.

2009-07-10  Jim Meyering  <meyering@redhat.com>

	build: automatically rerun ./bootstrap when needed
	When "git pull" (or any other operation) brings in a new version of the
	gnulib git submodule, you must rerun the autogen.sh script.  With this
	change, "make" now fails and tells you to run ./autogen.sh, when needed.
	* autogen.sh: Maintain a new file, .git-module-status, containing
	the current submodule status.  If it doesn't exist or its content
	is different from what "git submodule status" prints, then run
	./bootstrap
	* .gitignore: Add .git-module-status
	* cfg.mk: Diagnose out of date submodule and fail.
	* README-hacking: Update not to mention bootstrap.
	* Makefile.am (MAINTAINERCLEANFILES): Add .git-module-status,
	so that "make maintainerclean" will remove it.

	build: make autogen.sh use autoreconf -if
	* autogen.sh: Use "autoreconf -if" instead of open-coding it with
	manual and unconditional invocation of each separate tool.

2009-07-10  Mark McLoughlin  <markmc@redhat.com>

	Use virDomainChrTypeFromString() instead of open coding
	* src/domain_conf.c: replace open coded chr type parsing with
	  virDomainChrTypeFromString(), retaining the existing semantics
	  where unknown types are silently mapped to the "null" type and
	  "pty" is used if none is specified

2009-07-10  Mark McLoughlin  <markmc@redhat.com>

	Switch to using a unix socket for the qemu monitor
	We keep support for the pty based monitor so that we can re-connect
	to VMs started by older versions of libvirtd.

	* src/domain_conf.c: handle formatting and parsing unix monitors

	* src/qemu_driver.c: add qemudOpenMonitorUnix(), remove the monitor
	  pty path searching from qemudFindCharDevicePTYs(), switch
	  qemudStartVMDaemon() and qemuDomainXMLToNative() to using a unix
	  monitor

	* tests/qemuxml2argvtest.c: switch to using a unix monitor

	* tests/qemuxml2argvdata/qemuxml2argv-*.args: update test data

2009-07-10  Mark McLoughlin  <markmc@redhat.com>

	Add the monitor type to the domain state XML
	There are no functional changes in this patch apart from adding the
	monitor type to the state XML.

	The patch mostly consists of switching to use virDomainChrDef every
	where to describe the monitor.

	* src/domain_conf.h: replace monitorpath with monitor_chr

	* src/domain_conf.c: handle parsing the monitor type and initializing
	  monitor chr

	* src/qemu_conf.[ch]: make qemudBuildCommandLine take a
	  virDomainChrDefPtr and use that to build the -monitor parameter

	* src/qemu_driver.c: split pty specific and common code from
	  qemudOpenMonitor, have qemudStartVMDaemon() initialize monitor_chr

	* tests/qemuxml2argvtest.c: update for qemudBuildCommandLine() change

2009-07-10  Mark McLoughlin  <markmc@redhat.com>

	Minor qemu monitor coding style fixes
	* src/qemu_driver.c: use a consistent coding style for function
	  definitions

	Don't leak vm->monitorpath on re-connect
	* src/qemu_driver.c: vm->monitorpath is already initialized in the case
	  of re-connect, so move the initialization for the normal startup case
	  out of the common code

2009-07-10  Jim Meyering  <meyering@redhat.com>

	build: update from gnulib, for latest maint.mk
	* gnulib: Update submodule to latest.
	This fixes the make syntax-check failure whereby sc_po_check
	would complain about cfg.mk.

	avoid a "make syntax-check" failure
	* .x-sc_avoid_if_before_free: Ignore *all* ChangeLog files,
	now, including ChangeLog-old.

2009-07-09  Daniel P. Berrange  <berrange@redhat.com>

	Fix wierd build problems due to autopoint overwriting gnulib m4
	* Makefile.am: List -I m4 first, in ACLOCAL_AMFLAGS
	* .gitignore: ignore gnulib/, ChangeLog, *rej, *orig, *#*# (emacs
	  temporary files)

2009-07-09  Jim Meyering  <meyering@redhat.com>

	doc: clone+build instructions
	* README-hacking: New file.
	* bootstrap: Remove obsolete comments.

	build: adjust aclocal's search patch to prefer gnulib's m4 files.
	* Makefile.am (ACLOCAL_AMFLAGS): Search gnulib/m4/ before m4/.

2009-07-08  Jim Meyering  <meyering@redhat.com>

	generate ChangeLog from git logs into distribution tarball
	No longer maintain a version-controlled ChangeLog file, but do
	continue to include a ChangeLog file in distribution tarball.
	* Makefile.am (gen-ChangeLog): New rule.
	(dist-hook): Depend on it.
	(EXTRA_DIST): Add ChangeLog-old.
	* bootstrap (modules): Add gitlog-to-changelog.
	* ChangeLog: Remove file.  Renamed to...
	* ChangeLog-old: ...this.  New file.
	* autogen.sh: Touch ChangeLog, to ensure it exists.  For automake.

	use gnumakefile and maintainer-makefile modules from gnulib
	* bootstrap (modules): Add gnumakefile and maintainer-makefile.
	* GNUmakefile: Remove file, now provided by gnulib.
	* Makefile.maint: Remove.  Replaced by maint.mk from gnulib.
	.gitignore: Add GNUmakefile and maint.mk.
	* cfg.mk (prev_version_file): Disable this feature.
	Setting this to /dev/null avoids an otherwise harmless diagnostic.

	remove all .cvsignore files

2009-07-08  Jim Meyering  <meyering@redhat.com>

	make .gnulib a submodule
	This makes it so we record (via a git submodule)
	a snapshot of whatever version of gnulib we're using,
	and none of gnulib sources are in the libvirt repository.
	The result is that we have as much reproducibility as when
	we version-controlled imported copies of the gnulib sources,
	but without the hassle of the manual process we used when
	syncing with upstream.

	Note that when you clone libvirt, you get only the libvirt
	repository, but when you first run ./bootstrap, it clones
	gnulib (at the SHA1 recorded via the submodule), creating
	the .gnulib/ hierarchy.  Then, the bootstrap script runs
	gnulib-tool to populate gnulib/ with the files that make
	up the selected modules.

	Put the following in your ~/.gitconfig file.
	[alias]
	  syncsub = submodule foreach git pull origin master

	The update procedure is simple:
	  git syncsub
	  ...build & test...
	  git commit -m 'gnulib: sync submodule to latest' .gnulib

	* .gitmodules: New file.
	* .gnulib: Initialize.
	* bootstrap: Set up to use the new submodule.
	Stop using --no-vc-files.
	Don't remove .gitignore files.
	Don't use or create .cvsignore.
	Diagnose an invalid --gnulib-srcdir=DIR argument.
	* build-aux/vc-list-files: Delete file, now pulled from gnulib.
	* build-aux/useless-if-before-free: Likewise.
	* po/POTFILES.in: Remove gnulib/lib/gai_strerror.c, since
	it no longer contains translatable strings.
	* gnulib/*: Remove gnulib/ hierarchy.

2009-07-08  Jim Meyering  <meyering@redhat.com>

	skip some of gnulib's new rules
	* cfg.mk (local-checks-to-skip): Add these: sc_error_message_uppercase,
	sc_program_name, sc_require_test_exit_idiom, sc_makefile_check.

	Prepare to use maint.mk from gnulib
	Since Makefile.maint will soon come from gnulib's maint.mk,
	sync Makefile.maint to have the same contents (modulo minor
	things).  In syncing it, we have to remove some libvirt-specific
	rules.  Since we want to keep them (of course), put those in cfg.mk.
	* Makefile.maint: Merge from gnulib's maint.mk.
	* cfg.mk (sc_avoid_write): New rule.  From Makefile.cfg.
	(sc_prohibit_strcmp_and_strncmp): Likewise, and rename.
	(sc_prohibit_asprintf, sc_prohibit_VIR_ERR_NO_MEMORY): Likewise.
	(sc_prohibit_nonreentrant): Likewise.
	(sc_prohibit_ctype_h): Likewise.
	(sc_TAB_in_indentation, sc_avoid_ctype_macros): Likewise.
	(sc_prohibit_virBufferAdd_with_string_literal): Likewise.
	(sc_prohibit_gethostby): Likewise.
	(sc_libvirt_unmarked_diagnostics): Likewise.  Also, rename the
	rule, inserting "_libvirt", since this rule is a specialization of
	the one in gnulib.
	* GNUmakefile: Include cfg.mk, not Makefile.cfg
	* .x-sc_prohibit_strcmp_and_strncmp: New file.
	* Makefile.am (EXTRA_DIST): Add .x-sc_prohibit_strcmp_and_strncmp

	* Makefile.cfg: Rename to...
	* cfg.mk: ...this.  New file.

2009-07-08  Jim Meyering  <jim@meyering.net>

	use automake-1.11's silent-rules option, when possible
	Don't use mylibtool, (subsumed by automake's silent rules)
	Its use was causing a non-srcdir build to fail.
	* Makefile.am (EXTRA_DIST): Remove mylibtool.
	* configure.in: Don't use mylibtool.

	* configure.in: Use AM_SILENT_RULES([yes]),
	but only if that m4 macro is defined.
	Thus, it works even on systems that lack automake-1.11.
	Daniel Berrange suggested adding the conditional, so that
	we don't have a hard requirement on 1.11, e.g., for RHEL5.

2009-07-08  Jim Meyering  <meyering@redhat.com>

	fix another failing "make distcheck" (qemuhelptest)
	It failed in a non-srcdir build because those 5 sample output
	files were not included in the distribution tarball.  Include them.
	* tests/Makefile.am (qemuhelpdata, EXTRA_DIST): Include these:
	kvm-74, kvm-86, qemu-0.10.5, qemu-0.9.1, qemu-kvm-0.10.5.

	fix failing "make distcheck"
	* docs/Makefile.am (xml): Distribute testpool.xml and testvol.xml,
	which are referenced from testnode.xml.

2009-07-08  Daniel P. Berrange  <berrange@redhat.com>

	Make it easier to debug tests running programs
		* tests/testutils.c: Don't discard stderr when running
		external programs during tests

	Support <video> element for QEMU guests
		* src/qemu_conf.c, src/qemu_conf.h: Use -vga or -std-vga
		when starting guests if video card is present
		* tests/qemuhelptest.c: Change to use constants instead
		of hardcoded hex numbers, and add VGA support
		* tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl-fullscreen.xml,
		tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.args,
		tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.xml,
		tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-sasl.args,
		tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-sasl.xml,
		tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-tls.xml,
		tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc.xml,
		tests/qemuxml2argvdata/qemuxml2argv-input-xen.xml: Add <video>
		element for testing graphics adapter
		* tests/qemuxml2argvtest.c: Add QEMUD_CMD_FLAG_VGA flag
		* tests/qemuxml2xmltest.c: Add missing graphics-vnc-sasl/tls tests

	Support <video> tag for defining VGA card properties
	 * docs/schemas/domain.rng: Define <video> element schema
	 * src/domain_conf.c, src/domain_conf.h, src/libvirt_private.syms:
	   Add parsing and formatting for <video> element

2009-07-08  Daniel Veillard  <veillard@redhat.com>

	Report the object name on lookup error
	* src/network_driver.c src/node_device.c src/storage_driver.c:
	  many places in the code reported 'No xxx with matching name" after
	  a Lookup error without reporting the name used by the failed lookup

2009-07-08  Harshavardhana  <harsha@gluster.com>

	Add new net filesystem glusterfs
	* src/storage_conf.c src/storage_conf.h: adds glusterfs to the list
	  of network storage
	* libvirt.spec.in: adds the dependency on glusterfs-client

2009-07-07  Paolo Bonzini  <pbonzini@redhat.com>

	Avoid raising an internal error
	* src/qemu_conf.c: when connecting an interface if it reference
	  an undefined network, then we used to raise an internal error.

2009-07-07  Daniel Veillard  <veillard@redhat.com>

	Fix informations about previous git server
	* docs/downloads.html[.in]: update the secton about
	the server on git.et.redhat.com based on the plans
	Jim posted.

2009-07-06  Dan Kenigsberg  <danken@redhat.com>

	Fix python examples to use read-write conn
	* docs/examples/python/domstart.py python/tests/create.py:
	The two example were broken as they needed full-access connection
	but only opened read-only connections

2009-07-06  Daniel Veillard  <veillard@redhat.com>

	update download informations after switch to git * docs/downloads.html docs/downloads.html.in: update download   informations after switch to git daniel