OK so this is step 2.5 out of 8 ... it wasn't part of the original plan.

2.5 Export virGetDomain and virGetNetwork
-----------------------------------------

M src/libvirt_sym.version
M src/hash.c
M src/internal.h

This patch exports virGetDomain and virGetNetwork functions as "internal" functions (__virGetDomain and __virGetNetwork) for use by the remote daemon.

The use is as follows: client needs to invoke a function such as virDomainSuspend (virDomainPtr dom). In order to do this it has to send a reference to "dom" over the wire to the server, which it does by encoding a remote_nonnull_domain XDR object (basically the name and UUID). On the server side we use virGetDomain to pull out the corresponding virDomainPtr from the hash associated with the connection.

Rich.

--
Emerging Technologies, Red Hat  http://et.redhat.com/~rjones/
64 Baker Street, London, W1U 7DF     Mobile: +44 7866 314 421

Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod
Street, Windsor, Berkshire, SL4 1TE, United Kingdom.
Registered in England and Wales under Company Registration No. 3798903
Directors: Michael Cunningham (USA), Charlie Peters (USA) and David
Owens (Ireland)
Index: src/libvirt_sym.version
===================================================================
RCS file: /data/cvs/libvirt/src/libvirt_sym.version,v
retrieving revision 1.19
diff -u -r1.19 libvirt_sym.version
--- src/libvirt_sym.version	15 Mar 2007 17:24:57 -0000	1.19
+++ src/libvirt_sym.version	5 May 2007 10:50:14 -0000
@@ -93,5 +93,8 @@
 	__virConfWriteFile;
 	__virConfWriteMem;
 
+	__virGetDomain;
+	__virGetNetwork;
+
     local: *;
 };
Index: src/hash.c
===================================================================
RCS file: /data/cvs/libvirt/src/hash.c,v
retrieving revision 1.20
diff -u -r1.20 hash.c
--- src/hash.c	4 Apr 2007 14:19:49 -0000	1.20
+++ src/hash.c	5 May 2007 10:50:15 -0000
@@ -744,7 +744,7 @@
  * Returns a pointer to the domain, or NULL in case of failure
  */
 virDomainPtr
-virGetDomain(virConnectPtr conn, const char *name, const unsigned char *uuid) {
+__virGetDomain(virConnectPtr conn, const char *name, const unsigned char *uuid) {
     virDomainPtr ret = NULL;
 
     if ((!VIR_IS_CONNECT(conn)) || (name == NULL) || (uuid == NULL) ||
@@ -926,7 +926,7 @@
  * Returns a pointer to the network, or NULL in case of failure
  */
 virNetworkPtr
-virGetNetwork(virConnectPtr conn, const char *name, const unsigned char *uuid) {
+__virGetNetwork(virConnectPtr conn, const char *name, const unsigned char *uuid) {
     virNetworkPtr ret = NULL;
 
     if ((!VIR_IS_CONNECT(conn)) || (name == NULL) || (uuid == NULL) ||
Index: src/internal.h
===================================================================
RCS file: /data/cvs/libvirt/src/internal.h,v
retrieving revision 1.39
diff -u -r1.39 internal.h
--- src/internal.h	24 Apr 2007 13:44:16 -0000	1.39
+++ src/internal.h	5 May 2007 10:50:15 -0000
@@ -212,19 +212,22 @@
 
 virConnectPtr	virGetConnect	(void);
 int		virFreeConnect	(virConnectPtr conn);
-virDomainPtr	virGetDomain	(virConnectPtr conn,
+virDomainPtr	__virGetDomain	(virConnectPtr conn,
 				 const char *name,
 				 const unsigned char *uuid);
 int		virFreeDomain	(virConnectPtr conn,
 				 virDomainPtr domain);
 virDomainPtr	virGetDomainByID(virConnectPtr conn,
 				 int id);
-virNetworkPtr	virGetNetwork	(virConnectPtr conn,
+virNetworkPtr	__virGetNetwork	(virConnectPtr conn,
 				 const char *name,
 				 const unsigned char *uuid);
 int		virFreeNetwork	(virConnectPtr conn,
 				 virNetworkPtr domain);
 
+#define virGetDomain(c,n,u) __virGetDomain((c),(n),(u))
+#define virGetNetwork(c,n,u) __virGetNetwork((c),(n),(u))
+
 #ifdef __cplusplus
 }
 #endif                          /* __cplusplus */

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

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

Reply via email to