Blame SOURCES/koan-virt-install-options.patch

1070a0
diff -rupN cobbler-2.0.7.old/koan/app.py cobbler-2.0.7.new/koan/app.py
1070a0
--- cobbler-2.0.7.old/koan/app.py	2014-11-06 15:02:37.476914876 -0500
1070a0
+++ cobbler-2.0.7.new/koan/app.py	2014-11-06 15:14:29.830881393 -0500
1070a0
@@ -182,6 +182,22 @@ def main():
1070a0
                  dest="embed_kickstart",
1070a0
                  action="store_true",
1070a0
                  help="When used with  --replace-self, embed the kickstart in the initrd to overcome potential DHCP timeout issues. (seldom needed)")
1070a0
+    p.add_option("", "--qemu-disk-type",
1070a0
+                 dest="qemu_disk_type",
1070a0
+                 help="when used with --virt_type=qemu, add select of disk driver types: ide,scsi,virtio")
1070a0
+    p.add_option("", "--qemu-net-type",
1070a0
+                 dest="qemu_net_type",
1070a0
+                 help="when used with --virt_type=qemu, select type of network device to use: e1000, ne2k_pci, pcnet, rtl8139, virtio")
1070a0
+    p.add_option("", "--wait",
1070a0
+                 dest="wait", type='int', default=0,    # default to 0 for koan backwards compatibility
1070a0
+                 help="pass the --wait=<INT> argument to virt-install")
1070a0
+    p.add_option("", "--cpu",
1070a0
+                 dest="cpu",
1070a0
+                 help="pass the --cpu argument to virt-install")
1070a0
+    p.add_option("", "--noreboot",
1070a0
+                 dest="noreboot", default=False,        # default to False for koan backwards compatibility
1070a0
+                 action="store_true",
1070a0
+                 help="pass the --noreboot argument to virt-install")
1070a0
 
1070a0
     (options, args) = p.parse_args()
1070a0
 
1070a0
@@ -209,6 +225,11 @@ def main():
1070a0
         k.should_poll         = options.should_poll
1070a0
         k.embed_kickstart     = options.embed_kickstart
1070a0
         k.virt_auto_boot      = options.virt_auto_boot
1070a0
+        k.qemu_disk_type      = options.qemu_disk_type
1070a0
+        k.qemu_net_type       = options.qemu_net_type
1070a0
+        k.virtinstall_cpu     = options.cpu
1070a0
+        k.virtinstall_wait    = options.wait
1070a0
+        k.virtinstall_noreboot= options.noreboot
1070a0
 
1070a0
         if options.virt_name is not None:
1070a0
             k.virt_name          = options.virt_name
1070a0
@@ -264,6 +285,11 @@ class Koan:
1070a0
         self.virt_path         = None
1070a0
         self.qemu_disk_type    = None
1070a0
         self.virt_auto_boot    = None
1070a0
+        self.qemu_disk_type    = None
1070a0
+        self.qemu_net_type     = None
1070a0
+        self.virtinstall_cpu   = None
1070a0
+        self.virtinstall_wait  = None
1070a0
+        self.virtinstall_noreboot = None
1070a0
 
1070a0
         # This option adds the --copy-default argument to /sbin/grubby
1070a0
         # which uses the default boot entry in the grub.conf
1070a0
@@ -330,6 +356,18 @@ class Koan:
1070a0
                    self.virt_type = "xenpv"
1070a0
                raise InfoException, "--virt-type should be qemu, xenpv, xenfv, vmware, vmwarew, 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
+            self.qemu_disk_type = self.qemu_disk_type.lower()
1070a0
+            if self.virt_type not in [ "qemu", "auto", "kvm" ]:
1070a0
+               raise InfoException, "--qemu-disk-type must use with --virt-type=qemu"
1070a0
+
1070a0
+        # if --qemu-net-type was called without --virt-type=qemu, then fail
1070a0
+        if (self.qemu_net_type is not None):
1070a0
+            self.qemu_net_type = self.qemu_net_type.lower()
1070a0
+            if self.virt_type not in [ "qemu", "auto", "kvm" ]:
1070a0
+               raise InfoException, "--qemu-net-type must use with --virt-type=qemu"
1070a0
+
1070a0
         # if --static-interface and --profile was called together, then fail
1070a0
         if self.static_interface is not None and self.profile is not None:
1070a0
             raise InfoException, "--static-interface option is incompatible with --profile option use --system instead"
1070a0
@@ -1145,7 +1183,12 @@ class Koan:
1070a0
                 fullvirt       =  fullvirt,    
1070a0
                 bridge         =  self.virt_bridge,
1070a0
                 virt_type      =  self.virt_type,
1070a0
-                virt_auto_boot =  virt_auto_boot
1070a0
+                virt_auto_boot =  virt_auto_boot,
1070a0
+                qemu_driver_type  =  self.qemu_disk_type,
1070a0
+                qemu_net_type     =  self.qemu_net_type,
1070a0
+                cpu               =  self.virtinstall_cpu,
1070a0
+                wait              =  self.virtinstall_wait,
1070a0
+                noreboot          =  self.virtinstall_noreboot,
1070a0
         )
1070a0
 
1070a0
         print results
1070a0
diff -rupN cobbler-2.0.7.old/koan/virtinstall.py cobbler-2.0.7.new/koan/virtinstall.py
1070a0
--- cobbler-2.0.7.old/koan/virtinstall.py	2014-11-06 15:02:37.476914876 -0500
1070a0
+++ cobbler-2.0.7.new/koan/virtinstall.py	2014-11-06 15:11:11.564499529 -0500
1070a0
@@ -162,6 +162,7 @@ def build_commandline(uri,
1070a0
                       qemu_driver_type=None,
1070a0
                       qemu_net_type=None,
1070a0
                       qemu_machine_type=None,
1070a0
+                      cpu=None,
1070a0
                       wait=0,
1070a0
                       noreboot=False,
1070a0
                       osimport=False):
1070a0
@@ -404,6 +405,8 @@ def build_commandline(uri,
1070a0
         cmd += " "
1070a0
 
1070a0
     cmd += "--wait %d " % int(wait)
1070a0
+    if cpu:
1070a0
+        cmd += "--cpu %s " % cpu
1070a0
     if noreboot:
1070a0
         cmd += "--noreboot "
1070a0
     if osimport and not(import_exists):