From bce76271c5b2e1fe9afd838fa05e146e1ac61059 Mon Sep 17 00:00:00 2001 From: Samuel Ortiz Date: Mon, 27 Jan 2020 19:38:27 +0100 Subject: [PATCH] vm-virtio: Define a separate macro alias for ctrl queue devices Now that we have factorized the common virtio pausable implementation, it's cleaner to have a dedicated macro for control queue devices rather than overload the macro prototype. Signed-off-by: Samuel Ortiz --- vm-virtio/src/device.rs | 5 ++++- vm-virtio/src/net.rs | 2 +- vm-virtio/src/vhost_user/net.rs | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/vm-virtio/src/device.rs b/vm-virtio/src/device.rs index 922eced3b..236b7d5ca 100644 --- a/vm-virtio/src/device.rs +++ b/vm-virtio/src/device.rs @@ -203,8 +203,11 @@ macro_rules! virtio_pausable { } } }; +} - ($type:ident, $ctrl_q:expr) => { +#[macro_export] +macro_rules! virtio_ctrl_q_pausable { + ($type:ident) => { virtio_pausable_trait!($type); impl Pausable for $type { diff --git a/vm-virtio/src/net.rs b/vm-virtio/src/net.rs index 909107f9b..602764dc3 100644 --- a/vm-virtio/src/net.rs +++ b/vm-virtio/src/net.rs @@ -583,6 +583,6 @@ impl VirtioDevice for Net { } } -virtio_pausable!(Net, true); +virtio_ctrl_q_pausable!(Net); impl Snapshotable for Net {} impl Migratable for Net {} diff --git a/vm-virtio/src/vhost_user/net.rs b/vm-virtio/src/vhost_user/net.rs index ac9373a9e..c6702bf60 100644 --- a/vm-virtio/src/vhost_user/net.rs +++ b/vm-virtio/src/vhost_user/net.rs @@ -361,6 +361,6 @@ impl VirtioDevice for Net { } } -virtio_pausable!(Net, true); +virtio_ctrl_q_pausable!(Net); impl Snapshotable for Net {} impl Migratable for Net {}