summaryrefslogtreecommitdiff
path: root/usr.sbin/vmd/vionet.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2024-11-21 13:17:04 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2024-11-21 13:17:04 +0000
commitcaba869c8447fc7ef9f32581e1d02262e51ec18a (patch)
treec06988b36b6677e805071a9673b04b5360e2e36d /usr.sbin/vmd/vionet.c
parent9c8d00dd06d79ba9fccf07c45cd1bdae73e744c5 (diff)
Rename imsg_init, imsg_clear, imsg_read, imsg_write and imsg_flush to
imsgbuf_init, imsgbuf_clear, imsgbuf_read, imsgbuf_write and imsgbuf_flush. This separates the imsgbuf API from the per-imsg API. OK tb@
Diffstat (limited to 'usr.sbin/vmd/vionet.c')
-rw-r--r--usr.sbin/vmd/vionet.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/usr.sbin/vmd/vionet.c b/usr.sbin/vmd/vionet.c
index 76a12c60e06..7a4f61bda68 100644
--- a/usr.sbin/vmd/vionet.c
+++ b/usr.sbin/vmd/vionet.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vionet.c,v 1.19 2024/11/21 13:16:07 claudio Exp $ */
+/* $OpenBSD: vionet.c,v 1.20 2024/11/21 13:17:02 claudio Exp $ */
/*
* Copyright (c) 2023 Dave Voutila <dv@openbsd.org>
@@ -241,7 +241,7 @@ vionet_main(int fd, int fd_vmm)
/* Configure our sync channel event handler. */
log_debug("%s: wiring in sync channel handler (fd=%d)", __func__,
dev.sync_fd);
- imsg_init(&dev.sync_iev.ibuf, dev.sync_fd);
+ imsgbuf_init(&dev.sync_iev.ibuf, dev.sync_fd);
dev.sync_iev.handler = handle_sync_io;
dev.sync_iev.data = &dev;
dev.sync_iev.events = EV_READ;
@@ -297,7 +297,7 @@ fail:
msg.data = ret;
imsg_compose(&dev.sync_iev.ibuf, IMSG_DEVOP_MSG, 0, 0, -1, &msg,
sizeof(msg));
- imsg_flush(&dev.sync_iev.ibuf);
+ imsgbuf_flush(&dev.sync_iev.ibuf);
close_fd(dev.sync_fd);
close_fd(dev.async_fd);
@@ -903,8 +903,8 @@ dev_dispatch_vm(int fd, short event, void *arg)
fatalx("%s: missing vionet pointer", __func__);
if (event & EV_READ) {
- if ((n = imsg_read(ibuf)) == -1 && errno != EAGAIN)
- fatal("%s: imsg_read", __func__);
+ if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
+ fatal("%s: imsgbuf_read", __func__);
if (n == 0) {
/* this pipe is dead, so remove the event handler */
log_debug("%s: pipe dead (EV_READ)", __func__);
@@ -915,7 +915,7 @@ dev_dispatch_vm(int fd, short event, void *arg)
}
if (event & EV_WRITE) {
- if (imsg_write(ibuf) == -1) {
+ if (imsgbuf_write(ibuf) == -1) {
if (errno == EPIPE) {
/* this pipe is dead, remove the handler */
log_debug("%s: pipe dead (EV_WRITE)", __func__);
@@ -923,7 +923,7 @@ dev_dispatch_vm(int fd, short event, void *arg)
event_loopexit(NULL);
return;
}
- fatal("%s: imsg_write", __func__);
+ fatal("%s: imsgbuf_write", __func__);
}
}
@@ -976,8 +976,8 @@ handle_sync_io(int fd, short event, void *arg)
int8_t intr = INTR_STATE_NOOP;
if (event & EV_READ) {
- if ((n = imsg_read(ibuf)) == -1 && errno != EAGAIN)
- fatal("%s: imsg_read", __func__);
+ if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN)
+ fatal("%s: imsgbuf_read", __func__);
if (n == 0) {
/* this pipe is dead, so remove the event handler */
log_debug("%s: pipe dead (EV_READ)", __func__);
@@ -988,7 +988,7 @@ handle_sync_io(int fd, short event, void *arg)
}
if (event & EV_WRITE) {
- if (imsg_write(ibuf) == -1) {
+ if (imsgbuf_write(ibuf) == -1) {
if (errno == EPIPE) {
/* this pipe is dead, remove the handler */
log_debug("%s: pipe dead (EV_WRITE)", __func__);
@@ -996,7 +996,7 @@ handle_sync_io(int fd, short event, void *arg)
event_loopexit(NULL);
return;
}
- fatal("%s: imsg_write", __func__);
+ fatal("%s: imsgbuf_write", __func__);
}
}