Cap-resource request on Pd_session::transfer_quota
This patch handles the case where a PD's cap quota becomes exhausted on the attempt to transfer caps via 'Env::pd().transfer_quota'. The solution mirrors the existing code for RAM quota. Prior this patch, the 'transfer_quota' operation would trigger an 'Out_of_caps' exception.
This commit is contained in:
parent
cc437a5eca
commit
6fb7022508
|
@ -85,6 +85,15 @@ struct Genode::Expanding_pd_session_client : Pd_session_client
|
||||||
[&] () { _request_ram_from_parent(amount.value); },
|
[&] () { _request_ram_from_parent(amount.value); },
|
||||||
NUM_ATTEMPTS);
|
NUM_ATTEMPTS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void transfer_quota(Pd_session_capability pd_session, Cap_quota amount) override
|
||||||
|
{
|
||||||
|
enum { NUM_ATTEMPTS = 2 };
|
||||||
|
retry<Out_of_caps>(
|
||||||
|
[&] () { Pd_session_client::transfer_quota(pd_session, amount); },
|
||||||
|
[&] () { _request_caps_from_parent(amount.value); },
|
||||||
|
NUM_ATTEMPTS);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* _INCLUDE__BASE__INTERNAL__EXPANDING_PD_SESSION_CLIENT_H_ */
|
#endif /* _INCLUDE__BASE__INTERNAL__EXPANDING_PD_SESSION_CLIENT_H_ */
|
||||||
|
|
Loading…
Reference in New Issue