[PATCH] virt-install: allow to pass bustype via --disk

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
attached patch allows to pass the target device's bustype to virtinst.
Otherwise one can't force installation via virtio or scsi since the
OS/Distro specific default is always being used. Does this look sane?
Cheers,
 -- Guido
# HG changeset patch
# User "Guido Günther <agx@xxxxxxxxxxx>"
# Date 1224238023 -7200
# Node ID e065407e3950b52975772529182efc47cb53bd42
# Parent  9f45a36d8242a97bbb25bd8af68c49adcbc29fa4
Allow to pass the bustype via --disk

diff -r 9f45a36d8242 -r e065407e3950 man/en/virt-install.pod
--- a/man/en/virt-install.pod	Thu Oct 16 11:18:49 2008 -0400
+++ b/man/en/virt-install.pod	Fri Oct 17 12:07:03 2008 +0200
@@ -124,6 +124,12 @@
 Disk device type. Value can be 'cdrom', 'disk', or 'floppy'. Default is
 'disk'. If a 'cdrom' is specified, and no install method is chosen, the
 cdrom is used as the install media.
+
+=item B<device>
+
+Disk bus type. Value can be 'ide', 'scsi', 'usb , 'virtio' or 'xen'.  The
+default is hypervisor dependent since not all hypervisors support all bus
+types.
 
 =item B<perms>
 
diff -r 9f45a36d8242 -r e065407e3950 virt-install
--- a/virt-install	Thu Oct 16 11:18:49 2008 -0400
+++ b/virt-install	Fri Oct 17 12:07:03 2008 +0200
@@ -82,6 +82,7 @@
     ro = False
     shared = False
     sparse = True
+    bus = None
 
     origpath = path
 
@@ -113,6 +114,8 @@
         opt_type, opt_val = opt
         if opt_type == "device":
             devtype = opt_val
+        if opt_type == "bus":
+            bus = opt_val
         elif opt_type == "perms":
             if opt_val == "ro":
                 ro = True
@@ -135,7 +138,7 @@
         else:
             fail(_("Unknown --disk option '%s'." % opt))
 
-    # We return (path, (poolname, volname), volinst, device, readonly, shared)
+    # We return (path, (poolname, volname), volinst, device, bus, readonly, shared)
     if path_type == "path=":
         abspath = os.path.abspath(path)
         if os.path.dirname(abspath) == DEFAULT_POOL_PATH:
@@ -166,7 +169,7 @@
 
     if not devtype:
         devtype = virtinst.VirtualDisk.DEVICE_DISK
-    ret = (abspath, voltuple, volinst, devtype, ro, shared, size, sparse)
+    ret = (abspath, voltuple, volinst, devtype, bus, ro, shared, size, sparse)
     logging.debug("parse_disk: returning %s" % str(ret))
     return ret
 
@@ -175,20 +178,20 @@
     try:
         # Get disk parameters
         if is_file_path:
-            (path, voltuple, volinst, device, readOnly, shared, size,
+            (path, voltuple, volinst, device, bus, readOnly, shared, size,
              sparse) = \
-             (disk, None, None, virtinst.VirtualDisk.DEVICE_DISK, False,
+             (disk, None, None, virtinst.VirtualDisk.DEVICE_DISK, None, False,
               False, size, sparse)
         else:
             (path, voltuple, volinst,
-             device, readOnly, shared,
+             device, bus, readOnly, shared,
              size, sparse) = parse_disk_option(guest, disk, size)
             if not sparse and volinst:
                 volinst.allocation = volinst.capacity
 
         d = virtinst.VirtualDisk(path=path, size=size, sparse=sparse,
                                  volInstall=volinst, volName=voltuple,
-                                 readOnly=readOnly, device=device,
+                                 readOnly=readOnly, device=device, bus=bus,
                                  conn=guest.conn)
         # Default file backed PV guests to tap driver
         if d.type == virtinst.VirtualDisk.TYPE_FILE \
_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/et-mgmt-tools

[Index of Archives]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux