static void rng_backend_prop_set_opened(Object *obj, bool value, Error **errp) { RngBackend *s = RNG_BACKEND(obj); RngBackendClass *k = RNG_BACKEND_GET_CLASS(s); Error *local_err = NULL; if (value == s->opened) { return; } if (!value && s->opened) { error_setg(errp, QERR_PERMISSION_DENIED); return; } if (k->opened) { k->opened(s, &local_err); if (local_err) { error_propagate(errp, local_err); return; } } s->opened = true; }
void rng_backend_cancel_requests(RngBackend *s) { RngBackendClass *k = RNG_BACKEND_GET_CLASS(s); if (k->cancel_requests) { k->cancel_requests(s); } }
void rng_backend_request_entropy(RngBackend *s, size_t size, EntropyReceiveFunc *receive_entropy, void *opaque) { RngBackendClass *k = RNG_BACKEND_GET_CLASS(s); if (k->request_entropy) { k->request_entropy(s, size, receive_entropy, opaque); } }
static void rng_backend_prop_set_opened(Object *obj, bool value, Error **errp) { RngBackend *s = RNG_BACKEND(obj); RngBackendClass *k = RNG_BACKEND_GET_CLASS(s); if (value == s->opened) { return; } if (!value && s->opened) { error_set(errp, QERR_PERMISSION_DENIED); return; } if (k->opened) { k->opened(s, errp); } if (!error_is_set(errp)) { s->opened = value; } }