From nobody Sun Apr 28 14:39:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1556269870; cv=none; d=zoho.com; s=zohoarc; b=dd4D6ZfAQPKu7QDImlSpp5mObdTW0Phmxgq0MpgcTh029JPmxG453vL4zUZPteMUDClwG57Vw+KW7A/fGYmKCeHONZVQa7ij/CT8GlleQhUxtPqgD6jLdxgJjdEA3QKLcptGYPErHLycj2rB0Cv+ZgvvOQUYgEr7JH1ahkbXVkg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1556269870; 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:ARC-Authentication-Results; bh=i6GKTVuDGId7yLcVdA8xF5t2QhbOKKCdcMTkXSqL6jM=; b=R8io6mG2pVFRIq70CKTuIWn3qpSfW4wsF1uQDkid7ADmt/uhVPCX1rMECA0Ds2coX15sNWSG+fZHGe++vee5lz1Ez2zZH2UmjOUfjK5PlrsafTVM3HRrB4F0bzNQWA4q5KuTiN7pU1CO3S4w8WMCwh4YOivdjheaFpn+GE5zhLk= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1556269870666441.3289270719473; Fri, 26 Apr 2019 02:11:10 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 12C763082230; Fri, 26 Apr 2019 09:11:09 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CB1AF277A2; Fri, 26 Apr 2019 09:11:08 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 72ABD181AC90; Fri, 26 Apr 2019 09:11:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x3Q9B6em002796 for ; Fri, 26 Apr 2019 05:11:06 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9BD3E177F8; Fri, 26 Apr 2019 09:11:06 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 253ED5C1A1 for ; Fri, 26 Apr 2019 09:11:05 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Fri, 26 Apr 2019 11:11:00 +0200 Message-Id: <555512f3f7b8ae92fc00e016ac55da7f693bdb1b.1556269593.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/2] conf: Parse bandwidth.floor for interface type='bridge' too X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Fri, 26 Apr 2019 09:11:09 +0000 (UTC) Content-Type: text/plain; charset="utf-8" When users want to update an interface of a running domain, they are supposed to take whatever XML 'virsh dumpxml' produces, do all the tweaks and feed libvirt back with the new XML. This is exactly how 'virsh domif-setlink' works. Except after 518026e1595 an interface type=3D'network' will become type=3D'bridge' in live XML. And if the interface has some bandwidth with floor set we fail to parse it because floor is allowed only for type network. Signed-off-by: Michal Privoznik --- src/conf/domain_conf.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 6331424635..e23ea7a939 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -11631,9 +11631,10 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlo= pt, goto error; } } else if (virXMLNodeNameEqual(cur, "bandwidth")) { - if (virNetDevBandwidthParse(&def->bandwidth, - cur, - def->type =3D=3D VIR_DOMAIN_NE= T_TYPE_NETWORK) < 0) + bool allowFloor =3D + def->type =3D=3D VIR_DOMAIN_NET_TYPE_NETWORK || + def->type =3D=3D VIR_DOMAIN_NET_TYPE_BRIDGE; + if (virNetDevBandwidthParse(&def->bandwidth, cur, allowFlo= or) < 0) goto error; } else if (virXMLNodeNameEqual(cur, "vlan")) { if (virNetDevVlanParse(cur, ctxt, &def->vlan) < 0) --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun Apr 28 14:39:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1556269912; cv=none; d=zoho.com; s=zohoarc; b=Qe1UA6IgEZiMGTGxO6JGS1UPv+03G54IVf05EaFGXcuP32BKQsOp0JzgKiaEEFsMNcpwtMNsoHlCF8r9Q3B5BQfQN0mCOU6BJpmKrUyM9dlDPf4WgHqdGInsN2JzH2raMoSxgdm9Mygj5LESBwx5G4VoMVdTkM/oad81+cLQd7o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1556269912; 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:ARC-Authentication-Results; bh=/ay+hPwrXnAAa1ueQMKy+p7vJYmVyopfPFCcYWONOr4=; b=em2J8ndDQK3y/fOFuboPGq2TWr1WJll16drQJ+hsddZkx/2we27/Xl0isLAQ06nYfn/197LMXiaXzgEuPZHIVTGETRGSh/yqp1MMHgh9oPj9MfyWh5IOQW8Yr3+2CkkJ5uSMf9qRceeo0Zk0RqB9bclzZpN5vglDY5l0FVVqyGM= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1556269912497978.635774843778; Fri, 26 Apr 2019 02:11:52 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 00594C00C7DD; Fri, 26 Apr 2019 09:11:51 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C6D9E1001E92; Fri, 26 Apr 2019 09:11:50 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 81A843FB15; Fri, 26 Apr 2019 09:11:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x3Q9B7Zn002804 for ; Fri, 26 Apr 2019 05:11:07 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6AD2F177F8; Fri, 26 Apr 2019 09:11:07 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id E8D8A5C1A1 for ; Fri, 26 Apr 2019 09:11:06 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Fri, 26 Apr 2019 11:11:01 +0200 Message-Id: <4902b169d85eae29987f76bf93c561080499106d.1556269593.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/2] qemu: Relax interface type change check when changing an interface X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 26 Apr 2019 09:11:51 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Then changing some runtime knobs for an interface the qemuDomainChangeNet() is called. This does all kinds of checks to ensure that only supported changes are requested. There is one particular check which purpose is to make sure that interface type does not change. And even if it does, it's a change we can deal with. But since for a running domain any interface with type network becomes interface type bridge, this check fails and an error is reported. What we need to compare are actual types instead of configured ones. Fixes 518026e1595. Signed-off-by: Michal Privoznik --- src/qemu/qemu_hotplug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 630be12d54..ace171cd52 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -3966,7 +3966,7 @@ qemuDomainChangeNet(virQEMUDriverPtr driver, goto cleanup; } =20 - if (olddev->type =3D=3D newdev->type && oldType =3D=3D newType) { + if (oldType =3D=3D newType) { =20 /* if type hasn't changed, check the relevant fields for the type = */ switch (newdev->type) { --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list