qubes.storage.domain use new storage API

This commit is contained in:
Bahtiar `kalkin-` Gadimov 2016-07-12 17:54:52 +02:00
parent d1c606b952
commit f60ccb235d
No known key found for this signature in database
GPG Key ID: 96ED3C3BA19C3DEE

View File

@ -21,7 +21,7 @@
# #
''' Manages block devices in a domain ''' ''' Manages block devices in a domain '''
import string import string # pylint: disable=deprecated-module
from qubes.storage import Pool, Volume from qubes.storage import Pool, Volume
@ -99,15 +99,12 @@ class DomainPool(Pool):
class DomainVolume(Volume): class DomainVolume(Volume):
''' A volume provided by a block device in an domain ''' ''' A volume provided by a block device in an domain '''
def __init__(self, name, pool, desc, mode, size): def __init__(self, name, pool, desc, mode, **kwargs):
if mode == 'w': rw = (mode == 'w')
volume_type = 'read-write'
else:
volume_type = 'read-only'
super(DomainVolume, self).__init__(desc, super(DomainVolume, self).__init__(desc, pool, vid=name, removable=True,
pool, rw=rw, **kwargs)
volume_type,
vid=name, @property
size=size, def revisions(self):
removable=True) return {}