On 06/09/17 17:32, Wei Liu wrote: > On Wed, Sep 06, 2017 at 05:15:46PM +0200, Juergen Gross wrote: >>>> +grant_table_init(struct domain *d) >>>> +{ >>>> + struct grant_table *gt = d->grant_table; >>>> + unsigned int i, j; >>>> + >>>> + if ( gt->nr_grant_frames ) >>>> + return 0; >>>> + >>> >>> EBUSY here? I think we should catch the cases when this is called >>> multiple times. >> >> No. The call of grant_table_init() from >> domain_unpause_by_systemcontroller() can't be masked, otherwise I >> would have to make struct grant_table public again. Multiple calls >> are okay. > > For domain_unpause_by_systemcontroller, isn't it already guarded by > d->creation_finished to ensure there is only one call to > grant_table_init? > > Or do you mean if gnttab_table_init fails the system administrator will > somehow tries to unpause the domain again hence calling grant_table_init > again? >
No. It might have been called already due to e.g. gnttab_setup_table() being called as a result of xc_dom_gnttab_seed() during creation of the domU. The call from domain_unpause_by_systemcontroller() is just a safety net for cases where gnttab_setup_table() wasn't used (e.g. in case of a xenstore stubdom). Juergen _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel