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_size: Option<u64>,
hotplugged_size: Option<u64>,
balloon: bool,
balloon_size: u64,
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`
@ -142,20 +140,6 @@ _Example_
--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
`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,\
hotplug_method=acpi|virtio-mem,\
hotplug_size=<hotpluggable_memory_size>,\
hotplugged_size=<hotplugged_memory_size>,\
balloon=on|off\"",
hotplugged_size=<hotplugged_memory_size>\"",
)
.default_value(&default_memory)
.group("vm-config"),
@ -572,8 +571,6 @@ mod unit_tests {
hotplugged_size: None,
shared: false,
hugepages: false,
balloon: false,
balloon_size: 0,
zones: None,
},
kernel: Some(KernelConfig {

View File

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

View File

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