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