Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/bhyve/pci_virtio_console.c
Show First 20 Lines • Show All 417 Lines • ▼ Show 20 Lines | if (!vq_has_descs(vq)) { | ||||
return; | return; | ||||
} | } | ||||
do { | do { | ||||
n = vq_getchain(vq, &idx, &iov, 1, NULL); | n = vq_getchain(vq, &idx, &iov, 1, NULL); | ||||
len = readv(sock->vss_conn_fd, &iov, n); | len = readv(sock->vss_conn_fd, &iov, n); | ||||
if (len == 0 || (len < 0 && errno == EWOULDBLOCK)) { | if (len == 0 || (len < 0 && errno == EWOULDBLOCK)) { | ||||
vq_retchain(vq); | vq_retchains(vq, 1); | ||||
vq_endchains(vq, 0); | vq_endchains(vq, 0); | ||||
if (len == 0) | if (len == 0) | ||||
goto close; | goto close; | ||||
return; | return; | ||||
} | } | ||||
vq_relchain(vq, idx, len); | vq_relchain(vq, idx, len); | ||||
▲ Show 20 Lines • Show All 247 Lines • Show Last 20 Lines |