error: Replace error_report() & error_free() with error_report_err()
authorzhanghailiang <zhang.zhanghailiang@huawei.com>
Wed, 4 Mar 2015 10:25:54 +0000 (18:25 +0800)
committerMichael Tokarev <mjt@tls.msk.ru>
Thu, 19 Mar 2015 08:11:55 +0000 (11:11 +0300)
This is a continuation of the work started in commit 565f65d27:
"error: Use error_report_err() where appropriate"

Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
hw/arm/virt.c
savevm.c

index b2eaea835343c2b4cb85f11274a4bfe2ef7b39a4..b652b07ced5b2d0dd8c489f6a402f11c21836fad 100644 (file)
@@ -771,7 +771,7 @@ static void machvirt_init(MachineState *machine)
         cc->parse_features(CPU(cpuobj), cpuopts, &err);
         g_free(cpuopts);
         if (err) {
-            error_report("%s", error_get_pretty(err));
+            error_report_err(err);
             exit(1);
         }
 
index e7d97eea935eb47c7374fcbbcbcdf869a6e124f6..3b0e222cb3ad623cc7ddac64b0c90e4f8ad4837a 100644 (file)
--- a/savevm.c
+++ b/savevm.c
@@ -941,8 +941,7 @@ int qemu_loadvm_state(QEMUFile *f)
     int file_error_after_eof = -1;
 
     if (qemu_savevm_state_blocked(&local_err)) {
-        error_report("%s", error_get_pretty(local_err));
-        error_free(local_err);
+        error_report_err(local_err);
         return -EINVAL;
     }