From nobody Sun Feb 8 18:24:13 2026 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=1663577756; cv=none; d=zohomail.com; s=zohoarc; b=Ymr163ET6bywcPdOsSwnKwpEEQLM9So7TdxIBQzxs3cCaix9I1d9Z9DkLBO3U0jSBPRXcBkj++Y8EnvgzwnRyHUYO1CtWCgrrZcMb5Z2wRgy1dnJUAucVg02pBteSI83VgTGajymdCcy419/Tt27B5a5xBqpK1lyMz3rFZx8z6c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663577756; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=SYlntpndpODA08QKg5B/gkI6pmBwtZzmdSWCoN0hC8I=; b=kJOYkBiJaBChWSkRhyGUJUmlwm5vY31GWQe8ccumL5ddANsmp+YWn6LeYUC88xBCyCWMjBT4a1iZi7vKn3OyJ9dJsYm6H1Bo3Wmt20cWbBe/x5SXu9m2ZXOjHkzvQx0wqc+eB5OyLLBnKlnXF956djY8l6oiaXfLCTNMj6vKrxs= 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 1663577756876348.31186407630287; Mon, 19 Sep 2022 01:55:56 -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-529-Idb7wLAUOmupeOKellQGAA-1; Mon, 19 Sep 2022 04:55:52 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2908129ABA05; Mon, 19 Sep 2022 08:55:50 +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 D70874A9254; Mon, 19 Sep 2022 08:55:49 +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 C14321946595; Mon, 19 Sep 2022 08:55:49 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id DE53E19465A4 for ; Mon, 19 Sep 2022 08:55:47 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id CED8140C6EC3; Mon, 19 Sep 2022 08:55:47 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4FC4440C6EC2 for ; Mon, 19 Sep 2022 08:55:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663577755; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=SYlntpndpODA08QKg5B/gkI6pmBwtZzmdSWCoN0hC8I=; b=QySzIYdP1VGR3qpwNKrkGXzMiA9Nebt/s+ff2VaaO6f4oilP7xSyyaDDL85E63bLl7LwZG 4JGclhgO0DDHZrbnqFpEhPcIwUrwz/lwMYEJVGVuj4k95JDtZKSxeCmIIAAuEpMZ1Wleaz ZVJEkoa6ZkLHXTy6ZVyhXW/M0UraSmM= X-MC-Unique: Idb7wLAUOmupeOKellQGAA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 26/37] virDomainNetDefParseXML: Refactor parsing of data for VIR_DOMAIN_NET_TYPE_VDPA Date: Mon, 19 Sep 2022 10:55:11 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 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: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 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: 1663577757140100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/conf/domain_conf.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index b41e1644a5..c14f3f2910 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -9188,9 +9188,11 @@ virDomainNetDefParseXML(virDomainXMLOption *xmlopt, break; case VIR_DOMAIN_NET_TYPE_VDPA: - if (source_node) { - dev =3D virXMLPropString(source_node, "dev"); - } + if (virDomainNetDefParseXMLRequireSource(def, source_node) < 0) + return NULL; + + if (!(def->data.vdpa.devicepath =3D virXMLPropStringRequired(sourc= e_node, "dev"))) + return NULL; break; case VIR_DOMAIN_NET_TYPE_CLIENT: @@ -9331,15 +9333,6 @@ virDomainNetDefParseXML(virDomainXMLOption *xmlopt, break; case VIR_DOMAIN_NET_TYPE_VDPA: - if (dev =3D=3D NULL) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("No 'dev' attribute " - "specified with ")); - return NULL; - } - def->data.vdpa.devicepath =3D g_steal_pointer(&dev); - break; - case VIR_DOMAIN_NET_TYPE_BRIDGE: break; --=20 2.37.1