qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Carlos L. Torres" <cltorrespr@gmail.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org, stefanha@redhat.com
Subject: Re: [Qemu-devel] [PATCH v2 5/5] qmp: Add example usage of strto*l() qemu wrapper
Date: Sun, 19 Jul 2015 13:27:26 -0500	[thread overview]
Message-ID: <20150719182726.GA12754@carl6796-MacBookPro> (raw)
In-Reply-To: <55ABE384.2040905@redhat.com>

On Sun, Jul 19, 2015 at 07:51:00PM +0200, Paolo Bonzini wrote:
> 
> 
> On 19/07/2015 01:52, Carlos L. Torres wrote:
> > +    int err;
> >  
> >      info->qemu = g_new0(VersionTriple, 1);
> > -    info->qemu->major = strtol(version, &tmp, 10);
> > +    err = qemu_strtol(version, &tmp, 10, &(info->qemu->major));
> 
> There are usually no parentheses around the argument of the & operator.
> 
> > +    if (err) {
> > +        error_setg(errp, "There was a problem retrieving QEMU major version.");
> > +    }
> 
> I think it's okay to just assert that err is zero.  Otherwise, this
> simple example is okay.  Thanks!
> 
> Paolo
> 
> >      tmp++;
> > -    info->qemu->minor = strtol(tmp, &tmp, 10);
> > +
> > +    err = qemu_strtol(tmp, &tmp, 10, &(info->qemu->minor));
> > +    if (err) {
> > +        error_setg(errp, "There was a problem retrieving QEMU minor version.");
> > +    }
> >      tmp++;
> > -    info->qemu->micro = strtol(tmp, &tmp, 10);
> > +
> > +    err = qemu_strtol(tmp, &tmp, 10, &(info->qemu->micro));
> > +    if (err) {
> > +        error_setg(errp, "There was a problem retrieving QEMU micro version.");
> > +    }

Hi Paolo,

Thanks for taking the time to review the patch.
I'll make those small changes, and post v3 version of the patch.

Thanks,
-- Carlos Torres

      reply	other threads:[~2015-07-19 18:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-18 23:52 [Qemu-devel] [PATCH v2 0/5] cutils: Add qemu_strto*() wrappers Carlos L. Torres
2015-07-18 23:52 ` [Qemu-devel] [PATCH v2 1/5] cutils: Add qemu_strtol() wrapper Carlos L. Torres
2015-07-18 23:52 ` [Qemu-devel] [PATCH v2 2/5] cutils: Add qemu_strtoul() wrapper Carlos L. Torres
2015-07-18 23:52 ` [Qemu-devel] [PATCH v2 3/5] cutils: Add qemu_strtoll() wrapper Carlos L. Torres
2015-07-18 23:52 ` [Qemu-devel] [PATCH v2 4/5] cutils: Add qemu_strtoull() wrapper Carlos L. Torres
2015-07-18 23:52 ` [Qemu-devel] [PATCH v2 5/5] qmp: Add example usage of strto*l() qemu wrapper Carlos L. Torres
2015-07-19 17:51   ` Paolo Bonzini
2015-07-19 18:27     ` Carlos L. Torres [this message]

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=20150719182726.GA12754@carl6796-MacBookPro \
    --to=cltorrespr@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@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).