virtio: Derive Clone for DescriptorChain

Allow DescriptorChain to be cloned.  This will enable devices to
maintain a read head and write head in the same DescriptorChain.

BUG=chromium:703939
TEST=clone the DescriptorChain in a method

Change-Id: I1d775a9e0b7ed42052272f22a9b308ad4d108e45
Signed-off-by: Chirantan Ekbote <chirantan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1065171
Reviewed-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
This commit is contained in:
Chirantan Ekbote 2018-05-03 18:43:39 -07:00 committed by chrome-bot
parent 72fa671f6c
commit 6452eaf902

View file

@ -14,6 +14,7 @@ const VIRTQ_DESC_F_WRITE: u16 = 0x2;
const VIRTQ_DESC_F_INDIRECT: u16 = 0x4;
/// A virtio descriptor chain.
#[derive(Clone)]
pub struct DescriptorChain<'a> {
mem: &'a GuestMemory,
desc_table: GuestAddress,