[libvirt] [PATCH 2/2] qemu: Remove virHostdevIsSCSIDevice from qemuIsSharedHostdev

Ján Tomko jtomko at redhat.com
Fri Jan 11 08:26:08 UTC 2019


On Thu, Jan 10, 2019 at 06:40:33PM -0500, John Ferlan wrote:
>It's essentially dead code. The only way hostdev->shareable
>can be true is during virDomainHostdevDefParseXML when the
>result of virHostdevIsSCSIDevice is true.

While this might be true in our current codebase,
I don't think this function should rely on the callers
to only fill in hostdev->shareable for VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI
to guard its usage of the hostdev->source union.

Jano

>
>Signed-off-by: John Ferlan <jferlan at redhat.com>
>---
> src/qemu/qemu_conf.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
>diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
>index 20952e9607..945725566c 100644
>--- a/src/qemu/qemu_conf.c
>+++ b/src/qemu/qemu_conf.c
>@@ -1438,8 +1438,7 @@ static bool
> qemuIsSharedHostdev(virDomainHostdevDefPtr hostdev)
> {
>     return (hostdev->shareable &&
>-            (virHostdevIsSCSIDevice(hostdev) &&
>-             hostdev->source.subsys.u.scsi.protocol !=
>+            (hostdev->source.subsys.u.scsi.protocol !=
>              VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_ISCSI));
> }
>
>-- 
>2.20.1
>
>--
>libvir-list mailing list
>libvir-list at redhat.com
>https://www.redhat.com/mailman/listinfo/libvir-list
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20190111/17ed6710/attachment-0001.sig>


More information about the libvir-list mailing list