diff options
author | Thanos Makatos <thanos.makatos@nutanix.com> | 2021-02-04 15:39:54 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-04 15:39:54 +0000 |
commit | dc82d02a19716729c0d24dc7c3e5b0af12c9751a (patch) | |
tree | 7421531d2d0da350143831af55fc473e756c0235 /samples/server.c | |
parent | 1193fa7b6b4afe00f199f5fe7e86ddff27723baa (diff) | |
download | libvfio-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/server.c')
-rw-r--r-- | samples/server.c | 13 |
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; } |