diff --git a/SOURCES/0004-ovirt-Do-not-filter-out-DATA-storage-domains.patch b/SOURCES/0004-ovirt-Do-not-filter-out-DATA-storage-domains.patch deleted file mode 100644 index 285715a..0000000 --- a/SOURCES/0004-ovirt-Do-not-filter-out-DATA-storage-domains.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 21b482e6b85df7dca46e1dc8501b0f28ce4570a1 Mon Sep 17 00:00:00 2001 -From: "Eduardo Lima (Etrunko)" -Date: Fri, 15 May 2020 10:24:08 -0300 -Subject: [PATCH virt-viewer] ovirt: Do not filter out DATA storage domains - -Since ovirt 4.2 it is acceptable to have ISO images in storage domains -of DATA type, while the usage of ISO type is about to be deprecated. The -code now allow both types of storage domains when looking up for ISO -images. - -https://access.redhat.com/documentation/en-us/red_hat_virtualization/4.2/html/release_notes/deprecated_features_rhv -https://access.redhat.com/documentation/en-us/red_hat_virtualization/4.4-beta/html/release_notes/deprecated_features_rhv - -Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1835640 - -Signed-off-by: Eduardo Lima (Etrunko) ---- - src/ovirt-foreign-menu.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/ovirt-foreign-menu.c b/src/ovirt-foreign-menu.c -index dc6ecf4..c31c93f 100644 ---- a/src/ovirt-foreign-menu.c -+++ b/src/ovirt-foreign-menu.c -@@ -661,8 +661,8 @@ static gboolean storage_domain_validate(OvirtForeignMenu *menu G_GNUC_UNUSED, - - g_object_get(domain, "name", &name, "type", &type, "state", &state, NULL); - -- if (type != OVIRT_STORAGE_DOMAIN_TYPE_ISO) { -- g_debug("Storage domain '%s' type is not ISO", name); -+ if (type != OVIRT_STORAGE_DOMAIN_TYPE_ISO && type != OVIRT_STORAGE_DOMAIN_TYPE_DATA) { -+ g_debug("Storage domain '%s' type is not ISO or DATA", name); - ret = FALSE; - } - --- -2.26.2 - diff --git a/SOURCES/0006-ovirt-foreign-menu-Use-proper-function-in-the-case-o.patch b/SOURCES/0006-ovirt-foreign-menu-Use-proper-function-in-the-case-o.patch deleted file mode 100644 index 4fce592..0000000 --- a/SOURCES/0006-ovirt-foreign-menu-Use-proper-function-in-the-case-o.patch +++ /dev/null @@ -1,103 +0,0 @@ -From 0a16fd513034c2a1475ed84b38461faea7a12250 Mon Sep 17 00:00:00 2001 -From: "Eduardo Lima (Etrunko)" -Date: Thu, 25 Jun 2020 21:19:32 -0300 -Subject: [PATCH virt-viewer] ovirt-foreign-menu: Use proper function in the - case of DATA StorageDomains - -Unlike the StorageDomain objects of ISO type, the DATA ones require a -specific API recently added to libgovirt to support them. This commit -makes use of those new functions under #ifdef guards and adds proper a -check to configure.ac. - -Related: https://bugzilla.redhat.com/show_bug.cgi?id=1847223 - -Signed-off-by: Eduardo Lima (Etrunko) ---- - configure.ac | 2 +- - src/ovirt-foreign-menu.c | 36 ++++++++++++++++++++++++++++++++++-- - 2 files changed, 35 insertions(+), 3 deletions(-) - -diff --git a/configure.ac b/configure.ac -index 9da056f..a313ce1 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -203,7 +203,7 @@ AS_IF([test "x$with_ovirt" = "xyes"], - SAVED_LIBS="$LIBS" - CFLAGS="$SAVED_CFLAGS $OVIRT_CFLAGS" - LIBS="$SAVED_LIBS $OVIRT_LIBS" -- AC_CHECK_FUNCS([ovirt_api_search_vms ovirt_vm_get_host ovirt_host_get_cluster ovirt_cluster_get_data_center], -+ AC_CHECK_FUNCS([ovirt_api_search_vms ovirt_vm_get_host ovirt_host_get_cluster ovirt_cluster_get_data_center ovirt_storage_domain_get_disks], - [AC_DEFINE([HAVE_OVIRT_DATA_CENTER], 1, [Have support for data center])], - [] - ) -diff --git a/src/ovirt-foreign-menu.c b/src/ovirt-foreign-menu.c -index c31c93f..3c67f1a 100644 ---- a/src/ovirt-foreign-menu.c -+++ b/src/ovirt-foreign-menu.c -@@ -481,6 +481,18 @@ static void ovirt_foreign_menu_set_files(OvirtForeignMenu *menu, - for (it = files; it != NULL; it = it->next) { - char *name; - g_object_get(it->data, "name", &name, NULL); -+ -+#ifdef HAVE_OVIRT_STORAGE_DOMAIN_GET_DISKS -+ if (OVIRT_IS_DISK(it->data)) { -+ OvirtDiskContentType content_type; -+ g_object_get(it->data, "content-type", &content_type, NULL); -+ if (content_type != OVIRT_DISK_CONTENT_TYPE_ISO) { -+ g_debug("Ignoring %s disk which content-type is not ISO", name); -+ continue; -+ } -+ } -+#endif -+ - /* The oVirt REST API is supposed to have a 'type' node - * associated with file resources , but as of 3.2, this node - * is not present, so we do an extension check instead -@@ -695,6 +707,26 @@ static gboolean ovirt_foreign_menu_set_file_collection(OvirtForeignMenu *menu, O - return TRUE; - } - -+static OvirtCollection *storage_domain_get_files(OvirtStorageDomain *domain) -+{ -+ OvirtCollection *files = NULL; -+ OvirtStorageDomainType type; -+ -+ if (domain == NULL) -+ return NULL; -+ -+ g_object_get(domain, "type", &type, NULL); -+ -+ if (type == OVIRT_STORAGE_DOMAIN_TYPE_ISO) -+ files = ovirt_storage_domain_get_files(domain); -+#ifdef HAVE_OVIRT_STORAGE_DOMAIN_GET_DISKS -+ else if (type == OVIRT_STORAGE_DOMAIN_TYPE_DATA) -+ files = ovirt_storage_domain_get_disks(domain); -+#endif -+ -+ return files; -+} -+ - static gboolean set_file_collection_from_toplevel_storage_domain(OvirtForeignMenu *menu, OvirtStorageDomain *domain) - { - gboolean ret = FALSE; -@@ -716,7 +748,7 @@ static gboolean set_file_collection_from_toplevel_storage_domain(OvirtForeignMen - goto end; - } - -- ret = ovirt_foreign_menu_set_file_collection(menu, ovirt_storage_domain_get_files(OVIRT_STORAGE_DOMAIN(resource))); -+ ret = ovirt_foreign_menu_set_file_collection(menu, storage_domain_get_files(OVIRT_STORAGE_DOMAIN(resource))); - - end: - g_clear_error(&error); -@@ -756,7 +788,7 @@ static void storage_domains_fetched_cb(GObject *source_object, - if (!domain_valid) - domain_valid = TRUE; - -- file_collection = ovirt_storage_domain_get_files(domain); -+ file_collection = storage_domain_get_files(domain); - if (!ovirt_foreign_menu_set_file_collection(menu, file_collection)) { - /* Retry with toplevel storage domain */ - if (!set_file_collection_from_toplevel_storage_domain(menu, domain)) --- -2.26.2 - diff --git a/SOURCES/0007-ovirt-foreign-menu-Take-into-account-StorageDomains-.patch b/SOURCES/0007-ovirt-foreign-menu-Take-into-account-StorageDomains-.patch deleted file mode 100644 index 402744f..0000000 --- a/SOURCES/0007-ovirt-foreign-menu-Take-into-account-StorageDomains-.patch +++ /dev/null @@ -1,99 +0,0 @@ -From f5936a87795dfdefee10f87672abcf8f9175a7c9 Mon Sep 17 00:00:00 2001 -From: "Eduardo Lima (Etrunko)" -Date: Mon, 15 Jun 2020 20:53:18 -0300 -Subject: [PATCH virt-viewer] ovirt-foreign-menu: Take into account - StorageDomains of type DATA - -Now that we support both ISO and DATA storage domain types, we need to -make sure that the files are listed correctly. In this case we give the -domains of ISO type the precedence over DATA ones. - -This change extends previous commit bbda3aa which made it possible for -storage domains of type DATA to be considered valid. - -Signed-off-by: Eduardo Lima (Etrunko) ---- - src/ovirt-foreign-menu.c | 39 ++++++++++++++++++++++----------------- - 1 file changed, 22 insertions(+), 17 deletions(-) - -diff --git a/src/ovirt-foreign-menu.c b/src/ovirt-foreign-menu.c -index 3c67f1a..8d02a79 100644 ---- a/src/ovirt-foreign-menu.c -+++ b/src/ovirt-foreign-menu.c -@@ -734,6 +734,9 @@ static gboolean set_file_collection_from_toplevel_storage_domain(OvirtForeignMen - OvirtResource *resource = NULL; - gchar *href = NULL, *id = NULL; - -+ if (domain == NULL) -+ return FALSE; -+ - g_object_get(domain, "guid", &id, NULL); - href = g_strdup_printf("/ovirt-engine/api/storagedomains/%s", id); - resource = g_initable_new(OVIRT_TYPE_STORAGE_DOMAIN, NULL, &error, "guid", id, "href", href, NULL); -@@ -767,8 +770,8 @@ static void storage_domains_fetched_cb(GObject *source_object, - OvirtForeignMenu *menu = OVIRT_FOREIGN_MENU(g_task_get_source_object(task)); - OvirtCollection *collection = OVIRT_COLLECTION(source_object); - GHashTableIter iter; -- OvirtStorageDomain *domain; -- gboolean domain_valid = FALSE; -+ OvirtStorageDomain *domain, *valid_domain = NULL; -+ OvirtCollection *file_collection; - - ovirt_collection_fetch_finish(collection, result, &error); - if (error != NULL) { -@@ -780,35 +783,37 @@ static void storage_domains_fetched_cb(GObject *source_object, - - g_hash_table_iter_init(&iter, ovirt_collection_get_resources(collection)); - while (g_hash_table_iter_next(&iter, NULL, (gpointer *)&domain)) { -- OvirtCollection *file_collection; -- - if (!storage_domain_validate(menu, domain)) - continue; - -- if (!domain_valid) -- domain_valid = TRUE; -+ /* Storage domain of type ISO has precedence over type DATA */ -+ if (valid_domain != NULL) { -+ OvirtStorageDomainType domain_type, valid_type; -+ g_object_get(domain, "type", &domain_type, NULL); -+ g_object_get(valid_domain, "type", &valid_type, NULL); - -- file_collection = storage_domain_get_files(domain); -- if (!ovirt_foreign_menu_set_file_collection(menu, file_collection)) { -- /* Retry with toplevel storage domain */ -- if (!set_file_collection_from_toplevel_storage_domain(menu, domain)) -- continue; -+ if (domain_type > valid_type) -+ valid_domain = domain; -+ -+ continue; - } - -- break; /* There can only be one valid storage domain at a time, -- no need to iterate more on the list */ -+ valid_domain = domain; - } - -- if (menu->priv->files != NULL) { -- ovirt_foreign_menu_next_async_step(menu, task, STATE_STORAGE_DOMAIN); -- } else { -- const char *msg = domain_valid ? "Could not find ISO file collection" -+ file_collection = storage_domain_get_files(valid_domain); -+ if (!ovirt_foreign_menu_set_file_collection(menu, file_collection) && -+ !set_file_collection_from_toplevel_storage_domain(menu, valid_domain)) { /* Retry with toplevel storage domain */ -+ const char *msg = valid_domain ? "Could not find ISO file collection" - : "Could not find valid ISO storage domain"; - - g_debug("%s", msg); - g_task_return_new_error(task, OVIRT_ERROR, OVIRT_ERROR_FAILED, "%s", msg); - g_object_unref(task); -+ return; - } -+ -+ ovirt_foreign_menu_next_async_step(menu, task, STATE_STORAGE_DOMAIN); - } - - --- -2.26.2 - diff --git a/SPECS/virt-viewer.spec b/SPECS/virt-viewer.spec index 8034c2e..5456633 100644 --- a/SPECS/virt-viewer.spec +++ b/SPECS/virt-viewer.spec @@ -19,7 +19,7 @@ Name: virt-viewer Version: 9.0 -Release: 3%{?dist}%{?extra_release} +Release: 4%{?dist}%{?extra_release} Summary: Virtual Machine Viewer Group: Applications/System License: GPLv2+ @@ -29,10 +29,7 @@ Source0: http://virt-manager.org/download/sources/%{name}/%{name}-%{version}.tar Patch001: 0001-DOWNSTREAM-Workaround-inconsistency-with-REST-API.patch Patch002: 0002-DOWNSTREAM-ovirt-foreign-menu-Bypass-errors-from-Hos.patch Patch003: 0003-DOWNSTREAM-remote-viewer-Set-admin-privileges-when-c.patch -Patch004: 0004-ovirt-Do-not-filter-out-DATA-storage-domains.patch Patch005: 0005-display-error-message-on-no-extension-for-screenshot.patch -Patch006: 0006-ovirt-foreign-menu-Use-proper-function-in-the-case-o.patch -Patch007: 0007-ovirt-foreign-menu-Take-into-account-StorageDomains-.patch Requires: openssh-clients @@ -81,10 +78,7 @@ the display, and libvirt for looking up VNC/SPICE server details. %patch001 -p1 %patch002 -p1 %patch003 -p1 -%patch004 -p1 %patch005 -p1 -%patch006 -p1 -%patch007 -p1 %build @@ -124,6 +118,10 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/man1/remote-viewer.1* %changelog +* Fri Aug 28 2020 Eduardo Lima (Etrunko) - 9.0-4 +- Revert support for DATA storage domains temporarily. + Resolves: rhbz#1873549 + * Thu Jun 25 2020 Eduardo Lima (Etrunko) - 9.0-3 - Handle DATA storage domains properly Resolves: rhbz#1835640