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 <olaf@aepfle.de> Reviewed-by: Saurabh Sengar <ssengar@linux.microsoft.com> Link: https://lore.kernel.org/r/20241105081437.15689-1-olaf@aepfle.de Signed-off-by: Wei Liu <wei.liu@kernel.org> Message-ID: <20241105081437.15689-1-olaf@aepfle.de>
1 parent 67b5e10 commit a9640fc

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

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)