From: Stefan Hajnoczi <stefanha@gmail.com>
To: Prerna Saxena <saxenap.ltc@gmail.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 2/2] Debug : Add error messages before a call to debug().
Date: Wed, 27 Apr 2016 16:38:53 +0100	[thread overview]
Message-ID: <20160427153853.GA2873@stefanha-x1.localdomain> (raw)
In-Reply-To: <1460689374-9690-3-git-send-email-saxenap.ltc@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1784 bytes --]
On Fri, Apr 15, 2016 at 08:32:54AM +0530, Prerna Saxena wrote:
> diff --git a/block/block-backend.c b/block/block-backend.c
> index d74f670..0aa8692 100644
> --- a/block/block-backend.c
> +++ b/block/block-backend.c
> @@ -407,6 +407,7 @@ BlockBackend *blk_by_legacy_dinfo(DriveInfo *dinfo)
>              return blk;
>          }
>      }
> +    error_report("Drive Info not found, Aborting.");
error_report() documentation says:
 * Format arguments like sprintf().  The resulting message should be a
 * single phrase, with no newline or trailing punctuation.
>      abort();
>  }
>  
> @@ -463,6 +464,8 @@ int blk_attach_dev(BlockBackend *blk, void *dev)
>  void blk_attach_dev_nofail(BlockBackend *blk, void *dev)
>  {
>      if (blk_attach_dev(blk, dev) < 0) {
> +        error_report("Attaching device model to block %s failed. Aborting",
Please use '%s' instead of just %s for consistency with other error
messages.
> +            blk->name);
>          abort();
>      }
>  }
> @@ -1143,6 +1146,7 @@ BlockErrorAction blk_get_error_action(BlockBackend *blk, bool is_read,
>      case BLOCKDEV_ON_ERROR_IGNORE:
>          return BLOCK_ERROR_ACTION_IGNORE;
>      default:
> +        error_report("Unrecognized Block Error Action %d. Aborting.",on_err);
s/,/, /
Please use scripts/checkpatch.pl to check for coding style violations.
> diff --git a/exec.c b/exec.c
> index c4f9036..1b1d713 100644
> --- a/exec.c
> +++ b/exec.c
> @@ -2218,6 +2218,7 @@ static MemTxResult subpage_read(void *opaque, hwaddr addr, uint64_t *data,
>          *data = ldq_p(buf);
>          return MEMTX_OK;
>      default:
> +        printf("Unsupported read size %d, Aborting", len);
Why use printf() instead of error_report() in this file?
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
next prev parent reply	other threads:[~2016-04-27 15:39 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-15  3:02 [Qemu-devel] [PATCH 0/2] Cleanup and instrumenting qemu exits due to abort() Prerna Saxena
2016-04-15  3:02 ` [Qemu-devel] [PATCH 1/2] Block: Cleanup vvfat.c to remove dead code Prerna Saxena
2016-04-27 15:20   ` Stefan Hajnoczi
2016-04-27 16:07   ` Alex Bennée
2016-04-15  3:02 ` [Qemu-devel] [PATCH 2/2] Debug : Add error messages before a call to debug() Prerna Saxena
2016-04-27 15:38   ` Stefan Hajnoczi [this message]
2016-04-27 16:00   ` Eric Blake
2016-04-28  4:57     ` Prerna
2016-04-28  8:34     ` Markus Armbruster
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=20160427153853.GA2873@stefanha-x1.localdomain \
    --to=stefanha@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=saxenap.ltc@gmail.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).