vmm: Remove balloon options from --memory parameter

The standalone `--balloon` parameter being fully functional at this
point, we can get rid of the balloon options from the --memory
parameter.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf 2020-10-14 14:00:05 +02:00
parent 3594685279
commit f4e391922f
4 changed files with 5 additions and 46 deletions

View File

@ -18,14 +18,12 @@ struct MemoryConfig {
hotplug_method: HotplugMethod, hotplug_method: HotplugMethod,
hotplug_size: Option<u64>, hotplug_size: Option<u64>,
hotplugged_size: Option<u64>, hotplugged_size: Option<u64>,
balloon: bool,
balloon_size: u64,
zones: Option<Vec<MemoryZoneConfig>>, zones: Option<Vec<MemoryZoneConfig>>,
} }
``` ```
``` ```
--memory <memory> Memory parameters "size=<guest_memory_size>,mergeable=on|off,shared=on|off,hugepages=on|off,hotplug_method=acpi|virtio-mem,hotplug_size=<hotpluggable_memory_size>,hotplugged_size=<hotplugged_memory_size>,balloon=on|off" --memory <memory> Memory parameters "size=<guest_memory_size>,mergeable=on|off,shared=on|off,hugepages=on|off,hotplug_method=acpi|virtio-mem,hotplug_size=<hotpluggable_memory_size>,hotplugged_size=<hotplugged_memory_size>"
``` ```
### `size` ### `size`
@ -142,20 +140,6 @@ _Example_
--memory size=1G,hotplug_method=virtio-mem,hotplug_size=1G,hotplugged_size=512M --memory size=1G,hotplug_method=virtio-mem,hotplug_size=1G,hotplugged_size=512M
``` ```
### `balloon`
Specifies if the `virtio-balloon` device must be activated. This creates a
dedicated virtio device for managing the balloon in the guest, which allows
guest to access more or less memory depending on the balloon size.
By default this option is turned off.
_Example_
```
--memory size=1G,balloon=on
```
## Advanced Parameters ## Advanced Parameters
`MemoryZoneConfig` or what is known as `--memory-zone` from the CLI perspective `MemoryZoneConfig` or what is known as `--memory-zone` from the CLI perspective

View File

@ -111,8 +111,7 @@ fn create_app<'a, 'b>(
\"size=<guest_memory_size>,mergeable=on|off,shared=on|off,hugepages=on|off,\ \"size=<guest_memory_size>,mergeable=on|off,shared=on|off,hugepages=on|off,\
hotplug_method=acpi|virtio-mem,\ hotplug_method=acpi|virtio-mem,\
hotplug_size=<hotpluggable_memory_size>,\ hotplug_size=<hotpluggable_memory_size>,\
hotplugged_size=<hotplugged_memory_size>,\ hotplugged_size=<hotplugged_memory_size>\"",
balloon=on|off\"",
) )
.default_value(&default_memory) .default_value(&default_memory)
.group("vm-config"), .group("vm-config"),
@ -572,8 +571,6 @@ mod unit_tests {
hotplugged_size: None, hotplugged_size: None,
shared: false, shared: false,
hugepages: false, hugepages: false,
balloon: false,
balloon_size: 0,
zones: None, zones: None,
}, },
kernel: Some(KernelConfig { kernel: Some(KernelConfig {

View File

@ -537,12 +537,6 @@ components:
hugepages: hugepages:
type: boolean type: boolean
default: false default: false
balloon:
type: boolean
default: false
balloon_size:
type: integer
format: int64
zones: zones:
type: array type: array
items: items:
@ -810,8 +804,8 @@ components:
description: desired memory ram in bytes description: desired memory ram in bytes
type: integer type: integer
format: int64 format: int64
desired_ram_w_balloon: desired_balloon:
description: desired ballon size in bytes description: desired balloon size in bytes
type: integer type: integer
format: int64 format: int64

View File

@ -418,10 +418,6 @@ pub struct MemoryConfig {
#[serde(default)] #[serde(default)]
pub hugepages: bool, pub hugepages: bool,
#[serde(default)] #[serde(default)]
pub balloon: bool,
#[serde(default)]
pub balloon_size: u64,
#[serde(default)]
pub zones: Option<Vec<MemoryZoneConfig>>, pub zones: Option<Vec<MemoryZoneConfig>>,
} }
@ -436,8 +432,7 @@ impl MemoryConfig {
.add("hotplug_size") .add("hotplug_size")
.add("hotplugged_size") .add("hotplugged_size")
.add("shared") .add("shared")
.add("hugepages") .add("hugepages");
.add("balloon");
parser.parse(memory).map_err(Error::ParseMemory)?; parser.parse(memory).map_err(Error::ParseMemory)?;
let size = parser let size = parser
@ -472,11 +467,6 @@ impl MemoryConfig {
.map_err(Error::ParseMemory)? .map_err(Error::ParseMemory)?
.unwrap_or(Toggle(false)) .unwrap_or(Toggle(false))
.0; .0;
let balloon = parser
.convert::<Toggle>("balloon")
.map_err(Error::ParseMemory)?
.unwrap_or(Toggle(false))
.0;
let zones: Option<Vec<MemoryZoneConfig>> = if let Some(memory_zones) = &memory_zones { let zones: Option<Vec<MemoryZoneConfig>> = if let Some(memory_zones) = &memory_zones {
let mut zones = Vec::new(); let mut zones = Vec::new();
@ -546,8 +536,6 @@ impl MemoryConfig {
hotplugged_size, hotplugged_size,
shared, shared,
hugepages, hugepages,
balloon,
balloon_size: 0,
zones, zones,
}) })
} }
@ -581,8 +569,6 @@ impl Default for MemoryConfig {
hotplugged_size: None, hotplugged_size: None,
shared: false, shared: false,
hugepages: false, hugepages: false,
balloon: false,
balloon_size: 0,
zones: None, zones: None,
} }
} }
@ -2194,8 +2180,6 @@ mod tests {
hotplugged_size: None, hotplugged_size: None,
shared: false, shared: false,
hugepages: false, hugepages: false,
balloon: false,
balloon_size: 0,
zones: None, zones: None,
}, },
kernel: Some(KernelConfig { kernel: Some(KernelConfig {