Commit Graph

7 Commits

Author SHA1 Message Date
Rob Bradford
5e52729453 misc: Automatically fix cargo clippy issues added in 1.65 (stable)
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-12-14 14:27:19 +00:00
Wei Liu
b9ad3eda27 vhdx: add some safety comments
Also add some assertions to some places along side the safety comments.

Signed-off-by: Wei Liu <liuwe@microsoft.com>
2022-11-18 12:50:01 +00:00
Bo Chen
134e555c42 vhdx: Fix wrong alignment calculation
With the existing macro, `align!(7, 4)` would generate `16` which is
obviously wrong. Also, given it is a macro, the compiler catch the error
if the provided 'alignment' is '0'.

Signed-off-by: Bo Chen <chen.bo@intel.com>
2022-09-17 10:23:49 +01:00
Rob Bradford
e300c3dcf7 vhdx: Avoid unwrap() of invalid header
In the original code:

If the first header was invalid and the second header had the same
sequence number (zero) then the invalid first header would be returned.

The new code is more Rust idiomatic and avoids this situation.

See: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=48858

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-07-08 10:19:11 +01:00
dependabot[bot]
bf059914a6 build: bump uuid from 0.8.2 to 1.0.0
Bumps [uuid](https://github.com/uuid-rs/uuid) from 0.8.2 to 1.0.0.
- [Release notes](https://github.com/uuid-rs/uuid/releases)
- [Commits](https://github.com/uuid-rs/uuid/compare/0.8.2...1.0.0)

---
updated-dependencies:
- dependency-name: uuid
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-20 09:41:22 +00:00
Rob Bradford
1311a7f178 vhdx: Appropriately mark unread fields
These fields are needed for correctly accessing the datastructures but
are not read by the VHDX implementation itself.

As identified by the new beta clippy.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-10-19 19:42:36 +01:00
Fazla Mehrab
452af9b17c vhdx: Fixed and dynamic VHDx block device implementation
Microsoft’s VHDx block device format specification is implemented
here as a crate. This commit includes the implementation for the
fixed and dynamic formats, where the other format is known as
differencing. The vhdx_header.rs, vhdx_bat.rs, vhdx_metadata.rs
implements parser and manipulators for the VHDx header, Block
Allocation Table, and metadata, respectively, for the VHDx file.
The vhdx_io.rs implements read and write routines for the VHDx file.
The vhdx.rs implements the Vhdx structure, which provides the wrapper
functions for standard I/O operations like read, write, and seek.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
Signed-off-by: Fazla Mehrab <akm.fazla.mehrab@intel.com>
2021-08-19 11:43:19 +02:00