libvirt/tests-upstream-Fixing-compiler-warning-in-cputest.patch
Jiabo Feng 52e9a4d1d4 libvirt update to version 6.2.0-60
- vdpa: support vdpa device migrate
- vdpa: support vdpa device hot plug/unplug
- vdpa: Introduce the new device type vdpa to hostdev
- node_device: fix leak of DIR*
- Include vdpa devices in node device list
- lxc: fix lxcContainerMountAllFS() DEREF_BEFORE_CHECK
- qemu: Return perf status that affect next boot  for shutoff domains While we set up perf events for a shutoff domain and check the settings, All of perf events are reported as 'disabled', unless we add --config, This is redundant for a shutoff domain.
- tests: upstream Fixing compiler warning in cputest
- qemu_migration_cookie: Rename ret in qemuDomainExtractTLSSubject
- virrandom: Fix printf format string in virRandomGenerateWWN()
- fix the issue of errors when saving after 'virsh edit'
- Use (un)signed printf specifiers correctly
- admin: fix leak of typed parameters on error
- esx: call freeaddrinfo earlier in esxUtil_ResolveHostname Call freeaddrinfo() as soon as @result is not needed anymore, i.e. right after getnameinfo(); this avoids calling freeaddrinfo() in two branches.
- qemu: Fix incorrect command name in error messages

Signed-off-by: Jiabo Feng <fengjiabo1@huawei.com>
2023-12-05 21:06:20 +08:00

46 lines
1.7 KiB
Diff
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

From 53ff014d6e62a0bbef7e9fda360ddfe197115324 Mon Sep 17 00:00:00 2001
From: laokz <zhangkai@iscas.ac.cn>
Date: Thu, 14 Sep 2023 11:46:39 +0800
Subject: [PATCH] tests: upstream Fixing compiler warning in cputest
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Reference: https://github.com/libvirt/libvirt/commit/67c77744d74fe99a6b0e4ddef6869b305e29d6aa
---
tests: Fixing compiler warning in cputest
Found when building on Fedora 36 on s390x.
C compiler for the host machine: gcc (gcc 12.0.1 "gcc (GCC) 12.0.1 20220308 (Red Hat 12.0.1-0)")
C linker for the host machine: gcc ld.bfd 2.37-24
In function cpuTestUpdateLiveCompare,
inlined from cpuTestUpdateLive at ../dist-unpack/libvirt-8.2.5/tests/cputest.c:784:12:
../dist-unpack/libvirt-8.2.5/tests/cputest.c:696:21: warning: potential null pointer dereference [-Wnull-dereference]
696 | featAct->policy == VIR_CPU_FEATURE_REQUIRE) ||
| ~~~~~~~^~~~~~~~
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
---
tests/cputest.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/cputest.c b/tests/cputest.c
index 3657fa4095..8c22fb3ee9 100644
--- a/tests/cputest.c
+++ b/tests/cputest.c
@@ -760,7 +760,7 @@ cpuTestUpdateLiveCompare(virArch arch,
if ((cmp == 0 &&
featAct->policy == VIR_CPU_FEATURE_REQUIRE &&
featExp->policy == VIR_CPU_FEATURE_DISABLE) ||
- (cmp < 0 &&
+ (cmp < 0 && featAct &&
featAct->policy == VIR_CPU_FEATURE_REQUIRE) ||
(cmp > 0 &&
featExp->policy == VIR_CPU_FEATURE_DISABLE)) {
--
2.27.0