From nobody Sun May 5 19:20:00 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.zoho.com; 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 1491229336768121.99939835010002; Mon, 3 Apr 2017 07:22:16 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 7E5C8624DF; Mon, 3 Apr 2017 14:21:53 +0000 (UTC) Received: from colo-mx.corp.redhat.com (unknown [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C714B1749D; Mon, 3 Apr 2017 14:13:08 +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 EA106B3480; Mon, 3 Apr 2017 14:12:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v33ECQ6V010924 for ; Mon, 3 Apr 2017 10:12:26 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2FE2317AFF; Mon, 3 Apr 2017 14:12:26 +0000 (UTC) Received: from beluga.usersys.redhat.com (dhcp129-94.brq.redhat.com [10.34.129.94]) by smtp.corp.redhat.com (Postfix) with ESMTP id 85B7C5C890; Mon, 3 Apr 2017 14:12:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 7E5C8624DF Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 7E5C8624DF From: Erik Skultety To: libvir-list@redhat.com Date: Mon, 3 Apr 2017 16:12:17 +0200 Message-Id: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Erik Skultety Subject: [libvirt] [PATCH] qemu: Add device id for mediated devices on qemu command line 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.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 03 Apr 2017 14:22:16 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Like all devices, add the 'id' option for mdevs as well. Patch also adjusts the test accordingly. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D1438431 Signed-off-by: Erik Skultety --- src/qemu/qemu_command.c | 3 ++- tests/qemuxml2argvdata/qemuxml2argv-hostdev-mdev-precreated.args | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 5cf383aaea..445c696d6e 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -5231,7 +5231,8 @@ qemuBuildHostdevMediatedDevStr(const virDomainDef *de= f, char *ret =3D NULL; =20 virBufferAddLit(&buf, "vfio-pci"); - virBufferAsprintf(&buf, ",sysfsdev=3D%s", + virBufferAsprintf(&buf, ",id=3D%s,sysfsdev=3D%s", + dev->info->alias, virMediatedDeviceGetSysfsPath(mdevsrc->uuidstr)); =20 if (qemuBuildDeviceAddressStr(&buf, def, dev->info, qemuCaps) < 0) diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-mdev-precreated.ar= gs b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-mdev-precreated.args index fdefeb6104..76e77707bf 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-mdev-precreated.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-mdev-precreated.args @@ -20,6 +20,6 @@ QEMU_AUDIO_DRV=3Dnone \ -usb \ -drive file=3D/dev/HostVG/QEMUGuest2,format=3Draw,if=3Dnone,id=3Ddrive-ide= 0-0-0 \ -device ide-drive,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-= 0 \ --device vfio-pci,\ +-device vfio-pci,id=3Dhostdev0,\ sysfsdev=3D/sys/bus/mdev/devices/53764d0e-85a0-42b4-af5c-2046b460b1dc,bus= =3Dpci.0,\ addr=3D0x3 --=20 2.12.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list