]> xenbits.xensource.com Git - libvirt.git/commitdiff
Set thread job for every RPC call
authorJiri Denemark <jdenemar@redhat.com>
Wed, 11 Mar 2015 12:58:42 +0000 (13:58 +0100)
committerJiri Denemark <jdenemar@redhat.com>
Wed, 25 Mar 2015 09:00:54 +0000 (10:00 +0100)
Since all APIs are also RPC calls, we automatically get all APIs covered
with thread jobs.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
daemon/remote.c
src/locking/lock_daemon_dispatch.c
src/qemu/qemu_domain.c
src/rpc/gendispatch.pl

index 62a47289909850f09f64cc6aac10246f34612141..ea7ae9485dd278f9056939149de3ce64f3b5d08f 100644 (file)
@@ -51,6 +51,7 @@
 #include "viraccessapicheck.h"
 #include "viraccessapicheckqemu.h"
 #include "virpolkit.h"
+#include "virthreadjob.h"
 
 #define VIR_FROM_THIS VIR_FROM_RPC
 
index 168a6af38874b9f4ed6e29630a97e6a08c4df84f..a7cee9df04dc38709880d9d2fd5274e53ca7d1a8 100644 (file)
@@ -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
 
index 655afb9c341dc81b7ada51c4f8d0c5a38a0a6cc8..e6a7cf50926398df2ea7e0d5f38ab1094cf9a25e 100644 (file)
@@ -39,6 +39,7 @@
 #include "virtime.h"
 #include "virstoragefile.h"
 #include "virstring.h"
+#include "virthreadjob.h"
 
 #include "storage/storage_driver.h"
 
index 8b488ebca8e150324ab4394754a3610afdb41eca..aa73d0c31ba12f746892825efafef878fd3f2477 100755 (executable)
@@ -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