XenStorage add DisposableVm handling

This commit is contained in:
Bahtiar `kalkin-` Gadimov 2015-11-17 21:15:13 +01:00
parent 989eab1d72
commit 1934f06869

View File

@ -28,9 +28,9 @@ import re
import subprocess import subprocess
import sys import sys
from qubes.qubes import (QubesAdminVm, QubesAppVm, QubesException, QubesHVm, from qubes.qubes import (QubesAdminVm, QubesAppVm, QubesDisposableVm,
QubesNetVm, QubesProxyVm, QubesTemplateHVm, QubesException, QubesHVm, QubesNetVm, QubesProxyVm,
QubesTemplateVm, defaults, vm_files) QubesTemplateHVm, QubesTemplateVm, defaults, vm_files)
from qubes.storage import Pool, QubesVmStorage from qubes.storage import Pool, QubesVmStorage
@ -322,6 +322,9 @@ class XenPool(Pool):
subdir = 'vm-templates' subdir = 'vm-templates'
elif vm_type in [QubesAdminVm, QubesNetVm, QubesProxyVm]: elif vm_type in [QubesAdminVm, QubesNetVm, QubesProxyVm]:
subdir = 'servicevms' subdir = 'servicevms'
elif vm_type is QubesDisposableVm:
subdir = 'appvms'
return os.path.join(pool_dir, subdir, vm.template.name + '-dvm')
else: else:
raise QubesException(str(vm_type) + ' unknown vm type') raise QubesException(str(vm_type) + ' unknown vm type')