[libvirt PATCH] qemu: Don't warn when releasing a released job

Jiri Denemark posted 1 patch 1 year, 4 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/d263c2ad17bc9c259cb2af3cd5295e3e996b3071.1670939261.git.jdenemar@redhat.com
src/qemu/qemu_domainjob.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
[libvirt PATCH] qemu: Don't warn when releasing a released job
Posted by Jiri Denemark 1 year, 4 months ago
When qemuDomainObjReleaseAsyncJob is called when the current async job
is already released we emit quite useless warning which was implemented
to warn about releasing a job owned by another thread.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
 src/qemu/qemu_domainjob.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_domainjob.c b/src/qemu/qemu_domainjob.c
index 4d320f075e..8d958b9d21 100644
--- a/src/qemu/qemu_domainjob.c
+++ b/src/qemu/qemu_domainjob.c
@@ -647,7 +647,8 @@ qemuDomainObjReleaseAsyncJob(virDomainObj *obj)
     VIR_DEBUG("Releasing ownership of '%s' async job",
               virDomainAsyncJobTypeToString(obj->job->asyncJob));
 
-    if (obj->job->asyncOwner != virThreadSelfID()) {
+    if (obj->job->asyncOwner != 0 &&
+        obj->job->asyncOwner != virThreadSelfID()) {
         VIR_WARN("'%s' async job is owned by thread %llu",
                  virDomainAsyncJobTypeToString(obj->job->asyncJob),
                  obj->job->asyncOwner);
-- 
2.39.0
Re: [libvirt PATCH] qemu: Don't warn when releasing a released job
Posted by Peter Krempa 1 year, 4 months ago
On Tue, Dec 13, 2022 at 14:47:41 +0100, Jiri Denemark wrote:
> When qemuDomainObjReleaseAsyncJob is called when the current async job
> is already released we emit quite useless warning which was implemented
> to warn about releasing a job owned by another thread.

So isn't it still a programming error when attempting to release the job
after it was released already?

> 
> Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
> ---
>  src/qemu/qemu_domainjob.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Reviewed-by: Peter Krempa <pkrempa@redhat.com>