aboutsummaryrefslogtreecommitdiff
path: root/samples
diff options
context:
space:
mode:
authorThanos Makatos <thanos.makatos@nutanix.com>2021-02-04 15:39:54 +0000
committerGitHub <noreply@github.com>2021-02-04 15:39:54 +0000
commitdc82d02a19716729c0d24dc7c3e5b0af12c9751a (patch)
tree7421531d2d0da350143831af55fc473e756c0235 /samples
parent1193fa7b6b4afe00f199f5fe7e86ddff27723baa (diff)
downloadlibvfio-user-dc82d02a19716729c0d24dc7c3e5b0af12c9751a.zip
libvfio-user-dc82d02a19716729c0d24dc7c3e5b0af12c9751a.tar.gz
libvfio-user-dc82d02a19716729c0d24dc7c3e5b0af12c9751a.tar.bz2
client/server: misc comments (#304)
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
Diffstat (limited to 'samples')
-rw-r--r--samples/server.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/samples/server.c b/samples/server.c
index 11a7b55..6170753 100644
--- a/samples/server.c
+++ b/samples/server.c
@@ -536,12 +536,23 @@ int main(int argc, char *argv[])
if (irq_triggered) {
irq_triggered = false;
vfu_irq_trigger(vfu_ctx, 0);
-
+ /*
+ * Apart from triggering an IRQ via the eventfd, we also
+ * trigger an IRQ via a message, simply for demonstrating how
+ * it's done. The client expects this behavior from the server.
+ */
ret = vfu_irq_message(vfu_ctx, 0);
if (ret < 0) {
err(EXIT_FAILURE, "vfu_irq_message() failed");
}
+ /*
+ * We also initiate some dummy DMA via an explicit message,
+ * again to show how DMA is done. This is used if the client's
+ * RAM isn't mappable or the server implementation prefers it
+ * this way. Again, the client expects the server to send DMA
+ * messages right after it has triggered the IRQs.
+ */
do_dma_io(vfu_ctx, &server_data);
ret = 0;
}