From nobody Tue Apr 16 16:47:38 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1572287023; cv=none; d=zoho.com; s=zohoarc; b=nxVBnKZfcIn8XtWZ9rZtdcCkal8/zG6ft/064Xkh9/zIQwDHhMTE9eDCpwOCE5GLGNuV8BKGFqumZ9PdhPq3W8+T03EfzGDJoW6AlGEI1gCPyzHXxsOAME+cfSxBb2eR+S/mDIxQxl/gHFaS5nD3RXvblTkF9wqTw7ifC+2JFhg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1572287023; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=N3snao7iZc1OmhCkLz3S3mudt2+Fh+0qm7uyroQ2ZnU=; b=Zjc2BCYZbowZ23Vi70tv9tDw5ZgUVUhiTauCcDrOlKnmql+SY7plODudmK607/uUztMOeuP8Wg5yCx4Sl5YghbRwIxEe64NkKJi6RY3LypKBwdyO9MGDg9x4qW4dccI7pbv2jYmOKRtATGcqBgAgBVQBl3DiFu7tB/hpaRsRuCY= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1572287023678210.0513934077511; Mon, 28 Oct 2019 11:23:43 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iP9f1-0000ln-B4; Mon, 28 Oct 2019 18:22:35 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iP9ez-0000lZ-Lf for xen-devel@lists.xenproject.org; Mon, 28 Oct 2019 18:22:33 +0000 Received: from mail-lf1-x143.google.com (unknown [2a00:1450:4864:20::143]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id e5e30b78-f9af-11e9-beca-bc764e2007e4; Mon, 28 Oct 2019 18:22:28 +0000 (UTC) Received: by mail-lf1-x143.google.com with SMTP id f5so8569541lfp.1 for ; Mon, 28 Oct 2019 11:22:28 -0700 (PDT) Received: from al1-pc.kyiv.epam.com (ll-74.141.223.85.sovam.net.ua. [85.223.141.74]) by smtp.gmail.com with ESMTPSA id p86sm7474522lja.100.2019.10.28.11.22.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Oct 2019 11:22:27 -0700 (PDT) X-Inumbo-ID: e5e30b78-f9af-11e9-beca-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=x6gcVv6ZDlEFCzeVFBOyHJn95rgYFyAe3I5FPXjfjEA=; b=gm9/ZNAnpUx4H9Rr2W+ONu8mpYfWjjCE+5YtaFBb/PDpUTno1M1Se96QcGazv54bE4 JdYD1ZmXnAtYyiJf3juMo/s5Wbp0BOijruWqpDt3Cvm9YSUYZLTnM1ljfWQRBV76EFs/ fAjNexz2V3ZoNpXyKaHY08cMHjUN3OCV38sUfPsuWn1kcvLytIVwCHr+lAAxZjiQQzGp uL1Wuz4WTW2RYZuZrE4kQmttgs4EBY9LPSEDCqRFgwnxuk8N9IqqwuCdajk0LHY9mQXo xd8RDyrEpGOTZmIlsUDN2PP/OF3syX3nlHjRsMglKL5WD+d72nzuVWYEgUMCNZ85OgfH iYgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=x6gcVv6ZDlEFCzeVFBOyHJn95rgYFyAe3I5FPXjfjEA=; b=qLS0aboEyKQ6PeubNtW2IXvDXhodJAG6RrR4W8iBLj+Ciegi2viaUqk5pWA2viFR7F s1SdBh3dQ/PM5KGYAAGjbJ0UNa9bqvHIJ5F3QundBYHHj3hF/nfmQnR8OCDAfU5MTgFJ ywUy3Gp+fdyKt8EiscJRWzccyldq8mIULkFBI/T/fgfBWnMPqF7KbUtAxotQf6WDx8Yh C1lUP9/CTkcd3l5WZsTMJLz9J/63gs+DKH+jqPzwN/xg+W5qFxiI4q8InNhBP2NqtXiZ EgiesdTnsC4T/PbQOEtJJAhnxv3sY8+TWouSIlNfB0EpDpzyqUejPhejZS96sIgABPWF 7xgg== X-Gm-Message-State: APjAAAVYW27Ln2OADx2bCyO9W29LzMzEd4oV6+YCyFpmLY2NeaCs6j6L x9TJu1Yj6cvLZ/zC0qiWlp01lBHXsiEGuw== X-Google-Smtp-Source: APXvYqy9PMJSmzxNlHHRH056OzSqJbgI3Jr5398D0qOOjW0KtKJbSv8w7pcGWuZYBap7tdRJrI/FQA== X-Received: by 2002:ac2:43b6:: with SMTP id t22mr5557400lfl.126.1572286947621; Mon, 28 Oct 2019 11:22:27 -0700 (PDT) From: Oleksandr Grytsov To: xen-devel@lists.xenproject.org Date: Mon, 28 Oct 2019 20:22:16 +0200 Message-Id: <20191028182216.3882-2-al1img@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191028182216.3882-1-al1img@gmail.com> References: <20191028182216.3882-1-al1img@gmail.com> Subject: [Xen-devel] [PATCH v1 1/1] libxl/gentypes: add range init to array elements in json parsing X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: anthony.perard@citrix.com, Oleksandr Grytsov , julien.grall@arm.com, ian.jackson@eu.citrix.com, wl@xen.org MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Oleksandr Grytsov Add initialization of array elements in parse json function. Currently, array elements are initialized with calloc. Which means initialize all element fields with zero values. If entries are missed in json for such fields, it will be equal to zero instead of default values. The fix is to add range init function before parsing array element for structures which have defined range init function. Signed-off-by: Oleksandr Grytsov --- tools/libxl/gentypes.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/libxl/gentypes.py b/tools/libxl/gentypes.py index 6417c9dd8c..4ff5d8a2d0 100644 --- a/tools/libxl/gentypes.py +++ b/tools/libxl/gentypes.py @@ -456,6 +456,8 @@ def libxl_C_type_parse_json(ty, w, v, indent =3D " "= , parent =3D None, discrimina s +=3D " goto out;\n" s +=3D " }\n" s +=3D " for (i=3D0; (t=3Dlibxl__json_array_get(x,i)); i++) {\n" + if ty.elem_type.init_fn is not None and ty.elem_type.autogenerate_= init_fn: + s +=3D indent + " "+"%s_init(&%s[i]);\n" % (ty.elem_type.ty= pename, v) s +=3D libxl_C_type_parse_json(ty.elem_type, "t", v+"[i]", indent + " ", parent) s +=3D " }\n" --=20 2.17.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel