mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-07-05 01:12:36 +00:00
vmm: config: Remove mergeable option from PmemConfig
Fixes: #3968 Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
55c5961f43
commit
465db7f08c
34
src/main.rs
34
src/main.rs
|
@ -1323,40 +1323,6 @@ mod unit_tests {
|
||||||
}"#,
|
}"#,
|
||||||
false,
|
false,
|
||||||
),
|
),
|
||||||
#[cfg(target_arch = "x86_64")]
|
|
||||||
(
|
|
||||||
vec![
|
|
||||||
"cloud-hypervisor",
|
|
||||||
"--kernel",
|
|
||||||
"/path/to/kernel",
|
|
||||||
"--pmem",
|
|
||||||
"file=/path/to/img/1,size=1G,mergeable=on",
|
|
||||||
],
|
|
||||||
r#"{
|
|
||||||
"kernel": {"path": "/path/to/kernel"},
|
|
||||||
"pmem": [
|
|
||||||
{"file": "/path/to/img/1", "size": 1073741824, "mergeable": true}
|
|
||||||
]
|
|
||||||
}"#,
|
|
||||||
true,
|
|
||||||
),
|
|
||||||
#[cfg(target_arch = "x86_64")]
|
|
||||||
(
|
|
||||||
vec![
|
|
||||||
"cloud-hypervisor",
|
|
||||||
"--kernel",
|
|
||||||
"/path/to/kernel",
|
|
||||||
"--pmem",
|
|
||||||
"file=/path/to/img/1,size=1G,mergeable=off",
|
|
||||||
],
|
|
||||||
r#"{
|
|
||||||
"kernel": {"path": "/path/to/kernel"},
|
|
||||||
"pmem": [
|
|
||||||
{"file": "/path/to/img/1", "size": 1073741824, "mergeable": false}
|
|
||||||
]
|
|
||||||
}"#,
|
|
||||||
true,
|
|
||||||
),
|
|
||||||
]
|
]
|
||||||
.iter()
|
.iter()
|
||||||
.for_each(|(cli, openapi, equal)| {
|
.for_each(|(cli, openapi, equal)| {
|
||||||
|
|
|
@ -905,9 +905,6 @@ components:
|
||||||
iommu:
|
iommu:
|
||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
default: false
|
||||||
mergeable:
|
|
||||||
type: boolean
|
|
||||||
default: false
|
|
||||||
discard_writes:
|
discard_writes:
|
||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
default: false
|
||||||
|
|
|
@ -1675,8 +1675,6 @@ pub struct PmemConfig {
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub iommu: bool,
|
pub iommu: bool,
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub mergeable: bool,
|
|
||||||
#[serde(default)]
|
|
||||||
pub discard_writes: bool,
|
pub discard_writes: bool,
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub id: Option<String>,
|
pub id: Option<String>,
|
||||||
|
@ -1693,7 +1691,6 @@ impl PmemConfig {
|
||||||
parser
|
parser
|
||||||
.add("size")
|
.add("size")
|
||||||
.add("file")
|
.add("file")
|
||||||
.add("mergeable")
|
|
||||||
.add("iommu")
|
.add("iommu")
|
||||||
.add("discard_writes")
|
.add("discard_writes")
|
||||||
.add("id")
|
.add("id")
|
||||||
|
@ -1705,11 +1702,6 @@ impl PmemConfig {
|
||||||
.convert::<ByteSized>("size")
|
.convert::<ByteSized>("size")
|
||||||
.map_err(Error::ParsePersistentMemory)?
|
.map_err(Error::ParsePersistentMemory)?
|
||||||
.map(|v| v.0);
|
.map(|v| v.0);
|
||||||
let mergeable = parser
|
|
||||||
.convert::<Toggle>("mergeable")
|
|
||||||
.map_err(Error::ParsePersistentMemory)?
|
|
||||||
.unwrap_or(Toggle(false))
|
|
||||||
.0;
|
|
||||||
let iommu = parser
|
let iommu = parser
|
||||||
.convert::<Toggle>("iommu")
|
.convert::<Toggle>("iommu")
|
||||||
.map_err(Error::ParsePersistentMemory)?
|
.map_err(Error::ParsePersistentMemory)?
|
||||||
|
@ -1730,7 +1722,6 @@ impl PmemConfig {
|
||||||
file,
|
file,
|
||||||
size,
|
size,
|
||||||
iommu,
|
iommu,
|
||||||
mergeable,
|
|
||||||
discard_writes,
|
discard_writes,
|
||||||
id,
|
id,
|
||||||
pci_segment,
|
pci_segment,
|
||||||
|
@ -1738,10 +1729,6 @@ impl PmemConfig {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn validate(&self, vm_config: &VmConfig) -> ValidationResult<()> {
|
pub fn validate(&self, vm_config: &VmConfig) -> ValidationResult<()> {
|
||||||
if self.mergeable {
|
|
||||||
warn!("Enabling mergable pages for PMEM devices is ineffectual. This option is deprecated and will be removed in a later release");
|
|
||||||
}
|
|
||||||
|
|
||||||
if let Some(platform_config) = vm_config.platform.as_ref() {
|
if let Some(platform_config) = vm_config.platform.as_ref() {
|
||||||
if self.pci_segment >= platform_config.num_pci_segments {
|
if self.pci_segment >= platform_config.num_pci_segments {
|
||||||
return Err(ValidationError::InvalidPciSegment(self.pci_segment));
|
return Err(ValidationError::InvalidPciSegment(self.pci_segment));
|
||||||
|
@ -3094,11 +3081,10 @@ mod tests {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
PmemConfig::parse("file=/tmp/pmem,size=128M,iommu=on,mergeable=on,discard_writes=on")?,
|
PmemConfig::parse("file=/tmp/pmem,size=128M,iommu=on,discard_writes=on")?,
|
||||||
PmemConfig {
|
PmemConfig {
|
||||||
file: PathBuf::from("/tmp/pmem"),
|
file: PathBuf::from("/tmp/pmem"),
|
||||||
size: Some(128 << 20),
|
size: Some(128 << 20),
|
||||||
mergeable: true,
|
|
||||||
discard_writes: true,
|
discard_writes: true,
|
||||||
iommu: true,
|
iommu: true,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user