From nobody Mon Apr 29 21:31:10 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1652249926; cv=none; d=zohomail.com; s=zohoarc; b=n8kzj9JDokufxh3ZprfyDG6Oa/RayznuVial89KHNOCSpzf5q+tcnbBe8uOZIwCmACySJ6vsPRfd0AhFeF1TpgWOIqJS+4/4osdQnJg+7Fv1MwE8Vw0qzWzKGtp+ylyzYvppBt21J/4h6LGZzZKIMbRP04NIdn2vZnwW5Ca9xBY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1652249926; h=Content-Type: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=ugwC7L8zOpoICRUAq0ML3NBh+wfgIi6IkP6eI7XTwhs=; b=aG++uiVX0xdtcXYqXNF/gMtfvt3mLdB70KIVzQb030Uus+D0yKLu7og33cNoxUtw4NF3h4ypS0CEVrqWg77hDsB86M0MUjRRJEeEHHb5LAvDmf0B4iIugTwVUuMf7RCnI7/YvQvkabSr0MlJpIwRIu4Bu0gYsR95Rn0oCzE+6Mc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1652249926275489.89967438838596; Tue, 10 May 2022 23:18:46 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-587-MyJfZZYBONew2KuPcUGKvQ-1; Wed, 11 May 2022 02:18:42 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7AE1D38C5C47; Wed, 11 May 2022 06:18:40 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1B01B2026D64; Wed, 11 May 2022 06:18:40 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id C7B8C1947046; Wed, 11 May 2022 06:18:39 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id DFA6F1947043 for ; Wed, 11 May 2022 06:18:38 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id AD574416385; Wed, 11 May 2022 06:18:38 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-13-149.pek2.redhat.com [10.72.13.149]) by smtp.corp.redhat.com (Postfix) with ESMTP id 37781401E9D; Wed, 11 May 2022 06:18:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652249925; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=ugwC7L8zOpoICRUAq0ML3NBh+wfgIi6IkP6eI7XTwhs=; b=exwqcXFt3geUdkB6vlAVMaZNvDb89QlAzS90u5UDnoGtDWK1bSAeI4JDoOCPk0B2TcNone wwn4wISDFidvGMcgUomBUO0vd8Leb/QRlRZAENIgn1VkJZGb+Ff88og73a/s2HICz4GRUg Qu+fucXR/uVyfpQ7H151nHuRLQU17KM= X-MC-Unique: MyJfZZYBONew2KuPcUGKvQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Han Han To: libvir-list@redhat.com Subject: [PATCH v2] virt-xml-validate: Add more XML formats support Date: Wed, 11 May 2022 14:18:32 +0800 Message-Id: <20220511061832.3561165-1-hhan@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Han Han Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1652249927141100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Add these XML formats validation in manpage or script: cpu, domainbackup, domaincaps, domaincheckpoint, networkport, storagepoolcaps. Signed-off-by: Han Han Reviewed-by: J=C3=A1n Tomko --- Diff from v1: Add domainbackup, domaincaps, networkport, storagepoolcaps v1: https://listman.redhat.com/archives/libvir-list/2021-November/225070.ht= ml --- docs/manpages/virt-xml-validate.rst | 24 ++++++++++++++++++++++++ tools/virt-xml-validate.in | 15 +++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/docs/manpages/virt-xml-validate.rst b/docs/manpages/virt-xml-v= alidate.rst index 940eada3a8..503ddbd35a 100644 --- a/docs/manpages/virt-xml-validate.rst +++ b/docs/manpages/virt-xml-validate.rst @@ -31,18 +31,42 @@ from the name of the root element in the XML document. =20 Valid schema names currently include =20 +- ``cpu`` + +The schema for the XML format of cpu + - ``domainsnapshot`` =20 The schema for the XML format used by domain snapshot configuration =20 +- ``domaincheckpoint`` + +The schema for the XML format used by domain checkpoint configuration + +- ``domainbackup`` + +The schema for the XML format used by domain backup configuration + +- ``domaincaps`` + +The schema for the XML format of domain capabilities + - ``domain`` =20 The schema for the XML format used by guest domains configuration =20 +- ``networkport`` + +The schema for the XML format used by network port configuration + - ``network`` =20 The schema for the XML format used by virtual network configuration =20 +- ``storagepoolcaps`` + +The schema for the XML format of storage pool capabilities + - ``storagepool`` =20 The schema for the XML format used by storage pool configuration diff --git a/tools/virt-xml-validate.in b/tools/virt-xml-validate.in index 249bcf7eef..e444ef2fbc 100644 --- a/tools/virt-xml-validate.in +++ b/tools/virt-xml-validate.in @@ -74,9 +74,21 @@ if [ -z "$TYPE" ]; then ROOT=3D`xmllint --stream --debug "$XMLFILE" 2>/dev/null | grep "^0 1 "= | awk '{ print $3 }'` fi case "$ROOT" in + *cpu*) + TYPE=3D"cpu" + ;; *domainsnapshot*) # Must come first, since *domain* is a substring TYPE=3D"domainsnapshot" ;; + *domaincheckpoint*) + TYPE=3D"domaincheckpoint" + ;; + *domainbackup*) + TYPE=3D"domainbackup" + ;; + *domaincaps*) + TYPE=3D"domaincaps" + ;; *domain*) TYPE=3D"domain" ;; @@ -86,6 +98,9 @@ if [ -z "$TYPE" ]; then *network*) TYPE=3D"network" ;; + *storagepoolcaps*) + TYPE=3D"storagepoolcaps" + ;; *pool*) TYPE=3D"storagepool" ;; --=20 2.36.0