mirror of
https://github.com/retspen/webvirtcloud
synced 2026-11-11 12:46:49 +00:00
fix(instances): device edits fit every definition and device type
A volume of an LVM or iSCSI pool can be attached: by its own path, with the format its volume reports (raw when the pool knows none). Detaching a disk takes each definition's own description of it, so a disk only in the persistent definition goes too. Every NIC type can be a boot device; bridge and direct NICs were dropped from the boot order. The video model is a value, never parsed as XML. QoS changes clear the page's read cache. The NIC model "default" leaves the choice to libvirt instead of writing model "default", and rt18139 is rtl8139: a VM with either did not start (checked on a RHEL 10 host). A migration corrects the default NIC type setting.
This commit is contained in:
parent
769a0dc96f
commit
11fe2409f9
12 changed files with 250 additions and 48 deletions
|
|
@ -17,6 +17,7 @@ from vrtManager.util import (
|
|||
validate_macaddr,
|
||||
validate_uuid,
|
||||
vol_dev_type,
|
||||
vol_driver_type,
|
||||
xml_escape,
|
||||
)
|
||||
|
||||
|
|
@ -128,6 +129,13 @@ class TestVrtManagerUtil(unittest.TestCase):
|
|||
self.assertEqual(vol_dev_type("sata"), "sd")
|
||||
self.assertIsNone(vol_dev_type("unknown_bus"))
|
||||
|
||||
def test_vol_driver_type(self):
|
||||
for vol_format in ("qcow2", "qcow", "raw"):
|
||||
self.assertEqual(vol_driver_type(vol_format), vol_format)
|
||||
for vol_format in (None, "", "none", "unknown", "iso"):
|
||||
self.assertEqual(vol_driver_type(vol_format), "raw")
|
||||
self.assertEqual(vol_driver_type("linux-lvm", "disk"), "raw") # a partition
|
||||
|
||||
|
||||
|
||||
class OperationErrorTestCase(unittest.TestCase):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue