]> xenbits.xensource.com Git - libvirt.git/commitdiff
Define remote wire protocol & impls for virDomainQemuAttach
authorDaniel P. Berrange <berrange@redhat.com>
Thu, 5 May 2011 16:31:58 +0000 (17:31 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Tue, 12 Jul 2011 14:39:03 +0000 (15:39 +0100)
This tweaks the RPC generator to cope with some naming
conventions used for the QEMU specific APIs

* daemon/remote.c: Server side dispatcher
* src/remote/remote_driver.c: Client side dispatcher
* src/remote/qemu_protocol.x: Wire protocol definition
* src/rpc/gendispatch.pl: Use '$structprefix' in method
  names, fix QEMU flags and fix dispatcher method names

po/POTFILES.in
src/qemu_protocol-structs
src/remote/qemu_protocol.x
src/remote/remote_driver.c
src/rpc/gendispatch.pl

index 1b633789086950b0c14c1ddc110eceb6e3de20cd..5782cbf1df157a41d6c17870b80aba20fa008756 100644 (file)
@@ -1,4 +1,5 @@
 daemon/libvirtd.c
+daemon/qemu_dispatch.h
 daemon/remote.c
 daemon/remote_dispatch.h
 daemon/stream.c
index e93e8bff9ba9b910a50fb07fe75d4e11a1d84961..9c5f6aaae6190c2fb0acee52faaf950d09cee5dc 100644 (file)
@@ -12,3 +12,10 @@ struct qemu_monitor_command_args {
 struct qemu_monitor_command_ret {
         remote_nonnull_string      result;
 };
+struct qemu_domain_attach_args {
+        u_int                      pid;
+        u_int                      flags;
+};
+struct qemu_domain_attach_ret {
+        remote_nonnull_domain      dom;
+};
index fa453f4bbc6914cbbcf36ab68dd9144a90b67db1..9792f709a590362b948bd0bcd4e08c102d0eb94f 100644 (file)
@@ -37,6 +37,16 @@ struct qemu_monitor_command_ret {
     remote_nonnull_string result;
 };
 
+
+struct qemu_domain_attach_args {
+    unsigned int pid;
+    unsigned int flags;
+};
+
+struct qemu_domain_attach_ret {
+    remote_nonnull_domain dom;
+};
+
 /* Define the program number, protocol version and procedure numbers here. */
 const QEMU_PROGRAM = 0x20008087;
 const QEMU_PROTOCOL_VERSION = 1;
@@ -45,5 +55,6 @@ enum qemu_procedure {
     /* Each function must have a two-word comment.  The first word is
      * whether remote_generator.pl handles daemon, the second whether
      * it handles src/remote.  */
-    QEMU_PROC_MONITOR_COMMAND = 1 /* skipgen skipgen */
+    QEMU_PROC_MONITOR_COMMAND = 1, /* skipgen skipgen */
+    QEMU_PROC_DOMAIN_ATTACH = 2 /* autogen autogen */
 };
index 6921c153f53ee271f6a75c39fa7b316091629b4a..a2c62ba6ce8724df49799c45de6e4464afe064f9 100644 (file)
@@ -4237,6 +4237,7 @@ static virDriver remote_driver = {
     .domainRevertToSnapshot = remoteDomainRevertToSnapshot, /* 0.8.0 */
     .domainSnapshotDelete = remoteDomainSnapshotDelete, /* 0.8.0 */
     .qemuDomainMonitorCommand = remoteQemuDomainMonitorCommand, /* 0.8.3 */
+    .qemuDomainAttach = qemuDomainAttach, /* 0.9.4 */
     .domainOpenConsole = remoteDomainOpenConsole, /* 0.8.6 */
     .domainInjectNMI = remoteDomainInjectNMI, /* 0.9.2 */
     .domainMigrateBegin3 = remoteDomainMigrateBegin3, /* 0.9.2 */
index c69c5a2cca017ca97a2de3d626ee892288679327..85a0c0eead4d6481cc4c78d2ec82135fab36502a 100755 (executable)
@@ -821,6 +821,8 @@ elsif ($opt_b) {
                 $proc_name = "ConnectBaselineCPU"
             } elsif ($call->{ProcName} eq "CPUCompare") {
                 $proc_name = "ConnectCompareCPU"
+            } elsif ($structprefix eq "qemu" && $call->{ProcName} =~ /^Domain/) {
+                $proc_name =~ s/^(Domain)/${1}Qemu/;
             }
 
             if ($single_ret_as_list) {
@@ -1323,7 +1325,7 @@ elsif ($opt_k) {
         # print function
         print "\n";
         print "static $single_ret_type\n";
-        print "remote$call->{ProcName}(";
+        print "$structprefix$call->{ProcName}(";
 
         print join(", ", @args_list);
 
@@ -1417,8 +1419,13 @@ elsif ($opt_k) {
             print "    memset(&ret, 0, sizeof ret);\n";
         }
 
+        my $callflags = "0";
+        if ($structprefix eq "qemu") {
+            $callflags = "REMOTE_CALL_QEMU";
+        }
+
         print "\n";
-        print "    if (call($priv_src, priv, 0, ${procprefix}_PROC_$call->{UC_NAME},\n";
+        print "    if (call($priv_src, priv, $callflags, ${procprefix}_PROC_$call->{UC_NAME},\n";
         print "             (xdrproc_t)xdr_$argtype, (char *)$call_args,\n";
         print "             (xdrproc_t)xdr_$rettype, (char *)$call_ret) == -1) {\n";