diff --git a/vm/devices/vmbus/vmbus_client/src/hvsock.rs b/vm/devices/vmbus/vmbus_client/src/hvsock.rs index 7d8cfc8448..663b5835ba 100644 --- a/vm/devices/vmbus/vmbus_client/src/hvsock.rs +++ b/vm/devices/vmbus/vmbus_client/src/hvsock.rs @@ -36,7 +36,8 @@ impl HvsockRequestTracker { return None; } if let Some(index) = self.pending_requests.iter().position(|request| { - request.0.service_id == result.service_id && request.0.endpoint_id == result.endpoint_id + request.input().service_id == result.service_id + && request.input().endpoint_id == result.endpoint_id }) { let rpc = self.pending_requests.swap_remove(index); Some(rpc) @@ -61,14 +62,15 @@ impl HvsockRequestTracker { // Since silo_id isn't part of the result message, it doesn't need to be checked here // either. let Some(index) = self.pending_requests.iter().position(|request| { - request.0.service_id == offer.interface_id && request.0.endpoint_id == offer.instance_id + request.input().service_id == offer.interface_id + && request.input().endpoint_id == offer.instance_id }) else { tracing::warn!(?offer, "Channel offer for unknown hvsock request"); return None; }; let rpc = self.pending_requests.swap_remove(index); - tracing::debug!(request = ?rpc.0, "channel offer matches hvsocket request"); + tracing::debug!(request = ?rpc.input(), "channel offer matches hvsocket request"); Some(rpc) } } @@ -91,7 +93,7 @@ mod tests { silo_id: Guid::new_random(), }; - tracker.add_request(Rpc(request, mesh::oneshot().0)); + tracker.add_request(Rpc::detached(request)); assert_eq!(1, tracker.pending_requests.len()); // Endpoint ID mismatch. @@ -133,7 +135,7 @@ mod tests { silo_id: Guid::new_random(), }; - tracker.add_request(Rpc(request, mesh::oneshot().0)); + tracker.add_request(Rpc::detached(request)); assert_eq!(1, tracker.pending_requests.len()); // Endpoint ID mismatch. @@ -155,7 +157,7 @@ mod tests { // Match. let offer = create_offer(request.service_id, request.endpoint_id, true, false); let found = tracker.check_offer(&offer).unwrap(); - assert_eq!(found.0, request); + assert_eq!(*found.input(), request); assert_eq!(0, tracker.pending_requests.len()); // It no longer exists. diff --git a/vm/devices/vmbus/vmbus_client/src/lib.rs b/vm/devices/vmbus/vmbus_client/src/lib.rs index a0ae1e8b8f..220ab2de14 100644 --- a/vm/devices/vmbus/vmbus_client/src/lib.rs +++ b/vm/devices/vmbus/vmbus_client/src/lib.rs @@ -583,9 +583,8 @@ impl ClientTask { // The client only supports protocol versions which use the newer message format. // The host will not send a TlConnectRequestResult message on success, so a response to this // message is not guaranteed. - let request = rpc.0; + let message = protocol::TlConnectRequest2::from(*rpc.input()); self.hvsock_tracker.add_request(rpc); - let message = protocol::TlConnectRequest2::from(request); self.inner.send(&message); }