pub struct GuestResource {
pub handle: GuestResourceHandle,
pub planes: Vec<FramePlane>,
pub width: u32,
pub height: u32,
pub format: Format,
pub guest_cpu_mappable: bool,
}Fields§
§handle: GuestResourceHandleHandle to the backing memory.
planes: Vec<FramePlane>Layout of color planes, if the resource will receive frames.
width: u32§height: u32§format: Format§guest_cpu_mappable: boolWhether the buffer can be accessed by the guest CPU. This means the host must ensure that all operations on the buffer are completed before passing it to the guest.
Implementations§
Source§impl GuestResource
impl GuestResource
Sourcepub fn from_virtio_guest_mem_entry(
mem_entries: &[virtio_video_mem_entry],
mem: &GuestMemory,
params: &Params,
) -> Result<GuestResource, GuestMemResourceCreationError>
pub fn from_virtio_guest_mem_entry( mem_entries: &[virtio_video_mem_entry], mem: &GuestMemory, params: &Params, ) -> Result<GuestResource, GuestMemResourceCreationError>
Try to convert an unresolved virtio guest memory entry into a resolved guest memory resource.
Convert mem_entry into the guest memory resource it represents and resolve it through
mem.
Width, height and format is set from params.
Panics if params.format is None.
Sourcepub fn from_virtio_object_entry(
object: virtio_video_object_entry,
res_bridge: &Tube,
params: &Params,
) -> Result<GuestResource, ObjectResourceCreationError>
pub fn from_virtio_object_entry( object: virtio_video_object_entry, res_bridge: &Tube, params: &Params, ) -> Result<GuestResource, ObjectResourceCreationError>
Try to convert an unresolved virtio object entry into a resolved object resource.
Convert object into the object resource it represents and resolve it through res_bridge.
Returns an error if the object’s UUID is invalid or cannot be resolved to a buffer object
by res_bridge.