All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf-next] libbpf: mark bpf_object__open_xattr() deprecated
@ 2022-01-25  1:09 Christy Lee
  2022-01-25  4:54 ` Andrii Nakryiko
  0 siblings, 1 reply; 2+ messages in thread
From: Christy Lee @ 2022-01-25  1:09 UTC (permalink / raw)
  To: andrii, christyc.y.lee; +Cc: bpf, kernel-team, Christy Lee

Mark bpf_object__open_xattr() as deprecated, use
bpf_object__open_file() instead.

  [0] Closes: https://github.com/libbpf/libbpf/issues/287

Signed-off-by: Christy Lee <christylee@fb.com>
---
 tools/lib/bpf/libbpf.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/lib/bpf/libbpf.h b/tools/lib/bpf/libbpf.h
index 94670066de62..55dba4c38a04 100644
--- a/tools/lib/bpf/libbpf.h
+++ b/tools/lib/bpf/libbpf.h
@@ -183,6 +183,7 @@ bpf_object__open_mem(const void *obj_buf, size_t obj_buf_sz,
 LIBBPF_API struct bpf_object *
 bpf_object__open_buffer(const void *obj_buf, size_t obj_buf_sz,
 			const char *name);
+LIBBPF_DEPRECATED_SINCE(0, 8, "use bpf_object__open_file() instead")
 LIBBPF_API struct bpf_object *
 bpf_object__open_xattr(struct bpf_object_open_attr *attr);
 
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH bpf-next] libbpf: mark bpf_object__open_xattr() deprecated
  2022-01-25  1:09 [PATCH bpf-next] libbpf: mark bpf_object__open_xattr() deprecated Christy Lee
@ 2022-01-25  4:54 ` Andrii Nakryiko
  0 siblings, 0 replies; 2+ messages in thread
From: Andrii Nakryiko @ 2022-01-25  4:54 UTC (permalink / raw)
  To: Christy Lee; +Cc: Andrii Nakryiko, Christy Lee, bpf, Kernel Team

On Mon, Jan 24, 2022 at 5:09 PM Christy Lee <christylee@fb.com> wrote:
>
> Mark bpf_object__open_xattr() as deprecated, use
> bpf_object__open_file() instead.
>
>   [0] Closes: https://github.com/libbpf/libbpf/issues/287
>
> Signed-off-by: Christy Lee <christylee@fb.com>
> ---
>  tools/lib/bpf/libbpf.h | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/tools/lib/bpf/libbpf.h b/tools/lib/bpf/libbpf.h
> index 94670066de62..55dba4c38a04 100644
> --- a/tools/lib/bpf/libbpf.h
> +++ b/tools/lib/bpf/libbpf.h
> @@ -183,6 +183,7 @@ bpf_object__open_mem(const void *obj_buf, size_t obj_buf_sz,
>  LIBBPF_API struct bpf_object *
>  bpf_object__open_buffer(const void *obj_buf, size_t obj_buf_sz,
>                         const char *name);
> +LIBBPF_DEPRECATED_SINCE(0, 8, "use bpf_object__open_file() instead")
>  LIBBPF_API struct bpf_object *
>  bpf_object__open_xattr(struct bpf_object_open_attr *attr);

You've missed one internal use of bpf_object__open_xattr() in
bpf_prog_load_xattr2(), which would cause compilation warning (turned
error) at the next version bump. I've updated that to
__bpf_object__open_xattr(&open_attr, 0).

Best way to catch this is to temporarily change DEPRECATED_SINCE to
the current version (0.7) and compile everything with that.

But also given a better API exists for a long time now, we can
deprecate bpf_object__open_xattr() right now, so I changed
DEPRECATED_SINCE to 0.7 and applied to bpf-next, thanks.

>
> --
> 2.30.2
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-01-25  6:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-25  1:09 [PATCH bpf-next] libbpf: mark bpf_object__open_xattr() deprecated Christy Lee
2022-01-25  4:54 ` Andrii Nakryiko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.