mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-27 07:22:07 +03:00
Change return value of VIR_APPEND*INPLACE* to void
The INPLACE variants of the VIR_APPEND macros cannot fail and they are inherently quiet.
This commit is contained in:
parent
d8d4b9d957
commit
f2b4609723
@ -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
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user