| 2828 | |
| 2829 | impl VmConfig { |
| 2830 | fn validate_identifier( |
| 2831 | id_list: &mut BTreeSet<String>, |
| 2832 | id: &Option<String>, |
| 2833 | ) -> ValidationResult<()> { |
| 2834 | if let Some(id) = id.as_ref() { |
| 2835 | if id.starts_with("__") { |
| 2836 | return Err(ValidationError::InvalidIdentifier(id.clone())); |
| 2837 | } |
| 2838 | |
| 2839 | if !id_list.insert(id.clone()) { |
| 2840 | return Err(ValidationError::IdentifierNotUnique(id.clone())); |
| 2841 | } |
| 2842 | } |
| 2843 | |
| 2844 | Ok(()) |
| 2845 | } |
| 2846 | |
| 2847 | pub fn backed_by_shared_memory(&self) -> bool { |
| 2848 | if self.memory.shared || self.memory.hugepages { |