qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [RFC PATCH v1 25/25] core: Update error API usages


From: Peter Crosthwaite
Subject: [Qemu-devel] [RFC PATCH v1 25/25] core: Update error API usages
Date: Thu, 10 Sep 2015 22:33:35 -0700

Use error_prefix() and error_report_err() as appropriate.

Cc: Paolo Bonzini <address@hidden>
Signed-off-by: Peter Crosthwaite <address@hidden>
---

 arch_init.c | 5 ++---
 ui/vnc.c    | 5 ++---
 vl.c        | 7 +++----
 3 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/arch_init.c b/arch_init.c
index 38f5fb9..bb8db89 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -258,9 +258,8 @@ void do_acpitable_option(const QemuOpts *opts)
 
     acpi_table_add(opts, &err);
     if (err) {
-        error_report("Wrong acpi table provided: %s",
-                     error_get_pretty(err));
-        error_free(err);
+        error_prefix(err, "Wrong acpi table provided: ");
+        error_report_err(err);
         exit(1);
     }
 #endif
diff --git a/ui/vnc.c b/ui/vnc.c
index caf82f5..84324bf 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -3775,9 +3775,8 @@ int vnc_init_func(void *opaque, QemuOpts *opts, Error 
**errp)
     vnc_display_init(id);
     vnc_display_open(id, &local_err);
     if (local_err != NULL) {
-        error_report("Failed to start VNC server: %s",
-                     error_get_pretty(local_err));
-        error_free(local_err);
+        error_prefix(local_err, "Failed to start VNC server: ");
+        error_report_err(local_err);
         exit(1);
     }
     return 0;
diff --git a/vl.c b/vl.c
index 584ca88..17dcffd 100644
--- a/vl.c
+++ b/vl.c
@@ -4543,7 +4543,7 @@ int main(int argc, char **argv, char **envp)
         Error *local_err = NULL;
         qemu_boot_set(boot_once, &local_err);
         if (local_err) {
-            error_report("%s", error_get_pretty(local_err));
+            error_report_err(local_err);
             exit(1);
         }
         qemu_register_reset(restore_boot_order, g_strdup(boot_order));
@@ -4633,9 +4633,8 @@ int main(int argc, char **argv, char **envp)
         Error *local_err = NULL;
         qemu_start_incoming_migration(incoming, &local_err);
         if (local_err) {
-            error_report("-incoming %s: %s", incoming,
-                         error_get_pretty(local_err));
-            error_free(local_err);
+            error_prefix(local_err, "-incoming %s: ", incoming);
+            error_report_err(local_err);
             exit(1);
         }
     } else if (autostart) {
-- 
1.9.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]