storage: get rid of 'servicevms' subdir

Keep all the non-template VMs in 'appvms'. Having it split makes no
sense since any VM can be "converted" to NetVM by simply changing its
provides_network attribute and probably assigning some PCI device.

On the other hand, it may be useful to set this manually, for example by
management stack - based on VM function, not type. But don't care about
it for now.
This commit is contained in:
Marek Marczykowski-Górecki 2016-02-10 17:03:46 +01:00 committed by Wojtek Porczyk
parent c1bab3d094
commit f52a0f2d41

View File

@ -507,7 +507,6 @@ class Pool(object):
* ``appvms`` for ``QubesAppVm`` or ``QubesHvm``
* ``vm-templates`` for ``QubesTemplateVm`` or ``QubesTemplateHvm``
* ``servicevms`` for any subclass of ``QubesNetVm``
Args:
vm: a QubesVM
@ -517,20 +516,13 @@ class Pool(object):
string (str) absolute path to the directory where the vm files
are stored
"""
if vm.is_appvm():
subdir = 'appvms'
elif vm.is_template():
if vm.is_template():
subdir = 'vm-templates'
elif vm.is_netvm():
subdir = 'servicevms'
elif vm.is_disposablevm():
subdir = 'appvms'
return os.path.join(pool_dir, subdir, vm.template.name + '-dvm')
elif isinstance(vm, qubes.vm.adminvm.AdminVM):
subdir = 'servicevms'
else:
raise qubes.exc.QubesException(
'unknown vm type: {!r}'.format(str(vm.__class__)))
subdir = 'appvms'
return os.path.join(pool_dir, subdir, vm.name)