Skip to contentSkip to conversation

Trivial patches for 7 to 19 December 2011

GIT PULL New Stefan Hajnoczi 2 participants 19 messages Dec 19, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

The following changes since commit 5ab97b7f81dccccee03a3f1d03a4d09a27f0eeff:

phys_page_find_alloc: Use correct initial region_offset. (2011-12-15 10:22:40 -0600)

are available in the git repository at:
ssh://repo.or.cz/srv/git/qemu/stefanha.git trivial-patches

Geoffrey Thomas (1):
slirp: Fix typo in net_slirp_hostfwd_remove

Julian Pidancet (1):
Also create piix3 property when Xen is enabled

Michael Ellerman (1):
kvm: Print something before calling abort() if KVM_RUN fails

Paolo Bonzini (1):
ide: drop argument to dma_buf_commit

Peter Maydell (2):
Makefile.target: Remove unnecessary dependency rules
stellaris: Calculate system clock period on reset

Stefan Weil (11):
configure: Fix compiler warnings in config.log (always return a value from main)
configure: Fix compiler warnings in config.log (old-style function definition)
configure: Fix compiler warning in config.log (integer from pointer)
configure: Fix compiler warnings in config.log (null arguments)
configure: Fix compiler warning in config.log (unused variable)
configure: Fix compiler warning in config.log (macro redefined)
configure: Fix compiler warnings in config.log (uninitialized variable)
configure: Fix compiler warning in config.log (undefined NULL)
configure: Fix compiler warning in config.log (value was never used)
configure: Fix compiler warnings in config.log (statement without effect)
configure: Improve Xen autodetection for hosts without Xen

 Makefile.target |    6 ----
 configure       |   71 ++++++++++++++++++++++++++++++++++++++----------------
 hw/ide/core.c   |    6 ++--
 hw/piix_pci.c   |    3 +-
 hw/stellaris.c  |    1 +
 kvm-all.c       |    3 +-
 net/slirp.c     |    2 +-
 7 files changed, 58 insertions(+), 34 deletions(-)
Signature · 1 line
1.7.7.3
#1 lore raw

PATCH 1/17 ide: drop argument to dma_buf_commit

From: Paolo Bonzini <[email protected]>

The argument is unused and even wrong when the function is called by ide_handle_rw_error. Drop it.

---
 hw/ide/core.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
hw/ide/core.c +3 -3
index 49847bd..753c442 100644
@@ -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;
Signature · 1 line
1.7.7.3
#2 lore raw

PATCH 2/17 Makefile.target: Remove unnecessary dependency rules

In reply to Stefan Hajnoczi

From: Peter Maydell <[email protected]>

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.

---
 Makefile.target |    6 ------
 1 files changed, 0 insertions(+), 6 deletions(-)
Makefile.target +0 -6
index 8be9b9a..3261383 100644
@@ -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)
Signature · 1 line
1.7.7.3
#3 lore raw

PATCH 3/17 stellaris: Calculate system clock period on reset

In reply to Stefan Hajnoczi

From: Peter Maydell <[email protected]>

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.

---
 hw/stellaris.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
hw/stellaris.c +1 -0
index ce62a98..7a73074 100644
@@ -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)
Signature · 1 line
1.7.7.3
#4 lore raw

PATCH 4/17 kvm: Print something before calling abort() if KVM_RUN fails

In reply to Stefan Hajnoczi

From: Michael Ellerman <[email protected]>

It's a little unfriendly to call abort() without printing any sort of error message. So turn the DPRINTK() into an fprintf(stderr, ...).

---
 kvm-all.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
kvm-all.c +2 -1
index 4c466d6..ac048bc 100644
@@ -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();
         }
 
Signature · 1 line
1.7.7.3
#5 lore raw

PATCH 5/17 slirp: Fix typo in net_slirp_hostfwd_remove

In reply to Stefan Hajnoczi

From: Geoffrey Thomas <[email protected]>

Report an error when err is nonzero, not when it is zero.

---
 net/slirp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/slirp.c +1 -1
index 6646ecb..18e07ba 100644
@@ -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:
Signature · 1 line
1.7.7.3
#6 lore raw

PATCH 6/17 Also create piix3 property when Xen is enabled

In reply to Stefan Hajnoczi

From: Julian Pidancet <[email protected]>

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);
---
 hw/piix_pci.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
hw/piix_pci.c +1 -2
index d785d4b..ea156a9 100644
@@ -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;
Signature · 1 line
1.7.7.3
#7 lore raw

