> +fn init_qom() {
> +    static ONCE: Mutex<Cell<bool>> = Mutex::new(Cell::new(false));
> +
> +    let g = ONCE.lock().unwrap();
> +    if !g.get() {
> +        unsafe {
> +            module_call_init(module_init_type::MODULE_INIT_QOM);
> +        }
> +        g.set(true);
> +    }
> +}

Only one question: what is the purpose of using a Mutex here?

Others LGTM,

Reviewed-by: Zhao Liu <zhao1....@intel.com>


Reply via email to