From: "Dr. David Alan Gilbert (git)" <dgilbert@redhat.com>
To: qemu-devel@nongnu.org, quintela@redhat.com, peterx@redhat.com,
groug@kaod.org, ross.lagerwall@citrix.com
Subject: [Qemu-devel] [PULL 01/10] migration/xen: Check return value of qemu_fclose
Date: Wed, 14 Feb 2018 15:39:29 +0000 [thread overview]
Message-ID: <20180214153938.5410-2-dgilbert@redhat.com> (raw)
In-Reply-To: <20180214153938.5410-1-dgilbert@redhat.com>
From: Ross Lagerwall <ross.lagerwall@citrix.com>
QEMUFile uses buffered IO so when writing small amounts (such as the Xen
device state file), the actual write call and any errors that may occur
only happen as part of qemu_fclose(). Therefore, report IO errors when
saving the device state under Xen by checking the return value of
qemu_fclose().
Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
Message-Id: <20180206163039.23661-1-ross.lagerwall@citrix.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
migration/savevm.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/migration/savevm.c b/migration/savevm.c
index 3f611c02e8..68b652ff76 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -2284,8 +2284,7 @@ void qmp_xen_save_devices_state(const char *filename, bool has_live, bool live,
f = qemu_fopen_channel_output(QIO_CHANNEL(ioc));
object_unref(OBJECT(ioc));
ret = qemu_save_device_state(f);
- qemu_fclose(f);
- if (ret < 0) {
+ if (ret < 0 || qemu_fclose(f) < 0) {
error_setg(errp, QERR_IO_ERROR);
} else {
/* libxl calls the QMP command "stop" before calling
--
2.14.3
next prev parent reply other threads:[~2018-02-14 15:39 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-14 15:39 [Qemu-devel] [PULL 00/10] migration queue Dr. David Alan Gilbert (git)
2018-02-14 15:39 ` Dr. David Alan Gilbert (git) [this message]
2018-02-14 15:39 ` [Qemu-devel] [PULL 02/10] migration: improve documentation of postcopy-ram Dr. David Alan Gilbert (git)
2018-02-14 15:39 ` [Qemu-devel] [PULL 03/10] tests/migration: Add source to PC boot block Dr. David Alan Gilbert (git)
2018-02-14 15:39 ` [Qemu-devel] [PULL 04/10] migration: Fix early failure cleanup Dr. David Alan Gilbert (git)
2018-02-14 15:39 ` [Qemu-devel] [PULL 05/10] tests/migration: Add test for migration to bad destination Dr. David Alan Gilbert (git)
2018-02-14 15:39 ` [Qemu-devel] [PULL 06/10] migration: better error handling with QEMUFile Dr. David Alan Gilbert (git)
2018-02-14 15:39 ` [Qemu-devel] [PULL 07/10] migration: reuse mis->userfault_quit_fd Dr. David Alan Gilbert (git)
2018-02-14 15:39 ` [Qemu-devel] [PULL 08/10] migration: provide postcopy_fault_thread_notify() Dr. David Alan Gilbert (git)
2018-02-14 15:39 ` [Qemu-devel] [PULL 09/10] migration: allow send_rq to fail Dr. David Alan Gilbert (git)
2018-02-14 15:39 ` [Qemu-devel] [PULL 10/10] migration: pass MigrationState to migrate_init() Dr. David Alan Gilbert (git)
2018-02-15 15:45 ` [Qemu-devel] [PULL 00/10] migration queue Peter Maydell
2018-02-15 20:19 ` Dr. David Alan Gilbert
2018-02-16 6:14 ` Thomas Huth
2018-02-16 14:25 ` Peter Maydell
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=20180214153938.5410-2-dgilbert@redhat.com \
--to=dgilbert@redhat.com \
--cc=groug@kaod.org \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=ross.lagerwall@citrix.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).