qubes-anaconda-addon: adjust usbvm setup to simplified states

Don't use separte state for combined sys-net+sys-usb. Instead, use
pillar to adjust sys-usb state.

QubesOS/qubes-issues#3516
This commit is contained in:
Marek Marczykowski-Górecki 2018-03-02 20:55:43 +01:00
parent e83c0b4edc
commit 425a82ed2e
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -274,9 +274,8 @@ class QubesOsSpoke(FirstbootOnlySpokeMixIn, NormalSpoke):
self.choice_usb_with_net = QubesChoice( self.choice_usb_with_net = QubesChoice(
_("Use sys-net qube for both networking and USB devices"), _("Use sys-net qube for both networking and USB devices"),
('qvm.sys-net-with-usb',), ('pillar.qvm.sys-net-as-usbvm',),
depend=self.choice_usb, depend=self.choice_usb,
replace=('qvm.sys-usb',),
indent=True indent=True
) )
@ -516,6 +515,10 @@ class QubesOsSpoke(FirstbootOnlySpokeMixIn, NormalSpoke):
for state in QubesChoice.get_states(): for state in QubesChoice.get_states():
print("Setting up state: {}".format(state)) print("Setting up state: {}".format(state))
if state.startswith('pillar.'):
self.run_command(['qubesctl', 'top.enable',
state[len('pillar.'):], 'pillar=True'])
else:
self.run_command(['qubesctl', 'top.enable', state]) self.run_command(['qubesctl', 'top.enable', state])
try: try:
@ -524,6 +527,7 @@ class QubesOsSpoke(FirstbootOnlySpokeMixIn, NormalSpoke):
# enabled, to not interfere with later user changes (like assigning # enabled, to not interfere with later user changes (like assigning
# additional PCI devices) # additional PCI devices)
for state in QubesChoice.get_states(): for state in QubesChoice.get_states():
if not state.startswith('pillar.'):
self.run_command(['qubesctl', 'top.disable', state]) self.run_command(['qubesctl', 'top.disable', state])
except Exception: except Exception:
raise Exception( raise Exception(