From b61744b391e9184ac49c52f7eb42722507cc76ee Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Thu, 15 Dec 2011 15:11:16 +0100 Subject: ide: drop argument to dma_buf_commit The argument is unused and even wrong when the function is called by ide_handle_rw_error. Drop it. Signed-off-by: Paolo Bonzini Signed-off-by: Stefan Hajnoczi --- hw/ide/core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/ide/core.c b/hw/ide/core.c index 49847bd3ea..753c442bd5 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -493,7 +493,7 @@ void ide_sector_read(IDEState *s) } } -static void dma_buf_commit(IDEState *s, int is_write) +static void dma_buf_commit(IDEState *s) { qemu_sglist_destroy(&s->sg); } @@ -532,7 +532,7 @@ static int ide_handle_rw_error(IDEState *s, int error, int op) bdrv_iostatus_set_err(s->bs, error); } else { if (op & BM_STATUS_DMA_RETRY) { - dma_buf_commit(s, 0); + dma_buf_commit(s); ide_dma_error(s); } else { ide_rw_error(s); @@ -566,7 +566,7 @@ handle_rw_error: n = s->io_buffer_size >> 9; sector_num = ide_get_sector(s); if (n > 0) { - dma_buf_commit(s, ide_cmd_is_read(s)); + dma_buf_commit(s); sector_num += n; ide_set_sector(s, sector_num); s->nsector -= n; -- cgit v1.2.3 From 7fc3574d065d6744afbab73d8a701ffd94206138 Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Thu, 15 Dec 2011 18:28:52 +0000 Subject: Makefile.target: Remove unnecessary dependency rules Remove some dependency rules which aren't necessary (the automatically generated .d files cover all these). These were leftovers from dyngen days, when the object files also had a dependency on some generated files. Signed-off-by: Peter Maydell Signed-off-by: Stefan Hajnoczi --- Makefile.target | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Makefile.target b/Makefile.target index 8be9b9a596..3261383fd3 100644 --- a/Makefile.target +++ b/Makefile.target @@ -92,12 +92,6 @@ tci-dis.o: QEMU_CFLAGS += -I$(SRC_PATH)/tcg -I$(SRC_PATH)/tcg/tci $(libobj-y): $(GENERATED_HEADERS) -translate.o: translate.c cpu.h - -translate-all.o: translate-all.c cpu.h - -tcg/tcg.o: cpu.h - # HELPER_CFLAGS is used for all the code compiled with static register # variables op_helper.o ldst_helper.o user-exec.o: QEMU_CFLAGS += $(HELPER_CFLAGS) -- cgit v1.2.3 From bfc213af97c5f7768ad7549bc95134cb4e218a76 Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Thu, 15 Dec 2011 18:58:26 +0000 Subject: stellaris: Calculate system clock period on reset Calculate the system clock period on reset; otherwise it remains set to the default value of zero and attempting to use it provokes a hang. This is one of the issues noted in LP:696094. Signed-off-by: Peter Maydell Signed-off-by: Stefan Hajnoczi --- hw/stellaris.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/stellaris.c b/hw/stellaris.c index ce62a98158..7a73074982 100644 --- a/hw/stellaris.c +++ b/hw/stellaris.c @@ -621,6 +621,7 @@ static void ssys_reset(void *opaque) s->rcgc[0] = 1; s->scgc[0] = 1; s->dcgc[0] = 1; + ssys_calculate_system_clock(s); } static int stellaris_sys_post_load(void *opaque, int version_id) -- cgit v1.2.3 From 7b011fbc050d442a20ed5d2a29724570c1557661 Mon Sep 17 00:00:00 2001 From: Michael Ellerman Date: Fri, 16 Dec 2011 11:20:20 +1100 Subject: kvm: Print something before calling abort() if KVM_RUN fails It's a little unfriendly to call abort() without printing any sort of error message. So turn the DPRINTK() into an fprintf(stderr, ...). Signed-off-by: Michael Ellerman Signed-off-by: Stefan Hajnoczi --- kvm-all.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kvm-all.c b/kvm-all.c index 4c466d6aba..ac048bce50 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -977,7 +977,8 @@ int kvm_cpu_exec(CPUState *env) ret = EXCP_INTERRUPT; break; } - DPRINTF("kvm run failed %s\n", strerror(-run_ret)); + fprintf(stderr, "error: kvm run failed %s\n", + strerror(-run_ret)); abort(); } -- cgit v1.2.3 From b15ba6c95147e62671b29580c3b9056773cc496e Mon Sep 17 00:00:00 2001 From: Geoffrey Thomas Date: Sat, 17 Dec 2011 04:23:59 -0500 Subject: slirp: Fix typo in net_slirp_hostfwd_remove Report an error when err is nonzero, not when it is zero. Signed-off-by: Geoffrey Thomas Signed-off-by: Stefan Hajnoczi --- net/slirp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/slirp.c b/net/slirp.c index 6646ecb1c8..18e07ba609 100644 --- a/net/slirp.c +++ b/net/slirp.c @@ -351,7 +351,7 @@ void net_slirp_hostfwd_remove(Monitor *mon, const QDict *qdict) host_addr, host_port); monitor_printf(mon, "host forwarding rule for %s %s\n", src_str, - err ? "removed" : "not found"); + err ? "not found" : "removed"); return; fail_syntax: -- cgit v1.2.3 From 8ceb49fe4597e643aab5308b38f84de5d13a39b4 Mon Sep 17 00:00:00 2001 From: Julian Pidancet Date: Sun, 18 Dec 2011 18:08:44 +0000 Subject: Also create piix3 property when Xen is enabled This recently added line in hw/pc_piix.c is causing a SEGV on a Xen setup because the piix3 property is never created: qdev_property_add_child(qdev_resolve_path("/i440fx/piix3", NULL), "rtc", (DeviceState *)rtc_state, NULL); Signed-off-by: Julian Pidancet Signed-off-by: Stefan Hajnoczi --- hw/piix_pci.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/piix_pci.c b/hw/piix_pci.c index d785d4ba07..ea156a9373 100644 --- a/hw/piix_pci.c +++ b/hw/piix_pci.c @@ -324,9 +324,8 @@ static PCIBus *i440fx_common_init(const char *device_name, pci_create_simple_multifunction(b, -1, true, "PIIX3")); pci_bus_irqs(b, piix3_set_irq, pci_slot_get_pirq, piix3, PIIX_NUM_PIRQS); - - qdev_property_add_child(dev, "piix3", &piix3->dev.qdev, NULL); } + qdev_property_add_child(dev, "piix3", &piix3->dev.qdev, NULL); piix3->pic = pic; (*pi440fx_state)->piix3 = piix3; -- cgit v1.2.3 From 75cafad74d8df3f8ea188ed355127b91c9903290 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Sat, 17 Dec 2011 09:27:29 +0100 Subject: configure: Fix compiler warnings in config.log (always return a value from main) Fix several "warning: control reaches end of non-void function". Signed-off-by: Stefan Weil Signed-off-by: Stefan Hajnoczi --- configure | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/configure b/configure index 6fd580e3a6..03b8f35748 100755 --- a/configure +++ b/configure @@ -1082,7 +1082,7 @@ fi # check that the C compiler works. cat > $TMPC < $TMPC << EOF #include -int main(void) { makecontext(0, 0, 0); } +int main(void) { makecontext(0, 0, 0); return 0; } EOF if compile_prog "" "" ; then ucontext_coroutine=yes @@ -2664,7 +2664,7 @@ fi open_by_hande_at=no cat > $TMPC << EOF #include -int main(void) { struct file_handle fh; open_by_handle_at(0, &fh, 0); } +int main(void) { struct file_handle fh; return open_by_handle_at(0, &fh, 0); } EOF if compile_prog "" "" ; then open_by_handle_at=yes @@ -2677,6 +2677,7 @@ linux_magic_h=no cat > $TMPC << EOF #include int main(void) { + return 0; } EOF if compile_prog "" "" ; then -- cgit v1.2.3 From 182eacc0fdd860ac60fa6fcf40429caa15e8328a Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Sat, 17 Dec 2011 09:27:30 +0100 Subject: configure: Fix compiler warnings in config.log (old-style function definition) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit warning: function declaration isn’t a prototype In function ‘foo’: warning: old-style function definition The function name was changed, too, to avoid an additional warning. Signed-off-by: Stefan Weil Signed-off-by: Stefan Hajnoczi --- configure | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 03b8f35748..93c6cbec30 100755 --- a/configure +++ b/configure @@ -1274,11 +1274,11 @@ if test "$nptl" != "no" ; then cat > $TMPC < #include -void foo() -{ +int main(void) { #if !defined(CLONE_SETTLS) || !defined(FUTEX_WAIT) #error bork #endif + return 0; } EOF -- cgit v1.2.3 From ef9a252442c84af64216fc3e9c5c2283cbb30995 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Sat, 17 Dec 2011 17:46:02 +0100 Subject: configure: Fix compiler warning in config.log (integer from pointer) warning: return makes integer from pointer without a cast v2: Removed type cast. Signed-off-by: Stefan Weil Signed-off-by: Stefan Hajnoczi --- configure | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 93c6cbec30..773df6a0e8 100755 --- a/configure +++ b/configure @@ -1841,7 +1841,11 @@ if test "$curses" != "no" ; then #ifdef __OpenBSD__ #define resize_term resizeterm #endif -int main(void) { resize_term(0, 0); return curses_version(); } +int main(void) { + const char *s = curses_version(); + resize_term(0, 0); + return s != 0; +} EOF for curses_lib in $curses_list; do if compile_prog "" "$curses_lib" ; then -- cgit v1.2.3 From 7a42bbe4515168390ce1c3f65b15ebc08db625ce Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Sat, 17 Dec 2011 09:27:32 +0100 Subject: configure: Fix compiler warnings in config.log (null arguments) warning: null argument where non-null required (argument 1) warning: null argument where non-null required (argument 3) Signed-off-by: Stefan Weil Signed-off-by: Stefan Hajnoczi --- configure | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 773df6a0e8..4e596e6326 100755 --- a/configure +++ b/configure @@ -1951,7 +1951,12 @@ PTHREADLIBS_LIST="-pthread -lpthread -lpthreadGC2" pthread=no cat > $TMPC << EOF #include -int main(void) { pthread_create(0,0,0,0); return 0; } +static void *f(void *p) { return NULL; } +int main(void) { + pthread_t thread; + pthread_create(&thread, 0, f, 0); + return 0; +} EOF if compile_prog "" "" ; then pthread=yes -- cgit v1.2.3 From f91f9bee0c614da0dab6208a7a7fa00e3d207408 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Sat, 17 Dec 2011 09:27:33 +0100 Subject: configure: Fix compiler warning in config.log (unused variable) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit warning: unused variable ‘iov’ Signed-off-by: Stefan Weil Signed-off-by: Stefan Hajnoczi --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 4e596e6326..f2c2a27824 100755 --- a/configure +++ b/configure @@ -2060,7 +2060,7 @@ cat > $TMPC < #include #include -int main(void) { struct iovec iov; return 0; } +int main(void) { return sizeof(struct iovec); } EOF iovec=no if compile_prog "" "" ; then -- cgit v1.2.3 From ed054defef32c723c0c467676717c5ddeb8dcd18 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Sat, 17 Dec 2011 09:27:34 +0100 Subject: configure: Fix compiler warning in config.log (macro redefined) warning: "_GNU_SOURCE" redefined The macro is already defined on the command line. Signed-off-by: Stefan Weil Signed-off-by: Stefan Hajnoczi --- configure | 1 - 1 file changed, 1 deletion(-) diff --git a/configure b/configure index f2c2a27824..eeec8faf55 100755 --- a/configure +++ b/configure @@ -2251,7 +2251,6 @@ fi # signalfd probe signalfd="no" cat > $TMPC << EOF -#define _GNU_SOURCE #include #include #include -- cgit v1.2.3 From 66ea0f223b2521a2277839e568144773fecc8429 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Sat, 17 Dec 2011 09:27:35 +0100 Subject: configure: Fix compiler warnings in config.log (uninitialized variable) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit warning: ‘fd’ is used uninitialized in this function warning: ‘id’ is used uninitialized in this function Signed-off-by: Stefan Weil Signed-off-by: Stefan Hajnoczi --- configure | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure b/configure index eeec8faf55..e3713afd3e 100755 --- a/configure +++ b/configure @@ -2237,7 +2237,7 @@ cat > $TMPC << EOF int main(void) { - int len, fd; + int len, fd = 0; len = tee(STDIN_FILENO, STDOUT_FILENO, INT_MAX, SPLICE_F_NONBLOCK); splice(STDIN_FILENO, NULL, fd, NULL, len, SPLICE_F_MOVE); return 0; @@ -2449,7 +2449,7 @@ fi cat > $TMPC < #include -int main(void) { clockid_t id; return clock_gettime(id, NULL); } +int main(void) { return clock_gettime(CLOCK_REALTIME, NULL); } EOF if compile_prog "" "" ; then -- cgit v1.2.3 From ffc41d10b01b9c72a7dd412b271164530c14bdb8 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Sat, 17 Dec 2011 09:27:36 +0100 Subject: configure: Fix compiler warning in config.log (undefined NULL) Avoid the warning when probing for xfs. Signed-off-by: Stefan Weil Signed-off-by: Stefan Hajnoczi --- configure | 1 + 1 file changed, 1 insertion(+) diff --git a/configure b/configure index e3713afd3e..e9725d4480 100755 --- a/configure +++ b/configure @@ -1670,6 +1670,7 @@ fi # xfsctl() probe, used for raw-posix if test "$xfs" != "no" ; then cat > $TMPC << EOF +#include /* NULL */ #include int main(void) { -- cgit v1.2.3 From 55cc7f3ed228ac52ffb766ba9113c2ed88dfa846 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Sat, 17 Dec 2011 09:27:37 +0100 Subject: configure: Fix compiler warning in config.log (value was never used) Signed-off-by: Stefan Weil Signed-off-by: Stefan Hajnoczi --- configure | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/configure b/configure index e9725d4480..bd6f10fa7c 100755 --- a/configure +++ b/configure @@ -2269,8 +2269,7 @@ cat > $TMPC << EOF int main(void) { - int efd = eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC); - return 0; + return eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC); } EOF if compile_prog "" "" ; then -- cgit v1.2.3 From 84972cbb06046ad7b60e9c388509b9b96fa0510d Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Sat, 17 Dec 2011 09:27:38 +0100 Subject: configure: Fix compiler warnings in config.log (statement without effect) Signed-off-by: Stefan Weil Signed-off-by: Stefan Hajnoczi --- configure | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/configure b/configure index bd6f10fa7c..36ee849864 100755 --- a/configure +++ b/configure @@ -2074,7 +2074,7 @@ cat > $TMPC < #include #include -int main(void) { preadv; } +int main(void) { return preadv == preadv; } EOF preadv=no if compile_prog "" "" ; then @@ -2107,7 +2107,7 @@ if test "$opengl" != "no" ; then #include #include #include -int main(void) { GL_VERSION; return 0; } +int main(void) { return GL_VERSION != 0; } EOF if compile_prog "" "-lGL" ; then opengl=yes @@ -2369,8 +2369,7 @@ int main(void) * warning but not an error, and will proceed to fail the * qemu compile where we compile with -Werror.) */ - epoll_create1; - return 0; + return epoll_create1 == epoll_create1; } EOF if compile_prog "$ARCH_CFLAGS" "" ; then -- cgit v1.2.3 From 50ced5b3b108aba7f9b2c8e6f7de4e924f30f83b Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Sat, 17 Dec 2011 09:27:39 +0100 Subject: configure: Improve Xen autodetection for hosts without Xen With this patch, it only takes one test (instead of four) to detect that there is no Xen support at all. For most build hosts, this will reduce the time configure needs. It will also reduce noisy output in config.log. Build hosts with Xen now need up to five (instead of up to four) tests. They get improved diagnostics when Xen support fails. Cc: Stefano Stabellini Signed-off-by: Stefan Weil Signed-off-by: Stefan Hajnoczi --- configure | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/configure b/configure index 36ee849864..640e81536d 100755 --- a/configure +++ b/configure @@ -1317,10 +1317,30 @@ fi if test "$xen" != "no" ; then xen_libs="-lxenstore -lxenctrl -lxenguest" - # Xen unstable + # First we test whether Xen headers and libraries are available. + # If no, we are done and there is no Xen support. + # If yes, more tests are run to detect the Xen version. + + # Xen (any) cat > $TMPC < #include +int main(void) { + return 0; +} +EOF + if ! compile_prog "" "$xen_libs" ; then + # Xen not found + if test "$xen" = "yes" ; then + feature_not_found "xen" + fi + xen=no + + # Xen unstable + elif ( + cat > $TMPC < +#include #include #include #if !defined(HVM_MAX_VCPUS) @@ -1336,7 +1356,8 @@ int main(void) { return 0; } EOF - if compile_prog "" "$xen_libs" ; then + compile_prog "" "$xen_libs" + ) ; then xen_ctrl_version=410 xen=yes @@ -1407,10 +1428,10 @@ EOF xen_ctrl_version=330 xen=yes - # Xen not found or unsupported + # Xen version unsupported else if test "$xen" = "yes" ; then - feature_not_found "xen" + feature_not_found "xen (unsupported version)" fi xen=no fi -- cgit v1.2.3