Skip to main content

cloud_hypervisor_client/models/
vm_info.rs

1/*
2 * Cloud Hypervisor API
3 *
4 * Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
5 *
6 * The version of the OpenAPI document: 0.3.0
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// VmInfo : Virtual Machine information
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct VmInfo {
17    #[serde(rename = "config")]
18    pub config: models::VmConfig,
19    #[serde(rename = "state")]
20    pub state: models::VmState,
21    #[serde(rename = "memory_actual_size", skip_serializing_if = "Option::is_none")]
22    pub memory_actual_size: Option<i64>,
23    #[serde(rename = "device_tree", skip_serializing_if = "Option::is_none")]
24    pub device_tree: Option<std::collections::HashMap<String, models::DeviceNode>>,
25}
26
27impl VmInfo {
28    /// Virtual Machine information
29    pub fn new(config: models::VmConfig, state: models::VmState) -> VmInfo {
30        VmInfo {
31            config,
32            state,
33            memory_actual_size: None,
34            device_tree: None,
35        }
36    }
37}