[libvirt] [PATCH v2 2/4] test_driver: extract image loading code into a separate function