From nobody Mon Feb 9 17:22:40 2026 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 ARC-Seal: i=1; a=rsa-sha256; t=1569855305; cv=none; d=zoho.com; s=zohoarc; b=RczP+AYSvd0WABP8o2dR8LC8d0bGu2hVOCWi9AZ1DyjRqgYMsGK/LocwhPk0A5zT/TfJgcgxtOxFcje+flv9f4Zf+3zheObxV/LvkONm5nkmwQeJjTDciBK8Ah10s9eBxHpigo4hXnNkv92WX7z3PCrfbHAYiIMj2fUk2UiZflE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569855305; 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:ARC-Authentication-Results; bh=1HeRmYyJ+/JkVMbfiGwDrmNJK9talaAaFXXp6I75GHs=; b=kkEsgomDfDD4wPls8TnfQuAqk0m4cS1O+MrPU7D8tOD1Rl1RNJj6yLXO6PMN3zx4hi+sDeN9C9Ei/nnVHLGA2T+Ap6Tv49Ko0KOycf1BCF3Wr2OJfYE6V5Cfe3O00qHFqORtRuXKBfOeENXlqQw1hqMNdIqazU1wTRzZ5amBrJA= ARC-Authentication-Results: i=1; mx.zoho.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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1569855304958381.1425657956097; Mon, 30 Sep 2019 07:55:04 -0700 (PDT) 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 C4EC559449; Mon, 30 Sep 2019 14:55:02 +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 85E2B6012A; Mon, 30 Sep 2019 14:55:02 +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 21A0F4E58C; Mon, 30 Sep 2019 14:55:02 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x8U6tV0n013582 for ; Mon, 30 Sep 2019 02:55:31 -0400 Received: by smtp.corp.redhat.com (Postfix) id BB8B15D9CA; Mon, 30 Sep 2019 06:55:31 +0000 (UTC) Received: from mx1.redhat.com (ext-mx08.extmail.prod.ext.phx2.redhat.com [10.5.110.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B6EC75D9C9 for ; Mon, 30 Sep 2019 06:55:29 +0000 (UTC) Received: from mail-pl1-f194.google.com (mail-pl1-f194.google.com [209.85.214.194]) (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 58EF8C057EC6 for ; Mon, 30 Sep 2019 06:55:28 +0000 (UTC) Received: by mail-pl1-f194.google.com with SMTP id u20so3532815plq.4 for ; Sun, 29 Sep 2019 23:55:28 -0700 (PDT) Received: from 31_216.localdomain ([23.97.74.121]) by smtp.gmail.com with ESMTPSA id 202sm12370446pfu.161.2019.09.29.23.55.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 29 Sep 2019 23:55:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smartx-com.20150623.gappssmtp.com; s=20150623; h=mime-version:from:to:cc:subject:date:message-id:in-reply-to :references:content-transfer-encoding; bh=IWZIh5neO3DKwLF9TaOBsnohQsw1UvXlvePyo/iYcGM=; b=nBnoNP4s7QIaFSwduwj2XOiUMWvo4gxIQeXGNWvs8FTRyW3qfAtmpJyNfOZK9XEZ1I MTyC+Ye9KERAw2CqQDACtu5uG5ZTuvXWF9h3y54xIJJGNCkVZk1N8pheXWgPFMKc4+23 c8lAMUyRT7F2CFADi21jrCcRX4IRNCUzD7poIvSVxNiKPdgGDyLOcYFnIU88V6W+TlFH +Am6e+rtCor/RUU51FaZo4vliFihhM/ez8N0IhDvrhpFArJtnDdo4OaLKPdi6ELHdsFL eaiHcQp45Nt+iurJ0AyNPNokOKDzzHWRfDUvr+6HQHYw8PrJRJM9c5c0/39OiM8DNXif vdtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :in-reply-to:references:content-transfer-encoding; bh=IWZIh5neO3DKwLF9TaOBsnohQsw1UvXlvePyo/iYcGM=; b=BbCS+BxHuTj10qDCEHp3FKytDvdDG8JE0CzPfoMbInL/L5G/HzNoN6LCrH5xSLms// UpaUCk5WTG0bdNxciZKEKZpmD+v1RgdXqY5qxIkN/vZ1uxdl2d7jR1w6AvwU/Atucjby uQAUJvnyAl6zxsRZmoE4Bhvv1YUIWZNXgHWsqamvm0KLBhjezXH8zps7GSBBtgGHIPWO Q/k1A1lHzlgcNEfKxiD5IQRc2pKlew2pxmVRAx1+CzcDC5YIhMjNz8Sdrd2jtZuCj1wR zvWDigH1l80VeclA2zWkV4U/fgzRYMHs6CB+38z2A7ZymKpahpYGCE1FbZhUWIzEdJpw +wmQ== MIME-Version: 1.0 X-Gm-Message-State: APjAAAX/m1jCKaAV1COBK7Dl1uTc+dW2D/o2JoxQlT9AL2tvUSDWe++G hqVBBUZuW1R/I1p4gnI/vFlT7bxUQj9s+xxSVie3DA6JiKV3FAjr1mPBfZ7XsBTcXJx6oAriG/n R2pk7vCl8WMv5R6zNNg== X-Google-Smtp-Source: APXvYqyo2n7DpT0OVHi3G4mmQvRXvIPMEqa2ArO1ZiIWRCuR8U4BRcTJt+6zWRJEmm4U7H58Shb9Rw== X-Received: by 2002:a17:902:6e17:: with SMTP id u23mr18569407plk.205.1569826527468; Sun, 29 Sep 2019 23:55:27 -0700 (PDT) From: Li Feng To: libvir-list@redhat.com Date: Mon, 30 Sep 2019 14:54:22 +0800 Message-Id: <20190930065422.59782-4-fengli@smartx.com> In-Reply-To: <20190930065422.59782-1-fengli@smartx.com> References: <20190930065422.59782-1-fengli@smartx.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 30 Sep 2019 06:55:28 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 30 Sep 2019 06:55:28 +0000 (UTC) for IP:'209.85.214.194' DOMAIN:'mail-pl1-f194.google.com' HELO:'mail-pl1-f194.google.com' FROM:'fengli@smartx.com' RCPT:'' X-RedHat-Spam-Score: 0.001 (DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE) 209.85.214.194 mail-pl1-f194.google.com 209.85.214.194 mail-pl1-f194.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.32 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id x8U6tV0n013582 X-loop: libvir-list@redhat.com X-Mailman-Approved-At: Mon, 30 Sep 2019 10:55:01 -0400 Cc: Li Feng Subject: [libvirt] [PATCH 3/3] qemu: Add multiqueue support for vhost-user-scsi/blk 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.39]); Mon, 30 Sep 2019 14:55:03 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" The format like this: Signed-off-by: Li Feng --- src/conf/device_conf.h | 5 +++++ src/conf/domain_conf.c | 14 ++++++++++++= ++ src/qemu/qemu_command.c | 7 +++++++ tests/qemuxml2argvdata/vhost-user-blk.x86_64-latest.args | 2 +- tests/qemuxml2argvdata/vhost-user-blk.xml | 1 + 5 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/conf/device_conf.h b/src/conf/device_conf.h index d0854925e3..c3c722edd3 100644 --- a/src/conf/device_conf.h +++ b/src/conf/device_conf.h @@ -179,6 +179,11 @@ struct _virDomainDeviceInfo { * cases we might want to prevent that from happening by * locking the isolation group */ bool isolationGroupLocked; + + /* vhost-user-scsi/blk/nvme support multiqueue, parse the queue + * num from xml. + */ + unsigned int num_queues; }; =20 void virDomainDeviceInfoClear(virDomainDeviceInfoPtr info); diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index fd53fab271..eeed88e41e 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -7483,10 +7483,12 @@ virDomainDeviceInfoParseXML(virDomainXMLOptionPtr x= mlopt ATTRIBUTE_UNUSED, xmlNodePtr alias =3D NULL; xmlNodePtr boot =3D NULL; xmlNodePtr rom =3D NULL; + xmlNodePtr queue =3D NULL; int ret =3D -1; VIR_AUTOFREE(char *) romenabled =3D NULL; VIR_AUTOFREE(char *) rombar =3D NULL; VIR_AUTOFREE(char *) aliasStr =3D NULL; + VIR_AUTOFREE(char *) queueStr =3D NULL; =20 virDomainDeviceInfoClear(info); =20 @@ -7510,6 +7512,9 @@ virDomainDeviceInfoParseXML(virDomainXMLOptionPtr xml= opt ATTRIBUTE_UNUSED, (flags & VIR_DOMAIN_DEF_PARSE_ALLOW_ROM) && virXMLNodeNameEqual(cur, "rom")) { rom =3D cur; + } else if (queue =3D=3D NULL && + virXMLNodeNameEqual(cur, "queue")) { + queue =3D cur; } } cur =3D cur->next; @@ -7563,6 +7568,15 @@ virDomainDeviceInfoParseXML(virDomainXMLOptionPtr xm= lopt ATTRIBUTE_UNUSED, virDomainDeviceAddressParseXML(address, info) < 0) goto cleanup; =20 + if (queue) { + queueStr =3D virXMLPropString(queue, "num"); + if (virStrToLong_uip(queueStr, NULL, 10, &info->num_queues) < 0) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Cannot parse 'num' attribute '%s'"),= queueStr); + + goto cleanup; + } + } =20 ret =3D 0; cleanup: diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 336ca3f729..7a3c695ac1 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -10737,6 +10737,13 @@ qemuBuildVhostUserChrDeviceStr(char **deviceStr, virBufferAsprintf(&buf, "%s,chardev=3Dchar%s,id=3D%s", device_type, vhostuser->info.alias, vhostuser->info.alias); + if (vhostuser->info.num_queues > 0) { + if ((virDomainChrDeviceType)vhostuser->deviceType =3D=3D VIR_DOMAI= N_CHR_DEVICE_TYPE_VHOST_USER_SCSI) { + virBufferAsprintf(&buf, ",num_queues=3D%d", vhostuser->info.nu= m_queues); + } else if ((virDomainChrDeviceType)vhostuser->deviceType =3D=3D VI= R_DOMAIN_CHR_DEVICE_TYPE_VHOST_USER_BLK) { + virBufferAsprintf(&buf, ",num-queues=3D%d", vhostuser->info.nu= m_queues); + } + } =20 if (qemuBuildDeviceAddressStr(&buf, def, &vhostuser->info, qemuCaps) <= 0) return -1; diff --git a/tests/qemuxml2argvdata/vhost-user-blk.x86_64-latest.args b/tes= ts/qemuxml2argvdata/vhost-user-blk.x86_64-latest.args index 4c67be1863..ea99f5949d 100644 --- a/tests/qemuxml2argvdata/vhost-user-blk.x86_64-latest.args +++ b/tests/qemuxml2argvdata/vhost-user-blk.x86_64-latest.args @@ -31,7 +31,7 @@ file=3D/tmp/lib/domain--1-test/master-key.aes \ -chardev socket,id=3Dcharvhost-user-blk-disk0,path=3D/tmp/vhost-blk.sock,\ reconnect=3D1 \ -device vhost-user-blk-pci,chardev=3Dcharvhost-user-blk-disk0,\ -id=3Dvhost-user-blk-disk0 \ +id=3Dvhost-user-blk-disk0,num-queues=3D4 \ -sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ resourcecontrol=3Ddeny \ -msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/vhost-user-blk.xml b/tests/qemuxml2argv= data/vhost-user-blk.xml index c9ff7650cb..276fea14b5 100644 --- a/tests/qemuxml2argvdata/vhost-user-blk.xml +++ b/tests/qemuxml2argvdata/vhost-user-blk.xml @@ -32,6 +32,7 @@ + --=20 2.11.0 --=20 The SmartX email address is only for business purpose. Any sent message=20 that is not related to the business is not authorized or permitted by=20 SmartX. =E6=9C=AC=E9=82=AE=E7=AE=B1=E4=B8=BA=E5=8C=97=E4=BA=AC=E5=BF=97=E5=87=8C=E6= =B5=B7=E7=BA=B3=E7=A7=91=E6=8A=80=E6=9C=89=E9=99=90=E5=85=AC=E5=8F=B8=EF=BC= =88SmartX=EF=BC=89=E5=B7=A5=E4=BD=9C=E9=82=AE=E7=AE=B1. =E5=A6=82=E6=9C=AC= =E9=82=AE=E7=AE=B1=E5=8F=91=E5=87=BA=E7=9A=84=E9=82=AE=E4=BB=B6=E4=B8=8E=E5= =B7=A5=E4=BD=9C=E6=97=A0=E5=85=B3,=E8=AF=A5=E9=82=AE=E4=BB=B6=E6=9C=AA=E5= =BE=97=E5=88=B0=E6=9C=AC=E5=85=AC=E5=8F=B8=E4=BB=BB=E4=BD=95=E7=9A=84=E6=98= =8E=E7=A4=BA=E6=88=96=E9=BB=98=E7=A4=BA=E7=9A=84=E6=8E=88=E6=9D=83. -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list