mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
tests: Use separate IP address for guest -> host notification
This will allow an L2 guest to notify the L1 host. Signed-off-by: Rob Bradford <rbradford@meta.com>
This commit is contained in:
@@ -73,4 +73,4 @@ write_files:
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
echo -n "@DEFAULT_TCP_LISTENER_MESSAGE" > /dev/tcp/@HOST_IP/@TCP_LISTENER_PORT
|
||||
echo -n "@DEFAULT_TCP_LISTENER_MESSAGE" > /dev/tcp/@NOTIFY_IP/@TCP_LISTENER_PORT
|
||||
|
||||
@@ -207,6 +207,7 @@ pub struct GuestNetworkConfig {
|
||||
pub l2_guest_mac2: String,
|
||||
pub l2_guest_mac3: String,
|
||||
pub tcp_listener_port: u16,
|
||||
pub notify_ip: String,
|
||||
}
|
||||
|
||||
pub const DEFAULT_TCP_LISTENER_MESSAGE: &str = "booted";
|
||||
@@ -461,7 +462,7 @@ impl DiskConfig for UbuntuDiskConfig {
|
||||
"@DEFAULT_TCP_LISTENER_MESSAGE",
|
||||
DEFAULT_TCP_LISTENER_MESSAGE,
|
||||
);
|
||||
user_data_string = user_data_string.replace("@HOST_IP", &network.host_ip0);
|
||||
user_data_string = user_data_string.replace("@NOTIFY_IP", &network.notify_ip);
|
||||
user_data_string =
|
||||
user_data_string.replace("@TCP_LISTENER_PORT", &network.tcp_listener_port.to_string());
|
||||
|
||||
@@ -1202,6 +1203,7 @@ impl Guest {
|
||||
l2_guest_mac2: format!("de:ad:be:ef:34:{id:02x}"),
|
||||
l2_guest_mac3: format!("de:ad:be:ef:56:{id:02x}"),
|
||||
tcp_listener_port: DEFAULT_TCP_LISTENER_PORT + id as u16,
|
||||
notify_ip: format!("{class}.{id}.1"),
|
||||
};
|
||||
|
||||
disk_config.prepare_files(&tmp_dir, &network);
|
||||
|
||||
Reference in New Issue
Block a user