diff mbox

pci-stub: fix compile breakage with qmp

Message ID 1320802728-21841-1-git-send-email-agraf@suse.de
State New
Headers show

Commit Message

Alexander Graf Nov. 9, 2011, 1:38 a.m. UTC
Commit 79627472db3 introduced breakage in compiling the s390x-softmmu
target. Instead of compiling, it just throws a lot of errors:

In file included from /dev/shm/qemu/hw/pci-stub.c:24:
./qmp-commands.h:3: error: expected identifier or ‘(’ before ‘{’ token
[...]

This is because we have two files called qmp-commands.h. One resides in
the root directory of the source tree. The other one resides in the target
build directory.

Because pci-stub is not built in libhw, pci-stub.c seems to pick up the
qmp-commands.h file from the target build directory which contains only
definitions of qmp commands, not the function stubs.

This patch at least fixes this breakage for me, allowing me to compile
s390x-softmmu again.

CC: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
---
 hw/pci-stub.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Stefan Weil Nov. 9, 2011, 5:58 a.m. UTC | #1
Am 09.11.2011 02:38, schrieb Alexander Graf:
> Commit 79627472db3 introduced breakage in compiling the s390x-softmmu
> target. Instead of compiling, it just throws a lot of errors:
>
> In file included from /dev/shm/qemu/hw/pci-stub.c:24:
> ./qmp-commands.h:3: error: expected identifier or ‘(’ before ‘{’ token
> [...]
>
> This is because we have two files called qmp-commands.h. One resides in
> the root directory of the source tree. The other one resides in the target
> build directory.
>
> Because pci-stub is not built in libhw, pci-stub.c seems to pick up the
> qmp-commands.h file from the target build directory which contains only
> definitions of qmp commands, not the function stubs.
>
> This patch at least fixes this breakage for me, allowing me to compile
> s390x-softmmu again.
>
> CC: Luiz Capitulino<lcapitulino@redhat.com>
> Signed-off-by: Alexander Graf<agraf@suse.de>
> ---
>   hw/pci-stub.c |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/hw/pci-stub.c b/hw/pci-stub.c
> index 636171c..ab9789c 100644
> --- a/hw/pci-stub.c
> +++ b/hw/pci-stub.c
> @@ -21,7 +21,7 @@
>   #include "sysemu.h"
>   #include "monitor.h"
>   #include "pci.h"
> -#include "qmp-commands.h"
> +#include "../qmp-commands.h"
>
>   PciInfoList *qmp_query_pci(Error **errp)
>   {

No. Simply remove */qmp-commands.h. They are relicts from previous builds.

Cheers,
Stefan
Andreas Färber Nov. 9, 2011, 10:27 a.m. UTC | #2
Am 09.11.2011 06:58, schrieb Stefan Weil:
> Am 09.11.2011 02:38, schrieb Alexander Graf:
>> Commit 79627472db3 introduced breakage in compiling the s390x-softmmu
>> target. Instead of compiling, it just throws a lot of errors:
>>
>> In file included from /dev/shm/qemu/hw/pci-stub.c:24:
>> ./qmp-commands.h:3: error: expected identifier or ‘(’ before ‘{’ token
>> [...]
>>
>> This is because we have two files called qmp-commands.h. One resides in
>> the root directory of the source tree. The other one resides in the
>> target
>> build directory.
>>
>> Because pci-stub is not built in libhw, pci-stub.c seems to pick up the
>> qmp-commands.h file from the target build directory which contains only
>> definitions of qmp commands, not the function stubs.
>>
>> This patch at least fixes this breakage for me, allowing me to compile
>> s390x-softmmu again.
>>
>> CC: Luiz Capitulino<lcapitulino@redhat.com>
>> Signed-off-by: Alexander Graf<agraf@suse.de>
>> ---
>>   hw/pci-stub.c |    2 +-
>>   1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/hw/pci-stub.c b/hw/pci-stub.c
>> index 636171c..ab9789c 100644
>> --- a/hw/pci-stub.c
>> +++ b/hw/pci-stub.c
>> @@ -21,7 +21,7 @@
>>   #include "sysemu.h"
>>   #include "monitor.h"
>>   #include "pci.h"
>> -#include "qmp-commands.h"
>> +#include "../qmp-commands.h"
>>
>>   PciInfoList *qmp_query_pci(Error **errp)
>>   {
> 
> No. Simply remove */qmp-commands.h. They are relicts from previous builds.

If make clean didn't help, please patch that instead then.

Andreas
Luiz Capitulino Nov. 9, 2011, 12:47 p.m. UTC | #3
On Wed, 09 Nov 2011 11:27:22 +0100
Andreas Färber <afaerber@suse.de> wrote:

> Am 09.11.2011 06:58, schrieb Stefan Weil:
> > Am 09.11.2011 02:38, schrieb Alexander Graf:
> >> Commit 79627472db3 introduced breakage in compiling the s390x-softmmu
> >> target. Instead of compiling, it just throws a lot of errors:
> >>
> >> In file included from /dev/shm/qemu/hw/pci-stub.c:24:
> >> ./qmp-commands.h:3: error: expected identifier or ‘(’ before ‘{’ token
> >> [...]
> >>
> >> This is because we have two files called qmp-commands.h. One resides in
> >> the root directory of the source tree. The other one resides in the
> >> target
> >> build directory.
> >>
> >> Because pci-stub is not built in libhw, pci-stub.c seems to pick up the
> >> qmp-commands.h file from the target build directory which contains only
> >> definitions of qmp commands, not the function stubs.
> >>
> >> This patch at least fixes this breakage for me, allowing me to compile
> >> s390x-softmmu again.
> >>
> >> CC: Luiz Capitulino<lcapitulino@redhat.com>
> >> Signed-off-by: Alexander Graf<agraf@suse.de>
> >> ---
> >>   hw/pci-stub.c |    2 +-
> >>   1 files changed, 1 insertions(+), 1 deletions(-)
> >>
> >> diff --git a/hw/pci-stub.c b/hw/pci-stub.c
> >> index 636171c..ab9789c 100644
> >> --- a/hw/pci-stub.c
> >> +++ b/hw/pci-stub.c
> >> @@ -21,7 +21,7 @@
> >>   #include "sysemu.h"
> >>   #include "monitor.h"
> >>   #include "pci.h"
> >> -#include "qmp-commands.h"
> >> +#include "../qmp-commands.h"
> >>
> >>   PciInfoList *qmp_query_pci(Error **errp)
> >>   {
> > 
> > No. Simply remove */qmp-commands.h. They are relicts from previous builds.
> 
> If make clean didn't help, please patch that instead then.

So, did it fix the problem for you Alex?
Anthony Liguori Nov. 9, 2011, 5:57 p.m. UTC | #4
On 11/09/2011 04:27 AM, Andreas Färber wrote:
> Am 09.11.2011 06:58, schrieb Stefan Weil:
>> Am 09.11.2011 02:38, schrieb Alexander Graf:
>>> Commit 79627472db3 introduced breakage in compiling the s390x-softmmu
>>> target. Instead of compiling, it just throws a lot of errors:
>>>
>>> In file included from /dev/shm/qemu/hw/pci-stub.c:24:
>>> ./qmp-commands.h:3: error: expected identifier or ‘(’ before ‘{’ token
>>> [...]
>>>
>>> This is because we have two files called qmp-commands.h. One resides in
>>> the root directory of the source tree. The other one resides in the
>>> target
>>> build directory.
>>>
>>> Because pci-stub is not built in libhw, pci-stub.c seems to pick up the
>>> qmp-commands.h file from the target build directory which contains only
>>> definitions of qmp commands, not the function stubs.
>>>
>>> This patch at least fixes this breakage for me, allowing me to compile
>>> s390x-softmmu again.
>>>
>>> CC: Luiz Capitulino<lcapitulino@redhat.com>
>>> Signed-off-by: Alexander Graf<agraf@suse.de>
>>> ---
>>>    hw/pci-stub.c |    2 +-
>>>    1 files changed, 1 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/hw/pci-stub.c b/hw/pci-stub.c
>>> index 636171c..ab9789c 100644
>>> --- a/hw/pci-stub.c
>>> +++ b/hw/pci-stub.c
>>> @@ -21,7 +21,7 @@
>>>    #include "sysemu.h"
>>>    #include "monitor.h"
>>>    #include "pci.h"
>>> -#include "qmp-commands.h"
>>> +#include "../qmp-commands.h"
>>>
>>>    PciInfoList *qmp_query_pci(Error **errp)
>>>    {
>>
>> No. Simply remove */qmp-commands.h. They are relicts from previous builds.
>
> If make clean didn't help, please patch that instead then.

make clean is not meant to remove old files from old builds.

Regards,

Anthony Liguori

>
> Andreas
>
Andreas Färber Nov. 9, 2011, 6:01 p.m. UTC | #5
Am 09.11.2011 18:57, schrieb Anthony Liguori:
> On 11/09/2011 04:27 AM, Andreas Färber wrote:
>> Am 09.11.2011 06:58, schrieb Stefan Weil:
>>> Am 09.11.2011 02:38, schrieb Alexander Graf:
>>>> Commit 79627472db3 introduced breakage in compiling the s390x-softmmu
>>>> target. Instead of compiling, it just throws a lot of errors:
>>>>
>>>> In file included from /dev/shm/qemu/hw/pci-stub.c:24:
>>>> ./qmp-commands.h:3: error: expected identifier or ‘(’ before ‘{’ token
>>>> [...]
>>>>
>>>> This is because we have two files called qmp-commands.h. One resides in
>>>> the root directory of the source tree. The other one resides in the
>>>> target
>>>> build directory.
>>>>
>>>> Because pci-stub is not built in libhw, pci-stub.c seems to pick up the
>>>> qmp-commands.h file from the target build directory which contains only
>>>> definitions of qmp commands, not the function stubs.
>>>>
>>>> This patch at least fixes this breakage for me, allowing me to compile
>>>> s390x-softmmu again.
>>>>
>>>> CC: Luiz Capitulino<lcapitulino@redhat.com>
>>>> Signed-off-by: Alexander Graf<agraf@suse.de>
>>>> ---
>>>>    hw/pci-stub.c |    2 +-
>>>>    1 files changed, 1 insertions(+), 1 deletions(-)
>>>>
>>>> diff --git a/hw/pci-stub.c b/hw/pci-stub.c
>>>> index 636171c..ab9789c 100644
>>>> --- a/hw/pci-stub.c
>>>> +++ b/hw/pci-stub.c
>>>> @@ -21,7 +21,7 @@
>>>>    #include "sysemu.h"
>>>>    #include "monitor.h"
>>>>    #include "pci.h"
>>>> -#include "qmp-commands.h"
>>>> +#include "../qmp-commands.h"
>>>>
>>>>    PciInfoList *qmp_query_pci(Error **errp)
>>>>    {
>>>
>>> No. Simply remove */qmp-commands.h. They are relicts from previous
>>> builds.
>>
>> If make clean didn't help, please patch that instead then.
> 
> make clean is not meant to remove old files from old builds.

We have been using it that way in the past and I am not aware of a patch
that removed ancient cleanups, so it's good practice to keep it working
that way.

When I do a git pull I don't know whether or what it may bring. Always
doing make clean just-in-case is simply unproductive.

Regards,
Andreas
Alexander Graf Nov. 9, 2011, 11:12 p.m. UTC | #6
Am 09.11.2011 um 19:01 schrieb Andreas Färber <afaerber@suse.de>:

> Am 09.11.2011 18:57, schrieb Anthony Liguori:
>> On 11/09/2011 04:27 AM, Andreas Färber wrote:
>>> Am 09.11.2011 06:58, schrieb Stefan Weil:
>>>> Am 09.11.2011 02:38, schrieb Alexander Graf:
>>>>> Commit 79627472db3 introduced breakage in compiling the s390x-softmmu
>>>>> target. Instead of compiling, it just throws a lot of errors:
>>>>> 
>>>>> In file included from /dev/shm/qemu/hw/pci-stub.c:24:
>>>>> ./qmp-commands.h:3: error: expected identifier or ‘(’ before ‘{’ token
>>>>> [...]
>>>>> 
>>>>> This is because we have two files called qmp-commands.h. One resides in
>>>>> the root directory of the source tree. The other one resides in the
>>>>> target
>>>>> build directory.
>>>>> 
>>>>> Because pci-stub is not built in libhw, pci-stub.c seems to pick up the
>>>>> qmp-commands.h file from the target build directory which contains only
>>>>> definitions of qmp commands, not the function stubs.
>>>>> 
>>>>> This patch at least fixes this breakage for me, allowing me to compile
>>>>> s390x-softmmu again.
>>>>> 
>>>>> CC: Luiz Capitulino<lcapitulino@redhat.com>
>>>>> Signed-off-by: Alexander Graf<agraf@suse.de>
>>>>> ---
>>>>>   hw/pci-stub.c |    2 +-
>>>>>   1 files changed, 1 insertions(+), 1 deletions(-)
>>>>> 
>>>>> diff --git a/hw/pci-stub.c b/hw/pci-stub.c
>>>>> index 636171c..ab9789c 100644
>>>>> --- a/hw/pci-stub.c
>>>>> +++ b/hw/pci-stub.c
>>>>> @@ -21,7 +21,7 @@
>>>>>   #include "sysemu.h"
>>>>>   #include "monitor.h"
>>>>>   #include "pci.h"
>>>>> -#include "qmp-commands.h"
>>>>> +#include "../qmp-commands.h"
>>>>> 
>>>>>   PciInfoList *qmp_query_pci(Error **errp)
>>>>>   {
>>>> 
>>>> No. Simply remove */qmp-commands.h. They are relicts from previous
>>>> builds.
>>> 
>>> If make clean didn't help, please patch that instead then.
>> 
>> make clean is not meant to remove old files from old builds.
> 
> We have been using it that way in the past and I am not aware of a patch
> that removed ancient cleanups, so it's good practice to keep it working
> that way.
> 
> When I do a git pull I don't know whether or what it may bring. Always
> doing make clean just-in-case is simply unproductive.

I agree. After a git pull the worst case I want to see is that I need to do make defconfig clean. Anything that doesn't clean up this way leaves my build in a broken state, meaning it's a bug to me.

Alex

> 
> Regards,
> Andreas
> 
> -- 
> SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
> GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
Anthony Liguori Nov. 9, 2011, 11:38 p.m. UTC | #7
On 11/09/2011 05:12 PM, Alexander Graf wrote:
>
>> We have been using it that way in the past and I am not aware of a patch
>> that removed ancient cleanups, so it's good practice to keep it working
>> that way.
>>
>> When I do a git pull I don't know whether or what it may bring. Always
>> doing make clean just-in-case is simply unproductive.
>
> I agree. After a git pull the worst case I want to see is that I need to do make defconfig clean. Anything that doesn't clean up this way leaves my build in a broken state, meaning it's a bug to me.

Sorry, but there's no way around this.  This doesn't happen often and emails are 
almost always sent ahead of time.

It's impossible to test something like this because by definition, the code no 
longer lives in the tree.

Regards,

Anthony Liguori

>
> Alex
>
>>
>> Regards,
>> Andreas
>>
>> --
>> SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
>> GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
>
Alexander Graf Nov. 9, 2011, 11:44 p.m. UTC | #8
On 10.11.2011, at 00:38, Anthony Liguori wrote:

> On 11/09/2011 05:12 PM, Alexander Graf wrote:
>> 
>>> We have been using it that way in the past and I am not aware of a patch
>>> that removed ancient cleanups, so it's good practice to keep it working
>>> that way.
>>> 
>>> When I do a git pull I don't know whether or what it may bring. Always
>>> doing make clean just-in-case is simply unproductive.
>> 
>> I agree. After a git pull the worst case I want to see is that I need to do make defconfig clean. Anything that doesn't clean up this way leaves my build in a broken state, meaning it's a bug to me.
> 
> Sorry, but there's no way around this.  This doesn't happen often and emails are almost always sent ahead of time.
> 
> It's impossible to test something like this because by definition, the code no longer lives in the tree.

If we don't want to fix it, then we should remove the object directories for the build targets on git updates.


Alex
Alexander Graf Nov. 9, 2011, 11:45 p.m. UTC | #9
On 09.11.2011, at 13:47, Luiz Capitulino wrote:

> On Wed, 09 Nov 2011 11:27:22 +0100
> Andreas Färber <afaerber@suse.de> wrote:
> 
>> Am 09.11.2011 06:58, schrieb Stefan Weil:
>>> Am 09.11.2011 02:38, schrieb Alexander Graf:
>>>> Commit 79627472db3 introduced breakage in compiling the s390x-softmmu
>>>> target. Instead of compiling, it just throws a lot of errors:
>>>> 
>>>> In file included from /dev/shm/qemu/hw/pci-stub.c:24:
>>>> ./qmp-commands.h:3: error: expected identifier or ‘(’ before ‘{’ token
>>>> [...]
>>>> 
>>>> This is because we have two files called qmp-commands.h. One resides in
>>>> the root directory of the source tree. The other one resides in the
>>>> target
>>>> build directory.
>>>> 
>>>> Because pci-stub is not built in libhw, pci-stub.c seems to pick up the
>>>> qmp-commands.h file from the target build directory which contains only
>>>> definitions of qmp commands, not the function stubs.
>>>> 
>>>> This patch at least fixes this breakage for me, allowing me to compile
>>>> s390x-softmmu again.
>>>> 
>>>> CC: Luiz Capitulino<lcapitulino@redhat.com>
>>>> Signed-off-by: Alexander Graf<agraf@suse.de>
>>>> ---
>>>>  hw/pci-stub.c |    2 +-
>>>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>>> 
>>>> diff --git a/hw/pci-stub.c b/hw/pci-stub.c
>>>> index 636171c..ab9789c 100644
>>>> --- a/hw/pci-stub.c
>>>> +++ b/hw/pci-stub.c
>>>> @@ -21,7 +21,7 @@
>>>>  #include "sysemu.h"
>>>>  #include "monitor.h"
>>>>  #include "pci.h"
>>>> -#include "qmp-commands.h"
>>>> +#include "../qmp-commands.h"
>>>> 
>>>>  PciInfoList *qmp_query_pci(Error **errp)
>>>>  {
>>> 
>>> No. Simply remove */qmp-commands.h. They are relicts from previous builds.
>> 
>> If make clean didn't help, please patch that instead then.
> 
> So, did it fix the problem for you Alex?

Yup :). However, if I run into this other users / developers will too.


Alex
Anthony Liguori Nov. 10, 2011, 12:47 a.m. UTC | #10
On 11/09/2011 05:44 PM, Alexander Graf wrote:
>
> On 10.11.2011, at 00:38, Anthony Liguori wrote:
>
>> On 11/09/2011 05:12 PM, Alexander Graf wrote:
>>>
>>>> We have been using it that way in the past and I am not aware of a patch
>>>> that removed ancient cleanups, so it's good practice to keep it working
>>>> that way.
>>>>
>>>> When I do a git pull I don't know whether or what it may bring. Always
>>>> doing make clean just-in-case is simply unproductive.
>>>
>>> I agree. After a git pull the worst case I want to see is that I need to do make defconfig clean. Anything that doesn't clean up this way leaves my build in a broken state, meaning it's a bug to me.
>>
>> Sorry, but there's no way around this.  This doesn't happen often and emails are almost always sent ahead of time.
>>
>> It's impossible to test something like this because by definition, the code no longer lives in the tree.
>
> If we don't want to fix it, then we should remove the object directories for the build targets on git updates.

I suspect the real problem you're having is that you are building within the src 
directory instead of a separate object directory.

But at any rate, if you do a 'make clean' before a git fetch/merge, you'll also 
be fine.

Regards,

Anthony Liguori

>
>
> Alex
>
>
Anthony Liguori Nov. 10, 2011, 12:51 a.m. UTC | #11
On 11/09/2011 05:45 PM, Alexander Graf wrote:
>
> On 09.11.2011, at 13:47, Luiz Capitulino wrote:
>
>> On Wed, 09 Nov 2011 11:27:22 +0100
>> Andreas Färber<afaerber@suse.de>  wrote:
>>
>>> Am 09.11.2011 06:58, schrieb Stefan Weil:
>>>> Am 09.11.2011 02:38, schrieb Alexander Graf:
>>>>> Commit 79627472db3 introduced breakage in compiling the s390x-softmmu
>>>>> target. Instead of compiling, it just throws a lot of errors:
>>>>>
>>>>> In file included from /dev/shm/qemu/hw/pci-stub.c:24:
>>>>> ./qmp-commands.h:3: error: expected identifier or ‘(’ before ‘{’ token
>>>>> [...]
>>>>>
>>>>> This is because we have two files called qmp-commands.h. One resides in
>>>>> the root directory of the source tree. The other one resides in the
>>>>> target
>>>>> build directory.
>>>>>
>>>>> Because pci-stub is not built in libhw, pci-stub.c seems to pick up the
>>>>> qmp-commands.h file from the target build directory which contains only
>>>>> definitions of qmp commands, not the function stubs.
>>>>>
>>>>> This patch at least fixes this breakage for me, allowing me to compile
>>>>> s390x-softmmu again.
>>>>>
>>>>> CC: Luiz Capitulino<lcapitulino@redhat.com>
>>>>> Signed-off-by: Alexander Graf<agraf@suse.de>
>>>>> ---
>>>>>   hw/pci-stub.c |    2 +-
>>>>>   1 files changed, 1 insertions(+), 1 deletions(-)
>>>>>
>>>>> diff --git a/hw/pci-stub.c b/hw/pci-stub.c
>>>>> index 636171c..ab9789c 100644
>>>>> --- a/hw/pci-stub.c
>>>>> +++ b/hw/pci-stub.c
>>>>> @@ -21,7 +21,7 @@
>>>>>   #include "sysemu.h"
>>>>>   #include "monitor.h"
>>>>>   #include "pci.h"
>>>>> -#include "qmp-commands.h"
>>>>> +#include "../qmp-commands.h"
>>>>>
>>>>>   PciInfoList *qmp_query_pci(Error **errp)
>>>>>   {
>>>>
>>>> No. Simply remove */qmp-commands.h. They are relicts from previous builds.
>>>
>>> If make clean didn't help, please patch that instead then.
>>
>> So, did it fix the problem for you Alex?
>
> Yup :). However, if I run into this other users / developers will too.

That's why I sent this note:

http://mid.gmane.org/4E930612.2090104@codemonkey.ws

So that everyone was aware of this.  If you didn't read the note because you 
don't read every message on qemu-devel religiously (but I mean, doesn't 
everyone), then you should at least filter FYI or ANNOUNCES to a special folders.

I usually try to use an appropriate prefix when it's something that people need 
to look at.  You could also just filter any mail from me because every email I 
send is certainly worth reading ;-)

Regards,

Anthony Liguori

>
>
> Alex
>
>
Stefan Weil Nov. 10, 2011, 6:33 a.m. UTC | #12
Am 10.11.2011 00:45, schrieb Alexander Graf:
>
> On 09.11.2011, at 13:47, Luiz Capitulino wrote:
>
>> On Wed, 09 Nov 2011 11:27:22 +0100
>> Andreas Färber <afaerber@suse.de> wrote:
>>
>>> Am 09.11.2011 06:58, schrieb Stefan Weil:
>>>> Am 09.11.2011 02:38, schrieb Alexander Graf:
>>>>> Commit 79627472db3 introduced breakage in compiling the s390x-softmmu
>>>>> target. Instead of compiling, it just throws a lot of errors:
>>>>>
>>>>> In file included from /dev/shm/qemu/hw/pci-stub.c:24:
>>>>> ./qmp-commands.h:3: error: expected identifier or ‘(’ before ‘{’ token
>>>>> [...]
>>>>>
>>>>> This is because we have two files called qmp-commands.h. One 
>>>>> resides in
>>>>> the root directory of the source tree. The other one resides in the
>>>>> target
>>>>> build directory.
>>>>>
>>>>> Because pci-stub is not built in libhw, pci-stub.c seems to pick 
>>>>> up the
>>>>> qmp-commands.h file from the target build directory which contains 
>>>>> only
>>>>> definitions of qmp commands, not the function stubs.
>>>>>
>>>>> This patch at least fixes this breakage for me, allowing me to compile
>>>>> s390x-softmmu again.
>>>>>
>>>>> CC: Luiz Capitulino<lcapitulino@redhat.com>
>>>>> Signed-off-by: Alexander Graf<agraf@suse.de>
>>>>> ---
>>>>> hw/pci-stub.c | 2 +-
>>>>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>>>>
>>>>> diff --git a/hw/pci-stub.c b/hw/pci-stub.c
>>>>> index 636171c..ab9789c 100644
>>>>> --- a/hw/pci-stub.c
>>>>> +++ b/hw/pci-stub.c
>>>>> @@ -21,7 +21,7 @@
>>>>> #include "sysemu.h"
>>>>> #include "monitor.h"
>>>>> #include "pci.h"
>>>>> -#include "qmp-commands.h"
>>>>> +#include "../qmp-commands.h"
>>>>>
>>>>> PciInfoList *qmp_query_pci(Error **errp)
>>>>> {
>>>>
>>>> No. Simply remove */qmp-commands.h. They are relicts from previous 
>>>> builds.
>>>
>>> If make clean didn't help, please patch that instead then.
>>
>> So, did it fix the problem for you Alex?
>
> Yup :). However, if I run into this other users / developers will too.
>
>
> Alex

Hi Alex,

there is a rather simple solution for this kind of problems:
don't run make in your source tree.

QEMU supports out-of-tree builds since several years now.
So this helps:

# Run the following commands from QEMU's source root directory.
rm -rf bin && mkdir bin && cd bin && ../configure && make

This also allows several build directories with different configurations.
I use for example different trees for fast builds without compiler
optimization and full debugging and for production builds.
By the way: CFLAGS=-g is also very useful for build bots!

bin/debug  # directory configured with --enable-debug and CFLAGS=-g
bin/ndebug # directory with default settings and compiler optimization

Cheers,
Stefan
Andreas Färber Nov. 10, 2011, 9:46 a.m. UTC | #13
Am 10.11.2011 07:33, schrieb Stefan Weil:
> Am 10.11.2011 00:45, schrieb Alexander Graf:
>>
>> On 09.11.2011, at 13:47, Luiz Capitulino wrote:
>>
>>> On Wed, 09 Nov 2011 11:27:22 +0100
>>> Andreas Färber <afaerber@suse.de> wrote:
>>>
>>>> Am 09.11.2011 06:58, schrieb Stefan Weil:
>>>>> No. Simply remove */qmp-commands.h. They are relicts from previous
>>>>> builds.
>>>>
>>>> If make clean didn't help, please patch that instead then.
>>>
>>> So, did it fix the problem for you Alex?
>>
>> Yup :). However, if I run into this other users / developers will too.
>>
>>
>> Alex
> 
> Hi Alex,
> 
> there is a rather simple solution for this kind of problems:
> don't run make in your source tree.
> 
> QEMU supports out-of-tree builds since several years now.
> So this helps:
> 
> # Run the following commands from QEMU's source root directory.
> rm -rf bin && mkdir bin && cd bin && ../configure && make
> 
> This also allows several build directories with different configurations.
> I use for example different trees for fast builds without compiler
> optimization and full debugging and for production builds.
> By the way: CFLAGS=-g is also very useful for build bots!
> 
> bin/debug  # directory configured with --enable-debug and CFLAGS=-g
> bin/ndebug # directory with default settings and compiler optimization

Stefan and Anthony, I usually do build out-of-tree but that suggestion
still ignores the issue that cleaning the build, whether in-tree or
out-of-tree, before a pull defeats the whole purpose of dependency-based
conditional compilation and wastes a lot of time.

Removing these stale generated files should've been something Luis'
patch should've been doing IMO, then it's easily reviewable and
testable; now we can still verify by doing a checkout and build of the
predecessor commit and HEAD, and pulling that in through qemu-trivial
doesn't cost you, Anthony, a lot of time if you don't see our point. :)

Hell, we still clean up dyngen files in Makefile so let's not be too
lazy to clean up things that actually do break the build for core
contributors!

If Alex doesn't beat me I'll look into it next time I have a
long-running test case.

Regards,
Andreas
diff mbox

Patch

diff --git a/hw/pci-stub.c b/hw/pci-stub.c
index 636171c..ab9789c 100644
--- a/hw/pci-stub.c
+++ b/hw/pci-stub.c
@@ -21,7 +21,7 @@ 
 #include "sysemu.h"
 #include "monitor.h"
 #include "pci.h"
-#include "qmp-commands.h"
+#include "../qmp-commands.h"
 
 PciInfoList *qmp_query_pci(Error **errp)
 {