ovirt: Filter everything which does not end in .iso

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@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
This commit is contained in:
Christophe Fergeau 2018-08-28 19:01:08 +02:00
parent 1b45241a66
commit 71dc30571e

View File

@ -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;
}