]> xenbits.xensource.com Git - libvirt.git/commitdiff
docs: Refer to virReportOOMError in the HACKING file
authorMatthias Bolte <matthias.bolte@googlemail.com>
Sat, 30 Jan 2010 11:35:04 +0000 (12:35 +0100)
committerMatthias Bolte <matthias.bolte@googlemail.com>
Thu, 4 Feb 2010 18:09:28 +0000 (19:09 +0100)
Instead of refering to __virRaiseError(VIR_ERROR_NO_MEMORY).

HACKING
docs/hacking.html.in

diff --git a/HACKING b/HACKING
index 3844e50b80be4f133606e6a78e9b688c17ba44e8..4bf216cf4e760c2061e473ed5e89402127f918a7 100644 (file)
--- a/HACKING
+++ b/HACKING
@@ -166,13 +166,13 @@ codebase, because they encourage a number of serious coding bugs and do
 not enable compile time verification of checks for NULL. Instead of these
 routines, use the macros from memory.h
 
-  - eg to allocate  a single object:
+  - eg to allocate a single object:
 
       virDomainPtr domain;
 
       if (VIR_ALLOC(domain) < 0) {
-         __virRaiseError(VIR_ERROR_NO_MEMORY)
-         return NULL;
+          virReportOOMError(NULL);
+          return NULL;
       }
 
 
@@ -182,8 +182,8 @@ routines, use the macros from memory.h
        int ndomains = 10;
 
        if (VIR_ALLOC_N(domains, ndomains) < 0) {
-         __virRaiseError(VIR_ERROR_NO_MEMORY)
-         return NULL;
+           virReportOOMError(NULL);
+           return NULL;
        }
 
   - eg to allocate an array of object pointers
@@ -192,8 +192,8 @@ routines, use the macros from memory.h
        int ndomains = 10;
 
        if (VIR_ALLOC_N(domains, ndomains) < 0) {
-         __virRaiseError(VIR_ERROR_NO_MEMORY)
-         return NULL;
+           virReportOOMError(NULL);
+           return NULL;
        }
 
    - eg to re-allocate the array of domains to be longer
@@ -201,8 +201,8 @@ routines, use the macros from memory.h
        ndomains = 20
 
        if (VIR_REALLOC_N(domains, ndomains) < 0) {
-         __virRaiseError(VIR_ERROR_NO_MEMORY)
-         return NULL;
+           virReportOOMError(NULL);
+           return NULL;
        }
 
    - eg to free the domain
@@ -297,7 +297,7 @@ eg typical usage is as follows:
 
      if (virBufferError(&buf)) {
          virBufferFreeAndReset(&buf);
-         virReportOOMError(...);
+         virReportOOMError(NULL);
          return NULL;
      }
 
@@ -385,7 +385,7 @@ to build:
   - if a recently commited patch breaks compilation on a platform
     or for a given driver then it's fine to commit a minimal fix
     directly without getting the review feedback first
-  - similary if make check or make syntax-chek breaks, if there is
+  - similary if make check or make syntax-check breaks, if there is
     an obvious fix, it's fine to commit immediately
 The patch should still be sent to the list (or tell what the fix was if
 trivial) and 'make check syntax-check' should pass too before commiting
index 96f6657cc6c7a1f119a46ef0fb47f8cf3933bc96..71b4f47145112565fdf63c59fcf68edf7eba0000 100644 (file)
       virDomainPtr domain;
 
       if (VIR_ALLOC(domain) &lt; 0) {
-         __virRaiseError(VIR_ERROR_NO_MEMORY)
-         return NULL;
+          virReportOOMError(NULL);
+          return NULL;
       }
 </pre></li>
 
        int ndomains = 10;
 
        if (VIR_ALLOC_N(domains, ndomains) &lt; 0) {
-         __virRaiseError(VIR_ERROR_NO_MEMORY)
-         return NULL;
+           virReportOOMError(NULL);
+           return NULL;
        }
 </pre></li>
 
        int ndomains = 10;
 
        if (VIR_ALLOC_N(domains, ndomains) &lt; 0) {
-         __virRaiseError(VIR_ERROR_NO_MEMORY)
-         return NULL;
+           virReportOOMError(NULL);
+           return NULL;
        }
 </pre></li>
 
        ndomains = 20
 
        if (VIR_REALLOC_N(domains, ndomains) &lt; 0) {
-         __virRaiseError(VIR_ERROR_NO_MEMORY)
-         return NULL;
+           virReportOOMError(NULL);
+           return NULL;
        }
 </pre></li>
 
 
      if (virBufferError(&amp;buf)) {
          virBufferFreeAndReset(&amp;buf);
-         virReportOOMError(...);
+         virReportOOMError(NULL);
          return NULL;
      }
 
       <li>if a recently commited patch breaks compilation on a platform
         or for a given driver then it's fine to commit a minimal fix
         directly without getting the review feedback first</li>
-      <li>if make check or make syntax-chek breaks, if there is
+      <li>if make check or make syntax-check breaks, if there is
         an obvious fix, it's fine to commit immediately.
         The patch should still be sent to the list (or tell what the fix was if
         trivial) and 'make check syntax-check' should pass too before commiting