vfio_user: Reject SET_IRQS with VFIO_IRQ_SET_DATA_BOOL

This is unsupported.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford 2023-02-14 12:12:53 +00:00 committed by Bo Chen
parent aa502b3e41
commit 19e893fa53

View File

@ -272,6 +272,8 @@ pub enum Error {
SocketAccept(#[source] std::io::Error),
#[error("Unsupported command: {0:?}")]
UnsupportedCommand(Command),
#[error("Unsupported feature")]
UnsupportedFeature,
#[error("Error from backend: {0:?}")]
Backend(#[source] std::io::Error),
}
@ -1084,6 +1086,10 @@ impl Server {
.read_exact(&mut cmd.as_mut_slice()[size_of::<Header>()..])
.map_err(Error::StreamRead)?;
if cmd.flags & VFIO_IRQ_SET_DATA_BOOL > 0 {
return Err(Error::UnsupportedFeature);
}
backend
.set_irqs(cmd.index, cmd.flags, cmd.start, cmd.count, fds)
.map_err(Error::Backend)?;