From nobody Fri May 10 05:13:50 2024 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=1653319392; cv=none; d=zohomail.com; s=zohoarc; b=HDBBgRTGUF5PPKEIeWym/h2O/UR60bnn4oR774XjLUmMEeGm7iFj+xaQYotHjuw+txjK4tjEUz4+vziz4tjolpIOVpkJ/W97l1E6Ygaszz8OqIQYqSW2xyk1kSpyRW5GZWAbr1h9Ga2oxFdzHdwJ8jAKsoS+fqh9Av0NGZsVLAI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1653319392; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=QJ64OyNxbcXX6JigvDIqmZjdJQ7f1olUuQ8H1tllsyw=; b=NndCnS0QdJcjFVA2myUdefY19H49NsNigHV0r9D3lfhNSzF401unUtiCoZiNxX1B/fjAu/JTS8afRiANnU2JsO++t6LrLSk3GzuXDMMcH+bgvQdGXV8pO2NSspJCs8Oa/8CI88qMqb9aYokXIqTIch7RoxY2ZgzUXiG+qsZZWFU= 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 1653319392984737.2742864917968; Mon, 23 May 2022 08:23:12 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-62-p3WWpMR1P2ygXM0-Lg7MAw-1; Mon, 23 May 2022 11:23:08 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1031619705AA; Mon, 23 May 2022 15:23:06 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4843E40CFD00; Mon, 23 May 2022 15:23:05 +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 E0831194705A; Mon, 23 May 2022 15:23:04 +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 9F8C01947059 for ; Mon, 23 May 2022 15:23:03 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 77B49401E3B; Mon, 23 May 2022 15:23:03 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1FA95492C14 for ; Mon, 23 May 2022 15:23:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1653319392; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=QJ64OyNxbcXX6JigvDIqmZjdJQ7f1olUuQ8H1tllsyw=; b=ThwOlWAkHm31qYUAGQM+Qpddd9ir9xUz4rYfPXP4Bgc9vyLFXA20hpxgW+VqD+Gpm4oRMz /1brOJ5+sEWYMn8Fi7924tZ2pjrIinRlJOBtA1sFpXiMGRqeamMhWzcCZofT46zcSxZ7LT G2oL/SD/4F1ctgci10UBQOZ7RbqTrT4= X-MC-Unique: p3WWpMR1P2ygXM0-Lg7MAw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH] qemu_hotplug: Deny changing @rss and @rss_hash_report attributes of virtio vNICs Date: Mon, 23 May 2022 17:22:44 +0200 Message-Id: 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: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 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: 1653319393303100001 Content-Type: text/plain; charset="utf-8"; x-default="true" We have virDomainUpdateDeviceFlags() API that allows changing of some attributes of a device whilst domain is still running (e.g. setting different QoS, link state change on vNICs). But only very limited set of attributes can be changed and we have to check whether user isn't trying to sneak in a change that's not allowed. Well, in case of a virtio vNIC we forgot to check for @rss and @rss_hash_report attributes of . Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D2082540 Signed-off-by: Michal Privoznik Reviewed-by: Laine Stump --- src/qemu/qemu_hotplug.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 24df66cc9f..f795568299 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -3662,7 +3662,9 @@ qemuDomainChangeNet(virQEMUDriver *driver, olddev->driver.virtio.guest.tso4 !=3D newdev->driver.virtio.guest= .tso4 || olddev->driver.virtio.guest.tso6 !=3D newdev->driver.virtio.guest= .tso6 || olddev->driver.virtio.guest.ecn !=3D newdev->driver.virtio.guest.= ecn || - olddev->driver.virtio.guest.ufo !=3D newdev->driver.virtio.guest.= ufo)) { + olddev->driver.virtio.guest.ufo !=3D newdev->driver.virtio.guest.= ufo || + olddev->driver.virtio.rss !=3D newdev->driver.virtio.rss || + olddev->driver.virtio.rss_hash_report !=3D newdev->driver.virtio.= rss_hash_report)) { virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", _("cannot modify virtio network device driver attri= butes")); goto cleanup; --=20 2.35.1