summaryrefslogtreecommitdiffstats
path: root/core/modules/run-virt/data/opt/openslx/vmchooser/vmchooser-run_virt
diff options
context:
space:
mode:
authorSimon Rettberg2020-03-10 16:52:51 +0100
committerSimon Rettberg2020-03-10 16:52:51 +0100
commit92bd64aa85367ec602f714a404629d0818c17ca0 (patch)
treeba82fc46903588320646665de96f25064101464a /core/modules/run-virt/data/opt/openslx/vmchooser/vmchooser-run_virt
parent[inc/chroot] Add tmpfs layer for upperdir (diff)
downloadmltk-92bd64aa85367ec602f714a404629d0818c17ca0.tar.gz
mltk-92bd64aa85367ec602f714a404629d0818c17ca0.tar.xz
mltk-92bd64aa85367ec602f714a404629d0818c17ca0.zip
[run-virt] Add pre-exec and post-exec hooks
Diffstat (limited to 'core/modules/run-virt/data/opt/openslx/vmchooser/vmchooser-run_virt')
-rwxr-xr-xcore/modules/run-virt/data/opt/openslx/vmchooser/vmchooser-run_virt8
1 files changed, 7 insertions, 1 deletions
diff --git a/core/modules/run-virt/data/opt/openslx/vmchooser/vmchooser-run_virt b/core/modules/run-virt/data/opt/openslx/vmchooser/vmchooser-run_virt
index a2d0f3cb..cf4bc1ca 100755
--- a/core/modules/run-virt/data/opt/openslx/vmchooser/vmchooser-run_virt
+++ b/core/modules/run-virt/data/opt/openslx/vmchooser/vmchooser-run_virt
@@ -177,11 +177,17 @@ main() {
cleanexit 1
fi
+ run_hooks "pre-exec" "$PLUGIN_ID" "$IMGUUID"
+
writelog "VM command: ${VIRTCMD} ${VIRTCMDOPTS[*]}"
# This will start the VM (no eval needed!)
+ local retval
"${VIRTCMD}" "${VIRTCMDOPTS[@]}"
+ retval=$?
+
+ run_hooks "post-exec" "$PLUGIN_ID" "$IMGUUID"
- writelog "Virtualizer exited with '$?'. Bye."
+ writelog "Virtualizer exited with '$retval'. Bye."
cleanexit 0
}