mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: For --disk error if socket and path is specified
This is an error as the path should be specfied by the unmanaged backend. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
@@ -49,6 +49,8 @@ pub enum Error {
|
||||
ParseDiskVhostParam(std::str::ParseBoolError),
|
||||
/// Failed parsing disk wce parameter.
|
||||
ParseDiskWceParam(std::str::ParseBoolError),
|
||||
/// Both socket and path specified
|
||||
ParseDiskSocketAndPath,
|
||||
/// Failed parsing random number generator parameters.
|
||||
ParseRngParams,
|
||||
/// Failed parsing network ip parameter.
|
||||
@@ -453,6 +455,10 @@ impl DiskConfig {
|
||||
path = Some(PathBuf::from(path_str))
|
||||
}
|
||||
|
||||
if vhost_socket.as_ref().and(path.as_ref()).is_some() {
|
||||
return Err(Error::ParseDiskSocketAndPath);
|
||||
}
|
||||
|
||||
Ok(DiskConfig {
|
||||
path,
|
||||
readonly: parse_on_off(readonly_str)?,
|
||||
|
||||
Reference in New Issue
Block a user