Patchwork [2/9] spice: catch spice server initialization failures.

login
register
mail settings
Submitter Gerd Hoffmann
Date July 4, 2011, 3:14 p.m.
Message ID <1309792455-26825-3-git-send-email-kraxel@redhat.com>
Download mbox | patch
Permalink /patch/103123/
State New
Headers show

Comments

Gerd Hoffmann - July 4, 2011, 3:14 p.m.
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 |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

Patch

diff --git a/ui/spice-core.c b/ui/spice-core.c
index dd9905b..e142452 100644
--- a/ui/spice-core.c
+++ b/ui/spice-core.c
@@ -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;