From nobody Mon May 13 22:31:05 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1645466148; cv=none; d=zohomail.com; s=zohoarc; b=jfXG5a1OQ02nfhq2RMGzboEhE5ItkdqbtG4AVF1GmCGXnx9HpjJcZfZQz0+eerNahisW4QyF2AAd+EXwX43DTW8mFBSu63Cn7EEQUxq7k2CAMSx5ybTuDWremwFv1Pw/rON4Zesi2EG8RgWzIP5gQJhcYfR6uSkyXRBT01w1M2g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1645466148; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=NHzCyMpmKro/jSczjnl7YduIpklPrCNUNZsPtzWyarY=; b=iN+MvZ/I/oZoga9mdR4DIa6OfgI9hBfx9kengrrMq3OMYnMTqBQibkBR4K+64/WLyss+x+r+5Pmr7cj0muREbNFkHvLONAB6fiE3hJIaFDb26smQwZ8HqJXuhw2kGEGfLmMFSeRSbwaPXAS2Qj9ZqRmPQNZLoprf6Jclvjmfl5U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1645466148902762.5879860262417; Mon, 21 Feb 2022 09:55:48 -0800 (PST) Received: from localhost ([::1]:45732 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nMCuZ-0002ts-Qj for importer@patchew.org; Mon, 21 Feb 2022 12:55:47 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57908) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nMCtB-00029H-O2 for qemu-devel@nongnu.org; Mon, 21 Feb 2022 12:54:22 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:57740) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nMCt9-0004Lu-N8 for qemu-devel@nongnu.org; Mon, 21 Feb 2022 12:54:21 -0500 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 21LFo5Bd007500; Mon, 21 Feb 2022 17:54:15 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3ebn09um50-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 21 Feb 2022 17:54:15 +0000 Received: from m0098396.ppops.net (m0098396.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 21LHiHXE018008; Mon, 21 Feb 2022 17:54:14 GMT Received: from ppma05wdc.us.ibm.com (1b.90.2fa9.ip4.static.sl-reverse.com [169.47.144.27]) by mx0a-001b2d01.pphosted.com with ESMTP id 3ebn09um4q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 21 Feb 2022 17:54:14 +0000 Received: from pps.filterd (ppma05wdc.us.ibm.com [127.0.0.1]) by ppma05wdc.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 21LHr6gs009132; Mon, 21 Feb 2022 17:54:13 GMT Received: from b01cxnp22033.gho.pok.ibm.com (b01cxnp22033.gho.pok.ibm.com [9.57.198.23]) by ppma05wdc.us.ibm.com with ESMTP id 3ear69bwx9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 21 Feb 2022 17:54:13 +0000 Received: from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com [9.57.199.109]) by b01cxnp22033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 21LHsC5v26804620 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 21 Feb 2022 17:54:12 GMT Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D10A2112062; Mon, 21 Feb 2022 17:54:12 +0000 (GMT) Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 662FF112063; Mon, 21 Feb 2022 17:54:11 +0000 (GMT) Received: from farosas.linux.ibm.com.com (unknown [9.211.62.223]) by b01ledav004.gho.pok.ibm.com (Postfix) with ESMTP; Mon, 21 Feb 2022 17:54:11 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding; s=pp1; bh=NHzCyMpmKro/jSczjnl7YduIpklPrCNUNZsPtzWyarY=; b=KzxfTmZxY79G3D8Ms51w+9qyzVkomodVHQHKwWkXg7KMZ7uwBOZB02DOj/9QGotoQBsn x7GBqqH/3RhFE97Dv4PQ45zwXhCbVYrYl+RSzcVeuUDQ8EQ0GH+MZAYg6JgBYGLBIb1f Y7zH9BUnFj60eEAcLMDng1E18oI26KbWzTkzXWTtwhL6NXSBH7ZBDh06wQfX6GxIjCu1 ovsrOQBZ+aAIjP+N8h+FGS0xYiD9lochmZIDpwo9Of4VXAgh7MJTfjmL+0KiPaZSmhL6 OtbJrrF+ZDEsKg5CkTKJfUH4pj9hpUh6rLtuDqzGMaBmrqa8jrMF5Xjg06qQy/nP1kgy yA== From: Fabiano Rosas To: qemu-devel@nongnu.org Subject: [PATCH] analyze-migration.py: Fix instance_id signedness Date: Mon, 21 Feb 2022 14:53:57 -0300 Message-Id: <20220221175357.2103775-1-farosas@linux.ibm.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: 91UkqsSj6v4doq37GeeVLC9fiSP220e- X-Proofpoint-GUID: 1Bq8T_OVwWkoXE2qqzlI2puUnMmIe0-1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.816,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2022-02-21_08,2022-02-21_02,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 impostorscore=0 bulkscore=0 clxscore=1011 priorityscore=1501 spamscore=0 adultscore=0 lowpriorityscore=0 mlxscore=0 suspectscore=0 mlxlogscore=999 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2202210103 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=148.163.156.1; envelope-from=farosas@linux.ibm.com; helo=mx0a-001b2d01.pphosted.com X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: eduardo@habkost.net, crosa@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @ibm.com) X-ZM-MESSAGEID: 1645466151026100001 Content-Type: text/plain; charset="utf-8" The instance_id field is uint32_t in the migration code, however the script currently handles it as a signed integer: $ ./scripts/analyze-migration.py -f mig Traceback (most recent call last): File "./scripts/analyze-migration.py", line 605, in dump.read(dump_memory =3D args.memory) File "./scripts/analyze-migration.py", line 539, in read classdesc =3D self.section_classes[section_key] KeyError: ('spapr_iommu', -2147483648) Signed-off-by: Fabiano Rosas Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- scripts/analyze-migration.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/analyze-migration.py b/scripts/analyze-migration.py index b82a1b0c58..713f645eea 100755 --- a/scripts/analyze-migration.py +++ b/scripts/analyze-migration.py @@ -40,8 +40,8 @@ def __init__(self, filename): def read64(self): return int.from_bytes(self.file.read(8), byteorder=3D'big', signed= =3DTrue) =20 - def read32(self): - return int.from_bytes(self.file.read(4), byteorder=3D'big', signed= =3DTrue) + def read32(self, signed=3DTrue): + return int.from_bytes(self.file.read(4), byteorder=3D'big', signed= =3Dsigned) =20 def read16(self): return int.from_bytes(self.file.read(2), byteorder=3D'big', signed= =3DTrue) @@ -533,7 +533,7 @@ def read(self, desc_only =3D False, dump_memory =3D Fal= se, write_memory =3D False): elif section_type =3D=3D self.QEMU_VM_SECTION_START or section= _type =3D=3D self.QEMU_VM_SECTION_FULL: section_id =3D file.read32() name =3D file.readstr() - instance_id =3D file.read32() + instance_id =3D file.read32(signed=3DFalse) version_id =3D file.read32() section_key =3D (name, instance_id) classdesc =3D self.section_classes[section_key] --=20 2.34.1