Re: [PATCH 05/23] util: alloc: Reimplement VIR_APPEND_ELEMENT_COPY using virAppendElement

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

 



On 8/4/21 1:02 PM, Peter Krempa wrote:
> Use virAppendElement instead of virInsertElementsN to implement
> VIR_APPEND_ELEMENT_COPY which allows us to remove error handling as the
> only relevant errors were removed when switching to aborting memory
> allocation functions.
> 
> Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
> ---
>  src/conf/domain_conf.c           | 29 +++++------------------------
>  src/conf/nwfilter_conf.c         | 12 +++---------
>  src/conf/virnwfilterobj.c        |  8 ++------
>  src/cpu/cpu_x86.c                | 12 ++++--------
>  src/logging/log_handler.c        |  6 ++----
>  src/openvz/openvz_conf.c         |  5 ++---
>  src/qemu/qemu_domain.c           |  6 +-----
>  src/qemu/qemu_hotplug.c          |  6 ++----
>  src/util/viralloc.h              |  4 ++--
>  src/util/virfirewall.c           |  8 ++------
>  tests/nwfilterxml2firewalltest.c |  7 +------
>  11 files changed, 26 insertions(+), 77 deletions(-)

Squash this in please:

diff --git i/src/vz/vz_sdk.c w/src/vz/vz_sdk.c
index e09950812d..8a027a50b8 100644
--- i/src/vz/vz_sdk.c
+++ w/src/vz/vz_sdk.c
@@ -578,8 +578,7 @@ prlsdkAddDomainVideoInfoVm(PRL_HANDLE sdkdom, virDomainDef *def)
     video = g_new0(virDomainVideoDef, 1);
     accel = g_new0(virDomainVideoAccelDef, 1);
 
-    if (VIR_APPEND_ELEMENT_COPY(def->videos, def->nvideos, video) < 0)
-        goto error;
+    VIR_APPEND_ELEMENT_COPY(def->videos, def->nvideos, video);
 
     video->type = VIR_DOMAIN_VIDEO_TYPE_VGA;
     video->vram = videoRam << 10; /* from mbibytes to kbibytes */

Michal




[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]

  Powered by Linux