[libvirt] [PATCH 08/13] Rename domain lifecycle event message

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



To avoid confusion, rename the current REMOTE_PROC_DOMAIN_EVENT
message to REMOTE_PROC_DOMAIN_EVENT_LIFECYCLE. This does not
cause ABI problems, since the names are only relevant at the source
code level. On the wire they encoding is a plain integer whose
value does not change

* src/remote/remote_protocol.x: Rename REMOTE_PROC_DOMAIN_EVENT
  to REMOTE_PROC_DOMAIN_EVENT_LIFECYCLE.
* daemon/remote.c, src/remote/remote_driver.c: Update code for
  renamed event
---
 daemon/remote.c                |    6 +++---
 daemon/remote_dispatch_table.h |    2 +-
 src/remote/remote_driver.c     |    8 ++++----
 src/remote/remote_protocol.c   |    2 +-
 src/remote/remote_protocol.h   |   10 +++++-----
 src/remote/remote_protocol.x   |    4 ++--
 6 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/daemon/remote.c b/daemon/remote.c
index fd3aa4e..c55331c 100644
--- a/daemon/remote.c
+++ b/daemon/remote.c
@@ -105,7 +105,7 @@ static int remoteRelayDomainEventLifecycle(virConnectPtr conn ATTRIBUTE_UNUSED,
                                            void *opaque)
 {
     struct qemud_client *client = opaque;
-    remote_domain_event_msg data;
+    remote_domain_event_lifecycle_msg data;
 
     if (!client)
         return -1;
@@ -121,8 +121,8 @@ static int remoteRelayDomainEventLifecycle(virConnectPtr conn ATTRIBUTE_UNUSED,
     data.detail = detail;
 
     remoteDispatchDomainEventSend (client,
-                                   REMOTE_PROC_DOMAIN_EVENT,
-                                   (xdrproc_t)xdr_remote_domain_event_msg, &data);
+                                   REMOTE_PROC_DOMAIN_EVENT_LIFECYCLE,
+                                   (xdrproc_t)xdr_remote_domain_event_lifecycle_msg, &data);
 
     virMutexUnlock(&client->lock);
 
diff --git a/daemon/remote_dispatch_table.h b/daemon/remote_dispatch_table.h
index 6abf0ff..adfc58b 100644
--- a/daemon/remote_dispatch_table.h
+++ b/daemon/remote_dispatch_table.h
@@ -537,7 +537,7 @@
     .args_filter = (xdrproc_t) xdr_void,
     .ret_filter = (xdrproc_t) xdr_remote_domain_events_deregister_ret,
 },
