libxl: add PV sound device
v3 cover libxl: add PV sound device
From: Oleksandr Grytsov <[email protected]>
This patch set adds PV sound device support to xl.cfg and xl. See sndif.h for protocol implementation details.
Changes since v2:
* address comments
* rename libxl_vsnd_stream.id -> libxl_vsnd_stream.unique_id
* use XENSND_FIELD_... defines in xl_parse.c and xl_vsnd.c
Oleksandr Grytsov (5):
libxl: add PV sound device
libxl: add vsnd list and info
xl: add PV sound condif parser
xl: add vsnd CLI commands
docs: add PV sound device config
docs/man/xl.cfg.pod.5.in | 149 ++++++ docs/man/xl.pod.1.in | 30 ++ tools/libxl/Makefile | 2 +- tools/libxl/libxl.h | 24 + tools/libxl/libxl_create.c | 1 + tools/libxl/libxl_internal.h | 1 + tools/libxl/libxl_types.idl | 83 ++++ tools/libxl/libxl_types_internal.idl | 1 + tools/libxl/libxl_utils.h | 3 + tools/libxl/libxl_vsnd.c | 684 +++++++++++++++++++++++++++ tools/xl/Makefile | 2 +- tools/xl/xl.h | 3 + tools/xl/xl_cmdtable.c | 15 + tools/xl/xl_parse.c | 246 ++++++++++ tools/xl/xl_parse.h | 1 + tools/xl/xl_vsnd.c | 206 ++++++++ 16 files changed, 1449 insertions(+), 2 deletions(-) create mode 100644 tools/libxl/libxl_vsnd.c create mode 100644 tools/xl/xl_vsnd.c
Signature · 7 lines
2.17.1 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
PATCH v3 1/5 libxl: add PV sound device
From: Oleksandr Grytsov <[email protected]>
Add PV sound device described in sndif.h
--- tools/libxl/Makefile | 2 +- tools/libxl/libxl.h | 14 ++ tools/libxl/libxl_create.c | 1 + tools/libxl/libxl_internal.h | 1 + tools/libxl/libxl_types.idl | 64 ++++++ tools/libxl/libxl_types_internal.idl | 1 + tools/libxl/libxl_vsnd.c | 325 +++++++++++++++++++++++++++ 7 files changed, 407 insertions(+), 1 deletion(-) create mode 100644 tools/libxl/libxl_vsnd.c
tools/libxl/Makefile +1 -1
@@ -140,7 +140,7 @@ LIBXL_OBJS = flexarray.o libxl.o libxl_create.o libxl_dm.o libxl_pci.o \ libxl_vtpm.o libxl_nic.o libxl_disk.o libxl_console.o \ libxl_cpupool.o libxl_mem.o libxl_sched.o libxl_tmem.o \ libxl_9pfs.o libxl_domain.o libxl_vdispl.o \ - libxl_pvcalls.o $(LIBXL_OBJS-y) + libxl_pvcalls.o libxl_vsnd.o $(LIBXL_OBJS-y) LIBXL_OBJS += libxl_genid.o LIBXL_OBJS += _libxl_types.o libxl_flask.o _libxl_types_internal.o
tools/libxl/libxl.h +14 -0
@@ -2000,6 +2000,20 @@ int libxl_device_vdispl_getinfo(libxl_ctx *ctx, uint32_t domid, libxl_vdisplinfo *vdisplinfo)LIBXL_EXTERNAL_CALLERS_ONLY ; +/* Virtual sounds */ +int libxl_device_vsnd_add(libxl_ctx *ctx, uint32_t domid, + libxl_device_vsnd *vsnd, + const libxl_asyncop_how *ao_how) + LIBXL_EXTERNAL_CALLERS_ONLY; +int libxl_device_vsnd_remove(libxl_ctx *ctx, uint32_t domid, + libxl_device_vsnd *vsnd, + const libxl_asyncop_how *ao_how) + LIBXL_EXTERNAL_CALLERS_ONLY; +int libxl_device_vsnd_destroy(libxl_ctx *ctx, uint32_t domid, + libxl_device_vsnd *vsnd, + const libxl_asyncop_how *ao_how) + LIBXL_EXTERNAL_CALLERS_ONLY; +/* Keyboard */ int libxl_device_vkb_add (libxl_ctx *ctx,uint32_t domid,libxl_device_vkb *vkb,const libxl_asyncop_how *ao_how)
tools/libxl/libxl_create.c +1 -0
@@ -1501,6 +1501,7 @@ const struct libxl_device_type *device_type_tbl[] = { &libxl__pcidev_devtype, &libxl__dtdev_devtype, &libxl__vdispl_devtype, + &libxl__vsnd_devtype, NULL };
tools/libxl/libxl_internal.h +1 -0
@@ -3653,6 +3653,7 @@ extern const struct libxl_device_type libxl__pcidev_devtype;extern const struct libxl_device_type libxl__vdispl_devtype;extern const struct libxl_device_type libxl__p9_devtype;extern const struct libxl_device_type libxl__pvcallsif_devtype; +extern const struct libxl_device_type libxl__vsnd_devtype;extern const struct libxl_device_type *device_type_tbl[];
tools/libxl/libxl_types.idl +64 -0
76 lines not on this page · raw message
tools/libxl/libxl_types_internal.idl +1 -0
@@ -29,6 +29,7 @@ libxl__device_kind = Enumeration("device_kind", [ (12, "VDISPL"), (13, "VUART"), (14, "PVCALLS"), + (15, "VSND"), ]) libxl__console_backend = Enumeration("console_backend", [
tools/libxl/libxl_vsnd.c new file +325 -0
325 lines not on this page · raw message
Signature · 7 lines
2.17.1 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
PATCH v3 2/5 libxl: add vsnd list and info
In reply to Oleksandr GrytsovFrom: Oleksandr Grytsov <[email protected]>
Add getting vsnd list and info API
--- tools/libxl/libxl.h | 10 + tools/libxl/libxl_types.idl | 19 ++ tools/libxl/libxl_utils.h | 3 + tools/libxl/libxl_vsnd.c | 365 +++++++++++++++++++++++++++++++++++- 4 files changed, 394 insertions(+), 3 deletions(-)
tools/libxl/libxl.h +10 -0
@@ -2014,6 +2014,16 @@ int libxl_device_vsnd_destroy(libxl_ctx *ctx, uint32_t domid, const libxl_asyncop_how *ao_how)LIBXL_EXTERNAL_CALLERS_ONLY ; +libxl_device_vsnd *libxl_device_vsnd_list (libxl_ctx *ctx, +uint32_t domid,int *num) +LIBXL_EXTERNAL_CALLERS_ONLY ; +void libxl_device_vsnd_list_free(libxl_device_vsnd* list, int num) + LIBXL_EXTERNAL_CALLERS_ONLY; +int libxl_device_vsnd_getinfo(libxl_ctx *ctx, uint32_t domid, + libxl_device_vsnd *vsnd, + libxl_vsndinfo *vsndlinfo) + LIBXL_EXTERNAL_CALLERS_ONLY; +/* Keyboard */ int libxl_device_vkb_add (libxl_ctx *ctx,uint32_t domid,libxl_device_vkb *vkb,const libxl_asyncop_how *ao_how)
tools/libxl/libxl_types.idl +19 -0
@@ -1019,6 +1019,25 @@ libxl_vdisplinfo = Struct("vdisplinfo", [ ("connectors", Array(libxl_connectorinfo, "num_connectors")) ], dir=DIR_OUT) +libxl_streaminfo = Struct("streaminfo", [ + ("req_evtch", integer), + ("req_rref", integer) + ]) + +libxl_pcminfo = Struct("pcminfo", [ + ("streams", Array(libxl_streaminfo, "num_vsnd_streams")) + ]) + +libxl_vsndinfo = Struct("vsndinfo", [ + ("backend", string), + ("backend_id", uint32), + ("frontend", string), + ("frontend_id", uint32), + ("devid", libxl_devid), + ("state", integer), + ("pcms", Array(libxl_pcminfo, "num_vsnd_pcms")) + ]) + # NUMA node characteristics: size and free are how much memory it has, and how # much of it is free, respectively. dists is an array of distances from this # node to each other node.
tools/libxl/libxl_utils.h +3 -0
@@ -82,6 +82,9 @@ int libxl_devid_to_device_usbctrl(libxl_ctx *ctx, uint32_t domid,int libxl_devid_to_device_vdispl (libxl_ctx *ctx,uint32_t domid,int devid,libxl_device_vdispl *vdispl); +int libxl_devid_to_device_vsnd (libxl_ctx *ctx,uint32_t domid, +int devid,libxl_device_vsnd *vsnd); +int libxl_ctrlport_to_device_usbdev (libxl_ctx *ctx,uint32_t domid,int ctrl,int port,libxl_device_usbdev *usbdev);
tools/libxl/libxl_vsnd.c +362 -3
395 lines not on this page · raw message
Signature · 7 lines
2.17.1 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [PATCH v3 2/5] libxl: add vsnd list and info
Quoted 5 lines · Oleksandr Grytsov
From: Oleksandr Grytsov <[email protected]>
Add getting vsnd list and info API
Signed-off-by Oleksandr Grytsov <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
PATCH v3 3/5 xl: add PV sound condif parser
In reply to Oleksandr GrytsovFrom: Oleksandr Grytsov <[email protected]>
Add config parser for virtual sound devices
--- tools/xl/xl_parse.c | 246 ++++++++++++++++++++++++++++++++++++++++++++ tools/xl/xl_parse.h | 1 + 2 files changed, 247 insertions(+)
tools/xl/xl_parse.c +246 -0
@@ -19,6 +19,7 @@#include <stdlib.h> #include <xen/hvm/e820.h> #include <xen/hvm/params.h> +#include <xen/io/sndif.h> #include <libxl.h> #include <libxl_utils.h>
@@ -851,6 +852,249 @@ out:return rc; } +static int parse_vsnd_params (libxl_vsnd_params *params,char *token) +{ +char *oparg; +int i; + +if (MATCH_OPTION (XENSND_FIELD_SAMPLE_RATES , token, oparg)) { +libxl_string_list rates =NULL ; + +split_string_into_string_list (oparg,";" , &rates); + + params->num_sample_rates =libxl_string_list_length (&rates); + params->sample_rates =calloc (params->num_sample_rates, +sizeof (*params->sample_rates)); + +for (i =0 ; i < params->num_sample_rates; i++) { + params->sample_rates[i] =strtoul (rates[i],NULL ,0 ); + } + +libxl_string_list_dispose (&rates); + }else if (MATCH_OPTION (XENSND_FIELD_SAMPLE_FORMATS , token, oparg)) { +libxl_string_list formats =NULL ; + +split_string_into_string_list (oparg,";" , &formats); + + params->num_sample_formats =libxl_string_list_length (&formats); + params->sample_formats =calloc (params->num_sample_formats, +sizeof (*params->sample_formats)); + +for (i =0 ; i < params->num_sample_formats; i++) { +libxl_vsnd_pcm_format format; + +if (libxl_vsnd_pcm_format_from_string (formats[i], &format)) { +fprintf (stderr,"Invalid pcm format: %s\n" , formats[i]); +exit (EXIT_FAILURE ); + } + + params->sample_formats[i] = format; + } + +libxl_string_list_dispose (&formats); + }else if (MATCH_OPTION (XENSND_FIELD_CHANNELS_MIN , token, oparg)) { + params->channels_min =strtoul (oparg,NULL ,0 ); + }else if (MATCH_OPTION (XENSND_FIELD_CHANNELS_MAX , token, oparg)) { + params->channels_max =strtoul (oparg,NULL ,0 ); + }else if (MATCH_OPTION (XENSND_FIELD_BUFFER_SIZE , token, oparg)) { + params->buffer_size =strtoul (oparg,NULL ,0 ); + }else { +return 1 ; + } + +return 0 ; +} + +static int parse_vsnd_pcm_stream (libxl_device_vsnd *vsnd,char *param) +{ +if (vsnd->num_vsnd_pcms ==0 ) { +fprintf (stderr,"No vsnd pcm device\n" ); +return -1 ; + } + +libxl_vsnd_pcm *pcm = &vsnd->pcms[vsnd->num_vsnd_pcms -1 ]; + +if (pcm->num_vsnd_streams ==0 ) { +fprintf (stderr,"No vsnd stream\n" ); +return -1 ; + } + +libxl_vsnd_stream *stream = &pcm->streams[pcm->num_vsnd_streams -1 ]; + +if (parse_vsnd_params (&stream->params, param)) { +char *oparg; + +if (MATCH_OPTION (XENSND_FIELD_STREAM_UNIQUE_ID , param, oparg)) { + stream->unique_id =strdup (oparg); + }else if (MATCH_OPTION (XENSND_FIELD_TYPE , param, oparg)) { +if (libxl_vsnd_stream_type_from_string (oparg, &stream->type)) { +fprintf (stderr,"Invalid stream type: %s\n" , oparg); +return -1 ; + } + }else { +fprintf (stderr,"Invalid parameter: %s\n" , param); +return -1 ; + } + } + +return 0 ; +} + +static int parse_vsnd_pcm_param (libxl_device_vsnd *vsnd,char *param) +{ +if (vsnd->num_vsnd_pcms ==0 ) { +fprintf (stderr,"No pcm device\n" ); +return -1 ; + } + +libxl_vsnd_pcm *pcm = &vsnd->pcms[vsnd->num_vsnd_pcms -1 ]; + +if (parse_vsnd_params (&pcm->params, param)) { +char *oparg; + +if (MATCH_OPTION (XENSND_FIELD_DEVICE_NAME , param, oparg)) { + pcm->name =strdup (oparg); + }else { +fprintf (stderr,"Invalid parameter: %s\n" , param); +return -1 ; + } + } + +return 0 ; +} + +static int parse_vsnd_card_param (libxl_device_vsnd *vsnd,char *param) +{ +if (parse_vsnd_params (&vsnd->params, param)) { +char *oparg; + +if (MATCH_OPTION ("backend" , param, oparg)) { + vsnd->backend_domname =strdup (oparg); + }else if (MATCH_OPTION (XENSND_FIELD_VCARD_SHORT_NAME , param, oparg)) { + vsnd->short_name =strdup (oparg); + }else if (MATCH_OPTION (XENSND_FIELD_VCARD_LONG_NAME , param, oparg)) { + vsnd->long_name =strdup (oparg); + }else { +fprintf (stderr,"Invalid parameter: %s\n" , param); +return -1 ; + } + } + +return 0 ; +} + +static int parse_vsnd_create_item (libxl_device_vsnd *vsnd,const char *key) +{ +if (strcasecmp (key,"card" ) ==0 ) { + + }else if (strcasecmp (key,"pcm" ) ==0 ) { +ARRAY_EXTEND_INIT_NODEVID (vsnd->pcms, vsnd->num_vsnd_pcms, + libxl_vsnd_pcm_init); + }else if (strcasecmp (key,"stream" ) ==0 ) { +if (vsnd->num_vsnd_pcms ==0 ) { +ARRAY_EXTEND_INIT_NODEVID (vsnd->pcms, vsnd->num_vsnd_pcms, + libxl_vsnd_pcm_init); + } + +libxl_vsnd_pcm *pcm = &vsnd->pcms[vsnd->num_vsnd_pcms -1 ]; + +ARRAY_EXTEND_INIT_NODEVID (pcm->streams, pcm->num_vsnd_streams, + libxl_vsnd_stream_init); + }else { +fprintf (stderr,"Invalid key: %s\n" , key); +return -1 ; + } + +return 0 ; +} + +int parse_vsnd_item (libxl_device_vsnd *vsnd,const char *spec) +{ +char *buf =strdup (spec); +char *token =strtok (buf,"," ); +char *key =NULL ; +int ret; + +while (token) { +while (*token ==' ' ) token++; + +if (!key) { + key = token; + ret =parse_vsnd_create_item (vsnd, key); +if (ret) goto out; + }else { +if (strcasecmp (key,"card" ) ==0 ) { + ret =parse_vsnd_card_param (vsnd, token); +if (ret) goto out; + }else if (strcasecmp (key,"pcm" ) ==0 ) { + ret =parse_vsnd_pcm_param (vsnd, token); +if (ret) goto out; + }else if (strcasecmp (key,"stream" ) ==0 ) { + ret =parse_vsnd_pcm_stream (vsnd, token); +if (ret) goto out; + } + } + token =strtok (NULL ,"," ); + } + + ret =0 ; + +out: +free (buf); +return ret; +} + +static void parse_vsnd_card_config (const XLU_Config *config, +XLU_ConfigValue *card_value, +libxl_domain_config *d_config) +{ +int ret; +XLU_ConfigList *card_list; +libxl_device_vsnd *vsnd; +const char *card_item; +int item =0 ; + + ret =xlu_cfg_value_get_list (config, card_value, &card_list,0 ); + +if (ret) { +fprintf (stderr,"Failed to get vsnd card list: %s\n" ,strerror (ret)); + goto out; + } + + vsnd =ARRAY_EXTEND_INIT (d_config->vsnds, + d_config->num_vsnds, + libxl_device_vsnd_init); + +while ((card_item =xlu_cfg_get_listitem (card_list, item++)) !=NULL ) { + ret =parse_vsnd_item (vsnd, card_item); +if (ret) goto out; + } + + ret =0 ; + +out: + +if (ret)exit (EXIT_FAILURE ); +} + +static void parse_vsnd_config (const XLU_Config *config, +libxl_domain_config *d_config) +{ +XLU_ConfigList *vsnds; + +if (!xlu_cfg_get_list (config,"vsnd" , &vsnds,0 ,0 )) { +XLU_ConfigValue *card_value; + + d_config->num_vsnds =0 ; + d_config->vsnds =NULL ; + +while ((card_value =xlu_cfg_get_listitem2 (vsnds, d_config->num_vsnds)) + !=NULL ) { +parse_vsnd_card_config (config, card_value, d_config); + } + } +} + void parse_config_data(const char *config_source, const char *config_data, int config_len,
@@ -1726,6 +1970,8 @@ void parse_config_data(const char *config_source, } } +parse_vsnd_config (config, d_config); +if (!xlu_cfg_get_list (config,"channel" , &channels,0 ,0 )) { d_config->num_channels =0 ; d_config->channels =NULL ;
tools/xl/xl_parse.h +1 -0
@@ -34,6 +34,7 @@ int parse_usbdev_config(libxl_device_usbdev *usbdev, char *token);int parse_cpurange (const char *cpu,libxl_bitmap *cpumap);int parse_nic_config (libxl_device_nic *nic,XLU_Config **config,char *token);int parse_vdispl_config (libxl_device_vdispl *vdispl,char *token); +int parse_vsnd_item (libxl_device_vsnd *vsnd,const char *spec);int match_option_size (const char *prefix,size_t len,char *arg,char **argopt);
Signature · 7 lines
2.17.1 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
PATCH v3 4/5 xl: add vsnd CLI commands
In reply to Oleksandr GrytsovFrom: Oleksandr Grytsov <[email protected]>
Add CLI commands to attach, detach and list virtual sound devices
--- tools/xl/Makefile | 2 +- tools/xl/xl.h | 3 + tools/xl/xl_cmdtable.c | 15 +++ tools/xl/xl_vsnd.c | 206 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 225 insertions(+), 1 deletion(-) create mode 100644 tools/xl/xl_vsnd.c
tools/xl/Makefile +1 -1
@@ -22,7 +22,7 @@ XL_OBJS += xl_vtpm.o xl_block.o xl_nic.o xl_usb.o XL_OBJS += xl_sched.o xl_pci.o xl_vcpu.o xl_cdrom.o xl_mem.o XL_OBJS += xl_info.o xl_console.o xl_misc.o XL_OBJS += xl_vmcontrol.o xl_saverestore.o xl_migrate.o -XL_OBJS += xl_vdispl.o +XL_OBJS += xl_vdispl.o xl_vsnd.o $(XL_OBJS): CFLAGS += $(CFLAGS_libxentoollog) $(XL_OBJS): CFLAGS += $(CFLAGS_XL)
tools/xl/xl.h +3 -0
@@ -170,6 +170,9 @@ int main_vtpmdetach(int argc, char **argv);int main_vdisplattach (int argc,char **argv);int main_vdispllist (int argc,char **argv);int main_vdispldetach (int argc,char **argv); +int main_vsndattach (int argc,char **argv); +int main_vsndlist (int argc,char **argv); +int main_vsnddetach (int argc,char **argv);int main_usbctrl_attach (int argc,char **argv);int main_usbctrl_detach (int argc,char **argv);int main_usbdev_attach (int argc,char **argv);
tools/xl/xl_cmdtable.c +15 -0
@@ -399,6 +399,21 @@ struct cmd_spec cmd_table[] = {"Destroy a domain's virtual display device" ,"<Domain> <DevId>" , }, + { "vsnd-attach", + &main_vsndattach,1 ,1 , +"Create a new virtual sound device" , +"<Domain> <vsnd-spec-component(s)>..." , + }, + { "vsnd-list", + &main_vsndlist,0 ,0 , +"List virtual display devices for a domain" , +"<Domain(s)>" , + }, + { "vsnd-detach", + &main_vsnddetach,0 ,1 , +"Destroy a domain's virtual sound device" , +"<Domain> <DevId>" , + }, { "uptime", &main_uptime,0 ,0 , "Print uptime for all/some domains",
tools/xl/xl_vsnd.c new file +206 -0
206 lines not on this page · raw message
Signature · 7 lines
2.17.1 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
PATCH v3 5/5 docs: add PV sound device config
In reply to Oleksandr GrytsovFrom: Oleksandr Grytsov <[email protected]>
Update documentation with virtual sound device
--- docs/man/xl.cfg.pod.5.in | 149 +++++++++++++++++++++++++++++++++++++++ docs/man/xl.pod.1.in | 30 ++++++++ 2 files changed, 179 insertions(+)
docs/man/xl.cfg.pod.5.in +149 -0
@@ -1414,6 +1414,155 @@ we may break backward compatibility. =back +=item B<vsnd=[ VCARD_SPEC, VCARD_SPEC, ... ]> + +Specifies the virtual sound cards to be provided to the guest. +Each B<VCARD_SPEC> is a list, which has a form of +"[VSND_ITEM_SPEC, VSND_ITEM_SPEC, ... ]" (without the quotes). +The virtual sound card has hierarchical structure. +Every card has a set of PCM devices and streams, each could be individually +configured. + +B<VSND_ITEM_SPEC> describes individual item parameters. +B<VSND_ITEM_SPEC> is a string of comma separated item parameters +headed by item identifier. Each item parameter is C<KEY=VALUE> pair: + +=over 4 + +"identifier, param = value, ...". + +=back + +Identifier shall be one of following values: "CARD", "PCM", "STREAM". +The child item treated as belonging to the previously defined parent item. + +All parameters are optional. + +There are group of parameters which are common for all items. +This group can be defined at higher level of the hierarchy and be fully or +partially re-used by the underlying layers. These parameters are: + +=over 4 + +* number of channels (min/max) + +* supported sample rates + +* supported sample formats + +=back + +E.g. one can define these values for the whole card, device or stream. +Every underlying layer in turn can re-define some or all of them to better +fit its needs. For example, card may define number of channels to be +in [1; 8] range, and some particular stream may be limited to [1; 2] only. +The rule is that the underlying layer must be a subset of the upper layer +range. + +I<COMMON parameters:> + +=over 4 + +=over 4 + +=item B<sample-rates=RATES> + +List of integer values separated by semicolon: sample-rates=8000;22050;44100 + +=item B<sample-formats=FORMATS> + +List of string values separated by semicolon: sample-formats=s16_le;s8;u32_be + +Supported formats: s8, u8, s16_le, s16_be, u16_le, u16_be, s24_le, s24_be, +u24_le, u24_be, s32_le, s32_be, u32_le, u32_be, float_le, float_be, +float64_le, float64_be, iec958_subframe_le, iec958_subframe_be, +mu_law, a_law, ima_adpcm, mpeg, gsm + +=item B<channels-min=NUMBER> + +The minimum amount of channels. + +=item B<channels-max=NUMBER> + +The maximum amount of channels. + +=item B<buffer-size=NUMBER> + +The maximum size in octets of the buffer to allocate per stream. + +=back + +=back + +I<CARD specification:> + +=over 4 + +=over 4 + +=item B<backend=domain-id> + +Specify the backend domain name or id, defaults to dom0. + +=item B<short-name=STRING> + +Short name of the virtual sound card. + +=item B<long-name=STRING> + +Long name of the virtual sound card. + +=back + +=back + +I<PCM specification:> + +=over 4 + +=over 4 + +=item B<name=STRING> + +Name of the PCM sound device within the virtual sound card. + +=back + +=back + +I<STREAM specification:> + +=over 4 + +=over 4 + +=item B<unique-id=STRING> + +Unique stream identifier. + +=item B<type=TYPE> + +Stream type: "p" - playback stream, "c" - capture stream. + +=back + +=back + +I<EXAMPLE:> + + vsnd = [ + ['CARD, short-name=Main, sample-formats=s16_le;s8;u32_be', + 'PCM, name=Main', + 'STREAM, id=0, type=p', + 'STREAM, id=1, type=c, channels-max=2' + ], + ['CARD, short-name=Second', + 'PCM, name=Second, buffer-size=1024', + 'STREAM, id=2, type=p', + 'STREAM, id=3, type=c' + ] + ] + =back =head2 Paravirtualised (PV) Guest Specific Options
docs/man/xl.pod.1.in +30 -0
@@ -1492,6 +1492,36 @@ List virtual displays for a domain. =back +=head2 VSND DEVICES + +=over 4 + +=item B<vsnd-attach> I<domain-id> I<vsnd-item> I<vsnd-item> ... + +Creates a new vsnd device in the domain specified by I<domain-id>. +I<vsnd-item>'s describe the vsnd device to attach, using the same format as the +B<VSND_ITEM_SPEC> string in the domain config file. See L<xl.cfg> for +more information. + +B<EXAMPLE> + +=over 4 + +xl vsnd-attach DomU 'CARD, short-name=Main, sample-formats=s16_le;s8;u32_be' +'PCM, name=Main' 'STREAM, id=0, type=p' 'STREAM, id=1, type=c, channels-max=2' + +=back + +=item B<vsnd-detach> I<domain-id> I<dev-id> + +Removes the vsnd device specified by I<dev-id> from the domain specified by I<domain-id>. + +=item B<vsnd-list> I<domain-id> + +List vsnd devices for a domain. + +=back + =head1 PCI PASS-THROUGH =over 4
Signature · 7 lines
2.17.1 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 37 lines · Oleksandr Grytsov
From: Oleksandr Grytsov <[email protected]>
This patch set adds PV sound device support to xl.cfg and xl. See
sndif.hfor protocol implementation details.Changes since v2:
* address comments
* rename libxl_vsnd_stream.id -> libxl_vsnd_stream.unique_id
* useXENSND_FIELD_... defines inxl_parse.candxl_vsnd.cOleksandr Grytsov (5):
libxl: add PV sound device
libxl: add vsnd list and info
xl: add PV sound condif parser
xl: add vsnd CLI commands
docs: add PV sound device configdocs/man/xl.cfg.pod.5.in | 149 ++++++ docs/man/xl.pod.1.in | 30 ++ tools/libxl/Makefile | 2 +- tools/libxl/libxl.h | 24 + tools/libxl/libxl_create.c | 1 + tools/libxl/libxl_internal.h | 1 + tools/libxl/libxl_types.idl | 83 ++++ tools/libxl/libxl_types_internal.idl | 1 + tools/libxl/libxl_utils.h | 3 + tools/libxl/libxl_vsnd.c | 684 +++++++++++++++++++++++++++ tools/xl/Makefile | 2 +- tools/xl/xl.h | 3 + tools/xl/xl_cmdtable.c | 15 + tools/xl/xl_parse.c | 246 ++++++++++ tools/xl/xl_parse.h | 1 + tools/xl/xl_vsnd.c | 206 ++++++++ 16 files changed, 1449 insertions(+), 2 deletions(-) create mode 100644 tools/libxl/libxl_vsnd.c create mode 100644 tools/xl/xl_vsnd.c
Quoted 4 lines
--
2.17.1
ping
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel