event_notifier: handle initialization failure better

Add 'initialized' field and use it to avoid touching event notifiers which are
either not initialized or if their initialization failed.

This is somewhat a hack, but it seems the less intrusive way to make
virtio code deal with event notifiers that failed initialization.

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
Message-Id: <20201217150040.906961-4-mlevitsk@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Maxim Levitsky 2020-12-17 17:00:40 +02:00 committed by Paolo Bonzini
parent dec2bb14b8
commit e34e47eb28
2 changed files with 17 additions and 0 deletions

View file

@ -24,6 +24,7 @@ struct EventNotifier {
#else
int rfd;
int wfd;
bool initialized;
#endif
};