summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2014-03-19 16:05:54 +0100
committerGiuseppe Scrivano <gscrivan@redhat.com>2014-03-20 17:10:30 +0100
commit8d580cc483d2a9bf47283676233914e4cc8d29a6 (patch)
tree3d9927d52735c075b59bc90cfbf01bc847e2d9a6
parenta7050f918f85a235e117d6c7f2b49d367ec7163c (diff)
downloadvirt-manager-8d580cc483d2a9bf47283676233914e4cc8d29a6.tar.gz
virt-manager: disable CD/DVDROM passtrough on RHEL
Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1072610 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
-rw-r--r--virtManager/choosecd.py8
-rw-r--r--virtManager/create.py7
2 files changed, 13 insertions, 2 deletions
diff --git a/virtManager/choosecd.py b/virtManager/choosecd.py
index aa01ad2f..8b45464d 100644
--- a/virtManager/choosecd.py
+++ b/virtManager/choosecd.py
@@ -97,7 +97,13 @@ class vmmChooseCD(vmmGObjectUI):
def reset_state(self):
self.mediacombo.reset_state()
- use_cdrom = (self.mediacombo.has_media())
+
+ enable_phys = not self.vm.stable_defaults()
+ self.widget("physical-media").set_sensitive(enable_phys)
+ self.widget("physical-media").set_tooltip_text("" if enable_phys else
+ _("Physical CDROM passthrough not supported with this hypervisor"))
+
+ use_cdrom = (self.mediacombo.has_media()) and enable_phys
self.widget("physical-media").set_active(use_cdrom)
self.widget("iso-image").set_active(not use_cdrom)
diff --git a/virtManager/create.py b/virtManager/create.py
index 8e3bfd7c..679b7b19 100644
--- a/virtManager/create.py
+++ b/virtManager/create.py
@@ -551,9 +551,14 @@ class vmmCreate(vmmGObjectUI):
cdrom_option.set_active(self.mediacombo.has_media())
iso_option.set_active(not self.mediacombo.has_media())
+ enable_phys = not self._stable_defaults()
+ cdrom_option.set_sensitive(enable_phys)
+ cdrom_option.set_tooltip_text("" if enable_phys else
+ _("Physical CDROM passthrough not supported with this hypervisor"))
+
# Only allow ISO option for remote VM
is_local = not self.conn.is_remote()
- if not is_local:
+ if not is_local or not enable_phys:
iso_option.set_active(True)
self.toggle_local_cdrom(cdrom_option)