Skip to content

Commit d22fd10

Browse files
committed
kvm: fix init after adding new DriverInitParam
1 parent 794aa15 commit d22fd10

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/driver/kvm.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,10 @@ impl<T: KVMIntrospectable> Kvm<T> {
113113
mut kvmi: T,
114114
init_option: Option<DriverInitParam>,
115115
) -> Result<Self, Box<dyn Error>> {
116-
let DriverInitParam::KVMiSocket(socket_path) =
117-
init_option.ok_or(KVMDriverError::MissingSocketParameter)?;
116+
let socket_path = match init_option.ok_or(KVMDriverError::MissingSocketParameter)? {
117+
DriverInitParam::KVMiSocket(s) => s,
118+
_ => return Err(Box::new(KVMDriverError::MissingSocketParameter)),
119+
};
118120
debug!("init on {} (socket: {})", domain_name, socket_path);
119121
let unix_socket = SocketType::UnixSocket(socket_path);
120122
kvmi.init(unix_socket)?;

0 commit comments

Comments
 (0)