diff mbox

[raisin,4/4] Update to 4.7, update qemu and qemu_traditional recipes

Message ID 1465829063-22291-5-git-send-email-george.dunlap@citrix.com (mailing list archive)
State New, archived
Headers show

Commit Message

George Dunlap June 13, 2016, 2:44 p.m. UTC
Add a 4.7 config file, make it the default.

Also update the qemu and qemu_traditional recipies after Ian Cambell's
work to split off separate libraries.

Signed-off-by: George Dunlap <george.dunlap@citrix.com>
---
CC: Stefano Stabellini <sstabellini@kernel.org>
---
 components/qemu             | 21 +++++++++++++--------
 components/qemu_traditional |  2 +-
 configs/config-4.7          |  8 ++++++++
 defconfig                   |  2 +-
 4 files changed, 23 insertions(+), 10 deletions(-)

Comments

Stefano Stabellini June 14, 2016, 9:46 a.m. UTC | #1
On Mon, 13 Jun 2016, George Dunlap wrote:
> Add a 4.7 config file, make it the default.
> 
> Also update the qemu and qemu_traditional recipies after Ian Cambell's
> work to split off separate libraries.
> 
> Signed-off-by: George Dunlap <george.dunlap@citrix.com>
> ---
> CC: Stefano Stabellini <sstabellini@kernel.org>
> ---
>  components/qemu             | 21 +++++++++++++--------
>  components/qemu_traditional |  2 +-
>  configs/config-4.7          |  8 ++++++++
>  defconfig                   |  2 +-
>  4 files changed, 23 insertions(+), 10 deletions(-)
> 
> diff --git a/components/qemu b/components/qemu
> index e0d92a5..8624b50 100644
> --- a/components/qemu
> +++ b/components/qemu
> @@ -23,15 +23,20 @@ function qemu_build() {
>      cd "$BASEDIR"
>      git-checkout $QEMU_URL $QEMU_REVISION qemu-dir
>      cd qemu-dir
> -    ./configure --enable-xen --target-list=i386-softmmu --prefix=$PREFIX \
> -        --extra-cflags="-I$INST_DIR/$PREFIX/include" \
> -        --extra-ldflags="-L$INST_DIR/$PREFIX/lib -Wl,-rpath-link=$INST_DIR/$PREFIX/lib \
> +
> +    ./configure --enable-xen --target-list=i386-softmmu \
> +		--prefix=$PREFIX \
> +		--extra-cflags="-DXC_WANT_COMPAT_EVTCHN_API=1 \
> +		-DXC_WANT_COMPAT_GNTTAB_API=1 \
> +		-DXC_WANT_COMPAT_MAP_FOREIGN_API=1 \
> +                -I$INST_DIR/$PREFIX/include" \
> +		--extra-ldflags="-L$INST_DIR/$PREFIX/lib -Wl,-rpath-link=$INST_DIR/$PREFIX/lib \
>                           -L$INST_DIR/$PREFIX/lib64 -Wl,-rpath-link=$INST_DIR/$PREFIX/lib64" \
> -        --disable-kvm \
> -        --disable-docs \
> -        --bindir=$PREFIX/lib/xen/bin \
> -        --datadir=$PREFIX/share/qemu-xen \
> -        --disable-guest-agent
> +		--bindir=$PREFIX/lib/xen/bin \
> +		--datadir=$PREFIX/share/qemu-xen \
> +		--disable-kvm \
> +		--disable-docs \
> +		--disable-guest-agent

This is adding XC_WANT_COMPAT_EVTCHN_API=1, etc, unconditionally. If we
make this change, will raisin still be able to buil an older qemu
against an older xen?



>      $RAISIN_MAKE all
>      $RAISIN_MAKE install DESTDIR="$INST_DIR"
>      cd "$BASEDIR"
> diff --git a/components/qemu_traditional b/components/qemu_traditional
> index 3150c3e..8732fe2 100644
> --- a/components/qemu_traditional
> +++ b/components/qemu_traditional
> @@ -30,7 +30,7 @@ function qemu_traditional_build() {
>  
>      export CONFIG_BLKTAP1=n
>      export XEN_ROOT="$BASEDIR"/xen-dir
> -    ./xen-setup
> +    ./xen-setup --extra-cflags="-D__XEN_TOOLS__"
>      $RAISIN_MAKE all
>      $RAISIN_MAKE install DESTDIR="$INST_DIR"
>      cd "$BASEDIR"
> diff --git a/configs/config-4.7 b/configs/config-4.7
> new file mode 100644
> index 0000000..66fe467
> --- /dev/null
> +++ b/configs/config-4.7
> @@ -0,0 +1,8 @@
> +XEN_REVISION="origin/stable-4.7"
> +QEMU_REVISION="origin/stable-4.7"
> +QEMU_TRADITIONAL_REVISION="origin/stable-4.7"
> +SEABIOS_REVISION="rel-1.9.2"
> +GRUB_REVISION="master"
> +LIBVIRT_REVISION="origin/v1.3.3-maint"
> +OVMF_REVISION="52a99493cce88a9d4ec8a02d7f1bd1a1001ce60d"
> +LINUX_REVISION="master"
> diff --git a/defconfig b/defconfig
> index 8e79a43..f8ef398 100644
> --- a/defconfig
> +++ b/defconfig
> @@ -2,7 +2,7 @@
>  # Setup a Xen based system.
>  
>  # Available options: 4.5, 4.6, master (for development branch)
> -XEN_RELEASE="4.6"
> +XEN_RELEASE="4.7"
>  
>  # Components
>  ## All components: seabios ovmf xen qemu qemu_traditional grub libvirt linux
George Dunlap June 14, 2016, 10:03 a.m. UTC | #2
On 14/06/16 10:46, Stefano Stabellini wrote:
> On Mon, 13 Jun 2016, George Dunlap wrote:
>> Add a 4.7 config file, make it the default.
>>
>> Also update the qemu and qemu_traditional recipies after Ian Cambell's
>> work to split off separate libraries.
>>
>> Signed-off-by: George Dunlap <george.dunlap@citrix.com>
>> ---
>> CC: Stefano Stabellini <sstabellini@kernel.org>
>> ---
>>  components/qemu             | 21 +++++++++++++--------
>>  components/qemu_traditional |  2 +-
>>  configs/config-4.7          |  8 ++++++++
>>  defconfig                   |  2 +-
>>  4 files changed, 23 insertions(+), 10 deletions(-)
>>
>> diff --git a/components/qemu b/components/qemu
>> index e0d92a5..8624b50 100644
>> --- a/components/qemu
>> +++ b/components/qemu
>> @@ -23,15 +23,20 @@ function qemu_build() {
>>      cd "$BASEDIR"
>>      git-checkout $QEMU_URL $QEMU_REVISION qemu-dir
>>      cd qemu-dir
>> -    ./configure --enable-xen --target-list=i386-softmmu --prefix=$PREFIX \
>> -        --extra-cflags="-I$INST_DIR/$PREFIX/include" \
>> -        --extra-ldflags="-L$INST_DIR/$PREFIX/lib -Wl,-rpath-link=$INST_DIR/$PREFIX/lib \
>> +
>> +    ./configure --enable-xen --target-list=i386-softmmu \
>> +		--prefix=$PREFIX \
>> +		--extra-cflags="-DXC_WANT_COMPAT_EVTCHN_API=1 \
>> +		-DXC_WANT_COMPAT_GNTTAB_API=1 \
>> +		-DXC_WANT_COMPAT_MAP_FOREIGN_API=1 \
>> +                -I$INST_DIR/$PREFIX/include" \
>> +		--extra-ldflags="-L$INST_DIR/$PREFIX/lib -Wl,-rpath-link=$INST_DIR/$PREFIX/lib \
>>                           -L$INST_DIR/$PREFIX/lib64 -Wl,-rpath-link=$INST_DIR/$PREFIX/lib64" \
>> -        --disable-kvm \
>> -        --disable-docs \
>> -        --bindir=$PREFIX/lib/xen/bin \
>> -        --datadir=$PREFIX/share/qemu-xen \
>> -        --disable-guest-agent
>> +		--bindir=$PREFIX/lib/xen/bin \
>> +		--datadir=$PREFIX/share/qemu-xen \
>> +		--disable-kvm \
>> +		--disable-docs \
>> +		--disable-guest-agent
> 
> This is adding XC_WANT_COMPAT_EVTCHN_API=1, etc, unconditionally. If we
> make this change, will raisin still be able to buil an older qemu
> against an older xen?

I've tested this with XEN_RELEASE set to 4.5 and 4.6, and it builds just
fine.  The #define is just ignored, since neither Xen nor qemu in the
4.5 and 4.6 branches know anything about it.

If part of our goal is to be a repository of the canonical way to build
things, though, perhaps it would be better to have the extra flags be
conditional on the value of XEN_RELEASE.

 -George
Stefano Stabellini June 14, 2016, 10:08 a.m. UTC | #3
On Tue, 14 Jun 2016, George Dunlap wrote:
> On 14/06/16 10:46, Stefano Stabellini wrote:
> > On Mon, 13 Jun 2016, George Dunlap wrote:
> >> Add a 4.7 config file, make it the default.
> >>
> >> Also update the qemu and qemu_traditional recipies after Ian Cambell's
> >> work to split off separate libraries.
> >>
> >> Signed-off-by: George Dunlap <george.dunlap@citrix.com>
> >> ---
> >> CC: Stefano Stabellini <sstabellini@kernel.org>
> >> ---
> >>  components/qemu             | 21 +++++++++++++--------
> >>  components/qemu_traditional |  2 +-
> >>  configs/config-4.7          |  8 ++++++++
> >>  defconfig                   |  2 +-
> >>  4 files changed, 23 insertions(+), 10 deletions(-)
> >>
> >> diff --git a/components/qemu b/components/qemu
> >> index e0d92a5..8624b50 100644
> >> --- a/components/qemu
> >> +++ b/components/qemu
> >> @@ -23,15 +23,20 @@ function qemu_build() {
> >>      cd "$BASEDIR"
> >>      git-checkout $QEMU_URL $QEMU_REVISION qemu-dir
> >>      cd qemu-dir
> >> -    ./configure --enable-xen --target-list=i386-softmmu --prefix=$PREFIX \
> >> -        --extra-cflags="-I$INST_DIR/$PREFIX/include" \
> >> -        --extra-ldflags="-L$INST_DIR/$PREFIX/lib -Wl,-rpath-link=$INST_DIR/$PREFIX/lib \
> >> +
> >> +    ./configure --enable-xen --target-list=i386-softmmu \
> >> +		--prefix=$PREFIX \
> >> +		--extra-cflags="-DXC_WANT_COMPAT_EVTCHN_API=1 \
> >> +		-DXC_WANT_COMPAT_GNTTAB_API=1 \
> >> +		-DXC_WANT_COMPAT_MAP_FOREIGN_API=1 \
> >> +                -I$INST_DIR/$PREFIX/include" \
> >> +		--extra-ldflags="-L$INST_DIR/$PREFIX/lib -Wl,-rpath-link=$INST_DIR/$PREFIX/lib \
> >>                           -L$INST_DIR/$PREFIX/lib64 -Wl,-rpath-link=$INST_DIR/$PREFIX/lib64" \
> >> -        --disable-kvm \
> >> -        --disable-docs \
> >> -        --bindir=$PREFIX/lib/xen/bin \
> >> -        --datadir=$PREFIX/share/qemu-xen \
> >> -        --disable-guest-agent
> >> +		--bindir=$PREFIX/lib/xen/bin \
> >> +		--datadir=$PREFIX/share/qemu-xen \
> >> +		--disable-kvm \
> >> +		--disable-docs \
> >> +		--disable-guest-agent
> > 
> > This is adding XC_WANT_COMPAT_EVTCHN_API=1, etc, unconditionally. If we
> > make this change, will raisin still be able to buil an older qemu
> > against an older xen?
> 
> I've tested this with XEN_RELEASE set to 4.5 and 4.6, and it builds just
> fine.  The #define is just ignored, since neither Xen nor qemu in the
> 4.5 and 4.6 branches know anything about it.
> 
> If part of our goal is to be a repository of the canonical way to build
> things, though, perhaps it would be better to have the extra flags be
> conditional on the value of XEN_RELEASE.

If we are sure that it's ignored than it might be benign. Maybe we
should just add an in-code comment to explain why we added it though.
George Dunlap June 14, 2016, 10:17 a.m. UTC | #4
On 14/06/16 11:08, Stefano Stabellini wrote:
> On Tue, 14 Jun 2016, George Dunlap wrote:
>> On 14/06/16 10:46, Stefano Stabellini wrote:
>>> On Mon, 13 Jun 2016, George Dunlap wrote:
>>>> Add a 4.7 config file, make it the default.
>>>>
>>>> Also update the qemu and qemu_traditional recipies after Ian Cambell's
>>>> work to split off separate libraries.
>>>>
>>>> Signed-off-by: George Dunlap <george.dunlap@citrix.com>
>>>> ---
>>>> CC: Stefano Stabellini <sstabellini@kernel.org>
>>>> ---
>>>>  components/qemu             | 21 +++++++++++++--------
>>>>  components/qemu_traditional |  2 +-
>>>>  configs/config-4.7          |  8 ++++++++
>>>>  defconfig                   |  2 +-
>>>>  4 files changed, 23 insertions(+), 10 deletions(-)
>>>>
>>>> diff --git a/components/qemu b/components/qemu
>>>> index e0d92a5..8624b50 100644
>>>> --- a/components/qemu
>>>> +++ b/components/qemu
>>>> @@ -23,15 +23,20 @@ function qemu_build() {
>>>>      cd "$BASEDIR"
>>>>      git-checkout $QEMU_URL $QEMU_REVISION qemu-dir
>>>>      cd qemu-dir
>>>> -    ./configure --enable-xen --target-list=i386-softmmu --prefix=$PREFIX \
>>>> -        --extra-cflags="-I$INST_DIR/$PREFIX/include" \
>>>> -        --extra-ldflags="-L$INST_DIR/$PREFIX/lib -Wl,-rpath-link=$INST_DIR/$PREFIX/lib \
>>>> +
>>>> +    ./configure --enable-xen --target-list=i386-softmmu \
>>>> +		--prefix=$PREFIX \
>>>> +		--extra-cflags="-DXC_WANT_COMPAT_EVTCHN_API=1 \
>>>> +		-DXC_WANT_COMPAT_GNTTAB_API=1 \
>>>> +		-DXC_WANT_COMPAT_MAP_FOREIGN_API=1 \
>>>> +                -I$INST_DIR/$PREFIX/include" \
>>>> +		--extra-ldflags="-L$INST_DIR/$PREFIX/lib -Wl,-rpath-link=$INST_DIR/$PREFIX/lib \
>>>>                           -L$INST_DIR/$PREFIX/lib64 -Wl,-rpath-link=$INST_DIR/$PREFIX/lib64" \
>>>> -        --disable-kvm \
>>>> -        --disable-docs \
>>>> -        --bindir=$PREFIX/lib/xen/bin \
>>>> -        --datadir=$PREFIX/share/qemu-xen \
>>>> -        --disable-guest-agent
>>>> +		--bindir=$PREFIX/lib/xen/bin \
>>>> +		--datadir=$PREFIX/share/qemu-xen \
>>>> +		--disable-kvm \
>>>> +		--disable-docs \
>>>> +		--disable-guest-agent
>>>
>>> This is adding XC_WANT_COMPAT_EVTCHN_API=1, etc, unconditionally. If we
>>> make this change, will raisin still be able to buil an older qemu
>>> against an older xen?
>>
>> I've tested this with XEN_RELEASE set to 4.5 and 4.6, and it builds just
>> fine.  The #define is just ignored, since neither Xen nor qemu in the
>> 4.5 and 4.6 branches know anything about it.
>>
>> If part of our goal is to be a repository of the canonical way to build
>> things, though, perhaps it would be better to have the extra flags be
>> conditional on the value of XEN_RELEASE.
> 
> If we are sure that it's ignored than it might be benign. Maybe we
> should just add an in-code comment to explain why we added it though.

Well really, I think that the detection should be put into the qemu
configure scripts -- i.e., it should detect that there's the new API and
add the appropriate #defines itself.  But that's the sort of change I
don't think there will be a lot of enthusiasm for. :-)

I'll add a comment.

 -George
Stefano Stabellini June 14, 2016, 10:31 a.m. UTC | #5
On Tue, 14 Jun 2016, George Dunlap wrote:
> On 14/06/16 11:08, Stefano Stabellini wrote:
> > On Tue, 14 Jun 2016, George Dunlap wrote:
> >> On 14/06/16 10:46, Stefano Stabellini wrote:
> >>> On Mon, 13 Jun 2016, George Dunlap wrote:
> >>>> Add a 4.7 config file, make it the default.
> >>>>
> >>>> Also update the qemu and qemu_traditional recipies after Ian Cambell's
> >>>> work to split off separate libraries.
> >>>>
> >>>> Signed-off-by: George Dunlap <george.dunlap@citrix.com>
> >>>> ---
> >>>> CC: Stefano Stabellini <sstabellini@kernel.org>
> >>>> ---
> >>>>  components/qemu             | 21 +++++++++++++--------
> >>>>  components/qemu_traditional |  2 +-
> >>>>  configs/config-4.7          |  8 ++++++++
> >>>>  defconfig                   |  2 +-
> >>>>  4 files changed, 23 insertions(+), 10 deletions(-)
> >>>>
> >>>> diff --git a/components/qemu b/components/qemu
> >>>> index e0d92a5..8624b50 100644
> >>>> --- a/components/qemu
> >>>> +++ b/components/qemu
> >>>> @@ -23,15 +23,20 @@ function qemu_build() {
> >>>>      cd "$BASEDIR"
> >>>>      git-checkout $QEMU_URL $QEMU_REVISION qemu-dir
> >>>>      cd qemu-dir
> >>>> -    ./configure --enable-xen --target-list=i386-softmmu --prefix=$PREFIX \
> >>>> -        --extra-cflags="-I$INST_DIR/$PREFIX/include" \
> >>>> -        --extra-ldflags="-L$INST_DIR/$PREFIX/lib -Wl,-rpath-link=$INST_DIR/$PREFIX/lib \
> >>>> +
> >>>> +    ./configure --enable-xen --target-list=i386-softmmu \
> >>>> +		--prefix=$PREFIX \
> >>>> +		--extra-cflags="-DXC_WANT_COMPAT_EVTCHN_API=1 \
> >>>> +		-DXC_WANT_COMPAT_GNTTAB_API=1 \
> >>>> +		-DXC_WANT_COMPAT_MAP_FOREIGN_API=1 \
> >>>> +                -I$INST_DIR/$PREFIX/include" \
> >>>> +		--extra-ldflags="-L$INST_DIR/$PREFIX/lib -Wl,-rpath-link=$INST_DIR/$PREFIX/lib \
> >>>>                           -L$INST_DIR/$PREFIX/lib64 -Wl,-rpath-link=$INST_DIR/$PREFIX/lib64" \
> >>>> -        --disable-kvm \
> >>>> -        --disable-docs \
> >>>> -        --bindir=$PREFIX/lib/xen/bin \
> >>>> -        --datadir=$PREFIX/share/qemu-xen \
> >>>> -        --disable-guest-agent
> >>>> +		--bindir=$PREFIX/lib/xen/bin \
> >>>> +		--datadir=$PREFIX/share/qemu-xen \
> >>>> +		--disable-kvm \
> >>>> +		--disable-docs \
> >>>> +		--disable-guest-agent
> >>>
> >>> This is adding XC_WANT_COMPAT_EVTCHN_API=1, etc, unconditionally. If we
> >>> make this change, will raisin still be able to buil an older qemu
> >>> against an older xen?
> >>
> >> I've tested this with XEN_RELEASE set to 4.5 and 4.6, and it builds just
> >> fine.  The #define is just ignored, since neither Xen nor qemu in the
> >> 4.5 and 4.6 branches know anything about it.
> >>
> >> If part of our goal is to be a repository of the canonical way to build
> >> things, though, perhaps it would be better to have the extra flags be
> >> conditional on the value of XEN_RELEASE.
> > 
> > If we are sure that it's ignored than it might be benign. Maybe we
> > should just add an in-code comment to explain why we added it though.
> 
> Well really, I think that the detection should be put into the qemu
> configure scripts -- i.e., it should detect that there's the new API and
> add the appropriate #defines itself.  But that's the sort of change I
> don't think there will be a lot of enthusiasm for. :-)

Actually there is already code in QEMU configure script for the
detection. In fact I was wondering if explicitly passing XC_WANT_* is
actually necessary. I don't think it is from QEMU POV.


> I'll add a comment.
George Dunlap June 14, 2016, 10:34 a.m. UTC | #6
On 14/06/16 11:31, Stefano Stabellini wrote:
> On Tue, 14 Jun 2016, George Dunlap wrote:
>> On 14/06/16 11:08, Stefano Stabellini wrote:
>>> On Tue, 14 Jun 2016, George Dunlap wrote:
>>>> On 14/06/16 10:46, Stefano Stabellini wrote:
>>>>> On Mon, 13 Jun 2016, George Dunlap wrote:
>>>>>> Add a 4.7 config file, make it the default.
>>>>>>
>>>>>> Also update the qemu and qemu_traditional recipies after Ian Cambell's
>>>>>> work to split off separate libraries.
>>>>>>
>>>>>> Signed-off-by: George Dunlap <george.dunlap@citrix.com>
>>>>>> ---
>>>>>> CC: Stefano Stabellini <sstabellini@kernel.org>
>>>>>> ---
>>>>>>  components/qemu             | 21 +++++++++++++--------
>>>>>>  components/qemu_traditional |  2 +-
>>>>>>  configs/config-4.7          |  8 ++++++++
>>>>>>  defconfig                   |  2 +-
>>>>>>  4 files changed, 23 insertions(+), 10 deletions(-)
>>>>>>
>>>>>> diff --git a/components/qemu b/components/qemu
>>>>>> index e0d92a5..8624b50 100644
>>>>>> --- a/components/qemu
>>>>>> +++ b/components/qemu
>>>>>> @@ -23,15 +23,20 @@ function qemu_build() {
>>>>>>      cd "$BASEDIR"
>>>>>>      git-checkout $QEMU_URL $QEMU_REVISION qemu-dir
>>>>>>      cd qemu-dir
>>>>>> -    ./configure --enable-xen --target-list=i386-softmmu --prefix=$PREFIX \
>>>>>> -        --extra-cflags="-I$INST_DIR/$PREFIX/include" \
>>>>>> -        --extra-ldflags="-L$INST_DIR/$PREFIX/lib -Wl,-rpath-link=$INST_DIR/$PREFIX/lib \
>>>>>> +
>>>>>> +    ./configure --enable-xen --target-list=i386-softmmu \
>>>>>> +		--prefix=$PREFIX \
>>>>>> +		--extra-cflags="-DXC_WANT_COMPAT_EVTCHN_API=1 \
>>>>>> +		-DXC_WANT_COMPAT_GNTTAB_API=1 \
>>>>>> +		-DXC_WANT_COMPAT_MAP_FOREIGN_API=1 \
>>>>>> +                -I$INST_DIR/$PREFIX/include" \
>>>>>> +		--extra-ldflags="-L$INST_DIR/$PREFIX/lib -Wl,-rpath-link=$INST_DIR/$PREFIX/lib \
>>>>>>                           -L$INST_DIR/$PREFIX/lib64 -Wl,-rpath-link=$INST_DIR/$PREFIX/lib64" \
>>>>>> -        --disable-kvm \
>>>>>> -        --disable-docs \
>>>>>> -        --bindir=$PREFIX/lib/xen/bin \
>>>>>> -        --datadir=$PREFIX/share/qemu-xen \
>>>>>> -        --disable-guest-agent
>>>>>> +		--bindir=$PREFIX/lib/xen/bin \
>>>>>> +		--datadir=$PREFIX/share/qemu-xen \
>>>>>> +		--disable-kvm \
>>>>>> +		--disable-docs \
>>>>>> +		--disable-guest-agent
>>>>>
>>>>> This is adding XC_WANT_COMPAT_EVTCHN_API=1, etc, unconditionally. If we
>>>>> make this change, will raisin still be able to buil an older qemu
>>>>> against an older xen?
>>>>
>>>> I've tested this with XEN_RELEASE set to 4.5 and 4.6, and it builds just
>>>> fine.  The #define is just ignored, since neither Xen nor qemu in the
>>>> 4.5 and 4.6 branches know anything about it.
>>>>
>>>> If part of our goal is to be a repository of the canonical way to build
>>>> things, though, perhaps it would be better to have the extra flags be
>>>> conditional on the value of XEN_RELEASE.
>>>
>>> If we are sure that it's ignored than it might be benign. Maybe we
>>> should just add an in-code comment to explain why we added it though.
>>
>> Well really, I think that the detection should be put into the qemu
>> configure scripts -- i.e., it should detect that there's the new API and
>> add the appropriate #defines itself.  But that's the sort of change I
>> don't think there will be a lot of enthusiasm for. :-)
> 
> Actually there is already code in QEMU configure script for the
> detection. In fact I was wondering if explicitly passing XC_WANT_* is
> actually necessary. I don't think it is from QEMU POV.

That code might be in qemu-upstream, but it's not in the qemu-xen trees;
if you revert this bit of the patch and try to build with raisin it will
fail.  That's why I even bothered to add these in in the first place;
and why IanC added these runes to tools/Makefile.

Anthony, can you comment more authoritatively here on what's going on?
Would it be possible for 4.7.1 to backport the configure auto-detection
stuff?

 -George
Anthony PERARD June 14, 2016, 1:53 p.m. UTC | #7
On Tue, Jun 14, 2016 at 11:34:43AM +0100, George Dunlap wrote:
> On 14/06/16 11:31, Stefano Stabellini wrote:
> > On Tue, 14 Jun 2016, George Dunlap wrote:
> >> On 14/06/16 11:08, Stefano Stabellini wrote:
> >>> On Tue, 14 Jun 2016, George Dunlap wrote:
> >>>> On 14/06/16 10:46, Stefano Stabellini wrote:
> >>>>> On Mon, 13 Jun 2016, George Dunlap wrote:
> >>>>>> Add a 4.7 config file, make it the default.
> >>>>>>
> >>>>>> Also update the qemu and qemu_traditional recipies after Ian Cambell's
> >>>>>> work to split off separate libraries.
> >>>>>>
> >>>>>> Signed-off-by: George Dunlap <george.dunlap@citrix.com>
> >>>>>> ---
> >>>>>> CC: Stefano Stabellini <sstabellini@kernel.org>
> >>>>>> ---
> >>>>>>  components/qemu             | 21 +++++++++++++--------
> >>>>>>  components/qemu_traditional |  2 +-
> >>>>>>  configs/config-4.7          |  8 ++++++++
> >>>>>>  defconfig                   |  2 +-
> >>>>>>  4 files changed, 23 insertions(+), 10 deletions(-)
> >>>>>>
> >>>>>> diff --git a/components/qemu b/components/qemu
> >>>>>> index e0d92a5..8624b50 100644
> >>>>>> --- a/components/qemu
> >>>>>> +++ b/components/qemu
> >>>>>> @@ -23,15 +23,20 @@ function qemu_build() {
> >>>>>>      cd "$BASEDIR"
> >>>>>>      git-checkout $QEMU_URL $QEMU_REVISION qemu-dir
> >>>>>>      cd qemu-dir
> >>>>>> -    ./configure --enable-xen --target-list=i386-softmmu --prefix=$PREFIX \
> >>>>>> -        --extra-cflags="-I$INST_DIR/$PREFIX/include" \
> >>>>>> -        --extra-ldflags="-L$INST_DIR/$PREFIX/lib -Wl,-rpath-link=$INST_DIR/$PREFIX/lib \
> >>>>>> +
> >>>>>> +    ./configure --enable-xen --target-list=i386-softmmu \
> >>>>>> +		--prefix=$PREFIX \
> >>>>>> +		--extra-cflags="-DXC_WANT_COMPAT_EVTCHN_API=1 \
> >>>>>> +		-DXC_WANT_COMPAT_GNTTAB_API=1 \
> >>>>>> +		-DXC_WANT_COMPAT_MAP_FOREIGN_API=1 \
> >>>>>> +                -I$INST_DIR/$PREFIX/include" \
> >>>>>> +		--extra-ldflags="-L$INST_DIR/$PREFIX/lib -Wl,-rpath-link=$INST_DIR/$PREFIX/lib \
> >>>>>>                           -L$INST_DIR/$PREFIX/lib64 -Wl,-rpath-link=$INST_DIR/$PREFIX/lib64" \
> >>>>>> -        --disable-kvm \
> >>>>>> -        --disable-docs \
> >>>>>> -        --bindir=$PREFIX/lib/xen/bin \
> >>>>>> -        --datadir=$PREFIX/share/qemu-xen \
> >>>>>> -        --disable-guest-agent
> >>>>>> +		--bindir=$PREFIX/lib/xen/bin \
> >>>>>> +		--datadir=$PREFIX/share/qemu-xen \
> >>>>>> +		--disable-kvm \
> >>>>>> +		--disable-docs \
> >>>>>> +		--disable-guest-agent
> >>>>>
> >>>>> This is adding XC_WANT_COMPAT_EVTCHN_API=1, etc, unconditionally. If we
> >>>>> make this change, will raisin still be able to buil an older qemu
> >>>>> against an older xen?
> >>>>
> >>>> I've tested this with XEN_RELEASE set to 4.5 and 4.6, and it builds just
> >>>> fine.  The #define is just ignored, since neither Xen nor qemu in the
> >>>> 4.5 and 4.6 branches know anything about it.
> >>>>
> >>>> If part of our goal is to be a repository of the canonical way to build
> >>>> things, though, perhaps it would be better to have the extra flags be
> >>>> conditional on the value of XEN_RELEASE.
> >>>
> >>> If we are sure that it's ignored than it might be benign. Maybe we
> >>> should just add an in-code comment to explain why we added it though.
> >>
> >> Well really, I think that the detection should be put into the qemu
> >> configure scripts -- i.e., it should detect that there's the new API and
> >> add the appropriate #defines itself.  But that's the sort of change I
> >> don't think there will be a lot of enthusiasm for. :-)
> > 
> > Actually there is already code in QEMU configure script for the
> > detection. In fact I was wondering if explicitly passing XC_WANT_* is
> > actually necessary. I don't think it is from QEMU POV.
> 
> That code might be in qemu-upstream, but it's not in the qemu-xen trees;
> if you revert this bit of the patch and try to build with raisin it will
> fail.  That's why I even bothered to add these in in the first place;
> and why IanC added these runes to tools/Makefile.
> 
> Anthony, can you comment more authoritatively here on what's going on?

Yes, easy, xen-4.7 introduce a new API but qemu-xen-4.7 does not know
about it, so qemu-xen will fail to compile. But there are some magic
flags that are use to provide an compatible API and can qemu-xen
compile.

QEMU have been taught about the new API and will use it, without the
magic flags. QEMU will actually ignore the magic flags with a bunch of
#undef.

> Would it be possible for 4.7.1 to backport the configure auto-detection
> stuff?

I think that would be possible. But backporting the use of the new api
will probably be harder. I guess we could just have qemu-xen define the
magic flags itself instead of relying on them been given via a configure
option.


Is that answer your questions?
George Dunlap June 14, 2016, 2 p.m. UTC | #8
On 14/06/16 14:53, Anthony PERARD wrote:
> On Tue, Jun 14, 2016 at 11:34:43AM +0100, George Dunlap wrote:
>> On 14/06/16 11:31, Stefano Stabellini wrote:
>>> On Tue, 14 Jun 2016, George Dunlap wrote:
>>>> On 14/06/16 11:08, Stefano Stabellini wrote:
>>>>> On Tue, 14 Jun 2016, George Dunlap wrote:
>>>>>> On 14/06/16 10:46, Stefano Stabellini wrote:
>>>>>>> On Mon, 13 Jun 2016, George Dunlap wrote:
>>>>>>>> Add a 4.7 config file, make it the default.
>>>>>>>>
>>>>>>>> Also update the qemu and qemu_traditional recipies after Ian Cambell's
>>>>>>>> work to split off separate libraries.
>>>>>>>>
>>>>>>>> Signed-off-by: George Dunlap <george.dunlap@citrix.com>
>>>>>>>> ---
>>>>>>>> CC: Stefano Stabellini <sstabellini@kernel.org>
>>>>>>>> ---
>>>>>>>>  components/qemu             | 21 +++++++++++++--------
>>>>>>>>  components/qemu_traditional |  2 +-
>>>>>>>>  configs/config-4.7          |  8 ++++++++
>>>>>>>>  defconfig                   |  2 +-
>>>>>>>>  4 files changed, 23 insertions(+), 10 deletions(-)
>>>>>>>>
>>>>>>>> diff --git a/components/qemu b/components/qemu
>>>>>>>> index e0d92a5..8624b50 100644
>>>>>>>> --- a/components/qemu
>>>>>>>> +++ b/components/qemu
>>>>>>>> @@ -23,15 +23,20 @@ function qemu_build() {
>>>>>>>>      cd "$BASEDIR"
>>>>>>>>      git-checkout $QEMU_URL $QEMU_REVISION qemu-dir
>>>>>>>>      cd qemu-dir
>>>>>>>> -    ./configure --enable-xen --target-list=i386-softmmu --prefix=$PREFIX \
>>>>>>>> -        --extra-cflags="-I$INST_DIR/$PREFIX/include" \
>>>>>>>> -        --extra-ldflags="-L$INST_DIR/$PREFIX/lib -Wl,-rpath-link=$INST_DIR/$PREFIX/lib \
>>>>>>>> +
>>>>>>>> +    ./configure --enable-xen --target-list=i386-softmmu \
>>>>>>>> +		--prefix=$PREFIX \
>>>>>>>> +		--extra-cflags="-DXC_WANT_COMPAT_EVTCHN_API=1 \
>>>>>>>> +		-DXC_WANT_COMPAT_GNTTAB_API=1 \
>>>>>>>> +		-DXC_WANT_COMPAT_MAP_FOREIGN_API=1 \
>>>>>>>> +                -I$INST_DIR/$PREFIX/include" \
>>>>>>>> +		--extra-ldflags="-L$INST_DIR/$PREFIX/lib -Wl,-rpath-link=$INST_DIR/$PREFIX/lib \
>>>>>>>>                           -L$INST_DIR/$PREFIX/lib64 -Wl,-rpath-link=$INST_DIR/$PREFIX/lib64" \
>>>>>>>> -        --disable-kvm \
>>>>>>>> -        --disable-docs \
>>>>>>>> -        --bindir=$PREFIX/lib/xen/bin \
>>>>>>>> -        --datadir=$PREFIX/share/qemu-xen \
>>>>>>>> -        --disable-guest-agent
>>>>>>>> +		--bindir=$PREFIX/lib/xen/bin \
>>>>>>>> +		--datadir=$PREFIX/share/qemu-xen \
>>>>>>>> +		--disable-kvm \
>>>>>>>> +		--disable-docs \
>>>>>>>> +		--disable-guest-agent
>>>>>>>
>>>>>>> This is adding XC_WANT_COMPAT_EVTCHN_API=1, etc, unconditionally. If we
>>>>>>> make this change, will raisin still be able to buil an older qemu
>>>>>>> against an older xen?
>>>>>>
>>>>>> I've tested this with XEN_RELEASE set to 4.5 and 4.6, and it builds just
>>>>>> fine.  The #define is just ignored, since neither Xen nor qemu in the
>>>>>> 4.5 and 4.6 branches know anything about it.
>>>>>>
>>>>>> If part of our goal is to be a repository of the canonical way to build
>>>>>> things, though, perhaps it would be better to have the extra flags be
>>>>>> conditional on the value of XEN_RELEASE.
>>>>>
>>>>> If we are sure that it's ignored than it might be benign. Maybe we
>>>>> should just add an in-code comment to explain why we added it though.
>>>>
>>>> Well really, I think that the detection should be put into the qemu
>>>> configure scripts -- i.e., it should detect that there's the new API and
>>>> add the appropriate #defines itself.  But that's the sort of change I
>>>> don't think there will be a lot of enthusiasm for. :-)
>>>
>>> Actually there is already code in QEMU configure script for the
>>> detection. In fact I was wondering if explicitly passing XC_WANT_* is
>>> actually necessary. I don't think it is from QEMU POV.
>>
>> That code might be in qemu-upstream, but it's not in the qemu-xen trees;
>> if you revert this bit of the patch and try to build with raisin it will
>> fail.  That's why I even bothered to add these in in the first place;
>> and why IanC added these runes to tools/Makefile.
>>
>> Anthony, can you comment more authoritatively here on what's going on?
> 
> Yes, easy, xen-4.7 introduce a new API but qemu-xen-4.7 does not know
> about it, so qemu-xen will fail to compile. But there are some magic
> flags that are use to provide an compatible API and can qemu-xen
> compile.
> 
> QEMU have been taught about the new API and will use it, without the
> magic flags. QEMU will actually ignore the magic flags with a bunch of
> #undef.

So wait, I'm confused.  Isn't qemu-xen supposed to be upstream qemu plus
a handful of patches on top?  Or has there not been a QEMU release since
the time the new API?  Why on earth are we shipping in 4.7 a qemu that
can't use the new API we define in 4.7?

>> Would it be possible for 4.7.1 to backport the configure auto-detection
>> stuff?
> 
> I think that would be possible. But backporting the use of the new api
> will probably be harder. I guess we could just have qemu-xen define the
> magic flags itself instead of relying on them been given via a configure
> option.

Well at this point it's a bit late to import support for the new API
into qemu-xen-4.7; but it would be good for 4.7.1 to have qemu-xen's
configure set the necessary flags rather than bodging them in via
"--extra-cflags" in the Xen makefile.

 -George
Anthony PERARD June 14, 2016, 2:23 p.m. UTC | #9
On Tue, Jun 14, 2016 at 03:00:12PM +0100, George Dunlap wrote:
> On 14/06/16 14:53, Anthony PERARD wrote:
> > On Tue, Jun 14, 2016 at 11:34:43AM +0100, George Dunlap wrote:
> >> That code might be in qemu-upstream, but it's not in the qemu-xen trees;
> >> if you revert this bit of the patch and try to build with raisin it will
> >> fail.  That's why I even bothered to add these in in the first place;
> >> and why IanC added these runes to tools/Makefile.
> >>
> >> Anthony, can you comment more authoritatively here on what's going on?
> > 
> > Yes, easy, xen-4.7 introduce a new API but qemu-xen-4.7 does not know
> > about it, so qemu-xen will fail to compile. But there are some magic
> > flags that are use to provide an compatible API and can qemu-xen
> > compile.
> > 
> > QEMU have been taught about the new API and will use it, without the
> > magic flags. QEMU will actually ignore the magic flags with a bunch of
> > #undef.
> 
> So wait, I'm confused.  Isn't qemu-xen supposed to be upstream qemu plus
> a handful of patches on top?  Or has there not been a QEMU release since
> the time the new API?

The first release to include the new stuff appear to be 2.6, which have
been released a month ago. So the answer is no.

> Why on earth are we shipping in 4.7 a qemu that
> can't use the new API we define in 4.7?

Who knows...

> >> Would it be possible for 4.7.1 to backport the configure auto-detection
> >> stuff?
> > 
> > I think that would be possible. But backporting the use of the new api
> > will probably be harder. I guess we could just have qemu-xen define the
> > magic flags itself instead of relying on them been given via a configure
> > option.
> 
> Well at this point it's a bit late to import support for the new API
> into qemu-xen-4.7; but it would be good for 4.7.1 to have qemu-xen's
> configure set the necessary flags rather than bodging them in via
> "--extra-cflags" in the Xen makefile.

Yes.
George Dunlap June 14, 2016, 2:38 p.m. UTC | #10
On 14/06/16 15:23, Anthony PERARD wrote:
> On Tue, Jun 14, 2016 at 03:00:12PM +0100, George Dunlap wrote:
>> On 14/06/16 14:53, Anthony PERARD wrote:
>>> On Tue, Jun 14, 2016 at 11:34:43AM +0100, George Dunlap wrote:
>>>> That code might be in qemu-upstream, but it's not in the qemu-xen trees;
>>>> if you revert this bit of the patch and try to build with raisin it will
>>>> fail.  That's why I even bothered to add these in in the first place;
>>>> and why IanC added these runes to tools/Makefile.
>>>>
>>>> Anthony, can you comment more authoritatively here on what's going on?
>>>
>>> Yes, easy, xen-4.7 introduce a new API but qemu-xen-4.7 does not know
>>> about it, so qemu-xen will fail to compile. But there are some magic
>>> flags that are use to provide an compatible API and can qemu-xen
>>> compile.
>>>
>>> QEMU have been taught about the new API and will use it, without the
>>> magic flags. QEMU will actually ignore the magic flags with a bunch of
>>> #undef.
>>
>> So wait, I'm confused.  Isn't qemu-xen supposed to be upstream qemu plus
>> a handful of patches on top?  Or has there not been a QEMU release since
>> the time the new API?
> 
> The first release to include the new stuff appear to be 2.6, which have
> been released a month ago. So the answer is no.

OK, but presumably you'll pull in / rebase qemu-unstable at some point
in the next few weeks and then we can take the magic runes out of
tools/Makefile.

So back to raisin: I'll make a conditional to only add this for 4.7,
with an explanation; and when it gets fixed for 4.7.1 I'll take it out.

Thanks.
 -George
Stefano Stabellini June 15, 2016, 10:39 a.m. UTC | #11
On Tue, 14 Jun 2016, Anthony PERARD wrote:
> On Tue, Jun 14, 2016 at 11:34:43AM +0100, George Dunlap wrote:
> > On 14/06/16 11:31, Stefano Stabellini wrote:
> > > On Tue, 14 Jun 2016, George Dunlap wrote:
> > >> On 14/06/16 11:08, Stefano Stabellini wrote:
> > >>> On Tue, 14 Jun 2016, George Dunlap wrote:
> > >>>> On 14/06/16 10:46, Stefano Stabellini wrote:
> > >>>>> On Mon, 13 Jun 2016, George Dunlap wrote:
> > >>>>>> Add a 4.7 config file, make it the default.
> > >>>>>>
> > >>>>>> Also update the qemu and qemu_traditional recipies after Ian Cambell's
> > >>>>>> work to split off separate libraries.
> > >>>>>>
> > >>>>>> Signed-off-by: George Dunlap <george.dunlap@citrix.com>
> > >>>>>> ---
> > >>>>>> CC: Stefano Stabellini <sstabellini@kernel.org>
> > >>>>>> ---
> > >>>>>>  components/qemu             | 21 +++++++++++++--------
> > >>>>>>  components/qemu_traditional |  2 +-
> > >>>>>>  configs/config-4.7          |  8 ++++++++
> > >>>>>>  defconfig                   |  2 +-
> > >>>>>>  4 files changed, 23 insertions(+), 10 deletions(-)
> > >>>>>>
> > >>>>>> diff --git a/components/qemu b/components/qemu
> > >>>>>> index e0d92a5..8624b50 100644
> > >>>>>> --- a/components/qemu
> > >>>>>> +++ b/components/qemu
> > >>>>>> @@ -23,15 +23,20 @@ function qemu_build() {
> > >>>>>>      cd "$BASEDIR"
> > >>>>>>      git-checkout $QEMU_URL $QEMU_REVISION qemu-dir
> > >>>>>>      cd qemu-dir
> > >>>>>> -    ./configure --enable-xen --target-list=i386-softmmu --prefix=$PREFIX \
> > >>>>>> -        --extra-cflags="-I$INST_DIR/$PREFIX/include" \
> > >>>>>> -        --extra-ldflags="-L$INST_DIR/$PREFIX/lib -Wl,-rpath-link=$INST_DIR/$PREFIX/lib \
> > >>>>>> +
> > >>>>>> +    ./configure --enable-xen --target-list=i386-softmmu \
> > >>>>>> +		--prefix=$PREFIX \
> > >>>>>> +		--extra-cflags="-DXC_WANT_COMPAT_EVTCHN_API=1 \
> > >>>>>> +		-DXC_WANT_COMPAT_GNTTAB_API=1 \
> > >>>>>> +		-DXC_WANT_COMPAT_MAP_FOREIGN_API=1 \
> > >>>>>> +                -I$INST_DIR/$PREFIX/include" \
> > >>>>>> +		--extra-ldflags="-L$INST_DIR/$PREFIX/lib -Wl,-rpath-link=$INST_DIR/$PREFIX/lib \
> > >>>>>>                           -L$INST_DIR/$PREFIX/lib64 -Wl,-rpath-link=$INST_DIR/$PREFIX/lib64" \
> > >>>>>> -        --disable-kvm \
> > >>>>>> -        --disable-docs \
> > >>>>>> -        --bindir=$PREFIX/lib/xen/bin \
> > >>>>>> -        --datadir=$PREFIX/share/qemu-xen \
> > >>>>>> -        --disable-guest-agent
> > >>>>>> +		--bindir=$PREFIX/lib/xen/bin \
> > >>>>>> +		--datadir=$PREFIX/share/qemu-xen \
> > >>>>>> +		--disable-kvm \
> > >>>>>> +		--disable-docs \
> > >>>>>> +		--disable-guest-agent
> > >>>>>
> > >>>>> This is adding XC_WANT_COMPAT_EVTCHN_API=1, etc, unconditionally. If we
> > >>>>> make this change, will raisin still be able to buil an older qemu
> > >>>>> against an older xen?
> > >>>>
> > >>>> I've tested this with XEN_RELEASE set to 4.5 and 4.6, and it builds just
> > >>>> fine.  The #define is just ignored, since neither Xen nor qemu in the
> > >>>> 4.5 and 4.6 branches know anything about it.
> > >>>>
> > >>>> If part of our goal is to be a repository of the canonical way to build
> > >>>> things, though, perhaps it would be better to have the extra flags be
> > >>>> conditional on the value of XEN_RELEASE.
> > >>>
> > >>> If we are sure that it's ignored than it might be benign. Maybe we
> > >>> should just add an in-code comment to explain why we added it though.
> > >>
> > >> Well really, I think that the detection should be put into the qemu
> > >> configure scripts -- i.e., it should detect that there's the new API and
> > >> add the appropriate #defines itself.  But that's the sort of change I
> > >> don't think there will be a lot of enthusiasm for. :-)
> > > 
> > > Actually there is already code in QEMU configure script for the
> > > detection. In fact I was wondering if explicitly passing XC_WANT_* is
> > > actually necessary. I don't think it is from QEMU POV.
> > 
> > That code might be in qemu-upstream, but it's not in the qemu-xen trees;
> > if you revert this bit of the patch and try to build with raisin it will
> > fail.  That's why I even bothered to add these in in the first place;
> > and why IanC added these runes to tools/Makefile.
> > 
> > Anthony, can you comment more authoritatively here on what's going on?
> 
> Yes, easy, xen-4.7 introduce a new API but qemu-xen-4.7 does not know
> about it, so qemu-xen will fail to compile. But there are some magic
> flags that are use to provide an compatible API and can qemu-xen
> compile.
> 
> QEMU have been taught about the new API and will use it, without the
> magic flags. QEMU will actually ignore the magic flags with a bunch of
> #undef.
 
Looking a bit more closely, these flags are to enable backward
compatibility in libxc, which of course is not supposed to break any
QEMUs, old or new. To the contrary, it helps older QEMUs to build
properly against newer Xen versions (qemu-xen-4.7 falls in this
category). In addition new QEMU is able to ignore these flags when it
knows that it can use the new interface. So overall I would just pass
them unconditionally with a comment as explanation.
George Dunlap June 15, 2016, 10:42 a.m. UTC | #12
On 15/06/16 11:39, Stefano Stabellini wrote:
> On Tue, 14 Jun 2016, Anthony PERARD wrote:
>> On Tue, Jun 14, 2016 at 11:34:43AM +0100, George Dunlap wrote:
>>> On 14/06/16 11:31, Stefano Stabellini wrote:
>>>> On Tue, 14 Jun 2016, George Dunlap wrote:
>>>>> On 14/06/16 11:08, Stefano Stabellini wrote:
>>>>>> On Tue, 14 Jun 2016, George Dunlap wrote:
>>>>>>> On 14/06/16 10:46, Stefano Stabellini wrote:
>>>>>>>> On Mon, 13 Jun 2016, George Dunlap wrote:
>>>>>>>>> Add a 4.7 config file, make it the default.
>>>>>>>>>
>>>>>>>>> Also update the qemu and qemu_traditional recipies after Ian Cambell's
>>>>>>>>> work to split off separate libraries.
>>>>>>>>>
>>>>>>>>> Signed-off-by: George Dunlap <george.dunlap@citrix.com>
>>>>>>>>> ---
>>>>>>>>> CC: Stefano Stabellini <sstabellini@kernel.org>
>>>>>>>>> ---
>>>>>>>>>  components/qemu             | 21 +++++++++++++--------
>>>>>>>>>  components/qemu_traditional |  2 +-
>>>>>>>>>  configs/config-4.7          |  8 ++++++++
>>>>>>>>>  defconfig                   |  2 +-
>>>>>>>>>  4 files changed, 23 insertions(+), 10 deletions(-)
>>>>>>>>>
>>>>>>>>> diff --git a/components/qemu b/components/qemu
>>>>>>>>> index e0d92a5..8624b50 100644
>>>>>>>>> --- a/components/qemu
>>>>>>>>> +++ b/components/qemu
>>>>>>>>> @@ -23,15 +23,20 @@ function qemu_build() {
>>>>>>>>>      cd "$BASEDIR"
>>>>>>>>>      git-checkout $QEMU_URL $QEMU_REVISION qemu-dir
>>>>>>>>>      cd qemu-dir
>>>>>>>>> -    ./configure --enable-xen --target-list=i386-softmmu --prefix=$PREFIX \
>>>>>>>>> -        --extra-cflags="-I$INST_DIR/$PREFIX/include" \
>>>>>>>>> -        --extra-ldflags="-L$INST_DIR/$PREFIX/lib -Wl,-rpath-link=$INST_DIR/$PREFIX/lib \
>>>>>>>>> +
>>>>>>>>> +    ./configure --enable-xen --target-list=i386-softmmu \
>>>>>>>>> +		--prefix=$PREFIX \
>>>>>>>>> +		--extra-cflags="-DXC_WANT_COMPAT_EVTCHN_API=1 \
>>>>>>>>> +		-DXC_WANT_COMPAT_GNTTAB_API=1 \
>>>>>>>>> +		-DXC_WANT_COMPAT_MAP_FOREIGN_API=1 \
>>>>>>>>> +                -I$INST_DIR/$PREFIX/include" \
>>>>>>>>> +		--extra-ldflags="-L$INST_DIR/$PREFIX/lib -Wl,-rpath-link=$INST_DIR/$PREFIX/lib \
>>>>>>>>>                           -L$INST_DIR/$PREFIX/lib64 -Wl,-rpath-link=$INST_DIR/$PREFIX/lib64" \
>>>>>>>>> -        --disable-kvm \
>>>>>>>>> -        --disable-docs \
>>>>>>>>> -        --bindir=$PREFIX/lib/xen/bin \
>>>>>>>>> -        --datadir=$PREFIX/share/qemu-xen \
>>>>>>>>> -        --disable-guest-agent
>>>>>>>>> +		--bindir=$PREFIX/lib/xen/bin \
>>>>>>>>> +		--datadir=$PREFIX/share/qemu-xen \
>>>>>>>>> +		--disable-kvm \
>>>>>>>>> +		--disable-docs \
>>>>>>>>> +		--disable-guest-agent
>>>>>>>>
>>>>>>>> This is adding XC_WANT_COMPAT_EVTCHN_API=1, etc, unconditionally. If we
>>>>>>>> make this change, will raisin still be able to buil an older qemu
>>>>>>>> against an older xen?
>>>>>>>
>>>>>>> I've tested this with XEN_RELEASE set to 4.5 and 4.6, and it builds just
>>>>>>> fine.  The #define is just ignored, since neither Xen nor qemu in the
>>>>>>> 4.5 and 4.6 branches know anything about it.
>>>>>>>
>>>>>>> If part of our goal is to be a repository of the canonical way to build
>>>>>>> things, though, perhaps it would be better to have the extra flags be
>>>>>>> conditional on the value of XEN_RELEASE.
>>>>>>
>>>>>> If we are sure that it's ignored than it might be benign. Maybe we
>>>>>> should just add an in-code comment to explain why we added it though.
>>>>>
>>>>> Well really, I think that the detection should be put into the qemu
>>>>> configure scripts -- i.e., it should detect that there's the new API and
>>>>> add the appropriate #defines itself.  But that's the sort of change I
>>>>> don't think there will be a lot of enthusiasm for. :-)
>>>>
>>>> Actually there is already code in QEMU configure script for the
>>>> detection. In fact I was wondering if explicitly passing XC_WANT_* is
>>>> actually necessary. I don't think it is from QEMU POV.
>>>
>>> That code might be in qemu-upstream, but it's not in the qemu-xen trees;
>>> if you revert this bit of the patch and try to build with raisin it will
>>> fail.  That's why I even bothered to add these in in the first place;
>>> and why IanC added these runes to tools/Makefile.
>>>
>>> Anthony, can you comment more authoritatively here on what's going on?
>>
>> Yes, easy, xen-4.7 introduce a new API but qemu-xen-4.7 does not know
>> about it, so qemu-xen will fail to compile. But there are some magic
>> flags that are use to provide an compatible API and can qemu-xen
>> compile.
>>
>> QEMU have been taught about the new API and will use it, without the
>> magic flags. QEMU will actually ignore the magic flags with a bunch of
>> #undef.
>  
> Looking a bit more closely, these flags are to enable backward
> compatibility in libxc, which of course is not supposed to break any
> QEMUs, old or new. To the contrary, it helps older QEMUs to build
> properly against newer Xen versions (qemu-xen-4.7 falls in this
> category). In addition new QEMU is able to ignore these flags when it
> knows that it can use the new interface. So overall I would just pass
> them unconditionally with a comment as explanation.

Well I've already updated the patch to enable them conditionally (with a
comment), so I think I'll just use the new version. :-)

 -George
diff mbox

Patch

diff --git a/components/qemu b/components/qemu
index e0d92a5..8624b50 100644
--- a/components/qemu
+++ b/components/qemu
@@ -23,15 +23,20 @@  function qemu_build() {
     cd "$BASEDIR"
     git-checkout $QEMU_URL $QEMU_REVISION qemu-dir
     cd qemu-dir
-    ./configure --enable-xen --target-list=i386-softmmu --prefix=$PREFIX \
-        --extra-cflags="-I$INST_DIR/$PREFIX/include" \
-        --extra-ldflags="-L$INST_DIR/$PREFIX/lib -Wl,-rpath-link=$INST_DIR/$PREFIX/lib \
+
+    ./configure --enable-xen --target-list=i386-softmmu \
+		--prefix=$PREFIX \
+		--extra-cflags="-DXC_WANT_COMPAT_EVTCHN_API=1 \
+		-DXC_WANT_COMPAT_GNTTAB_API=1 \
+		-DXC_WANT_COMPAT_MAP_FOREIGN_API=1 \
+                -I$INST_DIR/$PREFIX/include" \
+		--extra-ldflags="-L$INST_DIR/$PREFIX/lib -Wl,-rpath-link=$INST_DIR/$PREFIX/lib \
                          -L$INST_DIR/$PREFIX/lib64 -Wl,-rpath-link=$INST_DIR/$PREFIX/lib64" \
-        --disable-kvm \
-        --disable-docs \
-        --bindir=$PREFIX/lib/xen/bin \
-        --datadir=$PREFIX/share/qemu-xen \
-        --disable-guest-agent
+		--bindir=$PREFIX/lib/xen/bin \
+		--datadir=$PREFIX/share/qemu-xen \
+		--disable-kvm \
+		--disable-docs \
+		--disable-guest-agent
     $RAISIN_MAKE all
     $RAISIN_MAKE install DESTDIR="$INST_DIR"
     cd "$BASEDIR"
diff --git a/components/qemu_traditional b/components/qemu_traditional
index 3150c3e..8732fe2 100644
--- a/components/qemu_traditional
+++ b/components/qemu_traditional
@@ -30,7 +30,7 @@  function qemu_traditional_build() {
 
     export CONFIG_BLKTAP1=n
     export XEN_ROOT="$BASEDIR"/xen-dir
-    ./xen-setup
+    ./xen-setup --extra-cflags="-D__XEN_TOOLS__"
     $RAISIN_MAKE all
     $RAISIN_MAKE install DESTDIR="$INST_DIR"
     cd "$BASEDIR"
diff --git a/configs/config-4.7 b/configs/config-4.7
new file mode 100644
index 0000000..66fe467
--- /dev/null
+++ b/configs/config-4.7
@@ -0,0 +1,8 @@ 
+XEN_REVISION="origin/stable-4.7"
+QEMU_REVISION="origin/stable-4.7"
+QEMU_TRADITIONAL_REVISION="origin/stable-4.7"
+SEABIOS_REVISION="rel-1.9.2"
+GRUB_REVISION="master"
+LIBVIRT_REVISION="origin/v1.3.3-maint"
+OVMF_REVISION="52a99493cce88a9d4ec8a02d7f1bd1a1001ce60d"
+LINUX_REVISION="master"
diff --git a/defconfig b/defconfig
index 8e79a43..f8ef398 100644
--- a/defconfig
+++ b/defconfig
@@ -2,7 +2,7 @@ 
 # Setup a Xen based system.
 
 # Available options: 4.5, 4.6, master (for development branch)
-XEN_RELEASE="4.6"
+XEN_RELEASE="4.7"
 
 # Components
 ## All components: seabios ovmf xen qemu qemu_traditional grub libvirt linux