Skip to contentSkip to conversation

configure: fix minor issues in Xen checks

PATCH Applied Peter Maydell 3 participants 5 messages Aug 2, 2012 – Aug 4, 2012

lore
Share & tools
lore
#0 lore raw

cover configure: fix minor issues in Xen checks

These patches fix some minor issues in the Xen checks:
* the use of subshells meant that the (not yet committed) "bail out on -Werror failure" check in do_cc didn't actually cause the configure run to stop
* the 4.1 probe code had a set-but-unused-variable warning

Blue: with these two I'm able to do a successful configure on Debian testing even with the 11/11 'make errors cause configure failures' patch.

Peter Maydell (2):
configure: Don't run Xen compile checks in subshells
configure: Fix set-but-not-used warning in Xen 4.1 probe

 configure |   33 ++++++++++++++++-----------------
 1 file changed, 16 insertions(+), 17 deletions(-)
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/2 configure: Don't run Xen compile checks in subshells

The Xen compile checks are currently run inside subshells. This is unnecessary and has the effect that if do_cc() exits with an error message then this only causes the subshell to exit, not the whole of configure, which is confusing. Remove the subshells, changing:
if ( cat ; compile_prog ) ; then ...
to
if cat && compile_prog ; then ...

---
 configure |   30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)
configure +15 -15
index 027a718..c47e440 100755
@@ -1397,8 +1397,8 @@ EOF
     xen=no
 
   # Xen unstable
-  elif (
-      cat > $TMPC <<EOF
+  elif 
+      cat > $TMPC <<EOF &&
 #include <xenctrl.h>
 #include <xenstore.h>
 #include <stdint.h>
@@ -1418,12 +1418,12 @@ int main(void) {
 }
 EOF
       compile_prog "" "$xen_libs"
-    ) ; then
+    then
     xen_ctrl_version=420
     xen=yes
 
-  elif (
-      cat > $TMPC <<EOF
+  elif 
+      cat > $TMPC <<EOF &&
 #include <xenctrl.h>
 #include <xs.h>
 #include <stdint.h>
@@ -1442,13 +1442,13 @@ int main(void) {
 }
 EOF
       compile_prog "" "$xen_libs"
-    ) ; then
+    then
     xen_ctrl_version=410
     xen=yes
 
   # Xen 4.0.0
-  elif (
-      cat > $TMPC <<EOF
+  elif
+      cat > $TMPC <<EOF &&
 #include <xenctrl.h>
 #include <xs.h>
 #include <stdint.h>
@@ -1469,13 +1469,13 @@ int main(void) {
 }
 EOF
       compile_prog "" "$xen_libs"
-    ) ; then
+    then
     xen_ctrl_version=400
     xen=yes
 
   # Xen 3.4.0
