[virt-tools-list] [PATCH] [virt-install] Add Missed cdrom in hardware list of customize dialog

Cole Robinson crobinso at redhat.com
Fri Sep 5 22:08:24 UTC 2014


On 08/26/2014 02:58 AM, Lin Ma wrote:
> While installing guest through 'Local install media', The cdrom item
> doesn't be displayed in hardware list of customize dialog, It doesn't
> affect guest installation, But cause user a little confusion.
> The patch fixes it.
> 
> Signed-off-by: Lin Ma <lma at suse.com>
> ---
>  virtManager/create.py | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/virtManager/create.py b/virtManager/create.py
> index d93c7f6..6c19e74 100644
> --- a/virtManager/create.py
> +++ b/virtManager/create.py
> @@ -1777,6 +1777,15 @@ class vmmCreate(vmmGObjectUI):
>  
>          if self.get_config_customize():
>              logging.debug("User requested 'customize', launching dialog")
> +            for dev in guest._install_devices:
> +                guest.remove_device(dev)
> +            guest._install_devices = []
> +            guest.installer.prepare(guest, None,
> +                util.make_scratchdir(guest.conn, guest.type))
> +            for dev in guest.installer.install_devices:
> +                if dev.virtual_device_type == "disk":
> +                    guest.add_device(dev)
> +                    guest._install_devices.append(dev)
>              try:
>                  self.customize(guest)
>              except Exception, e:
> 

Thanks for the patch. I admit that what you describe could cause user
confusion, but this patch is wayyy too hacky. _install_devices is private to
virtinst/guest.py and shouldn't be touched by virt-manager code (anything
prefixed by '_' is typically considered private). installer.prepare can result
in downloading a boot.iso if a URL is passed, and this won't show progress
information or give the user a chance to back out.

The proper way to do this likely requires reworking things at the virtinst
level in a non trivial way. It's possible, but not sure if it's really worth
it to fix this specific issue.

- Cole




More information about the virt-tools-list mailing list