Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.

Commit 181d241

Browse files
committed
use special event ops for vsock
To have larger buffer size and also handle HUP events so that it is possible to reconnect to hyperstart. Signed-off-by: Peng Tao <bergwolf@gmail.com>
1 parent 2d4c0f1 commit 181d241

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

src/init.c

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,9 +1270,23 @@ static struct hyper_event_ops hyper_ttyfd_ops = {
12701270
.wbuf_size = 10240,
12711271
};
12721272

1273+
static struct hyper_event_ops hyper_vsock_ctlfd_ops = {
1274+
.read = hyper_ctlfd_read,
1275+
.hup = hyper_event_hup,
1276+
.rbuf_size = 65536,
1277+
};
1278+
1279+
static struct hyper_event_ops hyper_vsock_ttyfd_ops = {
1280+
.read = hyper_ttyfd_read,
1281+
.write = hyper_event_write,
1282+
.hup = hyper_event_hup,
1283+
.rbuf_size = 65536,
1284+
.wbuf_size = 65536,
1285+
};
1286+
12731287
static int hyper_vsock_ctl_accept(struct hyper_event *he, int efd, int events)
12741288
{
1275-
if (hyper_vsock_accept(he, efd, &hyper_epoll.ctl, &hyper_ctlfd_ops) < 0)
1289+
if (hyper_vsock_accept(he, efd, &hyper_epoll.ctl, &hyper_vsock_ctlfd_ops) < 0)
12761290
return -1;
12771291

12781292
if (hyper_ctl_send_ready(hyper_epoll.ctl.fd)) {
@@ -1285,7 +1299,7 @@ static int hyper_vsock_ctl_accept(struct hyper_event *he, int efd, int events)
12851299

12861300
static int hyper_vsock_msg_accept(struct hyper_event *he, int efd, int events)
12871301
{
1288-
return hyper_vsock_accept(he, efd, &hyper_epoll.tty, &hyper_ttyfd_ops);
1302+
return hyper_vsock_accept(he, efd, &hyper_epoll.tty, &hyper_vsock_ttyfd_ops);
12891303
}
12901304

12911305
static struct hyper_event_ops hyper_vsock_ctl_listen_ops = {

0 commit comments

Comments
 (0)