From: Chen Gang <gang.chen.5i5j@gmail.com>
To: quintela@redhat.com, owasserm@redhat.com, pbonzini@redhat.com,
mst@redhat.com, Eric Blake <eblake@redhat.com>
Cc: QEMU Trivial <qemu-trivial@nongnu.org>,
QEMU Developers <qemu-devel@nongnu.org>
Subject: [Qemu-trivial] [PATCH] arch_init: Be sure of only one exit entry with DPRINTF() for ram_load()
Date: Thu, 01 May 2014 21:28:11 +0800 [thread overview]
Message-ID: <53624BEB.7030605@gmail.com> (raw)
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 <gang.chen.5i5j@gmail.com>
---
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.11.7
WARNING: multiple messages have this Message-ID (diff)
From: Chen Gang <gang.chen.5i5j@gmail.com>
To: quintela@redhat.com, owasserm@redhat.com, pbonzini@redhat.com,
mst@redhat.com, Eric Blake <eblake@redhat.com>
Cc: QEMU Trivial <qemu-trivial@nongnu.org>,
QEMU Developers <qemu-devel@nongnu.org>
Subject: [Qemu-devel] [PATCH] arch_init: Be sure of only one exit entry with DPRINTF() for ram_load()
Date: Thu, 01 May 2014 21:28:11 +0800 [thread overview]
Message-ID: <53624BEB.7030605@gmail.com> (raw)
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 <gang.chen.5i5j@gmail.com>
---
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.11.7
next reply other threads:[~2014-05-01 13:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-01 13:28 Chen Gang [this message]
2014-05-01 13:28 ` [Qemu-devel] [PATCH] arch_init: Be sure of only one exit entry with DPRINTF() for ram_load() Chen Gang
2014-05-03 8:41 ` [Qemu-trivial] " Michael Tokarev
2014-05-03 8:41 ` [Qemu-devel] " Michael Tokarev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53624BEB.7030605@gmail.com \
--to=gang.chen.5i5j@gmail.com \
--cc=eblake@redhat.com \
--cc=mst@redhat.com \
--cc=owasserm@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=quintela@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.