mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-08-20 21:50:07 +03:00
Compare commits
295 Commits
Author | SHA1 | Date | |
---|---|---|---|
4a5dfb847b | |||
42fea976df | |||
cf1b0f868b | |||
f92e9f599b | |||
f34ba729ff | |||
a119a98081 | |||
a6ef2e0055 | |||
67e7416119 | |||
3cb55cb51f | |||
896761e5c7 | |||
05436ab7ff | |||
d8637214a4 | |||
e2da806861 | |||
745c249a61 | |||
1c64dc76c1 | |||
3a8d93ab36 | |||
73da543e77 | |||
3801794908 | |||
4f4bfbc79e | |||
e96d88ff3d | |||
87e4ded54a | |||
a10aa7a96b | |||
3463c34e33 | |||
a9f8c8f5f1 | |||
3aaad2178c | |||
ecb2eb4554 | |||
bc18a91f91 | |||
a99e5ccba4 | |||
94d6177982 | |||
46d1324e47 | |||
ca9af16aa7 | |||
9322b2e861 | |||
e730de6fd8 | |||
8cc2bbe33c | |||
499189694a | |||
be33b189a5 | |||
eb0849f370 | |||
c2102c60ea | |||
555de859cc | |||
489fde7680 | |||
765bca14d1 | |||
2c22a68ce2 | |||
04b120e481 | |||
f03d3439cd | |||
b4f62abbf1 | |||
e15147c141 | |||
4e8f63fdaa | |||
aa7c4102aa | |||
339cc9d992 | |||
69d947eb80 | |||
39e49ad7c9 | |||
ad70b32414 | |||
5f0c720163 | |||
727d4fdc6e | |||
7523642c01 | |||
3b22f80f07 | |||
48dc345f2d | |||
6278bb191a | |||
e80f10064e | |||
c4985e9419 | |||
1b745219c7 | |||
d0eab955c2 | |||
a7acdde406 | |||
7420fec81b | |||
fb4ec82358 | |||
39e6ded8ae | |||
2b29698352 | |||
e52d74e536 | |||
20921cc284 | |||
e3672d9695 | |||
23a090ab92 | |||
a964a6dad6 | |||
554d82a200 | |||
839c6de58b | |||
1709e1dc88 | |||
5fb1e29c7e | |||
89408fd3a0 | |||
a888b22cf9 | |||
071be08079 | |||
3548e9aae8 | |||
d82071710e | |||
f61341173b | |||
84ef468ba8 | |||
2c7be88d15 | |||
788bedd904 | |||
0fc5b2fbc9 | |||
e428a69e6f | |||
437ac354fc | |||
25415eb104 | |||
61674cc17d | |||
458a673cb7 | |||
6d004d3f8a | |||
103ee5d4c2 | |||
45062390a6 | |||
763e33c373 | |||
a776fad370 | |||
0466ff28f2 | |||
ead04dcbe8 | |||
c790f6d25e | |||
ed493909f7 | |||
8dfbfe3145 | |||
5d99a309e6 | |||
e59dd65380 | |||
9a969b86a9 | |||
b751b46bc5 | |||
e676a699e8 | |||
4fbbbbd336 | |||
99ed5b4bee | |||
1fe181e36f | |||
735329b824 | |||
46d4a5e047 | |||
dd9b3fb594 | |||
2be79b1d5e | |||
19d1bf2562 | |||
0cd119e7b8 | |||
4dac0a1105 | |||
52e51d278e | |||
4d713eabf5 | |||
c7095a4b4c | |||
443698d2b2 | |||
406c05f2e7 | |||
c8070bf632 | |||
65316d7940 | |||
d6511cf6de | |||
9e58678a98 | |||
231dde6dc4 | |||
5b6c39f51f | |||
d052118dae | |||
37abbb387e | |||
17bfd657b7 | |||
890915054f | |||
e0a2770f67 | |||
fe54138020 | |||
6954d44e53 | |||
1c947488f6 | |||
c8ef64bdd7 | |||
8af87ea251 | |||
4275be68fb | |||
261c3a8fd0 | |||
12b6851d54 | |||
d6bd288da2 | |||
46971d5ed7 | |||
88053456f8 | |||
7386d78e6d | |||
55d0a68596 | |||
bd4edfeedd | |||
c7cbbfa43b | |||
d6eceb568f | |||
fbba4423e9 | |||
6c996bfc8f | |||
37e72aa542 | |||
83467de3ed | |||
ffafc252dd | |||
4015331b73 | |||
bc79ee38bb | |||
2ad1ca3f6c | |||
950c8b3916 | |||
06522492f9 | |||
2a37fb80eb | |||
c193699d34 | |||
0dbcac6598 | |||
34ac4c1fe7 | |||
b0119de82f | |||
83dfc25c02 | |||
ea5775bf8e | |||
ad17ffa034 | |||
7924fec593 | |||
8f06d6b103 | |||
0388d10a1f | |||
ca34b4d777 | |||
630cf4e22d | |||
cb48d5d71c | |||
33a7dc93d8 | |||
13a223253c | |||
e03a902735 | |||
8b5ab9fc90 | |||
043d702f02 | |||
922f5e6845 | |||
bd24695a23 | |||
b496213406 | |||
5af1e59d2d | |||
970c143497 | |||
7f3646c81d | |||
53f5386a2e | |||
0d575be45a | |||
0b05f6c26f | |||
f99b202f5b | |||
698d80a824 | |||
9fcbbd92bf | |||
0ff5cea597 | |||
d010b68962 | |||
337dce1e24 | |||
9604a4618a | |||
6a28a6f297 | |||
5614e868e1 | |||
b679ebe877 | |||
f1bd11bf87 | |||
ecd25f5262 | |||
830ba76c3e | |||
a485cae819 | |||
264ed02079 | |||
829b6420d8 | |||
6313259ada | |||
ca05a72db6 | |||
7c4bc3f92f | |||
9e8517c745 | |||
13d98d68fc | |||
b7e008d3dd | |||
6d4eb1985c | |||
ded70984f3 | |||
b5259e7e11 | |||
bd31fa766a | |||
c2fb8bfee3 | |||
0604e9efe0 | |||
e5fc0aad31 | |||
6add3883a6 | |||
34cd4f9076 | |||
7e58aaa7ae | |||
6ded3ebad5 | |||
f4cbc9370e | |||
4cea12bb69 | |||
e4c7e12300 | |||
53611889ff | |||
ed671f0e88 | |||
9e8c4fe304 | |||
7e6a06aeae | |||
0e459cbdfb | |||
36c612b21c | |||
e4471a7ac7 | |||
43b897c17a | |||
289d52c49e | |||
7125975d3c | |||
30bc0a10f3 | |||
1b3370b43f | |||
aff9fb9045 | |||
9c5470d292 | |||
8c0c10475d | |||
506629e619 | |||
2e59a005fd | |||
ccae0a4074 | |||
2ddb440cbb | |||
f998f82598 | |||
5257bac05a | |||
e2d2b7d577 | |||
762863d728 | |||
be2d2e06e2 | |||
63efdb85c1 | |||
bae8899a46 | |||
3130848a10 | |||
52037657dc | |||
a3d570c7b9 | |||
bd0af10802 | |||
7989276259 | |||
3693a02fff | |||
54f4ed6ba1 | |||
1c9968a2b1 | |||
c9319f315c | |||
34e5d2941c | |||
6f61232852 | |||
62db1b13f7 | |||
ca1a1b06d0 | |||
abb02bd18b | |||
73bc9c163c | |||
5abce0805b | |||
a2b2ada85c | |||
466f86052f | |||
af61834687 | |||
491b4eab14 | |||
4fb8dd5493 | |||
4a00119a0a | |||
f8a5192347 | |||
dd6b3318f3 | |||
c3e308c2fe | |||
792322f00d | |||
746f4373e7 | |||
d48717054c | |||
e8a4ea75a3 | |||
04a31e99fc | |||
e8c92c3b17 | |||
b6ee63d8bb | |||
c38d4d54c6 | |||
bff6ac7b63 | |||
b6dbbdc9fe | |||
055c2b25d2 | |||
773c8bac35 | |||
965c1bfee4 | |||
5305c55849 | |||
bc898df2c7 | |||
3527f16a94 | |||
ea960fb719 | |||
8492cd2084 | |||
2a23198886 | |||
3540f6af23 | |||
069252f0e6 | |||
b43401b915 |
@ -1,7 +1,5 @@
|
||||
*.a
|
||||
*.o
|
||||
*.orig
|
||||
*.rej
|
||||
*~
|
||||
.git
|
||||
ABOUT-NLS
|
||||
@ -27,7 +25,6 @@ libvirt.pc
|
||||
libvirt.spec
|
||||
ltconfig
|
||||
ltmain.sh
|
||||
m4
|
||||
mingw32-libvirt.spec
|
||||
mkinstalldirs
|
||||
results.log
|
||||
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,7 +1,5 @@
|
||||
*.a
|
||||
*.o
|
||||
*.orig
|
||||
*.rej
|
||||
*~
|
||||
.git
|
||||
ABOUT-NLS
|
||||
@ -27,7 +25,6 @@ libvirt.pc
|
||||
libvirt.spec
|
||||
ltconfig
|
||||
ltmain.sh
|
||||
m4
|
||||
mingw32-libvirt.spec
|
||||
mkinstalldirs
|
||||
results.log
|
||||
|
275
.hgignore
Normal file
275
.hgignore
Normal file
@ -0,0 +1,275 @@
|
||||
syntax: glob
|
||||
*.a
|
||||
*.o
|
||||
*~
|
||||
.git
|
||||
ABOUT-NLS
|
||||
COPYING
|
||||
INSTALL
|
||||
Makefile
|
||||
Makefile.in
|
||||
aclocal.m4
|
||||
autom4te.cache
|
||||
build-aux/compile
|
||||
build-aux/config.guess
|
||||
build-aux/config.rpath
|
||||
build-aux/config.sub
|
||||
build-aux/depcomp
|
||||
build-aux/install-sh
|
||||
build-aux/ltmain.sh
|
||||
build-aux/missing
|
||||
build-aux/mkinstalldirs
|
||||
build-aux/mktempd
|
||||
config.cache
|
||||
config.guess
|
||||
config.h
|
||||
config.h.in
|
||||
config.log
|
||||
config.rpath
|
||||
config.status
|
||||
config.sub
|
||||
configure
|
||||
coverage
|
||||
docs/.memdump
|
||||
docs/Makefile
|
||||
docs/Makefile.in
|
||||
docs/apibuild.pyc
|
||||
docs/devhelp/Makefile
|
||||
docs/devhelp/Makefile.in
|
||||
docs/devhelp/libvirt.devhelp
|
||||
docs/examples/.deps
|
||||
docs/examples/.libs
|
||||
docs/examples/.memdump
|
||||
docs/examples/Makefile
|
||||
docs/examples/Makefile.in
|
||||
docs/examples/info1
|
||||
docs/examples/python/Makefile
|
||||
docs/examples/python/Makefile.in
|
||||
docs/examples/suspend
|
||||
examples/domain-events/events-c/*.exe
|
||||
examples/domain-events/events-c/.deps
|
||||
examples/domain-events/events-c/.libs
|
||||
examples/domain-events/events-c/Makefile
|
||||
examples/domain-events/events-c/Makefile.in
|
||||
examples/domain-events/events-c/event-test
|
||||
gnulib/lib/*.la
|
||||
gnulib/lib/*.lo
|
||||
gnulib/lib/.deps
|
||||
gnulib/lib/.libs
|
||||
gnulib/lib/Makefile
|
||||
gnulib/lib/Makefile.in
|
||||
gnulib/lib/alloca.h
|
||||
gnulib/lib/arpa/inet.h
|
||||
gnulib/lib/arpa_inet.h
|
||||
gnulib/lib/errno.h
|
||||
gnulib/lib/float.h
|
||||
gnulib/lib/netdb.h
|
||||
gnulib/lib/netinet/in.h
|
||||
gnulib/lib/netinet_in.h
|
||||
gnulib/lib/poll.h
|
||||
gnulib/lib/stdbool.h
|
||||
gnulib/lib/stdint.h
|
||||
gnulib/lib/stdio.h
|
||||
gnulib/lib/stdlib.h
|
||||
gnulib/lib/string.h
|
||||
gnulib/lib/sys/select.h
|
||||
gnulib/lib/sys/socket.h
|
||||
gnulib/lib/sys/stat.h
|
||||
gnulib/lib/sys/time.h
|
||||
gnulib/lib/sys_ioctl.h
|
||||
gnulib/lib/sys_select.h
|
||||
gnulib/lib/sys_socket.h
|
||||
gnulib/lib/sys_stat.h
|
||||
gnulib/lib/sys_time.h
|
||||
gnulib/lib/time.h
|
||||
gnulib/lib/unistd.h
|
||||
gnulib/lib/wchar.h
|
||||
gnulib/tests/.deps
|
||||
gnulib/tests/.libs
|
||||
gnulib/tests/Makefile
|
||||
gnulib/tests/Makefile.in
|
||||
gnulib/tests/sys
|
||||
gnulib/tests/test-EOVERFLOW
|
||||
gnulib/tests/test-alloca-opt
|
||||
gnulib/tests/test-arpa_inet
|
||||
gnulib/tests/test-c-ctype
|
||||
gnulib/tests/test-errno
|
||||
gnulib/tests/test-fseeko
|
||||
gnulib/tests/test-getaddrinfo
|
||||
gnulib/tests/test-getdelim
|
||||
gnulib/tests/test-gethostname
|
||||
gnulib/tests/test-getline
|
||||
gnulib/tests/test-gettimeofday
|
||||
gnulib/tests/test-lseek
|
||||
gnulib/tests/test-lstat
|
||||
gnulib/tests/test-netdb
|
||||
gnulib/tests/test-netinet_in
|
||||
gnulib/tests/test-perror
|
||||
gnulib/tests/test-poll
|
||||
gnulib/tests/test-random_r
|
||||
gnulib/tests/test-snprintf
|
||||
gnulib/tests/test-sockets
|
||||
gnulib/tests/test-stdbool
|
||||
gnulib/tests/test-stdint
|
||||
gnulib/tests/test-stdio
|
||||
gnulib/tests/test-stdlib
|
||||
gnulib/tests/test-strerror
|
||||
gnulib/tests/test-string
|
||||
gnulib/tests/test-sys_select
|
||||
gnulib/tests/test-sys_socket
|
||||
gnulib/tests/test-sys_stat
|
||||
gnulib/tests/test-sys_time
|
||||
gnulib/tests/test-time
|
||||
gnulib/tests/test-unistd
|
||||
gnulib/tests/test-vasnprintf
|
||||
gnulib/tests/test-vasprintf
|
||||
gnulib/tests/test-wchar
|
||||
include/Makefile
|
||||
include/Makefile.in
|
||||
include/libvirt/Makefile
|
||||
include/libvirt/Makefile.in
|
||||
libtool
|
||||
libvirt-*.tar.gz
|
||||
libvirt.pc
|
||||
libvirt.spec
|
||||
ltconfig
|
||||
ltmain.sh
|
||||
m4/Makefile
|
||||
m4/Makefile.in
|
||||
m4/acinclude.m4
|
||||
m4/aclocal.m4
|
||||
m4/codeset.m4
|
||||
m4/gettext.m4
|
||||
m4/glibc21.m4
|
||||
m4/iconv.m4
|
||||
m4/intdiv0.m4
|
||||
m4/intmax.m4
|
||||
m4/inttypes-pri.m4
|
||||
m4/inttypes.m4
|
||||
m4/inttypes_h.m4
|
||||
m4/isc-posix.m4
|
||||
m4/lcmessage.m4
|
||||
m4/lib-ld.m4
|
||||
m4/lib-link.m4
|
||||
m4/lib-prefix.m4
|
||||
m4/libtool.m4
|
||||
m4/longdouble.m4
|
||||
m4/longlong.m4
|
||||
m4/ltoptions.m4
|
||||
m4/ltsugar.m4
|
||||
m4/ltversion.m4
|
||||
m4/lt~obsolete.m4
|
||||
m4/nls.m4
|
||||
m4/po.m4
|
||||
m4/printf-posix.m4
|
||||
m4/progtest.m4
|
||||
m4/signed.m4
|
||||
m4/size_max.m4
|
||||
m4/stdint_h.m4
|
||||
m4/uintmax_t.m4
|
||||
m4/ulonglong.m4
|
||||
m4/wchar_t.m4
|
||||
m4/wint_t.m4
|
||||
m4/xsize.m4
|
||||
mingw32-libvirt.spec
|
||||
mkinstalldirs
|
||||
po/*.gmo
|
||||
po/Makefile
|
||||
po/Makefile.in
|
||||
po/Makefile.in.in
|
||||
po/Makevars.template
|
||||
po/POTFILES
|
||||
po/Rules-quot
|
||||
po/boldquot.sed
|
||||
po/en@boldquot.header
|
||||
po/en@quot.header
|
||||
po/insert-header.sin
|
||||
po/quot.sed
|
||||
po/remove-potcdate.sed
|
||||
po/remove-potcdate.sin
|
||||
po/stamp-po
|
||||
proxy/.deps
|
||||
proxy/.libs
|
||||
proxy/Makefile
|
||||
proxy/Makefile.in
|
||||
proxy/libvirt_proxy
|
||||
python/*.la
|
||||
python/*.lo
|
||||
python/*.loT
|
||||
python/*.pyc
|
||||
python/.deps
|
||||
python/.libs
|
||||
python/Makefile
|
||||
python/Makefile.in
|
||||
python/gen_prog
|
||||
python/libvirt-export.c
|
||||
python/libvirt-py.[ch]
|
||||
python/libvirt.py
|
||||
python/libvirtclass.py
|
||||
python/libvirtclass.txt
|
||||
python/tests/Makefile
|
||||
python/tests/Makefile.in
|
||||
qemud/*.gcda
|
||||
qemud/*.gcno
|
||||
qemud/*.la
|
||||
qemud/*.lo
|
||||
qemud/.deps
|
||||
qemud/.libs
|
||||
qemud/Makefile
|
||||
qemud/Makefile.in
|
||||
qemud/libvirt_qemud
|
||||
qemud/libvirtd
|
||||
qemud/libvirtd.init
|
||||
qemud/libvirtd.logrotate
|
||||
results.log
|
||||
src/*.cov
|
||||
src/*.exe
|
||||
src/*.gcda
|
||||
src/*.gcno
|
||||
src/*.gcov
|
||||
src/*.la
|
||||
src/*.lo
|
||||
src/*.loT
|
||||
src/.deps
|
||||
src/.libs
|
||||
src/Makefile
|
||||
src/Makefile.in
|
||||
src/libvirt.syms
|
||||
src/libvirt_lxc
|
||||
src/libvirt_parthelper
|
||||
src/virsh
|
||||
src/virsh-net-edit.c
|
||||
src/virsh-pool-edit.c
|
||||
stamp-h
|
||||
stamp-h.in
|
||||
stamp-h1
|
||||
tests/*.exe
|
||||
tests/*.gcda
|
||||
tests/*.gcno
|
||||
tests/.deps
|
||||
tests/.libs
|
||||
tests/Makefile
|
||||
tests/Makefile.in
|
||||
tests/confdata/Makefile
|
||||
tests/confdata/Makefile.in
|
||||
tests/conftest
|
||||
tests/nodeinfotest
|
||||
tests/qemuxml2argvtest
|
||||
tests/qemuxml2xmltest
|
||||
tests/qparamtest
|
||||
tests/reconnect
|
||||
tests/sexpr2xmldata/Makefile
|
||||
tests/sexpr2xmldata/Makefile.in
|
||||
tests/sexpr2xmltest
|
||||
tests/statstest
|
||||
tests/virshtest
|
||||
tests/xencapsdata/Makefile
|
||||
tests/xencapsdata/Makefile.in
|
||||
tests/xencapstest
|
||||
tests/xmconfigdata/Makefile
|
||||
tests/xmconfigdata/Makefile.in
|
||||
tests/xmconfigtest
|
||||
tests/xml2sexprdata/Makefile
|
||||
tests/xml2sexprdata/Makefile.in
|
||||
tests/xml2sexprtest
|
||||
update.log
|
@ -1,4 +1,5 @@
|
||||
^src/util\.c$
|
||||
^src/xend_internal\.c$
|
||||
^src/util-lib\.c$
|
||||
^qemud/qemud.c$
|
||||
^gnulib/
|
||||
|
1
.x-sc_prohibit_HAVE_MBRTOWC
Normal file
1
.x-sc_prohibit_HAVE_MBRTOWC
Normal file
@ -0,0 +1 @@
|
||||
gnulib/.*
|
8
.x-sc_prohibit_VIR_ERR_NO_MEMORY
Normal file
8
.x-sc_prohibit_VIR_ERR_NO_MEMORY
Normal file
@ -0,0 +1,8 @@
|
||||
ChangeLog
|
||||
docs/devhelp/libvirt-virterror.html
|
||||
docs/html/libvirt-virterror.html
|
||||
docs/libvirt-api.xml
|
||||
docs/libvirt-refs.xml
|
||||
include/libvirt/virterror.h
|
||||
qemud/remote.c
|
||||
src/virterror.c
|
3
.x-sc_prohibit_asprintf
Normal file
3
.x-sc_prohibit_asprintf
Normal file
@ -0,0 +1,3 @@
|
||||
^gnulib/
|
||||
^po/
|
||||
ChangeLog
|
3
.x-sc_prohibit_gethostby
Normal file
3
.x-sc_prohibit_gethostby
Normal file
@ -0,0 +1,3 @@
|
||||
gnulib/lib/getaddrinfo.c
|
||||
gnulib/m4/
|
||||
src/xend_internal.c
|
8
.x-sc_prohibit_nonreentrant
Normal file
8
.x-sc_prohibit_nonreentrant
Normal file
@ -0,0 +1,8 @@
|
||||
^gnulib/
|
||||
^po/
|
||||
ChangeLog
|
||||
^Makefile*
|
||||
^docs/
|
||||
^tests/
|
||||
^src/virsh.c
|
||||
^build-aux/
|
2
.x-sc_require_config_h_first
Normal file
2
.x-sc_require_config_h_first
Normal file
@ -0,0 +1,2 @@
|
||||
^docs/examples/info1\.c$
|
||||
^docs/examples/suspend\.c$
|
12
AUTHORS
12
AUTHORS
@ -20,7 +20,8 @@ The primary maintainers and people with commit access rights:
|
||||
Dave Leskovec <dlesko@linux.vnet.ibm.com>
|
||||
Cole Robinson <crobinso@redhat.com>
|
||||
Dan Smith <danms@us.ibm.com>
|
||||
Guido Guenther <agx@sigxcpu.org>
|
||||
Guido Günther <agx@sigxcpu.org>
|
||||
John Levon <john.levon@sun.com>
|
||||
|
||||
Patches have also been contributed by:
|
||||
|
||||
@ -47,18 +48,23 @@ Patches have also been contributed by:
|
||||
Stefan de Konink <dekonink@kinkrsoftware.nl>
|
||||
Kaitlin Rupert <kaitlin@linux.vnet.ibm.com>
|
||||
Evgeniy Sokolov <evg@openvz.org>
|
||||
John Levon <john.levon@sun.com>
|
||||
David Lively <dlively@virtualiron.com>
|
||||
Charles Duffy <Charles_Duffy@messageone.com>
|
||||
Nguyen Anh Quynh <aquynh@gmail.com>
|
||||
James Morris <jmorris@namei.org>
|
||||
Chris Wrigh <chrisw@redhat.com>
|
||||
Ben Guthro <bguthro@virtualiron.com>
|
||||
Ben Guthro <ben.guthro@gmail.com>
|
||||
Shigeki Sakamoto <fj0588di@aa.jp.fujitsu.com>
|
||||
Gerd von Egidy <lists@egidy.de>
|
||||
Itamar Heim <iheim@redhat.com>
|
||||
Dave Allan <dallan@redhat.com>
|
||||
Markus Armbruster <armbru@redhat.com>
|
||||
|
||||
[....send patches to get your name here....]
|
||||
|
||||
The libvirt Logo was designed by Diana Fong
|
||||
|
||||
-- End
|
||||
;; Local Variables:
|
||||
;; coding: utf-8
|
||||
;; End:
|
||||
|
72
HACKING
72
HACKING
@ -91,6 +91,62 @@ Usually they're in macro definitions or strings, and should be converted
|
||||
anyhow.
|
||||
|
||||
|
||||
C types
|
||||
=======
|
||||
Use the right type.
|
||||
|
||||
Scalars
|
||||
-------
|
||||
If you're using "int" or "long", odds are good that there's a better type.
|
||||
If a variable is counting something, be sure to declare it with an
|
||||
unsigned type.
|
||||
If it's memory-size-related, use size_t (use ssize_t only if required).
|
||||
If it's file-size related, use uintmax_t, or maybe off_t.
|
||||
If it's file-offset related (i.e., signed), use off_t.
|
||||
If it's just counting small numbers use "unsigned int";
|
||||
(on all but oddball embedded systems, you can assume that that
|
||||
type is at least four bytes wide).
|
||||
If a variable has boolean semantics, give it the "bool" type
|
||||
and use the corresponding "true" and "false" macros. It's ok
|
||||
to include <stdbool.h>, since libvirt's use of gnulib ensures
|
||||
that it exists and is usable.
|
||||
In the unusual event that you require a specific width, use a
|
||||
standard type like int32_t, uint32_t, uint64_t, etc.
|
||||
|
||||
While using "bool" is good for readability, it comes with minor caveats:
|
||||
- Don't use "bool" in places where the type size must be constant across
|
||||
all systems, like public interfaces and on-the-wire protocols. Note
|
||||
that it would be possible (albeit wasteful) to use "bool" in libvirt's
|
||||
logical wire protocol, since XDR maps that to its lower-level bool_t
|
||||
type, which *is* fixed-size.
|
||||
- Don't compare a bool variable against the literal, "true",
|
||||
since a value with a logical non-false value need not be "1".
|
||||
I.e., don't write "if (seen == true) ...". Rather, write "if (seen)...".
|
||||
|
||||
Of course, take all of the above with a grain of salt. If you're about
|
||||
to use some system interface that requires a type like size_t, pid_t or
|
||||
off_t, use matching types for any corresponding variables.
|
||||
|
||||
Also, if you try to use e.g., "unsigned int" as a type, and that
|
||||
conflicts with the signedness of a related variable, sometimes
|
||||
it's best just to use the *wrong* type, if "pulling the thread"
|
||||
and fixing all related variables would be too invasive.
|
||||
|
||||
Finally, while using descriptive types is important, be careful not to
|
||||
go overboard. If whatever you're doing causes warnings, or requires
|
||||
casts, then reconsider or ask for help.
|
||||
|
||||
Pointers
|
||||
--------
|
||||
Ensure that all of your pointers are "const-correct".
|
||||
Unless a pointer is used to modify the pointed-to storage,
|
||||
give it the "const" attribute. That way, the reader knows
|
||||
up-front that this is a read-only pointer. Perhaps more
|
||||
importantly, if we're diligent about this, when you see a non-const
|
||||
pointer, you're guaranteed that it is used to modify the storage
|
||||
it points to, or it is aliased to another pointer that is.
|
||||
|
||||
|
||||
Low level memory management
|
||||
===========================
|
||||
|
||||
@ -247,6 +303,22 @@ are some special reasons why you cannot include these files
|
||||
explicitly.
|
||||
|
||||
|
||||
Printf-style functions
|
||||
======================
|
||||
|
||||
Whenever you add a new printf-style function, i.e., one with a format
|
||||
string argument and following "..." in its prototype, be sure to use
|
||||
gcc's printf attribute directive in the prototype. For example, here's
|
||||
the one for virAsprintf, in util.h:
|
||||
|
||||
int virAsprintf(char **strp, const char *fmt, ...)
|
||||
ATTRIBUTE_FORMAT(printf, 2, 3);
|
||||
|
||||
This makes it so gcc's -Wformat and -Wformat-security options can do
|
||||
their jobs and cross-check format strings with the number and types
|
||||
of arguments.
|
||||
|
||||
|
||||
|
||||
Libvirt commiters guidelines
|
||||
============================
|
||||
|
@ -14,8 +14,11 @@ EXTRA_DIST = \
|
||||
libvirt.pc libvirt.pc.in \
|
||||
$(man_MANS) autobuild.sh \
|
||||
.x-sc_avoid_if_before_free \
|
||||
.x-sc_require_config_h_first \
|
||||
.x-sc_prohibit_strcmp \
|
||||
.x-sc_require_config_h \
|
||||
.x-sc_prohibit_nonreentrant \
|
||||
Makefile.nonreentrant \
|
||||
autogen.sh
|
||||
|
||||
man_MANS = virsh.1
|
||||
|
21
Makefile.cfg
21
Makefile.cfg
@ -1,5 +1,5 @@
|
||||
# Customize Makefile.maint. -*- makefile -*-
|
||||
# Copyright (C) 2003-2008 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2003-2009 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -26,29 +26,36 @@ url_dir_list = \
|
||||
|
||||
# Tests not to run as part of "make distcheck".
|
||||
local-checks-to-skip = \
|
||||
makefile_path_separator_check \
|
||||
changelog-check \
|
||||
check-AUTHORS \
|
||||
makefile-check \
|
||||
sc_tight_scope \
|
||||
makefile_path_separator_check \
|
||||
patch-check \
|
||||
sc_GPL_version \
|
||||
sc_always_defined_macros \
|
||||
sc_cast_of_alloca_return_value \
|
||||
sc_dd_max_sym_length \
|
||||
sc_error_exit_success \
|
||||
sc_file_system \
|
||||
sc_immutable_NEWS \
|
||||
sc_m4_quote_check \
|
||||
sc_makefile_path_separator_check \
|
||||
sc_obsolete_symbols \
|
||||
sc_prohibit_S_IS_definition \
|
||||
sc_prohibit_atoi_atof \
|
||||
sc_prohibit_jm_in_m4 \
|
||||
sc_prohibit_nonreentrant \
|
||||
sc_prohibit_quote_without_use \
|
||||
sc_prohibit_quotearg_without_use \
|
||||
sc_prohibit_stat_st_blocks \
|
||||
sc_redundant_const \
|
||||
sc_root_tests \
|
||||
sc_space_tab \
|
||||
sc_sun_os_names \
|
||||
sc_system_h_headers \
|
||||
sc_tight_scope \
|
||||
sc_two_space_separator_in_usage \
|
||||
sc_useless_cpp_parens \
|
||||
patch-check \
|
||||
check-AUTHORS \
|
||||
changelog-check
|
||||
sc_useless_cpp_parens
|
||||
|
||||
useless_free_options = \
|
||||
--name=sexpr_free \
|
||||
|
637
Makefile.maint
637
Makefile.maint
@ -8,11 +8,13 @@ gzip_rsyncable := \
|
||||
$(shell gzip --help 2>/dev/null|grep rsyncable >/dev/null && echo --rsyncable)
|
||||
GZIP_ENV = '--no-name --best $(gzip_rsyncable)'
|
||||
|
||||
VC_LIST = build-aux/vc-list-files
|
||||
VC_LIST = $(srcdir)/build-aux/vc-list-files
|
||||
|
||||
VC_LIST_EXCEPT = \
|
||||
$(VC_LIST) | if test -f .x-$@; then grep -vEf .x-$@; else grep -v ChangeLog; fi
|
||||
|
||||
include Makefile.nonreentrant
|
||||
|
||||
# Prevent programs like 'sort' from considering distinct strings to be equal.
|
||||
# Doing it here saves us from having to set LC_ALL elsewhere in this file.
|
||||
export LC_ALL = C
|
||||
@ -23,12 +25,15 @@ syntax-check-rules := $(shell sed -n 's/^\(sc_[a-zA-Z0-9_-]*\):.*/\1/p' \
|
||||
.PHONY: $(syntax-check-rules)
|
||||
|
||||
local-checks-available = \
|
||||
po-check copyright-check m4-check author_mark_check \
|
||||
patch-check strftime-check $(syntax-check-rules) \
|
||||
makefile_path_separator_check \
|
||||
patch-check $(syntax-check-rules) \
|
||||
makefile-check check-AUTHORS
|
||||
.PHONY: $(local-checks-available)
|
||||
|
||||
# Arrange to print the name of each syntax-checking rule just before running it.
|
||||
$(syntax-check-rules): %: %.m
|
||||
$(patsubst %, %.m, $(syntax-check-rules)):
|
||||
@echo $(patsubst sc_%.m, %, $@)
|
||||
|
||||
local-check := $(filter-out $(local-checks-to-skip), $(local-checks-available))
|
||||
|
||||
syntax-check: $(local-check)
|
||||
@ -43,6 +48,21 @@ syntax-check: $(local-check)
|
||||
# exit 1; } || :
|
||||
# FIXME: don't allow `#include .strings\.h' anywhere
|
||||
|
||||
# By default, _prohibit_regexp does not ignore case.
|
||||
export ignore_case =
|
||||
_ignore_case = $$(test -n "$$ignore_case" && echo -i || :)
|
||||
|
||||
# There are many rules below that prohibit constructs in this package.
|
||||
# If the offending construct can be matched with a grep-E-style regexp,
|
||||
# use this macro. The shell variables "re" and "msg" must be defined.
|
||||
define _prohibit_regexp
|
||||
dummy=; : so we do not need a semicolon before each use \
|
||||
test "x$$re" != x || { echo '$(ME): re not defined' 1>&2; exit 1; }; \
|
||||
test "x$$msg" != x || { echo '$(ME): msg not defined' 1>&2; exit 1; };\
|
||||
grep $(_ignore_case) -nE "$$re" $$($(VC_LIST_EXCEPT)) && \
|
||||
{ echo '$(ME): '"$$msg" 1>&2; exit 1; } || :
|
||||
endef
|
||||
|
||||
sc_avoid_if_before_free:
|
||||
@$(srcdir)/build-aux/useless-if-before-free \
|
||||
$(useless_free_options) \
|
||||
@ -62,41 +82,59 @@ sc_avoid_write:
|
||||
fi
|
||||
|
||||
sc_cast_of_argument_to_free:
|
||||
@grep -nE '\<free \(\(' $$($(VC_LIST_EXCEPT)) && \
|
||||
{ echo '$(ME): don'\''t cast free argument' 1>&2; \
|
||||
exit 1; } || :
|
||||
@re='\<free *\( *\(' msg='don'\''t cast free argument' \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
sc_cast_of_x_alloc_return_value:
|
||||
@grep -nE '\*\) *x(m|c|re)alloc\>' $$($(VC_LIST_EXCEPT)) && \
|
||||
{ echo '$(ME): don'\''t cast x*alloc return value' 1>&2; \
|
||||
exit 1; } || :
|
||||
@re='\*\) *x(m|c|re)alloc\>' \
|
||||
msg='don'\''t cast x*alloc return value' \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
sc_cast_of_alloca_return_value:
|
||||
@grep -nE '\*\) *alloca\>' $$($(VC_LIST_EXCEPT)) && \
|
||||
{ echo '$(ME): don'\''t cast alloca return value' 1>&2; \
|
||||
exit 1; } || :
|
||||
@re='\*\) *alloca\>' msg='don'\''t cast alloca return value' \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
sc_space_tab:
|
||||
@grep -n '[ ] ' $$($(VC_LIST_EXCEPT)) && \
|
||||
{ echo '$(ME): found SPACE-TAB sequence; remove the SPACE' \
|
||||
1>&2; exit 1; } || :
|
||||
@re='[ ] ' msg='found SPACE-TAB sequence; remove the SPACE' \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
# Don't use *scanf or the old ato* functions in `real' code.
|
||||
# They provide no error checking mechanism.
|
||||
# Instead, use strto* functions.
|
||||
sc_prohibit_atoi_atof:
|
||||
@grep -nE '\<([fs]?scanf|ato([filq]|ll))\>' $$($(VC_LIST_EXCEPT)) && \
|
||||
{ echo '$(ME): do not use *scan''f, ato''f, ato''i, ato''l, ato''ll, ato''q, or ss''canf' \
|
||||
1>&2; exit 1; } || :
|
||||
@re='\<([fs]?scanf|ato([filq]|ll))\>' \
|
||||
msg='do not use *scan''f, ato''f, ato''i, ato''l, ato''ll or ato''q' \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
# Use STREQ rather than comparing strcmp == 0, or != 0.
|
||||
# Similarly, use STREQLEN or STRPREFIX rather than strncmp.
|
||||
sc_prohibit_strcmp:
|
||||
@grep -nE '! *str''n?cmp *\(|\<str''n?cmp *\([^)]+\) *==' \
|
||||
$$($(VC_LIST_EXCEPT)) && \
|
||||
{ echo '$(ME): use STREQ in place of the above uses of str''cmp' \
|
||||
@grep -nE '! *strn?cmp *\(|\<strn?cmp *\([^)]+\) *==' \
|
||||
$$($(VC_LIST_EXCEPT)) \
|
||||
| grep -vE ':# *define STREQ(LEN)?\(' && \
|
||||
{ echo '$(ME): use STREQ(LEN) in place of the above uses of strcmp(strncmp)' \
|
||||
1>&2; exit 1; } || :
|
||||
|
||||
# Use virAsprintf rather than a'sprintf since *strp is undefined on error.
|
||||
sc_prohibit_asprintf:
|
||||
@re='\<[a]sprintf\>' \
|
||||
msg='use virAsprintf, not a'sprintf \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
sc_prohibit_VIR_ERR_NO_MEMORY:
|
||||
@re='\<V''IR_ERR_NO_MEMORY\>' \
|
||||
msg='use virReportOOMError, not V'IR_ERR_NO_MEMORY \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
sc_prohibit_nonreentrant:
|
||||
@fail=0 ; \
|
||||
for i in $(NON_REENTRANT) ; \
|
||||
do \
|
||||
grep --before 2 --after 1 -nE "\<$$i\>[:space:]*\(" $$($(VC_LIST_EXCEPT)) && \
|
||||
fail=1 && echo "$(ME): use $${i}_r, not $${i}" || : ; \
|
||||
done ; \
|
||||
exit $$fail
|
||||
|
||||
# Using EXIT_SUCCESS as the first argument to error is misleading,
|
||||
# since when that parameter is 0, error does not exit. Use `0' instead.
|
||||
sc_error_exit_success:
|
||||
@ -106,12 +144,12 @@ sc_error_exit_success:
|
||||
exit 1; } || :
|
||||
|
||||
sc_file_system:
|
||||
@grep -ni 'file''system' $$($(VC_LIST_EXCEPT)) && \
|
||||
{ echo '$(ME): found use of "file''system";' \
|
||||
'rewrite to use "file system"' 1>&2; \
|
||||
exit 1; } || :
|
||||
@re=file''system ignore_case=1 \
|
||||
msg='found use of "file''system"; spell it "file system"' \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
sc_no_have_config_h:
|
||||
# Don't use cpp tests of this symbol. All code assumes config.h is included.
|
||||
sc_prohibit_have_config_h:
|
||||
@grep -n '^# *if.*HAVE''_CONFIG_H' $$($(VC_LIST_EXCEPT)) && \
|
||||
{ echo '$(ME): found use of HAVE''_CONFIG_H; remove' \
|
||||
1>&2; exit 1; } || :
|
||||
@ -127,6 +165,25 @@ sc_require_config_h:
|
||||
else :; \
|
||||
fi
|
||||
|
||||
# You must include <config.h> before including any other header file.
|
||||
sc_require_config_h_first:
|
||||
@if $(VC_LIST_EXCEPT) | grep '\.c$$' > /dev/null; then \
|
||||
fail=0; \
|
||||
for i in $$($(VC_LIST_EXCEPT) | grep '\.c$$'); do \
|
||||
grep '^# *include\>' $$i | sed 1q \
|
||||
| grep '^# *include <config\.h>' > /dev/null \
|
||||
|| { echo $$i; fail=1; }; \
|
||||
done; \
|
||||
test $$fail = 1 && \
|
||||
{ echo '$(ME): the above files include some other header' \
|
||||
'before <config.h>' 1>&2; exit 1; } || :; \
|
||||
else :; \
|
||||
fi
|
||||
|
||||
sc_prohibit_HAVE_MBRTOWC:
|
||||
@re='\bHAVE_MBRTOWC\b' msg="do not use $$re; it is always defined" \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
# To use this "command" macro, you must first define two shell variables:
|
||||
# h: the header, enclosed in <> or ""
|
||||
# re: a regular expression that matches IFF something provided by $h is used.
|
||||
@ -158,6 +215,36 @@ sc_prohibit_quotearg_without_use:
|
||||
sc_prohibit_quote_without_use:
|
||||
@h='"quote.h"' re='\<quote(_n)? *\(' $(_header_without_use)
|
||||
|
||||
# Don't include this header unless you use one of its functions.
|
||||
sc_prohibit_long_options_without_use:
|
||||
@h='"long-options.h"' re='\<parse_long_options *\(' \
|
||||
$(_header_without_use)
|
||||
|
||||
# Don't include this header unless you use one of its functions.
|
||||
sc_prohibit_inttostr_without_use:
|
||||
@h='"inttostr.h"' re='\<(off|[iu]max|uint)tostr *\(' \
|
||||
$(_header_without_use)
|
||||
|
||||
# Don't include this header unless you use one of its functions.
|
||||
sc_prohibit_error_without_use:
|
||||
@h='"error.h"' \
|
||||
re='\<error(_at_line|_print_progname|_one_per_line|_message_count)? *\('\
|
||||
$(_header_without_use)
|
||||
|
||||
sc_prohibit_safe_read_without_use:
|
||||
@h='"safe-read.h"' re='(\<SAFE_READ_ERROR\>|\<safe_read *\()' \
|
||||
$(_header_without_use)
|
||||
|
||||
sc_prohibit_argmatch_without_use:
|
||||
@h='"argmatch.h"' \
|
||||
re='(\<(ARRAY_CARDINALITY|X?ARGMATCH(|_TO_ARGUMENT|_VERIFY))\>|\<argmatch(_exit_fn|_(in)?valid) *\()' \
|
||||
$(_header_without_use)
|
||||
|
||||
sc_prohibit_root_dev_ino_without_use:
|
||||
@h='"root-dev-ino.h"' \
|
||||
re='(\<ROOT_DEV_INO_(CHECK|WARN)\>|\<get_root_dev_ino *\()' \
|
||||
$(_header_without_use)
|
||||
|
||||
# Prohibit the inclusion of c-ctype.h without an actual use.
|
||||
sc_prohibit_c_ctype_without_use:
|
||||
@h='[<"]c-ctype.h[">]' re='\<c_($(ctype_re)) *\(' $(_header_without_use)
|
||||
@ -169,10 +256,9 @@ sc_prohibit_ctype_h:
|
||||
1>&2; exit 1; } || :
|
||||
|
||||
sc_obsolete_symbols:
|
||||
@grep -nE '\<(HAVE''_FCNTL_H|O''_NDELAY)\>' \
|
||||
$$($(VC_LIST_EXCEPT)) && \
|
||||
{ echo '$(ME): do not use HAVE''_FCNTL_H or O''_NDELAY' \
|
||||
1>&2; exit 1; } || :
|
||||
@re='\<(HAVE''_FCNTL_H|O''_NDELAY)\>' \
|
||||
msg='do not use HAVE''_FCNTL_H or O'_NDELAY \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
# FIXME: warn about definitions of EXIT_FAILURE, EXIT_SUCCESS, STREQ
|
||||
|
||||
@ -186,121 +272,15 @@ sc_changelog:
|
||||
{ echo '$(ME): found unexpected prefix in a ChangeLog' 1>&2; \
|
||||
exit 1; } || :
|
||||
|
||||
# Ensure that dd's definition of LONGEST_SYMBOL stays in sync
|
||||
# with the strings from the two affected variables.
|
||||
dd_c = $(srcdir)/src/dd.c
|
||||
sc_dd_max_sym_length:
|
||||
ifneq ($(wildcard $(dd_c)),)
|
||||
@len=$$( (sed -n '/conversions\[\] =$$/,/^};/p' $(dd_c);\
|
||||
sed -n '/flags\[\] =$$/,/^};/p' $(dd_c) ) \
|
||||
|sed -n '/"/s/^[^"]*"\([^"]*\)".*/\1/p' \
|
||||
| wc --max-line-length); \
|
||||
max=$$(sed -n '/^#define LONGEST_SYMBOL /s///p' $(dd_c) \
|
||||
|tr -d '"' | wc --max-line-length); \
|
||||
if test "$$len" = "$$max"; then :; else \
|
||||
echo 'dd.c: LONGEST_SYMBOL is not longest' 1>&2; \
|
||||
exit 1; \
|
||||
fi
|
||||
endif
|
||||
|
||||
# Many m4 macros names once began with `jm_'.
|
||||
# On 2004-04-13, they were all changed to start with gl_ instead.
|
||||
# Make sure that none are inadvertently reintroduced.
|
||||
sc_prohibit_jm_in_m4:
|
||||
@grep -nE 'jm_[A-Z]' \
|
||||
$$($(VC_LIST) m4 |grep '\.m4$$'; echo /dev/null) && \
|
||||
{ echo '$(ME): do not use jm_ in m4 macro names' \
|
||||
1>&2; exit 1; } || :
|
||||
|
||||
sc_root_tests:
|
||||
@if test -d tests \
|
||||
&& grep check-root tests/Makefile.am>/dev/null 2>&1; then \
|
||||
t1=sc-root.expected; t2=sc-root.actual; \
|
||||
grep -nl '^require_root_$$' \
|
||||
$$($(VC_LIST) tests) |sed s,tests,., |sort > $$t1; \
|
||||
sed -n 's, cd \([^ ]*\) .*MAKE..check TESTS=\(.*\),./\1/\2,p' \
|
||||
$(srcdir)/tests/Makefile.am |sort > $$t2; \
|
||||
diff -u $$t1 $$t2 || diff=1; \
|
||||
rm -f $$t1 $$t2; \
|
||||
test "$$diff" \
|
||||
&& { echo 'tests/Makefile.am: missing check-root action'>&2; \
|
||||
exit 1; } || :; \
|
||||
fi
|
||||
|
||||
headers_with_interesting_macro_defs = \
|
||||
exit.h \
|
||||
fcntl_.h \
|
||||
fnmatch_.h \
|
||||
intprops.h \
|
||||
inttypes_.h \
|
||||
lchown.h \
|
||||
openat.h \
|
||||
stat-macros.h \
|
||||
stdint_.h
|
||||
|
||||
# Create a list of regular expressions matching the names
|
||||
# of macros that are guaranteed by parts of gnulib to be defined.
|
||||
.re-defmac:
|
||||
@(cd $(srcdir)/lib; \
|
||||
for f in $(headers_with_interesting_macro_defs); do \
|
||||
test -f $$f && \
|
||||
sed -n '/^# *define \([^_ (][^ (]*\)[ (].*/s//\1/p' $$f; \
|
||||
done; \
|
||||
) | sort -u \
|
||||
| grep -Ev 'ATTRIBUTE_NORETURN|SIZE_MAX' \
|
||||
| sed 's/^/^# *define /' \
|
||||
> $@-t
|
||||
@mv $@-t $@
|
||||
|
||||
# Don't define macros that we already get from gnulib header files.
|
||||
sc_always_defined_macros: .re-defmac
|
||||
@if test -f $(srcdir)/src/system.h; then \
|
||||
trap 'rc=$$?; rm -f .re-defmac; exit $$rc' 0 1 2 3 15; \
|
||||
grep -f .re-defmac $$($(VC_LIST)) \
|
||||
&& { echo '$(ME): define the above via some gnulib .h file' \
|
||||
1>&2; exit 1; } || :; \
|
||||
fi
|
||||
|
||||
# Create a list of regular expressions matching the names
|
||||
# of files included from system.h. Exclude a couple.
|
||||
.re-list:
|
||||
@sed -n '/^# *include /s///p' $(srcdir)/src/system.h \
|
||||
| grep -Ev 'sys/(param|file)\.h' \
|
||||
| sed 's/ .*//;;s/^["<]/^# *include [<"]/;s/\.h[">]$$/\\.h[">]/' \
|
||||
> $@-t
|
||||
@mv $@-t $@
|
||||
|
||||
# Files in src/ should not include directly any of
|
||||
# the headers already included via system.h.
|
||||
sc_system_h_headers: .re-list
|
||||
@if test -f $(srcdir)/src/system.h; then \
|
||||
trap 'rc=$$?; rm -f .re-list; exit $$rc' 0 1 2 3 15; \
|
||||
grep -nE -f .re-list \
|
||||
$$($(VC_LIST) src | \
|
||||
grep -Ev '((copy|system)\.h|parse-gram\.c)$$') \
|
||||
&& { echo '$(ME): the above are already included via system.h'\
|
||||
1>&2; exit 1; } || :; \
|
||||
fi
|
||||
|
||||
sc_sun_os_names:
|
||||
@grep -nEi \
|
||||
'solaris[^[:alnum:]]*2\.(7|8|9|[1-9][0-9])|sunos[^[:alnum:]][6-9]' \
|
||||
$$($(VC_LIST_EXCEPT)) && \
|
||||
{ echo '$(ME): found misuse of Sun OS version numbers' 1>&2; \
|
||||
exit 1; } || :
|
||||
|
||||
sc_the_the:
|
||||
@grep -ni '\<the ''the\>' $$($(VC_LIST_EXCEPT)) && \
|
||||
{ echo '$(ME): found use of "the ''the";' 1>&2; \
|
||||
exit 1; } || :
|
||||
|
||||
sc_tight_scope:
|
||||
$(MAKE) -C src $@
|
||||
@re='\<the ''the\>' \
|
||||
ignore_case=1 msg='found use of "the ''the";' \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
sc_trailing_blank:
|
||||
@grep -n '[ ]$$' $$($(VC_LIST_EXCEPT)) && \
|
||||
{ echo '$(ME): found trailing blank(s)' \
|
||||
1>&2; exit 1; } || :
|
||||
@re='[ ]$$' \
|
||||
ignore_case=1 msg='found trailing blank(s)' \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
# Ensure that no C source file uses TABs for indentation.
|
||||
# Also match *.h.in files, to get libvirt.h.in.
|
||||
@ -310,8 +290,8 @@ sc_TAB_in_indentation:
|
||||
$$($(VC_LIST_EXCEPT) \
|
||||
| grep -E '\.[ch](\.in)?$$' \
|
||||
| grep -v '^gnulib/') && \
|
||||
{ echo '$(ME): found TAB(s) use for indentation; use spaces' \
|
||||
1>&2; exit 1; } || :
|
||||
{ echo '$(ME): found TAB(s) used for indentation in C sources;'\
|
||||
'use spaces' 1>&2; exit 1; } || :
|
||||
|
||||
ctype_re = isalnum|isalpha|isascii|isblank|iscntrl|isdigit|isgraph|islower\
|
||||
|isprint|ispunct|isspace|isupper|isxdigit|tolower|toupper
|
||||
@ -333,35 +313,66 @@ sc_two_space_separator_in_usage:
|
||||
echo "$(ME): an option and its description"; \
|
||||
1>&2; exit 1; } || :
|
||||
|
||||
# Many of the function names below came from this filter:
|
||||
# git grep -B2 '\<_('|grep -E '\.c- *[[:alpha:]_][[:alnum:]_]* ?\(.*[,;]$' \
|
||||
# |sed 's/.*\.c- *//'|perl -pe 's/ ?\(.*//'|sort -u \
|
||||
# |grep -vE '^(qsort|if|close|assert|fputc|free|N_|vir.*GetName|.*Unlock|virNodeListDevices|virHashRemoveEntry|freeaddrinfo|.*[fF]ree|xdrmem_create|xmlXPathFreeObject|virUUIDFormat|openvzSetProgramSentinal|polkit_action_unref)$'
|
||||
|
||||
msg_gen_function =
|
||||
msg_gen_function += DEBUG0
|
||||
msg_gen_function += DISABLE_fprintf
|
||||
msg_gen_function += virXendError
|
||||
msg_gen_function += virXMLError
|
||||
msg_gen_function += virHashError
|
||||
msg_gen_function += virConfError
|
||||
msg_gen_function += virTestError
|
||||
msg_gen_function += virLibConnError
|
||||
msg_gen_function += virStorageReportError
|
||||
msg_gen_function += virxmlRpcError
|
||||
msg_gen_function += virLog
|
||||
msg_gen_function += qemudLog
|
||||
msg_gen_function += remoteDispatchError
|
||||
msg_gen_function += virStorageLog
|
||||
msg_gen_function += xenXMError
|
||||
msg_gen_function += ERROR
|
||||
msg_gen_function += ERROR0
|
||||
msg_gen_function += REMOTE_DEBUG
|
||||
msg_gen_function += ReportError
|
||||
msg_gen_function += qemudReportError
|
||||
msg_gen_function += openvzLog
|
||||
msg_gen_function += openvzError
|
||||
msg_gen_function += virDomainReportError
|
||||
msg_gen_function += virReportErrorHelper
|
||||
msg_gen_function += VIR_FREE
|
||||
msg_gen_function += VIR_INFO
|
||||
msg_gen_function += VIR_USE_CPU
|
||||
msg_gen_function += errorf
|
||||
msg_gen_function += lxcError
|
||||
msg_gen_function += networkLog
|
||||
msg_gen_function += networkReportError
|
||||
msg_gen_function += openvzError
|
||||
msg_gen_function += openvzLog
|
||||
msg_gen_function += qemudDispatchClientFailure
|
||||
msg_gen_function += qemudLog
|
||||
msg_gen_function += qemudReportError
|
||||
msg_gen_function += regerror
|
||||
msg_gen_function += remoteDispatchFormatError
|
||||
msg_gen_function += umlLog
|
||||
msg_gen_function += umlReportError
|
||||
msg_gen_function += virConfError
|
||||
msg_gen_function += virDomainReportError
|
||||
msg_gen_function += virHashError
|
||||
msg_gen_function += virLibConnError
|
||||
msg_gen_function += virLibDomainError
|
||||
msg_gen_function += virLog
|
||||
msg_gen_function += virNetworkReportError
|
||||
msg_gen_function += virNodeDeviceReportError
|
||||
msg_gen_function += virProxyError
|
||||
msg_gen_function += virRaiseError
|
||||
msg_gen_function += virReportErrorHelper
|
||||
msg_gen_function += virReportSystemError
|
||||
msg_gen_function += virSexprError
|
||||
msg_gen_function += virStorageLog
|
||||
msg_gen_function += virStorageReportError
|
||||
msg_gen_function += virXMLError
|
||||
msg_gen_function += virXenInotifyError
|
||||
msg_gen_function += virXenStoreError
|
||||
msg_gen_function += virXendError
|
||||
msg_gen_function += vshCloseLogFile
|
||||
msg_gen_function += xenUnifiedError
|
||||
msg_gen_function += xenXMError
|
||||
|
||||
# Uncomment the following and run "make syntax-check" to see diagnostics
|
||||
# that are not yet marked for translation, but that need to be rewritten
|
||||
# so that they are translatable.
|
||||
# msg_gen_function += error
|
||||
# msg_gen_function += virXenError
|
||||
# msg_gen_function += fprintf
|
||||
# msg_gen_function += testError
|
||||
# msg_gen_function += virXenError
|
||||
# msg_gen_function += vshPrint
|
||||
# msg_gen_function += vshError
|
||||
|
||||
func_or := $(shell printf '$(msg_gen_function)'|tr -s '[[:space:]]' '|')
|
||||
func_re := ($(func_or))
|
||||
@ -385,9 +396,16 @@ sc_unmarked_diagnostics:
|
||||
exit 1; } || :
|
||||
|
||||
sc_prohibit_virBufferAdd_with_string_literal:
|
||||
@grep -nE '\<virBufferAdd *\([^,]+, *"[^"]' $$($(VC_LIST_EXCEPT)) && \
|
||||
{ echo '$(ME): use virBufferAddLit, not virBufferAdd,' \
|
||||
'with a string literal' 1>&2; exit 1; } || :
|
||||
@re='\<virBufferAdd *\([^,]+, *"[^"]' \
|
||||
msg='use virBufferAddLit, not virBufferAdd, with a string literal' \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
# Not only do they fail to deal well with ipv6, but the gethostby*
|
||||
# functions are also not thread-safe.
|
||||
sc_prohibit_gethostby:
|
||||
@re='\<gethostby(addr|name2?) *\(' \
|
||||
msg='use getaddrinfo, not gethostby*' \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
# Avoid useless parentheses like those in this example:
|
||||
# #if defined (SYMBOL) || defined (SYM2)
|
||||
@ -398,18 +416,97 @@ sc_useless_cpp_parens:
|
||||
|
||||
# Require the latest GPL.
|
||||
sc_GPL_version:
|
||||
@grep -n 'either ''version [^3]' $$($(VC_LIST_EXCEPT)) && \
|
||||
{ echo '$(ME): GPL vN, N!=3' 1>&2; exit 1; } || :
|
||||
@re='either ''version [^3]' msg='GPL vN, N!=3' \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
cvs_keywords = \
|
||||
Author|Date|Header|Id|Name|Locker|Log|RCSfile|Revision|Source|State
|
||||
|
||||
sc_prohibit_cvs_keyword:
|
||||
@re='\$$($(cvs_keywords))\$$' \
|
||||
msg='do not use CVS keyword expansion' \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
# Make sure we don't use st_blocks. Use ST_NBLOCKS instead.
|
||||
# This is a bit of a kludge, since it prevents use of the string
|
||||
# even in comments, but for now it does the job with no false positives.
|
||||
sc_prohibit_stat_st_blocks:
|
||||
@re='[.>]st_blocks' msg='do not use st_blocks; use ST_NBLOCKS' \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
# Make sure we don't define any S_IS* macros in src/*.c files.
|
||||
# They're already defined via gnulib's sys/stat.h replacement.
|
||||
sc_prohibit_S_IS_definition:
|
||||
@re='^ *# *define *S_IS' \
|
||||
msg='do not define S_IS* macros; include <sys/stat.h>' \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
# Each program that uses proper_name_utf8 must link with
|
||||
# one of the ICONV libraries.
|
||||
sc_proper_name_utf8_requires_ICONV:
|
||||
@progs=$$(grep -l 'proper_name_utf8 ''("' $$($(VC_LIST_EXCEPT)));\
|
||||
if test "x$$progs" != x; then \
|
||||
fail=0; \
|
||||
for p in $$progs; do \
|
||||
dir=$$(dirname "$$p"); \
|
||||
base=$$(basename "$$p" .c); \
|
||||
grep "$${base}_LDADD.*ICONV)" $$dir/Makefile.am > /dev/null \
|
||||
|| { fail=1; echo 1>&2 "$(ME): $$p uses proper_name_utf8"; }; \
|
||||
done; \
|
||||
test $$fail = 1 && \
|
||||
{ echo 1>&2 '$(ME): the above do not link with any ICONV library'; \
|
||||
exit 1; } || :; \
|
||||
fi
|
||||
|
||||
# Warn about "c0nst struct Foo const foo[]",
|
||||
# but not about "char const *const foo" or "#define const const".
|
||||
sc_redundant_const:
|
||||
@grep -E '\bconst\b[[:space:][:alnum:]]{2,}\bconst\b' \
|
||||
$$($(VC_LIST_EXCEPT)) && \
|
||||
{ echo 1>&2 '$(ME): redundant "const" in declarations'; \
|
||||
exit 1; } || :
|
||||
|
||||
sc_const_long_option:
|
||||
@grep '^ *static.*struct option ' $$($(VC_LIST_EXCEPT)) \
|
||||
| grep -Ev 'const struct option|struct option const' && { \
|
||||
echo 1>&2 '$(ME): add "const" to the above declarations'; \
|
||||
exit 1; } || :
|
||||
|
||||
NEWS_hash = \
|
||||
$$(sed -n '/^\*.* $(PREV_VERSION_REGEXP) ([0-9-]*)/,$$p' \
|
||||
$(srcdir)/NEWS | md5sum -)
|
||||
|
||||
# Ensure that we don't accidentally insert an entry into an old NEWS block.
|
||||
sc_immutable_NEWS:
|
||||
@if test -f $(srcdir)/NEWS; then \
|
||||
test "$(NEWS_hash)" = '$(old_NEWS_hash)' && : || \
|
||||
{ echo '$(ME): you have modified old NEWS' 1>&2; exit 1; }; \
|
||||
fi
|
||||
|
||||
# Update the hash stored above. Do this after each release and
|
||||
# for any corrections to old entries.
|
||||
update-NEWS-hash: NEWS
|
||||
perl -pi -e 's/^(old_NEWS_hash = ).*/$${1}'"$(NEWS_hash)/" \
|
||||
$(srcdir)/cfg.mk
|
||||
|
||||
epoch_date = 1970-01-01 00:00:00.000000000 +0000
|
||||
# Ensure that the c99-to-c89 patch applies cleanly.
|
||||
patch-check:
|
||||
rm -rf src-c89 $@.1 $@.2
|
||||
cp -a src src-c89
|
||||
(cd src-c89; patch -p1 -V never --fuzz=0) < src/c99-to-c89.diff \
|
||||
cp -a $(srcdir)/src src-c89
|
||||
if test "x$(srcdir)" != x.; then \
|
||||
cp -a src/* src-c89; \
|
||||
dotfiles=`ls src/.[!.]* 2>/dev/null`; \
|
||||
test -z "$$dotfiles" || cp -a src/.[!.]* src-c89; \
|
||||
fi
|
||||
(cd src-c89; patch -p1 -V never --fuzz=0) < $(srcdir)/src/c99-to-c89.diff \
|
||||
> $@.1 2>&1
|
||||
if test "$$REGEN_PATCH" = yes; then \
|
||||
diff -upr src src-c89 | sed 's,src-c89/,src/,' \
|
||||
| grep -v '^Only in' > new-diff || : ; fi
|
||||
if test "$(REGEN_PATCH)" = yes; then \
|
||||
diff -upr $(srcdir)/src src-c89 | sed 's,$(srcdir)/src-c89/,src/,' \
|
||||
| grep -vE '^(Only in|File )' \
|
||||
| perl -pe 's/^((?:\+\+\+|---) \S+\t).*/$${1}$(epoch_date)/;' \
|
||||
-e 's/^ $$//' \
|
||||
> new-diff || : ; fi
|
||||
grep -v '^patching file ' $@.1 > $@.2 || :
|
||||
msg=ok; test -s $@.2 && msg='fuzzy patch' || : ; \
|
||||
rm -f src-c89/*.o || msg='rm failed'; \
|
||||
@ -418,21 +515,6 @@ patch-check:
|
||||
test "$$msg" = ok && rm -rf src-c89 $@.1 $@.2 || echo "$$msg" 1>&2; \
|
||||
test "$$msg" = ok
|
||||
|
||||
# Ensure that date's --help output stays in sync with the info
|
||||
# documentation for GNU strftime. The only exception is %N,
|
||||
# which date accepts but GNU strftime does not.
|
||||
extract_char = sed 's/^[^%][^%]*%\(.\).*/\1/'
|
||||
strftime-check:
|
||||
@if test -f $(srcdir)/src/date.c; then \
|
||||
grep '^ %. ' $(srcdir)/src/date.c | sort \
|
||||
| $(extract_char) > $@-src; \
|
||||
{ echo N; \
|
||||
info libc date calendar format | grep '^ `%.'\' \
|
||||
| $(extract_char); } | sort > $@-info; \
|
||||
diff -u $@-src $@-info || exit 1; \
|
||||
rm -f $@-src $@-info; \
|
||||
fi
|
||||
|
||||
check-AUTHORS:
|
||||
$(MAKE) -C src $@
|
||||
|
||||
@ -462,9 +544,10 @@ changelog-check:
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
m4-check:
|
||||
@grep -n 'AC_DEFUN([^[]' m4/*.m4 \
|
||||
&& { echo 'Makefile.maint: quote the first arg to AC_DEFUN' 1>&2; \
|
||||
sc_m4_quote_check:
|
||||
@grep -nE '(AC_DEFINE(_UNQUOTED)?|AC_DEFUN)\([^[]' \
|
||||
$$($(VC_LIST_EXCEPT) | grep -E '(^configure\.ac|\.m4)$$') \
|
||||
&& { echo '$(ME): quote the first arg to AC_DEF*' 1>&2; \
|
||||
exit 1; } || :
|
||||
|
||||
fix_po_file_diag = \
|
||||
@ -473,21 +556,21 @@ apply the above patch\n'
|
||||
|
||||
# Verify that all source files using _() are listed in po/POTFILES.in.
|
||||
po_file = po/POTFILES.in
|
||||
po-check:
|
||||
@if test -f po/POTFILES.in; then \
|
||||
grep -E -v '^(#|$$)' po/POTFILES.in \
|
||||
sc_po_check:
|
||||
@if test -f $(po_file); then \
|
||||
grep -E -v '^(#|$$)' $(po_file) \
|
||||
| grep -v '^src/false\.c$$' | sort > $@-1; \
|
||||
files=; \
|
||||
for file in $$($(VC_LIST_EXCEPT)); do \
|
||||
case $$file in \
|
||||
djgpp/* | man/*) continue;; \
|
||||
*/c99-to-c89.diff) continue;; \
|
||||
*.m4) continue;; \
|
||||
*.?|*.??) ;; \
|
||||
*) continue;; \
|
||||
esac; \
|
||||
case $$file in \
|
||||
*.[ch]) \
|
||||
base=`expr " $$file" : ' \(.*\)\..'`; \
|
||||
{ test -f $$base.l || test -f $$base.y; } && continue;; \
|
||||
*) continue;; \
|
||||
esac; \
|
||||
files="$$files $$file"; \
|
||||
done; \
|
||||
@ -498,22 +581,14 @@ po-check:
|
||||
rm -f $@-1 $@-2; \
|
||||
fi
|
||||
|
||||
# In a definition of #define AUTHORS "... and ..." where the RHS contains
|
||||
# the English word `and', the string must be marked with `N_ (...)' so that
|
||||
# gettext recognizes it as a string requiring translation.
|
||||
author_mark_check:
|
||||
@grep -n '^# *define AUTHORS "[^"]* and ' src/*.c |grep -v ' N_ (' && \
|
||||
{ echo 'Makefile.maint: enclose the above strings in N_ (...)' 1>&2; \
|
||||
exit 1; } || :
|
||||
|
||||
# Sometimes it is useful to change the PATH environment variable
|
||||
# in Makefiles. When doing so, it's better not to use the Unix-centric
|
||||
# path separator of `:', but rather the automake-provided `@PATH_SEPARATOR@'.
|
||||
# It'd be better to use `find -print0 ...|xargs -0 ...', but less portable,
|
||||
# and there probably aren't many projects with so many Makefile.am files
|
||||
# that we'd have to worry about limits on command line length.
|
||||
msg = 'Makefile.maint: Do not use `:'\'' above; use @PATH_SEPARATOR@ instead'
|
||||
makefile_path_separator_check:
|
||||
msg = '$(ME): Do not use `:'\'' above; use @PATH_SEPARATOR@ instead'
|
||||
sc_makefile_path_separator_check:
|
||||
@grep -n 'PATH=.*:' `find $(srcdir) -name Makefile.am` \
|
||||
&& { echo $(msg) 1>&2; exit 1; } || :
|
||||
|
||||
@ -526,7 +601,7 @@ writable-files:
|
||||
test -w $$file \
|
||||
|| { echo ERROR: $$file is not writable; fail=1; }; \
|
||||
done; \
|
||||
test "$$fail" && exit 1 || :
|
||||
test "$$fail" && exit 1 || : ; \
|
||||
fi
|
||||
|
||||
v_etc_file = lib/version-etc.c
|
||||
@ -534,7 +609,7 @@ sample-test = tests/sample-test
|
||||
texi = doc/$(PACKAGE).texi
|
||||
# Make sure that the copyright date in $(v_etc_file) is up to date.
|
||||
# Do the same for the $(sample-test) and the main doc/.texi file.
|
||||
copyright-check:
|
||||
sc_copyright_check:
|
||||
@if test -f $(v_etc_file); then \
|
||||
grep 'enum { COPYRIGHT_YEAR = '$$(date +%Y)' };' $(v_etc_file) \
|
||||
>/dev/null \
|
||||
@ -570,21 +645,134 @@ maintainer-distcheck:
|
||||
$(MAKE) distcheck
|
||||
$(MAKE) my-distcheck
|
||||
|
||||
|
||||
# Don't make a distribution if checks fail.
|
||||
# Also, make sure the NEWS file is up-to-date.
|
||||
vc-dist: $(local-check) cvs-check maintainer-distcheck
|
||||
$(MAKE) dist
|
||||
|
||||
# Use this to make sure we don't run these programs when building
|
||||
# from a virgin tgz file, below.
|
||||
null_AM_MAKEFLAGS = \
|
||||
ACLOCAL=false \
|
||||
AUTOCONF=false \
|
||||
AUTOMAKE=false \
|
||||
AUTOHEADER=false \
|
||||
MAKEINFO=false
|
||||
|
||||
built_programs = $$(cd src && MAKEFLAGS= $(MAKE) -s built_programs.list)
|
||||
|
||||
warn_cflags = -Dlint -O -Werror -Wall -Wformat -Wshadow -Wpointer-arith
|
||||
bin=bin-$$$$
|
||||
|
||||
write_loser = printf '\#!%s\necho $$0: bad path 1>&2; exit 1\n' '$(SHELL)'
|
||||
|
||||
TMPDIR ?= /tmp
|
||||
t=$(TMPDIR)/$(PACKAGE)/test
|
||||
pfx=$(t)/i
|
||||
|
||||
# More than once, tainted build and source directory names would
|
||||
# have caused at least one "make check" test to apply "chmod 700"
|
||||
# to all directories under $HOME. Make sure it doesn't happen again.
|
||||
tp := $(shell echo "$(TMPDIR)/$(PACKAGE)-$$$$")
|
||||
t_prefix = $(tp)/a
|
||||
t_taint = '$(t_prefix) b'
|
||||
fake_home = $(tp)/home
|
||||
|
||||
# Ensure that tests run from tainted build and src dir names work,
|
||||
# and don't affect anything in $HOME. Create witness files in $HOME,
|
||||
# record their attributes, and build/test. Then ensure that the
|
||||
# witnesses were not affected.
|
||||
taint-distcheck: $(DIST_ARCHIVES)
|
||||
test -d $(t_taint) && chmod -R 700 $(t_taint) || :
|
||||
-rm -rf $(t_taint) $(fake_home)
|
||||
mkdir -p $(t_prefix) $(t_taint) $(fake_home)
|
||||
GZIP=$(GZIP_ENV) $(AMTAR) -C $(t_taint) -zxf $(distdir).tar.gz
|
||||
mkfifo $(fake_home)/fifo
|
||||
touch $(fake_home)/f
|
||||
mkdir -p $(fake_home)/d/e
|
||||
ls -lR $(fake_home) $(t_prefix) > $(tp)/.ls-before
|
||||
cd $(t_taint)/$(distdir) \
|
||||
&& ./configure \
|
||||
&& $(MAKE) \
|
||||
&& HOME=$(fake_home) $(MAKE) check \
|
||||
&& ls -lR $(fake_home) $(t_prefix) > $(tp)/.ls-after \
|
||||
&& diff $(tp)/.ls-before $(tp)/.ls-after \
|
||||
&& test -d $(t_prefix)
|
||||
rm -rf $(tp)
|
||||
|
||||
# Verify that a twisted use of --program-transform-name=PROGRAM works.
|
||||
define install-transform-check
|
||||
echo running install-transform-check \
|
||||
&& rm -rf $(pfx) \
|
||||
&& $(MAKE) program_transform_name='s/.*/zyx/' \
|
||||
prefix=$(pfx) install \
|
||||
&& test "$$(echo $(pfx)/bin/*)" = "$(pfx)/bin/zyx" \
|
||||
&& test "$$(find $(pfx)/share/man -type f|sed 's,.*/,,;s,\..*,,')" = "zyx"
|
||||
endef
|
||||
|
||||
# Install, then verify that all binaries and man pages are in place.
|
||||
# Note that neither the binary, ginstall, nor the ].1 man page is installed.
|
||||
define my-instcheck
|
||||
$(MAKE) prefix=$(pfx) install \
|
||||
&& test ! -f $(pfx)/bin/ginstall \
|
||||
&& { fail=0; \
|
||||
for i in $(built_programs); do \
|
||||
test "$$i" = ginstall && i=install; \
|
||||
for j in "$(pfx)/bin/$$i" \
|
||||
"$(pfx)/share/man/man1/$$i.1"; do \
|
||||
case $$j in *'[.1') continue;; esac; \
|
||||
test -f "$$j" && : \
|
||||
|| { echo "$$j not installed"; fail=1; }; \
|
||||
done; \
|
||||
done; \
|
||||
test $$fail = 1 && exit 1 || :; \
|
||||
}
|
||||
endef
|
||||
|
||||
define coreutils-path-check
|
||||
{ \
|
||||
if test -f $(srcdir)/src/true.c; then \
|
||||
fail=1; \
|
||||
mkdir $(bin) \
|
||||
&& ($(write_loser)) > $(bin)/loser \
|
||||
&& chmod a+x $(bin)/loser \
|
||||
&& for i in $(built_programs); do \
|
||||
case $$i in \
|
||||
rm|expr|basename|echo|sort|ls|tr);; \
|
||||
cat|dirname|mv|wc);; \
|
||||
*) ln $(bin)/loser $(bin)/$$i;; \
|
||||
esac; \
|
||||
done \
|
||||
&& ln -sf ../src/true $(bin)/false \
|
||||
&& PATH=`pwd`/$(bin):$$PATH $(MAKE) -C tests check \
|
||||
&& { test -d gnulib-tests \
|
||||
&& $(MAKE) -C gnulib-tests check \
|
||||
|| :; } \
|
||||
&& rm -rf $(bin) \
|
||||
&& fail=0; \
|
||||
else \
|
||||
fail=0; \
|
||||
fi; \
|
||||
test $$fail = 1 && exit 1 || :; \
|
||||
}
|
||||
endef
|
||||
|
||||
# Use -Wformat -Werror to detect format-string/arg-list mismatches.
|
||||
# Also, check for shadowing problems with -Wshadow, and for pointer
|
||||
# arithmetic problems with -Wpointer-arith.
|
||||
# These CFLAGS are pretty strict. If you build this target, you probably
|
||||
# have to have a recent version of gcc and glibc headers.
|
||||
# The for-loop below ensures that there is a bin/ directory full of all
|
||||
# of the programs under test (except the few that are required for basic
|
||||
# Makefile rules), all symlinked to the just-built "false" program.
|
||||
# The hard-linking for-loop below ensures that there is a bin/ directory
|
||||
# full of all of the programs under test (except the ones that are required
|
||||
# for basic Makefile rules), all symlinked to the just-built "false" program.
|
||||
# This is to ensure that if ever a test neglects to make PATH include
|
||||
# the build srcdir, these always-failing programs will run.
|
||||
# Otherwise, it is too easy to test the wrong programs.
|
||||
# Note that "false" itself is a symlink to true, so it too will malfunction.
|
||||
TMPDIR ?= /tmp
|
||||
t=$(TMPDIR)/$(PACKAGE)/test
|
||||
my-distcheck: $(local-check) check
|
||||
my-distcheck: $(DIST_ARCHIVES) $(local-check)
|
||||
$(MAKE) syntax-check
|
||||
$(MAKE) check
|
||||
-rm -rf $(t)
|
||||
mkdir -p $(t)
|
||||
GZIP=$(GZIP_ENV) $(AMTAR) -C $(t) -zxf $(distdir).tar.gz
|
||||
@ -593,17 +781,13 @@ my-distcheck: $(local-check) check
|
||||
&& $(MAKE) CFLAGS='$(warn_cflags)' \
|
||||
AM_MAKEFLAGS='$(null_AM_MAKEFLAGS)' \
|
||||
&& $(MAKE) dvi \
|
||||
&& $(install-transform-check) \
|
||||
&& $(my-instcheck) \
|
||||
&& $(coreutils-path-check) \
|
||||
&& $(MAKE) distclean
|
||||
(cd $(t) && mv $(distdir) $(distdir).old \
|
||||
&& $(AMTAR) -zxf - ) < $(distdir).tar.gz
|
||||
diff -ur $(t)/$(distdir).old $(t)/$(distdir)
|
||||
if test -f $(srcdir)/src/c99-to-c89.diff; then \
|
||||
cd $(t)/$(distdir) \
|
||||
&& (cd src && patch -V never --fuzz=0 <c99-to-c89.diff) \
|
||||
&& ./configure --disable-largefile \
|
||||
CFLAGS='-Werror -ansi -Wno-long-long' \
|
||||
&& $(MAKE); \
|
||||
fi
|
||||
-rm -rf $(t)
|
||||
@echo "========================"; \
|
||||
echo "$(distdir).tar.gz is ready for distribution"; \
|
||||
@ -633,3 +817,10 @@ sync-vcs-ignore-files:
|
||||
mv $(c2g)-t $(c2g)
|
||||
perl $(c2g)
|
||||
rm -f $(c2g)
|
||||
echo "syntax: glob" > .hgignore
|
||||
( for ignore in $$($(VC_LIST) \
|
||||
| grep -E '(^|/)\.gitignore$$'); do \
|
||||
dir=$$(dirname "$$ignore"); \
|
||||
test "$$dir" = . && pfx= || pfx=$$dir/; \
|
||||
sed "s!^!$$pfx!" "$$ignore"; \
|
||||
done ) | sort -u >> .hgignore
|
||||
|
85
Makefile.nonreentrant
Normal file
85
Makefile.nonreentrant
Normal file
@ -0,0 +1,85 @@
|
||||
|
||||
#
|
||||
# Generated by running the following on Fedora 9:
|
||||
#
|
||||
# nm -D --defined-only /lib/libc.so.6 \
|
||||
# | grep '_r$' \
|
||||
# | awk '{print $3}' \
|
||||
# | grep -v __ \
|
||||
# | grep -v qsort \ # Red herring since we don't need to pass extra args to qsort comparator
|
||||
# | grep -v readdir \ # This is safe as long as each DIR * instance is only used by one thread
|
||||
# | sort \
|
||||
# | uniq \
|
||||
# | sed -e 's/_r//'
|
||||
#
|
||||
|
||||
NON_REENTRANT =
|
||||
NON_REENTRANT += asctime
|
||||
NON_REENTRANT += ctime
|
||||
NON_REENTRANT += drand48
|
||||
NON_REENTRANT += ecvt
|
||||
NON_REENTRANT += erand48
|
||||
NON_REENTRANT += ether_aton
|
||||
NON_REENTRANT += ether_ntoa
|
||||
NON_REENTRANT += fcvt
|
||||
NON_REENTRANT += fgetgrent
|
||||
NON_REENTRANT += fgetpwent
|
||||
NON_REENTRANT += fgetspent
|
||||
NON_REENTRANT += getaliasbyname
|
||||
NON_REENTRANT += getaliasent
|
||||
NON_REENTRANT += getdate
|
||||
NON_REENTRANT += getgrent
|
||||
NON_REENTRANT += getgrgid
|
||||
NON_REENTRANT += getgrnam
|
||||
NON_REENTRANT += gethostbyaddr
|
||||
NON_REENTRANT += gethostbyname2
|
||||
NON_REENTRANT += gethostbyname
|
||||
NON_REENTRANT += gethostent
|
||||
NON_REENTRANT += getlogin
|
||||
NON_REENTRANT += getmntent
|
||||
NON_REENTRANT += getnetbyaddr
|
||||
NON_REENTRANT += getnetbyname
|
||||
NON_REENTRANT += getnetent
|
||||
NON_REENTRANT += getnetgrent
|
||||
NON_REENTRANT += getprotobyname
|
||||
NON_REENTRANT += getprotobynumber
|
||||
NON_REENTRANT += getprotoent
|
||||
NON_REENTRANT += getpwent
|
||||
NON_REENTRANT += getpwnam
|
||||
NON_REENTRANT += getpwuid
|
||||
NON_REENTRANT += getrpcbyname
|
||||
NON_REENTRANT += getrpcbynumber
|
||||
NON_REENTRANT += getrpcent
|
||||
NON_REENTRANT += getservbyname
|
||||
NON_REENTRANT += getservbyport
|
||||
NON_REENTRANT += getservent
|
||||
NON_REENTRANT += getspent
|
||||
NON_REENTRANT += getspnam
|
||||
NON_REENTRANT += getutent
|
||||
NON_REENTRANT += getutid
|
||||
NON_REENTRANT += getutline
|
||||
NON_REENTRANT += gmtime
|
||||
NON_REENTRANT += hcreate
|
||||
NON_REENTRANT += hdestroy
|
||||
NON_REENTRANT += hsearch
|
||||
NON_REENTRANT += initstate
|
||||
NON_REENTRANT += jrand48
|
||||
NON_REENTRANT += lcong48
|
||||
NON_REENTRANT += localtime
|
||||
NON_REENTRANT += lrand48
|
||||
NON_REENTRANT += mrand48
|
||||
NON_REENTRANT += nrand48
|
||||
NON_REENTRANT += ptsname
|
||||
NON_REENTRANT += qecvt
|
||||
NON_REENTRANT += qfcvt
|
||||
NON_REENTRANT += random
|
||||
NON_REENTRANT += rand
|
||||
NON_REENTRANT += seed48
|
||||
NON_REENTRANT += setstate
|
||||
NON_REENTRANT += sgetspent
|
||||
NON_REENTRANT += srand48
|
||||
NON_REENTRANT += srandom
|
||||
NON_REENTRANT += strerror
|
||||
NON_REENTRANT += strtok
|
||||
NON_REENTRANT += tmpnam
|
||||
NON_REENTRANT += ttyname
|
77
NEWS
77
NEWS
@ -5,6 +5,83 @@
|
||||
http://libvirt.org/news.html
|
||||
|
||||
|
||||
0.6.0: Jan 31 2009:
|
||||
- New features: thread safety of the API and event handling (Daniel
|
||||
Berrange), allow QEmu domains to survive daemon restart (Guido
|
||||
G<>nther), extended logging capabilities, support copy-on-write
|
||||
storage volumes (Daniel Berrange), support of storage cache
|
||||
control options for QEmu/KVM (Daniel Berrange)
|
||||
- Portability: fix old DBus API problem, Debian portability fix
|
||||
(Daniel Berrange), fix distcheck (Jim Meyering), build in
|
||||
debug mode (Jim Meyering), libnuma API portability (Jim Meyering),
|
||||
many portability fixes pointed by Solaris (John Levon), non-gcc
|
||||
portability fixes (John Levon), various include fixes (Jim Meyering),
|
||||
various Windows and Mingw portability fixes (Daniel Berrange),
|
||||
solaris Xen fixes (John Levon), RPC portability to Solaris (Daniel
|
||||
Berrange)
|
||||
- Documentation: typo fixes (Richard Jones), logging support,
|
||||
vnc keymap attributes (Guido G<>nther), HACKING file updates
|
||||
(Jim Meyering), new PCI passthrough format, libvirt-qpid and
|
||||
UML driver documentation (Daniel Berrange), provide RNG schemas
|
||||
for all XML formats used in libvirt APIs (Daniel Berrange),
|
||||
- Bug fixes: segfault on virtual network without bridge name (Cole
|
||||
Robinson), various locking fixes (Cole Robinson), fix serial
|
||||
and parallel devices on tcp/unix/telnet (Guido G<>nther), leak
|
||||
in daemon (Jim Meyering), storage driver segfault (Miloslav TrmaC),
|
||||
missing check in read-only connections (Daniel Berrange),
|
||||
OpenVZ crash and mutex fixes (Anton Protopopov), couple of
|
||||
daemon bug fixes (John Levon), OpenVZ MAC addresses generation
|
||||
(Evgeniy Sokolov), poll call initialization fix (Daniel Berrange),
|
||||
various Xen driver fixes (John Levon), segfault on device
|
||||
back compat (Cole Robinson), couple Xen bug fixes coming from
|
||||
RHEL (Markus Armbruster), buffer overflow in libvirt proxy
|
||||
(rasputin@email.ru), vnc port report (John Levon), repair save
|
||||
and restore on recent KVM versions (Daniel Berrange), Xen
|
||||
cpu pinning XML fix (John Levon), various xen driver fixes
|
||||
(Daniel Berrange), some memory leak fixes (Daniel Berrange)
|
||||
- Improvements: driver infrastructure and locking (Daniel Berrange),
|
||||
Test driver infrastructure (Daniel Berrange), parallelism in the
|
||||
daemon and associated config (Daniel Berrange), virsh help cleanups
|
||||
(Jim Meyering), logrotate daemon logs (Guido G<>nther), more
|
||||
regression tests (Jim Meyering), QEmu SDL graphics (Itamar Heim),
|
||||
add --version flag to daemon (Dave Allan), memory consumption
|
||||
cleanup (Dave Allan), QEmu pid file and XML states for daemon
|
||||
restart (Guido G<>nther), gnulib updates (Jim Meyering and
|
||||
Dan Berrange), PCI passthrough for KVM (Jason Krieg), generic
|
||||
internal thread API (Daniel Berrange), RHEL-5 specific Xen
|
||||
configure option and code (Markus Armbruster), save domain
|
||||
state as string in status file (Guido G<>nther), add locking
|
||||
to all API entry points (Daniel Berrange), new ref counting APIs
|
||||
(Daniel Berrange), IP address for Xen bridges (John Levon),
|
||||
driver format for disk file types (Daniel Berrange), improve
|
||||
QEmu/KVM tun/tap performances (Mark McLoughlin), enable floppies
|
||||
for Xen fully virt (John Levon), support VNC password settings
|
||||
for QEmu/KVM (Daniel Berrange), qemu driver version reporting
|
||||
(Daniel Berrange)
|
||||
- Cleanups: converting linked lists to arrays (Daniel Berrange),
|
||||
daemon RPC handling refactoring (Daniel Berrange), strings cleanups
|
||||
(Jim Meyering), gethostby* cleanup and test (Jim Meyering), some
|
||||
code fixes (Dave Allan), various code cleanup (Jim Meyering),
|
||||
virsh argument handling cleanup (Jim Meyering), virAsprintf
|
||||
cleanup replacement (Guido G<>nther), QEmu monitor reads (Cole
|
||||
Robinson), Makefile cleanups (Guido G<>nther), Xen code cleanups
|
||||
(John Levon), revamp of ELF export scripts (John Levon), domain
|
||||
event callback args (John Levon), enforce use of pid_t (John Levon),
|
||||
virsh pool-*-as XML code merge (Cole Robinson), xgettext warnings
|
||||
(Jim Meyering), add virKillProcess (Guido G<>nther), add
|
||||
virGetHostname (David Lutterkort), add flags argument to the full
|
||||
XML parsing stack (Guido G<>nther), various daemon code cleanups
|
||||
(Guido G<>nther), handling of daemon missing config file (Jim
|
||||
Meyering), rpcgen invocation cleanup (Richard Jones), devhelp
|
||||
builkd makefile cleanups (John Levon), update error handling for
|
||||
threading (Daniel Berrange), remove all non-rentrant POSIX calls
|
||||
usage (Daniel Berrange), many small cleanups (Jim Meyering and
|
||||
Daniel Berrange), examples Makefile generator (John Levon),
|
||||
mis-use of PF_UNIX as a protocol (John Levon), cleanup OOM
|
||||
error paths (Jim Meyering), temporary fix fro valgrind on lxc
|
||||
(Daniel Berrange), QEmu driver init cleanups (Daniel Berrange)
|
||||
|
||||
|
||||
0.5.1: Dec 4 2008:
|
||||
- Portability: fix missing dep in spec file, fix compilation with new
|
||||
NUMA libraries (Daniel Berrange), udev compatibility for RHEL (Chris
|
||||
|
2
RENAMES
2
RENAMES
@ -2,8 +2,6 @@
|
||||
#
|
||||
# File renames don't normally go into patches because they make
|
||||
# the patches much harder to read, so list them here instead.
|
||||
#
|
||||
# $Id$
|
||||
|
||||
# Clearer naming scheme after Xen-unified patch went in.
|
||||
src/xen_internal.c src/xen_internal_hv.c
|
||||
|
24
acinclude.m4
24
acinclude.m4
@ -45,21 +45,9 @@ AC_DEFUN([LIBVIRT_COMPILE_WARNINGS],[
|
||||
;;
|
||||
esac
|
||||
|
||||
compiler_flags=
|
||||
COMPILER_FLAGS=
|
||||
for option in $try_compiler_flags; do
|
||||
SAVE_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $option"
|
||||
AC_MSG_CHECKING([whether gcc understands $option])
|
||||
AC_TRY_LINK([], [],
|
||||
has_option=yes,
|
||||
has_option=no,)
|
||||
CFLAGS="$SAVE_CFLAGS"
|
||||
AC_MSG_RESULT($has_option)
|
||||
if test $has_option = yes; then
|
||||
compiler_flags="$compiler_flags $option"
|
||||
fi
|
||||
unset has_option
|
||||
unset SAVE_CFLAGS
|
||||
gl_COMPILER_FLAGS($option)
|
||||
done
|
||||
unset option
|
||||
unset try_compiler_flags
|
||||
@ -85,8 +73,14 @@ AC_DEFUN([LIBVIRT_COMPILE_WARNINGS],[
|
||||
fi
|
||||
AC_MSG_RESULT($complCFLAGS)
|
||||
|
||||
WARN_CFLAGS="$compiler_flags $complCFLAGS"
|
||||
WARN_CFLAGS="$COMPILER_FLAGS $complCFLAGS"
|
||||
AC_SUBST(WARN_CFLAGS)
|
||||
|
||||
dnl Needed to keep compile quiet on python 2.4
|
||||
COMPILER_FLAGS=
|
||||
gl_COMPILER_FLAGS(-Wno-redundant-decls)
|
||||
WARN_PYTHON_CFLAGS=$COMPILER_FLAGS
|
||||
AC_SUBST(WARN_PYTHON_CFLAGS)
|
||||
])
|
||||
|
||||
|
||||
|
@ -65,6 +65,7 @@ if [ -x /usr/bin/i686-pc-mingw32-gcc ]; then
|
||||
--build=$(uname -m)-pc-linux \
|
||||
--host=i686-pc-mingw32 \
|
||||
--prefix="$AUTOBUILD_INSTALL_ROOT/i686-pc-mingw32/sys-root/mingw" \
|
||||
--enable-compile-warnings=error \
|
||||
--without-sasl \
|
||||
--without-avahi \
|
||||
--without-polkit \
|
||||
|
@ -73,6 +73,7 @@ gethostname
|
||||
getpass
|
||||
gettext
|
||||
inet_pton
|
||||
ioctl
|
||||
mkstemp
|
||||
mktempd
|
||||
perror
|
||||
@ -80,13 +81,16 @@ physmem
|
||||
poll
|
||||
posix-shell
|
||||
recv
|
||||
random_r
|
||||
send
|
||||
setsockopt
|
||||
socket
|
||||
stpcpy
|
||||
strndup
|
||||
strerror
|
||||
strsep
|
||||
sys_stat
|
||||
time_r
|
||||
useless-if-before-free
|
||||
vasprintf
|
||||
verify
|
||||
@ -99,6 +103,7 @@ vc-list-files
|
||||
# put *.[ch] files in new gnulib/lib/ dir.
|
||||
|
||||
$gnulib_tool \
|
||||
--no-vc-files \
|
||||
--lgpl=2 \
|
||||
--with-tests \
|
||||
--m4-base=gnulib/m4 \
|
||||
|
42
configure.in
42
configure.in
@ -1,6 +1,6 @@
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_INIT([libvirt], [0.5.1])
|
||||
AC_INIT([libvirt], [0.6.0])
|
||||
AC_CONFIG_SRCDIR([src/libvirt.c])
|
||||
AC_CONFIG_AUX_DIR([build-aux])
|
||||
AM_CONFIG_HEADER([config.h])
|
||||
@ -60,6 +60,11 @@ AM_PROG_LIBTOOL
|
||||
|
||||
AM_PROG_CC_C_O
|
||||
|
||||
VERSION_SCRIPT_FLAGS=-Wl,--version-script=
|
||||
`/usr/bin/ld --help 2>&1 | grep -- --version-script >/dev/null` || \
|
||||
VERSION_SCRIPT_FLAGS="-Wl,-M -Wl,"
|
||||
AC_SUBST(VERSION_SCRIPT_FLAGS)
|
||||
|
||||
LIBVIRT_COMPILE_WARNINGS([maximum])
|
||||
|
||||
dnl Support large files / 64 bit seek offsets.
|
||||
@ -69,23 +74,27 @@ AC_SYS_LARGEFILE
|
||||
dnl Availability of various common functions (non-fatal if missing).
|
||||
AC_CHECK_FUNCS([cfmakeraw regexec uname sched_getaffinity getuid getgid])
|
||||
|
||||
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])
|
||||
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])
|
||||
|
||||
dnl Where are the XDR functions?
|
||||
dnl If portablexdr is installed, prefer that.
|
||||
dnl Otherwise try -lrpc (Cygwin) -lxdr (some MinGW) or none (most Unix)
|
||||
dnl Otherwise try -lrpc (Cygwin) -lxdr (some MinGW), -lnsl (Solaris)
|
||||
dnl or none (most Unix)
|
||||
AC_CHECK_LIB([portablexdr],[xdrmem_create],[],[
|
||||
AC_SEARCH_LIBS([xdrmem_create],[rpc xdr])
|
||||
AC_SEARCH_LIBS([xdrmem_create],[rpc xdr nsl])
|
||||
])
|
||||
|
||||
AC_CHECK_LIB([intl],[gettext],[])
|
||||
|
||||
dnl Do we have rpcgen?
|
||||
AC_PATH_PROG([RPCGEN], [rpcgen], [no])
|
||||
AM_CONDITIONAL([RPCGEN], [test "x$ac_cv_path_RPCGEN" != "xno"])
|
||||
AM_CONDITIONAL([HAVE_RPCGEN], [test "x$ac_cv_path_RPCGEN" != "xno"])
|
||||
dnl Is this GLIBC's buggy rpcgen?
|
||||
AM_CONDITIONAL([GLIBC_RPCGEN],
|
||||
AM_CONDITIONAL([HAVE_GLIBC_RPCGEN],
|
||||
[test "x$ac_cv_path_RPCGEN" != "xno" &&
|
||||
$ac_cv_path_RPCGEN -t </dev/null >/dev/null 2>&1])
|
||||
|
||||
@ -190,6 +199,7 @@ dnl --enable-debug=(yes|no)
|
||||
AC_ARG_ENABLE([debug],
|
||||
[AC_HELP_STRING([--enable-debug=no/yes],
|
||||
[enable debugging output])],[],[enable_debug=yes])
|
||||
AM_CONDITIONAL([ENABLE_DEBUG], test x"$enable_debug" = x"yes")
|
||||
if test x"$enable_debug" = x"yes"; then
|
||||
AC_DEFINE([ENABLE_DEBUG], [], [whether debugging is enabled])
|
||||
fi
|
||||
@ -224,6 +234,14 @@ fi
|
||||
AM_CONDITIONAL([LIBVIRT_INIT_SCRIPTS_RED_HAT], test x$with_init_scripts = xredhat)
|
||||
AC_MSG_RESULT($with_init_scripts)
|
||||
|
||||
dnl RHEL-5 has a peculiar version of Xen, which requires some special casing
|
||||
AC_ARG_WITH([rhel5-api],
|
||||
[AC_HELP_STRING([--with-rhel5-api=[ARG]],
|
||||
[build for the RHEL-5 API [default=no]])])
|
||||
if test x"$with_rhel5_api" = x"yes"; then
|
||||
AC_DEFINE([WITH_RHEL5_API], [1], [whether building for the RHEL-5 API])
|
||||
fi
|
||||
|
||||
dnl
|
||||
dnl ensure that Fedora's system-config-firewall knows
|
||||
dnl about libvirt's iptables rules
|
||||
@ -269,6 +287,13 @@ if test "$with_qemu" = "yes" ; then
|
||||
fi
|
||||
AM_CONDITIONAL([WITH_QEMU], [test "$with_qemu" = "yes"])
|
||||
|
||||
with_bridge=no
|
||||
if test "$with_qemu" = "yes" -o "$with_lxc" = "yes"; then
|
||||
with_bridge=yes
|
||||
AC_DEFINE_UNQUOTED([WITH_BRIDGE], 1, [whether bridge code is needed])
|
||||
fi
|
||||
AM_CONDITIONAL([WITH_BRIDGE], [test "$with_bridge" = "yes"])
|
||||
|
||||
if test "$with_uml" = "yes" ; then
|
||||
AC_DEFINE_UNQUOTED([WITH_UML], 1, [whether UML driver is enabled])
|
||||
fi
|
||||
@ -1164,6 +1189,7 @@ if test "x$with_hal" = "xyes" -o "x$with_hal" = "xcheck"; then
|
||||
CFLAGS="$CFLAGS $HAL_CFLAGS"
|
||||
LDFLAGS="$LDFLAGS $HAL_LIBS"
|
||||
AC_CHECK_FUNCS([libhal_get_all_devices],,[with_hal=no])
|
||||
AC_CHECK_FUNCS([dbus_watch_get_unix_fd])
|
||||
CFLAGS="$old_CFLAGS"
|
||||
LDFLAGS="$old_LDFLAGS"
|
||||
fi
|
||||
@ -1234,6 +1260,8 @@ then
|
||||
fi
|
||||
AM_CONDITIONAL([WITH_NODE_DEVICES], [test "$with_nodedev" = "yes"])
|
||||
|
||||
AM_CONDITIONAL([WITH_LINUX], [test `uname -s` = "Linux"])
|
||||
|
||||
# Only COPYING.LIB is under version control, yet COPYING
|
||||
# is included as part of the distribution tarball.
|
||||
# Copy one to the other, but only if this is a srcdir-build.
|
||||
@ -1244,10 +1272,10 @@ 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 \
|
||||
libvirt.pc libvirt.spec mingw32-libvirt.spec \
|
||||
src/libvirt_sym.version \
|
||||
po/Makefile.in \
|
||||
include/libvirt/Makefile include/libvirt/libvirt.h \
|
||||
python/Makefile python/tests/Makefile \
|
||||
|
@ -26,4 +26,3 @@ the underlying acual implementation of the hypervisor calls.
|
||||
releases of the library.
|
||||
|
||||
Daniel Veillard <veillard@redhat.com>
|
||||
$Date$
|
||||
|
@ -1,5 +1,5 @@
|
||||
## Process this file with automake to produce Makefile.in
|
||||
SUBDIRS= . examples devhelp
|
||||
SUBDIRS= schemas examples devhelp
|
||||
|
||||
# The directory containing the source code (if it contains documentation).
|
||||
DOC_SOURCE_DIR=../src
|
||||
@ -52,10 +52,6 @@ xml = \
|
||||
testnetpriv.xml \
|
||||
testnode.xml
|
||||
|
||||
rng = \
|
||||
libvirt.rng \
|
||||
network.rng
|
||||
|
||||
fig = \
|
||||
libvirt-net-logical.fig \
|
||||
libvirt-net-physical.fig
|
||||
@ -64,7 +60,7 @@ 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) \
|
||||
$(xml) $(rng) $(fig) $(png) \
|
||||
$(xml) $(fig) $(png) \
|
||||
virsh.pod ChangeLog.awk
|
||||
|
||||
all: web $(top_builddir)/NEWS $(man_MANS)
|
||||
@ -130,9 +126,8 @@ rebuild: api all
|
||||
|
||||
install-data-local:
|
||||
$(mkinstalldirs) $(DESTDIR)$(HTML_DIR)
|
||||
-@INSTALL@ -m 0644 $(srcdir)/libvir.html $(srcdir)/FAQ.html \
|
||||
$(srcdir)/redhat.gif $(srcdir)/Libxml2-Logo-90x34.gif \
|
||||
$(DESTDIR)$(HTML_DIR)
|
||||
-@INSTALL@ -m 0644 $(srcdir)/FAQ.html \
|
||||
$(srcdir)/Libxml2-Logo-90x34.gif $(DESTDIR)$(HTML_DIR)
|
||||
$(mkinstalldirs) $(DESTDIR)$(HTML_DIR)/html
|
||||
for h in $(apihtml); do \
|
||||
$(INSTALL) -m 0644 $(srcdir)/$$h $(DESTDIR)$(HTML_DIR)/html; done
|
||||
|
@ -27,6 +27,9 @@ included_files = {
|
||||
ignored_words = {
|
||||
"ATTRIBUTE_UNUSED": (0, "macro keyword"),
|
||||
"VIR_DEPRECATED": (0, "macro keyword"),
|
||||
"WINAPI": (0, "Windows keyword"),
|
||||
"__declspec": (3, "Windows keyword"),
|
||||
"__stdcall": (0, "Windows keyword"),
|
||||
}
|
||||
|
||||
ignored_functions = {
|
||||
|
@ -141,7 +141,7 @@
|
||||
</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 allows 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>
|
||||
|
@ -107,7 +107,7 @@
|
||||
<dl>
|
||||
<dt><a href="http://honk.sigxcpu.org/projects/libvirt/#munin">for munin</a></dt>
|
||||
<dd>
|
||||
The plugins provided by Guido Günther allows 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>
|
||||
|
@ -58,6 +58,10 @@
|
||||
<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>
|
||||
|
@ -58,6 +58,10 @@
|
||||
<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>
|
||||
|
@ -1,7 +1,8 @@
|
||||
DEVHELP_DIR=$(datadir)/gtk-doc/html/libvirt
|
||||
HTML_FILES=index.html general.html $(HTML_MODULES)
|
||||
HTML_MODULES= \
|
||||
libvirt-libvirt.html
|
||||
libvirt-libvirt.html \
|
||||
libvirt-virterror.html
|
||||
|
||||
EXTRA_FORMAT= \
|
||||
home.png \
|
||||
@ -14,14 +15,15 @@ EXTRA_DIST=devhelp.xsl html.xsl libvirt.devhelp $(HTML_FILES) $(EXTRA_FORMAT)
|
||||
|
||||
all: libvirt.devhelp $(HTML_FILES)
|
||||
|
||||
libvirt.devhelp $(HTML_FILES): devhelp.xsl html.xsl $(top_srcdir)/docs/libvirt-api.xml
|
||||
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 $(srcdir)/libvirt.devhelp devhelp.xsl $(top_srcdir)/docs/libvirt-api.xml ; fi );
|
||||
$(XSLTPROC) --nonet -o libvirt.devhelp $(srcdir)/devhelp.xsl $(top_srcdir)/docs/libvirt-api.xml ; fi );
|
||||
|
||||
install-data-local:
|
||||
install-data-local: libvirt.devhelp $(HTML_FILES)
|
||||
$(mkinstalldirs) $(DESTDIR)$(DEVHELP_DIR)
|
||||
-@INSTALL@ -m 0644 libvirt.devhelp $(DESTDIR)$(DEVHELP_DIR)
|
||||
-@INSTALL@ -m 0644 $(EXTRA_FORMAT) $(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
|
||||
|
@ -125,17 +125,18 @@ int <a href="#virNetworkGetUUID">virNetworkGetUUID</a> (<a href="libvirt-libvir
|
||||
<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> <a href="#virStoragePoolGetConnect">virStoragePoolGetConnect</a> (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool);
|
||||
int <a href="#virConnectGetVersion">virConnectGetVersion</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> unsigned long * hvVer);
|
||||
int <a href="#virDomainFree">virDomainFree</a> (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain);
|
||||
int <a href="#virStorageVolRef">virStorageVolRef</a> (<a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol);
|
||||
const char * <a href="#virStoragePoolGetName">virStoragePoolGetName</a> (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool);
|
||||
int <a href="#virDomainSetAutostart">virDomainSetAutostart</a> (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br/> int autostart);
|
||||
<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> <a href="#virStoragePoolDefineXML">virStoragePoolDefineXML</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> const char * xml, <br/> unsigned int flags);
|
||||
<a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> <a href="#virStorageVolLookupByPath">virStorageVolLookupByPath</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> const char * path);
|
||||
<a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> <a href="#virStorageVolLookupByName">virStorageVolLookupByName</a> (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool, <br/> const char * name);
|
||||
<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> <a href="#virDomainCreateLinux">virDomainCreateLinux</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> const char * xmlDesc, <br/> unsigned int flags);
|
||||
int <a href="#virNetworkCreate">virNetworkCreate</a> (<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network);
|
||||
int <a href="#virDomainSetMaxMemory">virDomainSetMaxMemory</a> (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br/> unsigned long memory);
|
||||
void <a href="#virEventRegisterImpl">virEventRegisterImpl</a> (<a href="libvirt-libvirt.html#virEventAddHandleFunc">virEventAddHandleFunc</a> addHandle, <br/> <a href="libvirt-libvirt.html#virEventUpdateHandleFunc">virEventUpdateHandleFunc</a> updateHandle, <br/> <a href="libvirt-libvirt.html#virEventRemoveHandleFunc">virEventRemoveHandleFunc</a> removeHandle, <br/> <a href="libvirt-libvirt.html#virEventAddTimeoutFunc">virEventAddTimeoutFunc</a> addTimeout, <br/> <a href="libvirt-libvirt.html#virEventUpdateTimeoutFunc">virEventUpdateTimeoutFunc</a> updateTimeout, <br/> <a href="libvirt-libvirt.html#virEventRemoveTimeoutFunc">virEventRemoveTimeoutFunc</a> removeTimeout);
|
||||
<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> <a href="#virDomainMigrate">virDomainMigrate</a> (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br/> <a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> dconn, <br/> unsigned long flags, <br/> const char * dname, <br/> const char * uri, <br/> unsigned long bandwidth);
|
||||
int <a href="#virDomainSuspend">virDomainSuspend</a> (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain);
|
||||
int <a href="#virNetworkCreate">virNetworkCreate</a> (<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network);
|
||||
<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> <a href="#virDomainCreateLinux">virDomainCreateLinux</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> const char * xmlDesc, <br/> unsigned int flags);
|
||||
char * <a href="#virNodeDeviceGetXMLDesc">virNodeDeviceGetXMLDesc</a> (<a href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a> dev, <br/> unsigned int flags);
|
||||
typedef void <a href="#virEventUpdateHandleFunc">virEventUpdateHandleFunc</a> (int watch, <br/> int event);
|
||||
int <a href="#virDomainDestroy">virDomainDestroy</a> (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain);
|
||||
@ -178,6 +179,7 @@ int <a href="#virStoragePoolListVolumes">virStoragePoolListVolumes</a> (<a href=
|
||||
char * <a href="#virConnectGetHostname">virConnectGetHostname</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn);
|
||||
typedef int <a href="#virEventRemoveTimeoutFunc">virEventRemoveTimeoutFunc</a> (int timer);
|
||||
const char * <a href="#virDomainGetName">virDomainGetName</a> (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain);
|
||||
int <a href="#virStoragePoolRef">virStoragePoolRef</a> (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool);
|
||||
char * <a href="#virNetworkGetXMLDesc">virNetworkGetXMLDesc</a> (<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network, <br/> int flags);
|
||||
int <a href="#virConnectNumOfStoragePools">virConnectNumOfStoragePools</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn);
|
||||
const char * <a href="#virNetworkGetName">virNetworkGetName</a> (<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network);
|
||||
@ -196,6 +198,7 @@ int <a href="#virStorageVolFree">virStorageVolFree</a> (<a href="libvirt-libvir
|
||||
int <a href="#virDomainMemoryPeek">virDomainMemoryPeek</a> (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br/> unsigned long long start, <br/> size_t size, <br/> void * buffer, <br/> unsigned int flags);
|
||||
<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> <a href="#virNetworkLookupByUUID">virNetworkLookupByUUID</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> const unsigned char * uuid);
|
||||
int <a href="#virConnectListDefinedNetworks">virConnectListDefinedNetworks</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> char ** const names, <br/> int maxnames);
|
||||
int <a href="#virConnectRef">virConnectRef</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn);
|
||||
int <a href="#virDomainGetUUID">virDomainGetUUID</a> (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br/> unsigned char * uuid);
|
||||
<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> <a href="#virNetworkCreateXML">virNetworkCreateXML</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> const char * xmlDesc);
|
||||
int <a href="#virDomainGetVcpus">virDomainGetVcpus</a> (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br/> <a href="libvirt-libvirt.html#virVcpuInfoPtr">virVcpuInfoPtr</a> info, <br/> int maxinfo, <br/> unsigned char * cpumaps, <br/> int maplen);
|
||||
@ -203,6 +206,7 @@ int <a href="#virDomainGetVcpus">virDomainGetVcpus</a> (<a href="libvirt-libvir
|
||||
int <a href="#virStoragePoolGetInfo">virStoragePoolGetInfo</a> (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool, <br/> <a href="libvirt-libvirt.html#virStoragePoolInfoPtr">virStoragePoolInfoPtr</a> info);
|
||||
int <a href="#virDomainResume">virDomainResume</a> (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain);
|
||||
int <a href="#virNodeListDevices">virNodeListDevices</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> const char * cap, <br/> char ** const names, <br/> int maxnames, <br/> unsigned int flags);
|
||||
int <a href="#virNetworkRef">virNetworkRef</a> (<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network);
|
||||
int <a href="#virStoragePoolRefresh">virStoragePoolRefresh</a> (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool, <br/> unsigned int flags);
|
||||
int <a href="#virConnectNumOfDefinedDomains">virConnectNumOfDefinedDomains</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn);
|
||||
<a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> <a href="#virStorageVolLookupByKey">virStorageVolLookupByKey</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> const char * key);
|
||||
@ -244,7 +248,9 @@ int <a href="#virConnectNumOfDefinedStoragePools">virConnectNumOfDefinedStorageP
|
||||
const char * <a href="#virNodeDeviceGetParent">virNodeDeviceGetParent</a> (<a href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a> dev);
|
||||
<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> <a href="#virConnectOpen">virConnectOpen</a> (const char * name);
|
||||
<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> <a href="#virDomainCreateXML">virDomainCreateXML</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> const char * xmlDesc, <br/> unsigned int flags);
|
||||
int <a href="#virNodeDeviceRef">virNodeDeviceRef</a> (<a href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a> dev);
|
||||
int <a href="#virDomainSetVcpus">virDomainSetVcpus</a> (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br/> unsigned int nvcpus);
|
||||
int <a href="#virDomainRef">virDomainRef</a> (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain);
|
||||
int <a href="#virConnectDomainEventRegister">virConnectDomainEventRegister</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> <a href="libvirt-libvirt.html#virConnectDomainEventCallback">virConnectDomainEventCallback</a> cb, <br/> void * opaque, <br/> <a href="libvirt-libvirt.html#virFreeCallback">virFreeCallback</a> freecb);
|
||||
unsigned int <a href="#virDomainGetID">virDomainGetID</a> (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain);
|
||||
int <a href="#virDomainBlockPeek">virDomainBlockPeek</a> (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br/> const char * path, <br/> unsigned long long offset, <br/> size_t size, <br/> void * buffer, <br/> unsigned int flags);
|
||||
@ -739,8 +745,8 @@ The content of this structure is not made public by the API.
|
||||
<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 connection</td></tr><tr><td><span class="term"><i><tt>cb</tt></i>:</span></td><td>callback to the function handling domain events</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success, -1 on failure</td></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virConnectDomainEventRegister"/>virConnectDomainEventRegister ()</h3><pre class="programlisting">int virConnectDomainEventRegister (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> <a href="libvirt-libvirt.html#virConnectDomainEventCallback">virConnectDomainEventCallback</a> cb, <br/> void * opaque, <br/> <a href="libvirt-libvirt.html#virFreeCallback">virFreeCallback</a> freecb)<br/>
|
||||
</pre><p>Adds a Domain Event Callback. Registering for a domain callback will enable delivery of the events</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 connection</td></tr><tr><td><span class="term"><i><tt>cb</tt></i>:</span></td><td>callback to the function handling domain events</td></tr><tr><td><span class="term"><i><tt>opaque</tt></i>:</span></td><td>opaque data to pass on to the callback</td></tr><tr><td><span class="term"><i><tt>freecb</tt></i>:</span></td><td>optional function to deallocate opaque when not used anymore</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success, -1 on failure</td></tr></tbody></table></div></div>
|
||||
</pre><p>Adds a Domain Event Callback. Registering for a domain callback will enable delivery of the events The <a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> object handle passed into the callback upon delivery of an event is only valid for the duration of execution of the callback. If the callback wishes to keep the domain object after the callback</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 connection</td></tr><tr><td><span class="term"><i><tt>cb</tt></i>:</span></td><td>callback to the function handling domain events</td></tr><tr><td><span class="term"><i><tt>opaque</tt></i>:</span></td><td>opaque data to pass on to the callback</td></tr><tr><td><span class="term"><i><tt>freecb</tt></i>:</span></td><td>optional function to deallocate opaque when not used anymore</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>it shall take a reference to it, by calling virDomainRef. The reference can be released once the object is no longer required by calling virDomainFree. Returns 0 on success, -1 on failure</td></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virConnectFindStoragePoolSources"/>virConnectFindStoragePoolSources ()</h3><pre class="programlisting">char * virConnectFindStoragePoolSources (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> const char * type, <br/> const char * srcSpec, <br/> unsigned int flags)<br/>
|
||||
</pre><p>Talks to a storage backend and attempts to auto-discover the set of available storage pool sources. e.g. For iSCSI this would be a set of iSCSI targets. For NFS this would be a list of exported paths. The srcSpec (optional for some storage pool types, e.g. local ones) is an instance of the storage pool's source element specifying where to look for the pools. srcSpec is not required for some types (e.g., those querying local storage resources only)</p>
|
||||
@ -829,6 +835,10 @@ The content of this structure is not made public by the API.
|
||||
<div class="refsect2" lang="en"><h3><a name="virConnectOpenReadOnly"/>virConnectOpenReadOnly ()</h3><pre class="programlisting"><a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> virConnectOpenReadOnly (const char * name)<br/>
|
||||
</pre><p>This function should be called first to get a restricted connection to the library functionalities. The set of APIs usable are then restricted on the available methods to control the domains.</p>
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td>URI of the hypervisor</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the hypervisor connection or NULL in case of error URIs are documented at http://libvirt.org/uri.html</td></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virConnectRef"/>virConnectRef ()</h3><pre class="programlisting">int virConnectRef (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)<br/>
|
||||
</pre><p>Increment the reference count on the connection. For each additional call to this method, there shall be a corresponding call to <a href="libvirt-libvirt.html#virConnectClose">virConnectClose</a> to release the reference count, once the caller no longer needs the reference to this object. This method is typically useful for applications where multiple threads are using a connection, and it is required that the connection remain open until all threads have finished using it. ie, each new thread using a connection would increment the reference count.</p>
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>the connection to hold a reference on</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td/></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virDomainAttachDevice"/>virDomainAttachDevice ()</h3><pre class="programlisting">int virDomainAttachDevice (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br/> const char * xml)<br/>
|
||||
</pre><p>Create a virtual device attachment to backend.</p>
|
||||
@ -965,6 +975,10 @@ The content of this structure is not made public by the API.
|
||||
<div class="refsect2" lang="en"><h3><a name="virDomainReboot"/>virDomainReboot ()</h3><pre class="programlisting">int virDomainReboot (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br/> unsigned int flags)<br/>
|
||||
</pre><p>Reboot a domain, the domain object is still usable there after but the domain OS is being stopped for a restart. Note that the guest OS may ignore the request.</p>
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags for the reboot operation, not used yet</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virDomainRef"/>virDomainRef ()</h3><pre class="programlisting">int virDomainRef (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)<br/>
|
||||
</pre><p>Increment the reference count on the domain. For each additional call to this method, there shall be a corresponding call to <a href="libvirt-libvirt.html#virDomainFree">virDomainFree</a> to release the reference count, once the caller no longer needs the reference to this object. This method is typically useful for applications where multiple threads are using a connection, and it is required that the connection remain open until all threads have finished using it. ie, each new thread using a domain would increment the reference count.</p>
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td/></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virDomainRestore"/>virDomainRestore ()</h3><pre class="programlisting">int virDomainRestore (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> const char * from)<br/>
|
||||
</pre><p>This method will restore a domain saved to disk by virDomainSave().</p>
|
||||
@ -1081,6 +1095,10 @@ The content of this structure is not made public by the API.
|
||||
<div class="refsect2" lang="en"><h3><a name="virNetworkLookupByUUIDString"/>virNetworkLookupByUUIDString ()</h3><pre class="programlisting"><a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> virNetworkLookupByUUIDString (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> const char * uuidstr)<br/>
|
||||
</pre><p>Try to lookup a network on the given hypervisor based on its UUID.</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>uuidstr</tt></i>:</span></td><td>the string UUID for the network</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a new network object or NULL in case of failure. If the network cannot be found, then <a href="libvirt-virterror.html#VIR_ERR_NO_NETWORK">VIR_ERR_NO_NETWORK</a> error is raised.</td></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virNetworkRef"/>virNetworkRef ()</h3><pre class="programlisting">int virNetworkRef (<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network)<br/>
|
||||
</pre><p>Increment the reference count on the network. For each additional call to this method, there shall be a corresponding call to <a href="libvirt-libvirt.html#virNetworkFree">virNetworkFree</a> to release the reference count, once the caller no longer needs the reference to this object. This method is typically useful for applications where multiple threads are using a connection, and it is required that the connection remain open until all threads have finished using it. ie, each new thread using a network would increment the reference count.</p>
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>network</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td/></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virNetworkSetAutostart"/>virNetworkSetAutostart ()</h3><pre class="programlisting">int virNetworkSetAutostart (<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network, <br/> int autostart)<br/>
|
||||
</pre><p>Configure the network to be automatically started when the host machine boots.</p>
|
||||
@ -1117,6 +1135,10 @@ The content of this structure is not made public by the API.
|
||||
<div class="refsect2" lang="en"><h3><a name="virNodeDeviceNumOfCaps"/>virNodeDeviceNumOfCaps ()</h3><pre class="programlisting">int virNodeDeviceNumOfCaps (<a href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a> dev)<br/>
|
||||
</pre><p>Accessor for the number of capabilities supported by the device.</p>
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>dev</tt></i>:</span></td><td>the device</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of capabilities supported by the device.</td></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virNodeDeviceRef"/>virNodeDeviceRef ()</h3><pre class="programlisting">int virNodeDeviceRef (<a href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a> dev)<br/>
|
||||
</pre><p>Increment the reference count on the dev. For each additional call to this method, there shall be a corresponding call to <a href="libvirt-libvirt.html#virNodeDeviceFree">virNodeDeviceFree</a> to release the reference count, once the caller no longer needs the reference to this object. This method is typically useful for applications where multiple threads are using a connection, and it is required that the connection remain open until all threads have finished using it. ie, each new thread using a dev would increment the reference count.</p>
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>dev</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td/></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virNodeGetCellsFreeMemory"/>virNodeGetCellsFreeMemory ()</h3><pre class="programlisting">int virNodeGetCellsFreeMemory (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/> unsigned long long * freeMems, <br/> int startCell, <br/> int maxCells)<br/>
|
||||
</pre><p>This call returns the amount of free memory in one or more NUMA cells. The @freeMems array must be allocated by the caller and will be filled with the amount of free memory in kilobytes for each cell requested, starting with startCell (in freeMems[0]), up to either (startCell + maxCells), or the number of additional cells in the node, whichever is smaller.</p>
|
||||
@ -1217,6 +1239,10 @@ The content of this structure is not made public by the API.
|
||||
<div class="refsect2" lang="en"><h3><a name="virStoragePoolNumOfVolumes"/>virStoragePoolNumOfVolumes ()</h3><pre class="programlisting">int virStoragePoolNumOfVolumes (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool)<br/>
|
||||
</pre><p>Fetch the number of storage volumes within a pool</p>
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>pool</tt></i>:</span></td><td>pointer to storage pool</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of storage pools, or -1 on failure</td></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virStoragePoolRef"/>virStoragePoolRef ()</h3><pre class="programlisting">int virStoragePoolRef (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool)<br/>
|
||||
</pre><p>Increment the reference count on the pool. For each additional call to this method, there shall be a corresponding call to <a href="libvirt-libvirt.html#virStoragePoolFree">virStoragePoolFree</a> to release the reference count, once the caller no longer needs the reference to this object. This method is typically useful for applications where multiple threads are using a connection, and it is required that the connection remain open until all threads have finished using it. ie, each new thread using a pool would increment the reference count.</p>
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>pool</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td/></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virStoragePoolRefresh"/>virStoragePoolRefresh ()</h3><pre class="programlisting">int virStoragePoolRefresh (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool, <br/> unsigned int flags)<br/>
|
||||
</pre><p>Request that the pool refresh its list of volumes. This may involve communicating with a remote server, and/or initializing new devices at the OS layer</p>
|
||||
@ -1239,7 +1265,7 @@ The content of this structure is not made public by the API.
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>vol</tt></i>:</span></td><td>pointer to storage volume</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>future flags, use 0 for now</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success, or -1 on error</td></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virStorageVolFree"/>virStorageVolFree ()</h3><pre class="programlisting">int virStorageVolFree (<a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol)<br/>
|
||||
</pre><p>Release the storage volume handle. The underlying storage volume contains to exist</p>
|
||||
</pre><p>Release the storage volume handle. The underlying storage volume continues to exist.</p>
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>vol</tt></i>:</span></td><td>pointer to storage volume</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success, or -1 on error</td></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virStorageVolGetConnect"/>virStorageVolGetConnect ()</h3><pre class="programlisting"><a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> virStorageVolGetConnect (<a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol)<br/>
|
||||
@ -1278,6 +1304,10 @@ The content of this structure is not made public by the API.
|
||||
</pre><p>Fetch a pointer to a storage volume based on its locally (host) unique path</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 hypervisor connection</td></tr><tr><td><span class="term"><i><tt>path</tt></i>:</span></td><td>locally unique path</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a storage volume, or NULL if not found / error</td></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
<div class="refsect2" lang="en"><h3><a name="virStorageVolRef"/>virStorageVolRef ()</h3><pre class="programlisting">int virStorageVolRef (<a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol)<br/>
|
||||
</pre><p>Increment the reference count on the vol. For each additional call to this method, there shall be a corresponding call to <a href="libvirt-libvirt.html#virStorageVolFree">virStorageVolFree</a> to release the reference count, once the caller no longer needs the reference to this object. This method is typically useful for applications where multiple threads are using a connection, and it is required that the connection remain open until all threads have finished using it. ie, each new thread using a vol would increment the reference count.</p>
|
||||
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>vol</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td/></tr></tbody></table></div></div>
|
||||
<hr/>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
@ -184,15 +184,15 @@ void <a href="#virConnResetLastError">virConnResetLastError</a> (<a href="libvi
|
||||
<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 One will need to free the result with virResetError()</p>
|
||||
</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 Simpler but may not be suitable for multithreaded accesses, in which case use virConnCopyLastError()</p>
|
||||
</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>Reset the last error caught on that connection</p>
|
||||
</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/>
|
||||
@ -200,7 +200,7 @@ void <a href="#virConnResetLastError">virConnResetLastError</a> (<a href="libvi
|
||||
<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 One will need to free the result with virResetError()</p>
|
||||
</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/>
|
||||
@ -208,7 +208,7 @@ void <a href="#virConnResetLastError">virConnResetLastError</a> (<a href="libvi
|
||||
<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="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 Simpler but may not be suitable for multithreaded accesses, in which case use virCopyLastError()</p>
|
||||
</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/>
|
||||
@ -216,7 +216,7 @@ void <a href="#virConnResetLastError">virConnResetLastError</a> (<a href="libvi
|
||||
<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.</p>
|
||||
</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="virSetErrorFunc"/>virSetErrorFunc ()</h3><pre class="programlisting">void virSetErrorFunc (void * userData, <br/> <a href="libvirt-virterror.html#virErrorFunc">virErrorFunc</a> handler)<br/>
|
||||
|
@ -142,6 +142,7 @@
|
||||
</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)
|
||||
|
@ -21,6 +21,7 @@
|
||||
|
||||
<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)
|
||||
|
@ -149,6 +149,23 @@
|
||||
node. If both are found, then Xen paravirtualized guests can be run using
|
||||
the KVM hardware acceleration.
|
||||
</li></ul>
|
||||
<h2>Connections to QEMU driver</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="xmlconfig" id="xmlconfig">Example domain XML config</a>
|
||||
</h2>
|
||||
@ -200,7 +217,7 @@
|
||||
<source network='default'/>
|
||||
<mac address='24:42:53:21:52:45'/>
|
||||
</interface>
|
||||
<graphics type='vnc' port='-1'/>
|
||||
<graphics type='vnc' port='-1' keymap='de'/>
|
||||
</devices>
|
||||
</domain></pre>
|
||||
<h3>Xen paravirtualized guests with hardware acceleration</h3>
|
||||
|
@ -32,6 +32,26 @@
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h2>Connections to QEMU driver</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="xmlconfig">Example domain XML config</a></h2>
|
||||
|
||||
<h3>QEMU emulated guest on x86_64</h3>
|
||||
@ -85,7 +105,7 @@
|
||||
<source network='default'/>
|
||||
<mac address='24:42:53:21:52:45'/>
|
||||
</interface>
|
||||
<graphics type='vnc' port='-1'/>
|
||||
<graphics type='vnc' port='-1' keymap='de'/>
|
||||
</devices>
|
||||
</domain></pre>
|
||||
|
||||
|
@ -126,6 +126,22 @@
|
||||
</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">
|
||||
|
@ -1,5 +1,25 @@
|
||||
<html>
|
||||
<body>
|
||||
<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>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
@ -146,8 +146,11 @@
|
||||
URIs are
|
||||
</p>
|
||||
<pre>
|
||||
uml:///system (local access, system instance)
|
||||
uml:///session (local access, session instance)
|
||||
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)
|
||||
|
@ -25,8 +25,11 @@
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
uml:///system (local access, system instance)
|
||||
uml:///session (local access, session instance)
|
||||
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)
|
||||
|
@ -159,6 +159,19 @@
|
||||
the <code>/etc/xen</code> directory. It is important not to place
|
||||
any other non-config files in this directory.
|
||||
</li></ul>
|
||||
<h2>Connections to Xen driver</h2>
|
||||
<p>
|
||||
The libvirt Xen driver is a single-instance privileged driver,
|
||||
with a driver name of 'xen'. Some example conection URIs for
|
||||
the libvirt driver are:
|
||||
</p>
|
||||
<pre>
|
||||
xen:/// (local access, direct)
|
||||
xen+unix:/// (local access, via daemon)
|
||||
xen://example.com/ (remote access, TLS/x509)
|
||||
xen+tcp://example.com/ (remote access, SASl/Kerberos)
|
||||
xen+ssh://root@example.com/ (remote access, SSH tunnelled)
|
||||
</pre>
|
||||
<h2>
|
||||
<a name="xmlconfig" id="xmlconfig">Example domain XML config</a>
|
||||
</h2>
|
||||
|
@ -44,6 +44,23 @@
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h2>Connections to Xen driver</h2>
|
||||
|
||||
<p>
|
||||
The libvirt Xen driver is a single-instance privileged driver,
|
||||
with a driver name of 'xen'. Some example conection URIs for
|
||||
the libvirt driver are:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
xen:/// (local access, direct)
|
||||
xen+unix:/// (local access, via daemon)
|
||||
xen://example.com/ (remote access, TLS/x509)
|
||||
xen+tcp://example.com/ (remote access, SASl/Kerberos)
|
||||
xen+ssh://root@example.com/ (remote access, SSH tunnelled)
|
||||
</pre>
|
||||
|
||||
|
||||
<h2><a name="xmlconfig">Example domain XML config</a></h2>
|
||||
|
||||
<p>
|
||||
|
@ -1,4 +1,3 @@
|
||||
*.exe
|
||||
.memdump
|
||||
Makefile.in
|
||||
Makefile
|
||||
|
1
docs/examples/.gitignore
vendored
1
docs/examples/.gitignore
vendored
@ -1,4 +1,3 @@
|
||||
*.exe
|
||||
.memdump
|
||||
Makefile.in
|
||||
Makefile
|
||||
|
@ -20,7 +20,7 @@ index.html: examples.xml examples.xsl $(top_srcdir)/docs/site.xsl
|
||||
install-data-local:
|
||||
$(mkinstalldirs) $(DESTDIR)$(HTML_DIR)
|
||||
-@INSTALL@ -m 0644 $(srcdir)/*.html $(srcdir)/*.c $(srcdir)/*.xml \
|
||||
$(srcdir)/*.xsl $(srcdir)/*.res $(DESTDIR)$(HTML_DIR)
|
||||
$(srcdir)/*.xsl $(DESTDIR)$(HTML_DIR)
|
||||
|
||||
EXTRA_DIST=examples.xsl index.py examples.xml
|
||||
|
||||
|
@ -218,8 +218,6 @@ def dump_sections(output):
|
||||
def dump_Makefile():
|
||||
for file in glob.glob('*.xml'):
|
||||
extras.append(file)
|
||||
for file in glob.glob('*.res'):
|
||||
extras.append(file)
|
||||
Makefile="""# -*- buffer-read-only: t -*- vi: set ro:
|
||||
# Beware this is autogenerated by index.py
|
||||
SUBDIRS=python
|
||||
@ -243,7 +241,7 @@ index.html: examples.xml examples.xsl $(top_srcdir)/docs/site.xsl
|
||||
install-data-local:
|
||||
$(mkinstalldirs) $(DESTDIR)$(HTML_DIR)
|
||||
-@INSTALL@ -m 0644 $(srcdir)/*.html $(srcdir)/*.c $(srcdir)/*.xml \\
|
||||
$(srcdir)/*.xsl $(srcdir)/*.res $(DESTDIR)$(HTML_DIR)
|
||||
$(srcdir)/*.xsl $(DESTDIR)$(HTML_DIR)
|
||||
|
||||
"""
|
||||
EXTRA_DIST= string.join(extras, ' ')
|
||||
|
@ -140,7 +140,7 @@
|
||||
<ul><li>
|
||||
<a href="#elementsDisks">Hard drives, floppy disks, CDROMs</a>
|
||||
</li><li>
|
||||
<a href="#elementsUSB">USB devices</a>
|
||||
<a href="#elementsUSB">USB and PCI devices</a>
|
||||
</li><li>
|
||||
<a href="#elementsNICS">Network interfaces</a>
|
||||
<ul><li>
|
||||
@ -464,11 +464,12 @@
|
||||
attribute provides the sub-type. <span class="since">Since 0.1.8</span>
|
||||
</dd></dl>
|
||||
<h4>
|
||||
<a name="elementsUSB" id="elementsUSB">USB devices</a>
|
||||
<a name="elementsUSB" id="elementsUSB">USB and PCI devices</a>
|
||||
</h4>
|
||||
<p>
|
||||
USB devices attached to the host can be passed through to the guest using
|
||||
the <code>hostdev</code> element. <span class="since">since after 0.4.4</span>
|
||||
USB and PCI devices attached to the host can be passed through to the guest using
|
||||
the <code>hostdev</code> element. <span class="since">since after
|
||||
0.4.4 for USB and 0.6.0 for PCI (KVM only)</span>:
|
||||
</p>
|
||||
<pre>
|
||||
...
|
||||
@ -477,22 +478,43 @@
|
||||
<vendor id='0x1234'/>
|
||||
<product id='0xbeef'/>
|
||||
</source>
|
||||
</disk>
|
||||
</hostdev>
|
||||
...</pre>
|
||||
<p>or:</p>
|
||||
<pre>
|
||||
...
|
||||
<hostdev mode='subsystem' type='pci'>
|
||||
<source>
|
||||
<address>bus='0x06' slot='0x02' function='0x0'</address>
|
||||
</source>
|
||||
</hostdev>
|
||||
...</pre>
|
||||
<dl><dt><code>hostdev</code></dt><dd>The <code>hostdev</code> element is the main container for describing
|
||||
host devices. For usb device passthrough <code>mode</code> is always
|
||||
"subsystem" and <code>type</code> is "usb".
|
||||
"subsystem" and <code>type</code> is "usb" for an USB device and "pci"
|
||||
for a PCI device..
|
||||
</dd><dt><code>source</code></dt><dd>The source element describes the device as seen from the host.
|
||||
The USB device can either be addressed by vendor / product id using the
|
||||
<code>vendor</code> and <code>product</code> elements or by the device's
|
||||
address on the hosts using the <code>address</code> element.</dd><dt><code>vendor</code>, <code>product</code></dt><dd>The <code>vendor</code> and <code>product</code> elements each have an
|
||||
address on the hosts using the <code>address</code> element.
|
||||
PCI devices on the other hand can only be described by their
|
||||
<code>address</code></dd><dt><code>vendor</code>, <code>product</code></dt><dd>The <code>vendor</code> and <code>product</code> elements each have an
|
||||
<code>id</code> attribute that specifies the USB vendor and product id.
|
||||
The ids can be given in decimal, hexadecimal (starting with 0x) or
|
||||
octal (starting with 0) form.</dd><dt><code>address</code></dt><dd>The <code>address</code> element has a <code>bus</code> and
|
||||
<code>device</code> attribute to specify the USB bus and device number
|
||||
the device appears at on the host. The values of these attributes can
|
||||
be given in decimal, hexadecimal (starting with 0x) or octal (starting
|
||||
with 0) form.</dd></dl>
|
||||
octal (starting with 0) form.</dd><dt><code>address</code></dt><dd>The <code>address</code> element for USB devices has a
|
||||
<code>bus</code> and <code>device</code> attribute to specify the
|
||||
USB bus and device number the device appears at on the host.
|
||||
The values of these attributes can be given in decimal, hexadecimal
|
||||
(starting with 0x) or octal (starting with 0) form.
|
||||
For PCI devices the element carries 3 attributes allowing to designate
|
||||
the device as can be found with the <code>lspci</code> or
|
||||
with <code>virsh nodedev-list</code>. The
|
||||
<code>bus</code> attribute allows the hexadecimal values 0 to ff, the
|
||||
<code>slot</code> attribute allows the hexadecimal values 0 to 1f, and
|
||||
the <code>function</code> attribute allows the hexadecimal values 0 to
|
||||
7. There is also an optional <code>domain</code> attribute for the
|
||||
PCI domain, with hexadecimal values 0 to ffff, but it is currently
|
||||
not used by qemu.</dd></dl>
|
||||
<h4>
|
||||
<a name="elementsNICS" id="elementsNICS">Network interfaces</a>
|
||||
</h4>
|
||||
@ -713,13 +735,18 @@ qemu-kvm -net nic,model=? /dev/null
|
||||
<dl><dt><code>graphics</code></dt><dd>The <code>graphics</code> element has a mandatory <code>type</code>
|
||||
attribute which takes the value "sdl" or "vnc". The former displays
|
||||
a window on the host desktop, while the latter activates a VNC server.
|
||||
The former accepts 3 optional arguments: a <code>display</code>
|
||||
attribute for the display to use, an <code>xauth</code> attribute for
|
||||
the authentication identifier, and an optional <code>fullscreen</code>
|
||||
attribute accepting values 'yes' or 'no'.
|
||||
If the latter is used the <code>port</code> attribute specifies the TCP
|
||||
port number (with -1 as legacy syntax indicating that it should be
|
||||
auto-allocated). The <code>autoport</code> attribute is the new
|
||||
preferred syntax for indicating autoallocation of the TCP port to use.
|
||||
The <code>listen</code> attribute is an IP address for the server to
|
||||
listen on. The <code>password</code> attribute provides a VNC password
|
||||
in clear text.</dd></dl>
|
||||
in clear text. The <code>keymap</code> attribute specifies the keymap
|
||||
to use.</dd></dl>
|
||||
<h4>
|
||||
<a name="elementsConsole" id="elementsConsole">Consoles, serial & parallel devices</a>
|
||||
</h4>
|
||||
|
@ -375,11 +375,12 @@
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<h4><a name="elementsUSB">USB devices</a></h4>
|
||||
<h4><a name="elementsUSB">USB and PCI devices</a></h4>
|
||||
|
||||
<p>
|
||||
USB devices attached to the host can be passed through to the guest using
|
||||
the <code>hostdev</code> element. <span class="since">since after 0.4.4</span>
|
||||
USB and PCI devices attached to the host can be passed through to the guest using
|
||||
the <code>hostdev</code> element. <span class="since">since after
|
||||
0.4.4 for USB and 0.6.0 for PCI (KVM only)</span>:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
@ -389,30 +390,51 @@
|
||||
<vendor id='0x1234'/>
|
||||
<product id='0xbeef'/>
|
||||
</source>
|
||||
</disk>
|
||||
</hostdev>
|
||||
...</pre>
|
||||
<p>or:</p>
|
||||
<pre>
|
||||
...
|
||||
<hostdev mode='subsystem' type='pci'>
|
||||
<source>
|
||||
<address>bus='0x06' slot='0x02' function='0x0'</address>
|
||||
</source>
|
||||
</hostdev>
|
||||
...</pre>
|
||||
|
||||
<dl>
|
||||
<dt><code>hostdev</code></dt>
|
||||
<dd>The <code>hostdev</code> element is the main container for describing
|
||||
host devices. For usb device passthrough <code>mode</code> is always
|
||||
"subsystem" and <code>type</code> is "usb".
|
||||
"subsystem" and <code>type</code> is "usb" for an USB device and "pci"
|
||||
for a PCI device..
|
||||
<dt><code>source</code></dt>
|
||||
<dd>The source element describes the device as seen from the host.
|
||||
The USB device can either be addressed by vendor / product id using the
|
||||
<code>vendor</code> and <code>product</code> elements or by the device's
|
||||
address on the hosts using the <code>address</code> element.</dd>
|
||||
address on the hosts using the <code>address</code> element.
|
||||
PCI devices on the other hand can only be described by their
|
||||
<code>address</code></dd>
|
||||
<dt><code>vendor</code>, <code>product</code></dt>
|
||||
<dd>The <code>vendor</code> and <code>product</code> elements each have an
|
||||
<code>id</code> attribute that specifies the USB vendor and product id.
|
||||
The ids can be given in decimal, hexadecimal (starting with 0x) or
|
||||
octal (starting with 0) form.</dd>
|
||||
<dt><code>address</code></dt>
|
||||
<dd>The <code>address</code> element has a <code>bus</code> and
|
||||
<code>device</code> attribute to specify the USB bus and device number
|
||||
the device appears at on the host. The values of these attributes can
|
||||
be given in decimal, hexadecimal (starting with 0x) or octal (starting
|
||||
with 0) form.</dd>
|
||||
<dd>The <code>address</code> element for USB devices has a
|
||||
<code>bus</code> and <code>device</code> attribute to specify the
|
||||
USB bus and device number the device appears at on the host.
|
||||
The values of these attributes can be given in decimal, hexadecimal
|
||||
(starting with 0x) or octal (starting with 0) form.
|
||||
For PCI devices the element carries 3 attributes allowing to designate
|
||||
the device as can be found with the <code>lspci</code> or
|
||||
with <code>virsh nodedev-list</code>. The
|
||||
<code>bus</code> attribute allows the hexadecimal values 0 to ff, the
|
||||
<code>slot</code> attribute allows the hexadecimal values 0 to 1f, and
|
||||
the <code>function</code> attribute allows the hexadecimal values 0 to
|
||||
7. There is also an optional <code>domain</code> attribute for the
|
||||
PCI domain, with hexadecimal values 0 to ffff, but it is currently
|
||||
not used by qemu.</dd>
|
||||
</dl>
|
||||
|
||||
<h4><a name="elementsNICS">Network interfaces</a></h4>
|
||||
@ -657,13 +679,18 @@ qemu-kvm -net nic,model=? /dev/null
|
||||
<dd>The <code>graphics</code> element has a mandatory <code>type</code>
|
||||
attribute which takes the value "sdl" or "vnc". The former displays
|
||||
a window on the host desktop, while the latter activates a VNC server.
|
||||
The former accepts 3 optional arguments: a <code>display</code>
|
||||
attribute for the display to use, an <code>xauth</code> attribute for
|
||||
the authentication identifier, and an optional <code>fullscreen</code>
|
||||
attribute accepting values 'yes' or 'no'.
|
||||
If the latter is used the <code>port</code> attribute specifies the TCP
|
||||
port number (with -1 as legacy syntax indicating that it should be
|
||||
auto-allocated). The <code>autoport</code> attribute is the new
|
||||
preferred syntax for indicating autoallocation of the TCP port to use.
|
||||
The <code>listen</code> attribute is an IP address for the server to
|
||||
listen on. The <code>password</code> attribute provides a VNC password
|
||||
in clear text.</dd>
|
||||
in clear text. The <code>keymap</code> attribute specifies the keymap
|
||||
to use.</dd>
|
||||
</dl>
|
||||
|
||||
<h4><a name="elementsConsole">Consoles, serial & parallel devices</a></h4>
|
||||
|
@ -131,6 +131,8 @@
|
||||
<a href="#StorageVolFirst">General metadata</a>
|
||||
</li><li>
|
||||
<a href="#StorageVolTarget">Target elements</a>
|
||||
</li><li>
|
||||
<a href="#StorageVolBacking">Backing store elements</a>
|
||||
</li></ul>
|
||||
</li><li>
|
||||
<a href="#examples">Example configuration</a>
|
||||
@ -328,14 +330,14 @@
|
||||
...
|
||||
<target>
|
||||
<path>/var/lib/virt/images/sparse.img</path>
|
||||
<format>qcow2</format>
|
||||
<permissions>
|
||||
<owner>0744</owner>
|
||||
<group>0744</group>
|
||||
<mode>0744</mode>
|
||||
<label>virt_image_t</label>
|
||||
</permissions>
|
||||
</target>
|
||||
</volume></pre>
|
||||
</target></pre>
|
||||
<dl><dt><code>path</code></dt><dd>Provides the location at which the volume can be accessed on
|
||||
the local filesystem, as an absolute path. This is a readonly
|
||||
attribute, so shouldn't be specified when creating a volume.
|
||||
@ -355,6 +357,45 @@
|
||||
element contains the numeric group ID. The <code>label</code> element
|
||||
contains the MAC (eg SELinux) label string.
|
||||
<span class="since">Since 0.4.1</span>
|
||||
</dd></dl>
|
||||
<h3>
|
||||
<a name="StorageVolBacking" id="StorageVolBacking">Backing store elements</a>
|
||||
</h3>
|
||||
<p>
|
||||
A single <code>backingStore</code> element is contained within the top level
|
||||
<code>volume</code> element. This tag is used to describe the optional copy
|
||||
on write, backing store for the storage volume. It can contain the following
|
||||
child elements:
|
||||
</p>
|
||||
<pre>
|
||||
...
|
||||
<backingStore>
|
||||
<path>/var/lib/virt/images/master.img</path>
|
||||
<format>raw</format>
|
||||
<permissions>
|
||||
<owner>0744</owner>
|
||||
<group>0744</group>
|
||||
<mode>0744</mode>
|
||||
<label>virt_image_t</label>
|
||||
</permissions>
|
||||
</backingStore>
|
||||
</volume></pre>
|
||||
<dl><dt><code>path</code></dt><dd>Provides the location at which the backing store can be accessed on
|
||||
the local filesystem, as an absolute path. If omitted, there is no
|
||||
backing store for this volume.
|
||||
<span class="since">Since 0.6.0</span></dd><dt><code>format</code></dt><dd>Provides information about the pool specific backing store format.
|
||||
For disk pools it will provide the partition type. For filesystem
|
||||
or directory pools it will provide the file format type, eg cow,
|
||||
qcow, vmdk, raw. Consult the pool-specific docs for the list of valid
|
||||
values. Most file formats require a backing store of the same format,
|
||||
however, the qcow2 format allows a different backing store format.
|
||||
<span class="since">Since 0.6.0</span></dd><dt><code>permissions</code></dt><dd>Provides information about the permissions of the backing file.
|
||||
It contains 4 child elements. The
|
||||
<code>mode</code> element contains the octal permission set. The
|
||||
<code>owner</code> element contains the numeric user ID. The <code>group</code>
|
||||
element contains the numeric group ID. The <code>label</code> element
|
||||
contains the MAC (eg SELinux) label string.
|
||||
<span class="since">Since 0.6.0</span>
|
||||
</dd></dl>
|
||||
<h2>
|
||||
<a name="examples" id="examples">Example configuration</a>
|
||||
|
@ -234,14 +234,14 @@
|
||||
...
|
||||
<target>
|
||||
<path>/var/lib/virt/images/sparse.img</path>
|
||||
<format>qcow2</format>
|
||||
<permissions>
|
||||
<owner>0744</owner>
|
||||
<group>0744</group>
|
||||
<mode>0744</mode>
|
||||
<label>virt_image_t</label>
|
||||
</permissions>
|
||||
</target>
|
||||
</volume></pre>
|
||||
</target></pre>
|
||||
|
||||
<dl>
|
||||
<dt><code>path</code></dt>
|
||||
@ -271,6 +271,54 @@
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<h3><a name="StorageVolBacking">Backing store elements</a></h3>
|
||||
|
||||
<p>
|
||||
A single <code>backingStore</code> element is contained within the top level
|
||||
<code>volume</code> element. This tag is used to describe the optional copy
|
||||
on write, backing store for the storage volume. It can contain the following
|
||||
child elements:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
...
|
||||
<backingStore>
|
||||
<path>/var/lib/virt/images/master.img</path>
|
||||
<format>raw</format>
|
||||
<permissions>
|
||||
<owner>0744</owner>
|
||||
<group>0744</group>
|
||||
<mode>0744</mode>
|
||||
<label>virt_image_t</label>
|
||||
</permissions>
|
||||
</backingStore>
|
||||
</volume></pre>
|
||||
|
||||
<dl>
|
||||
<dt><code>path</code></dt>
|
||||
<dd>Provides the location at which the backing store can be accessed on
|
||||
the local filesystem, as an absolute path. If omitted, there is no
|
||||
backing store for this volume.
|
||||
<span class="since">Since 0.6.0</span></dd>
|
||||
<dt><code>format</code></dt>
|
||||
<dd>Provides information about the pool specific backing store format.
|
||||
For disk pools it will provide the partition type. For filesystem
|
||||
or directory pools it will provide the file format type, eg cow,
|
||||
qcow, vmdk, raw. Consult the pool-specific docs for the list of valid
|
||||
values. Most file formats require a backing store of the same format,
|
||||
however, the qcow2 format allows a different backing store format.
|
||||
<span class="since">Since 0.6.0</span></dd>
|
||||
<dt><code>permissions</code></dt>
|
||||
<dd>Provides information about the permissions of the backing file.
|
||||
It contains 4 child elements. The
|
||||
<code>mode</code> element contains the octal permission set. The
|
||||
<code>owner</code> element contains the numeric user ID. The <code>group</code>
|
||||
element contains the numeric group ID. The <code>label</code> element
|
||||
contains the MAC (eg SELinux) label string.
|
||||
<span class="since">Since 0.6.0</span>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<h2><a name="examples">Example configuration</a></h2>
|
||||
|
||||
<p>
|
||||
|
@ -99,6 +99,7 @@ int <a href="#virConnectNumOfStoragePools">virConnectNumOfStoragePools</a> (<a h
|
||||
<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> <a href="#virConnectOpen">virConnectOpen</a> (const char * name)
|
||||
<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> <a href="#virConnectOpenAuth">virConnectOpenAuth</a> (const char * name, <br /> <a href="libvirt-libvirt.html#virConnectAuthPtr">virConnectAuthPtr</a> auth, <br /> int flags)
|
||||
<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> <a href="#virConnectOpenReadOnly">virConnectOpenReadOnly</a> (const char * name)
|
||||
int <a href="#virConnectRef">virConnectRef</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)
|
||||
int <a href="#virDomainAttachDevice">virDomainAttachDevice</a> (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br /> const char * xml)
|
||||
int <a href="#virDomainBlockPeek">virDomainBlockPeek</a> (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br /> const char * path, <br /> unsigned long long offset, <br /> size_t size, <br /> void * buffer, <br /> unsigned int flags)
|
||||
int <a href="#virDomainBlockStats">virDomainBlockStats</a> (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br /> const char * path, <br /> <a href="libvirt-libvirt.html#virDomainBlockStatsPtr">virDomainBlockStatsPtr</a> stats, <br /> size_t size)
|
||||
@ -133,6 +134,7 @@ int <a href="#virDomainMemoryPeek">virDomainMemoryPeek</a> (<a href="libvirt-li
|
||||
<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> <a href="#virDomainMigrate">virDomainMigrate</a> (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br /> <a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> dconn, <br /> unsigned long flags, <br /> const char * dname, <br /> const char * uri, <br /> unsigned long bandwidth)
|
||||
int <a href="#virDomainPinVcpu">virDomainPinVcpu</a> (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br /> unsigned int vcpu, <br /> unsigned char * cpumap, <br /> int maplen)
|
||||
int <a href="#virDomainReboot">virDomainReboot</a> (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br /> unsigned int flags)
|
||||
int <a href="#virDomainRef">virDomainRef</a> (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)
|
||||
int <a href="#virDomainRestore">virDomainRestore</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br /> const char * from)
|
||||
int <a href="#virDomainResume">virDomainResume</a> (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)
|
||||
int <a href="#virDomainSave">virDomainSave</a> (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br /> const char * to)
|
||||
@ -189,6 +191,7 @@ char * <a href="#virNetworkGetXMLDesc">virNetworkGetXMLDesc</a> (<a href="libvi
|
||||
<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> <a href="#virNetworkLookupByName">virNetworkLookupByName</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br /> const char * name)
|
||||
<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> <a href="#virNetworkLookupByUUID">virNetworkLookupByUUID</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br /> const unsigned char * uuid)
|
||||
<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> <a href="#virNetworkLookupByUUIDString">virNetworkLookupByUUIDString</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br /> const char * uuidstr)
|
||||
int <a href="#virNetworkRef">virNetworkRef</a> (<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network)
|
||||
int <a href="#virNetworkSetAutostart">virNetworkSetAutostart</a> (<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network, <br /> int autostart)
|
||||
int <a href="#virNetworkUndefine">virNetworkUndefine</a> (<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network)
|
||||
int <a href="#virNodeDeviceFree">virNodeDeviceFree</a> (<a href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a> dev)
|
||||
@ -198,6 +201,7 @@ char * <a href="#virNodeDeviceGetXMLDesc">virNodeDeviceGetXMLDesc</a> (<a href=
|
||||
int <a href="#virNodeDeviceListCaps">virNodeDeviceListCaps</a> (<a href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a> dev, <br /> char ** const names, <br /> int maxnames)
|
||||
<a href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a> <a href="#virNodeDeviceLookupByName">virNodeDeviceLookupByName</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br /> const char * name)
|
||||
int <a href="#virNodeDeviceNumOfCaps">virNodeDeviceNumOfCaps</a> (<a href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a> dev)
|
||||
int <a href="#virNodeDeviceRef">virNodeDeviceRef</a> (<a href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a> dev)
|
||||
int <a href="#virNodeGetCellsFreeMemory">virNodeGetCellsFreeMemory</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br /> unsigned long long * freeMems, <br /> int startCell, <br /> int maxCells)
|
||||
unsigned long long <a href="#virNodeGetFreeMemory">virNodeGetFreeMemory</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)
|
||||
int <a href="#virNodeGetInfo">virNodeGetInfo</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br /> <a href="libvirt-libvirt.html#virNodeInfoPtr">virNodeInfoPtr</a> info)
|
||||
@ -223,6 +227,7 @@ int <a href="#virStoragePoolListVolumes">virStoragePoolListVolumes</a> (<a href=
|
||||
<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> <a href="#virStoragePoolLookupByUUIDString">virStoragePoolLookupByUUIDString</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br /> const char * uuidstr)
|
||||
<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> <a href="#virStoragePoolLookupByVolume">virStoragePoolLookupByVolume</a> (<a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol)
|
||||
int <a href="#virStoragePoolNumOfVolumes">virStoragePoolNumOfVolumes</a> (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool)
|
||||
int <a href="#virStoragePoolRef">virStoragePoolRef</a> (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool)
|
||||
int <a href="#virStoragePoolRefresh">virStoragePoolRefresh</a> (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool, <br /> unsigned int flags)
|
||||
int <a href="#virStoragePoolSetAutostart">virStoragePoolSetAutostart</a> (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool, <br /> int autostart)
|
||||
int <a href="#virStoragePoolUndefine">virStoragePoolUndefine</a> (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool)
|
||||
@ -238,6 +243,7 @@ char * <a href="#virStorageVolGetXMLDesc">virStorageVolGetXMLDesc</a> (<a href=
|
||||
<a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> <a href="#virStorageVolLookupByKey">virStorageVolLookupByKey</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br /> const char * key)
|
||||
<a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> <a href="#virStorageVolLookupByName">virStorageVolLookupByName</a> (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool, <br /> const char * name)
|
||||
<a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> <a href="#virStorageVolLookupByPath">virStorageVolLookupByPath</a> (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br /> const char * path)
|
||||
int <a href="#virStorageVolRef">virStorageVolRef</a> (<a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol)
|
||||
</pre><h2>Description</h2><h3><a name="macros" id="macros">Macros</a></h3><h3><a name="LIBVIR_VERSION_NUMBER" id="LIBVIR_VERSION_NUMBER"><code>LIBVIR_VERSION_NUMBER</code></a></h3><pre>#define LIBVIR_VERSION_NUMBER</pre><p>Macro providing the version of the library as version * 1,000,000 + minor * 1000 + micro</p><h3><a name="VIR_COPY_CPUMAP" id="VIR_COPY_CPUMAP"><code>VIR_COPY_CPUMAP</code></a></h3><pre>#define VIR_COPY_CPUMAP</pre><p>This macro is to be used in conjunction with virDomainGetVcpus() and virDomainPinVcpu() APIs. <a href="libvirt-libvirt.html#VIR_COPY_CPUMAP">VIR_COPY_CPUMAP</a> macro extract the cpumap of the specified vcpu from cpumaps array and copy it into cpumap to be used later by virDomainPinVcpu() API.</p><h3><a name="VIR_CPU_MAPLEN" id="VIR_CPU_MAPLEN"><code>VIR_CPU_MAPLEN</code></a></h3><pre>#define VIR_CPU_MAPLEN</pre><p>This macro is to be used in conjunction with virDomainPinVcpu() API. It returns the length (in bytes) required to store the complete CPU map between a single virtual & all physical CPUs of a domain.</p><h3><a name="VIR_CPU_USABLE" id="VIR_CPU_USABLE"><code>VIR_CPU_USABLE</code></a></h3><pre>#define VIR_CPU_USABLE</pre><p>This macro is to be used in conjunction with virDomainGetVcpus() API. <a href="libvirt-libvirt.html#VIR_CPU_USABLE">VIR_CPU_USABLE</a> macro returns a non zero value (true) if the cpu is usable by the vcpu, and 0 otherwise.</p><h3><a name="VIR_DOMAIN_SCHED_FIELD_LENGTH" id="VIR_DOMAIN_SCHED_FIELD_LENGTH"><code>VIR_DOMAIN_SCHED_FIELD_LENGTH</code></a></h3><pre>#define VIR_DOMAIN_SCHED_FIELD_LENGTH</pre><p>Macro providing the field length of <a href="libvirt-libvirt.html#virSchedParameter">virSchedParameter</a></p><h3><a name="VIR_GET_CPUMAP" id="VIR_GET_CPUMAP"><code>VIR_GET_CPUMAP</code></a></h3><pre>#define VIR_GET_CPUMAP</pre><p>This macro is to be used in conjunction with virDomainGetVcpus() and virDomainPinVcpu() APIs. <a href="libvirt-libvirt.html#VIR_GET_CPUMAP">VIR_GET_CPUMAP</a> macro returns a pointer to the cpumap of the specified vcpu from cpumaps array.</p><h3><a name="VIR_NODEINFO_MAXCPUS" id="VIR_NODEINFO_MAXCPUS"><code>VIR_NODEINFO_MAXCPUS</code></a></h3><pre>#define VIR_NODEINFO_MAXCPUS</pre><p>This macro is to calculate the total number of CPUs supported but not necessary active in the host.</p><h3><a name="VIR_UNUSE_CPU" id="VIR_UNUSE_CPU"><code>VIR_UNUSE_CPU</code></a></h3><pre>#define VIR_UNUSE_CPU</pre><p>This macro is to be used in conjunction with virDomainPinVcpu() API. USE_CPU macro reset the bit (CPU not usable) of the related cpu in cpumap.</p><h3><a name="VIR_USE_CPU" id="VIR_USE_CPU"><code>VIR_USE_CPU</code></a></h3><pre>#define VIR_USE_CPU</pre><p>This macro is to be used in conjunction with virDomainPinVcpu() API. USE_CPU macro set the bit (CPU usable) of the related cpu in cpumap.</p><h3><a name="VIR_UUID_BUFLEN" id="VIR_UUID_BUFLEN"><code>VIR_UUID_BUFLEN</code></a></h3><pre>#define VIR_UUID_BUFLEN</pre><p>This macro provides the length of the buffer required for virDomainGetUUID()</p><h3><a name="VIR_UUID_STRING_BUFLEN" id="VIR_UUID_STRING_BUFLEN"><code>VIR_UUID_STRING_BUFLEN</code></a></h3><pre>#define VIR_UUID_STRING_BUFLEN</pre><p>This macro provides the length of the buffer required for virDomainGetUUIDString()</p><h3><a name="types" id="types">Types</a></h3><h3><a name="virConnect" id="virConnect"><code>virConnect</code></a></h3><div class="api"><pre>struct virConnect{
|
||||
</pre><table><tr><td colspan="3">The content of this structure is not made public by the API</td></tr></table><pre>
|
||||
}
|
||||
@ -335,7 +341,7 @@ char * <a href="#virStorageVolGetXMLDesc">virStorageVolGetXMLDesc</a> (<a href=
|
||||
</pre><p>This function closes the connection to the Hypervisor. This should not be called if further interaction with the Hypervisor are needed especially if there is running domain which need further monitoring by the application.</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>0 in case of success or -1 in case of error.</td></tr></tbody></table></div><h3><a name="virConnectDomainEventCallback" id="virConnectDomainEventCallback"><code>virConnectDomainEventCallback</code></a></h3><pre class="programlisting">typedef int (*virConnectDomainEventCallback) (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br /> <a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br /> int event, <br /> int detail, <br /> void * opaque)
|
||||
</pre><p>A callback function to be registered, and called when a domain event occurs</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td><a href="libvirt-libvirt.html#virConnect">virConnect</a> connection</td></tr><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>The domain on which the event occured</td></tr><tr><td><span class="term"><i><tt>event</tt></i>:</span></td><td>The specfic <a href="libvirt-libvirt.html#virDomainEventType">virDomainEventType</a> which occured</td></tr><tr><td><span class="term"><i><tt>detail</tt></i>:</span></td><td>event specific detail information</td></tr><tr><td><span class="term"><i><tt>opaque</tt></i>:</span></td><td>opaque user data</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td></td></tr></tbody></table></div><br /><h3><a name="virConnectDomainEventDeregister" id="virConnectDomainEventDeregister"><code>virConnectDomainEventDeregister</code></a></h3><pre class="programlisting">int virConnectDomainEventDeregister (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br /> <a href="libvirt-libvirt.html#virConnectDomainEventCallback">virConnectDomainEventCallback</a> cb)<br />
|
||||
</pre><p>Removes a Domain Event Callback. De-registering for a domain callback will disable delivery of this event type</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 connection</td></tr><tr><td><span class="term"><i><tt>cb</tt></i>:</span></td><td>callback to the function handling domain events</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success, -1 on failure</td></tr></tbody></table></div><h3><a name="virConnectDomainEventRegister" id="virConnectDomainEventRegister"><code>virConnectDomainEventRegister</code></a></h3><pre class="programlisting">int virConnectDomainEventRegister (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br /> <a href="libvirt-libvirt.html#virConnectDomainEventCallback">virConnectDomainEventCallback</a> cb, <br /> void * opaque, <br /> <a href="libvirt-libvirt.html#virFreeCallback">virFreeCallback</a> freecb)<br />
|
||||
</pre><p>Adds a Domain Event Callback. Registering for a domain callback will enable delivery of the events</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 connection</td></tr><tr><td><span class="term"><i><tt>cb</tt></i>:</span></td><td>callback to the function handling domain events</td></tr><tr><td><span class="term"><i><tt>opaque</tt></i>:</span></td><td>opaque data to pass on to the callback</td></tr><tr><td><span class="term"><i><tt>freecb</tt></i>:</span></td><td>optional function to deallocate opaque when not used anymore</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success, -1 on failure</td></tr></tbody></table></div><h3><a name="virConnectFindStoragePoolSources" id="virConnectFindStoragePoolSources"><code>virConnectFindStoragePoolSources</code></a></h3><pre class="programlisting">char * virConnectFindStoragePoolSources (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br /> const char * type, <br /> const char * srcSpec, <br /> unsigned int flags)<br />
|
||||
</pre><p>Adds a Domain Event Callback. Registering for a domain callback will enable delivery of the events The <a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> object handle passed into the callback upon delivery of an event is only valid for the duration of execution of the callback. If the callback wishes to keep the domain object after the callback</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 connection</td></tr><tr><td><span class="term"><i><tt>cb</tt></i>:</span></td><td>callback to the function handling domain events</td></tr><tr><td><span class="term"><i><tt>opaque</tt></i>:</span></td><td>opaque data to pass on to the callback</td></tr><tr><td><span class="term"><i><tt>freecb</tt></i>:</span></td><td>optional function to deallocate opaque when not used anymore</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>it shall take a reference to it, by calling virDomainRef. The reference can be released once the object is no longer required by calling virDomainFree. Returns 0 on success, -1 on failure</td></tr></tbody></table></div><h3><a name="virConnectFindStoragePoolSources" id="virConnectFindStoragePoolSources"><code>virConnectFindStoragePoolSources</code></a></h3><pre class="programlisting">char * virConnectFindStoragePoolSources (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br /> const char * type, <br /> const char * srcSpec, <br /> unsigned int flags)<br />
|
||||
</pre><p>Talks to a storage backend and attempts to auto-discover the set of available storage pool sources. e.g. For iSCSI this would be a set of iSCSI targets. For NFS this would be a list of exported paths. The srcSpec (optional for some storage pool types, e.g. local ones) is an instance of the storage pool's source element specifying where to look for the pools. srcSpec is not required for some types (e.g., those querying local storage resources only)</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 hypervisor connection</td></tr><tr><td><span class="term"><i><tt>type</tt></i>:</span></td><td>type of storage pool sources to discover</td></tr><tr><td><span class="term"><i><tt>srcSpec</tt></i>:</span></td><td>XML document specifying discovery source</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>flags for discovery (unused, pass 0)</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>an xml document consisting of a SourceList element containing a source document appropriate to the given pool type for each discovered source.</td></tr></tbody></table></div><h3><a name="virConnectGetCapabilities" id="virConnectGetCapabilities"><code>virConnectGetCapabilities</code></a></h3><pre class="programlisting">char * virConnectGetCapabilities (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)<br />
|
||||
</pre><p>Provides capabilities of the hypervisor / driver.</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>NULL in case of error, or an XML string defining the capabilities. The client must free the returned string after use.</td></tr></tbody></table></div><h3><a name="virConnectGetHostname" id="virConnectGetHostname"><code>virConnectGetHostname</code></a></h3><pre class="programlisting">char * virConnectGetHostname (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)<br />
|
||||
</pre><p>This returns the system hostname on which the hypervisor is running (the result of the gethostname(2) system call). If we are connected to a remote system, then this returns the hostname of the remote system.</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 a hypervisor connection</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the hostname which must be freed by the caller, or NULL if there was an error.</td></tr></tbody></table></div><h3><a name="virConnectGetMaxVcpus" id="virConnectGetMaxVcpus"><code>virConnectGetMaxVcpus</code></a></h3><pre class="programlisting">int virConnectGetMaxVcpus (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br /> const char * type)<br />
|
||||
@ -357,7 +363,8 @@ char * <a href="#virStorageVolGetXMLDesc">virStorageVolGetXMLDesc</a> (<a href=
|
||||
</pre><p>Provides the number of active storage pools</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 hypervisor connection</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of pools found, or -1 on error</td></tr></tbody></table></div><h3><a name="virConnectOpen" id="virConnectOpen"><code>virConnectOpen</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> virConnectOpen (const char * name)<br />
|
||||
</pre><p>This function should be called first to get a connection to the Hypervisor and xen store</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td>URI of the hypervisor</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the hypervisor connection or NULL in case of error URIs are documented at http://libvirt.org/uri.html</td></tr></tbody></table></div><h3><a name="virConnectOpenAuth" id="virConnectOpenAuth"><code>virConnectOpenAuth</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> virConnectOpenAuth (const char * name, <br /> <a href="libvirt-libvirt.html#virConnectAuthPtr">virConnectAuthPtr</a> auth, <br /> int flags)<br />
|
||||
</pre><p>This function should be called first to get a connection to the Hypervisor. If necessary, authentication will be performed fetching credentials via the callback</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td>URI of the hypervisor</td></tr><tr><td><span class="term"><i><tt>auth</tt></i>:</span></td><td>Authenticate callback parameters</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>Open flags</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the hypervisor connection or NULL in case of error URIs are documented at http://libvirt.org/uri.html</td></tr></tbody></table></div><h3><a name="virConnectOpenReadOnly" id="virConnectOpenReadOnly"><code>virConnectOpenReadOnly</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> virConnectOpenReadOnly (const char * name)<br />
|
||||
</pre><p>This function should be called first to get a restricted connection to the library functionalities. The set of APIs usable are then restricted on the available methods to control the domains.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td>URI of the hypervisor</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the hypervisor connection or NULL in case of error URIs are documented at http://libvirt.org/uri.html</td></tr></tbody></table></div><h3><a name="virDomainAttachDevice" id="virDomainAttachDevice"><code>virDomainAttachDevice</code></a></h3><pre class="programlisting">int virDomainAttachDevice (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br /> const char * xml)<br />
|
||||
</pre><p>This function should be called first to get a restricted connection to the library functionalities. The set of APIs usable are then restricted on the available methods to control the domains.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td>URI of the hypervisor</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the hypervisor connection or NULL in case of error URIs are documented at http://libvirt.org/uri.html</td></tr></tbody></table></div><h3><a name="virConnectRef" id="virConnectRef"><code>virConnectRef</code></a></h3><pre class="programlisting">int virConnectRef (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)<br />
|
||||
</pre><p>Increment the reference count on the connection. For each additional call to this method, there shall be a corresponding call to <a href="libvirt-libvirt.html#virConnectClose">virConnectClose</a> to release the reference count, once the caller no longer needs the reference to this object. This method is typically useful for applications where multiple threads are using a connection, and it is required that the connection remain open until all threads have finished using it. ie, each new thread using a connection would increment the reference count.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>the connection to hold a reference on</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td></td></tr></tbody></table></div><h3><a name="virDomainAttachDevice" id="virDomainAttachDevice"><code>virDomainAttachDevice</code></a></h3><pre class="programlisting">int virDomainAttachDevice (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br /> const char * xml)<br />
|
||||
</pre><p>Create a virtual device attachment to backend.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>pointer to domain object</td></tr><tr><td><span class="term"><i><tt>xml</tt></i>:</span></td><td>pointer to XML description of one device</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainBlockPeek" id="virDomainBlockPeek"><code>virDomainBlockPeek</code></a></h3><pre class="programlisting">int virDomainBlockPeek (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br /> const char * path, <br /> unsigned long long offset, <br /> size_t size, <br /> void * buffer, <br /> unsigned int flags)<br />
|
||||
</pre><p>This function allows you to read the contents of a domain's disk device. Typical uses for this are to determine if the domain has written a Master Boot Record (indicating that the domain has completed installation), or to try to work out the state of the domain's filesystems. (Note that in the local case you might try to open the block device or file directly, but that won't work in the remote case, nor if you don't have sufficient permission. Hence the need for this call). 'path' must be a device or file corresponding to the domain. In other words it must be the precise string returned in a <disk><source dev='...'/></disk> from virDomainGetXMLDesc. 'offset' and 'size' represent an area which must lie entirely within the device or file. 'size' may be 0 to test if the call would succeed. 'buffer' is the return buffer and must be at least 'size' bytes. NB. The remote driver imposes a 64K byte limit on 'size'. For your program to be able to work reliably over a remote connection you should split large requests to <= 65536 bytes.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>pointer to the domain object</td></tr><tr><td><span class="term"><i><tt>path</tt></i>:</span></td><td>path to the block device</td></tr><tr><td><span class="term"><i><tt>offset</tt></i>:</span></td><td>offset within block device</td></tr><tr><td><span class="term"><i><tt>size</tt></i>:</span></td><td>size to read</td></tr><tr><td><span class="term"><i><tt>buffer</tt></i>:</span></td><td>return buffer (must be at least size bytes)</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>unused, always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success or -1 in case of failure. really 64 bits</td></tr></tbody></table></div><h3><a name="virDomainBlockStats" id="virDomainBlockStats"><code>virDomainBlockStats</code></a></h3><pre class="programlisting">int virDomainBlockStats (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br /> const char * path, <br /> <a href="libvirt-libvirt.html#virDomainBlockStatsPtr">virDomainBlockStatsPtr</a> stats, <br /> size_t size)<br />
|
||||
</pre><p>This function returns block device (disk) stats for block devices attached to the domain. The path parameter is the name of the block device. Get this by calling <a href="libvirt-libvirt.html#virDomainGetXMLDesc">virDomainGetXMLDesc</a> and finding the <target dev='...'> attribute within //domain/devices/disk. (For example, "xvda"). Domains may have more than one block device. To get stats for each you should make multiple calls to this function. Individual fields within the stats structure may be returned as -1, which indicates that the hypervisor does not support that particular statistic.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>pointer to the domain object</td></tr><tr><td><span class="term"><i><tt>path</tt></i>:</span></td><td>path to the block device</td></tr><tr><td><span class="term"><i><tt>stats</tt></i>:</span></td><td>block device stats (returned)</td></tr><tr><td><span class="term"><i><tt>size</tt></i>:</span></td><td>size of stats structure</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success or -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainCoreDump" id="virDomainCoreDump"><code>virDomainCoreDump</code></a></h3><pre class="programlisting">int virDomainCoreDump (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br /> const char * to, <br /> int flags)<br />
|
||||
@ -391,7 +398,8 @@ char * <a href="#virStorageVolGetXMLDesc">virStorageVolGetXMLDesc</a> (<a href=
|
||||
</pre><p>This function allows you to read the contents of a domain's memory. The memory which is read is controlled by the 'start', 'size' and 'flags' parameters. If 'flags' is <a href="libvirt-libvirt.html#VIR_MEMORY_VIRTUAL">VIR_MEMORY_VIRTUAL</a> then the 'start' and 'size' parameters are interpreted as virtual memory addresses for whichever task happens to be running on the domain at the moment. Although this sounds haphazard it is in fact what you want in order to read Linux kernel state, because it ensures that pointers in the kernel image can be interpreted coherently. 'buffer' is the return buffer and must be at least 'size' bytes. 'size' may be 0 to test if the call would succeed. NB. The remote driver imposes a 64K byte limit on 'size'. For your program to be able to work reliably over a remote connection you should split large requests to <= 65536 bytes.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>pointer to the domain object</td></tr><tr><td><span class="term"><i><tt>start</tt></i>:</span></td><td>start of memory to peek</td></tr><tr><td><span class="term"><i><tt>size</tt></i>:</span></td><td>size of memory to peek</td></tr><tr><td><span class="term"><i><tt>buffer</tt></i>:</span></td><td>return buffer (must be at least size bytes)</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>flags, see below</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success or -1 in case of failure. really 64 bits</td></tr></tbody></table></div><h3><a name="virDomainMigrate" id="virDomainMigrate"><code>virDomainMigrate</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> virDomainMigrate (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br /> <a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> dconn, <br /> unsigned long flags, <br /> const char * dname, <br /> const char * uri, <br /> unsigned long bandwidth)<br />
|
||||
</pre><p>Migrate the domain object from its current host to the destination host given by dconn (a connection to the destination host). Flags may be one of more of the following: <a href="libvirt-libvirt.html#VIR_MIGRATE_LIVE">VIR_MIGRATE_LIVE</a> Attempt a live migration. If a hypervisor supports renaming domains during migration, then you may set the dname parameter to the new name (otherwise it keeps the same name). If this is not supported by the hypervisor, dname must be NULL or else you will get an error. Since typically the two hypervisors connect directly to each other in order to perform the migration, you may need to specify a path from the source to the destination. This is the purpose of the uri parameter. If uri is NULL, then libvirt will try to find the best method. Uri may specify the hostname or IP address of the destination host as seen from the source. Or uri may be a URI giving transport, hostname, user, port, etc. in the usual form. Refer to driver documentation for the particular URIs supported. The maximum bandwidth (in Mbps) that will be used to do migration can be specified with the bandwidth parameter. If set to 0, libvirt will choose a suitable default. Some hypervisors do not support this feature and will return an error if bandwidth is not 0. To see which features are supported by the current hypervisor, see virConnectGetCapabilities, /capabilities/host/migration_features. There are many limitations on migration imposed by the underlying technology - for example it may not be possible to migrate between different processors even with the same architecture, or between different types of hypervisor.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>dconn</tt></i>:</span></td><td>destination host (a connection object)</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>flags</td></tr><tr><td><span class="term"><i><tt>dname</tt></i>:</span></td><td>(optional) rename domain to this at destination</td></tr><tr><td><span class="term"><i><tt>uri</tt></i>:</span></td><td>(optional) dest hostname/URI as seen from the source host</td></tr><tr><td><span class="term"><i><tt>bandwidth</tt></i>:</span></td><td>(optional) specify migration bandwidth limit in Mbps</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the new domain object if the migration was successful, or NULL in case of error. Note that the new domain object exists in the scope of the destination connection (dconn).</td></tr></tbody></table></div><h3><a name="virDomainPinVcpu" id="virDomainPinVcpu"><code>virDomainPinVcpu</code></a></h3><pre class="programlisting">int virDomainPinVcpu (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br /> unsigned int vcpu, <br /> unsigned char * cpumap, <br /> int maplen)<br />
|
||||
</pre><p>Dynamically change the real CPUs which can be allocated to a virtual CPU. This function requires privileged access to the hypervisor.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>pointer to domain object, or NULL for Domain0</td></tr><tr><td><span class="term"><i><tt>vcpu</tt></i>:</span></td><td>virtual CPU number</td></tr><tr><td><span class="term"><i><tt>cpumap</tt></i>:</span></td><td>pointer to a bit map of real CPUs (in 8-bit bytes) (IN) Each bit set to 1 means that corresponding CPU is usable. Bytes are stored in little-endian order: CPU0-7, 8-15... In each byte, lowest CPU number is least significant bit.</td></tr><tr><td><span class="term"><i><tt>maplen</tt></i>:</span></td><td>number of bytes in cpumap, from 1 up to size of CPU map in underlying virtualization system (Xen...). If maplen < size, missing bytes are set to zero. If maplen > size, failure code is returned.</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainReboot" id="virDomainReboot"><code>virDomainReboot</code></a></h3><pre class="programlisting">int virDomainReboot (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br /> unsigned int flags)<br />
|
||||
</pre><p>Reboot a domain, the domain object is still usable there after but the domain OS is being stopped for a restart. Note that the guest OS may ignore the request.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags for the reboot operation, not used yet</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainRestore" id="virDomainRestore"><code>virDomainRestore</code></a></h3><pre class="programlisting">int virDomainRestore (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br /> const char * from)<br />
|
||||
</pre><p>Reboot a domain, the domain object is still usable there after but the domain OS is being stopped for a restart. Note that the guest OS may ignore the request.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags for the reboot operation, not used yet</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainRef" id="virDomainRef"><code>virDomainRef</code></a></h3><pre class="programlisting">int virDomainRef (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)<br />
|
||||
</pre><p>Increment the reference count on the domain. For each additional call to this method, there shall be a corresponding call to <a href="libvirt-libvirt.html#virDomainFree">virDomainFree</a> to release the reference count, once the caller no longer needs the reference to this object. This method is typically useful for applications where multiple threads are using a connection, and it is required that the connection remain open until all threads have finished using it. ie, each new thread using a domain would increment the reference count.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td></td></tr></tbody></table></div><h3><a name="virDomainRestore" id="virDomainRestore"><code>virDomainRestore</code></a></h3><pre class="programlisting">int virDomainRestore (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br /> const char * from)<br />
|
||||
</pre><p>This method will restore a domain saved to disk by virDomainSave().</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>from</tt></i>:</span></td><td>path to the</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainResume" id="virDomainResume"><code>virDomainResume</code></a></h3><pre class="programlisting">int virDomainResume (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)<br />
|
||||
</pre><p>Resume an suspended domain, the process is restarted from the state where it was frozen by calling virSuspendDomain(). This function may requires privileged access</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainSave" id="virDomainSave"><code>virDomainSave</code></a></h3><pre class="programlisting">int virDomainSave (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br /> const char * to)<br />
|
||||
</pre><p>This method will suspend a domain and save its memory contents to a file on disk. After the call, if successful, the domain is not listed as running anymore (this may be a problem). Use virDomainRestore() to restore a domain after saving.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>to</tt></i>:</span></td><td>path for the output file</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainSetAutostart" id="virDomainSetAutostart"><code>virDomainSetAutostart</code></a></h3><pre class="programlisting">int virDomainSetAutostart (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br /> int autostart)<br />
|
||||
@ -429,7 +437,8 @@ char * <a href="#virStorageVolGetXMLDesc">virStorageVolGetXMLDesc</a> (<a href=
|
||||
</pre><p>Provide an XML description of the network. The description may be reused later to relaunch the network with virNetworkCreateXML().</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>network</tt></i>:</span></td><td>a network object</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>and OR'ed set of extraction flags, not used yet</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a 0 terminated UTF-8 encoded XML instance, or NULL in case of error. the caller must free() the returned value.</td></tr></tbody></table></div><h3><a name="virNetworkLookupByName" id="virNetworkLookupByName"><code>virNetworkLookupByName</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> virNetworkLookupByName (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br /> const char * name)<br />
|
||||
</pre><p>Try to lookup a network on the given hypervisor based on its name.</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>name</tt></i>:</span></td><td>name for the network</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a new network object or NULL in case of failure. If the network cannot be found, then <a href="libvirt-virterror.html#VIR_ERR_NO_NETWORK">VIR_ERR_NO_NETWORK</a> error is raised.</td></tr></tbody></table></div><h3><a name="virNetworkLookupByUUID" id="virNetworkLookupByUUID"><code>virNetworkLookupByUUID</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> virNetworkLookupByUUID (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br /> const unsigned char * uuid)<br />
|
||||
</pre><p>Try to lookup a network on the given hypervisor based on its UUID.</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>uuid</tt></i>:</span></td><td>the raw UUID for the network</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a new network object or NULL in case of failure. If the network cannot be found, then <a href="libvirt-virterror.html#VIR_ERR_NO_NETWORK">VIR_ERR_NO_NETWORK</a> error is raised.</td></tr></tbody></table></div><h3><a name="virNetworkLookupByUUIDString" id="virNetworkLookupByUUIDString"><code>virNetworkLookupByUUIDString</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> virNetworkLookupByUUIDString (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br /> const char * uuidstr)<br />
|
||||
</pre><p>Try to lookup a network on the given hypervisor based on its UUID.</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>uuidstr</tt></i>:</span></td><td>the string UUID for the network</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a new network object or NULL in case of failure. If the network cannot be found, then <a href="libvirt-virterror.html#VIR_ERR_NO_NETWORK">VIR_ERR_NO_NETWORK</a> error is raised.</td></tr></tbody></table></div><h3><a name="virNetworkSetAutostart" id="virNetworkSetAutostart"><code>virNetworkSetAutostart</code></a></h3><pre class="programlisting">int virNetworkSetAutostart (<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network, <br /> int autostart)<br />
|
||||
</pre><p>Try to lookup a network on the given hypervisor based on its UUID.</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>uuidstr</tt></i>:</span></td><td>the string UUID for the network</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a new network object or NULL in case of failure. If the network cannot be found, then <a href="libvirt-virterror.html#VIR_ERR_NO_NETWORK">VIR_ERR_NO_NETWORK</a> error is raised.</td></tr></tbody></table></div><h3><a name="virNetworkRef" id="virNetworkRef"><code>virNetworkRef</code></a></h3><pre class="programlisting">int virNetworkRef (<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network)<br />
|
||||
</pre><p>Increment the reference count on the network. For each additional call to this method, there shall be a corresponding call to <a href="libvirt-libvirt.html#virNetworkFree">virNetworkFree</a> to release the reference count, once the caller no longer needs the reference to this object. This method is typically useful for applications where multiple threads are using a connection, and it is required that the connection remain open until all threads have finished using it. ie, each new thread using a network would increment the reference count.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>network</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td></td></tr></tbody></table></div><h3><a name="virNetworkSetAutostart" id="virNetworkSetAutostart"><code>virNetworkSetAutostart</code></a></h3><pre class="programlisting">int virNetworkSetAutostart (<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network, <br /> int autostart)<br />
|
||||
</pre><p>Configure the network to be automatically started when the host machine boots.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>network</tt></i>:</span></td><td>a network object</td></tr><tr><td><span class="term"><i><tt>autostart</tt></i>:</span></td><td>whether the network should be automatically started 0 or 1</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 in case of success</td></tr></tbody></table></div><h3><a name="virNetworkUndefine" id="virNetworkUndefine"><code>virNetworkUndefine</code></a></h3><pre class="programlisting">int virNetworkUndefine (<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network)<br />
|
||||
</pre><p>Undefine a network but does not stop it if it is running</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>network</tt></i>:</span></td><td>pointer to a defined network</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><h3><a name="virNodeDeviceFree" id="virNodeDeviceFree"><code>virNodeDeviceFree</code></a></h3><pre class="programlisting">int virNodeDeviceFree (<a href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a> dev)<br />
|
||||
</pre><p>Drops a reference to the node device, freeing it if this was the last reference.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dev</tt></i>:</span></td><td>pointer to the node device</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the 0 for success, -1 for error.</td></tr></tbody></table></div><h3><a name="virNodeDeviceGetName" id="virNodeDeviceGetName"><code>virNodeDeviceGetName</code></a></h3><pre class="programlisting">const char * virNodeDeviceGetName (<a href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a> dev)<br />
|
||||
@ -438,7 +447,8 @@ char * <a href="#virStorageVolGetXMLDesc">virStorageVolGetXMLDesc</a> (<a href=
|
||||
</pre><p>Fetch an XML document describing all aspects of the device.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dev</tt></i>:</span></td><td>pointer to the node device</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>flags for XML generation (unused, pass 0)</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the XML document, or NULL on error</td></tr></tbody></table></div><h3><a name="virNodeDeviceListCaps" id="virNodeDeviceListCaps"><code>virNodeDeviceListCaps</code></a></h3><pre class="programlisting">int virNodeDeviceListCaps (<a href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a> dev, <br /> char ** const names, <br /> int maxnames)<br />
|
||||
</pre><p>Lists the names of the capabilities supported by the device.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dev</tt></i>:</span></td><td>the device</td></tr><tr><td><span class="term"><i><tt>names</tt></i>:</span></td><td>array to collect the list of capability names</td></tr><tr><td><span class="term"><i><tt>maxnames</tt></i>:</span></td><td>size of @names</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of capability names listed in @names.</td></tr></tbody></table></div><h3><a name="virNodeDeviceLookupByName" id="virNodeDeviceLookupByName"><code>virNodeDeviceLookupByName</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a> virNodeDeviceLookupByName (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br /> const char * name)<br />
|
||||
</pre><p>Lookup a node device by its name.</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>name</tt></i>:</span></td><td>unique device name</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a <a href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a> if found, NULL otherwise.</td></tr></tbody></table></div><h3><a name="virNodeDeviceNumOfCaps" id="virNodeDeviceNumOfCaps"><code>virNodeDeviceNumOfCaps</code></a></h3><pre class="programlisting">int virNodeDeviceNumOfCaps (<a href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a> dev)<br />
|
||||
</pre><p>Accessor for the number of capabilities supported by the device.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dev</tt></i>:</span></td><td>the device</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of capabilities supported by the device.</td></tr></tbody></table></div><h3><a name="virNodeGetCellsFreeMemory" id="virNodeGetCellsFreeMemory"><code>virNodeGetCellsFreeMemory</code></a></h3><pre class="programlisting">int virNodeGetCellsFreeMemory (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br /> unsigned long long * freeMems, <br /> int startCell, <br /> int maxCells)<br />
|
||||
</pre><p>Accessor for the number of capabilities supported by the device.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dev</tt></i>:</span></td><td>the device</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of capabilities supported by the device.</td></tr></tbody></table></div><h3><a name="virNodeDeviceRef" id="virNodeDeviceRef"><code>virNodeDeviceRef</code></a></h3><pre class="programlisting">int virNodeDeviceRef (<a href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a> dev)<br />
|
||||
</pre><p>Increment the reference count on the dev. For each additional call to this method, there shall be a corresponding call to <a href="libvirt-libvirt.html#virNodeDeviceFree">virNodeDeviceFree</a> to release the reference count, once the caller no longer needs the reference to this object. This method is typically useful for applications where multiple threads are using a connection, and it is required that the connection remain open until all threads have finished using it. ie, each new thread using a dev would increment the reference count.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dev</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td></td></tr></tbody></table></div><h3><a name="virNodeGetCellsFreeMemory" id="virNodeGetCellsFreeMemory"><code>virNodeGetCellsFreeMemory</code></a></h3><pre class="programlisting">int virNodeGetCellsFreeMemory (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br /> unsigned long long * freeMems, <br /> int startCell, <br /> int maxCells)<br />
|
||||
</pre><p>This call returns the amount of free memory in one or more NUMA cells. The @freeMems array must be allocated by the caller and will be filled with the amount of free memory in kilobytes for each cell requested, starting with startCell (in freeMems[0]), up to either (startCell + maxCells), or the number of additional cells in the node, whichever is smaller.</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>freeMems</tt></i>:</span></td><td>pointer to the array of unsigned long long</td></tr><tr><td><span class="term"><i><tt>startCell</tt></i>:</span></td><td>index of first cell to return freeMems info on.</td></tr><tr><td><span class="term"><i><tt>maxCells</tt></i>:</span></td><td>Maximum number of cells for which freeMems information can be returned.</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of entries filled in freeMems, or -1 in case of error.</td></tr></tbody></table></div><h3><a name="virNodeGetFreeMemory" id="virNodeGetFreeMemory"><code>virNodeGetFreeMemory</code></a></h3><pre class="programlisting">unsigned long long virNodeGetFreeMemory (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)<br />
|
||||
</pre><p>provides the free memory available on the Node</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>the available free memory in kilobytes or 0 in case of error</td></tr></tbody></table></div><h3><a name="virNodeGetInfo" id="virNodeGetInfo"><code>virNodeGetInfo</code></a></h3><pre class="programlisting">int virNodeGetInfo (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br /> <a href="libvirt-libvirt.html#virNodeInfoPtr">virNodeInfoPtr</a> info)<br />
|
||||
</pre><p>Extract hardware information about the node.</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>info</tt></i>:</span></td><td>pointer to a <a href="libvirt-libvirt.html#virNodeInfo">virNodeInfo</a> structure allocated by the user</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virNodeListDevices" id="virNodeListDevices"><code>virNodeListDevices</code></a></h3><pre class="programlisting">int virNodeListDevices (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br /> const char * cap, <br /> char ** const names, <br /> int maxnames, <br /> unsigned int flags)<br />
|
||||
@ -463,13 +473,14 @@ char * <a href="#virStorageVolGetXMLDesc">virStorageVolGetXMLDesc</a> (<a href=
|
||||
</pre><p>Fetch a storage pool based on its globally unique id</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 hypervisor connection</td></tr><tr><td><span class="term"><i><tt>uuid</tt></i>:</span></td><td>globally unique id of pool to fetch</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a <a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> object, or NULL if no matching pool is found</td></tr></tbody></table></div><h3><a name="virStoragePoolLookupByUUIDString" id="virStoragePoolLookupByUUIDString"><code>virStoragePoolLookupByUUIDString</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> virStoragePoolLookupByUUIDString (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br /> const char * uuidstr)<br />
|
||||
</pre><p>Fetch a storage pool based on its globally unique id</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 hypervisor connection</td></tr><tr><td><span class="term"><i><tt>uuidstr</tt></i>:</span></td><td>globally unique id of pool to fetch</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a <a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> object, or NULL if no matching pool is found</td></tr></tbody></table></div><h3><a name="virStoragePoolLookupByVolume" id="virStoragePoolLookupByVolume"><code>virStoragePoolLookupByVolume</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> virStoragePoolLookupByVolume (<a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol)<br />
|
||||
</pre><p>Fetch a storage pool which contains a particular volume</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>vol</tt></i>:</span></td><td>pointer to storage volume</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a <a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> object, or NULL if no matching pool is found</td></tr></tbody></table></div><h3><a name="virStoragePoolNumOfVolumes" id="virStoragePoolNumOfVolumes"><code>virStoragePoolNumOfVolumes</code></a></h3><pre class="programlisting">int virStoragePoolNumOfVolumes (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool)<br />
|
||||
</pre><p>Fetch the number of storage volumes within a pool</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>pool</tt></i>:</span></td><td>pointer to storage pool</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of storage pools, or -1 on failure</td></tr></tbody></table></div><h3><a name="virStoragePoolRefresh" id="virStoragePoolRefresh"><code>virStoragePoolRefresh</code></a></h3><pre class="programlisting">int virStoragePoolRefresh (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool, <br /> unsigned int flags)<br />
|
||||
</pre><p>Fetch the number of storage volumes within a pool</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>pool</tt></i>:</span></td><td>pointer to storage pool</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of storage pools, or -1 on failure</td></tr></tbody></table></div><h3><a name="virStoragePoolRef" id="virStoragePoolRef"><code>virStoragePoolRef</code></a></h3><pre class="programlisting">int virStoragePoolRef (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool)<br />
|
||||
</pre><p>Increment the reference count on the pool. For each additional call to this method, there shall be a corresponding call to <a href="libvirt-libvirt.html#virStoragePoolFree">virStoragePoolFree</a> to release the reference count, once the caller no longer needs the reference to this object. This method is typically useful for applications where multiple threads are using a connection, and it is required that the connection remain open until all threads have finished using it. ie, each new thread using a pool would increment the reference count.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>pool</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td></td></tr></tbody></table></div><h3><a name="virStoragePoolRefresh" id="virStoragePoolRefresh"><code>virStoragePoolRefresh</code></a></h3><pre class="programlisting">int virStoragePoolRefresh (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool, <br /> unsigned int flags)<br />
|
||||
</pre><p>Request that the pool refresh its list of volumes. This may involve communicating with a remote server, and/or initializing new devices at the OS layer</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>pool</tt></i>:</span></td><td>pointer to storage pool</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>flags to control refresh behaviour (currently unused, use 0)</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if the volume list was refreshed, -1 on failure</td></tr></tbody></table></div><h3><a name="virStoragePoolSetAutostart" id="virStoragePoolSetAutostart"><code>virStoragePoolSetAutostart</code></a></h3><pre class="programlisting">int virStoragePoolSetAutostart (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool, <br /> int autostart)<br />
|
||||
</pre><p>Sets the autostart flag</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>pool</tt></i>:</span></td><td>pointer to storage pool</td></tr><tr><td><span class="term"><i><tt>autostart</tt></i>:</span></td><td>new flag setting</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success, -1 on failure</td></tr></tbody></table></div><h3><a name="virStoragePoolUndefine" id="virStoragePoolUndefine"><code>virStoragePoolUndefine</code></a></h3><pre class="programlisting">int virStoragePoolUndefine (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool)<br />
|
||||
</pre><p>Undefine an inactive storage pool</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>pool</tt></i>:</span></td><td>pointer to storage pool</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a <a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> object, or NULL if creation failed</td></tr></tbody></table></div><h3><a name="virStorageVolCreateXML" id="virStorageVolCreateXML"><code>virStorageVolCreateXML</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> virStorageVolCreateXML (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool, <br /> const char * xmldesc, <br /> unsigned int flags)<br />
|
||||
</pre><p>Create a storage volume within a pool based on an XML description. Not all pools support creation of volumes</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>pool</tt></i>:</span></td><td>pointer to storage pool</td></tr><tr><td><span class="term"><i><tt>xmldesc</tt></i>:</span></td><td>description of volume to create</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>flags for creation (unused, pass 0)</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the storage volume, or NULL on error</td></tr></tbody></table></div><h3><a name="virStorageVolDelete" id="virStorageVolDelete"><code>virStorageVolDelete</code></a></h3><pre class="programlisting">int virStorageVolDelete (<a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol, <br /> unsigned int flags)<br />
|
||||
</pre><p>Delete the storage volume from the pool</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>vol</tt></i>:</span></td><td>pointer to storage volume</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>future flags, use 0 for now</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success, or -1 on error</td></tr></tbody></table></div><h3><a name="virStorageVolFree" id="virStorageVolFree"><code>virStorageVolFree</code></a></h3><pre class="programlisting">int virStorageVolFree (<a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol)<br />
|
||||
</pre><p>Release the storage volume handle. The underlying storage volume contains to exist</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>vol</tt></i>:</span></td><td>pointer to storage volume</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success, or -1 on error</td></tr></tbody></table></div><h3><a name="virStorageVolGetConnect" id="virStorageVolGetConnect"><code>virStorageVolGetConnect</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> virStorageVolGetConnect (<a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol)<br />
|
||||
</pre><p>Release the storage volume handle. The underlying storage volume continues to exist.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>vol</tt></i>:</span></td><td>pointer to storage volume</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success, or -1 on error</td></tr></tbody></table></div><h3><a name="virStorageVolGetConnect" id="virStorageVolGetConnect"><code>virStorageVolGetConnect</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> virStorageVolGetConnect (<a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol)<br />
|
||||
</pre><p>Provides the connection pointer associated with a storage volume. The reference counter on the connection is not increased by this call. WARNING: When writing libvirt bindings in other languages, do not use this function. Instead, store the connection and the volume object together.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>vol</tt></i>:</span></td><td>pointer to a pool</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the <a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> or NULL in case of failure.</td></tr></tbody></table></div><h3><a name="virStorageVolGetInfo" id="virStorageVolGetInfo"><code>virStorageVolGetInfo</code></a></h3><pre class="programlisting">int virStorageVolGetInfo (<a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol, <br /> <a href="libvirt-libvirt.html#virStorageVolInfoPtr">virStorageVolInfoPtr</a> info)<br />
|
||||
</pre><p>Fetches volatile information about the storage volume such as its current allocation</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>vol</tt></i>:</span></td><td>pointer to storage volume</td></tr><tr><td><span class="term"><i><tt>info</tt></i>:</span></td><td>pointer at which to store info</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success, or -1 on failure</td></tr></tbody></table></div><h3><a name="virStorageVolGetKey" id="virStorageVolGetKey"><code>virStorageVolGetKey</code></a></h3><pre class="programlisting">const char * virStorageVolGetKey (<a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol)<br />
|
||||
</pre><p>Fetch the storage volume key. This is globally unique, so the same volume will have the same key no matter what host it is accessed from</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>vol</tt></i>:</span></td><td>pointer to storage volume</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the volume key, or NULL on error</td></tr></tbody></table></div><h3><a name="virStorageVolGetName" id="virStorageVolGetName"><code>virStorageVolGetName</code></a></h3><pre class="programlisting">const char * virStorageVolGetName (<a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol)<br />
|
||||
@ -478,5 +489,6 @@ char * <a href="#virStorageVolGetXMLDesc">virStorageVolGetXMLDesc</a> (<a href=
|
||||
</pre><p>Fetch an XML document describing all aspects of the storage volume</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>vol</tt></i>:</span></td><td>pointer to storage volume</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>flags for XML generation (unused, pass 0)</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the XML document, or NULL on error</td></tr></tbody></table></div><h3><a name="virStorageVolLookupByKey" id="virStorageVolLookupByKey"><code>virStorageVolLookupByKey</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> virStorageVolLookupByKey (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br /> const char * key)<br />
|
||||
</pre><p>Fetch a pointer to a storage volume based on its globally unique key</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 hypervisor connection</td></tr><tr><td><span class="term"><i><tt>key</tt></i>:</span></td><td>globally unique key</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a storage volume, or NULL if not found / error</td></tr></tbody></table></div><h3><a name="virStorageVolLookupByName" id="virStorageVolLookupByName"><code>virStorageVolLookupByName</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> virStorageVolLookupByName (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool, <br /> const char * name)<br />
|
||||
</pre><p>Fetch a pointer to a storage volume based on its name within a pool</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>pool</tt></i>:</span></td><td>pointer to storage pool</td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td>name of storage volume</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a storage volume, or NULL if not found / error</td></tr></tbody></table></div><h3><a name="virStorageVolLookupByPath" id="virStorageVolLookupByPath"><code>virStorageVolLookupByPath</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> virStorageVolLookupByPath (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br /> const char * path)<br />
|
||||
</pre><p>Fetch a pointer to a storage volume based on its locally (host) unique path</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 hypervisor connection</td></tr><tr><td><span class="term"><i><tt>path</tt></i>:</span></td><td>locally unique path</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a storage volume, or NULL if not found / error</td></tr></tbody></table></div></div></div><div id="footer"><p id="sponsor">
|
||||
</pre><p>Fetch a pointer to a storage volume based on its locally (host) unique path</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 hypervisor connection</td></tr><tr><td><span class="term"><i><tt>path</tt></i>:</span></td><td>locally unique path</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a storage volume, or NULL if not found / error</td></tr></tbody></table></div><h3><a name="virStorageVolRef" id="virStorageVolRef"><code>virStorageVolRef</code></a></h3><pre class="programlisting">int virStorageVolRef (<a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol)<br />
|
||||
</pre><p>Increment the reference count on the vol. For each additional call to this method, there shall be a corresponding call to <a href="libvirt-libvirt.html#virStorageVolFree">virStorageVolFree</a> to release the reference count, once the caller no longer needs the reference to this object. This method is typically useful for applications where multiple threads are using a connection, and it is required that the connection remain open until all threads have finished using it. ie, each new thread using a vol would increment the reference count.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>vol</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td></td></tr></tbody></table></div></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>
|
||||
|
File diff suppressed because one or more lines are too long
@ -82,24 +82,28 @@
|
||||
A set of bindings for common languages
|
||||
</li><li>
|
||||
A <a href="CIM/">CIM provider</a> for the DMTF virtualization schema
|
||||
</li><li>
|
||||
A <a href="/qpid/">QMF agent</a> for the AMQP/QPid messaging system
|
||||
</li></ul>
|
||||
<h2>libvirt supports:</h2>
|
||||
<ul><li>
|
||||
The <a href="http://www.cl.cam.ac.uk/Research/SRG/netos/xen/index.html">Xen</a> hypervisor
|
||||
on Linux and Solaris hosts.
|
||||
</li><li>
|
||||
The <a href="http://fabrice.bellard.free.fr/qemu/">QEMU</a> emulator
|
||||
The <a href="http://bellard.org/qemu/">QEMU</a> emulator
|
||||
</li><li>
|
||||
The <a href="http://kvm.qumranet.com/kvmwiki">KVM</a> Linux hypervisor
|
||||
</li><li>
|
||||
The <a href="http://lxc.sourceforge.net/">LXC</a> Linux container system
|
||||
</li><li>
|
||||
The <a href="http://openvz.org/">OpenVZ</a> Linux container system
|
||||
</li><li>
|
||||
The <a href="http://user-mode-linux.sourceforge.net/">User Mode Linux</a> paravirtualized kernel
|
||||
</li><li>
|
||||
Storage on IDE/SCSI/USB disks, FibreChannel, LVM, iSCSI, NFS and filesystems
|
||||
</li></ul>
|
||||
<h2>libvirt provides:</h2>
|
||||
<ul><li>Remote management using TLS encryption and x509 certificates</li><li>Remote management authenticating with Kerberos and SASL</li><li>Local access control using PolicyKit</li><li>Zero-conf discovery using Avahi multicast-DNS</li><li>Management of virtual machines, virtual networks and storage</li></ul>
|
||||
<ul><li>Remote management using TLS encryption and x509 certificates</li><li>Remote management authenticating with Kerberos and SASL</li><li>Local access control using PolicyKit</li><li>Zero-conf discovery using Avahi multicast-DNS</li><li>Management of virtual machines, virtual networks and storage</li><li>Portable client API for Linux, Solaris and Windows</li></ul>
|
||||
<p class="image">
|
||||
<img src="libvirtLogo.png" alt="libvirt Logo" /></p>
|
||||
</div>
|
||||
|
@ -25,6 +25,9 @@
|
||||
<li>
|
||||
A <a href="CIM/">CIM provider</a> for the DMTF virtualization schema
|
||||
</li>
|
||||
<li>
|
||||
A <a href="/qpid/">QMF agent</a> for the AMQP/QPid messaging system
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h2>libvirt supports:</h2>
|
||||
@ -35,7 +38,7 @@
|
||||
on Linux and Solaris hosts.
|
||||
</li>
|
||||
<li>
|
||||
The <a href="http://fabrice.bellard.free.fr/qemu/">QEMU</a> emulator
|
||||
The <a href="http://bellard.org/qemu/">QEMU</a> emulator
|
||||
</li>
|
||||
<li>
|
||||
The <a href="http://kvm.qumranet.com/kvmwiki">KVM</a> Linux hypervisor
|
||||
@ -46,6 +49,9 @@
|
||||
<li>
|
||||
The <a href="http://openvz.org/">OpenVZ</a> Linux container system
|
||||
</li>
|
||||
<li>
|
||||
The <a href="http://user-mode-linux.sourceforge.net/">User Mode Linux</a> paravirtualized kernel
|
||||
</li>
|
||||
<li>
|
||||
Storage on IDE/SCSI/USB disks, FibreChannel, LVM, iSCSI, NFS and filesystems
|
||||
</li>
|
||||
@ -59,6 +65,7 @@
|
||||
<li>Local access control using PolicyKit</li>
|
||||
<li>Zero-conf discovery using Avahi multicast-DNS</li>
|
||||
<li>Management of virtual machines, virtual networks and storage</li>
|
||||
<li>Portable client API for Linux, Solaris and Windows</li>
|
||||
</ul>
|
||||
|
||||
<p class="image">
|
||||
|
@ -173,17 +173,18 @@
|
||||
<exports symbol='virStoragePoolGetConnect' type='function'/>
|
||||
<exports symbol='virConnectGetVersion' type='function'/>
|
||||
<exports symbol='virDomainFree' type='function'/>
|
||||
<exports symbol='virStorageVolRef' type='function'/>
|
||||
<exports symbol='virStoragePoolGetName' type='function'/>
|
||||
<exports symbol='virDomainSetAutostart' type='function'/>
|
||||
<exports symbol='virStoragePoolDefineXML' type='function'/>
|
||||
<exports symbol='virStorageVolLookupByPath' type='function'/>
|
||||
<exports symbol='virStorageVolLookupByName' type='function'/>
|
||||
<exports symbol='virDomainCreateLinux' type='function'/>
|
||||
<exports symbol='virNetworkCreate' type='function'/>
|
||||
<exports symbol='virDomainSetMaxMemory' type='function'/>
|
||||
<exports symbol='virEventRegisterImpl' type='function'/>
|
||||
<exports symbol='virDomainMigrate' type='function'/>
|
||||
<exports symbol='virDomainSuspend' type='function'/>
|
||||
<exports symbol='virNetworkCreate' type='function'/>
|
||||
<exports symbol='virDomainCreateLinux' type='function'/>
|
||||
<exports symbol='virNodeDeviceGetXMLDesc' type='function'/>
|
||||
<exports symbol='virEventUpdateHandleFunc' type='function'/>
|
||||
<exports symbol='virDomainDestroy' type='function'/>
|
||||
@ -226,6 +227,7 @@
|
||||
<exports symbol='virConnectGetHostname' type='function'/>
|
||||
<exports symbol='virEventRemoveTimeoutFunc' type='function'/>
|
||||
<exports symbol='virDomainGetName' type='function'/>
|
||||
<exports symbol='virStoragePoolRef' type='function'/>
|
||||
<exports symbol='virNetworkGetXMLDesc' type='function'/>
|
||||
<exports symbol='virConnectNumOfStoragePools' type='function'/>
|
||||
<exports symbol='virNetworkGetName' type='function'/>
|
||||
@ -244,6 +246,7 @@
|
||||
<exports symbol='virDomainMemoryPeek' type='function'/>
|
||||
<exports symbol='virNetworkLookupByUUID' type='function'/>
|
||||
<exports symbol='virConnectListDefinedNetworks' type='function'/>
|
||||
<exports symbol='virConnectRef' type='function'/>
|
||||
<exports symbol='virDomainGetUUID' type='function'/>
|
||||
<exports symbol='virNetworkCreateXML' type='function'/>
|
||||
<exports symbol='virDomainGetVcpus' type='function'/>
|
||||
@ -251,6 +254,7 @@
|
||||
<exports symbol='virStoragePoolGetInfo' type='function'/>
|
||||
<exports symbol='virDomainResume' type='function'/>
|
||||
<exports symbol='virNodeListDevices' type='function'/>
|
||||
<exports symbol='virNetworkRef' type='function'/>
|
||||
<exports symbol='virStoragePoolRefresh' type='function'/>
|
||||
<exports symbol='virConnectNumOfDefinedDomains' type='function'/>
|
||||
<exports symbol='virStorageVolLookupByKey' type='function'/>
|
||||
@ -292,7 +296,9 @@
|
||||
<exports symbol='virNodeDeviceGetParent' type='function'/>
|
||||
<exports symbol='virConnectOpen' type='function'/>
|
||||
<exports symbol='virDomainCreateXML' type='function'/>
|
||||
<exports symbol='virNodeDeviceRef' type='function'/>
|
||||
<exports symbol='virDomainSetVcpus' type='function'/>
|
||||
<exports symbol='virDomainRef' type='function'/>
|
||||
<exports symbol='virConnectDomainEventRegister' type='function'/>
|
||||
<exports symbol='virDomainGetID' type='function'/>
|
||||
<exports symbol='virDomainBlockPeek' type='function'/>
|
||||
@ -764,18 +770,18 @@ see note above'/>
|
||||
<typedef name='virVcpuState' file='libvirt' type='enum'/>
|
||||
<variable name='virConnectAuthPtrDefault' file='libvirt' type='virConnectAuthPtr'/>
|
||||
<function name='virConnCopyLastError' file='virterror' module='virterror'>
|
||||
<info>Copy the content of the last error caught on that connection One will need to free the result with virResetError()</info>
|
||||
<info>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()</info>
|
||||
<return type='int' info='0 if no error was found and the error code otherwise and -1 in case of parameter error.'/>
|
||||
<arg name='conn' type='virConnectPtr' info='pointer to the hypervisor connection'/>
|
||||
<arg name='to' type='virErrorPtr' info='target to receive the copy'/>
|
||||
</function>
|
||||
<function name='virConnGetLastError' file='virterror' module='virterror'>
|
||||
<info>Provide a pointer to the last error caught on that connection Simpler but may not be suitable for multithreaded accesses, in which case use virConnCopyLastError()</info>
|
||||
<info>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.</info>
|
||||
<return type='virErrorPtr' info='a pointer to the last error or NULL if none occurred.'/>
|
||||
<arg name='conn' type='virConnectPtr' info='pointer to the hypervisor connection'/>
|
||||
</function>
|
||||
<function name='virConnResetLastError' file='virterror' module='virterror'>
|
||||
<info>Reset the last error caught on that connection</info>
|
||||
<info>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</info>
|
||||
<return type='void'/>
|
||||
<arg name='conn' type='virConnectPtr' info='pointer to the hypervisor connection'/>
|
||||
</function>
|
||||
@ -814,8 +820,8 @@ see note above'/>
|
||||
<arg name='cb' type='virConnectDomainEventCallback' info='callback to the function handling domain events'/>
|
||||
</function>
|
||||
<function name='virConnectDomainEventRegister' file='libvirt' module='libvirt'>
|
||||
<info>Adds a Domain Event Callback. Registering for a domain callback will enable delivery of the events</info>
|
||||
<return type='int' info='0 on success, -1 on failure'/>
|
||||
<info>Adds a Domain Event Callback. Registering for a domain callback will enable delivery of the events The virDomainPtr object handle passed into the callback upon delivery of an event is only valid for the duration of execution of the callback. If the callback wishes to keep the domain object after the callback</info>
|
||||
<return type='int' info='it shall take a reference to it, by calling virDomainRef. The reference can be released once the object is no longer required by calling virDomainFree. Returns 0 on success, -1 on failure'/>
|
||||
<arg name='conn' type='virConnectPtr' info='pointer to the connection'/>
|
||||
<arg name='cb' type='virConnectDomainEventCallback' info='callback to the function handling domain events'/>
|
||||
<arg name='opaque' type='void *' info='opaque data to pass on to the callback'/>
|
||||
@ -950,8 +956,13 @@ see note above'/>
|
||||
<return type='virConnectPtr' info='a pointer to the hypervisor connection or NULL in case of error URIs are documented at http://libvirt.org/uri.html'/>
|
||||
<arg name='name' type='const char *' info='URI of the hypervisor'/>
|
||||
</function>
|
||||
<function name='virConnectRef' file='libvirt' module='libvirt'>
|
||||
<info>Increment the reference count on the connection. For each additional call to this method, there shall be a corresponding call to virConnectClose to release the reference count, once the caller no longer needs the reference to this object. This method is typically useful for applications where multiple threads are using a connection, and it is required that the connection remain open until all threads have finished using it. ie, each new thread using a connection would increment the reference count.</info>
|
||||
<return type='int' info=''/>
|
||||
<arg name='conn' type='virConnectPtr' info='the connection to hold a reference on'/>
|
||||
</function>
|
||||
<function name='virCopyLastError' file='virterror' module='virterror'>
|
||||
<info>Copy the content of the last error caught at the library level One will need to free the result with virResetError()</info>
|
||||
<info>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()</info>
|
||||
<return type='int' info='0 if no error was found and the error code otherwise and -1 in case of parameter error.'/>
|
||||
<arg name='to' type='virErrorPtr' info='target to receive the copy'/>
|
||||
</function>
|
||||
@ -1179,6 +1190,11 @@ see note above'/>
|
||||
<arg name='domain' type='virDomainPtr' info='a domain object'/>
|
||||
<arg name='flags' type='unsigned int' info='extra flags for the reboot operation, not used yet'/>
|
||||
</function>
|
||||
<function name='virDomainRef' file='libvirt' module='libvirt'>
|
||||
<info>Increment the reference count on the domain. For each additional call to this method, there shall be a corresponding call to virDomainFree to release the reference count, once the caller no longer needs the reference to this object. This method is typically useful for applications where multiple threads are using a connection, and it is required that the connection remain open until all threads have finished using it. ie, each new thread using a domain would increment the reference count.</info>
|
||||
<return type='int' info=''/>
|
||||
<arg name='domain' type='virDomainPtr' info=''/>
|
||||
</function>
|
||||
<function name='virDomainRestore' file='libvirt' module='libvirt'>
|
||||
<info>This method will restore a domain saved to disk by virDomainSave().</info>
|
||||
<return type='int' info='0 in case of success and -1 in case of failure.'/>
|
||||
@ -1317,7 +1333,7 @@ see note above'/>
|
||||
<arg name='opaque' type='void *' info=''/>
|
||||
</functype>
|
||||
<function name='virGetLastError' file='virterror' module='virterror'>
|
||||
<info>Provide a pointer to the last error caught at the library level Simpler but may not be suitable for multithreaded accesses, in which case use virCopyLastError()</info>
|
||||
<info>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.</info>
|
||||
<return type='virErrorPtr' info='a pointer to the last error or NULL if none occurred.'/>
|
||||
</function>
|
||||
<function name='virGetVersion' file='libvirt' module='libvirt'>
|
||||
@ -1415,6 +1431,11 @@ see note above'/>
|
||||
<arg name='conn' type='virConnectPtr' info='pointer to the hypervisor connection'/>
|
||||
<arg name='uuidstr' type='const char *' info='the string UUID for the network'/>
|
||||
</function>
|
||||
<function name='virNetworkRef' file='libvirt' module='libvirt'>
|
||||
<info>Increment the reference count on the network. For each additional call to this method, there shall be a corresponding call to virNetworkFree to release the reference count, once the caller no longer needs the reference to this object. This method is typically useful for applications where multiple threads are using a connection, and it is required that the connection remain open until all threads have finished using it. ie, each new thread using a network would increment the reference count.</info>
|
||||
<return type='int' info=''/>
|
||||
<arg name='network' type='virNetworkPtr' info=''/>
|
||||
</function>
|
||||
<function name='virNetworkSetAutostart' file='libvirt' module='libvirt'>
|
||||
<info>Configure the network to be automatically started when the host machine boots.</info>
|
||||
<return type='int' info='-1 in case of error, 0 in case of success'/>
|
||||
@ -1465,6 +1486,11 @@ see note above'/>
|
||||
<return type='int' info='the number of capabilities supported by the device.'/>
|
||||
<arg name='dev' type='virNodeDevicePtr' info='the device'/>
|
||||
</function>
|
||||
<function name='virNodeDeviceRef' file='libvirt' module='libvirt'>
|
||||
<info>Increment the reference count on the dev. For each additional call to this method, there shall be a corresponding call to virNodeDeviceFree to release the reference count, once the caller no longer needs the reference to this object. This method is typically useful for applications where multiple threads are using a connection, and it is required that the connection remain open until all threads have finished using it. ie, each new thread using a dev would increment the reference count.</info>
|
||||
<return type='int' info=''/>
|
||||
<arg name='dev' type='virNodeDevicePtr' info=''/>
|
||||
</function>
|
||||
<function name='virNodeGetCellsFreeMemory' file='libvirt' module='libvirt'>
|
||||
<info>This call returns the amount of free memory in one or more NUMA cells. The @freeMems array must be allocated by the caller and will be filled with the amount of free memory in kilobytes for each cell requested, starting with startCell (in freeMems[0]), up to either (startCell + maxCells), or the number of additional cells in the node, whichever is smaller.</info>
|
||||
<return type='int' info='the number of entries filled in freeMems, or -1 in case of error.'/>
|
||||
@ -1506,7 +1532,7 @@ see note above'/>
|
||||
<arg name='err' type='virErrorPtr' info='pointer to the virError to clean up'/>
|
||||
</function>
|
||||
<function name='virResetLastError' file='virterror' module='virterror'>
|
||||
<info>Reset the last error caught at the library level.</info>
|
||||
<info>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.</info>
|
||||
<return type='void'/>
|
||||
</function>
|
||||
<function name='virSetErrorFunc' file='virterror' module='virterror'>
|
||||
@ -1632,6 +1658,11 @@ see note above'/>
|
||||
<return type='int' info='the number of storage pools, or -1 on failure'/>
|
||||
<arg name='pool' type='virStoragePoolPtr' info='pointer to storage pool'/>
|
||||
</function>
|
||||
<function name='virStoragePoolRef' file='libvirt' module='libvirt'>
|
||||
<info>Increment the reference count on the pool. For each additional call to this method, there shall be a corresponding call to virStoragePoolFree to release the reference count, once the caller no longer needs the reference to this object. This method is typically useful for applications where multiple threads are using a connection, and it is required that the connection remain open until all threads have finished using it. ie, each new thread using a pool would increment the reference count.</info>
|
||||
<return type='int' info=''/>
|
||||
<arg name='pool' type='virStoragePoolPtr' info=''/>
|
||||
</function>
|
||||
<function name='virStoragePoolRefresh' file='libvirt' module='libvirt'>
|
||||
<info>Request that the pool refresh its list of volumes. This may involve communicating with a remote server, and/or initializing new devices at the OS layer</info>
|
||||
<return type='int' info='0 if the volume list was refreshed, -1 on failure'/>
|
||||
@ -1663,7 +1694,7 @@ see note above'/>
|
||||
<arg name='flags' type='unsigned int' info='future flags, use 0 for now'/>
|
||||
</function>
|
||||
<function name='virStorageVolFree' file='libvirt' module='libvirt'>
|
||||
<info>Release the storage volume handle. The underlying storage volume contains to exist</info>
|
||||
<info>Release the storage volume handle. The underlying storage volume continues to exist.</info>
|
||||
<return type='int' info='0 on success, or -1 on error'/>
|
||||
<arg name='vol' type='virStorageVolPtr' info='pointer to storage volume'/>
|
||||
</function>
|
||||
@ -1717,5 +1748,10 @@ see note above'/>
|
||||
<arg name='conn' type='virConnectPtr' info='pointer to hypervisor connection'/>
|
||||
<arg name='path' type='const char *' info='locally unique path'/>
|
||||
</function>
|
||||
<function name='virStorageVolRef' file='libvirt' module='libvirt'>
|
||||
<info>Increment the reference count on the vol. For each additional call to this method, there shall be a corresponding call to virStorageVolFree to release the reference count, once the caller no longer needs the reference to this object. This method is typically useful for applications where multiple threads are using a connection, and it is required that the connection remain open until all threads have finished using it. ie, each new thread using a vol would increment the reference count.</info>
|
||||
<return type='int' info=''/>
|
||||
<arg name='vol' type='virStorageVolPtr' info=''/>
|
||||
</function>
|
||||
</symbols>
|
||||
</api>
|
||||
|
File diff suppressed because it is too large
Load Diff
194
docs/logging.html
Normal file
194
docs/logging.html
Normal file
@ -0,0 +1,194 @@
|
||||
<?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 logging.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: Logging in the library and the daemon</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>
|
||||
<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>
|
||||
<span class="active">Logging</span>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of the logical subsystems in the libvirt API" class="inactive" href="intro.html">Architecture</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Description of the XML formats used in libvirt" class="inactive" href="format.html">XML format</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Hypervisor specific driver information" class="inactive" href="drivers.html">Drivers</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Reference manual for the C public API" class="inactive" href="html/index.html">API reference</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Bindings of the libvirt API for other languages" class="inactive" href="bindings.html">Language bindings</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="User contributed content" class="inactive" href="http://wiki.libvirt.org">Wiki</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Frequently asked questions" class="inactive" href="FAQ.html">FAQ</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How and where to report bugs and request features" class="inactive" href="bugs.html">Bug reports</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="How to contact the developers via email and IRC" class="inactive" href="contact.html">Contact</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Miscellaneous links of interest related to libvirt" class="inactive" href="relatedlinks.html">Related Links</a>
|
||||
</div>
|
||||
</li><li>
|
||||
<div>
|
||||
<a title="Overview of all content on the website" class="inactive" href="sitemap.html">Sitemap</a>
|
||||
</div>
|
||||
</li></ul>
|
||||
</div>
|
||||
<div id="content">
|
||||
<h1>Logging in the library and the daemon</h1>
|
||||
<p>Libvirt includes logging facilities starting from version 0.6.0,
|
||||
this complements the <a href="errors.html">error handling</a>
|
||||
mechanism and APIs to allow tracing though the execution of the
|
||||
library as well as in the libvirtd daemon.</p>
|
||||
<p>The logging functionalities in libvirt are based on 3 key concepts,
|
||||
similar to the one present in other generic logging facilities like
|
||||
log4j:</p>
|
||||
<ul><li>log messages: they are information generated at runtime by
|
||||
the libvirt code, it includes a priority level (DEBUG = 1,
|
||||
INFO = 2, WARNING = 3, ERROR = 4), a category, function name and
|
||||
line number, indicating where it originated from, and finally
|
||||
a formatted message, in addition the library adds a timestamp
|
||||
at the begining of the message</li><li>log filters: it's a set of patter and priorities allowing to acept
|
||||
or reject a log message, if the message category matches a filter,
|
||||
the message priority is compared to the filter priority, if lower
|
||||
the message is discarded, if higher the message is output. If
|
||||
no filter matches, then a general priority level is applied to
|
||||
all remaining messages. This allows to capture for example all
|
||||
debug messages for the QEmu driver, but otherwise only allow
|
||||
errors to show up from other parts</li><li>log outputs: once a message has gone though filtering a set of
|
||||
output defines where to send the message, they can also filter
|
||||
based on the priority, for example it may be useful to output
|
||||
all messages to a debugging file but only allow errors to be
|
||||
logged though syslog.</li></ul>
|
||||
<p>The library configuration of logging is though 3 environment variables
|
||||
allowing to control the logging behaviour:</p>
|
||||
<ul><li>LIBVIRT_DEBUG: it can take the four following values:
|
||||
<ul><li>1 or "debug": asking the library to log every message emitted,
|
||||
though the filters can be used to avoid filling up the output</li><li>2 or "info": log all non-debugging informations</li><li>3 or "warn": log warnings and errors, that's the default value</li><li>4 or "error": log only error messages</li></ul></li><li>LIBVIRT_LOG_FILTERS: allow to define logging filters</li><li>LIBVIRT_LOG_OUTPUTS: allow to define logging outputs</li></ul>
|
||||
<p>Similary the daemon logging behaviour can be tuned using 3 config
|
||||
variables, stored in the configuration file:
|
||||
</p>
|
||||
<ul><li>log_level: accepts the following values:
|
||||
<ul><li>0: no logging at all</li><li>4: only errors</li><li>3: warnings and errors</li><li>2: informations, warnings and errors</li><li>1: debug and everything</li></ul></li><li>log_filters: allow to define logging filters</li><li>log_outputs: allow to define logging outputs</li></ul>
|
||||
<p>In both case the syntax for filters and outputs is similar.</p>
|
||||
<p>The format for a filter is:</p>
|
||||
<pre>x:name</pre>
|
||||
<p>where <code>name</code> is a match string e.g. <code>remote</code> or
|
||||
<code>qemu</code> and the x is the minimal level where matching messages
|
||||
should be logged:</p>
|
||||
<ul><li>1: DEBUG</li><li>2: INFO</li><li>3: WARNING</li><li>4: ERROR</li></ul>
|
||||
<p>Multiple filter can be defined in a single string, they just need to be
|
||||
separated by spaces, e.g: <code>"3:remote 4:event"</code> to only get
|
||||
warning or errors from the remote layer and only errors from the event
|
||||
layer.</p>
|
||||
<p>
|
||||
</p>
|
||||
<p>The format for an output can be one of those 3 forms:</p>
|
||||
<ul><li><code>x:stderr</code> output goes to stderr</li><li><code>x:syslog:name</code> use syslog for the output and use the
|
||||
given <code>name</code> as the ident</li><li><code>x:file:file_path</code>output to a file, with the given
|
||||
filepath</li></ul>
|
||||
<p>In all cases the x prefix is the minimal level, acting as a filter:</p>
|
||||
<ul><li>0: everything</li><li>1: DEBUG</li><li>2: INFO</li><li>3: WARNING</li><li>4: ERROR</li></ul>
|
||||
<p>Multiple output can be defined , they just need to be separated by
|
||||
spaces, e.g.: <code>"3:syslog:libvirtd 0:file:/tmp/libvirt.log"</code>
|
||||
will log all warnings and errors to syslog under the libvirtd ident
|
||||
but also log everything debugging and informations included in the
|
||||
file <code>/tmp/libvirt.log</code></p>
|
||||
<p>For example setting up the following:</p>
|
||||
<pre>export LIBVIRT_DEBUG=1
|
||||
export LIBVIRT_LOG_OUTPUTS="0:file:virsh.log"</pre>
|
||||
<p>and then running virsh will accumulate the logs in the
|
||||
<code>virsh.log</code> file in a way similar to:</p>
|
||||
<pre>14:29:04.771: debug : virInitialize:278 : register drivers
|
||||
14:29:04.771: debug : virRegisterDriver:618 : registering Test as driver 0</pre>
|
||||
<p>the messages are timestamped, there is also the level recorded,
|
||||
if debug the name of the function is also printed and then the formatted
|
||||
message. This should be sufficient to at least get a precise idea of
|
||||
what is happening and where things are going wrong, allowing to then
|
||||
put the correct breakpoints when running under a debugger.</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>
|
111
docs/logging.html.in
Normal file
111
docs/logging.html.in
Normal file
@ -0,0 +1,111 @@
|
||||
<?xml version="1.0"?>
|
||||
<html>
|
||||
<body>
|
||||
<h1 >Logging in the library and the daemon</h1>
|
||||
<p>Libvirt includes logging facilities starting from version 0.6.0,
|
||||
this complements the <a href="errors.html">error handling</a>
|
||||
mechanism and APIs to allow tracing though the execution of the
|
||||
library as well as in the libvirtd daemon.</p>
|
||||
<p>The logging functionalities in libvirt are based on 3 key concepts,
|
||||
similar to the one present in other generic logging facilities like
|
||||
log4j:</p>
|
||||
<ul>
|
||||
<li>log messages: they are information generated at runtime by
|
||||
the libvirt code, it includes a priority level (DEBUG = 1,
|
||||
INFO = 2, WARNING = 3, ERROR = 4), a category, function name and
|
||||
line number, indicating where it originated from, and finally
|
||||
a formatted message, in addition the library adds a timestamp
|
||||
at the begining of the message</li>
|
||||
<li>log filters: it's a set of patter and priorities allowing to acept
|
||||
or reject a log message, if the message category matches a filter,
|
||||
the message priority is compared to the filter priority, if lower
|
||||
the message is discarded, if higher the message is output. If
|
||||
no filter matches, then a general priority level is applied to
|
||||
all remaining messages. This allows to capture for example all
|
||||
debug messages for the QEmu driver, but otherwise only allow
|
||||
errors to show up from other parts</li>
|
||||
<li>log outputs: once a message has gone though filtering a set of
|
||||
output defines where to send the message, they can also filter
|
||||
based on the priority, for example it may be useful to output
|
||||
all messages to a debugging file but only allow errors to be
|
||||
logged though syslog.</li>
|
||||
</ul>
|
||||
<p>The library configuration of logging is though 3 environment variables
|
||||
allowing to control the logging behaviour:</p>
|
||||
<ul>
|
||||
<li>LIBVIRT_DEBUG: it can take the four following values:
|
||||
<ul>
|
||||
<li>1 or "debug": asking the library to log every message emitted,
|
||||
though the filters can be used to avoid filling up the output</li>
|
||||
<li>2 or "info": log all non-debugging informations</li>
|
||||
<li>3 or "warn": log warnings and errors, that's the default value</li>
|
||||
<li>4 or "error": log only error messages</li>
|
||||
</ul></li>
|
||||
<li>LIBVIRT_LOG_FILTERS: allow to define logging filters</li>
|
||||
<li>LIBVIRT_LOG_OUTPUTS: allow to define logging outputs</li>
|
||||
</ul>
|
||||
<p>Similary the daemon logging behaviour can be tuned using 3 config
|
||||
variables, stored in the configuration file:
|
||||
<ul>
|
||||
<li>log_level: accepts the following values:
|
||||
<ul>
|
||||
<li>0: no logging at all</li>
|
||||
<li>4: only errors</li>
|
||||
<li>3: warnings and errors</li>
|
||||
<li>2: informations, warnings and errors</li>
|
||||
<li>1: debug and everything</li>
|
||||
</ul></li>
|
||||
<li>log_filters: allow to define logging filters</li>
|
||||
<li>log_outputs: allow to define logging outputs</li>
|
||||
</ul>
|
||||
<p>In both case the syntax for filters and outputs is similar.</p>
|
||||
<p>The format for a filter is:</p>
|
||||
<pre>x:name</pre>
|
||||
<p>where <code>name</code> is a match string e.g. <code>remote</code> or
|
||||
<code>qemu</code> and the x is the minimal level where matching messages
|
||||
should be logged:</p>
|
||||
<ul>
|
||||
<li>1: DEBUG</li>
|
||||
<li>2: INFO</li>
|
||||
<li>3: WARNING</li>
|
||||
<li>4: ERROR</li>
|
||||
</ul>
|
||||
<p>Multiple filter can be defined in a single string, they just need to be
|
||||
separated by spaces, e.g: <code>"3:remote 4:event"</code> to only get
|
||||
warning or errors from the remote layer and only errors from the event
|
||||
layer.<p>
|
||||
<p>The format for an output can be one of those 3 forms:</p>
|
||||
<ul>
|
||||
<li><code>x:stderr</code> output goes to stderr</li>
|
||||
<li><code>x:syslog:name</code> use syslog for the output and use the
|
||||
given <code>name</code> as the ident</li>
|
||||
<li><code>x:file:file_path</code>output to a file, with the given
|
||||
filepath</li>
|
||||
</ul>
|
||||
<p>In all cases the x prefix is the minimal level, acting as a filter:</p>
|
||||
<ul>
|
||||
<li>0: everything</li>
|
||||
<li>1: DEBUG</li>
|
||||
<li>2: INFO</li>
|
||||
<li>3: WARNING</li>
|
||||
<li>4: ERROR</li>
|
||||
</ul>
|
||||
<p>Multiple output can be defined , they just need to be separated by
|
||||
spaces, e.g.: <code>"3:syslog:libvirtd 0:file:/tmp/libvirt.log"</code>
|
||||
will log all warnings and errors to syslog under the libvirtd ident
|
||||
but also log everything debugging and informations included in the
|
||||
file <code>/tmp/libvirt.log</code></p>
|
||||
<p>For example setting up the following:</p>
|
||||
<pre>export LIBVIRT_DEBUG=1
|
||||
export LIBVIRT_LOG_OUTPUTS="0:file:virsh.log"</pre>
|
||||
<p>and then running virsh will accumulate the logs in the
|
||||
<code>virsh.log</code> file in a way similar to:</p>
|
||||
<pre>14:29:04.771: debug : virInitialize:278 : register drivers
|
||||
14:29:04.771: debug : virRegisterDriver:618 : registering Test as driver 0</pre>
|
||||
<p>the messages are timestamped, there is also the level recorded,
|
||||
if debug the name of the function is also printed and then the formatted
|
||||
message. This should be sufficient to at least get a precise idea of
|
||||
what is happening and where things are going wrong, allowing to then
|
||||
put the correct breakpoints when running under a debugger.</p>
|
||||
</body>
|
||||
</html>
|
@ -76,6 +76,76 @@
|
||||
<p>Here is the list of official releases, however since it is early on in the
|
||||
development of libvirt, it is preferable when possible to just use the <a href="downloads.html">CVS version or snapshot</a>, contact the mailing list
|
||||
and check the <a href="ChangeLog.html">ChangeLog</a> to gauge progress.</p>
|
||||
<h3>0.6.0: Jan 31 2009</h3>
|
||||
<ul><li>New features: thread safety of the API and event handling (Daniel
|
||||
Berrange), allow QEmu domains to survive daemon restart (Guido
|
||||
G<>nther), extended logging capabilities, support copy-on-write
|
||||
storage volumes (Daniel Berrange), support of storage cache
|
||||
control options for QEmu/KVM (Daniel Berrange)</li><li>Portability: fix old DBus API problem, Debian portability fix
|
||||
(Daniel Berrange), fix distcheck (Jim Meyering), build in
|
||||
debug mode (Jim Meyering), libnuma API portability (Jim Meyering),
|
||||
many portability fixes pointed by Solaris (John Levon), non-gcc
|
||||
portability fixes (John Levon), various include fixes (Jim Meyering),
|
||||
various Windows and Mingw portability fixes (Daniel Berrange),
|
||||
solaris Xen fixes (John Levon), RPC portability to Solaris (Daniel
|
||||
Berrange)</li><li>Documentation: typo fixes (Richard Jones), logging support,
|
||||
vnc keymap attributes (Guido G<>nther), HACKING file updates
|
||||
(Jim Meyering), new PCI passthrough format, libvirt-qpid and
|
||||
UML driver documentation (Daniel Berrange), provide RNG schemas
|
||||
for all XML formats used in libvirt APIs (Daniel Berrange), </li><li>Bug fixes: segfault on virtual network without bridge name (Cole
|
||||
Robinson), various locking fixes (Cole Robinson), fix serial
|
||||
and parallel devices on tcp/unix/telnet (Guido G<>nther), leak
|
||||
in daemon (Jim Meyering), storage driver segfault (Miloslav TrmaC),
|
||||
missing check in read-only connections (Daniel Berrange),
|
||||
OpenVZ crash and mutex fixes (Anton Protopopov), couple of
|
||||
daemon bug fixes (John Levon), OpenVZ MAC addresses generation
|
||||
(Evgeniy Sokolov), poll call initialization fix (Daniel Berrange),
|
||||
various Xen driver fixes (John Levon), segfault on device
|
||||
back compat (Cole Robinson), couple Xen bug fixes coming from
|
||||
RHEL (Markus Armbruster), buffer overflow in libvirt proxy
|
||||
(rasputin@email.ru), vnc port report (John Levon), repair save
|
||||
and restore on recent KVM versions (Daniel Berrange), Xen
|
||||
cpu pinning XML fix (John Levon), various xen driver fixes
|
||||
(Daniel Berrange), some memory leak fixes (Daniel Berrange)</li><li>Improvements: driver infrastructure and locking (Daniel Berrange),
|
||||
Test driver infrastructure (Daniel Berrange), parallelism in the
|
||||
daemon and associated config (Daniel Berrange), virsh help cleanups
|
||||
(Jim Meyering), logrotate daemon logs (Guido G<>nther), more
|
||||
regression tests (Jim Meyering), QEmu SDL graphics (Itamar Heim),
|
||||
add --version flag to daemon (Dave Allan), memory consumption
|
||||
cleanup (Dave Allan), QEmu pid file and XML states for daemon
|
||||
restart (Guido G<>nther), gnulib updates (Jim Meyering and
|
||||
Dan Berrange), PCI passthrough for KVM (Jason Krieg), generic
|
||||
internal thread API (Daniel Berrange), RHEL-5 specific Xen
|
||||
configure option and code (Markus Armbruster), save domain
|
||||
state as string in status file (Guido G<>nther), add locking
|
||||
to all API entry points (Daniel Berrange), new ref counting APIs
|
||||
(Daniel Berrange), IP address for Xen bridges (John Levon),
|
||||
driver format for disk file types (Daniel Berrange), improve
|
||||
QEmu/KVM tun/tap performances (Mark McLoughlin), enable floppies
|
||||
for Xen fully virt (John Levon), support VNC password settings
|
||||
for QEmu/KVM (Daniel Berrange), qemu driver version reporting
|
||||
(Daniel Berrange) </li><li>Cleanups: converting linked lists to arrays (Daniel Berrange),
|
||||
daemon RPC handling refactoring (Daniel Berrange), strings cleanups
|
||||
(Jim Meyering), gethostby* cleanup and test (Jim Meyering), some
|
||||
code fixes (Dave Allan), various code cleanup (Jim Meyering),
|
||||
virsh argument handling cleanup (Jim Meyering), virAsprintf
|
||||
cleanup replacement (Guido G<>nther), QEmu monitor reads (Cole
|
||||
Robinson), Makefile cleanups (Guido G<>nther), Xen code cleanups
|
||||
(John Levon), revamp of ELF export scripts (John Levon), domain
|
||||
event callback args (John Levon), enforce use of pid_t (John Levon),
|
||||
virsh pool-*-as XML code merge (Cole Robinson), xgettext warnings
|
||||
(Jim Meyering), add virKillProcess (Guido G<>nther), add
|
||||
virGetHostname (David Lutterkort), add flags argument to the full
|
||||
XML parsing stack (Guido G<>nther), various daemon code cleanups
|
||||
(Guido G<>nther), handling of daemon missing config file (Jim
|
||||
Meyering), rpcgen invocation cleanup (Richard Jones), devhelp
|
||||
builkd makefile cleanups (John Levon), update error handling for
|
||||
threading (Daniel Berrange), remove all non-rentrant POSIX calls
|
||||
usage (Daniel Berrange), many small cleanups (Jim Meyering and
|
||||
Daniel Berrange), examples Makefile generator (John Levon),
|
||||
mis-use of PF_UNIX as a protocol (John Levon), cleanup OOM
|
||||
error paths (Jim Meyering), temporary fix fro valgrind on lxc
|
||||
(Daniel Berrange), QEmu driver init cleanups (Daniel Berrange)</li></ul>
|
||||
<h3>0.5.1: Dec 4 2008</h3>
|
||||
<ul><li>Portability: fix missing dep in spec file, fix compilation with new
|
||||
NUMA libraries (Daniel Berrange), udev compatibility for RHEL (Chris
|
||||
|
@ -5,6 +5,83 @@
|
||||
<p>Here is the list of official releases, however since it is early on in the
|
||||
development of libvirt, it is preferable when possible to just use the <a href="downloads.html">CVS version or snapshot</a>, contact the mailing list
|
||||
and check the <a href="ChangeLog.html">ChangeLog</a> to gauge progress.</p>
|
||||
<h3>0.6.0: Jan 31 2009</h3>
|
||||
<ul>
|
||||
<li>New features: thread safety of the API and event handling (Daniel
|
||||
Berrange), allow QEmu domains to survive daemon restart (Guido
|
||||
Günther), extended logging capabilities, support copy-on-write
|
||||
storage volumes (Daniel Berrange), support of storage cache
|
||||
control options for QEmu/KVM (Daniel Berrange)</li>
|
||||
<li>Portability: fix old DBus API problem, Debian portability fix
|
||||
(Daniel Berrange), fix distcheck (Jim Meyering), build in
|
||||
debug mode (Jim Meyering), libnuma API portability (Jim Meyering),
|
||||
many portability fixes pointed by Solaris (John Levon), non-gcc
|
||||
portability fixes (John Levon), various include fixes (Jim Meyering),
|
||||
various Windows and Mingw portability fixes (Daniel Berrange),
|
||||
solaris Xen fixes (John Levon), RPC portability to Solaris (Daniel
|
||||
Berrange)</li>
|
||||
<li>Documentation: typo fixes (Richard Jones), logging support,
|
||||
vnc keymap attributes (Guido Günther), HACKING file updates
|
||||
(Jim Meyering), new PCI passthrough format, libvirt-qpid and
|
||||
UML driver documentation (Daniel Berrange), provide RNG schemas
|
||||
for all XML formats used in libvirt APIs (Daniel Berrange), </li>
|
||||
<li>Bug fixes: segfault on virtual network without bridge name (Cole
|
||||
Robinson), various locking fixes (Cole Robinson), fix serial
|
||||
and parallel devices on tcp/unix/telnet (Guido Günther), leak
|
||||
in daemon (Jim Meyering), storage driver segfault (Miloslav TrmaC),
|
||||
missing check in read-only connections (Daniel Berrange),
|
||||
OpenVZ crash and mutex fixes (Anton Protopopov), couple of
|
||||
daemon bug fixes (John Levon), OpenVZ MAC addresses generation
|
||||
(Evgeniy Sokolov), poll call initialization fix (Daniel Berrange),
|
||||
various Xen driver fixes (John Levon), segfault on device
|
||||
back compat (Cole Robinson), couple Xen bug fixes coming from
|
||||
RHEL (Markus Armbruster), buffer overflow in libvirt proxy
|
||||
(rasputin@email.ru), vnc port report (John Levon), repair save
|
||||
and restore on recent KVM versions (Daniel Berrange), Xen
|
||||
cpu pinning XML fix (John Levon), various xen driver fixes
|
||||
(Daniel Berrange), some memory leak fixes (Daniel Berrange)</li>
|
||||
<li>Improvements: driver infrastructure and locking (Daniel Berrange),
|
||||
Test driver infrastructure (Daniel Berrange), parallelism in the
|
||||
daemon and associated config (Daniel Berrange), virsh help cleanups
|
||||
(Jim Meyering), logrotate daemon logs (Guido Günther), more
|
||||
regression tests (Jim Meyering), QEmu SDL graphics (Itamar Heim),
|
||||
add --version flag to daemon (Dave Allan), memory consumption
|
||||
cleanup (Dave Allan), QEmu pid file and XML states for daemon
|
||||
restart (Guido Günther), gnulib updates (Jim Meyering and
|
||||
Dan Berrange), PCI passthrough for KVM (Jason Krieg), generic
|
||||
internal thread API (Daniel Berrange), RHEL-5 specific Xen
|
||||
configure option and code (Markus Armbruster), save domain
|
||||
state as string in status file (Guido Günther), add locking
|
||||
to all API entry points (Daniel Berrange), new ref counting APIs
|
||||
(Daniel Berrange), IP address for Xen bridges (John Levon),
|
||||
driver format for disk file types (Daniel Berrange), improve
|
||||
QEmu/KVM tun/tap performances (Mark McLoughlin), enable floppies
|
||||
for Xen fully virt (John Levon), support VNC password settings
|
||||
for QEmu/KVM (Daniel Berrange), qemu driver version reporting
|
||||
(Daniel Berrange) </li>
|
||||
<li>Cleanups: converting linked lists to arrays (Daniel Berrange),
|
||||
daemon RPC handling refactoring (Daniel Berrange), strings cleanups
|
||||
(Jim Meyering), gethostby* cleanup and test (Jim Meyering), some
|
||||
code fixes (Dave Allan), various code cleanup (Jim Meyering),
|
||||
virsh argument handling cleanup (Jim Meyering), virAsprintf
|
||||
cleanup replacement (Guido Günther), QEmu monitor reads (Cole
|
||||
Robinson), Makefile cleanups (Guido Günther), Xen code cleanups
|
||||
(John Levon), revamp of ELF export scripts (John Levon), domain
|
||||
event callback args (John Levon), enforce use of pid_t (John Levon),
|
||||
virsh pool-*-as XML code merge (Cole Robinson), xgettext warnings
|
||||
(Jim Meyering), add virKillProcess (Guido Günther), add
|
||||
virGetHostname (David Lutterkort), add flags argument to the full
|
||||
XML parsing stack (Guido Günther), various daemon code cleanups
|
||||
(Guido Günther), handling of daemon missing config file (Jim
|
||||
Meyering), rpcgen invocation cleanup (Richard Jones), devhelp
|
||||
builkd makefile cleanups (John Levon), update error handling for
|
||||
threading (Daniel Berrange), remove all non-rentrant POSIX calls
|
||||
usage (Daniel Berrange), many small cleanups (Jim Meyering and
|
||||
Daniel Berrange), examples Makefile generator (John Levon),
|
||||
mis-use of PF_UNIX as a protocol (John Levon), cleanup OOM
|
||||
error paths (Jim Meyering), temporary fix fro valgrind on lxc
|
||||
(Daniel Berrange), QEmu driver init cleanups (Daniel Berrange)</li>
|
||||
</ul>
|
||||
<h3>0.5.1: Dec 4 2008</h3>
|
||||
<ul>
|
||||
<li>Portability: fix missing dep in spec file, fix compilation with new
|
||||
|
@ -84,7 +84,7 @@
|
||||
<ul><li>
|
||||
The <a href="http://www.cl.cam.ac.uk/Research/SRG/netos/xen/index.html">Xen</a> hypervisor
|
||||
</li><li>
|
||||
The <a href="http://fabrice.bellard.free.fr/qemu/">QEMU</a> emulator
|
||||
The <a href="http://bellard.org/qemu/">QEMU</a> emulator
|
||||
</li><li>
|
||||
The <a href="http://kvm.qumranet.com/kvmwiki">KVM</a> Linux hypervisor
|
||||
</li><li>
|
||||
|
@ -25,7 +25,7 @@
|
||||
The <a href="http://www.cl.cam.ac.uk/Research/SRG/netos/xen/index.html">Xen</a> hypervisor
|
||||
</li>
|
||||
<li>
|
||||
The <a href="http://fabrice.bellard.free.fr/qemu/">QEMU</a> emulator
|
||||
The <a href="http://bellard.org/qemu/">QEMU</a> emulator
|
||||
</li>
|
||||
<li>
|
||||
The <a href="http://kvm.qumranet.com/kvmwiki">KVM</a> Linux hypervisor
|
||||
|
@ -58,6 +58,10 @@
|
||||
<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>
|
||||
|
2
docs/schemas/.cvsignore
Normal file
2
docs/schemas/.cvsignore
Normal file
@ -0,0 +1,2 @@
|
||||
Makefile
|
||||
Makefile.in
|
12
docs/schemas/Makefile.am
Normal file
12
docs/schemas/Makefile.am
Normal file
@ -0,0 +1,12 @@
|
||||
|
||||
|
||||
schemadir = $(pkgdatadir)/schemas
|
||||
schema_DATA = \
|
||||
domain.rng \
|
||||
network.rng \
|
||||
storagepool.rng \
|
||||
storagevol.rng \
|
||||
nodedev.rng \
|
||||
capability.rng
|
||||
|
||||
EXTRA_DIST = $(schema_DATA)
|
287
docs/schemas/capability.rng
Normal file
287
docs/schemas/capability.rng
Normal file
@ -0,0 +1,287 @@
|
||||
<!-- A Relax NG schema for the libvirt node device XML format -->
|
||||
<grammar xmlns="http://relaxng.org/ns/structure/1.0"
|
||||
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
||||
<!-- We handle only document defining a domain -->
|
||||
<start>
|
||||
<ref name='capabilities'/>
|
||||
</start>
|
||||
|
||||
|
||||
<define name='capabilities'>
|
||||
<element name='capabilities'>
|
||||
<ref name='hostcaps'/>
|
||||
|
||||
<zeroOrMore>
|
||||
<ref name='guestcaps'/>
|
||||
</zeroOrMore>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='hostcaps'>
|
||||
<element name='host'>
|
||||
<element name='cpu'>
|
||||
<element name='arch'>
|
||||
<ref name='archnames'/>
|
||||
</element>
|
||||
<optional>
|
||||
<ref name='cpufeatures'/>
|
||||
</optional>
|
||||
</element>
|
||||
<optional>
|
||||
<ref name='migration'/>
|
||||
</optional>
|
||||
<optional>
|
||||
<ref name='topology'/>
|
||||
</optional>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='cpufeatures'>
|
||||
<element name='features'>
|
||||
<optional>
|
||||
<element name='pae'><empty/></element>
|
||||
</optional>
|
||||
<optional>
|
||||
<element name='nonpae'><empty/></element>
|
||||
</optional>
|
||||
<optional>
|
||||
<element name='vmx'><empty/></element>
|
||||
</optional>
|
||||
<optional>
|
||||
<element name='svm'><empty/></element>
|
||||
</optional>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='migration'>
|
||||
<element name='migration_features'>
|
||||
<optional>
|
||||
<element name='live'>
|
||||
<empty/>
|
||||
</element>
|
||||
</optional>
|
||||
<optional>
|
||||
<element name='uri_transports'>
|
||||
<oneOrMore>
|
||||
<element name='uri_transport'>
|
||||
<choice>
|
||||
<value>xenmigr</value>
|
||||
</choice>
|
||||
</element>
|
||||
</oneOrMore>
|
||||
</element>
|
||||
</optional>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='topology'>
|
||||
<element name='topology'>
|
||||
<element name='cells'>
|
||||
<attribute name='num'>
|
||||
<ref name='uint'/>
|
||||
</attribute>
|
||||
<oneOrMore>
|
||||
<ref name='cell'/>
|
||||
</oneOrMore>
|
||||
</element>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='cell'>
|
||||
<element name='cell'>
|
||||
<attribute name='id'>
|
||||
<ref name='uint'/>
|
||||
</attribute>
|
||||
|
||||
<optional>
|
||||
<element name='cpus'>
|
||||
<attribute name='num'>
|
||||
<ref name='uint'/>
|
||||
</attribute>
|
||||
<oneOrMore>
|
||||
<ref name='cpu'/>
|
||||
</oneOrMore>
|
||||
</element>
|
||||
</optional>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='cpu'>
|
||||
<element name='cpu'>
|
||||
<attribute name='id'>
|
||||
<ref name='uint'/>
|
||||
</attribute>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='guestcaps'>
|
||||
<element name='guest'>
|
||||
<ref name='ostype'/>
|
||||
<ref name='arch'/>
|
||||
<optional>
|
||||
<ref name='features'/>
|
||||
</optional>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='ostype'>
|
||||
<element name='os_type'>
|
||||
<choice>
|
||||
<value>xen</value> <!-- Xen 3.0 pv -->
|
||||
<value>linux</value> <!-- same as 'xen' - legacy -->
|
||||
<value>hvm</value> <!-- unmodified OS -->
|
||||
<value>exe</value> <!-- For container based virt -->
|
||||
<value>uml</value> <!-- user mode linux -->
|
||||
</choice>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='arch'>
|
||||
<element name='arch'>
|
||||
<attribute name='name'>
|
||||
<ref name='archnames'/>
|
||||
</attribute>
|
||||
<ref name='wordsize'/>
|
||||
<optional>
|
||||
<ref name='emulator'/>
|
||||
</optional>
|
||||
<optional>
|
||||
<ref name='loader'/>
|
||||
</optional>
|
||||
<zeroOrMore>
|
||||
<ref name='machine'/>
|
||||
</zeroOrMore>
|
||||
<oneOrMore>
|
||||
<ref name='domain'/>
|
||||
</oneOrMore>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='emulator'>
|
||||
<element name='emulator'>
|
||||
<ref name='path'/>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='loader'>
|
||||
<element name='loader'>
|
||||
<ref name='path'/>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='wordsize'>
|
||||
<element name='wordsize'>
|
||||
<choice>
|
||||
<value>31</value>
|
||||
<value>32</value>
|
||||
<value>64</value>
|
||||
</choice>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='machine'>
|
||||
<element name='machine'>
|
||||
<text/>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='domain'>
|
||||
<element name='domain'>
|
||||
<attribute name='type'>
|
||||
<choice>
|
||||
<value>qemu</value>
|
||||
<value>kqemu</value>
|
||||
<value>kvm</value>
|
||||
<value>xen</value>
|
||||
<value>uml</value>
|
||||
<value>lxc</value>
|
||||
<value>openvz</value>
|
||||
<value>test</value>
|
||||
</choice>
|
||||
</attribute>
|
||||
|
||||
<optional>
|
||||
<ref name='emulator'/>
|
||||
</optional>
|
||||
<optional>
|
||||
<ref name='machine'/>
|
||||
</optional>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='features'>
|
||||
<element name='features'>
|
||||
<optional>
|
||||
<element name='pae'>
|
||||
<empty/>
|
||||
</element>
|
||||
</optional>
|
||||
<optional>
|
||||
<element name='nonpae'>
|
||||
<empty/>
|
||||
</element>
|
||||
</optional>
|
||||
<optional>
|
||||
<element name='ia64_be'>
|
||||
<empty/>
|
||||
</element>
|
||||
</optional>
|
||||
<optional>
|
||||
<element name='acpi'>
|
||||
<ref name='featuretoggle'/>
|
||||
<empty/>
|
||||
</element>
|
||||
</optional>
|
||||
<optional>
|
||||
<element name='apic'>
|
||||
<ref name='featuretoggle'/>
|
||||
<empty/>
|
||||
</element>
|
||||
</optional>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='featuretoggle'>
|
||||
<attribute name='toggle'>
|
||||
<choice>
|
||||
<value>yes</value>
|
||||
<value>no</value>
|
||||
</choice>
|
||||
</attribute>
|
||||
<attribute name='default'>
|
||||
<choice>
|
||||
<value>on</value>
|
||||
<value>off</value>
|
||||
</choice>
|
||||
</attribute>
|
||||
</define>
|
||||
|
||||
<define name='archnames'>
|
||||
<choice>
|
||||
<value>i686</value>
|
||||
<value>x86_64</value>
|
||||
<value>ppc</value>
|
||||
<value>ppc64</value>
|
||||
<value>ia64</value>
|
||||
<value>s390</value>
|
||||
<value>mips</value>
|
||||
<value>mipsel</value>
|
||||
<value>sparc</value>
|
||||
</choice>
|
||||
</define>
|
||||
|
||||
|
||||
<define name='uint'>
|
||||
<data type='string'>
|
||||
<param name="pattern">[0-9]+</param>
|
||||
</data>
|
||||
</define>
|
||||
|
||||
<define name='path'>
|
||||
<data type='string'>
|
||||
<param name="pattern">/[a-zA-Z0-9_\+\-/%]+</param>
|
||||
</data>
|
||||
</define>
|
||||
|
||||
</grammar>
|
||||
|
@ -426,6 +426,25 @@
|
||||
-->
|
||||
<define name='driver'>
|
||||
<element name='driver'>
|
||||
<choice>
|
||||
<group>
|
||||
<ref name='driverFormat'/>
|
||||
<optional>
|
||||
<ref name='driverCache'/>
|
||||
</optional>
|
||||
</group>
|
||||
<group>
|
||||
<optional>
|
||||
<ref name='driverFormat'/>
|
||||
</optional>
|
||||
<ref name='driverCache'/>
|
||||
</group>
|
||||
</choice>
|
||||
<empty/>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='driverFormat'>
|
||||
<attribute name='name'>
|
||||
<ref name='genericName'/>
|
||||
</attribute>
|
||||
@ -434,8 +453,16 @@
|
||||
<ref name='genericName'/>
|
||||
</attribute>
|
||||
</optional>
|
||||
<empty/>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='driverCache'>
|
||||
<attribute name='cache'>
|
||||
<choice>
|
||||
<value>none</value>
|
||||
<value>writeback</value>
|
||||
<value>writethrough</value>
|
||||
</choice>
|
||||
</attribute>
|
||||
</define>
|
||||
|
||||
<define name='filesystem'>
|
||||
@ -638,7 +665,7 @@
|
||||
|
||||
<!--
|
||||
A graphic description, currently in Xen only 2 types are supported:
|
||||
- sdl without arguments
|
||||
- sdl with optional display, xauth and fullscreen
|
||||
- vnc with a required port and optional listen IP address, password
|
||||
and keymap
|
||||
-->
|
||||
@ -659,6 +686,14 @@
|
||||
<text/>
|
||||
</attribute>
|
||||
</optional>
|
||||
<optional>
|
||||
<attribute name='fullscreen'>
|
||||
<choice>
|
||||
<value>yes</value>
|
||||
<value>no</value>
|
||||
</choice>
|
||||
</attribute>
|
||||
</optional>
|
||||
</group>
|
||||
<group>
|
||||
<attribute name='type'>
|
||||
@ -882,6 +917,7 @@
|
||||
<choice>
|
||||
<ref name="usbproduct"/>
|
||||
<ref name="usbaddress"/>
|
||||
<ref name="pciaddress"/>
|
||||
</choice>
|
||||
</element>
|
||||
</group>
|
||||
@ -912,6 +948,24 @@
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name="pciaddress">
|
||||
<element name="address">
|
||||
<optional>
|
||||
<attribute name="domain">
|
||||
<ref name="pciDomain"/>
|
||||
</attribute>
|
||||
</optional>
|
||||
<attribute name="bus">
|
||||
<ref name="pciBus"/>
|
||||
</attribute>
|
||||
<attribute name="slot">
|
||||
<ref name="pciSlot"/>
|
||||
</attribute>
|
||||
<attribute name="function">
|
||||
<ref name="pciFunc"/>
|
||||
</attribute>
|
||||
</element>
|
||||
</define>
|
||||
<!--
|
||||
Devices attached to a domain.
|
||||
-->
|
||||
@ -1061,4 +1115,24 @@
|
||||
<param name="pattern">(0x)?[0-9a-fA-F]{1,3}</param>
|
||||
</data>
|
||||
</define>
|
||||
<define name='pciDomain'>
|
||||
<data type='string'>
|
||||
<param name="pattern">(0x)?[0-9a-fA-F]{1,4}</param>
|
||||
</data>
|
||||
</define>
|
||||
<define name='pciBus'>
|
||||
<data type='string'>
|
||||
<param name="pattern">(0x)?[0-9a-fA-F]{1,2}</param>
|
||||
</data>
|
||||
</define>
|
||||
<define name='pciSlot'>
|
||||
<data type='string'>
|
||||
<param name="pattern">(0x)?[0-1]?[0-9a-fA-F]</param>
|
||||
</data>
|
||||
</define>
|
||||
<define name='pciFunc'>
|
||||
<data type='string'>
|
||||
<param name="pattern">(0x)?[0-7]</param>
|
||||
</data>
|
||||
</define>
|
||||
</grammar>
|
@ -27,6 +27,21 @@
|
||||
</optional>
|
||||
</element>
|
||||
</optional>
|
||||
<optional>
|
||||
<!-- The device through which the bridge is connected to the
|
||||
rest of the network -->
|
||||
<element name="forward">
|
||||
<optional><attribute name="dev"><text/></attribute></optional>
|
||||
<optional>
|
||||
<attribute name="mode">
|
||||
<choice>
|
||||
<value>nat</value>
|
||||
<value>routed</value>
|
||||
</choice>
|
||||
</attribute>
|
||||
</optional>
|
||||
</element>
|
||||
</optional>
|
||||
<optional>
|
||||
<!-- The IP element sets up NAT'ing and an optional DHCP server
|
||||
local to the host. -->
|
||||
@ -51,19 +66,4 @@
|
||||
</element>
|
||||
</element>
|
||||
</optional>
|
||||
<optional>
|
||||
<!-- The device through which the bridge is connected to the
|
||||
rest of the network -->
|
||||
<element name="forward">
|
||||
<optional><attribute name="dev"><text/></attribute></optional>
|
||||
<optional>
|
||||
<attribute name="mode">
|
||||
<choice>
|
||||
<value>nat</value>
|
||||
<value>routed</value>
|
||||
</choice>
|
||||
</attribute>
|
||||
</optional>
|
||||
</element>
|
||||
</optional>
|
||||
</element>
|
360
docs/schemas/nodedev.rng
Normal file
360
docs/schemas/nodedev.rng
Normal file
@ -0,0 +1,360 @@
|
||||
<!-- A Relax NG schema for the libvirt node device XML format -->
|
||||
<grammar xmlns="http://relaxng.org/ns/structure/1.0"
|
||||
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
||||
<!-- We handle only document defining a domain -->
|
||||
<start>
|
||||
<ref name='device'/>
|
||||
</start>
|
||||
|
||||
<!--
|
||||
We handle only document defining a domain
|
||||
-->
|
||||
<define name='device'>
|
||||
<element name="device">
|
||||
<!-- The name of the network, used to refer to it through the API
|
||||
and in virsh -->
|
||||
<element name="name"><text/></element>
|
||||
<optional>
|
||||
<element name="parent"><text/></element>
|
||||
</optional>
|
||||
|
||||
<zeroOrMore>
|
||||
<ref name="capability"/>
|
||||
</zeroOrMore>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='capability'>
|
||||
<element name="capability">
|
||||
<choice>
|
||||
<ref name="capsystem"/>
|
||||
<ref name="cappcidev"/>
|
||||
<ref name="capusbdev"/>
|
||||
<ref name="capusbinterface"/>
|
||||
<ref name="capnet"/>
|
||||
<ref name="capscsihost"/>
|
||||
<ref name="capscsi"/>
|
||||
<ref name="capstorage"/>
|
||||
</choice>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='capsystem'>
|
||||
<attribute name='type'>
|
||||
<value>system</value>
|
||||
</attribute>
|
||||
|
||||
<optional>
|
||||
<element name='product'><text/></element>
|
||||
</optional>
|
||||
|
||||
<element name='hardware'>
|
||||
<optional>
|
||||
<element name='vendor'><text/></element>
|
||||
</optional>
|
||||
<optional>
|
||||
<element name='version'><text/></element>
|
||||
</optional>
|
||||
<optional>
|
||||
<element name='serial'><text/></element>
|
||||
</optional>
|
||||
|
||||
<element name='uuid'>
|
||||
<ref name='uuid'/>
|
||||
</element>
|
||||
</element>
|
||||
|
||||
|
||||
<element name='firmware'>
|
||||
<optional>
|
||||
<element name='vendor'><text/></element>
|
||||
</optional>
|
||||
<optional>
|
||||
<element name='version'><text/></element>
|
||||
</optional>
|
||||
<optional>
|
||||
<element name='release_date'><text/></element>
|
||||
</optional>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='cappcidev'>
|
||||
<attribute name='type'>
|
||||
<value>pci</value>
|
||||
</attribute>
|
||||
|
||||
<element name='domain'>
|
||||
<ref name='uint'/>
|
||||
</element>
|
||||
<element name='bus'>
|
||||
<ref name='uint'/>
|
||||
</element>
|
||||
<element name='slot'>
|
||||
<ref name='uint'/>
|
||||
</element>
|
||||
<element name='function'>
|
||||
<ref name='uint'/>
|
||||
</element>
|
||||
|
||||
<element name='product'>
|
||||
<attribute name='id'>
|
||||
<ref name='hexuint'/>
|
||||
</attribute>
|
||||
|
||||
<choice>
|
||||
<text/>
|
||||
<empty/>
|
||||
</choice>
|
||||
</element>
|
||||
|
||||
<element name='vendor'>
|
||||
<attribute name='id'>
|
||||
<ref name='hexuint'/>
|
||||
</attribute>
|
||||
|
||||
<choice>
|
||||
<text/>
|
||||
<empty/>
|
||||
</choice>
|
||||
</element>
|
||||
|
||||
</define>
|
||||
|
||||
<define name='capusbdev'>
|
||||
<attribute name='type'>
|
||||
<value>usb_device</value>
|
||||
</attribute>
|
||||
|
||||
<element name='bus'>
|
||||
<ref name='uint'/>
|
||||
</element>
|
||||
<element name='device'>
|
||||
<ref name='uint'/>
|
||||
</element>
|
||||
|
||||
<element name='product'>
|
||||
<attribute name='id'>
|
||||
<ref name='hexuint'/>
|
||||
</attribute>
|
||||
|
||||
<choice>
|
||||
<text/>
|
||||
<empty/>
|
||||
</choice>
|
||||
</element>
|
||||
|
||||
<element name='vendor'>
|
||||
<attribute name='id'>
|
||||
<ref name='hexuint'/>
|
||||
</attribute>
|
||||
|
||||
<choice>
|
||||
<text/>
|
||||
<empty/>
|
||||
</choice>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='capusbinterface'>
|
||||
<attribute name='type'>
|
||||
<value>usb</value>
|
||||
</attribute>
|
||||
|
||||
<element name='number'>
|
||||
<ref name='uint'/>
|
||||
</element>
|
||||
<element name='class'>
|
||||
<ref name='uint'/>
|
||||
</element>
|
||||
<element name='subclass'>
|
||||
<ref name='uint'/>
|
||||
</element>
|
||||
<element name='protocol'>
|
||||
<ref name='uint'/>
|
||||
</element>
|
||||
|
||||
<optional>
|
||||
<element name='description'>
|
||||
<text/>
|
||||
</element>
|
||||
</optional>
|
||||
</define>
|
||||
|
||||
<define name='capnet'>
|
||||
<attribute name='type'>
|
||||
<value>net</value>
|
||||
</attribute>
|
||||
|
||||
<element name='interface'>
|
||||
<text/>
|
||||
</element>
|
||||
<optional>
|
||||
<element name='address'>
|
||||
<ref name='mac'/>
|
||||
</element>
|
||||
</optional>
|
||||
|
||||
<zeroOrMore>
|
||||
<ref name='subcapnet'/>
|
||||
</zeroOrMore>
|
||||
</define>
|
||||
|
||||
<define name='subcapnet'>
|
||||
<element name='capability'>
|
||||
<choice>
|
||||
<ref name='subcapnet80203'/>
|
||||
<ref name='subcapnet80211'/>
|
||||
</choice>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='subcapnet80203'>
|
||||
<attribute name='type'>
|
||||
<value>80203</value>
|
||||
</attribute>
|
||||
</define>
|
||||
|
||||
<define name='subcapnet80211'>
|
||||
<attribute name='type'>
|
||||
<value>80211</value>
|
||||
</attribute>
|
||||
</define>
|
||||
|
||||
|
||||
<define name='capscsihost'>
|
||||
<attribute name='type'>
|
||||
<value>scsi_host</value>
|
||||
</attribute>
|
||||
|
||||
<element name='host'>
|
||||
<ref name='uint'/>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='capscsi'>
|
||||
<attribute name='type'>
|
||||
<value>scsi</value>
|
||||
</attribute>
|
||||
|
||||
<element name='host'>
|
||||
<ref name='uint'/>
|
||||
</element>
|
||||
<element name='bus'>
|
||||
<ref name='uint'/>
|
||||
</element>
|
||||
<element name='target'>
|
||||
<ref name='uint'/>
|
||||
</element>
|
||||
<element name='lun'>
|
||||
<ref name='uint'/>
|
||||
</element>
|
||||
|
||||
<element name='type'>
|
||||
<text/>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='capstorage'>
|
||||
<attribute name='type'>
|
||||
<value>storage</value>
|
||||
</attribute>
|
||||
|
||||
<element name='block'>
|
||||
<ref name='path'/>
|
||||
</element>
|
||||
|
||||
<optional>
|
||||
<element name='bus'>
|
||||
<text/>
|
||||
</element>
|
||||
</optional>
|
||||
<optional>
|
||||
<element name='drive_type'>
|
||||
<text/>
|
||||
</element>
|
||||
</optional>
|
||||
<optional>
|
||||
<element name='model'>
|
||||
<text/>
|
||||
</element>
|
||||
</optional>
|
||||
<optional>
|
||||
<element name='vendor'>
|
||||
<text/>
|
||||
</element>
|
||||
</optional>
|
||||
|
||||
<choice>
|
||||
<ref name='capstorageremoveable'/>
|
||||
<ref name='capstoragefixed'/>
|
||||
</choice>
|
||||
|
||||
<optional>
|
||||
<element name='capability'>
|
||||
<attribute name='type'>
|
||||
<value>hotpluggable</value>
|
||||
</attribute>
|
||||
</element>
|
||||
</optional>
|
||||
</define>
|
||||
|
||||
<define name='capstorageremoveable'>
|
||||
<element name='capability'>
|
||||
<attribute name='type'>
|
||||
<value>removable</value>
|
||||
</attribute>
|
||||
<element name='media_available'>
|
||||
<choice>
|
||||
<value>1</value>
|
||||
<value>0</value>
|
||||
</choice>
|
||||
</element>
|
||||
|
||||
<element name='media_size'>
|
||||
<ref name='uint'/>
|
||||
</element>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='capstoragefixed'>
|
||||
<element name='size'>
|
||||
<ref name='uint'/>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='uuid'>
|
||||
<choice>
|
||||
<data type='string'>
|
||||
<param name="pattern">[a-fA-F0-9]{32}</param>
|
||||
</data>
|
||||
<data type='string'>
|
||||
<param name="pattern">[a-fA-F0-9]{8}\-([a-fA-F0-9]{4}\-){3}[a-fA-F0-9]{12}</param>
|
||||
</data>
|
||||
</choice>
|
||||
</define>
|
||||
|
||||
<define name='uint'>
|
||||
<data type='string'>
|
||||
<param name="pattern">[0-9]+</param>
|
||||
</data>
|
||||
</define>
|
||||
|
||||
<define name='hexuint'>
|
||||
<data type='string'>
|
||||
<param name="pattern">(0x)?[0-9a-f]+</param>
|
||||
</data>
|
||||
</define>
|
||||
|
||||
<define name='mac'>
|
||||
<data type='string'>
|
||||
<param name="pattern">([a-fA-F0-9]{2}:){5}[a-fA-F0-9]{2}</param>
|
||||
</data>
|
||||
</define>
|
||||
|
||||
<define name='path'>
|
||||
<data type='string'>
|
||||
<param name="pattern">/[a-zA-Z0-9_\+\-/%]+</param>
|
||||
</data>
|
||||
</define>
|
||||
|
||||
</grammar>
|
371
docs/schemas/storagepool.rng
Normal file
371
docs/schemas/storagepool.rng
Normal file
@ -0,0 +1,371 @@
|
||||
<!-- A Relax NG schema for the libvirt node device XML format -->
|
||||
<grammar xmlns="http://relaxng.org/ns/structure/1.0"
|
||||
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
||||
<!-- We handle only document defining a domain -->
|
||||
<start>
|
||||
<ref name='pool'/>
|
||||
</start>
|
||||
|
||||
|
||||
<define name='pool'>
|
||||
<element name='pool'>
|
||||
<choice>
|
||||
<ref name='pooldir'/>
|
||||
<ref name='poolfs'/>
|
||||
<ref name='poolnetfs'/>
|
||||
<ref name='poollogical'/>
|
||||
<ref name='pooldisk'/>
|
||||
<ref name='pooliscsi'/>
|
||||
<ref name='poolscsi'/>
|
||||
</choice>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='pooldir'>
|
||||
<attribute name='type'>
|
||||
<value>dir</value>
|
||||
</attribute>
|
||||
<ref name='commonmetadata'/>
|
||||
<ref name='sizing'/>
|
||||
<ref name='sourcedir'/>
|
||||
<ref name='target'/>
|
||||
</define>
|
||||
|
||||
<define name='poolfs'>
|
||||
<attribute name='type'>
|
||||
<value>fs</value>
|
||||
</attribute>
|
||||
<ref name='commonmetadata'/>
|
||||
<ref name='sizing'/>
|
||||
<ref name='sourcefs'/>
|
||||
<ref name='target'/>
|
||||
</define>
|
||||
|
||||
<define name='poolnetfs'>
|
||||
<attribute name='type'>
|
||||
<value>netfs</value>
|
||||
</attribute>
|
||||
<ref name='commonmetadata'/>
|
||||
<ref name='sizing'/>
|
||||
<ref name='sourcenetfs'/>
|
||||
<ref name='target'/>
|
||||
</define>
|
||||
|
||||
<define name='poollogical'>
|
||||
<attribute name='type'>
|
||||
<value>logical</value>
|
||||
</attribute>
|
||||
<ref name='commonmetadata'/>
|
||||
<ref name='sizing'/>
|
||||
<ref name='sourcelogical'/>
|
||||
<ref name='target'/>
|
||||
</define>
|
||||
|
||||
<define name='pooldisk'>
|
||||
<attribute name='type'>
|
||||
<value>disk</value>
|
||||
</attribute>
|
||||
<ref name='commonmetadata'/>
|
||||
<ref name='sizing'/>
|
||||
<ref name='sourcedisk'/>
|
||||
<ref name='target'/>
|
||||
</define>
|
||||
|
||||
<define name='pooliscsi'>
|
||||
<attribute name='type'>
|
||||
<value>iscsi</value>
|
||||
</attribute>
|
||||
<ref name='commonmetadata'/>
|
||||
<ref name='sizing'/>
|
||||
<ref name='sourceiscsi'/>
|
||||
<ref name='target'/>
|
||||
</define>
|
||||
|
||||
<define name='poolscsi'>
|
||||
<attribute name='type'>
|
||||
<value>scsi</value>
|
||||
</attribute>
|
||||
<ref name='commonmetadata'/>
|
||||
<ref name='sizing'/>
|
||||
<ref name='sourcescsi'/>
|
||||
<ref name='target'/>
|
||||
</define>
|
||||
|
||||
<define name='commonmetadata'>
|
||||
<element name='name'>
|
||||
<ref name='name'/>
|
||||
</element>
|
||||
<optional>
|
||||
<element name='uuid'>
|
||||
<ref name='uuid'/>
|
||||
</element>
|
||||
</optional>
|
||||
</define>
|
||||
|
||||
<define name='sizing'>
|
||||
<optional>
|
||||
<element name='capacity'>
|
||||
<ref name='uint'/>
|
||||
</element>
|
||||
</optional>
|
||||
<optional>
|
||||
<element name='allocation'>
|
||||
<ref name='uint'/>
|
||||
</element>
|
||||
</optional>
|
||||
<optional>
|
||||
<element name='available'>
|
||||
<ref name='uint'/>
|
||||
</element>
|
||||
</optional>
|
||||
</define>
|
||||
|
||||
<define name='permissions'>
|
||||
<optional>
|
||||
<element name='permissions'>
|
||||
<element name='mode'>
|
||||
<ref name='uint'/>
|
||||
</element>
|
||||
<element name='owner'>
|
||||
<ref name='uint'/>
|
||||
</element>
|
||||
<element name='group'>
|
||||
<ref name='uint'/>
|
||||
</element>
|
||||
<optional>
|
||||
<element name='label'>
|
||||
<text/>
|
||||
</element>
|
||||
</optional>
|
||||
</element>
|
||||
</optional>
|
||||
</define>
|
||||
|
||||
<define name='target'>
|
||||
<element name='target'>
|
||||
<optional>
|
||||
<element name='path'>
|
||||
<ref name='path'/>
|
||||
</element>
|
||||
</optional>
|
||||
<ref name='permissions'/>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='sourceinfohost'>
|
||||
<element name='host'>
|
||||
<attribute name='name'>
|
||||
<text/>
|
||||
</attribute>
|
||||
<empty/>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='sourceinfodev'>
|
||||
<element name='device'>
|
||||
<attribute name='path'>
|
||||
<choice>
|
||||
<ref name='path'/>
|
||||
<ref name='name'/>
|
||||
</choice>
|
||||
</attribute>
|
||||
<choice>
|
||||
<empty/>
|
||||
<ref name='devextents'/>
|
||||
</choice>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='devextents'>
|
||||
<oneOrMore>
|
||||
<element name='freeExtent'>
|
||||
<attribute name='start'>
|
||||
<ref name='uint'/>
|
||||
</attribute>
|
||||
<attribute name='end'>
|
||||
<ref name='uint'/>
|
||||
</attribute>
|
||||
</element>
|
||||
</oneOrMore>
|
||||
</define>
|
||||
|
||||
<define name='sourceinfodir'>
|
||||
<element name='dir'>
|
||||
<attribute name='path'>
|
||||
<ref name='path'/>
|
||||
</attribute>
|
||||
<empty/>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='sourceinfoadapter'>
|
||||
<element name='adapter'>
|
||||
<attribute name='name'>
|
||||
<text/>
|
||||
</attribute>
|
||||
<empty/>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='sourceinfoname'>
|
||||
<element name='name'>
|
||||
<text/>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='sourcefmtfs'>
|
||||
<optional>
|
||||
<element name='format'>
|
||||
<attribute name='type'>
|
||||
<choice>
|
||||
<value>auto</value>
|
||||
<value>ext2</value>
|
||||
<value>ext3</value>
|
||||
<value>ext4</value>
|
||||
<value>ufs</value>
|
||||
<value>iso9660</value>
|
||||
<value>udf</value>
|
||||
<value>gfs</value>
|
||||
<value>gfs2</value>
|
||||
<value>vfat</value>
|
||||
<value>hfs+</value>
|
||||
<value>xfs</value>
|
||||
</choice>
|
||||
</attribute>
|
||||
</element>
|
||||
</optional>
|
||||
</define>
|
||||
|
||||
|
||||
<define name='sourcefmtnetfs'>
|
||||
<optional>
|
||||
<element name='format'>
|
||||
<attribute name='type'>
|
||||
<choice>
|
||||
<value>auto</value>
|
||||
<value>nfs</value>
|
||||
</choice>
|
||||
</attribute>
|
||||
</element>
|
||||
</optional>
|
||||
</define>
|
||||
|
||||
|
||||
<define name='sourcefmtdisk'>
|
||||
<optional>
|
||||
<element name='format'>
|
||||
<attribute name='type'>
|
||||
<choice>
|
||||
<value>none</value>
|
||||
<value>dos</value>
|
||||
<value>dvh</value>
|
||||
<value>gpt</value>
|
||||
<value>mac</value>
|
||||
<value>bsd</value>
|
||||
<value>pc98</value>
|
||||
<value>sun</value>
|
||||
<value>lvm2</value>
|
||||
</choice>
|
||||
</attribute>
|
||||
</element>
|
||||
</optional>
|
||||
</define>
|
||||
|
||||
|
||||
<define name='sourcefmtlogical'>
|
||||
<optional>
|
||||
<element name='format'>
|
||||
<attribute name='type'>
|
||||
<choice>
|
||||
<value>auto</value>
|
||||
<value>lvm2</value>
|
||||
</choice>
|
||||
</attribute>
|
||||
</element>
|
||||
</optional>
|
||||
</define>
|
||||
|
||||
|
||||
<define name='sourcedir'>
|
||||
<optional>
|
||||
<element name='source'>
|
||||
<empty/>
|
||||
</element>
|
||||
</optional>
|
||||
</define>
|
||||
<define name='sourcefs'>
|
||||
<element name='source'>
|
||||
<ref name='sourceinfodev'/>
|
||||
<ref name='sourcefmtfs'/>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='sourcenetfs'>
|
||||
<element name='source'>
|
||||
<ref name='sourceinfohost'/>
|
||||
<ref name='sourceinfodir'/>
|
||||
<ref name='sourcefmtnetfs'/>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='sourcelogical'>
|
||||
<element name='source'>
|
||||
<ref name='sourceinfoname'/>
|
||||
<optional>
|
||||
<ref name='sourceinfodev'/>
|
||||
</optional>
|
||||
<ref name='sourcefmtlogical'/>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='sourcedisk'>
|
||||
<element name='source'>
|
||||
<ref name='sourceinfodev'/>
|
||||
<ref name='sourcefmtdisk'/>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='sourceiscsi'>
|
||||
<element name='source'>
|
||||
<ref name='sourceinfohost'/>
|
||||
<ref name='sourceinfodev'/>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='sourcescsi'>
|
||||
<element name='source'>
|
||||
<ref name='sourceinfoname'/>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
|
||||
<define name='name'>
|
||||
<data type='string'>
|
||||
<param name="pattern">[a-zA-Z0-9_\+\-]+</param>
|
||||
</data>
|
||||
</define>
|
||||
<define name='uuid'>
|
||||
<choice>
|
||||
<data type='string'>
|
||||
<param name="pattern">[a-fA-F0-9]{32}</param>
|
||||
</data>
|
||||
<data type='string'>
|
||||
<param name="pattern">[a-fA-F0-9]{8}\-([a-fA-F0-9]{4}\-){3}[a-fA-F0-9]{12}</param>
|
||||
</data>
|
||||
</choice>
|
||||
</define>
|
||||
|
||||
<define name='uint'>
|
||||
<data type='string'>
|
||||
<param name="pattern">[0-9]+</param>
|
||||
</data>
|
||||
</define>
|
||||
|
||||
<define name='path'>
|
||||
<data type='string'>
|
||||
<param name="pattern">/[a-zA-Z0-9_\+\-/%]+</param>
|
||||
</data>
|
||||
</define>
|
||||
|
||||
|
||||
</grammar>
|
187
docs/schemas/storagevol.rng
Normal file
187
docs/schemas/storagevol.rng
Normal file
@ -0,0 +1,187 @@
|
||||
<!-- A Relax NG schema for the libvirt node device XML format -->
|
||||
<grammar xmlns="http://relaxng.org/ns/structure/1.0"
|
||||
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
||||
<!-- We handle only document defining a domain -->
|
||||
<start>
|
||||
<ref name='vol'/>
|
||||
</start>
|
||||
|
||||
|
||||
<define name='vol'>
|
||||
<element name='volume'>
|
||||
<element name='name'>
|
||||
<ref name='name'/>
|
||||
</element>
|
||||
<optional>
|
||||
<element name='key'>
|
||||
<text/>
|
||||
</element>
|
||||
</optional>
|
||||
<ref name='source'/>
|
||||
<ref name='sizing'/>
|
||||
<ref name='target'/>
|
||||
<optional>
|
||||
<ref name='backingStore'/>
|
||||
</optional>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='sizing'>
|
||||
<optional>
|
||||
<element name='capacity'>
|
||||
<ref name='uint'/>
|
||||
</element>
|
||||
</optional>
|
||||
<optional>
|
||||
<element name='allocation'>
|
||||
<ref name='uint'/>
|
||||
</element>
|
||||
</optional>
|
||||
</define>
|
||||
|
||||
<define name='permissions'>
|
||||
<optional>
|
||||
<element name='permissions'>
|
||||
<element name='mode'>
|
||||
<ref name='uint'/>
|
||||
</element>
|
||||
<element name='owner'>
|
||||
<ref name='uint'/>
|
||||
</element>
|
||||
<element name='group'>
|
||||
<ref name='uint'/>
|
||||
</element>
|
||||
<optional>
|
||||
<element name='label'>
|
||||
<text/>
|
||||
</element>
|
||||
</optional>
|
||||
</element>
|
||||
</optional>
|
||||
</define>
|
||||
|
||||
<define name='target'>
|
||||
<element name='target'>
|
||||
<optional>
|
||||
<element name='path'>
|
||||
<ref name='path'/>
|
||||
</element>
|
||||
</optional>
|
||||
<ref name='format'/>
|
||||
<ref name='permissions'/>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='backingStore'>
|
||||
<element name='backingStore'>
|
||||
<element name='path'>
|
||||
<ref name='path'/>
|
||||
</element>
|
||||
<ref name='format'/>
|
||||
<ref name='permissions'/>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
|
||||
<define name='source'>
|
||||
<element name='source'>
|
||||
<zeroOrMore>
|
||||
<ref name='sourcedev'/>
|
||||
</zeroOrMore>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='sourcedev'>
|
||||
<element name='device'>
|
||||
<attribute name='path'>
|
||||
<ref name='path'/>
|
||||
</attribute>
|
||||
<choice>
|
||||
<empty/>
|
||||
<ref name='devextents'/>
|
||||
</choice>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='devextents'>
|
||||
<oneOrMore>
|
||||
<element name='extent'>
|
||||
<attribute name='start'>
|
||||
<ref name='uint'/>
|
||||
</attribute>
|
||||
<attribute name='end'>
|
||||
<ref name='uint'/>
|
||||
</attribute>
|
||||
</element>
|
||||
</oneOrMore>
|
||||
</define>
|
||||
|
||||
<define name='formatdev'>
|
||||
<choice>
|
||||
<value>none</value>
|
||||
<value>auto</value>
|
||||
<value>ext2</value>
|
||||
<value>ext3</value>
|
||||
<value>ext4</value>
|
||||
<value>ufs</value>
|
||||
<value>iso9660</value>
|
||||
<value>udf</value>
|
||||
<value>gfs</value>
|
||||
<value>gfs2</value>
|
||||
<value>vfat</value>
|
||||
<value>hfs+</value>
|
||||
<value>xfs</value>
|
||||
</choice>
|
||||
|
||||
</define>
|
||||
|
||||
|
||||
<define name='formatfile'>
|
||||
<choice>
|
||||
<value>raw</value>
|
||||
<value>dir</value>
|
||||
<value>bochs</value>
|
||||
<value>cloop</value>
|
||||
<value>cow</value>
|
||||
<value>dmg</value>
|
||||
<value>iso</value>
|
||||
<value>qcow</value>
|
||||
<value>qcow2</value>
|
||||
<value>vmdk</value>
|
||||
<value>vpc</value>
|
||||
</choice>
|
||||
</define>
|
||||
|
||||
<define name='format'>
|
||||
<optional>
|
||||
<element name='format'>
|
||||
<attribute name='type'>
|
||||
<choice>
|
||||
<ref name='formatfile'/>
|
||||
<ref name='formatdev'/>
|
||||
</choice>
|
||||
</attribute>
|
||||
</element>
|
||||
</optional>
|
||||
</define>
|
||||
|
||||
<define name='name'>
|
||||
<data type='string'>
|
||||
<param name="pattern">[a-zA-Z0-9_\+\-\.]+</param>
|
||||
</data>
|
||||
</define>
|
||||
|
||||
<define name='uint'>
|
||||
<data type='string'>
|
||||
<param name="pattern">[0-9]+</param>
|
||||
</data>
|
||||
</define>
|
||||
|
||||
<define name='path'>
|
||||
<data type='string'>
|
||||
<param name="pattern">/[a-zA-Z0-9_\+\-\./%]+</param>
|
||||
</data>
|
||||
</define>
|
||||
|
||||
|
||||
</grammar>
|
@ -99,6 +99,9 @@
|
||||
</li><li>
|
||||
<a href="windows.html">Windows port</a>
|
||||
<span>Access the libvirt daemon from a native Windows client</span>
|
||||
</li><li>
|
||||
<a href="logging.html">Logging</a>
|
||||
<span>The library and the daemon logging support</span>
|
||||
</li></ul></li><li>
|
||||
<a href="intro.html">Architecture</a>
|
||||
<span>Overview of the logical subsystems in the libvirt API</span>
|
||||
|
@ -46,6 +46,10 @@
|
||||
<a href="windows.html">Windows port</a>
|
||||
<span>Access the libvirt daemon from a native Windows client</span>
|
||||
</li>
|
||||
<li>
|
||||
<a href="logging.html">Logging</a>
|
||||
<span>The library and the daemon logging support</span>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
|
@ -58,6 +58,10 @@
|
||||
<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>
|
||||
|
@ -101,7 +101,7 @@ allow to connect locally as root to the daemon supervising QEmu and KVM domains
|
||||
|
||||
=item qemu:///session
|
||||
|
||||
allow to connect locally as a normal user to the his own set of QEmu and KVM domains
|
||||
allow to connect locally as a normal user to his own set of QEmu and KVM domains
|
||||
|
||||
=back
|
||||
|
||||
|
@ -58,6 +58,10 @@
|
||||
<div>
|
||||
<span class="active">Windows port</span>
|
||||
</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>
|
||||
|
@ -11,9 +11,9 @@
|
||||
#include <libvirt/libvirt.h>
|
||||
|
||||
#define DEBUG0(fmt) printf("%s:%d :: " fmt "\n", \
|
||||
__FUNCTION__, __LINE__)
|
||||
__func__, __LINE__)
|
||||
#define DEBUG(fmt, ...) printf("%s:%d: " fmt "\n", \
|
||||
__FUNCTION__, __LINE__, __VA_ARGS__)
|
||||
__func__, __LINE__, __VA_ARGS__)
|
||||
#define STREQ(a,b) (strcmp((a),(b)) == 0)
|
||||
|
||||
#ifndef ATTRIBUTE_UNUSED
|
||||
@ -158,7 +158,7 @@ int myDomainEventCallback1 (virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||
int detail,
|
||||
void *opaque ATTRIBUTE_UNUSED)
|
||||
{
|
||||
printf("%s EVENT: Domain %s(%d) %s %s\n", __FUNCTION__, virDomainGetName(dom),
|
||||
printf("%s EVENT: Domain %s(%d) %s %s\n", __func__, virDomainGetName(dom),
|
||||
virDomainGetID(dom), eventToString(event),
|
||||
eventDetailToString(event, detail));
|
||||
return 0;
|
||||
@ -170,7 +170,7 @@ int myDomainEventCallback2 (virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||
int detail,
|
||||
void *opaque ATTRIBUTE_UNUSED)
|
||||
{
|
||||
printf("%s EVENT: Domain %s(%d) %s %s\n", __FUNCTION__, virDomainGetName(dom),
|
||||
printf("%s EVENT: Domain %s(%d) %s %s\n", __func__, virDomainGetName(dom),
|
||||
virDomainGetID(dom), eventToString(event),
|
||||
eventDetailToString(event, detail));
|
||||
return 0;
|
||||
@ -179,7 +179,7 @@ int myDomainEventCallback2 (virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||
static void myFreeFunc(void *opaque)
|
||||
{
|
||||
char *str = opaque;
|
||||
printf("%s: Freeing [%s]\n", __FUNCTION__, str);
|
||||
printf("%s: Freeing [%s]\n", __func__, str);
|
||||
free(str);
|
||||
}
|
||||
|
||||
|
@ -16,9 +16,11 @@ stdint.h
|
||||
stdio.h
|
||||
stdlib.h
|
||||
string.h
|
||||
sys_ioctl.h
|
||||
sys_select.h
|
||||
sys_socket.h
|
||||
sys_stat.h
|
||||
sys_time.h
|
||||
time.h
|
||||
unistd.h
|
||||
wchar.h
|
||||
|
2
gnulib/lib/.gitignore
vendored
2
gnulib/lib/.gitignore
vendored
@ -16,9 +16,11 @@ stdint.h
|
||||
stdio.h
|
||||
stdlib.h
|
||||
string.h
|
||||
sys_ioctl.h
|
||||
sys_select.h
|
||||
sys_socket.h
|
||||
sys_stat.h
|
||||
sys_time.h
|
||||
time.h
|
||||
unistd.h
|
||||
wchar.h
|
||||
|
@ -1,6 +1,6 @@
|
||||
## DO NOT EDIT! GENERATED AUTOMATICALLY!
|
||||
## Process this file with automake to produce Makefile.in.
|
||||
# Copyright (C) 2002-2008 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002-2009 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software, distributed under the terms of the GNU
|
||||
# General Public License. As a special exception to the GNU General
|
||||
@ -9,7 +9,7 @@
|
||||
# the same distribution terms as the rest of that program.
|
||||
#
|
||||
# Generated by gnulib-tool.
|
||||
# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib/lib --m4-base=gnulib/m4 --doc-base=doc --tests-base=gnulib/tests --aux-dir=build-aux --with-tests --lgpl=2 --libtool --macro-prefix=gl c-ctype close connect getaddrinfo gethostname getpass gettext inet_pton mkstemp mktempd perror physmem poll posix-shell recv send setsockopt socket strerror strndup strsep sys_stat useless-if-before-free vasprintf vc-list-files verify
|
||||
# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib/lib --m4-base=gnulib/m4 --doc-base=doc --tests-base=gnulib/tests --aux-dir=build-aux --with-tests --lgpl=2 --libtool --macro-prefix=gl --no-vc-files c-ctype close connect getaddrinfo gethostname getpass gettext inet_pton ioctl mkstemp mktempd perror physmem poll posix-shell random_r recv send setsockopt socket stpcpy strerror strndup strsep sys_stat time_r useless-if-before-free vasprintf vc-list-files verify
|
||||
|
||||
AUTOMAKE_OPTIONS = 1.5 gnits
|
||||
|
||||
@ -102,7 +102,7 @@ libgnu_la_SOURCES += c-ctype.h c-ctype.c
|
||||
## begin gnulib module close
|
||||
|
||||
|
||||
EXTRA_DIST += close.c
|
||||
EXTRA_DIST += close.c w32sock.h
|
||||
|
||||
EXTRA_libgnu_la_SOURCES += close.c
|
||||
|
||||
@ -291,6 +291,15 @@ EXTRA_DIST += intprops.h
|
||||
|
||||
## end gnulib module intprops
|
||||
|
||||
## begin gnulib module ioctl
|
||||
|
||||
|
||||
EXTRA_DIST += ioctl.c w32sock.h
|
||||
|
||||
EXTRA_libgnu_la_SOURCES += ioctl.c
|
||||
|
||||
## end gnulib module ioctl
|
||||
|
||||
## begin gnulib module link-warning
|
||||
|
||||
LINK_WARNING_H=$(top_srcdir)/build-aux/link-warning.h
|
||||
@ -356,6 +365,11 @@ netdb.h: netdb.in.h
|
||||
-e 's|@''NEXT_NETDB_H''@|$(NEXT_NETDB_H)|g' \
|
||||
-e 's|@''HAVE_NETDB_H''@|$(HAVE_NETDB_H)|g' \
|
||||
-e 's|@''GNULIB_GETADDRINFO''@|$(GNULIB_GETADDRINFO)|g' \
|
||||
-e 's|@''HAVE_STRUCT_ADDRINFO''@|$(HAVE_STRUCT_ADDRINFO)|g' \
|
||||
-e 's|@''HAVE_DECL_FREEADDRINFO''@|$(HAVE_DECL_FREEADDRINFO)|g' \
|
||||
-e 's|@''HAVE_DECL_GAI_STRERROR''@|$(HAVE_DECL_GAI_STRERROR)|g' \
|
||||
-e 's|@''HAVE_DECL_GETADDRINFO''@|$(HAVE_DECL_GETADDRINFO)|g' \
|
||||
-e 's|@''HAVE_DECL_GETNAMEINFO''@|$(HAVE_DECL_GETNAMEINFO)|g' \
|
||||
< $(srcdir)/netdb.in.h; \
|
||||
} > $@-t
|
||||
mv $@-t $@
|
||||
@ -441,6 +455,15 @@ EXTRA_libgnu_la_SOURCES += poll.c
|
||||
|
||||
## end gnulib module posix-shell
|
||||
|
||||
## begin gnulib module random_r
|
||||
|
||||
|
||||
EXTRA_DIST += random_r.c
|
||||
|
||||
EXTRA_libgnu_la_SOURCES += random_r.c
|
||||
|
||||
## end gnulib module random_r
|
||||
|
||||
## begin gnulib module realloc-posix
|
||||
|
||||
|
||||
@ -538,6 +561,7 @@ stdint.h: stdint.in.h
|
||||
-e 's/@''HAVE_SYS_BITYPES_H''@/$(HAVE_SYS_BITYPES_H)/g' \
|
||||
-e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \
|
||||
-e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \
|
||||
-e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \
|
||||
-e 's/@''BITSIZEOF_PTRDIFF_T''@/$(BITSIZEOF_PTRDIFF_T)/g' \
|
||||
-e 's/@''PTRDIFF_T_SUFFIX''@/$(PTRDIFF_T_SUFFIX)/g' \
|
||||
-e 's/@''BITSIZEOF_SIG_ATOMIC_T''@/$(BITSIZEOF_SIG_ATOMIC_T)/g' \
|
||||
@ -584,6 +608,8 @@ stdio.h: stdio.in.h
|
||||
-e 's|@''GNULIB_VPRINTF_POSIX''@|$(GNULIB_VPRINTF_POSIX)|g' \
|
||||
-e 's|@''GNULIB_VSNPRINTF''@|$(GNULIB_VSNPRINTF)|g' \
|
||||
-e 's|@''GNULIB_VSPRINTF_POSIX''@|$(GNULIB_VSPRINTF_POSIX)|g' \
|
||||
-e 's|@''GNULIB_DPRINTF''@|$(GNULIB_DPRINTF)|g' \
|
||||
-e 's|@''GNULIB_VDPRINTF''@|$(GNULIB_VDPRINTF)|g' \
|
||||
-e 's|@''GNULIB_VASPRINTF''@|$(GNULIB_VASPRINTF)|g' \
|
||||
-e 's|@''GNULIB_OBSTACK_PRINTF''@|$(GNULIB_OBSTACK_PRINTF)|g' \
|
||||
-e 's|@''GNULIB_OBSTACK_PRINTF_POSIX''@|$(GNULIB_OBSTACK_PRINTF_POSIX)|g' \
|
||||
@ -616,6 +642,10 @@ stdio.h: stdio.in.h
|
||||
-e 's|@''HAVE_DECL_VSNPRINTF''@|$(HAVE_DECL_VSNPRINTF)|g' \
|
||||
-e 's|@''REPLACE_SPRINTF''@|$(REPLACE_SPRINTF)|g' \
|
||||
-e 's|@''REPLACE_VSPRINTF''@|$(REPLACE_VSPRINTF)|g' \
|
||||
-e 's|@''HAVE_DPRINTF''@|$(HAVE_DPRINTF)|g' \
|
||||
-e 's|@''REPLACE_DPRINTF''@|$(REPLACE_DPRINTF)|g' \
|
||||
-e 's|@''HAVE_VDPRINTF''@|$(HAVE_VDPRINTF)|g' \
|
||||
-e 's|@''REPLACE_VDPRINTF''@|$(REPLACE_VDPRINTF)|g' \
|
||||
-e 's|@''HAVE_VASPRINTF''@|$(HAVE_VASPRINTF)|g' \
|
||||
-e 's|@''REPLACE_VASPRINTF''@|$(REPLACE_VASPRINTF)|g' \
|
||||
-e 's|@''HAVE_DECL_OBSTACK_PRINTF''@|$(HAVE_DECL_OBSTACK_PRINTF)|g' \
|
||||
@ -656,6 +686,7 @@ stdlib.h: stdlib.in.h
|
||||
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
|
||||
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
|
||||
-e 's|@''NEXT_STDLIB_H''@|$(NEXT_STDLIB_H)|g' \
|
||||
-e 's|@''HAVE_RANDOM_H''@|$(HAVE_RANDOM_H)|g' \
|
||||
-e 's|@''GNULIB_MALLOC_POSIX''@|$(GNULIB_MALLOC_POSIX)|g' \
|
||||
-e 's|@''GNULIB_REALLOC_POSIX''@|$(GNULIB_REALLOC_POSIX)|g' \
|
||||
-e 's|@''GNULIB_CALLOC_POSIX''@|$(GNULIB_CALLOC_POSIX)|g' \
|
||||
@ -702,6 +733,15 @@ EXTRA_DIST += stdlib.in.h
|
||||
|
||||
## end gnulib module stdlib
|
||||
|
||||
## begin gnulib module stpcpy
|
||||
|
||||
|
||||
EXTRA_DIST += stpcpy.c
|
||||
|
||||
EXTRA_libgnu_la_SOURCES += stpcpy.c
|
||||
|
||||
## end gnulib module stpcpy
|
||||
|
||||
## begin gnulib module strdup-posix
|
||||
|
||||
|
||||
@ -816,15 +856,6 @@ EXTRA_libgnu_la_SOURCES += strnlen.c
|
||||
|
||||
## end gnulib module strnlen
|
||||
|
||||
## begin gnulib module strpbrk
|
||||
|
||||
|
||||
EXTRA_DIST += strpbrk.c
|
||||
|
||||
EXTRA_libgnu_la_SOURCES += strpbrk.c
|
||||
|
||||
## end gnulib module strpbrk
|
||||
|
||||
## begin gnulib module strsep
|
||||
|
||||
|
||||
@ -834,6 +865,33 @@ EXTRA_libgnu_la_SOURCES += strsep.c
|
||||
|
||||
## end gnulib module strsep
|
||||
|
||||
## begin gnulib module sys_ioctl
|
||||
|
||||
BUILT_SOURCES += $(SYS_IOCTL_H)
|
||||
|
||||
# We need the following in order to create <sys/ioctl.h> when the system
|
||||
# does not have a complete one.
|
||||
sys/ioctl.h: sys_ioctl.in.h
|
||||
@MKDIR_P@ sys
|
||||
rm -f $@-t $@
|
||||
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
|
||||
sed -e 's|@''HAVE_SYS_IOCTL_H''@|$(HAVE_SYS_IOCTL_H)|g' \
|
||||
-e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
|
||||
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
|
||||
-e 's|@''NEXT_SYS_IOCTL_H''@|$(NEXT_SYS_IOCTL_H)|g' \
|
||||
-e 's|@''GNULIB_IOCTL''@|$(GNULIB_IOCTL)|g' \
|
||||
-e 's|@''SYS_IOCTL_H_HAVE_WINSOCK2_H''@|$(SYS_IOCTL_H_HAVE_WINSOCK2_H)|g' \
|
||||
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
|
||||
< $(srcdir)/sys_ioctl.in.h; \
|
||||
} > $@-t
|
||||
mv $@-t $@
|
||||
MOSTLYCLEANFILES += sys/ioctl.h sys/ioctl.h-t
|
||||
MOSTLYCLEANDIRS += sys
|
||||
|
||||
EXTRA_DIST += sys_ioctl.in.h
|
||||
|
||||
## end gnulib module sys_ioctl
|
||||
|
||||
## begin gnulib module sys_select
|
||||
|
||||
BUILT_SOURCES += $(SYS_SELECT_H)
|
||||
@ -966,6 +1024,42 @@ EXTRA_libgnu_la_SOURCES += tempname.c
|
||||
|
||||
## end gnulib module tempname
|
||||
|
||||
## begin gnulib module time
|
||||
|
||||
BUILT_SOURCES += time.h
|
||||
|
||||
# We need the following in order to create <time.h> when the system
|
||||
# doesn't have one that works with the given compiler.
|
||||
time.h: time.in.h
|
||||
rm -f $@-t $@
|
||||
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
|
||||
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
|
||||
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
|
||||
-e 's|@NEXT_TIME_H''@|$(NEXT_TIME_H)|g' \
|
||||
-e 's|@REPLACE_LOCALTIME_R''@|$(REPLACE_LOCALTIME_R)|g' \
|
||||
-e 's|@REPLACE_NANOSLEEP''@|$(REPLACE_NANOSLEEP)|g' \
|
||||
-e 's|@REPLACE_STRPTIME''@|$(REPLACE_STRPTIME)|g' \
|
||||
-e 's|@REPLACE_TIMEGM''@|$(REPLACE_TIMEGM)|g' \
|
||||
-e 's|@SYS_TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(SYS_TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \
|
||||
-e 's|@TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \
|
||||
< $(srcdir)/time.in.h; \
|
||||
} > $@-t
|
||||
mv $@-t $@
|
||||
MOSTLYCLEANFILES += time.h time.h-t
|
||||
|
||||
EXTRA_DIST += time.in.h
|
||||
|
||||
## end gnulib module time
|
||||
|
||||
## begin gnulib module time_r
|
||||
|
||||
|
||||
EXTRA_DIST += time_r.c
|
||||
|
||||
EXTRA_libgnu_la_SOURCES += time_r.c
|
||||
|
||||
## end gnulib module time_r
|
||||
|
||||
## begin gnulib module unistd
|
||||
|
||||
BUILT_SOURCES += unistd.h
|
||||
@ -995,6 +1089,7 @@ unistd.h: unistd.in.h
|
||||
-e 's|@''GNULIB_GETPAGESIZE''@|$(GNULIB_GETPAGESIZE)|g' \
|
||||
-e 's|@''GNULIB_GETUSERSHELL''@|$(GNULIB_GETUSERSHELL)|g' \
|
||||
-e 's|@''GNULIB_LCHOWN''@|$(GNULIB_LCHOWN)|g' \
|
||||
-e 's|@''GNULIB_LINK''@|$(GNULIB_LINK)|g' \
|
||||
-e 's|@''GNULIB_LSEEK''@|$(GNULIB_LSEEK)|g' \
|
||||
-e 's|@''GNULIB_READLINK''@|$(GNULIB_READLINK)|g' \
|
||||
-e 's|@''GNULIB_SLEEP''@|$(GNULIB_SLEEP)|g' \
|
||||
@ -1009,6 +1104,7 @@ unistd.h: unistd.in.h
|
||||
-e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \
|
||||
-e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \
|
||||
-e 's|@''HAVE_GETUSERSHELL''@|$(HAVE_GETUSERSHELL)|g' \
|
||||
-e 's|@''HAVE_LINK''@|$(HAVE_LINK)|g' \
|
||||
-e 's|@''HAVE_READLINK''@|$(HAVE_READLINK)|g' \
|
||||
-e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \
|
||||
-e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \
|
||||
@ -1084,10 +1180,40 @@ wchar.h: wchar.in.h
|
||||
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
|
||||
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
|
||||
-e 's|@''NEXT_WCHAR_H''@|$(NEXT_WCHAR_H)|g' \
|
||||
-e 's/@''HAVE_WCHAR_H''@/$(HAVE_WCHAR_H)/g' \
|
||||
-e 's|@''HAVE_WCHAR_H''@|$(HAVE_WCHAR_H)|g' \
|
||||
-e 's|@''GNULIB_BTOWC''@|$(GNULIB_BTOWC)|g' \
|
||||
-e 's|@''GNULIB_WCTOB''@|$(GNULIB_WCTOB)|g' \
|
||||
-e 's|@''GNULIB_MBSINIT''@|$(GNULIB_MBSINIT)|g' \
|
||||
-e 's|@''GNULIB_MBRTOWC''@|$(GNULIB_MBRTOWC)|g' \
|
||||
-e 's|@''GNULIB_MBRLEN''@|$(GNULIB_MBRLEN)|g' \
|
||||
-e 's|@''GNULIB_MBSRTOWCS''@|$(GNULIB_MBSRTOWCS)|g' \
|
||||
-e 's|@''GNULIB_MBSNRTOWCS''@|$(GNULIB_MBSNRTOWCS)|g' \
|
||||
-e 's|@''GNULIB_WCRTOMB''@|$(GNULIB_WCRTOMB)|g' \
|
||||
-e 's|@''GNULIB_WCSRTOMBS''@|$(GNULIB_WCSRTOMBS)|g' \
|
||||
-e 's|@''GNULIB_WCSNRTOMBS''@|$(GNULIB_WCSNRTOMBS)|g' \
|
||||
-e 's|@''GNULIB_WCWIDTH''@|$(GNULIB_WCWIDTH)|g' \
|
||||
-e 's/@''HAVE_WINT_T''@/$(HAVE_WINT_T)/g' \
|
||||
-e 's|@''HAVE_WINT_T''@|$(HAVE_WINT_T)|g' \
|
||||
-e 's|@''HAVE_BTOWC''@|$(HAVE_BTOWC)|g' \
|
||||
-e 's|@''HAVE_MBSINIT''@|$(HAVE_MBSINIT)|g' \
|
||||
-e 's|@''HAVE_MBRTOWC''@|$(HAVE_MBRTOWC)|g' \
|
||||
-e 's|@''HAVE_MBRLEN''@|$(HAVE_MBRLEN)|g' \
|
||||
-e 's|@''HAVE_MBSRTOWCS''@|$(HAVE_MBSRTOWCS)|g' \
|
||||
-e 's|@''HAVE_MBSNRTOWCS''@|$(HAVE_MBSNRTOWCS)|g' \
|
||||
-e 's|@''HAVE_WCRTOMB''@|$(HAVE_WCRTOMB)|g' \
|
||||
-e 's|@''HAVE_WCSRTOMBS''@|$(HAVE_WCSRTOMBS)|g' \
|
||||
-e 's|@''HAVE_WCSNRTOMBS''@|$(HAVE_WCSNRTOMBS)|g' \
|
||||
-e 's|@''HAVE_DECL_WCTOB''@|$(HAVE_DECL_WCTOB)|g' \
|
||||
-e 's|@''HAVE_DECL_WCWIDTH''@|$(HAVE_DECL_WCWIDTH)|g' \
|
||||
-e 's|@''REPLACE_MBSTATE_T''@|$(REPLACE_MBSTATE_T)|g' \
|
||||
-e 's|@''REPLACE_BTOWC''@|$(REPLACE_BTOWC)|g' \
|
||||
-e 's|@''REPLACE_WCTOB''@|$(REPLACE_WCTOB)|g' \
|
||||
-e 's|@''REPLACE_MBSINIT''@|$(REPLACE_MBSINIT)|g' \
|
||||
-e 's|@''REPLACE_MBRTOWC''@|$(REPLACE_MBRTOWC)|g' \
|
||||
-e 's|@''REPLACE_MBRLEN''@|$(REPLACE_MBRLEN)|g' \
|
||||
-e 's|@''REPLACE_MBSRTOWCS''@|$(REPLACE_MBSRTOWCS)|g' \
|
||||
-e 's|@''REPLACE_MBSNRTOWCS''@|$(REPLACE_MBSNRTOWCS)|g' \
|
||||
-e 's|@''REPLACE_WCRTOMB''@|$(REPLACE_WCRTOMB)|g' \
|
||||
-e 's|@''REPLACE_WCSRTOMBS''@|$(REPLACE_WCSRTOMBS)|g' \
|
||||
-e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \
|
||||
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
|
||||
< $(srcdir)/wchar.in.h; \
|
||||
|
@ -38,6 +38,10 @@
|
||||
|
||||
/* The definition of GL_LINK_WARNING is copied here. */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if @GNULIB_INET_NTOP@
|
||||
# if !@HAVE_DECL_INET_NTOP@
|
||||
/* Converts an internet address from internal format to a printable,
|
||||
@ -78,5 +82,9 @@ extern int inet_pton (int af, const char *restrict src, void *restrict dst);
|
||||
inet_pton (af, src, dst))
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _GL_ARPA_INET_H */
|
||||
#endif /* _GL_ARPA_INET_H */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* An fseeko() function that, together with fflush(), is POSIX compliant.
|
||||
Copyright (C) 2007-2008 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007-2009 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
@ -41,7 +41,7 @@ rpl_fseeko (FILE *fp, off_t offset, int whence)
|
||||
#endif
|
||||
|
||||
/* These tests are based on fpurge.c. */
|
||||
#if defined _IO_ferror_unlocked || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Linux libc5 */
|
||||
#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
|
||||
if (fp->_IO_read_end == fp->_IO_read_ptr
|
||||
&& fp->_IO_write_ptr == fp->_IO_write_base
|
||||
&& fp->_IO_save_base == NULL)
|
||||
@ -86,7 +86,14 @@ rpl_fseeko (FILE *fp, off_t offset, int whence)
|
||||
#error "Please port gnulib fseeko.c to your platform! Look at the code in fpurge.c, then report this to bug-gnulib."
|
||||
#endif
|
||||
{
|
||||
off_t pos = lseek (fileno (fp), offset, whence);
|
||||
/* We get here when an fflush() call immediately preceded this one. We
|
||||
know there are no buffers.
|
||||
POSIX requires us to modify the file descriptor's position.
|
||||
But we cannot position beyond end of file here. */
|
||||
off_t pos =
|
||||
lseek (fileno (fp),
|
||||
whence == SEEK_END && offset > 0 ? 0 : offset,
|
||||
whence);
|
||||
if (pos == -1)
|
||||
{
|
||||
#if defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */
|
||||
@ -94,9 +101,10 @@ rpl_fseeko (FILE *fp, off_t offset, int whence)
|
||||
#endif
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
#if defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */
|
||||
|
||||
#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
|
||||
fp->_flags &= ~_IO_EOF_SEEN;
|
||||
#elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */
|
||||
fp_->_offset = pos;
|
||||
fp_->_flags |= __SOFF;
|
||||
fp_->_flags &= ~__SEOF;
|
||||
@ -105,9 +113,10 @@ rpl_fseeko (FILE *fp, off_t offset, int whence)
|
||||
#elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw */
|
||||
fp->_flag &= ~_IOEOF;
|
||||
#endif
|
||||
/* If we were not requested to position beyond end of file, we're
|
||||
done. */
|
||||
if (!(whence == SEEK_END && offset > 0))
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
return fseeko (fp, offset, whence);
|
||||
}
|
||||
|
@ -41,6 +41,12 @@
|
||||
static struct tm tm_zero_buffer;
|
||||
static struct tm *localtime_buffer_addr = &tm_zero_buffer;
|
||||
|
||||
#undef localtime
|
||||
extern struct tm *localtime (time_t const *);
|
||||
|
||||
#undef gmtime
|
||||
extern struct tm *gmtime (time_t const *);
|
||||
|
||||
/* This is a wrapper for localtime. It is used only on systems for which
|
||||
gettimeofday clobbers the static buffer used for localtime's result.
|
||||
|
||||
@ -50,8 +56,6 @@ static struct tm *localtime_buffer_addr = &tm_zero_buffer;
|
||||
struct tm *
|
||||
rpl_localtime (time_t const *timep)
|
||||
{
|
||||
#undef localtime
|
||||
extern struct tm *localtime (time_t const *);
|
||||
struct tm *tm = localtime (timep);
|
||||
|
||||
if (localtime_buffer_addr == &tm_zero_buffer)
|
||||
@ -64,8 +68,6 @@ rpl_localtime (time_t const *timep)
|
||||
struct tm *
|
||||
rpl_gmtime (time_t const *timep)
|
||||
{
|
||||
#undef gmtime
|
||||
extern struct tm *gmtime (time_t const *);
|
||||
struct tm *tm = gmtime (timep);
|
||||
|
||||
if (localtime_buffer_addr == &tm_zero_buffer)
|
||||
@ -77,14 +79,15 @@ rpl_gmtime (time_t const *timep)
|
||||
#endif /* GETTIMEOFDAY_CLOBBERS_LOCALTIME || TZSET_CLOBBERS_LOCALTIME */
|
||||
|
||||
#if TZSET_CLOBBERS_LOCALTIME
|
||||
|
||||
#undef tzset
|
||||
extern void tzset (void);
|
||||
|
||||
/* This is a wrapper for tzset, for systems on which tzset may clobber
|
||||
the static buffer used for localtime's result. */
|
||||
void
|
||||
rpl_tzset (void)
|
||||
{
|
||||
#undef tzset
|
||||
extern void tzset (void);
|
||||
|
||||
/* Save and restore the contents of the buffer used for localtime's
|
||||
result around the call to tzset. */
|
||||
struct tm save = *localtime_buffer_addr;
|
||||
|
@ -1,24 +1,26 @@
|
||||
/* ioctl.c --- wrappers for Windows ioctl function
|
||||
|
||||
Copyright (C) 2008 Free Software Foundation, Inc.
|
||||
Copyright (C) 2008, 2009 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
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 program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Paolo Bonzini */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
@ -25,15 +25,15 @@
|
||||
#include <sys/stat.h>
|
||||
#undef __need_system_sys_stat_h
|
||||
|
||||
/* Specification. */
|
||||
#include <sys/stat.h>
|
||||
|
||||
static inline int
|
||||
orig_lstat (const char *filename, struct stat *buf)
|
||||
{
|
||||
return lstat (filename, buf);
|
||||
}
|
||||
|
||||
/* Specification. */
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
|
@ -36,12 +36,6 @@
|
||||
#ifndef _GL_NETDB_H
|
||||
#define _GL_NETDB_H
|
||||
|
||||
#if @HAVE_NETDB_H@ && HAVE_STRUCT_ADDRINFO
|
||||
|
||||
/* Declarations for a platform that has <netdb.h>. */
|
||||
|
||||
#else
|
||||
|
||||
/* Get netdb.h definitions such as struct hostent for MinGW. */
|
||||
#include <sys/socket.h>
|
||||
|
||||
@ -50,7 +44,7 @@
|
||||
|
||||
#if @GNULIB_GETADDRINFO@
|
||||
|
||||
# ifndef HAVE_STRUCT_ADDRINFO
|
||||
# if !@HAVE_STRUCT_ADDRINFO@
|
||||
|
||||
/* Structure to contain information about address of a service provider. */
|
||||
struct addrinfo
|
||||
@ -112,7 +106,7 @@ struct addrinfo
|
||||
# endif
|
||||
|
||||
# ifndef EAI_OVERFLOW
|
||||
/* Not defined on mingw32. */
|
||||
/* Not defined on mingw32 and Haiku. */
|
||||
# define EAI_OVERFLOW -12 /* Argument buffer overflow. */
|
||||
# endif
|
||||
# ifndef EAI_ADDRFAMILY
|
||||
@ -139,7 +133,7 @@ struct addrinfo
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# if !HAVE_DECL_GETADDRINFO
|
||||
# if !@HAVE_DECL_GETADDRINFO@
|
||||
/* Translate name of a service location and/or a service name to set of
|
||||
socket addresses.
|
||||
For more details, see the POSIX:2001 specification
|
||||
@ -150,21 +144,21 @@ extern int getaddrinfo (const char *restrict nodename,
|
||||
struct addrinfo **restrict res);
|
||||
# endif
|
||||
|
||||
# if !HAVE_DECL_FREEADDRINFO
|
||||
# if !@HAVE_DECL_FREEADDRINFO@
|
||||
/* Free `addrinfo' structure AI including associated storage.
|
||||
For more details, see the POSIX:2001 specification
|
||||
<http://www.opengroup.org/susv3xsh/getaddrinfo.html>. */
|
||||
extern void freeaddrinfo (struct addrinfo *ai);
|
||||
# endif
|
||||
|
||||
# if !HAVE_DECL_GAI_STRERROR
|
||||
# if !@HAVE_DECL_GAI_STRERROR@
|
||||
/* Convert error return from getaddrinfo() to a string.
|
||||
For more details, see the POSIX:2001 specification
|
||||
<http://www.opengroup.org/susv3xsh/gai_strerror.html>. */
|
||||
extern const char *gai_strerror (int ecode);
|
||||
# endif
|
||||
|
||||
# if !HAVE_DECL_GETNAMEINFO
|
||||
# if !@HAVE_DECL_GETNAMEINFO@
|
||||
/* Convert socket address to printable node and service names.
|
||||
For more details, see the POSIX:2001 specification
|
||||
<http://www.opengroup.org/susv3xsh/getnameinfo.html>. */
|
||||
@ -184,7 +178,5 @@ extern int getnameinfo(const struct sockaddr *restrict sa, socklen_t salen,
|
||||
|
||||
#endif /* @GNULIB_GETADDRINFO@ */
|
||||
|
||||
#endif /* HAVE_NETDB_H */
|
||||
|
||||
#endif /* _GL_NETDB_H */
|
||||
#endif /* _GL_NETDB_H */
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* Emulation for poll(2)
|
||||
Contributed by Paolo Bonzini.
|
||||
|
||||
Copyright 2001, 2002, 2003, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||
Copyright 2001-2003, 2006-2009 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of gnulib.
|
||||
|
||||
@ -19,6 +19,11 @@
|
||||
with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
/* Tell gcc not to warn about the (nfd < 0) tests, below. */
|
||||
#if (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) || 4 < __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wtype-limits"
|
||||
#endif
|
||||
|
||||
#include <config.h>
|
||||
#include <alloca.h>
|
||||
|
||||
@ -29,35 +34,35 @@
|
||||
#include <assert.h>
|
||||
|
||||
#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
|
||||
#define WIN32_NATIVE
|
||||
#include <winsock2.h>
|
||||
#include <windows.h>
|
||||
#include <io.h>
|
||||
#include <stdio.h>
|
||||
#include <conio.h>
|
||||
# define WIN32_NATIVE
|
||||
# include <winsock2.h>
|
||||
# include <windows.h>
|
||||
# include <io.h>
|
||||
# include <stdio.h>
|
||||
# include <conio.h>
|
||||
#else
|
||||
#include <sys/time.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/select.h>
|
||||
#include <unistd.h>
|
||||
# include <sys/time.h>
|
||||
# include <sys/socket.h>
|
||||
# include <sys/select.h>
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_IOCTL_H
|
||||
#include <sys/ioctl.h>
|
||||
# include <sys/ioctl.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_FILIO_H
|
||||
#include <sys/filio.h>
|
||||
# include <sys/filio.h>
|
||||
#endif
|
||||
|
||||
#include <time.h>
|
||||
|
||||
#ifndef INFTIM
|
||||
#define INFTIM (-1)
|
||||
# define INFTIM (-1)
|
||||
#endif
|
||||
|
||||
/* BeOS does not have MSG_PEEK. */
|
||||
#ifndef MSG_PEEK
|
||||
#define MSG_PEEK 0
|
||||
# define MSG_PEEK 0
|
||||
#endif
|
||||
|
||||
#ifdef WIN32_NATIVE
|
||||
@ -92,9 +97,9 @@ typedef enum _FILE_INFORMATION_CLASS {
|
||||
typedef DWORD (WINAPI *PNtQueryInformationFile)
|
||||
(HANDLE, IO_STATUS_BLOCK *, VOID *, ULONG, FILE_INFORMATION_CLASS);
|
||||
|
||||
#ifndef PIPE_BUF
|
||||
#define PIPE_BUF 512
|
||||
#endif
|
||||
# ifndef PIPE_BUF
|
||||
# define PIPE_BUF 512
|
||||
# endif
|
||||
|
||||
/* Compute revents values for file handle H. */
|
||||
|
||||
@ -234,7 +239,7 @@ compute_revents (int fd, int sought, fd_set *rfds, fd_set *wfds, fd_set *efds)
|
||||
int r;
|
||||
int socket_errno;
|
||||
|
||||
#if defined __MACH__ && defined __APPLE__
|
||||
# if defined __MACH__ && defined __APPLE__
|
||||
/* There is a bug in Mac OS X that causes it to ignore MSG_PEEK
|
||||
for some kinds of descriptors. Detect if this descriptor is a
|
||||
connected socket, a server socket, or something else using a
|
||||
@ -243,11 +248,11 @@ compute_revents (int fd, int sought, fd_set *rfds, fd_set *wfds, fd_set *efds)
|
||||
socket_errno = (r < 0) ? errno : 0;
|
||||
if (r == 0 || socket_errno == ENOTSOCK)
|
||||
ioctl (fd, FIONREAD, &r);
|
||||
#else
|
||||
# else
|
||||
char data[64];
|
||||
r = recv (fd, data, sizeof (data), MSG_PEEK);
|
||||
socket_errno = (r < 0) ? errno : 0;
|
||||
#endif
|
||||
# endif
|
||||
if (r == 0)
|
||||
happened |= POLLHUP;
|
||||
|
||||
@ -288,7 +293,7 @@ poll (pfd, nfd, timeout)
|
||||
int maxfd, rc;
|
||||
nfds_t i;
|
||||
|
||||
#ifdef _SC_OPEN_MAX
|
||||
# ifdef _SC_OPEN_MAX
|
||||
static int sc_open_max = -1;
|
||||
|
||||
if (nfd < 0
|
||||
@ -299,15 +304,15 @@ poll (pfd, nfd, timeout)
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
#else /* !_SC_OPEN_MAX */
|
||||
#ifdef OPEN_MAX
|
||||
# else /* !_SC_OPEN_MAX */
|
||||
# ifdef OPEN_MAX
|
||||
if (nfd < 0 || nfd > OPEN_MAX)
|
||||
{
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
#endif /* OPEN_MAX -- else, no check is needed */
|
||||
#endif /* !_SC_OPEN_MAX */
|
||||
# endif /* OPEN_MAX -- else, no check is needed */
|
||||
# endif /* !_SC_OPEN_MAX */
|
||||
|
||||
/* EFAULT is not necessary to implement, but let's do it in the
|
||||
simplest case. */
|
||||
@ -404,8 +409,7 @@ poll (pfd, nfd, timeout)
|
||||
fd_set rfds, wfds, xfds;
|
||||
BOOL poll_again;
|
||||
MSG msg;
|
||||
char sockbuf[256];
|
||||
int rc;
|
||||
int rc = 0;
|
||||
nfds_t i;
|
||||
|
||||
if (nfd < 0 || timeout < -1)
|
||||
@ -426,7 +430,6 @@ poll (pfd, nfd, timeout)
|
||||
/* Classify socket handles and create fd sets. */
|
||||
for (i = 0; i < nfd; i++)
|
||||
{
|
||||
size_t optlen = sizeof(sockbuf);
|
||||
pfd[i].revents = 0;
|
||||
if (pfd[i].fd < 0)
|
||||
continue;
|
||||
|
420
gnulib/lib/random_r.c
Normal file
420
gnulib/lib/random_r.c
Normal file
@ -0,0 +1,420 @@
|
||||
/*
|
||||
Copyright (C) 1995, 2005, 2008 Free Software Foundation
|
||||
|
||||
The GNU C 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.
|
||||
|
||||
The GNU C 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 the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
/*
|
||||
Copyright (C) 1983 Regents of the University of California.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
4. Neither the name of the University nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGE.*/
|
||||
|
||||
/*
|
||||
* This is derived from the Berkeley source:
|
||||
* @(#)random.c 5.5 (Berkeley) 7/6/88
|
||||
* It was reworked for the GNU C Library by Roland McGrath.
|
||||
* Rewritten to be reentrant by Ulrich Drepper, 1995
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
|
||||
/* An improved random number generation package. In addition to the standard
|
||||
rand()/srand() like interface, this package also has a special state info
|
||||
interface. The initstate() routine is called with a seed, an array of
|
||||
bytes, and a count of how many bytes are being passed in; this array is
|
||||
then initialized to contain information for random number generation with
|
||||
that much state information. Good sizes for the amount of state
|
||||
information are 32, 64, 128, and 256 bytes. The state can be switched by
|
||||
calling the setstate() function with the same array as was initialized
|
||||
with initstate(). By default, the package runs with 128 bytes of state
|
||||
information and generates far better random numbers than a linear
|
||||
congruential generator. If the amount of state information is less than
|
||||
32 bytes, a simple linear congruential R.N.G. is used. Internally, the
|
||||
state information is treated as an array of longs; the zeroth element of
|
||||
the array is the type of R.N.G. being used (small integer); the remainder
|
||||
of the array is the state information for the R.N.G. Thus, 32 bytes of
|
||||
state information will give 7 longs worth of state information, which will
|
||||
allow a degree seven polynomial. (Note: The zeroth word of state
|
||||
information also has some other information stored in it; see setstate
|
||||
for details). The random number generation technique is a linear feedback
|
||||
shift register approach, employing trinomials (since there are fewer terms
|
||||
to sum up that way). In this approach, the least significant bit of all
|
||||
the numbers in the state table will act as a linear feedback shift register,
|
||||
and will have period 2^deg - 1 (where deg is the degree of the polynomial
|
||||
being used, assuming that the polynomial is irreducible and primitive).
|
||||
The higher order bits will have longer periods, since their values are
|
||||
also influenced by pseudo-random carries out of the lower bits. The
|
||||
total period of the generator is approximately deg*(2**deg - 1); thus
|
||||
doubling the amount of state information has a vast influence on the
|
||||
period of the generator. Note: The deg*(2**deg - 1) is an approximation
|
||||
only good for large deg, when the period of the shift register is the
|
||||
dominant factor. With deg equal to seven, the period is actually much
|
||||
longer than the 7*(2**7 - 1) predicted by this formula. */
|
||||
|
||||
|
||||
|
||||
/* For each of the currently supported random number generators, we have a
|
||||
break value on the amount of state information (you need at least this many
|
||||
bytes of state info to support this random number generator), a degree for
|
||||
the polynomial (actually a trinomial) that the R.N.G. is based on, and
|
||||
separation between the two lower order coefficients of the trinomial. */
|
||||
|
||||
/* Linear congruential. */
|
||||
#define TYPE_0 0
|
||||
#define BREAK_0 8
|
||||
#define DEG_0 0
|
||||
#define SEP_0 0
|
||||
|
||||
/* x**7 + x**3 + 1. */
|
||||
#define TYPE_1 1
|
||||
#define BREAK_1 32
|
||||
#define DEG_1 7
|
||||
#define SEP_1 3
|
||||
|
||||
/* x**15 + x + 1. */
|
||||
#define TYPE_2 2
|
||||
#define BREAK_2 64
|
||||
#define DEG_2 15
|
||||
#define SEP_2 1
|
||||
|
||||
/* x**31 + x**3 + 1. */
|
||||
#define TYPE_3 3
|
||||
#define BREAK_3 128
|
||||
#define DEG_3 31
|
||||
#define SEP_3 3
|
||||
|
||||
/* x**63 + x + 1. */
|
||||
#define TYPE_4 4
|
||||
#define BREAK_4 256
|
||||
#define DEG_4 63
|
||||
#define SEP_4 1
|
||||
|
||||
|
||||
/* Array versions of the above information to make code run faster.
|
||||
Relies on fact that TYPE_i == i. */
|
||||
|
||||
#define MAX_TYPES 5 /* Max number of types above. */
|
||||
|
||||
struct random_poly_info
|
||||
{
|
||||
int seps[MAX_TYPES];
|
||||
int degrees[MAX_TYPES];
|
||||
};
|
||||
|
||||
static const struct random_poly_info random_poly_info =
|
||||
{
|
||||
{ SEP_0, SEP_1, SEP_2, SEP_3, SEP_4 },
|
||||
{ DEG_0, DEG_1, DEG_2, DEG_3, DEG_4 }
|
||||
};
|
||||
|
||||
#ifndef _LIBC
|
||||
# define weak_alias(local, symbol)
|
||||
# define __set_errno(e) errno = (e)
|
||||
# define __srandom_r srandom_r
|
||||
# define __initstate_r initstate_r
|
||||
# define __setstate_r setstate_r
|
||||
# define __random_r random_r
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/* Initialize the random number generator based on the given seed. If the
|
||||
type is the trivial no-state-information type, just remember the seed.
|
||||
Otherwise, initializes state[] based on the given "seed" via a linear
|
||||
congruential generator. Then, the pointers are set to known locations
|
||||
that are exactly rand_sep places apart. Lastly, it cycles the state
|
||||
information a given number of times to get rid of any initial dependencies
|
||||
introduced by the L.C.R.N.G. Note that the initialization of randtbl[]
|
||||
for default usage relies on values produced by this routine. */
|
||||
int
|
||||
__srandom_r (unsigned int seed, struct random_data *buf)
|
||||
{
|
||||
int type;
|
||||
int32_t *state;
|
||||
long int i;
|
||||
long int word;
|
||||
int32_t *dst;
|
||||
int kc;
|
||||
|
||||
if (buf == NULL)
|
||||
goto fail;
|
||||
type = buf->rand_type;
|
||||
if ((unsigned int) type >= MAX_TYPES)
|
||||
goto fail;
|
||||
|
||||
state = buf->state;
|
||||
/* We must make sure the seed is not 0. Take arbitrarily 1 in this case. */
|
||||
if (seed == 0)
|
||||
seed = 1;
|
||||
state[0] = seed;
|
||||
if (type == TYPE_0)
|
||||
goto done;
|
||||
|
||||
dst = state;
|
||||
word = seed;
|
||||
kc = buf->rand_deg;
|
||||
for (i = 1; i < kc; ++i)
|
||||
{
|
||||
/* This does:
|
||||
state[i] = (16807 * state[i - 1]) % 2147483647;
|
||||
but avoids overflowing 31 bits. */
|
||||
long int hi = word / 127773;
|
||||
long int lo = word % 127773;
|
||||
word = 16807 * lo - 2836 * hi;
|
||||
if (word < 0)
|
||||
word += 2147483647;
|
||||
*++dst = word;
|
||||
}
|
||||
|
||||
buf->fptr = &state[buf->rand_sep];
|
||||
buf->rptr = &state[0];
|
||||
kc *= 10;
|
||||
while (--kc >= 0)
|
||||
{
|
||||
int32_t discard;
|
||||
(void) __random_r (buf, &discard);
|
||||
}
|
||||
|
||||
done:
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
return -1;
|
||||
}
|
||||
|
||||
weak_alias (__srandom_r, srandom_r)
|
||||
|
||||
/* Initialize the state information in the given array of N bytes for
|
||||
future random number generation. Based on the number of bytes we
|
||||
are given, and the break values for the different R.N.G.'s, we choose
|
||||
the best (largest) one we can and set things up for it. srandom is
|
||||
then called to initialize the state information. Note that on return
|
||||
from srandom, we set state[-1] to be the type multiplexed with the current
|
||||
value of the rear pointer; this is so successive calls to initstate won't
|
||||
lose this information and will be able to restart with setstate.
|
||||
Note: The first thing we do is save the current state, if any, just like
|
||||
setstate so that it doesn't matter when initstate is called.
|
||||
Returns a pointer to the old state. */
|
||||
int
|
||||
__initstate_r (unsigned int seed, char *arg_state, size_t n,
|
||||
struct random_data *buf)
|
||||
{
|
||||
int32_t *old_state;
|
||||
int32_t *state;
|
||||
int type;
|
||||
int degree;
|
||||
int separation;
|
||||
|
||||
if (buf == NULL)
|
||||
goto fail;
|
||||
|
||||
old_state = buf->state;
|
||||
if (old_state != NULL)
|
||||
{
|
||||
int old_type = buf->rand_type;
|
||||
if (old_type == TYPE_0)
|
||||
old_state[-1] = TYPE_0;
|
||||
else
|
||||
old_state[-1] = (MAX_TYPES * (buf->rptr - old_state)) + old_type;
|
||||
}
|
||||
|
||||
if (n >= BREAK_3)
|
||||
type = n < BREAK_4 ? TYPE_3 : TYPE_4;
|
||||
else if (n < BREAK_1)
|
||||
{
|
||||
if (n < BREAK_0)
|
||||
{
|
||||
__set_errno (EINVAL);
|
||||
goto fail;
|
||||
}
|
||||
type = TYPE_0;
|
||||
}
|
||||
else
|
||||
type = n < BREAK_2 ? TYPE_1 : TYPE_2;
|
||||
|
||||
degree = random_poly_info.degrees[type];
|
||||
separation = random_poly_info.seps[type];
|
||||
|
||||
buf->rand_type = type;
|
||||
buf->rand_sep = separation;
|
||||
buf->rand_deg = degree;
|
||||
state = &((int32_t *) arg_state)[1]; /* First location. */
|
||||
/* Must set END_PTR before srandom. */
|
||||
buf->end_ptr = &state[degree];
|
||||
|
||||
buf->state = state;
|
||||
|
||||
__srandom_r (seed, buf);
|
||||
|
||||
state[-1] = TYPE_0;
|
||||
if (type != TYPE_0)
|
||||
state[-1] = (buf->rptr - state) * MAX_TYPES + type;
|
||||
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
__set_errno (EINVAL);
|
||||
return -1;
|
||||
}
|
||||
|
||||
weak_alias (__initstate_r, initstate_r)
|
||||
|
||||
/* Restore the state from the given state array.
|
||||
Note: It is important that we also remember the locations of the pointers
|
||||
in the current state information, and restore the locations of the pointers
|
||||
from the old state information. This is done by multiplexing the pointer
|
||||
location into the zeroth word of the state information. Note that due
|
||||
to the order in which things are done, it is OK to call setstate with the
|
||||
same state as the current state
|
||||
Returns a pointer to the old state information. */
|
||||
int
|
||||
__setstate_r (char *arg_state, struct random_data *buf)
|
||||
{
|
||||
int32_t *new_state = 1 + (int32_t *) arg_state;
|
||||
int type;
|
||||
int old_type;
|
||||
int32_t *old_state;
|
||||
int degree;
|
||||
int separation;
|
||||
|
||||
if (arg_state == NULL || buf == NULL)
|
||||
goto fail;
|
||||
|
||||
old_type = buf->rand_type;
|
||||
old_state = buf->state;
|
||||
if (old_type == TYPE_0)
|
||||
old_state[-1] = TYPE_0;
|
||||
else
|
||||
old_state[-1] = (MAX_TYPES * (buf->rptr - old_state)) + old_type;
|
||||
|
||||
type = new_state[-1] % MAX_TYPES;
|
||||
if (type < TYPE_0 || type > TYPE_4)
|
||||
goto fail;
|
||||
|
||||
buf->rand_deg = degree = random_poly_info.degrees[type];
|
||||
buf->rand_sep = separation = random_poly_info.seps[type];
|
||||
buf->rand_type = type;
|
||||
|
||||
if (type != TYPE_0)
|
||||
{
|
||||
int rear = new_state[-1] / MAX_TYPES;
|
||||
buf->rptr = &new_state[rear];
|
||||
buf->fptr = &new_state[(rear + separation) % degree];
|
||||
}
|
||||
buf->state = new_state;
|
||||
/* Set end_ptr too. */
|
||||
buf->end_ptr = &new_state[degree];
|
||||
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
__set_errno (EINVAL);
|
||||
return -1;
|
||||
}
|
||||
|
||||
weak_alias (__setstate_r, setstate_r)
|
||||
|
||||
/* If we are using the trivial TYPE_0 R.N.G., just do the old linear
|
||||
congruential bit. Otherwise, we do our fancy trinomial stuff, which is the
|
||||
same in all the other cases due to all the global variables that have been
|
||||
set up. The basic operation is to add the number at the rear pointer into
|
||||
the one at the front pointer. Then both pointers are advanced to the next
|
||||
location cyclically in the table. The value returned is the sum generated,
|
||||
reduced to 31 bits by throwing away the "least random" low bit.
|
||||
Note: The code takes advantage of the fact that both the front and
|
||||
rear pointers can't wrap on the same call by not testing the rear
|
||||
pointer if the front one has wrapped. Returns a 31-bit random number. */
|
||||
|
||||
int
|
||||
__random_r (struct random_data *buf, int32_t *result)
|
||||
{
|
||||
int32_t *state;
|
||||
|
||||
if (buf == NULL || result == NULL)
|
||||
goto fail;
|
||||
|
||||
state = buf->state;
|
||||
|
||||
if (buf->rand_type == TYPE_0)
|
||||
{
|
||||
int32_t val = state[0];
|
||||
val = ((state[0] * 1103515245) + 12345) & 0x7fffffff;
|
||||
state[0] = val;
|
||||
*result = val;
|
||||
}
|
||||
else
|
||||
{
|
||||
int32_t *fptr = buf->fptr;
|
||||
int32_t *rptr = buf->rptr;
|
||||
int32_t *end_ptr = buf->end_ptr;
|
||||
int32_t val;
|
||||
|
||||
val = *fptr += *rptr;
|
||||
/* Chucking least random bit. */
|
||||
*result = (val >> 1) & 0x7fffffff;
|
||||
++fptr;
|
||||
if (fptr >= end_ptr)
|
||||
{
|
||||
fptr = state;
|
||||
++rptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
++rptr;
|
||||
if (rptr >= end_ptr)
|
||||
rptr = state;
|
||||
}
|
||||
buf->fptr = fptr;
|
||||
buf->rptr = rptr;
|
||||
}
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
__set_errno (EINVAL);
|
||||
return -1;
|
||||
}
|
||||
|
||||
weak_alias (__random_r, random_r)
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2001-2002, 2004-2008 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 2001-2002, 2004-2009 Free Software Foundation, Inc.
|
||||
Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood.
|
||||
This file is part of gnulib.
|
||||
|
||||
@ -89,15 +89,6 @@
|
||||
# include <sys/bitypes.h>
|
||||
#endif
|
||||
|
||||
#if ! defined __cplusplus || defined __STDC_CONSTANT_MACROS
|
||||
|
||||
/* Get WCHAR_MIN, WCHAR_MAX. */
|
||||
# if ! (defined WCHAR_MIN && defined WCHAR_MAX)
|
||||
# include <wchar.h>
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
#undef _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
|
||||
|
||||
/* Minimum and maximum values for a integer type under the usual assumption.
|
||||
@ -122,46 +113,58 @@
|
||||
|
||||
#undef int8_t
|
||||
#undef uint8_t
|
||||
#define int8_t signed char
|
||||
#define uint8_t unsigned char
|
||||
typedef signed char gl_int8_t;
|
||||
typedef unsigned char gl_uint8_t;
|
||||
#define int8_t gl_int8_t
|
||||
#define uint8_t gl_uint8_t
|
||||
|
||||
#undef int16_t
|
||||
#undef uint16_t
|
||||
#define int16_t short int
|
||||
#define uint16_t unsigned short int
|
||||
typedef short int gl_int16_t;
|
||||
typedef unsigned short int gl_uint16_t;
|
||||
#define int16_t gl_int16_t
|
||||
#define uint16_t gl_uint16_t
|
||||
|
||||
#undef int32_t
|
||||
#undef uint32_t
|
||||
#define int32_t int
|
||||
#define uint32_t unsigned int
|
||||
typedef int gl_int32_t;
|
||||
typedef unsigned int gl_uint32_t;
|
||||
#define int32_t gl_int32_t
|
||||
#define uint32_t gl_uint32_t
|
||||
|
||||
/* Do not undefine int64_t if gnulib is not being used with 64-bit
|
||||
types, since otherwise it breaks platforms like Tandem/NSK. */
|
||||
#if LONG_MAX >> 31 >> 31 == 1
|
||||
# undef int64_t
|
||||
# define int64_t long int
|
||||
typedef long int gl_int64_t;
|
||||
# define int64_t gl_int64_t
|
||||
# define GL_INT64_T
|
||||
#elif defined _MSC_VER
|
||||
# undef int64_t
|
||||
# define int64_t __int64
|
||||
typedef __int64 gl_int64_t;
|
||||
# define int64_t gl_int64_t
|
||||
# define GL_INT64_T
|
||||
#elif @HAVE_LONG_LONG_INT@
|
||||
# undef int64_t
|
||||
# define int64_t long long int
|
||||
typedef long long int gl_int64_t;
|
||||
# define int64_t gl_int64_t
|
||||
# define GL_INT64_T
|
||||
#endif
|
||||
|
||||
#if ULONG_MAX >> 31 >> 31 >> 1 == 1
|
||||
# undef uint64_t
|
||||
# define uint64_t unsigned long int
|
||||
typedef unsigned long int gl_uint64_t;
|
||||
# define uint64_t gl_uint64_t
|
||||
# define GL_UINT64_T
|
||||
#elif defined _MSC_VER
|
||||
# undef uint64_t
|
||||
# define uint64_t unsigned __int64
|
||||
typedef unsigned __int64 gl_uint64_t;
|
||||
# define uint64_t gl_uint64_t
|
||||
# define GL_UINT64_T
|
||||
#elif @HAVE_UNSIGNED_LONG_LONG_INT@
|
||||
# undef uint64_t
|
||||
# define uint64_t unsigned long long int
|
||||
typedef unsigned long long int gl_uint64_t;
|
||||
# define uint64_t gl_uint64_t
|
||||
# define GL_UINT64_T
|
||||
#endif
|
||||
|
||||
@ -216,12 +219,18 @@
|
||||
#undef uint_fast32_t
|
||||
#undef int_fast64_t
|
||||
#undef uint_fast64_t
|
||||
#define int_fast8_t long int
|
||||
#define uint_fast8_t unsigned int_fast8_t
|
||||
#define int_fast16_t long int
|
||||
#define uint_fast16_t unsigned int_fast16_t
|
||||
#define int_fast32_t long int
|
||||
#define uint_fast32_t unsigned int_fast32_t
|
||||
typedef long int gl_int_fast8_t;
|
||||
typedef unsigned long int gl_uint_fast8_t;
|
||||
typedef long int gl_int_fast16_t;
|
||||
typedef unsigned long int gl_uint_fast16_t;
|
||||
typedef long int gl_int_fast32_t;
|
||||
typedef unsigned long int gl_uint_fast32_t;
|
||||
#define int_fast8_t gl_int_fast8_t
|
||||
#define uint_fast8_t gl_uint_fast8_t
|
||||
#define int_fast16_t gl_int_fast16_t
|
||||
#define uint_fast16_t gl_uint_fast16_t
|
||||
#define int_fast32_t gl_int_fast32_t
|
||||
#define uint_fast32_t gl_uint_fast32_t
|
||||
#ifdef GL_INT64_T
|
||||
# define int_fast64_t int64_t
|
||||
#endif
|
||||
@ -233,8 +242,10 @@
|
||||
|
||||
#undef intptr_t
|
||||
#undef uintptr_t
|
||||
#define intptr_t long int
|
||||
#define uintptr_t unsigned long int
|
||||
typedef long int gl_intptr_t;
|
||||
typedef unsigned long int gl_uintptr_t;
|
||||
#define intptr_t gl_intptr_t
|
||||
#define uintptr_t gl_uintptr_t
|
||||
|
||||
/* 7.18.1.5. Greatest-width integer types */
|
||||
|
||||
@ -243,20 +254,24 @@
|
||||
|
||||
#undef intmax_t
|
||||
#if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
|
||||
# define intmax_t long long int
|
||||
typedef long long int gl_intmax_t;
|
||||
# define intmax_t gl_intmax_t
|
||||
#elif defined GL_INT64_T
|
||||
# define intmax_t int64_t
|
||||
#else
|
||||
# define intmax_t long int
|
||||
typedef long int gl_intmax_t;
|
||||
# define intmax_t gl_intmax_t
|
||||
#endif
|
||||
|
||||
#undef uintmax_t
|
||||
#if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
|
||||
# define uintmax_t unsigned long long int
|
||||
typedef unsigned long long int gl_uintmax_t;
|
||||
# define uintmax_t gl_uintmax_t
|
||||
#elif defined GL_UINT64_T
|
||||
# define uintmax_t uint64_t
|
||||
#else
|
||||
# define uintmax_t unsigned long int
|
||||
typedef unsigned long int gl_uintmax_t;
|
||||
# define uintmax_t gl_uintmax_t
|
||||
#endif
|
||||
|
||||
/* Verify that intmax_t and uintmax_t have the same size. Too much code
|
||||
@ -419,10 +434,20 @@ typedef int _verify_intmax_size[2 * (sizeof (intmax_t) == sizeof (uintmax_t)) -
|
||||
/* ptrdiff_t limits */
|
||||
#undef PTRDIFF_MIN
|
||||
#undef PTRDIFF_MAX
|
||||
#define PTRDIFF_MIN \
|
||||
#if @APPLE_UNIVERSAL_BUILD@
|
||||
# if _LP64
|
||||
# define PTRDIFF_MIN _STDINT_MIN (1, 64, 0l)
|
||||
# define PTRDIFF_MAX _STDINT_MAX (1, 64, 0l)
|
||||
# else
|
||||
# define PTRDIFF_MIN _STDINT_MIN (1, 32, 0)
|
||||
# define PTRDIFF_MAX _STDINT_MAX (1, 32, 0)
|
||||
# endif
|
||||
#else
|
||||
# define PTRDIFF_MIN \
|
||||
_STDINT_MIN (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@)
|
||||
#define PTRDIFF_MAX \
|
||||
# define PTRDIFF_MAX \
|
||||
_STDINT_MAX (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@)
|
||||
#endif
|
||||
|
||||
/* sig_atomic_t limits */
|
||||
#undef SIG_ATOMIC_MIN
|
||||
@ -437,9 +462,26 @@ typedef int _verify_intmax_size[2 * (sizeof (intmax_t) == sizeof (uintmax_t)) -
|
||||
|
||||
/* size_t limit */
|
||||
#undef SIZE_MAX
|
||||
#define SIZE_MAX _STDINT_MAX (0, @BITSIZEOF_SIZE_T@, 0@SIZE_T_SUFFIX@)
|
||||
#if @APPLE_UNIVERSAL_BUILD@
|
||||
# if _LP64
|
||||
# define SIZE_MAX _STDINT_MAX (0, 64, 0ul)
|
||||
# else
|
||||
# define SIZE_MAX _STDINT_MAX (0, 32, 0ul)
|
||||
# endif
|
||||
#else
|
||||
# define SIZE_MAX _STDINT_MAX (0, @BITSIZEOF_SIZE_T@, 0@SIZE_T_SUFFIX@)
|
||||
#endif
|
||||
|
||||
/* wchar_t limits */
|
||||
/* Get WCHAR_MIN, WCHAR_MAX.
|
||||
This include is not on the top, above, because on OSF/1 4.0 we have a sequence of nested
|
||||
includes <wchar.h> -> <stdio.h> -> <getopt.h> -> <stdlib.h>, and the latter includes
|
||||
<stdint.h> and assumes its types are already defined. */
|
||||
#if ! (defined WCHAR_MIN && defined WCHAR_MAX)
|
||||
# define _GL_JUST_INCLUDE_SYSTEM_WCHAR_H
|
||||
# include <wchar.h>
|
||||
# undef _GL_JUST_INCLUDE_SYSTEM_WCHAR_H
|
||||
#endif
|
||||
#undef WCHAR_MIN
|
||||
#undef WCHAR_MAX
|
||||
#define WCHAR_MIN \
|
||||
|
@ -216,6 +216,38 @@ extern int vsprintf (char *str, const char *format, va_list args)
|
||||
vsprintf (b, f, a))
|
||||
#endif
|
||||
|
||||
#if @GNULIB_DPRINTF@
|
||||
# if @REPLACE_DPRINTF@
|
||||
# define dprintf rpl_dprintf
|
||||
# endif
|
||||
# if @REPLACE_DPRINTF@ || !@HAVE_DPRINTF@
|
||||
extern int dprintf (int fd, const char *format, ...)
|
||||
__attribute__ ((__format__ (__printf__, 2, 3)));
|
||||
# endif
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef dprintf
|
||||
# define dprintf(d,f,a) \
|
||||
(GL_LINK_WARNING ("dprintf is unportable - " \
|
||||
"use gnulib module dprintf for portability"), \
|
||||
dprintf (d, f, a))
|
||||
#endif
|
||||
|
||||
#if @GNULIB_VDPRINTF@
|
||||
# if @REPLACE_VDPRINTF@
|
||||
# define vdprintf rpl_vdprintf
|
||||
# endif
|
||||
# if @REPLACE_VDPRINTF@ || !@HAVE_VDPRINTF@
|
||||
extern int vdprintf (int fd, const char *format, va_list args)
|
||||
__attribute__ ((__format__ (__printf__, 2, 0)));
|
||||
# endif
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef vdprintf
|
||||
# define vdprintf(d,f,a) \
|
||||
(GL_LINK_WARNING ("vdprintf is unportable - " \
|
||||
"use gnulib module vdprintf for portability"), \
|
||||
vdprintf (d, f, a))
|
||||
#endif
|
||||
|
||||
#if @GNULIB_VASPRINTF@
|
||||
# if @REPLACE_VASPRINTF@
|
||||
# define asprintf rpl_asprintf
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* A GNU-like <stdlib.h>.
|
||||
|
||||
Copyright (C) 1995, 2001-2004, 2006-2008 Free Software Foundation, Inc.
|
||||
Copyright (C) 1995, 2001-2004, 2006-2009 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
@ -41,6 +41,12 @@
|
||||
# include <sys/loadavg.h>
|
||||
#endif
|
||||
|
||||
/* OSF/1 5.1 declares 'struct random_data' in <random.h>, which is included
|
||||
from <stdlib.h> if _REENTRANT is defined. Include it always. */
|
||||
#if @HAVE_RANDOM_H@
|
||||
# include <random.h>
|
||||
#endif
|
||||
|
||||
#if @GNULIB_RANDOM_R@ || !@HAVE_STRUCT_RANDOM_DATA@
|
||||
# include <stdint.h>
|
||||
#endif
|
||||
|
48
gnulib/lib/stpcpy.c
Normal file
48
gnulib/lib/stpcpy.c
Normal file
@ -0,0 +1,48 @@
|
||||
/* stpcpy.c -- copy a string and return pointer to end of new string
|
||||
Copyright (C) 1992, 1995, 1997-1998, 2006 Free Software Foundation, Inc.
|
||||
|
||||
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||
Bugs can be reported to bug-glibc@prep.ai.mit.edu.
|
||||
|
||||
This program 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 any
|
||||
later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#undef __stpcpy
|
||||
#ifdef _LIBC
|
||||
# undef stpcpy
|
||||
#endif
|
||||
|
||||
#ifndef weak_alias
|
||||
# define __stpcpy stpcpy
|
||||
#endif
|
||||
|
||||
/* Copy SRC to DEST, returning the address of the terminating '\0' in DEST. */
|
||||
char *
|
||||
__stpcpy (char *dest, const char *src)
|
||||
{
|
||||
register char *d = dest;
|
||||
register const char *s = src;
|
||||
|
||||
do
|
||||
*d++ = *s;
|
||||
while (*s++ != '\0');
|
||||
|
||||
return d - 1;
|
||||
}
|
||||
#ifdef weak_alias
|
||||
weak_alias (__stpcpy, stpcpy)
|
||||
#endif
|
@ -1,6 +1,6 @@
|
||||
/* strerror.c --- POSIX compatible system error routine
|
||||
|
||||
Copyright (C) 2007-2008 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007-2009 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
@ -40,94 +40,133 @@
|
||||
char *
|
||||
rpl_strerror (int n)
|
||||
{
|
||||
char const *msg = NULL;
|
||||
/* These error messages are taken from glibc/sysdeps/gnu/errlist.c. */
|
||||
switch (n)
|
||||
{
|
||||
# if GNULIB_defined_ETXTBSY
|
||||
case ETXTBSY:
|
||||
return "Text file busy";
|
||||
msg = "Text file busy";
|
||||
break;
|
||||
# endif
|
||||
|
||||
# if GNULIB_defined_ESOCK /* native Windows platforms */
|
||||
/* EWOULDBLOCK is the same as EAGAIN. */
|
||||
case EINPROGRESS:
|
||||
return "Operation now in progress";
|
||||
msg = "Operation now in progress";
|
||||
break;
|
||||
case EALREADY:
|
||||
return "Operation already in progress";
|
||||
msg = "Operation already in progress";
|
||||
break;
|
||||
case ENOTSOCK:
|
||||
return "Socket operation on non-socket";
|
||||
msg = "Socket operation on non-socket";
|
||||
break;
|
||||
case EDESTADDRREQ:
|
||||
return "Destination address required";
|
||||
msg = "Destination address required";
|
||||
break;
|
||||
case EMSGSIZE:
|
||||
return "Message too long";
|
||||
msg = "Message too long";
|
||||
break;
|
||||
case EPROTOTYPE:
|
||||
return "Protocol wrong type for socket";
|
||||
msg = "Protocol wrong type for socket";
|
||||
break;
|
||||
case ENOPROTOOPT:
|
||||
return "Protocol not available";
|
||||
msg = "Protocol not available";
|
||||
break;
|
||||
case EPROTONOSUPPORT:
|
||||
return "Protocol not supported";
|
||||
msg = "Protocol not supported";
|
||||
break;
|
||||
case ESOCKTNOSUPPORT:
|
||||
return "Socket type not supported";
|
||||
msg = "Socket type not supported";
|
||||
break;
|
||||
case EOPNOTSUPP:
|
||||
return "Operation not supported";
|
||||
msg = "Operation not supported";
|
||||
break;
|
||||
case EPFNOSUPPORT:
|
||||
return "Protocol family not supported";
|
||||
msg = "Protocol family not supported";
|
||||
break;
|
||||
case EAFNOSUPPORT:
|
||||
return "Address family not supported by protocol";
|
||||
msg = "Address family not supported by protocol";
|
||||
break;
|
||||
case EADDRINUSE:
|
||||
return "Address already in use";
|
||||
msg = "Address already in use";
|
||||
break;
|
||||
case EADDRNOTAVAIL:
|
||||
return "Cannot assign requested address";
|
||||
msg = "Cannot assign requested address";
|
||||
break;
|
||||
case ENETDOWN:
|
||||
return "Network is down";
|
||||
msg = "Network is down";
|
||||
break;
|
||||
case ENETUNREACH:
|
||||
return "Network is unreachable";
|
||||
msg = "Network is unreachable";
|
||||
break;
|
||||
case ENETRESET:
|
||||
return "Network dropped connection on reset";
|
||||
msg = "Network dropped connection on reset";
|
||||
break;
|
||||
case ECONNABORTED:
|
||||
return "Software caused connection abort";
|
||||
msg = "Software caused connection abort";
|
||||
break;
|
||||
case ECONNRESET:
|
||||
return "Connection reset by peer";
|
||||
msg = "Connection reset by peer";
|
||||
break;
|
||||
case ENOBUFS:
|
||||
return "No buffer space available";
|
||||
msg = "No buffer space available";
|
||||
break;
|
||||
case EISCONN:
|
||||
return "Transport endpoint is already connected";
|
||||
msg = "Transport endpoint is already connected";
|
||||
break;
|
||||
case ENOTCONN:
|
||||
return "Transport endpoint is not connected";
|
||||
msg = "Transport endpoint is not connected";
|
||||
break;
|
||||
case ESHUTDOWN:
|
||||
return "Cannot send after transport endpoint shutdown";
|
||||
msg = "Cannot send after transport endpoint shutdown";
|
||||
break;
|
||||
case ETOOMANYREFS:
|
||||
return "Too many references: cannot splice";
|
||||
msg = "Too many references: cannot splice";
|
||||
break;
|
||||
case ETIMEDOUT:
|
||||
return "Connection timed out";
|
||||
msg = "Connection timed out";
|
||||
break;
|
||||
case ECONNREFUSED:
|
||||
return "Connection refused";
|
||||
msg = "Connection refused";
|
||||
break;
|
||||
case ELOOP:
|
||||
return "Too many levels of symbolic links";
|
||||
msg = "Too many levels of symbolic links";
|
||||
break;
|
||||
case EHOSTDOWN:
|
||||
return "Host is down";
|
||||
msg = "Host is down";
|
||||
break;
|
||||
case EHOSTUNREACH:
|
||||
return "No route to host";
|
||||
msg = "No route to host";
|
||||
break;
|
||||
case EPROCLIM:
|
||||
return "Too many processes";
|
||||
msg = "Too many processes";
|
||||
break;
|
||||
case EUSERS:
|
||||
return "Too many users";
|
||||
msg = "Too many users";
|
||||
break;
|
||||
case EDQUOT:
|
||||
return "Disk quota exceeded";
|
||||
msg = "Disk quota exceeded";
|
||||
break;
|
||||
case ESTALE:
|
||||
return "Stale NFS file handle";
|
||||
msg = "Stale NFS file handle";
|
||||
break;
|
||||
case EREMOTE:
|
||||
return "Object is remote";
|
||||
msg = "Object is remote";
|
||||
break;
|
||||
# if HAVE_WINSOCK2_H
|
||||
/* WSA_INVALID_HANDLE maps to EBADF */
|
||||
/* WSA_NOT_ENOUGH_MEMORY maps to ENOMEM */
|
||||
/* WSA_INVALID_PARAMETER maps to EINVAL */
|
||||
case WSA_OPERATION_ABORTED:
|
||||
return "Overlapped operation aborted";
|
||||
msg = "Overlapped operation aborted";
|
||||
break;
|
||||
case WSA_IO_INCOMPLETE:
|
||||
return "Overlapped I/O event object not in signaled state";
|
||||
msg = "Overlapped I/O event object not in signaled state";
|
||||
break;
|
||||
case WSA_IO_PENDING:
|
||||
return "Overlapped operations will complete later";
|
||||
msg = "Overlapped operations will complete later";
|
||||
break;
|
||||
/* WSAEINTR maps to EINTR */
|
||||
/* WSAEBADF maps to EBADF */
|
||||
/* WSAEACCES maps to EACCES */
|
||||
@ -172,98 +211,127 @@ rpl_strerror (int n)
|
||||
/* WSAESTALE is ESTALE */
|
||||
/* WSAEREMOTE is EREMOTE */
|
||||
case WSASYSNOTREADY:
|
||||
return "Network subsystem is unavailable";
|
||||
msg = "Network subsystem is unavailable";
|
||||
break;
|
||||
case WSAVERNOTSUPPORTED:
|
||||
return "Winsock.dll version out of range";
|
||||
msg = "Winsock.dll version out of range";
|
||||
break;
|
||||
case WSANOTINITIALISED:
|
||||
return "Successful WSAStartup not yet performed";
|
||||
msg = "Successful WSAStartup not yet performed";
|
||||
break;
|
||||
case WSAEDISCON:
|
||||
return "Graceful shutdown in progress";
|
||||
msg = "Graceful shutdown in progress";
|
||||
break;
|
||||
case WSAENOMORE: case WSA_E_NO_MORE:
|
||||
return "No more results";
|
||||
msg = "No more results";
|
||||
break;
|
||||
case WSAECANCELLED: case WSA_E_CANCELLED:
|
||||
return "Call was canceled";
|
||||
msg = "Call was canceled";
|
||||
break;
|
||||
case WSAEINVALIDPROCTABLE:
|
||||
return "Procedure call table is invalid";
|
||||
msg = "Procedure call table is invalid";
|
||||
break;
|
||||
case WSAEINVALIDPROVIDER:
|
||||
return "Service provider is invalid";
|
||||
msg = "Service provider is invalid";
|
||||
break;
|
||||
case WSAEPROVIDERFAILEDINIT:
|
||||
return "Service provider failed to initialize";
|
||||
msg = "Service provider failed to initialize";
|
||||
break;
|
||||
case WSASYSCALLFAILURE:
|
||||
return "System call failure";
|
||||
msg = "System call failure";
|
||||
break;
|
||||
case WSASERVICE_NOT_FOUND:
|
||||
return "Service not found";
|
||||
msg = "Service not found";
|
||||
break;
|
||||
case WSATYPE_NOT_FOUND:
|
||||
return "Class type not found";
|
||||
msg = "Class type not found";
|
||||
break;
|
||||
case WSAEREFUSED:
|
||||
return "Database query was refused";
|
||||
msg = "Database query was refused";
|
||||
break;
|
||||
case WSAHOST_NOT_FOUND:
|
||||
return "Host not found";
|
||||
msg = "Host not found";
|
||||
break;
|
||||
case WSATRY_AGAIN:
|
||||
return "Nonauthoritative host not found";
|
||||
msg = "Nonauthoritative host not found";
|
||||
break;
|
||||
case WSANO_RECOVERY:
|
||||
return "Nonrecoverable error";
|
||||
msg = "Nonrecoverable error";
|
||||
break;
|
||||
case WSANO_DATA:
|
||||
return "Valid name, no data record of requested type";
|
||||
msg = "Valid name, no data record of requested type";
|
||||
break;
|
||||
/* WSA_QOS_* omitted */
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# if GNULIB_defined_ENOMSG
|
||||
case ENOMSG:
|
||||
return "No message of desired type";
|
||||
msg = "No message of desired type";
|
||||
break;
|
||||
# endif
|
||||
|
||||
# if GNULIB_defined_EIDRM
|
||||
case EIDRM:
|
||||
return "Identifier removed";
|
||||
msg = "Identifier removed";
|
||||
break;
|
||||
# endif
|
||||
|
||||
# if GNULIB_defined_ENOLINK
|
||||
case ENOLINK:
|
||||
return "Link has been severed";
|
||||
msg = "Link has been severed";
|
||||
break;
|
||||
# endif
|
||||
|
||||
# if GNULIB_defined_EPROTO
|
||||
case EPROTO:
|
||||
return "Protocol error";
|
||||
msg = "Protocol error";
|
||||
break;
|
||||
# endif
|
||||
|
||||
# if GNULIB_defined_EMULTIHOP
|
||||
case EMULTIHOP:
|
||||
return "Multihop attempted";
|
||||
msg = "Multihop attempted";
|
||||
break;
|
||||
# endif
|
||||
|
||||
# if GNULIB_defined_EBADMSG
|
||||
case EBADMSG:
|
||||
return "Bad message";
|
||||
msg = "Bad message";
|
||||
break;
|
||||
# endif
|
||||
|
||||
# if GNULIB_defined_EOVERFLOW
|
||||
case EOVERFLOW:
|
||||
return "Value too large for defined data type";
|
||||
msg = "Value too large for defined data type";
|
||||
break;
|
||||
# endif
|
||||
|
||||
# if GNULIB_defined_ENOTSUP
|
||||
case ENOTSUP:
|
||||
return "Not supported";
|
||||
msg = "Not supported";
|
||||
break;
|
||||
# endif
|
||||
|
||||
# if GNULIB_defined_
|
||||
case ECANCELED:
|
||||
return "Operation canceled";
|
||||
msg = "Operation canceled";
|
||||
break;
|
||||
# endif
|
||||
}
|
||||
|
||||
if (msg)
|
||||
return (char *) msg;
|
||||
|
||||
{
|
||||
char *result = strerror (n);
|
||||
|
||||
if (result == NULL || result[0] == '\0')
|
||||
{
|
||||
static char const fmt[] = "Unknown error (%d)";
|
||||
static char mesg[sizeof fmt + INT_STRLEN_BOUND (n)];
|
||||
sprintf (mesg, fmt, n);
|
||||
return mesg;
|
||||
static char msg_buf[sizeof fmt + INT_STRLEN_BOUND (n)];
|
||||
sprintf (msg_buf, fmt, n);
|
||||
return msg_buf;
|
||||
}
|
||||
|
||||
return result;
|
||||
|
@ -1,42 +0,0 @@
|
||||
/* Copyright (C) 1991, 1994, 2000, 2002-2003, 2006 Free Software
|
||||
Foundation, Inc.
|
||||
|
||||
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||
Bugs can be reported to bug-glibc@prep.ai.mit.edu.
|
||||
|
||||
This program 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, or (at your option) any
|
||||
later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
|
||||
#undef strpbrk
|
||||
|
||||
/* Find the first occurrence in S of any character in ACCEPT. */
|
||||
char *
|
||||
strpbrk (const char *s, const char *accept)
|
||||
{
|
||||
while (*s != '\0')
|
||||
{
|
||||
const char *a = accept;
|
||||
while (*a != '\0')
|
||||
if (*a++ == *s)
|
||||
return (char *) s;
|
||||
++s;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
@ -2,16 +2,16 @@
|
||||
Copyright (C) 2008 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3, or (at your option)
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 2.1, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
@ -15,14 +15,28 @@
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#ifndef _GL_SYS_SELECT_H
|
||||
|
||||
#if @HAVE_SYS_SELECT_H@
|
||||
|
||||
# if __GNUC__ >= 3
|
||||
@PRAGMA_SYSTEM_HEADER@
|
||||
# endif
|
||||
|
||||
/* On OSF/1, <sys/types.h> and <sys/time.h> include <sys/select.h>.
|
||||
Simply delegate to the system's header in this case. */
|
||||
#if @HAVE_SYS_SELECT_H@ && defined __osf__ && (defined _SYS_TYPES_H_ && !defined _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TYPES_H) && defined _OSF_SOURCE
|
||||
|
||||
# define _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TYPES_H
|
||||
# @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@
|
||||
|
||||
#elif @HAVE_SYS_SELECT_H@ && defined __osf__ && (defined _SYS_TIME_H_ && !defined _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H) && defined _OSF_SOURCE
|
||||
|
||||
# define _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H
|
||||
# @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@
|
||||
|
||||
#else
|
||||
|
||||
#ifndef _GL_SYS_SELECT_H
|
||||
|
||||
#if @HAVE_SYS_SELECT_H@
|
||||
|
||||
/* On many platforms, <sys/select.h> assumes prior inclusion of
|
||||
<sys/types.h>. */
|
||||
# include <sys/types.h>
|
||||
@ -76,3 +90,4 @@ extern int rpl_select (int, fd_set *, fd_set *, fd_set *, struct timeval *);
|
||||
|
||||
#endif /* _GL_SYS_SELECT_H */
|
||||
#endif /* _GL_SYS_SELECT_H */
|
||||
#endif /* OSF/1 */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Provide a more complete sys/stat header file.
|
||||
Copyright (C) 2005-2008 Free Software Foundation, Inc.
|
||||
Copyright (C) 2005-2009 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
@ -35,6 +35,9 @@
|
||||
|
||||
#ifndef _GL_SYS_STAT_H
|
||||
|
||||
/* Get nlink_t. */
|
||||
#include <sys/types.h>
|
||||
|
||||
/* The include_next requires a split double-inclusion guard. */
|
||||
#@INCLUDE_NEXT@ @NEXT_SYS_STAT_H@
|
||||
|
||||
@ -275,6 +278,12 @@
|
||||
# define S_IRWXUGO (S_IRWXU | S_IRWXG | S_IRWXO)
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#if @GNULIB_LSTAT@
|
||||
# if ! @HAVE_LSTAT@
|
||||
/* mingw does not support symlinks, therefore it does not have lstat. But
|
||||
@ -341,6 +350,12 @@ extern int lchmod (const char *filename, mode_t mode);
|
||||
lchmod (f, m))
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* _GL_SYS_STAT_H */
|
||||
#endif /* _GL_SYS_STAT_H */
|
||||
#endif
|
||||
|
@ -39,6 +39,10 @@
|
||||
# include <time.h>
|
||||
# endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
# if ! @HAVE_STRUCT_TIMEVAL@
|
||||
struct timeval
|
||||
{
|
||||
@ -53,4 +57,8 @@ struct timeval
|
||||
int gettimeofday (struct timeval *restrict, void *restrict);
|
||||
# endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _GL_SYS_TIME_H */
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user