Skip to contentSkip to conversation

block migration: fix return value mismatch

PATCH Gary R Hook 2 participants 2 messages Nov 21, 2014 – Nov 24, 2014

lore
Share & tools
lore
#0 lore raw
Quoted 9 lines · Stefan Hajnoczi

Review

Quoted 3 lines · Gary Hook
(quoted diff) +2 -1
-    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.

Quoted 7 lines
if (delta_ftell < 0) {
    return -1;
} else if (delta_ftell > 0) {
    return 1;
} else {
    return 0;
}

So now that it's clear that I fully botched the patch submission, I would like to follow up: shall I resubmit this change?

I don't see this fix in the current source (which makes sense due to the 2.2 RC2 work) but folks are asking. And it appears that there's a bug report over at RedHat that may be the same problem.

I think I'll add to my .sig: "Look, ma, only 72 columns!"

Signature · 3 lines
Gary R Hook
Senior Kernel Engineer
NIMBOXX, Inc
#1 lore raw
Quoted 19 lines · * Gary R Hook ([email protected]) wrote:
Quoted 9 lines · Stefan Hajnoczi

Review

Quoted 3 lines · Gary Hook
(quoted diff) +2 -1
-    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.

Quoted 7 lines
if (delta_ftell < 0) {
    return -1;
} else if (delta_ftell > 0) {
    return 1;
} else {
    return 0;
}
Quoted 8 lines

So now that it's clear that I fully botched the patch submission, I would like to follow up: shall I resubmit this change?

I don't see this fix in the current source (which makes sense due to the 2.2 RC2 work) but folks are asking. And it appears that there's a bug report over at RedHat that may be the same problem.

I think I'll add to my .sig: "Look, ma, only 72 columns!"

Please resubmit it, especially with the correct Signed-off-by

Dave

Quoted 6 lines
Signature · 4 lines
-- 
Gary R Hook
Senior Kernel Engineer
NIMBOXX, Inc

--
Dr. David Alan Gilbert / [email protected] / Manchester, UK