]> xenbits.xensource.com Git - libvirt.git/commitdiff
Change return value of VIR_APPEND*INPLACE* to void
authorJiri Denemark <jdenemar@redhat.com>
Tue, 17 May 2016 10:59:43 +0000 (12:59 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Wed, 18 May 2016 07:36:23 +0000 (09:36 +0200)
The INPLACE variants of the VIR_APPEND macros cannot fail and they are
inherently quiet.

src/conf/domain_conf.c
src/qemu/qemu_hotplug.c
src/util/viralloc.h

index 694e74ec9ee2beccb08df0d7e8a3785c719dfe7e..5c1fb209fbc91b9a648959b20b410d51d54e4166 100644 (file)
@@ -14012,7 +14012,7 @@ virDomainChrInsertPreAlloced(virDomainDefPtr vmdef,
 
     virDomainChrGetDomainPtrsInternal(vmdef, chr->deviceType, &arrPtr, &cntPtr);
 
-    ignore_value(VIR_APPEND_ELEMENT_INPLACE(*arrPtr, *cntPtr, chr));
+    VIR_APPEND_ELEMENT_INPLACE(*arrPtr, *cntPtr, chr);
 }
 
 virDomainChrDefPtr
index 282774cf05f355e3b6657d714656922897b8c961..0dfaafcd3f036e8c8a7ae9c30cd257b0f461057e 100644 (file)
@@ -1666,7 +1666,7 @@ qemuDomainAttachRNGDevice(virQEMUDriverPtr driver,
         goto cleanup;
     }
 
-    ignore_value(VIR_APPEND_ELEMENT_INPLACE(vm->def->rngs, vm->def->nrngs, rng));
+    VIR_APPEND_ELEMENT_INPLACE(vm->def->rngs, vm->def->nrngs, rng);
 
     ret = 0;
 
index 5f4e27bb80018186434c7a84f280e4d218d41e53..d790b3dfb401829784494889b7959bd519ceb759 100644 (file)
@@ -436,13 +436,17 @@ void virDispose(void *ptrptr, size_t count, size_t element_size, size_t *countpt
                        VIR_TYPEMATCH(ptr, &(newelem)), &(newelem), false, false, \
                        true, VIR_FROM_THIS, __FILE__, __FUNCTION__, __LINE__)
 # define VIR_APPEND_ELEMENT_INPLACE(ptr, count, newelem) \
-    virInsertElementsN(&(ptr), sizeof(*(ptr)), -1, &(count),  \
-                       VIR_TYPEMATCH(ptr, &(newelem)), &(newelem), true, true, \
-                       true, VIR_FROM_THIS, __FILE__, __FUNCTION__, __LINE__)
+    ignore_value(virInsertElementsN(&(ptr), sizeof(*(ptr)), -1, &(count),   \
+                                    VIR_TYPEMATCH(ptr, &(newelem)),         \
+                                    &(newelem), true, true, false,          \
+                                    VIR_FROM_THIS, __FILE__,                \
+                                    __FUNCTION__, __LINE__))
 # define VIR_APPEND_ELEMENT_COPY_INPLACE(ptr, count, newelem) \
-    virInsertElementsN(&(ptr), sizeof(*(ptr)), -1, &(count),  \
-                       VIR_TYPEMATCH(ptr, &(newelem)), &(newelem), false, true, \
-                       true, VIR_FROM_THIS, __FILE__, __FUNCTION__, __LINE__)
+    ignore_value(virInsertElementsN(&(ptr), sizeof(*(ptr)), -1, &(count),   \
+                                    VIR_TYPEMATCH(ptr, &(newelem)),         \
+                                    &(newelem), false, true, false,         \
+                                    VIR_FROM_THIS, __FILE__,                \
+                                    __FUNCTION__, __LINE__))
 
 /* Quiet version of macros above */
 # define VIR_APPEND_ELEMENT_QUIET(ptr, count, newelem) \
@@ -453,14 +457,7 @@ void virDispose(void *ptrptr, size_t count, size_t element_size, size_t *countpt
     virInsertElementsN(&(ptr), sizeof(*(ptr)), -1, &(count),  \
                        VIR_TYPEMATCH(ptr, &(newelem)), &(newelem), false, false, \
                        false, 0, NULL, NULL, 0)
-# define VIR_APPEND_ELEMENT_INPLACE_QUIET(ptr, count, newelem) \
-    virInsertElementsN(&(ptr), sizeof(*(ptr)), -1, &(count),  \
-                       VIR_TYPEMATCH(ptr, &(newelem)), &(newelem), true, true, \
-                       false. 0, NULL, NULL, 0)
-# define VIR_APPEND_ELEMENT_COPY_INPLACE_QUIET(ptr, count, newelem) \
-    virInsertElementsN(&(ptr), sizeof(*(ptr)), -1, &(count),  \
-                       VIR_TYPEMATCH(ptr, &(newelem)), &(newelem), false, true, \
-                       false, 0, NULL, NULL, 0)
+
 /**
  * VIR_DELETE_ELEMENT:
  * @ptr:   pointer to array of objects (*not* ptr to ptr)