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

[Libvir] Patch: Fix documentation and code of virGetDomain function




It turns out that you _can't_ pass name=NULL to virGetDomain, despite what the docs say.

Rich.

--
Emerging Technologies, Red Hat  http://et.redhat.com/~rjones/
64 Baker Street, London, W1U 7DF     Mobile: +44 7866 314 421
 "[Negative numbers] darken the very whole doctrines of the equations
 and make dark of the things which are in their nature excessively
 obvious and simple" (Francis Maseres FRS, mathematician, 1759)
Index: src/hash.c
===================================================================
RCS file: /data/cvs/libvirt/src/hash.c,v
retrieving revision 1.17
diff -u -r1.17 hash.c
--- src/hash.c	14 Feb 2007 15:40:54 -0000	1.17
+++ src/hash.c	28 Feb 2007 16:15:06 -0000
@@ -735,8 +735,8 @@
 /**
  * virGetDomain:
  * @conn: the hypervisor connection
- * @name: pointer to the domain name or NULL
- * @uuid: pointer to the uuid or NULL
+ * @name: pointer to the domain name
+ * @uuid: pointer to the uuid
  *
  * Lookup if the domain is already registered for that connection,
  * if yes return a new pointer to it, if no allocate a new structure,
@@ -749,7 +749,7 @@
 virGetDomain(virConnectPtr conn, const char *name, const unsigned char *uuid) {
     virDomainPtr ret = NULL;
 
-    if ((!VIR_IS_CONNECT(conn)) || ((name == NULL) && (uuid == NULL)) ||
+    if ((!VIR_IS_CONNECT(conn)) || (name == NULL) || (uuid == NULL) ||
         (conn->hashes_mux == NULL)) {
         virHashError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
         return(NULL);

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


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