From nobody Fri May 3 00:31:35 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=fail(p=none dis=none) header.from=virtuozzo.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 151984610890524.56857465139035; Wed, 28 Feb 2018 11:28:28 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CF84A28221; Wed, 28 Feb 2018 19:28:26 +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 DCB956018B; Wed, 28 Feb 2018 19:28:25 +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 CE30B18033EB; Wed, 28 Feb 2018 19:28:23 +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 w1SJPAKY029873 for ; Wed, 28 Feb 2018 14:25:11 -0500 Received: by smtp.corp.redhat.com (Postfix) id C02CE620B2; Wed, 28 Feb 2018 19:25:10 +0000 (UTC) Received: from mx1.redhat.com (ext-mx10.extmail.prod.ext.phx2.redhat.com [10.5.110.39]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BB7EE60476 for ; Wed, 28 Feb 2018 19:25:08 +0000 (UTC) Received: from relay.sw.ru (relay.sw.ru [185.231.240.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CF2CD61D07 for ; Wed, 28 Feb 2018 19:25:05 +0000 (UTC) Received: from mail.virtuozzo.com ([195.214.232.50]) by relay.sw.ru with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) (Exim 4.89) (envelope-from ) id 1er7Lb-0003SX-3S for libvir-list@redhat.com; Wed, 28 Feb 2018 22:25:03 +0300 Received: from darkstar.sw.ru (192.168.15.187) by US-EXCH2.sw.swsoft.com (172.16.10.60) with Microsoft SMTP Server (TLS) id 15.0.1236.3; Wed, 28 Feb 2018 22:20:42 +0300 From: Klim Kireev To: Date: Wed, 28 Feb 2018 22:20:28 +0300 Message-ID: <20180228192028.6569-1-klim.kireev@virtuozzo.com> MIME-Version: 1.0 X-ClientProxiedBy: US-EXCH2.sw.swsoft.com (172.16.10.60) To US-EXCH2.sw.swsoft.com (172.16.10.60) X-Greylist: Sender passed SPF test, ACL 227 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 28 Feb 2018 19:25:07 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 28 Feb 2018 19:25:07 +0000 (UTC) for IP:'185.231.240.75' DOMAIN:'relay.sw.ru' HELO:'relay.sw.ru' FROM:'klim.kireev@virtuozzo.com' RCPT:'' X-RedHat-Spam-Score: -0.001 (SPF_PASS) 185.231.240.75 relay.sw.ru 185.231.240.75 relay.sw.ru X-Scanned-By: MIMEDefang 2.78 on 10.5.110.39 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com X-Mailman-Approved-At: Wed, 28 Feb 2018 14:28:22 -0500 Subject: [libvirt] [PATCH] virtio-scsi: Add virtqueue_size parameter for qemu 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.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 28 Feb 2018 19:28:27 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" In QEMU commit 5c0919d02066c3d0eb896c33265ad90101a6a84a adds new option virtqueue_size. This Patch allows this option to be set in libvirt. --- docs/formatdomain.html.in | 6 ++++++ src/conf/domain_conf.c | 12 ++++++++++++ src/conf/domain_conf.h | 1 + src/qemu/qemu_command.c | 3 +++ 4 files changed, 22 insertions(+) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 6fd2189cd..2f33b5e70 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -3867,6 +3867,12 @@ host. Since 1.2.7 (QEMU and KVM only) +
virtqueue_size
+
+ The optional virtqueue_size attribute specifies the s= ize of + virtio queue. + Since 3.7.0 (QEMU and KVM only) +
max_sectors
The optional max_sectors attribute specifies the maxi= mum diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index d96b012b9..36a4deea2 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -9976,6 +9976,7 @@ virDomainControllerDefParseXML(virDomainXMLOptionPtr = xmlopt, char *model =3D NULL; char *queues =3D NULL; char *cmd_per_lun =3D NULL; + char *virtqueue_size =3D NULL; char *max_sectors =3D NULL; bool processedModel =3D false; char *modelName =3D NULL; @@ -10035,6 +10036,7 @@ virDomainControllerDefParseXML(virDomainXMLOptionPt= r xmlopt, queues =3D virXMLPropString(cur, "queues"); cmd_per_lun =3D virXMLPropString(cur, "cmd_per_lun"); max_sectors =3D virXMLPropString(cur, "max_sectors"); + virtqueue_size =3D virXMLPropString(cur, "virtqueue_size"); ioeventfd =3D virXMLPropString(cur, "ioeventfd"); iothread =3D virXMLPropString(cur, "iothread"); =20 @@ -10089,6 +10091,12 @@ virDomainControllerDefParseXML(virDomainXMLOptionP= tr xmlopt, goto error; } =20 + if (virtqueue_size && virStrToLong_ui(virtqueue_size, NULL, 10, &def->= virtqueue_size) < 0) { + virReportError(VIR_ERR_XML_ERROR, + _("Malformed 'virtqueue_size' value '%s'"), virtque= ue_size); + goto error; + } + if (max_sectors && virStrToLong_ui(max_sectors, NULL, 10, &def->max_se= ctors) < 0) { virReportError(VIR_ERR_XML_ERROR, _("Malformed 'max_sectors' value %s"), max_sectors); @@ -10310,6 +10318,7 @@ virDomainControllerDefParseXML(virDomainXMLOptionPt= r xmlopt, VIR_FREE(model); VIR_FREE(queues); VIR_FREE(cmd_per_lun); + VIR_FREE(virtqueue_size); VIR_FREE(max_sectors); VIR_FREE(modelName); VIR_FREE(chassisNr); @@ -23293,6 +23302,9 @@ virDomainControllerDriverFormat(virBufferPtr buf, if (def->cmd_per_lun) virBufferAsprintf(&driverBuf, " cmd_per_lun=3D'%u'", def->cmd_per_= lun); =20 + if (def->virtqueue_size) + virBufferAsprintf(&driverBuf, " virtqueue_size=3D'%u'", def->virtq= ueue_size); + if (def->max_sectors) virBufferAsprintf(&driverBuf, " max_sectors=3D'%u'", def->max_sect= ors); =20 diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 368f16f3f..141bd1aca 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -816,6 +816,7 @@ struct _virDomainControllerDef { int model; /* -1 =3D=3D undef */ unsigned int queues; unsigned int cmd_per_lun; + unsigned int virtqueue_size; unsigned int max_sectors; int ioeventfd; /* enum virTristateSwitch */ unsigned int iothread; /* unused =3D 0, > 0 specific thread # */ diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index fa0aa5d5c..9b1affd30 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -2808,6 +2808,9 @@ qemuBuildControllerDevStr(const virDomainDef *domainD= ef, if (def->queues) virBufferAsprintf(&buf, ",num_queues=3D%u", def->queues); =20 + if (def->virtqueue_size) + virBufferAsprintf(&buf, ",virtqueue_size=3D%u", def->virtqueue_siz= e); + if (def->cmd_per_lun) virBufferAsprintf(&buf, ",cmd_per_lun=3D%u", def->cmd_per_lun); =20 --=20 2.16.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list