pci-stub: fix compile breakage with qmp
PATCH 1/1 pci-stub: fix compile breakage with qmp
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.
--- hw/pci-stub.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
hw/pci-stub.c +1 -1
@@ -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) {
Signature · 1 line
1.6.0.2
Am 09.11.2011 02:38, schrieb Alexander Graf:
Quoted 29 lines
Commit
79627472db3introduced 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.cseems to pick up theqmp-commands.hfile 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<[email protected]>Signed-off-by Alexander Graf<[email protected]>--- hw/pci-stub.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)hw/pci-stub.c +0
-0
hw/pci-stub.c line 27
Quoted 8 lines
hw/pci-stub.c +1
-1@@ -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
Am 09.11.2011 06:58, schrieb Stefan Weil:
Quoted 37 lines
Am 09.11.2011 02:38, schrieb Alexander Graf:
Quoted 36 lines
Commit
79627472db3introduced 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.cseems to pick up theqmp-commands.hfile 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<[email protected]>Signed-off-by Alexander Graf<[email protected]>--- hw/pci-stub.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)hw/pci-stub.c +1
-1@@ -21,7 +21,7 @@#include "sysemu.h" #include "monitor.h" #include "pci.h" -#include "qmp-commands.h" +#include "../qmp-commands.h"
Quoted 4 lines
hw/pci-stub.c line 27
Quoted 2 lines
hw/pci-stub.c +0
-0PciInfoList *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
Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
Quoted 38 lines · On Wed, 09 Nov 2011 11:27:22 +0100 Andreas Färber <[email protected]> wrote:
Am 09.11.2011 06:58, schrieb Stefan Weil:
Quoted 37 lines
Am 09.11.2011 02:38, schrieb Alexander Graf:
Quoted 36 lines
Commit
79627472db3introduced 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.cseems to pick up theqmp-commands.hfile 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<[email protected]>Signed-off-by Alexander Graf<[email protected]>--- hw/pci-stub.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)hw/pci-stub.c +1
-1@@ -21,7 +21,7 @@#include "sysemu.h" #include "monitor.h" #include "pci.h" -#include "qmp-commands.h" +#include "../qmp-commands.h"
Quoted 6 lines
Quoted 4 lines
hw/pci-stub.c line 27
Quoted 2 lines
hw/pci-stub.c +0
-0PciInfoList *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?
Quoted 38 lines · Andreas Färber
Am 09.11.2011 06:58, schrieb Stefan Weil:
Quoted 37 lines
Am 09.11.2011 02:38, schrieb Alexander Graf:
Quoted 36 lines
Commit
79627472db3introduced 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.cseems to pick up theqmp-commands.hfile 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<[email protected]>Signed-off-by Alexander Graf<[email protected]>--- hw/pci-stub.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)hw/pci-stub.c +1
-1@@ -21,7 +21,7 @@#include "sysemu.h" #include "monitor.h" #include "pci.h" -#include "qmp-commands.h" +#include "../qmp-commands.h"
Quoted 6 lines
Quoted 4 lines
hw/pci-stub.c line 27
Quoted 2 lines
hw/pci-stub.c +0
-0PciInfoList *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
Quoted 3 lines
Andreas
Am 09.11.2011 18:57, schrieb Anthony Liguori:
Quoted 45 lines · Andreas Färber
Quoted 44 lines
Am 09.11.2011 06:58, schrieb Stefan Weil:
Quoted 42 lines
Am 09.11.2011 02:38, schrieb Alexander Graf:
Quoted 30 lines
Commit
79627472db3introduced 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.cseems to pick up theqmp-commands.hfile 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<[email protected]>Signed-off-by Alexander Graf<[email protected]>--- hw/pci-stub.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)hw/pci-stub.c +0
-0hw/pci-stub.c line 27
Quoted 8 lines
hw/pci-stub.c +1
-1@@ -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.
Quoted 3 lines
Quoted 1 line
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
Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
Am 09.11.2011 um 19:01 schrieb Andreas Färber <[email protected]>:
Quoted 48 lines
Am 09.11.2011 18:57, schrieb Anthony Liguori:
Quoted 47 lines · Andreas Färber
Quoted 45 lines
Am 09.11.2011 06:58, schrieb Stefan Weil:
Quoted 37 lines
Am 09.11.2011 02:38, schrieb Alexander Graf:
Quoted 36 lines
Commit
79627472db3introduced 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.cseems to pick up theqmp-commands.hfile 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<[email protected]>Signed-off-by Alexander Graf<[email protected]>--- hw/pci-stub.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)hw/pci-stub.c +1
-1@@ -21,7 +21,7 @@#include "sysemu.h" #include "monitor.h" #include "pci.h" -#include "qmp-commands.h" +#include "../qmp-commands.h" Quoted 5 lines
hw/pci-stub.c line 27
Quoted 2 lines
hw/pci-stub.c +0
-0PciInfoList *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.
Quoted 8 lines
Quoted 1 line
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
Quoted 7 lines
Regards,
AndreasSignature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
Quoted 9 lines · Alexander Graf
Quoted 7 lines
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
Quoted 11 lines
Alex
Quoted 7 lines
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
Quoted 6 lines · Anthony Liguori
Quoted 5 lines · Alexander Graf
Quoted 5 lines
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.
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
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
Quoted 41 lines · Luiz Capitulino
Quoted 38 lines · On Wed, 09 Nov 2011 11:27:22 +0100 Andreas Färber <[email protected]> wrote:
Am 09.11.2011 06:58, schrieb Stefan Weil:
Quoted 37 lines
Am 09.11.2011 02:38, schrieb Alexander Graf:
Quoted 36 lines
Commit
79627472db3introduced 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.cseems to pick up theqmp-commands.hfile 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<[email protected]>Signed-off-by Alexander Graf<[email protected]>--- hw/pci-stub.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)hw/pci-stub.c +1
-1@@ -21,7 +21,7 @@#include "sysemu.h" #include "monitor.h" #include "pci.h" -#include "qmp-commands.h" +#include "../qmp-commands.h"
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
hw/pci-stub.c line 27
Quoted 2 lines
hw/pci-stub.c +0
-0PciInfoList *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
Quoted 12 lines · Alexander Graf
Quoted 9 lines · Anthony Liguori
Quoted 8 lines · Alexander Graf
Quoted 7 lines
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.
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
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
Quoted 5 lines
Alex
Quoted 49 lines · Alexander Graf
Quoted 46 lines · Luiz Capitulino
Quoted 43 lines · On Wed, 09 Nov 2011 11:27:22 +0100 Andreas Färber<[email protected]> wrote:
Am 09.11.2011 06:58, schrieb Stefan Weil:
Quoted 41 lines
Am 09.11.2011 02:38, schrieb Alexander Graf:
Quoted 30 lines
Commit
79627472db3introduced 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.cseems to pick up theqmp-commands.hfile 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<[email protected]>Signed-off-by Alexander Graf<[email protected]>--- hw/pci-stub.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)hw/pci-stub.c +0
-0hw/pci-stub.c line 27
Quoted 8 lines
hw/pci-stub.c +1
-1@@ -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.
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
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/[email protected]
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
Quoted 5 lines
Alex
Am 10.11.2011 00:45, schrieb Alexander Graf:
Quoted 49 lines · Luiz Capitulino
Quoted 47 lines
Quoted 43 lines · On Wed, 09 Nov 2011 11:27:22 +0100 Andreas Färber <[email protected]> wrote:
Am 09.11.2011 06:58, schrieb Stefan Weil:
Quoted 41 lines
Am 09.11.2011 02:38, schrieb Alexander Graf:
Quoted 30 lines
Commit
79627472db3introduced 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.cseems to pick up theqmp-commands.hfile 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<[email protected]>Signed-off-by Alexander Graf<[email protected]>---
hw/pci-stub.c| 2 +-1 files changed, 1 insertions(+), 1 deletions(-)hw/pci-stub.c +0
-0hw/pci-stub.c line 27
Quoted 8 lines
hw/pci-stub.c +1
-1@@ -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.
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
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
Am 10.11.2011 07:33, schrieb Stefan Weil:
Quoted 31 lines
Am 10.11.2011 00:45, schrieb Alexander Graf:
Quoted 10 lines · Luiz Capitulino
Quoted 8 lines
Quoted 4 lines · On Wed, 09 Nov 2011 11:27:22 +0100 Andreas Färber <[email protected]> wrote:
Am 09.11.2011 06:58, schrieb Stefan Weil:
Quoted 2 lines
No. Simply remove
*/qmp-commands.h. They are relicts from previous builds.Quoted 8 lines
Quoted 3 lines
Quoted 1 line
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
Quoted 7 lines
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
Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg