Skip to content

Commit 10343e4

Browse files
authored
Merge branch 'main' into fix-4547
2 parents 6b97c07 + 83aec7b commit 10343e4

File tree

6 files changed

+23
-64
lines changed

6 files changed

+23
-64
lines changed

CHANGELOG.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ and this project adheres to
1212

1313
### Changed
1414

15+
- [#4913](https://github.com/firecracker-microvm/firecracker/pull/4913): Removed
16+
unnecessary fields (`max_connections` and `max_pending_resets`) from the
17+
snapshot format, bumping the snapshot version to 5.0.0. Users need to
18+
regenerate snapshots.
19+
1520
### Deprecated
1621

1722
### Removed
@@ -22,8 +27,8 @@ and this project adheres to
2227

2328
### Changed
2429

25-
- [#4907](https://github.com/firecracker-microvm/firecracker/pull/4907): Bump
26-
snapshot version to 4.0.0.
30+
- [#4907](https://github.com/firecracker-microvm/firecracker/pull/4907): Bumped
31+
the snapshot version to 4.0.0, so users need to regenerate snapshots.
2732

2833
## \[1.10.0\]
2934

docs/RELEASE_POLICY.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ v3.1 will be patched since were the last two Firecracker releases and less than
9090

9191
| Release | Release Date | Latest Patch | Min. end of support | Official end of Support |
9292
| ------: | -----------: | -----------: | ------------------: | :------------------------------ |
93-
| v1.10 | 2024-11-07 | v1.10.0 | 2025-05-07 | Supported |
93+
| v1.10 | 2024-11-07 | v1.10.1 | 2025-05-07 | Supported |
9494
| v1.9 | 2024-09-02 | v1.9.1 | 2025-03-02 | Supported |
9595
| v1.8 | 2024-07-10 | v1.8.0 | 2025-01-10 | Supported |
9696
| v1.7 | 2024-03-18 | v1.7.0 | 2024-09-18 | 2024-09-18 (end of 6mo support) |

src/vmm/src/mmds/ns.rs

+9-36
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,6 @@ impl MmdsNetworkStack {
8181
mac_addr: MacAddr,
8282
ipv4_addr: Ipv4Addr,
8383
tcp_port: u16,
84-
max_connections: NonZeroUsize,
85-
max_pending_resets: NonZeroUsize,
8684
mmds: Arc<Mutex<Mmds>>,
8785
) -> Self {
8886
MmdsNetworkStack {
@@ -93,8 +91,8 @@ impl MmdsNetworkStack {
9391
tcp_handler: TcpIPv4Handler::new(
9492
ipv4_addr,
9593
tcp_port,
96-
max_connections,
97-
max_pending_resets,
94+
NonZeroUsize::new(DEFAULT_MAX_CONNECTIONS).unwrap(),
95+
NonZeroUsize::new(DEFAULT_MAX_PENDING_RESETS).unwrap(),
9896
),
9997
mmds,
10098
}
@@ -105,14 +103,7 @@ impl MmdsNetworkStack {
105103
let ipv4_addr = mmds_ipv4_addr.unwrap_or_else(|| Ipv4Addr::from(DEFAULT_IPV4_ADDR));
106104

107105
// The unwrap()s are safe because the given literals are greater than 0.
108-
Self::new(
109-
mac_addr,
110-
ipv4_addr,
111-
DEFAULT_TCP_PORT,
112-
NonZeroUsize::new(DEFAULT_MAX_CONNECTIONS).unwrap(),
113-
NonZeroUsize::new(DEFAULT_MAX_PENDING_RESETS).unwrap(),
114-
mmds,
115-
)
106+
Self::new(mac_addr, ipv4_addr, DEFAULT_TCP_PORT, mmds)
116107
}
117108

118109
pub fn set_ipv4_addr(&mut self, ipv4_addr: Ipv4Addr) {
@@ -562,14 +553,8 @@ mod tests {
562553
let ip = Ipv4Addr::from(DEFAULT_IPV4_ADDR);
563554
let other_ip = Ipv4Addr::new(5, 6, 7, 8);
564555
let mac = MacAddr::from_bytes_unchecked(&[0; 6]);
565-
let mut ns = MmdsNetworkStack::new(
566-
mac,
567-
ip,
568-
DEFAULT_TCP_PORT,
569-
NonZeroUsize::new(DEFAULT_MAX_CONNECTIONS).unwrap(),
570-
NonZeroUsize::new(DEFAULT_MAX_PENDING_RESETS).unwrap(),
571-
Arc::new(Mutex::new(Mmds::default())),
572-
);
556+
let mut ns =
557+
MmdsNetworkStack::new_with_defaults(Some(ip), Arc::new(Mutex::new(Mmds::default())));
573558

574559
let mut eth =
575560
EthernetFrame::write_incomplete(buf.as_mut(), mac, mac, ETHERTYPE_ARP).unwrap();
@@ -589,14 +574,8 @@ mod tests {
589574
let ip = Ipv4Addr::from(DEFAULT_IPV4_ADDR);
590575
let other_ip = Ipv4Addr::new(5, 6, 7, 8);
591576
let mac = MacAddr::from_bytes_unchecked(&[0; 6]);
592-
let ns = MmdsNetworkStack::new(
593-
mac,
594-
ip,
595-
DEFAULT_TCP_PORT,
596-
NonZeroUsize::new(DEFAULT_MAX_CONNECTIONS).unwrap(),
597-
NonZeroUsize::new(DEFAULT_MAX_PENDING_RESETS).unwrap(),
598-
Arc::new(Mutex::new(Mmds::default())),
599-
);
577+
let ns =
578+
MmdsNetworkStack::new_with_defaults(Some(ip), Arc::new(Mutex::new(Mmds::default())));
600579

601580
let mut eth =
602581
EthernetFrame::write_incomplete(buf.as_mut(), mac, mac, ETHERTYPE_IPV4).unwrap();
@@ -615,14 +594,8 @@ mod tests {
615594
let ip = Ipv4Addr::from(DEFAULT_IPV4_ADDR);
616595
let other_ip = Ipv4Addr::new(5, 6, 7, 8);
617596
let mac = MacAddr::from_bytes_unchecked(&[0; 6]);
618-
let mut ns = MmdsNetworkStack::new(
619-
mac,
620-
ip,
621-
DEFAULT_TCP_PORT,
622-
NonZeroUsize::new(DEFAULT_MAX_CONNECTIONS).unwrap(),
623-
NonZeroUsize::new(DEFAULT_MAX_PENDING_RESETS).unwrap(),
624-
Arc::new(Mutex::new(Mmds::default())),
625-
);
597+
let mut ns =
598+
MmdsNetworkStack::new_with_defaults(Some(ip), Arc::new(Mutex::new(Mmds::default())));
626599

627600
// try IPv4 with detour_arp
628601
let mut eth =

src/vmm/src/mmds/persist.rs

-15
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
//! Defines the structures needed for saving/restoring MmdsNetworkStack.
55
66
use std::net::Ipv4Addr;
7-
use std::num::NonZeroUsize;
87
use std::sync::{Arc, Mutex};
98

109
use serde::{Deserialize, Serialize};
@@ -20,8 +19,6 @@ pub struct MmdsNetworkStackState {
2019
mac_addr: [u8; MAC_ADDR_LEN as usize],
2120
ipv4_addr: u32,
2221
tcp_port: u16,
23-
max_connections: NonZeroUsize,
24-
max_pending_resets: NonZeroUsize,
2522
}
2623

2724
impl Persist<'_> for MmdsNetworkStack {
@@ -37,8 +34,6 @@ impl Persist<'_> for MmdsNetworkStack {
3734
mac_addr,
3835
ipv4_addr: self.ipv4_addr.into(),
3936
tcp_port: self.tcp_handler.local_port(),
40-
max_connections: self.tcp_handler.max_connections(),
41-
max_pending_resets: self.tcp_handler.max_pending_resets(),
4237
}
4338
}
4439

@@ -50,8 +45,6 @@ impl Persist<'_> for MmdsNetworkStack {
5045
MacAddr::from_bytes_unchecked(&state.mac_addr),
5146
Ipv4Addr::from(state.ipv4_addr),
5247
state.tcp_port,
53-
state.max_connections,
54-
state.max_pending_resets,
5548
mmds,
5649
))
5750
}
@@ -83,13 +76,5 @@ mod tests {
8376
restored_ns.tcp_handler.local_port(),
8477
ns.tcp_handler.local_port()
8578
);
86-
assert_eq!(
87-
restored_ns.tcp_handler.max_connections(),
88-
ns.tcp_handler.max_connections()
89-
);
90-
assert_eq!(
91-
restored_ns.tcp_handler.max_pending_resets(),
92-
ns.tcp_handler.max_pending_resets()
93-
);
9479
}
9580
}

src/vmm/src/persist.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ pub enum CreateSnapshotError {
157157
}
158158

159159
/// Snapshot version
160-
pub const SNAPSHOT_VERSION: Version = Version::new(4, 0, 0);
160+
pub const SNAPSHOT_VERSION: Version = Version::new(5, 0, 0);
161161

162162
/// Creates a Microvm snapshot.
163163
pub fn create_snapshot(

tests/framework/utils_cpu_templates.py

+5-9
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,12 @@ def get_supported_cpu_templates():
4242

4343
SUPPORTED_CPU_TEMPLATES = get_supported_cpu_templates()
4444

45-
# Custom CPU templates for Aarch64 for testing
46-
AARCH64_CUSTOM_CPU_TEMPLATES_G2 = ["v1n1"]
47-
AARCH64_CUSTOM_CPU_TEMPLATES_G3 = [
48-
"aarch64_with_sve_and_pac",
49-
"v1n1",
50-
]
51-
5245

5346
def get_supported_custom_cpu_templates():
5447
"""
5548
Return the list of custom CPU templates supported by the platform.
5649
"""
50+
# pylint:disable=too-many-return-statements
5751
host_linux = global_props.host_linux_version_tpl
5852

5953
match get_cpu_vendor(), global_props.cpu_codename:
@@ -65,9 +59,11 @@ def get_supported_custom_cpu_templates():
6559
case CpuVendor.AMD, _:
6660
return AMD_TEMPLATES
6761
case CpuVendor.ARM, CpuModel.ARM_NEOVERSE_N1 if host_linux >= (6, 1):
68-
return AARCH64_CUSTOM_CPU_TEMPLATES_G2
62+
return ["v1n1"]
6963
case CpuVendor.ARM, CpuModel.ARM_NEOVERSE_V1 if host_linux >= (6, 1):
70-
return AARCH64_CUSTOM_CPU_TEMPLATES_G3
64+
return ["v1n1", "aarch64_with_sve_and_pac"]
65+
case CpuVendor.ARM, CpuModel.ARM_NEOVERSE_V1:
66+
return ["aarch64_with_sve_and_pac"]
7167
case _:
7268
return []
7369

0 commit comments

Comments
 (0)