mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-08-22 07:51:16 +00:00
virtio-devices: Rename CtrlVirtio to NetCtrl
This better represents its purpose. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
4806357f52
commit
bd90938f08
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
use super::net_util::{
|
use super::net_util::{
|
||||||
build_net_config_space, build_net_config_space_with_mq, virtio_features_to_tap_offload,
|
build_net_config_space, build_net_config_space_with_mq, virtio_features_to_tap_offload,
|
||||||
CtrlVirtio, NetCtrlEpollHandler, VirtioNetConfig,
|
NetCtrl, NetCtrlEpollHandler, VirtioNetConfig,
|
||||||
};
|
};
|
||||||
use super::Error as DeviceError;
|
use super::Error as DeviceError;
|
||||||
use super::{
|
use super::{
|
||||||
@ -512,7 +512,7 @@ impl VirtioDevice for Net {
|
|||||||
mem: mem.clone(),
|
mem: mem.clone(),
|
||||||
kill_evt,
|
kill_evt,
|
||||||
pause_evt,
|
pause_evt,
|
||||||
ctrl_q: CtrlVirtio::new(cvq_queue, cvq_queue_evt),
|
ctrl_q: NetCtrl::new(cvq_queue, cvq_queue_evt),
|
||||||
};
|
};
|
||||||
|
|
||||||
let paused = self.common.paused.clone();
|
let paused = self.common.paused.clone();
|
||||||
|
@ -49,14 +49,14 @@ pub enum Error {
|
|||||||
NoStatusDescriptor,
|
NoStatusDescriptor,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct CtrlVirtio {
|
pub struct NetCtrl {
|
||||||
pub queue_evt: EventFd,
|
pub queue_evt: EventFd,
|
||||||
pub queue: Queue,
|
pub queue: Queue,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl std::clone::Clone for CtrlVirtio {
|
impl std::clone::Clone for NetCtrl {
|
||||||
fn clone(&self) -> Self {
|
fn clone(&self) -> Self {
|
||||||
CtrlVirtio {
|
NetCtrl {
|
||||||
queue_evt: self.queue_evt.try_clone().unwrap(),
|
queue_evt: self.queue_evt.try_clone().unwrap(),
|
||||||
queue: self.queue.clone(),
|
queue: self.queue.clone(),
|
||||||
}
|
}
|
||||||
@ -72,9 +72,9 @@ pub struct ControlHeader {
|
|||||||
|
|
||||||
unsafe impl ByteValued for ControlHeader {}
|
unsafe impl ByteValued for ControlHeader {}
|
||||||
|
|
||||||
impl CtrlVirtio {
|
impl NetCtrl {
|
||||||
pub fn new(queue: Queue, queue_evt: EventFd) -> Self {
|
pub fn new(queue: Queue, queue_evt: EventFd) -> Self {
|
||||||
CtrlVirtio { queue_evt, queue }
|
NetCtrl { queue_evt, queue }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn process_cvq(&mut self, mem: &GuestMemoryMmap) -> Result<()> {
|
pub fn process_cvq(&mut self, mem: &GuestMemoryMmap) -> Result<()> {
|
||||||
@ -131,7 +131,7 @@ pub struct NetCtrlEpollHandler {
|
|||||||
pub mem: GuestMemoryAtomic<GuestMemoryMmap>,
|
pub mem: GuestMemoryAtomic<GuestMemoryMmap>,
|
||||||
pub kill_evt: EventFd,
|
pub kill_evt: EventFd,
|
||||||
pub pause_evt: EventFd,
|
pub pause_evt: EventFd,
|
||||||
pub ctrl_q: CtrlVirtio,
|
pub ctrl_q: NetCtrl,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl NetCtrlEpollHandler {
|
impl NetCtrlEpollHandler {
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
use super::super::net_util::{
|
use super::super::net_util::{
|
||||||
build_net_config_space, CtrlVirtio, NetCtrlEpollHandler, VirtioNetConfig,
|
build_net_config_space, NetCtrl, NetCtrlEpollHandler, VirtioNetConfig,
|
||||||
};
|
};
|
||||||
use super::super::{
|
use super::super::{
|
||||||
ActivateError, ActivateResult, Queue, VirtioCommon, VirtioDevice, VirtioDeviceType,
|
ActivateError, ActivateResult, Queue, VirtioCommon, VirtioDevice, VirtioDeviceType,
|
||||||
@ -247,7 +247,7 @@ impl VirtioDevice for Net {
|
|||||||
mem: mem.clone(),
|
mem: mem.clone(),
|
||||||
kill_evt,
|
kill_evt,
|
||||||
pause_evt,
|
pause_evt,
|
||||||
ctrl_q: CtrlVirtio::new(cvq_queue, cvq_queue_evt),
|
ctrl_q: NetCtrl::new(cvq_queue, cvq_queue_evt),
|
||||||
};
|
};
|
||||||
|
|
||||||
let paused = self.common.paused.clone();
|
let paused = self.common.paused.clone();
|
||||||
|
Loading…
Reference in New Issue
Block a user