| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
feat(mmds): wire QMP commands and implement MMDS handlers for all machine types QMP layer (machine_manager/src/qmp/): - qmp_schema.rs: register put-mmds, patch-mmds, get-mmds, put-mmds-config with typed arg structs (MmdsPutArgs, MmdsPatchArgs, MmdsConfigArgs). - qmp_socket.rs: dispatch the four new commands to DeviceInterface. - machine.rs: add default "not supported" stubs to DeviceInterface trait. LightMachine (micro_common/mod.rs): - Hold mmds_store: Arc<Mutex<MmdsStore>> on the struct. - Implement mmds_put/patch/get/config; propagate the store to virtio-net slots in fill_replaceable_device / add_net_replaceable_device. - Clear the store reference on device detach. StdMachine (standard_common/mod.rs, aarch64 + x86_64): - Add mmds_store: Option<Arc<Mutex<MmdsStore>>> to MachineBase (None for microvm which owns its own); initialize in StdMachine::new(). - Wire the store into virtio-net-pci devices at add_net_device time when the iface ID is already present in the MMDS config. - mmds_config rejects vhost interfaces (they bypass the virtio TX path), writes the new MmdsConfig, then atomically enables or clears MmdsTcpStack on each virtio-net device. - Make net_devs pub(crate) so standard_common can access it directly. mmds/mod.rs: add parse_ipv4() helper and unit tests covering MmdsStore put/patch/get, IMDSv2 token lifecycle, interface filtering, parse_ipv4 edge cases, and StdMachine MMDS handler logic. (cherry picked from commit 1278034bb65453927a84409f570dfcf67c67439e) | 4 天前 | |
feat(mmds): add MMDS core module with data store and in-process TCP/IP stack Add machine_manager/src/mmds/ with two files: - mod.rs: MmdsStore backed by MmdsData (instanceID, envID, address, accessTokenHash). Supports IMDSv1 (unauthenticated GET) and IMDSv2 (PUT /latest/api/token → TTL-bounded token, validated per-request via X-metadata-token header). MmdsConfig holds version (V2 by default), bound interface IDs, and endpoint IP (default 169.254.169.254). - tcp_stack.rs: MmdsTcpStack — minimal in-process TCP state machine keyed by (src_ip, src_port). Parses VirtioNetHdr + Ethernet + IPv4 + TCP, drives Listen→SynReceived→Established→CloseWait→LastAck lifecycle, demultiplexes HTTP/1.1 GET/PUT under /latest/ to MmdsStore, and returns raw response frames ready for guest RX virtqueue injection. (cherry picked from commit 203c3415c5a9ec6fafe45a7e122247d90f9c20c1) | 4 天前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 4 天前 | ||
| 4 天前 |