Skip to content

Commit 515965b

Browse files
committed
devices/vsock: refactor UdpProxy as TsiDgramProxy
Since UdpProxy now supports more than UDP, let's refactor it as TsiDgramProxy. Signed-off-by: Sergio Lopez <[email protected]>
1 parent 4222ac0 commit 515965b

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/devices/src/virtio/vsock/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ mod proxy;
1616
mod reaper;
1717
#[cfg(target_os = "macos")]
1818
mod timesync;
19+
mod tsi_dgram;
1920
mod tsi_stream;
20-
mod udp;
2121
mod unix;
2222

2323
pub use self::defs::uapi::VIRTIO_ID_VSOCK as TYPE_VSOCK;

src/devices/src/virtio/vsock/muxer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ use super::proxy::{Proxy, ProxyRemoval, ProxyUpdate};
1313
use super::reaper::ReaperThread;
1414
#[cfg(target_os = "macos")]
1515
use super::timesync::TimesyncThread;
16+
use super::tsi_dgram::TsiDgramProxy;
1617
use super::tsi_stream::TsiStreamProxy;
17-
use super::udp::UdpProxy;
1818
use super::unix::UnixProxy;
1919
use super::VsockError;
2020
use crossbeam_channel::{unbounded, Sender};
@@ -316,7 +316,7 @@ impl VsockMuxer {
316316
warn!("vsock: rejecting udp unix proxy because tsi_unix is disabled");
317317
return;
318318
}
319-
match UdpProxy::new(
319+
match TsiDgramProxy::new(
320320
id,
321321
self.cid,
322322
req.family,

src/devices/src/virtio/vsock/udp.rs renamed to src/devices/src/virtio/vsock/tsi_dgram.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ use utils::epoll::EventSet;
2727

2828
use vm_memory::GuestMemoryMmap;
2929

30-
pub struct UdpProxy {
30+
pub struct TsiDgramProxy {
3131
pub id: u64,
3232
cid: u64,
3333
local_port: u32,
@@ -45,7 +45,7 @@ pub struct UdpProxy {
4545
peer_fwd_cnt: Wrapping<u32>,
4646
}
4747

48-
impl UdpProxy {
48+
impl TsiDgramProxy {
4949
pub fn new(
5050
id: u64,
5151
cid: u64,
@@ -93,7 +93,7 @@ impl UdpProxy {
9393
};
9494
}
9595

96-
Ok(UdpProxy {
96+
Ok(TsiDgramProxy {
9797
id,
9898
cid,
9999
local_port: 0,
@@ -230,7 +230,7 @@ impl UdpProxy {
230230
}
231231
}
232232

233-
impl Proxy for UdpProxy {
233+
impl Proxy for TsiDgramProxy {
234234
fn id(&self) -> u64 {
235235
self.id
236236
}
@@ -464,7 +464,7 @@ impl Proxy for UdpProxy {
464464
}
465465
}
466466

467-
impl AsRawFd for UdpProxy {
467+
impl AsRawFd for TsiDgramProxy {
468468
fn as_raw_fd(&self) -> RawFd {
469469
self.fd.as_raw_fd()
470470
}

0 commit comments

Comments
 (0)