dcavalca / rpms / qemu

Forked from rpms/qemu a year ago
Clone

Blame 0201-spice-abort-on-invalid-streaming-cmdline-params.patch

Hans de Goede c8dfc6
From 46851363e2aed89fc535803c8a23f6bed9934312 Mon Sep 17 00:00:00 2001
Hans de Goede c8dfc6
From: Christophe Fergeau <cfergeau@redhat.com>
Hans de Goede c8dfc6
Date: Mon, 13 Aug 2012 10:32:32 +0200
Hans de Goede c8dfc6
Subject: [PATCH 201/215] spice: abort on invalid streaming cmdline params
Hans de Goede c8dfc6
Hans de Goede c8dfc6
When parsing its command line parameters, spice aborts when it
Hans de Goede c8dfc6
finds unexpected values, except for the 'streaming-video' option.
Hans de Goede c8dfc6
This happens because the parsing of the parameters for this option
Hans de Goede c8dfc6
is done using the 'name2enum' helper, which does not error out
Hans de Goede c8dfc6
on unknown values. Using the 'parse_name' helper makes sure we
Hans de Goede c8dfc6
error out in this case. Looking at git history, the use of
Hans de Goede c8dfc6
'name2enum' instead of 'parse_name' seems to have been an oversight,
Hans de Goede c8dfc6
so let's change to that now.
Hans de Goede c8dfc6
Hans de Goede c8dfc6
Fixes rhbz#831708
Hans de Goede c8dfc6
Hans de Goede c8dfc6
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Hans de Goede c8dfc6
---
Hans de Goede c8dfc6
 ui/spice-core.c | 3 ++-
Hans de Goede c8dfc6
 1 file changed, 2 insertions(+), 1 deletion(-)
Hans de Goede c8dfc6
Hans de Goede c8dfc6
diff --git a/ui/spice-core.c b/ui/spice-core.c
Hans de Goede c8dfc6
index 4fc48f8..bb4f585 100644
Hans de Goede c8dfc6
--- a/ui/spice-core.c
Hans de Goede c8dfc6
+++ b/ui/spice-core.c
Hans de Goede c8dfc6
@@ -344,7 +344,8 @@ static const char *stream_video_names[] = {
Hans de Goede c8dfc6
     [ SPICE_STREAM_VIDEO_FILTER ] = "filter",
Hans de Goede c8dfc6
 };
Hans de Goede c8dfc6
 #define parse_stream_video(_name) \
Hans de Goede c8dfc6
-    name2enum(_name, stream_video_names, ARRAY_SIZE(stream_video_names))
Hans de Goede c8dfc6
+    parse_name(_name, "stream video control", \
Hans de Goede c8dfc6
+               stream_video_names, ARRAY_SIZE(stream_video_names))
Hans de Goede c8dfc6
 
Hans de Goede c8dfc6
 static const char *compression_names[] = {
Hans de Goede c8dfc6
     [ SPICE_IMAGE_COMPRESS_OFF ]      = "off",
Hans de Goede c8dfc6
-- 
Hans de Goede c8dfc6
1.7.12
Hans de Goede c8dfc6