|
 |
1070a0 |
From 53b4932a705653c45228db287fc933a1288b5108 Mon Sep 17 00:00:00 2001
|
|
 |
1070a0 |
From: Jan Dobes <jdobes@redhat.com>
|
|
 |
1070a0 |
Date: Tue, 17 Oct 2017 11:58:51 +0200
|
|
 |
1070a0 |
Subject: [PATCH] support kvm type
|
|
 |
1070a0 |
|
|
 |
1070a0 |
copy from Cobbler 2.8
|
|
 |
1070a0 |
---
|
|
 |
1070a0 |
koan/app.py | 14 +++++++-------
|
|
 |
1070a0 |
1 file changed, 7 insertions(+), 7 deletions(-)
|
|
 |
1070a0 |
|
|
 |
1070a0 |
diff --git a/koan/app.py b/koan/app.py
|
|
 |
1070a0 |
index bacc135..b7dabb1 100755
|
|
 |
1070a0 |
--- a/koan/app.py
|
|
 |
1070a0 |
+++ b/koan/app.py
|
|
 |
1070a0 |
@@ -327,10 +327,10 @@
|
|
 |
1070a0 |
# if --virt-type was specified and invalid, then fail
|
|
 |
1070a0 |
if self.virt_type is not None:
|
|
 |
1070a0 |
self.virt_type = self.virt_type.lower()
|
|
 |
1070a0 |
- if self.virt_type not in [ "qemu", "xenpv", "xenfv", "xen", "vmware", "vmwarew", "auto" ]:
|
|
 |
1070a0 |
+ if self.virt_type not in [ "qemu", "xenpv", "xenfv", "xen", "vmware", "vmwarew", "auto", "kvm" ]:
|
|
 |
1070a0 |
if self.virt_type == "xen":
|
|
 |
1070a0 |
self.virt_type = "xenpv"
|
|
 |
1070a0 |
- raise(InfoException("--virt-type should be qemu, xenpv, xenfv, vmware, vmwarew, or auto"))
|
|
 |
1070a0 |
+ raise(InfoException("--virt-type should be qemu, xenpv, xenfv, vmware, vmwarew, kvm or auto"))
|
|
 |
1070a0 |
|
|
 |
1070a0 |
# if --qemu-disk-type was called without --virt-type=qemu, then fail
|
|
 |
1070a0 |
if (self.qemu_disk_type is not None):
|
|
 |
1070a0 |
@@ -545,7 +545,7 @@
|
|
 |
1070a0 |
raise(InfoException("xend needs to be started"))
|
|
 |
1070a0 |
|
|
 |
1070a0 |
# for qemu
|
|
 |
1070a0 |
- if self.virt_type == "qemu":
|
|
 |
1070a0 |
+ if self.virt_type in [ "qemu", "kvm" ]:
|
|
 |
1070a0 |
# qemu package installed?
|
|
 |
1070a0 |
if not os.path.exists("/usr/bin/qemu-img"):
|
|
 |
1070a0 |
raise(InfoException("qemu package needs to be installed"))
|
|
 |
1070a0 |
@@ -1201,7 +1201,7 @@
|
|
 |
1070a0 |
if virt_auto_boot:
|
|
 |
1070a0 |
if self.virt_type in [ "xenpv", "xenfv" ]:
|
|
 |
1070a0 |
utils.create_xendomains_symlink(virtname)
|
|
 |
1070a0 |
- elif self.virt_type == "qemu":
|
|
 |
1070a0 |
+ elif self.virt_type in [ "qemu", "kvm" ]:
|
|
 |
1070a0 |
utils.libvirt_enable_autostart(virtname)
|
|
 |
1070a0 |
else:
|
|
 |
1070a0 |
print("- warning: don't know how to autoboot this virt type yet")
|
|
 |
1070a0 |
@@ -1225,7 +1225,7 @@
|
|
 |
1070a0 |
if self.virt_type == "xenfv":
|
|
 |
1070a0 |
fullvirt = True
|
|
 |
1070a0 |
can_poll = "xen"
|
|
 |
1070a0 |
- elif self.virt_type == "qemu":
|
|
 |
1070a0 |
+ elif self.virt_type in [ "qemu", "kvm" ]:
|
|
 |
1070a0 |
fullvirt = True
|
|
 |
1070a0 |
uuid = None
|
|
 |
1070a0 |
from koan import qcreate
|
|
 |
1070a0 |
@@ -1410,7 +1410,7 @@
|
|
 |
1070a0 |
# not set in cobbler either? then assume reasonable defaults
|
|
 |
1070a0 |
if self.virt_type in [ "xenpv", "xenfv" ]:
|
|
 |
1070a0 |
prefix = "/var/lib/xen/images/"
|
|
 |
1070a0 |
- elif self.virt_type == "qemu":
|
|
 |
1070a0 |
+ elif self.virt_type in [ "qemu", "kvm" ]:
|
|
 |
1070a0 |
prefix = "/var/lib/libvirt/images/"
|
|
 |
1070a0 |
elif self.virt_type == "vmwarew":
|
|
 |
1070a0 |
prefix = "/var/lib/vmware/%s/" % name
|
|
 |
1070a0 |
--
|
|
 |
1070a0 |
1.8.3.1
|
|
 |
1070a0 |
|