Make the code more generic and not specific to TYPE_DEVICE.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
What about dropping _qdev from the function name too?
Also, I am not sure it's a well designed function.. I would rather have 3 different helper functions than dispatching with an errno... Might be worth a TODO note :)