mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-13 16:15:19 +00:00
70e826ec6a
The current hostdev parsing logic sets rawio or sgio even if the hostdev type is not 'scsi'. The rawio field in virDomainHostdevSubsysSCSI overlaps with wwpn field in virDomainHostdevSubsysSCSIVHost, consequently setting a bogus pointer value such as 0x1 or 0x2 from virDomainHostdevSubsysSCSIVHost's point of view. This leads to a segmentation fault when it attempts to free wwpn. While setting sgio does not appear to crash, it shares the same flawed logic as setting rawio. Instead, we ensure these are set only after the hostdev type check succeeds. This patch also adds two test cases to exercise both scenarios. Fixes: bdb95b520c53f9bacc6504fc51381bac4813be38 Signed-off-by: Rayhan Faizel <rayhan.faizel@gmail.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 lines
55 B
Plaintext
2 lines
55 B
Plaintext
XML error: sgio is only supported for scsi host device
|