From b9dfd34699b0cfa1dc0c9498c6a23716770c9266 Mon Sep 17 00:00:00 2001 From: qihao_yewu Date: Thu, 24 Nov 2022 20:16:13 +0800 Subject: [PATCH 1/2] Fix the invalid "+" operation between incompatible types (cherry picked from commit 32e64efd99fa07497988571af2291793fcc767ef) --- ...operation-between-incompatible-types.patch | 27 +++++++++++++++++++ libvirt-python.spec | 6 ++++- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 Fix-the-invalid-operation-between-incompatible-types.patch diff --git a/Fix-the-invalid-operation-between-incompatible-types.patch b/Fix-the-invalid-operation-between-incompatible-types.patch new file mode 100644 index 0000000..556e093 --- /dev/null +++ b/Fix-the-invalid-operation-between-incompatible-types.patch @@ -0,0 +1,27 @@ +From 787c5e56deede97ede263c104c2e7c54af922d39 Mon Sep 17 00:00:00 2001 +From: qihao_yewu +Date: Thu, 24 Nov 2022 19:54:14 +0800 +Subject: [PATCH] Fix the invalid "+" operation between incompatible types + +Change the ending position of parentheses. + +Signed-off-by: qihao_yewu +--- + examples/guest-vcpus/guest-vcpu-daemon.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/examples/guest-vcpus/guest-vcpu-daemon.py b/examples/guest-vcpus/guest-vcpu-daemon.py +index 30fcb9c..211e9d4 100755 +--- a/examples/guest-vcpus/guest-vcpu-daemon.py ++++ b/examples/guest-vcpus/guest-vcpu-daemon.py +@@ -103,7 +103,7 @@ def work(): + try: + conn = libvirt.open(uri) + except: +- print('Failed to connect to ' + uri + ', retry in ' + str(connectRetryTimeout)) + ' seconds' ++ print('Failed to connect to ' + uri + ', retry in ' + str(connectRetryTimeout) + ' seconds') + time.sleep(connectRetryTimeout) + continue + +-- +2.18.2 diff --git a/libvirt-python.spec b/libvirt-python.spec index 402383e..9edd26c 100644 --- a/libvirt-python.spec +++ b/libvirt-python.spec @@ -3,7 +3,7 @@ Summary: The libvirt virtualization API python3 binding Name: libvirt-python Version: 6.2.0 -Release: 3 +Release: 4 Source0: http://libvirt.org/sources/python/%{name}-%{version}.tar.gz Patch0000: setup-use-pytest-instead-of-nose-to-run-the-test-sui.patch Patch0001: spec-use-pytest-instead-of-nose.patch @@ -12,6 +12,7 @@ Patch0003: Fix-PY_SSIZE_T_CLEAN-deprecation-warning.patch Patch0004: Avoid-use-of-thread-function-deprecated-in-3.9.patch Patch0005: Replace-deprecated-PyEval_CallObject-with-PyObject_C.patch Patch0006: Avoid-truncating-python-version-number-when-running-.patch +Patch0007: Fix-the-invalid-operation-between-incompatible-types.patch Url: http://libvirt.org License: LGPLv2+ BuildRequires: libvirt-devel == %{version} @@ -76,6 +77,9 @@ find examples -type f -exec chmod 0644 \{\} \; %{python3_sitearch}/*egg-info %changelog +* Fri Nov 25 2022 Qi Hao - 6.2.0-4 +- Fix the invalid "+" operation between incompatible types + * Tue Mar 29 2022 yezengruan - 6.2.0-3 - Avoid truncating python version number when running sanity test -- Gitee From 0e62cbeaf24e4a0e62d070bc68e87c15d37ade0a Mon Sep 17 00:00:00 2001 From: qihao_yewu Date: Fri, 25 Nov 2022 09:56:10 +0800 Subject: [PATCH 2/2] generator: Fix string formatting cheery-pick from d2de75dd838801ef47c834f91c9f8ef5ed892d29 remove excessive arguments. Signed-off-by: Philipp Hahn Signed-off-by: qihao_yewu (cherry picked from commit f7a756951d3f3776a6a81d9405de36cc48ddc100) --- Fix-string-formatting.patch | 28 ++++++++++++++++++++++++++++ libvirt-python.spec | 6 +++++- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 Fix-string-formatting.patch diff --git a/Fix-string-formatting.patch b/Fix-string-formatting.patch new file mode 100644 index 0000000..605dda6 --- /dev/null +++ b/Fix-string-formatting.patch @@ -0,0 +1,28 @@ +From a24c9df52ce15f7ad5742e0693ef6108d7a2ea10 Mon Sep 17 00:00:00 2001 +From: qihao_yewu +Date: Thu, 24 Nov 2022 19:59:54 +0800 +Subject: [PATCH] generator: Fix string formatting + +remove excessive arguments. + +Signed-off-by: Philipp Hahn +Signed-off-by: qihao_yewu +--- + generator.py | 2 +---- + 1 file changed, 1 insertion(+), 1 deletions(-) + +diff --git a/generator.py b/generator.py +index 426f007..5e89136 100755 +--- a/generator.py ++++ b/generator.py +@@ -766,7 +766,7 @@ def print_function_wrapper(module, name, output, export, include): + if file == "python_accessor": + if args[1][1] == "char *": + c_call = "\n VIR_FREE(%s->%s);\n" % ( +- args[0][0], args[1][0], args[0][0], args[1][0]) ++ args[0][0], args[1][0]) + c_call = c_call + " %s->%s = (%s)strdup((const xmlChar *)%s);\n" % (args[0][0], + args[1][0], args[1][1], args[1][0]) + else: +-- +2.18.2 diff --git a/libvirt-python.spec b/libvirt-python.spec index 9edd26c..6c66a4f 100644 --- a/libvirt-python.spec +++ b/libvirt-python.spec @@ -3,7 +3,7 @@ Summary: The libvirt virtualization API python3 binding Name: libvirt-python Version: 6.2.0 -Release: 4 +Release: 5 Source0: http://libvirt.org/sources/python/%{name}-%{version}.tar.gz Patch0000: setup-use-pytest-instead-of-nose-to-run-the-test-sui.patch Patch0001: spec-use-pytest-instead-of-nose.patch @@ -13,6 +13,7 @@ Patch0004: Avoid-use-of-thread-function-deprecated-in-3.9.patch Patch0005: Replace-deprecated-PyEval_CallObject-with-PyObject_C.patch Patch0006: Avoid-truncating-python-version-number-when-running-.patch Patch0007: Fix-the-invalid-operation-between-incompatible-types.patch +Patch0008: Fix-string-formatting.patch Url: http://libvirt.org License: LGPLv2+ BuildRequires: libvirt-devel == %{version} @@ -77,6 +78,9 @@ find examples -type f -exec chmod 0644 \{\} \; %{python3_sitearch}/*egg-info %changelog +* Tue Nov 29 2022 Qi Hao - 6.2.0-5 +- generator: Fix string formatting + * Fri Nov 25 2022 Qi Hao - 6.2.0-4 - Fix the invalid "+" operation between incompatible types -- Gitee