diff options
| author | Steffen Ritter | 2025-02-27 16:10:07 +0100 |
|---|---|---|
| committer | Steffen Ritter | 2025-02-27 16:10:07 +0100 |
| commit | cf531c4d7383949e4438f6874979b94b43e0da41 (patch) | |
| tree | 8be8f78439874bb28aedcd701dd4908c8eea1511 | |
| parent | [run-virt] Do IP filtering in parallel to dns-level blocking (diff) | |
| download | mltk-cf531c4d7383949e4438f6874979b94b43e0da41.tar.gz mltk-cf531c4d7383949e4438f6874979b94b43e0da41.tar.xz mltk-cf531c4d7383949e4438f6874979b94b43e0da41.zip | |
[qemu] Save libvirt-xml
Copy the file which comes from dmsd to a place like the
other hypervisor runvirt-plugins do. Also this place don't
get wiped in case of failure.
And output the transformed xml by the runvirt-plugin-qemu
which is finally used by qemu
| -rwxr-xr-x | core/modules/qemu/data/opt/openslx/scripts/systemd-qemu_env | 3 | ||||
| -rw-r--r-- | core/modules/qemu/data/opt/openslx/vmchooser/plugins/qemukvm/run-virt.include | 9 |
2 files changed, 11 insertions, 1 deletions
diff --git a/core/modules/qemu/data/opt/openslx/scripts/systemd-qemu_env b/core/modules/qemu/data/opt/openslx/scripts/systemd-qemu_env index 15e904b3..0cb1a136 100755 --- a/core/modules/qemu/data/opt/openslx/scripts/systemd-qemu_env +++ b/core/modules/qemu/data/opt/openslx/scripts/systemd-qemu_env @@ -21,6 +21,9 @@ source /opt/openslx/vmchooser/plugins/qemukvm/includes/kernel-cmdln.inc source /opt/openslx/vmchooser/plugins/qemukvm/includes/passthrough-pci.inc source /opt/openslx/vmchooser/plugins/qemukvm/includes/passthrough-mdev.inc +# create required standard directories +mkdir -p "/tmp/virt/qemukvm" -m 1777 + # # setup PCI devices for passthrough if Intel PCI passthrough is enabled # diff --git a/core/modules/qemu/data/opt/openslx/vmchooser/plugins/qemukvm/run-virt.include b/core/modules/qemu/data/opt/openslx/vmchooser/plugins/qemukvm/run-virt.include index 56b32b8b..b6d3eb13 100644 --- a/core/modules/qemu/data/opt/openslx/vmchooser/plugins/qemukvm/run-virt.include +++ b/core/modules/qemu/data/opt/openslx/vmchooser/plugins/qemukvm/run-virt.include @@ -18,6 +18,7 @@ # BASH_SOURCE[0] contains the file being sourced, namely this one declare -rg QEMU_PLUGIN_DIR="$(dirname "${BASH_SOURCE[0]}")" declare -rg QEMU_INCLUDE_DIR="${QEMU_PLUGIN_DIR}/includes" +declare -rg VM_WORK_DIR="/tmp/virt/${PLUGIN_ID}/${USER}.$$" # Define which features the QEMU plugin supports declare -rg PLUGIN_FEATURES="firewall printer usb slxfloppy sound" @@ -30,6 +31,9 @@ run_plugin() { # include mediated device passthrough utils and functions $(safesource "${QEMU_INCLUDE_DIR}/passthrough-mdev.inc") + # make work dir + mkdir -p "$VM_WORK_DIR" >/dev/null 2>&1 + # setup RW image access for operation local vm_diskfile if notempty VM_DISKFILE_RO; then @@ -57,10 +61,13 @@ run_plugin() { # set path to QEMU firmware specification files local firmware_path="/usr/share/qemu/firmware" + cp -p "${TMPCONFIG}" "${VM_WORK_DIR}/libvirt.original.xml" + local vm_final_config="${VM_WORK_DIR}/libvirt.modified.xml" + # set debug related options if [ "${DEBUG}" = "true" ]; then # write finalized config in debug mode to temporary folder for debugging purposes - local vm_final_config="/tmp/qemu-last-config.xml" + #local vm_final_config="/tmp/qemu-last-config.xml" # set configuration for virt-manager local GSETTINGS_SCHEMA_NAME_PREFIX="org.virt-manager.virt-manager" |
