Added package app-emulation/libvirt.
This commit is contained in:
parent
56bde480dd
commit
d2a7d61c22
16
app-emulation/libvirt/Manifest
Normal file
16
app-emulation/libvirt/Manifest
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
AUX README.gentoo-r3 2065 BLAKE2B f3677b916121126c431ba32e324bcc9f04b4dfeef1ee54517cae1118c67274592d890d6d919a48af6709e9220379797549277904a02fea740a69b1bf8f2397aa SHA512 77ede8a3e1a380b334595e65ae148acd2e52d594200253dc67d68dd256db5bf72ce7ce222d067c739ce53f84634421e74726f30c0ab7a1c76b86ccdc191c8a69
|
||||||
|
AUX libvirt-6.0.0-fix_paths_in_libvirt-guests_sh.patch 1281 BLAKE2B 631f813ad29db29a6eb537ecd7b9d12aed097c5e0e01c07161adac1dec8a6f129bc098172fe6de4e78a2fbe5e67052005a7c5d1d17cbbb63ad27025662b9fa34 SHA512 dc80c9fc459207dd1ff77548054ea5a51c41a2d36e1b8917eca5f69293a86168af3da47466d8ff954a8b2e0ead9f28ed7d6c2c3671cf67d0ebb4039003a0dde2
|
||||||
|
AUX libvirt-8.2.0-do-not-use-sysconfig.patch 8420 BLAKE2B 37856003bc58b69531be6b55fcc3304b71558b7a5306c2da3fbad2d5eac006ca3ebb54bd56f8e761363311a5c865d2cd072c418794fcb605562fc32f997c88a9 SHA512 84a693b870aebe0f87f518473d28d97e613b6069f497e6e49c3e8feffc96c2e709d0a7a3530c52d4d034c6b0bc7374ab61f40ddd2f071735c5baacdebcfca8b6
|
||||||
|
AUX libvirt-8.2.0-fix-paths-for-apparmor.patch 2785 BLAKE2B 2b1daa96385ce09a078e1c152b222b274fcde1803497de8709d7569debc1537e9ee4f65a1f775636521ba351310ad13806005e1c02fa00224551244a79ace109 SHA512 be537022563bcf782381cdb99188becf1785de950124626e5ea13219a870a1c6c13834f2cb3c9cf4c364a66b5a7647bfa856a4c5e634dfac6a591c8c93e5ce9f
|
||||||
|
AUX libvirt-9.2.0-meson-Stop-detecting-Wl-version-script.patch 1981 BLAKE2B 69625606757a2b77c9fe4f38b2921ae4f7fb3b929ff7a0a0b9b76b9af5b575264397ae2710398a58fe5af778ab71db3494e4ff597e4cd1595d93b078d002c2f4 SHA512 8e2186f3eecd6bcdf523d4be24a9961251118e4375a5f923009ad1ec83c2c1fd96147ecb540197f780a397d9ff67b35b1f16b5a5180dce1b0aeb7c7c5bfa9485
|
||||||
|
AUX libvirt-guests.confd 2430 BLAKE2B 9d56477c9377e02503782e6d653579c6d149b292c43f37926f4646374e8aae05ca812b6a3a561811482861f8fe67dfdbe63851963326ddbbf2f4644c85411120 SHA512 78f419a89de7aabaad860903c24f1c070786fc1296d987e61dd537705b0e7f71a46c315888028f3826c3417e42861ca8471788be4ec5695e98427c5f18ae63fc
|
||||||
|
AUX libvirt-guests.init-r4 5591 BLAKE2B e745692a7ea706c8367cdb7ee2114565770bda5be5675ba3a541555659d17875f7996ff7028bf415224d095b49b71205a3d77f420464d5579ccc189def5e434d SHA512 ec2bc46d72afa61513983b777e2d49da618a35a4687bc75674b3a49ababd4e2e387661010d342fee86c7a73d259644985a263a6c2976e29a436d88921bb040b0
|
||||||
|
AUX libvirtd.confd-r5 740 BLAKE2B 74a069f4902dd1352f06029c886200615a35870ff88496c91956d23a3172db0789086622422f545498e92b7f8de41225022185fe291dd580cbacdeb783163f4b SHA512 98f935589dbc5f2a99329f77fdf84c563fa0dc99404b7476603679478d68ce8dbea2c88645251d3c28f59e7bcae124ae632972146e8a8c3e0e9fcbfb27296f91
|
||||||
|
AUX libvirtd.init-r19 1124 BLAKE2B 0effd71cd3dfda0892c37e4d6d69f5d6d02320a3f0793d4cf5490ef74868f0bb00ff8fbfc0ab4be057f56e40284c3f25b5821b1f6a34d0eccb1676a6d299aac8 SHA512 ba9bfe2c71d9c203857b69b7f6a84bea4a45c055e6627af351eec71faaf1ab043594ce35c31d853429f8b865373bdb76484357a492dd6c0e73631943c52c0fc0
|
||||||
|
AUX libvirtd.tmpfiles.conf 36 BLAKE2B fa0e1dac4117dcb2a2e826c82c4c63e20156db47abf4088167484f1f3149a4998840cf1aba745621851d7e2653df5c7f7268d8d61be3a3731ea053a88f35c13b SHA512 2b1c3c64dd6fa03d8c2ae24e7ce4aa7d754913214542a68a4e99f10fbc251fd23ee26e297a957d7b4b70eec8ef028c41fc915da3a85fbbd16143bb92d1de3aed
|
||||||
|
AUX virtlockd.init-r2 573 BLAKE2B 83bbd228bd59fa29f1d974bc5eec8af0b701328a0a64bbb9e2d9cb918d5d0b3c0d5e791afa18f47ffa2c429082083912fda3f2401c3c5b3d8d85ea8b7cacf440 SHA512 11bf7208e8da8cf7b907049100d095f4d6b5d215a0955fa620e50d6d541d3ecd9d779a7903c64feb25d17545c45491d52441e14a04f2c793f3b03dee7784c482
|
||||||
|
AUX virtlogd.init-r2 572 BLAKE2B e6a86e34eda78fc032df17e1bd94095e357770f4036e19fff895266b58df7e31774f6004fec56fad9e69bf7d1afa5d898bdebe018013877f8844d05b3a46d509 SHA512 d5d83edee8a4bdf0dac79abc129ff7ec11573aa580e32963d7c7d47133e276a4427d8653683fc8b0a6c1c2aba631e5875c73454d6fef3bcac6dcaca542e69f34
|
||||||
|
DIST libvirt-8.9.0.tar.xz 8946352 BLAKE2B 537b6badb6171110e99561613fb1318144991107139401296248afb747ae6f9cfafcd17b2292b8d8dcc9188ff4206035ea814efa6c129bae50c0518f61be9b81 SHA512 10426d45d55bb18e8e5d4327d698fbc6efd83c5f515ac40a0fcd72048a77936fe0b422ac14bce9966a65379d262df294c314f854a97861a223a0cbc6a8fd2382
|
||||||
|
DIST libvirt-8.9.0.tar.xz.asc 833 BLAKE2B a2054d0d9c8301aa0f8697253690b1ddd530a577bc789c7f38dc36a835134d0c8e5fc88536371c75da66afd9808540b9236e8d1247e4d7bd5f3a0aaf35c45f97 SHA512 087d5406ef23d6beee4a37e471d7d0aa433990b892f0beb7be76609fbdfcb69381acd59d63c62dcd2e2f9ccfcdefc35109cc175a0da4263e9b189981cb2baff1
|
||||||
|
EBUILD libvirt-8.9.0-r2.ebuild 9136 BLAKE2B 197b18ee1f588691bc0947f7783208adf726b442be95bddb80ed02e541b0d5b4ecec878f7c2a56019ecf55165a19bd7d2e0e0bb2e066887c441dd8ec57ed9eb5 SHA512 df61ed7e908741194f4aabb2eefd0be6c781787fcd0c962fcf34d939d7f72c51a77b7d4799763d86fdba64152e7988191971fc2952c6c1a9e89b7603e8eadfdd
|
||||||
|
MISC metadata.xml 3729 BLAKE2B 2e68676afb3820c7b8cd3d76b0a5c42886e246fc6b440ce49c71cbe60c124cdccd4ed8fb97f7153529b758d56dfba98b6a98a31b2fbff7e738f52bce796a3476 SHA512 0dfe519af8b740de9d41b1e2c40133026718a782b654a261c54cbe22b5f694cda8b73036c59411317757b73c40acaea77f70d7ab86ae8325e78d61151e6c64f1
|
58
app-emulation/libvirt/files/README.gentoo-r3
Normal file
58
app-emulation/libvirt/files/README.gentoo-r3
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
Important: The openrc libvirtd init script is now broken up into two
|
||||||
|
separate services: libvirtd, that solely handles the daemon, and
|
||||||
|
libvirt-guests, that takes care of clients during shutdown/restart of the
|
||||||
|
host. In order to reenable client handling, edit /etc/conf.d/libvirt-guests
|
||||||
|
and enable the service and start it:
|
||||||
|
|
||||||
|
$ rc-update add libvirt-guests
|
||||||
|
$ rc-service libvirt-guests start
|
||||||
|
|
||||||
|
|
||||||
|
For the basic networking support (bridged and routed networks) you don't
|
||||||
|
need any extra software. For more complex network modes including but not
|
||||||
|
limited to NATed network, you can enable the 'virt-network' USE flag. It
|
||||||
|
will pull in required runtime dependencies
|
||||||
|
|
||||||
|
|
||||||
|
If you are using dnsmasq on your system, you will have to configure
|
||||||
|
/etc/dnsmasq.conf to enable the following settings:
|
||||||
|
|
||||||
|
bind-interfaces
|
||||||
|
interface or except-interface
|
||||||
|
|
||||||
|
Otherwise you might have issues with your existing DNS server.
|
||||||
|
|
||||||
|
|
||||||
|
For openrc users:
|
||||||
|
|
||||||
|
Please use /etc/conf.d/libvirtd to control the '--listen' parameter for
|
||||||
|
libvirtd.
|
||||||
|
|
||||||
|
Use /etc/init.d/libvirt-guests to manage clients on restart/shutdown of
|
||||||
|
the host. The default configuration will suspend and resume running kvm
|
||||||
|
guests with 'managedsave'. This behavior can be changed under
|
||||||
|
/etc/conf.d/libvirt-guests
|
||||||
|
|
||||||
|
|
||||||
|
For systemd users:
|
||||||
|
|
||||||
|
The '--listen' parameter is unavailable when libvirtd is run as a
|
||||||
|
systemd unit.
|
||||||
|
|
||||||
|
The configuration for the 'libvirt-guests.service' is found under
|
||||||
|
/etc/libvirt/libvirt-guests.conf"
|
||||||
|
|
||||||
|
|
||||||
|
If you have built libvirt with policykit support, a new group "libvirt" has
|
||||||
|
been created. Simply add a user to the libvirt group in order to grant
|
||||||
|
administrative access to libvirtd. Alternatively, drop a custom policykit
|
||||||
|
rule into /etc/polkit-1/rules.d.
|
||||||
|
|
||||||
|
If you have built libvirt without policykit support (USE=-policykit), you
|
||||||
|
must change the unix sock group and/or perms in /etc/libvirt/libvirtd.conf
|
||||||
|
in order to allow normal users to connect to libvirtd.
|
||||||
|
|
||||||
|
|
||||||
|
If libvirt is built with USE=caps, libvirt will now start qemu/kvm VMs
|
||||||
|
with non-root privileges. Ensure any resources your VMs use are accessible
|
||||||
|
by qemu:qemu.
|
|
@ -0,0 +1,35 @@
|
||||||
|
From e97700d867ffa949c97f8a635a76b9ce510e806f Mon Sep 17 00:00:00 2001
|
||||||
|
Message-Id: <e97700d867ffa949c97f8a635a76b9ce510e806f.1580460243.git.mprivozn@redhat.com>
|
||||||
|
In-Reply-To: <5965f20fe0275b324c9b84ab7f48dd7db0494495.1580460243.git.mprivozn@redhat.com>
|
||||||
|
References: <5965f20fe0275b324c9b84ab7f48dd7db0494495.1580460243.git.mprivozn@redhat.com>
|
||||||
|
From: Michal Privoznik <mprivozn@redhat.com>
|
||||||
|
Date: Fri, 31 Jan 2020 09:42:14 +0100
|
||||||
|
Subject: [PATCH 2/3] Fix paths in libvirt-guests.sh.in
|
||||||
|
|
||||||
|
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||||||
|
---
|
||||||
|
tools/libvirt-guests.sh.in | 6 +++---
|
||||||
|
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/tools/libvirt-guests.sh.in b/tools/libvirt-guests.sh.in
|
||||||
|
index a881f6266e..79d38b3e9a 100644
|
||||||
|
--- a/tools/libvirt-guests.sh.in
|
||||||
|
+++ b/tools/libvirt-guests.sh.in
|
||||||
|
@@ -39,11 +39,11 @@ START_DELAY=0
|
||||||
|
BYPASS_CACHE=0
|
||||||
|
SYNC_TIME=0
|
||||||
|
|
||||||
|
-test -f "$sysconfdir"/sysconfig/libvirt-guests &&
|
||||||
|
- . "$sysconfdir"/sysconfig/libvirt-guests
|
||||||
|
+test -f "$sysconfdir"/libvirt/libvirt-guests.conf &&
|
||||||
|
+ . "$sysconfdir"/libvirt/libvirt-guests.conf
|
||||||
|
|
||||||
|
LISTFILE="$localstatedir"/lib/libvirt/libvirt-guests
|
||||||
|
-VAR_SUBSYS_LIBVIRT_GUESTS="$localstatedir"/lock/subsys/libvirt-guests
|
||||||
|
+VAR_SUBSYS_LIBVIRT_GUESTS="$localstatedir"/lock/libvirt-guests
|
||||||
|
|
||||||
|
RETVAL=0
|
||||||
|
|
||||||
|
--
|
||||||
|
2.24.1
|
||||||
|
|
|
@ -0,0 +1,211 @@
|
||||||
|
From 10d65f10a76c7478c4ec0c65ffeec7f4b18929f9 Mon Sep 17 00:00:00 2001
|
||||||
|
Message-Id: <10d65f10a76c7478c4ec0c65ffeec7f4b18929f9.1646212419.git.mprivozn@redhat.com>
|
||||||
|
From: Michal Privoznik <mprivozn@redhat.com>
|
||||||
|
Date: Wed, 2 Mar 2022 10:01:04 +0100
|
||||||
|
Subject: [PATCH] libvirt-8.2.0-do-not-use-sysconfig.patch
|
||||||
|
|
||||||
|
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||||||
|
---
|
||||||
|
src/interface/virtinterfaced.service.in | 1 -
|
||||||
|
src/libxl/virtxend.service.in | 1 -
|
||||||
|
src/locking/virtlockd.service.in | 1 -
|
||||||
|
src/logging/virtlogd.service.in | 3 +--
|
||||||
|
src/lxc/virtlxcd.service.in | 1 -
|
||||||
|
src/network/virtnetworkd.service.in | 1 -
|
||||||
|
src/node_device/virtnodedevd.service.in | 1 -
|
||||||
|
src/nwfilter/virtnwfilterd.service.in | 1 -
|
||||||
|
src/qemu/virtqemud.service.in | 1 -
|
||||||
|
src/remote/libvirtd.service.in | 1 -
|
||||||
|
src/remote/virtproxyd.service.in | 1 -
|
||||||
|
src/secret/virtsecretd.service.in | 1 -
|
||||||
|
src/storage/virtstoraged.service.in | 1 -
|
||||||
|
src/vbox/virtvboxd.service.in | 1 -
|
||||||
|
tools/libvirt-guests.service.in | 2 +-
|
||||||
|
15 files changed, 2 insertions(+), 16 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/interface/virtinterfaced.service.in b/src/interface/virtinterfaced.service.in
|
||||||
|
index cb860ff1c4..090b198ac7 100644
|
||||||
|
--- a/src/interface/virtinterfaced.service.in
|
||||||
|
+++ b/src/interface/virtinterfaced.service.in
|
||||||
|
@@ -14,7 +14,6 @@ Documentation=https://libvirt.org
|
||||||
|
[Service]
|
||||||
|
Type=notify
|
||||||
|
Environment=VIRTINTERFACED_ARGS="--timeout 120"
|
||||||
|
-EnvironmentFile=-@sysconfdir@/sysconfig/virtinterfaced
|
||||||
|
ExecStart=@sbindir@/virtinterfaced $VIRTINTERFACED_ARGS
|
||||||
|
ExecReload=/bin/kill -HUP $MAINPID
|
||||||
|
Restart=on-failure
|
||||||
|
diff --git a/src/libxl/virtxend.service.in b/src/libxl/virtxend.service.in
|
||||||
|
index 6b083c414f..597f5d1905 100644
|
||||||
|
--- a/src/libxl/virtxend.service.in
|
||||||
|
+++ b/src/libxl/virtxend.service.in
|
||||||
|
@@ -19,7 +19,6 @@ ConditionPathExists=/proc/xen/capabilities
|
||||||
|
[Service]
|
||||||
|
Type=notify
|
||||||
|
Environment=VIRTXEND_ARGS="--timeout 120"
|
||||||
|
-EnvironmentFile=-@sysconfdir@/sysconfig/virtxend
|
||||||
|
ExecStart=@sbindir@/virtxend $VIRTXEND_ARGS
|
||||||
|
ExecReload=/bin/kill -HUP $MAINPID
|
||||||
|
Restart=on-failure
|
||||||
|
diff --git a/src/locking/virtlockd.service.in b/src/locking/virtlockd.service.in
|
||||||
|
index 19271d1e7d..87193952cb 100644
|
||||||
|
--- a/src/locking/virtlockd.service.in
|
||||||
|
+++ b/src/locking/virtlockd.service.in
|
||||||
|
@@ -8,7 +8,6 @@ Documentation=https://libvirt.org
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Environment=VIRTLOCKD_ARGS=
|
||||||
|
-EnvironmentFile=-@sysconfdir@/sysconfig/virtlockd
|
||||||
|
ExecStart=@sbindir@/virtlockd $VIRTLOCKD_ARGS
|
||||||
|
ExecReload=/bin/kill -USR1 $MAINPID
|
||||||
|
# Losing the locks is a really bad thing that will
|
||||||
|
diff --git a/src/logging/virtlogd.service.in b/src/logging/virtlogd.service.in
|
||||||
|
index 8ab5478517..fe5c58b8ed 100644
|
||||||
|
--- a/src/logging/virtlogd.service.in
|
||||||
|
+++ b/src/logging/virtlogd.service.in
|
||||||
|
@@ -7,8 +7,7 @@ Documentation=man:virtlogd(8)
|
||||||
|
Documentation=https://libvirt.org
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
-EnvironmentFile=-@sysconfdir@/sysconfig/virtlogd
|
||||||
|
-ExecStart=@sbindir@/virtlogd $VIRTLOGD_ARGS
|
||||||
|
+ExecStart=@sbindir@/virtlogd
|
||||||
|
ExecReload=/bin/kill -USR1 $MAINPID
|
||||||
|
# Losing the logs is a really bad thing that will
|
||||||
|
# cause the machine to be fenced (rebooted), so make
|
||||||
|
diff --git a/src/lxc/virtlxcd.service.in b/src/lxc/virtlxcd.service.in
|
||||||
|
index 334c34db44..1b9689017e 100644
|
||||||
|
--- a/src/lxc/virtlxcd.service.in
|
||||||
|
+++ b/src/lxc/virtlxcd.service.in
|
||||||
|
@@ -19,7 +19,6 @@ Documentation=https://libvirt.org
|
||||||
|
[Service]
|
||||||
|
Type=notify
|
||||||
|
Environment=VIRTLXCD_ARGS="--timeout 120"
|
||||||
|
-EnvironmentFile=-@sysconfdir@/sysconfig/virtlxcd
|
||||||
|
ExecStart=@sbindir@/virtlxcd $VIRTLXCD_ARGS
|
||||||
|
ExecReload=/bin/kill -HUP $MAINPID
|
||||||
|
KillMode=process
|
||||||
|
diff --git a/src/network/virtnetworkd.service.in b/src/network/virtnetworkd.service.in
|
||||||
|
index 05ce672b73..ee4cd9bca1 100644
|
||||||
|
--- a/src/network/virtnetworkd.service.in
|
||||||
|
+++ b/src/network/virtnetworkd.service.in
|
||||||
|
@@ -17,7 +17,6 @@ Documentation=https://libvirt.org
|
||||||
|
[Service]
|
||||||
|
Type=notify
|
||||||
|
Environment=VIRTNETWORKD_ARGS="--timeout 120"
|
||||||
|
-EnvironmentFile=-@sysconfdir@/sysconfig/virtnetworkd
|
||||||
|
ExecStart=@sbindir@/virtnetworkd $VIRTNETWORKD_ARGS
|
||||||
|
ExecReload=/bin/kill -HUP $MAINPID
|
||||||
|
Restart=on-failure
|
||||||
|
diff --git a/src/node_device/virtnodedevd.service.in b/src/node_device/virtnodedevd.service.in
|
||||||
|
index cd9de362fd..7693aa52c4 100644
|
||||||
|
--- a/src/node_device/virtnodedevd.service.in
|
||||||
|
+++ b/src/node_device/virtnodedevd.service.in
|
||||||
|
@@ -14,7 +14,6 @@ Documentation=https://libvirt.org
|
||||||
|
[Service]
|
||||||
|
Type=notify
|
||||||
|
Environment=VIRTNODEDEVD_ARGS="--timeout 120"
|
||||||
|
-EnvironmentFile=-@sysconfdir@/sysconfig/virtnodedevd
|
||||||
|
ExecStart=@sbindir@/virtnodedevd $VIRTNODEDEVD_ARGS
|
||||||
|
ExecReload=/bin/kill -HUP $MAINPID
|
||||||
|
Restart=on-failure
|
||||||
|
diff --git a/src/nwfilter/virtnwfilterd.service.in b/src/nwfilter/virtnwfilterd.service.in
|
||||||
|
index ab65419e0c..16d8b377b0 100644
|
||||||
|
--- a/src/nwfilter/virtnwfilterd.service.in
|
||||||
|
+++ b/src/nwfilter/virtnwfilterd.service.in
|
||||||
|
@@ -14,7 +14,6 @@ Documentation=https://libvirt.org
|
||||||
|
[Service]
|
||||||
|
Type=notify
|
||||||
|
Environment=VIRTNWFILTERD_ARGS="--timeout 120"
|
||||||
|
-EnvironmentFile=-@sysconfdir@/sysconfig/virtnwfilterd
|
||||||
|
ExecStart=@sbindir@/virtnwfilterd $VIRTNWFILTERD_ARGS
|
||||||
|
ExecReload=/bin/kill -HUP $MAINPID
|
||||||
|
Restart=on-failure
|
||||||
|
diff --git a/src/qemu/virtqemud.service.in b/src/qemu/virtqemud.service.in
|
||||||
|
index 5ad968ace9..c63147d31f 100644
|
||||||
|
--- a/src/qemu/virtqemud.service.in
|
||||||
|
+++ b/src/qemu/virtqemud.service.in
|
||||||
|
@@ -21,7 +21,6 @@ Documentation=https://libvirt.org
|
||||||
|
[Service]
|
||||||
|
Type=notify
|
||||||
|
Environment=VIRTQEMUD_ARGS="--timeout 120"
|
||||||
|
-EnvironmentFile=-@sysconfdir@/sysconfig/virtqemud
|
||||||
|
ExecStart=@sbindir@/virtqemud $VIRTQEMUD_ARGS
|
||||||
|
ExecReload=/bin/kill -HUP $MAINPID
|
||||||
|
KillMode=process
|
||||||
|
diff --git a/src/remote/libvirtd.service.in b/src/remote/libvirtd.service.in
|
||||||
|
index 5d4d412fcc..27cfc34b90 100644
|
||||||
|
--- a/src/remote/libvirtd.service.in
|
||||||
|
+++ b/src/remote/libvirtd.service.in
|
||||||
|
@@ -29,7 +29,6 @@ Documentation=https://libvirt.org
|
||||||
|
[Service]
|
||||||
|
Type=notify
|
||||||
|
Environment=LIBVIRTD_ARGS="--timeout 120"
|
||||||
|
-EnvironmentFile=-@sysconfdir@/sysconfig/libvirtd
|
||||||
|
ExecStart=@sbindir@/libvirtd $LIBVIRTD_ARGS
|
||||||
|
ExecReload=/bin/kill -HUP $MAINPID
|
||||||
|
KillMode=process
|
||||||
|
diff --git a/src/remote/virtproxyd.service.in b/src/remote/virtproxyd.service.in
|
||||||
|
index f9bb6b84a9..0eddf5ee93 100644
|
||||||
|
--- a/src/remote/virtproxyd.service.in
|
||||||
|
+++ b/src/remote/virtproxyd.service.in
|
||||||
|
@@ -14,7 +14,6 @@ Documentation=https://libvirt.org
|
||||||
|
[Service]
|
||||||
|
Type=notify
|
||||||
|
Environment=VIRTPROXYD_ARGS="--timeout 120"
|
||||||
|
-EnvironmentFile=-@sysconfdir@/sysconfig/virtproxyd
|
||||||
|
ExecStart=@sbindir@/virtproxyd $VIRTPROXYD_ARGS
|
||||||
|
ExecReload=/bin/kill -HUP $MAINPID
|
||||||
|
Restart=on-failure
|
||||||
|
diff --git a/src/secret/virtsecretd.service.in b/src/secret/virtsecretd.service.in
|
||||||
|
index 6d298c5334..92e54f175f 100644
|
||||||
|
--- a/src/secret/virtsecretd.service.in
|
||||||
|
+++ b/src/secret/virtsecretd.service.in
|
||||||
|
@@ -14,7 +14,6 @@ Documentation=https://libvirt.org
|
||||||
|
[Service]
|
||||||
|
Type=notify
|
||||||
|
Environment=VIRTSECRETD_ARGS="--timeout 120"
|
||||||
|
-EnvironmentFile=-@sysconfdir@/sysconfig/virtsecretd
|
||||||
|
ExecStart=@sbindir@/virtsecretd $VIRTSECRETD_ARGS
|
||||||
|
ExecReload=/bin/kill -HUP $MAINPID
|
||||||
|
Restart=on-failure
|
||||||
|
diff --git a/src/storage/virtstoraged.service.in b/src/storage/virtstoraged.service.in
|
||||||
|
index eda4d86d37..abe91e3d80 100644
|
||||||
|
--- a/src/storage/virtstoraged.service.in
|
||||||
|
+++ b/src/storage/virtstoraged.service.in
|
||||||
|
@@ -16,7 +16,6 @@ Documentation=https://libvirt.org
|
||||||
|
[Service]
|
||||||
|
Type=notify
|
||||||
|
Environment=VIRTSTORAGED_ARGS="--timeout 120"
|
||||||
|
-EnvironmentFile=-@sysconfdir@/sysconfig/virtstoraged
|
||||||
|
ExecStart=@sbindir@/virtstoraged $VIRTSTORAGED_ARGS
|
||||||
|
ExecReload=/bin/kill -HUP $MAINPID
|
||||||
|
Restart=on-failure
|
||||||
|
diff --git a/src/vbox/virtvboxd.service.in b/src/vbox/virtvboxd.service.in
|
||||||
|
index 6f447276e9..54fbd0be4a 100644
|
||||||
|
--- a/src/vbox/virtvboxd.service.in
|
||||||
|
+++ b/src/vbox/virtvboxd.service.in
|
||||||
|
@@ -15,7 +15,6 @@ Documentation=https://libvirt.org
|
||||||
|
[Service]
|
||||||
|
Type=notify
|
||||||
|
Environment=VIRTVBOXD_ARGS="--timeout 120"
|
||||||
|
-EnvironmentFile=-@sysconfdir@/sysconfig/virtvboxd
|
||||||
|
ExecStart=@sbindir@/virtvboxd $VIRTVBOXD_ARGS
|
||||||
|
ExecReload=/bin/kill -HUP $MAINPID
|
||||||
|
Restart=on-failure
|
||||||
|
diff --git a/tools/libvirt-guests.service.in b/tools/libvirt-guests.service.in
|
||||||
|
index 3cf6476196..5668009ae4 100644
|
||||||
|
--- a/tools/libvirt-guests.service.in
|
||||||
|
+++ b/tools/libvirt-guests.service.in
|
||||||
|
@@ -20,7 +20,7 @@ Documentation=man:libvirt-guests(8)
|
||||||
|
Documentation=https://libvirt.org
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
-EnvironmentFile=-@sysconfdir@/sysconfig/libvirt-guests
|
||||||
|
+EnvironmentFile=-/etc/libvirt/libvirt-guests.conf
|
||||||
|
# Hack just call traditional service until we factor
|
||||||
|
# out the code
|
||||||
|
ExecStart=@libexecdir@/libvirt-guests.sh start
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
|
@ -0,0 +1,68 @@
|
||||||
|
From 52ecc3247d72e2a5ffc390093d803f59e20087f6 Mon Sep 17 00:00:00 2001
|
||||||
|
Message-Id: <52ecc3247d72e2a5ffc390093d803f59e20087f6.1647318231.git.mprivozn@redhat.com>
|
||||||
|
From: Michal Privoznik <mprivozn@redhat.com>
|
||||||
|
Date: Tue, 15 Mar 2022 05:23:29 +0100
|
||||||
|
Subject: [PATCH] libvirt-8.2.0-fix-paths-for-apparmor.patch
|
||||||
|
|
||||||
|
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||||||
|
---
|
||||||
|
diff --git a/src/security/apparmor/libvirt-qemu b/src/security/apparmor/libvirt-qemu
|
||||||
|
index 44056b5f14..1f0db2cda2 100644
|
||||||
|
--- a/src/security/apparmor/libvirt-qemu
|
||||||
|
+++ b/src/security/apparmor/libvirt-qemu
|
||||||
|
@@ -96,6 +96,7 @@
|
||||||
|
/usr/share/sgabios/** r,
|
||||||
|
/usr/share/slof/** r,
|
||||||
|
/usr/share/vgabios/** r,
|
||||||
|
+ /usr/share/seavgabios/** r,
|
||||||
|
|
||||||
|
# pki for libvirt-vnc and libvirt-spice (LP: #901272, #1690140)
|
||||||
|
/etc/pki/CA/ r,
|
||||||
|
diff --git a/src/security/apparmor/meson.build b/src/security/apparmor/meson.build
|
||||||
|
index 58b4024b85..c77b32665d 100644
|
||||||
|
--- a/src/security/apparmor/meson.build
|
||||||
|
+++ b/src/security/apparmor/meson.build
|
||||||
|
@@ -1,5 +1,5 @@
|
||||||
|
apparmor_gen_profiles = [
|
||||||
|
- 'usr.lib.libvirt.virt-aa-helper',
|
||||||
|
+ 'usr.libexec.libvirt.virt-aa-helper',
|
||||||
|
'usr.sbin.libvirtd',
|
||||||
|
'usr.sbin.virtqemud',
|
||||||
|
'usr.sbin.virtxend',
|
||||||
|
@@ -35,7 +35,7 @@ install_data(
|
||||||
|
)
|
||||||
|
|
||||||
|
install_data(
|
||||||
|
- 'usr.lib.libvirt.virt-aa-helper.local',
|
||||||
|
+ 'usr.libexec.libvirt.virt-aa-helper.local',
|
||||||
|
install_dir: apparmor_dir / 'local',
|
||||||
|
- rename: 'usr.lib.libvirt.virt-aa-helper',
|
||||||
|
+ rename: 'usr.libexec.libvirt.virt-aa-helper',
|
||||||
|
)
|
||||||
|
diff --git a/src/security/apparmor/usr.lib.libvirt.virt-aa-helper.in b/src/security/apparmor/usr.libexec.libvirt.virt-aa-helper.in
|
||||||
|
similarity index 94%
|
||||||
|
rename from src/security/apparmor/usr.lib.libvirt.virt-aa-helper.in
|
||||||
|
rename to src/security/apparmor/usr.libexec.libvirt.virt-aa-helper.in
|
||||||
|
index ff1d46bebe..6beedde1b1 100644
|
||||||
|
--- a/src/security/apparmor/usr.lib.libvirt.virt-aa-helper.in
|
||||||
|
+++ b/src/security/apparmor/usr.libexec.libvirt.virt-aa-helper.in
|
||||||
|
@@ -41,7 +41,7 @@ profile virt-aa-helper @libexecdir@/virt-aa-helper {
|
||||||
|
deny /dev/mapper/* r,
|
||||||
|
|
||||||
|
@libexecdir@/virt-aa-helper mr,
|
||||||
|
- /{usr/,}sbin/apparmor_parser Ux,
|
||||||
|
+ /{usr/,}{s,}bin/apparmor_parser Ux,
|
||||||
|
|
||||||
|
@sysconfdir@/apparmor.d/libvirt/* r,
|
||||||
|
@sysconfdir@/apparmor.d/libvirt/libvirt-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]* rw,
|
||||||
|
@@ -71,5 +71,5 @@ profile virt-aa-helper @libexecdir@/virt-aa-helper {
|
||||||
|
/**.[iI][sS][oO] r,
|
||||||
|
/**/disk{,.*} r,
|
||||||
|
|
||||||
|
- #include <local/usr.lib.libvirt.virt-aa-helper>
|
||||||
|
+ #include <local/usr.libexec.libvirt.virt-aa-helper>
|
||||||
|
}
|
||||||
|
diff --git a/src/security/apparmor/usr.lib.libvirt.virt-aa-helper.local b/src/security/apparmor/usr.libexec.libvirt.virt-aa-helper.local
|
||||||
|
similarity index 100%
|
||||||
|
rename from src/security/apparmor/usr.lib.libvirt.virt-aa-helper.local
|
||||||
|
rename to src/security/apparmor/usr.libexec.libvirt.virt-aa-helper.local
|
|
@ -0,0 +1,53 @@
|
||||||
|
From 743fdb97c81f38adc6e9b55f402244f7982352f4 Mon Sep 17 00:00:00 2001
|
||||||
|
Message-Id: <743fdb97c81f38adc6e9b55f402244f7982352f4.1679396460.git.mprivozn@redhat.com>
|
||||||
|
From: Michal Privoznik <mprivozn@redhat.com>
|
||||||
|
Date: Mon, 20 Mar 2023 13:38:27 +0100
|
||||||
|
Subject: [PATCH] meson: Stop detecting -Wl,--version-script=
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
With its version 16.0, the LLVM's linker turned on
|
||||||
|
--no-undefined-version by default [1]. This breaks how we detect
|
||||||
|
--version-script= detection, because at the compile time there's
|
||||||
|
no library built yet that we can use to make --version-script=
|
||||||
|
happy. Unfortunately, meson does not provide a way to detect this
|
||||||
|
either [2].
|
||||||
|
|
||||||
|
But there's not much sense in detecting the argument either. We
|
||||||
|
already special case some systems (windows, darwin) and do the
|
||||||
|
check for others, which are expected to support versioned
|
||||||
|
symbols, because of ELF. Worst case scenario - the error is
|
||||||
|
reported during compile time rather than configure time.
|
||||||
|
|
||||||
|
1: https://reviews.llvm.org/D135402
|
||||||
|
2: https://github.com/mesonbuild/meson/issues/3047
|
||||||
|
|
||||||
|
Resolves: https://bugs.gentoo.org/902211
|
||||||
|
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||||||
|
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
|
||||||
|
---
|
||||||
|
meson.build | 7 +------
|
||||||
|
1 file changed, 1 insertion(+), 6 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/meson.build b/meson.build
|
||||||
|
index c35823a79a..a0682e8d0b 100644
|
||||||
|
--- a/meson.build
|
||||||
|
+++ b/meson.build
|
||||||
|
@@ -534,12 +534,7 @@ elif host_machine.system() == 'darwin'
|
||||||
|
# macOS libraries don't support symbol versioning
|
||||||
|
version_script_flags = ''
|
||||||
|
else
|
||||||
|
- test_file = '@0@/src/libvirt_qemu.syms'.format(meson.project_source_root())
|
||||||
|
- if cc.has_link_argument('-Wl,--version-script=@0@'.format(test_file))
|
||||||
|
- version_script_flags = '-Wl,--version-script='
|
||||||
|
- else
|
||||||
|
- error('No supported version script link argument found.')
|
||||||
|
- endif
|
||||||
|
+ version_script_flags = '-Wl,--version-script='
|
||||||
|
endif
|
||||||
|
|
||||||
|
libvirt_flat_namespace = []
|
||||||
|
--
|
||||||
|
2.39.2
|
||||||
|
|
68
app-emulation/libvirt/files/libvirt-guests.confd
Normal file
68
app-emulation/libvirt/files/libvirt-guests.confd
Normal file
|
@ -0,0 +1,68 @@
|
||||||
|
# /etc/conf.d/libvirtd
|
||||||
|
|
||||||
|
# LIBVIRT_URIS
|
||||||
|
# space separated list of libvirt URIs to communicate with to start/stop guests
|
||||||
|
# Valid values are anything that can be passed to 'virsh connect'
|
||||||
|
|
||||||
|
#LIBVIRT_URIS="qemu:///system"
|
||||||
|
|
||||||
|
|
||||||
|
# LIBVIRT_SHUTDOWN
|
||||||
|
# Valid options:
|
||||||
|
# * managedsave - Performs a state save external to the VM (for hypervisors
|
||||||
|
# supporting this operation). qemu-kvm will stop the CPU
|
||||||
|
# and save off all state to a separate file. When the
|
||||||
|
# machine is started again, it will resume like nothing
|
||||||
|
# ever happened. This is guarenteed to always successfully
|
||||||
|
# stop your machine and restart it.
|
||||||
|
#
|
||||||
|
# * shutdown - Sends an ACPI shutdown (think of this as a request to
|
||||||
|
# your guest to shutdown). There is no way to distinguish
|
||||||
|
# between guests that are ignoring the shutdown request or
|
||||||
|
# are stuck or are taking a long time to shutdown. We will
|
||||||
|
# wait LIBVIRT_MAXWAIT seconds before yanking the power
|
||||||
|
# out.
|
||||||
|
#
|
||||||
|
# * destroy - Immediately stop all running guests. Use with caution as
|
||||||
|
# this can leave the guest in a corrupted state and might
|
||||||
|
# lead to data loss.
|
||||||
|
#
|
||||||
|
|
||||||
|
#LIBVIRT_SHUTDOWN="managedsave"
|
||||||
|
|
||||||
|
|
||||||
|
# LIBVIRT_MAXWAIT
|
||||||
|
# Timeout in seconds until stopping a guest and "pulling the plug" on the
|
||||||
|
# guest
|
||||||
|
# Valid values are any integer over 0
|
||||||
|
|
||||||
|
#LIBVIRT_MAXWAIT="500"
|
||||||
|
|
||||||
|
|
||||||
|
# LIBVIRT_START
|
||||||
|
# If this value is set to 'no', then guests and networks that were shutdown
|
||||||
|
# by this script when it was stopped will not be started when it is started
|
||||||
|
# back up.
|
||||||
|
# Valid values are yes or no
|
||||||
|
|
||||||
|
#LIBVIRT_START="yes"
|
||||||
|
|
||||||
|
|
||||||
|
# LIBVIRT_IGNORE_AUTOSTART
|
||||||
|
# If the VM is marked for autostart in its XML configuration then we won't
|
||||||
|
# save its start when the init script is stopped. The result is that when
|
||||||
|
# the init script starts back up, no attempt will be made to start the VM or
|
||||||
|
# confirm it is started.
|
||||||
|
# Valid values are yes or no
|
||||||
|
|
||||||
|
#LIBVIRT_IGNORE_AUTOSTART="no"
|
||||||
|
|
||||||
|
|
||||||
|
# LIBVIRT_NET_SHUTDOWN
|
||||||
|
# If libvirtd created networks for you (e.g. NATed networks) then this init
|
||||||
|
# script will shut them down for you if this is set to 'yes'. Otherwise,
|
||||||
|
# the networks will be left running. For this option to be useful you must
|
||||||
|
# have enabled the 'virt-network' USE flag and have had libvirt create a
|
||||||
|
# NATed network for you. Valid values: 'yes' or 'no'
|
||||||
|
|
||||||
|
#LIBVIRT_NET_SHUTDOWN="yes"
|
237
app-emulation/libvirt/files/libvirt-guests.init-r4
Normal file
237
app-emulation/libvirt/files/libvirt-guests.init-r4
Normal file
|
@ -0,0 +1,237 @@
|
||||||
|
#!/sbin/openrc-run
|
||||||
|
|
||||||
|
description="Virtual Machine Management (libvirt) Guests"
|
||||||
|
|
||||||
|
depend() {
|
||||||
|
use libvirtd
|
||||||
|
}
|
||||||
|
|
||||||
|
# set the default to QEMU
|
||||||
|
[ -z "${LIBVIRT_URIS}" ] && LIBVIRT_URIS="qemu:///system"
|
||||||
|
|
||||||
|
# default to suspending the VM via managedsave
|
||||||
|
case "${LIBVIRT_SHUTDOWN}" in
|
||||||
|
managedsave|shutdown|destroy) ;;
|
||||||
|
*) LIBVIRT_SHUTDOWN="managedsave" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# default to 500 seconds
|
||||||
|
[ -z ${LIBVIRT_MAXWAIT} ] && LIBVIRT_MAXWAIT=500
|
||||||
|
|
||||||
|
gueststatefile="/var/lib/libvirt/libvirt-guests.state"
|
||||||
|
netstatefile="/var/lib/libvirt/libvirt-net.state"
|
||||||
|
|
||||||
|
do_virsh() {
|
||||||
|
local hvuri=$1
|
||||||
|
shift
|
||||||
|
|
||||||
|
# if unset, default to qemu
|
||||||
|
[ -z ${hvuri} ] && hvuri="qemu:///system"
|
||||||
|
# if only qemu was supplied then correct the value
|
||||||
|
[ "xqemu" = x${hvuri} ] && hvuri="qemu:///system"
|
||||||
|
|
||||||
|
# Silence errors because virsh always throws an error about
|
||||||
|
# not finding the hypervisor version when connecting to libvirtd
|
||||||
|
# lastly strip the blank line at the end
|
||||||
|
LC_ALL=C virsh -c ${hvuri} "$@" 2>/dev/null | head -n -1
|
||||||
|
}
|
||||||
|
|
||||||
|
libvirtd_dom_list() {
|
||||||
|
# Only work with domains by their UUIDs
|
||||||
|
local hvuri=$1
|
||||||
|
shift
|
||||||
|
|
||||||
|
# The grep is to remove dom0 for xen domains. Otherwise we never hit 0
|
||||||
|
do_virsh "${hvuri}" list --uuid $@ | grep -v 00000000-0000-0000-0000-000000000000
|
||||||
|
}
|
||||||
|
|
||||||
|
libvirtd_dom_count() {
|
||||||
|
local hvuri=$1
|
||||||
|
shift
|
||||||
|
|
||||||
|
libvirtd_dom_list "${hvuri}" $@ | wc -l
|
||||||
|
}
|
||||||
|
|
||||||
|
libvirtd_net_list() {
|
||||||
|
# Only work with networks by their UUIDs
|
||||||
|
local hvuri=$1
|
||||||
|
shift
|
||||||
|
|
||||||
|
do_virsh "${hvuri}" net-list --uuid $@
|
||||||
|
}
|
||||||
|
|
||||||
|
libvirtd_net_count() {
|
||||||
|
local hvuri=$1
|
||||||
|
shift
|
||||||
|
|
||||||
|
libvirtd_net_list "${hvuri}" $@ | wc -l
|
||||||
|
}
|
||||||
|
|
||||||
|
libvirtd_dom_stop() {
|
||||||
|
# stops all persistent or transient domains for a given URI
|
||||||
|
# $1 - uri
|
||||||
|
# $2 - persisent/transient
|
||||||
|
|
||||||
|
local uri=$1
|
||||||
|
local persist=$2
|
||||||
|
local shutdown_type=${LIBVIRT_SHUTDOWN}
|
||||||
|
local counter=${LIBVIRT_MAXWAIT}
|
||||||
|
local dom_name=
|
||||||
|
local dom_as=
|
||||||
|
local dom_ids=
|
||||||
|
local uuid=
|
||||||
|
local dom_count=
|
||||||
|
|
||||||
|
[ "${persist}" = "--transient" ] && shutdown_type="shutdown"
|
||||||
|
[ -n "${counter}" ] || counter=500
|
||||||
|
|
||||||
|
einfo " Shutting down domain(s) ..."
|
||||||
|
|
||||||
|
# grab all persistent or transient domains running
|
||||||
|
dom_ids=$(libvirtd_dom_list ${uri} ${persist})
|
||||||
|
|
||||||
|
for uuid in ${dom_ids}; do
|
||||||
|
# Get the name
|
||||||
|
dom_name=$(do_virsh ${uri} domname ${uuid})
|
||||||
|
einfo " ${dom_name}"
|
||||||
|
# Get autostart state
|
||||||
|
dom_as=$(do_virsh ${uri} dominfo ${uuid} | \
|
||||||
|
awk '$1 == "Autostart:" { print $2 }')
|
||||||
|
|
||||||
|
if [ "${persist}" = "--persistent" ]; then
|
||||||
|
# Save our running state only if LIBVIRT_IGNORE_AUTOSTART != yes
|
||||||
|
if [ "x${LIBVIRT_IGNORE_AUTOSTART}" = "xyes" ] && \
|
||||||
|
[ ${dom_as} = "enabled" ]; then
|
||||||
|
:
|
||||||
|
else
|
||||||
|
echo "${uri} ${uuid}" >> ${gueststatefile}
|
||||||
|
fi
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Now let's stop it
|
||||||
|
do_virsh "${uri}" ${shutdown_type} ${uuid} > /dev/null
|
||||||
|
|
||||||
|
done
|
||||||
|
|
||||||
|
dom_count="$(libvirtd_dom_count ${uri} ${persist})"
|
||||||
|
while [ ${dom_count} -gt 0 ] && [ ${counter} -gt 0 ] ; do
|
||||||
|
dom_count="$(libvirtd_dom_count ${uri} ${persist})"
|
||||||
|
sleep 1
|
||||||
|
if [ "${shutdown_type}" = "shutdown" ]; then
|
||||||
|
counter=$((${counter} - 1))
|
||||||
|
fi
|
||||||
|
printf "."
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ "${shutdown_type}" = "shutdown" ]; then
|
||||||
|
# grab all domains still running
|
||||||
|
dom_ids=$(libvirtd_dom_list ${uri} ${persist})
|
||||||
|
for uuid in ${dom_ids}; do
|
||||||
|
dom_name=$(do_virsh ${uri} domname ${uuid})
|
||||||
|
eerror " ${dom_name} forcibly stopped"
|
||||||
|
do_virsh "${uri}" destroy ${uuid} > /dev/null
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
libvirtd_net_stop() {
|
||||||
|
# stops all persistent or transient domains for a given URI
|
||||||
|
# $1 - uri
|
||||||
|
# $2 - persisent/transient
|
||||||
|
|
||||||
|
local uri=$1
|
||||||
|
local persist=$2
|
||||||
|
local uuid=
|
||||||
|
local net_name=
|
||||||
|
|
||||||
|
if [ "${LIBVIRT_NET_SHUTDOWN}" != "no" ]; then
|
||||||
|
|
||||||
|
einfo " Shutting down network(s):"
|
||||||
|
for uuid in $(libvirtd_net_list ${uri} ${persist}); do
|
||||||
|
net_name=$(do_virsh ${uri} net-name ${uuid})
|
||||||
|
einfo " ${net_name}"
|
||||||
|
|
||||||
|
if [ "${persist}" = "--persistent" ]; then
|
||||||
|
# Save our running state
|
||||||
|
echo "${uri} ${uuid}" >> ${netstatefile}
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Actually stop the network
|
||||||
|
do_virsh qemu net-destroy ${uuid} > /dev/null
|
||||||
|
done
|
||||||
|
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
start() {
|
||||||
|
local uri=
|
||||||
|
local uuid=
|
||||||
|
local name=
|
||||||
|
|
||||||
|
for uri in ${LIBVIRT_URIS}; do
|
||||||
|
do_virsh "${uri}" connect
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
eerror "Failed to connect to '${uri}'. Domains may not start."
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
[ ! -e "${netstatefile}" ] && touch "${netstatefile}"
|
||||||
|
[ ! -e "${gueststatefile}" ] && touch "${gueststatefile}"
|
||||||
|
|
||||||
|
# if the user didn't want to start any guests up then respect their wish
|
||||||
|
[ "x${LIBVIRT_START}" = "xno" ] && return 0
|
||||||
|
|
||||||
|
# start networks
|
||||||
|
ebegin "Starting libvirt networks"
|
||||||
|
while read -r uri uuid
|
||||||
|
do
|
||||||
|
# ignore trash
|
||||||
|
[ -z "${uri}" ] || [ -z "${uuid}" ] && continue
|
||||||
|
|
||||||
|
name=$(do_virsh "${uri}" net-name ${uuid})
|
||||||
|
einfo " ${name}"
|
||||||
|
do_virsh "${uri}" net-start ${uuid} > /dev/null
|
||||||
|
done <"${netstatefile}"
|
||||||
|
eend 0
|
||||||
|
|
||||||
|
# start domains
|
||||||
|
ebegin "Starting libvirt domains"
|
||||||
|
while read -r uri uuid
|
||||||
|
do
|
||||||
|
# ignore trash
|
||||||
|
[ -z "${uri}" ] || [ -z "${uuid}" ] && continue
|
||||||
|
|
||||||
|
name=$(do_virsh "${uri}" domname ${uuid})
|
||||||
|
einfo " ${name}"
|
||||||
|
do_virsh "${uri}" start ${uuid} > /dev/null
|
||||||
|
do_virsh "${uri}" domtime --sync ${uuid} > /dev/null
|
||||||
|
done <"${gueststatefile}"
|
||||||
|
eend 0
|
||||||
|
}
|
||||||
|
|
||||||
|
stop() {
|
||||||
|
local counter=
|
||||||
|
local dom_name=
|
||||||
|
local net_name=
|
||||||
|
local dom_ids=
|
||||||
|
local uuid=
|
||||||
|
local dom_count=
|
||||||
|
|
||||||
|
rm -f "${gueststatefile}"
|
||||||
|
[ $? -ne 0 ] && eerror "Unable to save domain state"
|
||||||
|
rm -f "${netstatefile}"
|
||||||
|
[ $? -ne 0 ] && eerror "Unable to save net state"
|
||||||
|
|
||||||
|
for uri in ${LIBVIRT_URIS}; do
|
||||||
|
einfo "Stopping libvirt domains and networks for ${uri}"
|
||||||
|
|
||||||
|
libvirtd_dom_stop "${uri}" "--persistent"
|
||||||
|
libvirtd_dom_stop "${uri}" "--transient"
|
||||||
|
libvirtd_net_stop "${uri}" "--persistent"
|
||||||
|
libvirtd_net_stop "${uri}" "--transient"
|
||||||
|
|
||||||
|
einfo "Done stopping domains and networks for ${uri}"
|
||||||
|
done
|
||||||
|
}
|
18
app-emulation/libvirt/files/libvirtd.confd-r5
Normal file
18
app-emulation/libvirt/files/libvirtd.confd-r5
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
# /etc/conf.d/libvirtd
|
||||||
|
|
||||||
|
# Startup dependency
|
||||||
|
# libvirtd typically requires all networks to be up and settled which
|
||||||
|
# is what rc_need="net" provides. However if you only use specific networks
|
||||||
|
# for libvirtd, you may override this. Or if you only use libvirtd locally.
|
||||||
|
rc_need="net"
|
||||||
|
|
||||||
|
# The termination timeout (start-stop-daemon parameter "retry") ensures
|
||||||
|
# that the service will be terminated within a given time (25 + 5 seconds
|
||||||
|
# per default) when you are stopping the service.
|
||||||
|
#LIBVIRTD_TERMTIMEOUT="TERM/25/KILL/5"
|
||||||
|
|
||||||
|
# LIBVIRTD_OPTS
|
||||||
|
# You may want to add '--listen' to have libvirtd listen for tcp/ip connections
|
||||||
|
# if you want to use libvirt for remote control
|
||||||
|
# Please consult 'libvirtd --help' for more options
|
||||||
|
#LIBVIRTD_OPTS="--listen"
|
33
app-emulation/libvirt/files/libvirtd.init-r19
Normal file
33
app-emulation/libvirt/files/libvirtd.init-r19
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
#!/sbin/openrc-run
|
||||||
|
# Copyright 1999-2020 Gentoo Authors
|
||||||
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
|
||||||
|
description="Virtual Machine Management daemon (libvirt)"
|
||||||
|
|
||||||
|
LIBVIRTD_OPTS=${LIBVIRTD_OPTS:-"${LIBVIRTD_OPTS}"}
|
||||||
|
LIBVIRTD_TIMEOUT=${LIBVIRTD_TERMTIMEOUT:-"TERM/25/KILL/5"}
|
||||||
|
|
||||||
|
command="/usr/sbin/libvirtd"
|
||||||
|
command_args="${LIBVIRTD_OPTS}"
|
||||||
|
start_stop_daemon_args="-b --env KRB5_KTNAME=/etc/libvirt/krb5.tab"
|
||||||
|
pidfile="/run/libvirtd.pid"
|
||||||
|
retry="${LIBVIRTD_TERMTIMEOUT}"
|
||||||
|
|
||||||
|
depend() {
|
||||||
|
need virtlogd
|
||||||
|
use ceph dbus iscsid virtlockd
|
||||||
|
after cgconfig corosync ebtables iptables ip6tables shorewall nfs nfsmount ntp-client ntpdportmap rpc.statd sanlock xenconsoled
|
||||||
|
USE_FLAG_FIREWALLD
|
||||||
|
}
|
||||||
|
|
||||||
|
start_pre() {
|
||||||
|
# Test configuration directories in /etc/libvirt/ to be either not
|
||||||
|
# present or a directory, i.e. not a regular file, bug #532892
|
||||||
|
|
||||||
|
checkpath --directory /etc/libvirt/lxc || return 1
|
||||||
|
checkpath --directory /etc/libvirt/nwfilter || return 1
|
||||||
|
[ -L /etc/libvirt/qemu ] ||
|
||||||
|
checkpath --directory /etc/libvirt/qemu || return 1
|
||||||
|
[ -L /etc/libvirt/storage ] ||
|
||||||
|
checkpath --directory /etc/libvirt/storage || return 1
|
||||||
|
}
|
1
app-emulation/libvirt/files/libvirtd.tmpfiles.conf
Normal file
1
app-emulation/libvirt/files/libvirtd.tmpfiles.conf
Normal file
|
@ -0,0 +1 @@
|
||||||
|
d /run/libvirt/lxc 0755 root root -
|
23
app-emulation/libvirt/files/virtlockd.init-r2
Normal file
23
app-emulation/libvirt/files/virtlockd.init-r2
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
#!/sbin/openrc-run
|
||||||
|
# Copyright 1999-2020 Gentoo Authors
|
||||||
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
|
||||||
|
description="libvirt virtual machine lock manager"
|
||||||
|
command="/usr/sbin/virtlockd"
|
||||||
|
start_stop_daemon_args="-b"
|
||||||
|
pidfile="/run/virtlockd.pid"
|
||||||
|
|
||||||
|
extra_started_commands="reload"
|
||||||
|
description_reload="re-exec the daemon, while maintaining locks and clients"
|
||||||
|
|
||||||
|
|
||||||
|
depend() {
|
||||||
|
after ntp-client ntpd nfs nfsmount corosync
|
||||||
|
}
|
||||||
|
|
||||||
|
reload() {
|
||||||
|
ebegin "re-exec() virtlockd"
|
||||||
|
|
||||||
|
start-stop-daemon --signal SIGUSR1 \
|
||||||
|
--exec "${command}" --pidfile "${pidfile}"
|
||||||
|
}
|
23
app-emulation/libvirt/files/virtlogd.init-r2
Normal file
23
app-emulation/libvirt/files/virtlogd.init-r2
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
#!/sbin/openrc-run
|
||||||
|
# Copyright 1999-2020 Gentoo Authors
|
||||||
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
|
||||||
|
description="libvirt virtual machine logging manager"
|
||||||
|
command="/usr/sbin/virtlogd"
|
||||||
|
start_stop_daemon_args="-b"
|
||||||
|
pidfile="/run/virtlogd.pid"
|
||||||
|
|
||||||
|
extra_started_commands="reload"
|
||||||
|
description_reload="re-exec the daemon, while maintaining open connections"
|
||||||
|
|
||||||
|
|
||||||
|
depend() {
|
||||||
|
after ntp-client ntpd nfs nfsmount corosync
|
||||||
|
}
|
||||||
|
|
||||||
|
reload() {
|
||||||
|
ebegin "re-exec() virtlogd"
|
||||||
|
|
||||||
|
start-stop-daemon --signal SIGUSR1 \
|
||||||
|
--exec "${command}" --pidfile "${pidfile}"
|
||||||
|
}
|
349
app-emulation/libvirt/libvirt-8.9.0-r2.ebuild
Normal file
349
app-emulation/libvirt/libvirt-8.9.0-r2.ebuild
Normal file
|
@ -0,0 +1,349 @@
|
||||||
|
# Copyright 1999-2023 Gentoo Authors
|
||||||
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
|
||||||
|
EAPI=8
|
||||||
|
|
||||||
|
# Packages which get releases together:
|
||||||
|
# app-emacs/nxml-libvirt-schemas
|
||||||
|
# dev-python/libvirt-python
|
||||||
|
# dev-perl/Sys-Virt
|
||||||
|
# app-emulation/libvirt
|
||||||
|
# Please bump them together!
|
||||||
|
|
||||||
|
PYTHON_COMPAT=( python3_{9..11} )
|
||||||
|
VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/libvirt.org.asc
|
||||||
|
inherit meson linux-info python-any-r1 readme.gentoo-r1 tmpfiles verify-sig
|
||||||
|
|
||||||
|
if [[ ${PV} = *9999* ]]; then
|
||||||
|
inherit git-r3
|
||||||
|
EGIT_REPO_URI="https://gitlab.com/libvirt/libvirt.git"
|
||||||
|
EGIT_BRANCH="master"
|
||||||
|
else
|
||||||
|
SRC_URI="https://libvirt.org/sources/${P}.tar.xz
|
||||||
|
verify-sig? ( https://libvirt.org/sources/${P}.tar.xz.asc )"
|
||||||
|
KEYWORDS="amd64 ~arm arm64 ~ppc64 x86"
|
||||||
|
fi
|
||||||
|
|
||||||
|
DESCRIPTION="C toolkit to manipulate virtual machines"
|
||||||
|
HOMEPAGE="https://www.libvirt.org/ https://gitlab.com/libvirt/libvirt/"
|
||||||
|
LICENSE="LGPL-2.1"
|
||||||
|
SLOT="0/${PV}"
|
||||||
|
IUSE="
|
||||||
|
apparmor audit bash-completion +caps dtrace firewalld fuse glusterfs
|
||||||
|
iscsi iscsi-direct +libvirtd lvm libssh libssh2 lxc nfs nls numa openvz
|
||||||
|
parted pcap policykit +qemu rbd sasl selinux +udev
|
||||||
|
virtualbox +virt-network wireshark-plugins xen zfs
|
||||||
|
"
|
||||||
|
|
||||||
|
REQUIRED_USE="
|
||||||
|
firewalld? ( virt-network )
|
||||||
|
libvirtd? ( || ( lxc openvz qemu virtualbox xen ) )
|
||||||
|
lxc? ( caps libvirtd )
|
||||||
|
openvz? ( libvirtd )
|
||||||
|
qemu? ( libvirtd )
|
||||||
|
virt-network? ( libvirtd )
|
||||||
|
virtualbox? ( libvirtd )
|
||||||
|
xen? ( libvirtd )"
|
||||||
|
|
||||||
|
BDEPEND="
|
||||||
|
app-text/xhtml1
|
||||||
|
dev-lang/perl
|
||||||
|
dev-libs/libxslt
|
||||||
|
dev-perl/XML-XPath
|
||||||
|
dev-python/docutils
|
||||||
|
virtual/pkgconfig
|
||||||
|
net-libs/rpcsvc-proto
|
||||||
|
bash-completion? ( >=app-shells/bash-completion-2.0 )
|
||||||
|
verify-sig? ( sec-keys/openpgp-keys-libvirt )"
|
||||||
|
|
||||||
|
# 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="
|
||||||
|
acct-user/qemu
|
||||||
|
app-misc/scrub
|
||||||
|
>=dev-libs/glib-2.56.0
|
||||||
|
dev-libs/libgcrypt
|
||||||
|
dev-libs/libnl:3
|
||||||
|
>=dev-libs/libxml2-2.9.1
|
||||||
|
>=net-analyzer/openbsd-netcat-1.105-r1
|
||||||
|
>=net-libs/gnutls-3.2.0:=
|
||||||
|
net-libs/libtirpc:=
|
||||||
|
>=net-misc/curl-7.18.0
|
||||||
|
sys-apps/dbus
|
||||||
|
sys-apps/dmidecode
|
||||||
|
sys-devel/gettext
|
||||||
|
>=sys-libs/readline-7.0:=
|
||||||
|
virtual/acl
|
||||||
|
apparmor? ( sys-libs/libapparmor )
|
||||||
|
audit? ( sys-process/audit )
|
||||||
|
caps? ( sys-libs/libcap-ng )
|
||||||
|
dtrace? ( dev-util/systemtap )
|
||||||
|
firewalld? ( >=net-firewall/firewalld-0.6.3 )
|
||||||
|
fuse? ( sys-fs/fuse:= )
|
||||||
|
glusterfs? ( >=sys-cluster/glusterfs-3.4.1 )
|
||||||
|
iscsi? ( >=sys-block/open-iscsi-1.18.0 )
|
||||||
|
iscsi-direct? ( >=net-libs/libiscsi-1.18.0 )
|
||||||
|
libssh? ( >=net-libs/libssh-0.8.1:= )
|
||||||
|
libssh2? ( >=net-libs/libssh2-1.3 )
|
||||||
|
lvm? ( >=sys-fs/lvm2-2.02.48-r2[lvm] )
|
||||||
|
lxc? ( !sys-apps/systemd[cgroup-hybrid(-)] )
|
||||||
|
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[lvm]
|
||||||
|
)
|
||||||
|
pcap? ( >=net-libs/libpcap-1.8.0 )
|
||||||
|
policykit? (
|
||||||
|
acct-group/libvirt
|
||||||
|
>=sys-auth/polkit-0.9
|
||||||
|
)
|
||||||
|
qemu? (
|
||||||
|
>=app-emulation/qemu-4.2
|
||||||
|
>=dev-libs/yajl-2.0.3:=
|
||||||
|
)
|
||||||
|
rbd? ( sys-cluster/ceph )
|
||||||
|
sasl? ( >=dev-libs/cyrus-sasl-2.1.26 )
|
||||||
|
selinux? ( >=sys-libs/libselinux-2.0.85 )
|
||||||
|
virt-network? (
|
||||||
|
net-dns/dnsmasq[dhcp,ipv6(+),script]
|
||||||
|
net-firewall/ebtables
|
||||||
|
>=net-firewall/iptables-1.4.10[ipv6(+)]
|
||||||
|
net-misc/radvd
|
||||||
|
sys-apps/iproute2[-minimal]
|
||||||
|
)
|
||||||
|
wireshark-plugins? ( >=net-analyzer/wireshark-2.6.0:= )
|
||||||
|
xen? (
|
||||||
|
>=app-emulation/xen-4.9.0
|
||||||
|
app-emulation/xen-tools:=
|
||||||
|
)
|
||||||
|
udev? (
|
||||||
|
virtual/libudev:=
|
||||||
|
>=x11-libs/libpciaccess-0.10.9
|
||||||
|
)
|
||||||
|
zfs? ( sys-fs/zfs )
|
||||||
|
kernel_linux? ( sys-apps/util-linux )"
|
||||||
|
DEPEND="
|
||||||
|
${BDEPEND}
|
||||||
|
${RDEPEND}
|
||||||
|
${PYTHON_DEPS}
|
||||||
|
"
|
||||||
|
# The 'circular' dependency on dev-python/libvirt-python is because of
|
||||||
|
# virt-qemu-qmp-proxy.
|
||||||
|
PDEPEND="
|
||||||
|
qemu? ( dev-python/libvirt-python )
|
||||||
|
"
|
||||||
|
|
||||||
|
PATCHES=(
|
||||||
|
"${FILESDIR}"/${PN}-6.0.0-fix_paths_in_libvirt-guests_sh.patch
|
||||||
|
"${FILESDIR}"/${PN}-8.2.0-do-not-use-sysconfig.patch
|
||||||
|
"${FILESDIR}"/${PN}-8.2.0-fix-paths-for-apparmor.patch
|
||||||
|
"${FILESDIR}"/${PN}-9.2.0-meson-Stop-detecting-Wl-version-script.patch
|
||||||
|
)
|
||||||
|
|
||||||
|
pkg_setup() {
|
||||||
|
# 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 virt-network && CONFIG_CHECK+="
|
||||||
|
~BRIDGE_EBT_MARK_T
|
||||||
|
~BRIDGE_NF_EBTABLES
|
||||||
|
~NETFILTER_ADVANCED
|
||||||
|
~NETFILTER_XT_CONNMARK
|
||||||
|
~NETFILTER_XT_MARK
|
||||||
|
~NETFILTER_XT_TARGET_CHECKSUM
|
||||||
|
~IP_NF_FILTER
|
||||||
|
~IP_NF_MANGLE
|
||||||
|
~IP_NF_NAT
|
||||||
|
~IP_NF_TARGET_MASQUERADE
|
||||||
|
~IP6_NF_FILTER
|
||||||
|
~IP6_NF_MANGLE
|
||||||
|
~IP6_NF_NAT"
|
||||||
|
# Bandwidth Limiting Support
|
||||||
|
use virt-network && CONFIG_CHECK+="
|
||||||
|
~BRIDGE_EBT_T_NAT
|
||||||
|
~IP_NF_TARGET_REJECT
|
||||||
|
~NET_ACT_POLICE
|
||||||
|
~NET_CLS_FW
|
||||||
|
~NET_CLS_U32
|
||||||
|
~NET_SCH_HTB
|
||||||
|
~NET_SCH_INGRESS
|
||||||
|
~NET_SCH_SFQ"
|
||||||
|
|
||||||
|
ERROR_USER_NS="Optional depending on LXC configuration."
|
||||||
|
|
||||||
|
if [[ -n ${CONFIG_CHECK} ]]; then
|
||||||
|
linux-info_pkg_setup
|
||||||
|
fi
|
||||||
|
|
||||||
|
python-any-r1_pkg_setup
|
||||||
|
}
|
||||||
|
|
||||||
|
src_prepare() {
|
||||||
|
touch "${S}/.mailmap" || die
|
||||||
|
|
||||||
|
default
|
||||||
|
python_fix_shebang .
|
||||||
|
|
||||||
|
# Skip fragile tests which relies on pristine environment
|
||||||
|
# (Breaks because of sandbox environment variables)
|
||||||
|
# bug #802876
|
||||||
|
sed -i -e "/commandtest/d" tests/meson.build || die
|
||||||
|
|
||||||
|
# Tweak the init script:
|
||||||
|
cp "${FILESDIR}/libvirtd.init-r19" "${S}/libvirtd.init" || die
|
||||||
|
sed -e "s/USE_FLAG_FIREWALLD/$(usex firewalld 'need firewalld' '')/" \
|
||||||
|
-i "${S}/libvirtd.init" || die "sed failed"
|
||||||
|
}
|
||||||
|
|
||||||
|
src_configure() {
|
||||||
|
local emesonargs=(
|
||||||
|
$(meson_feature apparmor)
|
||||||
|
$(meson_feature apparmor apparmor_profiles)
|
||||||
|
$(meson_feature audit)
|
||||||
|
$(meson_feature caps capng)
|
||||||
|
$(meson_feature dtrace)
|
||||||
|
$(meson_feature firewalld)
|
||||||
|
$(meson_feature fuse)
|
||||||
|
$(meson_feature glusterfs)
|
||||||
|
$(meson_feature glusterfs storage_gluster)
|
||||||
|
$(meson_feature iscsi storage_iscsi)
|
||||||
|
$(meson_feature iscsi-direct storage_iscsi_direct)
|
||||||
|
$(meson_feature libvirtd driver_libvirtd)
|
||||||
|
$(meson_feature libssh)
|
||||||
|
$(meson_feature libssh2)
|
||||||
|
$(meson_feature lvm storage_lvm)
|
||||||
|
$(meson_feature lvm storage_mpath)
|
||||||
|
$(meson_feature lxc driver_lxc)
|
||||||
|
$(meson_feature nls)
|
||||||
|
$(meson_feature numa numactl)
|
||||||
|
$(meson_feature numa numad)
|
||||||
|
$(meson_feature openvz driver_openvz)
|
||||||
|
$(meson_feature parted storage_disk)
|
||||||
|
$(meson_feature pcap libpcap)
|
||||||
|
$(meson_feature policykit polkit)
|
||||||
|
$(meson_feature qemu driver_qemu)
|
||||||
|
$(meson_feature qemu yajl)
|
||||||
|
$(meson_feature rbd storage_rbd)
|
||||||
|
$(meson_feature sasl)
|
||||||
|
$(meson_feature selinux)
|
||||||
|
$(meson_feature udev)
|
||||||
|
$(meson_feature virt-network driver_network)
|
||||||
|
$(meson_feature virtualbox driver_vbox)
|
||||||
|
$(meson_feature wireshark-plugins wireshark_dissector)
|
||||||
|
$(meson_feature xen driver_libxl)
|
||||||
|
$(meson_feature zfs storage_zfs)
|
||||||
|
|
||||||
|
-Dnetcf=disabled
|
||||||
|
-Dsanlock=disabled
|
||||||
|
-Dopenwsman=disabled
|
||||||
|
|
||||||
|
-Ddriver_esx=enabled
|
||||||
|
-Dinit_script=systemd
|
||||||
|
-Dqemu_user=$(usex caps qemu root)
|
||||||
|
-Dqemu_group=$(usex caps qemu root)
|
||||||
|
-Ddriver_remote=enabled
|
||||||
|
-Dstorage_fs=enabled
|
||||||
|
-Ddriver_vmware=enabled
|
||||||
|
|
||||||
|
--localstatedir="${EPREFIX}/var"
|
||||||
|
-Drunstatedir="${EPREFIX}/run"
|
||||||
|
-Ddocdir="${EPREFIX}/usr/share/doc/${PF}"
|
||||||
|
)
|
||||||
|
|
||||||
|
meson_src_configure
|
||||||
|
}
|
||||||
|
|
||||||
|
src_test() {
|
||||||
|
export VIR_TEST_DEBUG=1
|
||||||
|
# Don't run the syntax check tests, they're fragile and not relevant
|
||||||
|
# to us downstream anyway.
|
||||||
|
# We also crank up the timeout (as Fedora does) just to preempt failures
|
||||||
|
# on slower arches.
|
||||||
|
meson_src_test --no-suite syntax-check --timeout-multiplier 10
|
||||||
|
}
|
||||||
|
|
||||||
|
src_install() {
|
||||||
|
meson_src_install
|
||||||
|
|
||||||
|
# Depending on configuration option, libvirt will create some bogus
|
||||||
|
# directoreis. They are either not used, or libvirtd is able to create
|
||||||
|
# them on demand, so let's remove them.
|
||||||
|
#
|
||||||
|
# Note, we are using -f here so that rm does not fail or warn if the
|
||||||
|
# directory is nonexistent.
|
||||||
|
rm -rf "${D}"/etc/sysconfig
|
||||||
|
rm -rf "${D}"/var
|
||||||
|
rm -rf "${D}"/run
|
||||||
|
|
||||||
|
use libvirtd || return 0
|
||||||
|
# From here, only libvirtd-related instructions, be warned!
|
||||||
|
|
||||||
|
newtmpfiles "${FILESDIR}"/libvirtd.tmpfiles.conf libvirtd.conf
|
||||||
|
|
||||||
|
newinitd "${S}/libvirtd.init" libvirtd
|
||||||
|
newinitd "${FILESDIR}/libvirt-guests.init-r4" libvirt-guests
|
||||||
|
newinitd "${FILESDIR}/virtlockd.init-r2" virtlockd
|
||||||
|
newinitd "${FILESDIR}/virtlogd.init-r2" virtlogd
|
||||||
|
|
||||||
|
newconfd "${FILESDIR}/libvirtd.confd-r5" libvirtd
|
||||||
|
newconfd "${FILESDIR}/libvirt-guests.confd" libvirt-guests
|
||||||
|
|
||||||
|
DOC_CONTENTS=$(<"${FILESDIR}/README.gentoo-r3")
|
||||||
|
DISABLE_AUTOFORMATTING=true
|
||||||
|
readme.gentoo_create_doc
|
||||||
|
}
|
||||||
|
|
||||||
|
pkg_postinst() {
|
||||||
|
if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then
|
||||||
|
touch "${ROOT}"/etc/libvirt/qemu/networks/default.xml || die
|
||||||
|
fi
|
||||||
|
|
||||||
|
use libvirtd || return 0
|
||||||
|
# From here, only libvirtd-related instructions, be warned!
|
||||||
|
tmpfiles_process libvirtd.conf
|
||||||
|
readme.gentoo_print_elog
|
||||||
|
}
|
100
app-emulation/libvirt/metadata.xml
Normal file
100
app-emulation/libvirt/metadata.xml
Normal file
|
@ -0,0 +1,100 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
|
||||||
|
<pkgmetadata>
|
||||||
|
<maintainer type="person">
|
||||||
|
<email>tamiko@gentoo.org</email>
|
||||||
|
<name>Matthias Maier</name>
|
||||||
|
</maintainer>
|
||||||
|
<maintainer type="person" proxied="yes">
|
||||||
|
<email>michal.privoznik@gmail.com</email>
|
||||||
|
<name>Michal Prívozník</name>
|
||||||
|
</maintainer>
|
||||||
|
<maintainer type="project">
|
||||||
|
<email>virtualization@gentoo.org</email>
|
||||||
|
<name>Gentoo Virtualization Project</name>
|
||||||
|
</maintainer>
|
||||||
|
<use>
|
||||||
|
<!-- Pool backend flags -->
|
||||||
|
<flag name="iscsi-direct">
|
||||||
|
Allow using libiscsi for iSCSI storage pool backend
|
||||||
|
</flag>
|
||||||
|
<flag name="iscsi">
|
||||||
|
Allow using an iSCSI remote storage server as pool for disk image storage
|
||||||
|
</flag>
|
||||||
|
<flag name="lvm">
|
||||||
|
Allow using the Logical Volume Manager (<pkg>sys-fs/lvm2</pkg>) as pool for disk image
|
||||||
|
storage
|
||||||
|
</flag>
|
||||||
|
<flag name="nfs">
|
||||||
|
Allow using Network File System mounts as pool for disk image storage
|
||||||
|
</flag>
|
||||||
|
<flag name="parted">
|
||||||
|
Allow using real disk partitions as pool for disk image storage, using
|
||||||
|
<pkg>sys-block/parted</pkg> to create, resize and delete them.
|
||||||
|
</flag>
|
||||||
|
<flag name="rbd">
|
||||||
|
Enable rados block device support via <pkg>sys-cluster/ceph</pkg>
|
||||||
|
</flag>
|
||||||
|
<!-- Virtualisation backends -->
|
||||||
|
<flag name="lxc">
|
||||||
|
Support management of Linux Containers virtualisation (<pkg>app-containers/lxc</pkg>)
|
||||||
|
</flag>
|
||||||
|
<flag name="openvz">
|
||||||
|
Support management of OpenVZ virtualisation (openvz-sources)
|
||||||
|
</flag>
|
||||||
|
<flag name="qemu">
|
||||||
|
Support management of QEMU virtualisation (<pkg>app-emulation/qemu</pkg>)
|
||||||
|
</flag>
|
||||||
|
<flag name="xen">
|
||||||
|
Support management of Xen virtualisation (<pkg>app-emulation/xen</pkg>)
|
||||||
|
</flag>
|
||||||
|
<flag name="virtualbox">
|
||||||
|
Support management of VirtualBox virtualisation (<pkg>app-emulation/virtualbox</pkg>)
|
||||||
|
</flag>
|
||||||
|
<!-- Miscellaneous flags -->
|
||||||
|
<flag name="dtrace">Enable dtrace support via <pkg>dev-util/systemtap</pkg></flag>
|
||||||
|
<flag name="fuse">Allow LXC to use <pkg>sys-fs/fuse</pkg> for mountpoints</flag>
|
||||||
|
<flag name="numa">
|
||||||
|
Use NUMA for memory segmenting via <pkg>sys-process/numactl</pkg> and
|
||||||
|
<pkg>sys-process/numad</pkg>
|
||||||
|
</flag>
|
||||||
|
<flag name="libvirtd">
|
||||||
|
Builds the libvirtd daemon as well as the client utilities instead of just the client
|
||||||
|
utilities
|
||||||
|
</flag>
|
||||||
|
<flag name="libssh">
|
||||||
|
Use <pkg>net-libs/libssh</pkg> to communicate with remote libvirtd hosts,
|
||||||
|
for example: qemu+libssh://server/system
|
||||||
|
</flag>
|
||||||
|
<flag name="libssh2">
|
||||||
|
Use <pkg>net-libs/libssh2</pkg> to communicate with remote libvirtd hosts,
|
||||||
|
for example: qemu+libssh2://server/system
|
||||||
|
</flag>
|
||||||
|
<flag name="pcap">
|
||||||
|
Support auto learning IP addreses for routing
|
||||||
|
</flag>
|
||||||
|
<flag name="virt-network">
|
||||||
|
Enable virtual networking (NAT) support for guests. Includes all
|
||||||
|
the dependencies for NATed network mode. Effectively any network
|
||||||
|
setup that relies on libvirt to setup and configure network
|
||||||
|
interfaces on your host. This can include bridged and routed
|
||||||
|
networks ONLY if you are allowing libvirt to create and manage
|
||||||
|
the underlying devices for you. In some cases this requires
|
||||||
|
enabling the 'netcf' USE flag (currently unavailable).
|
||||||
|
</flag>
|
||||||
|
<flag name="firewalld">DBus interface to iptables/ebtables allowing
|
||||||
|
for better runtime management of your firewall.</flag>
|
||||||
|
<flag name="wireshark-plugins">
|
||||||
|
Build the <pkg>net-analyzer/wireshark</pkg> plugin for the Libvirt RPC protocol
|
||||||
|
</flag>
|
||||||
|
<flag name="glusterfs">
|
||||||
|
Enable GlusterFS support via <pkg>sys-cluster/glusterfs</pkg>
|
||||||
|
</flag>
|
||||||
|
<flag name="zfs">
|
||||||
|
Enable ZFS backend storage <pkg>sys-fs/zfs</pkg>
|
||||||
|
</flag>
|
||||||
|
</use>
|
||||||
|
<upstream>
|
||||||
|
<remote-id type="gitlab">libvirt/libvirt</remote-id>
|
||||||
|
</upstream>
|
||||||
|
</pkgmetadata>
|
Loading…
Reference in a new issue