[libvirt] [PATCH 1/2] qemu: Filter non SCSI hostdevs in qemuHostdevPrepareSCSIDevices

John Ferlan posted 2 patches 5 years, 10 months ago
[libvirt] [PATCH 1/2] qemu: Filter non SCSI hostdevs in qemuHostdevPrepareSCSIDevices
Posted by John Ferlan 5 years, 10 months ago
When commit 1d94b3e7 added code to walk the [n]hostdevs list looking
to add shared hostdevs, it should've filtered any hostdevs that were
not SCSI hostdev's.

Signed-off-by: John Ferlan <jferlan@redhat.com>
---
 src/qemu/qemu_hostdev.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/qemu/qemu_hostdev.c b/src/qemu/qemu_hostdev.c
index a487e1d3aa..4eb3f1d7f1 100644
--- a/src/qemu/qemu_hostdev.c
+++ b/src/qemu/qemu_hostdev.c
@@ -275,6 +275,9 @@ qemuHostdevPrepareSCSIDevices(virQEMUDriverPtr driver,
     for (i = 0; i < nhostdevs; i++) {
         virDomainDeviceDef dev;
 
+        if (!virHostdevIsSCSIDevice(hostdevs[i]))
+            continue;
+
         dev.type = VIR_DOMAIN_DEVICE_HOSTDEV;
         dev.data.hostdev = hostdevs[i];
 
-- 
2.20.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 1/2] qemu: Filter non SCSI hostdevs in qemuHostdevPrepareSCSIDevices
Posted by Ján Tomko 5 years, 10 months ago
On Thu, Jan 10, 2019 at 06:40:32PM -0500, John Ferlan wrote:
>When commit 1d94b3e7 added code to walk the [n]hostdevs list looking
>to add shared hostdevs, it should've filtered any hostdevs that were
>not SCSI hostdev's.
>
>Signed-off-by: John Ferlan <jferlan@redhat.com>
>---
> src/qemu/qemu_hostdev.c | 3 +++
> 1 file changed, 3 insertions(+)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list