File tree 1 file changed +2
-2
lines changed 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,7 @@ impl MutEventSubscriber for ApiServerAdapter {
71
71
let event_set = event. event_set ( ) ;
72
72
73
73
if source == self . api_event_fd . as_raw_fd ( ) && event_set == EventSet :: IN {
74
+ let _ = self . api_event_fd . read ( ) ;
74
75
match self . from_api . try_recv ( ) {
75
76
Ok ( api_request) => {
76
77
let request_is_pause = * api_request == VmmAction :: Pause ;
@@ -101,7 +102,6 @@ impl MutEventSubscriber for ApiServerAdapter {
101
102
panic ! ( "The channel's sending half was disconnected. Cannot receive data." ) ;
102
103
}
103
104
} ;
104
- let _ = self . api_event_fd . read ( ) ;
105
105
} else {
106
106
error ! ( "Spurious EventManager event for handler: ApiServerAdapter" ) ;
107
107
}
@@ -129,7 +129,7 @@ pub(crate) fn run_with_api(
129
129
// FD to notify of API events. This is a blocking eventfd by design.
130
130
// It is used in the config/pre-boot loop which is a simple blocking loop
131
131
// which only consumes API events.
132
- let api_event_fd = EventFd :: new ( 0 ) . expect ( "Cannot create API Eventfd." ) ;
132
+ let api_event_fd = EventFd :: new ( libc :: EFD_SEMAPHORE ) . expect ( "Cannot create API Eventfd." ) ;
133
133
134
134
// Channels for both directions between Vmm and Api threads.
135
135
let ( to_vmm, from_api) = channel ( ) ;
You can’t perform that action at this time.
0 commit comments