[virt-tools-list] [PATCH virt-manager 2/2] virt-manager: disable CD/DVDROM passtrough on RHEL

Cole Robinson crobinso at redhat.com
Thu Mar 20 00:27:46 UTC 2014


On 03/19/2014 11:36 AM, Giuseppe Scrivano wrote:
> Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1072610
> 
> Signed-off-by: Giuseppe Scrivano <gscrivan at redhat.com>
> ---
>  virtManager/choosecd.py | 6 +++++-
>  virtManager/create.py   | 5 ++++-
>  2 files changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/virtManager/choosecd.py b/virtManager/choosecd.py
> index aa01ad2..8ce0b55 100644
> --- a/virtManager/choosecd.py
> +++ b/virtManager/choosecd.py
> @@ -97,7 +97,11 @@ class vmmChooseCD(vmmGObjectUI):
>  
>      def reset_state(self):
>          self.mediacombo.reset_state()
> -        use_cdrom = (self.mediacombo.has_media())
> +
> +        disable_local_cdrom = self.vm.stable_defaults()
> +        self.widget("physical-media").set_sensitive(not disable_local_cdrom)
> +
> +        use_cdrom = (self.mediacombo.has_media()) and not disable_local_cdrom
>  
>          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 757d700..9adafc3 100644
> --- a/virtManager/create.py
> +++ b/virtManager/create.py
> @@ -550,9 +550,12 @@ class vmmCreate(vmmGObjectUI):
>          cdrom_option.set_active(self.mediacombo.has_media())
>          iso_option.set_active(not self.mediacombo.has_media())
>  
> +        disable_local_cdrom = self._stable_defaults()
> +        cdrom_option.set_sensitive(not disable_local_cdrom)
> +
>          # Only allow ISO option for remote VM
>          is_local = not self.conn.is_remote()
> -        if not is_local:
> +        if not is_local or disable_local_cdrom:
>              iso_option.set_active(True)
>  
>          self.toggle_local_cdrom(cdrom_option)
> 

I would suggest adding a tooltip like 'Physical CDROM passthrough not
supported with this hypervisor' or something. Just disabling it might bring in
bug reports asking 'why is this turned off', etc.

- Cole




More information about the virt-tools-list mailing list