mirror of
https://github.com/retspen/webvirtcloud
synced 2026-11-11 12:46:49 +00:00
perf(instances): the new VM page does not list the host's VMs or read its capabilities
The page never showed either: get_instances() looked up every running domain and get_capabilities() parsed the host capabilities on each load, and both results were thrown away. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
This commit is contained in:
parent
ce98bc85d0
commit
6f12e10091
2 changed files with 2 additions and 5 deletions
|
|
@ -109,7 +109,6 @@ class CreateInstanceViewTests(TestCase):
|
|||
conn.get_network_models.return_value = ["virtio"]
|
||||
conn.get_storages.return_value = ["default"]
|
||||
conn.get_dom_capabilities.return_value = {"loader_enums": [], "loaders": [], "cpu_modes": ["host-model"]}
|
||||
conn.get_capabilities.return_value = {}
|
||||
conn.get_firmwares.return_value = ["BIOS", "UEFI", "UEFI Secure Boot"]
|
||||
conn.get_tpm_model.return_value = "tpm-crb"
|
||||
for method, value in (host or {}).items():
|
||||
|
|
@ -147,14 +146,12 @@ class CreateInstanceViewTests(TestCase):
|
|||
name="create-fw-compute", hostname="localhost", type=4, login="", password="",
|
||||
)
|
||||
conn = connection_class.return_value
|
||||
conn.get_instances.return_value = []
|
||||
conn.get_storages.return_value = []
|
||||
conn.get_networks.return_value = []
|
||||
conn.get_nwfilters.return_value = []
|
||||
conn.get_cache_modes.return_value = {}
|
||||
# A host without loader support has no "loaders"/"loader_enums" keys
|
||||
conn.get_dom_capabilities.return_value = {"loader_support": "no", "cpu_modes": ["host-model"]}
|
||||
conn.get_capabilities.return_value = {}
|
||||
conn.get_firmwares.return_value = ["BIOS"]
|
||||
conn.get_tpm_model.return_value = None
|
||||
|
||||
|
|
@ -162,6 +159,8 @@ class CreateInstanceViewTests(TestCase):
|
|||
|
||||
self.assertEqual(response.status_code, 200)
|
||||
conn.get_firmwares.assert_called_once_with("x86_64", "q35")
|
||||
conn.get_instances.assert_not_called() # the page lists no VMs
|
||||
conn.get_capabilities.assert_not_called()
|
||||
# a fresh host: what to do, not that the user defined nothing
|
||||
self.assertContains(response, "This host has no running storage pool for the VM's disks: add or start one on its Storage page.")
|
||||
conn.get_storages.return_value = ["default"]
|
||||
|
|
|
|||
|
|
@ -2541,7 +2541,6 @@ def create_instance(request, compute_id, arch, machine):
|
|||
|
||||
default_firmware = app_settings.INSTANCE_FIRMWARE_DEFAULT_TYPE
|
||||
default_cpu_mode = app_settings.INSTANCE_CPU_DEFAULT_MODE
|
||||
instances = conn.get_instances()
|
||||
videos = conn.get_video_models(arch, machine)
|
||||
default_video = app_settings.INSTANCE_VIDEO_DEFAULT_TYPE
|
||||
cache_modes = sorted(conn.get_cache_modes().items())
|
||||
|
|
@ -2568,7 +2567,6 @@ def create_instance(request, compute_id, arch, machine):
|
|||
default_input_device_bus = app_settings.INSTANCE_INPUT_DEFAULT_DEVICE
|
||||
|
||||
dom_caps = conn.get_dom_capabilities(arch, machine)
|
||||
caps = conn.get_capabilities(arch)
|
||||
|
||||
virtio_support = conn.is_supports_virtio(arch, machine)
|
||||
firmwares = conn.get_firmwares(arch, machine)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue