From nobody Fri Jan 9 09:11:11 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=1766968888; cv=none; d=zohomail.com; s=zohoarc; b=Rorv7+1KbVU1mWEgdXfLZ9ZFSadsY27cdyJCVBkVLj84DSDFSIJk5UMerClsaxY+8xiN8BMtj7LPDURhzRIj6kPbMpOMA/4mu1ty1boCd12bGTCjzELCG6AfnvcTyFI1CHSArA2fy+CN9VKXHDUQvay9IRwyTOc8/83QVHExPY0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1766968888; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=wKNjEt1uuZIXByHGuTkreaJnbK877NUBDlWgcVw7rOE=; b=DbDjh2o9znbZLn/bKfwC7ODQ0iZ2xJrEsBk3dHRdjIHJZcnJiagvssaHN/IZOS3hRkgeVsdfV/75MMdA/sBSTkNk5hwRhv3QSzSELKam60hpj77m19FnKJ+tuyvtxTuiokkaR76XAAS1SWRdVZKPgvRPhDAugi/FhND32/4OESA= 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 1766968888005262.58874979819814; Sun, 28 Dec 2025 16:41:28 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id AEC3E419EC; Sun, 28 Dec 2025 19:41:24 -0500 (EST) Received: from [172.19.199.83] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id A8AEA3F8A4; Sun, 28 Dec 2025 19:32:45 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id 183B5419D3; Sun, 28 Dec 2025 18:49:08 -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 3881F41B24 for ; Sun, 28 Dec 2025 18:40:59 -0500 (EST) Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-636-H4Bt5uv1PxuRonk821heZQ-1; Sun, 28 Dec 2025 18:40:57 -0500 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id DF8B41800342 for ; Sun, 28 Dec 2025 23:40:56 +0000 (UTC) Received: from harajuku.usersys.redhat.com.homenet.telecomitalia.it (unknown [10.45.224.19]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2E43F1800367 for ; Sun, 28 Dec 2025 23:40:55 +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=1766965258; 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: in-reply-to:in-reply-to:references:references; bh=wKNjEt1uuZIXByHGuTkreaJnbK877NUBDlWgcVw7rOE=; b=GhCayT8iobI/h5Wk6LatbT7CNivHlli04Z/gjzcHAbCzf/TKs8hzvFEzdGiPmDEgtsgGjI Vb1q2vdZMiWpsxNw6SVGQaMLzZMY+qxOr4NPoj35y7ELUwGUS0RO81Ei6FdWdKDZ2k0NZN GtlY/tMGKNFPphE0oeCz4zgVnAKfrk8= X-MC-Unique: H4Bt5uv1PxuRonk821heZQ-1 X-Mimecast-MFC-AGG-ID: H4Bt5uv1PxuRonk821heZQ_1766965257 To: devel@lists.libvirt.org Subject: [PATCH 04/29] conf: Introduce VIR_STORAGE_FILE_JSON Date: Mon, 29 Dec 2025 00:40:23 +0100 Message-ID: <20251228234048.1711701-5-abologna@redhat.com> In-Reply-To: <20251228234048.1711701-1-abologna@redhat.com> References: <20251228234048.1711701-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: q3PzRcSfRi-_VNsXidXug7E3-oZgoSXfUkCd35R92oI_1766965257 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: TB7577OEYENCSO5ZV2GR4LL6KNI543C4 X-Message-ID-Hash: TB7577OEYENCSO5ZV2GR4LL6KNI543C4 X-MailFrom: abologna@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: Andrea Bolognani via Devel Reply-To: Andrea Bolognani X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1766968889970158500 Content-Type: text/plain; charset="utf-8"; x-default="true" We will need to handle storage files using JSON format soon. Signed-off-by: Andrea Bolognani --- src/conf/storage_source_conf.c | 2 +- src/conf/storage_source_conf.h | 1 + src/qemu/qemu_block.c | 2 ++ tests/storagepoolcapsschemadata/poolcaps-fs.xml | 5 +++++ tests/storagepoolcapsschemadata/poolcaps-full.xml | 5 +++++ .../out/qcow2-qcow2_qcow2-qcow2_qcow2-auto | 2 +- .../virstoragetestdata/out/qcow2-qcow2_qcow2-qcow2_raw-auto | 2 +- tests/virstoragetestdata/out/qcow2-qcow2_qcow2-qcow2_raw-raw | 2 +- tests/virstoragetestdata/out/qcow2-symlinks | 2 +- .../out/qcow2datafile-qcow2_qcow2-datafile | 2 +- 10 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/conf/storage_source_conf.c b/src/conf/storage_source_conf.c index 087de1eaf2..e62707ba9b 100644 --- a/src/conf/storage_source_conf.c +++ b/src/conf/storage_source_conf.c @@ -57,7 +57,7 @@ VIR_ENUM_IMPL(virStorageFileFormat, "none", "raw", "dir", "bochs", "cloop", "dmg", "iso", - "vpc", "vdi", + "vpc", "vdi", "json", /* Not direct file formats, but used for various drivers */ "fat", "vhd", "ploop", /* Formats with backing file below here */ diff --git a/src/conf/storage_source_conf.h b/src/conf/storage_source_conf.h index fc868b31af..0682da27f0 100644 --- a/src/conf/storage_source_conf.h +++ b/src/conf/storage_source_conf.h @@ -63,6 +63,7 @@ typedef enum { VIR_STORAGE_FILE_ISO, VIR_STORAGE_FILE_VPC, VIR_STORAGE_FILE_VDI, + VIR_STORAGE_FILE_JSON, =20 /* Not direct file formats, but used for various drivers */ VIR_STORAGE_FILE_FAT, diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index a7062d3e96..66384a8159 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -1322,6 +1322,7 @@ qemuBlockStorageSourceGetBlockdevFormatProps(virStora= geSource *src) case VIR_STORAGE_FILE_COW: case VIR_STORAGE_FILE_ISO: case VIR_STORAGE_FILE_DIR: + case VIR_STORAGE_FILE_JSON: virReportError(VIR_ERR_INTERNAL_ERROR, _("mishandled storage format '%1$s'"), virStorageFileFormatTypeToString(src->format)); @@ -2317,6 +2318,7 @@ qemuBlockStorageSourceCreateGetFormatProps(virStorage= Source *src, case VIR_STORAGE_FILE_COW: case VIR_STORAGE_FILE_ISO: case VIR_STORAGE_FILE_DIR: + case VIR_STORAGE_FILE_JSON: return 0; =20 case VIR_STORAGE_FILE_AUTO_SAFE: diff --git a/tests/storagepoolcapsschemadata/poolcaps-fs.xml b/tests/storag= epoolcapsschemadata/poolcaps-fs.xml index eee75af746..1f59d33aef 100644 --- a/tests/storagepoolcapsschemadata/poolcaps-fs.xml +++ b/tests/storagepoolcapsschemadata/poolcaps-fs.xml @@ -12,6 +12,7 @@ iso vpc vdi + json fat vhd ploop @@ -55,6 +56,7 @@ iso vpc vdi + json fat vhd ploop @@ -88,6 +90,7 @@ iso vpc vdi + json fat vhd ploop @@ -167,6 +170,7 @@ iso vpc vdi + json fat vhd ploop @@ -193,6 +197,7 @@ iso vpc vdi + json fat vhd ploop diff --git a/tests/storagepoolcapsschemadata/poolcaps-full.xml b/tests/stor= agepoolcapsschemadata/poolcaps-full.xml index 805950a937..a4f532cbb8 100644 --- a/tests/storagepoolcapsschemadata/poolcaps-full.xml +++ b/tests/storagepoolcapsschemadata/poolcaps-full.xml @@ -12,6 +12,7 @@ iso vpc vdi + json fat vhd ploop @@ -55,6 +56,7 @@ iso vpc vdi + json fat vhd ploop @@ -88,6 +90,7 @@ iso vpc vdi + json fat vhd ploop @@ -167,6 +170,7 @@ iso vpc vdi + json fat vhd ploop @@ -193,6 +197,7 @@ iso vpc vdi + json fat vhd ploop diff --git a/tests/virstoragetestdata/out/qcow2-qcow2_qcow2-qcow2_qcow2-aut= o b/tests/virstoragetestdata/out/qcow2-qcow2_qcow2-qcow2_qcow2-auto index 79943f432e..c9db352af8 100644 --- a/tests/virstoragetestdata/out/qcow2-qcow2_qcow2-qcow2_qcow2-auto +++ b/tests/virstoragetestdata/out/qcow2-qcow2_qcow2-qcow2_qcow2-auto @@ -1,6 +1,6 @@ path:ABS_SRCDIR/virstoragetestdata/images/qcow2_qcow2-qcow2_qcow2-auto.qco= w2 backingStoreRaw: qcow2_qcow2-auto.qcow2 -backingStoreRawFormat: qcow2(14) +backingStoreRawFormat: qcow2(15) dataFileRaw: capacity: 1024 encryption: 0 diff --git a/tests/virstoragetestdata/out/qcow2-qcow2_qcow2-qcow2_raw-auto = b/tests/virstoragetestdata/out/qcow2-qcow2_qcow2-qcow2_raw-auto index 02e2c5a966..713df6086d 100644 --- a/tests/virstoragetestdata/out/qcow2-qcow2_qcow2-qcow2_raw-auto +++ b/tests/virstoragetestdata/out/qcow2-qcow2_qcow2-qcow2_raw-auto @@ -1,6 +1,6 @@ path:ABS_SRCDIR/virstoragetestdata/images/qcow2_qcow2-qcow2_raw-auto.qcow2 backingStoreRaw: qcow2_raw-auto.qcow2 -backingStoreRawFormat: qcow2(14) +backingStoreRawFormat: qcow2(15) dataFileRaw: capacity: 1024 encryption: 0 diff --git a/tests/virstoragetestdata/out/qcow2-qcow2_qcow2-qcow2_raw-raw b= /tests/virstoragetestdata/out/qcow2-qcow2_qcow2-qcow2_raw-raw index 843a013ef5..fb741133df 100644 --- a/tests/virstoragetestdata/out/qcow2-qcow2_qcow2-qcow2_raw-raw +++ b/tests/virstoragetestdata/out/qcow2-qcow2_qcow2-qcow2_raw-raw @@ -1,6 +1,6 @@ path:ABS_BUILDDIR/virstoragedata/wrap backingStoreRaw: ABS_BUILDDIR/virstoragedata/qcow2 -backingStoreRawFormat: qcow2(14) +backingStoreRawFormat: qcow2(15) dataFileRaw: capacity: 1024 encryption: 0 diff --git a/tests/virstoragetestdata/out/qcow2-symlinks b/tests/virstorage= testdata/out/qcow2-symlinks index c74cf6be53..8cc5d43e8f 100644 --- a/tests/virstoragetestdata/out/qcow2-symlinks +++ b/tests/virstoragetestdata/out/qcow2-symlinks @@ -1,6 +1,6 @@ path:ABS_SRCDIR/virstoragetestdata/images/sub/link2 backingStoreRaw: ../sub/link1 -backingStoreRawFormat: qcow2(14) +backingStoreRawFormat: qcow2(15) dataFileRaw: capacity: 1024 encryption: 0 diff --git a/tests/virstoragetestdata/out/qcow2datafile-qcow2_qcow2-datafil= e b/tests/virstoragetestdata/out/qcow2datafile-qcow2_qcow2-datafile index a200ba98fa..51dacec39c 100644 --- a/tests/virstoragetestdata/out/qcow2datafile-qcow2_qcow2-datafile +++ b/tests/virstoragetestdata/out/qcow2datafile-qcow2_qcow2-datafile @@ -1,6 +1,6 @@ path:ABS_SRCDIR/virstoragetestdata/images/qcow2datafile-datafile.qcow2 backingStoreRaw: datafile.qcow2 -backingStoreRawFormat: qcow2(14) +backingStoreRawFormat: qcow2(15) dataFileRaw: raw capacity: 1024 encryption: 0 --=20 2.52.0