mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-08-23 05:50:03 +03:00
Compare commits
896 Commits
Author | SHA1 | Date | |
---|---|---|---|
a56ec4515b | |||
4348a4a85a | |||
d66fab6eea | |||
3b13aa3db3 | |||
11a36d956c | |||
826cbac459 | |||
be2cd079af | |||
36297e1db2 | |||
e3f5dbcdf0 | |||
8fe128a46c | |||
74b379cbd5 | |||
c861237a64 | |||
b8b260dde9 | |||
7c39e4f885 | |||
73c901a807 | |||
33948c6844 | |||
93f77250b3 | |||
35b5f84c50 | |||
fae0da5c13 | |||
35e7f27141 | |||
8d75cb7fde | |||
0d5600fd2f | |||
345a5092e5 | |||
de85acdf3b | |||
543e013a15 | |||
f6c66d01fb | |||
dd26096ad1 | |||
ac33531a05 | |||
e1a2fe6af2 | |||
2dd44664cf | |||
c73a0c4ac9 | |||
221b457e69 | |||
ab8dd999f5 | |||
01e0e98f07 | |||
2e812c89e9 | |||
624a7927f0 | |||
bbaecd6a8f | |||
f5c65fa192 | |||
7b1fe89a5c | |||
e1f5f8516f | |||
3a05dc09ec | |||
709c37e932 | |||
db68d6b164 | |||
d285084b12 | |||
e46f6309d5 | |||
e2b8f981c4 | |||
e22f2f5c9c | |||
7165bef132 | |||
2eb9301ba5 | |||
6e24ccb266 | |||
112746cdc5 | |||
3c4b8a7706 | |||
ee8240b295 | |||
1e87ecd12e | |||
9e09f313d1 | |||
97648a9751 | |||
3f935df0af | |||
fca27ca2bb | |||
547d8e3a86 | |||
79cfda0013 | |||
529325bbdd | |||
ea6bc1e8c6 | |||
398d01b8a9 | |||
96ad9ed33b | |||
1a09553e52 | |||
6e16575a37 | |||
3bd4c7ba16 | |||
36e0372986 | |||
7cc1491d10 | |||
1daea0c59d | |||
79d233b5ca | |||
b37979023d | |||
553f31c579 | |||
8fc469b3d5 | |||
9d162096ca | |||
b013ebc3b2 | |||
c1a45b5107 | |||
15bfedcbbd | |||
47c8709564 | |||
f4e74cf63c | |||
14bf7270aa | |||
d710d60c31 | |||
fe627697a3 | |||
295fd6e833 | |||
a010fb58d6 | |||
5fede0a90b | |||
f5fc670638 | |||
00fd3ff49b | |||
c6f1459eb9 | |||
727cda9d1f | |||
970135f6bc | |||
d9b285d7e8 | |||
b08e6d38ae | |||
401c404811 | |||
4f17809a36 | |||
d790a66d6b | |||
11573f3ec1 | |||
182eba1bc6 | |||
d9e66a62b4 | |||
1caa19cb06 | |||
879cd8cc2b | |||
46da355022 | |||
79f45855a6 | |||
b06c97e51d | |||
4c10127b2c | |||
f8d54e7c94 | |||
aadab51541 | |||
85df93399c | |||
3e11f9ff90 | |||
e7f38d96f0 | |||
61ea9c89c5 | |||
f566c5924a | |||
ed2a10a1c5 | |||
81f3edea8f | |||
d7a3c8352e | |||
bdc8861aac | |||
f225e560de | |||
316e9f9032 | |||
6d9c4758ae | |||
eff29c8b28 | |||
6f19c16c78 | |||
19d70c7d96 | |||
1e64d8c731 | |||
4734a4227f | |||
3aee261527 | |||
f38b654e9b | |||
a541c76238 | |||
c93370c4ad | |||
237f3bf8da | |||
25e2857c21 | |||
323ad539bb | |||
5486abfe4e | |||
d104362d90 | |||
fe4bb32cba | |||
ce37c3a109 | |||
580ad29288 | |||
6bfffce916 | |||
3620e3cdcf | |||
b167672c74 | |||
23b2497292 | |||
8ce9f2b161 | |||
49faa15e4f | |||
c3aa1f8bdb | |||
0d4d04e550 | |||
15b0c4ffdb | |||
af4c893eb7 | |||
a1c4d7d765 | |||
6f9d8bdbcb | |||
ecd93b7541 | |||
b92587bc56 | |||
738ee810b4 | |||
03d777f345 | |||
b81a7ece97 | |||
12c542a421 | |||
6ed7374c5a | |||
27a1f781bc | |||
c8c9ef2757 | |||
0c85095e46 | |||
24e0171b86 | |||
faa8bf1079 | |||
58df0daa7f | |||
9ca731f66c | |||
3514c8c375 | |||
5d2df4100d | |||
aabafbea1d | |||
38b3514832 | |||
b1e32305bd | |||
cf5fa06c8d | |||
13f59ad733 | |||
bde4589189 | |||
b553b50acb | |||
7ad5c00ed9 | |||
634736a781 | |||
b1be11c727 | |||
1355e0552e | |||
e0a48c99e4 | |||
3decd4f9f1 | |||
f991a00653 | |||
81c28325aa | |||
cebeba7bd7 | |||
d6d528ca25 | |||
c00c6d038c | |||
ec171c529a | |||
7ff256ec98 | |||
e56c6a83b4 | |||
5c519beb2e | |||
7d6b260174 | |||
acfe3f2664 | |||
8c69a83881 | |||
0b648155e7 | |||
91b56239e0 | |||
c3fd4a75e9 | |||
229c5c9b2a | |||
c8b2f62297 | |||
58355a5bfb | |||
c93125b120 | |||
f7a107f73e | |||
5c2a1ae876 | |||
fd5c9bb9ab | |||
a70da51ff7 | |||
8881ae1bf8 | |||
3c80fac258 | |||
8110d304f4 | |||
315c0aa08c | |||
61fcc8b939 | |||
c4f6e80671 | |||
a640328f8c | |||
2c60f4f0f2 | |||
6c02fa7bd9 | |||
fac3f4cd54 | |||
e1d715ef7d | |||
67b2d5e0bf | |||
756be09d23 | |||
a2a30038cf | |||
47e7a258db | |||
b22d935dbe | |||
f2ad7824aa | |||
61a70716cd | |||
fb01a107c5 | |||
d513acdd54 | |||
847a7c7c2e | |||
f98be4d35c | |||
07ce4d2a90 | |||
cd6a9334b6 | |||
2db2c5a186 | |||
03d338608d | |||
b9a8bef477 | |||
ecc5c82985 | |||
fcd4e26943 | |||
7ec20935bd | |||
78811ae572 | |||
7887e00355 | |||
0e9ae444bd | |||
c42c1b8a5e | |||
ec31cd76c9 | |||
1e060bf2d7 | |||
cbe63e529d | |||
755915ea4b | |||
5c8d3d3bca | |||
e52d608ddf | |||
6ab16aaf63 | |||
3e14a8dc80 | |||
f5dd3bcde9 | |||
44646747a7 | |||
aa67241bde | |||
d4c032d0b7 | |||
6e7ab46106 | |||
d7ed2c18e1 | |||
3fa4a82e6f | |||
110abb0343 | |||
cebd575cd5 | |||
22d990f138 | |||
e45b13d248 | |||
db4137ba02 | |||
100cae7359 | |||
f238709304 | |||
32456779a1 | |||
8d4ed2ad3d | |||
c5a305584f | |||
56ad465675 | |||
aec22258ef | |||
1aec7d8606 | |||
5965de2f4d | |||
30506b9216 | |||
4ae51ca54e | |||
6fcac926fb | |||
657326cfe3 | |||
f54de34ba4 | |||
ee8a06f833 | |||
1128cc939d | |||
f125d3265a | |||
ca8a932c87 | |||
f7d5b4d613 | |||
aecae56071 | |||
130634dd7c | |||
1fcaae34e1 | |||
94f0c4abd9 | |||
1ad59dd152 | |||
bc8bcdcb24 | |||
577ab7bae0 | |||
089ef25a85 | |||
9323717b47 | |||
a7848c4502 | |||
e2cd26ee70 | |||
6f91c5b5ea | |||
46b80ce25e | |||
166c03f31b | |||
3ef2e05c4d | |||
1469bcf6c5 | |||
767c5bbe01 | |||
f2a46c848c | |||
25b20b7103 | |||
198bd0516a | |||
f4d881649a | |||
d5df676938 | |||
ad866fd196 | |||
3e8cb46076 | |||
46e76e8b2b | |||
03d28d7355 | |||
1f8988b580 | |||
902aaabb11 | |||
6b50bbea00 | |||
0cf672fa91 | |||
c8376c91f6 | |||
28c3243e77 | |||
3ced80b54a | |||
96f0ee85d2 | |||
91c7bf659b | |||
191053b53d | |||
02d9cef356 | |||
e1424a97a9 | |||
2a6825c393 | |||
182a80b922 | |||
34d22c1ed5 | |||
77a1f418c8 | |||
8ed3088441 | |||
0fa4d62986 | |||
f4592a8df5 | |||
3468628a22 | |||
1e813ceb3e | |||
20f1f714ba | |||
f435a3002b | |||
5cb74dadaf | |||
d9b4538469 | |||
1f5e292520 | |||
45aec0eae4 | |||
625f1745dd | |||
e4ac19a87a | |||
cff257f584 | |||
2e6bad311d | |||
da482fe1dd | |||
32ad6aefca | |||
85d15b5143 | |||
d823a05aef | |||
8eacfd4cc2 | |||
4ff6091294 | |||
6aa576cda7 | |||
6dfc042c21 | |||
b8ee9810b0 | |||
b6e747ec5a | |||
2d6adabd53 | |||
fea5a0bdc9 | |||
575b18c0f0 | |||
6a035507fd | |||
721d3f06c9 | |||
24121aa9da | |||
28b8cc31f6 | |||
077cd91773 | |||
f340964dc9 | |||
46acb0f2b7 | |||
d288703d57 | |||
eda3af2488 | |||
05b9b8fda3 | |||
9dc3b99345 | |||
f68c91faa6 | |||
0de63c6745 | |||
b35f0131e6 | |||
eb42e0ab5c | |||
6acc17af8c | |||
3697a0cef6 | |||
cc76cf31d7 | |||
1dac1b3726 | |||
776f527926 | |||
bf878aa97e | |||
8fd7eee90e | |||
83af050800 | |||
544cd63062 | |||
3badeffb05 | |||
8e06c8b3da | |||
777fc2e9d6 | |||
ce1783ccc1 | |||
40d46934d0 | |||
1aa1683377 | |||
2e7c8b0b6f | |||
da8b7c9f89 | |||
14194f1d56 | |||
690b4ad329 | |||
3ec80d0112 | |||
2b1f67d418 | |||
e8ad339312 | |||
78675b228b | |||
60ff07585c | |||
457e050628 | |||
12edef9a6a | |||
4dbecff9fb | |||
4954e079c8 | |||
0b973381dc | |||
331e1fcbee | |||
097c818bf0 | |||
cb51aa48a7 | |||
e403f8d43e | |||
2d6a581960 | |||
444647d1e3 | |||
c106c8a18c | |||
6318808270 | |||
ebea341856 | |||
4035152a87 | |||
64a6682b93 | |||
d4528d9ac2 | |||
0c5b7b93a3 | |||
7636ef4630 | |||
19bac57b26 | |||
43b3851975 | |||
48de890392 | |||
09cbae6297 | |||
82bdf6d5ae | |||
701477e8c3 | |||
9be5773fbb | |||
b216dd41d7 | |||
7b0075a242 | |||
d1ec4d7a5a | |||
3c7a12b416 | |||
cbcf5ba7d4 | |||
f5a8f969dd | |||
f9bfa10797 | |||
c42b397845 | |||
f2144a3063 | |||
47919e46ab | |||
7534be6fbc | |||
63fbcc6927 | |||
e542d52a7c | |||
9147bf2a73 | |||
22a1ec68d5 | |||
a9e96b1ee0 | |||
5f48643e0a | |||
a7c76142a0 | |||
22a5ebe44b | |||
8b54ef4147 | |||
a480572244 | |||
388f3368cb | |||
53d9a92497 | |||
87f3d69dac | |||
acec6c3d02 | |||
3879b33447 | |||
a11010c07d | |||
8ddfb40e2d | |||
3e64748c72 | |||
3f11d7820a | |||
64bf389bca | |||
a3a623dd57 | |||
16928a161b | |||
939cc47431 | |||
10a4e969a6 | |||
8feb499ba2 | |||
bf69fd9b22 | |||
7a4769bbdb | |||
1fdb582a09 | |||
067c00f533 | |||
1a94521770 | |||
08cb0b3cfc | |||
180ca598c4 | |||
f24d4671d4 | |||
e1ec2a1ea6 | |||
5705a7e066 | |||
e170af3ac0 | |||
88e3e8be7c | |||
5d3e02aaa2 | |||
84e96866ac | |||
651153216b | |||
a49cf8a57d | |||
f4e7157716 | |||
9a152d481b | |||
df3de82c06 | |||
8db5f642e9 | |||
16208bca89 | |||
3f3ec73d39 | |||
c9bece0c8f | |||
eb78ccf391 | |||
d3209478d5 | |||
13e5668a84 | |||
8fa592e3dc | |||
e195b43932 | |||
664085ab74 | |||
abe3ee9cc5 | |||
a8e34e298e | |||
181c80d6eb | |||
56d672afeb | |||
b9ebee4939 | |||
c3c4bd4e75 | |||
adefc3955b | |||
09a40ab471 | |||
70a339970c | |||
f69b841d2b | |||
4f377369a8 | |||
86823575fd | |||
69a0f3ee23 | |||
6a9948c018 | |||
e3f0cae719 | |||
7311161340 | |||
b55501c00c | |||
5c153e200f | |||
232514041d | |||
dd6cd7dd63 | |||
f055724b27 | |||
c4a04dc024 | |||
85453c4247 | |||
1daaebfa0c | |||
7d9576edcb | |||
9de2972c30 | |||
be44cabd7f | |||
32db8dd75b | |||
a3f33b6531 | |||
707302b2cf | |||
0f15d0344d | |||
c14c6b083e | |||
be291b330a | |||
38fd207e53 | |||
d412487eb7 | |||
7803e6f3ed | |||
84255632cb | |||
b557a36890 | |||
e4e50f52e8 | |||
e74d6c5009 | |||
5388607f3d | |||
115c02e871 | |||
b4ad955d9e | |||
3b4a542c06 | |||
13f3d40cbf | |||
3c2051f86a | |||
2348cf20e7 | |||
484640eaf6 | |||
41e097e91a | |||
1112330e46 | |||
a2e2717411 | |||
a7a82f9889 | |||
521ac51748 | |||
1466051d12 | |||
e2aeee6811 | |||
f4c3acdf35 | |||
e88d638ac6 | |||
55bc5090b9 | |||
38f6f47be9 | |||
946c489c68 | |||
de1ecd5302 | |||
165ed4a00e | |||
ed5a25841f | |||
be18d3a732 | |||
6c5d4e7cf4 | |||
5320ce02d8 | |||
9b5655a89e | |||
899ae0d2b5 | |||
7922e247f1 | |||
647247740f | |||
335f6bc251 | |||
e4c48e02b4 | |||
6ec87af68e | |||
20448818c4 | |||
528d37bdfe | |||
fb1b7d8ed0 | |||
d26d18a1a6 | |||
2cc33bfe20 | |||
c2709cdaaa | |||
4e21a95afe | |||
ffec099e75 | |||
d06f261cb1 | |||
35153940e3 | |||
423af1977f | |||
30605477f2 | |||
36c820e6c8 | |||
c23dae4e5c | |||
948897687e | |||
63e67ee013 | |||
ce2e300a4f | |||
0165410712 | |||
aa98871c77 | |||
1499e1d5f4 | |||
683241de5a | |||
6c3f7d7fd6 | |||
44948f5b69 | |||
e1506cb4eb | |||
909d647aab | |||
da4f146f83 | |||
3edbc2c4a9 | |||
d6fa6f3e92 | |||
846f694908 | |||
9734c81f3a | |||
6eeca586d4 | |||
b2fd033cd5 | |||
7641c3c782 | |||
4567905790 | |||
86941f55d5 | |||
6b56ac24df | |||
632ed550c7 | |||
3b5417687d | |||
fd06fd1442 | |||
f23814e0cd | |||
7471357081 | |||
a256fccfe1 | |||
16e4833492 | |||
6d7d465a04 | |||
1b16bf4ec7 | |||
045176bf35 | |||
a500d73ac0 | |||
bd70595c9d | |||
12a6278135 | |||
a3711708f7 | |||
8f84fef2eb | |||
0714b2ba4c | |||
d4ad29be2a | |||
043c954e9f | |||
d3c236f91c | |||
5dd21f2a75 | |||
d65707a5b4 | |||
9c9ed0f3f6 | |||
7a61c13834 | |||
27944fac9c | |||
caaa1b8f13 | |||
47cab73499 | |||
af4dad0fa2 | |||
c40e14b4be | |||
aa23d432cd | |||
852fa7d04a | |||
081c6330b1 | |||
a147ef3837 | |||
e1abc44814 | |||
c4951f11b7 | |||
08a2e796e8 | |||
07613d2020 | |||
4a7acedd3c | |||
1795bfe4a1 | |||
326ecb7814 | |||
2d1f2e706c | |||
bf5343d233 | |||
89c5ce4dcd | |||
788c315165 | |||
19e57fd902 | |||
2f5fb5e09d | |||
8c9b8431ee | |||
845659340e | |||
a90629aa13 | |||
f19fdbba22 | |||
ad664f54ff | |||
fe7cb869a8 | |||
f272378d52 | |||
e335b2ca90 | |||
13709bdbf8 | |||
62455ed872 | |||
05d377bdd2 | |||
1f4ec305f0 | |||
8a52daa2d4 | |||
72978b9789 | |||
bcf2aed1a9 | |||
75618aaf88 | |||
59254c9beb | |||
2d9bf021a1 | |||
27b175b9a2 | |||
bf773e0467 | |||
fb98f4b10d | |||
7bb22f58b8 | |||
360194bfb5 | |||
c120fcc06a | |||
96c807feb8 | |||
b731d7830e | |||
aef9746874 | |||
568583adf7 | |||
561e60732f | |||
ad6d5acb42 | |||
6b4d18c7b3 | |||
c6cd55d38e | |||
2562303a45 | |||
b0e48bfdfe | |||
f093e7ad6b | |||
813a2f683d | |||
9fc567db7b | |||
c759ae5509 | |||
d81275974a | |||
67d0c6eb94 | |||
add254feea | |||
547147084d | |||
1e4434d652 | |||
bc429a0e54 | |||
bf32184d48 | |||
9dfcca0353 | |||
88b4cc5fe9 | |||
2a004db6c7 | |||
f7bd305904 | |||
69ba4d0971 | |||
1476b6d487 | |||
eb6d21cc0e | |||
96619805cb | |||
1a982aef18 | |||
2c359dd609 | |||
39c7e7a6b7 | |||
609e31dd3e | |||
ecd937164f | |||
14435163a0 | |||
fd90b67afe | |||
173c230e66 | |||
b052424c0d | |||
4c4ea03d7a | |||
9e0809911c | |||
cc7499dd03 | |||
d45242c616 | |||
73f34b31f5 | |||
8ceac55c29 | |||
b547201561 | |||
31bd8cb6d0 | |||
2fa4a8b991 | |||
3f305eb1e9 | |||
5de555cae2 | |||
f7f52b1592 | |||
387935345c | |||
5ea25b7801 | |||
c1b2aea80c | |||
a06b407fce | |||
c57932c663 | |||
144276aa1a | |||
2be4d86740 | |||
c0b64e9daa | |||
502278d5b2 | |||
ac75bd1b1e | |||
53603043c7 | |||
3f63c44d12 | |||
659bd66529 | |||
c9d9eddaa4 | |||
bfb59c172b | |||
39f775cc05 | |||
c4a6bc4977 | |||
7c4ce7eb03 | |||
ae974a2bbf | |||
0420a03240 | |||
a8b12e4f27 | |||
d2c9fe850b | |||
56a46886ad | |||
3bdda17adc | |||
bf5d6f431e | |||
1fbe229b3c | |||
04cbe68797 | |||
56ecebf22d | |||
abed6fca87 | |||
d12a6ef9c2 | |||
ce958c191c | |||
f969e393a9 | |||
3166570f7c | |||
e11013d19c | |||
69d4634635 | |||
0ca460eada | |||
b0b968efd5 | |||
3621d42e0f | |||
1b28a99d14 | |||
c0d74ed43b | |||
7cce4768ae | |||
7d633ec400 | |||
81d0ffbc3b | |||
66220e3e61 | |||
6c3ef35064 | |||
8a1a2ac558 | |||
43692df590 | |||
b121c7871f | |||
545c815c4c | |||
34497fdb37 | |||
4ff19ced3a | |||
58c73c1789 | |||
525c3d40a9 | |||
8c13e4fef0 | |||
110c64209c | |||
a35f6aee6a | |||
c31300e69f | |||
2afc3bfd8b | |||
ee8553e156 | |||
dcd9865385 | |||
7c99cb93c5 | |||
fb828ed21d | |||
ad8a5e5daa | |||
b811851b8d | |||
a76e46044d | |||
107a7bd06b | |||
595ade9f41 | |||
3d4a0ccbc6 | |||
7828b5ccb0 | |||
d8dbd61107 | |||
60d4777190 | |||
4d5383fd36 | |||
c9e6c8c02f | |||
8d96348704 | |||
73bc011483 | |||
e8da987570 | |||
d879d360eb | |||
6a140adb78 | |||
2d1de285b3 | |||
4aa0959d60 | |||
5f99a7fd23 | |||
6244c173ba | |||
b8893d0277 | |||
f7ea2b5d7f | |||
b509716b33 | |||
adf4384501 | |||
bb175dfc53 | |||
5b13f4375d | |||
de658ab4e4 | |||
6962a2dd7e | |||
3ce55d22e4 | |||
67cc35ade9 | |||
37623bf49a | |||
cd223d93da | |||
fa1ceca232 | |||
ee0d7552e2 | |||
7afe94e7e2 | |||
0d11a25e6d | |||
af8600678d | |||
be9e5185b4 | |||
6852c88fc7 | |||
3804161eb6 | |||
885de7f8cf | |||
5b31c7d08a | |||
52c5f7adc8 | |||
37ede4d5f5 | |||
470317f5c7 | |||
0a31be6ba2 | |||
72dc6d60ab | |||
b8761bb215 | |||
1a60d6bcd6 | |||
e978774ec6 | |||
6582d5872d | |||
65ecb4b434 | |||
426f9772b8 | |||
9927ca6274 | |||
9959a1dd9d | |||
0c8a9d2d51 | |||
a331653dad | |||
27d72bd517 | |||
79d9d2432f | |||
2e878906e4 | |||
070c1c82b0 | |||
b81c7c0892 | |||
328eac61cd | |||
6059354da6 | |||
67e2804ecb | |||
54ebbde1e1 | |||
88e22e4e8c | |||
0fb9066aaf | |||
7022759b7e | |||
2a1c7b57ff | |||
1dfc35677e | |||
7ee54d8356 | |||
9f9ce6130d | |||
1d6c713b18 | |||
4f10759024 | |||
5432ec8ded | |||
81748c62c7 | |||
9ccdbb5d61 | |||
840955ff7c | |||
03f3736511 | |||
2a9ca74164 | |||
48e9d6862a | |||
3f24e6c21c | |||
5314dffc85 | |||
a4d0a3fd50 | |||
aaabde58cb | |||
cb4a6614fa | |||
9cae1d5ed6 | |||
62aa1b56d6 | |||
1aac8114ae | |||
1fbee8dadf | |||
741fecedaa | |||
d83ded2dba | |||
220bcb0535 | |||
9c19a898f9 | |||
7a367cca30 | |||
4c3f3b4d46 | |||
ec4e379125 | |||
5237c2b847 | |||
b4ee10dfde | |||
bfc48afa14 | |||
a4b1c0977a | |||
55671efe80 | |||
943a2f2b60 | |||
fd9a55254f | |||
969209ce07 | |||
89626e8d69 | |||
ac6797b28c | |||
cfa30de3b8 | |||
c881b32215 | |||
cb43623acd | |||
8372a8c127 | |||
26eb2feedd | |||
001390a684 | |||
fa4126087b | |||
9a15c48d2d | |||
2cd9b2d8ee | |||
10d1650843 | |||
81e6a22192 | |||
d24f6aabbb | |||
5caa1e0eb0 | |||
a6c612a4ad | |||
9fa79000ec | |||
169afbe9aa | |||
316befbb0c | |||
f61208bde9 | |||
1951b95cb2 | |||
a28a644680 | |||
14687aad81 | |||
cab9eed62e | |||
06e43a8f2c | |||
4fb341d741 | |||
b2df3510b7 |
34
.cvsignore
34
.cvsignore
@ -1,34 +0,0 @@
|
||||
*.a
|
||||
*.o
|
||||
*~
|
||||
.git
|
||||
ABOUT-NLS
|
||||
COPYING
|
||||
INSTALL
|
||||
Makefile
|
||||
Makefile.in
|
||||
aclocal.m4
|
||||
autom4te.cache
|
||||
config.cache
|
||||
config.guess
|
||||
config.h
|
||||
config.h.in
|
||||
config.log
|
||||
config.rpath
|
||||
config.status
|
||||
config.sub
|
||||
configure
|
||||
coverage
|
||||
libtool
|
||||
libvirt-*.tar.gz
|
||||
libvirt.pc
|
||||
libvirt.spec
|
||||
ltconfig
|
||||
ltmain.sh
|
||||
mingw32-libvirt.spec
|
||||
mkinstalldirs
|
||||
results.log
|
||||
stamp-h
|
||||
stamp-h.in
|
||||
stamp-h1
|
||||
update.log
|
13
.gitignore
vendored
13
.gitignore
vendored
@ -2,6 +2,7 @@
|
||||
*.o
|
||||
*~
|
||||
.git
|
||||
.git-module-status
|
||||
ABOUT-NLS
|
||||
COPYING
|
||||
INSTALL
|
||||
@ -19,6 +20,8 @@ config.status
|
||||
config.sub
|
||||
configure
|
||||
coverage
|
||||
cscope.files
|
||||
cscope.out
|
||||
libtool
|
||||
libvirt-*.tar.gz
|
||||
libvirt.pc
|
||||
@ -32,3 +35,13 @@ stamp-h
|
||||
stamp-h.in
|
||||
stamp-h1
|
||||
update.log
|
||||
tests/*.log
|
||||
/GNUmakefile
|
||||
/maint.mk
|
||||
gnulib/
|
||||
*.orig
|
||||
*.rej
|
||||
*#*#
|
||||
*.#*#
|
||||
ChangeLog
|
||||
NEWS
|
||||
|
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
[submodule "gnulib"]
|
||||
path = .gnulib
|
||||
url = git://git.sv.gnu.org/gnulib.git
|
1
.gnulib
Submodule
1
.gnulib
Submodule
Submodule .gnulib added at 28db629d4f
21
.hgignore
21
.hgignore
@ -46,12 +46,19 @@ docs/examples/info1
|
||||
docs/examples/python/Makefile
|
||||
docs/examples/python/Makefile.in
|
||||
docs/examples/suspend
|
||||
docs/schemas/Makefile
|
||||
docs/schemas/Makefile.in
|
||||
examples/domain-events/events-c/*.exe
|
||||
examples/domain-events/events-c/.deps
|
||||
examples/domain-events/events-c/.libs
|
||||
examples/domain-events/events-c/Makefile
|
||||
examples/domain-events/events-c/Makefile.in
|
||||
examples/domain-events/events-c/event-test
|
||||
examples/hellolibvirt/.deps
|
||||
examples/hellolibvirt/.libs
|
||||
examples/hellolibvirt/Makefile
|
||||
examples/hellolibvirt/Makefile.in
|
||||
examples/hellolibvirt/hellolibvirt
|
||||
gnulib/lib/*.la
|
||||
gnulib/lib/*.lo
|
||||
gnulib/lib/.deps
|
||||
@ -228,9 +235,11 @@ src/*.exe
|
||||
src/*.gcda
|
||||
src/*.gcno
|
||||
src/*.gcov
|
||||
src/*.i
|
||||
src/*.la
|
||||
src/*.lo
|
||||
src/*.loT
|
||||
src/*.s
|
||||
src/.deps
|
||||
src/.libs
|
||||
src/Makefile
|
||||
@ -254,12 +263,20 @@ tests/Makefile.in
|
||||
tests/confdata/Makefile
|
||||
tests/confdata/Makefile.in
|
||||
tests/conftest
|
||||
tests/eventtest
|
||||
tests/nodedevxml2xmltest
|
||||
tests/nodeinfotest
|
||||
tests/object-locking
|
||||
tests/object-locking-files.txt
|
||||
tests/object-locking.cmi
|
||||
tests/object-locking.cmx
|
||||
tests/qemuargv2xmltest
|
||||
tests/qemuhelptest
|
||||
tests/qemuxml2argvtest
|
||||
tests/qemuxml2xmltest
|
||||
tests/qparamtest
|
||||
tests/reconnect
|
||||
tests/seclabeltest
|
||||
tests/sexpr2xmldata/Makefile
|
||||
tests/sexpr2xmldata/Makefile.in
|
||||
tests/sexpr2xmltest
|
||||
@ -274,4 +291,8 @@ tests/xmconfigtest
|
||||
tests/xml2sexprdata/Makefile
|
||||
tests/xml2sexprdata/Makefile.in
|
||||
tests/xml2sexprtest
|
||||
tools/Makefile
|
||||
tools/Makefile.in
|
||||
tools/virt-xml-validate
|
||||
tools/virt-xml-validate.1
|
||||
update.log
|
||||
|
@ -1,5 +1 @@
|
||||
^gnulib/lib/getaddrinfo\.c$
|
||||
^gnulib/lib/printf-parse\.c$
|
||||
^gnulib/lib/vasnprintf\.c$
|
||||
^build-aux/useless-if-before-free$
|
||||
^ChangeLog$
|
||||
^ChangeLog
|
||||
|
@ -1,5 +1,6 @@
|
||||
^src/util\.c$
|
||||
^src/xend_internal\.c$
|
||||
^src/util-lib\.c$
|
||||
^qemud/qemud.c$
|
||||
^src/libvirt\.c$
|
||||
^src/qemu/qemu_driver\.c$
|
||||
^src/util/util\.c$
|
||||
^src/xen/xend_internal\.c$
|
||||
^daemon/libvirtd.c$
|
||||
^gnulib/
|
||||
|
@ -4,5 +4,5 @@ docs/html/libvirt-virterror.html
|
||||
docs/libvirt-api.xml
|
||||
docs/libvirt-refs.xml
|
||||
include/libvirt/virterror.h
|
||||
qemud/remote.c
|
||||
src/virterror.c
|
||||
daemon/dispatch.c
|
||||
src/util/virterror.c
|
||||
|
@ -4,7 +4,7 @@ ChangeLog
|
||||
^Makefile*
|
||||
^docs/
|
||||
^tests/
|
||||
^src/virsh\.c
|
||||
^src/console\.c
|
||||
^src/virterror\.c
|
||||
^tools/virsh\.c
|
||||
^tools/console\.c
|
||||
^src/util/virterror\.c
|
||||
^build-aux/
|
||||
|
1
.x-sc_prohibit_strcmp_and_strncmp
Normal file
1
.x-sc_prohibit_strcmp_and_strncmp
Normal file
@ -0,0 +1 @@
|
||||
^gnulib/
|
1
.x-sc_prohibit_strncpy
Normal file
1
.x-sc_prohibit_strncpy
Normal file
@ -0,0 +1 @@
|
||||
src/util/util.c
|
@ -1,6 +1,5 @@
|
||||
^docs/examples/info1\.c$
|
||||
^docs/examples/suspend\.c$
|
||||
^examples/
|
||||
^gnulib/lib/dummy\.c$
|
||||
^gnulib/tests/dummy\.c$
|
||||
^qemud/remote_protocol\.c$
|
||||
^daemon/remote_protocol\.c$
|
||||
^ChangeLog$
|
||||
|
@ -1,2 +1 @@
|
||||
^docs/examples/info1\.c$
|
||||
^docs/examples/suspend\.c$
|
||||
^examples/
|
||||
|
16
AUTHORS
16
AUTHORS
@ -22,6 +22,7 @@ The primary maintainers and people with commit access rights:
|
||||
Dan Smith <danms@us.ibm.com>
|
||||
Guido Günther <agx@sigxcpu.org>
|
||||
John Levon <john.levon@sun.com>
|
||||
Matthias Bolte <matthias.bolte@googlemail.com>
|
||||
|
||||
Patches have also been contributed by:
|
||||
|
||||
@ -52,7 +53,7 @@ Patches have also been contributed by:
|
||||
Charles Duffy <Charles_Duffy@messageone.com>
|
||||
Nguyen Anh Quynh <aquynh@gmail.com>
|
||||
James Morris <jmorris@namei.org>
|
||||
Chris Wrigh <chrisw@redhat.com>
|
||||
Chris Wright <chrisw@redhat.com>
|
||||
Ben Guthro <ben.guthro@gmail.com>
|
||||
Shigeki Sakamoto <fj0588di@aa.jp.fujitsu.com>
|
||||
Gerd von Egidy <lists@egidy.de>
|
||||
@ -63,11 +64,22 @@ Patches have also been contributed by:
|
||||
James Morris <jmorris@namei.org>
|
||||
Daniel J Walsh <dwalsh@redhat.com>
|
||||
Maximilian Wilhelm <max@rfc2324.org>
|
||||
Ryota Ozaki <ozaki.ryota@gmail.com>
|
||||
Pritesh Kothari <Pritesh.Kothari@Sun.COM>
|
||||
Amit Shah <amit.shah@redhat.com>
|
||||
Florian Vichot <florian.vichot@diateam.net>
|
||||
Takahashi Tomohiro <takatom@jp.fujitsu.com>
|
||||
Serge E. Hallyn <serue@us.ibm.com>
|
||||
Soren Hansen <soren@canonical.com>
|
||||
Laine Stump <laine@redhat.com>
|
||||
Abel Míguez Rodríguez<amiguezr@pdi.ucm.es>
|
||||
Doug Goldstein <cardoe@gentoo.org>
|
||||
Javier Fontan <jfontan@gmail.com>
|
||||
Federico Simoncelli <federico.simoncelli@gmail.com>
|
||||
Amy Griffis <amy.griffis@hp.com>
|
||||
Henrik Persson E <henrik.e.persson@ericsson.com>
|
||||
Satoru SATOH <satoru.satoh@gmail.com>
|
||||
Paolo Bonzini <pbonzini@redhat.com>
|
||||
Miloslav Trmač <mitr@redhat.com>
|
||||
|
||||
[....send patches to get your name here....]
|
||||
|
||||
|
@ -506,5 +506,3 @@ if necessary. Here is a sample; alter the names:
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
||||
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
60
GNUmakefile
60
GNUmakefile
@ -1,60 +0,0 @@
|
||||
# Having a separate GNUmakefile lets me `include' the dynamically
|
||||
# generated rules created via Makefile.maint as well as Makefile.maint itself.
|
||||
# This makefile is used only if you run GNU Make.
|
||||
# It is necessary if you want to build targets usually of interest
|
||||
# only to the maintainer.
|
||||
|
||||
# Copyright (C) 2001, 2003, 2006-2008 Free Software Foundation, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Systems where /bin/sh is not the default shell need this. The $(shell)
|
||||
# command below won't work with e.g. stock DOS/Windows shells.
|
||||
ifeq ($(wildcard /bin/s[h]),/bin/sh)
|
||||
SHELL = /bin/sh
|
||||
else
|
||||
# will be used only with the next shell-test line, then overwritten
|
||||
# by a configured-in value
|
||||
SHELL = sh
|
||||
endif
|
||||
|
||||
_have-Makefile := $(shell test -f Makefile && echo yes)
|
||||
|
||||
# If the user runs GNU make but has not yet run ./configure,
|
||||
# give them a diagnostic.
|
||||
ifeq ($(_have-Makefile),yes)
|
||||
|
||||
# Make tar archive easier to reproduce.
|
||||
export TAR_OPTIONS = --owner=0 --group=0 --numeric-owner
|
||||
|
||||
include Makefile
|
||||
|
||||
include $(srcdir)/Makefile.cfg
|
||||
include $(srcdir)/Makefile.maint
|
||||
|
||||
else
|
||||
|
||||
all:
|
||||
@echo There seems to be no Makefile in this directory. 1>&2
|
||||
@echo "You must run ./configure before running \`make'." 1>&2
|
||||
@exit 1
|
||||
|
||||
check dist distcheck install: all
|
||||
|
||||
endif
|
||||
|
||||
# Tell version 3.79 and up of GNU make to not build goals in this
|
||||
# directory in parallel. This is necessary in case someone tries to
|
||||
# build multiple targets on one command line.
|
||||
.NOTPARALLEL:
|
33
HACKING
33
HACKING
@ -231,6 +231,37 @@ one of the following semantically named macros
|
||||
|
||||
|
||||
|
||||
String copying
|
||||
==============
|
||||
|
||||
Do not use the strncpy function. According to the man page, it does
|
||||
*not* guarantee a NULL-terminated buffer, which makes it extremely dangerous
|
||||
to use. Instead, use one of the functionally equivalent functions:
|
||||
|
||||
- virStrncpy(char *dest, const char *src, size_t n, size_t destbytes)
|
||||
The first three arguments have the same meaning as for strncpy; namely the
|
||||
destination, source, and number of bytes to copy, respectively. The last
|
||||
argument is the number of bytes available in the destination string; if a
|
||||
copy of the source string (including a \0) will not fit into the
|
||||
destination, no bytes are copied and the routine returns NULL.
|
||||
Otherwise, n bytes from the source are copied into the destination and a
|
||||
trailing \0 is appended.
|
||||
|
||||
- virStrcpy(char *dest, const char *src, size_t destbytes)
|
||||
Use this variant if you know you want to copy the entire src string
|
||||
into dest. Note that this is a macro, so arguments could be
|
||||
evaluated more than once. This is equivalent to
|
||||
virStrncpy(dest, src, strlen(src), destbytes)
|
||||
|
||||
- virStrcpyStatic(char *dest, const char *src)
|
||||
Use this variant if you know you want to copy the entire src string
|
||||
into dest *and* you know that your destination string is a static string
|
||||
(i.e. that sizeof(dest) returns something meaningful). Note that
|
||||
this is a macro, so arguments could be evaluated more than once. This is
|
||||
equivalent to virStrncpy(dest, src, strlen(src), sizeof(dest)).
|
||||
|
||||
|
||||
|
||||
Variable length string buffer
|
||||
=============================
|
||||
|
||||
@ -312,7 +343,7 @@ gcc's printf attribute directive in the prototype. For example, here's
|
||||
the one for virAsprintf, in util.h:
|
||||
|
||||
int virAsprintf(char **strp, const char *fmt, ...)
|
||||
ATTRIBUTE_FORMAT(printf, 2, 3);
|
||||
ATTRIBUTE_FMT_PRINTF(2, 3);
|
||||
|
||||
This makes it so gcc's -Wformat and -Wformat-security options can do
|
||||
their jobs and cross-check format strings with the number and types
|
||||
|
44
Makefile.am
44
Makefile.am
@ -3,29 +3,43 @@
|
||||
LCOV = lcov
|
||||
GENHTML = genhtml
|
||||
|
||||
SUBDIRS = gnulib/lib include src qemud proxy docs gnulib/tests \
|
||||
python tests po examples/domain-events/events-c examples/hellolibvirt
|
||||
SUBDIRS = gnulib/lib include src daemon tools proxy docs gnulib/tests \
|
||||
python tests po examples/domain-events/events-c examples/hellolibvirt \
|
||||
examples/dominfo examples/domsuspend examples/python
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4 -I gnulib/m4
|
||||
|
||||
XML_EXAMPLES = $(wildcard examples/xml/test/*.xml) $(wildcard examples/xml/storage/*.xml)
|
||||
|
||||
EXTRA_DIST = \
|
||||
ChangeLog-old \
|
||||
libvirt.spec libvirt.spec.in \
|
||||
mingw32-libvirt.spec.in \
|
||||
libvirt.pc libvirt.pc.in \
|
||||
$(man_MANS) autobuild.sh \
|
||||
autobuild.sh \
|
||||
.x-sc_avoid_if_before_free \
|
||||
.x-sc_require_config_h_first \
|
||||
.x-sc_prohibit_strcmp \
|
||||
.x-sc_prohibit_strcmp_and_strncmp \
|
||||
.x-sc_require_config_h \
|
||||
.x-sc_prohibit_nonreentrant \
|
||||
Makefile.nonreentrant \
|
||||
autogen.sh
|
||||
|
||||
man_MANS = virsh.1
|
||||
autogen.sh \
|
||||
examples/domain-events/events-python \
|
||||
$(XML_EXAMPLES)
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = libvirt.pc
|
||||
|
||||
NEWS: $(top_srcdir)/docs/news.xsl $(top_srcdir)/docs/news.html.in
|
||||
-@(if [ -x $(XSLTPROC) ] ; then \
|
||||
$(XSLTPROC) --nonet $(top_srcdir)/docs/news.xsl \
|
||||
$(top_srcdir)/docs/news.html.in \
|
||||
| perl -0777 -pe 's/\n\n+$$/\n/' \
|
||||
| perl -pe 's/[ \t]+$$//' \
|
||||
> $@-t && mv $@-t $@ ; fi );
|
||||
|
||||
|
||||
rpm: clean
|
||||
@(unset CDPATH ; $(MAKE) dist && rpmbuild -ta $(distdir).tar.gz)
|
||||
|
||||
@ -38,7 +52,7 @@ tests:
|
||||
|
||||
cov: clean-cov
|
||||
mkdir $(top_builddir)/coverage
|
||||
$(LCOV) -c -o $(top_builddir)/coverage/libvirt.info.tmp -d $(top_srcdir)/src -d $(top_srcdir)/qemud -d $(top_srcdir)/tests
|
||||
$(LCOV) -c -o $(top_builddir)/coverage/libvirt.info.tmp -d $(top_srcdir)/src -d $(top_srcdir)/daemon -d $(top_srcdir)/tests
|
||||
$(LCOV) -r $(top_builddir)/coverage/libvirt.info.tmp -o $(top_builddir)/coverage/libvirt.info *usr*
|
||||
rm $(top_builddir)/coverage/libvirt.info.tmp
|
||||
$(GENHTML) -s -t "libvirt" -o $(top_builddir)/coverage --legend $(top_builddir)/coverage/libvirt.info
|
||||
@ -46,5 +60,21 @@ cov: clean-cov
|
||||
clean-cov:
|
||||
rm -rf $(top_builddir)/coverage
|
||||
|
||||
MAINTAINERCLEANFILES = .git-module-status
|
||||
|
||||
# disable this check
|
||||
distuninstallcheck:
|
||||
|
||||
dist-hook: gen-ChangeLog
|
||||
|
||||
# Generate the ChangeLog file (with all entries since the switch to git)
|
||||
# and insert it into the directory we're about to use to create a tarball.
|
||||
gen_start_date = 2009-07-04
|
||||
.PHONY: gen-ChangeLog
|
||||
gen-ChangeLog:
|
||||
if test -d .git; then \
|
||||
$(top_srcdir)/build-aux/gitlog-to-changelog \
|
||||
--since=$(gen_start_date) > $(distdir)/cl-t; \
|
||||
rm -f $(distdir)/ChangeLog; \
|
||||
mv $(distdir)/cl-t $(distdir)/ChangeLog; \
|
||||
fi
|
||||
|
62
Makefile.cfg
62
Makefile.cfg
@ -1,62 +0,0 @@
|
||||
# Customize Makefile.maint. -*- makefile -*-
|
||||
# Copyright (C) 2003-2009 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Use alpha.gnu.org for alpha and beta releases.
|
||||
# Use ftp.gnu.org for major releases.
|
||||
gnu_ftp_host-alpha = alpha.gnu.org
|
||||
gnu_ftp_host-beta = alpha.gnu.org
|
||||
gnu_ftp_host-major = ftp.gnu.org
|
||||
gnu_rel_host = $(gnu_ftp_host-$(RELEASE_TYPE))
|
||||
|
||||
url_dir_list = \
|
||||
ftp://$(gnu_rel_host)/gnu/coreutils
|
||||
|
||||
# Tests not to run as part of "make distcheck".
|
||||
local-checks-to-skip = \
|
||||
changelog-check \
|
||||
check-AUTHORS \
|
||||
makefile-check \
|
||||
makefile_path_separator_check \
|
||||
patch-check \
|
||||
sc_GPL_version \
|
||||
sc_always_defined_macros \
|
||||
sc_cast_of_alloca_return_value \
|
||||
sc_dd_max_sym_length \
|
||||
sc_error_exit_success \
|
||||
sc_file_system \
|
||||
sc_immutable_NEWS \
|
||||
sc_makefile_path_separator_check \
|
||||
sc_obsolete_symbols \
|
||||
sc_prohibit_S_IS_definition \
|
||||
sc_prohibit_atoi_atof \
|
||||
sc_prohibit_jm_in_m4 \
|
||||
sc_prohibit_quote_without_use \
|
||||
sc_prohibit_quotearg_without_use \
|
||||
sc_prohibit_stat_st_blocks \
|
||||
sc_root_tests \
|
||||
sc_space_tab \
|
||||
sc_sun_os_names \
|
||||
sc_system_h_headers \
|
||||
sc_tight_scope \
|
||||
sc_two_space_separator_in_usage \
|
||||
sc_useless_cpp_parens
|
||||
|
||||
useless_free_options = \
|
||||
--name=sexpr_free \
|
||||
--name=VIR_FREE \
|
||||
--name=xmlFree \
|
||||
--name=xmlXPathFreeContext \
|
||||
--name=xmlXPathFreeObject
|
827
Makefile.maint
827
Makefile.maint
@ -1,827 +0,0 @@
|
||||
# This is reported not to work with make-3.79.1
|
||||
# ME := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
|
||||
ME := Makefile.maint
|
||||
|
||||
# Do not save the original name or timestamp in the .tar.gz file.
|
||||
# Use --rsyncable if available.
|
||||
gzip_rsyncable := \
|
||||
$(shell gzip --help 2>/dev/null|grep rsyncable >/dev/null && echo --rsyncable)
|
||||
GZIP_ENV = '--no-name --best $(gzip_rsyncable)'
|
||||
|
||||
VC_LIST = $(srcdir)/build-aux/vc-list-files
|
||||
|
||||
VC_LIST_EXCEPT = \
|
||||
$(VC_LIST) | if test -f .x-$@; then grep -vEf .x-$@; else grep -v ChangeLog; fi
|
||||
|
||||
include Makefile.nonreentrant
|
||||
|
||||
# Prevent programs like 'sort' from considering distinct strings to be equal.
|
||||
# Doing it here saves us from having to set LC_ALL elsewhere in this file.
|
||||
export LC_ALL = C
|
||||
|
||||
# Collect the names of rules starting with `sc_'.
|
||||
syntax-check-rules := $(shell sed -n 's/^\(sc_[a-zA-Z0-9_-]*\):.*/\1/p' \
|
||||
$(srcdir)/$(ME))
|
||||
.PHONY: $(syntax-check-rules)
|
||||
|
||||
local-checks-available = \
|
||||
patch-check $(syntax-check-rules) \
|
||||
makefile-check check-AUTHORS
|
||||
.PHONY: $(local-checks-available)
|
||||
|
||||
# Arrange to print the name of each syntax-checking rule just before running it.
|
||||
$(syntax-check-rules): %: %.m
|
||||
$(patsubst %, %.m, $(syntax-check-rules)):
|
||||
@echo "CHECK:" $(patsubst sc_%.m, %, $@)
|
||||
|
||||
local-check := $(filter-out $(local-checks-to-skip), $(local-checks-available))
|
||||
|
||||
syntax-check: $(local-check)
|
||||
# @grep -nE '# *include <(limits|std(def|arg|bool))\.h>' \
|
||||
# $$(find -type f -name '*.[chly]') && \
|
||||
# { echo '$(ME): found conditional include' 1>&2; \
|
||||
# exit 1; } || :
|
||||
|
||||
# grep -nE '^# *include <(string|stdlib)\.h>' \
|
||||
# $(srcdir)/{lib,src}/*.[chy] && \
|
||||
# { echo '$(ME): FIXME' 1>&2; \
|
||||
# exit 1; } || :
|
||||
# FIXME: don't allow `#include .strings\.h' anywhere
|
||||
|
||||
# By default, _prohibit_regexp does not ignore case.
|
||||
export ignore_case =
|
||||
_ignore_case = $$(test -n "$$ignore_case" && echo -i || :)
|
||||
|
||||
# There are many rules below that prohibit constructs in this package.
|
||||
# If the offending construct can be matched with a grep-E-style regexp,
|
||||
# use this macro. The shell variables "re" and "msg" must be defined.
|
||||
define _prohibit_regexp
|
||||
dummy=; : so we do not need a semicolon before each use \
|
||||
test "x$$re" != x || { echo '$(ME): re not defined' 1>&2; exit 1; }; \
|
||||
test "x$$msg" != x || { echo '$(ME): msg not defined' 1>&2; exit 1; };\
|
||||
grep $(_ignore_case) -nE "$$re" $$($(VC_LIST_EXCEPT)) && \
|
||||
{ echo '$(ME): '"$$msg" 1>&2; exit 1; } || :
|
||||
endef
|
||||
|
||||
sc_avoid_if_before_free:
|
||||
@$(srcdir)/build-aux/useless-if-before-free \
|
||||
$(useless_free_options) \
|
||||
$$($(VC_LIST_EXCEPT)) && \
|
||||
{ echo '$(ME): found useless "if" before "free" above' 1>&2; \
|
||||
exit 1; } || :
|
||||
|
||||
# Avoid uses of write(2). Either switch to streams (fwrite), or use
|
||||
# the safewrite wrapper.
|
||||
sc_avoid_write:
|
||||
@if $(VC_LIST_EXCEPT) | grep '\.c$$' > /dev/null; then \
|
||||
grep '\<write *(' $$($(VC_LIST_EXCEPT) | grep '\.c$$') && \
|
||||
{ echo "$(ME): the above files use write;" \
|
||||
" consider using the safewrite wrapper instead" \
|
||||
1>&2; exit 1; } || :; \
|
||||
else :; \
|
||||
fi
|
||||
|
||||
sc_cast_of_argument_to_free:
|
||||
@re='\<free *\( *\(' msg='don'\''t cast free argument' \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
sc_cast_of_x_alloc_return_value:
|
||||
@re='\*\) *x(m|c|re)alloc\>' \
|
||||
msg='don'\''t cast x*alloc return value' \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
sc_cast_of_alloca_return_value:
|
||||
@re='\*\) *alloca\>' msg='don'\''t cast alloca return value' \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
sc_space_tab:
|
||||
@re='[ ] ' msg='found SPACE-TAB sequence; remove the SPACE' \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
# Don't use *scanf or the old ato* functions in `real' code.
|
||||
# They provide no error checking mechanism.
|
||||
# Instead, use strto* functions.
|
||||
sc_prohibit_atoi_atof:
|
||||
@re='\<([fs]?scanf|ato([filq]|ll))\>' \
|
||||
msg='do not use *scan''f, ato''f, ato''i, ato''l, ato''ll or ato''q' \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
# Use STREQ rather than comparing strcmp == 0, or != 0.
|
||||
# Similarly, use STREQLEN or STRPREFIX rather than strncmp.
|
||||
sc_prohibit_strcmp:
|
||||
@grep -nE '! *strn?cmp *\(|\<strn?cmp *\([^)]+\) *==' \
|
||||
$$($(VC_LIST_EXCEPT)) \
|
||||
| grep -vE ':# *define STREQ(LEN)?\(' && \
|
||||
{ echo '$(ME): use STREQ(LEN) in place of the above uses of strcmp(strncmp)' \
|
||||
1>&2; exit 1; } || :
|
||||
|
||||
# Use virAsprintf rather than a'sprintf since *strp is undefined on error.
|
||||
sc_prohibit_asprintf:
|
||||
@re='\<[a]sprintf\>' \
|
||||
msg='use virAsprintf, not a'sprintf \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
sc_prohibit_VIR_ERR_NO_MEMORY:
|
||||
@re='\<V''IR_ERR_NO_MEMORY\>' \
|
||||
msg='use virReportOOMError, not V'IR_ERR_NO_MEMORY \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
sc_prohibit_nonreentrant:
|
||||
@fail=0 ; \
|
||||
for i in $(NON_REENTRANT) ; \
|
||||
do \
|
||||
grep --before 2 --after 1 -nE "\<$$i\>[:space:]*\(" $$($(VC_LIST_EXCEPT)) && \
|
||||
fail=1 && echo "$(ME): use $${i}_r, not $${i}" || : ; \
|
||||
done ; \
|
||||
exit $$fail
|
||||
|
||||
# Using EXIT_SUCCESS as the first argument to error is misleading,
|
||||
# since when that parameter is 0, error does not exit. Use `0' instead.
|
||||
sc_error_exit_success:
|
||||
@grep -nF 'error (EXIT_SUCCESS,' \
|
||||
$$(find -type f -name '*.[chly]') && \
|
||||
{ echo '$(ME): found error (EXIT_SUCCESS' 1>&2; \
|
||||
exit 1; } || :
|
||||
|
||||
sc_file_system:
|
||||
@re=file''system ignore_case=1 \
|
||||
msg='found use of "file''system"; spell it "file system"' \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
# Don't use cpp tests of this symbol. All code assumes config.h is included.
|
||||
sc_prohibit_have_config_h:
|
||||
@grep -n '^# *if.*HAVE''_CONFIG_H' $$($(VC_LIST_EXCEPT)) && \
|
||||
{ echo '$(ME): found use of HAVE''_CONFIG_H; remove' \
|
||||
1>&2; exit 1; } || :
|
||||
|
||||
# Nearly all .c files must include <config.h>.
|
||||
sc_require_config_h:
|
||||
@if $(VC_LIST_EXCEPT) | grep '\.c$$' > /dev/null; then \
|
||||
grep -L '^# *include <config\.h>' \
|
||||
$$($(VC_LIST_EXCEPT) | grep '\.c$$') \
|
||||
| grep . && \
|
||||
{ echo '$(ME): the above files do not include <config.h>' \
|
||||
1>&2; exit 1; } || :; \
|
||||
else :; \
|
||||
fi
|
||||
|
||||
# You must include <config.h> before including any other header file.
|
||||
sc_require_config_h_first:
|
||||
@if $(VC_LIST_EXCEPT) | grep '\.c$$' > /dev/null; then \
|
||||
fail=0; \
|
||||
for i in $$($(VC_LIST_EXCEPT) | grep '\.c$$'); do \
|
||||
grep '^# *include\>' $$i | sed 1q \
|
||||
| grep '^# *include <config\.h>' > /dev/null \
|
||||
|| { echo $$i; fail=1; }; \
|
||||
done; \
|
||||
test $$fail = 1 && \
|
||||
{ echo '$(ME): the above files include some other header' \
|
||||
'before <config.h>' 1>&2; exit 1; } || :; \
|
||||
else :; \
|
||||
fi
|
||||
|
||||
sc_prohibit_HAVE_MBRTOWC:
|
||||
@re='\bHAVE_MBRTOWC\b' msg="do not use $$re; it is always defined" \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
# To use this "command" macro, you must first define two shell variables:
|
||||
# h: the header, enclosed in <> or ""
|
||||
# re: a regular expression that matches IFF something provided by $h is used.
|
||||
define _header_without_use
|
||||
h_esc=`echo "$$h"|sed 's/\./\\./'`; \
|
||||
if $(VC_LIST_EXCEPT) | grep '\.c$$' > /dev/null; then \
|
||||
files=$$(grep -l '^# *include '"$$h_esc" \
|
||||
$$($(VC_LIST_EXCEPT) | grep '\.c$$')) && \
|
||||
grep -LE "$$re" $$files | grep . && \
|
||||
{ echo "$(ME): the above files include $$h but don't use it" \
|
||||
1>&2; exit 1; } || :; \
|
||||
else :; \
|
||||
fi
|
||||
endef
|
||||
|
||||
# Prohibit the inclusion of assert.h without an actual use of assert.
|
||||
sc_prohibit_assert_without_use:
|
||||
@h='<assert.h>' re='\<assert *\(' $(_header_without_use)
|
||||
|
||||
# Prohibit the inclusion of getopt.h without an actual use.
|
||||
sc_prohibit_getopt_without_use:
|
||||
@h='<getopt.h>' re='\<getopt(_long)? *\(' $(_header_without_use)
|
||||
|
||||
# Don't include quotearg.h unless you use one of its functions.
|
||||
sc_prohibit_quotearg_without_use:
|
||||
@h='"quotearg.h"' re='\<quotearg(_[^ ]+)? *\(' $(_header_without_use)
|
||||
|
||||
# Don't include quote.h unless you use one of its functions.
|
||||
sc_prohibit_quote_without_use:
|
||||
@h='"quote.h"' re='\<quote(_n)? *\(' $(_header_without_use)
|
||||
|
||||
# Don't include this header unless you use one of its functions.
|
||||
sc_prohibit_long_options_without_use:
|
||||
@h='"long-options.h"' re='\<parse_long_options *\(' \
|
||||
$(_header_without_use)
|
||||
|
||||
# Don't include this header unless you use one of its functions.
|
||||
sc_prohibit_inttostr_without_use:
|
||||
@h='"inttostr.h"' re='\<(off|[iu]max|uint)tostr *\(' \
|
||||
$(_header_without_use)
|
||||
|
||||
# Don't include this header unless you use one of its functions.
|
||||
sc_prohibit_error_without_use:
|
||||
@h='"error.h"' \
|
||||
re='\<error(_at_line|_print_progname|_one_per_line|_message_count)? *\('\
|
||||
$(_header_without_use)
|
||||
|
||||
sc_prohibit_safe_read_without_use:
|
||||
@h='"safe-read.h"' re='(\<SAFE_READ_ERROR\>|\<safe_read *\()' \
|
||||
$(_header_without_use)
|
||||
|
||||
sc_prohibit_argmatch_without_use:
|
||||
@h='"argmatch.h"' \
|
||||
re='(\<(ARRAY_CARDINALITY|X?ARGMATCH(|_TO_ARGUMENT|_VERIFY))\>|\<argmatch(_exit_fn|_(in)?valid) *\()' \
|
||||
$(_header_without_use)
|
||||
|
||||
sc_prohibit_root_dev_ino_without_use:
|
||||
@h='"root-dev-ino.h"' \
|
||||
re='(\<ROOT_DEV_INO_(CHECK|WARN)\>|\<get_root_dev_ino *\()' \
|
||||
$(_header_without_use)
|
||||
|
||||
# Prohibit the inclusion of c-ctype.h without an actual use.
|
||||
sc_prohibit_c_ctype_without_use:
|
||||
@h='[<"]c-ctype.h[">]' re='\<c_($(ctype_re)) *\(' $(_header_without_use)
|
||||
|
||||
# Prohibit the inclusion of <ctype.h>.
|
||||
sc_prohibit_ctype_h:
|
||||
@grep -E '^# *include *<ctype\.h>' $$($(VC_LIST_EXCEPT)) && \
|
||||
{ echo "$(ME): don't use ctype.h; instead, use c-ctype.h" \
|
||||
1>&2; exit 1; } || :
|
||||
|
||||
sc_obsolete_symbols:
|
||||
@re='\<(HAVE''_FCNTL_H|O''_NDELAY)\>' \
|
||||
msg='do not use HAVE''_FCNTL_H or O'_NDELAY \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
# FIXME: warn about definitions of EXIT_FAILURE, EXIT_SUCCESS, STREQ
|
||||
|
||||
# Each nonempty line must start with a year number, or a TAB.
|
||||
# Or day-of-week+space.
|
||||
changelog_entry_header_regexp = \
|
||||
([12][0-9][0-9][0-9]| .|(Mon|Tue|Wed|Thu|Fri|Sat|Sun) )
|
||||
sc_changelog:
|
||||
@grep -Evn '(^$$|^$(changelog_entry_header_regexp))' \
|
||||
$$(find . -maxdepth 2 -name ChangeLog) && \
|
||||
{ echo '$(ME): found unexpected prefix in a ChangeLog' 1>&2; \
|
||||
exit 1; } || :
|
||||
|
||||
sc_the_the:
|
||||
@re='\<the ''the\>' \
|
||||
ignore_case=1 msg='found use of "the ''the";' \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
sc_trailing_blank:
|
||||
@re='[ ]$$' \
|
||||
ignore_case=1 msg='found trailing blank(s)' \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
# Ensure that no C source file uses TABs for indentation.
|
||||
# Also match *.h.in files, to get libvirt.h.in.
|
||||
# Exclude files in gnulib, since they're imported.
|
||||
sc_TAB_in_indentation:
|
||||
@grep -lE '^ * ' /dev/null \
|
||||
$$($(VC_LIST_EXCEPT) \
|
||||
| grep -E '\.[ch](\.in)?$$' \
|
||||
| grep -v '^gnulib/') && \
|
||||
{ echo '$(ME): found TAB(s) used for indentation in C sources;'\
|
||||
'use spaces' 1>&2; exit 1; } || :
|
||||
|
||||
ctype_re = isalnum|isalpha|isascii|isblank|iscntrl|isdigit|isgraph|islower\
|
||||
|isprint|ispunct|isspace|isupper|isxdigit|tolower|toupper
|
||||
|
||||
sc_avoid_ctype_macros:
|
||||
@grep -E '\b($(ctype_re)) *\(' /dev/null \
|
||||
$$($(VC_LIST_EXCEPT)) && \
|
||||
{ echo "$(ME): don't use ctype macros (use c-ctype.h)" \
|
||||
1>&2; exit 1; } || :
|
||||
|
||||
# Match lines like the following, but where there is only one space
|
||||
# between the options and the description:
|
||||
# -D, --all-repeated[=delimit-method] print all duplicate lines\n
|
||||
longopt_re = --[a-z][0-9A-Za-z-]*(\[?=[0-9A-Za-z-]*\]?)?
|
||||
sc_two_space_separator_in_usage:
|
||||
@grep -nE '^ *(-[A-Za-z],)? $(longopt_re) [^ ].*\\$$' \
|
||||
$$($(VC_LIST_EXCEPT)) && \
|
||||
{ echo "$(ME): help2man requires at least two spaces between"; \
|
||||
echo "$(ME): an option and its description"; \
|
||||
1>&2; exit 1; } || :
|
||||
|
||||
# Many of the function names below came from this filter:
|
||||
# git grep -B2 '\<_('|grep -E '\.c- *[[:alpha:]_][[:alnum:]_]* ?\(.*[,;]$' \
|
||||
# |sed 's/.*\.c- *//'|perl -pe 's/ ?\(.*//'|sort -u \
|
||||
# |grep -vE '^(qsort|if|close|assert|fputc|free|N_|vir.*GetName|.*Unlock|virNodeListDevices|virHashRemoveEntry|freeaddrinfo|.*[fF]ree|xdrmem_create|xmlXPathFreeObject|virUUIDFormat|openvzSetProgramSentinal|polkit_action_unref)$'
|
||||
|
||||
msg_gen_function =
|
||||
msg_gen_function += DEBUG0
|
||||
msg_gen_function += DISABLE_fprintf
|
||||
msg_gen_function += ERROR
|
||||
msg_gen_function += ERROR0
|
||||
msg_gen_function += REMOTE_DEBUG
|
||||
msg_gen_function += ReportError
|
||||
msg_gen_function += VIR_FREE
|
||||
msg_gen_function += VIR_INFO
|
||||
msg_gen_function += VIR_USE_CPU
|
||||
msg_gen_function += errorf
|
||||
msg_gen_function += lxcError
|
||||
msg_gen_function += networkLog
|
||||
msg_gen_function += networkReportError
|
||||
msg_gen_function += openvzError
|
||||
msg_gen_function += openvzLog
|
||||
msg_gen_function += qemudDispatchClientFailure
|
||||
msg_gen_function += qemudLog
|
||||
msg_gen_function += qemudReportError
|
||||
msg_gen_function += regerror
|
||||
msg_gen_function += remoteDispatchFormatError
|
||||
msg_gen_function += umlLog
|
||||
msg_gen_function += umlReportError
|
||||
msg_gen_function += virConfError
|
||||
msg_gen_function += virDomainReportError
|
||||
msg_gen_function += virSecurityReportError
|
||||
msg_gen_function += virHashError
|
||||
msg_gen_function += virLibConnError
|
||||
msg_gen_function += virLibDomainError
|
||||
msg_gen_function += virLog
|
||||
msg_gen_function += virNetworkReportError
|
||||
msg_gen_function += virNodeDeviceReportError
|
||||
msg_gen_function += virProxyError
|
||||
msg_gen_function += virRaiseError
|
||||
msg_gen_function += virReportErrorHelper
|
||||
msg_gen_function += virReportSystemError
|
||||
msg_gen_function += virSexprError
|
||||
msg_gen_function += virStorageLog
|
||||
msg_gen_function += virStorageReportError
|
||||
msg_gen_function += virXMLError
|
||||
msg_gen_function += virXenInotifyError
|
||||
msg_gen_function += virXenStoreError
|
||||
msg_gen_function += virXendError
|
||||
msg_gen_function += vshCloseLogFile
|
||||
msg_gen_function += xenUnifiedError
|
||||
msg_gen_function += xenXMError
|
||||
|
||||
# Uncomment the following and run "make syntax-check" to see diagnostics
|
||||
# that are not yet marked for translation, but that need to be rewritten
|
||||
# so that they are translatable.
|
||||
# msg_gen_function += error
|
||||
# msg_gen_function += fprintf
|
||||
# msg_gen_function += testError
|
||||
# msg_gen_function += virXenError
|
||||
# msg_gen_function += vshPrint
|
||||
# msg_gen_function += vshError
|
||||
|
||||
func_or := $(shell printf '$(msg_gen_function)'|tr -s '[[:space:]]' '|')
|
||||
func_re := ($(func_or))
|
||||
|
||||
# Look for diagnostics that aren't marked for translation.
|
||||
# This won't find any for which error's format string is on a separate line.
|
||||
# The sed filters eliminate false-positives like these:
|
||||
# _("...: "
|
||||
# "%s", _("no storage vol w..."
|
||||
sc_unmarked_diagnostics:
|
||||
@grep -nE \
|
||||
'\<$(func_re) \([^"]*"[^"]*[a-z]{3}' $$($(VC_LIST_EXCEPT)) \
|
||||
| grep -v '_''(' && \
|
||||
{ echo '$(ME): found unmarked diagnostic(s)' 1>&2; \
|
||||
exit 1; } || :
|
||||
@{ grep -nE '\<$(func_re) *\(.*;$$' $$($(VC_LIST_EXCEPT)); \
|
||||
grep -A1 -nE '\<$(func_re) *\(.*,$$' $$($(VC_LIST_EXCEPT)); } \
|
||||
| sed 's/_("[^"][^"]*"//;s/[ ]"%s"//' \
|
||||
| grep '[ ]"' && \
|
||||
{ echo '$(ME): found unmarked diagnostic(s)' 1>&2; \
|
||||
exit 1; } || :
|
||||
|
||||
sc_prohibit_virBufferAdd_with_string_literal:
|
||||
@re='\<virBufferAdd *\([^,]+, *"[^"]' \
|
||||
msg='use virBufferAddLit, not virBufferAdd, with a string literal' \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
# Not only do they fail to deal well with ipv6, but the gethostby*
|
||||
# functions are also not thread-safe.
|
||||
sc_prohibit_gethostby:
|
||||
@re='\<gethostby(addr|name2?) *\(' \
|
||||
msg='use getaddrinfo, not gethostby*' \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
# Avoid useless parentheses like those in this example:
|
||||
# #if defined (SYMBOL) || defined (SYM2)
|
||||
sc_useless_cpp_parens:
|
||||
@grep -n '^# *if .*defined *(' $$($(VC_LIST_EXCEPT)) && \
|
||||
{ echo '$(ME): found useless parentheses in cpp directive' \
|
||||
1>&2; exit 1; } || :
|
||||
|
||||
# Require the latest GPL.
|
||||
sc_GPL_version:
|
||||
@re='either ''version [^3]' msg='GPL vN, N!=3' \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
cvs_keywords = \
|
||||
Author|Date|Header|Id|Name|Locker|Log|RCSfile|Revision|Source|State
|
||||
|
||||
sc_prohibit_cvs_keyword:
|
||||
@re='\$$($(cvs_keywords))\$$' \
|
||||
msg='do not use CVS keyword expansion' \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
# Make sure we don't use st_blocks. Use ST_NBLOCKS instead.
|
||||
# This is a bit of a kludge, since it prevents use of the string
|
||||
# even in comments, but for now it does the job with no false positives.
|
||||
sc_prohibit_stat_st_blocks:
|
||||
@re='[.>]st_blocks' msg='do not use st_blocks; use ST_NBLOCKS' \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
# Make sure we don't define any S_IS* macros in src/*.c files.
|
||||
# They're already defined via gnulib's sys/stat.h replacement.
|
||||
sc_prohibit_S_IS_definition:
|
||||
@re='^ *# *define *S_IS' \
|
||||
msg='do not define S_IS* macros; include <sys/stat.h>' \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
# Each program that uses proper_name_utf8 must link with
|
||||
# one of the ICONV libraries.
|
||||
sc_proper_name_utf8_requires_ICONV:
|
||||
@progs=$$(grep -l 'proper_name_utf8 ''("' $$($(VC_LIST_EXCEPT)));\
|
||||
if test "x$$progs" != x; then \
|
||||
fail=0; \
|
||||
for p in $$progs; do \
|
||||
dir=$$(dirname "$$p"); \
|
||||
base=$$(basename "$$p" .c); \
|
||||
grep "$${base}_LDADD.*ICONV)" $$dir/Makefile.am > /dev/null \
|
||||
|| { fail=1; echo 1>&2 "$(ME): $$p uses proper_name_utf8"; }; \
|
||||
done; \
|
||||
test $$fail = 1 && \
|
||||
{ echo 1>&2 '$(ME): the above do not link with any ICONV library'; \
|
||||
exit 1; } || :; \
|
||||
fi
|
||||
|
||||
# Warn about "c0nst struct Foo const foo[]",
|
||||
# but not about "char const *const foo" or "#define const const".
|
||||
sc_redundant_const:
|
||||
@grep -E '\bconst\b[[:space:][:alnum:]]{2,}\bconst\b' \
|
||||
$$($(VC_LIST_EXCEPT)) && \
|
||||
{ echo 1>&2 '$(ME): redundant "const" in declarations'; \
|
||||
exit 1; } || :
|
||||
|
||||
sc_const_long_option:
|
||||
@grep '^ *static.*struct option ' $$($(VC_LIST_EXCEPT)) \
|
||||
| grep -Ev 'const struct option|struct option const' && { \
|
||||
echo 1>&2 '$(ME): add "const" to the above declarations'; \
|
||||
exit 1; } || :
|
||||
|
||||
NEWS_hash = \
|
||||
$$(sed -n '/^\*.* $(PREV_VERSION_REGEXP) ([0-9-]*)/,$$p' \
|
||||
$(srcdir)/NEWS | md5sum -)
|
||||
|
||||
# Ensure that we don't accidentally insert an entry into an old NEWS block.
|
||||
sc_immutable_NEWS:
|
||||
@if test -f $(srcdir)/NEWS; then \
|
||||
test "$(NEWS_hash)" = '$(old_NEWS_hash)' && : || \
|
||||
{ echo '$(ME): you have modified old NEWS' 1>&2; exit 1; }; \
|
||||
fi
|
||||
|
||||
# Update the hash stored above. Do this after each release and
|
||||
# for any corrections to old entries.
|
||||
update-NEWS-hash: NEWS
|
||||
perl -pi -e 's/^(old_NEWS_hash = ).*/$${1}'"$(NEWS_hash)/" \
|
||||
$(srcdir)/cfg.mk
|
||||
|
||||
epoch_date = 1970-01-01 00:00:00.000000000 +0000
|
||||
# Ensure that the c99-to-c89 patch applies cleanly.
|
||||
patch-check:
|
||||
rm -rf src-c89 $@.1 $@.2
|
||||
cp -a $(srcdir)/src src-c89
|
||||
if test "x$(srcdir)" != x.; then \
|
||||
cp -a src/* src-c89; \
|
||||
dotfiles=`ls src/.[!.]* 2>/dev/null`; \
|
||||
test -z "$$dotfiles" || cp -a src/.[!.]* src-c89; \
|
||||
fi
|
||||
(cd src-c89; patch -p1 -V never --fuzz=0) < $(srcdir)/src/c99-to-c89.diff \
|
||||
> $@.1 2>&1
|
||||
if test "$(REGEN_PATCH)" = yes; then \
|
||||
diff -upr $(srcdir)/src src-c89 | sed 's,$(srcdir)/src-c89/,src/,' \
|
||||
| grep -vE '^(Only in|File )' \
|
||||
| perl -pe 's/^((?:\+\+\+|---) \S+\t).*/$${1}$(epoch_date)/;' \
|
||||
-e 's/^ $$//' \
|
||||
> new-diff || : ; fi
|
||||
grep -v '^patching file ' $@.1 > $@.2 || :
|
||||
msg=ok; test -s $@.2 && msg='fuzzy patch' || : ; \
|
||||
rm -f src-c89/*.o || msg='rm failed'; \
|
||||
$(MAKE) -C src-c89 CFLAGS='-Wdeclaration-after-statement -Werror' \
|
||||
|| msg='compile failure with extra options'; \
|
||||
test "$$msg" = ok && rm -rf src-c89 $@.1 $@.2 || echo "$$msg" 1>&2; \
|
||||
test "$$msg" = ok
|
||||
|
||||
check-AUTHORS:
|
||||
$(MAKE) -C src $@
|
||||
|
||||
# Ensure that we use only the standard $(VAR) notation,
|
||||
# not @...@ in Makefile.am, now that we can rely on automake
|
||||
# to emit a definition for each substituted variable.
|
||||
makefile-check:
|
||||
grep -nE '@[A-Z_0-9]+@' `find . -name Makefile.am` \
|
||||
&& { echo 'Makefile.maint: use $$(...), not @...@' 1>&2; exit 1; } || :
|
||||
|
||||
news-date-check: NEWS
|
||||
today=`date +%Y-%m-%d`; \
|
||||
if head NEWS | grep '^\*.* $(VERSION_REGEXP) ('$$today')' \
|
||||
>/dev/null; then \
|
||||
:; \
|
||||
else \
|
||||
echo "version or today's date is not in NEWS" 1>&2; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
changelog-check:
|
||||
if head ChangeLog | grep 'Version $(VERSION_REGEXP)\.$$' \
|
||||
>/dev/null; then \
|
||||
:; \
|
||||
else \
|
||||
echo "$(VERSION) not in ChangeLog" 1>&2; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
sc_m4_quote_check:
|
||||
@grep -nE '(AC_DEFINE(_UNQUOTED)?|AC_DEFUN)\([^[]' \
|
||||
$$($(VC_LIST_EXCEPT) | grep -E '(^configure\.ac|\.m4)$$') \
|
||||
&& { echo '$(ME): quote the first arg to AC_DEF*' 1>&2; \
|
||||
exit 1; } || :
|
||||
|
||||
fix_po_file_diag = \
|
||||
'you have changed the set of files with translatable diagnostics;\n\
|
||||
apply the above patch\n'
|
||||
|
||||
# Verify that all source files using _() are listed in po/POTFILES.in.
|
||||
po_file = po/POTFILES.in
|
||||
sc_po_check:
|
||||
@if test -f $(po_file); then \
|
||||
grep -E -v '^(#|$$)' $(po_file) \
|
||||
| grep -v '^src/false\.c$$' | sort > $@-1; \
|
||||
files=; \
|
||||
for file in $$($(VC_LIST_EXCEPT)); do \
|
||||
case $$file in \
|
||||
*.m4) continue;; \
|
||||
*.?|*.??) ;; \
|
||||
*) continue;; \
|
||||
esac; \
|
||||
case $$file in \
|
||||
*.[ch]) \
|
||||
base=`expr " $$file" : ' \(.*\)\..'`; \
|
||||
{ test -f $$base.l || test -f $$base.y; } && continue;; \
|
||||
esac; \
|
||||
files="$$files $$file"; \
|
||||
done; \
|
||||
grep -E -l '\b(N?_|gettext *)\([^)"]*("|$$)' $$files \
|
||||
| sort -u > $@-2; \
|
||||
diff -u -L $(po_file) -L $(po_file) $@-1 $@-2 \
|
||||
|| { printf '$(ME): '$(fix_po_file_diag) 1>&2; exit 1; }; \
|
||||
rm -f $@-1 $@-2; \
|
||||
fi
|
||||
|
||||
# Sometimes it is useful to change the PATH environment variable
|
||||
# in Makefiles. When doing so, it's better not to use the Unix-centric
|
||||
# path separator of `:', but rather the automake-provided `@PATH_SEPARATOR@'.
|
||||
# It'd be better to use `find -print0 ...|xargs -0 ...', but less portable,
|
||||
# and there probably aren't many projects with so many Makefile.am files
|
||||
# that we'd have to worry about limits on command line length.
|
||||
msg = '$(ME): Do not use `:'\'' above; use @PATH_SEPARATOR@ instead'
|
||||
sc_makefile_path_separator_check:
|
||||
@grep -n 'PATH=.*:' `find $(srcdir) -name Makefile.am` \
|
||||
&& { echo $(msg) 1>&2; exit 1; } || :
|
||||
|
||||
# Check that `make alpha' will not fail at the end of the process.
|
||||
writable-files:
|
||||
if test -d $(release_archive_dir); then :; else \
|
||||
for file in $(distdir).tar.gz \
|
||||
$(release_archive_dir)/$(distdir).tar.gz; do \
|
||||
test -e $$file || continue; \
|
||||
test -w $$file \
|
||||
|| { echo ERROR: $$file is not writable; fail=1; }; \
|
||||
done; \
|
||||
test "$$fail" && exit 1 || : ; \
|
||||
fi
|
||||
|
||||
v_etc_file = lib/version-etc.c
|
||||
sample-test = tests/sample-test
|
||||
texi = doc/$(PACKAGE).texi
|
||||
# Make sure that the copyright date in $(v_etc_file) is up to date.
|
||||
# Do the same for the $(sample-test) and the main doc/.texi file.
|
||||
sc_copyright_check:
|
||||
@if test -f $(v_etc_file); then \
|
||||
grep 'enum { COPYRIGHT_YEAR = '$$(date +%Y)' };' $(v_etc_file) \
|
||||
>/dev/null \
|
||||
|| { echo 'out of date copyright in $(v_etc_file); update it' 1>&2; \
|
||||
exit 1; }; \
|
||||
fi
|
||||
@if test -f $(sample-test); then \
|
||||
grep '# Copyright (C) '$$(date +%Y)' Free' $(sample-test) \
|
||||
>/dev/null \
|
||||
|| { echo 'out of date copyright in $(sample-test); update it' 1>&2; \
|
||||
exit 1; }; \
|
||||
fi
|
||||
@if test -f $(texi); then \
|
||||
grep 'Copyright @copyright{} .*'$$(date +%Y)' Free' $(texi) \
|
||||
>/dev/null \
|
||||
|| { echo 'out of date copyright in $(texi); update it' 1>&2; \
|
||||
exit 1; }; \
|
||||
fi
|
||||
|
||||
vc-diff-check:
|
||||
$(VC) diff > vc-diffs || :
|
||||
if test -s vc-diffs; then \
|
||||
cat vc-diffs; \
|
||||
echo "Some files are locally modified:" 1>&2; \
|
||||
exit 1; \
|
||||
else \
|
||||
rm vc-diffs; \
|
||||
fi
|
||||
|
||||
cvs-check: vc-diff-check
|
||||
|
||||
maintainer-distcheck:
|
||||
$(MAKE) distcheck
|
||||
$(MAKE) my-distcheck
|
||||
|
||||
|
||||
# Don't make a distribution if checks fail.
|
||||
# Also, make sure the NEWS file is up-to-date.
|
||||
vc-dist: $(local-check) cvs-check maintainer-distcheck
|
||||
$(MAKE) dist
|
||||
|
||||
# Use this to make sure we don't run these programs when building
|
||||
# from a virgin tgz file, below.
|
||||
null_AM_MAKEFLAGS = \
|
||||
ACLOCAL=false \
|
||||
AUTOCONF=false \
|
||||
AUTOMAKE=false \
|
||||
AUTOHEADER=false \
|
||||
MAKEINFO=false
|
||||
|
||||
built_programs = $$(cd src && MAKEFLAGS= $(MAKE) -s built_programs.list)
|
||||
|
||||
warn_cflags = -Dlint -O -Werror -Wall -Wformat -Wshadow -Wpointer-arith
|
||||
bin=bin-$$$$
|
||||
|
||||
write_loser = printf '\#!%s\necho $$0: bad path 1>&2; exit 1\n' '$(SHELL)'
|
||||
|
||||
TMPDIR ?= /tmp
|
||||
t=$(TMPDIR)/$(PACKAGE)/test
|
||||
pfx=$(t)/i
|
||||
|
||||
# More than once, tainted build and source directory names would
|
||||
# have caused at least one "make check" test to apply "chmod 700"
|
||||
# to all directories under $HOME. Make sure it doesn't happen again.
|
||||
tp := $(shell echo "$(TMPDIR)/$(PACKAGE)-$$$$")
|
||||
t_prefix = $(tp)/a
|
||||
t_taint = '$(t_prefix) b'
|
||||
fake_home = $(tp)/home
|
||||
|
||||
# Ensure that tests run from tainted build and src dir names work,
|
||||
# and don't affect anything in $HOME. Create witness files in $HOME,
|
||||
# record their attributes, and build/test. Then ensure that the
|
||||
# witnesses were not affected.
|
||||
taint-distcheck: $(DIST_ARCHIVES)
|
||||
test -d $(t_taint) && chmod -R 700 $(t_taint) || :
|
||||
-rm -rf $(t_taint) $(fake_home)
|
||||
mkdir -p $(t_prefix) $(t_taint) $(fake_home)
|
||||
GZIP=$(GZIP_ENV) $(AMTAR) -C $(t_taint) -zxf $(distdir).tar.gz
|
||||
mkfifo $(fake_home)/fifo
|
||||
touch $(fake_home)/f
|
||||
mkdir -p $(fake_home)/d/e
|
||||
ls -lR $(fake_home) $(t_prefix) > $(tp)/.ls-before
|
||||
cd $(t_taint)/$(distdir) \
|
||||
&& ./configure \
|
||||
&& $(MAKE) \
|
||||
&& HOME=$(fake_home) $(MAKE) check \
|
||||
&& ls -lR $(fake_home) $(t_prefix) > $(tp)/.ls-after \
|
||||
&& diff $(tp)/.ls-before $(tp)/.ls-after \
|
||||
&& test -d $(t_prefix)
|
||||
rm -rf $(tp)
|
||||
|
||||
# Verify that a twisted use of --program-transform-name=PROGRAM works.
|
||||
define install-transform-check
|
||||
echo running install-transform-check \
|
||||
&& rm -rf $(pfx) \
|
||||
&& $(MAKE) program_transform_name='s/.*/zyx/' \
|
||||
prefix=$(pfx) install \
|
||||
&& test "$$(echo $(pfx)/bin/*)" = "$(pfx)/bin/zyx" \
|
||||
&& test "$$(find $(pfx)/share/man -type f|sed 's,.*/,,;s,\..*,,')" = "zyx"
|
||||
endef
|
||||
|
||||
# Install, then verify that all binaries and man pages are in place.
|
||||
# Note that neither the binary, ginstall, nor the ].1 man page is installed.
|
||||
define my-instcheck
|
||||
$(MAKE) prefix=$(pfx) install \
|
||||
&& test ! -f $(pfx)/bin/ginstall \
|
||||
&& { fail=0; \
|
||||
for i in $(built_programs); do \
|
||||
test "$$i" = ginstall && i=install; \
|
||||
for j in "$(pfx)/bin/$$i" \
|
||||
"$(pfx)/share/man/man1/$$i.1"; do \
|
||||
case $$j in *'[.1') continue;; esac; \
|
||||
test -f "$$j" && : \
|
||||
|| { echo "$$j not installed"; fail=1; }; \
|
||||
done; \
|
||||
done; \
|
||||
test $$fail = 1 && exit 1 || :; \
|
||||
}
|
||||
endef
|
||||
|
||||
define coreutils-path-check
|
||||
{ \
|
||||
if test -f $(srcdir)/src/true.c; then \
|
||||
fail=1; \
|
||||
mkdir $(bin) \
|
||||
&& ($(write_loser)) > $(bin)/loser \
|
||||
&& chmod a+x $(bin)/loser \
|
||||
&& for i in $(built_programs); do \
|
||||
case $$i in \
|
||||
rm|expr|basename|echo|sort|ls|tr);; \
|
||||
cat|dirname|mv|wc);; \
|
||||
*) ln $(bin)/loser $(bin)/$$i;; \
|
||||
esac; \
|
||||
done \
|
||||
&& ln -sf ../src/true $(bin)/false \
|
||||
&& PATH=`pwd`/$(bin):$$PATH $(MAKE) -C tests check \
|
||||
&& { test -d gnulib-tests \
|
||||
&& $(MAKE) -C gnulib-tests check \
|
||||
|| :; } \
|
||||
&& rm -rf $(bin) \
|
||||
&& fail=0; \
|
||||
else \
|
||||
fail=0; \
|
||||
fi; \
|
||||
test $$fail = 1 && exit 1 || :; \
|
||||
}
|
||||
endef
|
||||
|
||||
# Use -Wformat -Werror to detect format-string/arg-list mismatches.
|
||||
# Also, check for shadowing problems with -Wshadow, and for pointer
|
||||
# arithmetic problems with -Wpointer-arith.
|
||||
# These CFLAGS are pretty strict. If you build this target, you probably
|
||||
# have to have a recent version of gcc and glibc headers.
|
||||
# The hard-linking for-loop below ensures that there is a bin/ directory
|
||||
# full of all of the programs under test (except the ones that are required
|
||||
# for basic Makefile rules), all symlinked to the just-built "false" program.
|
||||
# This is to ensure that if ever a test neglects to make PATH include
|
||||
# the build srcdir, these always-failing programs will run.
|
||||
# Otherwise, it is too easy to test the wrong programs.
|
||||
# Note that "false" itself is a symlink to true, so it too will malfunction.
|
||||
my-distcheck: $(DIST_ARCHIVES) $(local-check)
|
||||
$(MAKE) syntax-check
|
||||
$(MAKE) check
|
||||
-rm -rf $(t)
|
||||
mkdir -p $(t)
|
||||
GZIP=$(GZIP_ENV) $(AMTAR) -C $(t) -zxf $(distdir).tar.gz
|
||||
cd $(t)/$(distdir) \
|
||||
&& ./configure --disable-nls \
|
||||
&& $(MAKE) CFLAGS='$(warn_cflags)' \
|
||||
AM_MAKEFLAGS='$(null_AM_MAKEFLAGS)' \
|
||||
&& $(MAKE) dvi \
|
||||
&& $(install-transform-check) \
|
||||
&& $(my-instcheck) \
|
||||
&& $(coreutils-path-check) \
|
||||
&& $(MAKE) distclean
|
||||
(cd $(t) && mv $(distdir) $(distdir).old \
|
||||
&& $(AMTAR) -zxf - ) < $(distdir).tar.gz
|
||||
diff -ur $(t)/$(distdir).old $(t)/$(distdir)
|
||||
-rm -rf $(t)
|
||||
@echo "========================"; \
|
||||
echo "$(distdir).tar.gz is ready for distribution"; \
|
||||
echo "========================"
|
||||
|
||||
cvs-to-git = '\#!/usr/bin/perl\n\
|
||||
use warnings;\n\
|
||||
use strict;\n\
|
||||
use File::Find;\n\
|
||||
use File::Copy;\n\
|
||||
\n\
|
||||
find ({wanted =>\n\
|
||||
sub {$$_ eq q/.cvsignore/ or return;\n\
|
||||
my $$gi = q/.gitignore/;\n\
|
||||
unlink $$gi;\n\
|
||||
copy($$_, $$gi) or die qq/copy failed: $$_->$$gi: $$!\\n/;\n\
|
||||
chmod 0444, $$gi;\n\
|
||||
}},\n\
|
||||
q!.!);\n'
|
||||
|
||||
.PHONY: sync-vcs-ignore-files
|
||||
c2g = cvs-to-git
|
||||
sync-vcs-ignore-files:
|
||||
rm -f $(c2g)-t $(c2g)
|
||||
printf $(cvs-to-git) > $(c2g)-t
|
||||
chmod a+x-w $(c2g)-t
|
||||
mv $(c2g)-t $(c2g)
|
||||
perl $(c2g)
|
||||
rm -f $(c2g)
|
||||
echo "syntax: glob" > .hgignore
|
||||
( for ignore in $$($(VC_LIST) \
|
||||
| grep -E '(^|/)\.gitignore$$'); do \
|
||||
dir=$$(dirname "$$ignore"); \
|
||||
test "$$dir" = . && pfx= || pfx=$$dir/; \
|
||||
sed "s!^!$$pfx!" "$$ignore"; \
|
||||
done ) | sort -u >> .hgignore
|
993
NEWS
993
NEWS
@ -1,993 +0,0 @@
|
||||
|
||||
NEWS file for libvirt
|
||||
|
||||
Note that this is automatically generated from the news webpage at:
|
||||
http://libvirt.org/news.html
|
||||
|
||||
|
||||
0.6.2: Apr 3 2009:
|
||||
- New features: support SASL auth for VNC server (Daniel Berrange),
|
||||
memory ballooning in QEMU (Daniel Berrange), SCSI HBA storage pool
|
||||
support (Dave Allan), PCI passthrough in Xen driver (Daniel
|
||||
Berrange)
|
||||
- Portability: be more flexible in QEmu binaries paths (Daniel
|
||||
Berrange), Mingw portability fixes (Daniel Berrange),
|
||||
- Documentation: add security attributes in RNG schemas, cleanup
|
||||
of architecture docs, missing disk bus values in RNG schemas,
|
||||
- Bug fixes: tap vs vbd type on block detach (Cole Robinson and
|
||||
Takahashi Tomohiro), bad free on storage volume error (Daniel
|
||||
Berrange), maplenght computations in remote driver (Daniel Berrange),
|
||||
event dispatching in the daemon (Daniel Berrange), virDomainSetVcpus
|
||||
deadlock (Daniel Berrange), save deadlock in test driver (Cole
|
||||
Robinson), fix timing of security driver init (Cole Robinson),
|
||||
forbid readonly connections from dumping the XML safe info (Cole
|
||||
Robinson), file descriptor leak on remote access,
|
||||
fix labelling of shared/readonly devices (Dan Walsh),
|
||||
virsh missing auth on shell commands (Matthias Bolte),
|
||||
avoid zombie on exec pipe errors (Ryota Ozaki),
|
||||
memory leak in virNodeDeviceGetParent (Daniel Berrange),
|
||||
URI check in migration (Daniel Berrange), various memory bug fixes
|
||||
(Daniel Berrange), python bindings generator fix (Daniel Berrange),
|
||||
NUMA memory fixes (Daniel Berrange), various svirt fixes (Daniel
|
||||
Berrange), fix sparse volume allocation reporting (Cole Robinson),
|
||||
test driver domain restore return value (Cole Robinson),
|
||||
do not lose file format info on volume refresh (Cole Robinson)
|
||||
- Improvements: get CPU usage info for LXC (Ryota Ozaki), fix domain
|
||||
RNG to add ac97 and tests (Pritesh Kothari), OpenVZ support for
|
||||
non-template filesystem root (Florian Vichot), improve arch
|
||||
capabilities generation (Daniel Berrange), modularization of spec
|
||||
file (Ryota Ozaki), better error reports in SEXPR generation (Daniel
|
||||
Berrange), support for vifname parameter in VIF config (Daniel
|
||||
Berrange), localtime handling for new xen (Daniel Berrange),
|
||||
error reporting/ verification of security labels (Dan Walsh),
|
||||
add --console arg for create and start virsh commands (Daniel
|
||||
Berrange), refresh volume alloc/capacity when dumping XML (Cole
|
||||
Robinson)
|
||||
- Cleanups: FILE * leaks removal, unused parameters flagging
|
||||
(Maximilian Wilhelm), switch to pre-C99 struct initialization
|
||||
for drivers (Chris Lalancette), symlinks resolving cleanup (Daniel
|
||||
Berrange)
|
||||
|
||||
|
||||
0.6.1: Mar 3 2009:
|
||||
- New features: new APIs for Node device detach reattach and reset
|
||||
(Mark McLoughlin), sVirt mandatory access control support (James
|
||||
Morris and Dan Walsh)
|
||||
- Portability: non gcc toolchain (John Levon), gcc-4.4 warnings fixes
|
||||
(Mark McLoughlin), fix build without LXC and QEmu (Jim Meyering)
|
||||
- Documentation: man page bugzilla URL (Mark McLoughlin), typo
|
||||
in domain format (Jesse Farinacci), clock offset fix (Mark
|
||||
McLoughlin), hostdev description typo (Mark McLoughlin), static
|
||||
host IP (Charles Duffy), new example program (David Allan)
|
||||
- Bug fixes: NULL dereference in LXC (Jim Meyering), fix domain
|
||||
error reporting (John Levon), fix loop of libvirtd --timeout
|
||||
(Daniel Berrange), limit history to 500 to restrict virsh memory
|
||||
(Daniel Berrange), wrong lvm volume format check (Cole Robinson),
|
||||
I/O error in daemon and associated remote acces crash (Daniel
|
||||
Berrange), fix autostart of session daemon (Daniel Berrange),
|
||||
restart guest on qemu migration failures (Chris Lalancette),
|
||||
config parsing leaks (Ryota Ozaki), DBus multithreading activation
|
||||
to avoid crashes (Daniel Berrange), mark defined network descriptions
|
||||
as persistent (Cole Robinson), qemu+tls handshake negotiation hang
|
||||
(Chris Lalancette)
|
||||
- Improvements: don't hardcode ssh port (Guido G<>nther), new test
|
||||
cases and testing infrastructure (Jim Meyering), improve the
|
||||
SExpr parser (John Levon), proper error reporting on xend
|
||||
shutdown command (John Levon), proper handling of errors when
|
||||
saving QEmu domains state (Guido G<>nther), revamp of the internal
|
||||
error memory APIs (John Levon), better virsh error reporting (John
|
||||
Levon), more daemon options to allow running multiple daemons (Jim
|
||||
Meyering), error handling when creating a QEmu domain (Guido G<>nther),
|
||||
fix timeouts in QEmu log reading (Guido G<>nther), migration with
|
||||
xend 3.3 fixes (John Levon), virsh XML dump flags cleanup (Cole
|
||||
Robinson), fix build with loadable drivers (Maximilian Wilhelm),
|
||||
internal XML APIs to read long long and hexa values (Mark
|
||||
McLoughlin), function to parse node device XML descriptions and
|
||||
associated test (Mark McLoughlin), generate network bridge names if
|
||||
not provided (Cole Robinson), recognize ejectable media in hostdev
|
||||
hal driver (Cole Robinson), integration of sVirt (Daniel Berrange)
|
||||
- Cleanups: printf NULL string checks (John Levon), remove uses of
|
||||
strerror and use virStrerror (Jim Meyering), remove redundant NULL
|
||||
assignments (Jim Meyering), QEmu driver logging and exec cleanups
|
||||
(Jim Meyering), many error handling cleanups (Jim Meyering), XML
|
||||
module cleanups (Mark McLoughlin), compiler warning (Maximilian
|
||||
Wilhelm), daemon TCP listen cleanup (Cole Robinson), size_t type
|
||||
cleanup (Guido G<>nther), parallel make fix (Michael Marineau),
|
||||
storage error diagnostic fix (Ryota Ozaki), remove redundant monitor
|
||||
watch variable (Cole Robinson), qemu AttachDevice error report
|
||||
improvement (Cole Robinson), virsh output cleanup (Jim Meyering),
|
||||
various tests cleanups and improvements (Jim Meyering), fix the
|
||||
internal export list with new APIs (Daniel Berrange), cleanups on
|
||||
new APIs for Node device (Daniel Berrange)
|
||||
|
||||
|
||||
0.6.0: Jan 31 2009:
|
||||
- New features: thread safety of the API and event handling (Daniel
|
||||
Berrange), allow QEmu domains to survive daemon restart (Guido
|
||||
G<>nther), extended logging capabilities, support copy-on-write
|
||||
storage volumes (Daniel Berrange), support of storage cache
|
||||
control options for QEmu/KVM (Daniel Berrange)
|
||||
- Portability: fix old DBus API problem, Debian portability fix
|
||||
(Daniel Berrange), fix distcheck (Jim Meyering), build in
|
||||
debug mode (Jim Meyering), libnuma API portability (Jim Meyering),
|
||||
many portability fixes pointed by Solaris (John Levon), non-gcc
|
||||
portability fixes (John Levon), various include fixes (Jim Meyering),
|
||||
various Windows and Mingw portability fixes (Daniel Berrange),
|
||||
solaris Xen fixes (John Levon), RPC portability to Solaris (Daniel
|
||||
Berrange)
|
||||
- Documentation: typo fixes (Richard Jones), logging support,
|
||||
vnc keymap attributes (Guido G<>nther), HACKING file updates
|
||||
(Jim Meyering), new PCI passthrough format, libvirt-qpid and
|
||||
UML driver documentation (Daniel Berrange), provide RNG schemas
|
||||
for all XML formats used in libvirt APIs (Daniel Berrange),
|
||||
- Bug fixes: segfault on virtual network without bridge name (Cole
|
||||
Robinson), various locking fixes (Cole Robinson), fix serial
|
||||
and parallel devices on tcp/unix/telnet (Guido G<>nther), leak
|
||||
in daemon (Jim Meyering), storage driver segfault (Miloslav TrmaC),
|
||||
missing check in read-only connections (Daniel Berrange),
|
||||
OpenVZ crash and mutex fixes (Anton Protopopov), couple of
|
||||
daemon bug fixes (John Levon), OpenVZ MAC addresses generation
|
||||
(Evgeniy Sokolov), poll call initialization fix (Daniel Berrange),
|
||||
various Xen driver fixes (John Levon), segfault on device
|
||||
back compat (Cole Robinson), couple Xen bug fixes coming from
|
||||
RHEL (Markus Armbruster), buffer overflow in libvirt proxy
|
||||
(rasputin@email.ru), vnc port report (John Levon), repair save
|
||||
and restore on recent KVM versions (Daniel Berrange), Xen
|
||||
cpu pinning XML fix (John Levon), various xen driver fixes
|
||||
(Daniel Berrange), some memory leak fixes (Daniel Berrange)
|
||||
- Improvements: driver infrastructure and locking (Daniel Berrange),
|
||||
Test driver infrastructure (Daniel Berrange), parallelism in the
|
||||
daemon and associated config (Daniel Berrange), virsh help cleanups
|
||||
(Jim Meyering), logrotate daemon logs (Guido G<>nther), more
|
||||
regression tests (Jim Meyering), QEmu SDL graphics (Itamar Heim),
|
||||
add --version flag to daemon (Dave Allan), memory consumption
|
||||
cleanup (Dave Allan), QEmu pid file and XML states for daemon
|
||||
restart (Guido G<>nther), gnulib updates (Jim Meyering and
|
||||
Dan Berrange), PCI passthrough for KVM (Jason Krieg), generic
|
||||
internal thread API (Daniel Berrange), RHEL-5 specific Xen
|
||||
configure option and code (Markus Armbruster), save domain
|
||||
state as string in status file (Guido G<>nther), add locking
|
||||
to all API entry points (Daniel Berrange), new ref counting APIs
|
||||
(Daniel Berrange), IP address for Xen bridges (John Levon),
|
||||
driver format for disk file types (Daniel Berrange), improve
|
||||
QEmu/KVM tun/tap performances (Mark McLoughlin), enable floppies
|
||||
for Xen fully virt (John Levon), support VNC password settings
|
||||
for QEmu/KVM (Daniel Berrange), qemu driver version reporting
|
||||
(Daniel Berrange)
|
||||
- Cleanups: converting linked lists to arrays (Daniel Berrange),
|
||||
daemon RPC handling refactoring (Daniel Berrange), strings cleanups
|
||||
(Jim Meyering), gethostby* cleanup and test (Jim Meyering), some
|
||||
code fixes (Dave Allan), various code cleanup (Jim Meyering),
|
||||
virsh argument handling cleanup (Jim Meyering), virAsprintf
|
||||
cleanup replacement (Guido G<>nther), QEmu monitor reads (Cole
|
||||
Robinson), Makefile cleanups (Guido G<>nther), Xen code cleanups
|
||||
(John Levon), revamp of ELF export scripts (John Levon), domain
|
||||
event callback args (John Levon), enforce use of pid_t (John Levon),
|
||||
virsh pool-*-as XML code merge (Cole Robinson), xgettext warnings
|
||||
(Jim Meyering), add virKillProcess (Guido G<>nther), add
|
||||
virGetHostname (David Lutterkort), add flags argument to the full
|
||||
XML parsing stack (Guido G<>nther), various daemon code cleanups
|
||||
(Guido G<>nther), handling of daemon missing config file (Jim
|
||||
Meyering), rpcgen invocation cleanup (Richard Jones), devhelp
|
||||
builkd makefile cleanups (John Levon), update error handling for
|
||||
threading (Daniel Berrange), remove all non-rentrant POSIX calls
|
||||
usage (Daniel Berrange), many small cleanups (Jim Meyering and
|
||||
Daniel Berrange), examples Makefile generator (John Levon),
|
||||
mis-use of PF_UNIX as a protocol (John Levon), cleanup OOM
|
||||
error paths (Jim Meyering), temporary fix fro valgrind on lxc
|
||||
(Daniel Berrange), QEmu driver init cleanups (Daniel Berrange)
|
||||
|
||||
|
||||
0.5.1: Dec 4 2008:
|
||||
- Portability: fix missing dep in spec file, fix compilation with new
|
||||
NUMA libraries (Daniel Berrange), udev compatibility for RHEL (Chris
|
||||
Lalancette),
|
||||
- Documentation: documentation copy and paste errors and typo (Cole
|
||||
Robinson)
|
||||
- Bug fixes: add a delay in storage backend for disks to show up
|
||||
(Chris Lalancette), fix parsing for CDRom device with no source
|
||||
(Daniel Berrange), use xenstore to list domains to avoid some
|
||||
bugs (Guido G<>nther), remove a leak in xen inotify code (Daniel
|
||||
Berrange), UML driver freeing of uninitialialized variable (Ron
|
||||
Yorston), fix UML inotify code (Daniel Berrange), crash when
|
||||
adding storage without a format (Cole Robinson)
|
||||
- Improvements: use xend preferably to hypervisor call to set Xen
|
||||
max memory (Jim Fehlig), allow remote://hostname/ URI for automatic
|
||||
probe of hypervisors (Daniel Berrange), fix daemon configuration
|
||||
regression testing (Jim Meyering ), check /usr/bin/kvm for QEmu
|
||||
driver init (Guido G<>nther), proper active vs. inactive
|
||||
differentiation (Guido G<>nther), improve MTU setting on tap
|
||||
interfaces (Eduardo Habkost), increase timeout for initial QEmu
|
||||
monitor poll (Cole Robinson)
|
||||
- Cleanups:fix improper initialisations (Jim Meyering)
|
||||
|
||||
|
||||
0.5.0: Nov 25 2008:
|
||||
- New features: CPU and scheduler support for LXC (Dan Smith), SDL display configuration (Daniel Berrange), domain lifecycle event support for QEmu and Xen with python bindings (Ben Guthro and Daniel Berrange), KVM/QEmu migration support (Rich Jones and Chris Lalancette), User Mode Linux driver (Daniel Berrange), API for node device enumeration using HAL and DeviceKit with python bindings (David Lively),
|
||||
- Portability: RHEL build fixes, VPATH build (Guido Gunther), many MinGW related cleanups and fixes (Richard Jones), compilation without libvirtd (Richard Jones), Add a Windows icon (Richard Jones), sys/poll.h portability fixes (Daniel Berrange), gnulib and mingw cleanups (Jim Meyering),
|
||||
- Documentation: virsh man page cleanups (Mark McLoughlin), doc for NIC model selection (Richard Jones), monitoring section, link to AMQP bindings, inew APIs, UML driver docs (Daniel Berrange),
|
||||
- Bug fixes: Xen interfaces ordering (Jim Fehlig), startup timeout with multiple pty (Cole Robinson), segfault if QEmu without active virtual network (Cole Robinson), qemu small leak (Eduardo Habkost), index creation for more than 26 disks (Sanjay Rao and Chris Wright), virRealloc handling of 0 (Daniel Berrange), missing pointer initialization (Chris Lalancette), bus device index bug (Guido G<>nther), avoid crash in some error patch (Chris Lalancette), fix a problem in storage back-end (Chris Lalancette), minimum domain memory size check for Xen (Shigeki Sakamoto), switch off QEmu cache if device is shared (Charles Duffy), logical volume definition before scan bug (Chris Lalancette), a couple of memory leaks on QEmu vnc (Jim Meyering), lvs parsing fixes (Cole Robinson),
|
||||
- Improvements: LXC resources control and internal cgroup API (Dan Smith), virDomainCreateLinux renamed virDomainDefineXML, network driver modularization (Daniel Berrange), change the way domain and net are reported in errors (Jim Meyering), partition table scan on iSCSI (Chris Lalancette), qemudDiskDeviceName to handle normal disks (Guido G<>nther), qemudDomainBlockStats improvement (Guido G<>nther), scsi/virtio hotplug support for KVM (Guido G<>nther), USB hot addition in QEmu (Guido G<>nther), logical pool and storage backend XML dump improvement (Chris Lalancette), MAC addresses prefix per driver (Daniel Berrange), OpenVZ getVersion support (Daniel Berrange), hot removal of scsi/virtio disks for KVM (Guido G<>nther), test storage driver (Cole Robinson), iSCSI and disk storage driver improvement on path handling (Chris Lalancette), UUID and ID support for Xenner (Daniel Berrange), better logging when when executing commands (Cole Robinson), bridged network for OpenVZ (Daniel Berrange), OpenVZ config file params (Evgeniy Sokolov), allow to build drivers as libtool convenience libs (Daniel Berrange), fully versioned linker script for exported ABI (Daniel Berrange), Push URI probing down into drivers open (Daniel Berrange), move all stateful drivers into the daemon binary (Daniel Berrange), improve domain event with a detail field (Daniel Berrange), domain events for QEMU driver (Daniel Berrange), event unregister callback crash (David Lively), plug a few leaks (Daniel Berrange), internal APIs for handling node device XML config (David Lively), tweaks to node device implementation (Daniel Berrange), OpenVZ vCPUs values init (Evgeniy Sokolov)
|
||||
- Cleanups: C99 initializers (Guido Gunther), test output (Cole Robinson), debug macro centralization (Cole Robinson), various error handling (Guido G<>nther), safewrite use cleanup (Jim Meyering), centralize error reporting logic (Cole Robinson), avoid printf warnings (Daniel Berrange), use arrays instead of list for internal APIs (Daniel Berrange), remove many format string warnings Jim Meyering), avoid syntax check warnings (Chris Lalancette), improve po-check and list generation (Jim Meyering), .gitignore generation and handling (Jim Meyering), use ARRAY_CARDINALITY (Jim Meyering), gnulib updates and switch to use netdb.h (Jim Meyering), drop usage of socket_errno (Jim Meyering), remove socketcompat.h (Jim Meyering), more tests (Jim Meyering), drop virStringList (Daniel Berrange), reformatting and isolation of the error APIs (Daniel Berrange), cleanup internal.h and move internal APIs in specific headers (Daniel Berrange), move domain events helpers into domain_events.c (Daniel Berrange), cleanup the way optional modules are compiled (Daniel Berrange), add new logging module, optional dlopen of drivers (Daniel Berrange), various new tests (Jim Meyering), cleanups when Xen is not configured in (Daniel Berrange), add some missing functions comments (Jim Meyering),
|
||||
|
||||
|
||||
0.4.6: Sep 23 2008:
|
||||
- Documentation: fix some comments in API (Anton Protopopov),
|
||||
cleanup and extension of bindings and windows pages (Richard Jones)
|
||||
- Portability: missing include file (Richard Jones)
|
||||
- Bug fixes: avoid a segfault if missing qemu emulator (Cole Robinson),
|
||||
reading vncdisplay from xend domain (Cole Robinson), segfault in
|
||||
OpenVZ (Evgeniy Sokolov), fix parsing of pool without a source
|
||||
(Chris Lalancette and Daniel Berrange)
|
||||
- Improvements: add storage disk volume delete (Cole Robinson),
|
||||
KVM dynamic max CPU detection (Guido G<>nther), spec file improvement
|
||||
for minimal builds (Ben Guthro), improved error message in XM
|
||||
configuration module (Richard Jones), network config in OpenVZ
|
||||
support (Evgeniy Sokolov), enable stopping a pool in logical
|
||||
storage backend and cleanup deletion of pool (Chris Lalancette)
|
||||
- Cleanups: deadcode removal (Nguyen Anh Quynh), fix one test
|
||||
case (Daniel Berrange), various strings and space cleanups (Daniel
|
||||
Berrange), structure initialization cleanup (Chris Lalancette)
|
||||
|
||||
|
||||
0.4.5: Sep 8 2008:
|
||||
- New features: NETNS support for Linux containers (Dan Smith),
|
||||
unified XML domain and network parsing for all drivers (Daniel
|
||||
Berrange), OpenVZ features improvements (Evgeniy Sokolov),
|
||||
OpenVZ and Linux containers support now default, USB device
|
||||
passthrough for QEmu/KVM (Guido G<>nther), storage pool source
|
||||
discovery (David Lively)
|
||||
- Portability: fixes for MinGW (Atsushi SAKAI and Daniel Berrange),
|
||||
detection of xen lib improvement (David Lively),
|
||||
storage backend portability for SLES (David Lively),
|
||||
fix make distclean and distcheck (Jim Meyering),
|
||||
fix build failures on RHEL4, lot of MinGW portability fixes (Atsushi
|
||||
SAKAI and Daniel Berrange), HTML generation fix, -lpthread explicit
|
||||
linking when needed (Jim Meyering)
|
||||
- Documentation: various typo fixes (Anton Protopopov, Toth
|
||||
Istv<74>n, Atsushi SAKAI, Nguyen Anh Quynh),
|
||||
Java bindings docs, remove Xen centric
|
||||
comments (Guido G<>nther), various typo in comments (Chris
|
||||
Lalancette), docs and API comments fixes (Charles Duffy),
|
||||
how to contribute to open source link (Richard Jones),
|
||||
memory unit fixups (matthew chan)
|
||||
- Bug fixes: memory leaks and testing for OOM (Daniel Berrange),
|
||||
do_open driver bug(Evgeniy Sokolov), don't use polkit auth when
|
||||
running as non-root (Daniel Berrange), boot of CDRom devices
|
||||
in QEmu/KVM (Daniel Berrange), fix OpenVZ probe function (Evgeniy
|
||||
Sokolov), ID related lookup fixes in OpenVZ (Evgeniy Sokolov),
|
||||
pool cration for netfs (Cole Robinson), check for migrate support
|
||||
with QEmu (Guido G<>nther), check against double create with QEmu
|
||||
(Guido G<>nther), broken open failure detection in QEmu (Guido
|
||||
G<>nther), UUID string conversions in QEmu (Guido G<>nther),
|
||||
various small cleanup and bug fixes (Daniel Berrange), ID
|
||||
related fixes in the test driver (Daniel Berrange), better error
|
||||
reporting on XML parsing (Daniel Berrange), empty CD-ROM source
|
||||
device section (Chris Lalancette), avoid crashes for interface
|
||||
without a name in QEmu (Guido G<>nther), provide the real
|
||||
vncport (Charles Duffy), fix forward delay (Daniel Berrange),
|
||||
new VM state is initialized to be SHUTOFF (Daniel Berrange),
|
||||
virsh attach-disk bug fixes (Chris Lalancette), veth clash
|
||||
of device names (Dan Smith), connection lookup fixes on
|
||||
storage creation (Cole Robinson), parted call fix (Cole Robinson),
|
||||
use "server" option when using serial/telnet with QEmu (Mark
|
||||
McLoughlin), duplicate virInitialize calls (Nguyen Anh Quynh),
|
||||
many fixes to virExec and related functions (Daniel Berrange),
|
||||
size of disk without partitions (Cole Robinson), creating and
|
||||
cleaning up logical volumes with target path (Cole Robinson),
|
||||
fix reporting of virConnectOpen problems (Daniel Berrange),
|
||||
veth cleanup at shutdown (Dan Smith), lookup of Xen VMs after define
|
||||
(Cole Robinson), fix emulator reported capabilities (Cole Robinson),
|
||||
avoid segfault on KVM CD eject (Cole Robinson), fix disk ordering
|
||||
and avoid duplicate in QEmu XML parsing (Cole Robinson), update
|
||||
domain XML after device hotplug (Cole Robinson), use poweroff instead
|
||||
of halt when shutting down a Xen domain (John Levon), don't dump core
|
||||
of Xen domain live by default (John Levon), vgcreate command line
|
||||
size bug (Jim Fehlig), signed/unsigned issue in probing file
|
||||
(Cole Robinson), Fix Xen domains without PVFB console (Daniel
|
||||
Berrange), OpenVZ config read bug fix (Evgeniy Sokolov).
|
||||
|
||||
- Improvements: improved failure diagnostic for TAP (Jim Meyering),
|
||||
better exec and error diagnostic for OpenVZ commands (Evgeniy
|
||||
Sokolov), OpenVZ auto start and stop of domains (Evgeniy Sokolov),
|
||||
OpenVZ domain cpu time consumption (Evgeniy Sokolov), virsh
|
||||
shutdown improvements and test (Jim Meyering), better report of
|
||||
XML well formedness errors (Richard Jones), new XML elements
|
||||
(Daniel Berrange), virsh "edit" command (Richard Jones), save
|
||||
UUID of OpenVZ domains (Evgeniy Sokolov), improve xen blocks
|
||||
statistics (Chris Lalancette), gnulib updates (Jim Meyering),
|
||||
allow to add disk as USB devices (Guido G<>nther), LXC container
|
||||
process should survive libvirtd restarts (Daniel Berrange), allow
|
||||
to define static host domain configs, number of CPU used by
|
||||
OpenVZ domains (Evgeniy Sokolov), private root fs for LXC (Daniel
|
||||
Berrange), storage source information in storage pools (David Lively),
|
||||
virsh reports attach and detach success (Cole Robinson), detect
|
||||
failure in QEmu eject command (Cole Robinson), add support for
|
||||
eect on floppy and SCSI cdroms for QEmu (Cole Robinson), LXC
|
||||
hypervisor version extraction (Dan Smith), Augeas config file support
|
||||
(Daniel Berrange), support for a domain name in network
|
||||
config (JJ Reynolds).
|
||||
- Cleanups: Python verbosity cleanup (Ryan Scott),
|
||||
space and tabs cleanups (Atsushi SAKAI), OpenVZ and LXC drivers
|
||||
cleanup and unification of XML handling (Daniel Berrange), updates
|
||||
to Relax-NG XML schemas (John Levon and Daniel Berrange), more
|
||||
printf format checkings (Jim Meyering), VIR_FREE related cleanups
|
||||
(Jim Meyering), integer string parsing cleanup (Evgeniy Sokolov),
|
||||
initial OpenVZ xml refactoring (Evgeniy Sokolov), better error
|
||||
message on domain redefine (Charles Duffy), check XML files against
|
||||
the RNG Schemas (Daniel Berrange), const-correctness in virsh
|
||||
(Richard Jones and Jim Meyering), const-correctness and cleanups
|
||||
in LXC and OpenVZ drivers (Daniel Berrange), virFileLinkPointsTo
|
||||
rewrite (Jim Meyering), cleanup of the conditional compilation
|
||||
of C files (Daniel Berrange), shell quoting fixes (Jim Meyering),
|
||||
parallel build support (James Morris and Jim Meyering), new
|
||||
convenenience virFileReadLimFD function (Jim Meyering).
|
||||
|
||||
|
||||
0.4.4: Jun 25 2008:
|
||||
- Bug fixes: QEmu network serialization (Kaitlin Rupert), internal
|
||||
memory allocation fixes (Chris Lalancette Jim Meyering), virsh
|
||||
large file config problem (Jim Meyering), xen list APIs when
|
||||
max is zero, string escape problems in the xm driver
|
||||
- Improvements: add autogen to tarballs, improve iSCSI support
|
||||
(Chris Lalancette), localization updates
|
||||
- Cleanups: const-ness fixed (Daniel P. Berrange), string helpers
|
||||
for enumeations (Daniel P. Berrange)
|
||||
|
||||
|
||||
0.4.3: Jun 12 2008:
|
||||
- New features: Linux Container start and stop (Dave Leskovec),
|
||||
Network interface model settings (Daniel Berrange),serial and parallel
|
||||
device support for QEmu and Xen (Daniel Berrange),
|
||||
Sound support for QEmu and Xen (Cole Robinson), vCPU settings for
|
||||
QEmu (Cole Robinson), support for NUMA and vCPU pinning in QEmu
|
||||
(Daniel Berrange), new virDomainBlockPeek API (Richard Jones)
|
||||
- Documentation: coding guidelines (Jim Meyering and Richard Jones),
|
||||
small man page missing entries and cleanup,
|
||||
Web site revamp (Daniel Berrange),
|
||||
typo fixes (Atsushi SAKAI), more docs on network XML format
|
||||
(Daniel Berrange), libvirt Wiki (Daniel Berrange),
|
||||
policykit config docs (Cole Robinson), XML domain docs revamp
|
||||
(Daniel Berrange), docs for remote listen-tls/tcp fixes (Kenneth
|
||||
Nagin),
|
||||
- Bug fixes: save change to config file for Xen (Ryan Scott),
|
||||
fix /var/run/libvirt/ group ownership (Anton Protopopov),
|
||||
ancient libparted workaround (Soren Hansen), out of bount
|
||||
array access (Daniel Berrange), remote check bug (Dave Leskovec),
|
||||
LXC signal and daemon restart problems (Dave Leskovec), bus selection
|
||||
logic fix in the daemon config (Daniel Berrange), 2 memory leaks
|
||||
in the daemon (Jim Meyering), daemon pid file logic bug fix
|
||||
(Daniel Berrange), python generator fixes (Daniel Berrange),
|
||||
ivarious leaks and memory problem pointed by valgrind (Daniel
|
||||
Berrange), iptables forwarding cleanup (Daniel Berrange),
|
||||
Xen cpuset value checking (Hiroyuki Kaguchi), container process
|
||||
checks for LXC (Dave Leskovec), let xend check block device syntax
|
||||
(Hiroyuki Kaguchi), UUIDString for python fixes (Cole Robinson)
|
||||
- Improvements: fixes for MinGW compilation (Richard Jones),
|
||||
autostart for running Xen domains (Cole Robinson),
|
||||
control of listening IP for daemon (Stefan de Konink),
|
||||
various Xenner related fixes and improvements (Daniel Berrange)
|
||||
autostart status printed in virsh domainfo (Shigeki Sakamoto),
|
||||
better error messages for xend driver (Richard Jones)
|
||||
- Code cleanups: OpenVZ compilation (Richard Jones), conn dom and
|
||||
net fields deprecation in error structures (Richard Jones),
|
||||
Xen-ism on UUID (Richard Jones), add missing .pod to dist (Richard
|
||||
Jones), tab cleanup from sources (Jim Meyering), remove unused field
|
||||
in virsh control structure (Richard Jones), compilation without
|
||||
pthread.h (Jim Meyering), cleanup of tests (Daniel Berrange),
|
||||
syntax-check improvements (Jim Meyering), python cleanup,
|
||||
remove dependancy on libc is_* character tests (Jim Meyering),
|
||||
format related cleanups (Jim Meyering), cleanup of the buffer
|
||||
internal APIs (Daniel Berrange), conversion to the new memory
|
||||
allocation API (Daniel Berrange), lcov coverage testing
|
||||
(Daniel Berrange), gnulib updates (Jim Meyering), compatibility
|
||||
fix with RHEL 5 (Daniel Berrange), SuSE compatibility fix (Jim
|
||||
Fehlig), const'ification of a number of structures (Jim Meyering),
|
||||
string comparison macro cleanups (Daniel Berrange), character
|
||||
range testing cleanups and assorted bug fixes (Jim Meyering),
|
||||
QEmu test fixes (Daniel Berrange), configure macro cleanup (Daniel
|
||||
Berrange), refactor QEmu command line building code (Daniel Berrange),
|
||||
type punning warning in remote code (Richard Jones), refactoring
|
||||
of internal headers (Richard Jones), generic out of memory
|
||||
testing and associated bug fixes (Daniel Berrange), don't raise
|
||||
internal error for unsupported features (Kaitlin Rupert),
|
||||
missing driver entry points (Daniel Berrange)
|
||||
|
||||
|
||||
0.4.2: Apr 8 2008:
|
||||
- New features: memory operation for QEmu/KVM driver (Cole Robinson),
|
||||
new routed networking schemas (Mads Olesen)
|
||||
- Documentation: storage documentation fixes (Atsushi Sakai), many
|
||||
typo cleanups (Atsushi Sakai), string fixes (Francesco Tombolini)
|
||||
- Bug fixes: pointer errors in qemu (Jim Meyering), iSCSI login fix
|
||||
(Chris Lalancette), well formedness error in test driver capabilities
|
||||
(Cole Robinson), fixes cleanup code when daemon exits (Daniel Berrange),
|
||||
CD Rom change on live QEmu/KVM domains (Cole Robinson), setting scheduler
|
||||
parameter is forbidden for read-only (Saori Fukuta)i, fixes for TAP
|
||||
devices (Daniel Berrange), assorted storage driver fixes (Daniel
|
||||
Berrange), Makefile fixes (Jim Meyering), Xen-3.2 hypercall fix,
|
||||
fix iptables rules to avoid blocking traffic within virtual network
|
||||
(Daniel Berrange), XML output fix for directory pools (Daniel Berrange),
|
||||
remove dandling domain/net/conn pointers from error data, do not
|
||||
ask polkit auth when root (Daniel Berrange), handling of fork and
|
||||
pipe errors when starting the daemon (Richard Jones)
|
||||
- Improvements: better validation of MAC addresses (Jim Meyering and
|
||||
Hiroyuki Kaguchi),
|
||||
virsh vcpupin error report (Shigeki Sakamoto), keep boot tag on
|
||||
HVM domains (Cole Robinson), virsh non-root should not be limited to read
|
||||
only anymore (Daniel Berrange), switch to polkit-auth from polkit-grant
|
||||
(Daniel Berrange), better handling of missing SElinux data (Daniel
|
||||
Berrange and Jim Meyering), cleanup of the connection opening logic
|
||||
(Daniel Berrange), first bits of Linux Containers support (Dave Leskovec),
|
||||
scheduler API support via xend (Saori Fukuta), improvement of the
|
||||
testing framework and first tests (Jim Meyering), missing error
|
||||
messages from virsh parameters validation (Shigeki Sakamoto),
|
||||
improve support of older iscsiadm command (Chris Lalancette),
|
||||
move linux container support in the daemon (Dan Berrange), older
|
||||
awk implementation support (Mike Gerdts), NUMA support in test
|
||||
driver (Cole Robinson), xen and hvm added to test driver capabilities
|
||||
(Cole Robinson)
|
||||
- Code cleanup: remove unused getopt header (Jim Meyering), mark more
|
||||
strings as translatable (Guido G<>nther and Jim Meyering), convert
|
||||
error strings to something meaningful and translatable (Jim Meyering),
|
||||
Linux Containers code cleanup, last error initializer (Guido G<>nther)
|
||||
|
||||
|
||||
0.4.1: Mar 3 2008:
|
||||
- New features: build on MacOSX (Richard Jones), storage management
|
||||
(Daniel Berrange), Xenner - Xen on KVM - support (Daniel Berrange)
|
||||
- Documentation: Fix of various typos (Atsushi SAKAI), memory and
|
||||
vcpu settings details (Richard Jones), ethernet bridging typo
|
||||
(Maxwell Bottiger), add storage APIs documentation (Daniel Berrange)
|
||||
- Bug fixes: OpenVZ code compilation (Mikhail Pokidko), crash in
|
||||
policykit auth handling (Daniel Berrange), large config files
|
||||
(Daniel Berrange), cpumap hypercall size (Saori Fukuta), crash
|
||||
in remote auth (Daniel Berrange), ssh args error (Daniel Berrange),
|
||||
preserve vif order from config files (Hiroyuki Kaguchi), invalid
|
||||
pointer access (Jim Meyering), virDomainGetXMLDesc flag handling,
|
||||
device name conversion on stats (Daniel Berrange), double mutex lock
|
||||
(Daniel Berrange), config file reading crashes (Guido Guenther),
|
||||
xenUnifiedDomainSuspend bug (Marcus Meissner), do not crash if
|
||||
/sys/hypervisor/capabilities is missing (Mark McLoughlin),
|
||||
virHashRemoveSet bug (Hiroyuki Kaguchi), close-on-exec flag for
|
||||
qemud signal pipe (Daniel Berrange), double free in OpenVZ
|
||||
(Anton Protopopov), handle mac without addresses (Shigeki Sakamoto),
|
||||
MAC addresses checks (Shigeki Sakamoto and Richard Jones),
|
||||
allow to read non-seekable files (Jim Meyering)
|
||||
- Improvements: Windows build (Richard Jones), KVM/QEmu shutdown
|
||||
(Guido Guenther), catch virExec output on debug (Mark McLoughlin),
|
||||
integration of iptables and lokkit (Mark McLoughlin), keymap
|
||||
parameter for VNC servers (Daniel Hokka Zakrisson), enable debug
|
||||
by default using VIR_DEBUG (Daniel Berrange), xen 3.2 fixes
|
||||
(Daniel Berrange), Python bindings for VCPU and scheduling
|
||||
(Daniel Berrange), framework for automatic code syntax checks
|
||||
(Jim Meyering), allow kernel+initrd setup in Xen PV (Daniel Berrange),
|
||||
allow change of Disk/NIC of an inactive domains (Shigeki Sakamoto),
|
||||
virsh commands to manipulate and create storage(Daniel Berrange),
|
||||
update use of PolicyKit APIs, better detection of fedault hypervisor,
|
||||
block device statistics for QEmu/KVM (Richard Jones), various improvements
|
||||
for Xenner (Daniel Berrange)
|
||||
- Code cleanups: avoid warnings (Daniel Berrange), virRun helper
|
||||
function (Dan Berrange), iptable code fixes (Mark McLoughlin),
|
||||
static and const cleanups (Jim Meyering), malloc and python cleanups
|
||||
(Jim Meyering), xstrtol_ull and xstrtol_ll functions (Daniel Berrange),
|
||||
remove no-op networking from OpenVZ (Daniel Berrange), python generator
|
||||
cleanups (Daniel Berrange), cleanup ref counting (Daniel Berrange),
|
||||
remove uninitialized warnings (Jim Meyering), cleanup configure
|
||||
for RHEL4 (Daniel Berrange), CR/LF cleanups (Richard Jones),
|
||||
various automatic code check and associated cleanups (Jim Meyering),
|
||||
various memory leaks (Jim Meyering), fix compilation when building
|
||||
without Xen (Guido Guenther), mark translatables strings (Jim Meyering),
|
||||
use virBufferAddLit for constant strings (Jim Meyering), fix
|
||||
make distcheck (Jim Meyering), return values for python bindings (Cole
|
||||
Robinson), trailing blanks fixes (Jim Meyering), gcc-4.3.0 fixes
|
||||
(Mark McLoughlin), use safe read and write routines (Jim Meyering),
|
||||
refactoring of code dealing with hypervisor capabilities (Daniel
|
||||
Berrange), qemudReportError to use virErrorMsg (Cole Robinson),
|
||||
intemediate library and Makefiles for compiling static and coverage
|
||||
rule support (Jim Meyering), cleanup of various leaks (Jim Meyering)
|
||||
|
||||
|
||||
0.4.0: Dec 18 2007:
|
||||
- New features: Compilation on Windows cygwin/mingw (Richard Jones),
|
||||
Ruby bindings (David Lutterkort), SASL based authentication for
|
||||
libvirt remote support (Daniel Berrange), PolicyKit authentication
|
||||
(Daniel Berrange)
|
||||
- Documentation: example files for QEMU and libvirtd configuations
|
||||
(Daniel Berrange), english cleanups (Jim Paris), CIM and OpenVZ
|
||||
references, document <shareable/>, daemon startup when using
|
||||
QEMU/KVM, document HV support for new NUMA calls (Richard Jones),
|
||||
various english fixes (Bruce Montague), OCaml docs links (Richard Jones),
|
||||
describe the various bindings add Ruby link, Windows support page
|
||||
(Richard Jones), authentication documentation updates (Daniel Berrange)
|
||||
|
||||
- Bug fixes: NUMA topology error handling (Beth Kon), NUMA topology
|
||||
cells without CPU (Beth Kon), XML to/from XM bridge config (Daniel
|
||||
Berrange), XM processing of vnc parameters (Daniel Berrange), Reset
|
||||
migration source after failure (Jim Paris), negative integer in config
|
||||
(Tatsuro Enokura), zero terminating string buffer, detect integer
|
||||
overflow (Jim Meyering), QEmu command line ending fixes (Daniel Berrange),
|
||||
recursion problem in the daemon (Daniel Berrange), HVM domain with CDRom
|
||||
(Masayuki Sunou), off by one error in NUMA cpu count (Beth Kon),
|
||||
avoid xend errors when adding disks (Masayuki Sunou), compile error
|
||||
(Chris Lalancette), transposed fwrite args (Jim Meyering), compile
|
||||
without xen and on solaris (Jim Paris), parsing of interface names
|
||||
(Richard Jones), overflow for starts on 32bits (Daniel Berrange),
|
||||
fix problems in error reporting (Saori Fukuta), wrong call to
|
||||
brSetForwardDelay changed to brSetEnableSTP (Richard Jones),
|
||||
allow shareable disk in old Xen, fix wrong certificate file (Jim
|
||||
Meyering), avoid some startup error when non-root, off-by-1 buffer
|
||||
NULL termination (Daniel Berrange), various string allocation fixes
|
||||
(Daniel Berrange), avoid problems with vnetXXX interfaces in domain dumps
|
||||
(Daniel Berrange), build fixes for RHEL (Daniel Berrange), virsh prompt
|
||||
should not depend on uid (Richard Jones), fix scaping of '<' (Richard
|
||||
Jones), fix detach-disk on Xen tap devices (Saori Fukuta), CPU
|
||||
parameter setting in XM config (Saori Fukuta), credential handling
|
||||
fixes (Daniel Berrange), fix compatibility with Xen 3.2.0 (Daniel
|
||||
Berrange)
|
||||
|
||||
- Improvements: /etc/libvirt/qemu.conf configuration for QEMU driver
|
||||
(Daniel Berrange), NUMA cpu pinning in config files (DV and Saori Fukuta),
|
||||
CDRom media change in KVM/QEMU (Daniel Berrange), tests for
|
||||
<shareable/> in configs, pinning inactive domains for Xen 3.0.3
|
||||
(Saori Fukuta), use gnulib for portability enhancement (Jim Meyering),
|
||||
--without-libvirtd config option (Richard Jones), Python bindings for
|
||||
NUMA, add extra utility functions to buffer (Richard Jones),
|
||||
separate qparams module for handling query parameters (Richard Jones)
|
||||
|
||||
- Code cleanups: remove virDomainRestart from API as it was never used
|
||||
(Richard Jones), constify params for attach/detach APIs (Daniel Berrange),
|
||||
gcc printf attribute checkings (Jim Meyering), refactoring of device
|
||||
parsing code and shell escaping (Daniel Berrange), virsh schedinfo
|
||||
parameters validation (Masayuki Sunou), Avoid risk of format string abuse
|
||||
(Jim Meyering), integer parsing cleanups (Jim Meyering), build out
|
||||
of the source tree (Jim Meyering), URI parsing refactoring (Richard
|
||||
Jones), failed strdup/malloc handling (Jim Meyering), Make "make
|
||||
distcheck" work (Jim Meyering), improve xen internall error reports
|
||||
(Richard Jones), cleanup of the daemon remote code (Daniel Berrange),
|
||||
rename error VIR_FROM_LINUX to VIR_FROM_STATS_LINUX (Richard Jones),
|
||||
don't compile the proxy if without Xen (Richard Jones), fix paths when
|
||||
configuring for /usr prefix, improve error reporting code (Jim Meyering),
|
||||
detect heap allocation failure (Jim Meyering), disable xen sexpr parsing
|
||||
code if Xen is disabled (Daniel Berrange), cleanup of the GetType
|
||||
entry point for Xen drivers, move some QEmu path handling to generic
|
||||
module (Daniel Berrange), many code cleanups related to the Windows
|
||||
port (Richard Jones), disable the proxy if using PolicyKit, readline
|
||||
availability detection, test libvirtd's config-processing code (Jim
|
||||
Meyering), use a variable name as sizeof argument (Jim Meyering)
|
||||
|
||||
|
||||
|
||||
0.3.3: Sep 30 2007:
|
||||
- New features: Avahi mDNS daemon export (Daniel Berrange),
|
||||
NUMA support (Beth Kan)
|
||||
- Documentation: cleanups (Toth Istvan), typos (Eduardo Pereira),
|
||||
- Bug fixes: memory corruption on large dumps (Masayuki Sunou), fix
|
||||
virsh vncdisplay command exit (Masayuki Sunou), Fix network stats
|
||||
TX/RX result (Richard Jones), warning on Xen 3.0.3 (Richard Jones),
|
||||
missing buffer check in virDomainXMLDevID (Hugh Brock), avoid zombies
|
||||
when using remote (Daniel Berrange), xend connection error message
|
||||
(Richard Jones), avoid ssh tty prompt (Daniel Berrange), username
|
||||
handling for remote URIs (Fabian Deutsch), fix potential crash
|
||||
on multiple input XML tags (Daniel Berrange), Solaris Xen hypercalls
|
||||
fixup (Mark Johnson)
|
||||
- Improvements: OpenVZ support (Shuveb Hussain and Anoop Cyriac),
|
||||
CD-Rom reload on XEn (Hugh Brock), PXE boot got QEmu/KVM (Daniel
|
||||
Berrange), QEmu socket permissions customization (Daniel Berrange),
|
||||
more QEmu support (Richard Jones), better path detection for qemu and
|
||||
dnsmasq (Richard Jones), QEmu flags are per-Domain (Daniel Berrange),
|
||||
virsh freecell command, Solaris portability fixes (Mark Johnson),
|
||||
default bootloader support (Daniel Berrange), new virNodeGetFreeMemory
|
||||
API, vncpasswd extraction in configuration files if secure (Mark
|
||||
Johnson and Daniel Berrange), Python bindings for block and interface
|
||||
statistics
|
||||
- Code cleanups: virDrvOpenRemoteFlags definition (Richard Jones),
|
||||
configure tests and output (Daniel Berrange)
|
||||
|
||||
|
||||
0.3.2: Aug 21 2007:
|
||||
- New features: KVM migration and save/restore (Jim Paris),
|
||||
added API for migration (Richard Jones), added APIs for block device and
|
||||
interface statistic (Richard Jones).
|
||||
- Documentation: examples for XML network APIs,
|
||||
fix typo and schedinfo synopsis in man page (Atsushi SAKAI),
|
||||
hypervisor support page update (Richard Jones).
|
||||
- Bug fixes: remove a couple of leaks in QEmu/KVM backend(Daniel berrange),
|
||||
fix GnuTLS 1.0 compatibility (Richard Jones), --config/-f option
|
||||
mistake for libvirtd (Richard Jones), remove leak in QEmu backend
|
||||
(Jim Paris), fix some QEmu communication bugs (Jim Paris), UUID
|
||||
lookup though proxy fix, setvcpus checking bugs (with Atsushi SAKAI),
|
||||
int checking in virsh parameters (with Masayuki Sunou), deny devices
|
||||
attach/detach for < Xen 3.0.4 (Masayuki Sunou), XenStore query
|
||||
memory leak (Masayuki Sunou), virsh schedinfo cleanup (Saori Fukuta).
|
||||
- Improvement: virsh new ttyconsole command, networking API implementation
|
||||
for test driver (Daniel berrange), qemu/kvm feature reporting of
|
||||
ACPI/APIC (David Lutterkort), checking of QEmu architectures (Daniel
|
||||
berrange), improve devices XML errors reporting (Masayuki Sunou),
|
||||
speedup of domain queries on Xen (Daniel berrange), augment XML dumps
|
||||
with interface devices names (Richard Jones), internal API to query
|
||||
drivers for features (Richard Jones).
|
||||
|
||||
- Cleanups: Improve virNodeGetInfo implentation (Daniel berrange),
|
||||
general UUID code cleanup (Daniel berrange), fix API generator
|
||||
file selection.
|
||||
|
||||
|
||||
0.3.1: Jul 24 2007:
|
||||
- Documentation: index to remote page, script to test certificates,
|
||||
IPv6 remote support docs (Daniel Berrange), document
|
||||
VIRSH_DEFAULT_CONNECT_URI in virsh man page (David Lutterkort),
|
||||
Relax-NG early grammar for the network XML (David Lutterkort)
|
||||
- Bug fixes: leaks in disk XML parsing (Masayuki Sunou), hypervisor
|
||||
alignment call problems on PPC64 (Christian Ehrhardt), dead client
|
||||
registration in daemon event loop (Daniel Berrange), double free
|
||||
in error handling (Daniel Berrange), close on exec for log file
|
||||
descriptors in the daemon (Daniel Berrange), avoid caching problem
|
||||
in remote daemon (Daniel Berrange), avoid crash after QEmu domain
|
||||
failure (Daniel Berrange)
|
||||
- Improvements: checks of x509 certificates and keys (Daniel Berrange),
|
||||
error reports in the daemon (Daniel Berrange), checking of Ethernet MAC
|
||||
addresses in XML configs (Masayuki Sunou), support for a new
|
||||
clock switch between UTC and localtime (Daniel Berrange), early
|
||||
version of OpenVZ support (Shuveb Hussain), support for input devices
|
||||
on PS/2 and USB buses (Daniel Berrange), more tests especially
|
||||
the QEmu support (Daniel Berrange), range check in credit scheduler
|
||||
(with Saori Fukuta and Atsushi Sakai), add support for listen VNC
|
||||
parameter un QEmu and fix command line arg (Daniel Berrange)
|
||||
- Cleanups: debug tracing (Richard Jones), removal of --with-qemud-pid-file
|
||||
(Richard Jones), remove unused virDeviceMode, new util module for
|
||||
code shared between drivers (Shuveb Hussain), xen header location
|
||||
detection (Richard Jones)
|
||||
|
||||
|
||||
0.3.0: Jul 9 2007:
|
||||
- Secure Remote support (Richard Jones).
|
||||
See the remote page
|
||||
of the documentation
|
||||
|
||||
- Documentation: remote support (Richard Jones), description of
|
||||
the URI connection strings (Richard Jones), update of virsh man
|
||||
page, matrix of libvirt API/hypervisor support with version
|
||||
information (Richard Jones)
|
||||
- Bug fixes: examples Makefile.am generation (Richard Jones),
|
||||
SetMem fix (Mark Johnson), URI handling and ordering of
|
||||
drivers (Daniel Berrange), fix virsh help without hypervisor (Richard
|
||||
Jones), id marshalling fix (Daniel Berrange), fix virConnectGetMaxVcpus
|
||||
on remote (Richard Jones), avoid a realloc leak (Jim Meyering), scheduler
|
||||
parameters handling for Xen (Richard Jones), various early remote
|
||||
bug fixes (Richard Jones), remove virsh leaks of domains references
|
||||
(Masayuki Sunou), configCache refill bug (Richard Jones), fix
|
||||
XML serialization bugs
|
||||
- Improvements: QEmu switch to XDR-based protocol (Dan Berrange),
|
||||
device attach/detach commands (Masayuki Sunou), OCaml bindings
|
||||
(Richard Jones), new entry points virDomainGetConnect and
|
||||
virNetworkGetConnect useful for bindings (Richard Jones),
|
||||
reunitifaction of remote and qemu daemon under a single libvirtd
|
||||
with a config file (Daniel Berrange)
|
||||
- Cleanups: parsing of connection URIs (Richard Jones), messages
|
||||
from virsh (Saori Fukuta), Coverage files (Daniel Berrange),
|
||||
Solaris fixes (Mark Johnson), avoid [r]index calls (Richard Jones),
|
||||
release information in Xen backend, virsh cpupin command cleanups
|
||||
(Masayuki Sunou), xen:/// suppport as standard Xen URI (Richard Jones and
|
||||
Daniel Berrange), improve driver selection/decline mechanism (Richard
|
||||
Jones), error reporting on XML dump (Richard Jones), Remove unused
|
||||
virDomainKernel structure (Richard Jones), daemon event loop event
|
||||
handling (Daniel Berrange), various unifications cleanup in the daemon
|
||||
merging (Daniel Berrange), internal file and timer monitoring API
|
||||
(Daniel Berrange), remove libsysfs dependancy, call brctl program
|
||||
directly (Daniel Berrange), virBuffer functions cleanups (Richard Jones),
|
||||
make init script LSB compliant, error handling on lookup functions
|
||||
(Richard Jones), remove internal virGetDomainByID (Richard Jones),
|
||||
revamp of xen subdrivers interfaces (Richard Jones)
|
||||
- Localization updates
|
||||
|
||||
|
||||
0.2.3: Jun 8 2007:
|
||||
- Documentation: documentation for upcoming remote access (Richard Jones),
|
||||
virConnectNumOfDefinedDomains doc (Jan Michael), virsh help messages
|
||||
for dumpxml and net-dumpxml (Chris Wright),
|
||||
- Bug fixes: RelaxNG schemas regexp fix (Robin Green), RelaxNG arch bug
|
||||
(Mark McLoughlin), large buffers bug fixes (Shigeki Sakamoto), error
|
||||
on out of memory condition (Shigeki Sakamoto), virshStrdup fix, non-root
|
||||
driver when using Xen bug (Richard Jones), use --strict-order when
|
||||
running dnsmasq (Daniel Berrange), virbr0 weirdness on restart (Mark
|
||||
McLoughlin), keep connection error messages (Richard Jones), increase
|
||||
QEmu read buffer on help (Daniel Berrange), rpm dependance on
|
||||
dnsmasq (Daniel Berrange), fix XML boot device syntax (Daniel Berrange),
|
||||
QEmu memory bug (Daniel Berrange), memory leak fix (Masayuki Sunou),
|
||||
fix compiler flags (Richard Jones), remove type ioemu on recent Xen
|
||||
HVM for paravirt drivers (Saori Fukuta), uninitialized string bug
|
||||
(Masayuki Sunou), allow init even if the daemon is not running,
|
||||
XML to config fix (Daniel Berrange)
|
||||
- Improvements: add a special error class for the test module (Richard
|
||||
Jones), virConnectGetCapabilities on proxy (Richard Jones), allow
|
||||
network driver to decline usage (Richard Jones), extend error messages
|
||||
for upcoming remote access (Richard Jones), on_reboot support for QEmu
|
||||
(Daniel Berrange), save daemon output in a log file (Daniel Berrange),
|
||||
xenXMDomainDefineXML can override guest config (Hugh Brock),
|
||||
add attach-device and detach-device commands to virsh (Masayuki Sunou
|
||||
and Mark McLoughlin and Richard Jones), make virGetVersion case
|
||||
insensitive and Python bindings (Richard Jones), new scheduler API
|
||||
(Atsushi SAKAI), localizations updates, add logging option for virsh
|
||||
(Nobuhiro Itou), allow arguments to be passed to bootloader (Hugh Brock),
|
||||
increase the test suite (Daniel Berrange and Hugh Brock)
|
||||
- Cleanups: Remove VIR_DRV_OPEN_QUIET (Richard Jones), disable xm_internal.c
|
||||
for Xen > 3.0.3 (Daniel Berrange), unused fields in _virDomain (Richard
|
||||
Jones), export __virGetDomain and __virGetNetwork for libvirtd only
|
||||
(Richard Jones), ignore old VNC config for HVM on recent Xen (Daniel
|
||||
Berrange), various code cleanups, -Werror cleanup (Hugh Brock)
|
||||
|
||||
|
||||
0.2.2: Apr 17 2007:
|
||||
- Documentation: fix errors due to Amaya (with Simon Hernandez),
|
||||
virsh uses kB not bytes (Atsushi SAKAI), add command line help to
|
||||
qemud (Richard Jones), xenUnifiedRegister docs (Atsushi SAKAI),
|
||||
strings typos (Nikolay Sivov), ilocalization probalem raised by
|
||||
Thomas Canniot
|
||||
- Bug fixes: virsh memory values test (Masayuki Sunou), operations without
|
||||
libvirt_qemud (Atsushi SAKAI), fix spec file (Florian La Roche, Jeremy
|
||||
Katz, Michael Schwendt),
|
||||
direct hypervisor call (Atsushi SAKAI), buffer overflow on qemu
|
||||
networking command (Daniel Berrange), buffer overflow in quemud (Daniel
|
||||
Berrange), virsh vcpupin bug (Masayuki Sunou), host PAE detections
|
||||
and strcuctures size (Richard Jones), Xen PAE flag handling (Daniel
|
||||
Berrange), bridged config configuration (Daniel Berrange), erroneous
|
||||
XEN_V2_OP_SETMAXMEM value (Masayuki Sunou), memory free error (Mark
|
||||
McLoughlin), set VIR_CONNECT_RO on read-only connections (S.Sakamoto),
|
||||
avoid memory explosion bug (Daniel Berrange), integer overflow
|
||||
for qemu CPU time (Daniel Berrange), QEMU binary path check (Daniel
|
||||
Berrange)
|
||||
- Cleanups: remove some global variables (Jim Meyering), printf-style
|
||||
functions checks (Jim Meyering), better virsh error messages, increase
|
||||
compiler checkings and security (Daniel Berrange), virBufferGrow usage
|
||||
and docs, use calloc instead of malloc/memset, replace all sprintf by
|
||||
snprintf, avoid configure clobbering user's CTAGS (Jim Meyering),
|
||||
signal handler error cleanup (Richard Jones), iptables internal code
|
||||
claenup (Mark McLoughlin), unified Xen driver (Richard Jones),
|
||||
cleanup XPath libxml2 calls, IPTables rules tightening (Daniel
|
||||
Berrange),
|
||||
- Improvements: more regression tests on XML (Daniel Berrange), Python
|
||||
bindings now generate exception in error cases (Richard Jones),
|
||||
Python bindings for vir*GetAutoStart (Daniel Berrange),
|
||||
handling of CD-Rom device without device name (Nobuhiro Itou),
|
||||
fix hypervisor call to work with Xen 3.0.5 (Daniel Berrange),
|
||||
DomainGetOSType for inactive domains (Daniel Berrange), multiple boot
|
||||
devices for HVM (Daniel Berrange),
|
||||
|
||||
|
||||
|
||||
0.2.1: Mar 16 2007:
|
||||
- Various internal cleanups (Richard Jones,Daniel Berrange,Mark McLoughlin)
|
||||
- Bug fixes: libvirt_qemud daemon path (Daniel Berrange), libvirt
|
||||
config directory (Daniel Berrange and Mark McLoughlin), memory leak
|
||||
in qemud (Mark), various fixes on network support (Mark), avoid Xen
|
||||
domain zombies on device hotplug errors (Daniel Berrange), various
|
||||
fixes on qemud (Mark), args parsing (Richard Jones), virsh -t argument
|
||||
(Saori Fukuta), avoid virsh crash on TAB key (Daniel Berrange), detect
|
||||
xend operation failures (Kazuki Mizushima), don't listen on null socket
|
||||
(Rich Jones), read-only socket cleanup (Rich Jones), use of vnc port 5900
|
||||
(Nobuhiro Itou), assorted networking fixes (Daniel Berrange), shutoff and
|
||||
shutdown mismatches (Kazuki Mizushima), unlimited memory handling
|
||||
(Atsushi SAKAI), python binding fixes (Tatsuro Enokura)
|
||||
- Build and portability fixes: IA64 fixes (Atsushi SAKAI), dependancies
|
||||
and build (Daniel Berrange), fix xend port detection (Daniel
|
||||
Berrange), icompile time warnings (Mark), avoid const related
|
||||
compiler warnings (Daniel Berrange), automated builds (Daniel
|
||||
Berrange), pointer/int mismatch (Richard Jones), configure time
|
||||
selection of drivers, libvirt spec hacking (Daniel Berrange)
|
||||
- Add support for network autostart and init scripts (Mark McLoughlin)
|
||||
- New API virConnectGetCapabilities() to detect the virtualization
|
||||
capabilities of a host (Richard Jones)
|
||||
- Minor improvements: qemud signal handling (Mark), don't shutdown or reboot
|
||||
domain0 (Kazuki Mizushima), QEmu version autodetection (Daniel Berrange),
|
||||
network UUIDs (Mark), speed up UUID domain lookups (Tatsuro Enokura and
|
||||
Daniel Berrange), support for paused QEmu CPU (Daniel Berrange), keymap
|
||||
VNC attribute support (Takahashi Tomohiro and Daniel Berrange), maximum
|
||||
number of virtual CPU (Masayuki Sunou), virtsh --readonly option (Rich
|
||||
Jones), python bindings for new functions (Daniel Berrange)
|
||||
- Documentation updates especially on the XML formats
|
||||
|
||||
|
||||
0.2.0: Feb 14 2007:
|
||||
- Various internal cleanups (Mark McLoughlin, Richard Jones,
|
||||
Daniel Berrange, Karel Zak)
|
||||
- Bug fixes: avoid a crash in connect (Daniel Berrange), virsh args
|
||||
parsing (Richard Jones)
|
||||
- Add support for QEmu and KVM virtualization (Daniel Berrange)
|
||||
- Add support for network configuration (Mark McLoughlin)
|
||||
- Minor improvements: regression testing (Daniel Berrange),
|
||||
localization string updates
|
||||
|
||||
|
||||
0.1.11: Jan 22 2007:
|
||||
- Finish XML <-> XM config files support
|
||||
- Remove memory leak when freeing virConf objects
|
||||
- Finishing inactive domain support (Daniel Berrange)
|
||||
- Added a Relax-NG schemas to check XML instances
|
||||
|
||||
|
||||
0.1.10: Dec 20 2006:
|
||||
- more localizations
|
||||
- bug fixes: VCPU info breakages on xen 3.0.3, xenDaemonListDomains buffer overflow (Daniel Berrange), reference count bug when creating Xen domains (Daniel Berrange).
|
||||
- improvements: support graphic framebuffer for Xen paravirt (Daniel Berrange), VNC listen IP range support (Daniel Berrange), support for default Xen config files and inactive domains of 3.0.4 (Daniel Berrange).
|
||||
|
||||
|
||||
0.1.9: Nov 29 2006:
|
||||
- python bindings: release interpeter lock when calling C (Daniel Berrange)
|
||||
- don't raise HTTP error when looking information for a domain
|
||||
- some refactoring to use the driver for all entry points
|
||||
- better error reporting (Daniel Berrange)
|
||||
- fix OS reporting when running as non-root
|
||||
- provide XML parsing errors
|
||||
- extension of the test framework (Daniel Berrange)
|
||||
- fix the reconnect regression test
|
||||
- python bindings: Domain instances now link to the Connect to avoid garbage collection and disconnect
|
||||
- separate the notion of maximum memory and current use at the XML level
|
||||
- Fix a memory leak (Daniel Berrange)
|
||||
- add support for shareable drives
|
||||
- add support for non-bridge style networking configs for guests(Daniel Berrange)
|
||||
- python bindings: fix unsigned long marshalling (Daniel Berrange)
|
||||
- new config APIs virConfNew() and virConfSetValue() to build configs from scratch
|
||||
- hot plug device support based on Michel Ponceau patch
|
||||
- added support for inactive domains, new APIs, various associated cleanup (Daniel Berrange)
|
||||
- special device model for HVM guests (Daniel Berrange)
|
||||
- add API to dump core of domains (but requires a patched xend)
|
||||
- pygrub bootloader information take over <os> information
|
||||
- updated the localization strings
|
||||
|
||||
|
||||
0.1.8: Oct 16 2006:
|
||||
- Bug for system with page size != 4k
|
||||
- vcpu number initialization (Philippe Berthault)
|
||||
- don't label crashed domains as shut off (Peter Vetere)
|
||||
- fix virsh man page (Noriko Mizumoto)
|
||||
- blktapdd support for alternate drivers like blktap (Daniel Berrange)
|
||||
- memory leak fixes (xend interface and XML parsing) (Daniel Berrange)
|
||||
- compile fix
|
||||
- mlock/munlock size fixes (Daniel Berrange)
|
||||
- improve error reporting
|
||||
|
||||
|
||||
0.1.7: Sep 29 2006:
|
||||
- fix a memory bug on getting vcpu information from xend (Daniel Berrange)
|
||||
- fix another problem in the hypercalls change in Xen changeset
|
||||
86d26e6ec89b when getting domain information (Daniel Berrange)
|
||||
|
||||
|
||||
0.1.6: Sep 22 2006:
|
||||
- Support for localization of strings using gettext (Daniel Berrange)
|
||||
- Support for new Xen-3.0.3 cdrom and disk configuration (Daniel Berrange)
|
||||
- Support for setting VNC port when creating domains with new
|
||||
xend config files (Daniel Berrange)
|
||||
- Fix bug when running against xen-3.0.2 hypercalls (Jim Fehlig)
|
||||
- Fix reconnection problem when talking directly to http xend
|
||||
|
||||
|
||||
0.1.5: Sep 5 2006:
|
||||
- Support for new hypercalls change in Xen changeset 86d26e6ec89b
|
||||
- bug fixes: virParseUUID() was wrong, netwoking for paravirt guestsi
|
||||
(Daniel Berrange), virsh on non-existent domains (Daniel Berrange),
|
||||
string cast bug when handling error in python (Pete Vetere), HTTP
|
||||
500 xend error code handling (Pete Vetere and Daniel Berrange)
|
||||
- improvements: test suite for SEXPR <-> XML format conversions (Daniel
|
||||
Berrange), virsh output regression suite (Daniel Berrange), new environ
|
||||
variable VIRSH_DEFAULT_CONNECT_URI for the default URI when connecting
|
||||
(Daniel Berrange), graphical console support for paravirt guests
|
||||
(Jeremy Katz), parsing of simple Xen config files (with Daniel Berrange),
|
||||
early work on defined (not running) domains (Daniel Berrange),
|
||||
virsh output improvement (Daniel Berrange
|
||||
|
||||
|
||||
0.1.4: Aug 16 2006:
|
||||
- bug fixes: spec file fix (Mark McLoughlin), error report problem (with
|
||||
Hugh Brock), long integer in Python bindings (with Daniel Berrange), XML
|
||||
generation bug for CDRom (Daniel Berrange), bug whem using number() XPath
|
||||
function (Mark McLoughlin), fix python detection code, remove duplicate
|
||||
initialization errors (Daniel Berrange)
|
||||
- improvements: UUID in XML description (Peter Vetere), proxy code
|
||||
cleanup, virtual CPU and affinity support + virsh support (Michel
|
||||
Ponceau, Philippe Berthault, Daniel Berrange), port and tty information
|
||||
for console in XML (Daniel Berrange), added XML dump to driver and proxy
|
||||
support (Daniel Berrange), extention of boot options with support for
|
||||
floppy and cdrom (Daniel Berrange), features block in XML to report/ask
|
||||
PAE, ACPI, APIC for HVM domains (Daniel Berrange), fail saide-effect
|
||||
operations when using read-only connection, large improvements to test
|
||||
driver (Daniel Berrange)
|
||||
- documentation: spelling (Daniel Berrange), test driver examples.
|
||||
|
||||
|
||||
0.1.3: Jul 11 2006:
|
||||
- bugfixes: build as non-root, fix xend access when root, handling of
|
||||
empty XML elements (Mark McLoughlin), XML serialization and parsing fixes
|
||||
(Mark McLoughlin), allow to create domains without disk (Mark
|
||||
McLoughlin),
|
||||
- improvement: xenDaemonLookupByID from O(n^2) to O(n) (Daniel Berrange),
|
||||
support for fully virtualized guest (Jim Fehlig, DV, Mark McLoughlin)
|
||||
- documentation: augmented to cover hvm domains
|
||||
|
||||
|
||||
0.1.2: Jul 3 2006:
|
||||
- headers include paths fixup
|
||||
- proxy mechanism for unprivileged read-only access by httpu
|
||||
|
||||
|
||||
0.1.1: Jun 21 2006:
|
||||
- building fixes: ncurses fallback (Jim Fehlig), VPATH builds (Daniel P.
|
||||
Berrange)
|
||||
- driver cleanups: new entry points, cleanup of libvirt.c (with Daniel P.
|
||||
Berrange)
|
||||
- Cope with API change introduced in Xen changeset 10277
|
||||
- new test driver for regression checks (Daniel P. Berrange)
|
||||
- improvements: added UUID to XML serialization, buffer usage (Karel
|
||||
Zak), --connect argument to virsh (Daniel P. Berrange),
|
||||
- bug fixes: uninitialized memory access in error reporting, S-Expr
|
||||
parsing (Jim Fehlig, Jeremy Katz), virConnectOpen bug, remove a TODO in
|
||||
xs_internal.c
|
||||
- documentation: Python examples (David Lutterkort), new Perl binding
|
||||
URL, man page update (Karel Zak)
|
||||
|
||||
|
||||
0.1.0: Apr 10 2006:
|
||||
- building fixes: --with-xen-distdir option (Ronald Aigner), out of tree
|
||||
build and pkginfo cflag fix (Daniel Berrange)
|
||||
- enhancement and fixes of the XML description format (David Lutterkort
|
||||
and Jim Fehlig)
|
||||
- new APIs: for Node information and Reboot
|
||||
- internal code cleanup: refactoring internals into a driver model, more
|
||||
error handling, structure sharing, thread safety and ref counting
|
||||
- bug fixes: error message (Jim Meyering), error allocation in virsh (Jim
|
||||
Meyering), virDomainLookupByID (Jim Fehlig),
|
||||
- documentation: updates on architecture, and format, typo fix (Jim
|
||||
Meyering)
|
||||
- bindings: exception handling in examples (Jim Meyering), perl ones out
|
||||
of tree (Daniel Berrange)
|
||||
- virsh: more options, create, nodeinfo (Karel Zak), renaming of some
|
||||
options (Karel Zak), use stderr only for errors (Karel Zak), man page
|
||||
(Andrew Puch)
|
||||
|
||||
|
||||
0.0.6: Feb 28 2006:
|
||||
- add UUID lookup and extract API
|
||||
- add error handling APIs both synchronous and asynchronous
|
||||
- added minimal hook for error handling at the python level, improved the
|
||||
python bindings
|
||||
- augment the documentation and tests to cover error handling
|
||||
|
||||
|
||||
0.0.5: Feb 23 2006:
|
||||
- Added XML description parsing, dependance to libxml2, implemented the
|
||||
creation API virDomainCreateLinux()
|
||||
- new APIs to lookup and name domain by UUID
|
||||
- fixed the XML dump when using the Xend access
|
||||
- Fixed a few more problem related to the name change
|
||||
- Adding regression tests in python and examples in C
|
||||
- web site improvement, extended the documentation to cover the XML
|
||||
format and Python API
|
||||
- Added devhelp help for Gnome/Gtk programmers
|
||||
|
||||
|
||||
0.0.4: Feb 10 2006:
|
||||
- Fix various bugs introduced in the name change
|
||||
|
||||
|
||||
0.0.3: Feb 9 2006:
|
||||
- Switch name from from 'libvir' to libvirt
|
||||
- Starting infrastructure to add code examples
|
||||
- Update of python bindings for completeness
|
||||
|
||||
|
||||
0.0.2: Jan 29 2006:
|
||||
- Update of the documentation, web site redesign (Diana Fong)
|
||||
- integration of HTTP xend RPC based on libxend by Anthony Liquori for
|
||||
most operations
|
||||
- Adding Save and Restore APIs
|
||||
- extended the virsh command line tool (Karel Zak)
|
||||
- remove xenstore transactions (Anthony Liguori)
|
||||
- fix the Python bindings bug when domain and connections where freed
|
||||
|
||||
|
||||
0.0.1: Dec 19 2005:
|
||||
- First release
|
||||
- Basic management of existing Xen domains
|
||||
- Minimal autogenerated Python bindings
|
||||
|
52
README-hacking
Normal file
52
README-hacking
Normal file
@ -0,0 +1,52 @@
|
||||
-*- outline -*-
|
||||
|
||||
These notes intend to help people working on the checked-out sources.
|
||||
These requirements do not apply when building from a distribution tarball.
|
||||
See also HACKING for more detailed libvirt contribution guidelines.
|
||||
|
||||
* Requirements
|
||||
|
||||
We've opted to keep only the highest-level sources in the GIT repository.
|
||||
This eases our maintenance burden, (fewer merges etc.), but imposes more
|
||||
requirements on anyone wishing to build from the just-checked-out sources.
|
||||
Note the requirements to build the released archive are much less and
|
||||
are just the requirements of the standard ./configure && make procedure.
|
||||
Specific development tools and versions will be checked for and listed by
|
||||
the bootstrap script. See README-prereq for specific notes on obtaining
|
||||
these prerequisite tools.
|
||||
|
||||
Valgrind <http://valgrind.org/> is also highly recommended, if
|
||||
Valgrind supports your architecture. See also README-valgrind.
|
||||
|
||||
While building from a just-cloned source tree may require installing a
|
||||
few prerequisites, later, a plain `git pull && make' should be sufficient.
|
||||
|
||||
* First GIT checkout
|
||||
|
||||
You can get a copy of the source repository like this:
|
||||
|
||||
$ git clone git://libvirt.org/libvirt
|
||||
$ cd libvirt
|
||||
|
||||
The next step is to get all required pieces from gnulib,
|
||||
to run autoreconf, and to invoke ./configure:
|
||||
|
||||
$ ./autogen.sh
|
||||
|
||||
And there you are! Just
|
||||
|
||||
$ make
|
||||
$ make check
|
||||
|
||||
At this point, there should be no difference between your local copy,
|
||||
and the GIT master copy:
|
||||
|
||||
$ git diff
|
||||
|
||||
should output no difference.
|
||||
|
||||
Enjoy!
|
||||
|
||||
Local Variables:
|
||||
indent-tabs-mode: nil
|
||||
End:
|
30
RENAMES
30
RENAMES
@ -1,30 +0,0 @@
|
||||
# Suggested list of file renames.
|
||||
#
|
||||
# File renames don't normally go into patches because they make
|
||||
# the patches much harder to read, so list them here instead.
|
||||
|
||||
# Clearer naming scheme after Xen-unified patch went in.
|
||||
src/xen_internal.c src/xen_internal_hv.c
|
||||
src/xen_internal.h src/xen_internal_hv.h
|
||||
src/proxy_internal.c src/xen_internal_proxy.c
|
||||
src/proxy_internal.h src/xen_internal_proxy.h
|
||||
src/xend_internal.c src/xen_internal_xend.c
|
||||
src/xend_internal.h src/xen_internal_xend.h
|
||||
src/xm_internal.c src/xen_internal_inactive.c
|
||||
src/xm_internal.h src/xen_internal_inactive.h
|
||||
src/xs_internal.c src/xen_internal_xenstore.c
|
||||
src/xs_internal.h src/xen_internal_xenstore.h
|
||||
src/xen_unified.c src/xen_internal.c
|
||||
src/xen_unified.h src/xen_internal.h
|
||||
|
||||
# Test driver should really be called test_internal.
|
||||
src/test.c src/test_internal.c
|
||||
src/test.h src/test_internal.h
|
||||
|
||||
# This would be better:
|
||||
src/*_internal*.c src/*_driver*.c
|
||||
src/*_internal*.h src/*_driver*.h
|
||||
|
||||
# Qemud is now the qemud + remote driver.
|
||||
qemud/protocol.x qemud/qemud_protocol.x
|
||||
qemud/* remote/*
|
@ -107,4 +107,3 @@ if test -n "$PKG_CONFIG"; then
|
||||
fi
|
||||
fi[]dnl
|
||||
])])
|
||||
|
||||
|
@ -74,7 +74,11 @@ if [ -x /usr/bin/i686-pc-mingw32-gcc ]; then
|
||||
--without-qemu \
|
||||
--without-lxc \
|
||||
--without-uml \
|
||||
--without-vbox \
|
||||
--without-openvz \
|
||||
--without-one \
|
||||
--without-phyp \
|
||||
--without-netcf \
|
||||
--without-libvirtd
|
||||
|
||||
make
|
||||
|
22
autogen.sh
22
autogen.sh
@ -54,13 +54,21 @@ if test -z "$*"; then
|
||||
echo "to pass any to it, please specify them on the $0 command line."
|
||||
fi
|
||||
|
||||
autopoint --force
|
||||
#rm -rf m4
|
||||
libtoolize --copy --force
|
||||
aclocal -I m4 -I gnulib/m4
|
||||
autoheader
|
||||
automake --add-missing
|
||||
autoconf
|
||||
# Ensure that whenever we pull in a gnulib update or otherwise change to a
|
||||
# different version (i.e., when switching branches), we also rerun ./bootstrap.
|
||||
curr_status=.git-module-status
|
||||
t=$(git submodule status)
|
||||
if test "$t" = "$(cat $curr_status 2>/dev/null)"; then
|
||||
: # good, it's up to date
|
||||
else
|
||||
echo running bootstrap...
|
||||
./bootstrap && echo "$t" > $curr_status
|
||||
fi
|
||||
|
||||
# Automake requires that ChangeLog exist.
|
||||
touch ChangeLog
|
||||
|
||||
autoreconf -if
|
||||
|
||||
cd $THEDIR
|
||||
|
||||
|
60
bootstrap
60
bootstrap
@ -1,11 +1,5 @@
|
||||
#!/bin/sh
|
||||
# Run this after autogen.sh, to pull in all of the gnulib-related bits.
|
||||
# It's important to run *after* autogen.sh, since it updates some of
|
||||
# the same files autogen.sh does, yet those from gnulib are newer,
|
||||
# and match the tests. So if a gnulib bug has been fixed since the
|
||||
# snapshot taken for whatever gettext release you're using, yet you
|
||||
# run "make check" against the wrong version, the corresponding unit
|
||||
# test in gl-tests/ may well fail.
|
||||
# Run this before autogen.sh, to pull in all of the gnulib-related bits.
|
||||
|
||||
usage() {
|
||||
echo >&2 "\
|
||||
@ -40,31 +34,38 @@ do
|
||||
esac
|
||||
done
|
||||
|
||||
cleanup_gnulib() {
|
||||
st=$?
|
||||
rm -fr .gnulib
|
||||
exit $st
|
||||
}
|
||||
# Get gnulib files.
|
||||
|
||||
case ${GNULIB_SRCDIR--} in
|
||||
-)
|
||||
if [ ! -d .gnulib ]; then
|
||||
echo "$0: getting gnulib files..."
|
||||
|
||||
trap cleanup_gnulib 1 2 13 15
|
||||
|
||||
git clone --depth 1 git://git.sv.gnu.org/gnulib .gnulib ||
|
||||
cleanup_gnulib
|
||||
|
||||
trap - 1 2 13 15
|
||||
fi
|
||||
echo "$0: getting gnulib files..."
|
||||
git submodule init || exit $?
|
||||
git submodule update || exit $?
|
||||
GNULIB_SRCDIR=.gnulib
|
||||
;;
|
||||
*)
|
||||
# Redirect the gnulib submodule to the directory on the command line
|
||||
# if possible.
|
||||
if test -d "$GNULIB_SRCDIR"/.git && \
|
||||
git config --file .gitmodules submodule.gnulib.url >/dev/null; then
|
||||
git submodule init
|
||||
GNULIB_SRCDIR=`cd $GNULIB_SRCDIR && pwd`
|
||||
git config --replace-all submodule.gnulib.url $GNULIB_SRCDIR
|
||||
echo "$0: getting gnulib files..."
|
||||
git submodule update || exit $?
|
||||
GNULIB_SRCDIR=.gnulib
|
||||
else
|
||||
echo >&2 "$0: invalid gnulib srcdir: $GNULIB_SRCDIR"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
gnulib_tool=$GNULIB_SRCDIR/gnulib-tool
|
||||
<$gnulib_tool || exit
|
||||
|
||||
modules='
|
||||
base64
|
||||
c-ctype
|
||||
close
|
||||
connect
|
||||
@ -72,8 +73,11 @@ getaddrinfo
|
||||
gethostname
|
||||
getpass
|
||||
gettext
|
||||
gitlog-to-changelog
|
||||
gnumakefile
|
||||
inet_pton
|
||||
ioctl
|
||||
maintainer-makefile
|
||||
mkstemp
|
||||
mktempd
|
||||
perror
|
||||
@ -86,6 +90,7 @@ send
|
||||
setsockopt
|
||||
socket
|
||||
stpcpy
|
||||
strchrnul
|
||||
strndup
|
||||
strerror
|
||||
strsep
|
||||
@ -103,20 +108,9 @@ vc-list-files
|
||||
# put *.[ch] files in new gnulib/lib/ dir.
|
||||
|
||||
$gnulib_tool \
|
||||
--no-vc-files \
|
||||
--lgpl=2 \
|
||||
--with-tests \
|
||||
--m4-base=gnulib/m4 \
|
||||
--source-base=gnulib/lib \
|
||||
--tests-base=gnulib/tests \
|
||||
--import $modules
|
||||
|
||||
rm -f \
|
||||
.gitignore \
|
||||
gnulib/lib/.gitignore \
|
||||
gnulib/m4/.gitignore \
|
||||
gnulib/tests/.gitignore
|
||||
|
||||
(cd gnulib/lib &&
|
||||
(cat .cvsignore; \
|
||||
ls -1 *.in.h|sed 's/\.in\.h/.h/') | sort -u > .t; mv .t .cvsignore)
|
||||
|
@ -1,10 +0,0 @@
|
||||
compile
|
||||
config.guess
|
||||
config.rpath
|
||||
config.sub
|
||||
depcomp
|
||||
install-sh
|
||||
ltmain.sh
|
||||
missing
|
||||
mkinstalldirs
|
||||
mktempd
|
3
build-aux/.gitignore
vendored
3
build-aux/.gitignore
vendored
@ -8,3 +8,6 @@ ltmain.sh
|
||||
missing
|
||||
mkinstalldirs
|
||||
mktempd
|
||||
/useless-if-before-free
|
||||
/vc-list-files
|
||||
/gitlog-to-changelog
|
||||
|
@ -1,180 +0,0 @@
|
||||
#!/usr/bin/perl -T
|
||||
# Detect instances of "if (p) free (p);".
|
||||
# Likewise for "if (p != NULL) free (p);". And with braces.
|
||||
|
||||
my $VERSION = '2008-05-25 17:36'; # UTC
|
||||
# The definition above must lie within the first 8 lines in order
|
||||
# for the Emacs time-stamp write hook (at end) to update it.
|
||||
# If you change this file with Emacs, please let the write hook
|
||||
# do its job. Otherwise, update this string manually.
|
||||
|
||||
# Copyright (C) 2008 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Written by Jim Meyering
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Getopt::Long;
|
||||
|
||||
(my $ME = $0) =~ s|.*/||;
|
||||
|
||||
# use File::Coda; # http://meyering.net/code/Coda/
|
||||
END {
|
||||
defined fileno STDOUT or return;
|
||||
close STDOUT and return;
|
||||
warn "$ME: failed to close standard output: $!\n";
|
||||
$? ||= 1;
|
||||
}
|
||||
|
||||
sub usage ($)
|
||||
{
|
||||
my ($exit_code) = @_;
|
||||
my $STREAM = ($exit_code == 0 ? *STDOUT : *STDERR);
|
||||
if ($exit_code != 0)
|
||||
{
|
||||
print $STREAM "Try `$ME --help' for more information.\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print $STREAM <<EOF;
|
||||
Usage: $ME [OPTIONS] FILE...
|
||||
|
||||
Detect any instance in FILE of a useless "if" test before a free call, e.g.,
|
||||
"if (p) free (p);". Any such test may be safely removed without affecting
|
||||
the semantics of the C code in FILE. Use --name=FOO --name=BAR to also
|
||||
detect free-like functions named FOO and BAR.
|
||||
|
||||
OPTIONS:
|
||||
|
||||
--list print only the name of each matching FILE (\0-terminated)
|
||||
--name=N add name N to the list of `free'-like functions to detect;
|
||||
may be repeated
|
||||
|
||||
--help display this help and exit
|
||||
--version output version information and exit
|
||||
|
||||
Exit status:
|
||||
|
||||
0 one or more matches
|
||||
1 no match
|
||||
2 an error
|
||||
|
||||
EXAMPLE:
|
||||
|
||||
For example, this command prints all removable "if" tests before "free"
|
||||
and "kfree" calls in the linux kernel sources:
|
||||
|
||||
git ls-files -z |xargs -0 $ME --name=kfree
|
||||
|
||||
EOF
|
||||
}
|
||||
exit $exit_code;
|
||||
}
|
||||
|
||||
{
|
||||
sub EXIT_MATCH {0}
|
||||
sub EXIT_NO_MATCH {1}
|
||||
sub EXIT_ERROR {2}
|
||||
my $err = EXIT_NO_MATCH;
|
||||
|
||||
my $list;
|
||||
my @name = qw(free);
|
||||
GetOptions
|
||||
(
|
||||
help => sub { usage 0 },
|
||||
version => sub { print "$ME version $VERSION\n"; exit },
|
||||
list => \$list,
|
||||
'name=s@' => \@name,
|
||||
) or usage 1;
|
||||
|
||||
# Make sure we have the right number of non-option arguments.
|
||||
# Always tell the user why we fail.
|
||||
@ARGV < 1
|
||||
and (warn "$ME: missing FILE argument\n"), usage EXIT_ERROR;
|
||||
|
||||
my $or = join '|', @name;
|
||||
my $regexp = qr/(?:$or)/;
|
||||
|
||||
# Set the input record separator.
|
||||
# Note: this makes it impractical to print line numbers.
|
||||
$/ = '"';
|
||||
|
||||
my $found_match = 0;
|
||||
FILE:
|
||||
foreach my $file (@ARGV)
|
||||
{
|
||||
open FH, '<', $file
|
||||
or (warn "$ME: can't open `$file' for reading: $!\n"),
|
||||
$err = EXIT_ERROR, next;
|
||||
while (defined (my $line = <FH>))
|
||||
{
|
||||
while ($line =~
|
||||
/\b(if\s*\(\s*([^)]+?)(?:\s*!=\s*NULL)?\s*\)
|
||||
(?: \s*$regexp\s*\((?:\s*\([^)]+\))?\s*([^)]+)\)|
|
||||
\s*\{\s*$regexp\s*\((?:\s*\([^)]+\))?\s*([^)]+)\)\s*;\s*\}))/sxg)
|
||||
{
|
||||
# Compare "if" expression and free'd expression,
|
||||
# without regard to white space.
|
||||
(my $e1 = $2) =~ tr/ \t//d;
|
||||
my $e2 = defined $3 ? $3 : $4;
|
||||
$e2 =~ tr/ \t//d;
|
||||
if ($e1 eq $e2)
|
||||
{
|
||||
$found_match = 1;
|
||||
$list
|
||||
and (print "$file\0"), next FILE;
|
||||
print "$file: $1\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
continue
|
||||
{
|
||||
close FH;
|
||||
}
|
||||
|
||||
$found_match && $err == EXIT_NO_MATCH
|
||||
and $err = EXIT_MATCH;
|
||||
|
||||
exit $err;
|
||||
}
|
||||
|
||||
my $foo = <<'EOF';
|
||||
# The above is to *find* them.
|
||||
# This adjusts them, removing the unnecessary "if (p)" part.
|
||||
|
||||
# FIXME: do something like this as an option (doesn't do braces):
|
||||
useless-if-before-free -l $(lid -knone free) | xargs -0 \
|
||||
perl -0x3b -pi -e \
|
||||
's/\bif\s*\(\s*(\S+?)(?:\s*!=\s*NULL)?\s*\)\s+(free\s*\((?:\s*\([^)]+\))?\s*\1\s*\))/$2/s'
|
||||
|
||||
# Or, with git:
|
||||
git ls-files -z |xargs -0 perl -0x3b -pi -e '...'
|
||||
|
||||
Be careful that the result of the above transformation is valid.
|
||||
If the matched string is followed by "else", then obviously, it won't be.
|
||||
|
||||
When modifying files, refuse to process anything other than a regular file.
|
||||
EOF
|
||||
|
||||
## Local Variables:
|
||||
## indent-tabs-mode: nil
|
||||
## eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
## time-stamp-start: "my $VERSION = '"
|
||||
## time-stamp-format: "%:y-%02m-%02d %02H:%02M"
|
||||
## time-stamp-time-zone: "UTC"
|
||||
## time-stamp-end: "'; # UTC"
|
||||
## End:
|
@ -1,107 +0,0 @@
|
||||
#!/bin/sh
|
||||
# List version-controlled file names.
|
||||
|
||||
# Print a version string.
|
||||
scriptversion=2008-07-11.19
|
||||
|
||||
# Copyright (C) 2006-2008 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
# List the specified version-controlled files.
|
||||
# With no argument, list them all. With a single DIRECTORY argument,
|
||||
# list the version-controlled files in that directory.
|
||||
|
||||
# If there's an argument, it must be a single, "."-relative directory name.
|
||||
# cvsu is part of the cvsutils package: http://www.red-bean.com/cvsutils/
|
||||
|
||||
postprocess=
|
||||
case $1 in
|
||||
--help) cat <<EOF
|
||||
Usage: $0 [-C SRCDIR] [DIR]
|
||||
|
||||
Output a list of version-controlled files in DIR (default .), relative to
|
||||
SRCDIR (default .). SRCDIR must be the top directory of a checkout.
|
||||
|
||||
Options:
|
||||
--help print this help, then exit
|
||||
--version print version number, then exit
|
||||
-C SRCDIR change directory to SRCDIR before generating list
|
||||
|
||||
Report bugs and patches to <bug-gnulib@gnu.org>.
|
||||
EOF
|
||||
exit ;;
|
||||
|
||||
--version)
|
||||
year=`echo "$scriptversion" | sed 's/[^0-9].*//'`
|
||||
cat <<EOF
|
||||
vc-list-files $scriptversion
|
||||
Copyright (C) $year Free Software Foundation, Inc,
|
||||
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
|
||||
This is free software: you are free to change and redistribute it.
|
||||
There is NO WARRANTY, to the extent permitted by law.
|
||||
EOF
|
||||
exit ;;
|
||||
|
||||
-C)
|
||||
test "$2" = . || postprocess="| sed 's|^|$2/|'"
|
||||
cd "$2" || exit 1
|
||||
shift; shift ;;
|
||||
esac
|
||||
|
||||
dir=
|
||||
case $# in
|
||||
0) ;;
|
||||
1) dir=$1 ;;
|
||||
*) echo "$0: too many arguments" 1>&2
|
||||
echo "Usage: $0 [-C srcdir] [DIR]" 1>&2; exit 1;;
|
||||
esac
|
||||
|
||||
test "x$dir" = x && dir=.
|
||||
|
||||
if test -d .git; then
|
||||
eval exec git ls-files '"$dir"' $postprocess
|
||||
elif test -d .hg; then
|
||||
eval exec hg locate '"$dir/*"' $postprocess
|
||||
elif test -d .bzr; then
|
||||
test "$postprocess" = '' && postprocess="| sed 's|^\./||'"
|
||||
eval exec bzr ls --versioned '"$dir"' $postprocess
|
||||
elif test -d CVS; then
|
||||
test "$postprocess" = '' && postprocess="| sed 's|^\./||'"
|
||||
if test -x build-aux/cvsu; then
|
||||
eval build-aux/cvsu --find --types=AFGM '"$dir"' $postprocess
|
||||
elif (cvsu --help) >/dev/null 2>&1; then
|
||||
eval cvsu --find --types=AFGM '"$dir"' $postprocess
|
||||
else
|
||||
eval awk -F/ \''{ \
|
||||
if (!$1 && $3 !~ /^-/) { \
|
||||
f=FILENAME; \
|
||||
if (f ~ /CVS\/Entries$/) \
|
||||
f = substr(f, 0, length(f)-11); \
|
||||
print f $2; \
|
||||
}}'\'' \
|
||||
`find "$dir" -name Entries -print` /dev/null' $postprocess
|
||||
fi
|
||||
else
|
||||
echo "$0: Failed to determine type of version control used in `pwd`" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-end: "$"
|
||||
# End:
|
264
cfg.mk
Normal file
264
cfg.mk
Normal file
@ -0,0 +1,264 @@
|
||||
# Customize Makefile.maint. -*- makefile -*-
|
||||
# Copyright (C) 2003-2009 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Use alpha.gnu.org for alpha and beta releases.
|
||||
# Use ftp.gnu.org for major releases.
|
||||
gnu_ftp_host-alpha = alpha.gnu.org
|
||||
gnu_ftp_host-beta = alpha.gnu.org
|
||||
gnu_ftp_host-major = ftp.gnu.org
|
||||
gnu_rel_host = $(gnu_ftp_host-$(RELEASE_TYPE))
|
||||
|
||||
url_dir_list = \
|
||||
ftp://$(gnu_rel_host)/gnu/coreutils
|
||||
|
||||
# Tests not to run as part of "make distcheck".
|
||||
local-checks-to-skip = \
|
||||
changelog-check \
|
||||
check-AUTHORS \
|
||||
makefile-check \
|
||||
makefile_path_separator_check \
|
||||
patch-check \
|
||||
sc_GPL_version \
|
||||
sc_always_defined_macros \
|
||||
sc_cast_of_alloca_return_value \
|
||||
sc_dd_max_sym_length \
|
||||
sc_error_exit_success \
|
||||
sc_file_system \
|
||||
sc_immutable_NEWS \
|
||||
sc_makefile_path_separator_check \
|
||||
sc_obsolete_symbols \
|
||||
sc_prohibit_S_IS_definition \
|
||||
sc_prohibit_atoi_atof \
|
||||
sc_prohibit_jm_in_m4 \
|
||||
sc_prohibit_quote_without_use \
|
||||
sc_prohibit_quotearg_without_use \
|
||||
sc_prohibit_stat_st_blocks \
|
||||
sc_root_tests \
|
||||
sc_space_tab \
|
||||
sc_sun_os_names \
|
||||
sc_system_h_headers \
|
||||
sc_tight_scope \
|
||||
sc_two_space_separator_in_usage \
|
||||
sc_error_message_uppercase \
|
||||
sc_program_name \
|
||||
sc_require_test_exit_idiom \
|
||||
sc_makefile_check \
|
||||
sc_useless_cpp_parens
|
||||
|
||||
useless_free_options = \
|
||||
--name=sexpr_free \
|
||||
--name=VIR_FREE \
|
||||
--name=xmlFree \
|
||||
--name=xmlXPathFreeContext \
|
||||
--name=xmlXPathFreeObject
|
||||
|
||||
# Avoid uses of write(2). Either switch to streams (fwrite), or use
|
||||
# the safewrite wrapper.
|
||||
sc_avoid_write:
|
||||
@if $(VC_LIST_EXCEPT) | grep '\.c$$' > /dev/null; then \
|
||||
grep '\<write *(' $$($(VC_LIST_EXCEPT) | grep '\.c$$') && \
|
||||
{ echo "$(ME): the above files use write;" \
|
||||
" consider using the safewrite wrapper instead" \
|
||||
1>&2; exit 1; } || :; \
|
||||
else :; \
|
||||
fi
|
||||
|
||||
# Use STREQ rather than comparing strcmp == 0, or != 0.
|
||||
# Similarly, use STREQLEN or STRPREFIX rather than strncmp.
|
||||
sc_prohibit_strcmp_and_strncmp:
|
||||
@grep -nE '! *strn?cmp *\(|\<strn?cmp *\([^)]+\) *==' \
|
||||
$$($(VC_LIST_EXCEPT)) \
|
||||
| grep -vE ':# *define STREQ(LEN)?\(' && \
|
||||
{ echo '$(ME): use STREQ(LEN) in place of the above uses of strcmp(strncmp)' \
|
||||
1>&2; exit 1; } || :
|
||||
|
||||
# Use virAsprintf rather than a'sprintf since *strp is undefined on error.
|
||||
sc_prohibit_asprintf:
|
||||
@re='\<[a]sprintf\>' \
|
||||
msg='use virAsprintf, not a'sprintf \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
sc_prohibit_strncpy:
|
||||
@re='strncpy *\(' \
|
||||
msg='use virStrncpy, not strncpy' \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
sc_prohibit_VIR_ERR_NO_MEMORY:
|
||||
@re='\<V''IR_ERR_NO_MEMORY\>' \
|
||||
msg='use virReportOOMError, not V'IR_ERR_NO_MEMORY \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
include $(srcdir)/Makefile.nonreentrant
|
||||
sc_prohibit_nonreentrant:
|
||||
@fail=0 ; \
|
||||
for i in $(NON_REENTRANT) ; \
|
||||
do \
|
||||
grep --before 2 --after 1 -nE "\<$$i\>[:space:]*\(" $$($(VC_LIST_EXCEPT)) && \
|
||||
fail=1 && echo "$(ME): use $${i}_r, not $${i}" || : ; \
|
||||
done ; \
|
||||
exit $$fail
|
||||
|
||||
# Prohibit the inclusion of <ctype.h>.
|
||||
sc_prohibit_ctype_h:
|
||||
@grep -E '^# *include *<ctype\.h>' $$($(VC_LIST_EXCEPT)) && \
|
||||
{ echo "$(ME): don't use ctype.h; instead, use c-ctype.h" \
|
||||
1>&2; exit 1; } || :
|
||||
|
||||
# Ensure that no C source file uses TABs for indentation.
|
||||
# Also match *.h.in files, to get libvirt.h.in.
|
||||
# Exclude files in gnulib, since they're imported.
|
||||
sc_TAB_in_indentation:
|
||||
@grep -lE '^ * ' /dev/null \
|
||||
$$($(VC_LIST_EXCEPT) \
|
||||
| grep -E '\.[ch](\.in)?$$' \
|
||||
| grep -v '^gnulib/') && \
|
||||
{ echo '$(ME): found TAB(s) used for indentation in C sources;'\
|
||||
'use spaces' 1>&2; exit 1; } || :
|
||||
|
||||
ctype_re = isalnum|isalpha|isascii|isblank|iscntrl|isdigit|isgraph|islower\
|
||||
|isprint|ispunct|isspace|isupper|isxdigit|tolower|toupper
|
||||
|
||||
sc_avoid_ctype_macros:
|
||||
@grep -E '\b($(ctype_re)) *\(' /dev/null \
|
||||
$$($(VC_LIST_EXCEPT)) && \
|
||||
{ echo "$(ME): don't use ctype macros (use c-ctype.h)" \
|
||||
1>&2; exit 1; } || :
|
||||
|
||||
sc_prohibit_virBufferAdd_with_string_literal:
|
||||
@re='\<virBufferAdd *\([^,]+, *"[^"]' \
|
||||
msg='use virBufferAddLit, not virBufferAdd, with a string literal' \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
# Not only do they fail to deal well with ipv6, but the gethostby*
|
||||
# functions are also not thread-safe.
|
||||
sc_prohibit_gethostby:
|
||||
@re='\<gethostby(addr|name2?) *\(' \
|
||||
msg='use getaddrinfo, not gethostby*' \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
# Many of the function names below came from this filter:
|
||||
# git grep -B2 '\<_('|grep -E '\.c- *[[:alpha:]_][[:alnum:]_]* ?\(.*[,;]$' \
|
||||
# |sed 's/.*\.c- *//'|perl -pe 's/ ?\(.*//'|sort -u \
|
||||
# |grep -vE '^(qsort|if|close|assert|fputc|free|N_|vir.*GetName|.*Unlock|virNodeListDevices|virHashRemoveEntry|freeaddrinfo|.*[fF]ree|xdrmem_create|xmlXPathFreeObject|virUUIDFormat|openvzSetProgramSentinal|polkit_action_unref)$'
|
||||
|
||||
msg_gen_function =
|
||||
msg_gen_function += DEBUG0
|
||||
msg_gen_function += DISABLE_fprintf
|
||||
msg_gen_function += ERROR
|
||||
msg_gen_function += ERROR0
|
||||
msg_gen_function += REMOTE_DEBUG
|
||||
msg_gen_function += ReportError
|
||||
msg_gen_function += VIR_FREE
|
||||
msg_gen_function += VIR_INFO
|
||||
msg_gen_function += VIR_USE_CPU
|
||||
msg_gen_function += errorf
|
||||
msg_gen_function += lxcError
|
||||
msg_gen_function += networkLog
|
||||
msg_gen_function += networkReportError
|
||||
msg_gen_function += oneError
|
||||
msg_gen_function += openvzError
|
||||
msg_gen_function += openvzLog
|
||||
msg_gen_function += qemudDispatchClientFailure
|
||||
msg_gen_function += qemudLog
|
||||
msg_gen_function += qemudReportError
|
||||
msg_gen_function += regerror
|
||||
msg_gen_function += remoteDispatchFormatError
|
||||
msg_gen_function += umlLog
|
||||
msg_gen_function += umlReportError
|
||||
msg_gen_function += virConfError
|
||||
msg_gen_function += virDomainReportError
|
||||
msg_gen_function += virSecurityReportError
|
||||
msg_gen_function += virHashError
|
||||
msg_gen_function += virLibConnError
|
||||
msg_gen_function += virLibDomainError
|
||||
msg_gen_function += virLog
|
||||
msg_gen_function += virNetworkReportError
|
||||
msg_gen_function += virNodeDeviceReportError
|
||||
msg_gen_function += virProxyError
|
||||
msg_gen_function += virRaiseError
|
||||
msg_gen_function += virReportErrorHelper
|
||||
msg_gen_function += virReportSystemError
|
||||
msg_gen_function += virSexprError
|
||||
msg_gen_function += virStorageLog
|
||||
msg_gen_function += virStorageReportError
|
||||
msg_gen_function += virXMLError
|
||||
msg_gen_function += virXenInotifyError
|
||||
msg_gen_function += virXenStoreError
|
||||
msg_gen_function += virXendError
|
||||
msg_gen_function += vshCloseLogFile
|
||||
msg_gen_function += xenUnifiedError
|
||||
msg_gen_function += xenXMError
|
||||
|
||||
# Uncomment the following and run "make syntax-check" to see diagnostics
|
||||
# that are not yet marked for translation, but that need to be rewritten
|
||||
# so that they are translatable.
|
||||
# msg_gen_function += error
|
||||
# msg_gen_function += fprintf
|
||||
# msg_gen_function += testError
|
||||
# msg_gen_function += virXenError
|
||||
# msg_gen_function += vshPrint
|
||||
# msg_gen_function += vshError
|
||||
|
||||
func_or := $(shell printf '$(msg_gen_function)'|tr -s '[[:space:]]' '|')
|
||||
func_re := ($(func_or))
|
||||
|
||||
# Look for diagnostics that aren't marked for translation.
|
||||
# This won't find any for which error's format string is on a separate line.
|
||||
# The sed filters eliminate false-positives like these:
|
||||
# _("...: "
|
||||
# "%s", _("no storage vol w..."
|
||||
sc_libvirt_unmarked_diagnostics:
|
||||
@grep -nE \
|
||||
'\<$(func_re) \([^"]*"[^"]*[a-z]{3}' $$($(VC_LIST_EXCEPT)) \
|
||||
| grep -v '_''(' && \
|
||||
{ echo '$(ME): found unmarked diagnostic(s)' 1>&2; \
|
||||
exit 1; } || :
|
||||
@{ grep -nE '\<$(func_re) *\(.*;$$' $$($(VC_LIST_EXCEPT)); \
|
||||
grep -A1 -nE '\<$(func_re) *\(.*,$$' $$($(VC_LIST_EXCEPT)); } \
|
||||
| sed 's/_("[^"][^"]*"//;s/[ ]"%s"//' \
|
||||
| grep '[ ]"' && \
|
||||
{ echo '$(ME): found unmarked diagnostic(s)' 1>&2; \
|
||||
exit 1; } || :
|
||||
|
||||
# Disallow trailing blank lines.
|
||||
sc_prohibit_trailing_blank_lines:
|
||||
@$(VC_LIST_EXCEPT) | xargs perl -ln -0777 -e \
|
||||
'/\n\n+$$/ and print $$ARGV' > $@-t
|
||||
@found=0; test -s $@-t && { found=1; cat $@-t 1>&2; \
|
||||
echo '$(ME): found trailing blank line(s)' 1>&2; }; \
|
||||
rm -f $@-t; \
|
||||
test $$found = 0
|
||||
|
||||
# We don't use this feature of maint.mk.
|
||||
prev_version_file = /dev/null
|
||||
|
||||
ifeq (0,$(MAKELEVEL))
|
||||
_curr_status = .git-module-status
|
||||
# The sed filter accommodates those who check out on a commit from which
|
||||
# no tag is reachable. In that case, git submodule status prints a "-"
|
||||
# in column 1 and does not print a "git describe"-style string after the
|
||||
# submodule name. Contrast these:
|
||||
# -b653eda3ac4864de205419d9f41eec267cb89eeb .gnulib
|
||||
# b653eda3ac4864de205419d9f41eec267cb89eeb .gnulib (v0.0-2286-gb653eda)
|
||||
_submodule_hash = sed 's/.//;s/ .*//'
|
||||
_update_required := $(shell \
|
||||
actual=$$(git submodule status | $(_submodule_hash)); \
|
||||
stamp="$$($(_submodule_hash) $(_curr_status) 2>/dev/null)"; \
|
||||
test "$$stamp" = "$$actual"; echo $$?)
|
||||
ifeq (1,$(_update_required))
|
||||
$(error gnulib update required; run ./autogen.sh first)
|
||||
endif
|
||||
endif
|
609
configure.in
609
configure.in
@ -1,11 +1,16 @@
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_INIT([libvirt], [0.6.2])
|
||||
AC_INIT([libvirt], [0.7.2])
|
||||
AC_CONFIG_SRCDIR([src/libvirt.c])
|
||||
AC_CONFIG_AUX_DIR([build-aux])
|
||||
AM_CONFIG_HEADER([config.h])
|
||||
dnl Make automake keep quiet about wildcards & other GNUmake-isms
|
||||
AM_INIT_AUTOMAKE([-Wno-portability])
|
||||
|
||||
# Use the silent-rules feature when possible.
|
||||
m4_ifndef([AM_SILENT_RULES], [m4_define([AM_SILENT_RULES],[])])
|
||||
AM_SILENT_RULES([yes])
|
||||
|
||||
AC_CANONICAL_HOST
|
||||
|
||||
LIBVIRT_MAJOR_VERSION=`echo $VERSION | awk -F. '{print $1}'`
|
||||
@ -28,6 +33,7 @@ GNUTLS_REQUIRED="1.0.25"
|
||||
AVAHI_REQUIRED="0.6.0"
|
||||
POLKIT_REQUIRED="0.6"
|
||||
PARTED_REQUIRED="1.8.0"
|
||||
NETCF_REQUIRED="0.0.1"
|
||||
|
||||
dnl Checks for C compiler.
|
||||
AC_PROG_CC
|
||||
@ -57,7 +63,6 @@ dnl Support building Win32 DLLs (must appear *before* AM_PROG_LIBTOOL)
|
||||
AC_LIBTOOL_WIN32_DLL
|
||||
|
||||
AM_PROG_LIBTOOL
|
||||
|
||||
AM_PROG_CC_C_O
|
||||
|
||||
VERSION_SCRIPT_FLAGS=-Wl,--version-script=
|
||||
@ -78,7 +83,7 @@ dnl Availability of various not common threadsafe functions
|
||||
AC_CHECK_FUNCS([strerror_r strtok_r getmntent_r getgrnam_r getpwuid_r])
|
||||
|
||||
dnl Availability of various common headers (non-fatal if missing).
|
||||
AC_CHECK_HEADERS([pwd.h paths.h regex.h sys/syslimits.h sys/utsname.h sys/wait.h winsock2.h sched.h termios.h sys/poll.h syslog.h])
|
||||
AC_CHECK_HEADERS([pwd.h paths.h regex.h sys/syslimits.h sys/utsname.h sys/wait.h winsock2.h sched.h termios.h sys/poll.h syslog.h mntent.h])
|
||||
|
||||
dnl Where are the XDR functions?
|
||||
dnl If portablexdr is installed, prefer that.
|
||||
@ -175,15 +180,25 @@ dnl Allow to build without Xen, QEMU/KVM, test or remote driver
|
||||
AC_ARG_WITH([xen],
|
||||
[ --with-xen add XEN support (on)],[],[with_xen=yes])
|
||||
AC_ARG_WITH([xen-inotify],
|
||||
[ --with-xen-inotify add XEN inotify support (on)],[],[with_xen_inotify=yes])
|
||||
[ --with-xen-inotify add XEN inotify support (on)],[],[with_xen_inotify=check])
|
||||
AC_ARG_WITH([qemu],
|
||||
[ --with-qemu add QEMU/KVM support (on)],[],[with_qemu=yes])
|
||||
AC_ARG_WITH([uml],
|
||||
[ --with-uml add UML support (on)],[],[with_uml=yes])
|
||||
[ --with-uml add UML support (on)],[],[with_uml=check])
|
||||
AC_ARG_WITH([openvz],
|
||||
[ --with-openvz add OpenVZ support (on)],[],[with_openvz=yes])
|
||||
AC_ARG_WITH([libssh2],
|
||||
[ --with-libssh2=[PFX] libssh2 location],[],[with_libssh2=yes])
|
||||
AC_ARG_WITH([phyp],
|
||||
[ --with-phyp=[PFX] add PHYP support (on)],[],[with_phyp=check])
|
||||
AC_ARG_WITH([vbox],
|
||||
[ --with-vbox add VirtualBox support (on)],[],[with_vbox=yes])
|
||||
AC_ARG_WITH([lxc],
|
||||
[ --with-lxc add Linux Container support (on)],[],[with_lxc=yes])
|
||||
[ --with-lxc add Linux Container support (on)],[],[with_lxc=check])
|
||||
AC_ARG_WITH([one],
|
||||
[ --with-one add ONE support (on)],[],[with_one=check])
|
||||
AC_ARG_WITH([esx],
|
||||
[ --with-esx add ESX support (on)],[],[with_esx=check])
|
||||
AC_ARG_WITH([test],
|
||||
[ --with-test add test driver support (on)],[],[with_test=yes])
|
||||
AC_ARG_WITH([remote],
|
||||
@ -277,13 +292,10 @@ if test "$with_openvz" = "yes"; then
|
||||
fi
|
||||
AM_CONDITIONAL([WITH_OPENVZ], [test "$with_openvz" = "yes"])
|
||||
|
||||
if test "$with_libvirtd" = "no" ; then
|
||||
with_lxc=no
|
||||
if test "x$with_vbox" = "xyes"; then
|
||||
AC_DEFINE_UNQUOTED([WITH_VBOX], 1, [whether VirtualBox driver is enabled])
|
||||
fi
|
||||
if test "$with_lxc" = "yes" ; then
|
||||
AC_DEFINE_UNQUOTED([WITH_LXC], 1, [whether LXC driver is enabled])
|
||||
fi
|
||||
AM_CONDITIONAL([WITH_LXC], [test "$with_lxc" = "yes"])
|
||||
AM_CONDITIONAL([WITH_VBOX], [test "$with_vbox" = "yes"])
|
||||
|
||||
if test "$with_libvirtd" = "no" ; then
|
||||
with_qemu=no
|
||||
@ -293,10 +305,10 @@ if test "$with_qemu" = "yes" ; then
|
||||
fi
|
||||
AM_CONDITIONAL([WITH_QEMU], [test "$with_qemu" = "yes"])
|
||||
|
||||
if test "$with_uml" = "yes" ; then
|
||||
AC_DEFINE_UNQUOTED([WITH_UML], 1, [whether UML driver is enabled])
|
||||
if test "$with_one" = "yes" ; then
|
||||
AC_DEFINE_UNQUOTED([WITH_ONE],1,[whether ONE driver is enabled])
|
||||
fi
|
||||
AM_CONDITIONAL([WITH_UML], [test "$with_uml" = "yes"])
|
||||
AM_CONDITIONAL([WITH_ONE],[test "$with_one" = "yes"])
|
||||
|
||||
if test "$with_test" = "yes" ; then
|
||||
AC_DEFINE_UNQUOTED([WITH_TEST], 1, [whether Test driver is enabled])
|
||||
@ -379,13 +391,69 @@ if test "$with_xen" != "yes"; then
|
||||
with_xen_inotify=no
|
||||
fi
|
||||
if test "$with_xen_inotify" != "no"; then
|
||||
AC_CHECK_HEADER([linux/inotify.h],[],[with_xen_inotify=no])
|
||||
AC_CHECK_HEADER([sys/inotify.h], [
|
||||
with_xen_inotify=yes
|
||||
], [
|
||||
if test "$with_xen_inotify" = "check"; then
|
||||
with_xen_inotify=no
|
||||
AC_MSG_NOTICE([Header file <sys/inotify.h> is required for Xen Inotify support, disabling it])
|
||||
else
|
||||
AC_MSG_ERROR([Header file <sys/inotify.h> is required for Xen Inotify support!])
|
||||
fi
|
||||
0])
|
||||
fi
|
||||
if test "$with_xen_inotify" = "yes"; then
|
||||
AC_DEFINE_UNQUOTED([WITH_XEN_INOTIFY], 1,[whether Xen inotify sub-driver is enabled])
|
||||
fi
|
||||
AM_CONDITIONAL([WITH_XEN_INOTIFY], [test "$with_xen_inotify" = "yes"])
|
||||
|
||||
dnl
|
||||
dnl check for kvm headers
|
||||
dnl
|
||||
AC_CHECK_HEADERS([linux/kvm.h])
|
||||
|
||||
dnl
|
||||
dnl check for sufficient headers for LXC
|
||||
dnl
|
||||
if test "$with_lxc" = "yes" -o "$with_lxc" = "check"; then
|
||||
AC_CHECK_HEADER([sched.h],
|
||||
dnl Header is there, check for unshare()
|
||||
[
|
||||
AC_TRY_LINK([#define _GNU_SOURCE
|
||||
#include <sched.h>], [
|
||||
unshare (1);
|
||||
], [
|
||||
with_lxc=yes
|
||||
], [
|
||||
if test "$with_lxc" = "check"; then
|
||||
with_lxc=no
|
||||
AC_MSG_NOTICE([Function unshare() not present in <sched.h> header but required for LXC driver, disabling it])
|
||||
else
|
||||
AC_MSG_ERROR([Function unshare() not present in <sched.h> header, but required for LXC driver])
|
||||
fi
|
||||
|
||||
])
|
||||
|
||||
dnl Header is not there
|
||||
],[
|
||||
if test "$with_lxc" = "check"; then
|
||||
with_lxc=no
|
||||
AC_MSG_NOTICE([Header <sched.h> not found but required for LXC driver, disabling it])
|
||||
else
|
||||
AC_MSG_ERROR([Header <sched.h> not found but required for LXC driver])
|
||||
fi
|
||||
|
||||
])
|
||||
fi
|
||||
if test "$with_libvirtd" = "no" ; then
|
||||
with_lxc=no
|
||||
fi
|
||||
if test "$with_lxc" = "yes" ; then
|
||||
AC_DEFINE_UNQUOTED([WITH_LXC], 1, [whether LXC driver is enabled])
|
||||
fi
|
||||
AM_CONDITIONAL([WITH_LXC], [test "$with_lxc" = "yes"])
|
||||
|
||||
|
||||
dnl
|
||||
dnl check for kernel headers required by src/bridge.c
|
||||
dnl
|
||||
@ -394,14 +462,38 @@ if test "$with_qemu" = "yes" -o "$with_lxc" = "yes" ; then
|
||||
AC_MSG_ERROR([You must install kernel-headers in order to compile libvirt]))
|
||||
fi
|
||||
|
||||
dnl
|
||||
dnl check for kvm headers
|
||||
dnl
|
||||
AC_CHECK_HEADERS([linux/kvm.h])
|
||||
|
||||
dnl Need to test if pkg-config exists
|
||||
PKG_PROG_PKG_CONFIG
|
||||
|
||||
dnl OpenNebula driver Compilation setting
|
||||
dnl
|
||||
|
||||
XMLRPC_REQUIRED=1.14.0
|
||||
|
||||
XMLRPC_CFLAGS=
|
||||
XMLRPC_LIBS=
|
||||
if test "x$with_one" = "xyes" -o "x$with_one" = "xcheck"; then
|
||||
PKG_CHECK_MODULES(XMLRPC, xmlrpc_client >= $XMLRPC_REQUIRED,
|
||||
[with_one=yes], [
|
||||
if test "x$with_one" = "xcheck" ; then
|
||||
with_one=no
|
||||
else
|
||||
AC_MSG_ERROR(
|
||||
[You must install XMLRPC-C >= $XMLRPC_REQUIRED to compile libvirt ONE driver])
|
||||
fi
|
||||
])
|
||||
if test "x$with_one" = "xyes" ; then
|
||||
AC_DEFINE_UNQUOTED([HAVE_XMLRPC], 1,
|
||||
[whether One is used to broadcast server presence])
|
||||
fi
|
||||
fi
|
||||
AM_CONDITIONAL([HAVE_XMLRPC], [test "x$with_one" = "xyes"])
|
||||
AM_CONDITIONAL([WITH_ONE], [test "x$with_one" = "xyes"])
|
||||
AC_SUBST([XMLRPC_CFLAGS])
|
||||
AC_SUBST([XMLRPC_LIBS])
|
||||
|
||||
|
||||
dnl ==========================================================================
|
||||
dnl find libxml2 library, borrowed from xmlsec
|
||||
dnl ==========================================================================
|
||||
@ -549,40 +641,61 @@ AC_SUBST([SASL_LIBS])
|
||||
dnl PolicyKit library
|
||||
POLKIT_CFLAGS=
|
||||
POLKIT_LIBS=
|
||||
PKCHECK_PATH=
|
||||
AC_ARG_WITH([polkit],
|
||||
[ --with-polkit use PolicyKit for UNIX socket access checks],
|
||||
[],
|
||||
[with_polkit=check])
|
||||
|
||||
with_polkit0=no
|
||||
with_polkit1=no
|
||||
if test "x$with_polkit" = "xyes" -o "x$with_polkit" = "xcheck"; then
|
||||
PKG_CHECK_MODULES(POLKIT, polkit-dbus >= $POLKIT_REQUIRED,
|
||||
[with_polkit=yes], [
|
||||
if test "x$with_polkit" = "xcheck" ; then
|
||||
with_polkit=no
|
||||
else
|
||||
AC_MSG_ERROR(
|
||||
[You must install PolicyKit >= $POLKIT_REQUIRED to compile libvirt])
|
||||
fi
|
||||
])
|
||||
if test "x$with_polkit" = "xyes" ; then
|
||||
dnl Check for new polkit first - just a binary
|
||||
AC_PATH_PROG([PKCHECK_PATH],[pkcheck], [], [/usr/sbin:$PATH])
|
||||
if test "x$PKCHECK_PATH" != "x" ; then
|
||||
AC_DEFINE_UNQUOTED([PKCHECK_PATH],["$PKCHECK_PATH"],[Location of pkcheck program])
|
||||
AC_DEFINE_UNQUOTED([HAVE_POLKIT], 1,
|
||||
[use PolicyKit for UNIX socket access checks])
|
||||
[use PolicyKit for UNIX socket access checks])
|
||||
AC_DEFINE_UNQUOTED([HAVE_POLKIT1], 1,
|
||||
[use PolicyKit for UNIX socket access checks])
|
||||
with_polkit="yes"
|
||||
with_polkit1="yes"
|
||||
else
|
||||
dnl Check for old polkit second - library + binary
|
||||
PKG_CHECK_MODULES(POLKIT, polkit-dbus >= $POLKIT_REQUIRED,
|
||||
[with_polkit=yes], [
|
||||
if test "x$with_polkit" = "xcheck" ; then
|
||||
with_polkit=no
|
||||
else
|
||||
AC_MSG_ERROR(
|
||||
[You must install PolicyKit >= $POLKIT_REQUIRED to compile libvirt])
|
||||
fi
|
||||
])
|
||||
if test "x$with_polkit" = "xyes" ; then
|
||||
AC_DEFINE_UNQUOTED([HAVE_POLKIT], 1,
|
||||
[use PolicyKit for UNIX socket access checks])
|
||||
AC_DEFINE_UNQUOTED([HAVE_POLKIT0], 1,
|
||||
[use PolicyKit for UNIX socket access checks])
|
||||
|
||||
old_CFLAGS=$CFLAGS
|
||||
old_LDFLAGS=$LDFLAGS
|
||||
CFLAGS="$CFLAGS $POLKIT_CFLAGS"
|
||||
LDFLAGS="$LDFLAGS $POLKIT_LIBS"
|
||||
AC_CHECK_FUNCS([polkit_context_is_caller_authorized])
|
||||
CFLAGS="$old_CFLAGS"
|
||||
LDFLAGS="$old_LDFLAGS"
|
||||
old_CFLAGS=$CFLAGS
|
||||
old_LDFLAGS=$LDFLAGS
|
||||
CFLAGS="$CFLAGS $POLKIT_CFLAGS"
|
||||
LDFLAGS="$LDFLAGS $POLKIT_LIBS"
|
||||
AC_CHECK_FUNCS([polkit_context_is_caller_authorized])
|
||||
CFLAGS="$old_CFLAGS"
|
||||
LDFLAGS="$old_LDFLAGS"
|
||||
|
||||
AC_PATH_PROG([POLKIT_AUTH], [polkit-auth])
|
||||
if test "x$POLKIT_AUTH" != "x"; then
|
||||
AC_DEFINE_UNQUOTED([POLKIT_AUTH],["$POLKIT_AUTH"],[Location of polkit-auth program])
|
||||
AC_PATH_PROG([POLKIT_AUTH], [polkit-auth])
|
||||
if test "x$POLKIT_AUTH" != "x"; then
|
||||
AC_DEFINE_UNQUOTED([POLKIT_AUTH],["$POLKIT_AUTH"],[Location of polkit-auth program])
|
||||
fi
|
||||
with_polkit0="yes"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
AM_CONDITIONAL([HAVE_POLKIT], [test "x$with_polkit" = "xyes"])
|
||||
AM_CONDITIONAL([HAVE_POLKIT0], [test "x$with_polkit0" = "xyes"])
|
||||
AM_CONDITIONAL([HAVE_POLKIT1], [test "x$with_polkit1" = "xyes"])
|
||||
AC_SUBST([POLKIT_CFLAGS])
|
||||
AC_SUBST([POLKIT_LIBS])
|
||||
|
||||
@ -686,6 +799,83 @@ fi
|
||||
AM_CONDITIONAL([WITH_SECDRIVER_SELINUX], [test "$with_secdriver_selinux" != "no"])
|
||||
|
||||
|
||||
dnl AppArmor
|
||||
AC_ARG_WITH([apparmor],
|
||||
[ --with-apparmor use AppArmor to manage security],
|
||||
[],
|
||||
[with_apparmor=check])
|
||||
|
||||
APPARMOR_CFLAGS=
|
||||
APPARMOR_LIBS=
|
||||
if test "$with_apparmor" != "no"; then
|
||||
old_cflags="$CFLAGS"
|
||||
old_libs="$LIBS"
|
||||
if test "$with_apparmor" = "check"; then
|
||||
AC_CHECK_HEADER([sys/apparmor.h],[],[with_apparmor=no])
|
||||
AC_CHECK_LIB([apparmor], [aa_change_profile],[],[with_apparmor=no])
|
||||
AC_CHECK_LIB([apparmor], [aa_change_hat],[],[with_apparmor=no])
|
||||
if test "$with_apparmor" != "no"; then
|
||||
with_apparmor="yes"
|
||||
fi
|
||||
else
|
||||
fail=0
|
||||
AC_CHECK_HEADER([sys/apparmor.h],[],[fail=1])
|
||||
AC_CHECK_LIB([apparmor], [aa_change_profile],[],[fail=1])
|
||||
AC_CHECK_LIB([apparmor], [aa_change_hat],[],[fail=1])
|
||||
test $fail = 1 &&
|
||||
AC_MSG_ERROR([You must install the AppArmor development package in order to compile libvirt])
|
||||
fi
|
||||
CFLAGS="$old_cflags"
|
||||
LIBS="$old_libs"
|
||||
fi
|
||||
if test "$with_apparmor" = "yes"; then
|
||||
APPARMOR_LIBS="-lapparmor"
|
||||
AC_DEFINE_UNQUOTED([HAVE_APPARMOR], 1, [whether AppArmor is available for security])
|
||||
AC_DEFINE_UNQUOTED([APPARMOR_DIR], "/etc/apparmor.d", [path to apparmor directory])
|
||||
AC_DEFINE_UNQUOTED([APPARMOR_PROFILES_PATH], "/sys/kernel/security/apparmor/profiles", [path to kernel profiles])
|
||||
fi
|
||||
AM_CONDITIONAL([HAVE_APPARMOR], [test "$with_apparmor" != "no"])
|
||||
AC_SUBST([APPARMOR_CFLAGS])
|
||||
AC_SUBST([APPARMOR_LIBS])
|
||||
|
||||
|
||||
AC_ARG_WITH([secdriver-apparmor],
|
||||
[ --with-secdriver-apparmor use AppArmor security driver],
|
||||
[],
|
||||
[with_secdriver_apparmor=check])
|
||||
|
||||
if test "$with_apparmor" != "yes" ; then
|
||||
if test "$with_secdriver_apparmor" = "check" ; then
|
||||
with_secdriver_apparmor=no
|
||||
else
|
||||
AC_MSG_ERROR([You must install the AppArmor development package in order to compile libvirt])
|
||||
fi
|
||||
else
|
||||
old_cflags="$CFLAGS"
|
||||
old_libs="$LIBS"
|
||||
CFLAGS="$CFLAGS $APPARMOR_CFLAGS"
|
||||
LIBS="$CFLAGS $APPARMOR_LIBS"
|
||||
|
||||
fail=0
|
||||
AC_CHECK_FUNC([change_hat], [], [fail=1])
|
||||
AC_CHECK_FUNC([aa_change_profile], [], [fail=1])
|
||||
CFLAGS="$old_cflags"
|
||||
LIBS="$old_libs"
|
||||
|
||||
if test "$fail" = "1" ; then
|
||||
if test "$with_secdriver_apparmor" = "check" ; then
|
||||
with_secdriver_apparmor=no
|
||||
else
|
||||
AC_MSG_ERROR([You must install the AppArmor development package in order to compile libvirt])
|
||||
fi
|
||||
else
|
||||
with_secdriver_apparmor=yes
|
||||
AC_DEFINE_UNQUOTED([WITH_SECDRIVER_APPARMOR], 1, [whether AppArmor security driver is available])
|
||||
fi
|
||||
fi
|
||||
AM_CONDITIONAL([WITH_SECDRIVER_APPARMOR], [test "$with_secdriver_apparmor" != "no"])
|
||||
|
||||
|
||||
|
||||
dnl NUMA lib
|
||||
AC_ARG_WITH([numactl],
|
||||
@ -722,6 +912,147 @@ AM_CONDITIONAL([HAVE_NUMACTL], [test "$with_numactl" != "no"])
|
||||
AC_SUBST([NUMACTL_CFLAGS])
|
||||
AC_SUBST([NUMACTL_LIBS])
|
||||
|
||||
|
||||
dnl
|
||||
dnl Checks for the UML driver
|
||||
dnl
|
||||
|
||||
if test "$with_uml" = "yes" -o "$with_uml" = "check"; then
|
||||
AC_CHECK_HEADER([sys/inotify.h], [
|
||||
with_uml=yes
|
||||
], [
|
||||
if test "$with_uml" = "check"; then
|
||||
with_uml=no
|
||||
AC_MSG_NOTICE([<sys/inotify.h> is required for the UML driver, disabling it])
|
||||
else
|
||||
AC_MSG_ERROR([The <sys/inotify.h> is required for the UML driver. Upgrade your libc6.])
|
||||
fi
|
||||
])
|
||||
fi
|
||||
if test "$with_libvirtd" = "no" ; then
|
||||
with_uml=no
|
||||
fi
|
||||
if test "$with_uml" = "yes" ; then
|
||||
AC_DEFINE_UNQUOTED([WITH_UML], 1, [whether UML driver is enabled])
|
||||
fi
|
||||
AM_CONDITIONAL([WITH_UML], [test "$with_uml" = "yes"])
|
||||
|
||||
|
||||
|
||||
dnl
|
||||
dnl libssh checks
|
||||
dnl
|
||||
|
||||
if test "$with_libssh2" != "yes" -a "$with_libssh2" != "no"; then
|
||||
libssh2_path="$with_libssh2"
|
||||
elif test "$with_libssh2" = "yes"; then
|
||||
libssh2_path="/usr/local/lib/"
|
||||
elif test "$with_libssh2" = "no"; then
|
||||
with_phyp="no";
|
||||
fi
|
||||
|
||||
if test "$with_phyp" = "check"; then
|
||||
AC_CHECK_LIB([ssh2],[libssh2_session_startup],[
|
||||
LIBSSH2_LIBS="$LIBSSH2_LIBS -lssh2 -L$libssh2_path"
|
||||
AC_SUBST([LIBSSH2_LIBS])
|
||||
],[
|
||||
with_phyp="no"
|
||||
with_libssh2="no";
|
||||
],[])
|
||||
|
||||
if test "$with_phyp" != "no"; then
|
||||
AC_CHECK_HEADERS([libssh2.h],[
|
||||
with_phyp="yes"
|
||||
LIBSSH2_CFLAGS="-I/usr/local/include"
|
||||
AC_SUBST([LIBSSH2_CFLAGS])
|
||||
],[
|
||||
with_phyp="no"
|
||||
with_libssh2="no";
|
||||
],[
|
||||
])
|
||||
fi
|
||||
|
||||
if test "$with_phyp" != "no"; then
|
||||
saved_libs="$LIBS"
|
||||
LIBS="$LIBS -lssh2"
|
||||
AC_TRY_LINK([#include <libssh2.h>], [
|
||||
(void) libssh2_session_block_directions(NULL);
|
||||
], [
|
||||
AC_DEFINE_UNQUOTED([WITH_PHYP], 1, [whether IBM HMC / IVM driver is enabled])
|
||||
], [
|
||||
with_phyp=no
|
||||
AC_MSG_NOTICE([Function libssh2_session_block_directions() not present in your version of libssh2 but required for Phyp driver, disabling it])
|
||||
])
|
||||
LIBS="$saved_libs"
|
||||
fi
|
||||
elif test "$with_phyp" = "yes"; then
|
||||
AC_CHECK_LIB([ssh2],[libssh2_session_startup],[
|
||||
LIBSSH2_LIBS="$LIBSSH2_LIBS -lssh2 -L$libssh2_path"
|
||||
AC_SUBST([LIBSSH2_LIBS])],[
|
||||
AC_MSG_ERROR([You must install the libssh2 to compile Phyp driver.])
|
||||
])
|
||||
|
||||
AC_CHECK_HEADERS([libssh2.h],[
|
||||
LIBSSH2_CFLAGS="-I/usr/local/include"
|
||||
AC_SUBST([LIBSSH2_CFLAGS])],[
|
||||
AC_MSG_ERROR([Cannot find libssh2 headers. Is libssh2 installed ?])
|
||||
],[])
|
||||
|
||||
saved_libs="$LIBS"
|
||||
LIBS="$LIBS -lssh2"
|
||||
AC_TRY_LINK([#include <libssh2.h>], [
|
||||
(void) libssh2_session_block_directions(NULL);
|
||||
], [], [
|
||||
AC_MSG_ERROR([Function libssh2_session_block_directions() not present in your version of libssh2. Need >= 1.0])
|
||||
])
|
||||
LIBS="$saved_libs"
|
||||
|
||||
AC_DEFINE_UNQUOTED([WITH_PHYP], 1,
|
||||
[whether IBM HMC / IVM driver is enabled])
|
||||
fi
|
||||
AM_CONDITIONAL([WITH_PHYP],[test "$with_phyp" = "yes"])
|
||||
|
||||
dnl libcap-ng
|
||||
AC_ARG_WITH([capng],
|
||||
[ --with-capng use libcap-ng to reduce libvirtd privileges],
|
||||
[],
|
||||
[with_capng=check])
|
||||
|
||||
dnl
|
||||
dnl This check looks for 'capng_updatev' since that was
|
||||
dnl introduced in 0.4.0 release which need as minimum
|
||||
dnl
|
||||
CAPNG_CFLAGS=
|
||||
CAPNG_LIBS=
|
||||
if test "$with_qemu" = "yes" -a "$with_capng" != "no"; then
|
||||
old_cflags="$CFLAGS"
|
||||
old_libs="$LIBS"
|
||||
if test "$with_capng" = "check"; then
|
||||
AC_CHECK_HEADER([cap-ng.h],[],[with_capng=no])
|
||||
AC_CHECK_LIB([cap-ng], [capng_updatev],[],[with_capng=no])
|
||||
if test "$with_capng" != "no"; then
|
||||
with_capng="yes"
|
||||
fi
|
||||
else
|
||||
fail=0
|
||||
AC_CHECK_HEADER([cap-ng.h],[],[fail=1])
|
||||
AC_CHECK_LIB([cap-ng], [capng_updatev],[],[fail=1])
|
||||
test $fail = 1 &&
|
||||
AC_MSG_ERROR([You must install the capng >= 0.4.0 development package in order to compile and run libvirt])
|
||||
fi
|
||||
CFLAGS="$old_cflags"
|
||||
LIBS="$old_libs"
|
||||
fi
|
||||
if test "$with_capng" = "yes"; then
|
||||
CAPNG_LIBS="-lcap-ng"
|
||||
AC_DEFINE_UNQUOTED([HAVE_CAPNG], 1, [whether capng is available for privilege reduction])
|
||||
fi
|
||||
AM_CONDITIONAL([HAVE_CAPNG], [test "$with_capng" != "no"])
|
||||
AC_SUBST([CAPNG_CFLAGS])
|
||||
AC_SUBST([CAPNG_LIBS])
|
||||
|
||||
|
||||
|
||||
dnl virsh libraries
|
||||
AC_CHECK_HEADERS([readline/readline.h])
|
||||
|
||||
@ -782,9 +1113,42 @@ if test "$with_qemu:$with_lxc:$with_network" != "no:no:no"; then
|
||||
fi
|
||||
AM_CONDITIONAL([WITH_BRIDGE], [test "$with_bridge" = "yes"])
|
||||
|
||||
dnl
|
||||
dnl Storage driver checks
|
||||
dnl
|
||||
dnl netcf library
|
||||
AC_ARG_WITH([netcf],
|
||||
[ --with-netcf libnetcf support to configure physical host network interfaces],
|
||||
[], [with_netcf=check])
|
||||
|
||||
NETCF_CFLAGS=
|
||||
NETCF_LIBS=
|
||||
if test "$with_netcf" = "yes" -o "$with_netcf" = "check"; then
|
||||
PKG_CHECK_MODULES(NETCF, netcf >= $NETCF_REQUIRED,
|
||||
[with_netcf=yes], [
|
||||
if test "$with_netcf" = "check" ; then
|
||||
with_netcf=no
|
||||
else
|
||||
AC_MSG_ERROR(
|
||||
[You must install libnetcf >= $NETCF_REQUIRED to compile libvirt])
|
||||
fi
|
||||
])
|
||||
if test "$with_netcf" = "yes" ; then
|
||||
AC_DEFINE_UNQUOTED([WITH_NETCF], 1,
|
||||
[whether libnetcf is available to configure physical host network interfaces])
|
||||
fi
|
||||
fi
|
||||
AM_CONDITIONAL([WITH_NETCF], [test "$with_netcf" = "yes"])
|
||||
AC_SUBST([NETCF_CFLAGS])
|
||||
AC_SUBST([NETCF_LIBS])
|
||||
|
||||
|
||||
with_secrets=yes
|
||||
if test "$with_libvirtd" = "no"; then
|
||||
with_secrets=no
|
||||
fi
|
||||
if test "$with_secrets" = "yes" ; then
|
||||
AC_DEFINE_UNQUOTED([WITH_SECRETS], 1, [whether local secrets management driver is available])
|
||||
fi
|
||||
AM_CONDITIONAL([WITH_SECRETS], [test "$with_secrets" = "yes"])
|
||||
|
||||
|
||||
AC_ARG_WITH([storage-fs],
|
||||
[ --with-storage-fs with FileSystem backend for the storage driver (on)],[],[with_storage_fs=check])
|
||||
@ -794,6 +1158,8 @@ AC_ARG_WITH([storage-iscsi],
|
||||
[ --with-storage-iscsi with iSCSI backend for the storage driver (on)],[],[with_storage_iscsi=check])
|
||||
AC_ARG_WITH([storage-scsi],
|
||||
[ --with-storage-scsi with SCSI backend for the storage driver (on)],[],[with_storage_scsi=check])
|
||||
AC_ARG_WITH([storage-mpath],
|
||||
[ --with-storage-mpath with mpath backend for the storage driver (on)],[],[with_storage_mpath=check])
|
||||
AC_ARG_WITH([storage-disk],
|
||||
[ --with-storage-disk with GPartd Disk backend for the storage driver (on)],[],[with_storage_disk=check])
|
||||
|
||||
@ -804,6 +1170,7 @@ if test "$with_libvirtd" = "no"; then
|
||||
with_storage_lvm=no
|
||||
with_storage_iscsi=no
|
||||
with_storage_scsi=no
|
||||
with_storage_mpath=no
|
||||
with_storage_disk=no
|
||||
fi
|
||||
if test "$with_storage_dir" = "yes" ; then
|
||||
@ -840,21 +1207,6 @@ if test "$with_storage_fs" = "yes"; then
|
||||
[Location or name of the showmount program])
|
||||
fi
|
||||
|
||||
AC_PATH_PROG([QEMU_IMG], [qemu-img], [], [$PATH:/sbin:/usr/sbin:/bin:/usr/bin])
|
||||
if test -n "$QEMU_IMG" ; then
|
||||
AC_DEFINE_UNQUOTED([HAVE_QEMU_IMG], 1, [whether qemu-img is available for non-raw files])
|
||||
AC_DEFINE_UNQUOTED([QEMU_IMG],["$QEMU_IMG"],
|
||||
[Location or name of the qemu-img program])
|
||||
fi
|
||||
|
||||
AC_PATH_PROG([QCOW_CREATE], [qcow-create], [], [$PATH:/sbin:/usr/sbin:/bin:/usr/bin])
|
||||
if test -n "$QCOW_CREATE" ; then
|
||||
AC_DEFINE_UNQUOTED([HAVE_QCOW_CREATE], 1, [whether qcow-create is available for non-raw files])
|
||||
AC_DEFINE_UNQUOTED([QCOW_CREATE],["$QCOW_CREATE"],
|
||||
[Location or name of the qcow-create program])
|
||||
fi
|
||||
|
||||
|
||||
if test "$with_storage_lvm" = "yes" -o "$with_storage_lvm" = "check"; then
|
||||
AC_PATH_PROG([PVCREATE], [pvcreate], [], [$PATH:/sbin:/usr/sbin])
|
||||
AC_PATH_PROG([VGCREATE], [vgcreate], [], [$PATH:/sbin:/usr/sbin])
|
||||
@ -940,6 +1292,26 @@ if test "$with_storage_scsi" = "check"; then
|
||||
fi
|
||||
AM_CONDITIONAL([WITH_STORAGE_SCSI], [test "$with_storage_scsi" = "yes"])
|
||||
|
||||
if test "$with_storage_mpath" = "check"; then
|
||||
with_storage_mpath=yes
|
||||
|
||||
AC_DEFINE_UNQUOTED([WITH_STORAGE_MPATH], 1,
|
||||
[whether mpath backend for storage driver is enabled])
|
||||
fi
|
||||
AM_CONDITIONAL([WITH_STORAGE_MPATH], [test "$with_storage_mpath" = "yes"])
|
||||
|
||||
if test "$with_storage_mpath" = "yes"; then
|
||||
DEVMAPPER_REQUIRED=0.0
|
||||
DEVMAPPER_CFLAGS=
|
||||
DEVMAPPER_LIBS=
|
||||
PKG_CHECK_MODULES(DEVMAPPER, devmapper >= $DEVMAPPER_REQUIRED,
|
||||
[], [
|
||||
AC_MSG_ERROR(
|
||||
[You must install device-mapper-devel >= $DEVMAPPER_REQUIRED to compile libvirt])
|
||||
])
|
||||
fi
|
||||
AC_SUBST([DEVMAPPER_CFLAGS])
|
||||
AC_SUBST([DEVMAPPER_LIBS])
|
||||
|
||||
LIBPARTED_CFLAGS=
|
||||
LIBPARTED_LIBS=
|
||||
@ -987,11 +1359,43 @@ AM_CONDITIONAL([WITH_STORAGE_DISK], [test "$with_storage_disk" = "yes"])
|
||||
AC_SUBST([LIBPARTED_CFLAGS])
|
||||
AC_SUBST([LIBPARTED_LIBS])
|
||||
|
||||
dnl
|
||||
dnl check for libcurl (ESX)
|
||||
dnl
|
||||
|
||||
LIBCURL_CFLAGS=""
|
||||
LIBCURL_LIBS=""
|
||||
LIBCURL_REQUIRED="7.18.0"
|
||||
LIBCURL_FOUND="no"
|
||||
|
||||
if test "$with_esx" = "yes" -o "$with_esx" = "check"; then
|
||||
PKG_CHECK_MODULES(LIBCURL, libcurl >= $LIBCURL_REQUIRED, [
|
||||
LIBCURL_FOUND=yes
|
||||
with_esx="yes"
|
||||
], [
|
||||
if test "$with_esx" = "check"; then
|
||||
with_esx=no
|
||||
AC_MSG_NOTICE([libcurl is required for ESX driver, disabling it])
|
||||
else
|
||||
AC_MSG_ERROR([libcurl >= $LIBCURL_REQUIRED is required for the ESX driver])
|
||||
fi
|
||||
])
|
||||
fi
|
||||
if test "$with_esx" = "yes" ; then
|
||||
AC_DEFINE_UNQUOTED([WITH_ESX], 1, [whether ESX driver is enabled])
|
||||
fi
|
||||
AM_CONDITIONAL([WITH_ESX], [test "$with_esx" = "yes"])
|
||||
|
||||
AC_SUBST([LIBCURL_CFLAGS])
|
||||
AC_SUBST([LIBCURL_LIBS])
|
||||
|
||||
dnl
|
||||
dnl check for python
|
||||
dnl
|
||||
|
||||
AC_ARG_WITH([python],
|
||||
[ --with-python Build python bindings (on)],[],[with_python=yes])
|
||||
|
||||
PYTHON_VERSION=
|
||||
PYTHON_INCLUDES=
|
||||
PYTHON_SITE_PACKAGES=
|
||||
@ -1049,7 +1453,7 @@ if test "$with_python" != "no" ; then
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if test "$with_python" != ""
|
||||
if test "$with_python" != "yes"
|
||||
then
|
||||
pythondir='$(PYTHON_SITE_PACKAGES)'
|
||||
else
|
||||
@ -1122,6 +1526,22 @@ if test "${enable_oom}" = yes; then
|
||||
AC_DEFINE([TEST_OOM], 1, [Whether malloc OOM checking is enabled])
|
||||
fi
|
||||
|
||||
|
||||
AC_ARG_ENABLE([test-locking],
|
||||
[ --enable-test-locking thread locking tests using CIL],
|
||||
[case "${enableval}" in
|
||||
yes|no) ;;
|
||||
*) AC_MSG_ERROR([bad value ${enableval} for test-locking option]) ;;
|
||||
esac],
|
||||
[enableval=no])
|
||||
enable_locking=$enableval
|
||||
|
||||
if test "$enable_locking" = "yes"; then
|
||||
LOCK_CHECKING_CFLAGS="-Dbool=char -D_Bool=char -save-temps"
|
||||
AC_SUBST([LOCK_CHECKING_CFLAGS])
|
||||
fi
|
||||
AM_CONDITIONAL([WITH_CIL],[test "$enable_locking" = "yes"])
|
||||
|
||||
dnl Enable building the proxy?
|
||||
|
||||
AC_ARG_WITH([xen-proxy],
|
||||
@ -1324,6 +1744,19 @@ AM_CONDITIONAL([WITH_NODE_DEVICES], [test "$with_nodedev" = "yes"])
|
||||
|
||||
AM_CONDITIONAL([WITH_LINUX], [test `uname -s` = "Linux"])
|
||||
|
||||
|
||||
AC_ARG_WITH([qemu-user],
|
||||
[ --with-qemu-user username to run QEMU system instance as],
|
||||
[QEMU_USER=${withval}],
|
||||
[QEMU_USER=root])
|
||||
AC_ARG_WITH([qemu-group],
|
||||
[ --with-qemu-group groupname to run QEMU system instance as],
|
||||
[QEMU_GROUP=${withval}],
|
||||
[QEMU_GROUP=root])
|
||||
AC_DEFINE_UNQUOTED([QEMU_USER], ["$QEMU_USER"], [QEMU user account])
|
||||
AC_DEFINE_UNQUOTED([QEMU_GROUP], ["$QEMU_GROUP"], [QEMU group account])
|
||||
|
||||
|
||||
# Only COPYING.LIB is under version control, yet COPYING
|
||||
# is included as part of the distribution tarball.
|
||||
# Copy one to the other, but only if this is a srcdir-build.
|
||||
@ -1332,8 +1765,6 @@ test "x$srcdir" = x. && ! test -f COPYING &&
|
||||
cp -f COPYING.LIB COPYING
|
||||
|
||||
AC_OUTPUT(Makefile src/Makefile include/Makefile docs/Makefile \
|
||||
docs/examples/Makefile docs/devhelp/Makefile \
|
||||
docs/examples/python/Makefile \
|
||||
docs/schemas/Makefile \
|
||||
gnulib/lib/Makefile \
|
||||
gnulib/tests/Makefile \
|
||||
@ -1341,7 +1772,8 @@ AC_OUTPUT(Makefile src/Makefile include/Makefile docs/Makefile \
|
||||
po/Makefile.in \
|
||||
include/libvirt/Makefile include/libvirt/libvirt.h \
|
||||
python/Makefile python/tests/Makefile \
|
||||
qemud/Makefile \
|
||||
daemon/Makefile \
|
||||
tools/Makefile \
|
||||
tests/Makefile proxy/Makefile \
|
||||
tests/xml2sexprdata/Makefile \
|
||||
tests/sexpr2xmldata/Makefile \
|
||||
@ -1349,6 +1781,9 @@ AC_OUTPUT(Makefile src/Makefile include/Makefile docs/Makefile \
|
||||
tests/xencapsdata/Makefile \
|
||||
tests/confdata/Makefile \
|
||||
examples/domain-events/events-c/Makefile \
|
||||
examples/domsuspend/Makefile \
|
||||
examples/dominfo/Makefile \
|
||||
examples/python/Makefile \
|
||||
examples/hellolibvirt/Makefile)
|
||||
|
||||
AC_MSG_NOTICE([])
|
||||
@ -1362,11 +1797,16 @@ AC_MSG_NOTICE([ Proxy: $with_xen_proxy])
|
||||
AC_MSG_NOTICE([ QEMU: $with_qemu])
|
||||
AC_MSG_NOTICE([ UML: $with_uml])
|
||||
AC_MSG_NOTICE([ OpenVZ: $with_openvz])
|
||||
AC_MSG_NOTICE([ VBox: $with_vbox])
|
||||
AC_MSG_NOTICE([ LXC: $with_lxc])
|
||||
AC_MSG_NOTICE([ PHYP: $with_phyp])
|
||||
AC_MSG_NOTICE([ ONE: $with_one])
|
||||
AC_MSG_NOTICE([ ESX: $with_esx])
|
||||
AC_MSG_NOTICE([ Test: $with_test])
|
||||
AC_MSG_NOTICE([ Remote: $with_remote])
|
||||
AC_MSG_NOTICE([ Network: $with_network])
|
||||
AC_MSG_NOTICE([Libvirtd: $with_libvirtd])
|
||||
AC_MSG_NOTICE([ netcf: $with_netcf])
|
||||
AC_MSG_NOTICE([])
|
||||
AC_MSG_NOTICE([Storage Drivers])
|
||||
AC_MSG_NOTICE([])
|
||||
@ -1376,11 +1816,13 @@ AC_MSG_NOTICE([ NetFS: $with_storage_fs])
|
||||
AC_MSG_NOTICE([ LVM: $with_storage_lvm])
|
||||
AC_MSG_NOTICE([ iSCSI: $with_storage_iscsi])
|
||||
AC_MSG_NOTICE([ SCSI: $with_storage_scsi])
|
||||
AC_MSG_NOTICE([ mpath: $with_storage_mpath])
|
||||
AC_MSG_NOTICE([ Disk: $with_storage_disk])
|
||||
AC_MSG_NOTICE([])
|
||||
AC_MSG_NOTICE([Security Drivers])
|
||||
AC_MSG_NOTICE([])
|
||||
AC_MSG_NOTICE([ SELinux: $with_secdriver_selinux])
|
||||
AC_MSG_NOTICE([AppArmor: $with_secdriver_apparmor])
|
||||
AC_MSG_NOTICE([])
|
||||
AC_MSG_NOTICE([Driver Loadable Modules])
|
||||
AC_MSG_NOTICE([])
|
||||
@ -1393,6 +1835,16 @@ AC_MSG_NOTICE([])
|
||||
AC_MSG_NOTICE([Libraries])
|
||||
AC_MSG_NOTICE([])
|
||||
AC_MSG_NOTICE([ libxml: $LIBXML_CFLAGS $LIBXML_LIBS])
|
||||
if test "$with_esx" = "yes" ; then
|
||||
AC_MSG_NOTICE([ libcurl: $LIBCURL_CFLAGS $LIBCURL_LIBS])
|
||||
else
|
||||
AC_MSG_NOTICE([ libcurl: no])
|
||||
fi
|
||||
if test "$with_libssh2" != "no" ; then
|
||||
AC_MSG_NOTICE([ libssh2: $LIBSSH2_CFLAGS $LIBSSH2_LIBS])
|
||||
else
|
||||
AC_MSG_NOTICE([ libssh2: no])
|
||||
fi
|
||||
AC_MSG_NOTICE([ gnutls: $GNUTLS_CFLAGS $GNUTLS_LIBS])
|
||||
if test "$with_sasl" != "no" ; then
|
||||
AC_MSG_NOTICE([ sasl: $SASL_CFLAGS $SASL_LIBS])
|
||||
@ -1405,7 +1857,11 @@ else
|
||||
AC_MSG_NOTICE([ avahi: no])
|
||||
fi
|
||||
if test "$with_polkit" = "yes" ; then
|
||||
AC_MSG_NOTICE([ polkit: $POLKIT_CFLAGS $POLKIT_LIBS])
|
||||
if test "$with_polkit0" = "yes" ; then
|
||||
AC_MSG_NOTICE([ polkit: $POLKIT_CFLAGS $POLKIT_LIBS (version 0)])
|
||||
else
|
||||
AC_MSG_NOTICE([ polkit: $PKCHECK_PATH (version 1)])
|
||||
fi
|
||||
else
|
||||
AC_MSG_NOTICE([ polkit: no])
|
||||
fi
|
||||
@ -1414,11 +1870,21 @@ AC_MSG_NOTICE([ selinux: $SELINUX_CFLAGS $SELINUX_LIBS])
|
||||
else
|
||||
AC_MSG_NOTICE([ selinux: no])
|
||||
fi
|
||||
if test "$with_apparmor" = "yes" ; then
|
||||
AC_MSG_NOTICE([apparmor: $APPARMOR_CFLAGS $APPARMOR_LIBS])
|
||||
else
|
||||
AC_MSG_NOTICE([apparmor: no])
|
||||
fi
|
||||
if test "$with_numactl" = "yes" ; then
|
||||
AC_MSG_NOTICE([ numactl: $NUMACTL_CFLAGS $NUMACTL_LIBS])
|
||||
else
|
||||
AC_MSG_NOTICE([ numactl: no])
|
||||
fi
|
||||
if test "$with_capng" = "yes" ; then
|
||||
AC_MSG_NOTICE([ capng: $CAPNG_CFLAGS $CAPNG_LIBS])
|
||||
else
|
||||
AC_MSG_NOTICE([ capng: no])
|
||||
fi
|
||||
if test "$with_xen" = "yes" ; then
|
||||
AC_MSG_NOTICE([ xen: $XEN_CFLAGS $XEN_LIBS])
|
||||
else
|
||||
@ -1434,6 +1900,16 @@ AC_MSG_NOTICE([ devkit: $DEVKIT_CFLAGS $DEVKIT_LIBS])
|
||||
else
|
||||
AC_MSG_NOTICE([ devkit: no])
|
||||
fi
|
||||
if test "$with_netcf" = "yes" ; then
|
||||
AC_MSG_NOTICE([ netcf: $NETCF_CFLAGS $NETCF_LIBS])
|
||||
else
|
||||
AC_MSG_NOTICE([ netcf: no])
|
||||
fi
|
||||
if test "$with_one" = "yes" ; then
|
||||
AC_MSG_NOTICE([ xmlrpc: $XMLRPC_CFLAGS $XMLRPC_LIBS])
|
||||
else
|
||||
AC_MSG_NOTICE([ xmlrpc: no])
|
||||
fi
|
||||
AC_MSG_NOTICE([])
|
||||
AC_MSG_NOTICE([Test suite])
|
||||
AC_MSG_NOTICE([])
|
||||
@ -1445,4 +1921,9 @@ AC_MSG_NOTICE([])
|
||||
AC_MSG_NOTICE([ Debug: $enable_debug])
|
||||
AC_MSG_NOTICE([ Warnings: $enable_compile_warnings])
|
||||
AC_MSG_NOTICE([ Readline: $lv_use_readline])
|
||||
AC_MSG_NOTICE([ Python: $with_python])
|
||||
AC_MSG_NOTICE([])
|
||||
AC_MSG_NOTICE([Privileges])
|
||||
AC_MSG_NOTICE([])
|
||||
AC_MSG_NOTICE([ QEMU: $QEMU_USER:$QEMU_GROUP])
|
||||
AC_MSG_NOTICE([])
|
||||
|
0
qemud/.gitignore → daemon/.gitignore
vendored
0
qemud/.gitignore → daemon/.gitignore
vendored
@ -2,81 +2,48 @@
|
||||
|
||||
DAEMON_SOURCES = \
|
||||
event.c event.h \
|
||||
qemud.c qemud.h \
|
||||
remote.c \
|
||||
libvirtd.c libvirtd.h \
|
||||
remote.c remote.h \
|
||||
dispatch.c dispatch.h \
|
||||
stream.c stream.h \
|
||||
remote_dispatch_prototypes.h \
|
||||
remote_dispatch_table.h \
|
||||
remote_dispatch_args.h \
|
||||
remote_dispatch_ret.h \
|
||||
remote_protocol.h remote_protocol.c
|
||||
../src/remote/remote_protocol.c
|
||||
|
||||
AVAHI_SOURCES = \
|
||||
mdns.c mdns.h
|
||||
|
||||
DISTCLEANFILES =
|
||||
EXTRA_DIST = \
|
||||
default-network.xml \
|
||||
remote_generate_stubs.pl rpcgen_fix.pl \
|
||||
remote_protocol.x \
|
||||
remote_generate_stubs.pl \
|
||||
libvirtd.conf \
|
||||
libvirtd.init.in \
|
||||
libvirtd.policy \
|
||||
libvirtd.policy-0 \
|
||||
libvirtd.policy-1 \
|
||||
libvirtd.sasl \
|
||||
libvirtd.sysconf \
|
||||
libvirtd.aug \
|
||||
libvirtd_qemu.aug \
|
||||
libvirtd.logrotate.in \
|
||||
test_libvirtd.aug \
|
||||
test_libvirtd_qemu.aug \
|
||||
$(AVAHI_SOURCES) \
|
||||
$(DAEMON_SOURCES)
|
||||
|
||||
if HAVE_RPCGEN
|
||||
#
|
||||
# Maintainer-only target for re-generating the derived .c/.h source
|
||||
# files, which are actually derived from the .x file.
|
||||
#
|
||||
# For committing protocol changes to CVS, the GLIBC rpcgen *must*
|
||||
# be used.
|
||||
#
|
||||
# Support for non-GLIB rpcgen is here as a convenience for
|
||||
# non-Linux people needing to test changes during dev.
|
||||
#
|
||||
rpcgen:
|
||||
rm -f rp.c-t rp.h-t rp.c-t1 rp.c-t2 rp.h-t1
|
||||
$(RPCGEN) -h -o rp.h-t $(srcdir)/remote_protocol.x
|
||||
$(RPCGEN) -c -o rp.c-t $(srcdir)/remote_protocol.x
|
||||
if HAVE_GLIBC_RPCGEN
|
||||
perl -w $(srcdir)/rpcgen_fix.pl rp.h-t > rp.h-t1
|
||||
perl -w $(srcdir)/rpcgen_fix.pl rp.c-t > rp.c-t1
|
||||
(echo '#include <config.h>'; cat rp.c-t1) > rp.c-t2
|
||||
chmod 0444 rp.c-t2 rp.h-t1
|
||||
mv -f rp.h-t1 $(srcdir)/remote_protocol.h
|
||||
mv -f rp.c-t2 $(srcdir)/remote_protocol.c
|
||||
rm -f rp.c-t rp.h-t rp.c-t1
|
||||
else
|
||||
chmod 0444 rp.c-t rp.h-t
|
||||
mv -f rp.h-t $(srcdir)/remote_protocol.h
|
||||
mv -f rp.c-t $(srcdir)/remote_protocol.c
|
||||
endif
|
||||
endif
|
||||
|
||||
remote_protocol.c: remote_protocol.h
|
||||
BUILT_SOURCES =
|
||||
|
||||
if WITH_LIBVIRTD
|
||||
|
||||
UUID=$(shell uuidgen 2>/dev/null)
|
||||
|
||||
sbin_PROGRAMS = libvirtd
|
||||
|
||||
confdir = $(sysconfdir)/libvirt/
|
||||
conf_DATA = libvirtd.conf
|
||||
|
||||
augeasdir = $(datadir)/augeas/lenses
|
||||
augeas_DATA = libvirtd.aug libvirtd_qemu.aug
|
||||
augeas_DATA = libvirtd.aug
|
||||
|
||||
augeastestsdir = $(datadir)/augeas/lenses/tests
|
||||
augeastests_DATA = test_libvirtd.aug test_libvirtd_qemu.aug
|
||||
augeastests_DATA = test_libvirtd.aug
|
||||
|
||||
libvirtd_SOURCES = $(DAEMON_SOURCES)
|
||||
|
||||
@ -85,6 +52,9 @@ libvirtd_CFLAGS = \
|
||||
-I$(top_srcdir)/gnulib/lib -I../gnulib/lib \
|
||||
-I$(top_srcdir)/include -I$(top_builddir)/include \
|
||||
-I$(top_srcdir)/src \
|
||||
-I$(top_srcdir)/src/util \
|
||||
-I$(top_srcdir)/src/conf \
|
||||
-I$(top_srcdir)/src/remote \
|
||||
$(LIBXML_CFLAGS) $(GNUTLS_CFLAGS) $(SASL_CFLAGS) \
|
||||
$(POLKIT_CFLAGS) \
|
||||
$(WARN_CFLAGS) -DLOCAL_STATE_DIR="\"$(localstatedir)\"" \
|
||||
@ -104,9 +74,10 @@ libvirtd_LDADD = \
|
||||
$(SASL_LIBS) \
|
||||
$(POLKIT_LIBS)
|
||||
|
||||
libvirtd_LDADD += ../src/libvirt_util.la
|
||||
|
||||
if WITH_DRIVER_MODULES
|
||||
libvirtd_LDADD += ../src/libvirt_driver.la
|
||||
libvirtd_LDADD += ../src/libvirt_util.la
|
||||
else
|
||||
if WITH_QEMU
|
||||
libvirtd_LDADD += ../src/libvirt_driver_qemu.la
|
||||
@ -120,6 +91,10 @@ if WITH_UML
|
||||
libvirtd_LDADD += ../src/libvirt_driver_uml.la
|
||||
endif
|
||||
|
||||
if WITH_ONE
|
||||
libvirtd_LDADD += ../src/libvirt_driver_one.la
|
||||
endif
|
||||
|
||||
if WITH_STORAGE_DIR
|
||||
libvirtd_LDADD += ../src/libvirt_driver_storage.la
|
||||
endif
|
||||
@ -128,6 +103,10 @@ if WITH_NETWORK
|
||||
libvirtd_LDADD += ../src/libvirt_driver_network.la
|
||||
endif
|
||||
|
||||
if WITH_NETCF
|
||||
libvirtd_LDADD += ../src/libvirt_driver_interface.la
|
||||
endif
|
||||
|
||||
if WITH_NODE_DEVICES
|
||||
libvirtd_LDADD += ../src/libvirt_driver_nodedev.la
|
||||
endif
|
||||
@ -136,7 +115,13 @@ endif
|
||||
libvirtd_LDADD += ../src/libvirt.la
|
||||
|
||||
if HAVE_POLKIT
|
||||
if HAVE_POLKIT0
|
||||
policydir = $(datadir)/PolicyKit/policy
|
||||
policyfile = libvirtd.policy-0
|
||||
else
|
||||
policydir = $(datadir)/polkit-1/actions
|
||||
policyfile = libvirtd.policy-1
|
||||
endif
|
||||
endif
|
||||
|
||||
if HAVE_AVAHI
|
||||
@ -146,47 +131,21 @@ libvirtd_LDADD += $(AVAHI_LIBS)
|
||||
endif
|
||||
|
||||
|
||||
default_xml_dest = libvirt/qemu/networks/default.xml
|
||||
install-data-local: install-init install-data-sasl install-data-polkit \
|
||||
install-logrotate
|
||||
mkdir -p $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/autostart
|
||||
$(INSTALL_DATA) $(srcdir)/default-network.xml \
|
||||
$(DESTDIR)$(sysconfdir)/$(default_xml_dest)
|
||||
test -z "$(UUID)" || \
|
||||
sed -i -e "s,</name>,</name>\n <uuid>$(UUID)</uuid>," \
|
||||
$(DESTDIR)$(sysconfdir)/$(default_xml_dest)
|
||||
test -e $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/autostart/default.xml || \
|
||||
ln -s ../default.xml \
|
||||
$(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/autostart/default.xml
|
||||
mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/qemu
|
||||
mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt
|
||||
mkdir -p $(DESTDIR)$(localstatedir)/run/libvirt
|
||||
mkdir -p $(DESTDIR)$(localstatedir)/lib/libvirt
|
||||
|
||||
uninstall-local:: uninstall-init uninstall-data-sasl install-data-polkit
|
||||
rm -f $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/autostart/default.xml
|
||||
rm -f $(DESTDIR)$(sysconfdir)/$(default_xml_dest)
|
||||
rmdir $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/autostart || :
|
||||
rmdir $(DESTDIR)$(localstatedir)/log/libvirt/qemu || :
|
||||
uninstall-local:: uninstall-init uninstall-data-sasl uninstall-data-polkit
|
||||
rmdir $(DESTDIR)$(localstatedir)/log/libvirt || :
|
||||
rmdir $(DESTDIR)$(localstatedir)/run/libvirt || :
|
||||
rmdir $(DESTDIR)$(localstatedir)/lib/libvirt || :
|
||||
|
||||
if HAVE_SASL
|
||||
install-data-sasl:: install-init
|
||||
mkdir -p $(DESTDIR)$(sysconfdir)/sasl2/
|
||||
$(INSTALL_DATA) $(srcdir)/libvirtd.sasl $(DESTDIR)$(sysconfdir)/sasl2/libvirt.conf
|
||||
|
||||
uninstall-data-sasl:: install-init
|
||||
rm -f $(DESTDIR)$(sysconfdir)/sasl2/libvirt.conf
|
||||
rmdir $(DESTDIR)$(sysconfdir)/sasl2/
|
||||
else
|
||||
install-data-sasl:
|
||||
uninstall-data-sasl:
|
||||
endif
|
||||
|
||||
if HAVE_POLKIT
|
||||
install-data-polkit:: install-init
|
||||
mkdir -p $(DESTDIR)$(policydir)
|
||||
$(INSTALL_DATA) $(srcdir)/libvirtd.policy $(DESTDIR)$(policydir)/org.libvirt.unix.policy
|
||||
$(INSTALL_DATA) $(srcdir)/$(policyfile) $(DESTDIR)$(policydir)/org.libvirt.unix.policy
|
||||
uninstall-data-polkit:: install-init
|
||||
rm -f $(DESTDIR)$(policydir)/org.libvirt.unix.policy
|
||||
else
|
||||
@ -200,19 +159,22 @@ remote.c: remote_dispatch_prototypes.h \
|
||||
remote_dispatch_args.h \
|
||||
remote_dispatch_ret.h
|
||||
|
||||
remote_dispatch_prototypes.h: $(srcdir)/remote_generate_stubs.pl remote_protocol.x
|
||||
perl -w $(srcdir)/remote_generate_stubs.pl -p $(srcdir)/remote_protocol.x > $@
|
||||
REMOTE_PROTOCOL = $(top_srcdir)/src/remote/remote_protocol.x
|
||||
|
||||
remote_dispatch_table.h: $(srcdir)/remote_generate_stubs.pl remote_protocol.x
|
||||
perl -w $(srcdir)/remote_generate_stubs.pl -t $(srcdir)/remote_protocol.x > $@
|
||||
remote_dispatch_prototypes.h: $(srcdir)/remote_generate_stubs.pl $(REMOTE_PROTOCOL)
|
||||
perl -w $(srcdir)/remote_generate_stubs.pl -p $(REMOTE_PROTOCOL) > $@
|
||||
|
||||
remote_dispatch_args.h: $(srcdir)/remote_generate_stubs.pl remote_protocol.x
|
||||
perl -w $(srcdir)/remote_generate_stubs.pl -a $(srcdir)/remote_protocol.x > $@
|
||||
remote_dispatch_table.h: $(srcdir)/remote_generate_stubs.pl $(REMOTE_PROTOCOL)
|
||||
perl -w $(srcdir)/remote_generate_stubs.pl -t $(REMOTE_PROTOCOL) > $@
|
||||
|
||||
remote_dispatch_ret.h: $(srcdir)/remote_generate_stubs.pl remote_protocol.x
|
||||
perl -w $(srcdir)/remote_generate_stubs.pl -r $(srcdir)/remote_protocol.x > $@
|
||||
remote_dispatch_args.h: $(srcdir)/remote_generate_stubs.pl $(REMOTE_PROTOCOL)
|
||||
perl -w $(srcdir)/remote_generate_stubs.pl -a $(REMOTE_PROTOCOL) > $@
|
||||
|
||||
remote_dispatch_ret.h: $(srcdir)/remote_generate_stubs.pl $(REMOTE_PROTOCOL)
|
||||
perl -w $(srcdir)/remote_generate_stubs.pl -r $(REMOTE_PROTOCOL) > $@
|
||||
|
||||
BUILT_SOURCES += libvirtd.logrotate
|
||||
|
||||
DISTCLEANFILES += libvirtd.logrotate
|
||||
libvirtd.logrotate: libvirtd.logrotate.in
|
||||
sed \
|
||||
-e s!\@localstatedir\@!@localstatedir@!g \
|
||||
@ -221,6 +183,8 @@ libvirtd.logrotate: libvirtd.logrotate.in
|
||||
|
||||
install-logrotate: libvirtd.logrotate
|
||||
mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/qemu/
|
||||
mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/lxc/
|
||||
mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/uml/
|
||||
mkdir -p $(DESTDIR)$(sysconfdir)/logrotate.d/
|
||||
$(INSTALL_DATA) $< $(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd
|
||||
|
||||
@ -237,6 +201,8 @@ uninstall-init:
|
||||
rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirtd \
|
||||
$(DESTDIR)$(sysconfdir)/sysconfig/libvirtd
|
||||
|
||||
BUILT_SOURCES += libvirtd.init
|
||||
|
||||
libvirtd.init: libvirtd.init.in
|
||||
sed \
|
||||
-e s!\@localstatedir\@!@localstatedir@!g \
|
||||
@ -249,13 +215,12 @@ libvirtd.init: libvirtd.init.in
|
||||
check-local:
|
||||
test -x '$(AUGPARSE)' \
|
||||
&& '$(AUGPARSE)' -I $(srcdir) $(srcdir)/test_libvirtd.aug || :
|
||||
test -x '$(AUGPARSE)' \
|
||||
&& '$(AUGPARSE)' -I $(srcdir) $(srcdir)/test_libvirtd_qemu.aug || :
|
||||
|
||||
else
|
||||
|
||||
install-init:
|
||||
uninstall-init:
|
||||
libvirtd.init:
|
||||
|
||||
endif # DBUS_INIT_SCRIPTS_RED_HAT
|
||||
|
||||
@ -263,7 +228,26 @@ endif # DBUS_INIT_SCRIPTS_RED_HAT
|
||||
# are used by nearly every other library.
|
||||
libvirtd_LDADD += ../gnulib/lib/libgnu.la $(LIBSOCKET)
|
||||
|
||||
else # WITH_LIBVIRTD
|
||||
install-data-local: install-data-sasl
|
||||
uninstall-local:: uninstall-data-sasl
|
||||
endif # WITH_LIBVIRTD
|
||||
|
||||
CLEANFILES = libvirtd.init
|
||||
# This is needed for clients too, so can't wrap in
|
||||
# the WITH_LIBVIRTD conditional
|
||||
if HAVE_SASL
|
||||
install-data-sasl:
|
||||
mkdir -p $(DESTDIR)$(sysconfdir)/sasl2/
|
||||
$(INSTALL_DATA) $(srcdir)/libvirtd.sasl $(DESTDIR)$(sysconfdir)/sasl2/libvirt.conf
|
||||
|
||||
uninstall-data-sasl:
|
||||
rm -f $(DESTDIR)$(sysconfdir)/sasl2/libvirt.conf
|
||||
rmdir $(DESTDIR)$(sysconfdir)/sasl2/
|
||||
else
|
||||
install-data-sasl:
|
||||
uninstall-data-sasl:
|
||||
endif
|
||||
|
||||
|
||||
CLEANFILES = $(BUILT_SOURCES)
|
||||
CLEANFILES += *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda
|
@ -59,5 +59,4 @@ for the associated RPC call.
|
||||
While the helper method is executing, no locks are held on either
|
||||
the client or server, but the ref count on the 'struct qemud_client'
|
||||
object is incremented to ensure its not deleted. The helper can
|
||||
now safely invoke the neccessary libvirt API call.
|
||||
|
||||
now safely invoke the necessary libvirt API call.
|
668
daemon/dispatch.c
Normal file
668
daemon/dispatch.c
Normal file
@ -0,0 +1,668 @@
|
||||
/*
|
||||
* dispatch.h: RPC message dispatching infrastructure
|
||||
*
|
||||
* Copyright (C) 2007, 2008, 2009 Red Hat, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* Author: Richard W.M. Jones <rjones@redhat.com>
|
||||
* Author: Daniel P. Berrange <berrange@redhat.com>
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "dispatch.h"
|
||||
#include "remote.h"
|
||||
|
||||
#include "memory.h"
|
||||
|
||||
/* Convert a libvirt virError object into wire format */
|
||||
static void
|
||||
remoteDispatchCopyError (remote_error *rerr,
|
||||
virErrorPtr verr)
|
||||
{
|
||||
rerr->code = verr->code;
|
||||
rerr->domain = verr->domain;
|
||||
rerr->message = verr->message ? malloc(sizeof(char*)) : NULL;
|
||||
if (rerr->message) *rerr->message = strdup(verr->message);
|
||||
rerr->level = verr->level;
|
||||
rerr->str1 = verr->str1 ? malloc(sizeof(char*)) : NULL;
|
||||
if (rerr->str1) *rerr->str1 = strdup(verr->str1);
|
||||
rerr->str2 = verr->str2 ? malloc(sizeof(char*)) : NULL;
|
||||
if (rerr->str2) *rerr->str2 = strdup(verr->str2);
|
||||
rerr->str3 = verr->str3 ? malloc(sizeof(char*)) : NULL;
|
||||
if (rerr->str3) *rerr->str3 = strdup(verr->str3);
|
||||
rerr->int1 = verr->int1;
|
||||
rerr->int2 = verr->int2;
|
||||
}
|
||||
|
||||
|
||||
/* A set of helpers for sending back errors to client
|
||||
in various ways .... */
|
||||
|
||||
static void
|
||||
remoteDispatchStringError (remote_error *rerr,
|
||||
int code, const char *msg)
|
||||
{
|
||||
virError verr;
|
||||
|
||||
memset(&verr, 0, sizeof verr);
|
||||
|
||||
/* Construct the dummy libvirt virError. */
|
||||
verr.code = code;
|
||||
verr.domain = VIR_FROM_REMOTE;
|
||||
verr.message = (char *)msg;
|
||||
verr.level = VIR_ERR_ERROR;
|
||||
verr.str1 = (char *)msg;
|
||||
|
||||
remoteDispatchCopyError(rerr, &verr);
|
||||
}
|
||||
|
||||
|
||||
void remoteDispatchAuthError (remote_error *rerr)
|
||||
{
|
||||
remoteDispatchStringError (rerr, VIR_ERR_AUTH_FAILED, "authentication failed");
|
||||
}
|
||||
|
||||
|
||||
void remoteDispatchFormatError (remote_error *rerr,
|
||||
const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
char msgbuf[1024];
|
||||
char *msg = msgbuf;
|
||||
|
||||
va_start (args, fmt);
|
||||
vsnprintf (msgbuf, sizeof msgbuf, fmt, args);
|
||||
va_end (args);
|
||||
|
||||
remoteDispatchStringError (rerr, VIR_ERR_RPC, msg);
|
||||
}
|
||||
|
||||
|
||||
void remoteDispatchGenericError (remote_error *rerr)
|
||||
{
|
||||
remoteDispatchStringError(rerr,
|
||||
VIR_ERR_INTERNAL_ERROR,
|
||||
"library function returned error but did not set virterror");
|
||||
}
|
||||
|
||||
|
||||
void remoteDispatchOOMError (remote_error *rerr)
|
||||
{
|
||||
remoteDispatchStringError(rerr,
|
||||
VIR_ERR_NO_MEMORY,
|
||||
"out of memory");
|
||||
}
|
||||
|
||||
|
||||
void remoteDispatchConnError (remote_error *rerr,
|
||||
virConnectPtr conn)
|
||||
{
|
||||
virErrorPtr verr;
|
||||
|
||||
if (conn)
|
||||
verr = virConnGetLastError(conn);
|
||||
else
|
||||
verr = virGetLastError();
|
||||
if (verr)
|
||||
remoteDispatchCopyError(rerr, verr);
|
||||
else
|
||||
remoteDispatchGenericError(rerr);
|
||||
}
|
||||
|
||||
static int
|
||||
remoteSerializeError(struct qemud_client *client,
|
||||
remote_error *rerr,
|
||||
int program,
|
||||
int version,
|
||||
int procedure,
|
||||
int type,
|
||||
int serial)
|
||||
{
|
||||
XDR xdr;
|
||||
unsigned int len;
|
||||
struct qemud_client_message *msg = NULL;
|
||||
|
||||
DEBUG("prog=%d ver=%d proc=%d type=%d serial=%d, msg=%s",
|
||||
program, version, procedure, type, serial,
|
||||
rerr->message ? *rerr->message : "(none)");
|
||||
|
||||
if (VIR_ALLOC(msg) < 0)
|
||||
goto fatal_error;
|
||||
|
||||
/* Return header. */
|
||||
msg->hdr.prog = program;
|
||||
msg->hdr.vers = version;
|
||||
msg->hdr.proc = procedure;
|
||||
msg->hdr.type = type;
|
||||
msg->hdr.serial = serial;
|
||||
msg->hdr.status = REMOTE_ERROR;
|
||||
|
||||
msg->bufferLength = sizeof(msg->buffer);
|
||||
|
||||
/* Serialise the return header. */
|
||||
xdrmem_create (&xdr,
|
||||
msg->buffer,
|
||||
msg->bufferLength,
|
||||
XDR_ENCODE);
|
||||
|
||||
len = 0; /* We'll come back and write this later. */
|
||||
if (!xdr_u_int (&xdr, &len))
|
||||
goto xdr_error;
|
||||
|
||||
if (!xdr_remote_message_header (&xdr, &msg->hdr))
|
||||
goto xdr_error;
|
||||
|
||||
/* Error was not set, so synthesize a generic error message. */
|
||||
if (rerr->code == 0)
|
||||
remoteDispatchGenericError(rerr);
|
||||
|
||||
if (!xdr_remote_error (&xdr, rerr))
|
||||
goto xdr_error;
|
||||
|
||||
/* Write the length word. */
|
||||
len = xdr_getpos (&xdr);
|
||||
if (xdr_setpos (&xdr, 0) == 0)
|
||||
goto xdr_error;
|
||||
|
||||
if (!xdr_u_int (&xdr, &len))
|
||||
goto xdr_error;
|
||||
|
||||
xdr_destroy (&xdr);
|
||||
|
||||
msg->bufferLength = len;
|
||||
msg->bufferOffset = 0;
|
||||
|
||||
/* Put reply on end of tx queue to send out */
|
||||
qemudClientMessageQueuePush(&client->tx, msg);
|
||||
qemudUpdateClientEvent(client);
|
||||
xdr_free((xdrproc_t)xdr_remote_error, (char *)rerr);
|
||||
|
||||
return 0;
|
||||
|
||||
xdr_error:
|
||||
xdr_destroy(&xdr);
|
||||
VIR_FREE(msg);
|
||||
fatal_error:
|
||||
xdr_free((xdrproc_t)xdr_remote_error, (char *)rerr);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* @client: the client to send the error to
|
||||
* @rerr: the error object to send
|
||||
* @req: the message this error is in reply to
|
||||
*
|
||||
* Send an error message to the client
|
||||
*
|
||||
* Returns 0 if the error was sent, -1 upon fatal error
|
||||
*/
|
||||
int
|
||||
remoteSerializeReplyError(struct qemud_client *client,
|
||||
remote_error *rerr,
|
||||
remote_message_header *req) {
|
||||
/*
|
||||
* For data streams, errors are sent back as data streams
|
||||
* For method calls, errors are sent back as method replies
|
||||
*/
|
||||
return remoteSerializeError(client,
|
||||
rerr,
|
||||
req->prog,
|
||||
req->vers,
|
||||
req->proc,
|
||||
req->type == REMOTE_STREAM ? REMOTE_STREAM : REMOTE_REPLY,
|
||||
req->serial);
|
||||
}
|
||||
|
||||
int
|
||||
remoteSerializeStreamError(struct qemud_client *client,
|
||||
remote_error *rerr,
|
||||
int proc,
|
||||
int serial)
|
||||
{
|
||||
return remoteSerializeError(client,
|
||||
rerr,
|
||||
REMOTE_PROGRAM,
|
||||
REMOTE_PROTOCOL_VERSION,
|
||||
proc,
|
||||
REMOTE_STREAM,
|
||||
serial);
|
||||
}
|
||||
|
||||
/*
|
||||
* @msg: the complete incoming message, whose header to decode
|
||||
*
|
||||
* Decodes the header part of the client message, but does not
|
||||
* validate the decoded fields in the header. It expects
|
||||
* bufferLength to refer to length of the data packet. Upon
|
||||
* return bufferOffset will refer to the amount of the packet
|
||||
* consumed by decoding of the header.
|
||||
*
|
||||
* returns 0 if successfully decoded, -1 upon fatal error
|
||||
*/
|
||||
int
|
||||
remoteDecodeClientMessageHeader (struct qemud_client_message *msg)
|
||||
{
|
||||
XDR xdr;
|
||||
int ret = -1;
|
||||
|
||||
msg->bufferOffset = REMOTE_MESSAGE_HEADER_XDR_LEN;
|
||||
|
||||
/* Parse the header. */
|
||||
xdrmem_create (&xdr,
|
||||
msg->buffer + msg->bufferOffset,
|
||||
msg->bufferLength - msg->bufferOffset,
|
||||
XDR_DECODE);
|
||||
|
||||
if (!xdr_remote_message_header (&xdr, &msg->hdr))
|
||||
goto cleanup;
|
||||
|
||||
msg->bufferOffset += xdr_getpos(&xdr);
|
||||
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
xdr_destroy(&xdr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* @msg: the outgoing message, whose header to encode
|
||||
*
|
||||
* Encodes the header part of the client message, setting the
|
||||
* message offset ready to encode the payload. Leaves space
|
||||
* for the length field later. Upon return bufferLength will
|
||||
* refer to the total available space for message, while
|
||||
* bufferOffset will refer to current space used by header
|
||||
*
|
||||
* returns 0 if successfully encoded, -1 upon fatal error
|
||||
*/
|
||||
int
|
||||
remoteEncodeClientMessageHeader (struct qemud_client_message *msg)
|
||||
{
|
||||
XDR xdr;
|
||||
int ret = -1;
|
||||
unsigned int len = 0;
|
||||
|
||||
msg->bufferLength = sizeof(msg->buffer);
|
||||
msg->bufferOffset = 0;
|
||||
|
||||
/* Format the header. */
|
||||
xdrmem_create (&xdr,
|
||||
msg->buffer,
|
||||
msg->bufferLength,
|
||||
XDR_ENCODE);
|
||||
|
||||
/* The real value is filled in shortly */
|
||||
if (!xdr_u_int (&xdr, &len)) {
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!xdr_remote_message_header (&xdr, &msg->hdr))
|
||||
goto cleanup;
|
||||
|
||||
len = xdr_getpos(&xdr);
|
||||
xdr_setpos(&xdr, 0);
|
||||
|
||||
/* Fill in current length - may be re-written later
|
||||
* if a payload is added
|
||||
*/
|
||||
if (!xdr_u_int (&xdr, &len)) {
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
msg->bufferOffset += len;
|
||||
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
xdr_destroy(&xdr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
remoteDispatchClientCall (struct qemud_server *server,
|
||||
struct qemud_client *client,
|
||||
struct qemud_client_message *msg);
|
||||
|
||||
|
||||
/*
|
||||
* @server: the unlocked server object
|
||||
* @client: the locked client object
|
||||
* @msg: the complete incoming message packet, with header already decoded
|
||||
*
|
||||
* This function gets called from qemud when it pulls a incoming
|
||||
* remote protocol messsage off the dispatch queue for processing.
|
||||
*
|
||||
* The @msg parameter must have had its header decoded already by
|
||||
* calling remoteDecodeClientMessageHeader
|
||||
*
|
||||
* Returns 0 if the message was dispatched, -1 upon fatal error
|
||||
*/
|
||||
int
|
||||
remoteDispatchClientRequest (struct qemud_server *server,
|
||||
struct qemud_client *client,
|
||||
struct qemud_client_message *msg)
|
||||
{
|
||||
int ret;
|
||||
remote_error rerr;
|
||||
|
||||
DEBUG("prog=%d ver=%d type=%d satus=%d serial=%d proc=%d",
|
||||
msg->hdr.prog, msg->hdr.vers, msg->hdr.type,
|
||||
msg->hdr.status, msg->hdr.serial, msg->hdr.proc);
|
||||
|
||||
memset(&rerr, 0, sizeof rerr);
|
||||
|
||||
/* Check version, etc. */
|
||||
if (msg->hdr.prog != REMOTE_PROGRAM) {
|
||||
remoteDispatchFormatError (&rerr,
|
||||
_("program mismatch (actual %x, expected %x)"),
|
||||
msg->hdr.prog, REMOTE_PROGRAM);
|
||||
goto error;
|
||||
}
|
||||
if (msg->hdr.vers != REMOTE_PROTOCOL_VERSION) {
|
||||
remoteDispatchFormatError (&rerr,
|
||||
_("version mismatch (actual %x, expected %x)"),
|
||||
msg->hdr.vers, REMOTE_PROTOCOL_VERSION);
|
||||
goto error;
|
||||
}
|
||||
|
||||
switch (msg->hdr.type) {
|
||||
case REMOTE_CALL:
|
||||
return remoteDispatchClientCall(server, client, msg);
|
||||
|
||||
case REMOTE_STREAM:
|
||||
/* Since stream data is non-acked, async, we may continue to received
|
||||
* stream packets after we closed down a stream. Just drop & ignore
|
||||
* these.
|
||||
*/
|
||||
VIR_INFO("Ignoring unexpected stream data serial=%d proc=%d status=%d",
|
||||
msg->hdr.serial, msg->hdr.proc, msg->hdr.status);
|
||||
qemudClientMessageRelease(client, msg);
|
||||
break;
|
||||
|
||||
default:
|
||||
remoteDispatchFormatError (&rerr, _("type (%d) != REMOTE_CALL"),
|
||||
(int) msg->hdr.type);
|
||||
goto error;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
error:
|
||||
ret = remoteSerializeReplyError(client, &rerr, &msg->hdr);
|
||||
|
||||
if (ret >= 0)
|
||||
VIR_FREE(msg);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* @server: the unlocked server object
|
||||
* @client: the locked client object
|
||||
* @msg: the complete incoming method call, with header already decoded
|
||||
*
|
||||
* This method is used to dispatch an message representing an
|
||||
* incoming method call from a client. It decodes the payload
|
||||
* to obtain method call arguments, invokves the method and
|
||||
* then sends a reply packet with the return values
|
||||
*
|
||||
* Returns 0 if the reply was sent, or -1 upon fatal error
|
||||
*/
|
||||
int
|
||||
remoteDispatchClientCall (struct qemud_server *server,
|
||||
struct qemud_client *client,
|
||||
struct qemud_client_message *msg)
|
||||
{
|
||||
XDR xdr;
|
||||
remote_error rerr;
|
||||
dispatch_args args;
|
||||
dispatch_ret ret;
|
||||
const dispatch_data *data = NULL;
|
||||
int rv = -1;
|
||||
unsigned int len;
|
||||
virConnectPtr conn = NULL;
|
||||
|
||||
memset(&args, 0, sizeof args);
|
||||
memset(&ret, 0, sizeof ret);
|
||||
memset(&rerr, 0, sizeof rerr);
|
||||
|
||||
if (msg->hdr.status != REMOTE_OK) {
|
||||
remoteDispatchFormatError (&rerr, _("status (%d) != REMOTE_OK"),
|
||||
(int) msg->hdr.status);
|
||||
goto rpc_error;
|
||||
}
|
||||
|
||||
/* If client is marked as needing auth, don't allow any RPC ops,
|
||||
* except for authentication ones
|
||||
*/
|
||||
if (client->auth) {
|
||||
if (msg->hdr.proc != REMOTE_PROC_AUTH_LIST &&
|
||||
msg->hdr.proc != REMOTE_PROC_AUTH_SASL_INIT &&
|
||||
msg->hdr.proc != REMOTE_PROC_AUTH_SASL_START &&
|
||||
msg->hdr.proc != REMOTE_PROC_AUTH_SASL_STEP &&
|
||||
msg->hdr.proc != REMOTE_PROC_AUTH_POLKIT
|
||||
) {
|
||||
/* Explicitly *NOT* calling remoteDispatchAuthError() because
|
||||
we want back-compatability with libvirt clients which don't
|
||||
support the VIR_ERR_AUTH_FAILED error code */
|
||||
remoteDispatchFormatError (&rerr, "%s", _("authentication required"));
|
||||
goto rpc_error;
|
||||
}
|
||||
}
|
||||
|
||||
data = remoteGetDispatchData(msg->hdr.proc);
|
||||
|
||||
if (!data) {
|
||||
remoteDispatchFormatError (&rerr, _("unknown procedure: %d"),
|
||||
msg->hdr.proc);
|
||||
goto rpc_error;
|
||||
}
|
||||
|
||||
/* De-serialize payload with args from the wire message */
|
||||
xdrmem_create (&xdr,
|
||||
msg->buffer + msg->bufferOffset,
|
||||
msg->bufferLength - msg->bufferOffset,
|
||||
XDR_DECODE);
|
||||
if (!((data->args_filter)(&xdr, &args))) {
|
||||
xdr_destroy (&xdr);
|
||||
remoteDispatchFormatError (&rerr, "%s", _("parse args failed"));
|
||||
goto rpc_error;
|
||||
}
|
||||
xdr_destroy (&xdr);
|
||||
|
||||
/* Call function. */
|
||||
conn = client->conn;
|
||||
virMutexUnlock(&client->lock);
|
||||
|
||||
/*
|
||||
* When the RPC handler is called:
|
||||
*
|
||||
* - Server object is unlocked
|
||||
* - Client object is unlocked
|
||||
*
|
||||
* Without locking, it is safe to use:
|
||||
*
|
||||
* 'conn', 'rerr', 'args and 'ret'
|
||||
*/
|
||||
rv = (data->fn)(server, client, conn, &msg->hdr, &rerr, &args, &ret);
|
||||
|
||||
virMutexLock(&server->lock);
|
||||
virMutexLock(&client->lock);
|
||||
virMutexUnlock(&server->lock);
|
||||
|
||||
xdr_free (data->args_filter, (char*)&args);
|
||||
|
||||
if (rv < 0)
|
||||
goto rpc_error;
|
||||
|
||||
/* Return header. We're re-using same message object, so
|
||||
* only need to tweak type/status fields */
|
||||
/*msg->hdr.prog = msg->hdr.prog;*/
|
||||
/*msg->hdr.vers = msg->hdr.vers;*/
|
||||
/*msg->hdr.proc = msg->hdr.proc;*/
|
||||
msg->hdr.type = REMOTE_REPLY;
|
||||
/*msg->hdr.serial = msg->hdr.serial;*/
|
||||
msg->hdr.status = REMOTE_OK;
|
||||
|
||||
if (remoteEncodeClientMessageHeader(msg) < 0) {
|
||||
xdr_free (data->ret_filter, (char*)&ret);
|
||||
goto fatal_error;
|
||||
}
|
||||
|
||||
|
||||
/* Now for the payload */
|
||||
xdrmem_create (&xdr,
|
||||
msg->buffer,
|
||||
msg->bufferLength,
|
||||
XDR_ENCODE);
|
||||
|
||||
if (xdr_setpos(&xdr, msg->bufferOffset) == 0)
|
||||
goto xdr_error;
|
||||
|
||||
/* If OK, serialise return structure, if error serialise error. */
|
||||
/* Serialise reply data */
|
||||
if (!((data->ret_filter) (&xdr, &ret)))
|
||||
goto xdr_error;
|
||||
|
||||
/* Update the length word. */
|
||||
msg->bufferOffset += xdr_getpos (&xdr);
|
||||
len = msg->bufferOffset;
|
||||
if (xdr_setpos (&xdr, 0) == 0)
|
||||
goto xdr_error;
|
||||
|
||||
if (!xdr_u_int (&xdr, &len))
|
||||
goto xdr_error;
|
||||
|
||||
xdr_destroy (&xdr);
|
||||
xdr_free (data->ret_filter, (char*)&ret);
|
||||
|
||||
/* Reset ready for I/O */
|
||||
msg->bufferLength = len;
|
||||
msg->bufferOffset = 0;
|
||||
|
||||
/* Put reply on end of tx queue to send out */
|
||||
qemudClientMessageQueuePush(&client->tx, msg);
|
||||
qemudUpdateClientEvent(client);
|
||||
|
||||
return 0;
|
||||
|
||||
rpc_error:
|
||||
/* Semi-bad stuff happened, we can still try to send back
|
||||
* an RPC error message to client */
|
||||
rv = remoteSerializeReplyError(client, &rerr, &msg->hdr);
|
||||
|
||||
if (rv >= 0)
|
||||
VIR_FREE(msg);
|
||||
|
||||
return rv;
|
||||
|
||||
xdr_error:
|
||||
/* Seriously bad stuff happened, so we'll kill off this client
|
||||
and not send back any RPC error */
|
||||
xdr_free (data->ret_filter, (char*)&ret);
|
||||
xdr_destroy (&xdr);
|
||||
fatal_error:
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
remoteSendStreamData(struct qemud_client *client,
|
||||
struct qemud_client_stream *stream,
|
||||
const char *data,
|
||||
unsigned int len)
|
||||
{
|
||||
struct qemud_client_message *msg;
|
||||
XDR xdr;
|
||||
|
||||
DEBUG("client=%p stream=%p data=%p len=%d", client, stream, data, len);
|
||||
|
||||
if (VIR_ALLOC(msg) < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Return header. We're re-using same message object, so
|
||||
* only need to tweak type/status fields */
|
||||
msg->hdr.prog = REMOTE_PROGRAM;
|
||||
msg->hdr.vers = REMOTE_PROTOCOL_VERSION;
|
||||
msg->hdr.proc = stream->procedure;
|
||||
msg->hdr.type = REMOTE_STREAM;
|
||||
msg->hdr.serial = stream->serial;
|
||||
/*
|
||||
* NB
|
||||
* data != NULL + len > 0 => REMOTE_CONTINUE (Sending back data)
|
||||
* data != NULL + len == 0 => REMOTE_CONTINUE (Sending read EOF)
|
||||
* data == NULL => REMOTE_OK (Sending finish handshake confirmation)
|
||||
*/
|
||||
msg->hdr.status = data ? REMOTE_CONTINUE : REMOTE_OK;
|
||||
|
||||
if (remoteEncodeClientMessageHeader(msg) < 0)
|
||||
goto fatal_error;
|
||||
|
||||
if (data && len) {
|
||||
if ((msg->bufferLength - msg->bufferOffset) < len)
|
||||
goto fatal_error;
|
||||
|
||||
/* Now for the payload */
|
||||
xdrmem_create (&xdr,
|
||||
msg->buffer,
|
||||
msg->bufferLength,
|
||||
XDR_ENCODE);
|
||||
|
||||
/* Skip over existing header already written */
|
||||
if (xdr_setpos(&xdr, msg->bufferOffset) == 0)
|
||||
goto xdr_error;
|
||||
|
||||
memcpy(msg->buffer + msg->bufferOffset, data, len);
|
||||
msg->bufferOffset += len;
|
||||
|
||||
/* Update the length word. */
|
||||
len = msg->bufferOffset;
|
||||
if (xdr_setpos (&xdr, 0) == 0)
|
||||
goto xdr_error;
|
||||
|
||||
if (!xdr_u_int (&xdr, &len))
|
||||
goto xdr_error;
|
||||
|
||||
xdr_destroy (&xdr);
|
||||
|
||||
DEBUG("Total %d", msg->bufferOffset);
|
||||
}
|
||||
if (data)
|
||||
msg->streamTX = 1;
|
||||
|
||||
/* Reset ready for I/O */
|
||||
msg->bufferLength = msg->bufferOffset;
|
||||
msg->bufferOffset = 0;
|
||||
|
||||
/* Put reply on end of tx queue to send out */
|
||||
qemudClientMessageQueuePush(&client->tx, msg);
|
||||
qemudUpdateClientEvent(client);
|
||||
|
||||
return 0;
|
||||
|
||||
xdr_error:
|
||||
xdr_destroy (&xdr);
|
||||
fatal_error:
|
||||
VIR_FREE(msg);
|
||||
return -1;
|
||||
}
|
80
daemon/dispatch.h
Normal file
80
daemon/dispatch.h
Normal file
@ -0,0 +1,80 @@
|
||||
/*
|
||||
* dispatch.h: RPC message dispatching infrastructure
|
||||
*
|
||||
* Copyright (C) 2007, 2008, 2009 Red Hat, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* Author: Richard W.M. Jones <rjones@redhat.com>
|
||||
* Author: Daniel P. Berrange <berrange@redhat.com>
|
||||
*/
|
||||
|
||||
#ifndef __LIBVIRTD_DISPATCH_H__
|
||||
#define __LIBVIRTD_DISPATCH_H__
|
||||
|
||||
|
||||
#include "libvirtd.h"
|
||||
|
||||
|
||||
int
|
||||
remoteDecodeClientMessageHeader (struct qemud_client_message *req);
|
||||
int
|
||||
remoteEncodeClientMessageHeader (struct qemud_client_message *req);
|
||||
|
||||
int
|
||||
remoteDispatchClientRequest (struct qemud_server *server,
|
||||
struct qemud_client *client,
|
||||
struct qemud_client_message *req);
|
||||
|
||||
|
||||
void remoteDispatchFormatError (remote_error *rerr,
|
||||
const char *fmt, ...)
|
||||
ATTRIBUTE_FMT_PRINTF(2, 3);
|
||||
|
||||
void remoteDispatchAuthError (remote_error *rerr);
|
||||
void remoteDispatchGenericError (remote_error *rerr);
|
||||
void remoteDispatchOOMError (remote_error *rerr);
|
||||
void remoteDispatchConnError (remote_error *rerr,
|
||||
virConnectPtr conn);
|
||||
|
||||
|
||||
int
|
||||
remoteSerializeReplyError(struct qemud_client *client,
|
||||
remote_error *rerr,
|
||||
remote_message_header *req);
|
||||
int
|
||||
remoteSerializeStreamError(struct qemud_client *client,
|
||||
remote_error *rerr,
|
||||
int proc,
|
||||
int serial);
|
||||
|
||||
/* Having this here is dubious. It should be in remote.h
|
||||
* but qemud.c shouldn't depend on that header directly.
|
||||
* Refactor this later to deal with this properly.
|
||||
*/
|
||||
int remoteRelayDomainEvent (virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||
virDomainPtr dom,
|
||||
int event,
|
||||
int detail,
|
||||
void *opaque);
|
||||
|
||||
|
||||
int
|
||||
remoteSendStreamData(struct qemud_client *client,
|
||||
struct qemud_client_stream *stream,
|
||||
const char *data,
|
||||
unsigned int len);
|
||||
|
||||
#endif /* __LIBVIRTD_DISPATCH_H__ */
|
@ -30,7 +30,8 @@
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "qemud.h"
|
||||
#include "threads.h"
|
||||
#include "logging.h"
|
||||
#include "event.h"
|
||||
#include "memory.h"
|
||||
#include "util.h"
|
||||
@ -83,10 +84,10 @@ struct virEventLoop {
|
||||
static struct virEventLoop eventLoop;
|
||||
|
||||
/* Unique ID for the next FD watch to be registered */
|
||||
static int nextWatch = 0;
|
||||
static int nextWatch = 1;
|
||||
|
||||
/* Unique ID for the next timer to be registered */
|
||||
static int nextTimer = 0;
|
||||
static int nextTimer = 1;
|
||||
|
||||
static void virEventLock(void)
|
||||
{
|
||||
@ -108,7 +109,7 @@ int virEventAddHandleImpl(int fd, int events,
|
||||
void *opaque,
|
||||
virFreeCallback ff) {
|
||||
int watch;
|
||||
EVENT_DEBUG("Add handle %d %d %p %p", fd, events, cb, opaque);
|
||||
EVENT_DEBUG("Add handle fd=%d events=%d cb=%p opaque=%p", fd, events, cb, opaque);
|
||||
virEventLock();
|
||||
if (eventLoop.handlesCount == eventLoop.handlesAlloc) {
|
||||
EVENT_DEBUG("Used %d handle slots, adding %d more",
|
||||
@ -142,15 +143,22 @@ int virEventAddHandleImpl(int fd, int events,
|
||||
|
||||
void virEventUpdateHandleImpl(int watch, int events) {
|
||||
int i;
|
||||
EVENT_DEBUG("Update handle w=%d e=%d", watch, events);
|
||||
|
||||
if (watch <= 0) {
|
||||
VIR_WARN("Ignoring invalid update watch %d", watch);
|
||||
return;
|
||||
}
|
||||
|
||||
virEventLock();
|
||||
for (i = 0 ; i < eventLoop.handlesCount ; i++) {
|
||||
if (eventLoop.handles[i].watch == watch) {
|
||||
eventLoop.handles[i].events =
|
||||
virEventHandleTypeToPollEvent(events);
|
||||
virEventInterruptLocked();
|
||||
break;
|
||||
}
|
||||
}
|
||||
virEventInterruptLocked();
|
||||
virEventUnlock();
|
||||
}
|
||||
|
||||
@ -162,7 +170,13 @@ void virEventUpdateHandleImpl(int watch, int events) {
|
||||
*/
|
||||
int virEventRemoveHandleImpl(int watch) {
|
||||
int i;
|
||||
EVENT_DEBUG("Remove handle %d", watch);
|
||||
EVENT_DEBUG("Remove handle w=%d", watch);
|
||||
|
||||
if (watch <= 0) {
|
||||
VIR_WARN("Ignoring invalid remove watch %d", watch);
|
||||
return -1;
|
||||
}
|
||||
|
||||
virEventLock();
|
||||
for (i = 0 ; i < eventLoop.handlesCount ; i++) {
|
||||
if (eventLoop.handles[i].deleted)
|
||||
@ -171,11 +185,11 @@ int virEventRemoveHandleImpl(int watch) {
|
||||
if (eventLoop.handles[i].watch == watch) {
|
||||
EVENT_DEBUG("mark delete %d %d", i, eventLoop.handles[i].fd);
|
||||
eventLoop.handles[i].deleted = 1;
|
||||
virEventInterruptLocked();
|
||||
virEventUnlock();
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
virEventInterruptLocked();
|
||||
virEventUnlock();
|
||||
return -1;
|
||||
}
|
||||
@ -231,6 +245,12 @@ void virEventUpdateTimeoutImpl(int timer, int frequency) {
|
||||
struct timeval tv;
|
||||
int i;
|
||||
EVENT_DEBUG("Updating timer %d timeout with %d ms freq", timer, frequency);
|
||||
|
||||
if (timer <= 0) {
|
||||
VIR_WARN("Ignoring invalid update timer %d", timer);
|
||||
return;
|
||||
}
|
||||
|
||||
if (gettimeofday(&tv, NULL) < 0) {
|
||||
return;
|
||||
}
|
||||
@ -243,10 +263,10 @@ void virEventUpdateTimeoutImpl(int timer, int frequency) {
|
||||
frequency >= 0 ? frequency +
|
||||
(((unsigned long long)tv.tv_sec)*1000) +
|
||||
(((unsigned long long)tv.tv_usec)/1000) : 0;
|
||||
virEventInterruptLocked();
|
||||
break;
|
||||
}
|
||||
}
|
||||
virEventInterruptLocked();
|
||||
virEventUnlock();
|
||||
}
|
||||
|
||||
@ -259,6 +279,12 @@ void virEventUpdateTimeoutImpl(int timer, int frequency) {
|
||||
int virEventRemoveTimeoutImpl(int timer) {
|
||||
int i;
|
||||
EVENT_DEBUG("Remove timer %d", timer);
|
||||
|
||||
if (timer <= 0) {
|
||||
VIR_WARN("Ignoring invalid remove timer %d", timer);
|
||||
return -1;
|
||||
}
|
||||
|
||||
virEventLock();
|
||||
for (i = 0 ; i < eventLoop.timeoutsCount ; i++) {
|
||||
if (eventLoop.timeouts[i].deleted)
|
||||
@ -266,11 +292,11 @@ int virEventRemoveTimeoutImpl(int timer) {
|
||||
|
||||
if (eventLoop.timeouts[i].timer == timer) {
|
||||
eventLoop.timeouts[i].deleted = 1;
|
||||
virEventInterruptLocked();
|
||||
virEventUnlock();
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
virEventInterruptLocked();
|
||||
virEventUnlock();
|
||||
return -1;
|
||||
}
|
||||
@ -287,7 +313,7 @@ static int virEventCalculateTimeout(int *timeout) {
|
||||
EVENT_DEBUG("Calculate expiry of %d timers", eventLoop.timeoutsCount);
|
||||
/* Figure out if we need a timeout */
|
||||
for (i = 0 ; i < eventLoop.timeoutsCount ; i++) {
|
||||
if (eventLoop.timeouts[i].deleted || eventLoop.timeouts[i].frequency < 0)
|
||||
if (eventLoop.timeouts[i].frequency < 0)
|
||||
continue;
|
||||
|
||||
EVENT_DEBUG("Got a timeout scheduled for %llu", eventLoop.timeouts[i].expiresAt);
|
||||
@ -324,32 +350,36 @@ static int virEventCalculateTimeout(int *timeout) {
|
||||
* file handles. The caller must free the returned data struct
|
||||
* returns: the pollfd array, or NULL on error
|
||||
*/
|
||||
static int virEventMakePollFDs(struct pollfd **retfds) {
|
||||
static struct pollfd *virEventMakePollFDs(int *nfds) {
|
||||
struct pollfd *fds;
|
||||
int i, nfds = 0;
|
||||
int i;
|
||||
|
||||
*nfds = 0;
|
||||
for (i = 0 ; i < eventLoop.handlesCount ; i++) {
|
||||
if (eventLoop.handles[i].deleted)
|
||||
continue;
|
||||
nfds++;
|
||||
if (eventLoop.handles[i].events)
|
||||
(*nfds)++;
|
||||
}
|
||||
*retfds = NULL;
|
||||
|
||||
/* Setup the poll file handle data structs */
|
||||
if (VIR_ALLOC_N(fds, nfds) < 0)
|
||||
return -1;
|
||||
if (VIR_ALLOC_N(fds, *nfds) < 0)
|
||||
return NULL;
|
||||
|
||||
for (i = 0, nfds = 0 ; i < eventLoop.handlesCount ; i++) {
|
||||
if (eventLoop.handles[i].deleted)
|
||||
*nfds = 0;
|
||||
for (i = 0 ; i < eventLoop.handlesCount ; i++) {
|
||||
EVENT_DEBUG("Prepare n=%d w=%d, f=%d e=%d", i,
|
||||
eventLoop.handles[i].watch,
|
||||
eventLoop.handles[i].fd,
|
||||
eventLoop.handles[i].events);
|
||||
if (!eventLoop.handles[i].events)
|
||||
continue;
|
||||
fds[nfds].fd = eventLoop.handles[i].fd;
|
||||
fds[nfds].events = eventLoop.handles[i].events;
|
||||
fds[nfds].revents = 0;
|
||||
fds[*nfds].fd = eventLoop.handles[i].fd;
|
||||
fds[*nfds].events = eventLoop.handles[i].events;
|
||||
fds[*nfds].revents = 0;
|
||||
(*nfds)++;
|
||||
//EVENT_DEBUG("Wait for %d %d", eventLoop.handles[i].fd, eventLoop.handles[i].events);
|
||||
nfds++;
|
||||
}
|
||||
|
||||
*retfds = fds;
|
||||
return nfds;
|
||||
return fds;
|
||||
}
|
||||
|
||||
|
||||
@ -371,6 +401,7 @@ static int virEventDispatchTimeouts(void) {
|
||||
int i;
|
||||
/* Save this now - it may be changed during dispatch */
|
||||
int ntimeouts = eventLoop.timeoutsCount;
|
||||
DEBUG("Dispatch %d", ntimeouts);
|
||||
|
||||
if (gettimeofday(&tv, NULL) < 0) {
|
||||
return -1;
|
||||
@ -410,10 +441,24 @@ static int virEventDispatchTimeouts(void) {
|
||||
*/
|
||||
static int virEventDispatchHandles(int nfds, struct pollfd *fds) {
|
||||
int i, n;
|
||||
DEBUG("Dispatch %d", nfds);
|
||||
|
||||
for (i = 0, n = 0 ; i < eventLoop.handlesCount && n < nfds ; i++) {
|
||||
/* NB, use nfds not eventLoop.handlesCount, because new
|
||||
* fds might be added on end of list, and they're not
|
||||
* in the fds array we've got */
|
||||
for (i = 0, n = 0 ; n < nfds && i < eventLoop.handlesCount ; n++) {
|
||||
while ((eventLoop.handles[i].fd != fds[n].fd ||
|
||||
eventLoop.handles[i].events == 0) &&
|
||||
i < eventLoop.handlesCount) {
|
||||
i++;
|
||||
}
|
||||
if (i == eventLoop.handlesCount)
|
||||
break;
|
||||
|
||||
DEBUG("i=%d w=%d", i, eventLoop.handles[i].watch);
|
||||
if (eventLoop.handles[i].deleted) {
|
||||
EVENT_DEBUG("Skip deleted %d", eventLoop.handles[i].fd);
|
||||
EVENT_DEBUG("Skip deleted n=%d w=%d f=%d", i,
|
||||
eventLoop.handles[i].watch, eventLoop.handles[i].fd);
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -421,14 +466,14 @@ static int virEventDispatchHandles(int nfds, struct pollfd *fds) {
|
||||
virEventHandleCallback cb = eventLoop.handles[i].cb;
|
||||
void *opaque = eventLoop.handles[i].opaque;
|
||||
int hEvents = virPollEventToEventHandleType(fds[n].revents);
|
||||
EVENT_DEBUG("Dispatch %d %d %p", fds[n].fd,
|
||||
EVENT_DEBUG("Dispatch n=%d f=%d w=%d e=%d %p", i,
|
||||
fds[n].fd, eventLoop.handles[i].watch,
|
||||
fds[n].revents, eventLoop.handles[i].opaque);
|
||||
virEventUnlock();
|
||||
(cb)(eventLoop.handles[i].watch,
|
||||
fds[n].fd, hEvents, opaque);
|
||||
virEventLock();
|
||||
}
|
||||
n++;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@ -441,6 +486,7 @@ static int virEventDispatchHandles(int nfds, struct pollfd *fds) {
|
||||
*/
|
||||
static int virEventCleanupTimeouts(void) {
|
||||
int i;
|
||||
DEBUG("Cleanup %d", eventLoop.timeoutsCount);
|
||||
|
||||
/* Remove deleted entries, shuffling down remaining
|
||||
* entries as needed to form contiguous series
|
||||
@ -481,6 +527,7 @@ static int virEventCleanupTimeouts(void) {
|
||||
*/
|
||||
static int virEventCleanupHandles(void) {
|
||||
int i;
|
||||
DEBUG("Cleanupo %d", eventLoop.handlesCount);
|
||||
|
||||
/* Remove deleted entries, shuffling down remaining
|
||||
* entries as needed to form contiguous series
|
||||
@ -519,22 +566,20 @@ static int virEventCleanupHandles(void) {
|
||||
* at least one file handle has an event, or a timer expires
|
||||
*/
|
||||
int virEventRunOnce(void) {
|
||||
struct pollfd *fds;
|
||||
struct pollfd *fds = NULL;
|
||||
int ret, timeout, nfds;
|
||||
|
||||
virEventLock();
|
||||
eventLoop.running = 1;
|
||||
eventLoop.leader = pthread_self();
|
||||
if ((nfds = virEventMakePollFDs(&fds)) < 0) {
|
||||
virEventUnlock();
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (virEventCalculateTimeout(&timeout) < 0) {
|
||||
VIR_FREE(fds);
|
||||
virEventUnlock();
|
||||
return -1;
|
||||
}
|
||||
if (virEventCleanupTimeouts() < 0 ||
|
||||
virEventCleanupHandles() < 0)
|
||||
goto error;
|
||||
|
||||
if (!(fds = virEventMakePollFDs(&nfds)) ||
|
||||
virEventCalculateTimeout(&timeout) < 0)
|
||||
goto error;
|
||||
|
||||
virEventUnlock();
|
||||
|
||||
@ -546,38 +591,31 @@ int virEventRunOnce(void) {
|
||||
if (errno == EINTR) {
|
||||
goto retry;
|
||||
}
|
||||
VIR_FREE(fds);
|
||||
return -1;
|
||||
goto error_unlocked;
|
||||
}
|
||||
|
||||
virEventLock();
|
||||
if (virEventDispatchTimeouts() < 0) {
|
||||
VIR_FREE(fds);
|
||||
virEventUnlock();
|
||||
return -1;
|
||||
}
|
||||
if (virEventDispatchTimeouts() < 0)
|
||||
goto error;
|
||||
|
||||
if (ret > 0 &&
|
||||
virEventDispatchHandles(nfds, fds) < 0) {
|
||||
VIR_FREE(fds);
|
||||
virEventUnlock();
|
||||
return -1;
|
||||
}
|
||||
VIR_FREE(fds);
|
||||
virEventDispatchHandles(nfds, fds) < 0)
|
||||
goto error;
|
||||
|
||||
if (virEventCleanupTimeouts() < 0) {
|
||||
virEventUnlock();
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (virEventCleanupHandles() < 0) {
|
||||
virEventUnlock();
|
||||
return -1;
|
||||
}
|
||||
if (virEventCleanupTimeouts() < 0 ||
|
||||
virEventCleanupHandles() < 0)
|
||||
goto error;
|
||||
|
||||
eventLoop.running = 0;
|
||||
virEventUnlock();
|
||||
VIR_FREE(fds);
|
||||
return 0;
|
||||
|
||||
error:
|
||||
virEventUnlock();
|
||||
error_unlocked:
|
||||
VIR_FREE(fds);
|
||||
return -1;
|
||||
}
|
||||
|
||||
static void virEventHandleWakeup(int watch ATTRIBUTE_UNUSED,
|
||||
@ -597,10 +635,10 @@ int virEventInit(void)
|
||||
return -1;
|
||||
|
||||
if (pipe(eventLoop.wakeupfd) < 0 ||
|
||||
qemudSetNonBlock(eventLoop.wakeupfd[0]) < 0 ||
|
||||
qemudSetNonBlock(eventLoop.wakeupfd[1]) < 0 ||
|
||||
qemudSetCloseExec(eventLoop.wakeupfd[0]) < 0 ||
|
||||
qemudSetCloseExec(eventLoop.wakeupfd[1]) < 0)
|
||||
virSetNonBlock(eventLoop.wakeupfd[0]) < 0 ||
|
||||
virSetNonBlock(eventLoop.wakeupfd[1]) < 0 ||
|
||||
virSetCloseExec(eventLoop.wakeupfd[0]) < 0 ||
|
||||
virSetCloseExec(eventLoop.wakeupfd[1]) < 0)
|
||||
return -1;
|
||||
|
||||
if (virEventAddHandleImpl(eventLoop.wakeupfd[0],
|
||||
@ -616,9 +654,12 @@ static int virEventInterruptLocked(void)
|
||||
char c = '\0';
|
||||
|
||||
if (!eventLoop.running ||
|
||||
pthread_self() == eventLoop.leader)
|
||||
pthread_self() == eventLoop.leader) {
|
||||
VIR_DEBUG("Skip interrupt, %d %d", eventLoop.running, (int)eventLoop.leader);
|
||||
return 0;
|
||||
}
|
||||
|
||||
VIR_DEBUG0("Interrupting");
|
||||
if (safewrite(eventLoop.wakeupfd[1], &c, sizeof(c)) != sizeof(c))
|
||||
return -1;
|
||||
return 0;
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* qemud.c: daemon start of day, guest process & i/o management
|
||||
* libvirtd.c: daemon start of day, guest process & i/o management
|
||||
*
|
||||
* Copyright (C) 2006, 2007, 2008, 2009 Red Hat, Inc.
|
||||
* Copyright (C) 2006 Daniel P. Berrange
|
||||
@ -53,12 +53,15 @@
|
||||
|
||||
#define VIR_FROM_THIS VIR_FROM_QEMU
|
||||
|
||||
#include "qemud.h"
|
||||
#include "libvirtd.h"
|
||||
#include "dispatch.h"
|
||||
|
||||
#include "util.h"
|
||||
#include "remote_internal.h"
|
||||
#include "remote_driver.h"
|
||||
#include "conf.h"
|
||||
#include "event.h"
|
||||
#include "memory.h"
|
||||
#include "stream.h"
|
||||
#ifdef HAVE_AVAHI
|
||||
#include "mdns.h"
|
||||
#endif
|
||||
@ -67,23 +70,30 @@
|
||||
#include "driver.h"
|
||||
#else
|
||||
#ifdef WITH_QEMU
|
||||
#include "qemu_driver.h"
|
||||
#include "qemu/qemu_driver.h"
|
||||
#endif
|
||||
#ifdef WITH_LXC
|
||||
#include "lxc_driver.h"
|
||||
#include "lxc/lxc_driver.h"
|
||||
#endif
|
||||
#ifdef WITH_UML
|
||||
#include "uml_driver.h"
|
||||
#include "uml/uml_driver.h"
|
||||
#endif
|
||||
#ifdef WITH_ONE
|
||||
#include "opennebula/one_driver.h"
|
||||
#endif
|
||||
#ifdef WITH_NETWORK
|
||||
#include "network_driver.h"
|
||||
#include "network/bridge_driver.h"
|
||||
#endif
|
||||
#ifdef WITH_NETCF
|
||||
#include "interface/netcf_driver.h"
|
||||
#endif
|
||||
#ifdef WITH_STORAGE_DIR
|
||||
#include "storage_driver.h"
|
||||
#include "storage/storage_driver.h"
|
||||
#endif
|
||||
#ifdef WITH_NODE_DEVICES
|
||||
#include "node_device.h"
|
||||
#include "node_device/node_device_driver.h"
|
||||
#endif
|
||||
#include "secret/secret_driver.h"
|
||||
#endif
|
||||
|
||||
|
||||
@ -112,8 +122,6 @@ static int unix_sock_ro_mask = 0666;
|
||||
|
||||
#else
|
||||
|
||||
#define SYSTEM_UID 0
|
||||
|
||||
static gid_t unix_sock_gid = 0; /* Only root by default */
|
||||
static int unix_sock_rw_mask = 0700; /* Allow user only */
|
||||
static int unix_sock_ro_mask = 0777; /* Allow world */
|
||||
@ -126,11 +134,6 @@ static int timeout = -1; /* -t: Shutdown timeout */
|
||||
static int sigwrite = -1; /* Signal handler pipe */
|
||||
static int ipsock = 0; /* -l Listen for TCP/IP */
|
||||
|
||||
/* Defaults for logging */
|
||||
static int log_level = 3;
|
||||
static char *log_filters = NULL;
|
||||
static char *log_outputs = NULL;
|
||||
|
||||
/* Defaults for configuration file elements */
|
||||
static int listen_tls = 1;
|
||||
static int listen_tcp = 0;
|
||||
@ -218,7 +221,7 @@ qemudClientMessageQueuePush(struct qemud_client_message **queue,
|
||||
}
|
||||
}
|
||||
|
||||
static struct qemud_client_message *
|
||||
struct qemud_client_message *
|
||||
qemudClientMessageQueueServe(struct qemud_client_message **queue)
|
||||
{
|
||||
struct qemud_client_message *tmp = *queue;
|
||||
@ -371,32 +374,6 @@ qemudDispatchSignalEvent(int watch ATTRIBUTE_UNUSED,
|
||||
virMutexUnlock(&server->lock);
|
||||
}
|
||||
|
||||
int qemudSetCloseExec(int fd) {
|
||||
int flags;
|
||||
if ((flags = fcntl(fd, F_GETFD)) < 0)
|
||||
goto error;
|
||||
flags |= FD_CLOEXEC;
|
||||
if ((fcntl(fd, F_SETFD, flags)) < 0)
|
||||
goto error;
|
||||
return 0;
|
||||
error:
|
||||
VIR_ERROR0(_("Failed to set close-on-exec file descriptor flag"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
int qemudSetNonBlock(int fd) {
|
||||
int flags;
|
||||
if ((flags = fcntl(fd, F_GETFL)) < 0)
|
||||
goto error;
|
||||
flags |= O_NONBLOCK;
|
||||
if ((fcntl(fd, F_SETFL, flags)) < 0)
|
||||
goto error;
|
||||
return 0;
|
||||
error:
|
||||
VIR_ERROR0(_("Failed to set non-blocking file descriptor flag"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int qemudGoDaemon(void) {
|
||||
int pid = fork();
|
||||
@ -525,20 +502,22 @@ static int qemudListenUnix(struct qemud_server *server,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (qemudSetCloseExec(sock->fd) < 0 ||
|
||||
qemudSetNonBlock(sock->fd) < 0)
|
||||
if (virSetCloseExec(sock->fd) < 0 ||
|
||||
virSetNonBlock(sock->fd) < 0)
|
||||
goto cleanup;
|
||||
|
||||
memset(&addr, 0, sizeof(addr));
|
||||
addr.sun_family = AF_UNIX;
|
||||
strncpy(addr.sun_path, path, sizeof(addr.sun_path)-1);
|
||||
if (virStrcpyStatic(addr.sun_path, path) == NULL) {
|
||||
VIR_ERROR(_("Path %s too long for unix socket"), path);
|
||||
goto cleanup;
|
||||
}
|
||||
if (addr.sun_path[0] == '@')
|
||||
addr.sun_path[0] = '\0';
|
||||
|
||||
|
||||
oldgrp = getgid();
|
||||
oldmask = umask(readonly ? ~unix_sock_ro_mask : ~unix_sock_rw_mask);
|
||||
if (getuid() == 0)
|
||||
if (server->privileged)
|
||||
setgid(unix_sock_gid);
|
||||
|
||||
if (bind(sock->fd, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
|
||||
@ -547,7 +526,7 @@ static int qemudListenUnix(struct qemud_server *server,
|
||||
goto cleanup;
|
||||
}
|
||||
umask(oldmask);
|
||||
if (getuid() == 0)
|
||||
if (server->privileged)
|
||||
setgid(oldgrp);
|
||||
|
||||
if (listen(sock->fd, 30) < 0) {
|
||||
@ -687,8 +666,8 @@ remoteListenTCP (struct qemud_server *server,
|
||||
else
|
||||
sock->port = -1;
|
||||
|
||||
if (qemudSetCloseExec(sock->fd) < 0 ||
|
||||
qemudSetNonBlock(sock->fd) < 0)
|
||||
if (virSetCloseExec(sock->fd) < 0 ||
|
||||
virSetNonBlock(sock->fd) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (listen (sock->fd, 30) < 0) {
|
||||
@ -722,7 +701,6 @@ static int qemudInitPaths(struct qemud_server *server,
|
||||
char *roSockname,
|
||||
int maxlen)
|
||||
{
|
||||
uid_t uid = geteuid();
|
||||
char *sock_dir;
|
||||
char *dir_prefix = NULL;
|
||||
int ret = -1;
|
||||
@ -732,7 +710,7 @@ static int qemudInitPaths(struct qemud_server *server,
|
||||
sock_dir = unix_sock_dir;
|
||||
else {
|
||||
sock_dir = sockname;
|
||||
if (uid == SYSTEM_UID) {
|
||||
if (server->privileged) {
|
||||
dir_prefix = strdup (LOCAL_STATE_DIR);
|
||||
if (dir_prefix == NULL) {
|
||||
virReportOOMError(NULL);
|
||||
@ -742,6 +720,7 @@ static int qemudInitPaths(struct qemud_server *server,
|
||||
dir_prefix) >= maxlen)
|
||||
goto snprintf_error;
|
||||
} else {
|
||||
uid_t uid = geteuid();
|
||||
dir_prefix = virGetUserDirectory(NULL, uid);
|
||||
if (dir_prefix == NULL) {
|
||||
/* Do not diagnose here; virGetUserDirectory does that. */
|
||||
@ -759,7 +738,7 @@ static int qemudInitPaths(struct qemud_server *server,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (uid == SYSTEM_UID) {
|
||||
if (server->privileged) {
|
||||
if (snprintf (sockname, maxlen, "%s/libvirt-sock",
|
||||
sock_dir_prefix) >= maxlen
|
||||
|| (snprintf (roSockname, maxlen, "%s/libvirt-sock-ro",
|
||||
@ -773,10 +752,10 @@ static int qemudInitPaths(struct qemud_server *server,
|
||||
goto snprintf_error;
|
||||
}
|
||||
|
||||
if (uid == SYSTEM_UID)
|
||||
server->logDir = strdup (LOCAL_STATE_DIR "/log/libvirt");
|
||||
if (server->privileged)
|
||||
server->logDir = strdup (LOCAL_STATE_DIR "/log/libvirt");
|
||||
else
|
||||
virAsprintf(&server->logDir, "%s/.libvirt/log", dir_prefix);
|
||||
virAsprintf(&server->logDir, "%s/.libvirt/log", dir_prefix);
|
||||
|
||||
if (server->logDir == NULL)
|
||||
virReportOOMError(NULL);
|
||||
@ -812,6 +791,7 @@ static struct qemud_server *qemudInitialize(int sigread) {
|
||||
VIR_FREE(server);
|
||||
}
|
||||
|
||||
server->privileged = geteuid() == 0 ? 1 : 0;
|
||||
server->sigread = sigread;
|
||||
|
||||
if (virEventInit() < 0) {
|
||||
@ -838,13 +818,18 @@ static struct qemud_server *qemudInitialize(int sigread) {
|
||||
virDriverLoadModule("network");
|
||||
virDriverLoadModule("storage");
|
||||
virDriverLoadModule("nodedev");
|
||||
virDriverLoadModule("secret");
|
||||
virDriverLoadModule("qemu");
|
||||
virDriverLoadModule("lxc");
|
||||
virDriverLoadModule("uml");
|
||||
virDriverLoadModule("one");
|
||||
#else
|
||||
#ifdef WITH_NETWORK
|
||||
networkRegister();
|
||||
#endif
|
||||
#ifdef WITH_NETCF
|
||||
interfaceRegister();
|
||||
#endif
|
||||
#ifdef WITH_STORAGE_DIR
|
||||
storageRegister();
|
||||
#endif
|
||||
@ -852,6 +837,7 @@ static struct qemud_server *qemudInitialize(int sigread) {
|
||||
(defined(HAVE_HAL) || defined(HAVE_DEVKIT))
|
||||
nodedevRegister();
|
||||
#endif
|
||||
secretRegister();
|
||||
#ifdef WITH_QEMU
|
||||
qemuRegister();
|
||||
#endif
|
||||
@ -861,6 +847,9 @@ static struct qemud_server *qemudInitialize(int sigread) {
|
||||
#ifdef WITH_UML
|
||||
umlRegister();
|
||||
#endif
|
||||
#ifdef WITH_ONE
|
||||
oneRegister();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
virEventRegisterImpl(virEventAddHandleImpl,
|
||||
@ -870,7 +859,7 @@ static struct qemud_server *qemudInitialize(int sigread) {
|
||||
virEventUpdateTimeoutImpl,
|
||||
virEventRemoveTimeoutImpl);
|
||||
|
||||
virStateInitialize();
|
||||
virStateInitialize(server->privileged);
|
||||
|
||||
return server;
|
||||
}
|
||||
@ -907,7 +896,7 @@ static struct qemud_server *qemudNetworkInit(struct qemud_server *server) {
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_POLKIT
|
||||
#if HAVE_POLKIT0
|
||||
if (auth_unix_rw == REMOTE_AUTH_POLKIT ||
|
||||
auth_unix_ro == REMOTE_AUTH_POLKIT) {
|
||||
DBusError derr;
|
||||
@ -941,7 +930,7 @@ static struct qemud_server *qemudNetworkInit(struct qemud_server *server) {
|
||||
}
|
||||
|
||||
#ifdef HAVE_AVAHI
|
||||
if (getuid() == 0 && mdns_adv) {
|
||||
if (server->privileged && mdns_adv) {
|
||||
struct libvirtd_mdns_group *group;
|
||||
int port = 0;
|
||||
|
||||
@ -994,7 +983,7 @@ static struct qemud_server *qemudNetworkInit(struct qemud_server *server) {
|
||||
sock = sock->next;
|
||||
}
|
||||
|
||||
#ifdef HAVE_POLKIT
|
||||
#if HAVE_POLKIT0
|
||||
if (server->sysbus)
|
||||
dbus_connection_unref(server->sysbus);
|
||||
#endif
|
||||
@ -1273,8 +1262,8 @@ static int qemudDispatchServer(struct qemud_server *server, struct qemud_socket
|
||||
setsockopt (fd, IPPROTO_TCP, TCP_NODELAY, (void *)&no_slow_start,
|
||||
sizeof no_slow_start);
|
||||
|
||||
if (qemudSetCloseExec(fd) < 0 ||
|
||||
qemudSetNonBlock(fd) < 0) {
|
||||
if (virSetCloseExec(fd) < 0 ||
|
||||
virSetNonBlock(fd) < 0) {
|
||||
close(fd);
|
||||
return -1;
|
||||
}
|
||||
@ -1294,7 +1283,6 @@ static int qemudDispatchServer(struct qemud_server *server, struct qemud_socket
|
||||
client->auth = sock->auth;
|
||||
memcpy (&client->addr, &addr, sizeof addr);
|
||||
client->addrlen = addrlen;
|
||||
client->server = server;
|
||||
|
||||
/* Prepare one for packet receive */
|
||||
if (VIR_ALLOC(client->rx) < 0)
|
||||
@ -1324,7 +1312,7 @@ static int qemudDispatchServer(struct qemud_server *server, struct qemud_socket
|
||||
|
||||
if (client->type != QEMUD_SOCK_TYPE_TLS) {
|
||||
/* Plain socket, so prepare to read first message */
|
||||
if (qemudRegisterClientEvent (server, client, 0) < 0)
|
||||
if (qemudRegisterClientEvent (server, client) < 0)
|
||||
goto cleanup;
|
||||
} else {
|
||||
int ret;
|
||||
@ -1346,13 +1334,13 @@ static int qemudDispatchServer(struct qemud_server *server, struct qemud_socket
|
||||
goto cleanup;
|
||||
|
||||
/* Handshake & cert check OK, so prepare to read first message */
|
||||
if (qemudRegisterClientEvent(server, client, 0) < 0)
|
||||
if (qemudRegisterClientEvent(server, client) < 0)
|
||||
goto cleanup;
|
||||
} else if (ret == GNUTLS_E_INTERRUPTED || ret == GNUTLS_E_AGAIN) {
|
||||
/* Most likely, need to do more handshake data */
|
||||
client->handshake = 1;
|
||||
|
||||
if (qemudRegisterClientEvent (server, client, 0) < 0)
|
||||
if (qemudRegisterClientEvent (server, client) < 0)
|
||||
goto cleanup;
|
||||
} else {
|
||||
VIR_ERROR(_("TLS handshake failed: %s"),
|
||||
@ -1397,7 +1385,10 @@ static int qemudDispatchServer(struct qemud_server *server, struct qemud_socket
|
||||
* jobs have finished, then clean it up elsehwere
|
||||
*/
|
||||
void qemudDispatchClientFailure(struct qemud_client *client) {
|
||||
virEventRemoveHandleImpl(client->watch);
|
||||
if (client->watch != -1) {
|
||||
virEventRemoveHandleImpl(client->watch);
|
||||
client->watch = -1;
|
||||
}
|
||||
|
||||
/* Deregister event delivery callback */
|
||||
if(client->conn) {
|
||||
@ -1406,12 +1397,21 @@ void qemudDispatchClientFailure(struct qemud_client *client) {
|
||||
}
|
||||
|
||||
#if HAVE_SASL
|
||||
if (client->saslconn) sasl_dispose(&client->saslconn);
|
||||
if (client->saslconn) {
|
||||
sasl_dispose(&client->saslconn);
|
||||
client->saslconn = NULL;
|
||||
}
|
||||
free(client->saslUsername);
|
||||
client->saslUsername = NULL;
|
||||
#endif
|
||||
if (client->tlssession) gnutls_deinit (client->tlssession);
|
||||
close(client->fd);
|
||||
client->fd = -1;
|
||||
if (client->tlssession) {
|
||||
gnutls_deinit (client->tlssession);
|
||||
client->tlssession = NULL;
|
||||
}
|
||||
if (client->fd != -1) {
|
||||
close(client->fd);
|
||||
client->fd = -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1437,7 +1437,7 @@ static void *qemudWorker(void *data)
|
||||
|
||||
while (1) {
|
||||
struct qemud_client *client = NULL;
|
||||
struct qemud_client_message *reply;
|
||||
struct qemud_client_message *msg;
|
||||
|
||||
virMutexLock(&server->lock);
|
||||
while (((client = qemudPendingJob(server)) == NULL) &&
|
||||
@ -1460,24 +1460,18 @@ static void *qemudWorker(void *data)
|
||||
client->refs++;
|
||||
|
||||
/* Remove our message from dispatch queue while we use it */
|
||||
reply = qemudClientMessageQueueServe(&client->dx);
|
||||
msg = qemudClientMessageQueueServe(&client->dx);
|
||||
|
||||
/* This function drops the lock during dispatch,
|
||||
* and re-acquires it before returning */
|
||||
if (remoteDispatchClientRequest (server, client, reply) < 0) {
|
||||
VIR_FREE(reply);
|
||||
if (remoteDispatchClientRequest (server, client, msg) < 0) {
|
||||
VIR_FREE(msg);
|
||||
qemudDispatchClientFailure(client);
|
||||
client->refs--;
|
||||
virMutexUnlock(&client->lock);
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Put reply on end of tx queue to send out */
|
||||
qemudClientMessageQueuePush(&client->tx, reply);
|
||||
|
||||
if (qemudRegisterClientEvent(server, client, 1) < 0)
|
||||
qemudDispatchClientFailure(client);
|
||||
|
||||
client->refs--;
|
||||
virMutexUnlock(&client->lock);
|
||||
|
||||
@ -1710,19 +1704,42 @@ readmore:
|
||||
/* Prepare to read rest of message */
|
||||
client->rx->bufferLength += len;
|
||||
|
||||
if (qemudRegisterClientEvent(server, client, 1) < 0) {
|
||||
qemudDispatchClientFailure(client);
|
||||
return;
|
||||
}
|
||||
qemudUpdateClientEvent(client);
|
||||
|
||||
/* Try and read payload immediately instead of going back
|
||||
into poll() because chances are the data is already
|
||||
waiting for us */
|
||||
goto readmore;
|
||||
} else {
|
||||
/* Grab the completed message */
|
||||
struct qemud_client_message *msg = qemudClientMessageQueueServe(&client->rx);
|
||||
struct qemud_client_filter *filter;
|
||||
|
||||
/* Decode the header so we can use it for routing decisions */
|
||||
if (remoteDecodeClientMessageHeader(msg) < 0) {
|
||||
VIR_FREE(msg);
|
||||
qemudDispatchClientFailure(client);
|
||||
}
|
||||
|
||||
/* Check if any filters match this message */
|
||||
filter = client->filters;
|
||||
while (filter) {
|
||||
int ret;
|
||||
ret = (filter->query)(client, msg, filter->opaque);
|
||||
if (ret == 1) {
|
||||
msg = NULL;
|
||||
break;
|
||||
} else if (ret == -1) {
|
||||
VIR_FREE(msg);
|
||||
qemudDispatchClientFailure(client);
|
||||
return;
|
||||
}
|
||||
filter = filter->next;
|
||||
}
|
||||
|
||||
/* Move completed message to the end of the dispatch queue */
|
||||
qemudClientMessageQueuePush(&client->dx, client->rx);
|
||||
client->rx = NULL;
|
||||
if (msg)
|
||||
qemudClientMessageQueuePush(&client->dx, msg);
|
||||
client->nrequests++;
|
||||
|
||||
/* Possibly need to create another receive buffer */
|
||||
@ -1733,11 +1750,10 @@ readmore:
|
||||
if (client->rx)
|
||||
client->rx->bufferLength = REMOTE_MESSAGE_HEADER_XDR_LEN;
|
||||
|
||||
if (qemudRegisterClientEvent(server, client, 1) < 0)
|
||||
qemudDispatchClientFailure(client);
|
||||
else
|
||||
/* Tell one of the workers to get on with it... */
|
||||
virCondSignal(&server->job);
|
||||
qemudUpdateClientEvent(client);
|
||||
|
||||
/* Tell one of the workers to get on with it... */
|
||||
virCondSignal(&server->job);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1878,13 +1894,37 @@ static ssize_t qemudClientWrite(struct qemud_client *client) {
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
qemudClientMessageRelease(struct qemud_client *client,
|
||||
struct qemud_client_message *msg)
|
||||
{
|
||||
if (msg->streamTX) {
|
||||
remoteStreamMessageFinished(client, msg);
|
||||
} else if (!msg->async)
|
||||
client->nrequests--;
|
||||
|
||||
/* See if the recv queue is currently throttled */
|
||||
if (!client->rx &&
|
||||
client->nrequests < max_client_requests) {
|
||||
/* Reset message record for next RX attempt */
|
||||
memset(msg, 0, sizeof(*msg));
|
||||
client->rx = msg;
|
||||
/* Get ready to receive next message */
|
||||
client->rx->bufferLength = REMOTE_MESSAGE_HEADER_XDR_LEN;
|
||||
} else {
|
||||
VIR_FREE(msg);
|
||||
}
|
||||
|
||||
qemudUpdateClientEvent(client);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Process all queued client->tx messages until
|
||||
* we would block on I/O
|
||||
*/
|
||||
static void
|
||||
qemudDispatchClientWrite(struct qemud_server *server,
|
||||
struct qemud_client *client) {
|
||||
qemudDispatchClientWrite(struct qemud_client *client) {
|
||||
while (client->tx) {
|
||||
ssize_t ret;
|
||||
|
||||
@ -1902,32 +1942,16 @@ qemudDispatchClientWrite(struct qemud_server *server,
|
||||
/* Get finished reply from head of tx queue */
|
||||
reply = qemudClientMessageQueueServe(&client->tx);
|
||||
|
||||
/* If its not an async message, then we have
|
||||
* just completed an RPC request */
|
||||
if (!reply->async)
|
||||
client->nrequests--;
|
||||
qemudClientMessageRelease(client, reply);
|
||||
|
||||
/* Move record to end of 'rx' ist */
|
||||
if (!client->rx &&
|
||||
client->nrequests < max_client_requests) {
|
||||
/* Reset message record for next RX attempt */
|
||||
client->rx = reply;
|
||||
client->rx->bufferOffset = 0;
|
||||
client->rx->bufferLength = REMOTE_MESSAGE_HEADER_XDR_LEN;
|
||||
} else {
|
||||
VIR_FREE(reply);
|
||||
}
|
||||
|
||||
if (client->closing ||
|
||||
qemudRegisterClientEvent (server, client, 1) < 0)
|
||||
qemudDispatchClientFailure(client);
|
||||
if (client->closing)
|
||||
qemudDispatchClientFailure(client);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
qemudDispatchClientHandshake(struct qemud_server *server,
|
||||
struct qemud_client *client) {
|
||||
qemudDispatchClientHandshake(struct qemud_client *client) {
|
||||
int ret;
|
||||
/* Continue the handshake. */
|
||||
ret = gnutls_handshake (client->tlssession);
|
||||
@ -1937,15 +1961,14 @@ qemudDispatchClientHandshake(struct qemud_server *server,
|
||||
/* Finished. Next step is to check the certificate. */
|
||||
if (remoteCheckAccess (client) == -1)
|
||||
qemudDispatchClientFailure(client);
|
||||
else if (qemudRegisterClientEvent (server, client, 1))
|
||||
qemudDispatchClientFailure(client);
|
||||
else
|
||||
qemudUpdateClientEvent(client);
|
||||
} else if (ret == GNUTLS_E_AGAIN ||
|
||||
ret == GNUTLS_E_INTERRUPTED) {
|
||||
/* Carry on waiting for more handshake. Update
|
||||
the events just in case handshake data flow
|
||||
direction has changed */
|
||||
if (qemudRegisterClientEvent (server, client, 1))
|
||||
qemudDispatchClientFailure(client);
|
||||
qemudUpdateClientEvent (client);
|
||||
} else {
|
||||
/* Fatal error in handshake */
|
||||
VIR_ERROR(_("TLS handshake failed: %s"),
|
||||
@ -1985,10 +2008,10 @@ qemudDispatchClientEvent(int watch, int fd, int events, void *opaque) {
|
||||
if (events & (VIR_EVENT_HANDLE_WRITABLE |
|
||||
VIR_EVENT_HANDLE_READABLE)) {
|
||||
if (client->handshake) {
|
||||
qemudDispatchClientHandshake(server, client);
|
||||
qemudDispatchClientHandshake(client);
|
||||
} else {
|
||||
if (events & VIR_EVENT_HANDLE_WRITABLE)
|
||||
qemudDispatchClientWrite(server, client);
|
||||
qemudDispatchClientWrite(client);
|
||||
if (events & VIR_EVENT_HANDLE_READABLE)
|
||||
qemudDispatchClientRead(server, client);
|
||||
}
|
||||
@ -2003,9 +2026,12 @@ qemudDispatchClientEvent(int watch, int fd, int events, void *opaque) {
|
||||
virMutexUnlock(&client->lock);
|
||||
}
|
||||
|
||||
int qemudRegisterClientEvent(struct qemud_server *server,
|
||||
struct qemud_client *client,
|
||||
int update) {
|
||||
|
||||
/*
|
||||
* @client: a locked client object
|
||||
*/
|
||||
static int
|
||||
qemudCalculateHandleMode(struct qemud_client *client) {
|
||||
int mode = 0;
|
||||
|
||||
if (client->handshake) {
|
||||
@ -2025,19 +2051,40 @@ int qemudRegisterClientEvent(struct qemud_server *server,
|
||||
mode |= VIR_EVENT_HANDLE_WRITABLE;
|
||||
}
|
||||
|
||||
if (update) {
|
||||
virEventUpdateHandleImpl(client->watch, mode);
|
||||
} else {
|
||||
if ((client->watch = virEventAddHandleImpl(client->fd,
|
||||
mode,
|
||||
qemudDispatchClientEvent,
|
||||
server, NULL)) < 0)
|
||||
return -1;
|
||||
}
|
||||
return mode;
|
||||
}
|
||||
|
||||
/*
|
||||
* @server: a locked or unlocked server object
|
||||
* @client: a locked client object
|
||||
*/
|
||||
int qemudRegisterClientEvent(struct qemud_server *server,
|
||||
struct qemud_client *client) {
|
||||
int mode;
|
||||
|
||||
mode = qemudCalculateHandleMode(client);
|
||||
|
||||
if ((client->watch = virEventAddHandleImpl(client->fd,
|
||||
mode,
|
||||
qemudDispatchClientEvent,
|
||||
server, NULL)) < 0)
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* @client: a locked client object
|
||||
*/
|
||||
void qemudUpdateClientEvent(struct qemud_client *client) {
|
||||
int mode;
|
||||
|
||||
mode = qemudCalculateHandleMode(client);
|
||||
|
||||
virEventUpdateHandleImpl(client->watch, mode);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
qemudDispatchServerEvent(int watch, int fd, int events, void *opaque) {
|
||||
struct qemud_server *server = (struct qemud_server *)opaque;
|
||||
@ -2110,6 +2157,9 @@ static void qemudFreeClient(struct qemud_client *client) {
|
||||
VIR_FREE(msg);
|
||||
}
|
||||
|
||||
while (client->streams)
|
||||
remoteRemoveClientStream(client, client->streams);
|
||||
|
||||
if (client->conn)
|
||||
virConnectClose(client->conn);
|
||||
virMutexDestroy(&client->lock);
|
||||
@ -2240,7 +2290,6 @@ cleanup:
|
||||
}
|
||||
VIR_FREE(server->workers);
|
||||
|
||||
free(server->workers);
|
||||
virMutexUnlock(&server->lock);
|
||||
return ret;
|
||||
}
|
||||
@ -2461,53 +2510,74 @@ remoteReadSaslAllowedUsernameList (virConfPtr conf ATTRIBUTE_UNUSED,
|
||||
*/
|
||||
static int
|
||||
qemudSetLogging(virConfPtr conf, const char *filename) {
|
||||
char *debugEnv;
|
||||
int log_level;
|
||||
char *log_filters = NULL;
|
||||
char *log_outputs = NULL;
|
||||
int ret = -1;
|
||||
|
||||
virLogReset();
|
||||
|
||||
/*
|
||||
* look for default logging level first from config file,
|
||||
* then from environment variable and finally from command
|
||||
* line options
|
||||
* Libvirtd's order of precedence is:
|
||||
* cmdline > environment > config
|
||||
*
|
||||
* In order to achieve this, we must process configuration in
|
||||
* different order for the log level versus the filters and
|
||||
* outputs. Because filters and outputs append, we have to look at
|
||||
* the environment first and then only check the config file if
|
||||
* there was no result from the environment. The default output is
|
||||
* then applied only if there was no setting from either of the
|
||||
* first two. Because we don't have a way to determine if the log
|
||||
* level has been set, we must process variables in the opposite
|
||||
* order, each one overriding the previous.
|
||||
*/
|
||||
/*
|
||||
* GET_CONF_INT returns 0 when there is no log_level setting in
|
||||
* the config file. The conditional below eliminates a false
|
||||
* warning in that case, but also has the side effect of missing
|
||||
* a warning if the user actually does say log_level=0.
|
||||
*/
|
||||
GET_CONF_INT (conf, filename, log_level);
|
||||
debugEnv = getenv("LIBVIRT_DEBUG");
|
||||
if (debugEnv && *debugEnv && *debugEnv != '0') {
|
||||
if (STREQ(debugEnv, "2") || STREQ(debugEnv, "info"))
|
||||
log_level = VIR_LOG_INFO;
|
||||
else if (STREQ(debugEnv, "3") || STREQ(debugEnv, "warning"))
|
||||
log_level = VIR_LOG_WARN;
|
||||
else if (STREQ(debugEnv, "4") || STREQ(debugEnv, "error"))
|
||||
log_level = VIR_LOG_ERROR;
|
||||
else
|
||||
log_level = VIR_LOG_DEBUG;
|
||||
}
|
||||
if ((verbose) && (log_level >= VIR_LOG_WARN))
|
||||
log_level = VIR_LOG_INFO;
|
||||
virLogSetDefaultPriority(log_level);
|
||||
if (log_level != 0)
|
||||
virLogSetDefaultPriority(log_level);
|
||||
|
||||
/* there is no default filters */
|
||||
GET_CONF_STR (conf, filename, log_filters);
|
||||
virLogParseFilters(log_filters);
|
||||
virLogSetFromEnv();
|
||||
|
||||
if (virLogGetNbFilters() == 0) {
|
||||
GET_CONF_STR (conf, filename, log_filters);
|
||||
virLogParseFilters(log_filters);
|
||||
}
|
||||
|
||||
if (virLogGetNbOutputs() == 0) {
|
||||
GET_CONF_STR (conf, filename, log_outputs);
|
||||
virLogParseOutputs(log_outputs);
|
||||
}
|
||||
|
||||
/*
|
||||
* by default save all warning and errors to syslog or
|
||||
* all logs to stderr if not running as daemon
|
||||
* If no defined outputs, then direct to syslog when running
|
||||
* as daemon. Otherwise the default output is stderr.
|
||||
*/
|
||||
GET_CONF_STR (conf, filename, log_outputs);
|
||||
if (log_outputs == NULL) {
|
||||
if (virLogGetNbOutputs() == 0) {
|
||||
char *tmp = NULL;
|
||||
if (godaemon) {
|
||||
char *tmp = NULL;
|
||||
if (virAsprintf (&tmp, "%d:syslog:libvirtd", log_level) < 0)
|
||||
if (virAsprintf (&tmp, "%d:syslog:libvirtd",
|
||||
virLogGetDefaultPriority()) < 0)
|
||||
goto free_and_fail;
|
||||
virLogParseOutputs (tmp);
|
||||
VIR_FREE (tmp);
|
||||
} else {
|
||||
virLogParseOutputs("0:stderr:libvirtd");
|
||||
if (virAsprintf (&tmp, "%d:stderr",
|
||||
virLogGetDefaultPriority()) < 0)
|
||||
goto free_and_fail;
|
||||
}
|
||||
} else
|
||||
virLogParseOutputs(log_outputs);
|
||||
virLogParseOutputs(tmp);
|
||||
VIR_FREE(tmp);
|
||||
}
|
||||
|
||||
/*
|
||||
* Command line override for --verbose
|
||||
*/
|
||||
if ((verbose) && (virLogGetDefaultPriority() > VIR_LOG_INFO))
|
||||
virLogSetDefaultPriority(VIR_LOG_INFO);
|
||||
|
||||
ret = 0;
|
||||
|
||||
free_and_fail:
|
||||
@ -2529,16 +2599,17 @@ remoteReadConfigFile (struct qemud_server *server, const char *filename)
|
||||
char *unix_sock_ro_perms = NULL;
|
||||
char *unix_sock_rw_perms = NULL;
|
||||
char *unix_sock_group = NULL;
|
||||
char *buf = NULL;
|
||||
|
||||
#if HAVE_POLKIT
|
||||
/* Change the default back to no auth for non-root */
|
||||
if (getuid() != 0 && auth_unix_rw == REMOTE_AUTH_POLKIT)
|
||||
if (!server->privileged && auth_unix_rw == REMOTE_AUTH_POLKIT)
|
||||
auth_unix_rw = REMOTE_AUTH_NONE;
|
||||
if (getuid() != 0 && auth_unix_ro == REMOTE_AUTH_POLKIT)
|
||||
if (!server->privileged && auth_unix_ro == REMOTE_AUTH_POLKIT)
|
||||
auth_unix_ro = REMOTE_AUTH_NONE;
|
||||
#endif
|
||||
|
||||
conf = virConfReadFile (filename);
|
||||
conf = virConfReadFile (filename, 0);
|
||||
if (!conf) return -1;
|
||||
|
||||
/*
|
||||
@ -2571,16 +2642,37 @@ remoteReadConfigFile (struct qemud_server *server, const char *filename)
|
||||
|
||||
GET_CONF_STR (conf, filename, unix_sock_group);
|
||||
if (unix_sock_group) {
|
||||
if (getuid() != 0) {
|
||||
if (!server->privileged) {
|
||||
VIR_WARN0(_("Cannot set group when not running as root"));
|
||||
} else {
|
||||
char buf[1024];
|
||||
int ret;
|
||||
struct group grpdata, *grp;
|
||||
if (getgrnam_r(unix_sock_group, &grpdata, buf, sizeof(buf), &grp) != 0 || !grp) {
|
||||
size_t maxbuf = sysconf(_SC_GETGR_R_SIZE_MAX);
|
||||
|
||||
if (maxbuf == -1)
|
||||
maxbuf = 1024;
|
||||
|
||||
if (VIR_ALLOC_N(buf, maxbuf) < 0) {
|
||||
VIR_ERROR("%s", _("Failed to allocate memory for buffer"));
|
||||
goto free_and_fail;
|
||||
}
|
||||
|
||||
while ((ret = getgrnam_r(unix_sock_group, &grpdata,
|
||||
buf, maxbuf,
|
||||
&grp)) == ERANGE) {
|
||||
maxbuf *= 2;
|
||||
if (maxbuf > 65536 || VIR_REALLOC_N(buf, maxbuf) < 0) {
|
||||
VIR_ERROR("%s", _("Failed to reallocate enough memory for buffer"));
|
||||
goto free_and_fail;
|
||||
}
|
||||
}
|
||||
|
||||
if (ret != 0 || !grp) {
|
||||
VIR_ERROR(_("Failed to lookup group '%s'"), unix_sock_group);
|
||||
goto free_and_fail;
|
||||
}
|
||||
unix_sock_gid = grp->gr_gid;
|
||||
VIR_FREE (buf);
|
||||
}
|
||||
free (unix_sock_group);
|
||||
unix_sock_group = NULL;
|
||||
@ -2643,6 +2735,7 @@ remoteReadConfigFile (struct qemud_server *server, const char *filename)
|
||||
free (unix_sock_ro_perms);
|
||||
free (unix_sock_rw_perms);
|
||||
free (unix_sock_group);
|
||||
VIR_FREE (buf);
|
||||
|
||||
/* Don't bother trying to free listen_addr, tcp_port, tls_port, key_file,
|
||||
cert_file, ca_file, or crl_file, since they are initialized to
|
||||
@ -2676,13 +2769,13 @@ qemudSetupPrivs (void)
|
||||
|
||||
if (__init_daemon_priv (PU_RESETGROUPS | PU_CLEARLIMITSET,
|
||||
SYSTEM_UID, SYSTEM_UID, PRIV_XVM_CONTROL, NULL)) {
|
||||
fprintf (stderr, "additional privileges are required\n");
|
||||
VIR_ERROR0(_("additional privileges are required\n"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (priv_set (PRIV_OFF, PRIV_ALLSETS, PRIV_FILE_LINK_ANY, PRIV_PROC_INFO,
|
||||
PRIV_PROC_SESSION, PRIV_PROC_EXEC, PRIV_PROC_FORK, NULL)) {
|
||||
fprintf (stderr, "failed to set reduced privileges\n");
|
||||
VIR_ERROR0(_("failed to set reduced privileges\n"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -2839,7 +2932,7 @@ int main(int argc, char **argv) {
|
||||
|
||||
/* If running as root and no PID file is set, use the default */
|
||||
if (pid_file == NULL &&
|
||||
getuid() == 0 &&
|
||||
geteuid() == 0 &&
|
||||
REMOTE_PID_FILE[0] != '\0')
|
||||
pid_file = REMOTE_PID_FILE;
|
||||
|
||||
@ -2849,10 +2942,10 @@ int main(int argc, char **argv) {
|
||||
goto error1;
|
||||
|
||||
if (pipe(sigpipe) < 0 ||
|
||||
qemudSetNonBlock(sigpipe[0]) < 0 ||
|
||||
qemudSetNonBlock(sigpipe[1]) < 0 ||
|
||||
qemudSetCloseExec(sigpipe[0]) < 0 ||
|
||||
qemudSetCloseExec(sigpipe[1]) < 0) {
|
||||
virSetNonBlock(sigpipe[0]) < 0 ||
|
||||
virSetNonBlock(sigpipe[1]) < 0 ||
|
||||
virSetCloseExec(sigpipe[0]) < 0 ||
|
||||
virSetCloseExec(sigpipe[1]) < 0) {
|
||||
char ebuf[1024];
|
||||
VIR_ERROR(_("Failed to create pipe: %s"),
|
||||
virStrerror(errno, ebuf, sizeof ebuf));
|
||||
@ -2874,7 +2967,7 @@ int main(int argc, char **argv) {
|
||||
sigaction(SIGPIPE, &sig_action, NULL);
|
||||
|
||||
/* Ensure the rundir exists (on tmpfs on some systems) */
|
||||
if (geteuid () == 0) {
|
||||
if (geteuid() == 0) {
|
||||
const char *rundir = LOCAL_STATE_DIR "/run/libvirt";
|
||||
|
||||
if (mkdir (rundir, 0755)) {
|
||||
@ -2885,6 +2978,12 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
}
|
||||
|
||||
/* Beyond this point, nothing should rely on using
|
||||
* getuid/geteuid() == 0, for privilege level checks.
|
||||
* It must all use the flag 'server->privileged'
|
||||
* which is also passed into all libvirt stateful
|
||||
* drivers
|
||||
*/
|
||||
if (qemudSetupPrivs() < 0)
|
||||
goto error2;
|
||||
|
||||
@ -2898,7 +2997,7 @@ int main(int argc, char **argv) {
|
||||
goto error2;
|
||||
|
||||
/* Change the group ownership of /var/run/libvirt to unix_sock_gid */
|
||||
if (unix_sock_dir && geteuid() == 0) {
|
||||
if (unix_sock_dir && server->privileged) {
|
||||
if (chown(unix_sock_dir, -1, unix_sock_gid) < 0)
|
||||
VIR_ERROR(_("Failed to change group ownership of %s"),
|
||||
unix_sock_dir);
|
@ -269,7 +269,7 @@
|
||||
# Logging controls
|
||||
#
|
||||
|
||||
# Logging level: 0 none, 4 errors, 3 warnings, 2 informations, 1 debug
|
||||
# Logging level: 4 errors, 3 warnings, 2 informations, 1 debug
|
||||
# basically 1 will log everything possible
|
||||
#log_level = 3
|
||||
|
||||
@ -303,13 +303,12 @@
|
||||
# x:file:file_path
|
||||
# output to a file, with the given filepath
|
||||
# In all case the x prefix is the minimal level, acting as a filter
|
||||
# 0: everything
|
||||
# 1: DEBUG
|
||||
# 2: INFO
|
||||
# 3: WARNING
|
||||
# 4: ERROR
|
||||
#
|
||||
# Multiple output can be defined , they just need to be separated by spaces.
|
||||
# Multiple output can be defined, they just need to be separated by spaces.
|
||||
# e.g.:
|
||||
# log_outputs="3:syslog:libvirtd"
|
||||
# to log all warnings and errors to syslog under the libvirtd ident
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* qemud.h: daemon data structure definitions
|
||||
* libvirtd.h: daemon data structure definitions
|
||||
*
|
||||
* Copyright (C) 2006-2009 Red Hat, Inc.
|
||||
* Copyright (C) 2006 Daniel P. Berrange
|
||||
@ -34,7 +34,7 @@
|
||||
#include <sasl/sasl.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_POLKIT
|
||||
#if HAVE_POLKIT0
|
||||
#include <dbus/dbus.h>
|
||||
#endif
|
||||
|
||||
@ -52,15 +52,61 @@
|
||||
#ifdef HAVE_ANSIDECL_H
|
||||
#include <ansidecl.h>
|
||||
#endif
|
||||
|
||||
#ifndef __GNUC_PREREQ
|
||||
#if defined __GNUC__ && defined __GNUC_MINOR__
|
||||
# define __GNUC_PREREQ(maj, min) \
|
||||
((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
|
||||
#else
|
||||
#define __GNUC_PREREQ(maj,min) 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* ATTRIBUTE_UNUSED:
|
||||
*
|
||||
* Macro to flag conciously unused parameters to functions
|
||||
*/
|
||||
#ifndef ATTRIBUTE_UNUSED
|
||||
#define ATTRIBUTE_UNUSED __attribute__((__unused__))
|
||||
#endif
|
||||
#ifndef ATTRIBUTE_FORMAT
|
||||
#define ATTRIBUTE_FORMAT(args...) __attribute__((__format__ (args)))
|
||||
#endif
|
||||
|
||||
/**
|
||||
* ATTRIBUTE_FMT_PRINTF
|
||||
*
|
||||
* Macro used to check printf like functions, if compiling
|
||||
* with gcc.
|
||||
*
|
||||
* We use gnulib which guarentees we always have GNU style
|
||||
* printf format specifiers even on broken Win32 platforms
|
||||
* hence we have to force 'gnu_printf' for new GCC
|
||||
*/
|
||||
#ifndef ATTRIBUTE_FMT_PRINTF
|
||||
#if __GNUC_PREREQ (4, 4)
|
||||
#define ATTRIBUTE_FMT_PRINTF(fmtpos,argpos) __attribute__((__format__ (gnu_printf, fmtpos,argpos)))
|
||||
#else
|
||||
#define ATTRIBUTE_FMT_PRINTF(fmtpos,argpos) __attribute__((__format__ (printf, fmtpos,argpos)))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef ATTRIBUTE_RETURN_CHECK
|
||||
#if __GNUC_PREREQ (3, 4)
|
||||
#define ATTRIBUTE_RETURN_CHECK __attribute__((__warn_unused_result__))
|
||||
#else
|
||||
#define ATTRIBUTE_RETURN_CHECK
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#else
|
||||
#ifndef ATTRIBUTE_UNUSED
|
||||
#define ATTRIBUTE_UNUSED
|
||||
#define ATTRIBUTE_FORMAT(...)
|
||||
#endif
|
||||
#ifndef ATTRIBUTE_FMT_PRINTF
|
||||
#define ATTRIBUTE_FMT_PRINTF(...)
|
||||
#endif
|
||||
#ifndef ATTRIBUTE_RETURN_CHECK
|
||||
#define ATTRIBUTE_RETURN_CHECK
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define qemudDebug DEBUG
|
||||
@ -83,11 +129,44 @@ struct qemud_client_message {
|
||||
unsigned int bufferLength;
|
||||
unsigned int bufferOffset;
|
||||
|
||||
int async : 1;
|
||||
unsigned int async : 1;
|
||||
unsigned int streamTX : 1;
|
||||
|
||||
remote_message_header hdr;
|
||||
|
||||
struct qemud_client_message *next;
|
||||
};
|
||||
|
||||
struct qemud_client;
|
||||
|
||||
/* Allow for filtering of incoming messages to a custom
|
||||
* dispatch processing queue, instead of client->dx.
|
||||
*/
|
||||
typedef int (*qemud_client_filter_func)(struct qemud_client *client,
|
||||
struct qemud_client_message *msg, void *opaque);
|
||||
struct qemud_client_filter {
|
||||
qemud_client_filter_func query;
|
||||
void *opaque;
|
||||
|
||||
struct qemud_client_filter *next;
|
||||
};
|
||||
|
||||
struct qemud_client_stream {
|
||||
virStreamPtr st;
|
||||
int procedure;
|
||||
int serial;
|
||||
|
||||
unsigned int recvEOF : 1;
|
||||
unsigned int closed : 1;
|
||||
|
||||
struct qemud_client_filter filter;
|
||||
|
||||
struct qemud_client_message *rx;
|
||||
int tx;
|
||||
|
||||
struct qemud_client_stream *next;
|
||||
};
|
||||
|
||||
/* Stores the per-client connection state */
|
||||
struct qemud_client {
|
||||
virMutex lock;
|
||||
@ -132,6 +211,13 @@ struct qemud_client {
|
||||
/* Zero or many messages waiting for transmit
|
||||
* back to client, including async events */
|
||||
struct qemud_client_message *tx;
|
||||
/* Filters to capture messages that would otherwise
|
||||
* end up on the 'dx' queue */
|
||||
struct qemud_client_filter *filters;
|
||||
|
||||
/* Data streams */
|
||||
struct qemud_client_stream *streams;
|
||||
|
||||
|
||||
/* This is only valid if a remote open call has been made on this
|
||||
* connection, otherwise it will be NULL. Also if remote close is
|
||||
@ -140,8 +226,6 @@ struct qemud_client {
|
||||
virConnectPtr conn;
|
||||
int refs;
|
||||
|
||||
/* back-pointer to our server */
|
||||
struct qemud_server *server;
|
||||
};
|
||||
|
||||
#define QEMUD_CLIENT_MAGIC 0x7788aaee
|
||||
@ -172,6 +256,8 @@ struct qemud_server {
|
||||
virMutex lock;
|
||||
virCond job;
|
||||
|
||||
int privileged;
|
||||
|
||||
int nworkers;
|
||||
int nactiveworkers;
|
||||
struct qemud_worker *workers;
|
||||
@ -189,38 +275,31 @@ struct qemud_server {
|
||||
#if HAVE_SASL
|
||||
char **saslUsernameWhitelist;
|
||||
#endif
|
||||
#if HAVE_POLKIT
|
||||
#if HAVE_POLKIT0
|
||||
DBusConnection *sysbus;
|
||||
#endif
|
||||
};
|
||||
|
||||
void qemudLog(int priority, const char *fmt, ...)
|
||||
ATTRIBUTE_FORMAT(printf,2,3);
|
||||
ATTRIBUTE_FMT_PRINTF(2,3);
|
||||
|
||||
|
||||
int qemudSetCloseExec(int fd);
|
||||
int qemudSetNonBlock(int fd);
|
||||
|
||||
int
|
||||
remoteDispatchClientRequest (struct qemud_server *server,
|
||||
struct qemud_client *client,
|
||||
struct qemud_client_message *req);
|
||||
|
||||
int qemudRegisterClientEvent(struct qemud_server *server,
|
||||
struct qemud_client *client,
|
||||
int update);
|
||||
struct qemud_client *client);
|
||||
void qemudUpdateClientEvent(struct qemud_client *client);
|
||||
|
||||
void qemudDispatchClientFailure(struct qemud_client *client);
|
||||
|
||||
void
|
||||
qemudClientMessageQueuePush(struct qemud_client_message **queue,
|
||||
struct qemud_client_message *msg);
|
||||
struct qemud_client_message *
|
||||
qemudClientMessageQueueServe(struct qemud_client_message **queue);
|
||||
|
||||
int remoteRelayDomainEvent (virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||
virDomainPtr dom,
|
||||
int event,
|
||||
int detail,
|
||||
void *opaque);
|
||||
void
|
||||
qemudClientMessageRelease(struct qemud_client *client,
|
||||
struct qemud_client_message *msg);
|
||||
|
||||
|
||||
#if HAVE_POLKIT
|
@ -5,7 +5,13 @@
|
||||
#
|
||||
### BEGIN INIT INFO
|
||||
# Provides: libvirtd
|
||||
# Required-Start: $network messagebus
|
||||
# Should-Start: $named
|
||||
# Should-Start: xend
|
||||
# Should-Start: hal
|
||||
# Should-Start: avahi
|
||||
# Required-Stop: $network messagebus
|
||||
# Should-Stop: $named
|
||||
# Default-Start: 3 4 5
|
||||
# Short-Description: daemon for libvirt virtualization API
|
||||
# Description: This is a daemon for managing guest instances
|
8
daemon/libvirtd.logrotate.in
Normal file
8
daemon/libvirtd.logrotate.in
Normal file
@ -0,0 +1,8 @@
|
||||
@localstatedir@/log/libvirt/qemu/*.log @localstatedir@/log/libvirt/uml/*.log @localstatedir@/log/libvirt/lxc/*.log {
|
||||
weekly
|
||||
missingok
|
||||
rotate 4
|
||||
compress
|
||||
delaycompress
|
||||
copytruncate
|
||||
}
|
42
daemon/libvirtd.policy-1
Normal file
42
daemon/libvirtd.policy-1
Normal file
@ -0,0 +1,42 @@
|
||||
<!DOCTYPE policyconfig PUBLIC
|
||||
"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
|
||||
"http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd">
|
||||
|
||||
<!--
|
||||
Policy definitions for libvirt daemon
|
||||
|
||||
Copyright (c) 2007 Daniel P. Berrange <berrange redhat com>
|
||||
|
||||
libvirt is licensed to you under the GNU Lesser General Public License
|
||||
version 2. See COPYING for details.
|
||||
|
||||
NOTE: If you make changes to this file, make sure to validate the file
|
||||
using the polkit-policy-file-validate(1) tool. Changes made to this
|
||||
file are instantly applied.
|
||||
-->
|
||||
|
||||
<policyconfig>
|
||||
<action id="org.libvirt.unix.monitor">
|
||||
<description>Monitor local virtualized systems</description>
|
||||
<message>System policy prevents monitoring of local virtualized systems</message>
|
||||
<defaults>
|
||||
<!-- Any program can use libvirt in read-only mode for monitoring,
|
||||
even if not part of a session -->
|
||||
<allow_any>yes</allow_any>
|
||||
<allow_inactive>yes</allow_inactive>
|
||||
<allow_active>yes</allow_active>
|
||||
</defaults>
|
||||
</action>
|
||||
|
||||
<action id="org.libvirt.unix.manage">
|
||||
<description>Manage local virtualized systems</description>
|
||||
<message>System policy prevents management of local virtualized systems</message>
|
||||
<defaults>
|
||||
<!-- Only a program in the active host session can use libvirt in
|
||||
read-write mode for management, and we require user password -->
|
||||
<allow_any>no</allow_any>
|
||||
<allow_inactive>no</allow_inactive>
|
||||
<allow_active>auth_admin_keep</allow_active>
|
||||
</defaults>
|
||||
</action>
|
||||
</policyconfig>
|
@ -7,3 +7,11 @@
|
||||
|
||||
# Override Kerberos service keytab for SASL/GSSAPI
|
||||
#KRB5_KTNAME=/etc/libvirt/krb5.tab
|
||||
|
||||
# Override the QEMU/SDL default audio driver probing when
|
||||
# starting virtual machines using SDL graphics
|
||||
#
|
||||
# NB these have no effect for VMs using VNC
|
||||
#QEMU_AUDIO_DRV=sdl
|
||||
#
|
||||
#SDL_AUDIODRIVER=pulse
|
@ -37,11 +37,9 @@
|
||||
#include <avahi-common/error.h>
|
||||
#include <avahi-common/timeval.h>
|
||||
|
||||
#include "internal.h"
|
||||
#include "qemud.h"
|
||||
#include "libvirtd.h"
|
||||
#include "mdns.h"
|
||||
#include "event.h"
|
||||
#include "remote_internal.h"
|
||||
#include "memory.h"
|
||||
|
||||
#define AVAHI_DEBUG(fmt, ...) DEBUG(fmt, __VA_ARGS__)
|
||||
@ -178,7 +176,7 @@ static void libvirtd_mdns_create_services(struct libvirtd_mdns_group *group) {
|
||||
|
||||
static void libvirtd_mdns_client_callback(AvahiClient *c, AvahiClientState state, void *userdata) {
|
||||
struct libvirtd_mdns *mdns = (struct libvirtd_mdns *)userdata;
|
||||
struct libvirtd_mdns_group *group = mdns->group;
|
||||
struct libvirtd_mdns_group *group;
|
||||
if (!mdns->client)
|
||||
mdns->client = c;
|
||||
|
File diff suppressed because it is too large
Load Diff
73
daemon/remote.h
Normal file
73
daemon/remote.h
Normal file
@ -0,0 +1,73 @@
|
||||
/*
|
||||
* remote.h: handlers for RPC method calls
|
||||
*
|
||||
* Copyright (C) 2007, 2008, 2009 Red Hat, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* Author: Richard W.M. Jones <rjones@redhat.com>
|
||||
* Author: Daniel P. Berrange <berrange@redhat.com>
|
||||
*/
|
||||
|
||||
#ifndef __LIBVIRTD_REMOTE_H__
|
||||
#define __LIBVIRTD_REMOTE_H__
|
||||
|
||||
|
||||
#include "libvirtd.h"
|
||||
|
||||
typedef union {
|
||||
#include "remote_dispatch_args.h"
|
||||
} dispatch_args;
|
||||
|
||||
typedef union {
|
||||
#include "remote_dispatch_ret.h"
|
||||
} dispatch_ret;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* When the RPC handler is called:
|
||||
*
|
||||
* - Server object is unlocked
|
||||
* - Client object is unlocked
|
||||
*
|
||||
* Both must be locked before use. Server lock must
|
||||
* be held before attempting to lock client.
|
||||
*
|
||||
* Without any locking, it is safe to use:
|
||||
*
|
||||
* 'conn', 'rerr', 'args and 'ret'
|
||||
*/
|
||||
typedef int (*dispatch_fn) (struct qemud_server *server,
|
||||
struct qemud_client *client,
|
||||
virConnectPtr conn,
|
||||
remote_message_header *hdr,
|
||||
remote_error *err,
|
||||
dispatch_args *args,
|
||||
dispatch_ret *ret);
|
||||
|
||||
typedef struct {
|
||||
dispatch_fn fn;
|
||||
xdrproc_t args_filter;
|
||||
xdrproc_t ret_filter;
|
||||
} dispatch_data;
|
||||
|
||||
|
||||
const dispatch_data const *remoteGetDispatchData(int proc);
|
||||
|
||||
|
||||
|
||||
#endif /* __LIBVIRTD_REMOTE_H__ */
|
@ -103,3 +103,26 @@
|
||||
remote_node_device_re_attach_args val_remote_node_device_re_attach_args;
|
||||
remote_node_device_reset_args val_remote_node_device_reset_args;
|
||||
remote_domain_get_security_label_args val_remote_domain_get_security_label_args;
|
||||
remote_node_device_create_xml_args val_remote_node_device_create_xml_args;
|
||||
remote_node_device_destroy_args val_remote_node_device_destroy_args;
|
||||
remote_storage_vol_create_xml_from_args val_remote_storage_vol_create_xml_from_args;
|
||||
remote_list_interfaces_args val_remote_list_interfaces_args;
|
||||
remote_interface_lookup_by_name_args val_remote_interface_lookup_by_name_args;
|
||||
remote_interface_lookup_by_mac_string_args val_remote_interface_lookup_by_mac_string_args;
|
||||
remote_interface_get_xml_desc_args val_remote_interface_get_xml_desc_args;
|
||||
remote_interface_define_xml_args val_remote_interface_define_xml_args;
|
||||
remote_interface_undefine_args val_remote_interface_undefine_args;
|
||||
remote_interface_create_args val_remote_interface_create_args;
|
||||
remote_interface_destroy_args val_remote_interface_destroy_args;
|
||||
remote_domain_xml_from_native_args val_remote_domain_xml_from_native_args;
|
||||
remote_domain_xml_to_native_args val_remote_domain_xml_to_native_args;
|
||||
remote_list_defined_interfaces_args val_remote_list_defined_interfaces_args;
|
||||
remote_list_secrets_args val_remote_list_secrets_args;
|
||||
remote_secret_lookup_by_uuid_args val_remote_secret_lookup_by_uuid_args;
|
||||
remote_secret_define_xml_args val_remote_secret_define_xml_args;
|
||||
remote_secret_get_xml_desc_args val_remote_secret_get_xml_desc_args;
|
||||
remote_secret_set_value_args val_remote_secret_set_value_args;
|
||||
remote_secret_get_value_args val_remote_secret_get_value_args;
|
||||
remote_secret_undefine_args val_remote_secret_undefine_args;
|
||||
remote_secret_lookup_by_usage_args val_remote_secret_lookup_by_usage_args;
|
||||
remote_domain_migrate_prepare_tunnel_args val_remote_domain_migrate_prepare_tunnel_args;
|
File diff suppressed because it is too large
Load Diff
@ -75,7 +75,6 @@
|
||||
remote_domain_memory_peek_ret val_remote_domain_memory_peek_ret;
|
||||
remote_domain_events_register_ret val_remote_domain_events_register_ret;
|
||||
remote_domain_events_deregister_ret val_remote_domain_events_deregister_ret;
|
||||
remote_domain_event_ret val_remote_domain_event_ret;
|
||||
remote_domain_migrate_prepare2_ret val_remote_domain_migrate_prepare2_ret;
|
||||
remote_domain_migrate_finish2_ret val_remote_domain_migrate_finish2_ret;
|
||||
remote_get_uri_ret val_remote_get_uri_ret;
|
||||
@ -88,3 +87,22 @@
|
||||
remote_node_device_list_caps_ret val_remote_node_device_list_caps_ret;
|
||||
remote_domain_get_security_label_ret val_remote_domain_get_security_label_ret;
|
||||
remote_node_get_security_model_ret val_remote_node_get_security_model_ret;
|
||||
remote_node_device_create_xml_ret val_remote_node_device_create_xml_ret;
|
||||
remote_storage_vol_create_xml_from_ret val_remote_storage_vol_create_xml_from_ret;
|
||||
remote_num_of_interfaces_ret val_remote_num_of_interfaces_ret;
|
||||
remote_list_interfaces_ret val_remote_list_interfaces_ret;
|
||||
remote_interface_lookup_by_name_ret val_remote_interface_lookup_by_name_ret;
|
||||
remote_interface_lookup_by_mac_string_ret val_remote_interface_lookup_by_mac_string_ret;
|
||||
remote_interface_get_xml_desc_ret val_remote_interface_get_xml_desc_ret;
|
||||
remote_interface_define_xml_ret val_remote_interface_define_xml_ret;
|
||||
remote_domain_xml_from_native_ret val_remote_domain_xml_from_native_ret;
|
||||
remote_domain_xml_to_native_ret val_remote_domain_xml_to_native_ret;
|
||||
remote_num_of_defined_interfaces_ret val_remote_num_of_defined_interfaces_ret;
|
||||
remote_list_defined_interfaces_ret val_remote_list_defined_interfaces_ret;
|
||||
remote_num_of_secrets_ret val_remote_num_of_secrets_ret;
|
||||
remote_list_secrets_ret val_remote_list_secrets_ret;
|
||||
remote_secret_lookup_by_uuid_ret val_remote_secret_lookup_by_uuid_ret;
|
||||
remote_secret_define_xml_ret val_remote_secret_define_xml_ret;
|
||||
remote_secret_get_xml_desc_ret val_remote_secret_get_xml_desc_ret;
|
||||
remote_secret_get_value_ret val_remote_secret_get_value_ret;
|
||||
remote_secret_lookup_by_usage_ret val_remote_secret_lookup_by_usage_ret;
|
@ -537,10 +537,10 @@
|
||||
.args_filter = (xdrproc_t) xdr_void,
|
||||
.ret_filter = (xdrproc_t) xdr_remote_domain_events_deregister_ret,
|
||||
},
|
||||
{ /* DomainEvent => 107 */
|
||||
.fn = (dispatch_fn) remoteDispatchDomainEvent,
|
||||
{ /* Async event DomainEvent => 107 */
|
||||
.fn = NULL,
|
||||
.args_filter = (xdrproc_t) xdr_void,
|
||||
.ret_filter = (xdrproc_t) xdr_remote_domain_event_ret,
|
||||
.ret_filter = (xdrproc_t) xdr_void,
|
||||
},
|
||||
{ /* DomainMigratePrepare2 => 108 */
|
||||
.fn = (dispatch_fn) remoteDispatchDomainMigratePrepare2,
|
||||
@ -607,13 +607,143 @@
|
||||
.args_filter = (xdrproc_t) xdr_remote_node_device_reset_args,
|
||||
.ret_filter = (xdrproc_t) xdr_void,
|
||||
},
|
||||
{ /* DomainGetSecurityLabel => 118 */
|
||||
{ /* DomainGetSecurityLabel => 121 */
|
||||
.fn = (dispatch_fn) remoteDispatchDomainGetSecurityLabel,
|
||||
.args_filter = (xdrproc_t) xdr_remote_domain_get_security_label_args,
|
||||
.ret_filter = (xdrproc_t) xdr_remote_domain_get_security_label_ret,
|
||||
},
|
||||
{ /* NodeGetSecurityModel => 119 */
|
||||
{ /* NodeGetSecurityModel => 122 */
|
||||
.fn = (dispatch_fn) remoteDispatchNodeGetSecurityModel,
|
||||
.args_filter = (xdrproc_t) xdr_void,
|
||||
.ret_filter = (xdrproc_t) xdr_remote_node_get_security_model_ret,
|
||||
},
|
||||
{ /* NodeDeviceCreateXml => 123 */
|
||||
.fn = (dispatch_fn) remoteDispatchNodeDeviceCreateXml,
|
||||
.args_filter = (xdrproc_t) xdr_remote_node_device_create_xml_args,
|
||||
.ret_filter = (xdrproc_t) xdr_remote_node_device_create_xml_ret,
|
||||
},
|
||||
{ /* NodeDeviceDestroy => 124 */
|
||||
.fn = (dispatch_fn) remoteDispatchNodeDeviceDestroy,
|
||||
.args_filter = (xdrproc_t) xdr_remote_node_device_destroy_args,
|
||||
.ret_filter = (xdrproc_t) xdr_void,
|
||||
},
|
||||
{ /* StorageVolCreateXmlFrom => 125 */
|
||||
.fn = (dispatch_fn) remoteDispatchStorageVolCreateXmlFrom,
|
||||
.args_filter = (xdrproc_t) xdr_remote_storage_vol_create_xml_from_args,
|
||||
.ret_filter = (xdrproc_t) xdr_remote_storage_vol_create_xml_from_ret,
|
||||
},
|
||||
{ /* NumOfInterfaces => 126 */
|
||||
.fn = (dispatch_fn) remoteDispatchNumOfInterfaces,
|
||||
.args_filter = (xdrproc_t) xdr_void,
|
||||
.ret_filter = (xdrproc_t) xdr_remote_num_of_interfaces_ret,
|
||||
},
|
||||
{ /* ListInterfaces => 127 */
|
||||
.fn = (dispatch_fn) remoteDispatchListInterfaces,
|
||||
.args_filter = (xdrproc_t) xdr_remote_list_interfaces_args,
|
||||
.ret_filter = (xdrproc_t) xdr_remote_list_interfaces_ret,
|
||||
},
|
||||
{ /* InterfaceLookupByName => 128 */
|
||||
.fn = (dispatch_fn) remoteDispatchInterfaceLookupByName,
|
||||
.args_filter = (xdrproc_t) xdr_remote_interface_lookup_by_name_args,
|
||||
.ret_filter = (xdrproc_t) xdr_remote_interface_lookup_by_name_ret,
|
||||
},
|
||||
{ /* InterfaceLookupByMacString => 129 */
|
||||
.fn = (dispatch_fn) remoteDispatchInterfaceLookupByMacString,
|
||||
.args_filter = (xdrproc_t) xdr_remote_interface_lookup_by_mac_string_args,
|
||||
.ret_filter = (xdrproc_t) xdr_remote_interface_lookup_by_mac_string_ret,
|
||||
},
|
||||
{ /* InterfaceGetXmlDesc => 130 */
|
||||
.fn = (dispatch_fn) remoteDispatchInterfaceGetXmlDesc,
|
||||
.args_filter = (xdrproc_t) xdr_remote_interface_get_xml_desc_args,
|
||||
.ret_filter = (xdrproc_t) xdr_remote_interface_get_xml_desc_ret,
|
||||
},
|
||||
{ /* InterfaceDefineXml => 131 */
|
||||
.fn = (dispatch_fn) remoteDispatchInterfaceDefineXml,
|
||||
.args_filter = (xdrproc_t) xdr_remote_interface_define_xml_args,
|
||||
.ret_filter = (xdrproc_t) xdr_remote_interface_define_xml_ret,
|
||||
},
|
||||
{ /* InterfaceUndefine => 132 */
|
||||
.fn = (dispatch_fn) remoteDispatchInterfaceUndefine,
|
||||
.args_filter = (xdrproc_t) xdr_remote_interface_undefine_args,
|
||||
.ret_filter = (xdrproc_t) xdr_void,
|
||||
},
|
||||
{ /* InterfaceCreate => 133 */
|
||||
.fn = (dispatch_fn) remoteDispatchInterfaceCreate,
|
||||
.args_filter = (xdrproc_t) xdr_remote_interface_create_args,
|
||||
.ret_filter = (xdrproc_t) xdr_void,
|
||||
},
|
||||
{ /* InterfaceDestroy => 134 */
|
||||
.fn = (dispatch_fn) remoteDispatchInterfaceDestroy,
|
||||
.args_filter = (xdrproc_t) xdr_remote_interface_destroy_args,
|
||||
.ret_filter = (xdrproc_t) xdr_void,
|
||||
},
|
||||
{ /* DomainXmlFromNative => 135 */
|
||||
.fn = (dispatch_fn) remoteDispatchDomainXmlFromNative,
|
||||
.args_filter = (xdrproc_t) xdr_remote_domain_xml_from_native_args,
|
||||
.ret_filter = (xdrproc_t) xdr_remote_domain_xml_from_native_ret,
|
||||
},
|
||||
{ /* DomainXmlToNative => 136 */
|
||||
.fn = (dispatch_fn) remoteDispatchDomainXmlToNative,
|
||||
.args_filter = (xdrproc_t) xdr_remote_domain_xml_to_native_args,
|
||||
.ret_filter = (xdrproc_t) xdr_remote_domain_xml_to_native_ret,
|
||||
},
|
||||
{ /* NumOfDefinedInterfaces => 137 */
|
||||
.fn = (dispatch_fn) remoteDispatchNumOfDefinedInterfaces,
|
||||
.args_filter = (xdrproc_t) xdr_void,
|
||||
.ret_filter = (xdrproc_t) xdr_remote_num_of_defined_interfaces_ret,
|
||||
},
|
||||
{ /* ListDefinedInterfaces => 138 */
|
||||
.fn = (dispatch_fn) remoteDispatchListDefinedInterfaces,
|
||||
.args_filter = (xdrproc_t) xdr_remote_list_defined_interfaces_args,
|
||||
.ret_filter = (xdrproc_t) xdr_remote_list_defined_interfaces_ret,
|
||||
},
|
||||
{ /* NumOfSecrets => 139 */
|
||||
.fn = (dispatch_fn) remoteDispatchNumOfSecrets,
|
||||
.args_filter = (xdrproc_t) xdr_void,
|
||||
.ret_filter = (xdrproc_t) xdr_remote_num_of_secrets_ret,
|
||||
},
|
||||
{ /* ListSecrets => 140 */
|
||||
.fn = (dispatch_fn) remoteDispatchListSecrets,
|
||||
.args_filter = (xdrproc_t) xdr_remote_list_secrets_args,
|
||||
.ret_filter = (xdrproc_t) xdr_remote_list_secrets_ret,
|
||||
},
|
||||
{ /* SecretLookupByUuid => 141 */
|
||||
.fn = (dispatch_fn) remoteDispatchSecretLookupByUuid,
|
||||
.args_filter = (xdrproc_t) xdr_remote_secret_lookup_by_uuid_args,
|
||||
.ret_filter = (xdrproc_t) xdr_remote_secret_lookup_by_uuid_ret,
|
||||
},
|
||||
{ /* SecretDefineXml => 142 */
|
||||
.fn = (dispatch_fn) remoteDispatchSecretDefineXml,
|
||||
.args_filter = (xdrproc_t) xdr_remote_secret_define_xml_args,
|
||||
.ret_filter = (xdrproc_t) xdr_remote_secret_define_xml_ret,
|
||||
},
|
||||
{ /* SecretGetXmlDesc => 143 */
|
||||
.fn = (dispatch_fn) remoteDispatchSecretGetXmlDesc,
|
||||
.args_filter = (xdrproc_t) xdr_remote_secret_get_xml_desc_args,
|
||||
.ret_filter = (xdrproc_t) xdr_remote_secret_get_xml_desc_ret,
|
||||
},
|
||||
{ /* SecretSetValue => 144 */
|
||||
.fn = (dispatch_fn) remoteDispatchSecretSetValue,
|
||||
.args_filter = (xdrproc_t) xdr_remote_secret_set_value_args,
|
||||
.ret_filter = (xdrproc_t) xdr_void,
|
||||
},
|
||||
{ /* SecretGetValue => 145 */
|
||||
.fn = (dispatch_fn) remoteDispatchSecretGetValue,
|
||||
.args_filter = (xdrproc_t) xdr_remote_secret_get_value_args,
|
||||
.ret_filter = (xdrproc_t) xdr_remote_secret_get_value_ret,
|
||||
},
|
||||
{ /* SecretUndefine => 146 */
|
||||
.fn = (dispatch_fn) remoteDispatchSecretUndefine,
|
||||
.args_filter = (xdrproc_t) xdr_remote_secret_undefine_args,
|
||||
.ret_filter = (xdrproc_t) xdr_void,
|
||||
},
|
||||
{ /* SecretLookupByUsage => 147 */
|
||||
.fn = (dispatch_fn) remoteDispatchSecretLookupByUsage,
|
||||
.args_filter = (xdrproc_t) xdr_remote_secret_lookup_by_usage_args,
|
||||
.ret_filter = (xdrproc_t) xdr_remote_secret_lookup_by_usage_ret,
|
||||
},
|
||||
{ /* DomainMigratePrepareTunnel => 148 */
|
||||
.fn = (dispatch_fn) remoteDispatchDomainMigratePrepareTunnel,
|
||||
.args_filter = (xdrproc_t) xdr_remote_domain_migrate_prepare_tunnel_args,
|
||||
.ret_filter = (xdrproc_t) xdr_void,
|
||||
},
|
@ -65,6 +65,16 @@ while (<>) {
|
||||
ret => "remote_${name}_ret"
|
||||
}
|
||||
}
|
||||
} elsif (/^struct remote_(.*)_msg/) {
|
||||
$name = $1;
|
||||
$ProcName = name_to_ProcName ($name);
|
||||
|
||||
$calls{$name} = {
|
||||
name => $name,
|
||||
ProcName => $ProcName,
|
||||
UC_NAME => uc $name,
|
||||
msg => "remote_${name}_msg"
|
||||
}
|
||||
} elsif (/^\s*REMOTE_PROC_(.*?)\s+=\s+(\d+),?$/) {
|
||||
$name = lc $1;
|
||||
$id = $2;
|
||||
@ -98,10 +108,14 @@ if ($opt_d) {
|
||||
elsif ($opt_p) {
|
||||
my @keys = sort (keys %calls);
|
||||
foreach (@keys) {
|
||||
# Skip things which are REMOTE_MESSAGE
|
||||
next if $calls{$_}->{msg};
|
||||
|
||||
print "static int remoteDispatch$calls{$_}->{ProcName}(\n";
|
||||
print " struct qemud_server *server,\n";
|
||||
print " struct qemud_client *client,\n";
|
||||
print " virConnectPtr conn,\n";
|
||||
print " remote_message_header *hdr,\n";
|
||||
print " remote_error *err,\n";
|
||||
print " $calls{$_}->{args} *args,\n";
|
||||
print " $calls{$_}->{ret} *ret);\n";
|
||||
@ -113,6 +127,7 @@ elsif ($opt_p) {
|
||||
elsif ($opt_a) {
|
||||
for ($id = 0 ; $id <= $#calls ; $id++) {
|
||||
if (defined $calls[$id] &&
|
||||
!$calls[$id]->{msg} &&
|
||||
$calls[$id]->{args} ne "void") {
|
||||
print " $calls[$id]->{args} val_$calls[$id]->{args};\n";
|
||||
}
|
||||
@ -124,6 +139,7 @@ elsif ($opt_a) {
|
||||
elsif ($opt_r) {
|
||||
for ($id = 0 ; $id <= $#calls ; $id++) {
|
||||
if (defined $calls[$id] &&
|
||||
!$calls[$id]->{msg} &&
|
||||
$calls[$id]->{ret} ne "void") {
|
||||
print " $calls[$id]->{ret} val_$calls[$id]->{ret};\n";
|
||||
}
|
||||
@ -134,7 +150,7 @@ elsif ($opt_r) {
|
||||
# ("remote_dispatch_table.h").
|
||||
elsif ($opt_t) {
|
||||
for ($id = 0 ; $id <= $#calls ; $id++) {
|
||||
if (defined $calls[$id]) {
|
||||
if (defined $calls[$id] && !$calls[$id]->{msg}) {
|
||||
print "{ /* $calls[$id]->{ProcName} => $id */\n";
|
||||
print " .fn = (dispatch_fn) remoteDispatch$calls[$id]->{ProcName},\n";
|
||||
if ($calls[$id]->{args} ne "void") {
|
||||
@ -149,7 +165,11 @@ elsif ($opt_t) {
|
||||
}
|
||||
print "},\n";
|
||||
} else {
|
||||
print "{ /* (unused) => $id */\n";
|
||||
if ($calls[$id]->{msg}) {
|
||||
print "{ /* Async event $calls[$id]->{ProcName} => $id */\n";
|
||||
} else {
|
||||
print "{ /* (unused) => $id */\n";
|
||||
}
|
||||
print " .fn = NULL,\n";
|
||||
print " .args_filter = (xdrproc_t) xdr_void,\n";
|
||||
print " .ret_filter = (xdrproc_t) xdr_void,\n";
|
607
daemon/stream.c
Normal file
607
daemon/stream.c
Normal file
@ -0,0 +1,607 @@
|
||||
/*
|
||||
* stream.c: APIs for managing client streams
|
||||
*
|
||||
* Copyright (C) 2009 Red Hat, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* Author: Daniel P. Berrange <berrange@redhat.com>
|
||||
*/
|
||||
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "stream.h"
|
||||
#include "memory.h"
|
||||
#include "dispatch.h"
|
||||
#include "logging.h"
|
||||
|
||||
static int
|
||||
remoteStreamHandleWrite(struct qemud_client *client,
|
||||
struct qemud_client_stream *stream);
|
||||
static int
|
||||
remoteStreamHandleRead(struct qemud_client *client,
|
||||
struct qemud_client_stream *stream);
|
||||
static int
|
||||
remoteStreamHandleFinish(struct qemud_client *client,
|
||||
struct qemud_client_stream *stream,
|
||||
struct qemud_client_message *msg);
|
||||
static int
|
||||
remoteStreamHandleAbort(struct qemud_client *client,
|
||||
struct qemud_client_stream *stream,
|
||||
struct qemud_client_message *msg);
|
||||
|
||||
|
||||
|
||||
static void
|
||||
remoteStreamUpdateEvents(struct qemud_client_stream *stream)
|
||||
{
|
||||
int newEvents = 0;
|
||||
if (stream->rx)
|
||||
newEvents |= VIR_STREAM_EVENT_WRITABLE;
|
||||
if (stream->tx && !stream->recvEOF)
|
||||
newEvents |= VIR_STREAM_EVENT_READABLE;
|
||||
|
||||
virStreamEventUpdateCallback(stream->st, newEvents);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Callback that gets invoked when a stream becomes writable/readable
|
||||
*/
|
||||
static void
|
||||
remoteStreamEvent(virStreamPtr st, int events, void *opaque)
|
||||
{
|
||||
struct qemud_client *client = opaque;
|
||||
struct qemud_client_stream *stream;
|
||||
|
||||
/* XXX sub-optimal - we really should be taking the server lock
|
||||
* first, but we have no handle to the server object
|
||||
* We're lucky to get away with it for now, due to this callback
|
||||
* executing in the main thread, but this should really be fixed
|
||||
*/
|
||||
virMutexLock(&client->lock);
|
||||
|
||||
stream = remoteFindClientStream(client, st);
|
||||
|
||||
if (!stream) {
|
||||
VIR_WARN("event for client=%p stream st=%p, but missing stream state", client, st);
|
||||
virStreamEventRemoveCallback(st);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
DEBUG("st=%p events=%d", st, events);
|
||||
|
||||
if (events & VIR_STREAM_EVENT_WRITABLE) {
|
||||
if (remoteStreamHandleWrite(client, stream) < 0) {
|
||||
remoteRemoveClientStream(client, stream);
|
||||
qemudDispatchClientFailure(client);
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
|
||||
if (!stream->recvEOF &&
|
||||
(events & (VIR_STREAM_EVENT_READABLE | VIR_STREAM_EVENT_HANGUP))) {
|
||||
events = events & ~(VIR_STREAM_EVENT_READABLE | VIR_STREAM_EVENT_HANGUP);
|
||||
if (remoteStreamHandleRead(client, stream) < 0) {
|
||||
remoteRemoveClientStream(client, stream);
|
||||
qemudDispatchClientFailure(client);
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
|
||||
if (!stream->closed &&
|
||||
(events & (VIR_STREAM_EVENT_ERROR | VIR_STREAM_EVENT_HANGUP))) {
|
||||
int ret;
|
||||
remote_error rerr;
|
||||
memset(&rerr, 0, sizeof rerr);
|
||||
stream->closed = 1;
|
||||
virStreamAbort(stream->st);
|
||||
if (events & VIR_STREAM_EVENT_HANGUP)
|
||||
remoteDispatchFormatError(&rerr, "%s", _("stream had unexpected termination"));
|
||||
else
|
||||
remoteDispatchFormatError(&rerr, "%s", _("stream had I/O failure"));
|
||||
ret = remoteSerializeStreamError(client, &rerr, stream->procedure, stream->serial);
|
||||
remoteRemoveClientStream(client, stream);
|
||||
if (ret < 0)
|
||||
qemudDispatchClientFailure(client);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (stream->closed) {
|
||||
remoteRemoveClientStream(client, stream);
|
||||
} else {
|
||||
remoteStreamUpdateEvents(stream);
|
||||
}
|
||||
|
||||
cleanup:
|
||||
virMutexUnlock(&client->lock);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* @client: a locked client object
|
||||
*
|
||||
* Invoked by the main loop when filtering incoming messages.
|
||||
*
|
||||
* Returns 1 if the message was processed, 0 if skipped,
|
||||
* -1 on fatal client error
|
||||
*/
|
||||
static int
|
||||
remoteStreamFilter(struct qemud_client *client,
|
||||
struct qemud_client_message *msg, void *opaque)
|
||||
{
|
||||
struct qemud_client_stream *stream = opaque;
|
||||
|
||||
if (msg->hdr.serial == stream->serial &&
|
||||
msg->hdr.proc == stream->procedure &&
|
||||
msg->hdr.type == REMOTE_STREAM) {
|
||||
DEBUG("Incoming rx=%p serial=%d proc=%d status=%d",
|
||||
stream->rx, msg->hdr.proc, msg->hdr.serial, msg->hdr.status);
|
||||
|
||||
/* If there are queued packets, we need to queue all further
|
||||
* messages, since they must be processed strictly in order.
|
||||
* If there are no queued packets, then OK/ERROR messages
|
||||
* should be processed immediately. Data packets are still
|
||||
* queued to only be processed when the stream is marked as
|
||||
* writable.
|
||||
*/
|
||||
if (stream->rx) {
|
||||
qemudClientMessageQueuePush(&stream->rx, msg);
|
||||
remoteStreamUpdateEvents(stream);
|
||||
} else {
|
||||
int ret = 0;
|
||||
switch (msg->hdr.status) {
|
||||
case REMOTE_OK:
|
||||
ret = remoteStreamHandleFinish(client, stream, msg);
|
||||
if (ret == 0)
|
||||
qemudClientMessageRelease(client, msg);
|
||||
break;
|
||||
|
||||
case REMOTE_CONTINUE:
|
||||
qemudClientMessageQueuePush(&stream->rx, msg);
|
||||
remoteStreamUpdateEvents(stream);
|
||||
break;
|
||||
|
||||
case REMOTE_ERROR:
|
||||
default:
|
||||
ret = remoteStreamHandleAbort(client, stream, msg);
|
||||
if (ret == 0)
|
||||
qemudClientMessageRelease(client, msg);
|
||||
break;
|
||||
}
|
||||
|
||||
if (ret < 0)
|
||||
return -1;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* @conn: a connection object to associate the stream with
|
||||
* @hdr: the method call to associate with the stram
|
||||
*
|
||||
* Creates a new stream for this conn
|
||||
*
|
||||
* Returns a new stream object, or NULL upon OOM
|
||||
*/
|
||||
struct qemud_client_stream *
|
||||
remoteCreateClientStream(virConnectPtr conn,
|
||||
remote_message_header *hdr)
|
||||
{
|
||||
struct qemud_client_stream *stream;
|
||||
|
||||
DEBUG("proc=%d serial=%d", hdr->proc, hdr->serial);
|
||||
|
||||
if (VIR_ALLOC(stream) < 0)
|
||||
return NULL;
|
||||
|
||||
stream->procedure = hdr->proc;
|
||||
stream->serial = hdr->serial;
|
||||
|
||||
stream->st = virStreamNew(conn, VIR_STREAM_NONBLOCK);
|
||||
if (!stream->st) {
|
||||
VIR_FREE(stream);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
stream->filter.query = remoteStreamFilter;
|
||||
stream->filter.opaque = stream;
|
||||
|
||||
return stream;
|
||||
}
|
||||
|
||||
/*
|
||||
* @stream: an unused client stream
|
||||
*
|
||||
* Frees the memory associated with this inactive client
|
||||
* stream
|
||||
*/
|
||||
void remoteFreeClientStream(struct qemud_client *client,
|
||||
struct qemud_client_stream *stream)
|
||||
{
|
||||
struct qemud_client_message *msg;
|
||||
|
||||
if (!stream)
|
||||
return;
|
||||
|
||||
DEBUG("proc=%d serial=%d", stream->procedure, stream->serial);
|
||||
|
||||
msg = stream->rx;
|
||||
while (msg) {
|
||||
struct qemud_client_message *tmp = msg->next;
|
||||
qemudClientMessageRelease(client, msg);
|
||||
msg = tmp;
|
||||
}
|
||||
|
||||
virStreamFree(stream->st);
|
||||
VIR_FREE(stream);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* @client: a locked client to add the stream to
|
||||
* @stream: a stream to add
|
||||
*/
|
||||
int remoteAddClientStream(struct qemud_client *client,
|
||||
struct qemud_client_stream *stream,
|
||||
int transmit)
|
||||
{
|
||||
struct qemud_client_stream *tmp = client->streams;
|
||||
|
||||
DEBUG("client=%p proc=%d serial=%d", client, stream->procedure, stream->serial);
|
||||
|
||||
if (virStreamEventAddCallback(stream->st, 0,
|
||||
remoteStreamEvent, client, NULL) < 0)
|
||||
return -1;
|
||||
|
||||
if (tmp) {
|
||||
while (tmp->next)
|
||||
tmp = tmp->next;
|
||||
tmp->next = stream;
|
||||
} else {
|
||||
client->streams = stream;
|
||||
}
|
||||
|
||||
stream->filter.next = client->filters;
|
||||
client->filters = &stream->filter;
|
||||
|
||||
if (transmit)
|
||||
stream->tx = 1;
|
||||
|
||||
remoteStreamUpdateEvents(stream);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* @client: a locked client object
|
||||
* @procedure: procedure associated with the stream
|
||||
* @serial: serial number associated with the stream
|
||||
*
|
||||
* Finds a existing active stream
|
||||
*
|
||||
* Returns a stream object matching the procedure+serial number, or NULL
|
||||
*/
|
||||
struct qemud_client_stream *
|
||||
remoteFindClientStream(struct qemud_client *client,
|
||||
virStreamPtr st)
|
||||
{
|
||||
struct qemud_client_stream *stream = client->streams;
|
||||
|
||||
while (stream) {
|
||||
if (stream->st == st)
|
||||
return stream;
|
||||
stream = stream->next;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* @client: a locked client object
|
||||
* @stream: an inactive, closed stream object
|
||||
*
|
||||
* Removes a stream from the list of active streams for the client
|
||||
*
|
||||
* Returns 0 if the stream was removd, -1 if it doesn't exist
|
||||
*/
|
||||
int
|
||||
remoteRemoveClientStream(struct qemud_client *client,
|
||||
struct qemud_client_stream *stream)
|
||||
{
|
||||
DEBUG("client=%p proc=%d serial=%d", client, stream->procedure, stream->serial);
|
||||
|
||||
struct qemud_client_stream *curr = client->streams;
|
||||
struct qemud_client_stream *prev = NULL;
|
||||
struct qemud_client_filter *filter = NULL;
|
||||
|
||||
if (client->filters == &stream->filter) {
|
||||
client->filters = client->filters->next;
|
||||
} else {
|
||||
filter = client->filters;
|
||||
while (filter) {
|
||||
if (filter->next == &stream->filter) {
|
||||
filter->next = filter->next->next;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!stream->closed)
|
||||
virStreamAbort(stream->st);
|
||||
|
||||
while (curr) {
|
||||
if (curr == stream) {
|
||||
if (prev)
|
||||
prev->next = curr->next;
|
||||
else
|
||||
client->streams = curr->next;
|
||||
remoteFreeClientStream(client, stream);
|
||||
return 0;
|
||||
}
|
||||
prev = curr;
|
||||
curr = curr->next;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Returns:
|
||||
* -1 if fatal error occurred
|
||||
* 0 if message was fully processed
|
||||
* 1 if message is still being processed
|
||||
*/
|
||||
static int
|
||||
remoteStreamHandleWriteData(struct qemud_client *client,
|
||||
struct qemud_client_stream *stream,
|
||||
struct qemud_client_message *msg)
|
||||
{
|
||||
remote_error rerr;
|
||||
int ret;
|
||||
|
||||
DEBUG("stream=%p proc=%d serial=%d len=%d offset=%d",
|
||||
stream, msg->hdr.proc, msg->hdr.serial, msg->bufferLength, msg->bufferOffset);
|
||||
|
||||
memset(&rerr, 0, sizeof rerr);
|
||||
|
||||
ret = virStreamSend(stream->st,
|
||||
msg->buffer + msg->bufferOffset,
|
||||
msg->bufferLength - msg->bufferOffset);
|
||||
|
||||
if (ret > 0) {
|
||||
msg->bufferOffset += ret;
|
||||
|
||||
/* Partial write, so indicate we have more todo later */
|
||||
if (msg->bufferOffset < msg->bufferLength)
|
||||
return 1;
|
||||
} else if (ret == -2) {
|
||||
/* Blocking, so indicate we have more todo later */
|
||||
return 1;
|
||||
} else {
|
||||
VIR_INFO0("Stream send failed");
|
||||
stream->closed = 1;
|
||||
remoteDispatchConnError(&rerr, client->conn);
|
||||
return remoteSerializeReplyError(client, &rerr, &msg->hdr);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Process an finish handshake from the client.
|
||||
*
|
||||
* Returns a REMOTE_OK confirmation if successful, or a REMOTE_ERROR
|
||||
* if there was a stream error
|
||||
*
|
||||
* Returns 0 if successfully sent RPC reply, -1 upon fatal error
|
||||
*/
|
||||
static int
|
||||
remoteStreamHandleFinish(struct qemud_client *client,
|
||||
struct qemud_client_stream *stream,
|
||||
struct qemud_client_message *msg)
|
||||
{
|
||||
remote_error rerr;
|
||||
int ret;
|
||||
|
||||
DEBUG("stream=%p proc=%d serial=%d",
|
||||
stream, msg->hdr.proc, msg->hdr.serial);
|
||||
|
||||
memset(&rerr, 0, sizeof rerr);
|
||||
|
||||
stream->closed = 1;
|
||||
ret = virStreamFinish(stream->st);
|
||||
|
||||
if (ret < 0) {
|
||||
remoteDispatchConnError(&rerr, client->conn);
|
||||
return remoteSerializeReplyError(client, &rerr, &msg->hdr);
|
||||
} else {
|
||||
/* Send zero-length confirm */
|
||||
if (remoteSendStreamData(client, stream, NULL, 0) < 0)
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Process an abort request from the client.
|
||||
*
|
||||
* Returns 0 if successfully aborted, -1 upon error
|
||||
*/
|
||||
static int
|
||||
remoteStreamHandleAbort(struct qemud_client *client,
|
||||
struct qemud_client_stream *stream,
|
||||
struct qemud_client_message *msg)
|
||||
{
|
||||
remote_error rerr;
|
||||
|
||||
DEBUG("stream=%p proc=%d serial=%d",
|
||||
stream, msg->hdr.proc, msg->hdr.serial);
|
||||
|
||||
memset(&rerr, 0, sizeof rerr);
|
||||
|
||||
stream->closed = 1;
|
||||
virStreamAbort(stream->st);
|
||||
|
||||
if (msg->hdr.status == REMOTE_ERROR)
|
||||
remoteDispatchFormatError(&rerr, "%s", _("stream aborted at client request"));
|
||||
else {
|
||||
VIR_WARN("unexpected stream status %d", msg->hdr.status);
|
||||
remoteDispatchFormatError(&rerr, _("stream aborted with unexpected status %d"),
|
||||
msg->hdr.status);
|
||||
}
|
||||
|
||||
return remoteSerializeReplyError(client, &rerr, &msg->hdr);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Called when the stream is signalled has being able to accept
|
||||
* data writes. Will process all pending incoming messages
|
||||
* until they're all gone, or I/O blocks
|
||||
*
|
||||
* Returns 0 on success, or -1 upon fatal error
|
||||
*/
|
||||
static int
|
||||
remoteStreamHandleWrite(struct qemud_client *client,
|
||||
struct qemud_client_stream *stream)
|
||||
{
|
||||
struct qemud_client_message *msg, *tmp;
|
||||
|
||||
DEBUG("stream=%p", stream);
|
||||
|
||||
msg = stream->rx;
|
||||
while (msg && !stream->closed) {
|
||||
int ret;
|
||||
switch (msg->hdr.status) {
|
||||
case REMOTE_OK:
|
||||
ret = remoteStreamHandleFinish(client, stream, msg);
|
||||
break;
|
||||
|
||||
case REMOTE_CONTINUE:
|
||||
ret = remoteStreamHandleWriteData(client, stream, msg);
|
||||
break;
|
||||
|
||||
case REMOTE_ERROR:
|
||||
default:
|
||||
ret = remoteStreamHandleAbort(client, stream, msg);
|
||||
break;
|
||||
}
|
||||
|
||||
if (ret == 0)
|
||||
qemudClientMessageQueueServe(&stream->rx);
|
||||
else if (ret < 0)
|
||||
return -1;
|
||||
else
|
||||
break; /* still processing data */
|
||||
|
||||
tmp = msg->next;
|
||||
qemudClientMessageRelease(client, msg);
|
||||
msg = tmp;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Invoked when a stream is signalled as having data
|
||||
* available to read. This reads upto one message
|
||||
* worth of data, and then queues that for transmission
|
||||
* to the client.
|
||||
*
|
||||
* Returns 0 if data was queued for TX, or a error RPC
|
||||
* was sent, or -1 on fatal error, indicating client should
|
||||
* be killed
|
||||
*/
|
||||
static int
|
||||
remoteStreamHandleRead(struct qemud_client *client,
|
||||
struct qemud_client_stream *stream)
|
||||
{
|
||||
char *buffer;
|
||||
size_t bufferLen = REMOTE_MESSAGE_PAYLOAD_MAX;
|
||||
int ret;
|
||||
|
||||
DEBUG("stream=%p", stream);
|
||||
|
||||
/* Shouldn't ever be called unless we're marked able to
|
||||
* transmit, but doesn't hurt to check */
|
||||
if (!stream->tx)
|
||||
return 0;
|
||||
|
||||
if (VIR_ALLOC_N(buffer, bufferLen) < 0)
|
||||
return -1;
|
||||
|
||||
ret = virStreamRecv(stream->st, buffer, bufferLen);
|
||||
if (ret == -2) {
|
||||
/* Should never get this, since we're only called when we know
|
||||
* we're readable, but hey things change... */
|
||||
ret = 0;
|
||||
} else if (ret < 0) {
|
||||
remote_error rerr;
|
||||
memset(&rerr, 0, sizeof rerr);
|
||||
remoteDispatchConnError(&rerr, NULL);
|
||||
|
||||
ret = remoteSerializeStreamError(client, &rerr, stream->procedure, stream->serial);
|
||||
} else {
|
||||
stream->tx = 0;
|
||||
if (ret == 0)
|
||||
stream->recvEOF = 1;
|
||||
ret = remoteSendStreamData(client, stream, buffer, ret);
|
||||
}
|
||||
|
||||
VIR_FREE(buffer);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Invoked when an outgoing data packet message has been fully sent.
|
||||
* This simply re-enables TX of further data.
|
||||
*
|
||||
* The idea is to stop the daemon growing without bound due to
|
||||
* fast stream, but slow client
|
||||
*/
|
||||
void
|
||||
remoteStreamMessageFinished(struct qemud_client *client,
|
||||
struct qemud_client_message *msg)
|
||||
{
|
||||
struct qemud_client_stream *stream = client->streams;
|
||||
|
||||
while (stream) {
|
||||
if (msg->hdr.proc == stream->procedure &&
|
||||
msg->hdr.serial == stream->serial)
|
||||
break;
|
||||
stream = stream->next;
|
||||
}
|
||||
|
||||
DEBUG("Message client=%p stream=%p proc=%d serial=%d", client, stream, msg->hdr.proc, msg->hdr.serial);
|
||||
|
||||
if (stream) {
|
||||
stream->tx = 1;
|
||||
remoteStreamUpdateEvents(stream);
|
||||
}
|
||||
}
|
54
daemon/stream.h
Normal file
54
daemon/stream.h
Normal file
@ -0,0 +1,54 @@
|
||||
/*
|
||||
* stream.h: APIs for managing client streams
|
||||
*
|
||||
* Copyright (C) 2009 Red Hat, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* Author: Daniel P. Berrange <berrange@redhat.com>
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __LIBVIRTD_STREAM_H__
|
||||
#define __LIBVIRTD_STREAM_H__
|
||||
|
||||
#include "libvirtd.h"
|
||||
|
||||
|
||||
|
||||
struct qemud_client_stream *
|
||||
remoteCreateClientStream(virConnectPtr conn,
|
||||
remote_message_header *hdr);
|
||||
|
||||
void remoteFreeClientStream(struct qemud_client *client,
|
||||
struct qemud_client_stream *stream);
|
||||
|
||||
int remoteAddClientStream(struct qemud_client *client,
|
||||
struct qemud_client_stream *stream,
|
||||
int transmit);
|
||||
|
||||
struct qemud_client_stream *
|
||||
remoteFindClientStream(struct qemud_client *client,
|
||||
virStreamPtr stream);
|
||||
|
||||
int
|
||||
remoteRemoveClientStream(struct qemud_client *client,
|
||||
struct qemud_client_stream *stream);
|
||||
|
||||
void
|
||||
remoteStreamMessageFinished(struct qemud_client *client,
|
||||
struct qemud_client_message *msg);
|
||||
|
||||
#endif /* __LIBVIRTD_STREAM_H__ */
|
@ -1,4 +0,0 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
.memdump
|
||||
apibuild.pyc
|
3
docs/.gitignore
vendored
3
docs/.gitignore
vendored
@ -2,3 +2,6 @@ Makefile
|
||||
Makefile.in
|
||||
.memdump
|
||||
apibuild.pyc
|
||||
*.html
|
||||
libvirt-api.xml
|
||||
libvirt-refs.xml
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 495 B |
198
docs/FAQ.html
198
docs/FAQ.html
@ -1,198 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!--
|
||||
This file is autogenerated from FAQ.html.in
|
||||
Do not edit this file. Changes will be lost.
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
|
||||
<link rel="stylesheet" type="text/css" href="main.css" />
|
||||
<link rel="SHORTCUT ICON" href="32favicon.png" />
|
||||
<title>libvirt: FAQ</title>
|
||||
<meta name="description" content="libvirt, virtualization, virtualization API" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="headerLogo"></div>
|
||||
<div id="headerSearch">
|
||||
<form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><div>
|
||||
<input id="query" name="query" type="text" size="12" value="" />
|
||||
<input id="submit" name="submit" type="submit" value="Search" />
|
||||
</div></form>
|
||||
</div>
|
||||
</div>
|
||||
<div id="body">
|
||||
<div id="menu">
|
||||
<ul class="l0"><li>
|
||||
<div>
|
||||
<a title="Front page of the libvirt website" class="inactive" href="index.html">Home</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Details of new features and bugs fixed in each release" class="inactive" href="news.html">News</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Get the latest source releases, binary builds and get access to the source repository" class="inactive" href="downloads.html">Downloads</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Information for users, administrators and developers" class="inactive" href="docs.html">Documentation</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="User contributed content" class="inactive" href="http://wiki.libvirt.org">Wiki</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<span class="active">FAQ</span>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How and where to report bugs and request features" class="inactive" href="bugs.html">Bug reports</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How to contact the developers via email and IRC" class="inactive" href="contact.html">Contact</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Miscellaneous links of interest related to libvirt" class="inactive" href="relatedlinks.html">Related Links</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of all content on the website" class="inactive" href="sitemap.html">Sitemap</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
<div id="content">
|
||||
<h1>FAQ</h1>
|
||||
<p>Table of Contents:</p>
|
||||
<ul><li>
|
||||
<a href="FAQ.html#License">License(s)</a>
|
||||
</li><li>
|
||||
<a href="FAQ.html#Installati">Installation</a>
|
||||
</li><li>
|
||||
<a href="FAQ.html#Compilatio">Compilation</a>
|
||||
</li><li>
|
||||
<a href="FAQ.html#Developer">Developer corner</a>
|
||||
</li></ul>
|
||||
<h3><a name="License" id="License">License</a>(s)</h3>
|
||||
<ol><li>
|
||||
<em>Licensing Terms for libvirt</em>
|
||||
<p>libvirt is released under the <a href="http://www.opensource.org/licenses/lgpl-license.html">GNU Lesser
|
||||
General Public License</a>, see the file COPYING.LIB in the distribution
|
||||
for the precise wording. The only library that libvirt depends upon is
|
||||
the Xen store access library which is also licenced under the LGPL.</p>
|
||||
</li><li>
|
||||
<em>Can I embed libvirt in a proprietary application ?</em>
|
||||
<p>Yes. The LGPL allows you to embed libvirt into a proprietary
|
||||
application. It would be graceful to send-back bug fixes and improvements
|
||||
as patches for possible incorporation in the main development tree. It
|
||||
will decrease your maintenance costs anyway if you do so.</p>
|
||||
</li></ol>
|
||||
<h3>
|
||||
<a name="Installati" id="Installati">Installation</a>
|
||||
</h3>
|
||||
<ol><li><em>Where can I get libvirt</em> ?
|
||||
<p>The original distribution comes from <a href="ftp://libvirt.org/libvirt/">ftp://libvirt.org/libvirt/</a>.</p>
|
||||
</li><li>
|
||||
<em>I can't install the libvirt/libvirt-devel RPM packages due to
|
||||
failed dependencies</em>
|
||||
<p>The most generic solution is to re-fetch the latest src.rpm , and
|
||||
rebuild it locally with</p>
|
||||
<p><code>rpm --rebuild libvirt-xxx.src.rpm</code>.</p>
|
||||
<p>If everything goes well it will generate two binary rpm packages (one
|
||||
providing the shared libs and virsh, and the other one, the -devel
|
||||
package, providing includes, static libraries and scripts needed to build
|
||||
applications with libvirt that you can install locally.</p>
|
||||
<p>One can also rebuild the RPMs from a tarball:</p>
|
||||
<p>
|
||||
<code>rpmbuild -ta libdir-xxx.tar.gz</code>
|
||||
</p>
|
||||
<p>Or from a configured tree with:</p>
|
||||
<p>
|
||||
<code>make rpm</code>
|
||||
</p>
|
||||
</li><li>
|
||||
<em>Failure to use the API for non-root users</em>
|
||||
<p>Large parts of the API may only be accessible with root privileges,
|
||||
however the read only access to the xenstore data doesnot have to be
|
||||
forbidden to user, at least for monitoring purposes. If "virsh dominfo"
|
||||
fails to run as an user, change the mode of the xenstore read-only socket
|
||||
with:</p>
|
||||
<p>
|
||||
<code>chmod 666 /var/run/xenstored/socket_ro</code>
|
||||
</p>
|
||||
<p>and also make sure that the Xen Daemon is running correctly with local
|
||||
HTTP server enabled, this is defined in
|
||||
<code>/etc/xen/xend-config.sxp</code> which need the following line to be
|
||||
enabled:</p>
|
||||
<p>
|
||||
<code>(xend-http-server yes)</code>
|
||||
</p>
|
||||
<p>If needed restart the xend daemon after making the change with the
|
||||
following command run as root:</p>
|
||||
<p>
|
||||
<code>service xend restart</code>
|
||||
</p>
|
||||
</li></ol>
|
||||
<h3>
|
||||
<a name="Compilatio" id="Compilatio">Compilation</a>
|
||||
</h3>
|
||||
<ol><li>
|
||||
<em>What is the process to compile libvirt ?</em>
|
||||
<p>As most UNIX libraries libvirt follows the "standard":</p>
|
||||
<p>
|
||||
<code>gunzip -c libvirt-xxx.tar.gz | tar xvf -</code>
|
||||
</p>
|
||||
<p>
|
||||
<code>cd libvirt-xxxx</code>
|
||||
</p>
|
||||
<p>
|
||||
<code>./configure --help</code>
|
||||
</p>
|
||||
<p>to see the options, then the compilation/installation proper</p>
|
||||
<p>
|
||||
<code>./configure [possible options]</code>
|
||||
</p>
|
||||
<p>
|
||||
<code>make</code>
|
||||
</p>
|
||||
<p>
|
||||
<code>make install</code>
|
||||
</p>
|
||||
<p>At that point you may have to rerun ldconfig or a similar utility to
|
||||
update your list of installed shared libs.</p>
|
||||
</li><li>
|
||||
<em>What other libraries are needed to compile/install libvirt ?</em>
|
||||
<p>Libvirt requires libxenstore, which is usually provided by the xen
|
||||
packages as well as the public headers to compile against libxenstore.</p>
|
||||
</li><li>
|
||||
<em>I use the CVS version and there is no configure script</em>
|
||||
<p>The configure script (and other Makefiles) are generated. Use the
|
||||
autogen.sh script to regenerate the configure script and Makefiles,
|
||||
like:</p>
|
||||
<p>
|
||||
<code>./autogen.sh --prefix=/usr --disable-shared</code>
|
||||
</p>
|
||||
</li></ol>
|
||||
<h3><a name="Developer" id="Developer">Developer</a> corner</h3>
|
||||
<ol><li>
|
||||
<em>Troubles compiling or linking programs using libvirt</em>
|
||||
<p>To simplify the process of reusing the library, libvirt comes with
|
||||
pkgconfig support, which can be used directly from autoconf support or
|
||||
via the pkg-config command line tool, like:</p>
|
||||
<p>
|
||||
<code>pkg-config libvirt --libs</code>
|
||||
</p>
|
||||
</li></ol>
|
||||
</div>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<p id="sponsor">
|
||||
Sponsored by:<br /><a href="http://et.redhat.com/"><img src="et.png" alt="Project sponsored by Red Hat Emerging Technology" /></a></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
28
docs/Goals
28
docs/Goals
@ -1,28 +0,0 @@
|
||||
|
||||
Why libxen:
|
||||
-----------
|
||||
|
||||
|
||||
The main goals of the library is to provide an stable API abstracting
|
||||
the underlying acual implementation of the hypervisor calls.
|
||||
|
||||
1/ Stable API:
|
||||
by isolating the data structures and entry points used at the low
|
||||
level Xen Hypervisor interfaces, allowing evolution of said interface
|
||||
over time without breaking the application visible API and ABI
|
||||
|
||||
2/ Abstraction:
|
||||
by providing at the C level simplified concept exposed only as opaque
|
||||
structure for the hypervisor connection, domains and other kind of
|
||||
objects which may be needed in the future. It must also provide
|
||||
a set of higher level function calls simplifying the developement
|
||||
of applications using the supervisor.
|
||||
|
||||
3/ Maintainability and openness:
|
||||
All data structures and entry points must be fully documented, all
|
||||
changes will be driven in an open fashion based on a publicly archived
|
||||
mailing-list allowing peer-review before changes will be introduced.
|
||||
Tools and regression tests will be implemented and shipped as part of the
|
||||
releases of the library.
|
||||
|
||||
Daniel Veillard <veillard@redhat.com>
|
Binary file not shown.
Before Width: | Height: | Size: 3.0 KiB |
@ -1,10 +1,10 @@
|
||||
## Process this file with automake to produce Makefile.in
|
||||
SUBDIRS= schemas examples devhelp
|
||||
SUBDIRS= schemas
|
||||
|
||||
# The directory containing the source code (if it contains documentation).
|
||||
DOC_SOURCE_DIR=../src
|
||||
|
||||
man_MANS=
|
||||
DEVHELP_DIR=$(datadir)/gtk-doc/html/libvirt
|
||||
|
||||
apihtml = \
|
||||
html/index.html \
|
||||
@ -17,62 +17,74 @@ apipng = \
|
||||
html/home.png \
|
||||
html/right.png
|
||||
|
||||
devhelphtml = \
|
||||
devhelp/libvirt.devhelp \
|
||||
devhelp/index.html \
|
||||
devhelp/general.html \
|
||||
devhelp/libvirt-libvirt.html \
|
||||
devhelp/libvirt-virterror.html
|
||||
|
||||
devhelppng = \
|
||||
devhelp/home.png \
|
||||
devhelp/left.png \
|
||||
devhelp/right.png \
|
||||
devhelp/up.png
|
||||
|
||||
devhelpcss = devhelp/style.css
|
||||
|
||||
devhelpxsl = devhelp/devhelp.xsl devhelp/html.xsl
|
||||
|
||||
png = \
|
||||
16favicon.png \
|
||||
32favicon.png \
|
||||
footer_corner.png \
|
||||
footer_pattern.png \
|
||||
libvirHeader.png \
|
||||
libvirLogo.png \
|
||||
libvirt-header-bg.png \
|
||||
libvirt-header-logo.png \
|
||||
libvirtLogo.png \
|
||||
libvirt-net-logical.png \
|
||||
libvirt-net-physical.png \
|
||||
libvirt-daemon-arch.png \
|
||||
libvirt-driver-arch.png \
|
||||
libvirt-object-model.png \
|
||||
madeWith.png \
|
||||
windows-cygwin-1.png \
|
||||
windows-cygwin-2.png \
|
||||
windows-cygwin-3.png \
|
||||
et.png
|
||||
|
||||
gif = \
|
||||
Libxml2-Logo-90x34.gif \
|
||||
architecture.gif \
|
||||
node.gif
|
||||
|
||||
dot_html_in = $(wildcard *.html.in)
|
||||
dot_html = $(dot_html_in:%.html.in=%.html)
|
||||
|
||||
patches = $(wildcard api_extension/*.patch)
|
||||
|
||||
xml = \
|
||||
libvirt-api.xml \
|
||||
libvirt-refs.xml \
|
||||
testdomfc4.xml \
|
||||
testdomfv0.xml \
|
||||
testnetdef.xml \
|
||||
testnetpriv.xml \
|
||||
testnode.xml
|
||||
libvirt-refs.xml
|
||||
|
||||
fig = \
|
||||
libvirt-net-logical.fig \
|
||||
libvirt-net-physical.fig
|
||||
libvirt-net-physical.fig \
|
||||
libvirt-daemon-arch.fig \
|
||||
libvirt-driver-arch.fig \
|
||||
libvirt-object-model.fig
|
||||
|
||||
EXTRA_DIST= \
|
||||
libvirt-api.xml libvirt-refs.xml apibuild.py \
|
||||
site.xsl newapi.xsl news.xsl page.xsl ChangeLog.xsl \
|
||||
$(dot_html) $(dot_html_in) $(gif) $(apihtml) $(apipng) \
|
||||
$(devhelphtml) $(devhelppng) $(devhelpcss) $(devhelpxsl) \
|
||||
$(xml) $(fig) $(png) \
|
||||
virsh.pod ChangeLog.awk
|
||||
$(patches) \
|
||||
ChangeLog.awk
|
||||
|
||||
all: web $(top_builddir)/NEWS $(man_MANS)
|
||||
CLEANFILES = $(dot_html) $(apihtml) $(devhelphtml)
|
||||
|
||||
virsh.1: virsh.pod
|
||||
pod2man -c "Virtualization Support" $(srcdir)/virsh.pod > $@-t
|
||||
mv $@-t $@
|
||||
cp $@ $(top_builddir)
|
||||
all: web
|
||||
|
||||
api: libvirt-api.xml libvirt-refs.xml $(srcdir)/html/index.html
|
||||
api: libvirt-api.xml libvirt-refs.xml
|
||||
|
||||
web: $(dot_html)
|
||||
web: $(dot_html) html/index.html devhelp/index.html
|
||||
|
||||
ChangeLog.xml: ../ChangeLog ChangeLog.awk
|
||||
awk -f ChangeLog.awk < $< > $@
|
||||
@ -83,6 +95,9 @@ ChangeLog.html.in: ChangeLog.xml ChangeLog.xsl
|
||||
name=`echo $@ | sed -e 's/.tmp//'`; \
|
||||
$(XSLTPROC) --nonet $(top_srcdir)/docs/ChangeLog.xsl $< > $@ || (rm $@ && exit 1) ; fi )
|
||||
|
||||
%.png: %.fig
|
||||
convert -rotate 90 $< $@
|
||||
|
||||
%.html.tmp: %.html.in site.xsl page.xsl sitemap.html.in
|
||||
@(if [ -x $(XSLTPROC) ] ; then \
|
||||
echo "Generating $@"; \
|
||||
@ -97,7 +112,7 @@ ChangeLog.html.in: ChangeLog.xml ChangeLog.xsl
|
||||
else echo "missing XHTML1 DTD" ; fi ; fi );
|
||||
|
||||
|
||||
$(srcdir)/html/index.html: libvirt-api.xml newapi.xsl page.xsl sitemap.html.in
|
||||
html/index.html: libvirt-api.xml newapi.xsl page.xsl sitemap.html.in
|
||||
-@(if [ -x $(XSLTPROC) ] ; then \
|
||||
echo "Rebuilding the HTML pages from the XML API" ; \
|
||||
$(XSLTPROC) --nonet $(srcdir)/newapi.xsl libvirt-api.xml ; fi )
|
||||
@ -107,15 +122,17 @@ $(srcdir)/html/index.html: libvirt-api.xml newapi.xsl page.xsl sitemap.html.in
|
||||
$(XMLLINT) --nonet --valid --noout html/*.html ; \
|
||||
else echo "missing XHTML1 DTD" ; fi ; fi );
|
||||
|
||||
devhelp/index.html devhelp/libvirt.devhelp: libvirt-api.xml $(devhelpxsl)
|
||||
-@(echo Rebuilding devhelp files)
|
||||
-@(if [ -x $(XSLTPROC) ] ; then \
|
||||
$(XSLTPROC) --nonet -o devhelp/libvirt.devhelp $(top_srcdir)/docs/devhelp/devhelp.xsl $(top_srcdir)/docs/libvirt-api.xml ; fi );
|
||||
|
||||
|
||||
libvirt-api.xml libvirt-refs.xml: apibuild.py \
|
||||
$(srcdir)/../include/libvirt/*.h \
|
||||
$(srcdir)/../src/*.h $(srcdir)/../src/*.c
|
||||
$(srcdir)/../src/libvirt.c $(srcdir)/../src/util/virterror.c
|
||||
-(./apibuild.py)
|
||||
|
||||
$(top_builddir)/NEWS: $(top_srcdir)/docs/news.xsl $(top_srcdir)/docs/news.html.in
|
||||
-@(if [ -x $(XSLTPROC) ] ; then \
|
||||
$(XSLTPROC) --nonet $(top_srcdir)/docs/news.xsl $(top_srcdir)/docs/news.html.in > $(top_builddir)/NEWS ; fi );
|
||||
|
||||
clean-local:
|
||||
rm -f *~ *.bak *.hierarchy *.signals *-unused.txt
|
||||
|
||||
@ -133,7 +150,13 @@ install-data-local:
|
||||
$(INSTALL) -m 0644 $(srcdir)/$$h $(DESTDIR)$(HTML_DIR)/html; done
|
||||
for p in $(apipng); do \
|
||||
$(INSTALL) -m 0644 $(srcdir)/$$p $(DESTDIR)$(HTML_DIR)/html; done
|
||||
$(mkinstalldirs) $(DESTDIR)$(DEVHELP_DIR)
|
||||
for file in $(devhelphtml) $(devhelppng) $(devhelpcss); do \
|
||||
@INSTALL@ -m 0644 $(srcdir)/$${file} $(DESTDIR)$(DEVHELP_DIR) ; \
|
||||
done
|
||||
|
||||
uninstall-local:
|
||||
for h in $(apihtml); do rm $(DESTDIR)$(HTML_DIR)/$$h; done
|
||||
for p in $(apipng); do rm $(DESTDIR)$(HTML_DIR)/$$p; done
|
||||
for f in $(devhelphtml) $(devhelppng) $(devhelpcss); do \
|
||||
rm $(DESTDIR)$(DEVHELP_DIR)$$f ; done
|
136
docs/api.html.in
Normal file
136
docs/api.html.in
Normal file
@ -0,0 +1,136 @@
|
||||
<?xml version="1.0"?>
|
||||
<html>
|
||||
<body>
|
||||
<h1>The libvirt API concepts</h1>
|
||||
|
||||
<p> This page describes the main principles and architecture choices
|
||||
behind the definition of the libvirt API:
|
||||
<ul>
|
||||
<li>
|
||||
<a href="#Objects">Objects exposed</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#Functions">Functions and naming conventions</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#Driver">The drivers</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#Remote">Daemon and remote access</a>
|
||||
</li>
|
||||
</ul>
|
||||
<h2><a name="Objects" id="Objects">Objects exposed</a></h2>
|
||||
<p> As defined in the <a href="goals.html">goals section</a>, libvirt
|
||||
API need to expose all the resources needed to manage the virtualization
|
||||
support of recent operating systems. The first object manipulated though
|
||||
the API is <code>virConnectPtr</code> which represent a connection to
|
||||
an hypervisor. Any application using libvirt is likely to start using the
|
||||
API by calling one of <a href="html/libvirt-libvirt.html#virConnectOpen"
|
||||
>the virConnectOpen functions</a>. You will note that those functions take
|
||||
a name argument which is actually an URI to select the right hypervisor to
|
||||
open, this is needed to allow remote connections and also select between
|
||||
different possible hypervisors (for example on a Linux system it may be
|
||||
possible to use both KVM and LinuxContainers on the same node). A NULL
|
||||
name will default to a preselected hypervisor but it's probably not a
|
||||
wise thing to do in most cases. See the <a href="uri.html">connection
|
||||
URI</a> page for a full descriptions of the values allowed.<p>
|
||||
<p> Once the application obtained a <code class='docref'>virConnectPtr</code>
|
||||
connection to the
|
||||
hypervisor it can then use it to manage domains and related resources
|
||||
available for virtualization like storage and networking. All those are
|
||||
exposed as first class objects, and connected to the hypervisor connection
|
||||
(and the node or cluster where it is available).</p>
|
||||
<p class="image">
|
||||
<img alt="first class objects exposed by the API"
|
||||
src="libvirt-object-model.png"/>
|
||||
</p>
|
||||
<p> The figure above shows the five main objects exported by the API:</p>
|
||||
<ul>
|
||||
<li>virConnectPtr: represent a connection to an hypervisor.</li>
|
||||
<li>virDomainPtr: represent one domain either active or defined (i.e.
|
||||
existing as permanent config file and storage but not currently running
|
||||
on that node). The function <code class='docref'>virConnectListDomains</code>
|
||||
allows to list all the IDs for the domains active on this hypervisor.</li>
|
||||
<li>virNetworkPtr: represent one network either active or defined (i.e.
|
||||
existing as permanent config file and storage but not currently activated.
|
||||
The function <code class='docref'>virConnectListNetworks</code>
|
||||
allows to list all the virtualization networks actived on this node.</li>
|
||||
<li>virStorageVolPtr: represent one storage volume, usually this is used
|
||||
as a block device available to one of the domains. The function
|
||||
<code class="docref">virStorageVolLookupByPath</code> allows to find
|
||||
the object based on its path on the node.</li>
|
||||
<li>virStoragePoolPtr: represent a storage pool, i.e. a logical area
|
||||
which can be used to allocate and store storage volumes. The function
|
||||
<code class="docref">virStoragePoolLookupByVolume</code> allows to find
|
||||
the storage pool containing a given storage volume.</li>
|
||||
</ul>
|
||||
<p> Most object manipulated by the library can also be represented using
|
||||
XML descriptions. This is used primarily to create those object, but is
|
||||
also helpful to modify or save their description back.</p>
|
||||
<p> Domains, network and storage pools can be either <code>active</code>
|
||||
i.e. either running or available for immediate use, or
|
||||
<code>defined</code> in which case they are inactive but there is
|
||||
a permanent definition available in the system for them. Based on this
|
||||
thay can be activated dynamically in order to be used.</p>
|
||||
<p> Most kind of object can also be named in various ways:<p>
|
||||
<ul>
|
||||
<li>by their <code>name</code>, an user friendly identifier but
|
||||
whose unicity cannot be garanteed between two nodes.</li>
|
||||
<li>by their <code>ID</code>, which is a runtime unique identifier
|
||||
provided by the hypervisor for one given activation of the object,
|
||||
but it becomes invalid once the resource is deactivated.</li >
|
||||
<li>by their <code>UUID</code>, a 16 bytes unique identifier
|
||||
as defined in <a href="http://www.ietf.org/rfc/rfc4122.txt">RFC 4122</a>,
|
||||
which is garanteed to be unique for long term usage and across a
|
||||
set of nodes.</li>
|
||||
</ul>
|
||||
|
||||
<h2><a name="Functions" id="Functions">Functions and naming
|
||||
conventions</a></h2>
|
||||
<p> The naming of the functions present in the library is usually
|
||||
made of a prefix describing the object associated to the function
|
||||
and a verb describing the action on that object.</p>
|
||||
<p> For each first class object you will find apis
|
||||
for the following actions:</p>
|
||||
<ul>
|
||||
<li><b>Lookup</b>:...LookupByName,
|
||||
<li><b>Enumeration</b>:virConnectList... and virConnectNumOf...:
|
||||
those are used to enumerate a set of object available to an given
|
||||
hypervisor connection like:
|
||||
<code class='docref'>virConnectListDomains</code>,
|
||||
<code class='docref'>virConnectNumOfDomains</code>,
|
||||
<code class='docref'>virConnectListNetworks</code>,
|
||||
<code class='docref'>virConnectListStoragePools</code>, etc.</li>
|
||||
<li><b>Description</b>: ...GetInfo: those are generic accessor providing
|
||||
a set of informations about an object, they are
|
||||
<code class='docref'>virNodeGetInfo</code>,
|
||||
<code class='docref'>virDomainGetInfo</code>,
|
||||
<code class='docref'>virStoragePoolGetInfo</code>,
|
||||
<code class='docref'>virStorageVolGetInfo</code>.</li>
|
||||
<li><b>Accessors</b>: ...Get... and ...Set...: those are more specific
|
||||
accessors to query or modify the given object, like
|
||||
<code class='docref'>virConnectGetType</code>,
|
||||
<code class='docref'>virDomainGetMaxMemory</code>,
|
||||
<code class='docref'>virDomainSetMemory</code>,
|
||||
<code class='docref'>virDomainGetVcpus</code>,
|
||||
<code class='docref'>virStoragePoolSetAutostart</code>,
|
||||
<code class='docref'>virNetworkGetBridgeName</code>, etc.</li>
|
||||
<li><b>Creation</b>: </li>
|
||||
<li><b>Destruction</b>: ... </li>
|
||||
</ul>
|
||||
<p> For more in-depth details of the storage related APIs see
|
||||
<a href="storage.html">the storage management page</a>,
|
||||
<h2><a name="Driver" id="Driver">The libvirt drivers</a></h2>
|
||||
<p></p>
|
||||
<p class="image">
|
||||
<img alt="The libvirt driver architecture"
|
||||
src="libvirt-driver-arch.png"/>
|
||||
</p>
|
||||
<h2><a name="Remote" id="Remote">Daemon and remote access</a></h2>
|
||||
<p></p>
|
||||
<p class="image">
|
||||
<img alt="The libvirt daemon and remote architecture"
|
||||
src="libvirt-daemon-arch.png"/>
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
302
docs/api_extension.html.in
Normal file
302
docs/api_extension.html.in
Normal file
@ -0,0 +1,302 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Implementing a new API in Libvirt</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>Implementing a new API in Libvirt</h1>
|
||||
|
||||
<ul id="toc"></ul>
|
||||
|
||||
<p>
|
||||
This document walks you through the process of implementing a new
|
||||
API in libvirt. It uses as an example the addition of the node device
|
||||
create and destroy APIs.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Before you begin coding, it is critical that you propose your
|
||||
changes on the libvirt mailing list and get feedback on your ideas to
|
||||
make sure what you're proposing fits with the general direction of the
|
||||
project. Even before doing a proof of concept implementation, send an
|
||||
email giving an overview of the functionality you think should be
|
||||
added to libvirt. Someone may already be working on the feature you
|
||||
want. Also, recognize that everything you write is likely to undergo
|
||||
significant rework as you discuss it with the other developers, so
|
||||
don't wait too long before getting feedback.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Adding a new API to libvirt is not difficult, but there are quite a
|
||||
few steps. This document assumes that you are familiar with C
|
||||
programming and have checked out the libvirt code from the source code
|
||||
repository and successfully built the existing tree. Instructions on
|
||||
how to check out and build the code can be found at:
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="http://libvirt.org/downloads.html">http://libvirt.org/downloads.html</a>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Once you have a working development environment, the steps to create a
|
||||
new API are:
|
||||
</p>
|
||||
<ol>
|
||||
<li>define the public API</li>
|
||||
<li>define the internal driver API</li>
|
||||
<li>implement the public API</li>
|
||||
<li>define the wire protocol format</li>
|
||||
<li>implement the RPC client</li>
|
||||
<li>implement the server side dispatcher</li>
|
||||
<li>implement the driver methods</li>
|
||||
<li>add virsh support</li>
|
||||
</ol>
|
||||
|
||||
<p>
|
||||
It is, of course, possible to implement the pieces in any order, but
|
||||
if the development tasks are completed in the order listed, the code
|
||||
will compile after each step. Given the number of changes required,
|
||||
verification after each step is highly recommended.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Submit new code in the form shown in the example code: one patch
|
||||
per step. That's not to say submit patches before you have working
|
||||
functionality--get the whole thing working and make sure you're happy
|
||||
with it. Then use git or some other version control system that lets
|
||||
you rewrite your commit history and break patches into pieces so you
|
||||
don't drop a big blob of code on the mailing list at one go. For
|
||||
example, I didn't follow my own advice when I originally submitted the
|
||||
example code to the libvirt list but rather submitted it in several
|
||||
large chunks. I've used git's ability to rewrite my commit history to
|
||||
break the code apart into the example patches shown.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Don't mix anything else into the patches you submit. The patches
|
||||
should be the minimal changes required to implement the functionality
|
||||
you're adding. If you notice a bug in unrelated code (i.e., code you
|
||||
don't have to touch to implement your API change) during development,
|
||||
create a patch that just addresses that bug and submit it
|
||||
separately.
|
||||
</p>
|
||||
|
||||
<p>With that said, let's begin.</p>
|
||||
|
||||
<h2><a name='publicapi'>Defining the public API</a></h2>
|
||||
|
||||
<p>The first task is to define the public API and add it to:</p>
|
||||
|
||||
<p><code>include/libvirt/libvirt.h.in</code></p>
|
||||
|
||||
<p>
|
||||
This task is in many ways the most important to get right, since once
|
||||
the API has been committed to the repository, it's libvirt's policy
|
||||
never to change it. Mistakes in the implementation are bugs that you
|
||||
can fix. Make a mistake in the API definition and you're stuck with
|
||||
it, so think carefully about the interface and don't be afraid to
|
||||
rework it as you go through the process of implementing it.
|
||||
</p>
|
||||
|
||||
<p>Once you have defined the API, you have to add the symbol names to:</p>
|
||||
|
||||
<p><code>src/libvirt_public.syms</code></p>
|
||||
|
||||
<p class="example">See <a href="api_extension/0001-Step-1-of-8-Define-the-public-API.patch">0001-Step-1-of-8-Define-the-public-API.patch</a> for example code.</p>
|
||||
|
||||
|
||||
<h2><a name='internalapi'>Defining the internal API</a></h2>
|
||||
|
||||
<p>
|
||||
Each public API call is associated with a driver, such as a host
|
||||
virtualization driver, a network virtualization driver, a storage
|
||||
virtualization driver, a state driver, or a device monitor. Adding
|
||||
the internal API is ordinarily a matter of adding a new member to the
|
||||
struct representing one of these drivers.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Of course, it's possible that the new API will involve the creation of
|
||||
an entire new driver type, in which case the changes will include the
|
||||
creation of a new struct type to represent the new driver type.
|
||||
</p>
|
||||
|
||||
<p>The driver structs are defined in:</p>
|
||||
|
||||
<p><code>src/driver.h</code></p>
|
||||
|
||||
<p>
|
||||
To define the internal API, first typedef the driver function
|
||||
prototype and then add a new field for it to the relevant driver
|
||||
struct.
|
||||
</p>
|
||||
|
||||
<p class="example">See <a href="api_extension/0002-Step-2-of-8-Define-the-internal-driver-API.patch">0002-Step-2-of-8-Define-the-internal-driver-API.patch</a></p>
|
||||
|
||||
<h2><a name='implpublic'>Implementing the public API</a></h2>
|
||||
|
||||
<p>
|
||||
Implementing the public API is largely a formality in which we wire up
|
||||
public API to the internal driver API. The public API implementation
|
||||
takes care of some basic validity checks before passing control to the
|
||||
driver implementation. In RFC 2119 vocabulary, this function:
|
||||
</p>
|
||||
|
||||
<ol class="ordinarylist">
|
||||
<li>SHOULD log a message with VIR_DEBUG() indicating that it is
|
||||
being called and its parameters;</li>
|
||||
<li>MUST call virResetLastError();</li>
|
||||
<li>SHOULD confirm that the connection is valid with
|
||||
VIR_IS_CONNECT(conn);</li>
|
||||
<li><strong>SECURITY: If the API requires a connection with write
|
||||
privileges, MUST confirm that the connection flags do not
|
||||
indicate that the connection is read-only;</strong></li>
|
||||
<li>SHOULD do basic validation of the parameters that are being
|
||||
passed in;</li>
|
||||
<li>MUST confirm that the driver for this connection exists and that
|
||||
it implements this function;</li>
|
||||
<li>MUST call the internal API;</li>
|
||||
<li>SHOULD log a message with VIR_DEBUG() indicating that it is
|
||||
returning, its return value, and status.</li>
|
||||
<li>MUST return status to the caller.</li>
|
||||
</ol>
|
||||
|
||||
<p>The public API calls are implemented in:</p>
|
||||
|
||||
<p><code>src/libvirt.c</code></p>
|
||||
|
||||
<p class="example">See <a href="api_extension/0003-Step-3-of-8-Implement-the-public-API.patch">0003-Step-3-of-8-Implement-the-public-API.patch</a></p>
|
||||
|
||||
|
||||
<h2><a name='wireproto'>Defining the wire protocol format</a></h2>
|
||||
|
||||
<p>
|
||||
Defining the wire protocol is essentially a straightforward exercise
|
||||
which is probably most easily understood by referring to the existing
|
||||
remote protocol wire format definitions and the example patch. It
|
||||
involves making two additions to:
|
||||
</p>
|
||||
|
||||
<p><code>qemud/remote_protocol.x</code></p>
|
||||
|
||||
<p>
|
||||
First, create two new structs for each new function that you're adding
|
||||
to the API. One struct describes the parameters to be passed to the
|
||||
remote function, and a second struct describes the value returned by
|
||||
the remote function. The one exception to this rule is that functions
|
||||
that return only integer status do not require a struct for returned
|
||||
data.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Second, add values to the remote_procedure enum for each new function
|
||||
added to the API.
|
||||
</p>
|
||||
|
||||
<p class="example">See <a href="api_extension/0004-Step-4-of-8-Define-the-wire-protocol-format.patch">0004-Step-4-of-8-Define-the-wire-protocol-format.patch</a></p>
|
||||
|
||||
<p>
|
||||
Once these changes are in place, it's necessary to run 'make rpcgen'
|
||||
in the qemud directory to create the .c and .h files required by the
|
||||
remote protocol code. This must be done on a Linux host using the
|
||||
GLibC rpcgen program. Other rpcgen versions may generate code which
|
||||
results in bogus compile time warnings
|
||||
</p>
|
||||
|
||||
|
||||
<h2><a name='rpcclient'>Implement the RPC client</a></h2>
|
||||
|
||||
<p>
|
||||
Implementing the RPC client is also relatively mechanical, so refer to
|
||||
the exising code and example patch for guidance. The RPC client uses
|
||||
the rpcgen generated .h files. The remote method calls go in:
|
||||
</p>
|
||||
|
||||
<p><code>src/remote_internal.c</code></p>
|
||||
|
||||
<p>Each remote method invocation does the following:</p>
|
||||
|
||||
<ol class="ordinarylist">
|
||||
<li>locks the remote driver;</li>
|
||||
<li>sets up the method arguments;</li>
|
||||
<li>invokes the remote function;</li>
|
||||
<li>checks the return value, if necessary;</li>
|
||||
<li>extracts any returned data;</li>
|
||||
<li>frees any returned data;</li>
|
||||
<li>unlocks the remote driver.</li>
|
||||
</ol>
|
||||
|
||||
<p>
|
||||
Once you have created the remote method calls, you have to add fields
|
||||
for them to the driver structs for the appropriate remote driver.
|
||||
</p>
|
||||
|
||||
<p class="example">See <a href="api_extension/0005-Step-5-of-8-Implement-the-RPC-client.patch">0005-Step-5-of-8-Implement-the-RPC-client.patch</a></p>
|
||||
|
||||
<h2><a name="serverdispatch">Implement the server side dispatcher</a></h2>
|
||||
|
||||
<p>
|
||||
Implementing the server side of the remote function calls is simply a
|
||||
matter of deserializing the parameters passed in from the remote
|
||||
caller and passing them to the corresponding internal API function.
|
||||
The server side dispatchers are implemented in:
|
||||
</p>
|
||||
|
||||
<p><code>qemud/remote.c</code></p>
|
||||
|
||||
<p>Again, this step uses the .h files generated by make rpcgen.</p>
|
||||
|
||||
<p class="example">See <a href="api_extension/0006-Step-6-of-8-Implement-the-server-side-dispatcher.patch">0006-Step-6-of-8-Implement-the-server-side-dispatcher.patch</a></p>
|
||||
|
||||
|
||||
<h2><a name="driverimpl">Implement the driver methods</a></h2>
|
||||
|
||||
<p>
|
||||
So, after all that, we get to the fun part. All functionality in
|
||||
libvirt is implemented inside a driver. Thus, here is where you
|
||||
implement whatever functionality you're adding to libvirt. You'll
|
||||
either need to add additional files to the src directory or extend
|
||||
files that are already there, depending on what functionality you're
|
||||
adding.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
In the example code, the extension is only an additional two function
|
||||
calls in the node device API, so most of the new code is additions to
|
||||
existing files. The only new files are there for multi-platform
|
||||
implementation convenience, as some of the new code is Linux specific.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The example code is probably uninteresting unless you're concerned
|
||||
with libvirt storage, but I've included it here to show how new files
|
||||
are added to the build environment.
|
||||
</p>
|
||||
|
||||
<p class="example">See <a href="api_extension/0007-Step-7-of-8-Implement-the-driver-methods.patch">0007-Step-7-of-8-Implement-the-driver-methods.patch</a></p>
|
||||
|
||||
<h2><a name="virsh">Implement virsh commands</a></h2>
|
||||
|
||||
<p>
|
||||
Once you have the new functionality in place, the easiest way to test
|
||||
it and also to provide it to end users is to implement support for it
|
||||
in virsh.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
A virsh command is composed of a few pieces of code. You need to
|
||||
define an array of vshCmdInfo structs for each new command that
|
||||
contain the help text and the command description text. You also need
|
||||
an array of vshCmdOptDef structs to describe the command options.
|
||||
Once you have those pieces of data in place you can write the function
|
||||
implementing the virsh command. Finally, you need to add the new
|
||||
command to the commands[] array.
|
||||
</p>
|
||||
|
||||
<p class="example">See <a href="api_extension/0008-Step-8-of-8-Add-virsh-support.patch">0008-Step-8-of-8-Add-virsh-support.patch</a></p>
|
||||
|
||||
<p>Once you have working functionality, run make check and make
|
||||
syntax-check before generating patches.</p>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,44 @@
|
||||
From 2ae8fd62a1e5e085b7902da9bc207b806d84fd91 Mon Sep 17 00:00:00 2001
|
||||
From: David Allan <dallan@redhat.com>
|
||||
Date: Tue, 19 May 2009 16:16:11 -0400
|
||||
Subject: [PATCH] Step 1 of 8 Define the public API
|
||||
|
||||
---
|
||||
include/libvirt/libvirt.h.in | 6 ++++++
|
||||
src/libvirt_public.syms | 6 ++++++
|
||||
2 files changed, 12 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in
|
||||
index a028b21..2f7076f 100644
|
||||
--- a/include/libvirt/libvirt.h.in
|
||||
+++ b/include/libvirt/libvirt.h.in
|
||||
@@ -1124,6 +1124,12 @@ int virNodeDeviceDettach (virNodeDevicePtr dev);
|
||||
int virNodeDeviceReAttach (virNodeDevicePtr dev);
|
||||
int virNodeDeviceReset (virNodeDevicePtr dev);
|
||||
|
||||
+virNodeDevicePtr virNodeDeviceCreateXML (virConnectPtr conn,
|
||||
+ const char *xmlDesc,
|
||||
+ unsigned int flags);
|
||||
+
|
||||
+int virNodeDeviceDestroy (virNodeDevicePtr dev);
|
||||
+
|
||||
/*
|
||||
* Domain Event Notification
|
||||
*/
|
||||
diff --git a/src/libvirt_public.syms b/src/libvirt_public.syms
|
||||
index f7ebbc3..b8f9128 100644
|
||||
--- a/src/libvirt_public.syms
|
||||
+++ b/src/libvirt_public.syms
|
||||
@@ -258,4 +258,10 @@ LIBVIRT_0.6.1 {
|
||||
virNodeGetSecurityModel;
|
||||
} LIBVIRT_0.6.0;
|
||||
|
||||
+LIBVIRT_0.6.3 {
|
||||
+ global:
|
||||
+ virNodeDeviceCreateXML;
|
||||
+ virNodeDeviceDestroy;
|
||||
+} LIBVIRT_0.6.1;
|
||||
+
|
||||
# .... define new API here using predicted next version number ....
|
||||
--
|
||||
1.6.0.6
|
@ -0,0 +1,36 @@
|
||||
From b26d7fc2d64e7e6e4d3ea2b43361015d3620d7a6 Mon Sep 17 00:00:00 2001
|
||||
From: David Allan <dallan@redhat.com>
|
||||
Date: Tue, 19 May 2009 16:19:14 -0400
|
||||
Subject: [PATCH] Step 2 of 8 Define the internal driver API
|
||||
|
||||
---
|
||||
src/driver.h | 7 +++++++
|
||||
1 files changed, 7 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/src/driver.h b/src/driver.h
|
||||
index 39dc413..c357b76 100644
|
||||
--- a/src/driver.h
|
||||
+++ b/src/driver.h
|
||||
@@ -684,6 +684,11 @@ typedef int (*virDevMonDeviceListCaps)(virNodeDevicePtr dev,
|
||||
char **const names,
|
||||
int maxnames);
|
||||
|
||||
+typedef virNodeDevicePtr (*virDrvNodeDeviceCreateXML)(virConnectPtr conn,
|
||||
+ const char *xmlDesc,
|
||||
+ unsigned int flags);
|
||||
+typedef int (*virDrvNodeDeviceDestroy)(virNodeDevicePtr dev);
|
||||
+
|
||||
/**
|
||||
* _virDeviceMonitor:
|
||||
*
|
||||
@@ -702,6 +707,8 @@ struct _virDeviceMonitor {
|
||||
virDevMonDeviceGetParent deviceGetParent;
|
||||
virDevMonDeviceNumOfCaps deviceNumOfCaps;
|
||||
virDevMonDeviceListCaps deviceListCaps;
|
||||
+ virDrvNodeDeviceCreateXML deviceCreateXML;
|
||||
+ virDrvNodeDeviceDestroy deviceDestroy;
|
||||
};
|
||||
|
||||
/*
|
||||
--
|
||||
1.6.0.6
|
@ -0,0 +1,119 @@
|
||||
From fc585594a207dfb9149e7d3d01c9eb1c79b6d52d Mon Sep 17 00:00:00 2001
|
||||
From: David Allan <dallan@redhat.com>
|
||||
Date: Tue, 19 May 2009 16:22:23 -0400
|
||||
Subject: [PATCH] Step 3 of 8 Implement the public API
|
||||
|
||||
---
|
||||
src/libvirt.c | 97 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
1 files changed, 97 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/src/libvirt.c b/src/libvirt.c
|
||||
index f3d4484..ded18a7 100644
|
||||
--- a/src/libvirt.c
|
||||
+++ b/src/libvirt.c
|
||||
@@ -7509,6 +7509,103 @@ error:
|
||||
}
|
||||
|
||||
|
||||
+/**
|
||||
+ * virNodeDeviceCreateXML:
|
||||
+ * @conn: pointer to the hypervisor connection
|
||||
+ * @xmlDesc: string containing an XML description of the device to be created
|
||||
+ * @flags: callers should always pass 0
|
||||
+ *
|
||||
+ * Create a new device on the VM host machine, for example, virtual
|
||||
+ * HBAs created using vport_create.
|
||||
+ *
|
||||
+ * Returns a node device object if successful, NULL in case of failure
|
||||
+ */
|
||||
+virNodeDevicePtr
|
||||
+virNodeDeviceCreateXML(virConnectPtr conn,
|
||||
+ const char *xmlDesc,
|
||||
+ unsigned int flags)
|
||||
+{
|
||||
+ VIR_DEBUG("conn=%p, xmlDesc=%s, flags=%d", conn, xmlDesc, flags);
|
||||
+
|
||||
+ virResetLastError();
|
||||
+
|
||||
+ if (!VIR_IS_CONNECT(conn)) {
|
||||
+ virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ if (conn->flags & VIR_CONNECT_RO) {
|
||||
+ virLibConnError(conn, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
|
||||
+ goto error;
|
||||
+ }
|
||||
+
|
||||
+ if (xmlDesc == NULL) {
|
||||
+ virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
|
||||
+ goto error;
|
||||
+ }
|
||||
+
|
||||
+ if (conn->deviceMonitor &&
|
||||
+ conn->deviceMonitor->deviceCreateXML) {
|
||||
+ virNodeDevicePtr dev = conn->deviceMonitor->deviceCreateXML(conn, xmlDesc, flags);
|
||||
+ if (dev == NULL)
|
||||
+ goto error;
|
||||
+ return dev;
|
||||
+ }
|
||||
+
|
||||
+ virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
|
||||
+
|
||||
+error:
|
||||
+ /* Copy to connection error object for back compatability */
|
||||
+ virSetConnError(conn);
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/**
|
||||
+ * virNodeDeviceDestroy:
|
||||
+ * @dev: a device object
|
||||
+ *
|
||||
+ * Destroy the device object. The virtual device is removed from the host operating system.
|
||||
+ * This function may require privileged access
|
||||
+ *
|
||||
+ * Returns 0 in case of success and -1 in case of failure.
|
||||
+ */
|
||||
+int
|
||||
+virNodeDeviceDestroy(virNodeDevicePtr dev)
|
||||
+{
|
||||
+ DEBUG("dev=%p", dev);
|
||||
+
|
||||
+ virResetLastError();
|
||||
+
|
||||
+ if (!VIR_IS_CONNECTED_NODE_DEVICE(dev)) {
|
||||
+ virLibNodeDeviceError(NULL, VIR_ERR_INVALID_NODE_DEVICE, __FUNCTION__);
|
||||
+ return (-1);
|
||||
+ }
|
||||
+
|
||||
+ if (dev->conn->flags & VIR_CONNECT_RO) {
|
||||
+ virLibConnError(dev->conn, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
|
||||
+ goto error;
|
||||
+ }
|
||||
+
|
||||
+ if (dev->conn->deviceMonitor &&
|
||||
+ dev->conn->deviceMonitor->deviceDestroy) {
|
||||
+ int retval = dev->conn->deviceMonitor->deviceDestroy(dev);
|
||||
+ if (retval < 0) {
|
||||
+ goto error;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ virLibConnError (dev->conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
|
||||
+
|
||||
+error:
|
||||
+ /* Copy to connection error object for back compatability */
|
||||
+ virSetConnError(dev->conn);
|
||||
+ return -1;
|
||||
+}
|
||||
+
|
||||
+
|
||||
/*
|
||||
* Domain Event Notification
|
||||
*/
|
||||
--
|
||||
1.6.0.6
|
@ -0,0 +1,47 @@
|
||||
From bce8f1243b0454c0d70e3db832a039d22faab09a Mon Sep 17 00:00:00 2001
|
||||
From: David Allan <dallan@redhat.com>
|
||||
Date: Wed, 20 May 2009 13:58:58 -0400
|
||||
Subject: [PATCH] Step 4 of 8 Define the wire protocol format
|
||||
|
||||
---
|
||||
qemud/remote_protocol.x | 18 +++++++++++++++++-
|
||||
1 files changed, 17 insertions(+), 1 deletions(-)
|
||||
|
||||
diff --git a/qemud/remote_protocol.x b/qemud/remote_protocol.x
|
||||
index 2d8e6a2..2c79949 100644
|
||||
--- a/qemud/remote_protocol.x
|
||||
+++ b/qemud/remote_protocol.x
|
||||
@@ -1109,6 +1109,19 @@ struct remote_node_device_reset_args {
|
||||
remote_nonnull_string name;
|
||||
};
|
||||
|
||||
+struct remote_node_device_create_xml_args {
|
||||
+ remote_nonnull_string xml_desc;
|
||||
+ int flags;
|
||||
+};
|
||||
+
|
||||
+struct remote_node_device_create_xml_ret {
|
||||
+ remote_nonnull_node_device dev;
|
||||
+};
|
||||
+
|
||||
+struct remote_node_device_destroy_args {
|
||||
+ remote_nonnull_string name;
|
||||
+};
|
||||
+
|
||||
|
||||
/**
|
||||
* Events Register/Deregister:
|
||||
@@ -1270,7 +1283,10 @@ enum remote_procedure {
|
||||
REMOTE_PROC_NODE_DEVICE_RESET = 120,
|
||||
|
||||
REMOTE_PROC_DOMAIN_GET_SECURITY_LABEL = 121,
|
||||
- REMOTE_PROC_NODE_GET_SECURITY_MODEL = 122
|
||||
+ REMOTE_PROC_NODE_GET_SECURITY_MODEL = 122,
|
||||
+
|
||||
+ REMOTE_PROC_NODE_DEVICE_CREATE_XML = 123,
|
||||
+ REMOTE_PROC_NODE_DEVICE_DESTROY = 124
|
||||
};
|
||||
|
||||
/* Custom RPC structure. */
|
||||
--
|
||||
1.6.0.6
|
@ -0,0 +1,84 @@
|
||||
From ff272552c297966ace3492aefe91fc830152251a Mon Sep 17 00:00:00 2001
|
||||
From: David Allan <dallan@redhat.com>
|
||||
Date: Tue, 19 May 2009 16:26:12 -0400
|
||||
Subject: [PATCH] Step 5 of 8 Implement the RPC client
|
||||
|
||||
---
|
||||
src/remote_internal.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
1 files changed, 55 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/src/remote_internal.c b/src/remote_internal.c
|
||||
index 4b3afb0..e665ef8 100644
|
||||
--- a/src/remote_internal.c
|
||||
+++ b/src/remote_internal.c
|
||||
@@ -4978,6 +4978,59 @@ done:
|
||||
}
|
||||
|
||||
|
||||
+static virNodeDevicePtr
|
||||
+remoteNodeDeviceCreateXML(virConnectPtr conn,
|
||||
+ const char *xmlDesc,
|
||||
+ unsigned int flags)
|
||||
+{
|
||||
+ remote_node_device_create_xml_args args;
|
||||
+ remote_node_device_create_xml_ret ret;
|
||||
+ virNodeDevicePtr dev = NULL;
|
||||
+ struct private_data *priv = conn->privateData;
|
||||
+
|
||||
+ remoteDriverLock(priv);
|
||||
+
|
||||
+ memset(&ret, 0, sizeof ret);
|
||||
+ args.xml_desc = (char *)xmlDesc;
|
||||
+ args.flags = flags;
|
||||
+
|
||||
+ if (call(conn, priv, 0, REMOTE_PROC_NODE_DEVICE_CREATE_XML,
|
||||
+ (xdrproc_t) xdr_remote_node_device_create_xml_args, (char *) &args,
|
||||
+ (xdrproc_t) xdr_remote_node_device_create_xml_ret, (char *) &ret) == -1)
|
||||
+ goto done;
|
||||
+
|
||||
+ dev = get_nonnull_node_device(conn, ret.dev);
|
||||
+ xdr_free ((xdrproc_t) xdr_remote_node_device_create_xml_ret, (char *) &ret);
|
||||
+
|
||||
+done:
|
||||
+ remoteDriverUnlock(priv);
|
||||
+ return dev;
|
||||
+}
|
||||
+
|
||||
+static int
|
||||
+remoteNodeDeviceDestroy(virNodeDevicePtr dev)
|
||||
+{
|
||||
+ int rv = -1;
|
||||
+ remote_node_device_destroy_args args;
|
||||
+ struct private_data *priv = dev->conn->privateData;
|
||||
+
|
||||
+ remoteDriverLock(priv);
|
||||
+
|
||||
+ args.name = dev->name;
|
||||
+
|
||||
+ if (call(dev->conn, priv, 0, REMOTE_PROC_NODE_DEVICE_DESTROY,
|
||||
+ (xdrproc_t) xdr_remote_node_device_destroy_args, (char *) &args,
|
||||
+ (xdrproc_t) xdr_void, (char *) NULL) == -1)
|
||||
+ goto done;
|
||||
+
|
||||
+ rv = 0;
|
||||
+
|
||||
+done:
|
||||
+ remoteDriverUnlock(priv);
|
||||
+ return rv;
|
||||
+}
|
||||
+
|
||||
+
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
static int
|
||||
@@ -6982,6 +7035,8 @@ static virDeviceMonitor dev_monitor = {
|
||||
.deviceGetParent = remoteNodeDeviceGetParent,
|
||||
.deviceNumOfCaps = remoteNodeDeviceNumOfCaps,
|
||||
.deviceListCaps = remoteNodeDeviceListCaps,
|
||||
+ .deviceCreateXML = remoteNodeDeviceCreateXML,
|
||||
+ .deviceDestroy = remoteNodeDeviceDestroy
|
||||
};
|
||||
|
||||
|
||||
--
|
||||
1.6.0.6
|
@ -0,0 +1,70 @@
|
||||
From 4c5166df583459574526841234d61d6ae5be19a0 Mon Sep 17 00:00:00 2001
|
||||
From: David Allan <dallan@redhat.com>
|
||||
Date: Tue, 19 May 2009 16:26:55 -0400
|
||||
Subject: [PATCH] Step 6 of 8 Implement the server side dispatcher
|
||||
|
||||
---
|
||||
qemud/remote.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
1 files changed, 48 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/qemud/remote.c b/qemud/remote.c
|
||||
index e27820f..8d24a3a 100644
|
||||
--- a/qemud/remote.c
|
||||
+++ b/qemud/remote.c
|
||||
@@ -4323,6 +4323,54 @@ remoteDispatchNodeDeviceReset (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
}
|
||||
|
||||
|
||||
+static int
|
||||
+remoteDispatchNodeDeviceCreateXml(struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
+ struct qemud_client *client ATTRIBUTE_UNUSED,
|
||||
+ virConnectPtr conn,
|
||||
+ remote_error *rerr,
|
||||
+ remote_node_device_create_xml_args *args,
|
||||
+ remote_node_device_create_xml_ret *ret)
|
||||
+{
|
||||
+ virNodeDevicePtr dev;
|
||||
+
|
||||
+ dev = virNodeDeviceCreateXML (conn, args->xml_desc, args->flags);
|
||||
+ if (dev == NULL) {
|
||||
+ remoteDispatchConnError(rerr, conn);
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ make_nonnull_node_device (&ret->dev, dev);
|
||||
+ virNodeDeviceFree(dev);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+static int
|
||||
+remoteDispatchNodeDeviceDestroy(struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
+ struct qemud_client *client ATTRIBUTE_UNUSED,
|
||||
+ virConnectPtr conn,
|
||||
+ remote_error *rerr,
|
||||
+ remote_node_device_destroy_args *args,
|
||||
+ void *ret ATTRIBUTE_UNUSED)
|
||||
+{
|
||||
+ virNodeDevicePtr dev;
|
||||
+
|
||||
+ dev = virNodeDeviceLookupByName(conn, args->name);
|
||||
+ if (dev == NULL) {
|
||||
+ remoteDispatchFormatError(rerr, "%s", _("node_device not found"));
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ if (virNodeDeviceDestroy(dev) == -1) {
|
||||
+ remoteDispatchConnError(rerr, conn);
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+
|
||||
/**************************
|
||||
* Async Events
|
||||
**************************/
|
||||
--
|
||||
1.6.0.6
|
File diff suppressed because it is too large
Load Diff
132
docs/api_extension/0008-Step-8-of-8-Add-virsh-support.patch
Normal file
132
docs/api_extension/0008-Step-8-of-8-Add-virsh-support.patch
Normal file
@ -0,0 +1,132 @@
|
||||
From 193cc4abbb6c2fc5557d3699f86ff0103d5a21ef Mon Sep 17 00:00:00 2001
|
||||
From: David Allan <dallan@redhat.com>
|
||||
Date: Tue, 19 May 2009 16:47:31 -0400
|
||||
Subject: [PATCH 8/8] Step 8 of 8 Add virsh support
|
||||
|
||||
---
|
||||
src/virsh.c | 103 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
1 files changed, 103 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/src/virsh.c b/src/virsh.c
|
||||
index cb32ede..ab2a2b7 100644
|
||||
--- a/src/virsh.c
|
||||
+++ b/src/virsh.c
|
||||
@@ -2962,6 +2962,107 @@ cmdPoolCreate(vshControl *ctl, const vshCmd *cmd)
|
||||
|
||||
|
||||
/*
|
||||
+ * "nodedev-create" command
|
||||
+ */
|
||||
+static const vshCmdInfo info_node_device_create[] = {
|
||||
+ {"help", gettext_noop("create a device defined "
|
||||
+ "by an XML file on the node")},
|
||||
+ {"desc", gettext_noop("Create a device on the node. Note that this "
|
||||
+ "command creates devices on the physical host "
|
||||
+ "that can then be assigned to a virtual machine.")},
|
||||
+ {NULL, NULL}
|
||||
+};
|
||||
+
|
||||
+static const vshCmdOptDef opts_node_device_create[] = {
|
||||
+ {"file", VSH_OT_DATA, VSH_OFLAG_REQ,
|
||||
+ gettext_noop("file containing an XML description of the device")},
|
||||
+ {NULL, 0, 0, NULL}
|
||||
+};
|
||||
+
|
||||
+static int
|
||||
+cmdNodeDeviceCreate(vshControl *ctl, const vshCmd *cmd)
|
||||
+{
|
||||
+ virNodeDevicePtr dev = NULL;
|
||||
+ char *from;
|
||||
+ int found = 0;
|
||||
+ int ret = TRUE;
|
||||
+ char *buffer;
|
||||
+
|
||||
+ if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
|
||||
+ return FALSE;
|
||||
+
|
||||
+ from = vshCommandOptString(cmd, "file", &found);
|
||||
+ if (!found) {
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+
|
||||
+ if (virFileReadAll(from, VIRSH_MAX_XML_FILE, &buffer) < 0) {
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+
|
||||
+ dev = virNodeDeviceCreateXML(ctl->conn, buffer, 0);
|
||||
+ free (buffer);
|
||||
+
|
||||
+ if (dev != NULL) {
|
||||
+ vshPrint(ctl, _("Node device %s created from %s\n"),
|
||||
+ virNodeDeviceGetName(dev), from);
|
||||
+ } else {
|
||||
+ vshError(ctl, FALSE, _("Failed to create node device from %s"), from);
|
||||
+ ret = FALSE;
|
||||
+ }
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/*
|
||||
+ * "nodedev-destroy" command
|
||||
+ */
|
||||
+static const vshCmdInfo info_node_device_destroy[] = {
|
||||
+ {"help", gettext_noop("destroy a device on the node")},
|
||||
+ {"desc", gettext_noop("Destroy a device on the node. Note that this "
|
||||
+ "command destroys devices on the physical host ")},
|
||||
+ {NULL, NULL}
|
||||
+};
|
||||
+
|
||||
+static const vshCmdOptDef opts_node_device_destroy[] = {
|
||||
+ {"name", VSH_OT_DATA, VSH_OFLAG_REQ,
|
||||
+ gettext_noop("name of the device to be destroyed")},
|
||||
+ {NULL, 0, 0, NULL}
|
||||
+};
|
||||
+
|
||||
+static int
|
||||
+cmdNodeDeviceDestroy(vshControl *ctl, const vshCmd *cmd)
|
||||
+{
|
||||
+ virNodeDevicePtr dev = NULL;
|
||||
+ int ret = TRUE;
|
||||
+ int found = 0;
|
||||
+ char *name;
|
||||
+
|
||||
+ if (!vshConnectionUsability(ctl, ctl->conn, TRUE)) {
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+
|
||||
+ name = vshCommandOptString(cmd, "name", &found);
|
||||
+ if (!found) {
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+
|
||||
+ dev = virNodeDeviceLookupByName(ctl->conn, name);
|
||||
+
|
||||
+ if (virNodeDeviceDestroy(dev) == 0) {
|
||||
+ vshPrint(ctl, _("Destroyed node device '%s'\n"), name);
|
||||
+ } else {
|
||||
+ vshError(ctl, FALSE, _("Failed to destroy node device '%s'"), name);
|
||||
+ ret = FALSE;
|
||||
+ }
|
||||
+
|
||||
+ virNodeDeviceFree(dev);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/*
|
||||
* XML Building helper for pool-define-as and pool-create-as
|
||||
*/
|
||||
static const vshCmdOptDef opts_pool_X_as[] = {
|
||||
@@ -5895,6 +5996,8 @@ static const vshCmdDef commands[] = {
|
||||
{"nodedev-dettach", cmdNodeDeviceDettach, opts_node_device_dettach, info_node_device_dettach},
|
||||
{"nodedev-reattach", cmdNodeDeviceReAttach, opts_node_device_reattach, info_node_device_reattach},
|
||||
{"nodedev-reset", cmdNodeDeviceReset, opts_node_device_reset, info_node_device_reset},
|
||||
+ {"nodedev-create", cmdNodeDeviceCreate, opts_node_device_create, info_node_device_create},
|
||||
+ {"nodedev-destroy", cmdNodeDeviceDestroy, opts_node_device_destroy, info_node_device_destroy},
|
||||
|
||||
{"pool-autostart", cmdPoolAutostart, opts_pool_autostart, info_pool_autostart},
|
||||
{"pool-build", cmdPoolBuild, opts_pool_build, info_pool_build},
|
||||
--
|
||||
1.6.0.6
|
@ -38,7 +38,9 @@ ignored_functions = {
|
||||
"virDomainMigratePerform": "private function for migration",
|
||||
"virDomainMigratePrepare": "private function for migration",
|
||||
"virDomainMigratePrepare2": "private function for migration",
|
||||
"virDomainMigratePrepareTunnel": "private function for tunnelled migration",
|
||||
"virDrvSupportsFeature": "private function for remote access",
|
||||
"DllMain": "specific function for Win32",
|
||||
}
|
||||
|
||||
def escape(raw):
|
||||
@ -53,7 +55,9 @@ def uniq(items):
|
||||
d = {}
|
||||
for item in items:
|
||||
d[item]=1
|
||||
return d.keys()
|
||||
k = d.keys()
|
||||
k.sort()
|
||||
return k
|
||||
|
||||
class identifier:
|
||||
def __init__(self, name, header=None, module=None, type=None, lineno = 0,
|
||||
@ -837,14 +841,20 @@ class CParser:
|
||||
arg, name))
|
||||
while len(lines) > 0 and lines[0] == '*':
|
||||
del lines[0]
|
||||
desc = ""
|
||||
desc = None
|
||||
while len(lines) > 0:
|
||||
l = lines[0]
|
||||
while len(l) > 0 and l[0] == '*':
|
||||
l = l[1:]
|
||||
l = string.strip(l)
|
||||
if len(l) >= 6 and l[0:6] == "return" or l[0:6] == "Return":
|
||||
try:
|
||||
i = 0
|
||||
# Remove all leading '*', followed by at most one ' ' character
|
||||
# since we need to preserve correct identation of code examples
|
||||
while i < len(l) and l[i] == '*':
|
||||
i = i + 1
|
||||
if i > 0:
|
||||
if i < len(l) and l[i] == ' ':
|
||||
i = i + 1
|
||||
l = l[i:]
|
||||
if len(l) >= 6 and l[0:7] == "returns" or l[0:7] == "Returns":
|
||||
try:
|
||||
l = string.split(l, ' ', 1)[1]
|
||||
except:
|
||||
l = ""
|
||||
@ -858,9 +868,14 @@ class CParser:
|
||||
retdesc = retdesc + " " + l
|
||||
del lines[0]
|
||||
else:
|
||||
desc = desc + " " + l
|
||||
if desc is not None:
|
||||
desc = desc + "\n" + l
|
||||
else:
|
||||
desc = l
|
||||
del lines[0]
|
||||
|
||||
if desc is None:
|
||||
desc = ""
|
||||
retdesc = string.strip(retdesc)
|
||||
desc = string.strip(desc)
|
||||
|
||||
@ -1715,7 +1730,7 @@ class docBuilder:
|
||||
try:
|
||||
(args, desc) = id.info
|
||||
if desc != None and desc != "":
|
||||
output.write(" <info>%s</info>\n" % (escape(desc)))
|
||||
output.write(" <info><![CDATA[%s]]></info>\n" % (desc))
|
||||
self.indexString(name, desc)
|
||||
for arg in args:
|
||||
(name, desc) = arg
|
||||
@ -1759,7 +1774,7 @@ class docBuilder:
|
||||
try:
|
||||
desc = id.extra
|
||||
if desc != None and desc != "":
|
||||
output.write(">\n <info>%s</info>\n" % (escape(desc)))
|
||||
output.write(">\n <info><![CDATA[%s]]></info>\n" % (desc))
|
||||
output.write(" </typedef>\n")
|
||||
else:
|
||||
output.write("/>\n")
|
||||
@ -1795,7 +1810,7 @@ class docBuilder:
|
||||
output.write(" <cond>%s</cond>\n"% (apstr));
|
||||
try:
|
||||
(ret, params, desc) = id.info
|
||||
output.write(" <info>%s</info>\n" % (escape(desc)))
|
||||
output.write(" <info><![CDATA[%s]]></info>\n" % (desc))
|
||||
self.indexString(name, desc)
|
||||
if ret[0] != None:
|
||||
if ret[0] == "void":
|
||||
@ -2088,11 +2103,11 @@ def rebuild():
|
||||
builder = None
|
||||
if glob.glob("../src/libvirt.c") != [] :
|
||||
print "Rebuilding API description for libvirt"
|
||||
builder = docBuilder("libvirt", ["../src", "../include/libvirt"],
|
||||
builder = docBuilder("libvirt", ["../src", "../src/util", "../include/libvirt"],
|
||||
[])
|
||||
elif glob.glob("src/libvirt.c") != [] :
|
||||
print "Rebuilding API description for libvir"
|
||||
builder = docBuilder("libvirt", ["src", "include/libvirt"],
|
||||
builder = docBuilder("libvirt", ["src", "src/util", "include/libvirt"],
|
||||
[])
|
||||
else:
|
||||
print "rebuild() failed, unable to guess the module"
|
||||
|
168
docs/apps.html
168
docs/apps.html
@ -1,168 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!--
|
||||
This file is autogenerated from apps.html.in
|
||||
Do not edit this file. Changes will be lost.
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
|
||||
<link rel="stylesheet" type="text/css" href="main.css" />
|
||||
<link rel="SHORTCUT ICON" href="32favicon.png" />
|
||||
<title>libvirt: Applications using libvirt</title>
|
||||
<meta name="description" content="libvirt, virtualization, virtualization API" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="headerLogo"></div>
|
||||
<div id="headerSearch">
|
||||
<form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><div>
|
||||
<input id="query" name="query" type="text" size="12" value="" />
|
||||
<input id="submit" name="submit" type="submit" value="Search" />
|
||||
</div></form>
|
||||
</div>
|
||||
</div>
|
||||
<div id="body">
|
||||
<div id="menu">
|
||||
<ul class="l0"><li>
|
||||
<div>
|
||||
<a title="Front page of the libvirt website" class="inactive" href="index.html">Home</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Details of new features and bugs fixed in each release" class="inactive" href="news.html">News</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Get the latest source releases, binary builds and get access to the source repository" class="inactive" href="downloads.html">Downloads</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Information for users, administrators and developers" class="inactive" href="docs.html">Documentation</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="User contributed content" class="inactive" href="http://wiki.libvirt.org">Wiki</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Frequently asked questions" class="inactive" href="FAQ.html">FAQ</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How and where to report bugs and request features" class="inactive" href="bugs.html">Bug reports</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How to contact the developers via email and IRC" class="inactive" href="contact.html">Contact</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Miscellaneous links of interest related to libvirt" class="active" href="relatedlinks.html">Related Links</a>
|
||||
<ul class="l1"><li>
|
||||
<div>
|
||||
<span class="active">Applications</span>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of all content on the website" class="inactive" href="sitemap.html">Sitemap</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
<div id="content">
|
||||
<h1>Applications using <strong>libvirt</strong></h1>
|
||||
<p>
|
||||
This page provides an illustration of the wide variety of
|
||||
applications using the libvirt management API. If you know
|
||||
of interesting applications not listed on this page, send
|
||||
a message to the <a href="contact.html">mailing list</a>
|
||||
to request that it be added here. If your application uses
|
||||
libvirt as its API, the following graphic is available for
|
||||
your website to advertise support for libvirt:
|
||||
</p>
|
||||
<p class="image">
|
||||
<img src="madeWith.png" alt="Made with libvirt" /></p>
|
||||
<h2>Command line tools</h2>
|
||||
<dl><dt>virsh</dt><dd>
|
||||
An interactive shell, and batch scriptable tool for performing
|
||||
management tasks on all libvirt managed domains, networks and
|
||||
storage. This is part of the libvirt core distribution.
|
||||
</dd><dt><a href="http://virt-manager.org/">virt-install</a></dt><dd>
|
||||
Provides a way to provision new virtual machines from a
|
||||
OS distribution install tree. It supports provisioning from
|
||||
local CD images, and the network over NFS, HTTP and FTP.
|
||||
</dd><dt><a href="http://virt-manager.org/">virt-clone</a></dt><dd>
|
||||
Allows the disk image(s) and configuration for an existing
|
||||
virtual machine to be cloned to form a new virtual machine.
|
||||
It automates copying of data across to new disk images, and
|
||||
updates the UUID, Mac address and name in the configuration
|
||||
</dd><dt><a href="http://virt-manager.org/">virt-image</a></dt><dd>
|
||||
Provides a way to deploy virtual appliances. It defines a
|
||||
simplified portable XML format describing the pre-requisites
|
||||
of a virtual machine. At time of deployment this is translated
|
||||
into the domain XML format for execution under any libvirt
|
||||
hypervisor meeting the pre-requisites.
|
||||
</dd><dt><a href="http://et.redhat.com/~rjones/virt-df/">virt-df</a></dt><dd>
|
||||
Examine the utilization of each filesystem in a virtual machine
|
||||
from the comfort of the host machine. This tool peeks into the
|
||||
guest disks and determines how much space is used. It can cope
|
||||
with common Linux filesystems and LVM volumes.
|
||||
</dd><dt><a href="http://et.redhat.com/~rjones/virt-top/">virt-top</a></dt><dd>
|
||||
Watch the CPU, memory, network and disk utilization of all
|
||||
virtual machines running on a host.
|
||||
</dd></dl>
|
||||
<h2>Desktop applications</h2>
|
||||
<dl><dt><a href="http://virt-manager.org/">virt-manager</a></dt><dd>
|
||||
A general purpose desktop management tool, able to manage
|
||||
virtual machines across both local and remotely accessed
|
||||
hypervisors. It is targeted at home and small office usage
|
||||
upto managing 10-20 hosts and their VMs.
|
||||
</dd><dt><a href="http://virt-manager.org/">virt-viewer</a></dt><dd>
|
||||
A lightweight tool for accessing the graphical console
|
||||
associated with a virtual machine. It can securely connect
|
||||
to remote consoles supporting the VNC protocol. Also provides
|
||||
an optional mozilla browser plugin.
|
||||
</dd></dl>
|
||||
<h2>Web applications</h2>
|
||||
<dl><dt><a href="http://ovirt.org/">oVirt</a></dt><dd>
|
||||
oVirt provides the ability to manage large numbers of virtual
|
||||
machines across an entire data center of hosts. It integrates
|
||||
with FreeIPA for Kerberos authentication, and in the future,
|
||||
certificate management.
|
||||
</dd></dl>
|
||||
<h2>LiveCD / Appliances</h2>
|
||||
<dl><dt><a href="http://et.redhat.com/~rjones/virt-p2v/">virt-p2v</a></dt><dd>
|
||||
A tool for converting a physical machine into a virtual machine. It
|
||||
is a LiveCD which is booted on the machine to be converted. It collects
|
||||
a little information from the user and then copies the disks over to
|
||||
a remote machine and defines the XML for a domain to run the guest.
|
||||
</dd></dl>
|
||||
<h2>Monitoring plugins</h2>
|
||||
<dl><dt><a href="http://honk.sigxcpu.org/projects/libvirt/#munin">for munin</a></dt><dd>
|
||||
The plugins provided by Guido Günther allow to monitor various things
|
||||
like network and block I/O with
|
||||
<a href="http://munin.projects.linpro.no/">Munin</a>.
|
||||
</dd><dt><a href="http://collectd.org/plugins/libvirt.shtml">for collectd</a></dt><dd>
|
||||
The libvirt-plugin is part of <a href="http://collectd.org/">collectd</a>
|
||||
and gather statistics about virtualized guests on a system. This
|
||||
way, you can collect CPU, network interface and block device usage
|
||||
for each guest without installing collectd on the guest systems.
|
||||
or a full description of available please refer to the libvirt section
|
||||
in the collectd.conf(5) manual page.
|
||||
</dd><dt><a href="http://et.redhat.com/~rjones/nagios-virt/">nagios-virt</a></dt><dd>
|
||||
Nagios-virt is a configuration tool for adding monitoring of your
|
||||
virtualised domains to <a href="http://www.nagios.org/">Nagios</a>.
|
||||
You can use this tool to either set up a new Nagios installation for
|
||||
your Xen or QEMU/KVM guests, or to integrate with your existing Nagios
|
||||
installation.
|
||||
</dd></dl>
|
||||
</div>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<p id="sponsor">
|
||||
Sponsored by:<br /><a href="http://et.redhat.com/"><img src="et.png" alt="Project sponsored by Red Hat Emerging Technology" /></a></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -89,6 +89,14 @@
|
||||
with FreeIPA for Kerberos authentication, and in the future,
|
||||
certificate management.
|
||||
</dd>
|
||||
<dt><a href="http://community.abiquo.com/display/AbiCloud">AbiCloud</a></dt>
|
||||
<dd>
|
||||
AbiCloud is an open source cloud platform manager which allows to
|
||||
easily deploy a private cloud in your datacenter. One of the key
|
||||
differences of AbiCloud is the web rich interface for managing the
|
||||
infrastructure. You can deploy a new service just dragging and
|
||||
dropping a VM.
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<h2>LiveCD / Appliances</h2>
|
||||
|
@ -1,124 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!--
|
||||
This file is autogenerated from archdomain.html.in
|
||||
Do not edit this file. Changes will be lost.
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
|
||||
<link rel="stylesheet" type="text/css" href="main.css" />
|
||||
<link rel="SHORTCUT ICON" href="32favicon.png" />
|
||||
<title>libvirt: Domain management architecture</title>
|
||||
<meta name="description" content="libvirt, virtualization, virtualization API" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="headerLogo"></div>
|
||||
<div id="headerSearch">
|
||||
<form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><div>
|
||||
<input id="query" name="query" type="text" size="12" value="" />
|
||||
<input id="submit" name="submit" type="submit" value="Search" />
|
||||
</div></form>
|
||||
</div>
|
||||
</div>
|
||||
<div id="body">
|
||||
<div id="menu">
|
||||
<ul class="l0"><li>
|
||||
<div>
|
||||
<a title="Front page of the libvirt website" class="inactive" href="index.html">Home</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Details of new features and bugs fixed in each release" class="inactive" href="news.html">News</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Get the latest source releases, binary builds and get access to the source repository" class="inactive" href="downloads.html">Downloads</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Information for users, administrators and developers" class="active" href="docs.html">Documentation</a>
|
||||
<ul class="l1"><li>
|
||||
<div>
|
||||
<a title="Information about deploying and using libvirt" class="inactive" href="deployment.html">Deployment</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of the logical subsystems in the libvirt API" class="active" href="intro.html">Architecture</a>
|
||||
<ul class="l2"><li>
|
||||
<div>
|
||||
<a title="Terminology and goals of libvirt API" class="inactive" href="goals.html">Goals</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<span class="active">Domains</span>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Providing isolated networks and NAT based network connectivity" class="inactive" href="archnetwork.html">Network</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Managing storage pools and volumes" class="inactive" href="archstorage.html">Storage</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Enumerating host node devices" class="inactive" href="archnode.html">Node Devices</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Description of the XML formats used in libvirt" class="inactive" href="format.html">XML format</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Hypervisor specific driver information" class="inactive" href="drivers.html">Drivers</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Reference manual for the C public API" class="inactive" href="html/index.html">API reference</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Bindings of the libvirt API for other languages" class="inactive" href="bindings.html">Language bindings</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="User contributed content" class="inactive" href="http://wiki.libvirt.org">Wiki</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Frequently asked questions" class="inactive" href="FAQ.html">FAQ</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How and where to report bugs and request features" class="inactive" href="bugs.html">Bug reports</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How to contact the developers via email and IRC" class="inactive" href="contact.html">Contact</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Miscellaneous links of interest related to libvirt" class="inactive" href="relatedlinks.html">Related Links</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of all content on the website" class="inactive" href="sitemap.html">Sitemap</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
<div id="content">
|
||||
<h1>Domain management architecture</h1>
|
||||
</div>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<p id="sponsor">
|
||||
Sponsored by:<br /><a href="http://et.redhat.com/"><img src="et.png" alt="Project sponsored by Red Hat Emerging Technology" /></a></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -1,157 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!--
|
||||
This file is autogenerated from architecture.html.in
|
||||
Do not edit this file. Changes will be lost.
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
|
||||
<link rel="stylesheet" type="text/css" href="main.css" />
|
||||
<link rel="SHORTCUT ICON" href="32favicon.png" />
|
||||
<title>libvirt: libvirt architecture</title>
|
||||
<meta name="description" content="libvirt, virtualization, virtualization API" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="headerLogo"></div>
|
||||
<div id="headerSearch">
|
||||
<form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><div>
|
||||
<input id="query" name="query" type="text" size="12" value="" />
|
||||
<input id="submit" name="submit" type="submit" value="Search" />
|
||||
</div></form>
|
||||
</div>
|
||||
</div>
|
||||
<div id="body">
|
||||
<div id="menu">
|
||||
<ul class="l0"><li>
|
||||
<div>
|
||||
<a title="Front page of the libvirt website" class="inactive" href="index.html">Home</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Details of new features and bugs fixed in each release" class="inactive" href="news.html">News</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Get the latest source releases, binary builds and get access to the source repository" class="inactive" href="downloads.html">Downloads</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Information for users, administrators and developers" class="inactive" href="docs.html">Documentation</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="User contributed content" class="inactive" href="http://wiki.libvirt.org">Wiki</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Frequently asked questions" class="inactive" href="FAQ.html">FAQ</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How and where to report bugs and request features" class="inactive" href="bugs.html">Bug reports</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How to contact the developers via email and IRC" class="inactive" href="contact.html">Contact</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Miscellaneous links of interest related to libvirt" class="inactive" href="relatedlinks.html">Related Links</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of all content on the website" class="inactive" href="sitemap.html">Sitemap</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
<div id="content">
|
||||
<h1>libvirt architecture</h1>
|
||||
<p>Currently libvirt supports 2 kind of virtualization, and its
|
||||
internal structure is based on a driver model which simplifies adding new
|
||||
engines:</p>
|
||||
<ul><li>
|
||||
<a href="#Xen">Xen hypervisor</a>
|
||||
</li><li>
|
||||
<a href="#QEmu">QEmu and KVM based virtualization</a>
|
||||
</li><li>
|
||||
<a href="#drivers">the driver architecture</a>
|
||||
</li></ul>
|
||||
<h3>
|
||||
<a name="Xen" id="Xen">Libvirt Xen support</a>
|
||||
</h3>
|
||||
<p>When running in a Xen environment, programs using libvirt have to execute
|
||||
in "Domain 0", which is the primary Linux OS loaded on the machine. That OS
|
||||
kernel provides most if not all of the actual drivers used by the set of
|
||||
domains. It also runs the Xen Store, a database of information shared by the
|
||||
hypervisor, the kernels, the drivers and the xen daemon. Xend. The xen daemon
|
||||
supervise the control and execution of the sets of domains. The hypervisor,
|
||||
drivers, kernels and daemons communicate though a shared system bus
|
||||
implemented in the hypervisor. The figure below tries to provide a view of
|
||||
this environment:</p>
|
||||
<img src="architecture.gif" alt="The Xen architecture" />
|
||||
<p>The library can be initialized in 2 ways depending on the level of
|
||||
privilege of the embedding program. If it runs with root access,
|
||||
virConnectOpen() can be used, it will use three different ways to connect to
|
||||
the Xen infrastructure:</p>
|
||||
<ul><li>a connection to the Xen Daemon though an HTTP RPC layer</li><li>a read/write connection to the Xen Store</li><li>use Xen Hypervisor calls</li><li>when used as non-root libvirt connect to a proxy daemon running
|
||||
as root and providing read-only support</li></ul>
|
||||
<p>The library will usually interact with the Xen daemon for any operation
|
||||
changing the state of the system, but for performance and accuracy reasons
|
||||
may talk directly to the hypervisor when gathering state information at
|
||||
least when possible (i.e. when the running program using libvirt has root
|
||||
privilege access).</p>
|
||||
<p>If it runs without root access virConnectOpenReadOnly() should be used to
|
||||
connect to initialize the library. It will then fork a libvirt_proxy
|
||||
program running as root and providing read_only access to the API, this is
|
||||
then only useful for reporting and monitoring.</p>
|
||||
<h3>
|
||||
<a name="QEmu" id="QEmu">Libvirt QEmu and KVM support</a>
|
||||
</h3>
|
||||
<p>The model for QEmu and KVM is completely similar, basically KVM is based
|
||||
on QEmu for the process controlling a new domain, only small details differs
|
||||
between the two. In both case the libvirt API is provided by a controlling
|
||||
process forked by libvirt in the background and which launch and control the
|
||||
QEmu or KVM process. That program called libvirt_qemud talks though a specific
|
||||
protocol to the library, and connects to the console of the QEmu process in
|
||||
order to control and report on its status. Libvirt tries to expose all the
|
||||
emulations models of QEmu, the selection is done when creating the new
|
||||
domain, by specifying the architecture and machine type targeted.</p>
|
||||
<p>The code controlling the QEmu process is available in the
|
||||
<code>qemud/</code> directory.</p>
|
||||
<h3>
|
||||
<a name="drivers" id="drivers">the driver based architecture</a>
|
||||
</h3>
|
||||
<p>As the previous section explains, libvirt can communicate using different
|
||||
channels with the current hypervisor, and should also be able to use
|
||||
different kind of hypervisor. To simplify the internal design, code, ease
|
||||
maintenance and simplify the support of other virtualization engine the
|
||||
internals have been structured as one core component, the libvirt.c module
|
||||
acting as a front-end for the library API and a set of hypervisor drivers
|
||||
defining a common set of routines. That way the Xen Daemon access, the Xen
|
||||
Store one, the Hypervisor hypercall are all isolated in separate C modules
|
||||
implementing at least a subset of the common operations defined by the
|
||||
drivers present in driver.h:</p>
|
||||
<ul><li>xend_internal: implements the driver functions though the Xen
|
||||
Daemon</li><li>xs_internal: implements the subset of the driver available though the
|
||||
Xen Store</li><li>xen_internal: provide the implementation of the functions possible via
|
||||
direct hypervisor access</li><li>proxy_internal: provide read-only Xen access via a proxy, the proxy code
|
||||
is in the <code>proxy/</code>directory.</li><li>xm_internal: provide support for Xen defined but not running
|
||||
domains.</li><li>qemu_internal: implement the driver functions for QEmu and
|
||||
KVM virtualization engines. It also uses a qemud/ specific daemon
|
||||
which interacts with the QEmu process to implement libvirt API.</li><li>test: this is a test driver useful for regression tests of the
|
||||
front-end part of libvirt.</li></ul>
|
||||
<p>Note that a given driver may only implement a subset of those functions,
|
||||
(for example saving a Xen domain state to disk and restoring it is only
|
||||
possible though the Xen Daemon), in that case the driver entry points for
|
||||
unsupported functions are initialized to NULL.</p>
|
||||
<p></p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<p id="sponsor">
|
||||
Sponsored by:<br /><a href="http://et.redhat.com/"><img src="et.png" alt="Project sponsored by Red Hat Emerging Technology" /></a></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -1,153 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!--
|
||||
This file is autogenerated from archnetwork.html.in
|
||||
Do not edit this file. Changes will be lost.
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
|
||||
<link rel="stylesheet" type="text/css" href="main.css" />
|
||||
<link rel="SHORTCUT ICON" href="32favicon.png" />
|
||||
<title>libvirt: Network management architecture</title>
|
||||
<meta name="description" content="libvirt, virtualization, virtualization API" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="headerLogo"></div>
|
||||
<div id="headerSearch">
|
||||
<form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><div>
|
||||
<input id="query" name="query" type="text" size="12" value="" />
|
||||
<input id="submit" name="submit" type="submit" value="Search" />
|
||||
</div></form>
|
||||
</div>
|
||||
</div>
|
||||
<div id="body">
|
||||
<div id="menu">
|
||||
<ul class="l0"><li>
|
||||
<div>
|
||||
<a title="Front page of the libvirt website" class="inactive" href="index.html">Home</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Details of new features and bugs fixed in each release" class="inactive" href="news.html">News</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Get the latest source releases, binary builds and get access to the source repository" class="inactive" href="downloads.html">Downloads</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Information for users, administrators and developers" class="active" href="docs.html">Documentation</a>
|
||||
<ul class="l1"><li>
|
||||
<div>
|
||||
<a title="Information about deploying and using libvirt" class="inactive" href="deployment.html">Deployment</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of the logical subsystems in the libvirt API" class="active" href="intro.html">Architecture</a>
|
||||
<ul class="l2"><li>
|
||||
<div>
|
||||
<a title="Terminology and goals of libvirt API" class="inactive" href="goals.html">Goals</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Managing virtual machines" class="inactive" href="archdomain.html">Domains</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<span class="active">Network</span>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Managing storage pools and volumes" class="inactive" href="archstorage.html">Storage</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Enumerating host node devices" class="inactive" href="archnode.html">Node Devices</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Description of the XML formats used in libvirt" class="inactive" href="format.html">XML format</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Hypervisor specific driver information" class="inactive" href="drivers.html">Drivers</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Reference manual for the C public API" class="inactive" href="html/index.html">API reference</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Bindings of the libvirt API for other languages" class="inactive" href="bindings.html">Language bindings</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="User contributed content" class="inactive" href="http://wiki.libvirt.org">Wiki</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Frequently asked questions" class="inactive" href="FAQ.html">FAQ</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How and where to report bugs and request features" class="inactive" href="bugs.html">Bug reports</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How to contact the developers via email and IRC" class="inactive" href="contact.html">Contact</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Miscellaneous links of interest related to libvirt" class="inactive" href="relatedlinks.html">Related Links</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of all content on the website" class="inactive" href="sitemap.html">Sitemap</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
<div id="content">
|
||||
<h1>Network management architecture</h1>
|
||||
<h2>Architecture illustration</h2>
|
||||
<p>
|
||||
The diagrams below illustrate some of the network configurations
|
||||
enabled by the libvirt networking APIs
|
||||
</p>
|
||||
<ul><li><strong>VLAN 1</strong>. This virtual network has connectivity
|
||||
to <code>LAN 2</code> with traffic forwarded and NATed.
|
||||
</li><li><strong>VLAN 2</strong>. This virtual network is completely
|
||||
isolated from any physical LAN.
|
||||
</li><li><strong>Guest A</strong>. The first network interface is bridged
|
||||
to the physical <code>LAN 1</code>. The second interface is connected
|
||||
to a virtual network <code>VLAN 1</code>.
|
||||
</li><li><strong>Guest B</strong>. The first network interface is connected
|
||||
to a virtual network <code>VLAN 1</code>, giving it limited NAT
|
||||
based connectivity to LAN2. It has a second network interface
|
||||
connected to <code>VLAN 2</code>. It acts a router allowing limited
|
||||
traffic between the two VLANs, thus giving <code>Guest C</code>
|
||||
connectivity to the physical <code>LAN 2</code>.
|
||||
</li><li><strong>Guest C</strong>. The only network interface is connected
|
||||
to a virtual network <code>VLAN 2</code>. It has no direct connectivity
|
||||
to a physical LAN, relying on <code>Guest B</code> to route traffic
|
||||
on its behalf.
|
||||
</li></ul>
|
||||
<h3>Logical diagram</h3>
|
||||
<p class="image">
|
||||
<img src="libvirt-net-logical.png" alt="Logical network architecture" /></p>
|
||||
<h3>Physical diagram</h3>
|
||||
<p class="image">
|
||||
<img src="libvirt-net-physical.png" alt="Physical network architecture" /></p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<p id="sponsor">
|
||||
Sponsored by:<br /><a href="http://et.redhat.com/"><img src="et.png" alt="Project sponsored by Red Hat Emerging Technology" /></a></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -1,124 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!--
|
||||
This file is autogenerated from archnode.html.in
|
||||
Do not edit this file. Changes will be lost.
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
|
||||
<link rel="stylesheet" type="text/css" href="main.css" />
|
||||
<link rel="SHORTCUT ICON" href="32favicon.png" />
|
||||
<title>libvirt: Node device management architecture</title>
|
||||
<meta name="description" content="libvirt, virtualization, virtualization API" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="headerLogo"></div>
|
||||
<div id="headerSearch">
|
||||
<form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><div>
|
||||
<input id="query" name="query" type="text" size="12" value="" />
|
||||
<input id="submit" name="submit" type="submit" value="Search" />
|
||||
</div></form>
|
||||
</div>
|
||||
</div>
|
||||
<div id="body">
|
||||
<div id="menu">
|
||||
<ul class="l0"><li>
|
||||
<div>
|
||||
<a title="Front page of the libvirt website" class="inactive" href="index.html">Home</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Details of new features and bugs fixed in each release" class="inactive" href="news.html">News</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Get the latest source releases, binary builds and get access to the source repository" class="inactive" href="downloads.html">Downloads</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Information for users, administrators and developers" class="active" href="docs.html">Documentation</a>
|
||||
<ul class="l1"><li>
|
||||
<div>
|
||||
<a title="Information about deploying and using libvirt" class="inactive" href="deployment.html">Deployment</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of the logical subsystems in the libvirt API" class="active" href="intro.html">Architecture</a>
|
||||
<ul class="l2"><li>
|
||||
<div>
|
||||
<a title="Terminology and goals of libvirt API" class="inactive" href="goals.html">Goals</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Managing virtual machines" class="inactive" href="archdomain.html">Domains</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Providing isolated networks and NAT based network connectivity" class="inactive" href="archnetwork.html">Network</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Managing storage pools and volumes" class="inactive" href="archstorage.html">Storage</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<span class="active">Node Devices</span>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Description of the XML formats used in libvirt" class="inactive" href="format.html">XML format</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Hypervisor specific driver information" class="inactive" href="drivers.html">Drivers</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Reference manual for the C public API" class="inactive" href="html/index.html">API reference</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Bindings of the libvirt API for other languages" class="inactive" href="bindings.html">Language bindings</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="User contributed content" class="inactive" href="http://wiki.libvirt.org">Wiki</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Frequently asked questions" class="inactive" href="FAQ.html">FAQ</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How and where to report bugs and request features" class="inactive" href="bugs.html">Bug reports</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How to contact the developers via email and IRC" class="inactive" href="contact.html">Contact</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Miscellaneous links of interest related to libvirt" class="inactive" href="relatedlinks.html">Related Links</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of all content on the website" class="inactive" href="sitemap.html">Sitemap</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
<div id="content">
|
||||
<h1>Node device management architecture</h1>
|
||||
</div>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<p id="sponsor">
|
||||
Sponsored by:<br /><a href="http://et.redhat.com/"><img src="et.png" alt="Project sponsored by Red Hat Emerging Technology" /></a></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -1,143 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!--
|
||||
This file is autogenerated from archstorage.html.in
|
||||
Do not edit this file. Changes will be lost.
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
|
||||
<link rel="stylesheet" type="text/css" href="main.css" />
|
||||
<link rel="SHORTCUT ICON" href="32favicon.png" />
|
||||
<title>libvirt: Storage management architecture</title>
|
||||
<meta name="description" content="libvirt, virtualization, virtualization API" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="headerLogo"></div>
|
||||
<div id="headerSearch">
|
||||
<form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><div>
|
||||
<input id="query" name="query" type="text" size="12" value="" />
|
||||
<input id="submit" name="submit" type="submit" value="Search" />
|
||||
</div></form>
|
||||
</div>
|
||||
</div>
|
||||
<div id="body">
|
||||
<div id="menu">
|
||||
<ul class="l0"><li>
|
||||
<div>
|
||||
<a title="Front page of the libvirt website" class="inactive" href="index.html">Home</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Details of new features and bugs fixed in each release" class="inactive" href="news.html">News</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Get the latest source releases, binary builds and get access to the source repository" class="inactive" href="downloads.html">Downloads</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Information for users, administrators and developers" class="active" href="docs.html">Documentation</a>
|
||||
<ul class="l1"><li>
|
||||
<div>
|
||||
<a title="Information about deploying and using libvirt" class="inactive" href="deployment.html">Deployment</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of the logical subsystems in the libvirt API" class="active" href="intro.html">Architecture</a>
|
||||
<ul class="l2"><li>
|
||||
<div>
|
||||
<a title="Terminology and goals of libvirt API" class="inactive" href="goals.html">Goals</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Managing virtual machines" class="inactive" href="archdomain.html">Domains</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Providing isolated networks and NAT based network connectivity" class="inactive" href="archnetwork.html">Network</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<span class="active">Storage</span>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Enumerating host node devices" class="inactive" href="archnode.html">Node Devices</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Description of the XML formats used in libvirt" class="inactive" href="format.html">XML format</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Hypervisor specific driver information" class="inactive" href="drivers.html">Drivers</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Reference manual for the C public API" class="inactive" href="html/index.html">API reference</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Bindings of the libvirt API for other languages" class="inactive" href="bindings.html">Language bindings</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="User contributed content" class="inactive" href="http://wiki.libvirt.org">Wiki</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Frequently asked questions" class="inactive" href="FAQ.html">FAQ</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How and where to report bugs and request features" class="inactive" href="bugs.html">Bug reports</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How to contact the developers via email and IRC" class="inactive" href="contact.html">Contact</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Miscellaneous links of interest related to libvirt" class="inactive" href="relatedlinks.html">Related Links</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of all content on the website" class="inactive" href="sitemap.html">Sitemap</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
<div id="content">
|
||||
<h1>Storage management architecture</h1>
|
||||
<p>
|
||||
The storage management APIs are based around 2 core concepts
|
||||
</p>
|
||||
<ol><li>
|
||||
<strong>Volume</strong> - a single storage volume which can
|
||||
be assigned to a guest, or used for creating further pools. A
|
||||
volume is either a block device, a raw file, or a special format
|
||||
file.
|
||||
</li><li>
|
||||
<strong>Pool</strong> - provides a means for taking a chunk
|
||||
of storage and carving it up into volumes. A pool can be used to
|
||||
manage things such as a physical disk, a NFS server, a iSCSI target,
|
||||
a host adapter, an LVM group.
|
||||
</li></ol>
|
||||
<p>
|
||||
These two concepts are mapped through to two libvirt objects, a
|
||||
<code>virStorageVolPtr</code> and a <code>virStoragePoolPtr</code>,
|
||||
each with a collection of APIs for their management.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<p id="sponsor">
|
||||
Sponsored by:<br /><a href="http://et.redhat.com/"><img src="et.png" alt="Project sponsored by Red Hat Emerging Technology" /></a></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
310
docs/auth.html
310
docs/auth.html
@ -1,310 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!--
|
||||
This file is autogenerated from auth.html.in
|
||||
Do not edit this file. Changes will be lost.
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
|
||||
<link rel="stylesheet" type="text/css" href="main.css" />
|
||||
<link rel="SHORTCUT ICON" href="32favicon.png" />
|
||||
<title>libvirt: Access control</title>
|
||||
<meta name="description" content="libvirt, virtualization, virtualization API" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="headerLogo"></div>
|
||||
<div id="headerSearch">
|
||||
<form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><div>
|
||||
<input id="query" name="query" type="text" size="12" value="" />
|
||||
<input id="submit" name="submit" type="submit" value="Search" />
|
||||
</div></form>
|
||||
</div>
|
||||
</div>
|
||||
<div id="body">
|
||||
<div id="menu">
|
||||
<ul class="l0"><li>
|
||||
<div>
|
||||
<a title="Front page of the libvirt website" class="inactive" href="index.html">Home</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Details of new features and bugs fixed in each release" class="inactive" href="news.html">News</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Get the latest source releases, binary builds and get access to the source repository" class="inactive" href="downloads.html">Downloads</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Information for users, administrators and developers" class="active" href="docs.html">Documentation</a>
|
||||
<ul class="l1"><li>
|
||||
<div>
|
||||
<a title="Information about deploying and using libvirt" class="active" href="deployment.html">Deployment</a>
|
||||
<ul class="l2"><li>
|
||||
<div>
|
||||
<a title="The URI formats used for connecting to libvirt" class="inactive" href="uri.html">URI format</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Enable remote access over TCP" class="inactive" href="remote.html">Remote access</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<span class="active">Authentication</span>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Access the libvirt daemon from a native Windows client" class="inactive" href="windows.html">Windows port</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="The library and the daemon logging support" class="inactive" href="logging.html">Logging</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of the logical subsystems in the libvirt API" class="inactive" href="intro.html">Architecture</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Description of the XML formats used in libvirt" class="inactive" href="format.html">XML format</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Hypervisor specific driver information" class="inactive" href="drivers.html">Drivers</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Reference manual for the C public API" class="inactive" href="html/index.html">API reference</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Bindings of the libvirt API for other languages" class="inactive" href="bindings.html">Language bindings</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="User contributed content" class="inactive" href="http://wiki.libvirt.org">Wiki</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Frequently asked questions" class="inactive" href="FAQ.html">FAQ</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How and where to report bugs and request features" class="inactive" href="bugs.html">Bug reports</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How to contact the developers via email and IRC" class="inactive" href="contact.html">Contact</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Miscellaneous links of interest related to libvirt" class="inactive" href="relatedlinks.html">Related Links</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of all content on the website" class="inactive" href="sitemap.html">Sitemap</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
<div id="content">
|
||||
<h1>Access control</h1>
|
||||
<p>
|
||||
When connecting to libvirt, some connections may require client
|
||||
authentication before allowing use of the APIs. The set of possible
|
||||
authentication mechanisms is administrator controlled, independent
|
||||
of applications using libvirt.
|
||||
</p>
|
||||
<ul><li>
|
||||
<a href="#ACL_server_config">Server configuration</a>
|
||||
</li><li>
|
||||
<a href="#ACL_server_unix_perms">UNIX socket permissions/group</a>
|
||||
</li><li>
|
||||
<a href="#ACL_server_polkit">UNIX socket PolicyKit auth</a>
|
||||
</li><li>
|
||||
<a href="#ACL_server_username">Username/password auth</a>
|
||||
</li><li>
|
||||
<a href="#ACL_server_kerberos">Kerberos auth</a>
|
||||
</li></ul>
|
||||
<h3>
|
||||
<a name="ACL_server_config" id="ACL_server_config">Server configuration</a>
|
||||
</h3>
|
||||
<p>
|
||||
The libvirt daemon allows the administrator to choose the authentication
|
||||
mechanisms used for client connections on each network socket independently.
|
||||
This is primarily controlled via the libvirt daemon master config file in
|
||||
<code>/etc/libvirt/libvirtd.conf</code>. Each of the libvirt sockets can
|
||||
have its authentication mechanism configured independently. There is
|
||||
currently a choice of <code>none</code>, <code>polkit</code>, and <code>sasl</code>.
|
||||
The SASL scheme can be further configured to choose between a large
|
||||
number of different mechanisms.
|
||||
</p>
|
||||
<h3>
|
||||
<a name="ACL_server_unix_perms" id="ACL_server_unix_perms">UNIX socket permissions/group</a>
|
||||
</h3>
|
||||
<p>
|
||||
If libvirt does not contain support for PolicyKit, then access control for
|
||||
the UNIX domain socket is done using traditional file user/group ownership
|
||||
and permissions. There are 2 sockets, one for full read-write access, the
|
||||
other for read-only access. The RW socket will be restricted (mode 0700) to
|
||||
only allow the <code>root</code> user to connect. The read-only socket will
|
||||
be open access (mode 0777) to allow any user to connect.
|
||||
</p>
|
||||
<p>
|
||||
To allow non-root users greater access, the <code>libvirtd.conf</code> file
|
||||
can be edited to change the permissions via the <code>unix_sock_rw_perms</code>,
|
||||
config parameter and to set a user group via the <code>unix_sock_group</code>
|
||||
parameter. For example, setting the former to mode <code>0770</code> and the
|
||||
latter <code>wheel</code> would let any user in the wheel group connect to
|
||||
the libvirt daemon.
|
||||
</p>
|
||||
<h3>
|
||||
<a name="ACL_server_polkit" id="ACL_server_polkit">UNIX socket PolicyKit auth</a>
|
||||
</h3>
|
||||
<p>
|
||||
If libvirt contains support for PolicyKit, then access control options are
|
||||
more advanced. The <code>unix_sock_auth</code> parameter will default to
|
||||
<code>polkit</code>, and the file permissions will default to <code>0777</code>
|
||||
even on the RW socket. Upon connecting to the socket, the client application
|
||||
will be required to identify itself with PolicyKit. The default policy for the
|
||||
RW daemon socket will require any application running in the current desktop
|
||||
session to authenticate using the user's password. This is akin to <code>sudo</code>
|
||||
auth, but does not require that the client application ultimately run as root.
|
||||
Default policy will still allow any application to connect to the RO socket.
|
||||
</p>
|
||||
<p>
|
||||
The default policy can be overridden by the administrator using the PolicyKit
|
||||
master configuration file in <code>/etc/PolicyKit/PolicyKit.conf</code>. The
|
||||
<code>PolicyKit.conf(5)</code> manual page provides details on the syntax
|
||||
available. The two libvirt daemon actions available are named <code>org.libvirt.unix.monitor</code>
|
||||
for the RO socket, and <code>org.libvirt.unix.manage</code> for the RW socket.
|
||||
</p>
|
||||
<p>
|
||||
As an example, to allow a user <code>fred</code>full access to the RW socket,
|
||||
while requiring <code>joe</code> to authenticate with the admin password,
|
||||
would require adding the following snippet to <code>PolicyKit.conf</code>.
|
||||
</p>
|
||||
<pre>
|
||||
<match action="org.libvirt.unix.manage">
|
||||
<match user="fred">
|
||||
<return result="yes"/>
|
||||
</match>
|
||||
</match>
|
||||
<match action="org.libvirt.unix.manage">
|
||||
<match user="joe">
|
||||
<return result="auth_admin"/>
|
||||
</match>
|
||||
</match>
|
||||
</pre>
|
||||
<h3>
|
||||
<a name="ACL_server_username" id="ACL_server_username">Username/password auth</a>
|
||||
</h3>
|
||||
<p>
|
||||
The plain TCP socket of the libvirt daemon defaults to using SASL for authentication.
|
||||
The SASL mechanism configured by default is DIGEST-MD5, which provides a basic
|
||||
username+password style authentication. It also provides for encryption of the data
|
||||
stream, so the security of the plain TCP socket is on a par with that of the TLS
|
||||
socket. If desired the UNIX socket and TLS socket can also have SASL enabled by
|
||||
setting the <code>auth_unix_ro</code>, <code>auth_unix_rw</code>, <code>auth_tls</code>
|
||||
config params in <code>libvirt.conf</code>.
|
||||
</p>
|
||||
<p>
|
||||
Out of the box, no user accounts are defined, so no clients will be able to authenticate
|
||||
on the TCP socket. Adding users and setting their passwords is done with the <code>saslpasswd2</code>
|
||||
command. When running this command it is important to tell it that the appname is <code>libvirt</code>.
|
||||
As an example, to add a user <code>fred</code>, run
|
||||
</p>
|
||||
<pre>
|
||||
# saslpasswd2 -a libvirt fred
|
||||
Password: xxxxxx
|
||||
Again (for verification): xxxxxx
|
||||
</pre>
|
||||
<p>
|
||||
To see a list of all accounts the <code>sasldblistusers2</code> command can be used.
|
||||
This command expects to be given the path to the libvirt user database, which is kept
|
||||
in <code>/etc/libvirt/passwd.db</code>
|
||||
</p>
|
||||
<pre>
|
||||
# sasldblistusers2 -f /etc/libvirt/passwd.db
|
||||
fred@t60wlan.home.berrange.com: userPassword
|
||||
</pre>
|
||||
<p>
|
||||
Finally, to disable a user's access, the <code>saslpasswd2</code> command can be used
|
||||
again:
|
||||
</p>
|
||||
<pre>
|
||||
# saslpasswd2 -a libvirt -d fred
|
||||
</pre>
|
||||
<h3>
|
||||
<a name="ACL_server_kerberos" id="ACL_server_kerberos">Kerberos auth</a>
|
||||
</h3>
|
||||
<p>
|
||||
The plain TCP socket of the libvirt daemon defaults to using SASL for authentication.
|
||||
The SASL mechanism configured by default is DIGEST-MD5, which provides a basic
|
||||
username+password style authentication. To enable Kerberos single-sign-on instead,
|
||||
the libvirt SASL configuration file must be changed. This is <code>/etc/sasl2/libvirt.conf</code>.
|
||||
The <code>mech_list</code> parameter must first be changed to <code>gssapi</code>
|
||||
instead of the default <code>digest-md5</code>. If SASL is enabled on the UNIX
|
||||
and/or TLS sockets, Kerberos will also be used for them. Like DIGEST-MD5, the Kerberos
|
||||
mechanism provides data encryption of the session.
|
||||
</p>
|
||||
<p>
|
||||
Some operating systems do not install the SASL kerberos plugin by default. It
|
||||
may be necessary to install a sub-package such as <code>cyrus-sasl-gssapi</code>.
|
||||
To check whether the Kerberos plugin is installed run the <code>pluginviewer</code>
|
||||
program and verify that <code>gssapi</code> is listed,eg:
|
||||
</p>
|
||||
<pre>
|
||||
# pluginviewer
|
||||
...snip...
|
||||
Plugin "gssapiv2" [loaded], API version: 4
|
||||
SASL mechanism: GSSAPI, best SSF: 56
|
||||
security flags: NO_ANONYMOUS|NO_PLAINTEXT|NO_ACTIVE|PASS_CREDENTIALS|MUTUAL_AUTH
|
||||
features: WANT_CLIENT_FIRST|PROXY_AUTHENTICATION|NEED_SERVER_FQDN
|
||||
</pre>
|
||||
<p>
|
||||
Next is is necessary for the administrator of the Kerberos realm to issue a principle
|
||||
for the libvirt server. There needs to be one principle per host running the libvirt
|
||||
daemon. The principle should be named <code>libvirt/full.hostname@KERBEROS.REALM</code>.
|
||||
This is typically done by running the <code>kadmin.local</code> command on the Kerberos
|
||||
server, though some Kerberos servers have alternate ways of setting up service principles.
|
||||
Once created, the principle should be exported to a keytab, copied to the host running
|
||||
the libvirt daemon and placed in <code>/etc/libvirt/krb5.tab</code>
|
||||
</p>
|
||||
<pre>
|
||||
# kadmin.local
|
||||
kadmin.local: add_principal libvirt/foo.example.com
|
||||
Enter password for principal "libvirt/foo.example.com@EXAMPLE.COM":
|
||||
Re-enter password for principal "libvirt/foo.example.com@EXAMPLE.COM":
|
||||
Principal "libvirt/foo.example.com@EXAMPLE.COM" created.
|
||||
|
||||
kadmin.local: ktadd -k /root/libvirt-foo-example.tab libvirt/foo.example.com@EXAMPLE.COM
|
||||
Entry for principal libvirt/foo.example.com@EXAMPLE.COM with kvno 4, encryption type Triple DES cbc mode with HMAC/sha1 added to keytab WRFILE:/root/libvirt-foo-example.tab.
|
||||
Entry for principal libvirt/foo.example.com@EXAMPLE.COM with kvno 4, encryption type ArcFour with HMAC/md5 added to keytab WRFILE:/root/libvirt-foo-example.tab.
|
||||
Entry for principal libvirt/foo.example.com@EXAMPLE.COM with kvno 4, encryption type DES with HMAC/sha1 added to keytab WRFILE:/root/libvirt-foo-example.tab.
|
||||
Entry for principal libvirt/foo.example.com@EXAMPLE.COM with kvno 4, encryption type DES cbc mode with RSA-MD5 added to keytab WRFILE:/root/libvirt-foo-example.tab.
|
||||
|
||||
kadmin.local: quit
|
||||
|
||||
# scp /root/libvirt-foo-example.tab root@foo.example.com:/etc/libvirt/krb5.tab
|
||||
# rm /root/libvirt-foo-example.tab
|
||||
</pre>
|
||||
<p>
|
||||
Any client application wishing to connect to a Kerberos enabled libvirt server
|
||||
merely needs to run <code>kinit</code> to gain a user principle. This may well
|
||||
be done automatically when a user logs into a desktop session, if PAM is setup
|
||||
to authenticate against Kerberos.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<p id="sponsor">
|
||||
Sponsored by:<br /><a href="http://et.redhat.com/"><img src="et.png" alt="Project sponsored by Red Hat Emerging Technology" /></a></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -151,7 +151,7 @@ Plugin "gssapiv2" [loaded], API version: 4
|
||||
features: WANT_CLIENT_FIRST|PROXY_AUTHENTICATION|NEED_SERVER_FQDN
|
||||
</pre>
|
||||
<p>
|
||||
Next is is necessary for the administrator of the Kerberos realm to issue a principle
|
||||
Next it is necessary for the administrator of the Kerberos realm to issue a principle
|
||||
for the libvirt server. There needs to be one principle per host running the libvirt
|
||||
daemon. The principle should be named <code>libvirt/full.hostname@KERBEROS.REALM</code>.
|
||||
This is typically done by running the <code>kadmin.local</code> command on the Kerberos
|
||||
|
@ -1,130 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!--
|
||||
This file is autogenerated from bindings.html.in
|
||||
Do not edit this file. Changes will be lost.
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
|
||||
<link rel="stylesheet" type="text/css" href="main.css" />
|
||||
<link rel="SHORTCUT ICON" href="32favicon.png" />
|
||||
<title>libvirt: Bindings for other languages</title>
|
||||
<meta name="description" content="libvirt, virtualization, virtualization API" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="headerLogo"></div>
|
||||
<div id="headerSearch">
|
||||
<form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><div>
|
||||
<input id="query" name="query" type="text" size="12" value="" />
|
||||
<input id="submit" name="submit" type="submit" value="Search" />
|
||||
</div></form>
|
||||
</div>
|
||||
</div>
|
||||
<div id="body">
|
||||
<div id="menu">
|
||||
<ul class="l0"><li>
|
||||
<div>
|
||||
<a title="Front page of the libvirt website" class="inactive" href="index.html">Home</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Details of new features and bugs fixed in each release" class="inactive" href="news.html">News</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Get the latest source releases, binary builds and get access to the source repository" class="inactive" href="downloads.html">Downloads</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Information for users, administrators and developers" class="active" href="docs.html">Documentation</a>
|
||||
<ul class="l1"><li>
|
||||
<div>
|
||||
<a title="Information about deploying and using libvirt" class="inactive" href="deployment.html">Deployment</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of the logical subsystems in the libvirt API" class="inactive" href="intro.html">Architecture</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Description of the XML formats used in libvirt" class="inactive" href="format.html">XML format</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Hypervisor specific driver information" class="inactive" href="drivers.html">Drivers</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Reference manual for the C public API" class="inactive" href="html/index.html">API reference</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<span class="active">Language bindings</span>
|
||||
<ul class="l2"><li>
|
||||
<div>
|
||||
<a title="overview of the python API bindings" class="inactive" href="python.html">Python</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="overview of the Java API bindings" class="inactive" href="java.html">Java</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="User contributed content" class="inactive" href="http://wiki.libvirt.org">Wiki</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Frequently asked questions" class="inactive" href="FAQ.html">FAQ</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How and where to report bugs and request features" class="inactive" href="bugs.html">Bug reports</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How to contact the developers via email and IRC" class="inactive" href="contact.html">Contact</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Miscellaneous links of interest related to libvirt" class="inactive" href="relatedlinks.html">Related Links</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of all content on the website" class="inactive" href="sitemap.html">Sitemap</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
<div id="content">
|
||||
<h1>Bindings for other languages</h1>
|
||||
<p>Libvirt comes with bindings to support other languages than
|
||||
pure <strong>C</strong>. First the headers embeds the necessary declarations to
|
||||
allow direct access from <strong>C++</strong> code, but also we have bindings for
|
||||
higher level kind of languages:</p>
|
||||
<ul><li><strong>Python</strong>: Libvirt comes with direct support for the Python language
|
||||
(just make sure you installed the libvirt-python package if not
|
||||
compiling from sources). See below for more information about
|
||||
using libvirt with python</li><li><strong>Perl</strong>: Daniel Berrange provides <a href="http://search.cpan.org/dist/Sys-Virt/">bindings for
|
||||
Perl</a>.</li><li><strong>OCaml</strong>: Richard Jones supplies <a href="http://libvirt.org/ocaml/">bindings for OCaml</a>.</li><li><strong>Ruby</strong>: David Lutterkort provides <a href="http://libvirt.org/ruby/">bindings for Ruby</a>.</li><li><strong>Java</strong>: Daniel Veillard maintains <a href="java.html">Java bindings</a>.</li><li><strong>C#</strong>: Richard Jones wrote about <a href="https://www.redhat.com/archives/libvir-list/2008-September/msg00283.html">calling libvirt from C# on the mailing list</a>.</li></ul>
|
||||
<p>For information on using libvirt on <strong>Windows</strong>
|
||||
<a href="windows.html">please see the Windows
|
||||
support page</a>.
|
||||
</p>
|
||||
<p>Support, requests or help for libvirt bindings are welcome on
|
||||
the <a href="https://www.redhat.com/mailman/listinfo/libvir-list/">mailing
|
||||
list</a>, as usual try to provide enough background information
|
||||
and make sure you use recent version, see the <a href="bugs.html">help
|
||||
page</a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<p id="sponsor">
|
||||
Sponsored by:<br /><a href="http://et.redhat.com/"><img src="et.png" alt="Project sponsored by Red Hat Emerging Technology" /></a></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
120
docs/bugs.html
120
docs/bugs.html
@ -1,120 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!--
|
||||
This file is autogenerated from bugs.html.in
|
||||
Do not edit this file. Changes will be lost.
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
|
||||
<link rel="stylesheet" type="text/css" href="main.css" />
|
||||
<link rel="SHORTCUT ICON" href="32favicon.png" />
|
||||
<title>libvirt: Bug reporting</title>
|
||||
<meta name="description" content="libvirt, virtualization, virtualization API" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="headerLogo"></div>
|
||||
<div id="headerSearch">
|
||||
<form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><div>
|
||||
<input id="query" name="query" type="text" size="12" value="" />
|
||||
<input id="submit" name="submit" type="submit" value="Search" />
|
||||
</div></form>
|
||||
</div>
|
||||
</div>
|
||||
<div id="body">
|
||||
<div id="menu">
|
||||
<ul class="l0"><li>
|
||||
<div>
|
||||
<a title="Front page of the libvirt website" class="inactive" href="index.html">Home</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Details of new features and bugs fixed in each release" class="inactive" href="news.html">News</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Get the latest source releases, binary builds and get access to the source repository" class="inactive" href="downloads.html">Downloads</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Information for users, administrators and developers" class="inactive" href="docs.html">Documentation</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="User contributed content" class="inactive" href="http://wiki.libvirt.org">Wiki</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Frequently asked questions" class="inactive" href="FAQ.html">FAQ</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<span class="active">Bug reports</span>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How to contact the developers via email and IRC" class="inactive" href="contact.html">Contact</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Miscellaneous links of interest related to libvirt" class="inactive" href="relatedlinks.html">Related Links</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of all content on the website" class="inactive" href="sitemap.html">Sitemap</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
<div id="content">
|
||||
<h1>Bug reporting</h1>
|
||||
<p>
|
||||
The <a href="http://bugzilla.redhat.com">Red Hat Bugzilla Server</a>
|
||||
should be used to report bugs and request features against libvirt.
|
||||
Before submitting a ticket, check the existing tickets to see if
|
||||
the bug/feature is already tracked.
|
||||
</p>
|
||||
<h2>General libvirt bug reports</h2>
|
||||
<p>
|
||||
If you are using official libvirt binaries from a Linux distribution
|
||||
check below for distribution specific bug reporting policies first.
|
||||
For general libvirt bug reports, from self-built releases, CVS snapshots
|
||||
and any other non-distribution supported builds, enter tickets under
|
||||
the <code>Virtualization Tools</code> product and the <code>libvirt</code>
|
||||
component.
|
||||
</p>
|
||||
<ul><li><a href="">View libvirt tickets</a></li><li><a href="http://bugzilla.redhat.com/bugzilla/enter_bug.cgi?product=Virtualization%20Tools&component=libvirt">New libvirt ticket</a></li></ul>
|
||||
<h2>Linux Distribution specific bug reports</h2>
|
||||
<ul><li>
|
||||
If you are using official binaries from a <strong>Fedora distribution</strong>, enter
|
||||
tickets against the <code>Fedora</code> product and the <code>libvirt</code>
|
||||
component.
|
||||
<ul><li><a href="">View Fedora libvirt tickets</a></li><li><a href="http://bugzilla.redhat.com/bugzilla/enter_bug.cgi?product=Fedora&component=libvirt">New Fedora libvirt ticket</a></li></ul></li><li>
|
||||
If you are using official binaries from <strong>Red Hat Enterprise Linux distribution</strong>,
|
||||
tickets against the <code>Red Hat Enterprise Linux 5</code> product and
|
||||
the <code>libvirt</code> component.
|
||||
<ul><li><a href="">View Red Hat Enterprise Linux libvirt tickets</a></li><li><a href="http://bugzilla.redhat.com/bugzilla/enter_bug.cgi?product=Red%20Hat%20Enterprise%20Linux%205&component=libvirt">New Red Hat Enterprise Linux libvirt ticket</a></li></ul></li><li>
|
||||
If you are using official binaries from another Linux distribution first
|
||||
follow their own bug reporting guidelines.
|
||||
</li></ul>
|
||||
<h2>How to file high quality bug reports</h2>
|
||||
<p>
|
||||
To increase the likelihood of your bug report being addressed it is
|
||||
important to provide as much information as possible. When filing
|
||||
libvirt bugs use this checklist to see if you are providing enough
|
||||
information:
|
||||
</p>
|
||||
<ul><li>The version number of the libvirt build, or date of the CVS
|
||||
checkout</li><li>The hardware architecture being used</li><li>The name of the hypervisor (Xen, QEMU, KVM)</li><li>The XML config of the guest domain if relevant</li><li>For Xen hypervisor, the XenD logfile from /var/log/xen</li><li>For QEMU/KVM, the domain logfile from /var/log/libvirt/qemu</li></ul>
|
||||
<p>
|
||||
If requesting a new feature attach any available patch to the ticket
|
||||
and also email the patch to the libvirt mailing list for discussion
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<p id="sponsor">
|
||||
Sponsored by:<br /><a href="http://et.redhat.com/"><img src="et.png" alt="Project sponsored by Red Hat Emerging Technology" /></a></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -23,7 +23,7 @@
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="">View libvirt tickets</a></li>
|
||||
<li><a href="http://bugzilla.redhat.com/buglist.cgi?component=libvirt&product=Virtualization%20Tools">View libvirt tickets</a></li>
|
||||
<li><a href="http://bugzilla.redhat.com/bugzilla/enter_bug.cgi?product=Virtualization%20Tools&component=libvirt">New libvirt ticket</a></li>
|
||||
</ul>
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
tickets against the <code>Fedora</code> product and the <code>libvirt</code>
|
||||
component.
|
||||
<ul>
|
||||
<li><a href="">View Fedora libvirt tickets</a></li>
|
||||
<li><a href="http://bugzilla.redhat.com/buglist.cgi?component=libvirt&product=Fedora">View Fedora libvirt tickets</a></li>
|
||||
<li><a href="http://bugzilla.redhat.com/bugzilla/enter_bug.cgi?product=Fedora&component=libvirt">New Fedora libvirt ticket</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
@ -43,7 +43,7 @@
|
||||
tickets against the <code>Red Hat Enterprise Linux 5</code> product and
|
||||
the <code>libvirt</code> component.
|
||||
<ul>
|
||||
<li><a href="">View Red Hat Enterprise Linux libvirt tickets</a></li>
|
||||
<li><a href="http://bugzilla.redhat.com/buglist.cgi?component=libvirt&product=Red%20Hat%20Enterprise%20Linux%205">View Red Hat Enterprise Linux libvirt tickets</a></li>
|
||||
<li><a href="http://bugzilla.redhat.com/bugzilla/enter_bug.cgi?product=Red%20Hat%20Enterprise%20Linux%205&component=libvirt">New Red Hat Enterprise Linux libvirt ticket</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
@ -1,100 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!--
|
||||
This file is autogenerated from contact.html.in
|
||||
Do not edit this file. Changes will be lost.
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
|
||||
<link rel="stylesheet" type="text/css" href="main.css" />
|
||||
<link rel="SHORTCUT ICON" href="32favicon.png" />
|
||||
<title>libvirt: Contacting the development team</title>
|
||||
<meta name="description" content="libvirt, virtualization, virtualization API" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="headerLogo"></div>
|
||||
<div id="headerSearch">
|
||||
<form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><div>
|
||||
<input id="query" name="query" type="text" size="12" value="" />
|
||||
<input id="submit" name="submit" type="submit" value="Search" />
|
||||
</div></form>
|
||||
</div>
|
||||
</div>
|
||||
<div id="body">
|
||||
<div id="menu">
|
||||
<ul class="l0"><li>
|
||||
<div>
|
||||
<a title="Front page of the libvirt website" class="inactive" href="index.html">Home</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Details of new features and bugs fixed in each release" class="inactive" href="news.html">News</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Get the latest source releases, binary builds and get access to the source repository" class="inactive" href="downloads.html">Downloads</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Information for users, administrators and developers" class="inactive" href="docs.html">Documentation</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="User contributed content" class="inactive" href="http://wiki.libvirt.org">Wiki</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Frequently asked questions" class="inactive" href="FAQ.html">FAQ</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How and where to report bugs and request features" class="inactive" href="bugs.html">Bug reports</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<span class="active">Contact</span>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Miscellaneous links of interest related to libvirt" class="inactive" href="relatedlinks.html">Related Links</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of all content on the website" class="inactive" href="sitemap.html">Sitemap</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
<div id="content">
|
||||
<h1>Contacting the development team</h1>
|
||||
<h2>Mailing list</h2>
|
||||
<p>
|
||||
There is a mailing-list <a href="mailto:libvir-list@redhat.com">libvir-list@redhat.com</a> for libvirt,
|
||||
with an <a href="https://www.redhat.com/archives/libvir-list/">on-line archive</a>.
|
||||
Please subscribe to this list before posting by visiting the
|
||||
<a href="https://www.redhat.com/mailman/listinfo/libvir-list">associated Web</a>
|
||||
page and follow the instructions. Patches with explanations and provided as
|
||||
attachments are really appreciated and will be discussed on the mailing list.
|
||||
If possible generate the patches by using <code>cvs diff -up</code> in a CVS
|
||||
checkout.
|
||||
</p>
|
||||
<h2>IRC discussion</h2>
|
||||
<p>
|
||||
Some of the libvirt developers may be found on IRC on the <a href="http://oftc.net">OFTC IRC</a>
|
||||
network. Use the settings:
|
||||
</p>
|
||||
<ul><li>server: irc.oftc.net</li><li>port: 6667 (the usual IRC port)</li><li>channel: #virt</li></ul>
|
||||
<p>
|
||||
NB There is no guarantee that someone will be watching or able to reply
|
||||
promptly, so use the mailing-list if you don't get an answer on the IRC
|
||||
channel.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<p id="sponsor">
|
||||
Sponsored by:<br /><a href="http://et.redhat.com/"><img src="et.png" alt="Project sponsored by Red Hat Emerging Technology" /></a></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -1,156 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!--
|
||||
This file is autogenerated from deployment.html.in
|
||||
Do not edit this file. Changes will be lost.
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
|
||||
<link rel="stylesheet" type="text/css" href="main.css" />
|
||||
<link rel="SHORTCUT ICON" href="32favicon.png" />
|
||||
<title>libvirt: Deployment</title>
|
||||
<meta name="description" content="libvirt, virtualization, virtualization API" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="headerLogo"></div>
|
||||
<div id="headerSearch">
|
||||
<form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><div>
|
||||
<input id="query" name="query" type="text" size="12" value="" />
|
||||
<input id="submit" name="submit" type="submit" value="Search" />
|
||||
</div></form>
|
||||
</div>
|
||||
</div>
|
||||
<div id="body">
|
||||
<div id="menu">
|
||||
<ul class="l0"><li>
|
||||
<div>
|
||||
<a title="Front page of the libvirt website" class="inactive" href="index.html">Home</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Details of new features and bugs fixed in each release" class="inactive" href="news.html">News</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Get the latest source releases, binary builds and get access to the source repository" class="inactive" href="downloads.html">Downloads</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Information for users, administrators and developers" class="active" href="docs.html">Documentation</a>
|
||||
<ul class="l1"><li>
|
||||
<div>
|
||||
<span class="active">Deployment</span>
|
||||
<ul class="l2"><li>
|
||||
<div>
|
||||
<a title="The URI formats used for connecting to libvirt" class="inactive" href="uri.html">URI format</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Enable remote access over TCP" class="inactive" href="remote.html">Remote access</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Configure authentication for the libvirt daemon" class="inactive" href="auth.html">Authentication</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Access the libvirt daemon from a native Windows client" class="inactive" href="windows.html">Windows port</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="The library and the daemon logging support" class="inactive" href="logging.html">Logging</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of the logical subsystems in the libvirt API" class="inactive" href="intro.html">Architecture</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Description of the XML formats used in libvirt" class="inactive" href="format.html">XML format</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Hypervisor specific driver information" class="inactive" href="drivers.html">Drivers</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Reference manual for the C public API" class="inactive" href="html/index.html">API reference</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Bindings of the libvirt API for other languages" class="inactive" href="bindings.html">Language bindings</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="User contributed content" class="inactive" href="http://wiki.libvirt.org">Wiki</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Frequently asked questions" class="inactive" href="FAQ.html">FAQ</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How and where to report bugs and request features" class="inactive" href="bugs.html">Bug reports</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How to contact the developers via email and IRC" class="inactive" href="contact.html">Contact</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Miscellaneous links of interest related to libvirt" class="inactive" href="relatedlinks.html">Related Links</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of all content on the website" class="inactive" href="sitemap.html">Sitemap</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
<div id="content">
|
||||
<h1>Deployment</h1>
|
||||
<h2>Pre-packaged releases</h2>
|
||||
<p>
|
||||
The libvirt API is now available in all major Linux distributions
|
||||
so the simplest deployment approach is to use your distributions'
|
||||
package management software to install the <code>libvirt</code>
|
||||
module.
|
||||
</p>
|
||||
<h2>Self-built releases</h2>
|
||||
<p>
|
||||
libvirt uses GNU autotools for its build system, so deployment
|
||||
follows the usual process of <code>configure; make ; make install</code>
|
||||
</p>
|
||||
<pre>
|
||||
|
||||
# ./configure --prefix=$HOME/usr
|
||||
# make
|
||||
# make install
|
||||
</pre>
|
||||
<h2>Built from CVS / GIT</h2>
|
||||
<p>
|
||||
When building from CVS it is necessary to generate the autotools
|
||||
support files. This requires having <code>autoconf</code>,
|
||||
<code>automake</code>, <code>libtool</code> and <code>intltool</code>
|
||||
installed. The process can be automated with the <code>autogen.sh</code>
|
||||
script.
|
||||
</p>
|
||||
<pre>
|
||||
|
||||
# ./autogen.sh --prefix=$HOME/usr
|
||||
# make
|
||||
# make install
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<p id="sponsor">
|
||||
Sponsored by:<br /><a href="http://et.redhat.com/"><img src="et.png" alt="Project sponsored by Red Hat Emerging Technology" /></a></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -1,3 +0,0 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
libvirt.devhelp
|
1
docs/devhelp/.gitignore
vendored
1
docs/devhelp/.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
libvirt.devhelp
|
||||
*.html
|
||||
|
@ -1,29 +0,0 @@
|
||||
DEVHELP_DIR=$(datadir)/gtk-doc/html/libvirt
|
||||
HTML_FILES=index.html general.html $(HTML_MODULES)
|
||||
HTML_MODULES= \
|
||||
libvirt-libvirt.html \
|
||||
libvirt-virterror.html
|
||||
|
||||
EXTRA_FORMAT= \
|
||||
home.png \
|
||||
left.png \
|
||||
right.png \
|
||||
up.png \
|
||||
style.css
|
||||
|
||||
EXTRA_DIST=devhelp.xsl html.xsl libvirt.devhelp $(HTML_FILES) $(EXTRA_FORMAT)
|
||||
|
||||
all: libvirt.devhelp $(HTML_FILES)
|
||||
|
||||
libvirt.devhelp $(HTML_FILES): $(srcdir)/devhelp.xsl html.xsl $(top_srcdir)/docs/libvirt-api.xml
|
||||
-@(echo Rebuilding devhelp files)
|
||||
-@(if [ -x $(XSLTPROC) ] ; then \
|
||||
$(XSLTPROC) --nonet -o libvirt.devhelp $(srcdir)/devhelp.xsl $(top_srcdir)/docs/libvirt-api.xml ; fi );
|
||||
|
||||
install-data-local: libvirt.devhelp $(HTML_FILES)
|
||||
$(mkinstalldirs) $(DESTDIR)$(DEVHELP_DIR)
|
||||
-@INSTALL@ -m 0644 libvirt.devhelp $(DESTDIR)$(DEVHELP_DIR)
|
||||
-@INSTALL@ -m 0644 $(HTML_FILES) $(DESTDIR)$(DEVHELP_DIR)
|
||||
-for file in $(EXTRA_FORMAT); do \
|
||||
@INSTALL@ -m 0644 $(srcdir)/$${file} $(DESTDIR)$(DEVHELP_DIR) ; \
|
||||
done
|
@ -123,5 +123,3 @@
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
||||
|
||||
|
@ -1,38 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<title>libvirt: </title>
|
||||
<meta name="generator" content="Libvirt devhelp stylesheet"/>
|
||||
<link rel="start" href="index.html" title="libvirt Reference Manual"/>
|
||||
<link rel="up" href="index.html" title="libvirt Reference Manual"/>
|
||||
<link rel="stylesheet" href="style.css" type="text/css"/>
|
||||
<link rel="chapter" href="index.html" title="libvirt Reference Manual"/>
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
|
||||
<tr valign="middle">
|
||||
<td>
|
||||
<a accesskey="u" href="index.html">
|
||||
<img src="up.png" width="24" height="24" border="0" alt="Up"/>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a accesskey="h" href="index.html">
|
||||
<img src="home.png" width="24" height="24" border="0" alt="Home"/>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a accesskey="n" href="libvirt-libvirt.html">
|
||||
<img src="right.png" width="24" height="24" border="0" alt="Next"/>
|
||||
</a>
|
||||
</td>
|
||||
<th width="100%" align="center">libvirt Reference Manual</th>
|
||||
</tr>
|
||||
</table>
|
||||
<h2>
|
||||
<span class="refentrytitle">libvirt API Modules</span>
|
||||
</h2>
|
||||
<p><a href="libvirt-libvirt.html">libvirt</a> - core interfaces for the libvirt library<br/><a href="libvirt-virterror.html">virterror</a> - error handling interfaces for the libvirt library<br/></p>
|
||||
</body>
|
||||
</html>
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user