[virt-tools-list] [PATCH virt-viewer v4 11/12] ovirt-foreign-menu: Set new ISO name using GTask API

Eduardo Lima (Etrunko) etrunko at redhat.com
Thu Nov 3 14:34:01 UTC 2016


On 11/01/2016 06:33 PM, Eduardo Lima (Etrunko) wrote:
> From: Christophe Fergeau <cfergeau at redhat.com>
> 
> This is done with the new ovirt_foreign_menu_set_current_iso_name_async
> function. Also, an error dialog will be shown in case anything goes
> wrong with the async method.
> 
> Signed-off-by: Eduardo Lima (Etrunko) <etrunko at redhat.com>
> ---
>  src/ovirt-foreign-menu.c            | 40 +++++++++++++++++++++++++++----------
>  src/ovirt-foreign-menu.h            |  9 ++++++++-
>  src/remote-viewer-iso-list-dialog.c | 40 +++++++++++++++++++++++++++++--------
>  3 files changed, 70 insertions(+), 19 deletions(-)
> 
> diff --git a/src/ovirt-foreign-menu.c b/src/ovirt-foreign-menu.c
> index 8320552..288a812 100644
> --- a/src/ovirt-foreign-menu.c
> +++ b/src/ovirt-foreign-menu.c

[snip]

> @@ -382,7 +399,11 @@ static void updated_cdrom_cb(GObject *source_object,
>       * the new ISO */
>      if (error != NULL) {
>          g_warning("failed to update cdrom resource: %s", error->message);
> -        g_clear_error(&error);
> +        g_task_return_error(task, error);
> +    } else {
> +        g_warn_if_reached();
> +        g_task_return_new_error(task, OVIRT_ERROR, OVIRT_ERROR_FAILED,
> +                                "failed to update cdrom resource");
>      }

The block above should be placed after resetting the file back to the
original, because in the case of error, on the dialog we will get the
outdated name. I will send the updated patch soon.

Regards, Eduardo

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




More information about the virt-tools-list mailing list