[virt-tools-list] [virt-manager PATCH] virt-manager: validate URL if OS detection is not in progress

Cole Robinson crobinso at redhat.com
Thu Apr 17 16:41:45 UTC 2014


On 04/17/2014 06:10 AM, Giuseppe Scrivano wrote:
> There is no reason to wait for the OS to be detected before validating
> the user input when there is no detection active.  Make sure we block
> only if the OS detection is in progress.
> 
> Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1086529
> 
> Signed-off-by: Giuseppe Scrivano <gscrivan at redhat.com>
> ---
>  virtManager/create.py | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/virtManager/create.py b/virtManager/create.py
> index 0757f94..673d0cd 100644
> --- a/virtManager/create.py
> +++ b/virtManager/create.py
> @@ -1314,7 +1314,8 @@ class vmmCreate(vmmGObjectUI):
>          if self.have_startup_error:
>              return
>  
> -        if curpage == PAGE_INSTALL and self.should_detect_media():
> +        if (curpage == PAGE_INSTALL and self.should_detect_media()
> +            and self.detectedDistro == DETECT_INPROGRESS):
>              # Make sure we have detected the OS before validating the page
>              self.detect_media_os(forward=True)
>              return
> 

This isn't correct. If you follow the code path, calling detect_media_os when
self.detectedDistro == DETECT_INPROGRESS is a no-op.

What that check is trying to fix is the case when a user fills in a URL, auto
detect is selected, but they never 'activate' the URL text entry so detection
isn't manually triggered. In that case, we should initiate distro detection
when the user clicks 'forward'. This change breaks that.

Though off hand I don't know what the proper fix for that bug is, it needs to
preserve the above behavior though

- Cole




More information about the virt-tools-list mailing list