diff options
author | Zhao Liu <zhao1.liu@intel.com> | 2025-01-21 22:04:56 +0800 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2025-01-23 11:50:53 +0100 |
commit | 0f9eb0ff2b25787be62fceb036dba7c3f54fde2d (patch) | |
tree | 525a888f4c0da48be31d36f8a5e9778da13583c3 /rust/qemu-api/src/prelude.rs | |
parent | 8113dbbcdaee05f319a7e48272416d918cb2b04a (diff) | |
download | qemu-0f9eb0ff2b25787be62fceb036dba7c3f54fde2d.zip qemu-0f9eb0ff2b25787be62fceb036dba7c3f54fde2d.tar.gz qemu-0f9eb0ff2b25787be62fceb036dba7c3f54fde2d.tar.bz2 |
rust/qdev: Make REALIZE safe
A safe REALIZE accepts immutable reference.
Since current PL011's realize() only calls a char binding function (
qemu_chr_fe_set_handlers), it is possible to convert mutable reference
(&mut self) to immutable reference (&self), which only needs to convert
the pointers passed to C to mutable pointers.
Thus, make REALIZE accept immutable reference.
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Link: https://lore.kernel.org/r/20250121140457.84631-2-zhao1.liu@intel.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'rust/qemu-api/src/prelude.rs')
0 files changed, 0 insertions, 0 deletions