[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/8] qapi/qom: Introduce smp-cache object
From: |
Zhao Liu |
Subject: |
Re: [PATCH 2/8] qapi/qom: Introduce smp-cache object |
Date: |
Tue, 9 Jul 2024 18:13:04 +0800 |
> diff --git a/hw/core/smp-cache.c b/hw/core/smp-cache.c
> new file mode 100644
> index 000000000000..c0157ce51c8f
> --- /dev/null
> +++ b/hw/core/smp-cache.c
> @@ -0,0 +1,103 @@
> +/*
> + * Cache Object for SMP machine
> + *
> + * Copyright (C) 2024 Intel Corporation.
> + *
> + * Author: Zhao Liu <zhao1.liu@intel.com>
> + *
> + * This work is licensed under the terms of the GNU GPL, version 2 or
> + * later. See the COPYING file in the top-level directory.
> + */
> +
> +#include "qemu/osdep.h"
> +
> +#include "hw/core/smp-cache.h"
> +#include "qapi/error.h"
> +#include "qapi/qapi-visit-machine-common.h"
> +#include "qom/object_interfaces.h"
> +
> +static void
> +smp_cache_get_cache_prop(Object *obj, Visitor *v, const char *name,
> + void *opaque, Error **errp)
> +{
> + SMPCache *cache = SMP_CACHE(obj);
> + SMPCachePropertyList *head = NULL;
> + SMPCachePropertyList **tail = &head;
> +
> + for (int i = 0; i < SMP_CACHE__MAX; i++) {
> + SMPCacheProperty *node = g_new(SMPCacheProperty, 1);
> +
> + node->name = cache->props[i].name;
> + node->topo = cache->props[i].topo;
> + QAPI_LIST_APPEND(tail, node);
> + }
> +
> + if (!visit_type_SMPCachePropertyList(v, name, &head, errp)) {
> + return;
Oops, here I shouldn't return. Whether it succeeds or not, I should
continue with the following free().
> + }
> + qapi_free_SMPCachePropertyList(head);
> +}
[PATCH 2/8] qapi/qom: Introduce smp-cache object, Zhao Liu, 2024/07/03
- Re: [PATCH 2/8] qapi/qom: Introduce smp-cache object,
Zhao Liu <=
- Re: [PATCH 2/8] qapi/qom: Introduce smp-cache object, Markus Armbruster, 2024/07/22
- Re: [PATCH 2/8] qapi/qom: Introduce smp-cache object, Zhao Liu, 2024/07/22
- Re: [PATCH 2/8] qapi/qom: Introduce smp-cache object, Markus Armbruster, 2024/07/24
- Re: [PATCH 2/8] qapi/qom: Introduce smp-cache object, Daniel P . Berrangé, 2024/07/24
- Re: [PATCH 2/8] qapi/qom: Introduce smp-cache object, Zhao Liu, 2024/07/24
- Re: [PATCH 2/8] qapi/qom: Introduce smp-cache object, Zhao Liu, 2024/07/24
Re: [PATCH 2/8] qapi/qom: Introduce smp-cache object, Zhao Liu, 2024/07/24
Re: [PATCH 2/8] qapi/qom: Introduce smp-cache object, Markus Armbruster, 2024/07/25
Message not availableRe: [PATCH 2/8] qapi/qom: Introduce smp-cache object, Jonathan Cameron, 2024/07/25
Re: [PATCH 2/8] qapi/qom: Introduce smp-cache object, Zhao Liu, 2024/07/25