PATCH 7/17 configure: Fix compiler warnings in config.log (always return a value from main)

In reply to Stefan Hajnoczi

From: Stefan Weil <[email protected]>

Fix several "warning: control reaches end of non-void function".

---
 configure |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
configure +4 -3
index 6fd580e..03b8f35 100755
@@ -1082,7 +1082,7 @@ fi
 
 # check that the C compiler works.
 cat > $TMPC <<EOF
-int main(void) {}
+int main(void) { return 0; }
 EOF
 
 if compile_object ; then
@@ -2651,7 +2651,7 @@ ucontext_coroutine=no
 if test "$darwin" != "yes"; then
   cat > $TMPC << EOF
 #include <ucontext.h>
-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 <fcntl.h>
-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 <linux/magic.h>
 int main(void) {
+  return 0;
 }
 EOF
 if compile_prog "" "" ; then
Signature · 1 line
1.7.7.3
#8 lore raw

PATCH 8/17 configure: Fix compiler warnings in config.log (old-style function definition)

In reply to Stefan Hajnoczi

From: Stefan Weil <[email protected]>

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.

---
 configure |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
configure +2 -2
index 03b8f35..93c6cbe 100755
@@ -1274,11 +1274,11 @@ if test "$nptl" != "no" ; then
   cat > $TMPC <<EOF
 #include <sched.h>
 #include <linux/futex.h>
