[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC PATCH v1 21/25] tests: Update error API usages
From: |
Peter Crosthwaite |
Subject: |
[Qemu-devel] [RFC PATCH v1 21/25] tests: Update error API usages |
Date: |
Thu, 10 Sep 2015 22:33:31 -0700 |
Use error_prefix() and error_report_err() as appropriate.
Cc: Stefan Hajnoczi <address@hidden>
Signed-off-by: Peter Crosthwaite <address@hidden>
---
tests/test-aio.c | 5 ++---
tests/test-thread-pool.c | 5 ++---
tests/test-throttle.c | 9 ++++-----
3 files changed, 8 insertions(+), 11 deletions(-)
diff --git a/tests/test-aio.c b/tests/test-aio.c
index 217e337..daeeb47 100644
--- a/tests/test-aio.c
+++ b/tests/test-aio.c
@@ -802,9 +802,8 @@ int main(int argc, char **argv)
ctx = aio_context_new(&local_error);
if (!ctx) {
- error_report("Failed to create AIO Context: '%s'",
- error_get_pretty(local_error));
- error_free(local_error);
+ error_prefix(local_err, "Failed to create AIO Context: ");
+ error_report_err(local_err);
exit(1);
}
src = aio_get_g_source(ctx);
diff --git a/tests/test-thread-pool.c b/tests/test-thread-pool.c
index 6a0b981..231c789 100644
--- a/tests/test-thread-pool.c
+++ b/tests/test-thread-pool.c
@@ -229,9 +229,8 @@ int main(int argc, char **argv)
ctx = aio_context_new(&local_error);
if (!ctx) {
- error_report("Failed to create AIO Context: '%s'",
- error_get_pretty(local_error));
- error_free(local_error);
+ error_prefix(local_error, "Failed to create AIO Context:");
+ error_report_err(local_error);
exit(1);
}
pool = aio_get_thread_pool(ctx);
diff --git a/tests/test-throttle.c b/tests/test-throttle.c
index 85c9b6c..4996445 100644
--- a/tests/test-throttle.c
+++ b/tests/test-throttle.c
@@ -587,12 +587,11 @@ int main(int argc, char **argv)
ctx = qemu_get_aio_context();
if (!ctx) {
- error_report("Failed to create AIO Context: '%s'",
- local_error ? error_get_pretty(local_error) :
- "Failed to initialize the QEMU main loop");
- if (local_error) {
- error_free(local_error);
+ if (!local_error) {
+ error_setg(&local_error, "Failed to initialize the QEMU main loop");
}
+ error_prefix(local_error, "Failed to create AIO Context: ");
+ error_report_err(local_error);
exit(1);
}
--
1.9.1
- [Qemu-devel] [RFC PATCH v1 12/25] arm: netduino: Update error API usages, (continued)
- [Qemu-devel] [RFC PATCH v1 12/25] arm: netduino: Update error API usages, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [RFC PATCH v1 11/25] arm: fsl-imx*: Update error API usages, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [RFC PATCH v1 13/25] arm: allwinner: Update error API usages, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [RFC PATCH v1 14/25] arm: digic: Update error API usages, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [RFC PATCH v1 15/25] cpu: arm: Remove un-needed error checking, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [RFC PATCH v1 16/25] ppc: Update error API usages, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [RFC PATCH v1 17/25] i386: pc: Update error API usages, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [RFC PATCH v1 18/25] monitor: update error API usages, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [RFC PATCH v1 19/25] qdev: Update error API usages, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [RFC PATCH v1 20/25] block: Update error API usages, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [RFC PATCH v1 21/25] tests: Update error API usages,
Peter Crosthwaite <=
- [Qemu-devel] [RFC PATCH v1 22/25] usb: bus: Update error API usages, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [RFC PATCH v1 23/25] scsi: Update error API usages, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [RFC PATCH v1 24/25] migration: savevm: Update error API usages, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [RFC PATCH v1 25/25] core: Update error API usages, Peter Crosthwaite, 2015/09/11
- Re: [Qemu-devel] [RFC PATCH v1 00/25] error: Automatic error concatenation and prefixing, Markus Armbruster, 2015/09/11
- Re: [Qemu-devel] [RFC PATCH v1 00/25] error: Automatic error concatenation and prefixing, Eric Blake, 2015/09/11