1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-12-02 08:56:07 +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

@ -121,9 +121,9 @@ def _instance_page(request, pk, instance, compute):
if can_manage_console:
console_form = ConsoleForm(
initial={
"listen_on": instance.console_listener_address,
"password": instance.console_passwd,
"keymap": instance.console_keymap,
"listen_on": instance.config_console_listener_address,
"password": instance.config_console_passwd,
"keymap": instance.config_console_keymap,
},
can_set_listener=request.user.is_superuser,
)
@ -1501,7 +1501,11 @@ def set_bootorder(request, pk):
for idx, val in enumerate(bootorder.split(",")):
dev_type, dev = val.split(":", 1)
order_list[idx] = {"type": dev_type, "dev": dev}
instance.proxy.set_bootorder(order_list)
try:
instance.proxy.set_bootorder(order_list)
except util.OperationError as err:
messages.error(request, err)
return _back(request, pk, "boot_opt")
msg = _("Set boot order")
if not instance.proxy.get_status() == 5: