Blame SOURCES/virt-manager-virt-manager-disable-CD-DVDROM-passtrough-on-RHEL.patch

343f27
From b5b1e8fc6b212a42d07ddca424a6474ce413e1e4 Mon Sep 17 00:00:00 2001
343f27
From: Giuseppe Scrivano <gscrivan@redhat.com>
343f27
Date: Wed, 19 Mar 2014 16:05:54 +0100
343f27
Subject: [PATCH 2/2] virt-manager: disable CD/DVDROM passtrough on RHEL
343f27
343f27
Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1072610
343f27
343f27
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
343f27
(cherry picked from commit 8d580cc483d2a9bf47283676233914e4cc8d29a6)
343f27
343f27
Conflicts:
343f27
	virtManager/choosecd.py
343f27
	virtManager/create.py
343f27
---
343f27
 virtManager/choosecd.py | 8 +++++++-
343f27
 virtManager/create.py   | 7 ++++++-
343f27
 2 files changed, 13 insertions(+), 2 deletions(-)
343f27
343f27
diff --git a/virtManager/choosecd.py b/virtManager/choosecd.py
343f27
index a0cac24..540e4b7 100644
343f27
--- a/virtManager/choosecd.py
343f27
+++ b/virtManager/choosecd.py
343f27
@@ -83,7 +83,13 @@ class vmmChooseCD(vmmGObjectUI):
343f27
 
343f27
     def reset_state(self):
343f27
         cd_path = self.widget("cd-path")
343f27
-        use_cdrom = (cd_path.get_active() > -1)
343f27
+
343f27
+        enable_phys = not self.vm.stable_defaults()
343f27
+        self.widget("physical-media").set_sensitive(enable_phys)
343f27
+        self.widget("physical-media").set_tooltip_text("" if enable_phys else
343f27
+            _("Physical CDROM passthrough not supported with this hypervisor"))
343f27
+
343f27
+        use_cdrom = (cd_path.get_active() > -1) and enable_phys
343f27
 
343f27
         if use_cdrom:
343f27
             self.widget("physical-media").set_active(True)
343f27
diff --git a/virtManager/create.py b/virtManager/create.py
343f27
index 90ef1eb..76a355e 100644
343f27
--- a/virtManager/create.py
343f27
+++ b/virtManager/create.py
343f27
@@ -547,8 +547,13 @@ class vmmCreate(vmmGObjectUI):
343f27
         else:
343f27
             iso_option.set_active(True)
343f27
 
343f27
+        enable_phys = not self._stable_defaults()
343f27
+        cdrom_option.set_sensitive(enable_phys)
343f27
+        cdrom_option.set_tooltip_text("" if enable_phys else
343f27
+            _("Physical CDROM passthrough not supported with this hypervisor"))
343f27
+
343f27
         # Only allow ISO option for remote VM
343f27
-        if not is_local:
343f27
+        if not is_local or not enable_phys:
343f27
             iso_option.set_active(True)
343f27
 
343f27
         self.toggle_local_cdrom(cdrom_option)
343f27
-- 
343f27
1.8.3.1
343f27