mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
api: http: handle cpu according to openapi
openapi definition defines an object for cpus not an integer Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
This commit is contained in:
committed by
Samuel Ortiz
parent
205b8c1cd5
commit
78e2f7a99a
@@ -346,7 +346,7 @@ fn main() {
|
||||
"Cloud Hypervisor Guest\n\tAPI server: {}\n\tvCPUs: {}\n\tMemory: {} MB\
|
||||
\n\tKernel: {:?}\n\tKernel cmdline: {}\n\tDisk(s): {:?}",
|
||||
api_socket_path,
|
||||
u8::from(&vm_config.cpus),
|
||||
vm_config.cpus.cpu_count,
|
||||
vm_config.memory.size >> 20,
|
||||
vm_config.kernel,
|
||||
vm_config.cmdline.args.as_str(),
|
||||
@@ -901,7 +901,7 @@ mod tests {
|
||||
}
|
||||
|
||||
fn api_create_body(&self, cpu_count: u8) -> String {
|
||||
format! {"{{\"cpus\":{},\"kernel\":{{\"path\":\"{}\"}},\"cmdline\":{{\"args\": \"\"}},\"net\":[{{\"ip\":\"{}\", \"mask\":\"255.255.255.0\", \"mac\":\"{}\"}}], \"disks\":[{{\"path\":\"{}\"}}, {{\"path\":\"{}\"}}]}}",
|
||||
format! {"{{\"cpus\":{{\"cpu_count\":{}}},\"kernel\":{{\"path\":\"{}\"}},\"cmdline\":{{\"args\": \"\"}},\"net\":[{{\"ip\":\"{}\", \"mask\":\"255.255.255.0\", \"mac\":\"{}\"}}], \"disks\":[{{\"path\":\"{}\"}}, {{\"path\":\"{}\"}}]}}",
|
||||
cpu_count,
|
||||
self.fw_path.as_str(),
|
||||
self.network.host_ip,
|
||||
|
||||
Reference in New Issue
Block a user