[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 05/22] arch_init: Be sure of only one exit entry with
From: |
Michael Tokarev |
Subject: |
[Qemu-devel] [PULL 05/22] arch_init: Be sure of only one exit entry with DPRINTF() for ram_load() |
Date: |
Mon, 5 May 2014 22:01:46 +0400 |
From: Chen Gang <address@hidden>
When DPRINTF() has effect, the original author wants to print all
ram_load() calling results. So need use 'goto' instead of 'return'
within ram_load(), just like other areas have done.
Signed-off-by: Chen Gang <address@hidden>
Signed-off-by: Michael Tokarev <address@hidden>
---
arch_init.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/arch_init.c b/arch_init.c
index 60c975d..333f698 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -998,7 +998,8 @@ static int ram_load(QEMUFile *f, void *opaque, int
version_id)
seq_iter++;
if (version_id < 4 || version_id > 4) {
- return -EINVAL;
+ ret = -EINVAL;
+ goto done;
}
do {
@@ -1055,7 +1056,8 @@ static int ram_load(QEMUFile *f, void *opaque, int
version_id)
host = host_from_stream_offset(f, addr, flags);
if (!host) {
- return -EINVAL;
+ ret = -EINVAL;
+ goto done;
}
ch = qemu_get_byte(f);
@@ -1065,14 +1067,16 @@ static int ram_load(QEMUFile *f, void *opaque, int
version_id)
host = host_from_stream_offset(f, addr, flags);
if (!host) {
- return -EINVAL;
+ ret = -EINVAL;
+ goto done;
}
qemu_get_buffer(f, host, TARGET_PAGE_SIZE);
} else if (flags & RAM_SAVE_FLAG_XBZRLE) {
void *host = host_from_stream_offset(f, addr, flags);
if (!host) {
- return -EINVAL;
+ ret = -EINVAL;
+ goto done;
}
if (load_xbzrle(f, addr, host) < 0) {
--
1.7.10.4
- [Qemu-devel] [PULL 00/22] Trivial patches for 2014-05-05, Michael Tokarev, 2014/05/05
- [Qemu-devel] [PULL 03/22] qga: Fix typo (plural) in comment, Michael Tokarev, 2014/05/05
- [Qemu-devel] [PULL 04/22] tests/tcg: Fix compilation of test_path, Michael Tokarev, 2014/05/05
- [Qemu-devel] [PULL 01/22] Makefiles: convert some obj-specific CFLAGS to use new foo.o-cflags syntax, Michael Tokarev, 2014/05/05
- [Qemu-devel] [PULL 02/22] configure: remove bashism, Michael Tokarev, 2014/05/05
- [Qemu-devel] [PULL 05/22] arch_init: Be sure of only one exit entry with DPRINTF() for ram_load(),
Michael Tokarev <=
- [Qemu-devel] [PULL 22/22] libcacard: remove unnecessary EOL from debug prints, Michael Tokarev, 2014/05/05
- [Qemu-devel] [PULL 11/22] qemu-timer: Add missing 'static' attribute, Michael Tokarev, 2014/05/05
- [Qemu-devel] [PULL 07/22] hw/mips: Add missing 'static' and 'const' attributes, Michael Tokarev, 2014/05/05
- [Qemu-devel] [PULL 06/22] hw/9pfs: Add missing 'static' attributes, Michael Tokarev, 2014/05/05
- [Qemu-devel] [PULL 18/22] qmp: report path ambiguity error, Michael Tokarev, 2014/05/05
- [Qemu-devel] [PULL 21/22] docs/memory.txt: Fix document on MMIO operations, Michael Tokarev, 2014/05/05
- [Qemu-devel] [PULL 14/22] hw/9pfs: Add include file for exported symbol, Michael Tokarev, 2014/05/05
- [Qemu-devel] [PULL 16/22] glib: move g_poll() replacement into glib-compat.h, Michael Tokarev, 2014/05/05
- [Qemu-devel] [PULL 10/22] ui: Add missing 'static' attribute, Michael Tokarev, 2014/05/05
- [Qemu-devel] [PULL 09/22] monitor: Add missing 'static' attribute, Michael Tokarev, 2014/05/05