search for: vir_event_handle_read

Displaying 2 results from an estimated 2 matches for "vir_event_handle_read".

2013 Sep 18
2
Trouble using virStream with callbacks
...ne CONNECT_URI "qemu:///system" #define DOMAIN "TestVM" #define CHANNEL "channel.0" #define BUF_SIZE 80 int stream_active = 1; void stdin_to_stream(int watch, int fd, int events, void *opaque) { virStreamPtr stream = *((virStreamPtr*)(opaque)); if (events & VIR_EVENT_HANDLE_READABLE) { char buf[1024]; int bytes_read = read(fd, buf, sizeof(buf)); if (bytes_read > 0) virStreamSend(stream, buf, bytes_read); } if (events & (VIR_EVENT_HANDLE_ERROR|VIR_EVENT_HANDLE_HANGUP)) { stream_active = 0; } return; } void stream_to_stdou...
2019 Aug 05
2
Vm in state "in shutdown"
...too. 618 static void 619 qemuMonitorUpdateWatch(qemuMonitorPtr mon) 620 { 621 int events = 622 VIR_EVENT_HANDLE_HANGUP | 623 VIR_EVENT_HANDLE_ERROR; 624 625 if (!mon->watch) 626 return; 627 628 if (mon->lastError.code == VIR_ERR_OK) { 629 events |= VIR_EVENT_HANDLE_READABLE; 630 631 if ((mon->msg && mon->msg->txOffset < mon->msg->txLength) && 632 !mon->waitGreeting) 633 events |= VIR_EVENT_HANDLE_WRITABLE; 634 } 635 636 virEventUpdateHandle(mon->watch, events); 637 } I try to fix this...