From ddc98ee7562fa01abbd4d1b027efd5e98ceb93bf Mon Sep 17 00:00:00 2001 From: Timos Ampelikiotis Date: Tue, 10 Oct 2023 14:51:22 +0000 Subject: [ADD] Vhost-user-sound is being added Signed-off-by: Timos Ampelikiotis Change-Id: I77c6fe2a1e50d4c838662a5eee846780e265de5f --- adapter.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'adapter.c') diff --git a/adapter.c b/adapter.c index b95092c..75b5681 100644 --- a/adapter.c +++ b/adapter.c @@ -48,6 +48,8 @@ #include "vhost_user_blk.h" #include "vhost_user_input.h" #include "vhost_user_gpio.h" +#include "vhost_user_sound.h" + #ifdef DEBUG #define DBG(...) printf("adapter: " __VA_ARGS__) @@ -138,7 +140,7 @@ static void help_args(void) "\t\t [ -qn number of queues ]\n" "\t\t [ -qs size of queues ]\n" "The 'device_name' can be one of the following:\n" - "\tvrng, vhurng, vhublk, vhuinput, vhugpio\n"); + "\tvrng, vhurng, vhublk, vhuinput, vhusnd, vhugpio\n"); } int find_arg(int argc, char **argv, char *str) @@ -156,9 +158,9 @@ int find_arg(int argc, char **argv, char *str) int val_device_arg(char *str) { char *adapter_devices[] = {"vrng", "vhurng", "vhublk", "vhuinput", - "vhugpio"}; - char *vhu_devices[] = {"vhurng", "vhublk", "vhuinput", "vhugpio"}; - int adapter_devices_num = 5, i; + "vhusnd", "vhugpio"}; + char *vhu_devices[] = {"vhurng", "vhublk", "vhuinput", "vhusnd", "vhugpio"}; + int adapter_devices_num = 6, i; for (i = 0; i < adapter_devices_num; i++) { if (!strcmp(adapter_devices[i], str)) { @@ -171,8 +173,8 @@ int val_device_arg(char *str) bool check_vhu_device(char *str) { - char *vhu_devices[] = {"vhurng", "vhublk", "vhuinput", "vhugpio"}; - int vhu_devices_num = 4, i; + char *vhu_devices[] = {"vhurng", "vhublk", "vhuinput", "vhusnd", "vhugpio"}; + int vhu_devices_num = 5, i; for (i = 0; i < vhu_devices_num; i++) { if (!strcmp(vhu_devices[i], str)) { @@ -290,6 +292,9 @@ int main(int argc, char **argv) virtio_input_device_realize(); break; case 5: + vus_device_realize(); + break; + case 6: vu_gpio_device_realize(); break; default: -- cgit