1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-11 12:46:49 +00:00

fix(instances): a running VM's boot order, video and console forms show the pending settings

On an active VM the boot order editor, the video model select and the
console form showed the running VM: a pending boot order, video model or
console setting looked unset, and the boot order editor offered devices
of the running VM only. Choosing one of those cleared the pending order,
since the setter dropped the old order and skipped devices it could not
find. They now read the persistent definition (get_bootmenu,
get_bootorder, get_media_devices, get_video_model and the console
getters take config=), and set_bootorder refuses a device that is not in
it before it changes anything.
This commit is contained in:
catborise 2026-10-11 14:18:20 +03:00
parent 042530fbfd
commit d0bd2ac32b
9 changed files with 152 additions and 35 deletions

View file

@ -185,6 +185,38 @@ class Instance(models.Model):
def config_description(self) -> str:
return self.proxy.get_description(config=True)
@cached_property
def config_media(self) -> list[dict]:
"""CD-ROMs, boot menu and boot order of the persistent definition,
which the boot order editor changes."""
return self.proxy.get_media_devices(config=True)
@cached_property
def config_bootmenu(self) -> bool:
return self.proxy.get_bootmenu(config=True)
@cached_property
def config_boot_order(self) -> dict:
return self.proxy.get_bootorder(config=True)
@cached_property
def config_video_model(self) -> str | None:
"""Video model and console settings of the persistent definition,
which their forms change."""
return self.proxy.get_video_model(config=True)
@cached_property
def config_console_listener_address(self) -> str:
return self.proxy.get_console_listener_addr(config=True)
@cached_property
def config_console_passwd(self):
return self.proxy.get_console_passwd(config=True)
@cached_property
def config_console_keymap(self) -> str:
return self.proxy.get_console_keymap(config=True)
@cached_property
def telnet_port(self):
return self.proxy.get_telnet_port()