1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-12-03 09:26:03 +00:00

fix(instances): a VM of an architecture without firmware choices or PCI cards can be created

The create page shows no firmware choice for an architecture whose host
offers none, yet the form required one, so such a VM could never be
created from the page. The firmware is now optional there: the machine's
own is used, as the job and the API already did.

s390x machines have no PCI bus for the emulated network cards (e1000,
e1000e, rtl8139), yet the create page and the VM's network tab offered
them for every architecture. They now offer default and virtio there,
and a create job refuses a card model the VM's architecture cannot have.
This commit is contained in:
catborise 2026-11-12 14:13:30 +03:00
parent 3bd519c935
commit 159049736d
12 changed files with 107 additions and 80 deletions

View file

@ -36,6 +36,7 @@ class CloudInitCreateTestCase(TransactionTestCase):
self.conn.wvm.lookupByUUIDString.side_effect = missing # until the job defines the VM
self.conn.get_instances.return_value = []
self.conn.get_networks.return_value = ["default"]
self.conn.get_network_models.return_value = ["default", "virtio"]
self.conn.get_cache_modes.return_value = {"none": "Disable cache"}
self.conn.get_firmwares.return_value = ["BIOS", "UEFI", "UEFI Secure Boot"]
self.conn.get_dom_capabilities.return_value = {"cpu_modes": ["host-model"]}