diff options
-rw-r--r-- | app-emulation/libvirt/ChangeLog | 9 | ||||
-rw-r--r-- | app-emulation/libvirt/Manifest | 33 | ||||
-rw-r--r-- | app-emulation/libvirt/files/libvirt-1.2.10-cve-2014-8131.patch | 75 | ||||
-rw-r--r-- | app-emulation/libvirt/libvirt-1.2.10-r1.ebuild (renamed from app-emulation/libvirt/libvirt-1.2.10.ebuild) | 5 | ||||
-rw-r--r-- | app-emulation/libvirt/libvirt-1.2.9.1-r1.ebuild | 451 |
5 files changed, 102 insertions, 471 deletions
diff --git a/app-emulation/libvirt/ChangeLog b/app-emulation/libvirt/ChangeLog index cc3b7a29861c..0037e7c8ccec 100644 --- a/app-emulation/libvirt/ChangeLog +++ b/app-emulation/libvirt/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for app-emulation/libvirt # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-emulation/libvirt/ChangeLog,v 1.392 2014/11/20 11:56:40 tamiko Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-emulation/libvirt/ChangeLog,v 1.393 2014/12/10 22:44:45 tamiko Exp $ + +*libvirt-1.2.10-r1 (10 Dec 2014) + + 10 Dec 2014; Matthias Maier <tamiko@gentoo.org> + +files/libvirt-1.2.10-cve-2014-8131.patch, +libvirt-1.2.10-r1.ebuild, + -libvirt-1.2.10.ebuild, -libvirt-1.2.9.1-r1.ebuild: + fix for CVE-2014-8131, bug #532204, drop vulnerable unstable 20 Nov 2014; Matthias Maier <tamiko@gentoo.org> +files/libvirt-1.2.9-fix-firewalld-configuration.patch, diff --git a/app-emulation/libvirt/Manifest b/app-emulation/libvirt/Manifest index 507e0bc7ba3a..9514abe98b3e 100644 --- a/app-emulation/libvirt/Manifest +++ b/app-emulation/libvirt/Manifest @@ -2,6 +2,7 @@ Hash: SHA256 AUX libvirt-1.2.10-cve-2014-7823.patch 3066 SHA256 f5574d5b7f02700bd81596b451896163c8dcb1081d568338ed9810dbe0d759ef SHA512 1a13c0fd39671e417b7c338a4d4cada52c83527e726f23a59fb31b3f0777eec3b901761e7a62f07abec0968482a0410c0b28a145290755d68ea02f0b497d981c WHIRLPOOL 8ff93c91d1ab972cf46d90feb9b196e9b0516c3646809448660d200d7fbd205e9507323e63e9afd299ac7393d43f90ff7b1be2fc74ba8f5f64ce6c9ab37a3827 +AUX libvirt-1.2.10-cve-2014-8131.patch 2761 SHA256 1ecbb82ee50dfb91361cb2f55d1dc8e014e08223258dad2a1183d5d844cd7d62 SHA512 36913fbab2ad6499e0386765c106e3592348a77fb8cf10c74353be6299de4a1740a336a2b98efbceed982725cb688f6110e435a4033d9d7141031262a12e0da9 WHIRLPOOL a750d5025385f956a66a177e90332c0f19f7be6097d75bb7b5a2b050a893b0e4638dd1edc04f92219727fa3e069c4e6349ce52cd007472186c72f8c400b107ab AUX libvirt-1.2.9-cve-2014-7823.patch 3250 SHA256 bbc13c3061875de9b9a4c31e061d3797118564ce3c945dda44015d320c4bc8d1 SHA512 851d6662ada92e0566614ae315a0a630c4656349efee01884590856285653a36fd467c81e0f53e3ffc3a55e4106250014d79f0d73cbf39c0c821ac957300c019 WHIRLPOOL b9bfc2b3f09aebd4a6f4e170acd75c8d372c84aa84d5914f3e8807da184c74dca03f117ef621caf6d1e73f2026410b4421c9ea845a092edb95bdcaa34d92bc64 AUX libvirt-1.2.9-do_not_use_sysconf.patch 3879 SHA256 1a0c0b29c481097ee218cc752b11f00193a87a010feefc71ea3f56e041c5844d SHA512 cd8881ed2fd928e4fc122a8615fc328f515181129253cba1124c1faf48549729428113822b56034143e192c44944b1a40e83b960f742db64738e5bc05b9bb371 WHIRLPOOL 9413e40883d98d5d78a2c269786a2f640ec9689744ef431a4e9a092d251d33deda954ad8631520a04a16d8c30ca2e9b28bc8b78562f27267f80740901907a253 AUX libvirt-1.2.9-fix-firewalld-configuration.patch 1069 SHA256 0a4116d91fa068e42735624b78b8fa763f7ee251480151033219981ed11a0c4f SHA512 99addf602f9551e7c2dd92d62d9c3170402d3028dee4f4e8f6809c58cbb2c15d971b518ddc83f2688e0e234194e14156c531eb2ceb0cf2b1740dbb5b099b54ed WHIRLPOOL 7d904c54eb2d98cc446700d1e21ab13080c8bd212122fe5dac91882d564b8453c2ea1e509e8b8995c03623f19d6555b8d126cf0e363e062d2ede93ec12cfcda8 @@ -10,28 +11,26 @@ AUX libvirtd.init-r13 3678 SHA256 5744e7392b0777d14142552237f517ff1fbf6c4734aff9 AUX libvirtd.service.conf 401 SHA256 1cfb6f7dec5746364d9a4cccddb4b63f8ccd0ebf8bfaa000b13a09962ca24fac SHA512 27adbd104ea87e51d423b057392a0c6726692ad8ee9723f73dc4bfe8eb54069725d64883434424ba810d36992d404d1ba4afe6bcefb866d3d3d92dfd161c2b32 WHIRLPOOL d6b960b7d18bdbaf0ff6dc5ecf29e7d10e22fa7d16933a149d6287c007d864a0e0dd67048c25a038dd5f73c9ea911d2cd49bf21c072b0c7eab1e92be35d8b545 AUX virtlockd.init 437 SHA256 0894a839f85dff6f97bde514437935f4c1589ba4f2cbd3e0efe28753698694a1 SHA512 3d7b366736fb98acd26577e29a3c00592e7be038634fc3b51891f557426cd9945bf08a4486f1d62aa91ce7dc7d6bf96d7e57ef06a3a0b4aceb55b9e9c9e9b2da WHIRLPOOL d633a1a7358dbf7bd94d70f44753c9c346adfc78537643e5f379cea017d20e1097998ecfaf87e47e4e0f9216d43a3053af24e3129ecfb8f110f5283a769f368f DIST libvirt-1.2.10.tar.gz 30029503 SHA256 5050f4cea3dd59d3eca25c3d3f16085e10d624ecc18bd35820cd3dac6f46c08e SHA512 9cd5d2a604769cf70e388c367abcde27ee8d6d7043227f17dd2cac92a467ea06547374e1d83c7b1ee4c5322d8b3d9e4cbb6db373efae5eaaceed1b1376cbd09d WHIRLPOOL 986c1fd0128101f936897c97a36d646b8893d9ee0a223d05b004d73408a2720aeb9bb5fe3e4a7c476947021b89d955fb4a1b3a64dfe8dfe0d30dbfe75487b8fe -DIST libvirt-1.2.9.1.tar.gz 30173171 SHA256 7824638d674b1e3fa6b48760587d6ff6d3d466671e71cc759b3383a5a9c1a3a4 SHA512 113b321a8a3834d6e2e0d952942b681fe047cdb840e39866ad444e9e5f0a65f0140b31e65af8453fcebd541eb932c4470794a8bd7fc7c6e1e70be39d5d685929 WHIRLPOOL 28f1d1fdf904f9f05c3f6116bddf1b7466d431c1e11c6e0c738c69f5e35088581c5748de57980b9bc98ea18972f5c1492453f59aa427a311041cd7aeeec535c7 DIST libvirt-1.2.9.tar.gz 30154430 SHA256 95931a5a52f451b9ab73d6a5ae11a5740e1ba69a66520c2a0cffc6068a7e8fc4 SHA512 e91367037622da17b5081ccf471e17d36f474596f19034b30e86f42940939340dc4cf455697e54bf9023005fc45cd9982a0f39d244373dd4d585fd7b9aee918c WHIRLPOOL 771025eb6fdda434f9413b03f6c6e0e8a36fd314eb650f913b695481adb71cff3a07ba19934857dcd468b6357c371ba3972a67b71c4ca29092c2094e482cb24d -EBUILD libvirt-1.2.10.ebuild 12647 SHA256 44f39fbb93f8774ff8af1cdf8cc93ba21c1c255a721cb90f3d66ad9aab054d04 SHA512 77699a86a34d9d8bdd1fec1bd32a36f0e31b8f2c778e35b898d236597dcb1880519d73ba77b615b9e48c3af6ea4d014da801d57277967ea1e57b5fa2241e218b WHIRLPOOL dec84622f8714520af784a0419f68db2d31d3851ff75d09f0a6562a3ddfd54cbd104cbdaa95c1530271668bef1e83b9e7741458977c6945d17dfe1846f30821d +EBUILD libvirt-1.2.10-r1.ebuild 12693 SHA256 109dfb93ca6777c55ece4466a54f871155e331298fd556a98df40dfc02bf3876 SHA512 dc596bb2c046fe7e0f608ada909e1f8b715000c6686244a2557f064c764782a78a90299ca3b316dc64b41efad1738b7ea6214afcadad171c6a9a8ccf114a77ca WHIRLPOOL 85c26f7779f80501ab03d3793d9b38c2a0fe8880bf1f14fdf9e03b8e74ec61f5c4f33fabb730ca090d1bf78ce860b80e277647abe652713e09e89c0ed5cdd5c8 EBUILD libvirt-1.2.9-r2.ebuild 13051 SHA256 a4f70a8d9a50abfd64a5b99feb2e393ca28b3f4138c1f0825391e615b372df20 SHA512 43dbde43a3e5818f067379cbf120a56e56db9e46b2a95e5ebb34318378a4476716d97810170761262030d09821b2c53c518a3e9df8e33413ca8b122158be0818 WHIRLPOOL 42e404845712101d44308968f78e0bb063a5f9f9452f8fdcd47f32fdc02f520cdfb2c68bcbc21ce4b5a3f9cfad1dcc95ea6d63bc3b22d53ac492fcee328a0aa4 -EBUILD libvirt-1.2.9.1-r1.ebuild 12608 SHA256 9a2934004718fd97f5b56f993644566fc6fca7e25cceaba861a0fef10b0bad06 SHA512 17559900a0221acb8fef6fc8f6608ee055f06e80756ba95392dcdab102e5ea74aecef9a96a4c20146a8431106987395e7d238b858b1d6b9fa3037d920d26903c WHIRLPOOL e95875a06a384fca7704ecf2143acb3ec1423f073be32321a93544f483fe593d5aaf17e611a9f07361fb745b363b5cc254b69ac227d1f7fa4741b46a4898c1fc EBUILD libvirt-9999.ebuild 12535 SHA256 0676fabd6df874db39ee2dd2b5fa68371b60b0d35ff7c8a795e946126a8239db SHA512 2de0cb161f528248e61efb192e58e002731a8fc7fef2e2a7133eff9468bdb30362124b1ccc361b38c8db815b17189fdb772ccc623af253acd3686b3b151f33a4 WHIRLPOOL 98f5d988f4e37cef561d6c58385c1002082cee045ae3d39be7cd0ecbcb2e3a3f203772c8e49aefeb373478260efdcd4fb590b4802a512767e7885bdc635fa635 -MISC ChangeLog 22808 SHA256 76f5786e0b5547227ac011f7593b15de980953f8a71a6062eb9207c42514c039 SHA512 02f129700ff7246ae808815a88544cdb8ea095430721e2928e3bf8bee77c1e064e446ccc3c406f161d1b31c69c2c39ded699e49efd503edd3d8d52a227bfb90b WHIRLPOOL ce70da11ff434864b69f4a89141bf71f7f01b412ae354e9331d6dcff479f9561b4e4f335f695885530476d1a253e135bae89b11723a78496992a52ebf7b3826a +MISC ChangeLog 23082 SHA256 116583d2f9dd21850f6f62b64d01830a70966d381996961c36bf85795c958730 SHA512 dcd67f2a36a9a7ea7112d58b4b7edc720dff04d9d661de6e944d37d376741a22fc92a923b8b8e2fdcf91b2ffc60eb7e08f0a9880360022f2032a913a8bd5fcf0 WHIRLPOOL ca0e5181510e6952ab958e2875bec050734c7e7e16eb6dd2b66e8c9282734815ba8eae79e484c56c49938cb6dd75aaba82e1721f5d5d05d570e6e5646f56a276 MISC metadata.xml 3736 SHA256 376b65feea8c2f85dccad2e564cc6111f2dc2de2a3b785a4c10af8c95c4920ee SHA512 93933d1ddfce67739e0647adce2f9253ae596429c794b73562737b508400a0fa7af93eae06808b088888b1d44f421ce4765cc6b56b9b5356140af80ca36bebfc WHIRLPOOL 7ef396db2e624c2798ba30ad4b8099237fb699c5e94cd1470ec6161a068f1e815930a87104545b4b98183784465a9a5f9dc051beb99ef1c5731e61f42f5c7381 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.1 -iQIcBAEBCAAGBQJUbdb6AAoJELhOzYlK7nn/oXEP/08RspVyakVifFYOYZ3owI3S -w6XMsMZj+/eDj6eUtK2kynSJ1HirKwLEOMnnAeQSa3Hfwdd/9QJg8RzI4oZM/OJn -LolTYyNReilaq7e0mVnm+1lMTafn4jNuZ8S3Tm9HkHAA77KUClkjxKx/j+ybReKo -z3y0cFYc8OQytCeY7zukHYFZMwsMdjWUX9nJ09logwczaUSzKbw3/poIW/9wcAvQ -jhLue2Vqns/q14pS4ochrzT5Ohv0cPVi70AO8PMgVNXisMuFmI8Y0oDT2+DE/KR4 -lUujX3V+370mzqaLvX8P6A6leDoAd7LB1oL5bAiIGPRY1hQvpFRP85EnugSWypvu -dzYBcXGvwifFMjOmdB0k8tGUfd/eKTaCY+c7zLpDU78OGts4ZCtwjGCULFuzzOes -yYePNNyuijnAbLTAmapqyRv10j/aiGAwtL8MssgnZAI3wlOgOw2+Wn/xelexul2V -qz0JYavmZwVPKpOmBXt9sZSmG+r1W9TsXnuXbgXTWDU70txgpjRT5dXkvf0W/Hfm -IyEBuWEAohij8YnOAltB2fUwm860PxzVDDRIwck+IDZgqJDEoXZFC3iq1PQ7ngoX -ySu+d817uBUn8kN+OC1uaOLgKxuIYqZLTUZT9/wSDLbTvs9dCQrvbC+oTWb4WoiE -JNTDm4lW7kybd5MZZ8mI -=Fr82 +iQIcBAEBCAAGBQJUiMzeAAoJELhOzYlK7nn/dv0P+gK5PduNNpfVrJUUm6xnbaY+ +Wf1oPKm9dv38z/ccZ/69f4Kz+Ax8WCXfV1JPgmcOuGdtaGJRoDQLlVlygNnUZkUO +P5bcm2Db3TNmNx2GJdDz2TKhrP162g7RDRO8Lq9Qv610De+W90epGFWM5z+2+5Md +k39kzzZC6t5I8OiOdBe6kmuiiuAndvMXjDPjW6d1Yzt2WwHkXpvv9SWUo7klZlcn +DJe+SSkjnX+v3GxypviSkQPllISZAe4FosPkU5/eyxPN3ZrbDIi2P0CQg+7VoqXv +AYgjyKn4uXIfj4A+55pVBVQ0ZrjKoVTj3i2g6ZYHgSbLdM8102CFNzRX6d1P1lzJ +rGVMiA688tfjieh0CnTZtaHz75tfhS2fschaAMqzuPDkm+vHbTI0QSsRyrHLMxmX +DwnTNPsEYrJvZEii7ie5KepTsPaZW8VjVr4DQr398UZbKMsncWze600TrfuW56dE +DRnpdC0NC8s13pVVAoQvUdaUJWNbOkA/D1KR8GbfSpWlsq+iQUtOo2gid6CBu5Lr +AQT439LQj28k0bEbRAOcrdr0mv6hEo8SUAVUhEzaTFBT+J2cKrIi1BqcXGomo+kz +314T5ZUBQbg+hPm/2QH1fYRaEBM7et+AwtmbGbkg2gdVyqOVz9uqYLwZG5F0dFXc +sdDgkDN+FeJfudIOG0yJ +=xAmX -----END PGP SIGNATURE----- diff --git a/app-emulation/libvirt/files/libvirt-1.2.10-cve-2014-8131.patch b/app-emulation/libvirt/files/libvirt-1.2.10-cve-2014-8131.patch new file mode 100644 index 000000000000..5ede7efc4ef7 --- /dev/null +++ b/app-emulation/libvirt/files/libvirt-1.2.10-cve-2014-8131.patch @@ -0,0 +1,75 @@ +From 57023c0a3af4af1c547189c1f6712ed5edeb0c0b Mon Sep 17 00:00:00 2001 +From: Martin Kletzander <mkletzan@redhat.com> +Date: Thu, 27 Nov 2014 15:47:52 +0100 +Subject: [PATCH 11/20] CVE-2014-8131: Fix possible deadlock and segfault in + qemuConnectGetAllDomainStats() + +When user doesn't have read access on one of the domains he requested, +the for loop could exit abruptly or continue and override pointer which +pointed to locked object. + +This patch fixed two issues at once. One is that domflags might have +had QEMU_DOMAIN_STATS_HAVE_JOB even when there was no job started (this +is fixed by doing domflags |= QEMU_DOMAIN_STATS_HAVE_JOB only when the +job was acquired and cleaning domflags on every start of the loop. +Second one is that the domain is kept locked when +virConnectGetAllDomainStatsCheckACL() fails and continues the loop when +it didn't end. Adding a simple virObjectUnlock() and clearing the +pointer ought to do. + +Signed-off-by: Martin Kletzander <mkletzan@redhat.com> +--- + src/qemu/qemu_driver.c | 20 +++++++++++++------- + 1 file changed, 13 insertions(+), 7 deletions(-) + +diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c +index be37c8f..ae6225b 100644 +--- a/src/qemu/qemu_driver.c ++++ b/src/qemu/qemu_driver.c +@@ -18740,20 +18740,23 @@ qemuConnectGetAllDomainStats(virConnectPtr conn, + privflags |= QEMU_DOMAIN_STATS_HAVE_JOB; + + for (i = 0; i < ndoms; i++) { +- domflags = privflags; + virDomainStatsRecordPtr tmp = NULL; ++ domflags = 0; + + if (!(dom = qemuDomObjFromDomain(doms[i]))) + continue; + + if (doms != domlist && +- !virConnectGetAllDomainStatsCheckACL(conn, dom->def)) ++ !virConnectGetAllDomainStatsCheckACL(conn, dom->def)) { ++ virObjectUnlock(dom); ++ dom = NULL; + continue; ++ } + +- if (HAVE_JOB(domflags) && ++ if (HAVE_JOB(privflags) && + qemuDomainObjBeginJob(driver, dom, QEMU_JOB_QUERY) < 0) + /* As it was never requested. Gather as much as possible anyway. */ +- domflags &= ~QEMU_DOMAIN_STATS_HAVE_JOB; ++ domflags |= QEMU_DOMAIN_STATS_HAVE_JOB; + + if (qemuDomainGetStats(conn, dom, stats, &tmp, domflags) < 0) + goto endjob; +@@ -18761,9 +18764,12 @@ qemuConnectGetAllDomainStats(virConnectPtr conn, + if (tmp) + tmpstats[nstats++] = tmp; + +- if (HAVE_JOB(domflags) && !qemuDomainObjEndJob(driver, dom)) { +- dom = NULL; +- continue; ++ if (HAVE_JOB(domflags)) { ++ domflags = 0; ++ if (!qemuDomainObjEndJob(driver, dom)) { ++ dom = NULL; ++ continue; ++ } + } + + virObjectUnlock(dom); +-- +2.0.4 + diff --git a/app-emulation/libvirt/libvirt-1.2.10.ebuild b/app-emulation/libvirt/libvirt-1.2.10-r1.ebuild index 4f13715e019e..344d5b1fee24 100644 --- a/app-emulation/libvirt/libvirt-1.2.10.ebuild +++ b/app-emulation/libvirt/libvirt-1.2.10-r1.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-emulation/libvirt/libvirt-1.2.10.ebuild,v 1.5 2014/11/20 11:56:40 tamiko Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-emulation/libvirt/libvirt-1.2.10-r1.ebuild,v 1.1 2014/12/10 22:44:45 tamiko Exp $ EAPI=5 @@ -222,7 +222,8 @@ src_prepare() { epatch \ "${FILESDIR}"/${PN}-1.2.9-do_not_use_sysconf.patch \ "${FILESDIR}"/${PN}-1.2.9-fix-firewalld-configuration.patch \ - "${FILESDIR}"/${P}-cve-2014-7823.patch + "${FILESDIR}"/${P}-cve-2014-7823.patch \ + "${FILESDIR}"/${P}-cve-2014-8131.patch epatch_user diff --git a/app-emulation/libvirt/libvirt-1.2.9.1-r1.ebuild b/app-emulation/libvirt/libvirt-1.2.9.1-r1.ebuild deleted file mode 100644 index db8cab7bb95a..000000000000 --- a/app-emulation/libvirt/libvirt-1.2.9.1-r1.ebuild +++ /dev/null @@ -1,451 +0,0 @@ -# Copyright 1999-2014 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-emulation/libvirt/libvirt-1.2.9.1-r1.ebuild,v 1.2 2014/11/20 11:56:40 tamiko Exp $ - -EAPI=5 - -AUTOTOOLIZE=yes - -MY_P="${P/_rc/-rc}" - -inherit eutils user autotools linux-info systemd readme.gentoo - -if [[ ${PV} = *9999* ]]; then - inherit git-r3 - EGIT_REPO_URI="git://libvirt.org/libvirt.git" - SRC_URI="" - KEYWORDS="" - SLOT="0" -else - # Versions with 4 numbers are stable updates: - if [[ ${PV} =~ ^[0-9]+(\.[0-9]+){3} ]]; then - SRC_URI="http://libvirt.org/sources/stable_updates/${MY_P}.tar.gz" - else - SRC_URI="http://libvirt.org/sources/${MY_P}.tar.gz" - fi - KEYWORDS="~amd64 ~x86" - SLOT="0/${PV}" -fi -S="${WORKDIR}/${P%_rc*}" - -DESCRIPTION="C toolkit to manipulate virtual machines" -HOMEPAGE="http://www.libvirt.org/" -LICENSE="LGPL-2.1" -IUSE="audit avahi +caps firewalld fuse iscsi +libvirtd lvm lxc +macvtap nfs \ - nls numa openvz parted pcap phyp policykit +qemu rbd sasl \ - selinux +udev uml +vepa virtualbox virt-network wireshark-plugins xen \ - elibc_glibc systemd" -REQUIRED_USE="libvirtd? ( || ( lxc openvz qemu uml virtualbox xen ) ) - lxc? ( caps libvirtd ) - openvz? ( libvirtd ) - qemu? ( libvirtd ) - uml? ( libvirtd ) - vepa? ( macvtap ) - virtualbox? ( libvirtd ) - xen? ( libvirtd ) - virt-network? ( libvirtd ) - firewalld? ( virt-network )" - -# gettext.sh command is used by the libvirt command wrappers, and it's -# non-optional, so put it into RDEPEND. -# We can use both libnl:1.1 and libnl:3, but if you have both installed, the -# package will use 3 by default. Since we don't have slot pinning in an API, -# we must go with the most recent -RDEPEND="sys-libs/readline - sys-libs/ncurses - >=net-misc/curl-7.18.0 - dev-libs/libgcrypt:0 - >=dev-libs/libxml2-2.7.6 - dev-libs/libnl:3 - >=net-libs/gnutls-1.0.25 - net-libs/libssh2 - sys-apps/dmidecode - >=sys-apps/util-linux-2.17 - sys-devel/gettext - >=net-analyzer/netcat6-1.0-r2 - app-misc/scrub - audit? ( sys-process/audit ) - avahi? ( >=net-dns/avahi-0.6[dbus] ) - caps? ( sys-libs/libcap-ng ) - fuse? ( >=sys-fs/fuse-2.8.6 ) - iscsi? ( sys-block/open-iscsi ) - lxc? ( !systemd? ( sys-power/pm-utils ) ) - lvm? ( >=sys-fs/lvm2-2.02.48-r2 ) - nfs? ( net-fs/nfs-utils ) - numa? ( - >sys-process/numactl-2.0.2 - sys-process/numad - ) - openvz? ( sys-kernel/openvz-sources ) - parted? ( - >=sys-block/parted-1.8[device-mapper] - sys-fs/lvm2 - ) - pcap? ( >=net-libs/libpcap-1.0.0 ) - policykit? ( >=sys-auth/polkit-0.9 ) - qemu? ( - >=app-emulation/qemu-0.13.0 - dev-libs/yajl - !systemd? ( sys-power/pm-utils ) - ) - rbd? ( sys-cluster/ceph ) - sasl? ( dev-libs/cyrus-sasl ) - selinux? ( >=sys-libs/libselinux-2.0.85 ) - systemd? ( sys-apps/systemd ) - virtualbox? ( || ( app-emulation/virtualbox >=app-emulation/virtualbox-bin-2.2.0 ) ) - wireshark-plugins? ( net-analyzer/wireshark:= ) - xen? ( app-emulation/xen-tools app-emulation/xen ) - udev? ( virtual/udev >=x11-libs/libpciaccess-0.10.9 ) - virt-network? ( net-dns/dnsmasq[script] - >=net-firewall/iptables-1.4.10 - net-misc/radvd - net-firewall/ebtables - sys-apps/iproute2[-minimal] - firewalld? ( net-firewall/firewalld ) - ) - elibc_glibc? ( || ( >=net-libs/libtirpc-0.2.2-r1 <sys-libs/glibc-2.14 ) )" - -DEPEND="${RDEPEND} - virtual/pkgconfig - app-text/xhtml1 - dev-lang/perl - dev-libs/libxslt" - -DOC_CONTENTS="For the basic networking support (bridged and routed networks) -you don't need any extra software. For more complex network modes -including but not limited to NATed network, you can enable the -'virt-network' USE flag.\n\n -If you are using dnsmasq on your system, you will have -to configure /etc/dnsmasq.conf to enable the following settings:\n\n - bind-interfaces\n - interface or except-interface\n\n -Otherwise you might have issues with your existing DNS server." - -LXC_CONFIG_CHECK=" - ~CGROUPS - ~CGROUP_FREEZER - ~CGROUP_DEVICE - ~CGROUP_CPUACCT - ~CGROUP_SCHED - ~CGROUP_PERF - ~BLK_CGROUP - ~NET_CLS_CGROUP - ~CGROUP_NET_PRIO - ~CPUSETS - ~RESOURCE_COUNTERS - ~NAMESPACES - ~UTS_NS - ~IPC_NS - ~PID_NS - ~NET_NS - ~USER_NS - ~DEVPTS_MULTIPLE_INSTANCES - ~VETH - ~MACVLAN - ~POSIX_MQUEUE - ~SECURITYFS - ~!GRKERNSEC_CHROOT_MOUNT - ~!GRKERNSEC_CHROOT_DOUBLE - ~!GRKERNSEC_CHROOT_PIVOT - ~!GRKERNSEC_CHROOT_CHMOD - ~!GRKERNSEC_CHROOT_CAPS -" - -VIRTNET_CONFIG_CHECK=" - ~BRIDGE_NF_EBTABLES - ~BRIDGE_EBT_MARK_T - ~NETFILTER_ADVANCED - ~NETFILTER_XT_TARGET_CHECKSUM - ~NETFILTER_XT_CONNMARK - ~NETFILTER_XT_MARK -" - -BWLMT_CONFIG_CHECK=" - ~BRIDGE_EBT_T_NAT - ~NET_SCH_HTB - ~NET_SCH_SFQ - ~NET_SCH_INGRESS - ~NET_CLS_FW - ~NET_CLS_U32 - ~NET_ACT_POLICE -" - -MACVTAP_CONFIG_CHECK=" ~MACVTAP" - -LVM_CONFIG_CHECK=" ~BLK_DEV_DM ~DM_SNAPSHOT ~DM_MULTIPATH" - -ERROR_USER_NS="Optional depending on LXC configuration." - -pkg_setup() { - enewgroup qemu 77 - enewuser qemu 77 -1 -1 qemu kvm - - # Some people used the masked ebuild which was not adding the qemu - # user to the kvm group originally. This results in VMs failing to - # start for some users. bug #430808 - egetent group kvm | grep -q qemu - if [[ $? -ne 0 ]]; then - gpasswd -a qemu kvm - fi - - # Handle specific kernel versions for different features - kernel_is lt 3 6 && LXC_CONFIG_CHECK+=" ~CGROUP_MEM_RES_CTLR" - kernel_is ge 3 6 && LXC_CONFIG_CHECK+=" ~MEMCG ~MEMCG_SWAP ~MEMCG_KMEM" - - CONFIG_CHECK="" - use fuse && CONFIG_CHECK+=" ~FUSE_FS" - use lvm && CONFIG_CHECK+="${LVM_CONFIG_CHECK}" - use lxc && CONFIG_CHECK+="${LXC_CONFIG_CHECK}" - use macvtap && CONFIG_CHECK+="${MACVTAP_CONFIG_CHECK}" - use virt-network && CONFIG_CHECK+="${VIRTNET_CONFIG_CHECK}" - # Bandwidth Limiting Support - use virt-network && CONFIG_CHECK+="${BWLMT_CONFIG_CHECK}" - if [[ -n ${CONFIG_CHECK} ]]; then - linux-info_pkg_setup - fi -} - -src_prepare() { - touch "${S}/.mailmap" - - if [[ ${PV} = *9999* ]]; then - # git checkouts require bootstrapping to create the configure script. - # Additionally the submodules must be cloned to the right locations - # bug #377279 - ./bootstrap || die "bootstrap failed" - ( - git submodule status | sed 's/^[ +-]//;s/ .*//' - git hash-object bootstrap.conf - ) >.git-module-status - fi - - epatch \ - "${FILESDIR}"/${PN}-1.2.9-do_not_use_sysconf.patch \ - "${FILESDIR}"/${PN}-1.2.9-fix-firewalld-configuration.patch - - epatch_user - - [[ -n ${AUTOTOOLIZE} ]] && eautoreconf - - # Tweak the init script - local avahi_init= - local iscsi_init= - local rbd_init= - local firewalld_init= - cp "${FILESDIR}/libvirtd.init-r13" "${S}/libvirtd.init" - use avahi && avahi_init='avahi-daemon' - use iscsi && iscsi_init='iscsid' - use rbd && rbd_init='ceph' - use firewalld && firewalld_init='need firewalld' - - sed -e "s/USE_FLAG_FIREWALLD/${firewalld_init}/" -i "${S}/libvirtd.init" - sed -e "s/USE_FLAG_AVAHI/${avahi_init}/" -i "${S}/libvirtd.init" - sed -e "s/USE_FLAG_ISCSI/${iscsi_init}/" -i "${S}/libvirtd.init" - sed -e "s/USE_FLAG_RBD/${rbd_init}/" -i "${S}/libvirtd.init" -} - -src_configure() { - local myconf="" - - ## enable/disable daemon, otherwise client only utils - myconf+=" $(use_with libvirtd)" - - ## enable/disable the daemon using avahi to find VMs - myconf+=" $(use_with avahi)" - - ## hypervisors on the local host - myconf+=" $(use_with xen) $(use_with xen xen-inotify)" - myconf+=" --without-xenapi" - if use xen && has_version ">=app-emulation/xen-tools-4.2.0"; then - myconf+=" --with-libxl" - else - myconf+=" --without-libxl" - fi - myconf+=" $(use_with openvz)" - myconf+=" $(use_with lxc)" - if use virtualbox && has_version app-emulation/virtualbox-ose; then - myconf+=" --with-vbox=/usr/lib/virtualbox-ose/" - else - myconf+=" $(use_with virtualbox vbox)" - fi - myconf+=" $(use_with uml)" - myconf+=" $(use_with qemu)" - myconf+=" $(use_with qemu yajl)" # Use QMP over HMP - myconf+=" $(use_with phyp)" - myconf+=" --with-esx" - myconf+=" --with-vmware" - - ## additional host drivers - myconf+=" $(use_with virt-network network)" - myconf+=" --with-storage-fs" - myconf+=" $(use_with lvm storage-lvm)" - myconf+=" $(use_with iscsi storage-iscsi)" - myconf+=" $(use_with parted storage-disk)" - myconf+=" $(use_with lvm storage-mpath)" - myconf+=" $(use_with rbd storage-rbd)" - myconf+=" $(use_with numa numactl)" - myconf+=" $(use_with numa numad)" - myconf+=" $(use_with selinux)" - myconf+=" $(use_with fuse)" - - # udev for device support details - myconf+=" $(use_with udev)" - myconf+=" --without-hal" - - # linux capability support so we don't need privileged accounts - myconf+=" $(use_with caps capng)" - - ## auth stuff - myconf+=" $(use_with policykit polkit)" - myconf+=" $(use_with sasl)" - - # network bits - myconf+=" $(use_with macvtap)" - myconf+=" $(use_with pcap libpcap)" - myconf+=" $(use_with vepa virtualport)" - myconf+=" $(use_with firewalld)" - - ## other - myconf+=" $(use_enable nls)" - - # user privilege bits fir qemu/kvm - if use caps; then - myconf+=" --with-qemu-user=qemu" - myconf+=" --with-qemu-group=qemu" - else - myconf+=" --with-qemu-user=root" - myconf+=" --with-qemu-group=root" - fi - - # audit support - myconf+=" $(use_with audit)" - - # wireshark dissector - myconf+=" $(use_with wireshark-plugins wireshark-dissector)" - - ## stuff we don't yet support - myconf+=" --without-netcf" - - # locking support - myconf+=" --without-sanlock" - - # systemd unit files - myconf+=" $(use_with systemd systemd-daemon)" - use systemd && myconf+=" --with-init-script=systemd" - - # this is a nasty trick to work around the problem in bug - # #275073. The reason why we don't solve this properly is that - # it'll require us to rebuild autotools (and we don't really want - # to do that right now). The proper solution has been sent - # upstream and should hopefully land in 0.7.7, in the mean time, - # mime the same functionality with this. - case ${CHOST} in - *cygwin* | *mingw* ) - ;; - *) - ac_cv_prog_WINDRES=no - ;; - esac - - econf \ - ${myconf} \ - --disable-static \ - --disable-werror \ - --with-remote \ - --docdir=/usr/share/doc/${PF} \ - --localstatedir=/var - - if [[ ${PV} = *9999* ]]; then - # Restore gnulib's config.sub and config.guess - # bug #377279 - (cd .gnulib && git reset --hard > /dev/null) - fi -} - -src_test() { - # Explicitly allow parallel build of tests - export VIR_TEST_DEBUG=1 - HOME="${T}" emake check || die "tests failed" -} - -src_install() { - emake install \ - DESTDIR="${D}" \ - HTML_DIR=/usr/share/doc/${PF}/html \ - DOCS_DIR=/usr/share/doc/${PF} \ - EXAMPLE_DIR=/usr/share/doc/${PF}/examples \ - SYSTEMD_UNIT_DIR="$(systemd_get_unitdir)" \ - || die "emake install failed" - - find "${D}" -name '*.la' -delete || die - - # Remove bogus, empty directories. They are either not used, or - # libvirtd is able to create them on demand - rm -rf "${D}"/etc/sysconf - rm -rf "${D}"/var/cache - rm -rf "${D}"/var/run - rm -rf "${D}"/var/log - - use libvirtd || return 0 - # From here, only libvirtd-related instructions, be warned! - - use systemd && \ - systemd_install_serviced "${FILESDIR}"/libvirtd.service.conf libvirtd - - newinitd "${S}/libvirtd.init" libvirtd || die - newconfd "${FILESDIR}/libvirtd.confd-r4" libvirtd || die - newinitd "${FILESDIR}/virtlockd.init" virtlockd || die - - readme.gentoo_create_doc -} - -pkg_preinst() { - # we only ever want to generate this once - if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then - rm -rf "${D}"/etc/libvirt/qemu/networks/default.xml - fi - - # We really don't want to use or support old PolicyKit cause it - # screws with the new polkit integration - if has_version sys-auth/policykit; then - rm -rf "${D}"/usr/share/PolicyKit/policy/org.libvirt.unix.policy - fi - - # Only sysctl files ending in .conf work - dodir /etc/sysctl.d - mv "${D}"/usr/lib/sysctl.d/libvirtd.conf "${D}"/etc/sysctl.d/libvirtd.conf -} - -pkg_postinst() { - if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then - touch "${ROOT}"/etc/libvirt/qemu/networks/default.xml - fi - - if ! use policykit; then - elog "To allow normal users to connect to libvirtd you must change the" - elog "unix sock group and/or perms in /etc/libvirt/libvirtd.conf" - fi - - use libvirtd || return 0 - # From here, only libvirtd-related instructions, be warned! - - readme.gentoo_print_elog - - if use caps && use qemu; then - elog "libvirt will now start qemu/kvm VMs with non-root privileges." - elog "Ensure any resources your VMs use are accessible by qemu:qemu" - fi - - if [[ -n "${REPLACING_VERSIONS}" ]]; then - elog "" - elog "The systemd service-file configuration under /etc/sysconfig has" - elog "been removed. Please use" - elog " /etc/systemd/system/libvirt.d/00gentoo.conf" - elog "to control the '--listen' parameter for libvirtd. The configuration" - elog "for the libvirt-guests.service is now found under" - elog " /etc/libvirt/libvirt-guests.conf" - elog "The openrc configuration has not been changed. Thus no action is" - elog "required for the openrc service manager." - elog "" - fi -} |