dcavalca / rpms / qemu

Forked from rpms/qemu a year ago
Clone

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

5544c1
From 9fa75115d0f300817a372dd8b9460d6b65a30b20 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
5544c1
Subject: [PATCH] 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>
5544c1
(cherry picked from commit 835cab85ad83ed8dfe1c13243aeda5959b153e3e)
5544c1
5544c1
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.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
-- 
5544c1
1.7.12.1
Hans de Goede c8dfc6