mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-12-11 16:00:50 -07:00
migration/block-dirty-bitmap: fix uninitialized variable warning
A default value is provided for the variable 'bitmap_name' to avoid
a compiler warning.
The compiler showed the 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 <euler.robot@huawei.com>
Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
Message-Id: <20201014114430.1898684-1-kuhn.chenqun@huawei.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
[eblake: commit message grammar tweaks]
Signed-off-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
ed7b70c27b
commit
a024890a64
1 changed files with 9 additions and 12 deletions
|
|
@ -1072,8 +1072,8 @@ static int dirty_bitmap_load_header(QEMUFile *f, DBMLoadState *s,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (!s->cancelled) {
|
||||
if (bitmap_alias_map) {
|
||||
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) {
|
||||
|
|
@ -1082,9 +1082,6 @@ static int dirty_bitmap_load_header(QEMUFile *f, DBMLoadState *s,
|
|||
s->bs->node_name, s->node_alias);
|
||||
cancel_incoming_locked(s);
|
||||
}
|
||||
} else {
|
||||
bitmap_name = s->bitmap_alias;
|
||||
}
|
||||
}
|
||||
|
||||
if (!s->cancelled) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue