Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

libvirt hooks not working

Featured Replies

Hi,

 

as we have libvirt 6.5, shouldnt it be possible to use hook scripts ?

 

i created the folder /etc/libvirt/hooks/qemu.d/ where the scripts should be executed ordered by name (i only need 1)

 

so in my case i added a script work_gvt.sh, chmod +x, with the following content (also a test output which also doesnt get executed)

 

#!/bin/bash

echo "Testrun" > /mnt/cache/testrun.txt

if [ $# -ge 3 ]; then
    if [ $1 = "Work_gvt" -a $2 = "prepare" -a $3 = "begin" ]; then
        echo "Creating vgpu"
        echo ee0036c0-8e21-40b2-9f33-8d5c5f6f5f93 > "/sys/devices/pci0000:00/0000:00:02.0/mdev_supported_types/i915-GVTg_V5_8/create"
    elif [ $1 = "Work_gvt" -a $2 = "release" -a $3 = "end" ]; then
        echo "removing vgpu"
        echo 1 > "/sys/devices/pci0000:00/0000:00:02.0/ee0036c0-8e21-40b2-9f33-8d5c5f6f5f93/remove"
    fi
fi

 

so question is, only possible to modify the limetech qemu file to initiate things ... which shouldnt be the goal i d guess.

Edited by alturismo

  • Community Expert

Hi @alturismo 

 

I have a similar requirements for a plugin and have a post in the programming section. qemu in the hooks dir would need to be modified to provide the support you are looking for. 

 

 

  • 3 months later...
  • Community Expert

Hi @alturismo working with ljm42 & ich777  on a new suggested hooks file, this my current prototype suggested directory structure.

 

root@computenode:/etc/libvirt/hooks# tree
.
├── qemu
├── qemu.d
│   ├── #all
│   │   ├── prepare
│   │   │   └── USB_Manager
│   │   ├── start
│   │   │   └── VM_Manager
│   │   └── stopped
│   │       └── USB_Manager -> /etc/libvirt/hooks/qemu.d/#all/prepare/USB_Manager
│   ├── Ubuntu
│   │   ├── start
│   │   └── stopped
│   │       └── gvt
│   └── Windows 10 test4
│       ├── prepare
│       │   └── gvt
│       └── release
│           └── gvt
├── qemu.old
├── qemu.orig
└── qemu_hook_version

 

 

  • 1 month later...
  • Community Expert
On 2/21/2021 at 8:29 AM, alturismo said:

 /etc/libvirt/hooks/qemu.d/ where the scripts should be executed ordered by name (i only need 1)

this works in 6.10 as use for my usb manager plugin

  • Author
5 hours ago, SimonF said:

this works in 6.10 as use for my usb manager plugin

 

i saw that already, i had my old scripts in there and after 1st boot on 6.10 my gvt-g VM's didnt work, until i figured my old crap was in there  ;)

 

thanks for the note anyway ;)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.