Disable recording filtering for Windows

Although this feature can be ported to Windows doing so would
require the usage of g_spawn_async_with_fds, which is only available
in GLib 2.58 or some specific Win32 code.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
This commit is contained in:
Frediano Ziglio 2018-11-08 07:50:37 +00:00
parent 9a07eb6582
commit d417a0bdfd
2 changed files with 12 additions and 2 deletions

View File

@ -815,6 +815,7 @@ void red_record_qxl_command(RedRecord *record, RedMemSlotInfo *slots,
pthread_mutex_unlock(&record->lock);
}
#ifndef _WIN32
/**
* Redirects child output to the file specified
*/
@ -827,6 +828,7 @@ static void child_output_setup(gpointer user_data)
}
close(fd);
}
#endif
RedRecord *red_record_new(const char *filename)
{
@ -843,6 +845,7 @@ RedRecord *red_record_new(const char *filename)
filter = getenv("SPICE_WORKER_RECORD_FILTER");
if (filter) {
#ifndef _WIN32
gint argc;
gchar **argv = NULL;
GError *error = NULL;
@ -868,6 +871,10 @@ RedRecord *red_record_new(const char *filename)
}
close(fd_in);
g_spawn_close_pid(child_pid);
#else
// TODO
spice_warning("recorder filter not supported under Windows");
#endif
}
if (fwrite(header, sizeof(header)-1, 1, f) != 1) {

View File

@ -35,9 +35,9 @@ test_record(bool compress)
RedRecord *rec;
const char *fn = OUTPUT_FILENAME;
unsetenv("SPICE_WORKER_RECORD_FILTER");
g_unsetenv("SPICE_WORKER_RECORD_FILTER");
if (compress) {
setenv("SPICE_WORKER_RECORD_FILTER", "gzip", 1);
g_setenv("SPICE_WORKER_RECORD_FILTER", "gzip", 1);
}
// delete possible stale test output
@ -95,6 +95,9 @@ int
main(void)
{
test_record(false);
// TODO implement on Windows
#ifndef _WIN32
test_record(true);
#endif
return 0;
}