[libvirt PATCH 3/8] remote: use g_new0 instead of VIR_ALLOC

Pavel Hrdina phrdina at redhat.com
Thu Oct 8 16:07:13 UTC 2020


On Thu, Oct 08, 2020 at 02:12:09PM +0200, Ján Tomko wrote:
> Signed-off-by: Ján Tomko <jtomko at redhat.com>
> ---
>  src/remote/remote_daemon_config.c   |   3 +-
>  src/remote/remote_daemon_dispatch.c | 225 ++++++++++------------------
>  src/remote/remote_daemon_stream.c   |   6 +-
>  src/remote/remote_driver.c          | 102 ++++---------
>  4 files changed, 108 insertions(+), 228 deletions(-)

[...]

> diff --git a/src/remote/remote_daemon_dispatch.c b/src/remote/remote_daemon_dispatch.c
> index a659737bc7..90115167fb 100644
> --- a/src/remote/remote_daemon_dispatch.c
> +++ b/src/remote/remote_daemon_dispatch.c
> @@ -2413,16 +2406,14 @@ remoteDispatchDomainMemoryStats(virNetServerPtr server G_GNUC_UNUSED,
>          goto cleanup;
>  
>      /* Allocate stats array for making dispatch call */
> -    if (VIR_ALLOC_N(stats, args->maxStats) < 0)
> -        goto cleanup;
> +    stats = g_new0(struct _virDomainMemoryStat, args->maxStats);

We have virDomainMemoryStatStruct but this works as well.

Pavel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20201008/3bdecb91/attachment-0001.sig>


More information about the libvir-list mailing list