-
-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add vm.icon property #342
Add vm.icon property #342
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,3 +62,25 @@ def qubes_features_request(self, vm, event, untrusted_features): | |
# if this is the first time qrexec was advertised, now can finish | ||
# template setup | ||
yield from vm.fire_event_async('template-postinstall') | ||
|
||
# pylint: disable=no-self-use | ||
def set_servicevm_feature(self, subject): | ||
if getattr(subject, 'provides_network', False): | ||
subject.features['servicevm'] = 1 | ||
elif 'servicevm' in subject.features: | ||
del subject.features['servicevm'] | ||
|
||
@qubes.ext.handler('property-set:provides_network') | ||
def on_property_set(self, subject, event, name, newvalue, oldvalue=None): | ||
# pylint: disable=unused-argument | ||
self.set_servicevm_feature(subject) | ||
|
||
@qubes.ext.handler('property-del:provides_network') | ||
def on_property_del(self, subject, event, name): | ||
# pylint: disable=unused-argument | ||
self.set_servicevm_feature(subject) | ||
|
||
@qubes.ext.handler('domain-load') | ||
def on_domain_load(self, subject, event): | ||
# pylint: disable=unused-argument | ||
self.set_servicevm_feature(subject) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This all will work fine for new VMs, because default value for provides_network is false (so default not having |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was deleting
servicevm
necessary? Later on this commit:Came here from QubesOS/qubes-mgmt-salt-dom0-virtual-machines#63
I don't think not having
provides_network
must enforce not havingservicevm
.