qemu: add pci helper functions (Marcelo Tosatti)