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