From nobody Sun Feb 8 20:17:32 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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.133.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=1663577826; cv=none; d=zohomail.com; s=zohoarc; b=Ii0vyJLB1qJJVhL1FWlDp2zbSN8nfD1yqZniYx7u7OblJFv0TA4h+jxJ4apTWDwbr5B5ua2ieYUtHggjgZPpLY/g2WSpx2WTm1HT2shJSdWBA+yyMlPs8uEwXVR/J7KMEcxMYMn2Kc7S/q07cnZOqCwImhouN4t72pZuGJwPAyc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663577826; 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=i1W8uGO9yBpDd32RTHPNpO7CmrKpu+XS6OTnzwIH1vw=; b=iLFHAQctQH+WZIgf1y6BAvjpupYaE2d+5SssS9q/LUVa5IoOz9GrLI8B67nuV2LpEMTlN5/4rldUJzmmy4DYsXoPgONj04WF7lZ2yuF/5E4oIyJRI1GQhiLmX5owQWG75TjRg+ztoyMEiqIIJo7TUa7bFSY69IEp0vN7Th0Uhl4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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.133.124]) by mx.zohomail.com with SMTPS id 1663577826964866.4184529772549; Mon, 19 Sep 2022 01:57:06 -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-288-KpcMG4IoNHyx3kwg7GXDSw-1; Mon, 19 Sep 2022 04:55:48 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 59A0829ABA0C; Mon, 19 Sep 2022 08:55:46 +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 473F323177; Mon, 19 Sep 2022 08:55:46 +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 3AA181946597; Mon, 19 Sep 2022 08:55:46 +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 28BB119465A0 for ; Mon, 19 Sep 2022 08:55:45 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 12DA740C6EC4; Mon, 19 Sep 2022 08:55:45 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7BF1B40C6EC2 for ; Mon, 19 Sep 2022 08:55:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663577826; 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=i1W8uGO9yBpDd32RTHPNpO7CmrKpu+XS6OTnzwIH1vw=; b=HjeVkMgXbW8OunI1ibfAeplziQTIYIwQ1ffqVwMzoxTFNXqLnRulGrez9HjiSr5yXjE/ax rTHYXyrWONknD5VoTqqw7PqPuJVlREBMp0XKTGPggnDAa2nG/WZHVeg89JCfjxhz5lHarf lUOmIl5yKTUi81QrkDCjRNQMRuH8/mc= X-MC-Unique: KpcMG4IoNHyx3kwg7GXDSw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 23/37] virDomainNetDefParseXML: Extract network device model earlier Date: Mon, 19 Sep 2022 10:55:08 +0200 Message-Id: <360e2ff964c49b2c7c25510605b25e5d0eea5611.1663577578.git.pkrempa@redhat.com> 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.5 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: 1663577827755100008 Content-Type: text/plain; charset="utf-8" Move the code fetching the model of the net device before the main code parsing individual device types so that the data is available before the upcoming refactor. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/conf/domain_conf.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 77d3ef564e..35843f6b72 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -9019,6 +9019,10 @@ virDomainNetDefParseXML(virDomainXMLOption *xmlopt, &def->trustGuestRxFilters) < 0) return NULL; + if ((model =3D virXPathString("string(./model/@type)", ctxt)) && + virDomainNetSetModelString(def, model) < 0) + return NULL; + if ((source_node =3D virXPathNode("./source", ctxt))) { if (virDomainNetIPInfoParseXML(_("interface host IP"), source_node= , ctxt, &def->hostIP) < 0) return NULL; @@ -9202,7 +9206,6 @@ virDomainNetDefParseXML(virDomainXMLOption *xmlopt, def->script =3D virXPathString("string(./script/@path)", ctxt); def->downscript =3D virXPathString("string(./downscript/@path)", ctxt); def->domain_name =3D virXPathString("string(./backenddomain/@name)", c= txt); - model =3D virXPathString("string(./model/@type)", ctxt); if ((filterref_node =3D virXPathNode("./filterref", ctxt))) { filter =3D virXMLPropString(filterref_node, "filter"); @@ -9258,10 +9261,6 @@ virDomainNetDefParseXML(virDomainXMLOption *xmlopt, return NULL; } - if (model !=3D NULL && - virDomainNetSetModelString(def, model) < 0) - return NULL; - switch (def->type) { case VIR_DOMAIN_NET_TYPE_NETWORK: break; --=20 2.37.1