From 0c5da1bf8bd3bee9bf77d13e79a210f79ca8ec07 Mon Sep 17 00:00:00 2001 From: Jiabo Feng Date: Wed, 9 Aug 2023 17:14:47 +0800 Subject: [PATCH] libvirt update to version 6.2.0-59 - selinux: adapt to libselinux - fix error in printf format string Signed-off-by: Jiabo Feng --- fix-error-in-printf-format-string.patch | 32 ++++++++++++++++++++ libvirt.spec | 8 ++++- selinux-adapt-to-libselinux.patch | 39 +++++++++++++++++++++++++ 3 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 fix-error-in-printf-format-string.patch create mode 100644 selinux-adapt-to-libselinux.patch diff --git a/fix-error-in-printf-format-string.patch b/fix-error-in-printf-format-string.patch new file mode 100644 index 0000000..78edba3 --- /dev/null +++ b/fix-error-in-printf-format-string.patch @@ -0,0 +1,32 @@ +From 56dc1a61719f5133b30676afe71c4d1482c84476 Mon Sep 17 00:00:00 2001 +From: Zhenyu Ye +Date: Thu, 19 Aug 2021 20:14:11 +0800 +Subject: [PATCH] fix error in printf format string + +Use %s to print NULLSTR(duri). + +Reported-by: Peng Liang +Signed-off-by: Zhenyu Ye +Reviewed-by: Michal Privoznik +Signed-off-by: zhujun2 +(cherry-pick from 94ac9d55fd9067326c483372c858bb4233826880) +--- + src/libvirt-domain.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c +index 6ce4a6715c..8f6ff2fe22 100644 +--- a/src/libvirt-domain.c ++++ b/src/libvirt-domain.c +@@ -4086,7 +4086,7 @@ virDomainMigrateToURI(virDomainPtr domain, + const char *dconnuri = NULL; + const char *miguri = NULL; + +- VIR_DOMAIN_DEBUG(domain, "duri=%p, flags=0x%lx, dname=%s, bandwidth=%lu", ++ VIR_DOMAIN_DEBUG(domain, "duri=%s, flags=0x%lx, dname=%s, bandwidth=%lu", + NULLSTR(duri), flags, NULLSTR(dname), bandwidth); + + virResetLastError(); +-- +2.41.0.windows.1 + diff --git a/libvirt.spec b/libvirt.spec index 126d745..b4e7b39 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -101,7 +101,7 @@ Summary: Library providing a simple virtualization API Name: libvirt Version: 6.2.0 -Release: 58 +Release: 59 License: LGPLv2+ URL: https://libvirt.org/ @@ -484,6 +484,8 @@ Patch0371: cpu_topo-support-for-cpu_topo-clusters-in-conf.patch Patch0372: cpu_topo-support-for-specifying-clusters-in-qemu-com.patch Patch0373: cpu_topo-support-for-reporting-cluster_id-in-NUMA-to.patch Patch0374: cpu_topo-fix-detection-of-vCPU-pids-when-multiple-cl.patch +Patch0375: fix-error-in-printf-format-string.patch +Patch0376: selinux-adapt-to-libselinux.patch Requires: libvirt-daemon = %{version}-%{release} Requires: libvirt-daemon-config-network = %{version}-%{release} @@ -2220,6 +2222,10 @@ exit 0 %changelog +* Wed Aug 9 2023 Jiabo Feng - 6.2.0-59 +- selinux: adapt to libselinux +- fix error in printf format string + * Tue May 23 2023 laokz - 6.2.0-58 - add riscv64 support diff --git a/selinux-adapt-to-libselinux.patch b/selinux-adapt-to-libselinux.patch new file mode 100644 index 0000000..e6e188a --- /dev/null +++ b/selinux-adapt-to-libselinux.patch @@ -0,0 +1,39 @@ +From 20fd0fb6b915363efecd2d108363995d8dea8e1a Mon Sep 17 00:00:00 2001 +From: mayunlong +Date: Wed, 9 Aug 2023 16:20:46 +0800 +Subject: [PATCH] selinux: adapt to libselinux + +After libselinux is upgranded to version 3.5, +the function context_str returns "const char *". +As a result, the build fails. Now fix it. + +Signed-off-by:mayunlong +--- + src/security/security_selinux.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/security/security_selinux.c b/src/security/security_selinux.c +index c91c7ca484..cb4dc3e101 100644 +--- a/src/security/security_selinux.c ++++ b/src/security/security_selinux.c +@@ -541,7 +541,7 @@ static char * + virSecuritySELinuxContextAddRange(char *src, + char *dst) + { +- char *str = NULL; ++ const char *str = NULL; + char *ret = NULL; + context_t srccon = NULL; + context_t dstcon = NULL; +@@ -582,7 +582,7 @@ virSecuritySELinuxGenNewContext(const char *basecontext, + { + context_t context = NULL; + char *ret = NULL; +- char *str; ++ const char *str; + char *ourSecContext = NULL; + context_t ourContext = NULL; + +-- +2.41.0.windows.1 + -- Gitee