QubesNetVm and subclasses use servicevm/ as vmdir

This commit is contained in:
Bahtiar `kalkin-` Gadimov 2015-11-17 21:19:15 +01:00
parent 1934f06869
commit 9eee00c6d7

View File

@ -28,9 +28,9 @@ import re
import subprocess import subprocess
import sys import sys
from qubes.qubes import (QubesAdminVm, QubesAppVm, QubesDisposableVm, from qubes.qubes import (QubesAppVm, QubesDisposableVm, QubesException,
QubesException, QubesHVm, QubesNetVm, QubesProxyVm, QubesHVm, QubesNetVm, QubesTemplateHVm,
QubesTemplateHVm, QubesTemplateVm, defaults, vm_files) QubesTemplateVm, defaults, vm_files)
from qubes.storage import Pool, QubesVmStorage from qubes.storage import Pool, QubesVmStorage
@ -303,8 +303,7 @@ class XenPool(Pool):
* ``appvms`` for ``QubesAppVm`` or ``QubesHvm`` * ``appvms`` for ``QubesAppVm`` or ``QubesHvm``
* ``vm-templates`` for ``QubesTemplateVm`` or ``QubesTemplateHvm`` * ``vm-templates`` for ``QubesTemplateVm`` or ``QubesTemplateHvm``
* ``servicevms`` for ``QubesProxyVm``, ``QubesNetVm`` or * ``servicevms`` for any subclass of ``QubesNetVm``
``QubesAdminVm``
Args: Args:
vm: a QubesVM vm: a QubesVM
@ -320,7 +319,7 @@ class XenPool(Pool):
subdir = 'appvms' subdir = 'appvms'
elif vm_type in [QubesTemplateVm, QubesTemplateHVm]: elif vm_type in [QubesTemplateVm, QubesTemplateHVm]:
subdir = 'vm-templates' subdir = 'vm-templates'
elif vm_type in [QubesAdminVm, QubesNetVm, QubesProxyVm]: elif issubclass(vm_type, QubesNetVm):
subdir = 'servicevms' subdir = 'servicevms'
elif vm_type is QubesDisposableVm: elif vm_type is QubesDisposableVm:
subdir = 'appvms' subdir = 'appvms'