[virt-tools-list] [virt-viewer 2/2] Don't use virGetLastErrorMessage()

Marc-André Lureau mlureau at redhat.com
Thu Oct 30 16:28:57 UTC 2014


ack

----- Original Message -----
> This was introduced in libvirt 1.0.6 but we only require libvirt 0.10.0
> ---
>  src/virt-viewer.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/virt-viewer.c b/src/virt-viewer.c
> index cbedc9f..830a96e 100644
> --- a/src/virt-viewer.c
> +++ b/src/virt-viewer.c
> @@ -576,9 +576,10 @@ choose_vm(char **vm_name, virConnectPtr conn, GError
> **error)
>  
>      dom = virDomainLookupByName(conn, *vm_name);
>      if (dom == NULL) {
> +        virErrorPtr err = virGetLastError();
>          g_set_error_literal(error,
>                              VIRT_VIEWER_ERROR, VIRT_VIEWER_ERROR_FAILED,
> -                            virGetLastErrorMessage());
> +                            err && err->message ? err->message : "unknown
> libvirt error");
>      } else if (virDomainGetState(dom, &i, NULL, 0) < 0 || i !=
>      VIR_DOMAIN_RUNNING) {
>          g_set_error(error,
>                      VIRT_VIEWER_ERROR, VIRT_VIEWER_ERROR_FAILED,
> --
> 2.1.0
> 
> _______________________________________________
> virt-tools-list mailing list
> virt-tools-list at redhat.com
> https://www.redhat.com/mailman/listinfo/virt-tools-list
> 




More information about the virt-tools-list mailing list