From nobody Sun Oct 5 19:07:09 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1603713872; cv=none; d=zohomail.com; s=zohoarc; b=PNbwdUHllNtNiQ9I+c5f4PrTuzIX/2h8SHHRuvikaOtalykAOWCuoeGm0RgBd6PaNycXlQCzWfg2UxvZujpbOISU86ekhNULeIZsjyPtYBbFGx0lNBHANjFPF5aaMm506E0sq+/fJQKjALseTzdD6WH+sf+PSh/3H7FjX9uriZE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1603713872; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=oLyUB6LTT/nJ6eZrsjXCp9HkJxFs8bbUSiSmYcKKUBw=; b=ZsCCQzx6PnTsUYiTolQSN5riLsY9O1NJ2dCx7nFKaC7w3ifgRZ7Zi95qaFe0eVEodWX3t/pvNZHd9+QIrcG9Jx6eBOLcuUerdLf30wzD5hFGtOF+YcKQ2QZCLQP/ws2KoGJMxOj5K2n+aPsN9By6MpV0bwdyJjgCwZrhQgGPKQw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1603713872530270.0819526266521; Mon, 26 Oct 2020 05:04:32 -0700 (PDT) Received: from localhost ([::1]:38618 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kX1El-0002St-Ox for importer@patchew.org; Mon, 26 Oct 2020 08:04:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40866) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kX1DG-0000zg-GB for qemu-devel@nongnu.org; Mon, 26 Oct 2020 08:02:58 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:29839) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kX1DD-0001pg-9p for qemu-devel@nongnu.org; Mon, 26 Oct 2020 08:02:57 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-76-8PQ4iARhPX6c8I-OShLMkA-1; Mon, 26 Oct 2020 08:02:51 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B15FAA0BE8; Mon, 26 Oct 2020 12:02:49 +0000 (UTC) Received: from blue.redhat.com (ovpn-112-145.phx2.redhat.com [10.3.112.145]) by smtp.corp.redhat.com (Postfix) with ESMTP id D485310013D9; Mon, 26 Oct 2020 12:02:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603713773; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oLyUB6LTT/nJ6eZrsjXCp9HkJxFs8bbUSiSmYcKKUBw=; b=VG/GBrqaEUhLgD0hFs6d4TCgC5nq81A6wktJaoZ00Zw9fHHoHGLooLFyW0o4z3CAxBY9/T IIPPnPX1dx4P99QV5Iuaqt6FetdW9aLAzhHW9bCC42DoyruKNw6O79thpm4t9R79UpTKQb H/RfZNYI2xZwcz8cYaCAd0hALpN5WIM= X-MC-Unique: 8PQ4iARhPX6c8I-OShLMkA-1 From: Eric Blake To: qemu-devel@nongnu.org Subject: [PULL 2/2] migration/block-dirty-bitmap: fix uninitialized variable warning Date: Mon, 26 Oct 2020 07:02:45 -0500 Message-Id: <20201026120245.25024-3-eblake@redhat.com> In-Reply-To: <20201026120245.25024-1-eblake@redhat.com> References: <20201026120245.25024-1-eblake@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=eblake@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=eblake@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/25 21:03:19 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Vladimir Sementsov-Ogievskiy , "open list:Dirty Bitmaps" , Juan Quintela , "Dr. David Alan Gilbert" , Stefan Hajnoczi , Euler Robot , Chen Qun , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Chen Qun 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: =E2=80=98bitmap_name=E2=80= =99 may be used uninitialized in this function [-Wmaybe-uninitialized] g_strlcpy(s->bitmap_name, bitmap_name, sizeof(s->bitmap_name)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Reported-by: Euler Robot Signed-off-by: Chen Qun Message-Id: <20201014114430.1898684-1-kuhn.chenqun@huawei.com> Reviewed-by: Vladimir Sementsov-Ogievskiy [eblake: commit message grammar tweaks] Signed-off-by: Eric Blake --- migration/block-dirty-bitmap.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c index 98921db77271..c61d382be87c 100644 --- a/migration/block-dirty-bitmap.c +++ b/migration/block-dirty-bitmap.c @@ -1072,18 +1072,15 @@ static int dirty_bitmap_load_header(QEMUFile *f, DB= MLoadState *s, return -EINVAL; } - if (!s->cancelled) { - if (bitmap_alias_map) { - bitmap_name =3D 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 =3D s->bitmap_alias; + bitmap_name =3D s->bitmap_alias; + if (!s->cancelled && bitmap_alias_map) { + bitmap_name =3D 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); } } --=20 2.29.0