disk: do not require DiskFile in ToAsyncDisk

This would complicate the implementation of ToAsyncDisk for qcow and
other formats. Change the trait bounds so that only the minimal set of
traits used in the asynchronous block device is required.

BUG=b:219595052
TEST=cargo build

Change-Id: Id5ece59596b0a0989f953854a9cf4c30d32f7e34
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3824064
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
This commit is contained in:
Daniel Verkamp 2022-02-14 16:34:33 -08:00 committed by crosvm LUCI
parent 8050152448
commit 03dd11a0d4

View file

@ -160,7 +160,7 @@ impl<
}
/// A `DiskFile` that can be converted for asychronous access.
pub trait ToAsyncDisk: DiskFile {
pub trait ToAsyncDisk: AsRawDescriptors + DiskGetLen + Send {
/// Convert a boxed self in to a box-wrapped implementaiton of AsyncDisk.
/// Used to convert a standard disk image to an async disk image. This conversion and the
/// inverse are needed so that the `Send` DiskImage can be given to the block thread where it is