block: add support for devtype option

QubesOS/qubes-issues#2951
This commit is contained in:
Marek Marczykowski-Górecki 2017-08-01 15:20:36 +02:00
parent a407e34931
commit 22f2fe6d69
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -242,6 +242,11 @@ class BlockDeviceExtension(qubes.ext.Extension):
raise qubes.exc.QubesValueError( raise qubes.exc.QubesValueError(
'read-only option can only have ' 'read-only option can only have '
'\'yes\' or \'no\' value') '\'yes\' or \'no\' value')
elif option == 'devtype':
if value not in ('disk', 'cdrom'):
raise qubes.exc.QubesValueError(
'devtype option can only have '
'\'disk\' or \'cdrom\' value')
else: else:
raise qubes.exc.QubesValueError( raise qubes.exc.QubesValueError(
'Unsupported option {}'.format(option)) 'Unsupported option {}'.format(option))