Skip to content

Commit a9640fc

Browse files
olafheringliuw
authored andcommitted
tools/hv: terminate fcopy daemon if read from uio fails
Terminate endless loop in reading fails, to avoid flooding syslog. This happens if the state of "Guest services" integration service is changed from "enabled" to "disabled" at runtime in the VM settings. In this case pread returns EIO. Also handle an interrupted system call, and continue in this case. Signed-off-by: Olaf Hering <[email protected]> Reviewed-by: Saurabh Sengar <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Wei Liu <[email protected]> Message-ID: <[email protected]>
1 parent 67b5e10 commit a9640fc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tools/hv/hv_fcopy_uio_daemon.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,8 +466,10 @@ int main(int argc, char *argv[])
466466
*/
467467
ret = pread(fcopy_fd, &tmp, sizeof(int), 0);
468468
if (ret < 0) {
469+
if (errno == EINTR || errno == EAGAIN)
470+
continue;
469471
syslog(LOG_ERR, "pread failed: %s", strerror(errno));
470-
continue;
472+
goto close;
471473
}
472474

473475
len = HV_RING_SIZE;

0 commit comments

Comments
 (0)