virttest/utils_test/libvirt.py: Add a common function to install packages
 on host or guest; update create_net_xml function.