-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
+AUX libvirt-1.2.10-cve-2014-7823.patch 3066 SHA256 f5574d5b7f02700bd81596b451896163c8dcb1081d568338ed9810dbe0d759ef SHA512 1a13c0fd39671e417b7c338a4d4cada52c83527e726f23a59fb31b3f0777eec3b901761e7a62f07abec0968482a0410c0b28a145290755d68ea02f0b497d981c WHIRLPOOL 8ff93c91d1ab972cf46d90feb9b196e9b0516c3646809448660d200d7fbd205e9507323e63e9afd299ac7393d43f90ff7b1be2fc74ba8f5f64ce6c9ab37a3827
+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 libvirtd.confd-r4 2015 SHA256 c2ca5d9a2d4ed433e91bd215c2ca678109cc981072897a497955e36760dc3b9f SHA512 b3e1d2433be7838a35386747422a8f98f2a7f6a92a03089f9472eb8ee2efb7d10d2becd363fea7cdaf8771da31b58cd60d192b25e089b6257ad5341b1074e540 WHIRLPOOL 284e72e704b759433d5ddc1a3e4019164dda6b48cb2734ea9a6780747938bba2855a99dcf1b125ab3f500a6145315cafa4a3531ff6938c0c62e5b1a6f99ea9b3
AUX libvirtd.init-r13 3678 SHA256 5744e7392b0777d14142552237f517ff1fbf6c4734aff96fa340158ceed09e35 SHA512 d50898c07291aefc0025aa51e7f4356c1e5d7b22c3d6d4c31f6da3dc4b23d88e2678568c4f2c755c6763ddce9bfc0e2aedeba52f001daba9ff3cbba2cd57ebf3 WHIRLPOOL 6a8a39b39b7e9d6efca47800e886cbb1e88b9e948c3ac623d120780d34f1fd8bba48c83e445fd0c0bdbff67926fcc577640eb4db0137fb5d703abc6eaf790dfb
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.tar.gz 30154430 SHA256 95931a5a52f451b9ab73d6a5ae11a5740e1ba69a66520c2a0cffc6068a7e8fc4 SHA512 e91367037622da17b5081ccf471e17d36f474596f19034b30e86f42940939340dc4cf455697e54bf9023005fc45cd9982a0f39d244373dd4d585fd7b9aee918c WHIRLPOOL 771025eb6fdda434f9413b03f6c6e0e8a36fd314eb650f913b695481adb71cff3a07ba19934857dcd468b6357c371ba3972a67b71c4ca29092c2094e482cb24d
-EBUILD libvirt-1.2.9-r1.ebuild 13018 SHA256 481cb1d1eff81ec6c183391bff708594996b45db5c239d5aff7a008c6031dabd SHA512 13a7e69bc7760038e778af32cc4a30feadeeb451aded2e930ea15b64dfc38ed99212b1873bdf53acddb120c1c3e16796aa940a93cd504d187770f401b32a6c5a WHIRLPOOL 788dd3ade3f0d94605c6e127d36daf1401cb6e25df7e19b13739892d6e6cd43740762be3ebdb6a273c95d81b699b0e34c932a722d934c59d91883a7298a9adbe
+EBUILD libvirt-1.2.10.ebuild 13061 SHA256 4804bb54d0004985d81c481804a2194c619ddc5bc1c1ce7f95cd4e92f105a80c SHA512 8b1f46e1d90daa7d3079da724cf49c55c63a1e7ed146a4342f51586c6dccb427fc4dc20c50b53061668fa31aeab9b2c0d97e7bf304c9f79179d6502d8fecea0f WHIRLPOOL 5e063d2d7f41d8fae688853d6ade4a4287deae32b634b8bb5ba49407397506a7007b34a36b65796807b2f4be52c7313a0af0be5409590392f729836e161bf4bc
+EBUILD libvirt-1.2.9-r2.ebuild 13056 SHA256 40f6404ed96588700e79510e644bdd594a741cbdb43f6bc7087f0643bb213cbf SHA512 5694dcd7d6115f86abf322bef9223a41cce1047ef59ad99c4befe209083d80b376c763588d88aec29975cddfbacd399240567f0b089b29854440aba45fd1512a WHIRLPOOL c2cbfad1acc7d42305b16c443bfe349662575cb823cfd3ffe0b764eddb4b08c4527483ab3fa740302ac12b5269a3d0d125eeee02ab00ce0bc84c60c1d5445ac6
EBUILD libvirt-1.2.9.ebuild 12535 SHA256 15119a80b32e4c38f60ca171acdb2f81a32bd4a52eb0f0ec509cc60fa0942443 SHA512 28164fde352359c4f5cc52859eb26ea836c61fb24b9bf196a48e70eea09b8963bb11cfcce67452f4a6aec65602d8b6b7c94dfb2ae6671cf198f117a5bcb3b185 WHIRLPOOL 3b85c9512cc647493ac1b7d2dd17273e1db2b8e17c973e3af1c88e836bb927c105527c426f586c27bcf765600d2e8e46a598da4f36e6e501fa90e933692934ce
-EBUILD libvirt-9999.ebuild 12471 SHA256 30454708ff687b1830a0f2829db6cabe47672b9e1e23b6e6525f5adb6732d4fc SHA512 9779829b5a395f9be211d4382b896caef386af5500fa4761d3a3c95da553848d0a40b228befc2199d566878b9bd840be19658a749b00df74f54cc3f10a4c40c3 WHIRLPOOL 3cc12748e88ca0c3176cc19a039912d3b766cdca286ad8c46284669c9adc4fbb308cad1f0def25c023f9e2c15a5551f6d0cc6bcd34e5b774f67e357f3b5e78d1
-MISC ChangeLog 21020 SHA256 10bb69c5f67cd74cf889b50b1c4dfe91686f93f0282584e72e822191f8a47f7b SHA512 8b267d9671209afcb6a54a33b40067b04abc97c8a65cc6cf13d5e24a6fba088036cf70e616ad840e5d58810aabde515bf389ae422912763c9262ad43c24f3293 WHIRLPOOL e220cb1e9002b3856e4d7676e6f4f145289eb78aaf69a7dcfaa954412c461d161a906966f64a0709570c4b9262f6fecb58524255a08a1e4d9ef7ac13695b9b80
+EBUILD libvirt-9999.ebuild 13013 SHA256 a19e7e0b78ffd0ed1887d27a65d85b16bdd266a4b1ac1547433275c291c25b6d SHA512 4592c4e88d8fa639c24fc3b7d177dbfafa0ad61f60fe1335f523fec67cdbeaacef8a87ed5126ad733a90d401cef571f59a322926e67d3335261524a468a3d862 WHIRLPOOL 499a2ec03b0ad79de042cb940456bc2d64cfc079934e2194aab3695c171ef7b66891c2cdc6786b3c6f86975c0c53a5e6f800f7ea585700580c084de318d0c2e7
+MISC ChangeLog 21420 SHA256 d21a4789f03a175b91e0c2759f025f6b83a2be5dadfd04c1f27aaeddbf4987ab SHA512 30986a10e4489a01cf30b939463fe54ff828434e22b814f151b685dc2480eea4b6c680f42ac2cc0c6199cbd879df4b99910071adf746e75fef976d8b7e49f67a WHIRLPOOL 3e317315d2b2a29b47cacc2421fe5696ffc53e4b762dfdd5993b6d0e913d50778df12c7336c8f9a6aadb59d70c61d55179ab1b0e3dc27986b0b232c0ca2112c7
MISC metadata.xml 3736 SHA256 376b65feea8c2f85dccad2e564cc6111f2dc2de2a3b785a4c10af8c95c4920ee SHA512 93933d1ddfce67739e0647adce2f9253ae596429c794b73562737b508400a0fa7af93eae06808b088888b1d44f421ce4765cc6b56b9b5356140af80ca36bebfc WHIRLPOOL 7ef396db2e624c2798ba30ad4b8099237fb699c5e94cd1470ec6161a068f1e815930a87104545b4b98183784465a9a5f9dc051beb99ef1c5731e61f42f5c7381
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0
-iQIcBAEBCAAGBQJUV8O1AAoJELhOzYlK7nn/YrwP/06OU3E5DscURHcFMPlZvwLm
-xw1e/4PoP1N2/NBHc/pWY1XfH8R+/FdTTzH57OKD/WbfQNVGwJKul47dwS+Wh/QG
-3NJvNefJBhILoUOoUAbzCMv2KEaYchUdpv3aL/rWGewTLW42uw7xHjaq8gpPjPhW
-i001oExe1ndj0fPw4CtdSGhWMejif8mICuRBngVedSdXQLrGYfBMTSy/4PCqDzhy
-EHRHzHoNtK6k9ehrkxS/+9PI0t08yuHr0pUPn3kU/kxJyn8C7ZUXlrcx7O4nftHH
-q4lM3Y4qb5N9sKQ9FRJyQPGtgHJjQAFvEFytIe97SHmoTWRd487AV4UKfQrNexYY
-y9eJtzVcK+a9Xpyx7bhM5AopED23ohv3ltez6SECX/ZCGpuc4HbirLcMG4F54PHo
-dzCWOx0QYhQcgACDSd5NaGUMdDZA0fjbef3hYXZXT1YIV0JoQK6rdpLll//mycyg
-K5TKauVKCYavpkn8HeHwKs9hNuSXYk0jA+AauY0MQMWXi848DTLeqdSPGe/HsZ9L
-GCjrr4jfigIA0QbaowdYDZMbIVnm3cK/HCWAR8GSWaKiKIhP1w37FY2zOT0Gv3OU
-v9mCnmE27P76kWjfzVFN7er5drt0lEfztUj6vkSglJPsZM9YBfu90WPi2QPVMkav
-uqJUGaQpCcvNBPJYL8Dg
-=8C/X
+iQIcBAEBCAAGBQJUW/fjAAoJELhOzYlK7nn/IJYP/1RT7dpTeNyj0HG7LHedrur+
+SdYsrSTAvAGmtmdYB//Wz+LLKAvQUCvFxquDVnwiIEemNHHRYzzkd9MTDvqSRoMx
+4Tb4ZUXgB7ULwrEHGvEKkqWF63463hFuPQm4kWTPNHtSWthxZl66W326yu6xySIZ
+xIASlnHwnxNQ0+5WcGIh/pGQ/erKHx/ekNt35SJODKk+5Sz0jPRmO+D3iEbn19QO
+rhqj6rUqhIwBv7qUeR+Swl33axkd/vdvHUXaE/fDb+/R/ibQNZHbzAapWysLvDtR
+ptwSyPYjE37klExgxjoIMs2yIOb/NBULLdv08pawhbBGMSSo2hteJZCN1pzLgE1f
+j2jIrAN7sFO5zs4KE2FIS2uH8tCu/ezqXLYZnniKacCvhxEF1sDi9NenWlQP4tmk
+4VGUhjWNkM3u0HN+N9Nh/jC325w4QAIqxWI2aUyZGIHS/IsEiiVNedNW1u8AGrV5
+Wal0EorLddV+dY/kl9wni2PN350BQaRPhHDvpqoKy0D0seWKUxSd/0NmizYXhJq8
+WYpMDthdNFSfDKGof9Ev0gg9zJt+/Oo4epOt9x1+0gbzU+jqW8KXw3Xw8326/6P1
+6LZlcUVyad9wKWNh5URDdF5wpFSHDymtGIfYijHgIBU1uWwKf9HEb92sXuEuwihF
+jWcewFoJfsQcQUROwYFS
+=oe39
-----END PGP SIGNATURE-----
--- /dev/null
+Patch from: https://www.redhat.com/archives/libvir-list/2014-November/msg00114.html
+
+From: Eric Blake <eblake redhat com>
+To: libvir-list redhat com
+Subject: [libvirt] [PATCH] CVE-2014-7823: dumpxml: security hole with migratable flag
+Date: Wed, 5 Nov 2014 17:30:46 +0100
+---
+
+Commit 28f8dfd (v1.0.0) introduced a security hole: in at least
+the qemu implementation of virDomainGetXMLDesc, the use of the
+flag VIR_DOMAIN_XML_MIGRATABLE (which is usable from a read-only
+connection) triggers the implicit use of VIR_DOMAIN_XML_SECURE
+prior to calling qemuDomainFormatXML. However, the use of
+VIR_DOMAIN_XML_SECURE is supposed to be restricted to read-write
+clients only. This patch treats the migratable flag as requiring
+the same permissions, rather than analyzing what might break if
+migratable xml no longer includes secret information.
+
+Fortunately, the information leak is low-risk: all that is gated
+by the VIR_DOMAIN_XML_SECURE flag is the VNC connection password;
+but VNC passwords are already weak (FIPS forbids their use, and
+on a non-FIPS machine, anyone stupid enough to trust a max-8-byte
+password sent in plaintext over the network deserves what they
+get). SPICE offers better security than VNC, and all other
+secrets are properly protected by use of virSecret associations
+rather than direct output in domain XML.
+
+* src/remote/remote_protocol.x (REMOTE_PROC_DOMAIN_GET_XML_DESC):
+Tighten rules on use of migratable flag.
+* src/libvirt-domain.c (virDomainGetXMLDesc): Likewise.
+
+Signed-off-by: Eric Blake <eblake redhat com>
+---
+
+The libvirt-security list agreed that this did not need an embargo
+because it is low-risk; but I'm on the road this week, so while
+this patch for master can go in now, I won't complete the backport
+to all the affected stable branches (everything since v1.0.0) or
+do the Libvirt Security Notice writeup until Monday.
+
+ src/libvirt-domain.c | 3 ++-
+ src/remote/remote_protocol.x | 1 +
+ 2 files changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
+index 7dc3146..2b0defc 100644
+--- a/src/libvirt-domain.c
++++ b/src/libvirt-domain.c
+@@ -2607,7 +2607,8 @@ virDomainGetXMLDesc(virDomainPtr domain, unsigned int flags)
+ virCheckDomainReturn(domain, NULL);
+ conn = domain->conn;
+
+- if ((conn->flags & VIR_CONNECT_RO) && (flags & VIR_DOMAIN_XML_SECURE)) {
++ if ((conn->flags & VIR_CONNECT_RO) &&
++ (flags & (VIR_DOMAIN_XML_SECURE | VIR_DOMAIN_XML_MIGRATABLE))) {
+ virReportError(VIR_ERR_OPERATION_DENIED, "%s",
+ _("virDomainGetXMLDesc with secure flag"));
+ goto error;
+diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x
+index db12cda..ebf4530 100644
+--- a/src/remote/remote_protocol.x
++++ b/src/remote/remote_protocol.x
+@@ -3255,6 +3255,7 @@ enum remote_procedure {
+ * @generate: both
+ * @acl: domain:read
+ * @acl: domain:read_secure:VIR_DOMAIN_XML_SECURE
++ * @acl: domain:read_secure:VIR_DOMAIN_XML_MIGRATABLE
+ */
+ REMOTE_PROC_DOMAIN_GET_XML_DESC = 14,
+
+--
+1.9.3
+
--- /dev/null
+Patch from: https://www.redhat.com/archives/libvir-list/2014-November/msg00114.html
+
+Backported to version 1.2.9: (Matthias Maier <tamiko@gentoo.org>)
+In libvirt versions prior to 1.2.10 the function
+ char*
+ virDomainGetXMLDesc(virDomainPtr domain, unsigned int flags)
+is defined in libvirt.c
+
+
+From: Eric Blake <eblake redhat com>
+To: libvir-list redhat com
+Subject: [libvirt] [PATCH] CVE-2014-7823: dumpxml: security hole with migratable flag
+Date: Wed, 5 Nov 2014 17:30:46 +0100
+---
+
+Commit 28f8dfd (v1.0.0) introduced a security hole: in at least
+the qemu implementation of virDomainGetXMLDesc, the use of the
+flag VIR_DOMAIN_XML_MIGRATABLE (which is usable from a read-only
+connection) triggers the implicit use of VIR_DOMAIN_XML_SECURE
+prior to calling qemuDomainFormatXML. However, the use of
+VIR_DOMAIN_XML_SECURE is supposed to be restricted to read-write
+clients only. This patch treats the migratable flag as requiring
+the same permissions, rather than analyzing what might break if
+migratable xml no longer includes secret information.
+
+Fortunately, the information leak is low-risk: all that is gated
+by the VIR_DOMAIN_XML_SECURE flag is the VNC connection password;
+but VNC passwords are already weak (FIPS forbids their use, and
+on a non-FIPS machine, anyone stupid enough to trust a max-8-byte
+password sent in plaintext over the network deserves what they
+get). SPICE offers better security than VNC, and all other
+secrets are properly protected by use of virSecret associations
+rather than direct output in domain XML.
+
+* src/remote/remote_protocol.x (REMOTE_PROC_DOMAIN_GET_XML_DESC):
+Tighten rules on use of migratable flag.
+* src/libvirt-domain.c (virDomainGetXMLDesc): Likewise.
+
+Signed-off-by: Eric Blake <eblake redhat com>
+---
+
+The libvirt-security list agreed that this did not need an embargo
+because it is low-risk; but I'm on the road this week, so while
+this patch for master can go in now, I won't complete the backport
+to all the affected stable branches (everything since v1.0.0) or
+do the Libvirt Security Notice writeup until Monday.
+
+ src/libvirt-domain.c | 3 ++-
+ src/remote/remote_protocol.x | 1 +
+ 2 files changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/src/libvirt.c b/src/libvirt.c
+index 7dc3146..2b0defc 100644
+--- a/src/libvirt.c
++++ b/src/libvirt.c
+@@ -4369,7 +4369,8 @@ virDomainGetXMLDesc(virDomainPtr domain, unsigned int flags)
+ virCheckDomainReturn(domain, NULL);
+ conn = domain->conn;
+
+- if ((conn->flags & VIR_CONNECT_RO) && (flags & VIR_DOMAIN_XML_SECURE)) {
++ if ((conn->flags & VIR_CONNECT_RO) &&
++ (flags & (VIR_DOMAIN_XML_SECURE | VIR_DOMAIN_XML_MIGRATABLE))) {
+ virReportError(VIR_ERR_OPERATION_DENIED, "%s",
+ _("virDomainGetXMLDesc with secure flag"));
+ goto error;
+diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x
+index db12cda..ebf4530 100644
+--- a/src/remote/remote_protocol.x
++++ b/src/remote/remote_protocol.x
+@@ -3255,6 +3255,7 @@ enum remote_procedure {
+ * @generate: both
+ * @acl: domain:read
+ * @acl: domain:read_secure:VIR_DOMAIN_XML_SECURE
++ * @acl: domain:read_secure:VIR_DOMAIN_XML_MIGRATABLE
+ */
+ REMOTE_PROC_DOMAIN_GET_XML_DESC = 14,
+
+--
+1.9.3
+
--- /dev/null
+# 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.1 2014/11/06 22:36:08 tamiko Exp $
+
+EAPI=5
+
+#BACKPORTS=062ad8b2
+AUTOTOOLIZE=yes
+
+MY_P="${P/_rc/-rc}"
+
+inherit eutils user autotools linux-info systemd readme.gentoo
+
+if [[ ${PV} = *9999* ]]; then
+ inherit git-2
+ EGIT_REPO_URI="git://libvirt.org/libvirt.git"
+ AUTOTOOLIZE=yes
+ SRC_URI=""
+ KEYWORDS=""
+else
+ SRC_URI="http://libvirt.org/sources/${MY_P}.tar.gz
+ ftp://libvirt.org/libvirt/${MY_P}.tar.gz
+ ${BACKPORTS:+
+ http://dev.gentoo.org/~cardoe/distfiles/${MY_P}-${BACKPORTS}.tar.xz}"
+ KEYWORDS="~amd64 ~x86"
+fi
+S="${WORKDIR}/${P%_rc*}"
+
+DESCRIPTION="C toolkit to manipulate virtual machines"
+HOMEPAGE="http://www.libvirt.org/"
+LICENSE="LGPL-2.1"
+SLOT="0/${PV}"
+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 ) )"
+# one? ( dev-libs/xmlrpc-c )
+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"
+ [[ -n ${BACKPORTS} ]] && \
+ EPATCH_FORCE=yes EPATCH_SUFFIX="patch" EPATCH_SOURCE="${S}/patches" \
+ epatch
+
+ 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}"/${P}-cve-2014-7823.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="${myconf} $(use_with libvirtd)"
+
+ ## enable/disable the daemon using avahi to find VMs
+ myconf="${myconf} $(use_with avahi)"
+
+ ## hypervisors on the local host
+ myconf="${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="${myconf} $(use_with openvz)"
+ myconf="${myconf} $(use_with lxc)"
+ if use virtualbox && has_version app-emulation/virtualbox-ose; then
+ myconf="${myconf} --with-vbox=/usr/lib/virtualbox-ose/"
+ else
+ myconf="${myconf} $(use_with virtualbox vbox)"
+ fi
+ myconf="${myconf} $(use_with uml)"
+ myconf="${myconf} $(use_with qemu)"
+ myconf="${myconf} $(use_with qemu yajl)" # Use QMP over HMP
+ myconf="${myconf} $(use_with phyp)"
+ myconf="${myconf} --with-esx"
+ myconf="${myconf} --with-vmware"
+
+ ## additional host drivers
+ myconf="${myconf} $(use_with virt-network network)"
+ myconf="${myconf} --with-storage-fs"
+ myconf="${myconf} $(use_with lvm storage-lvm)"
+ myconf="${myconf} $(use_with iscsi storage-iscsi)"
+ myconf="${myconf} $(use_with parted storage-disk)"
+ myconf="${myconf} $(use_with lvm storage-mpath)"
+ myconf="${myconf} $(use_with rbd storage-rbd)"
+ myconf="${myconf} $(use_with numa numactl)"
+ myconf="${myconf} $(use_with numa numad)"
+ myconf="${myconf} $(use_with selinux)"
+ myconf="${myconf} $(use_with fuse)"
+
+ # udev for device support details
+ myconf="${myconf} $(use_with udev)"
+
+ # linux capability support so we don't need privileged accounts
+ myconf="${myconf} $(use_with caps capng)"
+
+ ## auth stuff
+ myconf="${myconf} $(use_with policykit polkit)"
+ myconf="${myconf} $(use_with sasl)"
+
+ # network bits
+ myconf="${myconf} $(use_with macvtap)"
+ myconf="${myconf} $(use_with pcap libpcap)"
+ myconf="${myconf} $(use_with vepa virtualport)"
+ myconf="${myconf} $(use_with firewalld)"
+
+ ## other
+ myconf="${myconf} $(use_enable nls)"
+
+ # user privilege bits fir qemu/kvm
+ if use caps; then
+ myconf="${myconf} --with-qemu-user=qemu"
+ myconf="${myconf} --with-qemu-group=qemu"
+ else
+ myconf="${myconf} --with-qemu-user=root"
+ myconf="${myconf} --with-qemu-group=root"
+ fi
+
+ # audit support
+ myconf="${myconf} $(use_with audit)"
+
+ # wireshark dissector
+ myconf="${myconf} $(use_with wireshark-plugins wireshark-dissector)"
+
+ ## stuff we don't yet support
+ myconf="${myconf} --without-netcf"
+
+ # we use udev over hal
+ myconf="${myconf} --without-hal"
+
+ # locking support
+ myconf="${myconf} --without-sanlock"
+
+ # systemd unit files
+ myconf="${myconf} $(use_with systemd systemd-daemon)"
+ use systemd && myconf="${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 \
+ --docdir=/usr/share/doc/${PF} \
+ --with-remote \
+ --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
+}