From nobody Sun Feb 8 21:13:53 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; 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=1744188398; cv=none; d=zohomail.com; s=zohoarc; b=e7Fy4O81RnzW3g/bEjo2OiipxvGXvzMA9wpll+JreTxV0CKJowmJV/hEOwdcVwvhWBxIaRI2MBTqpxVWvKLT4zdNXyqa6Secz8DfCKQ8uWzh+a/CKlb/4fjBllyPBpnVCrCeXJcdKmK0WQn6MojJa5XjAPopzTsZghIFmeJgGnI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1744188398; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id; bh=nnmuDKtYXQQoAyZj1+6zT0NULqNL4GyCSD3T2xs5+UM=; b=dg/l/z6yJNo7HRzteppvw/1CX69ChKo2yeDNzIfwwpnBZfLR9b11n2RCMHGUTpnzt6czIf9+zr3Tzl55WjPP2TxOd9BmDrPTYHoc4JJYonKGnRnGoXrYz8yffvtQ7NSjmdgI8lsirjiGxNhdrVbDZbpa1SprYsjqVyDcPHpTiAM= 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 1744188398160428.77816542105586; Wed, 9 Apr 2025 01:46:38 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 95C331726; Wed, 9 Apr 2025 04:46:37 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id DD5D6159F; Wed, 9 Apr 2025 04:46:18 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 363DC155D; Wed, 9 Apr 2025 04:46:16 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id B0EBA1551 for ; Wed, 9 Apr 2025 04:46:15 -0400 (EDT) Received: from mx-prod-mc-06.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-678-gD6inJC-OMaRlyGDRrPFSQ-1; Wed, 09 Apr 2025 04:46:14 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C2D661800349 for ; Wed, 9 Apr 2025 08:46:13 +0000 (UTC) Received: from kshcheti-thinkpadp1gen4i.tpbc.com (unknown [10.43.2.246]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id EF8091955DCE; Wed, 9 Apr 2025 08:46:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1744188375; 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=YPTOhrd9P1jLaJZDGJOsn/dWSsk+BVpG7ouOB3JRdr0=; b=Ler25fVzXT4JBZ6kwbetcTXxMjHx32982KZqnjdqk+cMlWtx08iDjYm9rZdvxbMHEbkZo8 uTGjrdO4yEbnC++dNMZetvMmfh2WURTjbsrtnnqzhm+0tAA4BtRah3yGUj+2DhLm14QDJe YaESUYFFD7jpdo/P5rqERtgWTEBP5oQ= X-MC-Unique: gD6inJC-OMaRlyGDRrPFSQ-1 X-Mimecast-MFC-AGG-ID: gD6inJC-OMaRlyGDRrPFSQ_1744188373 To: devel@lists.libvirt.org Subject: [PATCH v2 1/2] storage: virStorageVolDefParse and storageVolCreateXML flags fix Date: Wed, 9 Apr 2025 10:43:15 +0200 Message-ID: <20250409084540.999876-2-kshcheti@redhat.com> In-Reply-To: <20250409084540.999876-1-kshcheti@redhat.com> References: <20250409084540.999876-1-kshcheti@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 0_zK_q747rJeKqBz6JTdcju-4GBfkeSBHo9Ob9dm0lY_1744188373 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: S7APIQPXXGXDSR6NIHWPZ6IFI4XKTASJ X-Message-ID-Hash: S7APIQPXXGXDSR6NIHWPZ6IFI4XKTASJ X-MailFrom: kshcheti@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: Kirill Shchetiniuk X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: From: Kirill Shchetiniuk via Devel Reply-To: Kirill Shchetiniuk X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1744188399141019000 Content-Type: text/plain; charset="utf-8"; x-default="true" When the new storage was created using virsh with --validate option following errors occurred: # virsh vol-create default --file vol-def.xml --validate error: Failed to create vol from vol-def.xml error: unsupported flags (0x4) in function virStorageVolDefParseXML and after virStorageVolDefParse fix: # virsh vol-create default --file vol-def.xml --validate error: Failed to create vol from vol-def.xml error: unsupported flags (0x4) in function storageBackendCreateQemuImg Clear the VIR_VOL_XML_PARSE_VALIDATE flag before virStorageVolDefParseXML() and the VIR_STORAGE_VOL_CREATE_VALIDATE before backend->buildVol() (traces down to storageBackendCreateQemuImg) calls, as the XML schema validation is already complete within previous steps and there is no validation later. Signed-off-by: Kirill Shchetiniuk --- src/conf/storage_conf.c | 2 ++ src/storage/storage_driver.c | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index 68842004b7..3bbd727eb7 100644 --- a/src/conf/storage_conf.c +++ b/src/conf/storage_conf.c @@ -1409,6 +1409,8 @@ virStorageVolDefParse(virStoragePoolDef *pool, "volume", &ctxt, "storagevol.rng", validate))) return NULL; =20 + flags &=3D ~(VIR_VOL_XML_PARSE_VALIDATE); + return virStorageVolDefParseXML(pool, ctxt, flags); } =20 diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c index 86c03762d2..2f5a26bbef 100644 --- a/src/storage/storage_driver.c +++ b/src/storage/storage_driver.c @@ -1877,6 +1877,7 @@ storageVolCreateXML(virStoragePoolPtr pool, virStorageVolPtr vol =3D NULL, newvol =3D NULL; g_autoptr(virStorageVolDef) voldef =3D NULL; unsigned int parseFlags =3D VIR_VOL_XML_PARSE_OPT_CAPACITY; + unsigned int buildFlags =3D flags; =20 virCheckFlags(VIR_STORAGE_VOL_CREATE_PREALLOC_METADATA | VIR_STORAGE_VOL_CREATE_VALIDATE, NULL); @@ -1953,7 +1954,8 @@ storageVolCreateXML(virStoragePoolPtr pool, voldef->building =3D true; virObjectUnlock(obj); =20 - buildret =3D backend->buildVol(obj, buildvoldef, flags); + buildFlags &=3D ~(VIR_STORAGE_VOL_CREATE_VALIDATE); + buildret =3D backend->buildVol(obj, buildvoldef, buildFlags); =20 VIR_FREE(buildvoldef); =20 --=20 2.48.1