File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -121,7 +121,22 @@ impl Kvm {
121
121
/// Wrapper over `KVM_CHECK_EXTENSION`.
122
122
///
123
123
/// Returns 0 if the capability is not available and a positive integer otherwise.
124
- fn check_extension_int ( & self , c : Cap ) -> i32 {
124
+ /// See the documentation for `KVM_CHECK_EXTENSION`.
125
+ ///
126
+ /// # Arguments
127
+ ///
128
+ /// * `c` - KVM capability to check.
129
+ ///
130
+ /// # Example
131
+ ///
132
+ /// ```
133
+ /// # use kvm_ioctls::Kvm;
134
+ /// use kvm_ioctls::Cap;
135
+ ///
136
+ /// let kvm = Kvm::new().unwrap();
137
+ /// assert!(kvm.check_extension_int(Cap::MaxVcpuId) > 0);
138
+ /// ```
139
+ pub fn check_extension_int ( & self , c : Cap ) -> i32 {
125
140
// Safe because we know that our file is a KVM fd and that the extension is one of the ones
126
141
// defined by kernel.
127
142
unsafe { ioctl_with_val ( self , KVM_CHECK_EXTENSION ( ) , c as c_ulong ) }
You can’t perform that action at this time.
0 commit comments