vhost_kern: set the proper type of constants

VHOST_ACCESS_* and VHOST_IOTLB_* constants are assigned to c_uchar
fields and VHOST_IOTLB_MSG to a c_int field.

Let's set the proper types to avoid casts when assigning them.

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
This commit is contained in:
Stefano Garzarella 2021-03-23 15:17:32 +01:00 committed by Jiang Liu
parent 3355764355
commit 761c144a71

View file

@ -20,14 +20,14 @@ use std::os::raw;
pub const VHOST: raw::c_uint = 0xaf;
pub const VHOST_VRING_F_LOG: raw::c_uint = 0;
pub const VHOST_ACCESS_RO: raw::c_uint = 1;
pub const VHOST_ACCESS_WO: raw::c_uint = 2;
pub const VHOST_ACCESS_RW: raw::c_uint = 3;
pub const VHOST_IOTLB_MISS: raw::c_uint = 1;
pub const VHOST_IOTLB_UPDATE: raw::c_uint = 2;
pub const VHOST_IOTLB_INVALIDATE: raw::c_uint = 3;
pub const VHOST_IOTLB_ACCESS_FAIL: raw::c_uint = 4;
pub const VHOST_IOTLB_MSG: raw::c_uint = 1;
pub const VHOST_ACCESS_RO: raw::c_uchar = 1;
pub const VHOST_ACCESS_WO: raw::c_uchar = 2;
pub const VHOST_ACCESS_RW: raw::c_uchar = 3;
pub const VHOST_IOTLB_MISS: raw::c_uchar = 1;
pub const VHOST_IOTLB_UPDATE: raw::c_uchar = 2;
pub const VHOST_IOTLB_INVALIDATE: raw::c_uchar = 3;
pub const VHOST_IOTLB_ACCESS_FAIL: raw::c_uchar = 4;
pub const VHOST_IOTLB_MSG: raw::c_int = 1;
pub const VHOST_PAGE_SIZE: raw::c_uint = 4096;
pub const VHOST_VIRTIO: raw::c_uint = 175;
pub const VHOST_VRING_LITTLE_ENDIAN: raw::c_uint = 0;