mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-18 18:56:29 +00:00
Fix single-client handling in some block providers
This commit is contained in:
parent
927d71ad59
commit
34db8f5360
@ -2239,7 +2239,10 @@ struct Nvme::Main : Rpc_object<Typed_root<Block::Session>>
|
||||
Capability<Session> session(Root::Session_args const &args,
|
||||
Affinity const &) override
|
||||
{
|
||||
log("new block session: ", args.string());
|
||||
if (_block_session.constructed()) {
|
||||
error("device is already in use");
|
||||
throw Service_denied();
|
||||
}
|
||||
|
||||
Session_label const label { label_from_args(args.string()) };
|
||||
Session_policy const policy { label, _config_rom.xml() };
|
||||
|
@ -1034,8 +1034,6 @@ struct Usb::Main : Rpc_object<Typed_root<Block::Session>>
|
||||
Genode::Session_capability session(Root::Session_args const &args,
|
||||
Affinity const &) override
|
||||
{
|
||||
log("new block session: ", args.string());
|
||||
|
||||
if (block_session.constructed()) {
|
||||
error("device is already in use");
|
||||
throw Service_denied();
|
||||
|
@ -383,6 +383,9 @@ struct Main : Rpc_object<Typed_root<Block::Session>>,
|
||||
|
||||
void close(Capability<Session> cap) override
|
||||
{
|
||||
if (!_block_session.constructed())
|
||||
return;
|
||||
|
||||
if (cap == _block_session->cap()) {
|
||||
_block_session.destruct();
|
||||
_block_file.destruct();
|
||||
|
@ -212,7 +212,10 @@ struct Test::Main : Rpc_object<Typed_root<Block::Session> >
|
||||
Capability<Session> session(Root::Session_args const &args,
|
||||
Affinity const &) override
|
||||
{
|
||||
log("new block session: ", args.string());
|
||||
if (_block_session.constructed()) {
|
||||
error("already in use");
|
||||
throw Service_denied();
|
||||
}
|
||||
|
||||
size_t const ds_size =
|
||||
Arg_string::find_arg(args.string(), "tx_buf_size").ulong_value(0);
|
||||
|
Loading…
Reference in New Issue
Block a user