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
|
2025- 4- 1 Jiri Denemark <jdenemar@redhat.com>
Post-release version bump to 11.3.0
2025- 3- 26 SuhailAhmedVelorum <suhailahmedvelorum@gmail.com>
Fixed minor typo in libvirt-override.py::openAuth TODO item
2025- 3- 25 Michal Privoznik <mprivozn@redhat.com>
Add support for domain NIC MAC address change event
2025- 3- 21 Michal Privoznik <mprivozn@redhat.com>
override: domain: Implement override for virDomainSetThrottleGroup()
The bindings generator can't generate proper bindings for
virDomainSetThrottleGroup() (because of typed parameters in the
arguments) so implement it manually.
2025- 3- 21 Michal Privoznik <mprivozn@redhat.com>
override: domain: Implement override for virDomainGetAutostartOnce()
The bindings generator can't generate proper bindings for
virDomainGetAutostartOnce() (because of int* in the arguments) so
implement it manually.
2025- 3- 21 Michal Privoznik <mprivozn@redhat.com>
Modernize typed parameter fetching in libvirt_virDomainSetBlockIoTune()
Instead of fetching supported tunables and passing only those to
the API (effectively ignoring unsupported ones), pass all
tunables or error out on unsupported ones.
2025- 3- 3 Jiri Denemark <jdenemar@redhat.com>
Post-release version bump to 11.2.0
2025- 2- 17 Pavel Hrdina <phrdina@redhat.com>
ci: refresh with 'lcitool manifest'
2025- 1- 15 Jiri Denemark <jdenemar@redhat.com>
Post-release version bump to 11.1.0
2024- 12- 2 Jiri Denemark <jdenemar@redhat.com>
Post-release version bump to 11.0.0
2024- 11- 18 Daniel P. Berrangé <berrange@redhat.com>
ci: refresh with 'lcitool manifest'
Notable changes
* openSUSE Leap updated to 15.6
* Switch to URLs for referencing projects in manifest
2024- 11- 1 Jiri Denemark <jdenemar@redhat.com>
Post-release version bump to 10.10.0
2024- 10- 22 Ariel Otilibili <otilibil@eurecom.fr>
tox.ini: bumped Python
Removed 3.8, added 3.13 [1].
[1] https://devguide.python.org/versions/
2024- 10- 1 Jiri Denemark <jdenemar@redhat.com>
Post-release version bump to 10.9.0
2024- 9- 2 Jiri Denemark <jdenemar@redhat.com>
Post-release version bump to 10.8.0
2024- 8- 8 Ariel Otilibili <otilibil@eurecom.fr>
example/domstart.py: Removed useless brackets for tuple unpacking
2024- 8- 8 Ariel Otilibili <otilibil@eurecom.fr>
tox.ini: Bumped environment list for Python
* aligned list with supported Python versions [1]
* as of today, supported versions are 3.8 to 3.12
https://devguide.python.org/versions/
2024- 8- 8 Ariel Otilibili <otilibil@eurecom.fr>
Makefile: `make check` now computes env variable on the fly
* env variable used to be Python3.6
* Python3.6 is end of life since December 2021 [1].
[1] https://devguide.python.org/versions/
2024- 8- 5 Jiri Denemark <jdenemar@redhat.com>
Post-release version bump to 10.7.0
2024- 7- 1 Jiri Denemark <jdenemar@redhat.com>
Post-release version bump to 10.6.0
2024- 6- 11 Konstantin Khorenko <khorenko@virtuozzo.com>
examples/nodestat: Show memory pinning information again
Resurrect the logic after it has been occasionally broken during fixing
the syntax complains from python.
Fixes: c588ba9 ("examples/nodestat: Fix None comparison")
2024- 6- 3 Jiri Denemark <jdenemar@redhat.com>
Post-release version bump to 10.5.0
2024- 5- 2 Michal Privoznik <mprivozn@redhat.com>
ci: Drop CentOS 8 Stream and switch F38 to 40, Ubuntu 20.04 to 22.04
There a lot happening here, but that's because otherwise lcitool
fails to regenerate files. Firstly, CentOS 8 is dropped as it's
unsupported now. Secondly, Fedora 40 is introduced and Fedora 38
is dropped. And lastly, Ubuntu 24.04 is introduced and Ubuntu
20.04 is dropped.
2024- 5- 2 Michal Privoznik <mprivozn@redhat.com>
test_aio.py: Fix skip message
There are two unit tests in test_aio.py that are skipped if
Python is too new (3.10 or newer). But the message printed when
they are skipped mentions just 3.10 which is confusing. Change it
to "3.10+".
2024- 5- 2 Michal Privoznik <mprivozn@redhat.com>
Switch to PyMODINIT_FUNC annotation
Instead of doing some 'extern ...' declaration magic to force
proper PyInit_libvirtmod*() symbol exposure in resulting .so we
can use what Python already offers - PyMODINIT_FUNC macro and
call it a day.
2024- 5- 2 Michal Privoznik <mprivozn@redhat.com>
generator.py: Drop build/ prefix from #include
When -Ibuild flag is passed to compiler then build/ can be dropped
from includes. This is safe to do, because the prefix is only on
local includes (#include "") not system ones (#include <>).
2024- 5- 2 Michal Privoznik <mprivozn@redhat.com>
generator.py: Switch from ${module}-export.c to ${module}-export.c.inc
The generator.py generates a (per module) table of functions it
generated code for and stores it in ${module}-export.c file. The
file is then #include-d in corresponding override.c in the table
of all methods implemented in the module.
Now, problem is with naming of the file because the ".c" suffix
might suggest the file needs to be compiled. Well, it doesn't.
It's way closer to being a header file, so change the suffix to
".c.inc".
2024- 5- 2 Michal Privoznik <mprivozn@redhat.com>
generator.py: Allow source and build dirs override
Soon generator.py is going to be ran from a build directory which
is different than the source directory. Allow specifying these
directories on the cmd line.
And while at it, introduce new "c+py" output mode in which both C
and Python files are generated. While this is a fallback mode if
no output mode is selected, we need this new mode so that
aforementioned directories can be specified.
2024- 5- 2 Michal Privoznik <mprivozn@redhat.com>
setup.py: s/PY_VERSION/VERSION/
When generating spec file, @PY_VERSION@ is replaced with the
current version of libvirt-python. Well, it's not as obvious as
it could be: usually it's just @VERSION@. Worse, the PY_ prefix
may mislead readers into thinking it refers to python version.
Just drop the PY_ prefix.
2024- 5- 2 Jiri Denemark <jdenemar@redhat.com>
Post-release version bump to 10.4.0
2024- 5- 1 Jelle van der Waa <jvanderwaa@redhat.com>
examples: replace logging.warn with logging.warning
logging.warn is an alias to logging.warning since Python 3.3 and will be
removed in Python 3.13.
2024- 4- 30 Daniel P. Berrangé <berrange@redhat.com>
gitlab: stop using a venv when creating source/binary dist
The change to use 'python -m build' in
commit 333c8bef2bcca5ca7dbcdb5861a385d626e0feb9
Author: Erik Skultety <eskultet@redhat.com>
Date: Tue Jun 20 12:19:40 2023 +0200
ci: Drop direct 'setup.py' usage
resulted in the CI jobs all downloading latest setuptools and
deps from pypi and running builds with them in a venv. IOW we
ceased testing against the setuptools/wheel packages provided
by the distro, which is the whole point of the CI.
Passing the '-n -x' flags to 'python -m build' tells it to stop
using a venv and not to check dependancies, thus letting it
use what we pre-installed in the container.
This doesn't work on CentOS Stream 8, however, so we revert to
using the old setup.py approach. This is a short term issue,
since Stream 8 is EOL at the end of May, so we'll be deleting
all the Stream 8 jobs across libvirt CI very soon.
2024- 4- 25 Daniel P. Berrangé <berrange@redhat.com>
ci: refresh with lcitool manifest
This pulls in the new wheel packages.
2024- 4- 25 Daniel P. Berrangé <berrange@redhat.com>
ci: add 'python3-wheel' as a dep
The 'python -m build' command creates a source dist and a binary
wheel. To be able run this command without creating a new venv
and downloading from pypi, we need to pre-install the 'wheel'
package.
2024- 4- 25 Daniel P. Berrangé <berrange@redhat.com>
ci: refresh with latest lcitool manifest
Fixes logic that caused some jobs to mistakenly not be run
when expected.
2024- 4- 2 Jiri Denemark <jdenemar@redhat.com>
Post-release version bump to 10.3.0
2024- 3- 1 Jiri Denemark <jdenemar@redhat.com>
Post-release version bump to 10.2.0
2024- 2- 27 Michal Privoznik <mprivozn@redhat.com>
ci: Switch native_git_build_job to c9s and resume api_coverage_job
Currently, there's just one native_git_build_job -
x86_64-centos-stream-8-git and this is a problem because that's
the job that api_coverage_job then uses. But CentOS Stream 8 has
too old lxml which then makes tests/test_api_coverage.py skip its
run. By switching to CentOS Stream 9 the test can run happily
again.
2024- 2- 27 Michal Privoznik <mprivozn@redhat.com>
test_api_coverage: Reflect different naming in python for virDomainFDAssociate() and virDomainRestoreParams()
While virDomainRestoreParams() has 'virDomain' prefix (and thus
is put into Domain class), it is really in the same family as
virDomainRestore() or virDomainRestoreFlags() -> it acts upon
virConnect object and thus belongs into Connect class.
Then, virDomainFDAssociate is exposed as Domain.FDAssociate() but
because of the way we would generate the method's name
(fDAssociate) the test thinks it's not implemented.
2024- 2- 20 Vincent Vanlaer <libvirt-e6954efa@volkihar.be>
Fix memory leak in virStreamRecvFlags
virStreamRecvFlags allocates a temporary buffer to store the received
stream data in. This buffer was not freed on returns other than the
normal return with data.
2024- 1- 19 Daniel P. Berrangé <berrange@redhat.com>
ci: refresh with latest 'lcitool manifest'
This refresh gets rid of the split jobs for prebuilt and local
container environments.
2024- 1- 15 Jiri Denemark <jdenemar@redhat.com>
Post-release version bump to 10.1.0
2024- 1- 8 Peter Krempa <pkrempa@redhat.com>
ci: Install built module for testing insde an venv
Distros recently started to object to using 'pip' to install system-wide
packages to prevent breakage. We were hacking-around that by using
'pip install --break-system-packages', but it's straightforward to
simply create a venv with '--system-site-packages' and install it there.
2024- 1- 8 Peter Krempa <pkrempa@redhat.com>
ci: Update Fedora and Debian versions and regenerate
Update:
Debian-10 -> Debian-12
Fedora-37 -> Fedora-38
Fedora-38 -> Fedora-39
Also the artifacts from the Fedora 39 job are needed for the integration
test suite in the main libvirt project.
For Debian 12 we need to start using
'pip install --break-system-packages' as a hack to work around
installation of the built package for testing.
2023- 12- 1 Jiri Denemark <jdenemar@redhat.com>
Post-release version bump to 10.0.0
2023- 11- 1 Jiri Denemark <jdenemar@redhat.com>
Post-release version bump to 9.10.0
2023- 10- 2 Jiri Denemark <jdenemar@redhat.com>
Post-release version bump to 9.9.0
2023- 9- 25 Daniel P. Berrangé <berrange@redhat.com>
Request the Python stable API when building
We have Python 3.6 as a minimum version. If we set Py_LIMITED_API
to 0x03060000, we'll get the stable python API associated with
versions >= 3.6. This lets users compile once and have the libvirt
binary module be loadable by any Python version >= 3.6, as described
in:
https://docs.python.org/3/c-api/stable.html
2023- 9- 25 Daniel P. Berrangé <berrange@redhat.com>
Use PySequence_GetItem preferentially
Although marginally faster, PySequence_ITEM is not part
of the stable API and also omits some safety checks. It
is better for us to be using PySequence_GetItem instead.
2023- 9- 25 Daniel P. Berrangé <berrange@redhat.com>
add missing includes for C library functions
We use various C library functions like printf, strcmp, free
but don't have the corresponding #includes, getting them
indirectly via Python.h. This is a bad idea as Python.h is
not guaranteed to provided these, and indeed will omit them
when Py_LIMITED_API is greater then 0x030a0000.
2023- 9- 25 Pino Toscano <ptoscano@redhat.com>
setup: simplify authors list generation
Use a set to collect the authors from the git output with no duplicates,
then sort the resulting set, and apply the wanted indentation.
This method is more Pythonic, using a set to avoid duplicates; applying
the indentation after the sorting makes the sorting slightly faster.
2023- 9- 25 Pino Toscano <ptoscano@redhat.com>
setup: switch away fron subprocess.Popen()
Adopt subprocess.check_output() as more modern and higher-level way to
invoke processes, checking that they succeed, and getting their output.
2023- 9- 25 Pino Toscano <ptoscano@redhat.com>
setup: remove unnecessary f-string
The whole content of this f-string is a variable, so use that variable
directly.
2023- 9- 25 Pino Toscano <ptoscano@redhat.com>
setup: invoke git commands properly
Storing the git commands as single string, to split it by space later
on, works only in case there are no spaces in the arguments, which is
exactly what is in those commands.
Instead, specify them directly as lists, with the options & arguments
split in the right way. This fixes the generation of the AUTHORS and
ChangeLog files.
2023- 9- 21 Daniel P. Berrangé <berrange@redhat.com>
gitlab: unset CFLAGS for rpm build
Setting CFLAGS before invoking rpm-build causes replacement of the
CFLAGS that RPM wants to set for python. This causes the loss of
certain flags needed to turn on debug output and optimization.
Previously this wasn't a problem as something in setuptools appears
to have been adding -g anyway, but with the update to python 3.12
this now fully breaks. We should never have been setting CFLAGS
during the RPM build so we drop it unconditionally for all distros.
2023- 9- 21 Daniel P. Berrangé <berrange@redhat.com>
Add binding for network metadata events
2023- 9- 1 Jiri Denemark <jdenemar@redhat.com>
Post-release version bump to 9.8.0
2023- 8- 21 Erik Skultety <eskultet@redhat.com>
ci: lcitool: Maintain project package deps lists here
Each respective project that lcitool knows about and currently
maintains its list of package dependencies knows best what packages
they actually depend on. If a new dependency is currently needed,
first a change in lcitool is necessary before GitLab jobs and
containers can be updated. Provided a mapping already exists in
lcitool (which can quickly be added as an override via mappings.yml
temporarily) we speed up the whole CI update process by
one step.
Note that starting this commit lcitool must be invoked as
'$ lcitool -d/--data-dir ci/lcitool ...'
to pick up the project dependency list correctly.
2023- 8- 1 Jiri Denemark <jdenemar@redhat.com>
Post-release version bump to 9.7.0
2023- 7- 3 Jiri Denemark <jdenemar@redhat.com>
Post-release version bump to 9.6.0
2023- 6- 22 Erik Skultety <eskultet@redhat.com>
README: Drop direct 'setup.py' usage
With all the bits in place we can now replace the direct 'setup.py'
invocation examples with alternatives.
2023- 6- 22 Erik Skultety <eskultet@redhat.com>
ci: Drop direct 'setup.py' usage
With all the bits in place we can now drop the 'setup.py' invocations
with preferred alternatives.
This patch does a few things:
- we don't run plain install because that always spins up a new build
process regardless of whether there are build artifacts literally from
the previous command, so instead we install the built wheel directly
- when building, we build both the .whl binary and an sdist because
we'll need the sdist for rpmbuild later in the CI job
- we don't capture the 'build' path as a job artifact anymore, because
that now only contains egg metadata, all the build artifacts are
created by Python's build module under 'dist' so we capture that one
instead
- we always limit pytest to the 'tests' directory which was something
'setup.py test' used to do as a precaution measure, but setup.py no
longer has the logic (which is fine)
2023- 6- 22 Erik Skultety <eskultet@redhat.com>
spec: Invoke pytest properly
With all the bits in place we can now drop the 'setup.py' invocations
with preferred alternatives. The way to do this in a SPEC file is to
use either of the following macros: %tox or %pytest - both of which
automatically set paths for the test suite correctly which is
something we used to do ourselves in our implementation of the
setup.py's test command originally.
That is wrong and with the migration to PEP-517 compliant builds it
also won't work anymore properly, because there'd be no libs to import
by mangling PYTHONPATH, we'd only get an sdist or a wheel, or in case
of rpmbuild a preset buildroot environment.
2023- 6- 22 Erik Skultety <eskultet@redhat.com>
setup: Drop the my_test command
Direct setup.py invocations are being discouraged in favour of
using Python's 'build' module. Therefore, we can't really make use of this command
anymore since only wheels and tarballs are built with the 'build' module
compared to the previous state of the art of dumping the freshly built
modules and libraries directly inside the build directory.
We'll have to encourage usage of tox which will install the package
inside a virtualenvironment for the tests. Future patch will update the
Makefile targets to make this easier for the end users.
2023- 6- 22 Erik Skultety <eskultet@redhat.com>
setup: Drop the clean command
Direct setup.py invocations are discouraged anyway, use git clean
or 'make clean' instead.
2023- 6- 22 Erik Skultety <eskultet@redhat.com>
Add pyproject.toml
Given the missing setuptools keywords issue and hence having moved all
the declarative stuff to setup.cfg this one is only a very basic one
just to comply PEP-517 and foolproof this project for the future
PyPa/pip changes.
2023- 6- 22 Erik Skultety <eskultet@redhat.com>
Makefile: Add a 'test' rule to run the full tox execution
This one should be used for the "full" test experience including any
additional environments, test suites and linters we may introduce
further down the road.
2023- 6- 22 Erik Skultety <eskultet@redhat.com>
Makefile: Update targets according to the new way of building
- drop direct setup.py invocations
- clean the artifacts directly with 'rm'
- use tox instead of invoking pytest otherwise we don't have a
mechanism to test against the freshly built libvirt modules other
than unpacking the built wheel and mangling the PYTHONPATH again
- use direct rpmbuild invocation to build RPM (the rpm target in its
current form didn't really work anyway)
2023- 6- 22 Erik Skultety <eskultet@redhat.com>
setup: Query library version out of a file
This makes it possible to programatically query the version in any
stage of the build process, including Makefile etc.
2023- 6- 22 Erik Skultety <eskultet@redhat.com>
Move declarative stuff out of setup.py to setup.cfg
So, why using setup.cfg if pyproject.toml is the new best thing
recommended everywhere? Well, quite a few of the fields we use with
setuptools are setuptools-specific and haven't been introduced as
keywords to pyproject.toml yet. There is a chance that these fields
could be added via a dedicated 'tool.setuptools' TOML section, but none
of it is officially documented and so it would be BETA at best anyway.
Let's not try our luck and use a declarative config file tailored
specifically to setuptools - setup.cfg. It's also unlikely we'd switch
from setuptools to something else in the near future given the nature
of building this project (i.e. building with C modules) and if so, it
would likely not be a PyPa recommended PEP-517 compliant build
system anyway, e.g. meson, so we're totally fine doing this.
2023- 6- 22 Erik Skultety <eskultet@redhat.com>
README: Move the long_description from setup.py in here
2023- 6- 22 Erik Skultety <eskultet@redhat.com>
MANIFEST.in: Cleanup
When migrated to the PEP-517 compliant builds, some errors occurred due
to missing or non-existent files mentioned in the MANIFEST. Notable
changes:
- README and MANIFEST files are automatically added to sdist per
MANIFEST documentation
- we want all tests/examples to be included, so use the 'graft' keyword
instead of enumerating individual files
- we want all *.[ch] files as those are needed for the build, so use
'include *.[ch]' instead of enumerating individual files
- we want all *.xml files, so use 'include *.xml'
- we want all *.py files - in case this is no longer the case in the
future, we'll need to tweak that 'include'
- we don't want any __pycache__ nor *.pyc build artifacts, so exclude
them globally
2023- 6- 21 Erik Skultety <eskultet@redhat.com>
ci: Refresh with latest lcitool changes
- bump OpenSUSE Leap 15.4 -> 15.5
- add python3-build dependency (PEP-517)
- add python3-venv dependency (PEP-517)
2023- 6- 9 Erik Skultety <eskultet@redhat.com>
setup: styling: Fix last occurrence of os.path in favour of pathlib
Commit e749b4cf forgot to update a couple more occurrences.
Fixes: e749b4cf111bcfc9ceeb88be57dc1d810fc631d9
2023- 6- 9 Erik Skultety <eskultet@redhat.com>
setup: Drop explicit creation of the build dir in sdist
No need to do that since we'll create it in the top-level code as a
first thing anyway.
2023- 6- 9 Erik Skultety <eskultet@redhat.com>
setup: Use a simple helper to generate dist files from .in templates
The code is almost identical in the impacted cases, so factor it out.
2023- 6- 9 Erik Skultety <eskultet@redhat.com>
setup: styling: Use context managers more
Some of the operations, namely file operations and spawning processes
can utilize the power of context managers. Use them more, use them
together.
2023- 6- 9 Erik Skultety <eskultet@redhat.com>
setup: Move over from os.popen to subprocess.Popen
subprocess is the high-level Pythonic interface providing more
flexibility over the low-level os.popen stuff. It is recommended to
always use subprocess over the direct 'os' interface.
2023- 6- 9 Erik Skultety <eskultet@redhat.com>
setup: styling: More f-string conversions
Fix a few more occurrences.
Fixes: 745e5a8ca46feb1acf3382c38eb45c74c1c42489
2023- 6- 8 Erik Skultety <eskultet@redhat.com>
MANIFEST.in: Add Makefile
2023- 6- 8 Erik Skultety <eskultet@redhat.com>
tox.ini: Drop sanitytest execution
Commit 60044515 renamed sanitytest to test_coverage_api but forgot to
update the tox.ini file.
Fixes: 60044515a256c36afad0fc5efcb7ea946eb93783
2023- 6- 8 Erik Skultety <eskultet@redhat.com>
COPYING: Only ship a single license file COPYING
The correct license we've used for a while is LGPLv2+, so drop the
original.
2023- 6- 8 Erik Skultety <eskultet@redhat.com>
setup: Simplify get_pkgconfig_data
We don't need to do both None/non-None checks on the returned string.
2023- 6- 8 Erik Skultety <eskultet@redhat.com>
setup: Move away from os.path to pathlib.Path
Drops usage of the glob module along the way as pathlib integrates glob
as well.
2023- 6- 7 Erik Skultety <eskultet@redhat.com>
setup: styling: Don't mix top-level code with function/class definition
It hinders readability so much when the top-level code that gets
executed right away when setup.py is loaded is mixed in between type
definitions.
2023- 6- 7 Erik Skultety <eskultet@redhat.com>
setup: styling: Format multi-line arguments properly
2023- 6- 7 Erik Skultety <eskultet@redhat.com>
setup: styling: Adopt f-strings in favour of old-style string formatting
2023- 6- 7 Erik Skultety <eskultet@redhat.com>
setup: styling: Drop unexpected spaces when providing kwargs arguments
2023- 6- 7 Erik Skultety <eskultet@redhat.com>
setup: styling: Replace apostrophes with quotes
Let's standardize on usage of one and be consistent with it.
2023- 6- 7 Erik Skultety <eskultet@redhat.com>
setup: styling: Fix method/function/class spacing
2 newlines in between classes/functions, 1 newline in between methods.
2023- 6- 7 Erik Skultety <eskultet@redhat.com>
setup: Re-order the imports
First go general, whole module imports, then specific symbol imports.
2023- 6- 7 Erik Skultety <eskultet@redhat.com>
setup: Bump the minimum version of Python to 3.6
3.6 is already EOL, but many platforms still default to Python 3.6 when
it comes to the default platform Python package. Since we don't rely
on any 3.7+ features in the bindings at the moment, let's keep
everyone's life simpler and stay with 3.6 for now, we can bump it again
in the future.
2023- 6- 7 Erik Skultety <eskultet@redhat.com>
setup: Reduce the Python classifiers to "Python :: 3" only
We're not good at tracking all the released Python 3 versions (+ we
don't support Python 2 anymore).
Additionally, future patches will take care of reporting the minimum
required version of Python anyway through the 'python_requires' field
which shows up correctly in PyPI.
2023- 6- 1 Jiri Denemark <jdenemar@redhat.com>
Post-release version bump to 9.5.0
2023- 5- 31 Han Han <hhan@redhat.com>
virDomainMigrate3Params: Add missing params
Add these missing migrate params:
- VIR_MIGRATE_PARAM_DISKS_URI, since libvirt v6.8.0(49186372db)
- VIR_MIGRATE_PARAM_TLS_DESTINATION, since libvirt v6.0.0(1b8af37213e)
- VIR_MIGRATE_PARAM_COMPRESSION_ZLIB_LEVEL and VIR_MIGRATE_PARAM_COMPRESSION_ZSTD_LEVEL,
since libvirt v9.4.0(150ae3e62b9)
2023- 5- 3 Erik Skultety <eskultet@redhat.com>
ci: Drop Fedora 36 target
2023- 5- 3 Erik Skultety <eskultet@redhat.com>
ci: Add Fedora 38 target
2023- 5- 3 Erik Skultety <eskultet@redhat.com>
ci: Replace OpenSUSE Leap 15.4 target with Leap 15 name
We now refer to the latest Leap 15.X simply as Leap 15 in lcitool.
2023- 5- 2 Jiri Denemark <jdenemar@redhat.com>
Post-release version bump to 9.4.0
2023- 4- 26 Daniel P. Berrangé <berrange@redhat.com>
rpm: convert license to SPDX format
2023- 4- 19 Jiri Denemark <jdenemar@redhat.com>
Post-release version bump to 9.3.0
2023- 4- 19 Daniel P. Berrangé <berrange@redhat.com>
setup: limit pytest to 'tests' subdir
The libvirt git repo contains test data that represents the
layout of files in sysfs, which has two subdirs that mutually
reference each other with symlinks.
When pytest does test discovery it will traverse every
directory it finds underneath the libvirt-python checkout.
Since we checkout libvirt as a sub-dir, pytest traverses
everything in libvirt git and gets stuck in an infinite
loop following symlinks in the libvirt test data.
Telling pytest to only look at the 'tests' subdir avoids
this extra traversal.
2023- 4- 19 Daniel P. Berrangé <berrange@redhat.com>
ci: pass --break-system-packages on Debian Sid
Debian Sid python packages block users from installing packages using
pip unless using a venv. A venv has no benefit when we are running in
a throwaway container which has no need for software upgrades.
2023- 4- 19 Daniel P. Berrangé <berrange@redhat.com>
ci: mark bleeding edge distros as non-gating
Fedora Rawhide, Debian Sid and OpenSUSE Tumbleweed are all liable to
have sporadic failures due to being bleeding edge distros. Thus they
should not gate contributor changes that are otherwise correct.
2023- 4- 19 Daniel P. Berrangé <berrange@redhat.com>
ci: regenerated with lcitool manifest
This replaces OpenSUSE Leap 15.3 with 15.4
2023- 3- 1 Jiri Denemark <jdenemar@redhat.com>
Post-release version bump to 9.2.0
2023- 2- 13 Michal Privoznik <mprivozn@redhat.com>
Fix sign compare offenders
In a few places we compare signed and unsigned integers. In
majority of cases it's because the iteration variable is declared
as ssize_t but then in the for() loop it's compared against an
unsigned int. But there is one case where the opposite happens
(libvirt_virDomainSendKey()), or where an UINT_MAX (which is
inherently unsigned) is compared against signed long.
Also, use this opportunity to decrease scope of 'j' variable
inside of libvirt_virDomainInterfaceAddresses().
2023- 2- 13 Michal Privoznik <mprivozn@redhat.com>
Stop typecasting libvirt_intWrap() arguments
There's no need to explicitly typecast arguments passed to
libvirt_intWrap() as they are int or long already.
2023- 2- 13 Michal Privoznik <mprivozn@redhat.com>
libvirt-override: Don't typecast strlen() in debug printings
After some data was read from an incoming stream, we debug print
their length using strlen() (assuming its text stream, not binary
stream). Anyway, the debug format uses %d which then requires
strlen() to be typecasted. Well, we can use %zu and drop the
typecast.
2023- 2- 13 Michal Privoznik <mprivozn@redhat.com>
libvirt_virConnectOpenAuth: Avoid plain PyLong_AsLong() call
When constructing the list of credentials to pass to
virConnectOpenAuth(), the virConnectAuth.credtype member is set
via plain PyLong_AsLong() without any error checking. Well, the
code relies on virConnectOpenAuth() to do sanity check of passed
arguments.
Switch to libvirt_intUnwrap() which does check for errors and
avoid needless trip to libvirt's public API upon error.
2023- 2- 13 Michal Privoznik <mprivozn@redhat.com>
libvirt_virNodeGetInfo fix
2023- 2- 13 Michal Privoznik <mprivozn@redhat.com>
typewrappers: Drop typecast in libvirt_intWrap()
The libvirt_intWrap() accepts an integer and passes it to
PyLong_FromLong() which accepts a long. It's perfectly okay to
let compiler do that implicitly.
2023- 2- 13 Michal Privoznik <mprivozn@redhat.com>
typewrappers: Rework libvirt_uintWrap()
Python C API offers PyLong_FromUnsignedLong() which allows us to
drop typecast.
2023- 2- 13 Michal Privoznik <mprivozn@redhat.com>
typewrappers: Rework libvirt_uintUnwrap()
Python C API offers PyLong_AsUnsignedLong() which already raises
an exception on negative values. Rewrite our libvirt_uintUnwrap()
to use that and drop check for negative values.
2023- 1- 16 Jiri Denemark <jdenemar@redhat.com>
Post-release version bump to 9.1.0
2023- 1- 12 Peter Krempa <pkrempa@redhat.com>
override: domain: Implement override for virDomainFDAssociate
The bindings generator can't generate proper bindings for FD passing so
the bindings need to be implemented manually both the python wrapper and
the C backend.
2023- 1- 6 Erik Skultety <eskultet@redhat.com>
ci: manifest: Define RPM artifacts for regular CentOS Stream 8 build
Commit 7360326 missed the fact that artifacts were only defined for the
libvirt Git type of libvirt-python build (git is cloned, libvirt is
built and then libvirt-python) based on the
'native_git_build_job_prebuilt_env' job template whereas libvirt CI
expects the RPM artifacts to come from a job based on the
'native_build_job' template instead.
Note that this patch is a hotfix to something which requires a proper
cleanup to stay consistent with the way we're handling the same thing
in libvirt-perl.
2023- 1- 6 Erik Skultety <eskultet@redhat.com>
.gitignore: Ignore more common Python build artifacts
2023- 1- 5 Erik Skultety <eskultet@redhat.com>
ci: manifest: Define artifacts cache
After commit 6e0d4d53 we lost RPM artifacts cache breaking the whole
integration CI. The reason for that is that we manually defined the
artifacts cache in gitlab.yml instead of manifest.yml. Naturally with
the next lcitool update, gitlab.yml got overwritten according to
manifest.yml which didn't define any artifacts cache.
Fixes: 6e0d4d53d51e8aa9d537e404a886eab131e311cc
2023- 1- 5 Erik Skultety <eskultet@redhat.com>
ci: manifest: Replace 'expiry' with 'expire_in'
'expiry' isn't a keyword in lcitool anymore, the only reason why
everything has kept working despite lcitool updates is that lcitool
sets 'expire_in' to 2 days by default.
2023- 1- 4 Erik Skultety <eskultety@ridgehead.home.lan>
ci: Refresh and add Fedora 37 target
2022- 12- 1 Jiri Denemark <jdenemar@redhat.com>
Post-release version bump to 9.0.0
2022- 11- 23 Daniel P. Berrangé <berrange@redhat.com>
rpm: add explicit build dep on python3-setuptools
We previously got this implicitly via a dep from python3-pytest
so never noticed that it was missing. The implicit dep is going
away in rawhide real soon.
2022- 11- 1 Jiri Denemark <jdenemar@redhat.com>
Post-release version bump to 8.10.0
2022- 10- 13 Peter Krempa <pkrempa@redhat.com>
ci: Expose built RPMs as artifacts
Expose the artifacts from the centos-stream-8/9 and fedora 35/36 jobs so
that the main libvirt integration testing project can consume them.
The new libvirt sub-rpm containing a python helper to access QMP
directly requires python environment which we didn't yet install in the
integration job.
2022- 10- 10 Chris Gunn <chrisgun@microsoft.com>
Fix memory leak in libvirt_virStreamRecv.
The libvirt_virStreamRecv function uses a temporary allocated buffer to
receive data before copying the data into a Python byte array. But
there are some error paths where this buffer is not freed. This change
fixes that memory leak.
2022- 10- 3 Erik Skultety <eskultet@redhat.com>
ci: Fix the stage of the api-coverage job
The 'extends' stanza supports a list, however there's a merge algorithm
in place where a subsequent list entry overwrites all conflicting
settings from the previous one - which is exactly what happened here as
the gitlab-build-{local,prebuilt}-env job template overwrote
api-coverage's stage to 'builds' whereas the original was
'sanity_checks'.
Fixes: 4733e2a2d13cb9a85127ba17c04cc29278b31e89
2022- 10- 3 Jiri Denemark <jdenemar@redhat.com>
Post-release version bump to 8.9.0
2022- 9- 30 Daniel P. Berrangé <berrange@redhat.com>
ci: refresh with latest lcitool manifest
This refresh switches the CI for contributors to be triggered by merge
requests. Pushing to a branch in a fork will no longer run CI pipelines,
in order to avoid consuming CI minutes. To regain the original behaviour
contributors can opt-in to a pipeline on push
git push <remote> -o ci.variable=RUN_PIPELINE=1
This variable can also be set globally on the repository, though this is
not recommended. Upstream repo pushes to branches will run CI.
The use of containers has changed in this update, with only the upstream
repo creating containers, in order to avoid consuming contributors'
limited storage quotas. A fork with existing container images may delete
them. Containers will be rebuilt upstream when pushing commits with CI
changes to the default branch. Any other scenario with CI changes will
simply install build pre-requisite packages in a throaway environment,
using the ci/buildenv/ scripts. These scripts may also be used on a
contributor's local machines.
With pipelines triggered by merge requests, it is also now possible to
workaround the inability of contributors to run pipelines if they have
run out of CI quota. A project member can trigger a pipeline from the
merge request, which will run in context of upstream, however, note
this should only be done after reviewing the code for any malicious
CI changes.
2022- 9- 9 Bastian Germann <bage@linutronix.de>
Link libvirtmod_* modules also with libvirt
The -lvirt linker flag has to be added to the libvirtmod_qemu and
libvirtmod_lxc modules as well.
2022- 9- 9 Bastian Germann <bage@linutronix.de>
Replace uint with unsigned int
Mingw-w64 target does not support uint definition.
2022- 9- 1 Jiri Denemark <jdenemar@redhat.com>
Post-release version bump to 8.8.0
2022- 8- 1 Jiri Denemark <jdenemar@redhat.com>
Post-release version bump to 8.7.0
2022- 7- 8 Michal Privoznik <mprivozn@redhat.com>
libvirt-utils: Clear error when guessing typed param type
Our APIs which accept typed parameters are usually exposed in
python as accepting dictionary, for instance:
virDomainSetIOThreadParams(..., virTypedParameterPtr params, ...) ->
virDomain.setIOThreadParams(..., {}, ...)
Now, before calling the C API, the dictionary is processed by
virPyDictToTypedParams() which accepts an additional argument:
array that hints types for each typed parameter. However, if a
key is not in the array we guess what the correct type might be.
This is done by attempting conversion from python into string, if
that fails then into boolean, then into long, only to fall back
to double. Now, for the long type we can have two cases: the
value is non-negative (ULL) or it is negative (LL). Therefore, we
firstly attempt ULL case and if that fails we stick with the
latter.
However, after we attempted the ULL conversion, python records an
error internally (which is then queried via PyErr_Occurred()),
but the error is never cleared out. This leads to spurious paths
taken afterwards: e.g. when libvirt_longlongUnwrap() is trying to
convert -1, it fails. But not rightfully - the PyErr_Occurred()
check it performs has nothing to do with any of its actions,
rather than our guessing work done before.
Therefore, clear the error after we've guessed the type.
2022- 7- 8 Michal Privoznik <mprivozn@redhat.com>
Add VIR_DOMAIN_IOTHREAD_THREAD_POOL_{MIN,MAX} macros
The python version of virDomainSetIOThreadParams
(setIOThreadParams()), expects two arguments on input: the thread
ID and a dictionary which is then translated into our typed
parameters. During this translation we use a helper array which
holds type for each typed parameter supported
(virPyDomainSetIOThreadParams[]). Otherwise we guess what the
correct type is. Now, when introducing
VIR_DOMAIN_IOTHREAD_THREAD_POOL_{MIN,MAX} typed params into
libvirt I forgot to update the array. Do that now.
2022- 7- 1 Jiri Denemark <jdenemar@redhat.com>
Post-release version bump to 8.6.0
2022- 6- 25 Pino Toscano <ptoscano@redhat.com>
setup: make 'clean' command compatible again with distutils
After the switch of 'my_clean' to a simple Command, the 'clean' command
has no more bits for options, resulting in distutils (either external
or embedded in setuptools) complaining about it:
distutils.errors.DistutilsClassError: command class <class '__main__.my_clean'> must provide 'user_options' attribute (a list of tuples)
To overcome that, provide all the standard bits from options, i.e. the
'user_options' list, and the 'initialize_options' & 'finalize_options'
methods. In addition, add a dummy 'all' option, as distutils wants it:
error: error in [...]/.pydistutils.cfg: command 'my_clean' has no such option 'all'
Fixes commit a965c91c6fa1275613edbbef75c0422574eb9ff2
2022- 6- 8 Daniel P. Berrangé <berrange@redhat.com>
setup: advertize Python 3.9 and 3.10 support
Add classifiers that indicate we intend to support python versions
3.9 and 3.10.
2022- 6- 8 Daniel P. Berrangé <berrange@redhat.com>
examples: remove use of deprecated setDaemon method
In Python 3.10 the setDaemon method was deprecated. It is redundant
since the 'daemon' parameter can be given when creating the thread,
or the 'daemon' attribute can be set after it was created.
2022- 6- 8 Daniel P. Berrangé <berrange@redhat.com>
tests: expand AIO tests and add more comments
Add a test for one more usage scenario that was possible in the past,
whereby libvirt events are registered before starting the asyncio
loop, but we let libvirt find the loop associated with the current
thread.
Skip the test relies on auto-creating an event loop with Python >= 3.10
since it now triggers a deprecation warning which will soon turn into a
RuntimeError.
2022- 6- 8 Daniel P. Berrangé <berrange@redhat.com>
tests: use mocks to allow calling virEventRegisterImpl many times
We currently have to run each of the test_aio.py test cases in a
separate process, because libvirt.virEventRegisterImpl can only be
called once per process. This leads to quite unpleasant console
output when running tests.
By introducing a mock for libvirt.virEventRegisterImpl we can
regain the ability to run everything in a single process. The only
caveat is that it relies on tests to fully cleanup, but in practice
this is ok for our current tests.
2022- 6- 8 Chris Gunn <chrisgun@microsoft.com>
tests: add libvirtaio test coverage
2022- 6- 8 Daniel P. Berrangé <berrange@redhat.com>
libvirtaio: add better docs on best practice usage pattern
2022- 6- 8 Daniel P. Berrangé <berrange@redhat.com>
libvirtio: lazy create the Event object in drain()
The drain method uses an asyncio.Event object to be notified when other
coroutines have removed all registered callbacks. The Event object needs
to be associated with the coroutine that the event loop is running with
and currently this is achieved by passing in the 'loop' parameter.
Unfortunately Python 3.10 has removed the 'loop' parameter and now the
object is associated implicitly with the current thread's event loop.
At the time the virEventAsyncIOImpl constructor is called, however,
there is no guarantee that an event loop has been set for the thread.
The explicitly passed in 'loop' parameter would handle this scenario.
For portability with Python >= 3.10 we need to delay creation of the
Event object until we have a guarantee that there is a loop associated
with the current thread. This is achieved by lazily creating the Event
object inside the 'drain' method, which is expected to be invoked from
coroutine context and thus ensure a loop is associated.
2022- 6- 8 Chris Gunn <chrisgun@microsoft.com>
libvirtaio: convert to using 'async' / 'await' syntax
The 'async' keyword is new in Python 3.5, as a way to declare that a
method is a coroutine. This replaces the '@asyncio.coroutine' decorator
that is deprecated since 3.8 and scheduled to be removed in 3.11
The 'await' keyword has to be used instead of 'yield' from any
coroutines declared with 'async'.
[DB: Split off from a larger patch mixing multiple changes]
2022- 6- 8 Chris Gunn <chrisgun@microsoft.com>
libvirtaio: drop back compat for python < 3.4.4
setup.py ensures we have python >= 3.5, so there is no need to do
back compat with the 'asyncio.ensure_future' method, which was new
in 3.4.4
[DB: Split off from a larger patch mixing multiple changes]
2022- 6- 1 Jiri Denemark <jdenemar@redhat.com>
Post-release version bump to 8.5.0
2022- 5- 13 Michal Privoznik <mprivozn@redhat.com>
Add an override impl for virDomainRestoreParams and virDomainSaveParams
2022- 5- 2 Jiri Denemark <jdenemar@redhat.com>
Post-release version bump to 8.4.0
2022- 4- 21 Daniel P. Berrangé <berrange@redhat.com>
setup: switch to running API coverage test using pytest
The API coverage test is no longer a special case.
2022- 4- 21 Daniel P. Berrangé <berrange@redhat.com>
sanitytest: skip tests when seeing broken lxml implementation
The python lxml registers some global callbacks with libxml2. As a
result when another user of libxml2 calls APIs, it can trigger the
python callbacks that lxml previously registered. Execution of the
python callbacks in this case is often unsafe and leads to SEGVs.
This hasn't been a problem since the sanitytest.py test has been
a standalone program we execute. When it gets turned into a real
python unit test, it will run in the same process as all the other
tests and trigger the crash.
A mitigation was added in lxml 4.5.2 which is good enough to let
us continuing using lxml.
2022- 4- 21 Daniel P. Berrangé <berrange@redhat.com>
sanitytest: turn into a normal python unittest
The sanitytest.py file is now using the normal python unittest
pattern, though we invoke the one test explicitly for now.
2022- 4- 21 Daniel P. Berrangé <berrange@redhat.com>
sanitytest: move function/enum identification into a helper method
This is a step towards turning the sanitytest.py file into a normal
python unittest.
Best viewed with the '-b' flag to diff.
2022- 4- 21 Daniel P. Berrangé <berrange@redhat.com>
sanitytest: move class identification into a helper method
This is a step towards turning the sanitytest.py file into a normal
python unittest.
Best viewed with the '-b' flag to diff.
2022- 4- 21 Daniel P. Berrangé <berrange@redhat.com>
sanitytest: move initial class method mapping into a helper method
This is a step towards turning the sanitytest.py file into a normal
python unittest.
Best viewed with the '-b' flag to diff.
2022- 4- 21 Daniel P. Berrangé <berrange@redhat.com>
sanitytest: move class method mapping fixup into a helper method
This is a step towards turning the sanitytest.py file into a normal
python unittest.
Best viewed with the '-b' flag to diff.
2022- 4- 21 Daniel P. Berrangé <berrange@redhat.com>
sanitytest: move C to python API mapping check into a helper method
This is a step towards turning the sanitytest.py file into a normal
python unittest.
Best viewed with the '-b' flag to diff.
2022- 4- 21 Daniel P. Berrangé <berrange@redhat.com>
sanitytest: move python to C API mapping check into a helper method
This is a step towards turning the sanitytest.py file into a normal
python unittest.
Best viewed with the '-b' flag to diff.
2022- 4- 21 Daniel P. Berrangé <berrange@redhat.com>
sanitytest: move C API binding check into a helper method
This is a step towards turning the sanitytest.py file into a normal
python unittest.
Best viewed with the '-b' flag to diff.
2022- 4- 21 Daniel P. Berrangé <berrange@redhat.com>
sanitytest: stop passing python module path into sanity test
We want to move over to make sanitytest.py operate like a more normal
test script, which means making it self contained.
The setup.py already sets the PYTHONPATH thanks to changes introduced
in:
commit eaded7bdadf3ccdc4b208ec0ed65a1b23b8b5f69
Author: Daniel P. Berrange <berrange@redhat.com>
Date: Tue Mar 18 11:11:48 2014 +0000
Add support for running unit tests with nose
so passing the python module path into sanitytest.py is redundant.
2022- 4- 21 Daniel P. Berrangé <berrange@redhat.com>
sanitytest: stop passing API XML path into sanity test
We want to move over to make sanitytest.py operate like a more normal
test script, which means making it self contained.
The test already knows how to find the libvirt API XML path using
pkg-config and if an override location is required, this can be done
by pointing $PKG_CONFIG_PATH to a suitable place.
2022- 4- 21 Daniel P. Berrangé <berrange@redhat.com>
setup: switch from distutils to setuptools
The distutils package is deprecated and targetted for deletion in Python
3.12, so we need to switch to setuptools. Thanks to all the preceeding
changes this is no more difficult than changing the import statements.
Closes https://gitlab.com/libvirt/libvirt-python/-/issues/1
2022- 4- 21 Daniel P. Berrangé <berrange@redhat.com>
setup: remove use of distutils.util.get_platform
The 'get_platform' function is used to determine the platform specific
component of the build output directory containing the loadable
modules and python code. There is no nice replacement for this
function, but we can achieve our goal by simply scaning for the desired
subdirectory, which should exist by the time 'test' runs.
2022- 4- 21 Daniel P. Berrangé <berrange@redhat.com>
setup: override 'build_ext' / 'build_py' commands rather than 'build'
We override the 'build' command to invoke the code generator before the
extensions are compiled. The 'build' command, however, is merely a
wrapper around several other commands. It is possible for the user to
directly invoke those commands, in which case our code generator won't
get a chance to run:
$ python setup.py build_ext
running build_ext
building 'libvirtmod' extension
creating build/temp.linux-x86_64-3.10
creating build/temp.linux-x86_64-3.10/build
gcc ..snip... -c build/libvirt.c -o build/temp.linux-x86_64-3.10/build/libvirt.o
cc1: fatal error: build/libvirt.c: No such file or directory
compilation terminated.
error: command '/usr/lib64/ccache/gcc' failed with exit code 1
To solve this we instead override 'build_ext' and 'build_py'. This in
turn means we call the generator to emit C code separately from Python
code.
2022- 4- 21 Daniel P. Berrangé <berrange@redhat.com>
setup: replace distutils.dir_util.remove_tree with shutils
The distutils.dir_util.remove_tree method has no compelling benefit
over using the standard python shutils module.
2022- 4- 21 Daniel P. Berrangé <berrange@redhat.com>
setup: replace distutils.spawn with subprocess
The distutils.spawn method has no compelling benefit over using the
standard python subprocess module.
2022- 4- 21 Daniel P. Berrangé <berrange@redhat.com>
setup: replace distutils.spawn.find_executable with shutils
The distutils.spawn.find_executable method has no compelling benefit
over using the standard python shutils module.
2022- 4- 21 Daniel P. Berrangé <berrange@redhat.com>
setup: introduce an explicit check for pkg-config operation
Instead of searching for the pkg-config binary manually, just try to run
it and catch the exception raised if it isn't found. Use the --version
flag as a way to validate that it is at least somewhat functional.
2022- 4- 21 Daniel P. Berrangé <berrange@redhat.com>
setup: stop inheriting from 'clean' command
The default 'clean' command impl deletes only intermediate files from
the 'build' directory. We've overridden it to delete everything. There
is no benefit in inheriting from the default impl, given our subclass
will delete everything.
2022- 4- 21 Daniel P. Berrangé <berrange@redhat.com>
setup: drop the 'rpm' command
This duplicates funtionality already provided by the 'bdist_rpm'
command.
2022- 4- 21 Daniel P. Berrangé <berrange@redhat.com>
generator: introduce ability to selectively generate code
Currently we always generate both the C code and Python code at the same
time. To cope with following changes to the build process, we want to be
able to generate C and Python separately.
2022- 4- 21 Daniel P. Berrangé <berrange@redhat.com>
generator: rename methods for code generation
The names make it clearer exactly what is being generated by each.
2022- 4- 21 Daniel P. Berrangé <berrange@redhat.com>
generator: split function skip logic out of C generator
The python generator needs to know whether certain functions were
skipped in the C generator. This is achieved by the C generator
deleting skipped functions as it runs. This is an unhelpful side
effect as it makes it impossible to run the python generator
without first running the C generator.
This refactors buildStubs to get rid of the global side effects
it has, by providing some helper functions for buildWrappers
to use.
2022- 4- 21 Daniel P. Berrangé <berrange@redhat.com>
generator: split function type validation out of C generator
As a side effect of generating the C code, the buildStubs methods
checks for various unsupported types and reports errors. This is
an undesirable side effect, if we want to skip C code generation.
Splitting function type validation out into a separate method
allows better reuse.
2022- 4- 21 Daniel P. Berrangé <berrange@redhat.com>
generator: split loading of APIs out from writing stubs
The buildStubs method has a side effect of loading and parsing the API
XML files, which the buildWrappers method then relies on.
Splitting API loading into a separate method will facilitate running
only the buildWrappers method in future.
2022- 4- 21 Daniel P. Berrangé <berrange@redhat.com>
generator: merge python wrapper generator methods
Instead of having three separate methods for generating python
wrappers, merge them all together.
2022- 4- 21 Daniel P. Berrangé <berrange@redhat.com>
generator: refactor buildWrappers to make it more generic
Prepare for using buildWrappers to generate code for the QEMU / LXC
APIs too.
2022- 4- 21 Daniel P. Berrangé <berrange@redhat.com>
generator: simplify some repeated code patterns
Now that we're using common data structures for all the main libvirt,
QEMU and LXC APIs, several of the functions have code duplication
that can be eliminated.
2022- 4- 21 Daniel P. Berrangé <berrange@redhat.com>
generator: use single function for registering all enums
Now that we only use a single dict for tracking all enums, we
only need a single function for registering them.
2022- 4- 21 Daniel P. Berrangé <berrange@redhat.com>
generator: use single dict for tracking all enums
A single invokation of the generator only handles processing of one
libvirt API module, so there is no need to use separate dicts for
tracking enums.
2022- 4- 21 Daniel P. Berrangé <berrange@redhat.com>
generator: use single function for registering all functions
Now that we only use a single dict for tracking all functions, we
only need a single function for registering them.
2022- 4- 21 Daniel P. Berrangé <berrange@redhat.com>
generator: use single dict for tracking all skipped functions
A single invokation of the generator only handles processing of one
libvirt API module, so there is no need to use separate dicts for
tracking skipped functions.
2022- 4- 21 Daniel P. Berrangé <berrange@redhat.com>
generator: use single dict for tracking all functions
A single invokation of the generator only handles processing of one
libvirt API module, so there is no need to use separate dicts for
tracking functions.
2022- 4- 1 Jiri Denemark <jdenemar@redhat.com>
Post-release version bump to 8.3.0
2022- 3- 28 Daniel P. Berrangé <berrange@redhat.com>
gitlab: switch to using 'pip' for package installation
The distutils/setuptools 'install' command is deprecated in favour of
'pip', and with recent versiosn, using it will create a bad install
that triggers a traceback on all future use of setuptools:
Traceback (most recent call last):
File "/builds/berrange/libvirt-python/setup.py", line 328, in <module>
setup(name = 'libvirt-python',
File "/usr/lib/python3.10/site-packages/setuptools/__init__.py", line 154, in setup
_install_setup_requires(attrs)
File "/usr/lib/python3.10/site-packages/setuptools/__init__.py", line 143, in _install_setup_requires
dist = MinimalDistribution(attrs)
File "/usr/lib/python3.10/site-packages/setuptools/__init__.py", line 135, in __init__
super().__init__(filtered)
File "/usr/lib/python3.10/site-packages/setuptools/dist.py", line 456, in __init__
for ep in metadata.entry_points(group='distutils.setup_keywords'):
File "/usr/lib64/python3.10/importlib/metadata/__init__.py", line 1009, in entry_points
return SelectableGroups.load(eps).select(**params)
File "/usr/lib64/python3.10/importlib/metadata/__init__.py", line 459, in load
ordered = sorted(eps, key=by_group)
File "/usr/lib64/python3.10/importlib/metadata/__init__.py", line 1006, in <genexpr>
eps = itertools.chain.from_iterable(
File "/usr/lib64/python3.10/importlib/metadata/_itertools.py", line 16, in unique_everseen
k = key(element)
File "/usr/lib64/python3.10/importlib/metadata/__init__.py", line 941, in _normalized_name
return self._name_from_stem(stem) or super()._normalized_name
File "/usr/lib64/python3.10/importlib/metadata/__init__.py", line 622, in _normalized_name
return Prepared.normalize(self.name)
File "/usr/lib64/python3.10/importlib/metadata/__init__.py", line 871, in normalize
return re.sub(r"[-_.]+", "-", name).lower().replace('-', '_')
File "/usr/lib64/python3.10/re.py", line 209, in sub
return _compile(pattern, flags).sub(repl, string, count)
This is certainly a bug in distutils/setuptools, but given the
'install' command is deprecated, instead of waiting for a fix,
just switch to the recommend 'pip install .' command.
2022- 3- 28 Daniel P. Berrangé <berrange@redhat.com>
ci: refresh from lcitool manifest
This drops the CentOS 8 job and replaces Fedora 33 with 35.
2022- 3- 10 Michal Privoznik <mprivozn@redhat.com>
Implement virDomainQemuMonitorCommandWithFiles() override
With libvirt-8.2.0 there's a new API:
virDomainQemuMonitorCommandWithFiles(). Since the API has both
input and output arguments we need to provide an alternative
implementation. Moreover, since FD passing works only on
UNIX-like systems we can query the returned FDs for their flags
and construct mode for python File object.
2022- 3- 1 Jiri Denemark <jdenemar@redhat.com>
Post-release version bump to 8.2.0
2022- 2- 11 Daniel P. Berrangé <berrange@redhat.com>
add missing files to MANIFEST.in
2022- 1- 14 Jiri Denemark <jdenemar@redhat.com>
Post-release version bump to 8.1.0
2022- 1- 5 Daniel P. Berrangé <berrange@redhat.com>
Add an override impl for virDomainSetLaunchSecurityState
2021- 12- 1 Jiri Denemark <jdenemar@redhat.com>
Post-release version bump to 8.0.0
2021- 12- 1 Daniel P. Berrangé <berrange@redhat.com>
Switch to new GitHub repo-lockdown configuration
The repo-lockdown service used to run as a bot outside GitHub, but has
now switched to using the GitHub Actions workflow framework. This
requires use of a new configuration file.
2021- 11- 1 Jiri Denemark <jdenemar@redhat.com>
Post-release version bump to 7.10.0
2021- 10- 8 Daniel P. Berrangé <berrange@redhat.com>
Add support for domain event for memory device size change
2021- 10- 1 Jiri Denemark <jdenemar@redhat.com>
Post-release version bump to 7.9.0
2021- 9- 24 Michal Privoznik <mprivozn@redhat.com>
sanitytest: Add virNetworkCreateXMLFlags() to list of name fixups
When checking whether each C API is exported to Python and vice
versa the sanitytest script is doing some name fixing. For
instance virNetworkCreateXML() is translated into
virConnect.networkCreateXML(). However, we have new C API on the
way: virNetworkCreateXMLFlags() which is not on the list for
these name fixups. Add it there.
Mind you, the python code generator works just fine because
generator.py:1082 compares just the prefix.
2021- 9- 21 Jonathon Jongsma <jjongsma@redhat.com>
Don't mention email patch submission in README
Since patches are now submitted via gitlab merge requests, don't mention
mailing list patch submission in the README. Point to the CONTRIBUTING
file instead.
2021- 9- 21 Jonathon Jongsma <jjongsma@redhat.com>
Update readme to mention pytest instead of nose
Commit a376a2ab switch from python-nose to python-pytest for tests, but
the README was not updated.
2021- 9- 21 Jonathon Jongsma <jjongsma@redhat.com>
Add new autostart API for node devices
Provide a manual override for the virNodeDeviceGetAutostart() API
modeled on what's done for the network and storage APIs.
2021- 9- 2 Daniel P. Berrangé <berrange@redhat.com>
ci: remove obsolete refresh script and documentation
We now use lcitool's manifest feature to generate files.
2021- 9- 2 Daniel P. Berrangé <berrange@redhat.com>
ci: re-generate containers/gitlab config from manifest
This uses the command "lcitool manifest ci/manifest.yml" to re-generate
all existing dockerfiles and gitlab CI config.
2021- 9- 2 Daniel P. Berrangé <berrange@redhat.com>
ci: define a CI manifest file
This is to be used with the command "lcitool manifest ci/manifest.yml"
to re-generate all existing dockerfiles and gitlab CI config.
2021- 9- 1 Daniel P. Berrangé <berrange@redhat.com>
rpm: drop support for RHEL-7
We no longer support libvirt on this distro
2021- 9- 1 Jiri Denemark <jdenemar@redhat.com>
Post-release version bump to 7.8.0
2021- 8- 2 Jiri Denemark <jdenemar@redhat.com>
Post-release version bump to 7.7.0
2021- 7- 27 Daniel P. Berrangé <berrange@redhat.com>
gitlab: use custom docker:dind image
The current docker:dind container has broken default seccomp filter that
results in clone3 being blocked, which in turn breaks Fedora 35 rawhide.
This custom image has a workaround that causes the seccomp filter to
return ENOSYS for clone3 instad of EPERM, thus triggering glibc to
fallback to clone correctly.
2021- 7- 1 Jiri Denemark <jdenemar@redhat.com>
Post-release version bump to 7.6.0
2021- 6- 25 Peter Krempa <pkrempa@redhat.com>
Fix BlockThreshold Callback argument conversion once more
The conversion was changed from "OssiiO" to "OssLLO". Unfortunately the
arguments are unsigned long long, where the proper coversion character
is 'K'.
Fixes: https://gitlab.com/libvirt/libvirt-python/-/merge_requests/40
Fixes: fd069ac85c8cf1593587dc9287a3d5eb6bd4bdb9
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1976109
2021- 6- 1 Jiri Denemark <jdenemar@redhat.com>
Post-release version bump to 7.5.0
2021- 5- 27 w00506750 <hogan.wang@huawei.com>
iothread: fix memory access out of bounds
When the 'pcpu' is larger then the last 'iothr->cpumap' bits,
set the list element to False to avoid out of bounds access
'iothr->cpumap'.
Reviewed-by: Hogan Wang <hogan.wang@huawei.com>
2021- 5- 27 Jiri Denemark <jdenemar@redhat.com>
Post-release version bump to 7.4.0
2021- 5- 25 Daniel P. Berrangé <berrange@redhat.com>
containers: refresh containers with latest libvirt-ci
2021- 5- 25 Daniel P. Berrangé <berrange@redhat.com>
gitlab: don't set RPM variable on container job
2021- 5- 25 Daniel P. Berrangé <berrange@redhat.com>
gitlab: add OpenSUSE Tumbleweed container and build
2021- 5- 25 Daniel P. Berrangé <berrange@redhat.com>
gitlab: introduce Fedora 34 container and build
2021- 5- 25 Daniel P. Berrangé <berrange@redhat.com>
gitlab: rename opensuse-152 to opensuse-leap-152
2021- 5- 25 Daniel P. Berrangé <berrange@redhat.com>
gitlab: rename centos-stream to centos-stream-8
2021- 5- 25 Daniel P. Berrangé <berrange@redhat.com>
gitlab: drop Fedora 32 container and build
2021- 5- 25 Daniel P. Berrangé <berrange@redhat.com>
gitlab: drop centos-7 container and build
2021- 4- 15 Michal Privoznik <mprivozn@redhat.com>
generator.py: Untangle virNodeDevice name fixup
The way that virNodeDevice method name fixup is written makes it
hard to find via grep (matching the virNodeDevice prefix and then
matching only the operation like "Get", "Lookup", ...). Expand
the string matching to match the pattern of other cases.
2021- 4- 15 Michal Privoznik <mprivozn@redhat.com>
generator.py: Fix method names for new virNodeDevice*() APIs
In the 7.3.0 release we are going to have three new public APIs:
virNodeDeviceDefineXML()
virNodeDeviceUndefine()
virNodeDeviceCreate()
The first one is slightly problematic, because it takes
virConnectPtr argument and thus our generator wants to put its
wrapper under virConnect python class, which is correct, but
what's incorrect is the name it chooses for the method:
defineXML(). Such method already exists and wraps
virDomainDefineXML() around. Also, the name is rather confusing
anyway - it's missing the 'nodeDevice' prefix.
Fortunately, the fix is easy - add another case into nameFixup().
The story with virNodeDeviceCreate() is similar. Except, this time
the class in which the method was put is correct. But the name is
still wrong, because our generator matched 'virNodeDeviceCreate'
thinking it's the good old virNodeDeviceCreateXML() API and
"fixed" the name of the method to nodeDeviceCreate().
Luckily, virNodeDeviceUndefine() is just fine.
2021- 4- 12 Ján Tomko <jtomko@redhat.com>
spec: use pytest instead of nose
2021- 4- 12 Daniel P. Berrangé <berrange@redhat.com>
rpm: use HTTPS for URLs
2021- 4- 9 Daniel P. Berrangé <berrange@redhat.com>
Don't run sanity checks by default
The sanity check scripts verify that the binding covers all APIs in the
libvirt library/headers being built against. This is primarily there for
libvirt maintainers to identify when there are gaps in API coverage.
This is not something downstream consumers of libvirt-python should be
running themselves, so we shouldn't added it to tests by default.
In addition if people are working on branches or submitting merge
requests for python changes, we shouldn't block their work for failed
API coverage sanity tests, if the python binding otherwise builds fine
and passes regular unit tests.
Thus, we introduce a new gitlab job "api-coverage" with some conditions:
- If pushing to a branch, the job is treated as non-fatal
- For regular scheduled builds, it is mandatory
- Don't run in any other scenarios
This job uses the artifacts from the centos-8-git-build job and re-runs
the test suite, requesting the sanity tests to be run too.
This will achieve the result of letting us see missing API coverage
in nightly builds, without blocking other contributions.
2021- 4- 7 Ján Tomko <jtomko@redhat.com>
tests: use assertEqual instead of assertEquals
tests/test_conn.py:17: DeprecationWarning: Please use assertEqual instead.
2021- 4- 7 Ján Tomko <jtomko@redhat.com>
ci: refresh containers for nose->pytest switch
Matches libvirt-ci commit facd5d855c97bf5b127ff9bf245c8fdf514dd916
2021- 4- 7 Ján Tomko <jtomko@redhat.com>
setup: use pytest instead of nose to run the test suite
The software we use for running tests - nose - has been
deprecated in favor of nose2.
We don't use anything nose-specific, just unittest.TestCase,
which pytest can handle just fine.
Switch to using pytest, which we already use for libvirt-dbus.
2021- 4- 7 Ján Tomko <jtomko@redhat.com>
setup: drop have_libvirtaio
This function says we have libvirtaio on Python >= 3.3,
however we already mandate Python >= 3.5 at the start of the file.
2021- 4- 7 Andrea Bolognani <abologna@redhat.com>
ci: Move dco job to sanity_checks stage
If the DCO check fails we still want the pipeline to fail, but
that doesn't mean there's no value in running the other jobs to
get a better picture.
2021- 4- 7 Andrea Bolognani <abologna@redhat.com>
ci: Use 'extends' GitLab CI feature
This is the recommended way to use templates in job
definitions.
2021- 4- 6 Ján Tomko <jtomko@redhat.com>
ci: drop openSUSE leap 15.1 in favor of 15.2
2021- 4- 6 Ján Tomko <jtomko@redhat.com>
ci: refresh dockerfiles
Refresh to match libvirt-ci commit 94c25bde639eb31ff2071fb6abfd3d5c777f4ab2
2021- 4- 1 Jiri Denemark <jdenemar@redhat.com>
Post-release version bump to 7.3.0
2021- 3- 1 Jiri Denemark <jdenemar@redhat.com>
Post-release version bump to 7.2.0
2021- 3- 1 renlei4 <ren.lei4@zte.com.cn>
Fix wrong type for BlockThreshold Callback
type of threshold and excess are unsigned long long,
but PyObject_CallMethod incorrectly set it to int.
if threshold or excess greater than 0x7FFFFFFF(max int),
those variables will overflow.
2021- 2- 15 Daniel P. Berrangé <berrange@redhat.com>
Add impl override for virDomainGetMessages
2021- 2- 9 Beraldo Leal <bleal@redhat.com>
improving readme with requirements
When installing this library in a fresh system, some basic packages are
necessary to compile and run. This patch will add basic instructions
with some requirements to help new contributors and users.
2021- 1- 15 Jiri Denemark <jdenemar@redhat.com>
Post-release version bump to 7.1.0
2020- 12- 15 Daniel P. Berrangé <berrange@redhat.com>
ci: refresh containers for CentOS-8 PowerTools repo rename
A recent CentOS-8 update renamed the "PowerTools" repo to "powertools"
and since dnf is case sensitive wrt repo names, this broke ability to
build new containers.
The refresh fixes the repo name and pulls in other misc improvements
to containers.
2020- 12- 3 Daniel P. Berrangé <berrange@redhat.com>
Avoid signed/unsigned warnings in loop over SSH keys
libvirt-override.c: In function ‘libvirt_virDomainAuthorizedSSHKeysGet’:
libvirt-override.c:10455:19: warning: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare]
10455 | for (i = 0; i < nkeys; i++)
| ^
2020- 12- 1 Daniel P. Berrangé <berrange@redhat.com>
gitlab: replace "libvirt-" prefix with "ci-" in dockerfiles
This makes the dockerfile name match the output container name
2020- 12- 1 Daniel P. Berrangé <berrange@redhat.com>
gitlab: refresh containers with lcitool for fully minimized base
2020- 12- 1 Daniel P. Berrangé <berrange@redhat.com>
gitlab: re-generate container images from lcitool
This introduces Fedora 33 and removes some redundant packages.
2020- 12- 1 Daniel P. Berrangé <berrange@redhat.com>
gitlab: move dockerfiles into ci/containers sub-directory
This brings the repo into alignment with the main libvirt.git practice.
2020- 12- 1 Jiri Denemark <jdenemar@redhat.com>
Post-release version bump to 7.0.0
2020- 11- 27 Erik Skultety <eskultet@redhat.com>
MANIFEST.in: Distribute MANIFEST.in in the source tarball
Follow the same procedure as we do with specfiles in the main library
where we distribute libvirt.spec.in along with the generated
libvirt.spec inside the tarball.
Fixes: https://gitlab.com/libvirt/libvirt-python/-/issues/5
2020- 11- 19 Michal Privoznik <mprivozn@redhat.com>
Implement virDomainAuthorizedSSHKeys{Get,Set}
Both APIs work with string lists (the getter returns it, the
setter gets keys to set from it) -> represent that as a python
list. The rest is kept as is in C.
2020- 11- 12 Daniel P. Berrangé <berrange@redhat.com>
Add support for memory failure event callbacks
2020- 11- 12 Daniel P. Berrangé <berrange@redhat.com>
Replace deprecated PyEval_CallObject with PyObject_Call
The former is deprecated since Python 3.9, and the latter has existed
for all 3.x and probably before.
2020- 11- 12 Daniel P. Berrangé <berrange@redhat.com>
Pass -Werror when building extension
This ensures we pick up warnings from new python headers or other
problems.
2020- 11- 12 Daniel P. Berrangé <berrange@redhat.com>
Avoid truncating python version number when running sanity test
The current code assumes the version number string will be only three
characters long, which fails with "3.10".
2020- 11- 12 Daniel P. Berrangé <berrange@redhat.com>
Avoid use of thread function deprecated in 3.9
PyEval_ThreadsInitialized was deprecated in 3.9, with deletion targetted
for 3.11. Furthermore since 3.7 it is guaranteed that threads are always
initialized by Py_Initialize(), so checking it is redundant.
2020- 11- 6 Daniel P. Berrangé <berrange@redhat.com>
Add unit tests for openAuth method
Validate that the type hinting is working as expected
2020- 11- 2 Jiri Denemark <jdenemar@redhat.com>
Post-release version bump to 6.10.0
2020- 10- 6 Daniel P. Berrangé <berrange@redhat.com>
gitlab: optimize CI job dependencies
Allow more parallelization by giving explicit dependencies between jobs.
2020- 10- 6 Daniel P. Berrangé <berrange@redhat.com>
tests: start basic unit tests for more APIs
To prevent regressions, especially with generated code, we need to have
test coverage of more APIs. This starts off with coverage for object
creation for all object types supported by the test driver
currently. This exercises constructors which have been broken several
times in the past.
Related https://gitlab.com/libvirt/libvirt-python/-/issues/4
2020- 10- 6 Daniel P. Berrangé <berrange@redhat.com>
fix constructor param name for virDomainSnapshot / virDomainCheckpoint
Fixes 7f021c21d6a091ca33615852d6061e75b2500f3f
Resolves https://gitlab.com/libvirt/libvirt-python/-/issues/4
2020- 10- 1 Jiri Denemark <jdenemar@redhat.com>
Post-release version bump to 6.9.0
2020- 9- 1 Philipp Hahn <hahn@univention.de>
generator: Work around type change
a variable should not change its type.
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2020- 9- 1 Philipp Hahn <hahn@univention.de>
generator: Add PEP 484 type annotations
2020- 9- 1 Philipp Hahn <hahn@univention.de>
generator: Merge common code of print_function_wrapper
2020- 9- 1 Philipp Hahn <hahn@univention.de>
generator: Merge code for __init__ genration
2020- 9- 1 Philipp Hahn <hahn@univention.de>
generator: Expand tuple to names in for loop
Assign tuple to multiple loop variables for better readability
2020- 9- 1 Philipp Hahn <hahn@univention.de>
generator: break lines in generated code
to be closes to pep8 which makes reading the generated code easier and
reduces the number of issues found by flake8.
2020- 9- 1 Philipp Hahn <hahn@univention.de>
generator: Use empty string instead of None
for better type checking: both are bool()==False, but None is not str.
2020- 9- 1 Philipp Hahn <hahn@univention.de>
generator: Convert to defaultdict()
for nested dictionaries allows to remove the case distinction for
"first" from "all other" cases.
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2020- 9- 1 Philipp Hahn <hahn@univention.de>
generator: Move funcs_failed into buildStubs()
The variables are local to that funcion
2020- 9- 1 Philipp Hahn <hahn@univention.de>
generator: Convert list() to set()
tuple() and list() are sequences, while dict() and set() are hash-based,
which is more efficient for contains().
2020- 9- 1 Philipp Hahn <hahn@univention.de>
generator: Convert dict() to set()
Python has a native type for set()s.
2020- 9- 1 Philipp Hahn <hahn@univention.de>
generator: Simplify boolean condition
no need to compare with None or empty string.
2020- 9- 1 Philipp Hahn <hahn@univention.de>
generator: Simplify loop break
2020- 9- 1 Philipp Hahn <hahn@univention.de>
generator: Simplify sorting
Use sorted(..., key=...) instead of using explicit list.sort()
2020- 9- 1 Philipp Hahn <hahn@univention.de>
generator: Fixed writing cached=None
2020- 9- 1 Philipp Hahn <hahn@univention.de>
generator: Store arguments and return as tuple
instead of list.
2020- 9- 1 Philipp Hahn <hahn@univention.de>
generator: Expand tuple to names in for loop
Assign tuple to multiple loop variables for better readability
2020- 9- 1 Philipp Hahn <hahn@univention.de>
generator: Initialize with empty strings
instead of using None as this has a different type.
2020- 9- 1 Philipp Hahn <hahn@univention.de>
generator: Simplify XML attribute fetching
Use attr.get(key, default) instead.
Also use the empty sting "" as the default value instead of "None": Both
are "False" when used as a bool()ean, but "None" would require an
explicit check for "not None" in many places as str() and None have
different types.
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2020- 9- 1 Philipp Hahn <hahn@univention.de>
generator: Convert in_function to bool
2020- 9- 1 Philipp Hahn <hahn@univention.de>
generator: Use string formatting
instead of sting concatenating.
2020- 9- 1 Philipp Hahn <hahn@univention.de>
generator: Use SAX method names
directly instead of using legacy method names from xmllib.
Depends: 3740a5e4c701281ac76a55e3f02b1d4221f1f9f0
2020- 9- 1 Philipp Hahn <hahn@univention.de>
generator: Remove unused SAX content handler methods
getmethodname()
close()
cdata()
2020- 9- 1 Philipp Hahn <hahn@univention.de>
generator: Refactor parser creation
to use closing context manager.
2020- 9- 1 Philipp Hahn <hahn@univention.de>
generator: Open file with context manager
2020- 9- 1 Philipp Hahn <hahn@univention.de>
generator: Use splitlines()
instead of hand-coded implementation.
2020- 9- 1 Philipp Hahn <hahn@univention.de>
generator: Just walk the dict
instead of generating a list first.
2020- 9- 1 Philipp Hahn <hahn@univention.de>
generator: Directly get dict length
instead of generating a list and then counting the elements.
2020- 9- 1 Philipp Hahn <hahn@univention.de>
generator: Walk only the values
instead of the keys and then doing a lookup.
2020- 9- 1 Philipp Hahn <hahn@univention.de>
generator: Use dict.item() to walk keys and values
which saves a lookup of each key.
2020- 9- 1 Philipp Hahn <hahn@univention.de>
generator: Check contained in hash
directly instead of explicitly requesting only the keys as a list and
converting that list to another list.
Checking directly for an element to be contained in a hash is much more
efficient as this is done using hashing O(1) instead of walking the list
in half on average O(n).
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2020- 9- 1 Philipp Hahn <hahn@univention.de>
generator: Initialize function_classes directly
2020- 9- 1 Philipp Hahn <hahn@univention.de>
generator: Remove global declarations
for variables with are not assigned.
2020- 9- 1 Philipp Hahn <hahn@univention.de>
generator: Use string concatenation
:%s,\(\w\+\)\s*=\s*\1\s*+,\1 +=,
2020- 9- 1 Philipp Hahn <hahn@univention.de>
generator: Use increment assignment
:%s,\(\w\+\)\s*=\s*\1\s*+,\1 +=,
2020- 9- 1 Philipp Hahn <hahn@univention.de>
generator: Use enumerate()
instead of manual iteration counting.
2020- 9- 1 Philipp Hahn <hahn@univention.de>
generator: Simplify string concatentaion
by using ''.join() instead of concatenating string fragments in a loop,
which is slower as it required re-hashing the string multiple times.
2020- 9- 1 Philipp Hahn <hahn@univention.de>
generator: Use more string formatting
2020- 9- 1 Philipp Hahn <hahn@univention.de>
generator: Merge now identical if-elif-else cases
Commit ca394b9f "generator: Fix parent type" fixed the case for creating
`virStorage*` instances, which require a reference to `virConnect`, so
the special handling for `._conn` is no longer needed.
Commit ee5c856a "Remove legacy libvirtError arguments" removed the
different arguments, so all cases are the same now.
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2020- 9- 1 Philipp Hahn <hahn@univention.de>
generator: Fix return type on failure
to return a negative value instead of None for consistency.
2020- 9- 1 Philipp Hahn <hahn@univention.de>
generator: Remove useless sort key
tuples are sorted by first component anyway.
2020- 9- 1 Philipp Hahn <hahn@univention.de>
generator: Remove skipped_modules
Unused.
2020- 9- 1 Philipp Hahn <hahn@univention.de>
generator: Remove dead variable assignments
2020- 9- 1 Philipp Hahn <hahn@univention.de>
generator: Use raw-string for regular expression
"\(" is not a valid escape sequence for a Python string, but currently
is passed on unmodified. This might breaks in the future when new escape
sequences are introduced.
> generator.py:1001:7: W605 invalid escape sequence '\('
> generator.py:1001:18: W605 invalid escape sequence '\)'
Use raw python string instead.
2020- 9- 1 Philipp Hahn <hahn@univention.de>
generator: Convert to 'not in' and 'is not'
as recommended by pep8
2020- 9- 1 Philipp Hahn <hahn@univention.de>
generator: Change type of quiet to bool
Use `bool` instead of `int`.
2020- 9- 1 Philipp Hahn <hahn@univention.de>
generator: Simplify exception handling
sys.exc_info() returns a 3-tuple (type, value, traceback), where `value`
is the instance captured by `except type as value`.
2020- 9- 1 Philipp Hahn <hahn@univention.de>
generator: Cleanup imports
Move imports to top
Remove unused import string
Remove duplicate import os
2020- 9- 1 Philipp Hahn <hahn@univention.de>
generator: Do not use bare except
as it also catches SystemExit, InterruptedError, SyntaxError and such.
2020- 9- 1 Jiri Denemark <jdenemar@redhat.com>
Post-release version bump to 6.8.0
2020- 8- 28 Philipp Hahn <hahn@univention.de>
Revert "libvirtaio: Drop object(*args, **kwargs)"
This reverts commit f4be03b330125ab1e5a2bb10b4f12674aeff4691.
While object.__init__() does not expect any additional arguments, this
construct is required for Pythons multiple inheritance implementation.
The original author Wojtek Porczyk <woju@invisiblethingslab.com>
explained is this way:
> I'm sorry I didn't notice this earlier, but the commit f4be03b3 dated
> 2020-04-20 [0] is wrong. The super().__init__(*args, **kwargs) in
> Callback.__init__ was there on purpose, because of how Python's inheritance in
> new-style classes works.
>
> Let me explain this a bit, because it is not obvious.
>
> Suppose you had diamond inheritance like this:
>
> class A(object): pass
> class B(A): pass
> class C(A): pass
> class D(B,C): pass
>
> And those classes needed a common function with varying arguments:
>
> class A(object):
> def spam(self, a): print(f'A: {a}')
> class B(A):
> def spam(self, b): print(f'B: {b}')
> class C(A):
> def spam(self, c): print(f'C: {c}')
> class D(B,C):
> def spam(self, d): print(f'D: {d}')
>
> The way to call all parent's functions exactly once (as per MRO) and accept
> all arguments and also forbid unknown arguments is to accept **kwargs
> everywhere and pass them to super().spam():
>
> class A:
> def spam(self, a):
> print(f'A: {a}')
> class B(A):
> def spam(self, b, **kwargs):
> print(f'B: {b}')
> super().spam(**kwargs)
> class C(A):
> def spam(self, c, **kwargs):
> print(f'C: {c}')
> super().spam(**kwargs)
> class D(B, C):
> def spam(self, d, **kwargs):
> print(f'D: {d}')
> super().spam(**kwargs)
>
> Let's run this:
>
> >>> B().spam(a=1, b=2)
> B: 2
> A: 1
> >>> D().spam(a=1, b=2, c=3, d=4)
> D: 4
> B: 2
> C: 3
> A: 1
>
> You may notice that super() in B.spam refers to two different classes, either
> A or C, depending on inheritance order in yet undefined classes (as of B's
> definition).
>
> That's why the conclusion that super() in Callback.__init__ refers to object
> is wrong. In this example, spam=__init__, A=object, B=Callback and C and D are
> not yet written, but theoretically possible classes that could be written by
> someone else. Why would they be needed, I don't know, but if someone writes
> them, s/he would be out of options to invent new arguments to C.__init__.
>
> Note that super().__init__(*args, **kwargs) when super() refers to object
> isn't harmful, and just ensures that args and kwargs are empty (i.e. no
> unknown arguments were passed). In fact, this is exactly why object.__init__()
> takes no arguments since Python 2.6 [1][2], as you correctly point out in the
> commit message.
>
> I don't think this breaks anything (I very much doubt anyone would need to
> write code that would trigger this), nevertheless, as the commit is both
> pointless and wrong, and as the original author of libvirtaio I'd like to ask
> for this commit to be reverted. If this breaks some static analysis tool,
> could you just suppress it for this particular line?
>
>
> [0] https://gitlab.com/libvirt/libvirt-python/-/commit/f4be03b330125ab1e5a2bb10b4f12674aeff4691
> [1] https://bugs.python.org/issue1683368
> [2] https://docs.python.org/3/whatsnew/2.6.html#porting-to-python-2-6
> (fourth point)
>
2020- 8- 18 Philipp Hahn <hahn@univention.de>
connect: Just clear all event handlers
2020- 8- 18 Philipp Hahn <hahn@univention.de>
domain: Fix None comparison
None should be compared with "is None" instead of "== None", as the
later would invoke a "__cmp__()" method.
2020- 8- 18 Philipp Hahn <hahn@univention.de>
stream: Return None from callback
nobody evaluates the return value.
2020- 8- 18 Philipp Hahn <hahn@univention.de>
stream: Convert type() to isinstance()
2020- 8- 18 Philipp Hahn <hahn@univention.de>
stream: no type change
static typing forbids re-declaring a variable with different types.
Rename the variable.
2020- 8- 18 Philipp Hahn <hahn@univention.de>
stream: Simplify boolean condition
2020- 8- 18 Philipp Hahn <hahn@univention.de>
stream: Fix exception traceback handling
sys.exc_info() returns a 3-tuple (type, value, traceback). Raising just
`value` again looses the traceback information as this creates a new
exception.
Just use `raise` which re-raises the previous exception including the
original traceback.
FYI: There is a subtile difference between Python 2 and Python 3:
> try:
> raise ValueError()
> except ValueError:
> try:
> raise TypeError()
> except TypeError:
> pass
> raise
With Python 3 the exception environment is dropped after the exception
has been handled - as such Python 3 re-raises the outer ValueError.
With Python 2 the last (inner) exception is raised: TypeError
2020- 8- 18 Philipp Hahn <hahn@univention.de>
stream: Do not use bare except
as it also catches SystemExit, InterruptedError, SyntaxError and such.
2020- 8- 18 Philipp Hahn <hahn@univention.de>
override: Convert to list comprehension
:%s/retlist = list()\n\s*\(for \w\+ in ret\):\n\s*retlist.append(\(.*\))\n\n\s*return retlist/return [\2 \1]/
2020- 8- 18 Philipp Hahn <hahn@univention.de>
override: Catch type error
handler() should either return bytes or -2 or -3.
Explicitly raise ValueError or TypeError to silence mypy.
2020- 8- 18 Philipp Hahn <hahn@univention.de>
override: no type change
static typing forbids re-declaring a variable with different types.
Rename the variable.
2020- 8- 18 Philipp Hahn <hahn@univention.de>
override: Add manual PEP 484 type annotations
2020- 8- 18 Philipp Hahn <hahn@univention.de>
override: Simplify exception handling
sys.exc_info() returns a 3-tuple (type, value, traceback), where `value`
is the instance captured by `except type as value`.
2020- 8- 17 Vincent Vanlaer <vincent.vanlaer@skynet.be>
Include libvirt-qemu-override.py in sdist
libvirt-qemu-override.py was introduced in e3da8f17 but never added to
MANIFEST.in. It was therefore not contained in the official releases on
libvirt.org.
2020- 8- 7 Philipp Hahn <hahn@univention.de>
libvirtaio: Add manual PEP 484 type annotations
2020- 8- 6 Philipp Hahn <hahn@univention.de>
libvirtaio: assert callback type
self.callbacks contains a mix of FDCallback and TimeoutCallback, while
the update code does not explicitly check for.
2020- 8- 6 Philipp Hahn <hahn@univention.de>
libvirtaio: Fix return type
libvirtaio.py:364: error: "virEventInvokeFreeCallback" does not return a value
2020- 8- 6 Philipp Hahn <hahn@univention.de>
libvirtaio: Drop object(*args, **kwargs)
object.__init__() does not expect those parameters.
2020- 8- 6 Philipp Hahn <hahn@univention.de>
libvirtaio: Cleanup imports
Move imports to top
2020- 8- 6 Philipp Hahn <hahn@univention.de>
sanitytest: no type change
static typing forbids re-declaring a variable with different types.
Rename the variable.
2020- 8- 6 Philipp Hahn <hahn@univention.de>
sanitytest: Use str.startswith() instead of str[0]
2020- 8- 6 Philipp Hahn <hahn@univention.de>
sanitytest: Use set for tracking used functions
2020- 8- 6 Philipp Hahn <hahn@univention.de>
sanitytest: Use 3-tuple for finalklassmap
2020- 8- 6 Philipp Hahn <hahn@univention.de>
sanitytest: Use 3-tuple for basicklassmap
2020- 8- 6 Philipp Hahn <hahn@univention.de>
sanitytest: Add PEP 484 type annotations
2020- 8- 6 Philipp Hahn <hahn@univention.de>
sanitytest: Drop Python 2 compatibility
Python 3 only has int, remove the Python 2 long type
2020- 8- 6 Philipp Hahn <hahn@univention.de>
sanitytest: Drop else:pass
useless
2020- 8- 6 Philipp Hahn <hahn@univention.de>
sanitytest: Do not re-declare set
is a built-in python type
2020- 8- 6 Philipp Hahn <hahn@univention.de>
sanitytest: Convert type() to isinstance()
2020- 8- 6 Philipp Hahn <hahn@univention.de>
sanitytest: Skip type annotations
Teach sanitytest to ignore typing imports
2020- 8- 6 Philipp Hahn <hahn@univention.de>
sanitytest: Remove unused import
2020- 8- 6 Philipp Hahn <hahn@univention.de>
Remove legacy libvirtError arguments
The fields have been deprecated in C with
git:f60dc0bc09f09c6817d6706a9edb1579a3e2b2b8
They are only passed to the libvirtError constructor, but not stored for
later or used anywhere else.
sed -ri '/raise libvirtError/s/, \w+=self(\._dom)?//' *.py
2020- 8- 6 Philipp Hahn <hahn@univention.de>
Normalize white space
indent by 4 spaces
one spaces around assignments
2020- 8- 6 Philipp Hahn <hahn@univention.de>
examples/event-test: Fix remove return type
The remove function are supposed to return 0 on success and -1 on failure.
<https://libvirt.org/html/libvirt-libvirt-event.html#virEventRemoveTimeoutFunc>
2020- 8- 5 Philipp Hahn <hahn@univention.de>
examples: Fix white space
indent by 4 spaces
one spaces around assignments
2020- 8- 5 Philipp Hahn <hahn@univention.de>
examples: Replace sys.exit() with exit()
No need to import sys.
2020- 8- 5 Philipp Hahn <hahn@univention.de>
examples: Cleanup imports
Break import into multiple lines as recommended by PEP-8
Move imports to top
Remove unused imports
2020- 8- 5 Philipp Hahn <hahn@univention.de>
examples: Do not use bare except
as it also catches SystemExit, InterruptedError, SyntaxError and such.
2020- 8- 5 Philipp Hahn <hahn@univention.de>
examples: Convert to ArgumentParser
Replace getopt() and hand-rolled-parser with argparse.ArgumentParser.
Fix wrong header comments copy-pasted from domstart.py
2020- 8- 5 Philipp Hahn <hahn@univention.de>
examples: Add/fix PEP 484 type annotation
2020- 8- 5 Philipp Hahn <hahn@univention.de>
examples: Add missing return values
examples/dhcpleases.py:45: error: Missing return statement
2020- 8- 5 Philipp Hahn <hahn@univention.de>
examples/nodestat: Fix None comparison
"is" compares for "points to the same object", which for strings is the
same as comparing the byte sequence itself as Python hashes each strings
to only stores a unique copy of each string.
> examples/nodestats.py:86:43: F632 use ==/!= to compare constant literals (str, bytes, int, float, tuple)
> examples/nodestats.py:91:12: F632 use ==/!= to compare constant literals (str, bytes, int, float, tuple)
> examples/nodestats.py:94:40: F632 use ==/!= to compare constant literals (str, bytes, int, float, tuple)
Use "==" and "!=" for string comparsion.
2020- 8- 5 Philipp Hahn <hahn@univention.de>
examples/consolecallback: Fix assorted errors
Assert stream is opened before receiving bytes.
Need to check for bytes() instead of [unicode]str().
2020- 8- 5 Philipp Hahn <hahn@univention.de>
examples/consolecallback: Add var to save callback
> examples/consolecallback.py:98: error: "Console" has no attribute "stdin_watch"
2020- 8- 5 Philipp Hahn <hahn@univention.de>
examples/esxlist: Fix Python 2 raw_input()
which was renamed to input() for Python 3.
2020- 8- 5 Philipp Hahn <hahn@univention.de>
examples/event-test: Use atexit for Python 3
Assigning sys.exitfunc no longer works with Python 3.
Use atexit.register() instead.
2020- 8- 5 Philipp Hahn <hahn@univention.de>
examples/event-test: Remove unneeded global statement
It only needed when a value is assigned.
2020- 8- 5 Philipp Hahn <hahn@univention.de>
examples/dhcp*: Fix None comparison
None should be compared with "is None" instead of "== None", as the
later would invoke a "__cmp__()" method.
2020- 8- 5 Philipp Hahn <hahn@univention.de>
examples/*: Remove stray semicolon
This is Python, not C
2020- 8- 4 Daniel P. Berrangé <berrange@redhat.com>
ci: refresh dockerfiles for changed libvirt build system
Libvirt changed from autotools to meson. All the containers need
refreshing and the CI recipes updated.
2020- 8- 2 Jiri Denemark <jdenemar@redhat.com>
Post-release version bump to 6.7.0
2020- 7- 27 Philipp Hahn <hahn@univention.de>
generator: Fix parent type
The constructors for virDomain, virStoragePool, virDomainCheckpoint,
virDomainSnapshot expect virConnect as their first argument. The current
code always uses `self`, which is okay when such an instance is created
from a method of virConnect itself, but there are several cases where
this is not the case:
virDomain.migrate() -> virDomain
virDomain.migrate2() -> virDomain
virDomain.migrate3() -> virDomain
virDomainCheckpoint.getParent() -> virDomainCheckpoint
virDomainSnapshot.getParent() -> virDomainSnapshot
virStorageVol.storagePoolLookupByVolume() -> virStoragePool
> libvirt.py:1850: error: Argument 1 to "virDomain" has incompatible type "virDomain"; expected "virConnect"
> libvirt.py:1871: error: Argument 1 to "virDomain" has incompatible type "virDomain"; expected "virConnect"
> libvirt.py:1888: error: Argument 1 to "virDomain" has incompatible type "virDomain"; expected "virConnect"
> libvirt.py:3422: error: Argument 1 to "virStorageVol" has incompatible type "virStoragePool"; expected "virConnect"
> libvirt.py:6835: error: Argument 1 to "virDomainCheckpoint" has incompatible type "virDomainCheckpoint"; expected "virDomain"
> libvirt.py:6943: error: Argument 1 to "virDomainSnapshot" has incompatible type "virDomainSnapshot"; expected "virDomain"
>>> import libvirt
>>> con = libvirt.open('test:///default')
>>> dom = con.lookupByName("test")
>>> first = dom.checkpointCreateXML("""<domaincheckpoint><name>First</name></domaincheckpoint>""")
>>> first.domain()
<libvirt.virDomain object at 0x7f728c3b6b80>
^^^^^^
>>> second = dom.checkpointCreateXML("""<domaincheckpoint><name>Second</name></domaincheckpoint>""")
>>> parent = second.getParent()
>>> parent.domain()
<libvirt.virDomainCheckpoint object at 0x7f728c424d30>
^^^^^^^^^^^^^^^^
2020- 7- 27 Philipp Hahn <hahn@univention.de>
debug: Fix bit-rot in debug output
Let the compiler optimize out the printf() call instead of doing it with the
pre-processor as the later does not catch format string errors or the following
case, where NULLSTR() is used but not defined:
> libvirt-qemu-override.c: In function ‘libvirt_qemu_virConnectDomainQemuMonitorEventRegister’:
> libvirt-qemu-override.c:271:34: warning: implicit declaration of function ‘NULLSTR’; did you mean ‘NULL’? [-Wimplicit-function-declaration]
> 271 | pyobj_conn, pyobj_dom, NULLSTR(event), pyobj_cbData, flags);
> | ^~~~~~~
> libvirt-qemu-override.c:39:28: note: in definition of macro ‘DEBUG’
> 39 | while (0) {printf(fmt, __VA_ARGS__);}
> | ^~~~~~~~~~~
> libvirt-qemu-override.c:270:11: warning: format ‘%s’ expects argument of type ‘char *’, but argument 4 has type ‘int’ [-Wformat=]
> 270 | DEBUG("libvirt_qemu_virConnectDomainQemuMonitorEventRegister(%p %p %s %p %x) called\n",
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 271 | pyobj_conn, pyobj_dom, NULLSTR(event), pyobj_cbData, flags);
> | ~~~~~~~~~~~~~~
> | |
> | int
> libvirt-qemu-override.c:39:23: note: in definition of macro ‘DEBUG’
> 39 | while (0) {printf(fmt, __VA_ARGS__);}
> | ^~~
> libvirt-qemu-override.c:270:73: note: format string is defined here
> 270 | DEBUG("libvirt_qemu_virConnectDomainQemuMonitorEventRegister(%p %p %s %p %x) called\n",
> | ~^
> | |
> | char *
> | %d
Copy the definition of NULLSTR from libvirt/src/internal.h to typewrappers.h
2020- 7- 27 Philipp Hahn <hahn@univention.de>
libvirtaio: Fix return types of callback
libvirt defines the signature for the callback functions, e.g. the
functions for remove() must return -1 on error and 0 on success. Raising
an exception violates that contract.
_remove_timeout() did not explicitly handle a double-remove and
implicitly passed on the exception.
update() expects no return value, so remove the pointless return to pass
on None.
2020- 7- 27 Philipp Hahn <hahn@univention.de>
qemu-api: Fix return type
The API XML description uses "C types": "str *" is not valid.
2020- 7- 27 Philipp Hahn <hahn@univention.de>
generator: Fix domainCheckpoint.listAllChildren()
virDomainCheckpoint(dom, _obj)
expects a reference to the virDomain as its first argument, but
virDomainCheckpoint.listAllChildren()
passes `self` instead:
libvirt.py:7056: error: Argument 1 to "virDomainCheckpoint" has incompatible type "virDomainCheckpoint"; expected "virDomain"
>>> import libvirt
>>> con = libvirt.open('test:///default')
>>> dom = con.lookupByName("test")
>>> first = dom.checkpointCreateXML("""<domaincheckpoint><name>First</name></domaincheckpoint>""")
>>> second = dom.checkpointCreateXML("""<domaincheckpoint><name>Second</name></domaincheckpoint>""")
>>> child, = first.listAllChildren()
>>> second.domain()
<libvirt.virDomain object at 0x7f828d777b80>
^^^^^^^^^
>>> child.domain()
<libvirt.virDomainCheckpoint object at 0x7f828d8160a0>
^^^^^^^^^^^^^^^^^^^
2020- 7- 27 Philipp Hahn <hahn@univention.de>
generator: Fix domainSnapshot.listAllChildren()
virDomainSnapshot(dom, _obj)
expects a reference to the virDomain as its first argument, but
virDomainSnapshot.listAllChildren()
passes `self` instead:
libvirt.py:6459: error: Argument 1 to "virDomainSnapshot" has incompatible type "virDomainSnapshot"; expected "virDomain"
>>> import libvirt
>>> con = libvirt.open('test:///default')
>>> dom = con.lookupByName("test")
>>> first = dom.snapshotCreateXML("""<domainsnapshot><name>First</name></domainsnapshot>""")
>>> second = dom.snapshotCreateXML("""<domainsnapshot><name>Second</name></domainsnapshot>""")
>>> child, = first.listAllChildren()
>>> second.domain()
<libvirt.virDomain object at 0x7fb32be3cfd0>
^^^^^^^^^
>>> child.domain()
<libvirt.virDomainSnapshot object at 0x7fb32bdb9080>
^^^^^^^^^^^^^^^^^
2020- 7- 27 Philipp Hahn <hahn@univention.de>
generator: Fix string formatting
remove excessive arguments.
2020- 7- 27 Philipp Hahn <hahn@univention.de>
generator: Fix undefined variables file
generator.py:931:15: F821 undefined name 'file'
generator.py:951:15: F821 undefined name 'file'
2020- 7- 22 Jiri Denemark <jdenemar@redhat.com>
Post-release version bump to 6.6.0
2020- 7- 17 Radostin Stoyanov <rstoyanov@fedoraproject.org>
generator: Fix typos
2020- 7- 15 Radostin Stoyanov <rstoyanov@fedoraproject.org>
examples: Refactor domipaddrs
This patch makes domipaddrs example compatible with Python3.
2020- 7- 6 Cole Robinson <crobinso@redhat.com>
Fix PY_SSIZE_T_CLEAN deprecation warning
Seen running on fedora 32:
DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats
ret = libvirtmod.virDomainLookupByUUID(self._o, uuid)
This comes from here: https://bugs.python.org/issue36381
See the section about PY_SSIZE_T_CLEAN here:
https://docs.python.org/3/c-api/arg.html#strings-and-buffers
Solution is to use Py_ssize_t instead of int for unpacked '#' values,
combined with defined PY_SSIZE_T_CLEAN before importing Python.h. The
latter turns these deprecation warnings into runtime segfaults though
if we missed an instance.
I verified the virt-manager's test suite works fine after this change
2020- 7- 5 Cole Robinson <crobinso@redhat.com>
generator: Fix SyntaxWarning
$ ./setup.py build
running build
/usr/bin/pkg-config --print-errors --atleast-version=0.9.11 libvirt
/usr/bin/python3 generator.py libvirt /usr/share/libvirt/api/libvirt-api.xml
generator.py:1562: SyntaxWarning: "is" with a literal. Did you mean "=="?
if classname is "virStorageVol":
...
2020- 7- 3 Michal Privoznik <mprivozn@redhat.com>
virStream: Use larger buffer for sendAll/recvAll methods
There are four methods which receive/send entire stream
(sendAll(), recvAll(), sparseSendAll() and sparseRecvAll()). All
these have an intermediary buffer which is either filled by
incoming stream and passed to a user provided callback to handle
the data, or the other way round - user fills it with data they
want to send and the buffer is handed over to virStream.
But the buffer is incredibly small which leads to smaller packets
being sent and thus increased overhead. What we can do is to use
the same buffer as their C counterparts do (e.g.
virStreamSendAll()) - they all use VIR_NET_MESSAGE_LEGACY_PAYLOAD_MAX
long buffer (which is the maximum size of a stream packet we
send) - this is almost exactly 256KiB (it's 256KiB - 24B for the
header).
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2020- 7- 3 Michal Privoznik <mprivozn@redhat.com>
MANIFEST: Distribute sparsestream.py example
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2020- 6- 8 Daniel P. Berrangé <berrange@redhat.com>
setup: post-release version bump to 6.5.0
2020- 5- 22 Andrea Bolognani <abologna@redhat.com>
ci: Test installation
2020- 5- 22 Andrea Bolognani <abologna@redhat.com>
ci: Make job skips more flexible
Instead of hardcoding the names of the targets for which certain
steps should be skipped, use a separate variable to store that
information.
2020- 5- 14 Daniel P. Berrangé <berrange@redhat.com>
examples: remove docs about non-existent XML files
The docs refers to XML files that don't exist in the python binding
since it was split off from the main libvirt.git repo.
Fixes #3
2020- 5- 14 Daniel P. Berrangé <berrange@redhat.com>
Drop largely empty and unused NEWS file
We bundle a git generated ChangeLog file in the dist, and never add
any entries to the NEWS file.
Fixes #2
2020- 5- 14 Daniel P. Berrangé <berrange@redhat.com>
gitlab: add testing of the rpmbuild process
2020- 5- 5 Daniel P. Berrangé <berrange@redhat.com>
gitlab: add CONTRIBUTING.rst file to indicate use of merge requests
With the introduction of automated CI pipelines, we are now ready to switch
to using merge requests for the project. With this switch we longer wish
to have patches sent to the mailing list, and thus the git-publish
config is removed.
2020- 5- 5 Daniel P. Berrangé <berrange@redhat.com>
setup: post-release version bump to 6.4.0
2020- 5- 5 Daniel Veillard <veillard@redhat.com>
Release of libvirt-python 6.3.0
* setup.py: updated for the release
2020- 5- 1 Daniel P. Berrangé <berrange@redhat.com>
gitlab: fix typo s/perl/python/ in docker cached image name
Reported-by: Pavel Hrdina <phrdina@redhat.com>
2020- 5- 1 Daniel P. Berrangé <berrange@redhat.com>
travis: delete redundant configuration
Now that we're standardizing on GitLab CI for both official gating CI
and developer CI, there's no compelling reason to continue to support
Travis CI.
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2020- 5- 1 Daniel P. Berrangé <berrange@redhat.com>
gitlab: introduce CI jobs testing git master & distro libvirt
The python build needs to validate two axis
- A variety of libvirt versions
- A variety of python versions
We get coverage for both these axis by running a build against the
distro provided libvirt packages. All that is then missing is a build
against the latest libvirt git master, which only needs to be run on
a single distro, for which CentOS 8 is picked as a stable long life
base.
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2020- 5- 1 Daniel P. Berrangé <berrange@redhat.com>
test: workaround missing VIR_TYPED_PARAM enums in API definition
On Ubuntu 18.04 with libvirt 4.0.0 libvirt-python build fails
running test
/usr/bin/python3 sanitytest.py build/lib.linux-x86_64-3.6 /usr/share/libvirt/api/libvirt-api.xml
Cannot get a value of enum VIR_TYPED_PARAM_BOOLEAN (originally VIR_DOMAIN_BLKIO_PARAM_BOOLEAN)
Cannot get a value of enum VIR_TYPED_PARAM_DOUBLE (originally VIR_DOMAIN_BLKIO_PARAM_DOUBLE)
Cannot get a value of enum VIR_TYPED_PARAM_INT (originally VIR_DOMAIN_BLKIO_PARAM_INT)
...snip...
The code generated for the binding is still correct and so we can just
whitelist this error scenario.
2020- 4- 30 Daniel P. Berrangé <berrange@redhat.com>
gitlab: add CI job for validating DCO signoff
This job uses the shared "check-dco" image to validate that all
commits on a branch in a developer's repo fork have a suitable
2020- 4- 27 Philipp Hahn <hahn@univention.de>
examples: Fix connection error handling 2
Fix two more cases in examples as
libvirt.open*() does not return None but raises an exception
Fixes: 283e2bc693746164b22226e14d6fe3ccd38a07bf
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020- 4- 22 Daniel P. Berrangé <berrange@redhat.com>
setup: require python >= 3.5 to build
Python 3.5 is the oldest Python version available across our supported
build platforms.
Reviewed-by: Philipp Hahn <hahn@univention.de>
2020- 4- 20 Philipp Hahn <hahn@univention.de>
examples: Fix connection error handling
libvirt.open*() does not return None but raises an exception
2020- 4- 7 Daniel P. Berrangé <berrange@redhat.com>
github: enable lockdown of issues and merge requests
Libvirt uses GitHub as an automated read-only mirror. The goals were to
have a disaster recovery backup for libvirt.org, a way to make it easy
for people to clone their own private copy of libvirt Git, and finally
as a way to interact with apps like Travis.
The project description was set to a message telling people that we
don't respond to pull requests. This was quite a negative message to
potential contributors, and also did not give them any guidance about
the right way to submit to libvirt. Many also missed the description and
submitted issues or pull requests regardless.
It is possible to disable the issue tracker in GitHub, but there is no
way to disable merge requests. Disabling the issue tracker would also
leave the problem of users not being given any positive information
about where they should be reporting instead.
There is a fairly new 3rd party application built for GitHub that
provides a bot which auto-responds to both issues and merge requests,
closing and locking them, with a arbitrary comment:
https://github.com/apps/repo-lockdown
This commit adds a suitable configuration file for libvirt, which
tries to give a positive response to user's issue/pullreq and guide
them to the desired contribution path on GitLab.
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
2020- 4- 2 Daniel Veillard <veillard@redhat.com>
Release of libvirt-python 6.2.0
* setup.py: bumped version to 6.2.0
2020- 3- 30 Radostin Stoyanov <rstoyanov@fedoraproject.org>
tox: Test with Python 3.6, 3.7 and 3.8
Support for Python 2.X has been dropped with commit b22e4f2.
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020- 3- 3 Daniel Veillard <veillard@redhat.com>
Release of libvirt-python 6.1.0
* setup.py : updated for release
2020- 1- 16 Daniel P. Berrangé <berrange@redhat.com>
gitpublish: add 'libvirt-' to subject prefix
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2020- 1- 15 Daniel Veillard <veillard@redhat.com>
Release of libvirt-python-6.0.0
* setup.py: updated for the release
2020- 1- 3 Daniel P. Berrangé <berrange@redhat.com>
Add overrides for network port UUID getter/lookup methods
The generator creates broken code for all these methods.
Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
2020- 1- 3 Daniel P. Berrangé <berrange@redhat.com>
fix class type instantiated when listing network ports
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2019- 12- 9 Andrea Bolognani <abologna@redhat.com>
setup: Accept 'nosetests3' as nosetests binary
This is the name used on Ubuntu.
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2019- 12- 6 Daniel P. Berrangé <berrange@redhat.com>
Fix RPM deps for centos 7
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2019- 12- 4 Daniel P. Berrangé <berrange@redhat.com>
Drop support for python 2
python2 will be end of life by the time of the next
libvirt release. All our supported build targets, including
CentOS7, have a python3 build available.
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2019- 12- 2 Daniel Veillard <veillard@redhat.com>
Release of libvirt-python 5.10.0
* setup.py: update for release
2019- 11- 28 Pavel Hrdina <phrdina@redhat.com>
generator.py: add mapping for VIR_DOMAIN_QEMU_AGENT_COMMAND_*
Libvirt commit <95f5ac9ae52455e9da47afc95fa31c9456ac27ae> changed the
VIR_DOMAIN_QEMU_AGENT_COMMAND_* enum values to use different enum values
instead of direct numbers. We need to translate it back.
Traceback (most recent call last):
File "generator.py", line 2143, in <module>
qemuBuildWrappers(sys.argv[1])
File "generator.py", line 2008, in qemuBuildWrappers
items.sort(key=lambda i: (int(i[1]), i[0]))
File "generator.py", line 2008, in <lambda>
items.sort(key=lambda i: (int(i[1]), i[0]))
ValueError: invalid literal for int() with base 10: 'VIR_DOMAIN_AGENT_RESPONSE_TIMEOUT_BLOCK'
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2019- 11- 6 Daniel Veillard <veillard@redhat.com>
Release of libvirt-python 5.9.0
* setup.py: update for release
2019- 10- 5 Daniel Veillard <veillard@redhat.com>
Release of libvirt-python 5.8.0
* setup.py: updated version
2019- 9- 23 Pavel Hrdina <phrdina@redhat.com>
virDomainMigrate3Params: add missing parallel connections param
Introduced in libvirt 5.2.0 by commit <d3ea986af24>.
Reported-by: Liping Cheng <lcheng@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2019- 9- 23 Pavel Hrdina <phrdina@redhat.com>
virDomainMigrate3Params: add missing bandwidth postcopy param
Introduced in libvirt 5.1.0 by commit <c830187a015>.
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2019- 9- 20 Daniel P. Berrangé <berrange@redhat.com>
Custom impl for virConnectSetIdentity which can't be generated
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2019- 9- 20 Pavel Hrdina <phrdina@redhat.com>
virDomainMemoryStats: include hugetlb pgalloc and pgfail
Introduced in libvirt 5.4.0 by commit <a699b19f6c3>.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1683516
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2019- 9- 20 Pavel Hrdina <phrdina@redhat.com>
virDomainMemoryStats: include disk caches
Introduced in libvirt 4.6.0 by commit <aee04655089>.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1683516
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2019- 9- 12 Daniel P. Berrangé <berrange@redhat.com>
sanitytest: whitelist 'network' method as having no C impl
2019- 9- 12 Daniel P. Berrangé <berrange@redhat.com>
generator: fix constructor for virNetworkPort
The virNetworkPort class is passed both the virNetwork parent
python class and the virNetworkPort C object. This needs special
handling in the generator, similar to how virDomainSnapshots are
dealt with.
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2019- 9- 5 Cole Robinson <crobinso@redhat.com>
Fix -Wsign-compare warnings
libvirt-override.c: In function ‘libvirt_virConnectBaselineHypervisorCPU’:
libvirt-override.c:9946:23: warning: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare]
libvirt-override.c:9961:19: warning: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare]
Use ssize_t as was similarly done in 75ec2acb6163b
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2019- 9- 3 Daniel Veillard <veillard@redhat.com>
Release of libvirt-python 5.7.0
2019- 9- 3 Nir Soffer <nirsof@gmail.com>
spec: Build python2 package in fedora < 31
Since commit ee0cfbe65c5d (spec: Unconditionally build python2 on
Fedora) python2-libvirt is not built on any Fedora version.
Fix the spec to drop python2-libvirt on Fedora 31.
Reviewed-by: Cole Robinson <crobinso@redhat.com>
2019- 8- 29 Michal Privoznik <mprivozn@redhat.com>
Implement virDomainGetGuestInfo
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2019- 8- 5 Daniel Veillard <veillard@redhat.com>
Release of libvirt-python-5.6.0
* setup.py: updated for new release
2019- 7- 29 Eric Blake <eblake@redhat.com>
Define virDomainCheckpointPtr typedef on old libvirt
Needed prior to 5.6.0
2019- 7- 29 Eric Blake <eblake@redhat.com>
Add virDomainCheckpoint APIs
Copies heavily from existing virDomainSnapshot handling, regarding
what special cases the generator has to be taught and what overrides
need to be written.
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2019- 7- 9 Cole Robinson <crobinso@redhat.com>
spec: Bump minimum supported Fedora version to 29
Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
2019- 7- 9 Cole Robinson <crobinso@redhat.com>
spec: Unconditionally build python2 on Fedora
In Fedora we are currently shipping python2 bindings for all builds,
so this conditional is out of date. Fedora 31 may be the time that
python2 bindings are dropped:
https://fedoraproject.org/wiki/Changes/F31_Mass_Python_2_Package_Removal
But I think it's better to wait for that to actually happen before
we change this again
Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
2019- 7- 2 Daniel Veillard <veillard@redhat.com>
Release of libvirt-python 5.5.0
* setup.py: update for release
2019- 6- 26 Sergei Turchanov <turchanov@farpost.com>
Fix regression in lxcOpenNamespace
This fixes regression caused by the 1d39dbaf637db03f6e597ed56b96aa065710b4a1
fdlist[i] erroneously was replaced by fdlist[1] which caused
lxcOpenNamespace to return a list with identical elements.
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2019- 6- 20 Daniel P. Berrangé <berrange@redhat.com>
Add new override file to dist
2019- 6- 20 Daniel P. Berrangé <berrange@redhat.com>
Add missing impl of virNetworkListAllPorts
This API needs manual impl as the generator cannot cope
2019- 6- 20 Daniel P. Berrangé <berrange@redhat.com>
sanitytest: add some special cases for virNetworkPort APIs
2019- 6- 20 Daniel P. Berrangé <berrange@redhat.com>
generator: fix naming of getter APIs for virNetworkPort
2019- 6- 20 Daniel P. Berrangé <berrange@redhat.com>
Define virNetworkPortPtr typedef on old libvirt
2019- 6- 20 Daniel P. Berrangé <berrange@redhat.com>
Fix syntax error with missing ; and too many )
2019- 6- 20 Daniel P. Berrangé <berrange@redhat.com>
Add support for virNetworkPort object & APIs
Define the various rules in the generator to wire up methods into the
virNetwork class and create the new virNetworkPort class.
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2019- 6- 3 Daniel Veillard <veillard@redhat.com>
Release of Libvirt-python 5.4.0
2019- 5- 4 Daniel Veillard <veillard@redhat.com>
Release of libvirt-python 5.3.0
* setup.py: bumped release version
2019- 4- 29 Michal Privoznik <mprivozn@redhat.com>
Allow virConnect.getDomainCapabilities() to have no arguments
Our C API allows no values to be passed (well, it accepts all
NULLs). There's no reason that python binding should require all
arguments.
Reviewed-by: Kashyap Chamarthy <kchamart@redhat.com>
2019- 4- 4 Daniel P. Berrangé <berrange@redhat.com>
rpm: use new python macros for build/install rules
The new %py{2,3}_{build,install} macros ensure that the right compiler
and linker flags are used when building python modules.
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2019- 4- 3 Daniel Veillard <veillard@redhat.com>
Release of libvirt-python 5.2.0
* setup.py: bumped release version up
2019- 3- 12 Nir Soffer <nirsof@gmail.com>
Fix handling of optional params in blockCopy()
Commit 2b4bd07e0a22 (Add check for params, nparams being a dictionary)
changed the way the optional params argument is treated. If
libvirt.virDomain.blockCopy() is called without specifying params,
params is None, and the call will fail with:
TypeError: block params must be a dictionary
This is wrong as params is defined as kwarg, breaking existing libvirt
users like oVirt. Add a check for Py_None, so we accept either a dict or
None and fail with TypeError with anything else.
Resolves: https://bugzilla.redhat.com/1687114
2019- 3- 4 Daniel Veillard <veillard@redhat.com>
Release of libvirt-python 5.1.0
* setup.py: updated for release
2019- 2- 25 Pavel Hrdina <phrdina@redhat.com>
Fix virDomainPinIOThread typed params check
The VIR_DOMAIN_IOTHREAD_POLL_SHRINK is unsigned int.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1680546
2019- 2- 7 Eric Blake <eblake@redhat.com>
generator.py: typo fix
2019- 1- 24 Daniel P. Berrangé <berrange@redhat.com>
travis: add testing of 5.0.0 release
Update to test against very latest release. Since we dropped two
python versions, we can afford to add new libvirt version without
dropping a previous one.
Reviewed-by: Cole Robinson <crobinso@redhat.com>
2019- 1- 24 Daniel P. Berrangé <berrange@redhat.com>
travis: switch from trusty to xenial dist
The trusty gnutls version is too old to support modern libvirt
Reviewed-by: Cole Robinson <crobinso@redhat.com>
2019- 1- 24 Daniel P. Berrangé <berrange@redhat.com>
travis: remove python 2.6 and 3.6 from build matrix
The lxml package that we download with pip no longer supports either
of these versions of python.
Reviewed-by: Cole Robinson <crobinso@redhat.com>
2019- 1- 22 Daniel P. Berrangé <berrange@redhat.com>
rpm spec: remove %{extra_release} from spec
The %{extra_release} field was previously populated by data from the old
autobuild.sh file but is no longer used.
2019- 1- 15 Daniel Veillard <veillard@redhat.com>
Release of libvirt-python 5.0.0
* setup.py: updated for release
2018- 12- 3 Daniel Veillard <veillard@redhat.com>
Release of libvirt-python-4.10.0
* setup.py: update to bump release number
2018- 11- 26 Philipp Hahn <hahn@univention.de>
Add daemon to list of shutdown reasons
Add the support to work with libvirt commit 66a85cb13.
2018- 11- 20 John Ferlan <jferlan@redhat.com>
Fix copy paste error on the version check value
2018- 11- 20 John Ferlan <jferlan@redhat.com>
Implement API binding for virDomainSetIOThreadParams
Similar to libvirt_virDomainBlockCopy (and migration API's). Create
the code for the new API.
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2018- 11- 20 John Ferlan <jferlan@redhat.com>
Add check for params, nparams being a dictionary
If PyDict_Check fails, we should force an error rather than
blindly continuing on.
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2018- 11- 20 John Ferlan <jferlan@redhat.com>
Add missing virPyDictToTypedParams for libvirt_virDomainBlockCopy
Need to free params like similar API's such as libvirt_virDomainMigrate3
and libvirt_virDomainMigrateToURI3.
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2018- 11- 20 John Ferlan <jferlan@redhat.com>
Fix typos in virDomainSetSchedulerParameters name
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2018- 11- 4 Daniel Veillard <veillard@redhat.com>
Release of libvirt-python 4.9.0
* setup.py: update for new release
2018- 11- 1 Philipp Hahn <hahn@univention.de>
event-test.py: Report ERROR events
VIR_DOMAIN_EVENT_ID_IO_ERROR and VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON
callbacks receive the same 'action' parameter, so also translate that
numeric action to a descriptive text for the first callback.
2018- 11- 1 Philipp Hahn <hahn@univention.de>
event-test.py: Fix ERROR event
ERROR_EVENTS translates the numeric 'action' argument to a description,
not the 'reason' argument which already contains a descriptive string
like 'enospc'.
> Traceback (most recent call last):
> File "/usr/lib/python2.7/dist-packages/libvirt.py", line 4661, in _dispatchDomainEventIOErrorReasonCallback
> reason, opaque)
> File "libvirt-python/examples/event-test.py", line 536, in myDomainEventIOErrorReasonCallback
> dom.name(), dom.ID(), srcpath, devalias, action, ERROR_EVENTS[reason]))
> File "libvirt-python/examples/event-test.py", line 474, in __getitem__
> data = self.args[item]
> TypeError: tuple indices must be integers, not str
Fixes: f5928c6711654f1496707ca77f626b3192843d57
2018- 10- 1 Daniel Veillard <veillard@redhat.com>
Release of libvirt-python 4.8.0
- setup.py : updated for release
2018- 9- 24 Philipp Hahn <hahn@univention.de>
event-test.py: Fix blanks
Closer to pep8
2018- 9- 24 Philipp Hahn <hahn@univention.de>
event-test.py: Convert CONNECTION events
to use new Description class
2018- 9- 24 Philipp Hahn <hahn@univention.de>
event-test.py: Convert SECRET events
to use new Description class
2018- 9- 24 Philipp Hahn <hahn@univention.de>
event-test.py: Convert DEVICE events
to use new Description class
2018- 9- 24 Philipp Hahn <hahn@univention.de>
event-test.py: Convert STORAGE events
to use new Description class
2018- 9- 24 Philipp Hahn <hahn@univention.de>
event-test.py: Convert NETWORK events
to use new Description class
2018- 9- 24 Philipp Hahn <hahn@univention.de>
event-test.py: Convert TRAY events
to use new Description class
2018- 9- 24 Philipp Hahn <hahn@univention.de>
event-test.py: Convert DISK events
to use new Description class
2018- 9- 24 Philipp Hahn <hahn@univention.de>
event-test.py: Convert GRAPHICS events
to use new Description class
2018- 9- 24 Philipp Hahn <hahn@univention.de>
event-test.py: Convert AGENT events
to use new Description class
2018- 9- 24 Philipp Hahn <hahn@univention.de>
event-test.py: Convert ERROR events
to use new Description class
2018- 9- 24 Philipp Hahn <hahn@univention.de>
event-test.py: Convert WATCHDOG events
to use new Description class
2018- 9- 24 Philipp Hahn <hahn@univention.de>
event-test.py: Convert BLOCKJOB events
to use new Description class
2018- 9- 24 Philipp Hahn <hahn@univention.de>
event-test.py: Convert LIVECYCLE events
to use new Description class
2018- 9- 24 Philipp Hahn <hahn@univention.de>
event-test.py: Add class for event descriptions
2018- 9- 24 Philipp Hahn <hahn@univention.de>
event-test.py: Simplify event ID lists
by directly building the list with the IDs instead of appending them
explicitly.
2018- 9- 24 Philipp Hahn <hahn@univention.de>
event-test.py: Merge livecycle callbacks
Registering the same function twice using the old domainEventRegister()
interface would not work, as the function reference is used for
un-registering.
But it is not a problem with the new interface domainEventRegisterAny(),
as that returns a unique ID.
While at it also demonstrate the 'opaque' mechanism.
2018- 9- 24 Philipp Hahn <hahn@univention.de>
event-test.py: Use __file__
instead of sys.argv[0]
2018- 9- 24 Philipp Hahn <hahn@univention.de>
event-test.py: Add missing globale statement
to fix loop termination on exit.
2018- 9- 24 Philipp Hahn <hahn@univention.de>
event-test.py: Remove dead assignment
variable is unused
2018- 9- 24 Philipp Hahn <hahn@univention.de>
event-test.py: Remove extra parenthesis
2018- 9- 24 Philipp Hahn <hahn@univention.de>
event-test.py: Handle closed connection
If libvirtd terminates while event-test.py has an open connection to it,
it will crash with the following traceback:
> myConnectionCloseCallback: qemu:///session: Error
> Exception in thread libvirtEventLoop:
> Traceback (most recent call last):
> File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
> self.run()
> File "/usr/lib/python2.7/threading.py", line 754, in run
> self.__target(*self.__args, **self.__kwargs)
> File "examples/event-test.py", line 424, in virEventLoopPollRun
> eventLoop.run_loop()
> File "examples/event-test.py", line 242, in run_loop
> self.run_once()
> File "examples/event-test.py", line 187, in run_once
> libvirt.virEventInvokeFreeCallback(opaque)
> AttributeError: 'module' object has no attribute 'virEventInvokeFreeCallback'
>
> libvirt: XML-RPC error : internal error: client socket is closed
> Traceback (most recent call last):
> File "examples/event-test.py", line 872, in <module>
> main()
> File "examples/event-test.py", line 854, in main
> vc.secretEventDeregisterAny(id)
> File "/usr/lib/python2.7/dist-packages/libvirt.py", line 4987, in secretEventDeregisterAny
> if ret == -1: raise libvirtError ('virConnectSecretEventDeregisterAny() failed', conn=self)
> libvirt.libvirtError: internal error: client socket is closed
> Closing qemu:///session
Skip unregistering the event callbacks and closing the connection if the
connection is already broken / closed.
2018- 9- 24 Philipp Hahn <hahn@univention.de>
event-test.py: Sync list of domain lifecycle events
Add new events to prevent crash:
> Traceback (most recent call last):
> File "/usr/lib/python2.7/dist-packages/libvirt.py", line 4601, in _dispatchDomainEventCallbacks
> cb(self, virDomain(self, _obj=dom), event, detail, opaque)
> File "libvirt-python/examples/event-test.py", line 505, in myDomainEventCallback1
> domDetailToString(event, detail)))
> File "libvirt-python/examples/event-test.py", line 484, in domDetailToString
> return domEventStrings[event][detail]
> IndexError: tuple index out of range
2018- 9- 3 Daniel Veillard <veillard@redhat.com>
Release of libvirt-python=4.7.0
* setup.py: updated for release
2018- 8- 6 Daniel Veillard <veillard@redhat.com>
Release of libvirt-python-4.6.0
* setup.py: updated for release
2018- 7- 23 Daniel P. Berrangé <berrange@redhat.com>
rpm: update min required rhel/fedora
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018- 7- 23 Daniel P. Berrangé <berrange@redhat.com>
rpm: add BuildRequires on gcc
The gcc RPM is no longer part of the default build root.
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018- 7- 23 Daniel P. Berrangé <berrange@redhat.com>
rpm: use the versioned python2 macro names
The use of non-versioned python2 macro names is deprecated in Fedora
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018- 7- 16 Daniel P. Berrangé <berrange@redhat.com>
travis: add libvirt 4.5.0 version to build matrix
2018- 7- 16 Daniel P. Berrangé <berrange@redhat.com>
fix build with older libvirt missing virNWFilterBindingPtr
While we correctly disable all public API bindings that rely on
virNWFilterBindingPtr, the generator is still creating a helper function
that needs it - libvirt_virNWFilterBinding_pointer. Making this helper
conditional is a little hairy, so just provide a trivial typedef to keep
it happy.
2018- 7- 10 Cole Robinson <crobinso@redhat.com>
spec: Remove Group: and %defattr
These are only needed for RHEL5 builds, which are no longer supported
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/CMCUBB4SWS3URHTRRS3OPFM4HF5CGKBW/
https://fedoraproject.org/wiki/RPMGroups
2018- 7- 2 Daniel Veillard <veillard@redhat.com>
Release of libvirt-python-4.5.0
* setup.py: updated for release
2018- 6- 28 Daniel P. Berrangé <berrange@redhat.com>
Fix bugs in nwfilter binding APIs
We did not correctly mangle the API names in two cases, and we also
forgot to specialize the lookup method name in the sanity test.
2018- 6- 28 Daniel P. Berrangé <berrange@redhat.com>
Add support for nwfilter binding objects / apis
2018- 6- 27 Cole Robinson <crobinso@redhat.com>
libvirtaio: Fix compat with python 3.7
In python 3.7, async is now a keyword, so this throws a syntax error:
File "/usr/lib64/python3.7/site-packages/libvirtaio.py", line 49
from asyncio import async as ensure_future
^
SyntaxError: invalid syntax
Switch to getattr trickery to accomplish the same goal
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2018- 6- 14 Erik Skultety <eskultet@redhat.com>
Add support for virNodeGetSEVInfo
This binding allows to query the AMD's SEV firmware for various platform
specific things, like a PDH certificate and a certificate chain to
establish a trusted connection with the firmware. Because the API uses
typed params, it's exempted from generation.
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2018- 6- 14 Erik Skultety <eskultet@redhat.com>
Add support for virDomainGetLaunchSecurityInfo
Libvirt recently introduced support for getting launch security
parameters, most notably AMD SEV VM memory measurement. This API can't
be generated as it's using typed parameters which we need to allocate.
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2018- 6- 12 Pavel Hrdina <phrdina@redhat.com>
libvirt_charPtrUnwrap: remove unnecessary check of returned string
Function libvirt_charPtrUnwrap() either fails or always sets the
unwrapped string so there is no need to check it explicitly.
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2018- 6- 12 Pavel Hrdina <phrdina@redhat.com>
libvirt-override: Reset exception if the error is ignored
In virConnectCredCallbackWrapper() we ignore the error case of
libvirt_charPtrUnwrap() function so we should also reset the exception.
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2018- 6- 12 Pavel Hrdina <phrdina@redhat.com>
typewrappers: Fix libvirt_charPtrUnwrap to set an exception if it fails
If the function fails it should always set an exception.
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2018- 6- 12 Pavel Hrdina <phrdina@redhat.com>
libvirt-utils: remove unused py_str function
Commit <57a160b5248ba47d4e1c9d22d95847dad8e0524f> removed last usage
but did not remove the function itself.
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2018- 6- 6 Daniel P. Berrangé <berrange@redhat.com>
Blacklist virGetLastError{Code,Domain}
These methods will not be exposed to apps, since we auto raise
all errors.
2018- 6- 4 Daniel Veillard <veillard@redhat.com>
Release of libvirt-python-4.4.0
* setup.py: update for release
2018- 6- 1 Jiri Denemark <jdenemar@redhat.com>
Add support for virConnectBaselineHypervisorCPU
The python bindings for this API cannot be generated because are
generator is not capable of handling string arrays (char **) parameters.
https://bugzilla.redhat.com/show_bug.cgi?id=1584676
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2018- 5- 22 Michal Privoznik <mprivozn@redhat.com>
event-test.py: Sync list of storage lifecycle events
https://bugzilla.redhat.com/show_bug.cgi?id=1578337
Since libvirt 3.8.0 we have 6 events: defined, undefined,
started, stopped, created, deleted. However, the last two were
missing in a string list that translates libvirt events (int)
into human readable strings.
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2018- 5- 16 Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
Allow virConnect to be used as a context manager
The libvirt python bindings are now more 'pythonic' as virConnect can
now be used as a context manager.
For example, it's possible to write the following code:
with libvirt.open() as conn:
# do something with the connection...
print(conn.listAllDomains())
At the end of this with-block the connection will be closed
automatically.
Reviewed-by: Bjoern Walk <bwalk@linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
2018- 5- 16 Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
libvirt-override.py: remove unused import
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
Reviewed-by: Bjoern Walk <bwalk@linux.vnet.ibm.com>
2018- 5- 16 Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
libvirt-override.py: fix sparseSendAll
Variable ret is used before assignment.
2018- 5- 16 Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
libvirt_qemu/lxc: fix a namespace issue
Reviewed-by: Bjoern Walk <bwalk@linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
2018- 5- 16 Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
libvirt_qemu/lxc: import 'sys' package
This fixes the pylint [1] warning "E: 25,16: Undefined variable
'sys' (undefined-variable)".
[1] https://www.pylint.org/
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
Reviewed-by: Bjoern Walk <bwalk@linux.vnet.ibm.com>
2018- 5- 3 Andrea Bolognani <abologna@redhat.com>
maint: Drop autobuild.sh
The Test-AutoBuild project, that this script is supposed
to be used with, hasn't seen any activity in ~7 years;
these days, libvirt-python CI builds are happening on the
Jenkins-based CentOS CI environment under the libvirt
umbrella[1], and in that context the script is not used
at all.
[1] https://ci.centos.org/view/libvirt/
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2018- 4- 24 Daniel P. Berrangé <berrange@redhat.com>
git: add config file telling git-publish how to send patches
The "git-publish" tool is a useful git extension for sending patch
series for code review. It automatically creates versioned tags
each time code on a branch is sent, so that there is a record of
each version. It also remembers the cover letter so it does not
need re-entering each time the series is reposted.
With this config file present it is now sufficient[1] to run
$ git publish
to send all patches in a branch to the list for review, with the
correct subject prefix added for this non-core libvirt module.
[1] Assuming your $HOME/.gitconfig has an SMTP server listed
at least e.g.
[sendemail]
smtpserver = smtp.example.com
2018- 4- 19 Daniel P. Berrangé <berrange@redhat.com>
Fix build with older libvirt versions
The libvirt python module is supposed to build with historical versions
of the API back to 0.9.1, which means all constants / methods must be
wrapped in conditionals. This was accidentally forgotten in:
commit 314b2346df2d8e2d7d705b003c693b4fa0189bdf
Author: Edgar Kaziakhmedov <edgar.kaziakhmedov@virtuozzo.com>
Date: Wed Feb 7 17:49:30 2018 +0300
Set hints for virPyDictToTypedParams
Predefine hints for all parameters possible to avoid wrong type
convert.
This broke the build against any libvirt < 2.0.0
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2018- 4- 3 Daniel P. Berrangé <berrange@redhat.com>
Post-release version bump to 4.3.0
2018- 3- 23 Daniel P. Berrangé <berrange@redhat.com>
Disable Python 2 on future RHEL and Fedora > 29
The end of Python 2 is nearing, so declare when it will be removed
from libvirt Python binding RPMs.
NB, this doesn't imply we'll be removing py2 support from upstream
libvirt-python on the same timeframe - we'll consider what todo
wrt that when upstream Python 2 finally goes EOL.
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2018- 3- 5 Daniel P. Berrangé <berrange@redhat.com>
Post-release version bump to 4.2.0
2018- 3- 5 Daniel Veillard <veillard@redhat.com>
Release of libvirt-python 4.1.0
2018- 2- 19 Pavel Hrdina <phrdina@redhat.com>
Fix virPyDictToTypedParams type hint for block copy params
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2018- 2- 19 Pavel Hrdina <phrdina@redhat.com>
Add missing virPyDictToTypedParams hint for migration params
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2018- 2- 19 Pavel Hrdina <phrdina@redhat.com>
Fix order of virPyDictToTypedParams hints
This corresponds to the order in libvirt-domain.h header file.
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2018- 2- 19 Pavel Hrdina <phrdina@redhat.com>
Use static variables to store virPyDictToTypedParams hints
There is no need to have dynamic allocation every time the API
is called. Rewrites commit <314b2346df>.
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2018- 2- 19 Edgar Kaziakhmedov <edgar.kaziakhmedov@virtuozzo.com>
Set hints for virPyDictToTypedParams
Predefine hints for all parameters possible to avoid wrong type
convert.
2018- 2- 9 Daniel P. Berrangé <berrange@redhat.com>
tests: add special case for virStoragePoolLookupByTargetPath
This new API trips up the sanity test for checking mapping of
all C APIs into Python.
2018- 2- 6 Jiri Denemark <jdenemar@redhat.com>
event-test.py: Remove extra ( in --help output
2018- 1- 19 Daniel Veillard <veillard@redhat.com>
Release of libvirt-python-4.0.0
2018- 1- 12 Daniel P. Berrange <berrange@redhat.com>
Use python*_sitearch macros instead of manually defining the dir
Note we use python_sitearch not python2_sitearch, since the former
is more portable.
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2018- 1- 12 Daniel P. Berrange <berrange@redhat.com>
Fix filtering of RPM provides for .so files
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2018- 1- 12 Daniel P. Berrange <berrange@redhat.com>
Require libvirt native version matching py version by default
Although we're capable of building against any libvirt >= 0.9.11, 99% of the
time we want RPM builds to be done against matching libvirt version, otherwise
we might silently build against an unexpected/wrong version.
We don't support building against a native libvirt that's newer than the
python binding, since the generator may incorrectly handle new APIs. So use
== instead of >= too.
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2018- 1- 12 Daniel P. Berrange <berrange@redhat.com>
Turn on python3 sub-RPMs for RHEL > 7
It is expected that future RHEL-8 will have python3 by default, so enable that.
It is unclear whether python2 will still be available, so leave that enabled
for now.
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2018- 1- 12 Daniel P. Berrange <berrange@redhat.com>
Adapt to rename of py2 RPMs from python- to python2- prefix
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2018- 1- 12 Daniel P. Berrange <berrange@redhat.com>
Add emacs mode marker to activate rpm-spec highlighting
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2018- 1- 12 Daniel P. Berrange <berrange@redhat.com>
Add checks for min supported distros
Be clear about which distros we aim to support with the specfile, so we know
what we can cleanup in the spec later.
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2018- 1- 12 Daniel P. Berrange <berrange@redhat.com>
Allow override of which sub-RPMs to build
Allow using
rpmbuild --define "with_python2 0"
to override the default logic about which python sub-RPMs to build
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2018- 1- 12 Daniel P. Berrange <berrange@redhat.com>
Allow disabling of python2 RPM build
With Fedora modularity, it is possible to have add-on repos for multiple
versions of python3. It is thus desirable to be able to build libvirt-python
in these repos, with only the python3 sub-RPMs enabled.
Thus also helps if future RHEL/Fedora drop python2 entirely from their default
repos.
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2017- 12- 11 Peng Hao <peng.hao2@zte.com.cn>
libvirt-python : PyObject memory leak
libvirt_virConnectDomainEventTunableCallback leak a PyObject.
2017- 12- 4 Daniel Veillard <veillard@redhat.com>
Release of libvirt-python 3.10.0
2017- 11- 30 Cédric Bosdonnat <cbosdonnat@suse.com>
Don't hardcode interpreter path
This is particularly useful on operating systems that don't ship
Python as part of the base system (eg. FreeBSD) while still working
just as well as it did before on Linux.
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
2017- 11- 2 Daniel Veillard <veillard@redhat.com>
Release of libvirt-python-3.9.0
2017- 9- 29 Nir Soffer <nirsof@gmail.com>
Unify whitespace around *_ALLOW_THREADS macros
Most of the code treats libvirt API calls as separate block, keeping one
blank line before the LIBVIRT_BEGIN_ALLOW_THREAD, and one blank line
after LIBVIRT_END_ALLOW_THREADS. Unify the whitespace so all calls
wrapped with these macros are treated as a separate block.
2017- 9- 27 Nir Soffer <nirsof@gmail.com>
Release the GIL during virDomainGetMemoryStats & virDomainGetDiskErrors
We discovered that the entire python process get stuck for about 30
seconds when calling virDomain.getMemoryStats() if libvirt is stuck in
virConnect.getAllDomainStats() on inaccessible storage. This blocking
cause a horrible mess in oVirt.
This patches adds the standard *_ALLOW_THREADS around the call to avoid
this unwanted blocking.
2017- 9- 26 Daniel P. Berrange <berrange@redhat.com>
Avoid implicit treatment of an arithmetic result as a boolean
Latest GCC versions are unhappy with us treating an integer
arithmetic result as a boolean:
libvirt-utils.c: In function ‘virReallocN’:
libvirt-utils.c:111:23: warning: ‘*’ in boolean context, suggest ‘&&’ instead [-Wint-in-bool-context]
if (!tmp && (size * count)) {
~~~~~~^~~~~~~~
Add an explicit comparison '!= 0' to keep it happy, since its
suggestion to use '&&' is nonsense.
2017- 9- 26 Daniel P. Berrange <berrange@redhat.com>
Fix comparisons between signed & unsigned integers
When python3 builds C modules, it adds the -Wsign-compare flag to GCC.
This creates lots of warnings where we compare a 'size_t' value against
an 'int' value due to signed/unsigned difference. Change all the size_t
types to ssize_t to address this.
2017- 9- 26 Wojtek Porczyk <woju@invisiblethingslab.com>
libvirtaio: add .drain() coroutine
The intended use is to ensure that the implementation is empty, which is
one way to ensure that all connections were properly closed and file
descriptors reclaimed.
2017- 9- 26 Wojtek Porczyk <woju@invisiblethingslab.com>
libvirtaio: keep track of the current implementation
Since 7534c19 it is not possible to register event implementation twice.
Instead, allow for retrieving the current one, should it be needed
afterwards.
2017- 9- 26 Wojtek Porczyk <woju@invisiblethingslab.com>
libvirtaio: fix closing of the objects
- Descriptor.close() was a dead code, never used.
- TimeoutCallback.close(), as a cleanup function, should have called
super() as last statement, not first
2017- 9- 26 Wojtek Porczyk <woju@invisiblethingslab.com>
libvirtaio: do not double-add callbacks
This was a harmless bug, without any impact, but it is wrong to manage
the collection of callbacks from it's members.
2017- 9- 26 Wojtek Porczyk <woju@invisiblethingslab.com>
libvirtaio: cache the list of callbacks when calling
When the callback causes something that results in changes wrt
registered handles, python aborts iteration.
Relevant error message:
Exception in callback None()
handle: <Handle cancelled>
Traceback (most recent call last):
File "/usr/lib64/python3.5/asyncio/events.py", line 126, in _run
self._callback(*self._args)
File "/usr/lib64/python3.5/site-packages/libvirtaio.py", line 99, in _handle
for callback in self.callbacks.values():
RuntimeError: dictionary changed size during iteration
QubesOS/qubes-issues#2805
2017- 9- 26 Wojtek Porczyk <woju@invisiblethingslab.com>
libvirtaio: add more debug logging
This logging is helpful for tracing problems with unclosed connections
and leaking file descriptors.
2017- 9- 19 Daniel P. Berrange <berrange@redhat.com>
Add travis build config
Enable builds on several python versions, and against several versions
of libvirt. Ideally we would build all the way back to 0.9.11, since
that is the min supported libvirt for python binding. It is not possible
to build this old libvirt version on modern distros though, so using
1.2.0 as the oldest for now.
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2017- 9- 18 Daniel P. Berrange <berrange@redhat.com>
Skip sparseRecvAll / sparseSendAll in sanity test
The sanity test check aims to ensure that every function listed in
the Python code maps to a corresponding C function. The Sparse
send/recv methods are special though - we're never calling the
corresponding C APIs, instead we have a pure python impl.
2017- 9- 6 Daniel P. Berrange <berrange@redhat.com>
Post-release version bump to 3.8.0
2017- 9- 6 Daniel P. Berrange <berrange@redhat.com>
Report an error if registering an event loop twice
The C library will now ignore an attempt to register an event
loop twice. It is unable to report an error in this case though
due to the C API returning 'void'. To improve this we must
manually report an error at the python level.
2017- 9- 6 Daniel P. Berrange <berrange@redhat.com>
Remove unused variables for event callbacks
2017- 9- 4 Daniel P. Berrange <berrange@redhat.com>
Change Obsoletes to an explicit version
We only want to obsolete versions which actually had the
original name, not all future versions.
2017- 9- 4 Daniel Veillard <veillard@redhat.com>
Release of libvirt-python 3.7.0
* setup.py: updated for release
2017- 8- 26 John Ferlan <jferlan@redhat.com>
Implement virDomainMigrateGetMaxDowntime
Add override code for virDomainMigrateGetMaxDowntime
2017- 8- 26 John Ferlan <jferlan@redhat.com>
Introduce virDomainMigrateGetMaxDowntime API
Introduce wrapper for virDomainMigrateGetMaxDowntime
2017- 8- 10 Daniel P. Berrange <berrange@redhat.com>
Fix package name in description of sub-RPMs
2017- 8- 10 Daniel P. Berrange <berrange@redhat.com>
Revert "rpm: assume python3 is always available"
This reverts commit b302b6d884ad4c6c917203a463f3377f3615b030.
Only drop the Fedora 18 test - RHEL must still build without
python 3
2017- 8- 10 Daniel P. Berrange <berrange@redhat.com>
rpm: rename packages to python2-libvirt / python3-libvirt
This complies with Fedora naming policy for python packages
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2017- 8- 10 Daniel P. Berrange <berrange@redhat.com>
rpm: assume python3 is always available
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2017- 8- 2 Tomáš Golembiovský <tgolembi@redhat.com>
virDomainMemoryStats: include usable memory and last update
We've forgot to include VIR_DOMAIN_MEMORY_STAT_USABLE and
VIR_DOMAIN_MEMORY_STAT_LAST_UPDATE constants.
2017- 8- 2 Daniel Veillard <veillard@redhat.com>
Release of libvirt-python-3.6.0
virtually identical to 3.5.0 except for the bump of version in setup.py
2017- 7- 4 Daniel Veillard <veillard@redhat.com>
Release of libvirt-python-3.5.0
* setup.py: bump version number
2017- 6- 20 Martin Kletzander <mkletzan@redhat.com>
Add details for shutdown event
In commit a8eba5036cb4b0e2ec827e9e6e019ce70e451377, libvirt added
support for two more details. In python bindings it all worked fine
automagically except an example that was not updated.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1463188
2017- 6- 2 Daniel Veillard <veillard@redhat.com>
Release of libvirt-python-3.4.0
2017- 5- 24 Daniel P. Berrange <berrange@redhat.com>
Fix error check for virDomainGetTime method
The virDomainGetTime returns either a dict or None, but the python
glue layer for checking for '-1'. Thus it failed to raise an
exception on error.
2017- 5- 24 Michal Privoznik <mprivozn@redhat.com>
examples: Introduce sparsestream.py
Sparse streams are not that straight forward to use for the very
first time. Especially the sparseRecvAll() and sparseSendAll()
methods which expects callbacks. What we can do to make it easier
for developers is to have an example where they can take an
inspiration from.
2017- 5- 24 Michal Privoznik <mprivozn@redhat.com>
virStream: Introduce virStreamSparse{Recv,Send}All
Yet again, our parser is not capable of generating proper
wrapper. To be fair, this one wold be really tough anyway.
2017- 5- 23 Michal Privoznik <mprivozn@redhat.com>
virStream: Introduce virStreamRecvFlags
Yet again, we need a custom wrapper over virStreamRecvFlags
because our generator is not capable of generating it.
2017- 5- 23 Michal Privoznik <mprivozn@redhat.com>
Implement virStreamSendHole/virStreamRecvHole
The return value for virStreamRecvHole is slightly different to
its C counterpart. In python, either it returns the hole size or
None if C API fails.
2017- 5- 17 Xavier Fernandez <xav.fernandez@gmail.com>
Use better comparison in virStream.sendAll for Python 3
In Python 3, if the file is open in binary mode, @got will end up
being equal to b"" and b"" != "" in Python 3.
2017- 5- 15 Martin Kletzander <mkletzan@redhat.com>
spec: Install egg-info with rpm package
This was being done due to now deprecated policy and that file should
be installed so that pip can recognize that the packages is already
installed in the system.
2017- 5- 5 Daniel Veillard <veillard@redhat.com>
Release of libvirt-python-3.3.0
2017- 4- 4 Daniel P. Berrange <berrange@redhat.com>
event-test: add ability to run the asyncio event loop
The event test program '--loop' arg is modified to take the name
of an event loop impl to run. eg 'event-test.py --loop asyncio'
2017- 4- 4 Daniel P. Berrange <berrange@redhat.com>
event-test: rename example event loop impl
Use the name 'Poll' instead of 'Pure' for the event loop demo,
since there's now a second pure python loop impl available.
2017- 4- 4 Daniel P. Berrange <berrange@redhat.com>
event-test: unregister callbacks & close conn on exit
In order to test cleanup code paths we must unregister all callbacks
and close the connection on shutdown. Since cleanup happens in the
background, we do a short sleep to allow the main loop to run its
cleanup too.
2017- 4- 4 Daniel P. Berrange <berrange@redhat.com>
event-test: add timeout to exit event loop
2017- 4- 4 Daniel P. Berrange <berrange@redhat.com>
event-test: free opaque data when removing callbacks
The pure python event loop impl has to call
libvirt.virEventInvokeFreeCallback
to free the event opaque data from a clean stack context
2017- 4- 4 Wojtek Porczyk <woju@invisiblethingslab.com>
Add asyncio event loop implementation
This is usable only on python >= 3.4 (or 3.3 with out-of-tree asyncio),
however it should be harmless for anyone with older python versions.
In simplest case, to have the callbacks queued on the default loop:
>>> import libvirtaio
>>> libvirtaio.virEventRegisterAsyncIOImpl()
The function is not present on non-compatible platforms.
2017- 4- 4 Wojtek Porczyk <woju@invisiblethingslab.com>
Allow for ff callbacks to be called by custom event implementations
The documentation says:
> If the opaque user data requires free'ing when the handle is
> unregistered, then a 2nd callback can be supplied for this purpose.
> This callback needs to be invoked from a clean stack. If 'ff'
> callbacks are invoked directly from the virEventRemoveHandleFunc they
> will likely deadlock in libvirt.
And they did deadlock. In removeTimeout too. Now we supply a custom
function to pick it from the opaque blob and fire.
2017- 4- 2 Daniel Veillard <veillard@redhat.com>
Release of libvirt-python-3.2.0
* setup.py: bumped version
2017- 3- 29 Peter Krempa <pkrempa@redhat.com>
event: Add handler for block threshold event
Unfortunately python doesn't generate those.
2017- 3- 29 Peter Krempa <pkrempa@redhat.com>
event: fix comment for _dispatchDomainEventMetadataChangeCallback
The comment was copied from the device removal failed event.
2017- 1- 27 Daniel P. Berrange <berrange@redhat.com>
Removed unused 'functions_list_exception_test' code from generator
The 'functions_list_exception_test' data structure and associated code
in the generator is inherited from libxml. This has never
been used in libvirt, so delete it to simplify the generator.
2017- 1- 27 Daniel P. Berrange <berrange@redhat.com>
Removed unused 'converter_type' code from generator
The 'converter_type' data structure and associated code
in the generator is inherited from libxml. This has never
been used in libvirt, so delete it to simplify the generator.
2017- 1- 27 Daniel P. Berrange <berrange@redhat.com>
Removed unused 'classes_ancestor' code from generator
The 'classes_ancestor' data structure and associated code
in the generator is inherited from libxml. This has never
been used in libvirt, so delete it to simplify the generator.
2017- 1- 27 Daniel P. Berrange <berrange@redhat.com>
Removed unused 'py_return_types' code from generator
The 'py_return_types' data structure and associated code
in the generator is inherited from libxml. This has never
been used in libvirt, so delete it to simplify the generator.
2017- 1- 27 Daniel P. Berrange <berrange@redhat.com>
Removed unused 'foreign_encoding_args' code from generator
The 'foreign_encoding_args' data structure and associated code
in the generator is inherited from libxml. This has never
been used in libvirt, so delete it to simplify the generator.
2017- 1- 27 Daniel P. Berrange <berrange@redhat.com>
Removed unused 'function_post' code from generator
The 'function_post' data structure and associated code
in the generator is inherited from libxml. This has never
been used in libvirt, so delete it to simplify the generator.
2017- 1- 27 Daniel P. Berrange <berrange@redhat.com>
Removed unused 'reference_keepers' code from generator
The 'reference_keepers' data structure and associated code
in the generator is inherited from libxml. This has never
been used in libvirt, so delete it to simplify the generator.
2017- 1- 27 Daniel P. Berrange <berrange@redhat.com>
Protect against user accidentally calling constructors directly
When using libvirt python you must never call the object
constructors directly, as these are expecting to be passed
a wrapped C object. For example
import libvirt
c = libvirt.virConnect("qemu:///system")
c.listAllDomains()
will mysteriously segfault. With this change the user now
gets an slightly more helpful error
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/berrange/src/virt/libvirt-python/build/libvirt.py", line 3409, in __init__
raise Exception("Expected a wrapped C Object but got %s" % type(_obj))
Exception: Expected a wrapped C Object but got <type 'str'>
2017- 1- 18 Wu Zongyong <wuzongyo@mail.ustc.edu.cn>
Fix the incorrect memory freeing which will result in crash
Commit id '71fd95409' neglected to adjust a couple of API's do that now.
The number of elements in new_params is equal to the length of info,
instead of nparams, so it's wrong to free new_params using nparams.
2017- 1- 18 John Ferlan <jferlan@redhat.com>
Post-release version bump to 3.1.0
2017- 1- 17 Daniel Veillard <veillard@redhat.com>
Release of libvirt-python-3.0.0
2017- 1- 10 Michal Privoznik <mprivozn@redhat.com>
examples: Update event-test.py
With recent changes there are new events known to libvirt.
Reflect those changes in our event-test.py example script.
2017- 1- 10 Daniel P. Berrange <berrange@redhat.com>
Fix typos in previous secrets event patch
2017- 1- 9 Daniel P. Berrange <berrange@redhat.com>
Add support for domain metadata change event
2017- 1- 9 Daniel P. Berrange <berrange@redhat.com>
Add support for secret event APIs
2016- 12- 21 Daniel P. Berrange <berrange@redhat.com>
Add override impl for virStorageVolGetInfoFlags
2016- 12- 21 Daniel P. Berrange <berrange@redhat.com>
Remove bogus \o escape in regex
One of the regexes has a bogus \o instead of plain 'o'. Somehow
this magically worked on all versions of python, until 3.6 came
along and complained
2016- 12- 14 Daniel P. Berrange <berrange@redhat.com>
Fix running of nosetests on python 3
Previously the way Fedora installed /usr/bin/nosetests allowed it
to be invoked with either python 2 or 3. Since Fedora 25 though,
it contains a module name that only exists on python 2. So we need
to be more intelligent and pick a different nosetests binary per
version.
2016- 12- 13 Prabodh Agarwal <prabodh1194@users.noreply.github.com>
HACKING: fix grammar
2016- 12- 5 Daniel P. Berrange <berrange@redhat.com>
Fill out more fields for PKG-INFO file
Ensure the description and license are set in PKG-INFO,
and clarify the summary field.
2016- 11- 11 Konstantin Neumoin <kneumoin@virtuozzo.com>
don't overrun buffer when converting cpumap
If we pass large(more than cpunum) cpu mask to any libvirt_virDomainPin*
function, it could leads to crash. So we have to check tuple size in
virPyCpumapConvert and ignore extra tuple members.
Since we allocate a zeroed buffer, we don't need to bother with setting
the bits to zero.
2016- 11- 11 Konstantin Neumoin <kneumoin@virtuozzo.com>
move cpumap conversion code to a common helper
All libvirt_virDomainPin* functions do the same thing for convert
pycpumap to cpumap, so this patch moves all common logic to new
helper - virPyCpumapConvert.
2016- 11- 2 Pavel Hrdina <phrdina@redhat.com>
Post-release version bump to 2.5.0
2016- 11- 1 Daniel Veillard <veillard@redhat.com>
Release of libvirt-2.4.0
* setup.py: just bumped up the release number
2016- 9- 19 Peter Krempa <pkrempa@redhat.com>
override: Properly override wrapper for virDomainGetGuestVcpus
Without the change to libvirt-override-api.xml generator.py would
generate the following function header:
def guestVcpus(self, params, nparams, flags=0):
Since @params and @nparams are output-only in C and the python C
implementation actualy creates a dict from them we should not need to
pass them. Add the API definition to drop the two unnecessary args:
def guestVcpus(self, flags=0):
The code did not work at all until this change as the C impl expects
only two arguments but the python required use of four.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1377071
2016- 9- 19 Peter Krempa <pkrempa@redhat.com>
Post-release version bump to 2.3.0
2016- 8- 24 Michal Privoznik <mprivozn@redhat.com>
PyArg_ParseTuple: Provide correct function names
At the end of the format string we put :virFunctionName where ':'
says "this is the end of argument list", and virFunctionName is
the prefix for error messages then. However, in some cases we
have had wrong names there. Some of them are actually quite
funny: xmlRegisterErrorHandler.
2016- 8- 17 Jovanka Gulicoska <jovanka.gulicoska@gmail.com>
event-test: support node device update callback
2016- 8- 17 Jovanka Gulicoska <jovanka.gulicoska@gmail.com>
Add support for node device update callback
2016- 8- 2 Jovanka Gulicoska <jovanka.gulicoska@gmail.com>
event-test: Add node device lifecycle event tests
2016- 8- 2 Jovanka Gulicoska <jovanka.gulicoska@gmail.com>
Python binding for node poll lifecycle events API
2016- 8- 2 Cole Robinson <crobinso@redhat.com>
Post-release version bump to 2.2.0
2016- 7- 28 Markus Rothe <markusr815@gmail.com>
allow pkg-config binary to be set by env
https://bugzilla.redhat.com/show_bug.cgi?id=1350523
2016- 7- 25 Pavel Hrdina <phrdina@redhat.com>
Post-release version bump to 2.1.0
2016- 7- 23 Pavel Hrdina <phrdina@redhat.com>
Fix crash in storage pool refresh callback
Fixes copy-paste typo introduced by commit cb84e36c.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1354271
2016- 6- 24 Daniel P. Berrange <berrange@redhat.com>
Add support for storage pool refesh callback
2016- 6- 24 Daniel P. Berrange <berrange@redhat.com>
Fix signedness of arg to virDomainGetGuestVcpus
2016- 6- 23 Michal Privoznik <mprivozn@redhat.com>
Add support for virDomainGetGuestVcpus
This function has virTypedParameterPtr as one of the args and our
generator is unable to deal with that. Therefore we must provide
implementation.
2016- 6- 16 Jovanka Gulicoska <jovanka.gulicoska@gmail.com>
event-test: Add storage pool lifecycle event tests
2016- 6- 16 Jovanka Gulicoska <jovanka.gulicoska@gmail.com>
Python binding for storage pool lifecycle events API
Code matches the network event API implementation
2016- 6- 14 Daniel P. Berrange <berrange@redhat.com>
Post-release version bump to 2.0.0
2016- 6- 4 Daniel Veillard <veillard@redhat.com>
Release of libvirt-python-1.3.5
* setup.py: bumped to 1.3.5, the release is virtually identical to 1.3.4
2016- 4- 21 Peter Krempa <pkrempa@redhat.com>
generator.py: Consider symbols from libvirt-common
Some of the libvirt public API was moved into the libvirt-common.h file.
We should consider it while building python too.
2016- 4- 20 Cole Robinson <crobinso@redhat.com>
spec: Don't pull in dependencies for example scripts
If the scripts are marked as executable, RPM magic will scan them
for dependencies, which can pull in python2 for the python3 package
2016- 4- 18 Pavel Hrdina <phrdina@redhat.com>
fix crash in getAllDomainStats
Commits 1d39dbaf and 827ed9b4 broke the libvirt-python API by removing
virDomainRef() and virDomainFree(). virDomainStatsRecordListFree() will
free that domain pointer and later when virDomain (python object) call
its destructor and tries to free that same pointer again.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1326839
2016- 4- 18 Peter Krempa <pkrempa@redhat.com>
event: Add support VIR_DOMAIN_EVENT_ID_DEVICE_REMOVAL_FAILED
2016- 4- 18 Peter Krempa <pkrempa@redhat.com>
Post-release version bump to 1.3.4
2016- 4- 6 Daniel Veillard <veillard@redhat.com>
Release of libvirt-python-1.3.3
2016- 3- 31 Qiaowei Ren <qiaowei.ren@intel.com>
python: add python binding for Perf API
This patch adds the python binding for virDomainSetPerfEvents and
virDomainSetPerfEvents API.
2016- 3- 8 Jiri Denemark <jdenemar@redhat.com>
Add support for JOB_COMPLETED event
2016- 2- 23 Pavel Hrdina <phrdina@redhat.com>
libvirt-override: fix PyArg_ParseTuple for size_t
Format string uses 'n' for Py_ssize_t but size_t is unsigned long, we
need to use 'k'.
2016- 2- 23 Pavel Hrdina <phrdina@redhat.com>
libvirt-override: fix PyArg_ParseTuple for unsigned long long
Format string uses 'L' for long long type and 'K' for unsigned long long
type.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1260356
2016- 2- 23 Pavel Hrdina <phrdina@redhat.com>
libvirt-override: fix PyArg_ParseTuple for unsigned int
Format string uses 'i' for int type and 'I' for unsigned int type.
2016- 2- 23 Pavel Hrdina <phrdina@redhat.com>
libvirt-override: all flags should be defined as unsigned int
2016- 1- 18 Jiri Denemark <jdenemar@redhat.com>
Add support for MIGRATION_ITERATION event
2016- 1- 18 Jiri Denemark <jdenemar@redhat.com>
setup: Use cflags and ldflags properly
The setup.py script reads cflags and ldflags from pkg-config and uses
them when compiling/linking C modules. Since both cflags and ldflags may
include multiple compiler arguments we need to split them rather than
concatenating them into a single argument.
2016- 1- 18 Jiri Denemark <jdenemar@redhat.com>
Post-release version bump to 1.3.2
2016- 1- 17 Daniel Veillard <veillard@redhat.com>
Version bump to 1.3.1
For release but no change from 1.3.0
2015- 11- 24 Pavel Hrdina <phrdina@redhat.com>
Post-release version bump to 1.3.0
2015- 10- 31 Pavel Hrdina <phrdina@redhat.com>
fix crash introduced by commit 1d39dbaf
Some of the libvirt_*Wrap functions steals the reference and we need to
set the item in array to NULL no not free it on success. Those three
places was accidentally removed by commit 1d39dbaf.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1270977
2015- 10- 15 Martin Kletzander <mkletzan@redhat.com>
Post-release version bump to 1.2.21
2015- 10- 5 Pavel Hrdina <phrdina@redhat.com>
use VIR_PY_DICT_SET_GOTO
2015- 10- 5 Pavel Hrdina <phrdina@redhat.com>
use VYR_PY_LIST_SET_GOTO and VIR_PY_LIST_APPEND_GOTO
2015- 10- 5 Pavel Hrdina <phrdina@redhat.com>
use VIR_PY_TUPLE_GOTO
2015- 10- 5 Pavel Hrdina <phrdina@redhat.com>
utils: introduce new macro helpers for tuple, list and dict objects
2015- 10- 5 Pavel Hrdina <phrdina@redhat.com>
improve usage of cleanup paths
This removes several code duplicates and also some unusual code structures.
2015- 10- 5 Pavel Hrdina <phrdina@redhat.com>
drop unnecessary py_retval variable
2015- 10- 5 Pavel Hrdina <phrdina@redhat.com>
change the order of some statements
This change makes it easier to free allocated object especially for
python objects. We can benefit from the fact, that if you call
Py_DECREF on any python object it will also remove reference for all
assigned object to the root object. For example, calling Py_DECREF on
dict will also remove reference recursively on all elements in that
dictionary. Our job is then just call Py_DECREF on the root element and
don't care about anything else.
2015- 10- 5 Pavel Hrdina <phrdina@redhat.com>
Must check return value for all Py*_New functions
If the function fails, we need to cleanup memory and return NULL.
2015- 10- 5 Pavel Hrdina <phrdina@redhat.com>
use Py_CLEAR instead of Py_XDECREF followed by NULL assignment
2015- 10- 5 Pavel Hrdina <phrdina@redhat.com>
Use VIR_PY_NONE instead of increment and Py_None
To insert Py_None into some other python object like dict or tuple, you
need to increase reference to the Py_None. We have a macro to do that.
2015- 10- 5 Pavel Hrdina <phrdina@redhat.com>
Return NULL and set an exception if allocation fails
This is a recommended work-flow for allocation failures and we should
follow it.
2015- 10- 5 Pavel Hrdina <phrdina@redhat.com>
Return correct python object
In case of error without setting an python exception we need to return
a correct python object. For functions that returns anything else than
a number the return value is 'None', otherwise it's '-1'.
2015- 10- 5 Pavel Hrdina <phrdina@redhat.com>
Return NULL if python exception is set
There is a rule, python API fails, it also in those cases sets an
exception. We should follow those rules and in those cases return NULL.
2015- 10- 5 Pavel Hrdina <phrdina@redhat.com>
wrap lines to 80 columns
2015- 10- 5 Pavel Hrdina <phrdina@redhat.com>
fix indentation
2015- 10- 5 Pavel Hrdina <phrdina@redhat.com>
indent labels by one space
2015- 10- 5 Pavel Hrdina <phrdina@redhat.com>
cleanup functions definition
Follow the libvirt hacking guide and make the code consistent.
2015- 10- 5 Pavel Hrdina <phrdina@redhat.com>
Move utils and shared code into libvirt-utils
2015- 10- 5 Pavel Hrdina <phrdina@redhat.com>
drop unnecessary goto
2015- 10- 5 Pavel Hrdina <phrdina@redhat.com>
remove useless check for NULL before Py_XDECREF
2015- 10- 5 Pavel Hrdina <phrdina@redhat.com>
refactor the function to not override python exceptions
2015- 10- 5 Pavel Hrdina <phrdina@redhat.com>
update virDomainGetVcpus xml API description
Python api returns a tuple with the vcpus information.
2015- 10- 2 Daniel Veillard <veillard@redhat.com>
Release of libvirt-python-1.2.20
2015- 9- 21 Luyao Huang <lhuang@redhat.com>
generator: fix build fail with old xml lib
https://bugzilla.redhat.com/show_bug.cgi?id=1222795#c6
if build libvirt-python with some old xml lib (python-pyxml),
build will fail and error like this:
File "generator.py", line 139, in start
if "string" in attrs:
File "/usr/local/lib/python2.7/site-packages/_xmlplus/sax/xmlreader.py" \
, line 316, in __getitem__
return self._attrs[name]
KeyError: 0
This is an old issue and have been mentioned in commit 3ae0a76d.
There is no __contains__ in class AttributesImpl, python will use
__getitem__ in this place, so we will get error.
Let's use 'YYY in XXX.keys()' to avoid this issue.
2015- 8- 26 Luyao Huang <lhuang@redhat.com>
examples: small fix for nodestats.py example
Add nodestats.py in MANIFEST.in and add a
small description for nodestats.py in README
2015- 8- 3 Jiri Denemark <jdenemar@redhat.com>
Check return value of PyList_Append
libvirt_virDomainGetSecurityLabelList called PyList_Append without
checking its return value. While looking at it I noticed the function
did not properly check several other return values either so I fixed
them all.
https://bugzilla.redhat.com/show_bug.cgi?id=1249511
2015- 8- 3 Jiri Denemark <jdenemar@redhat.com>
Post-release version bump to 1.2.19
2015- 8- 3 Daniel Veillard <veillard@redhat.com>
Forgot to bump version to 1.2.18
2015- 7- 30 Peter Krempa <pkrempa@redhat.com>
iothread: Fix crash if virDomainGetIOThreadInfo returns error
The cleanup portion of libvirt_virDomainGetIOThreadInfo would try to
clean the returned structures but the count of iothreads was set to -1.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1248295
2015- 7- 17 Michal Privoznik <mprivozn@redhat.com>
examples: Introduce nodestats example
So, this is an exercise to show libvirt capabilities. Firstly, for
each host NUMA nodes some statistics are printed out, i.e. total
memory and free memory. Then, for each running domain, that has memory
strictly bound to certain host nodes, a small statistics of how much
memory it takes is printed out too. For instance:
# ./examples/nodestats.py
NUMA stats
NUMA nodes: 0 1 2 3
MemTotal: 3950 3967 3937 3943
MemFree: 66 56 42 41
Domain 'fedora':
Overall memory: 1536 MiB
Domain 'fedora22':
Overall memory: 2048 MiB
Domain 'fedora21':
Overall memory: 1024 MiB nodes 0-1
Node 0: 1024 MiB nodes 0-1
Domain 'gentoo':
Overall memory: 4096 MiB nodes 0-3
Node 0: 1024 MiB nodes 0
Node 1: 1024 MiB nodes 1
Node 2: 1024 MiB nodes 2
Node 3: 1024 MiB nodes 3
We can see 4 host NUMA nodes, all of them having roughly 4GB of RAM.
Yeah, all of them has nearly all the memory consumed. Then, there are
four domains running. For instance, domain 'fedora' has 1.5GB memory
which is not pinned onto any specific host NUMA node. Domain 'gentoo' on
the other hand has 4GB memory and has 4 NUMA nodes which are pinned 1:1
to host nodes.
2015- 6- 29 Pavel Boldin <pboldin@mirantis.com>
virPyDictToTypedParams: packing lists of values
Pack a list or a tuple of values passed to a Python method to the
multi-value parameter.
2015- 6- 28 Martin Kletzander <mkletzan@redhat.com>
Revert "Change livbirt version to 1.3.0 for the next release"
This reverts commit 751e016f09a6a0dd372667bdd2b322731718e359.
Since Admin API was deferred for a release and the minor version bump
didn't happen, it must not happen in libvirt-python either, for
compatibility reasons.
2015- 6- 16 Martin Kletzander <mkletzan@redhat.com>
Change livbirt version to 1.3.0 for the next release
Since the background for Admin API is merged upstream, we are bumping
the minor release version as discussed previously
2015- 6- 8 Jiri Denemark <jdenemar@redhat.com>
Provide symbolic names for typed parameters
https://bugzilla.redhat.com/show_bug.cgi?id=1222795
2015- 6- 5 Jiri Denemark <jdenemar@redhat.com>
Post-release version bump to 1.2.17
2015- 6- 1 Daniel P. Berrange <berrange@redhat.com>
Include tests in MANIFEST
The unit tests were missing from the tar.gz archives due to not
being listed in the MANIFEST.in file
2015- 5- 28 Jim Fehlig <jfehlig@suse.com>
Fix duplicate entries in AUTHORS
The generated AUTHORS file contains many duplicates. If an author
has N commits, there will be N entries for the author in AUTHORS.
Check if an author already exists in the list before appending.
While at it, add a .mailmap (derived from libivrt's .mailmap) to
futher tidy the generated AUTHORS list.
2015- 5- 20 Guido Günther <agx@sigxcpu.org>
Sort tuples on both items
In order to achieve reproducible builds[0] we want the items within
enums always generated in the same order so sort on both items in the
tuple.
[0] https://wiki.debian.org/ReproducibleBuilds/About
2015- 5- 20 Guido Günther <agx@sigxcpu.org>
Simplify sorting
funcs.keys() can't be None, only the empty array
2015- 5- 20 Guido Günther <agx@sigxcpu.org>
Sort dictionary keys
In order to achive reproducible builds[0] we want functions and enums
always generated in the same order.
[0] https://wiki.debian.org/ReproducibleBuilds/About
2015- 5- 11 Peter Krempa <pkrempa@redhat.com>
examples: Add example to make guest agent lifecycle event useful
This example allows to use the guest agent event and metadata to track
vCPU count set via the guest agent (agent-based onlining/offlining) and
keep it persistent accross domain restarts.
The daemon listens for the agent lifecycle event, and if it's received
it looks into doman's metadata to see whether a desired count was set
and issues the guest agent command.
2015- 5- 11 Peter Krempa <pkrempa@redhat.com>
Post-release version bump to 1.2.16
2015- 4- 22 Victor Stinner <victor.stinner@gmail.com>
libvirt-python: add classifiers to setup.py
Add the Python 3 classifier, needed by the caniusepython3 tool to check
if dependencies of a projects are Python 3 compatible:
https://caniusepython3.com/
2015- 4- 22 Victor Stinner <victor.stinner@gmail.com>
Add tox.ini to run tests on Python 2.6, 2.7 & 3.4
2015- 4- 22 Victor Stinner <victor.stinner@gmail.com>
sanitytest.py parameters are now optional
When called without parameters, sanitytest.py doesn't touch sys.path and
locates itself the patch to the libvirt-api.xml file using pkg-config.
This change makes possible to run sanitytest.py from tox.
2015- 4- 15 Ján Tomko <jtomko@redhat.com>
Implement the DEVICE_ADDED event
2015- 4- 2 Jiri Denemark <jdenemar@redhat.com>
Post-release version bump to 1.2.15
2015- 3- 28 Pavel Hrdina <phrdina@redhat.com>
Expose virDomainInterfacesAddresses to python binding
examples/Makefile.am:
* Add new file domipaddrs.py
examples/README:
* Add documentation for the python example
libvirt-override-api.xml:
* Add new symbol for virDomainInterfacesAddresses
libvirt-override.c:
* Hand written python api
Example:
$ python examples/domipaddrs.py qemu:///system f18
Interface MAC address Protocol Address
vnet0 52:54:00:20:70:3d ipv4 192.168.105.240/16
2015- 3- 26 Ján Tomko <jtomko@redhat.com>
Rename virDomainGetIOThreadsInfo to virDomainGetIOThreadInfo
2015- 3- 26 Ján Tomko <jtomko@redhat.com>
Rename virDomainIOThreadsInfoFree to virDomainIOThreadInfoFree
2015- 3- 19 Pavel Hrdina <phrdina@redhat.com>
Post-release version bump to 1.2.14
2015- 3- 11 John Ferlan <jferlan@redhat.com>
Support virDomainPinIOThread
Support the libvirt_virDomainSetIOThreads method using code that mimics
the existing libvirt_virDomainPinVcpuFlags method
The following is a sample session assuming guest 'iothr-gst' has IOThreads
configured (it's currently running, too)
>>> import libvirt
>>> con=libvirt.open("qemu:///system")
>>> dom=con.lookupByName('iothr-gst')
>>> dom.ioThreadsInfo()
[(1, [False, False, True, False]), (2, [False, False, False, True]), (3, [True, True, True, True])]
>>> cpumap=(True,True,True,False)
>>> dom.pinIOThread(3,cpumap)
0
>>> print dom.ioThreadsInfo()
[(1, [False, False, True, False]), (2, [False, False, False, True]), (3, [True, True, True, False])]
>>>
merge
2015- 3- 11 John Ferlan <jferlan@redhat.com>
Support virDomainGetIOThreadsInfo and virDomainIOThreadsInfoFree
Add support for the libvirt_virDomainGetIOThreadsInfo method. This
code mostly follows the libvirt_virDomainGetVcpuPinInfo method, but
also takes some from the libvirt_virNodeGetCPUMap method with respect
to building the cpumap into the returned tuple rather than two separate
tuples which vcpu pinning generates
Assuming two domains, one with IOThreads defined (eg, 'iothr-gst') and
one without ('noiothr-gst'), execute the following in an 'iothr.py' file:
import libvirt
con=libvirt.open("qemu:///system")
dom=con.lookupByName('iothr-gst')
print dom.ioThreadsInfo()
dom2=con.lookupByName('noiothr-gst')
print dom2.ioThreadsInfo()
$ python iothr.py
[(1, [False, False, True, False]), (2, [False, False, False, True]), (3, [True, True, True, True])]
[]
$
2015- 3- 5 Ján Tomko <jtomko@redhat.com>
Clarify description for virNodeGetSecurityModel
s/host/hypervisor/ to match the wording used by the C binding.
https://bugzilla.redhat.com/show_bug.cgi?id=1198518
2015- 1- 27 Daniel P. Berrange <berrange@redhat.com>
Post-release version bump to 1.2.13
2015- 1- 19 Pavel Hrdina <phrdina@redhat.com>
sanitytest: fix mapping test for virDomainDefineXMLFlags
The libvirt API has in the name "virDomain" but it's correctly mapped
into "virConnect" class. Create an exception in the sanity test.
2015- 1- 15 Eric Blake <eblake@redhat.com>
build: make it easier to backport event ids
In some cases, it is very easy for downstream distros to backport
enum values without requiring a .so bump. Keying the conditional
code off of the upstream version where the enum value was added
is not ideal, because downstream then has to patch that the feature
is available in their build that still reports an earlier version
number. For example, if RHEL 7 backports events from 1.2.11 into
a build based on 1.2.8, building the python bindings would warn:
libvirt-override.c: In function ‘libvirt_virConnectDomainEventRegisterAny’:
libvirt-override.c:6653:5: warning: enumeration value ‘VIR_DOMAIN_EVENT_ID_TUNABLE’ not handled in switch [-Wswitch]
switch ((virDomainEventID) eventID) {
^
libvirt-override.c:6653:5: warning: enumeration value ‘VIR_DOMAIN_EVENT_ID_AGENT_LIFECYCLE’ not handled in switch [-Wswitch]
The solution is simple - use feature-based probes instead of
version probes. Since we already scrape the XML API document of
whatever libvirt build we are binding, and that XML already
documents any downstream enum additions, we can use those as the
features for gating conditional compilation.
* generator.py (enum): Track event id names.
(buildStubs): Output define wrappers for events.
* libvirt-override.c
(libvirt_virConnectDomainEventBalloonChangeCallback)
(libvirt_virConnectDomainEventPMSuspendDiskCallback)
(libvirt_virConnectDomainEventDeviceRemovedCallback)
(libvirt_virConnectDomainEventTunableCallback)
(libvirt_virConnectDomainEventAgentLifecycleCallback)
(libvirt_virConnectDomainEventRegisterAny): Use them.
2014- 12- 16 Michal Privoznik <mprivozn@redhat.com>
Bump version to 1.2.12 for new dev cycle
2014- 12- 11 Richard W.M. Jones <rjones@redhat.com>
Add c_pointer method to classes.
This returns the raw C pointer to the underlying object, eg:
conn = libvirt.open(None)
print "0x%x" % conn.c_pointer() # returns virConnectPtr of the connection
dom = conn.lookupByName("test")
print "0x%x" % dom.c_pointer() # returns virDomainPtr of the domain
The reason behind this is to allow us to transparently pass Python dom
objects through the libguestfs Python API.
https://bugzilla.redhat.com/show_bug.cgi?id=1075164
2014- 12- 2 Tomoki Sekiyama <tomoki.sekiyama@hds.com>
override: iterate virDomainFSInfo.devAliases using ndevAliases
Currently devAliases in virDomainFSInfo struct are iterated as a
NULL-terminated list, but that is not guaranteed. It should use
ndevAliases which stores the number of the items in devAliases.
2014- 12- 1 Pavel Hrdina <phrdina@redhat.com>
fix examples
The dhcpleases example had an old usage of print function. The formating
of leases record was also wrong.
The event-test example had an old usage of exceptions.
It's mainly to make examples compatible with python3.
2014- 11- 24 Peter Krempa <pkrempa@redhat.com>
event: Add bindings for agent lifecycle event
Also add the example.
2014- 11- 24 Tomoki Sekiyama <tomoki.sekiyama@hds.com>
override: Implement bindings for virDomainGetFSInfo as domain.fsInfo
Implement the function which returns a list of tuples, that contains members
of virDomainFSInfo struct.
2014- 11- 11 Luyao Huang <lhuang@redhat.com>
Add dict check for setTime and allow pass 'seconds' parameter
When pass None or a empty dictionary to time, it will report
error. This commit allows a one-element dictionary which contains
just 'seconds' field, which results in the same as passing 0 for
'nseconds' field. Moreover, dict is checked for unknown fields.
2014- 11- 6 Jiri Denemark <jdenemar@redhat.com>
Check return value of libvirt_uintUnwrap
libvirt_virDomainSendKey didn't check whether libvirt_uintUnwrap
succeeded or not.
https://bugzilla.redhat.com/show_bug.cgi?id=1161039
2014- 11- 3 John Ferlan <jferlan@redhat.com>
Bump version to 1.2.11 for new dev cycle
2014- 10- 28 Dmitry Guryanov <dguryanov@parallels.com>
fix libvirt headers list
Since libvirt.h has been split out, generator.py
should be fixed accordingly. So add full list of header
files.
2014- 10- 22 Pavel Hrdina <phrdina@redhat.com>
virDomainBlockCopy: initialize flags to 0
An optional argument if not passed isn't modified by the
PyArg_ParseTuple function.
2014- 10- 22 Pavel Hrdina <phrdina@redhat.com>
flags cannot get right value for blockCopy function
When use blockCopy, flags cannot get a right value, because
PyArg_ParseTuple want to get 6 parameters and blockCopy only
pass 5. Flags will get a unpredictable value, this will make
the function fail with error:
unsupported flags (0x7f6c) in function qemuDomainBlockCopy
2014- 10- 22 Peter Krempa <pkrempa@redhat.com>
Fix rest of unsigned integer handling
As in the previous patch, fix all places where 'flags' is converted as a
signed argument to unsigned including the python code generator.
2014- 10- 22 Luyao Huang <lhuang@redhat.com>
Fix parsing of 'flags' argument for bulk stats functions
When 'flags' is set to
'libvirt.VIR_CONNECT_GET_ALL_DOMAINS_STATS_ENFORCE_STATS,
python will report a error:
OverflowError: signed integer is greater than maximum
as VIR_CONNECT_GET_ALL_DOMAINS_STATS_ENFORCE_STATS is defined as 1<<31.
This happens as PyArg_ParseTuple's formatting string containing 'i' as a
modifier expects a signed integer.
With python >= 2.3, 'I' means unsigned int and 'i' means int so we
should use 'I' in the formatting string.
See: https://docs.python.org/2/c-api/arg.html
2014- 10- 22 Peter Krempa <pkrempa@redhat.com>
Fix function name when parsing arguments in libvirt_virNodeAllocPages
The override function was copied&pasted from virConnectGetAllDomainStats
and the function name after the colon was not changed. Fix the issue as
an invalid name would appear in the error message.
2014- 10- 20 Luyao Huang <lhuang@redhat.com>
Improve error output when use getTime with a nonzero flags.
When give a nonzero flags to getTime, c_retval will get -1 and goto
cleanup. But py_retval still is NULL, so set py_retval = VIR_PY_NONE.
This will make the output message more correct.
2014- 10- 16 Pradipta Kr. Banerjee <pradipta.banerjee@gmail.com>
Change the comment in getPyNodeCPUCount method reflecting correct called methods
Comment mentions virGetNodeCPUMap whereas the actual method is
virNodeGetCPUMap. Similarly comment mentions virGetNodeInfo whereas the actual
method is virNodeGetInfo
2014- 10- 7 Pavel Hrdina <phrdina@redhat.com>
setup.py: fix rpm build to return 1 on error
2014- 10- 7 Martin Kletzander <mkletzan@redhat.com>
sanitytest: define long for python version >= 3
Commit c58c7f362aab37e4961407c2efc8a74925ed9c37 fixed 32-bit python
build but broke build with python3 due to the lack of 'long' in the
newer version of python. This patch aims to fix it with a simple
string comparison of sys.version and '3'.
2014- 10- 7 Martin Kletzander <mkletzan@redhat.com>
sanitytest: count with the fact that large enums can be long
On 32-bit systems, one new flag that has the value of 1 << 31, namely
VIR_CONNECT_GET_ALL_DOMAINS_STATS_ENFORCE_STATS, fails to fit into an
'int' on python and is therefore of type 'long'. Fix sanitytest to
count with such fact in order to avoid build failures on 32-bit systems.
2014- 10- 6 Martin Kletzander <mkletzan@redhat.com>
sanitytest: check for exported enums
We are already collecting list of enums exported and list of enums we
want to have available. Event though there was an issue with one enum
fixed with 014d9bbaf368b33a881f1d6b2fd8a5dd285a4f71, there was no test
for it and this commit tries to fix that.
2014- 10- 2 Pavel Hrdina <phrdina@redhat.com>
Post-release version bump for new dev cycle
2014- 9- 30 Pavel Hrdina <phrdina@redhat.com>
implement new tunable event
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1147639
2014- 9- 26 Michal Privoznik <mprivozn@redhat.com>
Implement new virNodeAllocPages API
2014- 9- 12 Michal Privoznik <mprivozn@redhat.com>
generator: Free strings after libvirt_charPtrWrap
https://bugzilla.redhat.com/show_bug.cgi?id=1140998
Up till bb3301ba the wrapper was freeing the passed strings for us.
However that changed after the commit. So now we don't free any
strings which results in memory leaks as reported upstream [1]:
==14265== 2,407 bytes in 1 blocks are definitely lost in loss record 1,457 of 1,550
==14265== at 0x4C2845D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==14265== by 0x5C46624: xdr_string (in /usr/lib64/libc-2.17.so)
==14265== by 0xCFD9FCD: xdr_remote_nonnull_string (remote_protocol.c:31)
==14265== by 0xCFDC2C8: xdr_remote_domain_get_xml_desc_ret (remote_protocol.c:1617)
==14265== by 0xCFF0811: virNetMessageDecodePayload (virnetmessage.c:407)
==14265== by 0xCFE68FB: virNetClientProgramCall (virnetclientprogram.c:379)
==14265== by 0xCFBE8B1: callFull.isra.2 (remote_driver.c:6578)
==14265== by 0xCFC7F04: remoteDomainGetXMLDesc (remote_driver.c:6600)
==14265== by 0xCF8167C: virDomainGetXMLDesc (libvirt.c:4380)
==14265== by 0xCC2C4DF: libvirt_virDomainGetXMLDesc (libvirt.c:1141)
==14265== by 0x4F12B93: PyEval_EvalFrameEx (in /usr/lib64/libpython2.7.so.1.0)
==14265== by 0x4F141AC: PyEval_EvalCodeEx (in /usr/lib64/libpython2.7.so.1.0)
The python documentation clearly advise us to call free() [2]. From
an example in their docs:
PyObject *res;
char *buf = (char *) malloc(BUFSIZ); /* for I/O */
if (buf == NULL)
return PyErr_NoMemory();
...Do some I/O operation involving buf...
res = PyString_FromString(buf);
free(buf); /* malloc'ed */
return res;
Moreover, instead of using VIR_FREE() (which we are not exporting),
I'll just go with bare free().
1: https://www.redhat.com/archives/libvir-list/2014-September/msg00736.html
2: https://docs.python.org/2/c-api/memory.html
2014- 9- 2 Peter Krempa <pkrempa@redhat.com>
override: Fix two uninitialized variables in convertDomainStatsRecord
py_record_domain and py_record_stats would be accessed uninitialized if
an out-of-memory condition would happen in the first loop. Unlikely, but
coverity complained.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1136354
2014- 9- 2 Pavel Hrdina <phrdina@redhat.com>
libvirt-override: fix some build warnings
Remove unused label 'cleanup' in 'libvirt_virConnectGetAllDomainStats'
function and remove unused variable 'conn' in function
'libvirt_virDomainListGetStats'.
2014- 9- 2 Michal Privoznik <mprivozn@redhat.com>
Post-release version bump for new dev cycle
2014- 9- 1 Pavel Hrdina <phrdina@redhat.com>
Implement API bindings for virDomainBlockCopy
2014- 9- 1 Pavel Hrdina <phrdina@redhat.com>
API: Implement bindings for virDomainListGetStats
Implement the function by returning a list of tuples instead the array
of virDomainStatsRecords and store the typed parameters as dict.
2014- 9- 1 Peter Krempa <pkrempa@redhat.com>
API: Implement bindings for virConnectGetAllDomainStats
Implement the function by returning a list of tuples instead the array
of virDomainStatsRecords and store the typed parameters as dict.
2014- 9- 1 Peter Krempa <pkrempa@redhat.com>
API: Skip 'virDomainStatsRecordListFree'
The new API function doesn't make sense to be exported in python. The
bindings will return native types instead of the struct array.
2014- 9- 1 Pavel Hrdina <phrdina@redhat.com>
generator: resolve one level of enum reference
In the libvirt.h we have one enum defined by references from another
enum and it leads in wrong order of definitons in python code. To
prevent this we should resolve that references before we generate the
python code.
For now we have only one level of references so we will count with that
in the generator but we should update it in the future to be more
flexible.
2014- 8- 19 Mo Yuxiang <Moyuxiang@huawei.com>
build: Fix build warning on libvirt-python
On compiling libvirt-python, we get such a warning:
libvirt-qemu-override.c: In function ‘libvirt_qemu_virConnectDomainQemuMonitorEventRegister’:
libvirt-qemu-override.c:304: warning: suggest explicit braces to avoid ambiguous ‘else’
Py_DECREF is a macro using if/else on older Python releases.
The solution is to add braces.
Python 2.7 and newer has the macro wrapped in a do { } while(0) block.
2014- 8- 11 Zhou Yimin <zhouyimin@huawei.com>
Fix libvirt_longlongWrap returning a very large value
If hypervisor is not Xen, the errs in struct _virDomainBlockStats will be -1.
But in KVM when we call domain.blockStats(), errs is 18446744073709551615.
To fix that, this patch has two changes:
1. Replace use of the PyLong_FromUnsignedLongLong with PyLong_FromLongLong
in function libvirt_longlongWrap
2. If the paramemter of libvirt_longlongWrap is unsigned long long,
use libvirt_ulonglongWrap instead because of above change.
After this patch, errs is -1 which is consistent with virDomainBlockStats api.
2014- 8- 4 Eric Blake <eblake@redhat.com>
maint: document use of libvirt's run script
Ever since libvirt commit 78c09530, it's easier to just use the
run script.
* README: Mention run script.
2014- 8- 4 Eric Blake <eblake@redhat.com>
Bump version to 1.2.8 for new dev cycle
2014- 7- 29 Jiri Denemark <Jiri.Denemark@gmail.com>
spec: Reorganize to satisfy buggy spectool
spectool parses a specfile and strips everything but a preamble.
However, if the first section is preceded by %if clause, it keeps it
there which then makes rpmbuild complain about unmatched %if. Let's make
the buggy tool happy by moving sections around so that the first one is
not in any conditional.
2014- 7- 22 Martin Kletzander <mkletzan@redhat.com>
Bump version to 1.2.7 for new dev cycle
2014- 6- 27 Nehal J Wani <nehaljw.kkd1@gmail.com>
Implement new virNetworkGetDHCPLeases API
This API returns a list of DHCP leases for all network interfaces
connected to the given virtual network or limited output just for one
interface if mac is specified.
Example Output:
[{'iface': 'virbr3', 'ipaddr': '192.168.150.181', 'hostname': 'ubuntu14',
'expirytime': 1403737495L, 'prefix': 24, 'clientid': None,
'mac': '52:54:00:e8:73:eb', 'iaid': None, 'type': 0},
{'iface': 'virbr3', 'ipaddr': '2001:db8:ca2:2:1::bd', 'hostname': 'fedora20-test',
'expirytime': 1403738587L, 'prefix': 64, 'clientid': '00:04:b1:d8:86:42:e1:6a:aa:cf:d5:86:94:23:6f:94:04:cd',
'mac': '52:54:00:5b:40:98', 'iaid': '5980312', 'type': 1}]
2014- 6- 25 Eric Blake <eblake@redhat.com>
maint: document development against uninstalled libvirt
Thanks to Dan's recent work in libvirt.git, it is much easier to
develop against uninstalled libvirt. Mention how.
* README: More details.
2014- 6- 25 Nehal J Wani <nehaljw.kkd1@gmail.com>
build: use correct int conversion in NodeGetFreePages
Commit c8ba859bc7 introduced a compiler warning while un-wrapping
a python object to uint in libvirt_virNodeGetFreePages.
On compiling libvirt-python against libvirt 1.2.6, we get:
libvirt-override.c: In function ‘libvirt_virNodeGetFreePages’:
libvirt-override.c:7811:9: warning: pointer targets in passing argument 2 of ‘libvirt_intUnwrap’ differ in signedness [-Wpointer-sign]
if (libvirt_intUnwrap(tmp, &pages[i]) < 0)
^
In file included from libvirt-override.c:24:0:
typewrappers.h:169:5: note: expected ‘int *’ but argument is of type ‘unsigned int *’
int libvirt_intUnwrap(PyObject *obj, int *val);
^
2014- 6- 20 Michal Privoznik <mprivozn@redhat.com>
Implement new virNodeGetFreePages API
The API expose information on host's free pages counts. For easier
access, in python this API returns a dictionary such as:
In [4]: conn.getFreePages([2048,1*1024*1024], -1, 5)
Out[4]:
{-1: {2048: 114, 1048576: 4},
0: {2048: 3, 1048576: 1},
1: {2048: 100, 1048576: 1},
2: {2048: 10, 1048576: 1},
3: {2048: 1, 1048576: 1}}
At the top level of the returned dictionary there's a pair of <NUMA
node> and another dictionary that contains detailed information on
each supported page size. The information then consists of fairs of
<page size> and <count of free pages>.
2014- 6- 19 Jason Andryuk <andryuk@aero.org>
Correct virDomainMigrateToURI3 definition
dconnuri is a string, so update the definition to match. Without this,
the generated python would fail when passed a string.
2014- 6- 18 Eric Blake <eblake@redhat.com>
build: provide wrapper makefile
After years of finger training, I'm so used to 'make check' just
working, that I lose quite a bit of time re-learning that in this
project, it is spelled 'python setup.py build check'. A shim
makefile bridges the gap.
* Makefile: New file.
2014- 6- 18 Eric Blake <eblake@redhat.com>
event-test: add missing events
Update the example to be able to trace all events.
* examples/event-test.py (main): Match full list of domain events.
(myDomainEventIOErrorReasonCallback)
(myDomainEventControlErrorCallback)
(myDomainEventBlockJobCallback, myDomainEventBlockJob2Callback)
(blockJobTypeToString, blockJobStatusToString): New functions.
2014- 6- 18 Eric Blake <eblake@redhat.com>
blockjob: support new BLOCK_JOB_2 event
Libvirt 1.2.6 is introducing a new block job event that passes disk
information by target device rather than host file name. At the
python level, we are just a passthrough, so we can reuse all the
existing code and just wire up the new enum value.
* libvirt-override-virConnect.py
(_dispatchDomainEventBlockPullCallback): Rename...
(_dispatchDomainEventBlockJobCallback): ...to this, and make
generic to both events.
* libvirt-override.c
(libvirt_virConnectDomainEventBlockJobCallback): Match naming.
(libvirt_virConnectDomainEventRegisterAny): Allow new registration.
2014- 6- 2 Martin Kletzander <mkletzan@redhat.com>
Bump version to 1.2.6 for new dev cycle
2014- 5- 27 Martin Kletzander <mkletzan@redhat.com>
fix leak in memoryStats with older python
libvirt_virDomainMemoryStats() function creates a dictionary without
any checks whether the additions were successful, whether the python
objects were created and, most importantly, without decrementing the
reference count on the objects added to the dictionary. This is
somehow not an issue with current upstream versions, however with
python 2.6 this exposes a leak in our bindings. The following patch
works on both old and new CPython versions and is already used in
other parts of the code, so it's also most straightforward.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1099860
2014- 5- 20 Michal Privoznik <mprivozn@redhat.com>
Implement virDomain{Get,Set}Time APIs
While the setter can be generated automatically, the getter is not.
However, it would be a lot easier if they both share the same logic:
a python dictionary to represent the time: dict['seconds'] to
represent seconds, and dict['nseconds'] to represent nanoseconds.
2014- 5- 16 Tomoki Sekiyama <tomoki.sekiyama@hds.com>
override: add virDomainFSFreeze and virDomainFSThaw API
Add binding for the new virDomainFSFreeze and virDomainFSThaw functions
added in libvirt 1.2.5. These require override since these take a list
of mountpoints path string. The methods are named 'fsFreeze' and
'fsThaw'.
2014- 5- 5 Martin Kletzander <mkletzan@redhat.com>
Bump version to 1.2.5 for new dev cycle
2014- 4- 7 Laine Stump <laine@laine.org>
build: add BuildRequires for python-lxml and python3-lxml
python-lxml is likely always already present anyway (due to so many
packages being dependent on it), but at least on my F20 system,
python3-lxml wasn't installed, leading to a failure of "python
setup.py rpm" without an informative error message.
2014- 4- 7 Laine Stump <laine@laine.org>
increment version post-release
As is now done with libvirt. git head will always have the version
number of the expected *next* release.
2014- 4- 2 Daniel P. Berrange <berrange@redhat.com>
Fix nosetests usage with python3
Add RPM deps on python/python3-nose, make RPM build run the
test suite and invoke nosetests using correct python binary
2014- 3- 31 Brian Rak <brak@gameservers.com>
Fix potential crash when setting partial cpu/memory/numa/interface limits on domains
The number of parameters in new_params is not guaranteed to be the
same as the number of parameters in params. Use the correct count
when freeing new_params to avoid crashes.
2014- 3- 25 Cole Robinson <crobinso@redhat.com>
setup.py: Allow running --help or clean without pkg-config
If pkg-config isn't installed, or a too old libvirt, we can't even
do 'python setup.py --help' without throwing an exception.
Have the pkg-config checks and validation only throw an exception if
being called from the 'build' step.
https://bugzilla.redhat.com/show_bug.cgi?id=1074170
2014- 3- 25 Cole Robinson <crobinso@redhat.com>
setup.py: Make have_libvirt_lxc a function
This means we call it twice for a build operation, but I don't think
that's a big deal.
2014- 3- 25 Cole Robinson <crobinso@redhat.com>
setup.py: Move module list building to its own function
Makes it a bit more clear what all that code is used for, rather than
intermixing it with function definitions.
Besides the comment additions, this is a no-op and just reindents the
block, into a function.
2014- 3- 25 Cole Robinson <crobinso@redhat.com>
setup.py: Remove unused import
2014- 3- 25 Eric Blake <eblake@redhat.com>
qemu: support arbitrary monitor events
Wrap the new virConnectDomainQemuMonitorEventRegister function
added in libvirt 1.2.3. This patch copies heavily from
network events (commit 6ea5be0) and from event loop callbacks
in libvirt-override.c, since in the libvirt_qemu module, we
must expose top-level functions rather than class members.
* generator.py (qemu_skip_function): Don't generate event code.
(qemuBuildWrappers): Delay manual portion until after imports.
* libvirt-qemu-override.py (qemuMonitorEventRegister)
(qemuMonitorEventDeregister): New file.
* libvirt-qemu-override.c
(libvirt_qemu_virConnectDomainQemuMonitorEventFreeFunc)
(libvirt_qemu_virConnectDomainQemuMonitorEventCallback)
(libvirt_qemu_virConnectDomainQemuMonitorEventRegister)
(libvirt_qemu_virConnectDomainQemuMonitorEventDeregister)
(libvirt_qemu_lookupPythonFunc, getLibvirtQemuDictObject)
(getLibvirtQemuModuleObject): New functions.
2014- 3- 25 Eric Blake <eblake@redhat.com>
event: fix domain reference bugs
Noticed this bug while adding qemu monitor events; there's probably
lots of other misuse of libvirt_virDomainPtrWrap, but for now I'm
limiting the fix to all copied-and-pasted event callbacks, since
I'm about to copy it again in the next patch. While at it, check
for failure to extract the "conn" key from the opaque callback
struct, and hoist that check to occur before we reach the point
where it is harder to undo on failure (the network code was the
only code that had it in the right place, but then it failed to
restore thread state on failure).
The graphics callback is still not clean; but incremental
improvements are better than nothing.
* libvirt-override.c (libvirt_virConnectDomainEventCallback)
(libvirt_virConnectDomainEvetnLifecycleCallback)
(libvirt_virConnectDomainEventGenericCallback)
(libvirt_virConnectDomainEventRTCChangeCallback)
(libvirt_virConnectDomainEventWatchdogCallback)
(libvirt_virConnectDomainEventIOErrorCallback)
(libvirt_virConnectDomainEventIOErrorReasonCallback)
(libvirt_virConnectDomainEventGraphicsCallback)
(libvirt_virConnectDomainEventBlockJobCallback)
(libvirt_virConnectDomainEventDiskChangeCallback)
(libvirt_virConnectDomainEventTrayChangeCallback)
(libvirt_virConnectDomainEventPMWakeupCallback)
(libvirt_virConnectDomainEventPMSuspendCallback)
(libvirt_virConnectDomainEventBalloonChangeCallback)
(libvirt_virConnectDomainEventPMSuspendDiskCallback)
(libvirt_virConnectDomainEventDeviceRemovedCallback): Don't pass
NULL to PyObject_CallMethod.
(libvirt_virConnectNetworkEventLifecycleCallback): Likewise, and
don't corrupt thread state.
2014- 3- 25 Martin Kletzander <mkletzan@redhat.com>
generator: Add virConnectDomainQemuMonitorEventCallback to skipped_types
2014- 3- 24 Eric Blake <eblake@redhat.com>
maint: balance {} usage
Emacs gets lost when finding function boundaries when #ifdef
sections do not have balanced {}.
* libvirt-override.c (libvirt_PyString_Check): New define.
(virPyDictToTypedParams): Avoid unbalanced {} across ifdef.
2014- 3- 24 Peter Krempa <pkrempa@redhat.com>
maint: Add ctags configuration file and ignore the output
Add the config file to ease creation of tags to help navigation in
editors.
2014- 3- 24 Eric Blake <eblake@redhat.com>
maint: set up preferred emacs settings
Copy the relevant settings from libvirt.git, so that emacs users
maintain the style previously used before the two repos split.
* .dir-locals.el: New file.
2014- 3- 21 Eric Blake <eblake@redhat.com>
maint: ignore .pyc files
* .gitignore: Add exemption.
2014- 3- 20 Cole Robinson <crobinso@redhat.com>
override: Return NULL on python failure in getCPUModelNames
Eric pointed this out on the last patch, but I pushed it before noticing
his message.
2014- 3- 20 Cole Robinson <crobinso@redhat.com>
override: GetCPUModelNames should return None on failure
Right now, on failure, libvirt.py doesn't raise an exception and just
returns -1 to the user.
2014- 3- 19 Daniel P. Berrange <berrange@redhat.com>
Add test for setting scheduler parameters
Add a test setting scheduler parameters to validate the
previous bugfix to strncpy of field names.
2014- 3- 19 Daniel P. Berrange <berrange@redhat.com>
Add support for running unit tests with nose
Make the 'python setup.py test' able to run unit tests
found under tests/ through the 'nosetests' command
2014- 3- 18 Michal Privoznik <mprivozn@redhat.com>
setPyVirTypedParameter: free whole return variable on error
The @ret value is built in a loop. However, if in one iteration
there's an error, we should free all the fields built so far. For
instance, if there's an error and the previous item was
type of VIR_TYPED_PARAM_STRING we definitely must free it.
2014- 3- 18 Michal Privoznik <mprivozn@redhat.com>
setPyVirTypedParameter: Copy full field name
In the setPyVirTypedParameter we try to produce virTypedParameter
array from a python dictionary. However, when copying field name into
item in returned array, we use strncpy() as the field name is fixed
length array. To determine its size we use sizeof() but mistakenly
dereference it resulting in sizeof(char) which equals to 1 byte.
Moreover, there's no need for using sizeof() when we have a global
macro to tell us the length of the field name:
VIR_TYPED_PARAM_FIELD_LENGTH.
And since array is allocated using VIR_ALLOC() we are sure the memory
is initially filled with zeros. Hence, there's no need to terminate
string we've just copied into field name with '\0' character. It's
there for sure too as we copy up to field length - 1.
2014- 3- 3 Daniel P. Berrange <berrange@redhat.com>
Post release version bump to 1.2.3
2014- 3- 2 Daniel Veillard <veillard@redhat.com>
Release of libvirt-python 1.2.2
2014- 2- 20 Martin Kletzander <mkletzan@redhat.com>
generator: Skip exporting only sentinels
When enum type has '_LAST' in its name, but is not the last type in
that enum, it's skipped even though it shouldn't be. Currently, this
is the case for only VIR_NETWORK_UPDATE_COMMAND_ADD_LAST inside an
enum virNetworkUpdateCommand.
Also, since _LAST types can have other enums instead of values, that
needs to be filtered out using a try-except when converting the value.
2014- 2- 13 Philipp Hahn <hahn@univention.de>
Fix stream related spelling mistakes
Consistent spelling of all-uppercase I/O.
2014- 2- 12 Eric Blake <eblake@redhat.com>
examples: demonstrate network events
Commit 6ea5be0 added network event callback support, so we might
as well demonstrate that it works by updating our example.
* examples/event-test.py: Add network event, fix typos.
2014- 2- 4 Eric Blake <eblake@redhat.com>
maint: ignore editor files
* .gitignore: Exclude emacs cruft.
2014- 2- 3 Eric Blake <eblake@redhat.com>
Merge tag 'v1.2.1'
Release of libvirt-python-1.2.1
2014- 1- 23 Robie Basak <robie.basak@canonical.com>
Fix calling of virStreamSend method
Change d40861 removed the 'len' argument from the virStreamSend
C level wrapper, but forgot to remove it from the python level
wrapper.
Reported-by: Robie Basak <robie.basak@canonical.com>
2014- 1- 16 Daniel Veillard <veillard@redhat.com>
Release of libvirt-python-1.2.1
2014- 1- 11 Doug Goldstein <cardoe@cardoe.com>
virStream.sendAll() fix raising an undeclared var
The exception is raised from the variable 'e', which was undeclared in
this context. Used code that is compatible with old and new Python
versions.
2014- 1- 2 Doug Goldstein <cardoe@cardoe.com>
Add space after comma for consistency with code style
2013- 12- 30 Doug Goldstein <cardoe@cardoe.com>
define __GNUC_PREREQ macro before using it
We brought over use of the __GNUC_PREREQ macro from libvirt but didn't
bring over the definition of it. This brings over the macro from libvirt
sources.
2013- 12- 12 Daniel P. Berrange <berrange@redhat.com>
Rewrite libvirt_charPtrUnwrap to work with Python 3.0->3.2
The PyUnicode_AsUTF8 method doesn't exist prior to Python 3.3.
It is also somewhat inefficient, so rewrite it to use an
intermediate PyBytes object.
2013- 12- 12 Daniel P. Berrange <berrange@redhat.com>
Add python3 to the automated build and RPM
This updates autobuild.sh to test the python3 build process.
The RPM specfile is changed to build a libvirt-python3 RPM
on Fedora > 18
2013- 12- 11 Daniel P. Berrange <berrange@redhat.com>
Skip network event callbacks in sanity test
2013- 12- 11 Daniel P. Berrange <berrange@redhat.com>
Fix return type in override method for virStreamRecv
The virStreamRecv override returns a PyObject not an int
2013- 12- 11 Daniel P. Berrange <berrange@redhat.com>
sanitytest: remove use of string.lower()
Call lower() directly on the string object instance, not
the class
2013- 12- 11 Daniel P. Berrange <berrange@redhat.com>
sanitytest: Fix broken comparison between int and string
Python2 was forgiving of a comparison between an int and string
but Python3 gets very upset.
2013- 12- 11 Daniel P. Berrange <berrange@redhat.com>
override: Switch virStreamSend wrapper to use libvirt_charPtrSizeUnwrap
Instead of using a 'z#i' format string to receive byte array,
use 'O' and then libvirt_charPtrSizeUnwrap. This lets us hide
the Python 3 vs 2 differences in typewrappers.c
2013- 12- 11 Daniel P. Berrange <berrange@redhat.com>
override: Conditionalize use of PyString_Check and PyInt_Check
The PyString and PyInt classes are gone in Python 3, so we must
conditionalize their use to be Python 2 only.
2013- 12- 11 Daniel P. Berrange <berrange@redhat.com>
typewrappers: PyInt/PyLong merge for Python3
In Python3 the PyInt / PyLong types have merged into a single
PyLong type. Conditionalize the use of PyInt to Python 2 only
2013- 12- 11 Daniel P. Berrange <berrange@redhat.com>
typewrappers: Replace use of PyString class
Replace use of PyString with either PyBytes or PyUnicode.
The former is used for buffers with explicit sizes, which
are used by APIs processing raw bytes.
2013- 12- 11 Daniel P. Berrange <berrange@redhat.com>
override: Replace PyInt_AsLong with helper
Replace use of the PyInt_AsLong libvirt_intUnwrap helper.
This isolates the need for Python3 specific code in one
place
2013- 12- 11 Daniel P. Berrange <berrange@redhat.com>
override: Replace Py{Int,Long}_FromLong with helpers
Replace use of the PyInt_FromLong and PyLong_FromLongLong
with libvirt_{int,uint,longlong,ulonglong}Wrap helpers.
This isolates the need for Python3 specific code in one
place.
2013- 12- 11 Daniel P. Berrange <berrange@redhat.com>
override: Replace PyString_AsString with libvirt_charPtrUnwrap
Replace calls to PyString_AsString with the helper method
libvirt_charPtrUnwrap. This isolates the code that will
change in Python3.
In making this change, all callers now have responsibility
for free'ing the string.
2013- 12- 11 Daniel P. Berrange <berrange@redhat.com>
override: Replace PyString_FromString with libvirt_constcharPtrWrap
Make use of libvirt_constcharPtrWrap in all override code,
to match generated code. This will isolate Python3 specific
changes in one place.
2013- 12- 11 Daniel P. Berrange <berrange@redhat.com>
sanitytest: Fix libvirtError class handling for Python 2.4
The Exception class hiearchy in Python 2.4 reports different
data types than in later Python versions. As a result the
type(libvirt.libvirtError) does not return 'type'. We just
special case handling of this class.
2013- 12- 11 Daniel P. Berrange <berrange@redhat.com>
override: Fix native module registration to work with Python3
The way native modules are registered has completely
changed, so the code must be #ifdef'd for Python2 & 3
2013- 12- 11 Daniel P. Berrange <berrange@redhat.com>
examples: Ensure we write bytes to the self-pipe
Strings in python3 default to unicode, so when writing to
the self-pipe we must be sure to use bytes by calling the
encode() method.
2013- 12- 11 Daniel P. Berrange <berrange@redhat.com>
examples: Invoke print("...") instead of print "..."
The 'print' method must be called as a function in python3,
ie with brackets.
2013- 12- 11 Daniel P. Berrange <berrange@redhat.com>
Don't free passed in args in libvirt_charPtrWrap / libvirt_charPtrSizeWrap
Functions should not make assumptions about the memory management
callers use for parameters
2013- 12- 11 Cédric Bosdonnat <cbosdonnat@suse.com>
Added python binding for the new network events API
The new network events code requires manual binding code to
be written.
2013- 12- 9 Doug Goldstein <cardoe@cardoe.com>
test: Invoke print("...") instead of print "..."
The 'print' statement no longer exists in Python 3 and now must be
called as a function. This is compatible down to Python 2.4 as we are
not using any special syntax of the function.
2013- 12- 9 Doug Goldstein <cardoe@cardoe.com>
override: Fix exception handling syntax
Python 3 no longer accepts 'except Exception, e:' as valid while Python
2.4 does not accept the new syntax 'except Exception as e:' so this uses
a fall back method that is compatible with both.
2013- 12- 9 Daniel P. Berrange <berrange@redhat.com>
generator: Sort enums and functions when generating code
To assist in diff comparisons between code generated with
different versions of Python, do an explicit sort of all
functions and enums.
2013- 12- 9 Daniel P. Berrange <berrange@redhat.com>
generator: Remove use of string.replace and string.find functions
Call the 'replace' and 'find' functions directly on the
string variables, instead of via the 'string' module.
Python3 only accepts the latter syntax
2013- 12- 9 Daniel P. Berrange <berrange@redhat.com>
generator: Update to use sort() 'key' param
The sort() method previously took either a comparator function
or a key function. Only the latter is supported in Python3.
2013- 12- 9 Daniel P. Berrange <berrange@redhat.com>
generator: Remove use of 'has_key' function
The code 'XXX.has_key(YYYY)' must be changed to be of
the form 'YYY in XXXX' which works in Python2 and 3
As an added complication, if 'YYY in XXX' is used against
an object overriding the '__getitem__' method it does not
work in Python 2.4. Instead we must use 'YYY in XXX.keys()'
2013- 12- 5 Doug Goldstein <cardoe@cardoe.com>
Update exception catching in generated code
Use a syntax for exception handling that works in both Python 2 and
Python 3. The new syntax is 'except Exception as e:' but this does not
work in older Pythons so we use the most compatible way by just catching
the exception and getting the type and the exception value after the
fact.
2013- 12- 5 Doug Goldstein <cardoe@cardoe.com>
generator: Support exceptions in Python 2 and 3
Use a syntax for exception handling that works in both Python 2 and
Python 3
2013- 12- 5 Doug Goldstein <cardoe@cardoe.com>
setup: Drop unused exception variable
Drop the unused exception variable in setup.py. This has the benefit
of dropping syntax that is not valid with Python 3.
2013- 12- 4 Daniel P. Berrange <berrange@redhat.com>
generator: Cast iterators to a list() explicitly
In python3 various methods list 'dict.keys()' do not
return a list, so we must explicitly cast the result.
2013- 12- 4 Daniel P. Berrange <berrange@redhat.com>
Revert "Optimize callback lookup in event handlers"
This reverts commit 084729e26905f574b8c057cc4c732b1b6ce852d3.
The PyImport_ImportModuleNoBlock method does not exist in
python 2.4
2013- 12- 4 Daniel P. Berrange <berrange@redhat.com>
Revert accidental change to exception handling syntax
The previous commit changed the exception handling syntax to
use 'as' instead of a ','. This doesn't work with python 2.4
2013- 12- 4 Daniel P. Berrange <berrange@redhat.com>
generator: Invoke print("...") instead of print "..."
The 'print' method must be called as a function in python3,
ie with brackets.
2013- 12- 4 Daniel P. Berrange <berrange@redhat.com>
generator: Remove string.lower(XXX) with XXX.lower()
In python3 the string.lower() method doesn't exist, the
lower() function can only be executed against a string
variable directly. Python2 supported both approaches so
this change is compatible
2013- 12- 4 Daniel P. Berrange <berrange@redhat.com>
generator: Don't use 'list' as a variable name
In python3 if we use 'list' as a variable name it causes it
to hide the corresponding 'list()' function from the entire
function that holds the variable.
2013- 12- 4 Daniel P. Berrange <berrange@redhat.com>
Optimize callback lookup in event handlers
The event handler code currently invokes PyImport_ImportModule
which is very heavyweight. This is not in fact required, since
we know the libvirt module has already been imported. We can
thus use PyImport_ImportModuleNoBlock and do away with the
global variables caching the imported module reference.
2013- 12- 4 Daniel P. Berrange <berrange@redhat.com>
Fix use of virDomainEventRegister in python bindings
If an app used the virDomainEventRegister binding instead
of the virDomainEventRegisterAny binding, it would never
have its callback invoked. This is because the code for
dispatching from the C libvirt_virConnectDomainEventCallback
method was totally fubar.
If DEBUG macro was set in the python build the error would
become visible
"libvirt_virConnectDomainEventCallback dom_class is not a class!"
The code in libvirt_virConnectDomainEventCallback was
inexplicably complex and has apparently never worked. The
fix is to write it the same way as the other callback handlers.
2013- 12- 3 Doug Goldstein <cardoe@cardoe.com>
setup: Use user requested python binary
When setup.py is kicked off with a python interpreter other than the
system 'python', (e.g. python2.7 setup.py build) the build process would
switch to 'python' and not use python2.7 as requested by the user. We
should always respect the user requested python interpreter and use it.
2013- 11- 28 Daniel P. Berrange <berrange@redhat.com>
Improve quality of sanitytest check
Validate that every public API method is mapped into the python
and that every python method has a sane C API.
2013- 11- 28 Daniel P. Berrange <berrange@redhat.com>
Skip copying manually written python for C APIs which don't exist
If the libvirt-override-virXXXX.py file has methods which call
C APIs that don't exist in the version of libvirt built against
we need to skip copying their code.
eg for 0.9.13 libvirt we should not copy the 'listAllDomains'
method.
The way this works is that it breaks the override file into
individual methods by looking for ' def '. It then collects
the contents until the next method start, whereupon it looks
for a libvirtmod.XXXXXX API call. It checks if the XXXXX part
is present in the XML description we have, and if not, it
discards the entire method.
2013- 11- 28 Daniel P. Berrange <berrange@redhat.com>
Fix misc RPM specfile flaws
Fix the RPM summary line, add placeholder %changelog tag,
make %setup quiet, add Url: tag and filter out bogus
provides and add example programs as docs.
2013- 11- 28 Daniel P. Berrange <berrange@redhat.com>
Fix code for avoiding overrides of non-existant functions
When reading/writing a global variable from inside a method
it must be declared as a global, otherwise a local variable
by the same name will be used.
Special case the virConnectListDomainsID method which is
bizarrely renamed for no obvious reason.
2013- 11- 28 Daniel P. Berrange <berrange@redhat.com>
Deal with old filenames for events/error functions
Older libvirt has files named 'events' and 'virterror'
rather than 'virevent' and 'virerror'. This is visible
in the API XML files. We must look for both names to
ensure we don't lose generation of methods with older
versions of libvirt.
2013- 11- 27 Daniel P. Berrange <berrange@redhat.com>
Add missing binding of security model/label APIs
The virNodeGetSecurityModel, virDomainGetSecurityLabel and
virDomainGetSecurityLabelList methods were disabled in the
python binding for inexplicable reasons.
2013- 11- 27 Daniel P. Berrange <berrange@redhat.com>
Avoid generating the methods in multiple classes
The python code generator tries to figure out what class a
method should be in by looking at the list of arguments for
any which are object types. Unfortunately missing break
statements meant that methods which have multiple object
arguments (eg migrate as a virDomainPtr followed by a
virConnectPtr) got added to multiple classes.
The following incorrect methods are removed by this change
virStream.download (dup of virStorageVol.download)
virStream.screenshot (dup of virDomain.screenshot)
virStream.upload (dup of virStorageVol.upload)
virConnect.migrate (dup of virDomain.migrate)
virConnect.migrate2 (dup of virDomain.migrate2)
virConnect.migrate3 (dup of virDomain.migrate3)
virConnect.migrateToURI3 (dup of virDomain.migrateToURI3)
2013- 11- 27 Daniel P. Berrange <berrange@redhat.com>
Make block pull event dispatcher private
The method dispatchDomainEventBlockPullCallback which is
used internally to dispatch block pull events to the python
application code was missing the leading '_', to denote that
it was private. All other event callback helpers have a
leading '_'. No application should have been using this so
it is justifiable to rename it.
2013- 11- 27 Daniel P. Berrange <berrange@redhat.com>
Don't include virDomainSnapshotRef in python API
The reference counting API is for internal use only. Attempts
to use it from python application code will cause havoc.
2013- 11- 26 Doug Goldstein <cardoe@cardoe.com>
Call virGetLastError from mod rather than py wrapper
All other code always calls the methods from the mod rather than using
the python wrapper so this matches the state of all other callers.
2013- 11- 26 Don Dugger <donald.d.dugger@intel.com>
Return right error code for baselineCPU
This Python interface code is returning a -1 on errors for the
`baselineCPU' API. Since this API is supposed to return a pointer
the error return value should really be VIR_PY_NONE.
2013- 11- 26 Martin Kletzander <mkletzan@redhat.com>
Make setup.py executable
2013- 11- 26 Daniel P. Berrange <berrange@redhat.com>
Update README file contents and add HACKING file
The previous README file from the python code is more like a
HACKING file. Rename it and update the content. Then add a
basic README file
2013- 11- 25 Eric Blake <eblake@redhat.com>
maint: next release is 1.2.0
No other hits for:
git grep '1\.1\.5'
* libvirt-utils.h: Fix comment.
2013- 11- 22 Daniel P. Berrange <berrange@redhat.com>
Ensure API overrides only used if API exists
Entries in the -overrides.xml files should only be recorded
if the API also exists in the main API XML file.
2013- 11- 22 Daniel P. Berrange <berrange@redhat.com>
Relax min required libvirt to version 0.9.11
2013- 11- 22 Doug Goldstein <cardoe@cardoe.com>
virConnectGetCPUModelNames API appeared in 1.1.3
2013- 11- 22 Daniel P. Berrange <berrange@redhat.com>
VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED appeared in 1.1.1
2013- 11- 22 Doug Goldstein <cardoe@cardoe.com>
virDomainCreateXMLWithFiles and virDomainCreateWithFiles APIs appeared in 1.1.1
virDomainCreateXMLWithFiles() and virDomainCreateWithFiles() were not
added to libvirt until 1.1.1
2013- 11- 22 Doug Goldstein <cardoe@cardoe.com>
virDomainMigrate3 and virDomainMigrateToURI3 appeared in 1.1.0
The functions virDomainMigrate3 and virDomainMigrateToURI3 were not
added to libvirt until v1.1.0.
2013- 11- 22 Doug Goldstein <cardoe@cardoe.com>
virTypedParams* API appeared in 1.0.2 and used in 1.1.0
When building against versions of libvirt prior to 1.0.2, we can not
provide wrappers for virTypedParams* APIs. In addition we don't need
to have the helper APIs until 1.1.0 when the first API we wrap starts
to use them.
2013- 11- 22 Doug Goldstein <cardoe@cardoe.com>
virDomainMigrateGetCompressionCache API appeared in 1.0.3
2013- 11- 22 Doug Goldstein <cardoe@cardoe.com>
virDomainGetJobStats API appeared in 1.0.3
2013- 11- 22 Doug Goldstein <cardoe@cardoe.com>
virNodeGetCPUMap API appeared in 1.0.0
2013- 11- 22 Daniel P. Berrange <berrange@redhat.com>
VIR_DOMAIN_EVENT_ID_PMSUSPEND_DISK appeared in 1.0.0
2013- 11- 22 Doug Goldstein <cardoe@cardoe.com>
virStoragePoolListAllVolumes API appeared in 0.10.2
2013- 11- 22 Doug Goldstein <cardoe@cardoe.com>
virNode{Get,Set}MemoryParameters API appeared in 0.10.2
2013- 11- 22 Doug Goldstein <cardoe@cardoe.com>
virConnectListAll* APIs appeared in 0.10.2
2013- 11- 22 Daniel P. Berrange <berrange@redhat.com>
virDomainQemuAgentCommand appeared in 0.10.0
2013- 11- 22 Doug Goldstein <cardoe@cardoe.com>
virDomainPinEmulator and virDomainGetEmulatorPinInfo APIs appeared in 0.10.0
2013- 11- 22 Daniel P. Berrange <berrange@redhat.com>
VIR_DOMAIN_EVENT_ID_BALLOON_CHANGED appeared in 0.10.0
2013- 11- 22 Doug Goldstein <cardoe@cardoe.com>
virConnect{Unr,R}egisterCloseCallback API appeared in 0.10.0
2013- 11- 22 Doug Goldstein <cardoe@cardoe.com>
virDomainSnapshotListAllChildren API appeared in 0.9.13
2013- 11- 22 Doug Goldstein <cardoe@cardoe.com>
virConnectListAllDomains API appeared in 0.9.13
2013- 11- 22 Doug Goldstein <cardoe@cardoe.com>
virDomainListAllSnapshots API appeared in 0.9.13
2013- 11- 22 Doug Goldstein <cardoe@cardoe.com>
Don't build LXC module when building less than 1.0.2
The functions that the LXC module wraps did not appear until 1.0.2 so we
can't build the module unless we're building against 1.0.2 or newer.
2013- 11- 22 Doug Goldstein <cardoe@cardoe.com>
Create array of modules to be built
Create an array of modules to be built to allow for flexibility to
enable or disable some modules in the future and allow for additional
modules to be added easily
2013- 11- 22 Doug Goldstein <cardoe@cardoe.com>
Break generator.py to be called per module
Since we don't always want to build all the modules, and there might be
more modules added in the future but we want to retain backwards
compatibility with older libvirts, change generator.py to be called once
per module instead of with all modules at once.
2013- 11- 22 Daniel P. Berrange <berrange@redhat.com>
Setup distutils build system
Create a setup.py for building libvirt python code and add
supporting files
2013- 11- 22 Daniel P. Berrange <berrange@redhat.com>
Add execute permission for sanitytest.py
2013- 11- 22 Daniel P. Berrange <berrange@redhat.com>
Add build/ to python module path for sanitytest.py
The generated libvirt.py modules will be in the build/
directory, so santitytest.py must use that directory.
2013- 11- 22 Doug Goldstein <cardoe@cardoe.com>
Import some virTypedParams* APIs from libvirt
virTypedParamsClear() and virTypedParamsFree() were introduced in
libvirt 1.0.2. In an effort to keep the code clean bring these two
functions to libvirt-python if we're building against a version of
libvirt that's older than 1.0.2
2013- 11- 22 Doug Goldstein <cardoe@cardoe.com>
Import LIBVIR_CHECK_VERSION macro from libvirt
Add LIBVIR_CHECK_VERSION from libvirt upstream so that we can check the
version of the library we are compiling against and support a range of
libvirt versions. The macro was added to libvirt in 1.2.0 so we must
provide it if its not defined.
2013- 11- 22 Daniel P. Berrange <berrange@redhat.com>
Import VIR_FORCE_CLOSE macro from libvirt
Import the macro for safely closing file descriptors
2013- 11- 22 Daniel P. Berrange <berrange@redhat.com>
Remove use of virStrcpyStatic
2013- 11- 22 Daniel P. Berrange <berrange@redhat.com>
Import VIR_ALLOC / VIR_ALLOC_N / VIR_REALLOC_N functions
Import the libvirt memory allocation functions, stripping the OOM
testing and error reporting pieces.
2013- 11- 22 Daniel P. Berrange <berrange@redhat.com>
Import code annotation macros from libvirt
Import ATTRIBUTE_RETURN_CHECK, ATTRIBUTE_UNUSED &
ATTRIBUTE_NONNULL macros
2013- 11- 22 Daniel P. Berrange <berrange@redhat.com>
Import gnulib's ignore_value macro
2013- 11- 22 Daniel P. Berrange <berrange@redhat.com>
Import gnulib's xalloc_oversized macro
2013- 11- 22 Daniel P. Berrange <berrange@redhat.com>
Add decl of MIN macro
2013- 11- 22 Daniel P. Berrange <berrange@redhat.com>
Import STREQ macro from libvirt
2013- 11- 22 Daniel P. Berrange <berrange@redhat.com>
Update header file includes
We're no longer using automake, so <config.h> files are not
required. Also remove of all libvirt internal util header
files. Reference generated header files in build/ subdir.
2013- 11- 22 Daniel P. Berrange <berrange@redhat.com>
Update generator for new code layout
Change the generator.py to
- Take XML API file names on command line
- Generate data in build/ directory instead of cwd
2013- 11- 22 Daniel P. Berrange <berrange@redhat.com>
Remove obsolete Makefile.am
We are no longer using automake, so Makefile.am is obsolete
2013- 11- 22 Daniel P. Berrange <berrange@redhat.com>
Move python example programs into python/examples/ subdirectory
2013- 11- 22 Daniel P. Berrange <berrange@redhat.com>
Mostly revert "python: remove virConnectGetCPUModelNames from globals"
This reverts commit 6b90d7428d72e92db292a9228c44701bfd5003c9.
The original problem was that libvirt_virConnectGetCPUModelNames
was listed twice in the exports table, once automatically from
the generator and once from the manual override. We merely needed
to list it in the skip_impl list, and not delete the manually
written code entirely.
2013- 11- 21 Doug Goldstein <cardoe@cardoe.com>
python: remove virConnectGetCPUModelNames from globals
Commit de51dc9c9aed0e615c8b301cccb89f4859324eb0 primarily added
virConnectGetCPUModelNames as libvirt.getCPUModelNames(conn, arch)
instead of libvirt.virConnect.getCPUModelNames(arch) so revert the code
that does the former while leaving the code that does the later.
This is the rest of the patch that was ACK'd by Dan but I committed only
the partial patch in 6a8b8ae.
2013- 11- 21 Doug Goldstein <cardoe@cardoe.com>
python: remove virConnectGetCPUModelNames from globals
Commit de51dc9c9aed0e615c8b301cccb89f4859324eb0 primarily added
virConnectGetCPUModelNames as libvirt.getCPUModelNames(conn, arch)
instead of libvirt.virConnect.getCPUModelNames(arch) so revert the code
that does the former while leaving the code that does the later.
2013- 11- 20 Eric Blake <eblake@redhat.com>
maint: fix comma style issues: python
Most of our code base uses space after comma but not before;
fix the remaining uses before adding a syntax check.
* python/libvirt-override.c: Consistently use commas.
2013- 11- 19 Doug Goldstein <cardoe@cardoe.com>
Add missing break to switch-case block
The case label for VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED did not have its
own break statement but relied on falling through which we probably
don't want.
2013- 10- 22 Marian Neagul <marian@info.uvt.ro>
python: Fix Create*WithFiles filefd passing
Commit d76227be added functions virDomainCreateWithFiles and
virDomainCreateXMLWithFiles, but there was a little piece missing in
python bindings. This patch fixes proper passing of file descriptors
in the overwrites of these functions.
2013- 10- 21 Daniel P. Berrange <berrange@redhat.com>
Don't link virt-login-shell against libvirt.so (CVE-2013-4400)
The libvirt.so library has far too many library deps to allow
linking against it from setuid programs. Those libraries can
do stuff in __attribute__((constructor) functions which is
not setuid safe.
The virt-login-shell needs to link directly against individual
files that it uses, with all library deps turned off except
for libxml2 and libselinux.
Create a libvirt-setuid-rpc-client.la library which is linked
to by virt-login-shell. A config-post.h file allows this library
to disable all external deps except libselinux and libxml2.
2013- 10- 14 Eric Blake <eblake@redhat.com>
maint: avoid 'const fooPtr' in python bindings
'const fooPtr' is the same as 'foo * const' (the pointer won't
change, but it's contents can). But in general, if an interface
is trying to be const-correct, it should be using 'const foo *'
(the pointer is to data that can't be changed).
Fix up offenders in the python bindings.
* python/generator.py (py_types): Drop useless conversions.
* python/libvirt-override.c (getPyVirTypedParameter)
(setPyVirTypedParameter): Use intended type.
2013- 9- 30 Michal Privoznik <mprivozn@redhat.com>
python: Document virNodeGetInfo bug
The memory size in virNodeGetInfo python API binding is reported in MiB
instead of KiB (like we have in C struct). However, there already might
be applications out there relying on this inconsistence so we can't
simply fix it. Document this sad fact as known bug.
2013- 9- 23 Giuseppe Scrivano <gscrivan@redhat.com>
python: add bindings for virConnectGetCPUModelNames
2013- 9- 23 Giuseppe Scrivano <gscrivan@redhat.com>
libvirt: add new public API virConnectGetCPUModelNames
The new function virConnectGetCPUModelNames allows to retrieve the list
of CPU models known by the hypervisor for a specific architecture.
2013- 9- 20 Daniel P. Berrange <berrange@redhat.com>
Fix potential use of uninitialized value in virDomainGetVcpuPinInfo
The virDomainGetVcpuPinInfo python wrapper had a potential use of
uninitialized values
2013- 9- 10 Oskari Saarenmaa <os@ohmu.fi>
docs, comments: minor typo fixes
2013- 9- 4 Eric Blake <eblake@redhat.com>
build: enforce makefile conditional style
Automake has builtin support to prevent botched conditional nesting,
but only if you use:
if FOO
else !FOO
endif !FOO
An example error message when using the wrong name:
daemon/Makefile.am:378: error: else reminder (LIBVIRT_INIT_SCRIPT_SYSTEMD_TRUE) incompatible with current conditional: LIBVIRT_INIT_SCRIPT_SYSTEMD_FALSE
daemon/Makefile.am:381: error: endif reminder (LIBVIRT_INIT_SCRIPT_SYSTEMD_TRUE) incompatible with current conditional: LIBVIRT_INIT_SCRIPT_SYSTEMD_FALSE
As our makefiles tend to have quite a bit of nested conditionals,
it's better to take advantage of the benefits of the build system
double-checking that our conditionals are well-nested, but that
requires a syntax check to enforce our usage style.
Alas, unlike C preprocessor and spec files, we can't use indentation
to make it easier to see how deeply nesting goes.
* cfg.mk (sc_makefile_conditionals): New rule.
* daemon/Makefile.am: Enforce the style.
* gnulib/tests/Makefile.am: Likewise.
* python/Makefile.am: Likewise.
* src/Makefile.am: Likewise.
* tests/Makefile.am: Likewise.
* tools/Makefile.am: Likewise.
2013- 9- 3 Ján Tomko <jtomko@redhat.com>
Fix leaks in python bindings
https://bugzilla.redhat.com/show_bug.cgi?id=1003828
2013- 8- 29 Guan Qiang <hzguanqiang@corp.netease.com>
python: Fix a PyList usage mistake
Fix PyList usage mistake in Function libvirt_lxc_virDomainLxcOpenNamespace.
https://bugzilla.redhat.com/show_bug.cgi?id=1002383
2013- 8- 23 Claudio Bley <cbley@av-test.de>
python: simplify complicated conditional assignment
2013- 8- 23 Claudio Bley <cbley@av-test.de>
Test for object identity when checking for None in Python
Consistently use "is" or "is not" to compare variables to None,
because doing so is preferrable, as per PEP 8
(http://www.python.org/dev/peps/pep-0008/#programming-recommendations):
> Comparisons to singletons like None should always be done with is or
> is not, never the equality operators.
2013- 8- 22 Guido Günther <agx@sigxcpu.org>
python: Use RELRO_LDFLAGS and NO_INDIRECT_LDFLAGS
A readonly GOT and detecting indirect linkage is useful here too.
2013- 7- 30 Daniel P. Berrange <berrange@redhat.com>
Delete obsolete / unused python test files
The python/tests directory contains a number of so called
"tests" for the python API. These are all hardcoded to
look for Xen and cannot be run in any automated fashion,
and no one is ever manually running them. Given that they
don't meaningully contribute to the test coverage, delete
them.
For some reason these tests were also copied into the
filesystem as part of 'make install'. The change to the
RPM in commit 3347a4203278ec93d7b0ceb88b5ed10e4f14765c
caused a build failure, since it removed the code which
deleted these installed tests.
2013- 7- 29 Cole Robinson <crobinso@redhat.com>
python: Drop TODO
File hasn't been really touched for 7 years. And with recent rawhide
changes it contributed to an RPM build failure. Let's drop it.
This also removes installation of a libvirt-python doc dir, so drop
handling of it from the RPM spec.
2013- 7- 19 Eric Blake <eblake@redhat.com>
maint: split long lines in Makefiles
Makefiles are another easy file to enforce line limits.
Mostly straightforward; interesting tricks worth noting:
src/Makefile.am: $(confdir) was already defined, use it in more places
tests/Makefile.am: path_add and VG required some interesting compression
* cfg.mk (sc_prohibit_long_lines): Add another test.
* Makefile.am: Fix offenders.
* daemon/Makefile.am: Likewise.
* docs/Makefile.am: Likewise.
* python/Makefile.am: Likewise.
* src/Makefile.am: Likewise.
* tests/Makefile.am: Likewise.
2013- 7- 18 Jiri Denemark <jdenemar@redhat.com>
Add VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED event
2013- 7- 18 Daniel P. Berrange <berrange@redhat.com>
Introduce new domain create APIs to pass pre-opened FDs to LXC
With container based virt, it is useful to be able to pass
pre-opened file descriptors to the container init process.
This allows for containers to be auto-activated from incoming
socket connections, passing the active socket into the container.
To do this, introduce a pair of new APIs, virDomainCreateXMLWithFiles
and virDomainCreateWithFiles, which accept an array of file
descriptors. For the LXC driver, UNIX file descriptor passing
will be used to send them to libvirtd, which will them pass
them down to libvirt_lxc, which will then pass them to the container
init process.
This will only be implemented for LXC right now, but the design
is generic enough it could work with other hypervisors, hence
I suggest adding this to libvirt.so, rather than libvirt-lxc.so
2013- 7- 15 Guannan Ren <gren@redhat.com>
python: return dictionary without value in case of no blockjob
Currently, when there is no blockjob, dom.blockJobInfo('vda')
still reports error because it doesn't distinguish return value 0 from -1.
libvirt.libvirtError: virDomainGetBlockJobInfo() failed
virDomainGetBlockJobInfo() API return value:
-1 in case of failure, 0 when nothing found, 1 found.
And use PyDict_SetItemString instead of PyDict_SetItem when key is
of string type. PyDict_SetItemString increments key/value reference
count, so call Py_DECREF() for value. For key, we don't need to
do this, because PyDict_SetItemString will handle it internally.
2013- 7- 10 Daniel P. Berrange <berrange@redhat.com>
Convert 'int i' to 'size_t i' in python/ files
Convert the type of loop iterators named 'i', 'j', k',
'ii', 'jj', 'kk', to be 'size_t' instead of 'int' or
'unsigned int', also santizing 'ii', 'jj', 'kk' to use
the normal 'i', 'j', 'k' naming
2013- 7- 10 Michal Privoznik <mprivozn@redhat.com>
viralloc: Report OOM error on failure
Similarly to VIR_STRDUP, we want the OOM error to be reported in
VIR_ALLOC and friends.
2013- 6- 24 Jiri Denemark <jdenemar@redhat.com>
python: Add bindings for extensible migration APIs
The patch implements wrappers for virDomainMigrate3 and
virDomainMigrateToURI3.
2013- 6- 24 Jiri Denemark <jdenemar@redhat.com>
Extensible migration APIs
This patch introduces two new APIs virDomainMigrate3 and
virDomainMigrateToURI3 that may be used in place of their older
variants. These new APIs take optional migration parameters (such as
bandwidth, domain XML, ...) in an array of virTypedParameters, which
makes adding new parameters easier as there's no need to introduce new
APIs whenever a new migration parameter needs to be added. Both APIs are
backward compatible and will automatically use older migration calls in
case the new calls are not supported as long as the typed parameters
array does not contain any parameter which was not supported by the
older calls.
2013- 5- 28 Eric Blake <eblake@redhat.com>
syntax: prefer space after semicolon in for loop
I noticed several unusual spacings in for loops, and decided to
fix them up. See the next commit for the syntax check that found
all of these.
* examples/domsuspend/suspend.c (main): Fix spacing.
* python/libvirt-override.c: Likewise.
* src/conf/interface_conf.c: Likewise.
* src/security/virt-aa-helper.c: Likewise.
* src/util/virconf.c: Likewise.
* src/util/virhook.c: Likewise.
* src/util/virlog.c: Likewise.
* src/util/virsocketaddr.c: Likewise.
* src/util/virsysinfo.c: Likewise.
* src/util/viruuid.c: Likewise.
* src/vbox/vbox_tmpl.c: Likewise.
* src/xen/xen_hypervisor.c: Likewise.
* tools/virsh-domain-monitor.c (vshDomainStateToString): Drop
default case, to let compiler check us.
* tools/virsh-domain.c (vshDomainVcpuStateToString): Likewise.
2013- 5- 21 Osier Yang <jyang@redhat.com>
python: Remove the whitespace before ";"
2013- 5- 20 Eric Blake <eblake@redhat.com>
maint: use LGPL correctly
Several files called out COPYING or COPYING.LIB instead of using
the normal boilerplate. It's especially important that we don't
call out COPYING from an LGPL file, since COPYING is traditionally
used for the GPL. A few files were lacking copyright altogether.
* src/rpc/gendispatch.pl: Add missing copyright.
* Makefile.nonreentrant: Likewise.
* src/check-symfile.pl: Likewise.
* src/check-symsorting.pl: Likewise.
* src/driver.h: Likewise.
* src/internal.h: Likewise.
* tools/libvirt-guests.sh.in: Likewise.
* tools/virt-pki-validate.in: Mention copyright in comment, not just code.
* tools/virt-sanlock-cleanup.in: Likewise.
* src/rpc/genprotocol.pl: Spell out license terms.
* src/xen/xend_internal.h: Likewise.
* src/xen/xend_internal.c: Likewise.
* Makefile.am: Likewise.
* daemon/Makefile.am: Likewise.
* docs/Makefile.am: Likewise.
* docs/schemas/Makefile.am: Likewise.
* examples/apparmor/Makefile.am: Likewise.
* examples/domain-events/events-c/Makefile.am: Likewise.
* examples/dominfo/Makefile.am: Likewise.
* examples/domsuspend/Makefile.am: Likewise.
* examples/hellolibvirt/Makefile.am: Likewise.
* examples/openauth/Makefile.am: Likewise.
* examples/python/Makefile.am: Likewise.
* examples/systemtap/Makefile.am: Likewise.
* examples/xml/nwfilter/Makefile.am: Likewise.
* gnulib/lib/Makefile.am: Likewise.
* gnulib/tests/Makefile.am: Likewise.
* include/Makefile.am: Likewise.
* include/libvirt/Makefile.am: Likewise.
* python/Makefile.am: Likewise.
* python/tests/Makefile.am: Likewise.
* src/Makefile.am: Likewise.
* tests/Makefile.am: Likewise.
* tools/Makefile.am: Likewise.
* configure.ac: Likewise.
2013- 5- 9 Daniel P. Berrange <berrange@redhat.com>
Fix build of python bindings on Python 2.4
The PyDict_Next method on Python <= 2.4 used 'int' instead
of "Py_ssize_t" for the 'pos' parameter
2013- 5- 6 Eric Blake <eblake@redhat.com>
build: clean up stray files found by 'make distcheck'
'make distcheck' complained:
ERROR: files left in build directory after distclean:
./python/libvirt.pyc
./tests/commandhelper.log
Problems introduced in commits f015495 and 25ea8e4 (both v1.0.3).
* tests/commandtest.c (test21): Check (and clean) log file.
* tests/commanddata/test21.log: New file.
* python/Makefile.am (CLEANFILES): Clean up compiled python files.
2013- 5- 2 Eric Blake <eblake@redhat.com>
build: always include sanitytest in tarball
The libvirt 1.0.5 tarball is missing a file which renders 'make
check' broken; first reported on list by Guido Günther.
* python/Makefile.am (EXTRA_DIST): Hoist sanitytest.py out of
HAVE_PYTHON conditional.
2013- 5- 2 Michal Privoznik <mprivozn@redhat.com>
virutil: Move string related functions to virstring.c
The source code base needs to be adapted as well. Some files
include virutil.h just for the string related functions (here,
the include is substituted to match the new file), some include
virutil.h without any need (here, the include is removed), and
some require both.
2013- 4- 19 Eric Blake <eblake@redhat.com>
docs: fix usage of 'onto'
http://www.uhv.edu/ac/newsletters/writing/grammartip2009.07.01.htm
(and several other sites) give hints that 'onto' is best used if
you can also add 'up' just before it and still make sense. In many
cases in the code base, we really want the two-word form, or even
a simplification to just 'on' or 'to'.
* docs/hacking.html.in: Use correct 'on to'.
* python/libvirt-override.c: Likewise.
* src/lxc/lxc_controller.c: Likewise.
* src/util/virpci.c: Likewise.
* daemon/THREADS.txt: Use simpler 'on'.
* docs/formatdomain.html.in: Better usage.
* docs/internals/rpc.html.in: Likewise.
* src/conf/domain_event.c: Likewise.
* src/rpc/virnetclient.c: Likewise.
* tests/qemumonitortestutils.c: Likewise.
* HACKING: Regenerate.
2013- 4- 18 Osier Yang <jyang@redhat.com>
syntax-check: Only allows to include public headers in external tools
With this patch, include public headers in "" form is only allowed
for "internal.h". And only the external tools (examples|tools|python
|include/libvirt) can include the public headers in <> form.
2013- 3- 26 Guannan Ren <gren@redhat.com>
python: set default value to optional arguments
When prefixing with string (optional) or optional in the description
of arguments to libvirt C APIs, in python, these arguments will be
set as optional arugments, for example:
* virDomainSaveFlags:
* @domain: a domain object
* @to: path for the output file
* @dxml: (optional) XML config for adjusting guest xml used on restore
* @flags: bitwise-OR of virDomainSaveRestoreFlags
the corresponding python APIs is
restoreFlags(self, frm, dxml=None, flags=0)
The following python APIs are changed to:
blockCommit(self, disk, base, top, bandwidth=0, flags=0)
blockPull(self, disk, bandwidth=0, flags=0)
blockRebase(self, disk, base, bandwidth=0, flags=0)
migrate(self, dconn, flags=0, dname=None, uri=None, bandwidth=0)
migrate2(self, dconn, dxml=None, flags=0, dname=None, uri=None, bandwidth=0)
migrateToURI(self, duri, flags=0, dname=None, bandwidth=0)
migrateToURI2(self, dconnuri=None, miguri=None, dxml=None, flags=0, \
dname=None, bandwidth=0)
saveFlags(self, to, dxml=None, flags=0)
migrate(self, domain, flags=0, dname=None, uri=None, bandwidth=0)
migrate2(self, domain, dxml=None, flags=0, dname=None, uri=None, bandwidth=0)
restoreFlags(self, frm, dxml=None, flags=0)
2013- 3- 22 Guannan Ren <gren@redhat.com>
python:remove semicolon in python code
This breaked "make syntax-check" testing
Pushed under trivial rule
2013- 3- 22 Guannan Ren <gren@redhat.com>
make: regenerate bindings when <classname>.py changes
2013- 3- 22 Guannan Ren <gren@redhat.com>
python: treat flags as default argument with value 0
The following four functions have not changed because default arguments
have to come after positional arguments. Changing them will break the
the binding APIs.
migrate(self, dconn, flags, dname, uri, bandwidth):
migrate2(self, dconn, dxml, flags, dname, uri, bandwidth):
migrateToURI(self, duri, flags, dname, bandwidth):
migrateToURI2(self, dconnuri, miguri, dxml, flags, dname, bandwidth):
2013- 3- 21 Peter Krempa <pkrempa@redhat.com>
python: Fix emulatorpin API bindings
The addition of emulator pinning APIs didn't think of doing the right
job with python APIs for them. The default generator produced unusable
code for this.
This patch switches to proper code as in the case of domain Vcpu pining.
This change can be classified as a python API-breaker but in the state
the code was before I doubt anyone was able to use it successfully.
2013- 3- 21 Guannan Ren <gren@redhat.com>
python: fix bindings that don't raise an exception
For example:
>>> dom.memoryStats()
libvir: QEMU Driver error : Requested operation is not valid:\
domain is not running
There are six such python API functions like so.
The root reason is that generator.py script checks the type of return
value of a python stub function defined in libvirt-api.xml or
libvirt-override-api.xml to see whether to add the raise clause or not
in python wrapper code in libvirt.py.
The type of return value is supposed to be C types.
For those stub functions which return python non-integer data type like
string, list, tuple, dictionary, the existing type in functions varies
from each other which leads problem like this.
Currently, in generator.py, it maintains a buggy whitelist for stub functions
returning a list type. I think it is easy to forget adding new function name
in the whitelist.
This patch makes the value of type consistent with C type "char *"
in libvirt-override-api.xml. For python, any of types could be printed
as string, so I choose "char *" in this case. And the comment in xml
could explain it when adding new function definition.
<function name='virNodeGetCPUStats' file='python'>
...
- <return type='virNodeCPUStats' info='...'/>
+ <return type='char *' info='...'/>
...
</function>
2013- 3- 13 Daniel P. Berrange <berrange@redhat.com>
Apply security label when entering LXC namespaces
Add a new virDomainLxcEnterSecurityLabel() function as a
counterpart to virDomainLxcEnterNamespaces(), which can
change the current calling process to have a new security
context. This call runs client side, not in libvirtd
so we can't use the security driver infrastructure.
When entering a namespace, the process spawned from virsh
will default to running with the security label of virsh.
The actual desired behaviour is to run with the security
label of the container most of the time. So this changes
virsh lxc-enter-namespace command to invoke the
virDomainLxcEnterSecurityLabel method.
The current behaviour is:
LABEL PID TTY TIME CMD
system_u:system_r:svirt_lxc_net_t:s0:c0.c1023 1 pts/0 00:00:00 systemd
system_u:system_r:svirt_lxc_net_t:s0:c0.c1023 3 pts/1 00:00:00 sh
system_u:system_r:svirt_lxc_net_t:s0:c0.c1023 24 ? 00:00:00 systemd-journal
system_u:system_r:svirt_lxc_net_t:s0:c0.c1023 29 ? 00:00:00 dhclient
staff_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 47 ? 00:00:00 ps
Note the ps command is running as unconfined_t, After this patch,
The new behaviour is this:
virsh -c lxc:/// lxc-enter-namespace dan -- /bin/ps -eZ
LABEL PID TTY TIME CMD
system_u:system_r:svirt_lxc_net_t:s0:c0.c1023 1 pts/0 00:00:00 systemd
system_u:system_r:svirt_lxc_net_t:s0:c0.c1023 3 pts/1 00:00:00 sh
system_u:system_r:svirt_lxc_net_t:s0:c0.c1023 24 ? 00:00:00 systemd-journal
system_u:system_r:svirt_lxc_net_t:s0:c0.c1023 32 ? 00:00:00 dhclient
system_u:system_r:svirt_lxc_net_t:s0:c0.c1023 38 ? 00:00:00 ps
The '--noseclabel' flag can be used to skip security labelling.
2013- 3- 1 Guannan Ren <gren@redhat.com>
python: fix fd leak in generator.py
2013- 3- 1 Guannan Ren <gren@redhat.com>
python: fix typoes and repeated global vars references
2013- 2- 22 Jiri Denemark <jdenemar@redhat.com>
python: Implement virDomainMigrateGetCompressionCache wrapper
2013- 2- 22 Jiri Denemark <jdenemar@redhat.com>
Introduce virDomainMigrate*CompressionCache APIs
Introduce virDomainMigrateGetCompressionCache and
virDomainMigrateSetCompressionCache APIs.
2013- 2- 22 Jiri Denemark <jdenemar@redhat.com>
python: Implement virDomainGetJobStats wrapper
2013- 2- 22 Jiri Denemark <jdenemar@redhat.com>
Introduce virDomainGetJobStats API
This is an extensible version of virDomainGetJobInfo.
2013- 2- 11 Guido Günther <agx@sigxcpu.org>
Check if classes are derived from object
This makes sure we don't regress to old style classes
2013- 2- 7 Guido Günther <agx@sigxcpu.org>
Remove more trailing semicolons in Python files
2013- 2- 7 Guido Günther <agx@sigxcpu.org>
Cosmetics: Remove semicolons
It's Python, not C
2013- 2- 5 Jiri Denemark <jdenemar@redhat.com>
sanitytest.py: Do not rely on system libvirt
When running sanitytest.py we should not rely on libvirt library
installed on the system. And since we generate a nice wrapper called
"run" that sets both PYTHON_PATH and LD_LIBRARY_PATH, we should just use
it rather than trying to duplicate it in the Makefile.
2013- 2- 5 Daniel P. Berrange <berrange@redhat.com>
Fix missing error constants in libvirt python module
The previous change to the generator, changed too much - only
the functions are in 'virerror.c', the constants remained in
'virerror.h' which could not be renamed for API compat reasons.
Add a test case to sanity check the generated python bindings
2013- 1- 31 Serge Hallyn <serge.hallyn@canonical.com>
complete virterror->virerror name change
Without these two string changes in generator.py, the
virGetLastError wrapper does not get created in
/usr/share/pyshared/libvirt.py. Noticed when running
tests with virt-install.
2013- 1- 24 Jiri Denemark <jdenemar@redhat.com>
python: Fix bindings for virDomainSnapshotGet{Domain,Connect}
https://bugzilla.redhat.com/show_bug.cgi?id=895882
virDomainSnapshot.getDomain() and virDomainSnapshot.getConnect()
wrappers around virDomainSnapshotGet{Domain,Connect} were not supposed
to be ever implemented. The class should contain proper domain() and
connect() accessors that fetch python objects stored internally within
the class. While domain() was already provided, connect() was missing.
This patch adds connect() method to virDomainSnapshot class and
reimplements getDomain() and getConnect() methods as aliases to domain()
and connect() for backward compatibility.
2013- 1- 24 Daniel P. Berrange <berrange@redhat.com>
Make python objects inherit from 'object' base class
As of python >= 2.2, it is recommended that all objects inherit
from the 'object' base class. We already require python >= 2.3
for libvirt for thread macro support, so we should follow this
best practice.
See also
http://stackoverflow.com/questions/4015417/python-class-inherits-object
2013- 1- 18 Jiri Denemark <jdenemar@redhat.com>
Introduce virTypedParamsClear public API
The function is just a renamed public version of former
virTypedParameterArrayClear.
2013- 1- 18 Jiri Denemark <jdenemar@redhat.com>
Add virTypedParams* APIs
Working with virTypedParameters in clients written in C is ugly and
requires all clients to duplicate the same code. This set of APIs makes
this code for manipulating with virTypedParameters integral part of
libvirt so that all clients may benefit from it.
2013- 1- 17 Jiri Denemark <jdenemar@redhat.com>
python: Avoid freeing uninitialized new_params pointer
2013- 1- 14 Daniel P. Berrange <berrange@redhat.com>
Fix build due to previous LXC patch
Mark virDomainLxcEnterNamespace as skipped in python binding
and remove reference to lxcDomainOpenNamespace which doesn't
arrive until a later patch
2013- 1- 14 Daniel P. Berrange <berrange@redhat.com>
Introduce an LXC specific public API & library
This patch introduces support for LXC specific public APIs. In
common with what was done for QEMU, this creates a libvirt_lxc.so
library and libvirt/libvirt-lxc.h header file.
The actual APIs are
int virDomainLxcOpenNamespace(virDomainPtr domain,
int **fdlist,
unsigned int flags);
int virDomainLxcEnterNamespace(virDomainPtr domain,
unsigned int nfdlist,
int *fdlist,
unsigned int *noldfdlist,
int **oldfdlist,
unsigned int flags);
which provide a way to use the setns() system call to move the
calling process into the container's namespace. It is not
practical to write in a generically applicable manner. The
nearest that we could get to such an API would be an API which
allows to pass a command + argv to be executed inside a
container. Even if we had such a generic API, this LXC specific
API is still useful, because it allows the caller to maintain
the current process context, in particular any I/O streams they
have open.
NB the virDomainLxcEnterNamespace() API is special in that it
runs client side, so does not involve the internal driver API.
2012- 12- 28 Michal Privoznik <mprivozn@redhat.com>
python: Adapt to virevent rename
With our recent renames under src/util/* we forgot to adapt
python wrapper code generator. This results in some methods being
not exposed:
$ python examples/domain-events/events-python/event-test.py
Using uri:qemu:///system
Traceback (most recent call last):
File "examples/domain-events/events-python/event-test.py", line 585, in <module>
main()
File "examples/domain-events/events-python/event-test.py", line 543, in main
virEventLoopPureStart()
File "examples/domain-events/events-python/event-test.py", line 416, in virEventLoopPureStart
virEventLoopPureRegister()
File "examples/domain-events/events-python/event-test.py", line 397, in virEventLoopPureRegister
libvirt.virEventRegisterImpl(virEventAddHandleImpl,
AttributeError: 'module' object has no attribute 'virEventRegisterImpl'
2012- 12- 21 Daniel P. Berrange <berrange@redhat.com>
Rename util.{c,h} to virutil.{c,h}
2012- 12- 21 Daniel P. Berrange <berrange@redhat.com>
Rename memory.{c,h} to viralloc.{c,h}
2012- 12- 4 Osier Yang <jyang@redhat.com>
Fix the indention
Introduced by commit 1465876a, pushed under build-breaker &&
trivial rule.
2012- 12- 4 Daniel P. Berrange <berrange@redhat.com>
Bind connection close callback APIs to python binding
Add code in the python binding to cope with the new APIs
virConnectRegisterCloseCallback and
virConnectUnregisterCloseCallback. Also demonstrate their
use in the python domain events demo
2012- 11- 15 Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
python: Use virNodeGetCPUMap where possible
Modified the places where virNodeGetInfo was used for the purpose
of obtaining the maximum node CPU number. Transparently falling
back to virNodeGetInfo in case of failure.
Wrote a utility function getPyNodeCPUCount for that purpose.
2012- 11- 2 Daniel P. Berrange <berrange@redhat.com>
Remove spurious whitespace between function name & open brackets
The libvirt coding standard is to use 'function(...args...)'
instead of 'function (...args...)'. A non-trivial number of
places did not follow this rule and are fixed in this patch.
2012- 10- 25 Eric Blake <eblake@redhat.com>
maint: consistent whitespace after 'if'
Noticed during the review of the previous patch.
* python/libvirt-override.c: Use space between 'if ('.
2012- 10- 25 Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
virNodeGetCPUMap: Add python binding
Added a method getCPUMap to virConnect.
It can be used as follows:
import libvirt
import sys
import os
conn = libvirt.openReadOnly(None)
if conn == None:
print 'Failed to open connection to the hypervisor'
sys.exit(1)
try:
(cpus, cpumap, online) = conn.getCPUMap(0)
except:
print 'Failed to extract the node cpu map information'
sys.exit(1)
print 'CPUs total %d, online %d' % (cpus, online)
print 'CPU map %s' % str(cpumap)
del conn
print "OK"
sys.exit(0)
2012- 10- 24 Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
virNodeGetCPUMap: Define public API.
Adding a new API to obtain information about the
host node's present, online and offline CPUs.
int virNodeGetCPUMap(virConnectPtr conn,
unsigned char **cpumap,
unsigned int *online,
unsigned int flags);
The function will return the number of CPUs present on the host
or -1 on failure;
If cpumap is non-NULL virNodeGetCPUMap will allocate an array
containing a bit map representation of the online CPUs. It's
the callers responsibility to deallocate cpumap using free().
If online is non-NULL, the variable pointed to will contain
the number of online host node CPUs.
The variable flags has been added to support future extensions
and must be set to 0.
Extend the driver structure by nodeGetCPUMap entry in support of the
new API virNodeGetCPUMap.
Added implementation of virNodeGetCPUMap to libvirt.c
2012- 10- 15 Martin Kletzander <mkletzan@redhat.com>
Add support for SUSPEND_DISK event
This patch adds support for SUSPEND_DISK event; both lifecycle and
separated. The support is added for QEMU, machines are changed to
PMSUSPENDED, but as QEMU sends SHUTDOWN afterwards, the state changes
to shut-off. This and much more needs to be done in order for libvirt
to work with transient devices, wake-ups etc. This patch is not
aiming for that functionality.
2012- 10- 13 Guido Günther <agx@sigxcpu.org>
Properly parse (unsigned) long long
This fixes problems on platforms where sizeof(long) != sizeof(long long)
like ia32.
2012- 10- 8 Guannan Ren <gren@redhat.com>
python: keep consistent handling of Python integer conversion
libvirt_ulonglongUnwrap requires the integer type of python obj.
But libvirt_longlongUnwrap still could handle python obj of
Pyfloat_type which causes the float value to be rounded up
to an integer.
For example
>>> dom.setSchedulerParameters({'vcpu_quota': 0.88})
0
libvirt_longlongUnwrap treats 0.88 as a valid value 0
However
>>> dom.setSchedulerParameters({'cpu_shares': 1000.22})
libvirt_ulonglongUnwrap will throw out an error
"TypeError: an integer is required"
The patch make this consistent.
2012- 10- 8 Guannan Ren <gren@redhat.com>
python: cleanup vcpu related binding APIs
libvirt_virDomainGetVcpus: add error handling, return -1 instead of None
libvirt_virDomainPinVcpu and libvirt_virDomainPinVcpuFlags:
check the type of argument
make use of libvirt_boolUnwrap
Set bitmap according to these values which are contained in given
argument of vcpu tuple and turn off these bit corresponding to
missing vcpus in argument tuple
The original way ignored the error info from PyTuple_GetItem
if index is out of range.
"IndexError: tuple index out of range"
The error message will only be raised on next command in interactive mode.
2012- 9- 28 Guannan Ren <gren@redhat.com>
python: return error if PyObject obj is NULL for unwrapper helper functions
The result is indeterminate for NULL argument to python
functions as follows. It's better to return negative value in
these situations.
PyObject_IsTrue will segfault if the argument is NULL
PyFloat_AsDouble(NULL) is -1.000000
PyLong_AsUnsignedLongLong(NULL) is 0.000000
2012- 9- 17 Osier Yang <jyang@redhat.com>
node_memory: Expose the APIs to Python bindings
* python/libvirt-override-api.xml: (Add document to describe
the APIs).
* python/libvirt-override.c: (Implement the API wrappers manually)
2012- 9- 17 Osier Yang <jyang@redhat.com>
node_memory: Define the APIs to get/set memory parameters
* include/libvirt/libvirt.h.in: (Add macros for the param fields,
declare the APIs).
* src/driver.h: (New methods for the driver struct)
* src/libvirt.c: (Implement the public APIs)
* src/libvirt_public.syms: (Export the public symbols)
2012- 9- 17 Osier Yang <jyang@redhat.com>
list: Expose virConnectListAllSecrets to Python binding
The implementation is done manually as the generator does not support
wrapping lists of C pointers into Python objects.
python/libvirt-override-api.xml: Document
python/libvirt-override-virConnect.py: Implementation for listAllSecrets.
python/libvirt-override.c: Implementation for the wrapper.
2012- 9- 17 Osier Yang <jyang@redhat.com>
list: Define new API virConnectListAllSecrets
This is to list the secret objects. Supports to filter the secrets
by its storage location, and whether it's private or not.
include/libvirt/libvirt.h.in: Declare enum virConnectListAllSecretFlags
and virConnectListAllSecrets.
python/generator.py: Skip auto-generating
src/driver.h: (virDrvConnectListAllSecrets)
src/libvirt.c: Implement the public API
src/libvirt_public.syms: Export the symbol to public
2012- 9- 17 Osier Yang <jyang@redhat.com>
list: Expose virConnectListAllNWFilters to Python binding
The implementation is done manually as the generator does not support
wrapping lists of C pointers into Python objects.
python/libvirt-override-api.xml: Document
python/libvirt-override-virConnect.py:
* Implementation for listAllNWFilters.
python/libvirt-override.c: Implementation for the wrapper.
2012- 9- 17 Osier Yang <jyang@redhat.com>
list: Define new API virConnectListAllNWFilters
This is to list the network filter objects. No flags are supported
include/libvirt/libvirt.h.in: Declare enum virConnectListAllNWFilterFlags
and virConnectListAllNWFilters.
python/generator.py: Skip auto-generating
src/driver.h: (virDrvConnectListAllNWFilters)
src/libvirt.c: Implement the public API
src/libvirt_public.syms: Export the symbol to public
2012- 9- 17 Osier Yang <jyang@redhat.com>
list: Expose virConnectListAllNodeDevices to Python binding
The implementation is done manually as the generator does not support
wrapping lists of C pointers into Python objects.
python/libvirt-override-api.xml: Document
python/libvirt-override-virConnect.py:
* Implementation for listAllNodeDevices.
python/libvirt-override.c: Implementation for the wrapper.
2012- 9- 17 Osier Yang <jyang@redhat.com>
list: Define new API virConnectListAllNodeDevices
This is to list the node device objects, supports to filter the results
by capability types.
include/libvirt/libvirt.h.in: Declare enum virConnectListAllNodeDeviceFlags
and virConnectListAllNodeDevices.
python/generator.py: Skip auto-generating
src/driver.h: (virDrvConnectListAllNodeDevices)
src/libvirt.c: Implement the public API
src/libvirt_public.syms: Export the symbol to public
2012- 9- 12 Osier Yang <jyang@redhat.com>
list: Expose virConnectListAllInterfaces to Python binding
The implementation is done manually as the generator does not support
wrapping lists of C pointers into Python objects.
python/libvirt-override-api.xml: Document
python/libvirt-override-virConnect.py:
* New file, includes implementation of listAllInterfaces.
python/libvirt-override.c: Implementation for the wrapper.
2012- 9- 12 Osier Yang <jyang@redhat.com>
list: Define new API virConnectListAllInterfaces
This is to list the interface objects, supported filtering flags
are: active|inactive.
include/libvirt/libvirt.h.in: Declare enum virConnectListAllInterfaceFlags
and virConnectListAllInterfaces.
python/generator.py: Skip auto-generating
src/driver.h: (virDrvConnectListAllInterfaces)
src/libvirt.c: Implement the public API
src/libvirt_public.syms: Export the symbol to public
2012- 9- 11 Federico Simoncelli <fsimonce@redhat.com>
python: Initialize new_params in virDomainSetSchedulerParameters
The new_params variable must be initialized in case the
virDomainGetSchedulerParameters call fails and we hit the cleanup
section before actually allocating the new parameters.
2012- 9- 11 Daniel P. Berrange <berrange@redhat.com>
Check against python None type when filling in auth parameters
When deciding whether to provide an auth function callback
in openAuth(), credcb was checked against NULL, when it
really needs to be checked against Py_None
2012- 9- 11 Daniel P. Berrange <berrange@redhat.com>
Print any exception that occurs in authentication callback
If an exception occurs in the python callback for openAuth()
the stack trace isn't seen by the apps, since this code is
called from libvirt context. To aid diagnostics, print the
error to stderr at least
2012- 9- 11 Daniel P. Berrange <berrange@redhat.com>
Fix crash passing an empty list to python openAuth() API
If passing a 'credtype' parameter which was an empty list
to the python openAuth() API, the 'credtype' field in
the virConnectAuth struct would not be initialized. This
lead to a crash when later trying to free that field.
2012- 9- 11 Osier Yang <jyang@redhat.com>
list: Expose virConnectListAllNetworks to Python binding
The implementation is done manually as the generator does not support
wrapping lists of C pointers into Python objects.
python/libvirt-override-api.xml: Document
python/libvirt-override-virConnect.py: Implement listAllNetworks.
python/libvirt-override.c: Implementation for the wrapper.
2012- 9- 11 Osier Yang <jyang@redhat.com>
list: Define new API virConnectListAllNetworks
This is to list the network objects, supported filtering flags
are: active|inactive, persistent|transient, autostart|no-autostart.
include/libvirt/libvirt.h.in: Declare enum virConnectListAllNetworkFlags
and virConnectListAllNetworks.
python/generator.py: Skip auto-generating
src/driver.h: (virDrvConnectListAllNetworks)
src/libvirt.c: Implement the public API
src/libvirt_public.syms: Export the symbol to public
2012- 9- 10 Osier Yang <jyang@redhat.com>
list: Expose virStoragePoolListAllVolumes to Python binding
The implementation is done manually as the generator does not support
wrapping lists of C pointers into Python objects.
python/libvirt-override-api.xml: Document
python/libvirt-override-virStoragePool.py:
* New file, includes implementation of listAllVolumes.
python/libvirt-override.c: Implementation for the wrapper.
2012- 9- 10 Osier Yang <jyang@redhat.com>
list: Define new API virStoragePoolListAllVolumes
Simply returns the storage volume objects. No supported filter
flags.
include/libvirt/libvirt.h.in: Declare the API
python/generator.py: Skip the function for generating. virStoragePool.py
will be added in later patch.
src/driver.h: virDrvStoragePoolListVolumesFlags
src/libvirt.c: Implementation for the API.
src/libvirt_public.syms: Export the symbol to public
2012- 9- 7 Jiri Denemark <jdenemar@redhat.com>
Fix PMSuspend and PMWakeup events
The unused reason parameter of PM{Suspend,Wakeup} event callbacks was
completely ignored in lot of places and those events were not actually
working at all.
2012- 9- 6 Osier Yang <jyang@redhat.com>
python: Expose virStorageListAllStoragePools to python binding
The implementation is done manually as the generator does not support
wrapping lists of C pointers into Python objects.
python/libvirt-override-api.xml: Document
python/libvirt-override-virConnect.py: Add listAllStoragePools
python/libvirt-override.c: Implementation for the wrapper.
2012- 9- 6 Osier Yang <jyang@redhat.com>
list: Define new API virStorageListAllStoragePools
This introduces a new API to list the storage pool objects,
4 groups of flags are provided to filter the returned pools:
* Active or not
* Autostarting or not
* Persistent or not
* And the pool type.
include/libvirt/libvirt.h.in: New enum virConnectListAllStoragePoolFlags;
Declare the API.
python/generator.py: Skip the generating
src/driver.h: (virDrvConnectListAllStoragePools)
src/libvirt.c: Implementation for the API.
src/libvirt_public.syms: Export the symbol.
2012- 8- 31 Eric Blake <eblake@redhat.com>
python: don't mask libvirt errors
A user reported this crash when using python bindings:
File "/home/nox/workspace/NOX/src/NOX/hooks.py", line 134, in trigger
hook.trigger(event)
File "/home/nox/workspace/NOX/src/NOX/hooks.py", line 33, in trigger
self.handlers[event]()
File "/home/nox/workspace/NOX/hooks/volatility.py", line 81, in memory_dump
for block in Memory(self.ctx):
File "/home/see/workspace/NOX/src/NOX/lib/libtools.py", line 179, in next
libvirt.VIR_MEMORY_PHYSICAL)
File "/usr/lib/python2.7/dist-packages/libvirt.py", line 1759, in memoryPeek
ret = libvirtmod.virDomainMemoryPeek(self._o, start, size, flags)
SystemError: error return without exception set
In the python bindings, returning NULL makes python think an
exception was thrown, while returning the None object lets the
wrappers know that a libvirt error exists.
Reported by Nox DaFox, fix suggested by Dan Berrange.
* python/libvirt-override.c (libvirt_virDomainBlockPeek)
(libvirt_virDomainMemoryPeek): Return python's None object, so
wrapper knows to check libvirt error.
2012- 8- 23 MATSUDA Daiki <matsudadik@intellilink.co.jp>
agent: add python module support
Add virDomainQemuAgentCommand() support function to python module.
2012- 8- 23 MATSUDA Daiki <matsudadik@intellilink.co.jp>
agent: add virDrvDomainQemuAgentCommand prototype for drivers.
Add virDrvDomainQemuAgentCommand prototype for drivers.
Add virDomainQemuAgentCommand() for virDrvDomainQemuAgentCommand.
2012- 8- 20 Marcelo Cerri <mhcerri@linux.vnet.ibm.com>
Update the remote API
This patch updates libvirt's API to allow applications to inspect the
full list of security labels of a domain.
2012- 7- 30 Peter Krempa <pkrempa@redhat.com>
python: Don't generate bodies for close callback functions
Commit 6ed5a1b9bd6240b8f2736790e48dd1c284c2e0e1 adds close callback
functions to the public API but doesn't add python implementation. This
patch sets the function to be written manually (to fix the build), but
doesn't implement them yet.
2012- 7- 14 Daniel P. Berrange <berrange@redhat.com>
Define public API for receiving guest memory balloon events
When the guest changes its memory balloon applications may want
to know what the new value is, without having to periodically
poll on XML / domain info. Introduce a "balloon change" event
to let apps see this
* include/libvirt/libvirt.h.in: Define the
virConnectDomainEventBalloonChangeCallback callback
and VIR_DOMAIN_EVENT_ID_BALLOON_CHANGE constant
* python/libvirt-override-virConnect.py,
python/libvirt-override.c: Wire up helpers for new event
* daemon/remote.c: Helper for serializing balloon event
* examples/domain-events/events-c/event-test.c,
examples/domain-events/events-python/event-test.py: Add
example of balloon event usage
* src/conf/domain_event.c, src/conf/domain_event.h: Handling
of balloon events
* src/remote/remote_driver.c: Add handler of balloon events
* src/remote/remote_protocol.x: Define wire protocol for
balloon events
* src/remote_protocol-structs: Likewise.
2012- 6- 19 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- 6- 19 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- 6- 18 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- 6- 18 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- 6- 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- 6- 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- 5- 4 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- 4- 27 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- 4- 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- 3- 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- 3- 28 Guannan Ren <gren@redhat.com>
python: make python APIs use these helper functions
*setPyVirTypedParameter
*libvirt_virDomainGetCPUStats
2012- 3- 28 Guannan Ren <gren@redhat.com>
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- 3- 26 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- 3- 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- 3- 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- 3- 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- 3- 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- 3- 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- 3- 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- 3- 20 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- 2- 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- 2- 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- 2- 9 Guannan Ren <gren@redhat.com>
python: refactoring virTypedParameter conversion for NUMA tuning APIs
*getPyVirTypedParameter
*setPyVirTypedParameter
*virDomainSetNumaParameters
*virDomainGetNumaParameters
2012- 2- 9 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- 2- 8 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- 2- 7 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- 2- 3 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- 2- 3 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- 2- 3 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- 2- 3 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- 2- 3 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- 2- 1 Jiri Denemark <jdenemar@redhat.com>
python: Add binding for virDomainGetDiskErrors
2012- 2- 1 Jiri Denemark <jdenemar@redhat.com>
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- 2- 1 Alex Jia <ajia@redhat.com>
python: correct a copy-paste error
* python/libvirt-override-virStream.py: fix a copy-paste error in sendAll().
2012- 1- 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- 1- 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- 1- 20 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.
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- 20 Hu Tao <hutao@cn.fujitsu.com>
add new API virDomain{G, S}etNumaParameters
Set up the types for the numa functions and insert them into the
virDriver structure definition.
2011- 12- 19 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- 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- 13 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- 5 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.
2011- 12- 5 Peter Krempa <pkrempa@redhat.com>
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- 11- 30 Lei Li <lilei@linux.vnet.ibm.com>
Support virDomain{Set, Get}BlockIoTune in the python API
Python support for both setting and getting block I/O throttle.
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- 10- 31 Matthias Bolte <matthias.bolte@googlemail.com>
python: Fix documentation of virStream recv
This was fixed in be757a3f7baf93b for libvirt.c.
2011- 10- 25 Michal Privoznik <mprivozn@redhat.com>
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);
2011- 10- 17 Philipp Hahn <hahn@univention.de>
Fix two comments related to error handling
2011- 10- 10 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- 10 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- 9- 16 Jiri Denemark <jdenemar@redhat.com>
python: Fix bindings generated in VPATH build
2011- 9- 15 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- 9- 14 Osier Yang <jyang@redhat.com>
qemu_api: Update Makefile to generate libvirtmod_qemu lib
2011- 9- 14 Osier Yang <jyang@redhat.com>
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
2011- 9- 14 Osier Yang <jyang@redhat.com>
qemu_api: Add override XML and C files for QEMU APIs
There is only one function (virDomainQemuMonitorCommand) need to
be hand-craft.
2011- 9- 6 Osier Yang <jyang@redhat.com>
latency: Expose the new API for Python binding
2011- 9- 1 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- 8- 2 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- 7- 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- 7- 28 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- 7- 28 Hu Tao <hutao@cn.fujitsu.com>
python: add python binding for virDomainSetMemoryParameters
2011- 7- 28 Hu Tao <hutao@cn.fujitsu.com>
python: add python binding for virDomainGetMemoryParameters
2011- 7- 28 Hu Tao <hutao@cn.fujitsu.com>
python: add python binding for virDomainSetBlkioParameters
2011- 7- 28 Hu Tao <hutao@cn.fujitsu.com>
python: add python binding for virDomainGetBlkioParameters
2011- 7- 27 Lai Jiangshan <laijs@cn.fujitsu.com>
send-key: Implement Python API
2011- 7- 26 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- 7- 25 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- 7- 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
2011- 7- 25 Taku Izumi <izumi.taku@jp.fujitsu.com>
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
2011- 7- 25 Taku Izumi <izumi.taku@jp.fujitsu.com>
python: add Python binding for virDomainGetSchedulerParametersFlags API
This patch adds the Python bindings for
virDomainGetSchedulerParametersFlags API.
2011- 7- 25 Taku Izumi <izumi.taku@jp.fujitsu.com>
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- 7- 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- 7- 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- 7- 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- 7- 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- 7- 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- 7- 13 Eric Blake <eblake@redhat.com>
python: prefer unsigned flags
* python/libvirt-override.c (libvirt_virConnectOpenAuth)
(libvirt_virDomainSnapshotListNames)
(libvirt_virDomainRevertToSnapshot): Change flags type.
2011- 7- 7 Matthias Bolte <matthias.bolte@googlemail.com>
python: Fix bogus label placement
2011- 7- 1 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- 6- 24 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- 6- 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- 6- 24 Eric Blake <eblake@redhat.com>
Revert "Enable virDomainBlockPull in the python API."
This reverts commit d74b86f5d6ecae3d18a391f90a918fcac75914db.
Conflicts:
python/generator.py
2011- 6- 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- 6- 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- 6- 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- 6- 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- 6- 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- 6- 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- 6- 21 Cole Robinson <crobinso@redhat.com>
python: Add bindings for virEvent*Handle/Timeout
2011- 6- 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- 6- 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.
2011- 6- 21 Cole Robinson <crobinso@redhat.com>
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- 6- 20 Cole Robinson <crobinso@redhat.com>
python: Implement bindings for virStreamEventAddCallback
v2:
Don't generate virStreamFree
2011- 6- 20 Cole Robinson <crobinso@redhat.com>
python: generator: Don't print warning if nothing to warn about
2011- 6- 20 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- 6- 16 Jiri Denemark <jdenemar@redhat.com>
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- 6- 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- 6- 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- 6- 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- 6- 14 Minoru Usui <usui@mxm.nes.nec.co.jp>
virNodeGetMemoryStats: Expose new API
2011- 6- 14 Minoru Usui <usui@mxm.nes.nec.co.jp>
virNodeGetCPUStats: Expose new API
2011- 6- 14 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- 6- 13 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- 6- 8 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- 5- 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- 5- 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- 5- 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- 5- 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.
2011- 5- 23 Michal Privoznik <mprivozn@redhat.com>
python: Fix typo in bindings
This typo caused a bug in which we wanted to free() invalid pointer.
2011- 5- 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- 5- 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- 5- 16 Jiri Denemark <jdenemar@redhat.com>
virDomainGetState public API
This API is supposed to replace virDomainGetInfo when the only purpose
of calling it is getting current domain status.
2011- 3- 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- 3- 11 Gui Jianfeng <guijianfeng@cn.fujitsu.com>
libvirt: add virDomain{Get,Set}BlkioParameters
Add virDomainSetBlkioParameters virDomainGetBlkioParameters
2011- 2- 21 Eric Blake <eblake@redhat.com>
maint: fix grammar in error message
* python/tests/create.py: Use correct wording.
2011- 2- 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- 1- 10 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.
2010- 11- 14 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- 10- 12 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- 12 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- 9- 27 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- 7- 23 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- 7- 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.
2010- 7- 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- 6- 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- 6- 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- 6- 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- 5- 20 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- 5- 18 Jim Meyering <meyering@redhat.com>
python: don't ignore virInitialize failure in module initialization
* python/libvirt-override.c (initlibvirtmod): Upon virInitialize
failure, skip the Py_InitModule call.
2010- 4- 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- 4- 29 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- 4- 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- 4- 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- 4- 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- 4- 9 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- 4- 8 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- 4- 5 Chris Lalancette <clalance@redhat.com>
Snapshot API framework.
2010- 3- 26 Stefan Berger <stefanb@us.ibm.com>
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
2010- 3- 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- 3- 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- 3- 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- 3- 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- 3- 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- 3- 17 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- 3- 9 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- 3- 2 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- 2- 17 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- 2- 16 Jim Meyering <meyering@redhat.com>
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.
2010- 2- 12 Jiri Denemark <jdenemar@redhat.com>
virConnectBaselineCPU public API
2010- 1- 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- 1- 18 Jim Meyering <meyering@redhat.com>
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.
2010- 1- 6 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
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 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- 14 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- 8 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- 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.
2009- 11- 20 Cole Robinson <crobinso@redhat.com>
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- 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- 3 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- 10- 5 Cole Robinson <crobinso@redhat.com>
python: Add a newline after custom classes
In the generated bindings, custom classes are squashed against the following
class, which hurts readability.
2009- 10- 5 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- 5 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.
2009- 10- 5 Cole Robinson <crobinso@redhat.com>
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- 5 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- 5 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
2009- 10- 5 Cole Robinson <crobinso@redhat.com>
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.
2009- 9- 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- 9- 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- 9- 21 Daniel P. Berrange <berrange@redhat.com>
Misc syntax-check fixes
2009- 9- 21 Daniel P. Berrange <berrange@redhat.com>
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
2009- 9- 14 Daniel P. Berrange <berrange@redhat.com>
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- 9- 14 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- 9- 3 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.
2009- 9- 1 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- 7- 26 Cole Robinson <crobinso@redhat.com>
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- 7- 16 Jim Meyering <meyering@redhat.com>
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- 7- 8 Jim Meyering <meyering@redhat.com>
remove all .cvsignore files
2009- 7- 6 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- 5- 28 Daniel P. Berrange <berrange@redhat.com>
Fix python domain events example & binding
2009- 5- 21 Daniel P. Berrange <berrange@redhat.com>
Add virInterface APIs to python code generator
2009- 5- 19 Cole Robinson <crobinso@redhat.com>
Better error reporting if 'import libvirtmod' fails
Don't squash a possibly legitimate libvirtmod error (e.g. some from
clashing libvirt.so versions) with 'Cannot import cygvirtmod'
2009- 4- 1 Daniel P. Berrange <berrange@redhat.com>
Fix crash after calling virConnectClose
2009- 4- 1 Daniel P. Berrange <berrange@redhat.com>
Fix generation of networkCreateXML and storagePoolCreateXML
2009- 3- 3 Jim Meyering <meyering@redhat.com>
update .gitignore and .hgignore files
2009- 3- 3 Daniel P. Berrange <berrange@redhat.com>
Internal driver API for sVirt support (James Morris & Dan Walsh)
2009- 3- 2 Daniel P. Berrange <berrange@redhat.com>
Ignore some generated autotools files in example app
2009- 2- 26 Daniel Veillard <veillard@redhat.com>
* python/Makefile.am: avoid a parallel make issue #472702 provided by Michael Marineau Daniel
2009- 2- 16 Cole Robinson <crobinso@redhat.com>
Fix building python bindings: Skip bindings for virSaveLastError and virFreeError
2009- 1- 20 Daniel P. Berrange <berrange@redhat.com>
Use global thread-local error for all python error reporting
2008- 12- 18 Daniel P. Berrange <berrange@redhat.com>
Replace __FUNCTION__ with __func__ for better portability (John Levon)
2008- 12- 18 Daniel P. Berrange <berrange@redhat.com>
Fix gcc-ism in python build (John Levon)
2008- 12- 15 Jim Meyering <meyering@redhat.com>
syntax-check: enforce the no-cvs-keywords prohibition
* Makefile.maint (sc_prohibit_cvs_keyword): New rule.
Suggested by Daniel Veillard.
The new test exposed two uses of $Date$.
* docs/Goals: Don't use $Date$.
* python/TODO: Likewise.
2008- 11- 25 Daniel P. Berrange <berrange@redhat.com>
Support domain lifecycle events for Xen (Ben Guthro & Daniel Berrange)
2008- 11- 24 Daniel P. Berrange <berrange@redhat.com>
Fix python bindings events code (David Lively)
2008- 11- 21 Daniel P. Berrange <berrange@redhat.com>
Python binding for node device APIs (David Lively)
2008- 11- 19 Daniel P. Berrange <berrange@redhat.com>
Add a virFreeCallback to event loop APIs
2008- 11- 19 Daniel P. Berrange <berrange@redhat.com>
Change public API for virEventAddHandle to allow multiple registrations per FD
2008- 11- 19 Daniel P. Berrange <berrange@redhat.com>
Add a virFreeCallback to virDomainEventRegister (from David Lively)
2008- 11- 17 Daniel P. Berrange <berrange@redhat.com>
Add domain events detail information
2008- 11- 17 Daniel P. Berrange <berrange@redhat.com>
Fix domain events python thread safety & incorrect enum generation
2008- 10- 31 Daniel Veillard <veillard@redhat.com>
* python/virConnect.py: needed for events from the python bindings by Ben Guthro daniel
2008- 10- 31 Daniel Veillard <veillard@redhat.com>
* python/Makefile.am python/generator.py python/libvir.c python/libvir.py python/libvirt_wrap.h python/types.c: adds support for events from the python bindings, also improves the generator allowing to embbed per function definition files, patch by Ben Guthro * examples/domain-events/events-python/event-test.py: also adds a programming example Daniel
2008- 10- 23 Daniel Veillard <veillard@redhat.com>
Massive patch adding event APIs by Ben Guthro * include/libvirt/libvirt.h include/libvirt/libvirt.h.in src/libvirt.c src/libvirt_sym.version: new libvirt event entry points, big patch provided by Ben Guthro * Makefile.am configure.in src/driver.h src/event.c src/event.h src/internal.h src/libvirt.c src/libvirt_sym.version src/lxc_driver.c src/openvz_driver.c src/qemu_conf.h src/qemu_driver.c src/remote_internal.c src/storage_backend_fs.c src/test.c qemud/event.c qemud/event.h qemud/mdns.c qemud/qemud.c qemud/qemud.h qemud/remote.c qemud/remote_dispatch_localvars.h qemud/remote_dispatch_proc_switch.h qemud/remote_dispatch_prototypes.h qemud/remote_protocol.c qemud/remote_protocol.h qemud/remote_protocol.x proxy/Makefile.am python/generator.py: Not much is left untouched by the patch adding the events support * docs/libvirt-api.xml docs/libvirt-refs.xml docs/html/libvirt-libvirt.html: regenerated the docs * examples/domain-events/events-c/Makefile.am examples/domain-events/events-c/event-test.c: a test example * AUTHORS: added Ben Guthro daniel
2008- 10- 17 Jim Meyering <meyering@redhat.com>
generate .gitignore files from .cvsignore ones
* Makefile.maint (sync-vcs-ignore-files): New target.
Prompted by a patch from James Morris.
http://thread.gmane.org/gmane.comp.emulators.libvirt/8619/focus=8773
Add all (now-generated) .gitignore files.
* .gitignore: New file.
* build-aux/.gitignore: New file.
* docs/.gitignore: New file.
* docs/devhelp/.gitignore: New file.
* docs/examples/.gitignore: New file.
* docs/examples/python/.gitignore: New file.
* gnulib/lib/.gitignore: New file.
* gnulib/lib/arpa/.gitignore: New file.
* gnulib/lib/netinet/.gitignore: New file.
* gnulib/lib/sys/.gitignore: New file.
* gnulib/tests/.gitignore: New file.
* include/.gitignore: New file.
* include/libvirt/.gitignore: New file.
* po/.gitignore: New file.
* proxy/.gitignore: New file.
* python/.gitignore: New file.
* python/tests/.gitignore: New file.
* qemud/.gitignore: New file.
* src/.gitignore: New file.
* tests/.gitignore: New file.
* tests/confdata/.gitignore: New file.
* tests/sexpr2xmldata/.gitignore: New file.
* tests/virshdata/.gitignore: New file.
* tests/xencapsdata/.gitignore: New file.
* tests/xmconfigdata/.gitignore: New file.
* tests/xml2sexprdata/.gitignore: New file.
2008- 10- 1 Daniel Veillard <veillard@redhat.com>
Xen interface order and fix python parallel build * src/xend_internal.c: fix ordering when parsing multiple Xen interfaces, patch by Jim Fehlig * python/Makefile.am: fix parallel build Daniel
2008- 8- 22 Daniel P. Berrange <berrange@redhat.com>
Use libvirt error message for python exceptions
2008- 8- 12 Daniel Veillard <veillard@redhat.com>
Fix connection lookup in python storage instances * python/generator.py: patch from Cole Robinson trying to fix problem of connection lookup when creating storage instances Daniel
2008- 7- 25 Daniel Veillard <veillard@redhat.com>
Skip python bindings for virDomainBlockPeek and virDomainMemoryPeek * python/generator.py: skip generation for virDomainBlockPeek and virDomainMemoryPeek as they break the build Daniel
2008- 7- 9 Daniel P. Berrange <berrange@redhat.com>
Ignore JIT'd python files
2008- 6- 25 Daniel Veillard <veillard@redhat.com>
* python/types.c: patch from Ryan Scott to remove misplaced verbosity when compiling in debug mode. Daniel
2008- 6- 11 Daniel Veillard <veillard@redhat.com>
* python/libvir.py python/libvirt-python-api.xml: more python cleanups by Cole Robinson Daniel
2008- 6- 10 Daniel Veillard <veillard@redhat.com>
* python/generator.py python/libvir.c python/libvirt-python-api.xml: Apply patch from Cole Robinson fixing UUIDString for python Daniel
2008- 5- 29 Daniel P. Berrange <berrange@redhat.com>
Fix python code generation for storage APIs
2008- 5- 21 Daniel P. Berrange <berrange@redhat.com>
Don't free C object after destroy method in python
2008- 4- 18 Daniel P. Berrange <berrange@redhat.com>
Python header workaround
2008- 4- 18 Jim Meyering <meyering@redhat.com>
Work around Python.h name-space pollution.
* python/libvir.c (HAVE_PTHREAD_H): #undef.
Without this, we'd get a redefinition warning.
2008- 4- 10 Jim Meyering <meyering@redhat.com>
convert TAB-based indentation in C sources to use only spaces
Done using this command (also includes .c.in and .h.in files):
for i in $(g ls-files|grep -E '\.[ch](\.in)?$'|grep -v gnulib); do
expand -i $i > j && mv j $i;done
2008- 4- 10 Jim Meyering <meyering@redhat.com>
remove Vim and Emacs variable settings from C source files
Done with these commands:
git grep -l Local.variab|xargs \
perl -0x3b -pi -e 's,\n+/\*\n \* vim:(.|\n)*,\n,'
git grep -l Local.variab|xargs \
perl -0x3b -pi -e 's,\n+/\*\n \* Local variables:\n(.|\n)*,\n,'
2008- 4- 8 Daniel Veillard <veillard@redhat.com>
Fix potential infinite loop in python generator * python/generator.py: fix an infinite loop bug Daniel
2008- 3- 14 Richard W.M. Jones <rjones@redhat.com>
Fix typo "informations" -> "information" (Atsushi SAKAI and Saori FUKUTA).
2008- 2- 29 Richard W.M. Jones <rjones@redhat.com>
Many typos fixed (Atsushi SAKAI).
2008- 2- 20 Daniel P. Berrange <berrange@redhat.com>
Added python binding for storage APIs
2008- 2- 7 Daniel Veillard <veillard@redhat.com>
Python bindings return values fixes * python/libvir.c: apply patch from Cole Robinson to provide return values for manulally written python bindings. Daniel
2008- 2- 5 Jim Meyering <meyering@redhat.com>
Remove all trailing blanks; turn on the rule to detect them.
* Makefile.cfg (local-checks-to-skip): Remove sc_trailing_blank.
* .x-sc_trailing_blank: New file, to exempt the few binary files.
2008- 1- 29 Jim Meyering <meyering@redhat.com>
Enable the <config.h>-requiring test; fix violations
Use <config.h>, not "config.h", per autoconf documentation.
* Makefile.cfg (local-checks-to-skip) [sc_require_config_h]: Enable.
* .x-sc_require_config_h: New file, to list exempted files.
* Makefile.am (EXTRA_DIST): Add .x-sc_require_config_h.
2008- 1- 29 Jim Meyering <meyering@redhat.com>
Given code like if (foo) free (foo); remove the useless "if (foo) " part.
Likewise, given if (foo != NULL) free (foo); remove the useless "if" test.
* proxy/libvirt_proxy.c: Remove unnecessary "if" test before free.
* python/generator.py: Likewise.
* qemud/qemud.c: Likewise.
* src/buf.c: Likewise.
* src/conf.c: Likewise.
* src/hash.c: Likewise.
* src/iptables.c: Likewise.
* src/libvirt.c: Likewise.
* src/openvz_conf.c: Likewise.
* src/qemu_conf.c: Likewise.
* src/qemu_driver.c: Likewise.
* src/remote_internal.c: Likewise.
* src/test.c: Likewise.
* src/virsh.c: Likewise.
* src/virterror.c: Likewise.
* src/xen_internal.c: Likewise.
* src/xen_unified.c: Likewise.
* src/xend_internal.c: Likewise.
* src/xm_internal.c: Likewise.
* src/xml.c: Likewise.
* src/xmlrpc.c: Likewise.
* src/xs_internal.c: Likewise.
* tests/testutils.c: Likewise.
* tests/xencapstest.c: Likewise.
* tests/xmconfigtest.c: Likewise.
2008- 1- 21 Daniel P. Berrange <berrange@redhat.com>
Make python generator fail build on any missing APIs
2008- 1- 21 Daniel P. Berrange <berrange@redhat.com>
Add missing vcpu/schedular APIs to python binding
2008- 1- 17 Jim Meyering <meyering@redhat.com>
Handle PyTuple_New's malloc failure.
* python/libvir.c (libvirt_virDomainBlockStats): Handle a NULL
return from PyTuple_New.
(libvirt_virDomainInterfaceStats, libvirt_virGetLastError): Likewise.
(libvirt_virConnGetLastError): Likewise.
2008- 1- 17 Jim Meyering <meyering@redhat.com>
Factor out some duplication.
* python/libvir.c (VIR_PY_NONE): New macro, to encapsulate
a common two-statement sequence.
Replace all such 2-stmt sequences.
2007- 12- 11 Jim Meyering <meyering@redhat.com>
Use a variable name as sizeof argument, not a type name.
Given code like: T *var = calloc (n, sizeof (T));
Convert to this: T *var = calloc (n, sizeof (*var));
This first-cut change adjusts all malloc, calloc, and
realloc statements.
The only binary differences are in remote_internal.c
(due to the bug fix) and in xmlrpc.c (due to factorization).
* python/libvir.c: As above.
* qemud/event.c: Likewise.
* qemud/mdns.c: Likewise.
* qemud/qemud.c: Likewise.
* qemud/remote.c: Likewise.
* src/bridge.c: Likewise.
* src/buf.c: Likewise.
* src/conf.c: Likewise.
* src/hash.c: Likewise.
* src/iptables.c: Likewise.
* src/openvz_conf.c: Likewise.
* src/qemu_conf.c: Likewise.
* src/qemu_driver.c: Likewise.
* src/test.c: Likewise.
* src/xen_internal.c: Likewise.
* src/xen_unified.c: Likewise.
* src/xm_internal.c: Likewise.
* src/xml.c: Likewise.
* tests/qemuxml2argvtest.c: Likewise.
* src/xmlrpc.c (xmlRpcValuePtr): Likewise, and minor factorization.
* src/remote_internal.c (remoteAuthMakeCredentials): Use the right
type when allocating space for an array of cred _pointers_.
2007- 12- 7 Jim Meyering <meyering@redhat.com>
Include "config.h" in remaining non-generated files.
* proxy/libvirt_proxy.c: Likewise.
* python/libvir.c: Likewise.
* python/types.c: Likewise.
* src/event.c: Likewise.
* src/xm_internal.c: Likewise.
* tests/reconnect.c: Likewise.
* tests/testutils.c: Likewise.
2007- 12- 7 Daniel Veillard <veillard@redhat.com>
* python/generator.py python/libvir.c python/libvirt-python-api.xml: add a python binding for virNodeGetCellsFreeMemory Daniel
2007- 12- 5 Daniel P. Berrange <berrange@redhat.com>
Add manual impl of virConnectOpenAuth python binding
2007- 12- 5 Richard W.M. Jones <rjones@redhat.com>
Wed Dec 5 13:48:00 UTC 2007 Richard W.M. Jones <rjones@redhat.com>
* python/libvir.c, python/libvirt_wrap.h, qemud/qemud.c,
qemud/remote.c, src/internal.h, src/openvz_conf.c,
src/openvz_driver.c, src/proxy_internal.h, src/qemu_conf.c,
src/qemu_driver.c, src/remote_internal.h, src/test.h, src/util.c,
src/xen_unified.c, src/xen_unified.h, tests/nodeinfotest.c,
tests/qemuxml2argvtest.c, tests/qemuxml2xmltest.c, tests/reconnect.c,
tests/sexpr2xmltest.c, tests/virshtest.c, tests/xencapstest.c,
tests/xmconfigtest.c, tests/xml2sexprtest.c:
Change #include <> to #include "" for local includes.
Removed many includes from src/internal.h and put them in
the C files which actually use them.
Removed <ansidecl.h> - unused.
Added a comment around __func__.
Removed a clashing redefinition of VERSION symbol.
All limits (PATH_MAX etc) now done in src/internal.h, so we
don't need to include those headers in other files.
2007- 11- 30 Richard W.M. Jones <rjones@redhat.com>
Fri Nov 30 11:04:00 GMT 2007 Richard W.M. Jones <rjones@redhat.com>
* python/libvir.c, python/libvir.py: Make Python aware that
the C bindings module is called cygvirtmod.dll when compiled
by CYGWIN.
* python/Makefile.am: Remove symlink libvirtmod.dll -> cygvirtmod.dll
no longer necessary because of the above.
* configure.in: Remove AM_CONDITIONAL(CYGWIN).
2007- 11- 29 Richard W.M. Jones <rjones@redhat.com>
Thu Nov 29 17:40:00 GMT 2007 Richard W.M. Jones <rjones@redhat.com>
* configure.in: Added CYGWIN_EXTRA_LDFLAGS, CYGWIN_EXTRA_LIBADD,
CYGWIN_EXTRA_PYTHON_LIBADD, CYGWIN automake conditional.
* src/Makefile.am: Extra flags required to build DLL of libvirt
for Cygwin.
* python/Makefile.am: Extra flags and rule required to build
Python module for Cygwin.
2007- 11- 15 Jim Meyering <meyering@redhat.com>
Make "make distcheck" work.
* Makefile.am: Expand some "*" wildcards, and (for now) disable
the relatively unimportant, distuninstallcheck target.
Fix a few redirect-directly-to-target bugs.
Add a few $(srcdir)/ prefixes and add an uninstall-local rule.
* docs/Makefile.am: More of the same. Split some long lines.
* python/Makefile.am: Likewise.
* python/tests/Makefile.am: Likewise.
* qemud/Makefile.am: Likewise.
* tests/Makefile.am: Remove the directories already listed in SUBDIRS.
* docs/examples/index.py: Adapt to produce the desired changes in
docs/examples/Makefile.am. Also, sort *.c, so results are reproducible,
and emit a comment telling emacs and vi that the file is read-only.
* docs/examples/Makefile.am: Regenerate.
Author: Jim Meyering <meyering@redhat.com>
2007- 9- 30 Daniel Veillard <veillard@redhat.com>
* python/generator.py python/libvir.c python/libvirt-python-api.xml: provide bindings for block and interface statistics Daniel
2007- 7- 24 Daniel Veillard <veillard@redhat.com>
* libvirt.spec.in NEWS docs/* po/*: preparing release 0.3.1 * src/libvirt.c python/generator.py: some cleanup and warnings from Richard W.M. Jones Daniel
2007- 6- 26 Richard W.M. Jones <rjones@redhat.com>
Tue Jun 26 14:40:00 BST 2007 Richard W.M. Jones <rjones@redhat.com>
* src/remote_internal.c, python/Makefile.am: Python bindings
fixed, and now building virConnect.getHostname and
virConnect.getURI. Fixed a problem which stopped
libvirt.py from being (re-)built. Rearranged
python/Makefile.am to make it cleaner and clearer.
2007- 6- 25 Richard W.M. Jones <rjones@redhat.com>
Mon Jun 25 16:55:00 BST 2007 Richard W.M. Jones <rjones@redhat.com>
* include/libvirt/libvirt.h.in, src/libvirt.c, src/libvirt_sym.version,
python/generator.py: Added virDomainGetConnect and
virNetworkGetConnect to allow us to get the "hidden"
connection associated with each domain or network.
2007- 6- 15 Richard W.M. Jones <rjones@redhat.com>
Fri Jun 15 08:53:00 BST 2007 Richard W.M. Jones <rjones@redhat.com>
* src/internal.h, src/virsh.c: Replace _N with N_ so that
Solaris builds work (Mark Johnson).
* src/virsh.c: Add a couple of missing error messages (Mark
Johnson).
* python/types.c: Fix NULL pointer deref on DEBUG build
(Mark Johnson).
* src/virsh.c: Spelling fix (Mark Johnson).
2007- 5- 29 Richard W.M. Jones <rjones@redhat.com>
+Tue May 29 15:56:00 BST 2007 Richard W.M. Jones <rjones@redhat.com> + + * python/generator.py, python/libvir.c, python/libvir.py: + Wrap the virGetVersion call as Python libvirt.getVersion. + + * src/libvirt.c: Change virGetVersion so that the driver name + is case insensitive. +
2007- 4- 16 Daniel P. Berrange <berrange@redhat.com>
Fixed exception reporting for domain/network operations
2007- 4- 10 Daniel P. Berrange <berrange@redhat.com>
Added vir*GetAutostart APIs to python
2007- 3- 28 Richard W.M. Jones <rjones@redhat.com>
* python/generator.py: Python bindings now throw exceptions in almost all cases where an error is encountered in the underlying libvirt code.
2007- 3- 16 Daniel Veillard <veillard@redhat.com>
* python/generator.py: patch from Tatsuro Enokura to fix virNetworkDefine binding Daniel
2007- 3- 15 Daniel Veillard <veillard@redhat.com>
* python/generator.py: fix the python binding generation for virNetworkLookup...() functions, which were clashing with equivalent virConnLookup...() equivalents, as reported by Tatsuro Enokura Daniel
2007- 3- 9 Daniel P. Berrange <berrange@redhat.com>
Added python bindings for networking APIs
2007- 3- 6 Daniel P. Berrange <berrange@redhat.com>
Fixed up numerous compiler warnings
2007- 3- 1 Mark McLoughlin <markmc@redhat.com>
Thu Mar 01 16:17:48 EST 2007 Mark McLoughlin <markmc@redhat.com>
* acinclude.m4: add LIBVIRT_COMPILE_WARNINGS, copied from
GNOME but with a few more flags we'd been using.
* configure.in: use that instead of setting CFLAGS
directly.
* proxy/Makefile.am, python/Makefile.am, qemud/Makefile.am,
src/Makefile.am, tests/Makefile.am: use $(WARN_CFLAGS)
2007- 2- 14 Daniel P. Berrange <berrange@redhat.com>
Blacklist vshRunConsole from python
2007- 1- 23 Mark McLoughlin <markmc@redhat.com>
Mon Jan 23 14:36:18 IST 2007 Mark McLoughlin <markmc@redhat.com>
* include/libvirt/libvirt.h.in: add VIR_UUID_BUFLEN and
VIR_UUID_STRING_BUFLEN
* libvirt/proxy/libvirt_proxy.c, libvirt/src/hash.c,
libvirt/src/internal.h, libvirt/src/libvirt.c,
libvirt/src/proxy_internal.c, libvirt/src/test.c,
libvirt/src/virsh.c, libvirt/src/xend_internal.c,
libvirt/src/xm_internal.c, libvirt/src/xml.c,
libvirt/python/libvir.c: use them
2006- 11- 16 Daniel P. Berrange <berrange@redhat.com>
Added binding for virConnectListDefinedDomains api
2006- 11- 15 Daniel P. Berrange <berrange@redhat.com>
Fix unsigned long wraparound in python binding
2006- 11- 10 Daniel P. Berrange <berrange@redhat.com>
Fixed string concatenation in case where there is no lower level error
2006- 11- 9 Daniel Veillard <veillard@redhat.com>
* python/generator.py: changed the generator to generate a reference from Domain class instances to the Connect they were issued from should fix rhbz#204490 * docs//*: rebuilt Daniel
2006- 11- 7 Daniel P. Berrange <berrange@redhat.com>
Propagate libvirt errors back with python exceptions
2006- 10- 24 Daniel P. Berrange <berrange@redhat.com>
Make python bindings threaded, by dropping/acquiring Python GIL where needed
2006- 8- 29 Daniel Veillard <veillard@redhat.com>
* python/libvir.c: Pete Vetere pointed out a bug in string cast when handling errors in Python Daniel
2006- 8- 4 Daniel Veillard <veillard@redhat.com>
* python/generator.py: fix the generator when handling long integers Dan Berrange reported problems due to this when using virDomainSetMemory bindings Daniel
2006- 7- 5 Mark McLoughlin <markmc@redhat.com>
unleash the hush puppies
2006- 6- 26 Daniel Veillard <veillard@redhat.com>
* configure.in libvirt.spec.in docs/examples/* include/Makefile.am include/libvirt/virterror.h python/generator.py python/libvir.c python/libvirt_wrap.h src/driver.h src/internal.h src/test.h src/virsh.c src/virterror.c src/xend_internal.c src/xend_internal.h src/xml.c src/xml.h: moved the includes from include/ to include/libvirt to reflect the installed include tree. This avoid using "" in the includes themselves. Daniel
2006- 3- 29 Daniel Veillard <veillard@redhat.com>
* python/libvir.c: fixed a bug in the new wrapper * python/tests/Makefile.am python/tests/node.py: added a new test for the new API * python/tests/create.py: remove a debug Daniel
2006- 3- 29 Daniel Veillard <veillard@redhat.com>
* include/libvirt.h[.in] include/virterror.h src/driver.h src/internal.h src/libvirt_sym.version src/xen_internal.c src/xs_internal.c: added a new entry point to get node hardware informations virGetNodeInfo, and associated driver hook. * src/xend_internal.c: implemented the node and version information hooks for the Xen Daemon * python/libvir.c python/libvirt-python-api.xml python/generator.py: also added Python bindings for the new call Daniel
2006- 3- 28 Daniel Veillard <veillard@redhat.com>
* python/libvir.c: call the initialize entry point * src/libvirt_sym.version: add initialize entry point * src/libvirt.c: make sure we always initialize the lib * python/tests/*.py: start updating exemple for exception handling as pointed by Jim Meyering Daniel
2006- 3- 28 Daniel Veillard <veillard@redhat.com>
* doc/site.xsl doc/libvir.html doc/*: added informations about the Perl bindings, regenerated * python/libvirt_wrap.h: added a missing include. Daniel
2006- 3- 23 Daniel Veillard <veillard@redhat.com>
* src/xs_internal.c src/xs_internal.h include/virterror.h src/virterror.c: created a new module related to Xen Store accesses * src/libvirt.c src/xen_internal.[ch] src/xend_internal.[ch]: nearly completed the separation of the code from the different modules Daniel
2006- 3- 22 Daniel Veillard <veillard@redhat.com>
* python/tests/create.py: add one more image path * src/libvirt.c src/xend_internal.c src/xend_internal.h: more work on the xend refactoring Daniel
2006- 3- 22 Daniel Veillard <veillard@redhat.com>
* python/tests/create.py: adapt to new naming scheme in FC5 Daniel
2006- 2- 28 Daniel Veillard <veillard@redhat.com>
* NEWS configure.in libvirt.spec.in include/libvirt.h docs/*: preparing release 0.0.6 Daniel
2006- 2- 28 Daniel Veillard <veillard@redhat.com>
Fixed the test, daniel
2006- 2- 28 Daniel Veillard <veillard@redhat.com>
* TODO: updated * python/Makefile.am python/generator.py python/libvir.c python/libvir.py: improved python binding, raise exception when an instance creation or lookup fails, and add support for the global error handler, per conn handler still needed * python/tests/error.py python/tests/Makefile.am: adding a regression test Daniel
2006- 2- 24 Daniel Veillard <veillard@redhat.com>
* python/generator.py python/libvir.c python/libvirt-python-api.xml: UUID strings can contain zeroes, so the autogenerated conversion functions don't work. Daniel
2006- 2- 23 Daniel Veillard <veillard@redhat.com>
* src/libvirt.c: fixing a bug before the release of 0.0.5 * python/generator.py python/libvir.c python/libvirt-python-api.xml: also fixing the binding for getting a domain UUID * python/tests/Makefile.am python/tests/uuid.py: added a test for the new UUID API Daniel
2006- 2- 23 Daniel Veillard <veillard@redhat.com>
* python/tests/Makefile.am: added the create.py in the regression tests Daniel
2006- 2- 21 Daniel Veillard <veillard@redhat.com>
* TODO: updated * python/tests/Makefile.am: fix a small PYTHONPATH bug * docs//*: fixed the xsl a bit for toc names, added doc for the python bindings, regenerated Daniel
2006- 2- 20 Daniel Veillard <veillard@redhat.com>
* docs/examples/examples.xsl docs/examples/index.html docs/site.xsl: integates the examples page in the web site * docs//* : fixed generator and rebuilt the docs * python/tests/basic.py python/tests/create.py: couple cleanups Daniel
2006- 2- 17 Daniel Veillard <veillard@redhat.com>
* python/tests/create.py: trying to make test more generic, but it's difficult since it requires a system image * src/libvirt.c src/xend_internal.c: fixed the shutdown API which was broken due to a bad reason at the xend level. Daniel
2006- 2- 16 Daniel Veillard <veillard@redhat.com>
* configure.in src/Makefile.am: adding dependency to libxml2 * include/libvirt.h* src/libvirt.c src/xend_internal.[ch] src/xml.[ch]: added XML parsing for Xen domain descriptions needed for creates, plugged in a converter to s-exp and xend call. Modified the virDomainCreateLinux() to reflect that XML based description. Seems to work. * python/tests/create.py: added a test case which seems to work not tested much yet * docs/*: regenerated Daniel
2006- 2- 15 Daniel Veillard <veillard@redhat.com>
* configure.in libvirt.spec.in include/libvirt.h.in python/Makefile.am src/Makefile.am: fix rpm packaging problems whith head, more LIBVIR -> LIBVIRT changes. Daniel
2006- 2- 14 Daniel Veillard <veillard@redhat.com>
* Makefile.am configure.in python/Makefile.am python/tests/Makefile.am python/tests/basic.py: added first python test script and a 'make tests' target Daniel
2006- 2- 10 Daniel Veillard <veillard@redhat.com>
* python/libvir.c: fixed one more problem prior to 0.0.4 Daniel
2006- 2- 9 Daniel Veillard <veillard@redhat.com>
* //* : renamed the project libvirt , this affects all makefiles, the specs, the icons, the docs, etc ... * configure.in: prepare for 0.0.3 Daniel
2006- 1- 31 Daniel Veillard <veillard@redhat.com>
* python/*: update of the python bindings, fix names, add missing features like list of domains and domain info extraction Daniel
2006- 1- 28 Daniel Veillard <veillard@redhat.com>
* python/libvir.c: fix a stupid bug in python bindings (DomainDestroy is still mishandled though) Daniel
2006- 1- 26 Daniel Veillard <veillard@redhat.com>
* TODO: updated * docs/search.php: use the new web site design * python/generator.py: fix a generation bug on python keyword Daniel
2005- 12- 19 Daniel Veillard <veillard@redhat.com>
* Makefile.am configure.in libvir.spec.in python/*: added a first version for python bindings, heavilly based on libxml2/libxslt way of doing things, maybe this need to be revisited. Added packaging too. * src/hash.h: fixed the Copyright notice. Daniel
|