From 667cce7b60e9645794179fce7de3b161531e4145 Mon Sep 17 00:00:00 2001 From: Jiri Denemark Date: Wed, 11 Mar 2015 13:58:42 +0100 Subject: [PATCH] Set thread job for every RPC call Since all APIs are also RPC calls, we automatically get all APIs covered with thread jobs. Signed-off-by: Jiri Denemark --- daemon/remote.c | 1 + src/locking/lock_daemon_dispatch.c | 1 + src/qemu/qemu_domain.c | 1 + src/rpc/gendispatch.pl | 6 +++++- 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/daemon/remote.c b/daemon/remote.c index 62a4728990..ea7ae9485d 100644 --- a/daemon/remote.c +++ b/daemon/remote.c @@ -51,6 +51,7 @@ #include "viraccessapicheck.h" #include "viraccessapicheckqemu.h" #include "virpolkit.h" +#include "virthreadjob.h" #define VIR_FROM_THIS VIR_FROM_RPC diff --git a/src/locking/lock_daemon_dispatch.c b/src/locking/lock_daemon_dispatch.c index 168a6af388..a7cee9df04 100644 --- a/src/locking/lock_daemon_dispatch.c +++ b/src/locking/lock_daemon_dispatch.c @@ -29,6 +29,7 @@ #include "lock_daemon.h" #include "lock_protocol.h" #include "virerror.h" +#include "virthreadjob.h" #define VIR_FROM_THIS VIR_FROM_RPC diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 655afb9c34..e6a7cf5092 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -39,6 +39,7 @@ #include "virtime.h" #include "virstoragefile.h" #include "virstring.h" +#include "virthreadjob.h" #include "storage/storage_driver.h" diff --git a/src/rpc/gendispatch.pl b/src/rpc/gendispatch.pl index 8b488ebca8..aa73d0c31b 100755 --- a/src/rpc/gendispatch.pl +++ b/src/rpc/gendispatch.pl @@ -428,8 +428,10 @@ elsif ($mode eq "server") { print " void *args$argann,\n"; print " void *ret$retann)\n"; print "{\n"; + print " int rv;\n"; + print " virThreadJobSet(\"$name\");\n"; print " VIR_DEBUG(\"server=%p client=%p msg=%p rerr=%p args=%p ret=%p\", server, client, msg, rerr, args, ret);\n"; - print " return $name(server, client, msg, rerr"; + print " rv = $name(server, client, msg, rerr"; if ($argtype ne "void") { print ", args"; } @@ -437,6 +439,8 @@ elsif ($mode eq "server") { print ", ret"; } print ");\n"; + print " virThreadJobClear(rv);\n"; + print " return rv;\n"; print "}\n"; # Finally we print out the dispatcher method body impl