[libvirt] [PATCH 3/3] blockjob: add blockcommit support to rpc

Eric Blake eblake at redhat.com
Mon Sep 17 22:08:45 UTC 2012


Relatively straightforward.  Our decision to make block job
speed a long keeps haunting us on new API.

* src/remote/remote_protocol.x (remote_domain_block_commit_args):
New struct.
* src/remote/remote_driver.c (remote_driver): Enable it.
* src/remote_protocol-structs: Regenerate.
* src/rpc/gendispatch.pl (long_legacy): Exempt another bandwidth.
---
 src/remote/remote_driver.c   |  1 +
 src/remote/remote_protocol.x | 12 +++++++++++-
 src/remote_protocol-structs  |  9 +++++++++
 src/rpc/gendispatch.pl       |  1 +
 4 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index 8f3895d..b6edf38 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -6045,6 +6045,7 @@ static virDriver remote_driver = {
     .domainBlockJobSetSpeed = remoteDomainBlockJobSetSpeed, /* 0.9.4 */
     .domainBlockPull = remoteDomainBlockPull, /* 0.9.4 */
     .domainBlockRebase = remoteDomainBlockRebase, /* 0.9.10 */
+    .domainBlockCommit = remoteDomainBlockCommit, /* 0.10.2 */
     .setKeepAlive = remoteSetKeepAlive, /* 0.9.8 */
     .isAlive = remoteIsAlive, /* 0.9.8 */
     .nodeSuspendForDuration = remoteNodeSuspendForDuration, /* 0.9.8 */
diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x
index 6201ff7..9481f15 100644
--- a/src/remote/remote_protocol.x
+++ b/src/remote/remote_protocol.x
@@ -1224,6 +1224,14 @@ struct remote_domain_block_rebase_args {
     unsigned hyper bandwidth;
     unsigned int flags;
 };
+struct remote_domain_block_commit_args {
+    remote_nonnull_domain dom;
+    remote_nonnull_string disk;
+    remote_string base;
+    remote_string top;
+    unsigned hyper bandwidth;
+    unsigned int flags;
+};

 struct remote_domain_set_block_io_tune_args {
     remote_nonnull_domain dom;
@@ -2988,7 +2996,9 @@ enum remote_procedure {
     REMOTE_PROC_CONNECT_LIST_ALL_NWFILTERS = 286, /* skipgen skipgen priority:high */
     REMOTE_PROC_CONNECT_LIST_ALL_SECRETS = 287, /* skipgen skipgen priority:high */
     REMOTE_PROC_NODE_SET_MEMORY_PARAMETERS = 288, /* autogen autogen */
-    REMOTE_PROC_NODE_GET_MEMORY_PARAMETERS = 289 /* skipgen skipgen */
+    REMOTE_PROC_NODE_GET_MEMORY_PARAMETERS = 289, /* skipgen skipgen */
+    REMOTE_PROC_DOMAIN_BLOCK_COMMIT = 290 /* autogen autogen */
+

     /*
      * Notice how the entries are grouped in sets of 10 ?
diff --git a/src/remote_protocol-structs b/src/remote_protocol-structs
index 52ccf80..8b0ae1f 100644
--- a/src/remote_protocol-structs
+++ b/src/remote_protocol-structs
@@ -875,6 +875,14 @@ struct remote_domain_block_rebase_args {
         uint64_t                   bandwidth;
         u_int                      flags;
 };
+struct remote_domain_block_commit_args {
+        remote_nonnull_domain      dom;
+        remote_nonnull_string      disk;
+        remote_string              base;
+        remote_string              top;
+        uint64_t                   bandwidth;
+        u_int                      flags;
+};
 struct remote_domain_set_block_io_tune_args {
         remote_nonnull_domain      dom;
         remote_nonnull_string      disk;
@@ -2397,4 +2405,5 @@ enum remote_procedure {
         REMOTE_PROC_CONNECT_LIST_ALL_SECRETS = 287,
         REMOTE_PROC_NODE_SET_MEMORY_PARAMETERS = 288,
         REMOTE_PROC_NODE_GET_MEMORY_PARAMETERS = 289,
+        REMOTE_PROC_DOMAIN_BLOCK_COMMIT = 290,
 };
diff --git a/src/rpc/gendispatch.pl b/src/rpc/gendispatch.pl
index 774977d..ae7ecba 100755
--- a/src/rpc/gendispatch.pl
+++ b/src/rpc/gendispatch.pl
@@ -276,6 +276,7 @@ my $long_legacy = {
     GetLibVersion               => { ret => { lib_ver => 1 } },
     GetVersion                  => { ret => { hv_ver => 1 } },
     NodeGetInfo                 => { ret => { memory => 1 } },
+    DomainBlockCommit           => { arg => { bandwidth => 1 } },
     DomainBlockPull             => { arg => { bandwidth => 1 } },
     DomainBlockRebase           => { arg => { bandwidth => 1 } },
     DomainBlockJobSetSpeed      => { arg => { bandwidth => 1 } },
-- 
1.7.11.4




More information about the libvir-list mailing list