diff mbox

[1/6] vl: Use &error_fatal when parsing VNC options

Message ID 1463062204-20330-2-git-send-email-ehabkost@redhat.com
State New
Headers show

Commit Message

Eduardo Habkost May 12, 2016, 2:09 p.m. UTC
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 vl.c | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)
diff mbox

Patch

diff --git a/vl.c b/vl.c
index 82f18b5..bd05609 100644
--- a/vl.c
+++ b/vl.c
@@ -2149,11 +2149,7 @@  static DisplayType select_display(const char *p)
 #endif
     } else if (strstart(p, "vnc", &opts)) {
         if (*opts == '=') {
-            Error *err = NULL;
-            if (vnc_parse(opts + 1, &err) == NULL) {
-                error_report_err(err);
-                exit(1);
-            }
+            vnc_parse(opts + 1, &error_fatal);
         } else {
             error_report("VNC requires a display argument vnc=<display>");
             exit(1);
@@ -3707,15 +3703,8 @@  int main(int argc, char **argv, char **envp)
                 }
                 break;
             case QEMU_OPTION_vnc:
-            {
-                Error *local_err = NULL;
-
-                if (vnc_parse(optarg, &local_err) == NULL) {
-                    error_report_err(local_err);
-                    exit(1);
-                }
+                vnc_parse(optarg, &error_fatal);
                 break;
-            }
             case QEMU_OPTION_no_acpi:
                 acpi_enabled = 0;
                 break;