qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Ross Lagerwall <ross.lagerwall@citrix.com>
Cc: Juan Quintela <quintela@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] migration/xen: Check return value of qemu_fclose
Date: Wed, 7 Feb 2018 16:27:25 +0000	[thread overview]
Message-ID: <20180207162724.GP2665@work-vm> (raw)
In-Reply-To: <20180206163039.23661-1-ross.lagerwall@citrix.com>

* Ross Lagerwall (ross.lagerwall@citrix.com) wrote:
> 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>

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 b7908f6..4b9d5be 100644
> --- a/migration/savevm.c
> +++ b/migration/savevm.c
> @@ -2267,8 +2267,7 @@ void qmp_xen_save_devices_state(const char *filename, bool has_live, bool live,
>      qio_channel_set_name(QIO_CHANNEL(ioc), "migration-xen-save-state");
>      f = qemu_fopen_channel_output(QIO_CHANNEL(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.9.5
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK

  reply	other threads:[~2018-02-07 16:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-06 16:30 [Qemu-devel] [PATCH] migration/xen: Check return value of qemu_fclose Ross Lagerwall
2018-02-07 16:27 ` Dr. David Alan Gilbert [this message]
2018-02-14 10:22 ` Dr. David Alan Gilbert

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=20180207162724.GP2665@work-vm \
    --to=dgilbert@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).