[Spice-devel] [PATCH xf86_video_qxl 2/2 (v2)] XSpice: auto generate temp files for the vdagent process.

Christophe Fergeau cfergeau at redhat.com
Mon Nov 16 08:30:32 PST 2015


ACK

Christophe

On Mon, Nov 09, 2015 at 10:08:57AM -0600, Jeremy White wrote:
> Signed-off-by: Jeremy White <jwhite at codeweavers.com>
> ---
> Changes since v1:
>   - Use a temporary directory, not merely extending the name of
>     a single temporary file.
> ---
>  scripts/Xspice | 25 ++++++++++++++++++++++---
>  1 file changed, 22 insertions(+), 3 deletions(-)
> 
> diff --git a/scripts/Xspice b/scripts/Xspice
> index 5941f4f..15a5a5e 100755
> --- a/scripts/Xspice
> +++ b/scripts/Xspice
> @@ -90,9 +90,9 @@ parser.add_argument('--streaming-video', choices=['off', 'all', 'filter'],
>  add_boolean('--ipv4-only')
>  add_boolean('--ipv6-only')
>  parser.add_argument('--vdagent', action='store_true', dest='vdagent_enabled', default=False, help='launch vdagent & vdagentd. They provide clipboard & resolution automation')
> -parser.add_argument('--vdagent-virtio-path', default='/tmp/xspice-virtio', help='virtio socket path used by vdagentd')
> -parser.add_argument('--vdagent-uinput-path', default='/tmp/xspice-uinput', help='uinput socket path used by vdagent')
> -parser.add_argument('--vdagent-udcs-path', default='/tmp/xspice-vdagent', help='udcs socket path used by vdagent and vdagentd')
> +parser.add_argument('--vdagent-virtio-path', help='virtio socket path used by vdagentd')
> +parser.add_argument('--vdagent-uinput-path', help='uinput socket path used by vdagent')
> +parser.add_argument('--vdagent-udcs-path', help='udcs socket path used by vdagent and vdagentd')
>  parser.add_argument('--vdagentd-exec', help='path to spice-vdagentd (used with --vdagent)')
>  parser.add_argument('--vdagent-exec', help='path to spice-vdagent (used with --vdagent)')
>  parser.add_argument('--vdagent-no-launch', default=True, action='store_false', dest='vdagent_launch', help='do not launch vdagent & vdagentd, used for debugging or if some external script wants to take care of that')
> @@ -258,6 +258,25 @@ EndSection
>      """ % locals())
>      cf.flush()
>  
> +if args.vdagent_enabled:
> +    for f in [args.vdagent_udcs_path, args.vdagent_virtio_path, args.vdagent_uinput_path]:
> +        if f and os.path.exists(f):
> +            os.unlink(f)
> +
> +    if not temp_dir:
> +        temp_dir  = tempfile.mkdtemp(prefix="Xspice-")
> +        cleanup_dirs.append(temp_dir)
> +
> +    # Auto generate temporary files for vdagent
> +    if not args.vdagent_udcs_path:
> +        args.vdagent_udcs_path = temp_dir + "/vdagent.udcs"
> +    if not args.vdagent_virtio_path:
> +        args.vdagent_virtio_path = temp_dir + "/vdagent.virtio"
> +    if not args.vdagent_uinput_path:
> +        args.vdagent_uinput_path = temp_dir + "/vdagent.uinput"
> +
> +    cleanup_files.extend([args.vdagent_udcs_path, args.vdagent_virtio_path, args.vdagent_uinput_path])
> +
>  var_args = ['port', 'tls_port', 'disable_ticketing',
>      'x509_dir', 'sasl', 'cacert_file', 'x509_cert_file',
>      'x509_key_file', 'x509_key_password',
> -- 
> 2.1.4
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20151116/16127650/attachment.sig>


More information about the Spice-devel mailing list