mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-01-03 11:25:20 +00:00
tests: Add `test_live_migration_numa_local'
Signed-off-by: Bo Chen <chen.bo@intel.com>
This commit is contained in:
parent
f81220ae2d
commit
7e9c61ab18
@ -7273,8 +7273,9 @@ mod live_migration {
|
||||
net_id, guest.network.guest_mac, guest.network.host_ip
|
||||
);
|
||||
|
||||
let memory_param: &[&str] = if numa {
|
||||
&[
|
||||
let memory_param: &[&str] = match (local, numa) {
|
||||
(false, false) => &["--memory", "size=4G"],
|
||||
(false, true) => &[
|
||||
"--memory",
|
||||
"size=0,hotplug_method=virtio-mem",
|
||||
"--memory-zone",
|
||||
@ -7285,11 +7286,20 @@ mod live_migration {
|
||||
"guest_numa_id=0,cpus=[0-2,9],distances=[1@15,2@20],memory_zones=mem0",
|
||||
"guest_numa_id=1,cpus=[3-4,6-8],distances=[0@20,2@25],memory_zones=mem1",
|
||||
"guest_numa_id=2,cpus=[5,10-11],distances=[0@25,1@30],memory_zones=mem2",
|
||||
]
|
||||
} else if local {
|
||||
&["--memory", "size=4G,shared=on"]
|
||||
} else {
|
||||
&["--memory", "size=4G"]
|
||||
],
|
||||
(true, false) => &["--memory", "size=4G,shared=on"],
|
||||
(true, true) => &[
|
||||
"--memory",
|
||||
"size=0,hotplug_method=virtio-mem,shared=on",
|
||||
"--memory-zone",
|
||||
"id=mem0,size=1G,hotplug_size=32G,shared=on",
|
||||
"id=mem1,size=1G,hotplug_size=32G,shared=on",
|
||||
"id=mem2,size=2G,hotplug_size=32G,shared=on",
|
||||
"--numa",
|
||||
"guest_numa_id=0,cpus=[0-2,9],distances=[1@15,2@20],memory_zones=mem0",
|
||||
"guest_numa_id=1,cpus=[3-4,6-8],distances=[0@20,2@25],memory_zones=mem1",
|
||||
"guest_numa_id=2,cpus=[5,10-11],distances=[0@25,1@30],memory_zones=mem2",
|
||||
],
|
||||
};
|
||||
|
||||
// Start the source VM
|
||||
@ -7583,6 +7593,12 @@ mod live_migration {
|
||||
_test_live_migration(true, false)
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(not(feature = "mshv"))]
|
||||
fn test_live_migration_numa_local() {
|
||||
_test_live_migration(true, true)
|
||||
}
|
||||
|
||||
fn _test_live_migration_ovs_dpdk(local: bool) {
|
||||
let ovs_focal = UbuntuDiskConfig::new(FOCAL_IMAGE_NAME.to_string());
|
||||
let ovs_guest = Guest::new(Box::new(ovs_focal));
|
||||
|
Loading…
Reference in New Issue
Block a user