mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-08-18 13:50:02 +03:00
Compare commits
649 Commits
Author | SHA1 | Date | |
---|---|---|---|
040e80f7e6 | |||
b8d4b6bec9 | |||
4811fab790 | |||
eb81396863 | |||
c7e1cfc9f4 | |||
7d43c80bc4 | |||
776b675861 | |||
2060a0a43e | |||
b827338a72 | |||
264f3ddac9 | |||
2cdb665b10 | |||
f2f656d426 | |||
0fe553744a | |||
278e947890 | |||
bbf20165cc | |||
046039124d | |||
afec7cf1ff | |||
448b92c05e | |||
ecb0221a5f | |||
91f9157e5b | |||
d42cfb4ef0 | |||
03a155a25b | |||
645f4acafe | |||
4b3e19526c | |||
57dbe08e74 | |||
dad6ecc6bf | |||
8d567fbcd3 | |||
8c4d80d72e | |||
c15a64b9b4 | |||
5313dc372b | |||
7bed630dfb | |||
4be6e024c7 | |||
da82b03fb0 | |||
ddfd21f815 | |||
3cbc05012d | |||
d0d4b8ad76 | |||
dae7054b76 | |||
a8a560dd3a | |||
c7a8e1bf74 | |||
007f016b2d | |||
d11d93f406 | |||
fd2090cdb9 | |||
f24e67d24f | |||
e6cbadd588 | |||
ce62916b6e | |||
308b85330a | |||
7023663873 | |||
e99fb5ed9d | |||
db19834a0a | |||
3ad6dcf3dc | |||
fe2af45bb2 | |||
ce4c0bf5a2 | |||
632be33689 | |||
2e23607448 | |||
e51cf5c192 | |||
7c34bb2681 | |||
2659b3f5aa | |||
730fd3b022 | |||
3c3dffc285 | |||
45e0483dac | |||
bc0010b3d1 | |||
fedad93d9e | |||
6008cfc7c0 | |||
4916936751 | |||
75825e453a | |||
a32c43d6fe | |||
cabc2cc98f | |||
c04498b305 | |||
117aa0d874 | |||
52147a0452 | |||
9b6efcfef1 | |||
f9c56cce79 | |||
1dc10a7b28 | |||
6c70802374 | |||
a340f9131a | |||
77cfcccfa8 | |||
41d8968d43 | |||
4604c18f0b | |||
1cfd5a00eb | |||
ff26194143 | |||
e40438fa7f | |||
15a9144609 | |||
dd9e9c3b54 | |||
790f0b3057 | |||
457a10d91d | |||
624f0c68bc | |||
df4c57ae27 | |||
0f04b58730 | |||
5469686bfd | |||
ec3fa12e94 | |||
6f5e63324f | |||
64a4c60e9e | |||
cdf7a40d9c | |||
7ecb50c2a6 | |||
4c9afe08e4 | |||
8d6a1b2c88 | |||
3cc8a66052 | |||
11dc7786f4 | |||
f0006d9792 | |||
8a659e3186 | |||
784b5030c1 | |||
cd04abcc8e | |||
c26cb9234f | |||
e02f691a90 | |||
c6d5ac174e | |||
bb4ec5550b | |||
8f67f6448b | |||
649bcd72fe | |||
4fbad2e049 | |||
b712bfb46c | |||
7d10811312 | |||
91b009cde4 | |||
3811eaaa63 | |||
3023ec5ee7 | |||
bea92f968e | |||
af249ea468 | |||
7400396801 | |||
89d549c3eb | |||
8db32571ba | |||
a9cb354833 | |||
24e3b35c6c | |||
15941b2bc7 | |||
45bd290b64 | |||
0aa72ac6fd | |||
1fc3816d0f | |||
104fdbf038 | |||
07a107f0da | |||
08dce95a74 | |||
667ce28946 | |||
4e40aee273 | |||
7624b47d1e | |||
2f5115627b | |||
030db0c2ec | |||
4c44cdcce3 | |||
517761fd96 | |||
af1e2ede26 | |||
468439854b | |||
23eaae9aff | |||
3d4c1d94d7 | |||
753c6c9c75 | |||
ef591ef7b9 | |||
075bb5f1aa | |||
9ae8fa5839 | |||
4728bad403 | |||
112ed8f50d | |||
991be60403 | |||
9231aa7d95 | |||
979218cdd9 | |||
680c92ae7e | |||
b79aaf91b8 | |||
447ef8863c | |||
7c7681dd90 | |||
b7abcf9d71 | |||
fc8d199188 | |||
958c366b21 | |||
4296cea2b2 | |||
a71f79c37e | |||
8001eef5d0 | |||
4ab7995871 | |||
5f67253813 | |||
0264e1678c | |||
46992453b9 | |||
3505790b85 | |||
530d4463ba | |||
c3cc4f8bad | |||
9899e08b8d | |||
37bc888b28 | |||
24c8fc5dff | |||
d5fcd4f7a3 | |||
47fec8eac2 | |||
a3adcce795 | |||
1acef95a81 | |||
66c6cc7c5e | |||
33b35313a3 | |||
64f920d056 | |||
48a7637d9f | |||
e5edc3f03a | |||
d61fff3f4b | |||
9bcb174473 | |||
fcbbb289b6 | |||
0d77396605 | |||
936565c701 | |||
16c1c0833b | |||
0b74bc622c | |||
74c81b5d93 | |||
dfdfc601ac | |||
d27098c054 | |||
4c893ef9be | |||
03b5dc14de | |||
b2af10cd49 | |||
982682b8fd | |||
5bd53990c5 | |||
6940109b9a | |||
43a9249c95 | |||
2ff5cffe6e | |||
4ed2c3773e | |||
2f4682a9f8 | |||
08bed02515 | |||
b03fe2d0ae | |||
09c64d0072 | |||
949dd07b19 | |||
309acaa023 | |||
e8fc4cbb64 | |||
89f0c6d089 | |||
9e2fe24518 | |||
d686056f62 | |||
9710856b33 | |||
f5ee422c58 | |||
cf577653dc | |||
de2b252df5 | |||
41fa653f32 | |||
4f4a1deccb | |||
caf8e91588 | |||
6d8331fd58 | |||
4027461865 | |||
e1ea1b2af7 | |||
39a7be470c | |||
16a3a4a30a | |||
2210f8a3a8 | |||
04e0686262 | |||
e391595890 | |||
c396fb36fa | |||
2d8d9b100b | |||
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 |
1
.gitignore
vendored
1
.gitignore
vendored
@ -44,3 +44,4 @@ gnulib/
|
||||
*#*#
|
||||
*.#*#
|
||||
ChangeLog
|
||||
NEWS
|
||||
|
2
.gnulib
2
.gnulib
Submodule .gnulib updated: b653eda3ac...28db629d4f
@ -1,5 +1,7 @@
|
||||
^src/util\.c$
|
||||
^src/xend_internal\.c$
|
||||
^src/util-lib\.c$
|
||||
^qemud/qemud.c$
|
||||
^src/libvirt\.c$
|
||||
^src/qemu/qemu_driver\.c$
|
||||
^src/qemu/qemu_monitor\.c$
|
||||
^src/util/util\.c$
|
||||
^src/xen/xend_internal\.c$
|
||||
^daemon/libvirtd.c$
|
||||
^gnulib/
|
||||
|
@ -1,8 +1,5 @@
|
||||
ChangeLog
|
||||
docs/devhelp/libvirt-virterror.html
|
||||
docs/html/libvirt-virterror.html
|
||||
docs/libvirt-api.xml
|
||||
docs/libvirt-refs.xml
|
||||
include/libvirt/virterror.h
|
||||
qemud/dispatch.c
|
||||
src/virterror.c
|
||||
^ChangeLog$
|
||||
^ChangeLog-old$
|
||||
^include/libvirt/virterror\.h$
|
||||
^daemon/dispatch\.c$
|
||||
^src/util/virterror\.c$
|
||||
|
@ -1,3 +1,2 @@
|
||||
gnulib/lib/getaddrinfo.c
|
||||
gnulib/m4/
|
||||
src/xend_internal.c
|
||||
^gnulib/lib/getaddrinfo\.c$
|
||||
^gnulib/m4/
|
||||
|
2
.x-sc_prohibit_gethostname
Normal file
2
.x-sc_prohibit_gethostname
Normal file
@ -0,0 +1,2 @@
|
||||
^src/util/util\.c$
|
||||
^ChangeLog-old$
|
@ -1,10 +1,10 @@
|
||||
^gnulib/
|
||||
^po/
|
||||
ChangeLog
|
||||
^ChangeLog$
|
||||
^ChangeLog-old$
|
||||
^Makefile*
|
||||
^docs/
|
||||
^tests/
|
||||
^src/virsh\.c
|
||||
^src/console\.c
|
||||
^src/virterror\.c
|
||||
^tools/virsh\.c$
|
||||
^tools/console\.c$
|
||||
^build-aux/
|
||||
|
@ -1 +1,8 @@
|
||||
^gnulib/
|
||||
^ChangeLog-old$
|
||||
^examples/domain-events/events-c/event-test\.c$
|
||||
^src/internal\.h$
|
||||
^src/lxc/lxc_container\.c$
|
||||
^src/node_device/node_device_devkit\.c$
|
||||
^src/node_device/node_device_hal\.c$
|
||||
^src/storage/parthelper\.c$
|
||||
|
1
.x-sc_prohibit_strncpy
Normal file
1
.x-sc_prohibit_strncpy
Normal file
@ -0,0 +1 @@
|
||||
^src/util/util\.c$
|
@ -1,6 +1,4 @@
|
||||
^docs/examples/info1\.c$
|
||||
^docs/examples/suspend\.c$
|
||||
^examples/
|
||||
^gnulib/lib/dummy\.c$
|
||||
^gnulib/tests/dummy\.c$
|
||||
^qemud/remote_protocol\.c$
|
||||
^ChangeLog$
|
||||
|
@ -1,2 +1 @@
|
||||
^docs/examples/info1\.c$
|
||||
^docs/examples/suspend\.c$
|
||||
^examples/
|
||||
|
5
AUTHORS
5
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>
|
||||
@ -78,7 +79,7 @@ Patches have also been contributed by:
|
||||
Henrik Persson E <henrik.e.persson@ericsson.com>
|
||||
Satoru SATOH <satoru.satoh@gmail.com>
|
||||
Paolo Bonzini <pbonzini@redhat.com>
|
||||
Matthias Bolte <matthias.bolte@googlemail.com>
|
||||
Miloslav Trmač <mitr@redhat.com>
|
||||
|
||||
[....send patches to get your name here....]
|
||||
|
||||
|
42
HACKING
42
HACKING
@ -37,6 +37,17 @@ and run the tests:
|
||||
|
||||
The latter test checks for memory leaks.
|
||||
|
||||
If you encounter any failing tests, the VIR_TEST_DEBUG environment variable
|
||||
may provide extra information to debug the failures. Larger values of
|
||||
VIR_TEST_DEBUG may provide larger amounts of information:
|
||||
|
||||
VIR_TEST_DEBUG=1 make check (or)
|
||||
VIR_TEST_DEBUG=2 make check
|
||||
|
||||
Also, individual tests can be run from inside the 'tests/' directory, like:
|
||||
|
||||
./qemuxml2xmltest
|
||||
|
||||
(6) Update tests and/or documentation, particularly if you are adding
|
||||
a new feature or changing the output of a program.
|
||||
|
||||
@ -231,6 +242,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
|
||||
=============================
|
||||
|
||||
|
41
Makefile.am
41
Makefile.am
@ -3,31 +3,54 @@
|
||||
LCOV = lcov
|
||||
GENHTML = genhtml
|
||||
|
||||
SUBDIRS = gnulib/lib include src qemud tools 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_ctype_macros \
|
||||
.x-sc_avoid_if_before_free \
|
||||
.x-sc_require_config_h_first \
|
||||
.x-sc_avoid_write \
|
||||
.x-sc_m4_quote_check \
|
||||
.x-sc_prohibit_asprintf \
|
||||
.x-sc_prohibit_gethostby \
|
||||
.x-sc_prohibit_gethostname \
|
||||
.x-sc_prohibit_have_config_h \
|
||||
.x-sc_prohibit_HAVE_MBRTOWC \
|
||||
.x-sc_prohibit_nonreentrant \
|
||||
.x-sc_prohibit_strcmp \
|
||||
.x-sc_prohibit_strcmp_and_strncmp \
|
||||
.x-sc_prohibit_strncpy \
|
||||
.x-sc_prohibit_VIR_ERR_NO_MEMORY \
|
||||
.x-sc_require_config_h \
|
||||
.x-sc_prohibit_nonreentrant \
|
||||
.x-sc_require_config_h_first \
|
||||
.x-sc_trailing_blank \
|
||||
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)
|
||||
|
||||
@ -40,7 +63,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
|
||||
|
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/*
|
@ -65,6 +65,7 @@ gnulib_tool=$GNULIB_SRCDIR/gnulib-tool
|
||||
<$gnulib_tool || exit
|
||||
|
||||
modules='
|
||||
base64
|
||||
c-ctype
|
||||
close
|
||||
connect
|
||||
@ -89,6 +90,7 @@ send
|
||||
setsockopt
|
||||
socket
|
||||
stpcpy
|
||||
strchrnul
|
||||
strndup
|
||||
strerror
|
||||
strsep
|
||||
|
20
cfg.mk
20
cfg.mk
@ -79,11 +79,9 @@ sc_avoid_write:
|
||||
# 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; } || :
|
||||
@re='strn?cmp *\(' \
|
||||
msg='use STREQ() in place of the above uses of str[n]cmp' \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
# Use virAsprintf rather than a'sprintf since *strp is undefined on error.
|
||||
sc_prohibit_asprintf:
|
||||
@ -91,12 +89,22 @@ sc_prohibit_asprintf:
|
||||
msg='use virAsprintf, not a'sprintf \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
sc_prohibit_strncpy:
|
||||
@re='strncpy *\(' \
|
||||
msg='use virStrncpy, not strncpy' \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
sc_prohibit_gethostname:
|
||||
@re='gethostname *\(' \
|
||||
msg='use virGetHostname, not gethostname' \
|
||||
$(_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 Makefile.nonreentrant
|
||||
include $(srcdir)/Makefile.nonreentrant
|
||||
sc_prohibit_nonreentrant:
|
||||
@fail=0 ; \
|
||||
for i in $(NON_REENTRANT) ; \
|
||||
|
432
configure.in
432
configure.in
@ -1,6 +1,6 @@
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_INIT([libvirt], [0.7.0])
|
||||
AC_INIT([libvirt], [0.7.4])
|
||||
AC_CONFIG_SRCDIR([src/libvirt.c])
|
||||
AC_CONFIG_AUX_DIR([build-aux])
|
||||
AM_CONFIG_HEADER([config.h])
|
||||
@ -33,7 +33,13 @@ GNUTLS_REQUIRED="1.0.25"
|
||||
AVAHI_REQUIRED="0.6.0"
|
||||
POLKIT_REQUIRED="0.6"
|
||||
PARTED_REQUIRED="1.8.0"
|
||||
NETCF_REQUIRED="0.0.1"
|
||||
NETCF_REQUIRED="0.1.4"
|
||||
UDEV_REQUIRED=145
|
||||
PCIACCESS_REQUIRED=0.10.0
|
||||
XMLRPC_REQUIRED=1.14.0
|
||||
HAL_REQUIRED=0.5.0
|
||||
DEVMAPPER_REQUIRED=1.0.0
|
||||
LIBCURL_REQUIRED="7.18.0"
|
||||
|
||||
dnl Checks for C compiler.
|
||||
AC_PROG_CC
|
||||
@ -83,7 +89,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.
|
||||
@ -187,8 +193,8 @@ AC_ARG_WITH([uml],
|
||||
[ --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([libssh],
|
||||
[ --with-libssh=[PFX] libssh location],[],[with_libssh=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],
|
||||
@ -243,17 +249,17 @@ dnl init script flavor
|
||||
dnl
|
||||
AC_MSG_CHECKING([for init script flavor])
|
||||
AC_ARG_WITH([init-script],
|
||||
[AC_HELP_STRING([--with-init-scripts=[redhat|auto|none]],
|
||||
[Style of init scripts to install (defaults to auto)])])
|
||||
if test "x$with_init_scripts" = "x" -o "x$with_init_scripts" = "xauto"; then
|
||||
[AC_HELP_STRING([--with-init-script=[redhat|auto|none]],
|
||||
[Style of init script to install (defaults to auto)])])
|
||||
if test "x$with_init_script" = "x" -o "x$with_init_script" = "xauto"; then
|
||||
if test -f /etc/redhat-release ; then
|
||||
with_init_scripts=redhat
|
||||
with_init_script=redhat
|
||||
else
|
||||
with_init_scripts=none
|
||||
with_init_script=none
|
||||
fi
|
||||
fi
|
||||
AM_CONDITIONAL([LIBVIRT_INIT_SCRIPTS_RED_HAT], test x$with_init_scripts = xredhat)
|
||||
AC_MSG_RESULT($with_init_scripts)
|
||||
AM_CONDITIONAL([LIBVIRT_INIT_SCRIPT_RED_HAT], test x$with_init_script = xredhat)
|
||||
AC_MSG_RESULT($with_init_script)
|
||||
|
||||
dnl RHEL-5 has a peculiar version of Xen, which requires some special casing
|
||||
AC_ARG_WITH([rhel5-api],
|
||||
@ -287,6 +293,9 @@ fi
|
||||
AC_PATH_PROG([IPTABLES_PATH], [iptables], /sbin/iptables, [/usr/sbin:$PATH])
|
||||
AC_DEFINE_UNQUOTED([IPTABLES_PATH], "$IPTABLES_PATH", [path to iptables binary])
|
||||
|
||||
AC_PATH_PROG([EBTABLES_PATH], [ebtables], /sbin/ebtables, [/usr/sbin:$PATH])
|
||||
AC_DEFINE_UNQUOTED([EBTABLES_PATH], "$EBTABLES_PATH", [path to ebtables binary])
|
||||
|
||||
if test "$with_openvz" = "yes"; then
|
||||
AC_DEFINE_UNQUOTED([WITH_OPENVZ], 1, [whether OpenVZ driver is enabled])
|
||||
fi
|
||||
@ -463,11 +472,12 @@ if test "$with_qemu" = "yes" -o "$with_lxc" = "yes" ; then
|
||||
fi
|
||||
|
||||
|
||||
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
|
||||
@ -491,9 +501,6 @@ AC_SUBST([XMLRPC_CFLAGS])
|
||||
AC_SUBST([XMLRPC_LIBS])
|
||||
|
||||
|
||||
dnl Need to test if pkg-config exists
|
||||
PKG_PROG_PKG_CONFIG
|
||||
|
||||
dnl ==========================================================================
|
||||
dnl find libxml2 library, borrowed from xmlsec
|
||||
dnl ==========================================================================
|
||||
@ -641,40 +648,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])
|
||||
|
||||
@ -778,6 +806,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],
|
||||
@ -845,46 +950,70 @@ dnl
|
||||
dnl libssh checks
|
||||
dnl
|
||||
|
||||
if test "$with_libssh" != "yes" -a "$with_libssh" != "no"; then
|
||||
libssh_path="$with_libssh"
|
||||
elif test "$with_libssh" = "yes"; then
|
||||
libssh_path="/usr/local/lib/"
|
||||
elif test "$with_libssh" = "no"; then
|
||||
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([ssh],[ssh_new],[
|
||||
LIBSSH_LIBS="$LIBSSH_LIBS -lssh -L$libssh_path"
|
||||
AC_SUBST([LIBSSH_LIBS])],[
|
||||
AC_CHECK_LIB([ssh2],[libssh2_session_startup],[
|
||||
LIBSSH2_LIBS="$LIBSSH2_LIBS -lssh2 -L$libssh2_path"
|
||||
AC_SUBST([LIBSSH2_LIBS])
|
||||
],[
|
||||
with_phyp="no"
|
||||
with_libssh="no";
|
||||
],[])
|
||||
with_libssh2="no";
|
||||
],[])
|
||||
|
||||
if test "$with_phyp" != "no"; then
|
||||
AC_CHECK_HEADERS([libssh/libssh.h],[
|
||||
with_phyp="yes"
|
||||
LIBSSH_CFLAGS="-I/usr/local/include/libssh"
|
||||
AC_SUBST([LIBSSH_CFLAGS])
|
||||
AC_DEFINE_UNQUOTED([WITH_PHYP], 1,
|
||||
[whether IBM HMC / IVM driver is enabled])
|
||||
],[
|
||||
with_phyp="no"
|
||||
with_libssh="no";
|
||||
],[])
|
||||
fi
|
||||
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 -L$libssh2_path -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([ssh],[ssh_new],[
|
||||
LIBSSH_LIBS="$LIBSSH_LIBS -lssh -L$libssh_path"
|
||||
AC_SUBST([LIBSSH_LIBS])],[
|
||||
AC_MSG_ERROR([You must install the libssh to compile Phype driver.])
|
||||
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([libssh/libssh.h],[
|
||||
LIBSSH_CFLAGS="-I/usr/local/include/libssh"
|
||||
AC_SUBST([LIBSSH_CFLAGS])],[
|
||||
AC_MSG_ERROR([Cannot find libssh headers.Is libssh installed ?])
|
||||
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
|
||||
@ -1017,6 +1146,17 @@ 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])
|
||||
AC_ARG_WITH([storage-lvm],
|
||||
@ -1025,6 +1165,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])
|
||||
|
||||
@ -1035,6 +1177,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
|
||||
@ -1156,6 +1299,36 @@ 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_CFLAGS=
|
||||
DEVMAPPER_LIBS=
|
||||
PKG_CHECK_MODULES([DEVMAPPER], [devmapper >= $DEVMAPPER_REQUIRED], [], [DEVMAPPER_FOUND=no])
|
||||
if test "$DEVMAPPER_FOUND" = "no"; then
|
||||
# devmapper is missing pkg-config files in ubuntu, suse, etc
|
||||
save_LIBS="$LIBS"
|
||||
save_CFLAGS="$CFLAGS"
|
||||
DEVMAPPER_FOUND=yes
|
||||
AC_CHECK_HEADER([libdevmapper.h],,[DEVMAPPER_FOUND=no])
|
||||
AC_CHECK_LIB([devmapper], [dm_task_run],,[DEVMAPPER_FOUND=no])
|
||||
DEVMAPPER_LIBS="-ldevmapper"
|
||||
LIBS="$save_LIBS"
|
||||
CFLAGS="$save_CFLAGS"
|
||||
fi
|
||||
if test "$DEVMAPPER_FOUND" = "no" ; then
|
||||
AC_MSG_ERROR([You must install device-mapper-devel/libdevmapper >= $DEVMAPPER_REQUIRED to compile libvirt])
|
||||
fi
|
||||
|
||||
fi
|
||||
AC_SUBST([DEVMAPPER_CFLAGS])
|
||||
AC_SUBST([DEVMAPPER_LIBS])
|
||||
|
||||
LIBPARTED_CFLAGS=
|
||||
LIBPARTED_LIBS=
|
||||
@ -1209,7 +1382,6 @@ dnl
|
||||
|
||||
LIBCURL_CFLAGS=""
|
||||
LIBCURL_LIBS=""
|
||||
LIBCURL_REQUIRED="7.18.0"
|
||||
LIBCURL_FOUND="no"
|
||||
|
||||
if test "$with_esx" = "yes" -o "$with_esx" = "check"; then
|
||||
@ -1237,6 +1409,9 @@ 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=
|
||||
@ -1294,7 +1469,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
|
||||
@ -1481,8 +1656,7 @@ test "$enable_shared" = no && lt_cv_objdir=.
|
||||
LV_LIBTOOL_OBJDIR=${lt_cv_objdir-.}
|
||||
AC_SUBST([LV_LIBTOOL_OBJDIR])
|
||||
|
||||
dnl HAL or DeviceKit library for host device enumeration
|
||||
HAL_REQUIRED=0.0
|
||||
dnl HAL library check for host device enumeration
|
||||
HAL_CFLAGS=
|
||||
HAL_LIBS=
|
||||
AC_ARG_WITH([hal],
|
||||
@ -1521,62 +1695,55 @@ AM_CONDITIONAL([HAVE_HAL], [test "x$with_hal" = "xyes"])
|
||||
AC_SUBST([HAL_CFLAGS])
|
||||
AC_SUBST([HAL_LIBS])
|
||||
|
||||
DEVKIT_REQUIRED=0.0
|
||||
DEVKIT_CFLAGS=
|
||||
DEVKIT_LIBS=
|
||||
AC_ARG_WITH([devkit],
|
||||
[ --with-devkit use DeviceKit for host device enumeration],
|
||||
|
||||
dnl udev/libpciaccess library check for alternate host device enumeration
|
||||
UDEV_CFLAGS=
|
||||
UDEV_LIBS=
|
||||
PCIACCESS_CFLAGS=
|
||||
PCIACCESS_LIBS=
|
||||
AC_ARG_WITH([udev],
|
||||
[ --with-udev use libudev for host device enumeration],
|
||||
[],
|
||||
[with_devkit=no])
|
||||
[with_udev=check])
|
||||
|
||||
if test "$with_libvirtd" = "no" ; then
|
||||
with_devkit=no
|
||||
with_udev=no
|
||||
fi
|
||||
|
||||
dnl Extra check needed while devkit pkg-config info missing glib2 dependency
|
||||
PKG_CHECK_MODULES(GLIB2, glib-2.0 >= 0.0,,[
|
||||
if test "x$with_devkit" = "xcheck"; then
|
||||
with_devkit=no
|
||||
elif test "x$with_devkit" = "xyes"; then
|
||||
AC_MSG_ERROR([required package DeviceKit requires package glib-2.0])
|
||||
fi])
|
||||
|
||||
if test "x$with_devkit" = "xyes" -o "x$with_devkit" = "xcheck"; then
|
||||
PKG_CHECK_MODULES(DEVKIT, devkit-gobject >= $DEVKIT_REQUIRED,
|
||||
[with_devkit=yes], [
|
||||
if test "x$with_devkit" = "xcheck" ; then
|
||||
with_devkit=no
|
||||
if test "x$with_udev" = "xyes" -o "x$with_udev" = "xcheck"; then
|
||||
PKG_CHECK_MODULES(UDEV, libudev >= $UDEV_REQUIRED,
|
||||
[], [
|
||||
if test "x$with_udev" = "xcheck" ; then
|
||||
with_udev=no
|
||||
else
|
||||
AC_MSG_ERROR(
|
||||
[You must install DeviceKit-devel >= $DEVKIT_REQUIRED to compile libvirt])
|
||||
[You must install libudev-devel >= $UDEV_REQUIRED to compile libvirt])
|
||||
fi
|
||||
])
|
||||
if test "x$with_devkit" = "xyes" ; then
|
||||
AC_DEFINE_UNQUOTED([HAVE_DEVKIT], 1,
|
||||
[use DeviceKit for host device enumeration])
|
||||
|
||||
dnl Add glib2 flags explicitly while devkit pkg-config info missing glib2 dependency
|
||||
DEVKIT_CFLAGS="$GLIB2_CFLAGS $DEVKIT_CFLAGS"
|
||||
DEVKIT_LIBS="$GLIB2_LIBS $DEVKIT_LIBS"
|
||||
|
||||
dnl Add more flags apparently required for devkit to work properly
|
||||
DEVKIT_CFLAGS="$DEVKIT_CFLAGS -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT"
|
||||
|
||||
old_CFLAGS=$CFLAGS
|
||||
old_LDFLAGS=$LDFLAGS
|
||||
CFLAGS="$CFLAGS $DEVKIT_CFLAGS"
|
||||
LDFLAGS="$LDFLAGS $DEVKIT_LIBS"
|
||||
AC_CHECK_FUNCS([devkit_client_connect],,[with_devkit=no])
|
||||
CFLAGS="$old_CFLAGS"
|
||||
LDFLAGS="$old_LDFLAGS"
|
||||
if test "x$with_udev" != "xno"; then
|
||||
PKG_CHECK_MODULES(PCIACCESS, pciaccess >= $PCIACCESS_REQUIRED,
|
||||
[with_udev=yes],
|
||||
[
|
||||
if test "x$with_udev" = "xcheck" ; then
|
||||
with_udev=no
|
||||
else
|
||||
AC_MSG_ERROR(
|
||||
[You must install libpciaccess-devel >= $PCIACCESS_REQUIRED to compile libvirt])
|
||||
fi
|
||||
])
|
||||
fi
|
||||
if test "x$with_udev" = "xyes" ; then
|
||||
AC_DEFINE_UNQUOTED([HAVE_UDEV], 1,
|
||||
[use UDEV for host device enumeration])
|
||||
fi
|
||||
fi
|
||||
AM_CONDITIONAL([HAVE_DEVKIT], [test "x$with_devkit" = "xyes"])
|
||||
AC_SUBST([DEVKIT_CFLAGS])
|
||||
AC_SUBST([DEVKIT_LIBS])
|
||||
AM_CONDITIONAL([HAVE_UDEV], [test "x$with_udev" = "xyes"])
|
||||
AC_SUBST([UDEV_CFLAGS])
|
||||
AC_SUBST([UDEV_LIBS])
|
||||
AC_SUBST([PCIACCESS_CFLAGS])
|
||||
AC_SUBST([PCIACCESS_LIBS])
|
||||
|
||||
with_nodedev=no;
|
||||
if test "$with_devkit" = "yes" -o "$with_hal" = "yes";
|
||||
if test "$with_hal" = "yes" -o "$with_udev" = "yes";
|
||||
then
|
||||
with_nodedev=yes
|
||||
AC_DEFINE_UNQUOTED([WITH_NODE_DEVICES], 1, [with node device driver])
|
||||
@ -1606,8 +1773,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 \
|
||||
@ -1615,7 +1780,7 @@ 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 \
|
||||
@ -1624,6 +1789,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([])
|
||||
@ -1656,11 +1824,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([])
|
||||
@ -1678,10 +1848,10 @@ AC_MSG_NOTICE([ libcurl: $LIBCURL_CFLAGS $LIBCURL_LIBS])
|
||||
else
|
||||
AC_MSG_NOTICE([ libcurl: no])
|
||||
fi
|
||||
if test "$with_libssh" != "no" ; then
|
||||
AC_MSG_NOTICE([ libssh: $LIBSSH_CFLAGS $LIBSSH_LIBS])
|
||||
if test "$with_libssh2" != "no" ; then
|
||||
AC_MSG_NOTICE([ libssh2: $LIBSSH2_CFLAGS $LIBSSH2_LIBS])
|
||||
else
|
||||
AC_MSG_NOTICE([ libssh: no])
|
||||
AC_MSG_NOTICE([ libssh2: no])
|
||||
fi
|
||||
AC_MSG_NOTICE([ gnutls: $GNUTLS_CFLAGS $GNUTLS_LIBS])
|
||||
if test "$with_sasl" != "no" ; then
|
||||
@ -1695,7 +1865,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
|
||||
@ -1704,6 +1878,11 @@ 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
|
||||
@ -1724,10 +1903,10 @@ AC_MSG_NOTICE([ hal: $HAL_CFLAGS $HAL_LIBS])
|
||||
else
|
||||
AC_MSG_NOTICE([ hal: no])
|
||||
fi
|
||||
if test "$with_devkit" = "yes" ; then
|
||||
AC_MSG_NOTICE([ devkit: $DEVKIT_CFLAGS $DEVKIT_LIBS])
|
||||
if test "$with_udev" = "yes" ; then
|
||||
AC_MSG_NOTICE([ udev: $UDEV_CFLAGS $UDEV_LIBS $PCIACCESS_CFLAGS $PCIACCESS_LIBS])
|
||||
else
|
||||
AC_MSG_NOTICE([ devkit: no])
|
||||
AC_MSG_NOTICE([ udev: no])
|
||||
fi
|
||||
if test "$with_netcf" = "yes" ; then
|
||||
AC_MSG_NOTICE([ netcf: $NETCF_CFLAGS $NETCF_LIBS])
|
||||
@ -1750,6 +1929,7 @@ 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([])
|
||||
|
0
qemud/.gitignore → daemon/.gitignore
vendored
0
qemud/.gitignore → daemon/.gitignore
vendored
@ -2,84 +2,48 @@
|
||||
|
||||
DAEMON_SOURCES = \
|
||||
event.c event.h \
|
||||
qemud.c qemud.h \
|
||||
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)
|
||||
|
||||
BUILT_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
|
||||
|
||||
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)
|
||||
|
||||
@ -88,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)\"" \
|
||||
@ -107,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
|
||||
@ -147,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
|
||||
@ -157,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
|
||||
@ -211,17 +159,19 @@ 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
|
||||
|
||||
@ -233,10 +183,12 @@ 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
|
||||
|
||||
if LIBVIRT_INIT_SCRIPTS_RED_HAT
|
||||
if LIBVIRT_INIT_SCRIPT_RED_HAT
|
||||
install-init: libvirtd.init
|
||||
mkdir -p $(DESTDIR)$(sysconfdir)/rc.d/init.d
|
||||
$(INSTALL_SCRIPT) libvirtd.init \
|
||||
@ -263,8 +215,6 @@ 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
|
||||
|
||||
@ -272,13 +222,32 @@ install-init:
|
||||
uninstall-init:
|
||||
libvirtd.init:
|
||||
|
||||
endif # DBUS_INIT_SCRIPTS_RED_HAT
|
||||
endif # LIBVIRT_INIT_SCRIPT_RED_HAT
|
||||
|
||||
# This must be added last, since functions it provides/replaces
|
||||
# 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
|
||||
|
||||
# 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
|
52
daemon/THREADING.txt
Normal file
52
daemon/THREADING.txt
Normal file
@ -0,0 +1,52 @@
|
||||
|
||||
Threading in the libvirtd daemon
|
||||
================================
|
||||
|
||||
To allow efficient processing of RPC requests, the libvirtd daemon
|
||||
makes use of threads.
|
||||
|
||||
- The process leader. This is the initial thread of control
|
||||
when the daemon starts running. It is responsible for
|
||||
initializing all the state, and starting the event loop.
|
||||
Once that's all done, this thread does nothing except
|
||||
wait for the event loop to quit, thus indicating an orderly
|
||||
shutdown is required.
|
||||
|
||||
- The event loop. This thread runs the event loop, sitting
|
||||
in poll() on all monitored file handles, and calculating
|
||||
and dispatching any timers that may be registered. When
|
||||
this thread quits, the entire daemon will shutdown.
|
||||
|
||||
- The workers. These 'n' threads all sit around waiting to
|
||||
process incoming RPC requests. Since RPC requests may take
|
||||
a long time to complete, with long idle periods, there will
|
||||
be quite a few workers running.
|
||||
|
||||
The use of threads obviously requires locking to ensure safety when
|
||||
accessing/changing data structures.
|
||||
|
||||
- the top level lock is on 'struct qemud_server'. This must be
|
||||
held before acquiring any other lock
|
||||
|
||||
- Each 'struct qemud_client' object has a lock. The server lock
|
||||
must be held before acquiring it. Once the client lock is acquired
|
||||
the server lock can (optionally) be dropped.
|
||||
|
||||
- The event loop has its own self-contained lock. You can ignore
|
||||
this as a caller of virEvent APIs.
|
||||
|
||||
|
||||
The server lock is used in conjunction with a condition variable
|
||||
to pass jobs from the event loop thread to the workers. The main
|
||||
event loop thread handles I/O from the client socket, and once a
|
||||
complete RPC message has been read off the wire (and optionally
|
||||
decrypted), it will be placed onto the 'dx' job queue for the
|
||||
associated client object. The job condition will be signalled and
|
||||
a worker will wakup and process it.
|
||||
|
||||
The worker thread must quickly drop its locks on the server and
|
||||
client to allow the main event loop thread to continue running
|
||||
with its other work. Critically important, is that now libvirt
|
||||
API call will ever be made with the server or client locks held.
|
||||
|
||||
-- End
|
@ -104,7 +104,7 @@ void remoteDispatchOOMError (remote_error *rerr)
|
||||
{
|
||||
remoteDispatchStringError(rerr,
|
||||
VIR_ERR_NO_MEMORY,
|
||||
NULL);
|
||||
"out of memory");
|
||||
}
|
||||
|
||||
|
||||
@ -136,6 +136,10 @@ remoteSerializeError(struct qemud_client *client,
|
||||
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;
|
||||
|
||||
@ -191,6 +195,7 @@ remoteSerializeError(struct qemud_client *client,
|
||||
|
||||
xdr_error:
|
||||
xdr_destroy(&xdr);
|
||||
VIR_FREE(msg);
|
||||
fatal_error:
|
||||
xdr_free((xdrproc_t)xdr_remote_error, (char *)rerr);
|
||||
return -1;
|
||||
@ -206,19 +211,38 @@ fatal_error:
|
||||
*
|
||||
* Returns 0 if the error was sent, -1 upon fatal error
|
||||
*/
|
||||
static int
|
||||
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,
|
||||
REMOTE_REPLY,
|
||||
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
|
||||
*
|
||||
@ -336,8 +360,13 @@ 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. */
|
||||
@ -358,13 +387,31 @@ remoteDispatchClientRequest (struct qemud_server *server,
|
||||
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:
|
||||
return remoteSerializeReplyError(client, &rerr, &msg->hdr);
|
||||
ret = remoteSerializeReplyError(client, &rerr, &msg->hdr);
|
||||
|
||||
if (ret >= 0)
|
||||
VIR_FREE(msg);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@ -456,7 +503,7 @@ remoteDispatchClientCall (struct qemud_server *server,
|
||||
*
|
||||
* 'conn', 'rerr', 'args and 'ret'
|
||||
*/
|
||||
rv = (data->fn)(server, client, conn, &rerr, &args, &ret);
|
||||
rv = (data->fn)(server, client, conn, &msg->hdr, &rerr, &args, &ret);
|
||||
|
||||
virMutexLock(&server->lock);
|
||||
virMutexLock(&client->lock);
|
||||
@ -521,8 +568,12 @@ remoteDispatchClientCall (struct qemud_server *server,
|
||||
rpc_error:
|
||||
/* Semi-bad stuff happened, we can still try to send back
|
||||
* an RPC error message to client */
|
||||
return remoteSerializeReplyError(client, &rerr, &msg->hdr);
|
||||
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
|
||||
@ -532,3 +583,86 @@ xdr_error:
|
||||
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;
|
||||
}
|
@ -25,7 +25,7 @@
|
||||
#define __LIBVIRTD_DISPATCH_H__
|
||||
|
||||
|
||||
#include "qemud.h"
|
||||
#include "libvirtd.h"
|
||||
|
||||
|
||||
int
|
||||
@ -49,6 +49,17 @@ 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.
|
||||
@ -60,4 +71,10 @@ int remoteRelayDomainEvent (virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||
void *opaque);
|
||||
|
||||
|
||||
int
|
||||
remoteSendStreamData(struct qemud_client *client,
|
||||
struct qemud_client_stream *stream,
|
||||
const char *data,
|
||||
unsigned int len);
|
||||
|
||||
#endif /* __LIBVIRTD_DISPATCH_H__ */
|
@ -109,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",
|
||||
@ -170,7 +170,7 @@ 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);
|
||||
@ -350,22 +350,32 @@ static int virEventCalculateTimeout(int *timeout) {
|
||||
* file handles. The caller must free the returned data struct
|
||||
* returns: the pollfd array, or NULL on error
|
||||
*/
|
||||
static struct pollfd *virEventMakePollFDs(void) {
|
||||
static struct pollfd *virEventMakePollFDs(int *nfds) {
|
||||
struct pollfd *fds;
|
||||
int i;
|
||||
|
||||
*nfds = 0;
|
||||
for (i = 0 ; i < eventLoop.handlesCount ; i++) {
|
||||
if (eventLoop.handles[i].events)
|
||||
(*nfds)++;
|
||||
}
|
||||
|
||||
/* Setup the poll file handle data structs */
|
||||
if (VIR_ALLOC_N(fds, eventLoop.handlesCount) < 0)
|
||||
if (VIR_ALLOC_N(fds, *nfds) < 0)
|
||||
return NULL;
|
||||
|
||||
*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);
|
||||
fds[i].fd = eventLoop.handles[i].fd;
|
||||
fds[i].events = eventLoop.handles[i].events;
|
||||
fds[i].revents = 0;
|
||||
if (!eventLoop.handles[i].events)
|
||||
continue;
|
||||
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);
|
||||
}
|
||||
|
||||
@ -391,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;
|
||||
@ -429,28 +440,38 @@ static int virEventDispatchTimeouts(void) {
|
||||
* Returns 0 upon success, -1 if an error occurred
|
||||
*/
|
||||
static int virEventDispatchHandles(int nfds, struct pollfd *fds) {
|
||||
int i;
|
||||
int i, n;
|
||||
DEBUG("Dispatch %d", nfds);
|
||||
|
||||
/* 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 ; i < nfds ; i++) {
|
||||
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 n=%d w=%d f=%d", i,
|
||||
eventLoop.handles[i].watch, eventLoop.handles[i].fd);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (fds[i].revents) {
|
||||
if (fds[n].revents) {
|
||||
virEventHandleCallback cb = eventLoop.handles[i].cb;
|
||||
void *opaque = eventLoop.handles[i].opaque;
|
||||
int hEvents = virPollEventToEventHandleType(fds[i].revents);
|
||||
int hEvents = virPollEventToEventHandleType(fds[n].revents);
|
||||
EVENT_DEBUG("Dispatch n=%d f=%d w=%d e=%d %p", i,
|
||||
fds[i].fd, eventLoop.handles[i].watch,
|
||||
fds[i].revents, eventLoop.handles[i].opaque);
|
||||
fds[n].fd, eventLoop.handles[i].watch,
|
||||
fds[n].revents, eventLoop.handles[i].opaque);
|
||||
virEventUnlock();
|
||||
(cb)(eventLoop.handles[i].watch,
|
||||
fds[i].fd, hEvents, opaque);
|
||||
fds[n].fd, hEvents, opaque);
|
||||
virEventLock();
|
||||
}
|
||||
}
|
||||
@ -465,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
|
||||
@ -505,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
|
||||
@ -554,10 +577,9 @@ int virEventRunOnce(void) {
|
||||
virEventCleanupHandles() < 0)
|
||||
goto error;
|
||||
|
||||
if (!(fds = virEventMakePollFDs()) ||
|
||||
if (!(fds = virEventMakePollFDs(&nfds)) ||
|
||||
virEventCalculateTimeout(&timeout) < 0)
|
||||
goto error;
|
||||
nfds = eventLoop.handlesCount;
|
||||
|
||||
virEventUnlock();
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -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
|
||||
|
||||
@ -129,26 +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_message *msg, void *opaque);
|
||||
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_message *dx;
|
||||
|
||||
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;
|
||||
@ -197,6 +215,10 @@ struct qemud_client {
|
||||
* 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
|
||||
* called, it will be set back to NULL if that succeeds.
|
||||
@ -245,15 +267,18 @@ struct qemud_server {
|
||||
struct qemud_client **clients;
|
||||
|
||||
int sigread;
|
||||
int sigwrite;
|
||||
char *logDir;
|
||||
unsigned int shutdown : 1;
|
||||
pthread_t eventThread;
|
||||
unsigned int hasEventThread :1;
|
||||
unsigned int quitEventThread :1;
|
||||
#ifdef HAVE_AVAHI
|
||||
struct libvirtd_mdns *mdns;
|
||||
#endif
|
||||
#if HAVE_SASL
|
||||
char **saslUsernameWhitelist;
|
||||
#endif
|
||||
#if HAVE_POLKIT
|
||||
#if HAVE_POLKIT0
|
||||
DBusConnection *sysbus;
|
||||
#endif
|
||||
};
|
||||
@ -275,6 +300,9 @@ qemudClientMessageQueuePush(struct qemud_client_message **queue,
|
||||
struct qemud_client_message *
|
||||
qemudClientMessageQueueServe(struct qemud_client_message **queue);
|
||||
|
||||
void
|
||||
qemudClientMessageRelease(struct qemud_client *client,
|
||||
struct qemud_client_message *msg);
|
||||
|
||||
|
||||
#if HAVE_POLKIT
|
@ -40,6 +40,7 @@
|
||||
|
||||
SERVICE=libvirtd
|
||||
PROCESS=libvirtd
|
||||
PIDFILE=@localstatedir@/run/$SERVICE.pid
|
||||
|
||||
LIBVIRTD_CONFIG=
|
||||
LIBVIRTD_ARGS=
|
||||
@ -59,7 +60,7 @@ start() {
|
||||
echo -n $"Starting $SERVICE daemon: "
|
||||
mkdir -p @localstatedir@/cache/libvirt
|
||||
rm -rf @localstatedir@/cache/libvirt/*
|
||||
KRB5_KTNAME=$KRB5_KTNAME daemon --check $SERVICE $PROCESS --daemon $LIBVIRTD_CONFIG_ARGS $LIBVIRTD_ARGS
|
||||
KRB5_KTNAME=$KRB5_KTNAME daemon --pidfile $PIDFILE --check $SERVICE $PROCESS --daemon $LIBVIRTD_CONFIG_ARGS $LIBVIRTD_ARGS
|
||||
RETVAL=$?
|
||||
echo
|
||||
[ $RETVAL -eq 0 ] && touch @localstatedir@/lock/subsys/$SERVICE
|
||||
@ -68,12 +69,12 @@ start() {
|
||||
stop() {
|
||||
echo -n $"Stopping $SERVICE daemon: "
|
||||
|
||||
killproc $PROCESS
|
||||
killproc -p $PIDFILE $PROCESS
|
||||
RETVAL=$?
|
||||
echo
|
||||
if [ $RETVAL -eq 0 ]; then
|
||||
rm -f @localstatedir@/lock/subsys/$SERVICE
|
||||
rm -f @localstatedir@/run/$SERVICE.pid
|
||||
rm -f $PIDFILE
|
||||
rm -rf @localstatedir@/cache/libvirt/*
|
||||
fi
|
||||
}
|
||||
@ -86,7 +87,7 @@ restart() {
|
||||
reload() {
|
||||
echo -n $"Reloading $SERVICE configuration: "
|
||||
|
||||
killproc $PROCESS -HUP
|
||||
killproc -p $PIDFILE $PROCESS -HUP
|
||||
RETVAL=$?
|
||||
echo
|
||||
return $RETVAL
|
||||
@ -98,7 +99,7 @@ case "$1" in
|
||||
$1
|
||||
;;
|
||||
status)
|
||||
status $PROCESS
|
||||
status -p $PIDFILE $PROCESS
|
||||
RETVAL=$?
|
||||
;;
|
||||
force-reload)
|
9
daemon/libvirtd.logrotate.in
Normal file
9
daemon/libvirtd.logrotate.in
Normal file
@ -0,0 +1,9 @@
|
||||
@localstatedir@/log/libvirt/qemu/*.log @localstatedir@/log/libvirt/uml/*.log @localstatedir@/log/libvirt/lxc/*.log {
|
||||
weekly
|
||||
missingok
|
||||
rotate 4
|
||||
compress
|
||||
delaycompress
|
||||
copytruncate
|
||||
minsize 100k
|
||||
}
|
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
@ -25,7 +25,7 @@
|
||||
#define __LIBVIRTD_REMOTE_H__
|
||||
|
||||
|
||||
#include "qemud.h"
|
||||
#include "libvirtd.h"
|
||||
|
||||
typedef union {
|
||||
#include "remote_dispatch_args.h"
|
||||
@ -54,6 +54,7 @@ typedef union {
|
||||
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);
|
@ -117,3 +117,19 @@
|
||||
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;
|
||||
remote_domain_is_active_args val_remote_domain_is_active_args;
|
||||
remote_domain_is_persistent_args val_remote_domain_is_persistent_args;
|
||||
remote_network_is_active_args val_remote_network_is_active_args;
|
||||
remote_network_is_persistent_args val_remote_network_is_persistent_args;
|
||||
remote_storage_pool_is_active_args val_remote_storage_pool_is_active_args;
|
||||
remote_storage_pool_is_persistent_args val_remote_storage_pool_is_persistent_args;
|
||||
remote_interface_is_active_args val_remote_interface_is_active_args;
|
File diff suppressed because it is too large
Load Diff
@ -99,3 +99,19 @@
|
||||
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;
|
||||
remote_is_secure_ret val_remote_is_secure_ret;
|
||||
remote_domain_is_active_ret val_remote_domain_is_active_ret;
|
||||
remote_domain_is_persistent_ret val_remote_domain_is_persistent_ret;
|
||||
remote_network_is_active_ret val_remote_network_is_active_ret;
|
||||
remote_network_is_persistent_ret val_remote_network_is_persistent_ret;
|
||||
remote_storage_pool_is_active_ret val_remote_storage_pool_is_active_ret;
|
||||
remote_storage_pool_is_persistent_ret val_remote_storage_pool_is_persistent_ret;
|
||||
remote_interface_is_active_ret val_remote_interface_is_active_ret;
|
||||
remote_get_lib_version_ret val_remote_get_lib_version_ret;
|
@ -697,3 +697,98 @@
|
||||
.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,
|
||||
},
|
||||
{ /* IsSecure => 149 */
|
||||
.fn = (dispatch_fn) remoteDispatchIsSecure,
|
||||
.args_filter = (xdrproc_t) xdr_void,
|
||||
.ret_filter = (xdrproc_t) xdr_remote_is_secure_ret,
|
||||
},
|
||||
{ /* DomainIsActive => 150 */
|
||||
.fn = (dispatch_fn) remoteDispatchDomainIsActive,
|
||||
.args_filter = (xdrproc_t) xdr_remote_domain_is_active_args,
|
||||
.ret_filter = (xdrproc_t) xdr_remote_domain_is_active_ret,
|
||||
},
|
||||
{ /* DomainIsPersistent => 151 */
|
||||
.fn = (dispatch_fn) remoteDispatchDomainIsPersistent,
|
||||
.args_filter = (xdrproc_t) xdr_remote_domain_is_persistent_args,
|
||||
.ret_filter = (xdrproc_t) xdr_remote_domain_is_persistent_ret,
|
||||
},
|
||||
{ /* NetworkIsActive => 152 */
|
||||
.fn = (dispatch_fn) remoteDispatchNetworkIsActive,
|
||||
.args_filter = (xdrproc_t) xdr_remote_network_is_active_args,
|
||||
.ret_filter = (xdrproc_t) xdr_remote_network_is_active_ret,
|
||||
},
|
||||
{ /* NetworkIsPersistent => 153 */
|
||||
.fn = (dispatch_fn) remoteDispatchNetworkIsPersistent,
|
||||
.args_filter = (xdrproc_t) xdr_remote_network_is_persistent_args,
|
||||
.ret_filter = (xdrproc_t) xdr_remote_network_is_persistent_ret,
|
||||
},
|
||||
{ /* StoragePoolIsActive => 154 */
|
||||
.fn = (dispatch_fn) remoteDispatchStoragePoolIsActive,
|
||||
.args_filter = (xdrproc_t) xdr_remote_storage_pool_is_active_args,
|
||||
.ret_filter = (xdrproc_t) xdr_remote_storage_pool_is_active_ret,
|
||||
},
|
||||
{ /* StoragePoolIsPersistent => 155 */
|
||||
.fn = (dispatch_fn) remoteDispatchStoragePoolIsPersistent,
|
||||
.args_filter = (xdrproc_t) xdr_remote_storage_pool_is_persistent_args,
|
||||
.ret_filter = (xdrproc_t) xdr_remote_storage_pool_is_persistent_ret,
|
||||
},
|
||||
{ /* InterfaceIsActive => 156 */
|
||||
.fn = (dispatch_fn) remoteDispatchInterfaceIsActive,
|
||||
.args_filter = (xdrproc_t) xdr_remote_interface_is_active_args,
|
||||
.ret_filter = (xdrproc_t) xdr_remote_interface_is_active_ret,
|
||||
},
|
||||
{ /* GetLibVersion => 157 */
|
||||
.fn = (dispatch_fn) remoteDispatchGetLibVersion,
|
||||
.args_filter = (xdrproc_t) xdr_void,
|
||||
.ret_filter = (xdrproc_t) xdr_remote_get_lib_version_ret,
|
||||
},
|
@ -115,6 +115,7 @@ elsif ($opt_p) {
|
||||
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";
|
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__ */
|
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,13 +17,27 @@ 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 \
|
||||
@ -33,13 +47,9 @@ 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
|
||||
|
||||
@ -50,14 +60,7 @@ patches = $(wildcard api_extension/*.patch)
|
||||
|
||||
xml = \
|
||||
libvirt-api.xml \
|
||||
libvirt-refs.xml \
|
||||
testdomfc4.xml \
|
||||
testdomfv0.xml \
|
||||
testnetdef.xml \
|
||||
testnetpriv.xml \
|
||||
testnode.xml \
|
||||
testpool.xml \
|
||||
testvol.xml
|
||||
libvirt-refs.xml
|
||||
|
||||
fig = \
|
||||
libvirt-net-logical.fig \
|
||||
@ -70,20 +73,18 @@ 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) \
|
||||
$(patches) \
|
||||
virsh.pod ChangeLog.awk
|
||||
ChangeLog.awk
|
||||
|
||||
all: web $(top_builddir)/NEWS $(man_MANS)
|
||||
CLEANFILES = $(dot_html) $(apihtml) $(devhelphtml)
|
||||
|
||||
virsh.1: virsh.pod
|
||||
pod2man -c "Virtualization Support" -r "$(PACKAGE)-$(VERSION)" $(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 < $< > $@
|
||||
@ -105,34 +106,33 @@ ChangeLog.html.in: ChangeLog.xml ChangeLog.xsl
|
||||
|
||||
%.html: %.html.tmp
|
||||
@(if [ -x $(XMLLINT) -a -x $(XMLCATALOG) ] ; then \
|
||||
if $(XMLCATALOG) /etc/xml/catalog "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" > /dev/null ; then \
|
||||
if $(XMLCATALOG) /etc/xml/catalog "-//W3C//DTD XHTML 1.0 Strict//EN" > /dev/null ; then \
|
||||
echo "Validating $@" ; \
|
||||
$(XMLLINT) --nonet --format --valid $< > $@ || : ; \
|
||||
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 )
|
||||
-@(if [ -x $(XMLLINT) -a -x $(XMLCATALOG) ] ; then \
|
||||
if $(XMLCATALOG) /etc/xml/catalog "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" > /dev/null ; then \
|
||||
if $(XMLCATALOG) /etc/xml/catalog "-//W3C//DTD XHTML 1.0 Strict//EN" > /dev/null ; then \
|
||||
echo "Validating the resulting XHTML pages" ; \
|
||||
$(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 \
|
||||
| perl -0777 -pe 's/\n\n+$$/\n/' \
|
||||
> $@-t && mv $@-t $@ ; fi );
|
||||
|
||||
clean-local:
|
||||
rm -f *~ *.bak *.hierarchy *.signals *-unused.txt
|
||||
|
||||
@ -150,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
|
||||
|
246
docs/api.html
246
docs/api.html
@ -1,246 +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 api.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: The libvirt API concepts</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">API concepts</span>
|
||||
</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>
|
||||
<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><li>
|
||||
<div>
|
||||
<a title="Working on the internals of libvirt API, driver and daemon code" class="inactive" href="internals.html">Internals</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>The libvirt API concepts</h1>
|
||||
<p> This page describes the main principles and architecture choices
|
||||
behind the definition of the libvirt API:
|
||||
</p>
|
||||
<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>
|
||||
</p>
|
||||
<p> Once the application obtained a <a href="html/libvirt-libvirt.html#virConnectPtr"><code>virConnectPtr</code></a>
|
||||
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 <a href="html/libvirt-libvirt.html#virConnectListDomains"><code>virConnectListDomains</code></a>
|
||||
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 <a href="html/libvirt-libvirt.html#virConnectListNetworks"><code>virConnectListNetworks</code></a>
|
||||
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
|
||||
<a href="html/libvirt-libvirt.html#virStorageVolLookupByPath"><code>virStorageVolLookupByPath</code></a> 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
|
||||
<a href="html/libvirt-libvirt.html#virStoragePoolLookupByVolume"><code>virStoragePoolLookupByVolume</code></a> 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>
|
||||
<p>
|
||||
</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><li><b>Enumeration</b>:virConnectList... and virConnectNumOf...:
|
||||
those are used to enumerate a set of object available to an given
|
||||
hypervisor connection like:
|
||||
<a href="html/libvirt-libvirt.html#virConnectListDomains"><code>virConnectListDomains</code></a>,
|
||||
<a href="html/libvirt-libvirt.html#virConnectNumOfDomains"><code>virConnectNumOfDomains</code></a>,
|
||||
<a href="html/libvirt-libvirt.html#virConnectListNetworks"><code>virConnectListNetworks</code></a>,
|
||||
<a href="html/libvirt-libvirt.html#virConnectListStoragePools"><code>virConnectListStoragePools</code></a>, etc.</li><li><b>Description</b>: ...GetInfo: those are generic accessor providing
|
||||
a set of informations about an object, they are
|
||||
<a href="html/libvirt-libvirt.html#virNodeGetInfo"><code>virNodeGetInfo</code></a>,
|
||||
<a href="html/libvirt-libvirt.html#virDomainGetInfo"><code>virDomainGetInfo</code></a>,
|
||||
<a href="html/libvirt-libvirt.html#virStoragePoolGetInfo"><code>virStoragePoolGetInfo</code></a>,
|
||||
<a href="html/libvirt-libvirt.html#virStorageVolGetInfo"><code>virStorageVolGetInfo</code></a>.</li><li><b>Accessors</b>: ...Get... and ...Set...: those are more specific
|
||||
accessors to query or modify the given object, like
|
||||
<a href="html/libvirt-libvirt.html#virConnectGetType"><code>virConnectGetType</code></a>,
|
||||
<a href="html/libvirt-libvirt.html#virDomainGetMaxMemory"><code>virDomainGetMaxMemory</code></a>,
|
||||
<a href="html/libvirt-libvirt.html#virDomainSetMemory"><code>virDomainSetMemory</code></a>,
|
||||
<a href="html/libvirt-libvirt.html#virDomainGetVcpus"><code>virDomainGetVcpus</code></a>,
|
||||
<a href="html/libvirt-libvirt.html#virStoragePoolSetAutostart"><code>virStoragePoolSetAutostart</code></a>,
|
||||
<a href="html/libvirt-libvirt.html#virNetworkGetBridgeName"><code>virNetworkGetBridgeName</code></a>, 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>,
|
||||
</p>
|
||||
<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>
|
||||
</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>
|
@ -84,7 +84,7 @@
|
||||
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
|
||||
@ -93,7 +93,7 @@
|
||||
<p> For each first class object you will find apis
|
||||
for the following actions:</p>
|
||||
<ul>
|
||||
<li><b>Lookup</b>:...LookupByName,
|
||||
<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:
|
||||
@ -119,7 +119,7 @@
|
||||
<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>,
|
||||
<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">
|
||||
|
@ -1,365 +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 api_extension.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: Implementing a new API in 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="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>
|
||||
<a title="Bindings of the libvirt API for other languages" class="inactive" href="bindings.html">Language bindings</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Working on the internals of libvirt API, driver and daemon code" class="active" href="internals.html">Internals</a>
|
||||
<ul class="l2"><li>
|
||||
<div>
|
||||
<a title="General hacking guidelines for contributors" class="inactive" href="hacking.html">Contributor guidelines</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<span class="active">API extensions</span>
|
||||
</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>Implementing a new API in Libvirt</h1>
|
||||
<ul><li>
|
||||
<a href="#publicapi">Defining the public API</a>
|
||||
</li><li>
|
||||
<a href="#internalapi">Defining the internal API</a>
|
||||
</li><li>
|
||||
<a href="#implpublic">Implementing the public API</a>
|
||||
</li><li>
|
||||
<a href="#wireproto">Defining the wire protocol format</a>
|
||||
</li><li>
|
||||
<a href="#rpcclient">Implement the RPC client</a>
|
||||
</li><li>
|
||||
<a href="#serverdispatch">Implement the server side dispatcher</a>
|
||||
</li><li>
|
||||
<a href="#driverimpl">Implement the driver methods</a>
|
||||
</li><li>
|
||||
<a href="#virsh">Implement virsh commands</a>
|
||||
</li></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" id="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" id="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" id="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" id="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" id="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" id="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" id="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" id="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>
|
||||
</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>
|
@ -145,20 +145,20 @@
|
||||
|
||||
<ol class="ordinarylist">
|
||||
<li>SHOULD log a message with VIR_DEBUG() indicating that it is
|
||||
being called and its parameters;</li>
|
||||
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>
|
||||
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>
|
||||
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>
|
||||
passed in;</li>
|
||||
<li>MUST confirm that the driver for this connection exists and that
|
||||
it implements this function;</li>
|
||||
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>
|
||||
returning, its return value, and status.</li>
|
||||
<li>MUST return status to the caller.</li>
|
||||
</ol>
|
||||
|
||||
|
@ -26,6 +26,7 @@ included_files = {
|
||||
|
||||
ignored_words = {
|
||||
"ATTRIBUTE_UNUSED": (0, "macro keyword"),
|
||||
"ATTRIBUTE_SENTINEL": (0, "macro keyword"),
|
||||
"VIR_DEPRECATED": (0, "macro keyword"),
|
||||
"WINAPI": (0, "Windows keyword"),
|
||||
"__declspec": (3, "Windows keyword"),
|
||||
@ -38,6 +39,7 @@ 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",
|
||||
}
|
||||
@ -54,7 +56,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,
|
||||
@ -838,14 +842,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 = ""
|
||||
@ -859,9 +869,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)
|
||||
|
||||
@ -1716,7 +1731,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
|
||||
@ -1760,7 +1775,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")
|
||||
@ -1796,7 +1811,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":
|
||||
@ -2089,11 +2104,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>
|
@ -21,42 +21,42 @@
|
||||
<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.
|
||||
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.
|
||||
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
|
||||
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.
|
||||
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.
|
||||
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.
|
||||
Watch the CPU, memory, network and disk utilization of all
|
||||
virtual machines running on a host.
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
@ -65,17 +65,17 @@
|
||||
<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.
|
||||
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.
|
||||
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>
|
||||
|
||||
@ -84,10 +84,18 @@
|
||||
<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.
|
||||
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>
|
||||
<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>
|
||||
|
||||
@ -96,10 +104,10 @@
|
||||
<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.
|
||||
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>
|
||||
|
||||
@ -107,13 +115,13 @@
|
||||
<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
|
||||
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>
|
||||
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.
|
||||
@ -122,8 +130,8 @@
|
||||
</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>.
|
||||
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.
|
||||
|
@ -1,132 +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>
|
||||
<a title="The libvirt API concepts" class="inactive" href="api.html">API concepts</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><li>
|
||||
<div>
|
||||
<a title="Working on the internals of libvirt API, driver and daemon code" class="inactive" href="internals.html">Internals</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,161 +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="The libvirt API concepts" class="inactive" href="api.html">API concepts</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><li>
|
||||
<div>
|
||||
<a title="Working on the internals of libvirt API, driver and daemon code" class="inactive" href="internals.html">Internals</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>
|
@ -11,26 +11,26 @@
|
||||
|
||||
<ul>
|
||||
<li><strong>VLAN 1</strong>. This virtual network has connectivity
|
||||
to <code>LAN 2</code> with traffic forwarded and NATed.
|
||||
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.
|
||||
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>.
|
||||
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>
|
||||
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.
|
||||
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>
|
||||
|
||||
|
@ -1,132 +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="The libvirt API concepts" class="inactive" href="api.html">API concepts</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><li>
|
||||
<div>
|
||||
<a title="Working on the internals of libvirt API, driver and daemon code" class="inactive" href="internals.html">Internals</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,151 +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="The libvirt API concepts" class="inactive" href="api.html">API concepts</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><li>
|
||||
<div>
|
||||
<a title="Working on the internals of libvirt API, driver and daemon code" class="inactive" href="internals.html">Internals</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>
|
@ -7,16 +7,16 @@
|
||||
</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.
|
||||
<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.
|
||||
<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>
|
||||
|
||||
|
314
docs/auth.html
314
docs/auth.html
@ -1,314 +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><li>
|
||||
<div>
|
||||
<a title="Working on the internals of libvirt API, driver and daemon code" class="inactive" href="internals.html">Internals</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,134 +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><li>
|
||||
<div>
|
||||
<a title="Working on the internals of libvirt API, driver and daemon code" class="inactive" href="internals.html">Internals</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>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="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>
|
||||
<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="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><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="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><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>
|
@ -30,26 +30,26 @@
|
||||
<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="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>
|
||||
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="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>
|
||||
<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="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>
|
||||
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="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>
|
||||
<li>
|
||||
If you are using official binaries from another Linux distribution first
|
||||
follow their own bug reporting guidelines.
|
||||
If you are using official binaries from another Linux distribution first
|
||||
follow their own bug reporting guidelines.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@ -65,7 +65,7 @@
|
||||
|
||||
<ul>
|
||||
<li>The version number of the libvirt build, or date of the CVS
|
||||
checkout</li>
|
||||
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>
|
||||
|
@ -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,160 +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><li>
|
||||
<div>
|
||||
<a title="Working on the internals of libvirt API, driver and daemon code" class="inactive" href="internals.html">Internals</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
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
|
@ -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>
|
@ -1,43 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<title>libvirt Reference Manual</title>
|
||||
<meta name="generator" content="Libvirt devhelp stylesheet"/>
|
||||
<link rel="stylesheet" href="style.css" type="text/css"/>
|
||||
</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="h" href="index.html">
|
||||
<img src="home.png" width="24" height="24" border="0" alt="Home"/>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a accesskey="n" href="general.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 Reference Manual</span>
|
||||
</h2>
|
||||
<p>Libvir is a C toolkit to interact with the virtualization capabilities of
|
||||
recent versions of Linux (and other OSes). It is free software available
|
||||
under the <a href="http://www.opensource.org/licenses/lgpl-license.html">GNU
|
||||
Lesser General Public License</a>. Virtualization of the Linux Operating
|
||||
System means the ability to run multiple instances of Operating Systems
|
||||
concurrently on a single hardware system where the basic resources are driven
|
||||
by a Linux instance. The library aim at providing long term stable C API
|
||||
initially for the <a href="http://www.cl.cam.ac.uk/Research/SRG/netos/xen/index.html">Xen
|
||||
paravirtualization</a> but should be able to integrate other virtualization
|
||||
mechanisms if needed.</p>
|
||||
<p> If you get lost searching for some specific API use, try
|
||||
<a href="http://libvirt.org/search.php">the online search
|
||||
engine</a> hosted on <a href="http://libvirt.org/">libvirt.org</a>
|
||||
it indexes the project page, the APIs as well as the mailing-list archives. </p>
|
||||
</body>
|
||||
</html>
|
@ -1,120 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<title>conf: </title>
|
||||
<meta name="generator" content="Libvirt devhelp stylesheet"/>
|
||||
<link rel="start" href="index.html" title="libvirt Reference Manual"/>
|
||||
<link rel="up" href="general.html" title="API"/>
|
||||
<link rel="stylesheet" href="style.css" type="text/css"/>
|
||||
<link rel="chapter" href="general.html" title="API"/>
|
||||
</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="p" href="libvirt-virterror.html">
|
||||
<img src="left.png" width="24" height="24" border="0" alt="Prev"/>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a accesskey="u" href="general.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>
|
||||
<th width="100%" align="center">libvirt Reference Manual</th>
|
||||
</tr>
|
||||
</table>
|
||||
<h2>
|
||||
<span class="refentrytitle">conf</span>
|
||||
</h2>
|
||||
<p>conf - </p>
|
||||
<p></p>
|
||||
<p>Author(s): </p>
|
||||
<div class="refsynopsisdiv">
|
||||
<h2>Synopsis</h2>
|
||||
<pre class="synopsis">typedef <a href="libvirt-conf.html#virConfValue">virConfValue</a> * <a href="#virConfValuePtr">virConfValuePtr</a>;
|
||||
typedef enum <a href="#virConfType">virConfType</a>;
|
||||
typedef struct _virConfValue <a href="#virConfValue">virConfValue</a>;
|
||||
typedef struct _virConf <a href="#virConf">virConf</a>;
|
||||
typedef <a href="libvirt-conf.html#virConf">virConf</a> * <a href="#virConfPtr">virConfPtr</a>;
|
||||
int <a href="#virConfWriteFile">virConfWriteFile</a> (const char * filename, <br/> <a href="libvirt-conf.html#virConfPtr">virConfPtr</a> conf);
|
||||
<a href="libvirt-conf.html#virConfValuePtr">virConfValuePtr</a> <a href="#virConfGetValue">virConfGetValue</a> (<a href="libvirt-conf.html#virConfPtr">virConfPtr</a> conf, <br/> const char * setting);
|
||||
<a href="libvirt-conf.html#virConfPtr">virConfPtr</a> <a href="#virConfReadMem">virConfReadMem</a> (const char * memory, <br/> int len);
|
||||
int <a href="#virConfFree">virConfFree</a> (<a href="libvirt-conf.html#virConfPtr">virConfPtr</a> conf);
|
||||
<a href="libvirt-conf.html#virConfPtr">virConfPtr</a> <a href="#virConfReadFile">virConfReadFile</a> (const char * filename);
|
||||
int <a href="#virConfWriteMem">virConfWriteMem</a> (char * memory, <br/> int * len, <br/> <a href="libvirt-conf.html#virConfPtr">virConfPtr</a> conf);
|
||||
</pre>
|
||||
</div>
|
||||
<div class="refsect1" lang="en">
|
||||
<h2>Description</h2>
|
||||
</div>
|
||||
<div class="refsect1" lang="en">
|
||||
<h2>Details</h2>
|
||||
<div class="refsect2" lang="en">
|
||||
<div class="refsect2" lang="en"><h3><a name="virConf">Structure </a>virConf</h3><pre class="programlisting">struct _virConf {
|
||||
The content of this structure is not made public by the API.
|
||||
} virConf;
|
||||
</pre><p/>
|
||||
</div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virConfPtr">Typedef </a>virConfPtr</h3><pre class="programlisting"><a href="libvirt-conf.html#virConf">virConf</a> * virConfPtr;
|
||||
</pre><p>a pointer to a parsed configuration file</p>
|
||||
</div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virConfType">Enum </a>virConfType</h3><pre class="programlisting">enum <a href="#virConfType">virConfType</a> {
|
||||
<a name="VIR_CONF_NONE">VIR_CONF_NONE</a> = 0 /* undefined */
|
||||
<a name="VIR_CONF_LONG">VIR_CONF_LONG</a> = 1 /* a long int */
|
||||
<a name="VIR_CONF_STRING">VIR_CONF_STRING</a> = 2 /* a string */
|
||||
<a name="VIR_CONF_LIST">VIR_CONF_LIST</a> = 3 /* a list */
|
||||
};
|
||||
</pre><p/>
|
||||
</div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virConfValue">Structure </a>virConfValue</h3><pre class="programlisting">struct _virConfValue {
|
||||
<a href="libvirt-conf.html#virConfType">virConfType</a> type : the <a href="libvirt-conf.html#virConfType">virConfType</a>
|
||||
<a href="libvirt-conf.html#virConfValuePtr">virConfValuePtr</a> next : next element if in a list
|
||||
long l : long integer
|
||||
char * str : pointer to 0 terminated string
|
||||
<a href="libvirt-conf.html#virConfValuePtr">virConfValuePtr</a> list : list of a list
|
||||
} virConfValue;
|
||||
</pre><p/>
|
||||
</div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virConfValuePtr">Typedef </a>virConfValuePtr</h3><pre class="programlisting"><a href="libvirt-conf.html#virConfValue">virConfValue</a> * virConfValuePtr;
|
||||
</pre><p/>
|
||||
</div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virConfFree"/>virConfFree ()</h3><pre class="programlisting">int virConfFree (<a href="libvirt-conf.html#virConfPtr">virConfPtr</a> conf)<br/>
|
||||
</pre><p>Frees all data associated to the handle</p>
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>conf</tt></i>:</span></td><td>a configuration file handle</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of error.</td></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virConfGetValue"/>virConfGetValue ()</h3><pre class="programlisting"><a href="libvirt-conf.html#virConfValuePtr">virConfValuePtr</a> virConfGetValue (<a href="libvirt-conf.html#virConfPtr">virConfPtr</a> conf, <br/> const char * setting)<br/>
|
||||
</pre><p>Lookup the value associated to this entry in the configuration file</p>
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>conf</tt></i>:</span></td><td>a configuration file handle</td></tr><tr><td><span class="term"><i><tt>setting</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the value or NULL if the lookup failed, the data associated will be freed when virConfFree() is called</td></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virConfReadFile"/>virConfReadFile ()</h3><pre class="programlisting"><a href="libvirt-conf.html#virConfPtr">virConfPtr</a> virConfReadFile (const char * filename)<br/>
|
||||
</pre><p>Reads a configuration file.</p>
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>the path to the configuration file.</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>an handle to lookup settings or NULL if it failed to read or parse the file, use virConfFree() to free the data.</td></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virConfReadMem"/>virConfReadMem ()</h3><pre class="programlisting"><a href="libvirt-conf.html#virConfPtr">virConfPtr</a> virConfReadMem (const char * memory, <br/> int len)<br/>
|
||||
</pre><p>Reads a configuration file loaded in memory. The string can be zero terminated in which case @len can be 0</p>
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>memory</tt></i>:</span></td><td>pointer to the content of the configuration file</td></tr><tr><td><span class="term"><i><tt>len</tt></i>:</span></td><td>length in byte</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>an handle to lookup settings or NULL if it failed to parse the content, use virConfFree() to free the data.</td></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virConfWriteFile"/>virConfWriteFile ()</h3><pre class="programlisting">int virConfWriteFile (const char * filename, <br/> <a href="libvirt-conf.html#virConfPtr">virConfPtr</a> conf)<br/>
|
||||
</pre><p>Writes a configuration file back to a file.</p>
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>the path to the configuration file.</td></tr><tr><td><span class="term"><i><tt>conf</tt></i>:</span></td><td>the conf</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of bytes written or -1 in case of error.</td></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virConfWriteMem"/>virConfWriteMem ()</h3><pre class="programlisting">int virConfWriteMem (char * memory, <br/> int * len, <br/> <a href="libvirt-conf.html#virConfPtr">virConfPtr</a> conf)<br/>
|
||||
</pre><p>Writes a configuration file back to a memory area. @len is an IN/OUT parameter, it indicates the size available in bytes, and on output the size required for the configuration file (even if the call fails due to insufficient space).</p>
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>memory</tt></i>:</span></td><td>pointer to the memory to store the config file</td></tr><tr><td><span class="term"><i><tt>len</tt></i>:</span></td><td>pointer to the length in byte of the store, on output the size</td></tr><tr><td><span class="term"><i><tt>conf</tt></i>:</span></td><td>the conf</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of bytes written or -1 in case of error.</td></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
File diff suppressed because it is too large
Load Diff
@ -1,251 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<title>virterror: error handling interfaces for the libvirt library</title>
|
||||
<meta name="generator" content="Libvirt devhelp stylesheet"/>
|
||||
<link rel="start" href="index.html" title="libvirt Reference Manual"/>
|
||||
<link rel="up" href="general.html" title="API"/>
|
||||
<link rel="stylesheet" href="style.css" type="text/css"/>
|
||||
<link rel="chapter" href="general.html" title="API"/>
|
||||
</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="p" href="libvirt-libvirt.html">
|
||||
<img src="left.png" width="24" height="24" border="0" alt="Prev"/>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a accesskey="u" href="general.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>
|
||||
<th width="100%" align="center">libvirt Reference Manual</th>
|
||||
</tr>
|
||||
</table>
|
||||
<h2>
|
||||
<span class="refentrytitle">virterror</span>
|
||||
</h2>
|
||||
<p>virterror - error handling interfaces for the libvirt library</p>
|
||||
<p>Provides the interfaces of the libvirt library to handle errors raised while using the library. </p>
|
||||
<p>Author(s): Daniel Veillard <veillard@redhat.com> </p>
|
||||
<div class="refsynopsisdiv">
|
||||
<h2>Synopsis</h2>
|
||||
<pre class="synopsis">typedef <a href="libvirt-virterror.html#virError">virError</a> * <a href="#virErrorPtr">virErrorPtr</a>;
|
||||
typedef enum <a href="#virErrorLevel">virErrorLevel</a>;
|
||||
typedef enum <a href="#virErrorDomain">virErrorDomain</a>;
|
||||
typedef enum <a href="#virErrorNumber">virErrorNumber</a>;
|
||||
typedef struct _virError <a href="#virError">virError</a>;
|
||||
void <a href="#virFreeError">virFreeError</a> (<a href="libvirt-virterror.html#virErrorPtr">virErrorPtr</a> err);
|
||||
int <a href="#virCopyLastError">virCopyLastError</a> (<a href="libvirt-virterror.html#virErrorPtr">virErrorPtr</a> to);
|
||||
void <a href="#virConnSetErrorFunc">virConnSetErrorFunc</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> void * userData, <br/> <a href="libvirt-virterror.html#virErrorFunc">virErrorFunc</a> handler);
|
||||
void <a href="#virResetLastError">virResetLastError</a> (void);
|
||||
typedef void <a href="#virErrorFunc">virErrorFunc</a> (void * userData, <br/> <a href="libvirt-virterror.html#virErrorPtr">virErrorPtr</a> error);
|
||||
void <a href="#virResetError">virResetError</a> (<a href="libvirt-virterror.html#virErrorPtr">virErrorPtr</a> err);
|
||||
<a href="libvirt-virterror.html#virErrorPtr">virErrorPtr</a> <a href="#virConnGetLastError">virConnGetLastError</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn);
|
||||
void <a href="#virDefaultErrorFunc">virDefaultErrorFunc</a> (<a href="libvirt-virterror.html#virErrorPtr">virErrorPtr</a> err);
|
||||
<a href="libvirt-virterror.html#virErrorPtr">virErrorPtr</a> <a href="#virGetLastError">virGetLastError</a> (void);
|
||||
void <a href="#virSetErrorFunc">virSetErrorFunc</a> (void * userData, <br/> <a href="libvirt-virterror.html#virErrorFunc">virErrorFunc</a> handler);
|
||||
int <a href="#virConnCopyLastError">virConnCopyLastError</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> <a href="libvirt-virterror.html#virErrorPtr">virErrorPtr</a> to);
|
||||
void <a href="#virConnResetLastError">virConnResetLastError</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn);
|
||||
<a href="libvirt-virterror.html#virErrorPtr">virErrorPtr</a> <a href="#virSaveLastError">virSaveLastError</a> (void);
|
||||
</pre>
|
||||
</div>
|
||||
<div class="refsect1" lang="en">
|
||||
<h2>Description</h2>
|
||||
</div>
|
||||
<div class="refsect1" lang="en">
|
||||
<h2>Details</h2>
|
||||
<div class="refsect2" lang="en">
|
||||
<div class="refsect2" lang="en"><h3><a name="virError">Structure </a>virError</h3><pre class="programlisting">struct _virError {
|
||||
int code : The error code, a <a href="libvirt-virterror.html#virErrorNumber">virErrorNumber</a>
|
||||
int domain : What part of the library raised this error
|
||||
char * message : human-readable informative error message
|
||||
<a href="libvirt-virterror.html#virErrorLevel">virErrorLevel</a> level : how consequent is the error
|
||||
<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn : connection if available, deprecated see note above
|
||||
<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom : domain if available, deprecated see note above
|
||||
char * str1 : extra string information
|
||||
char * str2 : extra string information
|
||||
char * str3 : extra string information
|
||||
int int1 : extra number information
|
||||
int int2 : extra number information
|
||||
<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> net : network if available, deprecated see note above
|
||||
} virError;
|
||||
</pre><p/>
|
||||
</div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virErrorDomain">Enum </a>virErrorDomain</h3><pre class="programlisting">enum <a href="#virErrorDomain">virErrorDomain</a> {
|
||||
<a name="VIR_FROM_NONE">VIR_FROM_NONE</a> = 0
|
||||
<a name="VIR_FROM_XEN">VIR_FROM_XEN</a> = 1 /* Error at Xen hypervisor layer */
|
||||
<a name="VIR_FROM_XEND">VIR_FROM_XEND</a> = 2 /* Error at connection with xend daemon */
|
||||
<a name="VIR_FROM_XENSTORE">VIR_FROM_XENSTORE</a> = 3 /* Error at connection with xen store */
|
||||
<a name="VIR_FROM_SEXPR">VIR_FROM_SEXPR</a> = 4 /* Error in the S-Expression code */
|
||||
<a name="VIR_FROM_XML">VIR_FROM_XML</a> = 5 /* Error in the XML code */
|
||||
<a name="VIR_FROM_DOM">VIR_FROM_DOM</a> = 6 /* Error when operating on a domain */
|
||||
<a name="VIR_FROM_RPC">VIR_FROM_RPC</a> = 7 /* Error in the XML-RPC code */
|
||||
<a name="VIR_FROM_PROXY">VIR_FROM_PROXY</a> = 8 /* Error in the proxy code */
|
||||
<a name="VIR_FROM_CONF">VIR_FROM_CONF</a> = 9 /* Error in the configuration file handling */
|
||||
<a name="VIR_FROM_QEMU">VIR_FROM_QEMU</a> = 10 /* Error at the QEMU daemon */
|
||||
<a name="VIR_FROM_NET">VIR_FROM_NET</a> = 11 /* Error when operating on a network */
|
||||
<a name="VIR_FROM_TEST">VIR_FROM_TEST</a> = 12 /* Error from test driver */
|
||||
<a name="VIR_FROM_REMOTE">VIR_FROM_REMOTE</a> = 13 /* Error from remote driver */
|
||||
<a name="VIR_FROM_OPENVZ">VIR_FROM_OPENVZ</a> = 14 /* Error from OpenVZ driver */
|
||||
<a name="VIR_FROM_XENXM">VIR_FROM_XENXM</a> = 15 /* Error at Xen XM layer */
|
||||
<a name="VIR_FROM_STATS_LINUX">VIR_FROM_STATS_LINUX</a> = 16 /* Error in the Linux Stats code */
|
||||
<a name="VIR_FROM_LXC">VIR_FROM_LXC</a> = 17 /* Error from Linux Container driver */
|
||||
<a name="VIR_FROM_STORAGE">VIR_FROM_STORAGE</a> = 18 /* Error from storage driver */
|
||||
<a name="VIR_FROM_NETWORK">VIR_FROM_NETWORK</a> = 19 /* Error from network config */
|
||||
<a name="VIR_FROM_DOMAIN">VIR_FROM_DOMAIN</a> = 20 /* Error from domain config */
|
||||
<a name="VIR_FROM_UML">VIR_FROM_UML</a> = 21 /* Error at the UML driver */
|
||||
<a name="VIR_FROM_NODEDEV">VIR_FROM_NODEDEV</a> = 22 /* Error from node device monitor */
|
||||
<a name="VIR_FROM_XEN_INOTIFY">VIR_FROM_XEN_INOTIFY</a> = 23 /* Error from xen inotify layer */
|
||||
<a name="VIR_FROM_SECURITY">VIR_FROM_SECURITY</a> = 24 /* Error from security framework */
|
||||
<a name="VIR_FROM_VBOX">VIR_FROM_VBOX</a> = 25 /* Error from VirtualBox driver */
|
||||
<a name="VIR_FROM_INTERFACE">VIR_FROM_INTERFACE</a> = 26 /* Error when operating on an interface */
|
||||
<a name="VIR_FROM_ONE">VIR_FROM_ONE</a> = 27 /* Error from OpenNebula driver */
|
||||
<a name="VIR_FROM_ESX">VIR_FROM_ESX</a> = 28 /* Error from ESX driver */
|
||||
<a name="VIR_FROM_PHYP">VIR_FROM_PHYP</a> = 29 /* Error from IBM power hypervisor */
|
||||
};
|
||||
</pre><p/>
|
||||
</div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virErrorLevel">Enum </a>virErrorLevel</h3><pre class="programlisting">enum <a href="#virErrorLevel">virErrorLevel</a> {
|
||||
<a name="VIR_ERR_NONE">VIR_ERR_NONE</a> = 0
|
||||
<a name="VIR_ERR_WARNING">VIR_ERR_WARNING</a> = 1 /* A simple warning */
|
||||
<a name="VIR_ERR_ERROR">VIR_ERR_ERROR</a> = 2 /* An error */
|
||||
};
|
||||
</pre><p/>
|
||||
</div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virErrorNumber">Enum </a>virErrorNumber</h3><pre class="programlisting">enum <a href="#virErrorNumber">virErrorNumber</a> {
|
||||
<a name="VIR_ERR_OK">VIR_ERR_OK</a> = 0
|
||||
<a name="VIR_ERR_INTERNAL_ERROR">VIR_ERR_INTERNAL_ERROR</a> = 1 /* internal error */
|
||||
<a name="VIR_ERR_NO_MEMORY">VIR_ERR_NO_MEMORY</a> = 2 /* memory allocation failure */
|
||||
<a name="VIR_ERR_NO_SUPPORT">VIR_ERR_NO_SUPPORT</a> = 3 /* no support for this function */
|
||||
<a name="VIR_ERR_UNKNOWN_HOST">VIR_ERR_UNKNOWN_HOST</a> = 4 /* could not resolve hostname */
|
||||
<a name="VIR_ERR_NO_CONNECT">VIR_ERR_NO_CONNECT</a> = 5 /* can't connect to hypervisor */
|
||||
<a name="VIR_ERR_INVALID_CONN">VIR_ERR_INVALID_CONN</a> = 6 /* invalid connection object */
|
||||
<a name="VIR_ERR_INVALID_DOMAIN">VIR_ERR_INVALID_DOMAIN</a> = 7 /* invalid domain object */
|
||||
<a name="VIR_ERR_INVALID_ARG">VIR_ERR_INVALID_ARG</a> = 8 /* invalid function argument */
|
||||
<a name="VIR_ERR_OPERATION_FAILED">VIR_ERR_OPERATION_FAILED</a> = 9 /* a command to hypervisor failed */
|
||||
<a name="VIR_ERR_GET_FAILED">VIR_ERR_GET_FAILED</a> = 10 /* a HTTP GET command to failed */
|
||||
<a name="VIR_ERR_POST_FAILED">VIR_ERR_POST_FAILED</a> = 11 /* a HTTP POST command to failed */
|
||||
<a name="VIR_ERR_HTTP_ERROR">VIR_ERR_HTTP_ERROR</a> = 12 /* unexpected HTTP error code */
|
||||
<a name="VIR_ERR_SEXPR_SERIAL">VIR_ERR_SEXPR_SERIAL</a> = 13 /* failure to serialize an S-Expr */
|
||||
<a name="VIR_ERR_NO_XEN">VIR_ERR_NO_XEN</a> = 14 /* could not open Xen hypervisor control */
|
||||
<a name="VIR_ERR_XEN_CALL">VIR_ERR_XEN_CALL</a> = 15 /* failure doing an hypervisor call */
|
||||
<a name="VIR_ERR_OS_TYPE">VIR_ERR_OS_TYPE</a> = 16 /* unknown OS type */
|
||||
<a name="VIR_ERR_NO_KERNEL">VIR_ERR_NO_KERNEL</a> = 17 /* missing kernel information */
|
||||
<a name="VIR_ERR_NO_ROOT">VIR_ERR_NO_ROOT</a> = 18 /* missing root device information */
|
||||
<a name="VIR_ERR_NO_SOURCE">VIR_ERR_NO_SOURCE</a> = 19 /* missing source device information */
|
||||
<a name="VIR_ERR_NO_TARGET">VIR_ERR_NO_TARGET</a> = 20 /* missing target device information */
|
||||
<a name="VIR_ERR_NO_NAME">VIR_ERR_NO_NAME</a> = 21 /* missing domain name information */
|
||||
<a name="VIR_ERR_NO_OS">VIR_ERR_NO_OS</a> = 22 /* missing domain OS information */
|
||||
<a name="VIR_ERR_NO_DEVICE">VIR_ERR_NO_DEVICE</a> = 23 /* missing domain devices information */
|
||||
<a name="VIR_ERR_NO_XENSTORE">VIR_ERR_NO_XENSTORE</a> = 24 /* could not open Xen Store control */
|
||||
<a name="VIR_ERR_DRIVER_FULL">VIR_ERR_DRIVER_FULL</a> = 25 /* too many drivers registered */
|
||||
<a name="VIR_ERR_CALL_FAILED">VIR_ERR_CALL_FAILED</a> = 26 /* not supported by the drivers (DEPRECATED) */
|
||||
<a name="VIR_ERR_XML_ERROR">VIR_ERR_XML_ERROR</a> = 27 /* an XML description is not well formed or broken */
|
||||
<a name="VIR_ERR_DOM_EXIST">VIR_ERR_DOM_EXIST</a> = 28 /* the domain already exist */
|
||||
<a name="VIR_ERR_OPERATION_DENIED">VIR_ERR_OPERATION_DENIED</a> = 29 /* operation forbidden on read-only connections */
|
||||
<a name="VIR_ERR_OPEN_FAILED">VIR_ERR_OPEN_FAILED</a> = 30 /* failed to open a conf file */
|
||||
<a name="VIR_ERR_READ_FAILED">VIR_ERR_READ_FAILED</a> = 31 /* failed to read a conf file */
|
||||
<a name="VIR_ERR_PARSE_FAILED">VIR_ERR_PARSE_FAILED</a> = 32 /* failed to parse a conf file */
|
||||
<a name="VIR_ERR_CONF_SYNTAX">VIR_ERR_CONF_SYNTAX</a> = 33 /* failed to parse the syntax of a conf file */
|
||||
<a name="VIR_ERR_WRITE_FAILED">VIR_ERR_WRITE_FAILED</a> = 34 /* failed to write a conf file */
|
||||
<a name="VIR_ERR_XML_DETAIL">VIR_ERR_XML_DETAIL</a> = 35 /* detail of an XML error */
|
||||
<a name="VIR_ERR_INVALID_NETWORK">VIR_ERR_INVALID_NETWORK</a> = 36 /* invalid network object */
|
||||
<a name="VIR_ERR_NETWORK_EXIST">VIR_ERR_NETWORK_EXIST</a> = 37 /* the network already exist */
|
||||
<a name="VIR_ERR_SYSTEM_ERROR">VIR_ERR_SYSTEM_ERROR</a> = 38 /* general system call failure */
|
||||
<a name="VIR_ERR_RPC">VIR_ERR_RPC</a> = 39 /* some sort of RPC error */
|
||||
<a name="VIR_ERR_GNUTLS_ERROR">VIR_ERR_GNUTLS_ERROR</a> = 40 /* error from a GNUTLS call */
|
||||
<a name="VIR_WAR_NO_NETWORK">VIR_WAR_NO_NETWORK</a> = 41 /* failed to start network */
|
||||
<a name="VIR_ERR_NO_DOMAIN">VIR_ERR_NO_DOMAIN</a> = 42 /* domain not found or unexpectedly disappeared */
|
||||
<a name="VIR_ERR_NO_NETWORK">VIR_ERR_NO_NETWORK</a> = 43 /* network not found */
|
||||
<a name="VIR_ERR_INVALID_MAC">VIR_ERR_INVALID_MAC</a> = 44 /* invalid MAC address */
|
||||
<a name="VIR_ERR_AUTH_FAILED">VIR_ERR_AUTH_FAILED</a> = 45 /* authentication failed */
|
||||
<a name="VIR_ERR_INVALID_STORAGE_POOL">VIR_ERR_INVALID_STORAGE_POOL</a> = 46 /* invalid storage pool object */
|
||||
<a name="VIR_ERR_INVALID_STORAGE_VOL">VIR_ERR_INVALID_STORAGE_VOL</a> = 47 /* invalid storage vol object */
|
||||
<a name="VIR_WAR_NO_STORAGE">VIR_WAR_NO_STORAGE</a> = 48 /* failed to start storage */
|
||||
<a name="VIR_ERR_NO_STORAGE_POOL">VIR_ERR_NO_STORAGE_POOL</a> = 49 /* storage pool not found */
|
||||
<a name="VIR_ERR_NO_STORAGE_VOL">VIR_ERR_NO_STORAGE_VOL</a> = 50 /* storage pool not found */
|
||||
<a name="VIR_WAR_NO_NODE">VIR_WAR_NO_NODE</a> = 51 /* failed to start node driver */
|
||||
<a name="VIR_ERR_INVALID_NODE_DEVICE">VIR_ERR_INVALID_NODE_DEVICE</a> = 52 /* invalid node device object */
|
||||
<a name="VIR_ERR_NO_NODE_DEVICE">VIR_ERR_NO_NODE_DEVICE</a> = 53 /* node device not found */
|
||||
<a name="VIR_ERR_NO_SECURITY_MODEL">VIR_ERR_NO_SECURITY_MODEL</a> = 54 /* security model not found */
|
||||
<a name="VIR_ERR_OPERATION_INVALID">VIR_ERR_OPERATION_INVALID</a> = 55 /* operation is not applicable at this time */
|
||||
<a name="VIR_WAR_NO_INTERFACE">VIR_WAR_NO_INTERFACE</a> = 56 /* failed to start interface driver */
|
||||
<a name="VIR_ERR_NO_INTERFACE">VIR_ERR_NO_INTERFACE</a> = 57 /* interface driver not running */
|
||||
<a name="VIR_ERR_INVALID_INTERFACE">VIR_ERR_INVALID_INTERFACE</a> = 58 /* invalid interface object */
|
||||
<a name="VIR_ERR_MULTIPLE_INTERFACES">VIR_ERR_MULTIPLE_INTERFACES</a> = 59 /* more than one matching interface found */
|
||||
};
|
||||
</pre><p/>
|
||||
</div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virErrorPtr">Typedef </a>virErrorPtr</h3><pre class="programlisting"><a href="libvirt-virterror.html#virError">virError</a> * virErrorPtr;
|
||||
</pre><p/>
|
||||
</div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virErrorFunc"/>Function type virErrorFunc</h3><pre class="programlisting">void virErrorFunc (void * userData, <br/> <a href="libvirt-virterror.html#virErrorPtr">virErrorPtr</a> error)<br/>
|
||||
</pre><p>Signature of a function to use when there is an error raised by the library.</p>
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>userData</tt></i>:</span></td><td>user provided data for the error callback</td></tr><tr><td><span class="term"><i><tt>error</tt></i>:</span></td><td>the error being raised.</td></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virConnCopyLastError"/>virConnCopyLastError ()</h3><pre class="programlisting">int virConnCopyLastError (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> <a href="libvirt-virterror.html#virErrorPtr">virErrorPtr</a> to)<br/>
|
||||
</pre><p>Copy the content of the last error caught on that connection This method is not protected against access from multiple threads. In a multi-threaded application, always use the global virGetLastError() API which is backed by thread local storage. If the connection object was discovered to be invalid by an API call, then the error will be reported against the global error object. Since 0.6.0, all errors reported in the per-connection object are also duplicated in the global error object. As such an application can always use virGetLastError(). This method remains for backwards compatability. One will need to free the result with virResetError()</p>
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>to</tt></i>:</span></td><td>target to receive the copy</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if no error was found and the error code otherwise and -1 in case of parameter error.</td></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virConnGetLastError"/>virConnGetLastError ()</h3><pre class="programlisting"><a href="libvirt-virterror.html#virErrorPtr">virErrorPtr</a> virConnGetLastError (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)<br/>
|
||||
</pre><p>Provide a pointer to the last error caught on that connection This method is not protected against access from multiple threads. In a multi-threaded application, always use the global virGetLastError() API which is backed by thread local storage. If the connection object was discovered to be invalid by an API call, then the error will be reported against the global error object. Since 0.6.0, all errors reported in the per-connection object are also duplicated in the global error object. As such an application can always use virGetLastError(). This method remains for backwards compatability.</p>
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the last error or NULL if none occurred.</td></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virConnResetLastError"/>virConnResetLastError ()</h3><pre class="programlisting">void virConnResetLastError (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)<br/>
|
||||
</pre><p>The error object is kept in thread local storage, so separate threads can safely access this concurrently. Reset the last error caught on that connection</p>
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virConnSetErrorFunc"/>virConnSetErrorFunc ()</h3><pre class="programlisting">void virConnSetErrorFunc (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> void * userData, <br/> <a href="libvirt-virterror.html#virErrorFunc">virErrorFunc</a> handler)<br/>
|
||||
</pre><p>Set a connection error handling function, if @handler is NULL it will reset to default which is to pass error back to the global library handler.</p>
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>userData</tt></i>:</span></td><td>pointer to the user data provided in the handler callback</td></tr><tr><td><span class="term"><i><tt>handler</tt></i>:</span></td><td>the function to get called in case of error or NULL</td></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virCopyLastError"/>virCopyLastError ()</h3><pre class="programlisting">int virCopyLastError (<a href="libvirt-virterror.html#virErrorPtr">virErrorPtr</a> to)<br/>
|
||||
</pre><p>Copy the content of the last error caught at the library level The error object is kept in thread local storage, so separate threads can safely access this concurrently. One will need to free the result with virResetError()</p>
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>to</tt></i>:</span></td><td>target to receive the copy</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if no error was found and the error code otherwise and -1 in case of parameter error.</td></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virDefaultErrorFunc"/>virDefaultErrorFunc ()</h3><pre class="programlisting">void virDefaultErrorFunc (<a href="libvirt-virterror.html#virErrorPtr">virErrorPtr</a> err)<br/>
|
||||
</pre><p>Default routine reporting an error to stderr.</p>
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>err</tt></i>:</span></td><td>pointer to the error.</td></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virFreeError"/>virFreeError ()</h3><pre class="programlisting">void virFreeError (<a href="libvirt-virterror.html#virErrorPtr">virErrorPtr</a> err)<br/>
|
||||
</pre><p>Resets and frees the given error.</p>
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>err</tt></i>:</span></td><td>error to free</td></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virGetLastError"/>virGetLastError ()</h3><pre class="programlisting"><a href="libvirt-virterror.html#virErrorPtr">virErrorPtr</a> virGetLastError (void)<br/>
|
||||
</pre><p>Provide a pointer to the last error caught at the library level The error object is kept in thread local storage, so separate threads can safely access this concurrently.</p>
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the last error or NULL if none occurred.</td></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virResetError"/>virResetError ()</h3><pre class="programlisting">void virResetError (<a href="libvirt-virterror.html#virErrorPtr">virErrorPtr</a> err)<br/>
|
||||
</pre><p>Reset the error being pointed to</p>
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>err</tt></i>:</span></td><td>pointer to the <a href="libvirt-virterror.html#virError">virError</a> to clean up</td></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virResetLastError"/>virResetLastError ()</h3><pre class="programlisting">void virResetLastError (void)<br/>
|
||||
</pre><p>Reset the last error caught at the library level. The error object is kept in thread local storage, so separate threads can safely access this concurrently, only resetting their own error object.</p>
|
||||
</div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virSaveLastError"/>virSaveLastError ()</h3><pre class="programlisting"><a href="libvirt-virterror.html#virErrorPtr">virErrorPtr</a> virSaveLastError (void)<br/>
|
||||
</pre><p>Save the last error into a new error object.</p>
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the copied error or NULL if allocation failed. It is the caller's responsibility to free the error with virFreeError().</td></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virSetErrorFunc"/>virSetErrorFunc ()</h3><pre class="programlisting">void virSetErrorFunc (void * userData, <br/> <a href="libvirt-virterror.html#virErrorFunc">virErrorFunc</a> handler)<br/>
|
||||
</pre><p>Set a library global error handling function, if @handler is NULL, it will reset to default printing on stderr. The error raised there are those for which no handler at the connection level could caught.</p>
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>userData</tt></i>:</span></td><td>pointer to the user data provided in the handler callback</td></tr><tr><td><span class="term"><i><tt>handler</tt></i>:</span></td><td>the function to get called in case of error or NULL</td></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
107
docs/docs.html
107
docs/docs.html
@ -1,107 +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 docs.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: Documentation</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>
|
||||
<span class="active">Documentation</span>
|
||||
<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>
|
||||
<a title="Bindings of the libvirt API for other languages" class="inactive" href="bindings.html">Language bindings</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Working on the internals of libvirt API, driver and daemon code" class="inactive" href="internals.html">Internals</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>Documentation</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,148 +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 downloads.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: Downloads</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>
|
||||
<span class="active">Downloads</span>
|
||||
</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>Downloads</h1>
|
||||
<h2>Official Releases</h2>
|
||||
<p>
|
||||
The latest versions of the libvirt C library can be downloaded from:
|
||||
</p>
|
||||
<ul><li><a href="ftp://libvirt.org/libvirt/">libvirt.org FTP server</a></li><li><a href="http://libvirt.org/sources/">libvirt.org HTTP server</a></li></ul>
|
||||
<h2>Hourly development snapshots</h2>
|
||||
<p>
|
||||
Once an hour, an automated snapshot is made from the git server
|
||||
source tree. These snapshots should be usable, but we make no guarantees
|
||||
about their stability:
|
||||
</p>
|
||||
<ul><li><a href="ftp://libvirt.org/libvirt/libvirt-git-snapshot.tar.gz">libvirt.org FTP server</a></li><li><a href="http://libvirt.org/sources/libvirt-git-snapshot.tar.gz">libvirt.org HTTP server</a></li></ul>
|
||||
<h2>GIT source repository</h2>
|
||||
<p> Libvirt code source is now maintained in a <a href="http://git-scm.com/">git</a> repository available on
|
||||
<a href="http://libvirt.org/git/">libvirt.org</a>:
|
||||
</p>
|
||||
<pre>
|
||||
|
||||
git clone git://libvirt.org/libvirt.git
|
||||
</pre>
|
||||
<p>
|
||||
It can also be browsed at
|
||||
</p>
|
||||
<pre>
|
||||
|
||||
<a href="http://libvirt.org/git/?p=libvirt.git;a=summary">http://libvirt.org/git/?p=libvirt.git;a=summary</a>
|
||||
</pre>
|
||||
<h2>CVS repository access (Deprecated) </h2>
|
||||
<p>
|
||||
The master source repository used to be under <a href="http://ximbiot.com/cvs/cvshome/docs/">CVS</a>
|
||||
with anonymous access at:
|
||||
</p>
|
||||
<pre>
|
||||
|
||||
# cvs -d :pserver:anoncvs@libvirt.org:2401/data/cvs co libvirt
|
||||
</pre>
|
||||
<p> The server is maintainened temporarilly for existing uses, but all
|
||||
changes are only commited to git now and we expect to deprecate the CVS
|
||||
server during summer 2009. </p>
|
||||
<h2>Building from a source code checkout</h2>
|
||||
<p> The libvirt build process uses GNU autotools, so after obtaining a
|
||||
checkout it is necessary to generate the configure script and Makefile.in
|
||||
templates using the <code>autogen.sh</code> command, passing the extra
|
||||
arguments as as for configure. As an example, to do a complete build and
|
||||
install it into your home directory run:</p>
|
||||
<pre>
|
||||
|
||||
./autogen.sh --prefix=$HOME/usr
|
||||
make
|
||||
make install
|
||||
</pre>
|
||||
<h2>GIT repository mirror</h2>
|
||||
<p>
|
||||
Jim Mereying was maintaining a CVS to git mirror on
|
||||
<a href="http://git.et.redhat.com/?p=libvirt.git">git.et.redhat.com</a>.
|
||||
Existing users should migrate to the new libvirt.org git server, as the
|
||||
old one is now deprecated. For the sake of old links including now-
|
||||
rewritten SHA1s, we'll leave the old repository on-line for some time.
|
||||
It is available as:
|
||||
</p>
|
||||
<pre>
|
||||
|
||||
git clone git://git.et.redhat.com/libvirt.git
|
||||
</pre>
|
||||
<p>
|
||||
It can also be browsed at
|
||||
</p>
|
||||
<pre>
|
||||
<a href="http://git.et.redhat.com/?p=libvirt.git;a=summary">http://git.et.redhat.com/?p=libvirt.git;a=summary</a>
|
||||
</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>
|
@ -60,7 +60,7 @@
|
||||
<p> The libvirt build process uses GNU autotools, so after obtaining a
|
||||
checkout it is necessary to generate the configure script and Makefile.in
|
||||
templates using the <code>autogen.sh</code> command, passing the extra
|
||||
arguments as as for configure. As an example, to do a complete build and
|
||||
arguments as for configure. As an example, to do a complete build and
|
||||
install it into your home directory run:</p>
|
||||
<pre>
|
||||
|
||||
|
@ -1,160 +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 drivers.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: Internal drivers</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>
|
||||
<span class="active">Drivers</span>
|
||||
<ul class="l2"><li>
|
||||
<div>
|
||||
<a title="Driver the Xen hypervisor" class="inactive" href="drvxen.html">Xen</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for QEMU, KQEMU, KVM and Xenner" class="inactive" href="drvqemu.html">QEMU / KVM</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the Linux native container API" class="inactive" href="drvlxc.html">Linux Container</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Psuedo-driver simulating APIs in memory for test suites" class="inactive" href="drvtest.html">Test</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver providing secure remote to the libvirt APIs" class="inactive" href="drvremote.html">Remote</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the OpenVZ container technology" class="inactive" href="drvopenvz.html">OpenVZ</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the User Mode Linux technology" class="inactive" href="drvuml.html">UML</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the storage management APIs" class="inactive" href="storage.html">Storage</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for VirtualBox" class="inactive" href="drvvbox.html">VirtualBox</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for OpenNebula" class="inactive" href="drvone.html">OpenNebula</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</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><li>
|
||||
<div>
|
||||
<a title="Working on the internals of libvirt API, driver and daemon code" class="inactive" href="internals.html">Internals</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>Internal drivers</h1>
|
||||
<p>
|
||||
The libvirt public API delegates its implementation to one or
|
||||
more internal drivers, depending on the <a href="uri.html">connection URI</a>
|
||||
passed when initializing the library. There is always a hypervisor driver
|
||||
active, and if the libvirt daemon is available there will usually be a
|
||||
network and storage driver active.
|
||||
</p>
|
||||
<h2>Hypervisor drivers</h2>
|
||||
<p>
|
||||
The hypervisor drivers currently supported by libvirt are:
|
||||
</p>
|
||||
<ul><li><strong><a href="drvxen.html">Xen</a></strong></li><li><strong><a href="drvqemu.html">QEMU</a></strong></li><li><strong><a href="drvlxc.html">LXC</a></strong></li><li><strong><a href="drvtest.html">Test</a></strong></li><li><strong><a href="drvopenvz.html">OpenVZ</a></strong></li><li><strong><a href="drvvbox.html">VirtualBox</a></strong></li><li><strong><a href="drvone.html">OpenNebula</a></strong></li></ul>
|
||||
</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>
|
@ -24,6 +24,7 @@
|
||||
<li><strong><a href="drvopenvz.html">OpenVZ</a></strong></li>
|
||||
<li><strong><a href="drvvbox.html">VirtualBox</a></strong></li>
|
||||
<li><strong><a href="drvone.html">OpenNebula</a></strong></li>
|
||||
<li><strong><a href="drvesx.html">VMware ESX</a></strong></li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
||||
|
497
docs/drvesx.html.in
Normal file
497
docs/drvesx.html.in
Normal file
@ -0,0 +1,497 @@
|
||||
<html><body>
|
||||
<h1>VMware ESX hypervisor driver</h1>
|
||||
<ul id="toc"></ul>
|
||||
<p>
|
||||
The libvirt VMware ESX driver can manage VMware ESX/ESXi 3.5/4.0 and
|
||||
VMware GSX 2.0, also called VMware Server 2.0, and possibly later
|
||||
versions.
|
||||
</p>
|
||||
|
||||
|
||||
<h2><a name="prereq">Deployment pre-requisites</a></h2>
|
||||
<p>
|
||||
None. Any out-of-the-box installation of ESX/GSX should work. No
|
||||
preparations are required on the server side, no libvirtd must be
|
||||
installed on the ESX server. The driver uses version 2.5 of the remote,
|
||||
SOAP based
|
||||
<a href="http://www.vmware.com/support/developer/vc-sdk/visdk25pubs/ReferenceGuide/">
|
||||
VMware Virtual Infrastructure API</a> to communicate with the
|
||||
ESX server, like the VMware Virtual Infrastructure Client does. Since
|
||||
version 4.0 this API is called
|
||||
<a href="http://www.vmware.com/support/developer/vc-sdk/visdk400pubs/ReferenceGuide/">
|
||||
VMware vSphere API</a>.
|
||||
</p>
|
||||
|
||||
<h2><a name="uri">Connections to the VMware ESX driver</a></h2>
|
||||
<p>
|
||||
Some example remote connection URIs for the driver are:
|
||||
</p>
|
||||
<pre>
|
||||
esx://example.com (ESX over HTTPS)
|
||||
gsx://example.com (GSX over HTTPS)
|
||||
esx://example.com/?transport=http (ESX over HTTP)
|
||||
esx://example.com/?no_verify=1 (ESX over HTTPS, but doesn't verify the server's SSL certificate)
|
||||
</pre>
|
||||
|
||||
|
||||
<h3><a name="uriformat">URI Format</a></h3>
|
||||
<p>
|
||||
URIs have this general form ('[...]' marks an optional part).
|
||||
</p>
|
||||
<pre>
|
||||
type://[username@]hostname[:port]/[?extraparameters]
|
||||
</pre>
|
||||
<p>
|
||||
The <code>type://</code> is either <code>esx://</code> or
|
||||
<code>gsx://</code> and the driver selects the default port depending
|
||||
on it. For ESX the default HTTPS port is 443, for GSX it is 8333. If
|
||||
the port parameter is given, it overrides the default port.
|
||||
</p>
|
||||
|
||||
|
||||
<h4>Extra parameters</h4>
|
||||
<p>
|
||||
Extra parameters can be added to a URI as part of the query string
|
||||
(the part following '?'). The driver understands the extra parameters
|
||||
shown below.
|
||||
</p>
|
||||
<table class="top_table">
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Values</th>
|
||||
<th>Meaning</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>transport</code>
|
||||
</td>
|
||||
<td>
|
||||
<code>http</code> or <code>https</code>
|
||||
</td>
|
||||
<td>
|
||||
Overrides the default HTTPS transport. For ESX the default
|
||||
HTTP port is 80, for GSX it is 8222.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>vcenter</code>
|
||||
</td>
|
||||
<td>
|
||||
Hostname of a VMware vCenter
|
||||
</td>
|
||||
<td>
|
||||
In order to perform a migration the driver needs to know the
|
||||
VMware vCenter for the ESX server.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>no_verify</code>
|
||||
</td>
|
||||
<td>
|
||||
<code>0</code> or <code>1</code>
|
||||
</td>
|
||||
<td>
|
||||
If set to 1, this disables libcurl client checks of the server's
|
||||
SSL certificate. The default value it 0.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
<h3><a name="auth">Authentication</a></h3>
|
||||
<p>
|
||||
In order to perform any useful operation the driver needs to log into
|
||||
the ESX server. Therefore, only <code>virConnectOpenAuth</code> can be
|
||||
used to connect to an ESX server, <code>virConnectOpen</code> and
|
||||
<code>virConnectOpenReadOnly</code> don't work.
|
||||
To log into an ESX server or vCenter the driver will request
|
||||
credentials using the callback passed to the
|
||||
<code>virConnectOpenAuth</code> function. The driver passes the
|
||||
hostname as challenge parameter to the callback. This enables the
|
||||
callback to distinguish between requests for ESX server and vCenter.
|
||||
</p>
|
||||
<p>
|
||||
<strong>Note</strong>: During the ongoing driver development, testing
|
||||
is done using an unrestricted <code>root</code> account. Problems may
|
||||
occur if you use a restricted account. Detailed testing with restricted
|
||||
accounts has not been done yet.
|
||||
</p>
|
||||
|
||||
|
||||
<h2><a name="xmlspecial">Specialties in the domain XML config</a></h2>
|
||||
<p>
|
||||
There are several specialties in the domain XML config for ESX domains.
|
||||
</p>
|
||||
|
||||
<h3>Restrictions</h3>
|
||||
<p>
|
||||
There are some restrictions for some values of the domain XML config.
|
||||
The driver will complain if this restrictions are violated.
|
||||
</p>
|
||||
<ul>
|
||||
<li>
|
||||
Memory size has to be a multiple of 4096
|
||||
</li>
|
||||
<li>
|
||||
Number of virtual CPU has to be 1 or a multiple of 2
|
||||
</li>
|
||||
<li>
|
||||
Valid MAC address prefixes are <code>00:0c:29</code> and
|
||||
<code>00:50:56</code>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h3>Datastore references</h3>
|
||||
<p>
|
||||
Storage is managed in datastores. VMware uses a special path format to
|
||||
reference files in a datastore. Basically, the datastore name is put
|
||||
into squared braces in front of the path.
|
||||
</p>
|
||||
<pre>
|
||||
[datastore] directory/filename
|
||||
</pre>
|
||||
<p>
|
||||
To define a new domain the driver converts the domain XML into a
|
||||
VMware VMX file and uploads it to a datastore known to the ESX server.
|
||||
Because multiple datastores may be known to an ESX server the driver
|
||||
needs to decide to which datastores the VMX file should be uploaded.
|
||||
The driver deduces this information from the path of the source of the
|
||||
first file-based harddisk listed in the domain XML.
|
||||
</p>
|
||||
|
||||
|
||||
<h3>Available hardware</h3>
|
||||
<p>
|
||||
VMware ESX supports different models of SCSI controllers and network
|
||||
cards.
|
||||
</p>
|
||||
|
||||
<h4>SCSI controller models</h4>
|
||||
<dl>
|
||||
<dt><code>buslogic</code></dt>
|
||||
<dd>
|
||||
BusLogic SCSI controller for older guests.
|
||||
</dd>
|
||||
<dt><code>lsilogic</code></dt>
|
||||
<dd>
|
||||
LSI Logic SCSI controller for recent guests.
|
||||
</dd>
|
||||
</dl>
|
||||
<p>
|
||||
Here a domain XML snippet:
|
||||
</p>
|
||||
<pre>
|
||||
...
|
||||
<disk type='file' device='disk'>
|
||||
<driver name='<strong>lsilogic</strong>'/>
|
||||
<source file='[local-storage] Fedora11/Fedora11.vmdk'/>
|
||||
<target dev='sda' bus='scsi'/>
|
||||
</disk>
|
||||
...
|
||||
</pre>
|
||||
|
||||
|
||||
<h4>Network card models</h4>
|
||||
<dl>
|
||||
<dt><code>vlance</code></dt>
|
||||
<dd>
|
||||
AMD PCnet32 network card for older guests.
|
||||
</dd>
|
||||
<dt><code>vmxnet</code>, <code>vmxnet3</code></dt>
|
||||
<dd>
|
||||
Special VMware VMXnet network card, requires VMware tools inside
|
||||
the guest.
|
||||
</dd>
|
||||
<dt><code>e1000</code></dt>
|
||||
<dd>
|
||||
Intel E1000 network card for recent guests.
|
||||
</dd>
|
||||
</dl>
|
||||
<p>
|
||||
Here a domain XML snippet:
|
||||
</p>
|
||||
<pre>
|
||||
...
|
||||
<interface type='bridge'>
|
||||
<mac address='00:50:56:25:48:c7'/>
|
||||
<source bridge='VM Network'/>
|
||||
<model type='<strong>e1000</strong>'/>
|
||||
</interface>
|
||||
...
|
||||
</pre>
|
||||
|
||||
|
||||
<h2><a name="importexport">Import and export of domain XML configs</a></h2>
|
||||
<p>
|
||||
The ESX driver currently supports a native config format known as
|
||||
<code>vmware-vmx</code> to handle VMware VMX configs.
|
||||
</p>
|
||||
|
||||
|
||||
<h3><a name="xmlimport">Converting from VMware VMX config to domain XML config</a></h3>
|
||||
<p>
|
||||
The <code>virsh domxml-from-native</code> provides a way to convert an
|
||||
existing VMware VMX config into a domain XML config that can then be
|
||||
used by libvirt.
|
||||
</p>
|
||||
<pre>
|
||||
$ cat > demo.vmx << EOF
|
||||
#!/usr/bin/vmware
|
||||
config.version = "8"
|
||||
virtualHW.version = "4"
|
||||
floppy0.present = "false"
|
||||
nvram = "Fedora11.nvram"
|
||||
deploymentPlatform = "windows"
|
||||
virtualHW.productCompatibility = "hosted"
|
||||
tools.upgrade.policy = "useGlobal"
|
||||
powerType.powerOff = "default"
|
||||
powerType.powerOn = "default"
|
||||
powerType.suspend = "default"
|
||||
powerType.reset = "default"
|
||||
displayName = "Fedora11"
|
||||
extendedConfigFile = "Fedora11.vmxf"
|
||||
scsi0.present = "true"
|
||||
scsi0.sharedBus = "none"
|
||||
scsi0.virtualDev = "lsilogic"
|
||||
memsize = "1024"
|
||||
scsi0:0.present = "true"
|
||||
scsi0:0.fileName = "/vmfs/volumes/498076b2-02796c1a-ef5b-000ae484a6a3/Fedora11/Fedora11.vmdk"
|
||||
scsi0:0.deviceType = "scsi-hardDisk"
|
||||
ide0:0.present = "true"
|
||||
ide0:0.clientDevice = "true"
|
||||
ide0:0.deviceType = "cdrom-raw"
|
||||
ide0:0.startConnected = "false"
|
||||
ethernet0.present = "true"
|
||||
ethernet0.networkName = "VM Network"
|
||||
ethernet0.addressType = "vpx"
|
||||
ethernet0.address = "00:50:56:91:48:c7"
|
||||
chipset.onlineStandby = "false"
|
||||
guestOSAltName = "Red Hat Enterprise Linux 5 (32-Bit)"
|
||||
guestOS = "rhel5"
|
||||
uuid.bios = "50 11 5e 16 9b dc 49 d7-f1 71 53 c4 d7 f9 17 10"
|
||||
snapshot.action = "keep"
|
||||
sched.cpu.min = "0"
|
||||
sched.cpu.units = "mhz"
|
||||
sched.cpu.shares = "normal"
|
||||
sched.mem.minsize = "0"
|
||||
sched.mem.shares = "normal"
|
||||
toolScripts.afterPowerOn = "true"
|
||||
toolScripts.afterResume = "true"
|
||||
toolScripts.beforeSuspend = "true"
|
||||
toolScripts.beforePowerOff = "true"
|
||||
scsi0:0.redo = ""
|
||||
tools.syncTime = "false"
|
||||
uuid.location = "56 4d b5 06 a2 bd fb eb-ae 86 f7 d8 49 27 d0 c4"
|
||||
sched.cpu.max = "unlimited"
|
||||
sched.swap.derivedName = "/vmfs/volumes/498076b2-02796c1a-ef5b-000ae484a6a3/Fedora11/Fedora11-7de040d8.vswp"
|
||||
tools.remindInstall = "TRUE"
|
||||
EOF
|
||||
|
||||
$ virsh -c esx://example.com domxml-from-native vmware-vmx demo.vmx
|
||||
Enter username for example.com [root]:
|
||||
Enter root password for example.com:
|
||||
<domain type='vmware'>
|
||||
<name>Fedora11</name>
|
||||
<uuid>50115e16-9bdc-49d7-f171-53c4d7f91710</uuid>
|
||||
<memory>1048576</memory>
|
||||
<currentMemory>1048576</currentMemory>
|
||||
<vcpu>1</vcpu>
|
||||
<os>
|
||||
<type arch='i686'>hvm</type>
|
||||
</os>
|
||||
<clock offset='utc'/>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
<on_reboot>restart</on_reboot>
|
||||
<on_crash>destroy</on_crash>
|
||||
<devices>
|
||||
<disk type='file' device='disk'>
|
||||
<driver name='lsilogic'/>
|
||||
<source file='[local-storage] Fedora11/Fedora11.vmdk'/>
|
||||
<target dev='sda' bus='scsi'/>
|
||||
</disk>
|
||||
<interface type='bridge'>
|
||||
<mac address='00:50:56:91:48:c7'/>
|
||||
<source bridge='VM Network'/>
|
||||
</interface>
|
||||
</devices>
|
||||
</domain>
|
||||
</pre>
|
||||
|
||||
|
||||
<h3><a name="xmlexport">Converting from domain XML config to VMware VMX config</a></h3>
|
||||
<p>
|
||||
The <code>virsh domxml-to-native</code> provides a way to convert a
|
||||
domain XML config into a VMware VMX config.
|
||||
</p>
|
||||
<pre>
|
||||
$ cat > demo.xml << EOF
|
||||
<domain type='vmware'>
|
||||
<name>Fedora11</name>
|
||||
<uuid>50115e16-9bdc-49d7-f171-53c4d7f91710</uuid>
|
||||
<memory>1048576</memory>
|
||||
<currentMemory>1048576</currentMemory>
|
||||
<vcpu>1</vcpu>
|
||||
<os>
|
||||
<type arch='x86_64'>hvm</type>
|
||||
</os>
|
||||
<devices>
|
||||
<disk type='file' device='disk'>
|
||||
<driver name='lsilogic'/>
|
||||
<source file='[local-storage] Fedora11/Fedora11.vmdk'/>
|
||||
<target dev='sda' bus='scsi'/>
|
||||
</disk>
|
||||
<interface type='bridge'>
|
||||
<mac address='00:50:56:25:48:c7'/>
|
||||
<source bridge='VM Network'/>
|
||||
</interface>
|
||||
</devices>
|
||||
</domain>
|
||||
EOF
|
||||
|
||||
$ virsh -c esx://example.com domxml-to-native vmware-vmx demo.xml
|
||||
Enter username for example.com [root]:
|
||||
Enter root password for example.com:
|
||||
config.version = "8"
|
||||
virtualHW.version = "4"
|
||||
guestOS = "other-64"
|
||||
uuid.bios = "50 11 5e 16 9b dc 49 d7-f1 71 53 c4 d7 f9 17 10"
|
||||
displayName = "Fedora11"
|
||||
memsize = "1024"
|
||||
numvcpus = "1"
|
||||
scsi0.present = "true"
|
||||
scsi0.virtualDev = "lsilogic"
|
||||
scsi0:0.present = "true"
|
||||
scsi0:0.deviceType = "scsi-hardDisk"
|
||||
scsi0:0.fileName = "/vmfs/volumes/local-storage/Fedora11/Fedora11.vmdk"
|
||||
ethernet0.present = "true"
|
||||
ethernet0.networkName = "VM Network"
|
||||
ethernet0.connectionType = "bridged"
|
||||
ethernet0.addressType = "static"
|
||||
ethernet0.address = "00:50:56:25:48:C7"
|
||||
</pre>
|
||||
|
||||
|
||||
<h2><a name="xmlconfig">Example domain XML configs</a></h2>
|
||||
|
||||
<h3>Fedora11 on x86_64</h3>
|
||||
<pre>
|
||||
<domain type='vmware'>
|
||||
<name>Fedora11</name>
|
||||
<uuid>50115e16-9bdc-49d7-f171-53c4d7f91710</uuid>
|
||||
<memory>1048576</memory>
|
||||
<currentMemory>1048576</currentMemory>
|
||||
<vcpu>1</vcpu>
|
||||
<os>
|
||||
<type arch='x86_64'>hvm</type>
|
||||
</os>
|
||||
<devices>
|
||||
<disk type='file' device='disk'>
|
||||
<source file='[local-storage] Fedora11/Fedora11.vmdk'/>
|
||||
<target dev='sda' bus='scsi'/>
|
||||
</disk>
|
||||
<interface type='bridge'>
|
||||
<mac address='00:50:56:25:48:c7'/>
|
||||
<source bridge='VM Network'/>
|
||||
</interface>
|
||||
</devices>
|
||||
</domain>
|
||||
</pre>
|
||||
|
||||
|
||||
<h2><a name="migration">Migration</a></h2>
|
||||
<p>
|
||||
A migration cannot be initiated on an ESX server directly, a VMware
|
||||
vCenter is necessary for this. The vCenter hostname has to be passed
|
||||
to the driver via the <code>vcenter</code> query parameter.
|
||||
</p>
|
||||
<pre>
|
||||
esx://example.com/?vcenter=example-vcenter.com
|
||||
</pre>
|
||||
<p>
|
||||
Here an example how to migrate the domain <code>Fedora11</code> from
|
||||
ESX server <code>example-src.com</code> to ESX server
|
||||
<code>example-dst.com</code> involving vCenter
|
||||
<code>example-vcenter.com</code> using <code>virsh</code>.
|
||||
</p>
|
||||
<pre>
|
||||
$ virsh -c esx://example-src.com/?vcenter=example-vcenter.com migrate Fedora11 esx://example-dst.com/?vcenter=example-vcenter.com
|
||||
Enter username for example-src.com [root]:
|
||||
Enter root password for example-src.com:
|
||||
Enter username for example-vcenter.com [administrator]:
|
||||
Enter administrator password for example-vcenter.com:
|
||||
Enter username for example-dst.com [root]:
|
||||
Enter root password for example-dst.com:
|
||||
Enter username for example-vcenter.com [administrator]:
|
||||
Enter administrator password for example-vcenter.com:
|
||||
</pre>
|
||||
|
||||
|
||||
<h2><a name="scheduler">Scheduler configuration</a></h2>
|
||||
<p>
|
||||
The driver exposes the ESX CPU scheduler. The parameters listed below
|
||||
are available to control the scheduler.
|
||||
</p>
|
||||
<dl>
|
||||
<dt><code>reservation</code></dt>
|
||||
<dd>
|
||||
The amount of CPU resource in MHz that is guaranteed to be
|
||||
available to the domain. Valid values are 0 and greater.
|
||||
</dd>
|
||||
<dt><code>limit</code></dt>
|
||||
<dd>
|
||||
The CPU utilization of the domain will be
|
||||
limited to this value in MHz, even if more CPU resources are
|
||||
available. If the limit is set to -1, the CPU utilization of the
|
||||
domain is unlimited. If the limit is not set to -1, it must be
|
||||
greater than or equal to the reservation.
|
||||
</dd>
|
||||
<dt><code>shares</code></dt>
|
||||
<dd>
|
||||
Shares are used to determine relative CPU
|
||||
allocation between domains. In general, a domain with more shares
|
||||
gets proportionally more of the CPU resource. Valid values are 0
|
||||
and greater. The special values -1, -2 and -3 represent the
|
||||
predefined shares level <code>low</code>, <code>normal</code> and
|
||||
<code>high</code>.
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
<h2><a name="tools">VMware tools</a></h2>
|
||||
<p>
|
||||
Some actions require installed VMware tools. If the VMware tools are
|
||||
not installed in the guest and one of the actions below is to be
|
||||
performed the ESX server raises an error and the driver reports it.
|
||||
</p>
|
||||
<ul>
|
||||
<li>
|
||||
<code>virDomainReboot</code>
|
||||
</li>
|
||||
<li>
|
||||
<code>virDomainShutdown</code>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2><a name="links">Links</a></h2>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="http://www.vmware.com/support/developer/vc-sdk/">
|
||||
VMware vSphere Web Services SDK Documentation
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="http://www.vmware.com/pdf/esx3_memory.pdf">
|
||||
The Role of Memory in VMware ESX Server 3
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="http://www.sanbarrow.com/vmx.html">
|
||||
VMware VMX config parameters
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</body></html>
|
223
docs/drvlxc.html
223
docs/drvlxc.html
@ -1,223 +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 drvlxc.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: LXC container driver</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="active" href="drivers.html">Drivers</a>
|
||||
<ul class="l2"><li>
|
||||
<div>
|
||||
<a title="Driver the Xen hypervisor" class="inactive" href="drvxen.html">Xen</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for QEMU, KQEMU, KVM and Xenner" class="inactive" href="drvqemu.html">QEMU / KVM</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<span class="active">Linux Container</span>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Psuedo-driver simulating APIs in memory for test suites" class="inactive" href="drvtest.html">Test</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver providing secure remote to the libvirt APIs" class="inactive" href="drvremote.html">Remote</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the OpenVZ container technology" class="inactive" href="drvopenvz.html">OpenVZ</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the User Mode Linux technology" class="inactive" href="drvuml.html">UML</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the storage management APIs" class="inactive" href="storage.html">Storage</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for VirtualBox" class="inactive" href="drvvbox.html">VirtualBox</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for OpenNebula" class="inactive" href="drvone.html">OpenNebula</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</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><li>
|
||||
<div>
|
||||
<a title="Working on the internals of libvirt API, driver and daemon code" class="inactive" href="internals.html">Internals</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>LXC container driver</h1>
|
||||
<p>
|
||||
The libvirt LXC driver manages "Linux Containers". Containers are sets of processes
|
||||
with private namespaces which can (but don't always) look like separate machines, but
|
||||
do not have their own OS. Here are two example configurations. The first is a very
|
||||
light-weight "application container" which does not have it's own root image. You would
|
||||
start it using
|
||||
</p>
|
||||
<h3>Example config version 1</h3>
|
||||
<p></p>
|
||||
<pre>
|
||||
<domain type='lxc'>
|
||||
<name>vm1</name>
|
||||
<memory>500000</memory>
|
||||
<os>
|
||||
<type>exe</type>
|
||||
<init>/bin/sh</init>
|
||||
</os>
|
||||
<vcpu>1</vcpu>
|
||||
<clock offset='utc'/>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
<on_reboot>restart</on_reboot>
|
||||
<on_crash>destroy</on_crash>
|
||||
<devices>
|
||||
<emulator>/usr/libexec/libvirt_lxc</emulator>
|
||||
<interface type='network'>
|
||||
<source network='default'/>
|
||||
</interface>
|
||||
<console type='pty' />
|
||||
</devices>
|
||||
</domain>
|
||||
</pre>
|
||||
<p>
|
||||
The next example assumes there is a private root filesystem
|
||||
(perhaps hand-crafted using busybox, or installed from media,
|
||||
debootstrap, whatever) under /opt/vm-1-root:
|
||||
</p>
|
||||
<p></p>
|
||||
<pre>
|
||||
<domain type='lxc'>
|
||||
<name>vm1</name>
|
||||
<memory>32768</memory>
|
||||
<os>
|
||||
<type>exe</type>
|
||||
<init>/init</init>
|
||||
</os>
|
||||
<vcpu>1</vcpu>
|
||||
<clock offset='utc'/>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
<on_reboot>restart</on_reboot>
|
||||
<on_crash>destroy</on_crash>
|
||||
<devices>
|
||||
<emulator>/usr/libexec/libvirt_lxc</emulator>
|
||||
<filesystem type='mount'>
|
||||
<source dir='/opt/vm-1-root'/>
|
||||
<target dir='/'/>
|
||||
</filesystem>
|
||||
<interface type='network'>
|
||||
<source network='default'/>
|
||||
</interface>
|
||||
<console type='pty' />
|
||||
</devices>
|
||||
</domain>
|
||||
</pre>
|
||||
<p>
|
||||
In both cases, you can define and start a container using:</p>
|
||||
<pre>
|
||||
virsh --connect lxc:/// define v1.xml
|
||||
virsh --connect lxc:/// start v1.xml
|
||||
</pre>
|
||||
<pre>
|
||||
virsh --connect lxc:/// console v1
|
||||
</pre>
|
||||
<p>Now doing 'ps -ef' will only show processes in the container, for
|
||||
instance.
|
||||
</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>
|
@ -13,24 +13,24 @@ start it using
|
||||
<p></p>
|
||||
<pre>
|
||||
<domain type='lxc'>
|
||||
<name>vm1</name>
|
||||
<memory>500000</memory>
|
||||
<os>
|
||||
<type>exe</type>
|
||||
<init>/bin/sh</init>
|
||||
</os>
|
||||
<vcpu>1</vcpu>
|
||||
<clock offset='utc'/>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
<on_reboot>restart</on_reboot>
|
||||
<on_crash>destroy</on_crash>
|
||||
<devices>
|
||||
<emulator>/usr/libexec/libvirt_lxc</emulator>
|
||||
<interface type='network'>
|
||||
<source network='default'/>
|
||||
</interface>
|
||||
<console type='pty' />
|
||||
</devices>
|
||||
<name>vm1</name>
|
||||
<memory>500000</memory>
|
||||
<os>
|
||||
<type>exe</type>
|
||||
<init>/bin/sh</init>
|
||||
</os>
|
||||
<vcpu>1</vcpu>
|
||||
<clock offset='utc'/>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
<on_reboot>restart</on_reboot>
|
||||
<on_crash>destroy</on_crash>
|
||||
<devices>
|
||||
<emulator>/usr/libexec/libvirt_lxc</emulator>
|
||||
<interface type='network'>
|
||||
<source network='default'/>
|
||||
</interface>
|
||||
<console type='pty' />
|
||||
</devices>
|
||||
</domain>
|
||||
</pre>
|
||||
|
||||
@ -42,28 +42,28 @@ debootstrap, whatever) under /opt/vm-1-root:
|
||||
<p></p>
|
||||
<pre>
|
||||
<domain type='lxc'>
|
||||
<name>vm1</name>
|
||||
<memory>32768</memory>
|
||||
<os>
|
||||
<type>exe</type>
|
||||
<init>/init</init>
|
||||
</os>
|
||||
<vcpu>1</vcpu>
|
||||
<clock offset='utc'/>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
<on_reboot>restart</on_reboot>
|
||||
<on_crash>destroy</on_crash>
|
||||
<devices>
|
||||
<emulator>/usr/libexec/libvirt_lxc</emulator>
|
||||
<filesystem type='mount'>
|
||||
<source dir='/opt/vm-1-root'/>
|
||||
<target dir='/'/>
|
||||
</filesystem>
|
||||
<interface type='network'>
|
||||
<source network='default'/>
|
||||
</interface>
|
||||
<console type='pty' />
|
||||
</devices>
|
||||
<name>vm1</name>
|
||||
<memory>32768</memory>
|
||||
<os>
|
||||
<type>exe</type>
|
||||
<init>/init</init>
|
||||
</os>
|
||||
<vcpu>1</vcpu>
|
||||
<clock offset='utc'/>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
<on_reboot>restart</on_reboot>
|
||||
<on_crash>destroy</on_crash>
|
||||
<devices>
|
||||
<emulator>/usr/libexec/libvirt_lxc</emulator>
|
||||
<filesystem type='mount'>
|
||||
<source dir='/opt/vm-1-root'/>
|
||||
<target dir='/'/>
|
||||
</filesystem>
|
||||
<interface type='network'>
|
||||
<source network='default'/>
|
||||
</interface>
|
||||
<console type='pty' />
|
||||
</devices>
|
||||
</domain>
|
||||
</pre>
|
||||
|
||||
|
234
docs/drvone.html
234
docs/drvone.html
@ -1,234 +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 drvone.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: OpenNebula Virtual Infrastructure Manager driver</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="active" href="drivers.html">Drivers</a>
|
||||
<ul class="l2"><li>
|
||||
<div>
|
||||
<a title="Driver the Xen hypervisor" class="inactive" href="drvxen.html">Xen</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for QEMU, KQEMU, KVM and Xenner" class="inactive" href="drvqemu.html">QEMU / KVM</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the Linux native container API" class="inactive" href="drvlxc.html">Linux Container</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Psuedo-driver simulating APIs in memory for test suites" class="inactive" href="drvtest.html">Test</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver providing secure remote to the libvirt APIs" class="inactive" href="drvremote.html">Remote</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the OpenVZ container technology" class="inactive" href="drvopenvz.html">OpenVZ</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the User Mode Linux technology" class="inactive" href="drvuml.html">UML</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the storage management APIs" class="inactive" href="storage.html">Storage</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for VirtualBox" class="inactive" href="drvvbox.html">VirtualBox</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<span class="active">OpenNebula</span>
|
||||
</div>
|
||||
</li></ul>
|
||||
</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><li>
|
||||
<div>
|
||||
<a title="Working on the internals of libvirt API, driver and daemon code" class="inactive" href="internals.html">Internals</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>OpenNebula Virtual Infrastructure Manager driver</h1>
|
||||
<p><a name="toc" id="toc"></a><a href="http://opennebula.org/">OpenNebula</a>
|
||||
is a Virtual Infrastructure Manager that controls Virtual Machines (VM) in a pool of distributed resources
|
||||
by orchestrating network, storage and virtualization technologies. The OpenNebula driver lets you manage your private or hybrid (<a href="http://aws.amazon.com/ec2/">Amazon EC2</a> or <a href="http://www.elastichosts.com/">Elastic Hosts</a> based) cloud using a standard libvirt interface, including the API as well as the related
|
||||
tools and VM description files.</p>
|
||||
<h2>
|
||||
<a name="prereq" id="prereq"></a>Deployment pre-requisites</h2>
|
||||
<ul><li>
|
||||
<p style="margin-bottom: 0in">A working OpenNebula installation,
|
||||
version 1.2 or higher.
|
||||
</p>
|
||||
</li></ul>
|
||||
<h2>
|
||||
<a name="uris" id="uris"></a>Connections to OpenNebula driver</h2>
|
||||
<p>The Uri of the driver protocol is "one". Some example
|
||||
connection Uris for the driver are:
|
||||
</p>
|
||||
<pre> one:/// (local access)
|
||||
one+unix:/// (local access)
|
||||
one://example.com/ (remote access)
|
||||
one+tcp://example.com/ (remote access, SASl/Kerberos)
|
||||
one+ssh://user@example.com/ (remote access, SSH tunnelled)
|
||||
</pre>
|
||||
<h2>
|
||||
<a name="xmlconfig" id="xmlconfig"></a>Example domain XML config</h2>
|
||||
<p>There are some limitations on the XML attributes that may be
|
||||
specified when interfacing OpenNebula. The following xml example
|
||||
details the attributes and options supported by the OpenNebula
|
||||
driver:</p>
|
||||
<h3>Paravirtualized guest direct kernel boot
|
||||
</h3>
|
||||
<pre> <domain type='one'>
|
||||
<name>vm01</name>
|
||||
<memory>32768</memory>
|
||||
<vcpu>1</vcpu>
|
||||
|
||||
<os>
|
||||
<type>linux</type>
|
||||
<kernel>/boot/vmlinuz-2.6.24-17-xen</kernel>
|
||||
<initrd>/boot/initrd.img-2.6.24-17-xen</initrd>
|
||||
<cmdline></cmdline>
|
||||
<root>sda1</root>
|
||||
</os>
|
||||
|
||||
<devices>
|
||||
|
||||
<disk type='file' device='disk'>
|
||||
<source file='/images/sgehosts/01/disk.img'/>
|
||||
<target dev='sda1'/>
|
||||
</disk>
|
||||
|
||||
<disk type='file' device='disk'>
|
||||
<source file='/images/sgehosts/01/swap.img'/>
|
||||
<target dev='sda2'/>
|
||||
</disk>
|
||||
|
||||
<disk type='file' device='cdrom'>
|
||||
<source file='/images/iso/cdrom.iso'/>
|
||||
<target dev='hdc'/>
|
||||
<readonly/>
|
||||
</disk>
|
||||
|
||||
|
||||
<!--BRIDGE-->
|
||||
<interface type='bridge'>
|
||||
<source bridge='eth0'/>
|
||||
<mac address='00:16:3e:5d:c7:9e'/>
|
||||
</interface>
|
||||
|
||||
<!--ONE Network-->
|
||||
<interface type='network'>
|
||||
<source network='onenetwork'/>
|
||||
</interface>
|
||||
</devices>
|
||||
</domain>
|
||||
</pre>
|
||||
<p>
|
||||
<b>Note:</b> The "<interface type='network'>" will
|
||||
attach the interface to a previously configured network (named
|
||||
<tt>onenetwork</tt>) within the <a href="http://opennebula.org/">OpenNebula</a> system, typically with the
|
||||
<tt>onevnet</tt> CLI command.</p>
|
||||
<p><b>Note</b>: OpenNebula supports the simultaneous use of different hypervisors, so you can specify any os type (linux or hvm) supported by your cluster.
|
||||
</p>
|
||||
<h2>Links</h2>
|
||||
<ul><li><a href="http://www.opennebula.org/doku.php?id=documentation">OpenNebula Documentation</a>
|
||||
</li><li><a href="http://www.opennebula.org/doku.php?id=documentation:rel1.2:ug">OpenNebula User Guide</a>
|
||||
</li></ul>
|
||||
</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>
|
@ -18,82 +18,83 @@ tools and VM description files.</p>
|
||||
<ul>
|
||||
<li>
|
||||
<p style="margin-bottom: 0in">A working OpenNebula installation,
|
||||
version 1.2 or higher.
|
||||
</p>
|
||||
</li>
|
||||
version 1.2 or higher.
|
||||
</p>
|
||||
</li>
|
||||
</ul>
|
||||
<h2>
|
||||
<a name="uris"></a>Connections to OpenNebula driver</h2>
|
||||
<p>The Uri of the driver protocol is "one". Some example
|
||||
connection Uris for the driver are:
|
||||
</p>
|
||||
<pre> one:/// (local access)
|
||||
one+unix:/// (local access)
|
||||
one://example.com/ (remote access)
|
||||
one+tcp://example.com/ (remote access, SASl/Kerberos)
|
||||
one+ssh://user@example.com/ (remote access, SSH tunnelled)
|
||||
</pre>
|
||||
<pre>
|
||||
one:/// (local access)
|
||||
one+unix:/// (local access)
|
||||
one://example.com/ (remote access)
|
||||
one+tcp://example.com/ (remote access, SASl/Kerberos)
|
||||
one+ssh://user@example.com/ (remote access, SSH tunnelled)
|
||||
</pre>
|
||||
<h2>
|
||||
<a name="xmlconfig"></a>Example domain XML config</h2>
|
||||
<p>There are some limitations on the XML attributes that may be
|
||||
specified when interfacing OpenNebula. The following xml example
|
||||
details the attributes and options supported by the OpenNebula
|
||||
driver:</p>
|
||||
driver:</p>
|
||||
|
||||
<h3>Paravirtualized guest direct kernel boot
|
||||
<h3>Paravirtualized guest direct kernel boot
|
||||
</h3>
|
||||
<pre> <domain type='one'>
|
||||
<name>vm01</name>
|
||||
<memory>32768</memory>
|
||||
<vcpu>1</vcpu>
|
||||
<pre>
|
||||
<domain type='one'>
|
||||
<name>vm01</name>
|
||||
<memory>32768</memory>
|
||||
<vcpu>1</vcpu>
|
||||
|
||||
<os>
|
||||
<type>linux</type>
|
||||
<kernel>/boot/vmlinuz-2.6.24-17-xen</kernel>
|
||||
<initrd>/boot/initrd.img-2.6.24-17-xen</initrd>
|
||||
<cmdline></cmdline>
|
||||
<root>sda1</root>
|
||||
</os>
|
||||
<os>
|
||||
<type>linux</type>
|
||||
<kernel>/boot/vmlinuz-2.6.24-17-xen</kernel>
|
||||
<initrd>/boot/initrd.img-2.6.24-17-xen</initrd>
|
||||
<cmdline></cmdline>
|
||||
<root>sda1</root>
|
||||
</os>
|
||||
|
||||
<devices>
|
||||
<devices>
|
||||
<disk type='file' device='disk'>
|
||||
<source file='/images/sgehosts/01/disk.img'/>
|
||||
<target dev='sda1'/>
|
||||
</disk>
|
||||
|
||||
<disk type='file' device='disk'>
|
||||
<source file='/images/sgehosts/01/disk.img'/>
|
||||
<target dev='sda1'/>
|
||||
</disk>
|
||||
<disk type='file' device='disk'>
|
||||
<source file='/images/sgehosts/01/swap.img'/>
|
||||
<target dev='sda2'/>
|
||||
</disk>
|
||||
|
||||
<disk type='file' device='disk'>
|
||||
<source file='/images/sgehosts/01/swap.img'/>
|
||||
<target dev='sda2'/>
|
||||
</disk>
|
||||
|
||||
<disk type='file' device='cdrom'>
|
||||
<source file='/images/iso/cdrom.iso'/>
|
||||
<target dev='hdc'/>
|
||||
<readonly/>
|
||||
</disk>
|
||||
<disk type='file' device='cdrom'>
|
||||
<source file='/images/iso/cdrom.iso'/>
|
||||
<target dev='hdc'/>
|
||||
<readonly/>
|
||||
</disk>
|
||||
|
||||
|
||||
<!--BRIDGE-->
|
||||
<interface type='bridge'>
|
||||
<source bridge='eth0'/>
|
||||
<mac address='00:16:3e:5d:c7:9e'/>
|
||||
</interface>
|
||||
<!--BRIDGE-->
|
||||
<interface type='bridge'>
|
||||
<source bridge='eth0'/>
|
||||
<mac address='00:16:3e:5d:c7:9e'/>
|
||||
</interface>
|
||||
|
||||
<!--ONE Network-->
|
||||
<interface type='network'>
|
||||
<source network='onenetwork'/>
|
||||
</interface>
|
||||
</devices>
|
||||
</domain>
|
||||
</pre>
|
||||
<!--ONE Network-->
|
||||
<interface type='network'>
|
||||
<source network='onenetwork'/>
|
||||
</interface>
|
||||
</devices>
|
||||
</domain>
|
||||
</pre>
|
||||
<p>
|
||||
<b>Note:</b> The "<interface type='network'>" will
|
||||
attach the interface to a previously configured network (named
|
||||
<tt>onenetwork</tt>) within the <a href="http://opennebula.org/">OpenNebula</a> system, typically with the
|
||||
<tt>onevnet</tt> CLI command.</p>
|
||||
|
||||
<p><b>Note</b>: OpenNebula supports the simultaneous use of different hypervisors, so you can specify any os type (linux or hvm) supported by your cluster.
|
||||
<p><b>Note</b>: OpenNebula supports the simultaneous use of different hypervisors, so you can specify any os type (linux or hvm) supported by your cluster.
|
||||
</p>
|
||||
|
||||
<h2>Links</h2>
|
||||
|
@ -1,236 +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 drvopenvz.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: OpenVZ container driver</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="active" href="drivers.html">Drivers</a>
|
||||
<ul class="l2"><li>
|
||||
<div>
|
||||
<a title="Driver the Xen hypervisor" class="inactive" href="drvxen.html">Xen</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for QEMU, KQEMU, KVM and Xenner" class="inactive" href="drvqemu.html">QEMU / KVM</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the Linux native container API" class="inactive" href="drvlxc.html">Linux Container</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Psuedo-driver simulating APIs in memory for test suites" class="inactive" href="drvtest.html">Test</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver providing secure remote to the libvirt APIs" class="inactive" href="drvremote.html">Remote</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<span class="active">OpenVZ</span>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the User Mode Linux technology" class="inactive" href="drvuml.html">UML</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the storage management APIs" class="inactive" href="storage.html">Storage</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for VirtualBox" class="inactive" href="drvvbox.html">VirtualBox</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for OpenNebula" class="inactive" href="drvone.html">OpenNebula</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</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><li>
|
||||
<div>
|
||||
<a title="Working on the internals of libvirt API, driver and daemon code" class="inactive" href="internals.html">Internals</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>OpenVZ container driver</h1>
|
||||
<p>
|
||||
The OpenVZ driver for libvirt allows use and management of container
|
||||
based virtualization on a Linux host OS. Prior to using the OpenVZ
|
||||
driver, the OpenVZ enabled kernel must be installed & booted, and the
|
||||
OpenVZ userspace tools installed. The libvirt driver has been tested
|
||||
with OpenVZ 3.0.22, but other 3.0.x versions should also work without
|
||||
undue trouble.
|
||||
</p>
|
||||
<h2>Connections to OpenVZ driver</h2>
|
||||
<p>
|
||||
The libvirt OpenVZ driver is a single-instance privileged driver,
|
||||
with a driver name of 'openvz'. Some example conection URIs for
|
||||
the libvirt driver are:
|
||||
</p>
|
||||
<pre>
|
||||
openvz:///system (local access)
|
||||
openvz+unix:///system (local access)
|
||||
openvz://example.com/system (remote access, TLS/x509)
|
||||
openvz+tcp://example.com/system (remote access, SASl/Kerberos)
|
||||
openvz+ssh://root@example.com/system (remote access, SSH tunnelled)
|
||||
</pre>
|
||||
<h2>Notes on bridged networking</h2>
|
||||
<p>
|
||||
Bridged networking enables a guest domain (ie container) to have its
|
||||
network interface connected directly to the host's physical LAN. Before
|
||||
this can be used there are a couple of configuration pre-requisites for
|
||||
the host OS.
|
||||
</p>
|
||||
<h3>Host network devices</h3>
|
||||
<p>
|
||||
One or more of the physical devices must be attached to a bridge. The
|
||||
process for this varies according to the operating system in use, so
|
||||
for up to date notes consult the <a href="http://wiki.libvirt.org">Wiki</a>
|
||||
or your operating system's networking documentation. The basic idea is
|
||||
that the host OS should end up with a bridge device "br0" containing a
|
||||
physical device "eth0", or a bonding device "bond0".
|
||||
</p>
|
||||
<h3>OpenVZ tools configuration</h3>
|
||||
<p>
|
||||
OpenVZ releases later than 3.0.23 ship with a standard network device
|
||||
setup script that is able to setup bridging, named
|
||||
<code>/usr/sbin/vznetaddbr</code>. For releases prior to 3.0.23, this
|
||||
script must be created manually by the host OS adminstrator. The
|
||||
simplest way is to just download the latest version of this script
|
||||
from a newer OpenVZ release, or upstream source repository. Then
|
||||
a generic configuration file <code>/etc/vz/vznetctl.conf</code>
|
||||
must be created containing
|
||||
</p>
|
||||
<pre>
|
||||
#!/bin/bash
|
||||
EXTERNAL_SCRIPT="/usr/sbin/vznetaddbr"
|
||||
</pre>
|
||||
<p>
|
||||
The host OS is now ready to allow bridging of guest containers, which
|
||||
will work whether the container is started with libvirt, or OpenVZ
|
||||
tools.
|
||||
</p>
|
||||
<h2>Example guest domain XML configuration</h2>
|
||||
<p>
|
||||
The current libvirt OpenVZ driver has a restriction that the
|
||||
domain names must match the OpenVZ container VEID, which by
|
||||
convention start at 100, and are incremented from there. The
|
||||
choice of OS template to use inside the container is determined
|
||||
by the <code>filesystem</code> tag, and the template source name
|
||||
matches the templates known to OpenVZ tools.
|
||||
</p>
|
||||
<pre>
|
||||
<domain type='openvz' id='104'>
|
||||
<name>104</name>
|
||||
<uuid>86c12009-e591-a159-6e9f-91d18b85ef78</uuid>
|
||||
<vcpu>3</vcpu>
|
||||
<os>
|
||||
<type>exe</type>
|
||||
<init>/sbin/init</init>
|
||||
</os>
|
||||
<devices>
|
||||
<filesystem type='template'>
|
||||
<source name='fedora-9-i386-minimal'/>
|
||||
<target dir='/'/>
|
||||
</filesystem>
|
||||
<interface type='bridge'>
|
||||
<mac address='00:18:51:5b:ea:bf'/>
|
||||
<source bridge='br0'/>
|
||||
<target dev='veth101.0'/>
|
||||
</interface>
|
||||
</devices>
|
||||
</domain>
|
||||
</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>
|
@ -19,13 +19,13 @@
|
||||
the libvirt driver are:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
openvz:///system (local access)
|
||||
openvz+unix:///system (local access)
|
||||
openvz://example.com/system (remote access, TLS/x509)
|
||||
openvz+tcp://example.com/system (remote access, SASl/Kerberos)
|
||||
openvz+ssh://root@example.com/system (remote access, SSH tunnelled)
|
||||
</pre>
|
||||
<pre>
|
||||
openvz:///system (local access)
|
||||
openvz+unix:///system (local access)
|
||||
openvz://example.com/system (remote access, TLS/x509)
|
||||
openvz+tcp://example.com/system (remote access, SASl/Kerberos)
|
||||
openvz+ssh://root@example.com/system (remote access, SSH tunnelled)
|
||||
</pre>
|
||||
|
||||
<h2>Notes on bridged networking</h2>
|
||||
|
||||
@ -60,10 +60,10 @@
|
||||
must be created containing
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
<pre>
|
||||
#!/bin/bash
|
||||
EXTERNAL_SCRIPT="/usr/sbin/vznetaddbr"
|
||||
</pre>
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
The host OS is now ready to allow bridging of guest containers, which
|
||||
@ -83,7 +83,7 @@ EXTERNAL_SCRIPT="/usr/sbin/vznetaddbr"
|
||||
matches the templates known to OpenVZ tools.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
<pre>
|
||||
<domain type='openvz' id='104'>
|
||||
<name>104</name>
|
||||
<uuid>86c12009-e591-a159-6e9f-91d18b85ef78</uuid>
|
||||
@ -104,7 +104,7 @@ EXTERNAL_SCRIPT="/usr/sbin/vznetaddbr"
|
||||
</interface>
|
||||
</devices>
|
||||
</domain>
|
||||
</pre>
|
||||
</pre>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,348 +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 drvqemu.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: QEMU/KVM hypervisor driver</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="active" href="drivers.html">Drivers</a>
|
||||
<ul class="l2"><li>
|
||||
<div>
|
||||
<a title="Driver the Xen hypervisor" class="inactive" href="drvxen.html">Xen</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<span class="active">QEMU / KVM</span>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the Linux native container API" class="inactive" href="drvlxc.html">Linux Container</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Psuedo-driver simulating APIs in memory for test suites" class="inactive" href="drvtest.html">Test</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver providing secure remote to the libvirt APIs" class="inactive" href="drvremote.html">Remote</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the OpenVZ container technology" class="inactive" href="drvopenvz.html">OpenVZ</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the User Mode Linux technology" class="inactive" href="drvuml.html">UML</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the storage management APIs" class="inactive" href="storage.html">Storage</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for VirtualBox" class="inactive" href="drvvbox.html">VirtualBox</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for OpenNebula" class="inactive" href="drvone.html">OpenNebula</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</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><li>
|
||||
<div>
|
||||
<a title="Working on the internals of libvirt API, driver and daemon code" class="inactive" href="internals.html">Internals</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>QEMU/KVM hypervisor driver</h1>
|
||||
<ul><li>
|
||||
<a href="#prereq">Deployment pre-requisites</a>
|
||||
</li><li>
|
||||
<a href="#uris">Connections to QEMU driver</a>
|
||||
</li><li>
|
||||
<a href="#imex">Import and export of libvirt domain XML configs</a>
|
||||
<ul><li>
|
||||
<a href="#xmlimport">Converting from QEMU args to domain XML</a>
|
||||
</li><li>
|
||||
<a href="#xmlexport">Converting from domain XML to QEMU args</a>
|
||||
</li></ul>
|
||||
</li><li>
|
||||
<a href="#xmlconfig">Example domain XML config</a>
|
||||
</li></ul>
|
||||
<p>
|
||||
The libvirt QEMU driver can manage any QEMU emulator from version 0.8.1
|
||||
or later. It can also manage anything that provides the same QEMU command
|
||||
line syntax and monitor interaction. This includes KVM, and Xenner.
|
||||
</p>
|
||||
<h2>
|
||||
<a name="prereq" id="prereq">Deployment pre-requisites</a>
|
||||
</h2>
|
||||
<ul><li>
|
||||
<strong>QEMU emulators</strong>: The driver will probe <code>/usr/bin</code>
|
||||
for the presence of <code>qemu</code>, <code>qemu-system-x86_64</code>,
|
||||
<code>qemu-system-mips</code>,<code>qemu-system-mipsel</code>,
|
||||
<code>qemu-system-sparc</code>,<code>qemu-system-ppc</code>. The results
|
||||
of this can be seen from the capabilities XML output.
|
||||
</li><li>
|
||||
<strong>KVM hypervisor</strong>: The driver will probe <code>/usr/bin</code>
|
||||
for the presence of <code>qemu-kvm</code> and <code>/dev/kvm</code> device
|
||||
node. If both are found, then KVM fullyvirtualized, hardware accelerated
|
||||
guests will be available.
|
||||
</li><li>
|
||||
<strong>Xenner hypervisor</strong>: The driver will probe <code>/usr/bin</code>
|
||||
for the presence of <code>xenner</code> and <code>/dev/kvm</code> device
|
||||
node. If both are found, then Xen paravirtualized guests can be run using
|
||||
the KVM hardware acceleration.
|
||||
</li></ul>
|
||||
<h2>
|
||||
<a name="uris" id="uris">Connections to QEMU driver</a>
|
||||
</h2>
|
||||
<p>
|
||||
The libvirt QEMU driver is a multi-instance driver, providing a single
|
||||
system wide privileged driver (the "system" instance), and per-user
|
||||
unprivileged drivers (the "session" instance). The of the driver protocol
|
||||
is "qemu". Some example conection URIs for the libvirt driver are:
|
||||
</p>
|
||||
<pre>
|
||||
qemu:///session (local access to per-user instance)
|
||||
qemu+unix:///session (local access to per-user instance)
|
||||
|
||||
qemu:///system (local access to system instance)
|
||||
qemu+unix:///system (local access to system instance)
|
||||
qemu://example.com/system (remote access, TLS/x509)
|
||||
qemu+tcp://example.com/system (remote access, SASl/Kerberos)
|
||||
qemu+ssh://root@example.com/system (remote access, SSH tunnelled)
|
||||
</pre>
|
||||
<h2>
|
||||
<a name="imex" id="imex">Import and export of libvirt domain XML configs</a>
|
||||
</h2>
|
||||
<p>The QEMU driver currently supports a single native
|
||||
config format known as <code>qemu-argv</code>. The data for this format
|
||||
is expected to be a single line first a list of environment variables,
|
||||
then the QEMu binary name, finally followed by the QEMU command line
|
||||
arguments</p>
|
||||
<h3>
|
||||
<a name="xmlimport" id="xmlimport">Converting from QEMU args to domain XML</a>
|
||||
</h3>
|
||||
<p>
|
||||
The <code>virsh domxml-from-native</code> provides a way to convert an
|
||||
existing set of QEMU args into a guest description using libvirt Domain XML
|
||||
that can then be used by libvirt.
|
||||
</p>
|
||||
<pre>$ cat > demo.args <<EOF
|
||||
LC_ALL=C PATH=/bin HOME=/home/test USER=test \
|
||||
LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 \
|
||||
-nographic -monitor pty -no-acpi -boot c -hda \
|
||||
/dev/HostVG/QEMUGuest1 -net none -serial none \
|
||||
-parallel none -usb
|
||||
EOF
|
||||
$ virsh domxml-from-native qemu-argv demo.args
|
||||
<domain type='qemu'>
|
||||
<uuid>00000000-0000-0000-0000-000000000000</uuid>
|
||||
<memory>219136</memory>
|
||||
<currentMemory>219136</currentMemory>
|
||||
<vcpu>1</vcpu>
|
||||
<os>
|
||||
<type arch='i686' machine='pc'>hvm</type>
|
||||
<boot dev='hd'/>
|
||||
</os>
|
||||
<clock offset='utc'/>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
<on_reboot>restart</on_reboot>
|
||||
<on_crash>destroy</on_crash>
|
||||
<devices>
|
||||
<emulator>/usr/bin/qemu</emulator>
|
||||
<disk type='block' device='disk'>
|
||||
<source dev='/dev/HostVG/QEMUGuest1'/>
|
||||
<target dev='hda' bus='ide'/>
|
||||
</disk>
|
||||
</devices>
|
||||
</domain>
|
||||
</pre>
|
||||
<p>NB, don't include the literral \ in the args, put everything on one line</p>
|
||||
<h3>
|
||||
<a name="xmlexport" id="xmlexport">Converting from domain XML to QEMU args</a>
|
||||
</h3>
|
||||
<p>
|
||||
The <code>virsh domxml-to-native</code> provides a way to convert a
|
||||
guest description using libvirt Domain XML, into a set of QEMU args
|
||||
that can be run manually.
|
||||
</p>
|
||||
<pre>$ cat > demo.xml <<EOF
|
||||
<domain type='qemu'>
|
||||
<name>QEMUGuest1</name>
|
||||
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
||||
<memory>219200</memory>
|
||||
<currentMemory>219200</currentMemory>
|
||||
<vcpu>1</vcpu>
|
||||
<os>
|
||||
<type arch='i686' machine='pc'>hvm</type>
|
||||
<boot dev='hd'/>
|
||||
</os>
|
||||
<clock offset='utc'/>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
<on_reboot>restart</on_reboot>
|
||||
<on_crash>destroy</on_crash>
|
||||
<devices>
|
||||
<emulator>/usr/bin/qemu</emulator>
|
||||
<disk type='block' device='disk'>
|
||||
<source dev='/dev/HostVG/QEMUGuest1'/>
|
||||
<target dev='hda' bus='ide'/>
|
||||
</disk>
|
||||
</devices>
|
||||
</domain>
|
||||
EOF
|
||||
$ virsh domxml-to-native qemu-argv demo.xml
|
||||
LC_ALL=C PATH=/usr/bin:/bin HOME=/home/test \
|
||||
USER=test LOGNAME=test /usr/bin/qemu -S -M pc \
|
||||
-no-kqemu -m 214 -smp 1 -name QEMUGuest1 -nographic \
|
||||
-monitor pty -no-acpi -boot c -drive \
|
||||
file=/dev/HostVG/QEMUGuest1,if=ide,index=0 -net none \
|
||||
-serial none -parallel none -usb
|
||||
</pre>
|
||||
<h2>
|
||||
<a name="xmlconfig" id="xmlconfig">Example domain XML config</a>
|
||||
</h2>
|
||||
<h3>QEMU emulated guest on x86_64</h3>
|
||||
<pre><domain type='qemu'>
|
||||
<name>QEmu-fedora-i686</name>
|
||||
<uuid>c7a5fdbd-cdaf-9455-926a-d65c16db1809</uuid>
|
||||
<memory>219200</memory>
|
||||
<currentMemory>219200</currentMemory>
|
||||
<vcpu>2</vcpu>
|
||||
<os>
|
||||
<type arch='i686' machine='pc'>hvm</type>
|
||||
<boot dev='cdrom'/>
|
||||
</os>
|
||||
<devices>
|
||||
<emulator>/usr/bin/qemu-system-x86_64</emulator>
|
||||
<disk type='file' device='cdrom'>
|
||||
<source file='/home/user/boot.iso'/>
|
||||
<target dev='hdc'/>
|
||||
<readonly/>
|
||||
</disk>
|
||||
<disk type='file' device='disk'>
|
||||
<source file='/home/user/fedora.img'/>
|
||||
<target dev='hda'/>
|
||||
</disk>
|
||||
<interface type='network'>
|
||||
<source network='default'/>
|
||||
</interface>
|
||||
<graphics type='vnc' port='-1'/>
|
||||
</devices>
|
||||
</domain></pre>
|
||||
<h3>KVM hardware accelerated guest on i686</h3>
|
||||
<pre><domain type='kvm'>
|
||||
<name>demo2</name>
|
||||
<uuid>4dea24b3-1d52-d8f3-2516-782e98a23fa0</uuid>
|
||||
<memory>131072</memory>
|
||||
<vcpu>1</vcpu>
|
||||
<os>
|
||||
<type arch="i686">hvm</type>
|
||||
</os>
|
||||
<clock sync="localtime"/>
|
||||
<devices>
|
||||
<emulator>/usr/bin/qemu-kvm</emulator>
|
||||
<disk type='file' device='disk'>
|
||||
<source file='/var/lib/libvirt/images/demo2.img'/>
|
||||
<target dev='hda'/>
|
||||
</disk>
|
||||
<interface type='network'>
|
||||
<source network='default'/>
|
||||
<mac address='24:42:53:21:52:45'/>
|
||||
</interface>
|
||||
<graphics type='vnc' port='-1' keymap='de'/>
|
||||
</devices>
|
||||
</domain></pre>
|
||||
<h3>Xen paravirtualized guests with hardware acceleration</h3>
|
||||
</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>
|
@ -14,23 +14,23 @@
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<strong>QEMU emulators</strong>: The driver will probe <code>/usr/bin</code>
|
||||
for the presence of <code>qemu</code>, <code>qemu-system-x86_64</code>,
|
||||
<code>qemu-system-mips</code>,<code>qemu-system-mipsel</code>,
|
||||
<code>qemu-system-sparc</code>,<code>qemu-system-ppc</code>. The results
|
||||
of this can be seen from the capabilities XML output.
|
||||
<strong>QEMU emulators</strong>: The driver will probe <code>/usr/bin</code>
|
||||
for the presence of <code>qemu</code>, <code>qemu-system-x86_64</code>,
|
||||
<code>qemu-system-mips</code>,<code>qemu-system-mipsel</code>,
|
||||
<code>qemu-system-sparc</code>,<code>qemu-system-ppc</code>. The results
|
||||
of this can be seen from the capabilities XML output.
|
||||
</li>
|
||||
<li>
|
||||
<strong>KVM hypervisor</strong>: The driver will probe <code>/usr/bin</code>
|
||||
for the presence of <code>qemu-kvm</code> and <code>/dev/kvm</code> device
|
||||
node. If both are found, then KVM fullyvirtualized, hardware accelerated
|
||||
guests will be available.
|
||||
<strong>KVM hypervisor</strong>: The driver will probe <code>/usr/bin</code>
|
||||
for the presence of <code>qemu-kvm</code> and <code>/dev/kvm</code> device
|
||||
node. If both are found, then KVM fullyvirtualized, hardware accelerated
|
||||
guests will be available.
|
||||
</li>
|
||||
<li>
|
||||
<strong>Xenner hypervisor</strong>: The driver will probe <code>/usr/bin</code>
|
||||
for the presence of <code>xenner</code> and <code>/dev/kvm</code> device
|
||||
node. If both are found, then Xen paravirtualized guests can be run using
|
||||
the KVM hardware acceleration.
|
||||
<strong>Xenner hypervisor</strong>: The driver will probe <code>/usr/bin</code>
|
||||
for the presence of <code>xenner</code> and <code>/dev/kvm</code> device
|
||||
node. If both are found, then Xen paravirtualized guests can be run using
|
||||
the KVM hardware acceleration.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@ -43,16 +43,369 @@
|
||||
is "qemu". Some example conection URIs for the libvirt driver are:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
qemu:///session (local access to per-user instance)
|
||||
qemu+unix:///session (local access to per-user instance)
|
||||
<pre>
|
||||
qemu:///session (local access to per-user instance)
|
||||
qemu+unix:///session (local access to per-user instance)
|
||||
|
||||
qemu:///system (local access to system instance)
|
||||
qemu+unix:///system (local access to system instance)
|
||||
qemu://example.com/system (remote access, TLS/x509)
|
||||
qemu+tcp://example.com/system (remote access, SASl/Kerberos)
|
||||
qemu+ssh://root@example.com/system (remote access, SSH tunnelled)
|
||||
</pre>
|
||||
qemu:///system (local access to system instance)
|
||||
qemu+unix:///system (local access to system instance)
|
||||
qemu://example.com/system (remote access, TLS/x509)
|
||||
qemu+tcp://example.com/system (remote access, SASl/Kerberos)
|
||||
qemu+ssh://root@example.com/system (remote access, SSH tunnelled)
|
||||
</pre>
|
||||
|
||||
<h2><a name="security">Driver security architecture</a></h2>
|
||||
|
||||
<p>
|
||||
There are multiple layers to security in the QEMU driver, allowing for
|
||||
flexibility in the use of QEMU based virtual machines.
|
||||
</p>
|
||||
|
||||
<h3><a name="securitydriver">Driver instances</a></h3>
|
||||
|
||||
<p>
|
||||
As explained above there are two ways to access the QEMU driver
|
||||
in libvirt. The "qemu:///session" family of URIs connect to a
|
||||
libvirtd instance running as the same user/group ID as the client
|
||||
application. Thus the QEMU instances spawned from this driver will
|
||||
share the same privileges as the client application. The intended
|
||||
use case for this driver is desktop virtualization, with virtual
|
||||
machines storing their disk imags in the user's home directory and
|
||||
being managed from the local desktop login session.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The "qemu:///system" family of URIs connect to a
|
||||
libvirtd instance running as the privileged system account 'root'.
|
||||
Thus the QEMU instances spawned from this driver may have much
|
||||
higher privileges than the client application managing them.
|
||||
The intended use case for this driver is server virtualization,
|
||||
where the virtual machines may need to be connected to host
|
||||
resources (block, PCI, USB, network devices) whose access requires
|
||||
elevated privileges.
|
||||
</p>
|
||||
|
||||
<h3><a name="securitydac">POSIX users/groups</a></h3>
|
||||
|
||||
<p>
|
||||
In the "session" instance, the POSIX users/groups model restricts QEMU
|
||||
virtual machines (and libvirtd in general) to only have access to resources
|
||||
with the same user/group ID as the client application. There is no
|
||||
finer level of configuration possible for the "session" instances.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
In the "system" instance, libvirt releases from 0.7.0 onwards allow
|
||||
control over the user/group that the QEMU virtual machines are run
|
||||
as. A build of libvirt with no configuration parameters set will
|
||||
still run QEMU processes as root:root. It is possible to change
|
||||
this default by using the --with-qemu-user=$USERNAME and
|
||||
--with-qemu-group=$GROUPNAME arguments to 'configure' during
|
||||
build. It is strongly recommended that vendors build with both
|
||||
of these arguments set to 'qemu'. Regardless of this build time
|
||||
default, administrators can set a per-host default setting in
|
||||
the <code>/etc/libvirt/qemu.conf</code> configuration file via
|
||||
the <code>user=$USERNAME</code> and <code>group=$GROUPNAME</code>
|
||||
parameters. When a non-root user or group is configured, the
|
||||
libvirt QEMU driver will change uid/gid to match immediately
|
||||
before executing the QEMU binary for a virtual machine.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
If QEMU virtual machines from the "system" instance are being
|
||||
run as non-root, there will be greater restrictions on what
|
||||
host resources the QEMU process will be able to access. The
|
||||
libvirtd daemon will attempt to manage permissions on resources
|
||||
to minimise the likelihood of unintentional security denials,
|
||||
but the administrator / application developer must be aware of
|
||||
some of the consequences / restrictions.
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<p>
|
||||
The directories <code>/var/run/libvirt/qemu/</code>,
|
||||
<code>/var/lib/libvirt/qemu/</code> and
|
||||
<code>/var/cache/libvirt/qemu/</code> must all have their
|
||||
ownership set to match the user / group ID that QEMU
|
||||
guests will be run as. If the vendor has set a non-root
|
||||
user/group for the QEMU driver at build time, the
|
||||
permissions should be set automatically at install time.
|
||||
If a host administrator customizes user/group in
|
||||
<code>/etc/libvirt/qemu.conf</code>, they will need to
|
||||
manually set the ownership on these directories.
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>
|
||||
When attaching USB and PCI devices to a QEMU guest,
|
||||
QEMU will need to access files in <code>/dev/bus/usb</code>
|
||||
and <code>/sys/bus/pci/devices</code> respectively. The libvirtd daemon
|
||||
will automatically set the ownership on specific devices
|
||||
that are assigned to a guest at start time. There should
|
||||
not be any need for administrator changes in this respect.
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>
|
||||
Any files/devices used as guest disk images must be
|
||||
accessible to the user/group ID that QEMU guests are
|
||||
configured to run as. The libvirtd daemon will automatically
|
||||
set the ownership of the file/device path to the correct
|
||||
user/group ID. Applications / administrators must be aware
|
||||
though that the parent directory permissions may still
|
||||
deny access. The directories containing disk images
|
||||
must either have their ownership set to match the user/group
|
||||
configured for QEMU, or their UNIX file permissions must
|
||||
have the 'execute/search' bit enabled for 'others'.
|
||||
</p>
|
||||
<p>
|
||||
The simplest option is the latter one, of just enabling
|
||||
the 'execute/search' bit. For any directory to be used
|
||||
for storing disk images, this can be achieved by running
|
||||
the following command on the directory itself, and any
|
||||
parent directories
|
||||
</p>
|
||||
<pre>
|
||||
chmod o+x /path/to/directory
|
||||
</pre>
|
||||
<p>
|
||||
In particular note that if using the "system" instance
|
||||
and attempting to store disk images in a user home
|
||||
directory, the default permissions on $HOME are typically
|
||||
too restrictive to allow access.
|
||||
</p>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3><a name="securitycap">Linux process capabilities</a></h3>
|
||||
|
||||
<p>
|
||||
The libvirt QEMU driver has a build time option allowing it to use
|
||||
the <a href="http://people.redhat.com/sgrubb/libcap-ng/index.html">libcap-ng</a>
|
||||
library to manage process capabilities. If this build option is
|
||||
enabled, then the QEMU driver will use this to ensure that all
|
||||
process capabilities are dropped before executing a QEMU virtual
|
||||
machine. Process capabilities are what gives the 'root' account
|
||||
its high power, in particular the CAP_DAC_OVERRIDE capability
|
||||
is what allows a process running as 'root' to access files owned
|
||||
by any user.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
If the QEMU driver is configured to run virtual machines as non-root,
|
||||
then they will already loose all their process capabilities at time
|
||||
of startup. The Linux capability feature is thus aimed primarily at
|
||||
the scenario where the QEMU processes are running as root. In this
|
||||
case, before launching a QEMU virtual machine, libvirtd will use
|
||||
libcap-ng APIs to drop all process capabilities. It is important
|
||||
for administrators to note that this implies the QEMU process will
|
||||
<strong>only</strong> be able to access files owned by root, and
|
||||
not files owned by any other user.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Thus, if a vendor / distributor has configured their libvirt package
|
||||
to run as 'qemu' by default, a number of changes will be required
|
||||
before an administrator can change a host to run guests as root.
|
||||
In particular it will be necessary to change ownership on the
|
||||
directories <code>/var/run/libvirt/qemu/</code>,
|
||||
<code>/var/lib/libvirt/qemu/</code> and
|
||||
<code>/var/cache/libvirt/qemu/</code> back to root, in addition
|
||||
to changing the <code>/etc/libvirt/qemu.conf</code> settings.
|
||||
</p>
|
||||
|
||||
<h3><a name="securityselinux">SELinux basic confinement</a></h3>
|
||||
|
||||
<p>
|
||||
The basic SELinux protection for QEMU virtual machines is intended to
|
||||
protect the host OS from a compromised virtual machine process. There
|
||||
is no protection between guests.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
In the basic model, all QEMU virtual machines run under the confined
|
||||
domain <code>root:system_r:qemu_t</code>. It is required that any
|
||||
disk image assigned to a QEMU virtual machine is labelled with
|
||||
<code>system_u:object_r:virt_image_t</code>. In a default deployment,
|
||||
package vendors/distributor will typically ensure that the directory
|
||||
<code>/var/lib/libvirt/images</code> has this label, such that any
|
||||
disk images created in this directory will automatically inherit the
|
||||
correct labelling. If attempting to use disk images in another
|
||||
location, the user/administrator must ensure the directory has be
|
||||
given this requisite label. Likewise physical block devices must
|
||||
be labelled <code>system_u:object_r:virt_image_t</code>.
|
||||
</p>
|
||||
<p>
|
||||
Not all filesystems allow for labelling of individual files. In
|
||||
particular NFS, VFat and NTFS have no support for labelling. In
|
||||
these cases administrators must use the 'context' option when
|
||||
mounting the filesystem to set the default label to
|
||||
<code>system_u:object_r:virt_image_t</code>. In the case of
|
||||
NFS, there is an alternative option, of enabling the <code>virt_use_nfs</code>
|
||||
SELinux boolean.
|
||||
</p>
|
||||
|
||||
<h3><a name="securitysvirt">SELinux sVirt confinement</a></h3>
|
||||
|
||||
<p>
|
||||
The SELinux sVirt protection for QEMU virtual machines builds to the
|
||||
basic level of protection, to also allow individual guests to be
|
||||
protected from each other.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
In the sVirt model, each QEMU virtual machine runs under its own
|
||||
confined domain, which is based on <code>system_u:system_r:svirt_t:s0</code>
|
||||
with a unique category appended, eg, <code>system_u:system_r:svirt_t:s0:c34,c44</code>.
|
||||
The rules are setup such that a domain can only access files which are
|
||||
labelled with the matching category level, eg
|
||||
<code>system_u:object_r:svirt_image_t:s0:c34,c44</code>. This prevents one
|
||||
QEMU process accessing any file resources that are prevent to another QEMU
|
||||
process.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
There are two ways of assigning labels to virtual machines under sVirt.
|
||||
In the default setup, if sVirt is enabled, guests will get an automatically
|
||||
assigned unique label each time they are booted. The libvirtd daemon will
|
||||
also automatically relabel exclusive access disk images to match this
|
||||
label. Disks that are marked as <shared> will get a generic
|
||||
label <code>system_u:system_r:svirt_image_t:s0</code> allowing all guests
|
||||
read/write access them, while disks marked as <readonly> will
|
||||
get a generic label <code>system_u:system_r:svirt_content_t:s0</code>
|
||||
which allows all guests read-only access.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
With statically assigned labels, the application should include the
|
||||
desired guest and file labels in the XML at time of creating the
|
||||
guest with libvirt. In this scenario the application is responsible
|
||||
for ensuring the disk images & similar resources are suitably
|
||||
labelled to match, libvirtd will not attempt any relabelling.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
If the sVirt security model is active, then the node capabilities
|
||||
XML will include its details. If a virtual machine is currently
|
||||
protected by the security model, then the guest XML will include
|
||||
its assigned labels. If enabled at compile time, the sVirt security
|
||||
model will always be activated if SELinux is available on the host
|
||||
OS. To disable sVirt, and revert to the basic level of SELinux
|
||||
protection (host protection only), the <code>/etc/libvirt/qemu.conf</code>
|
||||
file can be used to change the setting to <code>security_driver="none"</code>
|
||||
</p>
|
||||
|
||||
<h3><a name="securitysvirtaa">AppArmor sVirt confinement</a></h3>
|
||||
|
||||
<p>
|
||||
When using basic AppArmor protection for the libvirtd daemon and
|
||||
QEMU virtual machines, the intention is to protect the host OS
|
||||
from a compromised virtual machine process. There is no protection
|
||||
between guests.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The AppArmor sVirt protection for QEMU virtual machines builds on
|
||||
this basic level of protection, to also allow individual guests to
|
||||
be protected from each other.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
In the sVirt model, if a profile is loaded for the libvirtd daemon,
|
||||
then each <code>qemu:///system</code> QEMU virtual machine will have
|
||||
a profile created for it when the virtual machine is started if one
|
||||
does not already exist. This generated profile uses a profile name
|
||||
based on the UUID of the QEMU virtual machine and contains rules
|
||||
allowing access to only the files it needs to run, such as its disks,
|
||||
pid file and log files. Just before the QEMU virtual machine is
|
||||
started, the libvirtd daemon will change into this unique profile,
|
||||
preventing the QEMU process from accessing any file resources that
|
||||
are present in another QEMU process or the host machine.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The AppArmor sVirt implementation is flexible in that it allows an
|
||||
administrator to customize the template file in
|
||||
<code>/etc/apparmor.d/libvirt/TEMPLATE</code> for site-specific
|
||||
access for all newly created QEMU virtual machines. Also, when a new
|
||||
profile is generated, two files are created:
|
||||
<code>/etc/apparmor.d/libvirt/libvirt-<uuid></code> and
|
||||
<code>/etc/apparmor.d/libvirt/libvirt-<uuid>.files</code>. The
|
||||
former can be fine-tuned by the administrator to allow custom access
|
||||
for this particular QEMU virtual machine, and the latter will be
|
||||
updated appropriately when required file access changes, such as when
|
||||
a disk is added. This flexibility allows for situations such as
|
||||
having one virtual machine in complain mode with all others in
|
||||
enforce mode.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
While users can define their own AppArmor profile scheme, a typical
|
||||
configuration will include a profile for <code>/usr/sbin/libvirtd</code>,
|
||||
<code>/usr/lib/libvirt/virt-aa-helper</code> (a helper program which the
|
||||
libvirtd daemon uses instead of manipulating AppArmor directly), and
|
||||
an abstraction to be included by <code>/etc/apparmor.d/libvirt/TEMPLATE</code>
|
||||
(typically <code>/etc/apparmor.d/abstractions/libvirt-qemu</code>).
|
||||
An example profile scheme can be found in the examples/apparmor
|
||||
directory of the source distribution.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
If the sVirt security model is active, then the node capabilities
|
||||
XML will include its details. If a virtual machine is currently
|
||||
protected by the security model, then the guest XML will include
|
||||
its assigned profile name. If enabled at compile time, the sVirt
|
||||
security model will be activated if AppArmor is available on the host
|
||||
OS and a profile for the libvirtd daemon is loaded when libvirtd is
|
||||
started. To disable sVirt, and revert to the basic level of AppArmor
|
||||
protection (host protection only), the <code>/etc/libvirt/qemu.conf</code>
|
||||
file can be used to change the setting to <code>security_driver="none"</code>.
|
||||
</p>
|
||||
|
||||
|
||||
<h3><a name="securityacl">Cgroups device ACLs</a></h3>
|
||||
|
||||
<p>
|
||||
Recent Linux kernels have a capability known as "cgroups" which is used
|
||||
for resource management. It is implemented via a number of "controllers",
|
||||
each controller covering a specific task/functional area. One of the
|
||||
available controllers is the "devices" controller, which is able to
|
||||
setup whitelists of block/character devices that a cgroup should be
|
||||
allowed to access. If the "devices" controller is mounted on a host,
|
||||
then libvirt will automatically create a dedicated cgroup for each
|
||||
QEMU virtual machine and setup the device whitelist so that the QEMU
|
||||
process can only access shared devices, and explicitly disks images
|
||||
backed by block devices.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The list of shared devices a guest is allowed access to is
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
/dev/null, /dev/full, /dev/zero,
|
||||
/dev/random, /dev/urandom,
|
||||
/dev/ptmx, /dev/kvm, /dev/kqemu,
|
||||
/dev/rtc, /dev/hpet, /dev/net/tun
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
In the event of unanticipated needs arising, this can be customized
|
||||
via the <code>/etc/libvirt/qemu.conf</code> file.
|
||||
To mount the cgroups device controller, the following command
|
||||
should be run as root, prior to starting libvirtd
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
mkdir /dev/cgroup
|
||||
mount -t cgroup none /dev/cgroup -o devices
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
libvirt will then place each virtual machine in a cgroup at
|
||||
<code>/dev/cgroup/libvirt/qemu/$VMNAME/</code>
|
||||
</p>
|
||||
|
||||
<h2><a name="imex">Import and export of libvirt domain XML configs</a></h2>
|
||||
|
||||
@ -77,6 +430,7 @@ LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 \
|
||||
/dev/HostVG/QEMUGuest1 -net none -serial none \
|
||||
-parallel none -usb
|
||||
EOF
|
||||
|
||||
$ virsh domxml-from-native qemu-argv demo.args
|
||||
<domain type='qemu'>
|
||||
<uuid>00000000-0000-0000-0000-000000000000</uuid>
|
||||
@ -99,7 +453,7 @@ $ virsh domxml-from-native qemu-argv demo.args
|
||||
</disk>
|
||||
</devices>
|
||||
</domain>
|
||||
</pre>
|
||||
</pre>
|
||||
|
||||
<p>NB, don't include the literral \ in the args, put everything on one line</p>
|
||||
|
||||
@ -135,6 +489,7 @@ $ virsh domxml-from-native qemu-argv demo.args
|
||||
</devices>
|
||||
</domain>
|
||||
EOF
|
||||
|
||||
$ virsh domxml-to-native qemu-argv demo.xml
|
||||
LC_ALL=C PATH=/usr/bin:/bin HOME=/home/test \
|
||||
USER=test LOGNAME=test /usr/bin/qemu -S -M pc \
|
||||
@ -142,7 +497,7 @@ $ virsh domxml-to-native qemu-argv demo.xml
|
||||
-monitor pty -no-acpi -boot c -drive \
|
||||
file=/dev/HostVG/QEMUGuest1,if=ide,index=0 -net none \
|
||||
-serial none -parallel none -usb
|
||||
</pre>
|
||||
</pre>
|
||||
|
||||
<h2><a name="xmlconfig">Example domain XML config</a></h2>
|
||||
|
||||
@ -203,7 +558,7 @@ $ virsh domxml-to-native qemu-argv demo.xml
|
||||
|
||||
<h3>Xen paravirtualized guests with hardware acceleration</h3>
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,148 +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 drvremote.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: Remote management driver</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="active" href="drivers.html">Drivers</a>
|
||||
<ul class="l2"><li>
|
||||
<div>
|
||||
<a title="Driver the Xen hypervisor" class="inactive" href="drvxen.html">Xen</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for QEMU, KQEMU, KVM and Xenner" class="inactive" href="drvqemu.html">QEMU / KVM</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the Linux native container API" class="inactive" href="drvlxc.html">Linux Container</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Psuedo-driver simulating APIs in memory for test suites" class="inactive" href="drvtest.html">Test</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<span class="active">Remote</span>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the OpenVZ container technology" class="inactive" href="drvopenvz.html">OpenVZ</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the User Mode Linux technology" class="inactive" href="drvuml.html">UML</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the storage management APIs" class="inactive" href="storage.html">Storage</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for VirtualBox" class="inactive" href="drvvbox.html">VirtualBox</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for OpenNebula" class="inactive" href="drvone.html">OpenNebula</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</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><li>
|
||||
<div>
|
||||
<a title="Working on the internals of libvirt API, driver and daemon code" class="inactive" href="internals.html">Internals</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>Remote management driver</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,164 +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 drvtest.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: Test "mock" driver</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="active" href="drivers.html">Drivers</a>
|
||||
<ul class="l2"><li>
|
||||
<div>
|
||||
<a title="Driver the Xen hypervisor" class="inactive" href="drvxen.html">Xen</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for QEMU, KQEMU, KVM and Xenner" class="inactive" href="drvqemu.html">QEMU / KVM</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the Linux native container API" class="inactive" href="drvlxc.html">Linux Container</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<span class="active">Test</span>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver providing secure remote to the libvirt APIs" class="inactive" href="drvremote.html">Remote</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the OpenVZ container technology" class="inactive" href="drvopenvz.html">OpenVZ</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the User Mode Linux technology" class="inactive" href="drvuml.html">UML</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the storage management APIs" class="inactive" href="storage.html">Storage</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for VirtualBox" class="inactive" href="drvvbox.html">VirtualBox</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for OpenNebula" class="inactive" href="drvone.html">OpenNebula</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</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><li>
|
||||
<div>
|
||||
<a title="Working on the internals of libvirt API, driver and daemon code" class="inactive" href="internals.html">Internals</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>Test "mock" driver</h1>
|
||||
<h2>Connections to Test driver</h2>
|
||||
<p>
|
||||
The libvirt Test driver is a per-process fake hypervisor driver,
|
||||
with a driver name of 'test'. The driver maintains all its state
|
||||
in memory. It can start with a pre-configured default config, or
|
||||
be given a path to a alternate config. Some example conection URIs
|
||||
for the libvirt driver are:
|
||||
</p>
|
||||
<pre>
|
||||
test:///default (local access, default config)
|
||||
test:///path/to/driver/config.xml (local access, custom config)
|
||||
test+unix:///default (local access, default config, via daemon)
|
||||
test://example.com/default (remote access, TLS/x509)
|
||||
test+tcp://example.com/default (remote access, SASl/Kerberos)
|
||||
test+ssh://root@example.com/default (remote access, SSH tunnelled)
|
||||
</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>
|
@ -12,14 +12,14 @@
|
||||
for the libvirt driver are:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
test:///default (local access, default config)
|
||||
test:///path/to/driver/config.xml (local access, custom config)
|
||||
test+unix:///default (local access, default config, via daemon)
|
||||
test://example.com/default (remote access, TLS/x509)
|
||||
test+tcp://example.com/default (remote access, SASl/Kerberos)
|
||||
test+ssh://root@example.com/default (remote access, SSH tunnelled)
|
||||
</pre>
|
||||
<pre>
|
||||
test:///default (local access, default config)
|
||||
test:///path/to/driver/config.xml (local access, custom config)
|
||||
test+unix:///default (local access, default config, via daemon)
|
||||
test://example.com/default (remote access, TLS/x509)
|
||||
test+tcp://example.com/default (remote access, SASl/Kerberos)
|
||||
test+ssh://root@example.com/default (remote access, SSH tunnelled)
|
||||
</pre>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
216
docs/drvuml.html
216
docs/drvuml.html
@ -1,216 +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 drvuml.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: User Mode Linux driver</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="active" href="drivers.html">Drivers</a>
|
||||
<ul class="l2"><li>
|
||||
<div>
|
||||
<a title="Driver the Xen hypervisor" class="inactive" href="drvxen.html">Xen</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for QEMU, KQEMU, KVM and Xenner" class="inactive" href="drvqemu.html">QEMU / KVM</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the Linux native container API" class="inactive" href="drvlxc.html">Linux Container</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Psuedo-driver simulating APIs in memory for test suites" class="inactive" href="drvtest.html">Test</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver providing secure remote to the libvirt APIs" class="inactive" href="drvremote.html">Remote</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the OpenVZ container technology" class="inactive" href="drvopenvz.html">OpenVZ</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<span class="active">UML</span>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for the storage management APIs" class="inactive" href="storage.html">Storage</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for VirtualBox" class="inactive" href="drvvbox.html">VirtualBox</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Driver for OpenNebula" class="inactive" href="drvone.html">OpenNebula</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</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><li>
|
||||
<div>
|
||||
<a title="Working on the internals of libvirt API, driver and daemon code" class="inactive" href="internals.html">Internals</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>User Mode Linux driver</h1>
|
||||
<p>
|
||||
The UML driver for libvirt allows use and management of paravirtualized
|
||||
guests built for User Mode Linux. UML requires no special support in
|
||||
the host kernel, so can be used by any user of any linux system, provided
|
||||
they have enough free RAM for their guest's needs, though there are
|
||||
certain restrictions on network connectivity unless the adminstrator
|
||||
has pre-created TAP devices.
|
||||
</p>
|
||||
<h2>Connections to UML driver</h2>
|
||||
<p>
|
||||
The libvirt UML driver follows the QEMU driver in providing two
|
||||
types of connection. There is one privileged instance per host,
|
||||
which runs as root. This is called the "system" instance, and allows
|
||||
full use of all host resources. Then, there is a per-user unprivileged
|
||||
"session", instance. This has more restricted capabilities, and may
|
||||
require the host administrator to setup certain resources ahead of
|
||||
time to allow full integration with the network. Example connection
|
||||
URIs are
|
||||
</p>
|
||||
<pre>
|
||||
uml:///session (local access to per-user instance)
|
||||
uml+unix:///session (local access to per-user instance)
|
||||
|
||||
uml:///system (local access to system instance)
|
||||
uml+unix:///system (local access to system instance)
|
||||
uml://example.com/system (remote access, TLS/x509)
|
||||
uml+tcp://example.com/system (remote access, SASl/Kerberos)
|
||||
uml+ssh://root@example.com/system (remote access, SSH tunnelled)
|
||||
</pre>
|
||||
<h2>Example XML configuration</h2>
|
||||
<p>
|
||||
User mode Linux driver only supports directly kernel boot at
|
||||
this time. A future driver enhancement may allow a paravirt
|
||||
bootloader in a similar style to Xen's pygrub. For now though,
|
||||
the UML kernel must be stored on the host and referenced
|
||||
explicitly in the "os" element. Since UML is a paravirtualized
|
||||
technology, the kernel "type" is set to "uml"
|
||||
</p>
|
||||
<p>
|
||||
There is not yet support for networking in the driver, but
|
||||
disks can be specified in the usual libvirt manner. The main
|
||||
variation is the target device naming scheme "ubd0", and
|
||||
bus type of "uml".
|
||||
</p>
|
||||
<p>
|
||||
Once booted the primary console is connected toa PTY, and
|
||||
thus accessible with "virsh console" or equivalent tools
|
||||
</p>
|
||||
<pre>
|
||||
<domain type='uml'>
|
||||
<name>demo</name>
|
||||
<uuid>b4433fc2-a22e-ffb3-0a3d-9c173b395800</uuid>
|
||||
<memory>500000</memory>
|
||||
<currentMemory>500000</currentMemory>
|
||||
<vcpu>1</vcpu>
|
||||
<os>
|
||||
<type arch='x86_64'>uml</type>
|
||||
<kernel>/home/berrange/linux-uml-2.6.26-x86_64</kernel>
|
||||
</os>
|
||||
<devices>
|
||||
<disk type='file' device='disk'>
|
||||
<source file='/home/berrange/FedoraCore6-AMD64-root_fs'/>
|
||||
<target dev='ubd0' bus='uml'/>
|
||||
</disk>
|
||||
<console type='pty'/>
|
||||
</devices>
|
||||
</domain>
|
||||
</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>
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user