From c1bc644bad59b34f952fafc7f8f3f52c9fccc5c7 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Wed, 9 Apr 2008 14:00:07 +0000
Subject: [PATCH] Warn about conn, dom and net fields in virterror         *
 include/libvirt/virterror.h: Warn about the use of           conn, dom and
 net fields in virterror.

---
 ChangeLog                   |  6 ++++++
 include/libvirt/virterror.h | 10 +++++++---
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 7f9f7fc249..453dc1378a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Wed Apr  9 14:56:00 BST 2008 Richard W.M. Jones <rjones@redhat.com>
+
+	Warn about conn, dom and net fields in virterror
+	* include/libvirt/virterror.h: Warn about the use of
+	  conn, dom and net fields in virterror.
+
 Wed Apr  9 14:46:00 BST 2008 Richard W.M. Jones <rjones@redhat.com>
 
 	Remove extraneous underscore
diff --git a/include/libvirt/virterror.h b/include/libvirt/virterror.h
index a4155b346a..460b42f383 100644
--- a/include/libvirt/virterror.h
+++ b/include/libvirt/virterror.h
@@ -63,6 +63,10 @@ typedef enum {
  * virError:
  *
  * A libvirt Error instance.
+ *
+ * The conn, dom and net fields should be used with extreme care.
+ * Reference counts are not incremented so the underlying objects
+ * may be deleted without notice after the error has been delivered.
  */
 
 typedef struct _virError virError;
@@ -72,14 +76,14 @@ struct _virError {
     int		domain;	/* What part of the library raised this error */
     char       *message;/* human-readable informative error message */
     virErrorLevel level;/* how consequent is the error */
-    virConnectPtr conn;	/* the connection if available */
-    virDomainPtr dom;	/* the domain if available */
+    virConnectPtr conn;	/* connection if available, see note above */
+    virDomainPtr dom;	/* domain if available, see note above */
     char       *str1;	/* extra string information */
     char       *str2;	/* extra string information */
     char       *str3;	/* extra string information */
     int		int1;	/* extra number information */
     int		int2;	/* extra number information */
-    virNetworkPtr net;	/* the network if available */
+    virNetworkPtr net;	/* network if available, see note above */
 };
 
 /**