Skip to main content

cloud_hypervisor_client/models/
balloon_config.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#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct BalloonConfig {
16    #[serde(rename = "size")]
17    pub size: i64,
18    /// Deflate balloon when the guest is under memory pressure.
19    #[serde(rename = "deflate_on_oom", skip_serializing_if = "Option::is_none")]
20    pub deflate_on_oom: Option<bool>,
21    /// Enable guest to report free pages.
22    #[serde(
23        rename = "free_page_reporting",
24        skip_serializing_if = "Option::is_none"
25    )]
26    pub free_page_reporting: Option<bool>,
27}
28
29impl BalloonConfig {
30    pub fn new(size: i64) -> BalloonConfig {
31        BalloonConfig {
32            size,
33            deflate_on_oom: None,
34            free_page_reporting: None,
35        }
36    }
37}