virtio: Enable qcow support for virtio-block

With this enabled, one can pass a QCOW format disk
image with '--disk' switch.

Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
This commit is contained in:
Chao Peng
2019-05-10 07:27:56 +00:00
committed by Rob Bradford
parent 919226f31e
commit 6ecdd98634
6 changed files with 109 additions and 29 deletions

View File

@@ -15,7 +15,7 @@ pub trait Cacheable {
fn dirty(&self) -> bool;
}
#[derive(Debug)]
#[derive(Clone, Debug)]
/// Represents a vector that implements the `Cacheable` trait so it can be held in a cache.
pub struct VecCache<T: 'static + Copy + Default> {
vec: Box<[T]>,
@@ -83,7 +83,7 @@ impl<T: 'static + Copy + Default> IndexMut<usize> for VecCache<T> {
}
}
#[derive(Debug)]
#[derive(Clone, Debug)]
pub struct CacheMap<T: Cacheable> {
capacity: usize,
map: HashMap<usize, T>,