tape: correctly call Async handler in proxmox-tape
This commit is contained in:
parent
42cb9bd6a5
commit
6fe9aedd0b
|
@ -167,7 +167,7 @@ async fn rewind(
|
||||||
},
|
},
|
||||||
)]
|
)]
|
||||||
/// Eject/Unload drive media
|
/// Eject/Unload drive media
|
||||||
fn eject_media(
|
async fn eject_media(
|
||||||
mut param: Value,
|
mut param: Value,
|
||||||
rpcenv: &mut dyn RpcEnvironment,
|
rpcenv: &mut dyn RpcEnvironment,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
|
@ -179,7 +179,7 @@ fn eject_media(
|
||||||
let info = &api2::tape::drive::API_METHOD_EJECT_MEDIA;
|
let info = &api2::tape::drive::API_METHOD_EJECT_MEDIA;
|
||||||
|
|
||||||
match info.handler {
|
match info.handler {
|
||||||
ApiHandler::Sync(handler) => (handler)(param, info, rpcenv)?,
|
ApiHandler::Async(handler) => (handler)(param, info, rpcenv).await?,
|
||||||
_ => unreachable!(),
|
_ => unreachable!(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -200,7 +200,7 @@ fn eject_media(
|
||||||
},
|
},
|
||||||
)]
|
)]
|
||||||
/// Load media
|
/// Load media
|
||||||
fn load_media(
|
async fn load_media(
|
||||||
mut param: Value,
|
mut param: Value,
|
||||||
rpcenv: &mut dyn RpcEnvironment,
|
rpcenv: &mut dyn RpcEnvironment,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
|
@ -212,7 +212,7 @@ fn load_media(
|
||||||
let info = &api2::tape::drive::API_METHOD_LOAD_MEDIA;
|
let info = &api2::tape::drive::API_METHOD_LOAD_MEDIA;
|
||||||
|
|
||||||
match info.handler {
|
match info.handler {
|
||||||
ApiHandler::Sync(handler) => (handler)(param, info, rpcenv)?,
|
ApiHandler::Async(handler) => (handler)(param, info, rpcenv).await?,
|
||||||
_ => unreachable!(),
|
_ => unreachable!(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -273,7 +273,7 @@ async fn label_media(
|
||||||
},
|
},
|
||||||
)]
|
)]
|
||||||
/// Read media label
|
/// Read media label
|
||||||
fn read_label(
|
async fn read_label(
|
||||||
mut param: Value,
|
mut param: Value,
|
||||||
rpcenv: &mut dyn RpcEnvironment,
|
rpcenv: &mut dyn RpcEnvironment,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
|
@ -285,7 +285,7 @@ fn read_label(
|
||||||
let output_format = get_output_format(¶m);
|
let output_format = get_output_format(¶m);
|
||||||
let info = &api2::tape::drive::API_METHOD_READ_LABEL;
|
let info = &api2::tape::drive::API_METHOD_READ_LABEL;
|
||||||
let mut data = match info.handler {
|
let mut data = match info.handler {
|
||||||
ApiHandler::Sync(handler) => (handler)(param, info, rpcenv)?,
|
ApiHandler::Async(handler) => (handler)(param, info, rpcenv).await?,
|
||||||
_ => unreachable!(),
|
_ => unreachable!(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -361,7 +361,7 @@ async fn inventory(
|
||||||
|
|
||||||
let param = json!({ "drive": &drive });
|
let param = json!({ "drive": &drive });
|
||||||
let mut data = match info.handler {
|
let mut data = match info.handler {
|
||||||
ApiHandler::Sync(handler) => (handler)(param, info, rpcenv)?,
|
ApiHandler::Async(handler) => (handler)(param, info, rpcenv).await?,
|
||||||
_ => unreachable!(),
|
_ => unreachable!(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue