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

feat(instances): a running VM's XML can be edited for its next start

The XML editor of a running or paused VM only showed its XML. It now
shows the persistent definition, the one the VM starts with next (with
secrets, like the other edit forms), and Change saves it through the same
review dialog; the running VM keeps its live configuration until it
restarts. The tab and the saved message say so. The check against a
definition changed since the editor was opened covers this case too.
This commit is contained in:
catborise 2026-10-24 19:44:10 +03:00
parent 3f329b50dd
commit ec679d4d7a
6 changed files with 49 additions and 55 deletions

View file

@ -6,12 +6,11 @@ from django.utils.translation import gettext_lazy as _
from libvirt import (
VIR_DOMAIN_SNAPSHOT_LIST_EXTERNAL,
VIR_DOMAIN_SNAPSHOT_LIST_INTERNAL,
VIR_DOMAIN_XML_SECURE,
libvirtError,
)
from operations import claims
from operations.models import Claim
from vrtManager.instance import wvmInstance
from vrtManager.instance import PERSISTENT_XML, wvmInstance
from webvirtcloud.settings import QEMU_CONSOLE_LISTENER_ADDRESSES
@ -291,7 +290,8 @@ class Instance(models.Model):
@cached_property
def inst_xml(self):
return self.proxy._XMLDesc(VIR_DOMAIN_XML_SECURE)
# the definition for the next start, which is the current one while the VM is off
return self.proxy._XMLDesc(PERSISTENT_XML)
@cached_property
def has_managed_save_image(self):