diff mbox series

[RFC,1/6] xen: link against xentoolcore

Message ID 1505498999-17427-2-git-send-email-ian.jackson@eu.citrix.com
State New
Headers show
Series [RFC,1/6] xen: link against xentoolcore | expand

Commit Message

Ian Jackson Sept. 15, 2017, 6:09 p.m. UTC
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 configure | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Jürgen Groß Sept. 22, 2017, 12:14 p.m. UTC | #1
On 15/09/17 20:09, Ian Jackson wrote:
> Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
> ---
>  configure | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/configure b/configure
> index fd7e3a5..c59a0c0 100755
> --- a/configure
> +++ b/configure
> @@ -2072,14 +2072,14 @@ if test "$xen" != "no" ; then
>        $($pkg_config --modversion xencontrol | sed 's/\./ /g') )"
>      xen=yes
>      xen_pc="xencontrol xenstore xenguest xenforeignmemory xengnttab"
> -    xen_pc="$xen_pc xenevtchn xendevicemodel"
> +    xen_pc="$xen_pc xenevtchn xendevicemodel xentoolcore"
>      QEMU_CFLAGS="$QEMU_CFLAGS $($pkg_config --cflags $xen_pc)"
>      libs_softmmu="$($pkg_config --libs $xen_pc) $libs_softmmu"
>      LDFLAGS="$($pkg_config --libs $xen_pc) $LDFLAGS"
>    else
>  
>      xen_libs="-lxenstore -lxenctrl -lxenguest"
> -    xen_stable_libs="-lxenforeignmemory -lxengnttab -lxenevtchn"
> +    xen_stable_libs="-lxenforeignmemory -lxengnttab -lxenevtchn -lxentoolcore"

I don't think this is necessary. libxentoolcore is only available with
a new Xen, which will always have the xentoolcore.pc file installed.


Juergen
Anthony PERARD Sept. 25, 2017, 3:01 p.m. UTC | #2
On Fri, Sep 15, 2017 at 07:09:54PM +0100, Ian Jackson wrote:
> Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
> ---
>  configure | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 

Here is a patch that I think will work, if libxentoolcore is release in
Xen 4.10.

diff --git a/configure b/configure
index 133a5757ef..a22ff71294 100755
--- a/configure
+++ b/configure
@@ -2071,7 +2071,7 @@ if test "$xen" != "no" ; then
       $($pkg_config --modversion xencontrol | sed 's/\./ /g') )"
     xen=yes
     xen_pc="xencontrol xenstore xenguest xenforeignmemory xengnttab"
-    xen_pc="$xen_pc xenevtchn xendevicemodel"
+    xen_pc="$xen_pc xenevtchn xendevicemodel xentoolcore"
     QEMU_CFLAGS="$QEMU_CFLAGS $($pkg_config --cflags $xen_pc)"
     libs_softmmu="$($pkg_config --libs $xen_pc) $libs_softmmu"
     LDFLAGS="$($pkg_config --libs $xen_pc) $LDFLAGS"
@@ -2103,18 +2103,20 @@ EOF
         cat > $TMPC <<EOF &&
 #undef XC_WANT_COMPAT_MAP_FOREIGN_API
 #include <xenforeignmemory.h>
+#include <xentoolcore.h>
 int main(void) {
   xenforeignmemory_handle *xfmem;
 
   xfmem = xenforeignmemory_open(0, 0);
   xenforeignmemory_map2(xfmem, 0, 0, 0, 0, 0, 0, 0);
+  xentoolcore_restrict_all(0);
 
   return 0;
 }
 EOF
-        compile_prog "" "$xen_libs -lxendevicemodel $xen_stable_libs"
+        compile_prog "" "$xen_libs -lxendevicemodel $xen_stable_libs -lxentoolcore"
       then
-      xen_stable_libs="-lxendevicemodel $xen_stable_libs"
+      xen_stable_libs="-lxendevicemodel $xen_stable_libs -lxentoolcore"
       xen_ctrl_version=41000
       xen=yes
     elif
