aboutsummaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2021-07-20 14:53:53 +0200
committerMarkus Armbruster <armbru@redhat.com>2021-08-26 17:15:28 +0200
commitf9734d5d4078f17daf328b9e113aaffe3d00ecaf (patch)
treef0c0f46f58e1576c34b86ed2ee9db13edd57645f /ui
parentc83fcfaf8a54d0d034bd0edf7bbb3b0d16669be9 (diff)
error: Use error_fatal to simplify obvious fatal errors (again)
We did this with scripts/coccinelle/use-error_fatal.cocci before, in commit 50beeb68094 and 007b06578ab. This commit cleans up rarer variations that don't seem worth matching with Coccinelle. Cc: Thomas Huth <thuth@redhat.com> Cc: Cornelia Huck <cornelia.huck@de.ibm.com> Cc: Peter Xu <peterx@redhat.com> Cc: Juan Quintela <quintela@redhat.com> Cc: Stefan Hajnoczi <stefanha@redhat.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Marc-André Lureau <marcandre.lureau@redhat.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20210720125408.387910-2-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Peter Xu <peterx@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Diffstat (limited to 'ui')
-rw-r--r--ui/console.c6
-rw-r--r--ui/spice-core.c7
2 files changed, 3 insertions, 10 deletions
diff --git a/ui/console.c b/ui/console.c
index 1103b65314..5d2e6178ff 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -1508,7 +1508,6 @@ void register_displaychangelistener(DisplayChangeListener *dcl)
"This VM has no graphic display device.";
static DisplaySurface *dummy;
QemuConsole *con;
- Error *err = NULL;
assert(!dcl->ds);
@@ -1523,9 +1522,8 @@ void register_displaychangelistener(DisplayChangeListener *dcl)
dcl->con->gl = dcl;
}
- if (dcl->con && !dpy_compatible_with(dcl->con, dcl, &err)) {
- error_report_err(err);
- exit(1);
+ if (dcl->con) {
+ dpy_compatible_with(dcl->con, dcl, &error_fatal);
}
trace_displaychangelistener_register(dcl, dcl->ops->dpy_name);
diff --git a/ui/spice-core.c b/ui/spice-core.c
index 0371055e6c..31974b8d6c 100644
--- a/ui/spice-core.c
+++ b/ui/spice-core.c
@@ -671,18 +671,13 @@ static void qemu_spice_init(void)
}
passwordSecret = qemu_opt_get(opts, "password-secret");
if (passwordSecret) {
- Error *local_err = NULL;
if (qemu_opt_get(opts, "password")) {
error_report("'password' option is mutually exclusive with "
"'password-secret'");
exit(1);
}
password = qcrypto_secret_lookup_as_utf8(passwordSecret,
- &local_err);
- if (!password) {
- error_report_err(local_err);
- exit(1);
- }
+ &error_fatal);
} else {
str = qemu_opt_get(opts, "password");
if (str) {