[virt-manager PATCH 4/7] installer: deal with floppy devices used during install

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

 



A floppy device is going to be used when performing a unattended
installation in a Windows guest.

In order to have it done cleanly, let's mimic the what's already
existent for dealing with cdrom devices used during installation.

Signed-off-by: Fabiano Fidêncio <fidencio@xxxxxxxxxx>
---
 virtinst/installer.py | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/virtinst/installer.py b/virtinst/installer.py
index b8c048f1..488ed324 100644
--- a/virtinst/installer.py
+++ b/virtinst/installer.py
@@ -49,6 +49,7 @@ class Installer(object):
         self._install_kernel = None
         self._install_initrd = None
         self._install_cdrom_device = None
+        self._install_floppy_device = None
         self._defaults_are_set = False
 
         if location_kernel or location_initrd:
@@ -111,6 +112,25 @@ class Installer(object):
         self._install_cdrom_device.path = None
         self._install_cdrom_device.sync_path_props()
 
+    def _add_install_floppy_device(self, guest, location):
+        if self._install_floppy_device:
+            return
+        dev = DeviceDisk(self.conn)
+        dev.device = dev.DEVICE_FLOPPY
+        dev.path = location
+        dev.sync_path_props()
+        dev.validate()
+        dev.set_defaults(guest)
+        self._install_floppy_device = dev
+        guest.add_device(self._install_floppy_device)
+
+    def _remove_install_floppy_device(self, guest):
+        if not self._install_floppy_device:
+            return
+
+        self._install_floppy_device.path = None
+        self._install_floppy_device.sync_path_props()
+
     def _build_boot_order(self, guest, bootdev):
         bootorder = [bootdev]
 
-- 
2.20.1

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list




[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux