spice: catch spice server initialization failures.
authorGerd Hoffmann <kraxel@redhat.com>
Wed, 15 Jun 2011 11:11:33 +0000 (13:11 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Mon, 4 Jul 2011 13:35:12 +0000 (15:35 +0200)
When the spice server initialization fails report this and exit instead
of ignoring the error.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
ui/spice-core.c

index dd9905be363106308c8982053498a14a875776fe..e142452bb655f5363194bdb0d91e90c41d191f56 100644 (file)
@@ -602,7 +602,10 @@ void qemu_spice_init(void)
 
     qemu_opt_foreach(opts, add_channel, NULL, 0);
 
-    spice_server_init(spice_server, &core_interface);
+    if (0 != spice_server_init(spice_server, &core_interface)) {
+        fprintf(stderr, "failed to initialize spice server");
+        exit(1);
+    };
     using_spice = 1;
 
     migration_state.notify = migration_state_notifier;