* [PATCH v4] kexec-tools: Make xc_dlhandle static
@ 2018-01-24 19:20 Eric DeVolder
2018-01-24 19:26 ` Daniel Kiper
0 siblings, 1 reply; 4+ messages in thread
From: Eric DeVolder @ 2018-01-24 19:20 UTC (permalink / raw)
To: kexec, horms, andrew.cooper3; +Cc: daniel.kiper, eric.devolder, konrad.wilk
This patch is a follow-on to commit 894bea93 "kexec-tools: Perform
run-time linking of libxenctrl.so". This patch addresses feedback
from Daniel Kiper.
This patch implements Daniel's suggestion to make the
xc_dlhandle variable static, insert missing 'extern'
qualifier for the new __xc() wrappers, and correct some
style issues.
Signed-off-by: Eric DeVolder <eric.devolder@oracle.com>
---
v1: 23jan2018
- Implemented feedback from Daniel Kiper
v2: 23jan2018
- Implemented feedback from Daniel Kiper
- Broke patch into two
v3: 24jan2018
- Implemented feedback from Daniel Kiper
- Added 'extern' to the new declarations in kexec-xen.h
v4: 24jan2018
- Implemented feedback from Daniel Kiper
- Corrected style issues
---
kexec/kexec-xen.c | 11 ++++++++++-
kexec/kexec-xen.h | 18 ++++++++----------
2 files changed, 18 insertions(+), 11 deletions(-)
diff --git a/kexec/kexec-xen.c b/kexec/kexec-xen.c
index 75f8758..1887390 100644
--- a/kexec/kexec-xen.c
+++ b/kexec/kexec-xen.c
@@ -15,8 +15,17 @@
#include "crashdump.h"
#ifdef CONFIG_LIBXENCTRL_DL
-void *xc_dlhandle;
+#include <dlfcn.h>
+
+/* The handle from dlopen(), needed by dlsym(), dlclose() */
+static void *xc_dlhandle;
xc_hypercall_buffer_t XC__HYPERCALL_BUFFER_NAME(HYPERCALL_BUFFER_NULL);
+
+void *__xc_dlsym(const char *symbol)
+{
+ return dlsym(xc_dlhandle, symbol);
+}
+
xc_interface *__xc_interface_open(xentoollog_logger *logger,
xentoollog_logger *dombuild_logger,
unsigned open_flags)
diff --git a/kexec/kexec-xen.h b/kexec/kexec-xen.h
index ffb8743..ae67393 100644
--- a/kexec/kexec-xen.h
+++ b/kexec/kexec-xen.h
@@ -5,29 +5,27 @@
#include <xenctrl.h>
#ifdef CONFIG_LIBXENCTRL_DL
-#include <dlfcn.h>
-
-/* The handle from dlopen(), needed by dlsym(), dlclose() */
-extern void *xc_dlhandle;
+/* Lookup symbols in libxenctrl.so */
+extern void *__xc_dlsym(const char *symbol);
/* Wrappers around xc_interface_open/close() to insert dlopen/dlclose() */
-xc_interface *__xc_interface_open(xentoollog_logger *logger,
- xentoollog_logger *dombuild_logger,
- unsigned open_flags);
-int __xc_interface_close(xc_interface *xch);
+extern xc_interface *__xc_interface_open(xentoollog_logger *logger,
+ xentoollog_logger *dombuild_logger,
+ unsigned open_flags);
+extern int __xc_interface_close(xc_interface *xch);
/* GCC expression statements for evaluating dlsym() */
#define __xc_call(dtype, name, args...) \
( \
{ dtype value; \
typedef dtype (*func_t)(xc_interface *, ...); \
- func_t func = dlsym(xc_dlhandle, #name); \
+ func_t func = __xc_dlsym(#name); \
value = func(args); \
value; } \
)
#define __xc_data(dtype, name) \
( \
- { dtype *value = (dtype *)dlsym(xc_dlhandle, #name); value; } \
+ { dtype *value = (dtype *)__xc_dlsym(#name); value; } \
)
/* The wrappers around utilized xenctrl.h functions */
--
2.7.4
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v4] kexec-tools: Make xc_dlhandle static
2018-01-24 19:20 [PATCH v4] kexec-tools: Make xc_dlhandle static Eric DeVolder
@ 2018-01-24 19:26 ` Daniel Kiper
2018-01-25 8:06 ` Simon Horman
0 siblings, 1 reply; 4+ messages in thread
From: Daniel Kiper @ 2018-01-24 19:26 UTC (permalink / raw)
To: Eric DeVolder; +Cc: andrew.cooper3, horms, kexec, konrad.wilk
On Wed, Jan 24, 2018 at 01:20:21PM -0600, Eric DeVolder wrote:
> This patch is a follow-on to commit 894bea93 "kexec-tools: Perform
> run-time linking of libxenctrl.so". This patch addresses feedback
> from Daniel Kiper.
>
> This patch implements Daniel's suggestion to make the
> xc_dlhandle variable static, insert missing 'extern'
> qualifier for the new __xc() wrappers, and correct some
> style issues.
>
> Signed-off-by: Eric DeVolder <eric.devolder@oracle.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Daniel
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v4] kexec-tools: Make xc_dlhandle static
2018-01-24 19:26 ` Daniel Kiper
@ 2018-01-25 8:06 ` Simon Horman
2018-01-25 10:21 ` Daniel Kiper
0 siblings, 1 reply; 4+ messages in thread
From: Simon Horman @ 2018-01-25 8:06 UTC (permalink / raw)
To: Daniel Kiper; +Cc: andrew.cooper3, Eric DeVolder, kexec, konrad.wilk
On Wed, Jan 24, 2018 at 08:26:32PM +0100, Daniel Kiper wrote:
> On Wed, Jan 24, 2018 at 01:20:21PM -0600, Eric DeVolder wrote:
> > This patch is a follow-on to commit 894bea93 "kexec-tools: Perform
> > run-time linking of libxenctrl.so". This patch addresses feedback
> > from Daniel Kiper.
> >
> > This patch implements Daniel's suggestion to make the
> > xc_dlhandle variable static, insert missing 'extern'
> > qualifier for the new __xc() wrappers, and correct some
> > style issues.
> >
> > Signed-off-by: Eric DeVolder <eric.devolder@oracle.com>
>
> Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Thanks, applied.
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v4] kexec-tools: Make xc_dlhandle static
2018-01-25 8:06 ` Simon Horman
@ 2018-01-25 10:21 ` Daniel Kiper
0 siblings, 0 replies; 4+ messages in thread
From: Daniel Kiper @ 2018-01-25 10:21 UTC (permalink / raw)
To: Simon Horman; +Cc: andrew.cooper3, Eric DeVolder, kexec, konrad.wilk
On Thu, Jan 25, 2018 at 09:06:52AM +0100, Simon Horman wrote:
> On Wed, Jan 24, 2018 at 08:26:32PM +0100, Daniel Kiper wrote:
> > On Wed, Jan 24, 2018 at 01:20:21PM -0600, Eric DeVolder wrote:
> > > This patch is a follow-on to commit 894bea93 "kexec-tools: Perform
> > > run-time linking of libxenctrl.so". This patch addresses feedback
> > > from Daniel Kiper.
> > >
> > > This patch implements Daniel's suggestion to make the
> > > xc_dlhandle variable static, insert missing 'extern'
> > > qualifier for the new __xc() wrappers, and correct some
> > > style issues.
> > >
> > > Signed-off-by: Eric DeVolder <eric.devolder@oracle.com>
> >
> > Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
>
> Thanks, applied.
Simon, thank you.
Eric, thank you for doing the work.
Daniel
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-01-25 10:21 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-24 19:20 [PATCH v4] kexec-tools: Make xc_dlhandle static Eric DeVolder
2018-01-24 19:26 ` Daniel Kiper
2018-01-25 8:06 ` Simon Horman
2018-01-25 10:21 ` Daniel Kiper
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.