migration/block-dirty-bitmap: fix uninitialized variable warning
PATCH v3 1/1 migration/block-dirty-bitmap: fix uninitialized variable warning
A default value is provided for the variable 'bitmap_name' to avoid compiler warning.
The compiler show warning:migration/block-dirty-bitmap.c:1090:13: warning: ‘bitmap_name’ may be used uninitialized in this function [-Wmaybe-uninitialized]
g_strlcpy(s->bitmap_name, bitmap_name, sizeof(s->bitmap_name));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~---v2->v3: Placing the declaration at the beginning of the block(Base on Max's suggestion).
--- migration/block-dirty-bitmap.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-)
migration/block-dirty-bitmap.c +9 -12
@@ -1071,18 +1071,15 @@ static int dirty_bitmap_load_header(QEMUFile *f, DBMLoadState *s,return -EINVAL ; } -if (!s->cancelled) { -if (bitmap_alias_map) { - bitmap_name =g_hash_table_lookup (bitmap_alias_map, - s->bitmap_alias); -if (!bitmap_name) { -error_report ("Error: Unknown bitmap alias '%s' on node " -"'%s' (alias '%s')" , s->bitmap_alias, - s->bs->node_name, s->node_alias); -cancel_incoming_locked (s); - } - }else { - bitmap_name = s->bitmap_alias; + bitmap_name = s->bitmap_alias; +if (!s->cancelled && bitmap_alias_map) { + bitmap_name =g_hash_table_lookup (bitmap_alias_map, + s->bitmap_alias); +if (!bitmap_name) { +error_report ("Error: Unknown bitmap alias '%s' on node " +"'%s' (alias '%s')" , s->bitmap_alias, + s->bs->node_name, s->node_alias); +cancel_incoming_locked (s); } }
Signature · 1 line
2.23.0
Quoted 10 lines · Chen Qun
A default value is provided for the variable '
bitmap_name' to avoid compiler warning.The compiler show warning:
migration/block-dirty-bitmap.c:1090:13: warning: ‘bitmap_name’ may be used uninitialized in this function [-Wmaybe-uninitialized]g_strlcpy(s->bitmap_name, bitmap_name, sizeof(s->bitmap_name)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Reported-by Euler Robot<[email protected]>Signed-off-by Chen Qun<[email protected]>
Signature · 2 lines
Best regards, Vladimir
Ping!
Hello,
Maybe this patch, some people have any other suggestions? Or, maybe missed to queue?
Thanks,
Chen Qun
Quoted 34 lines
-----Original Message-----
From: Vladimir Sementsov-Ogievskiy [mailto:[email protected]]
Sent: Wednesday, October 14, 2020 11:56 PM
To: Chenqun (kuhn) <[email protected]>; [email protected]; [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Zhanghailiang <[email protected]>; ganqixin <[email protected]>; [email protected]; Euler Robot <[email protected]>; Laurent Vivier <[email protected]>; Li Qiang <[email protected]>
Subject: Re: [PATCH v3] migration/block-dirty-bitmap: fix uninitialized variable warningQuoted 1 line · Chen Qun
A default value is provided for the variable '
bitmap_name' to avoid compilerwarning.
Quoted 5 lines
The compiler show warning:
migration/block-dirty-bitmap.c:1090:13: warning: ‘bitmap_name’ may be used uninitialized in this function [-Wmaybe-uninitialized]g_strlcpy(s->bitmap_name, bitmap_name,
sizeof(s->bitmap_name));Quoted 1 line
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Quoted 3 lines
Reported-by Euler Robot<[email protected]>Signed-off-by Chen Qun<[email protected]>Reviewed-by Vladimir Sementsov-Ogievskiy <[email protected]>--
Best regards,
Vladimir
Le 20/10/2020 à 09:36, Chenqun (kuhn) a écrit :
Quoted 5 lines
Ping!
Hello,
Maybe this patch, some people have any other suggestions? Or, maybe missed to queue?
Hi,
As we've seen by reviewing previous versions, this change is not really trivial, so I will not take it via the trivial queue.
Perhaps via block I/O queue (Stefan?), Dirty Bitmaps (John?) or Migration (Juan?).
Thanks,
Laurent
Quoted 37 lines
Thanks,
Chen QunQuoted 34 lines
-----Original Message-----
From: Vladimir Sementsov-Ogievskiy [mailto:[email protected]]
Sent: Wednesday, October 14, 2020 11:56 PM
To: Chenqun (kuhn) <[email protected]>; [email protected]; [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Zhanghailiang <[email protected]>; ganqixin <[email protected]>; [email protected]; Euler Robot <[email protected]>; Laurent Vivier <[email protected]>; Li Qiang <[email protected]>
Subject: Re: [PATCH v3] migration/block-dirty-bitmap: fix uninitialized variable warningQuoted 1 line · Chen Qun
A default value is provided for the variable '
bitmap_name' to avoid compilerwarning.
Quoted 5 lines
The compiler show warning:
migration/block-dirty-bitmap.c:1090:13: warning: ‘bitmap_name’ may be used uninitialized in this function [-Wmaybe-uninitialized]g_strlcpy(s->bitmap_name, bitmap_name,
sizeof(s->bitmap_name));Quoted 1 line
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Quoted 3 lines
Reported-by Euler Robot<[email protected]>Signed-off-by Chen Qun<[email protected]>Reviewed-by Vladimir Sementsov-Ogievskiy <[email protected]>--
Best regards,
Vladimir
Quoted 7 lines · Laurent Vivier
Le 20/10/2020 à 09:36, Chenqun (kuhn) a écrit :
Quoted 5 lines
Ping!
Hello,
Maybe this patch, some people have any other suggestions? Or, maybe missed to queue?
Quoted 8 lines
Hi,
As we've seen by reviewing previous versions, this change is not really trivial, so I will not take it via the trivial queue.
Perhaps via block I/O queue (Stefan?), Dirty Bitmaps (John?) or Migration (Juan?).
Correct would be Eric's bitmaps tree.
Quoted 39 lines
Quoted 38 lines
Thanks,
Chen QunQuoted 34 lines
-----Original Message-----
From: Vladimir Sementsov-Ogievskiy [mailto:[email protected]]
Sent: Wednesday, October 14, 2020 11:56 PM
To: Chenqun (kuhn) <[email protected]>; [email protected]; [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Zhanghailiang <[email protected]>; ganqixin <[email protected]>; [email protected]; Euler Robot <[email protected]>; Laurent Vivier <[email protected]>; Li Qiang <[email protected]>
Subject: Re: [PATCH v3] migration/block-dirty-bitmap: fix uninitialized variable warningQuoted 1 line · Chen Qun
A default value is provided for the variable '
bitmap_name' to avoid compilerwarning.
Quoted 5 lines
The compiler show warning:
migration/block-dirty-bitmap.c:1090:13: warning: ‘bitmap_name’ may be used uninitialized in this function [-Wmaybe-uninitialized]g_strlcpy(s->bitmap_name, bitmap_name,
sizeof(s->bitmap_name));Quoted 1 line
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Quoted 3 lines
Reported-by Euler Robot<[email protected]>Signed-off-by Chen Qun<[email protected]>Reviewed-by Vladimir Sementsov-Ogievskiy <[email protected]>--
Best regards,
Vladimir
Signature · 2 lines
Best regards, Vladimir
Quoted 11 lines · Vladimir Sementsov-Ogievskiy
Quoted 10 lines · Laurent Vivier
Le 20/10/2020 à 09:36, Chenqun (kuhn) a écrit :
Quoted 6 lines
Ping!
Hello,
Maybe this patch, some people have any other suggestions? Or, maybe missed to queue?
Hi,
Quoted 8 lines
Quoted 6 lines
As we've seen by reviewing previous versions, this change is not really trivial, so I will not take it via the trivial queue.
Perhaps via block I/O queue (Stefan?), Dirty Bitmaps (John?) or Migration (Juan?).
Correct would be Eric's bitmaps tree.
Yes, I'm planning on queuing this.
Signature · 3 lines
Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org