Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 703334 - app-emulation/qemu: add qemu-pr-helper startup scripts
Summary: app-emulation/qemu: add qemu-pr-helper startup scripts
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Matthias Maier
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-12-19 07:38 UTC by Joakim Tjernlund
Modified: 2022-04-17 15:39 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joakim Tjernlund 2019-12-19 07:38:19 UTC
On DM hosts one can see in dmesg:
 device-mapper: core: qemu-system-x86: sending ioctl 5326 to DM device without required privilege.

I believe this is because Gentoo does not support the qemu-pr-helper service
which will proxy such ioctls
Comment 1 Sergei Trofimovich (RETIRED) gentoo-dev 2019-12-20 08:00:02 UTC
https://kashyapc.fedorapeople.org/QEMU-Docs/_build/html/docs/pr-manager.html looks relevant.
Comment 2 Joakim Tjernlund 2019-12-20 11:16:51 UTC
(In reply to Sergei Trofimovich from comment #1)
> https://kashyapc.fedorapeople.org/QEMU-Docs/_build/html/docs/pr-manager.html
> looks relevant.

Yes, that looks like a good place to start.
Maby this is a app-emulation/libvirt issue too?
Something needs to start the qemu-pr-helper service
but libvirt needs to use it whenever USE=caps is set
Comment 3 Sergei Trofimovich (RETIRED) gentoo-dev 2019-12-20 23:00:31 UTC
I think it makes sense to add init.d scripts to qemu ebuild. systemd part is already included  as part of source tarball and is trivial to install [1]. I can try to hack up init.d equivalent for it.

Or you can try to do it yourself and attach your version of init.d script.

[1]: example systemd integration:

diff --git a/app-emulation/qemu/qemu-9999.ebuild b/app-emulation/qemu/qemu-9999.ebuild
index 0eaa68925a8..ed2da6176c2 100644
--- a/app-emulation/qemu/qemu-9999.ebuild
+++ b/app-emulation/qemu/qemu-9999.ebuild
@@ -10,8 +10,8 @@ PLOCALES="bg de_DE fr_FR hu it tr zh_CN"

 FIRMWARE_ABI_VERSION="4.0.0-r50"

-inherit eutils linux-info toolchain-funcs multilib python-r1 \
-	udev fcaps readme.gentoo-r1 pax-utils l10n xdg-utils
+inherit eutils linux-info toolchain-funcs multilib python-r1
+inherit udev fcaps readme.gentoo-r1 pax-utils l10n systemd xdg-utils

 if [[ ${PV} = *9999* ]]; then
 	EGIT_REPO_URI="git://git.qemu.org/qemu.git"
@@ -718,6 +718,9 @@ src_install() {
 	dostrip -x ${QA_PREBUILT}

 	if [[ -n ${softmmu_targets} ]]; then
+		# Install qemu-pr-helper startup scripts
+		systemd_dounit "${S}"/contrib/systemd/qemu-pr-helper.{service,socket}
+
 		# 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"
Comment 4 Michal Privoznik 2020-02-10 13:07:54 UTC
(In reply to Joakim Tjernlund from comment #2)
Libvirt supports reservations using <reservations/> subelement, for instance:

  <disk type='block' device='lun'>
    <driver name='qemu' type='raw'/>
    <source dev='/dev/sda'>
      <reservations managed='no'>
        <source type='unix' path='/path/to/qemu-pr-helper' mode='client'/>
      </reservations>
    <target dev='sda' bus='scsi'/>
    <address type='drive' controller='0' bus='0' target='3' unit='0'/>
  </disk>

https://libvirt.org/formatdomain.html#elementsDisks

It will start the helper process automatically if domain XML requires it.
Comment 5 Joakim Tjernlund 2020-02-15 18:32:35 UTC
(In reply to Michal Privoznik from comment #4)
> (In reply to Joakim Tjernlund from comment #2)
> Libvirt supports reservations using <reservations/> subelement, for instance:
> 
>   <disk type='block' device='lun'>
>     <driver name='qemu' type='raw'/>
>     <source dev='/dev/sda'>
>       <reservations managed='no'>
>         <source type='unix' path='/path/to/qemu-pr-helper' mode='client'/>
>       </reservations>
>     <target dev='sda' bus='scsi'/>
>     <address type='drive' controller='0' bus='0' target='3' unit='0'/>
>   </disk>
> 
> https://libvirt.org/formatdomain.html#elementsDisks
> 
> It will start the helper process automatically if domain XML requires it.

Yes, but I am nor sure all needs a re covered  by that. I don't have any LUNs
but I still saw the that error