On 16.06.21 16:43, Julien Grall wrote: > From: Julien Grall > > Currently, the callbacks can_read and can_write are called directly. This > doesn't allow us to add generic check and therefore requires duplication. > > At the moment, one check that could benefit to be common is whether the > connection should ignored. The position is slightly different between > domain and socket because for the latter we want to check the state of > the file descriptor first. > > In follow-up patches, there will be more potential generic checks. > > This patch provides wrappers to read/write a connection and move > the check ->is_ignored after the callback for everyone. > > This also requires to replace the direct call to domain_can_read() > and domain_can_write() with the new wrapper. At the same time, > both functions can now be static. Note that the implementations need > to be moved earlier in the file xenstored_domain.c to avoid > declaring the prototype. > > Signed-off-by: Julien Grall Reviewed-by: Juergen Gross Juergen