From nobody Thu Jan 8 12:09:43 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1767622253; cv=none; d=zohomail.com; s=zohoarc; b=nKkD9gZ0WXN0u5VUVFjBNFqd192wmFkVfTUUJiegwagwh/WaPZ2Ep4p/VUJSWI4SlxvmtjYZGx70B7P1FtPq8LJSQSujKJMZXH02QQRLERUslHuIjxFVWL9VbvhgopA4VEWwS7XMqeCS7cuwn/coqDjS/A0efW1ItFZ3AqhAWrU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1767622253; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:Subject:Subject:To:To:Message-Id:Cc; bh=cVSYhPLlttf/MVS0TnMq5/H3JqaTFrkjRHgwTcLxrSM=; b=RnegMhdLulU43q5i0+0ykUHkw7UinoIg4qGmkLkyVswApcmdP7NKh7NFKt4Ol8O79RBUFQ/BfABP9Dx78U62mkKVlX4oy4oo4lh0w45nIKF7HWYb48V4dwfF0chsfpKsxe6BC9bRjjLfJBbPjNuFHg6Q2peRIh6wSrmJXDZzh9o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1767622252625599.5610485550114; Mon, 5 Jan 2026 06:10:52 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id 65168418E6; Mon, 5 Jan 2026 09:09:52 -0500 (EST) Received: from [172.19.199.83] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 12C6B41A58; Mon, 5 Jan 2026 09:09:00 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id DD708418B2; Mon, 5 Jan 2026 09:08:51 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 0DC153F96E for ; Mon, 5 Jan 2026 09:08:50 -0500 (EST) Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-136-R1r8GcvLObWpOEbYptQ2Ew-1; Mon, 05 Jan 2026 09:08:49 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 80F4B1956054 for ; Mon, 5 Jan 2026 14:08:48 +0000 (UTC) Received: from speedmetal.openshiftapps.com (unknown [10.45.242.19]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id CFDD719560A7 for ; Mon, 5 Jan 2026 14:08:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1767622130; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cVSYhPLlttf/MVS0TnMq5/H3JqaTFrkjRHgwTcLxrSM=; b=PHCE1G6Ou1DgafzMxu43IQT4RC27K44x1wmqSjV7ccLTzS93sJqCQYAO1AoLU8ErkrhfKt PZ6fRfkCCA+BMPeDP6Swa+tb7D8LdgStxIdPlh58gC1AaXimIrbH7WD/kom2hLAaxD/SmF q4F8/zXZnvnOFbrZCfRzteDppOjq2Yc= X-MC-Unique: R1r8GcvLObWpOEbYptQ2Ew-1 X-Mimecast-MFC-AGG-ID: R1r8GcvLObWpOEbYptQ2Ew_1767622128 To: devel@lists.libvirt.org Subject: [PATCH] virjsontest: Add test for nesting depth Date: Mon, 5 Jan 2026 15:08:46 +0100 Message-ID: <7844d76c97118d8e5974ccb161f33f92915b94ff.1767622036.git.pkrempa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 1mgfELP9OlAO1XZq0DmRZBWa9W1gQB-jKDP2qklPbY8_1767622128 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: AXUFOYLGGSCAJ7AL3AYCCMZW6QYDLWAA X-Message-ID-Hash: AXUFOYLGGSCAJ7AL3AYCCMZW6QYDLWAA X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Peter Krempa via Devel Reply-To: Peter Krempa X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1767622257029154100 Content-Type: text/plain; charset="utf-8" From: Peter Krempa Add an example of 250 layer deep nested JSON to make sure the parser supports it. This is in order to maintain compatibility with external snapshots in qemu, where such a deeply nested document is returned with a 'query-block' QMP call. I've used a fake JSON as a real reply from qemu is around 1.4MiB for a 200 deep image chain. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- As promised for the JSON nesting fix. Obviously works only when applied on top of it. tests/virjsondata/parse-nesting-in.json | 1 + tests/virjsondata/parse-nesting-out.json | 1 + 2 files changed, 2 insertions(+) create mode 100644 tests/virjsondata/parse-nesting-in.json create mode 120000 tests/virjsondata/parse-nesting-out.json diff --git a/tests/virjsondata/parse-nesting-in.json b/tests/virjsondata/pa= rse-nesting-in.json new file mode 100644 index 0000000000..8bbe1a3439 --- /dev/null +++ b/tests/virjsondata/parse-nesting-in.json @@ -0,0 +1 @@ +{"n249": {"n248": {"n247": {"n246": {"n245": {"n244": {"n243": {"n242": {"= n241": {"n240": {"n239": {"n238": {"n237": {"n236": {"n235": {"n234": {"n23= 3": {"n232": {"n231": {"n230": {"n229": {"n228": {"n227": {"n226": {"n225":= {"n224": {"n223": {"n222": {"n221": {"n220": {"n219": {"n218": {"n217": {"= n216": {"n215": {"n214": {"n213": {"n212": {"n211": {"n210": {"n209": {"n20= 8": {"n207": {"n206": {"n205": {"n204": {"n203": {"n202": {"n201": {"n200":= {"n199": {"n198": {"n197": {"n196": {"n195": {"n194": {"n193": {"n192": {"= n191": {"n190": {"n189": {"n188": {"n187": {"n186": {"n185": {"n184": {"n18= 3": {"n182": {"n181": {"n180": {"n179": {"n178": {"n177": {"n176": {"n175":= {"n174": {"n173": {"n172": {"n171": {"n170": {"n169": {"n168": {"n167": {"= n166": {"n165": {"n164": {"n163": {"n162": {"n161": {"n160": {"n159": {"n15= 8": {"n157": {"n156": {"n155": {"n154": {"n153": {"n152": {"n151": {"n150":= {"n149": {"n148": {"n147": {"n146": {"n145": {"n144": {"n143": {"n142": {"= n141": {"n140": {"n139": {"n138": {"n137": {"n136": {"n135": {"n134": {"n13= 3": {"n132": {"n131": {"n130": {"n129": {"n128": {"n127": {"n126": {"n125":= {"n124": {"n123": {"n122": {"n121": {"n120": {"n119": {"n118": {"n117": {"= n116": {"n115": {"n114": {"n113": {"n112": {"n111": {"n110": {"n109": {"n10= 8": {"n107": {"n106": {"n105": {"n104": {"n103": {"n102": {"n101": {"n100":= {"n99": {"n98": {"n97": {"n96": {"n95": {"n94": {"n93": {"n92": {"n91": {"= n90": {"n89": {"n88": {"n87": {"n86": {"n85": {"n84": {"n83": {"n82": {"n81= ": {"n80": {"n79": {"n78": {"n77": {"n76": {"n75": {"n74": {"n73": {"n72": = {"n71": {"n70": {"n69": {"n68": {"n67": {"n66": {"n65": {"n64": {"n63": {"n= 62": {"n61": {"n60": {"n59": {"n58": {"n57": {"n56": {"n55": {"n54": {"n53"= : {"n52": {"n51": {"n50": {"n49": {"n48": {"n47": {"n46": {"n45": {"n44": {= "n43": {"n42": {"n41": {"n40": {"n39": {"n38": {"n37": {"n36": {"n35": {"n3= 4": {"n33": {"n32": {"n31": {"n30": {"n29": {"n28": {"n27": {"n26": {"n25":= {"n24": {"n23": {"n22": {"n21": {"n20": {"n19": {"n18": {"n17": {"n16": {"= n15": {"n14": {"n13": {"n12": {"n11": {"n10": {"n9": {"n8": {"n7": {"n6": {= "n5": {"n4": {"n3": {"n2": {"n1": {"n0": "end"}}}}}}}}}}}}}}}}}}}}}}}}}}}}}= }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}= }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}= }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} diff --git a/tests/virjsondata/parse-nesting-out.json b/tests/virjsondata/p= arse-nesting-out.json new file mode 120000 index 0000000000..d269172843 --- /dev/null +++ b/tests/virjsondata/parse-nesting-out.json @@ -0,0 +1 @@ +parse-nesting-in.json \ No newline at end of file --=20 2.52.0