diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/libxl/libxl.h | 11 | ||||
-rw-r--r-- | tools/libxl/libxl_create.c | 3 | ||||
-rw-r--r-- | tools/libxl/libxl_dm.c | 10 | ||||
-rw-r--r-- | tools/libxl/libxl_types.idl | 2 | ||||
-rw-r--r-- | tools/libxl/xl_cmdimpl.c | 4 |
5 files changed, 30 insertions, 0 deletions
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h index be19bf5186..4cab2947e7 100644 --- a/tools/libxl/libxl.h +++ b/tools/libxl/libxl.h @@ -344,6 +344,17 @@ */ #define LIBXL_HAVE_DOMINFO_OUTSTANDING_MEMKB 1 +/* + * LIBXL_HAVE_SPICE_VDAGENT + * + * If defined, then the libxl_spice_info structure will contain a boolean type: + * vdagent and clipboard_sharing. These values define if Spice vdagent and + * clipboard sharing are enabled. + * + * If this is not defined, the Spice vdagent support is ignored. + */ +#define LIBXL_HAVE_SPICE_VDAGENT 1 + /* Functions annotated with LIBXL_EXTERNAL_CALLERS_ONLY may not be * called from within libxl itself. Callers outside libxl, who * do not #include libxl_internal.h, are fine. */ diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c index 0c32d0b143..7567238f75 100644 --- a/tools/libxl/libxl_create.c +++ b/tools/libxl/libxl_create.c @@ -272,6 +272,9 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc, libxl_defbool_setdefault(&b_info->u.hvm.spice.disable_ticketing, false); libxl_defbool_setdefault(&b_info->u.hvm.spice.agent_mouse, true); + libxl_defbool_setdefault(&b_info->u.hvm.spice.vdagent, false); + libxl_defbool_setdefault(&b_info->u.hvm.spice.clipboard_sharing, + false); } libxl_defbool_setdefault(&b_info->u.hvm.nographic, false); diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c index 4035b6db62..43c3becc7a 100644 --- a/tools/libxl/libxl_dm.c +++ b/tools/libxl/libxl_dm.c @@ -351,6 +351,10 @@ static char *dm_spice_options(libxl__gc *gc, opt = libxl__sprintf(gc, "%s,password=%s", opt, spice->passwd); opt = libxl__sprintf(gc, "%s,agent-mouse=%s", opt, libxl_defbool_val(spice->agent_mouse) ? "on" : "off"); + + if (!libxl_defbool_val(spice->clipboard_sharing)) + opt = libxl__sprintf(gc, "%s,disable-copy-paste", opt); + return opt; } @@ -472,6 +476,12 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc, flexarray_append(dm_args, "-spice"); flexarray_append(dm_args, spiceoptions); + if (libxl_defbool_val(b_info->u.hvm.spice.vdagent)) { + flexarray_vappend(dm_args, "-device", "virtio-serial", + "-chardev", "spicevmc,id=vdagent,name=vdagent", "-device", + "virtserialport,chardev=vdagent,name=com.redhat.spice.0", + NULL); + } } switch (b_info->u.hvm.vga.kind) { diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl index 10f95f42e3..049dbb50b5 100644 --- a/tools/libxl/libxl_types.idl +++ b/tools/libxl/libxl_types.idl @@ -181,6 +181,8 @@ libxl_spice_info = Struct("spice_info", [ ("disable_ticketing", libxl_defbool), ("passwd", string), ("agent_mouse", libxl_defbool), + ("vdagent", libxl_defbool), + ("clipboard_sharing", libxl_defbool), ]) libxl_sdl_info = Struct("sdl_info", [ diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index 35b3e290ff..3d7eaad5e0 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -1495,6 +1495,10 @@ skip_vfb: &b_info->u.hvm.spice.passwd, 0); xlu_cfg_get_defbool(config, "spiceagent_mouse", &b_info->u.hvm.spice.agent_mouse, 0); + xlu_cfg_get_defbool(config, "spicevdagent", + &b_info->u.hvm.spice.vdagent, 0); + xlu_cfg_get_defbool(config, "spice_clipboard_sharing", + &b_info->u.hvm.spice.clipboard_sharing, 0); xlu_cfg_get_defbool(config, "nographic", &b_info->u.hvm.nographic, 0); xlu_cfg_get_defbool(config, "gfx_passthru", &b_info->u.hvm.gfx_passthru, 0); |