virt-install: Support --image too
I want to be able to `cosa virt-install --image tmp/fastbuild/fastbuild-qemu.qcow2`
just like I can `kola run`.
@@ -27,12 +27,18 @@ parser = argparse.ArgumentParser()
parser.add_argument("--connect", "-c", help="libvirt URI", default="qemu:///system")
parser.add_argument("--ignition", "-i", help="Ignition config", required=True)
parser.add_argument("--build", help="Build ID")
+parser.add_argument("--image", help="Image path")
parser.add_argument("--pool", help="storage pool", default="default")
parser.add_argument("--name", help="Prefix for libvirt resources")
parser.add_argument("--instid", help="Suffix appended to libvirt resources")
args, vinstall_args = parser.parse_known_args()
builds = Builds()
+if args.image:
+ qemupath = args.image
+ if args.name is None:
+ args.name = os.path.basename(qemupath)
+else:
if args.build is None:
args.build = builds.get_latest()
builddir = builds.get_build_dir(args.build)
