virhostdev: Unify virDomainHostdevDef to virPCIDevice translation
virhostdev: Unify virDomainHostdevDef to virPCIDevice translation

There are two places where we need to create virPCIDevice from
given virDomainHostdevDef. In both places the code is duplicated.
Move them into a single function and call it from those two
places.

Signed-off-by: Michal Privoznik <83d82aaba2eed257f4814b0c239c260c4caaadf0@redhat.com>
Reviewed-by: Ján Tomko <4cab11cfb98d3c937327354a78eb07dbb6ee2bc6@redhat.com>
Reviewed-by: Daniel Henrique Barboza <627b089ad62deae9aaf06ccfa2c9056df28927e0@gmail.com>
Tested-by: Daniel Henrique Barboza <627b089ad62deae9aaf06ccfa2c9056df28927e0@gmail.com>

andreabolognani/libvirt,nertpinx/libvirt,andreabolognani/libvirt,crobinso/libvirt,jardasgit/libvirt,jfehlig/libvirt,jardasgit/libvirt,zippy2/libvirt,jardasgit/libvirt,jfehlig/libvirt,fabianfreyer/libvirt,fabianfreyer/libvirt,andreabolognani/libvirt,crobinso/libvirt,nertpinx/libvirt,andreabolognani/libvirt,libvirt/libvirt,jfehlig/libvirt,jardasgit/libvirt,fabianfreyer/libvirt,nertpinx/libvirt,andreabolognani/libvirt,libvirt/libvirt,libvirt/libvirt,zippy2/libvirt,zippy2/libvirt,olafhering/libvirt,fabianfreyer/libvirt,zippy2/libvirt,nertpinx/libvirt,olafhering/libvirt,olafhering/libvirt,libvirt/libvirt,olafhering/libvirt,crobinso/libvirt,jfehlig/libvirt,fabianfreyer/libvirt,nertpinx/libvirt,crobinso/libvirt,jardasgit/libvirt