From e2d84e38284aeb9d522a7e935554340ddf0e4a6f Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Wed, 15 Nov 2017 17:13:45 +0000 Subject: gentoo resync : 15.11.2017 --- app-emulation/containerd/Manifest | 2 + .../containerd/containerd-1.0.0_beta3.ebuild | 52 ++ app-emulation/docker-swarm/Manifest | 2 +- .../docker-swarm/docker-swarm-1.2.5.ebuild | 4 +- app-emulation/libvirt/Manifest | 8 +- .../libvirt-3.6.0-ssh-malicious-hostname-fix.patch | 47 -- .../libvirt/files/libvirt-3.9.0-tirpc.patch | 13 + app-emulation/libvirt/libvirt-3.6.0.ebuild | 382 ---------- app-emulation/libvirt/libvirt-3.8.0-r1.ebuild | 4 +- app-emulation/libvirt/libvirt-3.9.0.ebuild | 383 ++++++++++ app-emulation/lxc/Manifest | 3 +- app-emulation/lxc/files/lxc.initd.6 | 118 --- app-emulation/lxc/lxc-2.0.8.ebuild | 17 +- app-emulation/qemu-guest-agent/Manifest | 10 +- .../qemu-guest-agent-2.10.1.ebuild | 82 +++ .../qemu-guest-agent/qemu-guest-agent-2.5.0.ebuild | 11 +- .../qemu-guest-agent/qemu-guest-agent-2.6.0.ebuild | 11 +- .../qemu-guest-agent/qemu-guest-agent-2.8.1.ebuild | 9 +- .../qemu-guest-agent/qemu-guest-agent-2.9.0.ebuild | 9 +- app-emulation/qemu/Manifest | 26 +- .../qemu/files/qemu-2.10.0-CVE-2017-13711.patch | 80 --- .../qemu/files/qemu-2.10.1-CVE-2017-15268.patch | 54 ++ .../qemu/files/qemu-2.10.1-CVE-2017-15289.patch | 58 ++ .../qemu/files/qemu-2.9.0-CVE-2017-10664.patch | 47 -- .../qemu/files/qemu-2.9.0-CVE-2017-10806.patch | 50 -- .../qemu/files/qemu-2.9.0-CVE-2017-11334.patch | 40 -- .../qemu/files/qemu-2.9.0-CVE-2017-11434.patch | 29 - .../qemu/files/qemu-2.9.0-CVE-2017-7493.patch | 174 ----- .../qemu/files/qemu-2.9.0-CVE-2017-8112.patch | 22 - .../qemu/files/qemu-2.9.0-CVE-2017-8309.patch | 22 - .../qemu/files/qemu-2.9.0-CVE-2017-8379.patch | 76 -- .../qemu/files/qemu-2.9.0-CVE-2017-8380.patch | 34 - .../qemu/files/qemu-2.9.0-CVE-2017-9503-1.patch | 122 ---- .../qemu/files/qemu-2.9.0-CVE-2017-9503-2.patch | 114 --- .../qemu/files/qemu-2.9.0-CVE-2017-9524-1.patch | 80 --- .../qemu/files/qemu-2.9.0-CVE-2017-9524-2.patch | 197 ----- app-emulation/qemu/qemu-2.10.0-r1.ebuild | 795 -------------------- app-emulation/qemu/qemu-2.10.0.ebuild | 781 -------------------- app-emulation/qemu/qemu-2.10.1.ebuild | 796 +++++++++++++++++++++ app-emulation/qemu/qemu-2.9.0-r56.ebuild | 793 -------------------- app-emulation/qemu/qemu-2.9.0-r57.ebuild | 796 --------------------- app-emulation/qemu/qemu-9999.ebuild | 19 +- 42 files changed, 1491 insertions(+), 4881 deletions(-) create mode 100644 app-emulation/containerd/containerd-1.0.0_beta3.ebuild delete mode 100644 app-emulation/libvirt/files/libvirt-3.6.0-ssh-malicious-hostname-fix.patch create mode 100644 app-emulation/libvirt/files/libvirt-3.9.0-tirpc.patch delete mode 100644 app-emulation/libvirt/libvirt-3.6.0.ebuild create mode 100644 app-emulation/libvirt/libvirt-3.9.0.ebuild delete mode 100644 app-emulation/lxc/files/lxc.initd.6 create mode 100644 app-emulation/qemu-guest-agent/qemu-guest-agent-2.10.1.ebuild delete mode 100644 app-emulation/qemu/files/qemu-2.10.0-CVE-2017-13711.patch create mode 100644 app-emulation/qemu/files/qemu-2.10.1-CVE-2017-15268.patch create mode 100644 app-emulation/qemu/files/qemu-2.10.1-CVE-2017-15289.patch delete mode 100644 app-emulation/qemu/files/qemu-2.9.0-CVE-2017-10664.patch delete mode 100644 app-emulation/qemu/files/qemu-2.9.0-CVE-2017-10806.patch delete mode 100644 app-emulation/qemu/files/qemu-2.9.0-CVE-2017-11334.patch delete mode 100644 app-emulation/qemu/files/qemu-2.9.0-CVE-2017-11434.patch delete mode 100644 app-emulation/qemu/files/qemu-2.9.0-CVE-2017-7493.patch delete mode 100644 app-emulation/qemu/files/qemu-2.9.0-CVE-2017-8112.patch delete mode 100644 app-emulation/qemu/files/qemu-2.9.0-CVE-2017-8309.patch delete mode 100644 app-emulation/qemu/files/qemu-2.9.0-CVE-2017-8379.patch delete mode 100644 app-emulation/qemu/files/qemu-2.9.0-CVE-2017-8380.patch delete mode 100644 app-emulation/qemu/files/qemu-2.9.0-CVE-2017-9503-1.patch delete mode 100644 app-emulation/qemu/files/qemu-2.9.0-CVE-2017-9503-2.patch delete mode 100644 app-emulation/qemu/files/qemu-2.9.0-CVE-2017-9524-1.patch delete mode 100644 app-emulation/qemu/files/qemu-2.9.0-CVE-2017-9524-2.patch delete mode 100644 app-emulation/qemu/qemu-2.10.0-r1.ebuild delete mode 100644 app-emulation/qemu/qemu-2.10.0.ebuild create mode 100644 app-emulation/qemu/qemu-2.10.1.ebuild delete mode 100644 app-emulation/qemu/qemu-2.9.0-r56.ebuild delete mode 100644 app-emulation/qemu/qemu-2.9.0-r57.ebuild (limited to 'app-emulation') diff --git a/app-emulation/containerd/Manifest b/app-emulation/containerd/Manifest index fd3c3dc4d543..956eac64daff 100644 --- a/app-emulation/containerd/Manifest +++ b/app-emulation/containerd/Manifest @@ -1,9 +1,11 @@ DIST containerd-0.2.9_p20170605.tar.gz 1229549 SHA256 c506121c49e3bfea27018aa77e09e4734067f84ae85b6ef75ec31b488a91ae54 SHA512 900cf9c251c4de0f9848fb5bf26537226c1361d1a64a0fba853bda3805cb141fc2a849442fe885f0ee228b3e3a7018440af18898b484a54a7b75b4a86538aaa9 WHIRLPOOL 880f19a994f623b7cd8c3f771b5c56468681de349ae4196e60ffcb5a34d42ef423d8eefc82c07134c9e50c33bc0ecbfc1a9e47c3df987050d8dcb82da0178d80 DIST containerd-0.2.9_p20170917.tar.gz 1140788 SHA256 4d2b6e30bcc6c4bb901d6b9f19b5ac1d4a2d9b17075a9b1f110102920d01f64a SHA512 c749bda691197ec8a7603db9ad92f2800a3f065143430a660333b7862518deb4c158a1c1fd01671dff438b40988d4a64d8f06bab05496b8728c6e2f57cd7da0a WHIRLPOOL 75cb3467a94af50bef52377f309d7c85386475789fab3d2758679f022b516735728a1ac2c54307954a14100c4f84059d8fd5e8376270fdd69e572cff43453fa0 DIST containerd-1.0.0_beta2.tar.gz 3681494 SHA256 3130384a814bc0a43fe3b76e2bbb2db2372fdc96490b76f8b278362ebc0d3fb1 SHA512 cecb4d2e0dccbc27c1e59f3e49f8fd5b08445988e49aa4b8a2a5910851509d51e001b5295905288c29fee2d91eadf2180a6b86947e130abe1b33a9a01416a286 WHIRLPOOL 4d526904a146971d57adbde6102e4fe42e0d303b102e721e34aaea3f54ef3176586dedf31a347f52d95a6e5c1850454b31ab3e5c6195b868929d32fde6218eb3 +DIST containerd-1.0.0_beta3.tar.gz 3696070 SHA256 efd40a7fdcb07b23273c389453559c0521c2cf4baf669cdf134cd10a21627ee4 SHA512 45853001bcf57f7289747b71215eb0bc60b18e54db73896779f294db1b72374cf36c8792371a8d46ddfe283dfc9655f10cb61b3a74420a79a4abb9fa89b76323 WHIRLPOOL 63c47a18c4d5f09043d0449a042c453451bfe4fedcb1e22eb35080c3730b1f181fcb58131f58ecf8e819688ccdfd9dbe4fb70cb9f3d08782257bb6126f05e0c5 EBUILD containerd-0.2.9_p20170605.ebuild 1000 SHA256 d8b66bb902a1e5ca6c58efc0c1b534832457bda08825f55ae6c177458761c9c8 SHA512 adec8a0e7d4d2e4dc200d470c1cbd2dbd38daf2ae2b931c9d32f5cd1b7c580cc1222c628c2e9b22fb64098c800c956a636e6167d6c7a6f391ec280b77a438a04 WHIRLPOOL 744713fcdd4726983c9cd4c1959446d9631d523e62aa28ee47b5ca679609d59701bc0f7c122c58e65325fa24917e68752e882ee4d9a0998328e88b717920070f EBUILD containerd-0.2.9_p20170917.ebuild 1001 SHA256 e05ed2f3fabbd8d0466506292b0a75e607ca3de9d3e799681eee9754ad5e1313 SHA512 d206822a85e56f2226b1099b98605800bb3f1aad7aac1846ece87c75b740e6e6aacee0def14925c96ea8ff86cf21622e5821e6112a39ea75edef1dfbeaf71b1f WHIRLPOOL 0eff2136f756f39b09dd1205052d3e6f5efa6d9f6dd5fc2ce8eef8e8b539946cab211812b6682275a79bbbb31a32c63a203cdeb62381ad309c39336512170c97 EBUILD containerd-1.0.0_beta2.ebuild 1228 SHA256 036490a9b30c448eb8912f7eb1e2630dc21b7751e31fdab757d7a9424eba7c36 SHA512 77a154a7a0d4f10e247e9f2b4a1f3c0b44f7cfad18c59f86afe25e77fccd3686a1e96d34603aae24889ad422037aa7cda8c80822f7168544bd2af0b6e828e9ed WHIRLPOOL 9a3162aec6cdac742c3aeabda449ad0934a1ff7dc8aa3a45fa8cbac252595081dd809c4712dacf389653ff47bf7eb3be27d918a6f48fad18c4ba320a437f480f +EBUILD containerd-1.0.0_beta3.ebuild 1248 SHA256 76ddfe2708657191e0a21649dbbe30b6f6e6cd8c209dc966a755cd4ebbf0e028 SHA512 2ab70d4fd26b1c9e0a7e35810b7d33a75f93961ccaae27c0577612fc55c3c71279fa18e05517d1f5df6e872d8a693eb7c3958d40a6aba9fbe5cd66fd711b8887 WHIRLPOOL 043f1b943a3002922adc139de22026d7a10677537c53883e3a5f581116a528ab6f2c45c20236bed9d3028b875fdf1b6b18eb0bf12919991612d3b8c551d1a968 EBUILD containerd-9999.ebuild 965 SHA256 b7e8d103eb3c8439cab6cbc0eeb7a0766a4611eb2f1dad0b68f7f299aa5fc912 SHA512 b2acd6bd1c237a1058cec02875877d82e2e8c568bf3143cca020c64e13a0649975e3adcdb68540216e8ce1bcdbc7141eda8476c1c01ee2ca313120eca2850012 WHIRLPOOL 6ea886f31c397d58103e7f7892826dbabe71e3c3318d81cb71c79f17a035ac3e52a68a71a3ba42ccab251d3ca9442101eabdf776a21146d89eef985a2ac790f1 MISC ChangeLog 3648 SHA256 23d267d9839cf9ddd25ec70935aa9cb0d751f1e1fec5fe04b0ab363ac5305df4 SHA512 6692f12dbd09bdfa0f7aef7a9d96e31679f2f8c0ea83c0ee265cf84557ad3cf644410c7372142206509925ac99e500adc9b73390d7868c1a014e76a2fdfc8b9d WHIRLPOOL 7cced3a814774acce4c1afe07e5522845f70f084aeb9975dba4351e357b653b1559267e17b4561029a39c014e149ecbad2501e0ed094ad361414794df9dc7d94 MISC metadata.xml 909 SHA256 649d7ed77a830933c54e829d88186959f369abb5575e6b5c51f76496da04e95e SHA512 bc18fe0db42a7d9eccc8757f18a92ab3c46f1941f0cc28e0ed4c7be2569b7cec64e1ef49bbddbaab2afea5925f67bb4f6a06f4d1015e29e73c9742f475731d03 WHIRLPOOL 52e6bdcbefc6b473da57e3920fc67d0d593e0028e87f9d4497bc095416ff630671634ef089d62f153e9cfd25c1efb702968fa3d4ef04e4c7f21bf776b2c40c00 diff --git a/app-emulation/containerd/containerd-1.0.0_beta3.ebuild b/app-emulation/containerd/containerd-1.0.0_beta3.ebuild new file mode 100644 index 000000000000..1f0795bfd426 --- /dev/null +++ b/app-emulation/containerd/containerd-1.0.0_beta3.ebuild @@ -0,0 +1,52 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 +EGO_PN="github.com/containerd/${PN}" + +inherit toolchain-funcs + +if [[ ${PV} == *9999 ]]; then + inherit golang-vcs +else + MY_PV="${PV/_beta/-beta.}" + EGIT_COMMIT="v${MY_PV}" + CONTAINERD_COMMIT="2b8ed96" + SRC_URI="https://${EGO_PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz" + KEYWORDS="~amd64 ~arm ~ppc64" + inherit golang-vcs-snapshot +fi + +DESCRIPTION="A daemon to control runC" +HOMEPAGE="https://containerd.tools" + +LICENSE="Apache-2.0" +SLOT="0" +IUSE="hardened +seccomp" + +DEPEND="sys-fs/btrfs-progs" +RDEPEND="|| ( >=app-emulation/docker-runc-1.0.0_rc4 + >=app-emulation/runc-1.0.0_rc4 ) + seccomp? ( sys-libs/libseccomp )" + +S=${WORKDIR}/${P}/src/${EGO_PN} + +src_prepare() { + default + if [[ ${PV} != *9999* ]]; then + sed -i -e "s/git describe --match.*$/echo ${PV})/"\ + -e "s/git rev-parse HEAD.*$/echo $CONTAINERD_COMMIT)/"\ + -e "s/-s -w//" \ + Makefile || die + fi +} + +src_compile() { + local options=( $(usex seccomp "seccomp" "") ) + export GOPATH="${WORKDIR}/${P}" # ${PWD}/vendor + LDFLAGS=$(usex hardened '-extldflags -fno-PIC' '') emake BUILDTAGS="${options[@]}" +} + +src_install() { + dobin bin/containerd{-shim,-stress,} bin/ctr +} diff --git a/app-emulation/docker-swarm/Manifest b/app-emulation/docker-swarm/Manifest index 33d2b82d4397..fdbd073a37c7 100644 --- a/app-emulation/docker-swarm/Manifest +++ b/app-emulation/docker-swarm/Manifest @@ -5,6 +5,6 @@ DIST gogo-protobuf-0.3.tar.gz 2116795 SHA256 82222a5ad3bdc53fb60851df05acc16e757 DIST logrus-0.11.0.tar.gz 24165 SHA256 dd1a009e0be6fa4df0609797a044d46ee467117d720ba444043ca61d6eb03429 SHA512 ee0b813e277cef0533800a966e6e07884b8de64e75c200439979f00986d84f98cfc750f7d4cb2a2b57d6524941fbba0c6211ce37da50d9a8ca99274f81639620 WHIRLPOOL 3fa3a96267f46ac583466ad7831f85f2c42e57c7da3ca6cae2335de5892c5e6e5c7a40f0208dacae8ac6f95be5cd6b24ea23b7d4c986c407bc848fab3f7e0680 DIST logrus-airbrake-hook-2.1.1.tar.gz 3896 SHA256 10a8f668ac387951204c93a0e7d9f14eea03ce687a312840ccd07c9fa437ccaf SHA512 8559f821731ee086a267f43f6e150e18b24a32a2556c45499b2ec42a85642a0581a862fc827b8b9a1949d003b5e36e69972df92a005111b94e2aa9678c336240 WHIRLPOOL 873df0a3aa7fba684e65d2a9d8c146d7806eab5d4216c867ada4ced05329b01a2b1448d937d6052bbc1d22fb28163de8b5288054749c305a5938b0d0a80e9bb1 EBUILD docker-swarm-1.2.0.ebuild 946 SHA256 ff240478a607ebfeddf2a85914f316198b86fbde40020b1c60dc4385c5d8fb46 SHA512 2cca2506e1638caf79f28f088cb8184fef4fdab87bfc723d29c7a1337a20b942f6e50a7b77d130d1720e2d9b764d360c1644fc39a42008d32648335b1f32144b WHIRLPOOL b4d79283a9d2c27e5a3e0d6ef04835bfc733f4da26bb49909e8218ce4ee98564a31434847f1c0b22dcc4561e25d4f053c7a206ed8a7b4bafbda83734ea900d68 -EBUILD docker-swarm-1.2.5.ebuild 2127 SHA256 df4cab5074bf561905d069a72f4593e226fcd1d42e5ed27cb5f3071bb2b12ef8 SHA512 187e42b66e2ce4eca9501ca564855f422a6f24fb8442d54c93f0e16f84ac2a9487e507d5fc00271777bc3036e62c4a0e34daf08d40b43167c6e573ce616e6673 WHIRLPOOL 7121cb09459936411a896311ad51e4ff7c78184740cbdd67aff8f3d0b73227f341ed930e7f6fa0bfe63e7e03f3e3fb607f240cd9d6a29ab4fd43f95d3038fcf8 +EBUILD docker-swarm-1.2.5.ebuild 2144 SHA256 f1bbdee4a24663b8b8ca462b652e033046722f442060e6eab829811fbed521aa SHA512 47509fe75e4701a012e8224aeef267bcc7da8e6108535a670f74caa81fddba264c789cef95cb89d94aa79395ad139a32ea5cc732221ecd7798831767cbbf77bb WHIRLPOOL e8fde78c0312e098ed1d61bd691010945e695609512132746ef262721fa26a0481984233f5435ce64e9aec81fb808eb9ac3afffa0395248c9e33658765926fab MISC ChangeLog 2460 SHA256 f903c61428157d6ff462ffb9248c14da0c4aeff8be414bf7a08638982bc2c0bd SHA512 1afdc75908cab53adec370877c75d72b7bc38a504149ca2d5559ed539a4f5a93881cb46c890f64fe2a9c2f536fe5f552a7e7a5e1e95de662243a0acb760e188e WHIRLPOOL 8702121913fa4c6bb2ec762c11ba131fb8ddf90a5da18d3e4ec7ad6c7abcbbe6b0b4c2877c51d82a0a9e68039803c424a9efd1ce3dbe67917e97b70c3b3e1957 MISC metadata.xml 303 SHA256 c129ccb5de61fdf45e025d396196dfe982f2e12b43ceaee498e107cc7d1f17a0 SHA512 b724e0dbde2212d3071b201aca8572059e0756f3be2a056097c84ea802ae4365a9682767725a02e3333f5f5cbd31f8e30a0a2b54b3e32619d75fbaa8400a9c22 WHIRLPOOL 6a6ed04b9e88a89149b7dda7655b888e25550c3cb7fce81abc8e8586202d3cf1ab0f2c431dbb9e4229047a61e18cef7bfeabc0ec6450a085e0ec894a0e9df99d diff --git a/app-emulation/docker-swarm/docker-swarm-1.2.5.ebuild b/app-emulation/docker-swarm/docker-swarm-1.2.5.ebuild index ee87135b33ab..65a67d8c2b90 100644 --- a/app-emulation/docker-swarm/docker-swarm-1.2.5.ebuild +++ b/app-emulation/docker-swarm/docker-swarm-1.2.5.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2016 Gentoo Foundation +# Copyright 1999-2017 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 EAPI=6 @@ -69,7 +69,7 @@ src_unpack() { } src_compile() { - GOPATH="${S}" \ + GOPATH="${S}" GOBIN="${S}/bin" \ go install -v -work -x ${EGO_BUILD_FLAGS} "${EGO_PN}" [[ -x ${S}/bin/${PN#docker-} ]] || die } diff --git a/app-emulation/libvirt/Manifest b/app-emulation/libvirt/Manifest index e879cfa0e899..d259cb0a69cd 100644 --- a/app-emulation/libvirt/Manifest +++ b/app-emulation/libvirt/Manifest @@ -4,8 +4,8 @@ AUX libvirt-1.3.0-do_not_use_sysconf.patch 4072 SHA256 896d482d3aa9281977e6900e6 AUX libvirt-1.3.4-glibc-2.23.patch 2049 SHA256 8fa125da2a8e6dabf17fc47863597b2b3929d4d4b1e01ace1433a75ac4bc0ba2 SHA512 022b610c2e343c9cb595babcc8b2e5e0e0db1a19d6bfc9babdc817bc1e093ff12ee1c26304c188151fecc32481ffd225d7a3d36324613dd5b4ea7139280629c4 WHIRLPOOL 3cc039820865eafd1ea23eec81c3b4f842fe359e49a85d09925dddd5f8b0228adf62fa908cb345b9df0526ed9eb388f965d70ef99d73edcfaf20c5539fcb4559 AUX libvirt-3.0.0-fix_paths_for_apparmor.patch 2904 SHA256 77ccadc9bf80b029a3105ac7609b759d5b73c40fef03d4eabcb6c6c9bd3334f9 SHA512 be4aba4b9bd44bb2f1b4f269f573caafce746783e0a7c08ff72d03a96b9675261346ededaf1d6b6c89afaa6d2b88fe7fb0d9f120d40fd714179e6f9d209a6724 WHIRLPOOL 917b54d20a1a2567052de25f08b8296b392002292303eee11acfee486eb8437a767695325adc63a08f239edcbdceae9787f63cdebb313631c7e6880c97a54caf AUX libvirt-3.1.0-musl-fix-includes.patch 221 SHA256 40b1814d2a1d05a987242af46592a74feb612ccb3f064e93984bdad29d9c1fc7 SHA512 876c7dacedcce1d69938779b978b3a23b2f51128f121b4aa53f5f301d7740f90d77f335523210ed492b68b5f7a0b864b25a694ee562fb5e8ab1b6411d3da48e7 WHIRLPOOL d9d7f57cee28f1f6149f6de6f853f08679cbb9b3e82b019ff6046da525c1768ea3f7ef34cf3afa6033e87f80e8f5c74e5f2d129122d8df6edb371e743a3a3af5 -AUX libvirt-3.6.0-ssh-malicious-hostname-fix.patch 1770 SHA256 6dd8209b02a14f4db4cd4b3903d62418bec4a200b2c85eb597266eefc4fb0814 SHA512 177a85183d9a4b3e2a8be523cfd10c8dd8e7988aca69864c3ff55ebaf5576eebf904317ac0814e588be21909b21c1deb1dfca13f84f3af54ebbdb55e8f12f562 WHIRLPOOL 1935e293c8a438b326b6c617fd695f93e92c99b6bca13c7815a62ae04bc7c2dba885763595b02a7d4ec4f3235124ff03cea704f4e56ac7c613edbeca847c9225 AUX libvirt-3.8.0-CVE-2017-1000256.patch 3737 SHA256 af14abe57e4764eb35df8e104f992132e0ca9797d5b470adde6515f6c7c95c10 SHA512 2c3e88670ec9531207c60b89e8e2ec6188834e795cd0e698d63781209182801209d4097fd72607166853b54a9f301a160b575f757741da5aeb995d752bbcb80a WHIRLPOOL 61cfac579defb75b2d92622c3fafc25036f9b3d5260e296941188d541327b381397b4bf996c9e5c5b624aae82a76b43798bf3253b66d26e3f7f3e5fba70273f9 +AUX libvirt-3.9.0-tirpc.patch 550 SHA256 8f9ee62106e4a1689dc0b600969109ab1309454dbfad9257cda00382cdc6e876 SHA512 66ec3702d053f14534f1fd67bcaff970b3a8d7fe262ba379d299b6f9b9cefcb1e1ec0fae90669644d4d86ba0895586a04ab718a35ad0869384c9c6db74ccce49 WHIRLPOOL e637ccd06822aff4f66e2fc25d92ad3cad6b0637f57fe03fc87470a757495e828429a3ad936b9624af30ea3a67fdc3433b2510561e083b87a2ec1df2d33fc921 AUX libvirt-guests.confd 2430 SHA256 d5f85bb8c1d2010347f23badc422e98046b97a0066254739b5829fce07837d63 SHA512 78f419a89de7aabaad860903c24f1c070786fc1296d987e61dd537705b0e7f71a46c315888028f3826c3417e42861ca8471788be4ec5695e98427c5f18ae63fc WHIRLPOOL 4f06b9319f52b872f14f86da9aeeafecf176c46755955c7773badd0df239fdd76efaff50921565154fa24896d0e4b07df788e785ed6ff5f2308c0ba0e79a9418 AUX libvirt-guests.init-r2 5412 SHA256 f78ced5ebe644522c6ce102b3f6bcf932686243a50629559f988548c570cad3a SHA512 0f46ec5776c61d1776248779fa894b1a6d7b98d0eb8e8374b320c785c25d92468f087e350233b9152eb2cd0680f6b334c3a61684dabc7c5b559d3b55fdcb712d WHIRLPOOL 77ce5c6e615c94b437f13f8bfb2689cea7b8231a4aa227e83944fd66793a3daf0ada8c041c358f38c2f676dfc7fb071880df682dcc759f63e8e20f033e141d39 AUX libvirtd.confd-r5 740 SHA256 4f7fba7e64533868119c0f3355aa22932e163b208397323dc2cd96daadcc4079 SHA512 98f935589dbc5f2a99329f77fdf84c563fa0dc99404b7476603679478d68ce8dbea2c88645251d3c28f59e7bcae124ae632972146e8a8c3e0e9fcbfb27296f91 WHIRLPOOL cc40f10c1ab440efff318f4cac95c0923dfb3309e727d3de4a5dd5cd95181da76a6f1de4ad6740b99d0b65b6bbf5a5128ce24288f77a91268e74d2e8d8e95e49 @@ -14,10 +14,10 @@ AUX libvirtd.service.conf 401 SHA256 1cfb6f7dec5746364d9a4cccddb4b63f8ccd0ebf8bf AUX libvirtd.tmpfiles.conf 36 SHA256 0102a9bbbb6fc9764c2d49933a89d1661b3999aec53c6a66302cb0f21ce9c9fc SHA512 2b1c3c64dd6fa03d8c2ae24e7ce4aa7d754913214542a68a4e99f10fbc251fd23ee26e297a957d7b4b70eec8ef028c41fc915da3a85fbbd16143bb92d1de3aed WHIRLPOOL c51b2059f4eef0ceaf69e11018a6e51299be5aa21a56741366db4fe43a7998388fa6e5bf15d79c52ab66dd69d64c679003a0904c54033c8bdfc04c16bb5b8e4f AUX virtlockd.init-r1 570 SHA256 23ddea66fb2d85c17c382daa07abfabe7fa57d62406d2ca5df0c755f5dcc3834 SHA512 65a05d406200da9a534df5caa1b9cb2af97f0b03f64e6b4157322975fa754f59ae74fff9ec8301a6c0510e4b75e2b72a78cddf004a76109e18c375e83527cee5 WHIRLPOOL 7959e426986747165ef074ca52b8049aa4120b0206b7532330346552fe5811a46fa71b58e02fcd37e55b872e099ccc8688fcc3f30b2e2316e01a4220806d49b4 AUX virtlogd.init-r1 569 SHA256 1647c11779fd874bdc115234bae0f0f65278084541473d2825aa9864ad49f939 SHA512 0a3e083e742f9e0d8206ab9a48c63bbd395bdc24e5551e2cbeddffa3fb576a817b73dbafe646c392a35c354d6b65426a9b6f3ce3dcafc30077715e90684968c1 WHIRLPOOL e0fa334c60dac4aa1ff721c3c4e957a688e0a58297cb06249de50dd838c55eee3c1c00fcb4b1c06b74c1fb61c52354889a09bd2793c8623faa120489cac95c3a -DIST libvirt-3.6.0.tar.xz 14797704 SHA256 3a2c97f6950796f300f6a2e0404f4de8e51c3b9430cdb82738439adb0ac59e3d SHA512 6cde735a18cb71c9e6dbb25cd2a8f9c72d55ad7d74bdf97b00d784593f0bc59498917fb235ce04de4428899241520d87bf19c015b80282b3d0c12918d9b8b288 WHIRLPOOL 8185ad998158bac9aa6bc0dd0f590a3d9fb393ad94d308bdc84e60ac5c56e110d5f4a2355e2a10b01a6521d8261ae7484aee275e12a17cc7f2830f169e990596 DIST libvirt-3.8.0.tar.xz 14868712 SHA256 73eba834089ed0ce74e3183a7f12cf0c6f7de08e9a700b5456c62fb124f903f9 SHA512 fc48f29b493a5ec2b3586f6c5df0b8cb81f3f26be847bc42acfb6481d45970edc760dda0232ad57b95b8cf13382d0269dd3edf4a744040cda15b835d32d8c672 WHIRLPOOL af36d20c2713398f0d7aaf1b9fc2bcf978abc096d3070cb7cb1efa6680204e591e02b03340f4d862f6e7d1fabd4135cba23eef8ccd459264a44a052acf0e509e -EBUILD libvirt-3.6.0.ebuild 9705 SHA256 5d9511479f979dce30eef8ddc68a80b0e602461a459b8dd71f637d6628a44061 SHA512 e44a8cdfc9d9070c726610d6ec2f4191fdbc19fb2e3dceff4ac2a232aa73d43d8a7a2548909906c0d5d273c23e3fd2762d8a7379cdfa03a539d09d36d38dd9d9 WHIRLPOOL af6d2497a375d6639b3c0903abdc8c0cf1122b62a03de0825ade097eed2acefd18acc3781e3a05fc9a27afe26ddf69a5ae497ffc3b98cc00556674aaef84adc1 -EBUILD libvirt-3.8.0-r1.ebuild 9654 SHA256 18017ad471d8ba23b78489d29d6bb5f5833c6ade99fcf418b848d04b966eaa32 SHA512 81d1abce5b9fc4b3705b59d12d0383e178d0a443952ee8828d08fd4ba2c890129c6cae25d188ffe8bf19fbd8221073488fa6c57b41968b689ece539f0bca7e1b WHIRLPOOL cfff4b177ac911a659855445fe2842428dbdcedf1f403890a8049d5a418468847b7a8fa013fc2ae5898ddff9ba07062ff77e1286e6b74dee2593a4dc8936f3a8 +DIST libvirt-3.9.0.tar.xz 15010344 SHA256 89fc63213291d329d537ea96e363fd609160da080322973bd1126d431ff63424 SHA512 59878fe5f98ffb73f949315c02ec19f6a075cab21f695c9b98927d17fdc0820d6fd0aa6a9820a6bdb8e6957884a9dccc30b175bc5a3d8d25617546cccd460a38 WHIRLPOOL 9d00863262aefe3ee07653bb7b8fd5bd83efe08289edd106fd04acb93ddf9a65880fcc974b80f45057c410b87ea3233a2e09b4cc9475ee3fd65d597d2c4916ea +EBUILD libvirt-3.8.0-r1.ebuild 9661 SHA256 ef0648cada30b73ffe53dbc034d7e114770d2c323e825f2fbc22c23ef0ea9975 SHA512 66a28a319d1ed7263524c9c13e4331c3451ad321ccb39b4e608e05ad1e9d40fd1b4a75a05d5910a0a83c3bc47f8c5746aa80eedd16b1c0e8b0a4a4e093d79169 WHIRLPOOL cc1b9d73ea52c594427df28d421eba8c6e7f32d24f49c04826d8e1ecabf77a5ac355a7ec8e784888a611e20767ff6812116a5bc2160ebeeca2dda4f9171ba78a +EBUILD libvirt-3.9.0.ebuild 9661 SHA256 a7e6254c482d288abd3b203b68c1cf083c52811992ca9e193c32e4b9831600ca SHA512 b9be4e0360e391239691f2129ab7cd9f42e67c3c28e6e5d753ae005e584f8a13768a58b488fa414f9cbefd60565a3d732c09e6ed8b5513a89d85de767cad834f WHIRLPOOL 2564d291ccb2fa3aa643525ca6b5b320f2e36d0d13476d52730957fbc02e3343658ccc7d94cb76a40cfa9ad04003fb58044c6b905c224d9efd853f774c097364 EBUILD libvirt-9999.ebuild 9506 SHA256 d5af8cfea0f8f40cb4c1e474a64709440cd5fc31672af9be7bc607fcec880f04 SHA512 669472ae963372efc043f20dcf3a38d06fcdf45eb80ca13c7b76e6fed35590255206731ebd4a42b95017399bba309d49e734c14c07c9b5dc22cc7ae7819dbac2 WHIRLPOOL 1158f1338973b99a1dc518aae73e50015fff4cc2a7d8afee086784525571b2668b76dd5f6eaf5391d8a80d6817f4d8c5caf363d93e758b89202ee73e4c047f43 MISC ChangeLog 27207 SHA256 94b83a13739094fab2b993a9a833e735422f1117aa3511fc399ef7449977cbe4 SHA512 36eda4a70d13b8e06fc293ae0a31e0841e0bbb541b3c8294e9a3f341957739208836f353175cba6ff6f3b9f99c41d6be6ab69909812a5d28f2b3b79b6e386fa0 WHIRLPOOL 8721914e310158f81b907583aaeac8d2000a3db9e63f761cd7ee9674ec7834f953f9ffa248a06938d5af5ae98aee304a1e53467e8d134ebf56351ff37aaaaa48 MISC ChangeLog-2015 33229 SHA256 9b5ab13f86ef62f4eead3fc3ce0a20da725cf43437e4edc24c606fa56ca46831 SHA512 e1209249689918947d066bb91245d851f39a48b78819cb3265aa36cbe5e678e8374ef7a6279dffe678b7264a4d53aecf1d5e4f4e690e4a70df32dd84a067571a WHIRLPOOL 94ef57fc540991bc6fc9442a3d74cd6e7c10bccfee41275fca6ae4286fa73ef8bf1d9c1e9d76f10a6c2548250f5d1e72a9c1776c7b504efd9325f61b09bee55d diff --git a/app-emulation/libvirt/files/libvirt-3.6.0-ssh-malicious-hostname-fix.patch b/app-emulation/libvirt/files/libvirt-3.6.0-ssh-malicious-hostname-fix.patch deleted file mode 100644 index 628928412767..000000000000 --- a/app-emulation/libvirt/files/libvirt-3.6.0-ssh-malicious-hostname-fix.patch +++ /dev/null @@ -1,47 +0,0 @@ -From e4cb8500810a310a10a6cb359e1b53fac03ed597 Mon Sep 17 00:00:00 2001 -From: "Daniel P. Berrange" -Date: Fri, 11 Aug 2017 17:19:53 +0100 -Subject: [PATCH] rpc: avoid ssh interpreting malicious hostname as arguments - -Inspired by the recent GIT / Mercurial security flaws -(http://blog.recurity-labs.com/2017-08-10/scm-vulns), -consider someone/something manages to feed libvirt a bogus -URI such as: - - virsh -c qemu+ssh://-oProxyCommand=gnome-calculator/system - -In this case, the hosname "-oProxyCommand=gnome-calculator" -will get interpreted as an argument to ssh, not a hostname. -Fortunately, due to the set of args we have following the -hostname, SSH will then interpret our bit of shell script -that runs 'nc' on the remote host as a cipher name, which is -clearly invalid. This makes ssh exit during argv parsing and -so it never tries to run gnome-calculator. - -We are lucky this time, but lets be more paranoid, by using -'--' to explicitly tell SSH when it has finished seeing -command line options. This forces it to interpret -"-oProxyCommand=gnome-calculator" as a hostname, and thus -see a fail from hostname lookup. - -Signed-off-by: Daniel P. Berrange ---- - src/rpc/virnetsocket.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c -index d228c8a8c..23089afef 100644 ---- a/src/rpc/virnetsocket.c -+++ b/src/rpc/virnetsocket.c -@@ -868,7 +868,7 @@ int virNetSocketNewConnectSSH(const char *nodename, - if (!netcat) - netcat = "nc"; - -- virCommandAddArgList(cmd, nodename, "sh", "-c", NULL); -+ virCommandAddArgList(cmd, "--", nodename, "sh", "-c", NULL); - - virBufferEscapeShell(&buf, netcat); - if (virBufferCheckError(&buf) < 0) { --- -2.13.5 - diff --git a/app-emulation/libvirt/files/libvirt-3.9.0-tirpc.patch b/app-emulation/libvirt/files/libvirt-3.9.0-tirpc.patch new file mode 100644 index 000000000000..39e2bfafa63a --- /dev/null +++ b/app-emulation/libvirt/files/libvirt-3.9.0-tirpc.patch @@ -0,0 +1,13 @@ +diff --git a/tools/Makefile.am b/tools/Makefile.am +index 5b73558..05bf8a5 100644 +--- a/tools/Makefile.am ++++ b/tools/Makefile.am +@@ -428,7 +428,7 @@ if WITH_WIRESHARK_DISSECTOR + + ws_plugin_LTLIBRARIES = wireshark/src/libvirt.la + wireshark_src_libvirt_la_CPPFLAGS = \ +- -I wireshark/src $(WIRESHARK_DISSECTOR_CFLAGS) ++ -I wireshark/src -I/usr/include/tirpc $(WIRESHARK_DISSECTOR_CFLAGS) + wireshark_src_libvirt_la_LDFLAGS = -avoid-version -module + nodist_wireshark_src_libvirt_la_SOURCES = wireshark/src/plugin.c + wireshark_src_libvirt_la_SOURCES = \ diff --git a/app-emulation/libvirt/libvirt-3.6.0.ebuild b/app-emulation/libvirt/libvirt-3.6.0.ebuild deleted file mode 100644 index d4d2786ca147..000000000000 --- a/app-emulation/libvirt/libvirt-3.6.0.ebuild +++ /dev/null @@ -1,382 +0,0 @@ -# Copyright 1999-2017 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -EAPI=6 - -inherit autotools eutils user linux-info systemd readme.gentoo-r1 - -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/${P}.tar.xz" - else - SRC_URI="http://libvirt.org/sources/${P}.tar.xz" - fi - KEYWORDS="amd64 ~arm64 x86" - SLOT="0/${PV}" -fi - -DESCRIPTION="C toolkit to manipulate virtual machines" -HOMEPAGE="http://www.libvirt.org/" -LICENSE="LGPL-2.1" -IUSE=" - apparmor audit +caps +dbus firewalld fuse glusterfs iscsi +libvirtd lvm - libssh lxc +macvtap nfs nls numa openvz parted pcap phyp policykit - +qemu rbd sasl selinux +udev uml +vepa virtualbox virt-network - wireshark-plugins xen zeroconf zfs elibc_glibc -" - -REQUIRED_USE=" - firewalld? ( virt-network ) - libvirtd? ( || ( lxc openvz qemu uml virtualbox xen ) ) - lxc? ( caps libvirtd ) - openvz? ( libvirtd ) - policykit? ( dbus ) - qemu? ( libvirtd ) - uml? ( libvirtd ) - vepa? ( macvtap ) - virt-network? ( libvirtd ) - virtualbox? ( libvirtd ) - xen? ( libvirtd )" - -# 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=" - app-misc/scrub - dev-libs/libgcrypt:0 - dev-libs/libnl:3 - >=dev-libs/libxml2-2.7.6 - || ( >=net-analyzer/netcat6-1.0-r2 >=net-analyzer/openbsd-netcat-1.105-r1 ) - >=net-libs/gnutls-1.0.25:0= - net-libs/libssh2 - >=net-misc/curl-7.18.0 - sys-apps/dmidecode - >=sys-apps/util-linux-2.17 - sys-devel/gettext - sys-libs/ncurses:0= - sys-libs/readline:= - apparmor? ( sys-libs/libapparmor ) - audit? ( sys-process/audit ) - caps? ( sys-libs/libcap-ng ) - dbus? ( sys-apps/dbus ) - elibc_glibc? ( sys-libs/glibc[rpc(+)] ) - firewalld? ( net-firewall/firewalld ) - fuse? ( >=sys-fs/fuse-2.8.6:= ) - glusterfs? ( >=sys-cluster/glusterfs-3.4.1 ) - iscsi? ( sys-block/open-iscsi ) - libssh? ( net-libs/libssh ) - lvm? ( >=sys-fs/lvm2-2.02.48-r2[-device-mapper-only(-)] ) - nfs? ( net-fs/nfs-utils ) - numa? ( - >sys-process/numactl-2.0.2 - sys-process/numad - ) - parted? ( - >=sys-block/parted-1.8[device-mapper] - sys-fs/lvm2[-device-mapper-only(-)] - ) - pcap? ( >=net-libs/libpcap-1.0.0 ) - policykit? ( >=sys-auth/polkit-0.9 ) - qemu? ( - >=app-emulation/qemu-0.13.0 - dev-libs/yajl - ) - rbd? ( sys-cluster/ceph ) - sasl? ( dev-libs/cyrus-sasl ) - selinux? ( >=sys-libs/libselinux-2.0.85 ) - virt-network? ( - net-dns/dnsmasq[script] - net-firewall/ebtables - >=net-firewall/iptables-1.4.10[ipv6] - net-misc/radvd - sys-apps/iproute2[-minimal] - ) - virtualbox? ( || ( app-emulation/virtualbox >=app-emulation/virtualbox-bin-2.2.0 ) ) - wireshark-plugins? ( net-analyzer/wireshark:= ) - xen? ( - app-emulation/xen - app-emulation/xen-tools:= - ) - udev? ( - virtual/udev - >=x11-libs/libpciaccess-0.10.9 - ) - zeroconf? ( >=net-dns/avahi-0.6[dbus] ) - zfs? ( sys-fs/zfs )" - -DEPEND="${RDEPEND} - app-text/xhtml1 - dev-lang/perl - dev-libs/libxslt - dev-perl/XML-XPath - virtual/pkgconfig" - -PATCHES=( - "${FILESDIR}"/${PN}-1.3.0-do_not_use_sysconf.patch - "${FILESDIR}"/${PN}-1.2.16-fix_paths_in_libvirt-guests_sh.patch - "${FILESDIR}"/${PN}-3.0.0-fix_paths_for_apparmor.patch - "${FILESDIR}"/${PN}-1.3.4-glibc-2.23.patch - "${FILESDIR}"/${PN}-3.1.0-musl-fix-includes.patch # bug #609488 - "${FILESDIR}"/${PN}-3.6.0-ssh-malicious-hostname-fix.patch # bug #629462 -) - -pkg_setup() { - if use qemu; then - enewgroup qemu 77 - enewuser qemu 77 -1 -1 "qemu,kvm" - fi - - use policykit && enewgroup libvirt - - # Check kernel configuration: - CONFIG_CHECK="" - use fuse && CONFIG_CHECK+=" - ~FUSE_FS" - - use lvm && CONFIG_CHECK+=" - ~BLK_DEV_DM - ~DM_MULTIPATH - ~DM_SNAPSHOT" - - use lxc && CONFIG_CHECK+=" - ~BLK_CGROUP - ~CGROUP_CPUACCT - ~CGROUP_DEVICE - ~CGROUP_FREEZER - ~CGROUP_NET_PRIO - ~CGROUP_PERF - ~CGROUPS - ~CGROUP_SCHED - ~CPUSETS - ~IPC_NS - ~MACVLAN - ~NAMESPACES - ~NET_CLS_CGROUP - ~NET_NS - ~PID_NS - ~POSIX_MQUEUE - ~SECURITYFS - ~USER_NS - ~UTS_NS - ~VETH - ~!GRKERNSEC_CHROOT_MOUNT - ~!GRKERNSEC_CHROOT_DOUBLE - ~!GRKERNSEC_CHROOT_PIVOT - ~!GRKERNSEC_CHROOT_CHMOD - ~!GRKERNSEC_CHROOT_CAPS" - - kernel_is lt 4 7 && use lxc && CONFIG_CHECK+=" - ~DEVPTS_MULTIPLE_INSTANCES" - - use macvtap && CONFIG_CHECK+=" - ~MACVTAP" - - use virt-network && CONFIG_CHECK+=" - ~BRIDGE_EBT_MARK_T - ~BRIDGE_NF_EBTABLES - ~NETFILTER_ADVANCED - ~NETFILTER_XT_CONNMARK - ~NETFILTER_XT_MARK - ~NETFILTER_XT_TARGET_CHECKSUM" - # Bandwidth Limiting Support - use virt-network && CONFIG_CHECK+=" - ~BRIDGE_EBT_T_NAT - ~NET_ACT_POLICE - ~NET_CLS_FW - ~NET_CLS_U32 - ~NET_SCH_HTB - ~NET_SCH_INGRESS - ~NET_SCH_SFQ" - - # Handle specific kernel versions for different features - kernel_is lt 3 6 && CONFIG_CHECK+=" ~CGROUP_MEM_RES_CTLR" - if kernel_is ge 3 6; then - CONFIG_CHECK+=" ~MEMCG ~MEMCG_SWAP " - kernel_is lt 4 5 && CONFIG_CHECK+=" ~MEMCG_KMEM " - fi - - ERROR_USER_NS="Optional depending on LXC configuration." - - if [[ -n ${CONFIG_CHECK} ]]; then - linux-info_pkg_setup - fi -} - -src_prepare() { - touch "${S}/.mailmap" - - default - - 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 - - # Tweak the init script: - cp "${FILESDIR}/libvirtd.init-r16" "${S}/libvirtd.init" || die - sed -e "s/USE_FLAG_FIREWALLD/$(usex firewalld 'need firewalld' '')/" \ - -e "s/USE_FLAG_AVAHI/$(usex zeroconf 'use avahi-daemon' '')/" \ - -e "s/USE_FLAG_ISCSI/$(usex iscsi 'use iscsid' '')/" \ - -e "s/USE_FLAG_RBD/$(usex rbd 'use ceph' '')/" \ - -i "${S}/libvirtd.init" || die "sed failed" - - eautoreconf -} - -src_configure() { - local myeconfargs=( - $(use_with apparmor) - $(use_with apparmor apparmor-profiles) - $(use_with audit) - $(use_with caps capng) - $(use_with dbus) - $(use_with firewalld) - $(use_with fuse) - $(use_with glusterfs) - $(use_with glusterfs storage-gluster) - $(use_with iscsi storage-iscsi) - $(use_with libvirtd) - $(use_with libssh) - $(use_with lvm storage-lvm) - $(use_with lvm storage-mpath) - $(use_with lxc) - $(use_with macvtap) - $(use_enable nls) - $(use_with numa numactl) - $(use_with numa numad) - $(use_with openvz) - $(use_with parted storage-disk) - $(use_with pcap libpcap) - $(use_with phyp) - $(use_with policykit polkit) - $(use_with qemu) - $(use_with qemu yajl) - $(use_with rbd storage-rbd) - $(use_with sasl) - $(use_with selinux) - $(use_with udev) - $(use_with uml) - $(use_with vepa virtualport) - $(use_with virt-network network) - $(use_with wireshark-plugins wireshark-dissector) - $(use_with xen) - $(use_with xen xen-inotify) - $(use_with xen libxl) - $(use_with zeroconf avahi) - $(use_with zfs storage-zfs) - - --without-hal - --without-netcf - --without-sanlock - --without-xenapi - - --with-esx - --with-init-script=systemd - --with-qemu-group=$(usex caps qemu root) - --with-qemu-user=$(usex caps qemu root) - --with-remote - --with-storage-fs - --with-vmware - - --disable-static - --disable-werror - - --with-html-subdir=${PF}/html - --localstatedir=/var - ) - - if use virtualbox && has_version app-emulation/virtualbox-ose; then - myeconfargs+=( --with-vbox=/usr/lib/virtualbox-ose/ ) - else - myeconfargs+=( $(use_with virtualbox vbox) ) - fi - - econf "${myeconfargs[@]}" - - if [[ ${PV} = *9999* ]]; then - # Restore gnulib's config.sub and config.guess - # bug #377279 - (cd .gnulib && git reset --hard > /dev/null) - fi -} - -src_test() { - cd "${BUILD_DIR}" - - # remove problematic tests, bug #591416, bug #591418 - sed -i -e 's#commandtest$(EXEEXT) # #' \ - -e 's#virfirewalltest$(EXEEXT) # #' \ - -e 's#nwfilterebiptablestest$(EXEEXT) # #' \ - -e 's#nwfilterxml2firewalltest$(EXEEXT)$##' \ - tests/Makefile - - export VIR_TEST_DEBUG=1 - HOME="${T}" emake check || die "tests failed" -} - -src_install() { - emake DESTDIR="${D}" \ - SYSTEMD_UNIT_DIR="$(systemd_get_systemunitdir)" install - - 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/sysconfig - 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! - - systemd_install_serviced \ - "${FILESDIR}"/libvirtd.service.conf libvirtd.service - - systemd_newtmpfilesd "${FILESDIR}"/libvirtd.tmpfiles.conf libvirtd.conf - - newinitd "${S}/libvirtd.init" libvirtd || die - newinitd "${FILESDIR}/libvirt-guests.init-r2" libvirt-guests || die - newinitd "${FILESDIR}/virtlockd.init-r1" virtlockd || die - newinitd "${FILESDIR}/virtlogd.init-r1" virtlogd || die - - newconfd "${FILESDIR}/libvirtd.confd-r5" libvirtd || die - newconfd "${FILESDIR}/libvirt-guests.confd" libvirt-guests || die - - DOC_CONTENTS=$(<"${FILESDIR}/README.gentoo-r2") - DISABLE_AUTOFORMATTING=true - 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 -} - -pkg_postinst() { - if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then - touch "${ROOT}"/etc/libvirt/qemu/networks/default.xml - fi - - use libvirtd || return 0 - # From here, only libvirtd-related instructions, be warned! - - readme.gentoo_print_elog -} diff --git a/app-emulation/libvirt/libvirt-3.8.0-r1.ebuild b/app-emulation/libvirt/libvirt-3.8.0-r1.ebuild index 7ac23060bb18..e131f0e87239 100644 --- a/app-emulation/libvirt/libvirt-3.8.0-r1.ebuild +++ b/app-emulation/libvirt/libvirt-3.8.0-r1.ebuild @@ -9,7 +9,7 @@ if [[ ${PV} = *9999* ]]; then inherit git-r3 EGIT_REPO_URI="git://libvirt.org/libvirt.git" SRC_URI="" - KEYWORDS="" + KEYWORDS="amd64 x86" SLOT="0" else # Versions with 4 numbers are stable updates: @@ -18,7 +18,7 @@ else else SRC_URI="http://libvirt.org/sources/${P}.tar.xz" fi - KEYWORDS="~amd64 ~arm64 ~x86" + KEYWORDS="amd64 ~arm64 x86" SLOT="0/${PV}" fi diff --git a/app-emulation/libvirt/libvirt-3.9.0.ebuild b/app-emulation/libvirt/libvirt-3.9.0.ebuild new file mode 100644 index 000000000000..d20a55de19b0 --- /dev/null +++ b/app-emulation/libvirt/libvirt-3.9.0.ebuild @@ -0,0 +1,383 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit autotools eutils user linux-info systemd readme.gentoo-r1 + +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/${P}.tar.xz" + else + SRC_URI="http://libvirt.org/sources/${P}.tar.xz" + fi + KEYWORDS="~amd64 ~arm64 ~x86" + SLOT="0/${PV}" +fi + +DESCRIPTION="C toolkit to manipulate virtual machines" +HOMEPAGE="http://www.libvirt.org/" +LICENSE="LGPL-2.1" +IUSE=" + apparmor audit +caps +dbus firewalld fuse glusterfs iscsi +libvirtd lvm + libssh lxc +macvtap nfs nls numa openvz parted pcap phyp policykit + +qemu rbd sasl selinux +udev uml +vepa virtualbox virt-network + wireshark-plugins xen zeroconf zfs +" + +REQUIRED_USE=" + firewalld? ( virt-network ) + libvirtd? ( || ( lxc openvz qemu uml virtualbox xen ) ) + lxc? ( caps libvirtd ) + openvz? ( libvirtd ) + policykit? ( dbus ) + qemu? ( libvirtd ) + uml? ( libvirtd ) + vepa? ( macvtap ) + virt-network? ( libvirtd ) + virtualbox? ( libvirtd ) + xen? ( libvirtd )" + +# 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=" + app-misc/scrub + dev-libs/libgcrypt:0 + dev-libs/libnl:3 + >=dev-libs/libxml2-2.7.6 + || ( >=net-analyzer/netcat6-1.0-r2 >=net-analyzer/openbsd-netcat-1.105-r1 ) + >=net-libs/gnutls-1.0.25:0= + net-libs/libssh2 + net-libs/libtirpc + net-libs/rpcsvc-proto + >=net-misc/curl-7.18.0 + sys-apps/dmidecode + >=sys-apps/util-linux-2.17 + sys-devel/gettext + sys-libs/ncurses:0= + sys-libs/readline:= + apparmor? ( sys-libs/libapparmor ) + audit? ( sys-process/audit ) + caps? ( sys-libs/libcap-ng ) + dbus? ( sys-apps/dbus ) + firewalld? ( net-firewall/firewalld ) + fuse? ( >=sys-fs/fuse-2.8.6:= ) + glusterfs? ( >=sys-cluster/glusterfs-3.4.1 ) + iscsi? ( sys-block/open-iscsi ) + libssh? ( net-libs/libssh ) + lvm? ( >=sys-fs/lvm2-2.02.48-r2[-device-mapper-only(-)] ) + nfs? ( net-fs/nfs-utils ) + numa? ( + >sys-process/numactl-2.0.2 + sys-process/numad + ) + parted? ( + >=sys-block/parted-1.8[device-mapper] + sys-fs/lvm2[-device-mapper-only(-)] + ) + pcap? ( >=net-libs/libpcap-1.0.0 ) + policykit? ( >=sys-auth/polkit-0.9 ) + qemu? ( + >=app-emulation/qemu-0.13.0 + dev-libs/yajl + ) + rbd? ( sys-cluster/ceph ) + sasl? ( dev-libs/cyrus-sasl ) + selinux? ( >=sys-libs/libselinux-2.0.85 ) + virt-network? ( + net-dns/dnsmasq[script] + net-firewall/ebtables + >=net-firewall/iptables-1.4.10[ipv6] + net-misc/radvd + sys-apps/iproute2[-minimal] + ) + virtualbox? ( || ( app-emulation/virtualbox >=app-emulation/virtualbox-bin-2.2.0 ) ) + wireshark-plugins? ( net-analyzer/wireshark:= ) + xen? ( + app-emulation/xen + app-emulation/xen-tools:= + ) + udev? ( + virtual/udev + >=x11-libs/libpciaccess-0.10.9 + ) + zeroconf? ( >=net-dns/avahi-0.6[dbus] ) + zfs? ( sys-fs/zfs )" + +DEPEND="${RDEPEND} + app-text/xhtml1 + dev-lang/perl + dev-libs/libxslt + dev-perl/XML-XPath + virtual/pkgconfig" + +PATCHES=( + "${FILESDIR}"/${PN}-1.3.0-do_not_use_sysconf.patch + "${FILESDIR}"/${PN}-1.2.16-fix_paths_in_libvirt-guests_sh.patch + "${FILESDIR}"/${PN}-3.0.0-fix_paths_for_apparmor.patch + "${FILESDIR}"/${PN}-1.3.4-glibc-2.23.patch + "${FILESDIR}"/${PN}-3.1.0-musl-fix-includes.patch # bug #609488 + "${FILESDIR}"/${PN}-3.9.0-tirpc.patch +) + +pkg_setup() { + if use qemu; then + enewgroup qemu 77 + enewuser qemu 77 -1 -1 "qemu,kvm" + fi + + use policykit && enewgroup libvirt + + # Check kernel configuration: + CONFIG_CHECK="" + use fuse && CONFIG_CHECK+=" + ~FUSE_FS" + + use lvm && CONFIG_CHECK+=" + ~BLK_DEV_DM + ~DM_MULTIPATH + ~DM_SNAPSHOT" + + use lxc && CONFIG_CHECK+=" + ~BLK_CGROUP + ~CGROUP_CPUACCT + ~CGROUP_DEVICE + ~CGROUP_FREEZER + ~CGROUP_NET_PRIO + ~CGROUP_PERF + ~CGROUPS + ~CGROUP_SCHED + ~CPUSETS + ~IPC_NS + ~MACVLAN + ~NAMESPACES + ~NET_CLS_CGROUP + ~NET_NS + ~PID_NS + ~POSIX_MQUEUE + ~SECURITYFS + ~USER_NS + ~UTS_NS + ~VETH + ~!GRKERNSEC_CHROOT_MOUNT + ~!GRKERNSEC_CHROOT_DOUBLE + ~!GRKERNSEC_CHROOT_PIVOT + ~!GRKERNSEC_CHROOT_CHMOD + ~!GRKERNSEC_CHROOT_CAPS" + + kernel_is lt 4 7 && use lxc && CONFIG_CHECK+=" + ~DEVPTS_MULTIPLE_INSTANCES" + + use macvtap && CONFIG_CHECK+=" + ~MACVTAP" + + use virt-network && CONFIG_CHECK+=" + ~BRIDGE_EBT_MARK_T + ~BRIDGE_NF_EBTABLES + ~NETFILTER_ADVANCED + ~NETFILTER_XT_CONNMARK + ~NETFILTER_XT_MARK + ~NETFILTER_XT_TARGET_CHECKSUM" + # Bandwidth Limiting Support + use virt-network && CONFIG_CHECK+=" + ~BRIDGE_EBT_T_NAT + ~NET_ACT_POLICE + ~NET_CLS_FW + ~NET_CLS_U32 + ~NET_SCH_HTB + ~NET_SCH_INGRESS + ~NET_SCH_SFQ" + + # Handle specific kernel versions for different features + kernel_is lt 3 6 && CONFIG_CHECK+=" ~CGROUP_MEM_RES_CTLR" + if kernel_is ge 3 6; then + CONFIG_CHECK+=" ~MEMCG ~MEMCG_SWAP " + kernel_is lt 4 5 && CONFIG_CHECK+=" ~MEMCG_KMEM " + fi + + ERROR_USER_NS="Optional depending on LXC configuration." + + if [[ -n ${CONFIG_CHECK} ]]; then + linux-info_pkg_setup + fi +} + +src_prepare() { + touch "${S}/.mailmap" + + default + + 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 + + # Tweak the init script: + cp "${FILESDIR}/libvirtd.init-r16" "${S}/libvirtd.init" || die + sed -e "s/USE_FLAG_FIREWALLD/$(usex firewalld 'need firewalld' '')/" \ + -e "s/USE_FLAG_AVAHI/$(usex zeroconf 'use avahi-daemon' '')/" \ + -e "s/USE_FLAG_ISCSI/$(usex iscsi 'use iscsid' '')/" \ + -e "s/USE_FLAG_RBD/$(usex rbd 'use ceph' '')/" \ + -i "${S}/libvirtd.init" || die "sed failed" + + eautoreconf +} + +src_configure() { + local myeconfargs=( + $(use_with apparmor) + $(use_with apparmor apparmor-profiles) + $(use_with audit) + $(use_with caps capng) + $(use_with dbus) + $(use_with firewalld) + $(use_with fuse) + $(use_with glusterfs) + $(use_with glusterfs storage-gluster) + $(use_with iscsi storage-iscsi) + $(use_with libvirtd) + $(use_with libssh) + $(use_with lvm storage-lvm) + $(use_with lvm storage-mpath) + $(use_with lxc) + $(use_with macvtap) + $(use_enable nls) + $(use_with numa numactl) + $(use_with numa numad) + $(use_with openvz) + $(use_with parted storage-disk) + $(use_with pcap libpcap) + $(use_with phyp) + $(use_with policykit polkit) + $(use_with qemu) + $(use_with qemu yajl) + $(use_with rbd storage-rbd) + $(use_with sasl) + $(use_with selinux) + $(use_with udev) + $(use_with uml) + $(use_with vepa virtualport) + $(use_with virt-network network) + $(use_with wireshark-plugins wireshark-dissector) + $(use_with xen) + $(use_with xen xen-inotify) + $(use_with xen libxl) + $(use_with zeroconf avahi) + $(use_with zfs storage-zfs) + + --without-hal + --without-netcf + --without-sanlock + --without-xenapi + + --with-esx + --with-init-script=systemd + --with-qemu-group=$(usex caps qemu root) + --with-qemu-user=$(usex caps qemu root) + --with-remote + --with-storage-fs + --with-vmware + + --disable-static + --disable-werror + + --with-html-subdir=${PF}/html + --localstatedir=/var + ) + + if use virtualbox && has_version app-emulation/virtualbox-ose; then + myeconfargs+=( --with-vbox=/usr/lib/virtualbox-ose/ ) + else + myeconfargs+=( $(use_with virtualbox vbox) ) + fi + + econf "${myeconfargs[@]}" + + if [[ ${PV} = *9999* ]]; then + # Restore gnulib's config.sub and config.guess + # bug #377279 + (cd .gnulib && git reset --hard > /dev/null) + fi +} + +src_test() { + cd "${BUILD_DIR}" + + # remove problematic tests, bug #591416, bug #591418 + sed -i -e 's#commandtest$(EXEEXT) # #' \ + -e 's#virfirewalltest$(EXEEXT) # #' \ + -e 's#nwfilterebiptablestest$(EXEEXT) # #' \ + -e 's#nwfilterxml2firewalltest$(EXEEXT)$##' \ + tests/Makefile + + export VIR_TEST_DEBUG=1 + HOME="${T}" emake check || die "tests failed" +} + +src_install() { + emake DESTDIR="${D}" \ + SYSTEMD_UNIT_DIR="$(systemd_get_systemunitdir)" install + + 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/sysconfig + 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! + + systemd_install_serviced \ + "${FILESDIR}"/libvirtd.service.conf libvirtd.service + + systemd_newtmpfilesd "${FILESDIR}"/libvirtd.tmpfiles.conf libvirtd.conf + + newinitd "${S}/libvirtd.init" libvirtd || die + newinitd "${FILESDIR}/libvirt-guests.init-r2" libvirt-guests || die + newinitd "${FILESDIR}/virtlockd.init-r1" virtlockd || die + newinitd "${FILESDIR}/virtlogd.init-r1" virtlogd || die + + newconfd "${FILESDIR}/libvirtd.confd-r5" libvirtd || die + newconfd "${FILESDIR}/libvirt-guests.confd" libvirt-guests || die + + DOC_CONTENTS=$(<"${FILESDIR}/README.gentoo-r2") + DISABLE_AUTOFORMATTING=true + 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 +} + +pkg_postinst() { + if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then + touch "${ROOT}"/etc/libvirt/qemu/networks/default.xml + fi + + use libvirtd || return 0 + # From here, only libvirtd-related instructions, be warned! + + readme.gentoo_print_elog +} diff --git a/app-emulation/lxc/Manifest b/app-emulation/lxc/Manifest index be660440866f..0e6eef09d47b 100644 --- a/app-emulation/lxc/Manifest +++ b/app-emulation/lxc/Manifest @@ -9,7 +9,6 @@ AUX lxc-2.0.6-bash-completion.patch 919 SHA256 44c354c90d85371654d77337c8daeca34 AUX lxc-2.0.6-major.patch 1834 SHA256 c0095581ab6f92e6cdbfc8298af08f1fbcbff98cf6d107b925489fd7253e418d SHA512 274e2d138e32645aca2ab954e24db02c4d7c5750a781ebf3d81c69c7eeade06b33a3c8ac36a16548a58f6d7f518977fb2df09e22de96d966de542f470720b398 WHIRLPOOL 386ac9236f5b6ff7ed721f1d0aeace99598a62f42c06423b268f1b75bc96aa446a7dcedf41c3fe131ec21dbdf670b3308d957ae508ca125623656eb06fdd2638 AUX lxc.initd.3 3273 SHA256 f704614cfb1b07aeceda15f4edfa392f5866743b0e582753d6afcf8a942a0155 SHA512 38b4b4d4cc8473d5836ac5c4a0824099ea9037e11c6624db53d977f0dcd2dfec3731db5d71a47dc5ebd4fa723cca50dfa9bf39f317e8d146f2a278ef3c9c83a8 WHIRLPOOL 7c68c9c7a68c995294f67186c27d726838605693611a21bdc548b497d1fa23a2a30762da136ca2d474504f25680ca83b8ce41545ae4ae8d4172420fd5d6321ea AUX lxc.initd.5 3282 SHA256 bc57cbf32f3b226b938a5871e97323849050e3c2f68a3e1db78b927c16f7f930 SHA512 6f72701fa42d41b39647a95ec45ca4d669a08a300f54b39715bbb554001bf662b9173cdacc2cb49b8e1093f5fcef971a1fd8270164c73a8e49d1b66dcbe7408d WHIRLPOOL fc4f8c066fd8c8b4290d01b8b12161630437738bdc656e50ba8183f7d1e7775d40c211ab94f6dbd9a640c568168d98c94c26d24eb9969049fa1cc45145a40977 -AUX lxc.initd.6 3280 SHA256 1bc1ee13105e6e0e060952d9c00d8e21c2ca14f8a345196251399cf5d1114a5f SHA512 914075985f11c84f41c10a1b48906e7ac10c7e486389df2a18bfde87af105bf0d302f6db19ffd6f794cbaf06c691bb8ca914c15e651d4f7b442f7eaaa80b658e WHIRLPOOL e8c19d151e1072e067fd57c148f8d7bd1a6f6f43043a0cc060b450bf56233b28647afd8e22c21e29f3ae56c29c835f6b5f79c36ed66a51128ee5b1a5f835e026 AUX lxc_at.service 232 SHA256 0aaf2f362b3ac6aa2b427d47ac4436d46387624b0d8bc4850c5d5b6a7d228711 SHA512 4c3bab4f2cc9aea8b0753dcaf2fd7ed5f1cd7d97d286d6204b2fc17505b6edaac2f536bbda5c1466856311d0e93d75de91dec51e9b0f665d67afedbf40c19170 WHIRLPOOL f6928b4b85e63c38295cabc651b7bd61d2b0bc69ff1850de7cfa8a4f40e4894d94264c262fec7d345488cace49c4283f932739313b975f6862c1aa0ef51e0652 AUX lxc_at.service.4 265 SHA256 194ce2917e99a5050dd793bc31c7d4393f61a9244aaa2f59109eaf8bebfe44fd SHA512 d61e7103e90e6ffb3202533e7d7555d8c02b943f06ec6c0d673713c1c0ede58641312c65d6dd6a15907c1171522e6148c2313d7b11acbd85d59fe65758cd52b3 WHIRLPOOL 55892d9cc5ff8cd8ca95ccae65abbb9735904cf1aba6ea33008349bbe4ea2ac01f83307998e90265b7dd2127761c05199be4f7133f21af1490bda40bf18a2873 DIST lxc-1.0.8.tar.gz 575127 SHA256 399ac3eb4e0a89d657fb2e2a57f686ed061d3f1ea4733e7521b1539e9906c7ee SHA512 f552a4f48bb47d26c6b9ddaf8221a439c0848e3f54ec41b77d54717c21bddd56193941046cc96c699790e8265e762a926469c25ee687adcf7795f2906b1c260a WHIRLPOOL 72cd0b8b0345692dd9a3ed8785ee27f5e575794a96c515db1f1d073c29be4c06ae8c1ee24fa375a5ede2bba2494704916710b2e8814ed991d43330a40dff3d56 @@ -25,7 +24,7 @@ EBUILD lxc-2.0.4.ebuild 6309 SHA256 9d9bd96381602b2ec6a6fc13d94e0fb76976fa57b22b EBUILD lxc-2.0.5.ebuild 6309 SHA256 9d9bd96381602b2ec6a6fc13d94e0fb76976fa57b22b7979aeb1f3b69c01339f SHA512 c4ebc644ac33bd976308b191f6fbad170872056879071562bae1e80e8082f0882e942d2757207aafce1ebdb1c7d8d8cee3f45339b5be6d205421541fef9594de WHIRLPOOL 2e6ace147e77c1f582b7ca7d6d5fa1985f004a4b0d2708b931b616e2ab9f0b40e8700a8170695e9f4e4a9804b1f79d7d69a3a23d2e1f1f93584a7665c31b5c0d EBUILD lxc-2.0.6-r1.ebuild 6362 SHA256 c6214bb9886d05bed8cdc6b51f297250953041037c51b95bd35bab27e0ee4d23 SHA512 57ed76595bfe00f8a924793832ea5b8ab4c08b68d978b91343cb43f0299b06a10baa0e65766b37a4a9dcb432cfc6cd1da93d8abd526967ccc5cf40693f748cf8 WHIRLPOOL b17dc35ab7af1e82bfc0cd44bd6bce79fe2a3ea1a550f966ad33c1f727bda20f3d410c7ccd9ab810e67440c64a67296c6f9d9ea8e3592d23a9b5e5e12345eb83 EBUILD lxc-2.0.7.ebuild 6343 SHA256 a86fe2f27af090ff94537efc0dde8d73b867f9fb377d0d446d3fb46dda3b77f5 SHA512 91312a9209a731026aa53f3d7bb73a0dc8f90f9fc37680cf56439067bd63aa3f35c60d2d320d5fae3d8469ea1a3fcd8e83ee5093ea4252643fd82e776ea5d58f WHIRLPOOL 0085faa8d54e65338c149530f5060320f17c53e7b778f051df43210992d8df2f9a3618cca72045591c22211569886a59775084c656aa52e726a2f1ab85e92148 -EBUILD lxc-2.0.8.ebuild 6351 SHA256 74a9ccedef00b13e078063edcb73538d4219b95494c3c22e059e3a3b1f970635 SHA512 a210cbfc88c8010977a03dfe64d29d7e9193eccd2bffb463698df9d18b8fe994d705704074be0fe9204fabeb134c6fe6407de9e89c7e8ff4ef702aadf9273fb9 WHIRLPOOL 43d19ca00c789ccb8cdb73ac3c54d1f9509a2dcce529587a6cff9fc2645972747a0c3bff5f2074d8baf934eaa913a7a640f95003635075973f0337b4e5d6e32e +EBUILD lxc-2.0.8.ebuild 6429 SHA256 7cbae50463ee5e8ae53cd225f04727e8568269a2f5d16810958f450694fded72 SHA512 173af6b3482067cd483865eb0080a78bea4b9662c540a4c6f6614c20d886ca2eae961ad63024c86d7156703b04c976a30d9095844361c549cd0ebff3edfacebd WHIRLPOOL 42aef7f1b2e22fcaabbe8e3c61d0daa988c33b58d1d7a5cc3838fa2f8af153382da0bd317556e000e253e60389ec85a629119e474f36bca0bcd22bad9ff100cd MISC ChangeLog 8797 SHA256 5711cccd5a871d9fa0df3728422d0bf02db636520f586ad9a332227a429e7b21 SHA512 08ea3917b8b910af4ccbd4986a4147302138bb23a3eee8a0d130ddfbe9ecd3c4044daba508ab4b53542e46ce33dca88328fc7a4652517a258286a2d286dee8ad WHIRLPOOL 5b85b0e1447cea8d93d8c38196624798b7f760803634c546a6e343bcc4804ff6da4cb2152cd584a37487806b2ddb0d9d790229ae2ff1b8754acd48d3ce645290 MISC ChangeLog-2015 16297 SHA256 14a9b5072facfe49b0c62131adff2be1185bacb7a44a0511fe447e22ac7aeb32 SHA512 d71746fdc367f4e5833ccde0cf1bcc047db4cb0582a00fac51f5b97c3fc1a160e3add6409185f9197faaa58b94f82f8532e7291344e8cc66a6ff49d48aa719c5 WHIRLPOOL fb28525b3c00a96e7f34beb01b28a486e5071041275f332ab0971ec6ae78159ad3361e3280c9d76b66d0ab6ea2aada06eb1d3530f5fb5ade8f80b073a4ce2416 MISC metadata.xml 811 SHA256 5bd0e8948d73e86844f03feaf3cf8276c0fc101355b29b86db03c2674ce06340 SHA512 fea5f647ca7eb616307378375af86051034e03170f6ce62e2219f78343797072902102515f93cc0f809558fbfbca88eb81e9f8d0fa621ae18381d39a12c31aa2 WHIRLPOOL 732d83aba86a12ed0ba0d3691cef7d56dd83382b7cdfed73935d65c47667323befb5ebb8e9e3f8bbec0f7dc8730125aad28fb7e000deeacd701b5f8a0ccef25d diff --git a/app-emulation/lxc/files/lxc.initd.6 b/app-emulation/lxc/files/lxc.initd.6 deleted file mode 100644 index a66dfdd22b41..000000000000 --- a/app-emulation/lxc/files/lxc.initd.6 +++ /dev/null @@ -1,118 +0,0 @@ -#!/sbin/openrc-run -# Copyright 1999-2017 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -CONTAINER=${SVCNAME#*.} - -LXC_PATH=`lxc-config lxc.lxcpath` - -lxc_get_configfile() { - if [ -f "${LXC_PATH}/${CONTAINER}.conf" ]; then - echo "${LXC_PATH}/${CONTAINER}.conf" - elif [ -f "${LXC_PATH}/${CONTAINER}/config" ]; then - echo "${LXC_PATH}/${CONTAINER}/config" - else - eerror "Unable to find a suitable configuration file." - eerror "If you set up the container in a non-standard" - eerror "location, please set the CONFIGFILE variable." - return 1 - fi -} - -[ $CONTAINER != $SVCNAME ] && CONFIGFILE=${CONFIGFILE:-$(lxc_get_configfile)} - -lxc_get_var() { - awk 'BEGIN { FS="[ \t]*=[ \t]*" } $1 == "'$1'" { print $2; exit }' ${CONFIGFILE} -} - -lxc_get_net_link_type() { - awk 'BEGIN { FS="[ \t]*=[ \t]*"; _link=""; _type="" } - $1 == "lxc.network.type" {_type=$2;} - $1 == "lxc.network.link" {_link=$2;} - {if(_link != "" && _type != ""){ - printf("%s:%s\n", _link, _type ); - _link=""; _type=""; - }; }' <${CONFIGFILE} -} - -checkconfig() { - if [ ${CONTAINER} = ${SVCNAME} ]; then - eerror "You have to create an init script for each container:" - eerror " ln -s lxc /etc/init.d/lxc.container" - return 1 - fi - - # no need to output anything, the function takes care of that. - [ -z "${CONFIGFILE}" ] && return 1 - - utsname=$(lxc_get_var lxc.utsname) - if [ ${CONTAINER} != ${utsname} ]; then - eerror "You should use the same name for the service and the" - eerror "container. Right now the container is called ${utsname}" - return 1 - fi -} - -depend() { - # be quiet, since we have to run depend() also for the - # non-muxed init script, unfortunately. - checkconfig 2>/dev/null || return 0 - - config ${CONFIGFILE} - need localmount - use lxcfs - - local _x _if - for _x in $(lxc_get_net_link_type); do - _if=${_x%:*} - case "${_x##*:}" in - # when the network type is set to phys, we can make use of a - # network service (for instance to set it up before we disable - # the net_admin capability), but we might also not set it up - # at all on the host and leave the net_admin capable service - # to take care of it. - phys) use net.${_if} ;; - *) need net.${_if} ;; - esac - done -} - -start() { - checkconfig || return 1 - rm -f /var/log/lxc/${CONTAINER}.log - - rootpath=$(lxc_get_var lxc.rootfs) - - # Check the format of our init and the chroot's init, to see - # if we have to use linux32 or linux64; always use setarch - # when required, as that makes it easier to deal with - # x32-based containers. - case $(scanelf -BF '%a#f' ${rootpath}/sbin/init) in - EM_X86_64) setarch=linux64;; - EM_386) setarch=linux32;; - esac - - ebegin "Starting ${CONTAINER}" - env -i ${setarch} $(which lxc-start) -l WARN -n ${CONTAINER} -f ${CONFIGFILE} -d -o /var/log/lxc/${CONTAINER}.log - sleep 1 - - # lxc-start -d will _always_ report a correct startup, even if it - # failed, so rather than trust that, check that the cgroup exists. - [ -d /sys/fs/cgroup/cpuset/lxc/${CONTAINER} ] - eend $? -} - -stop() { - checkconfig || return 1 - - - if ! [ -d /sys/fs/cgroup/cpuset/lxc/${CONTAINER} ]; then - ewarn "${CONTAINER} doesn't seem to be started." - return 0 - fi - - # 10s should be enough to shut everything down - ebegin "Stopping ${CONTAINER}" - lxc-stop -t 10 -n ${CONTAINER} - eend $? -} diff --git a/app-emulation/lxc/lxc-2.0.8.ebuild b/app-emulation/lxc/lxc-2.0.8.ebuild index ae0977801e10..d22f583a5a46 100644 --- a/app-emulation/lxc/lxc-2.0.8.ebuild +++ b/app-emulation/lxc/lxc-2.0.8.ebuild @@ -1,9 +1,9 @@ # Copyright 1999-2017 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -EAPI="6" +EAPI=6 -PYTHON_COMPAT=( python{3_4,3_5} ) +PYTHON_COMPAT=( python3_{4,5,6} ) DISTUTILS_OPTIONAL=1 inherit autotools bash-completion-r1 distutils-r1 linux-info versionator flag-o-matic systemd @@ -16,21 +16,23 @@ KEYWORDS="~amd64 ~arm ~arm64" LICENSE="LGPL-3" SLOT="0" -IUSE="cgmanager doc examples lua python seccomp" +IUSE="cgmanager doc examples lua python seccomp selinux" -RDEPEND="net-libs/gnutls +RDEPEND=" + net-libs/gnutls sys-libs/libcap cgmanager? ( app-admin/cgmanager ) lua? ( >=dev-lang/lua-5.1:= ) python? ( ${PYTHON_DEPS} ) - seccomp? ( sys-libs/libseccomp )" + seccomp? ( sys-libs/libseccomp ) + selinux? ( sys-libs/libselinux )" DEPEND="${RDEPEND} doc? ( app-text/docbook-sgml-utils ) >=sys-kernel/linux-headers-3.2" RDEPEND="${RDEPEND} - sys-process/criu + sys-process/criu[selinux=] sys-apps/util-linux app-misc/pax-utils virtual/awk" @@ -136,7 +138,8 @@ src_configure() { $(use_enable examples) \ $(use_enable lua) \ $(use_enable python) \ - $(use_enable seccomp) + $(use_enable seccomp) \ + $(use_enable selinux) } python_compile() { diff --git a/app-emulation/qemu-guest-agent/Manifest b/app-emulation/qemu-guest-agent/Manifest index 0ba73d9f0463..4c3b3913b81c 100644 --- a/app-emulation/qemu-guest-agent/Manifest +++ b/app-emulation/qemu-guest-agent/Manifest @@ -4,14 +4,16 @@ AUX qemu-ga.conf-r1 452 SHA256 0b613b13273154847f4c93c4fc714021533bff68638730d80 AUX qemu-ga.init-r1 624 SHA256 b05642aa865171b06bf9ac8ba5992e06d55648ceccb50ec21e1357248740f7f5 SHA512 820ae4b04b9eeb2c8ac6128544f764af67b4462cc98377ceb37708130a5cae118bd3ed892a945fb25234a8d73fb98e60dbf5da3a44861fc56f97b66a3f12532e WHIRLPOOL 3467924c4f2d6fdf9ad20c3e4470cebd865e9d7946039dc0742829dce0afe3ccc3af92d880f37f61979526cfa3daad14f6e2e91dc36da883226bf1872e36aa7b AUX qemu-ga.logrotate 128 SHA256 9332aeb8f09814fbdbdff8bfb6e6784bf8031a17cba08e8490060fb87f8f024c SHA512 0fb39dd7ee528b36d8e837fbc53ba69476ba83947a4df10a9df03a02861a37d21f53865adbd3050c24aad72ec8a8bee1fb33f7382213d855884aff109f3c3789 WHIRLPOOL 6d715ed34541254a2d69943805d29e15f11a7c0ebaa30a47e090787f26640b3d64e2d48892e66c094593cc9f9d8ff37c788542c180d8bc5b9a2573b832b18cca AUX qemu-guest-agent-2.5.0-sysmacros.patch 365 SHA256 c5b5905032b2384cf5a68ddb0c19d229f5a303d3278d4ac4ad386cf95b7d77c5 SHA512 a608a3d96f03c54fcccb7bcb354f0deec4bcb570f03b8ac9044ca5c6ee7a6252ae7cac05fb142d7c95feecfbb17e0499bbc1d6935c3e3e9ea7db319c4c11f6ad WHIRLPOOL 110821f136ae81b522947a7ed5fe59def066ccfef877f5e652fb869cc9235248ee820e35aae1d8375e17182ec3c908917d23472c420e8cb9704d8cc78955f99d +DIST qemu-2.10.1.tar.bz2 30821108 SHA256 8e040bc7556401ebb3a347a8f7878e9d4028cf71b2744b1a1699f4e741966ba8 SHA512 1a4a6ebf700ec6851c83cc2a71eaea8d95f14c685d094eaaa86c740eb9401e49a79074b72385f58681ca7646771a99bb6bbd9bebb39162f7220626d37ed0654f WHIRLPOOL 79b1b8c19affc799e1a42c02a7c2fea13bf4ca1f9a2aa6e765d529aa3531f68cca77e92264561b2884314074f3148469f5a2f976c3473beb5ed0568617ce777b DIST qemu-2.5.0.tar.bz2 25464996 SHA256 3443887401619fe33bfa5d900a4f2d6a79425ae2b7e43d5b8c36eb7a683772d4 SHA512 12153f94cc7f834fd6a85f25690c36f2331d88d414426fb8b9ac20a34e6f9222b1eda30b727674af583580fae90dfd6d0614a905dce1567d94cd049d426b9dd3 WHIRLPOOL 8f5717989d8d234ecf1763ee386b2e1f20c3b17918de130c6dae255e4523a230b2b01a759eba25e4b9f604c680d9b868c56f58bd71b7c6c2c22a2e46804435ef DIST qemu-2.6.0.tar.bz2 25755267 SHA256 c9ac4a651b273233d21b8bec32e30507cb9cce7900841febc330956a1a8434ec SHA512 0d17075e52f7688cc05776ad7a76509d1f22ae8eda896fddb06c1fd6dea6da485422c8efb3ba118b054d9a413b7b02baba656a9131658dabdb71def50c92b215 WHIRLPOOL f9373bf66f67301787e7510ac161b0072ba7c7bc067e10215fb97a52524adaba0fcbc79a4c0cefac9c6e2b4e07380eb9d10f65ed6ce6867e43843043684231ed DIST qemu-2.8.1.tar.bz2 28366270 SHA256 018e4c7ed22c220395cf41f835d01505e49d0e579a548bd3d72b03809442bbcd SHA512 0397b4029cdcb77ed053c44b3579a3f34894038e6fc6b4aa88de14515f5a78bf2f41c5e865f37111529f567c85d2f1c4deefae47dde54f76eac79410e5b2bdda WHIRLPOOL c41f53f18fac44efd1c81ba9d95204d23e9a70dc9c21624177be2fe92a327428fd5704b25bc334229fa36ae395fb4c82ba3955db39719c4458343978a4d3141a DIST qemu-2.9.0.tar.bz2 28720490 SHA256 00bfb217b1bb03c7a6c3261b819cfccbfb5a58e3e2ceff546327d271773c6c14 SHA512 4b28966eec0ca44681e35fcfb64a4eaef7c280b8d65c91d03f2efa37f76278fd8c1680e5798c7a30dbfcc8f3c05f4a803f48b8a2dfec3a4181bac079b2a5e422 WHIRLPOOL d79fe89eb271a56aee0cbd328e5f96999176b711afb5683d164b7b99d91e6dd2bfaf6e2ff4cd820a941c94f28116765cb07ffd5809d75c2f9654a67d56bfc0c1 -EBUILD qemu-guest-agent-2.5.0.ebuild 1892 SHA256 dff4cfded6e5b9e4c7175a363cb75fbb92699d18b38cd44dfd007e2775bd167b SHA512 22cadd91d2f585908581285c484b48c9b794169b63fb57fb353a5e7d35bde5ea3decae2cbce302d168b30932c1d75f7a24e77d95a220b12c871f18469d280b95 WHIRLPOOL 5dc39c494703b4d521e17410dbbb9622900a6f7f2257b899aa0de71336db5560f61117049fc21b0695cbccb11dbe150d52ac9ce0b04124bbaec3797745ea17f0 -EBUILD qemu-guest-agent-2.6.0.ebuild 1896 SHA256 392882e333f2bd4ee95dc873c5942a749c82217b9a405106af01d36553a96f84 SHA512 c8e7b73d7b54b845f3bc65362ab7f9f144b245fb6d2a74ca5a85d7c0ba89daf1e8538e200b4461272f59bdfc664cc9afc0c85d3ddc10144e3bdd867dc9391932 WHIRLPOOL f6fb91c1fde69cf1ce686d7f1d5a4cee7f21ad4366f311046cb23621c3e29d3e3e42dea313136b154a0d33b92301eb8febf14f4ad37746f9d21f3f6451706fb3 -EBUILD qemu-guest-agent-2.8.1.ebuild 1870 SHA256 ad33b66657f2afeb429517d9d59d32638f07be63fe2f6a174870be43ac1e14f7 SHA512 e254689f9926f81f323eeda81d162fcea9b22a7338a291036491c6a0261cb2e56d4b5284ce06d92b8d7ece770a0912b8ed582dc94648c330f1235556bb124a70 WHIRLPOOL c4ba6224f0f23f01600dbc55586b594fff9753d2915dd99e91280a428fa27d2de5eddd22f886d3a4e473e353f4b5c1a0a0733a39917f076c6b57157d5787dc36 -EBUILD qemu-guest-agent-2.9.0.ebuild 1870 SHA256 ad33b66657f2afeb429517d9d59d32638f07be63fe2f6a174870be43ac1e14f7 SHA512 e254689f9926f81f323eeda81d162fcea9b22a7338a291036491c6a0261cb2e56d4b5284ce06d92b8d7ece770a0912b8ed582dc94648c330f1235556bb124a70 WHIRLPOOL c4ba6224f0f23f01600dbc55586b594fff9753d2915dd99e91280a428fa27d2de5eddd22f886d3a4e473e353f4b5c1a0a0733a39917f076c6b57157d5787dc36 +EBUILD qemu-guest-agent-2.10.1.ebuild 1769 SHA256 17739163b5f24474aeefe21aad12d525a2cce5f19019fb3409ac216a54848d8a SHA512 9957f121352745a1067cad18a056dd5afa8e243daa8c3f8d4ebacaad1399ff4f8c435a76b1f0a46d7de9f7939935548018e96473c4f0fc0476b8caf0cd660ff4 WHIRLPOOL 98e5d16c6f7d333cd2fc5455ebea66ce138b8a356bed62bf4ec94851bece08facafad2b9887d3eae970f00edcaec3264f8e1374fa67cf9fab55bce7cad5806fb +EBUILD qemu-guest-agent-2.5.0.ebuild 1791 SHA256 14976c07e6193be326132e8362f1bfd645e1392bee4ad978e4925b2c2fd2bcd1 SHA512 2fbb48f9835c602d42e027cdd50b33d1c62b946305b8bfd78fbdbe36c1c3ebc07e8d32e0ae10e76934db5dea9dfdfdba702c43e5e8deb3f5df037ce6f9dbba80 WHIRLPOOL c75d9c05f0e111e8316450e75df0400e90bbc09130e52cd4130baf0a6a01c33b5044622abfa98fa2e862e9ba7a8253676809e719a2da13a37537511ac2ce39cc +EBUILD qemu-guest-agent-2.6.0.ebuild 1795 SHA256 437388a4d7d9baa723952df08ed0a6318235ad55f9fd7e0a5e37435bf187fe7a SHA512 99b03e7808629cc14f988ba5f1a855a8fddf45bcf4ad695d4c791e12ddc7b189828b62a025c03a887f3d3d935afaeee4db658ea29a5f1d153e757af841a95e35 WHIRLPOOL 4a64882c771c54e41d83fb5707237da0374d716a76365b291d1f24942e47737384f87edfcd85b9ecb572ffe9ce0b3f0580e6b7aae42957213ea896dc4a8beae7 +EBUILD qemu-guest-agent-2.8.1.ebuild 1769 SHA256 17739163b5f24474aeefe21aad12d525a2cce5f19019fb3409ac216a54848d8a SHA512 9957f121352745a1067cad18a056dd5afa8e243daa8c3f8d4ebacaad1399ff4f8c435a76b1f0a46d7de9f7939935548018e96473c4f0fc0476b8caf0cd660ff4 WHIRLPOOL 98e5d16c6f7d333cd2fc5455ebea66ce138b8a356bed62bf4ec94851bece08facafad2b9887d3eae970f00edcaec3264f8e1374fa67cf9fab55bce7cad5806fb +EBUILD qemu-guest-agent-2.9.0.ebuild 1769 SHA256 17739163b5f24474aeefe21aad12d525a2cce5f19019fb3409ac216a54848d8a SHA512 9957f121352745a1067cad18a056dd5afa8e243daa8c3f8d4ebacaad1399ff4f8c435a76b1f0a46d7de9f7939935548018e96473c4f0fc0476b8caf0cd660ff4 WHIRLPOOL 98e5d16c6f7d333cd2fc5455ebea66ce138b8a356bed62bf4ec94851bece08facafad2b9887d3eae970f00edcaec3264f8e1374fa67cf9fab55bce7cad5806fb MISC ChangeLog 5204 SHA256 f13cae569746e19a3c7cfac563e06462aacf6d670a2ee1a0bc22b1b0834d209e SHA512 36f55c7386c67367cb2d5ac7f5088e1ca8d994f5c885c7b197836c710713f9d4e6ed1f6982a2deb01009c04b181f087717b0b40db41c4e3bf0b7fa2d56fdc3ee WHIRLPOOL 73efb8a1d6ffb44f1e717599921b6824cdc856d3f810d07c515a6eaa08e4eda0a3589614f24c381cf3b249e4dc259ed38e7b7a4cb95c6347ffc4111c9d634b0b MISC ChangeLog-2015 4832 SHA256 1fad5a1063bec302bc0ab1018fde27bc9c008f2b951e0f34f2a6f82f876fb5bb SHA512 3dba906cae2e94ba6ff9270cd998f2baf35f57adea449d71dba01b893d258ca0e75e34fcf6082d80e1d5ae51ebb17def65093b3207406f202a19a7165d1b8a4f WHIRLPOOL 35d0901089a82d90c8fcc05ec741b4b81a8684a21a39be564a07c9a72eff626871e72b7de3408254f6a030fa2c559395a3d3e33439bd21fe9dd164f49f98fe12 MISC metadata.xml 251 SHA256 e1a6e78de44cc67cab2037d0450e2f22376c057e2a1f05fa095c45c40ba767c2 SHA512 7a5f4f7e0f89c87ab04103d4688e87d1560d63b3565dde0b6089f272ccf6c235e0d2ad31383a5171d425776c4a98b999eb5de420e42d1af8b80e76256b2c9297 WHIRLPOOL 6f27653731c8c73ddaf17f8d7cf53abdbf38c1d35e7458e8affe55ebcfbd87b310c61e6d116919018bfcc969ead44b8775571f509f774a8e05829523ecf645c9 diff --git a/app-emulation/qemu-guest-agent/qemu-guest-agent-2.10.1.ebuild b/app-emulation/qemu-guest-agent/qemu-guest-agent-2.10.1.ebuild new file mode 100644 index 000000000000..3068067649b1 --- /dev/null +++ b/app-emulation/qemu-guest-agent/qemu-guest-agent-2.10.1.ebuild @@ -0,0 +1,82 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="6" + +PYTHON_COMPAT=( python2_7 ) + +inherit eutils systemd udev python-any-r1 + +MY_PN="qemu" +MY_P="${MY_PN}-${PV}" + +SRC_URI="http://wiki.qemu.org/download/${MY_P}.tar.bz2" +KEYWORDS="~amd64 ~ppc ~ppc64 ~x86 ~x86-fbsd" + +DESCRIPTION="QEMU Guest Agent (qemu-ga) for use when running inside a VM" +HOMEPAGE="http://wiki.qemu.org/Features/QAPI/GuestAgent" + +LICENSE="GPL-2 BSD-2" +SLOT="0" +IUSE="" + +RDEPEND=">=dev-libs/glib-2.22 + ! -Date: Fri, 25 Aug 2017 01:35:53 +0200 -Subject: [PATCH] slirp: fix clearing ifq_so from pending packets -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -The if_fastq and if_batchq contain not only packets, but queues of packets -for the same socket. When sofree frees a socket, it thus has to clear ifq_so -from all the packets from the queues, not only the first. - -Signed-off-by: Samuel Thibault -Reviewed-by: Philippe Mathieu-Daudé -Cc: qemu-stable@nongnu.org -Signed-off-by: Peter Maydell ---- - slirp/socket.c | 39 +++++++++++++++++++++++---------------- - 1 file changed, 23 insertions(+), 16 deletions(-) - -diff --git a/slirp/socket.c b/slirp/socket.c -index ecec0295a9..cb7b5b608d 100644 ---- a/slirp/socket.c -+++ b/slirp/socket.c -@@ -60,29 +60,36 @@ socreate(Slirp *slirp) - } - - /* -+ * Remove references to so from the given message queue. -+ */ -+static void -+soqfree(struct socket *so, struct quehead *qh) -+{ -+ struct mbuf *ifq; -+ -+ for (ifq = (struct mbuf *) qh->qh_link; -+ (struct quehead *) ifq != qh; -+ ifq = ifq->ifq_next) { -+ if (ifq->ifq_so == so) { -+ struct mbuf *ifm; -+ ifq->ifq_so = NULL; -+ for (ifm = ifq->ifs_next; ifm != ifq; ifm = ifm->ifs_next) { -+ ifm->ifq_so = NULL; -+ } -+ } -+ } -+} -+ -+/* - * remque and free a socket, clobber cache - */ - void - sofree(struct socket *so) - { - Slirp *slirp = so->slirp; -- struct mbuf *ifm; - -- for (ifm = (struct mbuf *) slirp->if_fastq.qh_link; -- (struct quehead *) ifm != &slirp->if_fastq; -- ifm = ifm->ifq_next) { -- if (ifm->ifq_so == so) { -- ifm->ifq_so = NULL; -- } -- } -- -- for (ifm = (struct mbuf *) slirp->if_batchq.qh_link; -- (struct quehead *) ifm != &slirp->if_batchq; -- ifm = ifm->ifq_next) { -- if (ifm->ifq_so == so) { -- ifm->ifq_so = NULL; -- } -- } -+ soqfree(so, &slirp->if_fastq); -+ soqfree(so, &slirp->if_batchq); - - if (so->so_emu==EMU_RSH && so->extra) { - sofree(so->extra); --- -2.13.5 - diff --git a/app-emulation/qemu/files/qemu-2.10.1-CVE-2017-15268.patch b/app-emulation/qemu/files/qemu-2.10.1-CVE-2017-15268.patch new file mode 100644 index 000000000000..7d08b32b0272 --- /dev/null +++ b/app-emulation/qemu/files/qemu-2.10.1-CVE-2017-15268.patch @@ -0,0 +1,54 @@ +From a7b20a8efa28e5f22c26c06cd06c2f12bc863493 Mon Sep 17 00:00:00 2001 +From: "Daniel P. Berrange" +Date: Mon, 9 Oct 2017 14:43:42 +0100 +Subject: [PATCH] io: monitor encoutput buffer size from websocket GSource + +The websocket GSource is monitoring the size of the rawoutput +buffer to determine if the channel can accepts more writes. +The rawoutput buffer, however, is merely a temporary staging +buffer before data is copied into the encoutput buffer. Thus +its size will always be zero when the GSource runs. + +This flaw causes the encoutput buffer to grow without bound +if the other end of the underlying data channel doesn't +read data being sent. This can be seen with VNC if a client +is on a slow WAN link and the guest OS is sending many screen +updates. A malicious VNC client can act like it is on a slow +link by playing a video in the guest and then reading data +very slowly, causing QEMU host memory to expand arbitrarily. + +This issue is assigned CVE-2017-15268, publically reported in + + https://bugs.launchpad.net/qemu/+bug/1718964 + +Reviewed-by: Eric Blake +Signed-off-by: Daniel P. Berrange +--- + io/channel-websock.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/io/channel-websock.c b/io/channel-websock.c +index d1d471f86e..04bcc059cd 100644 +--- a/io/channel-websock.c ++++ b/io/channel-websock.c +@@ -28,7 +28,7 @@ + #include + + +-/* Max amount to allow in rawinput/rawoutput buffers */ ++/* Max amount to allow in rawinput/encoutput buffers */ + #define QIO_CHANNEL_WEBSOCK_MAX_BUFFER 8192 + + #define QIO_CHANNEL_WEBSOCK_CLIENT_KEY_LEN 24 +@@ -1208,7 +1208,7 @@ qio_channel_websock_source_check(GSource *source) + if (wsource->wioc->rawinput.offset || wsource->wioc->io_eof) { + cond |= G_IO_IN; + } +- if (wsource->wioc->rawoutput.offset < QIO_CHANNEL_WEBSOCK_MAX_BUFFER) { ++ if (wsource->wioc->encoutput.offset < QIO_CHANNEL_WEBSOCK_MAX_BUFFER) { + cond |= G_IO_OUT; + } + +-- +2.13.6 + diff --git a/app-emulation/qemu/files/qemu-2.10.1-CVE-2017-15289.patch b/app-emulation/qemu/files/qemu-2.10.1-CVE-2017-15289.patch new file mode 100644 index 000000000000..a4ad2d5e4359 --- /dev/null +++ b/app-emulation/qemu/files/qemu-2.10.1-CVE-2017-15289.patch @@ -0,0 +1,58 @@ +From eb38e1bc3740725ca29a535351de94107ec58d51 Mon Sep 17 00:00:00 2001 +From: Gerd Hoffmann +Date: Wed, 11 Oct 2017 10:43:14 +0200 +Subject: [PATCH] cirrus: fix oob access in mode4and5 write functions + +Move dst calculation into the loop, so we apply the mask on each +interation and will not overflow vga memory. + +Cc: Prasad J Pandit +Reported-by: Niu Guoxiang +Signed-off-by: Gerd Hoffmann +Message-id: 20171011084314.21752-1-kraxel@redhat.com +--- + hw/display/cirrus_vga.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c +index b4d579857a..bc32bf1e39 100644 +--- a/hw/display/cirrus_vga.c ++++ b/hw/display/cirrus_vga.c +@@ -2038,15 +2038,14 @@ static void cirrus_mem_writeb_mode4and5_8bpp(CirrusVGAState * s, + unsigned val = mem_value; + uint8_t *dst; + +- dst = s->vga.vram_ptr + (offset &= s->cirrus_addr_mask); + for (x = 0; x < 8; x++) { ++ dst = s->vga.vram_ptr + ((offset + x) & s->cirrus_addr_mask); + if (val & 0x80) { + *dst = s->cirrus_shadow_gr1; + } else if (mode == 5) { + *dst = s->cirrus_shadow_gr0; + } + val <<= 1; +- dst++; + } + memory_region_set_dirty(&s->vga.vram, offset, 8); + } +@@ -2060,8 +2059,8 @@ static void cirrus_mem_writeb_mode4and5_16bpp(CirrusVGAState * s, + unsigned val = mem_value; + uint8_t *dst; + +- dst = s->vga.vram_ptr + (offset &= s->cirrus_addr_mask); + for (x = 0; x < 8; x++) { ++ dst = s->vga.vram_ptr + ((offset + 2 * x) & s->cirrus_addr_mask & ~1); + if (val & 0x80) { + *dst = s->cirrus_shadow_gr1; + *(dst + 1) = s->vga.gr[0x11]; +@@ -2070,7 +2069,6 @@ static void cirrus_mem_writeb_mode4and5_16bpp(CirrusVGAState * s, + *(dst + 1) = s->vga.gr[0x10]; + } + val <<= 1; +- dst += 2; + } + memory_region_set_dirty(&s->vga.vram, offset, 16); + } +-- +2.13.6 + diff --git a/app-emulation/qemu/files/qemu-2.9.0-CVE-2017-10664.patch b/app-emulation/qemu/files/qemu-2.9.0-CVE-2017-10664.patch deleted file mode 100644 index 7db06929cf21..000000000000 --- a/app-emulation/qemu/files/qemu-2.9.0-CVE-2017-10664.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 041e32b8d9d076980b4e35317c0339e57ab888f1 Mon Sep 17 00:00:00 2001 -From: Max Reitz -Date: Sun, 11 Jun 2017 14:37:14 +0200 -Subject: [PATCH] qemu-nbd: Ignore SIGPIPE - -qemu proper has done so for 13 years -(8a7ddc38a60648257dc0645ab4a05b33d6040063), qemu-img and qemu-io have -done so for four years (526eda14a68d5b3596be715505289b541288ef2a). -Ignoring this signal is especially important in qemu-nbd because -otherwise a client can easily take down the qemu-nbd server by dropping -the connection when the server wants to send something, for example: - -$ qemu-nbd -x foo -f raw -t null-co:// & -[1] 12726 -$ qemu-io -c quit nbd://localhost/bar -can't open device nbd://localhost/bar: No export with name 'bar' available -[1] + 12726 broken pipe qemu-nbd -x foo -f raw -t null-co:// - -In this case, the client sends an NBD_OPT_ABORT and closes the -connection (because it is not required to wait for a reply), but the -server replies with an NBD_REP_ACK (because it is required to reply). - -Signed-off-by: Max Reitz -Message-Id: <20170611123714.31292-1-mreitz@redhat.com> -Signed-off-by: Paolo Bonzini ---- - qemu-nbd.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/qemu-nbd.c b/qemu-nbd.c -index 9464a0461c..4dd3fd4732 100644 ---- a/qemu-nbd.c -+++ b/qemu-nbd.c -@@ -581,6 +581,10 @@ int main(int argc, char **argv) - sa_sigterm.sa_handler = termsig_handler; - sigaction(SIGTERM, &sa_sigterm, NULL); - -+#ifdef CONFIG_POSIX -+ signal(SIGPIPE, SIG_IGN); -+#endif -+ - module_call_init(MODULE_INIT_TRACE); - qcrypto_init(&error_fatal); - --- -2.13.0 - diff --git a/app-emulation/qemu/files/qemu-2.9.0-CVE-2017-10806.patch b/app-emulation/qemu/files/qemu-2.9.0-CVE-2017-10806.patch deleted file mode 100644 index 0074f5f8c77a..000000000000 --- a/app-emulation/qemu/files/qemu-2.9.0-CVE-2017-10806.patch +++ /dev/null @@ -1,50 +0,0 @@ -From bd4a683505b27adc1ac809f71e918e58573d851d Mon Sep 17 00:00:00 2001 -From: Gerd Hoffmann -Date: Tue, 9 May 2017 13:01:28 +0200 -Subject: [PATCH] usb-redir: fix stack overflow in usbredir_log_data -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Don't reinvent a broken wheel, just use the hexdump function we have. - -Impact: low, broken code doesn't run unless you have debug logging -enabled. - -Reported-by: 李强 -Signed-off-by: Gerd Hoffmann -Message-id: 20170509110128.27261-1-kraxel@redhat.com ---- - hw/usb/redirect.c | 13 +------------ - 1 file changed, 1 insertion(+), 12 deletions(-) - -diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c -index b001a27f05..ad5ef783a6 100644 ---- a/hw/usb/redirect.c -+++ b/hw/usb/redirect.c -@@ -229,21 +229,10 @@ static void usbredir_log(void *priv, int level, const char *msg) - static void usbredir_log_data(USBRedirDevice *dev, const char *desc, - const uint8_t *data, int len) - { -- int i, j, n; -- - if (dev->debug < usbredirparser_debug_data) { - return; - } -- -- for (i = 0; i < len; i += j) { -- char buf[128]; -- -- n = sprintf(buf, "%s", desc); -- for (j = 0; j < 8 && i + j < len; j++) { -- n += sprintf(buf + n, " %02X", data[i + j]); -- } -- error_report("%s", buf); -- } -+ qemu_hexdump((char *)data, stderr, desc, len); - } - - /* --- -2.13.0 - diff --git a/app-emulation/qemu/files/qemu-2.9.0-CVE-2017-11334.patch b/app-emulation/qemu/files/qemu-2.9.0-CVE-2017-11334.patch deleted file mode 100644 index bfe4c7d89f2b..000000000000 --- a/app-emulation/qemu/files/qemu-2.9.0-CVE-2017-11334.patch +++ /dev/null @@ -1,40 +0,0 @@ -[Qemu-devel] [PULL 21/41] exec: use qemu_ram_ptr_length to access guest -From: Prasad J Pandit - -When accessing guest's ram block during DMA operation, use -'qemu_ram_ptr_length' to get ram block pointer. It ensures -that DMA operation of given length is possible; And avoids -any OOB memory access situations. - -Reported-by: Alex -Signed-off-by: Prasad J Pandit -Message-Id: -Signed-off-by: Paolo Bonzini ---- - exec.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/exec.c b/exec.c -index a083ff8..ad103ce 100644 ---- a/exec.c -+++ b/exec.c -@@ -2929,7 +2929,7 @@ static MemTxResult address_space_write_continue(AddressSpace *as, hwaddr addr, - } - } else { - /* RAM case */ -- ptr = qemu_map_ram_ptr(mr->ram_block, addr1); -+ ptr = qemu_ram_ptr_length(mr->ram_block, addr1, &l); - memcpy(ptr, buf, l); - invalidate_and_set_dirty(mr, addr1, l); - } -@@ -3020,7 +3020,7 @@ MemTxResult address_space_read_continue(AddressSpace *as, hwaddr addr, - } - } else { - /* RAM case */ -- ptr = qemu_map_ram_ptr(mr->ram_block, addr1); -+ ptr = qemu_ram_ptr_length(mr->ram_block, addr1, &l); - memcpy(buf, ptr, l); - } - --- -1.8.3.1 diff --git a/app-emulation/qemu/files/qemu-2.9.0-CVE-2017-11434.patch b/app-emulation/qemu/files/qemu-2.9.0-CVE-2017-11434.patch deleted file mode 100644 index 5d32067c7a05..000000000000 --- a/app-emulation/qemu/files/qemu-2.9.0-CVE-2017-11434.patch +++ /dev/null @@ -1,29 +0,0 @@ -[Qemu-devel] [PATCH] slirp: check len against dhcp options array end -From: Prasad J Pandit - -While parsing dhcp options string in 'dhcp_decode', if an options' -length 'len' appeared towards the end of 'bp_vend' array, ensuing -read could lead to an OOB memory access issue. Add check to avoid it. - -Reported-by: Reno Robert -Signed-off-by: Prasad J Pandit ---- - slirp/bootp.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/slirp/bootp.c b/slirp/bootp.c -index 5a4646c..5dd1a41 100644 ---- a/slirp/bootp.c -+++ b/slirp/bootp.c -@@ -123,6 +123,9 @@ static void dhcp_decode(const struct bootp_t *bp, int *pmsg_type, - if (p >= p_end) - break; - len = *p++; -+ if (p + len > p_end) { -+ break; -+ } - DPRINTF("dhcp: tag=%d len=%d\n", tag, len); - - switch(tag) { --- -2.9.4 diff --git a/app-emulation/qemu/files/qemu-2.9.0-CVE-2017-7493.patch b/app-emulation/qemu/files/qemu-2.9.0-CVE-2017-7493.patch deleted file mode 100644 index 346e7713f749..000000000000 --- a/app-emulation/qemu/files/qemu-2.9.0-CVE-2017-7493.patch +++ /dev/null @@ -1,174 +0,0 @@ -From 7a95434e0ca8a037fd8aa1a2e2461f92585eb77b Mon Sep 17 00:00:00 2001 -From: Greg Kurz -Date: Fri, 5 May 2017 14:48:08 +0200 -Subject: [PATCH] 9pfs: local: forbid client access to metadata (CVE-2017-7493) - -When using the mapped-file security mode, we shouldn't let the client mess -with the metadata. The current code already tries to hide the metadata dir -from the client by skipping it in local_readdir(). But the client can still -access or modify it through several other operations. This can be used to -escalate privileges in the guest. - -Affected backend operations are: -- local_mknod() -- local_mkdir() -- local_open2() -- local_symlink() -- local_link() -- local_unlinkat() -- local_renameat() -- local_rename() -- local_name_to_path() - -Other operations are safe because they are only passed a fid path, which -is computed internally in local_name_to_path(). - -This patch converts all the functions listed above to fail and return -EINVAL when being passed the name of the metadata dir. This may look -like a poor choice for errno, but there's no such thing as an illegal -path name on Linux and I could not think of anything better. - -This fixes CVE-2017-7493. - -Reported-by: Leo Gaspard -Signed-off-by: Greg Kurz -Reviewed-by: Eric Blake ---- - hw/9pfs/9p-local.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- - 1 file changed, 56 insertions(+), 2 deletions(-) - -diff --git a/hw/9pfs/9p-local.c b/hw/9pfs/9p-local.c -index f3ebca4f7a..a2486566af 100644 ---- a/hw/9pfs/9p-local.c -+++ b/hw/9pfs/9p-local.c -@@ -452,6 +452,11 @@ static off_t local_telldir(FsContext *ctx, V9fsFidOpenState *fs) - return telldir(fs->dir.stream); - } - -+static bool local_is_mapped_file_metadata(FsContext *fs_ctx, const char *name) -+{ -+ return !strcmp(name, VIRTFS_META_DIR); -+} -+ - static struct dirent *local_readdir(FsContext *ctx, V9fsFidOpenState *fs) - { - struct dirent *entry; -@@ -465,8 +470,8 @@ again: - if (ctx->export_flags & V9FS_SM_MAPPED) { - entry->d_type = DT_UNKNOWN; - } else if (ctx->export_flags & V9FS_SM_MAPPED_FILE) { -- if (!strcmp(entry->d_name, VIRTFS_META_DIR)) { -- /* skp the meta data directory */ -+ if (local_is_mapped_file_metadata(ctx, entry->d_name)) { -+ /* skip the meta data directory */ - goto again; - } - entry->d_type = DT_UNKNOWN; -@@ -559,6 +564,12 @@ static int local_mknod(FsContext *fs_ctx, V9fsPath *dir_path, - int err = -1; - int dirfd; - -+ if (fs_ctx->export_flags & V9FS_SM_MAPPED_FILE && -+ local_is_mapped_file_metadata(fs_ctx, name)) { -+ errno = EINVAL; -+ return -1; -+ } -+ - dirfd = local_opendir_nofollow(fs_ctx, dir_path->data); - if (dirfd == -1) { - return -1; -@@ -605,6 +616,12 @@ static int local_mkdir(FsContext *fs_ctx, V9fsPath *dir_path, - int err = -1; - int dirfd; - -+ if (fs_ctx->export_flags & V9FS_SM_MAPPED_FILE && -+ local_is_mapped_file_metadata(fs_ctx, name)) { -+ errno = EINVAL; -+ return -1; -+ } -+ - dirfd = local_opendir_nofollow(fs_ctx, dir_path->data); - if (dirfd == -1) { - return -1; -@@ -694,6 +711,12 @@ static int local_open2(FsContext *fs_ctx, V9fsPath *dir_path, const char *name, - int err = -1; - int dirfd; - -+ if (fs_ctx->export_flags & V9FS_SM_MAPPED_FILE && -+ local_is_mapped_file_metadata(fs_ctx, name)) { -+ errno = EINVAL; -+ return -1; -+ } -+ - /* - * Mark all the open to not follow symlinks - */ -@@ -752,6 +775,12 @@ static int local_symlink(FsContext *fs_ctx, const char *oldpath, - int err = -1; - int dirfd; - -+ if (fs_ctx->export_flags & V9FS_SM_MAPPED_FILE && -+ local_is_mapped_file_metadata(fs_ctx, name)) { -+ errno = EINVAL; -+ return -1; -+ } -+ - dirfd = local_opendir_nofollow(fs_ctx, dir_path->data); - if (dirfd == -1) { - return -1; -@@ -826,6 +855,12 @@ static int local_link(FsContext *ctx, V9fsPath *oldpath, - int ret = -1; - int odirfd, ndirfd; - -+ if (ctx->export_flags & V9FS_SM_MAPPED_FILE && -+ local_is_mapped_file_metadata(ctx, name)) { -+ errno = EINVAL; -+ return -1; -+ } -+ - odirfd = local_opendir_nofollow(ctx, odirpath); - if (odirfd == -1) { - goto out; -@@ -1096,6 +1131,12 @@ static int local_lremovexattr(FsContext *ctx, V9fsPath *fs_path, - static int local_name_to_path(FsContext *ctx, V9fsPath *dir_path, - const char *name, V9fsPath *target) - { -+ if (ctx->export_flags & V9FS_SM_MAPPED_FILE && -+ local_is_mapped_file_metadata(ctx, name)) { -+ errno = EINVAL; -+ return -1; -+ } -+ - if (dir_path) { - v9fs_path_sprintf(target, "%s/%s", dir_path->data, name); - } else if (strcmp(name, "/")) { -@@ -1116,6 +1157,13 @@ static int local_renameat(FsContext *ctx, V9fsPath *olddir, - int ret; - int odirfd, ndirfd; - -+ if (ctx->export_flags & V9FS_SM_MAPPED_FILE && -+ (local_is_mapped_file_metadata(ctx, old_name) || -+ local_is_mapped_file_metadata(ctx, new_name))) { -+ errno = EINVAL; -+ return -1; -+ } -+ - odirfd = local_opendir_nofollow(ctx, olddir->data); - if (odirfd == -1) { - return -1; -@@ -1206,6 +1254,12 @@ static int local_unlinkat(FsContext *ctx, V9fsPath *dir, - int ret; - int dirfd; - -+ if (ctx->export_flags & V9FS_SM_MAPPED_FILE && -+ local_is_mapped_file_metadata(ctx, name)) { -+ errno = EINVAL; -+ return -1; -+ } -+ - dirfd = local_opendir_nofollow(ctx, dir->data); - if (dirfd == -1) { - return -1; --- -2.13.0 - diff --git a/app-emulation/qemu/files/qemu-2.9.0-CVE-2017-8112.patch b/app-emulation/qemu/files/qemu-2.9.0-CVE-2017-8112.patch deleted file mode 100644 index 31fb69bf8976..000000000000 --- a/app-emulation/qemu/files/qemu-2.9.0-CVE-2017-8112.patch +++ /dev/null @@ -1,22 +0,0 @@ -CVE-2017-8112 - -https://lists.gnu.org/archive/html/qemu-devel/2017-04/msg04494.html ---- - hw/scsi/vmw_pvscsi.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/hw/scsi/vmw_pvscsi.c b/hw/scsi/vmw_pvscsi.c -index 7557546..4a106da 100644 ---- a/hw/scsi/vmw_pvscsi.c -+++ b/hw/scsi/vmw_pvscsi.c -@@ -202,7 +202,7 @@ pvscsi_ring_init_msg(PVSCSIRingInfo *m, PVSCSICmdDescSetupMsgRing *ri) - uint32_t len_log2; - uint32_t ring_size; - -- if (ri->numPages > PVSCSI_SETUP_MSG_RING_MAX_NUM_PAGES) { -+ if (!ri->numPages || ri->numPages > PVSCSI_SETUP_MSG_RING_MAX_NUM_PAGES) { - return -1; - } - ring_size = ri->numPages * PVSCSI_MAX_NUM_MSG_ENTRIES_PER_PAGE; --- -2.9.3 diff --git a/app-emulation/qemu/files/qemu-2.9.0-CVE-2017-8309.patch b/app-emulation/qemu/files/qemu-2.9.0-CVE-2017-8309.patch deleted file mode 100644 index 4f7f870210cd..000000000000 --- a/app-emulation/qemu/files/qemu-2.9.0-CVE-2017-8309.patch +++ /dev/null @@ -1,22 +0,0 @@ -bug #616870 - -https://lists.gnu.org/archive/html/qemu-devel/2017-04/msg05587.html ---- - audio/audio.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/audio/audio.c b/audio/audio.c -index c8898d8422..beafed209b 100644 ---- a/audio/audio.c -+++ b/audio/audio.c -@@ -2028,6 +2028,8 @@ void AUD_del_capture (CaptureVoiceOut *cap, void *cb_opaque) - sw = sw1; - } - QLIST_REMOVE (cap, entries); -+ g_free (cap->hw.mix_buf); -+ g_free (cap->buf); - g_free (cap); - } - return; --- -2.9.3 diff --git a/app-emulation/qemu/files/qemu-2.9.0-CVE-2017-8379.patch b/app-emulation/qemu/files/qemu-2.9.0-CVE-2017-8379.patch deleted file mode 100644 index 0a34dae671cb..000000000000 --- a/app-emulation/qemu/files/qemu-2.9.0-CVE-2017-8379.patch +++ /dev/null @@ -1,76 +0,0 @@ -bug #616872 - -https://lists.gnu.org/archive/html/qemu-devel/2017-04/msg05599.html ---- - ui/input.c | 14 +++++++++++--- - 1 file changed, 11 insertions(+), 3 deletions(-) - -diff --git a/ui/input.c b/ui/input.c -index ed88cda6d6..fb1f404095 100644 ---- a/ui/input.c -+++ b/ui/input.c -@@ -41,6 +41,8 @@ static QTAILQ_HEAD(QemuInputEventQueueHead, QemuInputEventQueue) kbd_queue = - QTAILQ_HEAD_INITIALIZER(kbd_queue); - static QEMUTimer *kbd_timer; - static uint32_t kbd_default_delay_ms = 10; -+static uint32_t queue_count; -+static uint32_t queue_limit = 1024; - - QemuInputHandlerState *qemu_input_handler_register(DeviceState *dev, - QemuInputHandler *handler) -@@ -268,6 +270,7 @@ static void qemu_input_queue_process(void *opaque) - break; - } - QTAILQ_REMOVE(queue, item, node); -+ queue_count--; - g_free(item); - } - } -@@ -282,6 +285,7 @@ static void qemu_input_queue_delay(struct QemuInputEventQueueHead *queue, - item->delay_ms = delay_ms; - item->timer = timer; - QTAILQ_INSERT_TAIL(queue, item, node); -+ queue_count++; - - if (start_timer) { - timer_mod(item->timer, qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL) -@@ -298,6 +302,7 @@ static void qemu_input_queue_event(struct QemuInputEventQueueHead *queue, - item->src = src; - item->evt = evt; - QTAILQ_INSERT_TAIL(queue, item, node); -+ queue_count++; - } - - static void qemu_input_queue_sync(struct QemuInputEventQueueHead *queue) -@@ -306,6 +311,7 @@ static void qemu_input_queue_sync(struct QemuInputEventQueueHead *queue) - - item->type = QEMU_INPUT_QUEUE_SYNC; - QTAILQ_INSERT_TAIL(queue, item, node); -+ queue_count++; - } - - void qemu_input_event_send_impl(QemuConsole *src, InputEvent *evt) -@@ -381,7 +387,7 @@ void qemu_input_event_send_key(QemuConsole *src, KeyValue *key, bool down) - qemu_input_event_send(src, evt); - qemu_input_event_sync(); - qapi_free_InputEvent(evt); -- } else { -+ } else if (queue_count < queue_limit) { - qemu_input_queue_event(&kbd_queue, src, evt); - qemu_input_queue_sync(&kbd_queue); - } -@@ -409,8 +415,10 @@ void qemu_input_event_send_key_delay(uint32_t delay_ms) - kbd_timer = timer_new_ms(QEMU_CLOCK_VIRTUAL, qemu_input_queue_process, - &kbd_queue); - } -- qemu_input_queue_delay(&kbd_queue, kbd_timer, -- delay_ms ? delay_ms : kbd_default_delay_ms); -+ if (queue_count < queue_limit) { -+ qemu_input_queue_delay(&kbd_queue, kbd_timer, -+ delay_ms ? delay_ms : kbd_default_delay_ms); -+ } - } - - InputEvent *qemu_input_event_new_btn(InputButton btn, bool down) --- -2.9.3 diff --git a/app-emulation/qemu/files/qemu-2.9.0-CVE-2017-8380.patch b/app-emulation/qemu/files/qemu-2.9.0-CVE-2017-8380.patch deleted file mode 100644 index 08911dd0bfb0..000000000000 --- a/app-emulation/qemu/files/qemu-2.9.0-CVE-2017-8380.patch +++ /dev/null @@ -1,34 +0,0 @@ -bug #616874 - -https://lists.gnu.org/archive/html/qemu-devel/2017-04/msg04147.html ---- - hw/scsi/megasas.c | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - -diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c -index 84b8caf..804122a 100644 ---- a/hw/scsi/megasas.c -+++ b/hw/scsi/megasas.c -@@ -2138,15 +2138,15 @@ static void megasas_mmio_write(void *opaque, hwaddr addr, - case MFI_SEQ: - trace_megasas_mmio_writel("MFI_SEQ", val); - /* Magic sequence to start ADP reset */ -- if (adp_reset_seq[s->adp_reset] == val) { -- s->adp_reset++; -+ if (adp_reset_seq[s->adp_reset++] == val) { -+ if (s->adp_reset == 6) { -+ s->adp_reset = 0; -+ s->diag = MFI_DIAG_WRITE_ENABLE; -+ } - } else { - s->adp_reset = 0; - s->diag = 0; - } -- if (s->adp_reset == 6) { -- s->diag = MFI_DIAG_WRITE_ENABLE; -- } - break; - case MFI_DIAG: - trace_megasas_mmio_writel("MFI_DIAG", val); --- -2.9.3 diff --git a/app-emulation/qemu/files/qemu-2.9.0-CVE-2017-9503-1.patch b/app-emulation/qemu/files/qemu-2.9.0-CVE-2017-9503-1.patch deleted file mode 100644 index 01c81d10ec0a..000000000000 --- a/app-emulation/qemu/files/qemu-2.9.0-CVE-2017-9503-1.patch +++ /dev/null @@ -1,122 +0,0 @@ -From 87e459a810d7b1ec1638085b5a80ea3d9b43119a Mon Sep 17 00:00:00 2001 -From: Paolo Bonzini -Date: Thu, 1 Jun 2017 17:26:14 +0200 -Subject: [PATCH] megasas: always store SCSIRequest* into MegasasCmd - -This ensures that the request is unref'ed properly, and avoids a -segmentation fault in the new qtest testcase that is added. -This is CVE-2017-9503. - -Reported-by: Zhangyanyu -Signed-off-by: Paolo Bonzini ---- - hw/scsi/megasas.c | 31 ++++++++++++++++--------------- - 2 files changed, 51 insertions(+), 15 deletions(-) - -diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c -index 135662df31..734fdaef90 100644 ---- a/hw/scsi/megasas.c -+++ b/hw/scsi/megasas.c -@@ -609,6 +609,9 @@ static void megasas_reset_frames(MegasasState *s) - static void megasas_abort_command(MegasasCmd *cmd) - { - /* Never abort internal commands. */ -+ if (cmd->dcmd_opcode != -1) { -+ return; -+ } - if (cmd->req != NULL) { - scsi_req_cancel(cmd->req); - } -@@ -1017,7 +1020,6 @@ static int megasas_pd_get_info_submit(SCSIDevice *sdev, int lun, - uint64_t pd_size; - uint16_t pd_id = ((sdev->id & 0xFF) << 8) | (lun & 0xFF); - uint8_t cmdbuf[6]; -- SCSIRequest *req; - size_t len, resid; - - if (!cmd->iov_buf) { -@@ -1026,8 +1028,8 @@ static int megasas_pd_get_info_submit(SCSIDevice *sdev, int lun, - info->inquiry_data[0] = 0x7f; /* Force PQual 0x3, PType 0x1f */ - info->vpd_page83[0] = 0x7f; - megasas_setup_inquiry(cmdbuf, 0, sizeof(info->inquiry_data)); -- req = scsi_req_new(sdev, cmd->index, lun, cmdbuf, cmd); -- if (!req) { -+ cmd->req = scsi_req_new(sdev, cmd->index, lun, cmdbuf, cmd); -+ if (!cmd->req) { - trace_megasas_dcmd_req_alloc_failed(cmd->index, - "PD get info std inquiry"); - g_free(cmd->iov_buf); -@@ -1036,26 +1038,26 @@ static int megasas_pd_get_info_submit(SCSIDevice *sdev, int lun, - } - trace_megasas_dcmd_internal_submit(cmd->index, - "PD get info std inquiry", lun); -- len = scsi_req_enqueue(req); -+ len = scsi_req_enqueue(cmd->req); - if (len > 0) { - cmd->iov_size = len; -- scsi_req_continue(req); -+ scsi_req_continue(cmd->req); - } - return MFI_STAT_INVALID_STATUS; - } else if (info->inquiry_data[0] != 0x7f && info->vpd_page83[0] == 0x7f) { - megasas_setup_inquiry(cmdbuf, 0x83, sizeof(info->vpd_page83)); -- req = scsi_req_new(sdev, cmd->index, lun, cmdbuf, cmd); -- if (!req) { -+ cmd->req = scsi_req_new(sdev, cmd->index, lun, cmdbuf, cmd); -+ if (!cmd->req) { - trace_megasas_dcmd_req_alloc_failed(cmd->index, - "PD get info vpd inquiry"); - return MFI_STAT_FLASH_ALLOC_FAIL; - } - trace_megasas_dcmd_internal_submit(cmd->index, - "PD get info vpd inquiry", lun); -- len = scsi_req_enqueue(req); -+ len = scsi_req_enqueue(cmd->req); - if (len > 0) { - cmd->iov_size = len; -- scsi_req_continue(req); -+ scsi_req_continue(cmd->req); - } - return MFI_STAT_INVALID_STATUS; - } -@@ -1217,7 +1219,6 @@ static int megasas_ld_get_info_submit(SCSIDevice *sdev, int lun, - struct mfi_ld_info *info = cmd->iov_buf; - size_t dcmd_size = sizeof(struct mfi_ld_info); - uint8_t cdb[6]; -- SCSIRequest *req; - ssize_t len, resid; - uint16_t sdev_id = ((sdev->id & 0xFF) << 8) | (lun & 0xFF); - uint64_t ld_size; -@@ -1226,8 +1227,8 @@ static int megasas_ld_get_info_submit(SCSIDevice *sdev, int lun, - cmd->iov_buf = g_malloc0(dcmd_size); - info = cmd->iov_buf; - megasas_setup_inquiry(cdb, 0x83, sizeof(info->vpd_page83)); -- req = scsi_req_new(sdev, cmd->index, lun, cdb, cmd); -- if (!req) { -+ cmd->req = scsi_req_new(sdev, cmd->index, lun, cdb, cmd); -+ if (!cmd->req) { - trace_megasas_dcmd_req_alloc_failed(cmd->index, - "LD get info vpd inquiry"); - g_free(cmd->iov_buf); -@@ -1236,10 +1237,10 @@ static int megasas_ld_get_info_submit(SCSIDevice *sdev, int lun, - } - trace_megasas_dcmd_internal_submit(cmd->index, - "LD get info vpd inquiry", lun); -- len = scsi_req_enqueue(req); -+ len = scsi_req_enqueue(cmd->req); - if (len > 0) { - cmd->iov_size = len; -- scsi_req_continue(req); -+ scsi_req_continue(cmd->req); - } - return MFI_STAT_INVALID_STATUS; - } -@@ -1851,7 +1852,7 @@ static void megasas_command_complete(SCSIRequest *req, uint32_t status, - return; - } - -- if (cmd->req == NULL) { -+ if (cmd->dcmd_opcode != -1) { - /* - * Internal command complete - */ diff --git a/app-emulation/qemu/files/qemu-2.9.0-CVE-2017-9503-2.patch b/app-emulation/qemu/files/qemu-2.9.0-CVE-2017-9503-2.patch deleted file mode 100644 index 74725a927364..000000000000 --- a/app-emulation/qemu/files/qemu-2.9.0-CVE-2017-9503-2.patch +++ /dev/null @@ -1,114 +0,0 @@ -From 5104fac8539eaf155fc6de93e164be43e1e62242 Mon Sep 17 00:00:00 2001 -From: Paolo Bonzini -Date: Thu, 1 Jun 2017 17:18:23 +0200 -Subject: [PATCH] megasas: do not read DCMD opcode more than once from frame - -Avoid TOC-TOU bugs by storing the DCMD opcode in the MegasasCmd - -Signed-off-by: Paolo Bonzini ---- - hw/scsi/megasas.c | 25 +++++++++++-------------- - 1 file changed, 11 insertions(+), 14 deletions(-) - -diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c -index c353118882..a3f75c1650 100644 ---- a/hw/scsi/megasas.c -+++ b/hw/scsi/megasas.c -@@ -63,6 +63,7 @@ typedef struct MegasasCmd { - - hwaddr pa; - hwaddr pa_size; -+ uint32_t dcmd_opcode; - union mfi_frame *frame; - SCSIRequest *req; - QEMUSGList qsg; -@@ -513,6 +514,7 @@ static MegasasCmd *megasas_enqueue_frame(MegasasState *s, - cmd->context &= (uint64_t)0xFFFFFFFF; - } - cmd->count = count; -+ cmd->dcmd_opcode = -1; - s->busy++; - - if (s->consumer_pa) { -@@ -1562,22 +1564,21 @@ static const struct dcmd_cmd_tbl_t { - - static int megasas_handle_dcmd(MegasasState *s, MegasasCmd *cmd) - { -- int opcode; - int retval = 0; - size_t len; - const struct dcmd_cmd_tbl_t *cmdptr = dcmd_cmd_tbl; - -- opcode = le32_to_cpu(cmd->frame->dcmd.opcode); -- trace_megasas_handle_dcmd(cmd->index, opcode); -+ cmd->dcmd_opcode = le32_to_cpu(cmd->frame->dcmd.opcode); -+ trace_megasas_handle_dcmd(cmd->index, cmd->dcmd_opcode); - if (megasas_map_dcmd(s, cmd) < 0) { - return MFI_STAT_MEMORY_NOT_AVAILABLE; - } -- while (cmdptr->opcode != -1 && cmdptr->opcode != opcode) { -+ while (cmdptr->opcode != -1 && cmdptr->opcode != cmd->dcmd_opcode) { - cmdptr++; - } - len = cmd->iov_size; - if (cmdptr->opcode == -1) { -- trace_megasas_dcmd_unhandled(cmd->index, opcode, len); -+ trace_megasas_dcmd_unhandled(cmd->index, cmd->dcmd_opcode, len); - retval = megasas_dcmd_dummy(s, cmd); - } else { - trace_megasas_dcmd_enter(cmd->index, cmdptr->desc, len); -@@ -1592,13 +1593,11 @@ static int megasas_handle_dcmd(MegasasState *s, MegasasCmd *cmd) - static int megasas_finish_internal_dcmd(MegasasCmd *cmd, - SCSIRequest *req) - { -- int opcode; - int retval = MFI_STAT_OK; - int lun = req->lun; - -- opcode = le32_to_cpu(cmd->frame->dcmd.opcode); -- trace_megasas_dcmd_internal_finish(cmd->index, opcode, lun); -- switch (opcode) { -+ trace_megasas_dcmd_internal_finish(cmd->index, cmd->dcmd_opcode, lun); -+ switch (cmd->dcmd_opcode) { - case MFI_DCMD_PD_GET_INFO: - retval = megasas_pd_get_info_submit(req->dev, lun, cmd); - break; -@@ -1606,7 +1605,7 @@ static int megasas_finish_internal_dcmd(MegasasCmd *cmd, - retval = megasas_ld_get_info_submit(req->dev, lun, cmd); - break; - default: -- trace_megasas_dcmd_internal_invalid(cmd->index, opcode); -+ trace_megasas_dcmd_internal_invalid(cmd->index, cmd->dcmd_opcode); - retval = MFI_STAT_INVALID_DCMD; - break; - } -@@ -1827,7 +1826,6 @@ static void megasas_xfer_complete(SCSIRequest *req, uint32_t len) - { - MegasasCmd *cmd = req->hba_private; - uint8_t *buf; -- uint32_t opcode; - - trace_megasas_io_complete(cmd->index, len); - -@@ -1837,8 +1835,7 @@ static void megasas_xfer_complete(SCSIRequest *req, uint32_t len) - } - - buf = scsi_req_get_buf(req); -- opcode = le32_to_cpu(cmd->frame->dcmd.opcode); -- if (opcode == MFI_DCMD_PD_GET_INFO && cmd->iov_buf) { -+ if (cmd->dcmd_opcode == MFI_DCMD_PD_GET_INFO && cmd->iov_buf) { - struct mfi_pd_info *info = cmd->iov_buf; - - if (info->inquiry_data[0] == 0x7f) { -@@ -1849,7 +1846,7 @@ static void megasas_xfer_complete(SCSIRequest *req, uint32_t len) - memcpy(info->vpd_page83, buf, len); - } - scsi_req_continue(req); -- } else if (opcode == MFI_DCMD_LD_GET_INFO) { -+ } else if (cmd->dcmd_opcode == MFI_DCMD_LD_GET_INFO) { - struct mfi_ld_info *info = cmd->iov_buf; - - if (cmd->iov_buf) { --- -2.13.0 - diff --git a/app-emulation/qemu/files/qemu-2.9.0-CVE-2017-9524-1.patch b/app-emulation/qemu/files/qemu-2.9.0-CVE-2017-9524-1.patch deleted file mode 100644 index 9d77193b1f6a..000000000000 --- a/app-emulation/qemu/files/qemu-2.9.0-CVE-2017-9524-1.patch +++ /dev/null @@ -1,80 +0,0 @@ -From df8ad9f128c15aa0a0ebc7b24e9a22c9775b67af Mon Sep 17 00:00:00 2001 -From: Eric Blake -Date: Fri, 26 May 2017 22:04:21 -0500 -Subject: [PATCH] nbd: Fully initialize client in case of failed negotiation - -If a non-NBD client connects to qemu-nbd, we would end up with -a SIGSEGV in nbd_client_put() because we were trying to -unregister the client's association to the export, even though -we skipped inserting the client into that list. Easy trigger -in two terminals: - -$ qemu-nbd -p 30001 --format=raw file -$ nmap 127.0.0.1 -p 30001 - -nmap claims that it thinks it connected to a pago-services1 -server (which probably means nmap could be updated to learn the -NBD protocol and give a more accurate diagnosis of the open -port - but that's not our problem), then terminates immediately, -so our call to nbd_negotiate() fails. The fix is to reorder -nbd_co_client_start() to ensure that all initialization occurs -before we ever try talking to a client in nbd_negotiate(), so -that the teardown sequence on negotiation failure doesn't fault -while dereferencing a half-initialized object. - -While debugging this, I also noticed that nbd_update_server_watch() -called by nbd_client_closed() was still adding a channel to accept -the next client, even when the state was no longer RUNNING. That -is fixed by making nbd_can_accept() pay attention to the current -state. - -Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1451614 - -Signed-off-by: Eric Blake -Message-Id: <20170527030421.28366-1-eblake@redhat.com> -Signed-off-by: Paolo Bonzini ---- - nbd/server.c | 8 +++----- - qemu-nbd.c | 2 +- - 2 files changed, 4 insertions(+), 6 deletions(-) - -diff --git a/nbd/server.c b/nbd/server.c -index ee59e5d234..49b55f6ede 100644 ---- a/nbd/server.c -+++ b/nbd/server.c -@@ -1358,16 +1358,14 @@ static coroutine_fn void nbd_co_client_start(void *opaque) - - if (exp) { - nbd_export_get(exp); -+ QTAILQ_INSERT_TAIL(&exp->clients, client, next); - } -+ qemu_co_mutex_init(&client->send_lock); -+ - if (nbd_negotiate(data)) { - client_close(client); - goto out; - } -- qemu_co_mutex_init(&client->send_lock); -- -- if (exp) { -- QTAILQ_INSERT_TAIL(&exp->clients, client, next); -- } - - nbd_client_receive_next_request(client); - -diff --git a/qemu-nbd.c b/qemu-nbd.c -index f60842fd86..651f85ecc1 100644 ---- a/qemu-nbd.c -+++ b/qemu-nbd.c -@@ -325,7 +325,7 @@ out: - - static int nbd_can_accept(void) - { -- return nb_fds < shared; -+ return state == RUNNING && nb_fds < shared; - } - - static void nbd_export_closed(NBDExport *exp) --- -2.13.0 - diff --git a/app-emulation/qemu/files/qemu-2.9.0-CVE-2017-9524-2.patch b/app-emulation/qemu/files/qemu-2.9.0-CVE-2017-9524-2.patch deleted file mode 100644 index e6934b379a26..000000000000 --- a/app-emulation/qemu/files/qemu-2.9.0-CVE-2017-9524-2.patch +++ /dev/null @@ -1,197 +0,0 @@ -From 0c9390d978cbf61e8f16c9f580fa96b305c43568 Mon Sep 17 00:00:00 2001 -From: Eric Blake -Date: Thu, 8 Jun 2017 17:26:17 -0500 -Subject: [PATCH] nbd: Fix regression on resiliency to port scan - -Back in qemu 2.5, qemu-nbd was immune to port probes (a transient -server would not quit, regardless of how many probe connections -came and went, until a connection actually negotiated). But we -broke that in commit ee7d7aa when removing the return value to -nbd_client_new(), although that patch also introduced a bug causing -an assertion failure on a client that fails negotiation. We then -made it worse during refactoring in commit 1a6245a (a segfault -before we could even assert); the (masked) assertion was cleaned -up in d3780c2 (still in 2.6), and just recently we finally fixed -the segfault ("nbd: Fully intialize client in case of failed -negotiation"). But that still means that ever since we added -TLS support to qemu-nbd, we have been vulnerable to an ill-timed -port-scan being able to cause a denial of service by taking down -qemu-nbd before a real client has a chance to connect. - -Since negotiation is now handled asynchronously via coroutines, -we no longer have a synchronous point of return by re-adding a -return value to nbd_client_new(). So this patch instead wires -things up to pass the negotiation status through the close_fn -callback function. - -Simple test across two terminals: -$ qemu-nbd -f raw -p 30001 file -$ nmap 127.0.0.1 -p 30001 && \ - qemu-io -c 'r 0 512' -f raw nbd://localhost:30001 - -Note that this patch does not change what constitutes successful -negotiation (thus, a client must enter transmission phase before -that client can be considered as a reason to terminate the server -when the connection ends). Perhaps we may want to tweak things -in a later patch to also treat a client that uses NBD_OPT_ABORT -as being a 'successful' negotiation (the client correctly talked -the NBD protocol, and informed us it was not going to use our -export after all), but that's a discussion for another day. - -Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1451614 - -Signed-off-by: Eric Blake -Message-Id: <20170608222617.20376-1-eblake@redhat.com> -Signed-off-by: Paolo Bonzini ---- - blockdev-nbd.c | 6 +++++- - include/block/nbd.h | 2 +- - nbd/server.c | 24 +++++++++++++++--------- - qemu-nbd.c | 4 ++-- - 4 files changed, 23 insertions(+), 13 deletions(-) - -diff --git a/blockdev-nbd.c b/blockdev-nbd.c -index dd0860f4a6..28f551a7b0 100644 ---- a/blockdev-nbd.c -+++ b/blockdev-nbd.c -@@ -27,6 +27,10 @@ typedef struct NBDServerData { - - static NBDServerData *nbd_server; - -+static void nbd_blockdev_client_closed(NBDClient *client, bool ignored) -+{ -+ nbd_client_put(client); -+} - - static gboolean nbd_accept(QIOChannel *ioc, GIOCondition condition, - gpointer opaque) -@@ -46,7 +50,7 @@ static gboolean nbd_accept(QIOChannel *ioc, GIOCondition condition, - qio_channel_set_name(QIO_CHANNEL(cioc), "nbd-server"); - nbd_client_new(NULL, cioc, - nbd_server->tlscreds, NULL, -- nbd_client_put); -+ nbd_blockdev_client_closed); - object_unref(OBJECT(cioc)); - return TRUE; - } -diff --git a/include/block/nbd.h b/include/block/nbd.h -index 416257abca..8fa5ce51f3 100644 ---- a/include/block/nbd.h -+++ b/include/block/nbd.h -@@ -162,7 +162,7 @@ void nbd_client_new(NBDExport *exp, - QIOChannelSocket *sioc, - QCryptoTLSCreds *tlscreds, - const char *tlsaclname, -- void (*close)(NBDClient *)); -+ void (*close_fn)(NBDClient *, bool)); - void nbd_client_get(NBDClient *client); - void nbd_client_put(NBDClient *client); - -diff --git a/nbd/server.c b/nbd/server.c -index 49b55f6ede..f2b1aa47ce 100644 ---- a/nbd/server.c -+++ b/nbd/server.c -@@ -81,7 +81,7 @@ static QTAILQ_HEAD(, NBDExport) exports = QTAILQ_HEAD_INITIALIZER(exports); - - struct NBDClient { - int refcount; -- void (*close)(NBDClient *client); -+ void (*close_fn)(NBDClient *client, bool negotiated); - - bool no_zeroes; - NBDExport *exp; -@@ -778,7 +778,7 @@ void nbd_client_put(NBDClient *client) - } - } - --static void client_close(NBDClient *client) -+static void client_close(NBDClient *client, bool negotiated) - { - if (client->closing) { - return; -@@ -793,8 +793,8 @@ static void client_close(NBDClient *client) - NULL); - - /* Also tell the client, so that they release their reference. */ -- if (client->close) { -- client->close(client); -+ if (client->close_fn) { -+ client->close_fn(client, negotiated); - } - } - -@@ -975,7 +975,7 @@ void nbd_export_close(NBDExport *exp) - - nbd_export_get(exp); - QTAILQ_FOREACH_SAFE(client, &exp->clients, next, next) { -- client_close(client); -+ client_close(client, true); - } - nbd_export_set_name(exp, NULL); - nbd_export_set_description(exp, NULL); -@@ -1337,7 +1337,7 @@ done: - - out: - nbd_request_put(req); -- client_close(client); -+ client_close(client, true); - nbd_client_put(client); - } - -@@ -1363,7 +1363,7 @@ static coroutine_fn void nbd_co_client_start(void *opaque) - qemu_co_mutex_init(&client->send_lock); - - if (nbd_negotiate(data)) { -- client_close(client); -+ client_close(client, false); - goto out; - } - -@@ -1373,11 +1373,17 @@ out: - g_free(data); - } - -+/* -+ * Create a new client listener on the given export @exp, using the -+ * given channel @sioc. Begin servicing it in a coroutine. When the -+ * connection closes, call @close_fn with an indication of whether the -+ * client completed negotiation. -+ */ - void nbd_client_new(NBDExport *exp, - QIOChannelSocket *sioc, - QCryptoTLSCreds *tlscreds, - const char *tlsaclname, -- void (*close_fn)(NBDClient *)) -+ void (*close_fn)(NBDClient *, bool)) - { - NBDClient *client; - NBDClientNewData *data = g_new(NBDClientNewData, 1); -@@ -1394,7 +1400,7 @@ void nbd_client_new(NBDExport *exp, - object_ref(OBJECT(client->sioc)); - client->ioc = QIO_CHANNEL(sioc); - object_ref(OBJECT(client->ioc)); -- client->close = close_fn; -+ client->close_fn = close_fn; - - data->client = client; - data->co = qemu_coroutine_create(nbd_co_client_start, data); -diff --git a/qemu-nbd.c b/qemu-nbd.c -index 651f85ecc1..9464a0461c 100644 ---- a/qemu-nbd.c -+++ b/qemu-nbd.c -@@ -336,10 +336,10 @@ static void nbd_export_closed(NBDExport *exp) - - static void nbd_update_server_watch(void); - --static void nbd_client_closed(NBDClient *client) -+static void nbd_client_closed(NBDClient *client, bool negotiated) - { - nb_fds--; -- if (nb_fds == 0 && !persistent && state == RUNNING) { -+ if (negotiated && nb_fds == 0 && !persistent && state == RUNNING) { - state = TERMINATE; - } - nbd_update_server_watch(); --- -2.13.0 - diff --git a/app-emulation/qemu/qemu-2.10.0-r1.ebuild b/app-emulation/qemu/qemu-2.10.0-r1.ebuild deleted file mode 100644 index 0c1e2e682316..000000000000 --- a/app-emulation/qemu/qemu-2.10.0-r1.ebuild +++ /dev/null @@ -1,795 +0,0 @@ -# Copyright 1999-2017 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -EAPI="6" - -PYTHON_COMPAT=( python2_7 ) -PYTHON_REQ_USE="ncurses,readline" - -PLOCALES="bg de_DE fr_FR hu it tr zh_CN" - -FIRMWARE_ABI_VERSION="2.9.0-r52" - -inherit eutils flag-o-matic linux-info toolchain-funcs multilib python-r1 \ - user udev fcaps readme.gentoo-r1 pax-utils l10n - -if [[ ${PV} = *9999* ]]; then - EGIT_REPO_URI="git://git.qemu.org/qemu.git" - inherit git-r3 - SRC_URI="" -else - SRC_URI="http://wiki.qemu-project.org/download/${P}.tar.bz2" - KEYWORDS="~amd64 ~arm64 ~ppc ~ppc64 ~x86 ~x86-fbsd" -fi - -DESCRIPTION="QEMU + Kernel-based Virtual Machine userland tools" -HOMEPAGE="http://www.qemu.org http://www.linux-kvm.org" - -LICENSE="GPL-2 LGPL-2 BSD-2" -SLOT="0" -IUSE="accessibility +aio alsa bluetooth bzip2 +caps +curl debug +fdt - glusterfs gnutls gtk gtk2 infiniband iscsi +jpeg kernel_linux - kernel_FreeBSD lzo ncurses nfs nls numa opengl +pin-upstream-blobs +png - pulseaudio python rbd sasl +seccomp sdl sdl2 selinux smartcard snappy - spice ssh static static-user systemtap tci test usb usbredir vde - +vhost-net virgl virtfs +vnc vte xattr xen xfs" - -COMMON_TARGETS="aarch64 alpha arm cris i386 m68k microblaze microblazeel - mips mips64 mips64el mipsel nios2 or1k ppc ppc64 s390x sh4 sh4eb sparc - sparc64 x86_64" -IUSE_SOFTMMU_TARGETS="${COMMON_TARGETS} - lm32 moxie ppcemb tricore unicore32 xtensa xtensaeb" -IUSE_USER_TARGETS="${COMMON_TARGETS} - armeb hppa mipsn32 mipsn32el ppc64abi32 ppc64le sparc32plus tilegx" - -use_softmmu_targets=$(printf ' qemu_softmmu_targets_%s' ${IUSE_SOFTMMU_TARGETS}) -use_user_targets=$(printf ' qemu_user_targets_%s' ${IUSE_USER_TARGETS}) -IUSE+=" ${use_softmmu_targets} ${use_user_targets}" - -# Allow no targets to be built so that people can get a tools-only build. -# Block USE flag configurations known to not work. -REQUIRED_USE="${PYTHON_REQUIRED_USE} - gtk2? ( gtk ) - qemu_softmmu_targets_arm? ( fdt ) - qemu_softmmu_targets_microblaze? ( fdt ) - qemu_softmmu_targets_mips64el? ( fdt ) - qemu_softmmu_targets_ppc? ( fdt ) - qemu_softmmu_targets_ppc64? ( fdt ) - sdl2? ( sdl ) - static? ( static-user !alsa !bluetooth !gtk !gtk2 !opengl !pulseaudio ) - virtfs? ( xattr ) - vte? ( gtk )" - -# Dependencies required for qemu tools (qemu-nbd, qemu-img, qemu-io, ...) -# and user/softmmu targets (qemu-*, qemu-system-*). -# -# Yep, you need both libcap and libcap-ng since virtfs only uses libcap. -# -# The attr lib isn't always linked in (although the USE flag is always -# respected). This is because qemu supports using the C library's API -# when available rather than always using the extranl library. -ALL_DEPEND=" - >=dev-libs/glib-2.0[static-libs(+)] - sys-libs/zlib[static-libs(+)] - python? ( ${PYTHON_DEPS} ) - systemtap? ( dev-util/systemtap ) - xattr? ( sys-apps/attr[static-libs(+)] )" - -# Dependencies required for qemu tools (qemu-nbd, qemu-img, qemu-io, ...) -# softmmu targets (qemu-system-*). -SOFTMMU_TOOLS_DEPEND=" - >=x11-libs/pixman-0.28.0[static-libs(+)] - accessibility? ( - app-accessibility/brltty[api] - app-accessibility/brltty[static-libs(+)] - ) - aio? ( dev-libs/libaio[static-libs(+)] ) - alsa? ( >=media-libs/alsa-lib-1.0.13 ) - bluetooth? ( net-wireless/bluez ) - bzip2? ( app-arch/bzip2[static-libs(+)] ) - caps? ( sys-libs/libcap-ng[static-libs(+)] ) - curl? ( >=net-misc/curl-7.15.4[static-libs(+)] ) - fdt? ( >=sys-apps/dtc-1.4.2[static-libs(+)] ) - glusterfs? ( >=sys-cluster/glusterfs-3.4.0[static-libs(+)] ) - gnutls? ( - dev-libs/nettle:=[static-libs(+)] - >=net-libs/gnutls-3.0:=[static-libs(+)] - ) - gtk? ( - gtk2? ( - x11-libs/gtk+:2 - vte? ( x11-libs/vte:0 ) - ) - !gtk2? ( - x11-libs/gtk+:3 - vte? ( x11-libs/vte:2.91 ) - ) - ) - infiniband? ( sys-fabric/librdmacm:=[static-libs(+)] ) - iscsi? ( net-libs/libiscsi ) - jpeg? ( virtual/jpeg:0=[static-libs(+)] ) - lzo? ( dev-libs/lzo:2[static-libs(+)] ) - ncurses? ( - sys-libs/ncurses:0=[unicode] - sys-libs/ncurses:0=[static-libs(+)] - ) - nfs? ( >=net-fs/libnfs-1.9.3[static-libs(+)] ) - numa? ( sys-process/numactl[static-libs(+)] ) - opengl? ( - virtual/opengl - media-libs/libepoxy[static-libs(+)] - media-libs/mesa[static-libs(+)] - media-libs/mesa[egl,gbm] - ) - png? ( media-libs/libpng:0=[static-libs(+)] ) - pulseaudio? ( media-sound/pulseaudio ) - rbd? ( sys-cluster/ceph[static-libs(+)] ) - sasl? ( dev-libs/cyrus-sasl[static-libs(+)] ) - sdl? ( - !sdl2? ( - media-libs/libsdl[X] - >=media-libs/libsdl-1.2.11[static-libs(+)] - ) - sdl2? ( - media-libs/libsdl2[X] - media-libs/libsdl2[static-libs(+)] - ) - ) - seccomp? ( >=sys-libs/libseccomp-2.1.0[static-libs(+)] ) - smartcard? ( >=app-emulation/libcacard-2.5.0[static-libs(+)] ) - snappy? ( app-arch/snappy:=[static-libs(+)] ) - spice? ( - >=app-emulation/spice-protocol-0.12.3 - >=app-emulation/spice-0.12.0[static-libs(+)] - ) - ssh? ( >=net-libs/libssh2-1.2.8[static-libs(+)] ) - usb? ( >=virtual/libusb-1-r2[static-libs(+)] ) - usbredir? ( >=sys-apps/usbredir-0.6[static-libs(+)] ) - vde? ( net-misc/vde[static-libs(+)] ) - virgl? ( media-libs/virglrenderer[static-libs(+)] ) - virtfs? ( sys-libs/libcap ) - xen? ( app-emulation/xen-tools:= ) - xfs? ( sys-fs/xfsprogs[static-libs(+)] )" - -X86_FIRMWARE_DEPEND=" - pin-upstream-blobs? ( - ~sys-firmware/edk2-ovmf-2017_pre20170505[binary] - ~sys-firmware/ipxe-1.0.0_p20160620 - ~sys-firmware/seabios-1.10.2[binary,seavgabios] - ~sys-firmware/sgabios-0.1_pre8 - ) - !pin-upstream-blobs? ( - sys-firmware/edk2-ovmf - sys-firmware/ipxe - >=sys-firmware/seabios-1.10.2[seavgabios] - sys-firmware/sgabios - )" -PPC64_FIRMWARE_DEPEND=" - pin-upstream-blobs? ( - ~sys-firmware/seabios-1.10.2[binary,seavgabios] - ) - !pin-upstream-blobs? ( - >=sys-firmware/seabios-1.10.2[seavgabios] - ) -" - -CDEPEND=" - !static? ( - ${ALL_DEPEND//\[static-libs(+)]} - ${SOFTMMU_TOOLS_DEPEND//\[static-libs(+)]} - ) - qemu_softmmu_targets_i386? ( ${X86_FIRMWARE_DEPEND} ) - qemu_softmmu_targets_x86_64? ( ${X86_FIRMWARE_DEPEND} ) - qemu_softmmu_targets_ppc64? ( ${PPC64_FIRMWARE_DEPEND} ) -" -DEPEND="${CDEPEND} - dev-lang/perl - =dev-lang/python-2* - sys-apps/texinfo - virtual/pkgconfig - kernel_linux? ( >=sys-kernel/linux-headers-2.6.35 ) - gtk? ( nls? ( sys-devel/gettext ) ) - static? ( - ${ALL_DEPEND} - ${SOFTMMU_TOOLS_DEPEND} - ) - static-user? ( ${ALL_DEPEND} ) - test? ( - dev-libs/glib[utils] - sys-devel/bc - )" -RDEPEND="${CDEPEND} - selinux? ( sec-policy/selinux-qemu )" - -PATCHES=( - "${FILESDIR}"/${PN}-2.5.0-cflags.patch - "${FILESDIR}"/${PN}-2.5.0-sysmacros.patch - "${FILESDIR}"/${PN}-2.10.0-CVE-2017-13711.patch # bug 629350 -) - -STRIP_MASK="/usr/share/qemu/palcode-clipper" - -QA_PREBUILT=" - usr/share/qemu/openbios-ppc - usr/share/qemu/openbios-sparc64 - usr/share/qemu/openbios-sparc32 - usr/share/qemu/palcode-clipper - usr/share/qemu/s390-ccw.img - usr/share/qemu/s390-netboot.img - usr/share/qemu/u-boot.e500" - -QA_WX_LOAD="usr/bin/qemu-i386 - usr/bin/qemu-x86_64 - usr/bin/qemu-alpha - usr/bin/qemu-arm - usr/bin/qemu-cris - usr/bin/qemu-m68k - usr/bin/qemu-microblaze - usr/bin/qemu-microblazeel - usr/bin/qemu-mips - usr/bin/qemu-mipsel - usr/bin/qemu-or1k - usr/bin/qemu-ppc - usr/bin/qemu-ppc64 - usr/bin/qemu-ppc64abi32 - usr/bin/qemu-sh4 - usr/bin/qemu-sh4eb - usr/bin/qemu-sparc - usr/bin/qemu-sparc64 - usr/bin/qemu-armeb - usr/bin/qemu-sparc32plus - usr/bin/qemu-s390x - usr/bin/qemu-unicore32" - -DOC_CONTENTS="If you don't have kvm compiled into the kernel, make sure you have the -kernel module loaded before running kvm. The easiest way to ensure that the -kernel module is loaded is to load it on boot. - For AMD CPUs the module is called 'kvm-amd'. - For Intel CPUs the module is called 'kvm-intel'. -Please review /etc/conf.d/modules for how to load these. - -Make sure your user is in the 'kvm' group. Just run - $ gpasswd -a kvm -then have re-login. - -For brand new installs, the default permissions on /dev/kvm might not let -you access it. You can tell udev to reset ownership/perms: - $ udevadm trigger -c add /dev/kvm - -If you want to register binfmt handlers for qemu user targets: -For openrc: - # rc-update add qemu-binfmt -For systemd: - # ln -s /usr/share/qemu/binfmt.d/qemu.conf /etc/binfmt.d/qemu.conf" - -pkg_pretend() { - if use kernel_linux && kernel_is lt 2 6 25; then - eerror "This version of KVM requres a host kernel of 2.6.25 or higher." - elif use kernel_linux; then - if ! linux_config_exists; then - eerror "Unable to check your kernel for KVM support" - else - CONFIG_CHECK="~KVM ~TUN ~BRIDGE" - ERROR_KVM="You must enable KVM in your kernel to continue" - ERROR_KVM_AMD="If you have an AMD CPU, you must enable KVM_AMD in" - ERROR_KVM_AMD+=" your kernel configuration." - ERROR_KVM_INTEL="If you have an Intel CPU, you must enable" - ERROR_KVM_INTEL+=" KVM_INTEL in your kernel configuration." - ERROR_TUN="You will need the Universal TUN/TAP driver compiled" - ERROR_TUN+=" into your kernel or loaded as a module to use the" - ERROR_TUN+=" virtual network device if using -net tap." - ERROR_BRIDGE="You will also need support for 802.1d" - ERROR_BRIDGE+=" Ethernet Bridging for some network configurations." - use vhost-net && CONFIG_CHECK+=" ~VHOST_NET" - ERROR_VHOST_NET="You must enable VHOST_NET to have vhost-net" - ERROR_VHOST_NET+=" support" - - if use amd64 || use x86 || use amd64-linux || use x86-linux; then - CONFIG_CHECK+=" ~KVM_AMD ~KVM_INTEL" - fi - - use python && CONFIG_CHECK+=" ~DEBUG_FS" - ERROR_DEBUG_FS="debugFS support required for kvm_stat" - - # Now do the actual checks setup above - check_extra_config - fi - fi - - if grep -qs '/usr/bin/qemu-kvm' "${EROOT}"/etc/libvirt/qemu/*.xml; then - eerror "The kvm/qemu-kvm wrappers no longer exist, but your libvirt" - eerror "instances are still pointing to it. Please update your" - eerror "configs in /etc/libvirt/qemu/ to use the -enable-kvm flag" - eerror "and the right system binary (e.g. qemu-system-x86_64)." - die "update your virt configs to not use qemu-kvm" - fi -} - -pkg_setup() { - enewgroup kvm 78 -} - -# Sanity check to make sure target lists are kept up-to-date. -check_targets() { - local var=$1 mak=$2 - local detected sorted - - pushd "${S}"/default-configs >/dev/null || die - - # Force C locale until glibc is updated. #564936 - detected=$(echo $(printf '%s\n' *-${mak}.mak | sed "s:-${mak}.mak::" | LC_COLLATE=C sort -u)) - sorted=$(echo $(printf '%s\n' ${!var} | LC_COLLATE=C sort -u)) - if [[ ${sorted} != "${detected}" ]] ; then - eerror "The ebuild needs to be kept in sync." - eerror "${var}: ${sorted}" - eerror "$(printf '%-*s' ${#var} configure): ${detected}" - die "sync ${var} to the list of targets" - fi - - popd >/dev/null -} - -handle_locales() { - # Make sure locale list is kept up-to-date. - local detected sorted - detected=$(echo $(cd po && printf '%s\n' *.po | grep -v messages.po | sed 's:.po$::' | sort -u)) - sorted=$(echo $(printf '%s\n' ${PLOCALES} | sort -u)) - if [[ ${sorted} != "${detected}" ]] ; then - eerror "The ebuild needs to be kept in sync." - eerror "PLOCALES: ${sorted}" - eerror " po/*.po: ${detected}" - die "sync PLOCALES" - fi - - # Deal with selective install of locales. - if use nls ; then - # Delete locales the user does not want. #577814 - rm_loc() { rm po/$1.po || die; } - l10n_for_each_disabled_locale_do rm_loc - else - # Cheap hack to disable gettext .mo generation. - rm -f po/*.po - fi -} - -src_prepare() { - check_targets IUSE_SOFTMMU_TARGETS softmmu - check_targets IUSE_USER_TARGETS linux-user - - # Alter target makefiles to accept CFLAGS set via flag-o - sed -i -r \ - -e 's/^(C|OP_C|HELPER_C)FLAGS=/\1FLAGS+=/' \ - Makefile Makefile.target || die - - default - - # Fix ld and objcopy being called directly - tc-export AR LD OBJCOPY - - # Verbose builds - MAKEOPTS+=" V=1" - - # Run after we've applied all patches. - handle_locales - - # Remove bundled copy of libfdt - rm -r dtc || die -} - -## -# configures qemu based on the build directory and the build type -# we are using. -# -qemu_src_configure() { - debug-print-function ${FUNCNAME} "$@" - - local buildtype=$1 - local builddir="${S}/${buildtype}-build" - - mkdir "${builddir}" - - local conf_opts=( - --prefix=/usr - --sysconfdir=/etc - --libdir=/usr/$(get_libdir) - --docdir=/usr/share/doc/${PF}/html - --disable-bsd-user - --disable-guest-agent - --disable-strip - --disable-werror - # We support gnutls/nettle for crypto operations. It is possible - # to use gcrypt when gnutls/nettle are disabled (but not when they - # are enabled), but it's not really worth the hassle. Disable it - # all the time to avoid automatically detecting it. #568856 - --disable-gcrypt - --python="${PYTHON}" - --cc="$(tc-getCC)" - --cxx="$(tc-getCXX)" - --host-cc="$(tc-getBUILD_CC)" - $(use_enable debug debug-info) - $(use_enable debug debug-tcg) - --enable-docs - $(use_enable tci tcg-interpreter) - $(use_enable xattr attr) - ) - - # Disable options not used by user targets. This simplifies building - # static user targets (USE=static-user) considerably. - conf_notuser() { - if [[ ${buildtype} == "user" ]] ; then - echo "--disable-${2:-$1}" - else - use_enable "$@" - fi - } - conf_opts+=( - $(conf_notuser accessibility brlapi) - $(conf_notuser aio linux-aio) - $(conf_notuser bzip2) - $(conf_notuser bluetooth bluez) - $(conf_notuser caps cap-ng) - $(conf_notuser curl) - $(conf_notuser fdt) - $(conf_notuser glusterfs) - $(conf_notuser gnutls) - $(conf_notuser gnutls nettle) - $(conf_notuser gtk) - $(conf_notuser infiniband rdma) - $(conf_notuser iscsi libiscsi) - $(conf_notuser jpeg vnc-jpeg) - $(conf_notuser kernel_linux kvm) - $(conf_notuser lzo) - $(conf_notuser ncurses curses) - $(conf_notuser nfs libnfs) - $(conf_notuser numa) - $(conf_notuser opengl) - $(conf_notuser png vnc-png) - $(conf_notuser rbd) - $(conf_notuser sasl vnc-sasl) - $(conf_notuser sdl) - $(conf_notuser seccomp) - $(conf_notuser smartcard) - $(conf_notuser snappy) - $(conf_notuser spice) - $(conf_notuser ssh libssh2) - $(conf_notuser usb libusb) - $(conf_notuser usbredir usb-redir) - $(conf_notuser vde) - $(conf_notuser vhost-net) - $(conf_notuser virgl virglrenderer) - $(conf_notuser virtfs) - $(conf_notuser vnc) - $(conf_notuser vte) - $(conf_notuser xen) - $(conf_notuser xen xen-pci-passthrough) - $(conf_notuser xfs xfsctl) - ) - - if [[ ! ${buildtype} == "user" ]] ; then - # audio options - local audio_opts="oss" - use alsa && audio_opts="alsa,${audio_opts}" - use sdl && audio_opts="sdl,${audio_opts}" - use pulseaudio && audio_opts="pa,${audio_opts}" - conf_opts+=( - --audio-drv-list="${audio_opts}" - ) - use gtk && conf_opts+=( --with-gtkabi=$(usex gtk2 2.0 3.0) ) - use sdl && conf_opts+=( --with-sdlabi=$(usex sdl2 2.0 1.2) ) - fi - - case ${buildtype} in - user) - conf_opts+=( - --enable-linux-user - --disable-system - --disable-blobs - --disable-tools - ) - local static_flag="static-user" - ;; - softmmu) - conf_opts+=( - --disable-linux-user - --enable-system - --disable-tools - --with-system-pixman - ) - local static_flag="static" - ;; - tools) - conf_opts+=( - --disable-linux-user - --disable-system - --disable-blobs - --enable-tools - ) - local static_flag="static" - ;; - esac - - local targets="${buildtype}_targets" - [[ -n ${targets} ]] && conf_opts+=( --target-list="${!targets}" ) - - # Add support for SystemTAP - use systemtap && conf_opts+=( --enable-trace-backend=dtrace ) - - # We always want to attempt to build with PIE support as it results - # in a more secure binary. But it doesn't work with static or if - # the current GCC doesn't have PIE support. - if use ${static_flag}; then - conf_opts+=( --static --disable-pie ) - else - tc-enables-pie && conf_opts+=( --enable-pie ) - fi - - echo "../configure ${conf_opts[*]}" - cd "${builddir}" - ../configure "${conf_opts[@]}" || die "configure failed" - - # FreeBSD's kernel does not support QEMU assigning/grabbing - # host USB devices yet - use kernel_FreeBSD && \ - sed -i -E -e "s|^(HOST_USB=)bsd|\1stub|" "${S}"/config-host.mak -} - -src_configure() { - local target - - python_setup - - softmmu_targets= softmmu_bins=() - user_targets= user_bins=() - - for target in ${IUSE_SOFTMMU_TARGETS} ; do - if use "qemu_softmmu_targets_${target}"; then - softmmu_targets+=",${target}-softmmu" - softmmu_bins+=( "qemu-system-${target}" ) - fi - done - - for target in ${IUSE_USER_TARGETS} ; do - if use "qemu_user_targets_${target}"; then - user_targets+=",${target}-linux-user" - user_bins+=( "qemu-${target}" ) - fi - done - - softmmu_targets=${softmmu_targets#,} - user_targets=${user_targets#,} - - [[ -n ${softmmu_targets} ]] && qemu_src_configure "softmmu" - [[ -n ${user_targets} ]] && qemu_src_configure "user" - qemu_src_configure "tools" -} - -src_compile() { - if [[ -n ${user_targets} ]]; then - cd "${S}/user-build" - default - fi - - if [[ -n ${softmmu_targets} ]]; then - cd "${S}/softmmu-build" - default - fi - - cd "${S}/tools-build" - default -} - -src_test() { - if [[ -n ${softmmu_targets} ]]; then - cd "${S}/softmmu-build" - pax-mark m */qemu-system-* #515550 - emake -j1 check - emake -j1 check-report.html - fi -} - -qemu_python_install() { - python_domodule "${S}/scripts/qmp/qmp.py" - - python_doscript "${S}/scripts/kvm/vmxcap" - python_doscript "${S}/scripts/qmp/qmp-shell" - python_doscript "${S}/scripts/qmp/qemu-ga-client" -} - -# Generate binfmt support files. -# - /etc/init.d/qemu-binfmt script which registers the user handlers (openrc) -# - /usr/share/qemu/binfmt.d/qemu.conf (for use with systemd-binfmt) -generate_initd() { - local out="${T}/qemu-binfmt" - local out_systemd="${T}/qemu.conf" - local d="${T}/binfmt.d" - - einfo "Generating qemu binfmt scripts and configuration files" - - # Generate the debian fragments first. - mkdir -p "${d}" - "${S}"/scripts/qemu-binfmt-conf.sh \ - --debian \ - --exportdir "${d}" \ - --qemu-path "${EPREFIX}/usr/bin" \ - || die - # Then turn the fragments into a shell script we can source. - sed -E -i \ - -e 's:^([^ ]+) (.*)$:\1="\2":' \ - "${d}"/* || die - - # Generate the init.d script by assembling the fragments from above. - local f qcpu package interpreter magic mask - cat "${FILESDIR}"/qemu-binfmt.initd.head >"${out}" || die - for f in "${d}"/qemu-* ; do - source "${f}" - - # Normalize the cpu logic like we do in the init.d for the native cpu. - qcpu=${package#qemu-} - case ${qcpu} in - arm*) qcpu="arm";; - mips*) qcpu="mips";; - ppc*) qcpu="ppc";; - s390*) qcpu="s390";; - sh*) qcpu="sh";; - sparc*) qcpu="sparc";; - esac - - cat <>"${out}" - if [ "\${cpu}" != "${qcpu}" -a -x "${interpreter}" ] ; then - echo ':${package}:M::${magic}:${mask}:${interpreter}:'"\${QEMU_BINFMT_FLAGS}" >/proc/sys/fs/binfmt_misc/register - fi -EOF - - echo ":${package}:M::${magic}:${mask}:${interpreter}:OC" >>"${out_systemd}" - - done - cat "${FILESDIR}"/qemu-binfmt.initd.tail >>"${out}" || die -} - -src_install() { - if [[ -n ${user_targets} ]]; then - cd "${S}/user-build" - emake DESTDIR="${ED}" install - - # Install binfmt handler init script for user targets. - generate_initd - doinitd "${T}/qemu-binfmt" - - # Install binfmt/qemu.conf. - insinto "/usr/share/qemu/binfmt.d" - doins "${T}/qemu.conf" - fi - - if [[ -n ${softmmu_targets} ]]; then - cd "${S}/softmmu-build" - emake DESTDIR="${ED}" install - - # This might not exist if the test failed. #512010 - [[ -e check-report.html ]] && dohtml check-report.html - - if use kernel_linux; then - udev_newrules "${FILESDIR}"/65-kvm.rules-r1 65-kvm.rules - fi - - if use python; then - python_foreach_impl qemu_python_install - fi - fi - - cd "${S}/tools-build" - emake DESTDIR="${ED}" install - - # Disable mprotect on the qemu binaries as they use JITs to be fast #459348 - pushd "${ED}"/usr/bin >/dev/null - pax-mark mr "${softmmu_bins[@]}" "${user_bins[@]}" # bug 575594 - popd >/dev/null - - # Install config file example for qemu-bridge-helper - insinto "/etc/qemu" - doins "${FILESDIR}/bridge.conf" - - cd "${S}" - dodoc Changelog MAINTAINERS docs/specs/pci-ids.txt - newdoc pc-bios/README README.pc-bios - - if [[ -n ${softmmu_targets} ]]; then - # Remove SeaBIOS since we're using the SeaBIOS packaged one - rm "${ED}/usr/share/qemu/bios.bin" - rm "${ED}/usr/share/qemu/bios-256k.bin" - if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then - dosym ../seabios/bios.bin /usr/share/qemu/bios.bin - dosym ../seabios/bios-256k.bin /usr/share/qemu/bios-256k.bin - fi - - # Remove vgabios since we're using the seavgabios packaged one - rm "${ED}/usr/share/qemu/vgabios.bin" - rm "${ED}/usr/share/qemu/vgabios-cirrus.bin" - rm "${ED}/usr/share/qemu/vgabios-qxl.bin" - rm "${ED}/usr/share/qemu/vgabios-stdvga.bin" - rm "${ED}/usr/share/qemu/vgabios-virtio.bin" - rm "${ED}/usr/share/qemu/vgabios-vmware.bin" - # PPC64 loads vgabios-stdvga - if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386 || use qemu_softmmu_targets_ppc64; then - dosym ../seavgabios/vgabios-isavga.bin /usr/share/qemu/vgabios.bin - dosym ../seavgabios/vgabios-cirrus.bin /usr/share/qemu/vgabios-cirrus.bin - dosym ../seavgabios/vgabios-qxl.bin /usr/share/qemu/vgabios-qxl.bin - dosym ../seavgabios/vgabios-stdvga.bin /usr/share/qemu/vgabios-stdvga.bin - dosym ../seavgabios/vgabios-virtio.bin /usr/share/qemu/vgabios-virtio.bin - dosym ../seavgabios/vgabios-vmware.bin /usr/share/qemu/vgabios-vmware.bin - fi - - # Remove sgabios since we're using the sgabios packaged one - rm "${ED}/usr/share/qemu/sgabios.bin" - if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then - dosym ../sgabios/sgabios.bin /usr/share/qemu/sgabios.bin - fi - - # Remove iPXE since we're using the iPXE packaged one - rm "${ED}"/usr/share/qemu/pxe-*.rom - if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then - dosym ../ipxe/8086100e.rom /usr/share/qemu/pxe-e1000.rom - dosym ../ipxe/80861209.rom /usr/share/qemu/pxe-eepro100.rom - dosym ../ipxe/10500940.rom /usr/share/qemu/pxe-ne2k_pci.rom - dosym ../ipxe/10222000.rom /usr/share/qemu/pxe-pcnet.rom - dosym ../ipxe/10ec8139.rom /usr/share/qemu/pxe-rtl8139.rom - dosym ../ipxe/1af41000.rom /usr/share/qemu/pxe-virtio.rom - fi - fi - - DISABLE_AUTOFORMATTING=true - readme.gentoo_create_doc -} - -firmware_abi_change() { - local pv - for pv in ${REPLACING_VERSIONS}; do - if ! version_is_at_least ${FIRMWARE_ABI_VERSION} ${pv}; then - return 0 - fi - done - return 1 -} - -pkg_postinst() { - if [[ -n ${softmmu_targets} ]] && use kernel_linux; then - udev_reload - fi - - fcaps cap_net_admin /usr/libexec/qemu-bridge-helper - - DISABLE_AUTOFORMATTING=true - readme.gentoo_print_elog - - if use pin-upstream-blobs && firmware_abi_change; then - ewarn "This version of qemu pins new versions of firmware blobs:" - ewarn " $(best_version sys-firmware/edk2-ovmf)" - ewarn " $(best_version sys-firmware/ipxe)" - ewarn " $(best_version sys-firmware/seabios)" - ewarn " $(best_version sys-firmware/sgabios)" - ewarn "This might break resume of hibernated guests (started with a different" - ewarn "firmware version) and live migration to/from qemu versions with different" - ewarn "firmware. Please (cold) restart all running guests. For functional" - ewarn "guest migration ensure that all" - ewarn "hosts run at least" - ewarn " app-emulation/qemu-${FIRMWARE_ABI_VERSION}." - fi -} - -pkg_info() { - echo "Using:" - echo " $(best_version app-emulation/spice-protocol)" - echo " $(best_version sys-firmware/edk2-ovmf)" - if has_version 'sys-firmware/edk2-ovmf[binary]'; then - echo " USE=binary" - else - echo " USE=''" - fi - echo " $(best_version sys-firmware/ipxe)" - echo " $(best_version sys-firmware/seabios)" - if has_version 'sys-firmware/seabios[binary]'; then - echo " USE=binary" - else - echo " USE=''" - fi - echo " $(best_version sys-firmware/sgabios)" -} diff --git a/app-emulation/qemu/qemu-2.10.0.ebuild b/app-emulation/qemu/qemu-2.10.0.ebuild deleted file mode 100644 index ad3e8e8235fd..000000000000 --- a/app-emulation/qemu/qemu-2.10.0.ebuild +++ /dev/null @@ -1,781 +0,0 @@ -# Copyright 1999-2017 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -EAPI="6" - -PYTHON_COMPAT=( python2_7 ) -PYTHON_REQ_USE="ncurses,readline" - -PLOCALES="bg de_DE fr_FR hu it tr zh_CN" - -FIRMWARE_ABI_VERSION="2.9.0-r52" - -inherit eutils flag-o-matic linux-info toolchain-funcs multilib python-r1 \ - user udev fcaps readme.gentoo-r1 pax-utils l10n - -if [[ ${PV} = *9999* ]]; then - EGIT_REPO_URI="git://git.qemu.org/qemu.git" - inherit git-r3 - SRC_URI="" -else - SRC_URI="http://wiki.qemu-project.org/download/${P}.tar.bz2" - KEYWORDS="amd64 ~arm64 ~ppc ~ppc64 x86 ~x86-fbsd" -fi - -DESCRIPTION="QEMU + Kernel-based Virtual Machine userland tools" -HOMEPAGE="http://www.qemu.org http://www.linux-kvm.org" - -LICENSE="GPL-2 LGPL-2 BSD-2" -SLOT="0" -IUSE="accessibility +aio alsa bluetooth bzip2 +caps +curl debug +fdt - glusterfs gnutls gtk gtk2 infiniband iscsi +jpeg kernel_linux - kernel_FreeBSD lzo ncurses nfs nls numa opengl +pin-upstream-blobs +png - pulseaudio python rbd sasl +seccomp sdl sdl2 selinux smartcard snappy - spice ssh static static-user systemtap tci test usb usbredir vde - +vhost-net virgl virtfs +vnc vte xattr xen xfs" - -COMMON_TARGETS="aarch64 alpha arm cris i386 m68k microblaze microblazeel - mips mips64 mips64el mipsel nios2 or1k ppc ppc64 s390x sh4 sh4eb sparc - sparc64 x86_64" -IUSE_SOFTMMU_TARGETS="${COMMON_TARGETS} - lm32 moxie ppcemb tricore unicore32 xtensa xtensaeb" -IUSE_USER_TARGETS="${COMMON_TARGETS} - armeb hppa mipsn32 mipsn32el ppc64abi32 ppc64le sparc32plus tilegx" - -use_softmmu_targets=$(printf ' qemu_softmmu_targets_%s' ${IUSE_SOFTMMU_TARGETS}) -use_user_targets=$(printf ' qemu_user_targets_%s' ${IUSE_USER_TARGETS}) -IUSE+=" ${use_softmmu_targets} ${use_user_targets}" - -# Allow no targets to be built so that people can get a tools-only build. -# Block USE flag configurations known to not work. -REQUIRED_USE="${PYTHON_REQUIRED_USE} - gtk2? ( gtk ) - qemu_softmmu_targets_arm? ( fdt ) - qemu_softmmu_targets_microblaze? ( fdt ) - qemu_softmmu_targets_mips64el? ( fdt ) - qemu_softmmu_targets_ppc? ( fdt ) - qemu_softmmu_targets_ppc64? ( fdt ) - sdl2? ( sdl ) - static? ( static-user !alsa !bluetooth !gtk !gtk2 !opengl !pulseaudio ) - virtfs? ( xattr ) - vte? ( gtk )" - -# Dependencies required for qemu tools (qemu-nbd, qemu-img, qemu-io, ...) -# and user/softmmu targets (qemu-*, qemu-system-*). -# -# Yep, you need both libcap and libcap-ng since virtfs only uses libcap. -# -# The attr lib isn't always linked in (although the USE flag is always -# respected). This is because qemu supports using the C library's API -# when available rather than always using the extranl library. -ALL_DEPEND=" - >=dev-libs/glib-2.0[static-libs(+)] - sys-libs/zlib[static-libs(+)] - python? ( ${PYTHON_DEPS} ) - systemtap? ( dev-util/systemtap ) - xattr? ( sys-apps/attr[static-libs(+)] )" - -# Dependencies required for qemu tools (qemu-nbd, qemu-img, qemu-io, ...) -# softmmu targets (qemu-system-*). -SOFTMMU_TOOLS_DEPEND=" - >=x11-libs/pixman-0.28.0[static-libs(+)] - accessibility? ( - app-accessibility/brltty[api] - app-accessibility/brltty[static-libs(+)] - ) - aio? ( dev-libs/libaio[static-libs(+)] ) - alsa? ( >=media-libs/alsa-lib-1.0.13 ) - bluetooth? ( net-wireless/bluez ) - bzip2? ( app-arch/bzip2[static-libs(+)] ) - caps? ( sys-libs/libcap-ng[static-libs(+)] ) - curl? ( >=net-misc/curl-7.15.4[static-libs(+)] ) - fdt? ( >=sys-apps/dtc-1.4.0[static-libs(+)] ) - glusterfs? ( >=sys-cluster/glusterfs-3.4.0[static-libs(+)] ) - gnutls? ( - dev-libs/nettle:=[static-libs(+)] - >=net-libs/gnutls-3.0:=[static-libs(+)] - ) - gtk? ( - gtk2? ( - x11-libs/gtk+:2 - vte? ( x11-libs/vte:0 ) - ) - !gtk2? ( - x11-libs/gtk+:3 - vte? ( x11-libs/vte:2.91 ) - ) - ) - infiniband? ( sys-fabric/librdmacm:=[static-libs(+)] ) - iscsi? ( net-libs/libiscsi ) - jpeg? ( virtual/jpeg:0=[static-libs(+)] ) - lzo? ( dev-libs/lzo:2[static-libs(+)] ) - ncurses? ( - sys-libs/ncurses:0=[unicode] - sys-libs/ncurses:0=[static-libs(+)] - ) - nfs? ( >=net-fs/libnfs-1.9.3[static-libs(+)] ) - numa? ( sys-process/numactl[static-libs(+)] ) - opengl? ( - virtual/opengl - media-libs/libepoxy[static-libs(+)] - media-libs/mesa[static-libs(+)] - media-libs/mesa[egl,gbm] - ) - png? ( media-libs/libpng:0=[static-libs(+)] ) - pulseaudio? ( media-sound/pulseaudio ) - rbd? ( sys-cluster/ceph[static-libs(+)] ) - sasl? ( dev-libs/cyrus-sasl[static-libs(+)] ) - sdl? ( - !sdl2? ( - media-libs/libsdl[X] - >=media-libs/libsdl-1.2.11[static-libs(+)] - ) - sdl2? ( - media-libs/libsdl2[X] - media-libs/libsdl2[static-libs(+)] - ) - ) - seccomp? ( >=sys-libs/libseccomp-2.1.0[static-libs(+)] ) - smartcard? ( >=app-emulation/libcacard-2.5.0[static-libs(+)] ) - snappy? ( app-arch/snappy:=[static-libs(+)] ) - spice? ( - >=app-emulation/spice-protocol-0.12.3 - >=app-emulation/spice-0.12.0[static-libs(+)] - ) - ssh? ( >=net-libs/libssh2-1.2.8[static-libs(+)] ) - usb? ( >=virtual/libusb-1-r2[static-libs(+)] ) - usbredir? ( >=sys-apps/usbredir-0.6[static-libs(+)] ) - vde? ( net-misc/vde[static-libs(+)] ) - virgl? ( media-libs/virglrenderer[static-libs(+)] ) - virtfs? ( sys-libs/libcap ) - xen? ( app-emulation/xen-tools:= ) - xfs? ( sys-fs/xfsprogs[static-libs(+)] )" - -X86_FIRMWARE_DEPEND=" - pin-upstream-blobs? ( - ~sys-firmware/edk2-ovmf-2017_pre20170505[binary] - ~sys-firmware/ipxe-1.0.0_p20160620 - ~sys-firmware/seabios-1.10.2[binary,seavgabios] - ~sys-firmware/sgabios-0.1_pre8 - ) - !pin-upstream-blobs? ( - sys-firmware/edk2-ovmf - sys-firmware/ipxe - >=sys-firmware/seabios-1.10.2[seavgabios] - sys-firmware/sgabios - )" - -CDEPEND=" - !static? ( - ${ALL_DEPEND//\[static-libs(+)]} - ${SOFTMMU_TOOLS_DEPEND//\[static-libs(+)]} - ) - qemu_softmmu_targets_i386? ( ${X86_FIRMWARE_DEPEND} ) - qemu_softmmu_targets_x86_64? ( ${X86_FIRMWARE_DEPEND} )" -DEPEND="${CDEPEND} - dev-lang/perl - =dev-lang/python-2* - sys-apps/texinfo - virtual/pkgconfig - kernel_linux? ( >=sys-kernel/linux-headers-2.6.35 ) - gtk? ( nls? ( sys-devel/gettext ) ) - static? ( - ${ALL_DEPEND} - ${SOFTMMU_TOOLS_DEPEND} - ) - static-user? ( ${ALL_DEPEND} ) - test? ( - dev-libs/glib[utils] - sys-devel/bc - )" -RDEPEND="${CDEPEND} - selinux? ( sec-policy/selinux-qemu )" - -PATCHES=( - "${FILESDIR}"/${PN}-2.5.0-cflags.patch - "${FILESDIR}"/${PN}-2.5.0-sysmacros.patch - "${FILESDIR}"/${PN}-2.10.0-CVE-2017-13711.patch # bug 629350 -) - -STRIP_MASK="/usr/share/qemu/palcode-clipper" - -QA_PREBUILT=" - usr/share/qemu/openbios-ppc - usr/share/qemu/openbios-sparc64 - usr/share/qemu/openbios-sparc32 - usr/share/qemu/palcode-clipper - usr/share/qemu/s390-ccw.img - usr/share/qemu/s390-netboot.img - usr/share/qemu/u-boot.e500" - -QA_WX_LOAD="usr/bin/qemu-i386 - usr/bin/qemu-x86_64 - usr/bin/qemu-alpha - usr/bin/qemu-arm - usr/bin/qemu-cris - usr/bin/qemu-m68k - usr/bin/qemu-microblaze - usr/bin/qemu-microblazeel - usr/bin/qemu-mips - usr/bin/qemu-mipsel - usr/bin/qemu-or1k - usr/bin/qemu-ppc - usr/bin/qemu-ppc64 - usr/bin/qemu-ppc64abi32 - usr/bin/qemu-sh4 - usr/bin/qemu-sh4eb - usr/bin/qemu-sparc - usr/bin/qemu-sparc64 - usr/bin/qemu-armeb - usr/bin/qemu-sparc32plus - usr/bin/qemu-s390x - usr/bin/qemu-unicore32" - -DOC_CONTENTS="If you don't have kvm compiled into the kernel, make sure you have the -kernel module loaded before running kvm. The easiest way to ensure that the -kernel module is loaded is to load it on boot. - For AMD CPUs the module is called 'kvm-amd'. - For Intel CPUs the module is called 'kvm-intel'. -Please review /etc/conf.d/modules for how to load these. - -Make sure your user is in the 'kvm' group. Just run - $ gpasswd -a kvm -then have re-login. - -For brand new installs, the default permissions on /dev/kvm might not let -you access it. You can tell udev to reset ownership/perms: - $ udevadm trigger -c add /dev/kvm - -If you want to register binfmt handlers for qemu user targets: -For openrc: - # rc-update add qemu-binfmt -For systemd: - # ln -s /usr/share/qemu/binfmt.d/qemu.conf /etc/binfmt.d/qemu.conf" - -pkg_pretend() { - if use kernel_linux && kernel_is lt 2 6 25; then - eerror "This version of KVM requres a host kernel of 2.6.25 or higher." - elif use kernel_linux; then - if ! linux_config_exists; then - eerror "Unable to check your kernel for KVM support" - else - CONFIG_CHECK="~KVM ~TUN ~BRIDGE" - ERROR_KVM="You must enable KVM in your kernel to continue" - ERROR_KVM_AMD="If you have an AMD CPU, you must enable KVM_AMD in" - ERROR_KVM_AMD+=" your kernel configuration." - ERROR_KVM_INTEL="If you have an Intel CPU, you must enable" - ERROR_KVM_INTEL+=" KVM_INTEL in your kernel configuration." - ERROR_TUN="You will need the Universal TUN/TAP driver compiled" - ERROR_TUN+=" into your kernel or loaded as a module to use the" - ERROR_TUN+=" virtual network device if using -net tap." - ERROR_BRIDGE="You will also need support for 802.1d" - ERROR_BRIDGE+=" Ethernet Bridging for some network configurations." - use vhost-net && CONFIG_CHECK+=" ~VHOST_NET" - ERROR_VHOST_NET="You must enable VHOST_NET to have vhost-net" - ERROR_VHOST_NET+=" support" - - if use amd64 || use x86 || use amd64-linux || use x86-linux; then - CONFIG_CHECK+=" ~KVM_AMD ~KVM_INTEL" - fi - - use python && CONFIG_CHECK+=" ~DEBUG_FS" - ERROR_DEBUG_FS="debugFS support required for kvm_stat" - - # Now do the actual checks setup above - check_extra_config - fi - fi - - if grep -qs '/usr/bin/qemu-kvm' "${EROOT}"/etc/libvirt/qemu/*.xml; then - eerror "The kvm/qemu-kvm wrappers no longer exist, but your libvirt" - eerror "instances are still pointing to it. Please update your" - eerror "configs in /etc/libvirt/qemu/ to use the -enable-kvm flag" - eerror "and the right system binary (e.g. qemu-system-x86_64)." - die "update your virt configs to not use qemu-kvm" - fi -} - -pkg_setup() { - enewgroup kvm 78 -} - -# Sanity check to make sure target lists are kept up-to-date. -check_targets() { - local var=$1 mak=$2 - local detected sorted - - pushd "${S}"/default-configs >/dev/null || die - - # Force C locale until glibc is updated. #564936 - detected=$(echo $(printf '%s\n' *-${mak}.mak | sed "s:-${mak}.mak::" | LC_COLLATE=C sort -u)) - sorted=$(echo $(printf '%s\n' ${!var} | LC_COLLATE=C sort -u)) - if [[ ${sorted} != "${detected}" ]] ; then - eerror "The ebuild needs to be kept in sync." - eerror "${var}: ${sorted}" - eerror "$(printf '%-*s' ${#var} configure): ${detected}" - die "sync ${var} to the list of targets" - fi - - popd >/dev/null -} - -handle_locales() { - # Make sure locale list is kept up-to-date. - local detected sorted - detected=$(echo $(cd po && printf '%s\n' *.po | grep -v messages.po | sed 's:.po$::' | sort -u)) - sorted=$(echo $(printf '%s\n' ${PLOCALES} | sort -u)) - if [[ ${sorted} != "${detected}" ]] ; then - eerror "The ebuild needs to be kept in sync." - eerror "PLOCALES: ${sorted}" - eerror " po/*.po: ${detected}" - die "sync PLOCALES" - fi - - # Deal with selective install of locales. - if use nls ; then - # Delete locales the user does not want. #577814 - rm_loc() { rm po/$1.po || die; } - l10n_for_each_disabled_locale_do rm_loc - else - # Cheap hack to disable gettext .mo generation. - rm -f po/*.po - fi -} - -src_prepare() { - check_targets IUSE_SOFTMMU_TARGETS softmmu - check_targets IUSE_USER_TARGETS linux-user - - # Alter target makefiles to accept CFLAGS set via flag-o - sed -i -r \ - -e 's/^(C|OP_C|HELPER_C)FLAGS=/\1FLAGS+=/' \ - Makefile Makefile.target || die - - default - - # Fix ld and objcopy being called directly - tc-export AR LD OBJCOPY - - # Verbose builds - MAKEOPTS+=" V=1" - - # Run after we've applied all patches. - handle_locales -} - -## -# configures qemu based on the build directory and the build type -# we are using. -# -qemu_src_configure() { - debug-print-function ${FUNCNAME} "$@" - - local buildtype=$1 - local builddir="${S}/${buildtype}-build" - - mkdir "${builddir}" - - local conf_opts=( - --prefix=/usr - --sysconfdir=/etc - --libdir=/usr/$(get_libdir) - --docdir=/usr/share/doc/${PF}/html - --disable-bsd-user - --disable-guest-agent - --disable-strip - --disable-werror - # We support gnutls/nettle for crypto operations. It is possible - # to use gcrypt when gnutls/nettle are disabled (but not when they - # are enabled), but it's not really worth the hassle. Disable it - # all the time to avoid automatically detecting it. #568856 - --disable-gcrypt - --python="${PYTHON}" - --cc="$(tc-getCC)" - --cxx="$(tc-getCXX)" - --host-cc="$(tc-getBUILD_CC)" - $(use_enable debug debug-info) - $(use_enable debug debug-tcg) - --enable-docs - $(use_enable tci tcg-interpreter) - $(use_enable xattr attr) - ) - - # Disable options not used by user targets. This simplifies building - # static user targets (USE=static-user) considerably. - conf_notuser() { - if [[ ${buildtype} == "user" ]] ; then - echo "--disable-${2:-$1}" - else - use_enable "$@" - fi - } - conf_opts+=( - $(conf_notuser accessibility brlapi) - $(conf_notuser aio linux-aio) - $(conf_notuser bzip2) - $(conf_notuser bluetooth bluez) - $(conf_notuser caps cap-ng) - $(conf_notuser curl) - $(conf_notuser fdt) - $(conf_notuser glusterfs) - $(conf_notuser gnutls) - $(conf_notuser gnutls nettle) - $(conf_notuser gtk) - $(conf_notuser infiniband rdma) - $(conf_notuser iscsi libiscsi) - $(conf_notuser jpeg vnc-jpeg) - $(conf_notuser kernel_linux kvm) - $(conf_notuser lzo) - $(conf_notuser ncurses curses) - $(conf_notuser nfs libnfs) - $(conf_notuser numa) - $(conf_notuser opengl) - $(conf_notuser png vnc-png) - $(conf_notuser rbd) - $(conf_notuser sasl vnc-sasl) - $(conf_notuser sdl) - $(conf_notuser seccomp) - $(conf_notuser smartcard) - $(conf_notuser snappy) - $(conf_notuser spice) - $(conf_notuser ssh libssh2) - $(conf_notuser usb libusb) - $(conf_notuser usbredir usb-redir) - $(conf_notuser vde) - $(conf_notuser vhost-net) - $(conf_notuser virgl virglrenderer) - $(conf_notuser virtfs) - $(conf_notuser vnc) - $(conf_notuser vte) - $(conf_notuser xen) - $(conf_notuser xen xen-pci-passthrough) - $(conf_notuser xfs xfsctl) - ) - - if [[ ! ${buildtype} == "user" ]] ; then - # audio options - local audio_opts="oss" - use alsa && audio_opts="alsa,${audio_opts}" - use sdl && audio_opts="sdl,${audio_opts}" - use pulseaudio && audio_opts="pa,${audio_opts}" - conf_opts+=( - --audio-drv-list="${audio_opts}" - ) - use gtk && conf_opts+=( --with-gtkabi=$(usex gtk2 2.0 3.0) ) - use sdl && conf_opts+=( --with-sdlabi=$(usex sdl2 2.0 1.2) ) - fi - - case ${buildtype} in - user) - conf_opts+=( - --enable-linux-user - --disable-system - --disable-blobs - --disable-tools - ) - local static_flag="static-user" - ;; - softmmu) - conf_opts+=( - --disable-linux-user - --enable-system - --disable-tools - --with-system-pixman - ) - local static_flag="static" - ;; - tools) - conf_opts+=( - --disable-linux-user - --disable-system - --disable-blobs - --enable-tools - ) - local static_flag="static" - ;; - esac - - local targets="${buildtype}_targets" - [[ -n ${targets} ]] && conf_opts+=( --target-list="${!targets}" ) - - # Add support for SystemTAP - use systemtap && conf_opts+=( --enable-trace-backend=dtrace ) - - # We always want to attempt to build with PIE support as it results - # in a more secure binary. But it doesn't work with static or if - # the current GCC doesn't have PIE support. - if use ${static_flag}; then - conf_opts+=( --static --disable-pie ) - else - tc-enables-pie && conf_opts+=( --enable-pie ) - fi - - echo "../configure ${conf_opts[*]}" - cd "${builddir}" - ../configure "${conf_opts[@]}" || die "configure failed" - - # FreeBSD's kernel does not support QEMU assigning/grabbing - # host USB devices yet - use kernel_FreeBSD && \ - sed -i -E -e "s|^(HOST_USB=)bsd|\1stub|" "${S}"/config-host.mak -} - -src_configure() { - local target - - python_setup - - softmmu_targets= softmmu_bins=() - user_targets= user_bins=() - - for target in ${IUSE_SOFTMMU_TARGETS} ; do - if use "qemu_softmmu_targets_${target}"; then - softmmu_targets+=",${target}-softmmu" - softmmu_bins+=( "qemu-system-${target}" ) - fi - done - - for target in ${IUSE_USER_TARGETS} ; do - if use "qemu_user_targets_${target}"; then - user_targets+=",${target}-linux-user" - user_bins+=( "qemu-${target}" ) - fi - done - - softmmu_targets=${softmmu_targets#,} - user_targets=${user_targets#,} - - [[ -n ${softmmu_targets} ]] && qemu_src_configure "softmmu" - [[ -n ${user_targets} ]] && qemu_src_configure "user" - qemu_src_configure "tools" -} - -src_compile() { - if [[ -n ${user_targets} ]]; then - cd "${S}/user-build" - default - fi - - if [[ -n ${softmmu_targets} ]]; then - cd "${S}/softmmu-build" - default - fi - - cd "${S}/tools-build" - default -} - -src_test() { - if [[ -n ${softmmu_targets} ]]; then - cd "${S}/softmmu-build" - pax-mark m */qemu-system-* #515550 - emake -j1 check - emake -j1 check-report.html - fi -} - -qemu_python_install() { - python_domodule "${S}/scripts/qmp/qmp.py" - - python_doscript "${S}/scripts/kvm/vmxcap" - python_doscript "${S}/scripts/qmp/qmp-shell" - python_doscript "${S}/scripts/qmp/qemu-ga-client" -} - -# Generate binfmt support files. -# - /etc/init.d/qemu-binfmt script which registers the user handlers (openrc) -# - /usr/share/qemu/binfmt.d/qemu.conf (for use with systemd-binfmt) -generate_initd() { - local out="${T}/qemu-binfmt" - local out_systemd="${T}/qemu.conf" - local d="${T}/binfmt.d" - - einfo "Generating qemu binfmt scripts and configuration files" - - # Generate the debian fragments first. - mkdir -p "${d}" - "${S}"/scripts/qemu-binfmt-conf.sh \ - --debian \ - --exportdir "${d}" \ - --qemu-path "${EPREFIX}/usr/bin" \ - || die - # Then turn the fragments into a shell script we can source. - sed -E -i \ - -e 's:^([^ ]+) (.*)$:\1="\2":' \ - "${d}"/* || die - - # Generate the init.d script by assembling the fragments from above. - local f qcpu package interpreter magic mask - cat "${FILESDIR}"/qemu-binfmt.initd.head >"${out}" || die - for f in "${d}"/qemu-* ; do - source "${f}" - - # Normalize the cpu logic like we do in the init.d for the native cpu. - qcpu=${package#qemu-} - case ${qcpu} in - arm*) qcpu="arm";; - mips*) qcpu="mips";; - ppc*) qcpu="ppc";; - s390*) qcpu="s390";; - sh*) qcpu="sh";; - sparc*) qcpu="sparc";; - esac - - cat <>"${out}" - if [ "\${cpu}" != "${qcpu}" -a -x "${interpreter}" ] ; then - echo ':${package}:M::${magic}:${mask}:${interpreter}:'"\${QEMU_BINFMT_FLAGS}" >/proc/sys/fs/binfmt_misc/register - fi -EOF - - echo ":${package}:M::${magic}:${mask}:${interpreter}:OC" >>"${out_systemd}" - - done - cat "${FILESDIR}"/qemu-binfmt.initd.tail >>"${out}" || die -} - -src_install() { - if [[ -n ${user_targets} ]]; then - cd "${S}/user-build" - emake DESTDIR="${ED}" install - - # Install binfmt handler init script for user targets. - generate_initd - doinitd "${T}/qemu-binfmt" - - # Install binfmt/qemu.conf. - insinto "/usr/share/qemu/binfmt.d" - doins "${T}/qemu.conf" - fi - - if [[ -n ${softmmu_targets} ]]; then - cd "${S}/softmmu-build" - emake DESTDIR="${ED}" install - - # This might not exist if the test failed. #512010 - [[ -e check-report.html ]] && dohtml check-report.html - - if use kernel_linux; then - udev_newrules "${FILESDIR}"/65-kvm.rules-r1 65-kvm.rules - fi - - if use python; then - python_foreach_impl qemu_python_install - fi - fi - - cd "${S}/tools-build" - emake DESTDIR="${ED}" install - - # Disable mprotect on the qemu binaries as they use JITs to be fast #459348 - pushd "${ED}"/usr/bin >/dev/null - pax-mark mr "${softmmu_bins[@]}" "${user_bins[@]}" # bug 575594 - popd >/dev/null - - # Install config file example for qemu-bridge-helper - insinto "/etc/qemu" - doins "${FILESDIR}/bridge.conf" - - cd "${S}" - dodoc Changelog MAINTAINERS docs/specs/pci-ids.txt - newdoc pc-bios/README README.pc-bios - - if [[ -n ${softmmu_targets} ]]; then - # Remove SeaBIOS since we're using the SeaBIOS packaged one - rm "${ED}/usr/share/qemu/bios.bin" - rm "${ED}/usr/share/qemu/bios-256k.bin" - if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then - dosym ../seabios/bios.bin /usr/share/qemu/bios.bin - dosym ../seabios/bios-256k.bin /usr/share/qemu/bios-256k.bin - fi - - # Remove vgabios since we're using the seavgabios packaged one - rm "${ED}/usr/share/qemu/vgabios.bin" - rm "${ED}/usr/share/qemu/vgabios-cirrus.bin" - rm "${ED}/usr/share/qemu/vgabios-qxl.bin" - rm "${ED}/usr/share/qemu/vgabios-stdvga.bin" - rm "${ED}/usr/share/qemu/vgabios-virtio.bin" - rm "${ED}/usr/share/qemu/vgabios-vmware.bin" - if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then - dosym ../seavgabios/vgabios-isavga.bin /usr/share/qemu/vgabios.bin - dosym ../seavgabios/vgabios-cirrus.bin /usr/share/qemu/vgabios-cirrus.bin - dosym ../seavgabios/vgabios-qxl.bin /usr/share/qemu/vgabios-qxl.bin - dosym ../seavgabios/vgabios-stdvga.bin /usr/share/qemu/vgabios-stdvga.bin - dosym ../seavgabios/vgabios-virtio.bin /usr/share/qemu/vgabios-virtio.bin - dosym ../seavgabios/vgabios-vmware.bin /usr/share/qemu/vgabios-vmware.bin - fi - - # Remove sgabios since we're using the sgabios packaged one - rm "${ED}/usr/share/qemu/sgabios.bin" - if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then - dosym ../sgabios/sgabios.bin /usr/share/qemu/sgabios.bin - fi - - # Remove iPXE since we're using the iPXE packaged one - rm "${ED}"/usr/share/qemu/pxe-*.rom - if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then - dosym ../ipxe/8086100e.rom /usr/share/qemu/pxe-e1000.rom - dosym ../ipxe/80861209.rom /usr/share/qemu/pxe-eepro100.rom - dosym ../ipxe/10500940.rom /usr/share/qemu/pxe-ne2k_pci.rom - dosym ../ipxe/10222000.rom /usr/share/qemu/pxe-pcnet.rom - dosym ../ipxe/10ec8139.rom /usr/share/qemu/pxe-rtl8139.rom - dosym ../ipxe/1af41000.rom /usr/share/qemu/pxe-virtio.rom - fi - fi - - DISABLE_AUTOFORMATTING=true - readme.gentoo_create_doc -} - -firmware_abi_change() { - local pv - for pv in ${REPLACING_VERSIONS}; do - if ! version_is_at_least ${FIRMWARE_ABI_VERSION} ${pv}; then - return 0 - fi - done - return 1 -} - -pkg_postinst() { - if [[ -n ${softmmu_targets} ]] && use kernel_linux; then - udev_reload - fi - - fcaps cap_net_admin /usr/libexec/qemu-bridge-helper - - DISABLE_AUTOFORMATTING=true - readme.gentoo_print_elog - - if use pin-upstream-blobs && firmware_abi_change; then - ewarn "This version of qemu pins new versions of firmware blobs:" - ewarn " $(best_version sys-firmware/edk2-ovmf)" - ewarn " $(best_version sys-firmware/ipxe)" - ewarn " $(best_version sys-firmware/seabios)" - ewarn " $(best_version sys-firmware/sgabios)" - ewarn "This might break resume of hibernated guests (started with a different" - ewarn "firmware version) and live migration to/from qemu versions with different" - ewarn "firmware. Please (cold) restart all running guests. For functional" - ewarn "guest migration ensure that all" - ewarn "hosts run at least" - ewarn " app-emulation/qemu-${FIRMWARE_ABI_VERSION}." - fi -} - -pkg_info() { - echo "Using:" - echo " $(best_version app-emulation/spice-protocol)" - echo " $(best_version sys-firmware/edk2-ovmf)" - if has_version 'sys-firmware/edk2-ovmf[binary]'; then - echo " USE=binary" - else - echo " USE=''" - fi - echo " $(best_version sys-firmware/ipxe)" - echo " $(best_version sys-firmware/seabios)" - if has_version 'sys-firmware/seabios[binary]'; then - echo " USE=binary" - else - echo " USE=''" - fi - echo " $(best_version sys-firmware/sgabios)" -} diff --git a/app-emulation/qemu/qemu-2.10.1.ebuild b/app-emulation/qemu/qemu-2.10.1.ebuild new file mode 100644 index 000000000000..944fecea9676 --- /dev/null +++ b/app-emulation/qemu/qemu-2.10.1.ebuild @@ -0,0 +1,796 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="6" + +PYTHON_COMPAT=( python2_7 ) +PYTHON_REQ_USE="ncurses,readline" + +PLOCALES="bg de_DE fr_FR hu it tr zh_CN" + +FIRMWARE_ABI_VERSION="2.9.0-r52" + +inherit eutils flag-o-matic linux-info toolchain-funcs multilib python-r1 \ + user udev fcaps readme.gentoo-r1 pax-utils l10n + +if [[ ${PV} = *9999* ]]; then + EGIT_REPO_URI="git://git.qemu.org/qemu.git" + inherit git-r3 + SRC_URI="" +else + SRC_URI="http://wiki.qemu-project.org/download/${P}.tar.bz2" + KEYWORDS="amd64 ~arm64 ~ppc ~ppc64 x86 ~x86-fbsd" +fi + +DESCRIPTION="QEMU + Kernel-based Virtual Machine userland tools" +HOMEPAGE="http://www.qemu.org http://www.linux-kvm.org" + +LICENSE="GPL-2 LGPL-2 BSD-2" +SLOT="0" +IUSE="accessibility +aio alsa bluetooth bzip2 +caps +curl debug +fdt + glusterfs gnutls gtk gtk2 infiniband iscsi +jpeg kernel_linux + kernel_FreeBSD lzo ncurses nfs nls numa opengl +pin-upstream-blobs +png + pulseaudio python rbd sasl +seccomp sdl sdl2 selinux smartcard snappy + spice ssh static static-user systemtap tci test usb usbredir vde + +vhost-net virgl virtfs +vnc vte xattr xen xfs" + +COMMON_TARGETS="aarch64 alpha arm cris i386 m68k microblaze microblazeel + mips mips64 mips64el mipsel nios2 or1k ppc ppc64 s390x sh4 sh4eb sparc + sparc64 x86_64" +IUSE_SOFTMMU_TARGETS="${COMMON_TARGETS} + lm32 moxie ppcemb tricore unicore32 xtensa xtensaeb" +IUSE_USER_TARGETS="${COMMON_TARGETS} + armeb hppa mipsn32 mipsn32el ppc64abi32 ppc64le sparc32plus tilegx" + +use_softmmu_targets=$(printf ' qemu_softmmu_targets_%s' ${IUSE_SOFTMMU_TARGETS}) +use_user_targets=$(printf ' qemu_user_targets_%s' ${IUSE_USER_TARGETS}) +IUSE+=" ${use_softmmu_targets} ${use_user_targets}" + +# Allow no targets to be built so that people can get a tools-only build. +# Block USE flag configurations known to not work. +REQUIRED_USE="${PYTHON_REQUIRED_USE} + gtk2? ( gtk ) + qemu_softmmu_targets_arm? ( fdt ) + qemu_softmmu_targets_microblaze? ( fdt ) + qemu_softmmu_targets_mips64el? ( fdt ) + qemu_softmmu_targets_ppc? ( fdt ) + qemu_softmmu_targets_ppc64? ( fdt ) + sdl2? ( sdl ) + static? ( static-user !alsa !bluetooth !gtk !gtk2 !opengl !pulseaudio ) + virtfs? ( xattr ) + vte? ( gtk )" + +# Dependencies required for qemu tools (qemu-nbd, qemu-img, qemu-io, ...) +# and user/softmmu targets (qemu-*, qemu-system-*). +# +# Yep, you need both libcap and libcap-ng since virtfs only uses libcap. +# +# The attr lib isn't always linked in (although the USE flag is always +# respected). This is because qemu supports using the C library's API +# when available rather than always using the extranl library. +ALL_DEPEND=" + >=dev-libs/glib-2.0[static-libs(+)] + sys-libs/zlib[static-libs(+)] + python? ( ${PYTHON_DEPS} ) + systemtap? ( dev-util/systemtap ) + xattr? ( sys-apps/attr[static-libs(+)] )" + +# Dependencies required for qemu tools (qemu-nbd, qemu-img, qemu-io, ...) +# softmmu targets (qemu-system-*). +SOFTMMU_TOOLS_DEPEND=" + >=x11-libs/pixman-0.28.0[static-libs(+)] + accessibility? ( + app-accessibility/brltty[api] + app-accessibility/brltty[static-libs(+)] + ) + aio? ( dev-libs/libaio[static-libs(+)] ) + alsa? ( >=media-libs/alsa-lib-1.0.13 ) + bluetooth? ( net-wireless/bluez ) + bzip2? ( app-arch/bzip2[static-libs(+)] ) + caps? ( sys-libs/libcap-ng[static-libs(+)] ) + curl? ( >=net-misc/curl-7.15.4[static-libs(+)] ) + fdt? ( >=sys-apps/dtc-1.4.2[static-libs(+)] ) + glusterfs? ( >=sys-cluster/glusterfs-3.4.0[static-libs(+)] ) + gnutls? ( + dev-libs/nettle:=[static-libs(+)] + >=net-libs/gnutls-3.0:=[static-libs(+)] + ) + gtk? ( + gtk2? ( + x11-libs/gtk+:2 + vte? ( x11-libs/vte:0 ) + ) + !gtk2? ( + x11-libs/gtk+:3 + vte? ( x11-libs/vte:2.91 ) + ) + ) + infiniband? ( sys-fabric/librdmacm:=[static-libs(+)] ) + iscsi? ( net-libs/libiscsi ) + jpeg? ( virtual/jpeg:0=[static-libs(+)] ) + lzo? ( dev-libs/lzo:2[static-libs(+)] ) + ncurses? ( + sys-libs/ncurses:0=[unicode] + sys-libs/ncurses:0=[static-libs(+)] + ) + nfs? ( >=net-fs/libnfs-1.9.3[static-libs(+)] ) + numa? ( sys-process/numactl[static-libs(+)] ) + opengl? ( + virtual/opengl + media-libs/libepoxy[static-libs(+)] + media-libs/mesa[static-libs(+)] + media-libs/mesa[egl,gbm] + ) + png? ( media-libs/libpng:0=[static-libs(+)] ) + pulseaudio? ( media-sound/pulseaudio ) + rbd? ( sys-cluster/ceph[static-libs(+)] ) + sasl? ( dev-libs/cyrus-sasl[static-libs(+)] ) + sdl? ( + !sdl2? ( + media-libs/libsdl[X] + >=media-libs/libsdl-1.2.11[static-libs(+)] + ) + sdl2? ( + media-libs/libsdl2[X] + media-libs/libsdl2[static-libs(+)] + ) + ) + seccomp? ( >=sys-libs/libseccomp-2.1.0[static-libs(+)] ) + smartcard? ( >=app-emulation/libcacard-2.5.0[static-libs(+)] ) + snappy? ( app-arch/snappy:=[static-libs(+)] ) + spice? ( + >=app-emulation/spice-protocol-0.12.3 + >=app-emulation/spice-0.12.0[static-libs(+)] + ) + ssh? ( >=net-libs/libssh2-1.2.8[static-libs(+)] ) + usb? ( >=virtual/libusb-1-r2[static-libs(+)] ) + usbredir? ( >=sys-apps/usbredir-0.6[static-libs(+)] ) + vde? ( net-misc/vde[static-libs(+)] ) + virgl? ( media-libs/virglrenderer[static-libs(+)] ) + virtfs? ( sys-libs/libcap ) + xen? ( app-emulation/xen-tools:= ) + xfs? ( sys-fs/xfsprogs[static-libs(+)] )" + +X86_FIRMWARE_DEPEND=" + pin-upstream-blobs? ( + ~sys-firmware/edk2-ovmf-2017_pre20170505[binary] + ~sys-firmware/ipxe-1.0.0_p20160620 + ~sys-firmware/seabios-1.10.2[binary,seavgabios] + ~sys-firmware/sgabios-0.1_pre8 + ) + !pin-upstream-blobs? ( + sys-firmware/edk2-ovmf + sys-firmware/ipxe + >=sys-firmware/seabios-1.10.2[seavgabios] + sys-firmware/sgabios + )" +PPC64_FIRMWARE_DEPEND=" + pin-upstream-blobs? ( + ~sys-firmware/seabios-1.10.2[binary,seavgabios] + ) + !pin-upstream-blobs? ( + >=sys-firmware/seabios-1.10.2[seavgabios] + ) +" + +CDEPEND=" + !static? ( + ${ALL_DEPEND//\[static-libs(+)]} + ${SOFTMMU_TOOLS_DEPEND//\[static-libs(+)]} + ) + qemu_softmmu_targets_i386? ( ${X86_FIRMWARE_DEPEND} ) + qemu_softmmu_targets_x86_64? ( ${X86_FIRMWARE_DEPEND} ) + qemu_softmmu_targets_ppc64? ( ${PPC64_FIRMWARE_DEPEND} ) +" +DEPEND="${CDEPEND} + dev-lang/perl + =dev-lang/python-2* + sys-apps/texinfo + virtual/pkgconfig + kernel_linux? ( >=sys-kernel/linux-headers-2.6.35 ) + gtk? ( nls? ( sys-devel/gettext ) ) + static? ( + ${ALL_DEPEND} + ${SOFTMMU_TOOLS_DEPEND} + ) + static-user? ( ${ALL_DEPEND} ) + test? ( + dev-libs/glib[utils] + sys-devel/bc + )" +RDEPEND="${CDEPEND} + selinux? ( sec-policy/selinux-qemu )" + +PATCHES=( + "${FILESDIR}"/${PN}-2.5.0-cflags.patch + "${FILESDIR}"/${PN}-2.5.0-sysmacros.patch + "${FILESDIR}"/${PN}-2.10.1-CVE-2017-15268.patch + "${FILESDIR}"/${PN}-2.10.1-CVE-2017-15289.patch +) + +STRIP_MASK="/usr/share/qemu/palcode-clipper" + +QA_PREBUILT=" + usr/share/qemu/openbios-ppc + usr/share/qemu/openbios-sparc64 + usr/share/qemu/openbios-sparc32 + usr/share/qemu/palcode-clipper + usr/share/qemu/s390-ccw.img + usr/share/qemu/s390-netboot.img + usr/share/qemu/u-boot.e500" + +QA_WX_LOAD="usr/bin/qemu-i386 + usr/bin/qemu-x86_64 + usr/bin/qemu-alpha + usr/bin/qemu-arm + usr/bin/qemu-cris + usr/bin/qemu-m68k + usr/bin/qemu-microblaze + usr/bin/qemu-microblazeel + usr/bin/qemu-mips + usr/bin/qemu-mipsel + usr/bin/qemu-or1k + usr/bin/qemu-ppc + usr/bin/qemu-ppc64 + usr/bin/qemu-ppc64abi32 + usr/bin/qemu-sh4 + usr/bin/qemu-sh4eb + usr/bin/qemu-sparc + usr/bin/qemu-sparc64 + usr/bin/qemu-armeb + usr/bin/qemu-sparc32plus + usr/bin/qemu-s390x + usr/bin/qemu-unicore32" + +DOC_CONTENTS="If you don't have kvm compiled into the kernel, make sure you have the +kernel module loaded before running kvm. The easiest way to ensure that the +kernel module is loaded is to load it on boot. + For AMD CPUs the module is called 'kvm-amd'. + For Intel CPUs the module is called 'kvm-intel'. +Please review /etc/conf.d/modules for how to load these. + +Make sure your user is in the 'kvm' group. Just run + $ gpasswd -a kvm +then have re-login. + +For brand new installs, the default permissions on /dev/kvm might not let +you access it. You can tell udev to reset ownership/perms: + $ udevadm trigger -c add /dev/kvm + +If you want to register binfmt handlers for qemu user targets: +For openrc: + # rc-update add qemu-binfmt +For systemd: + # ln -s /usr/share/qemu/binfmt.d/qemu.conf /etc/binfmt.d/qemu.conf" + +pkg_pretend() { + if use kernel_linux && kernel_is lt 2 6 25; then + eerror "This version of KVM requres a host kernel of 2.6.25 or higher." + elif use kernel_linux; then + if ! linux_config_exists; then + eerror "Unable to check your kernel for KVM support" + else + CONFIG_CHECK="~KVM ~TUN ~BRIDGE" + ERROR_KVM="You must enable KVM in your kernel to continue" + ERROR_KVM_AMD="If you have an AMD CPU, you must enable KVM_AMD in" + ERROR_KVM_AMD+=" your kernel configuration." + ERROR_KVM_INTEL="If you have an Intel CPU, you must enable" + ERROR_KVM_INTEL+=" KVM_INTEL in your kernel configuration." + ERROR_TUN="You will need the Universal TUN/TAP driver compiled" + ERROR_TUN+=" into your kernel or loaded as a module to use the" + ERROR_TUN+=" virtual network device if using -net tap." + ERROR_BRIDGE="You will also need support for 802.1d" + ERROR_BRIDGE+=" Ethernet Bridging for some network configurations." + use vhost-net && CONFIG_CHECK+=" ~VHOST_NET" + ERROR_VHOST_NET="You must enable VHOST_NET to have vhost-net" + ERROR_VHOST_NET+=" support" + + if use amd64 || use x86 || use amd64-linux || use x86-linux; then + CONFIG_CHECK+=" ~KVM_AMD ~KVM_INTEL" + fi + + use python && CONFIG_CHECK+=" ~DEBUG_FS" + ERROR_DEBUG_FS="debugFS support required for kvm_stat" + + # Now do the actual checks setup above + check_extra_config + fi + fi + + if grep -qs '/usr/bin/qemu-kvm' "${EROOT}"/etc/libvirt/qemu/*.xml; then + eerror "The kvm/qemu-kvm wrappers no longer exist, but your libvirt" + eerror "instances are still pointing to it. Please update your" + eerror "configs in /etc/libvirt/qemu/ to use the -enable-kvm flag" + eerror "and the right system binary (e.g. qemu-system-x86_64)." + die "update your virt configs to not use qemu-kvm" + fi +} + +pkg_setup() { + enewgroup kvm 78 +} + +# Sanity check to make sure target lists are kept up-to-date. +check_targets() { + local var=$1 mak=$2 + local detected sorted + + pushd "${S}"/default-configs >/dev/null || die + + # Force C locale until glibc is updated. #564936 + detected=$(echo $(printf '%s\n' *-${mak}.mak | sed "s:-${mak}.mak::" | LC_COLLATE=C sort -u)) + sorted=$(echo $(printf '%s\n' ${!var} | LC_COLLATE=C sort -u)) + if [[ ${sorted} != "${detected}" ]] ; then + eerror "The ebuild needs to be kept in sync." + eerror "${var}: ${sorted}" + eerror "$(printf '%-*s' ${#var} configure): ${detected}" + die "sync ${var} to the list of targets" + fi + + popd >/dev/null +} + +handle_locales() { + # Make sure locale list is kept up-to-date. + local detected sorted + detected=$(echo $(cd po && printf '%s\n' *.po | grep -v messages.po | sed 's:.po$::' | sort -u)) + sorted=$(echo $(printf '%s\n' ${PLOCALES} | sort -u)) + if [[ ${sorted} != "${detected}" ]] ; then + eerror "The ebuild needs to be kept in sync." + eerror "PLOCALES: ${sorted}" + eerror " po/*.po: ${detected}" + die "sync PLOCALES" + fi + + # Deal with selective install of locales. + if use nls ; then + # Delete locales the user does not want. #577814 + rm_loc() { rm po/$1.po || die; } + l10n_for_each_disabled_locale_do rm_loc + else + # Cheap hack to disable gettext .mo generation. + rm -f po/*.po + fi +} + +src_prepare() { + check_targets IUSE_SOFTMMU_TARGETS softmmu + check_targets IUSE_USER_TARGETS linux-user + + # Alter target makefiles to accept CFLAGS set via flag-o + sed -i -r \ + -e 's/^(C|OP_C|HELPER_C)FLAGS=/\1FLAGS+=/' \ + Makefile Makefile.target || die + + default + + # Fix ld and objcopy being called directly + tc-export AR LD OBJCOPY + + # Verbose builds + MAKEOPTS+=" V=1" + + # Run after we've applied all patches. + handle_locales + + # Remove bundled copy of libfdt + rm -r dtc || die +} + +## +# configures qemu based on the build directory and the build type +# we are using. +# +qemu_src_configure() { + debug-print-function ${FUNCNAME} "$@" + + local buildtype=$1 + local builddir="${S}/${buildtype}-build" + + mkdir "${builddir}" + + local conf_opts=( + --prefix=/usr + --sysconfdir=/etc + --libdir=/usr/$(get_libdir) + --docdir=/usr/share/doc/${PF}/html + --disable-bsd-user + --disable-guest-agent + --disable-strip + --disable-werror + # We support gnutls/nettle for crypto operations. It is possible + # to use gcrypt when gnutls/nettle are disabled (but not when they + # are enabled), but it's not really worth the hassle. Disable it + # all the time to avoid automatically detecting it. #568856 + --disable-gcrypt + --python="${PYTHON}" + --cc="$(tc-getCC)" + --cxx="$(tc-getCXX)" + --host-cc="$(tc-getBUILD_CC)" + $(use_enable debug debug-info) + $(use_enable debug debug-tcg) + --enable-docs + $(use_enable tci tcg-interpreter) + $(use_enable xattr attr) + ) + + # Disable options not used by user targets. This simplifies building + # static user targets (USE=static-user) considerably. + conf_notuser() { + if [[ ${buildtype} == "user" ]] ; then + echo "--disable-${2:-$1}" + else + use_enable "$@" + fi + } + conf_opts+=( + $(conf_notuser accessibility brlapi) + $(conf_notuser aio linux-aio) + $(conf_notuser bzip2) + $(conf_notuser bluetooth bluez) + $(conf_notuser caps cap-ng) + $(conf_notuser curl) + $(conf_notuser fdt) + $(conf_notuser glusterfs) + $(conf_notuser gnutls) + $(conf_notuser gnutls nettle) + $(conf_notuser gtk) + $(conf_notuser infiniband rdma) + $(conf_notuser iscsi libiscsi) + $(conf_notuser jpeg vnc-jpeg) + $(conf_notuser kernel_linux kvm) + $(conf_notuser lzo) + $(conf_notuser ncurses curses) + $(conf_notuser nfs libnfs) + $(conf_notuser numa) + $(conf_notuser opengl) + $(conf_notuser png vnc-png) + $(conf_notuser rbd) + $(conf_notuser sasl vnc-sasl) + $(conf_notuser sdl) + $(conf_notuser seccomp) + $(conf_notuser smartcard) + $(conf_notuser snappy) + $(conf_notuser spice) + $(conf_notuser ssh libssh2) + $(conf_notuser usb libusb) + $(conf_notuser usbredir usb-redir) + $(conf_notuser vde) + $(conf_notuser vhost-net) + $(conf_notuser virgl virglrenderer) + $(conf_notuser virtfs) + $(conf_notuser vnc) + $(conf_notuser vte) + $(conf_notuser xen) + $(conf_notuser xen xen-pci-passthrough) + $(conf_notuser xfs xfsctl) + ) + + if [[ ! ${buildtype} == "user" ]] ; then + # audio options + local audio_opts="oss" + use alsa && audio_opts="alsa,${audio_opts}" + use sdl && audio_opts="sdl,${audio_opts}" + use pulseaudio && audio_opts="pa,${audio_opts}" + conf_opts+=( + --audio-drv-list="${audio_opts}" + ) + use gtk && conf_opts+=( --with-gtkabi=$(usex gtk2 2.0 3.0) ) + use sdl && conf_opts+=( --with-sdlabi=$(usex sdl2 2.0 1.2) ) + fi + + case ${buildtype} in + user) + conf_opts+=( + --enable-linux-user + --disable-system + --disable-blobs + --disable-tools + ) + local static_flag="static-user" + ;; + softmmu) + conf_opts+=( + --disable-linux-user + --enable-system + --disable-tools + --with-system-pixman + ) + local static_flag="static" + ;; + tools) + conf_opts+=( + --disable-linux-user + --disable-system + --disable-blobs + --enable-tools + ) + local static_flag="static" + ;; + esac + + local targets="${buildtype}_targets" + [[ -n ${targets} ]] && conf_opts+=( --target-list="${!targets}" ) + + # Add support for SystemTAP + use systemtap && conf_opts+=( --enable-trace-backend=dtrace ) + + # We always want to attempt to build with PIE support as it results + # in a more secure binary. But it doesn't work with static or if + # the current GCC doesn't have PIE support. + if use ${static_flag}; then + conf_opts+=( --static --disable-pie ) + else + tc-enables-pie && conf_opts+=( --enable-pie ) + fi + + echo "../configure ${conf_opts[*]}" + cd "${builddir}" + ../configure "${conf_opts[@]}" || die "configure failed" + + # FreeBSD's kernel does not support QEMU assigning/grabbing + # host USB devices yet + use kernel_FreeBSD && \ + sed -i -E -e "s|^(HOST_USB=)bsd|\1stub|" "${S}"/config-host.mak +} + +src_configure() { + local target + + python_setup + + softmmu_targets= softmmu_bins=() + user_targets= user_bins=() + + for target in ${IUSE_SOFTMMU_TARGETS} ; do + if use "qemu_softmmu_targets_${target}"; then + softmmu_targets+=",${target}-softmmu" + softmmu_bins+=( "qemu-system-${target}" ) + fi + done + + for target in ${IUSE_USER_TARGETS} ; do + if use "qemu_user_targets_${target}"; then + user_targets+=",${target}-linux-user" + user_bins+=( "qemu-${target}" ) + fi + done + + softmmu_targets=${softmmu_targets#,} + user_targets=${user_targets#,} + + [[ -n ${softmmu_targets} ]] && qemu_src_configure "softmmu" + [[ -n ${user_targets} ]] && qemu_src_configure "user" + qemu_src_configure "tools" +} + +src_compile() { + if [[ -n ${user_targets} ]]; then + cd "${S}/user-build" + default + fi + + if [[ -n ${softmmu_targets} ]]; then + cd "${S}/softmmu-build" + default + fi + + cd "${S}/tools-build" + default +} + +src_test() { + if [[ -n ${softmmu_targets} ]]; then + cd "${S}/softmmu-build" + pax-mark m */qemu-system-* #515550 + emake -j1 check + emake -j1 check-report.html + fi +} + +qemu_python_install() { + python_domodule "${S}/scripts/qmp/qmp.py" + + python_doscript "${S}/scripts/kvm/vmxcap" + python_doscript "${S}/scripts/qmp/qmp-shell" + python_doscript "${S}/scripts/qmp/qemu-ga-client" +} + +# Generate binfmt support files. +# - /etc/init.d/qemu-binfmt script which registers the user handlers (openrc) +# - /usr/share/qemu/binfmt.d/qemu.conf (for use with systemd-binfmt) +generate_initd() { + local out="${T}/qemu-binfmt" + local out_systemd="${T}/qemu.conf" + local d="${T}/binfmt.d" + + einfo "Generating qemu binfmt scripts and configuration files" + + # Generate the debian fragments first. + mkdir -p "${d}" + "${S}"/scripts/qemu-binfmt-conf.sh \ + --debian \ + --exportdir "${d}" \ + --qemu-path "${EPREFIX}/usr/bin" \ + || die + # Then turn the fragments into a shell script we can source. + sed -E -i \ + -e 's:^([^ ]+) (.*)$:\1="\2":' \ + "${d}"/* || die + + # Generate the init.d script by assembling the fragments from above. + local f qcpu package interpreter magic mask + cat "${FILESDIR}"/qemu-binfmt.initd.head >"${out}" || die + for f in "${d}"/qemu-* ; do + source "${f}" + + # Normalize the cpu logic like we do in the init.d for the native cpu. + qcpu=${package#qemu-} + case ${qcpu} in + arm*) qcpu="arm";; + mips*) qcpu="mips";; + ppc*) qcpu="ppc";; + s390*) qcpu="s390";; + sh*) qcpu="sh";; + sparc*) qcpu="sparc";; + esac + + cat <>"${out}" + if [ "\${cpu}" != "${qcpu}" -a -x "${interpreter}" ] ; then + echo ':${package}:M::${magic}:${mask}:${interpreter}:'"\${QEMU_BINFMT_FLAGS}" >/proc/sys/fs/binfmt_misc/register + fi +EOF + + echo ":${package}:M::${magic}:${mask}:${interpreter}:OC" >>"${out_systemd}" + + done + cat "${FILESDIR}"/qemu-binfmt.initd.tail >>"${out}" || die +} + +src_install() { + if [[ -n ${user_targets} ]]; then + cd "${S}/user-build" + emake DESTDIR="${ED}" install + + # Install binfmt handler init script for user targets. + generate_initd + doinitd "${T}/qemu-binfmt" + + # Install binfmt/qemu.conf. + insinto "/usr/share/qemu/binfmt.d" + doins "${T}/qemu.conf" + fi + + if [[ -n ${softmmu_targets} ]]; then + cd "${S}/softmmu-build" + emake DESTDIR="${ED}" install + + # This might not exist if the test failed. #512010 + [[ -e check-report.html ]] && dohtml check-report.html + + if use kernel_linux; then + udev_newrules "${FILESDIR}"/65-kvm.rules-r1 65-kvm.rules + fi + + if use python; then + python_foreach_impl qemu_python_install + fi + fi + + cd "${S}/tools-build" + emake DESTDIR="${ED}" install + + # Disable mprotect on the qemu binaries as they use JITs to be fast #459348 + pushd "${ED}"/usr/bin >/dev/null + pax-mark mr "${softmmu_bins[@]}" "${user_bins[@]}" # bug 575594 + popd >/dev/null + + # Install config file example for qemu-bridge-helper + insinto "/etc/qemu" + doins "${FILESDIR}/bridge.conf" + + cd "${S}" + dodoc Changelog MAINTAINERS docs/specs/pci-ids.txt + newdoc pc-bios/README README.pc-bios + + if [[ -n ${softmmu_targets} ]]; then + # Remove SeaBIOS since we're using the SeaBIOS packaged one + rm "${ED}/usr/share/qemu/bios.bin" + rm "${ED}/usr/share/qemu/bios-256k.bin" + if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then + dosym ../seabios/bios.bin /usr/share/qemu/bios.bin + dosym ../seabios/bios-256k.bin /usr/share/qemu/bios-256k.bin + fi + + # Remove vgabios since we're using the seavgabios packaged one + rm "${ED}/usr/share/qemu/vgabios.bin" + rm "${ED}/usr/share/qemu/vgabios-cirrus.bin" + rm "${ED}/usr/share/qemu/vgabios-qxl.bin" + rm "${ED}/usr/share/qemu/vgabios-stdvga.bin" + rm "${ED}/usr/share/qemu/vgabios-virtio.bin" + rm "${ED}/usr/share/qemu/vgabios-vmware.bin" + # PPC64 loads vgabios-stdvga + if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386 || use qemu_softmmu_targets_ppc64; then + dosym ../seavgabios/vgabios-isavga.bin /usr/share/qemu/vgabios.bin + dosym ../seavgabios/vgabios-cirrus.bin /usr/share/qemu/vgabios-cirrus.bin + dosym ../seavgabios/vgabios-qxl.bin /usr/share/qemu/vgabios-qxl.bin + dosym ../seavgabios/vgabios-stdvga.bin /usr/share/qemu/vgabios-stdvga.bin + dosym ../seavgabios/vgabios-virtio.bin /usr/share/qemu/vgabios-virtio.bin + dosym ../seavgabios/vgabios-vmware.bin /usr/share/qemu/vgabios-vmware.bin + fi + + # Remove sgabios since we're using the sgabios packaged one + rm "${ED}/usr/share/qemu/sgabios.bin" + if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then + dosym ../sgabios/sgabios.bin /usr/share/qemu/sgabios.bin + fi + + # Remove iPXE since we're using the iPXE packaged one + rm "${ED}"/usr/share/qemu/pxe-*.rom + if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then + dosym ../ipxe/8086100e.rom /usr/share/qemu/pxe-e1000.rom + dosym ../ipxe/80861209.rom /usr/share/qemu/pxe-eepro100.rom + dosym ../ipxe/10500940.rom /usr/share/qemu/pxe-ne2k_pci.rom + dosym ../ipxe/10222000.rom /usr/share/qemu/pxe-pcnet.rom + dosym ../ipxe/10ec8139.rom /usr/share/qemu/pxe-rtl8139.rom + dosym ../ipxe/1af41000.rom /usr/share/qemu/pxe-virtio.rom + fi + fi + + DISABLE_AUTOFORMATTING=true + readme.gentoo_create_doc +} + +firmware_abi_change() { + local pv + for pv in ${REPLACING_VERSIONS}; do + if ! version_is_at_least ${FIRMWARE_ABI_VERSION} ${pv}; then + return 0 + fi + done + return 1 +} + +pkg_postinst() { + if [[ -n ${softmmu_targets} ]] && use kernel_linux; then + udev_reload + fi + + fcaps cap_net_admin /usr/libexec/qemu-bridge-helper + + DISABLE_AUTOFORMATTING=true + readme.gentoo_print_elog + + if use pin-upstream-blobs && firmware_abi_change; then + ewarn "This version of qemu pins new versions of firmware blobs:" + ewarn " $(best_version sys-firmware/edk2-ovmf)" + ewarn " $(best_version sys-firmware/ipxe)" + ewarn " $(best_version sys-firmware/seabios)" + ewarn " $(best_version sys-firmware/sgabios)" + ewarn "This might break resume of hibernated guests (started with a different" + ewarn "firmware version) and live migration to/from qemu versions with different" + ewarn "firmware. Please (cold) restart all running guests. For functional" + ewarn "guest migration ensure that all" + ewarn "hosts run at least" + ewarn " app-emulation/qemu-${FIRMWARE_ABI_VERSION}." + fi +} + +pkg_info() { + echo "Using:" + echo " $(best_version app-emulation/spice-protocol)" + echo " $(best_version sys-firmware/edk2-ovmf)" + if has_version 'sys-firmware/edk2-ovmf[binary]'; then + echo " USE=binary" + else + echo " USE=''" + fi + echo " $(best_version sys-firmware/ipxe)" + echo " $(best_version sys-firmware/seabios)" + if has_version 'sys-firmware/seabios[binary]'; then + echo " USE=binary" + else + echo " USE=''" + fi + echo " $(best_version sys-firmware/sgabios)" +} diff --git a/app-emulation/qemu/qemu-2.9.0-r56.ebuild b/app-emulation/qemu/qemu-2.9.0-r56.ebuild deleted file mode 100644 index f9ba26cbc93e..000000000000 --- a/app-emulation/qemu/qemu-2.9.0-r56.ebuild +++ /dev/null @@ -1,793 +0,0 @@ -# Copyright 1999-2017 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -EAPI="6" - -PYTHON_COMPAT=( python2_7 ) -PYTHON_REQ_USE="ncurses,readline" - -PLOCALES="bg de_DE fr_FR hu it tr zh_CN" - -FIRMWARE_ABI_VERSION="2.9.0-r52" - -inherit eutils flag-o-matic linux-info toolchain-funcs multilib python-r1 \ - user udev fcaps readme.gentoo-r1 pax-utils l10n - -if [[ ${PV} = *9999* ]]; then - EGIT_REPO_URI="git://git.qemu.org/qemu.git" - inherit git-r3 - SRC_URI="" -else - SRC_URI="http://wiki.qemu-project.org/download/${P}.tar.bz2" - KEYWORDS="amd64 ~arm64 ~ppc ~ppc64 x86 ~x86-fbsd" -fi - -DESCRIPTION="QEMU + Kernel-based Virtual Machine userland tools" -HOMEPAGE="http://www.qemu.org http://www.linux-kvm.org" - -LICENSE="GPL-2 LGPL-2 BSD-2" -SLOT="0" -IUSE="accessibility +aio alsa bluetooth bzip2 +caps +curl debug +fdt - glusterfs gnutls gtk gtk2 infiniband iscsi +jpeg kernel_linux - kernel_FreeBSD lzo ncurses nfs nls numa opengl +pin-upstream-blobs +png - pulseaudio python rbd sasl +seccomp sdl sdl2 selinux smartcard snappy - spice ssh static static-user systemtap tci test usb usbredir vde - +vhost-net virgl virtfs +vnc vte xattr xen xfs" - -COMMON_TARGETS="aarch64 alpha arm cris i386 m68k microblaze microblazeel - mips mips64 mips64el mipsel nios2 or1k ppc ppc64 s390x sh4 sh4eb sparc - sparc64 x86_64" -IUSE_SOFTMMU_TARGETS="${COMMON_TARGETS} - lm32 moxie ppcemb tricore unicore32 xtensa xtensaeb" -IUSE_USER_TARGETS="${COMMON_TARGETS} - armeb hppa mipsn32 mipsn32el ppc64abi32 ppc64le sparc32plus tilegx" - -use_softmmu_targets=$(printf ' qemu_softmmu_targets_%s' ${IUSE_SOFTMMU_TARGETS}) -use_user_targets=$(printf ' qemu_user_targets_%s' ${IUSE_USER_TARGETS}) -IUSE+=" ${use_softmmu_targets} ${use_user_targets}" - -# Allow no targets to be built so that people can get a tools-only build. -# Block USE flag configurations known to not work. -REQUIRED_USE="${PYTHON_REQUIRED_USE} - gtk2? ( gtk ) - qemu_softmmu_targets_arm? ( fdt ) - qemu_softmmu_targets_microblaze? ( fdt ) - qemu_softmmu_targets_mips64el? ( fdt ) - qemu_softmmu_targets_ppc? ( fdt ) - qemu_softmmu_targets_ppc64? ( fdt ) - sdl2? ( sdl ) - static? ( static-user !alsa !bluetooth !gtk !gtk2 !opengl !pulseaudio ) - virtfs? ( xattr ) - vte? ( gtk )" - -# Dependencies required for qemu tools (qemu-nbd, qemu-img, qemu-io, ...) -# and user/softmmu targets (qemu-*, qemu-system-*). -# -# Yep, you need both libcap and libcap-ng since virtfs only uses libcap. -# -# The attr lib isn't always linked in (although the USE flag is always -# respected). This is because qemu supports using the C library's API -# when available rather than always using the extranl library. -ALL_DEPEND=" - >=dev-libs/glib-2.0[static-libs(+)] - sys-libs/zlib[static-libs(+)] - python? ( ${PYTHON_DEPS} ) - systemtap? ( dev-util/systemtap ) - xattr? ( sys-apps/attr[static-libs(+)] )" - -# Dependencies required for qemu tools (qemu-nbd, qemu-img, qemu-io, ...) -# softmmu targets (qemu-system-*). -SOFTMMU_TOOLS_DEPEND=" - >=x11-libs/pixman-0.28.0[static-libs(+)] - accessibility? ( - app-accessibility/brltty[api] - app-accessibility/brltty[static-libs(+)] - ) - aio? ( dev-libs/libaio[static-libs(+)] ) - alsa? ( >=media-libs/alsa-lib-1.0.13 ) - bluetooth? ( net-wireless/bluez ) - bzip2? ( app-arch/bzip2[static-libs(+)] ) - caps? ( sys-libs/libcap-ng[static-libs(+)] ) - curl? ( >=net-misc/curl-7.15.4[static-libs(+)] ) - fdt? ( >=sys-apps/dtc-1.4.0[static-libs(+)] ) - glusterfs? ( >=sys-cluster/glusterfs-3.4.0[static-libs(+)] ) - gnutls? ( - dev-libs/nettle:=[static-libs(+)] - >=net-libs/gnutls-3.0:=[static-libs(+)] - ) - gtk? ( - gtk2? ( - x11-libs/gtk+:2 - vte? ( x11-libs/vte:0 ) - ) - !gtk2? ( - x11-libs/gtk+:3 - vte? ( x11-libs/vte:2.91 ) - ) - ) - infiniband? ( sys-fabric/librdmacm:=[static-libs(+)] ) - iscsi? ( net-libs/libiscsi ) - jpeg? ( virtual/jpeg:0=[static-libs(+)] ) - lzo? ( dev-libs/lzo:2[static-libs(+)] ) - ncurses? ( - sys-libs/ncurses:0=[unicode] - sys-libs/ncurses:0=[static-libs(+)] - ) - nfs? ( >=net-fs/libnfs-1.9.3[static-libs(+)] ) - numa? ( sys-process/numactl[static-libs(+)] ) - opengl? ( - virtual/opengl - media-libs/libepoxy[static-libs(+)] - media-libs/mesa[static-libs(+)] - media-libs/mesa[egl,gbm] - ) - png? ( media-libs/libpng:0=[static-libs(+)] ) - pulseaudio? ( media-sound/pulseaudio ) - rbd? ( sys-cluster/ceph[static-libs(+)] ) - sasl? ( dev-libs/cyrus-sasl[static-libs(+)] ) - sdl? ( - !sdl2? ( - media-libs/libsdl[X] - >=media-libs/libsdl-1.2.11[static-libs(+)] - ) - sdl2? ( - media-libs/libsdl2[X] - media-libs/libsdl2[static-libs(+)] - ) - ) - seccomp? ( >=sys-libs/libseccomp-2.1.0[static-libs(+)] ) - smartcard? ( >=app-emulation/libcacard-2.5.0[static-libs(+)] ) - snappy? ( app-arch/snappy:=[static-libs(+)] ) - spice? ( - >=app-emulation/spice-protocol-0.12.3 - >=app-emulation/spice-0.12.0[static-libs(+)] - ) - ssh? ( >=net-libs/libssh2-1.2.8[static-libs(+)] ) - usb? ( >=virtual/libusb-1-r2[static-libs(+)] ) - usbredir? ( >=sys-apps/usbredir-0.6[static-libs(+)] ) - vde? ( net-misc/vde[static-libs(+)] ) - virgl? ( media-libs/virglrenderer[static-libs(+)] ) - virtfs? ( sys-libs/libcap ) - xen? ( app-emulation/xen-tools:= ) - xfs? ( sys-fs/xfsprogs[static-libs(+)] )" - -X86_FIRMWARE_DEPEND=" - pin-upstream-blobs? ( - ~sys-firmware/edk2-ovmf-2017_pre20170505[binary] - ~sys-firmware/ipxe-1.0.0_p20160620 - ~sys-firmware/seabios-1.10.2[binary,seavgabios] - ~sys-firmware/sgabios-0.1_pre8 - ) - !pin-upstream-blobs? ( - sys-firmware/edk2-ovmf - sys-firmware/ipxe - >=sys-firmware/seabios-1.10.2[seavgabios] - sys-firmware/sgabios - )" - -CDEPEND=" - !static? ( - ${ALL_DEPEND//\[static-libs(+)]} - ${SOFTMMU_TOOLS_DEPEND//\[static-libs(+)]} - ) - qemu_softmmu_targets_i386? ( ${X86_FIRMWARE_DEPEND} ) - qemu_softmmu_targets_x86_64? ( ${X86_FIRMWARE_DEPEND} )" -DEPEND="${CDEPEND} - dev-lang/perl - =dev-lang/python-2* - sys-apps/texinfo - virtual/pkgconfig - kernel_linux? ( >=sys-kernel/linux-headers-2.6.35 ) - gtk? ( nls? ( sys-devel/gettext ) ) - static? ( - ${ALL_DEPEND} - ${SOFTMMU_TOOLS_DEPEND} - ) - static-user? ( ${ALL_DEPEND} ) - test? ( - dev-libs/glib[utils] - sys-devel/bc - )" -RDEPEND="${CDEPEND} - selinux? ( sec-policy/selinux-qemu )" - -PATCHES=( - "${FILESDIR}"/${PN}-2.5.0-cflags.patch - "${FILESDIR}"/${PN}-2.5.0-sysmacros.patch - "${FILESDIR}"/${PN}-2.9.0-CVE-2017-8309.patch # bug 616870 - "${FILESDIR}"/${PN}-2.9.0-CVE-2017-8379.patch # bug 616872 - "${FILESDIR}"/${PN}-2.9.0-CVE-2017-8380.patch # bug 616874 - "${FILESDIR}"/${PN}-2.9.0-CVE-2017-8112.patch # bug 616636 - "${FILESDIR}"/${PN}-2.9.0-CVE-2017-7493.patch # bug 618808 - "${FILESDIR}"/${PN}-2.9.0-CVE-2017-11434.patch # bug 625614 - "${FILESDIR}"/${PN}-2.9.0-CVE-2017-11334.patch # bug 621292 - "${FILESDIR}"/${PN}-2.9.0-CVE-2017-9524-1.patch # bug 621292 - "${FILESDIR}"/${PN}-2.9.0-CVE-2017-9524-2.patch - "${FILESDIR}"/${PN}-2.9.0-CVE-2017-9503-1.patch # bug 621184 - "${FILESDIR}"/${PN}-2.9.0-CVE-2017-9503-2.patch - "${FILESDIR}"/${PN}-2.9.0-CVE-2017-10664.patch # bug 623016 - "${FILESDIR}"/${PN}-2.9.0-CVE-2017-10806.patch # bug 624088 -) - -STRIP_MASK="/usr/share/qemu/palcode-clipper" - -QA_PREBUILT=" - usr/share/qemu/openbios-ppc - usr/share/qemu/openbios-sparc64 - usr/share/qemu/openbios-sparc32 - usr/share/qemu/palcode-clipper - usr/share/qemu/s390-ccw.img - usr/share/qemu/u-boot.e500" - -QA_WX_LOAD="usr/bin/qemu-i386 - usr/bin/qemu-x86_64 - usr/bin/qemu-alpha - usr/bin/qemu-arm - usr/bin/qemu-cris - usr/bin/qemu-m68k - usr/bin/qemu-microblaze - usr/bin/qemu-microblazeel - usr/bin/qemu-mips - usr/bin/qemu-mipsel - usr/bin/qemu-or1k - usr/bin/qemu-ppc - usr/bin/qemu-ppc64 - usr/bin/qemu-ppc64abi32 - usr/bin/qemu-sh4 - usr/bin/qemu-sh4eb - usr/bin/qemu-sparc - usr/bin/qemu-sparc64 - usr/bin/qemu-armeb - usr/bin/qemu-sparc32plus - usr/bin/qemu-s390x - usr/bin/qemu-unicore32" - -DOC_CONTENTS="If you don't have kvm compiled into the kernel, make sure you have the -kernel module loaded before running kvm. The easiest way to ensure that the -kernel module is loaded is to load it on boot. - For AMD CPUs the module is called 'kvm-amd'. - For Intel CPUs the module is called 'kvm-intel'. -Please review /etc/conf.d/modules for how to load these. - -Make sure your user is in the 'kvm' group. Just run - $ gpasswd -a kvm -then have re-login. - -For brand new installs, the default permissions on /dev/kvm might not let -you access it. You can tell udev to reset ownership/perms: - $ udevadm trigger -c add /dev/kvm - -If you want to register binfmt handlers for qemu user targets: -For openrc: - # rc-update add qemu-binfmt -For systemd: - # ln -s /usr/share/qemu/binfmt.d/qemu.conf /etc/binfmt.d/qemu.conf" - -pkg_pretend() { - if use kernel_linux && kernel_is lt 2 6 25; then - eerror "This version of KVM requres a host kernel of 2.6.25 or higher." - elif use kernel_linux; then - if ! linux_config_exists; then - eerror "Unable to check your kernel for KVM support" - else - CONFIG_CHECK="~KVM ~TUN ~BRIDGE" - ERROR_KVM="You must enable KVM in your kernel to continue" - ERROR_KVM_AMD="If you have an AMD CPU, you must enable KVM_AMD in" - ERROR_KVM_AMD+=" your kernel configuration." - ERROR_KVM_INTEL="If you have an Intel CPU, you must enable" - ERROR_KVM_INTEL+=" KVM_INTEL in your kernel configuration." - ERROR_TUN="You will need the Universal TUN/TAP driver compiled" - ERROR_TUN+=" into your kernel or loaded as a module to use the" - ERROR_TUN+=" virtual network device if using -net tap." - ERROR_BRIDGE="You will also need support for 802.1d" - ERROR_BRIDGE+=" Ethernet Bridging for some network configurations." - use vhost-net && CONFIG_CHECK+=" ~VHOST_NET" - ERROR_VHOST_NET="You must enable VHOST_NET to have vhost-net" - ERROR_VHOST_NET+=" support" - - if use amd64 || use x86 || use amd64-linux || use x86-linux; then - CONFIG_CHECK+=" ~KVM_AMD ~KVM_INTEL" - fi - - use python && CONFIG_CHECK+=" ~DEBUG_FS" - ERROR_DEBUG_FS="debugFS support required for kvm_stat" - - # Now do the actual checks setup above - check_extra_config - fi - fi - - if grep -qs '/usr/bin/qemu-kvm' "${EROOT}"/etc/libvirt/qemu/*.xml; then - eerror "The kvm/qemu-kvm wrappers no longer exist, but your libvirt" - eerror "instances are still pointing to it. Please update your" - eerror "configs in /etc/libvirt/qemu/ to use the -enable-kvm flag" - eerror "and the right system binary (e.g. qemu-system-x86_64)." - die "update your virt configs to not use qemu-kvm" - fi -} - -pkg_setup() { - enewgroup kvm 78 -} - -# Sanity check to make sure target lists are kept up-to-date. -check_targets() { - local var=$1 mak=$2 - local detected sorted - - pushd "${S}"/default-configs >/dev/null || die - - # Force C locale until glibc is updated. #564936 - detected=$(echo $(printf '%s\n' *-${mak}.mak | sed "s:-${mak}.mak::" | LC_COLLATE=C sort -u)) - sorted=$(echo $(printf '%s\n' ${!var} | LC_COLLATE=C sort -u)) - if [[ ${sorted} != "${detected}" ]] ; then - eerror "The ebuild needs to be kept in sync." - eerror "${var}: ${sorted}" - eerror "$(printf '%-*s' ${#var} configure): ${detected}" - die "sync ${var} to the list of targets" - fi - - popd >/dev/null -} - -handle_locales() { - # Make sure locale list is kept up-to-date. - local detected sorted - detected=$(echo $(cd po && printf '%s\n' *.po | grep -v messages.po | sed 's:.po$::' | sort -u)) - sorted=$(echo $(printf '%s\n' ${PLOCALES} | sort -u)) - if [[ ${sorted} != "${detected}" ]] ; then - eerror "The ebuild needs to be kept in sync." - eerror "PLOCALES: ${sorted}" - eerror " po/*.po: ${detected}" - die "sync PLOCALES" - fi - - # Deal with selective install of locales. - if use nls ; then - # Delete locales the user does not want. #577814 - rm_loc() { rm po/$1.po || die; } - l10n_for_each_disabled_locale_do rm_loc - else - # Cheap hack to disable gettext .mo generation. - rm -f po/*.po - fi -} - -src_prepare() { - check_targets IUSE_SOFTMMU_TARGETS softmmu - check_targets IUSE_USER_TARGETS linux-user - - # Alter target makefiles to accept CFLAGS set via flag-o - sed -i -r \ - -e 's/^(C|OP_C|HELPER_C)FLAGS=/\1FLAGS+=/' \ - Makefile Makefile.target || die - - default - - # Fix ld and objcopy being called directly - tc-export AR LD OBJCOPY - - # Verbose builds - MAKEOPTS+=" V=1" - - # Run after we've applied all patches. - handle_locales -} - -## -# configures qemu based on the build directory and the build type -# we are using. -# -qemu_src_configure() { - debug-print-function ${FUNCNAME} "$@" - - local buildtype=$1 - local builddir="${S}/${buildtype}-build" - - mkdir "${builddir}" - - local conf_opts=( - --prefix=/usr - --sysconfdir=/etc - --libdir=/usr/$(get_libdir) - --docdir=/usr/share/doc/${PF}/html - --disable-bsd-user - --disable-guest-agent - --disable-strip - --disable-werror - # We support gnutls/nettle for crypto operations. It is possible - # to use gcrypt when gnutls/nettle are disabled (but not when they - # are enabled), but it's not really worth the hassle. Disable it - # all the time to avoid automatically detecting it. #568856 - --disable-gcrypt - --python="${PYTHON}" - --cc="$(tc-getCC)" - --cxx="$(tc-getCXX)" - --host-cc="$(tc-getBUILD_CC)" - $(use_enable debug debug-info) - $(use_enable debug debug-tcg) - --enable-docs - $(use_enable tci tcg-interpreter) - $(use_enable xattr attr) - ) - - # Disable options not used by user targets. This simplifies building - # static user targets (USE=static-user) considerably. - conf_notuser() { - if [[ ${buildtype} == "user" ]] ; then - echo "--disable-${2:-$1}" - else - use_enable "$@" - fi - } - conf_opts+=( - $(conf_notuser accessibility brlapi) - $(conf_notuser aio linux-aio) - $(conf_notuser bzip2) - $(conf_notuser bluetooth bluez) - $(conf_notuser caps cap-ng) - $(conf_notuser curl) - $(conf_notuser fdt) - $(conf_notuser glusterfs) - $(conf_notuser gnutls) - $(conf_notuser gnutls nettle) - $(conf_notuser gtk) - $(conf_notuser infiniband rdma) - $(conf_notuser iscsi libiscsi) - $(conf_notuser jpeg vnc-jpeg) - $(conf_notuser kernel_linux kvm) - $(conf_notuser lzo) - $(conf_notuser ncurses curses) - $(conf_notuser nfs libnfs) - $(conf_notuser numa) - $(conf_notuser opengl) - $(conf_notuser png vnc-png) - $(conf_notuser rbd) - $(conf_notuser sasl vnc-sasl) - $(conf_notuser sdl) - $(conf_notuser seccomp) - $(conf_notuser smartcard) - $(conf_notuser snappy) - $(conf_notuser spice) - $(conf_notuser ssh libssh2) - $(conf_notuser usb libusb) - $(conf_notuser usbredir usb-redir) - $(conf_notuser vde) - $(conf_notuser vhost-net) - $(conf_notuser virgl virglrenderer) - $(conf_notuser virtfs) - $(conf_notuser vnc) - $(conf_notuser vte) - $(conf_notuser xen) - $(conf_notuser xen xen-pci-passthrough) - $(conf_notuser xfs xfsctl) - ) - - if [[ ! ${buildtype} == "user" ]] ; then - # audio options - local audio_opts="oss" - use alsa && audio_opts="alsa,${audio_opts}" - use sdl && audio_opts="sdl,${audio_opts}" - use pulseaudio && audio_opts="pa,${audio_opts}" - conf_opts+=( - --audio-drv-list="${audio_opts}" - ) - use gtk && conf_opts+=( --with-gtkabi=$(usex gtk2 2.0 3.0) ) - use sdl && conf_opts+=( --with-sdlabi=$(usex sdl2 2.0 1.2) ) - fi - - case ${buildtype} in - user) - conf_opts+=( - --enable-linux-user - --disable-system - --disable-blobs - --disable-tools - ) - local static_flag="static-user" - ;; - softmmu) - conf_opts+=( - --disable-linux-user - --enable-system - --disable-tools - --with-system-pixman - ) - local static_flag="static" - ;; - tools) - conf_opts+=( - --disable-linux-user - --disable-system - --disable-blobs - --enable-tools - ) - local static_flag="static" - ;; - esac - - local targets="${buildtype}_targets" - [[ -n ${targets} ]] && conf_opts+=( --target-list="${!targets}" ) - - # Add support for SystemTAP - use systemtap && conf_opts+=( --enable-trace-backend=dtrace ) - - # We always want to attempt to build with PIE support as it results - # in a more secure binary. But it doesn't work with static or if - # the current GCC doesn't have PIE support. - if use ${static_flag}; then - conf_opts+=( --static --disable-pie ) - else - tc-enables-pie && conf_opts+=( --enable-pie ) - fi - - echo "../configure ${conf_opts[*]}" - cd "${builddir}" - ../configure "${conf_opts[@]}" || die "configure failed" - - # FreeBSD's kernel does not support QEMU assigning/grabbing - # host USB devices yet - use kernel_FreeBSD && \ - sed -i -E -e "s|^(HOST_USB=)bsd|\1stub|" "${S}"/config-host.mak -} - -src_configure() { - local target - - python_setup - - softmmu_targets= softmmu_bins=() - user_targets= user_bins=() - - for target in ${IUSE_SOFTMMU_TARGETS} ; do - if use "qemu_softmmu_targets_${target}"; then - softmmu_targets+=",${target}-softmmu" - softmmu_bins+=( "qemu-system-${target}" ) - fi - done - - for target in ${IUSE_USER_TARGETS} ; do - if use "qemu_user_targets_${target}"; then - user_targets+=",${target}-linux-user" - user_bins+=( "qemu-${target}" ) - fi - done - - softmmu_targets=${softmmu_targets#,} - user_targets=${user_targets#,} - - [[ -n ${softmmu_targets} ]] && qemu_src_configure "softmmu" - [[ -n ${user_targets} ]] && qemu_src_configure "user" - qemu_src_configure "tools" -} - -src_compile() { - if [[ -n ${user_targets} ]]; then - cd "${S}/user-build" - default - fi - - if [[ -n ${softmmu_targets} ]]; then - cd "${S}/softmmu-build" - default - fi - - cd "${S}/tools-build" - default -} - -src_test() { - if [[ -n ${softmmu_targets} ]]; then - cd "${S}/softmmu-build" - pax-mark m */qemu-system-* #515550 - emake -j1 check - emake -j1 check-report.html - fi -} - -qemu_python_install() { - python_domodule "${S}/scripts/qmp/qmp.py" - - python_doscript "${S}/scripts/kvm/vmxcap" - python_doscript "${S}/scripts/qmp/qmp-shell" - python_doscript "${S}/scripts/qmp/qemu-ga-client" -} - -# Generate binfmt support files. -# - /etc/init.d/qemu-binfmt script which registers the user handlers (openrc) -# - /usr/share/qemu/binfmt.d/qemu.conf (for use with systemd-binfmt) -generate_initd() { - local out="${T}/qemu-binfmt" - local out_systemd="${T}/qemu.conf" - local d="${T}/binfmt.d" - - einfo "Generating qemu binfmt scripts and configuration files" - - # Generate the debian fragments first. - mkdir -p "${d}" - "${S}"/scripts/qemu-binfmt-conf.sh \ - --debian \ - --exportdir "${d}" \ - --qemu-path "${EPREFIX}/usr/bin" \ - || die - # Then turn the fragments into a shell script we can source. - sed -E -i \ - -e 's:^([^ ]+) (.*)$:\1="\2":' \ - "${d}"/* || die - - # Generate the init.d script by assembling the fragments from above. - local f qcpu package interpreter magic mask - cat "${FILESDIR}"/qemu-binfmt.initd.head >"${out}" || die - for f in "${d}"/qemu-* ; do - source "${f}" - - # Normalize the cpu logic like we do in the init.d for the native cpu. - qcpu=${package#qemu-} - case ${qcpu} in - arm*) qcpu="arm";; - mips*) qcpu="mips";; - ppc*) qcpu="ppc";; - s390*) qcpu="s390";; - sh*) qcpu="sh";; - sparc*) qcpu="sparc";; - esac - - cat <>"${out}" - if [ "\${cpu}" != "${qcpu}" -a -x "${interpreter}" ] ; then - echo ':${package}:M::${magic}:${mask}:${interpreter}:'"\${QEMU_BINFMT_FLAGS}" >/proc/sys/fs/binfmt_misc/register - fi -EOF - - echo ":${package}:M::${magic}:${mask}:${interpreter}:OC" >>"${out_systemd}" - - done - cat "${FILESDIR}"/qemu-binfmt.initd.tail >>"${out}" || die -} - -src_install() { - if [[ -n ${user_targets} ]]; then - cd "${S}/user-build" - emake DESTDIR="${ED}" install - - # Install binfmt handler init script for user targets. - generate_initd - doinitd "${T}/qemu-binfmt" - - # Install binfmt/qemu.conf. - insinto "/usr/share/qemu/binfmt.d" - doins "${T}/qemu.conf" - fi - - if [[ -n ${softmmu_targets} ]]; then - cd "${S}/softmmu-build" - emake DESTDIR="${ED}" install - - # This might not exist if the test failed. #512010 - [[ -e check-report.html ]] && dohtml check-report.html - - if use kernel_linux; then - udev_newrules "${FILESDIR}"/65-kvm.rules-r1 65-kvm.rules - fi - - if use python; then - python_foreach_impl qemu_python_install - fi - fi - - cd "${S}/tools-build" - emake DESTDIR="${ED}" install - - # Disable mprotect on the qemu binaries as they use JITs to be fast #459348 - pushd "${ED}"/usr/bin >/dev/null - pax-mark mr "${softmmu_bins[@]}" "${user_bins[@]}" # bug 575594 - popd >/dev/null - - # Install config file example for qemu-bridge-helper - insinto "/etc/qemu" - doins "${FILESDIR}/bridge.conf" - - cd "${S}" - dodoc Changelog MAINTAINERS docs/specs/pci-ids.txt - newdoc pc-bios/README README.pc-bios - dodoc docs/qmp-*.txt - - if [[ -n ${softmmu_targets} ]]; then - # Remove SeaBIOS since we're using the SeaBIOS packaged one - rm "${ED}/usr/share/qemu/bios.bin" - rm "${ED}/usr/share/qemu/bios-256k.bin" - if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then - dosym ../seabios/bios.bin /usr/share/qemu/bios.bin - dosym ../seabios/bios-256k.bin /usr/share/qemu/bios-256k.bin - fi - - # Remove vgabios since we're using the seavgabios packaged one - rm "${ED}/usr/share/qemu/vgabios.bin" - rm "${ED}/usr/share/qemu/vgabios-cirrus.bin" - rm "${ED}/usr/share/qemu/vgabios-qxl.bin" - rm "${ED}/usr/share/qemu/vgabios-stdvga.bin" - rm "${ED}/usr/share/qemu/vgabios-virtio.bin" - rm "${ED}/usr/share/qemu/vgabios-vmware.bin" - if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then - dosym ../seavgabios/vgabios-isavga.bin /usr/share/qemu/vgabios.bin - dosym ../seavgabios/vgabios-cirrus.bin /usr/share/qemu/vgabios-cirrus.bin - dosym ../seavgabios/vgabios-qxl.bin /usr/share/qemu/vgabios-qxl.bin - dosym ../seavgabios/vgabios-stdvga.bin /usr/share/qemu/vgabios-stdvga.bin - dosym ../seavgabios/vgabios-virtio.bin /usr/share/qemu/vgabios-virtio.bin - dosym ../seavgabios/vgabios-vmware.bin /usr/share/qemu/vgabios-vmware.bin - fi - - # Remove sgabios since we're using the sgabios packaged one - rm "${ED}/usr/share/qemu/sgabios.bin" - if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then - dosym ../sgabios/sgabios.bin /usr/share/qemu/sgabios.bin - fi - - # Remove iPXE since we're using the iPXE packaged one - rm "${ED}"/usr/share/qemu/pxe-*.rom - if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then - dosym ../ipxe/8086100e.rom /usr/share/qemu/pxe-e1000.rom - dosym ../ipxe/80861209.rom /usr/share/qemu/pxe-eepro100.rom - dosym ../ipxe/10500940.rom /usr/share/qemu/pxe-ne2k_pci.rom - dosym ../ipxe/10222000.rom /usr/share/qemu/pxe-pcnet.rom - dosym ../ipxe/10ec8139.rom /usr/share/qemu/pxe-rtl8139.rom - dosym ../ipxe/1af41000.rom /usr/share/qemu/pxe-virtio.rom - fi - fi - - DISABLE_AUTOFORMATTING=true - readme.gentoo_create_doc -} - -firmware_abi_change() { - local pv - for pv in ${REPLACING_VERSIONS}; do - if ! version_is_at_least ${FIRMWARE_ABI_VERSION} ${pv}; then - return 0 - fi - done - return 1 -} - -pkg_postinst() { - if [[ -n ${softmmu_targets} ]] && use kernel_linux; then - udev_reload - fi - - fcaps cap_net_admin /usr/libexec/qemu-bridge-helper - - DISABLE_AUTOFORMATTING=true - readme.gentoo_print_elog - - if use pin-upstream-blobs && firmware_abi_change; then - ewarn "This version of qemu pins new versions of firmware blobs:" - ewarn " $(best_version sys-firmware/edk2-ovmf)" - ewarn " $(best_version sys-firmware/ipxe)" - ewarn " $(best_version sys-firmware/seabios)" - ewarn " $(best_version sys-firmware/sgabios)" - ewarn "This might break resume of hibernated guests (started with a different" - ewarn "firmware version) and live migration to/from qemu versions with different" - ewarn "firmware. Please (cold) restart all running guests. For functional" - ewarn "guest migration ensure that all" - ewarn "hosts run at least" - ewarn " app-emulation/qemu-${FIRMWARE_ABI_VERSION}." - fi -} - -pkg_info() { - echo "Using:" - echo " $(best_version app-emulation/spice-protocol)" - echo " $(best_version sys-firmware/edk2-ovmf)" - if has_version 'sys-firmware/edk2-ovmf[binary]'; then - echo " USE=binary" - else - echo " USE=''" - fi - echo " $(best_version sys-firmware/ipxe)" - echo " $(best_version sys-firmware/seabios)" - if has_version 'sys-firmware/seabios[binary]'; then - echo " USE=binary" - else - echo " USE=''" - fi - echo " $(best_version sys-firmware/sgabios)" -} diff --git a/app-emulation/qemu/qemu-2.9.0-r57.ebuild b/app-emulation/qemu/qemu-2.9.0-r57.ebuild deleted file mode 100644 index a63311cba203..000000000000 --- a/app-emulation/qemu/qemu-2.9.0-r57.ebuild +++ /dev/null @@ -1,796 +0,0 @@ -# Copyright 1999-2017 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -EAPI="6" - -PYTHON_COMPAT=( python2_7 ) -PYTHON_REQ_USE="ncurses,readline" - -PLOCALES="bg de_DE fr_FR hu it tr zh_CN" - -FIRMWARE_ABI_VERSION="2.9.0-r52" - -inherit eutils flag-o-matic linux-info toolchain-funcs multilib python-r1 \ - user udev fcaps readme.gentoo-r1 pax-utils l10n - -if [[ ${PV} = *9999* ]]; then - EGIT_REPO_URI="git://git.qemu.org/qemu.git" - inherit git-r3 - SRC_URI="" -else - SRC_URI="http://wiki.qemu-project.org/download/${P}.tar.bz2" - KEYWORDS="~amd64 ~arm64 ~ppc ~ppc64 ~x86 ~x86-fbsd" -fi - -DESCRIPTION="QEMU + Kernel-based Virtual Machine userland tools" -HOMEPAGE="http://www.qemu.org http://www.linux-kvm.org" - -LICENSE="GPL-2 LGPL-2 BSD-2" -SLOT="0" -IUSE="accessibility +aio alsa bluetooth bzip2 +caps +curl debug +fdt - glusterfs gnutls gtk gtk2 infiniband iscsi +jpeg kernel_linux - kernel_FreeBSD lzo ncurses nfs nls numa opengl +pin-upstream-blobs +png - pulseaudio python rbd sasl +seccomp sdl sdl2 selinux smartcard snappy - spice ssh static static-user systemtap tci test usb usbredir vde - +vhost-net virgl virtfs +vnc vte xattr xen xfs" - -COMMON_TARGETS="aarch64 alpha arm cris i386 m68k microblaze microblazeel - mips mips64 mips64el mipsel nios2 or1k ppc ppc64 s390x sh4 sh4eb sparc - sparc64 x86_64" -IUSE_SOFTMMU_TARGETS="${COMMON_TARGETS} - lm32 moxie ppcemb tricore unicore32 xtensa xtensaeb" -IUSE_USER_TARGETS="${COMMON_TARGETS} - armeb hppa mipsn32 mipsn32el ppc64abi32 ppc64le sparc32plus tilegx" - -use_softmmu_targets=$(printf ' qemu_softmmu_targets_%s' ${IUSE_SOFTMMU_TARGETS}) -use_user_targets=$(printf ' qemu_user_targets_%s' ${IUSE_USER_TARGETS}) -IUSE+=" ${use_softmmu_targets} ${use_user_targets}" - -# Allow no targets to be built so that people can get a tools-only build. -# Block USE flag configurations known to not work. -REQUIRED_USE="${PYTHON_REQUIRED_USE} - gtk2? ( gtk ) - qemu_softmmu_targets_arm? ( fdt ) - qemu_softmmu_targets_microblaze? ( fdt ) - qemu_softmmu_targets_mips64el? ( fdt ) - qemu_softmmu_targets_ppc? ( fdt ) - qemu_softmmu_targets_ppc64? ( fdt ) - sdl2? ( sdl ) - static? ( static-user !alsa !bluetooth !gtk !gtk2 !opengl !pulseaudio ) - virtfs? ( xattr ) - vte? ( gtk )" - -# Dependencies required for qemu tools (qemu-nbd, qemu-img, qemu-io, ...) -# and user/softmmu targets (qemu-*, qemu-system-*). -# -# Yep, you need both libcap and libcap-ng since virtfs only uses libcap. -# -# The attr lib isn't always linked in (although the USE flag is always -# respected). This is because qemu supports using the C library's API -# when available rather than always using the extranl library. -ALL_DEPEND=" - >=dev-libs/glib-2.0[static-libs(+)] - sys-libs/zlib[static-libs(+)] - python? ( ${PYTHON_DEPS} ) - systemtap? ( dev-util/systemtap ) - xattr? ( sys-apps/attr[static-libs(+)] )" - -# Dependencies required for qemu tools (qemu-nbd, qemu-img, qemu-io, ...) -# softmmu targets (qemu-system-*). -SOFTMMU_TOOLS_DEPEND=" - >=x11-libs/pixman-0.28.0[static-libs(+)] - accessibility? ( - app-accessibility/brltty[api] - app-accessibility/brltty[static-libs(+)] - ) - aio? ( dev-libs/libaio[static-libs(+)] ) - alsa? ( >=media-libs/alsa-lib-1.0.13 ) - bluetooth? ( net-wireless/bluez ) - bzip2? ( app-arch/bzip2[static-libs(+)] ) - caps? ( sys-libs/libcap-ng[static-libs(+)] ) - curl? ( >=net-misc/curl-7.15.4[static-libs(+)] ) - fdt? ( >=sys-apps/dtc-1.4.2[static-libs(+)] ) - glusterfs? ( >=sys-cluster/glusterfs-3.4.0[static-libs(+)] ) - gnutls? ( - dev-libs/nettle:=[static-libs(+)] - >=net-libs/gnutls-3.0:=[static-libs(+)] - ) - gtk? ( - gtk2? ( - x11-libs/gtk+:2 - vte? ( x11-libs/vte:0 ) - ) - !gtk2? ( - x11-libs/gtk+:3 - vte? ( x11-libs/vte:2.91 ) - ) - ) - infiniband? ( sys-fabric/librdmacm:=[static-libs(+)] ) - iscsi? ( net-libs/libiscsi ) - jpeg? ( virtual/jpeg:0=[static-libs(+)] ) - lzo? ( dev-libs/lzo:2[static-libs(+)] ) - ncurses? ( - sys-libs/ncurses:0=[unicode] - sys-libs/ncurses:0=[static-libs(+)] - ) - nfs? ( >=net-fs/libnfs-1.9.3[static-libs(+)] ) - numa? ( sys-process/numactl[static-libs(+)] ) - opengl? ( - virtual/opengl - media-libs/libepoxy[static-libs(+)] - media-libs/mesa[static-libs(+)] - media-libs/mesa[egl,gbm] - ) - png? ( media-libs/libpng:0=[static-libs(+)] ) - pulseaudio? ( media-sound/pulseaudio ) - rbd? ( sys-cluster/ceph[static-libs(+)] ) - sasl? ( dev-libs/cyrus-sasl[static-libs(+)] ) - sdl? ( - !sdl2? ( - media-libs/libsdl[X] - >=media-libs/libsdl-1.2.11[static-libs(+)] - ) - sdl2? ( - media-libs/libsdl2[X] - media-libs/libsdl2[static-libs(+)] - ) - ) - seccomp? ( >=sys-libs/libseccomp-2.1.0[static-libs(+)] ) - smartcard? ( >=app-emulation/libcacard-2.5.0[static-libs(+)] ) - snappy? ( app-arch/snappy:=[static-libs(+)] ) - spice? ( - >=app-emulation/spice-protocol-0.12.3 - >=app-emulation/spice-0.12.0[static-libs(+)] - ) - ssh? ( >=net-libs/libssh2-1.2.8[static-libs(+)] ) - usb? ( >=virtual/libusb-1-r2[static-libs(+)] ) - usbredir? ( >=sys-apps/usbredir-0.6[static-libs(+)] ) - vde? ( net-misc/vde[static-libs(+)] ) - virgl? ( media-libs/virglrenderer[static-libs(+)] ) - virtfs? ( sys-libs/libcap ) - xen? ( app-emulation/xen-tools:= ) - xfs? ( sys-fs/xfsprogs[static-libs(+)] )" - -X86_FIRMWARE_DEPEND=" - pin-upstream-blobs? ( - ~sys-firmware/edk2-ovmf-2017_pre20170505[binary] - ~sys-firmware/ipxe-1.0.0_p20160620 - ~sys-firmware/seabios-1.10.2[binary,seavgabios] - ~sys-firmware/sgabios-0.1_pre8 - ) - !pin-upstream-blobs? ( - sys-firmware/edk2-ovmf - sys-firmware/ipxe - >=sys-firmware/seabios-1.10.2[seavgabios] - sys-firmware/sgabios - )" - -CDEPEND=" - !static? ( - ${ALL_DEPEND//\[static-libs(+)]} - ${SOFTMMU_TOOLS_DEPEND//\[static-libs(+)]} - ) - qemu_softmmu_targets_i386? ( ${X86_FIRMWARE_DEPEND} ) - qemu_softmmu_targets_x86_64? ( ${X86_FIRMWARE_DEPEND} )" -DEPEND="${CDEPEND} - dev-lang/perl - =dev-lang/python-2* - sys-apps/texinfo - virtual/pkgconfig - kernel_linux? ( >=sys-kernel/linux-headers-2.6.35 ) - gtk? ( nls? ( sys-devel/gettext ) ) - static? ( - ${ALL_DEPEND} - ${SOFTMMU_TOOLS_DEPEND} - ) - static-user? ( ${ALL_DEPEND} ) - test? ( - dev-libs/glib[utils] - sys-devel/bc - )" -RDEPEND="${CDEPEND} - selinux? ( sec-policy/selinux-qemu )" - -PATCHES=( - "${FILESDIR}"/${PN}-2.5.0-cflags.patch - "${FILESDIR}"/${PN}-2.5.0-sysmacros.patch - "${FILESDIR}"/${PN}-2.9.0-CVE-2017-8309.patch # bug 616870 - "${FILESDIR}"/${PN}-2.9.0-CVE-2017-8379.patch # bug 616872 - "${FILESDIR}"/${PN}-2.9.0-CVE-2017-8380.patch # bug 616874 - "${FILESDIR}"/${PN}-2.9.0-CVE-2017-8112.patch # bug 616636 - "${FILESDIR}"/${PN}-2.9.0-CVE-2017-7493.patch # bug 618808 - "${FILESDIR}"/${PN}-2.9.0-CVE-2017-11434.patch # bug 625614 - "${FILESDIR}"/${PN}-2.9.0-CVE-2017-11334.patch # bug 621292 - "${FILESDIR}"/${PN}-2.9.0-CVE-2017-9524-1.patch # bug 621292 - "${FILESDIR}"/${PN}-2.9.0-CVE-2017-9524-2.patch - "${FILESDIR}"/${PN}-2.9.0-CVE-2017-9503-1.patch # bug 621184 - "${FILESDIR}"/${PN}-2.9.0-CVE-2017-9503-2.patch - "${FILESDIR}"/${PN}-2.9.0-CVE-2017-10664.patch # bug 623016 - "${FILESDIR}"/${PN}-2.9.0-CVE-2017-10806.patch # bug 624088 -) - -STRIP_MASK="/usr/share/qemu/palcode-clipper" - -QA_PREBUILT=" - usr/share/qemu/openbios-ppc - usr/share/qemu/openbios-sparc64 - usr/share/qemu/openbios-sparc32 - usr/share/qemu/palcode-clipper - usr/share/qemu/s390-ccw.img - usr/share/qemu/u-boot.e500" - -QA_WX_LOAD="usr/bin/qemu-i386 - usr/bin/qemu-x86_64 - usr/bin/qemu-alpha - usr/bin/qemu-arm - usr/bin/qemu-cris - usr/bin/qemu-m68k - usr/bin/qemu-microblaze - usr/bin/qemu-microblazeel - usr/bin/qemu-mips - usr/bin/qemu-mipsel - usr/bin/qemu-or1k - usr/bin/qemu-ppc - usr/bin/qemu-ppc64 - usr/bin/qemu-ppc64abi32 - usr/bin/qemu-sh4 - usr/bin/qemu-sh4eb - usr/bin/qemu-sparc - usr/bin/qemu-sparc64 - usr/bin/qemu-armeb - usr/bin/qemu-sparc32plus - usr/bin/qemu-s390x - usr/bin/qemu-unicore32" - -DOC_CONTENTS="If you don't have kvm compiled into the kernel, make sure you have the -kernel module loaded before running kvm. The easiest way to ensure that the -kernel module is loaded is to load it on boot. - For AMD CPUs the module is called 'kvm-amd'. - For Intel CPUs the module is called 'kvm-intel'. -Please review /etc/conf.d/modules for how to load these. - -Make sure your user is in the 'kvm' group. Just run - $ gpasswd -a kvm -then have re-login. - -For brand new installs, the default permissions on /dev/kvm might not let -you access it. You can tell udev to reset ownership/perms: - $ udevadm trigger -c add /dev/kvm - -If you want to register binfmt handlers for qemu user targets: -For openrc: - # rc-update add qemu-binfmt -For systemd: - # ln -s /usr/share/qemu/binfmt.d/qemu.conf /etc/binfmt.d/qemu.conf" - -pkg_pretend() { - if use kernel_linux && kernel_is lt 2 6 25; then - eerror "This version of KVM requres a host kernel of 2.6.25 or higher." - elif use kernel_linux; then - if ! linux_config_exists; then - eerror "Unable to check your kernel for KVM support" - else - CONFIG_CHECK="~KVM ~TUN ~BRIDGE" - ERROR_KVM="You must enable KVM in your kernel to continue" - ERROR_KVM_AMD="If you have an AMD CPU, you must enable KVM_AMD in" - ERROR_KVM_AMD+=" your kernel configuration." - ERROR_KVM_INTEL="If you have an Intel CPU, you must enable" - ERROR_KVM_INTEL+=" KVM_INTEL in your kernel configuration." - ERROR_TUN="You will need the Universal TUN/TAP driver compiled" - ERROR_TUN+=" into your kernel or loaded as a module to use the" - ERROR_TUN+=" virtual network device if using -net tap." - ERROR_BRIDGE="You will also need support for 802.1d" - ERROR_BRIDGE+=" Ethernet Bridging for some network configurations." - use vhost-net && CONFIG_CHECK+=" ~VHOST_NET" - ERROR_VHOST_NET="You must enable VHOST_NET to have vhost-net" - ERROR_VHOST_NET+=" support" - - if use amd64 || use x86 || use amd64-linux || use x86-linux; then - CONFIG_CHECK+=" ~KVM_AMD ~KVM_INTEL" - fi - - use python && CONFIG_CHECK+=" ~DEBUG_FS" - ERROR_DEBUG_FS="debugFS support required for kvm_stat" - - # Now do the actual checks setup above - check_extra_config - fi - fi - - if grep -qs '/usr/bin/qemu-kvm' "${EROOT}"/etc/libvirt/qemu/*.xml; then - eerror "The kvm/qemu-kvm wrappers no longer exist, but your libvirt" - eerror "instances are still pointing to it. Please update your" - eerror "configs in /etc/libvirt/qemu/ to use the -enable-kvm flag" - eerror "and the right system binary (e.g. qemu-system-x86_64)." - die "update your virt configs to not use qemu-kvm" - fi -} - -pkg_setup() { - enewgroup kvm 78 -} - -# Sanity check to make sure target lists are kept up-to-date. -check_targets() { - local var=$1 mak=$2 - local detected sorted - - pushd "${S}"/default-configs >/dev/null || die - - # Force C locale until glibc is updated. #564936 - detected=$(echo $(printf '%s\n' *-${mak}.mak | sed "s:-${mak}.mak::" | LC_COLLATE=C sort -u)) - sorted=$(echo $(printf '%s\n' ${!var} | LC_COLLATE=C sort -u)) - if [[ ${sorted} != "${detected}" ]] ; then - eerror "The ebuild needs to be kept in sync." - eerror "${var}: ${sorted}" - eerror "$(printf '%-*s' ${#var} configure): ${detected}" - die "sync ${var} to the list of targets" - fi - - popd >/dev/null -} - -handle_locales() { - # Make sure locale list is kept up-to-date. - local detected sorted - detected=$(echo $(cd po && printf '%s\n' *.po | grep -v messages.po | sed 's:.po$::' | sort -u)) - sorted=$(echo $(printf '%s\n' ${PLOCALES} | sort -u)) - if [[ ${sorted} != "${detected}" ]] ; then - eerror "The ebuild needs to be kept in sync." - eerror "PLOCALES: ${sorted}" - eerror " po/*.po: ${detected}" - die "sync PLOCALES" - fi - - # Deal with selective install of locales. - if use nls ; then - # Delete locales the user does not want. #577814 - rm_loc() { rm po/$1.po || die; } - l10n_for_each_disabled_locale_do rm_loc - else - # Cheap hack to disable gettext .mo generation. - rm -f po/*.po - fi -} - -src_prepare() { - check_targets IUSE_SOFTMMU_TARGETS softmmu - check_targets IUSE_USER_TARGETS linux-user - - # Alter target makefiles to accept CFLAGS set via flag-o - sed -i -r \ - -e 's/^(C|OP_C|HELPER_C)FLAGS=/\1FLAGS+=/' \ - Makefile Makefile.target || die - - default - - # Fix ld and objcopy being called directly - tc-export AR LD OBJCOPY - - # Verbose builds - MAKEOPTS+=" V=1" - - # Run after we've applied all patches. - handle_locales - - #remove bundled copy of libfdt - rm -r dtc || die -} - -## -# configures qemu based on the build directory and the build type -# we are using. -# -qemu_src_configure() { - debug-print-function ${FUNCNAME} "$@" - - local buildtype=$1 - local builddir="${S}/${buildtype}-build" - - mkdir "${builddir}" - - local conf_opts=( - --prefix=/usr - --sysconfdir=/etc - --libdir=/usr/$(get_libdir) - --docdir=/usr/share/doc/${PF}/html - --disable-bsd-user - --disable-guest-agent - --disable-strip - --disable-werror - # We support gnutls/nettle for crypto operations. It is possible - # to use gcrypt when gnutls/nettle are disabled (but not when they - # are enabled), but it's not really worth the hassle. Disable it - # all the time to avoid automatically detecting it. #568856 - --disable-gcrypt - --python="${PYTHON}" - --cc="$(tc-getCC)" - --cxx="$(tc-getCXX)" - --host-cc="$(tc-getBUILD_CC)" - $(use_enable debug debug-info) - $(use_enable debug debug-tcg) - --enable-docs - $(use_enable tci tcg-interpreter) - $(use_enable xattr attr) - ) - - # Disable options not used by user targets. This simplifies building - # static user targets (USE=static-user) considerably. - conf_notuser() { - if [[ ${buildtype} == "user" ]] ; then - echo "--disable-${2:-$1}" - else - use_enable "$@" - fi - } - conf_opts+=( - $(conf_notuser accessibility brlapi) - $(conf_notuser aio linux-aio) - $(conf_notuser bzip2) - $(conf_notuser bluetooth bluez) - $(conf_notuser caps cap-ng) - $(conf_notuser curl) - $(conf_notuser fdt) - $(conf_notuser glusterfs) - $(conf_notuser gnutls) - $(conf_notuser gnutls nettle) - $(conf_notuser gtk) - $(conf_notuser infiniband rdma) - $(conf_notuser iscsi libiscsi) - $(conf_notuser jpeg vnc-jpeg) - $(conf_notuser kernel_linux kvm) - $(conf_notuser lzo) - $(conf_notuser ncurses curses) - $(conf_notuser nfs libnfs) - $(conf_notuser numa) - $(conf_notuser opengl) - $(conf_notuser png vnc-png) - $(conf_notuser rbd) - $(conf_notuser sasl vnc-sasl) - $(conf_notuser sdl) - $(conf_notuser seccomp) - $(conf_notuser smartcard) - $(conf_notuser snappy) - $(conf_notuser spice) - $(conf_notuser ssh libssh2) - $(conf_notuser usb libusb) - $(conf_notuser usbredir usb-redir) - $(conf_notuser vde) - $(conf_notuser vhost-net) - $(conf_notuser virgl virglrenderer) - $(conf_notuser virtfs) - $(conf_notuser vnc) - $(conf_notuser vte) - $(conf_notuser xen) - $(conf_notuser xen xen-pci-passthrough) - $(conf_notuser xfs xfsctl) - ) - - if [[ ! ${buildtype} == "user" ]] ; then - # audio options - local audio_opts="oss" - use alsa && audio_opts="alsa,${audio_opts}" - use sdl && audio_opts="sdl,${audio_opts}" - use pulseaudio && audio_opts="pa,${audio_opts}" - conf_opts+=( - --audio-drv-list="${audio_opts}" - ) - use gtk && conf_opts+=( --with-gtkabi=$(usex gtk2 2.0 3.0) ) - use sdl && conf_opts+=( --with-sdlabi=$(usex sdl2 2.0 1.2) ) - fi - - case ${buildtype} in - user) - conf_opts+=( - --enable-linux-user - --disable-system - --disable-blobs - --disable-tools - ) - local static_flag="static-user" - ;; - softmmu) - conf_opts+=( - --disable-linux-user - --enable-system - --disable-tools - --with-system-pixman - ) - local static_flag="static" - ;; - tools) - conf_opts+=( - --disable-linux-user - --disable-system - --disable-blobs - --enable-tools - ) - local static_flag="static" - ;; - esac - - local targets="${buildtype}_targets" - [[ -n ${targets} ]] && conf_opts+=( --target-list="${!targets}" ) - - # Add support for SystemTAP - use systemtap && conf_opts+=( --enable-trace-backend=dtrace ) - - # We always want to attempt to build with PIE support as it results - # in a more secure binary. But it doesn't work with static or if - # the current GCC doesn't have PIE support. - if use ${static_flag}; then - conf_opts+=( --static --disable-pie ) - else - tc-enables-pie && conf_opts+=( --enable-pie ) - fi - - echo "../configure ${conf_opts[*]}" - cd "${builddir}" - ../configure "${conf_opts[@]}" || die "configure failed" - - # FreeBSD's kernel does not support QEMU assigning/grabbing - # host USB devices yet - use kernel_FreeBSD && \ - sed -i -E -e "s|^(HOST_USB=)bsd|\1stub|" "${S}"/config-host.mak -} - -src_configure() { - local target - - python_setup - - softmmu_targets= softmmu_bins=() - user_targets= user_bins=() - - for target in ${IUSE_SOFTMMU_TARGETS} ; do - if use "qemu_softmmu_targets_${target}"; then - softmmu_targets+=",${target}-softmmu" - softmmu_bins+=( "qemu-system-${target}" ) - fi - done - - for target in ${IUSE_USER_TARGETS} ; do - if use "qemu_user_targets_${target}"; then - user_targets+=",${target}-linux-user" - user_bins+=( "qemu-${target}" ) - fi - done - - softmmu_targets=${softmmu_targets#,} - user_targets=${user_targets#,} - - [[ -n ${softmmu_targets} ]] && qemu_src_configure "softmmu" - [[ -n ${user_targets} ]] && qemu_src_configure "user" - qemu_src_configure "tools" -} - -src_compile() { - if [[ -n ${user_targets} ]]; then - cd "${S}/user-build" - default - fi - - if [[ -n ${softmmu_targets} ]]; then - cd "${S}/softmmu-build" - default - fi - - cd "${S}/tools-build" - default -} - -src_test() { - if [[ -n ${softmmu_targets} ]]; then - cd "${S}/softmmu-build" - pax-mark m */qemu-system-* #515550 - emake -j1 check - emake -j1 check-report.html - fi -} - -qemu_python_install() { - python_domodule "${S}/scripts/qmp/qmp.py" - - python_doscript "${S}/scripts/kvm/vmxcap" - python_doscript "${S}/scripts/qmp/qmp-shell" - python_doscript "${S}/scripts/qmp/qemu-ga-client" -} - -# Generate binfmt support files. -# - /etc/init.d/qemu-binfmt script which registers the user handlers (openrc) -# - /usr/share/qemu/binfmt.d/qemu.conf (for use with systemd-binfmt) -generate_initd() { - local out="${T}/qemu-binfmt" - local out_systemd="${T}/qemu.conf" - local d="${T}/binfmt.d" - - einfo "Generating qemu binfmt scripts and configuration files" - - # Generate the debian fragments first. - mkdir -p "${d}" - "${S}"/scripts/qemu-binfmt-conf.sh \ - --debian \ - --exportdir "${d}" \ - --qemu-path "${EPREFIX}/usr/bin" \ - || die - # Then turn the fragments into a shell script we can source. - sed -E -i \ - -e 's:^([^ ]+) (.*)$:\1="\2":' \ - "${d}"/* || die - - # Generate the init.d script by assembling the fragments from above. - local f qcpu package interpreter magic mask - cat "${FILESDIR}"/qemu-binfmt.initd.head >"${out}" || die - for f in "${d}"/qemu-* ; do - source "${f}" - - # Normalize the cpu logic like we do in the init.d for the native cpu. - qcpu=${package#qemu-} - case ${qcpu} in - arm*) qcpu="arm";; - mips*) qcpu="mips";; - ppc*) qcpu="ppc";; - s390*) qcpu="s390";; - sh*) qcpu="sh";; - sparc*) qcpu="sparc";; - esac - - cat <>"${out}" - if [ "\${cpu}" != "${qcpu}" -a -x "${interpreter}" ] ; then - echo ':${package}:M::${magic}:${mask}:${interpreter}:'"\${QEMU_BINFMT_FLAGS}" >/proc/sys/fs/binfmt_misc/register - fi -EOF - - echo ":${package}:M::${magic}:${mask}:${interpreter}:OC" >>"${out_systemd}" - - done - cat "${FILESDIR}"/qemu-binfmt.initd.tail >>"${out}" || die -} - -src_install() { - if [[ -n ${user_targets} ]]; then - cd "${S}/user-build" - emake DESTDIR="${ED}" install - - # Install binfmt handler init script for user targets. - generate_initd - doinitd "${T}/qemu-binfmt" - - # Install binfmt/qemu.conf. - insinto "/usr/share/qemu/binfmt.d" - doins "${T}/qemu.conf" - fi - - if [[ -n ${softmmu_targets} ]]; then - cd "${S}/softmmu-build" - emake DESTDIR="${ED}" install - - # This might not exist if the test failed. #512010 - [[ -e check-report.html ]] && dohtml check-report.html - - if use kernel_linux; then - udev_newrules "${FILESDIR}"/65-kvm.rules-r1 65-kvm.rules - fi - - if use python; then - python_foreach_impl qemu_python_install - fi - fi - - cd "${S}/tools-build" - emake DESTDIR="${ED}" install - - # Disable mprotect on the qemu binaries as they use JITs to be fast #459348 - pushd "${ED}"/usr/bin >/dev/null - pax-mark mr "${softmmu_bins[@]}" "${user_bins[@]}" # bug 575594 - popd >/dev/null - - # Install config file example for qemu-bridge-helper - insinto "/etc/qemu" - doins "${FILESDIR}/bridge.conf" - - cd "${S}" - dodoc Changelog MAINTAINERS docs/specs/pci-ids.txt - newdoc pc-bios/README README.pc-bios - dodoc docs/qmp-*.txt - - if [[ -n ${softmmu_targets} ]]; then - # Remove SeaBIOS since we're using the SeaBIOS packaged one - rm "${ED}/usr/share/qemu/bios.bin" - rm "${ED}/usr/share/qemu/bios-256k.bin" - if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then - dosym ../seabios/bios.bin /usr/share/qemu/bios.bin - dosym ../seabios/bios-256k.bin /usr/share/qemu/bios-256k.bin - fi - - # Remove vgabios since we're using the seavgabios packaged one - rm "${ED}/usr/share/qemu/vgabios.bin" - rm "${ED}/usr/share/qemu/vgabios-cirrus.bin" - rm "${ED}/usr/share/qemu/vgabios-qxl.bin" - rm "${ED}/usr/share/qemu/vgabios-stdvga.bin" - rm "${ED}/usr/share/qemu/vgabios-virtio.bin" - rm "${ED}/usr/share/qemu/vgabios-vmware.bin" - if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then - dosym ../seavgabios/vgabios-isavga.bin /usr/share/qemu/vgabios.bin - dosym ../seavgabios/vgabios-cirrus.bin /usr/share/qemu/vgabios-cirrus.bin - dosym ../seavgabios/vgabios-qxl.bin /usr/share/qemu/vgabios-qxl.bin - dosym ../seavgabios/vgabios-stdvga.bin /usr/share/qemu/vgabios-stdvga.bin - dosym ../seavgabios/vgabios-virtio.bin /usr/share/qemu/vgabios-virtio.bin - dosym ../seavgabios/vgabios-vmware.bin /usr/share/qemu/vgabios-vmware.bin - fi - - # Remove sgabios since we're using the sgabios packaged one - rm "${ED}/usr/share/qemu/sgabios.bin" - if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then - dosym ../sgabios/sgabios.bin /usr/share/qemu/sgabios.bin - fi - - # Remove iPXE since we're using the iPXE packaged one - rm "${ED}"/usr/share/qemu/pxe-*.rom - if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then - dosym ../ipxe/8086100e.rom /usr/share/qemu/pxe-e1000.rom - dosym ../ipxe/80861209.rom /usr/share/qemu/pxe-eepro100.rom - dosym ../ipxe/10500940.rom /usr/share/qemu/pxe-ne2k_pci.rom - dosym ../ipxe/10222000.rom /usr/share/qemu/pxe-pcnet.rom - dosym ../ipxe/10ec8139.rom /usr/share/qemu/pxe-rtl8139.rom - dosym ../ipxe/1af41000.rom /usr/share/qemu/pxe-virtio.rom - fi - fi - - DISABLE_AUTOFORMATTING=true - readme.gentoo_create_doc -} - -firmware_abi_change() { - local pv - for pv in ${REPLACING_VERSIONS}; do - if ! version_is_at_least ${FIRMWARE_ABI_VERSION} ${pv}; then - return 0 - fi - done - return 1 -} - -pkg_postinst() { - if [[ -n ${softmmu_targets} ]] && use kernel_linux; then - udev_reload - fi - - fcaps cap_net_admin /usr/libexec/qemu-bridge-helper - - DISABLE_AUTOFORMATTING=true - readme.gentoo_print_elog - - if use pin-upstream-blobs && firmware_abi_change; then - ewarn "This version of qemu pins new versions of firmware blobs:" - ewarn " $(best_version sys-firmware/edk2-ovmf)" - ewarn " $(best_version sys-firmware/ipxe)" - ewarn " $(best_version sys-firmware/seabios)" - ewarn " $(best_version sys-firmware/sgabios)" - ewarn "This might break resume of hibernated guests (started with a different" - ewarn "firmware version) and live migration to/from qemu versions with different" - ewarn "firmware. Please (cold) restart all running guests. For functional" - ewarn "guest migration ensure that all" - ewarn "hosts run at least" - ewarn " app-emulation/qemu-${FIRMWARE_ABI_VERSION}." - fi -} - -pkg_info() { - echo "Using:" - echo " $(best_version app-emulation/spice-protocol)" - echo " $(best_version sys-firmware/edk2-ovmf)" - if has_version 'sys-firmware/edk2-ovmf[binary]'; then - echo " USE=binary" - else - echo " USE=''" - fi - echo " $(best_version sys-firmware/ipxe)" - echo " $(best_version sys-firmware/seabios)" - if has_version 'sys-firmware/seabios[binary]'; then - echo " USE=binary" - else - echo " USE=''" - fi - echo " $(best_version sys-firmware/sgabios)" -} diff --git a/app-emulation/qemu/qemu-9999.ebuild b/app-emulation/qemu/qemu-9999.ebuild index a256ce5e7f72..1f09b78248a4 100644 --- a/app-emulation/qemu/qemu-9999.ebuild +++ b/app-emulation/qemu/qemu-9999.ebuild @@ -78,7 +78,6 @@ ALL_DEPEND=" # Dependencies required for qemu tools (qemu-nbd, qemu-img, qemu-io, ...) # softmmu targets (qemu-system-*). SOFTMMU_TOOLS_DEPEND=" - >=x11-libs/pixman-0.28.0[static-libs(+)] accessibility? ( app-accessibility/brltty[api] app-accessibility/brltty[static-libs(+)] @@ -89,7 +88,7 @@ SOFTMMU_TOOLS_DEPEND=" bzip2? ( app-arch/bzip2[static-libs(+)] ) caps? ( sys-libs/libcap-ng[static-libs(+)] ) curl? ( >=net-misc/curl-7.15.4[static-libs(+)] ) - fdt? ( >=sys-apps/dtc-1.4.0[static-libs(+)] ) + fdt? ( >=sys-apps/dtc-1.4.2[static-libs(+)] ) glusterfs? ( >=sys-cluster/glusterfs-3.4.0[static-libs(+)] ) gnutls? ( dev-libs/nettle:=[static-libs(+)] @@ -370,6 +369,9 @@ src_prepare() { # Run after we've applied all patches. handle_locales + + # Remove bundled copy of libfdt + rm -r dtc || die } ## @@ -489,7 +491,6 @@ qemu_src_configure() { --disable-linux-user --enable-system --disable-tools - --with-system-pixman ) local static_flag="static" ;; @@ -687,7 +688,6 @@ src_install() { cd "${S}" dodoc Changelog MAINTAINERS docs/specs/pci-ids.txt newdoc pc-bios/README README.pc-bios - dodoc docs/qmp-*.txt if [[ -n ${softmmu_targets} ]]; then # Remove SeaBIOS since we're using the SeaBIOS packaged one @@ -775,17 +775,18 @@ pkg_postinst() { pkg_info() { echo "Using:" echo " $(best_version app-emulation/spice-protocol)" - echo " $(best_version sys-firmware/ipxe)" - echo " $(best_version sys-firmware/seabios)" - if has_version 'sys-firmware/seabios[binary]'; then + echo " $(best_version sys-firmware/edk2-ovmf)" + if has_version 'sys-firmware/edk2-ovmf[binary]'; then echo " USE=binary" else echo " USE=''" fi - echo " $(best_version sys-firmware/edk2-ovmf)" - if has_version 'sys-firmware/edk2-ovmf[binary]'; then + echo " $(best_version sys-firmware/ipxe)" + echo " $(best_version sys-firmware/seabios)" + if has_version 'sys-firmware/seabios[binary]'; then echo " USE=binary" else echo " USE=''" fi + echo " $(best_version sys-firmware/sgabios)" } -- cgit v1.2.3