intel-iommu: correct the value used for error_setg_errno()
PATCH 1/1 intel-iommu: correct the value used for error_setg_errno()
error_setg_errno() expects a normal errno value, not a negated one, so we should use ENOTSUP instead of -ENOSUP.
Fixes Coverity CID 1487174
Fixes ("intel_iommu: support snoop control")
Signed-off-by Jason Wang <[email protected]>
--- hw/i386/intel_iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/i386/intel_iommu.c +1 -1
@@ -3032,7 +3032,7 @@ static int vtd_iommu_notify_flag_changed(IOMMUMemoryRegion *iommu,/* TODO: add support for VFIO and vhost users */ if (s->snoop_control) { -error_setg_errno (errp, -ENOTSUP , +error_setg_errno (errp,ENOTSUP ,"Snoop Control with vhost or VFIO is not supported" );return -ENOTSUP ; }
Signature · 1 line
2.25.1
Quoted 25 lines · Jason Wang
error_setg_errno()expects a normal errno value, not a negated one, so we should use ENOTSUP instead of-ENOSUP.Fixes Coverity CID 1487174Fixes ("intel_iommu: support snoop control")Signed-off-by Jason Wang <[email protected]>--- hw/i386/intel_iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)hw/i386/intel_iommu.c +1
-2@@ -3032,7 +3032,7 @@ static int vtd_iommu_notify_flag_changed(IOMMUMemoryRegion *iommu,/* TODO: add support for VFIO and vhost users */ if (s->snoop_control) { -error_setg_errno (errp, -ENOTSUP , +error_setg_errno (errp,ENOTSUP ,"Snoop Control with vhost or VFIO is not supported" );return -ENOTSUP ; } --
Quoted 1 line
2.25.1
Reviewed-by Peter Maydell <[email protected]>
thanks
-- PMM
Quoted 6 lines · Jason Wang
error_setg_errno()expects a normal errno value, not a negated one, so we should use ENOTSUP instead of-ENOSUP.Fixes Coverity CID 1487174Fixes ("intel_iommu: support snoop control")Signed-off-by Jason Wang <[email protected]>
Reviewed-by Peter Xu <[email protected]>
Signature · 1 line
Peter Xu