summaryrefslogtreecommitdiff
path: root/usr.sbin/vmd/virtio.h
diff options
context:
space:
mode:
authorStefan Kempf <stefan@cvs.openbsd.org>2016-09-02 17:08:29 +0000
committerStefan Kempf <stefan@cvs.openbsd.org>2016-09-02 17:08:29 +0000
commit6bc684acd42f9e0f827f818d90cc646951f89f37 (patch)
tree82a6ef460392ed77e777ce242bd651769c5273da /usr.sbin/vmd/virtio.h
parent9dad6c8830c07e1ae5c1ee536fe4c288299fb221 (diff)
Process incoming host->guest packets asynchronously to running VCPU
This registers a handler with libevent that is called on incoming packets for the guest. If they cannot be handled immediately (because the virtq is full), make sure they are handled on VCPU exits. ok mlarkin@
Diffstat (limited to 'usr.sbin/vmd/virtio.h')
-rw-r--r--usr.sbin/vmd/virtio.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.sbin/vmd/virtio.h b/usr.sbin/vmd/virtio.h
index a676797f5fb..a231ea65026 100644
--- a/usr.sbin/vmd/virtio.h
+++ b/usr.sbin/vmd/virtio.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: virtio.h,v 1.4 2016/07/09 09:06:22 stefan Exp $ */
+/* $OpenBSD: virtio.h,v 1.5 2016/09/02 17:08:28 stefan Exp $ */
/*
* Copyright (c) 2015 Mike Larkin <mlarkin@openbsd.org>
@@ -103,12 +103,17 @@ struct vioblk_dev {
};
struct vionet_dev {
+ pthread_mutex_t mutex;
+ struct event event;
+
struct virtio_io_cfg cfg;
struct virtio_vq_info vq[VIRTIO_MAX_QUEUES];
int fd, rx_added;
int rx_pending;
+ uint32_t vm_id;
+ int irq;
uint8_t mac[6];
};