clan_vm_manager: Fix switch <-> vm status desync
This commit is contained in:
parent
cd5afa1329
commit
6f590ce389
@ -254,15 +254,15 @@ class VMObject(GObject.Object):
|
|||||||
f"VM {self.get_id()} has not stopped after {self.KILL_TIMEOUT}s. Killing it"
|
f"VM {self.get_id()} has not stopped after {self.KILL_TIMEOUT}s. Killing it"
|
||||||
)
|
)
|
||||||
self.vm_process.kill_group()
|
self.vm_process.kill_group()
|
||||||
return
|
break
|
||||||
if self.is_building():
|
if self.is_building():
|
||||||
log.info(f"VM {self.get_id()} is still building. Killing it")
|
log.info(f"VM {self.get_id()} is still building. Killing it")
|
||||||
self.build_process.kill_group()
|
self.build_process.kill_group()
|
||||||
return
|
break
|
||||||
if not self.machine:
|
if not self.machine:
|
||||||
log.error(f"Machine object is None. Killing VM {self.get_id()}")
|
log.error(f"Machine object is None. Killing VM {self.get_id()}")
|
||||||
self.vm_process.kill_group()
|
self.vm_process.kill_group()
|
||||||
return
|
break
|
||||||
|
|
||||||
# Try to shutdown the VM gracefully using QMP
|
# Try to shutdown the VM gracefully using QMP
|
||||||
try:
|
try:
|
||||||
|
@ -4,7 +4,7 @@ from functools import partial
|
|||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
import gi
|
import gi
|
||||||
from clan_cli import history, machines
|
from clan_cli import history
|
||||||
from clan_cli.clan_uri import ClanURI
|
from clan_cli.clan_uri import ClanURI
|
||||||
|
|
||||||
from clan_vm_manager.components.interfaces import ClanConfig
|
from clan_vm_manager.components.interfaces import ClanConfig
|
||||||
@ -81,9 +81,10 @@ class ClanList(Gtk.Box):
|
|||||||
app.add_action(add_action)
|
app.add_action(add_action)
|
||||||
|
|
||||||
menu_model = Gio.Menu()
|
menu_model = Gio.Menu()
|
||||||
for vm in machines.list.list_machines(flake_url=vm.data.flake.flake_url):
|
# TODO: Make this lazy, blocks UI startup for too long
|
||||||
if vm not in vm_store:
|
# for vm in machines.list.list_machines(flake_url=vm.data.flake.flake_url):
|
||||||
menu_model.append(vm, f"app.add::{vm}")
|
# if vm not in vm_store:
|
||||||
|
# menu_model.append(vm, f"app.add::{vm}")
|
||||||
|
|
||||||
box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5)
|
box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5)
|
||||||
box.set_valign(Gtk.Align.CENTER)
|
box.set_valign(Gtk.Align.CENTER)
|
||||||
|
Loading…
Reference in New Issue
Block a user