qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Cody <jcody@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: kwolf@redhat.com, qemu-block@nongnu.org,
	mitake.hitoshi@lab.ntt.co.jp, qemu-devel@nongnu.org,
	v.tolstov@selfip.ru, mreitz@redhat.com, namei.unix@gmail.com,
	pbonzini@redhat.com
Subject: Re: [Qemu-devel] [PATCH v3 1/1] block/sheepdog: fix argument passed to qemu_strtoul()
Date: Wed, 2 Mar 2016 11:36:38 -0500	[thread overview]
Message-ID: <20160302163638.GA8345@localhost.localdomain> (raw)
In-Reply-To: <56D71535.9040008@redhat.com>

On Wed, Mar 02, 2016 at 09:30:45AM -0700, Eric Blake wrote:
> On 03/02/2016 09:24 AM, Jeff Cody wrote:
> > The function qemu_strtoul() reads 'unsigned long' sized data,
> > which is larger than uint32_t on 64-bit machines.
> > 
> > Even though the snap_id field in the header is 32-bits, we must
> > accomodate the full size in qemu_strtoul().
> 
> s/accomodate/accommodate/

Thanks, I'll fix that up when applying this patch to my block branch.

> 
> Someday, it might be nice to write a qemu_strtoi() and qemu_strtoui()
> that provide a guaranteed 32-bit result, rather than a
> platform-dependent width (we already have qemu_strto[u]ll() for 64-bit
> results).  It's a bit tricky, since C doesn't provide a native parsing
> to int, and the case for overflow detection is different on 32-bit
> machines than on 64-bit machines (libvirt took a couple of tries before
> getting something that worked correctly), but would probably be worth it
> in the long run.
> 
> But that idea doesn't have to hold up this patch.
> 
> -- 
> Eric Blake   eblake redhat com    +1-919-301-3266
> Libvirt virtualization library http://libvirt.org
> 

  reply	other threads:[~2016-03-02 16:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-02 16:24 [Qemu-devel] [PATCH v3 1/1] block/sheepdog: fix argument passed to qemu_strtoul() Jeff Cody
2016-03-02 16:28 ` Max Reitz
2016-03-02 16:30 ` Eric Blake
2016-03-02 16:36   ` Jeff Cody [this message]
2016-03-02 16:32 ` Max Reitz
2016-03-02 16:36   ` Jeff Cody
2016-03-03  4:07     ` Hitoshi Mitake
2016-03-03  4:06 ` Hitoshi Mitake
2016-03-10  2:35 ` Jeff Cody

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=20160302163638.GA8345@localhost.localdomain \
    --to=jcody@redhat.com \
    --cc=eblake@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mitake.hitoshi@lab.ntt.co.jp \
    --cc=mreitz@redhat.com \
    --cc=namei.unix@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=v.tolstov@selfip.ru \
    /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).