From nobody Fri Dec 19 06:01:15 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1602708300; cv=none; d=zohomail.com; s=zohoarc; b=S3uDXG8GSvV8+yywpKK5m9ezyLU9b/GE5o4zal7MNksplSjjkhpDWSh5o3f7dFBS1IXL46nqlsXn97149oIzwU2aGsYdxgUOhdyu95G7nFPhiv2ih61PAtG2Z1KPlbvJ0rZ382YV4Irl5vIXTOCL2cS3NHmjI7jmm29ddi+3Or8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602708300; h=Content-Type:Content-Transfer-Encoding:Cc: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=nHbu/nqQ9a+ABIX4cn79AHBPd6SS9iOnS4MoseqZ9M0=; b=fBCWRVwOgIMrjSgoqVYph2RMKASUnOV7aZf2Z3lfMU4ITI69Yqi6PibnheNFcLMi3b/FUgYJfA6IBdCLYAkPvUQF4jJ5jYqTiw5o+/U+p72xJlVDhfoid4SgyO5M0bLmEL8Z8kQgVrJb85CjlB4yk3+qMSKfoA+uRuqiqu2JipM= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1602708300672801.0573998258404; Wed, 14 Oct 2020 13:45:00 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-499-xPYmoV4wPaSbhN0GzehOvA-1; Wed, 14 Oct 2020 16:44:57 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3D7D8107B478; Wed, 14 Oct 2020 20:44:50 +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 16F145577F; Wed, 14 Oct 2020 20:44: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 CFBA492F38; Wed, 14 Oct 2020 20:44:49 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 09EKheP4028709 for ; Wed, 14 Oct 2020 16:43:40 -0400 Received: by smtp.corp.redhat.com (Postfix) id 625B22166BB3; Wed, 14 Oct 2020 20:43:40 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5D3812166B27 for ; Wed, 14 Oct 2020 20:43:40 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4317D1021F73 for ; Wed, 14 Oct 2020 20:43:40 +0000 (UTC) Received: from mail-il1-f193.google.com (mail-il1-f193.google.com [209.85.166.193]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-3-EAB7nvXuOm-HWV8HHduwIg-1; Wed, 14 Oct 2020 16:43:37 -0400 Received: by mail-il1-f193.google.com with SMTP id r10so1014082ilm.11 for ; Wed, 14 Oct 2020 13:43:37 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c6:5a9b:54fc:df2a:8a5e:989b]) by smtp.gmail.com with ESMTPSA id i4sm492202ilc.27.2020.10.14.13.43.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Oct 2020 13:43:36 -0700 (PDT) X-MC-Unique: xPYmoV4wPaSbhN0GzehOvA-1 X-MC-Unique: EAB7nvXuOm-HWV8HHduwIg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nHbu/nqQ9a+ABIX4cn79AHBPd6SS9iOnS4MoseqZ9M0=; b=tWB/Rvn0HKutCBXOy8cwBLYNe86fN/kCel0XCYZwe4gwadQ5EcL78Knhzhbkw72Q68 dpLU54/vjCyh/NxcLSxQADolBmg6xS4rpIvSN3xTf6NslR7cwYTs6M18PKuV4ZcucXmk CJRbFweNBy9aCGhOuK+3yuYSorWgjrxlci8pd1y/Lzugzgs8CrQ1gV/PunCMWUN3xyOr vS3Un7EC2dc4ItigOlJtNJ4w0EQlkBPaa/JXA0iSWZM8+IEvMzz1WZzcl2LCJTH9yBtN LGm2SSOqGgSbiQOSUiMuX3PY51ah8kT5q7orsQGhzWjnMwgY1++sp3/mus1z00ml/gR2 tw1w== X-Gm-Message-State: AOAM530xZQvFvRSi4XyVLf7JVZpiZer6V+a4b94LKoaIT1IQJGIoVFu+ KLCeeVuHKj5eefC4v+jPQvtlupLbKMc= X-Google-Smtp-Source: ABdhPJyw4gvrN+whB/wrwvyRPk2Lk+yefsqozfvKRN23VzQAXxrw80I5wtz83tGX5AVGkxsVMvXhSg== X-Received: by 2002:a92:8404:: with SMTP id l4mr880121ild.134.1602708216626; Wed, 14 Oct 2020 13:43:36 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH v1 10/24] qemu_command.c: move QEMU_CAPS_VIRTIO_NET_HOST_MTU check to qemu_validate.c Date: Wed, 14 Oct 2020 17:42:53 -0300 Message-Id: <20201014204307.631746-11-danielhb413@gmail.com> In-Reply-To: <20201014204307.631746-1-danielhb413@gmail.com> References: <20201014204307.631746-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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 Content-Type: text/plain; charset="utf-8" Signed-off-by: Daniel Henrique Barboza --- src/qemu/qemu_command.c | 9 ++------- src/qemu/qemu_validate.c | 8 ++++++++ tests/qemuxml2xmltest.c | 2 +- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 9f45faa490..62b8df1a13 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3408,14 +3408,9 @@ qemuBuildNicDevStr(virDomainDefPtr def, if (usingVirtio && net->driver.virtio.tx_queue_size) virBufferAsprintf(&buf, ",tx_queue_size=3D%u", net->driver.virtio.= tx_queue_size); =20 - if (usingVirtio && net->mtu) { - if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_NET_HOST_MTU)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("setting MTU is not supported with this QEMU = binary")); - return NULL; - } + if (usingVirtio && net->mtu) virBufferAsprintf(&buf, ",host_mtu=3D%u", net->mtu); - } + if (usingVirtio && net->teaming.type =3D=3D VIR_DOMAIN_NET_TEAMING_TYP= E_PERSISTENT) virBufferAddLit(&buf, ",failover=3Don"); =20 diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 9623ebed96..ebc70aaf00 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -1277,6 +1277,14 @@ qemuValidateDomainDeviceDefNetwork(const virDomainNe= tDef *net, return -1; } =20 + if (net->mtu && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_NET_HOST_MTU)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("setting MTU is not supported with this " + "QEMU binary")); + return -1; + } + if (net->driver.virtio.rx_queue_size & (net->driver.virtio.rx_queu= e_size - 1)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("rx_queue_size has to be a power of two")); diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index e85f2188db..a9037101de 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -499,7 +499,7 @@ mymain(void) DO_TEST("watchdog", NONE); DO_TEST("net-bandwidth", QEMU_CAPS_DEVICE_VGA, QEMU_CAPS_VNC); DO_TEST("net-bandwidth2", QEMU_CAPS_DEVICE_VGA, QEMU_CAPS_VNC); - DO_TEST("net-mtu", NONE); + DO_TEST("net-mtu", QEMU_CAPS_VIRTIO_NET_HOST_MTU); DO_TEST("net-coalesce", NONE); DO_TEST("net-many-models", NONE); =20 --=20 2.26.2