-{   /* Async event DomainEvent => 107 */
+{   /* Async event DomainEventLifecycle => 107 */
     .fn = NULL,
     .args_filter = (xdrproc_t) xdr_void,
     .ret_filter = (xdrproc_t) xdr_void,
diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index eba29f2..8b6db9c 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -6863,13 +6863,13 @@ done:
 static virDomainEventPtr
 remoteDomainReadEventLifecycle(virConnectPtr conn, XDR *xdr)
 {
-    remote_domain_event_msg msg;
+    remote_domain_event_lifecycle_msg msg;
     virDomainPtr dom;
     virDomainEventPtr event = NULL;
     memset (&msg, 0, sizeof msg);
 
     /* unmarshall parameters, and process it*/
-    if (! xdr_remote_domain_event_msg(xdr, &msg) ) {
+    if (! xdr_remote_domain_event_lifecycle_msg(xdr, &msg) ) {
         error (conn, VIR_ERR_RPC,
                _("unable to demarshall lifecycle event"));
         return NULL;
@@ -6880,7 +6880,7 @@ remoteDomainReadEventLifecycle(virConnectPtr conn, XDR *xdr)
         return NULL;
 
     event = virDomainEventNewFromDom(dom, msg.event, msg.detail);
-    xdr_free ((xdrproc_t) &xdr_remote_domain_event_msg, (char *) &msg);
+    xdr_free ((xdrproc_t) &xdr_remote_domain_event_lifecycle_msg, (char *) &msg);
 
     virDomainFree(dom);
     return event;
@@ -8396,7 +8396,7 @@ processCallDispatchMessage(virConnectPtr conn, struct private_data *priv,
     }
 
     switch (hdr->proc) {
-    case REMOTE_PROC_DOMAIN_EVENT:
+    case REMOTE_PROC_DOMAIN_EVENT_LIFECYCLE:
         event = remoteDomainReadEventLifecycle(conn, xdr);
         break;
 
diff --git a/src/remote/remote_protocol.c b/src/remote/remote_protocol.c
index 3f4af38..3ad8958 100644
--- a/src/remote/remote_protocol.c
+++ b/src/remote/remote_protocol.c
@@ -2560,7 +2560,7 @@ xdr_remote_domain_events_deregister_ret (XDR *xdrs, remote_domain_events_deregis
 }
 
 bool_t
-xdr_remote_domain_event_msg (XDR *xdrs, remote_domain_event_msg *objp)
+xdr_remote_domain_event_lifecycle_msg (XDR *xdrs, remote_domain_event_lifecycle_msg *objp)
 {
 
          if (!xdr_remote_nonnull_domain (xdrs, &objp->dom))
diff --git a/src/remote/remote_protocol.h b/src/remote/remote_protocol.h
index 40e1094..9005d6f 100644
--- a/src/remote/remote_protocol.h
+++ b/src/remote/remote_protocol.h
@@ -1450,12 +1450,12 @@ struct remote_domain_events_deregister_ret {
 };
 typedef struct remote_domain_events_deregister_ret remote_domain_events_deregister_ret;
 
-struct remote_domain_event_msg {
+struct remote_domain_event_lifecycle_msg {
         remote_nonnull_domain dom;
         int event;
         int detail;
 };
-typedef struct remote_domain_event_msg remote_domain_event_msg;
+typedef struct remote_domain_event_lifecycle_msg remote_domain_event_lifecycle_msg;
 
 struct remote_domain_xml_from_native_args {
         remote_nonnull_string nativeFormat;
@@ -1824,7 +1824,7 @@ enum remote_procedure {
         REMOTE_PROC_DOMAIN_MEMORY_PEEK = 104,
         REMOTE_PROC_DOMAIN_EVENTS_REGISTER = 105,
         REMOTE_PROC_DOMAIN_EVENTS_DEREGISTER = 106,
-        REMOTE_PROC_DOMAIN_EVENT = 107,
+        REMOTE_PROC_DOMAIN_EVENT_LIFECYCLE = 107,
         REMOTE_PROC_DOMAIN_MIGRATE_PREPARE2 = 108,
         REMOTE_PROC_DOMAIN_MIGRATE_FINISH2 = 109,
         REMOTE_PROC_GET_URI = 110,
@@ -2150,7 +2150,7 @@ extern  bool_t xdr_remote_node_device_create_xml_ret (XDR *, remote_node_device_
 extern  bool_t xdr_remote_node_device_destroy_args (XDR *, remote_node_device_destroy_args*);
 extern  bool_t xdr_remote_domain_events_register_ret (XDR *, remote_domain_events_register_ret*);
 extern  bool_t xdr_remote_domain_events_deregister_ret (XDR *, remote_domain_events_deregister_ret*);
-extern  bool_t xdr_remote_domain_event_msg (XDR *, remote_domain_event_msg*);
+extern  bool_t xdr_remote_domain_event_lifecycle_msg (XDR *, remote_domain_event_lifecycle_msg*);
 extern  bool_t xdr_remote_domain_xml_from_native_args (XDR *, remote_domain_xml_from_native_args*);
 extern  bool_t xdr_remote_domain_xml_from_native_ret (XDR *, remote_domain_xml_from_native_ret*);
 extern  bool_t xdr_remote_domain_xml_to_native_args (XDR *, remote_domain_xml_to_native_args*);
@@ -2435,7 +2435,7 @@ extern bool_t xdr_remote_node_device_create_xml_ret ();
 extern bool_t xdr_remote_node_device_destroy_args ();
 extern bool_t xdr_remote_domain_events_register_ret ();
 extern bool_t xdr_remote_domain_events_deregister_ret ();
-extern bool_t xdr_remote_domain_event_msg ();
+extern bool_t xdr_remote_domain_event_lifecycle_msg ();
 extern bool_t xdr_remote_domain_xml_from_native_args ();
 extern bool_t xdr_remote_domain_xml_from_native_ret ();
 extern bool_t xdr_remote_domain_xml_to_native_args ();
diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x
index 60435f4..2807afa 100644
--- a/src/remote/remote_protocol.x
+++ b/src/remote/remote_protocol.x
@@ -1299,7 +1299,7 @@ struct remote_domain_events_deregister_ret {
     int cb_registered;
 };
 
-struct remote_domain_event_msg {
+struct remote_domain_event_lifecycle_msg {
     remote_nonnull_domain dom;
     int event;
     int detail;
@@ -1649,7 +1649,7 @@ enum remote_procedure {
     REMOTE_PROC_DOMAIN_MEMORY_PEEK = 104,
     REMOTE_PROC_DOMAIN_EVENTS_REGISTER = 105,
     REMOTE_PROC_DOMAIN_EVENTS_DEREGISTER = 106,
-    REMOTE_PROC_DOMAIN_EVENT = 107,
+    REMOTE_PROC_DOMAIN_EVENT_LIFECYCLE = 107,
     REMOTE_PROC_DOMAIN_MIGRATE_PREPARE2 = 108,
     REMOTE_PROC_DOMAIN_MIGRATE_FINISH2 = 109,
     REMOTE_PROC_GET_URI = 110,
-- 
1.6.6.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]