replay: allows to specify a filter for record output
replay: allows to specify a filter for record output

This allows compression using external programs or any type
of filters.

To use it set SPICE_WORKER_RECORD_FILTER environment to the
filter command you want to use. The command is executed with
g_spawn_async_with_pipes (which uses execve) so is not a shell
command although the command is parsed using g_shell_parse_argv
which split arguments as shell does.

One easy way to use it is to just use a compressor like gzip with

  export SPICE_WORKER_RECORD_FILENAME=/tmp/qemu_record.gz
  export SPICE_WORKER_RECORD_FILTER=gzip
  qemu ...

The filter will receive the recording on standard input and is
supposed to write in output filename (which is the standard output).
You can use additional arguments in SPICE_WORKER_RECORD_FILTER to
specify for instance compression level.

Signed-off-by: Frediano Ziglio <55d48b080b2e443e395cde84d2c83b135a4ff48e@redhat.com>
Acked-by: Jonathon Jongsma <c7254805a17bd5c41e24c3a278fcbf3afcdfb0fa@redhat.com>

fgouget/spice,fgouget/spice,fgouget/spice,fgouget/spice