qvm-start-gui: handle GuiVM
This commit is contained in:
parent
a5102d752f
commit
6b4a99f83f
@ -226,6 +226,10 @@ class QubesBase(qubesadmin.base.PropertyHolder):
|
|||||||
""" Remove a storage pool """
|
""" Remove a storage pool """
|
||||||
self.qubesd_call('dom0', 'admin.pool.Remove', name, None)
|
self.qubesd_call('dom0', 'admin.pool.Remove', name, None)
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def get_local_name():
|
||||||
|
return os.uname()[1]
|
||||||
|
|
||||||
def get_label(self, label):
|
def get_label(self, label):
|
||||||
"""Get label as identified by index or name
|
"""Get label as identified by index or name
|
||||||
|
|
||||||
|
@ -252,6 +252,11 @@ class GUILauncher(object):
|
|||||||
one for target AppVM is running.
|
one for target AppVM is running.
|
||||||
:param monitor_layout: monitor layout configuration
|
:param monitor_layout: monitor layout configuration
|
||||||
"""
|
"""
|
||||||
|
if vm.guivm != vm.app.get_local_name():
|
||||||
|
vm.log.info(
|
||||||
|
'{} has GuiVM {}. Skipping.'.format(vm.name, vm.guivm))
|
||||||
|
return
|
||||||
|
|
||||||
if vm.virt_mode == 'hvm':
|
if vm.virt_mode == 'hvm':
|
||||||
yield from self.start_gui_for_stubdomain(vm, force=force_stubdom)
|
yield from self.start_gui_for_stubdomain(vm, force=force_stubdom)
|
||||||
|
|
||||||
@ -311,6 +316,8 @@ class GUILauncher(object):
|
|||||||
"""Send monitor layout to all (running) VMs"""
|
"""Send monitor layout to all (running) VMs"""
|
||||||
monitor_layout = get_monitor_layout()
|
monitor_layout = get_monitor_layout()
|
||||||
for vm in self.app.domains:
|
for vm in self.app.domains:
|
||||||
|
if vm.guivm != vm.app.get_local_name():
|
||||||
|
continue
|
||||||
if vm.klass == 'AdminVM':
|
if vm.klass == 'AdminVM':
|
||||||
continue
|
continue
|
||||||
if vm.is_running():
|
if vm.is_running():
|
||||||
@ -322,6 +329,8 @@ class GUILauncher(object):
|
|||||||
def on_domain_spawn(self, vm, _event, **kwargs):
|
def on_domain_spawn(self, vm, _event, **kwargs):
|
||||||
"""Handler of 'domain-spawn' event, starts GUI daemon for stubdomain"""
|
"""Handler of 'domain-spawn' event, starts GUI daemon for stubdomain"""
|
||||||
try:
|
try:
|
||||||
|
if vm.guivm != vm.app.get_local_name():
|
||||||
|
return
|
||||||
if not vm.features.check_with_template('gui', True):
|
if not vm.features.check_with_template('gui', True):
|
||||||
return
|
return
|
||||||
if vm.virt_mode == 'hvm' and \
|
if vm.virt_mode == 'hvm' and \
|
||||||
@ -333,6 +342,8 @@ class GUILauncher(object):
|
|||||||
def on_domain_start(self, vm, _event, **kwargs):
|
def on_domain_start(self, vm, _event, **kwargs):
|
||||||
"""Handler of 'domain-start' event, starts GUI daemon for actual VM"""
|
"""Handler of 'domain-start' event, starts GUI daemon for actual VM"""
|
||||||
try:
|
try:
|
||||||
|
if vm.guivm != vm.app.get_local_name():
|
||||||
|
return
|
||||||
if not vm.features.check_with_template('gui', True):
|
if not vm.features.check_with_template('gui', True):
|
||||||
return
|
return
|
||||||
if kwargs.get('start_guid', 'True') == 'True':
|
if kwargs.get('start_guid', 'True') == 'True':
|
||||||
@ -349,6 +360,11 @@ class GUILauncher(object):
|
|||||||
for vm in self.app.domains:
|
for vm in self.app.domains:
|
||||||
if vm.klass == 'AdminVM':
|
if vm.klass == 'AdminVM':
|
||||||
continue
|
continue
|
||||||
|
try:
|
||||||
|
if vm.guivm != vm.app.get_local_name():
|
||||||
|
continue
|
||||||
|
except qubesadmin.exc.QubesPropertyAccessError:
|
||||||
|
continue
|
||||||
if not vm.features.check_with_template('gui', True):
|
if not vm.features.check_with_template('gui', True):
|
||||||
continue
|
continue
|
||||||
power_state = vm.get_power_state()
|
power_state = vm.get_power_state()
|
||||||
|
Loading…
Reference in New Issue
Block a user