[virt-viewer v3 10/10] vv-file: Show 'newer-version-url' when version check fails

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We currently display a generic error message when the current binary is
older than the minimum version specified in the vv file. The previous
commit added a 'newer-version-url' field to these .vv file. This commit
adds that URL to the error message if it's set.
---
 src/virt-viewer-file.c | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/src/virt-viewer-file.c b/src/virt-viewer-file.c
index 906d719..2f1eb2b 100644
--- a/src/virt-viewer-file.c
+++ b/src/virt-viewer-file.c
@@ -816,11 +816,23 @@ virt_viewer_file_check_min_version(VirtViewerFile *self, GError **error)
     version_cmp = virt_viewer_compare_buildid(min_version, PACKAGE_VERSION BUILDID);
 
     if (version_cmp > 0) {
-        g_set_error(error,
-                    VIRT_VIEWER_ERROR,
-                    VIRT_VIEWER_ERROR_FAILED,
-                    _("At least %s version %s is required to setup this connection"),
-                    g_get_application_name(), min_version);
+        gchar *url;
+        url = virt_viewer_file_get_version_url(self);
+        if (url != NULL) {
+            g_set_error(error,
+                        VIRT_VIEWER_ERROR,
+                        VIRT_VIEWER_ERROR_FAILED,
+                        _("At least %s version %s is required to setup this"
+                          " connection, see %s for details"),
+                        g_get_application_name(), min_version, url);
+            g_free(url);
+        } else {
+            g_set_error(error,
+                        VIRT_VIEWER_ERROR,
+                        VIRT_VIEWER_ERROR_FAILED,
+                        _("At least %s version %s is required to setup this connection"),
+                        g_get_application_name(), min_version);
+        }
         g_free(min_version);
         return FALSE;
     }
-- 
2.4.2

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list




[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux