[virt-tools-list] [virt-viewer] ovirt: Only use active ISO domains for foreign menu

Fabiano Fidêncio fabiano at fidencio.org
Tue Mar 1 13:40:23 UTC 2016


On Tue, Mar 1, 2016 at 2:36 PM, Christophe Fergeau <cfergeau at redhat.com> wrote:
> oVirt storage domains can be in various states (inactive, in
> maintainance, ...). We only want to show the ISOs it contains in the
> foreign menu when the storage domain is actually active, not in the
> other states.

No bug references?

> ---
>  src/ovirt-foreign-menu.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/src/ovirt-foreign-menu.c b/src/ovirt-foreign-menu.c
> index 9859439..82f0f2a 100644
> --- a/src/ovirt-foreign-menu.c
> +++ b/src/ovirt-foreign-menu.c
> @@ -650,12 +650,17 @@ static void storage_domains_fetched_cb(GObject *source_object,
>      while (g_hash_table_iter_next(&iter, NULL, (gpointer *)&domain)) {
>          OvirtCollection *file_collection;
>          int type;
> +        int state;
>
> -        g_object_get(domain, "type", &type, NULL);
> +        g_object_get(domain, "type", &type, "state", &state, NULL);
>          if (type != OVIRT_STORAGE_DOMAIN_TYPE_ISO) {
>              continue;
>          }
>
> +        if (state != OVIRT_STORAGE_DOMAIN_STATE_ACTIVE) {
> +            continue;
> +        }
> +
>          file_collection = ovirt_storage_domain_get_files(domain);
>          if (file_collection != NULL) {
>              if (menu->priv->files) {
> --
> 2.5.0
>
> _______________________________________________
> virt-tools-list mailing list
> virt-tools-list at redhat.com
> https://www.redhat.com/mailman/listinfo/virt-tools-list

Acked-by: Fabiano Fidêncio <fidencio at redhat.com>

-- 
Fabiano Fidêncio




More information about the virt-tools-list mailing list