Add Volume.internal field

- Linux kernel volumes are always internal volumes
This commit is contained in:
Bahtiar `kalkin-` Gadimov 2016-04-27 17:16:34 +02:00
parent 07800a0e67
commit 09727b1cbd
No known key found for this signature in database
GPG Key ID: 96ED3C3BA19C3DEE
4 changed files with 11 additions and 1 deletions

View File

@ -57,7 +57,7 @@ class Volume(object):
usage = 0
def __init__(self, name, pool, volume_type, vid=None, size=0,
removable=False, **kwargs):
removable=False, internal=False, **kwargs):
super(Volume, self).__init__(**kwargs)
self.name = str(name)
self.pool = str(pool)
@ -65,6 +65,7 @@ class Volume(object):
self.size = size
self.volume_type = volume_type
self.removable = removable
self.internal = internal
def __xml__(self):
return lxml.etree.Element('volume', **self.config)

View File

@ -111,6 +111,7 @@ class LinuxKernel(Pool):
kernel_version,
pool=self.name,
name=kernel_version,
internal=True,
volume_type='read-only')
for kernel_version in os.listdir(self.dir_path)]

View File

@ -45,23 +45,27 @@ class AppVM(qubes.vm.qubesvm.QubesVM):
'name': 'root',
'pool': 'default',
'volume_type': 'snapshot',
'internal': True
},
'private': {
'name': 'private',
'pool': 'default',
'volume_type': 'origin',
'size': defaults['private_img_size'],
'internal': True
},
'volatile': {
'name': 'volatile',
'pool': 'default',
'volume_type': 'volatile',
'size': defaults['root_img_size'],
'internal': True
},
'kernel': {
'name': 'kernel',
'pool': 'linux-kernel',
'volume_type': 'read-only',
'internal': True
}
}
super(AppVM, self).__init__(*args, **kwargs)

View File

@ -62,23 +62,27 @@ class TemplateVM(QubesVM):
'pool': 'default',
'volume_type': 'origin',
'size': defaults['root_img_size'],
'internal': True
},
'private': {
'name': 'private',
'pool': 'default',
'volume_type': 'read-write',
'size': defaults['private_img_size'],
'internal': True
},
'volatile': {
'name': 'volatile',
'pool': 'default',
'size': defaults['root_img_size'],
'volume_type': 'volatile',
'internal': True
},
'kernel': {
'name': 'kernel',
'pool': 'linux-kernel',
'volume_type': 'read-only',
'internal': True
}
}
super(TemplateVM, self).__init__(*args, **kwargs)