Anthony PERARD Sept. 25, 2017, 3:08 p.m. UTC | #3
On Fri, Sep 22, 2017 at 02:14:16PM +0200, Juergen Gross wrote:
> On 15/09/17 20:09, Ian Jackson wrote:
> > Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
> > ---
> >  configure | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/configure b/configure
> > index fd7e3a5..c59a0c0 100755
> > --- a/configure
> > +++ b/configure
> > @@ -2072,14 +2072,14 @@ if test "$xen" != "no" ; then
> >        $($pkg_config --modversion xencontrol | sed 's/\./ /g') )"
> >      xen=yes
> >      xen_pc="xencontrol xenstore xenguest xenforeignmemory xengnttab"
> > -    xen_pc="$xen_pc xenevtchn xendevicemodel"
> > +    xen_pc="$xen_pc xenevtchn xendevicemodel xentoolcore"
> >      QEMU_CFLAGS="$QEMU_CFLAGS $($pkg_config --cflags $xen_pc)"
> >      libs_softmmu="$($pkg_config --libs $xen_pc) $libs_softmmu"
> >      LDFLAGS="$($pkg_config --libs $xen_pc) $LDFLAGS"
> >    else
> >  
> >      xen_libs="-lxenstore -lxenctrl -lxenguest"
> > -    xen_stable_libs="-lxenforeignmemory -lxengnttab -lxenevtchn"
> > +    xen_stable_libs="-lxenforeignmemory -lxengnttab -lxenevtchn -lxentoolcore"
> 
> I don't think this is necessary. libxentoolcore is only available with
> a new Xen, which will always have the xentoolcore.pc file installed.

Only if ! echo $EXTRA_LDFLAGS | grep tools/libxc;

So building qemu via xen.git Makefiles, the pkg-config files are not
taken into account.
Jürgen Groß Sept. 25, 2017, 3:16 p.m. UTC | #4
On 25/09/17 17:08, Anthony PERARD wrote:
> On Fri, Sep 22, 2017 at 02:14:16PM +0200, Juergen Gross wrote:
>> On 15/09/17 20:09, Ian Jackson wrote:
>>> Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
>>> ---
>>>  configure | 4 ++--
>>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/configure b/configure
>>> index fd7e3a5..c59a0c0 100755
>>> --- a/configure
>>> +++ b/configure
>>> @@ -2072,14 +2072,14 @@ if test "$xen" != "no" ; then
>>>        $($pkg_config --modversion xencontrol | sed 's/\./ /g') )"
>>>      xen=yes
>>>      xen_pc="xencontrol xenstore xenguest xenforeignmemory xengnttab"
>>> -    xen_pc="$xen_pc xenevtchn xendevicemodel"
>>> +    xen_pc="$xen_pc xenevtchn xendevicemodel xentoolcore"
>>>      QEMU_CFLAGS="$QEMU_CFLAGS $($pkg_config --cflags $xen_pc)"
>>>      libs_softmmu="$($pkg_config --libs $xen_pc) $libs_softmmu"
>>>      LDFLAGS="$($pkg_config --libs $xen_pc) $LDFLAGS"
>>>    else
>>>  
>>>      xen_libs="-lxenstore -lxenctrl -lxenguest"
>>> -    xen_stable_libs="-lxenforeignmemory -lxengnttab -lxenevtchn"
>>> +    xen_stable_libs="-lxenforeignmemory -lxengnttab -lxenevtchn -lxentoolcore"
>>
>> I don't think this is necessary. libxentoolcore is only available with
>> a new Xen, which will always have the xentoolcore.pc file installed.
> 
> Only if ! echo $EXTRA_LDFLAGS | grep tools/libxc;
> 
> So building qemu via xen.git Makefiles, the pkg-config files are not
> taken into account.
> 

Aah, right, this patch for the Xen build system is still missing.

In Xen 4.11 we should drop passing all the flags to configure and use
the pkg-config files instead.


Juergen
Ian Jackson Oct. 3, 2017, 5:25 p.m. UTC | #5
Anthony PERARD writes ("Re: [Qemu-devel] [PATCH RFC 1/6] xen: link against xentoolcore"):
> Here is a patch that I think will work, if libxentoolcore is release in
> Xen 4.10.

Thanks very much.  I have, more or less, adopted this.  Thanks also
for your other comments, which I have addressed.

Ian.
diff mbox series

Patch

diff --git a/configure b/configure
index fd7e3a5..c59a0c0 100755
--- a/configure
+++ b/configure
@@ -2072,14 +2072,14 @@  if test "$xen" != "no" ; then
       $($pkg_config --modversion xencontrol | sed 's/\./ /g') )"
     xen=yes
     xen_pc="xencontrol xenstore xenguest xenforeignmemory xengnttab"
-    xen_pc="$xen_pc xenevtchn xendevicemodel"
+    xen_pc="$xen_pc xenevtchn xendevicemodel xentoolcore"
     QEMU_CFLAGS="$QEMU_CFLAGS $($pkg_config --cflags $xen_pc)"
     libs_softmmu="$($pkg_config --libs $xen_pc) $libs_softmmu"
     LDFLAGS="$($pkg_config --libs $xen_pc) $LDFLAGS"
   else
 
     xen_libs="-lxenstore -lxenctrl -lxenguest"
-    xen_stable_libs="-lxenforeignmemory -lxengnttab -lxenevtchn"
+    xen_stable_libs="-lxenforeignmemory -lxengnttab -lxenevtchn -lxentoolcore"
 
     # First we test whether Xen headers and libraries are available.
     # If no, we are done and there is no Xen support.