This repository was archived by the owner on Sep 7, 2021. It is now read-only.
File tree 2 files changed +16
-14
lines changed
2 files changed +16
-14
lines changed Original file line number Diff line number Diff line change @@ -15,4 +15,7 @@ byteorder = "*"
15
15
[target .'cfg(unix)' .dependencies ]
16
16
kvm-bindings = " 0.1"
17
17
18
+ [target .'cfg(unix)' .dev-dependencies ]
19
+ kvm-ioctls = " 0.1.0"
20
+
18
21
libc = " >=0.2.39"
Original file line number Diff line number Diff line change @@ -197,20 +197,19 @@ impl CpuId {
197
197
198
198
/// Returns the mutable entries slice so they can be modified before passing to the VCPU.
199
199
///
200
- // Example:
201
- // NOTE: Example is KVM-specific and thus not going to run on all platforms
202
- // (and doc-comment examples do not yet support conditional compilation), so
203
- // the example is left as a regular comment.
204
- //
205
- // ```rust
206
- // # extern crate kvm_ioctls;
207
- //
208
- // use kvm_ioctls::Kvm;
209
- // use vmm_vcpu::x86_64::{CpuId, MAX_CPUID_ENTRIES};
210
- // let kvm = Kvm::new().unwrap();
211
- // let mut cpuid = kvm.get_supported_cpuid(MAX_KVM_CPUID_ENTRIES).unwrap();
212
- // let cpuid_entries = cpuid.mut_entries_slice();
213
- // ```
200
+ /// ```cfg(unix)
201
+ /// extern crate kvm_ioctls;
202
+ ///
203
+ /// use kvm_ioctls::Kvm;
204
+ /// use vmm_vcpu::x86_64::{CpuId, MAX_CPUID_ENTRIES};
205
+ ///
206
+ /// # fn main() {
207
+ /// let kvm = Kvm::new().unwrap();
208
+ /// let mut cpuid = kvm.get_supported_cpuid(MAX_CPUID_ENTRIES).unwrap();
209
+ /// let cpuid_entries = cpuid.mut_entries_slice();
210
+ /// # }
211
+ ///
212
+ /// ```
214
213
///
215
214
pub fn mut_entries_slice ( & mut self ) -> & mut [ CpuIdEntry2 ] {
216
215
// Mapping the unsized array to a slice is unsafe because the length isn't known. Using
You can’t perform that action at this time.
0 commit comments