[virt-tools-list] [virt-viewer] ovirt: Filter everything which does not end in .iso

Eduardo Lima (Etrunko) etrunko at redhat.com
Thu Aug 30 15:02:00 UTC 2018


On 08/28/2018 02:06 PM, Christophe Fergeau wrote:
> oVirt REST API does not provide a way to know what is a valid ISO image
> which can be assigned to a running VM. I've seen floppy disk images
> (.vfd) in a domain, which is already filtered. Now I've seen an ISO
> domain with .qcow2 files in it, which can't be assigned to a VM either.
> This commit filters every file which does not have a .iso extension as
> it's unlikely to be possible to use it.
> 
> Signed-off-by: Christophe Fergeau <cfergeau at redhat.com>

Acked-by: Eduardo Lima (Etrunko) <etrunko at redhat.com>

> ---
>  src/ovirt-foreign-menu.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/ovirt-foreign-menu.c b/src/ovirt-foreign-menu.c
> index f212861..69bf2b3 100644
> --- a/src/ovirt-foreign-menu.c
> +++ b/src/ovirt-foreign-menu.c
> @@ -489,7 +489,8 @@ static void ovirt_foreign_menu_set_files(OvirtForeignMenu *menu,
>           * associated with file resources , but as of 3.2, this node
>           * is not present, so we do an extension check instead
>           * to differentiate between ISOs and floppy images */
> -        if (g_str_has_suffix(name, ".vfd")) {
> +        if (!g_str_has_suffix(name, ".iso")) {
> +            g_debug("Ignoring %s which does not have a .iso extension", name);
>              g_free(name);
>              continue;
>          }
> 

-- 
Eduardo de Barros Lima (Etrunko)
Software Engineer - RedHat
etrunko at redhat.com




More information about the virt-tools-list mailing list