Skip to content

Commit d59fd82

Browse files
authored
migration: new case updating interface during migration (#6611)
This commit adds test cases for updating network interface MTU settings in guest XML configuration during live migration scenarios. The motivation is to ensure network configuration integrity during complex migration procedures, preventing connectivity issues that may arise from inconsistent MTU settings. The approach involves modifying MTU values at different migration stages and validating network functionality post-migration. Reference: xxxx-298951 Signed-off-by: nanli <[email protected]>
1 parent cac3cfe commit d59fd82

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

libvirt/tests/cfg/migration/migration_xml_update.cfg

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,13 @@
4545
new_address = <address type='pci' domain='0x0000' bus='0x00' slot='0x1B' function='0x7'/>
4646
s390-virtio:
4747
new_address = <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x9999'/>
48+
- update_interface_mtu:
49+
remove_all = interface
50+
modify = mtu
51+
status_error = yes
52+
original_mtu = "5000"
53+
updated_mtu = "6000"
54+
add_device = {"type_name": "network", "source": {"network": "default"}, "model": "virtio", "mtu": {"size": "${original_mtu}"}}
55+
err_msg = "unsupported configuration: Target network card MTU .* does not match source .*"
56+
4857

libvirt/tests/src/migration/migration_xml_update.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ def create_migration_xml(test, vm_name, params):
5555
old_address = dev.find("address")
5656
dev.remove(old_address)
5757
dev.append(new_address)
58+
elif modify == "mtu":
59+
# Update MTU size for interface element
60+
mtu_element = dev.find("mtu")
61+
mtu_element.attrib['size'] = params.get("updated_mtu")
62+
5863
ElementTree.ElementTree(vmxml).write(tmp_file)
5964

6065

0 commit comments

Comments
 (0)