From 15c305caf3f1fbc563d5499a1927f6c079c5b459 Mon Sep 17 00:00:00 2001 From: Merlin Mathesius Date: Aug 21 2020 16:28:09 +0000 Subject: Fix so no platforms depend upon ceph for 32-bit architectures Include upstream patches to fix GCC 10 warnings Signed-off-by: Merlin Mathesius --- diff --git a/libvirt-6.6.0-qemu-avoid-maybe-uninitialized-warning-by-GCC-10.patch b/libvirt-6.6.0-qemu-avoid-maybe-uninitialized-warning-by-GCC-10.patch new file mode 100644 index 0000000..6b99c95 --- /dev/null +++ b/libvirt-6.6.0-qemu-avoid-maybe-uninitialized-warning-by-GCC-10.patch @@ -0,0 +1,40 @@ +From d96d359a032cda609f9adf3caafdf8425d8aa4ac Mon Sep 17 00:00:00 2001 +From: Boris Fiuczynski +Date: Thu, 13 Aug 2020 16:03:44 +0200 +Subject: [PATCH] qemu: avoid maybe-uninitialized warning by GCC 10 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +GCC 10 complains about "well_formed_uri" may be used uninitialzed. +Even though it is a false positive, we can easily avoid it. + +Avoiding + ../src/qemu/qemu_migration.c: In function ‘qemuMigrationDstPrepareDirect’: + ../src/qemu/qemu_migration.c:2920:16: error: ‘well_formed_uri’ may be used uninitialized in this function [-Werror=maybe-uninitialized] + 2920 | if (well_formed_uri) { + | ^ + +Signed-off-by: Boris Fiuczynski +Reviewed-by: Marc Hartmayer +Reviewed-by: Erik Skultety +--- + src/qemu/qemu_migration.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c +index 0f2f92b211..142faa2cf9 100644 +--- a/src/qemu/qemu_migration.c ++++ b/src/qemu/qemu_migration.c +@@ -2886,7 +2886,7 @@ qemuMigrationDstPrepareDirect(virQEMUDriverPtr driver, + + *uri_out = g_strdup_printf(incFormat, "tcp", hostname, port); + } else { +- bool well_formed_uri; ++ bool well_formed_uri = false; + + if (!(uri = qemuMigrationAnyParseURI(uri_in, &well_formed_uri))) + goto cleanup; +-- +GitLab + diff --git a/libvirt-6.6.0-storage-avoid-maybe-uninitialized-warning-by-GCC-10.patch b/libvirt-6.6.0-storage-avoid-maybe-uninitialized-warning-by-GCC-10.patch new file mode 100644 index 0000000..fc15370 --- /dev/null +++ b/libvirt-6.6.0-storage-avoid-maybe-uninitialized-warning-by-GCC-10.patch @@ -0,0 +1,78 @@ +From ae8a83c35378d8d3eac2e41b3a10cac0e587ce54 Mon Sep 17 00:00:00 2001 +From: Boris Fiuczynski +Date: Thu, 13 Aug 2020 16:03:46 +0200 +Subject: [PATCH] storage: avoid maybe-uninitialized warning by GCC 10 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +GCC 10 complains about variables may be used uninitialized. +Even though it might be false positives, we can easily avoid them. + +Avoiding + ../src/storage/storage_backend_iscsi_direct.c:634:11: error: ‘nb_block’ may be used uninitialized in this function [-Werror=maybe-uninitialized] + 634 | while (lba < nb_block) { + | ^ + ../src/storage/storage_backend_iscsi_direct.c:619:14: note: ‘nb_block’ was declared here + 619 | uint64_t nb_block; + | ^~~~~~~~ + ../src/storage/storage_backend_iscsi_direct.c:637:16: error: ‘block_size’ may be used uninitialized in this function [-Werror=maybe-uninitialized] + 637 | task = iscsi_write16_sync(iscsi, lun, lba, data, + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 638 | block_size * to_write, + | ~~~~~~~~~~~~~~~~~~~~~~ + 639 | block_size, 0, 0, 0, 0, 0); + | ~~~~~~~~~~~~~~~~~~~~~~~~~~ + ../src/storage/storage_backend_iscsi_direct.c:618:14: note: ‘block_size’ was declared here + 618 | uint32_t block_size; + | ^~~~~~~~~~ + ../src/storage/storage_backend_iscsi_direct.c: In function ‘virStorageBackendISCSIDirectRefreshPool’: + ../src/storage/storage_backend_iscsi_direct.c:320:39: error: ‘nb_block’ may be used uninitialized in this function [-Werror=maybe-uninitialized] + 320 | vol->target.capacity = block_size * nb_block; + | ~~~~~~~~~~~^~~~~~~~~~ + ../src/storage/storage_backend_iscsi_direct.c:306:14: note: ‘nb_block’ was declared here + 306 | uint64_t nb_block; + | ^~~~~~~~ + ../src/storage/storage_backend_iscsi_direct.c:320:39: error: ‘block_size’ may be used uninitialized in this function [-Werror=maybe-uninitialized] + 320 | vol->target.capacity = block_size * nb_block; + | ~~~~~~~~~~~^~~~~~~~~~ + ../src/storage/storage_backend_iscsi_direct.c:305:14: note: ‘block_size’ was declared here + 305 | uint32_t block_size; + | ^~~~~~~~~~ + +Signed-off-by: Boris Fiuczynski +Reviewed-by: Marc Hartmayer +Reviewed-by: Erik Skultety +--- + src/storage/storage_backend_iscsi_direct.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/storage/storage_backend_iscsi_direct.c b/src/storage/storage_backend_iscsi_direct.c +index c37c671db6..027fa83de7 100644 +--- a/src/storage/storage_backend_iscsi_direct.c ++++ b/src/storage/storage_backend_iscsi_direct.c +@@ -302,8 +302,8 @@ virISCSIDirectRefreshVol(virStoragePoolObjPtr pool, + char *portal) + { + virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); +- uint32_t block_size; +- uint64_t nb_block; ++ uint32_t block_size = 0; ++ uint64_t nb_block = 0; + g_autoptr(virStorageVolDef) vol = NULL; + + if (virISCSIDirectTestUnitReady(iscsi, lun) < 0) +@@ -615,8 +615,8 @@ virStorageBackendISCSIDirectVolWipeZero(virStorageVolDefPtr vol, + struct iscsi_context *iscsi) + { + uint64_t lba = 0; +- uint32_t block_size; +- uint64_t nb_block; ++ uint32_t block_size = 0; ++ uint64_t nb_block = 0; + struct scsi_task *task = NULL; + int lun = 0; + int ret = -1; +-- +GitLab + diff --git a/libvirt-6.6.0-tools-avoid-potential-null-pointer-dereference-by-GCC-10.patch b/libvirt-6.6.0-tools-avoid-potential-null-pointer-dereference-by-GCC-10.patch new file mode 100644 index 0000000..12e8b53 --- /dev/null +++ b/libvirt-6.6.0-tools-avoid-potential-null-pointer-dereference-by-GCC-10.patch @@ -0,0 +1,40 @@ +From e2bd2af6e4f9323cf732563b430ef02e075fc804 Mon Sep 17 00:00:00 2001 +From: Boris Fiuczynski +Date: Thu, 13 Aug 2020 16:03:45 +0200 +Subject: [PATCH] tools: avoid potential null pointer dereference by GCC 10 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +GCC 10 complains about "arg" possibly being a NULL dereference. +Even though it might be a false positive, we can easily avoid it. + +Avoiding + ../tools/vsh.c: In function ‘vshCommandOptStringReq’: + ../tools/vsh.c:1034:19: error: potential null pointer dereference [-Werror=null-dereference] + 1034 | else if (!*arg->data && !(arg->def->flags & VSH_OFLAG_EMPTY_OK)) + | ~~~^~~~~~ + +Signed-off-by: Boris Fiuczynski +Reviewed-by: Marc Hartmayer +Reviewed-by: Erik Skultety +--- + tools/vsh.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tools/vsh.c b/tools/vsh.c +index 5e2e3ac219..11f493f969 100644 +--- a/tools/vsh.c ++++ b/tools/vsh.c +@@ -1031,7 +1031,7 @@ vshCommandOptStringReq(vshControl *ctl, + /* this should not be propagated here, just to be sure */ + if (ret == -1) + error = N_("Mandatory option not present"); +- else if (!*arg->data && !(arg->def->flags & VSH_OFLAG_EMPTY_OK)) ++ else if (arg && !*arg->data && !(arg->def->flags & VSH_OFLAG_EMPTY_OK)) + error = N_("Option argument is empty"); + + if (error) { +-- +GitLab + diff --git a/libvirt.spec b/libvirt.spec index efbce13..b792683 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -122,11 +122,9 @@ %define with_storage_zfs 0 %endif -# Ceph dropping support for 32-bit hosts -%if 0%{?fedora} >= 30 - %ifarch %{arm} %{ix86} - %define with_storage_rbd 0 - %endif +# Ceph does not support 32-bit hosts +%ifarch %{arm} %{ix86} + %define with_storage_rbd 0 %endif # RHEL doesn't ship OpenVZ, VBox, PowerHypervisor, @@ -218,7 +216,7 @@ Summary: Library providing a simple virtualization API Name: libvirt Version: 6.6.0 -Release: 2%{?dist} +Release: 3%{?dist} License: LGPLv2+ URL: https://libvirt.org/ @@ -227,6 +225,13 @@ URL: https://libvirt.org/ %endif Source: https://libvirt.org/sources/%{?mainturl}libvirt-%{version}.tar.xz Patch1: 0001-util-Fix-logic-in-virFileSetCOW.patch +# Upstream patches to fix GCC 10 warnings +# https://gitlab.com/libvirt/libvirt/-/commit/d96d359a032cda609f9adf3caafdf8425d8aa4ac +Patch2: libvirt-6.6.0-qemu-avoid-maybe-uninitialized-warning-by-GCC-10.patch +# https://gitlab.com/libvirt/libvirt/-/commit/e2bd2af6e4f9323cf732563b430ef02e075fc804 +Patch3: libvirt-6.6.0-tools-avoid-potential-null-pointer-dereference-by-GCC-10.patch +# https://gitlab.com/libvirt/libvirt/-/commit/ae8a83c35378d8d3eac2e41b3a10cac0e587ce54 +Patch4: libvirt-6.6.0-storage-avoid-maybe-uninitialized-warning-by-GCC-10.patch Requires: libvirt-daemon = %{version}-%{release} Requires: libvirt-daemon-config-network = %{version}-%{release} @@ -1995,6 +2000,10 @@ exit 0 %changelog +* Fri Aug 21 2020 Merlin Mathesius - 6.6.0-3 +- Fix so no platforms depend upon ceph for 32-bit architectures +- Include upstream patches to fix GCC 10 warnings + * Fri Aug 21 2020 Daniel P. Berrangé - 6.6.0-2 - Fix creation of pools on non-btrfs (rhbz#1870197)