[PATCH v2 07/15] test: Annotate few fields of testDriver structure

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

 



Some of the fields are either immutable or self locking, so make a note
of that for future reference.
---
 src/test/test_driver.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index f105055..0cd8e6a 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -96,11 +96,7 @@ struct _testDriver {
     virMutex lock;

     int nextDomID;
-    virCapsPtr caps;
-    virDomainXMLOptionPtr xmlopt;
     virNodeInfo nodeInfo;
-    virDomainObjListPtr domains;
-    virNetworkObjListPtr networks;
     virInterfaceObjList ifaces;
     bool transaction_running;
     virInterfaceObjList backupIfaces;
@@ -111,6 +107,16 @@ struct _testDriver {
     size_t numAuths;
     testAuthPtr auths;

+    /* immutable pointer, immutable object after being initialized with
+     * testBuildCapabilities */
+    virCapsPtr caps;
+
+    /* immutable pointer, immutable object */
+    virDomainXMLOptionPtr xmlopt;
+
+    /* immutable pointer, self-locking APIs */
+    virDomainObjListPtr domains;
+    virNetworkObjListPtr networks;
     virObjectEventStatePtr eventState;
 };
 typedef struct _testDriver testDriver;
-- 
2.4.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]