Displaying 1 result from an estimated 1 matches for "virstreameventaddcallback".
2013 Sep 18
2
Trouble using virStream with callbacks
...reamNew(conn, VIR_STREAM_NONBLOCK)) == NULL)
errx(1, "virStreamNew");
if (virDomainOpenChannel(dom, CHANNEL, st, 0) == -1)
errx(1, "virDomainOpenChannel");
if (virEventRegisterDefaultImpl() != 0)
errx(1, "virEventRegisterDefaultImpl");
if (virStreamEventAddCallback(st, 1|4|8, stream_to_stdout, NULL, NULL) != 0)
errx(1, "virStreamEventAddCallback");
int flags = fcntl(fileno(stdin), F_GETFL) | O_NONBLOCK;
fcntl(fileno(stdin), F_SETFL, flags);
if (virEventAddHandle(fileno(stdin), 1|4|8, stdin_to_stream, &st, NULL) < 0)
err...