]> git.ipfire.org Git - thirdparty/libvirt.git/commit
nodedev: dont rely on ignoring errors on missing properties
authorDaniel P. Berrangé <berrange@redhat.com>
Tue, 17 Nov 2020 11:56:46 +0000 (11:56 +0000)
committerDaniel P. Berrangé <berrange@redhat.com>
Tue, 17 Nov 2020 16:54:57 +0000 (16:54 +0000)
commit032394856b284775fcb5fb8da2220946d043614b
tree8aee726281dffbe1c02b908a3750c5dac93afa2b
parentf4b4bfdf4113f015bd3ccd253c03611d2ce52d64
nodedev: dont rely on ignoring errors on missing properties

The udevProcessStorage method relies on udevGetIntProperty ignoring
errors about non-existant properties and instead setting the value to
zero. In theory when seeing ID_CDROM=1, you might expect that devices
which are not CDs will get ID_CDROM=0, but that's not what happens in
practice. Instead the property simply won't get set at all.

IOW, the code does not need to care about the value of the property,
merely whether it exists or not.

Reviewed-by: Laine Stump <laine@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
src/node_device/node_device_udev.c