From e228bd2aeb14cb94de90e68948fc3e84dd324719 Mon Sep 17 00:00:00 2001
From: Alon Levy <alevy@redhat.com>
Date: Wed, 29 Feb 2012 09:34:57 +0100
Subject: [PATCH 07/12] ui/spice-core: fix segfault in monitor

RH-Author: Alon Levy <alevy@redhat.com>
Message-id: <1330508097-2535-1-git-send-email-alevy@redhat.com>
Patchwork-id: 37688
O-Subject: [PATCH RHEL-6.3 qemu-kvm] ui/spice-core: fix segfault in monitor
Bugzilla: 743251
RH-Acked-by: Gerd Hoffmann <kraxel@redhat.com>
RH-Acked-by: Markus Armbruster <armbru@redhat.com>
RH-Acked-by: Hans de Goede <hdegoede@redhat.com>

Fix segfault if a qxl device is present but no spice command line
argument is given.

RHBZ 743251.

Signed-off-by: Alon Levy <alevy@redhat.com>

Upstream: 3bb781f3ed91bd3f085ded4d16f089e7b66f1076

brew: http://brewweb.devel.redhat.com/brew/taskinfo?taskID=4097081
---
 ui/spice-core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Signed-off-by: Michal Novotny <minovotn@redhat.com>
---
 ui/spice-core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/ui/spice-core.c b/ui/spice-core.c
index 196e6ab..a880bf1 100644
--- a/ui/spice-core.c
+++ b/ui/spice-core.c
@@ -503,7 +503,7 @@ void do_info_spice(Monitor *mon, QObject **ret_data)
     const char *addr;
     int port, tls_port;
 
-    if (!spice_server) {
+    if (!spice_server || !opts) {
         *ret_data = qobject_from_jsonf("{ 'enabled': false }");
         return;
     }
-- 
1.7.7.6

