mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
block: virtio-devices: block: Clarify the return of execute_async()
Instead of returning boolean return an struct of completion status so that it can be cached for batch submission. Signed-off-by: Bo Chen <bchen@crusoe.ai> Signed-off-by: Muminul Islam <muislam@microsoft.com>
This commit is contained in:
@@ -20,7 +20,9 @@ use std::{io, result};
|
||||
use anyhow::anyhow;
|
||||
use block::async_io::{AsyncIo, AsyncIoError, DiskFile};
|
||||
use block::fcntl::{get_lock_state, LockError, LockType};
|
||||
use block::{build_serial, fcntl, ExecuteError, Request, RequestType, VirtioBlockConfig};
|
||||
use block::{
|
||||
build_serial, fcntl, ExecuteAsync, ExecuteError, Request, RequestType, VirtioBlockConfig,
|
||||
};
|
||||
use rate_limiter::group::{RateLimiterGroup, RateLimiterGroupHandle};
|
||||
use rate_limiter::TokenType;
|
||||
use seccompiler::SeccompAction;
|
||||
@@ -232,7 +234,11 @@ impl BlockEpollHandler {
|
||||
desc_chain.head_index() as u64,
|
||||
);
|
||||
|
||||
if let Ok(true) = result {
|
||||
if let Ok(ExecuteAsync {
|
||||
async_complete: true,
|
||||
..
|
||||
}) = result
|
||||
{
|
||||
self.inflight_requests
|
||||
.push_back((desc_chain.head_index(), request));
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user