@@ -15,7 +15,7 @@ use params::{CommonInitParamsPy, DriverInitParamsPy, KVMInitParamsPy, MemflowIni
15
15
16
16
/// microvmi Python module declaration
17
17
#[ pymodule]
18
- fn pymicrovmi ( _py : Python , m : & PyModule ) -> PyResult < ( ) > {
18
+ fn pymicrovmi ( _py : Python < ' _ > , m : & Bound < ' _ , PyModule > ) -> PyResult < ( ) > {
19
19
// init the env logger at module init
20
20
env_logger:: init ( ) ;
21
21
@@ -64,7 +64,7 @@ impl MicrovmiExt {
64
64
/// driver_type (int, optional): the hypervisor driver type on which the library should be initialized.
65
65
/// init_param (DriverInitParamPy, optional): initialization parameters for driver initialization
66
66
#[ new]
67
- #[ args ( driver_type = " None" , init_params = " None" ) ]
67
+ #[ pyo3 ( signature = ( driver_type= None , init_params= None ) ) ]
68
68
fn new ( driver_type : Option < u32 > , init_params : Option < DriverInitParamsPy > ) -> PyResult < Self > {
69
69
info ! ( "Microvmi Python init" ) ;
70
70
debug ! (
@@ -118,7 +118,7 @@ impl MicrovmiExt {
118
118
size : usize ,
119
119
) -> PyResult < ( & ' p PyBytes , u64 ) > {
120
120
let mut bytes_read: u64 = 0 ;
121
- let pybuffer: & PyBytes = PyBytes :: new_with ( py, size, |buffer| {
121
+ let pybuffer: & PyBytes = PyBytes :: new_bound_with ( py, size, |buffer| {
122
122
self . driver
123
123
. read_physical ( paddr, buffer, & mut bytes_read)
124
124
. ok ( ) ;
@@ -133,7 +133,7 @@ impl MicrovmiExt {
133
133
/// Args:
134
134
/// paddr (int): the physical address to start reading from
135
135
/// buffer (bytearray): the buffer to read into
136
- fn read_physical_into ( & self , paddr : u64 , buffer : & PyByteArray ) -> u64 {
136
+ fn read_physical_into ( & self , paddr : u64 , buffer : & Bound < ' _ , PyByteArray > ) -> u64 {
137
137
let mut_buf: & mut [ u8 ] = unsafe { buffer. as_bytes_mut ( ) } ;
138
138
let mut bytes_read: u64 = 0 ;
139
139
// ignore read error
0 commit comments