From nobody Tue Dec 16 03:43:56 2025 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=1751904356; cv=none; d=zohomail.com; s=zohoarc; b=JCaXL8dQGiSU5I++5VWTTMcrzQXqu+ZjVQHL8H+6JkRi/6VdkioWKlzc+YcdEpJKjiJQd99qyca2yuOtqJ2A0dJQNTUv4kdb0ZPlbEEMKVoPr6Aoz1ejY4CsM7Mj5xqkDNomBnUE5OVtQpjr0EfrPyvrOTm0YQrzsBa5/k9lMiQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751904356; 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=/DvlEwnE/wxlWBX27gMz/in/ccBvMhr6tWsSedci3XA=; b=jvgEQIowKtFoCGGrTGf+bU39WGTf+BF6M7y2/G3dUrcO7QJf+rErhSPhWGD/1o+MjbIWfjY+Ckw1M9/qWG4vr5WAor2O8HrB57f9PIjrSP2F+nkZQMVz2KNfN0F56D71DnT55mJRpl4S81BVVOfzUDYDYJ8CxN5B4BB/G3/6OYk= 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 1751904356441738.753450822558; Mon, 7 Jul 2025 09:05:56 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 7A7BD14FC; Mon, 7 Jul 2025 12:05:55 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 3FBBF1375; Mon, 7 Jul 2025 12:04:50 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 960D91258; Mon, 7 Jul 2025 12:04:45 -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 20EB9BD5 for ; Mon, 7 Jul 2025 12:04:45 -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-462-im_WxTeNPEKZ18r3arJrhw-1; Mon, 07 Jul 2025 12:04:43 -0400 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (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 F2C7B1800287 for ; Mon, 7 Jul 2025 16:04:42 +0000 (UTC) Received: from kshcheti-thinkpadp1gen4i.tpbc.csb (unknown [10.43.2.22]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 07C9D1956087; Mon, 7 Jul 2025 16:04:41 +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=-1.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=1751904284; 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=uXZjcrH/Hw9x97pi6LYKThAkWPYGamkBHiWr/HsjUak=; b=Fj1Fe5I8koLhTN535zWqw9ozgAjCbO3zVE5oZre13To5lZ3YX2a4dh8fzorXHVlJ3l51e9 0a7oJhL6XK7nGkCBQezsLVVFdrPeA/MugxozVDyw4VhtnxzavHnJ+pMo0HhnNqQujKmXh2 QppDUn4Abi/aUrsUwzqrc+74FIA+ELU= X-MC-Unique: im_WxTeNPEKZ18r3arJrhw-1 X-Mimecast-MFC-AGG-ID: im_WxTeNPEKZ18r3arJrhw_1751904283 To: devel@lists.libvirt.org Subject: [PATCH 2/5] conf: virDomainHostdevSubsysMediatedDevDefParseXML refactor Date: Mon, 7 Jul 2025 18:03:47 +0200 Message-ID: <20250707160426.184333-3-kshcheti@redhat.com> In-Reply-To: <20250707160426.184333-1-kshcheti@redhat.com> References: <20250707160426.184333-1-kshcheti@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: OwutgNT27879z36scwdLqURTx9ksghZykPQH-QfXkfA_1751904283 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: PWMJW2PBPFNSGJ7E2GEKUO4UPR43CIG2 X-Message-ID-Hash: PWMJW2PBPFNSGJ7E2GEKUO4UPR43CIG2 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: 1751904358559116600 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Kirill Shchetiniuk Refactored the virDomainHostdevSubsysMediatedDevDefParseXML function to use virXMLPropUUID fuction instead of getting a string and parsing it later. Due to parsing function change the missing uuid error reporter and message were changed and changed error message was also reflected in tests' outputs. Signed-off-by: Kirill Shchetiniuk Reviewed-by: J=C3=A1n Tomko --- src/conf/domain_conf.c | 13 +------------ ...stdev-mdev-src-address-invalid.x86_64-latest.err | 2 +- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 1e24e41a48..bfc62b6270 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -6348,7 +6348,6 @@ virDomainHostdevSubsysMediatedDevDefParseXML(virDomai= nHostdevDef *def, unsigned char uuid[VIR_UUID_BUFLEN] =3D {0}; xmlNodePtr node =3D NULL; virDomainHostdevSubsysMediatedDev *mdevsrc =3D &def->source.subsys.u.m= dev; - g_autofree char *uuidxml =3D NULL; =20 if (!(node =3D virXPathNode("./source/address", ctxt))) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", @@ -6356,18 +6355,8 @@ virDomainHostdevSubsysMediatedDevDefParseXML(virDoma= inHostdevDef *def, return -1; } =20 - if (!(uuidxml =3D virXMLPropString(node, "uuid"))) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("Missing 'uuid' attribute for element
")= ); - return -1; - } - - if (virUUIDParse(uuidxml, uuid) < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, - "%s", - _("Cannot parse uuid attribute of element
= ")); + if (virXMLPropUUID(node, "uuid", VIR_XML_PROP_REQUIRED, uuid) < 0) return -1; - } =20 virUUIDFormat(uuid, mdevsrc->uuidstr); return 0; diff --git a/tests/qemuxmlconfdata/hostdev-mdev-src-address-invalid.x86_64-= latest.err b/tests/qemuxmlconfdata/hostdev-mdev-src-address-invalid.x86_64-= latest.err index 20a91e7fa6..29dfbfb1ce 100644 --- a/tests/qemuxmlconfdata/hostdev-mdev-src-address-invalid.x86_64-latest.= err +++ b/tests/qemuxmlconfdata/hostdev-mdev-src-address-invalid.x86_64-latest.= err @@ -1 +1 @@ -unsupported configuration: Missing 'uuid' attribute for element
+XML error: Missing required attribute 'uuid' in element 'address' --=20 2.49.0