Browse Source

block-snapshot: set qubes.xml path for test VMs

Since it is running with totally different environment, QUBES_XML_PATH
isn't passed from test runner. Apply heuristic based on VM name.
Marek Marczykowski-Górecki 7 years ago
parent
commit
d954bb82a3
1 changed files with 4 additions and 0 deletions
  1. 4 0
      linux/system-config/block-snapshot

+ 4 - 0
linux/system-config/block-snapshot

@@ -251,6 +251,10 @@ case "$command" in
             domain=$(cat "$HOTPLUG_STORE-domain")
             if [ "$domain" ]; then
               # Dont stop on errors
+              if [ -r /var/lib/qubes/qubes-test.xml -a \
+                  "${domain#test-}" != "$domain" ]; then
+                export QUBES_XML_PATH=/var/lib/qubes/qubes-test.xml
+              fi
               /usr/bin/qvm-template-commit --offline-mode "$domain" || true
             fi
           fi