From nobody Mon May 6 17:55:15 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; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1536589879371455.0772948819615; Mon, 10 Sep 2018 07:31:19 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8BC3C308AA0F; Mon, 10 Sep 2018 14:31:16 +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 8D51A3001A49; Mon, 10 Sep 2018 14:31:15 +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 002AC1809545; Mon, 10 Sep 2018 14:31:11 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w8AEVAvb003315 for ; Mon, 10 Sep 2018 10:31:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2B51F600CD; Mon, 10 Sep 2018 14:31:10 +0000 (UTC) Received: from mx1.redhat.com (ext-mx09.extmail.prod.ext.phx2.redhat.com [10.5.110.38]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2406A600CC for ; Mon, 10 Sep 2018 14:31:10 +0000 (UTC) Received: from mail-wm0-f53.google.com (mail-wm0-f53.google.com [74.125.82.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DD0028CCF for ; Mon, 10 Sep 2018 14:31:08 +0000 (UTC) Received: by mail-wm0-f53.google.com with SMTP id f21-v6so21795224wmc.5 for ; Mon, 10 Sep 2018 07:31:08 -0700 (PDT) Received: from rolandPC.redhat.com ([213.175.37.12]) by smtp.gmail.com with ESMTPSA id x125-v6sm14903339wmg.27.2018.09.10.07.31.05 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 10 Sep 2018 07:31:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=C4kxSbhmf9LTcbFSbIujRO+9AiT9s0vhxQgXY7CrQVM=; b=X5J0QI2vUkqiMahxhn+f6gJUTolQMnzUcdf2EOmdSGOplZYPJ/+pWoEwuC4nsMj6cD rFZvOOe0maIX3y3IioEomwOi8RClFRYRme6p1xJUNvT6tmzzimugzrodaAjJAn6YCobq BI/B6qlOwa14HR4HqmrSryBSixaUj4nfUvQCPJxDCGFFgQflilTkzeRH0uD7seGux+xe ojgdBmOosKpSVtUWZYL/qpgbDEUSchgKDy6cBQchWnMXk641luJ+sx2Fi/Z3SYIw9ERB CKVfJQkWUiI/psACUvo5NYAFrL7GMV5gR7HezxH2G2tkiR1srbmoY15/IZcJfSwpZvCd 7Jjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=C4kxSbhmf9LTcbFSbIujRO+9AiT9s0vhxQgXY7CrQVM=; b=qbVMfg90PzZHGcOL5liPD2qvODgNheJJz2mZsqR8k9AQCsrQHMlWnTYae+uQ7KOtl5 /cXKZx0pGTwKq51fvoZT+Sw5bICvrsLfwfoRMisy+A+8o7H/54m07kLDsTKdpE0VLNKk GaLOQ70OyEaLTDl0bxCZS2Ofzv8OYzEXf2afBVJBV35vaM2NENG9lmfepzlPZelL9lDO PnqU1Bi5g1uSt37GWt7Hw2Cgk+oYaaxNPI53M0MusJ+kI6ncPiodKFVMIYoGenEj+lya 7Ez9inIVgk//IUcFgRxzLSZr+nh7mfJ5Wnn9poAe40duuspgGinI4Ac3BjkNsQwzgr7I vmMA== X-Gm-Message-State: APzg51CGQpPHD96Lr29YjD0bmTXwfkOa6uTXWk1r9d9bd+zQ/0zcc498 BhzmAQwqjSt2X/c9uy3a7YsseIBT X-Google-Smtp-Source: ANB0VdY3/pDVGxDqXntQd0gxBjuOAR6fSdD1GFq/X9fFfBsQ2uD9t4RRVwFCaZ5bg1rBBOTKHR9WKg== X-Received: by 2002:a1c:7f93:: with SMTP id a141-v6mr889700wmd.45.1536589867178; Mon, 10 Sep 2018 07:31:07 -0700 (PDT) From: Roland Schulz To: libvir-list@redhat.com Date: Mon, 10 Sep 2018 16:30:59 +0200 Message-Id: <20180910143059.11167-1-schullzroll@gmail.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 10 Sep 2018 14:31:09 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 10 Sep 2018 14:31:09 +0000 (UTC) for IP:'74.125.82.53' DOMAIN:'mail-wm0-f53.google.com' HELO:'mail-wm0-f53.google.com' FROM:'schullzroll@gmail.com' RCPT:'' X-RedHat-Spam-Score: -0.108 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_PASS) 74.125.82.53 mail-wm0-f53.google.com 74.125.82.53 mail-wm0-f53.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.38 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] qemu: check for vhostusers bandwidth 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: , MIME-Version: 1.0 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.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Mon, 10 Sep 2018 14:31:17 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDMRC_1 RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" https://bugzilla.redhat.com/show_bug.cgi?id=3D1524230 Signed-off-by: Roland Schulz --- src/qemu/qemu_command.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index ff9589f593..284c2709fc 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -8244,6 +8244,8 @@ qemuBuildVhostuserCommandLine(virQEMUDriverPtr driver, virQEMUCapsPtr qemuCaps, unsigned int bootindex) { + virNetDevBandwidthPtr actualBandwidth =3D virDomainNetGetActualBandwid= th(net); + virDomainNetType actualType =3D virDomainNetGetActualType(net); virQEMUDriverConfigPtr cfg =3D virQEMUDriverGetConfig(driver); char *chardev =3D NULL; char *netdev =3D NULL; @@ -8257,6 +8259,19 @@ qemuBuildVhostuserCommandLine(virQEMUDriverPtr drive= r, goto cleanup; } =20 + /* Set bandwidth or warn if requested and not supported. */ + if (actualBandwidth) { + if (virNetDevSupportBandwidth(actualType)) { + if (virNetDevBandwidthSet(net->ifname, actualBandwidth, false, + !virDomainNetTypeSharesHostView(net)= ) < 0) + goto cleanup; + } else { + VIR_WARN("setting bandwidth on interfaces of " + "type '%s' is not implemented yet", + virDomainNetTypeToString(actualType)); + } + } + switch ((virDomainChrType)net->data.vhostuser->type) { case VIR_DOMAIN_CHR_TYPE_UNIX: if (!(chardev =3D qemuBuildChrChardevStr(logManager, secManager, --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list