diff options
author | Tudor Florea <tudor.florea@enea.com> | 2014-10-10 03:20:07 +0200 |
---|---|---|
committer | Tudor Florea <tudor.florea@enea.com> | 2014-10-10 03:20:07 +0200 |
commit | ee97d3d279164f8b44fb8afc997e4ae953d17106 (patch) | |
tree | bff0bd4240f00bbb21624c1df55583f61abaea25 /recipes-extended/libvirt | |
download | meta-virtualization-ee97d3d279164f8b44fb8afc997e4ae953d17106.tar.gz |
initial commit for Enea Linux 4.0-140929daisy-140929
Migrated from the internal git server on the daisy-enea-point-release branch
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'recipes-extended/libvirt')
11 files changed, 1186 insertions, 0 deletions
diff --git a/recipes-extended/libvirt/libvirt-python.inc b/recipes-extended/libvirt/libvirt-python.inc new file mode 100644 index 00000000..195a9dee --- /dev/null +++ b/recipes-extended/libvirt/libvirt-python.inc | |||
@@ -0,0 +1,55 @@ | |||
1 | inherit pythonnative python-dir | ||
2 | |||
3 | export STAGING_INCDIR | ||
4 | export STAGING_LIBDIR | ||
5 | export BUILD_SYS | ||
6 | export HOST_SYS | ||
7 | |||
8 | RDEPENDS_${PN}-python += "python" | ||
9 | PACKAGECONFIG_${PN}-python[xen] = ",,,xen-python" | ||
10 | |||
11 | PACKAGES += "${PN}-python-staticdev ${PN}-python-dev ${PN}-python-dbg ${PN}-python" | ||
12 | |||
13 | FILES_${PN}-python-staticdev += "${PYTHON_SITEPACKAGES_DIR}/*.a" | ||
14 | FILES_${PN}-python-dev += "${PYTHON_SITEPACKAGES_DIR}/*.la" | ||
15 | FILES_${PN}-python-dbg += "${PYTHON_SITEPACKAGES_DIR}/.debug/" | ||
16 | FILES_${PN}-python = "${bindir}/* ${libdir}/* ${libdir}/${PYTHON_DIR}/*" | ||
17 | |||
18 | SRC_URI += "http://libvirt.org/sources/python/libvirt-python-${PV}.tar.gz;name=libvirt_python" | ||
19 | SRC_URI += "file://libvirt_api_xml_path.patch;patchdir=../libvirt-python-${PV}" | ||
20 | |||
21 | SRC_URI[libvirt_python.md5sum] = "cd3b75c0eb64e933f0b648fbdca6e868" | ||
22 | SRC_URI[libvirt_python.sha256sum] = "94d79d662b6010f6c688b8856b2d95077736d48ffa35feed5a339d7fafbf8c39" | ||
23 | |||
24 | export LIBVIRT_API_PATH = "${S}/docs/libvirt-api.xml" | ||
25 | export LIBVIRT_CFLAGS = "-I${S}/include" | ||
26 | export LIBVIRT_LIBS = "-L${S}/src/.libs -lvirt -ldl" | ||
27 | export LDFLAGS="-L${S}/src/.libs" | ||
28 | |||
29 | LIBVIRT_INSTALL_ARGS = "--root=${D} \ | ||
30 | --prefix=${prefix} \ | ||
31 | --install-lib=${PYTHON_SITEPACKAGES_DIR} \ | ||
32 | --install-data=${datadir}" | ||
33 | |||
34 | python __anonymous () { | ||
35 | pkgconfig = d.getVar('PACKAGECONFIG', True) | ||
36 | if ('python') in pkgconfig.split(): | ||
37 | d.setVar('LIBVIRT_PYTHON_ENABLE', '1') | ||
38 | else: | ||
39 | d.setVar('LIBVIRT_PYTHON_ENABLE', '0') | ||
40 | } | ||
41 | |||
42 | do_compile_append() { | ||
43 | if [ "${LIBVIRT_PYTHON_ENABLE}" = "1" ]; then | ||
44 | cd ${WORKDIR}/libvirt-python-${PV} && \ | ||
45 | ${STAGING_BINDIR_NATIVE}/python-native/python setup.py build | ||
46 | fi | ||
47 | } | ||
48 | |||
49 | do_install_append() { | ||
50 | if [ "${LIBVIRT_PYTHON_ENABLE}" = "1" ]; then | ||
51 | cd ${WORKDIR}/${PN}-python-${PV} && \ | ||
52 | ${STAGING_BINDIR_NATIVE}/python-native/python setup.py install \ | ||
53 | --install-lib=${D}/${PYTHON_SITEPACKAGES_DIR} ${LIBVIRT_INSTALL_ARGS} | ||
54 | fi | ||
55 | } | ||
diff --git a/recipes-extended/libvirt/libvirt/dnsmasq_exclude_virbr.conf b/recipes-extended/libvirt/libvirt/dnsmasq_exclude_virbr.conf new file mode 100644 index 00000000..16bf1986 --- /dev/null +++ b/recipes-extended/libvirt/libvirt/dnsmasq_exclude_virbr.conf | |||
@@ -0,0 +1 @@ | |||
except-interface=virbr0 | |||
diff --git a/recipes-extended/libvirt/libvirt/libvirt-1.0.3-fix-thread-safety-in-lxc-callback-handling.patch b/recipes-extended/libvirt/libvirt/libvirt-1.0.3-fix-thread-safety-in-lxc-callback-handling.patch new file mode 100644 index 00000000..558d5ef6 --- /dev/null +++ b/recipes-extended/libvirt/libvirt/libvirt-1.0.3-fix-thread-safety-in-lxc-callback-handling.patch | |||
@@ -0,0 +1,63 @@ | |||
1 | From ad5d9cee87357f9f38f62583119606ef95ba10df Mon Sep 17 00:00:00 2001 | ||
2 | From: Bogdan Purcareata <bogdan.purcareata@freescale.com> | ||
3 | Date: Fri, 24 May 2013 16:46:00 +0300 | ||
4 | Subject: [PATCH] Fix thread safety in LXC callback handling | ||
5 | |||
6 | Signed-off-by: Bogdan Purcareata <bogdan.purcareata@freescale.com> | ||
7 | --- | ||
8 | src/lxc/lxc_process.c | 18 +++++++++++++++++- | ||
9 | 1 file changed, 17 insertions(+), 1 deletion(-) | ||
10 | |||
11 | diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c | ||
12 | index aaa81a7..0eadc67 100644 | ||
13 | --- a/src/lxc/lxc_process.c | ||
14 | +++ b/src/lxc/lxc_process.c | ||
15 | @@ -609,8 +609,13 @@ static void virLXCProcessMonitorExitNotify(virLXCMonitorPtr mon ATTRIBUTE_UNUSED | ||
16 | virLXCProtocolExitStatus status, | ||
17 | virDomainObjPtr vm) | ||
18 | { | ||
19 | + virLXCDriverPtr driver = lxc_driver; | ||
20 | virLXCDomainObjPrivatePtr priv = vm->privateData; | ||
21 | |||
22 | + lxcDriverLock(driver); | ||
23 | + virObjectLock(vm); | ||
24 | + lxcDriverUnlock(driver); | ||
25 | + | ||
26 | switch (status) { | ||
27 | case VIR_LXC_PROTOCOL_EXIT_STATUS_SHUTDOWN: | ||
28 | priv->stopReason = VIR_DOMAIN_EVENT_STOPPED_SHUTDOWN; | ||
29 | @@ -628,6 +633,8 @@ static void virLXCProcessMonitorExitNotify(virLXCMonitorPtr mon ATTRIBUTE_UNUSED | ||
30 | } | ||
31 | VIR_DEBUG("Domain shutoff reason %d (from status %d)", | ||
32 | priv->stopReason, status); | ||
33 | + | ||
34 | + virObjectUnlock(vm); | ||
35 | } | ||
36 | |||
37 | /* XXX a little evil */ | ||
38 | @@ -636,12 +643,21 @@ static void virLXCProcessMonitorInitNotify(virLXCMonitorPtr mon ATTRIBUTE_UNUSED | ||
39 | pid_t initpid, | ||
40 | virDomainObjPtr vm) | ||
41 | { | ||
42 | - virLXCDomainObjPrivatePtr priv = vm->privateData; | ||
43 | + virLXCDriverPtr driver = lxc_driver; | ||
44 | + virLXCDomainObjPrivatePtr priv; | ||
45 | + | ||
46 | + lxcDriverLock(driver); | ||
47 | + virObjectLock(vm); | ||
48 | + lxcDriverUnlock(driver); | ||
49 | + | ||
50 | + priv = vm->privateData; | ||
51 | priv->initpid = initpid; | ||
52 | virDomainAuditInit(vm, initpid); | ||
53 | |||
54 | if (virDomainSaveStatus(lxc_driver->caps, lxc_driver->stateDir, vm) < 0) | ||
55 | VIR_WARN("Cannot update XML with PID for LXC %s", vm->def->name); | ||
56 | + | ||
57 | + virObjectUnlock(vm); | ||
58 | } | ||
59 | |||
60 | static virLXCMonitorCallbacks monitorCallbacks = { | ||
61 | -- | ||
62 | 1.7.11.7 | ||
63 | |||
diff --git a/recipes-extended/libvirt/libvirt/libvirt_api_xml_path.patch b/recipes-extended/libvirt/libvirt/libvirt_api_xml_path.patch new file mode 100644 index 00000000..0aa3bde2 --- /dev/null +++ b/recipes-extended/libvirt/libvirt/libvirt_api_xml_path.patch | |||
@@ -0,0 +1,89 @@ | |||
1 | Adding support for LIBVIRT_CFLAGS and LIBVIRT_LIBS | ||
2 | |||
3 | Signed-off-by: Amy Fong <amy.fong@windriver.com> | ||
4 | |||
5 | |||
6 | Adding a support for LIBVIRT_API_PATH evironment variable, which can | ||
7 | control where the script should look for the 'libvirt-api.xml' file. | ||
8 | This allows building libvirt-python against different libvirt than the | ||
9 | one installed in the system. This may be used for example in autotest | ||
10 | or by packagers without the need to install libvirt into the system. | ||
11 | |||
12 | Signed-off-by: Martin Kletzander <mkletzan redhat com> | ||
13 | --- | ||
14 | setup.py | 25 ++++++++++++++++++++++--- | ||
15 | 1 file changed, 22 insertions(+), 3 deletions(-) | ||
16 | |||
17 | Index: libvirt-python-1.2.1/setup.py | ||
18 | =================================================================== | ||
19 | --- libvirt-python-1.2.1.orig/setup.py | ||
20 | +++ libvirt-python-1.2.1/setup.py | ||
21 | @@ -30,18 +30,19 @@ | ||
22 | if pkgcfg is None: | ||
23 | raise Exception("pkg-config binary is required to compile libvirt-python") | ||
24 | |||
25 | -spawn([pkgcfg, | ||
26 | - "--print-errors", | ||
27 | - "--atleast-version=%s" % MIN_LIBVIRT, | ||
28 | - "libvirt"]) | ||
29 | +# spawn([pkgcfg, | ||
30 | +# "--print-errors", | ||
31 | +# "--atleast-version=%s" % MIN_LIBVIRT, | ||
32 | +# "libvirt"]) | ||
33 | |||
34 | have_libvirt_lxc=True | ||
35 | -try: | ||
36 | - spawn([pkgcfg, | ||
37 | - "--atleast-version=%s" % MIN_LIBVIRT_LXC, | ||
38 | - "libvirt"]) | ||
39 | -except DistutilsExecError: | ||
40 | - have_libvirt_lxc=False | ||
41 | +# try: | ||
42 | +# spawn([pkgcfg, | ||
43 | +# "--atleast-version=%s" % MIN_LIBVIRT_LXC, | ||
44 | +# "libvirt"]) | ||
45 | +# except DistutilsExecError: | ||
46 | +# have_libvirt_lxc=False | ||
47 | +have_libvirt_lxc=True | ||
48 | |||
49 | def get_pkgconfig_data(args, mod, required=True): | ||
50 | """Run pkg-config to and return content associated with it""" | ||
51 | @@ -63,7 +64,17 @@ | ||
52 | """Check with pkg-config that libvirt is present and extract | ||
53 | the API XML file paths we need from it""" | ||
54 | |||
55 | - libvirt_api = get_pkgconfig_data(["--variable", "libvirt_api"], "libvirt") | ||
56 | + libvirt_api = os.getenv("LIBVIRT_API_PATH") | ||
57 | + | ||
58 | + if libvirt_api: | ||
59 | + if not libvirt_api.endswith("-api.xml"): | ||
60 | + raise ValueError("Invalid path '%s' for API XML" % libvirt_api) | ||
61 | + if not os.path.exists(libvirt_api): | ||
62 | + raise ValueError("API XML '%s' does not exist, " | ||
63 | + "have you built libvirt?" % libvirt_api) | ||
64 | + else: | ||
65 | + libvirt_api = get_pkgconfig_data(["--variable", "libvirt_api"], | ||
66 | + "libvirt") | ||
67 | |||
68 | offset = libvirt_api.index("-api.xml") | ||
69 | libvirt_qemu_api = libvirt_api[0:offset] + "-qemu-api.xml" | ||
70 | @@ -73,8 +84,17 @@ | ||
71 | |||
72 | return (libvirt_api, libvirt_qemu_api, libvirt_lxc_api) | ||
73 | |||
74 | -ldflags = get_pkgconfig_data(["--libs-only-L"], "libvirt", False) | ||
75 | -cflags = get_pkgconfig_data(["--cflags"], "libvirt", False) | ||
76 | +libvirt_cflags = os.getenv("LIBVIRT_CFLAGS") | ||
77 | +if libvirt_cflags: | ||
78 | + cflags = libvirt_cflags | ||
79 | +else: | ||
80 | + cflags = get_pkgconfig_data(["--cflags"], "libvirt", False) | ||
81 | + | ||
82 | +libvirt_libs = os.getenv("LIBVIRT_LIBS") | ||
83 | +if libvirt_libs: | ||
84 | + ldflags = libvirt_libs | ||
85 | +else: | ||
86 | + ldflags = get_pkgconfig_data(["--libs-only-L"], "libvirt", False) | ||
87 | |||
88 | c_modules = [] | ||
89 | py_modules = [] | ||
diff --git a/recipes-extended/libvirt/libvirt/libvirtd.conf b/recipes-extended/libvirt/libvirt/libvirtd.conf new file mode 100644 index 00000000..c0462b47 --- /dev/null +++ b/recipes-extended/libvirt/libvirt/libvirtd.conf | |||
@@ -0,0 +1,393 @@ | |||
1 | # Master libvirt daemon configuration file | ||
2 | # | ||
3 | # For further information consult http://libvirt.org/format.html | ||
4 | # | ||
5 | # NOTE: the tests/daemon-conf regression test script requires | ||
6 | # that each "PARAMETER = VALUE" line in this file have the parameter | ||
7 | # name just after a leading "#". | ||
8 | |||
9 | ################################################################# | ||
10 | # | ||
11 | # Network connectivity controls | ||
12 | # | ||
13 | |||
14 | # Flag listening for secure TLS connections on the public TCP/IP port. | ||
15 | # NB, must pass the --listen flag to the libvirtd process for this to | ||
16 | # have any effect. | ||
17 | # | ||
18 | # It is necessary to setup a CA and issue server certificates before | ||
19 | # using this capability. | ||
20 | # | ||
21 | # This is enabled by default, uncomment this to disable it | ||
22 | listen_tls = 0 | ||
23 | |||
24 | # Listen for unencrypted TCP connections on the public TCP/IP port. | ||
25 | # NB, must pass the --listen flag to the libvirtd process for this to | ||
26 | # have any effect. | ||
27 | # | ||
28 | # Using the TCP socket requires SASL authentication by default. Only | ||
29 | # SASL mechanisms which support data encryption are allowed. This is | ||
30 | # DIGEST_MD5 and GSSAPI (Kerberos5) | ||
31 | # | ||
32 | # This is disabled by default, uncomment this to enable it. | ||
33 | listen_tcp = 1 | ||
34 | |||
35 | |||
36 | |||
37 | # Override the port for accepting secure TLS connections | ||
38 | # This can be a port number, or service name | ||
39 | # | ||
40 | #tls_port = "16514" | ||
41 | |||
42 | # Override the port for accepting insecure TCP connections | ||
43 | # This can be a port number, or service name | ||
44 | # | ||
45 | #tcp_port = "16509" | ||
46 | |||
47 | |||
48 | # Override the default configuration which binds to all network | ||
49 | # interfaces. This can be a numeric IPv4/6 address, or hostname | ||
50 | # | ||
51 | #listen_addr = "192.168.0.1" | ||
52 | |||
53 | |||
54 | # Flag toggling mDNS advertizement of the libvirt service. | ||
55 | # | ||
56 | # Alternatively can disable for all services on a host by | ||
57 | # stopping the Avahi daemon | ||
58 | # | ||
59 | # This is enabled by default, uncomment this to disable it | ||
60 | #mdns_adv = 0 | ||
61 | |||
62 | # Override the default mDNS advertizement name. This must be | ||
63 | # unique on the immediate broadcast network. | ||
64 | # | ||
65 | # The default is "Virtualization Host HOSTNAME", where HOSTNAME | ||
66 | # is subsituted for the short hostname of the machine (without domain) | ||
67 | # | ||
68 | #mdns_name = "Virtualization Host Joe Demo" | ||
69 | |||
70 | |||
71 | ################################################################# | ||
72 | # | ||
73 | # UNIX socket access controls | ||
74 | # | ||
75 | |||
76 | # Set the UNIX domain socket group ownership. This can be used to | ||
77 | # allow a 'trusted' set of users access to management capabilities | ||
78 | # without becoming root. | ||
79 | # | ||
80 | # This is restricted to 'root' by default. | ||
81 | #unix_sock_group = "libvirt" | ||
82 | |||
83 | # Set the UNIX socket permissions for the R/O socket. This is used | ||
84 | # for monitoring VM status only | ||
85 | # | ||
86 | # Default allows any user. If setting group ownership may want to | ||
87 | # restrict this to: | ||
88 | #unix_sock_ro_perms = "0777" | ||
89 | |||
90 | # Set the UNIX socket permissions for the R/W socket. This is used | ||
91 | # for full management of VMs | ||
92 | # | ||
93 | # Default allows only root. If PolicyKit is enabled on the socket, | ||
94 | # the default will change to allow everyone (eg, 0777) | ||
95 | # | ||
96 | # If not using PolicyKit and setting group ownership for access | ||
97 | # control then you may want to relax this to: | ||
98 | #unix_sock_rw_perms = "0770" | ||
99 | |||
100 | # Set the name of the directory in which sockets will be found/created. | ||
101 | #unix_sock_dir = "/var/run/libvirt" | ||
102 | |||
103 | ################################################################# | ||
104 | # | ||
105 | # Authentication. | ||
106 | # | ||
107 | # - none: do not perform auth checks. If you can connect to the | ||
108 | # socket you are allowed. This is suitable if there are | ||
109 | # restrictions on connecting to the socket (eg, UNIX | ||
110 | # socket permissions), or if there is a lower layer in | ||
111 | # the network providing auth (eg, TLS/x509 certificates) | ||
112 | # | ||
113 | # - sasl: use SASL infrastructure. The actual auth scheme is then | ||
114 | # controlled from /etc/sasl2/libvirt.conf. For the TCP | ||
115 | # socket only GSSAPI & DIGEST-MD5 mechanisms will be used. | ||
116 | # For non-TCP or TLS sockets, any scheme is allowed. | ||
117 | # | ||
118 | # - polkit: use PolicyKit to authenticate. This is only suitable | ||
119 | # for use on the UNIX sockets. The default policy will | ||
120 | # require a user to supply their own password to gain | ||
121 | # full read/write access (aka sudo like), while anyone | ||
122 | # is allowed read/only access. | ||
123 | # | ||
124 | # Set an authentication scheme for UNIX read-only sockets | ||
125 | # By default socket permissions allow anyone to connect | ||
126 | # | ||
127 | # To restrict monitoring of domains you may wish to enable | ||
128 | # an authentication mechanism here | ||
129 | #auth_unix_ro = "none" | ||
130 | |||
131 | # Set an authentication scheme for UNIX read-write sockets | ||
132 | # By default socket permissions only allow root. If PolicyKit | ||
133 | # support was compiled into libvirt, the default will be to | ||
134 | # use 'polkit' auth. | ||
135 | # | ||
136 | # If the unix_sock_rw_perms are changed you may wish to enable | ||
137 | # an authentication mechanism here | ||
138 | #auth_unix_rw = "none" | ||
139 | |||
140 | # Change the authentication scheme for TCP sockets. | ||
141 | # | ||
142 | # If you don't enable SASL, then all TCP traffic is cleartext. | ||
143 | # Don't do this outside of a dev/test scenario. For real world | ||
144 | # use, always enable SASL and use the GSSAPI or DIGEST-MD5 | ||
145 | # mechanism in /etc/sasl2/libvirt.conf | ||
146 | #auth_tcp = "sasl" | ||
147 | |||
148 | # Change the authentication scheme for TLS sockets. | ||
149 | # | ||
150 | # TLS sockets already have encryption provided by the TLS | ||
151 | # layer, and limited authentication is done by certificates | ||
152 | # | ||
153 | # It is possible to make use of any SASL authentication | ||
154 | # mechanism as well, by using 'sasl' for this option | ||
155 | #auth_tls = "none" | ||
156 | |||
157 | |||
158 | |||
159 | ################################################################# | ||
160 | # | ||
161 | # TLS x509 certificate configuration | ||
162 | # | ||
163 | |||
164 | |||
165 | # Override the default server key file path | ||
166 | # | ||
167 | #key_file = "/etc/pki/libvirt/private/serverkey.pem" | ||
168 | |||
169 | # Override the default server certificate file path | ||
170 | # | ||
171 | #cert_file = "/etc/pki/libvirt/servercert.pem" | ||
172 | |||
173 | # Override the default CA certificate path | ||
174 | # | ||
175 | #ca_file = "/etc/pki/CA/cacert.pem" | ||
176 | |||
177 | # Specify a certificate revocation list. | ||
178 | # | ||
179 | # Defaults to not using a CRL, uncomment to enable it | ||
180 | #crl_file = "/etc/pki/CA/crl.pem" | ||
181 | |||
182 | |||
183 | |||
184 | ################################################################# | ||
185 | # | ||
186 | # Authorization controls | ||
187 | # | ||
188 | |||
189 | |||
190 | # Flag to disable verification of our own server certificates | ||
191 | # | ||
192 | # When libvirtd starts it performs some sanity checks against | ||
193 | # its own certificates. | ||
194 | # | ||
195 | # Default is to always run sanity checks. Uncommenting this | ||
196 | # will disable sanity checks which is not a good idea | ||
197 | #tls_no_sanity_certificate = 1 | ||
198 | |||
199 | # Flag to disable verification of client certificates | ||
200 | # | ||
201 | # Client certificate verification is the primary authentication mechanism. | ||
202 | # Any client which does not present a certificate signed by the CA | ||
203 | # will be rejected. | ||
204 | # | ||
205 | # Default is to always verify. Uncommenting this will disable | ||
206 | # verification - make sure an IP whitelist is set | ||
207 | #tls_no_verify_certificate = 1 | ||
208 | |||
209 | |||
210 | # A whitelist of allowed x509 Distinguished Names | ||
211 | # This list may contain wildcards such as | ||
212 | # | ||
213 | # "C=GB,ST=London,L=London,O=Red Hat,CN=*" | ||
214 | # | ||
215 | # See the POSIX fnmatch function for the format of the wildcards. | ||
216 | # | ||
217 | # NB If this is an empty list, no client can connect, so comment out | ||
218 | # entirely rather than using empty list to disable these checks | ||
219 | # | ||
220 | # By default, no DN's are checked | ||
221 | #tls_allowed_dn_list = ["DN1", "DN2"] | ||
222 | |||
223 | |||
224 | # A whitelist of allowed SASL usernames. The format for usernames | ||
225 | # depends on the SASL authentication mechanism. Kerberos usernames | ||
226 | # look like username@REALM | ||
227 | # | ||
228 | # This list may contain wildcards such as | ||
229 | # | ||
230 | # "*@EXAMPLE.COM" | ||
231 | # | ||
232 | # See the POSIX fnmatch function for the format of the wildcards. | ||
233 | # | ||
234 | # NB If this is an empty list, no client can connect, so comment out | ||
235 | # entirely rather than using empty list to disable these checks | ||
236 | # | ||
237 | # By default, no Username's are checked | ||
238 | #sasl_allowed_username_list = ["joe@EXAMPLE.COM", "fred@EXAMPLE.COM" ] | ||
239 | |||
240 | |||
241 | |||
242 | ################################################################# | ||
243 | # | ||
244 | # Processing controls | ||
245 | # | ||
246 | |||
247 | # The maximum number of concurrent client connections to allow | ||
248 | # over all sockets combined. | ||
249 | #max_clients = 20 | ||
250 | |||
251 | |||
252 | # The minimum limit sets the number of workers to start up | ||
253 | # initially. If the number of active clients exceeds this, | ||
254 | # then more threads are spawned, upto max_workers limit. | ||
255 | # Typically you'd want max_workers to equal maximum number | ||
256 | # of clients allowed | ||
257 | #min_workers = 5 | ||
258 | #max_workers = 20 | ||
259 | |||
260 | |||
261 | # The number of priority workers. If all workers from above | ||
262 | # pool will stuck, some calls marked as high priority | ||
263 | # (notably domainDestroy) can be executed in this pool. | ||
264 | #prio_workers = 5 | ||
265 | |||
266 | # Total global limit on concurrent RPC calls. Should be | ||
267 | # at least as large as max_workers. Beyond this, RPC requests | ||
268 | # will be read into memory and queued. This directly impact | ||
269 | # memory usage, currently each request requires 256 KB of | ||
270 | # memory. So by default upto 5 MB of memory is used | ||
271 | # | ||
272 | # XXX this isn't actually enforced yet, only the per-client | ||
273 | # limit is used so far | ||
274 | #max_requests = 20 | ||
275 | |||
276 | # Limit on concurrent requests from a single client | ||
277 | # connection. To avoid one client monopolizing the server | ||
278 | # this should be a small fraction of the global max_requests | ||
279 | # and max_workers parameter | ||
280 | #max_client_requests = 5 | ||
281 | |||
282 | ################################################################# | ||
283 | # | ||
284 | # Logging controls | ||
285 | # | ||
286 | |||
287 | # Logging level: 4 errors, 3 warnings, 2 information, 1 debug | ||
288 | # basically 1 will log everything possible | ||
289 | #log_level = 3 | ||
290 | |||
291 | # Logging filters: | ||
292 | # A filter allows to select a different logging level for a given category | ||
293 | # of logs | ||
294 | # The format for a filter is: | ||
295 | # x:name | ||
296 | # where name is a match string e.g. remote or qemu | ||
297 | # the x prefix is the minimal level where matching messages should be logged | ||
298 | # 1: DEBUG | ||
299 | # 2: INFO | ||
300 | # 3: WARNING | ||
301 | # 4: ERROR | ||
302 | # | ||
303 | # Multiple filter can be defined in a single @filters, they just need to be | ||
304 | # separated by spaces. | ||
305 | # | ||
306 | # e.g: | ||
307 | # log_filters="3:remote 4:event" | ||
308 | # to only get warning or errors from the remote layer and only errors from | ||
309 | # the event layer. | ||
310 | |||
311 | # Logging outputs: | ||
312 | # An output is one of the places to save logging information | ||
313 | # The format for an output can be: | ||
314 | # x:stderr | ||
315 | # output goes to stderr | ||
316 | # x:syslog:name | ||
317 | # use syslog for the output and use the given name as the ident | ||
318 | # x:file:file_path | ||
319 | # output to a file, with the given filepath | ||
320 | # In all case the x prefix is the minimal level, acting as a filter | ||
321 | # 1: DEBUG | ||
322 | # 2: INFO | ||
323 | # 3: WARNING | ||
324 | # 4: ERROR | ||
325 | # | ||
326 | # Multiple output can be defined, they just need to be separated by spaces. | ||
327 | # e.g.: | ||
328 | # log_outputs="3:syslog:libvirtd" | ||
329 | # to log all warnings and errors to syslog under the libvirtd ident | ||
330 | |||
331 | # Log debug buffer size: default 64 | ||
332 | # The daemon keeps an internal debug log buffer which will be dumped in case | ||
333 | # of crash or upon receiving a SIGUSR2 signal. This setting allows to override | ||
334 | # the default buffer size in kilobytes. | ||
335 | # If value is 0 or less the debug log buffer is deactivated | ||
336 | #log_buffer_size = 64 | ||
337 | |||
338 | |||
339 | ################################################################## | ||
340 | # | ||
341 | # Auditing | ||
342 | # | ||
343 | # This setting allows usage of the auditing subsystem to be altered: | ||
344 | # | ||
345 | # audit_level == 0 -> disable all auditing | ||
346 | # audit_level == 1 -> enable auditing, only if enabled on host (default) | ||
347 | # audit_level == 2 -> enable auditing, and exit if disabled on host | ||
348 | # | ||
349 | #audit_level = 2 | ||
350 | # | ||
351 | # If set to 1, then audit messages will also be sent | ||
352 | # via libvirt logging infrastructure. Defaults to 0 | ||
353 | # | ||
354 | #audit_logging = 1 | ||
355 | |||
356 | ################################################################### | ||
357 | # UUID of the host: | ||
358 | # Provide the UUID of the host here in case the command | ||
359 | # 'dmidecode -s system-uuid' does not provide a valid uuid. In case | ||
360 | # 'dmidecode' does not provide a valid UUID and none is provided here, a | ||
361 | # temporary UUID will be generated. | ||
362 | # Keep the format of the example UUID below. UUID must not have all digits | ||
363 | # be the same. | ||
364 | |||
365 | # NB This default all-zeros UUID will not work. Replace | ||
366 | # it with the output of the 'uuidgen' command and then | ||
367 | # uncomment this entry | ||
368 | #host_uuid = "00000000-0000-0000-0000-000000000000" | ||
369 | |||
370 | ################################################################### | ||
371 | # Keepalive protocol: | ||
372 | # This allows libvirtd to detect broken client connections or even | ||
373 | # dead client. A keepalive message is sent to a client after | ||
374 | # keepalive_interval seconds of inactivity to check if the client is | ||
375 | # still responding; keepalive_count is a maximum number of keepalive | ||
376 | # messages that are allowed to be sent to the client without getting | ||
377 | # any response before the connection is considered broken. In other | ||
378 | # words, the connection is automatically closed approximately after | ||
379 | # keepalive_interval * (keepalive_count + 1) seconds since the last | ||
380 | # message received from the client. If keepalive_interval is set to | ||
381 | # -1, libvirtd will never send keepalive requests; however clients | ||
382 | # can still send them and the deamon will send responses. When | ||
383 | # keepalive_count is set to 0, connections will be automatically | ||
384 | # closed after keepalive_interval seconds of inactivity without | ||
385 | # sending any keepalive messages. | ||
386 | # | ||
387 | #keepalive_interval = 5 | ||
388 | #keepalive_count = 5 | ||
389 | # | ||
390 | # If set to 1, libvirtd will refuse to talk to clients that do not | ||
391 | # support keepalive protocol. Defaults to 0. | ||
392 | # | ||
393 | #keepalive_required = 1 | ||
diff --git a/recipes-extended/libvirt/libvirt/libvirtd.sh b/recipes-extended/libvirt/libvirt/libvirtd.sh new file mode 100755 index 00000000..29dbf391 --- /dev/null +++ b/recipes-extended/libvirt/libvirt/libvirtd.sh | |||
@@ -0,0 +1,103 @@ | |||
1 | #!/bin/sh | ||
2 | ### BEGIN INIT INFO | ||
3 | # Provides: libvirtd | ||
4 | # Required-Start: $local_fs $network dbus | ||
5 | # Required-Stop: $local_fs $network dbus | ||
6 | # Default-Start: 2 3 4 5 | ||
7 | # Default-Stop: 0 1 6 | ||
8 | ### END INIT INFO | ||
9 | |||
10 | if [ -f /lib/lsb/init-functions ] | ||
11 | then | ||
12 | . /lib/lsb/init-functions | ||
13 | else | ||
14 | # int log_begin_message (char *message) | ||
15 | log_begin_msg () { | ||
16 | if [ -z "$1" ]; then | ||
17 | return 1 | ||
18 | fi | ||
19 | echo " * $@" | ||
20 | } | ||
21 | |||
22 | # int log_end_message (int exitstatus) | ||
23 | log_end_msg () { | ||
24 | |||
25 | # If no arguments were passed, return | ||
26 | [ -z "$1" ] && return 1 | ||
27 | |||
28 | # Only do the fancy stuff if we have an appropriate terminal | ||
29 | # and if /usr is already mounted | ||
30 | TPUT=/usr/bin/tput | ||
31 | EXPR=/usr/bin/expr | ||
32 | if [ -x $TPUT ] && [ -x $EXPR ] && $TPUT hpa 60 >/dev/null 2>&1; then | ||
33 | COLS=`$TPUT cols` | ||
34 | if [ -n "$COLS" ]; then | ||
35 | COL=`$EXPR $COLS - 7` | ||
36 | else | ||
37 | COL=73 | ||
38 | fi | ||
39 | UP=`$TPUT cuu1` | ||
40 | END=`$TPUT hpa $COL` | ||
41 | START=`$TPUT hpa 0` | ||
42 | RED=`$TPUT setaf 1` | ||
43 | NORMAL=`$TPUT op` | ||
44 | if [ $1 -eq 0 ]; then | ||
45 | echo "$UP$END[ ok ]" | ||
46 | else | ||
47 | echo -e "$UP$START $RED*$NORMAL$END[${RED}fail${NORMAL}]" | ||
48 | fi | ||
49 | else | ||
50 | if [ $1 -eq 0 ]; then | ||
51 | echo " ...done." | ||
52 | else | ||
53 | echo " ...fail!" | ||
54 | fi | ||
55 | fi | ||
56 | return $1 | ||
57 | } | ||
58 | |||
59 | log_warning_msg () { | ||
60 | if log_use_fancy_output; then | ||
61 | YELLOW=`$TPUT setaf 3` | ||
62 | NORMAL=`$TPUT op` | ||
63 | echo "$YELLOW*$NORMAL $@" | ||
64 | else | ||
65 | echo "$@" | ||
66 | fi | ||
67 | } | ||
68 | |||
69 | fi | ||
70 | |||
71 | case "$1" in | ||
72 | start) | ||
73 | if [ -e /var/run/libvirtd.pid ]; then | ||
74 | if [ -d /proc/$(cat /var/run/libvirtd.pid) ]; then | ||
75 | echo "virtualization library already started; not starting." | ||
76 | else | ||
77 | echo "Removing stale PID file /var/run/libvirtd.pid." | ||
78 | rm -f /var/run/libvirtd.pid | ||
79 | fi | ||
80 | fi | ||
81 | log_begin_msg "Starting virtualization library daemon: libvirtd" | ||
82 | if [ ! -e /var/run/libvirtd.pid ]; then | ||
83 | start-stop-daemon -K -x /usr/bin/dnsmasq --pidfile /var/run/libvirt/network/default.pid | ||
84 | fi | ||
85 | start-stop-daemon --start --quiet --pidfile /var/run/libvirtd.pid --exec /usr/sbin/libvirtd -- --daemon --listen | ||
86 | log_end_msg $? | ||
87 | ;; | ||
88 | stop) | ||
89 | log_begin_msg "Stopping virtualization library daemon: libvirtd" | ||
90 | start-stop-daemon --stop --quiet --retry 3 --exec /usr/sbin/libvirtd --pidfile /var/run/libvirtd.pid | ||
91 | log_end_msg $? | ||
92 | rm -f /var/run/libvirtd.pid | ||
93 | ;; | ||
94 | restart) | ||
95 | $0 stop | ||
96 | sleep 1 | ||
97 | $0 start | ||
98 | ;; | ||
99 | *) | ||
100 | echo "Usage: $0 {start|stop|restart}" | ||
101 | exit 1 | ||
102 | ;; | ||
103 | esac | ||
diff --git a/recipes-extended/libvirt/libvirt/qemu-fix-crash-in-qemuOpen.patch b/recipes-extended/libvirt/libvirt/qemu-fix-crash-in-qemuOpen.patch new file mode 100644 index 00000000..3cf9e839 --- /dev/null +++ b/recipes-extended/libvirt/libvirt/qemu-fix-crash-in-qemuOpen.patch | |||
@@ -0,0 +1,39 @@ | |||
1 | From 74bff2509080912ea8abf1de8fd95fa2412b659a Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com> | ||
3 | Date: Thu, 11 Apr 2013 11:37:25 +0200 | ||
4 | Subject: [PATCH] qemu: fix crash in qemuOpen | ||
5 | |||
6 | commit 74bff2509080912ea8abf1de8fd95fa2412b659a from upsteam | ||
7 | git://libvirt.org/libvirt.git | ||
8 | |||
9 | If the path part of connection URI is not present, cfg is used | ||
10 | unitialized. | ||
11 | |||
12 | https://bugzilla.redhat.com/show_bug.cgi?id=950855 | ||
13 | --- | ||
14 | src/qemu/qemu_driver.c | 2 +- | ||
15 | 1 files changed, 1 insertions(+), 1 deletions(-) | ||
16 | |||
17 | diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c | ||
18 | index 2c0d7d1..0d41e39 100644 | ||
19 | --- a/src/qemu/qemu_driver.c | ||
20 | +++ b/src/qemu/qemu_driver.c | ||
21 | @@ -1026,6 +1026,7 @@ static virDrvOpenStatus qemuOpen(virConnectPtr conn, | ||
22 | goto cleanup; | ||
23 | } | ||
24 | |||
25 | + cfg = virQEMUDriverGetConfig(qemu_driver); | ||
26 | if (conn->uri->path == NULL) { | ||
27 | virReportError(VIR_ERR_INTERNAL_ERROR, | ||
28 | _("no QEMU URI path given, try %s"), | ||
29 | @@ -1033,7 +1034,6 @@ static virDrvOpenStatus qemuOpen(virConnectPtr conn, | ||
30 | goto cleanup; | ||
31 | } | ||
32 | |||
33 | - cfg = virQEMUDriverGetConfig(qemu_driver); | ||
34 | if (cfg->privileged) { | ||
35 | if (STRNEQ(conn->uri->path, "/system") && | ||
36 | STRNEQ(conn->uri->path, "/session")) { | ||
37 | -- | ||
38 | 1.7.1 | ||
39 | |||
diff --git a/recipes-extended/libvirt/libvirt/run-ptest b/recipes-extended/libvirt/libvirt/run-ptest new file mode 100644 index 00000000..a434b186 --- /dev/null +++ b/recipes-extended/libvirt/libvirt/run-ptest | |||
@@ -0,0 +1,3 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | make -C tests -k check-TESTS | ||
diff --git a/recipes-extended/libvirt/libvirt/runptest.patch b/recipes-extended/libvirt/libvirt/runptest.patch new file mode 100644 index 00000000..0c019751 --- /dev/null +++ b/recipes-extended/libvirt/libvirt/runptest.patch | |||
@@ -0,0 +1,112 @@ | |||
1 | Add 'install-ptest' rule. | ||
2 | Change TESTS_ENVIRONMENT to allow running outside build dir. | ||
3 | |||
4 | Signed-off-by: Mihaela Sendrea <mihaela.sendrea@enea.com> | ||
5 | Upstream-status: Pending | ||
6 | |||
7 | diff -uNr a/tests/Makefile.am b/tests/Makefile.am | ||
8 | --- a/tests/Makefile.am 2014-03-11 11:37:31.497605736 +0200 | ||
9 | +++ b/tests/Makefile.am 2014-03-17 15:57:35.515268399 +0200 | ||
10 | @@ -27,9 +27,11 @@ | ||
11 | -I$(top_srcdir)/src/conf \ | ||
12 | $(GETTEXT_CPPFLAGS) | ||
13 | |||
14 | +PTEST_DIR ?= /usr/lib/libvirt/ptest | ||
15 | + | ||
16 | AM_CFLAGS = \ | ||
17 | - -Dabs_builddir="\"`pwd`\"" \ | ||
18 | - -Dabs_srcdir="\"`cd '$(srcdir)'; pwd`\"" \ | ||
19 | + -Dabs_builddir="\"$(PTEST_DIR)/tests\"" \ | ||
20 | + -Dabs_srcdir="\"$(PTEST_DIR)/tests\"" \ | ||
21 | $(LIBXML_CFLAGS) \ | ||
22 | $(GNUTLS_CFLAGS) \ | ||
23 | $(SASL_CFLAGS) \ | ||
24 | @@ -41,7 +43,7 @@ | ||
25 | |||
26 | if WITH_DRIVER_MODULES | ||
27 | INCLUDES += \ | ||
28 | - -DTEST_DRIVER_DIR=\"$(top_builddir)/src/.libs\" | ||
29 | + -DTEST_DRIVER_DIR=\"$(PTEST_DIR)/src/.libs\" | ||
30 | endif WITH_DRIVER_MODULES | ||
31 | |||
32 | PROBES_O = | ||
33 | @@ -344,20 +346,19 @@ | ||
34 | # Also, BSD sh doesn't like 'a=b b=$$a', so we can't use an | ||
35 | # intermediate shell variable, but must do all the expansion in make | ||
36 | |||
37 | -lv_abs_top_builddir=`cd '$(top_builddir)'; pwd` | ||
38 | path_add = $(subst :,$(PATH_SEPARATOR),\ | ||
39 | - $(subst !,$(lv_abs_top_builddir)/,!daemon:!tools:!tests)) | ||
40 | + $(subst !,$(PTEST_DIR)/,!daemon:!tools:!tests)) | ||
41 | |||
42 | VIR_TEST_EXPENSIVE ?= $(VIR_TEST_EXPENSIVE_DEFAULT) | ||
43 | TESTS_ENVIRONMENT = \ | ||
44 | - abs_top_builddir=$(lv_abs_top_builddir) \ | ||
45 | - abs_top_srcdir=`cd '$(top_srcdir)'; pwd` \ | ||
46 | - abs_builddir=`pwd` \ | ||
47 | - abs_srcdir=`cd '$(srcdir)'; pwd` \ | ||
48 | - CONFIG_HEADER="`cd '$(top_builddir)'; pwd`/config.h" \ | ||
49 | + abs_top_builddir="$(PTEST_DIR)" \ | ||
50 | + abs_top_srcdir="$(PTEST_DIR)" \ | ||
51 | + abs_builddir="$(PTEST_DIR)/tests" \ | ||
52 | + abs_srcdir="$(PTEST_DIR)/tests" \ | ||
53 | + CONFIG_HEADER="$(PTEST_DIR)/config.h" \ | ||
54 | PATH="$(path_add)$(PATH_SEPARATOR)$$PATH" \ | ||
55 | SHELL="$(SHELL)" \ | ||
56 | - LIBVIRT_DRIVER_DIR="$(lv_abs_top_builddir)/src/.libs" \ | ||
57 | + LIBVIRT_DRIVER_DIR="$(PTEST_DIR)/src/.libs" \ | ||
58 | LIBVIRT_AUTOSTART=0 \ | ||
59 | LC_ALL=C \ | ||
60 | VIR_TEST_EXPENSIVE=$(VIR_TEST_EXPENSIVE) \ | ||
61 | @@ -933,5 +934,51 @@ | ||
62 | EXTRA_DIST += object-locking.ml | ||
63 | endif ! WITH_CIL | ||
64 | |||
65 | +buildtest-TESTS: $(TESTS) $(test_libraries) $(test_helpers) | ||
66 | + | ||
67 | +PTESTS = $(TESTS) $(test_helpers) test-lib.sh schematestutils.sh | ||
68 | + | ||
69 | +install-ptest: | ||
70 | + list='$(TESTS) $(test_helpers) test-lib.sh schematestutils.sh' | ||
71 | + install -d $(DEST_DIR)/tools | ||
72 | + @(if [ -d ../tools/.libs ] ; then cd ../tools/.libs; fi; \ | ||
73 | + install * $(DEST_DIR)/tools) | ||
74 | + install -d $(DEST_DIR)/src/network | ||
75 | + cp ../src/network/*.xml $(DEST_DIR)/src/network | ||
76 | + install -d $(DEST_DIR)/src/cpu | ||
77 | + cp ../src/cpu/*.xml $(DEST_DIR)/src/cpu | ||
78 | + install ../src/libvirt_iohelper $(DEST_DIR)/src | ||
79 | + install -D ../daemon/libvirtd $(DEST_DIR)/daemon/libvirtd | ||
80 | + install -D ../daemon/libvirtd.conf $(DEST_DIR)/daemon/libvirtd.conf | ||
81 | + @(if [ -d ../daemon/.libs ] ; then cd ../daemon/.libs; fi; \ | ||
82 | + install * $(DEST_DIR)/daemon) | ||
83 | + install -d $(DEST_DIR)/src/.libs | ||
84 | + @(if [ -d ../src/.libs ] ; then cd ../src/.libs; fi; \ | ||
85 | + install * $(DEST_DIR)/src/.libs) | ||
86 | + install -d $(DEST_DIR)/docs/schemas | ||
87 | + cp ../docs/schemas/*.rng $(DEST_DIR)/docs/schemas | ||
88 | + cp -r ../build-aux $(DEST_DIR) | ||
89 | + install -d $(DEST_DIR)/examples/xml | ||
90 | + cp -r ../examples/xml/test $(DEST_DIR)/examples/xml | ||
91 | + install -d $(DEST_DIR)/tests/.libs | ||
92 | + find . -type d -name "*xml2xml*" -exec cp -r {} $(DEST_DIR)/tests \; | ||
93 | + find . -type d -name "*data" -exec cp -r {} $(DEST_DIR)/tests \; | ||
94 | + @(for file in $(PTESTS); do \ | ||
95 | + if [ -f .libs/$$file ]; then \ | ||
96 | + install .libs/$$file $(DEST_DIR)/tests; \ | ||
97 | + else \ | ||
98 | + install $$file $(DEST_DIR)/tests; \ | ||
99 | + fi; \ | ||
100 | + done;) | ||
101 | + @(if [ -d .libs ]; then install .libs/*.so $(DEST_DIR)/tests/.libs; fi;) | ||
102 | + cp ../config.h $(DEST_DIR) | ||
103 | + cp Makefile $(DEST_DIR)/tests | ||
104 | + sed -i -e 's/^Makefile:/_Makefile:/' $(DEST_DIR)/tests/Makefile | ||
105 | + cp ../Makefile $(DEST_DIR) | ||
106 | + sed -i -e 's|^Makefile:|_Makefile:|' $(DEST_DIR)/Makefile | ||
107 | + sed -i -e 's|$(BUILD_DIR)|$(PTEST_DIR)|g' $(DEST_DIR)/tests/Makefile | ||
108 | + sed -i -e 's|$(BUILD_DIR)|$(PTEST_DIR)|g' $(DEST_DIR)/Makefile | ||
109 | + sed -i -e 's|^\(.*\.log:\) \(.*EXEEXT.*\)|\1|g' $(DEST_DIR)/tests/Makefile | ||
110 | + | ||
111 | CLEANFILES = *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda *.cmi *.cmx \ | ||
112 | object-locking-files.txt | ||
diff --git a/recipes-extended/libvirt/libvirt/tools-add-libvirt-net-rpc-to-virt-host-validate-when.patch b/recipes-extended/libvirt/libvirt/tools-add-libvirt-net-rpc-to-virt-host-validate-when.patch new file mode 100644 index 00000000..91410449 --- /dev/null +++ b/recipes-extended/libvirt/libvirt/tools-add-libvirt-net-rpc-to-virt-host-validate-when.patch | |||
@@ -0,0 +1,112 @@ | |||
1 | From dade75d1ce25df6ab61867250d7adb65b4912090 Mon Sep 17 00:00:00 2001 | ||
2 | From: Bruce Ashfield <bruce.ashfield@windriver.com> | ||
3 | Date: Fri, 2 Aug 2013 11:38:43 -0400 | ||
4 | Subject: [PATCH] tools: add libvirt-net-rpc to virt-host-validate when TLS is | ||
5 | enabled | ||
6 | |||
7 | When gnu-tls is enabled for libvirt references to virNetTLSInit are | ||
8 | generated in libvirt. Any binaries linking against libvirt, must also | ||
9 | link against libvirt-net-rpc which provides the implementation. | ||
10 | |||
11 | Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> | ||
12 | --- | ||
13 | examples/dominfo/Makefile.am | 7 +++++++ | ||
14 | examples/domsuspend/Makefile.am | 7 +++++++ | ||
15 | examples/hellolibvirt/Makefile.am | 7 +++++++ | ||
16 | examples/openauth/Makefile.am | 6 ++++++ | ||
17 | tools/Makefile.am | 13 +++++++++++++ | ||
18 | 5 files changed, 40 insertions(+) | ||
19 | |||
20 | diff --git a/examples/dominfo/Makefile.am b/examples/dominfo/Makefile.am | ||
21 | index 4a30c7768df9..99b3e17eb741 100644 | ||
22 | --- a/examples/dominfo/Makefile.am | ||
23 | +++ b/examples/dominfo/Makefile.am | ||
24 | @@ -23,3 +23,10 @@ noinst_PROGRAMS=info1 | ||
25 | info1_SOURCES=info1.c | ||
26 | info1_LDFLAGS= | ||
27 | info1_LDADD= $(LDADDS) | ||
28 | + | ||
29 | +if WITH_GNUTLS | ||
30 | +info1_LDADD += $(top_builddir)/src/libvirt-net-rpc.la \ | ||
31 | + $(top_builddir)/gnulib/lib/libgnu.la \ | ||
32 | + $(NULL) | ||
33 | +endif | ||
34 | + | ||
35 | diff --git a/examples/domsuspend/Makefile.am b/examples/domsuspend/Makefile.am | ||
36 | index b8e65f24a28d..9553e0f1d948 100644 | ||
37 | --- a/examples/domsuspend/Makefile.am | ||
38 | +++ b/examples/domsuspend/Makefile.am | ||
39 | @@ -25,3 +25,10 @@ noinst_PROGRAMS=suspend | ||
40 | suspend_SOURCES=suspend.c | ||
41 | suspend_LDFLAGS= | ||
42 | suspend_LDADD= $(LDADDS) | ||
43 | + | ||
44 | +if WITH_GNUTLS | ||
45 | +suspend_LDADD += $(top_builddir)/src/libvirt-net-rpc.la \ | ||
46 | + $(top_builddir)/gnulib/lib/libgnu.la \ | ||
47 | + $(NULL) | ||
48 | +endif | ||
49 | + | ||
50 | diff --git a/examples/hellolibvirt/Makefile.am b/examples/hellolibvirt/Makefile.am | ||
51 | index 55ea972c42f8..a5272e2bb565 100644 | ||
52 | --- a/examples/hellolibvirt/Makefile.am | ||
53 | +++ b/examples/hellolibvirt/Makefile.am | ||
54 | @@ -19,3 +19,10 @@ noinst_PROGRAMS = hellolibvirt | ||
55 | hellolibvirt_CFLAGS = $(WARN_CFLAGS) | ||
56 | hellolibvirt_SOURCES = hellolibvirt.c | ||
57 | hellolibvirt_LDADD = $(top_builddir)/src/libvirt.la | ||
58 | + | ||
59 | +if WITH_GNUTLS | ||
60 | +hellolibvirt_LDADD += $(top_builddir)/src/libvirt-net-rpc.la \ | ||
61 | + $(top_builddir)/gnulib/lib/libgnu.la \ | ||
62 | + $(NULL) | ||
63 | +endif | ||
64 | + | ||
65 | diff --git a/examples/openauth/Makefile.am b/examples/openauth/Makefile.am | ||
66 | index 7bb860491e73..34e9b47f65cb 100644 | ||
67 | --- a/examples/openauth/Makefile.am | ||
68 | +++ b/examples/openauth/Makefile.am | ||
69 | @@ -19,3 +19,9 @@ noinst_PROGRAMS = openauth | ||
70 | openauth_CFLAGS = $(WARN_CFLAGS) | ||
71 | openauth_SOURCES = openauth.c | ||
72 | openauth_LDADD = $(top_builddir)/src/libvirt.la | ||
73 | +if WITH_GNUTLS | ||
74 | +openauth_LDADD += $(top_builddir)/src/libvirt-net-rpc.la \ | ||
75 | + $(top_builddir)/gnulib/lib/libgnu.la \ | ||
76 | + $(NULL) | ||
77 | +endif | ||
78 | + | ||
79 | diff --git a/tools/Makefile.am b/tools/Makefile.am | ||
80 | index 256a8f37a2a9..837a83fb612a 100644 | ||
81 | --- a/tools/Makefile.am | ||
82 | +++ b/tools/Makefile.am | ||
83 | @@ -147,6 +147,13 @@ virt_host_validate_LDADD = \ | ||
84 | ../gnulib/lib/libgnu.la \ | ||
85 | $(NULL) | ||
86 | |||
87 | +if WITH_GNUTLS | ||
88 | +virt_host_validate_LDADD += ../src/libvirt-net-rpc.la \ | ||
89 | + ../gnulib/lib/libgnu.la \ | ||
90 | + $(NULL) | ||
91 | +endif | ||
92 | + | ||
93 | + | ||
94 | virt_host_validate_CFLAGS = \ | ||
95 | $(WARN_CFLAGS) \ | ||
96 | $(PIE_CFLAGS) \ | ||
97 | @@ -214,6 +221,12 @@ virsh_CFLAGS = \ | ||
98 | $(READLINE_CFLAGS) | ||
99 | BUILT_SOURCES = | ||
100 | |||
101 | +if WITH_GNUTLS | ||
102 | +virsh_LDADD += ../src/libvirt-net-rpc.la \ | ||
103 | + ../gnulib/lib/libgnu.la \ | ||
104 | + $(NULL) | ||
105 | +endif | ||
106 | + | ||
107 | if WITH_WIN_ICON | ||
108 | virsh_LDADD += virsh_win_icon.$(OBJEXT) | ||
109 | |||
110 | -- | ||
111 | 1.8.1.2 | ||
112 | |||
diff --git a/recipes-extended/libvirt/libvirt_1.2.2.bb b/recipes-extended/libvirt/libvirt_1.2.2.bb new file mode 100644 index 00000000..0cd6b990 --- /dev/null +++ b/recipes-extended/libvirt/libvirt_1.2.2.bb | |||
@@ -0,0 +1,216 @@ | |||
1 | DESCRIPTION = "A toolkit to interact with the virtualization capabilities of recent versions of Linux." | ||
2 | HOMEPAGE = "http://libvirt.org" | ||
3 | LICENSE = "LGPLv2.1+" | ||
4 | LICENSE_${PN}-ptest = "GPLv2+ & LGPLv2.1" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ | ||
6 | file://COPYING.LESSER;md5=4fbd65380cdd255951079008b364516c" | ||
7 | SECTION = "console/tools" | ||
8 | PR = "r1" | ||
9 | |||
10 | DEPENDS = "bridge-utils gnutls libxml2 lvm2 avahi parted curl libpcap util-linux e2fsprogs pm-utils \ | ||
11 | iptables dnsmasq readline" | ||
12 | |||
13 | # libvirt-guests.sh needs gettext.sh | ||
14 | # | ||
15 | RDEPENDS_${PN} = "gettext-runtime" | ||
16 | |||
17 | RDEPENDS_${PN}-ptest += "make gawk" | ||
18 | |||
19 | RDEPENDS_libvirt-libvirtd += "bridge-utils iptables pm-utils dnsmasq netcat-openbsd" | ||
20 | RDEPENDS_libvirt-libvirtd_append_x86-64 = " dmidecode" | ||
21 | RDEPENDS_libvirt-libvirtd_append_x86 = " dmidecode" | ||
22 | |||
23 | #connman blocks the 53 port and libvirtd can't start its DNS service | ||
24 | RCONFLICTS_${PN}_libvirtd = "connman" | ||
25 | |||
26 | SRC_URI = "http://libvirt.org/sources/libvirt-${PV}.tar.gz;name=libvirt \ | ||
27 | file://tools-add-libvirt-net-rpc-to-virt-host-validate-when.patch \ | ||
28 | file://libvirtd.sh \ | ||
29 | file://libvirtd.conf \ | ||
30 | file://runptest.patch \ | ||
31 | file://run-ptest \ | ||
32 | " | ||
33 | |||
34 | SRC_URI[libvirt.md5sum] = "592958ad1ddce7574d8cb0a31e635acd" | ||
35 | SRC_URI[libvirt.sha256sum] = "a48377e307c5c21b67e43db99af909a23c33aff8cbbaa3361fd389eb047cbbc3" | ||
36 | |||
37 | inherit autotools gettext update-rc.d pkgconfig ptest | ||
38 | |||
39 | CACHED_CONFIGUREVARS += "\ | ||
40 | ac_cv_path_XMLLINT=/usr/bin/xmllint \ | ||
41 | ac_cv_path_XMLCATLOG=/usr/bin/xmlcatalog \ | ||
42 | ac_cv_path_AUGPARSE=/usr/bin/augparse \ | ||
43 | ac_cv_path_DNSMASQ=/usr/bin/dnsmasq \ | ||
44 | ac_cv_path_BRCTL=/usr/sbin/brctl \ | ||
45 | ac_cv_path_TC=/sbin/tc \ | ||
46 | ac_cv_path_UDEVADM=/sbin/udevadm \ | ||
47 | ac_cv_path_MODPROBE=/sbin/modprobe \ | ||
48 | ac_cv_path_IP_PATH=/bin/ip \ | ||
49 | ac_cv_path_IPTABLES_PATH=/usr/sbin/iptables \ | ||
50 | ac_cv_path_IP6TABLES_PATH=/usr/sbin/ip6tables \ | ||
51 | ac_cv_path_MOUNT=/bin/mount \ | ||
52 | ac_cv_path_UMOUNT=/bin/umount \ | ||
53 | ac_cv_path_MKFS=/usr/sbin/mkfs \ | ||
54 | ac_cv_path_SHOWMOUNT=/usr/sbin/showmount \ | ||
55 | ac_cv_path_PVCREATE=/usr/sbin/pvcreate \ | ||
56 | ac_cv_path_VGCREATE=/usr/sbin/vgcreate \ | ||
57 | ac_cv_path_LVCREATE=/usr/sbin/lvcreate \ | ||
58 | ac_cv_path_PVREMOVE=/usr/sbin/pvremove \ | ||
59 | ac_cv_path_VGREMOVE=/usr/sbin/vgremove \ | ||
60 | ac_cv_path_LVREMOVE=/usr/sbin/lvremove \ | ||
61 | ac_cv_path_LVCHANGE=/usr/sbin/lvchange \ | ||
62 | ac_cv_path_VGCHANGE=/usr/sbin/vgchange \ | ||
63 | ac_cv_path_VGSCAN=/usr/sbin/vgscan \ | ||
64 | ac_cv_path_PVS=/usr/sbin/pvs \ | ||
65 | ac_cv_path_VGS=/usr/sbin/vgs \ | ||
66 | ac_cv_path_LVS=/usr/sbin/lvs \ | ||
67 | ac_cv_path_PARTED=/usr/sbin/parted \ | ||
68 | ac_cv_path_DMSETUP=/usr/sbin/dmsetup" | ||
69 | |||
70 | # Some other possible paths we are not yet setting | ||
71 | #ac_cv_path_RPCGEN= | ||
72 | #ac_cv_path_XSLTPROC= | ||
73 | #ac_cv_path_RADVD= | ||
74 | #ac_cv_path_UDEVSETTLE= | ||
75 | #ac_cv_path_EBTABLES_PATH= | ||
76 | #ac_cv_path_PKG_CONFIG= | ||
77 | #ac_cv_path_ac_pt_PKG_CONFIG | ||
78 | #ac_cv_path_PKCHECK_PATH= | ||
79 | #ac_cv_path_POLKIT_AUTH= | ||
80 | #ac_cv_path_DTRACE= | ||
81 | #ac_cv_path_ISCSIADM= | ||
82 | #ac_cv_path_MSGFMT= | ||
83 | #ac_cv_path_GMSGFMT= | ||
84 | #ac_cv_path_XGETTEXT= | ||
85 | #ac_cv_path_MSGMERGE= | ||
86 | #ac_cv_path_SCRUB= | ||
87 | #ac_cv_path_PYTHON= | ||
88 | |||
89 | ALLOW_EMPTY_${PN} = "1" | ||
90 | |||
91 | PACKAGES =+ "${PN}-libvirtd ${PN}-virsh" | ||
92 | |||
93 | ALLOW_EMPTY_${PN}-libvirtd = "1" | ||
94 | |||
95 | FILES_${PN}-libvirtd = "${sysconfdir}/init.d \ | ||
96 | ${sysconfdir}/sysctl.d \ | ||
97 | ${sysconfdir}/logrotate.d \ | ||
98 | ${sysconfdir}/libvirt/libvirtd.conf \ | ||
99 | /usr/lib/sysctl.d/libvirtd.conf \ | ||
100 | ${sbindir}/libvirtd" | ||
101 | |||
102 | FILES_${PN}-virsh = "${bindir}/virsh" | ||
103 | FILES_${PN} += "${libdir}/libvirt/connection-driver \ | ||
104 | ${datadir}/augeas \ | ||
105 | ${datadir}/polkit-1" | ||
106 | |||
107 | FILES_${PN}-dbg += "${libdir}/libvirt/connection-driver/.debug ${libdir}/libvirt/lock-driver/.debug" | ||
108 | FILES_${PN}-staticdev += "${libdir}/*.a ${libdir}/libvirt/connection-driver/*.a ${libdir}/libvirt/lock-driver/*.a" | ||
109 | |||
110 | INITSCRIPT_PACKAGES = "${PN}-libvirtd" | ||
111 | INITSCRIPT_NAME_${PN}-libvirtd = "libvirtd" | ||
112 | INITSCRIPT_PARAMS_${PN}-libvirtd = "defaults 72" | ||
113 | |||
114 | PRIVATE_LIBS_${PN}-ptest = " \ | ||
115 | libvirt-lxc.so.0 \ | ||
116 | libvirt.so.0 \ | ||
117 | libvirt-qemu.so.0 \ | ||
118 | lockd.so \ | ||
119 | libvirt_driver_secret.so \ | ||
120 | libvirt_driver_nodedev.so \ | ||
121 | libvirt_driver_vbox.so \ | ||
122 | libvirt_driver_interface.so \ | ||
123 | libvirt_driver_uml.so \ | ||
124 | libvirt_driver_network.so \ | ||
125 | libvirt_driver_nwfilter.so \ | ||
126 | libvirt_driver_qemu.so \ | ||
127 | libvirt_driver_storage.so \ | ||
128 | libvirt_driver_lxc.so \ | ||
129 | " | ||
130 | |||
131 | # xen-minimal config | ||
132 | #PACKAGECONFIG ??= "xen libxl xen-inotify test remote libvirtd" | ||
133 | |||
134 | # full config | ||
135 | PACKAGECONFIG ??= "qemu yajl uml openvz vmware vbox esx iproute2 lxc test \ | ||
136 | remote macvtap libvirtd netcf udev python ebtables \ | ||
137 | ${@base_contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)} \ | ||
138 | ${@base_contains('DISTRO_FEATURES', 'xen', 'xen libxl xen-inotify', '', d)} \ | ||
139 | ${@base_contains('DISTRO_FEATURES', 'x11', 'polkit', '', d)} \ | ||
140 | " | ||
141 | |||
142 | # enable,disable,depends,rdepends | ||
143 | # | ||
144 | PACKAGECONFIG[qemu] = "--with-qemu,--without-qemu,qemu," | ||
145 | PACKAGECONFIG[yajl] = "--with-yajl,--without-yajl,yajl,yajl" | ||
146 | PACKAGECONFIG[xen] = "--with-xen,--without-xen,xen," | ||
147 | PACKAGECONFIG[xenapi] = "--with-xenapi,--without-xenapi,," | ||
148 | PACKAGECONFIG[libxl] = "--with-libxl=${STAGING_DIR_TARGET}/lib,--without-libxl,libxl," | ||
149 | PACKAGECONFIG[xen-inotify] = "--with-xen-inotify,--without-xen-inotify,xen," | ||
150 | PACKAGECONFIG[uml] = "--with-uml, --without-uml,," | ||
151 | PACKAGECONFIG[openvz] = "--with-openvz,--without-openvz,," | ||
152 | PACKAGECONFIG[vmware] = "--with-vmware,--without-vmware,," | ||
153 | PACKAGECONFIG[phyp] = "--with-phyp,--without-phyp,," | ||
154 | PACKAGECONFIG[vbox] = "--with-vbox,--without-vbox,," | ||
155 | PACKAGECONFIG[esx] = "--with-esx,--without-esx,," | ||
156 | PACKAGECONFIG[hyperv] = "--with-hyperv,--without-hyperv,," | ||
157 | PACKAGECONFIG[polkit] = "--with-polkit,--without-polkit,polkit,polkit" | ||
158 | PACKAGECONFIG[lxc] = "--with-lxc,--without-lxc, lxc," | ||
159 | PACKAGECONFIG[test] = "--with-test=yes,--with-test=no,," | ||
160 | PACKAGECONFIG[remote] = "--with-remote,--without-remote,," | ||
161 | PACKAGECONFIG[macvtap] = "--with-macvtap=yes,--with-macvtap=no,libnl,libnl" | ||
162 | PACKAGECONFIG[libvirtd] = "--with-libvirtd,--without-libvirtd,," | ||
163 | PACKAGECONFIG[netcf] = "--with-netcf,--without-netcf,netcf,netcf" | ||
164 | PACKAGECONFIG[dtrace] = "--with-dtrace,--without-dtrace,," | ||
165 | PACKAGECONFIG[udev] = "--with-udev --with-pciaccess,--without-udev,udev libpciaccess," | ||
166 | PACKAGECONFIG[selinux] = "--with-selinux,--without-selinux,libselinux," | ||
167 | PACKAGECONFIG[ebtables] = "ac_cv_path_EBTABLES_PATH=/sbin/ebtables,ac_cv_path_EBTABLES_PATH=,ebtables,ebtables" | ||
168 | PACKAGECONFIG[python] = ",,python," | ||
169 | PACKAGECONFIG[sasl] = "--with-sasl,--without-sasl,cyrus-sasl,cyrus-sasl" | ||
170 | PACKAGECONFIG[iproute2] = "ac_cv_path_IP_PATH=/sbin/ip,ac_cv_path_IP_PATH=,iproute2,iproute2" | ||
171 | |||
172 | # Enable the Python tool support | ||
173 | require libvirt-python.inc | ||
174 | |||
175 | do_install_append() { | ||
176 | install -d ${D}/etc/init.d | ||
177 | install -d ${D}/etc/libvirt | ||
178 | |||
179 | install -m 0755 ${WORKDIR}/libvirtd.sh ${D}/etc/init.d/libvirtd | ||
180 | install -m 0644 ${WORKDIR}/libvirtd.conf ${D}/etc/libvirt/libvirtd.conf | ||
181 | |||
182 | # This will wind up in the libvirtd package, but will NOT be invoked by default. | ||
183 | # | ||
184 | mv ${D}/${libexecdir}/libvirt-guests.sh ${D}/${sysconfdir}/init.d | ||
185 | |||
186 | # The /var/run/libvirt directories created by the Makefile | ||
187 | # are wiped out in volatile, we need to create these at boot. | ||
188 | rm -rf ${D}${localstatedir}/run | ||
189 | install -d ${D}${sysconfdir}/default/volatiles | ||
190 | echo "d root root 0755 ${localstatedir}/run/libvirt none" \ | ||
191 | > ${D}${sysconfdir}/default/volatiles/99_libvirt | ||
192 | echo "d root root 0755 ${localstatedir}/run/libvirt/lockd none" \ | ||
193 | >> ${D}${sysconfdir}/default/volatiles/99_libvirt | ||
194 | echo "d root root 0755 ${localstatedir}/run/libvirt/lxc none" \ | ||
195 | >> ${D}${sysconfdir}/default/volatiles/99_libvirt | ||
196 | echo "d root root 0755 ${localstatedir}/run/libvirt/network none" \ | ||
197 | >> ${D}${sysconfdir}/default/volatiles/99_libvirt | ||
198 | echo "d root root 0755 ${localstatedir}/run/libvirt/qemu none" \ | ||
199 | >> ${D}${sysconfdir}/default/volatiles/99_libvirt | ||
200 | } | ||
201 | |||
202 | EXTRA_OEMAKE = "BUILD_DIR=${B} DEST_DIR=${D}${PTEST_PATH} PTEST_DIR=${PTEST_PATH}" | ||
203 | |||
204 | do_compile_ptest() { | ||
205 | oe_runmake -C tests buildtest-TESTS | ||
206 | } | ||
207 | |||
208 | do_install_ptest() { | ||
209 | oe_runmake -C tests install-ptest | ||
210 | } | ||
211 | |||
212 | pkg_postinst_libvirt() { | ||
213 | if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then | ||
214 | /etc/init.d/populate-volatile.sh update | ||
215 | fi | ||
216 | } | ||