Re: [RFC 1/9] notifier: add validity check and notify function

2012-07-24 Thread Paolo Bonzini
Il 25/07/2012 00:33, Nicholas A. Bellinger ha scritto: > +int event_notifier_notify(EventNotifier *e) > +{ > +uint64_t value = 1; > +int r; > + > +assert(event_notifier_valid(e)); > +r = write(e->fd, &value, sizeof(value)); > +if (r < 0) { > +return -errno; > +} > +

[RFC 1/9] notifier: add validity check and notify function

2012-07-24 Thread Nicholas A. Bellinger
From: Stefan Hajnoczi Event notifiers that have not had the event_notifier_init() function called on them are invalid. The event_notifier_valid() function checks whether or not an event notifier is valild. This can be used to check whether a notifier is in use or not. It sometimes useful to no