Skip to contentSkip to conversation

Problem with error paths in various functions calling kvm_io_bus_unregister_dev

DISCUSSION Paolo Bonzini 1 participant 1 message Aug 12, 2015 1 message not in the archive KVM

lore
Share & tools
lore

Paolo Bonzini

author maintainer
#1 lore raw
In reply to a message not in the archive
Quoted 8 lines · nick

Our we to just assume
that calls to kvm_io_bug_unregister_dev always succeed as I disagree due to it allocating memory in kernel space that can easily fail. In additon I was wondering how the maintainers would like me to handle these calls as it's difficult due to it already being in error paths. Further more below is a link to the files and how the calls to kvm_io_bus_register_dev are executed in the respective error paths.
http://lxr.free-electrons.com/ident?i=kvm_io_bus_unregister_dev

You're right; the fix is not simple. The best way is to introduce a new API to register or unregister multiple devices atomically. This gets rid of calls in the error paths.

Paolo