Re: [Qemu-devel] [PATCH 1/1] block migration: fix return value mismatch

2014-11-24 Thread Dr. David Alan Gilbert
* Gary R Hook (grhookatw...@gmail.com) wrote: Stefan Hajnoczi address@hidden writes: On Wed, Nov 12, 2014 at 06:48:18PM +, Gary Hook wrote: -return qemu_ftell(f) - last_ftell; +delta_ftell = qemu_ftell(f) - last_ftell; +return( (delta_ftell 0) ? 1 : (delta_ftell 0) ?

Re: [Qemu-devel] [PATCH 1/1] block migration: fix return value mismatch

2014-11-21 Thread Gary R Hook
Stefan Hajnoczi address@hidden writes: On Wed, Nov 12, 2014 at 06:48:18PM +, Gary Hook wrote: -return qemu_ftell(f) - last_ftell; +delta_ftell = qemu_ftell(f) - last_ftell; +return( (delta_ftell 0) ? 1 : (delta_ftell 0) ? -1 : 0 ); Good find! Please don't nest the

Re: [Qemu-devel] [PATCH 1/1] block migration: fix return value mismatch

2014-11-13 Thread Stefan Hajnoczi
On Wed, Nov 12, 2014 at 06:48:18PM +, Gary Hook wrote: -return qemu_ftell(f) - last_ftell; +delta_ftell = qemu_ftell(f) - last_ftell; +return( (delta_ftell 0) ? 1 : (delta_ftell 0) ? -1 : 0 ); Good find! Please don't nest the ternary operator, it is hard to read. if

Re: [Qemu-devel] [PATCH 1/1] block migration: fix return value mismatch

2014-11-13 Thread Markus Armbruster
Stefan Hajnoczi stefa...@gmail.com writes: On Wed, Nov 12, 2014 at 06:48:18PM +, Gary Hook wrote: -return qemu_ftell(f) - last_ftell; +delta_ftell = qemu_ftell(f) - last_ftell; +return( (delta_ftell 0) ? 1 : (delta_ftell 0) ? -1 : 0 ); Good find! Please don't nest the

Re: [Qemu-devel] [PATCH 1/1] block migration: fix return value mismatch

2014-11-13 Thread Gary Hook
On 11/13/14, 5:20 AM, Stefan Hajnoczi stefa...@gmail.commailto:stefa...@gmail.com wrote: On Wed, Nov 12, 2014 at 06:48:18PM +, Gary Hook wrote: -return qemu_ftell(f) - last_ftell; +delta_ftell = qemu_ftell(f) - last_ftell; +return( (delta_ftell 0) ? 1 : (delta_ftell 0) ? -1 : 0

Re: [Qemu-devel] [PATCH 1/1] block migration: fix return value mismatch

2014-11-13 Thread Gary Hook
On 11/13/14, 6:46 AM, Markus Armbruster arm...@redhat.commailto:arm...@redhat.com wrote: Stefan Hajnoczi stefa...@gmail.commailto:stefa...@gmail.com writes: On Wed, Nov 12, 2014 at 06:48:18PM +, Gary Hook wrote: -return qemu_ftell(f) - last_ftell; +delta_ftell = qemu_ftell(f) -

Re: [Qemu-devel] [PATCH 1/1] block migration: fix return value mismatch

2014-11-13 Thread Eric Blake
On 11/13/2014 09:44 AM, Gary Hook wrote: [metacomment] On 11/13/14, 6:46 AM, Markus Armbruster arm...@redhat.commailto:arm...@redhat.com wrote: Stefan Hajnoczi stefa...@gmail.commailto:stefa...@gmail.com writes: On Wed, Nov 12, 2014 at 06:48:18PM +, Gary Hook wrote: Your quoting

Re: [Qemu-devel] [PATCH 1/1] block migration: fix return value mismatch

2014-11-13 Thread Gary Hook
On 11/13/14, 11:03 AM, Eric Blake ebl...@redhat.com wrote: On 11/13/2014 09:44 AM, Gary Hook wrote: [metacomment] On 11/13/14, 6:46 AM, Markus Armbruster arm...@redhat.commailto:arm...@redhat.com wrote: Stefan Hajnoczi stefa...@gmail.commailto:stefa...@gmail.com writes: On Wed, Nov 12,

Re: [Qemu-devel] [PATCH 1/1] block migration: fix return value mismatch

2014-11-13 Thread Stefan Hajnoczi
On Thu, Nov 13, 2014 at 5:32 PM, Gary Hook gary.h...@nimboxx.com wrote: On 11/13/14, 11:03 AM, Eric Blake ebl...@redhat.com wrote: On 11/13/2014 09:44 AM, Gary Hook wrote: [metacomment] On 11/13/14, 6:46 AM, Markus Armbruster arm...@redhat.commailto:arm...@redhat.com wrote: Stefan Hajnoczi

Re: [Qemu-devel] [PATCH 1/1] block migration: fix return value mismatch

2014-11-13 Thread Gary R Hook
Stefan Hajnoczi mailto:stefa...@gmail.com November 13, 2014 at 12:55 PM One more thing about email configuration: the character set encoding of your emails seems to be incorrect. GMail is rendering a superscript 1 (like to the power of one) when you wanted a single quote:

[Qemu-devel] [PATCH 1/1] block migration: fix return value mismatch

2014-11-12 Thread Gary Hook
The function uses a ternary return value (, , == 0) defined as an int. The code in in this function uses int64_t types to collect ftell() return values and use their difference as the return value. Unfortunately, narrowing of integer types results in the disposal of the left-most bits that

Re: [Qemu-devel] [PATCH 1/1] block migration: fix return value mismatch

2014-11-12 Thread Eric Blake
On 11/12/2014 11:48 AM, Gary Hook wrote: The function uses a ternary return value (, , == 0) defined as an int. The code in in this function uses int64_t types to collect ftell() return values and use their difference as the return value. Unfortunately, narrowing of integer types results in

Re: [Qemu-devel] [PATCH 1/1] block migration: fix return value mismatch

2014-11-12 Thread Markus Armbruster
Eric Blake ebl...@redhat.com writes: On 11/12/2014 11:48 AM, Gary Hook wrote: The function uses a ternary return value (, , == 0) defined as an int. The code in in this function uses int64_t types to collect ftell() return values and use their difference as the return value. Unfortunately,