All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fam Zheng <famz@redhat.com>
To: "Wei, Jiangang" <weijg.fnst@cn.fujitsu.com>
Cc: "kwolf@redhat.com" <kwolf@redhat.com>,
	"qemu-trivial@nongnu.org" <qemu-trivial@nongnu.org>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"qemu-block@nongnu.org" <qemu-block@nongnu.org>,
	"mreitz@redhat.com" <mreitz@redhat.com>
Subject: Re: [Qemu-trivial] [Qemu-devel] [PATCH] block/raw-posix: Fix error_report of mounting message
Date: Thu, 2 Jun 2016 11:15:59 +0800	[thread overview]
Message-ID: <20160602031559.GG19448@ad.usersys.redhat.com> (raw)
In-Reply-To: <1464836600.5185.7.camel@localhost>

On Thu, 06/02 03:04, Wei, Jiangang wrote:
> On Wed, 2016-06-01 at 15:23 +0800, Fam Zheng wrote:
> > On Wed, 06/01 15:08, Wei Jiangang wrote:
> > > Use a single error_printf to replace triple error_report.
> > > 
> > > Signed-off-by: Wei Jiangang <weijg.fnst@cn.fujitsu.com>
> > > ---
> > >  block/raw-posix.c | 10 +++++-----
> > >  1 file changed, 5 insertions(+), 5 deletions(-)
> > > 
> > > diff --git a/block/raw-posix.c b/block/raw-posix.c
> > > index a4f5a1b..141b01a 100644
> > > --- a/block/raw-posix.c
> > > +++ b/block/raw-posix.c
> > > @@ -2061,11 +2061,11 @@ static bool setup_cdrom(char *bsd_path, Error **errp)
> > >  /* Prints directions on mounting and unmounting a device */
> > >  static void print_unmounting_directions(const char *file_name)
> > >  {
> > > -    error_report("If device %s is mounted on the desktop, unmount"
> > > -                 " it first before using it in QEMU", file_name);
> > > -    error_report("Command to unmount device: diskutil unmountDisk %s",
> > > -                 file_name);
> > > -    error_report("Command to mount device: diskutil mountDisk %s", file_name);
> > > +    error_printf("If device %s is mounted on the desktop, unmount"
> > > +        " it first before using it in QEMU\n"
> > > +        "Command to unmount device: diskutil unmountDisk %s\n"
> > > +        "Command to mount device: diskutil mountDisk %s\n",
> > > +        file_name, file_name, file_name);
> > 
> > I'd say it's less readable with a worse alignment to the parameters.
> Hi, Fam
> 
> Thanks for your comment.
> You mean every error_report() followed by file_name is more readable ?
> or my codes dosen't follow a good alignment format?
> 

I'm happy with either way. :)

Fam


WARNING: multiple messages have this Message-ID (diff)
From: Fam Zheng <famz@redhat.com>
To: "Wei, Jiangang" <weijg.fnst@cn.fujitsu.com>
Cc: "kwolf@redhat.com" <kwolf@redhat.com>,
	"qemu-trivial@nongnu.org" <qemu-trivial@nongnu.org>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"qemu-block@nongnu.org" <qemu-block@nongnu.org>,
	"mreitz@redhat.com" <mreitz@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] block/raw-posix: Fix error_report of mounting message
Date: Thu, 2 Jun 2016 11:15:59 +0800	[thread overview]
Message-ID: <20160602031559.GG19448@ad.usersys.redhat.com> (raw)
In-Reply-To: <1464836600.5185.7.camel@localhost>

On Thu, 06/02 03:04, Wei, Jiangang wrote:
> On Wed, 2016-06-01 at 15:23 +0800, Fam Zheng wrote:
> > On Wed, 06/01 15:08, Wei Jiangang wrote:
> > > Use a single error_printf to replace triple error_report.
> > > 
> > > Signed-off-by: Wei Jiangang <weijg.fnst@cn.fujitsu.com>
> > > ---
> > >  block/raw-posix.c | 10 +++++-----
> > >  1 file changed, 5 insertions(+), 5 deletions(-)
> > > 
> > > diff --git a/block/raw-posix.c b/block/raw-posix.c
> > > index a4f5a1b..141b01a 100644
> > > --- a/block/raw-posix.c
> > > +++ b/block/raw-posix.c
> > > @@ -2061,11 +2061,11 @@ static bool setup_cdrom(char *bsd_path, Error **errp)
> > >  /* Prints directions on mounting and unmounting a device */
> > >  static void print_unmounting_directions(const char *file_name)
> > >  {
> > > -    error_report("If device %s is mounted on the desktop, unmount"
> > > -                 " it first before using it in QEMU", file_name);
> > > -    error_report("Command to unmount device: diskutil unmountDisk %s",
> > > -                 file_name);
> > > -    error_report("Command to mount device: diskutil mountDisk %s", file_name);
> > > +    error_printf("If device %s is mounted on the desktop, unmount"
> > > +        " it first before using it in QEMU\n"
> > > +        "Command to unmount device: diskutil unmountDisk %s\n"
> > > +        "Command to mount device: diskutil mountDisk %s\n",
> > > +        file_name, file_name, file_name);
> > 
> > I'd say it's less readable with a worse alignment to the parameters.
> Hi, Fam
> 
> Thanks for your comment.
> You mean every error_report() followed by file_name is more readable ?
> or my codes dosen't follow a good alignment format?
> 

I'm happy with either way. :)

Fam

  reply	other threads:[~2016-06-02  3:16 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-01  7:08 [Qemu-trivial] [Qemu-devel][PATCH] block/raw-posix: Fix error_report of mounting message Wei Jiangang
2016-06-01  7:08 ` [Qemu-devel] [PATCH] " Wei Jiangang
2016-06-01  7:23 ` [Qemu-trivial] " Fam Zheng
2016-06-01  7:23   ` Fam Zheng
2016-06-02  3:04   ` [Qemu-trivial] " Wei, Jiangang
2016-06-02  3:04     ` Wei, Jiangang
2016-06-02  3:15     ` Fam Zheng [this message]
2016-06-02  3:15       ` Fam Zheng
2016-06-02  7:57 ` [Qemu-trivial] " Markus Armbruster
2016-06-02  7:57   ` Markus Armbruster
2016-06-02 10:46   ` [Qemu-trivial] " Wei, Jiangang
2016-06-02 10:46     ` Wei, Jiangang
2016-06-03  9:00     ` Fam Zheng
2016-06-03  9:56       ` Wei, Jiangang

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=20160602031559.GG19448@ad.usersys.redhat.com \
    --to=famz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=weijg.fnst@cn.fujitsu.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.