* [PATCH 1/4] xen: Take into account Xen control interface changes since Xen Ver. 4.1
@ 2011-08-21 13:51 Daniel Kiper
2011-08-22 3:56 ` Konrad Rzeszutek Wilk
0 siblings, 1 reply; 3+ messages in thread
From: Daniel Kiper @ 2011-08-21 13:51 UTC (permalink / raw)
To: konrad.wilk, ian.campbell, vgoyal, horms, olaf, kexec, xen-devel,
linux-kernel
xc_interface_open() receive three arguments instead of void and returns
pointer to xc_interface type instead of int since Xen Ver. 4.1. Take into
account that and allow kexec-tools compilation with all versions of Xen.
Signed-off-by: Daniel Kiper <dkiper@net-space.pl>
---
kexec/crashdump-xen.c | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)
diff --git a/kexec/crashdump-xen.c b/kexec/crashdump-xen.c
index b347764..9dfabf8 100644
--- a/kexec/crashdump-xen.c
+++ b/kexec/crashdump-xen.c
@@ -126,19 +126,32 @@ unsigned long xen_architecture(struct crash_elf_info *elf_info)
{
unsigned long machine = elf_info->machine;
#ifdef HAVE_LIBXENCTRL
- int xc, rc;
+ int rc;
xen_capabilities_info_t capabilities;
+#ifdef XENCTRL_HAS_XC_INTERFACE
+ xc_interface *xc;
+#else
+ int xc;
+#endif
if (!xen_present())
goto out;
memset(capabilities, '0', XEN_CAPABILITIES_INFO_LEN);
+#ifdef XENCTRL_HAS_XC_INTERFACE
+ xc = xc_interface_open(NULL, NULL, 0);
+ if ( !xc ) {
+ fprintf(stderr, "failed to open xen control interface.\n");
+ goto out;
+ }
+#else
xc = xc_interface_open();
if ( xc == -1 ) {
fprintf(stderr, "failed to open xen control interface.\n");
goto out;
}
+#endif
rc = xc_version(xc, XENVER_capabilities, &capabilities[0]);
if ( rc == -1 ) {
--
1.5.6.5
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/4] xen: Take into account Xen control interface changes since Xen Ver. 4.1
2011-08-21 13:51 [PATCH 1/4] xen: Take into account Xen control interface changes since Xen Ver. 4.1 Daniel Kiper
@ 2011-08-22 3:56 ` Konrad Rzeszutek Wilk
2011-08-22 13:25 ` Daniel Kiper
0 siblings, 1 reply; 3+ messages in thread
From: Konrad Rzeszutek Wilk @ 2011-08-22 3:56 UTC (permalink / raw)
To: Daniel Kiper
Cc: ian.campbell, vgoyal, horms, olaf, kexec, xen-devel, linux-kernel
> xc_interface_open() receive three arguments instead of void and returns
> pointer to xc_interface type instead of int since Xen Ver. 4.1. Take into
> account that and allow kexec-tools compilation with all versions of Xen.
>
> Signed-off-by: Daniel Kiper <dkiper@net-space.pl>
> ---
> kexec/crashdump-xen.c | 15 ++++++++++++++-
> 1 files changed, 14 insertions(+), 1 deletions(-)
>
> diff --git a/kexec/crashdump-xen.c b/kexec/crashdump-xen.c
> index b347764..9dfabf8 100644
> --- a/kexec/crashdump-xen.c
> +++ b/kexec/crashdump-xen.c
> @@ -126,19 +126,32 @@ unsigned long xen_architecture(struct crash_elf_info
*elf_info)
> {
> unsigned long machine = elf_info->machine;
> #ifdef HAVE_LIBXENCTRL
> - int xc, rc;
> + int rc;
> xen_capabilities_info_t capabilities;
> +#ifdef XENCTRL_HAS_XC_INTERFACE
> + xc_interface *xc;
> +#else
> + int xc;
> +#endif
Where is the #endif for HAVE_LIBXENCTRL?
>
> if (!xen_present())
> goto out;
>
> memset(capabilities, '0', XEN_CAPABILITIES_INFO_LEN);
>
> +#ifdef XENCTRL_HAS_XC_INTERFACE
> + xc = xc_interface_open(NULL, NULL, 0);
> + if ( !xc ) {
> + fprintf(stderr, "failed to open xen control interface.\n");
> + goto out;
> + }
> +#else
> xc = xc_interface_open();
> if ( xc == -1 ) {
> fprintf(stderr, "failed to open xen control interface.\n");
> goto out;
> }
> +#endif
>
> rc = xc_version(xc, XENVER_capabilities, &capabilities[0]);
> if ( rc == -1 ) {
> --
> 1.5.6.5
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/4] xen: Take into account Xen control interface changes since Xen Ver. 4.1
2011-08-22 3:56 ` Konrad Rzeszutek Wilk
@ 2011-08-22 13:25 ` Daniel Kiper
0 siblings, 0 replies; 3+ messages in thread
From: Daniel Kiper @ 2011-08-22 13:25 UTC (permalink / raw)
To: Konrad Rzeszutek Wilk
Cc: Daniel Kiper, olaf, xen-devel, ian.campbell, kexec, linux-kernel,
horms, vgoyal
On Sun, Aug 21, 2011 at 11:56:50PM -0400, Konrad Rzeszutek Wilk wrote:
> > xc_interface_open() receive three arguments instead of void and returns
> > pointer to xc_interface type instead of int since Xen Ver. 4.1. Take into
> > account that and allow kexec-tools compilation with all versions of Xen.
> >
> > Signed-off-by: Daniel Kiper <dkiper@net-space.pl>
> > ---
> > kexec/crashdump-xen.c | 15 ++++++++++++++-
> > 1 files changed, 14 insertions(+), 1 deletions(-)
> >
> > diff --git a/kexec/crashdump-xen.c b/kexec/crashdump-xen.c
> > index b347764..9dfabf8 100644
> > --- a/kexec/crashdump-xen.c
> > +++ b/kexec/crashdump-xen.c
> > @@ -126,19 +126,32 @@ unsigned long xen_architecture(struct crash_elf_info
> *elf_info)
> > {
> > unsigned long machine = elf_info->machine;
> > #ifdef HAVE_LIBXENCTRL
> > - int xc, rc;
> > + int rc;
> > xen_capabilities_info_t capabilities;
> > +#ifdef XENCTRL_HAS_XC_INTERFACE
> > + xc_interface *xc;
> > +#else
> > + int xc;
> > +#endif
>
> Where is the #endif for HAVE_LIBXENCTRL?
At the end of this function. It is not included in this patch.
Daniel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-08-22 13:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-21 13:51 [PATCH 1/4] xen: Take into account Xen control interface changes since Xen Ver. 4.1 Daniel Kiper
2011-08-22 3:56 ` Konrad Rzeszutek Wilk
2011-08-22 13:25 ` Daniel Kiper
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®