qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: "Richard W.M. Jones" <rjones@redhat.com>
Cc: eblake@redhat.com, kwolf@redhat.com, qemu-devel@nongnu.org,
	qemu-block@nongnu.org, mreitz@redhat.com
Subject: Re: [Qemu-devel] [PATCH v3] qemu-io: Add generic function for reinitializing optind.
Date: Wed, 9 Jan 2019 14:19:52 +0000	[thread overview]
Message-ID: <20190109141952.GQ3998@redhat.com> (raw)
In-Reply-To: <20190109141446.GY27120@redhat.com>

On Wed, Jan 09, 2019 at 02:14:46PM +0000, Richard W.M. Jones wrote:
> On Wed, Jan 09, 2019 at 01:44:48PM +0000, Daniel P. Berrangé wrote:
> > On Wed, Jan 09, 2019 at 01:23:01PM +0000, Richard W.M. Jones wrote:
> > > How about this one?  Add a generic osdep function for reinitializing
> > > optind, which does optreset on FreeBSD (but is identical on all other
> > > OSes).  Use it from qemu-io and qemu-img.
> > > 
> > > I have tested this on Linux, FreeBSD and OpenBSD.
> > > 
> > > checkpatch complains:
> > > 
> > > WARNING: Block comments use a leading /* on a separate line
> > > #69: FILE: include/qemu/osdep.h:591:
> > > +/**
> > 
> > I think it just doesn't like your '/**' and wants '/*' instead.
> 
> The existing comments in the same file are a mix of three styles.
> I chose the style used closest to the new comment I was adding :-)

Yeah, pre-existing code is a mess often not passing current style
rules. I wish we'd clean up existing code, but failing that, it can
be valid to ignore style warnings to be more consistent with existing
code.

> 
> > > WARNING: architecture specific defines should be avoided
> > > #78: FILE: include/qemu/osdep.h:600:
> > > +#ifdef __FreeBSD__
> > 
> > Normally we'd suggest doing a configure test to for the platform
> > feature and then using a feature based ifdef test. In this case
> > though that would be difficult and/or overly complex.
> > 
> > This does make me wonder about the other *BSDs, OS-X and Mingw
> 
> OpenBSD is known fine with optind = 0.  I can't test OS-X.  I can test
> mingw (on Linux) later.
> 
> 
> > though ?  Should they all be using the #else codepath, or should
> > the other BSDs / OS-X use the __FreeBSD__ codepath.

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

  reply	other threads:[~2019-01-09 14:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-09 13:23 [Qemu-devel] [PATCH v3] qemu-io: Add generic function for reinitializing optind Richard W.M. Jones
2019-01-09 13:23 ` Richard W.M. Jones
2019-01-09 13:44 ` Daniel P. Berrangé
2019-01-09 14:14   ` Richard W.M. Jones
2019-01-09 14:19     ` Daniel P. Berrangé [this message]
2019-01-09 14:53   ` Eric Blake

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=20190109141952.GQ3998@redhat.com \
    --to=berrange@redhat.com \
    --cc=eblake@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rjones@redhat.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).