From c77a91fafad1a1d38af658dcbb64ffc4f484a262 Mon Sep 17 00:00:00 2001 From: Manuel Bentele Date: Mon, 30 Aug 2021 09:15:57 +0200 Subject: [qemu] Add printing of status for mediated device setup --- .../vmchooser/plugins/qemukvm/includes/passthrough-mdev.inc | 3 --- .../data/opt/openslx/vmchooser/plugins/qemukvm/run-virt.include | 7 ++++++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/core/modules/qemu/data/opt/openslx/vmchooser/plugins/qemukvm/includes/passthrough-mdev.inc b/core/modules/qemu/data/opt/openslx/vmchooser/plugins/qemukvm/includes/passthrough-mdev.inc index 067cc35d..f2e2942b 100644 --- a/core/modules/qemu/data/opt/openslx/vmchooser/plugins/qemukvm/includes/passthrough-mdev.inc +++ b/core/modules/qemu/data/opt/openslx/vmchooser/plugins/qemukvm/includes/passthrough-mdev.inc @@ -145,14 +145,11 @@ function passthrough_mdev_setup() { return 1; fi - writelog "Passthrough of mediated devices (mdev) is enabled successfully" - # obtain created mediated device for passthrough local pt_gpu_mdev_id="$(passthrough_mdev_instance_get)" # check if mediated device ID could be obtained if [ -z "${pt_gpu_mdev_id}" ]; then - writelog "Failed to obtain created mediated device UUID" return 2; fi 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 12239b4e..d61ff97d 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 @@ -46,7 +46,12 @@ run_plugin() { local pt_gpu_pci_ids=($(passthrough_pci_setup)) # setup GPU mediated device passthrough and obtain mediated device address - local pt_gpu_mdev_id=($(passthrough_mdev_setup)) + pt_gpu_mdev_id="$(passthrough_mdev_setup)" + if [ "${?}" -eq 0 ]; then + writelog "Mediated device (${pt_gpu_mdev_id}) is set up for passthrough successfully." + else + writelog "Failed to obtain created mediated device UUID!" + fi # write finalized config in debug mode to temporary folder for debugging purposes if [ "${DEBUG}" = "true" ]; then -- cgit v1.2.3-55-g7522