mirror of
https://github.com/retspen/webvirtcloud
synced 2026-11-09 11:46:49 +00:00
feat(instances): a VM's boot settings as switches and its boot order as one list
The Boot pane shows Autostart and the boot menu as switches that save on change, and the boot order as one list of the VM's disks, CD-ROM drives and NICs: the devices in the order first, checked and numbered, the others below. Up and Down move the checked devices; Apply order saves. - The boot menu can be changed while the VM runs: it is in the persistent definition, so it applies at the next start, as the boot order does. - The boot order editor no longer needs the boot menu enabled. - A VM that boots by device type (<os><boot dev='hd'/>) names those types; checking devices replaces that order. - An order is refused while a device the list does not show (a host device, a floppy) has a boot place, so Apply does not drop it; the message points to the XML editor. - An empty order is refused with a message instead of being ignored. - get_bootorder gives a NIC's full MAC as its target. - The unused jQuery multiselect plugin is removed.
This commit is contained in:
parent
a8f445d580
commit
20cfc25367
10 changed files with 168 additions and 163 deletions
|
|
@ -140,6 +140,16 @@ class DeviceEditsTestCase(unittest.TestCase):
|
|||
p.set_bootorder({0: {"type": "disk", "dev": "vda"}, 1: choice})
|
||||
p._defineXML.assert_not_called()
|
||||
|
||||
def test_a_boot_order_holding_a_device_the_list_does_not_show_is_not_replaced(self):
|
||||
for other in ("<hostdev mode='subsystem' type='pci'><boot order='2'/></hostdev>",
|
||||
"<disk type='file' device='floppy'><target dev='fda'/><boot order='2'/></disk>"):
|
||||
with self.subTest(other):
|
||||
p = proxy()
|
||||
p._XMLDesc = lambda flags, other=other: PERSISTENT.replace("<video>", other + "<video>")
|
||||
with self.assertRaises(util.OperationError):
|
||||
p.set_bootorder({0: {"type": "disk", "dev": "vda"}})
|
||||
p._defineXML.assert_not_called()
|
||||
|
||||
def test_the_default_nic_model_leaves_the_choice_to_libvirt(self):
|
||||
p = proxy()
|
||||
p.change_network("52:54:10:00:00:01", "52:54:10:00:00:01", "default", "net", "default", "")
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ class DeviceGettersTestCase(unittest.TestCase):
|
|||
order = proxy().get_bootorder()
|
||||
self.assertEqual(
|
||||
[order[i]["target"] for i in range(4)],
|
||||
["nic-00:00:02", "nic-00:00:03", "vda", "vdb"],
|
||||
["52:54:10:00:00:02", "52:54:10:00:00:03", "vda", "vdb"],
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue