Skip to content

Commit 1281bbd

Browse files
phip1611ShadowCurse
authored andcommitted
kvm-bindings: get_nested_state -> nested_state
In Rust, it is uncommon to prefix getters with "get". Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de> On-behalf-of: SAP philipp.schuster@sap.com
1 parent fa9d9c1 commit 1281bbd

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

kvm-ioctls/src/ioctls/vcpu.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2011,14 +2011,14 @@ impl VcpuFd {
20112011
/// let vcpu = vm.create_vcpu(0).unwrap();
20122012
/// let mut state_buffer = KvmNestedStateBuffer::empty();
20132013
/// if kvm.check_extension(Cap::NestedState) {
2014-
/// vcpu.get_nested_state(&mut state_buffer).unwrap();
2014+
/// vcpu.nested_state(&mut state_buffer).unwrap();
20152015
/// // Next, serialize the actual state into a file or so.
20162016
/// }
20172017
/// ```
20182018
///
20192019
/// [`Kvm::check_extension_int`]: kvm_ioctls::Kvm::check_extension_int
20202020
#[cfg(target_arch = "x86_64")]
2021-
pub fn get_nested_state(
2021+
pub fn nested_state(
20222022
&self,
20232023
buffer: &mut KvmNestedStateBuffer,
20242024
) -> Result<Option<NonZeroUsize /* actual length of state */>> {
@@ -2047,7 +2047,7 @@ impl VcpuFd {
20472047
///
20482048
/// - `state`: The new state to be put into KVM. The header must report the
20492049
/// `size` of the state properly. The state must be retrieved first using
2050-
/// [`Self::get_nested_state`].
2050+
/// [`Self::nested_state`].
20512051
///
20522052
/// # Example
20532053
///
@@ -2058,7 +2058,7 @@ impl VcpuFd {
20582058
/// let vcpu = vm.create_vcpu(0).unwrap();
20592059
/// if kvm.check_extension(Cap::NestedState) {
20602060
/// let mut state_buffer = KvmNestedStateBuffer::empty();
2061-
/// vcpu.get_nested_state(&mut state_buffer).unwrap();
2061+
/// vcpu.nested_state(&mut state_buffer).unwrap();
20622062
/// // Rename the variable to better reflect the role.
20632063
/// let old_state = state_buffer;
20642064
///
@@ -3725,7 +3725,7 @@ mod tests {
37253725
size_of::<KvmNestedStateBuffer>()
37263726
);
37273727

3728-
vcpu.get_nested_state(&mut state_buffer).unwrap();
3728+
vcpu.nested_state(&mut state_buffer).unwrap();
37293729
let old_state = state_buffer;
37303730

37313731
// There is no nested guest in this test, so there is no payload.

0 commit comments

Comments
 (0)