From nobody Sun Feb 8 12:31:24 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; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 154827922272259.25359494019506; Wed, 23 Jan 2019 13:33:42 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CCB9719F34; Wed, 23 Jan 2019 21:33:39 +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 9380CBA96; Wed, 23 Jan 2019 21:33:39 +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 30BF73F608; Wed, 23 Jan 2019 21:33:39 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x0NLXLMX032289 for ; Wed, 23 Jan 2019 16:33:21 -0500 Received: by smtp.corp.redhat.com (Postfix) id 321F2BA6D; Wed, 23 Jan 2019 21:33:21 +0000 (UTC) Received: from worklaptop.redhat.com (ovpn-120-34.rdu2.redhat.com [10.10.120.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 55FD2BA50; Wed, 23 Jan 2019 21:33:20 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Wed, 23 Jan 2019 16:32:34 -0500 Message-Id: <066d7b1e62cd29e74604d00c8a5940bec53e84db.1548278585.git.crobinso@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 06/25] qemu: command: Convert vhost-{vsock, scsi} to qemuBuildVirtioDevStr 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 23 Jan 2019 21:33:41 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Current code essentially duplicates the same logic, but misses some cases (like vhost-vsock-device). Signed-off-by: Cole Robinson Reviewed-by: Andrea Bolognani --- src/qemu/qemu_command.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index a1d991cefc..2dde4b9125 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4925,10 +4925,8 @@ qemuBuildSCSIVHostHostdevDevStr(const virDomainDef *= def, goto cleanup; } =20 - if (dev->info->type =3D=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW) - virBufferAddLit(&buf, "vhost-scsi-ccw"); - else - virBufferAddLit(&buf, "vhost-scsi-pci"); + if (qemuBuildVirtioDevStr(&buf, "vhost-scsi", dev->info->type) < 0) + goto cleanup; =20 virBufferAsprintf(&buf, ",wwpn=3D%s,vhostfd=3D%s,id=3D%s", hostsrc->wwpn, @@ -10347,11 +10345,9 @@ qemuBuildVsockDevStr(virDomainDefPtr def, virBuffer buf =3D VIR_BUFFER_INITIALIZER; char *ret =3D NULL; =20 - if (vsock->info.type =3D=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW) { - virBufferAddLit(&buf, "vhost-vsock-ccw"); - } else { - virBufferAddLit(&buf, "vhost-vsock-pci"); - } + + if (qemuBuildVirtioDevStr(&buf, "vhost-vsock", vsock->info.type) < 0) + goto cleanup; =20 virBufferAsprintf(&buf, ",id=3D%s", vsock->info.alias); virBufferAsprintf(&buf, ",guest-cid=3D%u", vsock->guest_cid); --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list