qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Kevin Wolf" <kwolf@redhat.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	qemu-block@nongnu.org, "Juan Quintela" <quintela@redhat.com>,
	"Connor Kuehl" <ckuehl@redhat.com>,
	"Michael Roth" <michael.roth@amd.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Max Reitz" <mreitz@redhat.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>
Subject: [PULL 09/13] block: add trace point when fdatasync fails
Date: Mon, 14 Jun 2021 15:15:45 +0100	[thread overview]
Message-ID: <20210614141549.100410-10-berrange@redhat.com> (raw)
In-Reply-To: <20210614141549.100410-1-berrange@redhat.com>

A flush failure is a critical failure scenario for some operations.
For example, it will prevent migration from completing, as it will
make vm_stop() report an error. Thus it is important to have a
trace point present for debugging.

Reviewed-by: Connor Kuehl <ckuehl@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 block/file-posix.c | 2 ++
 block/trace-events | 1 +
 2 files changed, 3 insertions(+)

diff --git a/block/file-posix.c b/block/file-posix.c
index 5ff78ecb34..4189b2bfa6 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -1338,6 +1338,8 @@ static int handle_aiocb_flush(void *opaque)
 
     ret = qemu_fdatasync(aiocb->aio_fildes);
     if (ret == -1) {
+        trace_file_flush_fdatasync_failed(errno);
+
         /* There is no clear definition of the semantics of a failing fsync(),
          * so we may have to assume the worst. The sad truth is that this
          * assumption is correct for Linux. Some pages are now probably marked
diff --git a/block/trace-events b/block/trace-events
index 574760ba9a..b3d2b1e62c 100644
--- a/block/trace-events
+++ b/block/trace-events
@@ -206,6 +206,7 @@ file_copy_file_range(void *bs, int src, int64_t src_off, int dst, int64_t dst_of
 file_FindEjectableOpticalMedia(const char *media) "Matching using %s"
 file_setup_cdrom(const char *partition) "Using %s as optical disc"
 file_hdev_is_sg(int type, int version) "SG device found: type=%d, version=%d"
+file_flush_fdatasync_failed(int err) "errno %d"
 
 # ssh.c
 sftp_error(const char *op, const char *ssh_err, int ssh_err_code, int sftp_err_code) "%s failed: %s (libssh error code: %d, sftp error code: %d)"
-- 
2.31.1



  parent reply	other threads:[~2021-06-14 14:20 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-14 14:15 [PULL 00/13] Misc fixes patches Daniel P. Berrangé
2021-06-14 14:15 ` [PULL 01/13] docs: add table of contents to QAPI references Daniel P. Berrangé
2021-06-14 14:15 ` [PULL 02/13] docs: document how to pass secret data to QEMU Daniel P. Berrangé
2021-06-14 14:15 ` [PULL 03/13] docs: document usage of the authorization framework Daniel P. Berrangé
2021-06-14 14:15 ` [PULL 04/13] docs: recommend SCRAM-SHA-256 SASL mech instead of SHA-1 variant Daniel P. Berrangé
2021-06-14 14:15 ` [PULL 05/13] sasl: remove comment about obsolete kerberos versions Daniel P. Berrangé
2021-06-14 14:15 ` [PULL 06/13] migration: add trace point when vm_stop_force_state fails Daniel P. Berrangé
2021-06-14 14:15 ` [PULL 07/13] softmmu: add trace point when bdrv_flush_all fails Daniel P. Berrangé
2021-06-14 14:15 ` [PULL 08/13] block: preserve errno from fdatasync failures Daniel P. Berrangé
2021-06-14 14:15 ` Daniel P. Berrangé [this message]
2021-06-14 14:15 ` [PULL 10/13] block: remove duplicate trace.h include Daniel P. Berrangé
2021-06-14 14:15 ` [PULL 11/13] migration: use GDateTime for formatting timestamp in snapshot names Daniel P. Berrangé
2021-06-14 14:15 ` [PULL 12/13] block: use GDateTime for formatting timestamp when dumping snapshot info Daniel P. Berrangé
2021-06-14 14:15 ` [PULL 13/13] usb/dev-mtp: use GDateTime for formatting timestamp for objects Daniel P. Berrangé
2021-06-14 19:07 ` [PULL 00/13] Misc fixes patches 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=20210614141549.100410-10-berrange@redhat.com \
    --to=berrange@redhat.com \
    --cc=armbru@redhat.com \
    --cc=ckuehl@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=michael.roth@amd.com \
    --cc=mreitz@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=richard.henderson@linaro.org \
    /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).