-void foo()
-{
+int main(void) {
 #if !defined(CLONE_SETTLS) || !defined(FUTEX_WAIT)
 #error bork
 #endif
+  return 0;
 }
 EOF
 
Signature · 1 line
1.7.7.3
#9 lore raw

PATCH 9/17 configure: Fix compiler warning in config.log (integer from pointer)

In reply to Stefan Hajnoczi

From: Stefan Weil <[email protected]>

warning: return makes integer from pointer without a cast

v2: Removed type cast.

---
 configure |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
configure +5 -1
index 93c6cbe..773df6a 100755
@@ -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
Signature · 1 line
1.7.7.3
#10 lore raw

PATCH 10/17 configure: Fix compiler warnings in config.log (null arguments)

In reply to Stefan Hajnoczi

From: Stefan Weil <[email protected]>

warning: null argument where non-null required (argument 1)
warning: null argument where non-null required (argument 3)

---
 configure |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
configure +6 -1
index 773df6a..4e596e6 100755
@@ -1951,7 +1951,12 @@ PTHREADLIBS_LIST="-pthread -lpthread -lpthreadGC2"
 pthread=no
 cat > $TMPC << EOF
 #include <pthread.h>
-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
Signature · 1 line
1.7.7.3
#11 lore raw

PATCH 11/17 configure: Fix compiler warning in config.log (unused variable)

In reply to Stefan Hajnoczi

From: Stefan Weil <[email protected]>

warning: unused variable ‘iov’

---
 configure |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
configure +1 -1
index 4e596e6..f2c2a27 100755
@@ -2060,7 +2060,7 @@ cat > $TMPC <<EOF
 #include <sys/types.h>
 #include <sys/uio.h>
 #include <unistd.h>
-int main(void) { struct iovec iov; return 0; }
+int main(void) { return sizeof(struct iovec); }
 EOF
 iovec=no
 if compile_prog "" "" ; then
Signature · 1 line
1.7.7.3
#12 lore raw

PATCH 12/17 configure: Fix compiler warning in config.log (macro redefined)

In reply to Stefan Hajnoczi

From: Stefan Weil <[email protected]>

warning: "_GNU_SOURCE" redefined

The macro is already defined on the command line.

---
 configure |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
configure +0 -1
index f2c2a27..eeec8fa 100755
@@ -2251,7 +2251,6 @@ fi
 # signalfd probe
 signalfd="no"
 cat > $TMPC << EOF
-#define _GNU_SOURCE
 #include <unistd.h>
 #include <sys/syscall.h>
 #include <signal.h>
Signature · 1 line
1.7.7.3
#13 lore raw

PATCH 13/17 configure: Fix compiler warnings in config.log (uninitialized variable)

In reply to Stefan Hajnoczi

From: Stefan Weil <[email protected]>

warning: ‘fd’ is used uninitialized in this function
warning: ‘id’ is used uninitialized in this function

---
 configure |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
configure +2 -2
index eeec8fa..e3713af 100755
@@ -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 <<EOF
 #include <signal.h>
 #include <time.h>
-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
Signature · 1 line
1.7.7.3
#14 lore raw

PATCH 14/17 configure: Fix compiler warning in config.log (undefined NULL)

In reply to Stefan Hajnoczi

From: Stefan Weil <[email protected]>

Avoid the warning when probing for xfs.

---
 configure |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
configure +1 -0
index e3713af..e9725d4 100755
@@ -1670,6 +1670,7 @@ fi
 # xfsctl() probe, used for raw-posix
 if test "$xfs" != "no" ; then
   cat > $TMPC << EOF
+#include <stddef.h>  /* NULL */
 #include <xfs/xfs.h>
 int main(void)
 {
Signature · 1 line
1.7.7.3
#15 lore raw

PATCH 15/17 configure: Fix compiler warning in config.log (value was never used)

In reply to Stefan Hajnoczi

From: Stefan Weil <[email protected]>

---
 configure |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
configure +1 -2
index e9725d4..bd6f10f 100755
@@ -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
Signature · 1 line
1.7.7.3
#16 lore raw

PATCH 16/17 configure: Fix compiler warnings in config.log (statement without effect)

In reply to Stefan Hajnoczi

From: Stefan Weil <[email protected]>

---
 configure |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
configure +3 -4
index bd6f10f..36ee849 100755
@@ -2074,7 +2074,7 @@ cat > $TMPC <<EOF
 #include <sys/types.h>
 #include <sys/uio.h>
 #include <unistd.h>
-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 <X11/Xlib.h>
 #include <GL/gl.h>
 #include <GL/glx.h>
-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
Signature · 1 line
1.7.7.3
#17 lore raw

PATCH 17/17 configure: Improve Xen autodetection for hosts without Xen

In reply to Stefan Hajnoczi

From: Stefan Weil <[email protected]>

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.

---
 configure |   29 +++++++++++++++++++++++++----
 1 files changed, 25 insertions(+), 4 deletions(-)
configure +25 -4
index 36ee849..640e815 100755
@@ -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 <<EOF
 #include <xenctrl.h>
 #include <xs.h>
+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 <<EOF
+#include <xenctrl.h>
+#include <xs.h>
 #include <stdint.h>
 #include <xen/hvm/hvm_info_table.h>
 #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
Signature · 1 line
1.7.7.3
#18 lore raw
In reply to Stefan Hajnoczi
Quoted 3 lines · Stefan Hajnoczi

The following changes since commit 5ab97b7f81dccccee03a3f1d03a4d09a27f0eeff:

   phys_page_find_alloc: Use correct initial region_offset. (2011-12-15 10:22:40 -0600)

Pulled. Thanks.

Regards,

Anthony Liguori

Quoted 42 lines

are available in the git repository at:
ssh://repo.or.cz/srv/git/qemu/stefanha.git trivial-patches

Geoffrey Thomas (1):
slirp: Fix typo in net_slirp_hostfwd_remove

Julian Pidancet (1):
Also create piix3 property when Xen is enabled

Michael Ellerman (1):
kvm: Print something before calling abort() if KVM_RUN fails

Paolo Bonzini (1):
ide: drop argument to dma_buf_commit

Peter Maydell (2):
Makefile.target: Remove unnecessary dependency rules
stellaris: Calculate system clock period on reset

Stefan Weil (11):
configure: Fix compiler warnings in config.log (always return a value from main)
configure: Fix compiler warnings in config.log (old-style function definition)
configure: Fix compiler warning in config.log (integer from pointer)
configure: Fix compiler warnings in config.log (null arguments)
configure: Fix compiler warning in config.log (unused variable)
configure: Fix compiler warning in config.log (macro redefined)
configure: Fix compiler warnings in config.log (uninitialized variable)
configure: Fix compiler warning in config.log (undefined NULL)
configure: Fix compiler warning in config.log (value was never used)
configure: Fix compiler warnings in config.log (statement without effect)
configure: Improve Xen autodetection for hosts without Xen

  Makefile.target |    6 ----
  configure       |   71 ++++++++++++++++++++++++++++++++++++++----------------
  hw/ide/core.c   |    6 ++--
  hw/piix_pci.c   |    3 +-
  hw/stellaris.c  |    1 +
  kvm-all.c       |    3 +-
  net/slirp.c     |    2 +-
  7 files changed, 58 insertions(+), 34 deletions(-)