1# Changelog 2 3## v0.12.1 4 5### Changed 6- [[#215](https://github.com/rust-vmm/vmm-sys-util/pull/215)]: Make 7 `as_mut_fam_struct()` public and unsafe to let users modify fields of the 8 header other than the length. 9 10## v0.12.0 11 12### Changed 13- Added all features to the generated docs.rs documentation. 14- Fixed a bug in `serde` implementation of `FamStructWrapper` which allowed out of 15 bounds memory access from Rust-safe code. See the related GHSA here: 16 https://github.com/rust-vmm/vmm-sys-util/security/advisories/GHSA-875g-mfp6-g7f9 17 for more information. 18 19## v0.11.2 20 21### Changed 22- [[#201](https://github.com/rust-vmm/vmm-sys-util/pull/201)] Updated `SyscallReturnCode` 23 to accept any signed integer type. 24 25## v0.11.1 26 27### Changed 28- [[#178](https://github.com/rust-vmm/vmm-sys-util/issues/178)]: Fixed a bug in 29 `rand_bytes` that was triggering a panic when the number of bytes was not a 30 multiple of 4. 31- [[#181](https://github.com/rust-vmm/vmm-sys-util/pull/181)]: Changed 32 `TempFile::new_with_prefix()` on linux to use `mkstemp` to prevent name 33 collisions. 34 35## v0.11.0 36 37### Added 38- Added `rand_bytes` function that generates a pseudo random vector of 39 `len` bytes. 40- Added implementation of `std::error::Error` for `fam::Error`. 41 - Added derive `Eq` and `PartialEq` for error types. 42 43### Changed 44- [[#161](https://github.com/rust-vmm/vmm-sys-util/issues/161)]: Updated the 45 license to BSD-3-Clause. 46- Use edition 2021. 47- [[vm-memory#199](https://github.com/rust-vmm/vm-memory/issues/199)]: Use caret 48 dependencies. This is the idiomatic way of specifying dependencies. 49 With this we reduce the risk of breaking customer code when new releases of 50 the dependencies are published. 51- Renamed `xor_psuedo_rng_u32` to `xor_pseudo_rng_u32` to fix a typo. 52- Renamed `xor_psuedo_rng_u8_alphanumerics` to `xor_pseudo_rng_u8_alphanumerics` 53 to fix a typo. 54 55## v0.10.0 56 57### Added 58- Added Android support by using the appropriate macro configuration when 59 exporting functionality. 60- Derive `Debug` for `FamStructWrapper` & `EventFd`. 61 62### Changed 63- The `ioctl_expr` is now a const function instead of a macro. 64 65## v0.9.0 66 67### Changed 68* Fixed safety for sock_ctrl_msg::raw_recvmsg() and enhanced documentation 69* Fixed sock_cmsg: ensured copy_nonoverlapping safety 70* [[#135](https://github.com/rust-vmm/vmm-sys-util/pull/135)]: sock_ctrl_msg: 71 mark recv_with_fds as unsafe 72 73 74## v0.8.0 75 76* Added set_check_for_hangup() to PollContext. 77* Added writable()/has_error()/raw_events() to PollEvent. 78* Derived Copy/Clone for PollWatchingEvents. 79* Fixed the implementation of `write_zeroes` to use `FALLOC_FL_ZERO_RANGE` 80 instead of `FALLOC_FL_PUNCH_HOLE`. 81* Added `write_all_zeroes` to `WriteZeroes`, which calls `write_zeroes` in a 82 loop until the requested length is met. 83* Added a new trait, `WriteZeroesAt`, which allows giving the offset in file 84 instead of using the current cursor. 85* Removed `max_events` from `Epoll::wait` which removes possible undefined 86 behavior. 87* [[#104](https://github.com/rust-vmm/vmm-sys-util/issues/104)]: Fixed FAM 88 struct `PartialEq` implementation. 89* [[#85](https://github.com/rust-vmm/vmm-sys-util/issues/85)]: Fixed FAM struct 90 `Clone` implementation. 91* [[#99](https://github.com/rust-vmm/vmm-sys-util/issues/99)]: Validate the 92 maximum capacity when initializing FAM Struct. 93 94# v0.7.0 95 96* Switched to Rust edition 2018. 97* Added the `metric` module that provides a `Metric` interface as well as a 98 default implementation for `AtomicU64`. 99 100# v0.6.1 101 102* Implemented `From<io::Error>` for `errno::Error`. 103 104# v0.6.0 105 106* Derived Copy for EpollEvent. 107* Implemented Debug for EpollEvent. 108* Changed `Epoll::ctl` signature such that `EpollEvent` is passed by 109 value and not by reference. 110* Enabled this crate to be used on other Unixes (besides Linux) by using 111 target_os = linux where appropriate. 112 113# v0.5.0 114 115* Added conditionally compiled `serde` compatibility to `FamStructWrapper`, 116 gated by the `with-serde` feature. 117* Implemented `Into<std::io::Error` for `errno::Error`. 118* Added a wrapper over `libc::epoll` used for basic epoll operations. 119 120# v0.4.0 121 122* Added Windows support for TempFile and errno::Error. 123* Added `into_file` for TempFile which enables the TempFile to be used as a 124 regular file. 125* Implemented std::error::Error for errno::Error. 126* Fixed the implementation of `register_signal_handler` by allowing only 127 valid signal numbers. 128 129# v0.3.1 130 131* Advertise functionality for obtaining POSIX real time signal base which is 132 needed to provide absolute signals in the API changed in v0.3.0. 133 134# v0.3.0 135 136* Removed `for_vcpu` argument from `signal::register_signal_handler` and 137 `signal::validate_signal_num`. Users can now pass absolute values for all 138 valid signal numbers. 139* Removed `flag` argument of `signal::register_signal_handler` public methods, 140 which now defaults to `libc::SA_SIGINFO`. 141* Changed `TempFile::new` and `TempDir::new` to create new temporary files/ 142 directories inside `$TMPDIR` if set, otherwise inside `/tmp`. 143* Added methods which create temporary files/directories with prefix. 144 145# v0.2.1 146 147* Fixed the FamStructWrapper Clone implementation to avoid UB. 148 149# v0.2.0 150 151* fam: updated the macro that generates implementions of FamStruct to 152 also take a parameter that specifies the name of the flexible array 153 member. 154 155# v0.1.1 156 157* Fixed the Cargo.toml license. 158* Fixed some clippy warnings. 159 160# v0.1.0 161 162This is the first vmm-sys-util crate release. 163 164It is a collection of modules implementing helpers and utilities used by 165multiple rust-vmm components and rust-vmm based VMMs. 166Most of the code in this first release is based on either the crosvm or the 167Firecracker projects, or both. 168 169The first release comes with the following Rust modules: 170 171* aio: Safe wrapper over 172 [`Linux AIO`](http://man7.org/linux/man-pages/man7/aio.7.html). 173 174* errno: Structures, helpers, and type definitions for working with 175 [`errno`](http://man7.org/linux/man-pages/man3/errno.3.html). 176 177* eventfd: Structure and wrapper functions for working with 178 [`eventfd`](http://man7.org/linux/man-pages/man2/eventfd.2.html). 179 180* fallocate: Enum and function for dealing with an allocated disk space 181 by [`fallocate`](http://man7.org/linux/man-pages/man2/fallocate.2.html). 182 183* fam: Trait and wrapper for working with C defined FAM structures. 184 185* file_traits: Traits for handling file synchronization and length. 186 187* ioctls: Macros and functions for working with 188 [`ioctl`](http://man7.org/linux/man-pages/man2/ioctl.2.html). 189 190* poll: Traits and structures for working with 191 [`epoll`](http://man7.org/linux/man-pages/man7/epoll.7.html) 192 193* rand: Miscellaneous functions related to getting (pseudo) random 194 numbers and strings. 195 196* seek_hole: Traits and implementations over 197 [`lseek64`](https://linux.die.net/man/3/lseek64). 198 199* signal: Enums, traits and functions for working with 200 [`signal`](http://man7.org/linux/man-pages/man7/signal.7.html). 201 202* sockctrl_msg: Wrapper for sending and receiving messages with file 203 descriptors on sockets that accept control messages (e.g. Unix domain 204 sockets). 205 206* tempdir: Structure for handling temporary directories. 207 208* tempfile: Struct for handling temporary files as well as any cleanup 209 required. 210 211* terminal: Trait for working with 212 [`termios`](http://man7.org/linux/man-pages/man3/termios.3.html). 213 214* timerfd: Structure and functions for working with 215 [`timerfd`](http://man7.org/linux/man-pages/man2/timerfd_create.2.html). 216 217* write_zeroes: Traits for replacing a range with a hole and writing 218 zeroes in a file. 219