-  elif (
-      cat > $TMPC <<EOF
+  elif
+      cat > $TMPC <<EOF &&
 #include <xenctrl.h>
 #include <xs.h>
 int main(void) {
@@ -1491,13 +1491,13 @@ int main(void) {
 }
 EOF
       compile_prog "" "$xen_libs"
-    ) ; then
+    then
     xen_ctrl_version=340
     xen=yes
 
   # Xen 3.3.0
-  elif (
-      cat > $TMPC <<EOF
+  elif
+      cat > $TMPC <<EOF &&
 #include <xenctrl.h>
 #include <xs.h>
 int main(void) {
@@ -1509,7 +1509,7 @@ int main(void) {
 }
 EOF
       compile_prog "" "$xen_libs"
-    ) ; then
+    then
     xen_ctrl_version=330
     xen=yes
 
Signature · 1 line
1.7.9.5
Applied
#2 lore raw

Re: [Qemu-devel] [PATCH 1/2] configure: Don't run Xen compile checks in subshells

Thanks, applied both.

Quoted 108 lines · Peter Maydell

The Xen compile checks are currently run inside subshells. This is unnecessary and has the effect that if do_cc() exits with an error message then this only causes the subshell to exit, not the whole of configure, which is confusing. Remove the subshells, changing:
if ( cat ; compile_prog ) ; then ...
to
if cat && compile_prog ; then ...

---
 configure |   30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)
configure +15 -16
index 027a718..c47e440 100755
@@ -1397,8 +1397,8 @@ EOF
     xen=no
 
   # Xen unstable
-  elif (
-      cat > $TMPC <<EOF
+  elif
+      cat > $TMPC <<EOF &&
 #include <xenctrl.h>
 #include <xenstore.h>
 #include <stdint.h>
@@ -1418,12 +1418,12 @@ int main(void) {
 }
 EOF
       compile_prog "" "$xen_libs"
-    ) ; then
+    then
     xen_ctrl_version=420
     xen=yes
 
-  elif (
-      cat > $TMPC <<EOF
+  elif
+      cat > $TMPC <<EOF &&
 #include <xenctrl.h>
 #include <xs.h>
 #include <stdint.h>
@@ -1442,13 +1442,13 @@ int main(void) {
 }
 EOF
       compile_prog "" "$xen_libs"
-    ) ; then
+    then
     xen_ctrl_version=410
     xen=yes
 
   # Xen 4.0.0
-  elif (
-      cat > $TMPC <<EOF
+  elif
+      cat > $TMPC <<EOF &&
 #include <xenctrl.h>
 #include <xs.h>
 #include <stdint.h>
@@ -1469,13 +1469,13 @@ int main(void) {
 }
 EOF
       compile_prog "" "$xen_libs"
-    ) ; then
+    then
     xen_ctrl_version=400
     xen=yes
 
   # Xen 3.4.0
-  elif (
-      cat > $TMPC <<EOF
+  elif
+      cat > $TMPC <<EOF &&
 #include <xenctrl.h>
 #include <xs.h>
 int main(void) {
@@ -1491,13 +1491,13 @@ int main(void) {
 }
 EOF
       compile_prog "" "$xen_libs"
-    ) ; then
+    then
     xen_ctrl_version=340
     xen=yes
 
   # Xen 3.3.0
-  elif (
-      cat > $TMPC <<EOF
+  elif
+      cat > $TMPC <<EOF &&
 #include <xenctrl.h>
 #include <xs.h>
 int main(void) {
@@ -1509,7 +1509,7 @@ int main(void) {
 }
 EOF
       compile_prog "" "$xen_libs"
-    ) ; then
+    then
     xen_ctrl_version=330
     xen=yes
 
--

1.7.9.5

#3 lore raw

PATCH 2/2 configure: Fix set-but-not-used warning in Xen 4.1 probe

In reply to Peter Maydell

The Xen 4.1 probe never uses the return value from xc_interface_open(), so was provoking a compiler warning on newer gcc. Fix by not bothering to put the return value anywhere.

---
 configure |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
configure +1 -2
index c47e440..fe65ab1 100755
@@ -1432,9 +1432,8 @@ EOF
 # error HVM_MAX_VCPUS not defined
 #endif
 int main(void) {
-  xc_interface *xc;
   xs_daemon_open();
-  xc = xc_interface_open(0, 0, 0);
+  xc_interface_open(0, 0, 0);
   xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0);
   xc_gnttab_open(NULL, 0);
   xc_domain_add_to_physmap(0, 0, XENMAPSPACE_gmfn, 0, 0);
Signature · 1 line
1.7.9.5
Tested-by on the v1 series
#4 lore raw
In reply to Peter Maydell
Quoted 10 lines · Peter Maydell

These patches fix some minor issues in the Xen checks:
* the use of subshells meant that the (not yet committed) "bail out on -Werror failure" check in do_cc didn't actually cause the configure run to stop
* the 4.1 probe code had a set-but-unused-variable warning

Blue: with these two I'm able to do a successful configure on Debian testing even with the 11/11 'make errors cause configure failures' patch.

Quoted 6 lines

Peter Maydell (2):
configure: Don't run Xen compile checks in subshells
configure: Fix set-but-not-used warning in Xen 4.1 probe

 configure |   33 ++++++++++++++++-----------------
 1 file changed, 16 insertions(+), 17 deletions(-)

They are both fine by me.