Compare commits
42 Commits
v1.0.1-mai
...
v0.9.12.3
Author | SHA1 | Date | |
---|---|---|---|
|
0595648d96 | ||
|
c385db5994 | ||
|
ffdb640963 | ||
|
2786686eb5 | ||
|
3e7d9e54e9 | ||
|
4dd29d3bdf | ||
|
c430c002dd | ||
|
4616ff521e | ||
|
5adafc831d | ||
|
6c06d86d9a | ||
|
9d4a1af78c | ||
|
c0b4111219 | ||
|
c7f51ff247 | ||
|
73aab23535 | ||
|
3865383450 | ||
|
ea095a4aac | ||
|
2f34eae93a | ||
|
078627104d | ||
|
cbcb1983af | ||
|
6cc4fe2c6b | ||
|
ea877ca7af | ||
|
c50e029f97 | ||
|
89a181053b | ||
|
ffbf1df457 | ||
|
1bcb4c727f | ||
|
ec5190af86 | ||
|
c4f884dfec | ||
|
42010c2861 | ||
|
901af5f469 | ||
|
9b3cc03193 | ||
|
d70ca364d4 | ||
|
9143006c0a | ||
|
1baa2fabad | ||
|
b01c3ae891 | ||
|
3afbdfc3c4 | ||
|
6a3787f98f | ||
|
ba92d4a9ca | ||
|
904fa209ae | ||
|
27977c7b13 | ||
|
16908590de | ||
|
addf5e1b31 | ||
|
11568ec854 |
@@ -14,7 +14,4 @@
|
||||
(nxml-mode . (
|
||||
(indent-tabs-mode . nil)
|
||||
))
|
||||
(perl-mode . (
|
||||
(indent-tabs-mode . nil)
|
||||
))
|
||||
)
|
||||
|
37
.gitignore
vendored
@@ -17,9 +17,7 @@
|
||||
*.rej
|
||||
*.s
|
||||
*~
|
||||
.#*
|
||||
.deps
|
||||
.gdb_history
|
||||
.git
|
||||
.git-module-status
|
||||
.libs
|
||||
@@ -27,7 +25,6 @@
|
||||
.memdump
|
||||
.sc-start-sc_*
|
||||
/ABOUT-NLS
|
||||
/AUTHORS
|
||||
/COPYING
|
||||
/ChangeLog
|
||||
/GNUmakefile
|
||||
@@ -56,16 +53,13 @@
|
||||
/daemon/libvirtd.8.in
|
||||
/daemon/libvirtd.init
|
||||
/daemon/libvirtd.pod
|
||||
/daemon/libvirtd.policy
|
||||
/daemon/libvirtd.service
|
||||
/daemon/test_libvirtd.aug
|
||||
/docs/apibuild.py.stamp
|
||||
/docs/devhelp/libvirt.devhelp
|
||||
/docs/hvsupport.html.in
|
||||
/docs/libvirt-api.xml
|
||||
/docs/libvirt-qemu-*.xml
|
||||
/docs/libvirt-refs.xml
|
||||
/docs/search.php
|
||||
/docs/todo.html.in
|
||||
/examples/domain-events/events-c/event-test
|
||||
/examples/dominfo/info1
|
||||
@@ -85,7 +79,7 @@
|
||||
/ltmain.sh
|
||||
/m4/*
|
||||
/maint.mk
|
||||
/mingw-libvirt.spec
|
||||
/mingw32-libvirt.spec
|
||||
/mkinstalldirs
|
||||
/po/*
|
||||
/proxy/
|
||||
@@ -97,37 +91,22 @@
|
||||
/python/libvirt.[ch]
|
||||
/python/libvirt.py
|
||||
/python/libvirt_qemu.py
|
||||
/run
|
||||
/sc_*
|
||||
/src/.*.stamp
|
||||
/src/esx/*.generated.*
|
||||
/src/hyperv/*.generated.*
|
||||
/src/libvirt*.def
|
||||
/src/libvirt.syms
|
||||
/src/libvirt_*.stp
|
||||
/src/libvirt_*helper
|
||||
/src/libvirt_*probes.h
|
||||
/src/libvirt_lxc
|
||||
/src/locking/lock_daemon_dispatch_stubs.h
|
||||
/src/locking/lock_protocol.[ch]
|
||||
/src/locking/qemu-lockd.conf
|
||||
/src/locking/qemu-sanlock.conf
|
||||
/src/locking/test_libvirt_sanlock.aug
|
||||
/src/lxc/lxc_controller_dispatch.h
|
||||
/src/lxc/lxc_monitor_dispatch.h
|
||||
/src/lxc/lxc_protocol.c
|
||||
/src/lxc/lxc_protocol.h
|
||||
/src/lxc/test_libvirtd_lxc.aug
|
||||
/src/qemu/test_libvirtd_qemu.aug
|
||||
/src/probes.h
|
||||
/src/remote/*_client_bodies.h
|
||||
/src/remote/*_protocol.[ch]
|
||||
/src/rpc/virkeepaliveprotocol.[ch]
|
||||
/src/rpc/virnetprotocol.[ch]
|
||||
/src/test_libvirt*.aug
|
||||
/src/util/virkeymaps.h
|
||||
/src/virt-aa-helper
|
||||
/src/virtlockd
|
||||
/src/virtlockd.init
|
||||
/tests/*.log
|
||||
/tests/*.pid
|
||||
/tests/*xml2*test
|
||||
@@ -150,29 +129,22 @@
|
||||
/tests/openvzutilstest
|
||||
/tests/qemuargv2xmltest
|
||||
/tests/qemuhelptest
|
||||
/tests/qemumonitorjsontest
|
||||
/tests/qemumonitortest
|
||||
/tests/qemuxmlnstest
|
||||
/tests/qparamtest
|
||||
/tests/reconnect
|
||||
/tests/secaatest
|
||||
/tests/seclabeltest
|
||||
/tests/securityselinuxtest
|
||||
/tests/sexpr2xmltest
|
||||
/tests/shunloadtest
|
||||
/tests/sockettest
|
||||
/tests/ssh
|
||||
/tests/statstest
|
||||
/tests/storagebackendsheepdogtest
|
||||
/tests/utiltest
|
||||
/tests/viratomictest
|
||||
/tests/virauthconfigtest
|
||||
/tests/virbitmaptest
|
||||
/tests/virbuftest
|
||||
/tests/virdrivermoduletest
|
||||
/tests/virhashtest
|
||||
/tests/virkeyfiletest
|
||||
/tests/virlockspacetest
|
||||
/tests/virnet*test
|
||||
/tests/virshtest
|
||||
/tests/virstringtest
|
||||
@@ -183,8 +155,6 @@
|
||||
/tests/xmconfigtest
|
||||
/tools/*.[18]
|
||||
/tools/libvirt-guests.init
|
||||
/tools/libvirt-guests.service
|
||||
/tools/libvirt-guests.sh
|
||||
/tools/virsh
|
||||
/tools/virsh-*-edit.c
|
||||
/tools/virt-*-validate
|
||||
@@ -195,14 +165,11 @@ Makefile.in
|
||||
TAGS
|
||||
coverage
|
||||
cscope.files
|
||||
cscope.in.out
|
||||
cscope.out
|
||||
cscope.po.out
|
||||
results.log
|
||||
stamp-h
|
||||
stamp-h.in
|
||||
stamp-h1
|
||||
tags
|
||||
!/gnulib/lib/Makefile.am
|
||||
!/gnulib/tests/Makefile.am
|
||||
!/m4/virt-*.m4
|
||||
|
2
.gnulib
27
.mailmap
@@ -3,6 +3,7 @@
|
||||
# Email consolidation:
|
||||
# <Preferred address in AUTHORS> <other alias used by same author>
|
||||
|
||||
<amy.griffis@hp.com> <aron.griffis@hp.com>
|
||||
<bozzolan@gmail.com> <redshift@gmx.com>
|
||||
<charles_duffy@messageone.com> <charles@dyfis.net>
|
||||
<dfj@redhat.com> <dfj@dfj.bne.redhat.com>
|
||||
@@ -27,32 +28,8 @@
|
||||
<supriyak@linux.vnet.ibm.com> <supriyak@in.ibm.com>
|
||||
<neil@aldur.co.uk> <neil@brightbox.co.uk>
|
||||
<stefanb@us.ibm.com> <stefanb@linux.vnet.ibm.com>
|
||||
<stefanb@us.ibm.com> <stefannb@linux.vnet.ibm.com>
|
||||
<josh.durgin@inktank.com> <joshd@hq.newdream.net>
|
||||
<josh.durgin@inktank.com> <josh.durgin@dreamhost.com>
|
||||
<gerd@egidy.de> <lists@egidy.de>
|
||||
<gerd@egidy.de> <gerd.von.egidy@intra2net.com>
|
||||
<benoar@dolka.fr> <benjamin.cama@telecom-bretagne.eu>
|
||||
<zhlcindy@linux.vnet.ibm.com> <zhlcindy@gmail.com>
|
||||
<serge.hallyn@canonical.com> <serue@us.ibm.com>
|
||||
<pritesh.kothari@sun.com> <Pritesh.Kothari@Sun.COM>
|
||||
<josh.durgin@dreamhost.com> <joshd@hq.newdream.net>
|
||||
|
||||
# Name consolidation:
|
||||
# Preferred author spelling <preferred email>
|
||||
Alex Jia <ajia@redhat.com>
|
||||
Royce Lv <lvroyce@linux.vnet.ibm.com>
|
||||
Daniel J Walsh <dwalsh@redhat.com>
|
||||
Ján Tomko <jtomko@redhat.com>
|
||||
Gerd von Egidy <gerd@egidy.de>
|
||||
MATSUDA Daiki <matsudadik@intellilink.co.jp>
|
||||
Tang Chen <tangchen@cn.fujitsu.com>
|
||||
Peng Zhou <ailvpeng25@gmail.com>
|
||||
Dirk Herrendoerfer <d.herrendoerfer@herrendoerfer.name>
|
||||
Thibault VINCENT <thibault.vincent@smartjog.com>
|
||||
Aurelien Rougemont <beorn@binaries.fr>
|
||||
Serge E. Hallyn <serge.hallyn@canonical.com>
|
||||
Henrik Persson E <henrik.e.persson@ericsson.com>
|
||||
Philipp Hahn <hahn@univention.de>
|
||||
Marco Bozzolan <bozzolan@gmail.com>
|
||||
Marco Bozzolan <redshift@gmx.com>
|
||||
Pritesh Kothari <pritesh.kothari@sun.com>
|
||||
|
247
AUTHORS
Normal file
@@ -0,0 +1,247 @@
|
||||
libvirt Authors
|
||||
===============
|
||||
|
||||
The libvirt project was initiated by:
|
||||
|
||||
Daniel Veillard <veillard@redhat.com> or <daniel@veillard.com>
|
||||
|
||||
The primary maintainers and people with commit access rights:
|
||||
|
||||
Daniel Veillard <veillard@redhat.com>
|
||||
Daniel Berrange <berrange@redhat.com>
|
||||
Richard W.M. Jones <rjones@redhat.com>
|
||||
Mark McLoughlin <markmc@redhat.com>
|
||||
Anthony Liguori <aliguori@us.ibm.com>
|
||||
Jim Meyering <meyering@redhat.com>
|
||||
Jim Fehlig <jfehlig@suse.com>
|
||||
Chris Lalancette <clalance@redhat.com>
|
||||
Cole Robinson <crobinso@redhat.com>
|
||||
Guido Günther <agx@sigxcpu.org>
|
||||
John Levon <john.levon@sun.com>
|
||||
Matthias Bolte <matthias.bolte@googlemail.com>
|
||||
Jiří Denemark <jdenemar@redhat.com>
|
||||
Dave Allan <dallan@redhat.com>
|
||||
Laine Stump <laine@redhat.com>
|
||||
Stefan Berger <stefanb@us.ibm.com>
|
||||
Eric Blake <eblake@redhat.com>
|
||||
Justin Clift <jclift@redhat.com>
|
||||
Osier Yang <jyang@redhat.com>
|
||||
Wen Congyang <wency@cn.fujitsu.com>
|
||||
Michal Prívozník <mprivozn@redhat.com>
|
||||
Peter Krempa <pkrempa@redhat.com>
|
||||
Christophe Fergeau <cfergeau@redhat.com>
|
||||
Alex Jia <ajia@redhat.com>
|
||||
Martin Kletzander <mkletzan@redhat.com>
|
||||
|
||||
Previous maintainers:
|
||||
Karel Zak <kzak@redhat.com>
|
||||
Atsushi SAKAI <sakaia@jp.fujitsu.com>
|
||||
Dave Leskovec <dlesko@linux.vnet.ibm.com>
|
||||
Dan Smith <danms@us.ibm.com>
|
||||
|
||||
Patches have also been contributed by:
|
||||
|
||||
David Lutterkort <dlutter@redhat.com>
|
||||
Andrew Puch <apuch@redhat.com>
|
||||
Philippe Berthault <philippe.berthault@Bull.net>
|
||||
Hugh Brock <hbrock@redhat.com>
|
||||
Michel Ponceau <michel.ponceau@bull.net>
|
||||
Jeremy Katz <katzj@redhat.com>
|
||||
Pete Vetere <pvetere@redhat.com>
|
||||
Kazuki Mizushima <mizushima.kazuk@jp.fujitsu.com>
|
||||
Saori Fukuta <fukuta.saori@jp.fujitsu.com>
|
||||
Tatsuro Enokura <fj7716hz@aa.jp.fujitsu.com>
|
||||
Takahashi Tomohiro <takatom@jp.fujitsu.com>
|
||||
Nobuhiro Itou <fj0873gn@aa.jp.fujitsu.com>
|
||||
Masayuki Sunou <fj1826dm@aa.jp.fujitsu.com>
|
||||
Mark Johnson <johnson.nh@gmail.com>
|
||||
Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
|
||||
Shuveb Hussain <shuveb@binarykarma.com>
|
||||
Jim Paris <jim@jtan.com>
|
||||
Daniel Hokka Zakrisson <daniel@hozac.com>
|
||||
Mads Chr. Olesen <shiyee@shiyee.dk>
|
||||
Anton Protopopov <aspsk2@gmail.com>
|
||||
Stefan de Konink <dekonink@kinkrsoftware.nl>
|
||||
Kaitlin Rupert <kaitlin@linux.vnet.ibm.com>
|
||||
Evgeniy Sokolov <evg@openvz.org>
|
||||
David Lively <dlively@virtualiron.com>
|
||||
Charles Duffy <Charles_Duffy@messageone.com>
|
||||
Nguyen Anh Quynh <aquynh@gmail.com>
|
||||
James Morris <jmorris@namei.org>
|
||||
Chris Wright <chrisw@redhat.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>
|
||||
Markus Armbruster <armbru@redhat.com>
|
||||
Ryota Ozaki <ozaki.ryota@gmail.com>
|
||||
Daniel J Walsh <dwalsh@redhat.com>
|
||||
Maximilian Wilhelm <max@rfc2324.org>
|
||||
Pritesh Kothari <Pritesh.Kothari@Sun.COM>
|
||||
Amit Shah <amit.shah@redhat.com>
|
||||
Florian Vichot <florian.vichot@diateam.net>
|
||||
Serge E. Hallyn <serue@us.ibm.com>
|
||||
Soren Hansen <soren@linux2go.dk>
|
||||
Abel Míguez Rodríguez<amiguezr@pdi.ucm.es>
|
||||
Doug Goldstein <cardoe@cardoe.com>
|
||||
Javier Fontan <jfontan@gmail.com>
|
||||
Federico Simoncelli <fsimonce@redhat.com>
|
||||
Amy Griffis <amy.griffis@hp.com>
|
||||
Henrik Persson E <henrik.e.persson@ericsson.com>
|
||||
Satoru SATOH <satoru.satoh@gmail.com>
|
||||
Paolo Bonzini <pbonzini@redhat.com>
|
||||
Miloslav Trmač <mitr@redhat.com>
|
||||
Jamie Strandboge <jamie@canonical.com>
|
||||
Gerhard Stenzel <gerhard.stenzel@de.ibm.com>
|
||||
Matthew Booth <mbooth@redhat.com>
|
||||
Diego Elio Pettenò <flameeyes@gmail.com>
|
||||
Adam Litke <agl@us.ibm.com>
|
||||
Steve Yarmie <steve.yarmie@gmail.com>
|
||||
Dan Kenigsberg <danken@redhat.com>
|
||||
Yuji NISHIDA <nishidy@nict.go.jp>
|
||||
Dustin Xiong <x_k_123@hotmail.com>
|
||||
Rolf Eike Beer <eike@sf-mail.de>
|
||||
Wolfgang Mauerer <wolfgang.mauerer@siemens.com>
|
||||
Philipp Hahn <hahn@univention.de>
|
||||
Ed Swierk <eswierk@aristanetworks.com>
|
||||
Paolo Smiraglia <paolo.smiraglia@gmail.com>
|
||||
Sharadha Prabhakar <sharadha.prabhakar@citrix.com>
|
||||
Chris Wong <wongc-redhat@hoku.net>
|
||||
Daniel Berteaud <daniel@firewall-services.com>
|
||||
Dustin Kirkland <kirkland@canonical.com>
|
||||
Luiz Capitulino <lcapitulino@redhat.com>
|
||||
Ryan Harper <ryanh@us.ibm.com>
|
||||
Spencer Shimko <sshimko@tresys.com>
|
||||
Marco Bozzolan <bozzolan@gmail.com>
|
||||
Alex Williamson <alex.williamson@redhat.com>
|
||||
Ersek Laszlo <lacos@caesar.elte.hu>
|
||||
Kenneth Nagin <NAGIN@il.ibm.com>
|
||||
Klaus Ethgen <Klaus@Ethgen.de>
|
||||
Bryan Kearney <bkearney@redhat.com>
|
||||
Darry L. Pierce <dpierce@redhat.com>
|
||||
David Jorm <dfj@redhat.com>
|
||||
Eduardo Otubo <otubo@linux.vnet.ibm.com>
|
||||
Garry Dolley <gdolley@arpnetworks.com>
|
||||
Harshavardhana <harsha@gluster.com>
|
||||
Jonas Eriksson <jonas.j.eriksson@ericsson.com>
|
||||
Jun Koi <junkoi2004@gmail.com>
|
||||
Olivier Fourdan <ofourdan@redhat.com>
|
||||
Ron Yorston <rmy@tigress.co.uk>
|
||||
Shahar Klein <shaharklein@yahoo.com>
|
||||
Taizo ITO <taizo.ito@hde.co.jp>
|
||||
Thomas Treutner <thomas@scripty.at>
|
||||
Jean-Baptiste Rouault <jean-baptiste.rouault@diateam.net>
|
||||
Марк Коренберг <socketpair@gmail.com>
|
||||
Alan Pevec <apevec@redhat.com>
|
||||
Aurelien Rougemont <beorn@binaries.fr>
|
||||
Patrick Dignan <pat_dignan@dell.com>
|
||||
Serge Hallyn <serge.hallyn@canonical.com>
|
||||
Nikunj A. Dadhania <nikunj@linux.vnet.ibm.com>
|
||||
Lai Jiangshan <laijs@cn.fujitsu.com>
|
||||
Harsh Prateek Bora <harsh@linux.vnet.ibm.com>
|
||||
John Morrissey <jwm@horde.net>
|
||||
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
|
||||
Hu Tao <hutao@cn.fujitsu.com>
|
||||
Laurent Léonard <laurent@open-minds.org>
|
||||
MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
|
||||
Josh Durgin <josh.durgin@dreamhost.com>
|
||||
Roopa Prabhu <roprabhu@cisco.com>
|
||||
Paweł Krześniak <pawel.krzesniak@gmail.com>
|
||||
Kay Schubert <kayegypt@web.de>
|
||||
Marc-André Lureau <marcandre.lureau@redhat.com>
|
||||
Juerg Haefliger <juerg.haefliger@hp.com>
|
||||
Matthias Dahl <mdvirt@designassembly.de>
|
||||
Niels de Vos <ndevos@redhat.com>
|
||||
Davidlohr Bueso <dave@gnu.org>
|
||||
Alon Levy <alevy@redhat.com>
|
||||
Hero Phương <herophuong93@gmail.com>
|
||||
Zdenek Styblik <stybla@turnovfree.net>
|
||||
Gui Jianfeng <guijianfeng@cn.fujitsu.com>
|
||||
Michal Novotny <minovotn@redhat.com>
|
||||
Markus Groß <gross@univention.de>
|
||||
Phil Petty <phpetty@cisco.com>
|
||||
Taku Izumi <izumi.taku@jp.fujitsu.com>
|
||||
Minoru Usui <usui@mxm.nes.nec.co.jp>
|
||||
Tiziano Mueller <dev-zero@gentoo.org>
|
||||
Thibault VINCENT <thibault.vincent@smartjog.com>
|
||||
Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
|
||||
Jesse Cook <code.crashenx@gmail.com>
|
||||
Alexander Todorov <atodorov@otb.bg>
|
||||
Richard Laager <rlaager@wiktel.com>
|
||||
Mark Wu <dwu@redhat.com>
|
||||
Yufang Zhang <yuzhang@redhat.com>
|
||||
Supriya Kannery <supriyak@linux.vnet.ibm.com>
|
||||
Dirk Herrendoerfer <d.herrendoerfer@herrendoerfer.name>
|
||||
Taisuke Yamada <tai@rakugaki.org>
|
||||
Heath Petersen <HeathPetersen@Kandre.com>
|
||||
Neil Wilson <neil@aldur.co.uk>
|
||||
Ohad Levy <ohadlevy@gmail.com>
|
||||
Michael Chapman <mike@very.puzzling.org>
|
||||
Daniel Gollub <gollub@b1-systems.de>
|
||||
David S. Wang <dwang2@cisco.com>
|
||||
Ruben Kerkhof <ruben@rubenkerkhof.com>
|
||||
Scott Moser <smoser@ubuntu.com>
|
||||
Guannan Ren <gren@redhat.com>
|
||||
John Williams <john.williams@petalogix.com>
|
||||
Michael Santos <michael.santos@gmail.com>
|
||||
Oskari Saarenmaa <os@ohmu.fi>
|
||||
Nan Zhang <nzhang@redhat.com>
|
||||
Wieland Hoffmann <themineo@googlemail.com>
|
||||
Douglas Schilling Landgraf <dougsland@redhat.com>
|
||||
Tom Vijlbrief <tom.vijlbrief@xs4all.nl>
|
||||
Shradha Shah <sshah@solarflare.com>
|
||||
Steve Hodgson <shodgson@solarflare.com>
|
||||
Xu He Jie <xuhj@linux.vnet.ibm.com>
|
||||
Lei Li <lilei@linux.vnet.ibm.com>
|
||||
Matthias Witte <witte@netzquadrat.de>
|
||||
Tang Chen <tangchen@cn.fujitsu.com>
|
||||
Dan Horák <dan@danny.cz>
|
||||
Sage Weil <sage@newdream.net>
|
||||
David L Stevens <dlstevens@us.ibm.com>
|
||||
Tyler Coumbes <coumbes@gmail.com>
|
||||
Wen Ruo Lv <lvroyce@linux.vnet.ibm.com>
|
||||
Patrice LACHANCE <patlachance@gmail.com>
|
||||
Eli Qiao <taget@linux.vnet.ibm.com>
|
||||
Michael Wood <esiotrot@gmail.com>
|
||||
Bharata B Rao <bharata@linux.vnet.ibm.com>
|
||||
Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
|
||||
Chang Liu <lingjiao.lc@taobao.com>
|
||||
Lorin Hochstein <lorin@isi.edu>
|
||||
Christian Franke <nobody@nowhere.ws>
|
||||
Prerna Saxena <prerna@linux.vnet.ibm.com>
|
||||
Michael Ellerman <michael@ellerman.id.au>
|
||||
Rommer <rommer@active.by>
|
||||
Yuri Chornoivan <yurchor@ukr.net>
|
||||
Deepak C Shetty <deepakcs@linux.vnet.ibm.com>
|
||||
Laszlo Ersek <lersek@redhat.com>
|
||||
Zeeshan Ali (Khattak) <zeeshanak@gnome.org>
|
||||
Marcelo Cerri <mhcerri@linux.vnet.ibm.com>
|
||||
Hendrik Schwartke <hendrik@os-t.de>
|
||||
Ansis Atteka <aatteka@nicira.com>
|
||||
Dan Wendlandt <dan@nicira.com>
|
||||
Kyle Mestery <kmestery@cisco.com>
|
||||
Lincoln Myers <lincoln_myers@yahoo.com>
|
||||
Peter Robinson <pbrobinson@gmail.com>
|
||||
Benjamin Cama <benoar@dolka.fr>
|
||||
Duncan Rance <libvirt@dunquino.com>
|
||||
Peng Zhou <ailvpeng25@gmail.com>
|
||||
Li Zhang <zhlcindy@linux.vnet.ibm.com>
|
||||
Stef Walter <stefw@gnome.org>
|
||||
Christian Benvenuti <benve@cisco.com>
|
||||
Ilja Livenson <ilja.livenson@gmail.com>
|
||||
Stefan Bader <stefan.bader@canonical.com>
|
||||
MATSUDA Daiki <matsudadik@intellilink.co.jp>
|
||||
Jan Kiszka <jan.kiszka@siemens.com>
|
||||
Ryan Woodsmall <rwoodsmall@gmail.com>
|
||||
Wido den Hollander <wido@widodh.nl>
|
||||
Eugen Feller <eugen.feller@inria.fr>
|
||||
Dmitry Guryanov <dguryanov@parallels.com>
|
||||
|
||||
[....send patches to get your name here....]
|
||||
|
||||
The libvirt Logo was designed by Diana Fong
|
||||
|
||||
-- End
|
||||
;; Local Variables:
|
||||
;; coding: utf-8
|
||||
;; End:
|
89
AUTHORS.in
@@ -1,89 +0,0 @@
|
||||
libvirt Authors
|
||||
===============
|
||||
|
||||
The libvirt project was initiated by:
|
||||
|
||||
Daniel Veillard <veillard@redhat.com> or <daniel@veillard.com>
|
||||
|
||||
The primary maintainers and people with commit access rights:
|
||||
|
||||
Alex Jia <ajia@redhat.com>
|
||||
Anthony Liguori <aliguori@us.ibm.com>
|
||||
Chris Lalancette <clalance@redhat.com>
|
||||
Christophe Fergeau <cfergeau@redhat.com>
|
||||
Cole Robinson <crobinso@redhat.com>
|
||||
Daniel Berrange <berrange@redhat.com>
|
||||
Daniel Veillard <veillard@redhat.com>
|
||||
Dave Allan <dallan@redhat.com>
|
||||
Doug Goldstein <cardoe@gentoo.org>
|
||||
Eric Blake <eblake@redhat.com>
|
||||
Guido Günther <agx@sigxcpu.org>
|
||||
Jim Fehlig <jfehlig@suse.com>
|
||||
Jim Meyering <meyering@redhat.com>
|
||||
Jiří Denemark <jdenemar@redhat.com>
|
||||
John Levon <john.levon@sun.com>
|
||||
Justin Clift <jclift@redhat.com>
|
||||
Laine Stump <laine@redhat.com>
|
||||
Mark McLoughlin <markmc@redhat.com>
|
||||
Martin Kletzander <mkletzan@redhat.com>
|
||||
Matthias Bolte <matthias.bolte@googlemail.com>
|
||||
Michal Prívozník <mprivozn@redhat.com>
|
||||
Osier Yang <jyang@redhat.com>
|
||||
Peter Krempa <pkrempa@redhat.com>
|
||||
Richard W.M. Jones <rjones@redhat.com>
|
||||
Stefan Berger <stefanb@us.ibm.com>
|
||||
Wen Congyang <wency@cn.fujitsu.com>
|
||||
|
||||
Previous maintainers:
|
||||
|
||||
Atsushi SAKAI <sakaia@jp.fujitsu.com>
|
||||
Dan Smith <danms@us.ibm.com>
|
||||
Dave Leskovec <dlesko@linux.vnet.ibm.com>
|
||||
Karel Zak <kzak@redhat.com>
|
||||
|
||||
Patches have also been contributed by:
|
||||
|
||||
Abel Míguez Rodríguez <amiguezr@pdi.ucm.es>
|
||||
Amit Shah <amit.shah@redhat.com>
|
||||
Andrew Puch <apuch@redhat.com>
|
||||
Anton Protopopov <aspsk2@gmail.com>
|
||||
Ben Guthro <ben.guthro@gmail.com>
|
||||
Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
|
||||
Daniel Hokka Zakrisson <daniel@hozac.com>
|
||||
Dan Wendlandt <dan@nicira.com>
|
||||
David Lively <dlively@virtualiron.com>
|
||||
David Lutterkort <dlutter@redhat.com>
|
||||
Evgeniy Sokolov <evg@openvz.org>
|
||||
Hugh Brock <hbrock@redhat.com>
|
||||
Itamar Heim <iheim@redhat.com>
|
||||
James Morris <jmorris@namei.org>
|
||||
Javier Fontan <jfontan@gmail.com>
|
||||
Jeremy Katz <katzj@redhat.com>
|
||||
Kaitlin Rupert <kaitlin@linux.vnet.ibm.com>
|
||||
Kazuki Mizushima <mizushima.kazuk@jp.fujitsu.com>
|
||||
Mads Chr. Olesen <shiyee@shiyee.dk>
|
||||
Mark Johnson <johnson.nh@gmail.com>
|
||||
Markus Armbruster <armbru@redhat.com>
|
||||
Masayuki Sunou <fj1826dm@aa.jp.fujitsu.com>
|
||||
Matthias Witte <witte@netzquadrat.de>
|
||||
Michel Ponceau <michel.ponceau@bull.net>
|
||||
Nobuhiro Itou <fj0873gn@aa.jp.fujitsu.com>
|
||||
Pete Vetere <pvetere@redhat.com>
|
||||
Philippe Berthault <philippe.berthault@Bull.net>
|
||||
Saori Fukuta <fukuta.saori@jp.fujitsu.com>
|
||||
Shigeki Sakamoto <fj0588di@aa.jp.fujitsu.com>
|
||||
Shuveb Hussain <shuveb@binarykarma.com>
|
||||
Stefan de Konink <dekonink@kinkrsoftware.nl>
|
||||
Takahashi Tomohiro <takatom@jp.fujitsu.com>
|
||||
Tatsuro Enokura <fj7716hz@aa.jp.fujitsu.com>
|
||||
|
||||
#authorslist#
|
||||
|
||||
[....send patches to get your name here....]
|
||||
|
||||
The libvirt logo was designed by Diana Fong
|
||||
|
||||
-- End
|
||||
;; Local Variables:
|
||||
;; coding: utf-8
|
||||
;; End:
|
102
HACKING
@@ -1,6 +1,5 @@
|
||||
-*- buffer-read-only: t -*- vi: set ro:
|
||||
DO NOT EDIT THIS FILE! IT IS GENERATED AUTOMATICALLY
|
||||
from docs/hacking.html.in!
|
||||
DO NOT EDIT THIS FILE! IT IS GENERATED AUTOMATICALLY!
|
||||
|
||||
|
||||
|
||||
@@ -22,61 +21,17 @@ or:
|
||||
|
||||
git diff > libvirt-myfeature.patch
|
||||
|
||||
However, the usual workflow of libvirt developer is:
|
||||
|
||||
git checkout master
|
||||
git pull
|
||||
git checkout -t origin -b workbranch
|
||||
Hack, committing any changes along the way
|
||||
|
||||
Then, when you want to post your patches:
|
||||
|
||||
git pull --rebase
|
||||
(fix any conflicts)
|
||||
git send-email --cover-letter --no-chain-reply-to --annotate \
|
||||
--to=libvir-list@redhat.com master
|
||||
|
||||
(Note that the "git send-email" subcommand may not be in the main git package
|
||||
and using it may require installion of a separate package, for example the
|
||||
"git-email" package in Fedora.) For a single patch you can omit
|
||||
"--cover-letter", but a series of two or more patches needs a cover letter. If
|
||||
you get tired of typing "--to=libvir-list@redhat.com" designation you can set
|
||||
it in git config:
|
||||
|
||||
git config sendemail.to libvir-list@redhat.com
|
||||
|
||||
Please follow this as close as you can, especially the rebase and git
|
||||
send-email part, as it makes life easier for other developers to review your
|
||||
patch set. One should avoid sending patches as attachments, but rather send
|
||||
them in email body along with commit message. If a developer is sending
|
||||
another version of the patch (e.g. to address review comments), he is advised
|
||||
to note differences to previous versions after the "---" line in the patch so
|
||||
that it helps reviewers but doesn't become part of git history. Moreover, such
|
||||
patch needs to be prefixed correctly with "--subject-prefix=PATCHv2" appended
|
||||
to "git send-email" (substitute "v2" with the correct version if needed
|
||||
though).
|
||||
|
||||
|
||||
|
||||
(3) Split large changes into a series of smaller patches, self-contained if
|
||||
possible, with an explanation of each patch and an explanation of how the
|
||||
sequence of patches fits together. Moreover, please keep in mind that it's
|
||||
required to be able to compile cleanly (*including* "make check" and "make
|
||||
syntax-check") after each patch. A feature does not have to work until the end
|
||||
of a series, but intermediate patches must compile and not cause test-suite
|
||||
failures (this is to preserve the usefulness of "git bisect", among other
|
||||
things).
|
||||
|
||||
|
||||
sequence of patches fits together.
|
||||
|
||||
(4) Make sure your patches apply against libvirt GIT. Developers only follow GIT
|
||||
and don't care much about released versions.
|
||||
|
||||
(5) Run the automated tests on your code before submitting any changes. In
|
||||
particular, configure with compile warnings set to -Werror. This is done
|
||||
automatically for a git checkout; from a tarball, use:
|
||||
particular, configure with compile warnings set to -Werror:
|
||||
|
||||
./configure --enable-werror
|
||||
./configure --enable-compile-warnings=error
|
||||
|
||||
and run the tests:
|
||||
|
||||
@@ -179,37 +134,6 @@ otherwise. For example, it is preferable to use "/* */" comments rather than
|
||||
declare them at the beginning of a scope, rather than immediately before use.
|
||||
|
||||
|
||||
Bracket spacing
|
||||
===============
|
||||
The keywords "if", "for", "while", and "switch" must have a single space
|
||||
following them before the opening bracket. eg
|
||||
|
||||
if(foo) // Bad
|
||||
if (foo) // Good
|
||||
|
||||
Function implementations mustnothave any whitespace between the function name and the opening bracket. eg
|
||||
|
||||
int foo (int wizz) // Bad
|
||||
int foo(int wizz) // Good
|
||||
|
||||
Function calls mustnothave any whitespace between the function name and the opening bracket. eg
|
||||
|
||||
bar = foo (wizz); // Bad
|
||||
bar = foo(wizz); // Good
|
||||
|
||||
Function typedefs mustnothave any whitespace between the closing bracket of the function name and
|
||||
opening bracket of the arg list. eg
|
||||
|
||||
typedef int (*foo) (int wizz); // Bad
|
||||
typedef int (*foo)(int wizz); // Good
|
||||
|
||||
There must not be any whitespace immediately following any opening bracket, or
|
||||
immediately prior to any closing bracket
|
||||
|
||||
int foo( int wizz ); // Bad
|
||||
int foo(int wizz); // Good
|
||||
|
||||
|
||||
Curly braces
|
||||
============
|
||||
Omit the curly braces around an "if", "while", "for" etc. body only when that
|
||||
@@ -310,6 +234,11 @@ But if negating a complex condition is too ugly, then at least add braces:
|
||||
|
||||
Preprocessor
|
||||
============
|
||||
Macros defined with an ALL_CAPS name should generally be assumed to be unsafe
|
||||
with regards to arguments with side-effects (that is, MAX(a++, b--) might
|
||||
increment a or decrement b too many or too few times). Exceptions to this rule
|
||||
are explicitly documented for macros in viralloc.h and virstring.h.
|
||||
|
||||
For variadic macros, stick with C99 syntax:
|
||||
|
||||
#define vshPrint(_ctl, ...) fprintf(stdout, __VA_ARGS__)
|
||||
@@ -492,7 +421,7 @@ File handling
|
||||
=============
|
||||
Usage of the "fdopen()", "close()", "fclose()" APIs is deprecated in libvirt
|
||||
code base to help avoiding double-closing of files or file descriptors, which
|
||||
is particularly dangerous in a multi-threaded application. Instead of these
|
||||
is particulary dangerous in a multi-threaded applications. Instead of these
|
||||
APIs, use the macros from virfile.h
|
||||
|
||||
- Open a file from a file descriptor:
|
||||
@@ -611,6 +540,17 @@ sizeof(dest) returns something meaningful). Note that this is a macro, so
|
||||
arguments could be evaluated more than once. This is equivalent to
|
||||
virStrncpy(dest, src, strlen(src), sizeof(dest)).
|
||||
|
||||
VIR_STRDUP(char *dst, const char *src);
|
||||
VIR_STRNDUP(char *dst, const char *src, size_t n);
|
||||
|
||||
You should avoid using strdup or strndup directly as they do not report
|
||||
out-of-memory error, and do not allow a NULL source. Use VIR_STRDUP or
|
||||
VIR_STRNDUP macros instead, which return 0 for NULL source, 1 for successful
|
||||
copy, and -1 for allocation failure with the error already reported. In very
|
||||
specific cases, when you don't want to report the out-of-memory error, you can
|
||||
use VIR_STRDUP_QUIET or VIR_STRNDUP_QUIET, but such usage is very rare and
|
||||
usually considered a flaw.
|
||||
|
||||
|
||||
Variable length string buffer
|
||||
=============================
|
||||
|
27
Makefile.am
@@ -1,6 +1,6 @@
|
||||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
## Copyright (C) 2005-2012 Red Hat, Inc.
|
||||
## Copyright (C) 2005-2011 Red Hat, Inc.
|
||||
## See COPYING.LIB for the License of this software
|
||||
|
||||
LCOV = lcov
|
||||
@@ -20,35 +20,33 @@ XML_EXAMPLES = \
|
||||
EXTRA_DIST = \
|
||||
ChangeLog-old \
|
||||
libvirt.spec libvirt.spec.in \
|
||||
mingw-libvirt.spec.in \
|
||||
mingw32-libvirt.spec.in \
|
||||
libvirt.pc.in \
|
||||
autobuild.sh \
|
||||
Makefile.nonreentrant \
|
||||
autogen.sh \
|
||||
cfg.mk \
|
||||
examples/domain-events/events-python \
|
||||
run.in \
|
||||
AUTHORS.in \
|
||||
$(XML_EXAMPLES)
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = libvirt.pc
|
||||
|
||||
NEWS: $(top_srcdir)/docs/news.xsl $(top_srcdir)/docs/news.html.in
|
||||
$(AM_V_GEN)if [ -x $(XSLTPROC) ] ; then \
|
||||
-@(if [ -x $(XSLTPROC) ] ; then \
|
||||
$(XSLTPROC) --nonet $(top_srcdir)/docs/news.xsl \
|
||||
$(top_srcdir)/docs/news.html.in \
|
||||
| perl -0777 -pe 's/\n\n+$$/\n/' \
|
||||
| perl -pe 's/[ \t]+$$//' \
|
||||
> $@-t && mv $@-t $@ ; fi
|
||||
> $@-t && mv $@-t $@ ; fi );
|
||||
|
||||
$(top_srcdir)/HACKING: $(top_srcdir)/docs/hacking1.xsl $(top_srcdir)/docs/hacking2.xsl \
|
||||
$(top_srcdir)/docs/wrapstring.xsl $(top_srcdir)/docs/hacking.html.in
|
||||
$(AM_V_GEN)if [ -x $(XSLTPROC) ] ; then \
|
||||
-@(if [ -x $(XSLTPROC) ] ; then \
|
||||
$(XSLTPROC) --nonet $(top_srcdir)/docs/hacking1.xsl $(top_srcdir)/docs/hacking.html.in | \
|
||||
$(XSLTPROC) --nonet $(top_srcdir)/docs/hacking2.xsl - \
|
||||
| perl -0777 -pe 's/\n\n+$$/\n/' \
|
||||
> $@-t && mv $@-t $@ ; fi;
|
||||
> $@-t && mv $@-t $@ ; fi );
|
||||
|
||||
rpm: clean
|
||||
@(unset CDPATH ; $(MAKE) dist && rpmbuild -ta $(distdir).tar.gz)
|
||||
@@ -79,25 +77,16 @@ MAINTAINERCLEANFILES = .git-module-status
|
||||
# disable this check
|
||||
distuninstallcheck:
|
||||
|
||||
dist-hook: gen-ChangeLog gen-AUTHORS
|
||||
dist-hook: gen-ChangeLog
|
||||
|
||||
# Generate the ChangeLog file (with all entries since the switch to git)
|
||||
# and insert it into the directory we're about to use to create a tarball.
|
||||
gen_start_date = 2009-07-04
|
||||
.PHONY: gen-ChangeLog
|
||||
gen-ChangeLog:
|
||||
$(AM_V_GEN)if test -d .git; then \
|
||||
if test -d .git; then \
|
||||
$(top_srcdir)/build-aux/gitlog-to-changelog \
|
||||
--since=$(gen_start_date) > $(distdir)/cl-t; \
|
||||
rm -f $(distdir)/ChangeLog; \
|
||||
mv $(distdir)/cl-t $(distdir)/ChangeLog; \
|
||||
fi
|
||||
|
||||
.PHONY: gen-AUTHORS
|
||||
gen-AUTHORS:
|
||||
$(AM_V_GEN)if test -d .git; then \
|
||||
out="`git log --pretty=format:'%aN <%aE>' | sort -u`" && \
|
||||
cat $(srcdir)/AUTHORS.in | perl -p -e "s/#authorslist#/$$out/" > \
|
||||
$(distdir)/AUTHORS-tmp && \
|
||||
mv -f $(distdir)/AUTHORS-tmp $(distdir)/AUTHORS ; \
|
||||
fi
|
||||
|
46
autobuild.sh
@@ -50,30 +50,30 @@ test -x /usr/bin/lcov && make cov
|
||||
rm -f *.tar.gz
|
||||
make dist
|
||||
|
||||
if test -n "$AUTOBUILD_COUNTER" ; then
|
||||
if [ -n "$AUTOBUILD_COUNTER" ]; then
|
||||
EXTRA_RELEASE=".auto$AUTOBUILD_COUNTER"
|
||||
else
|
||||
NOW=`date +"%s"`
|
||||
EXTRA_RELEASE=".$USER$NOW"
|
||||
fi
|
||||
|
||||
if test -f /usr/bin/rpmbuild ; then
|
||||
if [ -f /usr/bin/rpmbuild ]; then
|
||||
rpmbuild --nodeps \
|
||||
--define "extra_release $EXTRA_RELEASE" \
|
||||
--define "_sourcedir `pwd`" \
|
||||
-ba --clean libvirt.spec
|
||||
fi
|
||||
|
||||
# Test mingw32 cross-compile
|
||||
if test -x /usr/bin/i686-w64-mingw32-gcc ; then
|
||||
# Test mingw cross-compile
|
||||
if [ -x /usr/bin/i686-pc-mingw32-gcc ]; then
|
||||
make distclean
|
||||
|
||||
PKG_CONFIG_PATH="$AUTOBUILD_INSTALL_ROOT/i686-w64-mingw32/sys-root/mingw/lib/pkgconfig" \
|
||||
CC="i686-w64-mingw32-gcc" \
|
||||
PKG_CONFIG_PATH="$AUTOBUILD_INSTALL_ROOT/i686-pc-mingw32/sys-root/mingw/lib/pkgconfig" \
|
||||
CC="i686-pc-mingw32-gcc" \
|
||||
../configure \
|
||||
--build=$(uname -m)-w64-linux \
|
||||
--host=i686-w64-mingw32 \
|
||||
--prefix="$AUTOBUILD_INSTALL_ROOT/i686-w64-mingw32/sys-root/mingw" \
|
||||
--build=$(uname -m)-pc-linux \
|
||||
--host=i686-pc-mingw32 \
|
||||
--prefix="$AUTOBUILD_INSTALL_ROOT/i686-pc-mingw32/sys-root/mingw" \
|
||||
--enable-werror \
|
||||
--without-libvirtd \
|
||||
--without-python
|
||||
@@ -81,33 +81,13 @@ if test -x /usr/bin/i686-w64-mingw32-gcc ; then
|
||||
make
|
||||
make install
|
||||
|
||||
fi
|
||||
#set -o pipefail
|
||||
#make check 2>&1 | tee "$RESULTS"
|
||||
|
||||
# Test mingw64 cross-compile
|
||||
if test -x /usr/bin/x86_64-w64-mingw32-gcc ; then
|
||||
make distclean
|
||||
|
||||
PKG_CONFIG_PATH="$AUTOBUILD_INSTALL_ROOT/x86_64-w64-mingw32/sys-root/mingw/lib/pkgconfig" \
|
||||
CC="x86_64-w64-mingw32-gcc" \
|
||||
../configure \
|
||||
--build=$(uname -m)-w64-linux \
|
||||
--host=x86_64-w64-mingw32 \
|
||||
--prefix="$AUTOBUILD_INSTALL_ROOT/x86_64-w64-mingw32/sys-root/mingw" \
|
||||
--enable-werror \
|
||||
--without-libvirtd \
|
||||
--without-python
|
||||
|
||||
make
|
||||
make install
|
||||
|
||||
fi
|
||||
|
||||
|
||||
if test -x /usr/bin/i686-w64-mingw32-gcc && test -x /usr/bin/x86_64-w64-mingw32-gcc ; then
|
||||
if test -f /usr/bin/rpmbuild ; then
|
||||
if [ -f /usr/bin/rpmbuild ]; then
|
||||
rpmbuild --nodeps \
|
||||
--define "extra_release $EXTRA_RELEASE" \
|
||||
--define "_sourcedir `pwd`" \
|
||||
-ba --clean mingw-libvirt.spec
|
||||
-ba --clean mingw32-libvirt.spec
|
||||
fi
|
||||
fi
|
||||
|
32
autogen.sh
@@ -1,8 +1,6 @@
|
||||
#!/bin/sh
|
||||
# Run this to generate all the initial makefiles, etc.
|
||||
|
||||
set -e
|
||||
|
||||
srcdir=`dirname "$0"`
|
||||
test -z "$srcdir" && srcdir=.
|
||||
|
||||
@@ -21,8 +19,7 @@ if test "x$1" = "x--no-git"; then
|
||||
no_git=" $1"
|
||||
shift
|
||||
fi
|
||||
if test -z "$NOCONFIGURE" ; then
|
||||
if test "x$1" = "x--system"; then
|
||||
if test "x$1" = "x--system"; then
|
||||
shift
|
||||
prefix=/usr
|
||||
libdir=$prefix/lib
|
||||
@@ -33,12 +30,11 @@ if test -z "$NOCONFIGURE" ; then
|
||||
fi
|
||||
EXTRA_ARGS="--prefix=$prefix --sysconfdir=$sysconfdir --localstatedir=$localstatedir --libdir=$libdir"
|
||||
echo "Running ./configure with $EXTRA_ARGS $@"
|
||||
else
|
||||
else
|
||||
if test -z "$*" && test ! -f "$THEDIR/config.status"; then
|
||||
echo "I am going to run ./configure with no arguments - if you wish "
|
||||
echo "to pass any to it, please specify them on the $0 command line."
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# Compute the hash we'll use to determine whether rerunning bootstrap
|
||||
@@ -61,35 +57,19 @@ bootstrap_hash()
|
||||
# the required file po/Makevars.
|
||||
# Only run bootstrap from a git checkout, never from a tarball.
|
||||
if test -d .git; then
|
||||
curr_status=.git-module-status t=
|
||||
if test -d .gnulib; then
|
||||
t=$(bootstrap_hash; git diff .gnulib)
|
||||
fi
|
||||
case $t:${CLEAN_SUBMODULE+set} in
|
||||
*:set) ;;
|
||||
*-dirty*)
|
||||
echo "error: gnulib submodule is dirty, please investigate" 2>&1
|
||||
echo "set env-var CLEAN_SUBMODULE to discard gnulib changes" 2>&1
|
||||
exit 1 ;;
|
||||
esac
|
||||
# Keep this test in sync with cfg.mk:_update_required
|
||||
curr_status=.git-module-status
|
||||
t=$(bootstrap_hash; git diff .gnulib)
|
||||
if test "$t" = "$(cat $curr_status 2>/dev/null)" \
|
||||
&& test -f "po/Makevars" && test -f AUTHORS; then
|
||||
&& test -f "po/Makevars"; then
|
||||
# good, it's up to date, all we need is autoreconf
|
||||
autoreconf -if
|
||||
else
|
||||
if test ${CLEAN_SUBMODULE+set}; then
|
||||
echo cleaning up submodules...
|
||||
git submodule foreach 'git clean -dfqx && git reset --hard'
|
||||
fi
|
||||
echo running bootstrap$no_git...
|
||||
./bootstrap$no_git --bootstrap-sync && bootstrap_hash > $curr_status \
|
||||
|| { echo "Failed to bootstrap, please investigate."; exit 1; }
|
||||
fi
|
||||
fi
|
||||
|
||||
test -n "$NOCONFIGURE" && exit 0
|
||||
|
||||
cd "$THEDIR"
|
||||
|
||||
if test "x$OBJ_DIR" != x; then
|
||||
@@ -97,7 +77,7 @@ if test "x$OBJ_DIR" != x; then
|
||||
cd "$OBJ_DIR"
|
||||
fi
|
||||
|
||||
if test -z "$*" && test -z "$EXTRA_ARGS" && test -f config.status; then
|
||||
if test -z "$*" && test -f config.status; then
|
||||
./config.status --recheck
|
||||
else
|
||||
$srcdir/configure $EXTRA_ARGS "$@"
|
||||
|
265
bootstrap
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
# Print a version string.
|
||||
scriptversion=2012-07-19.14; # UTC
|
||||
scriptversion=2012-04-25.17; # UTC
|
||||
|
||||
# Bootstrap this package from checked-out sources.
|
||||
|
||||
@@ -77,33 +77,6 @@ Running without arguments will suffice in most cases.
|
||||
EOF
|
||||
}
|
||||
|
||||
# warnf_ FORMAT-STRING ARG1...
|
||||
warnf_ ()
|
||||
{
|
||||
warnf_format_=$1
|
||||
shift
|
||||
nl='
|
||||
'
|
||||
case $* in
|
||||
*$nl*) me_=$(printf "$me"|tr "$nl|" '??')
|
||||
printf "$warnf_format_" "$@" | sed "s|^|$me_: |" ;;
|
||||
*) printf "$me: $warnf_format_" "$@" ;;
|
||||
esac >&2
|
||||
}
|
||||
|
||||
# warn_ WORD1...
|
||||
warn_ ()
|
||||
{
|
||||
# If IFS does not start with ' ', set it and emit the warning in a subshell.
|
||||
case $IFS in
|
||||
' '*) warnf_ '%s\n' "$*";;
|
||||
*) (IFS=' '; warn_ "$@");;
|
||||
esac
|
||||
}
|
||||
|
||||
# die WORD1...
|
||||
die() { warn_ "$@"; exit 1; }
|
||||
|
||||
# Configuration.
|
||||
|
||||
# Name of the Makefile.am
|
||||
@@ -157,8 +130,7 @@ extract_package_name='
|
||||
p
|
||||
}
|
||||
'
|
||||
package=$(sed -n "$extract_package_name" configure.ac) \
|
||||
|| die 'cannot find package name in configure.ac'
|
||||
package=`sed -n "$extract_package_name" configure.ac` || exit
|
||||
gnulib_name=lib$package
|
||||
|
||||
build_aux=build-aux
|
||||
@@ -214,8 +186,6 @@ use_git=true
|
||||
# otherwise find the first of the NAMES that can be run (i.e.,
|
||||
# supports --version). If found, set ENVVAR to the program name,
|
||||
# die otherwise.
|
||||
#
|
||||
# FIXME: code duplication, see also gnu-web-doc-update.
|
||||
find_tool ()
|
||||
{
|
||||
find_tool_envvar=$1
|
||||
@@ -233,15 +203,19 @@ find_tool ()
|
||||
else
|
||||
find_tool_error_prefix="\$$find_tool_envvar: "
|
||||
fi
|
||||
test x"$find_tool_res" != x \
|
||||
|| die "one of these is required: $find_tool_names"
|
||||
($find_tool_res --version </dev/null) >/dev/null 2>&1 \
|
||||
|| die "${find_tool_error_prefix}cannot run $find_tool_res --version"
|
||||
if test x"$find_tool_res" = x; then
|
||||
echo >&2 "$me: one of these is required: $find_tool_names"
|
||||
exit 1
|
||||
fi
|
||||
($find_tool_res --version </dev/null) >/dev/null 2>&1 || {
|
||||
echo >&2 "$me: ${find_tool_error_prefix}cannot run $find_tool_res --version"
|
||||
exit 1
|
||||
}
|
||||
eval "$find_tool_envvar=\$find_tool_res"
|
||||
eval "export $find_tool_envvar"
|
||||
}
|
||||
|
||||
# Find sha1sum, named gsha1sum on MacPorts, and shasum on Mac OS X 10.6.
|
||||
# Find sha1sum, named gsha1sum on MacPorts, and shasum on MacOS 10.6.
|
||||
find_tool SHA1SUM sha1sum gsha1sum shasum
|
||||
|
||||
# Override the default configuration, if necessary.
|
||||
@@ -256,6 +230,7 @@ esac
|
||||
test -z "${gnulib_extra_files}" && \
|
||||
gnulib_extra_files="
|
||||
$build_aux/install-sh
|
||||
$build_aux/missing
|
||||
$build_aux/mdate-sh
|
||||
$build_aux/texinfo.tex
|
||||
$build_aux/depcomp
|
||||
@@ -281,7 +256,7 @@ do
|
||||
usage
|
||||
exit;;
|
||||
--gnulib-srcdir=*)
|
||||
GNULIB_SRCDIR=${option#--gnulib-srcdir=};;
|
||||
GNULIB_SRCDIR=`expr "X$option" : 'X--gnulib-srcdir=\(.*\)'`;;
|
||||
--skip-po)
|
||||
SKIP_PO=t;;
|
||||
--force)
|
||||
@@ -295,15 +270,21 @@ do
|
||||
--no-git)
|
||||
use_git=false;;
|
||||
*)
|
||||
die "$option: unknown option";;
|
||||
echo >&2 "$0: $option: unknown option"
|
||||
exit 1;;
|
||||
esac
|
||||
done
|
||||
|
||||
$use_git || test -d "$GNULIB_SRCDIR" \
|
||||
|| die "Error: --no-git requires --gnulib-srcdir"
|
||||
if $use_git || test -d "$GNULIB_SRCDIR"; then
|
||||
:
|
||||
else
|
||||
echo "$0: Error: --no-git requires --gnulib-srcdir" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test -n "$checkout_only_file" && test ! -r "$checkout_only_file"; then
|
||||
die "Bootstrapping from a non-checked-out distribution is risky."
|
||||
echo "$0: Bootstrapping from a non-checked-out distribution is risky." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Ensure that lines starting with ! sort last, per gitignore conventions
|
||||
@@ -326,10 +307,10 @@ insert_sorted_if_absent() {
|
||||
file=$1
|
||||
str=$2
|
||||
test -f $file || touch $file
|
||||
echo "$str" | sort_patterns - $file | cmp -s - $file > /dev/null \
|
||||
echo "$str" | sort_patterns - $file | cmp - $file > /dev/null \
|
||||
|| { echo "$str" | sort_patterns - $file > $file.bak \
|
||||
&& mv $file.bak $file; } \
|
||||
|| die "insert_sorted_if_absent $file $str: failed"
|
||||
|| exit 1
|
||||
}
|
||||
|
||||
# Adjust $PATTERN for $VC_IGNORE_FILE and insert it with
|
||||
@@ -342,7 +323,7 @@ insert_vc_ignore() {
|
||||
# A .gitignore entry that does not start with '/' applies
|
||||
# recursively to subdirectories, so prepend '/' to every
|
||||
# .gitignore entry.
|
||||
pattern=$(echo "$pattern" | sed s,^,/,);;
|
||||
pattern=`echo "$pattern" | sed s,^,/,`;;
|
||||
esac
|
||||
insert_sorted_if_absent "$vc_ignore_file" "$pattern"
|
||||
}
|
||||
@@ -353,8 +334,11 @@ grep '^[ ]*AC_CONFIG_AUX_DIR(\['"$build_aux"'\])' configure.ac \
|
||||
>/dev/null && found_aux_dir=yes
|
||||
grep '^[ ]*AC_CONFIG_AUX_DIR('"$build_aux"')' configure.ac \
|
||||
>/dev/null && found_aux_dir=yes
|
||||
test $found_aux_dir = yes \
|
||||
|| die "configure.ac lacks 'AC_CONFIG_AUX_DIR([$build_aux])'; add it"
|
||||
if test $found_aux_dir = no; then
|
||||
echo "$0: expected line not found in configure.ac. Add the following:" >&2
|
||||
echo " AC_CONFIG_AUX_DIR([$build_aux])" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# If $build_aux doesn't exist, create it now, otherwise some bits
|
||||
# below will malfunction. If creating it, also mark it as ignored.
|
||||
@@ -443,48 +427,31 @@ check_versions() {
|
||||
$use_git || continue
|
||||
fi
|
||||
# Honor $APP variables ($TAR, $AUTOCONF, etc.)
|
||||
appvar=$(echo $app | LC_ALL=C tr '[a-z]-' '[A-Z]_')
|
||||
appvar=`echo $app | LC_ALL=C tr '[a-z]-' '[A-Z]_'`
|
||||
test "$appvar" = TAR && appvar=AMTAR
|
||||
case $appvar in
|
||||
GZIP) ;; # Do not use $GZIP: it contains gzip options.
|
||||
*) eval "app=\${$appvar-$app}" ;;
|
||||
esac
|
||||
|
||||
# Handle the still-experimental Automake-NG programs specially.
|
||||
# They remain named as the mainstream Automake programs ("automake",
|
||||
# and "aclocal") to avoid gratuitous incompatibilities with
|
||||
# pre-existing usages (by, say, autoreconf, or custom autogen.sh
|
||||
# scripts), but correctly identify themselves (as being part of
|
||||
# "GNU automake-ng") when asked their version.
|
||||
case $app in
|
||||
automake-ng|aclocal-ng)
|
||||
app=${app%-ng}
|
||||
($app --version | grep '(GNU automake-ng)') >/dev/null 2>&1 || {
|
||||
warn_ "Error: '$app' not found or not from Automake-NG"
|
||||
ret=1
|
||||
continue
|
||||
} ;;
|
||||
esac
|
||||
if [ "$req_ver" = "-" ]; then
|
||||
# Merely require app to exist; not all prereq apps are well-behaved
|
||||
# so we have to rely on $? rather than get_version.
|
||||
$app --version >/dev/null 2>&1
|
||||
if [ 126 -le $? ]; then
|
||||
warn_ "Error: '$app' not found"
|
||||
echo "$me: Error: '$app' not found" >&2
|
||||
ret=1
|
||||
fi
|
||||
else
|
||||
# Require app to produce a new enough version string.
|
||||
inst_ver=$(get_version $app)
|
||||
if [ ! "$inst_ver" ]; then
|
||||
warn_ "Error: '$app' not found"
|
||||
echo "$me: Error: '$app' not found" >&2
|
||||
ret=1
|
||||
else
|
||||
latest_ver=$(sort_ver $req_ver $inst_ver | cut -d' ' -f2)
|
||||
if [ ! "$latest_ver" = "$inst_ver" ]; then
|
||||
warnf_ '%s\n' \
|
||||
"Error: '$app' version == $inst_ver is too old" \
|
||||
" '$app' version >= $req_ver is required"
|
||||
echo "$me: Error: '$app' version == $inst_ver is too old" >&2
|
||||
echo " '$app' version >= $req_ver is required" >&2
|
||||
ret=1
|
||||
fi
|
||||
fi
|
||||
@@ -529,8 +496,10 @@ esac
|
||||
|
||||
# When we can deduce that gnulib-tool will require patch,
|
||||
# and when patch is not already listed as a prerequisite, add it, too.
|
||||
if test -d "$local_gl_dir" \
|
||||
&& ! find "$local_gl_dir" -name '*.diff' -exec false {} +; then
|
||||
if test ! -d "$local_gl_dir" \
|
||||
|| find "$local_gl_dir" -name '*.diff' -exec false {} +; then
|
||||
:
|
||||
else
|
||||
case $buildreq in
|
||||
*patch*) ;;
|
||||
*) buildreq="patch -
|
||||
@@ -541,10 +510,11 @@ fi
|
||||
if ! printf "$buildreq" | check_versions; then
|
||||
echo >&2
|
||||
if test -f README-prereq; then
|
||||
die "See README-prereq for how to get the prerequisite programs"
|
||||
echo "$0: See README-prereq for how to get the prerequisite programs" >&2
|
||||
else
|
||||
die "Please install the prerequisite programs"
|
||||
echo "$0: Please install the prerequisite programs" >&2
|
||||
fi
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "$0: Bootstrapping from checked-out $package sources..."
|
||||
@@ -573,7 +543,7 @@ git_modules_config () {
|
||||
test -f .gitmodules && git config --file .gitmodules "$@"
|
||||
}
|
||||
|
||||
gnulib_path=$(git_modules_config submodule.gnulib.path)
|
||||
gnulib_path=`git_modules_config submodule.gnulib.path`
|
||||
test -z "$gnulib_path" && gnulib_path=gnulib
|
||||
|
||||
# Get gnulib files.
|
||||
@@ -646,10 +616,10 @@ download_po_files() {
|
||||
subdir=$1
|
||||
domain=$2
|
||||
echo "$me: getting translations into $subdir for $domain..."
|
||||
cmd=$(printf "$po_download_command_format" "$domain" "$subdir")
|
||||
cmd=`printf "$po_download_command_format" "$domain" "$subdir"`
|
||||
eval "$cmd" && return
|
||||
# Fallback to HTTP.
|
||||
cmd=$(printf "$po_download_command_format2" "$subdir" "$domain")
|
||||
cmd=`printf "$po_download_command_format2" "$subdir" "$domain"`
|
||||
eval "$cmd"
|
||||
}
|
||||
|
||||
@@ -672,7 +642,7 @@ update_po_files() {
|
||||
&& ls "$ref_po_dir"/*.po 2>/dev/null |
|
||||
sed 's|.*/||; s|\.po$||' > "$po_dir/LINGUAS" || return
|
||||
|
||||
langs=$(cd $ref_po_dir && echo *.po | sed 's/\.po//g')
|
||||
langs=`cd $ref_po_dir && echo *.po|sed 's/\.po//g'`
|
||||
test "$langs" = '*' && langs=x
|
||||
for po in $langs; do
|
||||
case $po in x) continue;; esac
|
||||
@@ -709,18 +679,18 @@ symlink_to_dir()
|
||||
|
||||
# If the destination directory doesn't exist, create it.
|
||||
# This is required at least for "lib/uniwidth/cjk.h".
|
||||
dst_dir=$(dirname "$dst")
|
||||
dst_dir=`dirname "$dst"`
|
||||
if ! test -d "$dst_dir"; then
|
||||
mkdir -p "$dst_dir"
|
||||
|
||||
# If we've just created a directory like lib/uniwidth,
|
||||
# tell version control system(s) it's ignorable.
|
||||
# FIXME: for now, this does only one level
|
||||
parent=$(dirname "$dst_dir")
|
||||
parent=`dirname "$dst_dir"`
|
||||
for dot_ig in x $vc_ignore; do
|
||||
test $dot_ig = x && continue
|
||||
ig=$parent/$dot_ig
|
||||
insert_vc_ignore $ig "${dst_dir##*/}"
|
||||
insert_vc_ignore $ig `echo "$dst_dir"|sed 's,.*/,,'`
|
||||
done
|
||||
fi
|
||||
|
||||
@@ -744,10 +714,10 @@ symlink_to_dir()
|
||||
# so that broken tools aren't confused into skipping needed builds. See
|
||||
# <http://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00326.html>.
|
||||
test -h "$dst" &&
|
||||
src_ls=$(ls -diL "$src" 2>/dev/null) && set $src_ls && src_i=$1 &&
|
||||
dst_ls=$(ls -diL "$dst" 2>/dev/null) && set $dst_ls && dst_i=$1 &&
|
||||
src_ls=`ls -diL "$src" 2>/dev/null` && set $src_ls && src_i=$1 &&
|
||||
dst_ls=`ls -diL "$dst" 2>/dev/null` && set $dst_ls && dst_i=$1 &&
|
||||
test "$src_i" = "$dst_i" &&
|
||||
both_ls=$(ls -dt "$src" "$dst") &&
|
||||
both_ls=`ls -dt "$src" "$dst"` &&
|
||||
test "X$both_ls" = "X$dst$nl$src" || {
|
||||
dot_dots=
|
||||
case $src in
|
||||
@@ -755,10 +725,11 @@ symlink_to_dir()
|
||||
*)
|
||||
case /$dst/ in
|
||||
*//* | */../* | */./* | /*/*/*/*/*/)
|
||||
die "invalid symlink calculation: $src -> $dst";;
|
||||
/*/*/*/*/) dot_dots=../../../;;
|
||||
/*/*/*/) dot_dots=../../;;
|
||||
/*/*/) dot_dots=../;;
|
||||
echo >&2 "$me: invalid symlink calculation: $src -> $dst"
|
||||
exit 1;;
|
||||
/*/*/*/*/) dot_dots=../../../;;
|
||||
/*/*/*/) dot_dots=../../;;
|
||||
/*/*/) dot_dots=../;;
|
||||
esac;;
|
||||
esac
|
||||
|
||||
@@ -769,22 +740,6 @@ symlink_to_dir()
|
||||
}
|
||||
}
|
||||
|
||||
version_controlled_file() {
|
||||
parent=$1
|
||||
file=$2
|
||||
if test -d .git; then
|
||||
git rm -n "$file" > /dev/null 2>&1
|
||||
elif test -d .svn; then
|
||||
svn log -r HEAD "$file" > /dev/null 2>&1
|
||||
elif test -d CVS; then
|
||||
grep -F "/${file##*/}/" "$parent/CVS/Entries" 2>/dev/null |
|
||||
grep '^/[^/]*/[0-9]' > /dev/null
|
||||
else
|
||||
warn_ "no version control for $file?"
|
||||
false
|
||||
fi
|
||||
}
|
||||
|
||||
# NOTE: we have to be careful to run both autopoint and libtoolize
|
||||
# before gnulib-tool, since gnulib-tool is likely to provide newer
|
||||
# versions of files "installed" by these two programs.
|
||||
@@ -797,55 +752,44 @@ with_gettext=yes
|
||||
grep '^[ ]*AM_GNU_GETTEXT_VERSION(' configure.ac >/dev/null || \
|
||||
with_gettext=no
|
||||
|
||||
if test $with_gettext = yes || test $use_libtool = 1; then
|
||||
|
||||
tempbase=.bootstrap$$
|
||||
trap "rm -f $tempbase.0 $tempbase.1" 1 2 13 15
|
||||
|
||||
> $tempbase.0 > $tempbase.1 &&
|
||||
find . ! -type d -print | sort > $tempbase.0 || exit
|
||||
|
||||
if test $with_gettext = yes; then
|
||||
# Released autopoint has the tendency to install macros that have been
|
||||
# obsoleted in current gnulib, so run this before gnulib-tool.
|
||||
echo "$0: $AUTOPOINT --force"
|
||||
$AUTOPOINT --force || exit
|
||||
fi
|
||||
|
||||
# Autoreconf runs aclocal before libtoolize, which causes spurious
|
||||
# warnings if the initial aclocal is confused by the libtoolized
|
||||
# (or worse out-of-date) macro directory.
|
||||
# libtoolize 1.9b added the --install option; but we support back
|
||||
# to libtoolize 1.5.22, where the install action was default.
|
||||
if test $use_libtool = 1; then
|
||||
install=
|
||||
case $($LIBTOOLIZE --help) in
|
||||
*--install*) install=--install ;;
|
||||
esac
|
||||
echo "running: $LIBTOOLIZE $install --copy"
|
||||
$LIBTOOLIZE $install --copy
|
||||
fi
|
||||
|
||||
find . ! -type d -print | sort >$tempbase.1
|
||||
old_IFS=$IFS
|
||||
IFS=$nl
|
||||
for file in $(comm -13 $tempbase.0 $tempbase.1); do
|
||||
IFS=$old_IFS
|
||||
parent=${file%/*}
|
||||
version_controlled_file "$parent" "$file" || {
|
||||
for dot_ig in x $vc_ignore; do
|
||||
test $dot_ig = x && continue
|
||||
ig=$parent/$dot_ig
|
||||
insert_vc_ignore "$ig" "${file##*/}"
|
||||
done
|
||||
}
|
||||
done
|
||||
IFS=$old_IFS
|
||||
|
||||
rm -f $tempbase.0 $tempbase.1
|
||||
trap - 1 2 13 15
|
||||
if test $with_gettext = yes; then
|
||||
# Released autopoint has the tendency to install macros that have been
|
||||
# obsoleted in current gnulib, so run this before gnulib-tool.
|
||||
echo "$0: $AUTOPOINT --force"
|
||||
$AUTOPOINT --force || exit
|
||||
fi
|
||||
|
||||
# Autoreconf runs aclocal before libtoolize, which causes spurious
|
||||
# warnings if the initial aclocal is confused by the libtoolized
|
||||
# (or worse out-of-date) macro directory.
|
||||
# libtoolize 1.9b added the --install option; but we support back
|
||||
# to libtoolize 1.5.22, where the install action was default.
|
||||
if test $use_libtool = 1; then
|
||||
install=
|
||||
case $($LIBTOOLIZE --help) in
|
||||
*--install*) install=--install ;;
|
||||
esac
|
||||
echo "running: $LIBTOOLIZE $install --copy"
|
||||
$LIBTOOLIZE $install --copy
|
||||
fi
|
||||
|
||||
version_controlled_file() {
|
||||
dir=$1
|
||||
file=$2
|
||||
found=no
|
||||
if test -d CVS; then
|
||||
grep -F "/$file/" $dir/CVS/Entries 2>/dev/null |
|
||||
grep '^/[^/]*/[0-9]' > /dev/null && found=yes
|
||||
elif test -d .git; then
|
||||
git rm -n "$dir/$file" > /dev/null 2>&1 && found=yes
|
||||
elif test -d .svn; then
|
||||
svn log -r HEAD "$dir/$file" > /dev/null 2>&1 && found=yes
|
||||
else
|
||||
echo "$me: no version control for $dir/$file?" >&2
|
||||
fi
|
||||
test $found = yes
|
||||
}
|
||||
|
||||
# Import from gnulib.
|
||||
|
||||
gnulib_tool_options="\
|
||||
@@ -870,12 +814,11 @@ echo "$0: $gnulib_tool $gnulib_tool_options --import ..."
|
||||
$gnulib_tool $gnulib_tool_options --import $gnulib_modules &&
|
||||
|
||||
for file in $gnulib_files; do
|
||||
symlink_to_dir "$GNULIB_SRCDIR" $file \
|
||||
|| die "failed to symlink $file"
|
||||
symlink_to_dir "$GNULIB_SRCDIR" $file || exit
|
||||
done
|
||||
|
||||
bootstrap_post_import_hook \
|
||||
|| die "bootstrap_post_import_hook failed"
|
||||
|| { echo >&2 "$me: bootstrap_post_import_hook failed"; exit 1; }
|
||||
|
||||
# Remove any dangling symlink matching "*.m4" or "*.[ch]" in some
|
||||
# gnulib-populated directories. Such .m4 files would cause aclocal to fail.
|
||||
@@ -903,17 +846,16 @@ echo "running: AUTOPOINT=true LIBTOOLIZE=true " \
|
||||
"$AUTORECONF --verbose --install $no_recursive -I $m4_base $ACLOCAL_FLAGS"
|
||||
AUTOPOINT=true LIBTOOLIZE=true \
|
||||
$AUTORECONF --verbose --install $no_recursive -I $m4_base $ACLOCAL_FLAGS \
|
||||
|| die "autoreconf failed"
|
||||
|| exit 1
|
||||
|
||||
# Get some extra files from gnulib, overriding existing files.
|
||||
for file in $gnulib_extra_files; do
|
||||
case $file in
|
||||
*/INSTALL) dst=INSTALL;;
|
||||
build-aux/*) dst=$build_aux/${file#build-aux/};;
|
||||
build-aux/*) dst=$build_aux/`expr "$file" : 'build-aux/\(.*\)'`;;
|
||||
*) dst=$file;;
|
||||
esac
|
||||
symlink_to_dir "$GNULIB_SRCDIR" $file $dst \
|
||||
|| die "failed to symlink $file"
|
||||
symlink_to_dir "$GNULIB_SRCDIR" $file $dst || exit
|
||||
done
|
||||
|
||||
if test $with_gettext = yes; then
|
||||
@@ -929,8 +871,7 @@ if test $with_gettext = yes; then
|
||||
a\
|
||||
'"$XGETTEXT_OPTIONS"' $${end_of_xgettext_options+}
|
||||
}
|
||||
' po/Makevars.template >po/Makevars \
|
||||
|| die 'cannot generate po/Makevars'
|
||||
' po/Makevars.template >po/Makevars || exit 1
|
||||
|
||||
# If the 'gettext' module is in use, grab the latest Makefile.in.in.
|
||||
# If only the 'gettext-h' module is in use, assume autopoint already
|
||||
@@ -938,8 +879,7 @@ if test $with_gettext = yes; then
|
||||
case $gnulib_modules in
|
||||
*gettext-h*) ;;
|
||||
*gettext*)
|
||||
cp $GNULIB_SRCDIR/build-aux/po/Makefile.in.in po/Makefile.in.in \
|
||||
|| die "cannot create po/Makefile.in.in"
|
||||
cp $GNULIB_SRCDIR/build-aux/po/Makefile.in.in po/Makefile.in.in || exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -955,8 +895,7 @@ if test $with_gettext = yes; then
|
||||
a\
|
||||
'"$XGETTEXT_OPTIONS_RUNTIME"' $${end_of_xgettext_options+}
|
||||
}
|
||||
' po/Makevars.template >runtime-po/Makevars \
|
||||
|| die 'cannot generate runtime-po/Makevars'
|
||||
' po/Makevars.template >runtime-po/Makevars || exit 1
|
||||
|
||||
# Copy identical files from po to runtime-po.
|
||||
(cd po && cp -p Makefile.in.in *-quot *.header *.sed *.sin ../runtime-po)
|
||||
|
@@ -13,8 +13,9 @@
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library. If not, see
|
||||
# <http://www.gnu.org/licenses/>.
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
|
||||
# gnulib modules used by this package.
|
||||
gnulib_modules='
|
||||
@@ -30,22 +31,18 @@ c-strcasestr
|
||||
calloc-posix
|
||||
canonicalize-lgpl
|
||||
chown
|
||||
clock-time
|
||||
close
|
||||
connect
|
||||
configmake
|
||||
count-one-bits
|
||||
crypto/md5
|
||||
crypto/sha256
|
||||
dirname-lgpl
|
||||
environ
|
||||
execinfo
|
||||
fclose
|
||||
fcntl
|
||||
fcntl-h
|
||||
fdatasync
|
||||
ffs
|
||||
ffsl
|
||||
fnmatch
|
||||
fsync
|
||||
func
|
||||
@@ -63,17 +60,13 @@ ignore-value
|
||||
inet_pton
|
||||
intprops
|
||||
ioctl
|
||||
isatty
|
||||
largefile
|
||||
ldexp
|
||||
listen
|
||||
localeconv
|
||||
maintainer-makefile
|
||||
manywarnings
|
||||
mkostemp
|
||||
mkostemps
|
||||
mkstemp
|
||||
mkstemps
|
||||
mktempd
|
||||
net_if
|
||||
netdb
|
||||
nonblocking
|
||||
openpty
|
||||
@@ -96,7 +89,6 @@ sigaction
|
||||
sigpipe
|
||||
snprintf
|
||||
socket
|
||||
stat-time
|
||||
stdarg
|
||||
stpcpy
|
||||
strchrnul
|
||||
@@ -224,12 +216,13 @@ if `(${PYTHON_CONFIG-python-config} --version;
|
||||
PYTHON_CONFIG=true
|
||||
fi
|
||||
|
||||
# Automake requires that ChangeLog and AUTHORS exist.
|
||||
touch AUTHORS ChangeLog || exit 1
|
||||
# Automake requires that ChangeLog exist.
|
||||
touch ChangeLog || exit 1
|
||||
|
||||
# Override bootstrap's list - we don't use mdate-sh or texinfo.tex.
|
||||
gnulib_extra_files="
|
||||
$build_aux/install-sh
|
||||
$build_aux/missing
|
||||
$build_aux/depcomp
|
||||
$build_aux/config.guess
|
||||
$build_aux/config.sub
|
||||
|
@@ -1,71 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
# augeas-gentest.pl: Generate an augeas test file, from an
|
||||
# example config file + test file template
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library. If not, see
|
||||
# <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# Authors:
|
||||
# Daniel P. Berrange <berrange@redhat.com>
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
die "syntax: $0 CONFIG TEMPLATE AUGTEST\n" unless @ARGV == 3;
|
||||
|
||||
my $config = shift @ARGV;
|
||||
my $template = shift @ARGV;
|
||||
my $augtest = shift @ARGV;
|
||||
|
||||
open AUGTEST, ">", $augtest or die "cannot create $augtest: $!";
|
||||
|
||||
$SIG{__DIE__} = sub {
|
||||
unlink $augtest;
|
||||
};
|
||||
|
||||
open CONFIG, "<", $config or die "cannot read $config: $!";
|
||||
open TEMPLATE, "<", $template or die "cannot read $template: $!";
|
||||
|
||||
my $group = 0;
|
||||
while (<TEMPLATE>) {
|
||||
if (/::CONFIG::/) {
|
||||
my $group = 0;
|
||||
print AUGTEST " let conf = \"";
|
||||
while (<CONFIG>) {
|
||||
if (/^#\w/) {
|
||||
s/^#//;
|
||||
s/\"/\\\"/g;
|
||||
print AUGTEST $_;
|
||||
$group = /\[\s$/;
|
||||
} elsif ($group) {
|
||||
s/\"/\\\"/g;
|
||||
if (/#\s*\]/) {
|
||||
$group = 0;
|
||||
}
|
||||
if (/^#/) {
|
||||
s/^#//;
|
||||
print AUGTEST $_;
|
||||
}
|
||||
}
|
||||
}
|
||||
print AUGTEST "\"\n";
|
||||
} else {
|
||||
print AUGTEST $_;
|
||||
}
|
||||
}
|
||||
|
||||
close TEMPLATE;
|
||||
close CONFIG;
|
||||
close AUGTEST or die "cannot save $augtest: $!";
|
@@ -1,116 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
# bracket-spacing.pl: Report any usage of 'function (..args..)'
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library. If not, see
|
||||
# <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# Authors:
|
||||
# Daniel P. Berrange <berrange@redhat.com>
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
my $ret = 0;
|
||||
my $incomment = 0;
|
||||
|
||||
foreach my $file (@ARGV) {
|
||||
open FILE, $file;
|
||||
|
||||
while (defined (my $line = <FILE>)) {
|
||||
my $data = $line;
|
||||
|
||||
# Kill any quoted strongs
|
||||
$data =~ s,".*?","XXX",g;
|
||||
|
||||
# Kill any C++ style comments
|
||||
$data =~ s,//.*$,//,;
|
||||
|
||||
next if $data =~ /^#/;
|
||||
|
||||
# Kill contents of multi-line comments
|
||||
# and detect end of multi-line comments
|
||||
if ($incomment) {
|
||||
if ($data =~ m,\*/,) {
|
||||
$incomment = 0;
|
||||
$data =~ s,^.*\*/,*/,;
|
||||
} else {
|
||||
$data = "";
|
||||
}
|
||||
}
|
||||
|
||||
# Kill single line comments, and detect
|
||||
# start of multi-line comments
|
||||
if ($data =~ m,/\*.*\*/,) {
|
||||
$data =~ s,/\*.*\*/,/* */,;
|
||||
} elsif ($data =~ m,/\*,) {
|
||||
$incomment = 1;
|
||||
$data =~ s,/\*.*,/*,;
|
||||
}
|
||||
|
||||
# We need to match things like
|
||||
#
|
||||
# int foo (int bar, bool wizz);
|
||||
# foo (bar, wizz);
|
||||
#
|
||||
# but not match things like:
|
||||
#
|
||||
# typedef int (*foo)(bar wizz)
|
||||
#
|
||||
# we can't do this (efficiently) without
|
||||
# missing things like
|
||||
#
|
||||
# foo (*bar, wizz);
|
||||
#
|
||||
while ($data =~ /(\w+)\s\((?!\*)/) {
|
||||
my $kw = $1;
|
||||
|
||||
# Allow space after keywords only
|
||||
if ($kw =~ /^(if|for|while|switch|return)$/) {
|
||||
$data =~ s/($kw\s\()/XXX(/;
|
||||
} else {
|
||||
print "$file:$.: $line";
|
||||
$ret = 1;
|
||||
last;
|
||||
}
|
||||
}
|
||||
|
||||
# Require whitespace immediately after keywords,
|
||||
# but none after the opening bracket
|
||||
while ($data =~ /(if|for|while|switch|return)\(/ ||
|
||||
$data =~ /(if|for|while|switch|return)\s+\(\s/) {
|
||||
print "$file:$.: $line";
|
||||
$ret = 1;
|
||||
last;
|
||||
}
|
||||
|
||||
# Forbid whitespace between )( of a function typedef
|
||||
while ($data =~ /\(\*\w+\)\s+\(/) {
|
||||
print "$file:$.: $line";
|
||||
$ret = 1;
|
||||
last;
|
||||
}
|
||||
|
||||
# Forbid whitespace following ( or prior to )
|
||||
while ($data =~ /\S\s+\)/ ||
|
||||
$data =~ /\(\s+\S/) {
|
||||
print "$file:$.: $line";
|
||||
$ret = 1;
|
||||
last;
|
||||
}
|
||||
}
|
||||
close FILE;
|
||||
}
|
||||
|
||||
exit $ret;
|
211
cfg.mk
@@ -13,8 +13,7 @@
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see
|
||||
# <http://www.gnu.org/licenses/>.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Use alpha.gnu.org for alpha and beta releases.
|
||||
# Use ftp.gnu.org for major releases.
|
||||
@@ -43,6 +42,7 @@ _test_script_regex = \<\(init\|test-lib\)\.sh\>
|
||||
# Tests not to run as part of "make distcheck".
|
||||
local-checks-to-skip = \
|
||||
changelog-check \
|
||||
check-AUTHORS \
|
||||
makefile-check \
|
||||
makefile_path_separator_check \
|
||||
patch-check \
|
||||
@@ -76,17 +76,6 @@ local-checks-to-skip = \
|
||||
sc_makefile_check \
|
||||
sc_useless_cpp_parens
|
||||
|
||||
# Most developers don't run 'make distcheck'. We want the official
|
||||
# dist to be secure, but don't want to penalize other developers
|
||||
# using a distro that has not yet picked up the automake fix.
|
||||
# FIXME remove this ifeq (making the syntax check unconditional)
|
||||
# once fixed automake (1.11.6 or 1.12.2+) is more common.
|
||||
ifeq ($(filter dist%, $(MAKECMDGOALS)), )
|
||||
local-checks-to-skip += sc_vulnerable_makefile_CVE-2012-3386
|
||||
else
|
||||
distdir: sc_vulnerable_makefile_CVE-2012-3386.z
|
||||
endif
|
||||
|
||||
# Files that should never cause syntax check failures.
|
||||
VC_LIST_ALWAYS_EXCLUDE_REGEX = \
|
||||
(^(HACKING|docs/(news\.html\.in|.*\.patch))|\.po)$$
|
||||
@@ -144,9 +133,20 @@ useless_free_options = \
|
||||
--name=virJSONValueFree \
|
||||
--name=virLastErrFreeData \
|
||||
--name=virNetMessageFree \
|
||||
--name=virNetClientFree \
|
||||
--name=virNetClientProgramFree \
|
||||
--name=virNetClientStreamFree \
|
||||
--name=virNetServerFree \
|
||||
--name=virNetServerClientFree \
|
||||
--name=virNetServerMDNSFree \
|
||||
--name=virNetServerMDNSEntryFree \
|
||||
--name=virNetServerMDNSGroupFree \
|
||||
--name=virNetServerProgramFree \
|
||||
--name=virNetServerServiceFree \
|
||||
--name=virNetSocketFree \
|
||||
--name=virNetSASLContextFree \
|
||||
--name=virNetSASLSessionFree \
|
||||
--name=virNetTLSSessionFree \
|
||||
--name=virNWFilterDefFree \
|
||||
--name=virNWFilterEntryFree \
|
||||
--name=virNWFilterHashTableFree \
|
||||
@@ -159,8 +159,6 @@ useless_free_options = \
|
||||
--name=virNetworkObjFree \
|
||||
--name=virNodeDeviceDefFree \
|
||||
--name=virNodeDeviceObjFree \
|
||||
--name=virObjectUnref \
|
||||
--name=virObjectFreeCallback \
|
||||
--name=virSecretDefFree \
|
||||
--name=virStorageEncryptionFree \
|
||||
--name=virStorageEncryptionSecretFree \
|
||||
@@ -314,7 +312,7 @@ sc_flags_usage:
|
||||
|
||||
# Avoid functions that should only be called via macro counterparts.
|
||||
sc_prohibit_internal_functions:
|
||||
@prohibit='vir(Free|AllocN?|ReallocN|(Insert|Delete)ElementsN|File(Close|Fclose|Fdopen)) *\(' \
|
||||
@prohibit='vir(Free|AllocN?|ReallocN|File(Close|Fclose|Fdopen)) *\(' \
|
||||
halt='use VIR_ macros instead of internal functions' \
|
||||
$(_sc_search_regexp)
|
||||
|
||||
@@ -339,12 +337,6 @@ sc_prohibit_fork_wrappers:
|
||||
halt='use virCommand for child processes' \
|
||||
$(_sc_search_regexp)
|
||||
|
||||
# Prefer mkostemp with O_CLOEXEC.
|
||||
sc_prohibit_mkstemp:
|
||||
@prohibit='[^"]\<mkstemps? *\(' \
|
||||
halt='use mkostemp with O_CLOEXEC instead of mkstemp' \
|
||||
$(_sc_search_regexp)
|
||||
|
||||
# access with X_OK accepts directories, but we can't exec() those.
|
||||
# access with F_OK or R_OK is okay, though.
|
||||
sc_prohibit_access_xok:
|
||||
@@ -358,18 +350,18 @@ snp_ = strncmp *\(.+\)
|
||||
sc_prohibit_strncmp:
|
||||
@prohibit='! *strncmp *\(|\<$(snp_) *[!=]=|[!=]= *$(snp_)' \
|
||||
exclude=':# *define STR(N?EQLEN|PREFIX)\(' \
|
||||
halt='use STREQLEN or STRPREFIX instead of str''ncmp' \
|
||||
halt='$(ME): use STREQLEN or STRPREFIX instead of str''ncmp' \
|
||||
$(_sc_search_regexp)
|
||||
|
||||
# strtol and friends are too easy to misuse
|
||||
sc_prohibit_strtol:
|
||||
@prohibit='\bstrto(u?ll?|[ui]max) *\(' \
|
||||
exclude='exempt from syntax-check' \
|
||||
halt='use virStrToLong_*, not strtol variants' \
|
||||
halt='$(ME): use virStrToLong_*, not strtol variants' \
|
||||
$(_sc_search_regexp)
|
||||
@prohibit='\bstrto[df] *\(' \
|
||||
exclude='exempt from syntax-check' \
|
||||
halt='use virStrToDouble, not strtod variants' \
|
||||
halt='$(ME): use virStrToDouble, not strtod variants' \
|
||||
$(_sc_search_regexp)
|
||||
|
||||
# Use virAsprintf rather than as'printf since *strp is undefined on error.
|
||||
@@ -391,8 +383,13 @@ sc_prohibit_sprintf:
|
||||
halt='use snprintf, not s'printf \
|
||||
$(_sc_search_regexp)
|
||||
|
||||
sc_prohibit_strncpy:
|
||||
@prohibit='strncpy *\(' \
|
||||
halt='use virStrncpy, not strncpy' \
|
||||
$(_sc_search_regexp)
|
||||
|
||||
sc_prohibit_readlink:
|
||||
@prohibit='\<readlink *\(' \
|
||||
@prohibit='readlink *\(' \
|
||||
halt='use virFileResolveLink, not readlink' \
|
||||
$(_sc_search_regexp)
|
||||
|
||||
@@ -411,11 +408,6 @@ sc_prohibit_VIR_ERR_NO_MEMORY:
|
||||
halt='use virReportOOMError, not V'IR_ERR_NO_MEMORY \
|
||||
$(_sc_search_regexp)
|
||||
|
||||
sc_prohibit_PATH_MAX:
|
||||
@prohibit='\<P''ATH_MAX\>' \
|
||||
halt='dynamically allocate paths, do not use P'ATH_MAX \
|
||||
$(_sc_search_regexp)
|
||||
|
||||
# Use a subshell for each function, to give the optimal warning message.
|
||||
include $(srcdir)/Makefile.nonreentrant
|
||||
sc_prohibit_nonreentrant:
|
||||
@@ -450,7 +442,7 @@ sc_size_of_brackets:
|
||||
# Ensure that no C source file, docs, or rng schema uses TABs for
|
||||
# indentation. Also match *.h.in files, to get libvirt.h.in. Exclude
|
||||
# files in gnulib, since they're imported.
|
||||
space_indent_files=(\.(rng|s?[ch](\.in)?|html.in|py|pl|syms)|(daemon|tools)/.*\.in)
|
||||
space_indent_files=(\.(rng|s?[ch](\.in)?|html.in|py|syms)|(daemon|tools)/.*\.in)
|
||||
sc_TAB_in_indentation:
|
||||
@prohibit='^ * ' \
|
||||
in_vc_files='$(space_indent_files)$$' \
|
||||
@@ -514,12 +506,46 @@ sc_avoid_attribute_unused_in_header:
|
||||
# |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 += ESX_ERROR
|
||||
msg_gen_function += ESX_VI_ERROR
|
||||
msg_gen_function += HYPERV_ERROR
|
||||
msg_gen_function += PHYP_ERROR
|
||||
msg_gen_function += VIR_ERROR
|
||||
msg_gen_function += VMX_ERROR
|
||||
msg_gen_function += XENXS_ERROR
|
||||
msg_gen_function += eventReportError
|
||||
msg_gen_function += ifaceError
|
||||
msg_gen_function += interfaceReportError
|
||||
msg_gen_function += iptablesError
|
||||
msg_gen_function += lxcError
|
||||
msg_gen_function += libxlError
|
||||
msg_gen_function += macvtapError
|
||||
msg_gen_function += networkReportError
|
||||
msg_gen_function += nodeReportError
|
||||
msg_gen_function += openvzError
|
||||
msg_gen_function += pciReportError
|
||||
msg_gen_function += qemuReportError
|
||||
msg_gen_function += qemudDispatchClientFailure
|
||||
msg_gen_function += regerror
|
||||
msg_gen_function += remoteError
|
||||
msg_gen_function += remoteDispatchFormatError
|
||||
msg_gen_function += statsError
|
||||
msg_gen_function += streamsReportError
|
||||
msg_gen_function += usbReportError
|
||||
msg_gen_function += umlReportError
|
||||
msg_gen_function += vah_error
|
||||
msg_gen_function += vah_warning
|
||||
msg_gen_function += vboxError
|
||||
msg_gen_function += virCommandError
|
||||
msg_gen_function += virConfError
|
||||
msg_gen_function += virCPUReportError
|
||||
msg_gen_function += virEventError
|
||||
msg_gen_function += virDomainReportError
|
||||
msg_gen_function += virGenericReportError
|
||||
msg_gen_function += virHashError
|
||||
msg_gen_function += virHookReportError
|
||||
msg_gen_function += virInterfaceReportError
|
||||
msg_gen_function += virJSONError
|
||||
msg_gen_function += virLibConnError
|
||||
msg_gen_function += virLibDomainError
|
||||
msg_gen_function += virLibDomainSnapshotError
|
||||
@@ -530,21 +556,40 @@ msg_gen_function += virLibNWFilterError
|
||||
msg_gen_function += virLibSecretError
|
||||
msg_gen_function += virLibStoragePoolError
|
||||
msg_gen_function += virLibStorageVolError
|
||||
msg_gen_function += virNetworkReportError
|
||||
msg_gen_function += virNodeDeviceReportError
|
||||
msg_gen_function += virNWFilterReportError
|
||||
msg_gen_function += virRaiseError
|
||||
msg_gen_function += virReportError
|
||||
msg_gen_function += virReportErrorHelper
|
||||
msg_gen_function += virReportSystemError
|
||||
msg_gen_function += virSecretReportError
|
||||
msg_gen_function += virSecurityReportError
|
||||
msg_gen_function += virSexprError
|
||||
msg_gen_function += virSmbiosReportError
|
||||
msg_gen_function += virSocketError
|
||||
msg_gen_function += virStatsError
|
||||
msg_gen_function += virStorageReportError
|
||||
msg_gen_function += virUtilError
|
||||
msg_gen_function += virXMLError
|
||||
msg_gen_function += virXenInotifyError
|
||||
msg_gen_function += virXenStoreError
|
||||
msg_gen_function += virXendError
|
||||
msg_gen_function += vmwareError
|
||||
msg_gen_function += xenapiSessionErrorHandler
|
||||
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 += fprintf
|
||||
# msg_gen_function += testError
|
||||
# msg_gen_function += virXenError
|
||||
# msg_gen_function += vshPrint
|
||||
# msg_gen_function += vshError
|
||||
|
||||
func_or := $(shell echo $(msg_gen_function)|tr -s ' ' '|')
|
||||
func_or := $(shell printf '$(msg_gen_function)'|tr -s '[[:space:]]' '|')
|
||||
func_re := ($(func_or))
|
||||
|
||||
# Look for diagnostics that aren't marked for translation.
|
||||
@@ -555,7 +600,7 @@ func_re := ($(func_or))
|
||||
sc_libvirt_unmarked_diagnostics:
|
||||
@prohibit='\<$(func_re) *\([^"]*"[^"]*[a-z]{3}' \
|
||||
exclude='_\(' \
|
||||
halt='found unmarked diagnostic(s)' \
|
||||
halt='$(ME): found unmarked diagnostic(s)' \
|
||||
$(_sc_search_regexp)
|
||||
@{ grep -nE '\<$(func_re) *\(.*;$$' $$($(VC_LIST_EXCEPT)); \
|
||||
grep -A1 -nE '\<$(func_re) *\(.*,$$' $$($(VC_LIST_EXCEPT)); } \
|
||||
@@ -578,39 +623,6 @@ sc_prohibit_newline_at_end_of_diagnostic:
|
||||
&& { echo '$(ME): newline at end of message(s)' 1>&2; \
|
||||
exit 1; } || :
|
||||
|
||||
# Look for diagnostics that lack a % in the format string, except that we
|
||||
# allow VIR_ERROR to do this, and ignore functions that take a single
|
||||
# string rather than a format argument.
|
||||
sc_prohibit_diagnostic_without_format:
|
||||
@{ grep -nE '\<$(func_re) *\(.*;$$' $$($(VC_LIST_EXCEPT)); \
|
||||
grep -A2 -nE '\<$(func_re) *\(.*,$$' $$($(VC_LIST_EXCEPT)); } \
|
||||
| sed -rn -e ':l; /[,"]$$/ {N;b l;}' \
|
||||
-e '/(xenapiSessionErrorHandler|vah_(error|warning))/d' \
|
||||
-e '/\<$(func_re) *\([^"]*"([^%"]|"\n[^"]*")*"[,)]/p' \
|
||||
| grep -vE 'VIR_ERROR' && \
|
||||
{ echo '$(ME): found diagnostic without %' 1>&2; \
|
||||
exit 1; } || :
|
||||
|
||||
# The strings "" and "%s" should never be marked for translation.
|
||||
# Files under tests/ and examples/ should not be translated.
|
||||
sc_prohibit_useless_translation:
|
||||
@prohibit='_\("(%s)?"\)' \
|
||||
halt='found useless translation' \
|
||||
$(_sc_search_regexp)
|
||||
@prohibit='\<N?_ *\(' \
|
||||
in_vc_files='^(tests|examples)/' \
|
||||
halt='no translations in tests or examples' \
|
||||
$(_sc_search_regexp)
|
||||
|
||||
# When splitting a diagnostic across lines, ensure that there is a space
|
||||
# or \n on one side of the split.
|
||||
sc_require_whitespace_in_translation:
|
||||
@grep -n -A1 '"$$' $$($(VC_LIST_EXCEPT)) \
|
||||
| sed -ne ':l; /"$$/ {N;b l;}; s/"\n[^"]*"/""/g; s/\\n/ /g' \
|
||||
-e '/_(.*[^\ ]""[^\ ]/p' | grep . && \
|
||||
{ echo '$(ME): missing whitespace at line split' 1>&2; \
|
||||
exit 1; } || :
|
||||
|
||||
# Enforce recommended preprocessor indentation style.
|
||||
sc_preprocessor_indentation:
|
||||
@if cppi --version >/dev/null 2>&1; then \
|
||||
@@ -633,13 +645,6 @@ sc_copyright_format:
|
||||
halt='spell Red Hat as two words' \
|
||||
$(_sc_search_regexp)
|
||||
|
||||
# Prefer the new URL listing over the old street address listing when
|
||||
# calling out where to get a copy of the [L]GPL.
|
||||
sc_copyright_address:
|
||||
@prohibit=Boston,' MA' \
|
||||
halt='Point to <http://www.gnu.org/licenses/>, not an address' \
|
||||
$(_sc_search_regexp)
|
||||
|
||||
# Some functions/macros produce messages intended solely for developers
|
||||
# and maintainers. Do not mark them for translation.
|
||||
sc_prohibit_gettext_markup:
|
||||
@@ -655,8 +660,6 @@ sc_prohibit_cross_inclusion:
|
||||
@for dir in $(cross_dirs); do \
|
||||
case $$dir in \
|
||||
util/) safe="util";; \
|
||||
locking/) \
|
||||
safe="($$dir|util|conf|rpc)";; \
|
||||
cpu/ | locking/ | network/ | rpc/ | security/) \
|
||||
safe="($$dir|util|conf)";; \
|
||||
xenapi/ | xenxs/ ) safe="($$dir|util|conf|xen)";; \
|
||||
@@ -693,14 +696,11 @@ ifeq (0,$(MAKELEVEL))
|
||||
# b653eda3ac4864de205419d9f41eec267cb89eeb .gnulib (v0.0-2286-gb653eda)
|
||||
# $ cat .git-module-status
|
||||
# b653eda3ac4864de205419d9f41eec267cb89eeb
|
||||
#
|
||||
# Keep this logic in sync with autogen.sh.
|
||||
_submodule_hash = sed 's/^[ +-]//;s/ .*//'
|
||||
_update_required := $(shell \
|
||||
cd '$(srcdir)'; \
|
||||
test -d .git || { echo 0; exit; }; \
|
||||
test -f po/Makevars || { echo 1; exit; }; \
|
||||
test -f AUTHORS || { echo 1; exit; }; \
|
||||
actual=$$(git submodule status | $(_submodule_hash); \
|
||||
git hash-object bootstrap.conf; \
|
||||
git ls-tree -d HEAD gnulib/local | awk '{print $$3}'; \
|
||||
@@ -710,11 +710,24 @@ ifeq (0,$(MAKELEVEL))
|
||||
_clean_requested = $(filter %clean,$(MAKECMDGOALS))
|
||||
ifeq (1,$(_update_required)$(_clean_requested))
|
||||
$(info INFO: gnulib update required; running ./autogen.sh first)
|
||||
$(shell touch $(srcdir)/AUTHORS $(srcdir)/ChangeLog)
|
||||
maint.mk Makefile: _autogen
|
||||
Makefile: _autogen
|
||||
endif
|
||||
endif
|
||||
|
||||
# Give credit where due:
|
||||
# Ensure that each commit author email address (possibly mapped via
|
||||
# git log's .mailmap) appears in our AUTHORS file.
|
||||
sc_check_author_list:
|
||||
@fail=0; \
|
||||
for i in $$(git log --pretty=format:%aE%n|sort -u|grep -v '^$$'); do \
|
||||
sanitized=$$(echo "$$i"|LC_ALL=C sed 's/\([^a-zA-Z0-9_@-]\)/\\\1/g'); \
|
||||
grep -iq "<$$sanitized>" $(srcdir)/AUTHORS \
|
||||
|| { printf '%s\n' "$$i" >&2; fail=1; }; \
|
||||
done; \
|
||||
test $$fail = 1 \
|
||||
&& echo '$(ME): committer(s) not listed in AUTHORS' >&2; \
|
||||
test $$fail = 0
|
||||
|
||||
# It is necessary to call autogen any time gnulib changes. Autogen
|
||||
# reruns configure, then we regenerate all Makefiles at once.
|
||||
.PHONY: _autogen
|
||||
@@ -723,12 +736,7 @@ _autogen:
|
||||
./config.status
|
||||
|
||||
# regenerate HACKING as part of the syntax-check
|
||||
syntax-check: $(top_srcdir)/HACKING bracket-spacing-check
|
||||
|
||||
bracket-spacing-check:
|
||||
$(AM_V_GEN)files=`$(VC_LIST) | grep '\.c$$'`; \
|
||||
$(PERL) $(top_srcdir)/build-aux/bracket-spacing.pl $$files || \
|
||||
(echo $(ME): incorrect whitespace around brackets, see HACKING for rules && exit 1)
|
||||
syntax-check: $(top_srcdir)/HACKING
|
||||
|
||||
# sc_po_check can fail if generated files are not built first
|
||||
sc_po_check: \
|
||||
@@ -743,21 +751,18 @@ $(srcdir)/src/remote/remote_client_bodies.h: $(srcdir)/src/remote/remote_protoco
|
||||
$(MAKE) -C src remote/remote_client_bodies.h
|
||||
|
||||
# List all syntax-check exemptions:
|
||||
exclude_file_name_regexp--sc_avoid_strcase = ^tools/virsh\.h$$
|
||||
exclude_file_name_regexp--sc_avoid_strcase = ^tools/virsh\.c$$
|
||||
|
||||
_src1=libvirt|fdstream|qemu/qemu_monitor|util/(command|util)|xen/xend_internal|rpc/virnetsocket|lxc/lxc_controller|locking/lock_daemon
|
||||
_src1=libvirt|fdstream|qemu/qemu_monitor|util/(command|util)|xen/xend_internal|rpc/virnetsocket|lxc/lxc_controller
|
||||
exclude_file_name_regexp--sc_avoid_write = \
|
||||
^(src/($(_src1))|daemon/libvirtd|tools/console|tests/(shunload|virnettlscontext)test)\.c$$
|
||||
|
||||
exclude_file_name_regexp--sc_bindtextdomain = ^(tests|examples)/
|
||||
|
||||
exclude_file_name_regexp--sc_copyright_address = \
|
||||
^COPYING\.LIB$$
|
||||
|
||||
exclude_file_name_regexp--sc_flags_usage = ^(docs/|src/util/virnetdevtap\.c$$)
|
||||
|
||||
exclude_file_name_regexp--sc_libvirt_unmarked_diagnostics = \
|
||||
^(src/rpc/gendispatch\.pl$$|tests/)
|
||||
^src/rpc/gendispatch\.pl$$
|
||||
|
||||
exclude_file_name_regexp--sc_po_check = ^(docs/|src/rpc/gendispatch\.pl$$)
|
||||
|
||||
@@ -776,9 +781,9 @@ exclude_file_name_regexp--sc_prohibit_close = \
|
||||
(\.p[yl]$$|^docs/|^(src/util/virfile\.c|src/libvirt\.c)$$)
|
||||
|
||||
exclude_file_name_regexp--sc_prohibit_empty_lines_at_EOF = \
|
||||
(^tests/(qemuhelp|nodeinfo)data/|\.(gif|ico|png|diff)$$)
|
||||
(^tests/qemuhelpdata/|\.(gif|ico|png|diff)$$)
|
||||
|
||||
_src2=src/(util/command|libvirt|lxc/lxc_controller|locking/lock_daemon)
|
||||
_src2=src/(util/command|libvirt|lxc/lxc_controller)
|
||||
exclude_file_name_regexp--sc_prohibit_fork_wrappers = \
|
||||
(^($(_src2)|tests/testutils|daemon/libvirtd)\.c$$)
|
||||
|
||||
@@ -791,20 +796,20 @@ exclude_file_name_regexp--sc_prohibit_newline_at_end_of_diagnostic = \
|
||||
^src/rpc/gendispatch\.pl$$
|
||||
|
||||
exclude_file_name_regexp--sc_prohibit_nonreentrant = \
|
||||
^((po|tests)/|docs/.*py|run.in$$)
|
||||
^((po|tests)/|docs/.*py$$|tools/(virsh|console)\.c$$)
|
||||
|
||||
exclude_file_name_regexp--sc_prohibit_raw_allocation = \
|
||||
^(src/util/memory\.[ch]|examples/.*)$$
|
||||
|
||||
exclude_file_name_regexp--sc_prohibit_readlink = \
|
||||
^src/(util/util|lxc/lxc_container)\.c$$
|
||||
exclude_file_name_regexp--sc_prohibit_readlink = ^src/util/util\.c$$
|
||||
|
||||
exclude_file_name_regexp--sc_prohibit_setuid = ^src/util/util\.c$$
|
||||
|
||||
exclude_file_name_regexp--sc_prohibit_sprintf = \
|
||||
^(docs/hacking\.html\.in)|(examples/systemtap/.*stp)|(src/dtrace2systemtap\.pl)|(src/rpc/gensystemtap\.pl)$$
|
||||
|
||||
exclude_file_name_regexp--sc_prohibit_strncpy = ^src/util/util\.c$$
|
||||
exclude_file_name_regexp--sc_prohibit_strncpy = \
|
||||
^(src/util/util|tools/virsh)\.c$$
|
||||
|
||||
exclude_file_name_regexp--sc_prohibit_strtol = \
|
||||
^src/(util/sexpr|(vbox|xen|xenxs)/.*)\.c$$
|
||||
@@ -815,10 +820,9 @@ exclude_file_name_regexp--sc_prohibit_xmlURI = ^src/util/viruri\.c$$
|
||||
|
||||
exclude_file_name_regexp--sc_prohibit_return_as_function = \.py$$
|
||||
|
||||
_virsh_includes=(edit|domain-monitor|domain|volume|pool|network|interface|nwfilter|secret|snapshot|host|nodedev)
|
||||
exclude_file_name_regexp--sc_require_config_h = ^(examples/|tools/virsh-$(_virsh_includes)\.c$$)
|
||||
exclude_file_name_regexp--sc_require_config_h = ^examples/
|
||||
|
||||
exclude_file_name_regexp--sc_require_config_h_first = ^(examples/|tools/virsh-$(_virsh_includes)\.c$$)
|
||||
exclude_file_name_regexp--sc_require_config_h_first = ^examples/
|
||||
|
||||
exclude_file_name_regexp--sc_trailing_blank = \
|
||||
(/qemuhelpdata/|\.(fig|gif|ico|png)$$)
|
||||
@@ -827,6 +831,3 @@ exclude_file_name_regexp--sc_unmarked_diagnostics = \
|
||||
^(docs/apibuild.py|tests/virt-aa-helper-test)$$
|
||||
|
||||
exclude_file_name_regexp--sc_size_of_brackets = cfg.mk
|
||||
|
||||
exclude_file_name_regexp--sc_correct_id_types = \
|
||||
(^src/locking/lock_protocol.x$$)
|
||||
|
618
configure.ac
@@ -35,7 +35,8 @@ EXTRA_DIST = \
|
||||
libvirtd.conf \
|
||||
libvirtd.init.in \
|
||||
libvirtd.upstart \
|
||||
libvirtd.policy.in \
|
||||
libvirtd.policy-0 \
|
||||
libvirtd.policy-1 \
|
||||
libvirtd.sasl \
|
||||
libvirtd.sysconf \
|
||||
libvirtd.sysctl \
|
||||
@@ -44,7 +45,7 @@ EXTRA_DIST = \
|
||||
libvirtd.qemu.logrotate.in \
|
||||
libvirtd.lxc.logrotate.in \
|
||||
libvirtd.uml.logrotate.in \
|
||||
test_libvirtd.aug.in \
|
||||
test_libvirtd.aug \
|
||||
THREADS.txt \
|
||||
libvirtd.pod.in \
|
||||
libvirtd.8.in \
|
||||
@@ -57,12 +58,12 @@ QEMU_PROTOCOL = $(top_srcdir)/src/remote/qemu_protocol.x
|
||||
|
||||
$(srcdir)/remote_dispatch.h: $(srcdir)/../src/rpc/gendispatch.pl \
|
||||
$(REMOTE_PROTOCOL)
|
||||
$(AM_V_GEN)$(PERL) -w $(srcdir)/../src/rpc/gendispatch.pl -b remote REMOTE \
|
||||
$(AM_V_GEN)perl -w $(srcdir)/../src/rpc/gendispatch.pl -b remote \
|
||||
$(REMOTE_PROTOCOL) > $@
|
||||
|
||||
$(srcdir)/qemu_dispatch.h: $(srcdir)/../src/rpc/gendispatch.pl \
|
||||
$(QEMU_PROTOCOL)
|
||||
$(AM_V_GEN)$(PERL) -w $(srcdir)/../src/rpc/gendispatch.pl -b qemu QEMU \
|
||||
$(AM_V_GEN)perl -w $(srcdir)/../src/rpc/gendispatch.pl -b qemu \
|
||||
$(QEMU_PROTOCOL) > $@
|
||||
|
||||
if WITH_LIBVIRTD
|
||||
@@ -80,13 +81,12 @@ augeas_DATA = libvirtd.aug
|
||||
augeastestsdir = $(datadir)/augeas/lenses/tests
|
||||
augeastests_DATA = test_libvirtd.aug
|
||||
|
||||
CLEANFILES += test_libvirtd.aug
|
||||
|
||||
libvirtd.8: $(srcdir)/libvirtd.8.in
|
||||
$(AM_V_GEN)sed \
|
||||
-e 's!SYSCONFDIR!$(sysconfdir)!g' \
|
||||
-e 's!LOCALSTATEDIR!$(localstatedir)!g' \
|
||||
< $< > $@-t && \
|
||||
sed \
|
||||
-e 's![@]sysconfdir[@]!$(sysconfdir)!g' \
|
||||
-e 's![@]localstatedir[@]!$(localstatedir)!g' \
|
||||
-e 's![@]remote_pid_file[@]!$(REMOTE_PID_FILE)!g' \
|
||||
< $< > $@-t
|
||||
mv $@-t $@
|
||||
|
||||
libvirtd_SOURCES = $(DAEMON_SOURCES)
|
||||
@@ -94,10 +94,11 @@ libvirtd_SOURCES = $(DAEMON_SOURCES)
|
||||
#-D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_POSIX_C_SOURCE=199506L
|
||||
libvirtd_CFLAGS = \
|
||||
$(LIBXML_CFLAGS) $(GNUTLS_CFLAGS) $(SASL_CFLAGS) \
|
||||
$(XDR_CFLAGS) $(POLKIT_CFLAGS) $(DBUS_CFLAGS) $(LIBNL_CFLAGS) \
|
||||
$(XDR_CFLAGS) $(POLKIT_CFLAGS) $(DBUS_CFLAGS) \
|
||||
$(WARN_CFLAGS) \
|
||||
$(COVERAGE_CFLAGS) \
|
||||
-DQEMUD_PID_FILE="\"$(QEMUD_PID_FILE)\""
|
||||
-DQEMUD_PID_FILE="\"$(QEMUD_PID_FILE)\"" \
|
||||
-DREMOTE_PID_FILE="\"$(REMOTE_PID_FILE)\""
|
||||
|
||||
libvirtd_LDFLAGS = \
|
||||
$(WARN_CFLAGS) \
|
||||
@@ -108,11 +109,10 @@ libvirtd_LDADD = \
|
||||
$(GNUTLS_LIBS) \
|
||||
$(SASL_LIBS) \
|
||||
$(DBUS_LIBS) \
|
||||
$(POLKIT_LIBS) \
|
||||
$(LIBNL_LIBS)
|
||||
$(POLKIT_LIBS)
|
||||
|
||||
if WITH_DTRACE_PROBES
|
||||
libvirtd_LDADD += ../src/libvirt_probes.lo
|
||||
libvirtd_LDADD += ../src/probes.o
|
||||
endif
|
||||
|
||||
libvirtd_LDADD += \
|
||||
@@ -121,19 +121,12 @@ libvirtd_LDADD += \
|
||||
if ! WITH_DRIVER_MODULES
|
||||
if WITH_QEMU
|
||||
libvirtd_LDADD += ../src/libvirt_driver_qemu.la
|
||||
if WITH_DTRACE_PROBES
|
||||
libvirtd_LDADD += ../src/libvirt_qemu_probes.lo
|
||||
endif
|
||||
endif
|
||||
|
||||
if WITH_LXC
|
||||
libvirtd_LDADD += ../src/libvirt_driver_lxc.la
|
||||
endif
|
||||
|
||||
if WITH_XEN
|
||||
libvirtd_LDADD += ../src/libvirt_driver_xen.la
|
||||
endif
|
||||
|
||||
if WITH_LIBXL
|
||||
libvirtd_LDADD += ../src/libvirt_driver_libxl.la
|
||||
endif
|
||||
@@ -142,7 +135,7 @@ if WITH_UML
|
||||
libvirtd_LDADD += ../src/libvirt_driver_uml.la
|
||||
endif
|
||||
|
||||
if WITH_STORAGE
|
||||
if WITH_STORAGE_DIR
|
||||
libvirtd_LDADD += ../src/libvirt_driver_storage.la
|
||||
endif
|
||||
|
||||
@@ -150,7 +143,7 @@ if WITH_NETWORK
|
||||
libvirtd_LDADD += ../src/libvirt_driver_network.la
|
||||
endif
|
||||
|
||||
if WITH_INTERFACE
|
||||
if WITH_NETCF
|
||||
libvirtd_LDADD += ../src/libvirt_driver_interface.la
|
||||
endif
|
||||
|
||||
@@ -172,20 +165,13 @@ libvirtd_LDADD += ../src/libvirt.la
|
||||
if HAVE_POLKIT
|
||||
if HAVE_POLKIT0
|
||||
policydir = $(datadir)/PolicyKit/policy
|
||||
policyauth = auth_admin_keep_session
|
||||
policyfile = libvirtd.policy-0
|
||||
else
|
||||
policydir = $(datadir)/polkit-1/actions
|
||||
policyauth = auth_admin_keep
|
||||
policyfile = libvirtd.policy-1
|
||||
endif
|
||||
endif
|
||||
|
||||
libvirtd.policy: libvirtd.policy.in $(top_builddir)/config.status
|
||||
$(AM_V_GEN) sed \
|
||||
-e 's![@]authaction[@]!$(policyauth)!g' \
|
||||
< $< > $@-t && \
|
||||
mv $@-t $@
|
||||
BUILT_SOURCES += libvirtd.policy
|
||||
|
||||
install-data-local: install-init-redhat install-init-systemd install-init-upstart \
|
||||
install-data-sasl install-data-polkit \
|
||||
install-logrotate install-sysctl
|
||||
@@ -203,7 +189,7 @@ uninstall-local:: uninstall-init-redhat uninstall-init-systemd uninstall-init-up
|
||||
if HAVE_POLKIT
|
||||
install-data-polkit::
|
||||
$(MKDIR_P) $(DESTDIR)$(policydir)
|
||||
$(INSTALL_DATA) libvirtd.policy $(DESTDIR)$(policydir)/org.libvirt.unix.policy
|
||||
$(INSTALL_DATA) $(srcdir)/$(policyfile) $(DESTDIR)$(policydir)/org.libvirt.unix.policy
|
||||
uninstall-data-polkit::
|
||||
rm -f $(DESTDIR)$(policydir)/org.libvirt.unix.policy
|
||||
rmdir $(DESTDIR)$(policydir) || :
|
||||
@@ -221,15 +207,15 @@ LOGROTATE_CONFS = libvirtd.qemu.logrotate libvirtd.lxc.logrotate \
|
||||
BUILT_SOURCES += $(LOGROTATE_CONFS)
|
||||
|
||||
libvirtd.logrotate: libvirtd.logrotate.in
|
||||
$(AM_V_GEN)sed \
|
||||
sed \
|
||||
-e 's![@]localstatedir[@]!$(localstatedir)!g' \
|
||||
< $< > $@-t && \
|
||||
< $< > $@-t
|
||||
mv $@-t $@
|
||||
|
||||
libvirtd.qemu.logrotate: libvirtd.qemu.logrotate.in
|
||||
$(AM_V_GEN)sed \
|
||||
sed \
|
||||
-e 's![@]localstatedir[@]!$(localstatedir)!g' \
|
||||
< $< > $@-t && \
|
||||
< $< > $@-t
|
||||
mv $@-t $@
|
||||
|
||||
libvirtd.lxc.logrotate: libvirtd.lxc.logrotate.in
|
||||
@@ -328,7 +314,7 @@ BUILT_SOURCES += libvirtd.service
|
||||
|
||||
install-init-systemd: install-sysconfig libvirtd.service
|
||||
$(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR)
|
||||
$(INSTALL_DATA) libvirtd.service \
|
||||
$(INSTALL_SCRIPT) libvirtd.service \
|
||||
$(DESTDIR)$(SYSTEMD_UNIT_DIR)/libvirtd.service
|
||||
|
||||
uninstall-init-systemd: uninstall-sysconfig
|
||||
@@ -358,16 +344,9 @@ libvirtd.service: libvirtd.service.in $(top_builddir)/config.status
|
||||
mv $@-t $@
|
||||
|
||||
|
||||
check-local: check-augeas
|
||||
|
||||
AUG_GENTEST = $(PERL) $(top_srcdir)/build-aux/augeas-gentest.pl
|
||||
|
||||
test_libvirtd.aug: test_libvirtd.aug.in $(srcdir)/libvirtd.conf
|
||||
$(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/libvirtd.conf $< $@
|
||||
|
||||
check-augeas: test_libvirtd.aug
|
||||
check-local:
|
||||
$(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
|
||||
'$(AUGPARSE)' -I $(srcdir) test_libvirtd.aug; \
|
||||
'$(AUGPARSE)' -I $(srcdir) $(srcdir)/test_libvirtd.aug; \
|
||||
fi
|
||||
|
||||
|
||||
@@ -384,8 +363,7 @@ POD2MAN = pod2man -c "Virtualization Support" \
|
||||
-r "$(PACKAGE)-$(VERSION)" -s 8
|
||||
|
||||
$(srcdir)/libvirtd.8.in: libvirtd.pod.in
|
||||
$(AM_V_GEN)$(POD2MAN) --name LIBVIRTD $< $@ \
|
||||
&& if grep 'POD ERROR' $@ ; then rm $@; exit 1; fi
|
||||
$(AM_V_GEN)$(POD2MAN) $< $@
|
||||
|
||||
# This is needed for clients too, so can't wrap in
|
||||
# the WITH_LIBVIRTD conditional
|
||||
|
@@ -15,8 +15,8 @@
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see
|
||||
* <http://www.gnu.org/licenses/>.
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* Author: Daniel P. Berrange <berrange@redhat.com>
|
||||
*/
|
||||
@@ -35,6 +35,10 @@
|
||||
|
||||
#define VIR_FROM_THIS VIR_FROM_CONF
|
||||
|
||||
#define virConfError(code, ...) \
|
||||
virReportErrorHelper(VIR_FROM_THIS, code, __FILE__, \
|
||||
__FUNCTION__, __LINE__, __VA_ARGS__)
|
||||
|
||||
/* Allocate an array of malloc'd strings from the config file, filename
|
||||
* (used only in diagnostics), using handle "conf". Upon error, return -1
|
||||
* and free any allocated memory. Otherwise, save the array in *list_arg
|
||||
@@ -45,24 +49,24 @@ remoteConfigGetStringList(virConfPtr conf, const char *key, char ***list_arg,
|
||||
const char *filename)
|
||||
{
|
||||
char **list;
|
||||
virConfValuePtr p = virConfGetValue(conf, key);
|
||||
virConfValuePtr p = virConfGetValue (conf, key);
|
||||
if (!p)
|
||||
return 0;
|
||||
|
||||
switch (p->type) {
|
||||
case VIR_CONF_STRING:
|
||||
if (VIR_ALLOC_N(list, 2) < 0) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("failed to allocate memory for %s config list"),
|
||||
key);
|
||||
virConfError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("failed to allocate memory for %s config list"),
|
||||
key);
|
||||
return -1;
|
||||
}
|
||||
list[0] = strdup(p->str);
|
||||
list[0] = strdup (p->str);
|
||||
list[1] = NULL;
|
||||
if (list[0] == NULL) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("failed to allocate memory for %s config list value"),
|
||||
key);
|
||||
virConfError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("failed to allocate memory for %s config list value"),
|
||||
key);
|
||||
VIR_FREE(list);
|
||||
return -1;
|
||||
}
|
||||
@@ -74,29 +78,29 @@ remoteConfigGetStringList(virConfPtr conf, const char *key, char ***list_arg,
|
||||
for (pp = p->list; pp; pp = pp->next)
|
||||
len++;
|
||||
if (VIR_ALLOC_N(list, 1+len) < 0) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("failed to allocate memory for %s config list"),
|
||||
key);
|
||||
virConfError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("failed to allocate memory for %s config list"),
|
||||
key);
|
||||
return -1;
|
||||
}
|
||||
for (i = 0, pp = p->list; pp; ++i, pp = pp->next) {
|
||||
if (pp->type != VIR_CONF_STRING) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("remoteReadConfigFile: %s: %s:"
|
||||
" must be a string or list of strings"),
|
||||
filename, key);
|
||||
virConfError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("remoteReadConfigFile: %s: %s:"
|
||||
" must be a string or list of strings"),
|
||||
filename, key);
|
||||
VIR_FREE(list);
|
||||
return -1;
|
||||
}
|
||||
list[i] = strdup(pp->str);
|
||||
list[i] = strdup (pp->str);
|
||||
if (list[i] == NULL) {
|
||||
int j;
|
||||
for (j = 0 ; j < i ; j++)
|
||||
VIR_FREE(list[j]);
|
||||
VIR_FREE(list);
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("failed to allocate memory for %s config list value"),
|
||||
key);
|
||||
virConfError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("failed to allocate memory for %s config list value"),
|
||||
key);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -106,10 +110,10 @@ remoteConfigGetStringList(virConfPtr conf, const char *key, char ***list_arg,
|
||||
}
|
||||
|
||||
default:
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("remoteReadConfigFile: %s: %s:"
|
||||
" must be a string or list of strings"),
|
||||
filename, key);
|
||||
virConfError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("remoteReadConfigFile: %s: %s:"
|
||||
" must be a string or list of strings"),
|
||||
filename, key);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -119,15 +123,15 @@ remoteConfigGetStringList(virConfPtr conf, const char *key, char ***list_arg,
|
||||
|
||||
/* A helper function used by each of the following macros. */
|
||||
static int
|
||||
checkType(virConfValuePtr p, const char *filename,
|
||||
const char *key, virConfType required_type)
|
||||
checkType (virConfValuePtr p, const char *filename,
|
||||
const char *key, virConfType required_type)
|
||||
{
|
||||
if (p->type != required_type) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("remoteReadConfigFile: %s: %s: invalid type:"
|
||||
" got %s; expected %s"), filename, key,
|
||||
virConfTypeName(p->type),
|
||||
virConfTypeName(required_type));
|
||||
virConfError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("remoteReadConfigFile: %s: %s: invalid type:"
|
||||
" got %s; expected %s"), filename, key,
|
||||
virConfTypeName (p->type),
|
||||
virConfTypeName (required_type));
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
@@ -139,12 +143,12 @@ checkType(virConfValuePtr p, const char *filename,
|
||||
failure), give a diagnostic and "goto" the cleanup-and-fail label. */
|
||||
#define GET_CONF_STR(conf, filename, var_name) \
|
||||
do { \
|
||||
virConfValuePtr p = virConfGetValue(conf, #var_name); \
|
||||
virConfValuePtr p = virConfGetValue (conf, #var_name); \
|
||||
if (p) { \
|
||||
if (checkType(p, filename, #var_name, VIR_CONF_STRING) < 0) \
|
||||
if (checkType (p, filename, #var_name, VIR_CONF_STRING) < 0) \
|
||||
goto error; \
|
||||
VIR_FREE(data->var_name); \
|
||||
if (!(data->var_name = strdup(p->str))) { \
|
||||
if (!(data->var_name = strdup (p->str))) { \
|
||||
virReportOOMError(); \
|
||||
goto error; \
|
||||
} \
|
||||
@@ -154,9 +158,9 @@ checkType(virConfValuePtr p, const char *filename,
|
||||
/* Like GET_CONF_STR, but for integral values. */
|
||||
#define GET_CONF_INT(conf, filename, var_name) \
|
||||
do { \
|
||||
virConfValuePtr p = virConfGetValue(conf, #var_name); \
|
||||
virConfValuePtr p = virConfGetValue (conf, #var_name); \
|
||||
if (p) { \
|
||||
if (checkType(p, filename, #var_name, VIR_CONF_LONG) < 0) \
|
||||
if (checkType (p, filename, #var_name, VIR_CONF_LONG) < 0) \
|
||||
goto error; \
|
||||
data->var_name = p->l; \
|
||||
} \
|
||||
@@ -166,11 +170,11 @@ checkType(virConfValuePtr p, const char *filename,
|
||||
static int remoteConfigGetAuth(virConfPtr conf, const char *key, int *auth, const char *filename) {
|
||||
virConfValuePtr p;
|
||||
|
||||
p = virConfGetValue(conf, key);
|
||||
p = virConfGetValue (conf, key);
|
||||
if (!p)
|
||||
return 0;
|
||||
|
||||
if (checkType(p, filename, key, VIR_CONF_STRING) < 0)
|
||||
if (checkType (p, filename, key, VIR_CONF_STRING) < 0)
|
||||
return -1;
|
||||
|
||||
if (!p->str)
|
||||
@@ -185,9 +189,9 @@ static int remoteConfigGetAuth(virConfPtr conf, const char *key, int *auth, cons
|
||||
} else if (STREQ(p->str, "polkit")) {
|
||||
*auth = VIR_NET_SERVER_SERVICE_AUTH_POLKIT;
|
||||
} else {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("remoteReadConfigFile: %s: %s: unsupported auth %s"),
|
||||
filename, key, p->str);
|
||||
virConfError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("remoteReadConfigFile: %s: %s: unsupported auth %s"),
|
||||
filename, key, p->str);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -201,16 +205,16 @@ daemonConfigFilePath(bool privileged, char **configfile)
|
||||
if (!(*configfile = strdup(SYSCONFDIR "/libvirt/libvirtd.conf")))
|
||||
goto no_memory;
|
||||
} else {
|
||||
char *configdir = NULL;
|
||||
char *userdir = NULL;
|
||||
|
||||
if (!(configdir = virGetUserConfigDirectory()))
|
||||
if (!(userdir = virGetUserDirectory(geteuid())))
|
||||
goto error;
|
||||
|
||||
if (virAsprintf(configfile, "%s/libvirtd.conf", configdir) < 0) {
|
||||
VIR_FREE(configdir);
|
||||
if (virAsprintf(configfile, "%s/.libvirt/libvirtd.conf", userdir) < 0) {
|
||||
VIR_FREE(userdir);
|
||||
goto no_memory;
|
||||
}
|
||||
VIR_FREE(configdir);
|
||||
VIR_FREE(userdir);
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -366,11 +370,11 @@ daemonConfigLoadOptions(struct daemonConfig *data,
|
||||
const char *filename,
|
||||
virConfPtr conf)
|
||||
{
|
||||
GET_CONF_INT(conf, filename, listen_tcp);
|
||||
GET_CONF_INT(conf, filename, listen_tls);
|
||||
GET_CONF_STR(conf, filename, tls_port);
|
||||
GET_CONF_STR(conf, filename, tcp_port);
|
||||
GET_CONF_STR(conf, filename, listen_addr);
|
||||
GET_CONF_INT (conf, filename, listen_tcp);
|
||||
GET_CONF_INT (conf, filename, listen_tls);
|
||||
GET_CONF_STR (conf, filename, tls_port);
|
||||
GET_CONF_STR (conf, filename, tcp_port);
|
||||
GET_CONF_STR (conf, filename, listen_addr);
|
||||
|
||||
if (remoteConfigGetAuth(conf, "auth_unix_rw", &data->auth_unix_rw, filename) < 0)
|
||||
goto error;
|
||||
@@ -393,22 +397,22 @@ daemonConfigLoadOptions(struct daemonConfig *data,
|
||||
if (remoteConfigGetAuth(conf, "auth_tls", &data->auth_tls, filename) < 0)
|
||||
goto error;
|
||||
|
||||
GET_CONF_STR(conf, filename, unix_sock_group);
|
||||
GET_CONF_STR(conf, filename, unix_sock_ro_perms);
|
||||
GET_CONF_STR(conf, filename, unix_sock_rw_perms);
|
||||
GET_CONF_STR (conf, filename, unix_sock_group);
|
||||
GET_CONF_STR (conf, filename, unix_sock_ro_perms);
|
||||
GET_CONF_STR (conf, filename, unix_sock_rw_perms);
|
||||
|
||||
GET_CONF_STR(conf, filename, unix_sock_dir);
|
||||
GET_CONF_STR (conf, filename, unix_sock_dir);
|
||||
|
||||
GET_CONF_INT(conf, filename, mdns_adv);
|
||||
GET_CONF_STR(conf, filename, mdns_name);
|
||||
GET_CONF_INT (conf, filename, mdns_adv);
|
||||
GET_CONF_STR (conf, filename, mdns_name);
|
||||
|
||||
GET_CONF_INT(conf, filename, tls_no_sanity_certificate);
|
||||
GET_CONF_INT(conf, filename, tls_no_verify_certificate);
|
||||
GET_CONF_INT (conf, filename, tls_no_sanity_certificate);
|
||||
GET_CONF_INT (conf, filename, tls_no_verify_certificate);
|
||||
|
||||
GET_CONF_STR(conf, filename, key_file);
|
||||
GET_CONF_STR(conf, filename, cert_file);
|
||||
GET_CONF_STR(conf, filename, ca_file);
|
||||
GET_CONF_STR(conf, filename, crl_file);
|
||||
GET_CONF_STR (conf, filename, key_file);
|
||||
GET_CONF_STR (conf, filename, cert_file);
|
||||
GET_CONF_STR (conf, filename, ca_file);
|
||||
GET_CONF_STR (conf, filename, crl_file);
|
||||
|
||||
if (remoteConfigGetStringList(conf, "tls_allowed_dn_list",
|
||||
&data->tls_allowed_dn_list, filename) < 0)
|
||||
@@ -420,28 +424,28 @@ daemonConfigLoadOptions(struct daemonConfig *data,
|
||||
goto error;
|
||||
|
||||
|
||||
GET_CONF_INT(conf, filename, min_workers);
|
||||
GET_CONF_INT(conf, filename, max_workers);
|
||||
GET_CONF_INT(conf, filename, max_clients);
|
||||
GET_CONF_INT (conf, filename, min_workers);
|
||||
GET_CONF_INT (conf, filename, max_workers);
|
||||
GET_CONF_INT (conf, filename, max_clients);
|
||||
|
||||
GET_CONF_INT(conf, filename, prio_workers);
|
||||
GET_CONF_INT (conf, filename, prio_workers);
|
||||
|
||||
GET_CONF_INT(conf, filename, max_requests);
|
||||
GET_CONF_INT(conf, filename, max_client_requests);
|
||||
GET_CONF_INT (conf, filename, max_requests);
|
||||
GET_CONF_INT (conf, filename, max_client_requests);
|
||||
|
||||
GET_CONF_INT(conf, filename, audit_level);
|
||||
GET_CONF_INT(conf, filename, audit_logging);
|
||||
GET_CONF_INT (conf, filename, audit_level);
|
||||
GET_CONF_INT (conf, filename, audit_logging);
|
||||
|
||||
GET_CONF_STR(conf, filename, host_uuid);
|
||||
GET_CONF_STR (conf, filename, host_uuid);
|
||||
|
||||
GET_CONF_INT(conf, filename, log_level);
|
||||
GET_CONF_STR(conf, filename, log_filters);
|
||||
GET_CONF_STR(conf, filename, log_outputs);
|
||||
GET_CONF_INT(conf, filename, log_buffer_size);
|
||||
GET_CONF_INT (conf, filename, log_level);
|
||||
GET_CONF_STR (conf, filename, log_filters);
|
||||
GET_CONF_STR (conf, filename, log_outputs);
|
||||
GET_CONF_INT (conf, filename, log_buffer_size);
|
||||
|
||||
GET_CONF_INT(conf, filename, keepalive_interval);
|
||||
GET_CONF_INT(conf, filename, keepalive_count);
|
||||
GET_CONF_INT(conf, filename, keepalive_required);
|
||||
GET_CONF_INT (conf, filename, keepalive_interval);
|
||||
GET_CONF_INT (conf, filename, keepalive_count);
|
||||
GET_CONF_INT (conf, filename, keepalive_required);
|
||||
|
||||
return 0;
|
||||
|
||||
|
@@ -15,8 +15,8 @@
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see
|
||||
* <http://www.gnu.org/licenses/>.
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* Author: Daniel P. Berrange <berrange@redhat.com>
|
||||
*/
|
||||
|
@@ -62,7 +62,6 @@ module Libvirtd =
|
||||
let logging_entry = int_entry "log_level"
|
||||
| str_entry "log_filters"
|
||||
| str_entry "log_outputs"
|
||||
| int_entry "log_buffer_size"
|
||||
|
||||
let auditing_entry = int_entry "audit_level"
|
||||
| bool_entry "audit_logging"
|
||||
@@ -71,8 +70,6 @@ module Libvirtd =
|
||||
| int_entry "keepalive_count"
|
||||
| bool_entry "keepalive_required"
|
||||
|
||||
let misc_entry = str_entry "host_uuid"
|
||||
|
||||
(* Each enty in the config is one of the following three ... *)
|
||||
let entry = network_entry
|
||||
| sock_acl_entry
|
||||
@@ -83,7 +80,6 @@ module Libvirtd =
|
||||
| logging_entry
|
||||
| auditing_entry
|
||||
| keepalive_entry
|
||||
| misc_entry
|
||||
let comment = [ label "#comment" . del /#[ \t]*/ "# " . store /([^ \t\n][^\n]*)?/ . del /\n/ "\n" ]
|
||||
let empty = [ label "#empty" . eol ]
|
||||
|
||||
|
@@ -15,8 +15,8 @@
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see
|
||||
* <http://www.gnu.org/licenses/>.
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* Author: Daniel P. Berrange <berrange@redhat.com>
|
||||
*/
|
||||
@@ -56,7 +56,6 @@
|
||||
#include "hooks.h"
|
||||
#include "uuid.h"
|
||||
#include "viraudit.h"
|
||||
#include "locking/lock_manager.h"
|
||||
|
||||
#ifdef WITH_DRIVER_MODULES
|
||||
# include "driver.h"
|
||||
@@ -67,9 +66,6 @@
|
||||
# ifdef WITH_LXC
|
||||
# include "lxc/lxc_driver.h"
|
||||
# endif
|
||||
# ifdef WITH_XEN
|
||||
# include "xen/xen_driver.h"
|
||||
# endif
|
||||
# ifdef WITH_LIBXL
|
||||
# include "libxl/libxl_driver.h"
|
||||
# endif
|
||||
@@ -79,10 +75,10 @@
|
||||
# ifdef WITH_NETWORK
|
||||
# include "network/bridge_driver.h"
|
||||
# endif
|
||||
# ifdef WITH_INTERFACE
|
||||
# include "interface/interface_driver.h"
|
||||
# ifdef WITH_NETCF
|
||||
# include "interface/netcf_driver.h"
|
||||
# endif
|
||||
# ifdef WITH_STORAGE
|
||||
# ifdef WITH_STORAGE_DIR
|
||||
# include "storage/storage_driver.h"
|
||||
# endif
|
||||
# ifdef WITH_NODE_DEVICES
|
||||
@@ -98,8 +94,6 @@
|
||||
|
||||
#include "configmake.h"
|
||||
|
||||
#include "virdbus.h"
|
||||
|
||||
#if HAVE_SASL
|
||||
virNetSASLContextPtr saslCtxt = NULL;
|
||||
#endif
|
||||
@@ -246,25 +240,17 @@ daemonPidFilePath(bool privileged,
|
||||
if (!(*pidfile = strdup(LOCALSTATEDIR "/run/libvirtd.pid")))
|
||||
goto no_memory;
|
||||
} else {
|
||||
char *rundir = NULL;
|
||||
mode_t old_umask;
|
||||
char *userdir = NULL;
|
||||
|
||||
if (!(rundir = virGetUserRuntimeDirectory()))
|
||||
if (!(userdir = virGetUserDirectory(geteuid())))
|
||||
goto error;
|
||||
|
||||
old_umask = umask(077);
|
||||
if (virFileMakePath(rundir) < 0) {
|
||||
umask(old_umask);
|
||||
goto error;
|
||||
}
|
||||
umask(old_umask);
|
||||
|
||||
if (virAsprintf(pidfile, "%s/libvirtd.pid", rundir) < 0) {
|
||||
VIR_FREE(rundir);
|
||||
if (virAsprintf(pidfile, "%s/.libvirt/libvirtd.pid", userdir) < 0) {
|
||||
VIR_FREE(userdir);
|
||||
goto no_memory;
|
||||
}
|
||||
|
||||
VIR_FREE(rundir);
|
||||
VIR_FREE(userdir);
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -294,25 +280,17 @@ daemonUnixSocketPaths(struct daemonConfig *config,
|
||||
if (!(*rosockfile = strdup(LOCALSTATEDIR "/run/libvirt/libvirt-sock-ro")))
|
||||
goto no_memory;
|
||||
} else {
|
||||
char *rundir = NULL;
|
||||
mode_t old_umask;
|
||||
char *userdir = NULL;
|
||||
|
||||
if (!(rundir = virGetUserRuntimeDirectory()))
|
||||
if (!(userdir = virGetUserDirectory(geteuid())))
|
||||
goto error;
|
||||
|
||||
old_umask = umask(077);
|
||||
if (virFileMakePath(rundir) < 0) {
|
||||
umask(old_umask);
|
||||
goto error;
|
||||
}
|
||||
umask(old_umask);
|
||||
|
||||
if (virAsprintf(sockfile, "%s/libvirt-sock", rundir) < 0) {
|
||||
VIR_FREE(rundir);
|
||||
if (virAsprintf(sockfile, "@%s/.libvirt/libvirt-sock", userdir) < 0) {
|
||||
VIR_FREE(userdir);
|
||||
goto no_memory;
|
||||
}
|
||||
|
||||
VIR_FREE(rundir);
|
||||
VIR_FREE(userdir);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
@@ -370,50 +348,25 @@ static void daemonInitialize(void)
|
||||
* If they try to open a connection for a module that
|
||||
* is not loaded they'll get a suitable error at that point
|
||||
*/
|
||||
# ifdef WITH_NETWORK
|
||||
virDriverLoadModule("network");
|
||||
# endif
|
||||
# ifdef WITH_STORAGE
|
||||
virDriverLoadModule("storage");
|
||||
# endif
|
||||
# ifdef WITH_NODE_DEVICES
|
||||
virDriverLoadModule("nodedev");
|
||||
# endif
|
||||
# ifdef WITH_SECRETS
|
||||
virDriverLoadModule("secret");
|
||||
# endif
|
||||
# ifdef WITH_NWFILTER
|
||||
virDriverLoadModule("nwfilter");
|
||||
# endif
|
||||
# ifdef WITH_INTERFACE
|
||||
virDriverLoadModule("interface");
|
||||
# endif
|
||||
# ifdef WITH_XEN
|
||||
virDriverLoadModule("xen");
|
||||
# endif
|
||||
# ifdef WITH_LIBXL
|
||||
virDriverLoadModule("libxl");
|
||||
# endif
|
||||
# ifdef WITH_QEMU
|
||||
virDriverLoadModule("qemu");
|
||||
# endif
|
||||
# ifdef WITH_LXC
|
||||
virDriverLoadModule("lxc");
|
||||
# endif
|
||||
# ifdef WITH_UML
|
||||
virDriverLoadModule("uml");
|
||||
# endif
|
||||
virDriverLoadModule("nwfilter");
|
||||
#else
|
||||
# ifdef WITH_NETWORK
|
||||
networkRegister();
|
||||
# endif
|
||||
# ifdef WITH_INTERFACE
|
||||
# ifdef WITH_NETCF
|
||||
interfaceRegister();
|
||||
# endif
|
||||
# ifdef WITH_STORAGE
|
||||
# ifdef WITH_STORAGE_DIR
|
||||
storageRegister();
|
||||
# endif
|
||||
# ifdef WITH_NODE_DEVICES
|
||||
# if defined(WITH_NODE_DEVICES)
|
||||
nodedevRegister();
|
||||
# endif
|
||||
# ifdef WITH_SECRETS
|
||||
@@ -422,9 +375,6 @@ static void daemonInitialize(void)
|
||||
# ifdef WITH_NWFILTER
|
||||
nwfilterRegister();
|
||||
# endif
|
||||
# ifdef WITH_XEN
|
||||
xenRegister();
|
||||
# endif
|
||||
# ifdef WITH_LIBXL
|
||||
libxlRegister();
|
||||
# endif
|
||||
@@ -471,7 +421,6 @@ static int daemonSetupNetworking(virNetServerPtr srv,
|
||||
goto error;
|
||||
}
|
||||
|
||||
VIR_DEBUG("Registering unix socket %s", sock_path);
|
||||
if (!(svc = virNetServerServiceNewUNIX(sock_path,
|
||||
unix_sock_rw_mask,
|
||||
unix_sock_gid,
|
||||
@@ -480,17 +429,15 @@ static int daemonSetupNetworking(virNetServerPtr srv,
|
||||
config->max_client_requests,
|
||||
NULL)))
|
||||
goto error;
|
||||
if (sock_path_ro) {
|
||||
VIR_DEBUG("Registering unix socket %s", sock_path_ro);
|
||||
if (!(svcRO = virNetServerServiceNewUNIX(sock_path_ro,
|
||||
unix_sock_ro_mask,
|
||||
unix_sock_gid,
|
||||
config->auth_unix_ro,
|
||||
true,
|
||||
config->max_client_requests,
|
||||
NULL)))
|
||||
goto error;
|
||||
}
|
||||
if (sock_path_ro &&
|
||||
!(svcRO = virNetServerServiceNewUNIX(sock_path_ro,
|
||||
unix_sock_ro_mask,
|
||||
unix_sock_gid,
|
||||
config->auth_unix_ro,
|
||||
true,
|
||||
config->max_client_requests,
|
||||
NULL)))
|
||||
goto error;
|
||||
|
||||
if (virNetServerAddService(srv, svc,
|
||||
config->mdns_adv && !ipsock ?
|
||||
@@ -504,8 +451,6 @@ static int daemonSetupNetworking(virNetServerPtr srv,
|
||||
|
||||
if (ipsock) {
|
||||
if (config->listen_tcp) {
|
||||
VIR_DEBUG("Registering TCP socket %s:%s",
|
||||
config->listen_addr, config->tcp_port);
|
||||
if (!(svcTCP = virNetServerServiceNewTCP(config->listen_addr,
|
||||
config->tcp_port,
|
||||
config->auth_tcp,
|
||||
@@ -542,8 +487,6 @@ static int daemonSetupNetworking(virNetServerPtr srv,
|
||||
goto error;
|
||||
}
|
||||
|
||||
VIR_DEBUG("Registering TLS socket %s:%s",
|
||||
config->listen_addr, config->tls_port);
|
||||
if (!(svcTLS =
|
||||
virNetServerServiceNewTCP(config->listen_addr,
|
||||
config->tls_port,
|
||||
@@ -551,7 +494,7 @@ static int daemonSetupNetworking(virNetServerPtr srv,
|
||||
false,
|
||||
config->max_client_requests,
|
||||
ctxt))) {
|
||||
virObjectUnref(ctxt);
|
||||
virNetTLSContextFree(ctxt);
|
||||
goto error;
|
||||
}
|
||||
if (virNetServerAddService(srv, svcTLS,
|
||||
@@ -559,7 +502,7 @@ static int daemonSetupNetworking(virNetServerPtr srv,
|
||||
!config->listen_tcp ? "_libvirt._tcp" : NULL) < 0)
|
||||
goto error;
|
||||
|
||||
virObjectUnref(ctxt);
|
||||
virNetTLSContextFree(ctxt);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -578,14 +521,24 @@ static int daemonSetupNetworking(virNetServerPtr srv,
|
||||
return 0;
|
||||
|
||||
error:
|
||||
virObjectUnref(svcTLS);
|
||||
virObjectUnref(svcTCP);
|
||||
virObjectUnref(svc);
|
||||
virObjectUnref(svcRO);
|
||||
virNetServerServiceFree(svcTLS);
|
||||
virNetServerServiceFree(svcTCP);
|
||||
virNetServerServiceFree(svc);
|
||||
virNetServerServiceFree(svcRO);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
static int daemonShutdownCheck(virNetServerPtr srv ATTRIBUTE_UNUSED,
|
||||
void *opaque ATTRIBUTE_UNUSED)
|
||||
{
|
||||
if (virStateActive())
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set up the logging environment
|
||||
* By default if daemonized all errors go to the logfile libvirtd.log,
|
||||
@@ -628,24 +581,7 @@ daemonSetupLogging(struct daemonConfig *config,
|
||||
virLogParseOutputs(config->log_outputs);
|
||||
|
||||
/*
|
||||
* If no defined outputs, and either running
|
||||
* as daemon or not on a tty, then first try
|
||||
* to direct it to the systemd journal
|
||||
* (if it exists)....
|
||||
*/
|
||||
if (virLogGetNbOutputs() == 0 &&
|
||||
(godaemon || !isatty(STDIN_FILENO))) {
|
||||
char *tmp;
|
||||
if (access("/run/systemd/journal/socket", W_OK) >= 0) {
|
||||
if (virAsprintf(&tmp, "%d:journald", virLogGetDefaultPriority()) < 0)
|
||||
goto no_memory;
|
||||
virLogParseOutputs(tmp);
|
||||
VIR_FREE(tmp);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* otherwise direct to libvirtd.log when running
|
||||
* If no defined outputs, then direct to libvirtd.log when running
|
||||
* as daemon. Otherwise the default output is stderr.
|
||||
*/
|
||||
if (virLogGetNbOutputs() == 0) {
|
||||
@@ -658,25 +594,16 @@ daemonSetupLogging(struct daemonConfig *config,
|
||||
LOCALSTATEDIR) == -1)
|
||||
goto no_memory;
|
||||
} else {
|
||||
char *logdir = virGetUserCacheDirectory();
|
||||
mode_t old_umask;
|
||||
|
||||
if (!logdir)
|
||||
char *userdir = virGetUserDirectory(geteuid());
|
||||
if (!userdir)
|
||||
goto error;
|
||||
|
||||
old_umask = umask(077);
|
||||
if (virFileMakePath(logdir) < 0) {
|
||||
umask(old_umask);
|
||||
goto error;
|
||||
}
|
||||
umask(old_umask);
|
||||
|
||||
if (virAsprintf(&tmp, "%d:file:%s/libvirtd.log",
|
||||
virLogGetDefaultPriority(), logdir) == -1) {
|
||||
VIR_FREE(logdir);
|
||||
if (virAsprintf(&tmp, "%d:file:%s/.libvirt/libvirtd.log",
|
||||
virLogGetDefaultPriority(), userdir) == -1) {
|
||||
VIR_FREE(userdir);
|
||||
goto no_memory;
|
||||
}
|
||||
VIR_FREE(logdir);
|
||||
VIR_FREE(userdir);
|
||||
}
|
||||
} else {
|
||||
if (virAsprintf(&tmp, "%d:stderr", virLogGetDefaultPriority()) < 0)
|
||||
@@ -705,23 +632,23 @@ error:
|
||||
static void
|
||||
daemonVersion(const char *argv0)
|
||||
{
|
||||
printf("%s (%s) %s\n", argv0, PACKAGE_NAME, PACKAGE_VERSION);
|
||||
printf ("%s (%s) %s\n", argv0, PACKAGE_NAME, PACKAGE_VERSION);
|
||||
}
|
||||
|
||||
#ifdef __sun
|
||||
static int
|
||||
daemonSetupPrivs(void)
|
||||
{
|
||||
chown("/var/run/libvirt", SYSTEM_UID, SYSTEM_UID);
|
||||
chown ("/var/run/libvirt", SYSTEM_UID, SYSTEM_UID);
|
||||
|
||||
if (__init_daemon_priv(PU_RESETGROUPS | PU_CLEARLIMITSET,
|
||||
SYSTEM_UID, SYSTEM_UID, PRIV_XVM_CONTROL, NULL)) {
|
||||
if (__init_daemon_priv (PU_RESETGROUPS | PU_CLEARLIMITSET,
|
||||
SYSTEM_UID, SYSTEM_UID, PRIV_XVM_CONTROL, NULL)) {
|
||||
VIR_ERROR(_("additional privileges are required"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (priv_set(PRIV_OFF, PRIV_ALLSETS, PRIV_FILE_LINK_ANY, PRIV_PROC_INFO,
|
||||
PRIV_PROC_SESSION, PRIV_PROC_EXEC, PRIV_PROC_FORK, NULL)) {
|
||||
if (priv_set (PRIV_OFF, PRIV_ALLSETS, PRIV_FILE_LINK_ANY, PRIV_PROC_INFO,
|
||||
PRIV_PROC_SESSION, PRIV_PROC_EXEC, PRIV_PROC_FORK, NULL)) {
|
||||
VIR_ERROR(_("failed to set reduced privileges"));
|
||||
return -1;
|
||||
}
|
||||
@@ -764,259 +691,78 @@ static int daemonSetupSignals(virNetServerPtr srv)
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static void daemonInhibitCallback(bool inhibit, void *opaque)
|
||||
{
|
||||
virNetServerPtr srv = opaque;
|
||||
|
||||
if (inhibit)
|
||||
virNetServerAddShutdownInhibition(srv);
|
||||
else
|
||||
virNetServerRemoveShutdownInhibition(srv);
|
||||
}
|
||||
|
||||
|
||||
#ifdef HAVE_DBUS
|
||||
static DBusConnection *sessionBus;
|
||||
static DBusConnection *systemBus;
|
||||
|
||||
static void daemonStopWorker(void *opaque)
|
||||
{
|
||||
virNetServerPtr srv = opaque;
|
||||
|
||||
VIR_DEBUG("Begin stop srv=%p", srv);
|
||||
|
||||
ignore_value(virStateStop());
|
||||
|
||||
VIR_DEBUG("Completed stop srv=%p", srv);
|
||||
|
||||
/* Exit libvirtd cleanly */
|
||||
virNetServerQuit(srv);
|
||||
}
|
||||
|
||||
|
||||
/* We do this in a thread to not block the main loop */
|
||||
static void daemonStop(virNetServerPtr srv)
|
||||
{
|
||||
virThread thr;
|
||||
virObjectRef(srv);
|
||||
if (virThreadCreate(&thr, false, daemonStopWorker, srv) < 0)
|
||||
virObjectUnref(srv);
|
||||
}
|
||||
|
||||
|
||||
static DBusHandlerResult
|
||||
handleSessionMessageFunc(DBusConnection *connection ATTRIBUTE_UNUSED,
|
||||
DBusMessage *message,
|
||||
void *opaque)
|
||||
{
|
||||
virNetServerPtr srv = opaque;
|
||||
|
||||
VIR_DEBUG("srv=%p", srv);
|
||||
|
||||
if (dbus_message_is_signal(message,
|
||||
DBUS_INTERFACE_LOCAL,
|
||||
"Disconnected"))
|
||||
daemonStop(srv);
|
||||
|
||||
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
|
||||
}
|
||||
|
||||
|
||||
static DBusHandlerResult
|
||||
handleSystemMessageFunc(DBusConnection *connection ATTRIBUTE_UNUSED,
|
||||
DBusMessage *message,
|
||||
void *opaque)
|
||||
{
|
||||
virNetServerPtr srv = opaque;
|
||||
|
||||
VIR_DEBUG("srv=%p", srv);
|
||||
|
||||
if (dbus_message_is_signal(message,
|
||||
"org.freedesktop.login1.Manager",
|
||||
"PrepareForShutdown"))
|
||||
daemonStop(srv);
|
||||
|
||||
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
static void daemonRunStateInit(void *opaque)
|
||||
{
|
||||
virNetServerPtr srv = opaque;
|
||||
|
||||
/* Since driver initialization can take time inhibit daemon shutdown until
|
||||
we're done so clients get a chance to connect */
|
||||
daemonInhibitCallback(true, srv);
|
||||
|
||||
/* Start the stateful HV drivers
|
||||
* This is deliberately done after telling the parent process
|
||||
* we're ready, since it can take a long time and this will
|
||||
* seriously delay OS bootup process */
|
||||
if (virStateInitialize(virNetServerIsPrivileged(srv),
|
||||
daemonInhibitCallback,
|
||||
srv) < 0) {
|
||||
if (virStateInitialize(virNetServerIsPrivileged(srv)) < 0) {
|
||||
VIR_ERROR(_("Driver state initialization failed"));
|
||||
/* Ensure the main event loop quits */
|
||||
kill(getpid(), SIGTERM);
|
||||
goto cleanup;
|
||||
virNetServerFree(srv);
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef HAVE_DBUS
|
||||
/* Tie the non-priviledged libvirtd to the session/shutdown lifecycle */
|
||||
if (!virNetServerIsPrivileged(srv)) {
|
||||
|
||||
sessionBus = virDBusGetSessionBus();
|
||||
if (sessionBus != NULL)
|
||||
dbus_connection_add_filter(sessionBus,
|
||||
handleSessionMessageFunc, srv, NULL);
|
||||
|
||||
systemBus = virDBusGetSystemBus();
|
||||
if (systemBus != NULL) {
|
||||
dbus_connection_add_filter(systemBus,
|
||||
handleSystemMessageFunc, srv, NULL);
|
||||
dbus_bus_add_match(systemBus,
|
||||
"type='signal',sender='org.freedesktop.login1', interface='org.freedesktop.login1.Manager'",
|
||||
NULL);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
/* Only now accept clients from network */
|
||||
virNetServerUpdateServices(srv, true);
|
||||
cleanup:
|
||||
daemonInhibitCallback(false, srv);
|
||||
virObjectUnref(srv);
|
||||
virNetServerFree(srv);
|
||||
}
|
||||
|
||||
static int daemonStateInit(virNetServerPtr srv)
|
||||
{
|
||||
virThread thr;
|
||||
virObjectRef(srv);
|
||||
virNetServerRef(srv);
|
||||
if (virThreadCreate(&thr, false, daemonRunStateInit, srv) < 0) {
|
||||
virObjectUnref(srv);
|
||||
virNetServerFree(srv);
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int migrateProfile(void)
|
||||
{
|
||||
char *old_base = NULL;
|
||||
char *updated = NULL;
|
||||
char *home = NULL;
|
||||
char *xdg_dir = NULL;
|
||||
char *config_dir = NULL;
|
||||
const char *config_home;
|
||||
int ret = -1;
|
||||
mode_t old_umask;
|
||||
|
||||
VIR_DEBUG("Checking if user profile needs migrating");
|
||||
|
||||
if (!(home = virGetUserDirectory()))
|
||||
goto cleanup;
|
||||
|
||||
if (virAsprintf(&old_base, "%s/.libvirt", home) < 0) {
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
/* if the new directory is there or the old one is not: do nothing */
|
||||
if (!(config_dir = virGetUserConfigDirectory()))
|
||||
goto cleanup;
|
||||
|
||||
if (!virFileIsDir(old_base) || virFileExists(config_dir)) {
|
||||
VIR_DEBUG("No old profile in '%s' / "
|
||||
"new profile directory already present '%s'",
|
||||
old_base, config_dir);
|
||||
ret = 0;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
/* test if we already attempted to migrate first */
|
||||
if (virAsprintf(&updated, "%s/DEPRECATED-DIRECTORY", old_base) < 0) {
|
||||
goto cleanup;
|
||||
}
|
||||
if (virFileExists(updated)) {
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
config_home = getenv("XDG_CONFIG_HOME");
|
||||
if (config_home && config_home[0] != '\0') {
|
||||
xdg_dir = strdup(config_home);
|
||||
} else {
|
||||
if (virAsprintf(&xdg_dir, "%s/.config", home) < 0) {
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
|
||||
old_umask = umask(077);
|
||||
if (virFileMakePath(xdg_dir) < 0) {
|
||||
umask(old_umask);
|
||||
goto cleanup;
|
||||
}
|
||||
umask(old_umask);
|
||||
|
||||
if (rename(old_base, config_dir) < 0) {
|
||||
int fd = creat(updated, 0600);
|
||||
VIR_FORCE_CLOSE(fd);
|
||||
VIR_ERROR(_("Unable to migrate %s to %s"), old_base, config_dir);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
VIR_DEBUG("Profile migrated from %s to %s", old_base, config_dir);
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
VIR_FREE(home);
|
||||
VIR_FREE(old_base);
|
||||
VIR_FREE(xdg_dir);
|
||||
VIR_FREE(config_dir);
|
||||
VIR_FREE(updated);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Print command-line usage. */
|
||||
static void
|
||||
daemonUsage(const char *argv0, bool privileged)
|
||||
{
|
||||
fprintf(stderr,
|
||||
_("\n"
|
||||
"Usage:\n"
|
||||
" %s [options]\n"
|
||||
"\n"
|
||||
"Options:\n"
|
||||
" -v | --verbose Verbose messages.\n"
|
||||
" -d | --daemon Run as a daemon & write PID file.\n"
|
||||
" -l | --listen Listen for TCP/IP connections.\n"
|
||||
" -t | --timeout <secs> Exit after timeout period.\n"
|
||||
" -f | --config <file> Configuration file.\n"
|
||||
" | --version Display version information.\n"
|
||||
" -p | --pid-file <file> Change name of PID file.\n"
|
||||
"\n"
|
||||
"libvirt management daemon:\n"),
|
||||
argv0);
|
||||
fprintf (stderr,
|
||||
_("\n\
|
||||
Usage:\n\
|
||||
%s [options]\n\
|
||||
\n\
|
||||
Options:\n\
|
||||
-v | --verbose Verbose messages.\n\
|
||||
-d | --daemon Run as a daemon & write PID file.\n\
|
||||
-l | --listen Listen for TCP/IP connections.\n\
|
||||
-t | --timeout <secs> Exit after timeout period.\n\
|
||||
-f | --config <file> Configuration file.\n\
|
||||
| --version Display version information.\n\
|
||||
-p | --pid-file <file> Change name of PID file.\n\
|
||||
\n\
|
||||
libvirt management daemon:\n"), argv0);
|
||||
|
||||
if (privileged) {
|
||||
fprintf(stderr,
|
||||
_("\n"
|
||||
" Default paths:\n"
|
||||
"\n"
|
||||
" Configuration file (unless overridden by -f):\n"
|
||||
" %s/libvirt/libvirtd.conf\n"
|
||||
"\n"
|
||||
" Sockets:\n"
|
||||
" %s/run/libvirt/libvirt-sock\n"
|
||||
" %s/run/libvirt/libvirt-sock-ro\n"
|
||||
"\n"
|
||||
" TLS:\n"
|
||||
" CA certificate: %s/pki/CA/caert.pem\n"
|
||||
" Server certificate: %s/pki/libvirt/servercert.pem\n"
|
||||
" Server private key: %s/pki/libvirt/private/serverkey.pem\n"
|
||||
"\n"
|
||||
" PID file (unless overridden by -p):\n"
|
||||
" %s/run/libvirtd.pid\n"
|
||||
"\n"),
|
||||
_("\n\
|
||||
Default paths:\n\
|
||||
\n\
|
||||
Configuration file (unless overridden by -f):\n\
|
||||
%s/libvirt/libvirtd.conf\n\
|
||||
\n\
|
||||
Sockets:\n\
|
||||
%s/run/libvirt/libvirt-sock\n\
|
||||
%s/run/libvirt/libvirt-sock-ro\n\
|
||||
\n\
|
||||
TLS:\n\
|
||||
CA certificate: %s/pki/CA/caert.pem\n\
|
||||
Server certificate: %s/pki/libvirt/servercert.pem\n\
|
||||
Server private key: %s/pki/libvirt/private/serverkey.pem\n\
|
||||
\n\
|
||||
PID file (unless overridden by -p):\n\
|
||||
%s/run/libvirtd.pid\n\
|
||||
\n"),
|
||||
SYSCONFDIR,
|
||||
LOCALSTATEDIR,
|
||||
LOCALSTATEDIR,
|
||||
@@ -1025,24 +771,24 @@ daemonUsage(const char *argv0, bool privileged)
|
||||
SYSCONFDIR,
|
||||
LOCALSTATEDIR);
|
||||
} else {
|
||||
fprintf(stderr, "%s",
|
||||
_("\n"
|
||||
" Default paths:\n"
|
||||
"\n"
|
||||
" Configuration file (unless overridden by -f):\n"
|
||||
" $XDG_CONFIG_HOME/libvirt/libvirtd.conf\n"
|
||||
"\n"
|
||||
" Sockets:\n"
|
||||
" $XDG_RUNTIME_DIR/libvirt/libvirt-sock\n"
|
||||
"\n"
|
||||
" TLS:\n"
|
||||
" CA certificate: $HOME/.pki/libvirt/cacert.pem\n"
|
||||
" Server certificate: $HOME/.pki/libvirt/servercert.pem\n"
|
||||
" Server private key: $HOME/.pki/libvirt/serverkey.pem\n"
|
||||
"\n"
|
||||
" PID file:\n"
|
||||
" $XDG_RUNTIME_DIR/libvirt/libvirtd.pid\n"
|
||||
"\n"));
|
||||
fprintf(stderr,
|
||||
"%s", _("\n\
|
||||
Default paths:\n\
|
||||
\n\
|
||||
Configuration file (unless overridden by -f):\n\
|
||||
$HOME/.libvirt/libvirtd.conf\n\
|
||||
\n\
|
||||
Sockets:\n\
|
||||
$HOME/.libvirt/libvirt-sock (in UNIX abstract namespace)\n\
|
||||
\n\
|
||||
TLS:\n\
|
||||
CA certificate: $HOME/.pki/libvirt/cacert.pem\n\
|
||||
Server certificate: $HOME/.pki/libvirt/servercert.pem\n\
|
||||
Server private key: $HOME/.pki/libvirt/serverkey.pem\n\
|
||||
\n\
|
||||
PID file:\n\
|
||||
$HOME/.libvirt/libvirtd.pid\n\
|
||||
\n"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1082,39 +828,16 @@ int main(int argc, char **argv) {
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
|
||||
if (setlocale(LC_ALL, "") == NULL ||
|
||||
bindtextdomain(PACKAGE, LOCALEDIR) == NULL ||
|
||||
if (setlocale (LC_ALL, "") == NULL ||
|
||||
bindtextdomain (PACKAGE, LOCALEDIR) == NULL ||
|
||||
textdomain(PACKAGE) == NULL ||
|
||||
virInitialize() < 0) {
|
||||
fprintf(stderr, _("%s: initialization failed\n"), argv[0]);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (strstr(argv[0], "lt-libvirtd") ||
|
||||
strstr(argv[0], "/daemon/.libs/libvirtd")) {
|
||||
char *tmp = strrchr(argv[0], '/');
|
||||
if (!tmp) {
|
||||
fprintf(stderr, _("%s: cannot identify driver directory\n"), argv[0]);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
*tmp = '\0';
|
||||
char *driverdir;
|
||||
if (virAsprintf(&driverdir, "%s/../../src/.libs", argv[0]) < 0) {
|
||||
fprintf(stderr, _("%s: initialization failed\n"), argv[0]);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (access(driverdir, R_OK) < 0) {
|
||||
fprintf(stderr, _("%s: expected driver directory '%s' is missing\n"),
|
||||
argv[0], driverdir);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
virLockManagerSetPluginDir(driverdir);
|
||||
#ifdef WITH_DRIVER_MODULES
|
||||
virDriverModuleInitialize(driverdir);
|
||||
#endif
|
||||
*tmp = '/';
|
||||
/* Must not free 'driverdir' - it is still used */
|
||||
}
|
||||
/* initialize early logging */
|
||||
virLogSetFromEnv();
|
||||
|
||||
while (1) {
|
||||
int optidx = 0;
|
||||
@@ -1178,16 +901,10 @@ int main(int argc, char **argv) {
|
||||
default:
|
||||
VIR_ERROR(_("%s: internal error: unknown flag: %c"),
|
||||
argv[0], c);
|
||||
exit(EXIT_FAILURE);
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
if (optind != argc) {
|
||||
fprintf(stderr, "%s: unexpected, non-option, command line arguments\n",
|
||||
argv[0]);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (!(config = daemonConfigNew(privileged))) {
|
||||
VIR_ERROR(_("Can't create initial configuration"));
|
||||
exit(EXIT_FAILURE);
|
||||
@@ -1215,12 +932,6 @@ int main(int argc, char **argv) {
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (!privileged &&
|
||||
migrateProfile() < 0) {
|
||||
VIR_ERROR(_("Exiting due to failure to migrate profile"));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (config->host_uuid &&
|
||||
virSetHostUUIDStr(config->host_uuid) < 0) {
|
||||
VIR_ERROR(_("invalid host UUID: %s"), config->host_uuid);
|
||||
@@ -1238,7 +949,6 @@ int main(int argc, char **argv) {
|
||||
VIR_ERROR(_("Can't determine pid file path."));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
VIR_DEBUG("Decided on pid file path '%s'", NULLSTR(pid_file));
|
||||
|
||||
if (daemonUnixSocketPaths(config,
|
||||
privileged,
|
||||
@@ -1247,8 +957,6 @@ int main(int argc, char **argv) {
|
||||
VIR_ERROR(_("Can't determine socket paths"));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
VIR_DEBUG("Decided on socket paths '%s' and '%s'",
|
||||
sock_file, NULLSTR(sock_file_ro));
|
||||
|
||||
if (godaemon) {
|
||||
char ebuf[1024];
|
||||
@@ -1270,23 +978,21 @@ int main(int argc, char **argv) {
|
||||
if (privileged) {
|
||||
run_dir = strdup(LOCALSTATEDIR "/run/libvirt");
|
||||
} else {
|
||||
run_dir = virGetUserRuntimeDirectory();
|
||||
char *user_dir = virGetUserDirectory(geteuid());
|
||||
|
||||
if (!run_dir) {
|
||||
if (!user_dir) {
|
||||
VIR_ERROR(_("Can't determine user directory"));
|
||||
goto cleanup;
|
||||
}
|
||||
ignore_value(virAsprintf(&run_dir, "%s/.libvirt/", user_dir));
|
||||
VIR_FREE(user_dir);
|
||||
}
|
||||
if (!run_dir) {
|
||||
virReportOOMError();
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (privileged)
|
||||
old_umask = umask(022);
|
||||
else
|
||||
old_umask = umask(077);
|
||||
VIR_DEBUG("Ensuring run dir '%s' exists", run_dir);
|
||||
old_umask = umask(022);
|
||||
if (virFileMakePath(run_dir) < 0) {
|
||||
char ebuf[1024];
|
||||
VIR_ERROR(_("unable to create rundir %s: %s"), run_dir,
|
||||
@@ -1315,10 +1021,7 @@ int main(int argc, char **argv) {
|
||||
config->keepalive_count,
|
||||
!!config->keepalive_required,
|
||||
config->mdns_adv ? config->mdns_name : NULL,
|
||||
remoteClientInitHook,
|
||||
NULL,
|
||||
remoteClientFreeFunc,
|
||||
NULL))) {
|
||||
remoteClientInitHook))) {
|
||||
ret = VIR_DAEMON_ERR_INIT;
|
||||
goto cleanup;
|
||||
}
|
||||
@@ -1326,7 +1029,6 @@ int main(int argc, char **argv) {
|
||||
/* Beyond this point, nothing should rely on using
|
||||
* getuid/geteuid() == 0, for privilege level checks.
|
||||
*/
|
||||
VIR_DEBUG("Dropping privileges (if required)");
|
||||
if (daemonSetupPrivs() < 0) {
|
||||
ret = VIR_DAEMON_ERR_PRIVS;
|
||||
goto cleanup;
|
||||
@@ -1363,11 +1065,11 @@ int main(int argc, char **argv) {
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (timeout != -1) {
|
||||
VIR_DEBUG("Registering shutdown timeout %d", timeout);
|
||||
if (timeout != -1)
|
||||
virNetServerAutoShutdown(srv,
|
||||
timeout);
|
||||
}
|
||||
timeout,
|
||||
daemonShutdownCheck,
|
||||
NULL);
|
||||
|
||||
if ((daemonSetupSignals(srv)) < 0) {
|
||||
ret = VIR_DAEMON_ERR_SIGNAL;
|
||||
@@ -1375,13 +1077,11 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
|
||||
if (config->audit_level) {
|
||||
VIR_DEBUG("Attempting to configure auditing subsystem");
|
||||
if (virAuditOpen() < 0) {
|
||||
if (config->audit_level > 1) {
|
||||
ret = VIR_DAEMON_ERR_AUDIT;
|
||||
goto cleanup;
|
||||
}
|
||||
VIR_DEBUG("Proceeding without auditing");
|
||||
}
|
||||
}
|
||||
virAuditLog(config->audit_logging);
|
||||
@@ -1429,21 +1129,11 @@ int main(int argc, char **argv) {
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
#if defined(__linux__) && defined(NETLINK_ROUTE)
|
||||
/* Register the netlink event service for NETLINK_ROUTE */
|
||||
if (virNetlinkEventServiceStart(NETLINK_ROUTE, 0) < 0) {
|
||||
/* Register the netlink event service */
|
||||
if (virNetlinkEventServiceStart() < 0) {
|
||||
ret = VIR_DAEMON_ERR_NETWORK;
|
||||
goto cleanup;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(__linux__) && defined(NETLINK_KOBJECT_UEVENT)
|
||||
/* Register the netlink event service for NETLINK_KOBJECT_UEVENT */
|
||||
if (virNetlinkEventServiceStart(NETLINK_KOBJECT_UEVENT, 1) < 0) {
|
||||
ret = VIR_DAEMON_ERR_NETWORK;
|
||||
goto cleanup;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Run event loop. */
|
||||
virNetServerRun(srv);
|
||||
@@ -1454,11 +1144,11 @@ int main(int argc, char **argv) {
|
||||
0, "shutdown", NULL, NULL);
|
||||
|
||||
cleanup:
|
||||
virNetlinkEventServiceStopAll();
|
||||
virObjectUnref(remoteProgram);
|
||||
virObjectUnref(qemuProgram);
|
||||
virNetlinkEventServiceStop();
|
||||
virNetServerProgramFree(remoteProgram);
|
||||
virNetServerProgramFree(qemuProgram);
|
||||
virNetServerClose(srv);
|
||||
virObjectUnref(srv);
|
||||
virNetServerFree(srv);
|
||||
virNetlinkShutdown();
|
||||
if (statuswrite != -1) {
|
||||
if (ret != 0) {
|
||||
@@ -1480,6 +1170,7 @@ cleanup:
|
||||
VIR_FREE(run_dir);
|
||||
|
||||
daemonConfigFree(config);
|
||||
virLogShutdown();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@@ -251,7 +251,7 @@
|
||||
|
||||
# The minimum limit sets the number of workers to start up
|
||||
# initially. If the number of active clients exceeds this,
|
||||
# then more threads are spawned, up to max_workers limit.
|
||||
# then more threads are spawned, upto max_workers limit.
|
||||
# Typically you'd want max_workers to equal maximum number
|
||||
# of clients allowed
|
||||
#min_workers = 5
|
||||
@@ -267,7 +267,7 @@
|
||||
# at least as large as max_workers. Beyond this, RPC requests
|
||||
# will be read into memory and queued. This directly impact
|
||||
# memory usage, currently each request requires 256 KB of
|
||||
# memory. So by default up to 5 MB of memory is used
|
||||
# memory. So by default upto 5 MB of memory is used
|
||||
#
|
||||
# XXX this isn't actually enforced yet, only the per-client
|
||||
# limit is used so far
|
||||
@@ -291,13 +291,10 @@
|
||||
# Logging filters:
|
||||
# A filter allows to select a different logging level for a given category
|
||||
# of logs
|
||||
# The format for a filter is one of:
|
||||
# The format for a filter is:
|
||||
# x:name
|
||||
# x:+name
|
||||
# where name is a string which is matched against source file name,
|
||||
# e.g., "remote", "qemu", or "util/json", the optional "+" prefix
|
||||
# tells libvirt to log stack trace for each message matching name,
|
||||
# and x is the minimal level where matching messages should be logged:
|
||||
# where name is a match string e.g. remote or qemu
|
||||
# the x prefix is the minimal level where matching messages should be logged
|
||||
# 1: DEBUG
|
||||
# 2: INFO
|
||||
# 3: WARNING
|
||||
@@ -306,9 +303,10 @@
|
||||
# Multiple filter can be defined in a single @filters, they just need to be
|
||||
# separated by spaces.
|
||||
#
|
||||
# e.g. to only get warning or errors from the remote layer and only errors
|
||||
# from the event layer:
|
||||
#log_filters="3:remote 4:event"
|
||||
# e.g:
|
||||
# log_filters="3:remote 4:event"
|
||||
# to only get warning or errors from the remote layer and only errors from
|
||||
# the event layer.
|
||||
|
||||
# Logging outputs:
|
||||
# An output is one of the places to save logging information
|
||||
@@ -326,9 +324,9 @@
|
||||
# 4: ERROR
|
||||
#
|
||||
# Multiple output can be defined, they just need to be separated by spaces.
|
||||
# e.g. to log all warnings and errors to syslog under the libvirtd ident:
|
||||
#log_outputs="3:syslog:libvirtd"
|
||||
#
|
||||
# e.g.:
|
||||
# log_outputs="3:syslog:libvirtd"
|
||||
# to log all warnings and errors to syslog under the libvirtd ident
|
||||
|
||||
# Log debug buffer size: default 64
|
||||
# The daemon keeps an internal debug log buffer which will be dumped in case
|
||||
|
@@ -15,8 +15,8 @@
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see
|
||||
* <http://www.gnu.org/licenses/>.
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* Author: Daniel P. Berrange <berrange@redhat.com>
|
||||
*/
|
||||
|
@@ -54,10 +54,7 @@ Use this name for the PID file, overriding the default value.
|
||||
|
||||
=item B<-t, --timeout> I<SECONDS>
|
||||
|
||||
Exit after timeout period (in seconds) elapse with no client connections
|
||||
or registered resources. Be aware that resources such as autostart
|
||||
networks will result in never reaching the timeout, even when there are
|
||||
no client connections.
|
||||
Exit after timeout period (in seconds) expires.
|
||||
|
||||
=item B<-v, --verbose>
|
||||
|
||||
@@ -75,74 +72,41 @@ On receipt of B<SIGHUP> libvirtd will reload its configuration.
|
||||
|
||||
=head1 FILES
|
||||
|
||||
=head2 When run as B<root>.
|
||||
|
||||
=over
|
||||
|
||||
=item F<SYSCONFDIR/libvirtd.conf>
|
||||
=item F<@sysconfdir@/libvirtd.conf>
|
||||
|
||||
The default configuration file used by libvirtd, unless overridden on the
|
||||
command line using the B<-f>|B<--config> option.
|
||||
|
||||
=item F<LOCALSTATEDIR/run/libvirt/libvirt-sock>
|
||||
=item F<@localstatedir@/run/libvirt/libvirt-sock>
|
||||
|
||||
=item F<LOCALSTATEDIR/run/libvirt/libvirt-sock-ro>
|
||||
=item F<@localstatedir@/run/libvirt/libvirt-sock-ro>
|
||||
|
||||
The sockets libvirtd will use.
|
||||
The sockets libvirtd will use when B<run as root>.
|
||||
|
||||
=item F<SYSCONFDIR/pki/CA/cacert.pem>
|
||||
=item F<$HOME/.libvirt/libvirt-sock>
|
||||
|
||||
The socket libvirtd will use when run as a B<non-root> user.
|
||||
|
||||
=item F<@sysconfdir@/pki/CA/cacert.pem>
|
||||
|
||||
The TLS B<Certificate Authority> certificate libvirtd will use.
|
||||
|
||||
=item F<SYSCONFDIR/pki/libvirt/servercert.pem>
|
||||
=item F<@sysconfdir@/pki/libvirt/servercert.pem>
|
||||
|
||||
The TLS B<Server> certificate libvirtd will use.
|
||||
|
||||
=item F<SYSCONFDIR/pki/libvirt/private/serverkey.pem>
|
||||
=item F<@sysconfdir@/pki/libvirt/private/serverkey.pem>
|
||||
|
||||
The TLS B<Server> private key libvirtd will use.
|
||||
|
||||
=item F<LOCALSTATEDIR/run/libvirtd.pid>
|
||||
=item F<@remote_pid_file@>
|
||||
|
||||
The PID file to use, unless overridden by the B<-p>|B<--pid-file> option.
|
||||
|
||||
=back
|
||||
|
||||
=head2 When run as B<non-root>.
|
||||
|
||||
=over
|
||||
|
||||
=item F<$XDG_CONFIG_HOME/libvirtd.conf>
|
||||
|
||||
The default configuration file used by libvirtd, unless overridden on the
|
||||
command line using the B<-f>|B<--config> option.
|
||||
|
||||
=item F<$XDG_RUNTIME_DIR/libvirt/libvirt-sock>
|
||||
|
||||
The socket libvirtd will use.
|
||||
|
||||
=item F<$HOME/.pki/libvirt/cacert.pem>
|
||||
|
||||
The TLS B<Certificate Authority> certificate libvirtd will use.
|
||||
|
||||
=item F<$HOME/.pki/libvirt/servercert.pem>
|
||||
|
||||
The TLS B<Server> certificate libvirtd will use.
|
||||
|
||||
=item F<$HOME/.pki/libvirt/serverkey.pem>
|
||||
|
||||
The TLS B<Server> private key libvirtd will use.
|
||||
|
||||
=item F<$XDG_RUNTIME_DIR/libvirt/libvirtd.pid>
|
||||
|
||||
The PID file to use, unless overridden by the B<-p>|B<--pid-file> option.
|
||||
|
||||
=item If $XDG_CONFIG_HOME is not set in your environment, libvirtd will use F<$HOME/.config>
|
||||
|
||||
=item If $XDG_RUNTIME_DIR is not set in your environment, libvirtd will use F<$HOME/.cache>
|
||||
|
||||
=back
|
||||
|
||||
=head1 EXAMPLES
|
||||
|
||||
To retrieve the version of libvirtd:
|
||||
@@ -154,8 +118,8 @@ To retrieve the version of libvirtd:
|
||||
To start libvirtd, instructing it to daemonize and create a PID file:
|
||||
|
||||
# libvirtd -d
|
||||
# ls -la LOCALSTATEDIR/run/libvirtd.pid
|
||||
-rw-r--r-- 1 root root 6 Jul 9 02:40 LOCALSTATEDIR/run/libvirtd.pid
|
||||
# ls -la @remote_pid_file@
|
||||
-rw-r--r-- 1 root root 6 Jul 9 02:40 @remote_pid_file@
|
||||
#
|
||||
|
||||
=head1 BUGS
|
||||
@@ -186,7 +150,7 @@ Please refer to the AUTHORS file distributed with libvirt.
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright (C) 2006-2012 Red Hat, Inc., and the authors listed in the
|
||||
Copyright (C) 2006-2010 Red Hat, Inc., and the authors listed in the
|
||||
libvirt AUTHORS file.
|
||||
|
||||
=head1 LICENSE
|
||||
|
42
daemon/libvirtd.policy-0
Normal file
@@ -0,0 +1,42 @@
|
||||
<!DOCTYPE policyconfig PUBLIC
|
||||
"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
|
||||
"http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd">
|
||||
|
||||
<!--
|
||||
Policy definitions for libvirt daemon
|
||||
|
||||
Copyright (c) 2007 Daniel P. Berrange <berrange redhat com>
|
||||
|
||||
libvirt is licensed to you under the GNU Lesser General Public License
|
||||
version 2. See COPYING for details.
|
||||
|
||||
NOTE: If you make changes to this file, make sure to validate the file
|
||||
using the polkit-policy-file-validate(1) tool. Changes made to this
|
||||
file are instantly applied.
|
||||
-->
|
||||
|
||||
<policyconfig>
|
||||
<action id="org.libvirt.unix.monitor">
|
||||
<description>Monitor local virtualized systems</description>
|
||||
<message>System policy prevents monitoring of local virtualized systems</message>
|
||||
<defaults>
|
||||
<!-- Any program can use libvirt in read-only mode for monitoring,
|
||||
even if not part of a session -->
|
||||
<allow_any>yes</allow_any>
|
||||
<allow_inactive>yes</allow_inactive>
|
||||
<allow_active>yes</allow_active>
|
||||
</defaults>
|
||||
</action>
|
||||
|
||||
<action id="org.libvirt.unix.manage">
|
||||
<description>Manage local virtualized systems</description>
|
||||
<message>System policy prevents management of local virtualized systems</message>
|
||||
<defaults>
|
||||
<!-- Only a program in the active host session can use libvirt in
|
||||
read-write mode for management, and we require user password -->
|
||||
<allow_any>auth_admin</allow_any>
|
||||
<allow_inactive>auth_admin</allow_inactive>
|
||||
<allow_active>auth_admin_keep_session</allow_active>
|
||||
</defaults>
|
||||
</action>
|
||||
</policyconfig>
|
42
daemon/libvirtd.policy-1
Normal file
@@ -0,0 +1,42 @@
|
||||
<!DOCTYPE policyconfig PUBLIC
|
||||
"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
|
||||
"http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd">
|
||||
|
||||
<!--
|
||||
Policy definitions for libvirt daemon
|
||||
|
||||
Copyright (c) 2007 Daniel P. Berrange <berrange redhat com>
|
||||
|
||||
libvirt is licensed to you under the GNU Lesser General Public License
|
||||
version 2. See COPYING for details.
|
||||
|
||||
NOTE: If you make changes to this file, make sure to validate the file
|
||||
using the polkit-policy-file-validate(1) tool. Changes made to this
|
||||
file are instantly applied.
|
||||
-->
|
||||
|
||||
<policyconfig>
|
||||
<action id="org.libvirt.unix.monitor">
|
||||
<description>Monitor local virtualized systems</description>
|
||||
<message>System policy prevents monitoring of local virtualized systems</message>
|
||||
<defaults>
|
||||
<!-- Any program can use libvirt in read-only mode for monitoring,
|
||||
even if not part of a session -->
|
||||
<allow_any>yes</allow_any>
|
||||
<allow_inactive>yes</allow_inactive>
|
||||
<allow_active>yes</allow_active>
|
||||
</defaults>
|
||||
</action>
|
||||
|
||||
<action id="org.libvirt.unix.manage">
|
||||
<description>Manage local virtualized systems</description>
|
||||
<message>System policy prevents management of local virtualized systems</message>
|
||||
<defaults>
|
||||
<!-- Only a program in the active host session can use libvirt in
|
||||
read-write mode for management, and we require user password -->
|
||||
<allow_any>auth_admin</allow_any>
|
||||
<allow_inactive>auth_admin</allow_inactive>
|
||||
<allow_active>auth_admin_keep</allow_active>
|
||||
</defaults>
|
||||
</action>
|
||||
</policyconfig>
|
@@ -1,51 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE policyconfig PUBLIC
|
||||
"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
|
||||
"http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd">
|
||||
|
||||
<!--
|
||||
Policy definitions for libvirt daemon
|
||||
|
||||
Copyright (C) 2012 Red Hat, Inc.
|
||||
Copyright (C) 2007 Daniel P. Berrange <berrange redhat com>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library. If not, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<policyconfig>
|
||||
<action id="org.libvirt.unix.monitor">
|
||||
<description>Monitor local virtualized systems</description>
|
||||
<message>System policy prevents monitoring of local virtualized systems</message>
|
||||
<defaults>
|
||||
<!-- Any program can use libvirt in read-only mode for monitoring,
|
||||
even if not part of a session -->
|
||||
<allow_any>yes</allow_any>
|
||||
<allow_inactive>yes</allow_inactive>
|
||||
<allow_active>yes</allow_active>
|
||||
</defaults>
|
||||
</action>
|
||||
|
||||
<action id="org.libvirt.unix.manage">
|
||||
<description>Manage local virtualized systems</description>
|
||||
<message>System policy prevents management of local virtualized systems</message>
|
||||
<defaults>
|
||||
<!-- Any program can use libvirt in read/write mode if they
|
||||
provide the root password -->
|
||||
<allow_any>@authaction@</allow_any>
|
||||
<allow_inactive>@authaction@</allow_inactive>
|
||||
<allow_active>@authaction@</allow_active>
|
||||
</defaults>
|
||||
</action>
|
||||
</policyconfig>
|
@@ -18,12 +18,9 @@ mech_list: digest-md5
|
||||
# qemu+tcp://hostname/system?auth=sasl.gssapi
|
||||
#mech_list: digest-md5 gssapi
|
||||
|
||||
# Some older builds of MIT kerberos on Linux ignore this option &
|
||||
# instead need KRB5_KTNAME env var.
|
||||
# For modern Linux, and other OS, this should be sufficient
|
||||
#
|
||||
# There is no default value here, uncomment if you need this
|
||||
#keytab: /etc/libvirt/krb5.tab
|
||||
# MIT kerberos ignores this option & needs KRB5_KTNAME env var.
|
||||
# May be useful for other non-Linux OS though....
|
||||
keytab: /etc/libvirt/krb5.tab
|
||||
|
||||
# If using digest-md5 for username/passwds, then this is the file
|
||||
# containing the passwds. Use 'saslpasswd2 -a libvirt [username]'
|
||||
|
@@ -5,9 +5,11 @@
|
||||
|
||||
[Unit]
|
||||
Description=Virtualization daemon
|
||||
After=syslog.target
|
||||
After=udev.target
|
||||
After=avahi.target
|
||||
After=dbus.target
|
||||
Before=libvirt-guests.service
|
||||
After=network.target
|
||||
After=dbus.service
|
||||
|
||||
[Service]
|
||||
EnvironmentFile=-/etc/sysconfig/libvirtd
|
||||
|
1150
daemon/remote.c
@@ -14,8 +14,8 @@
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see
|
||||
* <http://www.gnu.org/licenses/>.
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* Author: Richard W.M. Jones <rjones@redhat.com>
|
||||
* Author: Daniel P. Berrange <berrange@redhat.com>
|
||||
@@ -35,8 +35,7 @@ extern size_t remoteNProcs;
|
||||
extern virNetServerProgramProc qemuProcs[];
|
||||
extern size_t qemuNProcs;
|
||||
|
||||
void remoteClientFreeFunc(void *data);
|
||||
void *remoteClientInitHook(virNetServerClientPtr client,
|
||||
void *opaque);
|
||||
int remoteClientInitHook(virNetServerPtr srv,
|
||||
virNetServerClientPtr client);
|
||||
|
||||
#endif /* __LIBVIRTD_REMOTE_H__ */
|
||||
|
@@ -14,8 +14,8 @@
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see
|
||||
* <http://www.gnu.org/licenses/>.
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* Author: Daniel P. Berrange <berrange@redhat.com>
|
||||
*/
|
||||
@@ -32,6 +32,10 @@
|
||||
|
||||
#define VIR_FROM_THIS VIR_FROM_STREAMS
|
||||
|
||||
#define virNetError(code, ...) \
|
||||
virReportErrorHelper(VIR_FROM_THIS, code, __FILE__, \
|
||||
__FUNCTION__, __LINE__, __VA_ARGS__)
|
||||
|
||||
struct daemonClientStream {
|
||||
daemonClientPrivatePtr priv;
|
||||
int refs;
|
||||
@@ -104,6 +108,14 @@ daemonStreamMessageFinished(virNetMessagePtr msg ATTRIBUTE_UNUSED,
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
daemonStreamEventFreeFunc(void *opaque)
|
||||
{
|
||||
virNetServerClientPtr client = opaque;
|
||||
|
||||
virNetServerClientFree(client);
|
||||
}
|
||||
|
||||
/*
|
||||
* Callback that gets invoked when a stream becomes writable/readable
|
||||
*/
|
||||
@@ -221,11 +233,11 @@ daemonStreamEvent(virStreamPtr st, int events, void *opaque)
|
||||
virStreamEventRemoveCallback(stream->st);
|
||||
virStreamAbort(stream->st);
|
||||
if (events & VIR_STREAM_EVENT_HANGUP)
|
||||
virReportError(VIR_ERR_RPC,
|
||||
"%s", _("stream had unexpected termination"));
|
||||
virNetError(VIR_ERR_RPC,
|
||||
"%s", _("stream had unexpected termination"));
|
||||
else
|
||||
virReportError(VIR_ERR_RPC,
|
||||
"%s", _("stream had I/O failure"));
|
||||
virNetError(VIR_ERR_RPC,
|
||||
"%s", _("stream had I/O failure"));
|
||||
|
||||
msg = virNetMessageNew(false);
|
||||
if (!msg) {
|
||||
@@ -324,12 +336,14 @@ daemonCreateClientStream(virNetServerClientPtr client,
|
||||
|
||||
stream->refs = 1;
|
||||
stream->priv = priv;
|
||||
stream->prog = virObjectRef(prog);
|
||||
stream->prog = prog;
|
||||
stream->procedure = header->proc;
|
||||
stream->serial = header->serial;
|
||||
stream->filterID = -1;
|
||||
stream->st = st;
|
||||
|
||||
virNetServerProgramRef(prog);
|
||||
|
||||
return stream;
|
||||
}
|
||||
|
||||
@@ -355,7 +369,7 @@ int daemonFreeClientStream(virNetServerClientPtr client,
|
||||
VIR_DEBUG("client=%p, proc=%d, serial=%d",
|
||||
client, stream->procedure, stream->serial);
|
||||
|
||||
virObjectUnref(stream->prog);
|
||||
virNetServerProgramFree(stream->prog);
|
||||
|
||||
msg = stream->rx;
|
||||
while (msg) {
|
||||
@@ -401,11 +415,10 @@ int daemonAddClientStream(virNetServerClientPtr client,
|
||||
|
||||
if (virStreamEventAddCallback(stream->st, 0,
|
||||
daemonStreamEvent, client,
|
||||
virObjectFreeCallback) < 0)
|
||||
daemonStreamEventFreeFunc) < 0)
|
||||
return -1;
|
||||
|
||||
virObjectRef(client);
|
||||
|
||||
virNetServerClientRef(client);
|
||||
if ((stream->filterID = virNetServerClientAddFilter(client,
|
||||
daemonStreamFilter,
|
||||
stream)) < 0) {
|
||||
@@ -605,13 +618,13 @@ daemonStreamHandleAbort(virNetServerClientPtr client,
|
||||
virStreamAbort(stream->st);
|
||||
|
||||
if (msg->header.status == VIR_NET_ERROR)
|
||||
virReportError(VIR_ERR_RPC,
|
||||
"%s", _("stream aborted at client request"));
|
||||
virNetError(VIR_ERR_RPC,
|
||||
"%s", _("stream aborted at client request"));
|
||||
else {
|
||||
VIR_WARN("unexpected stream status %d", msg->header.status);
|
||||
virReportError(VIR_ERR_RPC,
|
||||
_("stream aborted with unexpected status %d"),
|
||||
msg->header.status);
|
||||
virNetError(VIR_ERR_RPC,
|
||||
_("stream aborted with unexpected status %d"),
|
||||
msg->header.status);
|
||||
}
|
||||
|
||||
return virNetServerProgramSendReplyError(remoteProgram,
|
||||
@@ -689,7 +702,7 @@ daemonStreamHandleWrite(virNetServerClientPtr client,
|
||||
|
||||
/*
|
||||
* Invoked when a stream is signalled as having data
|
||||
* available to read. This reads up to one message
|
||||
* available to read. This reads upto one message
|
||||
* worth of data, and then queues that for transmission
|
||||
* to the client.
|
||||
*
|
||||
|
@@ -14,8 +14,8 @@
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see
|
||||
* <http://www.gnu.org/licenses/>.
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* Author: Daniel P. Berrange <berrange@redhat.com>
|
||||
*/
|
||||
|
553
daemon/test_libvirtd.aug
Normal file
@@ -0,0 +1,553 @@
|
||||
module Test_libvirtd =
|
||||
let conf = "# Master libvirt daemon configuration file
|
||||
#
|
||||
# For further information consult http://libvirt.org/format.html
|
||||
|
||||
|
||||
#################################################################
|
||||
#
|
||||
# Network connectivity controls
|
||||
#
|
||||
|
||||
# Flag listening for secure TLS connections on the public TCP/IP port.
|
||||
# NB, must pass the --listen flag to the libvirtd process for this to
|
||||
# have any effect.
|
||||
#
|
||||
# It is necessary to setup a CA and issue server certificates before
|
||||
# using this capability.
|
||||
#
|
||||
# This is enabled by default, uncomment this to disable it
|
||||
listen_tls = 0
|
||||
|
||||
# Listen for unencrypted TCP connections on the public TCP/IP port.
|
||||
# NB, must pass the --listen flag to the libvirtd process for this to
|
||||
# have any effect.
|
||||
#
|
||||
# Using the TCP socket requires SASL authentication by default. Only
|
||||
# SASL mechanisms which support data encryption are allowed. This is
|
||||
# DIGEST_MD5 and GSSAPI (Kerberos5)
|
||||
#
|
||||
# This is disabled by default, uncomment this to enable it.
|
||||
listen_tcp = 1
|
||||
|
||||
|
||||
|
||||
# Override the port for accepting secure TLS connections
|
||||
# This can be a port number, or service name
|
||||
#
|
||||
tls_port = \"16514\"
|
||||
|
||||
# Override the port for accepting insecure TCP connections
|
||||
# This can be a port number, or service name
|
||||
#
|
||||
tcp_port = \"16509\"
|
||||
|
||||
|
||||
# Override the default configuration which binds to all network
|
||||
# interfaces. This can be a numeric IPv4/6 address, or hostname
|
||||
#
|
||||
listen_addr = \"192.168.0.1\"
|
||||
|
||||
|
||||
# Flag toggling mDNS advertizement of the libvirt service.
|
||||
#
|
||||
# Alternatively can disable for all services on a host by
|
||||
# stopping the Avahi daemon
|
||||
#
|
||||
# This is disabled by default, uncomment this to enable it
|
||||
mdns_adv = 1
|
||||
|
||||
# Override the default mDNS advertizement name. This must be
|
||||
# unique on the immediate broadcast network.
|
||||
#
|
||||
# The default is \"Virtualization Host HOSTNAME\", where HOSTNAME
|
||||
# is subsituted for the short hostname of the machine (without domain)
|
||||
#
|
||||
mdns_name = \"Virtualization Host Joe Demo\"
|
||||
|
||||
|
||||
#################################################################
|
||||
#
|
||||
# UNIX socket access controls
|
||||
#
|
||||
|
||||
# Set the UNIX domain socket group ownership. This can be used to
|
||||
# allow a 'trusted' set of users access to management capabilities
|
||||
# without becoming root.
|
||||
#
|
||||
# This is restricted to 'root' by default.
|
||||
unix_sock_group = \"libvirt\"
|
||||
|
||||
# Set the UNIX socket permissions for the R/O socket. This is used
|
||||
# for monitoring VM status only
|
||||
#
|
||||
# Default allows any user. If setting group ownership may want to
|
||||
# restrict this to:
|
||||
unix_sock_ro_perms = \"0777\"
|
||||
|
||||
# Set the UNIX socket permissions for the R/W socket. This is used
|
||||
# for full management of VMs
|
||||
#
|
||||
# Default allows only root. If PolicyKit is enabled on the socket,
|
||||
# the default will change to allow everyone (eg, 0777)
|
||||
#
|
||||
# If not using PolicyKit and setting group ownership for access
|
||||
# control then you may want to relax this to:
|
||||
unix_sock_rw_perms = \"0770\"
|
||||
|
||||
|
||||
|
||||
#################################################################
|
||||
#
|
||||
# Authentication.
|
||||
#
|
||||
# - none: do not perform auth checks. If you can connect to the
|
||||
# socket you are allowed. This is suitable if there are
|
||||
# restrictions on connecting to the socket (eg, UNIX
|
||||
# socket permissions), or if there is a lower layer in
|
||||
# the network providing auth (eg, TLS/x509 certificates)
|
||||
#
|
||||
# - sasl: use SASL infrastructure. The actual auth scheme is then
|
||||
# controlled from /etc/sasl2/libvirt.conf. For the TCP
|
||||
# socket only GSSAPI & DIGEST-MD5 mechanisms will be used.
|
||||
# For non-TCP or TLS sockets, any scheme is allowed.
|
||||
#
|
||||
# - polkit: use PolicyKit to authenticate. This is only suitable
|
||||
# for use on the UNIX sockets. The default policy will
|
||||
# require a user to supply their own password to gain
|
||||
# full read/write access (aka sudo like), while anyone
|
||||
# is allowed read/only access.
|
||||
#
|
||||
# Set an authentication scheme for UNIX read-only sockets
|
||||
# By default socket permissions allow anyone to connect
|
||||
#
|
||||
# To restrict monitoring of domains you may wish to enable
|
||||
# an authentication mechanism here
|
||||
auth_unix_ro = \"none\"
|
||||
|
||||
# Set an authentication scheme for UNIX read-write sockets
|
||||
# By default socket permissions only allow root. If PolicyKit
|
||||
# support was compiled into libvirt, the default will be to
|
||||
# use 'polkit' auth.
|
||||
#
|
||||
# If the unix_sock_rw_perms are changed you may wish to enable
|
||||
# an authentication mechanism here
|
||||
auth_unix_rw = \"none\"
|
||||
|
||||
# Change the authentication scheme for TCP sockets.
|
||||
#
|
||||
# If you don't enable SASL, then all TCP traffic is cleartext.
|
||||
# Don't do this outside of a dev/test scenario. For real world
|
||||
# use, always enable SASL and use the GSSAPI or DIGEST-MD5
|
||||
# mechanism in /etc/sasl2/libvirt.conf
|
||||
auth_tcp = \"sasl\"
|
||||
|
||||
# Change the authentication scheme for TLS sockets.
|
||||
#
|
||||
# TLS sockets already have encryption provided by the TLS
|
||||
# layer, and limited authentication is done by certificates
|
||||
#
|
||||
# It is possible to make use of any SASL authentication
|
||||
# mechanism as well, by using 'sasl' for this option
|
||||
auth_tls = \"none\"
|
||||
|
||||
|
||||
|
||||
#################################################################
|
||||
#
|
||||
# TLS x509 certificate configuration
|
||||
#
|
||||
|
||||
|
||||
# Override the default server key file path
|
||||
#
|
||||
key_file = \"/etc/pki/libvirt/private/serverkey.pem\"
|
||||
|
||||
# Override the default server certificate file path
|
||||
#
|
||||
cert_file = \"/etc/pki/libvirt/servercert.pem\"
|
||||
|
||||
# Override the default CA certificate path
|
||||
#
|
||||
ca_file = \"/etc/pki/CA/cacert.pem\"
|
||||
|
||||
# Specify a certificate revocation list.
|
||||
#
|
||||
# Defaults to not using a CRL, uncomment to enable it
|
||||
crl_file = \"/etc/pki/CA/crl.pem\"
|
||||
|
||||
|
||||
|
||||
#################################################################
|
||||
#
|
||||
# Authorization controls
|
||||
#
|
||||
|
||||
|
||||
# Flag to disable verification of client certificates
|
||||
#
|
||||
# Client certificate verification is the primary authentication mechanism.
|
||||
# Any client which does not present a certificate signed by the CA
|
||||
# will be rejected.
|
||||
#
|
||||
# Default is to always verify. Uncommenting this will disable
|
||||
# verification - make sure an IP whitelist is set
|
||||
tls_no_verify_certificate = 1
|
||||
tls_no_sanity_certificate = 1
|
||||
|
||||
|
||||
# A whitelist of allowed x509 Distinguished Names
|
||||
# This list may contain wildcards such as
|
||||
#
|
||||
# \"C=GB,ST=London,L=London,O=Red Hat,CN=*\"
|
||||
#
|
||||
# See the POSIX fnmatch function for the format of the wildcards.
|
||||
#
|
||||
# NB If this is an empty list, no client can connect, so comment out
|
||||
# entirely rather than using empty list to disable these checks
|
||||
#
|
||||
# By default, no DN's are checked
|
||||
tls_allowed_dn_list = [\"DN1\", \"DN2\"]
|
||||
|
||||
|
||||
# A whitelist of allowed SASL usernames. The format for usernames
|
||||
# depends on the SASL authentication mechanism. Kerberos usernames
|
||||
# look like username@REALM
|
||||
#
|
||||
# This list may contain wildcards such as
|
||||
#
|
||||
# \"*@EXAMPLE.COM\"
|
||||
#
|
||||
# See the POSIX fnmatch function for the format of the wildcards.
|
||||
#
|
||||
# NB If this is an empty list, no client can connect, so comment out
|
||||
# entirely rather than using empty list to disable these checks
|
||||
#
|
||||
# By default, no Username's are checked
|
||||
sasl_allowed_username_list = [
|
||||
\"joe@EXAMPLE.COM\",
|
||||
\"fred@EXAMPLE.COM\"
|
||||
]
|
||||
|
||||
|
||||
#################################################################
|
||||
#
|
||||
# Processing controls
|
||||
#
|
||||
|
||||
# The maximum number of concurrent client connections to allow
|
||||
# over all sockets combined.
|
||||
max_clients = 20
|
||||
|
||||
|
||||
# The minimum limit sets the number of workers to start up
|
||||
# initially. If the number of active clients exceeds this,
|
||||
# then more threads are spawned, upto max_workers limit.
|
||||
# Typically you'd want max_workers to equal maximum number
|
||||
# of clients allowed
|
||||
min_workers = 5
|
||||
max_workers = 20
|
||||
|
||||
# Total global limit on concurrent RPC calls. Should be
|
||||
# at least as large as max_workers. Beyond this, RPC requests
|
||||
# will be read into memory and queued. This directly impact
|
||||
# memory usage, currently each request requires 256 KB of
|
||||
# memory. So by default upto 5 MB of memory is used
|
||||
max_requests = 20
|
||||
|
||||
# Limit on concurrent requests from a single client
|
||||
# connection. To avoid one client monopolizing the server
|
||||
# this should be a small fraction of the global max_requests
|
||||
# and max_workers parameter
|
||||
max_client_requests = 5
|
||||
|
||||
# Logging level:
|
||||
log_level = 4
|
||||
|
||||
# Logging outputs:
|
||||
log_outputs=\"4:stderr\"
|
||||
|
||||
# Logging filters:
|
||||
log_filters=\"a\"
|
||||
|
||||
# Auditing:
|
||||
audit_level = 2
|
||||
"
|
||||
|
||||
test Libvirtd.lns get conf =
|
||||
{ "#comment" = "Master libvirt daemon configuration file" }
|
||||
{ "#comment" = "" }
|
||||
{ "#comment" = "For further information consult http://libvirt.org/format.html" }
|
||||
{ "#empty" }
|
||||
{ "#empty" }
|
||||
{ "#comment" = "################################################################" }
|
||||
{ "#comment" = "" }
|
||||
{ "#comment" = "Network connectivity controls" }
|
||||
{ "#comment" = "" }
|
||||
{ "#empty" }
|
||||
{ "#comment" = "Flag listening for secure TLS connections on the public TCP/IP port." }
|
||||
{ "#comment" = "NB, must pass the --listen flag to the libvirtd process for this to" }
|
||||
{ "#comment" = "have any effect." }
|
||||
{ "#comment" = "" }
|
||||
{ "#comment" = "It is necessary to setup a CA and issue server certificates before" }
|
||||
{ "#comment" = "using this capability." }
|
||||
{ "#comment" = "" }
|
||||
{ "#comment" = "This is enabled by default, uncomment this to disable it" }
|
||||
{ "listen_tls" = "0" }
|
||||
{ "#empty" }
|
||||
{ "#comment" = "Listen for unencrypted TCP connections on the public TCP/IP port." }
|
||||
{ "#comment" = "NB, must pass the --listen flag to the libvirtd process for this to" }
|
||||
{ "#comment" = "have any effect." }
|
||||
{ "#comment" = "" }
|
||||
{ "#comment" = "Using the TCP socket requires SASL authentication by default. Only" }
|
||||
{ "#comment" = "SASL mechanisms which support data encryption are allowed. This is" }
|
||||
{ "#comment" = "DIGEST_MD5 and GSSAPI (Kerberos5)" }
|
||||
{ "#comment" = "" }
|
||||
{ "#comment" = "This is disabled by default, uncomment this to enable it." }
|
||||
{ "listen_tcp" = "1" }
|
||||
{ "#empty" }
|
||||
{ "#empty" }
|
||||
{ "#empty" }
|
||||
{ "#comment" = "Override the port for accepting secure TLS connections" }
|
||||
{ "#comment" = "This can be a port number, or service name" }
|
||||
{ "#comment" = "" }
|
||||
{ "tls_port" = "16514" }
|
||||
{ "#empty" }
|
||||
{ "#comment" = "Override the port for accepting insecure TCP connections" }
|
||||
{ "#comment" = "This can be a port number, or service name" }
|
||||
{ "#comment" = "" }
|
||||
{ "tcp_port" = "16509" }
|
||||
{ "#empty" }
|
||||
{ "#empty" }
|
||||
{ "#comment" = "Override the default configuration which binds to all network" }
|
||||
{ "#comment" = "interfaces. This can be a numeric IPv4/6 address, or hostname" }
|
||||
{ "#comment" = "" }
|
||||
{ "listen_addr" = "192.168.0.1" }
|
||||
{ "#empty" }
|
||||
{ "#empty" }
|
||||
{ "#comment" = "Flag toggling mDNS advertizement of the libvirt service." }
|
||||
{ "#comment" = "" }
|
||||
{ "#comment" = "Alternatively can disable for all services on a host by" }
|
||||
{ "#comment" = "stopping the Avahi daemon" }
|
||||
{ "#comment" = "" }
|
||||
{ "#comment" = "This is disabled by default, uncomment this to enable it" }
|
||||
{ "mdns_adv" = "1" }
|
||||
{ "#empty" }
|
||||
{ "#comment" = "Override the default mDNS advertizement name. This must be" }
|
||||
{ "#comment" = "unique on the immediate broadcast network." }
|
||||
{ "#comment" = "" }
|
||||
{ "#comment" = "The default is \"Virtualization Host HOSTNAME\", where HOSTNAME" }
|
||||
{ "#comment" = "is subsituted for the short hostname of the machine (without domain)" }
|
||||
{ "#comment" = "" }
|
||||
{ "mdns_name" = "Virtualization Host Joe Demo" }
|
||||
{ "#empty" }
|
||||
{ "#empty" }
|
||||
{ "#comment" = "################################################################" }
|
||||
{ "#comment" = "" }
|
||||
{ "#comment" = "UNIX socket access controls" }
|
||||
{ "#comment" = "" }
|
||||
{ "#empty" }
|
||||
{ "#comment" = "Set the UNIX domain socket group ownership. This can be used to" }
|
||||
{ "#comment" = "allow a 'trusted' set of users access to management capabilities" }
|
||||
{ "#comment" = "without becoming root." }
|
||||
{ "#comment" = "" }
|
||||
{ "#comment" = "This is restricted to 'root' by default." }
|
||||
{ "unix_sock_group" = "libvirt" }
|
||||
{ "#empty" }
|
||||
{ "#comment" = "Set the UNIX socket permissions for the R/O socket. This is used" }
|
||||
{ "#comment" = "for monitoring VM status only" }
|
||||
{ "#comment" = "" }
|
||||
{ "#comment" = "Default allows any user. If setting group ownership may want to" }
|
||||
{ "#comment" = "restrict this to:" }
|
||||
{ "unix_sock_ro_perms" = "0777" }
|
||||
{ "#empty" }
|
||||
{ "#comment" = "Set the UNIX socket permissions for the R/W socket. This is used" }
|
||||
{ "#comment" = "for full management of VMs" }
|
||||
{ "#comment" = "" }
|
||||
{ "#comment" = "Default allows only root. If PolicyKit is enabled on the socket," }
|
||||
{ "#comment" = "the default will change to allow everyone (eg, 0777)" }
|
||||
{ "#comment" = "" }
|
||||
{ "#comment" = "If not using PolicyKit and setting group ownership for access" }
|
||||
{ "#comment" = "control then you may want to relax this to:" }
|
||||
{ "unix_sock_rw_perms" = "0770" }
|
||||
{ "#empty" }
|
||||
{ "#empty" }
|
||||
{ "#empty" }
|
||||
{ "#comment" = "################################################################" }
|
||||
{ "#comment" = "" }
|
||||
{ "#comment" = "Authentication." }
|
||||
{ "#comment" = "" }
|
||||
{ "#comment" = "- none: do not perform auth checks. If you can connect to the" }
|
||||
{ "#comment" = "socket you are allowed. This is suitable if there are" }
|
||||
{ "#comment" = "restrictions on connecting to the socket (eg, UNIX" }
|
||||
{ "#comment" = "socket permissions), or if there is a lower layer in" }
|
||||
{ "#comment" = "the network providing auth (eg, TLS/x509 certificates)" }
|
||||
{ "#comment" = "" }
|
||||
{ "#comment" = "- sasl: use SASL infrastructure. The actual auth scheme is then" }
|
||||
{ "#comment" = "controlled from /etc/sasl2/libvirt.conf. For the TCP" }
|
||||
{ "#comment" = "socket only GSSAPI & DIGEST-MD5 mechanisms will be used." }
|
||||
{ "#comment" = "For non-TCP or TLS sockets, any scheme is allowed." }
|
||||
{ "#comment" = "" }
|
||||
{ "#comment" = "- polkit: use PolicyKit to authenticate. This is only suitable" }
|
||||
{ "#comment" = "for use on the UNIX sockets. The default policy will" }
|
||||
{ "#comment" = "require a user to supply their own password to gain" }
|
||||
{ "#comment" = "full read/write access (aka sudo like), while anyone" }
|
||||
{ "#comment" = "is allowed read/only access." }
|
||||
{ "#comment" = "" }
|
||||
{ "#comment" = "Set an authentication scheme for UNIX read-only sockets" }
|
||||
{ "#comment" = "By default socket permissions allow anyone to connect" }
|
||||
{ "#comment" = "" }
|
||||
{ "#comment" = "To restrict monitoring of domains you may wish to enable" }
|
||||
{ "#comment" = "an authentication mechanism here" }
|
||||
{ "auth_unix_ro" = "none" }
|
||||
{ "#empty" }
|
||||
{ "#comment" = "Set an authentication scheme for UNIX read-write sockets" }
|
||||
{ "#comment" = "By default socket permissions only allow root. If PolicyKit" }
|
||||
{ "#comment" = "support was compiled into libvirt, the default will be to" }
|
||||
{ "#comment" = "use 'polkit' auth." }
|
||||
{ "#comment" = "" }
|
||||
{ "#comment" = "If the unix_sock_rw_perms are changed you may wish to enable" }
|
||||
{ "#comment" = "an authentication mechanism here" }
|
||||
{ "auth_unix_rw" = "none" }
|
||||
{ "#empty" }
|
||||
{ "#comment" = "Change the authentication scheme for TCP sockets." }
|
||||
{ "#comment" = "" }
|
||||
{ "#comment" = "If you don't enable SASL, then all TCP traffic is cleartext." }
|
||||
{ "#comment" = "Don't do this outside of a dev/test scenario. For real world" }
|
||||
{ "#comment" = "use, always enable SASL and use the GSSAPI or DIGEST-MD5" }
|
||||
{ "#comment" = "mechanism in /etc/sasl2/libvirt.conf" }
|
||||
{ "auth_tcp" = "sasl" }
|
||||
{ "#empty" }
|
||||
{ "#comment" = "Change the authentication scheme for TLS sockets." }
|
||||
{ "#comment" = "" }
|
||||
{ "#comment" = "TLS sockets already have encryption provided by the TLS" }
|
||||
{ "#comment" = "layer, and limited authentication is done by certificates" }
|
||||
{ "#comment" = "" }
|
||||
{ "#comment" = "It is possible to make use of any SASL authentication" }
|
||||
{ "#comment" = "mechanism as well, by using 'sasl' for this option" }
|
||||
{ "auth_tls" = "none" }
|
||||
{ "#empty" }
|
||||
{ "#empty" }
|
||||
{ "#empty" }
|
||||
{ "#comment" = "################################################################" }
|
||||
{ "#comment" = "" }
|
||||
{ "#comment" = "TLS x509 certificate configuration" }
|
||||
{ "#comment" = "" }
|
||||
{ "#empty" }
|
||||
{ "#empty" }
|
||||
{ "#comment" = "Override the default server key file path" }
|
||||
{ "#comment" = "" }
|
||||
{ "key_file" = "/etc/pki/libvirt/private/serverkey.pem" }
|
||||
{ "#empty" }
|
||||
{ "#comment" = "Override the default server certificate file path" }
|
||||
{ "#comment" = "" }
|
||||
{ "cert_file" = "/etc/pki/libvirt/servercert.pem" }
|
||||
{ "#empty" }
|
||||
{ "#comment" = "Override the default CA certificate path" }
|
||||
{ "#comment" = "" }
|
||||
{ "ca_file" = "/etc/pki/CA/cacert.pem" }
|
||||
{ "#empty" }
|
||||
{ "#comment" = "Specify a certificate revocation list." }
|
||||
{ "#comment" = "" }
|
||||
{ "#comment" = "Defaults to not using a CRL, uncomment to enable it" }
|
||||
{ "crl_file" = "/etc/pki/CA/crl.pem" }
|
||||
{ "#empty" }
|
||||
{ "#empty" }
|
||||
{ "#empty" }
|
||||
{ "#comment" = "################################################################" }
|
||||
{ "#comment" = "" }
|
||||
{ "#comment" = "Authorization controls" }
|
||||
{ "#comment" = "" }
|
||||
{ "#empty" }
|
||||
{ "#empty" }
|
||||
{ "#comment" = "Flag to disable verification of client certificates" }
|
||||
{ "#comment" = "" }
|
||||
{ "#comment" = "Client certificate verification is the primary authentication mechanism." }
|
||||
{ "#comment" = "Any client which does not present a certificate signed by the CA" }
|
||||
{ "#comment" = "will be rejected." }
|
||||
{ "#comment" = "" }
|
||||
{ "#comment" = "Default is to always verify. Uncommenting this will disable" }
|
||||
{ "#comment" = "verification - make sure an IP whitelist is set" }
|
||||
{ "tls_no_verify_certificate" = "1" }
|
||||
{ "tls_no_sanity_certificate" = "1" }
|
||||
{ "#empty" }
|
||||
{ "#empty" }
|
||||
{ "#comment" = "A whitelist of allowed x509 Distinguished Names" }
|
||||
{ "#comment" = "This list may contain wildcards such as" }
|
||||
{ "#comment" = "" }
|
||||
{ "#comment" = "\"C=GB,ST=London,L=London,O=Red Hat,CN=*\"" }
|
||||
{ "#comment" = "" }
|
||||
{ "#comment" = "See the POSIX fnmatch function for the format of the wildcards." }
|
||||
{ "#comment" = "" }
|
||||
{ "#comment" = "NB If this is an empty list, no client can connect, so comment out" }
|
||||
{ "#comment" = "entirely rather than using empty list to disable these checks" }
|
||||
{ "#comment" = "" }
|
||||
{ "#comment" = "By default, no DN's are checked" }
|
||||
{ "tls_allowed_dn_list"
|
||||
{ "1" = "DN1"}
|
||||
{ "2" = "DN2"}
|
||||
}
|
||||
{ "#empty" }
|
||||
{ "#empty" }
|
||||
{ "#comment" = "A whitelist of allowed SASL usernames. The format for usernames" }
|
||||
{ "#comment" = "depends on the SASL authentication mechanism. Kerberos usernames" }
|
||||
{ "#comment" = "look like username@REALM" }
|
||||
{ "#comment" = "" }
|
||||
{ "#comment" = "This list may contain wildcards such as" }
|
||||
{ "#comment" = "" }
|
||||
{ "#comment" = "\"*@EXAMPLE.COM\"" }
|
||||
{ "#comment" = "" }
|
||||
{ "#comment" = "See the POSIX fnmatch function for the format of the wildcards." }
|
||||
{ "#comment" = "" }
|
||||
{ "#comment" = "NB If this is an empty list, no client can connect, so comment out" }
|
||||
{ "#comment" = "entirely rather than using empty list to disable these checks" }
|
||||
{ "#comment" = "" }
|
||||
{ "#comment" = "By default, no Username's are checked" }
|
||||
{ "sasl_allowed_username_list"
|
||||
{ "1" = "joe@EXAMPLE.COM" }
|
||||
{ "2" = "fred@EXAMPLE.COM" }
|
||||
}
|
||||
{ "#empty" }
|
||||
{ "#empty" }
|
||||
{ "#comment" = "################################################################"}
|
||||
{ "#comment" = ""}
|
||||
{ "#comment" = "Processing controls"}
|
||||
{ "#comment" = ""}
|
||||
{ "#empty" }
|
||||
{ "#comment" = "The maximum number of concurrent client connections to allow"}
|
||||
{ "#comment" = "over all sockets combined."}
|
||||
{ "max_clients" = "20" }
|
||||
{ "#empty" }
|
||||
{ "#empty" }
|
||||
{ "#comment" = "The minimum limit sets the number of workers to start up"}
|
||||
{ "#comment" = "initially. If the number of active clients exceeds this,"}
|
||||
{ "#comment" = "then more threads are spawned, upto max_workers limit."}
|
||||
{ "#comment" = "Typically you'd want max_workers to equal maximum number"}
|
||||
{ "#comment" = "of clients allowed"}
|
||||
{ "min_workers" = "5" }
|
||||
{ "max_workers" = "20" }
|
||||
{ "#empty" }
|
||||
{ "#comment" = "Total global limit on concurrent RPC calls. Should be" }
|
||||
{ "#comment" = "at least as large as max_workers. Beyond this, RPC requests" }
|
||||
{ "#comment" = "will be read into memory and queued. This directly impact" }
|
||||
{ "#comment" = "memory usage, currently each request requires 256 KB of" }
|
||||
{ "#comment" = "memory. So by default upto 5 MB of memory is used" }
|
||||
{ "max_requests" = "20" }
|
||||
{ "#empty" }
|
||||
{ "#comment" = "Limit on concurrent requests from a single client" }
|
||||
{ "#comment" = "connection. To avoid one client monopolizing the server" }
|
||||
{ "#comment" = "this should be a small fraction of the global max_requests" }
|
||||
{ "#comment" = "and max_workers parameter" }
|
||||
{ "max_client_requests" = "5" }
|
||||
{ "#empty" }
|
||||
{ "#comment" = "Logging level:" }
|
||||
{ "log_level" = "4" }
|
||||
{ "#empty" }
|
||||
{ "#comment" = "Logging outputs:" }
|
||||
{ "log_outputs" = "4:stderr" }
|
||||
{ "#empty" }
|
||||
{ "#comment" = "Logging filters:" }
|
||||
{ "log_filters" = "a" }
|
||||
{ "#empty" }
|
||||
{ "#comment" = "Auditing:" }
|
||||
{ "audit_level" = "2" }
|
@@ -1,49 +0,0 @@
|
||||
module Test_libvirtd =
|
||||
::CONFIG::
|
||||
|
||||
test Libvirtd.lns get conf =
|
||||
{ "listen_tls" = "0" }
|
||||
{ "listen_tcp" = "1" }
|
||||
{ "tls_port" = "16514" }
|
||||
{ "tcp_port" = "16509" }
|
||||
{ "listen_addr" = "192.168.0.1" }
|
||||
{ "mdns_adv" = "1" }
|
||||
{ "mdns_name" = "Virtualization Host Joe Demo" }
|
||||
{ "unix_sock_group" = "libvirt" }
|
||||
{ "unix_sock_ro_perms" = "0777" }
|
||||
{ "unix_sock_rw_perms" = "0770" }
|
||||
{ "unix_sock_dir" = "/var/run/libvirt" }
|
||||
{ "auth_unix_ro" = "none" }
|
||||
{ "auth_unix_rw" = "none" }
|
||||
{ "auth_tcp" = "sasl" }
|
||||
{ "auth_tls" = "none" }
|
||||
{ "key_file" = "/etc/pki/libvirt/private/serverkey.pem" }
|
||||
{ "cert_file" = "/etc/pki/libvirt/servercert.pem" }
|
||||
{ "ca_file" = "/etc/pki/CA/cacert.pem" }
|
||||
{ "crl_file" = "/etc/pki/CA/crl.pem" }
|
||||
{ "tls_no_sanity_certificate" = "1" }
|
||||
{ "tls_no_verify_certificate" = "1" }
|
||||
{ "tls_allowed_dn_list"
|
||||
{ "1" = "DN1"}
|
||||
{ "2" = "DN2"}
|
||||
}
|
||||
{ "sasl_allowed_username_list"
|
||||
{ "1" = "joe@EXAMPLE.COM" }
|
||||
{ "2" = "fred@EXAMPLE.COM" }
|
||||
}
|
||||
{ "max_clients" = "20" }
|
||||
{ "min_workers" = "5" }
|
||||
{ "max_workers" = "20" }
|
||||
{ "prio_workers" = "5" }
|
||||
{ "max_requests" = "20" }
|
||||
{ "max_client_requests" = "5" }
|
||||
{ "log_level" = "3" }
|
||||
{ "log_filters" = "3:remote 4:event" }
|
||||
{ "log_outputs" = "3:syslog:libvirtd" }
|
||||
{ "log_buffer_size" = "64" }
|
||||
{ "audit_level" = "2" }
|
||||
{ "audit_logging" = "1" }
|
||||
{ "host_uuid" = "00000000-0000-0000-0000-000000000000" }
|
||||
{ "keepalive_interval" = "5" }
|
||||
{ "keepalive_count" = "5" }
|
||||
{ "keepalive_required" = "1" }
|
@@ -1,23 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<html>
|
||||
<body>
|
||||
<h1>404 page not found</h1>
|
||||
|
||||
<p>
|
||||
Someone appears to have eaten the <del>penguin</del>
|
||||
page you were looking for. You might want to try
|
||||
</p>
|
||||
<ul>
|
||||
<li>going back to the <a href="http://libvirt.org/">home page</a> to find
|
||||
a collection of links to interesting pages on this site</li>
|
||||
<li>using the search box at the top right corner of the screen to
|
||||
locate the content on this site or mailing list archives</li>
|
||||
</ul>
|
||||
|
||||
<p class="image">
|
||||
<img src="/libvirtLogo404.png" alt="libvirt Logo"/>
|
||||
</p>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
@@ -71,20 +71,10 @@ gif = \
|
||||
architecture.gif \
|
||||
node.gif
|
||||
|
||||
|
||||
internals_html_in = \
|
||||
$(patsubst $(srcdir)/%,%,$(wildcard $(srcdir)/internals/*.html.in))
|
||||
internals_html = $(internals_html_in:%.html.in=%.html)
|
||||
|
||||
dot_html_in = $(notdir $(wildcard $(srcdir)/*.html.in)) \
|
||||
todo.html.in \
|
||||
hvsupport.html.in
|
||||
dot_html_in = $(notdir $(wildcard $(srcdir)/*.html.in)) todo.html.in hvsupport.html.in \
|
||||
$(patsubst $(srcdir)/%,%,$(wildcard $(srcdir)/internals/*.html.in))
|
||||
dot_html = $(dot_html_in:%.html.in=%.html)
|
||||
|
||||
dot_php_in = $(notdir $(wildcard $(srcdir)/*.php.in))
|
||||
dot_php_code_in = $(dot_php_in:%.php.in=%.php.code.in)
|
||||
dot_php = $(dot_php_in:%.php.in=%.php)
|
||||
|
||||
patches = $(patsubst $(srcdir)/%,%,$(wildcard $(srcdir)/api_extension/*.patch))
|
||||
|
||||
xml = \
|
||||
@@ -117,25 +107,21 @@ EXTRA_DIST= \
|
||||
$(dot_html) $(dot_html_in) $(gif) $(apihtml) $(apipng) \
|
||||
$(devhelphtml) $(devhelppng) $(devhelpcss) $(devhelpxsl) \
|
||||
$(xml) $(qemu_xml) $(fig) $(png) $(css) \
|
||||
$(patches) $(dot_php_in) $(dot_php_code_in) $(dot_php)\
|
||||
$(internals_html_in) $(internals_html) \
|
||||
$(patches) \
|
||||
sitemap.html.in \
|
||||
todo.pl hvsupport.pl todo.cfg-example
|
||||
|
||||
MAINTAINERCLEANFILES = \
|
||||
$(addprefix $(srcdir)/,$(dot_html)) \
|
||||
$(addprefix $(srcdir)/,$(apihtml)) \
|
||||
$(addprefix $(srcdir)/,$(devhelphtml)) \
|
||||
$(addprefix $(srcdir)/,$(internals_html)) \
|
||||
$(addprefix $(srcdir)/,$(dot_php))
|
||||
$(addprefix $(srcdir)/,$(devhelphtml))
|
||||
|
||||
all-am: web
|
||||
|
||||
api: $(srcdir)/libvirt-api.xml $(srcdir)/libvirt-refs.xml
|
||||
qemu_api: $(srcdir)/libvirt-qemu-api.xml $(srcdir)/libvirt-qemu-refs.xml
|
||||
|
||||
web: $(dot_html) $(internals_html) html/index.html devhelp/index.html \
|
||||
$(dot_php)
|
||||
web: $(dot_html) html/index.html devhelp/index.html
|
||||
|
||||
todo.html.in: todo.pl
|
||||
if [ -f todo.cfg ]; then \
|
||||
@@ -187,19 +173,6 @@ internals/%.html.tmp: internals/%.html.in subsite.xsl page.xsl sitemap.html.in
|
||||
|| { rm $(srcdir)/$@ && exit 1; }; \
|
||||
else echo "missing XHTML1 DTD" ; fi ; fi
|
||||
|
||||
%.php.tmp: %.php.in site.xsl page.xsl sitemap.html.in
|
||||
@if [ -x $(XSLTPROC) ] ; then \
|
||||
echo "Generating $@"; \
|
||||
$(XSLTPROC) --stringparam pagename $(@:.tmp=) --nonet --html \
|
||||
$(top_srcdir)/docs/site.xsl $< > $@ \
|
||||
|| { rm $@ && exit 1; }; fi
|
||||
|
||||
%.php: %.php.tmp %.php.code.in
|
||||
@if [ -x $(XSLTPROC) ] ; then \
|
||||
echo "Scripting $@"; \
|
||||
sed -e '/<a id="php_placeholder"><\/a>/r '"$(srcdir)/$@.code.in" \
|
||||
-e /php_placeholder/d < $@.tmp > $(srcdir)/$@ \
|
||||
|| { rm $(srcdir)/$@ && exit 1; }; fi
|
||||
|
||||
html/index.html: libvirt-api.xml newapi.xsl page.xsl sitemap.html.in
|
||||
$(AM_V_GEN)if [ -x $(XSLTPROC) ] ; then \
|
||||
@@ -229,14 +202,11 @@ python_generated_files = \
|
||||
|
||||
APIBUILD=$(srcdir)/apibuild.py
|
||||
APIBUILD_STAMP=$(APIBUILD).stamp
|
||||
EXTRA_DIST += $(APIBUILD_STAMP)
|
||||
|
||||
$(python_generated_files): $(APIBUILD_STAMP)
|
||||
|
||||
$(APIBUILD_STAMP): $(srcdir)/apibuild.py \
|
||||
$(srcdir)/../include/libvirt/libvirt.h.in \
|
||||
$(srcdir)/../include/libvirt/libvirt-qemu.h \
|
||||
$(srcdir)/../include/libvirt/virterror.h \
|
||||
$(srcdir)/../include/libvirt/*.h \
|
||||
$(srcdir)/../src/libvirt.c \
|
||||
$(srcdir)/../src/libvirt-qemu.c \
|
||||
$(srcdir)/../src/util/virterror.c
|
||||
@@ -265,9 +235,6 @@ install-data-local:
|
||||
$(INSTALL) -m 0644 $(srcdir)/$$h $(DESTDIR)$(HTML_DIR)/html; done
|
||||
for p in $(apipng); do \
|
||||
$(INSTALL) -m 0644 $(srcdir)/$$p $(DESTDIR)$(HTML_DIR)/html; done
|
||||
$(mkinstalldirs) $(DESTDIR)$(HTML_DIR)/internals
|
||||
for f in $(internals_html); do \
|
||||
$(INSTALL) -m 0644 $(srcdir)/$$f $(DESTDIR)$(HTML_DIR)/internals; done
|
||||
$(mkinstalldirs) $(DESTDIR)$(DEVHELP_DIR)
|
||||
for file in $(devhelphtml) $(devhelppng) $(devhelpcss); do \
|
||||
$(INSTALL) -m 0644 $(srcdir)/$${file} $(DESTDIR)$(DEVHELP_DIR) ; \
|
||||
|
@@ -43,7 +43,7 @@
|
||||
<li>virNetworkPtr: represent one network either active or defined (i.e.
|
||||
existing as permanent config file and storage but not currently activated.
|
||||
The function <code class='docref'>virConnectListNetworks</code>
|
||||
allows to list all the virtualization networks activated on this node.</li>
|
||||
allows to list all the virtualization networks actived on this node.</li>
|
||||
<li>virStorageVolPtr: represent one storage volume, usually this is used
|
||||
as a block device available to one of the domains. The function
|
||||
<code class="docref">virStorageVolLookupByPath</code> allows to find
|
||||
@@ -64,13 +64,13 @@
|
||||
<p> Most kind of object can also be named in various ways:</p>
|
||||
<ul>
|
||||
<li>by their <code>name</code>, an user friendly identifier but
|
||||
whose unicity cannot be guaranteed between two nodes.</li>
|
||||
whose unicity cannot be garanteed between two nodes.</li>
|
||||
<li>by their <code>ID</code>, which is a runtime unique identifier
|
||||
provided by the hypervisor for one given activation of the object,
|
||||
but it becomes invalid once the resource is deactivated.</li >
|
||||
<li>by their <code>UUID</code>, a 16 bytes unique identifier
|
||||
as defined in <a href="http://www.ietf.org/rfc/rfc4122.txt">RFC 4122</a>,
|
||||
which is guaranteed to be unique for long term usage and across a
|
||||
which is garanteed to be unique for long term usage and across a
|
||||
set of nodes.</li>
|
||||
</ul>
|
||||
|
||||
|
@@ -1,4 +1,8 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Implementing a new API in Libvirt</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>Implementing a new API in Libvirt</h1>
|
||||
|
||||
|
120
docs/apibuild.py
@@ -1355,95 +1355,6 @@ class CParser:
|
||||
token = self.token()
|
||||
return token
|
||||
|
||||
def parseVirEnumDecl(self, token):
|
||||
if token[0] != "name":
|
||||
self.error("parsing VIR_ENUM_DECL: expecting name", token)
|
||||
|
||||
token = self.token()
|
||||
|
||||
if token[0] != "sep":
|
||||
self.error("parsing VIR_ENUM_DECL: expecting ')'", token)
|
||||
|
||||
if token[1] != ')':
|
||||
self.error("parsing VIR_ENUM_DECL: expecting ')'", token)
|
||||
|
||||
token = self.token()
|
||||
if token[0] == "sep" and token[1] == ';':
|
||||
token = self.token()
|
||||
|
||||
return token
|
||||
|
||||
def parseVirEnumImpl(self, token):
|
||||
# First the type name
|
||||
if token[0] != "name":
|
||||
self.error("parsing VIR_ENUM_IMPL: expecting name", token)
|
||||
|
||||
token = self.token()
|
||||
|
||||
if token[0] != "sep":
|
||||
self.error("parsing VIR_ENUM_IMPL: expecting ','", token)
|
||||
|
||||
if token[1] != ',':
|
||||
self.error("parsing VIR_ENUM_IMPL: expecting ','", token)
|
||||
token = self.token()
|
||||
|
||||
# Now the sentinel name
|
||||
if token[0] != "name":
|
||||
self.error("parsing VIR_ENUM_IMPL: expecting name", token)
|
||||
|
||||
token = self.token()
|
||||
|
||||
if token[0] != "sep":
|
||||
self.error("parsing VIR_ENUM_IMPL: expecting ','", token)
|
||||
|
||||
if token[1] != ',':
|
||||
self.error("parsing VIR_ENUM_IMPL: expecting ','", token)
|
||||
|
||||
token = self.token()
|
||||
|
||||
# Now a list of strings (optional comments)
|
||||
while token is not None:
|
||||
isGettext = False
|
||||
# First a string, optionally with N_(...)
|
||||
if token[0] == 'name':
|
||||
if token[1] != 'N_':
|
||||
self.error("parsing VIR_ENUM_IMPL: expecting 'N_'", token)
|
||||
token = self.token()
|
||||
if token[0] != "sep" or token[1] != '(':
|
||||
self.error("parsing VIR_ENUM_IMPL: expecting '('", token)
|
||||
token = self.token()
|
||||
isGettext = True
|
||||
|
||||
if token[0] != "string":
|
||||
self.error("parsing VIR_ENUM_IMPL: expecting a string", token)
|
||||
token = self.token()
|
||||
elif token[0] == "string":
|
||||
token = self.token()
|
||||
else:
|
||||
self.error("parsing VIR_ENUM_IMPL: expecting a string", token)
|
||||
|
||||
# Then a separator
|
||||
if token[0] == "sep":
|
||||
if isGettext and token[1] == ')':
|
||||
token = self.token()
|
||||
|
||||
if token[1] == ',':
|
||||
token = self.token()
|
||||
|
||||
if token[1] == ')':
|
||||
token = self.token()
|
||||
break
|
||||
|
||||
# Then an optional comment
|
||||
if token[0] == "comment":
|
||||
token = self.token()
|
||||
|
||||
|
||||
if token[0] == "sep" and token[1] == ';':
|
||||
token = self.token()
|
||||
|
||||
return token
|
||||
|
||||
#
|
||||
# Parse a C definition block, used for structs or unions it parse till
|
||||
# the balancing }
|
||||
@@ -1591,29 +1502,6 @@ class CParser:
|
||||
not self.is_header, "enum",
|
||||
(enum[1], enum[2], enum_type))
|
||||
return token
|
||||
elif token[0] == "name" and token[1] == "VIR_ENUM_DECL":
|
||||
token = self.token()
|
||||
if token != None and token[0] == "sep" and token[1] == "(":
|
||||
token = self.token()
|
||||
token = self.parseVirEnumDecl(token)
|
||||
else:
|
||||
self.error("parsing VIR_ENUM_DECL: expecting '('", token)
|
||||
if token != None:
|
||||
self.lexer.push(token)
|
||||
token = ("name", "virenumdecl")
|
||||
return token
|
||||
|
||||
elif token[0] == "name" and token[1] == "VIR_ENUM_IMPL":
|
||||
token = self.token()
|
||||
if token != None and token[0] == "sep" and token[1] == "(":
|
||||
token = self.token()
|
||||
token = self.parseVirEnumImpl(token)
|
||||
else:
|
||||
self.error("parsing VIR_ENUM_IMPL: expecting '('", token)
|
||||
if token != None:
|
||||
self.lexer.push(token)
|
||||
token = ("name", "virenumimpl")
|
||||
return token
|
||||
|
||||
elif token[0] == "name":
|
||||
if self.type == "":
|
||||
@@ -1759,7 +1647,6 @@ class CParser:
|
||||
"virDomainSetMaxMemory" : (False, ("memory")),
|
||||
"virDomainSetMemory" : (False, ("memory")),
|
||||
"virDomainSetMemoryFlags" : (False, ("memory")),
|
||||
"virDomainBlockCommit" : (False, ("bandwidth")),
|
||||
"virDomainBlockJobSetSpeed" : (False, ("bandwidth")),
|
||||
"virDomainBlockPull" : (False, ("bandwidth")),
|
||||
"virDomainBlockRebase" : (False, ("bandwidth")),
|
||||
@@ -1962,11 +1849,6 @@ class docBuilder:
|
||||
self.index = {}
|
||||
self.basename = name
|
||||
|
||||
def warning(self, msg):
|
||||
global warnings
|
||||
warnings = warnings + 1
|
||||
print msg
|
||||
|
||||
def indexString(self, id, str):
|
||||
if str == None:
|
||||
return
|
||||
@@ -2474,7 +2356,7 @@ class docBuilder:
|
||||
|
||||
def rebuild(name):
|
||||
if name not in ["libvirt", "libvirt-qemu"]:
|
||||
self.warning("rebuild() failed, unknown module %s") % name
|
||||
self.warning("rebuild() failed, unkown module %s") % name
|
||||
return None
|
||||
builder = None
|
||||
srcdir = os.environ["srcdir"]
|
||||
|
@@ -188,7 +188,7 @@
|
||||
A general purpose desktop management tool, able to manage
|
||||
virtual machines across both local and remotely accessed
|
||||
hypervisors. It is targeted at home and small office usage
|
||||
up to managing 10-20 hosts and their VMs.
|
||||
upto managing 10-20 hosts and their VMs.
|
||||
</dd>
|
||||
<dt><a href="http://virt-manager.org/">virt-viewer</a></dt>
|
||||
<dd>
|
||||
@@ -212,14 +212,6 @@
|
||||
modular Web Services architecture.
|
||||
</dd>
|
||||
|
||||
<dt><a href="http://www.eucalyptus.com">Eucalyptus</a></dt>
|
||||
<dd>
|
||||
Eucalyptus is an on-premise Infrastructure as a Service cloud
|
||||
software platform that is open source and
|
||||
AWS-compatible. Eucalyptus uses libivrt virtualization API to
|
||||
directly interact with Xen and KVM hypervisors.
|
||||
</dd>
|
||||
|
||||
<dt><a href="http://www.nimbusproject.org">Nimbus</a></dt>
|
||||
<dd>
|
||||
Nimbus is an open-source toolkit focused on providing
|
||||
|
@@ -25,7 +25,7 @@ for the authentication file using the following sequence:
|
||||
variable.</li>
|
||||
<li>The file path specified by the "authfile=/some/file" URI
|
||||
query parameter</li>
|
||||
<li>The file $XDG_CONFIG_HOME/libvirt/auth.conf</li>
|
||||
<li>The file $HOME/.libvirt/auth.conf</li>
|
||||
<li>The file /etc/libvirt/auth.conf</li>
|
||||
</ol>
|
||||
|
||||
@@ -233,8 +233,7 @@ The SASL mechanism configured by default is DIGEST-MD5, which provides a basic
|
||||
username+password style authentication. To enable Kerberos single-sign-on instead,
|
||||
the libvirt SASL configuration file must be changed. This is <code>/etc/sasl2/libvirt.conf</code>.
|
||||
The <code>mech_list</code> parameter must first be changed to <code>gssapi</code>
|
||||
instead of the default <code>digest-md5</code>, and keytab should be set to
|
||||
<code>/etc/libvirt/krb5.tab</code> . If SASL is enabled on the UNIX
|
||||
instead of the default <code>digest-md5</code>. If SASL is enabled on the UNIX
|
||||
and/or TLS sockets, Kerberos will also be used for them. Like DIGEST-MD5, the Kerberos
|
||||
mechanism provides data encryption of the session.
|
||||
</p>
|
||||
|
@@ -126,7 +126,7 @@
|
||||
<p>
|
||||
It may also happen that the libvirt daemon itself crashes or gets stuck,
|
||||
in the first case run it (as root) under gdb, and reproduce the sequence
|
||||
leading to the crash, similarly to a normal program provide the
|
||||
leading to the crash, similary to a normal program provide the
|
||||
"bt" backtrace information to where gdb will have stopped.<br/>
|
||||
But if libvirtd gets stuck, for example seems to stop processing
|
||||
commands, try to attach to the faulty daemon and issue a gdb command
|
||||
|
@@ -62,50 +62,14 @@
|
||||
<p>
|
||||
The libvirt build process uses GNU autotools, so after obtaining a
|
||||
checkout it is necessary to generate the configure script and Makefile.in
|
||||
templates using the <code>autogen.sh</code> command. By default when
|
||||
the <code>configure</code> script is run from within a GIT checkout, it
|
||||
will turn on -Werror for builds. This can be disabled with --disable-werror,
|
||||
but this is not recommended. To build & install libvirt to your home
|
||||
directory the following commands can be run:
|
||||
templates using the <code>autogen.sh</code> command, passing the extra
|
||||
arguments as for configure. As an example, to do a complete build and
|
||||
install it into your home directory run:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ ./autogen.sh --prefix=$HOME/usr
|
||||
$ ./autogen.sh --prefix=$HOME/usr --enable-compile-warnings=error
|
||||
$ make
|
||||
$ <b>sudo</b> make install</pre>
|
||||
|
||||
<p>
|
||||
Be aware though, that binaries built with a custom prefix will not
|
||||
interoperate with OS vendor provided binaries, since the UNIX socket
|
||||
paths will all be different. To produce a build that is compatible
|
||||
with normal OS vendor prefixes, use
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ ./autogen.sh --system
|
||||
$ make
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
When doing this for day-to-day development purposes, it is recommended
|
||||
not to install over the OS vendor provided binaries. Instead simply
|
||||
run libvirt directly from the source tree. For example to run
|
||||
a privileged libvirtd instance
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ su -
|
||||
# service libvirtd stop (or systemctl stop libvirtd.service)
|
||||
# /home/to/your/checkout/daemon/libvirtd
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
It is also possible to run virsh directly from the source tree
|
||||
using the ./run script (which sets some environment variables):
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
$ ./run ./tools/virsh ....
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
@@ -29,10 +29,9 @@
|
||||
<li><strong><a href="drvvmware.html">VMware Workstation/Player</a></strong></li>
|
||||
<li><strong><a href="drvxen.html">Xen</a></strong></li>
|
||||
<li><strong><a href="drvhyperv.html">Microsoft Hyper-V</a></strong></li>
|
||||
<li><strong><a href="drvphyp.html">IBM PowerVM (phyp)</a></strong></li>
|
||||
</ul>
|
||||
|
||||
<h2><a name="storage">Storage drivers</a></h2>
|
||||
<h2><a name="stroage">Storage drivers</a></h2>
|
||||
|
||||
<ul>
|
||||
<li><strong><a href="storage.html#StorageBackendDir">Directory backend</a></strong></li>
|
||||
@@ -43,8 +42,6 @@
|
||||
<li><strong><a href="storage.html#StorageBackendISCSI">iSCSI backend</a></strong></li>
|
||||
<li><strong><a href="storage.html#StorageBackendSCSI">SCSI backend</a></strong></li>
|
||||
<li><strong><a href="storage.html#StorageBackendMultipath">Multipath backend</a></strong></li>
|
||||
<li><strong><a href="storage.html#StorageBackendRBD">RBD (RADOS Block Device) backend</a></strong></li>
|
||||
<li><strong><a href="storage.html#StorageBackendSheepdog">Sheepdog backend</a></strong></li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
||||
|
@@ -2,10 +2,10 @@
|
||||
<h1>VMware ESX hypervisor driver</h1>
|
||||
<ul id="toc"></ul>
|
||||
<p>
|
||||
The libvirt VMware ESX driver can manage VMware ESX/ESXi 3.5/4.x/5.x and
|
||||
The libvirt VMware ESX driver can manage VMware ESX/ESXi 3.5/4.x and
|
||||
VMware GSX 2.0, also called VMware Server 2.0, and possibly later
|
||||
versions. <span class="since">Since 0.8.3</span> the driver can also
|
||||
connect to a VMware vCenter 2.5/4.x/5.x (VPX).
|
||||
connect to a VMware vCenter 2.5/4.x (VPX).
|
||||
</p>
|
||||
|
||||
<h2><a name="project">Project Links</a></h2>
|
||||
|
@@ -1,67 +0,0 @@
|
||||
<html><body>
|
||||
<h1>Parallels Cloud Server driver</h1>
|
||||
<ul id="toc"></ul>
|
||||
<p>
|
||||
The libvirt Parallels driver can manage Parallels Cloud Server starting from version 6.0.
|
||||
</p>
|
||||
|
||||
|
||||
<h2><a name="project">Project Links</a></h2>
|
||||
<ul>
|
||||
<li>
|
||||
The <a href="http://www.parallels.com/products/server/baremetal/sp/">Parallels Cloud Server</a> Virtualization Solution.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2><a name="uri">Connections to the Parallels Cloud Server driver</a></h2>
|
||||
<p>
|
||||
The libvirt Parallels driver is a single-instance privileged driver, with a driver name of 'parallels'. Some example connection URIs for the libvirt driver are:
|
||||
</p>
|
||||
<pre>
|
||||
parallels:///system (local access)
|
||||
parallels+unix:///system (local access)
|
||||
parallels://example.com/system (remote access, TLS/x509)
|
||||
parallels+tcp://example.com/system (remote access, SASl/Kerberos)
|
||||
parallels+ssh://root@example.com/system (remote access, SSH tunnelled)
|
||||
</pre>
|
||||
|
||||
<h2><a name="example">Example guest domain XML configuration</a></h2>
|
||||
|
||||
<p>
|
||||
Parallels driver require at least one hard disk for new domains
|
||||
at this time. It is used for defining directory, where VM should
|
||||
be created.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
<domain type='parallels'>
|
||||
<name>demo</name>
|
||||
<uuid>54cdecad-4492-4e31-a209-33cc21d64057</uuid>
|
||||
<description>some description</description>
|
||||
<memory unit='KiB'>1048576</memory>
|
||||
<currentMemory unit='KiB'>1048576</currentMemory>
|
||||
<vcpu placement='static'>2</vcpu>
|
||||
<os>
|
||||
<type arch='x86_64'>hvm</type>
|
||||
</os>
|
||||
<clock offset='utc'/>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
<on_reboot>destroy</on_reboot>
|
||||
<on_crash>destroy</on_crash>
|
||||
<devices>
|
||||
<disk type='file' device='disk'>
|
||||
<source file='/storage/vol1'/>
|
||||
<target dev='hda'/>
|
||||
</disk>
|
||||
<video>
|
||||
<model type='vga' vram='33554432' heads='1'>
|
||||
<acceleration accel3d='no' accel2d='no'/>
|
||||
</model>
|
||||
</video>
|
||||
</devices>
|
||||
</domain>
|
||||
|
||||
</pre>
|
||||
|
||||
</body></html>
|
@@ -1,47 +0,0 @@
|
||||
<html><body>
|
||||
<h1>IBM PowerVM hypervisor driver (phyp)</h1>
|
||||
<ul id="toc"></ul>
|
||||
<p>
|
||||
The IBM PowerVM driver can manage both HMC and IVM PowerVM
|
||||
guests. VIOS connections are tunneled through HMC.
|
||||
</p>
|
||||
|
||||
|
||||
<h2><a name="project">Project Links</a></h2>
|
||||
<ul>
|
||||
<li>
|
||||
The <a href="http://www-03.ibm.com/systems/power/software/virtualization/index.html">IBM
|
||||
PowerVM</a> hypervisor
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2><a name="uri">Connections to the PowerVM driver</a></h2>
|
||||
<p>
|
||||
Some example remote connection URIs for the driver are:
|
||||
</p>
|
||||
<pre>
|
||||
phyp://user@hmc/system (HMC connection)
|
||||
phyp://user@ivm/system (IVM connection)
|
||||
</pre>
|
||||
<p>
|
||||
<strong>Note</strong>: In contrast to other drivers, the
|
||||
PowerVM (or phyp) driver is a client-side-only driver,
|
||||
internally using ssh to connect to the specified hmc or ivm
|
||||
server. Therefore, the <a href="remote.html">remote transport
|
||||
mechanism</a> provided by the remote driver and libvirtd will
|
||||
not work, and you cannot use URIs like
|
||||
<code>phyp+ssh://example.com</code>.
|
||||
</p>
|
||||
|
||||
|
||||
<h3><a name="uriformat">URI Format</a></h3>
|
||||
<p>
|
||||
URIs have this general form (<code>[...]</code> marks an
|
||||
optional part, <code>{...|...}</code> marks a mandatory choice).
|
||||
</p>
|
||||
<pre>
|
||||
phyp://[username@]{hmc|ivm}/managed_system
|
||||
</pre>
|
||||
|
||||
</body></html>
|
@@ -54,7 +54,7 @@
|
||||
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 URI driver protocol
|
||||
is "qemu". Some example connection URIs for the libvirt driver are:
|
||||
is "qemu". Some example conection URIs for the libvirt driver are:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
@@ -476,7 +476,7 @@ $ virsh domxml-from-native qemu-argv demo.args
|
||||
</domain>
|
||||
</pre>
|
||||
|
||||
<p>NB, don't include the literal \ in the args, put everything on one line</p>
|
||||
<p>NB, don't include the literral \ in the args, put everything on one line</p>
|
||||
|
||||
<h3><a name="xmlexport">Converting from domain XML to QEMU args</a></h3>
|
||||
|
||||
|
@@ -8,7 +8,7 @@
|
||||
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 an alternate config. Some example connection URIs
|
||||
be given a path to a alternate config. Some example conection URIs
|
||||
for the libvirt driver are:
|
||||
</p>
|
||||
|
||||
|
@@ -53,21 +53,13 @@
|
||||
the <code>/etc/xen</code> directory. It is important not to place
|
||||
any other non-config files in this directory.
|
||||
</li>
|
||||
<li>
|
||||
<strong>libxl</strong>: Starting with Xen 4.2, the legacy XenD/xm
|
||||
toolstack is deprecated in favor of libxl, also commonly called
|
||||
libxenlight. libvirt supports this new Xen toolstack via the
|
||||
libxl driver. If XenD is enabled, the legacy xen driver consisting
|
||||
of the above mentioned channels will be used. If XenD is disabled,
|
||||
the libxl driver will be used.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h2><a name="uri">Connections to Xen driver</a></h2>
|
||||
|
||||
<p>
|
||||
The libvirt Xen driver is a single-instance privileged driver,
|
||||
with a driver name of 'xen'. Some example connection URIs for
|
||||
with a driver name of 'xen'. Some example conection URIs for
|
||||
the libvirt driver are:
|
||||
</p>
|
||||
|
||||
|
@@ -317,7 +317,7 @@ Bridge chain: PREROUTING, entries: 1, policy: ACCEPT
|
||||
|
||||
Bridge chain: POSTROUTING, entries: 1, policy: ACCEPT
|
||||
-o vnet0 -j libvirt-O-vnet0</pre>
|
||||
<p>To keep things manageable and easy to follow, the driver will then
|
||||
<p>To keep things managable and easy to follow, the driver will then
|
||||
create further sub-chains for each protocol then it needs to match
|
||||
against:
|
||||
</p>
|
||||
|
@@ -105,7 +105,7 @@
|
||||
<boot dev='cdrom'/>
|
||||
<bootmenu enable='yes'/>
|
||||
<smbios mode='sysinfo'/>
|
||||
<bios useserial='yes' rebootTimeout='0'/>
|
||||
<bios useserial='yes'/>
|
||||
</os>
|
||||
...</pre>
|
||||
|
||||
@@ -175,13 +175,8 @@
|
||||
Serial Graphics Adapter which allows users to see BIOS messages
|
||||
on a serial port. Therefore, one needs to have
|
||||
<a href="#elementCharSerial">serial port</a> defined.
|
||||
<span class="since">Since 0.9.4</span>.
|
||||
<span class="since">Since 0.10.2 (QEMU only)</span> there is
|
||||
another attribute, <code>rebootTimeout</code> that controls
|
||||
whether and after how long the guest should start booting
|
||||
again in case the boot fails (according to BIOS). The value is
|
||||
in milliseconds with maximum of <code>65535</code> and special
|
||||
value <code>-1</code> disables the reboot.
|
||||
<span class="since">Since 0.9.4</span>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<h4><a name="elementsOSBootloader">Host bootloader</a></h4>
|
||||
@@ -357,18 +352,8 @@
|
||||
the maximum supported by the hypervisor. <span class="since">Since
|
||||
0.4.4</span>, this element can contain an optional
|
||||
<code>cpuset</code> attribute, which is a comma-separated
|
||||
list of physical CPU numbers that domain process and virtual CPUs
|
||||
can be pinned to by default. (NB: The pinning policy of domain
|
||||
process and virtual CPUs can be specified separately by
|
||||
<code>cputune</code>. If attribute <code>emulatorpin</code>
|
||||
of <code>cputune</code> is specified, <code>cpuset</code>
|
||||
specified by <code>vcpu</code> here will be ingored; Similarly,
|
||||
For virtual CPUs which has <code>vcpupin</code> specified,
|
||||
<code>cpuset</code> specified by <code>cpuset</code> here
|
||||
will be ignored; For virtual CPUs which doesn't have
|
||||
<code>vcpupin</code> specified, it will be pinned to the physical
|
||||
CPUs specified by <code>cpuset</code> here).
|
||||
Each element in that list is either a single CPU number,
|
||||
list of physical CPU numbers that virtual CPUs can be pinned
|
||||
to. Each element in that list is either a single CPU number,
|
||||
a range of CPU numbers, or a caret followed by a CPU number to
|
||||
be excluded from a previous range. <span class="since">Since
|
||||
0.8.5</span>, the optional attribute <code>current</code> can
|
||||
@@ -399,12 +384,9 @@
|
||||
<vcpupin vcpu="1" cpuset="0,1"/>
|
||||
<vcpupin vcpu="2" cpuset="2,3"/>
|
||||
<vcpupin vcpu="3" cpuset="0,4"/>
|
||||
<emulatorpin cpuset="1-3"/>
|
||||
<shares>2048</shares>
|
||||
<period>1000000</period>
|
||||
<quota>-1</quota>
|
||||
<emulator_period>1000000</emulator_period>
|
||||
<emulator_quota>-1</emulator_quota>
|
||||
</cputune>
|
||||
...
|
||||
</domain>
|
||||
@@ -419,28 +401,15 @@
|
||||
</dd>
|
||||
<dt><code>vcpupin</code></dt>
|
||||
<dd>
|
||||
The optional <code>vcpupin</code> element specifies which of host's
|
||||
physical CPUs the domain VCPU will be pinned to. If this is omitted,
|
||||
and attribute <code>cpuset</code> of element <code>vcpu</code> is
|
||||
not specified, the vCPU is pinned to all the physical CPUs by default.
|
||||
It contains two required attributes, the attribute <code>vcpu</code>
|
||||
specifies vcpu id, and the attribute <code>cpuset</code> is same as
|
||||
attribute <code>cpuset</code> of element <code>vcpu</code>.
|
||||
(NB: Only qemu driver support)
|
||||
The optional <code>vcpupin</code> element specifies which of host
|
||||
physical CPUS the domain VCPU will be pinned to. If this is omitted,
|
||||
each VCPU is pinned to all the physical CPUS by default. It contains two
|
||||
required attributes, the attribute <code>vcpu</code> specifies vcpu id,
|
||||
and the attribute <code>cpuset</code> is same as
|
||||
attribute <code>cpuset</code>
|
||||
of element <code>vcpu</code>. (NB: Only qemu driver support)
|
||||
<span class="since">Since 0.9.0</span>
|
||||
</dd>
|
||||
<dt><code>emulatorpin</code></dt>
|
||||
<dd>
|
||||
The optional <code>emulatorpin</code> element specifies which of host
|
||||
physical CPUs the "emulator", a subset of a domain not including vcpu,
|
||||
will be pinned to. If this is omitted, and attribute
|
||||
<code>cpuset</code> of element <code>vcpu</code> is not specified,
|
||||
"emulator" is pinned to all the physical CPUs by default. It contains
|
||||
one required attribute <code>cpuset</code> specifying which physical
|
||||
CPUs to pin to. NB, <code>emulatorpin</code> is not allowed if
|
||||
attribute <code>placement</code> of element <code>vcpu</code> is
|
||||
"auto".
|
||||
</dd>
|
||||
<dt><code>shares</code></dt>
|
||||
<dd>
|
||||
The optional <code>shares</code> element specifies the proportional
|
||||
@@ -457,9 +426,8 @@
|
||||
interval(unit: microseconds). Within <code>period</code>, each vcpu of
|
||||
the domain will not be allowed to consume more than <code>quota</code>
|
||||
worth of runtime. The value should be in range [1000, 1000000]. A period
|
||||
with value 0 means no value.
|
||||
<span class="since">Only QEMU driver support since 0.9.4, LXC since
|
||||
0.9.10</span>
|
||||
with value 0 means no value. (NB: Only qemu driver support)
|
||||
<span class="since">Since 0.9.4</span>
|
||||
</dd>
|
||||
<dt><code>quota</code></dt>
|
||||
<dd>
|
||||
@@ -469,32 +437,9 @@
|
||||
means that it is not bandwidth controlled. The value should be in range
|
||||
[1000, 18446744073709551] or less than 0. A quota with value 0 means no
|
||||
value. You can use this feature to ensure that all vcpus run at the same
|
||||
speed.
|
||||
<span class="since">Only QEMU driver support since 0.9.4, LXC since
|
||||
0.9.10</span>
|
||||
speed. (NB: Only qemu driver support)
|
||||
<span class="since">Since 0.9.4</span>
|
||||
</dd>
|
||||
|
||||
<dt><code>emulator_period</code></dt>
|
||||
<dd>
|
||||
The optional <code>emulator_period</code> element specifies the enforcement
|
||||
interval(unit: microseconds). Within <code>emulator_period</code>, emulator
|
||||
threads(those excluding vcpus) of the domain will not be allowed to consume
|
||||
more than <code>emulator_quota</code> worth of runtime. The value should be
|
||||
in range [1000, 1000000]. A period with value 0 means no value.
|
||||
<span class="since">Only QEMU driver support since 0.10.0</span>
|
||||
</dd>
|
||||
<dt><code>emulator_quota</code></dt>
|
||||
<dd>
|
||||
The optional <code>emulator_quota</code> element specifies the maximum
|
||||
allowed bandwidth(unit: microseconds) for domain's emulator threads(those
|
||||
excluding vcpus). A domain with <code>emulator_quota</code> as any negative
|
||||
value indicates that the domain has infinite bandwidth for emulator threads
|
||||
(those excluding vcpus), which means that it is not bandwidth controlled.
|
||||
The value should be in range [1000, 18446744073709551] or less than 0. A
|
||||
quota with value 0 means no value.
|
||||
<span class="since">Only QEMU driver support since 0.10.0</span>
|
||||
</dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
@@ -513,7 +458,7 @@
|
||||
<dt><code>memory</code></dt>
|
||||
<dd>The maximum allocation of memory for the guest at boot time.
|
||||
The units for this value are determined by the optional
|
||||
attribute <code>unit</code>, which defaults to "KiB"
|
||||
atttribute <code>unit</code>, which defaults to "KiB"
|
||||
(kibibytes, 2<sup>10</sup> or blocks of 1024 bytes). Valid
|
||||
units are "b" or "bytes" for bytes, "KB" for kilobytes
|
||||
(10<sup>3</sup> or 1,000 bytes), "k" or "KiB" for kibibytes
|
||||
@@ -527,15 +472,9 @@
|
||||
However, the value will be rounded up to the nearest kibibyte
|
||||
by libvirt, and may be further rounded to the granularity
|
||||
supported by the hypervisor. Some hypervisors also enforce a
|
||||
minimum, such as 4000KiB.
|
||||
|
||||
In the case of crash, optional attribute <code>dumpCore</code>
|
||||
can be used to control whether the guest memory should be
|
||||
included in the generated coredump or not (values "on", "off").
|
||||
|
||||
<span class='since'><code>unit</code> since 0.9.11</span>,
|
||||
<span class='since'><code>dumpCore</code> since 0.10.2
|
||||
(QEMU only)</span></dd>
|
||||
minimum, such as
|
||||
4000KiB. <span class='since'><code>unit</code> since
|
||||
0.9.11</span></dd>
|
||||
<dt><code>currentMemory</code></dt>
|
||||
<dd>The actual allocation of memory for the guest. This value can
|
||||
be less than the maximum allocation, to allow for ballooning
|
||||
@@ -840,11 +779,7 @@
|
||||
in which case an attempt to start a domain requesting an unsupported
|
||||
CPU model will fail. Supported values for <code>fallback</code>
|
||||
attribute are: <code>allow</code> (this is the default), and
|
||||
<code>forbid</code>. The optional <code>vendor_id</code> attribute
|
||||
(<span class="since">Since 0.10.0</span>) can be used to set the
|
||||
vendor id seen by the guest. It must be exactly 12 characters long.
|
||||
If not set the vendor id of the host is used. Typical possible
|
||||
values are "AuthenticAMD" and "GenuineIntel".</dd>
|
||||
<code>forbid</code>.</dd>
|
||||
|
||||
<dt><code>vendor</code></dt>
|
||||
<dd><span class="since">Since 0.8.3</span> the content of the
|
||||
@@ -919,11 +854,15 @@
|
||||
This guest NUMA specification is currently available only for QEMU/KVM.
|
||||
</p>
|
||||
|
||||
<h3><a name="elementsEvents">Events configuration</a></h3>
|
||||
<h3><a name="elementsLifecycle">Lifecycle control</a></h3>
|
||||
|
||||
<p>
|
||||
It is sometimes necessary to override the default actions taken
|
||||
on various events.
|
||||
when a guest OS triggers a lifecycle operation. The following
|
||||
collections of elements allow the actions to be specified. A
|
||||
common use case is to force a reboot to be treated as a poweroff
|
||||
when doing the initial OS installation. This allows the VM to be
|
||||
re-configured for the first post-install bootup.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
@@ -931,16 +870,8 @@
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
<on_reboot>restart</on_reboot>
|
||||
<on_crash>restart</on_crash>
|
||||
<on_lockfailure>poweroff</on_lockfailure>
|
||||
...</pre>
|
||||
|
||||
<p>
|
||||
The following collections of elements allow the actions to be
|
||||
specified when a guest OS triggers a lifecycle operation. A
|
||||
common use case is to force a reboot to be treated as a poweroff
|
||||
when doing the initial OS installation. This allows the VM to be
|
||||
re-configured for the first post-install bootup.
|
||||
</p>
|
||||
<dl>
|
||||
<dt><code>on_poweroff</code></dt>
|
||||
<dd>The content of this element specifies the action to take when
|
||||
@@ -987,51 +918,6 @@
|
||||
domain will be restarted with the same configuration</dd>
|
||||
</dl>
|
||||
|
||||
<p>
|
||||
The <code>on_lockfailure</code> element (<span class="since">since
|
||||
1.0.0</span>) may be used to configure what action should be
|
||||
taken when a lock manager loses resource locks. The following
|
||||
actions are recognized by libvirt, although not all of them need
|
||||
to be supported by individual lock managers. When no action is
|
||||
specified, each lock manager will take its default action.
|
||||
</p>
|
||||
<dl>
|
||||
<dt><code>poweroff</code></dt>
|
||||
<dd>The domain will be forcefully powered off.</dd>
|
||||
<dt><code>restart</code></dt>
|
||||
<dd>The domain will be powered off and started up again to
|
||||
reacquire its locks.</dd>
|
||||
<dt><code>pause</code></dt>
|
||||
<dd>The domain will be paused so that it can be manually resumed
|
||||
when lock issues are solved.</dd>
|
||||
<dt><code>ignore</code></dt>
|
||||
<dd>Keep the domain running as if nothing happened.</dd>
|
||||
</dl>
|
||||
|
||||
<h3><a name="elementsPowerManagement">Power Management</a></h3>
|
||||
|
||||
<p>
|
||||
<span class="since">Since 0.10.2</span> it is possible to
|
||||
forcibly enable or disable BIOS advertisements to the guest
|
||||
OS. (NB: Only qemu driver support)
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
...
|
||||
<pm>
|
||||
<suspend-to-disk enabled='no'/>
|
||||
<suspend-to-mem enabled='yes'/>
|
||||
</pm>
|
||||
...</pre>
|
||||
|
||||
<dl>
|
||||
<dt><code>pm</code></dt>
|
||||
<dd>These elements enable ('yes') or disable ('no') BIOS support
|
||||
for S3 (suspend-to-disk) and S4 (suspend-to-mem) ACPI sleep
|
||||
states. If nothing is specified, then the hypervisor will be
|
||||
left with its default value.</dd>
|
||||
</dl>
|
||||
|
||||
<h3><a name="elementsFeatures">Hypervisor features</a></h3>
|
||||
|
||||
<p>
|
||||
@@ -1047,10 +933,6 @@
|
||||
<apic/>
|
||||
<hap/>
|
||||
<privnet/>
|
||||
<hyperv>
|
||||
<relaxed state='on'/>
|
||||
</hyperv>
|
||||
|
||||
</features>
|
||||
...</pre>
|
||||
|
||||
@@ -1070,13 +952,6 @@
|
||||
<dd>ACPI is useful for power management, for example, with
|
||||
KVM guests it is required for graceful shutdown to work.
|
||||
</dd>
|
||||
<dt><code>apic</code></dt>
|
||||
<dd>APIC allows the use of programmable IRQ
|
||||
management. <span class="since">Since 0.10.2 (QEMU only)</span> there is
|
||||
an optional attribute <code>eoi</code> with values <code>on</code>
|
||||
and <code>off</code> which toggles the availability of EOI (End of
|
||||
Interrupt) for the guest.
|
||||
</dd>
|
||||
<dt><code>hap</code></dt>
|
||||
<dd>Enable use of Hardware Assisted Paging if available in
|
||||
the hardware.
|
||||
@@ -1091,23 +966,6 @@
|
||||
This feature is only relevant for container based
|
||||
virtualization drivers, such as LXC.
|
||||
</dd>
|
||||
<dt><code>hyperv</code></dt>
|
||||
<dd>Enable various features improving behavior of guests
|
||||
running Microsoft Windows.
|
||||
<table class="top_table">
|
||||
<tr>
|
||||
<th>Feature</th>
|
||||
<th>Description</th>
|
||||
<th>Value</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>relaxed</td>
|
||||
<td>Relax contstraints on timers</td>
|
||||
<td> on, off</td>
|
||||
</tr>
|
||||
</table>
|
||||
<span class="since">Since 1.0.0 (QEMU only)</span>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<h3><a name="elementsTime">Time keeping</a></h3>
|
||||
@@ -1121,11 +979,11 @@
|
||||
|
||||
<pre>
|
||||
...
|
||||
<clock offset='localtime'>
|
||||
<timer name='rtc' tickpolicy='catchup' track='guest'>
|
||||
<catchup threshold='123' slew='120' limit='10000'/>
|
||||
<clock offset="localtime">
|
||||
<timer name="rtc" tickpolicy="catchup" track="guest">
|
||||
<catchup threshold=123 slew=120 limit=10000/>
|
||||
</timer>
|
||||
<timer name='pit' tickpolicy='delay'/>
|
||||
<timer name="pit" tickpolicy="delay"/>
|
||||
</clock>
|
||||
...</pre>
|
||||
|
||||
@@ -1360,13 +1218,6 @@
|
||||
<target dev='sda' bus='scsi'/>
|
||||
<address type='drive' controller='0' bus='0' target='3' unit='0'/>
|
||||
</disk>
|
||||
<disk type='block' device='disk'>
|
||||
<driver name='qemu' type='raw'/>
|
||||
<source dev='/dev/sda'/>
|
||||
<geometry cyls='16383' heads='16' secs='63' trans='lba'/>
|
||||
<blockio logical_block_size='512' physical_block_size='4096'/>
|
||||
<target dev='hda' bus='ide'/>
|
||||
</disk>
|
||||
</devices>
|
||||
...</pre>
|
||||
|
||||
@@ -1418,8 +1269,8 @@
|
||||
path to the file holding the disk. If the disk
|
||||
<code>type</code> is "block", then the <code>dev</code>
|
||||
attribute specifies the path to the host device to serve as
|
||||
the disk. With both "file" and "block", one or more optional
|
||||
sub-elements <code>seclabel</code>, <a href="#seclabel">described
|
||||
the disk. With both "file" and "block", an optional
|
||||
sub-element <code>seclabel</code>, <a href="#seclabel">described
|
||||
below</a> (and <span class="since">since 0.9.9</span>), can be
|
||||
used to override the domain security labeling policy for just
|
||||
that source file. If the disk <code>type</code> is "dir", then the
|
||||
@@ -1427,10 +1278,10 @@
|
||||
to the directory to use as the disk. If the disk <code>type</code>
|
||||
is "network", then the <code>protocol</code> attribute specifies
|
||||
the protocol to access to the requested image; possible values
|
||||
are "nbd", "rbd", "sheepdog" or "gluster". If the
|
||||
<code>protocol</code> attribute is "rbd", "sheepdog" or "gluster", an
|
||||
additional attribute <code>name</code> is mandatory to specify which
|
||||
volume/image will be used. When the disk <code>type</code> is
|
||||
are "nbd", "rbd", and "sheepdog". If the <code>protocol</code>
|
||||
attribute is "rbd" or "sheepdog", an additional
|
||||
attribute <code>name</code> is mandatory to specify which
|
||||
image will be used. When the disk <code>type</code> is
|
||||
"network", the <code>source</code> may have zero or
|
||||
more <code>host</code> sub-elements used to specify the hosts
|
||||
to connect.
|
||||
@@ -1595,7 +1446,7 @@
|
||||
The optional <code>event_idx</code> attribute controls
|
||||
some aspects of device event processing. The value can be
|
||||
either 'on' or 'off' - if it is on, it will reduce the
|
||||
number of interrupts and exits for the guest. The default
|
||||
number of interupts and exits for the guest. The default
|
||||
is determined by QEMU; usually if the feature is
|
||||
supported, default is on. In case there is a situation
|
||||
where this behavior is suboptimal, this attribute provides
|
||||
@@ -1606,7 +1457,7 @@
|
||||
</li>
|
||||
<li>
|
||||
The optional <code>copy_on_read</code> attribute controls
|
||||
whether to copy read backing file into the image file. The
|
||||
wether to copy read backing file into the image file. The
|
||||
value can be either "on" or "off".
|
||||
Copy-on-read avoids accessing the same backing file sectors
|
||||
repeatedly and is useful when the backing file is over a slow
|
||||
@@ -1651,30 +1502,10 @@
|
||||
like <code><serial>WD-WMAP9A966149</serial></code>.
|
||||
<span class="since">Since 0.7.1</span>
|
||||
</dd>
|
||||
<dt><code>wwn</code></dt>
|
||||
<dd>If present, this element specifies the WWN (World Wide Name)
|
||||
of a virtual hard disk or CD-ROM drive. It must be composed
|
||||
of 16 hexadecimal digits.
|
||||
<span class='since'>Since 0.10.1</span>
|
||||
</dd>
|
||||
<dt><code>vendor</code></dt>
|
||||
<dd>If present, this element specifies the vendor of a virtual hard
|
||||
disk or CD-ROM device. It must not be longer than 8 printable
|
||||
characters.
|
||||
<span class='since'>Since 1.0.1</span>
|
||||
</dd>
|
||||
<dt><code>product</code></dt>
|
||||
<dd>If present, this element specifies the product of a virtual hard
|
||||
disk or CD-ROM device. It must not be longer than 16 printable
|
||||
characters.
|
||||
<span class='since'>Since 1.0.1</span>
|
||||
</dd>
|
||||
<dt><code>host</code></dt>
|
||||
<dd>The <code>host</code> element supports 4 attributes, viz. "name",
|
||||
"port", "transport" and "socket", which specify the hostname, the port
|
||||
number, transport type and path to socket, respectively. The meaning
|
||||
of this element and the number of the elements depend on the protocol
|
||||
attribute.
|
||||
<dd>The <code>host</code> element has two attributes "name" and "port",
|
||||
which specify the hostname and the port number. The meaning of this
|
||||
element and the number of the elements depend on the protocol attribute.
|
||||
<table class="top_table">
|
||||
<tr>
|
||||
<th> Protocol </th>
|
||||
@@ -1696,15 +1527,7 @@
|
||||
<td> one of the sheepdog servers (default is localhost:7000) </td>
|
||||
<td> zero or one </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> gluster </td>
|
||||
<td> a server running glusterd daemon </td>
|
||||
<td> only one </td>
|
||||
</tr>
|
||||
</table>
|
||||
In case of gluster, valid values for transport attribute are tcp, rdma
|
||||
or unix. If nothing is specified, tcp is assumed. If transport is unix,
|
||||
socket attribute specifies path to unix socket.
|
||||
</dd>
|
||||
<dt><code>address</code></dt>
|
||||
<dd>If present, the <code>address</code> element ties the disk
|
||||
@@ -1742,42 +1565,6 @@
|
||||
associated with the Ceph secret
|
||||
object. <span class="since">libvirt 0.9.7</span>
|
||||
</dd>
|
||||
<dt><code>geometry</code></dt>
|
||||
<dd>The optional <code>geometry</code> element provides the
|
||||
ability to override geometry settings. This mostly useful for
|
||||
S390 DASD-disks or older DOS-disks. <span class="since">0.10.0</span>
|
||||
<dl>
|
||||
<dt><code>cyls</code></dt>
|
||||
<dd>The <code>cyls</code> attribute is the
|
||||
number of cylinders. </dd>
|
||||
<dt><code>heads</code></dt>
|
||||
<dd>The <code>heads</code> attribute is the
|
||||
number of heads. </dd>
|
||||
<dt><code>secs</code></dt>
|
||||
<dd>The <code>secs</code> attribute is the
|
||||
number of sectors per track. </dd>
|
||||
<dt><code>trans</code></dt>
|
||||
<dd>The optional <code>trans</code> attribute is the
|
||||
BIOS-Translation-Modus (none, lba or auto)</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
<dt><code>blockio</code></dt>
|
||||
<dd>If present, the <code>blockio</code> element allows
|
||||
to override any of the block device properties listed below.
|
||||
<span class="since">Since 0.10.2 (QEMU and KVM)</span>
|
||||
<dl>
|
||||
<dt><code>logical_block_size</code></dt>
|
||||
<dd>The logical block size the disk will report to the guest
|
||||
OS. For Linux this would be the value returned by the
|
||||
BLKSSZGET ioctl and describes the smallest units for disk
|
||||
I/O.
|
||||
<dt><code>physical_block_size</code></dt>
|
||||
<dd>The physical block size the disk will report to the guest
|
||||
OS. For Linux this would be the value returned by the
|
||||
BLKPBSZGET ioctl and describes the disk's hardware sector
|
||||
size which can be relevant for the alignment of disk data.
|
||||
</dl>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<h4><a name="elementsFilesystems">Filesystems</a></h4>
|
||||
@@ -1835,9 +1622,7 @@
|
||||
</dd>
|
||||
<dt><code>type='file'</code></dt>
|
||||
<dd>
|
||||
A host file will be treated as an image and mounted in
|
||||
the guest. The filesystem format will be autodetected.
|
||||
Only used by LXC driver.
|
||||
Currently unused.
|
||||
</dd>
|
||||
<dt><code>type='block'</code></dt>
|
||||
<dd>
|
||||
@@ -1845,18 +1630,6 @@
|
||||
format will be autodetected. Only used by LXC driver
|
||||
<span class="since">(since 0.9.5)</span>.
|
||||
</dd>
|
||||
<dt><code>type='ram'</code></dt>
|
||||
<dd>
|
||||
An in-memory filesystem, using memory from the host OS.
|
||||
The source element has a single attribute <code>usage</code>
|
||||
which gives the memory usage limit in kibibytes. Only used
|
||||
by LXC driver.
|
||||
<span class="since"> (since 0.9.13)</span></dd>
|
||||
<dt><code>type='bind'</code></dt>
|
||||
<dd>
|
||||
A directory inside the guest will be bound to another
|
||||
directory inside the guest. Only used by LXC driver
|
||||
<span class="since"> (since 0.9.13)</span></dd>
|
||||
</dl>
|
||||
|
||||
The filesystem block has an optional attribute <code>accessmode</code>
|
||||
@@ -1896,8 +1669,7 @@
|
||||
The resource on the host that is being accessed in the guest. The
|
||||
<code>name</code> attribute must be used with
|
||||
<code>type='template'</code>, and the <code>dir</code> attribute must
|
||||
be used with <code>type='mount'</code>. The <code>usage</code> attribute
|
||||
is used with <code>type='ram'</code> to set the memory limit in KB.
|
||||
be used with <code>type='mount'</code>
|
||||
</dd>
|
||||
|
||||
<dt><code>target</code></dt>
|
||||
@@ -1914,20 +1686,6 @@
|
||||
default read-write access is given (currently only works for
|
||||
QEMU/KVM driver).
|
||||
</dd>
|
||||
|
||||
<dt><code>space_hard_limit</code></dt>
|
||||
<dd>
|
||||
Maximum space available to this guest's filesystem.
|
||||
<span class="since">Since 0.9.13</span>
|
||||
</dd>
|
||||
|
||||
<dt><code>space_soft_limit</code></dt>
|
||||
<dd>
|
||||
Maximum space available to this guest's filesystem. The container is
|
||||
permitted to exceed its soft limits for a grace period of time. Afterwards the
|
||||
hard limit is enforced.
|
||||
<span class="since">Since 0.9.13</span>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<h4><a name="elementsAddress">Device Addresses</a></h4>
|
||||
@@ -2048,10 +1806,8 @@
|
||||
A "usb" controller has an optional attribute <code>model</code>,
|
||||
which is one of "piix3-uhci", "piix4-uhci", "ehci",
|
||||
"ich9-ehci1", "ich9-uhci1", "ich9-uhci2", "ich9-uhci3",
|
||||
"vt82c686b-uhci", "pci-ohci" or "nec-xhci". Additionally,
|
||||
<span class="since">since 0.10.0</span>, if the USB bus needs to be
|
||||
explicitly disabled for the guest, <code>model='none'</code> may be used.
|
||||
The PowerPC64 "spapr-vio" addresses do not have an associated controller.
|
||||
"vt82c686b-uhci" or "pci-ohci". The PowerPC64 "spapr-vio"
|
||||
addresses do not have an associated controller.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -2136,7 +1892,7 @@
|
||||
...
|
||||
<devices>
|
||||
<hostdev mode='subsystem' type='usb'>
|
||||
<source startupPolicy='optional'>
|
||||
<source>
|
||||
<vendor id='0x1234'/>
|
||||
<product id='0xbeef'/>
|
||||
</source>
|
||||
@@ -2180,29 +1936,9 @@
|
||||
<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. PCI devices
|
||||
on the other hand can only be described by their <code>address</code>.
|
||||
|
||||
<span class="since">Since 1.0.0</span>, the <code>source</code> element
|
||||
of USB devices may contain <code>startupPolicy</code> attribute which can
|
||||
be used to define policy what to do if the specified host USB device is
|
||||
not found. The attribute accepts the following values:
|
||||
<table class="top_table">
|
||||
<tr>
|
||||
<td> mandatory </td>
|
||||
<td> fail if missing for any reason (the default) </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> requisite </td>
|
||||
<td> fail if missing on boot up,
|
||||
drop if missing on migrate/restore/revert </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> optional </td>
|
||||
<td> drop if missing at any start attempt </td>
|
||||
</tr>
|
||||
</table>
|
||||
</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.
|
||||
@@ -2214,8 +1950,7 @@
|
||||
boot sequence. The per-device <code>boot</code> elements cannot be
|
||||
used together with general boot elements in
|
||||
<a href="#elementsOSBIOS">BIOS bootloader</a> section.
|
||||
<span class="since">Since 0.8.8</span> for PCI devices,
|
||||
<span class="since">Since 1.0.1</span> for USB devices.
|
||||
<span class="since">Since 0.8.8</span></dd>
|
||||
<dt><code>rom</code></dt>
|
||||
<dd>The <code>rom</code> element is used to change how a PCI
|
||||
device's ROM is presented to the guest. The optional <code>bar</code>
|
||||
@@ -2260,12 +1995,7 @@
|
||||
<devices>
|
||||
<redirdev bus='usb' type='tcp'>
|
||||
<source mode='connect' host='localhost' service='4000'/>
|
||||
<boot order='1'/>
|
||||
</redirdev>
|
||||
<redirfilter>
|
||||
<usbdev class='0x08' vendor='0x1234' product='0xbeef' version='2.00' allow='yes'/>
|
||||
<usbdev allow='no'/>
|
||||
</redirfilter>
|
||||
</devices>
|
||||
...</pre>
|
||||
|
||||
@@ -2282,36 +2012,21 @@
|
||||
tunnel; <code>type='tcp'</code>
|
||||
or <code>type='spicevmc'</code> (which uses the usbredir
|
||||
channel of a <a href="#elementsGraphics">SPICE graphics
|
||||
device</a>) are typical. The redirdev element has an optional
|
||||
sub-element <code><address></code> which can tie the
|
||||
device to a particular controller. Further sub-elements,
|
||||
such as <code><source></code>, may be required according
|
||||
to the given type, although a <code><target></code> sub-element
|
||||
is not required (since the consumer of the character device is
|
||||
the hypervisor itself, rather than a device visible in the guest).
|
||||
</dd>
|
||||
<dt><code>boot</code></dt>
|
||||
device</a>) are typical.</dd>
|
||||
|
||||
<dd>Specifies that the device is bootable.
|
||||
The <code>order</code> attribute determines the order in which
|
||||
devices will be tried during boot sequence. The per-device
|
||||
<code>boot</code> elements cannot be used together with general
|
||||
boot elements in <a href="#elementsOSBIOS">BIOS bootloader</a> section.
|
||||
(<span class="since">Since 1.0.1</span>)
|
||||
</dd>
|
||||
<dt><code>redirfilter</code></dt>
|
||||
<dd>The<code> redirfilter </code>element is used for creating the
|
||||
filter rule to filter out certain devices from redirection.
|
||||
It uses sub-element <code><usbdev></code> to define each filter rule.
|
||||
<code>class</code> attribute is the USB Class code, for example,
|
||||
0x08 represents mass storage devices. The USB device can be addressed by
|
||||
vendor / product id using the <code>vendor</code> and <code>product</code> attributes.
|
||||
<code>version</code> is the bcdDevice value of USB device, such as 1.00, 1.10 and 2.00.
|
||||
These four attributes are optional and <code>-1</code> can be used to allow
|
||||
any value for them. <code>allow</code> attribute is mandatory,
|
||||
'yes' means allow, 'no' for deny.
|
||||
</dd>
|
||||
</dl>
|
||||
<p>
|
||||
The redirdev element has an optional sub-element
|
||||
<code><address></code> which can tie the device to a
|
||||
particular controller.
|
||||
</p>
|
||||
<p>
|
||||
Further sub-elements, such as <code><source></code>, may
|
||||
be required according to the given type, although
|
||||
a <code><target></code> sub-element is not required (since
|
||||
the consumer of the character device is the hypervisor itself,
|
||||
rather than a device visible in the guest).
|
||||
</p>
|
||||
|
||||
<h4><a name="elementsSmartcard">Smartcard devices</a></h4>
|
||||
|
||||
@@ -2480,40 +2195,11 @@
|
||||
the network; one network may have multiple portgroups defined,
|
||||
with each portgroup containing slightly different configuration
|
||||
information for different classes of network
|
||||
connections. <span class="since">Since 0.9.4</span>.
|
||||
</p>
|
||||
<p>
|
||||
Also, similar to <code>direct</code> network connections
|
||||
(described below), a connection of type <code>network</code> may
|
||||
specify a <code>virtualport</code> element, with configuration
|
||||
data to be forwarded to a vepa (802.1Qbg) or 802.1Qbh compliant
|
||||
switch (<span class="since">Since 0.8.2</span>), or to an
|
||||
Open vSwitch virtual switch (<span class="since">Since
|
||||
0.9.11</span>).
|
||||
</p>
|
||||
<p>
|
||||
Since the actual type of switch may vary depending on the
|
||||
configuration in the <code><network></code> on the host,
|
||||
it is acceptable to omit the virtualport <code>type</code>
|
||||
attribute, and specify attributes from multiple different
|
||||
virtualport types (and also to leave out certain attributes); at
|
||||
domain startup time, a complete <code><virtualport></code>
|
||||
element will be constructed by merging together the type and
|
||||
attributes found in the which will be filled in from the network
|
||||
or portgroup <code><virtualport></code>)
|
||||
(<span class="since">Since 0.10.0</span>). For example, in order
|
||||
to work properly with both an 802.1Qbh switch and an Open vSwitch
|
||||
switch, you may choose to specify no type, but both
|
||||
an <code>instanceid</code> (in case the switch is 802.1Qbh) and
|
||||
an <code>interfaceid</code> (in case the switch is Open vSwitch)
|
||||
(you may also omit the other attributes, such as managerid,
|
||||
typeid, or profileid, to be filled in from the
|
||||
network's <code><virtualport></code>). If you want to
|
||||
limit a guest to connecting only to certain types of switches,
|
||||
you can specify the virtualport type, but still omit some/all of
|
||||
the parameters - in this case if the host's network has a
|
||||
different type of virtualport, connection of the interface will
|
||||
fail.
|
||||
connections. <span class="since">Since 0.9.4</span>). Also,
|
||||
similar to <code>direct</code> network connections (described
|
||||
below), a connection of type <code>network</code> may specify
|
||||
a <code>virtportprofile</code> element, with configuration data
|
||||
to be forwarded to a vepa or 802.1Qbh compliant switch.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
@@ -2527,8 +2213,8 @@
|
||||
<source network='default' portgroup='engineering'/>
|
||||
<target dev='vnet7'/>
|
||||
<mac address="00:11:22:33:44:55"/>
|
||||
<virtualport>
|
||||
<parameters instanceid='09b11c53-8b5c-4eeb-8f00-d84eaa0aaa4f'/>
|
||||
<virtualport type='802.1Qbg'>
|
||||
<parameters managerid='11' typeid='1193047' typeidversion='2' instanceid='09b11c53-8b5c-4eeb-8f00-d84eaa0aaa4f'/>
|
||||
</virtualport>
|
||||
|
||||
</interface>
|
||||
@@ -2540,7 +2226,7 @@
|
||||
<p>
|
||||
<strong><em>
|
||||
This is the recommended config for general guest connectivity on
|
||||
hosts with static wired networking configs.
|
||||
hosts with static wired networking configs
|
||||
</em></strong>
|
||||
</p>
|
||||
|
||||
@@ -2555,40 +2241,19 @@
|
||||
configuration is whatever is used on the LAN. This provides the guest VM
|
||||
full incoming & outgoing net access just like a physical machine.
|
||||
</p>
|
||||
<p>
|
||||
On Linux systems, the bridge device is normally a standard Linux
|
||||
host bridge. On hosts that support Open vSwitch, it is also
|
||||
possible to connect to an open vSwitch bridge device by adding
|
||||
a <code><virtualport type='openvswitch'/></code> to the
|
||||
interface definition. (<span class="since">Since
|
||||
0.9.11</span>). The Open vSwitch type virtualport accepts two
|
||||
parameters in its <code><parameters></code> element -
|
||||
an <code>interfaceid</code> which is a standard uuid used to
|
||||
uniquely identify this particular interface to Open vSwitch (if
|
||||
you do no specify one, a random interfaceid will be generated
|
||||
for you when you first define the interface), and an
|
||||
optional <code>profileid</code> which is sent to Open vSwitch as
|
||||
the interfaces "port-profile".
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
...
|
||||
<devices>
|
||||
...
|
||||
<interface type='bridge'>
|
||||
<source bridge='br0'/>
|
||||
</interface>
|
||||
...
|
||||
<interface type='bridge'>
|
||||
<source bridge='br1'/>
|
||||
<source bridge='br0'/>
|
||||
<target dev='vnet7'/>
|
||||
<mac address="00:11:22:33:44:55"/>
|
||||
</interface>
|
||||
<interface type='bridge'>
|
||||
<source bridge='ovsbr'/>
|
||||
<virtualport type='openvswitch'>
|
||||
<parameters profileid='menial' interfaceid='09b11c53-8b5c-4eeb-8f00-d84eaa0aaa4f'/>
|
||||
</virtualport>
|
||||
</interface>
|
||||
...
|
||||
</devices>
|
||||
...</pre>
|
||||
|
||||
@@ -2685,6 +2350,7 @@
|
||||
<pre>
|
||||
...
|
||||
<devices>
|
||||
<interface type='direct'/>
|
||||
...
|
||||
<interface type='direct'>
|
||||
<source dev='eth0' mode='vepa'/>
|
||||
@@ -2733,6 +2399,7 @@
|
||||
<pre>
|
||||
...
|
||||
<devices>
|
||||
<interface type='direct'/>
|
||||
...
|
||||
<interface type='direct'>
|
||||
<source dev='eth0.2' mode='vepa'/>
|
||||
@@ -2760,6 +2427,7 @@
|
||||
<pre>
|
||||
...
|
||||
<devices>
|
||||
<interface type='direct'/>
|
||||
...
|
||||
<interface type='direct'>
|
||||
<source dev='eth0' mode='private'/>
|
||||
@@ -2779,8 +2447,8 @@
|
||||
is directly assigned to the guest using generic device
|
||||
passthrough, after first optionally setting the device's MAC
|
||||
address to the configured value, and associating the device with
|
||||
an 802.1Qbh capable switch using an optionally specified
|
||||
<virtualport> element (see the examples of virtualport
|
||||
an 802.1Qgh capable switch using an optionally specified
|
||||
%lt;virtualport%gt; element (see the examples of virtualport
|
||||
given above for type='direct' network devices). Note that - due
|
||||
to limitations in standard single-port PCI ethernet card driver
|
||||
design - only SR-IOV (Single Root I/O Virtualization) virtual
|
||||
@@ -2985,7 +2653,7 @@ qemu-kvm -net nic,model=? /dev/null
|
||||
<dd>
|
||||
The <code>event_idx</code> attribute controls some aspects of
|
||||
device event processing. The value can be either 'on' or 'off'
|
||||
- if it is on, it will reduce the number of interrupts and
|
||||
- if it is on, it will reduce the number of interupts and
|
||||
exits for the guest. The default is determined by QEMU;
|
||||
usually if the feature is supported, default is on. In case
|
||||
there is a situation where this behavior is suboptimal, this
|
||||
@@ -3080,7 +2748,7 @@ qemu-kvm -net nic,model=? /dev/null
|
||||
<source network='default'/>
|
||||
<target dev='vnet0'/>
|
||||
<b><bandwidth>
|
||||
<inbound average='1000' peak='5000' floor='200' burst='1024'/>
|
||||
<inbound average='1000' peak='5000' burst='1024'/>
|
||||
<outbound average='128' peak='256' burst='256'/>
|
||||
</bandwidth></b>
|
||||
</interface>
|
||||
@@ -3095,69 +2763,14 @@ qemu-kvm -net nic,model=? /dev/null
|
||||
children element out result in no QoS applied on that traffic direction.
|
||||
So, when you want to shape only domain's incoming traffic, use
|
||||
<code>inbound</code> only, and vice versa. Each of these elements have one
|
||||
mandatory attribute <code>average</code> (or <code>floor</code> as
|
||||
described below). <code>average</code> specifies average bit rate on
|
||||
the interface being shaped. Then there are two optional attributes:
|
||||
mandatory attribute <code>average</code>. It specifies average bit rate on
|
||||
interface being shaped. Then there are two optional attributes:
|
||||
<code>peak</code>, which specifies maximum rate at which interface can send
|
||||
data, and <code>burst</code>, amount of bytes that can be burst at
|
||||
<code>peak</code> speed. Accepted values for attributes are integer
|
||||
numbers. The units for <code>average</code> and <code>peak</code> attributes
|
||||
are kilobytes per second, and for the <code>burst</code> just kilobytes.
|
||||
<span class="since">Since 0.9.4</span> The <code>inbound</code> can
|
||||
optionally have <code>floor</code> attribute. This is there for
|
||||
guaranteeing minimal throughput for shaped interfaces. This, however,
|
||||
requires that all traffic goes through one point where QoS decisions can
|
||||
take place. That's why this attribute works only for virtual networks for
|
||||
now (that is <code><interface type='network'/></code> with a
|
||||
forward type of route, nat, or no forward at all). Moreover, the
|
||||
virtual network the interface is connected to is required to have at least
|
||||
inbound QoS set (<code>average</code> at least). Moreover, with
|
||||
<code>floor<code> attribute users don't need to specify
|
||||
<code>average</code>. However, <code>peak</code> and <code>burst</code>
|
||||
attributes still require <code>average</code>. Currently, linux kernel
|
||||
doesn't allow ingress qdiscs to have any classes therefore
|
||||
<code>floor</code> can be applied only on <code>inbound</code> and not
|
||||
</code>outbound</code>. <span class="since">Since 1.0.1</span>
|
||||
</p>
|
||||
|
||||
<h5><a name="elementVlanTag">Setting VLAN tag (on supported network types only)</a></h5>
|
||||
|
||||
<pre>
|
||||
...
|
||||
<devices>
|
||||
<interface type='bridge'>
|
||||
<b><vlan></b>
|
||||
<b><tag id='42'/></b>
|
||||
<b></vlan></b>
|
||||
<source bridge='ovsbr0'/>
|
||||
<virtualport type='openvswitch'>
|
||||
<parameters interfaceid='09b11c53-8b5c-4eeb-8f00-d84eaa0aaa4f'/>
|
||||
</virtualport>
|
||||
</interface>
|
||||
<devices>
|
||||
...</pre>
|
||||
|
||||
<p>
|
||||
If (and only if) the network connection used by the guest
|
||||
supports vlan tagging transparent to the guest, an
|
||||
optional <code><vlan></code> element can specify one or
|
||||
more vlan tags to apply to the guest's network
|
||||
traffic <span class="since">Since 0.10.0</span>. (openvswitch
|
||||
and type='hostdev' SR-IOV interfaces do support transparent vlan
|
||||
tagging of guest traffic; everything else, including standard
|
||||
linux bridges and libvirt's own virtual networks, <b>do not</b>
|
||||
support it. 802.1Qbh (vn-link) and 802.1Qbg (VEPA) switches
|
||||
provide their own way (outside of libvirt) to tag guest traffic
|
||||
onto specific vlans.) To allow for specification of multiple
|
||||
tags (in the case of vlan trunking), a
|
||||
subelement, <code><tag></code>, specifies which vlan tag
|
||||
to use (for example: <code><tag id='42'/></code>. If an
|
||||
interface has more than one <code><vlan></code> element
|
||||
defined, it is assumed that the user wants to do VLAN trunking
|
||||
using all the specified tags. In the case that vlan trunking
|
||||
with a single tag is desired, the optional
|
||||
attribute <code>trunk='yes'</code> can be added to the toplevel
|
||||
vlan element.
|
||||
<span class="since">Since 0.9.4</span>
|
||||
</p>
|
||||
|
||||
<h5><a name="elementLink">Modifying virtual link state</a></h5>
|
||||
@@ -3485,7 +3098,7 @@ qemu-kvm -net nic,model=? /dev/null
|
||||
<devices>
|
||||
<video>
|
||||
<model type='vga' vram='8192' heads='1'>
|
||||
<acceleration accel3d='yes' accel2d='yes'/>
|
||||
<acceleration accel3d='yes' accel3d='yes'/>
|
||||
</model>
|
||||
</video>
|
||||
</devices>
|
||||
@@ -3570,14 +3183,6 @@ qemu-kvm -net nic,model=? /dev/null
|
||||
configured by the <code>source</code> element.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The <code>source</code> element may contain an optional
|
||||
<code>seclabel</code> to override the way that labelling
|
||||
is done on the socket path. If this element is not present,
|
||||
the <a href="#seclabel">security label is inherited from
|
||||
the per-domain setting</a>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Each character device element has an optional
|
||||
sub-element <code><address></code> which can tie the
|
||||
@@ -3871,7 +3476,7 @@ qemu-kvm -net nic,model=? /dev/null
|
||||
<serial type="dev">
|
||||
<source path="/dev/ttyS0"/>
|
||||
<target port="1"/>
|
||||
</serial>
|
||||
</serial>
|
||||
</devices>
|
||||
...</pre>
|
||||
|
||||
@@ -4011,25 +3616,6 @@ qemu-kvm -net nic,model=? /dev/null
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<p>
|
||||
<span class="since">Since 0.9.13</span>, a sound element
|
||||
with <code>ich6</code> model can have optional
|
||||
sub-elements <code><codec></code> to attach various audio
|
||||
codecs to the audio device. If not specified, a default codec
|
||||
will be attached to allow playback and recording. Valid values
|
||||
are 'duplex' (advertise a line-in and a line-out) and 'micro'
|
||||
(advertise a speaker and a microphone).
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
...
|
||||
<devices>
|
||||
<sound model='ich6'>
|
||||
<codec type='micro'/>
|
||||
<sound/>
|
||||
</devices>
|
||||
...</pre>
|
||||
|
||||
<p>
|
||||
Each <code>sound</code> element has an optional
|
||||
sub-element <code><address></code> which can tie the
|
||||
@@ -4190,13 +3776,6 @@ qemu-kvm -net nic,model=? /dev/null
|
||||
since 0.6.2, and 'none' since 0.9.10.</span>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
If more than one security driver is used by libvirt, multiple
|
||||
<code>seclabel</code> tags can be used, one for each driver and
|
||||
the security driver referenced by each tag can be defined using
|
||||
the attribute <code>model</code>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Valid input XML configurations for the top-level security label
|
||||
are:
|
||||
@@ -4252,22 +3831,12 @@ qemu-kvm -net nic,model=? /dev/null
|
||||
<dt><code>label</code></dt>
|
||||
<dd>If static labelling is used, this must specify the full
|
||||
security label to assign to the virtual domain. The format
|
||||
of the content depends on the security driver in use:
|
||||
<ul>
|
||||
<li>SELinux: a SELinux context.</li>
|
||||
<li>AppArmor: an AppArmor profile.</li>
|
||||
<li>
|
||||
DAC: owner and group separated by colon. They can be
|
||||
defined both as user/group names or uid/gid. The driver will first
|
||||
try to parse these values as names, but a leading plus sign can
|
||||
used to force the driver to parse them as uid or gid.
|
||||
</li>
|
||||
</ul>
|
||||
of the content depends on the security driver in use
|
||||
</dd>
|
||||
<dt><code>baselabel</code></dt>
|
||||
<dd>If dynamic labelling is used, this can optionally be
|
||||
used to specify the base security label. The format
|
||||
of the content depends on the security driver in use.
|
||||
of the content depends on the security driver in use
|
||||
</dd>
|
||||
<dt><code>imagelabel</code></dt>
|
||||
<dd>This is an output only element, which shows the
|
||||
|
@@ -15,14 +15,8 @@
|
||||
|
||||
<p>
|
||||
The root element required for all virtual networks is
|
||||
named <code>network</code> and has no configurable attributes
|
||||
(although <span class="since">since 0.10.0</span> there is one
|
||||
optional read-only attribute - when examining the live
|
||||
configuration of a network, the
|
||||
attribute <code>connections</code>, if present, specifies the
|
||||
number of guest interfaces currently connected via this
|
||||
network). The network XML format is
|
||||
available <span class="since">since 0.3.0</span>
|
||||
named <code>network</code> and has no attributes.
|
||||
The network XML format is available <span class="since">since 0.3.0</span>
|
||||
</p>
|
||||
|
||||
<h3><a name="elementsMetadata">General metadata</a></h3>
|
||||
@@ -33,7 +27,7 @@
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
<network ipv6='yes'>
|
||||
<network>
|
||||
<name>default</name>
|
||||
<uuid>3e3fce45-4f53-4fa7-bb32-11f34168b82b</uuid>
|
||||
...</pre>
|
||||
@@ -52,12 +46,6 @@
|
||||
The format must be RFC 4122 compliant, eg <code>3e3fce45-4f53-4fa7-bb32-11f34168b82b</code>.
|
||||
If omitted when defining/creating a new network, a random
|
||||
UUID is generated. <span class="since">Since 0.3.0</span></dd>
|
||||
<dt><code>ipv6='yes'</code></dt>
|
||||
<dd>The new, optional parameter <code>ipv6='yes'</code> enables
|
||||
a network definition with no IPv6 gateway addresses specified
|
||||
to have guest-to-guest communications. For further information,
|
||||
see the example below for the example with no gateway addresses.
|
||||
<span class="since">Since 1.0.1</span></dd>
|
||||
</dl>
|
||||
|
||||
<h3><a name="elementsConnect">Connectivity</a></h3>
|
||||
@@ -159,17 +147,10 @@
|
||||
This network describes either 1) an existing host bridge
|
||||
that was configured outside of libvirt (if
|
||||
a <code><bridge name='xyz'/></code> element has been
|
||||
specified, <span class="since">Since 0.9.4</span>), 2) an
|
||||
existing Open vSwitch bridge that was configured outside of
|
||||
libvirt (if both a <code><bridge name='xyz'/></code>
|
||||
element <b>and</b> a <code><virtualport
|
||||
type='openvswitch'/></code> have been
|
||||
specified <span class="since">Since 0.10.0</span>) 3) an
|
||||
interface or group of interfaces to be used for a "direct"
|
||||
connection via macvtap using macvtap's "bridge" mode (if
|
||||
the forward element has one or
|
||||
more <code><interface></code>
|
||||
subelements, <span class="since">Since 0.9.4</span>)
|
||||
specified), or 2) an interface or group of interfaces to
|
||||
be used for a "direct" connection via macvtap using
|
||||
macvtap's "bridge" mode (if the forward element has one or
|
||||
more <code><interface></code> subelements)
|
||||
(see <a href="formatdomain.html#elementsNICSDirect">Direct
|
||||
attachment to physical interface</a> for descriptions of
|
||||
the various macvtap modes). libvirt doesn't attempt to
|
||||
@@ -229,42 +210,6 @@
|
||||
(usually either a domain start, or a hotplug interface
|
||||
attach to a domain).<span class="since">Since 0.9.4</span>
|
||||
</dd>
|
||||
<dt><code>hostdev</code></dt>
|
||||
<dd>
|
||||
This network facilitates PCI Passthrough of a network
|
||||
device. A network device is chosen from the interface
|
||||
pool and directly assigned to the guest using generic
|
||||
device passthrough, after first optionally setting the
|
||||
device's MAC address and vlan tag to the configured value,
|
||||
and optionally associating the device with an 802.1Qbh
|
||||
capable switch using a <code><virtualport></code>
|
||||
element. Note that - due to limitations in standard
|
||||
single-port PCI ethernet card driver design - only SR-IOV
|
||||
(Single Root I/O Virtualization) virtual function (VF)
|
||||
devices can be assigned in this manner; to assign a
|
||||
standard single-port PCI or PCIe ethernet card to a guest,
|
||||
use the traditional <code>< hostdev></code> device
|
||||
definition. <span class="since"> Since 0.10.0</span>
|
||||
|
||||
<p>Note that this "intelligent passthrough" of network
|
||||
devices is very similar to the functionality of a
|
||||
standard <code>< hostdev></code> device, the
|
||||
difference being that this method allows specifying a MAC
|
||||
address, vlan tag, and <code><virtualport ></code>
|
||||
for the passed-through device. If these capabilities are
|
||||
not required, if you have a standard single-port PCI,
|
||||
PCIe, or USB network card that doesn't support SR-IOV (and
|
||||
hence would anyway lose the configured MAC address during
|
||||
reset after being assigned to the guest domain), or if you
|
||||
are using a version of libvirt older than 0.10.0, you
|
||||
should use a standard
|
||||
<code><hostdev></code> device definition in the
|
||||
domain's configuration to assign the device to the guest
|
||||
instead of defining an <code><interface
|
||||
type='network'></code> pointing to a network
|
||||
with <code><forward mode='hostdev'/></code>.
|
||||
</p>
|
||||
</dd>
|
||||
</dl>
|
||||
As mentioned above, a <code><forward></code> element can
|
||||
have multiple <code><interface></code> subelements, each
|
||||
@@ -281,22 +226,12 @@
|
||||
</forward>
|
||||
...
|
||||
</pre>
|
||||
<p>
|
||||
<span class="since">since 0.10.0</span>,
|
||||
<code><interface></code> also has an optional read-only
|
||||
attribute - when examining the live configuration of a
|
||||
network, the attribute <code>connections</code>, if present,
|
||||
specifies the number of guest interfaces currently connected
|
||||
via this physical interface.
|
||||
</p>
|
||||
<p>
|
||||
Additionally, <span class="since">since 0.9.10</span>, libvirt
|
||||
allows a shorthand for specifying all virtual interfaces
|
||||
associated with a single physical function, by using
|
||||
the <code><pf></code> subelement to call out the
|
||||
corresponding physical interface associated with multiple
|
||||
virtual interfaces:
|
||||
</p>
|
||||
Additionally, <span class="since">since 0.9.10</span>, libvirt
|
||||
allows a shorthand for specifying all virtual interfaces
|
||||
associated with a single physical function, by using
|
||||
the <code><pf></code> subelement to call out the
|
||||
corresponding physical interface associated with multiple
|
||||
virtual interfaces:
|
||||
<pre>
|
||||
...
|
||||
<forward mode='passthrough'>
|
||||
@@ -314,39 +249,6 @@
|
||||
particular, 'passthrough' mode, and 'private' mode when using
|
||||
802.1Qbh), libvirt will choose an unused physical interface
|
||||
or, if it can't find an unused interface, fail the operation.</p>
|
||||
|
||||
<p>
|
||||
<span class="since">since 0.10.0</span> When using forward
|
||||
mode 'hostdev', the interface pool is specified with a list
|
||||
of <code><address></code> elements, each of which has
|
||||
<code>< type></code> (must always be <code>'pci'</code>,
|
||||
<code><domain></code>, <code><bus></code>,
|
||||
<code><slot></code>, and <code><function></code>
|
||||
attributes.
|
||||
</p>
|
||||
<pre>
|
||||
...
|
||||
<forward mode='hostdev' managed='yes'>
|
||||
<address type='pci' domain='0' bus='4' slot='0' function='1'/>
|
||||
<address type='pci' domain='0' bus='4' slot='0' function='2'/>
|
||||
<address type='pci' domain='0' bus='4' slot='0' function='3'/>
|
||||
</forward>
|
||||
...
|
||||
</pre>
|
||||
|
||||
Alternatively the interface pool can also be defined using a
|
||||
single physical function <code><pf></code> subelement to
|
||||
call out the corresponding physical interface associated with
|
||||
multiple virtual interfaces (similar to passthrough mode):
|
||||
|
||||
<pre>
|
||||
...
|
||||
<forward mode='hostdev' managed='yes'>
|
||||
<pf dev='eth0'/>
|
||||
</forward>
|
||||
...
|
||||
</pre>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<h5><a name="elementQoS">Quality of service</a></h5>
|
||||
@@ -381,56 +283,6 @@
|
||||
<span class="since">Since 0.9.4</span>
|
||||
</p>
|
||||
|
||||
<h5><a name="elementVlanTag">Setting VLAN tag (on supported network types only)</a></h5>
|
||||
|
||||
<pre>
|
||||
...
|
||||
<devices>
|
||||
<interface type='bridge'>
|
||||
<b><vlan trunk='yes'></b>
|
||||
<b><tag id='42'/></b>
|
||||
<b><tag id='47'/></b>
|
||||
<b></vlan></b>
|
||||
<source bridge='ovsbr0'/>
|
||||
<virtualport type='openvswitch'>
|
||||
<parameters interfaceid='09b11c53-8b5c-4eeb-8f00-d84eaa0aaa4f'/>
|
||||
</virtualport>
|
||||
</interface>
|
||||
<devices>
|
||||
...</pre>
|
||||
|
||||
<p>
|
||||
If (and only if) the network type supports vlan tagging
|
||||
transparent to the guest, an optional <code><vlan></code>
|
||||
element can specify one or more vlan tags to apply to the
|
||||
traffic of all guests using this
|
||||
network <span class="since">Since 0.10.0</span>. (openvswitch
|
||||
and type='hostdev' SR-IOV networks do support transparent vlan
|
||||
tagging of guest traffic; everything else, including standard
|
||||
linux bridges and libvirt's own virtual networks, <b>do not</b>
|
||||
support it. 802.1Qbh (vn-link) and 802.1Qbg (VEPA) switches
|
||||
provide their own way (outside of libvirt) to tag guest traffic
|
||||
onto specific vlans.) As expected, the <code>tag</code>
|
||||
attribute specifies which vlan tag to use. If a network has more
|
||||
than one <code><vlan></code> element defined, it is
|
||||
assumed that the user wants to do VLAN trunking using all the
|
||||
specified tags. In the case that vlan trunking with a single tag
|
||||
is desired, the optional attribute <code>trunk='yes'</code> can
|
||||
be added to the vlan element.
|
||||
</p>
|
||||
<p>
|
||||
<code><vlan></code> elements can also be specified in
|
||||
a <code><portgroup></code> element, as well as directly in
|
||||
a domain's <code><interface></code> element. In the case
|
||||
that a vlan tag is specified in multiple locations, the setting
|
||||
in <code><interface></code> takes precedence, followed by
|
||||
the setting in the <code><portgroup></code> selected by
|
||||
the interface config. The <code><vlan></code>
|
||||
in <code><network></code> will be selected only if none is
|
||||
given in <code><portgroup></code>
|
||||
or <code><interface></code>.
|
||||
</p>
|
||||
|
||||
<h5><a name="elementsPortgroup">Portgroups</a></h5>
|
||||
|
||||
<pre>
|
||||
@@ -485,15 +337,9 @@
|
||||
default portgroup will be used. If no portgroup is given in the
|
||||
interface definition, and there is no default portgroup, then
|
||||
none will be used. Any <code><bandwidth></code>
|
||||
|
||||
specified directly in the domain XML will take precedence over
|
||||
any setting in the chosen portgroup. if
|
||||
a <code><virtualport></code> is specified in the portgroup
|
||||
(and/or directly in the network definition), the multiple
|
||||
virtualports will be merged, and any parameter that is specified
|
||||
in more than one virtualport, and is not identical, will be
|
||||
considered an error, and will prevent the interface from
|
||||
starting.
|
||||
or <code><virtualport></code> specified directly in the
|
||||
domain XML will take precedence over any setting in the chosen
|
||||
portgroup.
|
||||
</p>
|
||||
|
||||
<h3><a name="elementsAddress">Addressing</a></h3>
|
||||
@@ -583,10 +429,8 @@
|
||||
dotted-decimal format, or an IPv6 address in standard
|
||||
colon-separated hexadecimal format, that will be configured on
|
||||
the bridge
|
||||
device associated with the virtual network. To the guests this IPv4
|
||||
address will be their IPv4 default route. For IPv6, the default route is
|
||||
established via Router Advertisement.
|
||||
For IPv4 addresses, the <code>netmask</code>
|
||||
device associated with the virtual network. To the guests this
|
||||
address will be their default route. For IPv4 addresses, the <code>netmask</code>
|
||||
attribute defines the significant bits of the network address,
|
||||
again specified in dotted-decimal format. For IPv6 addresses,
|
||||
and as an alternate method for IPv4 addresses, you can specify
|
||||
@@ -595,13 +439,10 @@
|
||||
could also be given as <code>prefix='24'</code>. The <code>family</code>
|
||||
attribute is used to specify the type of address - 'ipv4' or 'ipv6'; if no
|
||||
<code>family</code> is given, 'ipv4' is assumed. A network can have more than
|
||||
one of each family of address defined, but only a single IPv4 address can have a
|
||||
<code>dhcp</code> or <code>tftp</code> element. <span class="since">Since 0.3.0 </span>
|
||||
one of each family of address defined, but only a single address can have a
|
||||
<code>dhcp</code> or <code>tftp</code> element. <span class="since">Since 0.3.0;
|
||||
IPv6, multiple addresses on a single network, <code>family</code>, and
|
||||
<code>prefix</code> are support <span class="since">Since 0.8.7</span>.
|
||||
Similar to IPv4, one IPv6 address per network can also have
|
||||
a <code>dhcp</code> definition. <span class="since">Since 1.0.1</span>
|
||||
|
||||
<code>prefix</code> since 0.8.7</span>
|
||||
<dl>
|
||||
<dt><code>tftp</code></dt>
|
||||
<dd>Immediately within
|
||||
@@ -619,44 +460,30 @@
|
||||
optional <code>dhcp</code> element. The presence of this element
|
||||
enables DHCP services on the virtual network. It will further
|
||||
contain one or more <code>range</code> elements. The
|
||||
<code>dhcp</code> element supported for both
|
||||
IPv4 <span class="since">Since 0.3.0</span>
|
||||
and IPv6 <span class="since">Since 1.0.1</span>, but
|
||||
only for one IP address of each type per network.
|
||||
<code>dhcp</code> element is not supported for IPv6, and
|
||||
is only supported on a single IP address per network for IPv4.
|
||||
<span class="since">Since 0.3.0</span>
|
||||
<dl>
|
||||
<dt><code>range</code></dt>
|
||||
<dd>The <code>start</code> and <code>end</code> attributes on the
|
||||
<code>range</code> element specify the boundaries of a pool of
|
||||
addresses to be provided to DHCP clients. These two addresses
|
||||
IPv4 addresses to be provided to DHCP clients. These two addresses
|
||||
must lie within the scope of the network defined on the parent
|
||||
<code>ip</code> element. There may be zero or more
|
||||
<code>range</code> elements specified.
|
||||
<span class="since">Since 0.3.0</span>
|
||||
<code>range</code> can be specified for one IPv4 address,
|
||||
one IPv6 address, or both. <span class="since">Since 1.0.1</span>
|
||||
<code>ip</code> element. <span class="since">Since 0.3.0</span>
|
||||
</dd>
|
||||
<dt><code>host</code></dt>
|
||||
<dd>Within the <code>dhcp</code> element there may be zero or more
|
||||
<code>host</code> elements. These specify hosts which will be given
|
||||
<code>host</code> elements; these specify hosts which will be given
|
||||
names and predefined IP addresses by the built-in DHCP server. Any
|
||||
IPv4 <code>host</code> element must specify the MAC address of the host to be assigned
|
||||
such element must specify the MAC address of the host to be assigned
|
||||
a given name (via the <code>mac</code> attribute), the IP to be
|
||||
assigned to that host (via the <code>ip</code> attribute), and the
|
||||
name to be given that host by the DHCP server (via the
|
||||
<code>name</code> attribute). <span class="since">Since 0.4.5</span>
|
||||
An IPv6 <code>host</code> element differs slightly from that for IPv4:
|
||||
there is no <code>mac</code> attribute since a MAC address has no
|
||||
defined meaning in IPv6. Instead, the <code>name</code> attribute is
|
||||
used to identify the host to be assigned the IPv6 address. For DHCPv6,
|
||||
the name is the plain name of the client host sent by the
|
||||
client to the server. Note that this method of assigning a
|
||||
specific IP address can also be used instead of the <code>mac</code>
|
||||
attribute for IPv4. <span class="since">Since 1.0.1</span>
|
||||
</dd>
|
||||
<dt><code>bootp</code></dt>
|
||||
<dd>The optional <code>bootp</code>
|
||||
element specifies BOOTP options to be provided by the DHCP
|
||||
server for IPv4 only.
|
||||
element specifies BOOTP options to be provided by the DHCP server.
|
||||
Two attributes are supported: <code>file</code> is mandatory and
|
||||
gives the file to be used for the boot image; <code>server</code> is
|
||||
optional and gives the address of the TFTP server from which the boot
|
||||
@@ -699,29 +526,6 @@
|
||||
<ip family="ipv6" address="2001:db8:ca2:2::1" prefix="64" />
|
||||
</network></pre>
|
||||
|
||||
|
||||
<p>
|
||||
Below is a variation of the above example which adds an IPv6
|
||||
dhcp range definition.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
<network>
|
||||
<name>default6</name>
|
||||
<bridge name="virbr0" />
|
||||
<forward mode="nat"/>
|
||||
<ip address="192.168.122.1" netmask="255.255.255.0">
|
||||
<dhcp>
|
||||
<range start="192.168.122.2" end="192.168.122.254" />
|
||||
</dhcp>
|
||||
</ip>
|
||||
<ip family="ipv6" address="2001:db8:ca2:2::1" prefix="64" >
|
||||
<dhcp>
|
||||
<range start="2001:db8:ca2:2:1::10" end="2001:db8:ca2:2:1::ff" />
|
||||
</dhcp>
|
||||
</ip>
|
||||
</network></pre>
|
||||
|
||||
<h3><a name="examplesRoute">Routed network config</a></h3>
|
||||
|
||||
<p>
|
||||
@@ -746,29 +550,6 @@
|
||||
<ip family="ipv6" address="2001:db8:ca2:2::1" prefix="64" />
|
||||
</network></pre>
|
||||
|
||||
<p>
|
||||
Below is another IPv6 varition. Instead of a dhcp range being
|
||||
specified, this example has a couple of IPv6 host definitions.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
<network>
|
||||
<name>local6</name>
|
||||
<bridge name="virbr1" />
|
||||
<forward mode="route" dev="eth1"/>
|
||||
<ip address="192.168.122.1" netmask="255.255.255.0">
|
||||
<dhcp>
|
||||
<range start="192.168.122.2" end="192.168.122.254" />
|
||||
</dhcp>
|
||||
</ip>
|
||||
<ip family="ipv6" address="2001:db8:ca2:2::1" prefix="64" >
|
||||
<dhcp>
|
||||
<host name="paul" ip="2001:db8:ca2:2:3::1" />
|
||||
<host name="bob" ip="2001:db8:ca2:2:3::2" />
|
||||
</dhcp>
|
||||
</ip>
|
||||
</network></pre>
|
||||
|
||||
<h3><a name="examplesPrivate">Isolated network config</a></h3>
|
||||
|
||||
<p>
|
||||
@@ -791,24 +572,6 @@
|
||||
<ip family="ipv6" address="2001:db8:ca2:3::1" prefix="64" />
|
||||
</network></pre>
|
||||
|
||||
<h3><a name="examplesPrivate6">Isolated IPv6 network config</a></h3>
|
||||
|
||||
<p>
|
||||
This variation of an isolated network defines only IPv6.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
<network>
|
||||
<name>sixnet</name>
|
||||
<bridge name="virbr6" />
|
||||
<ip family="ipv6" address="2001:db8:ca2:6::1" prefix="64" >
|
||||
<dhcp>
|
||||
<host name="peter" ip="2001:db8:ca2:6:6::1" />
|
||||
<host name="dariusz" ip="2001:db8:ca2:6:6::2" />
|
||||
</dhcp>
|
||||
</ip>
|
||||
</network></pre>
|
||||
|
||||
<h3><a name="examplesBridge">Using an existing host bridge</a></h3>
|
||||
|
||||
<p>
|
||||
@@ -862,25 +625,5 @@
|
||||
</forward>
|
||||
</network></pre>
|
||||
|
||||
<h3><a name="examplesNoGateway">Network config with no gateway addresses</a></h3>
|
||||
|
||||
<p>
|
||||
A valid network definition can contain no IPv4 or IPv6 addresses. Such a definition
|
||||
can be used for a "very private" or "very isolated" network since it will not be
|
||||
possible to communicate with the virtualization host via this network. However,
|
||||
this virtual network interface can be used for communication between virtual guest
|
||||
systems. This works for IPv4 and <span class="since">(Since 1.0.1)</span> IPv6.
|
||||
However, the new ipv6='yes' must be added for guest-to-guest IPv6
|
||||
communication.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
<network ipv6='yes'>
|
||||
<name>nogw</name>
|
||||
<uuid>7a3b7497-1ec7-8aef-6d5c-38dff9109e93</uuid>
|
||||
<bridge name="virbr2" stp="on" delay="0" />
|
||||
<mac address='00:16:3E:5D:C7:9E'/>
|
||||
</network></pre>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
@@ -143,7 +143,7 @@
|
||||
</dl>
|
||||
</dd>
|
||||
<dt><code>scsi</code></dt>
|
||||
<dd>Describes a SCSI device. Sub-elements include:
|
||||
<dd>Desribes a SCSI device. Sub-elements include:
|
||||
<dl>
|
||||
<dt><code>host</code></dt>
|
||||
<dd>The SCSI host containing the device.</dd>
|
||||
@@ -184,7 +184,7 @@
|
||||
available.</dd>
|
||||
<dt><code>capability</code></dt>
|
||||
<dd>If present, an additional capability is listed via
|
||||
the attribute <code>type</code>. Current capabilities
|
||||
the attribute <code>type</code>. Current capabilites
|
||||
include "hotpluggable" and "removable", with the
|
||||
latter implying the following
|
||||
sub-elements: <code>media_available</code> (0 or
|
||||
|
@@ -371,118 +371,6 @@
|
||||
Further, the notation of $VARIABLE is short-hand for $VARIABLE[@0]. The
|
||||
former notation always assumes the iterator with Id '0'.
|
||||
<p>
|
||||
|
||||
<h3><a name="nwfelemsRulesAdvIPAddrDetection">Automatic IP address detection</a></h3>
|
||||
<p>
|
||||
The detection of IP addresses used on a virtual machine's interface
|
||||
is automatically activated if the variable <code>IP</code> is referenced
|
||||
but no value has been assigned to it.
|
||||
<span class="since">Since 0.9.13</span>
|
||||
the variable <code>CTRL_IP_LEARNING</code> can be used to specify
|
||||
the IP address learning method to use. Valid values are <code>any</code>,
|
||||
<code>dhcp</code>, or <code>none</code>.
|
||||
<br/><br/>
|
||||
The value <code>any</code> means that libvirt may use any packet to
|
||||
determine the address in use by a virtual machine, which is the default
|
||||
behavior if the variable <code>CTRL_IP_LEARNING</code> is not set. This method
|
||||
will only detect a single IP address on an interface.
|
||||
Once a VM's IP address has been detected, its IP network traffic
|
||||
will be locked to that address, if for example IP address spoofing
|
||||
is prevented by one of its filters. In that case the user of the VM
|
||||
will not be able to change the IP address on the interface inside
|
||||
the VM, which would be considered IP address spoofing.
|
||||
When a VM is migrated to another host or resumed after a suspend operation,
|
||||
the first packet sent by the VM will again determine the IP address it can
|
||||
use on a particular interface.
|
||||
<br/><br>
|
||||
A value of <code>dhcp</code> specifies that libvirt should only honor DHCP
|
||||
server-assigned addresses with valid leases. This method supports the detection
|
||||
and usage of multiple IP address per interface.
|
||||
When a VM is resumed after a suspend operation, still valid IP address leases
|
||||
are applied to its filters. Otherwise the VM is expected to again use DHCP to obtain new
|
||||
IP addresses. The migration of a VM to another physical host requires that
|
||||
the VM again runs the DHCP protocol.
|
||||
<br/><br/>
|
||||
Use of <code>CTRL_IP_LEARNING=dhcp</code> (DHCP snooping) provides additional
|
||||
anti-spoofing security, especially when combined with a filter allowing
|
||||
only trusted DHCP servers to assign addresses. To enable this, set the
|
||||
variable <code>DHCPSERVER</code> to the IP address of a valid DHCP server
|
||||
and provide filters that use this variable to filter incoming DHCP responses.
|
||||
<br/><br/>
|
||||
When DHCP snooping is enabled and the DHCP lease expires,
|
||||
the VM will no longer be able to use the IP address until it acquires a
|
||||
new, valid lease from a DHCP server. If the VM is migrated, it must get
|
||||
a new valid DHCP lease to use an IP address (e.g., by
|
||||
bringing the VM interface down and up again).
|
||||
<br/><br/>
|
||||
Note that automatic DHCP detection listens to the DHCP traffic
|
||||
the VM exchanges with the DHCP server of the infrastructure. To avoid
|
||||
denial-of-service attacks on libvirt, the evaluation of those packets
|
||||
is rate-limited, meaning that a VM sending an excessive number of DHCP
|
||||
packets per second on an interface will not have all of those packets
|
||||
evaluated and thus filters may not get adapted. Normal DHCP client
|
||||
behavior is assumed to send a low number of DHCP packets per second.
|
||||
Further, it is important to setup appropriate filters on all VMs in
|
||||
the infrastructure to avoid them being able to send DHCP
|
||||
packets. Therefore VMs must either be prevented from sending UDP and TCP
|
||||
traffic from port 67 to port 68 or the <code>DHCPSERVER</code>
|
||||
variable should be used on all VMs to restrict DHCP server messages to
|
||||
only be allowed to originate from trusted DHCP servers. At the same
|
||||
time anti-spoofing prevention must be enabled on all VMs in the subnet.
|
||||
<br/><br/>
|
||||
If <code>CTRL_IP_LEARNING</code> is set to <code>none</code>, libvirt does not do
|
||||
IP address learning and referencing <code>IP</code> without assigning it an
|
||||
explicit value is an error.
|
||||
<br/><br/>
|
||||
The following XML provides an example for the activation of IP address learning
|
||||
using the DHCP snooping method:
|
||||
</p>
|
||||
<pre>
|
||||
<interface type='bridge'>
|
||||
<source bridge='virbr0'/>
|
||||
<filterref filter='clean-traffic'>
|
||||
<parameter name='CTRL_IP_LEARNING' value='dhcp'/>
|
||||
</filterref>
|
||||
</interface>
|
||||
</pre>
|
||||
|
||||
<h3><a name="nwfelemsReservedVars">Reserved Variables</a></h3>
|
||||
<p>
|
||||
The following table lists reserved variables in use by libvirt.
|
||||
</p>
|
||||
<table class="top_table">
|
||||
<tr>
|
||||
<th> Variable Name </th>
|
||||
<th> Semantics </th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> MAC </td>
|
||||
<td> The MAC address of the interface </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> IP </td>
|
||||
<td> The list of IP addresses in use by an interface </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> IPV6 </td>
|
||||
<td> Not currently implemented:
|
||||
the list of IPV6 addresses in use by an interface </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> DHCPSERVER </td>
|
||||
<td> The list of IP addresses of trusted DHCP servers</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> DHCPSERVERV6 </td>
|
||||
<td> Not currently implemented:
|
||||
The list of IPv6 addresses of trusted DHCP servers</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> CTRL_IP_LEARNING </td>
|
||||
<td> The choice of the IP address detection mode </td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h2><a name="nwfelems">Element and attribute overview</a></h2>
|
||||
|
||||
<p>
|
||||
@@ -605,7 +493,7 @@
|
||||
</ul>
|
||||
<p>
|
||||
The above example indicates that the traffic of type <code>ip</code>
|
||||
will be associated with the chain 'ipv4' and the rule will have
|
||||
will be asscociated with the chain 'ipv4' and the rule will have
|
||||
priority 500. If for example another filter is referenced whose
|
||||
traffic of type <code>ip</code> is also associated with the chain
|
||||
'ipv4' then that filter's rules will be ordered relative to the priority
|
||||
@@ -632,7 +520,7 @@
|
||||
<ul>
|
||||
<li>UINT8 : 8 bit integer; range 0-255</li>
|
||||
<li>UINT16: 16 bit integer; range 0-65535</li>
|
||||
<li>MAC_ADDR: MAC address in dotted decimal format, i.e., 00:11:22:33:44:55</li>
|
||||
<li>MAC_ADDR: MAC adrress in dotted decimal format, i.e., 00:11:22:33:44:55</li>
|
||||
<li>MAC_MASK: MAC address mask in MAC address format, i.e., FF:FF:FF:FC:00:00</li>
|
||||
<li>IP_ADDR: IP address in dotted decimal format, i.e., 10.1.2.3</li>
|
||||
<li>IP_MASK: IP address mask in either dotted decimal format (255.255.248.0) or CIDR mask (0-32)</li>
|
||||
@@ -640,11 +528,6 @@
|
||||
<li>IPV6_MASK: IPv6 mask in numbers format (FFFF:FFFF:FC00::) or CIDR mask (0-128)</li>
|
||||
<li>STRING: A string</li>
|
||||
<li>BOOLEAN: 'true', 'yes', '1' or 'false', 'no', '0'</li>
|
||||
<li>IPSETFLAGS: The source and destination flags of the ipset described
|
||||
by up to 6 'src' or 'dst' elements selecting features from either
|
||||
the source or destination part of the packet header; example:
|
||||
src,src,dst. The number of 'selectors' to provide here depends
|
||||
on the type of ipset that is referenced.</li>
|
||||
</ul>
|
||||
<p>
|
||||
<br/><br/>
|
||||
@@ -810,7 +693,7 @@
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>UINT8</td>
|
||||
<td>Bridge Protocol Data Unit (BPDU) type</td>
|
||||
<td>Bridge Protcol Data Unit (BPDU) type</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>flags</td>
|
||||
@@ -1286,16 +1169,6 @@
|
||||
<td>STRING</td>
|
||||
<td>TCP-only: format of mask/flags with mask and flags each being a comma separated list of SYN,ACK,URG,PSH,FIN,RST or NONE or ALL</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ipset <span class="since">(Since 0.9.13)</span></td>
|
||||
<td>STRING</td>
|
||||
<td>The name of an IPSet managed outside of libvirt</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ipsetflags <span class="since">(Since 0.9.13)</span></td>
|
||||
<td>IPSETFLAGS</td>
|
||||
<td>flags for the IPSet; requires ipset attribute</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p>
|
||||
<br/><br/>
|
||||
@@ -1396,16 +1269,6 @@
|
||||
<td>STRING</td>
|
||||
<td>comma separated list of NEW,ESTABLISHED,RELATED,INVALID or NONE</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ipset <span class="since">(Since 0.9.13)</span></td>
|
||||
<td>STRING</td>
|
||||
<td>The name of an IPSet managed outside of libvirt</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ipsetflags <span class="since">(Since 0.9.13)</span></td>
|
||||
<td>IPSETFLAGS</td>
|
||||
<td>flags for the IPSet; requires ipset attribute</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p>
|
||||
<br/><br/>
|
||||
@@ -1495,16 +1358,6 @@
|
||||
<td>STRING</td>
|
||||
<td>comma separated list of NEW,ESTABLISHED,RELATED,INVALID or NONE</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ipset <span class="since">(Since 0.9.13)</span></td>
|
||||
<td>STRING</td>
|
||||
<td>The name of an IPSet managed outside of libvirt</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ipsetflags <span class="since">(Since 0.9.13)</span></td>
|
||||
<td>IPSETFLAGS</td>
|
||||
<td>flags for the IPSet; requires ipset attribute</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p>
|
||||
<br/><br/>
|
||||
@@ -1606,16 +1459,6 @@
|
||||
<td>STRING</td>
|
||||
<td>TCP-only: format of mask/flags with mask and flags each being a comma separated list of SYN,ACK,URG,PSH,FIN,RST or NONE or ALL</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ipset <span class="since">(Since 0.9.13)</span></td>
|
||||
<td>STRING</td>
|
||||
<td>The name of an IPSet managed outside of libvirt</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ipsetflags <span class="since">(Since 0.9.13)</span></td>
|
||||
<td>IPSETFLAGS</td>
|
||||
<td>flags for the IPSet; requires ipset attribute</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p>
|
||||
<br/><br/>
|
||||
@@ -1702,16 +1545,6 @@
|
||||
<td>STRING</td>
|
||||
<td>comma separated list of NEW,ESTABLISHED,RELATED,INVALID or NONE</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ipset <span class="since">(Since 0.9.13)</span></td>
|
||||
<td>STRING</td>
|
||||
<td>The name of an IPSet managed outside of libvirt</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ipsetflags <span class="since">(Since 0.9.13)</span></td>
|
||||
<td>IPSETFLAGS</td>
|
||||
<td>flags for the IPSet; requires ipset attribute</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p>
|
||||
<br/><br/>
|
||||
@@ -1786,16 +1619,6 @@
|
||||
<td>STRING</td>
|
||||
<td>comma separated list of NEW,ESTABLISHED,RELATED,INVALID or NONE</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ipset <span class="since">(Since 0.9.13)</span></td>
|
||||
<td>STRING</td>
|
||||
<td>The name of an IPSet managed outside of libvirt</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ipsetflags <span class="since">(Since 0.9.13)</span></td>
|
||||
<td>IPSETFLAGS</td>
|
||||
<td>flags for the IPSet; requires ipset attribute</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p>
|
||||
<br/><br/>
|
||||
@@ -1806,7 +1629,6 @@
|
||||
The following sections discuss advanced filter configuration
|
||||
topics.
|
||||
</p>
|
||||
|
||||
<h4><a name="nwfelemsRulesAdvTracking">Connection tracking</a></h4>
|
||||
<p>
|
||||
The network filtering subsystem (on Linux) makes use of the connection
|
||||
@@ -1911,7 +1733,7 @@
|
||||
unresponsive due to its traffic being dropped.
|
||||
Therefore, the limit of connections should be rather high so that
|
||||
fluctuations in new TCP connections don't cause odd
|
||||
traffic behavior in relation to idle connections.
|
||||
traffic behavior in relaton to idle connections.
|
||||
</p>
|
||||
|
||||
<h2><a name="nwfcli">Command line tools</a></h2>
|
||||
@@ -2053,7 +1875,7 @@
|
||||
tree that instantiates iptables or ip6tables rules, a rule to let
|
||||
the UDP packet pass will also be necessary to be provided for those
|
||||
filtering layers. This can be
|
||||
achieved with a rule containing an appropriate <code>udp</code> or
|
||||
achieved with a rule containing an approriate <code>udp</code> or
|
||||
<code>udp-ipv6</code> traffic filtering node.
|
||||
</p>
|
||||
|
||||
@@ -2253,7 +2075,7 @@
|
||||
</pre>
|
||||
<p>
|
||||
Before trying out a filter using the <code>RELATED</code> state,
|
||||
you have to make sure that the appropriate connection tracking module
|
||||
you have to make sure that the approriate connection tracking module
|
||||
has been loaded into the host's kernel. Depending on the version of the
|
||||
kernel, you must run either one of the following two commands before
|
||||
the ftp connection with the VM is established.
|
||||
@@ -2339,6 +2161,36 @@
|
||||
filtering subsystem.
|
||||
</p>
|
||||
|
||||
<h3><a name="nwflimitsIP">IP Address Detection</a></h3>
|
||||
<p>
|
||||
In case a network filter references the variable
|
||||
<i>IP</i> and no variable was defined in any higher layer
|
||||
references to the filter, IP address detection will automatically
|
||||
be started when the filter is to be instantiated (VM start, interface
|
||||
hotplug event). Only IPv4
|
||||
addresses can be detected and only a single IP address
|
||||
legitimately in use by a VM on a single interface will be detected.
|
||||
In case a VM was to use multiple IP address on a single interface
|
||||
(IP aliasing),
|
||||
the IP addresses would have to be provided explicitly either
|
||||
in the network filter itself or as variables used in attributes'
|
||||
values. These
|
||||
variables must then be defined in a higher level reference to the filter
|
||||
and each assigned the value of the IP address that the VM is expected
|
||||
to be using.
|
||||
Different IP addresses in use by multiple interfaces of a VM
|
||||
(one IP address each) will be independently detected.
|
||||
<br/><br/>
|
||||
Once a VM's IP address has been detected, its IP network traffic
|
||||
may be locked to that address, if for example IP address spoofing
|
||||
is prevented by one of its filters. In that case the user of the VM
|
||||
will not be able to change the IP address on the interface inside
|
||||
the VM, which would be considered IP address spoofing.
|
||||
<br/><br/>
|
||||
In case a VM is resumed after suspension or migrated, IP address
|
||||
detection will be restarted.
|
||||
</p>
|
||||
|
||||
<h3><a name="nwflimitsmigr">VM Migration</a></h3>
|
||||
<p>
|
||||
VM migration is only supported if the whole filter tree
|
||||
|
@@ -24,7 +24,7 @@
|
||||
since the snapshot in a single file) and external (the
|
||||
snapshot is one file, and the changes since the snapshot are
|
||||
in another file).</dd>
|
||||
<dt>memory state (or VM state)</dt>
|
||||
<dt>VM state</dt>
|
||||
<dd>Tracks only the state of RAM and all other resources in use
|
||||
by the VM. If the disks are unmodified between the time a VM
|
||||
state snapshot is taken and restored, then the guest will
|
||||
@@ -33,7 +33,7 @@
|
||||
corruption.</dd>
|
||||
<dt>system checkpoint</dt>
|
||||
<dd>A combination of disk snapshots for all disks as well as VM
|
||||
memory state, which can be used to resume the guest from where it
|
||||
state, which can be used to resume the guest from where it
|
||||
left off with symptoms similar to hibernation (that is, TCP
|
||||
connections in the guest may have timed out, but no files or
|
||||
processes are lost).</dd>
|
||||
@@ -41,7 +41,7 @@
|
||||
|
||||
<p>
|
||||
Libvirt can manage all three types of snapshots. For now, VM
|
||||
state (memory) snapshots are created only by
|
||||
state snapshots are created only by
|
||||
the <code>virDomainSave()</code>, <code>virDomainSaveFlags</code>,
|
||||
and <code>virDomainManagedSave()</code> functions, and restored
|
||||
via the <code>virDomainRestore()</code>,
|
||||
@@ -106,17 +106,6 @@
|
||||
description is omitted when initially creating the snapshot,
|
||||
then this field will be empty.
|
||||
</dd>
|
||||
<dt><code>memory</code></dt>
|
||||
<dd>On input, this is an optional request for how to handle VM
|
||||
memory state. For an offline domain or a disk-only snapshot,
|
||||
attribute <code>snapshot</code> must be <code>no</code>, since
|
||||
there is no VM state saved; otherwise, the attribute can
|
||||
be <code>internal</code> if the memory state is piggy-backed with
|
||||
other internal disk state, or <code>external</code> along with
|
||||
a second attribute <code>file</code> giving the absolute path
|
||||
of the file holding the VM memory state. <span class="since">Since
|
||||
1.0.1</span>
|
||||
</dd>
|
||||
<dt><code>disks</code></dt>
|
||||
<dd>On input, this is an optional listing of specific
|
||||
instructions for disk snapshots; it is needed when making a
|
||||
@@ -183,7 +172,7 @@
|
||||
to <code>virDomainRevertToSnapshot()</code>. Additionally,
|
||||
this field can be the value "disk-snapshot"
|
||||
(<span class="since">since 0.9.5</span>) when it represents
|
||||
only a disk snapshot (no VM memory state), and reverting to this
|
||||
only a disk snapshot (no VM state), and reverting to this
|
||||
snapshot will default to an inactive guest. Readonly.
|
||||
</dd>
|
||||
<dt><code>parent</code></dt>
|
||||
@@ -233,7 +222,6 @@
|
||||
<parent>
|
||||
<name>bare-os-install</name>
|
||||
</parent>
|
||||
<memory snapshot='no'/>
|
||||
<disks>
|
||||
<disk name='vda' snapshot='external'>
|
||||
<driver type='qcow2'/>
|
||||
|
@@ -141,11 +141,6 @@
|
||||
<mode>0744</mode>
|
||||
<label>virt_image_t</label>
|
||||
</permissions>
|
||||
<timestamps>
|
||||
<atime>1341933637.273190990</atime>
|
||||
<mtime>1341930622.047245868</mtime>
|
||||
<ctime>1341930622.047245868</ctime>
|
||||
</timestamps>
|
||||
<encryption type='...'>
|
||||
...
|
||||
</encryption>
|
||||
@@ -177,19 +172,6 @@
|
||||
contains the MAC (eg SELinux) label string.
|
||||
<span class="since">Since 0.4.1</span>
|
||||
</dd>
|
||||
<dt><code>timestamps</code></dt>
|
||||
<dd>Provides timing information about the volume. Up to four
|
||||
sub-elements are present,
|
||||
where <code>atime</code>, <code>btime</code>, <code>ctime</code>
|
||||
and <code>mtime</code> hold the access, birth, change and
|
||||
modification time of the volume, where known. The used time
|
||||
format is <seconds>.<nanoseconds> since the
|
||||
beginning of the epoch (1 Jan 1970). If nanosecond resolution
|
||||
is 0 or otherwise unsupported by the host OS or filesystem,
|
||||
then the nanoseconds part is omitted. This is a readonly
|
||||
attribute and is ignored when creating a volume.
|
||||
<span class="since">Since 0.10.0</span>
|
||||
</dd>
|
||||
<dt><code>encryption</code></dt>
|
||||
<dd>If present, specifies how the volume is encrypted. See
|
||||
the <a href="formatstorageencryption.html">Storage Encryption</a> page
|
||||
|
@@ -18,67 +18,18 @@
|
||||
or:
|
||||
</p>
|
||||
<pre>
|
||||
git diff > libvirt-myfeature.patch
|
||||
git diff > libvirt-myfeature.patch
|
||||
</pre>
|
||||
<p>However, the usual workflow of libvirt developer is:</p>
|
||||
<pre>
|
||||
git checkout master
|
||||
git pull
|
||||
git checkout -t origin -b workbranch
|
||||
Hack, committing any changes along the way
|
||||
</pre>
|
||||
<p>Then, when you want to post your patches:</p>
|
||||
<pre>
|
||||
git pull --rebase
|
||||
(fix any conflicts)
|
||||
git send-email --cover-letter --no-chain-reply-to --annotate \
|
||||
--to=libvir-list@redhat.com master
|
||||
</pre>
|
||||
<p>(Note that the "git send-email" subcommand may not be in
|
||||
the main git package and using it may require installion of a
|
||||
separate package, for example the "git-email" package in
|
||||
Fedora.) For a single patch you can omit
|
||||
<code>--cover-letter</code>, but a series of two or more
|
||||
patches needs a cover letter. If you get tired of typing
|
||||
<code>--to=libvir-list@redhat.com</code> designation you can
|
||||
set it in git config:</p>
|
||||
<pre>
|
||||
git config sendemail.to libvir-list@redhat.com
|
||||
</pre>
|
||||
<p>Please follow this as close as you can, especially the rebase and
|
||||
git send-email part, as it makes life easier for other developers to
|
||||
review your patch set. One should avoid sending patches as attachments,
|
||||
but rather send them in email body along with commit message. If a
|
||||
developer is sending another version of the patch (e.g. to address
|
||||
review comments), he is advised to note differences to previous
|
||||
versions after the <code>---</code> line in the patch so that it helps
|
||||
reviewers but doesn't become part of git history. Moreover, such patch
|
||||
needs to be prefixed correctly with
|
||||
<code>--subject-prefix=PATCHv2</code> appended to <code>git
|
||||
send-email</code> (substitute <code>v2</code> with the correct
|
||||
version if needed though).</p>
|
||||
</li>
|
||||
|
||||
<li><p>Split large changes into a series of smaller patches,
|
||||
self-contained if possible, with an explanation of each patch
|
||||
and an explanation of how the sequence of patches fits
|
||||
together. Moreover, please keep in mind that it's required to
|
||||
be able to compile cleanly (<b>including</b> <code>make
|
||||
check</code> and <code>make syntax-check</code>) after each
|
||||
patch. A feature does not have to work until the end of a
|
||||
series, but intermediate patches must compile and not cause
|
||||
test-suite failures (this is to preserve the usefulness
|
||||
of <code>git bisect</code>, among other things).</p>
|
||||
</li>
|
||||
|
||||
<li>Split large changes into a series of smaller patches, self-contained
|
||||
if possible, with an explanation of each patch and an explanation of how
|
||||
the sequence of patches fits together.</li>
|
||||
<li>Make sure your patches apply against libvirt GIT. Developers
|
||||
only follow GIT and don't care much about released versions.</li>
|
||||
<li><p>Run the automated tests on your code before submitting any changes.
|
||||
In particular, configure with compile warnings set to
|
||||
-Werror. This is done automatically for a git checkout; from a
|
||||
tarball, use:</p>
|
||||
In particular, configure with compile warnings set to -Werror:</p>
|
||||
<pre>
|
||||
./configure --enable-werror
|
||||
./configure --enable-compile-warnings=error
|
||||
</pre>
|
||||
<p>
|
||||
and run the tests:
|
||||
@@ -212,55 +163,6 @@
|
||||
</p>
|
||||
|
||||
|
||||
<h2><a name="bracket_spacing">Bracket spacing</a></h2>
|
||||
|
||||
<p>
|
||||
The keywords <code>if</code>, <code>for</code>, <code>while</code>,
|
||||
and <code>switch</code> must have a single space following them
|
||||
before the opening bracket. eg
|
||||
</p>
|
||||
<pre>
|
||||
if(foo) // Bad
|
||||
if (foo) // Good
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Function implementations must <strong>not</strong> have any whitespace
|
||||
between the function name and the opening bracket. eg
|
||||
</p>
|
||||
<pre>
|
||||
int foo (int wizz) // Bad
|
||||
int foo(int wizz) // Good
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Function calls must <strong>not</strong> have any whitespace
|
||||
between the function name and the opening bracket. eg
|
||||
</p>
|
||||
<pre>
|
||||
bar = foo (wizz); // Bad
|
||||
bar = foo(wizz); // Good
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Function typedefs must <strong>not</strong> have any whitespace
|
||||
between the closing bracket of the function name and opening
|
||||
bracket of the arg list. eg
|
||||
</p>
|
||||
<pre>
|
||||
typedef int (*foo) (int wizz); // Bad
|
||||
typedef int (*foo)(int wizz); // Good
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
There must not be any whitespace immediately following any
|
||||
opening bracket, or immediately prior to any closing bracket
|
||||
</p>
|
||||
<pre>
|
||||
int foo( int wizz ); // Bad
|
||||
int foo(int wizz); // Good
|
||||
</pre>
|
||||
|
||||
<h2><a name="curly_braces">Curly braces</a></h2>
|
||||
|
||||
<p>
|
||||
@@ -403,6 +305,13 @@
|
||||
|
||||
<h2><a name="preprocessor">Preprocessor</a></h2>
|
||||
|
||||
<p>Macros defined with an ALL_CAPS name should generally be
|
||||
assumed to be unsafe with regards to arguments with side-effects
|
||||
(that is, MAX(a++, b--) might increment a or decrement b too
|
||||
many or too few times). Exceptions to this rule are explicitly
|
||||
documented for macros in viralloc.h and virstring.h.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
For variadic macros, stick with C99 syntax:
|
||||
</p>
|
||||
@@ -419,7 +328,7 @@
|
||||
#endif
|
||||
</pre>
|
||||
|
||||
<h2><a name="types">C types</a></h2>
|
||||
<h2><a href="types">C types</a></h2>
|
||||
|
||||
<p>
|
||||
Use the right type.
|
||||
@@ -603,8 +512,8 @@
|
||||
<p>
|
||||
Usage of the <code>fdopen()</code>, <code>close()</code>, <code>fclose()</code>
|
||||
APIs is deprecated in libvirt code base to help avoiding double-closing of files
|
||||
or file descriptors, which is particularly dangerous in a multi-threaded
|
||||
application. Instead of these APIs, use the macros from virfile.h
|
||||
or file descriptors, which is particulary dangerous in a multi-threaded
|
||||
applications. Instead of these APIs, use the macros from virfile.h
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
@@ -739,6 +648,21 @@
|
||||
virStrncpy(dest, src, strlen(src), sizeof(dest)).
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
VIR_STRDUP(char *dst, const char *src);
|
||||
VIR_STRNDUP(char *dst, const char *src, size_t n);
|
||||
</pre>
|
||||
<p>
|
||||
You should avoid using strdup or strndup directly as they do not report
|
||||
out-of-memory error, and do not allow a NULL source. Use
|
||||
VIR_STRDUP or VIR_STRNDUP macros instead, which return 0 for
|
||||
NULL source, 1 for successful copy, and -1 for allocation
|
||||
failure with the error already reported. In very
|
||||
specific cases, when you don't want to report the out-of-memory error, you
|
||||
can use VIR_STRDUP_QUIET or VIR_STRNDUP_QUIET, but such usage is very rare
|
||||
and usually considered a flaw.
|
||||
</p>
|
||||
|
||||
<h2><a name="strbuf">Variable length string buffer</a></h2>
|
||||
|
||||
<p>
|
||||
|
@@ -18,8 +18,7 @@
|
||||
|
||||
<xsl:template match="/">
|
||||
<xsl:text>-*- buffer-read-only: t -*- vi: set ro:
|
||||
DO NOT EDIT THIS FILE! IT IS GENERATED AUTOMATICALLY
|
||||
from docs/hacking.html.in!
|
||||
DO NOT EDIT THIS FILE! IT IS GENERATED AUTOMATICALLY!
|
||||
|
||||
|
||||
|
||||
|
@@ -101,7 +101,7 @@
|
||||
<h5><a name="qemu">/etc/libvirt/hooks/qemu</a></h5>
|
||||
<ul>
|
||||
<li>Before a QEMU guest is started, the qemu hook script is
|
||||
called in three locations; if any location fails, the guest
|
||||
called in two locations; if either location fails, the guest
|
||||
is not started. The first location, <span class="since">since
|
||||
0.9.0</span>, is before libvirt performs any resource
|
||||
labeling, and the hook can allocate resources not managed by
|
||||
@@ -110,11 +110,7 @@
|
||||
The second location, available <span class="since">Since
|
||||
0.8.0</span>, occurs after libvirt has finished labeling
|
||||
all resources, but has not yet started the guest, called as:<br/>
|
||||
<pre>/etc/libvirt/hooks/qemu guest_name start begin -</pre>
|
||||
The third location, <span class="since">0.9.13</span>,
|
||||
occurs after the QEMU process has successfully started up:<br/>
|
||||
<pre>/etc/libvirt/hooks/qemu guest_name started begin -</pre>
|
||||
</li>
|
||||
<pre>/etc/libvirt/hooks/qemu guest_name start begin -</pre></li>
|
||||
<li>When a QEMU guest is stopped, the qemu hook script is called
|
||||
in two locations, to match the startup.
|
||||
First, <span class="since">since 0.8.0</span>, the hook is
|
||||
@@ -134,51 +130,15 @@
|
||||
script returns failure or the output XML is not valid, incoming
|
||||
migration will be canceled. This hook may be used, e.g., to change
|
||||
location of disk images for incoming domains.</li>
|
||||
<li><span class="since">Since 0.9.13</span>, the qemu hook script
|
||||
is also called when the libvirtd daemon restarts and reconnects
|
||||
to previously running QEMU processes. If the script fails, the
|
||||
existing QEMU process will be killed off. It is called as:
|
||||
<pre>/etc/libvirt/hooks/qemu guest_name reconnect begin -</pre>
|
||||
</li>
|
||||
<li><span class="since">Since 0.9.13</span>, the qemu hook script
|
||||
is also called when the QEMU driver is told to attach to an
|
||||
externally launched QEMU process. It is called as:
|
||||
<pre>/etc/libvirt/hooks/qemu guest_name attach begin -</pre>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h5><a name="lxc">/etc/libvirt/hooks/lxc</a></h5>
|
||||
<ul>
|
||||
<li>Before a LXC guest is started, the lxc hook script is
|
||||
called in three locations; if any location fails, the guest
|
||||
is not started. The first location, <span class="since">since
|
||||
0.9.13</span>, is before libvirt performs any resource
|
||||
labeling, and the hook can allocate resources not managed by
|
||||
libvirt such as DRBD or missing bridges. This is called as:<br/>
|
||||
<pre>/etc/libvirt/hooks/lxc guest_name prepare begin -</pre>
|
||||
The second location, available <span class="since">Since
|
||||
0.8.0</span>, occurs after libvirt has finished labeling
|
||||
all resources, but has not yet started the guest, called as:<br/>
|
||||
<pre>/etc/libvirt/hooks/lxc guest_name start begin -</pre>
|
||||
The third location, <span class="since">0.9.13</span>,
|
||||
occurs after the LXC process has successfully started up:<br/>
|
||||
<pre>/etc/libvirt/hooks/lxc guest_name started begin -</pre>
|
||||
</li>
|
||||
<li>When an LXC guest is started, the lxc hook script is called as:<br/>
|
||||
<pre>/etc/libvirt/hooks/lxc guest_name start begin -</pre></li>
|
||||
<li>When a LXC guest is stopped, the lxc hook script is called
|
||||
in two locations, to match the startup.
|
||||
First, <span class="since">since 0.8.0</span>, the hook is
|
||||
called before libvirt restores any labels:<br/>
|
||||
<pre>/etc/libvirt/hooks/lxc guest_name stopped end -</pre>
|
||||
Then, after libvirt has released all resources, the hook is
|
||||
called again, <span class="since">since 0.9.0</span>, to allow
|
||||
any additional resource cleanup:<br/>
|
||||
<pre>/etc/libvirt/hooks/lxc guest_name release end -</pre></li>
|
||||
<li><span class="since">Since 0.9.13</span>, the lxc hook script
|
||||
is also called when the libvirtd daemon restarts and reconnects
|
||||
to previously running LXC processes. If the script fails, the
|
||||
existing LXC process will be killed off. It is called as:
|
||||
<pre>/etc/libvirt/hooks/lxc guest_name reconnect begin -</pre>
|
||||
</li>
|
||||
as:<br/>
|
||||
<pre>/etc/libvirt/hooks/lxc guest_name stopped end -</pre></li>
|
||||
</ul>
|
||||
<br/>
|
||||
|
||||
|
@@ -27,9 +27,9 @@ my %groupheaders = (
|
||||
my @srcs;
|
||||
find({
|
||||
wanted => sub {
|
||||
if (m!$srcdir/.*/\w+_(driver|tmpl|monitor|hal|udev)\.c$!) {
|
||||
push @srcs, $_ if $_ !~ /vbox_driver\.c/;
|
||||
}
|
||||
if (m!$srcdir/.*/\w+_(driver|tmpl|monitor|hal|udev)\.c$!) {
|
||||
push @srcs, $_ if $_ !~ /vbox_driver\.c/;
|
||||
}
|
||||
}, no_chdir => 1}, $srcdir);
|
||||
my $line;
|
||||
|
||||
@@ -47,26 +47,26 @@ while (defined($line = <FILE>)) {
|
||||
next if $line =~ /^\s*$/;
|
||||
next if $line =~ /^\s*(global|local):/;
|
||||
if ($line =~ /^\s*LIBVIRT_(\d+\.\d+\.\d+)\s*{\s*$/) {
|
||||
if (defined $vers) {
|
||||
die "malformed syms file";
|
||||
}
|
||||
$vers = $1;
|
||||
if (defined $vers) {
|
||||
die "malformed syms file";
|
||||
}
|
||||
$vers = $1;
|
||||
} elsif ($line =~ /\s*}\s*;\s*$/) {
|
||||
if (defined $prevvers) {
|
||||
die "malformed syms file";
|
||||
}
|
||||
$prevvers = $vers;
|
||||
$vers = undef;
|
||||
if (defined $prevvers) {
|
||||
die "malformed syms file";
|
||||
}
|
||||
$prevvers = $vers;
|
||||
$vers = undef;
|
||||
} elsif ($line =~ /\s*}\s*LIBVIRT_(\d+\.\d+\.\d+)\s*;\s*$/) {
|
||||
if ($1 ne $prevvers) {
|
||||
die "malformed syms file $1 != $vers";
|
||||
}
|
||||
$prevvers = $vers;
|
||||
$vers = undef;
|
||||
if ($1 ne $prevvers) {
|
||||
die "malformed syms file $1 != $vers";
|
||||
}
|
||||
$prevvers = $vers;
|
||||
$vers = undef;
|
||||
} elsif ($line =~ /\s*(\w+)\s*;\s*$/) {
|
||||
$apis{$1} = $vers;
|
||||
$apis{$1} = $vers;
|
||||
} else {
|
||||
die "unexpected data $line\n";
|
||||
die "unexpected data $line\n";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,26 +86,26 @@ while (defined($line = <FILE>)) {
|
||||
next if $line =~ /^\s*$/;
|
||||
next if $line =~ /^\s*(global|local):/;
|
||||
if ($line =~ /^\s*LIBVIRT_QEMU_(\d+\.\d+\.\d+)\s*{\s*$/) {
|
||||
if (defined $vers) {
|
||||
die "malformed syms file";
|
||||
}
|
||||
$vers = $1;
|
||||
if (defined $vers) {
|
||||
die "malformed syms file";
|
||||
}
|
||||
$vers = $1;
|
||||
} elsif ($line =~ /\s*}\s*;\s*$/) {
|
||||
if (defined $prevvers) {
|
||||
die "malformed syms file";
|
||||
}
|
||||
$prevvers = $vers;
|
||||
$vers = undef;
|
||||
if (defined $prevvers) {
|
||||
die "malformed syms file";
|
||||
}
|
||||
$prevvers = $vers;
|
||||
$vers = undef;
|
||||
} elsif ($line =~ /\s*}\s*LIBVIRT_QEMU_(\d+\.\d+\.\d+)\s*;\s*$/) {
|
||||
if ($1 ne $prevvers) {
|
||||
die "malformed syms file $1 != $vers";
|
||||
}
|
||||
$prevvers = $vers;
|
||||
$vers = undef;
|
||||
if ($1 ne $prevvers) {
|
||||
die "malformed syms file $1 != $vers";
|
||||
}
|
||||
$prevvers = $vers;
|
||||
$vers = undef;
|
||||
} elsif ($line =~ /\s*(\w+)\s*;\s*$/) {
|
||||
$apis{$1} = $vers;
|
||||
$apis{$1} = $vers;
|
||||
} else {
|
||||
die "unexpected data $line\n";
|
||||
die "unexpected data $line\n";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,31 +143,31 @@ my %groups;
|
||||
my $ingrp;
|
||||
while (defined($line = <FILE>)) {
|
||||
if ($line =~ /struct _(vir\w*(?:Driver|Monitor))/) {
|
||||
my $grp = $1;
|
||||
if ($grp ne "virStateDriver" &&
|
||||
$grp ne "virStreamDriver") {
|
||||
$ingrp = $grp;
|
||||
$groups{$ingrp} = { apis => {}, drivers => {} };
|
||||
}
|
||||
my $grp = $1;
|
||||
if ($grp ne "virStateDriver" &&
|
||||
$grp ne "virStreamDriver") {
|
||||
$ingrp = $grp;
|
||||
$groups{$ingrp} = { apis => {}, drivers => {} };
|
||||
}
|
||||
} elsif ($ingrp) {
|
||||
if ($line =~ /^\s*vir(?:Drv|DevMon)(\w+)\s+(\w+);\s*$/) {
|
||||
my $field = $2;
|
||||
my $name = $1;
|
||||
if ($line =~ /^\s*vir(?:Drv|DevMon)(\w+)\s+(\w+);\s*$/) {
|
||||
my $field = $2;
|
||||
my $name = $1;
|
||||
|
||||
my $api;
|
||||
if (exists $apis{"vir$name"}) {
|
||||
$api = "vir$name";
|
||||
} elsif (exists $apis{"virConnect$name"}) {
|
||||
$api = "virConnect$name";
|
||||
} elsif (exists $apis{"virNode$name"}) {
|
||||
$api = "virNode$name";
|
||||
} else {
|
||||
die "driver $name does not have a public API";
|
||||
}
|
||||
$groups{$ingrp}->{apis}->{$field} = $api;
|
||||
} elsif ($line =~ /};/) {
|
||||
$ingrp = undef;
|
||||
}
|
||||
my $api;
|
||||
if (exists $apis{"vir$name"}) {
|
||||
$api = "vir$name";
|
||||
} elsif (exists $apis{"virConnect$name"}) {
|
||||
$api = "virConnect$name";
|
||||
} elsif (exists $apis{"virNode$name"}) {
|
||||
$api = "virNode$name";
|
||||
} else {
|
||||
die "driver $name does not have a public API";
|
||||
}
|
||||
$groups{$ingrp}->{apis}->{$field} = $api;
|
||||
} elsif ($line =~ /};/) {
|
||||
$ingrp = undef;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -179,60 +179,60 @@ close FILE;
|
||||
|
||||
foreach my $src (@srcs) {
|
||||
open FILE, "<$src" or
|
||||
die "cannot read $src: $!";
|
||||
die "cannot read $src: $!";
|
||||
|
||||
$ingrp = undef;
|
||||
my $impl;
|
||||
while (defined($line = <FILE>)) {
|
||||
if (!$ingrp) {
|
||||
foreach my $grp (keys %groups) {
|
||||
if ($line =~ /^\s*(?:static\s+)?$grp\s+(\w+)\s*=\s*{/ ||
|
||||
$line =~ /^\s*(?:static\s+)?$grp\s+NAME\(\w+\)\s*=\s*{/) {
|
||||
$ingrp = $grp;
|
||||
$impl = $src;
|
||||
if (!$ingrp) {
|
||||
foreach my $grp (keys %groups) {
|
||||
if ($line =~ /^\s*(?:static\s+)?$grp\s+(\w+)\s*=\s*{/ ||
|
||||
$line =~ /^\s*(?:static\s+)?$grp\s+NAME\(\w+\)\s*=\s*{/) {
|
||||
$ingrp = $grp;
|
||||
$impl = $src;
|
||||
|
||||
if ($impl =~ m,.*/node_device_(\w+)\.c,) {
|
||||
$impl = $1;
|
||||
} else {
|
||||
$impl =~ s,.*/(\w+?)_((\w+)_)?(\w+)\.c,$1,;
|
||||
}
|
||||
if ($impl =~ m,.*/node_device_(\w+)\.c,) {
|
||||
$impl = $1;
|
||||
} else {
|
||||
$impl =~ s,.*/(\w+?)_((\w+)_)?(\w+)\.c,$1,;
|
||||
}
|
||||
|
||||
if ($groups{$ingrp}->{drivers}->{$impl}) {
|
||||
die "Group $ingrp already contains $impl";
|
||||
}
|
||||
if ($groups{$ingrp}->{drivers}->{$impl}) {
|
||||
die "Group $ingrp already contains $impl";
|
||||
}
|
||||
|
||||
$groups{$ingrp}->{drivers}->{$impl} = {};
|
||||
}
|
||||
}
|
||||
$groups{$ingrp}->{drivers}->{$impl} = {};
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
if ($line =~ m!\s*\.(\w+)\s*=\s*(\w+)\s*,?\s*(?:/\*\s*(\d+\.\d+\.\d+)\s*\*/\s*)?$!) {
|
||||
my $api = $1;
|
||||
my $meth = $2;
|
||||
my $vers = $3;
|
||||
} else {
|
||||
if ($line =~ m!\s*\.(\w+)\s*=\s*(\w+)\s*,?\s*(?:/\*\s*(\d+\.\d+\.\d+)\s*\*/\s*)?$!) {
|
||||
my $api = $1;
|
||||
my $meth = $2;
|
||||
my $vers = $3;
|
||||
|
||||
next if $api eq "no" || $api eq "name";
|
||||
next if $api eq "no" || $api eq "name";
|
||||
|
||||
die "Method $meth in $src is missing version" unless defined $vers;
|
||||
die "Method $meth in $src is missing version" unless defined $vers;
|
||||
|
||||
die "Driver method for $api is NULL in $src" if $meth eq "NULL";
|
||||
die "Driver method for $api is NULL in $src" if $meth eq "NULL";
|
||||
|
||||
if (!exists($groups{$ingrp}->{apis}->{$api})) {
|
||||
die "Found unexpected method $api in $ingrp\n";
|
||||
}
|
||||
if (!exists($groups{$ingrp}->{apis}->{$api})) {
|
||||
die "Found unexpected method $api in $ingrp\n";
|
||||
}
|
||||
|
||||
$groups{$ingrp}->{drivers}->{$impl}->{$api} = $vers;
|
||||
if ($api eq "domainMigratePrepare" ||
|
||||
$api eq "domainMigratePrepare2" ||
|
||||
$api eq "domainMigratePrepare3") {
|
||||
$groups{$ingrp}->{drivers}->{$impl}->{"domainMigrate"} = $vers
|
||||
unless $groups{$ingrp}->{drivers}->{$impl}->{"domainMigrate"};
|
||||
}
|
||||
$groups{$ingrp}->{drivers}->{$impl}->{$api} = $vers;
|
||||
if ($api eq "domainMigratePrepare" ||
|
||||
$api eq "domainMigratePrepare2" ||
|
||||
$api eq "domainMigratePrepare3") {
|
||||
$groups{$ingrp}->{drivers}->{$impl}->{"domainMigrate"} = $vers
|
||||
unless $groups{$ingrp}->{drivers}->{$impl}->{"domainMigrate"};
|
||||
}
|
||||
|
||||
} elsif ($line =~ /}/) {
|
||||
$ingrp = undef;
|
||||
}
|
||||
}
|
||||
} elsif ($line =~ /}/) {
|
||||
$ingrp = undef;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
close FILE;
|
||||
@@ -253,21 +253,21 @@ foreach my $drv (keys %{$groups{"virDriver"}->{drivers}}) {
|
||||
my $openVersStr = $groups{"virDriver"}->{drivers}->{$drv}->{"open"};
|
||||
my $openVers;
|
||||
if ($openVersStr =~ /(\d+)\.(\d+)\.(\d+)/) {
|
||||
$openVers = ($1 * 1000 * 1000) + ($2 * 1000) + $3;
|
||||
$openVers = ($1 * 1000 * 1000) + ($2 * 1000) + $3;
|
||||
}
|
||||
|
||||
# virConnectOpenReadOnly always matches virConnectOpen version
|
||||
$groups{"virDriver"}->{drivers}->{$drv}->{"openReadOnly"} =
|
||||
$groups{"virDriver"}->{drivers}->{$drv}->{"open"};
|
||||
$groups{"virDriver"}->{drivers}->{$drv}->{"open"};
|
||||
|
||||
# virConnectOpenAuth is always 0.4.0 if the driver existed
|
||||
# before this time, otherwise it matches the version of
|
||||
# the driver's virConnectOpen entry
|
||||
if ($openVersStr eq "Y" ||
|
||||
$openVers >= $openAuthVers) {
|
||||
$groups{"virDriver"}->{drivers}->{$drv}->{"openAuth"} = $openVersStr;
|
||||
$openVers >= $openAuthVers) {
|
||||
$groups{"virDriver"}->{drivers}->{$drv}->{"openAuth"} = $openVersStr;
|
||||
} else {
|
||||
$groups{"virDriver"}->{drivers}->{$drv}->{"openAuth"} = "0.4.0";
|
||||
$groups{"virDriver"}->{drivers}->{$drv}->{"openAuth"} = "0.4.0";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -283,17 +283,17 @@ foreach my $drv (keys %{$groups{"virDriver"}->{drivers}}) {
|
||||
next unless defined $createVersStr;
|
||||
my $createVers;
|
||||
if ($createVersStr =~ /(\d+)\.(\d+)\.(\d+)/) {
|
||||
$createVers = ($1 * 1000 * 1000) + ($2 * 1000) + $3;
|
||||
$createVers = ($1 * 1000 * 1000) + ($2 * 1000) + $3;
|
||||
}
|
||||
|
||||
# virCreateLinux is always 0.0.3 if the driver existed
|
||||
# before this time, otherwise it matches the version of
|
||||
# the driver's virCreateXML entry
|
||||
if ($createVersStr eq "Y" ||
|
||||
$createVers >= $createAPIVers) {
|
||||
$groups{"virDriver"}->{drivers}->{$drv}->{"domainCreateLinux"} = $createVersStr;
|
||||
$createVers >= $createAPIVers) {
|
||||
$groups{"virDriver"}->{drivers}->{$drv}->{"domainCreateLinux"} = $createVersStr;
|
||||
} else {
|
||||
$groups{"virDriver"}->{drivers}->{$drv}->{"domainCreateLinux"} = "0.0.3";
|
||||
$groups{"virDriver"}->{drivers}->{$drv}->{"domainCreateLinux"} = "0.0.3";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -329,7 +329,7 @@ foreach my $grp (sort { $a cmp $b } keys %groups) {
|
||||
EOF
|
||||
|
||||
foreach my $drv (sort { $a cmp $b } keys %{$groups{$grp}->{drivers}}) {
|
||||
print " <th>$drv</th>\n";
|
||||
print " <th>$drv</th>\n";
|
||||
}
|
||||
|
||||
print <<EOF;
|
||||
@@ -340,27 +340,27 @@ EOF
|
||||
|
||||
my $row = 0;
|
||||
foreach my $field (sort {
|
||||
$groups{$grp}->{apis}->{$a}
|
||||
cmp
|
||||
$groups{$grp}->{apis}->{$b}
|
||||
} keys %{$groups{$grp}->{apis}}) {
|
||||
my $api = $groups{$grp}->{apis}->{$field};
|
||||
my $vers = $apis{$api};
|
||||
print <<EOF;
|
||||
$groups{$grp}->{apis}->{$a}
|
||||
cmp
|
||||
$groups{$grp}->{apis}->{$b}
|
||||
} keys %{$groups{$grp}->{apis}}) {
|
||||
my $api = $groups{$grp}->{apis}->{$field};
|
||||
my $vers = $apis{$api};
|
||||
print <<EOF;
|
||||
<tr>
|
||||
<td><a href=\"html/libvirt-libvirt.html#$api\">$api</a></td>
|
||||
<td>$vers</td>
|
||||
EOF
|
||||
|
||||
foreach my $drv (sort {$a cmp $b } keys %{$groups{$grp}->{drivers}}) {
|
||||
if (exists $groups{$grp}->{drivers}->{$drv}->{$field}) {
|
||||
print "<td>", $groups{$grp}->{drivers}->{$drv}->{$field}, "</td>\n";
|
||||
} else {
|
||||
print "<td></td>\n";
|
||||
}
|
||||
if (exists $groups{$grp}->{drivers}->{$drv}->{$field}) {
|
||||
print "<td>", $groups{$grp}->{drivers}->{$drv}->{$field}, "</td>\n";
|
||||
} else {
|
||||
print "<td></td>\n";
|
||||
}
|
||||
}
|
||||
|
||||
print <<EOF;
|
||||
print <<EOF;
|
||||
</tr>
|
||||
EOF
|
||||
|
||||
@@ -373,13 +373,13 @@ EOF
|
||||
EOF
|
||||
|
||||
foreach my $drv (sort { $a cmp $b } keys %{$groups{$grp}->{drivers}}) {
|
||||
print " <th>$drv</th>\n";
|
||||
print " <th>$drv</th>\n";
|
||||
}
|
||||
|
||||
print <<EOF;
|
||||
</tr>
|
||||
EOF
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@@ -150,7 +150,7 @@
|
||||
<h2><a name="usagePatterns">Lock usage patterns</a></h2>
|
||||
|
||||
<p>
|
||||
The following pseudo code illustrates the common
|
||||
The following psuedo code illustrates the common
|
||||
patterns of operations invoked on the lock
|
||||
manager plugin callbacks.
|
||||
</p>
|
||||
@@ -183,10 +183,6 @@
|
||||
.key = "pid",
|
||||
.value = { .i = dom->pid },
|
||||
},
|
||||
{ .type = VIR_LOCK_MANAGER_PARAM_TYPE_CSTRING,
|
||||
.key = "uri",
|
||||
.value = { .cstr = driver->uri },
|
||||
},
|
||||
};
|
||||
mgr = virLockManagerNew(lockPlugin,
|
||||
VIR_LOCK_MANAGER_TYPE_DOMAIN,
|
||||
@@ -229,10 +225,6 @@
|
||||
.key = "pid",
|
||||
.value = { .i = dom->pid },
|
||||
},
|
||||
{ .type = VIR_LOCK_MANAGER_PARAM_TYPE_CSTRING,
|
||||
.key = "uri",
|
||||
.value = { .cstr = driver->uri },
|
||||
},
|
||||
};
|
||||
mgr = virLockManagerNew(lockPlugin,
|
||||
VIR_LOCK_MANAGER_TYPE_DOMAIN,
|
||||
|
@@ -157,15 +157,5 @@ from the C API, the only points to notice are:</p>
|
||||
various <span style="color: #E50073; background-color: #FFFFFF">methods</span>
|
||||
associated to the Domain class.</li>
|
||||
</ul>
|
||||
<h2>Maven</h2>
|
||||
<p>Up until version 0.4.7 the Java bindings were available from the central maven repository.</p>
|
||||
<p>If you want to use 0.4.8 or higher, please add the following repository to your pom.xml</p>
|
||||
<pre><repositories>
|
||||
<repository>
|
||||
<id>libvirt-org</id>
|
||||
<url>http://libvirt.org/maven2</url>
|
||||
</repository>
|
||||
</repositories></pre>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 7.2 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 9.3 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 32 KiB |
@@ -120,28 +120,6 @@
|
||||
# mount /var/lib/libvirt/sanlock
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
If your sanlock daemon happen to run under non-root
|
||||
privileges, you need to tell this to libvirt so it
|
||||
chowns created files correctly. This can be done by
|
||||
setting <code>user</code> and/or <code>group</code>
|
||||
variables in the configuration file. Accepted values
|
||||
range is specified in description to the same
|
||||
variables in <code>/etc/libvirt/qemu.conf</code>. For
|
||||
example:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
augtool -s set /files/etc/libvirt/qemu-sanlock.conf/user sanlock
|
||||
augtool -s set /files/etc/libvirt/qemu-sanlock.conf/group sanlock
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
But remember, that if this is NFS share, you need a
|
||||
no_root_squash-ed one for chown (and chmod possibly)
|
||||
to succeed.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
In terms of storage requirements, if the filesystem
|
||||
uses 512 byte sectors, you need to allow for <code>1MB</code>
|
||||
@@ -187,7 +165,7 @@
|
||||
<p>
|
||||
If all went well, libvirtd will have talked to sanlock
|
||||
and created the basic lockspace. This can be checked
|
||||
by looking for existence of the following file
|
||||
by looking for existance of the following file
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
@@ -230,29 +208,5 @@
|
||||
</pool>
|
||||
</pre>
|
||||
|
||||
<h2><a name="domainconfig">Domain configuration</a></h2>
|
||||
|
||||
<p>
|
||||
In case sanlock loses access to disk locks for some reason, it will
|
||||
kill all domains that lost their locks. This default behavior may
|
||||
be changed using
|
||||
<a href="formatdomain.html#elementsEvents">on_lockfailure
|
||||
element</a> in domain XML. When this element is present, sanlock
|
||||
will call <code>sanlock_helper</code> (provided by libvirt) with
|
||||
the specified action. This helper binary will connect to libvirtd
|
||||
and thus it may need to authenticate if libvirtd was configured to
|
||||
require that on the read-write UNIX socket. To provide the
|
||||
appropriate credentials to sanlock_helper, a
|
||||
<a href="auth.html#Auth_client_config">client authentication
|
||||
file</a> needs to contain something like the following:
|
||||
</p>
|
||||
<pre>
|
||||
[auth-libvirt-localhost]
|
||||
credentials=sanlock
|
||||
|
||||
[credentials-sanlock]
|
||||
authname=login
|
||||
password=password
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
@@ -114,16 +114,11 @@
|
||||
</h3>
|
||||
<p>The syntax for filters and outputs is the same for both types of
|
||||
variables.</p>
|
||||
<p>The format for a filter is one of:</p>
|
||||
<pre>
|
||||
x:name (log message only)
|
||||
x:+name (log message + stack trace)</pre>
|
||||
<p>where <code>name</code> is a string which is matched against source
|
||||
file name, e.g., <code>remote</code>, <code>qemu</code>, or
|
||||
<code>util/json</code>, the optional <code>+</code> prefix tells libvirt
|
||||
to log stack trace for each message matching <code>name</code>, and
|
||||
<code>x</code> is the minimal level where matching messages should
|
||||
be logged:</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>
|
||||
|
@@ -11,7 +11,7 @@
|
||||
libvirt implements several options for migration.
|
||||
</p>
|
||||
|
||||
<h2><a name="transport">Network data transports</a></h2>
|
||||
<h2><a id="transport">Network data transports</a></h2>
|
||||
|
||||
<p>
|
||||
There are two options for the data transport used during migration, either
|
||||
@@ -19,7 +19,7 @@
|
||||
over a libvirtd connection.
|
||||
</p>
|
||||
|
||||
<h3><a name="transportnative">Hypervisor native transport</a></h3>
|
||||
<h3><a id="transportnative">Hypervisor native transport</a></h3>
|
||||
<p>
|
||||
<em>Native</em> data transports may or may not support encryption, depending
|
||||
on the hypervisor in question, but will typically have the lowest computational costs
|
||||
@@ -33,7 +33,7 @@
|
||||
<img class="diagram" src="migration-native.png" alt="Migration native path">
|
||||
</p>
|
||||
|
||||
<h3><a name="transporttunnel">libvirt tunnelled transport</a></h3>
|
||||
<h3><a id="transporttunnel">libvirt tunnelled transport</a></h3>
|
||||
<p>
|
||||
<em>Tunnelled</em> data transports will always be capable of strong encryption
|
||||
since they are able to leverage the capabilities built in to the libvirt RPC protocol.
|
||||
@@ -51,7 +51,7 @@
|
||||
<img class="diagram" src="migration-tunnel.png" alt="Migration tunnel path">
|
||||
</p>
|
||||
|
||||
<h2><a name="flow">Communication control paths/flows</a></h2>
|
||||
<h2><a id="flow">Communication control paths/flows</a></h2>
|
||||
|
||||
<p>
|
||||
Migration of virtual machines requires close co-ordination of the two
|
||||
@@ -59,7 +59,7 @@
|
||||
which may be on the source, the destination, or a third host.
|
||||
</p>
|
||||
|
||||
<h3><a name="flowmanageddirect">Managed direct migration</a></h3>
|
||||
<h3><a id="flowmanageddirect">Managed direct migration</a></h3>
|
||||
|
||||
<p>
|
||||
With <em>managed direct</em> migration, the libvirt client process
|
||||
@@ -79,7 +79,7 @@
|
||||
</p>
|
||||
|
||||
|
||||
<h3><a name="flowpeer2peer">Managed peer to peer migration</a></h3>
|
||||
<h3><a id="flowpeer2peer">Managed peer to peer migration</a></h3>
|
||||
|
||||
<p>
|
||||
With <em>peer to peer</em> migration, the libvirt client process only
|
||||
@@ -101,7 +101,7 @@
|
||||
</p>
|
||||
|
||||
|
||||
<h3><a name="flowunmanageddirect">Unmanaged direct migration</a></h3>
|
||||
<h3><a id="flowunmanageddirect">Unmanaged direct migration</a></h3>
|
||||
|
||||
<p>
|
||||
With <em>unmanaged direct</em> migration, neither the libvirt client
|
||||
@@ -117,7 +117,7 @@
|
||||
</p>
|
||||
|
||||
|
||||
<h2><a name="security">Data security</a></h2>
|
||||
<h2><a id="security">Data security</a></h2>
|
||||
|
||||
<p>
|
||||
Since the migration data stream includes a complete copy of the guest
|
||||
@@ -136,21 +136,7 @@
|
||||
facility should be used.
|
||||
</p>
|
||||
|
||||
<h2><a name="offline">Offline migration</a></h2>
|
||||
|
||||
<p>
|
||||
Offline migration transfers inactive the definition of a domain
|
||||
(which may or may not be active). After successful completion, the
|
||||
domain remains in its current state on the source host and is defined
|
||||
but inactive on the destination host. It's a bit more clever than
|
||||
<code>virsh dumpxml</code> on source host followed by
|
||||
<code>virsh define</code> on destination host, as offline migration
|
||||
will run the pre-migration hook to update the domain XML on
|
||||
destination host. Currently, copying non-shared storage is not
|
||||
supported during offline migration.
|
||||
</p>
|
||||
|
||||
<h2><a name="uris">Migration URIs</a></h2>
|
||||
<h2><a id="uris">Migration URIs</a></h2>
|
||||
|
||||
<p>
|
||||
Initiating a guest migration requires the client application to
|
||||
@@ -200,7 +186,7 @@
|
||||
to comply with local firewall policies</li>
|
||||
</ol>
|
||||
|
||||
<h2><a name="config">Configuration file handling</a></h2>
|
||||
<h2><a id="config">Configuration file handling</a></h2>
|
||||
|
||||
<p>
|
||||
There are two types of virtual machine known to libvirt. A <em>transient</em>
|
||||
@@ -443,10 +429,10 @@
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h2><a name="scenarios">Migration scenarios</a></h2>
|
||||
<h2><a id="scenarios">Migration scenarios</a></h2>
|
||||
|
||||
|
||||
<h3><a name="scenarionativedirect">Native migration, client to two libvirtd servers</a></h3>
|
||||
<h3><a id="scenarionativedirect">Native migration, client to two libvirtd servers</a></h3>
|
||||
|
||||
<p>
|
||||
At an API level this requires use of virDomainMigrate, without the
|
||||
@@ -476,7 +462,7 @@
|
||||
Supported by Xen, QEMU, VMWare and VirtualBox drivers
|
||||
</p>
|
||||
|
||||
<h3><a name="scenarionativepeer2peer">Native migration, client to and peer2peer between, two libvirtd servers</a></h3>
|
||||
<h3><a id="scenarionativepeer2peer">Native migration, client to and peer2peer between, two libvirtd servers</a></h3>
|
||||
|
||||
<p>
|
||||
virDomainMigrate, with the VIR_MIGRATE_PEER2PEER flag set,
|
||||
@@ -500,7 +486,7 @@
|
||||
Supported by QEMU driver
|
||||
</p>
|
||||
|
||||
<h3><a name="scenariotunnelpeer2peer1">Tunnelled migration, client and peer2peer between two libvirtd servers</a></h3>
|
||||
<h3><a id="scenariotunnelpeer2peer1">Tunnelled migration, client and peer2peer between two libvirtd servers</a></h3>
|
||||
|
||||
<p>
|
||||
virDomainMigrate, with the VIR_MIGRATE_PEER2PEER & VIR_MIGRATE_TUNNELLED
|
||||
@@ -523,7 +509,7 @@
|
||||
Supported by QEMU driver
|
||||
</p>
|
||||
|
||||
<h3><a name="nativedirectunmanaged">Native migration, client to one libvirtd server</a></h3>
|
||||
<h3><a id="nativedirectunmanaged">Native migration, client to one libvirtd server</a></h3>
|
||||
|
||||
<p>
|
||||
virDomainMigrateToURI, without the VIR_MIGRATE_PEER2PEER flag set,
|
||||
@@ -547,7 +533,7 @@
|
||||
Supported by Xen driver
|
||||
</p>
|
||||
|
||||
<h3><a name="nativepeer2peer">Native migration, peer2peer between two libvirtd servers</a></h3>
|
||||
<h3><a id="nativepeer2peer">Native migration, peer2peer between two libvirtd servers</a></h3>
|
||||
|
||||
<p>
|
||||
virDomainMigrateToURI, with the VIR_MIGRATE_PEER2PEER flag set,
|
||||
@@ -584,7 +570,7 @@
|
||||
Supported by the QEMU driver
|
||||
</p>
|
||||
|
||||
<h3><a name="scenariotunnelpeer2peer2">Tunnelled migration, peer2peer between two libvirtd servers</a></h3>
|
||||
<h3><a id="scenariotunnelpeer2peer2">Tunnelled migration, peer2peer between two libvirtd servers</a></h3>
|
||||
|
||||
<p>
|
||||
virDomainMigrateToURI, with the VIR_MIGRATE_PEER2PEER & VIR_MIGRATE_TUNNELLED
|
||||
|
1972
docs/news.html.in
@@ -54,7 +54,7 @@
|
||||
<xsl:when test="$pagename = a/@href">
|
||||
<span class="{$class}"><xsl:value-of select="a"/></span>
|
||||
</xsl:when>
|
||||
<xsl:when test="starts-with(a/@href, 'http://wiki.libvirt.org')">
|
||||
<xsl:when test="a/@href = 'http://wiki.libvirt.org'">
|
||||
<a title="{./span}" class="{$class}" href="{a/@href}"><xsl:value-of select="a"/></a>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
|
@@ -1,4 +1,8 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<title>Pending patches needing review</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Pending patches needing review</h1>
|
||||
<p> A list of pending patches needing review upstream is available
|
||||
|
@@ -59,27 +59,6 @@
|
||||
<li>
|
||||
<a href="http://en.wikipedia.org/wiki/Virtualization">Wikipedia Virtualization</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="http://www.ibm.com/developerworks/linux/library/l-kvm-libvirt-audit/index.html">IBM developerworks article about libvirt and audit.</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h2>Blogs and Podcasts</h2>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<a href="http://twit.tv/show/floss-weekly/213">FLOSS Weekly
|
||||
podcast on the topic of libvirt</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="http://berrange.com/topics/libvirt/">Daniel
|
||||
Berrange's blog on useful libvirt development tips</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="http://planet.virt-tools.org/index.html">Virt Tools
|
||||
Blog Planet: blog aggregation of several virt-related
|
||||
feeds</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</body>
|
||||
|
@@ -136,14 +136,8 @@ Remote libvirt supports a range of transports:
|
||||
<dd> Unencrypted TCP/IP socket. Not recommended for production
|
||||
use, this is normally disabled, but an administrator can enable
|
||||
it for testing or use over a trusted network.
|
||||
The standard port is 16509. </dd>
|
||||
<dt> libssh2 </dt>
|
||||
<dd> Transport over the SSH protocol using
|
||||
<a href="http://libssh2.org/" title="libssh2 homepage">libssh2</a> instead
|
||||
of the OpenSSH binary. This transport uses the libvirt authentication callback for
|
||||
all ssh authentication calls and therefore supports keyboard-interactive authentication
|
||||
even with graphical management applications. As with the classic ssh transport
|
||||
netcat is required on the remote side.</dd>
|
||||
The standard port is 16509.
|
||||
</dd>
|
||||
</dl>
|
||||
<p>
|
||||
The default transport, if no other is specified, is <code>tls</code>.
|
||||
@@ -188,9 +182,6 @@ Connect to a libvirtd daemon offering unencrypted TCP/IP connections
|
||||
on localhost port 5000 and use the test driver with default
|
||||
settings.
|
||||
</li>
|
||||
<li><code>qemu+libssh2://user@host/system?known_hosts=/home/user/.ssh/known_hosts</code><br/> —
|
||||
Connect to a remote host using a ssh connection with the libssh2 driver
|
||||
and use a different known_hosts file.</li>
|
||||
</ul>
|
||||
<h4>
|
||||
<a name="Remote_URI_parameters">Extra parameters</a>
|
||||
@@ -246,7 +237,7 @@ Note that parameter values must be
|
||||
<td>
|
||||
<code>socket</code>
|
||||
</td>
|
||||
<td> unix, ssh, libssh2 </td>
|
||||
<td> unix, ssh </td>
|
||||
<td>
|
||||
The path to the Unix domain socket, which overrides the
|
||||
compiled-in default. For ssh transport, this is passed to
|
||||
@@ -261,7 +252,7 @@ Note that parameter values must be
|
||||
<td>
|
||||
<code>netcat</code>
|
||||
</td>
|
||||
<td> ssh, libssh2 </td>
|
||||
<td> ssh </td>
|
||||
<td>
|
||||
The name of the netcat command on the remote machine.
|
||||
The default is <code>nc</code>. For ssh transport, libvirt
|
||||
@@ -286,7 +277,7 @@ Note that parameter values must be
|
||||
<td>
|
||||
<code>keyfile</code>
|
||||
</td>
|
||||
<td> ssh, libssh2 </td>
|
||||
<td> ssh </td>
|
||||
<td>
|
||||
The name of the private key file to use to authentication to the remote
|
||||
machine. If this option is not used the default keys are used.
|
||||
@@ -350,39 +341,6 @@ Note that parameter values must be
|
||||
<td colspan="2"/>
|
||||
<td> Example: <code>pkipath=/tmp/pki/client</code> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>known_hosts</code>
|
||||
</td>
|
||||
<td> libssh2 </td>
|
||||
<td>
|
||||
Path to the known_hosts file to verify the host key against. LibSSH2
|
||||
supports OpenSSH-style known_hosts files, although it does not support
|
||||
all key types, so using files created by the OpenSSH binary may result
|
||||
into truncating the known_hosts file. It's recommended to use the default
|
||||
known_hosts file is located in libvirt's client local configuration
|
||||
directory e.g.: ~/.config/libvirt/known_hosts. Note: Use absolute paths.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"/>
|
||||
<td> Example: <code>known_hosts=/root/.ssh/known_hosts</code> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>sshauth</code>
|
||||
</td>
|
||||
<td> libssh2 </td>
|
||||
<td>
|
||||
A comma separated list of authentication methods to use. Default (is
|
||||
"agent,privkey,keyboard-interactive". The order of the methods is perserved.
|
||||
Some methods may require additional parameters.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"/>
|
||||
<td> Example: <code>sshauth=privkey,agent</code> </td>
|
||||
</tr>
|
||||
</table>
|
||||
<h3>
|
||||
<a name="Remote_certificates">Generating TLS certificates</a>
|
||||
|
@@ -54,31 +54,6 @@
|
||||
</choice>
|
||||
</define>
|
||||
|
||||
<define name="pciaddress">
|
||||
<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>
|
||||
<optional>
|
||||
<attribute name="multifunction">
|
||||
<choice>
|
||||
<value>on</value>
|
||||
<value>off</value>
|
||||
</choice>
|
||||
</attribute>
|
||||
</optional>
|
||||
</define>
|
||||
|
||||
<!-- a 6 byte MAC address in ASCII-hex format, eg "12:34:56:78:9A:BC" -->
|
||||
<!-- The lowest bit of the 1st byte is the "multicast" bit. a -->
|
||||
<!-- uniMacAddr requires that bit to be 0, and a multiMacAddr -->
|
||||
@@ -192,31 +167,4 @@
|
||||
<ref name='unsignedLong'/>
|
||||
</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>
|
||||
|
||||
<define name='wwn'>
|
||||
<data type='string'>
|
||||
<param name='pattern'>[0-9a-fA-F]{16}</param>
|
||||
</data>
|
||||
</define>
|
||||
|
||||
</grammar>
|
||||
|
@@ -44,22 +44,20 @@
|
||||
<optional>
|
||||
<ref name='topology'/>
|
||||
</optional>
|
||||
<zeroOrMore>
|
||||
<optional>
|
||||
<ref name='secmodel'/>
|
||||
</zeroOrMore>
|
||||
</optional>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='secmodel'>
|
||||
<element name='secmodel'>
|
||||
<interleave>
|
||||
<element name='model'>
|
||||
<text/>
|
||||
</element>
|
||||
<element name='doi'>
|
||||
<text/>
|
||||
</element>
|
||||
</interleave>
|
||||
<element name='model'>
|
||||
<text/>
|
||||
</element>
|
||||
<element name='doi'>
|
||||
<text/>
|
||||
</element>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
@@ -298,45 +296,43 @@
|
||||
|
||||
<define name='features'>
|
||||
<element name='features'>
|
||||
<interleave>
|
||||
<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>
|
||||
<optional>
|
||||
<element name='cpuselection'>
|
||||
<empty/>
|
||||
</element>
|
||||
</optional>
|
||||
<optional>
|
||||
<element name='deviceboot'>
|
||||
<empty/>
|
||||
</element>
|
||||
</optional>
|
||||
</interleave>
|
||||
<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>
|
||||
<optional>
|
||||
<element name='cpuselection'>
|
||||
<empty/>
|
||||
</element>
|
||||
</optional>
|
||||
<optional>
|
||||
<element name='deviceboot'>
|
||||
<empty/>
|
||||
</element>
|
||||
</optional>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
|
@@ -51,16 +51,13 @@
|
||||
<ref name="clock"/>
|
||||
<ref name="resources"/>
|
||||
<ref name="features"/>
|
||||
<ref name="events"/>
|
||||
<optional>
|
||||
<ref name="pm"/>
|
||||
</optional>
|
||||
<ref name="termination"/>
|
||||
<optional>
|
||||
<ref name="devices"/>
|
||||
</optional>
|
||||
<zeroOrMore>
|
||||
<optional>
|
||||
<ref name="seclabel"/>
|
||||
</zeroOrMore>
|
||||
</optional>
|
||||
<optional>
|
||||
<ref name='qemucmdline'/>
|
||||
</optional>
|
||||
@@ -151,32 +148,18 @@
|
||||
<!-- A per-device seclabel override is more limited, either
|
||||
relabel=no or a <label> must be present. -->
|
||||
<choice>
|
||||
<attribute name='relabel'>
|
||||
<value>no</value>
|
||||
</attribute>
|
||||
<group>
|
||||
<optional>
|
||||
<attribute name='model'>
|
||||
<text/>
|
||||
</attribute>
|
||||
</optional>
|
||||
<attribute name='relabel'>
|
||||
<value>no</value>
|
||||
</attribute>
|
||||
</group>
|
||||
<group>
|
||||
<optional>
|
||||
<attribute name='model'>
|
||||
<text/>
|
||||
</attribute>
|
||||
</optional>
|
||||
<optional>
|
||||
<attribute name='relabel'>
|
||||
<value>yes</value>
|
||||
</attribute>
|
||||
</optional>
|
||||
<zeroOrMore>
|
||||
<element name='label'>
|
||||
<text/>
|
||||
</element>
|
||||
</zeroOrMore>
|
||||
<element name='label'>
|
||||
<text/>
|
||||
</element>
|
||||
</group>
|
||||
</choice>
|
||||
</element>
|
||||
@@ -196,7 +179,6 @@
|
||||
<value>hyperv</value>
|
||||
<value>vbox</value>
|
||||
<value>phyp</value>
|
||||
<value>parallels</value>
|
||||
</choice>
|
||||
</attribute>
|
||||
</define>
|
||||
@@ -240,14 +222,12 @@
|
||||
<ref name="absFilePath"/>
|
||||
</element>
|
||||
</optional>
|
||||
<optional>
|
||||
<choice>
|
||||
<ref name="osbootkernel"/>
|
||||
</optional>
|
||||
<optional>
|
||||
<zeroOrMore>
|
||||
<ref name="osbootdev"/>
|
||||
</zeroOrMore>
|
||||
</optional>
|
||||
</choice>
|
||||
<optional>
|
||||
<element name="bootmenu">
|
||||
<attribute name="enable">
|
||||
@@ -301,7 +281,6 @@
|
||||
<ref name="hvmsparc"/>
|
||||
<ref name="hvmppc"/>
|
||||
<ref name="hvmppc64"/>
|
||||
<ref name="hvms390"/>
|
||||
</choice>
|
||||
</optional>
|
||||
<value>hvm</value>
|
||||
@@ -388,25 +367,6 @@
|
||||
</optional>
|
||||
</group>
|
||||
</define>
|
||||
<define name="hvms390">
|
||||
<group>
|
||||
<optional>
|
||||
<attribute name="arch">
|
||||
<choice>
|
||||
<value>s390</value>
|
||||
<value>s390x</value>
|
||||
</choice>
|
||||
</attribute>
|
||||
</optional>
|
||||
<optional>
|
||||
<attribute name="machine">
|
||||
<choice>
|
||||
<value>s390-virtio</value>
|
||||
</choice>
|
||||
</attribute>
|
||||
</optional>
|
||||
</group>
|
||||
</define>
|
||||
<define name="osexe">
|
||||
<element name="os">
|
||||
<element name="type">
|
||||
@@ -470,14 +430,6 @@
|
||||
<interleave>
|
||||
<element name="memory">
|
||||
<ref name='scaledInteger'/>
|
||||
<optional>
|
||||
<attribute name="dumpCore">
|
||||
<choice>
|
||||
<value>on</value>
|
||||
<value>off</value>
|
||||
</choice>
|
||||
</attribute>
|
||||
</optional>
|
||||
</element>
|
||||
<optional>
|
||||
<element name="currentMemory">
|
||||
@@ -592,16 +544,6 @@
|
||||
<ref name="cpuquota"/>
|
||||
</element>
|
||||
</optional>
|
||||
<optional>
|
||||
<element name="emulator_period">
|
||||
<ref name="cpuperiod"/>
|
||||
</element>
|
||||
</optional>
|
||||
<optional>
|
||||
<element name="emulator_quota">
|
||||
<ref name="cpuquota"/>
|
||||
</element>
|
||||
</optional>
|
||||
<zeroOrMore>
|
||||
<element name="vcpupin">
|
||||
<attribute name="vcpu">
|
||||
@@ -612,13 +554,6 @@
|
||||
</attribute>
|
||||
</element>
|
||||
</zeroOrMore>
|
||||
<optional>
|
||||
<element name="emulatorpin">
|
||||
<attribute name="cpuset">
|
||||
<ref name="cpuset"/>
|
||||
</attribute>
|
||||
</element>
|
||||
</optional>
|
||||
</element>
|
||||
</optional>
|
||||
|
||||
@@ -894,31 +829,6 @@
|
||||
<optional>
|
||||
<ref name="address"/>
|
||||
</optional>
|
||||
<optional>
|
||||
<ref name="geometry"/>
|
||||
</optional>
|
||||
<optional>
|
||||
<ref name="diskBlockIo"/>
|
||||
</optional>
|
||||
<optional>
|
||||
<element name="wwn">
|
||||
<ref name="wwn"/>
|
||||
</element>
|
||||
</optional>
|
||||
<optional>
|
||||
<element name="vendor">
|
||||
<data type="string">
|
||||
<param name="pattern">[x20-x7E]{0,8}</param>
|
||||
</data>
|
||||
</element>
|
||||
</optional>
|
||||
<optional>
|
||||
<element name="product">
|
||||
<data type="string">
|
||||
<param name="pattern">[x20-x7E]{0,16}</param>
|
||||
</data>
|
||||
</element>
|
||||
</optional>
|
||||
</interleave>
|
||||
</define>
|
||||
<define name="snapshot">
|
||||
@@ -1062,7 +972,6 @@
|
||||
<value>nbd</value>
|
||||
<value>rbd</value>
|
||||
<value>sheepdog</value>
|
||||
<value>gluster</value>
|
||||
</choice>
|
||||
</attribute>
|
||||
<optional>
|
||||
@@ -1070,32 +979,12 @@
|
||||
</optional>
|
||||
<zeroOrMore>
|
||||
<element name="host">
|
||||
<choice>
|
||||
<group>
|
||||
<optional>
|
||||
<attribute name="transport">
|
||||
<choice>
|
||||
<value>tcp</value>
|
||||
<value>rdma</value>
|
||||
</choice>
|
||||
</attribute>
|
||||
</optional>
|
||||
<attribute name="name">
|
||||
<ref name="dnsName"/>
|
||||
</attribute>
|
||||
<attribute name="port">
|
||||
<ref name="unsignedInt"/>
|
||||
</attribute>
|
||||
</group>
|
||||
<group>
|
||||
<attribute name="transport">
|
||||
<value>unix</value>
|
||||
</attribute>
|
||||
<attribute name="socket">
|
||||
<ref name="absFilePath"/>
|
||||
</attribute>
|
||||
</group>
|
||||
</choice>
|
||||
<attribute name="name">
|
||||
<ref name="dnsName"/>
|
||||
</attribute>
|
||||
<attribute name="port">
|
||||
<ref name="unsignedInt"/>
|
||||
</attribute>
|
||||
</element>
|
||||
</zeroOrMore>
|
||||
<empty/>
|
||||
@@ -1142,42 +1031,6 @@
|
||||
</optional>
|
||||
</element>
|
||||
</define>
|
||||
<define name="geometry">
|
||||
<element name="geometry">
|
||||
<attribute name="cyls">
|
||||
<data type="integer"/>
|
||||
</attribute>
|
||||
<attribute name="heads">
|
||||
<data type="integer"/>
|
||||
</attribute>
|
||||
<attribute name="secs">
|
||||
<data type="integer"/>
|
||||
</attribute>
|
||||
<optional>
|
||||
<attribute name="trans">
|
||||
<choice>
|
||||
<value>auto</value>
|
||||
<value>none</value>
|
||||
<value>lba</value>
|
||||
</choice>
|
||||
</attribute>
|
||||
</optional>
|
||||
</element>
|
||||
</define>
|
||||
<define name="diskBlockIo">
|
||||
<element name="blockio">
|
||||
<optional>
|
||||
<attribute name="logical_block_size">
|
||||
<data type="integer"/>
|
||||
</attribute>
|
||||
</optional>
|
||||
<optional>
|
||||
<attribute name="physical_block_size">
|
||||
<data type="integer"/>
|
||||
</attribute>
|
||||
</optional>
|
||||
</element>
|
||||
</define>
|
||||
<!--
|
||||
Disk may use a special driver for access.
|
||||
-->
|
||||
@@ -1223,32 +1076,11 @@
|
||||
<ref name="genericName"/>
|
||||
</attribute>
|
||||
<optional>
|
||||
<attribute name='type'>
|
||||
<choice>
|
||||
<ref name='diskFormat'/>
|
||||
<value>aio</value> <!-- back-compat for 'raw' -->
|
||||
</choice>
|
||||
<attribute name="type">
|
||||
<ref name="genericName"/>
|
||||
</attribute>
|
||||
</optional>
|
||||
</define>
|
||||
<define name='diskFormat'>
|
||||
<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>qed</value>
|
||||
<value>vmdk</value>
|
||||
<value>vpc</value>
|
||||
<value>fat</value>
|
||||
<value>vhd</value>
|
||||
</choice>
|
||||
</define>
|
||||
<define name="driverCache">
|
||||
<attribute name="cache">
|
||||
<choice>
|
||||
@@ -1367,8 +1199,6 @@
|
||||
<value>ich9-uhci3</value>
|
||||
<value>vt82c686b-uhci</value>
|
||||
<value>pci-ohci</value>
|
||||
<value>nec-xhci</value>
|
||||
<value>none</value>
|
||||
</choice>
|
||||
</attribute>
|
||||
</optional>
|
||||
@@ -1444,21 +1274,6 @@
|
||||
</optional>
|
||||
</interleave>
|
||||
</group>
|
||||
<group>
|
||||
<optional>
|
||||
<attribute name="type">
|
||||
<value>bind</value>
|
||||
</attribute>
|
||||
</optional>
|
||||
<interleave>
|
||||
<element name="source">
|
||||
<attribute name="dir">
|
||||
<ref name="absFilePath"/>
|
||||
</attribute>
|
||||
<empty/>
|
||||
</element>
|
||||
</interleave>
|
||||
</group>
|
||||
<group>
|
||||
<attribute name="type">
|
||||
<value>template</value>
|
||||
@@ -1472,24 +1287,6 @@
|
||||
</element>
|
||||
</interleave>
|
||||
</group>
|
||||
<group>
|
||||
<attribute name="type">
|
||||
<value>ram</value>
|
||||
</attribute>
|
||||
<interleave>
|
||||
<element name="source">
|
||||
<attribute name="usage">
|
||||
<ref name="unsignedLong"/>
|
||||
</attribute>
|
||||
<optional>
|
||||
<attribute name='unit'>
|
||||
<ref name='unit'/>
|
||||
</attribute>
|
||||
</optional>
|
||||
<empty/>
|
||||
</element>
|
||||
</interleave>
|
||||
</group>
|
||||
</choice>
|
||||
<interleave>
|
||||
<element name="target">
|
||||
@@ -1519,18 +1316,6 @@
|
||||
<ref name="address"/>
|
||||
</optional>
|
||||
</interleave>
|
||||
<interleave>
|
||||
<optional>
|
||||
<element name="space_hard_limit">
|
||||
<ref name='scaledInteger'/>
|
||||
</element>
|
||||
</optional>
|
||||
<optional>
|
||||
<element name="space_soft_limit">
|
||||
<ref name='scaledInteger'/>
|
||||
</element>
|
||||
</optional>
|
||||
</interleave>
|
||||
</element>
|
||||
</define>
|
||||
<!--
|
||||
@@ -1555,9 +1340,6 @@
|
||||
<empty/>
|
||||
</element>
|
||||
</optional>
|
||||
<optional>
|
||||
<ref name="virtualPortProfile"/>
|
||||
</optional>
|
||||
<ref name="interface-options"/>
|
||||
</interleave>
|
||||
</group>
|
||||
@@ -1710,14 +1492,6 @@
|
||||
</optional>
|
||||
<interleave>
|
||||
<element name="source">
|
||||
<optional>
|
||||
<attribute name="missing">
|
||||
<choice>
|
||||
<value>yes</value>
|
||||
<value>no</value>
|
||||
</choice>
|
||||
</attribute>
|
||||
</optional>
|
||||
<choice>
|
||||
<group>
|
||||
<ref name="usbproduct"/>
|
||||
@@ -1866,9 +1640,6 @@
|
||||
<optional>
|
||||
<ref name="bandwidth"/>
|
||||
</optional>
|
||||
<optional>
|
||||
<ref name="vlan"/>
|
||||
</optional>
|
||||
</interleave>
|
||||
</define>
|
||||
<!--
|
||||
@@ -2290,10 +2061,10 @@
|
||||
</element>
|
||||
</define>
|
||||
<!--
|
||||
When a certain event happens, multiple policies can be applied
|
||||
depends on what happened:
|
||||
When a domain terminates multiple policies can be applied depending
|
||||
on how it ended:
|
||||
-->
|
||||
<define name="events">
|
||||
<define name="termination">
|
||||
<interleave>
|
||||
<optional>
|
||||
<element name="on_reboot">
|
||||
@@ -2310,11 +2081,6 @@
|
||||
<ref name="crashOptions"/>
|
||||
</element>
|
||||
</optional>
|
||||
<optional>
|
||||
<element name="on_lockfailure">
|
||||
<ref name="lockfailureOptions"/>
|
||||
</element>
|
||||
</optional>
|
||||
</interleave>
|
||||
</define>
|
||||
<!--
|
||||
@@ -2356,57 +2122,6 @@
|
||||
<value>coredump-restart</value>
|
||||
</choice>
|
||||
</define>
|
||||
<!--
|
||||
Options when resource locks are lost:
|
||||
poweroff: power off the domain
|
||||
restart: power off the domain and start it up again to reacquire the
|
||||
locks
|
||||
pause: pause the execution of the domain so that it can be manually
|
||||
resumed when lock issues are solved
|
||||
ignore: keep the domain running
|
||||
-->
|
||||
<define name="lockfailureOptions">
|
||||
<choice>
|
||||
<value>poweroff</value>
|
||||
<value>restart</value>
|
||||
<value>pause</value>
|
||||
<value>ignore</value>
|
||||
</choice>
|
||||
</define>
|
||||
<!--
|
||||
Control ACPI sleep states (dis)allowed for the domain
|
||||
For each of the states the following rules apply:
|
||||
on: the state will be forcefully enabled
|
||||
off: the state will be forcefully disabled
|
||||
not specified: hypervisor will be left to decide its defaults
|
||||
-->
|
||||
<define name="pm">
|
||||
<element name="pm">
|
||||
<interleave>
|
||||
<optional>
|
||||
<element name="suspend-to-mem">
|
||||
<ref name="suspendChoices"/>
|
||||
</element>
|
||||
</optional>
|
||||
<optional>
|
||||
<element name="suspend-to-disk">
|
||||
<ref name="suspendChoices"/>
|
||||
</element>
|
||||
</optional>
|
||||
</interleave>
|
||||
<empty/>
|
||||
</element>
|
||||
</define>
|
||||
<define name="suspendChoices">
|
||||
<optional>
|
||||
<attribute name="enabled">
|
||||
<choice>
|
||||
<value>yes</value>
|
||||
<value>no</value>
|
||||
</choice>
|
||||
</attribute>
|
||||
</optional>
|
||||
</define>
|
||||
<!--
|
||||
Specific setup for a qemu emulated character device. Note: this
|
||||
definition doesn't fully specify the constraints on this node.
|
||||
@@ -2474,49 +2189,6 @@
|
||||
</choice>
|
||||
</define>
|
||||
|
||||
<define name="usbdevfilter">
|
||||
<element name="usbdev">
|
||||
<attribute name="allow">
|
||||
<choice>
|
||||
<value>yes</value>
|
||||
<value>no</value>
|
||||
</choice>
|
||||
</attribute>
|
||||
<optional>
|
||||
<attribute name="class">
|
||||
<choice>
|
||||
<ref name="usbClass"/>
|
||||
<ref name="usbIdDefault"/>
|
||||
</choice>
|
||||
</attribute>
|
||||
</optional>
|
||||
<optional>
|
||||
<attribute name="vendor">
|
||||
<choice>
|
||||
<ref name="usbId"/>
|
||||
<ref name="usbIdDefault"/>
|
||||
</choice>
|
||||
</attribute>
|
||||
</optional>
|
||||
<optional>
|
||||
<attribute name="product">
|
||||
<choice>
|
||||
<ref name="usbId"/>
|
||||
<ref name="usbIdDefault"/>
|
||||
</choice>
|
||||
</attribute>
|
||||
</optional>
|
||||
<optional>
|
||||
<attribute name="version">
|
||||
<choice>
|
||||
<ref name="usbVersion"/>
|
||||
<ref name="usbIdDefault"/>
|
||||
</choice>
|
||||
</attribute>
|
||||
</optional>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name="qemucdevSrcType">
|
||||
<attribute name="type">
|
||||
<ref name="qemucdevSrcTypeChoice"/>
|
||||
@@ -2540,9 +2212,6 @@
|
||||
<optional>
|
||||
<attribute name="wiremode"/>
|
||||
</optional>
|
||||
<optional>
|
||||
<ref name='devSeclabel'/>
|
||||
</optional>
|
||||
</element>
|
||||
</zeroOrMore>
|
||||
<optional>
|
||||
@@ -2581,16 +2250,6 @@
|
||||
</choice>
|
||||
</element>
|
||||
</define>
|
||||
<define name="codec">
|
||||
<element name="codec">
|
||||
<attribute name="type">
|
||||
<choice>
|
||||
<value>duplex</value>
|
||||
<value>micro</value>
|
||||
</choice>
|
||||
</attribute>
|
||||
</element>
|
||||
</define>
|
||||
<define name="sound">
|
||||
<element name="sound">
|
||||
<attribute name="model">
|
||||
@@ -2602,19 +2261,12 @@
|
||||
<value>ich6</value>
|
||||
</choice>
|
||||
</attribute>
|
||||
<interleave>
|
||||
<optional>
|
||||
<ref name="alias"/>
|
||||
</optional>
|
||||
<optional>
|
||||
<ref name="address"/>
|
||||
</optional>
|
||||
<zeroOrMore>
|
||||
<choice>
|
||||
<ref name="codec"/>
|
||||
</choice>
|
||||
</zeroOrMore>
|
||||
</interleave>
|
||||
<optional>
|
||||
<ref name="alias"/>
|
||||
</optional>
|
||||
<optional>
|
||||
<ref name="address"/>
|
||||
</optional>
|
||||
</element>
|
||||
</define>
|
||||
<define name="watchdog">
|
||||
@@ -2814,16 +2466,6 @@
|
||||
<optional>
|
||||
<ref name="address"/>
|
||||
</optional>
|
||||
<optional>
|
||||
<ref name="deviceBoot"/>
|
||||
</optional>
|
||||
</element>
|
||||
</define>
|
||||
<define name="redirfilter">
|
||||
<element name="redirfilter">
|
||||
<zeroOrMore>
|
||||
<ref name="usbdevfilter"/>
|
||||
</zeroOrMore>
|
||||
</element>
|
||||
</define>
|
||||
<define name="hostdev">
|
||||
@@ -2852,9 +2494,6 @@
|
||||
</optional>
|
||||
<group>
|
||||
<element name="source">
|
||||
<optional>
|
||||
<ref name="startupPolicy"/>
|
||||
</optional>
|
||||
<choice>
|
||||
<group>
|
||||
<ref name="usbproduct"/>
|
||||
@@ -2920,6 +2559,30 @@
|
||||
</attribute>
|
||||
</optional>
|
||||
</define>
|
||||
<define name="pciaddress">
|
||||
<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>
|
||||
<optional>
|
||||
<attribute name="multifunction">
|
||||
<choice>
|
||||
<value>on</value>
|
||||
<value>off</value>
|
||||
</choice>
|
||||
</attribute>
|
||||
</optional>
|
||||
</define>
|
||||
<define name="driveaddress">
|
||||
<optional>
|
||||
<attribute name="controller">
|
||||
@@ -2992,7 +2655,6 @@
|
||||
<ref name="smartcard"/>
|
||||
<ref name="hub"/>
|
||||
<ref name="redirdev"/>
|
||||
<ref name="redirfilter"/>
|
||||
</choice>
|
||||
</zeroOrMore>
|
||||
<optional>
|
||||
@@ -3005,8 +2667,7 @@
|
||||
</element>
|
||||
</define>
|
||||
<!--
|
||||
A set of optional features: PAE, APIC, ACPI,
|
||||
HyperV Enlightenment and HAP support
|
||||
A set of optional features: PAE, APIC, ACPI, and HAP support
|
||||
-->
|
||||
<define name="features">
|
||||
<optional>
|
||||
@@ -3019,14 +2680,7 @@
|
||||
</optional>
|
||||
<optional>
|
||||
<element name="apic">
|
||||
<optional>
|
||||
<attribute name="eoi">
|
||||
<choice>
|
||||
<value>on</value>
|
||||
<value>off</value>
|
||||
</choice>
|
||||
</attribute>
|
||||
</optional>
|
||||
<empty/>
|
||||
</element>
|
||||
</optional>
|
||||
<optional>
|
||||
@@ -3039,9 +2693,6 @@
|
||||
<empty/>
|
||||
</element>
|
||||
</optional>
|
||||
<optional>
|
||||
<ref name="hyperv"/>
|
||||
</optional>
|
||||
<optional>
|
||||
<element name="viridian">
|
||||
<empty/>
|
||||
@@ -3138,13 +2789,6 @@
|
||||
</choice>
|
||||
</attribute>
|
||||
</optional>
|
||||
<optional>
|
||||
<attribute name="vendor_id">
|
||||
<data type="string">
|
||||
<param name='pattern'>[^,]{12}</param>
|
||||
</data>
|
||||
</attribute>
|
||||
</optional>
|
||||
<choice>
|
||||
<text/>
|
||||
<empty/>
|
||||
@@ -3297,19 +2941,12 @@
|
||||
|
||||
<define name="bios">
|
||||
<element name="bios">
|
||||
<optional>
|
||||
<attribute name="useserial">
|
||||
<choice>
|
||||
<value>yes</value>
|
||||
<value>no</value>
|
||||
</choice>
|
||||
</attribute>
|
||||
</optional>
|
||||
<optional>
|
||||
<attribute name="rebootTimeout">
|
||||
<ref name="rebootTimeoutDelay"/>
|
||||
</attribute>
|
||||
</optional>
|
||||
<attribute name="useserial">
|
||||
<choice>
|
||||
<value>yes</value>
|
||||
<value>no</value>
|
||||
</choice>
|
||||
</attribute>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
@@ -3415,7 +3052,7 @@
|
||||
</attribute>
|
||||
<optional>
|
||||
<attribute name='format'>
|
||||
<ref name='diskFormat'/>
|
||||
<ref name="genericName"/>
|
||||
</attribute>
|
||||
</optional>
|
||||
<optional>
|
||||
@@ -3497,28 +3134,6 @@
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<!-- Optional HyperV Enlightenment features -->
|
||||
<define name="hyperv">
|
||||
<element name="hyperv">
|
||||
<interleave>
|
||||
<optional>
|
||||
<element name="relaxed">
|
||||
<ref name="hypervtristate"/>
|
||||
</element>
|
||||
</optional>
|
||||
</interleave>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name="hypervtristate">
|
||||
<attribute name="state">
|
||||
<choice>
|
||||
<value>on</value>
|
||||
<value>off</value>
|
||||
</choice>
|
||||
</attribute>
|
||||
</define>
|
||||
|
||||
<!--
|
||||
Optional hypervisor extensions in their own namespace:
|
||||
QEmu
|
||||
@@ -3605,11 +3220,6 @@
|
||||
<param name='minInclusive'>-1</param>
|
||||
</data>
|
||||
</define>
|
||||
<define name="rebootTimeoutDelay">
|
||||
<data type="short">
|
||||
<param name="minInclusive">-1</param>
|
||||
</data>
|
||||
</define>
|
||||
<define name="PortNumber">
|
||||
<data type="short">
|
||||
<param name="minInclusive">-1</param>
|
||||
@@ -3651,34 +3261,39 @@
|
||||
<param name="pattern">(([0-2]?[0-9]?[0-9]\.){3}[0-2]?[0-9]?[0-9])|(([0-9a-fA-F]+|:)+[0-9a-fA-F]+)|([a-zA-Z0-9_\.\+\-]*)</param>
|
||||
</data>
|
||||
</define>
|
||||
<define name="usbIdDefault">
|
||||
<data type="string">
|
||||
<param name="pattern">-1</param>
|
||||
</data>
|
||||
</define>
|
||||
<define name="usbId">
|
||||
<data type="string">
|
||||
<param name="pattern">(0x)?[0-9a-fA-F]{1,4}</param>
|
||||
</data>
|
||||
</define>
|
||||
<define name="usbVersion">
|
||||
<data type="string">
|
||||
<param name="pattern">[0-9]{1,2}.[0-9]{1,2}</param>
|
||||
</data>
|
||||
</define>
|
||||
<define name="usbAddr">
|
||||
<data type="string">
|
||||
<param name="pattern">(0x)?[0-9a-fA-F]{1,3}</param>
|
||||
</data>
|
||||
</define>
|
||||
<define name="usbClass">
|
||||
<define name="usbPort">
|
||||
<data type="string">
|
||||
<param name="pattern">((0x)?[0-9a-fA-F]{1,3}\.){0,3}(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="usbPort">
|
||||
<define name="pciSlot">
|
||||
<data type="string">
|
||||
<param name="pattern">((0x)?[0-9a-fA-F]{1,3}\.){0,3}(0x)?[0-9a-fA-F]{1,3}</param>
|
||||
<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>
|
||||
<define name="driveController">
|
||||
|
@@ -30,29 +30,6 @@
|
||||
<text/>
|
||||
</element>
|
||||
</optional>
|
||||
<optional>
|
||||
<element name='memory'>
|
||||
<choice>
|
||||
<attribute name='snapshot'>
|
||||
<choice>
|
||||
<value>no</value>
|
||||
<value>internal</value>
|
||||
</choice>
|
||||
</attribute>
|
||||
<group>
|
||||
<optional>
|
||||
<attribute name='snapshot'>
|
||||
<value>external</value>
|
||||
</attribute>
|
||||
</optional>
|
||||
<attribute name='file'>
|
||||
<ref name='absFilePath'/>
|
||||
</attribute>
|
||||
</group>
|
||||
</choice>
|
||||
<empty/>
|
||||
</element>
|
||||
</optional>
|
||||
<optional>
|
||||
<element name='disks'>
|
||||
<zeroOrMore>
|
||||
@@ -128,7 +105,7 @@
|
||||
<element name='driver'>
|
||||
<optional>
|
||||
<attribute name='type'>
|
||||
<ref name='diskFormat'/>
|
||||
<ref name='genericName'/>
|
||||
</attribute>
|
||||
</optional>
|
||||
<empty/>
|
||||
|
@@ -12,21 +12,6 @@
|
||||
<define name="network">
|
||||
|
||||
<element name="network">
|
||||
<optional>
|
||||
<attribute name="connections">
|
||||
<data type="unsignedInt"/>
|
||||
</attribute>
|
||||
</optional>
|
||||
<!-- Enables IPv6 guest-to-guest communications on a network
|
||||
with no gateways addresses specified -->
|
||||
<optional>
|
||||
<attribute name="ipv6">
|
||||
<choice>
|
||||
<value>yes</value>
|
||||
<value>no</value>
|
||||
</choice>
|
||||
</attribute>
|
||||
</optional>
|
||||
<interleave>
|
||||
|
||||
<!-- The name of the network, used to refer to it through the API
|
||||
@@ -97,51 +82,17 @@
|
||||
<value>passthrough</value>
|
||||
<value>private</value>
|
||||
<value>vepa</value>
|
||||
<value>hostdev</value>
|
||||
</choice>
|
||||
</attribute>
|
||||
</optional>
|
||||
|
||||
<optional>
|
||||
<attribute name="managed">
|
||||
<choice>
|
||||
<value>yes</value>
|
||||
<value>no</value>
|
||||
</choice>
|
||||
</attribute>
|
||||
</optional>
|
||||
<interleave>
|
||||
<choice>
|
||||
<group>
|
||||
<zeroOrMore>
|
||||
<element name='interface'>
|
||||
<attribute name='dev'>
|
||||
<ref name='deviceName'/>
|
||||
</attribute>
|
||||
<optional>
|
||||
<attribute name="connections">
|
||||
<data type="unsignedInt"/>
|
||||
</attribute>
|
||||
</optional>
|
||||
</element>
|
||||
</zeroOrMore>
|
||||
</group>
|
||||
<group>
|
||||
<zeroOrMore>
|
||||
<element name='address'>
|
||||
<attribute name='type'>
|
||||
<value>pci</value>
|
||||
</attribute>
|
||||
<ref name="pciaddress"/>
|
||||
<optional>
|
||||
<attribute name="connections">
|
||||
<data type="unsignedInt"/>
|
||||
</attribute>
|
||||
</optional>
|
||||
</element>
|
||||
</zeroOrMore>
|
||||
</group>
|
||||
</choice>
|
||||
<zeroOrMore>
|
||||
<element name='interface'>
|
||||
<attribute name='dev'>
|
||||
<ref name='deviceName'/>
|
||||
</attribute>
|
||||
</element>
|
||||
</zeroOrMore>
|
||||
<optional>
|
||||
<element name='pf'>
|
||||
<attribute name='dev'>
|
||||
@@ -172,17 +123,9 @@
|
||||
</choice>
|
||||
</attribute>
|
||||
</optional>
|
||||
<interleave>
|
||||
<optional>
|
||||
<ref name="virtualPortProfile"/>
|
||||
</optional>
|
||||
<optional>
|
||||
<ref name="bandwidth"/>
|
||||
</optional>
|
||||
<optional>
|
||||
<ref name="vlan"/>
|
||||
<ref name="virtualPortProfile"/>
|
||||
</optional>
|
||||
</interleave>
|
||||
</element>
|
||||
</zeroOrMore>
|
||||
|
||||
@@ -218,7 +161,7 @@
|
||||
</zeroOrMore>
|
||||
<zeroOrMore>
|
||||
<element name="host">
|
||||
<attribute name="ip"><ref name="ipAddr"/></attribute>
|
||||
<attribute name="ip"><ref name="ipv4Addr"/></attribute>
|
||||
<oneOrMore>
|
||||
<element name="hostname"><ref name="dnsName"/></element>
|
||||
</oneOrMore>
|
||||
@@ -229,9 +172,6 @@
|
||||
<optional>
|
||||
<ref name="bandwidth"/>
|
||||
</optional>
|
||||
<optional>
|
||||
<ref name="vlan"/>
|
||||
</optional>
|
||||
<optional>
|
||||
<element name="link">
|
||||
<attribute name="state">
|
||||
@@ -272,17 +212,15 @@
|
||||
<element name="dhcp">
|
||||
<zeroOrMore>
|
||||
<element name="range">
|
||||
<attribute name="start"><ref name="ipAddr"/></attribute>
|
||||
<attribute name="end"><ref name="ipAddr"/></attribute>
|
||||
<attribute name="start"><ref name="ipv4Addr"/></attribute>
|
||||
<attribute name="end"><ref name="ipv4Addr"/></attribute>
|
||||
</element>
|
||||
</zeroOrMore>
|
||||
<zeroOrMore>
|
||||
<element name="host">
|
||||
<optional>
|
||||
<attribute name="mac"><ref name="uniMacAddr"/></attribute>
|
||||
</optional>
|
||||
<attribute name="mac"><ref name="uniMacAddr"/></attribute>
|
||||
<attribute name="name"><text/></attribute>
|
||||
<attribute name="ip"><ref name="ipAddr"/></attribute>
|
||||
<attribute name="ip"><ref name="ipv4Addr"/></attribute>
|
||||
</element>
|
||||
</zeroOrMore>
|
||||
<optional>
|
||||
|
@@ -15,30 +15,22 @@
|
||||
<attribute name="type">
|
||||
<value>802.1Qbg</value>
|
||||
</attribute>
|
||||
<optional>
|
||||
<element name="parameters">
|
||||
<optional>
|
||||
<attribute name="managerid">
|
||||
<ref name="uint8range"/>
|
||||
</attribute>
|
||||
</optional>
|
||||
<optional>
|
||||
<attribute name="typeid">
|
||||
<ref name="uint24range"/>
|
||||
</attribute>
|
||||
</optional>
|
||||
<optional>
|
||||
<attribute name="typeidversion">
|
||||
<ref name="uint8range"/>
|
||||
</attribute>
|
||||
</optional>
|
||||
<optional>
|
||||
<attribute name="instanceid">
|
||||
<ref name="UUID"/>
|
||||
</attribute>
|
||||
</optional>
|
||||
</element>
|
||||
</optional>
|
||||
<element name="parameters">
|
||||
<attribute name="managerid">
|
||||
<ref name="uint8range"/>
|
||||
</attribute>
|
||||
<attribute name="typeid">
|
||||
<ref name="uint24range"/>
|
||||
</attribute>
|
||||
<attribute name="typeidversion">
|
||||
<ref name="uint8range"/>
|
||||
</attribute>
|
||||
<optional>
|
||||
<attribute name="instanceid">
|
||||
<ref name="UUID"/>
|
||||
</attribute>
|
||||
</optional>
|
||||
</element>
|
||||
</element>
|
||||
</group>
|
||||
<group>
|
||||
@@ -46,75 +38,11 @@
|
||||
<attribute name="type">
|
||||
<value>802.1Qbh</value>
|
||||
</attribute>
|
||||
<optional>
|
||||
<element name="parameters">
|
||||
<optional>
|
||||
<attribute name="profileid">
|
||||
<ref name="virtualPortProfileID"/>
|
||||
</attribute>
|
||||
</optional>
|
||||
</element>
|
||||
</optional>
|
||||
</element>
|
||||
</group>
|
||||
<group>
|
||||
<element name="virtualport">
|
||||
<attribute name="type">
|
||||
<value>openvswitch</value>
|
||||
</attribute>
|
||||
<optional>
|
||||
<element name="parameters">
|
||||
<optional>
|
||||
<attribute name="profileid">
|
||||
<ref name="virtualPortProfileID"/>
|
||||
</attribute>
|
||||
</optional>
|
||||
<optional>
|
||||
<attribute name="interfaceid">
|
||||
<ref name="UUID"/>
|
||||
</attribute>
|
||||
</optional>
|
||||
</element>
|
||||
</optional>
|
||||
</element>
|
||||
</group>
|
||||
<group>
|
||||
<!-- use this when no type attribute is present -->
|
||||
<element name="virtualport">
|
||||
<optional>
|
||||
<element name="parameters">
|
||||
<optional>
|
||||
<attribute name="managerid">
|
||||
<ref name="uint8range"/>
|
||||
</attribute>
|
||||
</optional>
|
||||
<optional>
|
||||
<attribute name="typeid">
|
||||
<ref name="uint24range"/>
|
||||
</attribute>
|
||||
</optional>
|
||||
<optional>
|
||||
<attribute name="typeidversion">
|
||||
<ref name="uint8range"/>
|
||||
</attribute>
|
||||
</optional>
|
||||
<optional>
|
||||
<attribute name="instanceid">
|
||||
<ref name="UUID"/>
|
||||
</attribute>
|
||||
</optional>
|
||||
<optional>
|
||||
<attribute name="profileid">
|
||||
<ref name="virtualPortProfileID"/>
|
||||
</attribute>
|
||||
</optional>
|
||||
<optional>
|
||||
<attribute name="interfaceid">
|
||||
<ref name="UUID"/>
|
||||
</attribute>
|
||||
</optional>
|
||||
</element>
|
||||
</optional>
|
||||
<element name="parameters">
|
||||
<attribute name="profileid">
|
||||
<ref name="virtualPortProfileID"/>
|
||||
</attribute>
|
||||
</element>
|
||||
</element>
|
||||
</group>
|
||||
</choice>
|
||||
@@ -148,11 +76,6 @@
|
||||
<ref name="speed"/>
|
||||
</attribute>
|
||||
</optional>
|
||||
<optional>
|
||||
<attribute name="floor">
|
||||
<ref name="speed"/>
|
||||
</attribute>
|
||||
</optional>
|
||||
<optional>
|
||||
<attribute name='burst'>
|
||||
<ref name="BurstSize"/>
|
||||
@@ -189,24 +112,4 @@
|
||||
<param name="pattern">(ipv4)|(ipv6)</param>
|
||||
</data>
|
||||
</define>
|
||||
|
||||
<define name="vlan">
|
||||
<element name="vlan">
|
||||
<optional>
|
||||
<attribute name="trunk">
|
||||
<value>yes</value>
|
||||
</attribute>
|
||||
</optional>
|
||||
<oneOrMore>
|
||||
<element name="tag">
|
||||
<attribute name="id">
|
||||
<data type="unsignedInt">
|
||||
<param name="maxInclusive">4095</param>
|
||||
</data>
|
||||
</attribute>
|
||||
<empty/>
|
||||
</element>
|
||||
</oneOrMore>
|
||||
</element>
|
||||
</define>
|
||||
</grammar>
|
||||
|
@@ -15,12 +15,6 @@
|
||||
<element name="parent"><text/></element>
|
||||
</optional>
|
||||
|
||||
<optional>
|
||||
<element name="driver">
|
||||
<element name="name"><text/></element>
|
||||
</element>
|
||||
</optional>
|
||||
|
||||
<zeroOrMore>
|
||||
<ref name="capability"/>
|
||||
</zeroOrMore>
|
||||
@@ -121,28 +115,6 @@
|
||||
</choice>
|
||||
</element>
|
||||
|
||||
<optional>
|
||||
<element name='capability'>
|
||||
<attribute name='type'>
|
||||
<value>phys_function</value>
|
||||
</attribute>
|
||||
<optional>
|
||||
<ref name='address'/>
|
||||
</optional>
|
||||
</element>
|
||||
</optional>
|
||||
|
||||
<optional>
|
||||
<element name='capability'>
|
||||
<attribute name='type'>
|
||||
<value>virt_functions</value>
|
||||
</attribute>
|
||||
<optional>
|
||||
<ref name='address'/>
|
||||
</optional>
|
||||
</element>
|
||||
</optional>
|
||||
|
||||
</define>
|
||||
|
||||
<define name='capusbdev'>
|
||||
@@ -245,6 +217,12 @@
|
||||
</attribute>
|
||||
</define>
|
||||
|
||||
<define name='wwn'>
|
||||
<data type='string'>
|
||||
<param name='pattern'>(0-9a-fA-F){16}</param>
|
||||
</data>
|
||||
</define>
|
||||
|
||||
<define name='capsfchost'>
|
||||
<attribute name='type'>
|
||||
<value>fc_host</value>
|
||||
@@ -391,15 +369,6 @@
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='address'>
|
||||
<element name='address'>
|
||||
<attribute name='domain'><ref name='hexuint'/></attribute>
|
||||
<attribute name='bus'><ref name='hexuint'/></attribute>
|
||||
<attribute name='slot'><ref name='hexuint'/></attribute>
|
||||
<attribute name='function'><ref name='hexuint'/></attribute>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='hexuint'>
|
||||
<data type='string'>
|
||||
<param name="pattern">(0x)?[0-9a-f]+</param>
|
||||
|
@@ -485,14 +485,6 @@
|
||||
<ref name="stateflags-type"/>
|
||||
</attribute>
|
||||
</optional>
|
||||
<optional>
|
||||
<attribute name="ipset">
|
||||
<ref name="ipset-name-type"/>
|
||||
</attribute>
|
||||
<attribute name="ipsetflags">
|
||||
<ref name="ipset-flags-type"/>
|
||||
</attribute>
|
||||
</optional>
|
||||
</interleave>
|
||||
</define>
|
||||
|
||||
@@ -1068,19 +1060,4 @@
|
||||
<param name="pattern">((SYN|ACK|URG|PSH|FIN|RST)(,(SYN|ACK|URG|PSH|FIN|RST))*|ALL|NONE)/((SYN|ACK|URG|PSH|FIN|RST)(,(SYN|ACK|URG|PSH|FIN|RST))*|ALL|NONE)</param>
|
||||
</data>
|
||||
</define>
|
||||
|
||||
<define name='ipset-name-type'>
|
||||
<choice>
|
||||
<ref name="variable-name-type"/>
|
||||
<data type="string">
|
||||
<param name="pattern">[a-zA-Z0-9_\.:\-\+ ]{1,31}</param>
|
||||
</data>
|
||||
</choice>
|
||||
</define>
|
||||
|
||||
<define name='ipset-flags-type'>
|
||||
<data type="string">
|
||||
<param name="pattern">(src|dst)(,(src|dst)){0,5}</param>
|
||||
</data>
|
||||
</define>
|
||||
</grammar>
|
||||
|
@@ -19,8 +19,6 @@
|
||||
<ref name='pooliscsi'/>
|
||||
<ref name='poolscsi'/>
|
||||
<ref name='poolmpath'/>
|
||||
<ref name='poolrbd'/>
|
||||
<ref name='poolsheepdog'/>
|
||||
</choice>
|
||||
</element>
|
||||
</define>
|
||||
@@ -107,24 +105,6 @@
|
||||
<ref name='target'/>
|
||||
</define>
|
||||
|
||||
<define name='poolrbd'>
|
||||
<attribute name='type'>
|
||||
<value>rbd</value>
|
||||
</attribute>
|
||||
<ref name='commonmetadata'/>
|
||||
<ref name='sizing'/>
|
||||
<ref name='sourcerbd'/>
|
||||
</define>
|
||||
|
||||
<define name='poolsheepdog'>
|
||||
<attribute name='type'>
|
||||
<value>sheepdog</value>
|
||||
</attribute>
|
||||
<ref name='commonmetadata'/>
|
||||
<ref name='sizing'/>
|
||||
<ref name='sourcesheepdog'/>
|
||||
</define>
|
||||
|
||||
<define name='sourceinfovendor'>
|
||||
<optional>
|
||||
<element name='vendor'>
|
||||
@@ -178,16 +158,10 @@
|
||||
<ref name='unsignedInt'/>
|
||||
</element>
|
||||
<element name='owner'>
|
||||
<choice>
|
||||
<ref name='unsignedInt'/>
|
||||
<value>-1</value>
|
||||
</choice>
|
||||
<ref name='unsignedInt'/>
|
||||
</element>
|
||||
<element name='group'>
|
||||
<choice>
|
||||
<ref name='unsignedInt'/>
|
||||
<value>-1</value>
|
||||
</choice>
|
||||
<ref name='unsignedInt'/>
|
||||
</element>
|
||||
<optional>
|
||||
<element name='label'>
|
||||
@@ -210,19 +184,17 @@
|
||||
</define>
|
||||
|
||||
<define name='sourceinfohost'>
|
||||
<oneOrMore>
|
||||
<element name='host'>
|
||||
<attribute name='name'>
|
||||
<text/>
|
||||
<element name='host'>
|
||||
<attribute name='name'>
|
||||
<text/>
|
||||
</attribute>
|
||||
<optional>
|
||||
<attribute name='port'>
|
||||
<ref name="PortNumber"/>
|
||||
</attribute>
|
||||
<optional>
|
||||
<attribute name='port'>
|
||||
<ref name="PortNumber"/>
|
||||
</attribute>
|
||||
</optional>
|
||||
<empty/>
|
||||
</element>
|
||||
</oneOrMore>
|
||||
</optional>
|
||||
<empty/>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='sourceinfodev'>
|
||||
@@ -293,38 +265,14 @@
|
||||
<attribute name='type'>
|
||||
<choice>
|
||||
<value>chap</value>
|
||||
<value>ceph</value>
|
||||
</choice>
|
||||
</attribute>
|
||||
<choice>
|
||||
<attribute name='login'>
|
||||
<text/>
|
||||
</attribute>
|
||||
<attribute name='username'>
|
||||
<text/>
|
||||
</attribute>
|
||||
</choice>
|
||||
<optional>
|
||||
<attribute name='passwd'>
|
||||
<text/>
|
||||
</attribute>
|
||||
</optional>
|
||||
<optional>
|
||||
<ref name='sourceinfoauthsecret'/>
|
||||
</optional>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='sourceinfoauthsecret'>
|
||||
<element name='secret'>
|
||||
<choice>
|
||||
<attribute name='uuid'>
|
||||
<text/>
|
||||
</attribute>
|
||||
<attribute name='usage'>
|
||||
<text/>
|
||||
</attribute>
|
||||
</choice>
|
||||
<attribute name='login'>
|
||||
<text/>
|
||||
</attribute>
|
||||
<attribute name='passwd'>
|
||||
<text/>
|
||||
</attribute>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
@@ -502,23 +450,6 @@
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='sourcerbd'>
|
||||
<element name='source'>
|
||||
<ref name='sourceinfoname'/>
|
||||
<ref name='sourceinfohost'/>
|
||||
<optional>
|
||||
<ref name='sourceinfoauth'/>
|
||||
</optional>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='sourcesheepdog'>
|
||||
<element name='source'>
|
||||
<ref name='sourceinfohost'/>
|
||||
<ref name='sourceinfoname'/>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name='name'>
|
||||
<data type='string'>
|
||||
<param name="pattern">[a-zA-Z0-9_\+\-]+</param>
|
||||
|
@@ -63,51 +63,15 @@
|
||||
</optional>
|
||||
</define>
|
||||
|
||||
<define name='timestamps'>
|
||||
<optional>
|
||||
<element name='timestamps'>
|
||||
<interleave>
|
||||
<optional>
|
||||
<element name='atime'>
|
||||
<ref name='timestamp'/>
|
||||
</element>
|
||||
</optional>
|
||||
<optional>
|
||||
<element name='btime'>
|
||||
<ref name='timestamp'/>
|
||||
</element>
|
||||
</optional>
|
||||
<optional>
|
||||
<element name='ctime'>
|
||||
<ref name='timestamp'/>
|
||||
</element>
|
||||
</optional>
|
||||
<optional>
|
||||
<element name='mtime'>
|
||||
<ref name='timestamp'/>
|
||||
</element>
|
||||
</optional>
|
||||
</interleave>
|
||||
</element>
|
||||
</optional>
|
||||
</define>
|
||||
|
||||
<define name='timestamp'>
|
||||
<data type='string'>
|
||||
<param name="pattern">[0-9]+(\.[0-9]{0,9})?</param>
|
||||
</data>
|
||||
</define>
|
||||
|
||||
<define name='target'>
|
||||
<element name='target'>
|
||||
<optional>
|
||||
<element name='path'>
|
||||
<data type='anyURI'/>
|
||||
<ref name='absFilePath'/>
|
||||
</element>
|
||||
</optional>
|
||||
<ref name='format'/>
|
||||
<ref name='permissions'/>
|
||||
<ref name='timestamps'/>
|
||||
<optional>
|
||||
<ref name='encryption'/>
|
||||
</optional>
|
||||
@@ -180,7 +144,6 @@
|
||||
|
||||
<define name='formatfile'>
|
||||
<choice>
|
||||
<value>unknown</value>
|
||||
<value>raw</value>
|
||||
<value>dir</value>
|
||||
<value>bochs</value>
|
||||
@@ -190,7 +153,6 @@
|
||||
<value>iso</value>
|
||||
<value>qcow</value>
|
||||
<value>qcow2</value>
|
||||
<value>qed</value>
|
||||
<value>vmdk</value>
|
||||
<value>vpc</value>
|
||||
</choice>
|
||||
|
@@ -1,28 +1,49 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!--
|
||||
This file is autogenerated from the PHP output
|
||||
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>Search the documentation on Libvir.org</title>
|
||||
<meta name="description" content="libvirt, virtualization, virtualization API" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<div id="headerLogo"></div>
|
||||
</div>
|
||||
<div id="body">
|
||||
<div id="content">
|
||||
<?php
|
||||
$query = $_GET['query'];
|
||||
// We handle only the first argument so far
|
||||
$query = ltrim ($query);
|
||||
|
||||
if (! $query) {
|
||||
echo "<h1 align='center'>Search the documentation on Libvir.org</h1>";
|
||||
}
|
||||
$scope = $_GET['scope'];
|
||||
if ($scope == NULL)
|
||||
$scope = "any";
|
||||
$scope = ltrim ($scope);
|
||||
if ($scope == "")
|
||||
$scope = "any";
|
||||
?>
|
||||
|
||||
?>
|
||||
<p> The search service indexes the libvirt APIs and documentation as well as the libvir-list@redhat.com mailing-list archives. To use it simply provide a set of keywords:</p>
|
||||
<form action="<?php echo $_SERVER['PHP_SELF'], "?query=", rawurlencode($query) ?>"
|
||||
enctype="application/x-www-form-urlencoded" method="get">
|
||||
<input name="query" type="text" size="50" value="<?php echo $query?>"/>
|
||||
<select name="scope">
|
||||
<option value="any">Search All</option>
|
||||
<option value="API" <?php if ($scope == 'API') print "selected='selected'"?>>Only the APIs</option>
|
||||
<option value="DOCS" <?php if ($scope == 'DOCS') print "selected='selected'"?>>Only the Documentation</option>
|
||||
<option value="LISTS" <?php if ($scope == 'LISTS') print "selected='selected'"?>>Only the lists archives</option>
|
||||
<option value="DOCS" <?php if ($scope == 'DOCS') print "selected"?>>Only the Documentation</option>
|
||||
<option value="LISTS" <?php if ($scope == 'LISTS') print "selected"?>>Only the lists archives</option>
|
||||
</select>
|
||||
<input name="submit" type="submit" value="Search ..."/>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
function logQueryWord($word) {
|
||||
$result = mysql_query ("SELECT ID,Count FROM Queries WHERE Value='$word'");
|
||||
@@ -222,3 +243,62 @@
|
||||
}
|
||||
}
|
||||
?>
|
||||
<img src="libvirtLogo.png" alt="libvirt Logo" />
|
||||
</div>
|
||||
<div id="menu">
|
||||
<ul class="l0"><li>
|
||||
<span class="active">Home</span>
|
||||
</li><li>
|
||||
<a title="Details of new features and bugs fixed in each release" class="inactive" href="news.html">News</a>
|
||||
</li><li>
|
||||
<a title="Get the latest source releases, binary builds and get access to the source repository" class="inactive" href="downloads.html">Downloads</a>
|
||||
</li><li>
|
||||
<a title="Information for users, administrators and developers" class="inactive" href="docs.html">Documentation</a>
|
||||
</li><li>
|
||||
<a title="User contributed content" class="inactive" href="http://wiki.libvirt.org">Wiki</a>
|
||||
</li><li>
|
||||
<a title="Frequently asked questions" class="inactive" href="http://wiki.libvirt.org/page/FAQ">FAQ</a>
|
||||
</li><li>
|
||||
<a title="How and where to report bugs and request features" class="inactive" href="bugs.html">Bug reports</a>
|
||||
</li><li>
|
||||
<a title="How to contact the developers via email and IRC" class="inactive" href="contact.html">Contact</a>
|
||||
</li><li>
|
||||
<a title="Miscellaneous links of interest related to libvirt" class="inactive" href="relatedlinks.html">Related Links</a>
|
||||
</li><li>
|
||||
<a title="Overview of all content on the website" class="inactive" href="sitemap.html">Sitemap</a>
|
||||
</li></ul>
|
||||
</div>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<div id="projects">
|
||||
<dl id="p1"><dt>
|
||||
<a href="http://augeas.net/">Augeas</a>
|
||||
</dt><dd>
|
||||
<span>A configuration editing tool and API</span>
|
||||
</dd><dt>
|
||||
<a href="http://libvirt.org/">libvirt</a>
|
||||
</dt><dd>
|
||||
<span>The open source virtualization API</span>
|
||||
</dd></dl>
|
||||
<dl id="p2"><dt>
|
||||
<a href="http://cobbler.et.redhat.com/">Cobbler</a>
|
||||
</dt><dd>
|
||||
<span>OS provisioning and profile management</span>
|
||||
</dd><dt>
|
||||
<a href="http://ovirt.org/">oVirt</a>
|
||||
</dt><dd>
|
||||
<span>Virtualization management across the data center</span>
|
||||
</dd></dl>
|
||||
<dl id="p3"><dt>
|
||||
<a href="http://freeipa.org/">FreeIPA</a>
|
||||
</dt><dd>
|
||||
<span>Identity, policy and audit management</span>
|
||||
</dd><dt>
|
||||
<a href="http://virt-manager.org/">Virtual Machine Manager</a>
|
||||
</dt><dd>
|
||||
<span>Virtualization management from the desktop</span>
|
||||
</dd></dl>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@@ -1,17 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<html>
|
||||
<body>
|
||||
<h1>Search the documentation on Libvirt.org</h1>
|
||||
|
||||
<p>
|
||||
The search service indexes the libvirt APIs and documentation as
|
||||
well as the libvir-list@redhat.com mailing-list archives. To use
|
||||
it simply provide a set of keywords:
|
||||
</p>
|
||||
|
||||
<a id="php_placeholder"/>
|
||||
|
||||
<img src="libvirtLogo.png" alt="libvirt Logo" />
|
||||
|
||||
</body>
|
||||
</html>
|
@@ -14,16 +14,7 @@
|
||||
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/>
|
||||
|
||||
<xsl:variable name="href_base">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$pagename = '404.html'">
|
||||
<xsl:value-of select="'/'"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="''"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="href_base" select="''"/>
|
||||
|
||||
<xsl:template match="/">
|
||||
<xsl:apply-templates select="." mode="page">
|
||||
|
@@ -107,12 +107,6 @@
|
||||
<li>
|
||||
<a href="#StorageBackendMultipath">Multipath backend</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#StorageBackendRBD">RBD (RADOS Block Device) backend</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#StorageBackendSheepdog">Sheepdog backend</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h2><a name="StorageBackendDir">Directory pool</a></h2>
|
||||
@@ -497,135 +491,6 @@
|
||||
The Multipath volume pool does not use the volume format type element.
|
||||
</p>
|
||||
|
||||
<h2><a name="StorageBackendRBD">RBD pools</a></h2>
|
||||
<p>
|
||||
This storage driver provides a pool which contains all RBD
|
||||
images in a RADOS pool. RBD (RADOS Block Device) is part
|
||||
of the Ceph distributed storage project.<br/>
|
||||
This backend <i>only</i> supports Qemu with RBD support. Kernel RBD
|
||||
which exposes RBD devices as block devices in /dev is <i>not</i>
|
||||
supported. RBD images created with this storage backend
|
||||
can be accessed through kernel RBD if configured manually, but
|
||||
this backend does not provide mapping for these images.<br/>
|
||||
Images created with this backend can be attached to Qemu guests
|
||||
when Qemu is build with RBD support (Since Qemu 0.14.0). The
|
||||
backend supports cephx authentication for communication with the
|
||||
Ceph cluster. Storing the cephx authentication key is done with
|
||||
the libvirt secret mechanism. The UUID in the example pool input
|
||||
refers to the UUID of the stored secret.
|
||||
<span class="since">Since 0.9.13</span>
|
||||
</p>
|
||||
|
||||
<h3>Example pool input</h3>
|
||||
<pre>
|
||||
<pool type="rbd">
|
||||
<name>myrbdpool</name>
|
||||
<source>
|
||||
<name>rbdpool</name>
|
||||
<host name='1.2.3.4' port='6789'/>
|
||||
<host name='my.ceph.monitor' port='6789'/>
|
||||
<host name='third.ceph.monitor' port='6789'/>
|
||||
<auth username='admin' type='ceph'>
|
||||
<secret uuid='2ec115d7-3a88-3ceb-bc12-0ac909a6fd87'/>
|
||||
</auth>
|
||||
</source>
|
||||
</pool></pre>
|
||||
|
||||
<h3>Example volume output</h3>
|
||||
<pre>
|
||||
<volume>
|
||||
<name>myvol</name>
|
||||
<key>rbd/myvol</key>
|
||||
<source>
|
||||
</source>
|
||||
<capacity unit='bytes'>53687091200</capacity>
|
||||
<allocation unit='bytes'>53687091200</allocation>
|
||||
<target>
|
||||
<path>rbd:rbd/myvol</path>
|
||||
<format type='unknown'/>
|
||||
<permissions>
|
||||
<mode>00</mode>
|
||||
<owner>0</owner>
|
||||
<group>0</group>
|
||||
</permissions>
|
||||
</target>
|
||||
</volume></pre>
|
||||
|
||||
<h3>Example disk attachement</h3>
|
||||
<p>RBD images can be attached to Qemu guests when Qemu is built
|
||||
with RBD support. Information about attaching a RBD image to a
|
||||
guest can be found
|
||||
at <a href="formatdomain.html#elementsDisks">format domain</a>
|
||||
page.</p>
|
||||
|
||||
<h3>Valid pool format types</h3>
|
||||
<p>
|
||||
The RBD pool does not use the pool format type element.
|
||||
</p>
|
||||
|
||||
<h3>Valid volume format types</h3>
|
||||
<p>
|
||||
The RBD pool does not use the volume format type element.
|
||||
</p>
|
||||
|
||||
<h2><a name="StorageBackendSheepdog">Sheepdog pools</a></h2>
|
||||
<p>
|
||||
This provides a pool based on a Sheepdog Cluster.
|
||||
Sheepdog is a distributed storage system for QEMU/KVM.
|
||||
It provides highly available block level storage volumes that
|
||||
can be attached to QEMU/KVM virtual machines.
|
||||
|
||||
The cluster must already be formatted.
|
||||
|
||||
<span class="since">Since 0.9.13</span>
|
||||
</p>
|
||||
|
||||
<h3>Example pool input</h3>
|
||||
<pre>
|
||||
<pool type="sheepdog">
|
||||
<name>mysheeppool</name>
|
||||
<source>
|
||||
<name>mysheeppool</name>
|
||||
<host name='localhost' port='7000'/>
|
||||
</source>
|
||||
</pool></pre>
|
||||
|
||||
<h3>Example volume output</h3>
|
||||
<pre>
|
||||
<volume>
|
||||
<name>myvol</name>
|
||||
<key>sheep/myvol</key>
|
||||
<source>
|
||||
</source>
|
||||
<capacity unit='bytes'>53687091200</capacity>
|
||||
<allocation unit='bytes'>53687091200</allocation>
|
||||
<target>
|
||||
<path>sheepdog:myvol</path>
|
||||
<format type='unknown'/>
|
||||
<permissions>
|
||||
<mode>00</mode>
|
||||
<owner>0</owner>
|
||||
<group>0</group>
|
||||
</permissions>
|
||||
</target>
|
||||
</volume></pre>
|
||||
|
||||
<h3>Example disk attachment</h3>
|
||||
<p>Sheepdog images can be attached to Qemu guests.
|
||||
Information about attaching a Sheepdog image to a
|
||||
guest can be found
|
||||
at the <a href="formatdomain.html#elementsDisks">format domain</a>
|
||||
page.</p>
|
||||
|
||||
<h3>Valid pool format types</h3>
|
||||
<p>
|
||||
The Sheepdog pool does not use the pool format type element.
|
||||
</p>
|
||||
|
||||
<h3>Valid volume format types</h3>
|
||||
<p>
|
||||
The Sheepdog pool does not use the volume format type element.
|
||||
</p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
42
docs/todo.pl
@@ -22,17 +22,17 @@ my $blurb = $cfg->get("output/blurb", undef);
|
||||
$SIG{__DIE__} = sub {
|
||||
my $err = shift;
|
||||
if (UNIVERSAL::isa($err, "BZ::Client::Exception")) {
|
||||
die "Unable to access bugzilla: " . $err->message;
|
||||
die "Unable to access bugzilla: " . $err->message;
|
||||
}
|
||||
die $err;
|
||||
};
|
||||
|
||||
my $client = BZ::Client->new(url => $server,
|
||||
user => $username,
|
||||
password => $password);
|
||||
user => $username,
|
||||
password => $password);
|
||||
|
||||
my $todo = BZ::Client::Bug->search($client, {'product' => $product,
|
||||
'alias' => $todoalias});
|
||||
'alias' => $todoalias});
|
||||
|
||||
die "Cannot find bug alias 'libvirtTodo'" unless $#{$todo} > -1;
|
||||
my $todoid = $todo->[0]->{'bug_id'};
|
||||
@@ -42,7 +42,7 @@ $todosummary =~ s/^\s*\[\s*RFE\s*\]\s*:?\s*//;
|
||||
$todosummary =~ s/^\s*Tracker\s*:\s*//;
|
||||
|
||||
my $trackers = BZ::Client::Bug->search($client, {'product' => $product,
|
||||
'blocked' => $todoid });
|
||||
'blocked' => $todoid });
|
||||
|
||||
my @trackers;
|
||||
|
||||
@@ -55,27 +55,27 @@ foreach my $tracker (@{$trackers}) {
|
||||
$summary =~ s/^\s*Tracker\s*:\s*//;
|
||||
|
||||
push @trackers, {
|
||||
id => $tracker->{'bug_id'},
|
||||
summary => $summary,
|
||||
features => [],
|
||||
id => $tracker->{'bug_id'},
|
||||
summary => $summary,
|
||||
features => [],
|
||||
};
|
||||
}
|
||||
|
||||
foreach my $tracker (@trackers) {
|
||||
my $features = BZ::Client::Bug->search($client, {'product' => $product,
|
||||
'blocked' => $tracker->{id}});
|
||||
'blocked' => $tracker->{id}});
|
||||
|
||||
foreach my $feature (@{$features}) {
|
||||
next if $feature->{'bug_status'} eq "CLOSED";
|
||||
next if $feature->{'bug_status'} eq "CLOSED";
|
||||
|
||||
my $summary = $feature->{'short_desc'};
|
||||
$summary =~ s/^\s*RFE\s*:\s*//;
|
||||
$summary =~ s/^\s*\[\s*RFE\s*\]\s*:?\s*//;
|
||||
my $summary = $feature->{'short_desc'};
|
||||
$summary =~ s/^\s*RFE\s*:\s*//;
|
||||
$summary =~ s/^\s*\[\s*RFE\s*\]\s*:?\s*//;
|
||||
|
||||
push @{$tracker->{features}}, {
|
||||
id => $feature->{'bug_id'},
|
||||
summary => $summary,
|
||||
};
|
||||
push @{$tracker->{features}}, {
|
||||
id => $feature->{'bug_id'},
|
||||
summary => $summary,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,11 +108,11 @@ foreach my $tracker (sort { $a->{summary} cmp $b->{summary} } @trackers) {
|
||||
print " <h2><a href=\"$server/$id\">$summary</a></h2>\n";
|
||||
print " <ul>\n";
|
||||
foreach my $feature (sort { $a->{summary} cmp $b->{summary} } @{$tracker->{features}}) {
|
||||
$summary = &escape($feature->{summary});
|
||||
$summary =~ s,^([^:]+):,<strong>$1</strong>,;
|
||||
$summary = &escape($feature->{summary});
|
||||
$summary =~ s,^([^:]+):,<strong>$1</strong>,;
|
||||
|
||||
$id = $feature->{id};
|
||||
print " <li>$summary (<strong>rhbz <a href=\"$server/$id\">$id</a></strong>)</li>\n";
|
||||
$id = $feature->{id};
|
||||
print " <li>$summary (<strong>rhbz <a href=\"$server/$id\">$id</a></strong>)</li>\n";
|
||||
}
|
||||
print " </ul>\n";
|
||||
}
|
||||
|
@@ -30,7 +30,7 @@ virConnectPtr conn = virConnectOpenReadOnly (<b>"test:///default"</b>);
|
||||
<p>
|
||||
To simplify life for administrators, it is possible to setup URI aliases in a
|
||||
libvirt client configuration file. The configuration file is <code>/etc/libvirt/libvirt.conf</code>
|
||||
for the root user, or <code>$XDG_CONFIG_HOME/libvirt/libvirt.conf</code> for any unprivileged user.
|
||||
for the root user, or <code>$HOME/.libvirt/libvirt.conf</code> for any unprivileged user.
|
||||
In this file, the following syntax can be used to setup aliases
|
||||
</p>
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
# Last Modified: Fri Mar 9 14:43:22 2012
|
||||
# Last Modified: Mon Apr 5 15:11:27 2010
|
||||
|
||||
#include <abstractions/base>
|
||||
#include <abstractions/consoles>
|
||||
@@ -108,22 +108,3 @@
|
||||
/bin/dash rmix,
|
||||
/bin/dd rmix,
|
||||
/bin/cat rmix,
|
||||
|
||||
/usr/libexec/qemu-bridge-helper Cx,
|
||||
# child profile for bridge helper process
|
||||
profile /usr/libexec/qemu-bridge-helper {
|
||||
#include <abstractions/base>
|
||||
|
||||
capability setuid,
|
||||
capability setgid,
|
||||
capability setpcap,
|
||||
capability net_admin,
|
||||
|
||||
network inet stream,
|
||||
|
||||
/dev/net/tun rw,
|
||||
/etc/qemu/** r,
|
||||
owner @{PROC}/*/status r,
|
||||
|
||||
/usr/libexec/qemu-bridge-helper rmix,
|
||||
}
|
||||
|
@@ -4,7 +4,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <signal.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
#include <libvirt/libvirt.h>
|
||||
#include <libvirt/virterror.h>
|
||||
@@ -16,8 +15,6 @@
|
||||
# define ATTRIBUTE_UNUSED __attribute__((__unused__))
|
||||
#endif
|
||||
|
||||
int run = 1;
|
||||
|
||||
/* Prototypes */
|
||||
const char *eventToString(int event);
|
||||
int myEventAddHandleFunc (int fd, int event,
|
||||
@@ -41,31 +38,6 @@ void usage(const char *pname);
|
||||
|
||||
/* Callback functions */
|
||||
|
||||
|
||||
static void connectClose(virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||
int reason,
|
||||
void *opaque ATTRIBUTE_UNUSED)
|
||||
{
|
||||
switch (reason) {
|
||||
case VIR_CONNECT_CLOSE_REASON_ERROR:
|
||||
fprintf(stderr, "Connection closed due to I/O error\n");
|
||||
break;
|
||||
case VIR_CONNECT_CLOSE_REASON_EOF:
|
||||
fprintf(stderr, "Connection closed due to end of file\n");
|
||||
break;
|
||||
case VIR_CONNECT_CLOSE_REASON_KEEPALIVE:
|
||||
fprintf(stderr, "Connection closed due to keepalive timeout\n");
|
||||
break;
|
||||
case VIR_CONNECT_CLOSE_REASON_CLIENT:
|
||||
fprintf(stderr, "Connection closed due to client request\n");
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr, "Connection closed due to unknown reason\n");
|
||||
break;
|
||||
};
|
||||
run = 0;
|
||||
}
|
||||
|
||||
const char *eventToString(int event) {
|
||||
const char *ret = "";
|
||||
switch ((virDomainEventType) event) {
|
||||
@@ -90,9 +62,6 @@ const char *eventToString(int event) {
|
||||
case VIR_DOMAIN_EVENT_SHUTDOWN:
|
||||
ret = "Shutdown";
|
||||
break;
|
||||
case VIR_DOMAIN_EVENT_PMSUSPENDED:
|
||||
ret = "PMSuspended";
|
||||
break;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@@ -149,9 +118,6 @@ static const char *eventDetailToString(int event, int detail) {
|
||||
case VIR_DOMAIN_EVENT_SUSPENDED_FROM_SNAPSHOT:
|
||||
ret = "Snapshot";
|
||||
break;
|
||||
case VIR_DOMAIN_EVENT_SUSPENDED_API_ERROR:
|
||||
ret = "API error";
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case VIR_DOMAIN_EVENT_RESUMED:
|
||||
@@ -182,7 +148,7 @@ static const char *eventDetailToString(int event, int detail) {
|
||||
ret = "Migrated";
|
||||
break;
|
||||
case VIR_DOMAIN_EVENT_STOPPED_SAVED:
|
||||
ret = "Saved";
|
||||
ret = "Failed";
|
||||
break;
|
||||
case VIR_DOMAIN_EVENT_STOPPED_FAILED:
|
||||
ret = "Failed";
|
||||
@@ -199,16 +165,6 @@ static const char *eventDetailToString(int event, int detail) {
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case VIR_DOMAIN_EVENT_PMSUSPENDED:
|
||||
switch ((virDomainEventPMSuspendedDetailType) detail) {
|
||||
case VIR_DOMAIN_EVENT_PMSUSPENDED_MEMORY:
|
||||
ret = "Memory";
|
||||
break;
|
||||
case VIR_DOMAIN_EVENT_PMSUSPENDED_DISK:
|
||||
ret = "Disk";
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@@ -266,17 +222,6 @@ static int myDomainEventRTCChangeCallback(virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int myDomainEventBalloonChangeCallback(virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||
virDomainPtr dom,
|
||||
unsigned long long actual,
|
||||
void *opaque ATTRIBUTE_UNUSED)
|
||||
{
|
||||
printf("%s EVENT: Domain %s(%d) balloon change %" PRIuMAX "KB\n",
|
||||
__func__, virDomainGetName(dom), virDomainGetID(dom), (uintmax_t)actual);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int myDomainEventWatchdogCallback(virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||
virDomainPtr dom,
|
||||
int action,
|
||||
@@ -393,7 +338,7 @@ static int myDomainEventPMWakeupCallback(virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||
int reason ATTRIBUTE_UNUSED,
|
||||
void *opaque ATTRIBUTE_UNUSED)
|
||||
{
|
||||
printf("%s EVENT: Domain %s(%d) system pmwakeup\n",
|
||||
printf("%s EVENT: Domain %s(%d) system pmwakeup",
|
||||
__func__, virDomainGetName(dom), virDomainGetID(dom));
|
||||
return 0;
|
||||
}
|
||||
@@ -403,17 +348,7 @@ static int myDomainEventPMSuspendCallback(virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||
int reason ATTRIBUTE_UNUSED,
|
||||
void *opaque ATTRIBUTE_UNUSED)
|
||||
{
|
||||
printf("%s EVENT: Domain %s(%d) system pmsuspend\n",
|
||||
__func__, virDomainGetName(dom), virDomainGetID(dom));
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int myDomainEventPMSuspendDiskCallback(virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||
virDomainPtr dom,
|
||||
int reason ATTRIBUTE_UNUSED,
|
||||
void *opaque ATTRIBUTE_UNUSED)
|
||||
{
|
||||
printf("%s EVENT: Domain %s(%d) system pmsuspend-disk\n",
|
||||
printf("%s EVENT: Domain %s(%d) system pmsuspend",
|
||||
__func__, virDomainGetName(dom), virDomainGetID(dom));
|
||||
return 0;
|
||||
}
|
||||
@@ -433,6 +368,7 @@ void usage(const char *pname)
|
||||
printf("%s uri\n", pname);
|
||||
}
|
||||
|
||||
int run = 1;
|
||||
|
||||
static void stop(int sig)
|
||||
{
|
||||
@@ -455,8 +391,6 @@ int main(int argc, char **argv)
|
||||
int callback10ret = -1;
|
||||
int callback11ret = -1;
|
||||
int callback12ret = -1;
|
||||
int callback13ret = -1;
|
||||
int callback14ret = -1;
|
||||
struct sigaction action_stop;
|
||||
|
||||
memset(&action_stop, 0, sizeof(action_stop));
|
||||
@@ -479,9 +413,6 @@ int main(int argc, char **argv)
|
||||
return -1;
|
||||
}
|
||||
|
||||
virConnectRegisterCloseCallback(dconn,
|
||||
connectClose, NULL, NULL);
|
||||
|
||||
sigaction(SIGTERM, &action_stop, NULL);
|
||||
sigaction(SIGINT, &action_stop, NULL);
|
||||
|
||||
@@ -545,16 +476,6 @@ int main(int argc, char **argv)
|
||||
VIR_DOMAIN_EVENT_ID_PMSUSPEND,
|
||||
VIR_DOMAIN_EVENT_CALLBACK(myDomainEventPMSuspendCallback),
|
||||
strdup("pmsuspend"), myFreeFunc);
|
||||
callback13ret = virConnectDomainEventRegisterAny(dconn,
|
||||
NULL,
|
||||
VIR_DOMAIN_EVENT_ID_BALLOON_CHANGE,
|
||||
VIR_DOMAIN_EVENT_CALLBACK(myDomainEventBalloonChangeCallback),
|
||||
strdup("callback balloonchange"), myFreeFunc);
|
||||
callback14ret = virConnectDomainEventRegisterAny(dconn,
|
||||
NULL,
|
||||
VIR_DOMAIN_EVENT_ID_PMSUSPEND_DISK,
|
||||
VIR_DOMAIN_EVENT_CALLBACK(myDomainEventPMSuspendDiskCallback),
|
||||
strdup("pmsuspend-disk"), myFreeFunc);
|
||||
if ((callback1ret != -1) &&
|
||||
(callback2ret != -1) &&
|
||||
(callback3ret != -1) &&
|
||||
@@ -565,9 +486,7 @@ int main(int argc, char **argv)
|
||||
(callback9ret != -1) &&
|
||||
(callback10ret != -1) &&
|
||||
(callback11ret != -1) &&
|
||||
(callback12ret != -1) &&
|
||||
(callback13ret != -1) &&
|
||||
(callback14ret != -1)) {
|
||||
(callback12ret != -1)) {
|
||||
if (virConnectSetKeepAlive(dconn, 5, 3) < 0) {
|
||||
virErrorPtr err = virGetLastError();
|
||||
fprintf(stderr, "Failed to start keepalive protocol: %s\n",
|
||||
@@ -575,7 +494,7 @@ int main(int argc, char **argv)
|
||||
run = 0;
|
||||
}
|
||||
|
||||
while (run) {
|
||||
while (run && virConnectIsAlive(dconn) == 1) {
|
||||
if (virEventRunDefaultImpl() < 0) {
|
||||
virErrorPtr err = virGetLastError();
|
||||
fprintf(stderr, "Failed to run event loop: %s\n",
|
||||
@@ -595,7 +514,6 @@ int main(int argc, char **argv)
|
||||
virConnectDomainEventDeregisterAny(dconn, callback10ret);
|
||||
virConnectDomainEventDeregisterAny(dconn, callback11ret);
|
||||
virConnectDomainEventDeregisterAny(dconn, callback12ret);
|
||||
virConnectDomainEventDeregisterAny(dconn, callback13ret);
|
||||
if (callback8ret != -1)
|
||||
virConnectDomainEventDeregisterAny(dconn, callback8ret);
|
||||
}
|
||||
|
@@ -126,7 +126,7 @@ class virEventLoopPure:
|
||||
self.poll.register(self.pipetrick[0], select.POLLIN)
|
||||
|
||||
|
||||
# Calculate when the next timeout is due to occur, returning
|
||||
# Calculate when the next timeout is due to occurr, returning
|
||||
# the absolute timestamp for the next timeout, or 0 if there is
|
||||
# no timeout due
|
||||
def next_timeout(self):
|
||||
@@ -169,7 +169,7 @@ class virEventLoopPure:
|
||||
#
|
||||
# Due to the coarse granularity of schedular timeslices, if
|
||||
# we ask for a sleep of 500ms in order to satisfy a timer, we
|
||||
# may return up to 1 schedular timeslice early. So even though
|
||||
# may return upto 1 schedular timeslice early. So even though
|
||||
# our sleep timeout was reached, the registered timer may not
|
||||
# technically be at its expiry point. This leads to us going
|
||||
# back around the loop with a crazy 5ms sleep. So when checking
|
||||
@@ -178,53 +178,48 @@ class virEventLoopPure:
|
||||
def run_once(self):
|
||||
sleep = -1
|
||||
self.runningPoll = True
|
||||
try:
|
||||
next = self.next_timeout()
|
||||
debug("Next timeout due at %d" % next)
|
||||
if next > 0:
|
||||
now = int(time.time() * 1000)
|
||||
if now >= next:
|
||||
sleep = 0
|
||||
else:
|
||||
sleep = (next - now) / 1000.0
|
||||
|
||||
debug("Poll with a sleep of %d" % sleep)
|
||||
events = self.poll.poll(sleep)
|
||||
|
||||
# Dispatch any file handle events that occurred
|
||||
for (fd, revents) in events:
|
||||
# See if the events was from the self-pipe
|
||||
# telling us to wakup. if so, then discard
|
||||
# the data just continue
|
||||
if fd == self.pipetrick[0]:
|
||||
self.pendingWakeup = False
|
||||
data = os.read(fd, 1)
|
||||
continue
|
||||
|
||||
h = self.get_handle_by_fd(fd)
|
||||
if h:
|
||||
debug("Dispatch fd %d handle %d events %d" % (fd, h.get_id(), revents))
|
||||
h.dispatch(self.events_from_poll(revents))
|
||||
|
||||
next = self.next_timeout()
|
||||
debug("Next timeout due at %d" % next)
|
||||
if next > 0:
|
||||
now = int(time.time() * 1000)
|
||||
for t in self.timers:
|
||||
interval = t.get_interval()
|
||||
if interval < 0:
|
||||
continue
|
||||
if now >= next:
|
||||
sleep = 0
|
||||
else:
|
||||
sleep = (next - now) / 1000.0
|
||||
|
||||
want = t.get_last_fired() + interval
|
||||
# Deduct 20ms, since scheduler timeslice
|
||||
# means we could be ever so slightly early
|
||||
if now >= (want-20):
|
||||
debug("Dispatch timer %d now %s want %s" % (t.get_id(), str(now), str(want)))
|
||||
t.set_last_fired(now)
|
||||
t.dispatch()
|
||||
debug("Poll with a sleep of %d" % sleep)
|
||||
events = self.poll.poll(sleep)
|
||||
|
||||
except (os.error, select.error), e:
|
||||
if e.args[0] != errno.EINTR:
|
||||
raise
|
||||
finally:
|
||||
self.runningPoll = False
|
||||
# Dispatch any file handle events that occurred
|
||||
for (fd, revents) in events:
|
||||
# See if the events was from the self-pipe
|
||||
# telling us to wakup. if so, then discard
|
||||
# the data just continue
|
||||
if fd == self.pipetrick[0]:
|
||||
self.pendingWakeup = False
|
||||
data = os.read(fd, 1)
|
||||
continue
|
||||
|
||||
h = self.get_handle_by_fd(fd)
|
||||
if h:
|
||||
debug("Dispatch fd %d handle %d events %d" % (fd, h.get_id(), revents))
|
||||
h.dispatch(self.events_from_poll(revents))
|
||||
|
||||
now = int(time.time() * 1000)
|
||||
for t in self.timers:
|
||||
interval = t.get_interval()
|
||||
if interval < 0:
|
||||
continue
|
||||
|
||||
want = t.get_last_fired() + interval
|
||||
# Deduct 20ms, since schedular timeslice
|
||||
# means we could be ever so slightly early
|
||||
if now >= (want-20):
|
||||
debug("Dispatch timer %d now %s want %s" % (t.get_id(), str(now), str(want)))
|
||||
t.set_last_fired(now)
|
||||
t.dispatch()
|
||||
|
||||
self.runningPoll = False
|
||||
|
||||
|
||||
# Actually the event loop forever
|
||||
@@ -436,20 +431,18 @@ def eventToString(event):
|
||||
"Suspended",
|
||||
"Resumed",
|
||||
"Stopped",
|
||||
"Shutdown",
|
||||
"PMSuspended" );
|
||||
"Shutdown" );
|
||||
return eventStrings[event];
|
||||
|
||||
def detailToString(event, detail):
|
||||
eventStrings = (
|
||||
( "Added", "Updated" ),
|
||||
( "Removed", ),
|
||||
( "Booted", "Migrated", "Restored", "Snapshot", "Wakeup" ),
|
||||
( "Paused", "Migrated", "IOError", "Watchdog", "Restored", "Snapshot", "API error" ),
|
||||
( "Unpaused", "Migrated", "Snapshot" ),
|
||||
( "Removed" ),
|
||||
( "Booted", "Migrated", "Restored", "Snapshot" ),
|
||||
( "Paused", "Migrated", "IOError", "Watchdog" ),
|
||||
( "Unpaused", "Migrated"),
|
||||
( "Shutdown", "Destroyed", "Crashed", "Migrated", "Saved", "Failed", "Snapshot"),
|
||||
( "Finished", ),
|
||||
( "Memory", "Disk" )
|
||||
( "Finished" )
|
||||
)
|
||||
return eventStrings[event][detail]
|
||||
|
||||
@@ -490,21 +483,6 @@ def myDomainEventPMWakeupCallback(conn, dom, reason, opaque):
|
||||
def myDomainEventPMSuspendCallback(conn, dom, reason, opaque):
|
||||
print "myDomainEventPMSuspendCallback: Domain %s(%s) system pmsuspend" % (
|
||||
dom.name(), dom.ID())
|
||||
def myDomainEventBalloonChangeCallback(conn, dom, actual, opaque):
|
||||
print "myDomainEventBalloonChangeCallback: Domain %s(%s) %d" % (dom.name(), dom.ID(), actual)
|
||||
def myDomainEventPMSuspendDiskCallback(conn, dom, reason, opaque):
|
||||
print "myDomainEventPMSuspendDiskCallback: Domain %s(%s) system pmsuspend_disk" % (
|
||||
dom.name(), dom.ID())
|
||||
|
||||
run = True
|
||||
|
||||
def myConnectionCloseCallback(conn, reason, opaque):
|
||||
reasonStrings = (
|
||||
"Error", "End-of-file", "Keepalive", "Client",
|
||||
)
|
||||
print "myConnectionCloseCallback: %s: %s" % (conn.getURI(), reasonStrings[reason])
|
||||
run = False
|
||||
|
||||
def usage(out=sys.stderr):
|
||||
print >>out, "usage: "+os.path.basename(sys.argv[0])+" [-hdl] [uri]"
|
||||
print >>out, " uri will default to qemu:///system"
|
||||
@@ -554,8 +532,6 @@ def main():
|
||||
if (old_exitfunc): old_exitfunc()
|
||||
sys.exitfunc = exit
|
||||
|
||||
vc.registerCloseCallback(myConnectionCloseCallback, None)
|
||||
|
||||
#Add 2 callbacks to prove this works with more than just one
|
||||
vc.domainEventRegister(myDomainEventCallback1,None)
|
||||
vc.domainEventRegisterAny(None, libvirt.VIR_DOMAIN_EVENT_ID_LIFECYCLE, myDomainEventCallback2, None)
|
||||
@@ -568,8 +544,6 @@ def main():
|
||||
vc.domainEventRegisterAny(None, libvirt.VIR_DOMAIN_EVENT_ID_TRAY_CHANGE, myDomainEventTrayChangeCallback, None)
|
||||
vc.domainEventRegisterAny(None, libvirt.VIR_DOMAIN_EVENT_ID_PMWAKEUP, myDomainEventPMWakeupCallback, None)
|
||||
vc.domainEventRegisterAny(None, libvirt.VIR_DOMAIN_EVENT_ID_PMSUSPEND, myDomainEventPMSuspendCallback, None)
|
||||
vc.domainEventRegisterAny(None, libvirt.VIR_DOMAIN_EVENT_ID_BALLOON_CHANGE, myDomainEventBalloonChangeCallback, None)
|
||||
vc.domainEventRegisterAny(None, libvirt.VIR_DOMAIN_EVENT_ID_PMSUSPEND_DISK, myDomainEventPMSuspendDiskCallback, None)
|
||||
|
||||
vc.setKeepAlive(5, 3)
|
||||
|
||||
@@ -577,7 +551,7 @@ def main():
|
||||
# of demo we'll just go to sleep. The other option is to
|
||||
# run the event loop in your main thread if your app is
|
||||
# totally event based.
|
||||
while run:
|
||||
while vc.isAlive() == 1:
|
||||
time.sleep(1)
|
||||
|
||||
|
||||
|
@@ -1,7 +1,6 @@
|
||||
## Copyright (C) 2005-2012 Red Hat, Inc.
|
||||
## Copyright (C) 2005-2011 Red Hat, Inc.
|
||||
## See COPYING.LIB for the License of this software
|
||||
|
||||
EXTRA_DIST= \
|
||||
README \
|
||||
consolecallback.py \
|
||||
dominfo.py domrestore.py domsave.py domstart.py esxlist.py
|
||||
|
@@ -1,88 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
# consolecallback - provide a persistent console that survives guest reboots
|
||||
|
||||
import sys, os, logging, libvirt, tty, termios, atexit
|
||||
|
||||
def reset_term():
|
||||
termios.tcsetattr(0, termios.TCSADRAIN, attrs)
|
||||
|
||||
def error_handler(unused, error):
|
||||
# The console stream errors on VM shutdown; we don't care
|
||||
if (error[0] == libvirt.VIR_ERR_RPC and
|
||||
error[1] == libvirt.VIR_FROM_STREAMS):
|
||||
return
|
||||
logging.warn(error)
|
||||
|
||||
class Console(object):
|
||||
def __init__(self, uri, uuid):
|
||||
self.uri = uri
|
||||
self.uuid = uuid
|
||||
self.connection = libvirt.open(uri)
|
||||
self.domain = self.connection.lookupByUUIDString(uuid)
|
||||
self.state = self.domain.state(0)
|
||||
self.connection.domainEventRegister(lifecycle_callback, self)
|
||||
self.stream = None
|
||||
self.run_console = True
|
||||
logging.info("%s initial state %d, reason %d",
|
||||
self.uuid, self.state[0], self.state[1])
|
||||
|
||||
def check_console(console):
|
||||
if (console.state[0] == libvirt.VIR_DOMAIN_RUNNING or
|
||||
console.state[0] == libvirt.VIR_DOMAIN_PAUSED):
|
||||
if console.stream == None:
|
||||
console.stream = console.connection.newStream(libvirt.VIR_STREAM_NONBLOCK)
|
||||
console.domain.openConsole(None, console.stream, 0)
|
||||
console.stream.eventAddCallback(libvirt.VIR_STREAM_EVENT_READABLE, stream_callback, console)
|
||||
else:
|
||||
if console.stream:
|
||||
console.stream.eventRemoveCallback()
|
||||
console.stream = None
|
||||
|
||||
return console.run_console
|
||||
|
||||
def stdin_callback(watch, fd, events, console):
|
||||
readbuf = os.read(fd, 1024)
|
||||
if readbuf.startswith(""):
|
||||
console.run_console = False
|
||||
return
|
||||
if console.stream:
|
||||
console.stream.send(readbuf)
|
||||
|
||||
def stream_callback(stream, events, console):
|
||||
try:
|
||||
received_data = console.stream.recv(1024)
|
||||
except:
|
||||
return
|
||||
os.write(0, received_data)
|
||||
|
||||
def lifecycle_callback (connection, domain, event, detail, console):
|
||||
console.state = console.domain.state(0)
|
||||
logging.info("%s transitioned to state %d, reason %d",
|
||||
console.uuid, console.state[0], console.state[1])
|
||||
|
||||
# main
|
||||
if len(sys.argv) != 3:
|
||||
print "Usage:", sys.argv[0], "URI UUID"
|
||||
print "for example:", sys.argv[0], "'qemu:///system' '32ad945f-7e78-c33a-e96d-39f25e025d81'"
|
||||
sys.exit(1)
|
||||
|
||||
uri = sys.argv[1]
|
||||
uuid = sys.argv[2]
|
||||
|
||||
print "Escape character is ^]"
|
||||
logging.basicConfig(filename='msg.log', level=logging.DEBUG)
|
||||
logging.info("URI: %s", uri)
|
||||
logging.info("UUID: %s", uuid)
|
||||
|
||||
libvirt.virEventRegisterDefaultImpl()
|
||||
libvirt.registerErrorHandler(error_handler, None)
|
||||
|
||||
atexit.register(reset_term)
|
||||
attrs = termios.tcgetattr(0)
|
||||
tty.setraw(0)
|
||||
|
||||
console = Console(uri, uuid)
|
||||
console.stdin_watch = libvirt.virEventAddHandle(0, libvirt.VIR_EVENT_HANDLE_READABLE, stdin_callback, console)
|
||||
|
||||
while check_console(console):
|
||||
libvirt.virEventRunDefaultImpl()
|
@@ -43,7 +43,7 @@ try:
|
||||
dom = conn.lookupByName(name)
|
||||
# Annoyiingly, libvirt prints its own error message here
|
||||
except libvirt.libvirtError:
|
||||
print "Domain %s is not running" % name
|
||||
print "Domain %s is not runing" % name
|
||||
sys.exit(0)
|
||||
|
||||
info = dom.info()
|
||||
|