[libvirt PATCH 2/4] nodedev: dont rely on ignoring errors on missing properties
Daniel P. Berrangé
berrange at redhat.com
Tue Nov 17 16:15:20 UTC 2020
On Tue, Nov 17, 2020 at 11:04:07AM -0500, Laine Stump wrote:
> On 11/17/20 7:56 AM, Daniel P. Berrangé wrote:
> > 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.
>
>
> Taking you at your word that, e.g. ID_CDROM will *always* be unset, and
> never set to 0 when the device isn't a CD,
ID_CDROM=1 is set when the '/lib/udev/cdrom_id' program determins that
the device is a CDROM.
There's no trace of anything evers etting ID_CDROM=0 in the standard
source.
I guess in theory someone could write a udev rule to force ID_CROM=0
instead of deleting the property, but that's kind of silly.
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
More information about the libvir-list
mailing list