@@ -27,7 +27,9 @@ use super::request::net::{parse_patch_net, parse_put_net};
27
27
use super :: request:: snapshot:: { parse_patch_vm_state, parse_put_snapshot} ;
28
28
use super :: request:: version:: parse_get_version;
29
29
use super :: request:: vsock:: parse_put_vsock;
30
- use crate :: api_server:: request:: hotplug:: memory:: parse_put_memory_hotplug;
30
+ use crate :: api_server:: request:: hotplug:: memory:: {
31
+ parse_get_memory_hotplug, parse_put_memory_hotplug,
32
+ } ;
31
33
use crate :: api_server:: request:: serial:: parse_put_serial;
32
34
33
35
#[ derive( Debug ) ]
@@ -85,6 +87,9 @@ impl TryFrom<&Request> for ParsedRequest {
85
87
}
86
88
( Method :: Get , "machine-config" , None ) => parse_get_machine_config ( ) ,
87
89
( Method :: Get , "mmds" , None ) => parse_get_mmds ( ) ,
90
+ ( Method :: Get , "hotplug" , None ) if path_tokens. next ( ) == Some ( "memory" ) => {
91
+ parse_get_memory_hotplug ( )
92
+ }
88
93
( Method :: Get , _, Some ( _) ) => method_to_error ( Method :: Get ) ,
89
94
( Method :: Put , "actions" , Some ( body) ) => parse_put_actions ( body) ,
90
95
( Method :: Put , "balloon" , Some ( body) ) => parse_put_balloon ( body) ,
@@ -177,6 +182,7 @@ impl ParsedRequest {
177
182
Self :: success_response_with_data ( balloon_config)
178
183
}
179
184
VmmData :: BalloonStats ( stats) => Self :: success_response_with_data ( stats) ,
185
+ VmmData :: VirtioMemStatus ( data) => Self :: success_response_with_data ( data) ,
180
186
VmmData :: InstanceInformation ( info) => Self :: success_response_with_data ( info) ,
181
187
VmmData :: VmmVersion ( version) => Self :: success_response_with_data (
182
188
& serde_json:: json!( { "firecracker_version" : version. as_str( ) } ) ,
@@ -561,6 +567,9 @@ pub mod tests {
561
567
VmmData :: BalloonStats ( stats) => {
562
568
http_response ( & serde_json:: to_string ( stats) . unwrap ( ) , 200 )
563
569
}
570
+ VmmData :: VirtioMemStatus ( data) => {
571
+ http_response ( & serde_json:: to_string ( data) . unwrap ( ) , 200 )
572
+ }
564
573
VmmData :: Empty => http_response ( "" , 204 ) ,
565
574
VmmData :: FullVmConfig ( cfg) => {
566
575
http_response ( & serde_json:: to_string ( cfg) . unwrap ( ) , 200 )
0 commit comments